You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2022/09/21 20:23:20 UTC

[incubator-nuttx] 02/03: arch/armv[6|7|8]-m: Move _vectors to arm_internal.h to avoid the duplication

This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 229b57d6cb1c87868e0ca86f6035e56226979fa5
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Tue Sep 20 06:41:52 2022 +0800

    arch/armv[6|7|8]-m: Move _vectors to arm_internal.h to avoid the duplication
    
    and change the type of _vectors from uint32_t to const void *
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 arch/arm/src/armv6-m/arm_vectors.c                   |  9 ++++-----
 arch/arm/src/armv7-m/arm_vectors.c                   |  9 ++++-----
 arch/arm/src/armv8-m/arm_vectors.c                   |  9 ++++-----
 arch/arm/src/common/arm_internal.h                   | 12 ++++++++++++
 arch/arm/src/cxd56xx/cxd56_irq.c                     | 10 ----------
 arch/arm/src/cxd56xx/cxd56_start.c                   | 10 ----------
 arch/arm/src/efm32/efm32_irq.c                       | 10 ----------
 arch/arm/src/eoss3/eoss3_irq.c                       |  6 ------
 arch/arm/src/gd32f4/gd32f4xx_irq.c                   |  6 ------
 arch/arm/src/imxrt/imxrt_irq.c                       | 10 ----------
 arch/arm/src/kinetis/kinetis_irq.c                   | 10 ----------
 arch/arm/src/lpc17xx_40xx/lpc17_40_irq.c             |  6 ------
 arch/arm/src/lpc43xx/lpc43_irq.c                     |  6 ------
 arch/arm/src/lpc54xx/lpc54_irq.c                     |  6 ------
 arch/arm/src/max326xx/common/max326_irq.c            |  6 ------
 arch/arm/src/nrf52/nrf52_irq.c                       |  6 ------
 arch/arm/src/nrf53/nrf53_irq.c                       |  6 ------
 arch/arm/src/rp2040/rp2040_irq.c                     | 10 ----------
 arch/arm/src/rtl8720c/ameba_nvic.c                   |  4 ----
 arch/arm/src/rtl8720c/ameba_vectors.c                | 10 ++++------
 arch/arm/src/s32k1xx/s32k14x/s32k14x_irq.c           |  6 ------
 arch/arm/src/s32k3xx/s32k3xx_irq.c                   |  6 ------
 arch/arm/src/sam34/sam_irq.c                         | 10 ----------
 arch/arm/src/samd5e5/sam_irq.c                       | 10 ----------
 arch/arm/src/samv7/sam_irq.c                         | 10 ----------
 arch/arm/src/stm32/stm32_irq.c                       | 12 ------------
 arch/arm/src/stm32/stm32_rcc.h                       | 20 --------------------
 arch/arm/src/stm32f7/stm32_irq.c                     | 10 ----------
 arch/arm/src/stm32f7/stm32_rcc.h                     | 14 --------------
 arch/arm/src/stm32h7/stm32_irq.c                     |  6 ------
 arch/arm/src/stm32h7/stm32_rcc.h                     | 14 --------------
 arch/arm/src/stm32l4/stm32l4_irq.c                   |  6 ------
 arch/arm/src/stm32l4/stm32l4_rcc.h                   | 14 --------------
 arch/arm/src/stm32l5/stm32l5_irq.c                   | 10 ----------
 arch/arm/src/stm32l5/stm32l5_rcc.h                   | 14 --------------
 arch/arm/src/stm32u5/stm32_irq.c                     |  6 ------
 arch/arm/src/stm32u5/stm32_rcc.h                     | 14 --------------
 arch/arm/src/stm32wb/stm32wb_rcc.h                   | 20 --------------------
 arch/arm/src/stm32wl5/stm32wl5_irq.c                 |  6 ------
 arch/arm/src/stm32wl5/stm32wl5_rcc.h                 | 14 --------------
 arch/arm/src/tiva/common/tiva_irq.c                  | 10 ----------
 arch/arm/src/xmc4/xmc4_irq.c                         | 10 ----------
 .../imxrt/imxrt1060-evk/src/imxrt_flexspi_nor_boot.c |  1 +
 .../imxrt/imxrt1060-evk/src/imxrt_flexspi_nor_boot.h |  5 ++---
 .../imxrt/imxrt1064-evk/src/imxrt_flexspi_nor_boot.c |  1 +
 .../imxrt/imxrt1064-evk/src/imxrt_flexspi_nor_boot.h |  3 +--
 .../imxrt/teensy-4.x/src/imxrt_flexspi_nor_boot.c    |  1 +
 .../imxrt/teensy-4.x/src/imxrt_flexspi_nor_boot.h    |  3 +--
 48 files changed, 35 insertions(+), 382 deletions(-)

diff --git a/arch/arm/src/armv6-m/arm_vectors.c b/arch/arm/src/armv6-m/arm_vectors.c
index 88fdbab911..09ae1ad0b9 100644
--- a/arch/arm/src/armv6-m/arm_vectors.c
+++ b/arch/arm/src/armv6-m/arm_vectors.c
@@ -50,7 +50,7 @@
  * Pre-processor Definitions
  ****************************************************************************/
 
-#define IDLE_STACK      ((unsigned int)&_ebss+CONFIG_IDLETHREAD_STACKSIZE)
+#define IDLE_STACK      ((const char *)&_ebss+CONFIG_IDLETHREAD_STACKSIZE)
 
 #ifndef ARMV6M_PERIPHERAL_INTERRUPTS
 #  error ARMV6M_PERIPHERAL_INTERRUPTS must be defined to the number of I/O interrupts to be supported
@@ -81,7 +81,7 @@ extern void exception_common(void);
  * Note that the [ ... ] designated initialiser is a GCC extension.
  */
 
