From patchwork Thu Sep 7 18:44:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 111961 Delivered-To: patch@linaro.org Received: by 10.140.94.239 with SMTP id g102csp487781qge; Thu, 7 Sep 2017 11:45:25 -0700 (PDT) X-Received: by 10.237.41.199 with SMTP id o65mr477074qtd.122.1504809925302; Thu, 07 Sep 2017 11:45:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504809925; cv=none; d=google.com; s=arc-20160816; b=llJmeh3iK9UzKVVihDizwrTY8+I/nK42OYNbULZBv5Fi459/HkI31jPPd6C7vGfIG6 Gfers1utJadIbk5dR7HrelqTbzK0Lc1arPfB934l/v3YrihgUXE6NK1V+2nY/7u28gVw fmc86L9GjKlvGdrNYVji+Lrof/uhNG3Cu3/eJHCLEab1N5sRFDjyo2ufg+i9m/EU97dX J5c+gPUjOAV3CHb2tLx5AUPJzSKYze2nEAy7yo6iQKu0FS4xr6qO5lSyi+RIUlbpdYnQ 6bd3z5uJhdIb5sA32ZtAlNrK94DroGWBYP8ZVlFcAJ1oIKtvwoXD4ycx3UULWjf6Y3pp OIsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=JZA6b13ZN6Z7JezGfssdXb53V7vRGi8yWYPs687OK2M=; b=axckW2UyAcm5puVKLONVikwWyO92Qt7eqjaRSZenf61zVsCpOfBcnPh2JhpF960860 eVg2AsITGzK2Gd9wLaGYI/sEIEPQAsxt3TUe9VyKQv9SsJFqjHRo/RV/mh1Y7JvpF7FJ 4XpDfMQ0sW7ZgSU4jqpXz4rRxhpwd5mils5Mmz/Pk9PgvnDzxeQX+EwbDLHRBb825THQ q0XnBMYduOOERjB5eoB+sbhcWZukJw/6RRb4+sDowyVPS85F3TkN8b7SLnM3FcbYbPCM kBfOCMRt3XWGl/Oj3pK7ESn3gbY7cNevIivmGpehH40eTViqY+jcFjrILzQjNy6DKeeO BVGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=YNhw0Hlx; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id 12si363826qtr.283.2017.09.07.11.45.25 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 07 Sep 2017 11:45:25 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=YNhw0Hlx; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:41737 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dq1nn-0004YD-8E for patch@linaro.org; Thu, 07 Sep 2017 14:45:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51194) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dq1nN-0004Wl-LX for qemu-devel@nongnu.org; Thu, 07 Sep 2017 14:45:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dq1nJ-0005YQ-0i for qemu-devel@nongnu.org; Thu, 07 Sep 2017 14:44:57 -0400 Received: from mail-pf0-x22f.google.com ([2607:f8b0:400e:c00::22f]:34429) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dq1nI-0005YC-R4 for qemu-devel@nongnu.org; Thu, 07 Sep 2017 14:44:52 -0400 Received: by mail-pf0-x22f.google.com with SMTP id e1so822675pfk.1 for ; Thu, 07 Sep 2017 11:44:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=JZA6b13ZN6Z7JezGfssdXb53V7vRGi8yWYPs687OK2M=; b=YNhw0Hlx/zGkc5Iv0ecJwlw7C+hn5E4P6IAELdxkDj47R212UjaRzMaDlk1sn9zWI/ MVEaqesRueLOgl9/5BEfK2vIqIILVuBNN+Vx1BdlMmkUxOwXn7R89gE9dFERxYTRT3PF +MR0Sb3XNcyBldb0YoaOyHh/AG3r6q/8DN/Jw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=JZA6b13ZN6Z7JezGfssdXb53V7vRGi8yWYPs687OK2M=; b=eakvVb0qCbQ0hilXAJRa2HR15Cyk9zbp3O/kUZfdKkG1czBR7r18YdPmEeRYAChSgd Q9zt4x3PjWF9vK1Cqq98cI/PtNCvnWnahRSgROnKkh5NWeYidGKGcS49PamzIA1ZmEBu jPmPzioOJQy4EOmikYFBvoCa037UmjnJz0YX2emfhCtv97OyyZ1HNfhThxsNqlTE50vb qOdcfXsjX0BCCgcr7Trc1uB3miXLSQXryla4p9U4N/m/KZVzvNDIYr5rkEri8/GuarBG Vyd8T69jJw4uuA9VbwB88MnTpD3wxRBzQW76jDMJz3UHKZnHOlfnqjKrLRLBTjXW3u61 JaqA== X-Gm-Message-State: AHPjjUhFeu4/FgaZBMhUf72d04isNZL1U7RKD0KgGeGyVwXvSKC/aAtA aell46JMxl9qCtHzvAaQCA== X-Google-Smtp-Source: ADKCNb6dBU+vgsRhj6pF2E/+ERrSnQwdgRxby8dYjtKnqSjOmks/z0HdMln6Ydxc8Q/VYzW8esk4jw== X-Received: by 10.98.20.19 with SMTP id 19mr301157pfu.167.1504809891530; Thu, 07 Sep 2017 11:44:51 -0700 (PDT) Received: from pike.twiddle.net (97-126-108-236.tukw.qwest.net. [97.126.108.236]) by smtp.gmail.com with ESMTPSA id r68sm464247pfi.7.2017.09.07.11.44.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Sep 2017 11:44:50 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 7 Sep 2017 11:44:46 -0700 Message-Id: <20170907184447.22752-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170907184447.22752-1-richard.henderson@linaro.org> References: <20170907184447.22752-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::22f Subject: [Qemu-devel] [PULL 2/3] target/hppa: Convert to DisasContextBase X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Signed-off-by: Richard Henderson --- target/hppa/translate.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) -- 2.13.5 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);