source: rtems/c/src/exec/score/headers/sysstate.h @ eb5a7e07

4.104.114.84.95
Last change on this file since eb5a7e07 was 5e9b32b, checked in by Joel Sherrill <joel.sherrill@…>, on 09/26/95 at 19:27:15

posix support initially added

  • Property mode set to 100644
File size: 3.4 KB
Line 
1/*  sysstates.h
2 *
3 *  This include file contains information regarding the system state.
4 *
5 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
6 *  On-Line Applications Research Corporation (OAR).
7 *  All rights assigned to U.S. Government, 1994.
8 *
9 *  This material may be reproduced by or for the U.S. Government pursuant
10 *  to the copyright license under the clause at DFARS 252.227-7013.  This
11 *  notice must appear in all copies of this file and its derivatives.
12 *
13 *  $Id$
14 */
15
16#ifndef __RTEMS_SYSTEM_STATE_h
17#define __RTEMS_SYSTEM_STATE_h
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23/* types */
24
25/* enumerated constants */
26
27/*
28 *  The following type defines the possible system states.
29 */
30
31typedef enum {
32  SYSTEM_STATE_BEFORE_INITIALIZATION,   /* start -> end of 1st init part */
33  SYSTEM_STATE_BEFORE_MULTITASKING,     /* end of 1st -> beginning of 2nd */
34  SYSTEM_STATE_BEGIN_MULTITASKING,      /* beginning of 2nd -> end of SYSI */
35  SYSTEM_STATE_UP,                      /* normal operation */
36  SYSTEM_STATE_FAILED                   /* fatal error occurred */
37} System_state_Codes;
38
39#define SYSTEM_STATE_CODES_FIRST SYSTEM_STATE_BEFORE_INITIALIZATION
40#define SYSTEM_STATE_CODES_LAST  SYSTEM_STATE_FAILED
41
42/*
43 *  The following variable indicates whether or not this is
44 *  an multiprocessing system.
45 */
46 
47EXTERN boolean _System_state_Is_multiprocessing;
48
49/*
50 *  The following variable contains the current system state.
51 */
52
53EXTERN System_state_Codes _System_state_Current;
54
55/*
56 *  _System_state_Handler_initialization
57 *
58 *  DESCRIPTION:
59 *
60 *  This routine initializes the system state handler.
61 */
62 
63STATIC INLINE void _System_state_Handler_initialization (
64  boolean  is_multiprocessing
65);
66 
67/*
68 *  _System_state_Set
69 *
70 *  DESCRIPTION:
71 *
72 *  This routine sets the current system state to that specified by
73 *  the called.
74 */
75
76STATIC INLINE void _System_state_Set (
77  System_state_Codes state
78);
79
80/*
81 *  _System_state_Get
82 *
83 *  DESCRIPTION:
84 *
85 *  This function returns the current system state.
86 */
87
88STATIC INLINE System_state_Codes _System_state_Get ( void );
89
90/*
91 *  _System_state_Is_before_initialization
92 *
93 *  DESCRIPTION:
94 *
95 *  This function returns TRUE if the state is equal to the
96 *  "before initialization" state, and FALSE otherwise.
97 */
98
99STATIC INLINE boolean _System_state_Is_before_initialization (
100  System_state_Codes state
101);
102
103/*
104 *  _System_state_Is_before_multitasking
105 *
106 *  DESCRIPTION:
107 *
108 *  This function returns TRUE if the state is equal to the
109 *  "before multitasking" state, and FALSE otherwise.
110 */
111
112STATIC INLINE boolean _System_state_Is_before_multitasking (
113  System_state_Codes state
114);
115
116/*
117 *  _System_state_Is_begin_multitasking
118 *
119 *  DESCRIPTION:
120 *
121 *  This function returns TRUE if the state is equal to the
122 *  "begin multitasking" state, and FALSE otherwise.
123 */
124
125STATIC INLINE boolean _System_state_Is_begin_multitasking (
126  System_state_Codes state
127);
128
129/*
130 *  _System_state_Is_up
131 *
132 *  DESCRIPTION:
133 *
134 *  This function returns TRUE if the state is equal to the
135 *  "up" state, and FALSE otherwise.
136 */
137
138STATIC INLINE boolean _System_state_Is_up (
139  System_state_Codes state
140);
141
142/*
143 *  _System_state_Is_failed
144 *
145 *  DESCRIPTION:
146 *
147 *  This function returns TRUE if the state is equal to the
148 *  "failed" state, and FALSE otherwise.
149 */
150
151STATIC INLINE boolean _System_state_Is_failed (
152  System_state_Codes state
153);
154
155#include <rtems/score/sysstate.inl>
156
157#ifdef __cplusplus
158}
159#endif
160
161#endif
162/* end of include file */
Note: See TracBrowser for help on using the repository browser.