-const unsigned int _vectors[] locate_data(".vectors") =
+const void *_vectors[] locate_data(".vectors") =
 {
   /* Initial stack */
 
@@ -89,10 +89,9 @@ const unsigned int _vectors[] locate_data(".vectors") =
 
   /* Reset exception handler */
 
-  (unsigned int)&__start,
+  __start,
 
   /* Vectors 2 - n point directly at the generic handler */
 
-  [2 ... (15 + ARMV6M_PERIPHERAL_INTERRUPTS)] = (unsigned int)
-                                                &exception_common
+  [2 ... (15 + ARMV6M_PERIPHERAL_INTERRUPTS)] = exception_common
 };
diff --git a/arch/arm/src/armv7-m/arm_vectors.c b/arch/arm/src/armv7-m/arm_vectors.c
index e47a5c5ed1..cb42f57809 100644
--- a/arch/arm/src/armv7-m/arm_vectors.c
+++ b/arch/arm/src/armv7-m/arm_vectors.c
@@ -45,7 +45,7 @@
  * Pre-processor Definitions
  ****************************************************************************/
 
-#define IDLE_STACK      ((unsigned int)&_ebss+CONFIG_IDLETHREAD_STACKSIZE)
+#define IDLE_STACK      ((const char *)&_ebss+CONFIG_IDLETHREAD_STACKSIZE)
 
 #ifndef ARMV7M_PERIPHERAL_INTERRUPTS
 #  error ARMV7M_PERIPHERAL_INTERRUPTS must be defined to the number of I/O interrupts to be supported
@@ -76,7 +76,7 @@ extern void exception_common(void);
  * Note that the [ ... ] designated initializer is a GCC extension.
  */
 
-const unsigned int _vectors[] locate_data(".vectors") =
+const void *_vectors[] locate_data(".vectors") =
 {
   /* Initial stack */
 
@@ -84,10 +84,9 @@ const unsigned int _vectors[] locate_data(".vectors") =
 
   /* Reset exception handler */
 
-  (unsigned int)&__start,
+  __start,
 
   /* Vectors 2 - n point directly at the generic handler */
 
-  [2 ... (15 + ARMV7M_PERIPHERAL_INTERRUPTS)] = (unsigned int)
-                                                &exception_common
+  [2 ... (15 + ARMV7M_PERIPHERAL_INTERRUPTS)] = exception_common
 };
diff --git a/arch/arm/src/armv8-m/arm_vectors.c b/arch/arm/src/armv8-m/arm_vectors.c
index 341b8627e0..531e2b7751 100644
--- a/arch/arm/src/armv8-m/arm_vectors.c
+++ b/arch/arm/src/armv8-m/arm_vectors.c
@@ -45,7 +45,7 @@
  * Pre-processor Definitions
  ****************************************************************************/
 
-#define IDLE_STACK      ((unsigned int)&_ebss+CONFIG_IDLETHREAD_STACKSIZE)
+#define IDLE_STACK      ((const char *)&_ebss+CONFIG_IDLETHREAD_STACKSIZE)
 
 #ifndef ARMV8M_PERIPHERAL_INTERRUPTS
 #  error ARMV8M_PERIPHERAL_INTERRUPTS must be defined to the number of I/O interrupts to be supported
@@ -76,7 +76,7 @@ extern void exception_common(void);
  * Note that the [ ... ] designated initializer is a GCC extension.
  */
 
-const unsigned int _vectors[] locate_data(".vectors") =
+const void *_vectors[] locate_data(".vectors") =
 {
   /* Initial stack */
 
@@ -84,10 +84,9 @@ const unsigned int _vectors[] locate_data(".vectors") =
 
   /* Reset exception handler */
 
-  (unsigned int)&__start,
+  __start,
 
   /* Vectors 2 - n point directly at the generic handler */
 
-  [2 ... (15 + ARMV8M_PERIPHERAL_INTERRUPTS)] = (unsigned int)
-                                                &exception_common
+  [2 ... (15 + ARMV8M_PERIPHERAL_INTERRUPTS)] = &exception_common
 };
diff --git a/arch/arm/src/common/arm_internal.h b/arch/arm/src/common/arm_internal.h
index 4130043bd9..bc838fe4d1 100644
--- a/arch/arm/src/common/arm_internal.h
+++ b/arch/arm/src/common/arm_internal.h
@@ -292,6 +292,18 @@ uintptr_t arm_intstack_top(void);
 #if defined(CONFIG_ARCH_ARMV6M) || defined(CONFIG_ARCH_ARMV7M) || \
     defined(CONFIG_ARCH_ARMV8M)
 
+/* This is the address of the  exception vector table (determined by the
+ * linker script).
+ */
+
+#if defined(__ICCARM__)
+/* _vectors replaced on __vector_table for IAR C-SPY Simulator */
+
+extern const void *__vector_table[];
+#else
+extern const void *_vectors[];
+#endif
+
 /* Interrupt acknowledge and dispatch */
 
 void arm_ack_irq(int irq);
diff --git a/arch/arm/src/cxd56xx/cxd56_irq.c b/arch/arm/src/cxd56xx/cxd56_irq.c
index 236d1c9a3c..2d36c8653d 100644
--- a/arch/arm/src/cxd56xx/cxd56_irq.c
+++ b/arch/arm/src/cxd56xx/cxd56_irq.c
@@ -110,16 +110,6 @@ const uint32_t g_cpu_intstack_top[CONFIG_SMP_NCPUS] =
 };
 #endif /* defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7 */
 
-/* This is the address of the  exception vector table (determined by the
- * linker script).
- */
-
-extern uint32_t _vectors[];
-
-/****************************************************************************
- * Private Data
- ****************************************************************************/
-
 /****************************************************************************
  * Private Functions
  ****************************************************************************/
