summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-02-17 09:47:12 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-02-19 09:59:38 +0100
commit92f50c3b2916d52c26d74fe1d61354d342e148af (patch)
tree6ba9fa06071d98ac169891decaaeba8ebf56c89b
parentpowerpc: Change interrupt disable implemetation (diff)
downloadrtems-92f50c3b2916d52c26d74fe1d61354d342e148af.tar.bz2
score: Add SYSTEM_STATE_TERMINATED
Merge systems states SYSTEM_STATE_SHUTDOWN and SYSTEM_STATE_FAILED into new system state SYSTEM_STATE_TERMINATED. This reflects that all system termination paths end up in _Internal_error_Occurred().
-rw-r--r--cpukit/sapi/src/exshutdown.c1
-rw-r--r--cpukit/score/include/rtems/score/interr.h2
-rw-r--r--cpukit/score/include/rtems/score/sysstate.h22
-rw-r--r--cpukit/score/src/interr.c2
-rw-r--r--testsuites/libtests/heapwalk/init.c2
-rw-r--r--testsuites/sptests/spfatal23/testcase.h2
6 files changed, 9 insertions, 22 deletions
diff --git a/cpukit/sapi/src/exshutdown.c b/cpukit/sapi/src/exshutdown.c
index 7a96869e27..44c5a09084 100644
--- a/cpukit/sapi/src/exshutdown.c
+++ b/cpukit/sapi/src/exshutdown.c
@@ -44,7 +44,6 @@ void rtems_shutdown_executive(
#endif
_Thread_Set_global_exit_status( result );
- _System_state_Set( SYSTEM_STATE_SHUTDOWN );
_Thread_Stop_multitasking();
/*******************************************************************
diff --git a/cpukit/score/include/rtems/score/interr.h b/cpukit/score/include/rtems/score/interr.h
index 79edc21249..b774edcfc9 100644
--- a/cpukit/score/include/rtems/score/interr.h
+++ b/cpukit/score/include/rtems/score/interr.h
@@ -192,7 +192,7 @@ extern Internal_errors_Information _Internal_errors_What_happened;
*
* 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.
+ * SYSTEM_STATE_TERMINATED.
*
* The final step is to call the CPU specific _CPU_Fatal_halt().
*
diff --git a/cpukit/score/include/rtems/score/sysstate.h b/cpukit/score/include/rtems/score/sysstate.h
index 304b9529c3..4a50e163f8 100644
--- a/cpukit/score/include/rtems/score/sysstate.h
+++ b/cpukit/score/include/rtems/score/sysstate.h
@@ -54,19 +54,14 @@ typedef enum {
SYSTEM_STATE_UP,
/**
- * @brief The system is in the midst of a shutdown.
+ * @brief The system reached its terminal state.
*/
- SYSTEM_STATE_SHUTDOWN,
-
- /**
- * @brief A fatal error has occurred.
- */
- SYSTEM_STATE_FAILED
+ SYSTEM_STATE_TERMINATED
} System_state_Codes;
#define SYSTEM_STATE_CODES_FIRST SYSTEM_STATE_BEFORE_INITIALIZATION
-#define SYSTEM_STATE_CODES_LAST SYSTEM_STATE_FAILED
+#define SYSTEM_STATE_CODES_LAST SYSTEM_STATE_TERMINATED
#if defined(RTEMS_MULTIPROCESSING)
SCORE_EXTERN bool _System_state_Is_multiprocessing;
@@ -114,13 +109,6 @@ RTEMS_INLINE_ROUTINE bool _System_state_Is_before_multitasking (
return (state == SYSTEM_STATE_BEFORE_MULTITASKING);
}
-RTEMS_INLINE_ROUTINE bool _System_state_Is_shutdown (
- System_state_Codes state
-)
-{
- return (state == SYSTEM_STATE_SHUTDOWN);
-}
-
RTEMS_INLINE_ROUTINE bool _System_state_Is_up (
System_state_Codes state
)
@@ -128,11 +116,11 @@ RTEMS_INLINE_ROUTINE bool _System_state_Is_up (
return (state == SYSTEM_STATE_UP);
}
-RTEMS_INLINE_ROUTINE bool _System_state_Is_failed (
+RTEMS_INLINE_ROUTINE bool _System_state_Is_terminated (
System_state_Codes state
)
{
- return (state == SYSTEM_STATE_FAILED);
+ return (state == SYSTEM_STATE_TERMINATED);
}
/** @} */
diff --git a/cpukit/score/src/interr.c b/cpukit/score/src/interr.c
index 1b895d6fac..f3a3127aa7 100644
--- a/cpukit/score/src/interr.c
+++ b/cpukit/score/src/interr.c
@@ -38,7 +38,7 @@ void _Internal_error_Occurred(
_Internal_errors_What_happened.is_internal = is_internal;
_Internal_errors_What_happened.the_error = the_error;
- _System_state_Set( SYSTEM_STATE_FAILED );
+ _System_state_Set( SYSTEM_STATE_TERMINATED );
_CPU_Fatal_halt( the_error );
diff --git a/testsuites/libtests/heapwalk/init.c b/testsuites/libtests/heapwalk/init.c
index f00b9b86ae..af79d1c1e1 100644
--- a/testsuites/libtests/heapwalk/init.c
+++ b/testsuites/libtests/heapwalk/init.c
@@ -94,7 +94,7 @@ static void test_system_not_up(void)
rtems_interrupt_disable( level );
System_state_Codes state = _System_state_Get();
- _System_state_Set( SYSTEM_STATE_FAILED );
+ _System_state_Set( SYSTEM_STATE_TERMINATED );
test_call_heap_walk( true );
_System_state_Set( state );
rtems_interrupt_enable( level );
diff --git a/testsuites/sptests/spfatal23/testcase.h b/testsuites/sptests/spfatal23/testcase.h
index 28010e1cc1..6be7d3a9c0 100644
--- a/testsuites/sptests/spfatal23/testcase.h
+++ b/testsuites/sptests/spfatal23/testcase.h
@@ -17,7 +17,7 @@
void force_error()
{
- _System_state_Set( SYSTEM_STATE_SHUTDOWN );
+ _System_state_Set( SYSTEM_STATE_BEFORE_MULTITASKING );
rtems_shutdown_executive( 0 );
/* we will not run this far */
}