diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-12-23 03:13:40 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-02-03 18:32:24 -0500 |
commit | ea536ad4f231a0055792d9b144715605cbd670c1 (patch) | |
tree | 31c7cd55f356cc80ba28b6e989e99af27fd2c567 /arch/mips/kernel/signal.c | |
parent | c6489c147de592af4d0d1c5263e7b4f0e8e7d100 (diff) |
mips: switch to generic sigaltstack
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/mips/kernel/signal.c')
-rw-r--r-- | arch/mips/kernel/signal.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c index 4d790d1f03d6..eab30865b2bd 100644 --- a/arch/mips/kernel/signal.c +++ b/arch/mips/kernel/signal.c | |||
@@ -313,15 +313,6 @@ SYSCALL_DEFINE3(sigaction, int, sig, const struct sigaction __user *, act, | |||
313 | } | 313 | } |
314 | #endif | 314 | #endif |
315 | 315 | ||
316 | asmlinkage int sys_sigaltstack(nabi_no_regargs struct pt_regs regs) | ||
317 | { | ||
318 | const stack_t __user *uss = (const stack_t __user *) regs.regs[4]; | ||
319 | stack_t __user *uoss = (stack_t __user *) regs.regs[5]; | ||
320 | unsigned long usp = regs.regs[29]; | ||
321 | |||
322 | return do_sigaltstack(uss, uoss, usp); | ||
323 | } | ||
324 | |||
325 | #ifdef CONFIG_TRAD_SIGNALS | 316 | #ifdef CONFIG_TRAD_SIGNALS |
326 | asmlinkage void sys_sigreturn(nabi_no_regargs struct pt_regs regs) | 317 | asmlinkage void sys_sigreturn(nabi_no_regargs struct pt_regs regs) |
327 | { | 318 | { |
@@ -378,9 +369,8 @@ asmlinkage void sys_rt_sigreturn(nabi_no_regargs struct pt_regs regs) | |||
378 | else if (sig) | 369 | else if (sig) |
379 | force_sig(sig, current); | 370 | force_sig(sig, current); |
380 | 371 | ||
381 | /* It is more difficult to avoid calling this function than to | 372 | if (restore_altstack(&frame->rs_uc.uc_stack)) |
382 | call it and ignore errors. */ | 373 | goto badframe; |
383 | do_sigaltstack(&frame->rs_uc.uc_stack, NULL, regs.regs[29]); | ||
384 | 374 | ||
385 | /* | 375 | /* |
386 | * Don't let your children do this ... | 376 | * Don't let your children do this ... |
@@ -457,12 +447,7 @@ static int setup_rt_frame(void *sig_return, struct k_sigaction *ka, | |||
457 | /* Create the ucontext. */ | 447 | /* Create the ucontext. */ |
458 | err |= __put_user(0, &frame->rs_uc.uc_flags); | 448 | err |= __put_user(0, &frame->rs_uc.uc_flags); |
459 | err |= __put_user(NULL, &frame->rs_uc.uc_link); | 449 | err |= __put_user(NULL, &frame->rs_uc.uc_link); |
460 | err |= __put_user((void __user *)current->sas_ss_sp, | 450 | err |= __save_altstack(&frame->rs_uc.uc_stack, regs->regs[29]); |
461 | &frame->rs_uc.uc_stack.ss_sp); | ||
462 | err |= __put_user(sas_ss_flags(regs->regs[29]), | ||
463 | &frame->rs_uc.uc_stack.ss_flags); | ||
464 | err |= __put_user(current->sas_ss_size, | ||
465 | &frame->rs_uc.uc_stack.ss_size); | ||
466 | err |= setup_sigcontext(regs, &frame->rs_uc.uc_mcontext); | 451 | err |= setup_sigcontext(regs, &frame->rs_uc.uc_mcontext); |
467 | err |= __copy_to_user(&frame->rs_uc.uc_sigmask, set, sizeof(*set)); | 452 | err |= __copy_to_user(&frame->rs_uc.uc_sigmask, set, sizeof(*set)); |
468 | 453 | ||