From 3e382bc84ce93df505b48fc4e305fcc5f4ac4567 Mon Sep 17 00:00:00 2001 From: bellard Date: Mon, 26 Jun 2006 20:29:47 +0000 Subject: [PATCH] consistent update of ERL and EXL (Dirk Behme) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2028 c046a42c-6fe2-441c-8c8c-71466251a162 --- target-mips/helper.c | 4 +++- target-mips/op.c | 2 ++ target-mips/op_helper.c | 4 ---- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/target-mips/helper.c b/target-mips/helper.c index 8325d48438..9c8e4f68df 100644 --- a/target-mips/helper.c +++ b/target-mips/helper.c @@ -332,7 +332,8 @@ void do_interrupt (CPUState *env) } else { env->CP0_ErrorEPC = env->PC; } - env->hflags = MIPS_HFLAG_ERL; + env->hflags |= MIPS_HFLAG_ERL; + env->CP0_Status |= (1 << CP0St_ERL); pc = 0xBFC00000; break; case EXCP_MCHECK: @@ -396,6 +397,7 @@ void do_interrupt (CPUState *env) pc = 0x80000000; } env->hflags |= MIPS_HFLAG_EXL; + env->CP0_Status |= (1 << CP0St_EXL); pc += offset; env->CP0_Cause = (env->CP0_Cause & ~0x7C) | (cause << 2); if (env->hflags & MIPS_HFLAG_BMASK) { diff --git a/target-mips/op.c b/target-mips/op.c index bc7f81949f..457551725d 100644 --- a/target-mips/op.c +++ b/target-mips/op.c @@ -1104,9 +1104,11 @@ void op_eret (void) if (env->hflags & MIPS_HFLAG_ERL) { env->PC = env->CP0_ErrorEPC; env->hflags &= ~MIPS_HFLAG_ERL; + env->CP0_Status &= ~(1 << CP0St_ERL); } else { env->PC = env->CP0_EPC; env->hflags &= ~MIPS_HFLAG_EXL; + env->CP0_Status &= ~(1 << CP0St_EXL); } env->CP0_LLAddr = 1; } diff --git a/target-mips/op_helper.c b/target-mips/op_helper.c index 37f260430c..bf397c9b44 100644 --- a/target-mips/op_helper.c +++ b/target-mips/op_helper.c @@ -219,10 +219,6 @@ void do_mfc0 (int reg, int sel) T0 = env->CP0_Status; if (env->hflags & MIPS_HFLAG_UM) T0 |= (1 << CP0St_UM); - if (env->hflags & MIPS_HFLAG_ERL) - T0 |= (1 << CP0St_ERL); - if (env->hflags & MIPS_HFLAG_EXL) - T0 |= (1 << CP0St_EXL); rn = "Status"; break; case 13: -- 2.11.4.GIT