qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org
Subject: [Qemu-devel] [PULL 16/24] target/hppa: Convert halt/reset insns
Date: Mon, 11 Feb 2019 20:57:13 -0800	[thread overview]
Message-ID: <20190212045721.28041-17-richard.henderson@linaro.org> (raw)
In-Reply-To: <20190212045721.28041-1-richard.henderson@linaro.org>

Tested-by: Helge Deller <deller@gmx.de>
Tested-by: Sven Schnelle <svens@stackframe.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/hppa/translate.c  | 49 ++++++++++++----------------------------
 target/hppa/insns.decode |  5 ++++
 2 files changed, 20 insertions(+), 34 deletions(-)

diff --git a/target/hppa/translate.c b/target/hppa/translate.c
index 4ecd522e51..c73a7ab3db 100644
--- a/target/hppa/translate.c
+++ b/target/hppa/translate.c
@@ -2376,20 +2376,27 @@ static bool trans_rfi_r(DisasContext *ctx, arg_rfi_r *a)
     return do_rfi(ctx, true);
 }
 
-#ifndef CONFIG_USER_ONLY
-static bool gen_hlt(DisasContext *ctx, int reset)
+static bool trans_halt(DisasContext *ctx, arg_halt *a)
 {
     CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR);
+#ifndef CONFIG_USER_ONLY
     nullify_over(ctx);
-    if (reset) {
-        gen_helper_reset(cpu_env);
-    } else {
-        gen_helper_halt(cpu_env);
-    }
+    gen_helper_halt(cpu_env);
     ctx->base.is_jmp = DISAS_NORETURN;
     return nullify_end(ctx);
+#endif
+}
+
+static bool trans_reset(DisasContext *ctx, arg_reset *a)
+{
+    CHECK_MOST_PRIVILEGED(EXCP_PRIV_OPR);
+#ifndef CONFIG_USER_ONLY
+    nullify_over(ctx);
+    gen_helper_reset(cpu_env);
+    ctx->base.is_jmp = DISAS_NORETURN;
+    return nullify_end(ctx);
+#endif
 }
-#endif /* !CONFIG_USER_ONLY */
 
 static bool trans_nop_addrx(DisasContext *ctx, arg_ldst *a)
 {
@@ -4134,32 +4141,6 @@ static void translate_one(DisasContext *ctx, uint32_t insn)
     case 0x2E:
         translate_table(ctx, insn, table_fp_fused);
         return;
-
-    case 0x04: /* spopn */
-    case 0x05: /* diag */
-    case 0x0F: /* product specific */
-        break;
-
-    case 0x07: /* unassigned */
-    case 0x15: /* unassigned */
-    case 0x1D: /* unassigned */
-    case 0x37: /* unassigned */
-        break;
-    case 0x3F:
-#ifndef CONFIG_USER_ONLY
-        /* Unassigned, but use as system-halt.  */
-        if (insn == 0xfffdead0) {
-            gen_hlt(ctx, 0); /* halt system */
-            return;
-        }
-        if (insn == 0xfffdead1) {
-            gen_hlt(ctx, 1); /* reset system */
-            return;
-        }
-#endif
-        break;
-    default:
-        break;
     }
     gen_illegal(ctx);
 }
diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode
index 25ac09d9d6..f564e54f1d 100644
--- a/target/hppa/insns.decode
+++ b/target/hppa/insns.decode
@@ -103,6 +103,11 @@ ssm             000000 ..........  000 01101011 t:5     i=%sm_imm
 rfi             000000 ----- ----- --- 01100000 00000
 rfi_r           000000 ----- ----- --- 01100101 00000
 
+# These are artificial instructions used by QEMU firmware.
+# They are allocated from the unassigned instruction space.
+halt            1111 1111 1111 1101 1110 1010 1101 0000
+reset           1111 1111 1111 1101 1110 1010 1101 0001
+
 ####
 # Memory Management
 ####
