diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2014-02-04 19:03:57 +0200 |
---|---|---|
committer | Patrick Georgi <patrick@georgi-clan.de> | 2014-04-09 13:21:25 +0200 |
commit | 657e0be46495bb54ddf5a0fbad786fe352c2847f (patch) | |
tree | 3e4c5c4268d78078be1949d828800ae6c7196600 /src/console/printk.c | |
parent | b3356bbff42148094ada671d3a0a803f195542e6 (diff) | |
download | coreboot-657e0be46495bb54ddf5a0fbad786fe352c2847f.tar.xz |
console: Move newline translation outside console_tx_byte
This gives us completely transparent low-level function to transmit
data.
Change-Id: I706791ff43d80a36a7252a4da0e6f3af92520db7
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/5336
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <patrick@georgi-clan.de>
Diffstat (limited to 'src/console/printk.c')
-rw-r--r-- | src/console/printk.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/console/printk.c b/src/console/printk.c index c61f63e6a6..63d37cc044 100644 --- a/src/console/printk.c +++ b/src/console/printk.c @@ -13,6 +13,13 @@ DECLARE_SPIN_LOCK(console_lock) +void do_putchar(unsigned char byte) +{ + if (byte == '\n') + console_tx_byte('\r'); + console_tx_byte(byte); +} + int do_printk(int msg_level, const char *fmt, ...) { va_list args; @@ -30,7 +37,7 @@ int do_printk(int msg_level, const char *fmt, ...) spin_lock(&console_lock); va_start(args, fmt); - i = vtxprintf(console_tx_byte, fmt, args); + i = vtxprintf(do_putchar, fmt, args); va_end(args); console_tx_flush(); @@ -44,7 +51,8 @@ int do_printk(int msg_level, const char *fmt, ...) #if CONFIG_CHROMEOS void do_vtxprintf(const char *fmt, va_list args) { - vtxprintf(console_tx_byte, fmt, args); + vtxprintf(do_putchar, fmt, args); console_tx_flush(); } #endif + |