diff options
author | Daisuke Nojiri <dnojiri@google.com> | 2013-04-05 13:59:23 -0700 |
---|---|---|
committer | ChromeBot <chrome-bot@google.com> | 2013-04-18 20:56:15 -0700 |
commit | 74c34bbad4c2914d0d1a3684a95e8dfe9e0116c8 (patch) | |
tree | d3a11b1496967daa4e43289a5ae041613215b1d8 /include/panic.h | |
parent | 5b04478423ef30739db9baf5ed3ebc1135c8504f (diff) | |
download | chrome-ec-74c34bbad4c2914d0d1a3684a95e8dfe9e0116c8.tar.gz |
Saving the main stack pointer at the entry of exception_panic.
CPU creates an exception frame on the main stack instead of the process
stack when the exception happens in a handler's context. So, we need to
save both msp and psp, and pick the right one to locate the exception frame.
Tested by marking the stack (as you see in the dump below) then triggering
divzero in svc_handler.
> crash svc
=== HANDLER EXCEPTION: 03 ====== xPSR: 6100000b ===
r0 :00000000 r1 :0000e237 r2 :000015cf r3 :000015cf
r4 :00000001 r5 :22222222 r6 :11111111 r7 :0000df01
r8 :00000000 r9 :2000545e r10:00000000 r11:00000000
r12:0000000d sp :20000fb8 lr :000055d7 pc :00000b40
Divide by 0, Forced hard fault
mmfs = 2000000, shcsr = 70080, hfsr = 40000000, dfsr = 0
=========== Process Stack Contents ===========
20002738: 11111111 22222222 33333333 44444444
20002748: 00000000 000003ad 000003c0 81000000
20002758: 00000000 0000557d 0000557c 21000000
20002768: 00000000 00000000 00000000 00000000
Rebooting...
BUG=chrome-os-partner:16901
BRANCH=none
TEST=mentioned above
Change-Id: I3ca08a1df20375953552b3dc926350e262b78b2a
Signed-off-by: Daisuke Nojiri <dnojiri@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/47495
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'include/panic.h')
-rw-r--r-- | include/panic.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/panic.h b/include/panic.h index b003f188c8..6caaf6a2d8 100644 --- a/include/panic.h +++ b/include/panic.h @@ -18,7 +18,7 @@ struct panic_data { uint8_t flags; /* Flags (PANIC_DATA_FLAG_*) */ uint8_t reserved; /* Reserved; set 0 */ - uint32_t regs[11]; /* psp, ipsr, lr, r4-r11 */ + uint32_t regs[12]; /* psp, ipsr, msp, r4-r11, lr(=exc_return) */ uint32_t frame[8]; /* r0-r3, r12, lr, pc, xPSR */ uint32_t mmfs; |