aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/signal_32.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/kernel/signal_32.c')
-rw-r--r--arch/sh/kernel/signal_32.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/arch/sh/kernel/signal_32.c b/arch/sh/kernel/signal_32.c
index 4bbbde895a5..51689d29ad4 100644
--- a/arch/sh/kernel/signal_32.c
+++ b/arch/sh/kernel/signal_32.c
@@ -24,6 +24,7 @@
24#include <linux/binfmts.h> 24#include <linux/binfmts.h>
25#include <linux/freezer.h> 25#include <linux/freezer.h>
26#include <linux/io.h> 26#include <linux/io.h>
27#include <linux/tracehook.h>
27#include <asm/system.h> 28#include <asm/system.h>
28#include <asm/ucontext.h> 29#include <asm/ucontext.h>
29#include <asm/uaccess.h> 30#include <asm/uaccess.h>
@@ -507,14 +508,13 @@ handle_signal(unsigned long sig, struct k_sigaction *ka, siginfo_t *info,
507 switch (regs->regs[0]) { 508 switch (regs->regs[0]) {
508 case -ERESTART_RESTARTBLOCK: 509 case -ERESTART_RESTARTBLOCK:
509 case -ERESTARTNOHAND: 510 case -ERESTARTNOHAND:
511 no_system_call_restart:
510 regs->regs[0] = -EINTR; 512 regs->regs[0] = -EINTR;
511 break; 513 break;
512 514
513 case -ERESTARTSYS: 515 case -ERESTARTSYS:
514 if (!(ka->sa.sa_flags & SA_RESTART)) { 516 if (!(ka->sa.sa_flags & SA_RESTART))
515 regs->regs[0] = -EINTR; 517 goto no_system_call_restart;
516 break;
517 }
518 /* fallthrough */ 518 /* fallthrough */
519 case -ERESTARTNOINTR: 519 case -ERESTARTNOINTR:
520 regs->regs[0] = save_r0; 520 regs->regs[0] = save_r0;
@@ -589,12 +589,15 @@ static void do_signal(struct pt_regs *regs, unsigned int save_r0)
589 * clear the TIF_RESTORE_SIGMASK flag */ 589 * clear the TIF_RESTORE_SIGMASK flag */
590 if (test_thread_flag(TIF_RESTORE_SIGMASK)) 590 if (test_thread_flag(TIF_RESTORE_SIGMASK))
591 clear_thread_flag(TIF_RESTORE_SIGMASK); 591 clear_thread_flag(TIF_RESTORE_SIGMASK);
592
593 tracehook_signal_handler(signr, &info, &ka, regs,
594 test_thread_flag(TIF_SINGLESTEP));
592 } 595 }
593 596
594 return; 597 return;
595 } 598 }
596 599
597 no_signal: 600no_signal:
598 /* Did we come from a system call? */ 601 /* Did we come from a system call? */
599 if (regs->tra >= 0) { 602 if (regs->tra >= 0) {
600 /* Restart the system call - no handlers present */ 603 /* Restart the system call - no handlers present */
@@ -618,9 +621,14 @@ static void do_signal(struct pt_regs *regs, unsigned int save_r0)
618} 621}
619 622
620asmlinkage void do_notify_resume(struct pt_regs *regs, unsigned int save_r0, 623asmlinkage void do_notify_resume(struct pt_regs *regs, unsigned int save_r0,
621 __u32 thread_info_flags) 624 unsigned long thread_info_flags)
622{ 625{
623 /* deal with pending signal delivery */ 626 /* deal with pending signal delivery */
624 if (thread_info_flags & (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK)) 627 if (thread_info_flags & _TIF_SIGPENDING)
625 do_signal(regs, save_r0); 628 do_signal(regs, save_r0);
629
630 if (thread_info_flags & _TIF_NOTIFY_RESUME) {
631 clear_thread_flag(TIF_NOTIFY_RESUME);
632 tracehook_notify_resume(regs);
633 }
626} 634}