]> rtime.felk.cvut.cz Git - frescor/fosa.git/blob - src_ose/fosa_ose_signals.sig
Adding FOSA thread groups
[frescor/fosa.git] / src_ose / fosa_ose_signals.sig
1 // -----------------------------------------------------------------------\r
2 //  Copyright (C) 2006 - 2007 by the FRESCOR consortium:\r
3 //\r
4 //    Universidad de Cantabria,              SPAIN\r
5 //    University of York,                    UK\r
6 //    Scuola Superiore Sant'Anna,            ITALY\r
7 //    Kaiserslautern University,             GERMANY\r
8 //    Univ. Politecnica  Valencia,           SPAIN\r
9 //    Czech Technical University in Prague,  CZECH REPUBLIC\r
10 //    ENEA                                   SWEDEN\r
11 //    Thales Communication S.A.              FRANCE\r
12 //    Visual Tools S.A.                      SPAIN\r
13 //    Rapita Systems Ltd                     UK\r
14 //    Evidence                               ITALY\r
15 //\r
16 //    See http://www.frescor.org\r
17 //\r
18 //        The FRESCOR project (FP6/2005/IST/5-034026) is funded\r
19 //        in part by the European Union Sixth Framework Programme\r
20 //        The European Union is not liable of any use that may be\r
21 //        made of this code.\r
22 //\r
23 //  All rights reserved.\r
24 //\r
25 //  Redistribution and use in source and binary forms, with or \r
26 //  without modification, are permitted provided that the \r
27 //  following conditions are met:\r
28 //\r
29 //    * Redistributions of source code must retain the above \r
30 //      copyright notice, this list of conditions and the \r
31 //      following disclaimer.\r
32 //    * Redistributions in binary form must reproduce the above \r
33 //      copyright notice, this list of conditions and the \r
34 //      following disclaimer in the documentation and/or other \r
35 //      materials provided with the distribution.\r
36 //    * Neither the name of FRESCOR nor the names of its \r
37 //      contributors may be used to endorse or promote products \r
38 //      derived from this software without specific prior \r
39 //      written permission.\r
40 //\r
41 //  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND \r
42 //  CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, \r
43 //  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF \r
44 //  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE \r
45 //  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR \r
46 //  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, \r
47 //  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES \r
48 //  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE \r
49 //  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR \r
50 //  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF \r
51 //  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \r
52 //  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT \r
53 //  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \r
54 //  POSSIBILITY OF SUCH DAMAGE.\r
55 // -----------------------------------------------------------------------\r
56 //fosa_ose_signals.h\r
57 //==============================================\r
58 //  ********  ******    ********  **********\r
59 //  **///// /**    **  **//////  /**     /**\r
60 //  **      /**    ** /**        /**     /**\r
61 //  ******* /**    ** /********* /**********\r
62 //  **////  /**    ** ////////** /**//////**\r
63 //  **      /**    **        /** /**     /**\r
64 //  **      /**    **  ********  /**     /**\r
65 //  //       /******/  ////////   //      // \r
66 //\r
67 // FOSA(Frescor Operating System Adaptation layer)\r
68 //================================================\r
69 \r
70 /*\r
71  * Intended to be used only by fosa_ose_implementation_specific.h. \r
72  * Declared like this to use the OSE way of signal declarations.\r
73  * \r
74  * It is not used by any .h file apart from that one to avoid include \r
75  * deadlocks and it is neither not accessible to any API client.\r
76  */\r
77 \r
78 #ifndef     FOSA_OSE_SIGNALS_SIG\r
79 #define     FOSA_OSE_SIGNALS_SIG\r
80 \r
81 #include "ose.h"\r
82 \r
83 //used for debugging.\r
84 //#include "stdio.h"\r
85 \r
86 /**\r
87  * @defgroup fosa_ose OSE implementation of fosa\r
88  * @ingroup fosa\r
89  *\r
90  * This module defines the fosa functions and types for OSE.\r
91  *\r
92  * @{\r
93  **/\r
94 \r
95 /*************************\r
96  * Decalaration of OSE signals.\r
97  *************************/ \r
98 \r
99 /*\r
100  * author erth\r
101  *\r
102  * General signal type used of fosa.\r
103  */\r
104 typedef struct {\r
105     SIGSELECT          sig_no;\r
106     frsh_signal_info_t info;\r
107 } fosa_ose_signal_t;\r
108 \r
109 /*\r
110  * author erth\r
111  *\r
112  * Signal number used when a new process are created. Specially when the \r
113  * scheduler are created.\r
114  */\r
115 #define FOSA_OSE_STARTUP_SIGNAL 256\r
116 \r
117 /*\r
118  * author erth\r
119  *\r
120  * Signal used when a new process is crated. To pass information about\r
121  * the POSIX like entrypoint. \r
122  */\r
123 typedef struct {\r
124     SIGSELECT sig_no;\r
125     frsh_thread_code_t code;\r
126     void * arg;\r
127 } fosa_ose_signal_startup_t;\r
128 \r
129 \r
130 /*\r
131  * author erth\r
132  *\r
133  * Signal used when starting the fosa scheduler process. This information\r
134  * need to be passed to the newly created process.\r
135  */\r
136 typedef struct {\r
137     SIGSELECT                   sig_no;\r
138     fosa_ads_scheduler_ops_t    scheduler_ops; \r
139     size_t                      scheduler_data_size;\r
140     void *                      init_args;\r
141     size_t                      init_args_size;\r
142 } fosa_ose_scheduler_startup_t;\r
143 \r
144 \r
145 /*\r
146  * author erth\r
147  *\r
148  * Signal used when asking the scheduler if a new thread can be created.\r
149  */\r
150 typedef struct {\r
151     SIGSELECT                   sig_no;\r
152     PROCESS                     tid; \r
153 } fosa_ose_new_thread_t;\r
154 \r
155 /*\r
156  * author erth\r
157  *\r
158  * Signal used when signalling for scheduling events.\r
159  */\r
160 typedef struct {\r
161     SIGSELECT                   sig_no;\r
162     PROCESS                     pid; \r
163 } fosa_ose_event_signal_t;\r
164 \r
165 /*\r
166  * author erth\r
167  *\r
168  * Signal number used when signaling condition variables.\r
169  */\r
170 #define FOSA_OSE_CONDVAR_SIGNAL 257\r
171 \r
172 /*\r
173  * author erth\r
174  *\r
175  * Signal types ar declared here to contain the following parameters. A \r
176  * union SIGNAL declaration must include a signal number and the signal\r
177  * structures of the signals that will be used by the program.\r
178  */\r
179 union SIGNAL\r
180 {\r
181     SIGSELECT                       sig_no;\r
182     fosa_ose_signal_t               fosa_ose_signal;\r
183     fosa_ose_signal_startup_t       fosa_ose_signal_startup;\r
184     fosa_ose_new_thread_t           fosa_ose_new_thread;\r
185     fosa_ose_scheduler_startup_t    fosa_ose_scheduler_startup;\r
186     fosa_ose_event_signal_t         fosa_ose_event_signal;\r
187 };\r
188 \r
189 /*\r
190  * author erth\r
191  *\r
192  * Signal numbers used when signaling callbacks from OSE to scheduler.\r
193  */\r
194 #define FOSA_OSE_BLOCK_SIGNAL           1\r
195 #define FOSA_OSE_TERMINATE_SIGNAL       2\r
196 #define FOSA_OSE_SIGNAL_SCHED_SIGNAL    3\r
197 #define FOSA_OSE_READY_SIGNAL           4\r
198 #define FOSA_OSE_TEST_EVENT_SIGNAL      5\r
199 #define FOSA_OSE_SHUTDOWN_FRSH          6\r
200 #define FOSA_OSE_NEW_THREAD_SIGNAL      7\r
201 #define FOSA_OSE_INIT_SIGNAL            8\r
202 #define FOSA_OSE_EMPTY                  9\r
203 \r
204 #define FOSA_OSE_REJECT                 10\r
205 #define FOSA_OSE_ACCEPT                 11\r
206 \r
207 #endif /*  FOSA_OSE_SIGNALS_SIG */\r