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