24 #ifndef _XENOMAI_PSOS_PSOS_H
25 #define _XENOMAI_PSOS_PSOS_H
27 #include <sys/types.h>
33 #define T_NOPREEMPT 0x0001
34 #define T_PREEMPT 0x0000
35 #define T_TSLICE 0x0002
36 #define T_NOTSLICE 0x0000
37 #define T_NOASR 0x0004
41 #define T_LEVELMASK0 0x0000
42 #define T_LEVELMASK1 0x0100
43 #define T_LEVELMASK2 0x0200
44 #define T_LEVELMASK3 0x0300
45 #define T_LEVELMASK4 0x0400
46 #define T_LEVELMASK5 0x0500
47 #define T_LEVELMASK6 0x0600
48 #define T_LEVELMASK7 0x0700
49 #define T_NOISR 0x0700
51 #define T_GLOBAL 0x0001
52 #define T_LOCAL 0x0000
53 #define T_NOFPU 0x0000
56 #define RN_PRIOR 0x0002
57 #define RN_FIFO 0x0000
59 #define RN_NODEL 0x0000
60 #define RN_NOWAIT 0x0001
61 #define RN_WAIT 0x0000
63 #define SM_GLOBAL 0x0001
64 #define SM_LOCAL 0x0000
65 #define SM_PRIOR 0x0002
66 #define SM_FIFO 0x0000
67 #define SM_NOWAIT 0x0001
68 #define SM_WAIT 0x0000
70 #define EV_NOWAIT 0x0001
71 #define EV_WAIT 0x0000
75 #define K_GLOBAL 0x0001
76 #define K_LOCAL 0x0000
78 #define PT_GLOBAL 0x0001
79 #define PT_LOCAL 0x0000
81 #define PT_NODEL 0x0000
83 #define Q_GLOBAL 0x0001
84 #define Q_LOCAL 0x0000
85 #define Q_PRIOR 0x0002
87 #define Q_LIMIT 0x0004
88 #define Q_NOLIMIT 0x0000
89 #define Q_PRIBUF 0x0008
90 #define Q_SYSBUF 0x0000
91 #define Q_NOWAIT 0x0001
94 #define ERR_TIMEOUT 0x01
96 #define ERR_NODENO 0x04
97 #define ERR_OBJDEL 0x05
98 #define ERR_OBJID 0x06
99 #define ERR_OBJTYPE 0x07
100 #define ERR_OBJTFULL 0x08
101 #define ERR_OBJNF 0x09
103 #define ERR_NOTCB 0x0E
104 #define ERR_NOSTK 0x0F
105 #define ERR_TINYSTK 0x10
106 #define ERR_PRIOR 0x11
107 #define ERR_ACTIVE 0x12
108 #define ERR_NACTIVE 0x13
109 #define ERR_SUSP 0x14
110 #define ERR_NOTSUSP 0x15
111 #define ERR_SETPRI 0x16
112 #define ERR_REGNUM 0x17
114 #define ERR_RNADDR 0x1B
115 #define ERR_UNITSIZE 0x1C
116 #define ERR_TINYUNIT 0x1D
117 #define ERR_TINYRN 0x1E
118 #define ERR_SEGINUSE 0x1F
119 #define ERR_TOOBIG 0x21
120 #define ERR_NOSEG 0x22
121 #define ERR_NOTINRN 0x23
122 #define ERR_SEGADDR 0x24
123 #define ERR_SEGFREE 0x25
124 #define ERR_RNKILLD 0x26
125 #define ERR_TATRNDEL 0x27
127 #define ERR_PTADDR 0x28
128 #define ERR_BUFSIZE 0x29
129 #define ERR_TINYPT 0x2A
130 #define ERR_BUFINUSE 0x2B
131 #define ERR_NOBUF 0x2C
132 #define ERR_BUFADDR 0x2D
133 #define ERR_BUFFREE 0x2F
135 #define ERR_MSGSIZ 0x31
136 #define ERR_BUFSIZ 0x32
137 #define ERR_NOQCB 0x33
138 #define ERR_NOMGB 0x34
139 #define ERR_QFULL 0x35
140 #define ERR_QKILLD 0x36
141 #define ERR_NOMSG 0x37
142 #define ERR_TATQDEL 0x38
143 #define ERR_MATQDEL 0x39
144 #define ERR_VARQ 0x3A
145 #define ERR_NOTVARQ 0x3B
147 #define ERR_NOEVS 0x3C
148 #define ERR_NOTINASR 0x3E
149 #define ERR_NOASR 0x3F
151 #define ERR_NOSCB 0x41
152 #define ERR_NOSEM 0x42
153 #define ERR_SKILLD 0x43
154 #define ERR_TATSDEL 0x44
156 #define ERR_NOTIME 0x47
157 #define ERR_ILLDATE 0x48
158 #define ERR_ILLTIME 0x49
159 #define ERR_ILLTICKS 0x4A
160 #define ERR_NOTIMERS 0x4B
161 #define ERR_BADTMID 0x4C
162 #define ERR_TMNOTSET 0x4D
163 #define ERR_TOOLATE 0x4E
169 u_long ev_receive(u_long events,
174 u_long ev_send(u_long tid,
177 u_long pt_create(
const char *name,
186 u_long pt_delete(u_long tid);
188 u_long pt_getbuf(u_long tid,
191 u_long pt_ident(
const char *name,
195 u_long pt_retbuf(u_long tid,
198 u_long q_broadcast(u_long qid,
202 u_long q_create(
const char *name,
207 u_long q_delete(u_long qid);
209 u_long q_ident(
const char *name,
213 u_long q_receive(u_long qid,
218 u_long q_send(u_long qid,
221 u_long q_urgent(u_long qid,
224 u_long q_vcreate(
const char *name,
230 u_long q_vdelete(u_long qid);
232 u_long q_vident(
const char *name,
236 u_long q_vreceive(u_long qid,
243 u_long q_vsend(u_long qid,
247 u_long q_vurgent(u_long qid,
251 u_long q_vbroadcast(u_long qid,
256 u_long rn_create(
const char *name,
264 u_long rn_delete(u_long rnid);
266 u_long rn_getseg(u_long rnid,
272 u_long rn_ident(
const char *name,
275 u_long rn_retseg(u_long rnid,
278 u_long sm_create(
const char *name,
283 u_long sm_delete(u_long smid);
285 u_long sm_ident(
const char *name,
289 u_long sm_p(u_long smid,
293 u_long sm_v(u_long smid);
295 u_long t_create(
const char *name,
302 u_long t_delete(u_long tid);
304 u_long t_getreg(u_long tid,
308 u_long t_ident(
const char *name,
312 u_long t_mode(u_long mask,
316 u_long t_resume(u_long tid);
318 u_long t_setpri(u_long tid,
322 u_long t_setreg(u_long tid,
326 u_long t_start(u_long tid,
328 void (*entry)(u_long a0,
334 u_long t_suspend(u_long tid);
336 u_long tm_cancel(u_long tmid);
338 u_long tm_evafter(u_long ticks,
342 u_long tm_evevery(u_long ticks,
346 u_long tm_evwhen(u_long date,
352 u_long tm_get(u_long *date_r,
356 u_long tm_set(u_long date,
360 u_long tm_getm(
unsigned long long *ns);
362 u_long tm_wkafter(u_long ticks);
364 u_long tm_wkwhen(u_long date,
368 int psos_task_normalize_priority(u_long psos_prio);
370 u_long psos_task_denormalize_priority(
int core_prio);