Signed-off-by: Antony Pavlov <antonynpavlov@xxxxxxxxx> --- arch/mips/lib/traps.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/arch/mips/lib/traps.c b/arch/mips/lib/traps.c index 0a5914e..d69697d 100644 --- a/arch/mips/lib/traps.c +++ b/arch/mips/lib/traps.c @@ -96,13 +96,10 @@ static char *get_exc_name(u32 cause) return "unknown exception"; } -void barebox_exc_handler(const struct pt_regs *regs) +static void show_regs(const struct pt_regs *regs) { - const int field = 2 * sizeof(unsigned long); - unsigned int cause = regs->cp0_cause; int i; - - printf("\nOoops, %s!\n\n", get_exc_name(cause)); + const int field = 2 * sizeof(unsigned long); /* * Saved main processor registers @@ -131,9 +128,17 @@ void barebox_exc_handler(const struct pt_regs *regs) printf("epc : %0*lx\n", field, regs->cp0_epc); printf("ra : %0*lx\n", field, regs->regs[31]); - printf("Status: %08x\n", (uint32_t) regs->cp0_status); - printf("Cause : %08x\n", cause); + printf("Status: %08x\n", (uint32_t)regs->cp0_status); + printf("Cause : %08x\n", (uint32_t)regs->cp0_cause); printf("Config: %08x\n\n", read_c0_config()); +} + +void barebox_exc_handler(const struct pt_regs *regs) +{ + unsigned int cause = regs->cp0_cause; + + printf("\nOoops, %s!\n\n", get_exc_name(cause)); + show_regs(regs); hang(); } -- 2.6.2 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox