diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-07-24 11:09:23 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-07-24 11:11:21 +0200 |
commit | 39046f766f170748acdb7f55f79a681a09552698 (patch) | |
tree | 9165005f4b957b65bfc4bcc7afc10381b8809af4 /cpukit/score/include/rtems/score/sysstate.h | |
parent | libtests/malloctest: Fixes for RTEMS_DEBUG (diff) | |
download | rtems-39046f766f170748acdb7f55f79a681a09552698.tar.bz2 |
score: Merge sysstate API into one file
Diffstat (limited to 'cpukit/score/include/rtems/score/sysstate.h')
-rw-r--r-- | cpukit/score/include/rtems/score/sysstate.h | 72 |
1 files changed, 67 insertions, 5 deletions
diff --git a/cpukit/score/include/rtems/score/sysstate.h b/cpukit/score/include/rtems/score/sysstate.h index 7d3d6aed59..6599dff4f1 100644 --- a/cpukit/score/include/rtems/score/sysstate.h +++ b/cpukit/score/include/rtems/score/sysstate.h @@ -18,7 +18,7 @@ #ifndef _RTEMS_SCORE_SYSSTATE_H #define _RTEMS_SCORE_SYSSTATE_H -#include <rtems/score/basedefs.h> /* SCORE_EXTERN */ +#include <rtems/score/basedefs.h> #ifdef __cplusplus extern "C" { @@ -79,11 +79,73 @@ SCORE_EXTERN bool _System_state_Is_multiprocessing; extern System_state_Codes _System_state_Current; -/* - * Make it possible for the application to get the system state information. - */ +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) + bool is_multiprocessing +#else + bool is_multiprocessing __attribute__((unused)) +#endif +) +{ + _System_state_Set( SYSTEM_STATE_BEFORE_INITIALIZATION ); +#if defined(RTEMS_MULTIPROCESSING) + _System_state_Is_multiprocessing = is_multiprocessing; +#endif +} + +RTEMS_INLINE_ROUTINE System_state_Codes _System_state_Get ( void ) +{ + return _System_state_Current; +} -#include <rtems/score/sysstate.inl> +RTEMS_INLINE_ROUTINE bool _System_state_Is_before_initialization ( + System_state_Codes state +) +{ + return (state == SYSTEM_STATE_BEFORE_INITIALIZATION); +} + +RTEMS_INLINE_ROUTINE bool _System_state_Is_before_multitasking ( + System_state_Codes state +) +{ + return (state == SYSTEM_STATE_BEFORE_MULTITASKING); +} + +RTEMS_INLINE_ROUTINE bool _System_state_Is_begin_multitasking ( + System_state_Codes state +) +{ + return (state == SYSTEM_STATE_BEGIN_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 +) +{ + return (state == SYSTEM_STATE_UP); +} + +RTEMS_INLINE_ROUTINE bool _System_state_Is_failed ( + System_state_Codes state +) +{ + return (state == SYSTEM_STATE_FAILED); +} /** @} */ |