summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2011-11-21 19:00:29 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2012-01-13 10:20:49 -0600
commiteea86673608692c2345cfb3edd72eb9958adad7f (patch)
treed64ea960c54691e49184769d1937801294d4f66a
parent3b89eb43b66eec34277fddfce610ac1ec7c78dba (diff)
downloadqemu-eea86673608692c2345cfb3edd72eb9958adad7f.tar.gz
rtc: raise AF bit when the alarm is encountered but AIE=0
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r--hw/mc146818rtc.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c
index 65ed779045..c482d3f3f5 100644
--- a/hw/mc146818rtc.c
+++ b/hw/mc146818rtc.c
@@ -425,16 +425,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;
}
}