source: rtems/c/src/exec/score/headers/states.h @ b3ac6a8d

4.104.114.84.95
Last change on this file since b3ac6a8d was 3a4ae6c, checked in by Joel Sherrill <joel.sherrill@…>, on 09/11/95 at 19:35:39

The word "RTEMS" almost completely removed from the core.

Configuration Table Template file added and all tests
modified to use this. All gvar.h and conftbl.h files
removed from test directories.

Configuration parameter maximum_devices added.

Core semaphore and mutex handlers added and RTEMS API Semaphore
Manager updated to reflect this.

Initialization sequence changed to invoke API specific initialization
routines. Initialization tasks table now owned by RTEMS Tasks Manager.

Added user extension for post-switch.

Utilized user extensions to implement API specific functionality
like signal dispatching.

Added extensions to the System Initialization Thread so that an
API can register a function to be invoked while the system
is being initialized. These are largely equivalent to the
pre-driver and post-driver hooks.

Added the Modules file oar-go32_p5, modified oar-go32, and modified
the file make/custom/go32.cfg to look at an environment varable which
determines what CPU model is being used.

All BSPs updated to reflect named devices and clock driver's IOCTL
used by the Shared Memory Driver. Also merged clock isr into
main file and removed ckisr.c where possible.

Updated spsize to reflect new and moved variables.

Makefiles for the executive source and include files updated to show
break down of files into Core, RTEMS API, and Neither.

Header and inline files installed into subdirectory based on whether
logically in the Core or a part of the RTEMS API.

  • Property mode set to 100644
