[coreboot] [v2] r4450 - in trunk/coreboot-v2/src: boot include/console include/x86emu

svn at coreboot.org svn at coreboot.org
Tue Jul 21 23:25:46 CEST 2009


Author: stepan
Date: 2009-07-21 23:25:45 +0200 (Tue, 21 Jul 2009)
New Revision: 4450

Modified:
   trunk/coreboot-v2/src/boot/hardwaremain.c
   trunk/coreboot-v2/src/include/console/console.h
   trunk/coreboot-v2/src/include/x86emu/x86emu.h
Log:
Example how simple it is to use printk instead of printk_something in
coreboot ram stage.

Signed-off-by: Stefan Reinauer <stepan at coresystems.de>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>
Acked-by: Peter Stuge <peter at stuge.se>



Modified: trunk/coreboot-v2/src/boot/hardwaremain.c
===================================================================
--- trunk/coreboot-v2/src/boot/hardwaremain.c	2009-07-21 21:24:22 UTC (rev 4449)
+++ trunk/coreboot-v2/src/boot/hardwaremain.c	2009-07-21 21:25:45 UTC (rev 4450)
@@ -25,7 +25,6 @@
  * C Bootstrap code for the coreboot
  */
 
-
 #include <console/console.h>
 #include <version.h>
 #include <device/device.h>
@@ -62,7 +61,7 @@
 	
 	post_code(0x39);
 
-	printk_notice("coreboot-%s%s %s %s...\n", 
+	printk(BIOS_NOTICE, "coreboot-%s%s %s %s...\n", 
 		      coreboot_version, coreboot_extra_version, coreboot_build,
 		      (boot_complete)?"rebooting":"booting");
 
@@ -113,6 +112,6 @@
 	elfboot(lb_mem);
 #endif
 #endif
-	printk_err("Boot failed.\n");
+	printk(BIOS_ERR, "Boot failed.\n");
 }
 

Modified: trunk/coreboot-v2/src/include/console/console.h
===================================================================
--- trunk/coreboot-v2/src/include/console/console.h	2009-07-21 21:24:22 UTC (rev 4449)
+++ trunk/coreboot-v2/src/include/console/console.h	2009-07-21 21:25:45 UTC (rev 4450)
@@ -29,6 +29,8 @@
 extern int console_loglevel;
 int do_printk(int msg_level, const char *fmt, ...) __attribute__((format(printf, 2, 3)));
 
+#define printk(x...) do_printk(x)
+
 #define printk_emerg(fmt, arg...)   do_printk(BIOS_EMERG   ,fmt, ##arg)
 #define printk_alert(fmt, arg...)   do_printk(BIOS_ALERT   ,fmt, ##arg)
 #define printk_crit(fmt, arg...)    do_printk(BIOS_CRIT    ,fmt, ##arg)

Modified: trunk/coreboot-v2/src/include/x86emu/x86emu.h
===================================================================
--- trunk/coreboot-v2/src/include/x86emu/x86emu.h	2009-07-21 21:24:22 UTC (rev 4449)
+++ trunk/coreboot-v2/src/include/x86emu/x86emu.h	2009-07-21 21:25:45 UTC (rev 4450)
@@ -49,7 +49,8 @@
 /* FIXME: undefine printk for the moment */
 #ifdef COREBOOT_VERSION
 #include "console/console.h"
-#define printk printk_debug
+#undef printk
+#define printk(x...) do_printk(BIOS_DEBUG, x)
 #else
 #define printk printf
 #endif 





More information about the coreboot mailing list