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>
This commit is contained in:
Keith Short 2019-05-14 13:38:56 -06:00 committed by Patrick Georgi
parent 1eeb94ff4a
commit cc8665eacc
2 changed files with 8 additions and 0 deletions

View File

@ -36,4 +36,11 @@ void __noreturn die(const char *msg)
die_notify(); die_notify();
halt(); 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 #endif

View File

@ -43,6 +43,7 @@ void post_log_clear(void);
/* this function is weak and can be overridden by a mainboard function. */ /* this function is weak and can be overridden by a mainboard function. */
void mainboard_post(u8 value); void mainboard_post(u8 value);
void __noreturn die(const char *msg); 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 * This function is weak and can be overridden to provide additional