summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2012-11-18 19:51:10 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2012-11-22 16:35:06 +0100
commit1906a36a8635fe8f666bc60eab354274ffc8dcfa (patch)
treec1a54f1f201a7b92048ac9f5c2177332fd6ad0ae /cpukit
parentscore: Delete nest level from internal error state (diff)
downloadrtems-1906a36a8635fe8f666bc60eab354274ffc8dcfa.tar.bz2
score: Change _Internal_error_Occurred()
Call the fatal handlers of the user extensions before the update of _Internal_errors_What_happened. This reduces the requirements on the execution context further. Now a valid read-write data is only required after the call to the fatal handlers.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/score/include/rtems/score/interr.h31
-rw-r--r--cpukit/score/src/interr.c3
2 files changed, 24 insertions, 10 deletions
diff --git a/cpukit/score/include/rtems/score/interr.h b/cpukit/score/include/rtems/score/interr.h
index 049264995a..367c1abbba 100644
--- a/cpukit/score/include/rtems/score/interr.h
+++ b/cpukit/score/include/rtems/score/interr.h
@@ -166,17 +166,32 @@ typedef struct {
extern Internal_errors_Information _Internal_errors_What_happened;
/**
- * @brief An internal or fatal error occurred.
+ * @brief Initiates system termination.
*
* This routine is invoked when the application or the executive itself
- * determines that a fatal error has occurred.
+ * determines that a fatal error has occurred or a final system state is
+ * reached (for example after exit()).
*
- * This function can be called in every system state provided the following
- * conditions are true
- * - the stack pointer is valid,
- * - the code memory is valid,
- * - the read-only data is valid, and
- * - the read-write data is accessible.
+ * The first action of this function is to call the fatal handler of the user
+ * extensions. For the initial extensions the following conditions are
+ * required
+ * - a valid stack pointer and enough stack space,
+ * - a valid code memory, and
+ * - valid read-only data.
+ * For the initial extensions the read-write data (including BSS segment) is
+ * not required.
+ *
+ * Non-initial extensions require in addition valid read-write data. The BSP
+ * may install an initial extension that performs a system reset. In this case
+ * the non-initial extensions will be not called.
+ *
+ * Once all fatal handler executed the error information will be stored to
+ * _Internal_errors_What_happened and the system state is set to
+ * SYSTEM_STATE_FAILED.
+ *
+ * The final step is to call the CPU specific _CPU_Fatal_halt().
+ *
+ * @see rtems_fatal_error_occurred() and rtems_fatal().
*/
void _Internal_error_Occurred(
Internal_errors_Source the_source,
diff --git a/cpukit/score/src/interr.c b/cpukit/score/src/interr.c
index a9f1efc8b9..50b3ffdde6 100644
--- a/cpukit/score/src/interr.c
+++ b/cpukit/score/src/interr.c
@@ -50,13 +50,12 @@ void _Internal_error_Occurred(
Internal_errors_t the_error
)
{
+ _User_extensions_Fatal( the_source, is_internal, the_error );
_Internal_errors_What_happened.the_source = the_source;
_Internal_errors_What_happened.is_internal = is_internal;
_Internal_errors_What_happened.the_error = the_error;
- _User_extensions_Fatal( the_source, is_internal, the_error );
-
_System_state_Set( SYSTEM_STATE_FAILED );
_CPU_Fatal_halt( the_error );