Merge branch 'master' into next
[linux-2.6] / arch / x86 / ia32 / ipc32.c
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
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
17         version = call >> 16; /* hack for backward compatibility */
18         call &= 0xffff;
19
20         switch (call) {
21         case SEMOP:
22                 /* struct sembuf is the same on 32 and 64bit :)) */
23                 return sys_semtimedop(first, compat_ptr(ptr), second, NULL);
24         case SEMTIMEDOP:
25                 return compat_sys_semtimedop(first, compat_ptr(ptr), second,
26                                                 compat_ptr(fifth));
27         case SEMGET:
28                 return sys_semget(first, second, third);
29         case SEMCTL:
30                 return compat_sys_semctl(first, second, third, compat_ptr(ptr));
31
32         case MSGSND:
33                 return compat_sys_msgsnd(first, second, third, compat_ptr(ptr));
34         case MSGRCV:
35                 return compat_sys_msgrcv(first, second, fifth, third,
36                                          version, compat_ptr(ptr));
37         case MSGGET:
38                 return sys_msgget((key_t) first, second);
39         case MSGCTL:
40                 return compat_sys_msgctl(first, second, compat_ptr(ptr));
41
42         case SHMAT:
43                 return compat_sys_shmat(first, second, third, version,
44                                         compat_ptr(ptr));
45         case SHMDT:
46                 return sys_shmdt(compat_ptr(ptr));
47         case SHMGET:
48                 return sys_shmget(first, (unsigned)second, third);
49         case SHMCTL:
50                 return compat_sys_shmctl(first, second, compat_ptr(ptr));
51         }
52         return -ENOSYS;
53 }