summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2011-10-07 09:19:43 +0200
committerBlue Swirl <blauwirbel@gmail.com>2011-10-16 11:11:04 +0000
commit78ef2b6989fb20eb7eee3a5cef66655ea1d19175 (patch)
treecc5de0af3a3376efe8e14bb68deb486f980b676b /hw
parentafdb06f84920c4949da904b045cdd105caf2579c (diff)
downloadqemu-78ef2b6989fb20eb7eee3a5cef66655ea1d19175.tar.gz
qemu-78ef2b6989fb20eb7eee3a5cef66655ea1d19175.tar.bz2
qemu-78ef2b6989fb20eb7eee3a5cef66655ea1d19175.zip
i8259: Reorder intack in pic_read_irq
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 <jan.kiszka@siemens.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/i8259.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/hw/i8259.c b/hw/i8259.c
index cddd3c769e..b7a011fb69 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,