From patchwork Thu Jun 28 05:39:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bharat Bhushan X-Patchwork-Id: 167792 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 00B6E100930 for ; Thu, 28 Jun 2012 15:35:38 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751450Ab2F1Ffg (ORCPT ); Thu, 28 Jun 2012 01:35:36 -0400 Received: from ch1ehsobe001.messaging.microsoft.com ([216.32.181.181]:53758 "EHLO ch1outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751152Ab2F1Ffe (ORCPT ); Thu, 28 Jun 2012 01:35:34 -0400 Received: from mail230-ch1-R.bigfish.com (10.43.68.236) by CH1EHSOBE001.bigfish.com (10.43.70.51) with Microsoft SMTP Server id 14.1.225.23; Thu, 28 Jun 2012 05:33:49 +0000 Received: from mail230-ch1 (localhost [127.0.0.1]) by mail230-ch1-R.bigfish.com (Postfix) with ESMTP id A83E010000C5; Thu, 28 Jun 2012 05:33:48 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 3 X-BigFish: VS3(zzzz1202h1082kzz8275bhz2dh2a8h668h839he5bhf0ah) Received: from mail230-ch1 (localhost.localdomain [127.0.0.1]) by mail230-ch1 (MessageSwitch) id 1340861627830641_24147; Thu, 28 Jun 2012 05:33:47 +0000 (UTC) Received: from CH1EHSMHS004.bigfish.com (snatpool3.int.messaging.microsoft.com [10.43.68.229]) by mail230-ch1.bigfish.com (Postfix) with ESMTP id C88DC800049; Thu, 28 Jun 2012 05:33:47 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CH1EHSMHS004.bigfish.com (10.43.70.4) with Microsoft SMTP Server (TLS) id 14.1.225.23; Thu, 28 Jun 2012 05:33:47 +0000 Received: from az84smr01.freescale.net (10.64.34.197) by 039-SN1MMR1-003.039d.mgd.msft.net (10.84.1.16) with Microsoft SMTP Server (TLS) id 14.2.298.5; Thu, 28 Jun 2012 00:35:32 -0500 Received: from freescale.com ([10.232.15.72]) by az84smr01.freescale.net (8.14.3/8.14.0) with SMTP id q5S5ZShX028171; Wed, 27 Jun 2012 22:35:29 -0700 Received: by freescale.com (sSMTP sendmail emulation); Thu, 28 Jun 2012 11:10:06 +0530 From: Bharat Bhushan To: , , CC: Bharat Bhushan , Bharat Bhushan Subject: [PATCH 2/4] Registered timer reset handler Date: Thu, 28 Jun 2012 11:09:57 +0530 Message-ID: <1340861999-31281-2-git-send-email-Bharat.Bhushan@freescale.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1340861999-31281-1-git-send-email-Bharat.Bhushan@freescale.com> References: <1340861999-31281-1-git-send-email-Bharat.Bhushan@freescale.com> MIME-Version: 1.0 X-OriginatorOrg: freescale.com Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.org Reset qemu timers when guest reset. Signed-off-by: Bharat Bhushan --- 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); }