From patchwork Mon May 24 20:13:39 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 53462 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 762F5B7D12 for ; Tue, 25 May 2010 06:29:03 +1000 (EST) Received: from localhost ([127.0.0.1]:52287 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OGeGh-0001XP-M2 for incoming@patchwork.ozlabs.org; Mon, 24 May 2010 16:28:59 -0400 Received: from [140.186.70.92] (port=40883 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OGe2O-00016V-Hk for qemu-devel@nongnu.org; Mon, 24 May 2010 16:14:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OGe29-0000Cy-9i for qemu-devel@nongnu.org; Mon, 24 May 2010 16:14:12 -0400 Received: from fmmailgate02.web.de ([217.72.192.227]:46567) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OGe28-0000Cj-Tr for qemu-devel@nongnu.org; Mon, 24 May 2010 16:13:57 -0400 Received: from smtp05.web.de ( [172.20.4.166]) by fmmailgate02.web.de (Postfix) with ESMTP id 5FEE51627120C; Mon, 24 May 2010 22:13:56 +0200 (CEST) Received: from [88.65.39.229] (helo=localhost.localdomain) by smtp05.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #4) id 1OGe28-0004UY-01; Mon, 24 May 2010 22:13:56 +0200 From: Jan Kiszka To: qemu-devel@nongnu.org Date: Mon, 24 May 2010 22:13:39 +0200 Message-Id: X-Mailer: git-send-email 1.6.0.2 In-Reply-To: References: In-Reply-To: References: X-Sender: jan.kiszka@web.de X-Provags-ID: V01U2FsdGVkX18p26iT1056f3deuf5196cvNfIb/+7pb4ghnkdx vfiZLcmXqHVUSukHSsZgS+hbvG3E6uFxzzjRlrSo0AVG4GPZZy jJUeACn6w= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 Cc: blue Swirl , Jan Kiszka , Juan Quintela Subject: [Qemu-devel] [RFT][PATCH 06/15] hpet: Start/stop timer when HPET_TN_ENABLE is modified X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Jan Kiszka We have to update the qemu timer when the per-timer enable bit is toggled, just like for HPET_CFG_ENABLE changes. Signed-off-by: Jan Kiszka --- hw/hpet.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/hw/hpet.c b/hw/hpet.c index 6974935..041dd84 100644 --- a/hw/hpet.c +++ b/hw/hpet.c @@ -430,6 +430,11 @@ static void hpet_ram_writel(void *opaque, target_phys_addr_t addr, printf("qemu: level-triggered hpet not supported\n"); exit (-1); } + if (activating_bit(old_val, new_val, HPET_TN_ENABLE)) { + hpet_set_timer(timer); + } else if (deactivating_bit(old_val, new_val, HPET_TN_ENABLE)) { + hpet_del_timer(timer); + } break; case HPET_TN_CFG + 4: // Interrupt capabilities DPRINTF("qemu: invalid HPET_TN_CFG+4 write\n");