diff options
-rw-r--r-- | src/console/die.c | 16 | ||||
-rw-r--r-- | src/include/console/console.h | 5 |
2 files changed, 10 insertions, 11 deletions
diff --git a/src/console/die.c b/src/console/die.c index 513d1c4097..3a17126264 100644 --- a/src/console/die.c +++ b/src/console/die.c @@ -30,17 +30,15 @@ __weak void die_notify(void) } /* Report a fatal error */ -void __noreturn die(const char *msg) +void __noreturn die(const char *fmt, ...) { - printk(BIOS_EMERG, "%s", msg); + va_list args; + + va_start(args, fmt); + vprintk(BIOS_EMERG, fmt, args); + va_end(args); + die_notify(); halt(); } - -/* Report a fatal error with a post code */ -void __noreturn die_with_post_code(uint8_t value, const char *msg) -{ - post_code(value); - die(msg); -} #endif diff --git a/src/include/console/console.h b/src/include/console/console.h index 082ba29be8..369ce5be00 100644 --- a/src/include/console/console.h +++ b/src/include/console/console.h @@ -42,8 +42,9 @@ void post_log_clear(void); #endif /* this function is weak and can be overridden by a mainboard function. */ void mainboard_post(u8 value); -void __noreturn die(const char *msg); -void __noreturn die_with_post_code(uint8_t value, const char *msg); +void __noreturn die(const char *fmt, ...); +#define die_with_post_code(value, fmt, ...) \ + do { post_code(value); die(fmt, ##__VA_ARGS__); } while (0) /* * This function is weak and can be overridden to provide additional |