diff options
author | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-04-06 18:46:01 +0000 |
---|---|---|
committer | ths <ths@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-04-06 18:46:01 +0000 |
commit | f41c52f17031325652387086006c5847bc703abd (patch) | |
tree | 7a48f39dd029a1aca329088e9e949c42f16c5221 /target-mips/op_helper.c | |
parent | 42a10898a8247821d161e3ac799b758f79fbe3b3 (diff) |
Save state for all CP0 instructions, they may throw a CPU exception.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2622 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-mips/op_helper.c')
-rw-r--r-- | target-mips/op_helper.c | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/target-mips/op_helper.c b/target-mips/op_helper.c index ba02f0d84f..92712a8994 100644 --- a/target-mips/op_helper.c +++ b/target-mips/op_helper.c @@ -329,10 +329,12 @@ void do_mfc0_count (void) void do_mtc0_status_debug(uint32_t old, uint32_t val) { - const uint32_t mask = 0x0000FF00; - fprintf(logfile, "Status %08x => %08x Cause %08x (%08x %08x %08x)\n", - old, val, env->CP0_Cause, old & mask, val & mask, - env->CP0_Cause & mask); + fprintf(logfile, "Status %08x (%08x) => %08x (%08x) Cause %08x", + old, old & env->CP0_Cause & CP0Ca_IP_mask, + val, val & env->CP0_Cause & CP0Ca_IP_mask, + env->CP0_Cause); + (env->hflags & MIPS_HFLAG_UM) ? fputs(", UM\n", logfile) + : fputs("\n", logfile); } void do_mtc0_status_irqraise_debug(void) @@ -508,15 +510,29 @@ void dump_sc (void) } } -void debug_eret (void) +void debug_pre_eret (void) { - if (loglevel) { - fprintf(logfile, "ERET: pc " TARGET_FMT_lx " EPC " TARGET_FMT_lx, - env->PC, env->CP0_EPC); - if (env->CP0_Status & (1 << CP0St_ERL)) - fprintf(logfile, " ErrorEPC " TARGET_FMT_lx, env->CP0_ErrorEPC); + fprintf(logfile, "ERET: PC " TARGET_FMT_lx " EPC " TARGET_FMT_lx, + env->PC, env->CP0_EPC); + if (env->CP0_Status & (1 << CP0St_ERL)) + fprintf(logfile, " ErrorEPC " TARGET_FMT_lx, env->CP0_ErrorEPC); + if (env->hflags & MIPS_HFLAG_DM) + fprintf(logfile, " DEPC " TARGET_FMT_lx, env->CP0_DEPC); + fputs("\n", logfile); +} + +void debug_post_eret (void) +{ + fprintf(logfile, " => PC " TARGET_FMT_lx " EPC " TARGET_FMT_lx, + env->PC, env->CP0_EPC); + if (env->CP0_Status & (1 << CP0St_ERL)) + fprintf(logfile, " ErrorEPC " TARGET_FMT_lx, env->CP0_ErrorEPC); + if (env->hflags & MIPS_HFLAG_DM) + fprintf(logfile, " DEPC " TARGET_FMT_lx, env->CP0_DEPC); + if (env->hflags & MIPS_HFLAG_UM) + fputs(", UM\n", logfile); + else fputs("\n", logfile); - } } void do_pmon (int function) |