aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/traps.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/traps.c')
-rw-r--r--arch/powerpc/kernel/traps.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 4b5b7ff4f78b..b463d48145a4 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -1030,21 +1030,29 @@ void SoftwareEmulation(struct pt_regs *regs)
1030 1030
1031#if defined(CONFIG_40x) || defined(CONFIG_BOOKE) 1031#if defined(CONFIG_40x) || defined(CONFIG_BOOKE)
1032 1032
1033void DebugException(struct pt_regs *regs, unsigned long debug_status) 1033void __kprobes DebugException(struct pt_regs *regs, unsigned long debug_status)
1034{ 1034{
1035 if (debug_status & DBSR_IC) { /* instruction completion */ 1035 if (debug_status & DBSR_IC) { /* instruction completion */
1036 regs->msr &= ~MSR_DE; 1036 regs->msr &= ~MSR_DE;
1037
1038 /* Disable instruction completion */
1039 mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) & ~DBCR0_IC);
1040 /* Clear the instruction completion event */
1041 mtspr(SPRN_DBSR, DBSR_IC);
1042
1043 if (notify_die(DIE_SSTEP, "single_step", regs, 5,
1044 5, SIGTRAP) == NOTIFY_STOP) {
1045 return;
1046 }
1047
1048 if (debugger_sstep(regs))
1049 return;
1050
1037 if (user_mode(regs)) { 1051 if (user_mode(regs)) {
1038 current->thread.dbcr0 &= ~DBCR0_IC; 1052 current->thread.dbcr0 &= ~DBCR0_IC;
1039 } else {
1040 /* Disable instruction completion */
1041 mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) & ~DBCR0_IC);
1042 /* Clear the instruction completion event */
1043 mtspr(SPRN_DBSR, DBSR_IC);
1044 if (debugger_sstep(regs))
1045 return;
1046 } 1053 }
1047 _exception(SIGTRAP, regs, TRAP_TRACE, 0); 1054
1055 _exception(SIGTRAP, regs, TRAP_TRACE, regs->nip);
1048 } 1056 }
1049} 1057}
1050#endif /* CONFIG_4xx || CONFIG_BOOKE */ 1058#endif /* CONFIG_4xx || CONFIG_BOOKE */