From 8397dc50285cf2d7989ef231e9614a135da8ec73 Mon Sep 17 00:00:00 2001 From: Andrew Boie Date: Mon, 26 Oct 2015 15:46:34 -0700 Subject: [PATCH] _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 --- arch/arc/core/irq_manage.c | 22 +++++----------------- arch/arm/core/irq_manage.c | 19 +++++-------------- 2 files changed, 10 insertions(+), 31 deletions(-) diff --git a/arch/arc/core/irq_manage.c b/arch/arc/core/irq_manage.c index 9e1f5f09296..fcc313ff734 100644 --- a/arch/arc/core/irq_manage.c +++ b/arch/arc/core/irq_manage.c @@ -42,18 +42,13 @@ * * @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 @a 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 ) @@ -61,13 +56,8 @@ void _irq_handler_set( int key = irq_lock(); int index = irq - 16; - __ASSERT(old == _sw_isr_table[index].isr, - "expected ISR not found in table"); - - if (old == _sw_isr_table[index].isr) { - _sw_isr_table[index].isr = new; - _sw_isr_table[index].arg = arg; - } + _sw_isr_table[index].isr = new; + _sw_isr_table[index].arg = arg; irq_unlock(key); } @@ -172,7 +162,7 @@ int irq_connect( void *arg ) { - _irq_handler_set(irq, _irq_spurious, isr, arg); + _irq_handler_set(irq, isr, arg); _irq_priority_set(irq, prio); return irq; } @@ -191,7 +181,5 @@ int irq_connect( void _irq_disconnect(unsigned int irq) { - int index = irq - 16; - - _irq_handler_set(irq, _sw_isr_table[index].isr, _irq_spurious, NULL); + _irq_handler_set(irq, _irq_spurious, NULL); } diff --git a/arch/arm/core/irq_manage.c b/arch/arm/core/irq_manage.c index ed4d648b9bf..6c7bf08b520 100644 --- a/arch/arm/core/irq_manage.c +++ b/arch/arm/core/irq_manage.c @@ -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 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); }