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_semop (first, (struct sembuf *)ptr, second);
37 return sys_semget (first, second, third);
42 if (get_user(fourth.__pad, (void **) ptr))
44 return sys_semctl (first, second, third, fourth);
48 return sys_msgsnd (first, (struct msgbuf *) ptr,
53 struct ipc_kludge tmp;
57 if (copy_from_user(&tmp,
58 (struct ipc_kludge *) ptr,
61 return sys_msgrcv (first, tmp.msgp, second,
65 return sys_msgrcv (first,
66 (struct msgbuf *) ptr,
67 second, fifth, third);
70 return sys_msgget ((key_t) first, second);
72 return sys_msgctl (first, second, (struct msqid_ds *) ptr);
78 ret = sys_shmat (first, (char *) ptr, second, &raddr);
81 return put_user (raddr, (ulong *) third);
83 case 1: /* iBCS2 emulator entry point */
84 if (!segment_eq(get_fs(), get_ds()))
86 return sys_shmat (first, (char *) ptr, second, (ulong *) third);
89 return sys_shmdt ((char *)ptr);
91 return sys_shmget (first, second, third);
93 return sys_shmctl (first, second,
94 (struct shmid_ds *) ptr);