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