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
Index: corebootv3-console_loglevel_global_var/include/console.h =================================================================== --- corebootv3-console_loglevel_global_var/include/console.h (Revision 785) +++ corebootv3-console_loglevel_global_var/include/console.h (Arbeitskopie) @@ -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))); Index: corebootv3-console_loglevel_global_var/lib/console.c =================================================================== --- corebootv3-console_loglevel_global_var/lib/console.c (Revision 785) +++ corebootv3-console_loglevel_global_var/lib/console.c (Arbeitskopie) @@ -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) { Index: corebootv3-console_loglevel_global_var/arch/x86/stage1.c =================================================================== --- corebootv3-console_loglevel_global_var/arch/x86/stage1.c (Revision 785) +++ corebootv3-console_loglevel_global_var/arch/x86/stage1.c (Arbeitskopie) @@ -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();
//
Acked-by: Ronald G. Minnich rminnich@gmail.com
On 18.08.2008 21:55, ron minnich wrote:
Acked-by: Ronald G. Minnich rminnich@gmail.com
Thanks, r786.
Regards, Carl-Daniel