blob: 29cdcd02ead30524c4394a7b558cc3223ffc986c [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#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 Rajput2f06de02008-12-27 21:37:10 +053011#include <asm/sys_ia32.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070012
Thomas Gleixner2da06b42008-01-30 13:30:08 +010013asmlinkage long sys32_ipc(u32 call, int first, int second, int third,
14 compat_uptr_t ptr, u32 fifth)
Linus Torvalds1da177e2005-04-16 15:20:36 -070015{
16 int version;
17
18 version = call >> 16; /* hack for backward compatibility */
19 call &= 0xffff;
20
21 switch (call) {
Thomas Gleixner2da06b42008-01-30 13:30:08 +010022 case SEMOP:
Linus Torvalds1da177e2005-04-16 15:20:36 -070023 /* struct sembuf is the same on 32 and 64bit :)) */
24 return sys_semtimedop(first, compat_ptr(ptr), second, NULL);
Thomas Gleixner2da06b42008-01-30 13:30:08 +010025 case SEMTIMEDOP:
Linus Torvalds1da177e2005-04-16 15:20:36 -070026 return compat_sys_semtimedop(first, compat_ptr(ptr), second,
27 compat_ptr(fifth));
Thomas Gleixner2da06b42008-01-30 13:30:08 +010028 case SEMGET:
Linus Torvalds1da177e2005-04-16 15:20:36 -070029 return sys_semget(first, second, third);
Thomas Gleixner2da06b42008-01-30 13:30:08 +010030 case SEMCTL:
Linus Torvalds1da177e2005-04-16 15:20:36 -070031 return compat_sys_semctl(first, second, third, compat_ptr(ptr));
32
Thomas Gleixner2da06b42008-01-30 13:30:08 +010033 case MSGSND:
Linus Torvalds1da177e2005-04-16 15:20:36 -070034 return compat_sys_msgsnd(first, second, third, compat_ptr(ptr));
Thomas Gleixner2da06b42008-01-30 13:30:08 +010035 case MSGRCV:
Linus Torvalds1da177e2005-04-16 15:20:36 -070036 return compat_sys_msgrcv(first, second, fifth, third,
37 version, compat_ptr(ptr));
Thomas Gleixner2da06b42008-01-30 13:30:08 +010038 case MSGGET:
Linus Torvalds1da177e2005-04-16 15:20:36 -070039 return sys_msgget((key_t) first, second);
Thomas Gleixner2da06b42008-01-30 13:30:08 +010040 case MSGCTL:
Linus Torvalds1da177e2005-04-16 15:20:36 -070041 return compat_sys_msgctl(first, second, compat_ptr(ptr));
42
Thomas Gleixner2da06b42008-01-30 13:30:08 +010043 case SHMAT:
Linus Torvalds1da177e2005-04-16 15:20:36 -070044 return compat_sys_shmat(first, second, third, version,
45 compat_ptr(ptr));
Thomas Gleixner2da06b42008-01-30 13:30:08 +010046 case SHMDT:
Linus Torvalds1da177e2005-04-16 15:20:36 -070047 return sys_shmdt(compat_ptr(ptr));
Thomas Gleixner2da06b42008-01-30 13:30:08 +010048 case SHMGET:
Linus Torvalds1da177e2005-04-16 15:20:36 -070049 return sys_shmget(first, (unsigned)second, third);
Thomas Gleixner2da06b42008-01-30 13:30:08 +010050 case SHMCTL:
Linus Torvalds1da177e2005-04-16 15:20:36 -070051 return compat_sys_shmctl(first, second, compat_ptr(ptr));
52 }
53 return -ENOSYS;
54}