diff --git a/arch/arm/src/cxd56xx/cxd56_start.c b/arch/arm/src/cxd56xx/cxd56_start.c
index 082572429f..fa6fa7e802 100644
--- a/arch/arm/src/cxd56xx/cxd56_start.c
+++ b/arch/arm/src/cxd56xx/cxd56_start.c
@@ -96,16 +96,6 @@ void weak_function up_cpuctxload(void);
   (CXD56M4_SYSH_PRIORITY_DEFAULT << 24 | CXD56M4_SYSH_PRIORITY_DEFAULT << 16 | \
    CXD56M4_SYSH_PRIORITY_DEFAULT << 8 | CXD56M4_SYSH_PRIORITY_DEFAULT)
 
-/****************************************************************************
- * Public Data
- ****************************************************************************/
-
-extern uint32_t _vectors[];
-
-/****************************************************************************
- * Private Functions
- ****************************************************************************/
-
 /****************************************************************************
  * Public Functions
  ****************************************************************************/
diff --git a/arch/arm/src/efm32/efm32_irq.c b/arch/arm/src/efm32/efm32_irq.c
index 2b70e920b8..fb6dcfd214 100644
--- a/arch/arm/src/efm32/efm32_irq.c
+++ b/arch/arm/src/efm32/efm32_irq.c
@@ -72,16 +72,6 @@
 
 volatile uint32_t *g_current_regs[1];
 
-/* This is the address of the  exception vector table (determined by the
- * linker script).
- */
-
-extern uint32_t _vectors[];
-
-/****************************************************************************
- * Private Functions
- ****************************************************************************/
-
 /****************************************************************************
  * Name: efm32_dumpnvic
  *
diff --git a/arch/arm/src/eoss3/eoss3_irq.c b/arch/arm/src/eoss3/eoss3_irq.c
index 513f3d3434..9a06055904 100644
--- a/arch/arm/src/eoss3/eoss3_irq.c
+++ b/arch/arm/src/eoss3/eoss3_irq.c
@@ -71,12 +71,6 @@
 
 volatile uint32_t *g_current_regs[1];
 
-/* This is the address of the  exception vector table (determined by the
- * linker script).
- */
-
-extern uint32_t _vectors[];
-
 /****************************************************************************
  * Private Functions
  ****************************************************************************/
diff --git a/arch/arm/src/gd32f4/gd32f4xx_irq.c b/arch/arm/src/gd32f4/gd32f4xx_irq.c
index 70b79319b3..1c82c38f3c 100644
--- a/arch/arm/src/gd32f4/gd32f4xx_irq.c
+++ b/arch/arm/src/gd32f4/gd32f4xx_irq.c
@@ -72,12 +72,6 @@
 
 volatile uint32_t *g_current_regs[1];
 
-/* This is the address of the  exception vector table (determined by the
- * linker script).
- */
-
-extern uint32_t _vectors[];
-
 /****************************************************************************
  * Private Functions
  ****************************************************************************/
diff --git a/arch/arm/src/imxrt/imxrt_irq.c b/arch/arm/src/imxrt/imxrt_irq.c
index 331732e7ab..38e3f46ccd 100644
--- a/arch/arm/src/imxrt/imxrt_irq.c
+++ b/arch/arm/src/imxrt/imxrt_irq.c
@@ -74,16 +74,6 @@
 
 volatile uint32_t *g_current_regs[1];
 
-/* This is the address of the  exception vector table (determined by the
- * linker script).
- */
-
-extern uint32_t _vectors[];
-
-/****************************************************************************
- * Private Data
- ****************************************************************************/
-
 /****************************************************************************
  * Private Functions
  ****************************************************************************/
diff --git a/arch/arm/src/kinetis/kinetis_irq.c b/arch/arm/src/kinetis/kinetis_irq.c
index 599bab0e19..1e863c6e30 100644
--- a/arch/arm/src/kinetis/kinetis_irq.c
+++ b/arch/arm/src/kinetis/kinetis_irq.c
@@ -69,16 +69,6 @@
 
 volatile uint32_t *g_current_regs[1];
 
-/* This is the address of the  exception vector table (determined by the
- * linker script).
- */
-
-extern uint32_t _vectors[];
-
-/****************************************************************************
- * Private Data
- ****************************************************************************/
-
 /****************************************************************************
  * Private Functions
  ****************************************************************************/
diff --git a/arch/arm/src/lpc17xx_40xx/lpc17_40_irq.c b/arch/arm/src/lpc17xx_40xx/lpc17_40_irq.c
index c88341da48..fe2b6e5b39 100644
--- a/arch/arm/src/lpc17xx_40xx/lpc17_40_irq.c
+++ b/arch/arm/src/lpc17xx_40xx/lpc17_40_irq.c
@@ -70,12 +70,6 @@
 
 volatile uint32_t *g_current_regs[1];
 
-/* This is the address of the  exception vector table (determined by the
- * linker script).
- */
-
-extern uint32_t _vectors[];
-
 /****************************************************************************
  * Private Functions
  ****************************************************************************/
diff --git a/arch/arm/src/lpc43xx/lpc43_irq.c b/arch/arm/src/lpc43xx/lpc43_irq.c
index f4fd374558..efbeaa6fc5 100644
--- a/arch/arm/src/lpc43xx/lpc43_irq.c
+++ b/arch/arm/src/lpc43xx/lpc43_irq.c
@@ -70,12 +70,6 @@
 
 volatile uint32_t *g_current_regs[1];
 
-/* This is the address of the  exception vector table (determined by the
- * linker script).
- */
-
-extern uint32_t _vectors[];
-
 /****************************************************************************
  * Private Functions
  ****************************************************************************/
diff --git a/arch/arm/src/lpc54xx/lpc54_irq.c b/arch/arm/src/lpc54xx/lpc54_irq.c
index f3e5c9699c..b4591d9230 100644
--- a/arch/arm/src/lpc54xx/lpc54_irq.c
+++ b/arch/arm/src/lpc54xx/lpc54_irq.c
@@ -69,12 +69,6 @@
 
 volatile uint32_t *g_current_regs[1];
 
