sh: Don't NOTIFY_STOP for non-UBC breakpoint traps.
authorPaul Mundt <lethal@linux-sh.org>
Tue, 22 Dec 2009 03:40:38 +0000 (12:40 +0900)
committerPaul Mundt <lethal@linux-sh.org>
Tue, 22 Dec 2009 03:40:38 +0000 (12:40 +0900)
Presently the hw_breakpoint code is the primary notifier dispatch for
breakpoint traps, although it's only UBC traps that are of particular
interest there. This patches in a check to allow non-UBC generated
breakpoints to pass through down the remainder of the notifier chain,
giving things like kgdb a chance at getting notified.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
arch/sh/kernel/hw_breakpoint.c

index 75b8c471120fd27d80e869b7a41b471833aa6917..022d8ed66bd6d6994a64bc785a0f882c56803369 100644 (file)
@@ -398,9 +398,18 @@ BUILD_TRAP_HANDLER(breakpoint)
 int __kprobes hw_breakpoint_exceptions_notify(struct notifier_block *unused,
                                    unsigned long val, void *data)
 {
+       struct die_args *args = data;
+
        if (val != DIE_BREAKPOINT)
                return NOTIFY_DONE;
 
+       /*
+        * If the breakpoint hasn't been triggered by the UBC, it's
+        * probably from a debugger, so don't do anything more here.
+        */
+       if (args->trapnr != 0x1e0)
+               return NOTIFY_DONE;
+
        return hw_breakpoint_handler(data);
 }