Author: hailfinger Date: 2008-08-18 22:13:11 +0200 (Mon, 18 Aug 2008) New Revision: 786
Modified: coreboot-v3/arch/x86/stage1.c coreboot-v3/include/console.h coreboot-v3/lib/console.c Log: Move console log level management to global variable infrastructure. The existing code does not work due to the characteristics of stage1. This has been broken since r729.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net Acked-by: Ronald G. Minnich rminnich@gmail.com
Modified: coreboot-v3/arch/x86/stage1.c =================================================================== --- coreboot-v3/arch/x86/stage1.c 2008-08-18 16:54:12 UTC (rev 785) +++ coreboot-v3/arch/x86/stage1.c 2008-08-18 20:13:11 UTC (rev 786) @@ -89,6 +89,12 @@ { memset(globvars, 0, sizeof(struct global_vars)); *(struct global_vars **)(bottom_of_stack() - sizeof(struct global_vars *)) = globvars; +#ifdef CONFIG_CONSOLE_BUFFER + /* Initialize the printk buffer. */ + printk_buffer_init(); +#endif + console_loglevel_init(); + }
void dump_mem_range(int msg_level, unsigned char *buf, int size) @@ -163,11 +169,6 @@ */ global_vars_init(&globvars);
-#ifdef CONFIG_CONSOLE_BUFFER - /* Initialize the printk buffer. NEVER run this on an AP! */ - printk_buffer_init(); -#endif - hardware_stage1();
//
Modified: coreboot-v3/include/console.h =================================================================== --- coreboot-v3/include/console.h 2008-08-18 16:54:12 UTC (rev 785) +++ coreboot-v3/include/console.h 2008-08-18 20:13:11 UTC (rev 786) @@ -37,6 +37,7 @@ void console_tx_flush(void); unsigned char console_rx_byte(void); int console_tst_byte(void); +void console_loglevel_init(void); #ifdef CONFIG_CONSOLE_BUFFER void printk_buffer_init(void); void printk_buffer_move(void *newaddr, int newsize); @@ -69,6 +70,7 @@ #ifdef CONFIG_CONSOLE_BUFFER struct printk_buffer *printk_buffer; #endif + unsigned int loglevel; };
int printk(int msg_level, const char *fmt, ...) __attribute__((format (printf, 2, 3)));
Modified: coreboot-v3/lib/console.c =================================================================== --- coreboot-v3/lib/console.c 2008-08-18 16:54:12 UTC (rev 785) +++ coreboot-v3/lib/console.c 2008-08-18 20:13:11 UTC (rev 786) @@ -8,8 +8,6 @@ int vtxprintf(void (*)(unsigned char, void *arg), void *arg, const char *, va_list);
-static unsigned int loglevel = CONFIG_DEFAULT_CONSOLE_LOGLEVEL; - /** * set the console log level * There are no invalid settings, although there are ones that @@ -21,7 +19,7 @@ if (level > BIOS_SPEW) printk(BIOS_ALWAYS, "Warning: ridiculous log level setting: %d (max %d)\n", level, BIOS_SPEW); - loglevel = level; + global_vars()->loglevel = level; }
/** @@ -31,9 +29,14 @@ */ static unsigned int console_loglevel(void) { - return loglevel; + return global_vars()->loglevel; }
+void console_loglevel_init(void) +{ + set_loglevel(CONFIG_DEFAULT_CONSOLE_LOGLEVEL); +} + #ifdef CONFIG_CONSOLE_BUFFER struct printk_buffer *printk_buffer_addr(void) {