提交 78ef2b69 编写于 作者: J Jan Kiszka 提交者: Blue Swirl

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: NJan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
上级 afdb06f8
...@@ -228,7 +228,6 @@ int pic_read_irq(PicState2 *s) ...@@ -228,7 +228,6 @@ int pic_read_irq(PicState2 *s)
irq = pic_get_irq(&s->pics[0]); irq = pic_get_irq(&s->pics[0]);
if (irq >= 0) { if (irq >= 0) {
pic_intack(&s->pics[0], irq);
if (irq == 2) { if (irq == 2) {
irq2 = pic_get_irq(&s->pics[1]); irq2 = pic_get_irq(&s->pics[1]);
if (irq2 >= 0) { if (irq2 >= 0) {
...@@ -238,12 +237,10 @@ int pic_read_irq(PicState2 *s) ...@@ -238,12 +237,10 @@ int pic_read_irq(PicState2 *s)
irq2 = 7; irq2 = 7;
} }
intno = s->pics[1].irq_base + irq2; intno = s->pics[1].irq_base + irq2;
#if defined(DEBUG_PIC) || defined(DEBUG_IRQ_LATENCY)
irq = irq2 + 8;
#endif
} else { } else {
intno = s->pics[0].irq_base + irq; intno = s->pics[0].irq_base + irq;
} }
pic_intack(&s->pics[0], irq);
} else { } else {
/* spurious IRQ on host controller */ /* spurious IRQ on host controller */
irq = 7; irq = 7;
...@@ -251,6 +248,11 @@ int pic_read_irq(PicState2 *s) ...@@ -251,6 +248,11 @@ int pic_read_irq(PicState2 *s)
} }
pic_update_irq(s); pic_update_irq(s);
#if defined(DEBUG_PIC) || defined(DEBUG_IRQ_LATENCY)
if (irq == 2) {
irq = irq2 + 8;
}
#endif
#ifdef DEBUG_IRQ_LATENCY #ifdef DEBUG_IRQ_LATENCY
printf("IRQ%d latency=%0.3fus\n", printf("IRQ%d latency=%0.3fus\n",
irq, irq,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册