[rtems commit] arm: Add and use _ARM_Exception_default()

Sebastian Huber sebh at rtems.org
Mon Jan 7 14:05:04 UTC 2013


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Jan  4 14:22:10 2013 +0100

arm: Add and use _ARM_Exception_default()

---

 cpukit/score/cpu/arm/Makefile.am             |    1 +
 cpukit/score/cpu/arm/arm-exception-default.c |   25 +++++++++++++++++++++++++
 cpukit/score/cpu/arm/arm_exc_abort.S         |    7 +++----
 cpukit/score/cpu/arm/rtems/score/cpu.h       |    2 ++
 4 files changed, 31 insertions(+), 4 deletions(-)

diff --git a/cpukit/score/cpu/arm/Makefile.am b/cpukit/score/cpu/arm/Makefile.am
index b084e7a..c941043 100644
--- a/cpukit/score/cpu/arm/Makefile.am
+++ b/cpukit/score/cpu/arm/Makefile.am
@@ -20,6 +20,7 @@ libscorecpu_a_SOURCES += arm_exc_interrupt.S
 libscorecpu_a_SOURCES += arm_exc_handler_low.S
 libscorecpu_a_SOURCES += arm_exc_handler_high.c
 libscorecpu_a_SOURCES += arm-exception-frame-print.c
+libscorecpu_a_SOURCES += arm-exception-default.c
 libscorecpu_a_SOURCES += armv7m-context-initialize.c
 libscorecpu_a_SOURCES += armv7m-context-restore.c
 libscorecpu_a_SOURCES += armv7m-context-switch.c
diff --git a/cpukit/score/cpu/arm/arm-exception-default.c b/cpukit/score/cpu/arm/arm-exception-default.c
new file mode 100644
index 0000000..ec29f23
--- /dev/null
+++ b/cpukit/score/cpu/arm/arm-exception-default.c
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2013 embedded brains GmbH.  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>
+#include <rtems/fatal.h>
+
+void _ARM_Exception_default( CPU_Exception_frame *frame )
+{
+  rtems_fatal( RTEMS_FATAL_SOURCE_EXCEPTION, (rtems_fatal_code) frame );
+}
diff --git a/cpukit/score/cpu/arm/arm_exc_abort.S b/cpukit/score/cpu/arm/arm_exc_abort.S
index fb1b985..f4cf672 100644
--- a/cpukit/score/cpu/arm/arm_exc_abort.S
+++ b/cpukit/score/cpu/arm/arm_exc_abort.S
@@ -28,7 +28,7 @@
 
 #ifdef ARM_MULTILIB_ARCH_V4
 
-.extern rtems_fatal_error_occurred
+.extern _ARM_Exception_default
 
 .globl _ARMV4_Exception_data_abort_set_handler
 .globl _ARMV4_Exception_data_abort
@@ -110,9 +110,8 @@ save_more_context:
 	/* Call high level handler */
 	ldr	r2, [r6]
 	cmp	r2, #0
-	ldreq	r2, =rtems_fatal_error_occurred
-	movne	r0, sp
-	moveq	r0, #0xaa
+	ldreq	r2, =_ARM_Exception_default
+	mov	r0, sp
 #ifndef __thumb__
 	mov	lr, pc
 	mov	pc, r2
diff --git a/cpukit/score/cpu/arm/rtems/score/cpu.h b/cpukit/score/cpu/arm/rtems/score/cpu.h
index f83b30f..d04a09e 100644
--- a/cpukit/score/cpu/arm/rtems/score/cpu.h
+++ b/cpukit/score/cpu/arm/rtems/score/cpu.h
@@ -573,6 +573,8 @@ typedef CPU_Interrupt_frame CPU_Exception_frame;
 
 void _CPU_Exception_frame_print( const CPU_Exception_frame *frame );
 
+void _ARM_Exception_default( CPU_Exception_frame *frame );
+
 #ifdef __cplusplus
 }
 #endif




More information about the vc mailing list