bfin: remove inline keyword
[xenomai-head.git] / include / vrtx / vrtx.h
blobc8b71461a3c120646cb40fb80923ed984510653e
1 /*
2 * Copyright (C) 2001,2002 IDEALX (http://www.idealx.com/).
3 * Written by Julien Pinon <jpinon@idealx.com>.
4 * Copyright (C) 2003 Philippe Gerum <rpm@xenomai.org>.
6 * Xenomai is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * Xenomai is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with Xenomai; if not, write to the Free Software Foundation,
18 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 #ifndef _XENO_VRTX_VRTX_H
22 #define _XENO_VRTX_VRTX_H
24 #include <nucleus/heap.h>
26 #define VRTX_SKIN_MAGIC 0x56525458
27 #define VRTX_SKIN_VERSION 6
29 #define TBSSUSP 0x0001
30 #define TBSMBOX 0x0002
31 #define TBSPUTC 0x0008
32 #define TBSDELAY 0x0020
33 #define TBSQUEUE 0x0040
34 #define TBSIDLE 0x0100
35 #define TBSFLAG 0x0200
36 #define TBSSEMA 0x0400
37 #define TBSMUTEX 0x0800
38 #define TBSADELAY 0x8000
40 #define RET_OK 0x00
41 #define ER_TID 0x01
42 #define ER_TCB 0x02
43 #define ER_MEM 0x03
44 #define ER_NMB 0x04
45 #define ER_MIU 0x05
46 #define ER_ZMW 0x06
47 #define ER_BUF 0x07
48 #define ER_TMO 0x0A
49 #define ER_NMP 0x0B
50 #define ER_QID 0x0C
51 #define ER_QFL 0x0D
52 #define ER_PID 0x0E
53 #define ER_IIP 0x12
54 #define ER_NOCB 0x30
55 #define ER_ID 0x31
56 #define ER_PND 0x32
57 #define ER_DEL 0x33
58 #define ER_OVF 0x34
60 #define seconds tv_sec
61 #define nanoseconds tv_nsec
63 typedef struct _TCB {
65 int TCBSTAT;
67 } TCB;
69 typedef struct _vrtx_hdesc {
70 int hid;
71 void *hcb;
72 size_t hsize;
73 unsigned long area;
74 } vrtx_hdesc_t;
76 typedef struct _vrtx_pdesc {
77 int pid;
78 void *ptcb;
79 size_t ptsize;
80 unsigned long area;
81 } vrtx_pdesc_t;
83 #if defined(__KERNEL__) || defined(__XENO_SIM__)
85 #ifdef __cplusplus
86 extern "C" {
87 #endif /* __cplusplus */
89 void ui_timer(void);
91 #ifdef __cplusplus
93 #endif /* __cplusplus */
95 #else /* !(__KERNEL__ || __XENO_SIM__) */
97 #include <vrtx/syscall.h>
99 #endif /* __KERNEL__ || __XENO_SIM__ */
102 * The following macros return normalized or native VRTX priority
103 * values. The core scheduler uses an ascending [0-257] priority scale
104 * (include/nucleus/sched.h), whilst the VRTX personality exhibits a
105 * decreasing scale [255-0]; normalization is done in the [1-256]
106 * range so that priority 0 is kept for non-realtime shadows.
108 #define vrtx_normalized_prio(prio) \
109 ({ int __p = (prio) ? XNSCHED_RT_MAX_PRIO - (prio) - 1 : 0; __p; })
110 #define vrtx_denormalized_prio(prio) \
111 ({ int __p = (prio) ? 256 - (prio) : 0; __p; })
113 #ifdef __cplusplus
114 extern "C" {
115 #endif /* __cplusplus */
117 void sc_putc(int c);
119 int sc_tecreate(void (*entry)(void *),
120 int tid,
121 int prio,
122 int mode,
123 unsigned long user,
124 unsigned long sys,
125 char *paddr,
126 unsigned long psize,
127 int *errp) __deprecated_in_kernel__;
129 int sc_tcreate(void (*entry)(void*),
130 int tid,
131 int prio,
132 int *errp) __deprecated_in_kernel__;
134 void sc_tdelete(int tid,
135 int opt,
136 int *errp);
138 TCB *sc_tinquiry(int pinfo[],
139 int tid,
140 int *errp);
142 void sc_tpriority(int tid,
143 int prio,
144 int *errp);
146 void sc_tresume(int tid,
147 int opt,
148 int *errp);
150 void sc_tslice(unsigned short ticks);
152 void sc_tsuspend(int tid,
153 int opt,
154 int *errp);
156 void sc_lock(void);
158 void sc_unlock(void);
160 int sc_mcreate(unsigned int opt,
161 int *errp);
163 void sc_maccept(int mid,
164 int *errp);
166 void sc_mdelete(int mid,
167 int opt, int *errp);
169 int sc_minquiry(int mid,
170 int *errp);
172 void sc_mpend(int mid,
173 unsigned long timeout,
174 int *errp);
176 void sc_mpost(int mid,
177 int *errp);
179 int sc_qcreate(int qid,
180 int qsize,
181 int *errp);
183 int sc_qecreate(int qid,
184 int qsize,
185 int opt,
186 int *errp);
188 void sc_qdelete(int qid,
189 int opt,
190 int *errp);
192 void sc_qjam(int qid,
193 char *msg,
194 int *errp);
196 void sc_qpost(int qid,
197 char *msg,
198 int *errp);
200 void sc_qbrdcst(int qid,
201 char *msg,
202 int *errp);
204 char *sc_qaccept(int qid,
205 int *errp);
207 char *sc_qinquiry(int qid,
208 int *countp,
209 int *errp);
211 char *sc_qpend(int qid,
212 long timeout,
213 int *errp);
215 void sc_post(char **mboxp,
216 char *msg,
217 int *errp);
219 char *sc_accept(char **mboxp,
220 int *errp);
222 char *sc_pend(char **mboxp,
223 long timeout,
224 int *errp);
226 int sc_fcreate(int *errp);
228 void sc_fdelete(int fid,
229 int opt,
230 int *errp);
232 void sc_fpost(int fid,
233 int mask,
234 int *errp);
236 int sc_fpend(int fid,
237 long timeout,
238 int mask,
239 int opt,
240 int *errp);
242 int sc_fclear(int fid,
243 int mask,
244 int *errp);
246 int sc_finquiry(int fid,
247 int *errp);
249 int sc_screate(unsigned initval,
250 int opt,
251 int *errp);
253 void sc_sdelete(int semid,
254 int opt,
255 int *errp);
257 void sc_spend(int semid,
258 long timeout,
259 int *errp);
261 void sc_saccept(int semid,
262 int *errp);
264 void sc_spost(int semid,
265 int *errp);
267 int sc_sinquiry(int semid,
268 int *errp);
270 int sc_pcreate(int pid,
271 char *paddr,
272 long psize,
273 long bsize,
274 int *errp);
276 void sc_pdelete(int tid,
277 int opt,
278 int *errp);
280 void sc_pextend(int pid,
281 char *eaddr,
282 long esize,
283 int *errp);
285 void sc_pinquiry(unsigned long info[3],
286 int pid,
287 int *errp);
289 char *sc_gblock(int pid,
290 int *errp);
292 void sc_rblock(int pid,
293 char *blockp,
294 int *errp);
296 int sc_hcreate(char *heapaddr,
297 unsigned long heapsize,
298 unsigned log2psize,
299 int *errp);
301 void sc_hdelete(int hid,
302 int opt,
303 int *errp);
305 char *sc_halloc(int hid,
306 unsigned long size,
307 int *errp);
309 void sc_hfree(int hid,
310 char *block,
311 int *errp);
313 void sc_hinquiry(int info[3],
314 int hid,
315 int *errp);
317 void sc_delay(long timeout);
319 void sc_adelay (struct timespec time,
320 int *errp);
322 void sc_stime(unsigned long ticks);
324 unsigned long sc_gtime(void);
326 void sc_gclock(struct timespec *timep,
327 unsigned long *nsp,
328 int *errp);
330 void sc_sclock(struct timespec time,
331 unsigned long ns,
332 int *errp);
334 int sc_gversion(void);
336 #ifdef __cplusplus
338 #endif /* __cplusplus */
340 #endif /* !_XENO_VRTX_VRTX_H */