2 * blantantly copied from linux/kernel/printk.c
4 * Copyright (C) 1991, 1992 Linus Torvalds
6 * by yhlu moved from arch/ppc/lib/printk_init.c, removed the global variable console_loglevel
9 #include <console/loglevel.h>
11 /* printk's without a loglevel use this.. */
12 #define DEFAULT_MESSAGE_LOGLEVEL 4 /* BIOS_WARNING */
14 /* Keep together for sysctl support */
15 /* Using an global varible can cause problem when we reset the stack from cache as ram to ram*/
17 int console_loglevel = CONFIG_DEFAULT_CONSOLE_LOGLEVEL;
19 #define console_loglevel ASM_CONSOLE_LOGLEVEL
22 extern int vtxprintf(void (*)(unsigned char), const char *, va_list);
23 extern void uart8250_tx_byte(unsigned, unsigned char);
25 void console_tx_byte(unsigned char byte)
28 uart8250_tx_byte(CONFIG_TTYS0_BASE, '\r');
29 uart8250_tx_byte(CONFIG_TTYS0_BASE, byte);
32 int do_printk(int msg_level, const char *fmt, ...)
37 if (msg_level > console_loglevel) {
42 i = vtxprintf(console_tx_byte, fmt, args);