ipc32.c 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #include <linux/kernel.h>
  2. #include <linux/spinlock.h>
  3. #include <linux/list.h>
  4. #include <linux/syscalls.h>
  5. #include <linux/time.h>
  6. #include <linux/sem.h>
  7. #include <linux/msg.h>
  8. #include <linux/shm.h>
  9. #include <linux/ipc.h>
  10. #include <linux/compat.h>
  11. #include <asm/ipc.h>
  12. asmlinkage long
  13. sys32_ipc(u32 call, int first, int second, int third,
  14. compat_uptr_t ptr, u32 fifth)
  15. {
  16. int version;
  17. version = call >> 16; /* hack for backward compatibility */
  18. call &= 0xffff;
  19. switch (call) {
  20. case SEMOP:
  21. /* struct sembuf is the same on 32 and 64bit :)) */
  22. return sys_semtimedop(first, compat_ptr(ptr), second, NULL);
  23. case SEMTIMEDOP:
  24. return compat_sys_semtimedop(first, compat_ptr(ptr), second,
  25. compat_ptr(fifth));
  26. case SEMGET:
  27. return sys_semget(first, second, third);
  28. case SEMCTL:
  29. return compat_sys_semctl(first, second, third, compat_ptr(ptr));
  30. case MSGSND:
  31. return compat_sys_msgsnd(first, second, third, compat_ptr(ptr));
  32. case MSGRCV:
  33. return compat_sys_msgrcv(first, second, fifth, third,
  34. version, compat_ptr(ptr));
  35. case MSGGET:
  36. return sys_msgget((key_t) first, second);
  37. case MSGCTL:
  38. return compat_sys_msgctl(first, second, compat_ptr(ptr));
  39. case SHMAT:
  40. return compat_sys_shmat(first, second, third, version,
  41. compat_ptr(ptr));
  42. break;
  43. case SHMDT:
  44. return sys_shmdt(compat_ptr(ptr));
  45. case SHMGET:
  46. return sys_shmget(first, (unsigned)second, third);
  47. case SHMCTL:
  48. return compat_sys_shmctl(first, second, compat_ptr(ptr));
  49. }
  50. return -ENOSYS;
  51. }