From 64733430754848bfb1f67c87c4c9142564270583 Mon Sep 17 00:00:00 2001 From: Vincent Palatin Date: Mon, 30 Jun 2014 19:32:12 -0700 Subject: better unhandled exception panic without runtime On panic, reboot properly the CPU rather than just jumping to the reset vector as that might lead to some incorrect initializations. Properly plug the div by 0 to the panic handling. Add a small trace if the debug output is activated. Signed-off-by: Vincent Palatin BRANCH=none BUG=chrome-os-partner:29840 TEST=add adhoc code triggering a data abort and see the firmware printing a trace, then rebooting immediatly in a working state. Change-Id: I1d5a98d9113c8ae08e05588a40f941d1ed22cebe Reviewed-on: https://chromium-review.googlesource.com/206268 Reviewed-by: Vic Yang Tested-by: Vincent Palatin Commit-Queue: Vincent Palatin --- core/cortex-m/init.S | 3 --- core/cortex-m0/div.S | 2 +- core/cortex-m0/init.S | 6 ++---- 3 files changed, 3 insertions(+), 8 deletions(-) (limited to 'core') diff --git a/core/cortex-m/init.S b/core/cortex-m/init.S index 0f5a3e2310..ac16fa83c7 100644 --- a/core/cortex-m/init.S +++ b/core/cortex-m/init.S @@ -384,10 +384,7 @@ fini_loop: /* Default exception handler */ .thumb_func default_handler: -#ifdef CONFIG_COMMON_PANIC_OUTPUT b exception_panic -#endif - b reset .align 2 _bss_start: diff --git a/core/cortex-m0/div.S b/core/cortex-m0/div.S index 8e055b8e0f..c20804e274 100644 --- a/core/cortex-m0/div.S +++ b/core/cortex-m0/div.S @@ -180,4 +180,4 @@ L_dont_sub0: bx lr __aeabi_idiv0: - bl panic + bl panic_reboot diff --git a/core/cortex-m0/init.S b/core/cortex-m0/init.S index 98bdb89e19..92dc386959 100644 --- a/core/cortex-m0/init.S +++ b/core/cortex-m0/init.S @@ -133,10 +133,8 @@ fini_loop: /* Default exception handler */ .thumb_func default_handler: -#ifdef CONFIG_COMMON_PANIC_OUTPUT - b exception_panic -#endif - b reset + ldr r0, =exception_panic + bx r0 .align 2 _bss_start: -- cgit v1.2.1