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

5
Last change on this file since 57f3969a was 57f3969a, checked in by Sebastian Huber <sebastian.huber@…>, on 12/02/17 at 19:32:37

bsps: Print internal error text

Update #3248.

  • Property mode set to 100644
File size: 1.7 KB
Line 
1/*
2 *  COPYRIGHT (c) 1989-1999.
3 *  On-Line Applications Research Corporation (OAR).
4 *
5 *  The license and distribution terms for this file may be
6 *  found in the file LICENSE in this distribution or at
7 *  http://www.rtems.org/license/LICENSE.
8 */
9
10#include <bsp.h>
11#include <bsp/bootcard.h>
12#include <rtems/bspIo.h>
13#include <rtems/version.h>
14
15void bsp_fatal_extension(
16  rtems_fatal_source source,
17  bool always_set_to_false,
18  rtems_fatal_code code
19)
20{
21  #if BSP_VERBOSE_FATAL_EXTENSION
22    printk(
23      "\n"
24      "*** FATAL ***\n"
25      "fatal source: %i (%s)\n",
26      source,
27      rtems_fatal_source_text( source )
28    );
29  #endif
30
31  #if (BSP_PRINT_EXCEPTION_CONTEXT) || BSP_VERBOSE_FATAL_EXTENSION
32    if ( source == RTEMS_FATAL_SOURCE_EXCEPTION ) {
33      rtems_exception_frame_print( (const rtems_exception_frame *) code );
34    }
35  #endif
36
37  #if BSP_VERBOSE_FATAL_EXTENSION
38    else if ( source == INTERNAL_ERROR_CORE ) {
39      printk(
40        "fatal code: %ju (%s)\n",
41        (uintmax_t) code,
42        rtems_internal_error_text( code )
43      );
44    } else {
45      printk(
46        "fatal code: %ju (0x%08jx)\n",
47        (uintmax_t) code,
48        (uintmax_t) code
49      );
50    }
51
52    printk(
53      "RTEMS version: %s\n"
54      "RTEMS tools: %s\n",
55      rtems_version(),
56      __VERSION__
57    );
58  #endif
59
60  #if (BSP_PRESS_KEY_FOR_RESET)
61    printk( "\nFATAL ERROR - Executive shutdown! Any key to reboot..." );
62
63    /*
64     * Wait for a key to be pressed
65     */
66    while ( getchark() == -1 )
67      ;
68
69    printk("\n");
70  #endif
71
72  /*
73   *  Check both conditions -- if you want to ask for reboot, then
74   *  you must have meant to reset the board.
75   */
76  #if (BSP_PRESS_KEY_FOR_RESET) || (BSP_RESET_BOARD_AT_EXIT)
77    bsp_reset();
78  #endif
79}
Note: See TracBrowser for help on using the repository browser.