compat_ioctl.c 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * ioctl32.c: Conversion between 32bit and 64bit native ioctls.
  3. *
  4. * S390 version
  5. * Copyright (C) 2000-2003 IBM Deutschland Entwicklung GmbH, IBM Corporation
  6. * Author(s): Gerhard Tonn (ton@de.ibm.com)
  7. * Arnd Bergmann (arndb@de.ibm.com)
  8. *
  9. * Original implementation from 32-bit Sparc compat code which is
  10. * Copyright (C) 2000 Silicon Graphics, Inc.
  11. * Written by Ulf Carlsson (ulfc@engr.sgi.com)
  12. */
  13. #include "compat_linux.h"
  14. #define INCLUDES
  15. #define CODE
  16. #include "../../../fs/compat_ioctl.c"
  17. #include <asm/dasd.h>
  18. #include <asm/cmb.h>
  19. #include <asm/tape390.h>
  20. static int do_ioctl32_pointer(unsigned int fd, unsigned int cmd,
  21. unsigned long arg, struct file *f)
  22. {
  23. return sys_ioctl(fd, cmd, (unsigned long)compat_ptr(arg));
  24. }
  25. static int do_ioctl32_ulong(unsigned int fd, unsigned int cmd,
  26. unsigned long arg, struct file *f)
  27. {
  28. return sys_ioctl(fd, cmd, arg);
  29. }
  30. #define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL((cmd),(ioctl_trans_handler_t)do_ioctl32_pointer)
  31. #define ULONG_IOCTL(cmd) HANDLE_IOCTL((cmd),(ioctl_trans_handler_t)do_ioctl32_ulong)
  32. #define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl_trans_handler_t)(handler), NULL },
  33. struct ioctl_trans ioctl_start[] = {
  34. /* architecture independent ioctls */
  35. #include <linux/compat_ioctl.h>
  36. #define DECLARES
  37. #include "../../../fs/compat_ioctl.c"
  38. /* s390 only ioctls */
  39. COMPATIBLE_IOCTL(DASDAPIVER)
  40. COMPATIBLE_IOCTL(BIODASDDISABLE)
  41. COMPATIBLE_IOCTL(BIODASDENABLE)
  42. COMPATIBLE_IOCTL(BIODASDRSRV)
  43. COMPATIBLE_IOCTL(BIODASDRLSE)
  44. COMPATIBLE_IOCTL(BIODASDSLCK)
  45. COMPATIBLE_IOCTL(BIODASDINFO)
  46. COMPATIBLE_IOCTL(BIODASDINFO2)
  47. COMPATIBLE_IOCTL(BIODASDFMT)
  48. COMPATIBLE_IOCTL(BIODASDPRRST)
  49. COMPATIBLE_IOCTL(BIODASDQUIESCE)
  50. COMPATIBLE_IOCTL(BIODASDRESUME)
  51. COMPATIBLE_IOCTL(BIODASDPRRD)
  52. COMPATIBLE_IOCTL(BIODASDPSRD)
  53. COMPATIBLE_IOCTL(BIODASDGATTR)
  54. COMPATIBLE_IOCTL(BIODASDSATTR)
  55. COMPATIBLE_IOCTL(BIODASDCMFENABLE)
  56. COMPATIBLE_IOCTL(BIODASDCMFDISABLE)
  57. COMPATIBLE_IOCTL(BIODASDREADALLCMB)
  58. COMPATIBLE_IOCTL(TAPE390_DISPLAY)
  59. /* s390 doesn't need handlers here */
  60. COMPATIBLE_IOCTL(TIOCGSERIAL)
  61. COMPATIBLE_IOCTL(TIOCSSERIAL)
  62. };
  63. int ioctl_table_size = ARRAY_SIZE(ioctl_start);