[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 10/22] i8259: Reorder intack in pic_read_irq
From: |
Jan Kiszka |
Subject: |
[Qemu-devel] [PATCH 10/22] i8259: Reorder intack in pic_read_irq |
Date: |
Wed, 28 Sep 2011 13:00:56 +0200 |
As we want to move the IRQ update to pic_intack, ordering matters: the
slave ack must be executed before the master ack to avoid missing
further pending slave IRQs.
Signed-off-by: Jan Kiszka <address@hidden>
---
hw/i8259.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/hw/i8259.c b/hw/i8259.c
index cddd3c7..b7a011f 100644
--- a/hw/i8259.c
+++ b/hw/i8259.c
@@ -228,7 +228,6 @@ int pic_read_irq(PicState2 *s)
irq = pic_get_irq(&s->pics[0]);
if (irq >= 0) {
- pic_intack(&s->pics[0], irq);
if (irq == 2) {
irq2 = pic_get_irq(&s->pics[1]);
if (irq2 >= 0) {
@@ -238,12 +237,10 @@ int pic_read_irq(PicState2 *s)
irq2 = 7;
}
intno = s->pics[1].irq_base + irq2;
-#if defined(DEBUG_PIC) || defined(DEBUG_IRQ_LATENCY)
- irq = irq2 + 8;
-#endif
} else {
intno = s->pics[0].irq_base + irq;
}
+ pic_intack(&s->pics[0], irq);
} else {
/* spurious IRQ on host controller */
irq = 7;
@@ -251,6 +248,11 @@ int pic_read_irq(PicState2 *s)
}
pic_update_irq(s);
+#if defined(DEBUG_PIC) || defined(DEBUG_IRQ_LATENCY)
+ if (irq == 2) {
+ irq = irq2 + 8;
+ }
+#endif
#ifdef DEBUG_IRQ_LATENCY
printf("IRQ%d latency=%0.3fus\n",
irq,
--
1.7.3.4
- [Qemu-devel] [PATCH 00/22] Rework i8259 and PC interrupt models, Jan Kiszka, 2011/09/28
- [Qemu-devel] [PATCH 06/22] i8259: Drop obsolete prototypes, Jan Kiszka, 2011/09/28
- [Qemu-devel] [PATCH 05/22] i8259: Remove premature inline function attributes, Jan Kiszka, 2011/09/28
- [Qemu-devel] [PATCH 22/22] i8259: Move to hw library, Jan Kiszka, 2011/09/28
- [Qemu-devel] [PATCH 20/22] i8259: Fix coding style, Jan Kiszka, 2011/09/28
- [Qemu-devel] [PATCH 10/22] i8259: Reorder intack in pic_read_irq,
Jan Kiszka <=
- [Qemu-devel] [PATCH 16/22] i8259: Replace PicState::pics_state with master flag, Jan Kiszka, 2011/09/28
- [Qemu-devel] [PATCH 04/22] pc: Fix and clean up PIC-to-APIC IRQ path, Jan Kiszka, 2011/09/28
- [Qemu-devel] [PATCH 18/22] qdev: Add HEX8 property, Jan Kiszka, 2011/09/28
- [Qemu-devel] [PATCH 07/22] i8259: Move pic_set_irq1 after pic_update_irq, Jan Kiszka, 2011/09/28
- [Qemu-devel] [PATCH 08/22] i8239: Introduce per-PIC output interrupt, Jan Kiszka, 2011/09/28
- [Qemu-devel] [PATCH 19/22] i8259: Convert to qdev, Jan Kiszka, 2011/09/28
- [Qemu-devel] [PATCH 03/22] pc: Convert GSIState::i8259_irq into array, Jan Kiszka, 2011/09/28
- [Qemu-devel] [PATCH 14/22] i8259: Clean up pic_ioport_read, Jan Kiszka, 2011/09/28
- [Qemu-devel] [PATCH 01/22] pc: Drop useless test from isa_irq_handler, Jan Kiszka, 2011/09/28
- [Qemu-devel] [PATCH 21/22] monitor: Restrict pic/irq_info to supporting targets, Jan Kiszka, 2011/09/28