aboutsummaryrefslogtreecommitdiff
path: root/target-ppc
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-10-09 18:08:01 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-10-09 18:08:01 +0000
commit7fe48483cd90401de2477733ce65037ee0ed0906 (patch)
tree8c3fe5c0ffda5348071a085fa82f1b5dffd9f163 /target-ppc
parent8e3a9fd28059821f819295fe9178435990141924 (diff)
monitor fixes
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1110 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-ppc')
-rw-r--r--target-ppc/cpu.h1
-rw-r--r--target-ppc/helper.c4
-rw-r--r--target-ppc/op_helper.c4
-rw-r--r--target-ppc/translate.c37
4 files changed, 23 insertions, 23 deletions
diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h
index 951c9715b1..3198c9b972 100644
--- a/target-ppc/cpu.h
+++ b/target-ppc/cpu.h
@@ -189,7 +189,6 @@ int cpu_ppc_signal_handler(int host_signum, struct siginfo *info,
void do_interrupt (CPUPPCState *env);
void cpu_loop_exit(void);
-void cpu_ppc_dump_state(CPUPPCState *env, FILE *f, int flags);
void dump_stack (CPUPPCState *env);
uint32_t _load_xer (CPUPPCState *env);
diff --git a/target-ppc/helper.c b/target-ppc/helper.c
index 1ed07e8339..de646727a6 100644
--- a/target-ppc/helper.c
+++ b/target-ppc/helper.c
@@ -521,7 +521,7 @@ int cpu_ppc_handle_mmu_fault (CPUState *env, uint32_t address, int rw,
do_fault:
#if defined (DEBUG_MMU)
if (loglevel > 0)
- cpu_ppc_dump_state(env, logfile, 0);
+ cpu_dump_state(env, logfile, fprintf, 0);
#endif
if (access_type == ACCESS_CODE) {
exception = EXCP_ISI;
@@ -676,7 +676,7 @@ void do_interrupt (CPUState *env)
env->nip, excp << 8, env->error_code);
}
if (loglevel > 0)
- cpu_ppc_dump_state(env, logfile, 0);
+ cpu_dump_state(env, logfile, fprintf, 0);
}
#endif
if (loglevel & CPU_LOG_INT) {
diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c
index 30905d98a6..073ca37e16 100644
--- a/target-ppc/op_helper.c
+++ b/target-ppc/op_helper.c
@@ -466,14 +466,14 @@ void do_store_dbat (int ul, int nr)
/* Special helpers for debug */
void dump_state (void)
{
- // cpu_ppc_dump_state(env, stdout, 0);
+ // cpu_dump_state(env, stdout, fprintf, 0);
}
void dump_rfi (void)
{
#if 0
printf("Return from interrupt => 0x%08x\n", env->nip);
- // cpu_ppc_dump_state(env, stdout, 0);
+ // cpu_dump_state(env, stdout, fprintf, 0);
#endif
}
diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index fd52f73cc6..4647c6e066 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -2924,24 +2924,26 @@ static int create_ppc_proc (opc_handler_t **ppc_opcodes, unsigned long pvr)
/*****************************************************************************/
/* Misc PPC helpers */
-void cpu_ppc_dump_state(CPUPPCState *env, FILE *f, int flags)
+void cpu_dump_state(CPUState *env, FILE *f,
+ int (*cpu_fprintf)(FILE *f, const char *fmt, ...),
+ int flags)
{
int i;
- fprintf(f, "nip=0x%08x LR=0x%08x CTR=0x%08x XER=0x%08x "
+ cpu_fprintf(f, "nip=0x%08x LR=0x%08x CTR=0x%08x XER=0x%08x "
"MSR=0x%08x\n", env->nip, env->lr, env->ctr,
_load_xer(env), _load_msr(env));
for (i = 0; i < 32; i++) {
if ((i & 7) == 0)
- fprintf(f, "GPR%02d:", i);
- fprintf(f, " %08x", env->gpr[i]);
+ cpu_fprintf(f, "GPR%02d:", i);
+ cpu_fprintf(f, " %08x", env->gpr[i]);
if ((i & 7) == 7)
- fprintf(f, "\n");
+ cpu_fprintf(f, "\n");
}
- fprintf(f, "CR: 0x");
+ cpu_fprintf(f, "CR: 0x");
for (i = 0; i < 8; i++)
- fprintf(f, "%01x", env->crf[i]);
- fprintf(f, " [");
+ cpu_fprintf(f, "%01x", env->crf[i]);
+ cpu_fprintf(f, " [");
for (i = 0; i < 8; i++) {
char a = '-';
if (env->crf[i] & 0x08)
@@ -2950,22 +2952,21 @@ void cpu_ppc_dump_state(CPUPPCState *env, FILE *f, int flags)
a = 'G';
else if (env->crf[i] & 0x02)
a = 'E';
- fprintf(f, " %c%c", a, env->crf[i] & 0x01 ? 'O' : ' ');
+ cpu_fprintf(f, " %c%c", a, env->crf[i] & 0x01 ? 'O' : ' ');
}
- fprintf(f, " ] ");
- fprintf(f, "TB: 0x%08x %08x\n", cpu_ppc_load_tbu(env),
+ cpu_fprintf(f, " ] ");
+ cpu_fprintf(f, "TB: 0x%08x %08x\n", cpu_ppc_load_tbu(env),
cpu_ppc_load_tbl(env));
for (i = 0; i < 16; i++) {
if ((i & 3) == 0)
- fprintf(f, "FPR%02d:", i);
- fprintf(f, " %016llx", *((uint64_t *)&env->fpr[i]));
+ cpu_fprintf(f, "FPR%02d:", i);
+ cpu_fprintf(f, " %016llx", *((uint64_t *)&env->fpr[i]));
if ((i & 3) == 3)
- fprintf(f, "\n");
+ cpu_fprintf(f, "\n");
}
- fprintf(f, "SRR0 0x%08x SRR1 0x%08x DECR=0x%08x\n",
+ cpu_fprintf(f, "SRR0 0x%08x SRR1 0x%08x DECR=0x%08x\n",
env->spr[SRR0], env->spr[SRR1], cpu_ppc_load_decr(env));
- fprintf(f, "reservation 0x%08x\n", env->reserve);
- fflush(f);
+ cpu_fprintf(f, "reservation 0x%08x\n", env->reserve);
}
#if !defined(CONFIG_USER_ONLY) && defined (USE_OPENFIRMWARE)
@@ -3170,7 +3171,7 @@ int gen_intermediate_code_internal (CPUState *env, TranslationBlock *tb,
#ifdef DEBUG_DISAS
if (loglevel & CPU_LOG_TB_CPU) {
fprintf(logfile, "---------------- excp: %04x\n", ctx.exception);
- cpu_ppc_dump_state(env, logfile, 0);
+ cpu_dump_state(env, logfile, fprintf, 0);
}
if (loglevel & CPU_LOG_TB_IN_ASM) {
fprintf(logfile, "IN: %s\n", lookup_symbol((void *)pc_start));