Commit 3e382bc84ce93df505b48fc4e305fcc5f4ac4567

Authored by bellard
1 parent beac80cd

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
@@ -332,7 +332,8 @@ void do_interrupt (CPUState *env) @@ -332,7 +332,8 @@ void do_interrupt (CPUState *env)
332 } else { 332 } else {
333 env->CP0_ErrorEPC = env->PC; 333 env->CP0_ErrorEPC = env->PC;
334 } 334 }
335 - env->hflags = MIPS_HFLAG_ERL; 335 + env->hflags |= MIPS_HFLAG_ERL;
  336 + env->CP0_Status |= (1 << CP0St_ERL);
336 pc = 0xBFC00000; 337 pc = 0xBFC00000;
337 break; 338 break;
338 case EXCP_MCHECK: 339 case EXCP_MCHECK:
@@ -396,6 +397,7 @@ void do_interrupt (CPUState *env) @@ -396,6 +397,7 @@ void do_interrupt (CPUState *env)
396 pc = 0x80000000; 397 pc = 0x80000000;
397 } 398 }
398 env->hflags |= MIPS_HFLAG_EXL; 399 env->hflags |= MIPS_HFLAG_EXL;
  400 + env->CP0_Status |= (1 << CP0St_EXL);
399 pc += offset; 401 pc += offset;
400 env->CP0_Cause = (env->CP0_Cause & ~0x7C) | (cause << 2); 402 env->CP0_Cause = (env->CP0_Cause & ~0x7C) | (cause << 2);
401 if (env->hflags & MIPS_HFLAG_BMASK) { 403 if (env->hflags & MIPS_HFLAG_BMASK) {
target-mips/op.c
@@ -1104,9 +1104,11 @@ void op_eret (void) @@ -1104,9 +1104,11 @@ void op_eret (void)
1104 if (env->hflags & MIPS_HFLAG_ERL) { 1104 if (env->hflags & MIPS_HFLAG_ERL) {
1105 env->PC = env->CP0_ErrorEPC; 1105 env->PC = env->CP0_ErrorEPC;
1106 env->hflags &= ~MIPS_HFLAG_ERL; 1106 env->hflags &= ~MIPS_HFLAG_ERL;
  1107 + env->CP0_Status &= ~(1 << CP0St_ERL);
1107 } else { 1108 } else {
1108 env->PC = env->CP0_EPC; 1109 env->PC = env->CP0_EPC;
1109 env->hflags &= ~MIPS_HFLAG_EXL; 1110 env->hflags &= ~MIPS_HFLAG_EXL;
  1111 + env->CP0_Status &= ~(1 << CP0St_EXL);
1110 } 1112 }
1111 env->CP0_LLAddr = 1; 1113 env->CP0_LLAddr = 1;
1112 } 1114 }
target-mips/op_helper.c
@@ -219,10 +219,6 @@ void do_mfc0 (int reg, int sel) @@ -219,10 +219,6 @@ void do_mfc0 (int reg, int sel)
219 T0 = env->CP0_Status; 219 T0 = env->CP0_Status;
220 if (env->hflags & MIPS_HFLAG_UM) 220 if (env->hflags & MIPS_HFLAG_UM)
221 T0 |= (1 << CP0St_UM); 221 T0 |= (1 << CP0St_UM);
222 - if (env->hflags & MIPS_HFLAG_ERL)  
223 - T0 |= (1 << CP0St_ERL);  
224 - if (env->hflags & MIPS_HFLAG_EXL)  
225 - T0 |= (1 << CP0St_EXL);  
226 rn = "Status"; 222 rn = "Status";
227 break; 223 break;
228 case 13: 224 case 13: