[PATCH 5/8] bsps/arm: Copy vector table only if necessary

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Jan 15 13:44:22 UTC 2016


---
 c/src/lib/libbsp/arm/shared/armv7m/irq/armv7m-irq.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/c/src/lib/libbsp/arm/shared/armv7m/irq/armv7m-irq.c b/c/src/lib/libbsp/arm/shared/armv7m/irq/armv7m-irq.c
index 6ad9482..53ab513 100644
--- a/c/src/lib/libbsp/arm/shared/armv7m/irq/armv7m-irq.c
+++ b/c/src/lib/libbsp/arm/shared/armv7m/irq/armv7m-irq.c
@@ -42,11 +42,13 @@ rtems_status_code bsp_interrupt_facility_initialize(void)
   ARMV7M_Exception_handler *vector_table =
     (ARMV7M_Exception_handler *) bsp_vector_table_begin;
 
-  memcpy(
-    vector_table,
-    bsp_start_vector_table_begin,
-    (size_t) bsp_vector_table_size
-  );
+  if (bsp_vector_table_begin != bsp_start_vector_table_begin) {
+    memcpy(
+      vector_table,
+      bsp_start_vector_table_begin,
+      (size_t) bsp_vector_table_size
+    );
+  }
 
   for (i = BSP_INTERRUPT_VECTOR_MIN; i <= BSP_INTERRUPT_VECTOR_MAX; ++i) {
     vector_table [ARMV7M_VECTOR_IRQ(i)] = _ARMV7M_NVIC_Interrupt_dispatch;
-- 
1.8.4.5




More information about the devel mailing list