Patchwork [RFC,v4,20/20] hw/integratorcp: Add child property for CPU

login
register
mail settings
Submitter Andreas Färber
Date March 10, 2012, 4:53 p.m.
Message ID <1331398436-20761-21-git-send-email-afaerber@suse.de>
Download mbox | patch
Permalink /patch/145882/
State New
Headers show

Comments

Andreas Färber - March 10, 2012, 4:53 p.m.
Only one CPU is created on this board, so we can use "/cpu".

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 hw/integratorcp.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

Patch

diff --git a/hw/integratorcp.c b/hw/integratorcp.c
index 9bdb9e6..ac3fd7e 100644
--- a/hw/integratorcp.c
+++ b/hw/integratorcp.c
@@ -443,6 +443,7 @@  static void integratorcp_init(ram_addr_t ram_size,
                      const char *kernel_filename, const char *kernel_cmdline,
                      const char *initrd_filename, const char *cpu_model)
 {
+    ARMCPU *cpu;
     CPUARMState *env;
     MemoryRegion *address_space_mem = get_system_memory();
     MemoryRegion *ram = g_new(MemoryRegion, 1);
@@ -459,6 +460,8 @@  static void integratorcp_init(ram_addr_t ram_size,
         fprintf(stderr, "Unable to find CPU definition\n");
         exit(1);
     }
+    cpu = arm_env_get_cpu(env);
+    object_property_add_child(object_get_root(), "cpu", OBJECT(cpu), NULL);
     memory_region_init_ram(ram, "integrator.ram", ram_size);
     vmstate_register_ram_global(ram);
     /* ??? On a real system the first 1Mb is mapped as SSRAM or boot flash.  */