Skip to content

Commit

Permalink
Catch and handle failure to allocate IRQ
Browse files Browse the repository at this point in the history
If an IRQ handler cannot be allocated for a driver, the failure should
be treated as an error rather than silently dropped.

Partially fix for #25

Signed-off-by: Curtis Millar <[email protected]>
  • Loading branch information
xurtis committed Sep 9, 2020
1 parent 6c1269b commit ffefb10
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions apps/sel4test-driver/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -556,8 +556,9 @@ static irq_id_t sel4test_timer_irq_register(UNUSED void *cookie, ps_irq_t irq, i
ZF_LOGF_IF(num_timer_irqs >= MAX_TIMER_IRQS, "Trying to register too many timer IRQs");

/* Allocate the IRQ */
seL4_Error serror = sel4platsupport_copy_irq_cap(&env.vka, &env.simple, &irq,
&env.timer_irqs[num_timer_irqs].handler_path);
error = sel4platsupport_copy_irq_cap(&env.vka, &env.simple, &irq,
&env.timer_irqs[num_timer_irqs].handler_path);
ZF_LOGF_IF(error, "Failed to allocate IRQ handler");

/* Allocate the root notifitcation if we haven't already done so */
if (env.timer_notification.cptr == seL4_CapNull) {
Expand Down

0 comments on commit ffefb10

Please sign in to comment.