ioctl32.c 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * ioctl32.c: Conversion between 32bit and 64bit native ioctls.
  3. *
  4. * Copyright (C) 2000 Silicon Graphics, Inc.
  5. * Written by Ulf Carlsson (ulfc@engr.sgi.com)
  6. * Copyright (C) 2000, 2004 Ralf Baechle
  7. * Copyright (C) 2002, 2003 Maciej W. Rozycki
  8. */
  9. #define INCLUDES
  10. #include "compat_ioctl.c"
  11. #include <linux/config.h>
  12. #include <linux/types.h>
  13. #include <linux/compat.h>
  14. #include <linux/ioctl32.h>
  15. #include <linux/syscalls.h>
  16. #ifdef CONFIG_SIBYTE_TBPROF
  17. #include <asm/sibyte/trace_prof.h>
  18. #endif
  19. #define A(__x) ((unsigned long)(__x))
  20. long sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg);
  21. #define CODE
  22. #include "compat_ioctl.c"
  23. typedef int (* ioctl32_handler_t)(unsigned int, unsigned int, unsigned long, struct file *);
  24. #define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL((cmd),sys_ioctl)
  25. #define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl32_handler_t)(handler), NULL },
  26. #define IOCTL_TABLE_START \
  27. struct ioctl_trans ioctl_start[] = {
  28. #define IOCTL_TABLE_END \
  29. };
  30. IOCTL_TABLE_START
  31. #include <linux/compat_ioctl.h>
  32. #define DECLARES
  33. #include "compat_ioctl.c"
  34. #ifdef CONFIG_SIBYTE_TBPROF
  35. COMPATIBLE_IOCTL(SBPROF_ZBSTART)
  36. COMPATIBLE_IOCTL(SBPROF_ZBSTOP)
  37. COMPATIBLE_IOCTL(SBPROF_ZBWAITFULL)
  38. #endif /* CONFIG_SIBYTE_TBPROF */
  39. /*HANDLE_IOCTL(RTC_IRQP_READ, w_long)
  40. COMPATIBLE_IOCTL(RTC_IRQP_SET)
  41. HANDLE_IOCTL(RTC_EPOCH_READ, w_long)
  42. COMPATIBLE_IOCTL(RTC_EPOCH_SET)
  43. */
  44. IOCTL_TABLE_END
  45. int ioctl_table_size = ARRAY_SIZE(ioctl_start);