[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 13/22] i8259: Fix poll command
From: |
Jan Kiszka |
Subject: |
[Qemu-devel] [PATCH 13/22] i8259: Fix poll command |
Date: |
Wed, 28 Sep 2011 13:00:59 +0200 |
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: Jan Kiszka <address@hidden>
---
hw/i8259.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/hw/i8259.c b/hw/i8259.c
index 53b86dd..849c82e 100644
--- a/hw/i8259.c
+++ b/hw/i8259.c
@@ -388,7 +388,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) {
--
1.7.3.4
- Re: [Qemu-devel] [PATCH 11/22] i8259: Update IRQ state after reset, (continued)
- Re: [Qemu-devel] [PATCH 11/22] i8259: Update IRQ state after reset, Jan Kiszka, 2011/09/28
- Re: [Qemu-devel] [PATCH 11/22] i8259: Update IRQ state after reset, Blue Swirl, 2011/09/29
- Re: [Qemu-devel] [PATCH 11/22] i8259: Update IRQ state after reset, Jan Kiszka, 2011/09/30
- Re: [Qemu-devel] [PATCH 11/22] i8259: Update IRQ state after reset, Peter Maydell, 2011/09/30
- Re: [Qemu-devel] [PATCH 11/22] i8259: Update IRQ state after reset, Blue Swirl, 2011/09/30
- Re: [Qemu-devel] [PATCH 11/22] i8259: Update IRQ state after reset, Blue Swirl, 2011/09/30
[Qemu-devel] [PATCH 15/22] i8259: PREP: Replace pic_intack_read with pic_read_irq, Jan Kiszka, 2011/09/28
[Qemu-devel] [PATCH 09/22] i8259: Do not update IRQ output after spurious pic_poll_read, Jan Kiszka, 2011/09/28
[Qemu-devel] [PATCH 02/22] pc: Generalize ISA IRQs to GSIs, Jan Kiszka, 2011/09/28
[Qemu-devel] [PATCH 13/22] i8259: Fix poll command,
Jan Kiszka <=
[Qemu-devel] [PATCH 12/22] i8259: Switch to per-PIC IRQ update, Jan Kiszka, 2011/09/28
Re: [Qemu-devel] [PATCH 00/22] Rework i8259 and PC interrupt models, Richard Henderson, 2011/09/28