Skip to content
Snippets Groups Projects
Commit 01757b59 authored by Armin Luntzer's avatar Armin Luntzer
Browse files

IRQ: pass irq number in call to handler

parent a3ce393e
No related branches found
No related tags found
No related merge requests found
......@@ -424,6 +424,10 @@ static int leon_irq_queue(struct irl_vector_elem *p_elem)
/**
*
* @brief execute deferred (low-priority) handlers
*
* @note see todo
* @todo TODO we do not track deferred handler IRQ numbers, so we'll just
* pass -1 for now and hope the user knows what he's doing -.-
*/
void leon_irq_queue_execute(void)
......@@ -442,7 +446,7 @@ void leon_irq_queue_execute(void)
if (likely(p_elem->handler)) {
if (p_elem->handler(p_elem->data))
if (p_elem->handler(-1, p_elem->data))
leon_irq_queue(p_elem);
else
list_add_tail(&p_elem->handler_node,
......@@ -480,9 +484,9 @@ static int leon_irq_dispatch(unsigned int irq)
list_for_each_entry(p_elem, &irl_vector[irq], handler_node) {
if (likely(p_elem->priority == ISR_PRIORITY_NOW))
p_elem->handler(p_elem->data);
p_elem->handler(irq, p_elem->data);
else if (leon_irq_queue(p_elem) < 0)
p_elem->handler(p_elem->data);
p_elem->handler(irq, p_elem->data);
}
return 0;
......@@ -557,9 +561,9 @@ static int leon_eirq_dispatch(unsigned int irq)
* queueing fails
*/
if (likely(p_elem->priority == ISR_PRIORITY_NOW))
p_elem->handler(p_elem->data);
p_elem->handler(eirq, p_elem->data);
else if (leon_irq_queue(p_elem) < 0)
p_elem->handler(p_elem->data);
p_elem->handler(eirq, p_elem->data);
}
}
......
......@@ -29,7 +29,7 @@ enum irqreturn {
typedef enum irqreturn irqreturn_t;
typedef irqreturn_t (*irq_handler_t)(void *);
typedef irqreturn_t (*irq_handler_t)(unsigned int irq, void *);
enum isr_exec_priority {ISR_PRIORITY_NOW, ISR_PRIORITY_DEFERRED};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment