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