diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-11-21 13:30:26 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-11-22 09:40:24 +0100 |
commit | 86a80ee1af0fedb3b575ae95db7e80f80d46b533 (patch) | |
tree | 199b27f845b337aabff042c1158bdc3834840d83 | |
parent | bsps: Simplify RTEMS_BSP_CLEANUP_OPTIONS (diff) | |
download | rtems-86a80ee1af0fedb3b575ae95db7e80f80d46b533.tar.bz2 |
bsps: Add BSP_VERBOSE_FATAL_EXTENSION
Add BSP_VERBOSE_FATAL_EXTENSION to RTEMS_BSP_CLEANUP_OPTIONS to
optionally print the RTEMS version, the fatal source and the fatal code
in the shared bsp_fatal_extension().
Close #3248.
-rw-r--r-- | c/src/aclocal/bsp-bspcleanup-options.m4 | 7 | ||||
-rw-r--r-- | c/src/lib/libbsp/shared/bspclean.c | 20 |
2 files changed, 25 insertions, 2 deletions
diff --git a/c/src/aclocal/bsp-bspcleanup-options.m4 b/c/src/aclocal/bsp-bspcleanup-options.m4 index 1c2ac586b1..60be886070 100644 --- a/c/src/aclocal/bsp-bspcleanup-options.m4 +++ b/c/src/aclocal/bsp-bspcleanup-options.m4 @@ -21,4 +21,9 @@ RTEMS_BSPOPTS_HELP([BSP_RESET_BOARD_AT_EXIT], RTEMS_BSPOPTS_SET([BSP_PRINT_EXCEPTION_CONTEXT],[*],[1]) RTEMS_BSPOPTS_HELP([BSP_PRINT_EXCEPTION_CONTEXT], [If defined to a non-zero value, prints the exception context when an -unexpected exception occurs.])]) +unexpected exception occurs.]) + +RTEMS_BSPOPTS_SET([BSP_VERBOSE_FATAL_EXTENSION],[*],[1]) +RTEMS_BSPOPTS_HELP([BSP_VERBOSE_FATAL_EXTENSION], +[If defined to a non-zero value, prints the some information in case of a fatal +error.])]) diff --git a/c/src/lib/libbsp/shared/bspclean.c b/c/src/lib/libbsp/shared/bspclean.c index e045512da0..bae9d21889 100644 --- a/c/src/lib/libbsp/shared/bspclean.c +++ b/c/src/lib/libbsp/shared/bspclean.c @@ -10,6 +10,7 @@ #include <bsp.h> #include <bsp/bootcard.h> #include <rtems/bspIo.h> +#include <rtems/version.h> void bsp_fatal_extension( rtems_fatal_source source, @@ -17,7 +18,24 @@ void bsp_fatal_extension( rtems_fatal_code code ) { - #if (BSP_PRINT_EXCEPTION_CONTEXT) + #if BSP_VERBOSE_FATAL_EXTENSION + printk( + "\n" + "*** FATAL ***\n" + "fatal source: %i (%s)\n" + "fatal code: %ju (0x%08jx)\n" + "RTEMS version: %s\n" + "RTEMS tools: %s\n", + source, + rtems_fatal_source_text( source ), + (uintmax_t) code, + (uintmax_t) code, + rtems_version(), + __VERSION__ + ); + #endif + + #if (BSP_PRINT_EXCEPTION_CONTEXT) || BSP_VERBOSE_FATAL_EXTENSION if ( source == RTEMS_FATAL_SOURCE_EXCEPTION ) { rtems_exception_frame_print( (const rtems_exception_frame *) code ); } |