Patchwork [for-next,64/74] mips_jazz: Use cpu_mips_init() to obtain MIPSCPU

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

Comments

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

Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 hw/mips_jazz.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
Hervé Poussineau - May 6, 2012, 9:48 p.m.
Andreas Färber a écrit :
> Needed for main_cpu_reset().
> 
> Signed-off-by: Andreas Färber <afaerber@suse.de>
> ---
>  hw/mips_jazz.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
[...]

Acked-by: Hervé Poussineau <hpoussin@reactos.org>

Patch

diff --git a/hw/mips_jazz.c b/hw/mips_jazz.c
index a6bc7ba..24959e0 100644
--- a/hw/mips_jazz.c
+++ b/hw/mips_jazz.c
@@ -112,6 +112,7 @@  static void mips_jazz_init(MemoryRegion *address_space,
 {
     char *filename;
     int bios_size, n;
+    MIPSCPU *cpu;
     CPUMIPSState *env;
     qemu_irq *rc4030, *i8259;
     rc4030_dma *dmas;
@@ -140,11 +141,12 @@  static void mips_jazz_init(MemoryRegion *address_space,
         cpu_model = "24Kf";
 #endif
     }
-    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;
     qemu_register_reset(main_cpu_reset, env);
 
     /* allocate RAM */