ipc32.c 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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/sys_ia32.h>
  12. asmlinkage long sys32_ipc(u32 call, int first, int second, int third,
  13. compat_uptr_t ptr, u32 fifth)
  14. {
  15. int version;
  16. version = call >> 16; /* hack for backward compatibility */
  17. call &= 0xffff;
  18. switch (call) {
  19. case SEMOP:
  20. /* struct sembuf is the same on 32 and 64bit :)) */
  21. return sys_semtimedop(first, compat_ptr(ptr), second, NULL);
  22. case SEMTIMEDOP:
  23. return compat_sys_semtimedop(first, compat_ptr(ptr), second,
  24. compat_ptr(fifth));
  25. case SEMGET:
  26. return sys_semget(first, second, third);
  27. case SEMCTL:
  28. return compat_sys_semctl(first, second, third, compat_ptr(ptr));
  29. case MSGSND:
  30. return compat_sys_msgsnd(first, second, third, compat_ptr(ptr));
  31. case MSGRCV:
  32. return compat_sys_msgrcv(first, second, fifth, third,
  33. version, compat_ptr(ptr));
  34. case MSGGET:
  35. return sys_msgget((key_t) first, second);
  36. case MSGCTL:
  37. return compat_sys_msgctl(first, second, compat_ptr(ptr));
  38. case SHMAT:
  39. return compat_sys_shmat(first, second, third, version,
  40. compat_ptr(ptr));
  41. case SHMDT:
  42. return sys_shmdt(compat_ptr(ptr));
  43. case SHMGET:
  44. return sys_shmget(first, (unsigned)second, third);
  45. case SHMCTL:
  46. return compat_sys_shmctl(first, second, compat_ptr(ptr));
  47. }
  48. return -ENOSYS;
  49. }