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, Richard Henderson <rth@twiddle.net>
Subject: [Qemu-devel] [PULL 2/3] target/hppa: Convert to DisasContextBase
Date: Thu,  7 Sep 2017 11:44:46 -0700	[thread overview]
Message-ID: <20170907184447.22752-3-richard.henderson@linaro.org> (raw)
In-Reply-To: <20170907184447.22752-1-richard.henderson@linaro.org>

From: Richard Henderson <rth@twiddle.net>

Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 target/hppa/translate.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/target/hppa/translate.c b/target/hppa/translate.c
index cb4a3e6cb4..993438a60b 100644
--- a/target/hppa/translate.c
+++ b/target/hppa/translate.c
@@ -38,7 +38,7 @@ typedef struct DisasCond {
 } DisasCond;
 
 typedef struct DisasContext {
-    struct TranslationBlock *tb;
+    DisasContextBase base;
     CPUState *cs;
 
     target_ulong iaoq_f;
@@ -52,7 +52,6 @@ typedef struct DisasContext {
     DisasCond null_cond;
     TCGLabel *null_lab;
 
-    bool singlestep_enabled;
     bool psw_n_nonzero;
 } DisasContext;
 
@@ -476,7 +475,7 @@ static DisasJumpType gen_illegal(DisasContext *ctx)
 static bool use_goto_tb(DisasContext *ctx, target_ulong dest)
 {
     /* Suppress goto_tb in the case of single-steping and IO.  */
-    if ((ctx->tb->cflags & CF_LAST_IO) || ctx->singlestep_enabled) {
+    if ((ctx->base.tb->cflags & CF_LAST_IO) || ctx->base.singlestep_enabled) {
         return false;
     }
     return true;
@@ -499,11 +498,11 @@ static void gen_goto_tb(DisasContext *ctx, int which,
         tcg_gen_goto_tb(which);
         tcg_gen_movi_tl(cpu_iaoq_f, f);
         tcg_gen_movi_tl(cpu_iaoq_b, b);
-        tcg_gen_exit_tb((uintptr_t)ctx->tb + which);
+        tcg_gen_exit_tb((uintptr_t)ctx->base.tb + which);
     } else {
         copy_iaoq_entry(cpu_iaoq_f, f, cpu_iaoq_b);
         copy_iaoq_entry(cpu_iaoq_b, b, ctx->iaoq_n_var);
-        if (ctx->singlestep_enabled) {
+        if (ctx->base.singlestep_enabled) {
             gen_excp_1(EXCP_DEBUG);
         } else {
             tcg_gen_lookup_and_goto_ptr(cpu_iaoq_f);
@@ -3737,11 +3736,11 @@ void gen_intermediate_code(CPUState *cs, struct TranslationBlock *tb)
     DisasJumpType ret;
     int num_insns, max_insns, i;
 
-    ctx.tb = tb;
+    ctx.base.tb = tb;
+    ctx.base.singlestep_enabled = cs->singlestep_enabled;
     ctx.cs = cs;
     ctx.iaoq_f = tb->pc;
     ctx.iaoq_b = tb->cs_base;
-    ctx.singlestep_enabled = cs->singlestep_enabled;
 
     ctx.ntemps = 0;
     for (i = 0; i < ARRAY_SIZE(ctx.temps); ++i) {
@@ -3755,7 +3754,7 @@ void gen_intermediate_code(CPUState *cs, struct TranslationBlock *tb)
     if (max_insns == 0) {
         max_insns = CF_COUNT_MASK;
     }
-    if (ctx.singlestep_enabled || singlestep) {
+    if (ctx.base.singlestep_enabled || singlestep) {
         max_insns = 1;
     } else if (max_insns > TCG_MAX_INSNS) {
         max_insns = TCG_MAX_INSNS;
@@ -3868,7 +3867,7 @@ void gen_intermediate_code(CPUState *cs, struct TranslationBlock *tb)
         nullify_save(&ctx);
         /* FALLTHRU */
     case DISAS_IAQ_N_UPDATED:
-        if (ctx.singlestep_enabled) {
+        if (ctx.base.singlestep_enabled) {
             gen_excp_1(EXCP_DEBUG);
         } else {
             tcg_gen_lookup_and_goto_ptr(cpu_iaoq_f);
-- 
2.13.5

  parent reply	other threads:[~2017-09-07 18:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-07 18:44 [Qemu-devel] [PULL 0/3] target/hppa update Richard Henderson
2017-09-07 18:44 ` [Qemu-devel] [PULL 1/3] target/hppa: Convert to DisasJumpType Richard Henderson
2017-09-07 18:44 ` Richard Henderson [this message]
2017-09-07 18:44 ` [Qemu-devel] [PULL 3/3] target/hppa: Convert to TranslatorOps Richard Henderson
2017-09-08 10:38 ` [Qemu-devel] [PULL 0/3] target/hppa update Peter Maydell

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