Xenomai  3.1
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
54 #define XNDBGSTOP 0x00400000
65 /* Information flags (shared) */
66 
67 #define XNTIMEO 0x00000001
68 #define XNRMID 0x00000002
69 #define XNBREAK 0x00000004
70 #define XNKICKED 0x00000008
71 #define XNWAKEN 0x00000010
72 #define XNROBBED 0x00000020
73 #define XNCANCELD 0x00000040
74 #define XNPIALERT 0x00000080
75 #define XNSCHEDP 0x00000100
76 #define XNCONTHI 0x00000200
78 /* Local information flags (private to current thread) */
79 
80 #define XNMOVED 0x00000001
81 #define XNLBALERT 0x00000002
82 #define XNDESCENT 0x00000004
83 #define XNSYSRST 0x00000008
84 #define XNHICCUP 0x00000010
88 /*
89  * Must follow strictly the declaration order of the state flags
90  * defined above. Status symbols are defined as follows:
91  *
92  * 'S' -> Forcibly suspended.
93  * 'w'/'W' -> Waiting for a resource, with or without timeout.
94  * 'D' -> Delayed (without any other wait condition).
95  * 'R' -> Runnable.
96  * 'U' -> Unstarted or dormant.
97  * 'X' -> Relaxed shadow.
98  * 'H' -> Held in emergency.
99  * 'b' -> Priority boost undergoing.
100  * 'T' -> Ptraced and stopped.
101  * 'l' -> Locks scheduler.
102  * 'r' -> Undergoes round-robin.
103  * 't' -> Runtime mode errors notified.
104  * 'L' -> Lock breaks trapped.
105  * 's' -> Ptraced, stopped synchronously.
106  */
107 #define XNTHREAD_STATE_LABELS "SWDRU..X.HbTlrt.....L.s"
108 
109 struct xnthread_user_window {
110  __u32 state;
111  __u32 info;
112  __u32 grant_value;
113  __u32 pp_pending;
114 };
115 
116 #endif /* !_COBALT_UAPI_KERNEL_THREAD_H */