diff options
author | Paul Mackerras <paulus@samba.org> | 2006-02-23 22:05:47 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-02-23 22:05:47 -0500 |
commit | a00428f5b149e36b8225b2a0812742a6dfb07b8c (patch) | |
tree | a78869cd67cf78a0eb091fb0ea5d397734bd6738 /arch/mips/kernel/signal_n32.c | |
parent | 774fee58c465ea1c7e9775e347ec307bcf2deeb3 (diff) | |
parent | fb5c594c2acc441f0d2d8f457484a0e0e9285db3 (diff) |
Merge ../powerpc-merge
Diffstat (limited to 'arch/mips/kernel/signal_n32.c')
-rw-r--r-- | arch/mips/kernel/signal_n32.c | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/arch/mips/kernel/signal_n32.c b/arch/mips/kernel/signal_n32.c index 384fc4a639a4..3e168c08a3a8 100644 --- a/arch/mips/kernel/signal_n32.c +++ b/arch/mips/kernel/signal_n32.c | |||
@@ -81,6 +81,39 @@ struct rt_sigframe_n32 { | |||
81 | #endif | 81 | #endif |
82 | }; | 82 | }; |
83 | 83 | ||
84 | extern void sigset_from_compat (sigset_t *set, compat_sigset_t *compat); | ||
85 | |||
86 | save_static_function(sysn32_rt_sigsuspend); | ||
87 | __attribute_used__ noinline static int | ||
88 | _sysn32_rt_sigsuspend(nabi_no_regargs struct pt_regs regs) | ||
89 | { | ||
90 | compat_sigset_t __user *unewset, uset; | ||
91 | size_t sigsetsize; | ||
92 | sigset_t newset; | ||
93 | |||
94 | /* XXX Don't preclude handling different sized sigset_t's. */ | ||
95 | sigsetsize = regs.regs[5]; | ||
96 | if (sigsetsize != sizeof(sigset_t)) | ||
97 | return -EINVAL; | ||
98 | |||
99 | unewset = (compat_sigset_t __user *) regs.regs[4]; | ||
100 | if (copy_from_user(&uset, unewset, sizeof(uset))) | ||
101 | return -EFAULT; | ||
102 | sigset_from_compat (&newset, &uset); | ||
103 | sigdelsetmask(&newset, ~_BLOCKABLE); | ||
104 | |||
105 | spin_lock_irq(¤t->sighand->siglock); | ||
106 | current->saved_sigmask = current->blocked; | ||
107 | current->blocked = newset; | ||
108 | recalc_sigpending(); | ||
109 | spin_unlock_irq(¤t->sighand->siglock); | ||
110 | |||
111 | current->state = TASK_INTERRUPTIBLE; | ||
112 | schedule(); | ||
113 | set_thread_flag(TIF_RESTORE_SIGMASK); | ||
114 | return -ERESTARTNOHAND; | ||
115 | } | ||
116 | |||
84 | save_static_function(sysn32_rt_sigreturn); | 117 | save_static_function(sysn32_rt_sigreturn); |
85 | __attribute_used__ noinline static void | 118 | __attribute_used__ noinline static void |
86 | _sysn32_rt_sigreturn(nabi_no_regargs struct pt_regs regs) | 119 | _sysn32_rt_sigreturn(nabi_no_regargs struct pt_regs regs) |
@@ -108,7 +141,7 @@ _sysn32_rt_sigreturn(nabi_no_regargs struct pt_regs regs) | |||
108 | /* The ucontext contains a stack32_t, so we must convert! */ | 141 | /* The ucontext contains a stack32_t, so we must convert! */ |
109 | if (__get_user(sp, &frame->rs_uc.uc_stack.ss_sp)) | 142 | if (__get_user(sp, &frame->rs_uc.uc_stack.ss_sp)) |
110 | goto badframe; | 143 | goto badframe; |
111 | st.ss_size = (long) sp; | 144 | st.ss_sp = (void *)(long) sp; |
112 | if (__get_user(st.ss_size, &frame->rs_uc.uc_stack.ss_size)) | 145 | if (__get_user(st.ss_size, &frame->rs_uc.uc_stack.ss_size)) |
113 | goto badframe; | 146 | goto badframe; |
114 | if (__get_user(st.ss_flags, &frame->rs_uc.uc_stack.ss_flags)) | 147 | if (__get_user(st.ss_flags, &frame->rs_uc.uc_stack.ss_flags)) |