qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@gmail.com>
To: qemu-devel@nongnu.org
Cc: Fabien Chouteau <chouteau@adacore.com>
Subject: [Qemu-devel] [PATCH 2/2][SPARC] Fix TA0_Shutdown feature
Date: Tue, 17 May 2011 17:32:33 +0200	[thread overview]
Message-ID: <BANLkTi=Bv=+6QgcHC0=jGiRFOc3D3ug2JA@mail.gmail.com> (raw)
In-Reply-To: <BANLkTikeSfsp537pf-unOyR4ftxctmfP2w@mail.gmail.com>

Fix TA0_SHUTDOWN feature

Signed-off-by: Julien Grall <julien.grall@gmail.com>
---
 target-sparc/op_helper.c |   13 +++++++++++--
 target-sparc/translate.c |    9 +--------
 2 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/target-sparc/op_helper.c b/target-sparc/op_helper.c
index a6fabad..cb775f5 100644
--- a/target-sparc/op_helper.c
+++ b/target-sparc/op_helper.c
@@ -326,8 +326,17 @@ void HELPER(raise_exception)(int tt)

 void HELPER(trap_always)(int tt)
 {
-    env->exception_index = tt;
-    do_interrupt(env);
+    if (tt == TT_TRAP
+        && env->def->features & CPU_FEATURE_TA0_SHUTDOWN
+#ifndef TARGET_SPARC64
+        && env->psret == 0
+#endif
+        ) {
+        helper_shutdown();
+    } else {
+        env->exception_index = tt;
+        do_interrupt(env);
+    }
 }

 void helper_shutdown(void)
diff --git a/target-sparc/translate.c b/target-sparc/translate.c
index b30003b..a47a2de 100644
--- a/target-sparc/translate.c
+++ b/target-sparc/translate.c
@@ -2009,14 +2009,7 @@ static void disas_sparc_insn(DisasContext * dc)
                     tcg_gen_addi_tl(cpu_dst, cpu_dst, TT_TRAP);
                     tcg_gen_trunc_tl_i32(cpu_tmp32, cpu_dst);

-                    if (rs2 == 0 &&
-                        dc->def->features & CPU_FEATURE_TA0_SHUTDOWN) {
-
-                        gen_helper_shutdown();
-
-                    } else {
-                        gen_helper_trap_always(cpu_tmp32);
-                    }
+                    gen_helper_trap_always(cpu_tmp32);
                 } else if (cond != 0) {
                     TCGv r_cond = tcg_temp_new();
                     int l1;
-- 
1.7.4.4

       reply	other threads:[~2011-05-17 15:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <BANLkTikeSfsp537pf-unOyR4ftxctmfP2w@mail.gmail.com>
2011-05-17 15:32 ` Julien Grall [this message]
2011-05-17 19:57   ` [Qemu-devel] [PATCH 2/2][SPARC] Fix TA0_Shutdown feature Blue Swirl
2011-05-18 13:17     ` Julien Grall
2011-05-20 16:03       ` Blue Swirl

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='BANLkTi=Bv=+6QgcHC0=jGiRFOc3D3ug2JA@mail.gmail.com' \
    --to=julien.grall@gmail.com \
    --cc=chouteau@adacore.com \
    --cc=qemu-devel@nongnu.org \
    /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).