sys_parisc32.c 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * sys_parisc32.c: Conversion between 32bit and 64bit native syscalls.
  3. *
  4. * Copyright (C) 2000-2001 Hewlett Packard Company
  5. * Copyright (C) 2000 John Marvin
  6. * Copyright (C) 2001 Matthew Wilcox
  7. *
  8. * These routines maintain argument size conversion between 32bit and 64bit
  9. * environment. Based heavily on sys_ia32.c and sys_sparc32.c.
  10. */
  11. #include <linux/compat.h>
  12. #include <linux/kernel.h>
  13. #include <linux/sched.h>
  14. #include <linux/fs.h>
  15. #include <linux/mm.h>
  16. #include <linux/file.h>
  17. #include <linux/signal.h>
  18. #include <linux/resource.h>
  19. #include <linux/times.h>
  20. #include <linux/time.h>
  21. #include <linux/smp.h>
  22. #include <linux/sem.h>
  23. #include <linux/shm.h>
  24. #include <linux/slab.h>
  25. #include <linux/uio.h>
  26. #include <linux/ncp_fs.h>
  27. #include <linux/poll.h>
  28. #include <linux/personality.h>
  29. #include <linux/stat.h>
  30. #include <linux/highmem.h>
  31. #include <linux/highuid.h>
  32. #include <linux/mman.h>
  33. #include <linux/binfmts.h>
  34. #include <linux/namei.h>
  35. #include <linux/vfs.h>
  36. #include <linux/ptrace.h>
  37. #include <linux/swap.h>
  38. #include <linux/syscalls.h>
  39. #include <asm/types.h>
  40. #include <asm/uaccess.h>
  41. #include <asm/mmu_context.h>
  42. #include "sys32.h"
  43. #undef DEBUG
  44. #ifdef DEBUG
  45. #define DBG(x) printk x
  46. #else
  47. #define DBG(x)
  48. #endif
  49. asmlinkage long sys32_unimplemented(int r26, int r25, int r24, int r23,
  50. int r22, int r21, int r20)
  51. {
  52. printk(KERN_ERR "%s(%d): Unimplemented 32 on 64 syscall #%d!\n",
  53. current->comm, current->pid, r20);
  54. return -ENOSYS;
  55. }
  56. asmlinkage long sys32_semctl(int semid, int semnum, int cmd, union semun arg)
  57. {
  58. union semun u;
  59. if (cmd == SETVAL) {
  60. /* Ugh. arg is a union of int,ptr,ptr,ptr, so is 8 bytes.
  61. * The int should be in the first 4, but our argument
  62. * frobbing has left it in the last 4.
  63. */
  64. u.val = *((int *)&arg + 1);
  65. return sys_semctl (semid, semnum, cmd, u);
  66. }
  67. return sys_semctl (semid, semnum, cmd, arg);
  68. }
  69. long sys32_lookup_dcookie(u32 cookie_high, u32 cookie_low, char __user *buf,
  70. size_t len)
  71. {
  72. return sys_lookup_dcookie((u64)cookie_high << 32 | cookie_low,
  73. buf, len);
  74. }
  75. asmlinkage long compat_sys_fanotify_mark(int fan_fd, int flags, u32 mask_hi,
  76. u32 mask_lo, int fd,
  77. const char __user *pathname)
  78. {
  79. return sys_fanotify_mark(fan_fd, flags, ((u64)mask_hi << 32) | mask_lo,
  80. fd, pathname);
  81. }