qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Artyom Tarasenko <atar4qemu@gmail.com>
To: qemu-devel@nongnu.org
Cc: mark.cave-ayland@ilande.co.uk, rth@twiddle.net,
	Artyom Tarasenko <atar4qemu@gmail.com>
Subject: [Qemu-devel] [PATCH 2/2 for-2.6] target-sparc: fix Trap Based Address Register behavior for sparc64
Date: Thu, 14 Apr 2016 11:29:16 +0200	[thread overview]
Message-ID: <1d5b26fed5e9648e4672545085509ea5ad8a9a60.1460625412.git.atar4qemu@gmail.com> (raw)
In-Reply-To: <b8d0b7c81437065b81416c00781e42ea09e2053c.1460625412.git.atar4qemu@gmail.com>
In-Reply-To: <b8d0b7c81437065b81416c00781e42ea09e2053c.1460625412.git.atar4qemu@gmail.com>

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>
---
 target-sparc/int64_helper.c | 5 ++---
 1 file 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;
 }
-- 
1.8.3.1

  reply	other threads:[~2016-04-14  9:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-14  9:29 [Qemu-devel] [PATCH 1/2 for-2.6] target-sparc: fix Nucleus quad LDD 128 bit access for windowed registers Artyom Tarasenko
2016-04-14  9:29 ` Artyom Tarasenko [this message]
2016-04-14 13:43   ` [Qemu-devel] [PATCH 2/2 for-2.6] target-sparc: fix Trap Based Address Register behavior for sparc64 Mark Cave-Ayland
2016-04-14 14:01     ` Artyom Tarasenko
2016-04-14 13:42 ` [Qemu-devel] [PATCH 1/2 for-2.6] target-sparc: fix Nucleus quad LDD 128 bit access for windowed registers Mark Cave-Ayland
2016-04-14 14:04   ` Artyom Tarasenko
2016-04-14 14:20     ` Mark Cave-Ayland
2016-04-14 14:49       ` Artyom Tarasenko
2016-04-14 15:59         ` Mark Cave-Ayland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1d5b26fed5e9648e4672545085509ea5ad8a9a60.1460625412.git.atar4qemu@gmail.com \
    --to=atar4qemu@gmail.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).