From 49ec86ddb150c1182928016405e27157a54b2547 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 20 Jun 2018 13:12:54 -0600 Subject: [PATCH] arch/arm: Fix an error found in build testing. --- arch/arm/include/stm32f7/stm32f72xx73xx_irq.h | 2 +- arch/arm/include/xmc4/xmc4500_irq.h | 2 +- arch/arm/src/armv7-m/ram_vectors.h | 3 ++- arch/arm/src/armv7-m/up_ramvec_attach.c | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/arm/include/stm32f7/stm32f72xx73xx_irq.h b/arch/arm/include/stm32f7/stm32f72xx73xx_irq.h index f1ff50d49e..9c7502fad7 100644 --- a/arch/arm/include/stm32f7/stm32f72xx73xx_irq.h +++ b/arch/arm/include/stm32f7/stm32f72xx73xx_irq.h @@ -159,8 +159,8 @@ #define STM32_IRQ_LPTIMER1 (STM32_IRQ_FIRST+93) /* 93: LP Timer1 global interrupt */ #define STM32_IRQ_SDMMC2 (STM32_IRQ_FIRST+103) /* 103: SDMMC2 global interrupt */ -#define NR_INTERRUPTS 103 +#define NR_INTERRUPTS 103 #define NR_VECTORS (STM32_IRQ_FIRST+NR_INTERRUPTS) /* EXTI interrupts (Do not use IRQ numbers) */ diff --git a/arch/arm/include/xmc4/xmc4500_irq.h b/arch/arm/include/xmc4/xmc4500_irq.h index 556af56422..f551307bd0 100644 --- a/arch/arm/include/xmc4/xmc4500_irq.h +++ b/arch/arm/include/xmc4/xmc4500_irq.h @@ -189,7 +189,7 @@ #define XMC4_IRQ_RESVD111 (XMC4_IRQ_FIRST+111) /* 111: Reserved */ #define NR_INTERRUPTS 112 /* 112 Non core IRQs*/ -#define NR_VECTORS (XMC4_IRQ_FIRST+NR_INTERRUPTS) /* 118 vectors */ +#define NR_VECTORS (XMC4_IRQ_FIRST+NR_INTERRUPTS) /* 128 vectors */ /* GPIO IRQ interrupts -- To be provided */ diff --git a/arch/arm/src/armv7-m/ram_vectors.h b/arch/arm/src/armv7-m/ram_vectors.h index 0306655f8d..a87dfa9fcc 100644 --- a/arch/arm/src/armv7-m/ram_vectors.h +++ b/arch/arm/src/armv7-m/ram_vectors.h @@ -44,6 +44,7 @@ #include #include "up_internal.h" +#include "chip.h" #ifdef CONFIG_ARCH_RAMVECTORS @@ -57,7 +58,7 @@ * table. */ -#define ARMV7M_VECTAB_SIZE (NR_VECTORS + 16) +#define ARMV7M_VECTAB_SIZE (ARMV7M_PERIPHERAL_INTERRUPTS + 16) /**************************************************************************** * Public Data diff --git a/arch/arm/src/armv7-m/up_ramvec_attach.c b/arch/arm/src/armv7-m/up_ramvec_attach.c index 6b954803e0..cd2f27c3c9 100644 --- a/arch/arm/src/armv7-m/up_ramvec_attach.c +++ b/arch/arm/src/armv7-m/up_ramvec_attach.c @@ -72,7 +72,7 @@ int up_ramvec_attach(int irq, up_vector_t vector) irqinfo("%s IRQ%d\n", vector ? "Attaching" : "Detaching", irq); - if ((unsigned)irq < NR_VECTORS) + if ((unsigned)irq < ARMV7M_VECTAB_SIZE) { irqstate_t flags;