From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:45879) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSYAg-0006b0-4y for qemu-devel@nongnu.org; Mon, 21 Nov 2011 13:00:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RSYAe-0006rp-RE for qemu-devel@nongnu.org; Mon, 21 Nov 2011 13:00:46 -0500 Received: from mail-qw0-f45.google.com ([209.85.216.45]:61284) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RSYAe-0006rE-NI for qemu-devel@nongnu.org; Mon, 21 Nov 2011 13:00:44 -0500 Received: by mail-qw0-f45.google.com with SMTP id g14so494838qab.4 for ; Mon, 21 Nov 2011 10:00:44 -0800 (PST) Sender: Paolo Bonzini From: Paolo Bonzini Date: Mon, 21 Nov 2011 19:00:29 +0100 Message-Id: <1321898431-18449-3-git-send-email-pbonzini@redhat.com> In-Reply-To: <1321898431-18449-1-git-send-email-pbonzini@redhat.com> References: <1321898431-18449-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 2/4] rtc: raise AF bit when the alarm is encountered but AIE=0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Signed-off-by: Paolo Bonzini --- hw/mc146818rtc.c | 19 ++++++++++--------- 1 files changed, 10 insertions(+), 9 deletions(-) diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c index 14c8cb9..a5c533b 100644 --- a/hw/mc146818rtc.c +++ b/hw/mc146818rtc.c @@ -427,16 +427,17 @@ 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 || - rtc_from_bcd(s, s->cmos_data[RTC_SECONDS_ALARM]) == s->current_tm.tm_sec) && - ((s->cmos_data[RTC_MINUTES_ALARM] & 0xc0) == 0xc0 || - rtc_from_bcd(s, s->cmos_data[RTC_MINUTES_ALARM]) == s->current_tm.tm_min) && - ((s->cmos_data[RTC_HOURS_ALARM] & 0xc0) == 0xc0 || - rtc_from_bcd(s, s->cmos_data[RTC_HOURS_ALARM]) == s->current_tm.tm_hour)) { - - s->cmos_data[RTC_REG_C] |= 0xa0; + if (((s->cmos_data[RTC_SECONDS_ALARM] & 0xc0) == 0xc0 || + rtc_from_bcd(s, s->cmos_data[RTC_SECONDS_ALARM]) == s->current_tm.tm_sec) && + ((s->cmos_data[RTC_MINUTES_ALARM] & 0xc0) == 0xc0 || + rtc_from_bcd(s, s->cmos_data[RTC_MINUTES_ALARM]) == s->current_tm.tm_min) && + ((s->cmos_data[RTC_HOURS_ALARM] & 0xc0) == 0xc0 || + rtc_from_bcd(s, s->cmos_data[RTC_HOURS_ALARM]) == s->current_tm.tm_hour)) { + + s->cmos_data[RTC_REG_C] |= REG_C_AF; + if (s->cmos_data[RTC_REG_B] & REG_B_AIE) { qemu_irq_raise(s->irq); + s->cmos_data[RTC_REG_C] |= REG_C_IRQF; } } -- 1.7.7.1