From patchwork Tue Mar 22 14:16:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 64178 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp2097473lbc; Tue, 22 Mar 2016 07:25:10 -0700 (PDT) X-Received: by 10.55.33.78 with SMTP id h75mr5664652qkh.54.1458656710599; Tue, 22 Mar 2016 07:25:10 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id x22si16249642qka.106.2016.03.22.07.25.10 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 22 Mar 2016 07:25:10 -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; 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 Received: from localhost ([::1]:37296 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiNF8-0007Qe-1S for patch@linaro.org; Tue, 22 Mar 2016 10:25:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32954) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiN7x-0004tV-4y for qemu-devel@nongnu.org; Tue, 22 Mar 2016 10:17:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aiN7w-0006gs-3P for qemu-devel@nongnu.org; Tue, 22 Mar 2016 10:17:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49512) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiN7v-0006go-Tn for qemu-devel@nongnu.org; Tue, 22 Mar 2016 10:17:44 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id A04FE75A; Tue, 22 Mar 2016 14:17:43 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-112-37.ams2.redhat.com [10.36.112.37]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2MEH9Q6004983; Tue, 22 Mar 2016 10:17:42 -0400 From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 22 Mar 2016 15:16:56 +0100 Message-Id: <1458656229-32043-17-git-send-email-pbonzini@redhat.com> In-Reply-To: <1458656229-32043-1-git-send-email-pbonzini@redhat.com> References: <1458656229-32043-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [Qemu-devel] [PULL 16/29] tcg: pass down TranslationBlock to tcg_code_gen X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Alex Bennée My later debugging patches need access to the origin PC which is held in the TranslationBlock structure. Pass down the whole structure as it also holds the information about the code start point. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Message-Id: <1458052224-9316-3-git-send-email-alex.bennee@linaro.org> Signed-off-by: Paolo Bonzini --- tcg/tcg.c | 6 +++--- tcg/tcg.h | 2 +- translate-all.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) -- 2.5.0 diff --git a/tcg/tcg.c b/tcg/tcg.c index 4c8c2d2..f1f1640 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -2328,7 +2328,7 @@ void tcg_dump_op_count(FILE *f, fprintf_function cpu_fprintf) #endif -int tcg_gen_code(TCGContext *s, tcg_insn_unit *gen_code_buf) +int tcg_gen_code(TCGContext *s, TranslationBlock *tb) { int i, oi, oi_next, num_insns; @@ -2387,8 +2387,8 @@ int tcg_gen_code(TCGContext *s, tcg_insn_unit *gen_code_buf) tcg_reg_alloc_start(s); - s->code_buf = gen_code_buf; - s->code_ptr = gen_code_buf; + s->code_buf = tb->tc_ptr; + s->code_ptr = tb->tc_ptr; tcg_out_tb_init(s); diff --git a/tcg/tcg.h b/tcg/tcg.h index b83f763..40c8fbe 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -636,7 +636,7 @@ void tcg_context_init(TCGContext *s); void tcg_prologue_init(TCGContext *s); void tcg_func_start(TCGContext *s); -int tcg_gen_code(TCGContext *s, tcg_insn_unit *gen_code_buf); +int tcg_gen_code(TCGContext *s, TranslationBlock *tb); void tcg_set_frame(TCGContext *s, TCGReg reg, intptr_t start, intptr_t size); diff --git a/translate-all.c b/translate-all.c index e9f409b..b3207fe 100644 --- a/translate-all.c +++ b/translate-all.c @@ -1120,7 +1120,7 @@ TranslationBlock *tb_gen_code(CPUState *cpu, the tcg optimization currently hidden inside tcg_gen_code. All that should be required is to flush the TBs, allocate a new TB, re-initialize it per above, and re-do the actual code generation. */ - gen_code_size = tcg_gen_code(&tcg_ctx, gen_code_buf); + gen_code_size = tcg_gen_code(&tcg_ctx, tb); if (unlikely(gen_code_size < 0)) { goto buffer_overflow; }