ioctl32.c 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. #define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL((cmd),sys_ioctl)
  24. #define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl_trans_handler_t)(handler), NULL },
  25. #define IOCTL_TABLE_START \
  26. struct ioctl_trans ioctl_start[] = {
  27. #define IOCTL_TABLE_END \
  28. };
  29. IOCTL_TABLE_START
  30. #include <linux/compat_ioctl.h>
  31. #define DECLARES
  32. #include "compat_ioctl.c"
  33. /*HANDLE_IOCTL(RTC_IRQP_READ, w_long)
  34. COMPATIBLE_IOCTL(RTC_IRQP_SET)
  35. HANDLE_IOCTL(RTC_EPOCH_READ, w_long)
  36. COMPATIBLE_IOCTL(RTC_EPOCH_SET)
  37. */
  38. IOCTL_TABLE_END
  39. int ioctl_table_size = ARRAY_SIZE(ioctl_start);