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 |
---|
20 | extern "C" { |
---|
21 | #endif |
---|
22 | |
---|
23 | /* |
---|
24 | * The following type defines the control block used to manage a |
---|
25 | * thread's state. |
---|
26 | */ |
---|
27 | |
---|
28 | typedef 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 not started */ |
---|
38 | #define STATES_SUSPENDED 0x0002 /* waiting for resume */ |
---|
39 | #define STATES_TRANSIENT 0x0004 /* thread in transition */ |
---|
40 | #define STATES_DELAYING 0x0008 /* wait for timeout */ |
---|
41 | #define STATES_WAITING_FOR_TIME 0x0010 /* wait for TOD */ |
---|
42 | #define STATES_WAITING_FOR_BUFFER 0x0020 |
---|
43 | #define STATES_WAITING_FOR_SEGMENT 0x0040 |
---|
44 | #define STATES_WAITING_FOR_MESSAGE 0x0080 |
---|
45 | #define STATES_WAITING_FOR_EVENT 0x0100 |
---|
46 | #define STATES_WAITING_FOR_SEMAPHORE 0x0200 |
---|
47 | #define STATES_WAITING_FOR_MUTEX 0x0400 |
---|
48 | #define STATES_WAITING_FOR_CONDITION_VARIABLE 0x0800 |
---|
49 | #define STATES_WAITING_FOR_RPC_REPLY 0x1000 |
---|
50 | #define STATES_WAITING_FOR_PERIOD 0x2000 |
---|
51 | |
---|
52 | #define STATES_LOCALLY_BLOCKED ( STATES_WAITING_FOR_BUFFER | \ |
---|
53 | STATES_WAITING_FOR_SEGMENT | \ |
---|
54 | STATES_WAITING_FOR_MESSAGE | \ |
---|
55 | STATES_WAITING_FOR_MUTEX | \ |
---|
56 | STATES_WAITING_FOR_CONDITION_VARIABLE | \ |
---|
57 | STATES_WAITING_FOR_SEMAPHORE ) |
---|
58 | |
---|
59 | #define STATES_WAITING_ON_THREAD_QUEUE \ |
---|
60 | ( STATES_LOCALLY_BLOCKED | \ |
---|
61 | STATES_WAITING_FOR_RPC_REPLY ) |
---|
62 | |
---|
63 | #define STATES_BLOCKED ( STATES_DELAYING | \ |
---|
64 | STATES_WAITING_FOR_TIME | \ |
---|
65 | STATES_WAITING_FOR_PERIOD | \ |
---|
66 | STATES_WAITING_FOR_EVENT | \ |
---|
67 | STATES_WAITING_ON_THREAD_QUEUE ) |
---|
68 | |
---|
69 | #ifndef __RTEMS_APPLICATION__ |
---|
70 | #include <rtems/score/states.inl> |
---|
71 | #endif |
---|
72 | |
---|
73 | #ifdef __cplusplus |
---|
74 | } |
---|
75 | #endif |
---|
76 | |
---|
77 | #endif |
---|
78 | /* end of include file */ |
---|