qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 4/6] target-alpha: Implement WAIT IPR.
Date: Thu, 22 Sep 2011 08:30:47 -0700	[thread overview]
Message-ID: <1316705449-17187-5-git-send-email-rth@twiddle.net> (raw)
In-Reply-To: <1316705449-17187-1-git-send-email-rth@twiddle.net>

Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 target-alpha/translate.c |   31 +++++++++++++++++++++----------
 1 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/target-alpha/translate.c b/target-alpha/translate.c
index fb2e9e5..c1ef465 100644
--- a/target-alpha/translate.c
+++ b/target-alpha/translate.c
@@ -1617,9 +1617,10 @@ static void gen_mfpr(int ra, int regno)
     }
 }
 
-static void gen_mtpr(int rb, int regno)
+static ExitStatus gen_mtpr(DisasContext *ctx, int rb, int regno)
 {
     TCGv tmp;
+    int data;
 
     if (rb == 31) {
         tmp = tcg_const_i64(0);
@@ -1627,19 +1628,27 @@ static void gen_mtpr(int rb, int regno)
         tmp = cpu_ir[rb];
     }
 
-    /* These two register numbers perform a TLB cache flush.  Thankfully we
-       can only do this inside PALmode, which means that the current basic
-       block cannot be affected by the change in mappings.  */
-    if (regno == 255) {
+    switch (regno) {
+    case 255:
         /* TBIA */
         gen_helper_tbia();
-    } else if (regno == 254) {
+        break;
+
+    case 254:
         /* TBIS */
         gen_helper_tbis(tmp);
-    } else {
+        break;
+
+    case 253:
+        /* WAIT */
+        tmp = tcg_const_i64(1);
+        tcg_gen_st32_i64(tmp, cpu_env, offsetof(CPUState, halted));
+        return gen_excp(ctx, EXCP_HLT, 0);
+
+    default:
         /* The basic registers are data only, and unknown registers
            are read-zero, write-ignore.  */
-        int data = cpu_pr_data(regno);
+        data = cpu_pr_data(regno);
         if (data != 0) {
             if (data & PR_BYTE) {
                 tcg_gen_st8_i64(tmp, cpu_env, data & ~PR_BYTE);
@@ -1649,11 +1658,14 @@ static void gen_mtpr(int rb, int regno)
                 tcg_gen_st_i64(tmp, cpu_env, data);
             }
         }
+        break;
     }
 
     if (rb == 31) {
         tcg_temp_free(tmp);
     }
+
+    return NO_EXIT;
 }
 #endif /* !USER_ONLY*/
 
@@ -3061,8 +3073,7 @@ static ExitStatus translate_one(DisasContext *ctx, uint32_t insn)
         /* HW_MTPR (PALcode) */
 #ifndef CONFIG_USER_ONLY
         if (ctx->tb->flags & TB_FLAGS_PAL_MODE) {
-            gen_mtpr(rb, insn & 0xffff);
-            break;
+            return gen_mtpr(ctx, rb, insn & 0xffff);
         }
 #endif
         goto invalid_opc;
-- 
1.7.6.2

  parent reply	other threads:[~2011-09-22 15:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-22 15:30 [Qemu-devel] [PATCH 0/6] Alpha system emulation, v11 Richard Henderson
2011-09-22 15:30 ` [Qemu-devel] [PATCH 1/6] target-alpha: Honor icount for RPCC instruction Richard Henderson
2011-09-22 15:30 ` [Qemu-devel] [PATCH 2/6] target-alpha: Add custom PALcode image for CLIPPER emulation Richard Henderson
2011-09-22 15:30 ` [Qemu-devel] [PATCH 3/6] target-alpha: Add " Richard Henderson
2011-09-22 15:30 ` Richard Henderson [this message]
2011-09-22 15:30 ` [Qemu-devel] [PATCH 5/6] target-alpha: Implement HALT IPR Richard Henderson
2011-09-22 15:30 ` [Qemu-devel] [PATCH 6/6] target-alpha: Add high-resolution access to wall clock and an alarm Richard Henderson
2011-09-22 16:04 ` [Qemu-devel] [PATCH 0/6] Alpha system emulation, v11 Edgar E. Iglesias
2011-09-27 15:32   ` Richard Henderson
2011-10-01 15:22     ` Richard Henderson
2011-10-08 15:37       ` Blue Swirl
2011-10-08 15:51         ` Richard Henderson
2011-10-08 16:36           ` Blue Swirl
2011-10-03  9:51   ` Paolo Bonzini
  -- strict thread matches above, loose matches on Subject: below --
2011-08-25 21:45 [Qemu-devel] [PULL][PATCH 0/6] Alpha system emulation, v9 Richard Henderson
2011-08-25 21:45 ` [Qemu-devel] [PATCH 4/6] target-alpha: Implement WAIT IPR Richard Henderson

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=1316705449-17187-5-git-send-email-rth@twiddle.net \
    --to=rth@twiddle.net \
    --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).