diff options
author | Simon Glass <sjg@chromium.org> | 2012-06-03 11:19:01 -0700 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-06-22 11:12:40 -0700 |
commit | 3977403642fd8ba2785763bdeba50e7d63c66072 (patch) | |
tree | 5f21544a0e661439b81c4cc2323c490c0ada06ca /include/panic.h | |
parent | b4df203506e31c3989c859da04ce3e6544fdcc7e (diff) | |
download | chrome-ec-3977403642fd8ba2785763bdeba50e7d63c66072.tar.gz |
Add a dedicated panic() function
In addition to ASSERT(), it might be useful to panic() sometimes, so add
a tidy way of doing it which will print a message and reset.
BUG=chrome-os-partner:10149
TEST=manual
Build a special version for snow where the 'rw' command calls panic()
See that a message is produced:
> rw 0
read 0x0 = 0x20001048
** PANIC: Address is 0
Change-Id: I4512c0193f4c1d52d0c256b2deefacf551056fd9
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/25413
Diffstat (limited to 'include/panic.h')
-rw-r--r-- | include/panic.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/panic.h b/include/panic.h index 2bef50f541..f42a399efa 100644 --- a/include/panic.h +++ b/include/panic.h @@ -69,6 +69,13 @@ void panic_assert_fail(const char *msg, const char *func, const char *fname, int linenum); /** + * Display a panic message and reset + * + * @param msg Panic message + */ +void panic(const char *msg); + +/** * Report a panic to the panic reporting device * * This is exported only to permit use from assembler. |