j
: Next unread message k
: Previous unread message j a
: Jump to all threads
j l
: Jump to MailingList overview
Author: laurent Date: 2009-08-10 21:57:43 +0200 (Mon, 10 Aug 2009) New Revision: 545
Modified: trunk/openbios-devel/arch/ppc/qemu/main.c Log: There are numerous places where using 'ELF_DPRINTF' does not make sense, because the loader does not use ELF binaries or is not directly involved in loading them.
Created a generic SUBSYS_PRINTF macro, as well as loader-specific ELF_DPRINTF, CHRP_DPRINTF, and YABOOT_DPRINTF macros.
Signed-off-by: Steven Noonan steven@uplinklabs.net
Modified: trunk/openbios-devel/arch/ppc/qemu/main.c =================================================================== --- trunk/openbios-devel/arch/ppc/qemu/main.c 2009-08-10 19:50:04 UTC (rev 544) +++ trunk/openbios-devel/arch/ppc/qemu/main.c 2009-08-10 19:57:43 UTC (rev 545) @@ -25,14 +25,18 @@ #define NO_QEMU_PROTOS #include "openbios/fw_cfg.h"
-//#define DEBUG_ELF +//#define DEBUG_QEMU
-#ifdef DEBUG_ELF -#define ELF_DPRINTF(fmt, args...) \ -do { printk("ELF - %s: " fmt, __func__ , ##args); } while (0) +#ifdef DEBUG_QEMU +#define SUBSYS_DPRINTF(subsys, fmt, args...) \ + do { printk("%s - %s: " fmt, subsys, __func__ , ##args); } while (0) #else -#define ELF_DPRINTF(fmt, args...) do { } while (0) +#define SUBSYS_DPRINTF(subsys, fmt, args...) \ + do { } while (0) #endif +#define CHRP_DPRINTF(fmt, args...) SUBSYS_DPRINTF("CHRP", fmt, ##args) +#define ELF_DPRINTF(fmt, args...) SUBSYS_DPRINTF("ELF", fmt, ##args) +#define YABOOT_DPRINTF(fmt, args...) SUBSYS_DPRINTF("YABOOT", fmt, ##args)
static void transfer_control_to_elf( ulong elf_entry ) @@ -239,7 +243,7 @@ snprintf(bootscript, sizeof(bootscript), "%s:%d,%s", device, partition, script_path);
- ELF_DPRINTF("Trying %s\n", bootscript); + CHRP_DPRINTF("Trying %s\n", bootscript); if ((fd = open_io(bootscript)) == -1) { ELF_DPRINTF("Can't open %s\n", bootscript); return; @@ -308,7 +312,7 @@ } } while (1);
- ELF_DPRINTF("got bootscript %s\n", bootscript); + CHRP_DPRINTF("got bootscript %s\n", bootscript);
encode_bootpath(of_path, param);
@@ -399,7 +403,7 @@ }
if (!path) { - ELF_DPRINTF("Entering boot, no path\n"); + YABOOT_DPRINTF("Entering boot, no path\n"); push_str("boot-device"); push_str("/options"); fword("(find-dev)"); @@ -440,7 +444,7 @@ } } } else { - ELF_DPRINTF("Entering boot, path %s\n", path); + YABOOT_DPRINTF("Entering boot, path %s\n", path); try_path(path, param); for( i=0; i < sizeof(chrp_paths) / sizeof(chrp_paths[0]); i++ ) { try_chrp_script(path, param, chrp_paths[i]);