summaryrefslogtreecommitdiff
path: root/target-cris
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-01-15 22:34:14 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-01-15 22:34:14 +0000
commit93fcfe39a0383377e647b821c9f165fd927cd4e0 (patch)
tree0c89165b2c8331045c6da46eb2dc4154ef69293a /target-cris
parent6cec5487990bf3f1f22b3fcb871978255e92ae0d (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 'target-cris')
-rw-r--r--target-cris/helper.c2
-rw-r--r--target-cris/mmu.c2
-rw-r--r--target-cris/op_helper.c4
-rw-r--r--target-cris/translate.c22
4 files changed, 13 insertions, 17 deletions
diff --git a/target-cris/helper.c b/target-cris/helper.c
index e24ba13fde..ae2f8dddb2 100644
--- a/target-cris/helper.c
+++ b/target-cris/helper.c
@@ -34,7 +34,7 @@
#ifdef CRIS_HELPER_DEBUG
#define D(x) x
-#define D_LOG(...) fprintf(logfile, ## __VA_ARGS__)
+#define D_LOG(...) qemu_log(__VA__ARGS__)
#else
#define D(x)
#define D_LOG(...) do { } while (0)
diff --git a/target-cris/mmu.c b/target-cris/mmu.c
index dd4fb3ff96..9d7981663b 100644
--- a/target-cris/mmu.c
+++ b/target-cris/mmu.c
@@ -32,7 +32,7 @@
#ifdef DEBUG
#define D(x) x
-#define D_LOG(...) fprintf(logfile, ## __VA_ARGS__)
+#define D_LOG(...) qemu_log(__VA__ARGS__)
#else
#define D(x)
#define D_LOG(...) do { } while (0)
diff --git a/target-cris/op_helper.c b/target-cris/op_helper.c
index c55ce86b64..2e280f3b62 100644
--- a/target-cris/op_helper.c
+++ b/target-cris/op_helper.c
@@ -30,7 +30,7 @@
#ifdef CRIS_OP_HELPER_DEBUG
#define D(x) x
-#define D_LOG(...) fprintf(logfile, ## __VA_ARGS__)
+#define D_LOG(...) qemu_log(__VA__ARGS__)
#else
#define D(x)
#define D_LOG(...) do { } while (0)
@@ -117,7 +117,7 @@ void helper_spc_write(uint32_t new_spc)
void helper_dump(uint32_t a0, uint32_t a1, uint32_t a2)
{
- (fprintf(logfile, "%s: a0=%x a1=%x\n", __func__, a0, a1));
+ qemu_log("%s: a0=%x a1=%x\n", __func__, a0, a1);
}
/* Used by the tlb decoder. */
diff --git a/target-cris/translate.c b/target-cris/translate.c
index c53663565a..8bd2136677 100644
--- a/target-cris/translate.c
+++ b/target-cris/translate.c
@@ -44,10 +44,7 @@
#define DISAS_CRIS 0
#if DISAS_CRIS
-# define LOG_DIS(...) do { \
- if (loglevel & CPU_LOG_TB_IN_ASM) \
- fprintf(logfile, ## __VA_ARGS__); \
- } while (0)
+# define LOG_DIS(...) qemu_log_mask(CPU_LOG_TB_IN_ASM, ## __VA_ARGS__)
#else
# define LOG_DIS(...) do { } while (0)
#endif
@@ -131,7 +128,7 @@ typedef struct DisasContext {
static void gen_BUG(DisasContext *dc, const char *file, int line)
{
printf ("BUG: pc=%x %s %d\n", dc->pc, file, line);
- fprintf (logfile, "BUG: pc=%x %s %d\n", dc->pc, file, line);
+ qemu_log("BUG: pc=%x %s %d\n", dc->pc, file, line);
cpu_abort(dc->env, "%s:%d\n", file, line);
}
@@ -798,7 +795,7 @@ static void cris_alu_op_exec(DisasContext *dc, int op,
t_gen_subx_carry(dc, dst);
break;
default:
- fprintf (logfile, "illegal ALU op.\n");
+ qemu_log("illegal ALU op.\n");
BUG();
break;
}
@@ -3147,8 +3144,7 @@ gen_intermediate_code_internal(CPUState *env, TranslationBlock *tb,
int num_insns;
int max_insns;
- if (!logfile)
- logfile = stderr;
+ qemu_log_try_set_file(stderr);
/* Odd PC indicates that branch is rexecuting due to exception in the
* delayslot, like in real hw.
@@ -3184,7 +3180,7 @@ gen_intermediate_code_internal(CPUState *env, TranslationBlock *tb,
dc->cpustate_changed = 0;
if (loglevel & CPU_LOG_TB_IN_ASM) {
- fprintf(logfile,
+ qemu_log(
"srch=%d pc=%x %x flg=%llx bt=%x ds=%u ccs=%x\n"
"pid=%x usp=%x\n"
"%x.%x.%x.%x\n"
@@ -3202,8 +3198,8 @@ gen_intermediate_code_internal(CPUState *env, TranslationBlock *tb,
env->regs[10], env->regs[11],
env->regs[12], env->regs[13],
env->regs[14], env->regs[15]);
- fprintf(logfile, "--------------\n");
- fprintf(logfile, "IN: %s\n", lookup_symbol(pc_start));
+ qemu_log("--------------\n");
+ qemu_log("IN: %s\n", lookup_symbol(pc_start));
}
next_page_start = (pc_start & TARGET_PAGE_MASK) + TARGET_PAGE_SIZE;
@@ -3336,8 +3332,8 @@ gen_intermediate_code_internal(CPUState *env, TranslationBlock *tb,
#ifdef DEBUG_DISAS
#if !DISAS_CRIS
if (loglevel & CPU_LOG_TB_IN_ASM) {
- target_disas(logfile, pc_start, dc->pc - pc_start, 0);
- fprintf(logfile, "\nisize=%d osize=%zd\n",
+ log_target_disas(pc_start, dc->pc - pc_start, 0);
+ qemu_log("\nisize=%d osize=%zd\n",
dc->pc - pc_start, gen_opc_ptr - gen_opc_buf);
}
#endif