diff options
Diffstat (limited to 'target-ppc/op_helper.c')
-rw-r--r-- | target-ppc/op_helper.c | 41 |
1 files changed, 37 insertions, 4 deletions
diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c index a65da36b7b..140b7f5cb2 100644 --- a/target-ppc/op_helper.c +++ b/target-ppc/op_helper.c @@ -68,6 +68,12 @@ void do_raise_exception (uint32_t exception) do_raise_exception_err(exception, 0); } +void cpu_dump_EA (target_ulong EA); +void do_print_mem_EA (target_ulong EA) +{ + cpu_dump_EA(EA); +} + /*****************************************************************************/ /* Registers load and stores */ void do_load_cr (void) @@ -181,6 +187,25 @@ void do_store_fpscr (uint32_t mask) set_float_rounding_mode(rnd_type, &env->fp_status); } +target_ulong ppc_load_dump_spr (int sprn) +{ + if (loglevel) { + fprintf(logfile, "Read SPR %d %03x => " ADDRX "\n", + sprn, sprn, env->spr[sprn]); + } + + return env->spr[sprn]; +} + +void ppc_store_dump_spr (int sprn, target_ulong val) +{ + if (loglevel) { + fprintf(logfile, "Write SPR %d %03x => " ADDRX " <= " ADDRX "\n", + sprn, sprn, env->spr[sprn], val); + } + env->spr[sprn] = val; +} + /*****************************************************************************/ /* Fixed point operations helpers */ #if defined(TARGET_PPC64) @@ -1250,10 +1275,14 @@ void do_load_dcr (void) target_ulong val; if (unlikely(env->dcr_env == NULL)) { - printf("No DCR environment\n"); + if (loglevel) { + fprintf(logfile, "No DCR environment\n"); + } do_raise_exception_err(EXCP_PROGRAM, EXCP_INVAL | EXCP_INVAL_INVAL); } else if (unlikely(ppc_dcr_read(env->dcr_env, T0, &val) != 0)) { - printf("DCR read error\n"); + if (loglevel) { + fprintf(logfile, "DCR read error %d %03x\n", (int)T0, (int)T0); + } do_raise_exception_err(EXCP_PROGRAM, EXCP_INVAL | EXCP_PRIV_REG); } else { T0 = val; @@ -1263,10 +1292,14 @@ void do_load_dcr (void) void do_store_dcr (void) { if (unlikely(env->dcr_env == NULL)) { - printf("No DCR environment\n"); + if (loglevel) { + fprintf(logfile, "No DCR environment\n"); + } do_raise_exception_err(EXCP_PROGRAM, EXCP_INVAL | EXCP_INVAL_INVAL); } else if (unlikely(ppc_dcr_write(env->dcr_env, T0, T1) != 0)) { - printf("DCR write error\n"); + if (loglevel) { + fprintf(logfile, "DCR write error %d %03x\n", (int)T0, (int)T0); + } do_raise_exception_err(EXCP_PROGRAM, EXCP_INVAL | EXCP_PRIV_REG); } } |