From 0001a7f1291d303b287050e440cf97be620ff5c3 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Tue, 21 Jul 2009 21:25:45 +0000 Subject: Example how simple it is to use printk instead of printk_something in coreboot ram stage. Signed-off-by: Stefan Reinauer Acked-by: Carl-Daniel Hailfinger Acked-by: Peter Stuge git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4450 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- src/boot/hardwaremain.c | 5 ++--- src/include/console/console.h | 2 ++ src/include/x86emu/x86emu.h | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/boot/hardwaremain.c b/src/boot/hardwaremain.c index 058be24ebc..a0543401ed 100644 --- a/src/boot/hardwaremain.c +++ b/src/boot/hardwaremain.c @@ -25,7 +25,6 @@ it with the version available from LANL. * C Bootstrap code for the coreboot */ - #include #include #include @@ -62,7 +61,7 @@ void hardwaremain(int boot_complete) 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 @@ void hardwaremain(int boot_complete) elfboot(lb_mem); #endif #endif - printk_err("Boot failed.\n"); + printk(BIOS_ERR, "Boot failed.\n"); } diff --git a/src/include/console/console.h b/src/include/console/console.h index b4e8e0911b..4bebdadb0c 100644 --- a/src/include/console/console.h +++ b/src/include/console/console.h @@ -29,6 +29,8 @@ extern struct console_driver econsole_drivers[]; 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) diff --git a/src/include/x86emu/x86emu.h b/src/include/x86emu/x86emu.h index bd01f20cc4..c52b5567a3 100644 --- a/src/include/x86emu/x86emu.h +++ b/src/include/x86emu/x86emu.h @@ -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 -- cgit v1.2.3