29 #include <linux/kernel.h>
30 #include <linux/pci.h>
32 #include <linux/agpgart.h>
33 #include <linux/slab.h>
34 #include <asm/uaccess.h>
45 userinfo.version.major = kerninfo.version.major;
46 userinfo.version.minor = kerninfo.version.minor;
47 userinfo.bridge_id = kerninfo.device->vendor |
48 (kerninfo.device->device << 16);
49 userinfo.agp_mode = kerninfo.mode;
51 userinfo.aper_size = kerninfo.aper_size;
52 userinfo.pg_total = userinfo.pg_system = kerninfo.max_memory;
53 userinfo.pg_used = kerninfo.current_memory;
61 static int compat_agpioc_reserve_wrap(
struct agp_file_private *priv,
void __user *arg)
72 if ((
unsigned) ureserve.seg_count >= ~0
U/
sizeof(
struct agp_segment32))
75 kreserve.pid = ureserve.pid;
76 kreserve.seg_count = ureserve.seg_count;
80 if (kreserve.seg_count == 0) {
84 if (client_priv !=
NULL) {
98 if (ureserve.seg_count >= 16384)
112 sizeof(*usegment) * ureserve.seg_count)) {
118 for (seg = 0; seg < ureserve.seg_count; seg++) {
125 kreserve.seg_list = ksegment;
127 if (client ==
NULL) {
131 if (client ==
NULL) {
137 if (client_priv !=
NULL) {
148 static int compat_agpioc_allocate_wrap(
struct agp_file_private *priv,
void __user *arg)
162 alloc.key = memory->
key;
172 static int compat_agpioc_bind_wrap(
struct agp_file_private *priv,
void __user *arg)
189 static int compat_agpioc_unbind_wrap(
struct agp_file_private *priv,
void __user *arg)
218 if ((
agp_fe.backend_acquired !=
true) &&
231 if (
agp_fe.current_controller->pid != curr_priv->
my_pid) {
239 ret_val = compat_agpioc_info_wrap(curr_priv, (
void __user *) arg);
255 ret_val = compat_agpioc_reserve_wrap(curr_priv, (
void __user *) arg);
263 ret_val = compat_agpioc_allocate_wrap(curr_priv, (
void __user *) arg);
271 ret_val = compat_agpioc_bind_wrap(curr_priv, (
void __user *) arg);
275 ret_val = compat_agpioc_unbind_wrap(curr_priv, (
void __user *) arg);
283 DBG(
"ioctl returns %d\n", ret_val);