compat_ioctl.c 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. #include <asm/ccwdev.h>
  21. #include "../../../drivers/s390/char/raw3270.h"
  22. static int do_ioctl32_pointer(unsigned int fd, unsigned int cmd,
  23. unsigned long arg, struct file *f)
  24. {
  25. return sys_ioctl(fd, cmd, (unsigned long)compat_ptr(arg));
  26. }
  27. static int do_ioctl32_ulong(unsigned int fd, unsigned int cmd,
  28. unsigned long arg, struct file *f)
  29. {
  30. return sys_ioctl(fd, cmd, arg);
  31. }
  32. #define COMPATIBLE_IOCTL(cmd) HANDLE_IOCTL((cmd),(ioctl_trans_handler_t)do_ioctl32_pointer)
  33. #define ULONG_IOCTL(cmd) HANDLE_IOCTL((cmd),(ioctl_trans_handler_t)do_ioctl32_ulong)
  34. #define HANDLE_IOCTL(cmd,handler) { (cmd), (ioctl_trans_handler_t)(handler), NULL },
  35. struct ioctl_trans ioctl_start[] = {
  36. /* architecture independent ioctls */
  37. #include <linux/compat_ioctl.h>
  38. #define DECLARES
  39. #include "../../../fs/compat_ioctl.c"
  40. };
  41. int ioctl_table_size = ARRAY_SIZE(ioctl_start);