Patchwork [68/74] sun4u: Let cpu_devinit() return SPARCCPU

login
register
mail settings
Submitter Andreas Färber
Date June 5, 2012, 1:22 a.m.
Message ID <1338859366-20689-69-git-send-email-afaerber@suse.de>
Download mbox | patch
Permalink /patch/162970/
State New
Headers show

Comments

Andreas Färber - June 5, 2012, 1:22 a.m.
Needed for main_cpu_reset().

Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Blue Swirl <blauwirbel@gmail.com>
---
 hw/sun4u.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

Patch

diff --git a/hw/sun4u.c b/hw/sun4u.c
index 92b616f..e63ba39 100644
--- a/hw/sun4u.c
+++ b/hw/sun4u.c
@@ -752,7 +752,7 @@  static TypeInfo ram_info = {
     .class_init    = ram_class_init,
 };
 
-static CPUSPARCState *cpu_devinit(const char *cpu_model, const struct hwdef *hwdef)
+static SPARCCPU *cpu_devinit(const char *cpu_model, const struct hwdef *hwdef)
 {
     SPARCCPU *cpu;
     CPUSPARCState *env;
@@ -786,7 +786,7 @@  static CPUSPARCState *cpu_devinit(const char *cpu_model, const struct hwdef *hwd
     reset_info->prom_addr = hwdef->prom_addr;
     qemu_register_reset(main_cpu_reset, reset_info);
 
-    return env;
+    return cpu;
 }
 
 static void sun4uv_init(MemoryRegion *address_space_mem,
@@ -796,6 +796,7 @@  static void sun4uv_init(MemoryRegion *address_space_mem,
                         const char *initrd_filename, const char *cpu_model,
                         const struct hwdef *hwdef)
 {
+    SPARCCPU *cpu;
     CPUSPARCState *env;
     M48t59State *nvram;
     unsigned int i;
@@ -808,7 +809,8 @@  static void sun4uv_init(MemoryRegion *address_space_mem,
     void *fw_cfg;
 
     /* init CPUs */
-    env = cpu_devinit(cpu_model, hwdef);
+    cpu = cpu_devinit(cpu_model, hwdef);
+    env = &cpu->env;
 
     /* set up devices */
     ram_init(0, RAM_size);