source: rtems/cpukit/score/include/rtems/score/sysstate.h @ ac7d5ef0

4.104.114.84.95
Last change on this file since ac7d5ef0 was ac7d5ef0, checked in by Joel Sherrill <joel.sherrill@…>, on May 11, 1995 at 5:39:37 PM

Initial revision

  • Property mode set to 100644
File size: 3.0 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 contains the current system state.
44 */
45
46EXTERN System_state_Codes _System_state_Current;
47
48/*
49 *  _System_state_Set
50 *
51 *  DESCRIPTION:
52 *
53 *  This routine sets the current system state to that specified by
54 *  the called.
55 */
56
57STATIC INLINE void _System_state_Set (
58  System_state_Codes state
59);
60
61/*
62 *  _System_state_Get
63 *
64 *  DESCRIPTION:
65 *
66 *  This function returns the current system state.
67 */
68
69STATIC INLINE System_state_Codes _System_state_Get ( void );
70
71/*
72 *  _System_state_Is_before_initialization
73 *
74 *  DESCRIPTION:
75 *
76 *  This function returns TRUE if the state is equal to the
77 *  "before initialization" state, and FALSE otherwise.
78 */
79
80STATIC INLINE boolean _System_state_Is_before_initialization (
81  System_state_Codes state
82);
83
84/*
85 *  _System_state_Is_before_multitasking
86 *
87 *  DESCRIPTION:
88 *
89 *  This function returns TRUE if the state is equal to the
90 *  "before multitasking" state, and FALSE otherwise.
91 */
92
93STATIC INLINE boolean _System_state_Is_before_multitasking (
94  System_state_Codes state
95);
96
97/*
98 *  _System_state_Is_begin_multitasking
99 *
100 *  DESCRIPTION:
101 *
102 *  This function returns TRUE if the state is equal to the
103 *  "begin multitasking" state, and FALSE otherwise.
104 */
105
106STATIC INLINE boolean _System_state_Is_begin_multitasking (
107  System_state_Codes state
108);
109
110/*
111 *  _System_state_Is_up
112 *
113 *  DESCRIPTION:
114 *
115 *  This function returns TRUE if the state is equal to the
116 *  "up" state, and FALSE otherwise.
117 */
118
119STATIC INLINE boolean _System_state_Is_up (
120  System_state_Codes state
121);
122
123/*
124 *  _System_state_Is_failed
125 *
126 *  DESCRIPTION:
127 *
128 *  This function returns TRUE if the state is equal to the
129 *  "failed" state, and FALSE otherwise.
130 */
131
132STATIC INLINE boolean _System_state_Is_failed (
133  System_state_Codes state
134);
135
136#include <rtems/sysstate.inl>
137
138#ifdef __cplusplus
139}
140#endif
141
142#endif
143/* end of include file */
Note: See TracBrowser for help on using the repository browser.