diff options
Diffstat (limited to 'arch/sparc/kernel/signal_32.c')
-rw-r--r-- | arch/sparc/kernel/signal_32.c | 29 |
1 files changed, 2 insertions, 27 deletions
diff --git a/arch/sparc/kernel/signal_32.c b/arch/sparc/kernel/signal_32.c index 68f9c8650af4..cd1823487759 100644 --- a/arch/sparc/kernel/signal_32.c +++ b/arch/sparc/kernel/signal_32.c | |||
@@ -59,18 +59,6 @@ struct rt_signal_frame { | |||
59 | #define SF_ALIGNEDSZ (((sizeof(struct signal_frame) + 7) & (~7))) | 59 | #define SF_ALIGNEDSZ (((sizeof(struct signal_frame) + 7) & (~7))) |
60 | #define RT_ALIGNEDSZ (((sizeof(struct rt_signal_frame) + 7) & (~7))) | 60 | #define RT_ALIGNEDSZ (((sizeof(struct rt_signal_frame) + 7) & (~7))) |
61 | 61 | ||
62 | static int _sigpause_common(old_sigset_t set) | ||
63 | { | ||
64 | sigset_t blocked; | ||
65 | siginitset(&blocked, set); | ||
66 | return sigsuspend(&blocked); | ||
67 | } | ||
68 | |||
69 | asmlinkage int sys_sigsuspend(old_sigset_t set) | ||
70 | { | ||
71 | return _sigpause_common(set); | ||
72 | } | ||
73 | |||
74 | asmlinkage void do_sigreturn(struct pt_regs *regs) | 62 | asmlinkage void do_sigreturn(struct pt_regs *regs) |
75 | { | 63 | { |
76 | struct signal_frame __user *sf; | 64 | struct signal_frame __user *sf; |
@@ -141,9 +129,7 @@ asmlinkage void do_rt_sigreturn(struct pt_regs *regs) | |||
141 | unsigned int psr, pc, npc; | 129 | unsigned int psr, pc, npc; |
142 | __siginfo_fpu_t __user *fpu_save; | 130 | __siginfo_fpu_t __user *fpu_save; |
143 | __siginfo_rwin_t __user *rwin_save; | 131 | __siginfo_rwin_t __user *rwin_save; |
144 | mm_segment_t old_fs; | ||
145 | sigset_t set; | 132 | sigset_t set; |
146 | stack_t st; | ||
147 | int err; | 133 | int err; |
148 | 134 | ||
149 | synchronize_user_stack(); | 135 | synchronize_user_stack(); |
@@ -171,8 +157,7 @@ asmlinkage void do_rt_sigreturn(struct pt_regs *regs) | |||
171 | if (!err && fpu_save) | 157 | if (!err && fpu_save) |
172 | err |= restore_fpu_state(regs, fpu_save); | 158 | err |= restore_fpu_state(regs, fpu_save); |
173 | err |= __copy_from_user(&set, &sf->mask, sizeof(sigset_t)); | 159 | err |= __copy_from_user(&set, &sf->mask, sizeof(sigset_t)); |
174 | 160 | err |= restore_altstack(&sf->stack); | |
175 | err |= __copy_from_user(&st, &sf->stack, sizeof(stack_t)); | ||
176 | 161 | ||
177 | if (err) | 162 | if (err) |
178 | goto segv; | 163 | goto segv; |
@@ -180,14 +165,6 @@ asmlinkage void do_rt_sigreturn(struct pt_regs *regs) | |||
180 | regs->pc = pc; | 165 | regs->pc = pc; |
181 | regs->npc = npc; | 166 | regs->npc = npc; |
182 | 167 | ||
183 | /* It is more difficult to avoid calling this function than to | ||
184 | * call it and ignore errors. | ||
185 | */ | ||
186 | old_fs = get_fs(); | ||
187 | set_fs(KERNEL_DS); | ||
188 | do_sigaltstack((const stack_t __user *) &st, NULL, (unsigned long)sf); | ||
189 | set_fs(old_fs); | ||
190 | |||
191 | err |= __get_user(rwin_save, &sf->rwin_save); | 168 | err |= __get_user(rwin_save, &sf->rwin_save); |
192 | if (!err && rwin_save) { | 169 | if (!err && rwin_save) { |
193 | if (restore_rwin_state(rwin_save)) | 170 | if (restore_rwin_state(rwin_save)) |
@@ -391,9 +368,7 @@ static int setup_rt_frame(struct k_sigaction *ka, struct pt_regs *regs, | |||
391 | err |= __copy_to_user(&sf->mask, &oldset->sig[0], sizeof(sigset_t)); | 368 | err |= __copy_to_user(&sf->mask, &oldset->sig[0], sizeof(sigset_t)); |
392 | 369 | ||
393 | /* Setup sigaltstack */ | 370 | /* Setup sigaltstack */ |
394 | err |= __put_user(current->sas_ss_sp, &sf->stack.ss_sp); | 371 | err |= __save_altstack(&sf->stack, regs->u_regs[UREG_FP]); |
395 | err |= __put_user(sas_ss_flags(regs->u_regs[UREG_FP]), &sf->stack.ss_flags); | ||
396 | err |= __put_user(current->sas_ss_size, &sf->stack.ss_size); | ||
397 | 372 | ||
398 | if (!wsaved) { | 373 | if (!wsaved) { |
399 | err |= __copy_to_user(sf, (char *) regs->u_regs[UREG_FP], | 374 | err |= __copy_to_user(sf, (char *) regs->u_regs[UREG_FP], |