ioctl32.c 18 KB

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