File size: 8.2 KB
Line 
1/*  states.h
2 *
3 *  This include file contains thread execution state information.
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_STATES_h
17#define __RTEMS_STATES_h
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23/*
24 *  The following type defines the control block used to manage a
25 *  thread's state.
26 */
27
28typedef unsigned32 States_Control;
29
30/*
31 *  The following constants define the individual states which may be
32 *  be used to compose and manipulate a thread's state.
33 */
34
35#define STATES_ALL_SET               0xffff  /* all states */
36#define STATES_READY                 0x0000  /* ready to run */
37#define STATES_DORMANT               0x0001  /* created but not started */
38#define STATES_SUSPENDED             0x0002  /* waiting to be resumed */
39#define STATES_TRANSIENT             0x0004  /* thread in transition */
40#define STATES_DELAYING              0x0008  /* wait for timeout */
41#define STATES_WAITING_FOR_BUFFER    0x0010  /* wait for partition buffer */
42#define STATES_WAITING_FOR_SEGMENT   0x0020  /* wait for region segment */
43#define STATES_WAITING_FOR_MESSAGE   0x0040  /* wait for message */
44#define STATES_WAITING_FOR_EVENT     0x0080  /* wait for event */
45#define STATES_WAITING_FOR_SEMAPHORE 0x0100  /* wait for semaphore */
46#define STATES_WAITING_FOR_MUTEX     0x0200  /* wait for mutex */
47#define STATES_WAITING_FOR_TIME      0x0400  /* wait for specific TOD */
48#define STATES_WAITING_FOR_RPC_REPLY 0x0800  /* wait for rpc reply */
49#define STATES_WAITING_FOR_PERIOD    0x1000  /* rate monotonic delay */
50
51#define STATES_LOCALLY_BLOCKED ( STATES_WAITING_FOR_BUFFER      | \
52                                 STATES_WAITING_FOR_SEGMENT     | \
53                                 STATES_WAITING_FOR_MESSAGE     | \
54                                 STATES_WAITING_FOR_MUTEX       | \
55                                 STATES_WAITING_FOR_SEMAPHORE   )
56
57#define STATES_WAITING_ON_THREAD_QUEUE \
58                               ( STATES_LOCALLY_BLOCKED         | \
59                                 STATES_WAITING_FOR_RPC_REPLY   )
60
61#define STATES_BLOCKED         ( STATES_DELAYING                | \
62                                 STATES_WAITING_FOR_TIME        | \
63                                 STATES_WAITING_FOR_PERIOD      | \
64                                 STATES_WAITING_FOR_EVENT       | \
65                                 STATES_WAITING_ON_THREAD_QUEUE )
66
67/*
68 *  _States_Set
69 *
70 *  DESCRIPTION:
71 *
72 *  This function sets the given states_to_set into the current_state
73 *  passed in.  The result is returned to the user in current_state.
74 */
75
76STATIC INLINE States_Control _States_Set (
77  States_Control states_to_set,
78  States_Control current_state
79);
80
81/*
82 *  _States_Clear
83 *
84 *  DESCRIPTION:
85 *
86 *  This function clears the given states_to_clear into the current_state
87 *  passed in.  The result is returned to the user in current_state.
88 */
89
90STATIC INLINE States_Control _States_Clear (
91  States_Control states_to_clear,
92  States_Control current_state
93);
94
95/*
96 *  _States_Is_ready
97 *
98 *  DESCRIPTION:
99 *
100 *  This function returns TRUE if the_states indicates that the
101 *  state is READY, and FALSE otherwise.
102 */
103
104STATIC INLINE boolean _States_Is_ready (
105  States_Control the_states
106);
107
108/*
109 *  _States_Is_only_dormant
110 *
111 *  DESCRIPTION:
112 *
113 *  This function returns TRUE if the DORMANT state is the ONLY state
114 *  set in the_states, and FALSE otherwise.
115 */
116
117STATIC INLINE boolean _States_Is_only_dormant (
118  States_Control the_states
119);
120
121/*
122 *  _States_Is_dormant
123 *
124 *  DESCRIPTION:
125 *
126 *  This function returns TRUE if the DORMANT state is set in
127 *  the_states, and FALSE otherwise.
128 */
129
130STATIC INLINE boolean _States_Is_dormant (
131  States_Control the_states
132);
133
134/*
135 *  _States_Is_suspended
136 *
137 *  DESCRIPTION:
138 *
139 *  This function returns TRUE if the SUSPENDED state is set in
140 *  the_states, and FALSE otherwise.
141 */
142
143STATIC INLINE boolean _States_Is_suspended (
144  States_Control the_states
145);
146
147/*
148 *  _States_Is_Transient
149 *
150 *  DESCRIPTION:
151 *
152 *  This function returns TRUE if the TRANSIENT state is set in
153 *  the_states, and FALSE otherwise.
154 */
155
156STATIC INLINE boolean _States_Is_transient (
157  States_Control the_states
158);
159
160/*
161 *  _States_Is_delaying
162 *
163 *  DESCRIPTION:
164 *
165 *  This function returns TRUE if the DELAYING state is set in
166 *  the_states, and FALSE otherwise.
167 */
168
169STATIC INLINE boolean _States_Is_delaying (
170  States_Control the_states
171);
172
173/*
174 *  _States_Is_waiting_for_buffer
175 *
176 *  DESCRIPTION:
177 *
178 *  This function returns TRUE if the WAITING_FOR_BUFFER state is set in
179 *  the_states, and FALSE otherwise.
180 */
181
182STATIC INLINE boolean _States_Is_waiting_for_buffer (
183  States_Control the_states
184);
185
186/*
187 *  _States_Is_waiting_for_segment
188 *
189 *  DESCRIPTION:
190 *
191 *  This function returns TRUE if the WAITING_FOR_SEGMENT state is set in
192 *  the_states, and FALSE otherwise.
193 */
194
195STATIC INLINE boolean _States_Is_waiting_for_segment (
196  States_Control the_states
197);
198
199/*
200 *  _States_Is_waiting_for_message
201 *
202 *  DESCRIPTION:
203 *
204 *  This function returns TRUE if the WAITING_FOR_MESSAGE state is set in
205 *  the_states, and FALSE otherwise.
206 */
207
208STATIC INLINE boolean _States_Is_waiting_for_message (
209  States_Control the_states
210);
211
212/*
213 *  _States_Is_waiting_for_event
214 *
215 *  DESCRIPTION:
216 *
217 *  This function returns TRUE if the WAITING_FOR_EVENT state is set in
218 *  the_states, and FALSE otherwise.
219 */
220
221STATIC INLINE boolean _States_Is_waiting_for_event (
222  States_Control the_states
223);
224
225/*
226 *  _States_Is_waiting_for_mutex
227 *
228 *  DESCRIPTION:
229 *
230 *  This function returns TRUE if the WAITING_FOR_MUTEX state
231 *  is set in the_states, and FALSE otherwise.
232 */
233 
234STATIC INLINE boolean _States_Is_waiting_for_mutex (
235  States_Control the_states
236);
237
238/*
239 *  _States_Is_waiting_for_semaphore
240 *
241 *  DESCRIPTION:
242 *
243 *  This function returns TRUE if the WAITING_FOR_SEMAPHORE state
244 *  is set in the_states, and FALSE otherwise.
245 */
246
247STATIC INLINE boolean _States_Is_waiting_for_semaphore (
248  States_Control the_states
249);
250
251/*
252 *  _States_Is_waiting_for_time
253 *
254 *  DESCRIPTION:
255 *
256 *  This function returns TRUE if the WAITING_FOR_TIME state is set in
257 *  the_states, and FALSE otherwise.
258 */
259
260STATIC INLINE boolean _States_Is_waiting_for_time (
261  States_Control the_states
262);
263
264/*
265 *  _States_Is_waiting_for_rpc_reply
266 *
267 *  DESCRIPTION:
268 *
269 *  This function returns TRUE if the WAITING_FOR_TIME state is set in
270 *  the_states, and FALSE otherwise.
271 */
272
273STATIC INLINE boolean _States_Is_waiting_for_rpc_reply (
274  States_Control the_states
275);
276
277/*
278 *  _States_Is_waiting_for_period
279 *
280 *  DESCRIPTION:
281 *
282 *  This function returns TRUE if the WAITING_FOR_PERIOD state is set in
283 *  the_states, and FALSE otherwise.
284 */
285
286STATIC INLINE boolean _States_Is_waiting_for_period (
287  States_Control the_states
288);
289
290/*
291 *  _States_Is_locally_blocked
292 *
293 *  DESCRIPTION:
294 *
295 *  This function returns TRUE if one of the states which indicates
296 *  that a task is blocked waiting for a local resource is set in
297 *  the_states, and FALSE otherwise.
298 */
299
300STATIC INLINE boolean _States_Is_locally_blocked (
301  States_Control the_states
302);
303
304/*
305 *  _States_Is_waiting_on_thread_queue
306 *
307 *  DESCRIPTION:
308 *
309 *  This function returns TRUE if one of the states which indicates
310 *  that a task is blocked waiting for a local resource is set in
311 *  the_states, and FALSE otherwise.
312 */
313
314STATIC INLINE boolean _States_Is_waiting_on_thread_queue (
315  States_Control the_states
316);
317
318/*
319 *  _States_Is_blocked
320 *
321 *  DESCRIPTION:
322 *
323 *  This function returns TRUE if one of the states which indicates
324 *  that a task is blocked is set in the_states, and FALSE otherwise.
325 */
326
327STATIC INLINE boolean _States_Is_blocked (
328  States_Control the_states
329);
330
331/*
332 *  _States_Are_set
333 *
334 *  DESCRIPTION:
335 *
336 *  This function returns TRUE if any of the states in the mask
337 *  are set in the_states, and FALSE otherwise.
338 */
339
340STATIC INLINE boolean _States_Are_set (
341  States_Control the_states,
342  States_Control mask
343);
344
345#include <rtems/core/states.inl>
346
347#ifdef __cplusplus
348}
349#endif
350
351#endif
352/* end of include file */
Note: See TracBrowser for help on using the repository browser.