Xenomai  3.0.5
thread.h
1 /*
2  * Copyright (C) 2013 Philippe Gerum <rpm@xenomai.org>.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
17  */
18 #ifndef _COBALT_UAPI_KERNEL_THREAD_H
19 #define _COBALT_UAPI_KERNEL_THREAD_H
20 
21 #include <cobalt/uapi/kernel/types.h>
22 
30 /* State flags (shared) */
31 
32 #define XNSUSP 0x00000001
33 #define XNPEND 0x00000002
34 #define XNDELAY 0x00000004
35 #define XNREADY 0x00000008
36 #define XNDORMANT 0x00000010
37 #define XNZOMBIE 0x00000020
38 #define XNMAPPED 0x00000040
39 #define XNRELAX 0x00000080
40 #define XNMIGRATE 0x00000100
41 #define XNHELD 0x00000200
42 #define XNBOOST 0x00000400
43 #define XNSSTEP 0x00000800
44 #define XNLOCK 0x00001000
45 #define XNRRB 0x00002000
46 #define XNWARN 0x00004000
47 #define XNFPU 0x00008000
48 #define XNROOT 0x00010000
49 #define XNWEAK 0x00020000
50 #define XNUSER 0x00040000
51 #define XNJOINED 0x00080000
52 #define XNTRAPLB 0x00100000
53 #define XNDEBUG 0x00200000
64 /* Information flags (shared) */
65 
66 #define XNTIMEO 0x00000001
67 #define XNRMID 0x00000002
68 #define XNBREAK 0x00000004
69 #define XNKICKED 0x00000008
70 #define XNWAKEN 0x00000010
71 #define XNROBBED 0x00000020
72 #define XNCANCELD 0x00000040
73 #define XNPIALERT 0x00000080
75 /* Local information flags (private to current thread) */
76 
77 #define XNMOVED 0x00000001
78 #define XNLBALERT 0x00000002
79 #define XNDESCENT 0x00000004
80 #define XNSYSRST 0x00000008
84 /*
85  * Must follow strictly the declaration order of the state flags
86  * defined above. Status symbols are defined as follows:
87  *
88  * 'S' -> Forcibly suspended.
89  * 'w'/'W' -> Waiting for a resource, with or without timeout.
90  * 'D' -> Delayed (without any other wait condition).
91  * 'R' -> Runnable.
92  * 'U' -> Unstarted or dormant.
93  * 'X' -> Relaxed shadow.
94  * 'H' -> Held in emergency.
95  * 'b' -> Priority boost undergoing.
96  * 'T' -> Ptraced and stopped.
97  * 'l' -> Locks scheduler.
98  * 'r' -> Undergoes round-robin.
99  * 't' -> Runtime mode errors notified.
100  * 'L' -> Lock breaks trapped.
101  */
102 #define XNTHREAD_STATE_LABELS "SWDRU..X.HbTlrt.....L."
103 
104 struct xnthread_user_window {
105  __u32 state;
106  __u32 info;
107  __u32 grant_value;
108 };
109 
110 #endif /* !_COBALT_UAPI_KERNEL_THREAD_H */