aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorJosh Boyer <jwboyer@linux.vnet.ibm.com>2009-10-05 00:46:05 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-10-27 01:42:40 -0400
commitcdd3904dcc56d9d24ef86be897e421d3cc364226 (patch)
tree2fc4468f3d3ce0a019ec192ce04c6b5a0766f527 /arch/powerpc
parent348aa3030096e61474a5537fed5bd69e70b755c0 (diff)
powerpc/booke: Fix xmon single step on PowerPC Book-E
Prior to the arch/ppc -> arch/powerpc transition, xmon had support for single stepping on 4xx boards. The functionality was lost when arch/ppc was removed. This patch restores single step support for 44x boards, and Book-E in general. Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/xmon/xmon.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index c6f0a71b405e..bdbe96c8a7e4 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -517,6 +517,15 @@ static int xmon_core(struct pt_regs *regs, int fromipi)
517 in_xmon = 0; 517 in_xmon = 0;
518#endif 518#endif
519 519
520#ifdef CONFIG_BOOKE
521 if (regs->msr & MSR_DE) {
522 bp = at_breakpoint(regs->nip);
523 if (bp != NULL) {
524 regs->nip = (unsigned long) &bp->instr[0];
525 atomic_inc(&bp->ref_count);
526 }
527 }
528#else
520 if ((regs->msr & (MSR_IR|MSR_PR|MSR_SF)) == (MSR_IR|MSR_SF)) { 529 if ((regs->msr & (MSR_IR|MSR_PR|MSR_SF)) == (MSR_IR|MSR_SF)) {
521 bp = at_breakpoint(regs->nip); 530 bp = at_breakpoint(regs->nip);
522 if (bp != NULL) { 531 if (bp != NULL) {
@@ -530,7 +539,7 @@ static int xmon_core(struct pt_regs *regs, int fromipi)
530 } 539 }
531 } 540 }
532 } 541 }
533 542#endif
534 insert_cpu_bpts(); 543 insert_cpu_bpts();
535 544
536 local_irq_restore(flags); 545 local_irq_restore(flags);
@@ -894,6 +903,14 @@ cmds(struct pt_regs *excp)
894 } 903 }
895} 904}
896 905
906#ifdef CONFIG_BOOKE
907static int do_step(struct pt_regs *regs)
908{
909 regs->msr |= MSR_DE;
910 mtspr(SPRN_DBCR0, mfspr(SPRN_DBCR0) | DBCR0_IC | DBCR0_IDM);
911 return 1;
912}
913#else
897/* 914/*
898 * Step a single instruction. 915 * Step a single instruction.
899 * Some instructions we emulate, others we execute with MSR_SE set. 916 * Some instructions we emulate, others we execute with MSR_SE set.
@@ -924,6 +941,7 @@ static int do_step(struct pt_regs *regs)
924 regs->msr |= MSR_SE; 941 regs->msr |= MSR_SE;
925 return 1; 942 return 1;
926} 943}
944#endif
927 945
928static void bootcmds(void) 946static void bootcmds(void)
929{ 947{