b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/* $XdotOrg: xserver/xorg/hw/xfree86/os-support/solaris/agpgart.h,v 1.2 2005/07/01 22:43:25 daniels Exp $ */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/*
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * AGPGART module version 0.99
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * Copyright (C) 1999 Jeff Hartmann
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * Copyright (C) 1999 Precision Insight, Inc.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * Copyright (C) 1999 Xi Graphics, Inc.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync *
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * Permission is hereby granted, free of charge, to any person obtaining a
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * copy of this software and associated documentation files (the "Software"),
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * to deal in the Software without restriction, including without limitation
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * the rights to use, copy, modify, merge, publish, distribute, sublicense,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * and/or sell copies of the Software, and to permit persons to whom the
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * Software is furnished to do so, subject to the following conditions:
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync *
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * The above copyright notice and this permission notice shall be included
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * in all copies or substantial portions of the Software.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync *
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * JEFF HARTMANN, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/*
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync *
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * Permission is hereby granted, free of charge, to any person obtaining a
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * copy of this software and associated documentation files (the
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * "Software"), to deal in the Software without restriction, including
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * without limitation the rights to use, copy, modify, merge, publish,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * distribute, and/or sell copies of the Software, and to permit persons
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * to whom the Software is furnished to do so, provided that the above
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * copyright notice(s) and this permission notice appear in all copies of
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * the Software and that both the above copyright notice(s) and this
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * permission notice appear in supporting documentation.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync *
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync *
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * Except as contained in this notice, the name of a copyright holder
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * shall not be used in advertising or otherwise to promote the sale, use
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * or other dealings in this Software without prior written authorization
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * of the copyright holder.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#ifndef _AGPGART_H
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define _AGPGART_H
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#pragma ident "@(#)agpgart.h 1.1 05/04/04 SMI"
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef struct _agp_version {
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync uint16_t agpv_major;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync uint16_t agpv_minor;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync} agp_version_t;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef struct _agp_info {
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync agp_version_t agpi_version;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync uint32_t agpi_devid; /* bridge vendor + device */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync uint32_t agpi_mode; /* mode of bridge */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ulong_t agpi_aperbase; /* base of aperture */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync size_t agpi_apersize; /* aperture range size */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync uint32_t agpi_pgtotal; /* max number of pages in aperture */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync uint32_t agpi_pgsystem; /* same as pg_total */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync uint32_t agpi_pgused; /* NUMBER of currently used pages */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync} agp_info_t;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef struct _agp_setup {
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync uint32_t agps_mode;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync} agp_setup_t;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef struct _agp_allocate {
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int32_t agpa_key;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync uint32_t agpa_pgcount;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync uint32_t agpa_type;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync uint32_t agpa_physical; /* for i810/830 driver */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync} agp_allocate_t;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef struct _agp_bind {
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int32_t agpb_key;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync uint32_t agpb_pgstart;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync} agp_bind_t;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef struct _agp_unbind {
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int32_t agpu_key;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync uint32_t agpu_pri; /* no use in solaris */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync} agp_unbind_t;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define AGPIOC_BASE 'G'
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define AGPIOC_INFO _IOR(AGPIOC_BASE, 0, 100)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define AGPIOC_ACQUIRE _IO(AGPIOC_BASE, 1)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define AGPIOC_RELEASE _IO(AGPIOC_BASE, 2)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define AGPIOC_SETUP _IOW(AGPIOC_BASE, 3, agp_setup_t)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define AGPIOC_ALLOCATE _IOWR(AGPIOC_BASE, 4, agp_allocate_t)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define AGPIOC_DEALLOCATE _IOW(AGPIOC_BASE, 5, int)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define AGPIOC_BIND _IOW(AGPIOC_BASE, 6, agp_bind_t)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define AGPIOC_UNBIND _IOW(AGPIOC_BASE, 7, agp_unbind_t)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define AGP_DEVICE "/dev/agpgart"
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#endif /* _AGPGART_H */