Skip to content

Commit f313788

Browse files
midnightveilIvan-Velickovic
authored andcommitted
libmicrokit: ack all IRQs (workaround seL4/#1536)
There is a subtle race condition in the way that seL4 sets up IRQs: seL4/seL4#1536. This removes the need for every driver to manually do something equivalent, as we have needed in sDDF. Signed-off-by: Julia Vassiliki <julia.vassiliki@unsw.edu.au>
1 parent f6342a6 commit f313788

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

libmicrokit/src/main.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,23 @@ static void handler_loop(void)
6969
bool have_reply = false;
7070
seL4_MessageInfo_t reply_tag;
7171

72+
/**
73+
* Because of https://github.com/seL4/seL4/issues/1536
74+
* let's acknowledge all the IRQs after we've started.
75+
*/
76+
{
77+
seL4_Word irqs_to_ack = microkit_irqs;
78+
unsigned int idx = 0;
79+
do {
80+
if (irqs_to_ack & 1) {
81+
microkit_irq_ack(idx);
82+
}
83+
84+
irqs_to_ack >>= 1;
85+
idx++;
86+
} while (irqs_to_ack != 0);
87+
}
88+
7289
for (;;) {
7390
seL4_Word badge;
7491
seL4_MessageInfo_t tag;

0 commit comments

Comments
 (0)