diff options
Diffstat (limited to 'arch/mips/kernel/linux32.c')
-rw-r--r-- | arch/mips/kernel/linux32.c | 58 |
1 files changed, 12 insertions, 46 deletions
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c index 30d433f14f93..37849edd0645 100644 --- a/arch/mips/kernel/linux32.c +++ b/arch/mips/kernel/linux32.c | |||
@@ -311,6 +311,8 @@ asmlinkage int sys32_sched_rr_get_interval(compat_pid_t pid, | |||
311 | return ret; | 311 | return ret; |
312 | } | 312 | } |
313 | 313 | ||
314 | #ifdef CONFIG_SYSVIPC | ||
315 | |||
314 | asmlinkage long | 316 | asmlinkage long |
315 | sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u32 fifth) | 317 | sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u32 fifth) |
316 | { | 318 | { |
@@ -368,6 +370,16 @@ sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u32 fifth) | |||
368 | return err; | 370 | return err; |
369 | } | 371 | } |
370 | 372 | ||
373 | #else | ||
374 | |||
375 | asmlinkage long | ||
376 | sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u32 fifth) | ||
377 | { | ||
378 | return -ENOSYS; | ||
379 | } | ||
380 | |||
381 | #endif /* CONFIG_SYSVIPC */ | ||
382 | |||
371 | #ifdef CONFIG_MIPS32_N32 | 383 | #ifdef CONFIG_MIPS32_N32 |
372 | asmlinkage long sysn32_semctl(int semid, int semnum, int cmd, u32 arg) | 384 | asmlinkage long sysn32_semctl(int semid, int semnum, int cmd, u32 arg) |
373 | { | 385 | { |
@@ -564,49 +576,3 @@ _sys32_clone(nabi_no_regargs struct pt_regs regs) | |||
564 | return do_fork(clone_flags, newsp, ®s, 0, | 576 | return do_fork(clone_flags, newsp, ®s, 0, |
565 | parent_tidptr, child_tidptr); | 577 | parent_tidptr, child_tidptr); |
566 | } | 578 | } |
567 | |||
568 | /* | ||
569 | * Implement the event wait interface for the eventpoll file. It is the kernel | ||
570 | * part of the user space epoll_pwait(2). | ||
571 | */ | ||
572 | asmlinkage long compat_sys_epoll_pwait(int epfd, | ||
573 | struct epoll_event __user *events, int maxevents, int timeout, | ||
574 | const compat_sigset_t __user *sigmask, size_t sigsetsize) | ||
575 | { | ||
576 | int error; | ||
577 | sigset_t ksigmask, sigsaved; | ||
578 | |||
579 | /* | ||
580 | * If the caller wants a certain signal mask to be set during the wait, | ||
581 | * we apply it here. | ||
582 | */ | ||
583 | if (sigmask) { | ||
584 | if (sigsetsize != sizeof(sigset_t)) | ||
585 | return -EINVAL; | ||
586 | if (!access_ok(VERIFY_READ, sigmask, sizeof(ksigmask))) | ||
587 | return -EFAULT; | ||
588 | if (__copy_conv_sigset_from_user(&ksigmask, sigmask)) | ||
589 | return -EFAULT; | ||
590 | sigdelsetmask(&ksigmask, sigmask(SIGKILL) | sigmask(SIGSTOP)); | ||
591 | sigprocmask(SIG_SETMASK, &ksigmask, &sigsaved); | ||
592 | } | ||
593 | |||
594 | error = sys_epoll_wait(epfd, events, maxevents, timeout); | ||
595 | |||
596 | /* | ||
597 | * If we changed the signal mask, we need to restore the original one. | ||
598 | * In case we've got a signal while waiting, we do not restore the | ||
599 | * signal mask yet, and we allow do_signal() to deliver the signal on | ||
600 | * the way back to userspace, before the signal mask is restored. | ||
601 | */ | ||
602 | if (sigmask) { | ||
603 | if (error == -EINTR) { | ||
604 | memcpy(¤t->saved_sigmask, &sigsaved, | ||
605 | sizeof(sigsaved)); | ||
606 | set_thread_flag(TIF_RESTORE_SIGMASK); | ||
607 | } else | ||
608 | sigprocmask(SIG_SETMASK, &sigsaved, NULL); | ||
609 | } | ||
610 | |||
611 | return error; | ||
612 | } | ||