OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rtems-20020807/] [cpukit/] [score/] [inline/] [rtems/] [score/] [states.inl] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1026 ivang
/*  states.inl
2
 *
3
 *  This file contains the macro implementation of the inlined
4
 *  routines associated with thread state information.
5
 *
6
 *  COPYRIGHT (c) 1989-1999.
7
 *  On-Line Applications Research Corporation (OAR).
8
 *
9
 *  The license and distribution terms for this file may be
10
 *  found in the file LICENSE in this distribution or at
11
 *  http://www.OARcorp.com/rtems/license.html.
12
 *
13
 *  states.inl,v 1.10 1999/11/17 17:50:37 joel Exp
14
 */
15
 
16
#ifndef __STATES_inl
17
#define __STATES_inl
18
 
19
/*PAGE
20
 *
21
 *  _States_Set
22
 *
23
 *  DESCRIPTION:
24
 *
25
 *  This function sets the given states_to_set into the current_state
26
 *  passed in.  The result is returned to the user in current_state.
27
 */
28
 
29
RTEMS_INLINE_ROUTINE States_Control _States_Set (
30
  States_Control states_to_set,
31
  States_Control current_state
32
)
33
{
34
   return (current_state | states_to_set);
35
}
36
 
37
/*PAGE
38
 *
39
 *  _States_Clear
40
 *
41
 *  DESCRIPTION:
42
 *
43
 *  This function clears the given states_to_clear into the current_state
44
 *  passed in.  The result is returned to the user in current_state.
45
 */
46
 
47
RTEMS_INLINE_ROUTINE States_Control _States_Clear (
48
  States_Control states_to_clear,
49
  States_Control current_state
50
)
51
{
52
   return (current_state & ~states_to_clear);
53
}
54
 
55
/*PAGE
56
 *
57
 *  _States_Is_ready
58
 *
59
 *  DESCRIPTION:
60
 *
61
 *  This function returns TRUE if the_states indicates that the
62
 *  state is READY, and FALSE otherwise.
63
 */
64
 
65
RTEMS_INLINE_ROUTINE boolean _States_Is_ready (
66
  States_Control the_states
67
)
68
{
69
   return (the_states == STATES_READY);
70
}
71
 
72
/*PAGE
73
 *
74
 *  _States_Is_only_dormant
75
 *
76
 *  DESCRIPTION:
77
 *
78
 *  This function returns TRUE if the DORMANT state is the ONLY state
79
 *  set in the_states, and FALSE otherwise.
80
 */
81
 
82
RTEMS_INLINE_ROUTINE boolean _States_Is_only_dormant (
83
  States_Control the_states
84
)
85
{
86
   return (the_states == STATES_DORMANT);
87
}
88
 
89
/*PAGE
90
 *
91
 *  _States_Is_dormant
92
 *
93
 *  DESCRIPTION:
94
 *
95
 *  This function returns TRUE if the DORMANT state is set in
96
 *  the_states, and FALSE otherwise.
97
 */
98
 
99
RTEMS_INLINE_ROUTINE boolean _States_Is_dormant (
100
  States_Control the_states
101
)
102
{
103
   return (the_states & STATES_DORMANT);
104
}
105
 
106
/*PAGE
107
 *
108
 *  _States_Is_suspended
109
 *
110
 *  DESCRIPTION:
111
 *
112
 *  This function returns TRUE if the SUSPENDED state is set in
113
 *  the_states, and FALSE otherwise.
114
 */
115
 
116
RTEMS_INLINE_ROUTINE boolean _States_Is_suspended (
117
  States_Control the_states
118
)
119
{
120
   return (the_states & STATES_SUSPENDED);
121
}
122
 
123
/*PAGE
124
 *
125
 *  _States_Is_Transient
126
 *
127
 *  DESCRIPTION:
128
 *
129
 *  This function returns TRUE if the TRANSIENT state is set in
130
 *  the_states, and FALSE otherwise.
131
 */
132
 
133
RTEMS_INLINE_ROUTINE boolean _States_Is_transient (
134
  States_Control the_states
135
)
136
{
137
   return (the_states & STATES_TRANSIENT);
138
}
139
 
140
/*PAGE
141
 *
142
 *  _States_Is_delaying
143
 *
144
 *  DESCRIPTION:
145
 *
146
 *  This function returns TRUE if the DELAYING state is set in
147
 *  the_states, and FALSE otherwise.
148
 */
149
 
150
RTEMS_INLINE_ROUTINE boolean _States_Is_delaying (
151
  States_Control the_states
152
)
153
{
154
   return (the_states & STATES_DELAYING);
155
}
156
 
157
/*PAGE
158
 *
159
 *  _States_Is_waiting_for_buffer
160
 *
161
 *  DESCRIPTION:
162
 *
163
 *  This function returns TRUE if the WAITING_FOR_BUFFER state is set in
164
 *  the_states, and FALSE otherwise.
165
 */
166
 
167
RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_for_buffer (
168
  States_Control the_states
169
)
170
{
171
   return (the_states & STATES_WAITING_FOR_BUFFER);
172
}
173
 
174
/*PAGE
175
 *
176
 *  _States_Is_waiting_for_segment
177
 *
178
 *  DESCRIPTION:
179
 *
180
 *  This function returns TRUE if the WAITING_FOR_SEGMENT state is set in
181
 *  the_states, and FALSE otherwise.
182
 */
183
 
184
RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_for_segment (
185
  States_Control the_states
186
)
187
{
188
   return (the_states & STATES_WAITING_FOR_SEGMENT);
189
}
190
 
