aboutsummaryrefslogtreecommitdiff
path: root/tcg
diff options
context:
space:
mode:
authorEmilio G. Cota <cota@braap.org>2017-07-12 18:26:40 -0400
committerRichard Henderson <richard.henderson@linaro.org>2017-10-24 13:53:42 -0700
commitdf2cce2968069526553d82331ce9817eaca6b03a (patch)
treebf892ab107f5095e8e85963b475bd65f3d8a674d /tcg
parent26689780f838f6be13c3878b973ad4a83c0e8071 (diff)
tcg: introduce **tcg_ctxs to keep track of all TCGContext's
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. Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Emilio G. Cota <cota@braap.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'tcg')
-rw-r--r--tcg/tcg.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tcg/tcg.c b/tcg/tcg.c
index 62f418ac8a..24ef6df6b5 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -118,6 +118,9 @@ static bool tcg_out_ldst_finalize(TCGContext *s);
#define TCG_HIGHWATER 1024
+static TCGContext **tcg_ctxs;
+static unsigned int n_tcg_ctxs;
+
static TCGRegSet tcg_target_available_regs[2];
static TCGRegSet tcg_target_call_clobber_regs;
@@ -384,6 +387,8 @@ void tcg_context_init(TCGContext *s)
}
tcg_ctx = s;
+ tcg_ctxs = &tcg_ctx;
+ n_tcg_ctxs = 1;
}
/*