-/* This is the address of the  exception vector table (determined by the
- * linker script).
- */
-
-extern uint32_t _vectors[];
-
 /****************************************************************************
  * Private Functions
  ****************************************************************************/
diff --git a/arch/arm/src/max326xx/common/max326_irq.c b/arch/arm/src/max326xx/common/max326_irq.c
index ff874828ae..ac2fdfd63e 100644
--- a/arch/arm/src/max326xx/common/max326_irq.c
+++ b/arch/arm/src/max326xx/common/max326_irq.c
@@ -69,12 +69,6 @@
 
 volatile uint32_t *g_current_regs[1];
 
-/* This is the address of the  exception vector table (determined by the
- * linker script).
- */
-
-extern uint32_t _vectors[];
-
 /****************************************************************************
  * Private Functions
  ****************************************************************************/
diff --git a/arch/arm/src/nrf52/nrf52_irq.c b/arch/arm/src/nrf52/nrf52_irq.c
index 31cb76e148..442c41d20e 100644
--- a/arch/arm/src/nrf52/nrf52_irq.c
+++ b/arch/arm/src/nrf52/nrf52_irq.c
@@ -71,12 +71,6 @@
 
 volatile uint32_t *g_current_regs[1];
 
-/* This is the address of the  exception vector table (determined by the
- * linker script).
- */
-
-extern uint32_t _vectors[];
-
 /****************************************************************************
  * Private Functions
  ****************************************************************************/
diff --git a/arch/arm/src/nrf53/nrf53_irq.c b/arch/arm/src/nrf53/nrf53_irq.c
index 255ae23a63..9e331f04c0 100644
--- a/arch/arm/src/nrf53/nrf53_irq.c
+++ b/arch/arm/src/nrf53/nrf53_irq.c
@@ -71,12 +71,6 @@
 
 volatile uint32_t *g_current_regs[1];
 
-/* This is the address of the  exception vector table (determined by the
- * linker script).
- */
-
-extern uint32_t _vectors[];
-
 /****************************************************************************
  * Private Functions
  ****************************************************************************/
diff --git a/arch/arm/src/rp2040/rp2040_irq.c b/arch/arm/src/rp2040/rp2040_irq.c
index 6d7a06b8dc..21e1b37777 100644
--- a/arch/arm/src/rp2040/rp2040_irq.c
+++ b/arch/arm/src/rp2040/rp2040_irq.c
@@ -88,16 +88,6 @@ const uint32_t g_cpu_intstack_top[CONFIG_SMP_NCPUS] =
 };
 #endif /* defined(CONFIG_SMP) && CONFIG_ARCH_INTERRUPTSTACK > 7 */
 
-/* This is the address of the  exception vector table (determined by the
- * linker script).
- */
-
-extern uint32_t _vectors[];
-
-/****************************************************************************
- * Private Data
- ****************************************************************************/
-
 /****************************************************************************
  * Private Functions
  ****************************************************************************/
diff --git a/arch/arm/src/rtl8720c/ameba_nvic.c b/arch/arm/src/rtl8720c/ameba_nvic.c
index 88cf34b38b..343a8d8a70 100644
--- a/arch/arm/src/rtl8720c/ameba_nvic.c
+++ b/arch/arm/src/rtl8720c/ameba_nvic.c
@@ -64,10 +64,6 @@
 
 volatile uint32_t *g_current_regs[CONFIG_SMP_NCPUS];
 
-/* extern int32_t    __StackLimit; */
-
-extern uint32_t   _vectors[];
-
 /****************************************************************************
  * Private Function Declarations
  ****************************************************************************/
diff --git a/arch/arm/src/rtl8720c/ameba_vectors.c b/arch/arm/src/rtl8720c/ameba_vectors.c
index db225ee0a1..322c24501c 100644
--- a/arch/arm/src/rtl8720c/ameba_vectors.c
+++ b/arch/arm/src/rtl8720c/ameba_vectors.c
@@ -31,7 +31,7 @@
  ****************************************************************************/
 
 extern uint32_t __stack;
-#define IDLE_STACK      ((unsigned int)&__stack - 4)
+#define IDLE_STACK      ((const char *)&__stack - 4)
 #ifndef ARMV8M_PERIPHERAL_INTERRUPTS
 #  error ARMV8M_PERIPHERAL_INTERRUPTS must be defined to the number of I/O interrupts to be supported
 #endif
@@ -63,8 +63,7 @@ extern void exception_common(void);
  * Note that the [ ... ] designated initialiser is a GCC extension.
  */
 
-const unsigned int _vectors[] locate_data(".vectors") \
-                    aligned_data(0x100) =
+const void *_vectors[] locate_data(".vectors") aligned_data(0x100) =
 {
   /* Initial stack */
 
@@ -72,11 +71,10 @@ const unsigned int _vectors[] locate_data(".vectors") \
 
   /* Reset exception handler */
 
-  (unsigned int) &ram_start,
+  ram_start,
 
   /* Vectors 2 - n point directly at the generic handler */
 
-  [2 ...(15 + ARMV8M_PERIPHERAL_INTERRUPTS)] = (unsigned int)
-                                               &exception_common
+  [2 ...(15 + ARMV8M_PERIPHERAL_INTERRUPTS)] = exception_common
 };
 
diff --git a/arch/arm/src/s32k1xx/s32k14x/s32k14x_irq.c b/arch/arm/src/s32k1xx/s32k14x/s32k14x_irq.c
index 21c0ac5c4b..852232bfaf 100644
--- a/arch/arm/src/s32k1xx/s32k14x/s32k14x_irq.c
+++ b/arch/arm/src/s32k1xx/s32k14x/s32k14x_irq.c
@@ -69,12 +69,6 @@
 
 volatile uint32_t *g_current_regs[1];
 
