RTEMS 5.2
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
40typedef 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)
68extern bool _System_state_Is_multiprocessing;
69#endif
70
71extern System_state_Codes _System_state_Current;
72
80)
81{
82 _System_state_Current = state;
83}
84
91{
92 return _System_state_Current;
93}
94
105)
106{
107 return (state == SYSTEM_STATE_BEFORE_INITIALIZATION);
108}
109
120)
121{
122 return (state == SYSTEM_STATE_BEFORE_MULTITASKING);
123}
124
135)
136{
137 return (state == SYSTEM_STATE_UP);
138}
139
150)
151{
152 return (state == SYSTEM_STATE_TERMINATED);
153}
154
157#ifdef __cplusplus
158}
159#endif
160
161#endif
162/* end of include file */
Basic Definitions.
#define RTEMS_INLINE_ROUTINE
Definition: basedefs.h:66
RTEMS_INLINE_ROUTINE System_state_Codes _System_state_Get(void)
Gets the current system state.
Definition: sysstate.h:90
RTEMS_INLINE_ROUTINE bool _System_state_Is_before_multitasking(System_state_Codes state)
Checks if the state is before multitasking.
Definition: sysstate.h:118
RTEMS_INLINE_ROUTINE bool _System_state_Is_before_initialization(System_state_Codes state)
Checks if the state is before initialization.
Definition: sysstate.h:103
System_state_Codes
System states.
Definition: sysstate.h:40
RTEMS_INLINE_ROUTINE bool _System_state_Is_up(System_state_Codes state)
Checks if the state is up.
Definition: sysstate.h:133
RTEMS_INLINE_ROUTINE void _System_state_Set(System_state_Codes state)
Sets the current system state to the given state.
Definition: sysstate.h:78
RTEMS_INLINE_ROUTINE bool _System_state_Is_terminated(System_state_Codes state)
Checks if the state is terminated.
Definition: sysstate.h:148
@ SYSTEM_STATE_TERMINATED
The system reached its terminal state.
Definition: sysstate.h:60
@ SYSTEM_STATE_UP
The system is up and operating normally.
Definition: sysstate.h:55
@ SYSTEM_STATE_BEFORE_MULTITASKING
The system is between end of the first phase of initialization but before multitasking is started.
Definition: sysstate.h:50
@ SYSTEM_STATE_BEFORE_INITIALIZATION
The system is before the end of the first phase of initialization.
Definition: sysstate.h:44