summaryrefslogtreecommitdiff
path: root/bsps/arm/shared/irq/irq-armv7m.c
diff options
context:
space:
mode:
Diffstat (limited to 'bsps/arm/shared/irq/irq-armv7m.c')
-rw-r--r--bsps/arm/shared/irq/irq-armv7m.c50
1 files changed, 32 insertions, 18 deletions
diff --git a/bsps/arm/shared/irq/irq-armv7m.c b/bsps/arm/shared/irq/irq-armv7m.c
index 99c0e373bf..84ebeeb159 100644
--- a/bsps/arm/shared/irq/irq-armv7m.c
+++ b/bsps/arm/shared/irq/irq-armv7m.c
@@ -1,27 +1,41 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
/*
- * Copyright (c) 2011-2012 Sebastian Huber. All rights reserved.
+ * Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
+ * Copyright (C) 2011, 2012 Sebastian Huber
*
- * embedded brains GmbH
- * Obere Lagerstr. 30
- * 82178 Puchheim
- * Germany
- * <rtems@embedded-brains.de>
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
*
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.org/license/LICENSE.
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
*/
-#include <string.h>
-
-#include <rtems/score/armv7m.h>
-
+#include <bsp/irq-generic.h>
#include <bsp.h>
#include <bsp/irq.h>
-#include <bsp/irq-generic.h>
#include <bsp/linker-symbols.h>
#include <bsp/armv7m-irq.h>
+#include <rtems/score/armv7m.h>
+
+#include <string.h>
+
#ifdef ARM_MULTILIB_ARCH_V7M
void bsp_interrupt_vector_enable(rtems_vector_number vector)
@@ -38,9 +52,10 @@ void bsp_interrupt_vector_disable(rtems_vector_number vector)
rtems_status_code bsp_interrupt_facility_initialize(void)
{
- int i;
- ARMV7M_Exception_handler *vector_table =
- (ARMV7M_Exception_handler *) bsp_vector_table_begin;
+ ARMV7M_Exception_handler *vector_table;
+ int i;
+
+ vector_table = (ARMV7M_Exception_handler *) bsp_vector_table_begin;
if (bsp_vector_table_begin != bsp_start_vector_table_begin) {
memcpy(
@@ -53,7 +68,6 @@ rtems_status_code bsp_interrupt_facility_initialize(void)
_ARMV7M_SCB->icsr = ARMV7M_SCB_ICSR_PENDSVCLR | ARMV7M_SCB_ICSR_PENDSTCLR;
for (i = BSP_INTERRUPT_VECTOR_MIN; i <= BSP_INTERRUPT_VECTOR_MAX; ++i) {
- vector_table [ARMV7M_VECTOR_IRQ(i)] = _ARMV7M_NVIC_Interrupt_dispatch;
_ARMV7M_NVIC_Clear_enable(i);
_ARMV7M_NVIC_Clear_pending(i);
_ARMV7M_NVIC_Set_priority(i, BSP_ARMV7M_IRQ_PRIORITY_DEFAULT);