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 // -----------------------------------------------------------------------
58 //frsh_configuration_parameters.h
59 //==============================================
60 // ******** ******* ******** ** **
61 // **///// /**////** **////// /** /**
62 // ** /** /** /** /** /**
63 // ******* /******* /********* /**********
64 // **//// /**///** ////////** /**//////**
65 // ** /** //** /** /** /**
66 // ** /** //** ******** /** /**
67 // // // // //////// // //
69 // FRSH(FRescor ScHeduler), pronounced "fresh"
70 //==============================================
71 #ifndef _FRSH_CONFIGURATION_PARAMETERS_H_
72 #define _FRSH_CONFIGURATION_PARAMETERS_H_
77 * @defgroup config Configuration Parameters
79 * Here we define global parameters that will have an important
80 * influence on FRSH behaviour. They must also be coherent with the
81 * respective values in the underlaying OS.
88 * This symbol specifies whether the scheduler will make a
89 * schedulability test of the requested contract or not
91 #define FRSH_ADMISSION_TEST_IS_ENABLED true
95 * @defgroup internal lists size for memory optimization
98 * Tune these values for optimizing the amount of memory used by the
104 /** Maximum number of accepted contracts (servers) **/
105 #define FRSH_MAX_N_SERVERS 125
108 /** Maximum number of threads that may be scheduled by the framework **/
109 #define FRSH_MAX_N_THREADS 25
113 * Maximum number of critical sections that can be stored in a
114 * contract parameters object
116 #define FRSH_MAX_N_CRITICAL_SECTIONS 25
120 * Maximum number of utilization values (pairs of budget and period)
121 * that can be stored in a contract parameters object
123 #define FRSH_MAX_N_UTILIZATION_VALUES 5
127 * Maximum number of synchronization objects
129 #define FRSH_MAX_N_SYNCH_OBJECTS 5
132 /** Maximum number of shared objects **/
133 #define FRSH_MAX_N_SHARED_OBJECTS 100
138 * @defgroup schedandservice Scheduler and Service thread parameters
141 * The current implementation in MaRTE OS uses the Application-Defined
142 * Scheduling Interface (proposed to the POSIX standardization
143 * committee), to create a fixed-priority-based scheduler that
144 * operates under the rules of the FIRST scheduling framework.
146 * In this implementation there are two special threads:
147 * - The application scheduler thread, that
148 * implements the scheduler
150 * - The service thread, that is in charge of
151 * negotiating and renegotiating contracts
152 * concurrently with the application
154 * The following symbols are necessary to adapt the application to the
155 * underlying fixed priority scheduler
161 * Priority assigned to the application scheduler; it should be above
162 * the priorities of the application threads and of the service
163 * thread, and it should be at least 1 level below the maximum of the
166 #define FRSH_SCHEDULER_PRIORITY 29 //104
169 * Real-time signal number reserved for the application scheduler to
172 #define FRSH_SCHEDULER_SIGNAL SIGRTMIN
176 * The highest priority that can be assigned to an application thread,
177 * it should be defined as one level less than the
178 * FRSH_SCHEDULER_PRIORITY
180 #define FRSH_HIGHEST_THREAD_PRIORITY FRSH_SCHEDULER_PRIORITY-1
184 * The lowest priority that can be assigned to an application thread,
185 * it should be at least 1 level above the minimum of the system
187 #define FRSH_LOWEST_THREAD_PRIORITY 3
190 * Each call to the functions that negotiate or renegotiate a contract
191 * or that change the quality and importance generates a request for
192 * the service thread that we call a service job. This job will be
193 * pending in a queue until executed by the service thread. The
194 * following symbol represents the maximum number of requests that can
195 * be simultaneously queued.
197 #define FRSH_MAX_N_SERVICE_JOBS FRSH_MAX_N_SERVERS * 2
201 * In order to bound the background activity of the scheduler (i.e.,
202 * the admission tests necessary for the negotiation and
203 * re-negotiation of contracts), a service thread has been defined. It
204 * runs at a given priority level and has a budget and period
209 /** Initial period of the service thread (timespec) **/
210 #define FRSH_SERVICE_THREAD_PERIOD {0,10000000} // 0.01 seg
211 // {0,100000000} //0.1 seg
212 // {0,10000000} //3.1 0.01
214 /** Initial budget of the service thread (timespec) **/
215 #define FRSH_SERVICE_THREAD_BUDGET {0,1000000} // 0.001 seg
216 // {0,10000000} //0.01 seg
217 // {0,1000000} //3.1 0.001
221 * Initial priority of the service thread, it has to be lower than the
222 * FRSH_SCHEDULER_PRIORITY, and is set according to its period and the
223 * expected response times for reconfiguration or tunning of the
226 #define FRSH_SERVICE_THREAD_PRIORITY FRSH_LOWEST_THREAD_PRIORITY+1 //3 3 //3 1
233 * @defgroup miscconfig Miscellaneous Config parameters
240 * Maximum number of servers that can be simultaneusly waiting for
241 * being signaled in a synchronization object
243 #define FRSH_MAX_N_SERVERS_IN_SYNCH_OBJECT 4
247 * Maximum number of events that can be pending to be signaled in a
248 * synchronization object
250 #define FRSH_MAX_N_EVENTS_IN_SYNCH_OBJECT 100
253 * Maximum number of pending replenishments in each sporadic server
255 #define FRSH_MAX_N_PENDING_REPLENISHMENTS 25 //250
259 * Maximum number of target windows in a table driven schedule
261 #define FRSH_MAX_N_TARGET_WINDOWS 100
264 * The cpu time given by the round robin scheduler
265 * to the threads in the background (timespec)
267 #define FRSH_RR_SLICE_CPU_TIME {0,100000000} //3 0.1 sec
270 * This function must be supplied by the user to map the preemption
271 * level values given in the contracts for the servers, to priority
272 * values in the range that is allowed by the present implementation
273 * for application threads. The value returned by the function must
274 * fit in the interval defined by the constants:
275 * [FRSH_LOWEST_THREAD_PRIORITY, FRSH_HIGHEST_THREAD_PRIORITY]
277 int frsh_priority_map (unsigned long plevel);
280 * This symbol specifies the maximum number of chars that are stored
281 * of a given shared_object_id, so this is the maximum length used
284 #define FRSH_MAX_SIZE_SHARED_OBJ_ID 65
287 /** Maximum number of networks accesible from a node **/
288 #define FRSH_MAX_N_NETWORK_IDS 1
291 * Maximum number of servers that can be given in a servers list
292 * to the group negotiation/cancellation primitive
294 #define FRSH_MAX_N_SERVER_VALUES 10
297 * Maximum number of contracts that can be given in a contracts list
298 * to the group negotiation/cancellation primitive
300 #define FRSH_MAX_N_CONTRACT_VALUES 10
306 #endif /* _FRSH_CONFIGURATION_PARAMETERS_H_ */