aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-05-21 23:42:15 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-06-01 12:58:49 -0400
commita610d6e672d6d3723e8da257ad4a8a288a8f2f89 (patch)
tree2fac6ce7f72756771f4f87583205cc402589dcad /arch/sh
parent5754f412a3f107cbcd93ee125bef296f2a07539b (diff)
pull clearing RESTORE_SIGMASK into block_sigmask()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/sh')
-rw-r--r--arch/sh/kernel/signal_32.c26
-rw-r--r--arch/sh/kernel/signal_64.c24
2 files changed, 15 insertions, 35 deletions
diff --git a/arch/sh/kernel/signal_32.c b/arch/sh/kernel/signal_32.c
index bfb3d599f032..2675a97f374f 100644
--- a/arch/sh/kernel/signal_32.c
+++ b/arch/sh/kernel/signal_32.c
@@ -522,7 +522,7 @@ handle_syscall_restart(unsigned long save_r0, struct pt_regs *regs,
522/* 522/*
523 * OK, we're invoking a handler 523 * OK, we're invoking a handler
524 */ 524 */
525static int 525static void
526handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info, 526handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
527 struct pt_regs *regs, unsigned int save_r0) 527 struct pt_regs *regs, unsigned int save_r0)
528{ 528{
@@ -535,10 +535,11 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
535 else 535 else
536 ret = setup_frame(sig, ka, oldset, regs); 536 ret = setup_frame(sig, ka, oldset, regs);
537 537
538 if (ret == 0) 538 if (ret)
539 block_sigmask(ka, sig); 539 return;
540 540 block_sigmask(ka, sig);
541 return ret; 541 tracehook_signal_handler(sig, info, ka, regs,
542 test_thread_flag(TIF_SINGLESTEP));
542} 543}
543 544
544/* 545/*
@@ -570,20 +571,7 @@ static void do_signal(struct pt_regs *regs, unsigned int save_r0)
570 handle_syscall_restart(save_r0, regs, &ka.sa); 571 handle_syscall_restart(save_r0, regs, &ka.sa);
571 572
572 /* Whee! Actually deliver the signal. */ 573 /* Whee! Actually deliver the signal. */
573 if (handle_signal(signr, &ka, &info, 574 handle_signal(signr, &ka, &info, regs, save_r0);
574 regs, save_r0) == 0) {
575 /*
576 * A signal was successfully delivered; the saved
577 * sigmask will have been stored in the signal frame,
578 * and will be restored by sigreturn, so we can simply
579 * clear the TS_RESTORE_SIGMASK flag
580 */
581 current_thread_info()->status &= ~TS_RESTORE_SIGMASK;
582
583 tracehook_signal_handler(signr, &info, &ka, regs,
584 test_thread_flag(TIF_SINGLESTEP));
585 }
586
587 return; 575 return;
588 } 576 }
589 577
diff --git a/arch/sh/kernel/signal_64.c b/arch/sh/kernel/signal_64.c
index aeeab070aaa9..7075c63bfc6f 100644
--- a/arch/sh/kernel/signal_64.c
+++ b/arch/sh/kernel/signal_64.c
@@ -43,7 +43,7 @@
43 43
44#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) 44#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
45 45
46static int 46static void
47handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, 47handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
48 struct pt_regs * regs); 48 struct pt_regs * regs);
49 49
@@ -103,17 +103,7 @@ static void do_signal(struct pt_regs *regs)
103 handle_syscall_restart(regs, &ka.sa); 103 handle_syscall_restart(regs, &ka.sa);
104 104
105 /* Whee! Actually deliver the signal. */ 105 /* Whee! Actually deliver the signal. */
106 if (handle_signal(signr, &info, &ka, regs) == 0) { 106 handle_signal(signr, &info, &ka, regs);
107 /*
108 * If a signal was successfully delivered, the
109 * saved sigmask is in its frame, and we can
110 * clear the TS_RESTORE_SIGMASK flag.
111 */
112 current_thread_info()->status &= ~TS_RESTORE_SIGMASK;
113
114 tracehook_signal_handler(signr, &info, &ka, regs,
115 test_thread_flag(TIF_SINGLESTEP));
116 }
117 return; 107 return;
118 } 108 }
119 109
@@ -648,7 +638,7 @@ give_sigsegv:
648/* 638/*
649 * OK, we're invoking a handler 639 * OK, we're invoking a handler
650 */ 640 */
651static int 641static void
652handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, 642handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
653 struct pt_regs * regs) 643 struct pt_regs * regs)
654{ 644{
@@ -661,10 +651,12 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
661 else 651 else
662 ret = setup_frame(sig, ka, oldset, regs); 652 ret = setup_frame(sig, ka, oldset, regs);
663 653
664 if (ret == 0) 654 if (ret)
665 block_sigmask(ka, sig); 655 return;
666 656
667 return ret; 657 block_sigmask(ka, sig);
658 tracehook_signal_handler(sig, info, ka, regs,
659 test_thread_flag(TIF_SINGLESTEP));
668} 660}
669 661
670asmlinkage void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags) 662asmlinkage void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags)