From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40560) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXsty-0000ii-Ap for qemu-devel@nongnu.org; Mon, 22 Feb 2016 11:00:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aXstw-0001Ac-8R for qemu-devel@nongnu.org; Mon, 22 Feb 2016 10:59:58 -0500 Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]:34169) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXstw-0001AX-2I for qemu-devel@nongnu.org; Mon, 22 Feb 2016 10:59:56 -0500 Received: by mail-wm0-x22a.google.com with SMTP id b205so161905852wmb.1 for ; Mon, 22 Feb 2016 07:59:55 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= Date: Mon, 22 Feb 2016 15:59:39 +0000 Message-Id: <1456156787-17509-2-git-send-email-alex.bennee@linaro.org> In-Reply-To: <1456156787-17509-1-git-send-email-alex.bennee@linaro.org> References: <1456156787-17509-1-git-send-email-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH v7 1/9] tcg: pass down TranslationBlock to tcg_code_gen List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Crosthwaite , dgilbert@redhat.com, crosthwaitepeter@gmail.com, pbonzini@redhat.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= , aurelien@aurel32.net, rth@twiddle.net 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 --- v1 - checkpatch fixes v5 - much simplified due to changes since last posting v6 - remove needless tweaking of gen_code_buf in tb_gen_code --- tcg/tcg.c | 6 +++--- tcg/tcg.h | 2 +- translate-all.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index 0317c9e..b76d978 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -2269,7 +2269,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; @@ -2328,8 +2328,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 83da5fb..10af870 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -626,7 +626,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; } -- 2.7.1