]> rtime.felk.cvut.cz Git - frescor/fosa.git/blob - include/fosa_opaque_types.h
e44b8ce2e8314ae43ee276969f53d55f7577d659
[frescor/fosa.git] / include / fosa_opaque_types.h
1 // -----------------------------------------------------------------------
2 //  Copyright (C) 2006 - 2007 FRESCOR consortium partners:
3 //
4 //    Universidad de Cantabria,              SPAIN
5 //    University of York,                    UK
6 //    Scuola Superiore Sant'Anna,            ITALY
7 //    Kaiserslautern University,             GERMANY
8 //    Univ. Politecnica  Valencia,           SPAIN
9 //    Czech Technical University in Prague,  CZECH REPUBLIC
10 //    ENEA                                   SWEDEN
11 //    Thales Communication S.A.              FRANCE
12 //    Visual Tools S.A.                      SPAIN
13 //    Rapita Systems Ltd                     UK
14 //    Evidence                               ITALY
15 //
16 //    See http://www.frescor.org for a link to partners' websites
17 //
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
21 //        made of this code.
22 //
23 //  This file is part of the FRSH implementation
24 //
25 //  FRSH is free software; you can  redistribute it and/or  modify
26 //  it under the terms of  the GNU General Public License as published by
27 //  the Free Software Foundation;  either  version 2, or (at  your option)
28 //  any later version.
29 //
30 //  FRSH  is distributed  in  the hope  that  it  will  be useful,  but
31 //  WITHOUT  ANY  WARRANTY;     without  even the   implied   warranty  of
32 //  MERCHANTABILITY  or  FITNESS FOR  A  PARTICULAR PURPOSE. See  the  GNU
33 //  General Public License for more details.
34 //
35 //  You should have  received a  copy of  the  GNU  General Public License
36 //  distributed  with  FRSH;  see file COPYING.   If not,  write to the
37 //  Free Software  Foundation,  59 Temple Place  -  Suite 330,  Boston, MA
38 //  02111-1307, USA.
39 //
40 //  As a special exception, if you include this header file into source
41 //  files to be compiled, this header file does not by itself cause
42 //  the resulting executable to be covered by the GNU General Public
43 //  License.  This exception does not however invalidate any other
44 //  reasons why the executable file might be covered by the GNU General
45 //  Public License.
46 // -----------------------------------------------------------------------
47 //fosa_opaque_types.h
48 //==============================================
49 //  ********  ******    ********  **********
50 //  **///// /**    **  **//////  /**     /**
51 //  **      /**    ** /**        /**     /**
52 //  ******* /**    ** /********* /**********
53 //  **////  /**    ** ////////** /**//////**
54 //  **      /**    **        /** /**     /**
55 //  **      /**    **  ********  /**     /**
56 //  //       /******/  ////////   //      //
57 //
58 // FOSA(Frescor Operating System Adaptation layer)
59 //================================================
60
61 // Implementation dependent definitions
62
63 #ifndef _FOSA_OPAQUE_TYPES_H_
64 #define _FOSA_OPAQUE_TYPES_H_
65
66 #include <stdbool.h>
67
68 /////////////////////// RT_LINUX, MARTE_OS & AQuoSA ///////////////////////////
69
70 #if defined(RT_LINUX) || defined(MARTE_OS) || defined(AQuoSA)
71
72 #include <pthread.h>
73 #include <signal.h>
74 #include <time.h>
75 #include <sched.h>
76
77 #ifdef RT_LINUX
78 #include <rtl_timer.h>
79 #endif
80
81 #define    FOSA_CLOCK_ID_T_OPAQUE    clockid_t
82 #define    FOSA_SYSTEM_CLOCK_OPAQUE  CLOCK_MONOTONIC
83
84 #define    FOSA_TIMER_ID_T_OPAQUE    timer_t
85
86 #define    FOSA_COND_T_OPAQUE        pthread_cond_t
87
88 /*********
89  *  ADS
90  *********/
91
92 #ifdef MARTE_OS
93 typedef struct {
94     posix_appsched_actions_t actions;
95     struct timespec * timeout_ptr;
96     struct timespec timeout;
97     bool rejected;
98     bool suspended;
99     bool activated;
100 } fosa_ads_actions_internal_t;
101
102
103 #define FOSA_ADS_ACTIONS_T_OPAQUE fosa_ads_actions_internal_t
104 #else
105
106 /* hack to get AQuoSA sources compile without having none
107  * of the application level scheduler header files and symbols */
108 #ifdef AQuoSA
109 #define posix_appsched_actions_t int
110 #endif
111
112 #define FOSA_ADS_ACTIONS_T_OPAQUE posix_appsched_actions_t
113 #endif
114
115
116 #endif
117
118 ////////////////// END OF RT_LINUX, MARTE_OS and AQuoSA //////////////////////
119
120
121 ////////////////////////// DUMMY_OS    //////////////////////////////////////
122
123 #if defined(DUMMY_OS)
124
125 /* With this define we make sure that we are truly POSIX and OSE */
126 /* independent at the FRSH code.                                 */
127 /*****************************************************************/
128
129 #define    FOSA_CLOCK_ID_T_OPAQUE    int
130 #define    FOSA_SYSTEM_CLOCK_OPAQUE  42
131
132 #define    FOSA_TIMER_ID_T_OPAQUE    int
133
134 #define    FOSA_COND_T_OPAQUE        int
135
136 /*********
137  *  ADS
138  *********/
139
140 #define FOSA_ADS_ACTIONS_T_OPAQUE  int
141
142
143
144
145 #endif /* DUMMY */
146 //////////////////////////End of DUMMY_OS ////////////////////////////////////
147
148
149
150
151 #endif // _FOSA_OPAQUE_TYPES_H_