1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 #ifndef _UAPI_AGP_H
28 #define _UAPI_AGP_H
29
30 #define AGPIOC_BASE 'A'
31 #define AGPIOC_INFO _IOR (AGPIOC_BASE, 0, struct agp_info*)
32 #define AGPIOC_ACQUIRE _IO (AGPIOC_BASE, 1)
33 #define AGPIOC_RELEASE _IO (AGPIOC_BASE, 2)
34 #define AGPIOC_SETUP _IOW (AGPIOC_BASE, 3, struct agp_setup*)
35 #define AGPIOC_RESERVE _IOW (AGPIOC_BASE, 4, struct agp_region*)
36 #define AGPIOC_PROTECT _IOW (AGPIOC_BASE, 5, struct agp_region*)
37 #define AGPIOC_ALLOCATE _IOWR(AGPIOC_BASE, 6, struct agp_allocate*)
38 #define AGPIOC_DEALLOCATE _IOW (AGPIOC_BASE, 7, int)
39 #define AGPIOC_BIND _IOW (AGPIOC_BASE, 8, struct agp_bind*)
40 #define AGPIOC_UNBIND _IOW (AGPIOC_BASE, 9, struct agp_unbind*)
41 #define AGPIOC_CHIPSET_FLUSH _IO (AGPIOC_BASE, 10)
42
43 #define AGP_DEVICE "/dev/agpgart"
44
45 #ifndef TRUE
46 #define TRUE 1
47 #endif
48
49 #ifndef FALSE
50 #define FALSE 0
51 #endif
52
53 #ifndef __KERNEL__
54 #include <linux/types.h>
55 #include <stdlib.h>
56
57 struct agp_version {
58 __u16 major;
59 __u16 minor;
60 };
61
62 typedef struct _agp_info {
63 struct agp_version version;
64 __u32 bridge_id;
65 __u32 agp_mode;
66 unsigned long aper_base;
67 size_t aper_size;
68 size_t pg_total;
69 size_t pg_system;
70 size_t pg_used;
71 } agp_info;
72
73 typedef struct _agp_setup {
74 __u32 agp_mode;
75 } agp_setup;
76
77
78
79
80 typedef struct _agp_segment {
81 __kernel_off_t pg_start;
82 __kernel_size_t pg_count;
83 int prot;
84 } agp_segment;
85
86 typedef struct _agp_region {
87 __kernel_pid_t pid;
88 __kernel_size_t seg_count;
89 struct _agp_segment *seg_list;
90 } agp_region;
91
92 typedef struct _agp_allocate {
93 int key;
94 __kernel_size_t pg_count;
95 __u32 type;
96 __u32 physical;
97
98
99
100 } agp_allocate;
101
102 typedef struct _agp_bind {
103 int key;
104 __kernel_off_t pg_start;
105 } agp_bind;
106
107 typedef struct _agp_unbind {
108 int key;
109 __u32 priority;
110 } agp_unbind;
111
112 #endif
113
114 #endif