diff options
author | Simon Glass <sjg@chromium.org> | 2012-06-03 09:28:45 -0700 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-06-08 17:55:40 -0700 |
commit | 3439e70a901477133ed0a22eea55afdd4fc89f7b (patch) | |
tree | f79165901c1d98b957e475a12edf5d557c7f8aa1 /core/cortex-m/init.S | |
parent | 6f44651eb063eeffd85d68311712378243aa96e8 (diff) | |
download | chrome-ec-3439e70a901477133ed0a22eea55afdd4fc89f7b.tar.gz |
Convert panic() to C code
Move the implementation of panic into C code. Only a very small part
needs to be in assembler, and the reset is easier to maintain as C.
As part of this, define panic_putc() and panic_puts() which directly
wite to the UART.
To make things more convenience for the future, add a simple printf()
implementation in the panic path. This is not reliant on the uart
buffering system being in a happy state. However, we do call the
emergency flush so that our panic message will appear after previous
output rather that surpressing it (which would be extremely confusing).
Code/data size for panic.o grows by about 200 bytes, but this is mostly
due to the increased flexibility.
text data bss dec hex filename
292 272 0 564 234 old panic.S
692 3 48 743 2e7 new panic.c
BUG=chrome-os-partner:10146
TEST=manual:
build and boot on snow:
> rw 0x06000000
=== EXCEPTION: 03 ====== xPSR: 01000000 ===========
r0 :0000000b r1 :00000047 r2 :06000000 r3 :200013dd
r4 :00000000 r5 :080052cc r6 :200013d0 r7 :00000002
r8 :00000000 r9 :200013de r10:00000000 r11:00000000
r12:00000000 sp :200009a0 lr :08002a5d pc :08003962
Rebooting...
Change-Id: If3e3f572e0f32af780b6ebda235b1b3cde4de5e4
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/24503
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'core/cortex-m/init.S')
-rw-r--r-- | core/cortex-m/init.S | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/cortex-m/init.S b/core/cortex-m/init.S index bef720d46c..22cece17cb 100644 --- a/core/cortex-m/init.S +++ b/core/cortex-m/init.S @@ -368,7 +368,7 @@ fini_loop: /* default exception handler */ .thumb_func default_handler: - b panic + b exception_panic _bss_start: .long __bss_start |