]> Git Repo - qemu.git/commitdiff
target-sparc: fix Trap Based Address Register behavior for sparc64
authorArtyom Tarasenko <[email protected]>
Thu, 14 Apr 2016 19:14:32 +0000 (21:14 +0200)
committerMark Cave-Ayland <[email protected]>
Fri, 15 Apr 2016 08:30:40 +0000 (09:30 +0100)
Accoding the chapter 7.6 Trap Processing of the SPARC Architecture Manual v9,
the Trap Based Address Register is not modified as a trap is taken.

This fix allows booting FreeBSD-10.3-RELEASE-sparc64.

Signed-off-by: Artyom Tarasenko <[email protected]>
Reviewed-by: Mark Cave-Ayland <[email protected]>
Signed-off-by: Mark Cave-Ayland <[email protected]>
target-sparc/int64_helper.c

index aa876cd8ba7b4cf862a17af11cdbd16f025655e5..29360fa5fe78ff786a888a514803f63b99d41c27 100644 (file)
@@ -158,9 +158,8 @@ void sparc_cpu_do_interrupt(CPUState *cs)
     } else if ((intno & 0x1c0) == TT_FILL) {
         cpu_set_cwp(env, cpu_cwp_inc(env, env->cwp + 1));
     }
-    env->tbr &= ~0x7fffULL;
-    env->tbr |= ((env->tl > 1) ? 1 << 14 : 0) | (intno << 5);
-    env->pc = env->tbr;
+    env->pc = env->tbr  & ~0x7fffULL;
+    env->pc |= ((env->tl > 1) ? 1 << 14 : 0) | (intno << 5);
     env->npc = env->pc + 4;
     cs->exception_index = -1;
 }
This page took 0.026891 seconds and 4 git commands to generate.