summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernd Schmidt <bernds_cb1@t-online.de>2008-05-07 11:41:26 +0800
committerBryan Wu <cooloney@kernel.org>2008-05-07 11:41:26 +0800
commit8513c42edb3f1c91a8418fae11846c87cf7b8581 (patch)
treed8e4b855507413b55a0097aa86885d8e3fd037c6
parent7d39270d31b91647722823a0919164dea9fd4ad7 (diff)
downloadlinux-8513c42edb3f1c91a8418fae11846c87cf7b8581.tar.gz
linux-8513c42edb3f1c91a8418fae11846c87cf7b8581.tar.bz2
linux-8513c42edb3f1c91a8418fae11846c87cf7b8581.zip
[Blackfin] arch: disable single stepping when delivering a signal
When delivering a signal, disable single stepping but call ptrace_notify if it was enabled before. The idea was taken from the x86 port. Signed-off-by: Bernd Schmidt <bernds_cb1@t-online.de> Signed-off-by: Bryan Wu <cooloney@kernel.org>
-rw-r--r--arch/blackfin/kernel/signal.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/blackfin/kernel/signal.c b/arch/blackfin/kernel/signal.c
index cb9d883d493c..dbc3bbf846be 100644
--- a/arch/blackfin/kernel/signal.c
+++ b/arch/blackfin/kernel/signal.c
@@ -42,6 +42,9 @@
#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
+/* Location of the trace bit in SYSCFG. */
+#define TRACE_BITS 0x0001
+
struct fdpic_func_descriptor {
unsigned long text;
unsigned long GOT;
@@ -225,6 +228,16 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t * info,
regs->r1 = (unsigned long)(&frame->info);
regs->r2 = (unsigned long)(&frame->uc);
+ /*
+ * Clear the trace flag when entering the signal handler, but
+ * notify any tracer that was single-stepping it. The tracer
+ * may want to single-step inside the handler too.
+ */
+ if (regs->syscfg & TRACE_BITS) {
+ regs->syscfg &= ~TRACE_BITS;
+ ptrace_notify(SIGTRAP);
+ }
+
return 0;
give_sigsegv: