summaryrefslogtreecommitdiff
path: root/target-mips/op.c
diff options
context:
space:
mode:
Diffstat (limited to 'target-mips/op.c')
-rw-r--r--target-mips/op.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/target-mips/op.c b/target-mips/op.c
index 6d94be6311..df76e8e71e 100644
--- a/target-mips/op.c
+++ b/target-mips/op.c
@@ -597,10 +597,13 @@ void debug_eret (void);
void op_eret (void)
{
CALL_FROM_TB0(debug_eret);
- if (env->hflags & MIPS_HFLAG_ERL)
+ if (env->hflags & MIPS_HFLAG_ERL) {
env->PC = env->CP0_ErrorEPC;
- else
+ env->hflags &= ~MIPS_HFLAG_ERL;
+ } else {
env->PC = env->CP0_EPC;
+ env->hflags &= ~MIPS_HFLAG_EXL;
+ }
env->CP0_LLAddr = 1;
}