From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:40871) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RrwvB-0004DJ-I0 for qemu-devel@nongnu.org; Mon, 30 Jan 2012 14:29:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rrwv5-0001rY-D8 for qemu-devel@nongnu.org; Mon, 30 Jan 2012 14:29:45 -0500 Received: from mail-iy0-f173.google.com ([209.85.210.173]:37534) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rrwv5-0001rP-1q for qemu-devel@nongnu.org; Mon, 30 Jan 2012 14:29:39 -0500 Received: by iahk25 with SMTP id k25so7189909iah.4 for ; Mon, 30 Jan 2012 11:29:38 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1327061100-9286-1-git-send-email-pbonzini@redhat.com> References: <1327061100-9286-1-git-send-email-pbonzini@redhat.com> From: Blue Swirl Date: Mon, 30 Jan 2012 19:29:18 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] m48t59: use rtc_clock for alarm timer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org, =?UTF-8?Q?Andreas_F=C3=A4rber?= Thanks, applied. On Fri, Jan 20, 2012 at 12:05, Paolo Bonzini wrote: > This lets the RTC get adjustments from the host NTP client. > The watchdog still uses the vm_clock. =C2=A0The previous behavior is > available with "-rtc clock=3Dvm". > > Cc: Andreas F=C3=A4rber > Signed-off-by: Paolo Bonzini > --- > =C2=A0hw/m48t59.c | =C2=A0 =C2=A04 ++-- > =C2=A01 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/hw/m48t59.c b/hw/m48t59.c > index c043996..fd5dc00 100644 > --- a/hw/m48t59.c > +++ b/hw/m48t59.c > @@ -126,7 +126,7 @@ static void alarm_cb (void *opaque) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 /* Repeat once a second */ > =C2=A0 =C2=A0 =C2=A0 =C2=A0 next_time =3D 1; > =C2=A0 =C2=A0 } > - =C2=A0 =C2=A0qemu_mod_timer(NVRAM->alrm_timer, qemu_get_clock_ns(vm_clo= ck) + > + =C2=A0 =C2=A0qemu_mod_timer(NVRAM->alrm_timer, qemu_get_clock_ns(rtc_cl= ock) + > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 nex= t_time * 1000); > =C2=A0 =C2=A0 qemu_set_irq(NVRAM->IRQ, 0); > =C2=A0} > @@ -687,7 +687,7 @@ static void m48t59_init_common(M48t59State *s) > =C2=A0{ > =C2=A0 =C2=A0 s->buffer =3D g_malloc0(s->size); > =C2=A0 =C2=A0 if (s->type =3D=3D 59) { > - =C2=A0 =C2=A0 =C2=A0 =C2=A0s->alrm_timer =3D qemu_new_timer_ns(vm_clock= , &alarm_cb, s); > + =C2=A0 =C2=A0 =C2=A0 =C2=A0s->alrm_timer =3D qemu_new_timer_ns(rtc_cloc= k, &alarm_cb, s); > =C2=A0 =C2=A0 =C2=A0 =C2=A0 s->wd_timer =3D qemu_new_timer_ns(vm_clock, &= watchdog_cb, s); > =C2=A0 =C2=A0 } > =C2=A0 =C2=A0 qemu_get_timedate(&s->alarm, 0); > -- > 1.7.7.1 > >