aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorBharat Bhushan <r65777@freescale.com>2012-12-27 19:16:51 +0000
committerAlexander Graf <agraf@suse.de>2013-01-07 17:37:09 +0100
commit88a78d9093917096feffeba66802be27d0e64ead (patch)
tree3167623fccc7de9e494ec0d3e401189308b2da9e /hw
parentaf7e9e74c6a62a5bcd911726a9e88d28b61490e0 (diff)
PPC: Reset qemu timers when guest reset
This patch install the timer reset handler. This will be called when the guest is reset. Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com> [agraf: adjust for QOM'ification] Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'hw')
-rw-r--r--hw/ppc_booke.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/hw/ppc_booke.c b/hw/ppc_booke.c
index 4483b8d292..25a4e91b69 100644
--- a/hw/ppc_booke.c
+++ b/hw/ppc_booke.c
@@ -237,6 +237,17 @@ void store_booke_tcr(CPUPPCState *env, target_ulong val)
}
+static void ppc_booke_timer_reset_handle(void *opaque)
+{
+ PowerPCCPU *cpu = opaque;
+ CPUPPCState *env = &cpu->env;
+
+ env->spr[SPR_BOOKE_TSR] = 0;
+ env->spr[SPR_BOOKE_TCR] = 0;
+
+ booke_update_irq(cpu);
+}
+
void ppc_booke_timers_init(PowerPCCPU *cpu, uint32_t freq, uint32_t flags)
{
ppc_tb_t *tb_env;
@@ -257,4 +268,6 @@ void ppc_booke_timers_init(PowerPCCPU *cpu, uint32_t freq, uint32_t flags)
qemu_new_timer_ns(vm_clock, &booke_fit_cb, cpu);
booke_timer->wdt_timer =
qemu_new_timer_ns(vm_clock, &booke_wdt_cb, cpu);
+
+ qemu_register_reset(ppc_booke_timer_reset_handle, cpu);
}