提交 98815437 编写于 作者: B Bernhard Kauer 提交者: Anthony Liguori

RTC polling mode broken

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: NBernhard Kauer <kauer@tudos.org>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 e09a5267
......@@ -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 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册