summary refs log tree commit diff stats
path: root/hw/core/cpu-system.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2025-01-23 10:19:44 +0100
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2025-03-06 15:46:18 +0100
commita86cf967a1afe8ccbf58d34983816bc2985d65d2 (patch)
tree2e4ae9211791830a77e75adb0fc1cf5e81167ac1 /hw/core/cpu-system.c
parente3a575f5609569400da628d384b32f5e3cf58745 (diff)
downloadfocaccia-qemu-a86cf967a1afe8ccbf58d34983816bc2985d65d2.tar.gz
focaccia-qemu-a86cf967a1afe8ccbf58d34983816bc2985d65d2.zip
cpus: Have cpu_exec_initfn() per user / system emulation
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é <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20250123234415.59850-19-philmd@linaro.org>
Diffstat (limited to 'hw/core/cpu-system.c')
-rw-r--r--hw/core/cpu-system.c7
1 files changed, 7 insertions, 0 deletions
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));
+}