aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2014-01-15 13:52:14 -0500
committerKevin O'Connor <kevin@koconnor.net>2014-01-22 17:30:30 -0500
commitbb1fcb4507095d47f504fab344e589f67e87854b (patch)
tree83b9901751179bb33721b991616ff2d68adb5ae6
parent940fc1fc58b4f2a1c3baa8a5bb907f7b22ba0a31 (diff)
downloadseabios-bb1fcb4507095d47f504fab344e589f67e87854b.zip
seabios-bb1fcb4507095d47f504fab344e589f67e87854b.tar.gz
seabios-bb1fcb4507095d47f504fab344e589f67e87854b.tar.bz2
debug: Unify the SeaBIOS debug version banner.
Introduce debug_banner() and use it in all the places SeaBIOS version is displayed for debugging purposes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r--src/fw/coreboot.c2
-rw-r--r--src/fw/xen.c4
-rw-r--r--src/output.c6
-rw-r--r--src/output.h1
-rw-r--r--src/post.c2
5 files changed, 11 insertions, 4 deletions
diff --git a/src/fw/coreboot.c b/src/fw/coreboot.c
index 88ac5d9..df8fca8 100644
--- a/src/fw/coreboot.c
+++ b/src/fw/coreboot.c
@@ -182,7 +182,7 @@ coreboot_preinit(void)
struct cb_cbmem_ref *cbref = find_cb_subtable(cbh, CB_TAG_CBMEM_CONSOLE);
if (cbref) {
cbcon = (void*)(u32)cbref->cbmem_addr;
- dprintf(1, "----- [ SeaBIOS %s ] -----\n", VERSION);
+ debug_banner();
dprintf(1, "Found coreboot cbmem console @ %llx\n", cbref->cbmem_addr);
}
diff --git a/src/fw/xen.c b/src/fw/xen.c
index d5f5ed3..dd8e8af 100644
--- a/src/fw/xen.c
+++ b/src/fw/xen.c
@@ -71,8 +71,8 @@ void xen_preinit(void)
if (strcmp(signature, "XenVMMXenVMM") == 0) {
/* Set debug_io_port first, so the following messages work. */
DebugOutputPort = 0xe9;
- dprintf(1, "SeaBIOS (version %s)\n\n", VERSION);
- dprintf(1, "Found Xen hypervisor signature at %x\n", base);
+ debug_banner();
+ dprintf(1, "\nFound Xen hypervisor signature at %x\n", base);
if ((eax - base) < 2)
panic("Insufficient Xen cpuid leaves. eax=%x at base %x\n",
eax, base);
diff --git a/src/output.c b/src/output.c
index 06d42a2..994a1d6 100644
--- a/src/output.c
+++ b/src/output.c
@@ -26,6 +26,12 @@ struct putcinfo {
* Debug output
****************************************************************/
+void
+debug_banner(void)
+{
+ dprintf(1, "SeaBIOS (version %s)\n", VERSION);
+}
+
// Write a character to debug port(s).
static void
debug_putc(struct putcinfo *action, char c)
diff --git a/src/output.h b/src/output.h
index 6601035..42a76b8 100644
--- a/src/output.h
+++ b/src/output.h
@@ -4,6 +4,7 @@
#include "types.h" // u32
// output.c
+void debug_banner(void);
void panic(const char *fmt, ...)
__attribute__ ((format (printf, 1, 2))) __noreturn;
void printf(const char *fmt, ...)
diff --git a/src/post.c b/src/post.c
index ec3271e..b5cbdb8 100644
--- a/src/post.c
+++ b/src/post.c
@@ -319,7 +319,7 @@ handle_post(void)
return;
serial_debug_preinit();
- dprintf(1, "Start bios (version %s)\n", VERSION);
+ debug_banner();
// Check if we are running under Xen.
xen_preinit();