summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/console/die.c11
-rw-r--r--src/include/console/console.h6
2 files changed, 17 insertions, 0 deletions
diff --git a/src/console/die.c b/src/console/die.c
index ea46f51dfa..79babeceee 100644
--- a/src/console/die.c
+++ b/src/console/die.c
@@ -21,10 +21,21 @@
#ifndef __ROMCC__
#define NORETURN __attribute__((noreturn))
+/*
+ * The method should be overwritten in mainboard directory to signal that a
+ * fatal error had occurred. On boards that do share the same EC and where the
+ * EC is capable of controlling LEDs or a buzzer the method can be overwritten
+ * in EC directory instead.
+ */
+__attribute__ ((weak)) void die_notify(void)
+{
+}
+
/* Report a fatal error */
void NORETURN die(const char *msg)
{
printk(BIOS_EMERG, "%s", msg);
+ die_notify();
halt();
}
#endif
diff --git a/src/include/console/console.h b/src/include/console/console.h
index aab0411600..aa935e4579 100644
--- a/src/include/console/console.h
+++ b/src/include/console/console.h
@@ -42,6 +42,12 @@ void post_log_clear(void);
void mainboard_post(u8 value);
void __attribute__((noreturn)) die(const char *msg);
+/*
+ * This function is weak and can be overridden to provide additional
+ * feedback to the user. Possible use case: Play a beep.
+ */
+void die_notify(void);
+
#define __CONSOLE_ENABLE__ \
((ENV_BOOTBLOCK && IS_ENABLED(CONFIG_BOOTBLOCK_CONSOLE)) || \
(ENV_POSTCAR && IS_ENABLED(CONFIG_POSTCAR_CONSOLE)) || \