Do not EOI an interrupt until the point after the filter handlers / before

threaded handlers.

It's not easy to see from the diffs of this change exactly how it
accomplishes the above.  The arm_mask_irq() and arm_unmask_irq() functions
are, respectively, the pre_thread and post_thread hooks.  Not seen in
these diffs, the arm_post_filter() routine also EOIs.  The post_filter
routine runs after filter handlers if there will be no threaded handlers,
so it just EOIs.  The pre_thread routine masks the interrupt (at the
controller, not the source) and EOIs.  So one way or another, the EOI
happens at the point where filter handlers are done.
This commit is contained in:
Ian Lepore 2013-10-31 03:23:25 +00:00
parent adcea15135
commit 425a5c7900

View File

@ -271,7 +271,6 @@ arm_get_next_irq(int last_irq)
printf("Spurious interrupt detected [0x%08x]\n", active_irq);
return -1;
}
gic_c_write_4(GICC_EOIR, active_irq);
return active_irq;
}
@ -279,14 +278,15 @@ arm_get_next_irq(int last_irq)
void
arm_mask_irq(uintptr_t nb)
{
gic_d_write_4(GICD_ICENABLER(nb >> 5), (1UL << (nb & 0x1F)));
gic_c_write_4(GICC_EOIR, nb);
}
void
arm_unmask_irq(uintptr_t nb)
{
gic_c_write_4(GICC_EOIR, nb);
gic_d_write_4(GICD_ISENABLER(nb >> 5), (1UL << (nb & 0x1F)));
}