2 * blantantly copied from linux/kernel/printk.c
4 * Copyright (C) 1991, 1992 Linus Torvalds
9 #include <smp/spinlock.h>
10 #include <console/console.h>
12 /* Keep together for sysctl support */
14 unsigned int console_loglevel = DEFAULT_CONSOLE_LOGLEVEL;
17 extern int vtxprintf(void (*)(unsigned char), const char *, va_list);
19 static spinlock_t console_lock = SPIN_LOCK_UNLOCKED;
21 int do_printk(int msg_level, const char *fmt, ...)
26 if (msg_level >= console_loglevel) {
30 spin_lock(&console_lock);
33 i = vtxprintf(console_tx_byte, fmt, args);
38 spin_unlock(&console_lock);