[SPARC64]: remove alloc_user_space()
[linux-2.6/verdex.git] / arch / sparc64 / kernel / ioctl32.c
blob0e587d6de319900bbbc34a57561a2400fe86cf0d
1 /* $Id: ioctl32.c,v 1.136 2002/01/14 09:49:52 davem Exp $
2 * ioctl32.c: Conversion between 32bit and 64bit native ioctls.
4 * Copyright (C) 1997-2000 Jakub Jelinek (jakub@redhat.com)
5 * Copyright (C) 1998 Eddie C. Dost (ecd@skynet.be)
6 * Copyright (C) 2003 Pavel Machek (pavel@suse.cz)
8 * These routines maintain argument size conversion between 32bit and 64bit
9 * ioctls.
12 #define INCLUDES
13 #include "compat_ioctl.c"
14 #include <linux/ncp_fs.h>
15 #include <linux/syscalls.h>
16 #include <asm/fbio.h>
17 #include <asm/kbio.h>
18 #include <asm/vuid_event.h>
19 #include <asm/envctrl.h>
20 #include <asm/display7seg.h>
21 #include <asm/openpromio.h>
22 #include <asm/audioio.h>
23 #include <asm/watchdog.h>
25 /* Use this to get at 32-bit user passed pointers.
26 * See sys_sparc32.c for description about it.
28 #define A(__x) compat_ptr(__x)
30 #define CODE
31 #include "compat_ioctl.c"
33 struct fbcmap32 {
34 int index; /* first element (0 origin) */
35 int count;
36 u32 red;
37 u32 green;
38 u32 blue;
41 #define FBIOPUTCMAP32 _IOW('F', 3, struct fbcmap32)
42 #define FBIOGETCMAP32 _IOW('F', 4, struct fbcmap32)
44 static int fbiogetputcmap(unsigned int fd, unsigned int cmd, unsigned long arg)
46 struct fbcmap32 __user *argp = (void __user *)arg;
47 struct fbcmap __user *p = compat_alloc_user_space(sizeof(*p));
48 u32 addr;
49 int ret;
51 ret = copy_in_user(p, argp, 2 * sizeof(int));
52 ret |= get_user(addr, &argp->red);
53 ret |= put_user(compat_ptr(addr), &p->red);
54 ret |= get_user(addr, &argp->green);
55 ret |= put_user(compat_ptr(addr), &p->green);
56 ret |= get_user(addr, &argp->blue);
57 ret |= put_user(compat_ptr(addr), &p->blue);
58 if (ret)
59 return -EFAULT;
60 return sys_ioctl(fd, (cmd == FBIOPUTCMAP32) ? FBIOPUTCMAP_SPARC : FBIOGETCMAP_SPARC, (unsigned long)p);
63 struct fbcursor32 {
64 short set; /* what to set, choose from the list above */
65 short enable; /* cursor on/off */
66 struct fbcurpos pos; /* cursor position */
67 struct fbcurpos hot; /* cursor hot spot */
68 struct fbcmap32 cmap; /* color map info */
69 struct fbcurpos size; /* cursor bit map size */
70 u32 image; /* cursor image bits */
71 u32 mask; /* cursor mask bits */
74 #define FBIOSCURSOR32 _IOW('F', 24, struct fbcursor32)
75 #define FBIOGCURSOR32 _IOW('F', 25, struct fbcursor32)
77 static int fbiogscursor(unsigned int fd, unsigned int cmd, unsigned long arg)
79 struct fbcursor __user *p = compat_alloc_user_space(sizeof(*p));
80 struct fbcursor32 __user *argp = (void __user *)arg;
81 compat_uptr_t addr;
82 int ret;
84 ret = copy_in_user(p, argp,
85 2 * sizeof (short) + 2 * sizeof(struct fbcurpos));
86 ret |= copy_in_user(&p->size, &argp->size, sizeof(struct fbcurpos));
87 ret |= copy_in_user(&p->cmap, &argp->cmap, 2 * sizeof(int));
88 ret |= get_user(addr, &argp->cmap.red);
89 ret |= put_user(compat_ptr(addr), &p->cmap.red);
90 ret |= get_user(addr, &argp->cmap.green);
91 ret |= put_user(compat_ptr(addr), &p->cmap.green);
92 ret |= get_user(addr, &argp->cmap.blue);
93 ret |= put_user(compat_ptr(addr), &p->cmap.blue);
94 ret |= get_user(addr, &argp->mask);
95 ret |= put_user(compat_ptr(addr), &p->mask);
96 ret |= get_user(addr, &argp->image);
97 ret |= put_user(compat_ptr(addr), &p->image);
98 if (ret)
99 return -EFAULT;
100 return sys_ioctl (fd, FBIOSCURSOR, (unsigned long)p);
103 #if defined(CONFIG_DRM) || defined(CONFIG_DRM_MODULE)
104 /* This really belongs in include/linux/drm.h -DaveM */
105 #include "../../../drivers/char/drm/drm.h"
107 typedef struct drm32_version {
108 int version_major; /* Major version */
109 int version_minor; /* Minor version */
110 int version_patchlevel;/* Patch level */
111 int name_len; /* Length of name buffer */
112 u32 name; /* Name of driver */
113 int date_len; /* Length of date buffer */
114 u32 date; /* User-space buffer to hold date */
115 int desc_len; /* Length of desc buffer */
116 u32 desc; /* User-space buffer to hold desc */
117 } drm32_version_t;
118 #define DRM32_IOCTL_VERSION DRM_IOWR(0x00, drm32_version_t)
120 static int drm32_version(unsigned int fd, unsigned int cmd, unsigned long arg)
122 drm32_version_t __user *uversion = (drm32_version_t __user *)arg;
123 drm_version_t __user *p = compat_alloc_user_space(sizeof(*p));
124 compat_uptr_t addr;
125 int n;
126 int ret;
128 if (clear_user(p, 3 * sizeof(int)) ||
129 get_user(n, &uversion->name_len) ||
130 put_user(n, &p->name_len) ||
131 get_user(addr, &uversion->name) ||
132 put_user(compat_ptr(addr), &p->name) ||
133 get_user(n, &uversion->date_len) ||
134 put_user(n, &p->date_len) ||
135 get_user(addr, &uversion->date) ||
136 put_user(compat_ptr(addr), &p->date) ||
137 get_user(n, &uversion->desc_len) ||
138 put_user(n, &p->desc_len) ||
139 get_user(addr, &uversion->desc) ||
140 put_user(compat_ptr(addr), &p->desc))
141 return -EFAULT;
143 ret = sys_ioctl(fd, DRM_IOCTL_VERSION, (unsigned long)p);
144 if (ret)
145 return ret;
147 if (copy_in_user(uversion, p, 3 * sizeof(int)) ||
148 get_user(n, &p->name_len) ||
149 put_user(n, &uversion->name_len) ||
150 get_user(n, &p->date_len) ||
151 put_user(n, &uversion->date_len) ||
152 get_user(n, &p->desc_len) ||
153 put_user(n, &uversion->desc_len))
154 return -EFAULT;
156 return 0;
159 typedef struct drm32_unique {
160 int unique_len; /* Length of unique */
161 u32 unique; /* Unique name for driver instantiation */
162 } drm32_unique_t;
163 #define DRM32_IOCTL_GET_UNIQUE DRM_IOWR(0x01, drm32_unique_t)
164 #define DRM32_IOCTL_SET_UNIQUE DRM_IOW( 0x10, drm32_unique_t)
166 static int drm32_getsetunique(unsigned int fd, unsigned int cmd, unsigned long arg)
168 drm32_unique_t __user *uarg = (drm32_unique_t __user *)arg;
169 drm_unique_t __user *p = compat_alloc_user_space(sizeof(*p));
170 compat_uptr_t addr;
171 int n;
172 int ret;
174 if (get_user(n, &uarg->unique_len) ||
175 put_user(n, &p->unique_len) ||
176 get_user(addr, &uarg->unique) ||
177 put_user(compat_ptr(addr), &p->unique))
178 return -EFAULT;
180 if (cmd == DRM32_IOCTL_GET_UNIQUE)
181 ret = sys_ioctl (fd, DRM_IOCTL_GET_UNIQUE, (unsigned long)p);
182 else
183 ret = sys_ioctl (fd, DRM_IOCTL_SET_UNIQUE, (unsigned long)p);
185 if (ret)
186 return ret;
188 if (get_user(n, &p->unique_len) || put_user(n, &uarg->unique_len))
189 return -EFAULT;
191 return 0;
194 typedef struct drm32_map {
195 u32 offset; /* Requested physical address (0 for SAREA)*/
196 u32 size; /* Requested physical size (bytes) */
197 drm_map_type_t type; /* Type of memory to map */
198 drm_map_flags_t flags; /* Flags */
199 u32 handle; /* User-space: "Handle" to pass to mmap */
200 /* Kernel-space: kernel-virtual address */
201 int mtrr; /* MTRR slot used */
202 /* Private data */
203 } drm32_map_t;
204 #define DRM32_IOCTL_ADD_MAP DRM_IOWR(0x15, drm32_map_t)
206 static int drm32_addmap(unsigned int fd, unsigned int cmd, unsigned long arg)
208 drm32_map_t __user *uarg = (drm32_map_t __user *) arg;
209 drm_map_t karg;
210 mm_segment_t old_fs;
211 u32 tmp;
212 int ret;
214 ret = get_user(karg.offset, &uarg->offset);
215 ret |= get_user(karg.size, &uarg->size);
216 ret |= get_user(karg.type, &uarg->type);
217 ret |= get_user(karg.flags, &uarg->flags);
218 ret |= get_user(tmp, &uarg->handle);
219 ret |= get_user(karg.mtrr, &uarg->mtrr);
220 if (ret)
221 return -EFAULT;
223 karg.handle = (void *) (unsigned long) tmp;
225 old_fs = get_fs();
226 set_fs(KERNEL_DS);
227 ret = sys_ioctl(fd, DRM_IOCTL_ADD_MAP, (unsigned long) &karg);
228 set_fs(old_fs);
230 if (!ret) {
231 ret = put_user(karg.offset, &uarg->offset);
232 ret |= put_user(karg.size, &uarg->size);
233 ret |= put_user(karg.type, &uarg->type);
234 ret |= put_user(karg.flags, &uarg->flags);
235 tmp = (u32) (long)karg.handle;
236 ret |= put_user(tmp, &uarg->handle);
237 ret |= put_user(karg.mtrr, &uarg->mtrr);
238 if (ret)
239 ret = -EFAULT;
242 return ret;
245 typedef struct drm32_buf_info {
246 int count; /* Entries in list */
247 u32 list; /* (drm_buf_desc_t *) */
248 } drm32_buf_info_t;
249 #define DRM32_IOCTL_INFO_BUFS DRM_IOWR(0x18, drm32_buf_info_t)
251 static int drm32_info_bufs(unsigned int fd, unsigned int cmd, unsigned long arg)
253 drm32_buf_info_t __user *uarg = (drm32_buf_info_t __user *)arg;
254 drm_buf_info_t __user *p = compat_alloc_user_space(sizeof(*p));
255 compat_uptr_t addr;
256 int n;
257 int ret;
259 if (get_user(n, &uarg->count) || put_user(n, &p->count) ||
260 get_user(addr, &uarg->list) || put_user(compat_ptr(addr), &p->list))
261 return -EFAULT;
263 ret = sys_ioctl(fd, DRM_IOCTL_INFO_BUFS, (unsigned long)p);
264 if (ret)
265 return ret;
267 if (get_user(n, &p->count) || put_user(n, &uarg->count))
268 return -EFAULT;
270 return 0;
273 typedef struct drm32_buf_free {
274 int count;
275 u32 list; /* (int *) */
276 } drm32_buf_free_t;
277 #define DRM32_IOCTL_FREE_BUFS DRM_IOW( 0x1a, drm32_buf_free_t)
279 static int drm32_free_bufs(unsigned int fd, unsigned int cmd, unsigned long arg)
281 drm32_buf_free_t __user *uarg = (drm32_buf_free_t __user *)arg;
282 drm_buf_free_t __user *p = compat_alloc_user_space(sizeof(*p));
283 compat_uptr_t addr;
284 int n;
286 if (get_user(n, &uarg->count) || put_user(n, &p->count) ||
287 get_user(addr, &uarg->list) || put_user(compat_ptr(addr), &p->list))
288 return -EFAULT;
290 return sys_ioctl(fd, DRM_IOCTL_FREE_BUFS, (unsigned long)p);
293 typedef struct drm32_buf_pub {
294 int idx; /* Index into master buflist */
295 int total; /* Buffer size */
296 int used; /* Amount of buffer in use (for DMA) */
297 u32 address; /* Address of buffer (void *) */
298 } drm32_buf_pub_t;
300 typedef struct drm32_buf_map {
301 int count; /* Length of buflist */
302 u32 virtual; /* Mmaped area in user-virtual (void *) */
303 u32 list; /* Buffer information (drm_buf_pub_t *) */
304 } drm32_buf_map_t;
305 #define DRM32_IOCTL_MAP_BUFS DRM_IOWR(0x19, drm32_buf_map_t)
307 static int drm32_map_bufs(unsigned int fd, unsigned int cmd, unsigned long arg)
309 drm32_buf_map_t __user *uarg = (drm32_buf_map_t __user *)arg;
310 drm32_buf_pub_t __user *ulist;
311 drm_buf_map_t __user *arg64;
312 drm_buf_pub_t __user *list;
313 int orig_count, ret, i;
314 int n;
315 compat_uptr_t addr;
317 if (get_user(orig_count, &uarg->count))
318 return -EFAULT;
320 arg64 = compat_alloc_user_space(sizeof(drm_buf_map_t) +
321 (size_t)orig_count * sizeof(drm_buf_pub_t));
322 list = (void __user *)(arg64 + 1);
324 if (put_user(orig_count, &arg64->count) ||
325 put_user(list, &arg64->list) ||
326 get_user(addr, &uarg->virtual) ||
327 put_user(compat_ptr(addr), &arg64->virtual) ||
328 get_user(addr, &uarg->list))
329 return -EFAULT;
331 ulist = compat_ptr(addr);
333 for (i = 0; i < orig_count; i++) {
334 if (get_user(n, &ulist[i].idx) ||
335 put_user(n, &list[i].idx) ||
336 get_user(n, &ulist[i].total) ||
337 put_user(n, &list[i].total) ||
338 get_user(n, &ulist[i].used) ||
339 put_user(n, &list[i].used) ||
340 get_user(addr, &ulist[i].address) ||
341 put_user(compat_ptr(addr), &list[i].address))
342 return -EFAULT;
345 ret = sys_ioctl(fd, DRM_IOCTL_MAP_BUFS, (unsigned long) arg64);
346 if (ret)
347 return ret;
349 for (i = 0; i < orig_count; i++) {
350 void __user *p;
351 if (get_user(n, &list[i].idx) ||
352 put_user(n, &ulist[i].idx) ||
353 get_user(n, &list[i].total) ||
354 put_user(n, &ulist[i].total) ||
355 get_user(n, &list[i].used) ||
356 put_user(n, &ulist[i].used) ||
357 get_user(p, &list[i].address) ||
358 put_user((unsigned long)p, &ulist[i].address))
359 return -EFAULT;
362 if (get_user(n, &arg64->count) || put_user(n, &uarg->count))
363 return -EFAULT;
365 return 0;
368 typedef struct drm32_dma {
369 /* Indices here refer to the offset into
370 buflist in drm_buf_get_t. */
371 int context; /* Context handle */
372 int send_count; /* Number of buffers to send */
373 u32 send_indices; /* List of handles to buffers (int *) */
374 u32 send_sizes; /* Lengths of data to send (int *) */
375 drm_dma_flags_t flags; /* Flags */
376 int request_count; /* Number of buffers requested */
377 int request_size; /* Desired size for buffers */
378 u32 request_indices; /* Buffer information (int *) */
379 u32 request_sizes; /* (int *) */
380 int granted_count; /* Number of buffers granted */
381 } drm32_dma_t;
382 #define DRM32_IOCTL_DMA DRM_IOWR(0x29, drm32_dma_t)
384 /* RED PEN The DRM layer blindly dereferences the send/request
385 * index/size arrays even though they are userland
386 * pointers. -DaveM
388 static int drm32_dma(unsigned int fd, unsigned int cmd, unsigned long arg)
390 drm32_dma_t __user *uarg = (drm32_dma_t __user *) arg;
391 drm_dma_t __user *p = compat_alloc_user_space(sizeof(*p));
392 compat_uptr_t addr;
393 int ret;
395 if (copy_in_user(p, uarg, 2 * sizeof(int)) ||
396 get_user(addr, &uarg->send_indices) ||
397 put_user(compat_ptr(addr), &p->send_indices) ||
398 get_user(addr, &uarg->send_sizes) ||
399 put_user(compat_ptr(addr), &p->send_sizes) ||
400 copy_in_user(&p->flags, &uarg->flags, sizeof(drm_dma_flags_t)) ||
401 copy_in_user(&p->request_count, &uarg->request_count, sizeof(int))||
402 copy_in_user(&p->request_size, &uarg->request_size, sizeof(int)) ||
403 get_user(addr, &uarg->request_indices) ||
404 put_user(compat_ptr(addr), &p->request_indices) ||
405 get_user(addr, &uarg->request_sizes) ||
406 put_user(compat_ptr(addr), &p->request_sizes) ||
407 copy_in_user(&p->granted_count, &uarg->granted_count, sizeof(int)))
408 return -EFAULT;
410 ret = sys_ioctl(fd, DRM_IOCTL_DMA, (unsigned long)p);
411 if (ret)
412 return ret;
414 if (copy_in_user(uarg, p, 2 * sizeof(int)) ||
415 copy_in_user(&uarg->flags, &p->flags, sizeof(drm_dma_flags_t)) ||
416 copy_in_user(&uarg->request_count, &p->request_count, sizeof(int))||
417 copy_in_user(&uarg->request_size, &p->request_size, sizeof(int)) ||
418 copy_in_user(&uarg->granted_count, &p->granted_count, sizeof(int)))
419 return -EFAULT;
421 return 0;
424 typedef struct drm32_ctx_res {
425 int count;
426 u32 contexts; /* (drm_ctx_t *) */
427 } drm32_ctx_res_t;
428 #define DRM32_IOCTL_RES_CTX DRM_IOWR(0x26, drm32_ctx_res_t)
430 static int drm32_res_ctx(unsigned int fd, unsigned int cmd, unsigned long arg)
432 drm32_ctx_res_t __user *uarg = (drm32_ctx_res_t __user *) arg;
433 drm_ctx_res_t __user *p = compat_alloc_user_space(sizeof(*p));
434 compat_uptr_t addr;
435 int ret;
437 if (copy_in_user(p, uarg, sizeof(int)) ||
438 get_user(addr, &uarg->contexts) ||
439 put_user(compat_ptr(addr), &p->contexts))
440 return -EFAULT;
442 ret = sys_ioctl(fd, DRM_IOCTL_RES_CTX, (unsigned long)p);
443 if (ret)
444 return ret;
446 if (copy_in_user(uarg, p, sizeof(int)))
447 return -EFAULT;
449 return 0;
452 #endif
454 typedef int (* ioctl32_handler_t)(unsigned int, unsigned int, unsigned long, struct file *);
456 #define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL((cmd),sys_ioctl)
457 #define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl32_handler_t)(handler), NULL },
458 #define IOCTL_TABLE_START \
459 struct ioctl_trans ioctl_start[] = {
460 #define IOCTL_TABLE_END \
463 IOCTL_TABLE_START
464 #include <linux/compat_ioctl.h>
465 #define DECLARES
466 #include "compat_ioctl.c"
467 COMPATIBLE_IOCTL(FBIOGTYPE)
468 COMPATIBLE_IOCTL(FBIOSATTR)
469 COMPATIBLE_IOCTL(FBIOGATTR)
470 COMPATIBLE_IOCTL(FBIOSVIDEO)
471 COMPATIBLE_IOCTL(FBIOGVIDEO)
472 COMPATIBLE_IOCTL(FBIOGCURSOR32) /* This is not implemented yet. Later it should be converted... */
473 COMPATIBLE_IOCTL(FBIOSCURPOS)
474 COMPATIBLE_IOCTL(FBIOGCURPOS)
475 COMPATIBLE_IOCTL(FBIOGCURMAX)
476 /* Little k */
477 COMPATIBLE_IOCTL(KIOCTYPE)
478 COMPATIBLE_IOCTL(KIOCLAYOUT)
479 COMPATIBLE_IOCTL(KIOCGTRANS)
480 COMPATIBLE_IOCTL(KIOCTRANS)
481 COMPATIBLE_IOCTL(KIOCCMD)
482 COMPATIBLE_IOCTL(KIOCSDIRECT)
483 COMPATIBLE_IOCTL(KIOCSLED)
484 COMPATIBLE_IOCTL(KIOCGLED)
485 COMPATIBLE_IOCTL(KIOCSRATE)
486 COMPATIBLE_IOCTL(KIOCGRATE)
487 COMPATIBLE_IOCTL(VUIDSFORMAT)
488 COMPATIBLE_IOCTL(VUIDGFORMAT)
489 /* Little v, the video4linux ioctls */
490 COMPATIBLE_IOCTL(_IOR('p', 20, int[7])) /* RTCGET */
491 COMPATIBLE_IOCTL(_IOW('p', 21, int[7])) /* RTCSET */
492 COMPATIBLE_IOCTL(ENVCTRL_RD_WARNING_TEMPERATURE)
493 COMPATIBLE_IOCTL(ENVCTRL_RD_SHUTDOWN_TEMPERATURE)
494 COMPATIBLE_IOCTL(ENVCTRL_RD_CPU_TEMPERATURE)
495 COMPATIBLE_IOCTL(ENVCTRL_RD_FAN_STATUS)
496 COMPATIBLE_IOCTL(ENVCTRL_RD_VOLTAGE_STATUS)
497 COMPATIBLE_IOCTL(ENVCTRL_RD_SCSI_TEMPERATURE)
498 COMPATIBLE_IOCTL(ENVCTRL_RD_ETHERNET_TEMPERATURE)
499 COMPATIBLE_IOCTL(ENVCTRL_RD_MTHRBD_TEMPERATURE)
500 COMPATIBLE_IOCTL(ENVCTRL_RD_CPU_VOLTAGE)
501 COMPATIBLE_IOCTL(ENVCTRL_RD_GLOBALADDRESS)
502 /* COMPATIBLE_IOCTL(D7SIOCRD) same value as ENVCTRL_RD_VOLTAGE_STATUS */
503 COMPATIBLE_IOCTL(D7SIOCWR)
504 COMPATIBLE_IOCTL(D7SIOCTM)
505 /* OPENPROMIO, SunOS/Solaris only, the NetBSD one's have
506 * embedded pointers in the arg which we'd need to clean up...
508 COMPATIBLE_IOCTL(OPROMGETOPT)
509 COMPATIBLE_IOCTL(OPROMSETOPT)
510 COMPATIBLE_IOCTL(OPROMNXTOPT)
511 COMPATIBLE_IOCTL(OPROMSETOPT2)
512 COMPATIBLE_IOCTL(OPROMNEXT)
513 COMPATIBLE_IOCTL(OPROMCHILD)
514 COMPATIBLE_IOCTL(OPROMGETPROP)
515 COMPATIBLE_IOCTL(OPROMNXTPROP)
516 COMPATIBLE_IOCTL(OPROMU2P)
517 COMPATIBLE_IOCTL(OPROMGETCONS)
518 COMPATIBLE_IOCTL(OPROMGETFBNAME)
519 COMPATIBLE_IOCTL(OPROMGETBOOTARGS)
520 COMPATIBLE_IOCTL(OPROMSETCUR)
521 COMPATIBLE_IOCTL(OPROMPCI2NODE)
522 COMPATIBLE_IOCTL(OPROMPATH2NODE)
523 /* Big L */
524 COMPATIBLE_IOCTL(LOOP_SET_STATUS64)
525 COMPATIBLE_IOCTL(LOOP_GET_STATUS64)
526 /* Big A */
527 COMPATIBLE_IOCTL(AUDIO_GETINFO)
528 COMPATIBLE_IOCTL(AUDIO_SETINFO)
529 COMPATIBLE_IOCTL(AUDIO_DRAIN)
530 COMPATIBLE_IOCTL(AUDIO_GETDEV)
531 COMPATIBLE_IOCTL(AUDIO_GETDEV_SUNOS)
532 COMPATIBLE_IOCTL(AUDIO_FLUSH)
533 COMPATIBLE_IOCTL(AUTOFS_IOC_EXPIRE_MULTI)
534 #if defined(CONFIG_DRM) || defined(CONFIG_DRM_MODULE)
535 COMPATIBLE_IOCTL(DRM_IOCTL_GET_MAGIC)
536 COMPATIBLE_IOCTL(DRM_IOCTL_IRQ_BUSID)
537 COMPATIBLE_IOCTL(DRM_IOCTL_AUTH_MAGIC)
538 COMPATIBLE_IOCTL(DRM_IOCTL_BLOCK)
539 COMPATIBLE_IOCTL(DRM_IOCTL_UNBLOCK)
540 COMPATIBLE_IOCTL(DRM_IOCTL_CONTROL)
541 COMPATIBLE_IOCTL(DRM_IOCTL_ADD_BUFS)
542 COMPATIBLE_IOCTL(DRM_IOCTL_MARK_BUFS)
543 COMPATIBLE_IOCTL(DRM_IOCTL_ADD_CTX)
544 COMPATIBLE_IOCTL(DRM_IOCTL_RM_CTX)
545 COMPATIBLE_IOCTL(DRM_IOCTL_MOD_CTX)
546 COMPATIBLE_IOCTL(DRM_IOCTL_GET_CTX)
547 COMPATIBLE_IOCTL(DRM_IOCTL_SWITCH_CTX)
548 COMPATIBLE_IOCTL(DRM_IOCTL_NEW_CTX)
549 COMPATIBLE_IOCTL(DRM_IOCTL_ADD_DRAW)
550 COMPATIBLE_IOCTL(DRM_IOCTL_RM_DRAW)
551 COMPATIBLE_IOCTL(DRM_IOCTL_LOCK)
552 COMPATIBLE_IOCTL(DRM_IOCTL_UNLOCK)
553 COMPATIBLE_IOCTL(DRM_IOCTL_FINISH)
554 #endif /* DRM */
555 COMPATIBLE_IOCTL(WIOCSTART)
556 COMPATIBLE_IOCTL(WIOCSTOP)
557 COMPATIBLE_IOCTL(WIOCGSTAT)
558 /* And these ioctls need translation */
559 /* Note SIOCRTMSG is no longer, so this is safe and * the user would have seen just an -EINVAL anyways. */
560 HANDLE_IOCTL(FBIOPUTCMAP32, fbiogetputcmap)
561 HANDLE_IOCTL(FBIOGETCMAP32, fbiogetputcmap)
562 HANDLE_IOCTL(FBIOSCURSOR32, fbiogscursor)
563 #if defined(CONFIG_DRM) || defined(CONFIG_DRM_MODULE)
564 HANDLE_IOCTL(DRM32_IOCTL_VERSION, drm32_version)
565 HANDLE_IOCTL(DRM32_IOCTL_GET_UNIQUE, drm32_getsetunique)
566 HANDLE_IOCTL(DRM32_IOCTL_SET_UNIQUE, drm32_getsetunique)
567 HANDLE_IOCTL(DRM32_IOCTL_ADD_MAP, drm32_addmap)
568 HANDLE_IOCTL(DRM32_IOCTL_INFO_BUFS, drm32_info_bufs)
569 HANDLE_IOCTL(DRM32_IOCTL_FREE_BUFS, drm32_free_bufs)
570 HANDLE_IOCTL(DRM32_IOCTL_MAP_BUFS, drm32_map_bufs)
571 HANDLE_IOCTL(DRM32_IOCTL_DMA, drm32_dma)
572 HANDLE_IOCTL(DRM32_IOCTL_RES_CTX, drm32_res_ctx)
573 #endif /* DRM */
574 #if 0
575 HANDLE_IOCTL(RTC32_IRQP_READ, do_rtc_ioctl)
576 HANDLE_IOCTL(RTC32_IRQP_SET, do_rtc_ioctl)
577 HANDLE_IOCTL(RTC32_EPOCH_READ, do_rtc_ioctl)
578 HANDLE_IOCTL(RTC32_EPOCH_SET, do_rtc_ioctl)
579 #endif
580 /* take care of sizeof(sizeof()) breakage */
581 IOCTL_TABLE_END
583 int ioctl_table_size = ARRAY_SIZE(ioctl_start);