diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2010-10-02 22:57:30 -0400 |
---|---|---|
committer | Geert Uytterhoeven <geert@linux-m68k.org> | 2011-01-07 08:01:34 -0500 |
commit | 9e4930dbf17c1eba72631cd52a0c621da3d1a816 (patch) | |
tree | 0ac397df063473dd4990dd41d4ed76ed5cb2d643 /arch/m68k | |
parent | e68847fee706c6fe74c9afc3288c3adfc131b1fa (diff) |
m68k: Simplify the singlestepping handling in signals
Instead of checking the return value of do_signal() we can just do
the work (raise SIGTRAP and clear SR.T1) directly in handle_signal(),
when setting the sigframe up. Simplifies the assembler glue and is
closer to the way we do it on other targets.
Note that do_delayed_trace does *not* disappear; it's still needed
to deal with single-stepping through syscall, since 68040 doesn't
raise the trace exception at all if the trap exception is pending.
We hit it after returning from sys_...() if TIF_DELAYED_TRACE is
set; all that has changed is that we don't reuse it for "single-step
into the handler" codepath.
As the result, do_signal() doesn't need to return anything anymore.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'arch/m68k')
-rw-r--r-- | arch/m68k/kernel/entry.S | 6 | ||||
-rw-r--r-- | arch/m68k/kernel/signal.c | 11 |
2 files changed, 8 insertions, 9 deletions
diff --git a/arch/m68k/kernel/entry.S b/arch/m68k/kernel/entry.S index 3a15a03297a7..4e49f5777696 100644 --- a/arch/m68k/kernel/entry.S +++ b/arch/m68k/kernel/entry.S | |||
@@ -178,11 +178,7 @@ do_signal_return: | |||
178 | addql #4,%sp | 178 | addql #4,%sp |
179 | RESTORE_SWITCH_STACK | 179 | RESTORE_SWITCH_STACK |
180 | addql #4,%sp | 180 | addql #4,%sp |
181 | tstl %d0 | 181 | jbra resume_userspace |
182 | jeq resume_userspace | ||
183 | | when single stepping into handler stop at the first insn | ||
184 | btst #6,%curptr@(TASK_INFO+TINFO_FLAGS+2) | ||
185 | jeq resume_userspace | ||
186 | 182 | ||
187 | do_delayed_trace: | 183 | do_delayed_trace: |
188 | bclr #7,%sp@(PT_OFF_SR) | clear trace bit in SR | 184 | bclr #7,%sp@(PT_OFF_SR) | clear trace bit in SR |
diff --git a/arch/m68k/kernel/signal.c b/arch/m68k/kernel/signal.c index fa8200d03de2..a18b251fe593 100644 --- a/arch/m68k/kernel/signal.c +++ b/arch/m68k/kernel/signal.c | |||
@@ -978,6 +978,11 @@ handle_signal(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
978 | if (!(ka->sa.sa_flags & SA_NODEFER)) | 978 | if (!(ka->sa.sa_flags & SA_NODEFER)) |
979 | sigaddset(¤t->blocked,sig); | 979 | sigaddset(¤t->blocked,sig); |
980 | recalc_sigpending(); | 980 | recalc_sigpending(); |
981 | |||
982 | if (test_thread_flag(TIF_DELAYED_TRACE)) { | ||
983 | regs->sr &= ~0x8000; | ||
984 | send_sig(SIGTRAP, current, 1); | ||
985 | } | ||
981 | } | 986 | } |
982 | 987 | ||
983 | /* | 988 | /* |
@@ -985,7 +990,7 @@ handle_signal(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
985 | * want to handle. Thus you cannot kill init even with a SIGKILL even by | 990 | * want to handle. Thus you cannot kill init even with a SIGKILL even by |
986 | * mistake. | 991 | * mistake. |
987 | */ | 992 | */ |
988 | asmlinkage int do_signal(struct pt_regs *regs) | 993 | asmlinkage void do_signal(struct pt_regs *regs) |
989 | { | 994 | { |
990 | siginfo_t info; | 995 | siginfo_t info; |
991 | struct k_sigaction ka; | 996 | struct k_sigaction ka; |
@@ -1004,7 +1009,7 @@ asmlinkage int do_signal(struct pt_regs *regs) | |||
1004 | /* Whee! Actually deliver the signal. */ | 1009 | /* Whee! Actually deliver the signal. */ |
1005 | handle_signal(signr, &ka, &info, oldset, regs); | 1010 | handle_signal(signr, &ka, &info, oldset, regs); |
1006 | clear_thread_flag(TIF_RESTORE_SIGMASK); | 1011 | clear_thread_flag(TIF_RESTORE_SIGMASK); |
1007 | return 1; | 1012 | return; |
1008 | } | 1013 | } |
1009 | 1014 | ||
1010 | /* Did we come from a system call? */ | 1015 | /* Did we come from a system call? */ |
@@ -1017,6 +1022,4 @@ asmlinkage int do_signal(struct pt_regs *regs) | |||
1017 | clear_thread_flag(TIF_RESTORE_SIGMASK); | 1022 | clear_thread_flag(TIF_RESTORE_SIGMASK); |
1018 | sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); | 1023 | sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); |
1019 | } | 1024 | } |
1020 | |||
1021 | return 0; | ||
1022 | } | 1025 | } |