2 * linux/arch/mips/kernel/ipc.c
4 * This file contains various random system calls that
5 * have a non-standard calling sequence on the Linux/MIPS
8 #include <linux/errno.h>
9 #include <linux/sched.h>
11 #include <linux/smp.h>
12 #include <linux/smp_lock.h>
13 #include <linux/sem.h>
14 #include <linux/msg.h>
15 #include <linux/shm.h>
18 #include <asm/uaccess.h>
21 * sys_ipc() is the de-multiplexer for the SysV IPC calls..
23 * This is really horribly ugly.
25 asmlinkage int sys_ipc (uint call, int first, int second,
26 int third, void *ptr, long fifth)
30 version = call >> 16; /* hack for backward compatibility */
35 return sys_semtimedop (first, (struct sembuf *)ptr, second,
38 return sys_semtimedop (first, (struct sembuf *)ptr, second,
39 (const struct timespec *)fifth);
41 return sys_semget (first, second, third);
46 if (get_user(fourth.__pad, (void **) ptr))
48 return sys_semctl (first, second, third, fourth);
52 return sys_msgsnd (first, (struct msgbuf *) ptr,
57 struct ipc_kludge tmp;
61 if (copy_from_user(&tmp,
62 (struct ipc_kludge *) ptr,
65 return sys_msgrcv (first, tmp.msgp, second,
69 return sys_msgrcv (first,
70 (struct msgbuf *) ptr,
71 second, fifth, third);
74 return sys_msgget ((key_t) first, second);
76 return sys_msgctl (first, second, (struct msqid_ds *) ptr);
82 ret = sys_shmat (first, (char *) ptr, second, &raddr);
85 return put_user (raddr, (ulong *) third);
87 case 1: /* iBCS2 emulator entry point */
88 if (!segment_eq(get_fs(), get_ds()))
90 return sys_shmat (first, (char *) ptr, second, (ulong *) third);
93 return sys_shmdt ((char *)ptr);
95 return sys_shmget (first, second, third);
97 return sys_shmctl (first, second,
98 (struct shmid_ds *) ptr);