RTEMS  5.0.0
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 
39 typedef enum {
44 
50 
55 
61 
62 #define SYSTEM_STATE_CODES_FIRST SYSTEM_STATE_BEFORE_INITIALIZATION
63 
64 #define SYSTEM_STATE_CODES_LAST SYSTEM_STATE_TERMINATED
65 
66 #if defined(RTEMS_MULTIPROCESSING)
67 extern bool _System_state_Is_multiprocessing;
68 #endif
69 
70 extern System_state_Codes _System_state_Current;
71 
72 RTEMS_INLINE_ROUTINE void _System_state_Set (
73  System_state_Codes state
74 )
75 {
76  _System_state_Current = state;
77 }
78 
79 RTEMS_INLINE_ROUTINE System_state_Codes _System_state_Get ( void )
80 {
81  return _System_state_Current;
82 }
83 
84 RTEMS_INLINE_ROUTINE bool _System_state_Is_before_initialization (
85  System_state_Codes state
86 )
87 {
88  return (state == SYSTEM_STATE_BEFORE_INITIALIZATION);
89 }
90 
91 RTEMS_INLINE_ROUTINE bool _System_state_Is_before_multitasking (
92  System_state_Codes state
93 )
94 {
95  return (state == SYSTEM_STATE_BEFORE_MULTITASKING);
96 }
97 
98 RTEMS_INLINE_ROUTINE bool _System_state_Is_up (
99  System_state_Codes state
100 )
101 {
102  return (state == SYSTEM_STATE_UP);
103 }
104 
105 RTEMS_INLINE_ROUTINE bool _System_state_Is_terminated (
106  System_state_Codes state
107 )
108 {
109  return (state == SYSTEM_STATE_TERMINATED);
110 }
111 
114 #ifdef __cplusplus
115 }
116 #endif
117 
118 #endif
119 /* end of include file */
#define RTEMS_INLINE_ROUTINE
Definition: basedefs.h:65
The system is up and operating normally.
Definition: sysstate.h:54
The system is between end of the first phase of initialization but before multitasking is started...
Definition: sysstate.h:49
The system is before the end of the first phase of initialization.
Definition: sysstate.h:43
Basic Definitions.
System_state_Codes
System states.
Definition: sysstate.h:39
The system reached its terminal state.
Definition: sysstate.h:59