-- 
2.17.2

  parent reply	other threads:[~2019-02-12  4:58 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-12  4:56 [Qemu-devel] [PULL 00/24] target/hppa patch queue Richard Henderson
2019-02-12  4:56 ` [Qemu-devel] [PULL 01/24] target/hppa: Use DisasContextBase.is_jmp Richard Henderson
2019-02-12  4:56 ` [Qemu-devel] [PULL 02/24] target/hppa: Begin using scripts/decodetree.py Richard Henderson
2019-02-12  4:57 ` [Qemu-devel] [PULL 03/24] target/hppa: Convert move to/from system registers Richard Henderson
2019-02-12  4:57 ` [Qemu-devel] [PULL 04/24] target/hppa: Convert remainder of system insns Richard Henderson
2019-02-12  4:57 ` [Qemu-devel] [PULL 05/24] target/hppa: Unify specializations of OR Richard Henderson
2019-02-12  4:57 ` [Qemu-devel] [PULL 06/24] target/hppa: Convert memory management insns Richard Henderson
2019-02-12  4:57 ` [Qemu-devel] [PULL 07/24] target/hppa: Convert arithmetic/logical insns Richard Henderson
2019-02-12  4:57 ` [Qemu-devel] [PULL 08/24] target/hppa: Convert indexed memory insns Richard Henderson
2019-02-12  4:57 ` [Qemu-devel] [PULL 09/24] target/hppa: Convert fp multiply-add Richard Henderson
2019-02-12  4:57 ` [Qemu-devel] [PULL 10/24] target/hppa: Convert conditional branches Richard Henderson
2019-02-12  4:57 ` [Qemu-devel] [PULL 11/24] target/hppa: Convert shift, extract, deposit insns Richard Henderson
2019-02-12  4:57 ` [Qemu-devel] [PULL 12/24] target/hppa: Convert direct and indirect branches Richard Henderson
2019-02-12  4:57 ` [Qemu-devel] [PULL 13/24] target/hppa: Convert arithmetic immediate insns Richard Henderson
2019-02-12  4:57 ` [Qemu-devel] [PULL 14/24] target/hppa: Convert offset memory insns Richard Henderson
2019-02-12  4:57 ` [Qemu-devel] [PULL 15/24] target/hppa: Convert fp indexed " Richard Henderson
2019-02-12  4:57 ` Richard Henderson [this message]
2019-02-12  4:57 ` [Qemu-devel] [PULL 17/24] target/hppa: Convert fp fused multiply-add insns Richard Henderson
2019-02-12  4:57 ` [Qemu-devel] [PULL 18/24] target/hppa: Convert fp operate insns Richard Henderson
2019-02-12  4:57 ` [Qemu-devel] [PULL 19/24] target/hppa: Merge translate_one into hppa_tr_translate_insn Richard Henderson
2019-02-12  4:57 ` [Qemu-devel] [PULL 20/24] target/hppa: move GETPC to HELPER() functions Richard Henderson
2019-02-12  4:57 ` [Qemu-devel] [PULL 21/24] target/hppa: Rearrange log conditions Richard Henderson
2019-02-12  4:57 ` [Qemu-devel] [PULL 22/24] target/hppa: Fix addition '</<=' conditions Richard Henderson
2019-02-12  4:57 ` [Qemu-devel] [PULL 23/24] target/hppa: fix dcor instruction Richard Henderson
2019-02-12  4:57 ` [Qemu-devel] [PULL 24/24] hw/hppa: forward requests to CPU HPA Richard Henderson
2019-02-12 13:15 ` [Qemu-devel] [PULL 00/24] target/hppa patch queue Peter Maydell
2019-02-13 18:40   ` Philippe Mathieu-Daudé
2019-02-14 10:04     ` Peter Maydell
2019-02-14 11:32       ` Philippe Mathieu-Daudé
2019-02-13 16:33 ` no-reply

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=20190212045721.28041-17-richard.henderson@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=peter.maydell@linaro.org \
    --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).