diff options
author | Artyom Tarasenko <atar4qemu@gmail.com> | 2016-04-14 21:14:32 +0200 |
---|---|---|
committer | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2016-04-15 09:30:40 +0100 |
commit | de5f1077446ca455342db149737bdc395a7b9882 (patch) | |
tree | f1e2252843cadd5a8a854ce702d9a8b3ab64e19c /target-sparc | |
parent | 01a780d51a3a0851729e1747f3787a0db4d96722 (diff) | |
download | qemu-de5f1077446ca455342db149737bdc395a7b9882.zip qemu-de5f1077446ca455342db149737bdc395a7b9882.tar.gz qemu-de5f1077446ca455342db149737bdc395a7b9882.tar.bz2 |
target-sparc: fix Trap Based Address Register behavior for sparc64
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 <atar4qemu@gmail.com>
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Diffstat (limited to 'target-sparc')
-rw-r--r-- | target-sparc/int64_helper.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/target-sparc/int64_helper.c b/target-sparc/int64_helper.c index aa876cd..29360fa 100644 --- a/target-sparc/int64_helper.c +++ b/target-sparc/int64_helper.c @@ -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; } |