source: rtems/c/src/exec/score/inline/states.inl @ 95fbca1

4.104.114.84.95
Last change on this file since 95fbca1 was ac7d5ef0, checked in by Joel Sherrill <joel.sherrill@…>, on 05/11/95 at 17:39:37

Initial revision

  • Property mode set to 100644
File size: 4.2 KB
Line 
1/*  states.inl
2 *
3 *  This file contains the macro implementation of the inlined
4 *  routines associated with RTEMS state information.
5 *
6 *  COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
7 *  On-Line Applications Research Corporation (OAR).
8 *  All rights assigned to U.S. Government, 1994.
9 *
10 *  This material may be reproduced by or for the U.S. Government pursuant
11 *  to the copyright license under the clause at DFARS 252.227-7013.  This
12 *  notice must appear in all copies of this file and its derivatives.
13 *
14 *  $Id$
15 */
16
17#ifndef __STATES_inl
18#define __STATES_inl
19
20/*PAGE
21 *
22 *  _States_Set
23 *
24 */
25
26STATIC INLINE States_Control _States_Set (
27  States_Control states_to_set,
28  States_Control current_state
29)
30{
31   return (current_state | states_to_set);
32}
33
34/*PAGE
35 *
36 *  _States_Clear
37 *
38 */
39
40STATIC INLINE States_Control _States_Clear (
41  States_Control states_to_clear,
42  States_Control current_state
43)
44{
45   return (current_state & ~states_to_clear);
46}
47
48/*PAGE
49 *
50 *  _States_Is_ready
51 *
52 */
53
54STATIC INLINE boolean _States_Is_ready (
55  States_Control the_states
56)
57{
58   return (the_states == STATES_READY);
59}
60
61/*PAGE
62 *
63 *  _States_Is_only_dormant
64 *
65 */
66
67STATIC INLINE boolean _States_Is_only_dormant (
68  States_Control the_states
69)
70{
71   return (the_states == STATES_DORMANT);
72}
73
74/*PAGE
75 *
76 *  _States_Is_dormant
77 *
78 */
79
80STATIC INLINE boolean _States_Is_dormant (
81  States_Control the_states
82)
83{
84   return (the_states & STATES_DORMANT);
85}
86
87/*PAGE
88 *
89 *  _States_Is_suspended
90 *
91 */
92
93STATIC INLINE boolean _States_Is_suspended (
94  States_Control the_states
95)
96{
97   return (the_states & STATES_SUSPENDED);
98}
99
100/*PAGE
101 *
102 *  _States_Is_Transient
103 *
104 */
105
106STATIC INLINE boolean _States_Is_transient (
107  States_Control the_states
108)
109{
110   return (the_states & STATES_TRANSIENT);
111}
112
113/*PAGE
114 *
115 *  _States_Is_delaying
116 *
117 */
118
119STATIC INLINE boolean _States_Is_delaying (
120  States_Control the_states
121)
122{
123   return (the_states & STATES_DELAYING);
124}
125
126/*PAGE
127 *
128 *  _States_Is_waiting_for_buffer
129 *
130 */
131
132STATIC INLINE boolean _States_Is_waiting_for_buffer (
133  States_Control the_states
134)
135{
136   return (the_states & STATES_WAITING_FOR_BUFFER);
137}
138
139/*PAGE
140 *
141 *  _States_Is_waiting_for_segment
142 *
143 */
144
145STATIC INLINE boolean _States_Is_waiting_for_segment (
146  States_Control the_states
147)
148{
149   return (the_states & STATES_WAITING_FOR_SEGMENT);
150}
151
152/*PAGE
153 *
154 *  _States_Is_waiting_for_message
155 *
156 */
157
158STATIC INLINE boolean _States_Is_waiting_for_message (
159  States_Control the_states
160)
161{
162   return (the_states & STATES_WAITING_FOR_MESSAGE);
163}
164
165/*PAGE
166 *
167 *  _States_Is_waiting_for_event
168 *
169 */
170
171STATIC INLINE boolean _States_Is_waiting_for_event (
172  States_Control the_states
173)
174{
175   return (the_states & STATES_WAITING_FOR_EVENT);
176}
177
178/*PAGE
179 *
180 *  _States_Is_waiting_for_semaphore
181 *
182 */
183
184STATIC INLINE boolean _States_Is_waiting_for_semaphore (
185  States_Control the_states
186)
187{
188   return (the_states & STATES_WAITING_FOR_SEMAPHORE);
189}
190
191/*PAGE
192 *
193 *  _States_Is_waiting_for_time
194 *
195 */
196
197STATIC INLINE boolean _States_Is_waiting_for_time (
198  States_Control the_states
199)
200{
201   return (the_states & STATES_WAITING_FOR_TIME);
202}
203
204/*PAGE
205 *
206 *  _States_Is_waiting_for_rpc_reply
207 *
208 */
209
210STATIC INLINE boolean _States_Is_waiting_for_rpc_reply (
211  States_Control the_states
212)
213{
214   return (the_states & STATES_WAITING_FOR_RPC_REPLY);
215}
216
217/*PAGE
218 *
219 *  _States_Is_waiting_for_period
220 *
221 */
222
223STATIC INLINE boolean _States_Is_waiting_for_period (
224  States_Control the_states
225)
226{
227   return (the_states & STATES_WAITING_FOR_PERIOD);
228}
229
230/*PAGE
231 *
232 *  _States_Is_locally_blocked
233 *
234 */
235
236STATIC INLINE boolean _States_Is_locally_blocked (
237  States_Control the_states
238)
239{
240   return (the_states & STATES_LOCALLY_BLOCKED);
241}
242
243/*PAGE
244 *
245 *  _States_Is_waiting_on_thread_queue
246 *
247 */
248
249STATIC INLINE boolean _States_Is_waiting_on_thread_queue (
250  States_Control the_states
251)
252{
253   return (the_states & STATES_WAITING_ON_THREAD_QUEUE);
254}
255
256/*PAGE
257 *
258 *  _States_Is_blocked
259 *
260 */
261
262STATIC INLINE boolean _States_Is_blocked (
263  States_Control the_states
264)
265{
266   return (the_states & STATES_BLOCKED);
267}
268
269/*PAGEPAGE
270 *
271 *
272 *  _States_Are_set
273 *
274 */
275
276STATIC INLINE boolean _States_Are_set (
277  States_Control the_states,
278  States_Control mask
279)
280{
281   return ( (the_states & mask) != STATES_READY);
282}
283
284#endif
285/* end of include file */
Note: See TracBrowser for help on using the repository browser.