ppc4xx_devs: Use cpu_ppc_init() to obtain PowerPCCPU
authorAndreas Färber <afaerber@suse.de>
Fri, 4 May 2012 15:20:11 +0000 (17:20 +0200)
committerAndreas Färber <afaerber@suse.de>
Mon, 4 Jun 2012 21:00:44 +0000 (23:00 +0200)
Needed for ppc4xx_reset().

Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Alexander Graf <agraf@suse.de>
hw/ppc4xx_devs.c

index 00e36f4..4cefd75 100644 (file)
@@ -51,15 +51,18 @@ CPUPPCState *ppc4xx_init (const char *cpu_model,
                        clk_setup_t *cpu_clk, clk_setup_t *tb_clk,
                        uint32_t sysclk)
 {
+    PowerPCCPU *cpu;
     CPUPPCState *env;
 
     /* init CPUs */
-    env = cpu_init(cpu_model);
-    if (!env) {
+    cpu = cpu_ppc_init(cpu_model);
+    if (cpu == NULL) {
         fprintf(stderr, "Unable to find PowerPC %s CPU definition\n",
                 cpu_model);
         exit(1);
     }
+    env = &cpu->env;
+
     cpu_clk->cb = NULL; /* We don't care about CPU clock frequency changes */
     cpu_clk->opaque = env;
     /* Set time-base frequency to sysclk */