diff options
author | Atsushi Nemoto <anemo@mba.ocn.ne.jp> | 2007-01-10 04:53:33 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2007-01-10 15:02:24 -0500 |
commit | e16d8df0be26c8e82c4a1188af8143f2d466b12a (patch) | |
tree | c1b06fe59395286fccc94c7af72bfb6ef5ada773 /arch/mips/kernel/linux32.c | |
parent | 6b4cd2755039a0be642699e3fc2e3386daa88151 (diff) |
[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: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/linux32.c')
-rw-r--r-- | arch/mips/kernel/linux32.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c index b061c9aa6302..de3fae260ff8 100644 --- a/arch/mips/kernel/linux32.c +++ b/arch/mips/kernel/linux32.c | |||
@@ -440,14 +440,26 @@ sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u32 fifth) | |||
440 | } | 440 | } |
441 | 441 | ||
442 | #ifdef CONFIG_MIPS32_N32 | 442 | #ifdef CONFIG_MIPS32_N32 |
443 | asmlinkage long sysn32_semctl(int semid, int semnum, int cmd, union semun arg) | 443 | asmlinkage long sysn32_semctl(int semid, int semnum, int cmd, u32 arg) |
444 | { | 444 | { |
445 | /* compat_sys_semctl expects a pointer to union semun */ | 445 | /* compat_sys_semctl expects a pointer to union semun */ |
446 | u32 __user *uptr = compat_alloc_user_space(sizeof(u32)); | 446 | u32 __user *uptr = compat_alloc_user_space(sizeof(u32)); |
447 | if (put_user(ptr_to_compat(arg.__pad), uptr)) | 447 | if (put_user(arg, uptr)) |
448 | return -EFAULT; | 448 | return -EFAULT; |
449 | return compat_sys_semctl(semid, semnum, cmd, uptr); | 449 | return compat_sys_semctl(semid, semnum, cmd, uptr); |
450 | } | 450 | } |
451 | |||
452 | asmlinkage long sysn32_msgsnd(int msqid, u32 msgp, unsigned msgsz, int msgflg) | ||
453 | { | ||
454 | return compat_sys_msgsnd(msqid, msgsz, msgflg, compat_ptr(msgp)); | ||
455 | } | ||
456 | |||
457 | asmlinkage long sysn32_msgrcv(int msqid, u32 msgp, size_t msgsz, int msgtyp, | ||
458 | int msgflg) | ||
459 | { | ||
460 | return compat_sys_msgrcv(msqid, msgsz, msgtyp, msgflg, IPC_64, | ||
461 | compat_ptr(msgp)); | ||
462 | } | ||
451 | #endif | 463 | #endif |
452 | 464 | ||
453 | struct sysctl_args32 | 465 | struct sysctl_args32 |