1 | /* confdefs.h |
---|
2 | * |
---|
3 | * This include file contains the configuration table template that will |
---|
4 | * be used by the single processor tests to define its default configuration |
---|
5 | * parameters. |
---|
6 | * |
---|
7 | * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. |
---|
8 | * On-Line Applications Research Corporation (OAR). |
---|
9 | * All rights assigned to U.S. Government, 1994. |
---|
10 | * |
---|
11 | * This material may be reproduced by or for the U.S. Government pursuant |
---|
12 | * to the copyright license under the clause at DFARS 252.227-7013. This |
---|
13 | * notice must appear in all copies of this file and its derivatives. |
---|
14 | * |
---|
15 | * $Id$ |
---|
16 | */ |
---|
17 | |
---|
18 | #ifndef __CONFIGURATION_TEMPLATE_h |
---|
19 | #define __CONFIGURATION_TEMPLATE_h |
---|
20 | |
---|
21 | #ifdef __cplusplus |
---|
22 | extern "C" { |
---|
23 | #endif |
---|
24 | |
---|
25 | extern rtems_initialization_tasks_table Initialization_tasks[]; |
---|
26 | extern rtems_driver_address_table Device_drivers[]; |
---|
27 | extern rtems_configuration_table Configuration; |
---|
28 | extern rtems_multiprocessing_table Multiprocessing_configuration; |
---|
29 | #ifdef RTEMS_POSIX_API |
---|
30 | extern posix_api_configuration_table Configuration_POSIX_API; |
---|
31 | #endif |
---|
32 | |
---|
33 | /* |
---|
34 | * Default User Initialization Task Table. This table guarantees that |
---|
35 | * one user initialization table is defined. |
---|
36 | */ |
---|
37 | |
---|
38 | #ifndef CONFIGURE_HAS_OWN_INIT_TASK_TABLE |
---|
39 | |
---|
40 | #ifndef CONFIGURE_INIT_TASK_NAME |
---|
41 | #define CONFIGURE_INIT_TASK_NAME rtems_build_name( 'U', 'I', '1', ' ' ) |
---|
42 | #endif |
---|
43 | |
---|
44 | #ifndef CONFIGURE_INIT_TASK_STACK_SIZE |
---|
45 | #define CONFIGURE_INIT_TASK_STACK_SIZE RTEMS_MINIMUM_STACK_SIZE |
---|
46 | #endif |
---|
47 | |
---|
48 | #ifndef CONFIGURE_INIT_TASK_PRIORITY |
---|
49 | #define CONFIGURE_INIT_TASK_PRIORITY 1 |
---|
50 | #endif |
---|
51 | |
---|
52 | #ifndef CONFIGURE_INIT_TASK_ATTRIBUTES |
---|
53 | #define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_DEFAULT_ATTRIBUTES |
---|
54 | #endif |
---|
55 | |
---|
56 | #ifndef CONFIGURE_INIT_TASK_ENTRY_POINT |
---|
57 | #define CONFIGURE_INIT_TASK_ENTRY_POINT Init |
---|
58 | #endif |
---|
59 | |
---|
60 | #ifndef CONFIGURE_INIT_TASK_INITIAL_MODES |
---|
61 | #define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_NO_PREEMPT |
---|
62 | #endif |
---|
63 | |
---|
64 | #ifndef CONFIGURE_INIT_TASK_ARGUMENTS |
---|
65 | #define CONFIGURE_INIT_TASK_ARGUMENTS 0 |
---|
66 | #endif |
---|
67 | |
---|
68 | #ifdef CONFIGURE_INIT |
---|
69 | rtems_initialization_tasks_table Initialization_tasks[] = { |
---|
70 | { CONFIGURE_INIT_TASK_NAME, |
---|
71 | CONFIGURE_INIT_TASK_STACK_SIZE, |
---|
72 | CONFIGURE_INIT_TASK_PRIORITY, |
---|
73 | CONFIGURE_INIT_TASK_ATTRIBUTES, |
---|
74 | CONFIGURE_INIT_TASK_ENTRY_POINT, |
---|
75 | CONFIGURE_INIT_TASK_INITIAL_MODES, |
---|
76 | CONFIGURE_INIT_TASK_ARGUMENTS |
---|
77 | } |
---|
78 | }; |
---|
79 | #endif |
---|
80 | |
---|
81 | #endif |
---|
82 | |
---|
83 | /* |
---|
84 | * Default Device Driver Table. Each driver needed by the test is explicitly |
---|
85 | * choosen by that test. There is always a null driver entry. |
---|
86 | */ |
---|
87 | |
---|
88 | #define NULL_DRIVER_TABLE_ENTRY \ |
---|
89 | { NULL, NULL, NULL, NULL, NULL, NULL } |
---|
90 | |
---|
91 | #ifdef CONFIGURE_TEST_NEEDS_TIMER_DRIVER |
---|
92 | #include <timerdrv.h> |
---|
93 | #endif |
---|
94 | |
---|
95 | #ifdef CONFIGURE_TEST_NEEDS_STUB_DRIVER |
---|
96 | #include <stubdrv.h> |
---|
97 | #endif |
---|
98 | |
---|
99 | #ifndef CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE |
---|
100 | |
---|
101 | #ifdef CONFIGURE_INIT |
---|
102 | rtems_driver_address_table Device_drivers[] = { |
---|
103 | #ifdef CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER |
---|
104 | CONSOLE_DRIVER_TABLE_ENTRY, |
---|
105 | #endif |
---|
106 | #ifdef CONFIGURE_TEST_NEEDS_CLOCK_DRIVER |
---|
107 | CLOCK_DRIVER_TABLE_ENTRY, |
---|
108 | #endif |
---|
109 | #ifdef CONFIGURE_TEST_NEEDS_STUB_DRIVER |
---|
110 | STUB_DRIVER_TABLE_ENTRY, |
---|
111 | #endif |
---|
112 | NULL_DRIVER_TABLE_ENTRY |
---|
113 | }; |
---|
114 | #endif |
---|
115 | |
---|
116 | #endif /* CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE */ |
---|
117 | |
---|
118 | /* |
---|
119 | * Default the number of devices per device driver. This value may be |
---|
120 | * overridden by the user. |
---|
121 | */ |
---|
122 | |
---|
123 | #ifndef CONFIGURE_HAS_OWN_NUMBER_OF_DEVICES |
---|
124 | |
---|
125 | #ifndef CONFIGURE_MAXIMUM_DEVICES |
---|
126 | #define CONFIGURE_MAXIMUM_DEVICES 20 |
---|
127 | #endif |
---|
128 | |
---|
129 | #endif /* CONFIGURE_HAS_OWN_NUMBER_OF_DEVICES */ |
---|
130 | |
---|
131 | /* |
---|
132 | * Default Configuration Table. This table contains the most values set in |
---|
133 | * the RTEMS Test Suite. Each value may be overridden within each test to |
---|
134 | * customize the environment. |
---|
135 | */ |
---|
136 | |
---|
137 | #ifdef CONFIGURE_MPTEST |
---|
138 | #ifndef CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE |
---|
139 | |
---|
140 | #ifndef CONFIGURE_MP_NODE_NUMBER |
---|
141 | #define CONFIGURE_MP_NODE_NUMBER NODE_NUMBER |
---|
142 | #endif |
---|
143 | |
---|
144 | #ifndef CONFIGURE_MP_MAXIMUM_NODES |
---|
145 | #define CONFIGURE_MP_MAXIMUM_NODES 2 |
---|
146 | #endif |
---|
147 | |
---|
148 | #ifndef CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS |
---|
149 | #define CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS 32 |
---|
150 | #endif |
---|
151 | |
---|
152 | #ifndef CONFIGURE_MP_MAXIMUM_PROXIES |
---|
153 | #define CONFIGURE_MP_MAXIMUM_PROXIES 32 |
---|
154 | #endif |
---|
155 | |
---|
156 | #ifndef CONFIGURE_MP_MPCI_TABLE_POINTER |
---|
157 | #include <mpci.h> |
---|
158 | #define CONFIGURE_MP_MPCI_TABLE_POINTER &MPCI_table |
---|
159 | #endif |
---|
160 | |
---|
161 | #ifdef CONFIGURE_INIT |
---|
162 | rtems_multiprocessing_table Multiprocessing_configuration = { |
---|
163 | CONFIGURE_MP_NODE_NUMBER, /* local node number */ |
---|
164 | CONFIGURE_MP_MAXIMUM_NODES, /* maximum # nodes in system */ |
---|
165 | CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS, /* maximum # global objects */ |
---|
166 | CONFIGURE_MP_MAXIMUM_PROXIES, /* maximum # proxies */ |
---|
167 | CONFIGURE_MP_MPCI_TABLE_POINTER /* pointer to MPCI config table */ |
---|
168 | }; |
---|
169 | #endif |
---|
170 | |
---|
171 | #define CONFIGURE_MULTIPROCESSING_TABLE &Multiprocessing_configuration |
---|
172 | |
---|
173 | #endif /* CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE */ |
---|
174 | |
---|
175 | #else |
---|
176 | |
---|
177 | #define CONFIGURE_MULTIPROCESSING_TABLE NULL |
---|
178 | |
---|
179 | #endif /* CONFIGURE_MPTEST */ |
---|
180 | |
---|
181 | /* |
---|
182 | * Default Configuration Table. This table contains the most values set in |
---|
183 | * the RTEMS Test Suite. Each value may be overridden within each test to |
---|
184 | * customize the environment. |
---|
185 | */ |
---|
186 | |
---|
187 | #ifndef CONFIGURE_HAS_OWN_CONFIGURATION_TABLE |
---|
188 | |
---|
189 | #ifndef CONFIGURE_EXECUTIVE_RAM_WORK_AREA |
---|
190 | #define CONFIGURE_EXECUTIVE_RAM_WORK_AREA NULL |
---|
191 | #endif |
---|
192 | |
---|
193 | #ifndef CONFIGURE_MAXIMUM_TASKS |
---|
194 | #define CONFIGURE_MAXIMUM_TASKS 10 |
---|
195 | #endif |
---|
196 | |
---|
197 | #ifndef CONFIGURE_MAXIMUM_TIMERS |
---|
198 | #define CONFIGURE_MAXIMUM_TIMERS 0 |
---|
199 | #endif |
---|
200 | |
---|
201 | #ifndef CONFIGURE_MAXIMUM_SEMAPHORES |
---|
202 | #define CONFIGURE_MAXIMUM_SEMAPHORES 0 |
---|
203 | #endif |
---|
204 | |
---|
205 | #ifndef CONFIGURE_MAXIMUM_MESSAGE_QUEUES |
---|
206 | #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 0 |
---|
207 | #endif |
---|
208 | |
---|
209 | #ifndef CONFIGURE_MAXIMUM_PARTITIONS |
---|
210 | #define CONFIGURE_MAXIMUM_PARTITIONS 0 |
---|
211 | #endif |
---|
212 | |
---|
213 | #ifndef CONFIGURE_MAXIMUM_REGIONS |
---|
214 | #define CONFIGURE_MAXIMUM_REGIONS 0 |
---|
215 | #endif |
---|
216 | |
---|
217 | #ifndef CONFIGURE_MAXIMUM_PORTS |
---|
218 | #define CONFIGURE_MAXIMUM_PORTS 0 |
---|
219 | #endif |
---|
220 | |
---|
221 | #ifndef CONFIGURE_MAXIMUM_PERIODS |
---|
222 | #define CONFIGURE_MAXIMUM_PERIODS 0 |
---|
223 | #endif |
---|
224 | |
---|
225 | #ifndef CONFIGURE_MAXIMUM_USER_EXTENSIONS |
---|
226 | #define CONFIGURE_MAXIMUM_USER_EXTENSIONS 0 |
---|
227 | #endif |
---|
228 | |
---|
229 | #ifndef CONFIGURE_MICROSECONDS_PER_TICK |
---|
230 | #define CONFIGURE_MICROSECONDS_PER_TICK RTEMS_MILLISECONDS_TO_MICROSECONDS(10) |
---|
231 | #endif |
---|
232 | |
---|
233 | #ifndef CONFIGURE_TICKS_PER_TIMESLICE |
---|
234 | #define CONFIGURE_TICKS_PER_TIMESLICE 50 |
---|
235 | #endif |
---|
236 | |
---|
237 | #ifndef CONFIGURE_INITIAL_EXTENSIONS |
---|
238 | #define CONFIGURE_INITIAL_EXTENSIONS NULL |
---|
239 | #endif |
---|
240 | |
---|
241 | /* |
---|
242 | * POSIX API Configuration Parameters |
---|
243 | */ |
---|
244 | |
---|
245 | #ifdef RTEMS_POSIX_API |
---|
246 | |
---|
247 | #ifndef CONFIGURE_MAXIMUM_POSIX_THREADS |
---|
248 | #define CONFIGURE_MAXIMUM_POSIX_THREADS 10 |
---|
249 | #endif |
---|
250 | |
---|
251 | #ifndef CONFIGURE_MAXIMUM_POSIX_MUTEXES |
---|
252 | #define CONFIGURE_MAXIMUM_POSIX_MUTEXES 0 |
---|
253 | #endif |
---|
254 | |
---|
255 | #ifndef CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES |
---|
256 | #define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 0 |
---|
257 | #endif |
---|
258 | |
---|
259 | #endif |
---|
260 | |
---|
261 | /* |
---|
262 | * Calculate the RAM size based on the maximum number of objects configured. |
---|
263 | * The model is to estimate the memory required for each configured item, |
---|
264 | * sum the memory requirements and insure that there is at least 32K greater |
---|
265 | * than that for things not directly addressed such as: |
---|
266 | * |
---|
267 | * + stacks greater than minimum size |
---|
268 | * + FP contexts |
---|
269 | * + API areas (should be optional) |
---|
270 | * + messages |
---|
271 | * + object name and local pointer table overhead |
---|
272 | * + per node memory requirements |
---|
273 | * + executive fixed requirements (including at least internal threads |
---|
274 | * and the Ready chains) |
---|
275 | * |
---|
276 | * NOTE: Eventually this should take into account some of the above. |
---|
277 | * Basically, this is a "back of the envelope" estimate for |
---|
278 | * memory requirements. It could be more accurate. |
---|
279 | */ |
---|
280 | |
---|
281 | #ifndef CONFIGURE_EXECUTIVE_RAM_SIZE |
---|
282 | |
---|
283 | #define CONFIGURE_OBJECT_TABLE_STUFF \ |
---|
284 | ( sizeof(Objects_Control *) + sizeof(rtems_name *) + sizeof(rtems_name) ) |
---|
285 | |
---|
286 | #define CONFIGURE_MEMORY_FOR_TASKS(_tasks) \ |
---|
287 | ((_tasks) * \ |
---|
288 | ((sizeof(Thread_Control) + CONTEXT_FP_SIZE + \ |
---|
289 | STACK_MINIMUM_SIZE + sizeof( RTEMS_API_Control ) + \ |
---|
290 | CONFIGURE_OBJECT_TABLE_STUFF)) \ |
---|
291 | ) |
---|
292 | |
---|
293 | #define CONFIGURE_MEMORY_FOR_TIMERS(_timers) \ |
---|
294 | ((_timers) * ( sizeof(Timer_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
295 | |
---|
296 | #define CONFIGURE_MEMORY_FOR_SEMAPHORES(_semaphores) \ |
---|
297 | ((_semaphores) * \ |
---|
298 | ( sizeof(Semaphore_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
299 | |
---|
300 | #define CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(_queues) \ |
---|
301 | ( (_queues) * \ |
---|
302 | ( sizeof(Message_queue_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
303 | |
---|
304 | #define CONFIGURE_MEMORY_FOR_PARTITIONS(_partitions) \ |
---|
305 | ( (_partitions) * \ |
---|
306 | ( sizeof(Partition_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
307 | |
---|
308 | #define CONFIGURE_MEMORY_FOR_REGIONS(_regions) \ |
---|
309 | ( (_regions) * \ |
---|
310 | ( sizeof(Region_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
311 | |
---|
312 | #define CONFIGURE_MEMORY_FOR_PORTS(_ports) \ |
---|
313 | ( (_ports) * \ |
---|
314 | ( sizeof(Dual_ported_memory_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
315 | |
---|
316 | #define CONFIGURE_MEMORY_FOR_PERIODS(_periods) \ |
---|
317 | ( (_periods) * \ |
---|
318 | ( sizeof(Rate_monotonic_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
319 | |
---|
320 | #define CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(_extensions) \ |
---|
321 | ( (_extensions) * \ |
---|
322 | ( sizeof(Extension_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
323 | |
---|
324 | #define CONFIGURE_MEMORY_FOR_DEVICES(_devices) \ |
---|
325 | (((_devices) + 1) * ( sizeof(rtems_driver_name_t) ) ) |
---|
326 | |
---|
327 | #ifdef CONFIGURE_MPTEST |
---|
328 | |
---|
329 | #ifndef CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE |
---|
330 | |
---|
331 | #define CONFIGURE_MEMORY_FOR_PROXIES(_proxies) \ |
---|
332 | ( ((_proxies) + 1) * ( sizeof(Thread_Proxy_control) ) ) |
---|
333 | |
---|
334 | #define CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS(_global_objects) \ |
---|
335 | ((_global_objects) * ( sizeof(Objects_MP_Control) ) ) |
---|
336 | |
---|
337 | #define CONFIGURE_MEMORY_FOR_MP \ |
---|
338 | ( CONFIGURE_MEMORY_FOR_PROXIES(CONFIGURE_MP_MAXIMUM_PROXIES) + \ |
---|
339 | CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS(CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS) \ |
---|
340 | ) |
---|
341 | |
---|
342 | #endif /* CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE */ |
---|
343 | |
---|
344 | #else |
---|
345 | |
---|
346 | #define CONFIGURE_MEMORY_FOR_MP 0 |
---|
347 | |
---|
348 | #endif |
---|
349 | #define CONFIGURE_EXECUTIVE_RAM_SIZE \ |
---|
350 | (( CONFIGURE_MEMORY_FOR_TASKS(CONFIGURE_MAXIMUM_TASKS) + \ |
---|
351 | CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS) + \ |
---|
352 | CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_MAXIMUM_SEMAPHORES) + \ |
---|
353 | CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(CONFIGURE_MAXIMUM_MESSAGE_QUEUES) + \ |
---|
354 | CONFIGURE_MEMORY_FOR_PARTITIONS(CONFIGURE_MAXIMUM_PARTITIONS) + \ |
---|
355 | CONFIGURE_MEMORY_FOR_REGIONS(CONFIGURE_MAXIMUM_REGIONS) + \ |
---|
356 | CONFIGURE_MEMORY_FOR_PORTS(CONFIGURE_MAXIMUM_PORTS) + \ |
---|
357 | CONFIGURE_MEMORY_FOR_PERIODS(CONFIGURE_MAXIMUM_PERIODS) + \ |
---|
358 | CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(CONFIGURE_MAXIMUM_USER_EXTENSIONS) + \ |
---|
359 | CONFIGURE_MEMORY_FOR_DEVICES(CONFIGURE_MAXIMUM_DEVICES) + \ |
---|
360 | CONFIGURE_MEMORY_FOR_MP + \ |
---|
361 | (96*1024) \ |
---|
362 | ) & 0xffff8000) |
---|
363 | #endif |
---|
364 | |
---|
365 | #ifdef CONFIGURE_INIT |
---|
366 | |
---|
367 | rtems_api_configuration_table Configuration_RTEMS_API = { |
---|
368 | CONFIGURE_MAXIMUM_TASKS, |
---|
369 | CONFIGURE_MAXIMUM_TIMERS, |
---|
370 | CONFIGURE_MAXIMUM_SEMAPHORES, |
---|
371 | CONFIGURE_MAXIMUM_MESSAGE_QUEUES, |
---|
372 | CONFIGURE_MAXIMUM_PARTITIONS, |
---|
373 | CONFIGURE_MAXIMUM_REGIONS, |
---|
374 | CONFIGURE_MAXIMUM_PORTS, |
---|
375 | CONFIGURE_MAXIMUM_PERIODS, |
---|
376 | sizeof (Initialization_tasks)/ |
---|
377 | sizeof(rtems_initialization_tasks_table), /* number of init tasks */ |
---|
378 | Initialization_tasks /* init task(s) table */ |
---|
379 | }; |
---|
380 | |
---|
381 | #ifdef RTEMS_POSIX_API |
---|
382 | posix_api_configuration_table Configuration_POSIX_API = { |
---|
383 | CONFIGURE_MAXIMUM_POSIX_THREADS, |
---|
384 | CONFIGURE_MAXIMUM_POSIX_MUTEXES, |
---|
385 | CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES, |
---|
386 | 0, |
---|
387 | NULL |
---|
388 | }; |
---|
389 | #endif |
---|
390 | |
---|
391 | rtems_configuration_table Configuration = { |
---|
392 | CONFIGURE_EXECUTIVE_RAM_WORK_AREA, |
---|
393 | CONFIGURE_EXECUTIVE_RAM_SIZE, |
---|
394 | CONFIGURE_MAXIMUM_USER_EXTENSIONS, |
---|
395 | CONFIGURE_MICROSECONDS_PER_TICK, |
---|
396 | CONFIGURE_TICKS_PER_TIMESLICE, |
---|
397 | CONFIGURE_MAXIMUM_DEVICES, |
---|
398 | sizeof (Device_drivers)/ |
---|
399 | sizeof(rtems_driver_address_table), /* number of device drivers */ |
---|
400 | Device_drivers, /* pointer to driver table */ |
---|
401 | CONFIGURE_INITIAL_EXTENSIONS, /* pointer to initial extensions */ |
---|
402 | CONFIGURE_MULTIPROCESSING_TABLE, /* pointer to MP config table */ |
---|
403 | &Configuration_RTEMS_API, /* pointer to RTEMS API config */ |
---|
404 | #ifdef RTEMS_POSIX_API |
---|
405 | &Configuration_POSIX_API /* pointer to POSIX API config */ |
---|
406 | #else |
---|
407 | NULL /* pointer to POSIX API config */ |
---|
408 | #endif |
---|
409 | }; |
---|
410 | #endif |
---|
411 | |
---|
412 | #endif /* CONFIGURE_HAS_OWN_CONFIGURATION_TABLE */ |
---|
413 | |
---|
414 | #ifdef __cplusplus |
---|
415 | } |
---|
416 | #endif |
---|
417 | |
---|
418 | #endif |
---|
419 | /* end of include file */ |
---|