summaryrefslogtreecommitdiff
path: root/src/console
diff options
context:
space:
mode:
authorKeith Short <keithshort@chromium.org>2019-05-14 13:38:56 -0600
committerPatrick Georgi <pgeorgi@google.com>2019-05-20 14:44:27 +0000
commitcc8665eacc389318191aa6fe1b04b29580cc84ae (patch)
tree6be4927870a1fe803d9debb2473993725c94b1d3 /src/console
parent1eeb94ff4acf09959794a2ac1d92e685633aab18 (diff)
console: Add new function die_with_post_code()
Add a new helper function die_with_post_code() that generates a post code and an error string prior to halting the CPU. BUG=b:124401932 BRANCH=sarien TEST=build coreboot for sarien and arcada platforms Change-Id: I87551d60b253dc13ff76f7898c1f112f573a00a2 Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/32838 Reviewed-by: Martin Roth <martinroth@google.com> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Furquan Shaikh <furquan@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/console')
-rw-r--r--src/console/die.c7
1 files changed, 7 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