ioctl32.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * ioctl32.c: Conversion between 32bit and 64bit native ioctls.
  3. *
  4. * Based on sparc64 ioctl32.c by:
  5. *
  6. * Copyright (C) 1997-2000 Jakub Jelinek (jakub@redhat.com)
  7. * Copyright (C) 1998 Eddie C. Dost (ecd@skynet.be)
  8. *
  9. * ppc64 changes:
  10. *
  11. * Copyright (C) 2000 Ken Aaker (kdaaker@rchland.vnet.ibm.com)
  12. * Copyright (C) 2001 Anton Blanchard (antonb@au.ibm.com)
  13. *
  14. * These routines maintain argument size conversion between 32bit and 64bit
  15. * ioctls.
  16. *
  17. * This program is free software; you can redistribute it and/or
  18. * modify it under the terms of the GNU General Public License
  19. * as published by the Free Software Foundation; either version
  20. * 2 of the License, or (at your option) any later version.
  21. */
  22. #define INCLUDES
  23. #include "compat_ioctl.c"
  24. #include <linux/syscalls.h>
  25. #define CODE
  26. #include "compat_ioctl.c"
  27. #define HANDLE_IOCTL(cmd,handler) { cmd, (ioctl_trans_handler_t)handler, NULL },
  28. #define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL(cmd,sys_ioctl)
  29. #define IOCTL_TABLE_START \
  30. struct ioctl_trans ioctl_start[] = {
  31. #define IOCTL_TABLE_END \
  32. };
  33. IOCTL_TABLE_START
  34. #include <linux/compat_ioctl.h>
  35. #define DECLARES
  36. #include "compat_ioctl.c"
  37. COMPATIBLE_IOCTL(TIOCSTART)
  38. COMPATIBLE_IOCTL(TIOCSTOP)
  39. COMPATIBLE_IOCTL(TIOCSLTC)
  40. /* Little p (/dev/rtc, /dev/envctrl, etc.) */
  41. COMPATIBLE_IOCTL(_IOR('p', 20, int[7])) /* RTCGET */
  42. COMPATIBLE_IOCTL(_IOW('p', 21, int[7])) /* RTCSET */
  43. IOCTL_TABLE_END
  44. int ioctl_table_size = ARRAY_SIZE(ioctl_start);