diff options
author | Antony Pavlov <antonynpavlov@gmail.com> | 2015-11-10 10:27:13 +0300 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-11-11 08:38:24 +0100 |
commit | b6e9c2ae14275d48a854488ed69ba763ee021459 (patch) | |
tree | abb2bbd13e7a0c18187087d91b1f8021b0babdfd /arch/mips/lib/traps.c | |
parent | d9c2cfd534d2ebda662f2656b2e8076b255b4987 (diff) | |
download | barebox-b6e9c2ae14275d48a854488ed69ba763ee021459.tar.gz barebox-b6e9c2ae14275d48a854488ed69ba763ee021459.tar.xz |
MIPS: traps.c: separate registers print stuff to show_regs()
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/mips/lib/traps.c')
-rw-r--r-- | arch/mips/lib/traps.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/arch/mips/lib/traps.c b/arch/mips/lib/traps.c index 0a5914ea81..d69697d099 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(); } |