summary refs log tree commit diff stats
path: root/hw/leon3.c
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2012-05-04 02:33:34 +0200
committerAndreas Färber <afaerber@suse.de>2012-06-04 23:00:45 +0200
commit60ad07335697071ae8e183716171f59202c3c466 (patch)
treebf5ba529078498c8d982ef9d8061e673c327b295 /hw/leon3.c
parent403d7a2d734e1a8237a0d0db11110ece2aad28d8 (diff)
downloadfocaccia-qemu-60ad07335697071ae8e183716171f59202c3c466.tar.gz
focaccia-qemu-60ad07335697071ae8e183716171f59202c3c466.zip
leon3: Use cpu_sparc_init() to obtain SPARCCPU
Needed for main_cpu_reset().

Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/leon3.c')
-rw-r--r--hw/leon3.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/leon3.c b/hw/leon3.c
index 0a5ff165a1..8ffef83595 100644
--- a/hw/leon3.c
+++ b/hw/leon3.c
@@ -101,6 +101,7 @@ static void leon3_generic_hw_init(ram_addr_t  ram_size,
                                   const char *initrd_filename,
                                   const char *cpu_model)
 {
+    SPARCCPU *cpu;
     CPUSPARCState   *env;
     MemoryRegion *address_space_mem = get_system_memory();
     MemoryRegion *ram = g_new(MemoryRegion, 1);
@@ -117,11 +118,12 @@ static void leon3_generic_hw_init(ram_addr_t  ram_size,
         cpu_model = "LEON3";
     }
 
-    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, 0);