diff options
Diffstat (limited to 'arch/sh/kernel/signal_32.c')
-rw-r--r-- | arch/sh/kernel/signal_32.c | 43 |
1 files changed, 9 insertions, 34 deletions
diff --git a/arch/sh/kernel/signal_32.c b/arch/sh/kernel/signal_32.c index 9d7bfd66f189..d6b7b6154f87 100644 --- a/arch/sh/kernel/signal_32.c +++ b/arch/sh/kernel/signal_32.c | |||
@@ -32,8 +32,6 @@ | |||
32 | #include <asm/syscalls.h> | 32 | #include <asm/syscalls.h> |
33 | #include <asm/fpu.h> | 33 | #include <asm/fpu.h> |
34 | 34 | ||
35 | #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) | ||
36 | |||
37 | struct fdpic_func_descriptor { | 35 | struct fdpic_func_descriptor { |
38 | unsigned long text; | 36 | unsigned long text; |
39 | unsigned long GOT; | 37 | unsigned long GOT; |
@@ -226,7 +224,6 @@ asmlinkage int sys_sigreturn(unsigned long r4, unsigned long r5, | |||
226 | sizeof(frame->extramask)))) | 224 | sizeof(frame->extramask)))) |
227 | goto badframe; | 225 | goto badframe; |
228 | 226 | ||
229 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
230 | set_current_blocked(&set); | 227 | set_current_blocked(&set); |
231 | 228 | ||
232 | if (restore_sigcontext(regs, &frame->sc, &r0)) | 229 | if (restore_sigcontext(regs, &frame->sc, &r0)) |
@@ -256,7 +253,6 @@ asmlinkage int sys_rt_sigreturn(unsigned long r4, unsigned long r5, | |||
256 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) | 253 | if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) |
257 | goto badframe; | 254 | goto badframe; |
258 | 255 | ||
259 | sigdelsetmask(&set, ~_BLOCKABLE); | ||
260 | set_current_blocked(&set); | 256 | set_current_blocked(&set); |
261 | 257 | ||
262 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &r0)) | 258 | if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &r0)) |
@@ -522,10 +518,11 @@ handle_syscall_restart(unsigned long save_r0, struct pt_regs *regs, | |||
522 | /* | 518 | /* |
523 | * OK, we're invoking a handler | 519 | * OK, we're invoking a handler |
524 | */ | 520 | */ |
525 | static int | 521 | static void |
526 | handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, | 522 | handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, |
527 | sigset_t *oldset, struct pt_regs *regs, unsigned int save_r0) | 523 | struct pt_regs *regs, unsigned int save_r0) |
528 | { | 524 | { |
525 | sigset_t *oldset = sigmask_to_save(); | ||
529 | int ret; | 526 | int ret; |
530 | 527 | ||
531 | /* Set up the stack frame */ | 528 | /* Set up the stack frame */ |
@@ -534,10 +531,10 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, | |||
534 | else | 531 | else |
535 | ret = setup_frame(sig, ka, oldset, regs); | 532 | ret = setup_frame(sig, ka, oldset, regs); |
536 | 533 | ||
537 | if (ret == 0) | 534 | if (ret) |
538 | block_sigmask(ka, sig); | 535 | return; |
539 | 536 | signal_delivered(sig, info, ka, regs, | |
540 | return ret; | 537 | test_thread_flag(TIF_SINGLESTEP)); |
541 | } | 538 | } |
542 | 539 | ||
543 | /* | 540 | /* |
@@ -554,7 +551,6 @@ static void do_signal(struct pt_regs *regs, unsigned int save_r0) | |||
554 | siginfo_t info; | 551 | siginfo_t info; |
555 | int signr; | 552 | int signr; |
556 | struct k_sigaction ka; | 553 | struct k_sigaction ka; |
557 | sigset_t *oldset; | ||
558 | 554 | ||
559 | /* | 555 | /* |
560 | * We want the common case to go fast, which | 556 | * We want the common case to go fast, which |
@@ -565,30 +561,12 @@ static void do_signal(struct pt_regs *regs, unsigned int save_r0) | |||
565 | if (!user_mode(regs)) | 561 | if (!user_mode(regs)) |
566 | return; | 562 | return; |
567 | 563 | ||
568 | if (current_thread_info()->status & TS_RESTORE_SIGMASK) | ||
569 | oldset = ¤t->saved_sigmask; | ||
570 | else | ||
571 | oldset = ¤t->blocked; | ||
572 | |||
573 | signr = get_signal_to_deliver(&info, &ka, regs, NULL); | 564 | signr = get_signal_to_deliver(&info, &ka, regs, NULL); |
574 | if (signr > 0) { | 565 | if (signr > 0) { |
575 | handle_syscall_restart(save_r0, regs, &ka.sa); | 566 | handle_syscall_restart(save_r0, regs, &ka.sa); |
576 | 567 | ||
577 | /* Whee! Actually deliver the signal. */ | 568 | /* Whee! Actually deliver the signal. */ |
578 | if (handle_signal(signr, &ka, &info, oldset, | 569 | handle_signal(signr, &ka, &info, regs, save_r0); |
579 | regs, save_r0) == 0) { | ||
580 | /* | ||
581 | * A signal was successfully delivered; the saved | ||
582 | * sigmask will have been stored in the signal frame, | ||
583 | * and will be restored by sigreturn, so we can simply | ||
584 | * clear the TS_RESTORE_SIGMASK flag | ||
585 | */ | ||
586 | current_thread_info()->status &= ~TS_RESTORE_SIGMASK; | ||
587 | |||
588 | tracehook_signal_handler(signr, &info, &ka, regs, | ||
589 | test_thread_flag(TIF_SINGLESTEP)); | ||
590 | } | ||
591 | |||
592 | return; | 570 | return; |
593 | } | 571 | } |
594 | 572 | ||
@@ -610,10 +588,7 @@ static void do_signal(struct pt_regs *regs, unsigned int save_r0) | |||
610 | * If there's no signal to deliver, we just put the saved sigmask | 588 | * If there's no signal to deliver, we just put the saved sigmask |
611 | * back. | 589 | * back. |
612 | */ | 590 | */ |
613 | if (current_thread_info()->status & TS_RESTORE_SIGMASK) { | 591 | restore_saved_sigmask(); |
614 | current_thread_info()->status &= ~TS_RESTORE_SIGMASK; | ||
615 | sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); | ||
616 | } | ||
617 | } | 592 | } |
618 | 593 | ||
619 | asmlinkage void do_notify_resume(struct pt_regs *regs, unsigned int save_r0, | 594 | asmlinkage void do_notify_resume(struct pt_regs *regs, unsigned int save_r0, |