Rev 889 | Rev 972 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
881 | trimarchi | 1 | //fsf_configuration_parameters.h |
2 | //=============================================================== |
||
3 | // FFFFFFIII RRRRR SSTTTTTTT |
||
4 | // FF IIR RR SS |
||
5 | // FF IR SS |
||
6 | // FFFFFF RRRR SSSSST |
||
7 | // FF FI RRR SS |
||
8 | // FF II RRR SS |
||
9 | // FF IIIIIR RS |
||
10 | // |
||
11 | // Basic FSF(FIRST Scheduling Framework) configuration parameters |
||
12 | //============================================================== |
||
13 | |||
14 | ////////////////////////////////////////////////////// |
||
15 | // Definitions required to configure the fsf |
||
16 | // scheduling algorithms. |
||
17 | |||
889 | trimarchi | 18 | #include <unistd.h> |
19 | #include "stdbool.h" |
||
881 | trimarchi | 20 | |
21 | #ifndef _FSF_CONFIGURATION_PARAMETERS_H_ |
||
22 | #define _FSF_CONFIGURATION_PARAMETERS_H_ |
||
23 | |||
24 | // This symbol specifies whether the scheduler will make a |
||
25 | // schedulability test of the requested contract or not |
||
26 | |||
27 | #define FSF_ADMISSION_TEST_IS_ENABLED true |
||
28 | |||
29 | |||
30 | // Tune these values for optimizing the amount of memory used by the |
||
31 | // implementation |
||
32 | |||
33 | // Maximum number of accepted contracts (servers) |
||
34 | |||
909 | trimarchi | 35 | #define FSF_MAX_N_SERVERS 15 |
881 | trimarchi | 36 | |
37 | |||
38 | // Maximum number of threads that may be scheduled by the framework |
||
39 | |||
40 | #define FSF_MAX_N_THREADS 11 |
||
41 | |||
42 | |||
43 | // Maximum number of critical sections that can be stored in a |
||
44 | // contract parameters object |
||
45 | |||
46 | #define FSF_MAX_N_CRITICAL_SECTIONS 10 |
||
47 | |||
48 | |||
49 | // Maximum number of utilization values (pairs of budget and period) |
||
50 | // that can be stored in a contract parameters object |
||
51 | |||
52 | #define FSF_MAX_N_UTILIZATION_VALUES 5 |
||
53 | |||
54 | |||
55 | // Maximum number of synchronization objects |
||
56 | |||
57 | #define FSF_MAX_N_SYNCH_OBJECTS 5 |
||
58 | |||
59 | |||
60 | // Maximum number of shared objects |
||
61 | |||
62 | #define FSF_MAX_N_SHARED_OBJECTS 100 |
||
63 | |||
64 | |||
909 | trimarchi | 65 | // Define the max number of target windows in the table driven scheduling |
66 | |||
67 | #define FSF_MAX_N_TARGET_WINDOWS 100 |
||
68 | |||
881 | trimarchi | 69 | //////////////////////////////////////////// |
70 | // Other implementation dependent parameters |
||
71 | |||
72 | // The current implementation in MaRTE OS uses the Application-Defined |
||
73 | // Scheduling Interface (proposed to the POSIX standardization |
||
74 | // committee), to create a fixed-priority-based scheduler that |
||
75 | // operates under the rules of the FIRST scheduling framework. |
||
76 | |||
77 | // In this implementation there are two special threads: |
||
78 | // - The application scheduler thread, that |
||
79 | // implements the scheduler |
||
80 | |||
81 | // - The service thread, that is in charge of |
||
82 | // negotiating and renegotiating contracts |
||
83 | // concurrently with the application |
||
84 | |||
85 | // The following symbols are necessary to adapt the application to the |
||
86 | // underlying fixed priority scheduler |
||
87 | |||
88 | // Priority assigned to the application scheduler; it should be above |
||
89 | // the priorities of the application threads and of the service |
||
90 | // thread, and it should be at least 1 level below the maximum of the |
||
91 | // system |
||
92 | |||
93 | #define FSF_SCHEDULER_PRIORITY 30 |
||
94 | |||
95 | |||
96 | // Real-time signal number reserved for the application scheduler to |
||
97 | // manage its timers. |
||
98 | |||
99 | #define FSF_SCHEDULER_SIGNAL SIGRTMIN |
||
100 | |||
101 | |||
102 | // The highest priority that can be assigned to an application thread, |
||
103 | // it should be defined as one level less than the |
||
104 | // FSF_SCHEDULER_PRIORITY |
||
105 | |||
106 | #define FSF_HIGHEST_THREAD_PRIORITY FSF_SCHEDULER_PRIORITY-1 |
||
107 | |||
108 | |||
109 | // The lowest priority that can be assigned to an application thread, |
||
110 | // it should be at least 1 level above the minimum of the system |
||
111 | |||
112 | #define FSF_LOWEST_THREAD_PRIORITY 2 |
||
113 | |||
114 | // Each call to the functions that negotiate or renegotiate a contract |
||
115 | // or that change the quality and importance generates a request for |
||
116 | // the service thread that we call a service job. This job will be |
||
117 | // pending in a queue until executed by the service thread. The |
||
118 | // following symbol represents the maximum number of requests that can |
||
119 | // be simultaneously queued. |
||
120 | #define FSF_MAX_N_SERVICE_JOBS FSF_MAX_N_SERVERS * 2 |
||
121 | |||
122 | // In order to bound the background activity of the scheduler (i.e., |
||
123 | // the admission tests necessary for the negotiation and |
||
124 | // re-negotiation of contracts), a service thread has been defined. It |
||
125 | // runs at a given priority level and has a budget and period |
||
126 | // assigned. |
||
127 | |||
128 | |||
129 | // Initial period of the service thread (timespec) |
||
130 | |||
131 | #define FSF_SERVICE_THREAD_PERIOD {0,100000000} //0.1 seg |
||
132 | |||
133 | |||
134 | // Initial budget of the service thread (timespec) |
||
135 | |||
136 | #define FSF_SERVICE_THREAD_BUDGET {0,10000000} //0.01 seg |
||
137 | |||
138 | |||
139 | // Initial priority of the service thread, it has to be lower than the |
||
140 | // FSF_SCHEDULER_PRIORITY, and is set according to its period and the |
||
141 | // expected response times for reconfiguration or tunning of the |
||
142 | // system. |
||
143 | |||
144 | #define FSF_SERVICE_THREAD_PRIORITY 1 |
||
145 | |||
146 | |||
147 | // Numeric identifier of the service thread, used for tracing |
||
148 | |||
149 | #define FSF_SERVICE_THREAD_IDNAME 0x55555555 |
||
150 | |||
151 | |||
152 | //Maximum number of servers that can be simultaneusly waiting for |
||
153 | //being signaled in a synchronization object |
||
154 | |||
155 | #define FSF_MAX_N_SERVERS_IN_SYNCH_OBJECT 4 |
||
156 | |||
157 | |||
158 | //Maximum number of events that can be pending to be signaled in a |
||
159 | //synchronization object |
||
160 | |||
161 | #define FSF_MAX_N_EVENTS_IN_SYNCH_OBJECT 100 |
||
162 | |||
163 | |||
164 | //Maximum number of pending replenishments in each sporadic server |
||
165 | |||
166 | #define FSF_MAX_N_PENDING_REPLENISHMENTS 25 |
||
167 | |||
168 | |||
169 | // This function must be supplied by the user to map the preemption |
||
170 | // level values given in the contracts for the servers, to priority |
||
171 | // values in the range that is allowed by the present implementation |
||
172 | // for application threads. The value returned by the function must |
||
173 | // fit in the interval defined by the constants: |
||
174 | // [FSF_LOWEST_THREAD_PRIORITY, FSF_HIGHEST_THREAD_PRIORITY] |
||
175 | |||
176 | int |
||
177 | fsf_priority_map (unsigned long plevel); |
||
178 | |||
909 | trimarchi | 179 | //????? |
881 | trimarchi | 180 | // This symbol specifies whether the scheduling system will make |
181 | // traces of the servers, the scheduler and the service thread |
||
182 | // operation and make them available through the fsf_print_traces |
||
183 | // function |
||
184 | |||
185 | #define FSF_TRACING_SERVICE_IS_ENABLED true |
||
909 | trimarchi | 186 | //????? |
881 | trimarchi | 187 | |
188 | #endif /* _FSF_CONFIGURATION_PARAMETERS_H_ */ |