-/* This is the address of the  exception vector table (determined by the
- * linker script).
- */
-
-extern uint32_t _vectors[];
-
 /****************************************************************************
  * Private Functions
  ****************************************************************************/
diff --git a/arch/arm/src/s32k3xx/s32k3xx_irq.c b/arch/arm/src/s32k3xx/s32k3xx_irq.c
index 4810f8c628..7d1c132657 100644
--- a/arch/arm/src/s32k3xx/s32k3xx_irq.c
+++ b/arch/arm/src/s32k3xx/s32k3xx_irq.c
@@ -76,12 +76,6 @@
 
 volatile uint32_t *g_current_regs[1];
 
-/* This is the address of the  exception vector table (determined by the
- * linker script).
- */
-
-extern uint32_t _vectors[];
-
 /****************************************************************************
  * Private Functions
  ****************************************************************************/
diff --git a/arch/arm/src/sam34/sam_irq.c b/arch/arm/src/sam34/sam_irq.c
index 9eea9ca9c2..f0e2606d27 100644
--- a/arch/arm/src/sam34/sam_irq.c
+++ b/arch/arm/src/sam34/sam_irq.c
@@ -72,16 +72,6 @@
 
 volatile uint32_t *g_current_regs[CONFIG_SMP_NCPUS];
 
-/* This is the address of the  exception vector table (determined by the
- * linker script).
- */
-
-extern uint32_t _vectors[];
-
-/****************************************************************************
- * Private Data
- ****************************************************************************/
-
 /****************************************************************************
  * Private Functions
  ****************************************************************************/
diff --git a/arch/arm/src/samd5e5/sam_irq.c b/arch/arm/src/samd5e5/sam_irq.c
index 9346cbcfdb..0e1a5ea894 100644
--- a/arch/arm/src/samd5e5/sam_irq.c
+++ b/arch/arm/src/samd5e5/sam_irq.c
@@ -72,16 +72,6 @@
 
 volatile uint32_t *g_current_regs[CONFIG_SMP_NCPUS];
 
-/* This is the address of the  exception vector table (determined by the
- * linker script).
- */
-
-extern uint32_t _vectors[];
-
-/****************************************************************************
- * Private Data
- ****************************************************************************/
-
 /****************************************************************************
  * Private Functions
  ****************************************************************************/
diff --git a/arch/arm/src/samv7/sam_irq.c b/arch/arm/src/samv7/sam_irq.c
index 76d0aa4c7a..b6c782efa0 100644
--- a/arch/arm/src/samv7/sam_irq.c
+++ b/arch/arm/src/samv7/sam_irq.c
@@ -72,16 +72,6 @@
 
 volatile uint32_t *g_current_regs[1];
 
-/* This is the address of the  exception vector table (determined by the
- * linker script).
- */
-
-extern uint32_t _vectors[];
-
-/****************************************************************************
- * Private Data
- ****************************************************************************/
-
 /****************************************************************************
  * Private Functions
  ****************************************************************************/
diff --git a/arch/arm/src/stm32/stm32_irq.c b/arch/arm/src/stm32/stm32_irq.c
index 31c03b038c..cfb5e0eee7 100644
--- a/arch/arm/src/stm32/stm32_irq.c
+++ b/arch/arm/src/stm32/stm32_irq.c
@@ -72,18 +72,6 @@
 
 volatile uint32_t *g_current_regs[1];
 
-/* This is the address of the  exception vector table (determined by the
- * linker script).
- */
-
-#if defined(__ICCARM__)
-/* _vectors replaced on __vector_table for IAR C-SPY Simulator */
-
-extern uint32_t __vector_table[];
-#else
-extern uint32_t _vectors[];
-#endif
-
 /****************************************************************************
  * Private Functions
  ****************************************************************************/
diff --git a/arch/arm/src/stm32/stm32_rcc.h b/arch/arm/src/stm32/stm32_rcc.h
index bb9e3e9f24..4e49bfaf20 100644
--- a/arch/arm/src/stm32/stm32_rcc.h
+++ b/arch/arm/src/stm32/stm32_rcc.h
@@ -65,26 +65,6 @@ extern "C"
 #define EXTERN extern
 #endif
 
-/****************************************************************************
- * Public Data
- ****************************************************************************/
-
-/* This symbol references the Cortex-M3/4 vector table (as positioned by the
- * linker script, ld.script or ld.script.dfu.  The standard location for the
- * vector table is at the beginning of FLASH at address 0x0800:0000.  If we
- * are using the STMicro DFU bootloader, then the vector table will be offset
- * to a different location in FLASH and we will need to set the NVIC vector
- * location to this alternative location.
- */
-
-#if defined(__ICCARM__)
-/* _vectors replaced on __vector_table for IAR C-SPY Simulator */
-
-extern uint32_t __vector_table[];
-#else
-extern uint32_t _vectors[];
-#endif
-
 /****************************************************************************
  * Inline Functions
  ****************************************************************************/
diff --git a/arch/arm/src/stm32f7/stm32_irq.c b/arch/arm/src/stm32f7/stm32_irq.c
index 63117914b7..adf3d883de 100644
--- a/arch/arm/src/stm32f7/stm32_irq.c
+++ b/arch/arm/src/stm32f7/stm32_irq.c
@@ -73,16 +73,6 @@
 
 volatile uint32_t *g_current_regs[1];
 
-/* This is the address of the  exception vector table (determined by the
- * linker script).
- */
-
-extern uint32_t _vectors[];
-
-/****************************************************************************
- * Private Data
- ****************************************************************************/
-
 /****************************************************************************
  * Private Functions
  ****************************************************************************/
diff --git a/arch/arm/src/stm32f7/stm32_rcc.h b/arch/arm/src/stm32f7/stm32_rcc.h
index ae960de3c7..47e34a0111 100644
--- a/arch/arm/src/stm32f7/stm32_rcc.h
+++ b/arch/arm/src/stm32f7/stm32_rcc.h
@@ -45,20 +45,6 @@ extern "C"
 #define EXTERN extern
 #endif
 
