From patchwork Mon Mar 5 09:08:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 144635 X-Patchwork-Delegate: peter.maydell@linaro.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 73A30B6F98 for ; Mon, 5 Mar 2012 20:48:53 +1100 (EST) Received: from localhost ([::1]:49310 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S4TvD-0005vT-Qb for incoming@patchwork.ozlabs.org; Mon, 05 Mar 2012 04:09:35 -0500 Received: from eggs.gnu.org ([208.118.235.92]:45121) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S4Tud-0004hZ-R2 for qemu-devel@nongnu.org; Mon, 05 Mar 2012 04:09:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S4TuF-0002bk-Mj for qemu-devel@nongnu.org; Mon, 05 Mar 2012 04:08:59 -0500 Received: from mail-pz0-f46.google.com ([209.85.210.46]:55886) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S4TuF-0002b5-B3 for qemu-devel@nongnu.org; Mon, 05 Mar 2012 04:08:35 -0500 Received: by dajr28 with SMTP id r28so6111890daj.33 for ; Mon, 05 Mar 2012 01:08:33 -0800 (PST) Received-SPF: pass (google.com: domain of paolo.bonzini@gmail.com designates 10.68.211.168 as permitted sender) client-ip=10.68.211.168; Authentication-Results: mr.google.com; spf=pass (google.com: domain of paolo.bonzini@gmail.com designates 10.68.211.168 as permitted sender) smtp.mail=paolo.bonzini@gmail.com; dkim=pass header.i=paolo.bonzini@gmail.com Received: from mr.google.com ([10.68.211.168]) by 10.68.211.168 with SMTP id nd8mr46619655pbc.25.1330938513373 (num_hops = 1); Mon, 05 Mar 2012 01:08:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=Q269zqRTP7k8lueZWWNHgjPggp9A5OvLmFr/RJX35zI=; b=M20j60PsBjW91KMpKgEYEbmoPCDMls9SLJ3QeUJMFRck5mk89OW0moRJl7AurNfAvv 5Cl5dctkekLNTfoiq3bKXj3BqWqJGIGx1kefplca6FF74DpliUOyfRdOVDh2ZE1UdL3g oXmuiPdoYJMN4vqk7HGIUcpAwlX7bkrIgk9+4FZgqBUMHdh6LKElcHi3f0FImiYLOJNE otWHBnZ8aTDXZMc9EYOzPn3vrZKHlfwAvCuJXG96stIzFyryGhN+P9hvd1VGDoNcqDEy zXnvXk2h0T9qhxHXvnn1o6yCQRqNozF7wCMwJxxozMKcNtKlCMtKsebYuTxKlLueD2ns uG5g== Received: by 10.68.211.168 with SMTP id nd8mr39884876pbc.25.1330938513339; Mon, 05 Mar 2012 01:08:33 -0800 (PST) Received: from yakj.usersys.redhat.com (93-34-182-16.ip50.fastwebnet.it. [93.34.182.16]) by mx.google.com with ESMTPS id l8sm12838857pbi.0.2012.03.05.01.08.30 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 05 Mar 2012 01:08:32 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Mon, 5 Mar 2012 10:08:12 +0100 Message-Id: <1330938495-30573-3-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.7.7.6 In-Reply-To: <1330938495-30573-1-git-send-email-pbonzini@redhat.com> References: <1330938495-30573-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.210.46 Cc: peter.maydell@linaro.org Subject: [Qemu-devel] [PATCH v2 2/5] omap: switch omap_lpg to vm_clock X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The output of the pulse generator needs to be deterministic when running in -icount mode, and to remain constant whenever the VM is stopped. So the right clock to use is vm_clock. Signed-off-by: Paolo Bonzini --- hw/omap1.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/omap1.c b/hw/omap1.c index 1aa5f23..d19049a 100644 --- a/hw/omap1.c +++ b/hw/omap1.c @@ -3497,9 +3497,9 @@ static void omap_lpg_tick(void *opaque) struct omap_lpg_s *s = opaque; if (s->cycle) - qemu_mod_timer(s->tm, qemu_get_clock_ms(rt_clock) + s->period - s->on); + qemu_mod_timer(s->tm, qemu_get_clock_ms(vm_clock) + s->period - s->on); else - qemu_mod_timer(s->tm, qemu_get_clock_ms(rt_clock) + s->on); + qemu_mod_timer(s->tm, qemu_get_clock_ms(vm_clock) + s->on); s->cycle = !s->cycle; printf("%s: LED is %s\n", __FUNCTION__, s->cycle ? "on" : "off"); @@ -3617,7 +3617,7 @@ static struct omap_lpg_s *omap_lpg_init(MemoryRegion *system_memory, struct omap_lpg_s *s = (struct omap_lpg_s *) g_malloc0(sizeof(struct omap_lpg_s)); - s->tm = qemu_new_timer_ms(rt_clock, omap_lpg_tick, s); + s->tm = qemu_new_timer_ms(vm_clock, omap_lpg_tick, s); omap_lpg_reset(s);