ioctl32.c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* $Id: ioctl32.c,v 1.5 2002/10/18 00:21:43 varenet 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. *
  7. * These routines maintain argument size conversion between 32bit and 64bit
  8. * ioctls.
  9. */
  10. #include <linux/syscalls.h>
  11. #define INCLUDES
  12. #include "compat_ioctl.c"
  13. #include <asm/perf.h>
  14. #include <asm/ioctls.h>
  15. #define CODE
  16. #include "compat_ioctl.c"
  17. #define HANDLE_IOCTL(cmd, handler) { cmd, (ioctl_trans_handler_t)handler, NULL },
  18. #define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL(cmd, sys_ioctl)
  19. #define IOCTL_TABLE_START struct ioctl_trans ioctl_start[] = {
  20. #define IOCTL_TABLE_END };
  21. IOCTL_TABLE_START
  22. #include <linux/compat_ioctl.h>
  23. #define DECLARES
  24. #include "compat_ioctl.c"
  25. /* And these ioctls need translation */
  26. HANDLE_IOCTL(SIOCGPPPSTATS, dev_ifsioc)
  27. HANDLE_IOCTL(SIOCGPPPCSTATS, dev_ifsioc)
  28. HANDLE_IOCTL(SIOCGPPPVER, dev_ifsioc)
  29. #if defined(CONFIG_GEN_RTC)
  30. COMPATIBLE_IOCTL(RTC_AIE_ON)
  31. COMPATIBLE_IOCTL(RTC_AIE_OFF)
  32. COMPATIBLE_IOCTL(RTC_UIE_ON)
  33. COMPATIBLE_IOCTL(RTC_UIE_OFF)
  34. COMPATIBLE_IOCTL(RTC_PIE_ON)
  35. COMPATIBLE_IOCTL(RTC_PIE_OFF)
  36. COMPATIBLE_IOCTL(RTC_WIE_ON)
  37. COMPATIBLE_IOCTL(RTC_WIE_OFF)
  38. COMPATIBLE_IOCTL(RTC_ALM_SET) /* struct rtc_time only has ints */
  39. COMPATIBLE_IOCTL(RTC_ALM_READ) /* struct rtc_time only has ints */
  40. COMPATIBLE_IOCTL(RTC_RD_TIME) /* struct rtc_time only has ints */
  41. COMPATIBLE_IOCTL(RTC_SET_TIME) /* struct rtc_time only has ints */
  42. HANDLE_IOCTL(RTC_IRQP_READ, w_long)
  43. COMPATIBLE_IOCTL(RTC_IRQP_SET)
  44. HANDLE_IOCTL(RTC_EPOCH_READ, w_long)
  45. COMPATIBLE_IOCTL(RTC_EPOCH_SET)
  46. #endif
  47. IOCTL_TABLE_END
  48. int ioctl_table_size = ARRAY_SIZE(ioctl_start);