aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/linux32.c
diff options
context:
space:
mode:
authorDavide Libenzi <davidel@xmailserver.org>2007-03-07 23:41:21 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-08 10:38:22 -0500
commitf6dfb4fd7dd94429ef1d5233688aaed2a63f856b (patch)
tree81c29bfad51e187830ca059855aa285e350c9481 /arch/mips/kernel/linux32.c
parentb40df5743ee8aed8674edbbb77b8fd3c8c7a747f (diff)
[PATCH] Add epoll compat_ code to fs/compat.c
IA64 and ARM-OABI are currently using their own version of epoll compat_ code. An architecture needs epoll_event translation if alignof(u64) in 32 bit mode is different from alignof(u64) in 64 bit mode. If an architecture needs epoll_event translation, it must define struct compat_epoll_event in asm/compat.h and set CONFIG_HAVE_COMPAT_EPOLL_EVENT and use compat_sys_epoll_ctl and compat_sys_epoll_wait. All 64 bit architecture should use compat_sys_epoll_pwait. [sfr: restructure and move to fs/compat.c, remove MIPS version of compat_sys_epoll_pwait, use __put_user_unaligned] Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Russell King <rmk@arm.linux.org.uk> Cc: "Luck, Tony" <tony.luck@intel.com> Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/mips/kernel/linux32.c')
-rw-r--r--arch/mips/kernel/linux32.c46
1 files changed, 0 insertions, 46 deletions
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c
index 30d433f14f93..1df544c1f966 100644
--- a/arch/mips/kernel/linux32.c
+++ b/arch/mips/kernel/linux32.c
@@ -564,49 +564,3 @@ _sys32_clone(nabi_no_regargs struct pt_regs regs)
564 return do_fork(clone_flags, newsp, &regs, 0, 564 return do_fork(clone_flags, newsp, &regs, 0,
565 parent_tidptr, child_tidptr); 565 parent_tidptr, child_tidptr);
566} 566}
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 */
572asmlinkage 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(&current->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}