From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=39602 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OWALi-0006YJ-Bh for qemu-devel@nongnu.org; Tue, 06 Jul 2010 11:46:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OWALf-0002PD-U1 for qemu-devel@nongnu.org; Tue, 06 Jul 2010 11:46:17 -0400 Received: from mail-pz0-f45.google.com ([209.85.210.45]:56022) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OWALf-0002P0-Pi for qemu-devel@nongnu.org; Tue, 06 Jul 2010 11:46:15 -0400 Received: by pzk10 with SMTP id 10so453824pzk.4 for ; Tue, 06 Jul 2010 08:46:14 -0700 (PDT) Message-ID: <4C334FC0.9000507@codemonkey.ws> Date: Tue, 06 Jul 2010 10:46:08 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] make rtc alatm work References: <20100705083634.GL4689@redhat.com> In-Reply-To: <20100705083634.GL4689@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gleb Natapov Cc: qemu-devel@nongnu.org On 07/05/2010 03:36 AM, Gleb Natapov wrote: > Convert alarm time from BCD if needed before comparing with current > time. > > Signed-off-by: Gleb Natapov > Applied. Thanks. Regards, Anthony Liguori > diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c > index c3459bf..2b91fa8 100644 > --- a/hw/mc146818rtc.c > +++ b/hw/mc146818rtc.c > @@ -214,7 +214,6 @@ static void cmos_ioport_write(void *opaque, uint32_t addr, uint32_t data) > case RTC_SECONDS_ALARM: > case RTC_MINUTES_ALARM: > case RTC_HOURS_ALARM: > - /* XXX: not supported */ > s->cmos_data[s->cmos_index] = data; > break; > case RTC_SECONDS: > @@ -414,11 +413,11 @@ static void rtc_update_second2(void *opaque) > /* check alarm */ > if (s->cmos_data[RTC_REG_B]& REG_B_AIE) { > if (((s->cmos_data[RTC_SECONDS_ALARM]& 0xc0) == 0xc0 || > - s->cmos_data[RTC_SECONDS_ALARM] == s->current_tm.tm_sec)&& > + rtc_from_bcd(s, s->cmos_data[RTC_SECONDS_ALARM]) == s->current_tm.tm_sec)&& > ((s->cmos_data[RTC_MINUTES_ALARM]& 0xc0) == 0xc0 || > - s->cmos_data[RTC_MINUTES_ALARM] == s->current_tm.tm_mon)&& > + rtc_from_bcd(s, s->cmos_data[RTC_MINUTES_ALARM]) == s->current_tm.tm_min)&& > ((s->cmos_data[RTC_HOURS_ALARM]& 0xc0) == 0xc0 || > - s->cmos_data[RTC_HOURS_ALARM] == s->current_tm.tm_hour)) { > + rtc_from_bcd(s, s->cmos_data[RTC_HOURS_ALARM]) == s->current_tm.tm_hour)) { > > s->cmos_data[RTC_REG_C] |= 0xa0; > qemu_irq_raise(s->irq); > -- > Gleb. > > >