Patchwork [for-next,08/74] sun4m: Use cpu_sparc_init() to obtain SPARCCPU

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

Comments

Andreas Färber - May 6, 2012, 3:34 p.m.
Needed for {main,secondary}_cpu_reset().

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

Patch

diff --git a/hw/sun4m.c b/hw/sun4m.c
index 34088ad..c5d2e40 100644
--- a/hw/sun4m.c
+++ b/hw/sun4m.c
@@ -809,13 +809,15 @@  static TypeInfo ram_info = {
 static void cpu_devinit(const char *cpu_model, unsigned int id,
                         uint64_t prom_addr, qemu_irq **cpu_irqs)
 {
+    SPARCCPU *cpu;
     CPUSPARCState *env;
 
-    env = cpu_init(cpu_model);
-    if (!env) {
+    cpu = cpu_sparc_init(cpu_model);
+    if (cpu == NULL) {
         fprintf(stderr, "qemu: Unable to find Sparc CPU definition\n");
         exit(1);
     }
+    env = &cpu->env;
 
     cpu_sparc_set_id(env, id);
     if (id == 0) {