diff options
Diffstat (limited to 'src/console/printk.c')
-rw-r--r-- | src/console/printk.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/console/printk.c b/src/console/printk.c index ffa3106178..8db2c45f13 100644 --- a/src/console/printk.c +++ b/src/console/printk.c @@ -67,6 +67,8 @@ union log_state { }; }; +#define LOG_FAST(state) (HAS_ONLY_FAST_CONSOLES || ((state).level == CONSOLE_LOG_FAST)) + static void wrap_interactive_printf(const char *fmt, ...) { va_list args; @@ -83,7 +85,7 @@ static void line_start(union log_state state) LOG_FAST mode, just write the marker to CBMC and exit -- the rest of this function implements the LOG_ALL case. */ unsigned char marker = BIOS_LOG_LEVEL_TO_MARKER(state.level); - if (state.speed == CONSOLE_LOG_FAST) { + if (LOG_FAST(state)) { __cbmemc_tx_byte(marker); return; } @@ -98,7 +100,7 @@ static void line_start(union log_state state) static void line_end(union log_state state) { - if (CONFIG(CONSOLE_USE_ANSI_ESCAPES) && state.speed != CONSOLE_LOG_FAST) + if (CONFIG(CONSOLE_USE_ANSI_ESCAPES) && !LOG_FAST(state)) wrap_interactive_printf(BIOS_LOG_ESCAPE_RESET); } @@ -115,7 +117,7 @@ static void wrap_putchar(unsigned char byte, void *data) line_started = true; } - if (state.speed == CONSOLE_LOG_FAST) + if (LOG_FAST(state)) __cbmemc_tx_byte(byte); else console_tx_byte(byte); @@ -138,7 +140,7 @@ int vprintk(int msg_level, const char *fmt, va_list args) console_time_run(); i = vtxprintf(wrap_putchar, fmt, args, state.as_ptr); - if (state.speed != CONSOLE_LOG_FAST) + if (LOG_FAST(state)) console_tx_flush(); console_time_stop(); |