From: Bharat Bhushan <r65777@freescale.com>
To: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, agraf@suse.de
Cc: Bharat Bhushan <bharat.bhushan@freescale.com>
Subject: [Qemu-devel] [PATCH 2/3] Registered timer reset handler
Date: Fri, 3 Aug 2012 10:51:24 +0530 [thread overview]
Message-ID: <1343971285-17725-2-git-send-email-Bharat.Bhushan@freescale.com> (raw)
In-Reply-To: <1343971285-17725-1-git-send-email-Bharat.Bhushan@freescale.com>
Reset qemu timers when guest reset.
Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
---
hw/ppc_booke.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/hw/ppc_booke.c b/hw/ppc_booke.c
index d51e7fa..837a5b6 100644
--- a/hw/ppc_booke.c
+++ b/hw/ppc_booke.c
@@ -231,6 +231,16 @@ void store_booke_tcr(CPUPPCState *env, target_ulong val)
}
+static void ppc_booke_timer_reset_handle(void *opaque)
+{
+ CPUPPCState *env = opaque;
+
+ env->spr[SPR_BOOKE_TSR] = 0;
+ env->spr[SPR_BOOKE_TCR] = 0;
+
+ booke_update_irq(env);
+}
+
void ppc_booke_timers_init(CPUPPCState *env, uint32_t freq, uint32_t flags)
{
ppc_tb_t *tb_env;
@@ -251,4 +261,6 @@ void ppc_booke_timers_init(CPUPPCState *env, uint32_t freq, uint32_t flags)
qemu_new_timer_ns(vm_clock, &booke_fit_cb, env);
booke_timer->wdt_timer =
qemu_new_timer_ns(vm_clock, &booke_wdt_cb, env);
+
+ qemu_register_reset(ppc_booke_timer_reset_handle, env);
}
--
1.7.0.4
next prev parent reply other threads:[~2012-08-03 5:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-03 5:21 [Qemu-devel] [PATCH 1/3] Synchronize the linux-headers Bharat Bhushan
2012-08-03 5:21 ` Bharat Bhushan [this message]
2012-08-03 5:21 ` [Qemu-devel] [PATCH 3/3] Enable kvm emulated watchdog Bharat Bhushan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1343971285-17725-2-git-send-email-Bharat.Bhushan@freescale.com \
--to=r65777@freescale.com \
--cc=agraf@suse.de \
--cc=bharat.bhushan@freescale.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).