From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 2/4] rtc: raise AF bit when the alarm is encountered but AIE=0
Date: Mon, 21 Nov 2011 19:00:29 +0100 [thread overview]
Message-ID: <1321898431-18449-3-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1321898431-18449-1-git-send-email-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
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
next prev parent reply other threads:[~2011-11-21 18:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-21 18:00 [Qemu-devel] [PATCH 0/4] Fixes to the rtc device model Paolo Bonzini
2011-11-21 18:00 ` [Qemu-devel] [PATCH 1/4] rtc: fix 12-hour mode Paolo Bonzini
2011-11-22 6:39 ` Mark Wu
2011-11-22 7:30 ` Paolo Bonzini
2012-01-01 14:53 ` Avi Kivity
2012-01-01 19:53 ` Paolo Bonzini
2011-11-21 18:00 ` Paolo Bonzini [this message]
2011-11-21 18:00 ` [Qemu-devel] [PATCH 3/4] rtc: raise PF bit when the periodic timer triggers but PIE=0 Paolo Bonzini
2011-11-21 18:00 ` [Qemu-devel] [PATCH 4/4] rtc: clear non-PF bits when reinjecting on ack Paolo Bonzini
2011-12-30 15:58 ` [Qemu-devel] [PATCH 0/4] Fixes to the rtc device model Paolo Bonzini
2012-01-13 15:54 ` Paolo Bonzini
2012-01-13 16:54 ` Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1321898431-18449-3-git-send-email-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).