summaryrefslogtreecommitdiff
path: root/src/include/console
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2020-01-04 15:55:16 +0200
committerPatrick Georgi <pgeorgi@google.com>2020-04-20 06:12:30 +0000
commitf3dbf4ce6b38b9ebc8e0e537b49ccf1aed456435 (patch)
tree665e77e4bb1e5dd6a76e871a79696d7de066138d /src/include/console
parent8920ee0dcccea100428495220aa53e248f5a210d (diff)
drivers/pc80/rtc: Clean up post_log_path()
Change-Id: I605d39d907e083e73af4c72607216384e7ce166a Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/38190 Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Nico Huber <nico.h@gmx.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/include/console')
-rw-r--r--src/include/console/console.h25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/include/console/console.h b/src/include/console/console.h
index f9e9fe24c3..95c0e7fe1a 100644
--- a/src/include/console/console.h
+++ b/src/include/console/console.h
@@ -16,18 +16,27 @@
#include <console/vtxprintf.h>
+struct device;
+
void post_code(u8 value);
void arch_post_code(u8 value);
void cmos_post_code(u8 value);
+void cmos_post_extra(u32 value);
+void cmos_post_path(const struct device *dev);
int cmos_post_previous_boot(u8 *code, u32 *extra);
-#if CONFIG(CMOS_POST_EXTRA)
-struct device;
-void post_log_path(const struct device *dev);
-void post_log_clear(void);
-#else
-#define post_log_path(x) do {} while (0)
-#define post_log_clear() do {} while (0)
-#endif
+
+static inline void post_log_path(const struct device *dev)
+{
+ if (CONFIG(CMOS_POST) && dev)
+ cmos_post_path(dev);
+}
+
+static inline void post_log_clear(void)
+{
+ if (CONFIG(CMOS_POST))
+ cmos_post_extra(0);
+}
+
/* this function is weak and can be overridden by a mainboard function. */
void mainboard_post(u8 value);
void __noreturn die(const char *fmt, ...);