From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35468) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Utka2-00036p-GZ for qemu-devel@nongnu.org; Mon, 01 Jul 2013 16:20:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UtkZy-00012m-Kf for qemu-devel@nongnu.org; Mon, 01 Jul 2013 16:20:10 -0400 Received: from mail-qc0-x234.google.com ([2607:f8b0:400d:c01::234]:64835) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UtkZy-00011r-Fh for qemu-devel@nongnu.org; Mon, 01 Jul 2013 16:20:06 -0400 Received: by mail-qc0-f180.google.com with SMTP id a1so3178737qcx.39 for ; Mon, 01 Jul 2013 13:20:06 -0700 (PDT) Sender: Richard Henderson From: Richard Henderson Date: Mon, 1 Jul 2013 13:19:29 -0700 Message-Id: <1372709970-29244-2-git-send-email-rth@twiddle.net> In-Reply-To: <1372709970-29244-1-git-send-email-rth@twiddle.net> References: <1372709970-29244-1-git-send-email-rth@twiddle.net> Subject: [Qemu-devel] [PATCH 1/2] target-alpha: Copy singlestep_enabled to DisasContext List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: afaerber@suse.de Prepare for removing env from DisasContext. Signed-off-by: Richard Henderson --- target-alpha/translate.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/target-alpha/translate.c b/target-alpha/translate.c index 4db16db..b59f919 100644 --- a/target-alpha/translate.c +++ b/target-alpha/translate.c @@ -46,6 +46,8 @@ struct DisasContext { int tb_rm; /* Current flush-to-zero setting for this TB. */ int tb_ftz; + + bool singlestep_enabled; }; /* Return values from translate_one, indicating the state of the TB. @@ -380,7 +382,7 @@ static int use_goto_tb(DisasContext *ctx, uint64_t dest) /* Check for the dest on the same page as the start of the TB. We also want to suppress goto_tb in the case of single-steping and IO. */ return (((ctx->tb->pc ^ dest) & TARGET_PAGE_MASK) == 0 - && !ctx->env->singlestep_enabled + && !ctx->singlestep_enabled && !(ctx->tb->cflags & CF_LAST_IO)); } @@ -3396,6 +3398,7 @@ static inline void gen_intermediate_code_internal(CPUAlphaState *env, ctx.env = env; ctx.pc = pc_start; ctx.mem_idx = cpu_mmu_index(env); + ctx.singlestep_enabled = env->singlestep_enabled; /* ??? Every TB begins with unset rounding mode, to be initialized on the first fp insn of the TB. Alternately we could define a proper @@ -3452,7 +3455,7 @@ static inline void gen_intermediate_code_internal(CPUAlphaState *env, || tcg_ctx.gen_opc_ptr >= gen_opc_end || num_insns >= max_insns || singlestep - || env->singlestep_enabled)) { + || ctx.singlestep_enabled)) { ret = EXIT_PC_STALE; } } while (ret == NO_EXIT); @@ -3469,7 +3472,7 @@ static inline void gen_intermediate_code_internal(CPUAlphaState *env, tcg_gen_movi_i64(cpu_pc, ctx.pc); /* FALLTHRU */ case EXIT_PC_UPDATED: - if (env->singlestep_enabled) { + if (ctx.singlestep_enabled) { gen_excp_1(EXCP_DEBUG, 0); } else { tcg_gen_exit_tb(0); -- 1.8.1.4