Patchwork [for-next,11/74] sun4u: Let cpu_devinit() return SPARCCPU

login
register
mail settings
Submitter Andreas Färber
Date May 6, 2012, 3:34 p.m.
Message ID <1336318514-30906-12-git-send-email-afaerber@suse.de>
Download mbox | patch
Permalink /patch/157132/
State New
Headers show

Comments

Andreas Färber - May 6, 2012, 3:34 p.m.
Needed for main_cpu_reset().

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

Patch

diff --git a/hw/sun4u.c b/hw/sun4u.c
index 8bb8557..df1aada 100644
--- a/hw/sun4u.c
+++ b/hw/sun4u.c
@@ -744,7 +744,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;
@@ -778,7 +778,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,
@@ -788,6 +788,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;
@@ -800,7 +801,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);