diff options
author | Tom Hughes <tomhughes@chromium.org> | 2022-10-03 15:05:06 -0700 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-10-12 23:39:31 +0000 |
commit | aebccf721edad727dfa011a48eb12ff75015be79 (patch) | |
tree | cf5eef6e23f67611e5be966b8d916c1a90b01ef3 /core | |
parent | c2ac97e9c24566451d2e24df2b4b2af9f4076ba4 (diff) | |
download | chrome-ec-aebccf721edad727dfa011a48eb12ff75015be79.tar.gz |
tree: Remove CONFIG_SOFTWARE_PANIC
It's always enabled in the core/<core>/core_config.h files. The
following script demonstrates that it's enabled in all boards:
for board in `make print-boards`; do
make print-configs board="${board}" | grep -q CONFIG_SOFTWARE_PANIC
if [ $? -ne 0 ]; then
echo "${board} failed"
exit 1
fi
done
BRANCH=none
BUG=none
TEST=make buildall
Cq-Depend: chromium:3943248
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: If683b244f17b48bedf3699f2b24e83b5ad6e849e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3933255
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
Diffstat (limited to 'core')
-rw-r--r-- | core/cortex-m/config_core.h | 2 | ||||
-rw-r--r-- | core/cortex-m/panic.c | 2 | ||||
-rw-r--r-- | core/cortex-m/task.c | 2 | ||||
-rw-r--r-- | core/cortex-m0/config_core.h | 1 | ||||
-rw-r--r-- | core/cortex-m0/panic.c | 2 | ||||
-rw-r--r-- | core/cortex-m0/task.c | 2 | ||||
-rw-r--r-- | core/cortex-m0/watchdog.c | 2 | ||||
-rw-r--r-- | core/minute-ia/config_core.h | 2 | ||||
-rw-r--r-- | core/minute-ia/task.c | 4 | ||||
-rw-r--r-- | core/nds32/config_core.h | 2 | ||||
-rw-r--r-- | core/nds32/panic.c | 4 | ||||
-rw-r--r-- | core/nds32/task.c | 2 | ||||
-rw-r--r-- | core/riscv-rv32i/config_core.h | 1 | ||||
-rw-r--r-- | core/riscv-rv32i/panic.c | 6 | ||||
-rw-r--r-- | core/riscv-rv32i/task.c | 2 |
15 files changed, 1 insertions, 35 deletions
diff --git a/core/cortex-m/config_core.h b/core/cortex-m/config_core.h index 949df7ee21..3b9ccb89e6 100644 --- a/core/cortex-m/config_core.h +++ b/core/cortex-m/config_core.h @@ -10,6 +10,4 @@ #define BFD_ARCH arm #define BFD_FORMAT "elf32-littlearm" -#define CONFIG_SOFTWARE_PANIC - #endif /* __CROS_EC_CONFIG_CORE_H */ diff --git a/core/cortex-m/panic.c b/core/cortex-m/panic.c index 3a59fcf201..0f803dc8e5 100644 --- a/core/cortex-m/panic.c +++ b/core/cortex-m/panic.c @@ -416,7 +416,6 @@ void exception_panic(void) "r8", "r9", "r10", "r11", "cc", "memory"); } -#ifdef CONFIG_SOFTWARE_PANIC void software_panic(uint32_t reason, uint32_t info) { __asm__("mov " STRINGIFY( @@ -463,7 +462,6 @@ void panic_get_reason(uint32_t *reason, uint32_t *info, uint8_t *exception) *exception = *reason = *info = 0; } } -#endif void bus_fault_handler(void) { diff --git a/core/cortex-m/task.c b/core/cortex-m/task.c index ce6c8c9615..03e069df8c 100644 --- a/core/cortex-m/task.c +++ b/core/cortex-m/task.c @@ -304,9 +304,7 @@ void svc_handler(int desched, task_id_t resched) if (*current->stack != STACK_UNUSED_VALUE) { panic_printf("\n\nStack overflow in %s task!\n", task_names[current - tasks]); -#ifdef CONFIG_SOFTWARE_PANIC software_panic(PANIC_SW_STACK_OVERFLOW, current - tasks); -#endif } #endif diff --git a/core/cortex-m0/config_core.h b/core/cortex-m0/config_core.h index e954e5e0af..9ef52f848a 100644 --- a/core/cortex-m0/config_core.h +++ b/core/cortex-m0/config_core.h @@ -18,7 +18,6 @@ #define CONFIG_SOFTWARE_CLZ #define CONFIG_SOFTWARE_CTZ #endif /* __clang__ */ -#define CONFIG_SOFTWARE_PANIC #define CONFIG_ASSEMBLY_MULA32 diff --git a/core/cortex-m0/panic.c b/core/cortex-m0/panic.c index f20908eb7c..3714d771a2 100644 --- a/core/cortex-m0/panic.c +++ b/core/cortex-m0/panic.c @@ -179,7 +179,6 @@ void exception_panic(void) "r8", "r9", "r10", "r11", "cc", "memory"); } -#ifdef CONFIG_SOFTWARE_PANIC void software_panic(uint32_t reason, uint32_t info) { __asm__("mov " STRINGIFY( @@ -226,7 +225,6 @@ void panic_get_reason(uint32_t *reason, uint32_t *info, uint8_t *exception) *exception = *reason = *info = 0; } } -#endif void bus_fault_handler(void) { diff --git a/core/cortex-m0/task.c b/core/cortex-m0/task.c index b34e920e09..03490025b5 100644 --- a/core/cortex-m0/task.c +++ b/core/cortex-m0/task.c @@ -234,9 +234,7 @@ task_ __attribute__((noinline)) * __svc_handler(int desched, task_id_t resched) if (*current->stack != STACK_UNUSED_VALUE) { panic_printf("\n\nStack overflow in %s task!\n", task_names[current - tasks]); -#ifdef CONFIG_SOFTWARE_PANIC software_panic(PANIC_SW_STACK_OVERFLOW, current - tasks); -#endif } #endif diff --git a/core/cortex-m0/watchdog.c b/core/cortex-m0/watchdog.c index b4d5c086f0..0b5a038168 100644 --- a/core/cortex-m0/watchdog.c +++ b/core/cortex-m0/watchdog.c @@ -34,10 +34,8 @@ void watchdog_trace(uint32_t excep_lr, uint32_t excep_sp) } /* Log PC. If we were in task context, log task id too. */ -#ifdef CONFIG_SOFTWARE_PANIC panic_set_reason(PANIC_SW_WATCHDOG, stack[STACK_IDX_REG_PC], (excep_lr & 0xf) == 1 ? 0xff : task_get_current()); -#endif panic_printf("### WATCHDOG PC=%08x / LR=%08x / pSP=%08x ", stack[STACK_IDX_REG_PC], stack[STACK_IDX_REG_LR], psp); diff --git a/core/minute-ia/config_core.h b/core/minute-ia/config_core.h index 1dce51720d..d8a9b3adb1 100644 --- a/core/minute-ia/config_core.h +++ b/core/minute-ia/config_core.h @@ -10,8 +10,6 @@ #define BFD_ARCH "i386" #define BFD_FORMAT "elf32-i386" -#define CONFIG_SOFTWARE_PANIC - /* * Since all implementations minute-ia are a single core, we do not need a * "lock;" prefix on any instructions. We use the below define in places where diff --git a/core/minute-ia/task.c b/core/minute-ia/task.c index 79ce82fd89..b4b747baa0 100644 --- a/core/minute-ia/task.c +++ b/core/minute-ia/task.c @@ -225,9 +225,7 @@ uint32_t switch_handler(int desched, task_id_t resched) panic_printf("\n\nStack overflow in %s task!\n", task_get_name(current - tasks)); - if (IS_ENABLED(CONFIG_SOFTWARE_PANIC)) - software_panic(PANIC_SW_STACK_OVERFLOW, - current - tasks); + software_panic(PANIC_SW_STACK_OVERFLOW, current - tasks); } if (desched && !current->events) { diff --git a/core/nds32/config_core.h b/core/nds32/config_core.h index 096b244643..094a86f76a 100644 --- a/core/nds32/config_core.h +++ b/core/nds32/config_core.h @@ -10,8 +10,6 @@ #define BFD_ARCH nds32 #define BFD_FORMAT "elf32-nds32le" -#define CONFIG_SOFTWARE_PANIC - /* * The Andestar v3m architecture has no CLZ/CTZ instructions (contrary to v3), * so let's use the software implementation. diff --git a/core/nds32/panic.c b/core/nds32/panic.c index a1eca1574f..5a877f8572 100644 --- a/core/nds32/panic.c +++ b/core/nds32/panic.c @@ -75,7 +75,6 @@ static const char *const itype_exc_type[16] = { }; #endif /* CONFIG_DEBUG_EXCEPTIONS */ -#ifdef CONFIG_SOFTWARE_PANIC void software_panic(uint32_t reason, uint32_t info) { asm volatile("mov55 $r6, %0" : : "r"(reason)); @@ -133,7 +132,6 @@ void panic_get_reason(uint32_t *reason, uint32_t *info, uint8_t *exception) *exception = *reason = *info = 0; } } -#endif /* CONFIG_SOFTWARE_PANIC */ static void print_panic_information(uint32_t *regs, uint32_t itype, uint32_t ipc, uint32_t ipsw) @@ -159,13 +157,11 @@ static void print_panic_information(uint32_t *regs, uint32_t itype, #ifdef CONFIG_DEBUG_EXCEPTIONS panic_printf("SWID of ITYPE: %x\n", ((itype >> 16) & 0x7fff)); if (panic_sw_reason_is_valid(regs[SOFT_PANIC_GPR_REASON])) { -#ifdef CONFIG_SOFTWARE_PANIC panic_printf("Software panic reason %s\n", panic_sw_reasons[(regs[SOFT_PANIC_GPR_REASON] - PANIC_SW_BASE)]); panic_printf("Software panic info 0x%x\n", regs[SOFT_PANIC_GPR_INFO]); -#endif } else { panic_printf("Exception type: General exception [%s]\n", itype_exc_type[(itype & 0xf)]); diff --git a/core/nds32/task.c b/core/nds32/task.c index d9ea6f191f..427f0e1202 100644 --- a/core/nds32/task.c +++ b/core/nds32/task.c @@ -311,9 +311,7 @@ task_ *next_sched_task(void) int i = task_get_current(); panic_printf("\n\nStack overflow in %s task!\n", task_names[i]); -#ifdef CONFIG_SOFTWARE_PANIC software_panic(PANIC_SW_STACK_OVERFLOW, i); -#endif } #endif diff --git a/core/riscv-rv32i/config_core.h b/core/riscv-rv32i/config_core.h index 2adcd2783f..c5863efb25 100644 --- a/core/riscv-rv32i/config_core.h +++ b/core/riscv-rv32i/config_core.h @@ -16,6 +16,5 @@ */ #define CONFIG_SOFTWARE_CLZ #define CONFIG_SOFTWARE_CTZ -#define CONFIG_SOFTWARE_PANIC #endif /* __CROS_EC_CONFIG_CORE_H */ diff --git a/core/riscv-rv32i/panic.c b/core/riscv-rv32i/panic.c index a2ce9213d9..3ac34c7774 100644 --- a/core/riscv-rv32i/panic.c +++ b/core/riscv-rv32i/panic.c @@ -34,7 +34,6 @@ static const char *const exc_type[16] = { }; #endif /* CONFIG_DEBUG_EXCEPTIONS */ -#ifdef CONFIG_SOFTWARE_PANIC /* General purpose register (s0) for saving software panic reason */ #define SOFT_PANIC_GPR_REASON 11 /* General purpose register (s1) for saving software panic information */ @@ -97,7 +96,6 @@ void panic_get_reason(uint32_t *reason, uint32_t *info, uint8_t *exception) *exception = *reason = *info = 0; } } -#endif /* CONFIG_SOFTWARE_PANIC */ static void print_panic_information(uint32_t *regs, uint32_t mcause, uint32_t mepc) @@ -122,13 +120,11 @@ static void print_panic_information(uint32_t *regs, uint32_t mcause, #ifdef CONFIG_DEBUG_EXCEPTIONS 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] - PANIC_SW_BASE)]); panic_printf("Software panic info: %d\n", regs[SOFT_PANIC_GPR_INFO]); -#endif } else { panic_printf("Exception type: %s\n", exc_type[(mcause & 0xf)]); } @@ -195,13 +191,11 @@ static void ccprint_panic_information(uint32_t *regs, uint32_t mcause, #ifdef CONFIG_DEBUG_EXCEPTIONS if ((regs[SOFT_PANIC_GPR_REASON] & 0xfffffff0) == PANIC_SW_BASE) { -#ifdef CONFIG_SOFTWARE_PANIC ccprintf("Software panic reason: %s\n", panic_sw_reasons[(regs[SOFT_PANIC_GPR_REASON] - PANIC_SW_BASE)]); ccprintf("Software panic info: %d\n", regs[SOFT_PANIC_GPR_INFO]); -#endif /* CONFIG_SOFTWARE_PANIC */ } else { ccprintf("Exception type: %s\n", exc_type[(mcause & 0xf)]); } diff --git a/core/riscv-rv32i/task.c b/core/riscv-rv32i/task.c index 84415dcda9..fd0d3938cb 100644 --- a/core/riscv-rv32i/task.c +++ b/core/riscv-rv32i/task.c @@ -291,9 +291,7 @@ task_ *__ram_code next_sched_task(void) int i = task_get_current(); panic_printf("\n\nStack overflow in %s task!\n", task_names[i]); -#ifdef CONFIG_SOFTWARE_PANIC software_panic(PANIC_SW_STACK_OVERFLOW, i); -#endif } #endif |