[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 37/45] tcg: introduce **tcg_ctxs to keep track of
From: |
Emilio G. Cota |
Subject: |
[Qemu-devel] [PATCH v2 37/45] tcg: introduce **tcg_ctxs to keep track of all TCGContext's |
Date: |
Sun, 16 Jul 2017 16:04:20 -0400 |
Groundwork for supporting multiple TCG contexts.
Note that having n_tcg_ctxs is unnecessary. However, it is
convenient to have it, since it will simplify iterating over the
array: we'll have just a for loop instead of having to iterate
over a NULL-terminated array (which would require n+1 elems)
or having to check with ifdef's for usermode/softmmu.
Signed-off-by: Emilio G. Cota <address@hidden>
---
tcg/tcg.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/tcg/tcg.c b/tcg/tcg.c
index f907c47..8094278 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -115,6 +115,8 @@ static int tcg_target_const_match(tcg_target_long val,
TCGType type,
static void tcg_out_tb_init(TCGContext *s);
static bool tcg_out_tb_finalize(TCGContext *s);
+static TCGContext **tcg_ctxs;
+static unsigned int n_tcg_ctxs;
static TCGRegSet tcg_target_available_regs[2];
static TCGRegSet tcg_target_call_clobber_regs;
@@ -323,6 +325,13 @@ static GHashTable *helper_table;
static int indirect_reg_alloc_order[ARRAY_SIZE(tcg_target_reg_alloc_order)];
static void process_op_defs(TCGContext *s);
+static void tcg_ctxs_init(TCGContext *s)
+{
+ tcg_ctxs = g_new(TCGContext *, 1);
+ tcg_ctxs[0] = s;
+ n_tcg_ctxs = 1;
+}
+
void tcg_context_init(TCGContext *s)
{
int op, total_args, n, i;
@@ -381,6 +390,7 @@ void tcg_context_init(TCGContext *s)
indirect_reg_alloc_order[i] = tcg_target_reg_alloc_order[i];
}
+ tcg_ctxs_init(s);
tcg_ctx = s;
}
--
2.7.4
- Re: [Qemu-devel] [PATCH v2 23/45] translate-all: define and use DEBUG_TB_FLUSH_GATE, (continued)
- [Qemu-devel] [PATCH v2 22/45] cpu-exec: lookup/generate TB outside exclusive region during step_atomic, Emilio G. Cota, 2017/07/16
- [Qemu-devel] [PATCH v2 33/45] tcg: take .helpers out of TCGContext, Emilio G. Cota, 2017/07/16
- [Qemu-devel] [PATCH v2 26/45] translate-all: define and use DEBUG_TB_CHECK_GATE, Emilio G. Cota, 2017/07/16
- [Qemu-devel] [PATCH v2 18/45] target/m68k: check CF_PARALLEL instead of parallel_cpus, Emilio G. Cota, 2017/07/16
- [Qemu-devel] [PATCH v2 39/45] osdep: move qemu_real_host_page_size/mask to osdep, Emilio G. Cota, 2017/07/16
- [Qemu-devel] [PATCH v2 37/45] tcg: introduce **tcg_ctxs to keep track of all TCGContext's,
Emilio G. Cota <=
- [Qemu-devel] [PATCH v2 40/45] osdep: introduce qemu_mprotect_rwx/none, Emilio G. Cota, 2017/07/16
- [Qemu-devel] [PATCH v2 32/45] tcg: take tb_ctx out of TCGContext, Emilio G. Cota, 2017/07/16
- [Qemu-devel] [PATCH v2 10/45] translate-all: guarantee that tb_hash only holds valid TBs, Emilio G. Cota, 2017/07/16