aboutsummaryrefslogtreecommitdiff
path: root/target-mips/helper.c
diff options
context:
space:
mode:
authorAurelien Jarno <aurelien@aurel32.net>2010-07-15 23:13:11 +0200
committerAurelien Jarno <aurelien@aurel32.net>2010-07-17 16:13:12 +0200
commit3fc00a7bdeffd26932c4f27a6bc4f902f86fbbe9 (patch)
tree6f76540af5b29d7bfc8ea1de5ffa92fe61587d19 /target-mips/helper.c
parent08218b3527301760393b0b4ec732fcdfb7ff6cda (diff)
target-mips: fix xtlb exception for loongson
Loongson 2E and 2F use the same entry for xtlb and tlb exception, at offset 0x000. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'target-mips/helper.c')
-rw-r--r--target-mips/helper.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/target-mips/helper.c b/target-mips/helper.c
index ea221ab53f..de2ed7d2c7 100644
--- a/target-mips/helper.c
+++ b/target-mips/helper.c
@@ -491,7 +491,8 @@ void do_interrupt (CPUState *env)
int SX = (env->CP0_Status & (1 << CP0St_SX)) != 0;
int KX = (env->CP0_Status & (1 << CP0St_KX)) != 0;
- if ((R == 0 && UX) || (R == 1 && SX) || (R == 3 && KX))
+ if (((R == 0 && UX) || (R == 1 && SX) || (R == 3 && KX)) &&
+ (!(env->insn_flags & (INSN_LOONGSON2E | INSN_LOONGSON2F))))
offset = 0x080;
else
#endif
@@ -507,7 +508,8 @@ void do_interrupt (CPUState *env)
int SX = (env->CP0_Status & (1 << CP0St_SX)) != 0;
int KX = (env->CP0_Status & (1 << CP0St_KX)) != 0;
- if ((R == 0 && UX) || (R == 1 && SX) || (R == 3 && KX))
+ if (((R == 0 && UX) || (R == 1 && SX) || (R == 3 && KX)) &&
+ (!(env->insn_flags & (INSN_LOONGSON2E | INSN_LOONGSON2F))))
offset = 0x080;
else
#endif