[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 07/11] ppc_booke: Pass PowerPCCPU to {decr, fit,
From: |
Andreas Färber |
Subject: |
[Qemu-devel] [PATCH v2 07/11] ppc_booke: Pass PowerPCCPU to {decr, fit, wdt} timer callbacks |
Date: |
Sun, 16 Dec 2012 01:13:33 +0100 |
Cleans up after passing PowerPCCPU to booke_update_irq().
Signed-off-by: Andreas Färber <address@hidden>
---
hw/ppc_booke.c | 23 ++++++++++-------------
1 Datei geändert, 10 Zeilen hinzugefügt(+), 13 Zeilen entfernt(-)
diff --git a/hw/ppc_booke.c b/hw/ppc_booke.c
index da6bc4a..5748063 100644
--- a/hw/ppc_booke.c
+++ b/hw/ppc_booke.c
@@ -155,8 +155,8 @@ static void booke_update_fixed_timer(CPUPPCState
*env,
static void booke_decr_cb(void *opaque)
{
- CPUPPCState *env = opaque;
- PowerPCCPU *cpu = ppc_env_get_cpu(env);
+ PowerPCCPU *cpu = opaque;
+ CPUPPCState *env = &cpu->env;
env->spr[SPR_BOOKE_TSR] |= TSR_DIS;
booke_update_irq(cpu);
@@ -169,13 +169,11 @@ static void booke_decr_cb(void *opaque)
static void booke_fit_cb(void *opaque)
{
- PowerPCCPU *cpu;
- CPUPPCState *env;
+ PowerPCCPU *cpu = opaque;
+ CPUPPCState *env = &cpu->env;
ppc_tb_t *tb_env;
booke_timer_t *booke_timer;
- env = opaque;
- cpu = ppc_env_get_cpu(env);
tb_env = env->tb_env;
booke_timer = tb_env->opaque;
env->spr[SPR_BOOKE_TSR] |= TSR_FIS;
@@ -190,13 +188,11 @@ static void booke_fit_cb(void *opaque)
static void booke_wdt_cb(void *opaque)
{
- PowerPCCPU *cpu;
- CPUPPCState *env;
+ PowerPCCPU *cpu = opaque;
+ CPUPPCState *env = &cpu->env;
ppc_tb_t *tb_env;
booke_timer_t *booke_timer;
- env = opaque;
- cpu = ppc_env_get_cpu(env);
tb_env = env->tb_env;
booke_timer = tb_env->opaque;
@@ -243,6 +239,7 @@ void store_booke_tcr(CPUPPCState *env, target_ulong val)
void ppc_booke_timers_init(CPUPPCState *env, uint32_t freq, uint32_t flags)
{
+ PowerPCCPU *cpu = ppc_env_get_cpu(env);
ppc_tb_t *tb_env;
booke_timer_t *booke_timer;
@@ -255,10 +252,10 @@ void ppc_booke_timers_init(CPUPPCState *env, uint32_t
freq, uint32_t flags)
tb_env->tb_freq = freq;
tb_env->decr_freq = freq;
tb_env->opaque = booke_timer;
- tb_env->decr_timer = qemu_new_timer_ns(vm_clock, &booke_decr_cb, env);
+ tb_env->decr_timer = qemu_new_timer_ns(vm_clock, &booke_decr_cb, cpu);
booke_timer->fit_timer =
- qemu_new_timer_ns(vm_clock, &booke_fit_cb, env);
+ qemu_new_timer_ns(vm_clock, &booke_fit_cb, cpu);
booke_timer->wdt_timer =
- qemu_new_timer_ns(vm_clock, &booke_wdt_cb, env);
+ qemu_new_timer_ns(vm_clock, &booke_wdt_cb, cpu);
}
--
1.7.10.4
- [Qemu-devel] [PATCH v2 00/11] QOM CPUState, part 6: CPU_COMMON for KVM, Andreas Färber, 2012/12/15
- [Qemu-devel] [PATCH v2 01/11] cpu: Move kvm_fd into CPUState, Andreas Färber, 2012/12/15
- [Qemu-devel] [PATCH v2 02/11] kvm: Pass CPUState to kvm_arch_*, Andreas Färber, 2012/12/15
- [Qemu-devel] [PATCH v2 05/11] ppc: Pass PowerPCCPU to [h]decr callbacks, Andreas Färber, 2012/12/15
- [Qemu-devel] [PATCH v2 04/11] ppc: Pass PowerPCCPU to ppc_set_irq(), Andreas Färber, 2012/12/15
- [Qemu-devel] [PATCH v2 06/11] ppc: Pass PowerPCCPU to [h]decr timer callbacks, Andreas Färber, 2012/12/15
- [Qemu-devel] [PATCH v2 07/11] ppc_booke: Pass PowerPCCPU to {decr, fit, wdt} timer callbacks,
Andreas Färber <=
- [Qemu-devel] [PATCH v2 08/11] ppc4xx_devs: Return PowerPCCPU from ppc4xx_init(), Andreas Färber, 2012/12/15
- [Qemu-devel] [PATCH v2 03/11] kvm: Pass CPUState to kvm_vcpu_ioctl(), Andreas Färber, 2012/12/15
- [Qemu-devel] [PATCH v2 11/11] cpu: Move kvm_run into CPUState, Andreas Färber, 2012/12/15
- [Qemu-devel] [PATCH v2 10/11] cpu: Move kvm_state field into CPUState, Andreas Färber, 2012/12/15
- [Qemu-devel] [PATCH v2 09/11] ppc_booke: Pass PowerPCCPU to ppc_booke_timers_init(), Andreas Färber, 2012/12/15
- Re: [Qemu-devel] [PATCH v2 00/11] QOM CPUState, part 6: CPU_COMMON for KVM, Andreas Färber, 2012/12/18