_irq_handler_set: don't require old function as parameter
This was kept around since it used to be necessary for x86, and we want our APIs to keep partity across arches, but with the x86 IRQ refactoring this is no longer needed. Change-Id: Iacd61f4c4d3cc33b4a15bfa083e106ba6d5da942 Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
39dceb21f6
commit
8397dc5028
2 changed files with 10 additions and 31 deletions
|
@ -38,27 +38,18 @@ extern void __reserved(void);
|
|||
*
|
||||
* @brief Replace an interrupt handler by another
|
||||
*
|
||||
* An interrupt's ISR can be replaced at runtime. Care must be taken that the
|
||||
* interrupt is disabled before doing this.
|
||||
*
|
||||
* This routine will hang if <old> is not found in the table and ASSERT_ON is
|
||||
* enabled.
|
||||
* An interrupt's ISR can be replaced at runtime.
|
||||
*
|
||||
* @return N/A
|
||||
*/
|
||||
void _irq_handler_set(unsigned int irq,
|
||||
void (*old)(void *arg),
|
||||
void (*new)(void *arg),
|
||||
void *arg)
|
||||
{
|
||||
int key = irq_lock();
|
||||
|
||||
__ASSERT(old == _sw_isr_table[irq].isr, "expected ISR not found in table");
|
||||
|
||||
if (old == _sw_isr_table[irq].isr) {
|
||||
_sw_isr_table[irq].isr = new;
|
||||
_sw_isr_table[irq].arg = arg;
|
||||
}
|
||||
_sw_isr_table[irq].isr = new;
|
||||
_sw_isr_table[irq].arg = arg;
|
||||
|
||||
irq_unlock(key);
|
||||
}
|
||||
|
@ -150,7 +141,7 @@ int irq_connect(unsigned int irq,
|
|||
void (*isr)(void *arg),
|
||||
void *arg)
|
||||
{
|
||||
_irq_handler_set(irq, _irq_spurious, isr, arg);
|
||||
_irq_handler_set(irq, isr, arg);
|
||||
_irq_priority_set(irq, prio);
|
||||
return irq;
|
||||
}
|
||||
|
@ -169,5 +160,5 @@ int irq_connect(unsigned int irq,
|
|||
*/
|
||||
void _irq_disconnect(unsigned int irq)
|
||||
{
|
||||
_irq_handler_set(irq, _sw_isr_table[irq].isr, _irq_spurious, NULL);
|
||||
_irq_handler_set(irq, _irq_spurious, NULL);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue