1 | /** |
---|
2 | * @file rtems/confdefs.h |
---|
3 | * |
---|
4 | * This include file contains the configuration table template that will |
---|
5 | * be instantiated by an application based on the setting of a number |
---|
6 | * of macros. The macros are documented in the Configuring a System |
---|
7 | * chapter of the Classic API User's Guide |
---|
8 | * |
---|
9 | * The model is to estimate the memory required for each configured item |
---|
10 | * and sum those estimates. The estimate can be too high or too low for |
---|
11 | * a variety of reasons: |
---|
12 | * |
---|
13 | * Reasons estimate is too high: |
---|
14 | * + FP contexts (not all tasks are FP) |
---|
15 | * |
---|
16 | * Reasons estimate is too low: |
---|
17 | * + stacks greater than minimum size |
---|
18 | * + messages |
---|
19 | * + application must account for device driver resources |
---|
20 | * + application must account for add-on library resource requirements |
---|
21 | * |
---|
22 | * NOTE: Eventually this may be able to take into account some of |
---|
23 | * the above. This procedure has evolved from just enough to |
---|
24 | * support the RTEMS Test Suites into something that can be |
---|
25 | * used remarkably reliably by most applications. |
---|
26 | */ |
---|
27 | |
---|
28 | /* |
---|
29 | * COPYRIGHT (c) 1989-2008. |
---|
30 | * On-Line Applications Research Corporation (OAR). |
---|
31 | * |
---|
32 | * The license and distribution terms for this file may be |
---|
33 | * found in the file LICENSE in this distribution or at |
---|
34 | * http://www.rtems.com/license/LICENSE. |
---|
35 | * |
---|
36 | * $Id$ |
---|
37 | */ |
---|
38 | |
---|
39 | #ifndef __CONFIGURATION_TEMPLATE_h |
---|
40 | #define __CONFIGURATION_TEMPLATE_h |
---|
41 | |
---|
42 | #ifdef __cplusplus |
---|
43 | extern "C" { |
---|
44 | #endif |
---|
45 | |
---|
46 | /* |
---|
47 | * Include the executive's configuration |
---|
48 | */ |
---|
49 | #include <rtems/score/cpuopts.h> |
---|
50 | #include <rtems/score/apimutex.h> |
---|
51 | |
---|
52 | extern rtems_initialization_tasks_table Initialization_tasks[]; |
---|
53 | extern rtems_driver_address_table Device_drivers[]; |
---|
54 | extern rtems_configuration_table Configuration; |
---|
55 | #if defined(RTEMS_MULTIPROCESSING) |
---|
56 | extern rtems_multiprocessing_table Multiprocessing_configuration; |
---|
57 | #endif |
---|
58 | #ifdef RTEMS_POSIX_API |
---|
59 | extern posix_api_configuration_table Configuration_POSIX_API; |
---|
60 | #endif |
---|
61 | #ifdef RTEMS_ITRON_API |
---|
62 | extern itron_api_configuration_table Configuration_ITRON_API; |
---|
63 | #endif |
---|
64 | |
---|
65 | /* |
---|
66 | * RTEMS C Library and Newlib support |
---|
67 | */ |
---|
68 | |
---|
69 | #if (defined(RTEMS_NEWLIB) && defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY)) |
---|
70 | #define CONFIGURE_NEWLIB_EXTENSION 1 |
---|
71 | #else |
---|
72 | #define CONFIGURE_NEWLIB_EXTENSION 0 |
---|
73 | #endif |
---|
74 | |
---|
75 | /* |
---|
76 | * File descriptors managed by libio |
---|
77 | */ |
---|
78 | |
---|
79 | #ifndef CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS |
---|
80 | #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 3 |
---|
81 | #endif |
---|
82 | |
---|
83 | #define CONFIGURE_LIBIO_SEMAPHORES \ |
---|
84 | (CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS + 1) |
---|
85 | |
---|
86 | #ifdef CONFIGURE_INIT |
---|
87 | uint32_t rtems_libio_number_iops = CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS; |
---|
88 | #endif |
---|
89 | |
---|
90 | /* |
---|
91 | * Termios resources |
---|
92 | */ |
---|
93 | |
---|
94 | #ifdef CONFIGURE_TERMIOS_DISABLED |
---|
95 | #define CONFIGURE_TERMIOS_SEMAPHORES 0 |
---|
96 | #else |
---|
97 | |
---|
98 | #ifndef CONFIGURE_NUMBER_OF_TERMIOS_PORTS |
---|
99 | #define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 1 |
---|
100 | #endif |
---|
101 | |
---|
102 | #define CONFIGURE_TERMIOS_SEMAPHORES \ |
---|
103 | ((CONFIGURE_NUMBER_OF_TERMIOS_PORTS * 4) + 1) |
---|
104 | #endif |
---|
105 | |
---|
106 | /* |
---|
107 | * PTYs |
---|
108 | */ |
---|
109 | |
---|
110 | #ifndef CONFIGURE_MAXIMUM_PTYS |
---|
111 | #define CONFIGURE_MAXIMUM_PTYS 0 |
---|
112 | #endif |
---|
113 | |
---|
114 | #ifdef CONFIGURE_INIT |
---|
115 | int rtems_telnetd_maximum_ptys = CONFIGURE_MAXIMUM_PTYS; |
---|
116 | #else |
---|
117 | extern int rtems_telnetd_maximum_ptys; |
---|
118 | #endif |
---|
119 | |
---|
120 | /* |
---|
121 | * Mount Table Configuration |
---|
122 | */ |
---|
123 | |
---|
124 | #include <rtems/imfs.h> |
---|
125 | |
---|
126 | #ifndef CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK |
---|
127 | #define CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK \ |
---|
128 | IMFS_MEMFILE_DEFAULT_BYTES_PER_BLOCK |
---|
129 | #endif |
---|
130 | #ifdef CONFIGURE_INIT |
---|
131 | int imfs_rq_memfile_bytes_per_block = CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK; |
---|
132 | #endif /* CONFIGURE_INIT */ |
---|
133 | |
---|
134 | #ifdef CONFIGURE_INIT |
---|
135 | #ifndef CONFIGURE_HAS_OWN_MOUNT_TABLE |
---|
136 | const rtems_filesystem_mount_table_t configuration_mount_table = { |
---|
137 | #ifdef CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM |
---|
138 | &IMFS_ops, |
---|
139 | #else /* using miniIMFS as base filesystem */ |
---|
140 | &miniIMFS_ops, |
---|
141 | #endif |
---|
142 | RTEMS_FILESYSTEM_READ_WRITE, |
---|
143 | NULL, |
---|
144 | NULL |
---|
145 | }; |
---|
146 | |
---|
147 | const rtems_filesystem_mount_table_t |
---|
148 | *rtems_filesystem_mount_table = &configuration_mount_table; |
---|
149 | const int rtems_filesystem_mount_table_size = 1; |
---|
150 | #endif |
---|
151 | #endif |
---|
152 | |
---|
153 | /* |
---|
154 | * Stack Checker Requirements |
---|
155 | * |
---|
156 | * NOTE: This does not automatically enable reporting at program exit. |
---|
157 | */ |
---|
158 | |
---|
159 | #ifdef STACK_CHECKER_ON |
---|
160 | #define CONFIGURE_STACK_CHECKER_EXTENSION 1 |
---|
161 | #else |
---|
162 | #define CONFIGURE_STACK_CHECKER_EXTENSION 0 |
---|
163 | #endif |
---|
164 | |
---|
165 | |
---|
166 | /* |
---|
167 | * Idle task body configuration |
---|
168 | * |
---|
169 | * There is a default IDLE thread body provided by RTEMS which |
---|
170 | * has the possibility of being CPU specific. There may be a |
---|
171 | * BSP specific override of the RTEMS default body and in turn, |
---|
172 | * the application may override and provide its own. |
---|
173 | */ |
---|
174 | #ifndef CONFIGURE_IDLE_TASK_BODY |
---|
175 | #ifdef BSP_IDLE_TASK_BODY |
---|
176 | #define CONFIGURE_IDLE_TASK_BODY BSP_IDLE_TASK_BODY |
---|
177 | #else |
---|
178 | #define CONFIGURE_IDLE_TASK_BODY NULL |
---|
179 | #endif |
---|
180 | #endif |
---|
181 | |
---|
182 | /* |
---|
183 | * Idle task stack size configuration |
---|
184 | * |
---|
185 | * By default, the IDLE task will have a stack of minimum size. |
---|
186 | * The BSP or application may override this value. |
---|
187 | */ |
---|
188 | #ifndef CONFIGURE_IDLE_TASK_STACK_SIZE |
---|
189 | #ifdef BSP_IDLE_TASK_STACK_SIZE |
---|
190 | #define CONFIGURE_IDLE_TASK_STACK_SIZE BSP_IDLE_TASK_STACK_SIZE |
---|
191 | #else |
---|
192 | #define CONFIGURE_IDLE_TASK_STACK_SIZE RTEMS_MINIMUM_STACK_SIZE |
---|
193 | #endif |
---|
194 | #endif |
---|
195 | |
---|
196 | /* |
---|
197 | * Interrupt stack size configuration |
---|
198 | * |
---|
199 | * By default, the interrupt stack will be of minimum size. |
---|
200 | * The BSP or application may override this value. |
---|
201 | */ |
---|
202 | #ifndef CONFIGURE_INTERRUPT_STACK_SIZE |
---|
203 | #ifdef BSP_INTERRUPT_STACK_SIZE |
---|
204 | #define CONFIGURE_INTERRUPT_STACK_SIZE BSP_INTERRUPT_STACK_SIZE |
---|
205 | #else |
---|
206 | #define CONFIGURE_INTERRUPT_STACK_SIZE RTEMS_MINIMUM_STACK_SIZE |
---|
207 | #endif |
---|
208 | #endif |
---|
209 | |
---|
210 | /* XXX try to get to the point where all BSP support allocating the |
---|
211 | * XXX memory from the Workspace |
---|
212 | */ |
---|
213 | #if (CPU_ALLOCATE_INTERRUPT_STACK == 0) |
---|
214 | #define CONFIGURE_INTERRUPT_STACK_MEMORY 0 |
---|
215 | #else |
---|
216 | #define CONFIGURE_INTERRUPT_STACK_MEMORY CONFIGURE_INTERRUPT_STACK_SIZE |
---|
217 | #endif |
---|
218 | |
---|
219 | /* |
---|
220 | * Task stack allocator configuration |
---|
221 | */ |
---|
222 | |
---|
223 | #ifndef CONFIGURE_TASK_STACK_ALLOCATOR |
---|
224 | #define CONFIGURE_TASK_STACK_ALLOCATOR NULL |
---|
225 | #endif |
---|
226 | |
---|
227 | #ifndef CONFIGURE_TASK_STACK_DEALLOCATOR |
---|
228 | #define CONFIGURE_TASK_STACK_DEALLOCATOR NULL |
---|
229 | #endif |
---|
230 | |
---|
231 | /* |
---|
232 | * Should the RTEMS Workspace and C Program Heap be cleared automatically |
---|
233 | * at system start up? |
---|
234 | */ |
---|
235 | |
---|
236 | #ifndef CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY |
---|
237 | #ifdef BSP_ZERO_WORKSPACE_AUTOMATICALLY |
---|
238 | #define CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY \ |
---|
239 | BSP_ZERO_WORKSPACE_AUTOMATICALLY |
---|
240 | #else |
---|
241 | #define CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY FALSE |
---|
242 | #endif |
---|
243 | #endif |
---|
244 | |
---|
245 | /* |
---|
246 | * RTEMS Malloc configuration |
---|
247 | */ |
---|
248 | |
---|
249 | #include <rtems/malloc.h> |
---|
250 | |
---|
251 | #ifdef CONFIGURE_INIT |
---|
252 | rtems_malloc_statistics_functions_t *rtems_malloc_statistics_helpers = |
---|
253 | #ifndef CONFIGURE_MALLOC_STATISTICS |
---|
254 | NULL; |
---|
255 | #else |
---|
256 | &rtems_malloc_statistics_helpers_table; |
---|
257 | #endif |
---|
258 | #endif |
---|
259 | |
---|
260 | #ifdef CONFIGURE_INIT |
---|
261 | rtems_malloc_sbrk_functions_t *rtems_malloc_sbrk_helpers = |
---|
262 | #ifndef CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK |
---|
263 | NULL; |
---|
264 | #else |
---|
265 | &rtems_malloc_sbrk_helpers_table; |
---|
266 | #endif |
---|
267 | #endif |
---|
268 | |
---|
269 | #ifdef CONFIGURE_INIT |
---|
270 | rtems_malloc_dirtier_t *rtems_malloc_dirty_helper = |
---|
271 | #if defined(CONFIGURE_MALLOC_DIRTY) |
---|
272 | rtems_malloc_dirty_memory; |
---|
273 | #else |
---|
274 | NULL; |
---|
275 | #endif |
---|
276 | #endif |
---|
277 | |
---|
278 | /* |
---|
279 | * Default User Initialization Task Table. This table guarantees that |
---|
280 | * one user initialization table is defined. |
---|
281 | */ |
---|
282 | |
---|
283 | #ifdef CONFIGURE_RTEMS_INIT_TASKS_TABLE |
---|
284 | |
---|
285 | #ifdef CONFIGURE_HAS_OWN_INIT_TASK_TABLE |
---|
286 | |
---|
287 | /* |
---|
288 | * The user is defining their own table information and setting the |
---|
289 | * appropriate variables. |
---|
290 | */ |
---|
291 | |
---|
292 | #else |
---|
293 | |
---|
294 | #ifndef CONFIGURE_INIT_TASK_NAME |
---|
295 | #define CONFIGURE_INIT_TASK_NAME rtems_build_name( 'U', 'I', '1', ' ' ) |
---|
296 | #endif |
---|
297 | |
---|
298 | #ifndef CONFIGURE_INIT_TASK_STACK_SIZE |
---|
299 | #define CONFIGURE_INIT_TASK_STACK_SIZE RTEMS_MINIMUM_STACK_SIZE |
---|
300 | #endif |
---|
301 | |
---|
302 | #ifndef CONFIGURE_INIT_TASK_PRIORITY |
---|
303 | #define CONFIGURE_INIT_TASK_PRIORITY 1 |
---|
304 | #endif |
---|
305 | |
---|
306 | #ifndef CONFIGURE_INIT_TASK_ATTRIBUTES |
---|
307 | #define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_DEFAULT_ATTRIBUTES |
---|
308 | #endif |
---|
309 | |
---|
310 | #ifndef CONFIGURE_INIT_TASK_ENTRY_POINT |
---|
311 | #define CONFIGURE_INIT_TASK_ENTRY_POINT Init |
---|
312 | #endif |
---|
313 | |
---|
314 | #ifndef CONFIGURE_INIT_TASK_INITIAL_MODES |
---|
315 | #define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_NO_PREEMPT |
---|
316 | #endif |
---|
317 | |
---|
318 | #ifndef CONFIGURE_INIT_TASK_ARGUMENTS |
---|
319 | #define CONFIGURE_INIT_TASK_ARGUMENTS 0 |
---|
320 | #endif |
---|
321 | |
---|
322 | #ifdef CONFIGURE_INIT |
---|
323 | rtems_initialization_tasks_table Initialization_tasks[] = { |
---|
324 | { CONFIGURE_INIT_TASK_NAME, |
---|
325 | CONFIGURE_INIT_TASK_STACK_SIZE, |
---|
326 | CONFIGURE_INIT_TASK_PRIORITY, |
---|
327 | CONFIGURE_INIT_TASK_ATTRIBUTES, |
---|
328 | CONFIGURE_INIT_TASK_ENTRY_POINT, |
---|
329 | CONFIGURE_INIT_TASK_INITIAL_MODES, |
---|
330 | CONFIGURE_INIT_TASK_ARGUMENTS |
---|
331 | } |
---|
332 | }; |
---|
333 | #endif |
---|
334 | |
---|
335 | #define CONFIGURE_INIT_TASK_TABLE Initialization_tasks |
---|
336 | |
---|
337 | #define CONFIGURE_INIT_TASK_TABLE_SIZE \ |
---|
338 | sizeof(CONFIGURE_INIT_TASK_TABLE) / sizeof(rtems_initialization_tasks_table) |
---|
339 | |
---|
340 | #endif /* CONFIGURE_HAS_OWN_INIT_TASK_TABLE */ |
---|
341 | |
---|
342 | #else /* CONFIGURE_RTEMS_INIT_TASKS_TABLE */ |
---|
343 | |
---|
344 | #define CONFIGURE_INIT_TASK_TABLE NULL |
---|
345 | #define CONFIGURE_INIT_TASK_TABLE_SIZE 0 |
---|
346 | #define CONFIGURE_INIT_TASK_STACK_SIZE 0 |
---|
347 | |
---|
348 | #endif |
---|
349 | |
---|
350 | /* |
---|
351 | * Default Device Driver Table. Each driver needed by the test is explicitly |
---|
352 | * choosen by that test. There is always a null driver entry. |
---|
353 | */ |
---|
354 | |
---|
355 | #define NULL_DRIVER_TABLE_ENTRY \ |
---|
356 | { NULL, NULL, NULL, NULL, NULL, NULL } |
---|
357 | |
---|
358 | #ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
---|
359 | #include <rtems/console.h> |
---|
360 | #endif |
---|
361 | |
---|
362 | #ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER |
---|
363 | #include <rtems/clockdrv.h> |
---|
364 | #endif |
---|
365 | |
---|
366 | #ifdef CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER |
---|
367 | #include <rtems/timerdrv.h> |
---|
368 | #endif |
---|
369 | |
---|
370 | #ifdef CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER |
---|
371 | #include <rtems/rtc.h> |
---|
372 | #endif |
---|
373 | |
---|
374 | #ifdef CONFIGURE_APPLICATION_NEEDS_WATCHDOG_DRIVER |
---|
375 | #include <rtems/watchdogdrv.h> |
---|
376 | #endif |
---|
377 | |
---|
378 | #ifdef CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER |
---|
379 | #include <rtems/devnull.h> |
---|
380 | #endif |
---|
381 | |
---|
382 | #ifdef CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER |
---|
383 | /* the ide driver needs the ATA driver */ |
---|
384 | # ifndef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER |
---|
385 | # define CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER |
---|
386 | # endif |
---|
387 | #include <libchip/ide_ctrl.h> |
---|
388 | #endif |
---|
389 | |
---|
390 | #ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER |
---|
391 | #include <libchip/ata.h> |
---|
392 | #endif |
---|
393 | |
---|
394 | #ifndef CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE |
---|
395 | |
---|
396 | #ifdef CONFIGURE_INIT |
---|
397 | rtems_driver_address_table Device_drivers[] = { |
---|
398 | #ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
---|
399 | CONSOLE_DRIVER_TABLE_ENTRY, |
---|
400 | #endif |
---|
401 | #ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER |
---|
402 | CLOCK_DRIVER_TABLE_ENTRY, |
---|
403 | #endif |
---|
404 | #ifdef CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER |
---|
405 | RTC_DRIVER_TABLE_ENTRY, |
---|
406 | #endif |
---|
407 | #ifdef CONFIGURE_APPLICATION_NEEDS_WATCHDOG_DRIVER |
---|
408 | WATCHDOG_DRIVER_TABLE_ENTRY, |
---|
409 | #endif |
---|
410 | #ifdef CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER |
---|
411 | DEVNULL_DRIVER_TABLE_ENTRY, |
---|
412 | #endif |
---|
413 | #ifdef CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER |
---|
414 | IDE_CONTROLLER_DRIVER_TABLE_ENTRY, |
---|
415 | #endif |
---|
416 | #ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER |
---|
417 | ATA_DRIVER_TABLE_ENTRY, |
---|
418 | #endif |
---|
419 | #ifdef CONFIGURE_APPLICATION_EXTRA_DRIVERS |
---|
420 | CONFIGURE_APPLICATION_EXTRA_DRIVERS, |
---|
421 | #endif |
---|
422 | #ifdef CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER |
---|
423 | NULL_DRIVER_TABLE_ENTRY |
---|
424 | #elif !defined(CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER) && \ |
---|
425 | !defined(CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER) && \ |
---|
426 | !defined(CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER) && \ |
---|
427 | !defined(CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER) && \ |
---|
428 | !defined(CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER) && \ |
---|
429 | !defined(CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER) && \ |
---|
430 | !defined(CONFIGURE_APPLICATION_EXTRA_DRIVERS) |
---|
431 | NULL_DRIVER_TABLE_ENTRY |
---|
432 | #endif |
---|
433 | }; |
---|
434 | #endif |
---|
435 | |
---|
436 | #endif /* CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE */ |
---|
437 | |
---|
438 | /* |
---|
439 | * Default the number of drivers per node. This value may be |
---|
440 | * overridden by the user. |
---|
441 | */ |
---|
442 | |
---|
443 | #define CONFIGURE_NUMBER_OF_DRIVERS \ |
---|
444 | ((sizeof(Device_drivers) / sizeof(rtems_driver_address_table))) |
---|
445 | |
---|
446 | #ifndef CONFIGURE_MAXIMUM_DRIVERS |
---|
447 | #define CONFIGURE_MAXIMUM_DRIVERS CONFIGURE_NUMBER_OF_DRIVERS |
---|
448 | #endif |
---|
449 | |
---|
450 | /* |
---|
451 | * Default the number of devices per device driver. This value may be |
---|
452 | * overridden by the user. |
---|
453 | * |
---|
454 | * NOTE: This configuration parameter is obsolete. Thus we will warn the |
---|
455 | * user that it is obsolete. |
---|
456 | */ |
---|
457 | |
---|
458 | #ifdef CONFIGURE_MAXIMUM_DEVICES |
---|
459 | #warning "CONFIGURE_MAXIMUM_DEVICES is obsolete. Do not use any longer." |
---|
460 | #endif |
---|
461 | |
---|
462 | #ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER |
---|
463 | /* |
---|
464 | * configure the priority of the ATA driver task |
---|
465 | */ |
---|
466 | # ifndef CONFIGURE_ATA_DRIVER_TASK_PRIORITY |
---|
467 | # define CONFIGURE_ATA_DRIVER_TASK_PRIORITY ATA_DRIVER_TASK_DEFAULT_PRIORITY |
---|
468 | # endif |
---|
469 | # ifdef CONFIGURE_INIT |
---|
470 | rtems_task_priority ata_driver_task_priority |
---|
471 | = CONFIGURE_ATA_DRIVER_TASK_PRIORITY; |
---|
472 | # endif /* CONFIGURE_INIT */ |
---|
473 | #endif |
---|
474 | |
---|
475 | /* |
---|
476 | * add bdbuf configuration and values for swapout task priority |
---|
477 | */ |
---|
478 | #ifdef CONFIGURE_APPLICATION_NEEDS_LIBBLOCK |
---|
479 | #include <rtems/bdbuf.h> |
---|
480 | /* |
---|
481 | * configure the priority of the bdbuf swapout task |
---|
482 | */ |
---|
483 | #ifndef CONFIGURE_SWAPOUT_TASK_PRIORITY |
---|
484 | #define CONFIGURE_SWAPOUT_TASK_PRIORITY SWAPOUT_TASK_DEFAULT_PRIORITY |
---|
485 | #endif |
---|
486 | #ifdef CONFIGURE_INIT |
---|
487 | rtems_task_priority swapout_task_priority |
---|
488 | = CONFIGURE_SWAPOUT_TASK_PRIORITY; |
---|
489 | #endif /* CONFIGURE_INIT */ |
---|
490 | #ifndef CONFIGURE_HAS_OWN_BDBUF_TABLE |
---|
491 | |
---|
492 | #ifndef CONFIGURE_BDBUF_BUFFER_COUNT |
---|
493 | #define CONFIGURE_BDBUF_BUFFER_COUNT 64 |
---|
494 | #endif /* CONFIGURE_BDBUF_BUFFER_COUNT */ |
---|
495 | |
---|
496 | #ifndef CONFIGURE_BDBUF_BUFFER_SIZE |
---|
497 | #define CONFIGURE_BDBUF_BUFFER_SIZE 512 |
---|
498 | #endif /* CONFIGURE_BDBUF_BUFFER_SIZE */ |
---|
499 | #ifdef CONFIGURE_INIT |
---|
500 | rtems_bdbuf_config rtems_bdbuf_configuration[] = { |
---|
501 | {CONFIGURE_BDBUF_BUFFER_SIZE,CONFIGURE_BDBUF_BUFFER_COUNT,NULL} |
---|
502 | }; |
---|
503 | int rtems_bdbuf_configuration_size =( sizeof(rtems_bdbuf_configuration) |
---|
504 | /sizeof(rtems_bdbuf_configuration[0])); |
---|
505 | #endif /* CONFIGURE_INIT */ |
---|
506 | #endif /* CONFIGURE_HAS_OWN_BDBUF_TABLE */ |
---|
507 | #endif /* CONFIGURE_APPLICATION_NEEDS_LIBBLOCK */ |
---|
508 | |
---|
509 | #if defined(RTEMS_MULTIPROCESSING) |
---|
510 | /* |
---|
511 | * Default Multiprocessing Configuration Table. The defaults are |
---|
512 | * appropriate for most of the RTEMS Multiprocessor Test Suite. Each |
---|
513 | * value may be overridden within each test to customize the environment. |
---|
514 | */ |
---|
515 | |
---|
516 | #ifdef CONFIGURE_MP_APPLICATION |
---|
517 | #ifndef CONFIGURE_HAS_OWN_MULTIPROCESSING_TABLE |
---|
518 | |
---|
519 | #ifndef CONFIGURE_MP_NODE_NUMBER |
---|
520 | #define CONFIGURE_MP_NODE_NUMBER NODE_NUMBER |
---|
521 | #endif |
---|
522 | |
---|
523 | #ifndef CONFIGURE_MP_MAXIMUM_NODES |
---|
524 | #define CONFIGURE_MP_MAXIMUM_NODES 2 |
---|
525 | #endif |
---|
526 | |
---|
527 | #ifndef CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS |
---|
528 | #define CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS 32 |
---|
529 | #endif |
---|
530 | |
---|
531 | #ifndef CONFIGURE_MP_MAXIMUM_PROXIES |
---|
532 | #define CONFIGURE_MP_MAXIMUM_PROXIES 32 |
---|
533 | #endif |
---|
534 | |
---|
535 | #ifndef CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK |
---|
536 | #define CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK 0 |
---|
537 | #endif |
---|
538 | |
---|
539 | #ifndef CONFIGURE_MP_MPCI_TABLE_POINTER |
---|
540 | #include <mpci.h> |
---|
541 | #define CONFIGURE_MP_MPCI_TABLE_POINTER &MPCI_table |
---|
542 | #endif |
---|
543 | |
---|
544 | #ifdef CONFIGURE_INIT |
---|
545 | rtems_multiprocessing_table Multiprocessing_configuration = { |
---|
546 | CONFIGURE_MP_NODE_NUMBER, /* local node number */ |
---|
547 | CONFIGURE_MP_MAXIMUM_NODES, /* maximum # nodes in system */ |
---|
548 | CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS, /* maximum # global objects */ |
---|
549 | CONFIGURE_MP_MAXIMUM_PROXIES, /* maximum # proxies */ |
---|
550 | CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK, /* MPCI task stack > minimum */ |
---|
551 | CONFIGURE_MP_MPCI_TABLE_POINTER /* pointer to MPCI config table */ |
---|
552 | }; |
---|
553 | #endif |
---|
554 | |
---|
555 | #define CONFIGURE_MULTIPROCESSING_TABLE &Multiprocessing_configuration |
---|
556 | |
---|
557 | #endif /* CONFIGURE_HAS_OWN_MULTIPROCESSING_TABLE */ |
---|
558 | |
---|
559 | #else |
---|
560 | |
---|
561 | #define CONFIGURE_MULTIPROCESSING_TABLE NULL |
---|
562 | |
---|
563 | #endif /* CONFIGURE_MP_APPLICATION */ |
---|
564 | #endif /* RTEMS_MULTIPROCESSING */ |
---|
565 | |
---|
566 | /* |
---|
567 | * Default Configuration Table. |
---|
568 | */ |
---|
569 | |
---|
570 | #ifndef CONFIGURE_HAS_OWN_CONFIGURATION_TABLE |
---|
571 | |
---|
572 | #ifndef CONFIGURE_EXECUTIVE_RAM_WORK_AREA |
---|
573 | #define CONFIGURE_EXECUTIVE_RAM_WORK_AREA NULL |
---|
574 | #endif |
---|
575 | |
---|
576 | #ifndef CONFIGURE_MAXIMUM_TASKS |
---|
577 | #define CONFIGURE_MAXIMUM_TASKS 0 |
---|
578 | #endif |
---|
579 | |
---|
580 | #ifndef CONFIGURE_MAXIMUM_TIMERS |
---|
581 | #define CONFIGURE_MAXIMUM_TIMERS 0 |
---|
582 | #endif |
---|
583 | |
---|
584 | #ifndef CONFIGURE_MAXIMUM_SEMAPHORES |
---|
585 | #define CONFIGURE_MAXIMUM_SEMAPHORES 0 |
---|
586 | #endif |
---|
587 | |
---|
588 | #ifndef CONFIGURE_MAXIMUM_MESSAGE_QUEUES |
---|
589 | #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 0 |
---|
590 | #endif |
---|
591 | |
---|
592 | #ifndef CONFIGURE_MAXIMUM_PARTITIONS |
---|
593 | #define CONFIGURE_MAXIMUM_PARTITIONS 0 |
---|
594 | #endif |
---|
595 | |
---|
596 | #ifndef CONFIGURE_MAXIMUM_REGIONS |
---|
597 | #define CONFIGURE_MAXIMUM_REGIONS 0 |
---|
598 | #endif |
---|
599 | |
---|
600 | #ifndef CONFIGURE_MAXIMUM_PORTS |
---|
601 | #define CONFIGURE_MAXIMUM_PORTS 0 |
---|
602 | #endif |
---|
603 | |
---|
604 | #ifndef CONFIGURE_MAXIMUM_PERIODS |
---|
605 | #define CONFIGURE_MAXIMUM_PERIODS 0 |
---|
606 | #endif |
---|
607 | |
---|
608 | #ifndef CONFIGURE_MAXIMUM_BARRIERS |
---|
609 | #define CONFIGURE_MAXIMUM_BARRIERS 0 |
---|
610 | #endif |
---|
611 | |
---|
612 | #ifndef CONFIGURE_MAXIMUM_USER_EXTENSIONS |
---|
613 | #define CONFIGURE_MAXIMUM_USER_EXTENSIONS 0 |
---|
614 | #endif |
---|
615 | |
---|
616 | #ifndef CONFIGURE_MICROSECONDS_PER_TICK |
---|
617 | #define CONFIGURE_MICROSECONDS_PER_TICK RTEMS_MILLISECONDS_TO_MICROSECONDS(10) |
---|
618 | #endif |
---|
619 | |
---|
620 | #ifndef CONFIGURE_TICKS_PER_TIMESLICE |
---|
621 | #define CONFIGURE_TICKS_PER_TIMESLICE 50 |
---|
622 | #endif |
---|
623 | |
---|
624 | /* |
---|
625 | * Initial Extension Set |
---|
626 | */ |
---|
627 | |
---|
628 | #ifdef CONFIGURE_INIT |
---|
629 | #ifdef STACK_CHECKER_ON |
---|
630 | #include <rtems/stackchk.h> |
---|
631 | #endif |
---|
632 | #include <rtems/libcsupport.h> |
---|
633 | |
---|
634 | #if defined(CONFIGURE_INITIAL_EXTENSIONS) || \ |
---|
635 | defined(STACK_CHECKER_ON) || \ |
---|
636 | (defined(RTEMS_NEWLIB) && !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY)) |
---|
637 | rtems_extensions_table Configuration_Initial_Extensions[] = { |
---|
638 | #if !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY) |
---|
639 | RTEMS_NEWLIB_EXTENSION, |
---|
640 | #endif |
---|
641 | #if defined(STACK_CHECKER_ON) |
---|
642 | RTEMS_STACK_CHECKER_EXTENSION, |
---|
643 | #endif |
---|
644 | #if defined(CONFIGURE_INITIAL_EXTENSIONS) |
---|
645 | CONFIGURE_INITIAL_EXTENSIONS, |
---|
646 | #endif |
---|
647 | }; |
---|
648 | |
---|
649 | #define CONFIGURE_INITIAL_EXTENSION_TABLE Configuration_Initial_Extensions |
---|
650 | #define CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS \ |
---|
651 | ((sizeof(Configuration_Initial_Extensions) / \ |
---|
652 | sizeof(rtems_extensions_table))) |
---|
653 | #else |
---|
654 | #define CONFIGURE_INITIAL_EXTENSION_TABLE NULL |
---|
655 | #define CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS 0 |
---|
656 | #endif |
---|
657 | |
---|
658 | |
---|
659 | #endif |
---|
660 | |
---|
661 | /* |
---|
662 | * POSIX API Configuration Parameters |
---|
663 | */ |
---|
664 | |
---|
665 | #ifdef RTEMS_POSIX_API |
---|
666 | |
---|
667 | #include <sys/types.h> |
---|
668 | #include <signal.h> |
---|
669 | #include <limits.h> |
---|
670 | #include <mqueue.h> |
---|
671 | #include <rtems/posix/barrier.h> |
---|
672 | #include <rtems/posix/cond.h> |
---|
673 | #include <rtems/posix/mqueue.h> |
---|
674 | #include <rtems/posix/mutex.h> |
---|
675 | #include <rtems/posix/key.h> |
---|
676 | #include <rtems/posix/psignal.h> |
---|
677 | #include <rtems/posix/rwlock.h> |
---|
678 | #include <rtems/posix/semaphore.h> |
---|
679 | #include <rtems/posix/spinlock.h> |
---|
680 | #include <rtems/posix/threadsup.h> |
---|
681 | #include <rtems/posix/timer.h> |
---|
682 | |
---|
683 | #ifndef CONFIGURE_MAXIMUM_POSIX_THREADS |
---|
684 | #define CONFIGURE_MAXIMUM_POSIX_THREADS 0 |
---|
685 | #endif |
---|
686 | |
---|
687 | #ifndef CONFIGURE_MAXIMUM_POSIX_MUTEXES |
---|
688 | #define CONFIGURE_MAXIMUM_POSIX_MUTEXES 0 |
---|
689 | #endif |
---|
690 | |
---|
691 | #ifndef CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES |
---|
692 | #define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 0 |
---|
693 | #endif |
---|
694 | |
---|
695 | #ifndef CONFIGURE_MAXIMUM_POSIX_KEYS |
---|
696 | #define CONFIGURE_MAXIMUM_POSIX_KEYS 0 |
---|
697 | #endif |
---|
698 | |
---|
699 | #ifndef CONFIGURE_MAXIMUM_POSIX_TIMERS |
---|
700 | #define CONFIGURE_MAXIMUM_POSIX_TIMERS 0 |
---|
701 | #endif |
---|
702 | |
---|
703 | #ifndef CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS |
---|
704 | #define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS 0 |
---|
705 | #endif |
---|
706 | |
---|
707 | #ifndef CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES |
---|
708 | #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES 0 |
---|
709 | #endif |
---|
710 | |
---|
711 | #ifndef CONFIGURE_MAXIMUM_POSIX_SEMAPHORES |
---|
712 | #define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES 0 |
---|
713 | #endif |
---|
714 | |
---|
715 | #ifndef CONFIGURE_MAXIMUM_POSIX_BARRIERS |
---|
716 | #define CONFIGURE_MAXIMUM_POSIX_BARRIERS 0 |
---|
717 | #endif |
---|
718 | |
---|
719 | #ifndef CONFIGURE_MAXIMUM_POSIX_SPINLOCKS |
---|
720 | #define CONFIGURE_MAXIMUM_POSIX_SPINLOCKS 0 |
---|
721 | #endif |
---|
722 | |
---|
723 | #ifndef CONFIGURE_MAXIMUM_POSIX_RWLOCKS |
---|
724 | #define CONFIGURE_MAXIMUM_POSIX_RWLOCKS 0 |
---|
725 | #endif |
---|
726 | |
---|
727 | #ifdef CONFIGURE_POSIX_INIT_THREAD_TABLE |
---|
728 | |
---|
729 | #ifdef CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE |
---|
730 | |
---|
731 | /* |
---|
732 | * The user is defining their own table information and setting the |
---|
733 | * appropriate variables for the POSIX Initialization Thread Table. |
---|
734 | */ |
---|
735 | |
---|
736 | #else |
---|
737 | |
---|
738 | #ifndef CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT |
---|
739 | #define CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT POSIX_Init |
---|
740 | #endif |
---|
741 | |
---|
742 | #ifndef CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE |
---|
743 | #define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE (RTEMS_MINIMUM_STACK_SIZE * 2) |
---|
744 | #endif |
---|
745 | |
---|
746 | #ifdef CONFIGURE_INIT |
---|
747 | posix_initialization_threads_table POSIX_Initialization_threads[] = { |
---|
748 | { CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT, \ |
---|
749 | CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE } |
---|
750 | }; |
---|
751 | #endif |
---|
752 | |
---|
753 | #define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME POSIX_Initialization_threads |
---|
754 | |
---|
755 | #define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE \ |
---|
756 | sizeof(CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME) / \ |
---|
757 | sizeof(posix_initialization_threads_table) |
---|
758 | |
---|
759 | #endif /* CONFIGURE_POSIX_HAS_OWN_INIT_TASK_TABLE */ |
---|
760 | |
---|
761 | #else /* CONFIGURE_POSIX_INIT_THREAD_TABLE */ |
---|
762 | |
---|
763 | #define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME NULL |
---|
764 | #define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE 0 |
---|
765 | |
---|
766 | #endif |
---|
767 | |
---|
768 | #define CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API \ |
---|
769 | ( \ |
---|
770 | sizeof (POSIX_API_Control) + \ |
---|
771 | (sizeof (void *) * (CONFIGURE_GNAT_KEYS + CONFIGURE_MAXIMUM_POSIX_KEYS)) \ |
---|
772 | ) |
---|
773 | |
---|
774 | #define CONFIGURE_MEMORY_FOR_POSIX_MUTEXES(_mutexes) \ |
---|
775 | ((_mutexes) * \ |
---|
776 | ( sizeof(POSIX_Mutex_Control) + CONFIGURE_OBJECT_TABLE_STUFF + \ |
---|
777 | NAME_MAX ) ) |
---|
778 | |
---|
779 | #define CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES(_condition_variables) \ |
---|
780 | ((_condition_variables) * \ |
---|
781 | ( sizeof(POSIX_Condition_variables_Control) + \ |
---|
782 | CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
783 | |
---|
784 | #define CONFIGURE_MEMORY_FOR_POSIX_KEYS(_keys) \ |
---|
785 | ((_keys) * \ |
---|
786 | ( sizeof(POSIX_Keys_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
787 | |
---|
788 | #define CONFIGURE_MEMORY_FOR_POSIX_TIMERS(_timers) \ |
---|
789 | ((_timers) * (sizeof(POSIX_Timer_Control) + CONFIGURE_OBJECT_TABLE_STUFF)) |
---|
790 | |
---|
791 | #define CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS(_queued_signals) \ |
---|
792 | ((_queued_signals) * \ |
---|
793 | ( sizeof(POSIX_signals_Siginfo_node) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
794 | |
---|
795 | #define CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES(_message_queues) \ |
---|
796 | ((_message_queues) * \ |
---|
797 | ( sizeof( POSIX_Message_queue_Control) + \ |
---|
798 | CONFIGURE_OBJECT_TABLE_STUFF + \ |
---|
799 | NAME_MAX ) ) |
---|
800 | |
---|
801 | #define CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES(_semaphores) \ |
---|
802 | ((_semaphores) * \ |
---|
803 | ( sizeof( POSIX_Semaphore_Control) + \ |
---|
804 | CONFIGURE_OBJECT_TABLE_STUFF + \ |
---|
805 | NAME_MAX ) ) |
---|
806 | |
---|
807 | #define CONFIGURE_MEMORY_FOR_POSIX_BARRIERS(_barriers) \ |
---|
808 | ((_barriers) * \ |
---|
809 | ( sizeof( POSIX_Barrier_Control) + \ |
---|
810 | CONFIGURE_OBJECT_TABLE_STUFF + \ |
---|
811 | NAME_MAX ) ) |
---|
812 | |
---|
813 | #define CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS(_spinlocks) \ |
---|
814 | ((_spinlocks) * \ |
---|
815 | ( sizeof( POSIX_Spinlock_Control) + \ |
---|
816 | CONFIGURE_OBJECT_TABLE_STUFF + \ |
---|
817 | NAME_MAX ) ) |
---|
818 | |
---|
819 | #define CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS(_rwlocks) \ |
---|
820 | ((_rwlocks) * \ |
---|
821 | ( sizeof( POSIX_RWLock_Control) + \ |
---|
822 | CONFIGURE_OBJECT_TABLE_STUFF + \ |
---|
823 | NAME_MAX ) ) |
---|
824 | |
---|
825 | #define CONFIGURE_MEMORY_FOR_POSIX \ |
---|
826 | ( \ |
---|
827 | CONFIGURE_MEMORY_FOR_POSIX_MUTEXES( CONFIGURE_MAXIMUM_POSIX_MUTEXES ) + \ |
---|
828 | CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES( \ |
---|
829 | CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES ) + \ |
---|
830 | CONFIGURE_MEMORY_FOR_POSIX_KEYS( CONFIGURE_MAXIMUM_POSIX_KEYS ) + \ |
---|
831 | CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS( \ |
---|
832 | CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS ) + \ |
---|
833 | CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES( \ |
---|
834 | CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES ) + \ |
---|
835 | CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES( \ |
---|
836 | CONFIGURE_MAXIMUM_POSIX_SEMAPHORES ) + \ |
---|
837 | CONFIGURE_MEMORY_FOR_POSIX_BARRIERS( CONFIGURE_MAXIMUM_POSIX_BARRIERS ) + \ |
---|
838 | CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS( \ |
---|
839 | CONFIGURE_MAXIMUM_POSIX_SPINLOCKS ) + \ |
---|
840 | CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS( \ |
---|
841 | CONFIGURE_MAXIMUM_POSIX_RWLOCKS ) + \ |
---|
842 | CONFIGURE_MEMORY_FOR_POSIX_TIMERS( CONFIGURE_MAXIMUM_POSIX_TIMERS ) + \ |
---|
843 | (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE) \ |
---|
844 | ) |
---|
845 | #else |
---|
846 | |
---|
847 | #define CONFIGURE_MAXIMUM_POSIX_THREADS 0 |
---|
848 | #define CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API 0 |
---|
849 | #define CONFIGURE_MEMORY_FOR_POSIX 0 |
---|
850 | |
---|
851 | |
---|
852 | #endif /* RTEMS_POSIX_API */ |
---|
853 | |
---|
854 | #ifndef CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE |
---|
855 | #define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE 0 |
---|
856 | #endif |
---|
857 | |
---|
858 | /* |
---|
859 | * ITRON API Configuration Parameters |
---|
860 | */ |
---|
861 | |
---|
862 | #ifdef RTEMS_ITRON_API |
---|
863 | |
---|
864 | #include <rtems/itron.h> |
---|
865 | #include <rtems/itron/config.h> |
---|
866 | #include <rtems/itron/eventflags.h> |
---|
867 | #include <rtems/itron/fmempool.h> |
---|
868 | #include <rtems/itron/mbox.h> |
---|
869 | #include <rtems/itron/msgbuffer.h> |
---|
870 | #include <rtems/itron/port.h> |
---|
871 | #include <rtems/itron/semaphore.h> |
---|
872 | #include <rtems/itron/task.h> |
---|
873 | #include <rtems/itron/vmempool.h> |
---|
874 | |
---|
875 | #ifndef CONFIGURE_MAXIMUM_ITRON_TASKS |
---|
876 | #define CONFIGURE_MAXIMUM_ITRON_TASKS 0 |
---|
877 | #endif |
---|
878 | |
---|
879 | #ifndef CONFIGURE_MAXIMUM_ITRON_SEMAPHORES |
---|
880 | #define CONFIGURE_MAXIMUM_ITRON_SEMAPHORES 0 |
---|
881 | #endif |
---|
882 | |
---|
883 | #ifndef CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS |
---|
884 | #define CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS 0 |
---|
885 | #endif |
---|
886 | |
---|
887 | #ifndef CONFIGURE_MAXIMUM_ITRON_MAILBOXES |
---|
888 | #define CONFIGURE_MAXIMUM_ITRON_MAILBOXES 0 |
---|
889 | #endif |
---|
890 | |
---|
891 | #ifndef CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS |
---|
892 | #define CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS 0 |
---|
893 | #endif |
---|
894 | |
---|
895 | #ifndef CONFIGURE_MAXIMUM_ITRON_PORTS |
---|
896 | #define CONFIGURE_MAXIMUM_ITRON_PORTS 0 |
---|
897 | #endif |
---|
898 | |
---|
899 | #ifndef CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS |
---|
900 | #define CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS 0 |
---|
901 | #endif |
---|
902 | |
---|
903 | #ifndef CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS |
---|
904 | #define CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS 0 |
---|
905 | #endif |
---|
906 | |
---|
907 | #ifdef CONFIGURE_ITRON_INIT_TASK_TABLE |
---|
908 | |
---|
909 | #ifdef CONFIGURE_ITRON_HAS_OWN_INIT_TASK_TABLE |
---|
910 | |
---|
911 | /* |
---|
912 | * The user is defining their own table information and setting the |
---|
913 | * appropriate variables for the ITRON Initialization Task Table. |
---|
914 | */ |
---|
915 | |
---|
916 | #else |
---|
917 | |
---|
918 | #ifndef CONFIGURE_ITRON_INIT_TASK_ENTRY_POINT |
---|
919 | #define CONFIGURE_ITRON_INIT_TASK_ENTRY_POINT ITRON_Init |
---|
920 | #endif |
---|
921 | |
---|
922 | #ifndef CONFIGURE_ITRON_INIT_TASK_ATTRIBUTES |
---|
923 | #define CONFIGURE_ITRON_INIT_TASK_ATTRIBUTES TA_HLNG |
---|
924 | #endif |
---|
925 | |
---|
926 | #ifndef CONFIGURE_ITRON_INIT_TASK_PRIORITY |
---|
927 | #define CONFIGURE_ITRON_INIT_TASK_PRIORITY 1 |
---|
928 | #endif |
---|
929 | |
---|
930 | #ifndef CONFIGURE_ITRON_INIT_TASK_STACK_SIZE |
---|
931 | #define CONFIGURE_ITRON_INIT_TASK_STACK_SIZE RTEMS_MINIMUM_STACK_SIZE |
---|
932 | #endif |
---|
933 | |
---|
934 | #ifdef CONFIGURE_INIT |
---|
935 | itron_initialization_tasks_table ITRON_Initialization_tasks[] = { |
---|
936 | { 1, /* ID */ |
---|
937 | { (VP) 0, /* exinfo */ |
---|
938 | CONFIGURE_ITRON_INIT_TASK_ATTRIBUTES, /* task attributes */ |
---|
939 | CONFIGURE_ITRON_INIT_TASK_ENTRY_POINT, /* task start address */ |
---|
940 | CONFIGURE_ITRON_INIT_TASK_PRIORITY, /* initial task priority */ |
---|
941 | CONFIGURE_ITRON_INIT_TASK_STACK_SIZE /* stack size */ |
---|
942 | } |
---|
943 | } |
---|
944 | }; |
---|
945 | #endif |
---|
946 | |
---|
947 | #define CONFIGURE_ITRON_INIT_TASK_TABLE_NAME ITRON_Initialization_tasks |
---|
948 | |
---|
949 | #define CONFIGURE_ITRON_INIT_TASK_TABLE_SIZE \ |
---|
950 | sizeof(CONFIGURE_ITRON_INIT_TASK_TABLE_NAME) / \ |
---|
951 | sizeof(itron_initialization_tasks_table) |
---|
952 | |
---|
953 | #endif /* CONFIGURE_ITRON_HAS_OWN_INIT_TASK_TABLE */ |
---|
954 | |
---|
955 | #else /* CONFIGURE_ITRON_INIT_TASK_TABLE */ |
---|
956 | |
---|
957 | #define CONFIGURE_ITRON_INIT_TASK_TABLE_NAME NULL |
---|
958 | #define CONFIGURE_ITRON_INIT_TASK_TABLE_SIZE 0 |
---|
959 | #define CONFIGURE_ITRON_INIT_TASK_STACK_SIZE 0 |
---|
960 | |
---|
961 | #endif |
---|
962 | |
---|
963 | #define CONFIGURE_MEMORY_PER_TASK_FOR_ITRON_API \ |
---|
964 | ( \ |
---|
965 | sizeof (ITRON_API_Control) \ |
---|
966 | ) |
---|
967 | |
---|
968 | #define CONFIGURE_MEMORY_FOR_ITRON_SEMAPHORES(_semaphores) \ |
---|
969 | ((_semaphores) * \ |
---|
970 | ( sizeof(ITRON_Semaphore_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
971 | |
---|
972 | #define CONFIGURE_MEMORY_FOR_ITRON_EVENTFLAGS(_eventflags) \ |
---|
973 | ((_eventflags) * \ |
---|
974 | ( sizeof(ITRON_Eventflags_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
975 | |
---|
976 | #define CONFIGURE_MEMORY_FOR_ITRON_MAILBOXES(_mailboxes) \ |
---|
977 | ((_mailboxes) * \ |
---|
978 | ( sizeof(ITRON_Mailbox_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
979 | |
---|
980 | #define CONFIGURE_MEMORY_FOR_ITRON_MESSAGE_BUFFERS(_message_buffers) \ |
---|
981 | ((_message_buffers) * \ |
---|
982 | ( sizeof(ITRON_Message_buffer_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
983 | |
---|
984 | #define CONFIGURE_MEMORY_FOR_ITRON_PORTS(_ports) \ |
---|
985 | ((_ports) * \ |
---|
986 | ( sizeof(ITRON_Port_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
987 | |
---|
988 | #define CONFIGURE_MEMORY_FOR_ITRON_MEMORY_POOLS(_memory_pools) \ |
---|
989 | ((_memory_pools) * \ |
---|
990 | (sizeof(ITRON_Variable_memory_pool_Control) + CONFIGURE_OBJECT_TABLE_STUFF)) |
---|
991 | |
---|
992 | #define CONFIGURE_MEMORY_FOR_ITRON_FIXED_MEMORY_POOLS(_fixed_memory_pools) \ |
---|
993 | ((_fixed_memory_pools) * \ |
---|
994 | ( sizeof(ITRON_Fixed_memory_pool_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
995 | |
---|
996 | |
---|
997 | #define CONFIGURE_MEMORY_FOR_ITRON \ |
---|
998 | ( \ |
---|
999 | CONFIGURE_MEMORY_FOR_ITRON_SEMAPHORES( \ |
---|
1000 | CONFIGURE_MAXIMUM_ITRON_SEMAPHORES ) + \ |
---|
1001 | CONFIGURE_MEMORY_FOR_ITRON_EVENTFLAGS( \ |
---|
1002 | CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS ) + \ |
---|
1003 | CONFIGURE_MEMORY_FOR_ITRON_MAILBOXES( \ |
---|
1004 | CONFIGURE_MAXIMUM_ITRON_MAILBOXES ) + \ |
---|
1005 | CONFIGURE_MEMORY_FOR_ITRON_MESSAGE_BUFFERS( \ |
---|
1006 | CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS ) + \ |
---|
1007 | CONFIGURE_MEMORY_FOR_ITRON_PORTS( \ |
---|
1008 | CONFIGURE_MAXIMUM_ITRON_PORTS ) + \ |
---|
1009 | CONFIGURE_MEMORY_FOR_ITRON_MEMORY_POOLS( \ |
---|
1010 | CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS ) + \ |
---|
1011 | CONFIGURE_MEMORY_FOR_ITRON_FIXED_MEMORY_POOLS( \ |
---|
1012 | CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS ) + \ |
---|
1013 | CONFIGURE_ITRON_INIT_TASK_STACK_SIZE \ |
---|
1014 | ) |
---|
1015 | |
---|
1016 | |
---|
1017 | #else |
---|
1018 | |
---|
1019 | #define CONFIGURE_MAXIMUM_ITRON_TASKS 0 |
---|
1020 | #define CONFIGURE_MAXIMUM_ITRON_SEMAPHORES 0 |
---|
1021 | #define CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS 0 |
---|
1022 | #define CONFIGURE_MAXIMUM_ITRON_MAILBOXES 0 |
---|
1023 | #define CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS 0 |
---|
1024 | #define CONFIGURE_MAXIMUM_ITRON_PORTS 0 |
---|
1025 | #define CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS 0 |
---|
1026 | #define CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS 0 |
---|
1027 | #define CONFIGURE_MEMORY_PER_TASK_FOR_ITRON_API 0 |
---|
1028 | #define CONFIGURE_MEMORY_FOR_ITRON 0 |
---|
1029 | |
---|
1030 | #endif /* RTEMS_ITRON_API */ |
---|
1031 | |
---|
1032 | |
---|
1033 | /* |
---|
1034 | * Calculate the RAM size based on the maximum number of objects configured. |
---|
1035 | */ |
---|
1036 | |
---|
1037 | #ifndef CONFIGURE_EXECUTIVE_RAM_SIZE |
---|
1038 | |
---|
1039 | #define CONFIGURE_OBJECT_TABLE_STUFF \ |
---|
1040 | ( sizeof(Objects_Control *) ) |
---|
1041 | |
---|
1042 | #if defined(RTEMS_NEWLIB) |
---|
1043 | #include <reent.h> |
---|
1044 | |
---|
1045 | #define CONFIGURE_MEMORY_PER_TASK_FOR_LIBC_REENTRANCY sizeof(struct _reent) |
---|
1046 | #else |
---|
1047 | #define CONFIGURE_MEMORY_PER_TASK_FOR_LIBC_REENTRANCY 0 |
---|
1048 | #endif |
---|
1049 | |
---|
1050 | #define CONFIGURE_MEMORY_FOR_TASKS(_tasks) \ |
---|
1051 | (((_tasks) + 1 ) * \ |
---|
1052 | ((sizeof(Thread_Control) + CONTEXT_FP_SIZE + \ |
---|
1053 | STACK_MINIMUM_SIZE + sizeof( RTEMS_API_Control ) + \ |
---|
1054 | CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API + \ |
---|
1055 | CONFIGURE_MEMORY_PER_TASK_FOR_ITRON_API + \ |
---|
1056 | CONFIGURE_MEMORY_PER_TASK_FOR_LIBC_REENTRANCY + \ |
---|
1057 | CONFIGURE_OBJECT_TABLE_STUFF)) \ |
---|
1058 | ) |
---|
1059 | |
---|
1060 | #define CONFIGURE_MEMORY_FOR_TIMERS(_timers) \ |
---|
1061 | ((_timers) * ( sizeof(Timer_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
1062 | |
---|
1063 | #define CONFIGURE_MEMORY_FOR_SEMAPHORES(_semaphores) \ |
---|
1064 | ((_semaphores) * \ |
---|
1065 | ( sizeof(Semaphore_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
1066 | |
---|
1067 | #define CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(_queues) \ |
---|
1068 | ( (_queues) * \ |
---|
1069 | ( sizeof(Message_queue_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
1070 | |
---|
1071 | #define CONFIGURE_MEMORY_FOR_PARTITIONS(_partitions) \ |
---|
1072 | ( (_partitions) * \ |
---|
1073 | ( sizeof(Partition_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
1074 | |
---|
1075 | #define CONFIGURE_MEMORY_FOR_REGIONS(_regions) \ |
---|
1076 | ( (_regions) * \ |
---|
1077 | ( sizeof(Region_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
1078 | |
---|
1079 | #define CONFIGURE_MEMORY_FOR_PORTS(_ports) \ |
---|
1080 | ( (_ports) * \ |
---|
1081 | ( sizeof(Dual_ported_memory_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
1082 | |
---|
1083 | #define CONFIGURE_MEMORY_FOR_PERIODS(_periods) \ |
---|
1084 | ( (_periods) * \ |
---|
1085 | ( sizeof(Rate_monotonic_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
1086 | |
---|
1087 | #define CONFIGURE_MEMORY_FOR_BARRIERS(_barriers) \ |
---|
1088 | ( (_barriers) * \ |
---|
1089 | ( sizeof(Barrier_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
1090 | |
---|
1091 | #define CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(_extensions) \ |
---|
1092 | ( (_extensions) * \ |
---|
1093 | ( sizeof(Extension_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
1094 | |
---|
1095 | #ifdef CONFIGURE_MP_APPLICATION |
---|
1096 | |
---|
1097 | #ifndef CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE |
---|
1098 | |
---|
1099 | #define CONFIGURE_MEMORY_FOR_PROXIES(_proxies) \ |
---|
1100 | ( ((_proxies) + 1) * ( sizeof(Thread_Proxy_control) ) ) |
---|
1101 | |
---|
1102 | #define CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS(_global_objects) \ |
---|
1103 | ((_global_objects) * ( sizeof(Objects_MP_Control) ) ) |
---|
1104 | |
---|
1105 | #define CONFIGURE_MEMORY_FOR_MP \ |
---|
1106 | ( CONFIGURE_MEMORY_FOR_PROXIES(CONFIGURE_MP_MAXIMUM_PROXIES) + \ |
---|
1107 | CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS(CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS) + \ |
---|
1108 | CONFIGURE_MEMORY_FOR_TASKS(1) + \ |
---|
1109 | CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK \ |
---|
1110 | ) |
---|
1111 | |
---|
1112 | #endif /* CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE */ |
---|
1113 | |
---|
1114 | #else |
---|
1115 | |
---|
1116 | #define CONFIGURE_MEMORY_FOR_MP 0 |
---|
1117 | |
---|
1118 | #endif |
---|
1119 | |
---|
1120 | /* |
---|
1121 | * This is so we can account for tasks with stacks greater than minimum |
---|
1122 | * size. This is in bytes. |
---|
1123 | */ |
---|
1124 | #ifndef CONFIGURE_EXTRA_TASK_STACKS |
---|
1125 | #define CONFIGURE_EXTRA_TASK_STACKS 0 |
---|
1126 | #endif |
---|
1127 | |
---|
1128 | /* |
---|
1129 | * Account for pending message buffers in bytes. |
---|
1130 | */ |
---|
1131 | #ifndef CONFIGURE_MESSAGE_BUFFER_MEMORY |
---|
1132 | #define CONFIGURE_MESSAGE_BUFFER_MEMORY 0 |
---|
1133 | #endif |
---|
1134 | |
---|
1135 | /* |
---|
1136 | * Catch all for extra memory in case something broken and underestimates. |
---|
1137 | * Historically this was used for message buffers. |
---|
1138 | */ |
---|
1139 | #ifndef CONFIGURE_MEMORY_OVERHEAD |
---|
1140 | #define CONFIGURE_MEMORY_OVERHEAD 0 |
---|
1141 | #endif |
---|
1142 | |
---|
1143 | #define CONFIGURE_API_MUTEX_MEMORY \ |
---|
1144 | ( (1) * \ |
---|
1145 | ( sizeof(API_Mutex_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) \ |
---|
1146 | ) |
---|
1147 | |
---|
1148 | #define CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD \ |
---|
1149 | ( CONFIGURE_MEMORY_FOR_TASKS(1) + /* IDLE */ \ |
---|
1150 | ((PRIORITY_MAXIMUM+1) * sizeof(Chain_Control)) + /* Ready chains */ \ |
---|
1151 | 256 + /* name/ptr table overhead */ \ |
---|
1152 | CONFIGURE_INTERRUPT_STACK_MEMORY + /* interrupt stack */ \ |
---|
1153 | CONFIGURE_API_MUTEX_MEMORY /* allocation mutex */ \ |
---|
1154 | ) |
---|
1155 | |
---|
1156 | /* |
---|
1157 | * Now account for any extra memory that initialization tasks or threads |
---|
1158 | * may have requested. |
---|
1159 | */ |
---|
1160 | |
---|
1161 | #ifdef RTEMS_POSIX_API |
---|
1162 | #define CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART \ |
---|
1163 | (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE - RTEMS_MINIMUM_STACK_SIZE) |
---|
1164 | #else |
---|
1165 | #define CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART 0 |
---|
1166 | #endif |
---|
1167 | #ifdef RTEMS_ITRON_API |
---|
1168 | #define CONFIGURE_INITIALIZATION_THREADS_STACKS_ITRON_PART \ |
---|
1169 | (CONFIGURE_ITRON_INIT_TASK_STACK_SIZE - RTEMS_MINIMUM_STACK_SIZE) |
---|
1170 | #else |
---|
1171 | #define CONFIGURE_INITIALIZATION_THREADS_STACKS_ITRON_PART 0 |
---|
1172 | #endif |
---|
1173 | |
---|
1174 | #define CONFIGURE_INITIALIZATION_THREADS_STACKS \ |
---|
1175 | ((CONFIGURE_INIT_TASK_STACK_SIZE - RTEMS_MINIMUM_STACK_SIZE) + \ |
---|
1176 | CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART + \ |
---|
1177 | CONFIGURE_INITIALIZATION_THREADS_STACKS_ITRON_PART) |
---|
1178 | |
---|
1179 | /* |
---|
1180 | * POSIX Threads have a default stack size of 2x minimum. The code |
---|
1181 | * below CONFIGURE_MEMORY_FOR_TASKS(...) takes this into account. |
---|
1182 | */ |
---|
1183 | #define CONFIGURE_EXECUTIVE_RAM_SIZE \ |
---|
1184 | (( CONFIGURE_MEMORY_FOR_POSIX + \ |
---|
1185 | CONFIGURE_MEMORY_FOR_ITRON + \ |
---|
1186 | CONFIGURE_MEMORY_FOR_TASKS(CONFIGURE_MAXIMUM_TASKS + \ |
---|
1187 | CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_ADA_TASKS + \ |
---|
1188 | CONFIGURE_MAXIMUM_ITRON_TASKS ) + \ |
---|
1189 | (CONFIGURE_MAXIMUM_POSIX_THREADS * RTEMS_MINIMUM_STACK_SIZE ) + \ |
---|
1190 | CONFIGURE_INITIALIZATION_THREADS_STACKS + \ |
---|
1191 | CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS) + \ |
---|
1192 | CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_MAXIMUM_SEMAPHORES + \ |
---|
1193 | CONFIGURE_LIBIO_SEMAPHORES + CONFIGURE_TERMIOS_SEMAPHORES) + \ |
---|
1194 | CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(CONFIGURE_MAXIMUM_MESSAGE_QUEUES) + \ |
---|
1195 | CONFIGURE_MEMORY_FOR_PARTITIONS(CONFIGURE_MAXIMUM_PARTITIONS) + \ |
---|
1196 | CONFIGURE_MEMORY_FOR_REGIONS( CONFIGURE_MAXIMUM_REGIONS ) + \ |
---|
1197 | CONFIGURE_MEMORY_FOR_PORTS(CONFIGURE_MAXIMUM_PORTS) + \ |
---|
1198 | CONFIGURE_MEMORY_FOR_PERIODS(CONFIGURE_MAXIMUM_PERIODS) + \ |
---|
1199 | CONFIGURE_MEMORY_FOR_BARRIERS(CONFIGURE_MAXIMUM_BARRIERS) + \ |
---|
1200 | CONFIGURE_MEMORY_FOR_USER_EXTENSIONS( \ |
---|
1201 | CONFIGURE_MAXIMUM_USER_EXTENSIONS + CONFIGURE_NEWLIB_EXTENSION + \ |
---|
1202 | CONFIGURE_STACK_CHECKER_EXTENSION ) + \ |
---|
1203 | CONFIGURE_MEMORY_FOR_MP + \ |
---|
1204 | CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD + \ |
---|
1205 | CONFIGURE_MESSAGE_BUFFER_MEMORY + \ |
---|
1206 | (CONFIGURE_MEMORY_OVERHEAD * 1024) + \ |
---|
1207 | (CONFIGURE_EXTRA_TASK_STACKS) + (CONFIGURE_ADA_TASKS_STACK) \ |
---|
1208 | ) & ~0x7) |
---|
1209 | #endif |
---|
1210 | |
---|
1211 | #ifdef CONFIGURE_GNAT_RTEMS |
---|
1212 | #define CONFIGURE_GNAT_MUTEXES 10 |
---|
1213 | /* GNAT/RTEMS provides an optimized Ada self and does not use POSIX Keys */ |
---|
1214 | #define CONFIGURE_GNAT_KEYS 0 |
---|
1215 | |
---|
1216 | /* 20 are required to run all tests in the ACVC */ |
---|
1217 | #ifndef CONFIGURE_MAXIMUM_ADA_TASKS |
---|
1218 | #define CONFIGURE_MAXIMUM_ADA_TASKS 20 |
---|
1219 | #endif |
---|
1220 | |
---|
1221 | /* This is the number of non-Ada tasks which invoked Ada code. */ |
---|
1222 | #ifndef CONFIGURE_MAXIMUM_FAKE_ADA_TASKS |
---|
1223 | #define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0 |
---|
1224 | #endif |
---|
1225 | |
---|
1226 | /* Ada tasks are allocated twice the minimum stack space */ |
---|
1227 | #define CONFIGURE_ADA_TASKS_STACK \ |
---|
1228 | (CONFIGURE_MAXIMUM_ADA_TASKS * (RTEMS_MINIMUM_STACK_SIZE + (6 * 1024))) |
---|
1229 | |
---|
1230 | #else |
---|
1231 | #define CONFIGURE_GNAT_MUTEXES 0 |
---|
1232 | #define CONFIGURE_GNAT_KEYS 0 |
---|
1233 | #define CONFIGURE_MAXIMUM_ADA_TASKS 0 |
---|
1234 | #define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0 |
---|
1235 | #define CONFIGURE_ADA_TASKS_STACK 0 |
---|
1236 | #endif |
---|
1237 | |
---|
1238 | |
---|
1239 | #ifdef CONFIGURE_INIT |
---|
1240 | |
---|
1241 | rtems_api_configuration_table Configuration_RTEMS_API = { |
---|
1242 | CONFIGURE_MAXIMUM_TASKS, |
---|
1243 | CONFIGURE_MAXIMUM_TIMERS, |
---|
1244 | CONFIGURE_MAXIMUM_SEMAPHORES + CONFIGURE_LIBIO_SEMAPHORES + |
---|
1245 | CONFIGURE_TERMIOS_SEMAPHORES, |
---|
1246 | CONFIGURE_MAXIMUM_MESSAGE_QUEUES, |
---|
1247 | CONFIGURE_MAXIMUM_PARTITIONS, |
---|
1248 | CONFIGURE_MAXIMUM_REGIONS, |
---|
1249 | CONFIGURE_MAXIMUM_PORTS, |
---|
1250 | CONFIGURE_MAXIMUM_PERIODS, |
---|
1251 | CONFIGURE_MAXIMUM_BARRIERS, |
---|
1252 | CONFIGURE_INIT_TASK_TABLE_SIZE, |
---|
1253 | CONFIGURE_INIT_TASK_TABLE |
---|
1254 | }; |
---|
1255 | |
---|
1256 | #ifdef RTEMS_POSIX_API |
---|
1257 | posix_api_configuration_table Configuration_POSIX_API = { |
---|
1258 | CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_ADA_TASKS, |
---|
1259 | CONFIGURE_MAXIMUM_POSIX_MUTEXES + CONFIGURE_GNAT_MUTEXES + |
---|
1260 | CONFIGURE_MAXIMUM_ADA_TASKS + CONFIGURE_MAXIMUM_FAKE_ADA_TASKS, |
---|
1261 | CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES + |
---|
1262 | CONFIGURE_MAXIMUM_ADA_TASKS + CONFIGURE_MAXIMUM_FAKE_ADA_TASKS, |
---|
1263 | CONFIGURE_MAXIMUM_POSIX_KEYS + CONFIGURE_GNAT_KEYS, |
---|
1264 | CONFIGURE_MAXIMUM_POSIX_TIMERS, |
---|
1265 | CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS, |
---|
1266 | CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES, |
---|
1267 | CONFIGURE_MAXIMUM_POSIX_SEMAPHORES, |
---|
1268 | CONFIGURE_MAXIMUM_POSIX_BARRIERS, |
---|
1269 | CONFIGURE_MAXIMUM_POSIX_RWLOCKS, |
---|
1270 | CONFIGURE_MAXIMUM_POSIX_SPINLOCKS, |
---|
1271 | CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE, |
---|
1272 | CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME |
---|
1273 | }; |
---|
1274 | #endif |
---|
1275 | |
---|
1276 | #ifdef RTEMS_ITRON_API |
---|
1277 | itron_api_configuration_table Configuration_ITRON_API = { |
---|
1278 | CONFIGURE_MAXIMUM_ITRON_TASKS, |
---|
1279 | CONFIGURE_MAXIMUM_ITRON_SEMAPHORES, |
---|
1280 | CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS, |
---|
1281 | CONFIGURE_MAXIMUM_ITRON_MAILBOXES, |
---|
1282 | CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS, |
---|
1283 | CONFIGURE_MAXIMUM_ITRON_PORTS, |
---|
1284 | CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS, |
---|
1285 | CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS, |
---|
1286 | CONFIGURE_ITRON_INIT_TASK_TABLE_SIZE, |
---|
1287 | CONFIGURE_ITRON_INIT_TASK_TABLE_NAME |
---|
1288 | }; |
---|
1289 | #endif |
---|
1290 | |
---|
1291 | rtems_configuration_table Configuration = { |
---|
1292 | CONFIGURE_EXECUTIVE_RAM_WORK_AREA, |
---|
1293 | CONFIGURE_EXECUTIVE_RAM_SIZE, /* required RTEMS workspace */ |
---|
1294 | CONFIGURE_MAXIMUM_USER_EXTENSIONS + CONFIGURE_NEWLIB_EXTENSION + |
---|
1295 | CONFIGURE_STACK_CHECKER_EXTENSION, /* maximum user extensions */ |
---|
1296 | CONFIGURE_MICROSECONDS_PER_TICK, /* microseconds per clock tick */ |
---|
1297 | CONFIGURE_TICKS_PER_TIMESLICE, /* ticks per timeslice quantum */ |
---|
1298 | CONFIGURE_IDLE_TASK_BODY, /* user's IDLE task */ |
---|
1299 | CONFIGURE_IDLE_TASK_STACK_SIZE, /* IDLE task stack size */ |
---|
1300 | CONFIGURE_INTERRUPT_STACK_SIZE, /* interrupt stack size */ |
---|
1301 | CONFIGURE_TASK_STACK_ALLOCATOR, /* stack allocator */ |
---|
1302 | CONFIGURE_TASK_STACK_DEALLOCATOR, /* stack deallocator */ |
---|
1303 | CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY, /* true to clear memory */ |
---|
1304 | CONFIGURE_MAXIMUM_DRIVERS, /* maximum device drivers */ |
---|
1305 | CONFIGURE_NUMBER_OF_DRIVERS, /* static device drivers */ |
---|
1306 | Device_drivers, /* pointer to driver table */ |
---|
1307 | CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS, /* number of initial extensions */ |
---|
1308 | CONFIGURE_INITIAL_EXTENSION_TABLE, /* pointer to initial extensions */ |
---|
1309 | #if defined(RTEMS_MULTIPROCESSING) |
---|
1310 | CONFIGURE_MULTIPROCESSING_TABLE, /* pointer to MP config table */ |
---|
1311 | #endif |
---|
1312 | &Configuration_RTEMS_API, /* pointer to RTEMS API config */ |
---|
1313 | #ifdef RTEMS_POSIX_API |
---|
1314 | &Configuration_POSIX_API, /* pointer to POSIX API config */ |
---|
1315 | #else |
---|
1316 | NULL, /* pointer to POSIX API config */ |
---|
1317 | #endif |
---|
1318 | #ifdef RTEMS_ITRON_API |
---|
1319 | &Configuration_ITRON_API /* pointer to ITRON API config */ |
---|
1320 | #else |
---|
1321 | NULL /* pointer to ITRON API config */ |
---|
1322 | #endif |
---|
1323 | }; |
---|
1324 | #endif |
---|
1325 | |
---|
1326 | #endif /* CONFIGURE_HAS_OWN_CONFIGURATION_TABLE */ |
---|
1327 | |
---|
1328 | /* |
---|
1329 | * If the user has configured a set of Classic API Initialization Tasks, |
---|
1330 | * then we need to install the code that runs that loop. |
---|
1331 | */ |
---|
1332 | #ifdef CONFIGURE_INIT |
---|
1333 | #ifdef CONFIGURE_RTEMS_INIT_TASKS_TABLE |
---|
1334 | void (_RTEMS_tasks_Initialize_user_tasks_body)(void); |
---|
1335 | void (*_RTEMS_tasks_Initialize_user_tasks_p)(void) = |
---|
1336 | _RTEMS_tasks_Initialize_user_tasks_body; |
---|
1337 | #else |
---|
1338 | void (*_RTEMS_tasks_Initialize_user_tasks_p)(void) = NULL; |
---|
1339 | #endif |
---|
1340 | #endif |
---|
1341 | |
---|
1342 | /* |
---|
1343 | * If the user has configured a set of POSIX Initialization Threads, |
---|
1344 | * then we need to install the code that runs that loop. |
---|
1345 | */ |
---|
1346 | #ifdef RTEMS_POSIX_API |
---|
1347 | #ifdef CONFIGURE_INIT |
---|
1348 | #ifdef CONFIGURE_POSIX_INIT_THREAD_TABLE |
---|
1349 | void _POSIX_Threads_Initialize_user_threads_body(void); |
---|
1350 | void (*_POSIX_Threads_Initialize_user_threads_p)(void) = |
---|
1351 | _POSIX_Threads_Initialize_user_threads_body; |
---|
1352 | #else |
---|
1353 | void (*_POSIX_Threads_Initialize_user_threads_p)(void) = NULL; |
---|
1354 | #endif |
---|
1355 | #endif |
---|
1356 | #endif |
---|
1357 | |
---|
1358 | /* |
---|
1359 | * If the user has configured a set of ITRON Initialization Tasks, |
---|
1360 | * then we need to install the code that runs that loop. |
---|
1361 | */ |
---|
1362 | #ifdef RTEMS_ITRON_API |
---|
1363 | #ifdef CONFIGURE_INIT |
---|
1364 | #ifdef CONFIGURE_ITRON_INIT_TASK_TABLE |
---|
1365 | void _ITRON_Task_Initialize_user_tasks_body(void); |
---|
1366 | void (*_ITRON_Initialize_user_tasks_p)(void) = |
---|
1367 | _ITRON_Task_Initialize_user_tasks_body; |
---|
1368 | #else |
---|
1369 | void (*_ITRON_Initialize_user_tasks_p)(void) = NULL; |
---|
1370 | #endif |
---|
1371 | #endif |
---|
1372 | #endif |
---|
1373 | |
---|
1374 | #ifdef __cplusplus |
---|
1375 | } |
---|
1376 | #endif |
---|
1377 | |
---|
1378 | /****************************************************************** |
---|
1379 | ****************************************************************** |
---|
1380 | ****************************************************************** |
---|
1381 | * CONFIGURATION WARNINGS AND ERROR CHECKING * |
---|
1382 | ****************************************************************** |
---|
1383 | ****************************************************************** |
---|
1384 | ****************************************************************** |
---|
1385 | */ |
---|
1386 | |
---|
1387 | /* |
---|
1388 | * Make sure a task/thread of some sort is configured |
---|
1389 | */ |
---|
1390 | #if (CONFIGURE_MAXIMUM_TASKS == 0) && \ |
---|
1391 | (CONFIGURE_MAXIMUM_POSIX_THREADS == 0) && \ |
---|
1392 | (CONFIGURE_MAXIMUM_ADA_TASKS == 0) && \ |
---|
1393 | (CONFIGURE_MAXIMUM_ITRON_TASKS == 0) |
---|
1394 | #error "CONFIGURATION ERROR: No tasks or threads configured!!" |
---|
1395 | #endif |
---|
1396 | |
---|
1397 | /* |
---|
1398 | * Make sure at least one of the initialization task/thread |
---|
1399 | * tables was defined. |
---|
1400 | */ |
---|
1401 | #if !defined(CONFIGURE_RTEMS_INIT_TASKS_TABLE) && \ |
---|
1402 | !defined(CONFIGURE_POSIX_INIT_THREAD_TABLE) && \ |
---|
1403 | !defined(CONFIGURE_ITRON_INIT_TASK_TABLE) |
---|
1404 | #error "CONFIGURATION ERROR: No initialization tasks or threads configured!!" |
---|
1405 | #endif |
---|
1406 | |
---|
1407 | /* |
---|
1408 | * If the user is trying to configure a multiprocessing application and |
---|
1409 | * RTEMS was not configured and built multiprocessing, then error out. |
---|
1410 | */ |
---|
1411 | #if defined(CONFIGURE_MP_APPLICATION) && \ |
---|
1412 | !defined(RTEMS_MULTIPROCESSING) |
---|
1413 | #error "CONFIGURATION ERROR: RTEMS not configured for multiprocessing!!" |
---|
1414 | #endif |
---|
1415 | |
---|
1416 | /* |
---|
1417 | * If an attempt was made to configure POSIX objects and |
---|
1418 | * the POSIX API was not configured into RTEMS, error out. |
---|
1419 | */ |
---|
1420 | #if !defined(RTEMS_POSIX_API) |
---|
1421 | #if ((CONFIGURE_MAXIMUM_POSIX_THREADS != 0) || \ |
---|
1422 | (CONFIGURE_MAXIMUM_POSIX_MUTEXES != 0) || \ |
---|
1423 | (CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES != 0) || \ |
---|
1424 | (CONFIGURE_MAXIMUM_POSIX_KEYS != 0) || \ |
---|
1425 | (CONFIGURE_MAXIMUM_POSIX_TIMERS != 0) || \ |
---|
1426 | (CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS != 0) || \ |
---|
1427 | (CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES != 0) || \ |
---|
1428 | (CONFIGURE_MAXIMUM_POSIX_SEMAPHORES != 0) || \ |
---|
1429 | (CONFIGURE_MAXIMUM_POSIX_BARRIERS != 0) || \ |
---|
1430 | (CONFIGURE_MAXIMUM_POSIX_SPINLOCKS != 0) || \ |
---|
1431 | (CONFIGURE_MAXIMUM_POSIX_RWLOCKS != 0) || \ |
---|
1432 | defined(CONFIGURE_POSIX_INIT_THREAD_TABLE)) |
---|
1433 | #error "CONFIGURATION ERROR: POSIX API support not configured!!" |
---|
1434 | #endif |
---|
1435 | #endif |
---|
1436 | |
---|
1437 | /* |
---|
1438 | * If an attempt was made to configure ITRON objects and |
---|
1439 | * the ITRON API was not configured into RTEMS, error out. |
---|
1440 | */ |
---|
1441 | #if !defined(RTEMS_ITRON_API) |
---|
1442 | #if ((CONFIGURE_MAXIMUM_ITRON_TASKS != 0) || \ |
---|
1443 | (CONFIGURE_MAXIMUM_ITRON_SEMAPHORES != 0) || \ |
---|
1444 | (CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS != 0) || \ |
---|
1445 | (CONFIGURE_MAXIMUM_ITRON_MAILBOXES != 0) || \ |
---|
1446 | (CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS != 0) || \ |
---|
1447 | (CONFIGURE_MAXIMUM_ITRON_PORTS != 0) || \ |
---|
1448 | (CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS != 0) || \ |
---|
1449 | (CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS != 0) || \ |
---|
1450 | defined(CONFIGURE_ITRON_INIT_TASK_TABLE)) |
---|
1451 | #error "CONFIGURATION ERROR: ITRON API support not configured!!" |
---|
1452 | #endif |
---|
1453 | #endif |
---|
1454 | |
---|
1455 | /* |
---|
1456 | * You must either explicity include or exclude the clock driver. |
---|
1457 | * It is such a common newbie error to leave it out. Maybe this |
---|
1458 | * will put an end to it. |
---|
1459 | * |
---|
1460 | * NOTE: If you are using the timer driver, it is considered |
---|
1461 | * mutually exclusive with the clock driver because the |
---|
1462 | * drivers are assumed to use the same "timer" hardware |
---|
1463 | * on many boards. |
---|
1464 | */ |
---|
1465 | #if !defined(CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE) |
---|
1466 | #if !defined(CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER) && \ |
---|
1467 | !defined(CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER) && \ |
---|
1468 | !defined(CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER) |
---|
1469 | #error "CONFIGURATION ERROR: Do you want the clock driver or not?!?" |
---|
1470 | #endif |
---|
1471 | #endif |
---|
1472 | |
---|
1473 | /* |
---|
1474 | * These names have been obsoleted so make the user application stop compiling |
---|
1475 | */ |
---|
1476 | #if defined(CONFIGURE_TEST_NEEDS_TIMER_DRIVER) || \ |
---|
1477 | defined(CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER) || \ |
---|
1478 | defined(CONFIGURE_TEST_NEEDS_CLOCK_DRIVER) || \ |
---|
1479 | defined(CONFIGURE_TEST_NEEDS_RTC_DRIVER) || \ |
---|
1480 | defined(CONFIGURE_TEST_NEEDS_STUB_DRIVER) |
---|
1481 | #error "CONFIGURATION ERROR: CONFIGURE_TEST_XXX constants are obsolete" |
---|
1482 | #endif |
---|
1483 | |
---|
1484 | #endif |
---|
1485 | /* end of include file */ |
---|