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 v2 2/2] [SPARC] Fix TA0_Shutdown feature
Date: Fri, 27 May 2011 18:25:13 +0200	[thread overview]
Message-ID: <BANLkTikAVh_PB8ppVFrh=Xf+kSricOkRZA@mail.gmail.com> (raw)

Hello,

Since the last patch, I have added a special helper for trap 0. It
will be use when the TA0_Shutdown feature is enabled.

Signed-off-by: Grall Julien <julien.grall@gmail.com>
---
 target-sparc/helper.h    |    1 +
 target-sparc/op_helper.c |   14 ++++++++++++++
 target-sparc/translate.c |    6 ++----
 3 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/target-sparc/helper.h b/target-sparc/helper.h
index 61ef03a..7f50c7a 100644
--- a/target-sparc/helper.h
+++ b/target-sparc/helper.h
@@ -86,6 +86,7 @@ DEF_HELPER_0(fcmpeq_fcc3, void)
 #endif
 DEF_HELPER_1(raise_exception, void, int)
 DEF_HELPER_1(trap_always, void, int)
+DEF_HELPER_1(trap_0, void, int)
 DEF_HELPER_0(shutdown, void)
 #define F_HELPER_0_0(name) DEF_HELPER_0(f ## name, void)
 #define F_HELPER_DQ_0_0(name)                   \
diff --git a/target-sparc/op_helper.c b/target-sparc/op_helper.c
index 8f9d579..266080d 100644
--- a/target-sparc/op_helper.c
+++ b/target-sparc/op_helper.c
@@ -330,6 +330,19 @@ void HELPER(trap_always)(int tt)
     do_interrupt(env);
 }

+void HELPER(trap_0)(int tt)
+{
+#ifndef TARGET_SPARC64
+    if (env->psret == 0) {
+        helper_shutdown();
+    } else {
+        helper_trap_always(tt);
+    }
+#else
+    helper_trap_always(tt);
+#endif
+}
+
 void helper_shutdown(void)
 {
 #if !defined(CONFIG_USER_ONLY)
diff --git a/target-sparc/translate.c b/target-sparc/translate.c
index 64035fc..13181ef 100644
--- a/target-sparc/translate.c
+++ b/target-sparc/translate.c
@@ -2037,10 +2037,8 @@ static void disas_sparc_insn(DisasContext * dc)
                     tcg_gen_trunc_tl_i32(cpu_tmp32, cpu_dst);

                     if (rs2 == 0 &&
-                        dc->def->features & CPU_FEATURE_TA0_SHUTDOWN) {
-
-                        gen_helper_shutdown();
-
+                        (dc->def->features & CPU_FEATURE_TA0_SHUTDOWN)) {
+                        gen_helper_trap_0(cpu_tmp32);
                     } else {
                         gen_helper_trap_always(cpu_tmp32);
                     }
-- 
1.7.4.4

             reply	other threads:[~2011-05-27 16:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-27 16:25 Julien Grall [this message]
2011-05-27 17:21 ` [Qemu-devel] [PATCH v2 2/2] [SPARC] Fix TA0_Shutdown feature 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='BANLkTikAVh_PB8ppVFrh=Xf+kSricOkRZA@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).