[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] [RESEND] RTC polling mode broken
From: |
Bernhard Kauer |
Subject: |
[Qemu-devel] [PATCH] [RESEND] RTC polling mode broken |
Date: |
Wed, 2 Sep 2009 09:49:05 +0200 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
The RTC emulation does not set the IRQ flags independent of the IRQ enable bits.
The original MC146818A datasheet from 1984 notes:
"flag bits in Register C [...] are set independent of the
state of the corresponding enable bits in Register B"
Similar sections can be found in newer documentation e.g. in rtc82885.
Qemu and Bochs set the IRQ flags only if they are enabled,
which breaks drivers polling on them.
The following patch corrects this for the update-ended-flag in Qemu only.
It does not fix the handling of the other flags.
Signed-off-by: Bernhard Kauer <address@hidden>
diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c
index 2022548..2b040a7 100644
--- a/hw/mc146818rtc.c
+++ b/hw/mc146818rtc.c
@@ -421,9 +421,10 @@ static void rtc_update_second2(void *opaque)
}
/* update ended interrupt */
+ s->cmos_data[RTC_REG_C] |= REG_C_UF;
if (s->cmos_data[RTC_REG_B] & REG_B_UIE) {
- s->cmos_data[RTC_REG_C] |= 0x90;
- rtc_irq_raise(s->irq);
+ s->cmos_data[RTC_REG_C] |= REG_C_IRQF;
+ rtc_irq_raise(s->irq);
}
/* clear update in progress bit */
- [Qemu-devel] [PATCH] [RESEND] RTC polling mode broken,
Bernhard Kauer <=
- [Qemu-devel] [PATCH] [RESEND2] Qemu unmaintained?, Bernhard Kauer, 2009/09/09
- Re: [Qemu-devel] [PATCH] [RESEND2] Qemu unmaintained?, Amit Shah, 2009/09/09
- Re: [Qemu-devel] [PATCH] [RESEND2] Qemu unmaintained?, Kevin Wolf, 2009/09/09
- Re: [Qemu-devel] [PATCH] [RESEND2] Qemu unmaintained?, Anthony Liguori, 2009/09/09
- Re: [Qemu-devel] [PATCH] [RESEND2] Qemu unmaintained?, Bernhard Kauer, 2009/09/09
- Re: [Qemu-devel] [PATCH] [RESEND2] Qemu unmaintained?, Amit Shah, 2009/09/10