[PATCH] bsps/irq: bsp_interrupt_facility_initialize()
Gedare Bloom
gedare at rtems.org
Tue Jul 27 20:03:15 UTC 2021
ok
On Tue, Jul 27, 2021 at 2:03 AM Sebastian Huber
<sebastian.huber at embedded-brains.de> wrote:
>
> Do not return a status code in bsp_interrupt_facility_initialize() since this
> leads to unreachable code in bsp_interrupt_initialize(). Use RTEMS_DEBUG
> assertions in bsp_interrupt_facility_initialize() if necessary.
> ---
> bsps/arm/beagle/irq/irq.c | 4 +--
> bsps/arm/csb336/irq/irq.c | 5 +---
> bsps/arm/csb337/irq/irq.c | 4 +--
> bsps/arm/edb7312/irq/irq.c | 4 +--
> bsps/arm/gumstix/irq/irq.c | 4 +--
> bsps/arm/lpc24xx/irq/irq.c | 4 +--
> bsps/arm/lpc32xx/irq/irq.c | 4 +--
> bsps/arm/raspberrypi/irq/irq.c | 3 +--
> bsps/arm/rtl22xx/irq/irq.c | 4 +--
> bsps/arm/shared/irq/irq-armv7m.c | 4 +--
> bsps/arm/smdk2410/irq/irq.c | 4 +--
> bsps/arm/tms570/irq/irq.c | 4 +--
> bsps/i386/shared/irq/irq.c | 4 +--
> bsps/include/bsp/irq-generic.h | 4 +--
> bsps/lm32/shared/irq/irq.c | 4 +--
> bsps/mips/shared/irq/irq.c | 3 +--
> bsps/powerpc/gen5200/irq/irq.c | 16 ++++++------
> bsps/powerpc/gen83xx/irq/irq.c | 30 ++++++++++-------------
> bsps/powerpc/mpc55xxevb/start/irq.c | 4 +--
> bsps/powerpc/mpc8260ads/irq/irq.c | 16 ++++++------
> bsps/powerpc/psim/irq/irq_init.c | 11 ++++-----
> bsps/powerpc/qemuppc/irq/irq_init.c | 11 ++++-----
> bsps/powerpc/qoriq/irq/irq.c | 6 ++---
> bsps/powerpc/shared/irq/ppc-irq-generic.c | 3 +--
> bsps/powerpc/t32mppc/irq/irq.c | 4 +--
> bsps/powerpc/tqm8xx/irq/irq.c | 28 +++++++++++----------
> bsps/powerpc/virtex/irq/irq_init.c | 9 ++++---
> bsps/riscv/griscv/irq/irq.c | 4 +--
> bsps/riscv/riscv/irq/irq.c | 4 +--
> bsps/shared/dev/irq/arm-gicv2.c | 3 +--
> bsps/shared/dev/irq/arm-gicv3.c | 3 +--
> bsps/shared/irq/irq-default.c | 4 +--
> bsps/shared/irq/irq-generic.c | 8 +-----
> bsps/sparc/leon3/start/eirq.c | 4 +--
> bsps/sparc/shared/irq/irq-shared.c | 3 +--
> bsps/x86_64/amd64/interrupts/idt.c | 4 +--
> 36 files changed, 90 insertions(+), 148 deletions(-)
>
> diff --git a/bsps/arm/beagle/irq/irq.c b/bsps/arm/beagle/irq/irq.c
> index d892299fbe..29a4e391e8 100644
> --- a/bsps/arm/beagle/irq/irq.c
> +++ b/bsps/arm/beagle/irq/irq.c
> @@ -163,7 +163,7 @@ rtems_status_code bsp_interrupt_vector_disable(rtems_vector_number vector)
> return RTEMS_SUCCESSFUL;
> }
>
> -rtems_status_code bsp_interrupt_facility_initialize(void)
> +void bsp_interrupt_facility_initialize(void)
> {
> int i;
> uint32_t intc_ilrx;
> @@ -183,6 +183,4 @@ rtems_status_code bsp_interrupt_facility_initialize(void)
> /* Install generic interrupt handler */
> arm_cp15_set_exception_handler(ARM_EXCEPTION_IRQ, _ARMV4_Exception_interrupt);
> arm_cp15_set_vector_base_address(bsp_vector_table_begin);
> -
> - return RTEMS_SUCCESSFUL;
> }
> diff --git a/bsps/arm/csb336/irq/irq.c b/bsps/arm/csb336/irq/irq.c
> index 266ca0113f..24a5a9eb57 100644
> --- a/bsps/arm/csb336/irq/irq.c
> +++ b/bsps/arm/csb336/irq/irq.c
> @@ -88,10 +88,7 @@ rtems_status_code bsp_interrupt_vector_disable(rtems_vector_number vector)
> return RTEMS_SUCCESSFUL;
> }
>
> -rtems_status_code bsp_interrupt_facility_initialize(void)
> +void bsp_interrupt_facility_initialize(void)
> {
> -
> _CPU_ISR_install_vector(ARM_EXCEPTION_IRQ, _ARMV4_Exception_interrupt, NULL);
> -
> - return RTEMS_SUCCESSFUL;
> }
> diff --git a/bsps/arm/csb337/irq/irq.c b/bsps/arm/csb337/irq/irq.c
> index 32f19c7000..19796b0380 100644
> --- a/bsps/arm/csb337/irq/irq.c
> +++ b/bsps/arm/csb337/irq/irq.c
> @@ -83,7 +83,7 @@ rtems_status_code bsp_interrupt_vector_disable(rtems_vector_number vector)
> return RTEMS_SUCCESSFUL;
> }
>
> -rtems_status_code bsp_interrupt_facility_initialize(void)
> +void bsp_interrupt_facility_initialize(void)
> {
> unsigned long i = 0;
>
> @@ -95,6 +95,4 @@ rtems_status_code bsp_interrupt_facility_initialize(void)
> AIC_CTL_REG(AIC_IDCR) = 0xffffffff;
>
> _CPU_ISR_install_vector(ARM_EXCEPTION_IRQ, _ARMV4_Exception_interrupt, NULL);
> -
> - return RTEMS_SUCCESSFUL;
> }
> diff --git a/bsps/arm/edb7312/irq/irq.c b/bsps/arm/edb7312/irq/irq.c
> index e039e119e5..d18b7ae197 100644
> --- a/bsps/arm/edb7312/irq/irq.c
> +++ b/bsps/arm/edb7312/irq/irq.c
> @@ -125,7 +125,7 @@ rtems_status_code bsp_interrupt_vector_disable(rtems_vector_number vector)
> return RTEMS_SUCCESSFUL;
> }
>
> -rtems_status_code bsp_interrupt_facility_initialize(void)
> +void bsp_interrupt_facility_initialize(void)
> {
> uint32_t int_stat = 0;
>
> @@ -221,6 +221,4 @@ rtems_status_code bsp_interrupt_facility_initialize(void)
> int_stat = *EP7312_INTSR3;
>
> _CPU_ISR_install_vector(ARM_EXCEPTION_IRQ, _ARMV4_Exception_interrupt, NULL);
> -
> - return RTEMS_SUCCESSFUL;
> }
> diff --git a/bsps/arm/gumstix/irq/irq.c b/bsps/arm/gumstix/irq/irq.c
> index e0f16e17e0..a91bc37971 100644
> --- a/bsps/arm/gumstix/irq/irq.c
> +++ b/bsps/arm/gumstix/irq/irq.c
> @@ -80,7 +80,7 @@ rtems_status_code bsp_interrupt_vector_disable(rtems_vector_number vector)
> return RTEMS_SUCCESSFUL;
> }
>
> -rtems_status_code bsp_interrupt_facility_initialize(void)
> +void bsp_interrupt_facility_initialize(void)
> {
> /* disable all interrupts */
> XSCALE_INT_ICMR = 0x0;
> @@ -90,6 +90,4 @@ rtems_status_code bsp_interrupt_facility_initialize(void)
>
> /* Install the IRQ exception handler */
> _CPU_ISR_install_vector(ARM_EXCEPTION_IRQ, _ARMV4_Exception_interrupt, NULL);
> -
> - return RTEMS_SUCCESSFUL;
> }
> diff --git a/bsps/arm/lpc24xx/irq/irq.c b/bsps/arm/lpc24xx/irq/irq.c
> index a851db8a7f..ac0ef7c7cb 100644
> --- a/bsps/arm/lpc24xx/irq/irq.c
> +++ b/bsps/arm/lpc24xx/irq/irq.c
> @@ -120,7 +120,7 @@ rtems_status_code bsp_interrupt_vector_disable(rtems_vector_number vector)
> return RTEMS_SUCCESSFUL;
> }
>
> -rtems_status_code bsp_interrupt_facility_initialize(void)
> +void bsp_interrupt_facility_initialize(void)
> {
> volatile uint32_t *addr = VICVectAddrBase;
> volatile uint32_t *prio = VICVectPriorityBase;
> @@ -157,8 +157,6 @@ rtems_status_code bsp_interrupt_facility_initialize(void)
>
> /* Install the IRQ exception handler */
> _CPU_ISR_install_vector(ARM_EXCEPTION_IRQ, _ARMV4_Exception_interrupt, NULL);
> -
> - return RTEMS_SUCCESSFUL;
> }
>
> #endif /* ARM_MULTILIB_ARCH_V4 */
> diff --git a/bsps/arm/lpc32xx/irq/irq.c b/bsps/arm/lpc32xx/irq/irq.c
> index f08d4fe9fb..368ecb906c 100644
> --- a/bsps/arm/lpc32xx/irq/irq.c
> +++ b/bsps/arm/lpc32xx/irq/irq.c
> @@ -347,7 +347,7 @@ void lpc32xx_set_exception_handler(
> }
> }
>
> -rtems_status_code bsp_interrupt_facility_initialize(void)
> +void bsp_interrupt_facility_initialize(void)
> {
> size_t i = 0;
>
> @@ -385,6 +385,4 @@ rtems_status_code bsp_interrupt_facility_initialize(void)
> lpc32xx.sic_2.atr = 0x0;
>
> lpc32xx_set_exception_handler(ARM_EXCEPTION_IRQ, _ARMV4_Exception_interrupt);
> -
> - return RTEMS_SUCCESSFUL;
> }
> diff --git a/bsps/arm/raspberrypi/irq/irq.c b/bsps/arm/raspberrypi/irq/irq.c
> index bd98689087..f3a6528a34 100644
> --- a/bsps/arm/raspberrypi/irq/irq.c
> +++ b/bsps/arm/raspberrypi/irq/irq.c
> @@ -217,11 +217,10 @@ void bsp_interrupt_handler_default(rtems_vector_number vector)
> printk("spurious interrupt: %" PRIdrtems_vector_number "\n", vector);
> }
>
> -rtems_status_code bsp_interrupt_facility_initialize(void)
> +void bsp_interrupt_facility_initialize(void)
> {
> BCM2835_REG(BCM2835_IRQ_DISABLE1) = 0xffffffff;
> BCM2835_REG(BCM2835_IRQ_DISABLE2) = 0xffffffff;
> BCM2835_REG(BCM2835_IRQ_DISABLE_BASIC) = 0xffffffff;
> BCM2835_REG(BCM2835_IRQ_FIQ_CTRL) = 0;
> - return RTEMS_SUCCESSFUL;
> }
> diff --git a/bsps/arm/rtl22xx/irq/irq.c b/bsps/arm/rtl22xx/irq/irq.c
> index fcfe6a66cf..ad9d33ed3e 100644
> --- a/bsps/arm/rtl22xx/irq/irq.c
> +++ b/bsps/arm/rtl22xx/irq/irq.c
> @@ -82,7 +82,7 @@ rtems_status_code bsp_interrupt_vector_disable(rtems_vector_number vector)
> return RTEMS_SUCCESSFUL;
> }
>
> -rtems_status_code bsp_interrupt_facility_initialize(void)
> +void bsp_interrupt_facility_initialize(void)
> {
> volatile uint32_t *ctrl = (volatile uint32_t *) VICVectCntlBase;
> size_t i = 0;
> @@ -109,6 +109,4 @@ rtems_status_code bsp_interrupt_facility_initialize(void)
>
> /* Install the IRQ exception handler */
> _CPU_ISR_install_vector(ARM_EXCEPTION_IRQ, _ARMV4_Exception_interrupt, NULL);
> -
> - return RTEMS_SUCCESSFUL;
> }
> diff --git a/bsps/arm/shared/irq/irq-armv7m.c b/bsps/arm/shared/irq/irq-armv7m.c
> index 8a1fd75a32..2602340e65 100644
> --- a/bsps/arm/shared/irq/irq-armv7m.c
> +++ b/bsps/arm/shared/irq/irq-armv7m.c
> @@ -94,7 +94,7 @@ rtems_status_code bsp_interrupt_vector_disable(rtems_vector_number vector)
> return RTEMS_SUCCESSFUL;
> }
>
> -rtems_status_code bsp_interrupt_facility_initialize(void)
> +void bsp_interrupt_facility_initialize(void)
> {
> ARMV7M_Exception_handler *vector_table;
> int i;
> @@ -118,8 +118,6 @@ rtems_status_code bsp_interrupt_facility_initialize(void)
> }
>
> _ARMV7M_SCB->vtor = vector_table;
> -
> - return RTEMS_SUCCESSFUL;
> }
>
> #endif /* ARM_MULTILIB_ARCH_V7M */
> diff --git a/bsps/arm/smdk2410/irq/irq.c b/bsps/arm/smdk2410/irq/irq.c
> index a293dac5c2..1501a94c87 100644
> --- a/bsps/arm/smdk2410/irq/irq.c
> +++ b/bsps/arm/smdk2410/irq/irq.c
> @@ -81,9 +81,7 @@ rtems_status_code bsp_interrupt_vector_disable(rtems_vector_number vector)
> return RTEMS_SUCCESSFUL;
> }
>
> -rtems_status_code bsp_interrupt_facility_initialize(void)
> +void bsp_interrupt_facility_initialize(void)
> {
> _CPU_ISR_install_vector(ARM_EXCEPTION_IRQ, _ARMV4_Exception_interrupt, NULL);
> -
> - return RTEMS_SUCCESSFUL;
> }
> diff --git a/bsps/arm/tms570/irq/irq.c b/bsps/arm/tms570/irq/irq.c
> index e254d4e856..437c1ab27c 100644
> --- a/bsps/arm/tms570/irq/irq.c
> +++ b/bsps/arm/tms570/irq/irq.c
> @@ -174,7 +174,7 @@ rtems_status_code bsp_interrupt_vector_disable(
> *
> * @retval RTEMS_SUCCESSFUL All is set
> */
> -rtems_status_code bsp_interrupt_facility_initialize(void)
> +void bsp_interrupt_facility_initialize(void)
> {
> void (**vim_vec)(void) = (void (**)(void)) 0xFFF82000;
> unsigned int value = 0x00010203;
> @@ -241,6 +241,4 @@ rtems_status_code bsp_interrupt_facility_initialize(void)
> sctlr |= 1 << 24;
> #endif
> asm volatile ("mcr p15, 0, %0, c1, c0, 0\n": : "r" (sctlr));
> -
> - return RTEMS_SUCCESSFUL;
> }
> diff --git a/bsps/i386/shared/irq/irq.c b/bsps/i386/shared/irq/irq.c
> index e6994d49c7..22bab64acf 100644
> --- a/bsps/i386/shared/irq/irq.c
> +++ b/bsps/i386/shared/irq/irq.c
> @@ -326,7 +326,7 @@ rtems_status_code bsp_interrupt_vector_disable(rtems_vector_number vector)
> return RTEMS_SUCCESSFUL;
> }
>
> -rtems_status_code bsp_interrupt_facility_initialize(void)
> +void bsp_interrupt_facility_initialize(void)
> {
> int i;
>
> @@ -347,8 +347,6 @@ rtems_status_code bsp_interrupt_facility_initialize(void)
>
> for (i = 0; i < BSP_IRQ_LINES_NUMBER; i++)
> irq_trigger[i] = elcr_read_trigger(i);
> -
> - return RTEMS_SUCCESSFUL;
> }
>
> static bool bsp_interrupt_handler_is_empty(rtems_vector_number vector)
> diff --git a/bsps/include/bsp/irq-generic.h b/bsps/include/bsp/irq-generic.h
> index e27c1b230c..fa1343a990 100644
> --- a/bsps/include/bsp/irq-generic.h
> +++ b/bsps/include/bsp/irq-generic.h
> @@ -202,10 +202,8 @@ void bsp_interrupt_initialize(void);
> * The vectors will be enabled with your bsp_interrupt_vector_enable() function
> * and disabled via your bsp_interrupt_vector_disable() function. These
> * functions have to work afterwards.
> - *
> - * @return On success RTEMS_SUCCESSFUL shall be returned.
> */
> -rtems_status_code bsp_interrupt_facility_initialize(void);
> +void bsp_interrupt_facility_initialize(void);
>
> /**
> * @brief Gets the attributes of the interrupt vector.
> diff --git a/bsps/lm32/shared/irq/irq.c b/bsps/lm32/shared/irq/irq.c
> index b65c796d43..4a7f9bd444 100644
> --- a/bsps/lm32/shared/irq/irq.c
> +++ b/bsps/lm32/shared/irq/irq.c
> @@ -12,9 +12,9 @@
> #include <bsp/irq.h>
> #include <bsp/irq-generic.h>
>
> -rtems_status_code bsp_interrupt_facility_initialize(void)
> +void bsp_interrupt_facility_initialize(void)
> {
> - return RTEMS_SUCCESSFUL;
> + /* Nothing to do */
> }
>
> rtems_status_code bsp_interrupt_get_attributes(
> diff --git a/bsps/mips/shared/irq/irq.c b/bsps/mips/shared/irq/irq.c
> index 70abb2e252..57816bd971 100644
> --- a/bsps/mips/shared/irq/irq.c
> +++ b/bsps/mips/shared/irq/irq.c
> @@ -121,10 +121,9 @@ rtems_status_code bsp_interrupt_vector_disable(rtems_vector_number vector)
> return RTEMS_SUCCESSFUL;
> }
>
> -rtems_status_code bsp_interrupt_facility_initialize(void)
> +void bsp_interrupt_facility_initialize(void)
> {
> mips_install_isr_entries();
> - return RTEMS_SUCCESSFUL;
> }
>
> void bsp_interrupt_handler_default(rtems_vector_number vector)
> diff --git a/bsps/powerpc/gen5200/irq/irq.c b/bsps/powerpc/gen5200/irq/irq.c
> index 9cf78f6a80..4ae79e58a9 100644
> --- a/bsps/powerpc/gen5200/irq/irq.c
> +++ b/bsps/powerpc/gen5200/irq/irq.c
> @@ -745,19 +745,17 @@ static void BSP_SIU_irq_init( void)
> setup_irqMaskTable();
> }
>
> -rtems_status_code bsp_interrupt_facility_initialize( void)
> +void bsp_interrupt_facility_initialize( void)
> {
> + rtems_status_code sc;
> +
> BSP_SIU_irq_init();
>
> /* Install exception handler */
> - if (ppc_exc_set_handler( ASM_EXT_VECTOR, C_dispatch_irq_handler)) {
> - return RTEMS_IO_ERROR;
> - }
> - if (ppc_exc_set_handler( ASM_E300_SYSMGMT_VECTOR, C_dispatch_irq_handler)) {
> - return RTEMS_IO_ERROR;
> - }
> -
> - return RTEMS_SUCCESSFUL;
> + sc = ppc_exc_set_handler( ASM_EXT_VECTOR, C_dispatch_irq_handler);
> + _Assert_Unused_variable_equals( sc, RTEMS_SUCCESSFUL);
> + sc = ppc_exc_set_handler( ASM_E300_SYSMGMT_VECTOR, C_dispatch_irq_handler);
> + _Assert_Unused_variable_equals( sc, RTEMS_SUCCESSFUL);
> }
>
> void bsp_interrupt_handler_default( rtems_vector_number vector)
> diff --git a/bsps/powerpc/gen83xx/irq/irq.c b/bsps/powerpc/gen83xx/irq/irq.c
> index 358c2698a2..4ebea21c60 100644
> --- a/bsps/powerpc/gen83xx/irq/irq.c
> +++ b/bsps/powerpc/gen83xx/irq/irq.c
> @@ -548,20 +548,17 @@ static int BSP_irq_handle_at_ipic( unsigned excNum)
> * Fill the array mpc83xx_ipic_prio2mask to allow masking of lower prio sources
> * to implement nested interrupts.
> */
> -static rtems_status_code mpc83xx_ipic_calc_prio2mask(void)
> +static void mpc83xx_ipic_calc_prio2mask(void)
> {
> - rtems_status_code rc = RTEMS_SUCCESSFUL;
> -
> /*
> * FIXME: fill the array
> */
> - return rc;
> }
>
> /*
> * Activate the interrupt controller
> */
> -static rtems_status_code mpc83xx_ipic_initialize(void)
> +static void mpc83xx_ipic_initialize(void)
> {
> /*
> * mask off all interrupts
> @@ -613,7 +610,7 @@ static rtems_status_code mpc83xx_ipic_initialize(void)
> /*
> * calculate priority masks
> */
> - return mpc83xx_ipic_calc_prio2mask();
> + mpc83xx_ipic_calc_prio2mask();
> }
>
> static int mpc83xx_exception_handler(
> @@ -624,19 +621,18 @@ static int mpc83xx_exception_handler(
> return BSP_irq_handle_at_ipic( exception_number);
> }
>
> -rtems_status_code bsp_interrupt_facility_initialize()
> +void bsp_interrupt_facility_initialize()
> {
> + rtems_status_code sc;
> +
> /* Install exception handler */
> - if (ppc_exc_set_handler( ASM_EXT_VECTOR, mpc83xx_exception_handler)) {
> - return RTEMS_IO_ERROR;
> - }
> - if (ppc_exc_set_handler( ASM_E300_SYSMGMT_VECTOR, mpc83xx_exception_handler)) {
> - return RTEMS_IO_ERROR;
> - }
> - if (ppc_exc_set_handler( ASM_E300_CRIT_VECTOR, mpc83xx_exception_handler)) {
> - return RTEMS_IO_ERROR;
> - }
> + sc = ppc_exc_set_handler( ASM_EXT_VECTOR, mpc83xx_exception_handler);
> + _Assert_Unused_variable_equals( sc, RTEMS_SUCCESSFUL);
> + sc = ppc_exc_set_handler( ASM_E300_SYSMGMT_VECTOR, mpc83xx_exception_handler);
> + _Assert_Unused_variable_equals( sc, RTEMS_SUCCESSFUL);
> + sc = ppc_exc_set_handler( ASM_E300_CRIT_VECTOR, mpc83xx_exception_handler);
> + _Assert_Unused_variable_equals( sc, RTEMS_SUCCESSFUL);
>
> /* Initialize the interrupt controller */
> - return mpc83xx_ipic_initialize();
> + mpc83xx_ipic_initialize();
> }
> diff --git a/bsps/powerpc/mpc55xxevb/start/irq.c b/bsps/powerpc/mpc55xxevb/start/irq.c
> index a4bf712af4..5dee6d74c7 100644
> --- a/bsps/powerpc/mpc55xxevb/start/irq.c
> +++ b/bsps/powerpc/mpc55xxevb/start/irq.c
> @@ -131,7 +131,7 @@ void bsp_interrupt_dispatch(uintptr_t exception_number)
> INTC.EOIR.R = 1;
> }
>
> -rtems_status_code bsp_interrupt_facility_initialize(void)
> +void bsp_interrupt_facility_initialize(void)
> {
> rtems_vector_number vector;
>
> @@ -148,8 +148,6 @@ rtems_status_code bsp_interrupt_facility_initialize(void)
>
> /* Set current priority to 0 */
> INTC.CPR.B.PRI = 0;
> -
> - return RTEMS_SUCCESSFUL;
> }
>
> rtems_status_code bsp_interrupt_get_attributes(
> diff --git a/bsps/powerpc/mpc8260ads/irq/irq.c b/bsps/powerpc/mpc8260ads/irq/irq.c
> index 9b73979efa..70cb5acf9b 100644
> --- a/bsps/powerpc/mpc8260ads/irq/irq.c
> +++ b/bsps/powerpc/mpc8260ads/irq/irq.c
> @@ -398,21 +398,19 @@ rtems_status_code bsp_interrupt_vector_disable( rtems_vector_number irqnum)
> return RTEMS_SUCCESSFUL;
> }
>
> -rtems_status_code bsp_interrupt_facility_initialize()
> +void bsp_interrupt_facility_initialize()
> {
> + rtems_status_code sc;
> +
> /* Install exception handler */
> - if (ppc_exc_set_handler( ASM_EXT_VECTOR, C_dispatch_irq_handler)) {
> - return RTEMS_IO_ERROR;
> - }
> - if (ppc_exc_set_handler( ASM_DEC_VECTOR, C_dispatch_irq_handler)) {
> - return RTEMS_IO_ERROR;
> - }
> + sc = ppc_exc_set_handler( ASM_EXT_VECTOR, C_dispatch_irq_handler);
> + _Assert_Unused_variable_equals( sc, RTEMS_SUCCESSFUL);
> + sc = ppc_exc_set_handler( ASM_DEC_VECTOR, C_dispatch_irq_handler);
> + _Assert_Unused_variable_equals( sc, RTEMS_SUCCESSFUL);
>
> /* Fill in priority masks */
> compute_SIU_IvectMask_from_prio();
>
> /* Initialize the interrupt controller */
> BSP_CPM_irq_init();
> -
> - return RTEMS_SUCCESSFUL;
> }
> diff --git a/bsps/powerpc/psim/irq/irq_init.c b/bsps/powerpc/psim/irq/irq_init.c
> index 97eb00890d..16c30e714d 100644
> --- a/bsps/powerpc/psim/irq/irq_init.c
> +++ b/bsps/powerpc/psim/irq/irq_init.c
> @@ -158,12 +158,11 @@ rtems_status_code bsp_interrupt_vector_disable( rtems_vector_number irqnum)
> return RTEMS_SUCCESSFUL;
> }
>
> -rtems_status_code bsp_interrupt_facility_initialize(void)
> +void bsp_interrupt_facility_initialize(void)
> {
> + rtems_status_code sc;
> +
> /* Install exception handler */
> - if (ppc_exc_set_handler( ASM_EXT_VECTOR, psim_exception_handler)) {
> - return RTEMS_IO_ERROR;
> - }
> -
> - return RTEMS_SUCCESSFUL;
> + sc = ppc_exc_set_handler( ASM_EXT_VECTOR, psim_exception_handler);
> + _Assert_Unused_variable_equals( sc, RTEMS_SUCCESSFUL);
> }
> diff --git a/bsps/powerpc/qemuppc/irq/irq_init.c b/bsps/powerpc/qemuppc/irq/irq_init.c
> index 5990785fd1..cd85b06c47 100644
> --- a/bsps/powerpc/qemuppc/irq/irq_init.c
> +++ b/bsps/powerpc/qemuppc/irq/irq_init.c
> @@ -94,12 +94,11 @@ rtems_status_code bsp_interrupt_vector_disable( rtems_vector_number irqnum)
> return RTEMS_SUCCESSFUL;
> }
>
> -rtems_status_code bsp_interrupt_facility_initialize(void)
> +void bsp_interrupt_facility_initialize(void)
> {
> - /* Install exception handler */
> - if (ppc_exc_set_handler( ASM_EXT_VECTOR, qemuppc_exception_handler)) {
> - return RTEMS_IO_ERROR;
> - }
> + rtems_status_code sc;
>
> - return RTEMS_SUCCESSFUL;
> + /* Install exception handler */
> + sc = ppc_exc_set_handler( ASM_EXT_VECTOR, qemuppc_exception_handler);
> + _Assert_Unused_variable_equals( sc, RTEMS_SUCCESSFUL);
> }
> diff --git a/bsps/powerpc/qoriq/irq/irq.c b/bsps/powerpc/qoriq/irq/irq.c
> index 71a932863d..01e24998ba 100644
> --- a/bsps/powerpc/qoriq/irq/irq.c
> +++ b/bsps/powerpc/qoriq/irq/irq.c
> @@ -181,7 +181,7 @@ void bsp_interrupt_dispatch(uintptr_t exception_number)
> }
> }
>
> -rtems_status_code bsp_interrupt_facility_initialize(void)
> +void bsp_interrupt_facility_initialize(void)
> {
> unsigned int i;
>
> @@ -458,7 +458,7 @@ static void pic_global_timer_init(void)
> }
> }
>
> -rtems_status_code bsp_interrupt_facility_initialize(void)
> +void bsp_interrupt_facility_initialize(void)
> {
> rtems_vector_number i = 0;
> uint32_t processor_id = ppc_processor_id();
> @@ -494,8 +494,6 @@ rtems_status_code bsp_interrupt_facility_initialize(void)
> qoriq.pic.eoi = 0;
> qoriq.pic.whoami;
> }
> -
> - return RTEMS_SUCCESSFUL;
> }
>
> #endif /* QORIQ_IS_HYPERVISOR_GUEST */
> diff --git a/bsps/powerpc/shared/irq/ppc-irq-generic.c b/bsps/powerpc/shared/irq/ppc-irq-generic.c
> index 729e92d688..f4b85f7bc0 100644
> --- a/bsps/powerpc/shared/irq/ppc-irq-generic.c
> +++ b/bsps/powerpc/shared/irq/ppc-irq-generic.c
> @@ -151,11 +151,10 @@ rtems_status_code bsp_interrupt_vector_disable(rtems_vector_number vector)
> return RTEMS_SUCCESSFUL;
> }
>
> -rtems_status_code bsp_interrupt_facility_initialize(void)
> +void bsp_interrupt_facility_initialize(void)
> {
> /*
> * Initialize RTEMS IRQ system
> */
> BSP_rtems_irq_mng_init(0);
> - return RTEMS_SUCCESSFUL;
> }
> diff --git a/bsps/powerpc/t32mppc/irq/irq.c b/bsps/powerpc/t32mppc/irq/irq.c
> index 30ecfe54d7..bbf97d25b1 100644
> --- a/bsps/powerpc/t32mppc/irq/irq.c
> +++ b/bsps/powerpc/t32mppc/irq/irq.c
> @@ -79,7 +79,7 @@ rtems_status_code bsp_interrupt_vector_disable(rtems_vector_number vector)
> return RTEMS_SUCCESSFUL;
> }
>
> -rtems_status_code bsp_interrupt_facility_initialize(void)
> +void bsp_interrupt_facility_initialize(void)
> {
> - return RTEMS_SUCCESSFUL;
> + /* Nothing to do */
> }
> diff --git a/bsps/powerpc/tqm8xx/irq/irq.c b/bsps/powerpc/tqm8xx/irq/irq.c
> index 42517504b7..1c405037a3 100644
> --- a/bsps/powerpc/tqm8xx/irq/irq.c
> +++ b/bsps/powerpc/tqm8xx/irq/irq.c
> @@ -226,8 +226,10 @@ static int BSP_irq_handle_at_siu( unsigned excNum)
> /*
> * Activate the CPIC
> */
> -static rtems_status_code mpc8xx_cpic_initialize( void)
> +static void mpc8xx_cpic_initialize( void)
> {
> + rtems_status_code sc;
> +
> /*
> * mask off all interrupts
> */
> @@ -240,20 +242,19 @@ static rtems_status_code mpc8xx_cpic_initialize( void)
> /*
> * enable CPIC interrupt in SIU interrupt controller
> */
> - return bsp_irq_enable_at_SIU(BSP_CPM_INTERRUPT);
> + sc = bsp_irq_enable_at_SIU(BSP_CPM_INTERRUPT);
> + _Assert_Unused_variable_equals(sc, RTEMS_SUCCESSFUL);
> }
>
> /*
> * Activate the SIU interrupt controller
> */
> -static rtems_status_code mpc8xx_siu_int_initialize( void)
> +static void mpc8xx_siu_int_initialize( void)
> {
> /*
> * mask off all interrupts
> */
> m8xx.simask = 0;
> -
> - return RTEMS_SUCCESSFUL;
> }
>
> static int mpc8xx_exception_handler(BSP_Exception_frame *frame,
> @@ -262,16 +263,17 @@ static int mpc8xx_exception_handler(BSP_Exception_frame *frame,
> return BSP_irq_handle_at_siu(exception_number);
> }
>
> -rtems_status_code bsp_interrupt_facility_initialize()
> +void bsp_interrupt_facility_initialize()
> {
> + rtems_status_code sc;
> +
> /* Install exception handler */
> - if (ppc_exc_set_handler(ASM_EXT_VECTOR, mpc8xx_exception_handler)) {
> - return RTEMS_IO_ERROR;
> - }
> + sc = ppc_exc_set_handler(ASM_EXT_VECTOR, mpc8xx_exception_handler);
> + _Assert_Unused_variable_equals(sc, RTEMS_SUCCESSFUL);
> +
> /* Initialize the SIU interrupt controller */
> - if (mpc8xx_siu_int_initialize()) {
> - return RTEMS_IO_ERROR;
> - }
> + mpc8xx_siu_int_initialize();
> +
> /* Initialize the CPIC interrupt controller */
> - return mpc8xx_cpic_initialize();
> + mpc8xx_cpic_initialize();
> }
> diff --git a/bsps/powerpc/virtex/irq/irq_init.c b/bsps/powerpc/virtex/irq/irq_init.c
> index 031e59cf9e..e18df51594 100644
> --- a/bsps/powerpc/virtex/irq/irq_init.c
> +++ b/bsps/powerpc/virtex/irq/irq_init.c
> @@ -203,11 +203,12 @@ static int C_dispatch_irq_handler(BSP_Exception_frame *frame, unsigned int excNu
> return 0;
> }
>
> -rtems_status_code bsp_interrupt_facility_initialize(void)
> +void bsp_interrupt_facility_initialize(void)
> {
> - opb_intc_init();
> + rtems_status_code sc;
>
> - ppc_exc_set_handler(ASM_EXT_VECTOR, C_dispatch_irq_handler);
> + opb_intc_init();
>
> - return RTEMS_SUCCESSFUL;
> + sc = ppc_exc_set_handler(ASM_EXT_VECTOR, C_dispatch_irq_handler);
> + _Assert_Unused_variable_equals(sc, RTEMS_SUCCESSFUL);
> }
> diff --git a/bsps/riscv/griscv/irq/irq.c b/bsps/riscv/griscv/irq/irq.c
> index 3f1c75dc8e..ea19797565 100644
> --- a/bsps/riscv/griscv/irq/irq.c
> +++ b/bsps/riscv/griscv/irq/irq.c
> @@ -75,7 +75,7 @@ void _RISCV_Interrupt_dispatch(uintptr_t mcause, Per_CPU_Control *cpu_self)
> }
> }
>
> -rtems_status_code bsp_interrupt_facility_initialize(void)
> +void bsp_interrupt_facility_initialize(void)
> {
>
> /*
> @@ -83,8 +83,6 @@ rtems_status_code bsp_interrupt_facility_initialize(void)
> * bsp_start_on_secondary_processor().
> */
> set_csr(mie, MIP_MEIP);
> -
> - return RTEMS_SUCCESSFUL;
> }
>
> rtems_status_code bsp_interrupt_get_attributes(
> diff --git a/bsps/riscv/riscv/irq/irq.c b/bsps/riscv/riscv/irq/irq.c
> index eff0de7156..1b632289a6 100644
> --- a/bsps/riscv/riscv/irq/irq.c
> +++ b/bsps/riscv/riscv/irq/irq.c
> @@ -215,15 +215,13 @@ static void riscv_plic_init(const void *fdt)
> set_csr(mie, MIP_MEIP);
> }
>
> -rtems_status_code bsp_interrupt_facility_initialize(void)
> +void bsp_interrupt_facility_initialize(void)
> {
> const void *fdt;
>
> fdt = bsp_fdt_get();
> riscv_clint_init(fdt);
> riscv_plic_init(fdt);
> -
> - return RTEMS_SUCCESSFUL;
> }
>
> rtems_status_code bsp_interrupt_get_attributes(
> diff --git a/bsps/shared/dev/irq/arm-gicv2.c b/bsps/shared/dev/irq/arm-gicv2.c
> index eaae6124e8..9c47a4d47b 100644
> --- a/bsps/shared/dev/irq/arm-gicv2.c
> +++ b/bsps/shared/dev/irq/arm-gicv2.c
> @@ -208,7 +208,7 @@ static void enable_fiq(void)
> #endif
> }
>
> -rtems_status_code bsp_interrupt_facility_initialize(void)
> +void bsp_interrupt_facility_initialize(void)
> {
> volatile gic_cpuif *cpuif = GIC_CPUIF;
> volatile gic_dist *dist = ARM_GIC_DIST;
> @@ -239,7 +239,6 @@ rtems_status_code bsp_interrupt_facility_initialize(void)
> dist->icddcr = GIC_DIST_ICDDCR_ENABLE_GRP_1 | GIC_DIST_ICDDCR_ENABLE;
>
> enable_fiq();
> - return RTEMS_SUCCESSFUL;
> }
>
> #ifdef RTEMS_SMP
> diff --git a/bsps/shared/dev/irq/arm-gicv3.c b/bsps/shared/dev/irq/arm-gicv3.c
> index ca282a378d..ea123d325e 100644
> --- a/bsps/shared/dev/irq/arm-gicv3.c
> +++ b/bsps/shared/dev/irq/arm-gicv3.c
> @@ -388,7 +388,7 @@ static void gicv3_init_cpu_interface(void)
> WRITE_SR(ICC_CTLR, 0x0);
> }
>
> -rtems_status_code bsp_interrupt_facility_initialize(void)
> +void bsp_interrupt_facility_initialize(void)
> {
> volatile gic_dist *dist = ARM_GIC_DIST;
> uint32_t id_count = get_id_count(dist);
> @@ -423,7 +423,6 @@ rtems_status_code bsp_interrupt_facility_initialize(void)
> }
>
> gicv3_init_cpu_interface();
> - return RTEMS_SUCCESSFUL;
> }
>
> #ifdef RTEMS_SMP
> diff --git a/bsps/shared/irq/irq-default.c b/bsps/shared/irq/irq-default.c
> index b7d9d9961e..bd93bd72c6 100644
> --- a/bsps/shared/irq/irq-default.c
> +++ b/bsps/shared/irq/irq-default.c
> @@ -93,7 +93,7 @@ rtems_status_code bsp_interrupt_vector_disable(rtems_vector_number vector)
> return RTEMS_UNSATISFIED;
> }
>
> -rtems_status_code bsp_interrupt_facility_initialize(void)
> +void bsp_interrupt_facility_initialize(void)
> {
> - return RTEMS_NOT_IMPLEMENTED;
> + /* Nothing to do */
> }
> diff --git a/bsps/shared/irq/irq-generic.c b/bsps/shared/irq/irq-generic.c
> index eddb887d15..dac1ca4209 100644
> --- a/bsps/shared/irq/irq-generic.c
> +++ b/bsps/shared/irq/irq-generic.c
> @@ -160,13 +160,7 @@ rtems_interrupt_entry *bsp_interrupt_entry_find(
>
> void bsp_interrupt_initialize( void )
> {
> - rtems_status_code sc;
> -
> - sc = bsp_interrupt_facility_initialize();
> - if ( sc != RTEMS_SUCCESSFUL ) {
> - bsp_fatal( BSP_FATAL_INTERRUPT_INITIALIZATION );
> - }
> -
> + bsp_interrupt_facility_initialize();
> bsp_interrupt_set_initialized();
> }
>
> diff --git a/bsps/sparc/leon3/start/eirq.c b/bsps/sparc/leon3/start/eirq.c
> index 0d71b79f1c..b94a674f64 100644
> --- a/bsps/sparc/leon3/start/eirq.c
> +++ b/bsps/sparc/leon3/start/eirq.c
> @@ -45,7 +45,7 @@ bool bsp_interrupt_is_valid_vector(rtems_vector_number vector)
> Processor_mask leon3_interrupt_affinities[BSP_INTERRUPT_VECTOR_MAX_STD + 1];
> #endif
>
> -rtems_status_code bsp_interrupt_facility_initialize(void)
> +void bsp_interrupt_facility_initialize(void)
> {
> #if defined(RTEMS_SMP)
> Processor_mask affinity;
> @@ -57,8 +57,6 @@ rtems_status_code bsp_interrupt_facility_initialize(void)
> leon3_interrupt_affinities[i] = affinity;
> }
> #endif
> -
> - return RTEMS_SUCCESSFUL;
> }
>
> rtems_status_code bsp_interrupt_get_attributes(
> diff --git a/bsps/sparc/shared/irq/irq-shared.c b/bsps/sparc/shared/irq/irq-shared.c
> index 8896aca761..c815e00e40 100644
> --- a/bsps/sparc/shared/irq/irq-shared.c
> +++ b/bsps/sparc/shared/irq/irq-shared.c
> @@ -35,10 +35,9 @@ bool bsp_interrupt_is_valid_vector(rtems_vector_number vector)
> return vector <= BSP_INTERRUPT_VECTOR_MAX_STD;
> }
>
> -rtems_status_code bsp_interrupt_facility_initialize(void)
> +void bsp_interrupt_facility_initialize(void)
> {
> /* Nothing to do */
> - return RTEMS_SUCCESSFUL;
> }
>
> static bool is_maskable(rtems_vector_number vector)
> diff --git a/bsps/x86_64/amd64/interrupts/idt.c b/bsps/x86_64/amd64/interrupts/idt.c
> index 0fe26c3cc0..4a2949450a 100644
> --- a/bsps/x86_64/amd64/interrupts/idt.c
> +++ b/bsps/x86_64/amd64/interrupts/idt.c
> @@ -129,7 +129,7 @@ void amd64_dispatch_isr(rtems_vector_number vector)
> bsp_interrupt_handler_dispatch(vector);
> }
>
> -rtems_status_code bsp_interrupt_facility_initialize(void)
> +void bsp_interrupt_facility_initialize(void)
> {
> uintptr_t old;
> for (uint32_t i = 0; i < BSP_IRQ_VECTOR_NUMBER; i++) {
> @@ -137,8 +137,6 @@ rtems_status_code bsp_interrupt_facility_initialize(void)
> }
>
> lidt(&idtr);
> -
> - return RTEMS_SUCCESSFUL;
> }
>
> rtems_status_code bsp_interrupt_vector_disable(rtems_vector_number vector)
> --
> 2.26.2
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
More information about the devel
mailing list