diff options
author | Dino Li <Dino.Li@ite.com.tw> | 2019-06-12 13:39:02 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-06-14 04:56:35 +0000 |
commit | 2a528cc40b9aaa80798d1146f1a3f4a7548a329d (patch) | |
tree | bb813561047567c0f356cfde75490aa7132530c5 /core | |
parent | a16b9b13c580175e7c29d8d9ddfbab3e859d156e (diff) | |
download | chrome-ec-2a528cc40b9aaa80798d1146f1a3f4a7548a329d.tar.gz |
core/riscv-rv32i: remove panic_sw_reasons[] from panic.c
Because the CL:1648958 made panic_sw_reasons[] common,
so we remove it to fix multiple definition error.
BUG=none
BRANCH=none
TEST=crash console command:
> crash stack
...
Software panic reason: PANIC_SW_STACK_OVERFLOW
Software panic info: 2
> crash assert
...
Software panic reason: PANIC_SW_ASSERT
Software panic info: 192
Change-Id: Ia34ae92f8b47f14040a78ae8a85bd479757f40ea
Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1655219
Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'core')
-rw-r--r-- | core/riscv-rv32i/panic.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/core/riscv-rv32i/panic.c b/core/riscv-rv32i/panic.c index dcf1da21b3..45338b6348 100644 --- a/core/riscv-rv32i/panic.c +++ b/core/riscv-rv32i/panic.c @@ -46,20 +46,6 @@ static const char * const exc_type[16] = { #define SOFT_PANIC_GPR_REASON 11 /* General purpose register (s1) for saving software panic information */ #define SOFT_PANIC_GPR_INFO 10 -/* The size must be a power of 2 */ -#define SOFT_PANIC_REASON_SIZE 8 -#define SOFT_PANIC_REASON_MASK (SOFT_PANIC_REASON_SIZE - 1) -/* Software panic reasons */ -static const char * const panic_sw_reasons[SOFT_PANIC_REASON_SIZE] = { - "PANIC_SW_DIV_ZERO", - "PANIC_SW_STACK_OVERFLOW", - "PANIC_SW_PD_CRASH", - "PANIC_SW_ASSERT", - "PANIC_SW_WATCHDOG", - "PANIC_SW_BAD_RNG", - "PANIC_SW_PMIC_FAULT", - NULL, -}; void software_panic(uint32_t reason, uint32_t info) { @@ -136,8 +122,8 @@ static void print_panic_information(uint32_t *regs, uint32_t mcause, if ((regs[SOFT_PANIC_GPR_REASON] & 0xfffffff0) == PANIC_SW_BASE) { #ifdef CONFIG_SOFTWARE_PANIC panic_printf("Software panic reason: %s\n", - panic_sw_reasons[(regs[SOFT_PANIC_GPR_REASON] & - SOFT_PANIC_REASON_MASK)]); + panic_sw_reasons[(regs[SOFT_PANIC_GPR_REASON] - + PANIC_SW_BASE)]); panic_printf("Software panic info: %d\n", regs[SOFT_PANIC_GPR_INFO]); #endif |