191
/*PAGE
192
 *
193
 *  _States_Is_waiting_for_message
194
 *
195
 *  DESCRIPTION:
196
 *
197
 *  This function returns TRUE if the WAITING_FOR_MESSAGE state is set in
198
 *  the_states, and FALSE otherwise.
199
 */
200
 
201
RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_for_message (
202
  States_Control the_states
203
)
204
{
205
   return (the_states & STATES_WAITING_FOR_MESSAGE);
206
}
207
 
208
/*PAGE
209
 *
210
 *  _States_Is_waiting_for_event
211
 *
212
 *  DESCRIPTION:
213
 *
214
 *  This function returns TRUE if the WAITING_FOR_EVENT state is set in
215
 *  the_states, and FALSE otherwise.
216
 */
217
 
218
RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_for_event (
219
  States_Control the_states
220
)
221
{
222
   return (the_states & STATES_WAITING_FOR_EVENT);
223
}
224
 
225
/*PAGE
226
 *
227
 *  _States_Is_waiting_for_mutex
228
 *
229
 *  DESCRIPTION:
230
 *
231
 *  This function returns TRUE if the WAITING_FOR_MUTEX state
232
 *  is set in the_states, and FALSE otherwise.
233
 */
234
 
235
RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_for_mutex (
236
  States_Control the_states
237
)
238
{
239
   return (the_states & STATES_WAITING_FOR_MUTEX);
240
}
241
 
242
/*PAGE
243
 *
244
 *  _States_Is_waiting_for_semaphore
245
 *
246
 *  DESCRIPTION:
247
 *
248
 *  This function returns TRUE if the WAITING_FOR_SEMAPHORE state
249
 *  is set in the_states, and FALSE otherwise.
250
 */
251
 
252
RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_for_semaphore (
253
  States_Control the_states
254
)
255
{
256
   return (the_states & STATES_WAITING_FOR_SEMAPHORE);
257
}
258
 
259
/*PAGE
260
 *
261
 *  _States_Is_waiting_for_time
262
 *
263
 *  DESCRIPTION:
264
 *
265
 *  This function returns TRUE if the WAITING_FOR_TIME state is set in
266
 *  the_states, and FALSE otherwise.
267
 */
268
 
269
RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_for_time (
270
  States_Control the_states
271
)
272
{
273
   return (the_states & STATES_WAITING_FOR_TIME);
274
}
275
 
276
/*PAGE
277
 *
278
 *  _States_Is_waiting_for_rpc_reply
279
 *
280
 *  DESCRIPTION:
281
 *
282
 *  This function returns TRUE if the WAITING_FOR_TIME state is set in
283
 *  the_states, and FALSE otherwise.
284
 */
285
 
286
RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_for_rpc_reply (
287
  States_Control the_states
288
)
289
{
290
   return (the_states & STATES_WAITING_FOR_RPC_REPLY);
291
}
292
 
293
/*PAGE
294
 *
295
 *  _States_Is_waiting_for_period
296
 *
297
 *  DESCRIPTION:
298
 *
299
 *  This function returns TRUE if the WAITING_FOR_PERIOD state is set in
300
 *  the_states, and FALSE otherwise.
301
 */
302
 
303
RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_for_period (
304
  States_Control the_states
305
)
306
{
307
   return (the_states & STATES_WAITING_FOR_PERIOD);
308
}
309
 
310
/*PAGE
311
 *
312
 *  _States_Is_locally_blocked
313
 *
314
 *  DESCRIPTION:
315
 *
316
 *  This function returns TRUE if one of the states which indicates
317
 *  that a task is blocked waiting for a local resource is set in
318
 *  the_states, and FALSE otherwise.
319
 */
320
 
321
RTEMS_INLINE_ROUTINE boolean _States_Is_locally_blocked (
322
  States_Control the_states
323
)
324
{
325
   return (the_states & STATES_LOCALLY_BLOCKED);
326
}
327
 
328
/*PAGE
329
 *
330
 *  _States_Is_waiting_on_thread_queue
331
 *
332
 *  DESCRIPTION:
333
 *
334
 *  This function returns TRUE if one of the states which indicates
335
 *  that a task is blocked waiting for a local resource is set in
336
 *  the_states, and FALSE otherwise.
337
 */
338
 
339
RTEMS_INLINE_ROUTINE boolean _States_Is_waiting_on_thread_queue (
340
  States_Control the_states
341
)
342
{
343
   return (the_states & STATES_WAITING_ON_THREAD_QUEUE);
344
}
345
 
346
/*PAGE
347
 *
348
 *  _States_Is_blocked
349
 *
350
 *  DESCRIPTION:
351
 *
352
 *  This function returns TRUE if one of the states which indicates
353
 *  that a task is blocked is set in the_states, and FALSE otherwise.
354
 */
355
 
356
RTEMS_INLINE_ROUTINE boolean _States_Is_blocked (
357
  States_Control the_states
358
)
359
{
360
   return (the_states & STATES_BLOCKED);
361
}
362
 
363
/*PAGE
364
 *
365
 *
366
 *  _States_Are_set
367
 *
368
 *  DESCRIPTION:
369
 *
370
 *  This function returns TRUE if any of the states in the mask
371
 *  are set in the_states, and FALSE otherwise.
372
 */
373
 
374
RTEMS_INLINE_ROUTINE boolean _States_Are_set (
375
  States_Control the_states,
376
  States_Control mask
377
)
378
{
379
   return ( (the_states & mask) != STATES_READY);
380
}
381
 
382
#endif
383
/* end of include file */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.