aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/mips/kernel/linux32.c69
-rw-r--r--arch/mips/kernel/scall64-o32.S2
-rw-r--r--arch/powerpc/kernel/sys_ppc32.c67
-rw-r--r--arch/s390/kernel/compat_linux.c44
-rw-r--r--arch/s390/kernel/compat_linux.h1
-rw-r--r--arch/s390/kernel/compat_wrapper.S8
-rw-r--r--arch/s390/kernel/syscalls.S2
-rw-r--r--arch/sparc/kernel/sys_sparc32.c65
-rw-r--r--arch/x86/ia32/Makefile3
-rw-r--r--arch/x86/ia32/ipc32.c54
-rw-r--r--arch/x86/include/asm/sys_ia32.h3
-rw-r--r--arch/x86/syscalls/syscall_32.tbl2
-rw-r--r--include/linux/compat.h1
-rw-r--r--ipc/compat.c44
-rw-r--r--kernel/sys_ni.c2
15 files changed, 52 insertions, 315 deletions
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c
index 6852d4876f82..7c57b8d7b255 100644
--- a/arch/mips/kernel/linux32.c
+++ b/arch/mips/kernel/linux32.c
@@ -119,75 +119,6 @@ SYSCALL_DEFINE6(32_pwrite, unsigned int, fd, const char __user *, buf,
119 return sys_pwrite64(fd, buf, count, merge_64(a4, a5)); 119 return sys_pwrite64(fd, buf, count, merge_64(a4, a5));
120} 120}
121 121
122#ifdef CONFIG_SYSVIPC
123
124SYSCALL_DEFINE6(32_ipc, u32, call, long, first, long, second, long, third,
125 unsigned long, ptr, unsigned long, fifth)
126{
127 int version, err;
128
129 version = call >> 16; /* hack for backward compatibility */
130 call &= 0xffff;
131
132 switch (call) {
133 case SEMOP:
134 /* struct sembuf is the same on 32 and 64bit :)) */
135 err = sys_semtimedop(first, compat_ptr(ptr), second, NULL);
136 break;
137 case SEMTIMEDOP:
138 err = compat_sys_semtimedop(first, compat_ptr(ptr), second,
139 compat_ptr(fifth));
140 break;
141 case SEMGET:
142 err = sys_semget(first, second, third);
143 break;
144 case SEMCTL:
145 err = compat_sys_semctl(first, second, third, compat_ptr(ptr));
146 break;
147 case MSGSND:
148 err = compat_sys_msgsnd(first, second, third, compat_ptr(ptr));
149 break;
150 case MSGRCV:
151 err = compat_sys_msgrcv(first, second, fifth, third,
152 version, compat_ptr(ptr));
153 break;
154 case MSGGET:
155 err = sys_msgget((key_t) first, second);
156 break;
157 case MSGCTL:
158 err = compat_sys_msgctl(first, second, compat_ptr(ptr));
159 break;
160 case SHMAT:
161 err = compat_sys_shmat(first, second, third, version,
162 compat_ptr(ptr));
163 break;
164 case SHMDT:
165 err = sys_shmdt(compat_ptr(ptr));
166 break;
167 case SHMGET:
168 err = sys_shmget(first, (unsigned)second, third);
169 break;
170 case SHMCTL:
171 err = compat_sys_shmctl(first, second, compat_ptr(ptr));
172 break;
173 default:
174 err = -EINVAL;
175 break;
176 }
177
178 return err;
179}
180
181#else
182
183SYSCALL_DEFINE6(32_ipc, u32, call, int, first, int, second, int, third,
184 u32, ptr, u32, fifth)
185{
186 return -ENOSYS;
187}
188
189#endif /* CONFIG_SYSVIPC */
190
191#ifdef CONFIG_MIPS32_N32 122#ifdef CONFIG_MIPS32_N32
192SYSCALL_DEFINE4(n32_semctl, int, semid, int, semnum, int, cmd, u32, arg) 123SYSCALL_DEFINE4(n32_semctl, int, semid, int, semnum, int, cmd, u32, arg)
193{ 124{
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S
index 91c8c6ea7b09..103bfe570fe8 100644
--- a/arch/mips/kernel/scall64-o32.S
+++ b/arch/mips/kernel/scall64-o32.S
@@ -309,7 +309,7 @@ sys_call_table:
309 PTR compat_sys_wait4 309 PTR compat_sys_wait4
310 PTR sys_swapoff /* 4115 */ 310 PTR sys_swapoff /* 4115 */
311 PTR compat_sys_sysinfo 311 PTR compat_sys_sysinfo
312 PTR sys_32_ipc 312 PTR compat_sys_ipc
313 PTR sys_fsync 313 PTR sys_fsync
314 PTR sys32_sigreturn 314 PTR sys32_sigreturn
315 PTR __sys_clone /* 4120 */ 315 PTR __sys_clone /* 4120 */
diff --git a/arch/powerpc/kernel/sys_ppc32.c b/arch/powerpc/kernel/sys_ppc32.c
index e695230ca181..d78ad7b6c464 100644
--- a/arch/powerpc/kernel/sys_ppc32.c
+++ b/arch/powerpc/kernel/sys_ppc32.c
@@ -61,73 +61,6 @@ asmlinkage long ppc32_select(u32 n, compat_ulong_t __user *inp,
61 return compat_sys_select((int)n, inp, outp, exp, compat_ptr(tvp_x)); 61 return compat_sys_select((int)n, inp, outp, exp, compat_ptr(tvp_x));
62} 62}
63 63
64#ifdef CONFIG_SYSVIPC
65long compat_sys_ipc(u32 call, u32 first, u32 second, u32 third, compat_uptr_t ptr,
66 u32 fifth)
67{
68 int version;
69
70 version = call >> 16; /* hack for backward compatibility */
71 call &= 0xffff;
72
73 switch (call) {
74
75 case SEMTIMEDOP:
76 if (fifth)
77 /* sign extend semid */
78 return compat_sys_semtimedop((int)first,
79 compat_ptr(ptr), second,
80 compat_ptr(fifth));
81 /* else fall through for normal semop() */
82 case SEMOP:
83 /* struct sembuf is the same on 32 and 64bit :)) */
84 /* sign extend semid */
85 return sys_semtimedop((int)first, compat_ptr(ptr), second,
86 NULL);
87 case SEMGET:
88 /* sign extend key, nsems */
89 return sys_semget((int)first, (int)second, third);
90 case SEMCTL:
91 /* sign extend semid, semnum */
92 return compat_sys_semctl((int)first, (int)second, third,
93 compat_ptr(ptr));
94
95 case MSGSND:
96 /* sign extend msqid */
97 return compat_sys_msgsnd((int)first, (int)second, third,
98 compat_ptr(ptr));
99 case MSGRCV:
100 /* sign extend msqid, msgtyp */
101 return compat_sys_msgrcv((int)first, second, (int)fifth,
102 third, version, compat_ptr(ptr));
103 case MSGGET:
104 /* sign extend key */
105 return sys_msgget((int)first, second);
106 case MSGCTL:
107 /* sign extend msqid */
108 return compat_sys_msgctl((int)first, second, compat_ptr(ptr));
109
110 case SHMAT:
111 /* sign extend shmid */
112 return compat_sys_shmat((int)first, second, third, version,
113 compat_ptr(ptr));
114 case SHMDT:
115 return sys_shmdt(compat_ptr(ptr));
116 case SHMGET:
117 /* sign extend key_t */
118 return sys_shmget((int)first, second, third);
119 case SHMCTL:
120 /* sign extend shmid */
121 return compat_sys_shmctl((int)first, second, compat_ptr(ptr));
122
123 default:
124 return -ENOSYS;
125 }
126
127 return -ENOSYS;
128}
129#endif
130
131unsigned long compat_sys_mmap2(unsigned long addr, size_t len, 64unsigned long compat_sys_mmap2(unsigned long addr, size_t len,
132 unsigned long prot, unsigned long flags, 65 unsigned long prot, unsigned long flags,
133 unsigned long fd, unsigned long pgoff) 66 unsigned long fd, unsigned long pgoff)
diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c
index fbd29c70a297..8b6e4f5288a2 100644
--- a/arch/s390/kernel/compat_linux.c
+++ b/arch/s390/kernel/compat_linux.c
@@ -288,51 +288,13 @@ asmlinkage long sys32_getegid16(void)
288 return high2lowgid(from_kgid_munged(current_user_ns(), current_egid())); 288 return high2lowgid(from_kgid_munged(current_user_ns(), current_egid()));
289} 289}
290 290
291/*
292 * sys32_ipc() is the de-multiplexer for the SysV IPC calls in 32bit emulation.
293 *
294 * This is really horribly ugly.
295 */
296#ifdef CONFIG_SYSVIPC 291#ifdef CONFIG_SYSVIPC
297asmlinkage long sys32_ipc(u32 call, int first, int second, int third, u32 ptr) 292COMPAT_SYSCALL_DEFINE5(s390_ipc, uint, call, int, first, unsigned long, second,
293 unsigned long, third, compat_uptr_t, ptr)
298{ 294{
299 if (call >> 16) /* hack for backward compatibility */ 295 if (call >> 16) /* hack for backward compatibility */
300 return -EINVAL; 296 return -EINVAL;
301 switch (call) { 297 return compat_sys_ipc(call, first, second, third, ptr, third);
302 case SEMTIMEDOP:
303 return compat_sys_semtimedop(first, compat_ptr(ptr),
304 second, compat_ptr(third));
305 case SEMOP:
306 /* struct sembuf is the same on 32 and 64bit :)) */
307 return sys_semtimedop(first, compat_ptr(ptr),
308 second, NULL);
309 case SEMGET:
310 return sys_semget(first, second, third);
311 case SEMCTL:
312 return compat_sys_semctl(first, second, third,
313 compat_ptr(ptr));
314 case MSGSND:
315 return compat_sys_msgsnd(first, second, third,
316 compat_ptr(ptr));
317 case MSGRCV:
318 return compat_sys_msgrcv(first, second, 0, third,
319 0, compat_ptr(ptr));
320 case MSGGET:
321 return sys_msgget((key_t) first, second);
322 case MSGCTL:
323 return compat_sys_msgctl(first, second, compat_ptr(ptr));
324 case SHMAT:
325 return compat_sys_shmat(first, second, third,
326 0, compat_ptr(ptr));
327 case SHMDT:
328 return sys_shmdt(compat_ptr(ptr));
329 case SHMGET:
330 return sys_shmget(first, (unsigned)second, third);
331 case SHMCTL:
332 return compat_sys_shmctl(first, second, compat_ptr(ptr));
333 }
334
335 return -ENOSYS;
336} 298}
337#endif 299#endif
338 300
diff --git a/arch/s390/kernel/compat_linux.h b/arch/s390/kernel/compat_linux.h
index bce0b7aec8f9..976518c0592a 100644
--- a/arch/s390/kernel/compat_linux.h
+++ b/arch/s390/kernel/compat_linux.h
@@ -94,7 +94,6 @@ long sys32_getuid16(void);
94long sys32_geteuid16(void); 94long sys32_geteuid16(void);
95long sys32_getgid16(void); 95long sys32_getgid16(void);
96long sys32_getegid16(void); 96long sys32_getegid16(void);
97long sys32_ipc(u32 call, int first, int second, int third, u32 ptr);
98long sys32_truncate64(const char __user * path, unsigned long high, 97long sys32_truncate64(const char __user * path, unsigned long high,
99 unsigned long low); 98 unsigned long low);
100long sys32_ftruncate64(unsigned int fd, unsigned long high, unsigned long low); 99long sys32_ftruncate64(unsigned int fd, unsigned long high, unsigned long low);
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S
index 6d4958ea390b..17644c8e10e1 100644
--- a/arch/s390/kernel/compat_wrapper.S
+++ b/arch/s390/kernel/compat_wrapper.S
@@ -388,14 +388,6 @@ ENTRY(compat_sys_sysinfo_wrapper)
388 llgtr %r2,%r2 # struct sysinfo_emu31 * 388 llgtr %r2,%r2 # struct sysinfo_emu31 *
389 jg compat_sys_sysinfo # branch to system call 389 jg compat_sys_sysinfo # branch to system call
390 390
391ENTRY(sys32_ipc_wrapper)
392 llgfr %r2,%r2 # uint
393 lgfr %r3,%r3 # int
394 lgfr %r4,%r4 # int
395 lgfr %r5,%r5 # int
396 llgfr %r6,%r6 # u32
397 jg sys32_ipc # branch to system call
398
399ENTRY(sys32_fsync_wrapper) 391ENTRY(sys32_fsync_wrapper)
400 llgfr %r2,%r2 # unsigned int 392 llgfr %r2,%r2 # unsigned int
401 jg sys_fsync # branch to system call 393 jg sys_fsync # branch to system call
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S
index 9154e17f25b9..d2baabed7148 100644
--- a/arch/s390/kernel/syscalls.S
+++ b/arch/s390/kernel/syscalls.S
@@ -125,7 +125,7 @@ NI_SYSCALL /* vm86old for i386 */
125SYSCALL(sys_wait4,sys_wait4,compat_sys_wait4) 125SYSCALL(sys_wait4,sys_wait4,compat_sys_wait4)
126SYSCALL(sys_swapoff,sys_swapoff,sys32_swapoff_wrapper) /* 115 */ 126SYSCALL(sys_swapoff,sys_swapoff,sys32_swapoff_wrapper) /* 115 */
127SYSCALL(sys_sysinfo,sys_sysinfo,compat_sys_sysinfo_wrapper) 127SYSCALL(sys_sysinfo,sys_sysinfo,compat_sys_sysinfo_wrapper)
128SYSCALL(sys_s390_ipc,sys_s390_ipc,sys32_ipc_wrapper) 128SYSCALL(sys_s390_ipc,sys_s390_ipc,compat_sys_s390_ipc)
129SYSCALL(sys_fsync,sys_fsync,sys32_fsync_wrapper) 129SYSCALL(sys_fsync,sys_fsync,sys32_fsync_wrapper)
130SYSCALL(sys_sigreturn,sys_sigreturn,sys32_sigreturn) 130SYSCALL(sys_sigreturn,sys_sigreturn,sys32_sigreturn)
131SYSCALL(sys_clone,sys_clone,sys_clone_wrapper) /* 120 */ 131SYSCALL(sys_clone,sys_clone,sys_clone_wrapper) /* 120 */
diff --git a/arch/sparc/kernel/sys_sparc32.c b/arch/sparc/kernel/sys_sparc32.c
index 5d4ee8374c84..d546188b13df 100644
--- a/arch/sparc/kernel/sys_sparc32.c
+++ b/arch/sparc/kernel/sys_sparc32.c
@@ -49,71 +49,6 @@
49#include <asm/mmu_context.h> 49#include <asm/mmu_context.h>
50#include <asm/compat_signal.h> 50#include <asm/compat_signal.h>
51 51
52#ifdef CONFIG_SYSVIPC
53asmlinkage long compat_sys_ipc(u32 call, u32 first, u32 second, u32 third, compat_uptr_t ptr, u32 fifth)
54{
55 int version;
56
57 version = call >> 16; /* hack for backward compatibility */
58 call &= 0xffff;
59
60 switch (call) {
61 case SEMTIMEDOP:
62 if (fifth)
63 /* sign extend semid */
64 return compat_sys_semtimedop((int)first,
65 compat_ptr(ptr), second,
66 compat_ptr(fifth));
67 /* else fall through for normal semop() */
68 case SEMOP:
69 /* struct sembuf is the same on 32 and 64bit :)) */
70 /* sign extend semid */
71 return sys_semtimedop((int)first, compat_ptr(ptr), second,
72 NULL);
73 case SEMGET:
74 /* sign extend key, nsems */
75 return sys_semget((int)first, (int)second, third);
76 case SEMCTL:
77 /* sign extend semid, semnum */
78 return compat_sys_semctl((int)first, (int)second, third,
79 compat_ptr(ptr));
80
81 case MSGSND:
82 /* sign extend msqid */
83 return compat_sys_msgsnd((int)first, (int)second, third,
84 compat_ptr(ptr));
85 case MSGRCV:
86 /* sign extend msqid, msgtyp */
87 return compat_sys_msgrcv((int)first, second, (int)fifth,
88 third, version, compat_ptr(ptr));
89 case MSGGET:
90 /* sign extend key */
91 return sys_msgget((int)first, second);
92 case MSGCTL:
93 /* sign extend msqid */
94 return compat_sys_msgctl((int)first, second, compat_ptr(ptr));
95
96 case SHMAT:
97 /* sign extend shmid */
98 return compat_sys_shmat((int)first, second, third, version,
99 compat_ptr(ptr));
100 case SHMDT:
101 return sys_shmdt(compat_ptr(ptr));
102 case SHMGET:
103 /* sign extend key_t */
104 return sys_shmget((int)first, second, third);
105 case SHMCTL:
106 /* sign extend shmid */
107 return compat_sys_shmctl((int)first, second, compat_ptr(ptr));
108
109 default:
110 return -ENOSYS;
111 }
112
113 return -ENOSYS;
114}
115#endif
116
117asmlinkage long sys32_truncate64(const char __user * path, unsigned long high, unsigned long low) 52asmlinkage long sys32_truncate64(const char __user * path, unsigned long high, unsigned long low)
118{ 53{
119 if ((int)high < 0) 54 if ((int)high < 0)
diff --git a/arch/x86/ia32/Makefile b/arch/x86/ia32/Makefile
index 455646e0e532..e785b422b766 100644
--- a/arch/x86/ia32/Makefile
+++ b/arch/x86/ia32/Makefile
@@ -5,9 +5,6 @@
5obj-$(CONFIG_IA32_EMULATION) := ia32entry.o sys_ia32.o ia32_signal.o 5obj-$(CONFIG_IA32_EMULATION) := ia32entry.o sys_ia32.o ia32_signal.o
6obj-$(CONFIG_IA32_EMULATION) += nosyscall.o syscall_ia32.o 6obj-$(CONFIG_IA32_EMULATION) += nosyscall.o syscall_ia32.o
7 7
8sysv-$(CONFIG_SYSVIPC) := ipc32.o
9obj-$(CONFIG_IA32_EMULATION) += $(sysv-y)
10
11obj-$(CONFIG_IA32_AOUT) += ia32_aout.o 8obj-$(CONFIG_IA32_AOUT) += ia32_aout.o
12 9
13audit-class-$(CONFIG_AUDIT) := audit.o 10audit-class-$(CONFIG_AUDIT) := audit.o
diff --git a/arch/x86/ia32/ipc32.c b/arch/x86/ia32/ipc32.c
deleted file mode 100644
index 29cdcd02ead3..000000000000
--- a/arch/x86/ia32/ipc32.c
+++ /dev/null
@@ -1,54 +0,0 @@
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
13asmlinkage long 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 case SHMDT:
47 return sys_shmdt(compat_ptr(ptr));
48 case SHMGET:
49 return sys_shmget(first, (unsigned)second, third);
50 case SHMCTL:
51 return compat_sys_shmctl(first, second, compat_ptr(ptr));
52 }
53 return -ENOSYS;
54}
diff --git a/arch/x86/include/asm/sys_ia32.h b/arch/x86/include/asm/sys_ia32.h
index 2b0e0c2d5379..df8ad3b3920a 100644
--- a/arch/x86/include/asm/sys_ia32.h
+++ b/arch/x86/include/asm/sys_ia32.h
@@ -57,9 +57,6 @@ asmlinkage long sys32_fallocate(int, int, unsigned,
57asmlinkage long sys32_sigreturn(void); 57asmlinkage long sys32_sigreturn(void);
58asmlinkage long sys32_rt_sigreturn(void); 58asmlinkage long sys32_rt_sigreturn(void);
59 59
60/* ia32/ipc32.c */
61asmlinkage long sys32_ipc(u32, int, int, int, compat_uptr_t, u32);
62
63asmlinkage long sys32_fanotify_mark(int, unsigned int, u32, u32, int, 60asmlinkage long sys32_fanotify_mark(int, unsigned int, u32, u32, int,
64 const char __user *); 61 const char __user *);
65 62
diff --git a/arch/x86/syscalls/syscall_32.tbl b/arch/x86/syscalls/syscall_32.tbl
index 0b55cd773e4c..0f6f5becab0d 100644
--- a/arch/x86/syscalls/syscall_32.tbl
+++ b/arch/x86/syscalls/syscall_32.tbl
@@ -123,7 +123,7 @@
123114 i386 wait4 sys_wait4 compat_sys_wait4 123114 i386 wait4 sys_wait4 compat_sys_wait4
124115 i386 swapoff sys_swapoff 124115 i386 swapoff sys_swapoff
125116 i386 sysinfo sys_sysinfo compat_sys_sysinfo 125116 i386 sysinfo sys_sysinfo compat_sys_sysinfo
126117 i386 ipc sys_ipc sys32_ipc 126117 i386 ipc sys_ipc compat_sys_ipc
127118 i386 fsync sys_fsync 127118 i386 fsync sys_fsync
128119 i386 sigreturn sys_sigreturn stub32_sigreturn 128119 i386 sigreturn sys_sigreturn stub32_sigreturn
129120 i386 clone sys_clone stub32_clone 129120 i386 clone sys_clone stub32_clone
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 482c9e65b5bf..79a4781ac502 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -318,6 +318,7 @@ long compat_sys_msgrcv(int first, int second, int msgtyp, int third,
318 int version, void __user *uptr); 318 int version, void __user *uptr);
319long compat_sys_shmat(int first, int second, compat_uptr_t third, int version, 319long compat_sys_shmat(int first, int second, compat_uptr_t third, int version,
320 void __user *uptr); 320 void __user *uptr);
321asmlinkage long compat_sys_ipc(u32, int, int, u32, compat_uptr_t, u32);
321#else 322#else
322long compat_sys_semctl(int semid, int semnum, int cmd, int arg); 323long compat_sys_semctl(int semid, int semnum, int cmd, int arg);
323long compat_sys_msgsnd(int msqid, struct compat_msgbuf __user *msgp, 324long compat_sys_msgsnd(int msqid, struct compat_msgbuf __user *msgp,
diff --git a/ipc/compat.c b/ipc/compat.c
index 2547f29dcd1b..1da2e2eb9d70 100644
--- a/ipc/compat.c
+++ b/ipc/compat.c
@@ -368,6 +368,50 @@ long compat_sys_msgrcv(int first, int second, int msgtyp, int third,
368 return do_msgrcv(first, uptr, second, msgtyp, third, 368 return do_msgrcv(first, uptr, second, msgtyp, third,
369 compat_do_msg_fill); 369 compat_do_msg_fill);
370} 370}
371
372COMPAT_SYSCALL_DEFINE6(ipc, u32, call, int, first, int, second,
373 u32, third, compat_uptr_t, ptr, u32, fifth)
374{
375 int version;
376
377 version = call >> 16; /* hack for backward compatibility */
378 call &= 0xffff;
379
380 switch (call) {
381 case SEMOP:
382 /* struct sembuf is the same on 32 and 64bit :)) */
383 return sys_semtimedop(first, compat_ptr(ptr), second, NULL);
384 case SEMTIMEDOP:
385 return compat_sys_semtimedop(first, compat_ptr(ptr), second,
386 compat_ptr(fifth));
387 case SEMGET:
388 return sys_semget(first, second, third);
389 case SEMCTL:
390 return compat_sys_semctl(first, second, third, compat_ptr(ptr));
391
392 case MSGSND:
393 return compat_sys_msgsnd(first, second, third, compat_ptr(ptr));
394 case MSGRCV:
395 return compat_sys_msgrcv(first, second, fifth, third,
396 version, compat_ptr(ptr));
397 case MSGGET:
398 return sys_msgget(first, second);
399 case MSGCTL:
400 return compat_sys_msgctl(first, second, compat_ptr(ptr));
401
402 case SHMAT:
403 return compat_sys_shmat(first, second, third, version,
404 compat_ptr(ptr));
405 case SHMDT:
406 return sys_shmdt(compat_ptr(ptr));
407 case SHMGET:
408 return sys_shmget(first, (unsigned)second, third);
409 case SHMCTL:
410 return compat_sys_shmctl(first, second, compat_ptr(ptr));
411 }
412
413 return -ENOSYS;
414}
371#else 415#else
372long compat_sys_semctl(int semid, int semnum, int cmd, int arg) 416long compat_sys_semctl(int semid, int semnum, int cmd, int arg)
373{ 417{
diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c
index b50e2a003c5a..bfd6787b355a 100644
--- a/kernel/sys_ni.c
+++ b/kernel/sys_ni.c
@@ -156,7 +156,7 @@ cond_syscall(compat_sys_process_vm_writev);
156cond_syscall(sys_pciconfig_read); 156cond_syscall(sys_pciconfig_read);
157cond_syscall(sys_pciconfig_write); 157cond_syscall(sys_pciconfig_write);
158cond_syscall(sys_pciconfig_iobase); 158cond_syscall(sys_pciconfig_iobase);
159cond_syscall(sys32_ipc); 159cond_syscall(compat_sys_s390_ipc);
160cond_syscall(ppc_rtas); 160cond_syscall(ppc_rtas);
161cond_syscall(sys_spu_run); 161cond_syscall(sys_spu_run);
162cond_syscall(sys_spu_create); 162cond_syscall(sys_spu_create);