-/****************************************************************************
- * Public Data
- ****************************************************************************/
-
-/* This symbol references the Cortex-M7 vector table (as positioned by the
- * linker script, ld.script or ld.script.dfu.  The standard location for the
- * vector table is at the beginning of FLASH at address 0x0800:0000.
- * If we are using the STMicro DFU bootloader, then the vector table will
- * be offset to a different location in FLASH and we will need to set the
- * NVIC vector location to this alternative location.
- */
-
-extern uint32_t _vectors[];  /* See stm32_vectors.S */
-
 /****************************************************************************
  * Inline Functions
  ****************************************************************************/
diff --git a/arch/arm/src/stm32h7/stm32_irq.c b/arch/arm/src/stm32h7/stm32_irq.c
index 4b7aeab273..77ee3f4750 100644
--- a/arch/arm/src/stm32h7/stm32_irq.c
+++ b/arch/arm/src/stm32h7/stm32_irq.c
@@ -73,12 +73,6 @@
 
 volatile uint32_t *g_current_regs[1];
 
-/* This is the address of the  exception vector table (determined by the
- * linker script).
- */
-
-extern uint32_t _vectors[];
-
 /****************************************************************************
  * Private Functions
  ****************************************************************************/
diff --git a/arch/arm/src/stm32h7/stm32_rcc.h b/arch/arm/src/stm32h7/stm32_rcc.h
index 678f0c3b18..c15b4fee8c 100644
--- a/arch/arm/src/stm32h7/stm32_rcc.h
+++ b/arch/arm/src/stm32h7/stm32_rcc.h
@@ -45,20 +45,6 @@ extern "C"
 #define EXTERN extern
 #endif
 
-/****************************************************************************
- * Public Data
- ****************************************************************************/
-
-/* This symbol references the Cortex-M7 vector table (as positioned by the
- * linker script).  The standard location for the vector table is at the
- * beginning of FLASH at address 0x0800:0000.  If we are using the STMicro
- * DFU bootloader, then the vector table will be offset to a different
- * location in FLASH and we will need to set the NVIC vector location to
- * this alternative location.
- */
-
-extern uint32_t _vectors[];  /* See armv7-m/arm_vectors.c */
-
 /****************************************************************************
  * Inline Functions
  ****************************************************************************/
diff --git a/arch/arm/src/stm32l4/stm32l4_irq.c b/arch/arm/src/stm32l4/stm32l4_irq.c
index 9453041c28..b043cce294 100644
--- a/arch/arm/src/stm32l4/stm32l4_irq.c
+++ b/arch/arm/src/stm32l4/stm32l4_irq.c
@@ -69,12 +69,6 @@
 
 volatile uint32_t *g_current_regs[1];
 
-/* This is the address of the  exception vector table (determined by the
- * linker script).
- */
-
-extern uint32_t _vectors[];
-
 /****************************************************************************
  * Private Functions
  ****************************************************************************/
diff --git a/arch/arm/src/stm32l4/stm32l4_rcc.h b/arch/arm/src/stm32l4/stm32l4_rcc.h
index ff539b0d31..c3fcdde622 100644
--- a/arch/arm/src/stm32l4/stm32l4_rcc.h
+++ b/arch/arm/src/stm32l4/stm32l4_rcc.h
@@ -57,20 +57,6 @@ extern "C"
 #define EXTERN extern
 #endif
 
-/****************************************************************************
- * Public Data
- ****************************************************************************/
-
-/* This symbol references the Cortex-M4 vector table (as positioned by the
- * linker script, ld.script or ld.script.dfu.  The standard location for the
- * vector table is at the beginning of FLASH at address 0x0800:0000.
- * If we are using the STMicro DFU bootloader, then the vector table will be
- * offset to a different location in FLASH and we will need to set the NVIC
- * vector location to this alternative location.
- */
-
-extern uint32_t _vectors[];  /* See stm32l4_vectors.S */
-
 /****************************************************************************
  * Inline Functions
  ****************************************************************************/
diff --git a/arch/arm/src/stm32l5/stm32l5_irq.c b/arch/arm/src/stm32l5/stm32l5_irq.c
index f1820a7eea..99592710c3 100644
--- a/arch/arm/src/stm32l5/stm32l5_irq.c
+++ b/arch/arm/src/stm32l5/stm32l5_irq.c
@@ -69,16 +69,6 @@
 
 volatile uint32_t *g_current_regs[1];
 
-/* This is the address of the  exception vector table (determined by the
- * linker script).
- */
-
-extern uint32_t _vectors[];
-
-/****************************************************************************
- * Private Functions
- ****************************************************************************/
-
 /****************************************************************************
  * Name: stm32l5_dumpnvic
  *
diff --git a/arch/arm/src/stm32l5/stm32l5_rcc.h b/arch/arm/src/stm32l5/stm32l5_rcc.h
index f855535d10..d9e1cd1fee 100644
--- a/arch/arm/src/stm32l5/stm32l5_rcc.h
+++ b/arch/arm/src/stm32l5/stm32l5_rcc.h
@@ -51,20 +51,6 @@ extern "C"
 #define EXTERN extern
 #endif
 
-/****************************************************************************
- * Public Data
- ****************************************************************************/
-
-/* This symbol references the Cortex-M33 vector table (as positioned by the
- * linker script, ld.script or ld.script.dfu.  The standard location for the
- * vector table is at the beginning of FLASH at address 0x0800:0000.  If we
- * are using the STMicro DFU bootloader, then the vector table will be offset
- * to a different location in FLASH and we will need to set the NVIC vector
- * location to this alternative location.
- */
-
-extern uint32_t _vectors[];  /* See stm32l5_vectors.S */
-
 /****************************************************************************
  * Inline Functions
  ****************************************************************************/
