[rtems commit] score: Add nest level to interal error state

Sebastian Huber sebh at rtems.org
Thu Nov 15 14:29:48 UTC 2012


Module:    rtems
Branch:    master
Commit:    7d0bdcac1ac20d6f22b24689c16e6aa7bc3c1e40
Changeset: http://git.rtems.org/rtems/commit/?id=7d0bdcac1ac20d6f22b24689c16e6aa7bc3c1e40

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Nov 14 09:27:43 2012 +0100

score: Add nest level to interal error state

Add Internal_errors_Information::nest_level.  This helps to detect
recursive calls to _Internal_error_Occurred().

---

 cpukit/score/include/rtems/score/interr.h |    7 +++++++
 cpukit/score/src/interr.c                 |    2 ++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/cpukit/score/include/rtems/score/interr.h b/cpukit/score/include/rtems/score/interr.h
index c81d493..8aa85ae 100644
--- a/cpukit/score/include/rtems/score/interr.h
+++ b/cpukit/score/include/rtems/score/interr.h
@@ -88,6 +88,13 @@ typedef struct {
   bool                    is_internal;
   /** This is the error code. */
   Internal_errors_t       the_error;
+
+  /**
+   * @brief The internal error nest level.
+   *
+   * This helps to detect recursive calls to _Internal_error_Occurred().
+   */
+  uint32_t                nest_level;
 } Internal_errors_Information;
 
 /**
diff --git a/cpukit/score/src/interr.c b/cpukit/score/src/interr.c
index a9f1efc..0192dfd 100644
--- a/cpukit/score/src/interr.c
+++ b/cpukit/score/src/interr.c
@@ -55,6 +55,8 @@ void _Internal_error_Occurred(
   _Internal_errors_What_happened.is_internal = is_internal;
   _Internal_errors_What_happened.the_error   = the_error;
 
+  ++_Internal_errors_What_happened.nest_level;
+
   _User_extensions_Fatal( the_source, is_internal, the_error );
 
   _System_state_Set( SYSTEM_STATE_FAILED );




More information about the vc mailing list