1 // -----------------------------------------------------------------------
2 // Copyright (C) 2006 - 2007 FRESCOR consortium partners:
4 // Universidad de Cantabria, SPAIN
5 // University of York, UK
6 // Scuola Superiore Sant'Anna, ITALY
7 // Kaiserslautern University, GERMANY
8 // Univ. Politécnica Valencia, SPAIN
9 // Czech Technical University in Prague, CZECH REPUBLIC
11 // Thales Communication S.A. FRANCE
12 // Visual Tools S.A. SPAIN
13 // Rapita Systems Ltd UK
16 // See http://www.frescor.org for a link to partners' websites
18 // FRESCOR project (FP6/2005/IST/5-034026) is funded
19 // in part by the European Union Sixth Framework Programme
20 // The European Union is not liable of any use that may be
24 // based on previous work (FSF) done in the FIRST project
26 // Copyright (C) 2005 Mälardalen University, SWEDEN
27 // Scuola Superiore S.Anna, ITALY
28 // Universidad de Cantabria, SPAIN
29 // University of York, UK
31 // FSF API web pages: http://marte.unican.es/fsf/docs
32 // http://shark.sssup.it/contrib/first/docs/
34 // This file is part of FRSH API
36 // FRSH API is free software; you can redistribute it and/or modify
37 // it under the terms of the GNU General Public License as published by
38 // the Free Software Foundation; either version 2, or (at your option)
41 // FRSH API is distributed in the hope that it will be useful, but
42 // WITHOUT ANY WARRANTY; without even the implied warranty of
43 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
44 // General Public License for more details.
46 // You should have received a copy of the GNU General Public License
47 // distributed with FRSH API; see file COPYING. If not, write to the
48 // Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
51 // As a special exception, if you include this header file into source
52 // files to be compiled, this header file does not by itself cause
53 // the resulting executable to be covered by the GNU General Public
54 // License. This exception does not however invalidate any other
55 // reasons why the executable file might be covered by the GNU General
57 // -----------------------------------------------------------------------
59 //========================================================================================
60 // ******** ******* ******** ** ** ******** ****** ******** **********
61 // **///// /**////** **////// /** /** **///// /** ** **////// /** /**
62 // ** /** /** /** /** /** ** /** ** /** /** /**
63 // ******* /******* /********* /********** ******* /** ** /********* /**********
64 // **//// /**///** ////////** /**//////** **//// /** ** ////////** /**//////**
65 // ** /** //** /** /** /** ** /** ** /** /** /**
66 // ** /** //** ******** /** /** ** /** ** ******** /** /**
67 // // // // //////// // // // /******/ //////// // //
69 // FRSH(FRescor ScHeduler), pronounced "fresh" FOSA(Frescor Oper System Adaptation layer)
70 //========================================================================================
72 #ifndef FRSH_FOSA_OPAQUE_H_
73 #define FRSH_FOSA_OPAQUE_H_
76 * @file frsh_fosa_opaque.h
81 * \addtogroup frshfosa
87 /////////////////////MaRTE OS, RT_LINUX & AQuoSA //////////////////////
89 #if defined(MARTE_OS) || defined(RT_LINUX) || defined(AQuoSA)
100 pthread_t pthread_id;
103 } FOSA_THREAD_ID_T_OPAQUE;
105 #else /* !AQuoSA, MARTE_OS, RT_LINUX */
107 typedef pthread_t FOSA_THREAD_ID_T_OPAQUE;
111 typedef pthread_attr_t FOSA_THREAD_ATTR_T_OPAQUE;
113 typedef int FOSA_SIGNAL_T_OPAQUE;
116 typedef pthread_mutex_t FOSA_MUTEX_T_OPAQUE;
118 // The minimum and maximum signal numbers that may be used by the FRSH
120 #define FOSA_SIGNAL_MIN SIGRTMIN
121 #define FOSA_SIGNAL_MAX SIGRTMIN+0
123 #define FOSA_NULL_SIGNAL 0
127 /* #include <error.h> */
129 /** Not enough memory available **/
130 #define FOSA_ENOMEM ENOMEM
132 /** Invalid parameter **/
133 #define FOSA_EINVAL EINVAL
135 /** Still pending information **/
136 #define FOSA_EAGAIN EAGAIN
138 /** FOSA ADS errors **/
139 #define FOSA_EREJECT EREJECT
140 #define FOSA_EMASKED -2
141 #define FOSA_EPOLICY -3
145 #endif /* MARTE_OS || RT_LINUX || AQuoSA */
147 //////////////////End of MaRTE OS, RT_LINUX & AQuoSA ///////////////////
149 ////////////////////////// VIRTUAL TIME //////////////////////////////////////
151 #if defined(VIRTUAL_TIME)
155 #define FOSA_THREAD_ID_T_OPAQUE vt_posix_process_t
157 #define FOSA_THREAD_ATTR_T_OPAQUE fosa_thread_attr_t
159 #define FOSA_SIGNAL_T_OPAQUE int
161 #define FOSA_MUTEX_T_OPAQUE fosa_mutex_t
163 // The minimum and maximum signal numbers that may be used by the FRSH
165 #define FOSA_SIGNAL_MIN 8
166 #define FOSA_SIGNAL_MAX 31
168 // the min. and max. priority a fosa thread can have
169 #define FOSA_PRIORITY_MAX VT_PRIORITY_MIN - 1
170 #define FOSA_PRIORITY_MIN VT_PRIORITY_MAX
172 #define FOSA_NULL_SIGNAL 0
174 /* FOSA Errors and return values*/
176 /** Invalid parameter **/
177 #define FOSA_EINVAL -1
179 /** Not enough memory available **/
180 #define FOSA_ENOMEM -2
182 /** Still pending information **/
183 #define FOSA_EAGAIN -3
185 /** Mutex not available **/
186 #define FOSA_EBUSY -4
188 /** Cond var timedout **/
189 #define FOSA_ETIMEDOUT -5
191 /** FOSA ADS errors **/
192 #define FOSA_EREJECT -6
193 #define FOSA_EMASKED -7
196 /** Sched policy not correct */
197 #define FOSA_EPOLICY -8
199 /** the value given by thread_id is not valid for ADS */
200 #define FOSA_ESRCH -9
202 /** retval if no action performed **/
203 #define FOSA_NO_ACTION 0
205 #endif /* VIRTUAL_TIME */
206 //////////////////////////End of VIRTUAL TIME ///////////////////////////////////
208 ////////////////////////// OSE //////////////////////////////////////
212 /* Put OSE dependent includes and defines here */
215 //////////////////////////End of OSE ////////////////////////////////////
217 ////////////////////////// DUMMY_OS //////////////////////////////////////
219 #if defined(DUMMY_OS)
221 /* With this define we make sure that we are truly POSIX and OSE */
222 /* independent at the FRSH code. */
223 /*****************************************************************/
225 #define FOSA_THREAD_ID_T_OPAQUE int
227 #define FOSA_THREAD_ATTR_T_OPAQUE int
229 #define FOSA_SIGNAL_T_OPAQUE int
231 #define FRSH_SIGNAL_INFO_T_OPAQUE int
233 #define FOSA_MUTEX_T_OPAQUE int
235 // The minimum and maximum signal numbers that may be used by the FRSH
237 #define FOSA_SIGNAL_MIN 42
238 #define FOSA_SIGNAL_MAX 42
240 #define FOSA_NULL_SIGNAL 0
244 /* #include <error.h> */
246 /** Not enough memory available **/
247 #define FOSA_ENOMEM -1
249 /** Invalid parameter **/
250 #define FOSA_EINVAL -2
252 /** Still pending information **/
253 #define FOSA_EAGAIN -3
255 /** FOSA ADS errors **/
256 #define FOSA_EREJECT -4
257 #define FOSA_EMASKED -5
259 #define FOSA_EPOLICY -6
262 //////////////////////////End of DUMMY_OS ////////////////////////////////////
269 #endif /* !FRSH_FOSA_OPAQUE_H_ */