RTEMS CPU Kit with SuperCore  4.11.2
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 SCORE_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 void _System_state_Handler_initialization (
80 #if defined(RTEMS_MULTIPROCESSING)
81  bool is_multiprocessing
82 #else
83  bool is_multiprocessing __attribute__((unused))
84 #endif
85 )
86 {
87  _System_state_Set( SYSTEM_STATE_BEFORE_INITIALIZATION );
88 #if defined(RTEMS_MULTIPROCESSING)
89  _System_state_Is_multiprocessing = is_multiprocessing;
90 #endif
91 }
92 
93 RTEMS_INLINE_ROUTINE System_state_Codes _System_state_Get ( void )
94 {
95  return _System_state_Current;
96 }
97 
98 RTEMS_INLINE_ROUTINE bool _System_state_Is_before_initialization (
99  System_state_Codes state
100 )
101 {
102  return (state == SYSTEM_STATE_BEFORE_INITIALIZATION);
103 }
104 
105 RTEMS_INLINE_ROUTINE bool _System_state_Is_before_multitasking (
106  System_state_Codes state
107 )
108 {
109  return (state == SYSTEM_STATE_BEFORE_MULTITASKING);
110 }
111 
112 RTEMS_INLINE_ROUTINE bool _System_state_Is_up (
113  System_state_Codes state
114 )
115 {
116  return (state == SYSTEM_STATE_UP);
117 }
118 
119 RTEMS_INLINE_ROUTINE bool _System_state_Is_terminated (
120  System_state_Codes state
121 )
122 {
123  return (state == SYSTEM_STATE_TERMINATED);
124 }
125 
128 #ifdef __cplusplus
129 }
130 #endif
131 
132 #endif
133 /* end of include file */
#define RTEMS_INLINE_ROUTINE
The following (in conjunction with compiler arguments) are used to choose between the use of static i...
Definition: basedefs.h:135
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.
#define SCORE_EXTERN
The following ensures that all data is declared in the space of the initialization routine for either...
Definition: basedefs.h:81
System_state_Codes
System states.
Definition: sysstate.h:39
The system reached its terminal state.
Definition: sysstate.h:59