From 9324ccd21c271a8aa227c8efa40ab6d5351038ae Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Thu, 8 Mar 2007 18:21:58 +0000 Subject: [PATCH] simplify (LB) tag code and add a config option for it. Signed-off-by: Stefan Reinauer Acked-by: Carl-Daniel Hailfinger git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@215 f3766cd6-281f-0410-b1cd-43a5c92072e9 --- arch/x86/console.c | 22 ++++++++++++++-------- console/Kconfig | 8 ++++++++ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/arch/x86/console.c b/arch/x86/console.c index bd20954469..0793e356d3 100644 --- a/arch/x86/console.c +++ b/arch/x86/console.c @@ -16,8 +16,19 @@ int console_loglevel(void) void console_tx_byte(unsigned char byte, void *ignored) { - if (byte == '\n') + if (byte == '\n') { uart8250_tx_byte(TTYSx_BASE, '\r'); +#if defined(CONFIG_CONSOLE_SERIAL_TAG) && (CONFIG_CONSOLE_SERIAL_TAG == 1) + uart8250_tx_byte(TTYSx_BASE, '\n'); + uart8250_tx_byte(TTYSx_BASE, '('); + uart8250_tx_byte(TTYSx_BASE, 'L'); + uart8250_tx_byte(TTYSx_BASE, 'B'); + uart8250_tx_byte(TTYSx_BASE, ')'); + uart8250_tx_byte(TTYSx_BASE, ' '); + return; +#endif + } + uart8250_tx_byte(TTYSx_BASE, byte); } @@ -30,8 +41,6 @@ int printk(int msg_level, const char *fmt, ...) return 0; } - i = vtxprintf(console_tx_byte, (void *)0, "(LB) ", args); - va_start(args, fmt); i = vtxprintf(console_tx_byte, (void *)0, fmt, args); va_end(args); @@ -41,7 +50,6 @@ int printk(int msg_level, const char *fmt, ...) void console_init(void) { - va_list args; static const char console_test[] = "\n\nLinuxBIOS-" LINUXBIOS_VERSION @@ -50,10 +58,8 @@ void console_init(void) LINUXBIOS_BUILD " starting...\n"; - /* We don't use printk() directly here in order to avoid printing - the "(LB) " in the first line of LinuxBIOS output. */ - if (BIOS_INFO < console_loglevel()) - vtxprintf(console_tx_byte, (void *)0, console_test, args); + printk(BIOS_INFO, console_test); + } void die(const char *str) diff --git a/console/Kconfig b/console/Kconfig index 0dcaf60c5e..bc19af7a2f 100644 --- a/console/Kconfig +++ b/console/Kconfig @@ -128,6 +128,14 @@ config CONSOLE_SERIAL_9600 endchoice +config CONSOLE_SERIAL_TAG + bool "Tag serial console output" + depends CONSOLE_SERIAL + default n + help + When you enable this option, LinuxBIOS will prefix each line of + serial output with (LB). + config CONSOLE_VGA boolean "VGA console support" depends CONSOLE