diff options
Diffstat (limited to 'arch/mips/kernel/signal_n32.c')
-rw-r--r-- | arch/mips/kernel/signal_n32.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/arch/mips/kernel/signal_n32.c b/arch/mips/kernel/signal_n32.c index 5a3776096f07..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) |