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