1 // -----------------------------------------------------------------------
\r
2 // Copyright (C) 2006 - 2007 by the FRESCOR consortium:
\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
11 // Thales Communication S.A. FRANCE
\r
12 // Visual Tools S.A. SPAIN
\r
13 // Rapita Systems Ltd UK
\r
16 // See http://www.frescor.org
\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
23 // All rights reserved.
\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
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
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
67 // FOSA(Frescor Operating System Adaptation layer)
\r
68 //================================================
\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
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
78 #ifndef FOSA_OSE_SIGNALS_SIG
\r
79 #define FOSA_OSE_SIGNALS_SIG
\r
83 //used for debugging.
\r
84 //#include "stdio.h"
\r
87 * @defgroup fosa_ose OSE implementation of fosa
\r
90 * This module defines the fosa functions and types for OSE.
\r
95 /*************************
\r
96 * Decalaration of OSE signals.
\r
97 *************************/
\r
102 * General signal type used of fosa.
\r
106 frsh_signal_info_t info;
\r
107 } fosa_ose_signal_t;
\r
112 * Signal number used when a new process are created. Specially when the
\r
113 * scheduler are created.
\r
115 #define FOSA_OSE_STARTUP_SIGNAL 256
\r
120 * Signal used when a new process is crated. To pass information about
\r
121 * the POSIX like entrypoint.
\r
125 frsh_thread_code_t code;
\r
127 } fosa_ose_signal_startup_t;
\r
133 * Signal used when starting the fosa scheduler process. This information
\r
134 * need to be passed to the newly created process.
\r
138 fosa_ads_scheduler_ops_t scheduler_ops;
\r
139 size_t scheduler_data_size;
\r
141 size_t init_args_size;
\r
142 } fosa_ose_scheduler_startup_t;
\r
148 * Signal used when asking the scheduler if a new thread can be created.
\r
153 } fosa_ose_new_thread_t;
\r
158 * Signal used when signalling for scheduling events.
\r
163 } fosa_ose_event_signal_t;
\r
168 * Signal number used when signaling condition variables.
\r
170 #define FOSA_OSE_CONDVAR_SIGNAL 257
\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
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
192 * Signal numbers used when signaling callbacks from OSE to scheduler.
\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
204 #define FOSA_OSE_REJECT 10
\r
205 #define FOSA_OSE_ACCEPT 11
\r
207 #endif /* FOSA_OSE_SIGNALS_SIG */
\r