xref: /aosp_15_r20/external/coreboot/src/console/die.c (revision b9411a12aaaa7e1e6a6fb7c5e057f44ee179a49c)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <console/console.h>
4 #include <halt.h>
5 #include <stdarg.h>
6 
7 /*
8  * The method should be overwritten in mainboard directory to signal that a
9  * fatal error had occurred. On boards that do share the same EC and where the
10  * EC is capable of controlling LEDs or a buzzer the method can be overwritten
11  * in EC directory instead.
12  */
die_notify(void)13 __weak void die_notify(void)
14 {
15 }
16 
17 /* Report a fatal error */
die(const char * fmt,...)18 void __noreturn die(const char *fmt, ...)
19 {
20 	va_list args;
21 
22 	va_start(args, fmt);
23 	vprintk(BIOS_EMERG, fmt, args);
24 	va_end(args);
25 
26 	die_notify();
27 	halt();
28 }
29