/arch/s390/kernel/compat_ioctl.c

https://bitbucket.org/evzijst/gittest · C · 73 lines · 48 code · 10 blank · 15 comment · 2 complexity · c8b7a20048f827c0e829cace0e44b926 MD5 · raw file

  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/tape390.h>
  19. static int do_ioctl32_pointer(unsigned int fd, unsigned int cmd,
  20. unsigned long arg, struct file *f)
  21. {
  22. return sys_ioctl(fd, cmd, (unsigned long)compat_ptr(arg));
  23. }
  24. static int do_ioctl32_ulong(unsigned int fd, unsigned int cmd,
  25. unsigned long arg, struct file *f)
  26. {
  27. return sys_ioctl(fd, cmd, arg);
  28. }
  29. #define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL((cmd),(ioctl_trans_handler_t)do_ioctl32_pointer)
  30. #define ULONG_IOCTL(cmd) HANDLE_IOCTL((cmd),(ioctl_trans_handler_t)do_ioctl32_ulong)
  31. #define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl_trans_handler_t)(handler), NULL },
  32. struct ioctl_trans ioctl_start[] = {
  33. /* architecture independent ioctls */
  34. #include <linux/compat_ioctl.h>
  35. #define DECLARES
  36. #include "../../../fs/compat_ioctl.c"
  37. /* s390 only ioctls */
  38. #if defined(CONFIG_DASD) || defined(CONFIG_DASD_MODULE)
  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. #endif
  56. #if defined(CONFIG_S390_TAPE) || defined(CONFIG_S390_TAPE_MODULE)
  57. COMPATIBLE_IOCTL(TAPE390_DISPLAY)
  58. #endif
  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);