From a86cf967a1afe8ccbf58d34983816bc2985d65d2 Mon Sep 17 00:00:00 2001 From: Philippe Mathieu-Daudé Date: Thu, 23 Jan 2025 10:19:44 +0100 Subject: cpus: Have cpu_exec_initfn() per user / system emulation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Slighly simplify cpu-target.c again by extracting cpu_exec_initfn() to cpu-{system,user}.c, adding an empty stub for user emulation. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20250123234415.59850-19-philmd@linaro.org> --- hw/core/cpu-system.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'hw/core/cpu-system.c') diff --git a/hw/core/cpu-system.c b/hw/core/cpu-system.c index 1310b4203f..e511507e13 100644 --- a/hw/core/cpu-system.c +++ b/hw/core/cpu-system.c @@ -20,6 +20,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" +#include "exec/address-spaces.h" #include "exec/memory.h" #include "exec/tswap.h" #include "hw/qdev-core.h" @@ -187,3 +188,9 @@ void cpu_class_init_props(DeviceClass *dc) device_class_set_props(dc, cpu_system_props); } + +void cpu_exec_initfn(CPUState *cpu) +{ + cpu->memory = get_system_memory(); + object_ref(OBJECT(cpu->memory)); +} -- cgit 1.4.1