xref: /utopia/UTPA2-700.0.x/projects/tools/lint/mips-linux-gnu_include/linux/agpgart.h (revision 53ee8cc121a030b8d368113ac3e966b4705770ef)
1*53ee8cc1Swenshuai.xi /*
2*53ee8cc1Swenshuai.xi  * AGPGART module version 0.99
3*53ee8cc1Swenshuai.xi  * Copyright (C) 1999 Jeff Hartmann
4*53ee8cc1Swenshuai.xi  * Copyright (C) 1999 Precision Insight, Inc.
5*53ee8cc1Swenshuai.xi  * Copyright (C) 1999 Xi Graphics, Inc.
6*53ee8cc1Swenshuai.xi  *
7*53ee8cc1Swenshuai.xi  * Permission is hereby granted, free of charge, to any person obtaining a
8*53ee8cc1Swenshuai.xi  * copy of this software and associated documentation files (the "Software"),
9*53ee8cc1Swenshuai.xi  * to deal in the Software without restriction, including without limitation
10*53ee8cc1Swenshuai.xi  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11*53ee8cc1Swenshuai.xi  * and/or sell copies of the Software, and to permit persons to whom the
12*53ee8cc1Swenshuai.xi  * Software is furnished to do so, subject to the following conditions:
13*53ee8cc1Swenshuai.xi  *
14*53ee8cc1Swenshuai.xi  * The above copyright notice and this permission notice shall be included
15*53ee8cc1Swenshuai.xi  * in all copies or substantial portions of the Software.
16*53ee8cc1Swenshuai.xi  *
17*53ee8cc1Swenshuai.xi  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18*53ee8cc1Swenshuai.xi  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19*53ee8cc1Swenshuai.xi  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
20*53ee8cc1Swenshuai.xi  * JEFF HARTMANN, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM,
21*53ee8cc1Swenshuai.xi  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
22*53ee8cc1Swenshuai.xi  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
23*53ee8cc1Swenshuai.xi  * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24*53ee8cc1Swenshuai.xi  *
25*53ee8cc1Swenshuai.xi  */
26*53ee8cc1Swenshuai.xi 
27*53ee8cc1Swenshuai.xi #ifndef _AGP_H
28*53ee8cc1Swenshuai.xi #define _AGP_H 1
29*53ee8cc1Swenshuai.xi 
30*53ee8cc1Swenshuai.xi #define AGPIOC_BASE       'A'
31*53ee8cc1Swenshuai.xi #define AGPIOC_INFO       _IOR (AGPIOC_BASE, 0, struct agp_info*)
32*53ee8cc1Swenshuai.xi #define AGPIOC_ACQUIRE    _IO  (AGPIOC_BASE, 1)
33*53ee8cc1Swenshuai.xi #define AGPIOC_RELEASE    _IO  (AGPIOC_BASE, 2)
34*53ee8cc1Swenshuai.xi #define AGPIOC_SETUP      _IOW (AGPIOC_BASE, 3, struct agp_setup*)
35*53ee8cc1Swenshuai.xi #define AGPIOC_RESERVE    _IOW (AGPIOC_BASE, 4, struct agp_region*)
36*53ee8cc1Swenshuai.xi #define AGPIOC_PROTECT    _IOW (AGPIOC_BASE, 5, struct agp_region*)
37*53ee8cc1Swenshuai.xi #define AGPIOC_ALLOCATE   _IOWR(AGPIOC_BASE, 6, struct agp_allocate*)
38*53ee8cc1Swenshuai.xi #define AGPIOC_DEALLOCATE _IOW (AGPIOC_BASE, 7, int)
39*53ee8cc1Swenshuai.xi #define AGPIOC_BIND       _IOW (AGPIOC_BASE, 8, struct agp_bind*)
40*53ee8cc1Swenshuai.xi #define AGPIOC_UNBIND     _IOW (AGPIOC_BASE, 9, struct agp_unbind*)
41*53ee8cc1Swenshuai.xi #define AGPIOC_CHIPSET_FLUSH _IO (AGPIOC_BASE, 10)
42*53ee8cc1Swenshuai.xi 
43*53ee8cc1Swenshuai.xi #define AGP_DEVICE      "/dev/agpgart"
44*53ee8cc1Swenshuai.xi 
45*53ee8cc1Swenshuai.xi #ifndef TRUE
46*53ee8cc1Swenshuai.xi #define TRUE 1
47*53ee8cc1Swenshuai.xi #endif
48*53ee8cc1Swenshuai.xi 
49*53ee8cc1Swenshuai.xi #ifndef FALSE
50*53ee8cc1Swenshuai.xi #define FALSE 0
51*53ee8cc1Swenshuai.xi #endif
52*53ee8cc1Swenshuai.xi 
53*53ee8cc1Swenshuai.xi #include <linux/types.h>
54*53ee8cc1Swenshuai.xi #include <asm/types.h>
55*53ee8cc1Swenshuai.xi 
56*53ee8cc1Swenshuai.xi struct agp_version {
57*53ee8cc1Swenshuai.xi 	__u16 major;
58*53ee8cc1Swenshuai.xi 	__u16 minor;
59*53ee8cc1Swenshuai.xi };
60*53ee8cc1Swenshuai.xi 
61*53ee8cc1Swenshuai.xi typedef struct _agp_info {
62*53ee8cc1Swenshuai.xi 	struct agp_version version;	/* version of the driver        */
63*53ee8cc1Swenshuai.xi 	__u32 bridge_id;	/* bridge vendor/device         */
64*53ee8cc1Swenshuai.xi 	__u32 agp_mode;		/* mode info of bridge          */
65*53ee8cc1Swenshuai.xi 	unsigned long aper_base;/* base of aperture             */
66*53ee8cc1Swenshuai.xi 	size_t aper_size;	/* size of aperture             */
67*53ee8cc1Swenshuai.xi 	size_t pg_total;	/* max pages (swap + system)    */
68*53ee8cc1Swenshuai.xi 	size_t pg_system;	/* max pages (system)           */
69*53ee8cc1Swenshuai.xi 	size_t pg_used;		/* current pages used           */
70*53ee8cc1Swenshuai.xi } agp_info;
71*53ee8cc1Swenshuai.xi 
72*53ee8cc1Swenshuai.xi typedef struct _agp_setup {
73*53ee8cc1Swenshuai.xi 	__u32 agp_mode;		/* mode info of bridge          */
74*53ee8cc1Swenshuai.xi } agp_setup;
75*53ee8cc1Swenshuai.xi 
76*53ee8cc1Swenshuai.xi /*
77*53ee8cc1Swenshuai.xi  * The "prot" down below needs still a "sleep" flag somehow ...
78*53ee8cc1Swenshuai.xi  */
79*53ee8cc1Swenshuai.xi typedef struct _agp_segment {
80*53ee8cc1Swenshuai.xi 	off_t pg_start;		/* starting page to populate    */
81*53ee8cc1Swenshuai.xi 	size_t pg_count;	/* number of pages              */
82*53ee8cc1Swenshuai.xi 	int prot;		/* prot flags for mmap          */
83*53ee8cc1Swenshuai.xi } agp_segment;
84*53ee8cc1Swenshuai.xi 
85*53ee8cc1Swenshuai.xi typedef struct _agp_region {
86*53ee8cc1Swenshuai.xi 	pid_t pid;		/* pid of process               */
87*53ee8cc1Swenshuai.xi 	size_t seg_count;	/* number of segments           */
88*53ee8cc1Swenshuai.xi 	struct _agp_segment *seg_list;
89*53ee8cc1Swenshuai.xi } agp_region;
90*53ee8cc1Swenshuai.xi 
91*53ee8cc1Swenshuai.xi typedef struct _agp_allocate {
92*53ee8cc1Swenshuai.xi 	int key;		/* tag of allocation            */
93*53ee8cc1Swenshuai.xi 	size_t pg_count;	/* number of pages              */
94*53ee8cc1Swenshuai.xi 	__u32 type;		/* 0 == normal, other devspec   */
95*53ee8cc1Swenshuai.xi    	__u32 physical;         /* device specific (some devices
96*53ee8cc1Swenshuai.xi 				 * need a phys address of the
97*53ee8cc1Swenshuai.xi 				 * actual page behind the gatt
98*53ee8cc1Swenshuai.xi 				 * table)                        */
99*53ee8cc1Swenshuai.xi } agp_allocate;
100*53ee8cc1Swenshuai.xi 
101*53ee8cc1Swenshuai.xi typedef struct _agp_bind {
102*53ee8cc1Swenshuai.xi 	int key;		/* tag of allocation            */
103*53ee8cc1Swenshuai.xi 	off_t pg_start;		/* starting page to populate    */
104*53ee8cc1Swenshuai.xi } agp_bind;
105*53ee8cc1Swenshuai.xi 
106*53ee8cc1Swenshuai.xi typedef struct _agp_unbind {
107*53ee8cc1Swenshuai.xi 	int key;		/* tag of allocation            */
108*53ee8cc1Swenshuai.xi 	__u32 priority;		/* priority for paging out      */
109*53ee8cc1Swenshuai.xi } agp_unbind;
110*53ee8cc1Swenshuai.xi 
111*53ee8cc1Swenshuai.xi 
112*53ee8cc1Swenshuai.xi #endif				/* _AGP_H */
113