[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 14/23] i8259: Fix poll command
From: |
Jan Kiszka |
Subject: |
[Qemu-devel] [PATCH v2 14/23] i8259: Fix poll command |
Date: |
Fri, 7 Oct 2011 09:19:47 +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 bb257e6..31962c0 100644
--- a/hw/i8259.c
+++ b/hw/i8259.c
@@ -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) {
--
1.7.3.4
- [Qemu-devel] [PATCH v2 05/23] i8259: Remove premature inline function attributes, (continued)
- [Qemu-devel] [PATCH v2 05/23] i8259: Remove premature inline function attributes, Jan Kiszka, 2011/10/07
- [Qemu-devel] [PATCH v2 06/23] i8259: Drop obsolete prototypes, Jan Kiszka, 2011/10/07
- [Qemu-devel] [PATCH v2 04/23] pc: Fix and clean up PIC-to-APIC IRQ path, Jan Kiszka, 2011/10/07
- [Qemu-devel] [PATCH v2 08/23] i8239: Introduce per-PIC output interrupt, Jan Kiszka, 2011/10/07
- [Qemu-devel] [PATCH v2 07/23] i8259: Move pic_set_irq1 after pic_update_irq, Jan Kiszka, 2011/10/07
- [Qemu-devel] [PATCH v2 11/23] i8259: Update IRQ state after reset, Jan Kiszka, 2011/10/07
- [Qemu-devel] [PATCH v2 10/23] i8259: Reorder intack in pic_read_irq, Jan Kiszka, 2011/10/07
- [Qemu-devel] [PATCH v2 09/23] i8259: Do not update IRQ output after spurious pic_poll_read, Jan Kiszka, 2011/10/07
- [Qemu-devel] [PATCH v2 13/23] i8259: Switch to per-PIC IRQ update, Jan Kiszka, 2011/10/07
- [Qemu-devel] [PATCH v2 15/23] i8259: Clean up pic_ioport_read, Jan Kiszka, 2011/10/07
- [Qemu-devel] [PATCH v2 14/23] i8259: Fix poll command,
Jan Kiszka <=
- [Qemu-devel] [PATCH v2 17/23] i8259: Replace PicState::pics_state with master flag, Jan Kiszka, 2011/10/07
- [Qemu-devel] [PATCH v2 12/23] i8259: Clear ELCR on reset, Jan Kiszka, 2011/10/07
- [Qemu-devel] [PATCH v2 02/23] pc: Generalize ISA IRQs to GSIs, Jan Kiszka, 2011/10/07
- [Qemu-devel] [PATCH v2 19/23] qdev: Add HEX8 property, Jan Kiszka, 2011/10/07
- [Qemu-devel] [PATCH v2 16/23] i8259: PREP: Replace pic_intack_read with pic_read_irq, Jan Kiszka, 2011/10/07
- [Qemu-devel] [PATCH v2 21/23] i8259: Fix coding style, Jan Kiszka, 2011/10/07
- [Qemu-devel] [PATCH v2 22/23] monitor: Restrict pic/irq_info to supporting targets, Jan Kiszka, 2011/10/07