From 50f3c42be544c40e91e0748875c075a2cdb8229b Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Fri, 4 Jan 2013 14:22:10 +0100 Subject: 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(-) create mode 100644 cpukit/score/cpu/arm/arm-exception-default.c diff --git a/cpukit/score/cpu/arm/Makefile.am b/cpukit/score/cpu/arm/Makefile.am index b084e7a5e3..c941043ef6 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 0000000000..ec29f23431 --- /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 + * + * + * 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 +#include + +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 fb1b985319..f4cf6724b8 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 f83b30f229..d04a09eaf0 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 -- cgit v1.2.3