Commit e16d8df0 authored by Atsushi Nemoto's avatar Atsushi Nemoto Committed by Ralf Baechle

[MIPS] Fix N32 SysV IPC routines

Add wrappers for N32 msg{snd,rcv}.  compat_sys_msg{snd,rcv} can not not be
used as system call entries as is.  This fix is based on Kaz Kylheku's
patch.

Also change a type of last argument of sysn32_semctl to match its true
size.
Signed-off-by: default avatarAtsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent 6b4cd275
...@@ -440,14 +440,26 @@ sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u32 fifth) ...@@ -440,14 +440,26 @@ sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u32 fifth)
} }
#ifdef CONFIG_MIPS32_N32 #ifdef CONFIG_MIPS32_N32
asmlinkage long sysn32_semctl(int semid, int semnum, int cmd, union semun arg) asmlinkage long sysn32_semctl(int semid, int semnum, int cmd, u32 arg)
{ {
/* compat_sys_semctl expects a pointer to union semun */ /* compat_sys_semctl expects a pointer to union semun */
u32 __user *uptr = compat_alloc_user_space(sizeof(u32)); u32 __user *uptr = compat_alloc_user_space(sizeof(u32));
if (put_user(ptr_to_compat(arg.__pad), uptr)) if (put_user(arg, uptr))
return -EFAULT; return -EFAULT;
return compat_sys_semctl(semid, semnum, cmd, uptr); return compat_sys_semctl(semid, semnum, cmd, uptr);
} }
asmlinkage long sysn32_msgsnd(int msqid, u32 msgp, unsigned msgsz, int msgflg)
{
return compat_sys_msgsnd(msqid, msgsz, msgflg, compat_ptr(msgp));
}
asmlinkage long sysn32_msgrcv(int msqid, u32 msgp, size_t msgsz, int msgtyp,
int msgflg)
{
return compat_sys_msgrcv(msqid, msgsz, msgtyp, msgflg, IPC_64,
compat_ptr(msgp));
}
#endif #endif
struct sysctl_args32 struct sysctl_args32
......
...@@ -187,8 +187,8 @@ EXPORT(sysn32_call_table) ...@@ -187,8 +187,8 @@ EXPORT(sysn32_call_table)
PTR sysn32_semctl PTR sysn32_semctl
PTR sys_shmdt /* 6065 */ PTR sys_shmdt /* 6065 */
PTR sys_msgget PTR sys_msgget
PTR compat_sys_msgsnd PTR sysn32_msgsnd
PTR compat_sys_msgrcv PTR sysn32_msgrcv
PTR compat_sys_msgctl PTR compat_sys_msgctl
PTR compat_sys_fcntl /* 6070 */ PTR compat_sys_fcntl /* 6070 */
PTR sys_flock PTR sys_flock
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment