[rtems commit] arm: New function

Sebastian Huber sebh at rtems.org
Sat Apr 7 17:01:46 UTC 2012


Module:    rtems
Branch:    master
Commit:    f0d66b1ba972a13d8942b1030c2affcbedc005fe
Changeset: http://git.rtems.org/rtems/commit/?id=f0d66b1ba972a13d8942b1030c2affcbedc005fe

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Mon Mar 26 18:12:22 2012 +0200

arm: New function

Add and use function _ARMV7M_Set_exception_priority_and_handler().  Use
ARMV7M_EXCEPTION_PRIORITY_LOWEST define.

---

 cpukit/score/cpu/arm/Makefile.am                   |    1 +
 .../cpu/arm/armv7m-exception-priority-handler.c    |   35 ++++++++++++++++++++
 cpukit/score/cpu/arm/armv7m-initialize.c           |    8 ++--
 cpukit/score/cpu/arm/rtems/score/armv7m.h          |    6 +++
 4 files changed, 46 insertions(+), 4 deletions(-)

diff --git a/cpukit/score/cpu/arm/Makefile.am b/cpukit/score/cpu/arm/Makefile.am
index 9043622..61210cb 100644
--- a/cpukit/score/cpu/arm/Makefile.am
+++ b/cpukit/score/cpu/arm/Makefile.am
@@ -27,6 +27,7 @@ libscorecpu_a_SOURCES += armv7m-context-switch.c
 libscorecpu_a_SOURCES += armv7m-exception-handler-get.c
 libscorecpu_a_SOURCES += armv7m-exception-handler-set.c
 libscorecpu_a_SOURCES += armv7m-exception-priority-get.c
+libscorecpu_a_SOURCES += armv7m-exception-priority-handler.c
 libscorecpu_a_SOURCES += armv7m-exception-priority-set.c
 libscorecpu_a_SOURCES += armv7m-initialize.c
 libscorecpu_a_SOURCES += armv7m-isr-dispatch.c
diff --git a/cpukit/score/cpu/arm/armv7m-exception-priority-handler.c b/cpukit/score/cpu/arm/armv7m-exception-priority-handler.c
new file mode 100644
index 0000000..726db75
--- /dev/null
+++ b/cpukit/score/cpu/arm/armv7m-exception-priority-handler.c
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2012 Sebastian Huber.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Obere Lagerstr. 30
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems at embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+  #include "config.h"
+#endif
+
+#include <rtems/score/cpu.h>
+
+#ifdef ARM_MULTILIB_ARCH_V7M
+
+#include <rtems/score/armv7m.h>
+
+void _ARMV7M_Set_exception_priority_and_handler(
+  int index,
+  int priority,
+  ARMV7M_Exception_handler handler
+)
+{
+  _ARMV7M_Set_exception_priority( index, priority );
+  _ARMV7M_Set_exception_handler( index, handler );
+}
+
+#endif /* ARM_MULTILIB_ARCH_V7M */
diff --git a/cpukit/score/cpu/arm/armv7m-initialize.c b/cpukit/score/cpu/arm/armv7m-initialize.c
index f8e652d..79647d1 100644
--- a/cpukit/score/cpu/arm/armv7m-initialize.c
+++ b/cpukit/score/cpu/arm/armv7m-initialize.c
@@ -31,14 +31,14 @@ void _CPU_Initialize( void )
    * also "ARMv7-M Architecture Reference Manual, Issue D" section B1.5.4
    * "Exception priorities and preemption".
    */
-  _ARMV7M_Set_exception_priority( ARMV7M_VECTOR_SVC, 0xff );
-  _ARMV7M_Set_exception_priority( ARMV7M_VECTOR_PENDSV, 0xff );
-  _ARMV7M_Set_exception_handler(
+  _ARMV7M_Set_exception_priority_and_handler(
     ARMV7M_VECTOR_SVC,
+    ARMV7M_EXCEPTION_PRIORITY_LOWEST,
     _ARMV7M_Supervisor_call
   );
-  _ARMV7M_Set_exception_handler(
+  _ARMV7M_Set_exception_priority_and_handler(
     ARMV7M_VECTOR_PENDSV,
+    ARMV7M_EXCEPTION_PRIORITY_LOWEST,
     _ARMV7M_Pendable_service_call
   );
 }
diff --git a/cpukit/score/cpu/arm/rtems/score/armv7m.h b/cpukit/score/cpu/arm/rtems/score/armv7m.h
index 936c452..a4bae3c 100644
--- a/cpukit/score/cpu/arm/rtems/score/armv7m.h
+++ b/cpukit/score/cpu/arm/rtems/score/armv7m.h
@@ -459,6 +459,12 @@ void _ARMV7M_Set_exception_handler(
   ARMV7M_Exception_handler handler
 );
 
+void _ARMV7M_Set_exception_priority_and_handler(
+  int index,
+  int priority,
+  ARMV7M_Exception_handler handler
+);
+
 void _ARMV7M_Interrupt_service_enter( void );
 
 void _ARMV7M_Interrupt_service_leave( void );




More information about the vc mailing list