simplify (LB) tag code and add a config option for it.

Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>



git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@215 f3766cd6-281f-0410-b1cd-43a5c92072e9
This commit is contained in:
Stefan Reinauer 2007-03-08 18:21:58 +00:00
parent b9f2e7a509
commit 9324ccd21c
2 changed files with 22 additions and 8 deletions

View file

@ -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)

View file

@ -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