]> xenbits.xensource.com Git - people/pauldu/qemu.git/commitdiff
tcg: pass down TranslationBlock to tcg_code_gen
authorAlex Bennée <alex.bennee@linaro.org>
Tue, 15 Mar 2016 14:30:16 +0000 (14:30 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 22 Mar 2016 21:20:17 +0000 (22:20 +0100)
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 <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Message-Id: <1458052224-9316-3-git-send-email-alex.bennee@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tcg/tcg.c
tcg/tcg.h
translate-all.c

index 4c8c2d2991a4167b766c83ce8ca32b6d096023db..f1f1640c9b94f315f0bd602d0943ad163ded35e2 100644 (file)
--- 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);
 
index b83f76351ccdb01146f47082c3fa28fb4c2de821..40c8fbe2ae6409a948e9e8714a96aa75f4f4b5db 100644 (file)
--- 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);
 
index e9f409b762ab58fbf987fe8770936c7d6ffd14f8..b3207fe274de08c9f6c63f4a26c2cafe7bdaecf0 100644 (file)
@@ -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;
     }