Merge tag 'dm-3.8-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-dm
[linux-2.6-block.git] / arch / x86 / ia32 / ipc32.c
CommitLineData
1da177e4
LT
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>
2f06de06 11#include <asm/sys_ia32.h>
1da177e4 12
2da06b4e
TG
13asmlinkage long sys32_ipc(u32 call, int first, int second, int third,
14 compat_uptr_t ptr, u32 fifth)
1da177e4
LT
15{
16 int version;
17
18 version = call >> 16; /* hack for backward compatibility */
19 call &= 0xffff;
20
21 switch (call) {
2da06b4e 22 case SEMOP:
1da177e4
LT
23 /* struct sembuf is the same on 32 and 64bit :)) */
24 return sys_semtimedop(first, compat_ptr(ptr), second, NULL);
2da06b4e 25 case SEMTIMEDOP:
1da177e4
LT
26 return compat_sys_semtimedop(first, compat_ptr(ptr), second,
27 compat_ptr(fifth));
2da06b4e 28 case SEMGET:
1da177e4 29 return sys_semget(first, second, third);
2da06b4e 30 case SEMCTL:
1da177e4
LT
31 return compat_sys_semctl(first, second, third, compat_ptr(ptr));
32
2da06b4e 33 case MSGSND:
1da177e4 34 return compat_sys_msgsnd(first, second, third, compat_ptr(ptr));
2da06b4e 35 case MSGRCV:
1da177e4
LT
36 return compat_sys_msgrcv(first, second, fifth, third,
37 version, compat_ptr(ptr));
2da06b4e 38 case MSGGET:
1da177e4 39 return sys_msgget((key_t) first, second);
2da06b4e 40 case MSGCTL:
1da177e4
LT
41 return compat_sys_msgctl(first, second, compat_ptr(ptr));
42
2da06b4e 43 case SHMAT:
1da177e4
LT
44 return compat_sys_shmat(first, second, third, version,
45 compat_ptr(ptr));
2da06b4e 46 case SHMDT:
1da177e4 47 return sys_shmdt(compat_ptr(ptr));
2da06b4e 48 case SHMGET:
1da177e4 49 return sys_shmget(first, (unsigned)second, third);
2da06b4e 50 case SHMCTL:
1da177e4
LT
51 return compat_sys_shmctl(first, second, compat_ptr(ptr));
52 }
53 return -ENOSYS;
54}