mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-27 18:25:05 +00:00
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
This commit is contained in:
@@ -372,3 +372,9 @@ void panic_assert_fail(const char *msg, const char *func, const char *fname,
|
||||
panic_reboot();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void panic(const char *msg)
|
||||
{
|
||||
report_panic(msg, NULL);
|
||||
}
|
||||
|
||||
@@ -68,6 +68,13 @@ void panic_printf(const char *format, ...);
|
||||
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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user