diff mbox

[v1,09/22] target-microblaze: Add address-space property

Message ID 1387181170-23267-10-git-send-email-edgar.iglesias@gmail.com
State New
Headers show

Commit Message

Edgar E. Iglesias Dec. 16, 2013, 8:05 a.m. UTC
From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
---
 target-microblaze/cpu.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)
diff mbox

Patch

diff --git a/target-microblaze/cpu.c b/target-microblaze/cpu.c
index 0ef9aa4..ada9556 100644
--- a/target-microblaze/cpu.c
+++ b/target-microblaze/cpu.c
@@ -88,11 +88,22 @@  static void mb_cpu_reset(CPUState *s)
 #endif
 }
 
+static void mb_cpu_setup_as(CPUState *cs)
+{
+#ifndef CONFIG_USER_ONLY
+    MicroBlazeCPU *cpu = MICROBLAZE_CPU(cs);
+    CPUMBState *env = &cpu->env;
+
+    cpu_address_space_init(cs, env->as);
+#endif
+}
+
 static void mb_cpu_realizefn(DeviceState *dev, Error **errp)
 {
     CPUState *cs = CPU(dev);
     MicroBlazeCPUClass *mcc = MICROBLAZE_CPU_GET_CLASS(dev);
 
+    mb_cpu_setup_as(cs);
     cpu_reset(cs);
     qemu_init_vcpu(cs);
 
@@ -123,6 +134,9 @@  static const VMStateDescription vmstate_mb_cpu = {
 };
 
 static Property mb_properties[] = {
+#ifndef CONFIG_USER_ONLY
+    DEFINE_PROP_ADDRESS_SPACE("address-space", MicroBlazeCPU, env.as),
+#endif
     DEFINE_PROP_UINT32("xlnx.base-vectors", MicroBlazeCPU, base_vectors, 0),
     DEFINE_PROP_END_OF_LIST(),
 };