diff options
Diffstat (limited to 'include/common/debug.h')
-rw-r--r-- | include/common/debug.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/include/common/debug.h b/include/common/debug.h index ee25af12..ab3e15a7 100644 --- a/include/common/debug.h +++ b/include/common/debug.h @@ -27,7 +27,9 @@ #ifndef __ASSEMBLY__ #include <cdefs.h> +#include <console.h> #include <stdarg.h> +#include <stdbool.h> #include <stdio.h> /* @@ -90,7 +92,13 @@ void backtrace(const char *cookie); #endif void __dead2 do_panic(void); -#define panic() do_panic() + +#define panic() \ + do { \ + backtrace(__func__); \ + (void)console_flush(); \ + do_panic(); \ + } while (false) /* Function called when stack protection check code detects a corrupted stack */ void __dead2 __stack_chk_fail(void); |