From mboxrd@z Thu Jan 1 00:00:00 1970 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) Sender: Paolo Bonzini From: Paolo Bonzini Date: Mon, 5 Mar 2012 10:08:12 +0100 Message-Id: <1330938495-30573-3-git-send-email-pbonzini@redhat.com> In-Reply-To: <1330938495-30573-1-git-send-email-pbonzini@redhat.com> References: <1330938495-30573-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH v2 2/5] omap: switch omap_lpg to vm_clock List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.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); -- 1.7.7.6