2 * blantantly copied from linux/kernel/printk.c
4 * Copyright (C) 1991, 1992 Linus Torvalds
9 #include <smp/spinlock.h>
10 #include <console/vtxprintf.h>
11 #include <console/console.h>
13 /* printk's without a loglevel use this.. */
14 #define DEFAULT_MESSAGE_LOGLEVEL 4 /* BIOS_WARNING */
16 /* We show everything that is MORE important than this.. */
17 #define MINIMUM_CONSOLE_LOGLEVEL 1 /* Minimum loglevel we let people use */
19 /* Keep together for sysctl support */
21 int console_loglevel = CONFIG_DEFAULT_CONSOLE_LOGLEVEL;
22 int default_console_loglevel = CONFIG_DEFAULT_CONSOLE_LOGLEVEL;
24 DECLARE_SPIN_LOCK(console_lock)
26 int do_printk(int msg_level, const char *fmt, ...)
31 if (msg_level > console_loglevel) {
35 spin_lock(&console_lock);
38 i = vtxprintf(console_tx_byte, fmt, args);
43 spin_unlock(&console_lock);