[rtems commit] bsps: Add BSP_VERBOSE_FATAL_EXTENSION
Sebastian Huber
sebh at rtems.org
Wed Nov 22 12:03:04 UTC 2017
Module: rtems
Branch: master
Commit: 86a80ee1af0fedb3b575ae95db7e80f80d46b533
Changeset: http://git.rtems.org/rtems/commit/?id=86a80ee1af0fedb3b575ae95db7e80f80d46b533
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Tue Nov 21 13:30:26 2017 +0100
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.
---
c/src/aclocal/bsp-bspcleanup-options.m4 | 7 ++++++-
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 1c2ac58..60be886 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 e045512..bae9d21 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 );
}
More information about the vc
mailing list