diff --git a/arch/arm/src/stm32u5/stm32_irq.c b/arch/arm/src/stm32u5/stm32_irq.c
index 9468f4785f..cff7e3a1d9 100644
--- a/arch/arm/src/stm32u5/stm32_irq.c
+++ b/arch/arm/src/stm32u5/stm32_irq.c
@@ -69,12 +69,6 @@
 
 volatile uint32_t *g_current_regs[1];
 
-/* This is the address of the  exception vector table (determined by the
- * linker script).
- */
-
-extern uint32_t _vectors[];
-
 /****************************************************************************
  * Private Functions
  ****************************************************************************/
diff --git a/arch/arm/src/stm32u5/stm32_rcc.h b/arch/arm/src/stm32u5/stm32_rcc.h
index 253f0d05a0..7bf863f143 100644
--- a/arch/arm/src/stm32u5/stm32_rcc.h
+++ b/arch/arm/src/stm32u5/stm32_rcc.h
@@ -51,20 +51,6 @@ extern "C"
 #define EXTERN extern
 #endif
 
-/****************************************************************************
- * Public Data
- ****************************************************************************/
-
-/* This symbol references the Cortex-M33 vector table (as positioned by the
- * linker script, ld.script or ld.script.dfu.  The standard location for the
- * vector table is at the beginning of FLASH at address 0x0800:0000.  If we
- * are using the STMicro DFU bootloader, then the vector table will be offset
- * to a different location in FLASH and we will need to set the NVIC vector
- * location to this alternative location.
- */
-
-extern uint32_t _vectors[];  /* See stm32_vectors.S */
-
 /****************************************************************************
  * Inline Functions
  ****************************************************************************/
diff --git a/arch/arm/src/stm32wb/stm32wb_rcc.h b/arch/arm/src/stm32wb/stm32wb_rcc.h
index a2a3af979c..cfe2c6dc78 100644
--- a/arch/arm/src/stm32wb/stm32wb_rcc.h
+++ b/arch/arm/src/stm32wb/stm32wb_rcc.h
@@ -45,26 +45,6 @@ extern "C"
 #define EXTERN extern
 #endif
 
-/****************************************************************************
- * Public Data
- ****************************************************************************/
-
-/* This symbol references the Cortex-M4 vector table (as positioned by the
- * linker script, ld.script or ld.script.dfu.  The standard location for the
- * vector table is at the beginning of FLASH at address 0x0800:0000.  If we
- * are using the STMicro DFU bootloader, then the vector table will be offset
- * to a different location in FLASH and we will need to set the NVIC vector
- * location to this alternative location.
- */
-
-#if defined(__ICCARM__)
-/* _vectors replaced on __vector_table for IAR C-SPY Simulator */
-
-EXTERN uint32_t __vector_table[];
-#else
-EXTERN uint32_t _vectors[];
-#endif
-
 /****************************************************************************
  * Public Types
  ****************************************************************************/
diff --git a/arch/arm/src/stm32wl5/stm32wl5_irq.c b/arch/arm/src/stm32wl5/stm32wl5_irq.c
index 1b816c6f00..8c003c050a 100644
--- a/arch/arm/src/stm32wl5/stm32wl5_irq.c
+++ b/arch/arm/src/stm32wl5/stm32wl5_irq.c
@@ -70,12 +70,6 @@
 
 volatile uint32_t *g_current_regs[1];
 
-/* This is the address of the  exception vector table (determined by the
- * linker script).
- */
-
-extern uint32_t _vectors[];
-
 /****************************************************************************
  * Private Functions
  ****************************************************************************/
diff --git a/arch/arm/src/stm32wl5/stm32wl5_rcc.h b/arch/arm/src/stm32wl5/stm32wl5_rcc.h
index 062a5035b9..e4c73ee8bd 100644
--- a/arch/arm/src/stm32wl5/stm32wl5_rcc.h
+++ b/arch/arm/src/stm32wl5/stm32wl5_rcc.h
@@ -47,20 +47,6 @@ extern "C"
 #define EXTERN extern
 #endif
 
-/****************************************************************************
- * Public Data
- ****************************************************************************/
-
-/* This symbol references the Cortex-M33 vector table (as positioned by the
- * linker script, ld.script or ld.script.dfu.  The standard location for the
- * vector table is at the beginning of FLASH at address 0x0800:0000.  If we
- * are using the STMicro DFU bootloader, then the vector table will be offset
- * to a different location in FLASH and we will need to set the NVIC vector
- * location to this alternative location.
- */
-
-extern uint32_t _vectors[];  /* See stm32wl5_vectors.S */
-
 /****************************************************************************
  * Inline Functions
  ****************************************************************************/
diff --git a/arch/arm/src/tiva/common/tiva_irq.c b/arch/arm/src/tiva/common/tiva_irq.c
index f9b5f0f33d..670d712b1d 100644
--- a/arch/arm/src/tiva/common/tiva_irq.c
+++ b/arch/arm/src/tiva/common/tiva_irq.c
@@ -70,16 +70,6 @@
 
 volatile uint32_t *g_current_regs[1];
 
-/* This is the address of the  exception vector table (determined by the
- * linker script).
- */
-
-extern uint32_t _vectors[];
-
-/****************************************************************************
- * Private Data
- ****************************************************************************/
-
 /****************************************************************************
  * Private Functions
  ****************************************************************************/
diff --git a/arch/arm/src/xmc4/xmc4_irq.c b/arch/arm/src/xmc4/xmc4_irq.c
index f2dc310707..30fe949ace 100644
--- a/arch/arm/src/xmc4/xmc4_irq.c
+++ b/arch/arm/src/xmc4/xmc4_irq.c
@@ -68,16 +68,6 @@
 
 volatile uint32_t *g_current_regs[1];
 
