[coreboot-gerrit] Patch set updated for coreboot: be6f6b4 console: Add printk helper for ChromeOS

Kyösti Mälkki (kyosti.malkki@gmail.com) gerrit at coreboot.org
Mon Apr 7 05:41:33 CEST 2014


Kyösti Mälkki (kyosti.malkki at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5347

-gerrit

commit be6f6b4282b33506c3bc6f58d545774939cd641b
Author: Kyösti Mälkki <kyosti.malkki at gmail.com>
Date:   Thu Mar 6 16:55:05 2014 +0200

    console: Add printk helper for ChromeOS
    
    Do not expose console_tx_flush() to ChromeOS as that function
    is part of lower-level implementation.
    
    Change-Id: I1e31662da88a60e83f8e5d307a4b53441c130aab
    Signed-off-by: Kyösti Mälkki <kyosti.malkki at gmail.com>
---
 src/console/printk.c                          |  8 ++++++++
 src/include/console/console.h                 | 10 ++++++++++
 src/vendorcode/google/chromeos/vboot_loader.c |  3 +--
 3 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/src/console/printk.c b/src/console/printk.c
index fb1194e..c61f63e 100644
--- a/src/console/printk.c
+++ b/src/console/printk.c
@@ -40,3 +40,11 @@ int do_printk(int msg_level, const char *fmt, ...)
 
 	return i;
 }
+
+#if CONFIG_CHROMEOS
+void do_vtxprintf(const char *fmt, va_list args)
+{
+	vtxprintf(console_tx_byte, fmt, args);
+	console_tx_flush();
+}
+#endif
diff --git a/src/include/console/console.h b/src/include/console/console.h
index aa5273f..e7b4253 100644
--- a/src/include/console/console.h
+++ b/src/include/console/console.h
@@ -82,6 +82,16 @@ static inline void printk(int LEVEL, const char *fmt, ...) {
 
 #endif /* defined(__PRE_RAM__) && !CONFIG_EARLY_CONSOLE */
 
+#if CONFIG_CHROMEOS
+/* FIXME: Collision of varargs with AMD headers without guard. */
+#include <console/vtxprintf.h>
+#if !defined(__PRE_RAM__) || CONFIG_EARLY_CONSOLE
+void do_vtxprintf(const char *fmt, va_list args);
+#else
+static inline void do_vtxprintf(const char *fmt, va_list args) {};
+#endif
+#endif
+
 #define print_emerg(STR)         printk(BIOS_EMERG,  "%s", (STR))
 #define print_alert(STR)         printk(BIOS_ALERT,  "%s", (STR))
 #define print_crit(STR)          printk(BIOS_CRIT,   "%s", (STR))
diff --git a/src/vendorcode/google/chromeos/vboot_loader.c b/src/vendorcode/google/chromeos/vboot_loader.c
index 0c5220a..943ad17 100644
--- a/src/vendorcode/google/chromeos/vboot_loader.c
+++ b/src/vendorcode/google/chromeos/vboot_loader.c
@@ -64,8 +64,7 @@ out:
 /* Helper routines for the vboot stub. */
 static void log_msg(const char *fmt, va_list args)
 {
-	vtxprintf(console_tx_byte, fmt, args);
-	console_tx_flush();
+	do_vtxprintf(fmt, args);
 }
 
 static void fatal_error(void)



More information about the coreboot-gerrit mailing list