aboutsummaryrefslogtreecommitdiff
path: root/tcg
diff options
context:
space:
mode:
Diffstat (limited to 'tcg')
-rw-r--r--tcg/tcg.c2
-rw-r--r--tcg/tcg.h14
2 files changed, 12 insertions, 4 deletions
diff --git a/tcg/tcg.c b/tcg/tcg.c
index 9275e372ff..c8a843ed09 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -263,7 +263,7 @@ void tcg_context_init(TCGContext *s)
void tcg_prologue_init(TCGContext *s)
{
/* init global prologue and epilogue */
- s->code_buf = code_gen_prologue;
+ s->code_buf = s->code_gen_prologue;
s->code_ptr = s->code_buf;
tcg_target_qemu_prologue(s);
flush_icache_range((tcg_target_ulong)s->code_buf,
diff --git a/tcg/tcg.h b/tcg/tcg.h
index a4279725a6..4086e985e3 100644
--- a/tcg/tcg.h
+++ b/tcg/tcg.h
@@ -462,6 +462,15 @@ struct TCGContext {
uint16_t gen_opc_icount[OPC_BUF_SIZE];
uint8_t gen_opc_instr_start[OPC_BUF_SIZE];
+ /* Code generation */
+ int code_gen_max_blocks;
+ uint8_t *code_gen_prologue;
+ uint8_t *code_gen_buffer;
+ size_t code_gen_buffer_size;
+ /* threshold to flush the translated code buffer */
+ size_t code_gen_buffer_max_size;
+ uint8_t *code_gen_ptr;
+
#if defined(CONFIG_QEMU_LDST_OPTIMIZATION) && defined(CONFIG_SOFTMMU)
/* labels info for qemu_ld/st IRs
The labels help to generate TLB miss case codes at the end of TB */
@@ -658,12 +667,11 @@ TCGv_i64 tcg_const_i64(int64_t val);
TCGv_i32 tcg_const_local_i32(int32_t val);
TCGv_i64 tcg_const_local_i64(int64_t val);
-extern uint8_t *code_gen_prologue;
-
/* TCG targets may use a different definition of tcg_qemu_tb_exec. */
#if !defined(tcg_qemu_tb_exec)
# define tcg_qemu_tb_exec(env, tb_ptr) \
- ((tcg_target_ulong (*)(void *, void *))code_gen_prologue)(env, tb_ptr)
+ ((tcg_target_ulong (*)(void *, void *))tcg_ctx.code_gen_prologue)(env, \
+ tb_ptr)
#endif
void tcg_register_jit(void *buf, size_t buf_size);