source: rtems/c/src/lib/libbsp/shared/bspclean.c @ 815994f

4.11
Last change on this file since 815994f was 815994f, checked in by Sebastian Huber <sebastian.huber@…>, on Nov 25, 2012 at 4:48:11 PM

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.

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/*
2 *  This is a dummy bsp_cleanup routine.
3 *
4 *  COPYRIGHT (c) 1989-1999.
5 *  On-Line Applications Research Corporation (OAR).
6 *
7 *  The license and distribution terms for this file may be
8 *  found in the file LICENSE in this distribution or at
9 *  http://www.rtems.com/license/LICENSE.
10 */
11
12#include <bsp.h>
13#include <bsp/bootcard.h>
14#include <rtems/bspIo.h>
15
16void bsp_fatal_extension(
17  rtems_fatal_source source,
18  bool is_internal,
19  rtems_fatal_code code
20)
21{
22  #if (BSP_PRESS_KEY_FOR_RESET)
23    printk( "\nEXECUTIVE SHUTDOWN! Any key to reboot..." );
24
25    /*
26     * Wait for a key to be pressed
27     */
28    while ( getchark() == -1 )
29      ;
30
31    printk("\n");
32  #endif
33
34  #if (BSP_PRINT_EXCEPTION_CONTEXT)
35    if ( source == RTEMS_FATAL_SOURCE_EXCEPTION ) {
36      rtems_exception_frame_print( (const rtems_exception_frame *) code );
37    }
38  #endif
39
40  /*
41   *  Check both conditions -- if you want to ask for reboot, then
42   *  you must have meant to reset the board.
43   */
44  #if (BSP_PRESS_KEY_FOR_RESET) || (BSP_RESET_BOARD_AT_EXIT)
45    bsp_reset();
46  #endif
47}
48
49void bsp_cleanup( uint32_t status )
50{
51  rtems_fatal( RTEMS_FATAL_SOURCE_EXIT, status );
52}
Note: See TracBrowser for help on using the repository browser.