-/* This is the address of the  exception vector table (determined by the
- * linker script).
- */
-
-extern uint32_t _vectors[];
-
-/****************************************************************************
- * Private Data
- ****************************************************************************/
-
 /****************************************************************************
  * Private Functions
  ****************************************************************************/
diff --git a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_flexspi_nor_boot.c b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_flexspi_nor_boot.c
index 09cec412cb..671e147958 100644
--- a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_flexspi_nor_boot.c
+++ b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_flexspi_nor_boot.c
@@ -23,6 +23,7 @@
  ****************************************************************************/
 
 #include "imxrt_flexspi_nor_boot.h"
+#include "arm_internal.h"
 
 /****************************************************************************
  * Public Data
diff --git a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_flexspi_nor_boot.h b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_flexspi_nor_boot.h
index e98b689331..a38be3aaa5 100644
--- a/boards/arm/imxrt/imxrt1060-evk/src/imxrt_flexspi_nor_boot.h
+++ b/boards/arm/imxrt/imxrt1060-evk/src/imxrt_flexspi_nor_boot.h
@@ -91,7 +91,7 @@
 
 /* Located in Destination Memory */
 
-#define IMAGE_ENTRY_ADDRESS        ((uint32_t)&_vectors)
+#define IMAGE_ENTRY_ADDRESS        ((uint32_t)_vectors)
 #define IMAG_VECTOR_TABLE           LOCATE_IN_DEST(&g_image_vector_table)
 
 /****************************************************************************
@@ -156,7 +156,6 @@ struct boot_data_s
  ****************************************************************************/
 
 extern const struct boot_data_s g_boot_data;
-extern  const uint8_t g_dcd_data[];
-extern  const uint32_t  _vectors[];
+extern const uint8_t g_dcd_data[];
 
 #endif /* __BOARDS_ARM_IMXRT_IMXRT1060_EVK_SRC_IMXRT_FLEXSPI_NOR_BOOT_H */
diff --git a/boards/arm/imxrt/imxrt1064-evk/src/imxrt_flexspi_nor_boot.c b/boards/arm/imxrt/imxrt1064-evk/src/imxrt_flexspi_nor_boot.c
index 018994d9e4..f68bc9ff8e 100644
--- a/boards/arm/imxrt/imxrt1064-evk/src/imxrt_flexspi_nor_boot.c
+++ b/boards/arm/imxrt/imxrt1064-evk/src/imxrt_flexspi_nor_boot.c
@@ -23,6 +23,7 @@
  ****************************************************************************/
 
 #include "imxrt_flexspi_nor_boot.h"
+#include "arm_internal.h"
 
 /****************************************************************************
  * Public Data
diff --git a/boards/arm/imxrt/imxrt1064-evk/src/imxrt_flexspi_nor_boot.h b/boards/arm/imxrt/imxrt1064-evk/src/imxrt_flexspi_nor_boot.h
index 6cf8eae8ca..f9f9117baf 100644
--- a/boards/arm/imxrt/imxrt1064-evk/src/imxrt_flexspi_nor_boot.h
+++ b/boards/arm/imxrt/imxrt1064-evk/src/imxrt_flexspi_nor_boot.h
@@ -95,7 +95,7 @@
 
 /* Located in Destination Memory */
 
-#define IMAGE_ENTRY_ADDRESS        ((uint32_t)&_vectors)
+#define IMAGE_ENTRY_ADDRESS        ((uint32_t)_vectors)
 #define IMAG_VECTOR_TABLE           LOCATE_IN_DEST(&g_image_vector_table)
 
 /****************************************************************************
@@ -163,6 +163,5 @@ extern const struct boot_data_s g_boot_data;
 #ifdef CONFIG_IMXRT1064_EVK_SDRAM
 extern const uint8_t g_dcd_data[];
 #endif
-extern  const uint32_t  _vectors[];
 
 #endif /* __BOARDS_ARM_IMXRT_IMXRT1060_EVK_SRC_IMXRT_FLEXSPI_NOR_BOOT_H */
diff --git a/boards/arm/imxrt/teensy-4.x/src/imxrt_flexspi_nor_boot.c b/boards/arm/imxrt/teensy-4.x/src/imxrt_flexspi_nor_boot.c
index b962e4bf78..b69a386809 100644
--- a/boards/arm/imxrt/teensy-4.x/src/imxrt_flexspi_nor_boot.c
+++ b/boards/arm/imxrt/teensy-4.x/src/imxrt_flexspi_nor_boot.c
@@ -23,6 +23,7 @@
  ****************************************************************************/
 
 #include "imxrt_flexspi_nor_boot.h"
+#include "arm_internal.h"
 
 /****************************************************************************
  * Public Data
diff --git a/boards/arm/imxrt/teensy-4.x/src/imxrt_flexspi_nor_boot.h b/boards/arm/imxrt/teensy-4.x/src/imxrt_flexspi_nor_boot.h
index faf87e8bc8..17bfb420fe 100644
--- a/boards/arm/imxrt/teensy-4.x/src/imxrt_flexspi_nor_boot.h
+++ b/boards/arm/imxrt/teensy-4.x/src/imxrt_flexspi_nor_boot.h
@@ -91,7 +91,7 @@
 
 /* Located in Destination Memory */
 
-#define IMAGE_ENTRY_ADDRESS        ((uint32_t)&_vectors)
+#define IMAGE_ENTRY_ADDRESS        ((uint32_t)_vectors)
 #define IMAG_VECTOR_TABLE           LOCATE_IN_DEST(&g_image_vector_table)
 
 /****************************************************************************
@@ -152,6 +152,5 @@ struct boot_data_s
 
 extern const struct boot_data_s g_boot_data;
 extern const uint8_t g_dcd_data[];
-extern const uint32_t _vectors[];
 
 #endif /* __BOARDS_ARM_IMXRT_TEENSY_4_SRC_IMXRT_FLEXSPI_NOR_BOOT_H */