]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/blackfin/kernel/signal.c
Merge branch 'topic/jack' into for-linus
[linux-2.6-omap-h63xx.git] / arch / blackfin / kernel / signal.c
index d1fa24401dc6995d92410efb3948989049682e52..dbc3bbf846be2f4cf7197644fa287c5e9f8ed070 100644 (file)
@@ -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;
@@ -212,7 +215,7 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t * info,
 
        /* Set up registers for signal handler */
        wrusp((unsigned long)frame);
-       if (get_personality & FDPIC_FUNCPTRS) {
+       if (current->personality & FDPIC_FUNCPTRS) {
                struct fdpic_func_descriptor __user *funcptr =
                        (struct fdpic_func_descriptor *) ka->sa.sa_handler;
                __get_user(regs->pc, &funcptr->text);
@@ -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: