summaryrefslogtreecommitdiffstats
path: root/tcg/tcg.c
diff options
context:
space:
mode:
authorRichard Henderson2021-03-10 05:52:45 +0100
committerRichard Henderson2021-06-11 18:27:08 +0200
commit43b972b7ebe9b8e84aa535031de7e605f6bf2cb2 (patch)
treecc1d8a122b43510682c1430134cafccbabe0edaf /tcg/tcg.c
parentaccel/tcg: Use MiB in tcg_init_machine (diff)
downloadqemu-43b972b7ebe9b8e84aa535031de7e605f6bf2cb2.tar.gz
qemu-43b972b7ebe9b8e84aa535031de7e605f6bf2cb2.tar.xz
qemu-43b972b7ebe9b8e84aa535031de7e605f6bf2cb2.zip
accel/tcg: Pass down max_cpus to tcg_init
Start removing the include of hw/boards.h from tcg/. Pass down the max_cpus value from tcg_init_machine, where we have the MachineState already. Reviewed-by: Luis Pires <luis.pires@eldorado.org.br> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'tcg/tcg.c')
-rw-r--r--tcg/tcg.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/tcg/tcg.c b/tcg/tcg.c
index 2625d9e502..5cc384e205 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -576,7 +576,7 @@ static void process_op_defs(TCGContext *s);
static TCGTemp *tcg_global_reg_new_internal(TCGContext *s, TCGType type,
TCGReg reg, const char *name);
-static void tcg_context_init(void)
+static void tcg_context_init(unsigned max_cpus)
{
TCGContext *s = &tcg_init_ctx;
int op, total_args, n, i;
@@ -645,8 +645,6 @@ static void tcg_context_init(void)
tcg_ctxs = &tcg_ctx;
n_tcg_ctxs = 1;
#else
- MachineState *ms = MACHINE(qdev_get_machine());
- unsigned int max_cpus = ms->smp.max_cpus;
tcg_ctxs = g_new(TCGContext *, max_cpus);
#endif
@@ -655,10 +653,10 @@ static void tcg_context_init(void)
cpu_env = temp_tcgv_ptr(ts);
}
-void tcg_init(size_t tb_size, int splitwx)
+void tcg_init(size_t tb_size, int splitwx, unsigned max_cpus)
{
- tcg_context_init();
- tcg_region_init(tb_size, splitwx);
+ tcg_context_init(max_cpus);
+ tcg_region_init(tb_size, splitwx, max_cpus);
}
/*