diff options
author | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-01-15 22:34:14 +0000 |
---|---|---|
committer | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-01-15 22:34:14 +0000 |
commit | 93fcfe39a0383377e647b821c9f165fd927cd4e0 (patch) | |
tree | 0c89165b2c8331045c6da46eb2dc4154ef69293a /hw | |
parent | 6cec5487990bf3f1f22b3fcb871978255e92ae0d (diff) |
Convert references to logfile/loglevel to use qemu_log*() macros
This is a large patch that changes all occurrences of logfile/loglevel
global variables to use the new qemu_log*() macros.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6338 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw')
-rw-r--r-- | hw/alpha_palcode.c | 15 | ||||
-rw-r--r-- | hw/mips_timer.c | 4 | ||||
-rw-r--r-- | hw/ppc.c | 10 | ||||
-rw-r--r-- | hw/ppc4xx_devs.c | 5 | ||||
-rw-r--r-- | hw/ppc_prep.c | 9 |
5 files changed, 11 insertions, 32 deletions
diff --git a/hw/alpha_palcode.c b/hw/alpha_palcode.c index 151f3c2ab5..bfffb5d29c 100644 --- a/hw/alpha_palcode.c +++ b/hw/alpha_palcode.c @@ -1061,13 +1061,11 @@ void call_pal (CPUState *env, int palcode) { target_long ret; - if (logfile != NULL) - fprintf(logfile, "%s: palcode %02x\n", __func__, palcode); + qemu_log("%s: palcode %02x\n", __func__, palcode); switch (palcode) { case 0x83: /* CALLSYS */ - if (logfile != NULL) - fprintf(logfile, "CALLSYS n " TARGET_FMT_ld "\n", env->ir[0]); + qemu_log("CALLSYS n " TARGET_FMT_ld "\n", env->ir[0]); ret = do_syscall(env, env->ir[IR_V0], env->ir[IR_A0], env->ir[IR_A1], env->ir[IR_A2], env->ir[IR_A3], env->ir[IR_A4], env->ir[IR_A5]); @@ -1082,18 +1080,15 @@ void call_pal (CPUState *env, int palcode) case 0x9E: /* RDUNIQUE */ env->ir[IR_V0] = env->unique; - if (logfile != NULL) - fprintf(logfile, "RDUNIQUE: " TARGET_FMT_lx "\n", env->unique); + qemu_log("RDUNIQUE: " TARGET_FMT_lx "\n", env->unique); break; case 0x9F: /* WRUNIQUE */ env->unique = env->ir[IR_A0]; - if (logfile != NULL) - fprintf(logfile, "WRUNIQUE: " TARGET_FMT_lx "\n", env->unique); + qemu_log("WRUNIQUE: " TARGET_FMT_lx "\n", env->unique); break; default: - if (logfile != NULL) - fprintf(logfile, "%s: unhandled palcode %02x\n", + qemu_log("%s: unhandled palcode %02x\n", __func__, palcode); exit(1); } diff --git a/hw/mips_timer.c b/hw/mips_timer.c index 67b873511c..d341e51657 100644 --- a/hw/mips_timer.c +++ b/hw/mips_timer.c @@ -84,9 +84,7 @@ static void mips_timer_cb (void *opaque) env = opaque; #if 0 - if (logfile) { - fprintf(logfile, "%s\n", __func__); - } + qemu_log("%s\n", __func__); #endif if (env->CP0_Cause & (1 << CP0Ca_DC)) @@ -32,20 +32,14 @@ //#define PPC_DEBUG_TB #ifdef PPC_DEBUG_IRQ -# define LOG_IRQ(...) do { \ - if (loglevel & CPU_LOG_INT) \ - fprintf(logfile, ## __VA_ARGS__); \ - } while (0) +# define LOG_IRQ(...) qemu_log_mask(CPU_LOG_INT, ## __VA_ARGS__) #else # define LOG_IRQ(...) do { } while (0) #endif #ifdef PPC_DEBUG_TB -# define LOG_TB(...) do { \ - if (loglevel) \ - fprintf(logfile, ## __VA_ARGS__); \ - } while (0) +# define LOG_TB(...) qemu_log(__VA_ARGS__) #else # define LOG_TB(...) do { } while (0) #endif diff --git a/hw/ppc4xx_devs.c b/hw/ppc4xx_devs.c index 4605159c79..aec0602ced 100644 --- a/hw/ppc4xx_devs.c +++ b/hw/ppc4xx_devs.c @@ -33,10 +33,7 @@ #ifdef DEBUG_UIC -# define LOG_UIC(...) do { \ - if (loglevel & CPU_LOG_INT) \ - fprintf(logfile, ## __VA_ARGS__); \ - } while (0) +# define LOG_UIC(...) qemu_log_mask(CPU_LOG_INT, ## __VA_ARGS__) #else # define LOG_UIC(...) do { } while (0) #endif diff --git a/hw/ppc_prep.c b/hw/ppc_prep.c index 6c0d8fe7cf..506391c8e4 100644 --- a/hw/ppc_prep.c +++ b/hw/ppc_prep.c @@ -53,18 +53,13 @@ #define PPC_IO_DPRINTF(fmt, args...) \ do { \ if (loglevel & CPU_LOG_IOPORT) { \ - fprintf(logfile, "%s: " fmt, __func__ , ##args); \ + qemu_log("%s: " fmt, __func__ , ##args); \ } else { \ printf("%s : " fmt, __func__ , ##args); \ } \ } while (0) #elif defined (DEBUG_PPC_IO) -#define PPC_IO_DPRINTF(fmt, args...) \ -do { \ - if (loglevel & CPU_LOG_IOPORT) { \ - fprintf(logfile, "%s: " fmt, __func__ , ##args); \ - } \ -} while (0) +#define PPC_IO_DPRINTF(fmt, args...) qemu_log_mask(CPU_LOG_IOPORT, ## __VA_ARGS__) #else #define PPC_IO_DPRINTF(fmt, args...) do { } while (0) #endif |