3 #ifndef CONSOLE_CONSOLE_H_
4 #define CONSOLE_CONSOLE_H_
13 #define RAM_DEBUG (CONFIG(DEBUG_RAM_SETUP) ? BIOS_DEBUG : BIOS_NEVER)
14 #define RAM_SPEW (CONFIG(DEBUG_RAM_SETUP) ? BIOS_SPEW : BIOS_NEVER)
21 #define die_with_post_code(value, fmt, ...) \
22 do { post_code(value); die(fmt, ##__VA_ARGS__); } while (0)
30 #if CONFIG(CONSOLE_OVERRIDE_LOGLEVEL)
39 return CONFIG_DEFAULT_CONSOLE_LOGLEVEL;
43 #define __CONSOLE_ENABLE__ \
44 ((ENV_BOOTBLOCK && CONFIG(BOOTBLOCK_CONSOLE)) || \
45 (ENV_POSTCAR && CONFIG(POSTCAR_CONSOLE)) || \
46 ENV_SEPARATE_VERSTAGE || ENV_ROMSTAGE || ENV_RAMSTAGE || \
47 ENV_LIBAGESA || (ENV_SMM && CONFIG(DEBUG_SMI)))
49 #if __CONSOLE_ENABLE__
54 int printk(
int msg_level,
const char *fmt, ...) __attribute__((format(
printf, 2, 3)));
70 enum { CONSOLE_LOG_NONE = 0, CONSOLE_LOG_FAST, CONSOLE_LOG_ALL };
71 #define HAS_ONLY_FAST_CONSOLES !(CONFIG(SPKMODEM) || CONFIG(CONSOLE_QEMU_DEBUGCON) || \
72 CONFIG(CONSOLE_SERIAL) || CONFIG(CONSOLE_NE2K) || CONFIG(CONSOLE_USB) || \
73 CONFIG(EM100PRO_SPI_CONSOLE) || CONFIG(CONSOLE_SPI_FLASH) || \
74 CONFIG(CONSOLE_SYSTEM76_EC))
81 __attribute__((format(
printf, 2, 3)))
82 printk(
int LEVEL, const
char *fmt, ...) {
return 0; }
static void do_putchar(unsigned char byte)
void arch_post_code(u8 value)
static int get_console_loglevel(void)
static int console_log_level(int msg_level)
static int vprintk(int LEVEL, const char *fmt, va_list args)
void mainboard_post(u8 value)
static int printk(int LEVEL, const char *fmt,...)
void __noreturn die(const char *fmt,...)
static void console_time_report(void)
static int get_log_level(void)
static long console_time_get_and_reset(void)
static void console_init(void)
Definitions of the log levels to be used in printk calls.
__builtin_va_list va_list