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