You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ma...@apache.org on 2015/11/09 22:10:49 UTC
incubator-mynewt-larva git commit: Move NVIC_Relocate() and friends
from BSPs to libs/cmsis-core/src.
Repository: incubator-mynewt-larva
Updated Branches:
refs/heads/master 5113d5f92 -> 7e851280f
Move NVIC_Relocate() and friends from BSPs to libs/cmsis-core/src.
Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/7e851280
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/7e851280
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/7e851280
Branch: refs/heads/master
Commit: 7e851280f35e56432dcb2575b54982f7cad8fc95
Parents: 5113d5f
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Mon Nov 9 13:09:38 2015 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Mon Nov 9 13:09:38 2015 -0800
----------------------------------------------------------------------
hw/bsp/nrf52pdk/src/cmsis_nvic.c | 69 --------------------
.../olimex_stm32-e407_devboard/src/cmsis_nvic.c | 69 --------------------
hw/bsp/stm32f3discovery/src/cmsis_nvic.c | 69 --------------------
libs/cmsis-core/src/cmsis_nvic.c | 69 ++++++++++++++++++++
4 files changed, 69 insertions(+), 207 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/7e851280/hw/bsp/nrf52pdk/src/cmsis_nvic.c
----------------------------------------------------------------------
diff --git a/hw/bsp/nrf52pdk/src/cmsis_nvic.c b/hw/bsp/nrf52pdk/src/cmsis_nvic.c
deleted file mode 100644
index d39814e..0000000
--- a/hw/bsp/nrf52pdk/src/cmsis_nvic.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- * Copyright (c) 2015 Runtime Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/* mbed Microcontroller Library - cmsis_nvic for STM32F4
- * Copyright (c) 2009-2011 ARM Limited. All rights reserved.
- *
- * CMSIS-style functionality to support dynamic vectors
- */
-#include "bsp/cmsis_nvic.h"
-
-extern char __isr_vector[];
-extern char __vector_tbl_reloc__[];
-
-void
-NVIC_Relocate(void)
-{
- uint32_t *current_location;
- uint32_t *new_location;
- int i;
-
- /*
- * Relocate the vector table from its current position to the position
- * designated in the linker script.
- */
- current_location = (uint32_t *)&__isr_vector;
- new_location = (uint32_t *)&__vector_tbl_reloc__;
-
- if (new_location != current_location) {
- for (i = 0; i < NVIC_NUM_VECTORS; i++) {
- new_location[i] = current_location[i];
- }
- }
-
- /* Set VTOR */
- SCB->VTOR = (uint32_t)&__vector_tbl_reloc__;
-}
-
-void
-NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)
-{
- uint32_t *vectors;
-
- vectors = (uint32_t *)SCB->VTOR;
- vectors[IRQn + NVIC_USER_IRQ_OFFSET] = vector;
- __DMB();
-}
-
-uint32_t
-NVIC_GetVector(IRQn_Type IRQn)
-{
- uint32_t *vectors;
-
- vectors = (uint32_t*)SCB->VTOR;
- return vectors[IRQn + NVIC_USER_IRQ_OFFSET];
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/7e851280/hw/bsp/olimex_stm32-e407_devboard/src/cmsis_nvic.c
----------------------------------------------------------------------
diff --git a/hw/bsp/olimex_stm32-e407_devboard/src/cmsis_nvic.c b/hw/bsp/olimex_stm32-e407_devboard/src/cmsis_nvic.c
deleted file mode 100644
index d39814e..0000000
--- a/hw/bsp/olimex_stm32-e407_devboard/src/cmsis_nvic.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- * Copyright (c) 2015 Runtime Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/* mbed Microcontroller Library - cmsis_nvic for STM32F4
- * Copyright (c) 2009-2011 ARM Limited. All rights reserved.
- *
- * CMSIS-style functionality to support dynamic vectors
- */
-#include "bsp/cmsis_nvic.h"
-
-extern char __isr_vector[];
-extern char __vector_tbl_reloc__[];
-
-void
-NVIC_Relocate(void)
-{
- uint32_t *current_location;
- uint32_t *new_location;
- int i;
-
- /*
- * Relocate the vector table from its current position to the position
- * designated in the linker script.
- */
- current_location = (uint32_t *)&__isr_vector;
- new_location = (uint32_t *)&__vector_tbl_reloc__;
-
- if (new_location != current_location) {
- for (i = 0; i < NVIC_NUM_VECTORS; i++) {
- new_location[i] = current_location[i];
- }
- }
-
- /* Set VTOR */
- SCB->VTOR = (uint32_t)&__vector_tbl_reloc__;
-}
-
-void
-NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)
-{
- uint32_t *vectors;
-
- vectors = (uint32_t *)SCB->VTOR;
- vectors[IRQn + NVIC_USER_IRQ_OFFSET] = vector;
- __DMB();
-}
-
-uint32_t
-NVIC_GetVector(IRQn_Type IRQn)
-{
- uint32_t *vectors;
-
- vectors = (uint32_t*)SCB->VTOR;
- return vectors[IRQn + NVIC_USER_IRQ_OFFSET];
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/7e851280/hw/bsp/stm32f3discovery/src/cmsis_nvic.c
----------------------------------------------------------------------
diff --git a/hw/bsp/stm32f3discovery/src/cmsis_nvic.c b/hw/bsp/stm32f3discovery/src/cmsis_nvic.c
deleted file mode 100644
index 7d73933..0000000
--- a/hw/bsp/stm32f3discovery/src/cmsis_nvic.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- * Copyright (c) 2015 Runtime Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/* mbed Microcontroller Library - cmsis_nvic for STM32F4
- * Copyright (c) 2009-2011 ARM Limited. All rights reserved.
- *
- * CMSIS-style functionality to support dynamic vectors
- */
-#include "bsp/cmsis_nvic.h"
-
-extern char __isr_vector[];
-extern char __vector_tbl_reloc__[];
-
-void
-NVIC_Relocate(void)
-{
- uint32_t *current_location;
- uint32_t *new_location;
- int i;
-
- /*
- * Relocate the vector table from its current position to the position
- * designated in the linker script.
- */
- current_location = (uint32_t *)&__isr_vector;
- new_location = (uint32_t *)&__vector_tbl_reloc__;
-
- if (new_location != current_location) {
- for (i = 0; i < NVIC_NUM_VECTORS; i++) {
- new_location[i] = current_location[i];
- }
- }
-
- /* Set VTOR */
- SCB->VTOR = (uint32_t)&__vector_tbl_reloc__;
-}
-
-void
-NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)
-{
- uint32_t *vectors;
-
- vectors = (uint32_t *)SCB->VTOR;
- vectors[IRQn + NVIC_USER_IRQ_OFFSET] = vector;
- __DMB();
-}
-
-uint32_t
-NVIC_GetVector(IRQn_Type IRQn)
-{
- uint32_t *vectors;
-
- vectors = (uint32_t*)SCB->VTOR;
- return vectors[IRQn + NVIC_USER_IRQ_OFFSET];
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/7e851280/libs/cmsis-core/src/cmsis_nvic.c
----------------------------------------------------------------------
diff --git a/libs/cmsis-core/src/cmsis_nvic.c b/libs/cmsis-core/src/cmsis_nvic.c
new file mode 100644
index 0000000..ffee566
--- /dev/null
+++ b/libs/cmsis-core/src/cmsis_nvic.c
@@ -0,0 +1,69 @@
+/**
+ * Copyright (c) 2015 Runtime Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* mbed Microcontroller Library - cmsis_nvic for XXXX
+ * Copyright (c) 2009-2011 ARM Limited. All rights reserved.
+ *
+ * CMSIS-style functionality to support dynamic vectors
+ */
+#include "bsp/cmsis_nvic.h"
+
+extern char __isr_vector[];
+extern char __vector_tbl_reloc__[];
+
+void
+NVIC_Relocate(void)
+{
+ uint32_t *current_location;
+ uint32_t *new_location;
+ int i;
+
+ /*
+ * Relocate the vector table from its current position to the position
+ * designated in the linker script.
+ */
+ current_location = (uint32_t *)&__isr_vector;
+ new_location = (uint32_t *)&__vector_tbl_reloc__;
+
+ if (new_location != current_location) {
+ for (i = 0; i < NVIC_NUM_VECTORS; i++) {
+ new_location[i] = current_location[i];
+ }
+ }
+
+ /* Set VTOR */
+ SCB->VTOR = (uint32_t)&__vector_tbl_reloc__;
+}
+
+void
+NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)
+{
+ uint32_t *vectors;
+
+ vectors = (uint32_t *)SCB->VTOR;
+ vectors[IRQn + NVIC_USER_IRQ_OFFSET] = vector;
+ __DMB();
+}
+
+uint32_t
+NVIC_GetVector(IRQn_Type IRQn)
+{
+ uint32_t *vectors;
+
+ vectors = (uint32_t*)SCB->VTOR;
+ return vectors[IRQn + NVIC_USER_IRQ_OFFSET];
+}
+