summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2014-06-30 19:32:12 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-07-03 02:56:52 +0000
commit64733430754848bfb1f67c87c4c9142564270583 (patch)
tree42f5a2b07465b49e0935502b956478f855378214 /core
parente86b4052a6d3698ea5af4aa70450c9326e2e2b62 (diff)
downloadchrome-ec-64733430754848bfb1f67c87c4c9142564270583.tar.gz
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 <vpalatin@chromium.org> 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 <victoryang@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'core')
-rw-r--r--core/cortex-m/init.S3
-rw-r--r--core/cortex-m0/div.S2
-rw-r--r--core/cortex-m0/init.S6
3 files changed, 3 insertions, 8 deletions
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: