]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/powerpc/kernel/traps.c
powerpc/booke: Add kprobes support for booke style processors
[linux-2.6-omap-h63xx.git] / arch / powerpc / kernel / traps.c
index 4b5b7ff4f78bb0e4564718fd7836f3a1542dae9f..b463d48145a496833e4bd9132011ba00b61532ae 100644 (file)
@@ -1030,21 +1030,29 @@ void SoftwareEmulation(struct pt_regs *regs)
 
 #if defined(CONFIG_40x) || defined(CONFIG_BOOKE)
 
-void DebugException(struct pt_regs *regs, unsigned long debug_status)
+void __kprobes DebugException(struct pt_regs *regs, unsigned long debug_status)
 {
        if (debug_status & DBSR_IC) {   /* instruction completion */
                regs->msr &= ~MSR_DE;
+
+               /* Disable instruction completion */
+               mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) & ~DBCR0_IC);
+               /* Clear the instruction completion event */
+               mtspr(SPRN_DBSR, DBSR_IC);
+
+               if (notify_die(DIE_SSTEP, "single_step", regs, 5,
+                              5, SIGTRAP) == NOTIFY_STOP) {
+                       return;
+               }
+
+               if (debugger_sstep(regs))
+                       return;
+
                if (user_mode(regs)) {
                        current->thread.dbcr0 &= ~DBCR0_IC;
-               } else {
-                       /* Disable instruction completion */
-                       mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) & ~DBCR0_IC);
-                       /* Clear the instruction completion event */
-                       mtspr(SPRN_DBSR, DBSR_IC);
-                       if (debugger_sstep(regs))
-                               return;
                }
-               _exception(SIGTRAP, regs, TRAP_TRACE, 0);
+
+               _exception(SIGTRAP, regs, TRAP_TRACE, regs->nip);
        }
 }
 #endif /* CONFIG_4xx || CONFIG_BOOKE */