提交 8d484caa 编写于 作者: J Jan Kiszka 提交者: Blue Swirl

i8259: Fix poll command

This was probably never used so far: According to the spec, polling
means ack'ing the pending IRQ and setting its corresponding bit in isr.
Moreover, we have to signal a pending IRQ via bit 7 of the returned
value, and we must not return a spurious IRQ if none is pending.

This implements the poll command without the help of pic_poll_read which
is left untouched as pic_intack_read is still using it.
Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
上级 b76750c1
......@@ -393,7 +393,13 @@ static uint64_t pic_ioport_read(void *opaque, target_phys_addr_t addr1,
int ret;
if (s->poll) {
ret = pic_poll_read(s);
ret = pic_get_irq(s);
if (ret >= 0) {
pic_intack(s, ret);
ret |= 0x80;
} else {
ret = 0;
}
s->poll = 0;
} else {
if (addr == 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册