summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/console/die.c7
-rw-r--r--src/include/console/console.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/console/die.c b/src/console/die.c
index 769e65134f..513d1c4097 100644
--- a/src/console/die.c
+++ b/src/console/die.c
@@ -36,4 +36,11 @@ void __noreturn die(const char *msg)
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 ed10807c9a..082ba29be8 100644
--- a/src/include/console/console.h
+++ b/src/include/console/console.h
@@ -43,6 +43,7 @@ void post_log_clear(void);
/* 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);
/*
* This function is weak and can be overridden to provide additional