Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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> |
Jaswinder Singh Rajput | 2f06de0 | 2008-12-27 21:37:10 +0530 | [diff] [blame] | 11 | #include <asm/sys_ia32.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | |
Thomas Gleixner | 2da06b4 | 2008-01-30 13:30:08 +0100 | [diff] [blame] | 13 | asmlinkage long sys32_ipc(u32 call, int first, int second, int third, |
| 14 | compat_uptr_t ptr, u32 fifth) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | { |
| 16 | int version; |
| 17 | |
| 18 | version = call >> 16; /* hack for backward compatibility */ |
| 19 | call &= 0xffff; |
| 20 | |
| 21 | switch (call) { |
Thomas Gleixner | 2da06b4 | 2008-01-30 13:30:08 +0100 | [diff] [blame] | 22 | case SEMOP: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | /* struct sembuf is the same on 32 and 64bit :)) */ |
| 24 | return sys_semtimedop(first, compat_ptr(ptr), second, NULL); |
Thomas Gleixner | 2da06b4 | 2008-01-30 13:30:08 +0100 | [diff] [blame] | 25 | case SEMTIMEDOP: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | return compat_sys_semtimedop(first, compat_ptr(ptr), second, |
| 27 | compat_ptr(fifth)); |
Thomas Gleixner | 2da06b4 | 2008-01-30 13:30:08 +0100 | [diff] [blame] | 28 | case SEMGET: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | return sys_semget(first, second, third); |
Thomas Gleixner | 2da06b4 | 2008-01-30 13:30:08 +0100 | [diff] [blame] | 30 | case SEMCTL: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 31 | return compat_sys_semctl(first, second, third, compat_ptr(ptr)); |
| 32 | |
Thomas Gleixner | 2da06b4 | 2008-01-30 13:30:08 +0100 | [diff] [blame] | 33 | case MSGSND: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | return compat_sys_msgsnd(first, second, third, compat_ptr(ptr)); |
Thomas Gleixner | 2da06b4 | 2008-01-30 13:30:08 +0100 | [diff] [blame] | 35 | case MSGRCV: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | return compat_sys_msgrcv(first, second, fifth, third, |
| 37 | version, compat_ptr(ptr)); |
Thomas Gleixner | 2da06b4 | 2008-01-30 13:30:08 +0100 | [diff] [blame] | 38 | case MSGGET: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | return sys_msgget((key_t) first, second); |
Thomas Gleixner | 2da06b4 | 2008-01-30 13:30:08 +0100 | [diff] [blame] | 40 | case MSGCTL: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | return compat_sys_msgctl(first, second, compat_ptr(ptr)); |
| 42 | |
Thomas Gleixner | 2da06b4 | 2008-01-30 13:30:08 +0100 | [diff] [blame] | 43 | case SHMAT: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | return compat_sys_shmat(first, second, third, version, |
| 45 | compat_ptr(ptr)); |
Thomas Gleixner | 2da06b4 | 2008-01-30 13:30:08 +0100 | [diff] [blame] | 46 | case SHMDT: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 47 | return sys_shmdt(compat_ptr(ptr)); |
Thomas Gleixner | 2da06b4 | 2008-01-30 13:30:08 +0100 | [diff] [blame] | 48 | case SHMGET: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 49 | return sys_shmget(first, (unsigned)second, third); |
Thomas Gleixner | 2da06b4 | 2008-01-30 13:30:08 +0100 | [diff] [blame] | 50 | case SHMCTL: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | return compat_sys_shmctl(first, second, compat_ptr(ptr)); |
| 52 | } |
| 53 | return -ENOSYS; |
| 54 | } |