ppc_booke: Pass PowerPCCPU to ppc_booke_timers_init()
authorAndreas Färber <afaerber@suse.de>
Sat, 1 Dec 2012 03:43:18 +0000 (04:43 +0100)
committerAndreas Färber <afaerber@suse.de>
Wed, 19 Dec 2012 13:09:32 +0000 (14:09 +0100)
Cleans up after passing PowerPCCPU to timer callbacks.

Signed-off-by: Andreas Färber <afaerber@suse.de>
hw/ppc.h
hw/ppc/e500.c
hw/ppc405_uc.c
hw/ppc440_bamboo.c
hw/ppc_booke.c
hw/virtex_ml507.c

index 64463ad3881f05a1efc4edf4e6c6bacf50f75bf2..ec33f9c6b92dbac48d99d4bee2dd5607a49b37fc 100644 (file)
--- a/hw/ppc.h
+++ b/hw/ppc.h
@@ -89,4 +89,4 @@ enum {
 #define PPC_SERIAL_MM_BAUDBASE 399193
 
 /* ppc_booke.c */
-void ppc_booke_timers_init(CPUPPCState *env, uint32_t freq, uint32_t flags);
+void ppc_booke_timers_init(PowerPCCPU *cpu, uint32_t freq, uint32_t flags);
index af6b67143a9971e282a21015bbe5bb5d1797bcf6..55923595ca50bffb94524a19c3f5d24fbfed7965 100644 (file)
@@ -495,7 +495,7 @@ void ppce500_init(PPCE500Params *params)
         env->mpic_cpu_base = MPC8544_CCSRBAR_BASE +
                               MPC8544_MPIC_REGS_OFFSET + 0x20000;
 
-        ppc_booke_timers_init(env, 400000000, PPC_TIMER_E500);
+        ppc_booke_timers_init(cpu, 400000000, PPC_TIMER_E500);
 
         /* Register reset handler */
         if (!i) {
index 373b8f332427f4e3aa0ad4b3168964e7a35efe73..fe71784cdc80c3ff853d798e3fae570aa800b76e 100644 (file)
@@ -2482,7 +2482,7 @@ CPUPPCState *ppc405ep_init(MemoryRegion *address_space_mem,
     /* OBP arbitrer */
     ppc4xx_opba_init(0xef600600);
     /* Initialize timers */
-    ppc_booke_timers_init(env, sysclk, 0);
+    ppc_booke_timers_init(cpu, sysclk, 0);
     /* Universal interrupt controller */
     irqs = g_malloc0(sizeof(qemu_irq) * PPCUIC_OUTPUT_NB);
     irqs[PPCUIC_OUTPUT_INT] =
index cc85607cb7d5196d6a8dedf940296ce9deafe63a..d9f0f81d629be670f57f3ac0ef0010696598c8bb 100644 (file)
@@ -195,7 +195,7 @@ static void bamboo_init(QEMUMachineInitArgs *args)
     env = &cpu->env;
 
     qemu_register_reset(main_cpu_reset, cpu);
-    ppc_booke_timers_init(env, 400000000, 0);
+    ppc_booke_timers_init(cpu, 400000000, 0);
     ppc_dcr_init(env, NULL, NULL);
 
     /* interrupt controller */
index 5748063f453f65d8a607b839bfa8168055b0a41f..f2c0409f94dc34d9995997cf921cd3a6d6dc8bad 100644 (file)
@@ -237,16 +237,15 @@ void store_booke_tcr(CPUPPCState *env, target_ulong val)
 
 }
 
-void ppc_booke_timers_init(CPUPPCState *env, uint32_t freq, uint32_t flags)
+void ppc_booke_timers_init(PowerPCCPU *cpu, uint32_t freq, uint32_t flags)
 {
-    PowerPCCPU *cpu = ppc_env_get_cpu(env);
     ppc_tb_t *tb_env;
     booke_timer_t *booke_timer;
 
     tb_env      = g_malloc0(sizeof(ppc_tb_t));
     booke_timer = g_malloc0(sizeof(booke_timer_t));
 
-    env->tb_env = tb_env;
+    cpu->env.tb_env = tb_env;
     tb_env->flags = flags | PPC_TIMER_BOOKE | PPC_DECR_ZERO_TRIGGERED;
 
     tb_env->tb_freq    = freq;
index 6ab8fee0c13a09b25b1fe887bcb00c75b01bee80..1a19cd2d08b05d00075a2d7ef020d4ebf54e4b28 100644 (file)
@@ -94,7 +94,7 @@ static PowerPCCPU *ppc440_init_xilinx(ram_addr_t *ram_size,
     }
     env = &cpu->env;
 
-    ppc_booke_timers_init(env, sysclk, 0/* no flags */);
+    ppc_booke_timers_init(cpu, sysclk, 0/* no flags */);
 
     ppc_dcr_init(env, NULL, NULL);