RTEMS
sysstate.h
Go to the documentation of this file.
1 
9 /*
10  * COPYRIGHT (c) 1989-2011.
11  * On-Line Applications Research Corporation (OAR).
12  *
13  * The license and distribution terms for this file may be
14  * found in the file LICENSE in this distribution or at
15  * http://www.rtems.org/license/LICENSE.
16  */
17 
18 #ifndef _RTEMS_SCORE_SYSSTATE_H
19 #define _RTEMS_SCORE_SYSSTATE_H
20 
21 #include <rtems/score/basedefs.h>
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
40 typedef enum {
45 
51 
56 
62 
63 #define SYSTEM_STATE_CODES_FIRST SYSTEM_STATE_BEFORE_INITIALIZATION
64 
65 #define SYSTEM_STATE_CODES_LAST SYSTEM_STATE_TERMINATED
66 
67 #if defined(RTEMS_MULTIPROCESSING)
68 extern bool _System_state_Is_multiprocessing;
69 #endif
70 
71 extern System_state_Codes _System_state_Current;
72 
79  System_state_Codes state
80 )
81 {
82  _System_state_Current = state;
83 }
84 
91 {
92  return _System_state_Current;
93 }
94 
104  System_state_Codes state
105 )
106 {
107  return (state == SYSTEM_STATE_BEFORE_INITIALIZATION);
108 }
109 
119  System_state_Codes state
120 )
121 {
122  return (state == SYSTEM_STATE_BEFORE_MULTITASKING);
123 }
124 
134  System_state_Codes state
135 )
136 {
137  return (state == SYSTEM_STATE_UP);
138 }
139 
149  System_state_Codes state
150 )
151 {
152  return (state == SYSTEM_STATE_TERMINATED);
153 }
154 
157 #ifdef __cplusplus
158 }
159 #endif
160 
161 #endif
162 /* end of include file */
The system is before the end of the first phase of initialization.
Definition: sysstate.h:44
The system reached its terminal state.
Definition: sysstate.h:60
System_state_Codes
System states.
Definition: sysstate.h:40
static __inline__ bool _System_state_Is_up(System_state_Codes state)
Checks if the state is up.
Definition: sysstate.h:133
static __inline__ void _System_state_Set(System_state_Codes state)
Sets the current system state to the given state.
Definition: sysstate.h:78
static __inline__ bool _System_state_Is_before_multitasking(System_state_Codes state)
Checks if the state is before multitasking.
Definition: sysstate.h:118
The system is up and operating normally.
Definition: sysstate.h:55
static __inline__ bool _System_state_Is_before_initialization(System_state_Codes state)
Checks if the state is before initialization.
Definition: sysstate.h:103
static __inline__ System_state_Codes _System_state_Get(void)
Gets the current system state.
Definition: sysstate.h:90
The system is between end of the first phase of initialization but before multitasking is started...
Definition: sysstate.h:50
static __inline__ bool _System_state_Is_terminated(System_state_Codes state)
Checks if the state is terminated.
Definition: sysstate.h:148
This header file provides basic definitions used by the API and the implementation.
#define RTEMS_INLINE_ROUTINE
Gives a hint to the compiler in a function declaration to inline this function.
Definition: basedefs.h:683