summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Yilun Lin <yllin@chromium.org>2021-01-11 12:13:50 +0800
committerCommit Bot <commit-bot@chromium.org>2021-01-11 07:09:56 +0000
commit6625f7173bcb4f33a1c92b549fa82b6c6e026664 (patch)
tree19b5666e9b8cf1151071abbb19849b49b65be014
parenta0ec62ec5a7009c6b5a3507eae8615e674d1567b (diff)
downloadchrome-ec-6625f7173bcb4f33a1c92b549fa82b6c6e026664.tar.gz
cortex-m/m0: uses BL reg as SW PANIC info
This provides more information when we hit the div_by_zero exception, since the register dump in panic info might be missing sometimes. BUG=b:177091249 TEST=crash divzero, and see the R5 provides BL reg BRANCH=none Change-Id: Icf617a01f0d93d1997812e9d8d44d4489f6a418a Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2620723 Reviewed-by: Tzung-Bi Shih <tzungbi@chromium.org> Reviewed-by: Ting Shen <phoenixshen@chromium.org>
-rw-r--r--third_party/libaeabi-cortexm0/core/cortex-m/uldivmod.S1
-rw-r--r--third_party/libaeabi-cortexm0/core/cortex-m0/div.S1
-rw-r--r--third_party/libaeabi-cortexm0/core/cortex-m0/uldivmod.S1
3 files changed, 3 insertions, 0 deletions
diff --git a/third_party/libaeabi-cortexm0/core/cortex-m/uldivmod.S b/third_party/libaeabi-cortexm0/core/cortex-m/uldivmod.S
index da60793e67..63f060891b 100644
--- a/third_party/libaeabi-cortexm0/core/cortex-m/uldivmod.S
+++ b/third_party/libaeabi-cortexm0/core/cortex-m/uldivmod.S
@@ -176,4 +176,5 @@ L_done_sub4:
__aeabi_ldiv0:
ldr SOFTWARE_PANIC_REASON_REG, =PANIC_SW_DIV_ZERO
+ mov SOFTWARE_PANIC_INFO_REG, r14
bl exception_panic
diff --git a/third_party/libaeabi-cortexm0/core/cortex-m0/div.S b/third_party/libaeabi-cortexm0/core/cortex-m0/div.S
index 898ecafe83..06dc7afacb 100644
--- a/third_party/libaeabi-cortexm0/core/cortex-m0/div.S
+++ b/third_party/libaeabi-cortexm0/core/cortex-m0/div.S
@@ -163,4 +163,5 @@ L_dont_sub0:
__aeabi_idiv0:
ldr SOFTWARE_PANIC_REASON_REG, =PANIC_SW_DIV_ZERO
+ mov SOFTWARE_PANIC_INFO_REG, r14
bl exception_panic
diff --git a/third_party/libaeabi-cortexm0/core/cortex-m0/uldivmod.S b/third_party/libaeabi-cortexm0/core/cortex-m0/uldivmod.S
index 269645268b..6c0a469d65 100644
--- a/third_party/libaeabi-cortexm0/core/cortex-m0/uldivmod.S
+++ b/third_party/libaeabi-cortexm0/core/cortex-m0/uldivmod.S
@@ -174,4 +174,5 @@ L_dont_sub4:
__aeabi_ldiv0:
ldr SOFTWARE_PANIC_REASON_REG, =PANIC_SW_DIV_ZERO
+ mov SOFTWARE_PANIC_INFO_REG, r14
bl exception_panic