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

4.115
Last change on this file since a052181 was a052181, checked in by Sebastian Huber <sebastian.huber@…>, on 11/14/12 at 08:59:10

score: Add RTEMS_FATAL_SOURCE_EXIT

Include <bsp/default-initial-extension.h> in all BSPs. Call
rtems_fatal() with RTEMS_FATAL_SOURCE_EXIT as source and the exit()
status code as fatal code in every bsp_cleanup(). Move previous
bsp_cleanup() code into bsp_fatal_extension().

  • Property mode set to 100644
File size: 985 bytes
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 error
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  /*
35   *  Check both conditions -- if you want to ask for reboot, then
36   *  you must have meant to reset the board.
37   */
38  #if (BSP_PRESS_KEY_FOR_RESET) || (BSP_RESET_BOARD_AT_EXIT)
39    bsp_reset();
40  #endif
41}
42
43void bsp_cleanup( uint32_t status )
44{
45  rtems_fatal( RTEMS_FATAL_SOURCE_EXIT, status );
46}
Note: See TracBrowser for help on using the repository browser.