summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-09-04 13:09:48 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-09-04 13:09:48 +0000
commit56e171066de897e3e8196b5e7479913b12ce2af6 (patch)
tree94887d97a946d9e4b6f86ccbd0f283bd05893aea /cpukit
parentFix expat. (diff)
downloadrtems-56e171066de897e3e8196b5e7479913b12ce2af6.tar.bz2
2009-09-04 Sebastian Huber <Sebastian.Huber@embedded-brains.de>
* rtems/src/taskmode.c, sapi/src/exshutdown.c, score/include/rtems/score/sysstate.h, score/inline/rtems/score/sysstate.inl: Added _System_state_Is_shutdown(). Removed direct uses of _System_state_Current. Documentation.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/ChangeLog8
-rw-r--r--cpukit/rtems/src/taskmode.c2
-rw-r--r--cpukit/sapi/src/exshutdown.c2
-rw-r--r--cpukit/score/include/rtems/score/sysstate.h75
-rw-r--r--cpukit/score/inline/rtems/score/sysstate.inl69
5 files changed, 69 insertions, 87 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog
index 312d8cc3b4..3d5c86ed0e 100644
--- a/cpukit/ChangeLog
+++ b/cpukit/ChangeLog
@@ -1,3 +1,11 @@
+2009-09-04 Sebastian Huber <Sebastian.Huber@embedded-brains.de>
+
+ * rtems/src/taskmode.c, sapi/src/exshutdown.c,
+ score/include/rtems/score/sysstate.h,
+ score/inline/rtems/score/sysstate.inl: Added
+ _System_state_Is_shutdown(). Removed direct uses of
+ _System_state_Current. Documentation.
+
2009-08-28 Joel Sherrill <joel.sherrill@OARcorp.com>
* libcsupport/src/malloc_initialize.c, sapi/src/exinit.c,
diff --git a/cpukit/rtems/src/taskmode.c b/cpukit/rtems/src/taskmode.c
index 8a0837039d..56f707c5e7 100644
--- a/cpukit/rtems/src/taskmode.c
+++ b/cpukit/rtems/src/taskmode.c
@@ -122,7 +122,7 @@ rtems_status_code rtems_task_mode(
}
}
- if ( _System_state_Is_up(_System_state_Current) )
+ if ( _System_state_Is_up( _System_state_Get() ) )
if ( _Thread_Evaluate_mode() || needs_asr_dispatching )
_Thread_Dispatch();
diff --git a/cpukit/sapi/src/exshutdown.c b/cpukit/sapi/src/exshutdown.c
index a136391048..1df2a4ba5a 100644
--- a/cpukit/sapi/src/exshutdown.c
+++ b/cpukit/sapi/src/exshutdown.c
@@ -35,7 +35,7 @@ void rtems_shutdown_executive(
uint32_t result
)
{
- if ( _System_state_Current != SYSTEM_STATE_SHUTDOWN ) {
+ if ( !_System_state_Is_shutdown( _System_state_Get() ) ) {
_System_state_Set( SYSTEM_STATE_SHUTDOWN );
_Thread_Stop_multitasking();
}
diff --git a/cpukit/score/include/rtems/score/sysstate.h b/cpukit/score/include/rtems/score/sysstate.h
index 8d4a8e313e..52fa1c0b89 100644
--- a/cpukit/score/include/rtems/score/sysstate.h
+++ b/cpukit/score/include/rtems/score/sysstate.h
@@ -1,7 +1,9 @@
/**
- * @file rtems/score/sysstate.h
+ * @file
*
- * This include file contains information regarding the system state.
+ * @ingroup ScoreSysState
+ *
+ * @brief System State Handler API.
*/
/*
@@ -18,63 +20,64 @@
#ifndef _RTEMS_SCORE_SYSSTATE_H
#define _RTEMS_SCORE_SYSSTATE_H
-/**
- * @defgroup ScoreSysState System State Handler
- *
- * This handler encapsulates functionality related to the management of the
- * internal system state of RTEMS.
- */
-/**@{*/
-
#ifdef __cplusplus
extern "C" {
#endif
-/* types */
-
-/* enumerated constants */
+/**
+ * @defgroup ScoreSysState System State Handler
+ *
+ * @ingroup Score
+ *
+ * @brief Management of the internal system state of RTEMS.
+ *
+ * @{
+ */
/**
- * The following type defines the possible system states.
+ * @brief System states.
*/
typedef enum {
- /** This indicates that the system state is between the start
- * of rtems_initialize_executive_early and the end of the first
- * phase of initialization.
+ /**
+ * @brief The system is before the end of the first phase of initialization.
*/
SYSTEM_STATE_BEFORE_INITIALIZATION,
- /** This indicates that the system state is between end of the first
- * phase of initializatin but before multitasking is started.
+
+ /**
+ * @brief The system is between end of the first phase of initializatin but
+ * before multitasking is started.
*/
SYSTEM_STATE_BEFORE_MULTITASKING,
- /** This indicates that the system state is attempting to initiate
- * multitasking.
+
+ /**
+ * @brief The system is attempting to initiate multitasking.
*/
SYSTEM_STATE_BEGIN_MULTITASKING,
- /** This indicates that the system is up and operating normally. */
+
+ /**
+ * @brief The system is up and operating normally.
+ */
SYSTEM_STATE_UP,
- /** This indicates that the system is in the midst of a shutdown. */
+
+ /**
+ * @brief The system is in the midst of a shutdown.
+ */
SYSTEM_STATE_SHUTDOWN,
- /** This indicates that a fatal error has occurred. */
+
+ /**
+ * @brief A fatal error has occurred.
+ */
SYSTEM_STATE_FAILED
} System_state_Codes;
-/** This defines the first system state. */
#define SYSTEM_STATE_CODES_FIRST SYSTEM_STATE_BEFORE_INITIALIZATION
-/** This defines the highest value system state. */
-#define SYSTEM_STATE_CODES_LAST SYSTEM_STATE_FAILED
+
+#define SYSTEM_STATE_CODES_LAST SYSTEM_STATE_FAILED
#if defined(RTEMS_MULTIPROCESSING)
-/**
- * The following variable indicates whether or not this is
- * an multiprocessing system.
- */
SCORE_EXTERN bool _System_state_Is_multiprocessing;
#endif
-/**
- * The following variable contains the current system state.
- */
SCORE_EXTERN System_state_Codes _System_state_Current;
/*
@@ -83,11 +86,11 @@ SCORE_EXTERN System_state_Codes _System_state_Current;
#include <rtems/score/sysstate.inl>
+/** @} */
+
#ifdef __cplusplus
}
#endif
-/**@}*/
-
#endif
/* end of include file */
diff --git a/cpukit/score/inline/rtems/score/sysstate.inl b/cpukit/score/inline/rtems/score/sysstate.inl
index b237400871..f391badaf3 100644
--- a/cpukit/score/inline/rtems/score/sysstate.inl
+++ b/cpukit/score/inline/rtems/score/sysstate.inl
@@ -1,8 +1,9 @@
/**
- * @file rtems/score/sysstate.inl
+ * @file
*
- * This file contains the inline implementation of routines regarding the
- * system state.
+ * @ingroup ScoreSysState
+ *
+ * @brief System State Handler API.
*/
/*
@@ -24,13 +25,17 @@
#define _RTEMS_SCORE_SYSSTATE_INL
/**
- * @addtogroup ScoreSysState
- * @{
+ * @addtogroup ScoreSysState
+ *
+ * @{
*/
-/**
- * This routine initializes the system state handler.
- */
+RTEMS_INLINE_ROUTINE void _System_state_Set (
+ System_state_Codes state
+)
+{
+ _System_state_Current = state;
+}
RTEMS_INLINE_ROUTINE void _System_state_Handler_initialization (
#if defined(RTEMS_MULTIPROCESSING)
@@ -40,38 +45,17 @@ RTEMS_INLINE_ROUTINE void _System_state_Handler_initialization (
#endif
)
{
- _System_state_Current = SYSTEM_STATE_BEFORE_INITIALIZATION;
+ _System_state_Set( SYSTEM_STATE_BEFORE_INITIALIZATION );
#if defined(RTEMS_MULTIPROCESSING)
_System_state_Is_multiprocessing = is_multiprocessing;
#endif
}
-
-/**
- * This routine sets the current system state to that specified by
- * the called.
- */
-
-RTEMS_INLINE_ROUTINE void _System_state_Set (
- System_state_Codes state
-)
-{
- _System_state_Current = state;
-}
-
-/**
- * This function returns the current system state.
- */
RTEMS_INLINE_ROUTINE System_state_Codes _System_state_Get ( void )
{
return _System_state_Current;
}
-/**
- * This function returns true if the state is equal to the
- * "before initialization" state, and false otherwise.
- */
-
RTEMS_INLINE_ROUTINE bool _System_state_Is_before_initialization (
System_state_Codes state
)
@@ -79,11 +63,6 @@ RTEMS_INLINE_ROUTINE bool _System_state_Is_before_initialization (
return (state == SYSTEM_STATE_BEFORE_INITIALIZATION);
}
-/**
- * This function returns true if the state is equal to the
- * "before multitasking" state, and false otherwise.
- */
-
RTEMS_INLINE_ROUTINE bool _System_state_Is_before_multitasking (
System_state_Codes state
)
@@ -91,11 +70,6 @@ RTEMS_INLINE_ROUTINE bool _System_state_Is_before_multitasking (
return (state == SYSTEM_STATE_BEFORE_MULTITASKING);
}
-/**
- * This function returns true if the state is equal to the
- * "begin multitasking" state, and false otherwise.
- */
-
RTEMS_INLINE_ROUTINE bool _System_state_Is_begin_multitasking (
System_state_Codes state
)
@@ -103,10 +77,12 @@ RTEMS_INLINE_ROUTINE bool _System_state_Is_begin_multitasking (
return (state == SYSTEM_STATE_BEGIN_MULTITASKING);
}
-/**
- * This function returns true if the state is equal to the
- * "up" state, and false otherwise.
- */
+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
@@ -115,11 +91,6 @@ RTEMS_INLINE_ROUTINE bool _System_state_Is_up (
return (state == SYSTEM_STATE_UP);
}
-/**
- * This function returns true if the state is equal to the
- * "failed" state, and false otherwise.
- */
-
RTEMS_INLINE_ROUTINE bool _System_state_Is_failed (
System_state_Codes state
)