From 815994fd17c2f732aacaf273a1e476a62de5f4a6 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Sun, 25 Nov 2012 17:48:11 +0100 Subject: score: Add CPU_Exception_frame Add CPU port type CPU_Exception_frame and function _CPU_Exception_frame_print(). The CPU ports of avr, bfin, h8300, lm32, m32c, m32r, m68k, nios2, sh, sparc64, and v850 use an empty default implementation of _CPU_Exception_frame_print(). Add rtems_exception_frame and rtems_exception_frame_print(). Add RTEMS_FATAL_SOURCE_EXCEPTION for CPU exceptions. Use rtems_fatal() with source RTEMS_FATAL_SOURCE_EXCEPTION in CPU ports of i386, powerpc, and sparc for unexpected exceptions. Add third parameter to RTEMS_BSP_CLEANUP_OPTIONS() which controls the BSP_PRINT_EXCEPTION_CONTEXT define used in the default bsp_fatal_extension(). Add test sptests/spfatal26. --- cpukit/score/cpu/i386/cpu.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'cpukit/score/cpu/i386/cpu.c') diff --git a/cpukit/score/cpu/i386/cpu.c b/cpukit/score/cpu/i386/cpu.c index acd2768730..15ff3c7619 100644 --- a/cpukit/score/cpu/i386/cpu.c +++ b/cpukit/score/cpu/i386/cpu.c @@ -117,7 +117,7 @@ struct Frame_ { uintptr_t pc; }; -static void _defaultExcHandler (CPU_Exception_frame *ctx) +void _CPU_Exception_frame_print (const CPU_Exception_frame *ctx) { unsigned int faultAddr = 0; printk("----------------------------------------------------------\n"); @@ -148,7 +148,6 @@ static void _defaultExcHandler (CPU_Exception_frame *ctx) * because the eip points to the faulty instruction so... */ printk("Exception while executing ISR!!!. System locked\n"); - _CPU_Fatal_halt(faultAddr); } else { struct Frame_ *fp = (struct Frame_*)ctx->ebp; @@ -171,10 +170,17 @@ static void _defaultExcHandler (CPU_Exception_frame *ctx) printk(" ************ FAULTY THREAD WILL BE SUSPENDED **************\n"); rtems_task_suspend(_Thread_Executing->Object.id); #endif - bsp_reset(); } } +static void _defaultExcHandler (CPU_Exception_frame *ctx) +{ + rtems_fatal( + RTEMS_FATAL_SOURCE_EXCEPTION, + (rtems_fatal_code) ctx + ); +} + cpuExcHandlerType _currentExcHandler = _defaultExcHandler; extern void rtems_exception_prologue_0(void); -- cgit v1.2.3