Patchwork [next,v2,66/74] mips_malta: Use cpu_mips_init() to obtain MIPSCPU

login
register
mail settings
Submitter Andreas Färber
Date May 10, 2012, 12:14 a.m.
Message ID <1336608892-30501-67-git-send-email-afaerber@suse.de>
Download mbox | patch
Permalink /patch/158117/
State New
Headers show

Comments

Andreas Färber - May 10, 2012, 12:14 a.m.
Needed for main_cpu_reset().

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

Patch

diff --git a/hw/mips_malta.c b/hw/mips_malta.c
index 4752bb2..d81e8d5 100644
--- a/hw/mips_malta.c
+++ b/hw/mips_malta.c
@@ -788,6 +788,7 @@  void mips_malta_init (ram_addr_t ram_size,
     int64_t kernel_entry;
     PCIBus *pci_bus;
     ISABus *isa_bus;
+    MIPSCPU *cpu;
     CPUMIPSState *env;
     qemu_irq *isa_irq;
     qemu_irq *cpu_exit_irq;
@@ -825,11 +826,13 @@  void mips_malta_init (ram_addr_t ram_size,
     }
 
     for (i = 0; i < smp_cpus; i++) {
-        env = cpu_init(cpu_model);
-        if (!env) {
+        cpu = cpu_mips_init(cpu_model);
+        if (cpu == NULL) {
             fprintf(stderr, "Unable to find CPU definition\n");
             exit(1);
         }
+        env = &cpu->env;
+
         /* Init internal devices */
         cpu_mips_irq_init_cpu(env);
         cpu_mips_clock_init(env);