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-2010. |
---|
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 | /* |
---|
43 | * Include the executive's configuration |
---|
44 | */ |
---|
45 | #include <rtems/score/cpuopts.h> |
---|
46 | #include <rtems/score/apimutex.h> |
---|
47 | |
---|
48 | #ifdef __cplusplus |
---|
49 | extern "C" { |
---|
50 | #endif |
---|
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 | * This macro determines whether the RTEMS reentrancy support for |
---|
67 | * the Newlib C Library is enabled. |
---|
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 | #include <rtems/libio.h> |
---|
76 | |
---|
77 | #ifdef CONFIGURE_INIT |
---|
78 | rtems_libio_init_functions_t rtems_libio_init_helper = |
---|
79 | #ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM |
---|
80 | NULL; |
---|
81 | #else |
---|
82 | rtems_libio_init; |
---|
83 | #endif |
---|
84 | |
---|
85 | rtems_libio_supp_functions_t rtems_libio_supp_helper = |
---|
86 | #ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM |
---|
87 | NULL; |
---|
88 | #else |
---|
89 | open_dev_console; |
---|
90 | #endif |
---|
91 | |
---|
92 | rtems_fs_init_functions_t rtems_fs_init_helper = |
---|
93 | #ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM |
---|
94 | NULL; |
---|
95 | #else |
---|
96 | rtems_filesystem_initialize; |
---|
97 | #endif |
---|
98 | #endif |
---|
99 | |
---|
100 | |
---|
101 | /* |
---|
102 | * If the application disables the filesystem, they will not need |
---|
103 | * a mount table, so do not produce one. |
---|
104 | */ |
---|
105 | #ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM |
---|
106 | #define CONFIGURE_HAS_OWN_MOUNT_TABLE |
---|
107 | #endif |
---|
108 | |
---|
109 | /** |
---|
110 | * This macro defines the number of POSIX file descriptors allocated |
---|
111 | * and managed by libio. These are the "integer" file descriptors that |
---|
112 | * are used by calls like open(2) and read(2). |
---|
113 | */ |
---|
114 | #ifndef CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS |
---|
115 | #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 3 |
---|
116 | #endif |
---|
117 | |
---|
118 | /** |
---|
119 | * From the number of file descriptors, we can determine how many |
---|
120 | * semaphores the implementation will require. |
---|
121 | */ |
---|
122 | #define CONFIGURE_LIBIO_SEMAPHORES \ |
---|
123 | (CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS + 1) |
---|
124 | |
---|
125 | #ifdef CONFIGURE_INIT |
---|
126 | /** |
---|
127 | * When instantiating the configuration tables, this variable is |
---|
128 | * initialized to specify the maximum number of file descriptors. |
---|
129 | */ |
---|
130 | uint32_t rtems_libio_number_iops = CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS; |
---|
131 | #endif |
---|
132 | |
---|
133 | /** |
---|
134 | * This macro determines if termios is disabled by this application. |
---|
135 | * This only means that resources will not be reserved. If you end |
---|
136 | * up using termios, it will fail. |
---|
137 | */ |
---|
138 | #ifdef CONFIGURE_TERMIOS_DISABLED |
---|
139 | #define CONFIGURE_TERMIOS_SEMAPHORES 0 |
---|
140 | #else |
---|
141 | /** |
---|
142 | * This macro specifies the number of serial or PTY ports that will |
---|
143 | * use termios. |
---|
144 | */ |
---|
145 | #ifndef CONFIGURE_NUMBER_OF_TERMIOS_PORTS |
---|
146 | #define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 1 |
---|
147 | #endif |
---|
148 | |
---|
149 | /** |
---|
150 | * This macro reserves the number of semaphores required by termios |
---|
151 | * based upon the number of communication ports that will use it. |
---|
152 | */ |
---|
153 | #define CONFIGURE_TERMIOS_SEMAPHORES \ |
---|
154 | ((CONFIGURE_NUMBER_OF_TERMIOS_PORTS * 4) + 1) |
---|
155 | #endif |
---|
156 | |
---|
157 | /** |
---|
158 | * This macro specifies the number of PTYs that can be concurrently |
---|
159 | * active. |
---|
160 | */ |
---|
161 | #ifndef CONFIGURE_MAXIMUM_PTYS |
---|
162 | #define CONFIGURE_MAXIMUM_PTYS 0 |
---|
163 | #endif |
---|
164 | |
---|
165 | /** |
---|
166 | * This variable contains the maximum number of PTYs that can be |
---|
167 | * concurrently active. |
---|
168 | */ |
---|
169 | #ifdef CONFIGURE_INIT |
---|
170 | int rtems_telnetd_maximum_ptys = CONFIGURE_MAXIMUM_PTYS; |
---|
171 | #else |
---|
172 | extern int rtems_telnetd_maximum_ptys; |
---|
173 | #endif |
---|
174 | |
---|
175 | /* |
---|
176 | * Filesystems and Mount Table Configuration. |
---|
177 | * |
---|
178 | * Defines to control the file system: |
---|
179 | * |
---|
180 | * CONFIGURE_APPLICATION_DISABLE_FILESYSTEM: |
---|
181 | * Disable the RTEMS filesystems. You get an empty DEVFS. |
---|
182 | * |
---|
183 | * CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM: |
---|
184 | * Use the DEVFS as the root file system. Limited functions are |
---|
185 | * provided when this is used. |
---|
186 | * |
---|
187 | * CONFIGURE_FILESYSTEM_ALL: |
---|
188 | * Add file filesystems to the default filesystem table. |
---|
189 | * |
---|
190 | * List of available file systems. You can define as many as you like: |
---|
191 | * CONFIGURE_FILESYSTEM_MINIIMFS - MiniIMFS, use DEVFS now |
---|
192 | * CONFIGURE_FILESYSTEM_IMFS - In Memory File System (IMFS) |
---|
193 | * CONFIGURE_FILESYSTEM_DEVFS - Device File System (DSVFS) |
---|
194 | * CONFIGURE_FILESYSTEM_TFTPFS - TFTP File System, networking enabled |
---|
195 | * CONFIGURE_FILESYSTEM_FTPFS - FTP File System, networking enabled |
---|
196 | * CONFIGURE_FILESYSTEM_NFS - Network File System, networking enabled |
---|
197 | * CONFIGURE_FILESYSTEM_DOSFS - DOS File System, uses libblock |
---|
198 | * CONFIGURE_FILESYSTEM_RFS - RTEMS File System (RFS), uses libblock |
---|
199 | * |
---|
200 | * Combinations: |
---|
201 | * |
---|
202 | * - If nothing is defined the base file system is the IMFS. |
---|
203 | * |
---|
204 | * - If CONFIGURE_APPLICATION_DISABLE_FILESYSTEM is defined all filesystem |
---|
205 | * are disabled by force and an empty DEVFS is created. |
---|
206 | * |
---|
207 | * - If CONFIGURE_USE_DEV_AS_BASE_FILESYSTEM is defined all filesystem |
---|
208 | * are disabled by force and DEVFS is defined. |
---|
209 | */ |
---|
210 | |
---|
211 | #ifdef CONFIGURE_INIT |
---|
212 | |
---|
213 | /* |
---|
214 | * Include all file systems. Do this before checking if the filesystem has |
---|
215 | * been disabled. |
---|
216 | */ |
---|
217 | #ifdef CONFIGURE_FILESYSTEM_ALL |
---|
218 | #define CONFIGURE_FILESYSTEM_MINIIMFS |
---|
219 | #define CONFIGURE_FILESYSTEM_IMFS |
---|
220 | #define CONFIGURE_FILESYSTEM_DEVFS |
---|
221 | #define CONFIGURE_FILESYSTEM_TFTPFS |
---|
222 | #define CONFIGURE_FILESYSTEM_FTPFS |
---|
223 | #define CONFIGURE_FILESYSTEM_NFS |
---|
224 | #define CONFIGURE_FILESYSTEM_DOSFS |
---|
225 | #define CONFIGURE_FILESYSTEM_RFS |
---|
226 | #endif |
---|
227 | |
---|
228 | /* |
---|
229 | * If disabling the file system undef everything. If DEVFS as the base |
---|
230 | * filesystem undefine all other filesystems because you cannot mount other |
---|
231 | * filesystems. Same for miniIMFS. |
---|
232 | */ |
---|
233 | #if defined(CONFIGURE_APPLICATION_DISABLE_FILESYSTEM) || \ |
---|
234 | defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM) || \ |
---|
235 | defined(CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM) |
---|
236 | #if defined(CONFIGURE_APPLICATION_DISABLE_FILESYSTEM) |
---|
237 | #undef CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM |
---|
238 | #undef CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM |
---|
239 | #elif defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM) |
---|
240 | #undef CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM |
---|
241 | #endif |
---|
242 | #undef CONFIGURE_FILESYSTEM_MINIIMFS |
---|
243 | #undef CONFIGURE_FILESYSTEM_IMFS |
---|
244 | #undef CONFIGURE_FILESYSTEM_DEVFS |
---|
245 | #undef CONFIGURE_FILESYSTEM_TFTPFS |
---|
246 | #undef CONFIGURE_FILESYSTEM_FTPFS |
---|
247 | #undef CONFIGURE_FILESYSTEM_NFS |
---|
248 | #undef CONFIGURE_FILESYSTEM_DOSFS |
---|
249 | #undef CONFIGURE_FILESYSTEM_RFS |
---|
250 | #endif |
---|
251 | |
---|
252 | /* |
---|
253 | * If the base filesystem is DEVFS define it else define IMFS. |
---|
254 | * We will have either DEVFS or IMFS defined after this. |
---|
255 | */ |
---|
256 | #if !defined(CONFIGURE_APPLICATION_DISABLE_FILESYSTEM) |
---|
257 | #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM) |
---|
258 | #define CONFIGURE_FILESYSTEM_DEVFS |
---|
259 | #elif defined(CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM) |
---|
260 | #define CONFIGURE_FILESYSTEM_MINIIMFS |
---|
261 | #elif !defined(CONFIGURE_FILESYSTEM_IMFS) |
---|
262 | #define CONFIGURE_FILESYSTEM_IMFS |
---|
263 | #endif |
---|
264 | #endif |
---|
265 | |
---|
266 | #endif |
---|
267 | |
---|
268 | /** |
---|
269 | * IMFS |
---|
270 | */ |
---|
271 | #include <rtems/imfs.h> |
---|
272 | |
---|
273 | /** |
---|
274 | * This specifies the number of bytes per block for files within the IMFS. |
---|
275 | * There are a maximum number of blocks per file so this dictates the maximum |
---|
276 | * size of a file. This has to be balanced with the unused portion of each |
---|
277 | * block that might be wasted. |
---|
278 | */ |
---|
279 | #ifndef CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK |
---|
280 | #define CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK \ |
---|
281 | IMFS_MEMFILE_DEFAULT_BYTES_PER_BLOCK |
---|
282 | #endif |
---|
283 | |
---|
284 | /** |
---|
285 | * This defines the miniIMFS file system table entry. |
---|
286 | */ |
---|
287 | #if !defined(CONFIGURE_FILESYSTEM_ENTRY_miniIMFS) && \ |
---|
288 | defined(CONFIGURE_FILESYSTEM_MINIIMFS) |
---|
289 | #define CONFIGURE_FILESYSTEM_ENTRY_miniIMFS \ |
---|
290 | { RTEMS_FILESYSTEM_TYPE_MINIIMFS, miniIMFS_initialize } |
---|
291 | #endif |
---|
292 | |
---|
293 | /** |
---|
294 | * This defines the IMFS file system table entry. |
---|
295 | */ |
---|
296 | #if !defined(CONFIGURE_FILESYSTEM_ENTRY_IMFS) && \ |
---|
297 | defined(CONFIGURE_FILESYSTEM_IMFS) |
---|
298 | #define CONFIGURE_FILESYSTEM_ENTRY_IMFS { "imfs", IMFS_initialize } |
---|
299 | #endif |
---|
300 | |
---|
301 | /** |
---|
302 | * DEVFS |
---|
303 | */ |
---|
304 | #if !defined(CONFIGURE_FILESYSTEM_ENTRY_DEVFS) && \ |
---|
305 | defined(CONFIGURE_FILESYSTEM_DEVFS) |
---|
306 | #include <rtems/devfs.h> |
---|
307 | #define CONFIGURE_FILESYSTEM_ENTRY_DEVFS \ |
---|
308 | { RTEMS_FILESYSTEM_TYPE_DEVFS, devFS_initialize } |
---|
309 | #endif |
---|
310 | |
---|
311 | #ifdef RTEMS_NETWORKING |
---|
312 | /** |
---|
313 | * FTPFS |
---|
314 | */ |
---|
315 | #if !defined(CONFIGURE_FILESYSTEM_ENTRY_FTPFS) && \ |
---|
316 | defined(CONFIGURE_FILESYSTEM_FTPFS) |
---|
317 | #include <rtems/ftpfs.h> |
---|
318 | #define CONFIGURE_FILESYSTEM_ENTRY_FTPFS \ |
---|
319 | { RTEMS_FILESYSTEM_TYPE_FTPFS, rtems_ftpfs_initialize } |
---|
320 | #endif |
---|
321 | |
---|
322 | /** |
---|
323 | * TFTPFS |
---|
324 | */ |
---|
325 | #if !defined(CONFIGURE_FILESYSTEM_ENTRY_TFTPFS) && \ |
---|
326 | defined(CONFIGURE_FILESYSTEM_TFTPFS) |
---|
327 | #include <rtems/tftp.h> |
---|
328 | #define CONFIGURE_FILESYSTEM_ENTRY_TFTPFS \ |
---|
329 | { RTEMS_FILESYSTEM_TYPE_TFTPFS, rtems_tftpfs_initialize } |
---|
330 | #endif |
---|
331 | |
---|
332 | /** |
---|
333 | * NFS |
---|
334 | */ |
---|
335 | #if !defined(CONFIGURE_FILESYSTEM_ENTRY_NFS) && \ |
---|
336 | defined(CONFIGURE_FILESYSTEM_NFS) |
---|
337 | #include <librtemsNfs.h> |
---|
338 | #define CONFIGURE_FILESYSTEM_ENTRY_NFS \ |
---|
339 | { RTEMS_FILESYSTEM_TYPE_NFS, rtems_nfs_initialize } |
---|
340 | #endif |
---|
341 | #endif |
---|
342 | |
---|
343 | /** |
---|
344 | * DOSFS |
---|
345 | */ |
---|
346 | #if !defined(CONFIGURE_FILESYSTEM_ENTRY_DOSFS) && \ |
---|
347 | defined(CONFIGURE_FILESYSTEM_DOSFS) |
---|
348 | #include <rtems/dosfs.h> |
---|
349 | #define CONFIGURE_FILESYSTEM_ENTRY_DOSFS \ |
---|
350 | { RTEMS_FILESYSTEM_TYPE_DOSFS, rtems_dosfs_initialize } |
---|
351 | #endif |
---|
352 | |
---|
353 | /** |
---|
354 | * RFS |
---|
355 | */ |
---|
356 | #if !defined(CONFIGURE_FILESYSTEM_ENTRY_RFS) && \ |
---|
357 | defined(CONFIGURE_FILESYSTEM_RFS) |
---|
358 | #include <rtems/rtems-rfs.h> |
---|
359 | #define CONFIGURE_FILESYSTEM_ENTRY_RFS \ |
---|
360 | { RTEMS_FILESYSTEM_TYPE_RFS, rtems_rfs_rtems_initialise } |
---|
361 | #endif |
---|
362 | |
---|
363 | #ifdef CONFIGURE_INIT |
---|
364 | |
---|
365 | /* |
---|
366 | * DEVFS variables. |
---|
367 | */ |
---|
368 | #if defined(CONFIGURE_APPLICATION_DISABLE_FILESYSTEM) |
---|
369 | #define CONFIGURE_MEMORY_FOR_DEVFS 0 |
---|
370 | #elif defined(CONFIGURE_FILESYSTEM_DEVFS) |
---|
371 | #ifndef CONFIGURE_MAXIMUM_DEVICES |
---|
372 | #define CONFIGURE_MAXIMUM_DEVICES 4 |
---|
373 | #endif |
---|
374 | #include <rtems/devfs.h> |
---|
375 | uint32_t rtems_device_table_size = CONFIGURE_MAXIMUM_DEVICES; |
---|
376 | #define CONFIGURE_MEMORY_FOR_DEVFS \ |
---|
377 | _Configure_Object_RAM(CONFIGURE_MAXIMUM_DEVICES, \ |
---|
378 | sizeof (rtems_device_name_t)) |
---|
379 | #else |
---|
380 | #define CONFIGURE_MEMORY_FOR_DEVFS 0 |
---|
381 | #endif |
---|
382 | |
---|
383 | #if defined(CONFIGURE_FILESYSTEM_IMFS) || \ |
---|
384 | defined(CONFIGURE_FILESYSTEM_MINIIMFS) |
---|
385 | int imfs_rq_memfile_bytes_per_block = CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK; |
---|
386 | #endif |
---|
387 | |
---|
388 | /** |
---|
389 | * Table termination record. |
---|
390 | */ |
---|
391 | #define CONFIGURE_FILESYSTEM_NULL { NULL, NULL } |
---|
392 | |
---|
393 | /** |
---|
394 | * The default file system table. Must be terminated with the NULL entry if |
---|
395 | * you provide your own. |
---|
396 | */ |
---|
397 | #ifndef CONFIGURE_HAS_OWN_FILESYSTEM_TABLE |
---|
398 | const rtems_filesystem_table_t rtems_filesystem_table[] = { |
---|
399 | #if defined(CONFIGURE_FILESYSTEM_MINIIMFS) && \ |
---|
400 | defined(CONFIGURE_FILESYSTEM_ENTRY_miniIMFS) |
---|
401 | CONFIGURE_FILESYSTEM_ENTRY_miniIMFS, |
---|
402 | #endif |
---|
403 | #if defined(CONFIGURE_FILESYSTEM_IMFS) && \ |
---|
404 | defined(CONFIGURE_FILESYSTEM_ENTRY_IMFS) |
---|
405 | CONFIGURE_FILESYSTEM_ENTRY_IMFS, |
---|
406 | #endif |
---|
407 | #if defined(CONFIGURE_FILESYSTEM_DEVFS) && \ |
---|
408 | defined(CONFIGURE_FILESYSTEM_ENTRY_DEVFS) |
---|
409 | CONFIGURE_FILESYSTEM_ENTRY_DEVFS, |
---|
410 | #endif |
---|
411 | #if defined(CONFIGURE_FILESYSTEM_TFTPFS) && \ |
---|
412 | defined(CONFIGURE_FILESYSTEM_ENTRY_TFTPFS) |
---|
413 | CONFIGURE_FILESYSTEM_ENTRY_TFTPFS, |
---|
414 | #endif |
---|
415 | #if defined(CONFIGURE_FILESYSTEM_FTPFS) && \ |
---|
416 | defined(CONFIGURE_FILESYSTEM_ENTRY_FTPFS) |
---|
417 | CONFIGURE_FILESYSTEM_ENTRY_FTPFS, |
---|
418 | #endif |
---|
419 | #if defined(CONFIGURE_FILESYSTEM_NFS) && \ |
---|
420 | defined(CONFIGURE_FILESYSTEM_ENTRY_NFS) |
---|
421 | CONFIGURE_FILESYSTEM_ENTRY_NFS, |
---|
422 | #endif |
---|
423 | #if defined(CONFIGURE_FILESYSTEM_DOSFS) && \ |
---|
424 | defined(CONFIGURE_FILESYSTEM_ENTRY_DOSFS) |
---|
425 | CONFIGURE_FILESYSTEM_ENTRY_DOSFS, |
---|
426 | #endif |
---|
427 | #if defined(CONFIGURE_FILESYSTEM_RFS) && \ |
---|
428 | defined(CONFIGURE_FILESYSTEM_ENTRY_RFS) |
---|
429 | CONFIGURE_FILESYSTEM_ENTRY_RFS, |
---|
430 | #endif |
---|
431 | CONFIGURE_FILESYSTEM_NULL |
---|
432 | }; |
---|
433 | #endif |
---|
434 | |
---|
435 | /** |
---|
436 | * This disables the inclusion of pipe support in the full IMFS. |
---|
437 | * |
---|
438 | * NOTE: When building for coverage, we need this variable all the time. |
---|
439 | */ |
---|
440 | #if !defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM) || \ |
---|
441 | defined(RTEMS_COVERAGE) |
---|
442 | #if defined(CONFIGURE_PIPES_ENABLED) |
---|
443 | bool rtems_pipe_configured = true; |
---|
444 | #else |
---|
445 | bool rtems_pipe_configured = false; |
---|
446 | #endif |
---|
447 | #endif |
---|
448 | |
---|
449 | #ifndef CONFIGURE_HAS_OWN_MOUNT_TABLE |
---|
450 | const rtems_filesystem_mount_table_t configuration_mount_table = { |
---|
451 | #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM) |
---|
452 | RTEMS_FILESYSTEM_TYPE_DEVFS, |
---|
453 | #elif defined(CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM) |
---|
454 | RTEMS_FILESYSTEM_TYPE_MINIIMFS, |
---|
455 | #else /* using IMFS as base filesystem */ |
---|
456 | RTEMS_FILESYSTEM_TYPE_IMFS, |
---|
457 | #endif |
---|
458 | RTEMS_FILESYSTEM_READ_WRITE, |
---|
459 | NULL, |
---|
460 | NULL |
---|
461 | }; |
---|
462 | |
---|
463 | const rtems_filesystem_mount_table_t |
---|
464 | *rtems_filesystem_mount_table = &configuration_mount_table; |
---|
465 | const int rtems_filesystem_mount_table_size = 1; |
---|
466 | #endif |
---|
467 | |
---|
468 | #endif |
---|
469 | |
---|
470 | /* |
---|
471 | * STACK_CHECER_ON was still available in 4.9 so give a warning for now. |
---|
472 | */ |
---|
473 | #if defined(STACK_CHECKER_ON) |
---|
474 | #define CONFIGURE_STACK_CHECKER_ENABLED |
---|
475 | #warning "STACK_CHECKER_ON deprecated -- use CONFIGURE_STACK_CHECKER_ENABLED" |
---|
476 | #endif |
---|
477 | |
---|
478 | /** |
---|
479 | * This configures the stack checker user extension. |
---|
480 | */ |
---|
481 | #ifdef CONFIGURE_STACK_CHECKER_ENABLED |
---|
482 | #define CONFIGURE_STACK_CHECKER_EXTENSION 1 |
---|
483 | #else |
---|
484 | #define CONFIGURE_STACK_CHECKER_EXTENSION 0 |
---|
485 | #endif |
---|
486 | |
---|
487 | /** |
---|
488 | * @brief Maximum Priority configuration |
---|
489 | * |
---|
490 | * This configures the maximum priority value that |
---|
491 | * a task may have. |
---|
492 | * |
---|
493 | * By reducing the number of priorities in a system, |
---|
494 | * the amount of RAM required by RTEMS can be significantly |
---|
495 | * reduced. RTEMS allocates a Chain_Control structure per |
---|
496 | * priority and this structure contains 3 pointers. So |
---|
497 | * the default is (256 * 12) = 3K on 32-bit architectures. |
---|
498 | * |
---|
499 | * This must be one less than a power of 2 between |
---|
500 | * 4 and 256. Valid values along with the application |
---|
501 | * priority levels and memory saved when pointers are |
---|
502 | * 32-bits in size are: |
---|
503 | * |
---|
504 | * + 3, 2 application priorities, 3024 bytes saved |
---|
505 | * + 7, 5 application priorities, 2976 bytes saved |
---|
506 | * + 15, 13 application priorities, 2880 bytes saved |
---|
507 | * + 31, 29 application priorities, 2688 bytes saved |
---|
508 | * + 63, 61 application priorities, 2304 bytes saved |
---|
509 | * + 127, 125 application priorities, 1536 bytes saved |
---|
510 | * + 255, 253 application priorities, 0 bytes saved |
---|
511 | * |
---|
512 | * It is specified in terms of Classic API |
---|
513 | * priority values. |
---|
514 | */ |
---|
515 | #ifndef CONFIGURE_MAXIMUM_PRIORITY |
---|
516 | #define CONFIGURE_MAXIMUM_PRIORITY PRIORITY_DEFAULT_MAXIMUM |
---|
517 | #endif |
---|
518 | |
---|
519 | /* |
---|
520 | * If you said the IDLE task was going to do application initialization |
---|
521 | * and didn't override the IDLE body, then something is amiss. |
---|
522 | */ |
---|
523 | #if (defined(CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION) && \ |
---|
524 | !defined(CONFIGURE_IDLE_TASK_BODY)) |
---|
525 | #error "CONFIGURE_ERROR: You did not override the IDLE task body." |
---|
526 | #endif |
---|
527 | |
---|
528 | /** |
---|
529 | * @brief Idle task body configuration |
---|
530 | * |
---|
531 | * There is a default IDLE thread body provided by RTEMS which |
---|
532 | * has the possibility of being CPU specific. There may be a |
---|
533 | * BSP specific override of the RTEMS default body and in turn, |
---|
534 | * the application may override and provide its own. |
---|
535 | */ |
---|
536 | #ifndef CONFIGURE_IDLE_TASK_BODY |
---|
537 | #if defined(BSP_IDLE_TASK_BODY) |
---|
538 | #define CONFIGURE_IDLE_TASK_BODY BSP_IDLE_TASK_BODY |
---|
539 | #elif (CPU_PROVIDES_IDLE_THREAD_BODY == TRUE) |
---|
540 | #define CONFIGURE_IDLE_TASK_BODY _CPU_Thread_Idle_body |
---|
541 | #else |
---|
542 | /* only instantiate and compile if used */ |
---|
543 | #ifdef CONFIGURE_INIT |
---|
544 | void *_Thread_Idle_body(uintptr_t ignored) |
---|
545 | { |
---|
546 | for( ; ; ) ; |
---|
547 | return 0; /* to avoid warning */ |
---|
548 | } |
---|
549 | #endif |
---|
550 | #define CONFIGURE_IDLE_TASK_BODY _Thread_Idle_body |
---|
551 | #endif |
---|
552 | #endif |
---|
553 | |
---|
554 | /** |
---|
555 | * By default, use the minimum stack size requested by this port. |
---|
556 | */ |
---|
557 | #ifndef CONFIGURE_MINIMUM_TASK_STACK_SIZE |
---|
558 | #define CONFIGURE_MINIMUM_TASK_STACK_SIZE CPU_STACK_MINIMUM_SIZE |
---|
559 | #endif |
---|
560 | |
---|
561 | /** |
---|
562 | * @brief Idle task stack size configuration |
---|
563 | * |
---|
564 | * By default, the IDLE task will have a stack of minimum size. |
---|
565 | * The BSP or application may override this value. |
---|
566 | */ |
---|
567 | #ifndef CONFIGURE_IDLE_TASK_STACK_SIZE |
---|
568 | #ifdef BSP_IDLE_TASK_STACK_SIZE |
---|
569 | #define CONFIGURE_IDLE_TASK_STACK_SIZE BSP_IDLE_TASK_STACK_SIZE |
---|
570 | #else |
---|
571 | #define CONFIGURE_IDLE_TASK_STACK_SIZE CONFIGURE_MINIMUM_TASK_STACK_SIZE |
---|
572 | #endif |
---|
573 | #endif |
---|
574 | |
---|
575 | /** |
---|
576 | * @brief Interrupt stack size configuration |
---|
577 | * |
---|
578 | * By default, the interrupt stack will be of minimum size. |
---|
579 | * The BSP or application may override this value. |
---|
580 | */ |
---|
581 | #ifndef CONFIGURE_INTERRUPT_STACK_SIZE |
---|
582 | #ifdef BSP_INTERRUPT_STACK_SIZE |
---|
583 | #define CONFIGURE_INTERRUPT_STACK_SIZE BSP_INTERRUPT_STACK_SIZE |
---|
584 | #else |
---|
585 | #define CONFIGURE_INTERRUPT_STACK_SIZE CONFIGURE_MINIMUM_TASK_STACK_SIZE |
---|
586 | #endif |
---|
587 | #endif |
---|
588 | |
---|
589 | /** |
---|
590 | * This reserves memory for the interrupt stack if it is to be allocated |
---|
591 | * by RTEMS rather than the BSP. |
---|
592 | * |
---|
593 | * @todo Try to get to the point where all BSPs support allocating the |
---|
594 | * memory from the Workspace. |
---|
595 | */ |
---|
596 | #if (CPU_ALLOCATE_INTERRUPT_STACK == 0) |
---|
597 | #define CONFIGURE_INTERRUPT_STACK_MEMORY 0 |
---|
598 | #else |
---|
599 | #define CONFIGURE_INTERRUPT_STACK_MEMORY \ |
---|
600 | _Configure_From_workspace( CONFIGURE_INTERRUPT_STACK_SIZE ) |
---|
601 | #endif |
---|
602 | |
---|
603 | /** |
---|
604 | * Configure the very much optional task stack allocator |
---|
605 | */ |
---|
606 | #ifndef CONFIGURE_TASK_STACK_ALLOCATOR |
---|
607 | #define CONFIGURE_TASK_STACK_ALLOCATOR NULL |
---|
608 | #endif |
---|
609 | |
---|
610 | /** |
---|
611 | * Configure the very much optional task stack deallocator |
---|
612 | */ |
---|
613 | #ifndef CONFIGURE_TASK_STACK_DEALLOCATOR |
---|
614 | #define CONFIGURE_TASK_STACK_DEALLOCATOR NULL |
---|
615 | #endif |
---|
616 | |
---|
617 | /** |
---|
618 | * Should the RTEMS Workspace and C Program Heap be cleared automatically |
---|
619 | * at system start up? |
---|
620 | */ |
---|
621 | #ifndef CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY |
---|
622 | #ifdef BSP_ZERO_WORKSPACE_AUTOMATICALLY |
---|
623 | #define CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY \ |
---|
624 | BSP_ZERO_WORKSPACE_AUTOMATICALLY |
---|
625 | #else |
---|
626 | #define CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY FALSE |
---|
627 | #endif |
---|
628 | #endif |
---|
629 | |
---|
630 | /* |
---|
631 | * RTEMS Malloc configuration |
---|
632 | */ |
---|
633 | |
---|
634 | #include <rtems/malloc.h> |
---|
635 | |
---|
636 | #ifdef CONFIGURE_INIT |
---|
637 | /** |
---|
638 | * By default, RTEMS uses separate heaps for the RTEMS Workspace and |
---|
639 | * the C Program Heap. On many BSPs, these can be optionally |
---|
640 | * combined provided one larger memory pool. This is particularly |
---|
641 | * useful in combination with the unlimited objects configuration. |
---|
642 | */ |
---|
643 | #ifdef CONFIGURE_UNIFIED_WORK_AREAS |
---|
644 | #include <rtems/score/wkspace.h> |
---|
645 | Heap_Control *RTEMS_Malloc_Heap = &_Workspace_Area; |
---|
646 | bool rtems_unified_work_area = true; |
---|
647 | #else |
---|
648 | Heap_Control RTEMS_Malloc_Area; |
---|
649 | Heap_Control *RTEMS_Malloc_Heap = &RTEMS_Malloc_Area; |
---|
650 | bool rtems_unified_work_area = false; |
---|
651 | #endif |
---|
652 | #endif |
---|
653 | |
---|
654 | #ifdef CONFIGURE_INIT |
---|
655 | /** |
---|
656 | * This configures the malloc family statistics to be available. |
---|
657 | * By default only function call counts are kept. |
---|
658 | */ |
---|
659 | rtems_malloc_statistics_functions_t *rtems_malloc_statistics_helpers = |
---|
660 | #ifndef CONFIGURE_MALLOC_STATISTICS |
---|
661 | NULL; |
---|
662 | #else |
---|
663 | &rtems_malloc_statistics_helpers_table; |
---|
664 | #endif |
---|
665 | #endif |
---|
666 | |
---|
667 | #ifdef CONFIGURE_INIT |
---|
668 | /** |
---|
669 | * This configures the sbrk() support for the malloc family. |
---|
670 | * By default it is assumed that the BSP provides all available |
---|
671 | * RAM to the malloc family implementation so sbrk()'ing to get |
---|
672 | * more memory would always fail anyway. |
---|
673 | */ |
---|
674 | rtems_malloc_sbrk_functions_t *rtems_malloc_sbrk_helpers = |
---|
675 | #ifndef CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK |
---|
676 | NULL; |
---|
677 | #else |
---|
678 | &rtems_malloc_sbrk_helpers_table; |
---|
679 | #endif |
---|
680 | #endif |
---|
681 | |
---|
682 | #ifdef CONFIGURE_INIT |
---|
683 | /** |
---|
684 | * This configures the malloc family plugin which dirties memory |
---|
685 | * allocated. This is helpful for finding unitialized data structure |
---|
686 | * problems. |
---|
687 | */ |
---|
688 | rtems_malloc_dirtier_t rtems_malloc_dirty_helper = |
---|
689 | #if defined(CONFIGURE_MALLOC_DIRTY) |
---|
690 | rtems_malloc_dirty_memory; |
---|
691 | #else |
---|
692 | NULL; |
---|
693 | #endif |
---|
694 | #endif |
---|
695 | |
---|
696 | /** |
---|
697 | * This is a helper macro used in calculations in this file. It is used |
---|
698 | * to noted when an element is allocated from the RTEMS Workspace and adds |
---|
699 | * a factor to account for heap overhead plus an alignment factor that |
---|
700 | * may be applied. |
---|
701 | */ |
---|
702 | #define _Configure_From_workspace(_size) \ |
---|
703 | (ssize_t)((_size) + (2 * sizeof(uint32_t)) + CPU_ALIGNMENT) |
---|
704 | |
---|
705 | /** |
---|
706 | * Do not use the unlimited bit as part of the multiplication |
---|
707 | * for memory usage. |
---|
708 | */ |
---|
709 | #define _Configure_Max_Objects(_max) \ |
---|
710 | ((_max) & ~RTEMS_UNLIMITED_OBJECTS) |
---|
711 | |
---|
712 | /** |
---|
713 | * This macro accounts for how memory for a set of configured objects is |
---|
714 | * allocated from the Executive Workspace. |
---|
715 | * |
---|
716 | * NOTE: It does NOT attempt to address the more complex case of unlimited |
---|
717 | * objects. |
---|
718 | */ |
---|
719 | #define _Configure_Object_RAM(_number, _size) \ |
---|
720 | ( _Configure_From_workspace(_Configure_Max_Objects(_number) * (_size)) + \ |
---|
721 | _Configure_From_workspace( \ |
---|
722 | ((_Configure_Max_Objects(_number) + 1) * sizeof(Objects_Control *)) + \ |
---|
723 | (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) \ |
---|
724 | ) \ |
---|
725 | ) |
---|
726 | |
---|
727 | /* |
---|
728 | * Default User Initialization Task Table. This table guarantees that |
---|
729 | * one user initialization table is defined. |
---|
730 | */ |
---|
731 | |
---|
732 | #ifdef CONFIGURE_RTEMS_INIT_TASKS_TABLE |
---|
733 | |
---|
734 | #ifdef CONFIGURE_HAS_OWN_INIT_TASK_TABLE |
---|
735 | |
---|
736 | /* |
---|
737 | * The user is defining their own table information and setting the |
---|
738 | * appropriate variables. |
---|
739 | */ |
---|
740 | |
---|
741 | #else |
---|
742 | |
---|
743 | #ifndef CONFIGURE_INIT_TASK_NAME |
---|
744 | #define CONFIGURE_INIT_TASK_NAME rtems_build_name('U', 'I', '1', ' ') |
---|
745 | #endif |
---|
746 | |
---|
747 | #ifndef CONFIGURE_INIT_TASK_STACK_SIZE |
---|
748 | #define CONFIGURE_INIT_TASK_STACK_SIZE CONFIGURE_MINIMUM_TASK_STACK_SIZE |
---|
749 | #endif |
---|
750 | |
---|
751 | #ifndef CONFIGURE_INIT_TASK_PRIORITY |
---|
752 | #define CONFIGURE_INIT_TASK_PRIORITY 1 |
---|
753 | #endif |
---|
754 | |
---|
755 | #ifndef CONFIGURE_INIT_TASK_ATTRIBUTES |
---|
756 | #define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_DEFAULT_ATTRIBUTES |
---|
757 | #endif |
---|
758 | |
---|
759 | #ifndef CONFIGURE_INIT_TASK_ENTRY_POINT |
---|
760 | #ifdef __cplusplus |
---|
761 | extern "C" { |
---|
762 | #endif |
---|
763 | rtems_task Init (rtems_task_argument ); |
---|
764 | #ifdef __cplusplus |
---|
765 | } |
---|
766 | #endif |
---|
767 | #define CONFIGURE_INIT_TASK_ENTRY_POINT Init |
---|
768 | extern const char* bsp_boot_cmdline; |
---|
769 | #define CONFIGURE_INIT_TASK_ARGUMENTS ((rtems_task_argument) &bsp_boot_cmdline) |
---|
770 | #endif |
---|
771 | |
---|
772 | #ifndef CONFIGURE_INIT_TASK_INITIAL_MODES |
---|
773 | #define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_NO_PREEMPT |
---|
774 | #endif |
---|
775 | |
---|
776 | #ifndef CONFIGURE_INIT_TASK_ARGUMENTS |
---|
777 | #define CONFIGURE_INIT_TASK_ARGUMENTS 0 |
---|
778 | #endif |
---|
779 | |
---|
780 | #ifdef CONFIGURE_INIT |
---|
781 | rtems_initialization_tasks_table Initialization_tasks[] = { |
---|
782 | { CONFIGURE_INIT_TASK_NAME, |
---|
783 | CONFIGURE_INIT_TASK_STACK_SIZE, |
---|
784 | CONFIGURE_INIT_TASK_PRIORITY, |
---|
785 | CONFIGURE_INIT_TASK_ATTRIBUTES, |
---|
786 | CONFIGURE_INIT_TASK_ENTRY_POINT, |
---|
787 | CONFIGURE_INIT_TASK_INITIAL_MODES, |
---|
788 | CONFIGURE_INIT_TASK_ARGUMENTS |
---|
789 | } |
---|
790 | }; |
---|
791 | #endif |
---|
792 | |
---|
793 | #define CONFIGURE_INIT_TASK_TABLE Initialization_tasks |
---|
794 | |
---|
795 | #define CONFIGURE_INIT_TASK_TABLE_SIZE \ |
---|
796 | sizeof(CONFIGURE_INIT_TASK_TABLE) / sizeof(rtems_initialization_tasks_table) |
---|
797 | |
---|
798 | #endif /* CONFIGURE_HAS_OWN_INIT_TASK_TABLE */ |
---|
799 | |
---|
800 | #else /* CONFIGURE_RTEMS_INIT_TASKS_TABLE */ |
---|
801 | |
---|
802 | #define CONFIGURE_INIT_TASK_TABLE NULL |
---|
803 | #define CONFIGURE_INIT_TASK_TABLE_SIZE 0 |
---|
804 | #define CONFIGURE_INIT_TASK_STACK_SIZE 0 |
---|
805 | |
---|
806 | #endif |
---|
807 | |
---|
808 | /* |
---|
809 | * Default Device Driver Table. Each driver needed by the test is explicitly |
---|
810 | * choosen by that test. There is always a null driver entry. |
---|
811 | */ |
---|
812 | |
---|
813 | #define NULL_DRIVER_TABLE_ENTRY \ |
---|
814 | { NULL, NULL, NULL, NULL, NULL, NULL } |
---|
815 | |
---|
816 | #ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
---|
817 | #include <rtems/console.h> |
---|
818 | #endif |
---|
819 | |
---|
820 | #ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER |
---|
821 | #include <rtems/clockdrv.h> |
---|
822 | #endif |
---|
823 | |
---|
824 | #ifdef CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER |
---|
825 | #include <rtems/timerdrv.h> |
---|
826 | #endif |
---|
827 | |
---|
828 | #ifdef CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER |
---|
829 | #include <rtems/rtc.h> |
---|
830 | #endif |
---|
831 | |
---|
832 | #ifdef CONFIGURE_APPLICATION_NEEDS_WATCHDOG_DRIVER |
---|
833 | #include <rtems/watchdogdrv.h> |
---|
834 | #endif |
---|
835 | |
---|
836 | #ifdef CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER |
---|
837 | #include <rtems/framebuffer.h> |
---|
838 | #endif |
---|
839 | |
---|
840 | #ifdef CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER |
---|
841 | #include <rtems/devnull.h> |
---|
842 | #endif |
---|
843 | |
---|
844 | #ifdef CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER |
---|
845 | /* the ide driver needs the ATA driver */ |
---|
846 | #ifndef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER |
---|
847 | #define CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER |
---|
848 | #endif |
---|
849 | #include <libchip/ide_ctrl.h> |
---|
850 | #endif |
---|
851 | |
---|
852 | #ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER |
---|
853 | #include <libchip/ata.h> |
---|
854 | #endif |
---|
855 | |
---|
856 | #ifndef CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE |
---|
857 | |
---|
858 | #ifdef CONFIGURE_INIT |
---|
859 | rtems_driver_address_table Device_drivers[] = { |
---|
860 | #ifdef CONFIGURE_BSP_PREREQUISITE_DRIVERS |
---|
861 | CONFIGURE_BSP_PREREQUISITE_DRIVERS, |
---|
862 | #endif |
---|
863 | #ifdef CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS |
---|
864 | CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS, |
---|
865 | #endif |
---|
866 | #ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
---|
867 | CONSOLE_DRIVER_TABLE_ENTRY, |
---|
868 | #endif |
---|
869 | #ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER |
---|
870 | CLOCK_DRIVER_TABLE_ENTRY, |
---|
871 | #endif |
---|
872 | #ifdef CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER |
---|
873 | RTC_DRIVER_TABLE_ENTRY, |
---|
874 | #endif |
---|
875 | #ifdef CONFIGURE_APPLICATION_NEEDS_WATCHDOG_DRIVER |
---|
876 | WATCHDOG_DRIVER_TABLE_ENTRY, |
---|
877 | #endif |
---|
878 | #ifdef CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER |
---|
879 | DEVNULL_DRIVER_TABLE_ENTRY, |
---|
880 | #endif |
---|
881 | #ifdef CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER |
---|
882 | IDE_CONTROLLER_DRIVER_TABLE_ENTRY, |
---|
883 | #endif |
---|
884 | #ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER |
---|
885 | ATA_DRIVER_TABLE_ENTRY, |
---|
886 | #endif |
---|
887 | #ifdef CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER |
---|
888 | FRAME_BUFFER_DRIVER_TABLE_ENTRY, |
---|
889 | #endif |
---|
890 | #ifdef CONFIGURE_APPLICATION_EXTRA_DRIVERS |
---|
891 | CONFIGURE_APPLICATION_EXTRA_DRIVERS, |
---|
892 | #endif |
---|
893 | #ifdef CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER |
---|
894 | NULL_DRIVER_TABLE_ENTRY |
---|
895 | #elif !defined(CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER) && \ |
---|
896 | !defined(CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER) && \ |
---|
897 | !defined(CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER) && \ |
---|
898 | !defined(CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER) && \ |
---|
899 | !defined(CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER) && \ |
---|
900 | !defined(CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER) && \ |
---|
901 | !defined(CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER) && \ |
---|
902 | !defined(CONFIGURE_APPLICATION_EXTRA_DRIVERS) |
---|
903 | NULL_DRIVER_TABLE_ENTRY |
---|
904 | #endif |
---|
905 | }; |
---|
906 | #endif |
---|
907 | |
---|
908 | #endif /* CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE */ |
---|
909 | |
---|
910 | /* |
---|
911 | * Default the number of drivers per node. This value may be |
---|
912 | * overridden by the user. |
---|
913 | */ |
---|
914 | |
---|
915 | #define CONFIGURE_NUMBER_OF_DRIVERS \ |
---|
916 | ((sizeof(Device_drivers) / sizeof(rtems_driver_address_table))) |
---|
917 | |
---|
918 | /** |
---|
919 | * This specifies the maximum number of device drivers that |
---|
920 | * can be installed in the system at one time. It must account |
---|
921 | * for both the statically and dynamically installed drivers. |
---|
922 | */ |
---|
923 | #ifndef CONFIGURE_MAXIMUM_DRIVERS |
---|
924 | #define CONFIGURE_MAXIMUM_DRIVERS CONFIGURE_NUMBER_OF_DRIVERS |
---|
925 | #endif |
---|
926 | |
---|
927 | |
---|
928 | #ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER |
---|
929 | /* |
---|
930 | * configure the priority of the ATA driver task |
---|
931 | */ |
---|
932 | #ifndef CONFIGURE_ATA_DRIVER_TASK_PRIORITY |
---|
933 | #define CONFIGURE_ATA_DRIVER_TASK_PRIORITY ATA_DRIVER_TASK_DEFAULT_PRIORITY |
---|
934 | #endif |
---|
935 | #ifdef CONFIGURE_INIT |
---|
936 | rtems_task_priority rtems_ata_driver_task_priority |
---|
937 | = CONFIGURE_ATA_DRIVER_TASK_PRIORITY; |
---|
938 | #endif /* CONFIGURE_INIT */ |
---|
939 | #endif |
---|
940 | |
---|
941 | /* |
---|
942 | * add bdbuf configuration and values for swapout task priority |
---|
943 | */ |
---|
944 | #ifdef CONFIGURE_APPLICATION_NEEDS_LIBBLOCK |
---|
945 | #include <rtems/bdbuf.h> |
---|
946 | /* |
---|
947 | * configure the bdbuf cache parameters |
---|
948 | */ |
---|
949 | #ifndef CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS |
---|
950 | #define CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS \ |
---|
951 | RTEMS_BDBUF_MAX_READ_AHEAD_BLOCKS_DEFAULT |
---|
952 | #endif |
---|
953 | #ifndef CONFIGURE_BDBUF_MAX_WRITE_BLOCKS |
---|
954 | #define CONFIGURE_BDBUF_MAX_WRITE_BLOCKS \ |
---|
955 | RTEMS_BDBUF_MAX_WRITE_BLOCKS_DEFAULT |
---|
956 | #endif |
---|
957 | #ifndef CONFIGURE_SWAPOUT_TASK_PRIORITY |
---|
958 | #define CONFIGURE_SWAPOUT_TASK_PRIORITY \ |
---|
959 | RTEMS_BDBUF_SWAPOUT_TASK_PRIORITY_DEFAULT |
---|
960 | #endif |
---|
961 | #ifndef CONFIGURE_SWAPOUT_SWAP_PERIOD |
---|
962 | #define CONFIGURE_SWAPOUT_SWAP_PERIOD \ |
---|
963 | RTEMS_BDBUF_SWAPOUT_TASK_SWAP_PERIOD_DEFAULT |
---|
964 | #endif |
---|
965 | #ifndef CONFIGURE_SWAPOUT_BLOCK_HOLD |
---|
966 | #define CONFIGURE_SWAPOUT_BLOCK_HOLD \ |
---|
967 | RTEMS_BDBUF_SWAPOUT_TASK_BLOCK_HOLD_DEFAULT |
---|
968 | #endif |
---|
969 | #ifndef CONFIGURE_SWAPOUT_WORKER_TASKS |
---|
970 | #define CONFIGURE_SWAPOUT_WORKER_TASKS \ |
---|
971 | RTEMS_BDBUF_SWAPOUT_WORKER_TASKS_DEFAULT |
---|
972 | #endif |
---|
973 | #ifndef CONFIGURE_SWAPOUT_WORKER_TASK_PRIORITY |
---|
974 | #define CONFIGURE_SWAPOUT_WORKER_TASK_PRIORITY \ |
---|
975 | RTEMS_BDBUF_SWAPOUT_WORKER_TASK_PRIORITY_DEFAULT |
---|
976 | #endif |
---|
977 | #ifndef CONFIGURE_BDBUF_CACHE_MEMORY_SIZE |
---|
978 | #define CONFIGURE_BDBUF_CACHE_MEMORY_SIZE \ |
---|
979 | RTEMS_BDBUF_CACHE_MEMORY_SIZE_DEFAULT |
---|
980 | #endif |
---|
981 | #ifndef CONFIGURE_BDBUF_BUFFER_MIN_SIZE |
---|
982 | #define CONFIGURE_BDBUF_BUFFER_MIN_SIZE \ |
---|
983 | RTEMS_BDBUF_BUFFER_MIN_SIZE_DEFAULT |
---|
984 | #endif |
---|
985 | #ifndef CONFIGURE_BDBUF_BUFFER_MAX_SIZE |
---|
986 | #define CONFIGURE_BDBUF_BUFFER_MAX_SIZE \ |
---|
987 | RTEMS_BDBUF_BUFFER_MAX_SIZE_DEFAULT |
---|
988 | #endif |
---|
989 | #ifdef CONFIGURE_INIT |
---|
990 | const rtems_bdbuf_config rtems_bdbuf_configuration = { |
---|
991 | CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS, |
---|
992 | CONFIGURE_BDBUF_MAX_WRITE_BLOCKS, |
---|
993 | CONFIGURE_SWAPOUT_TASK_PRIORITY, |
---|
994 | CONFIGURE_SWAPOUT_SWAP_PERIOD, |
---|
995 | CONFIGURE_SWAPOUT_BLOCK_HOLD, |
---|
996 | CONFIGURE_SWAPOUT_WORKER_TASKS, |
---|
997 | CONFIGURE_SWAPOUT_WORKER_TASK_PRIORITY, |
---|
998 | CONFIGURE_BDBUF_CACHE_MEMORY_SIZE, |
---|
999 | CONFIGURE_BDBUF_BUFFER_MIN_SIZE, |
---|
1000 | CONFIGURE_BDBUF_BUFFER_MAX_SIZE |
---|
1001 | }; |
---|
1002 | #endif |
---|
1003 | |
---|
1004 | /* |
---|
1005 | * Semaphores: |
---|
1006 | * o disk lock |
---|
1007 | * o bdbuf lock |
---|
1008 | * o bdbuf sync lock |
---|
1009 | * o bdbuf access condition |
---|
1010 | * o bdbuf transfer condition |
---|
1011 | * o bdbuf buffer condition |
---|
1012 | */ |
---|
1013 | #define CONFIGURE_LIBBLOCK_SEMAPHORES 6 |
---|
1014 | |
---|
1015 | #if defined(CONFIGURE_HAS_OWN_BDBUF_TABLE) || \ |
---|
1016 | defined(CONFIGURE_BDBUF_BUFFER_SIZE) || \ |
---|
1017 | defined(CONFIGURE_BDBUF_BUFFER_COUNT) |
---|
1018 | #error BDBUF Cache does not use a buffer configuration table. Please remove. |
---|
1019 | #endif |
---|
1020 | #else |
---|
1021 | #define CONFIGURE_LIBBLOCK_SEMAPHORES 0 |
---|
1022 | #endif /* CONFIGURE_APPLICATION_NEEDS_LIBBLOCK */ |
---|
1023 | |
---|
1024 | #if defined(RTEMS_MULTIPROCESSING) |
---|
1025 | /* |
---|
1026 | * Default Multiprocessing Configuration Table. The defaults are |
---|
1027 | * appropriate for most of the RTEMS Multiprocessor Test Suite. Each |
---|
1028 | * value may be overridden within each test to customize the environment. |
---|
1029 | */ |
---|
1030 | |
---|
1031 | #ifdef CONFIGURE_MP_APPLICATION |
---|
1032 | #define CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER 1 |
---|
1033 | |
---|
1034 | #ifndef CONFIGURE_HAS_OWN_MULTIPROCESSING_TABLE |
---|
1035 | |
---|
1036 | #ifndef CONFIGURE_MP_NODE_NUMBER |
---|
1037 | #define CONFIGURE_MP_NODE_NUMBER NODE_NUMBER |
---|
1038 | #endif |
---|
1039 | |
---|
1040 | #ifndef CONFIGURE_MP_MAXIMUM_NODES |
---|
1041 | #define CONFIGURE_MP_MAXIMUM_NODES 2 |
---|
1042 | #endif |
---|
1043 | |
---|
1044 | #ifndef CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS |
---|
1045 | #define CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS 32 |
---|
1046 | #endif |
---|
1047 | #define CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS(_global_objects) \ |
---|
1048 | _Configure_Object_RAM((_global_objects), sizeof(Objects_MP_Control)) |
---|
1049 | |
---|
1050 | #ifndef CONFIGURE_MP_MAXIMUM_PROXIES |
---|
1051 | #define CONFIGURE_MP_MAXIMUM_PROXIES 32 |
---|
1052 | #endif |
---|
1053 | #define CONFIGURE_MEMORY_FOR_PROXIES(_proxies) \ |
---|
1054 | _Configure_Object_RAM((_proxies) + 1, sizeof(Thread_Proxy_control) ) |
---|
1055 | |
---|
1056 | #ifndef CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK |
---|
1057 | #define CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK 0 |
---|
1058 | #endif |
---|
1059 | |
---|
1060 | #ifndef CONFIGURE_MP_MPCI_TABLE_POINTER |
---|
1061 | #include <mpci.h> |
---|
1062 | #define CONFIGURE_MP_MPCI_TABLE_POINTER &MPCI_table |
---|
1063 | #endif |
---|
1064 | |
---|
1065 | #ifdef CONFIGURE_INIT |
---|
1066 | rtems_multiprocessing_table Multiprocessing_configuration = { |
---|
1067 | CONFIGURE_MP_NODE_NUMBER, /* local node number */ |
---|
1068 | CONFIGURE_MP_MAXIMUM_NODES, /* maximum # nodes */ |
---|
1069 | CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS, /* maximum # global objects */ |
---|
1070 | CONFIGURE_MP_MAXIMUM_PROXIES, /* maximum # proxies */ |
---|
1071 | CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK, /* MPCI stack > minimum */ |
---|
1072 | CONFIGURE_MP_MPCI_TABLE_POINTER /* ptr to MPCI config table */ |
---|
1073 | }; |
---|
1074 | #endif |
---|
1075 | |
---|
1076 | #define CONFIGURE_MULTIPROCESSING_TABLE &Multiprocessing_configuration |
---|
1077 | |
---|
1078 | #endif /* CONFIGURE_HAS_OWN_MULTIPROCESSING_TABLE */ |
---|
1079 | |
---|
1080 | #else |
---|
1081 | |
---|
1082 | #define CONFIGURE_MULTIPROCESSING_TABLE NULL |
---|
1083 | |
---|
1084 | #endif /* CONFIGURE_MP_APPLICATION */ |
---|
1085 | #endif /* RTEMS_MULTIPROCESSING */ |
---|
1086 | |
---|
1087 | #ifndef CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER |
---|
1088 | #define CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER 0 |
---|
1089 | #endif |
---|
1090 | |
---|
1091 | |
---|
1092 | /* |
---|
1093 | * Default Configuration Table. |
---|
1094 | */ |
---|
1095 | |
---|
1096 | #ifndef CONFIGURE_HAS_OWN_CONFIGURATION_TABLE |
---|
1097 | |
---|
1098 | #ifndef CONFIGURE_MAXIMUM_TASKS |
---|
1099 | #define CONFIGURE_MAXIMUM_TASKS 0 |
---|
1100 | #endif |
---|
1101 | |
---|
1102 | #ifndef CONFIGURE_DISABLE_CLASSIC_API_NOTEPADS |
---|
1103 | #define CONFIGURE_NOTEPADS_ENABLED TRUE |
---|
1104 | #else |
---|
1105 | #define CONFIGURE_NOTEPADS_ENABLED FALSE |
---|
1106 | #endif |
---|
1107 | |
---|
1108 | #ifndef CONFIGURE_DISABLE_CLASSIC_API_NOTEPADS |
---|
1109 | #define CONFIGURE_MEMORY_PER_TASK_FOR_CLASSIC_API \ |
---|
1110 | _Configure_From_workspace( sizeof(RTEMS_API_Control) ) |
---|
1111 | #else |
---|
1112 | #define CONFIGURE_MEMORY_PER_TASK_FOR_CLASSIC_API \ |
---|
1113 | _Configure_From_workspace( sizeof(RTEMS_API_Control) - \ |
---|
1114 | (RTEMS_NUMBER_NOTEPADS * sizeof(uint32_t))) |
---|
1115 | #endif |
---|
1116 | |
---|
1117 | /** |
---|
1118 | * This macro calculates the memory required for task variables. |
---|
1119 | * |
---|
1120 | * @note Each task variable is individually allocated from the Workspace. |
---|
1121 | * Hence, we do the multiplication on the configured size. |
---|
1122 | */ |
---|
1123 | #ifndef CONFIGURE_MAXIMUM_TASK_VARIABLES |
---|
1124 | #define CONFIGURE_MAXIMUM_TASK_VARIABLES 0 |
---|
1125 | #define CONFIGURE_MEMORY_FOR_TASK_VARIABLES(_task_variables) 0 |
---|
1126 | #else |
---|
1127 | #define CONFIGURE_MEMORY_FOR_TASK_VARIABLES(_task_variables) \ |
---|
1128 | (_task_variables) * \ |
---|
1129 | _Configure_From_workspace(sizeof(rtems_task_variable_t)) |
---|
1130 | #endif |
---|
1131 | |
---|
1132 | #ifndef CONFIGURE_MAXIMUM_TIMERS |
---|
1133 | #define CONFIGURE_MAXIMUM_TIMERS 0 |
---|
1134 | #define CONFIGURE_MEMORY_FOR_TIMERS(_timers) 0 |
---|
1135 | #else |
---|
1136 | #define CONFIGURE_MEMORY_FOR_TIMERS(_timers) \ |
---|
1137 | _Configure_Object_RAM(_timers, sizeof(Timer_Control) ) |
---|
1138 | #endif |
---|
1139 | |
---|
1140 | #ifndef CONFIGURE_MAXIMUM_SEMAPHORES |
---|
1141 | #define CONFIGURE_MAXIMUM_SEMAPHORES 0 |
---|
1142 | #endif |
---|
1143 | |
---|
1144 | #define CONFIGURE_SEMAPHORES \ |
---|
1145 | (CONFIGURE_MAXIMUM_SEMAPHORES + CONFIGURE_LIBIO_SEMAPHORES + \ |
---|
1146 | CONFIGURE_TERMIOS_SEMAPHORES + CONFIGURE_LIBBLOCK_SEMAPHORES) |
---|
1147 | |
---|
1148 | /* |
---|
1149 | * If there are no user or support semaphores defined, then we can assume |
---|
1150 | * that no memory need be allocated at all for semaphores. |
---|
1151 | */ |
---|
1152 | #if CONFIGURE_SEMAPHORES == 0 |
---|
1153 | #define CONFIGURE_MEMORY_FOR_SEMAPHORES(_semaphores) 0 |
---|
1154 | #else |
---|
1155 | #define CONFIGURE_MEMORY_FOR_SEMAPHORES(_semaphores) \ |
---|
1156 | _Configure_Object_RAM(_semaphores, sizeof(Semaphore_Control) ) |
---|
1157 | #endif |
---|
1158 | |
---|
1159 | #ifndef CONFIGURE_MAXIMUM_MESSAGE_QUEUES |
---|
1160 | #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 0 |
---|
1161 | #define CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(_queues) 0 |
---|
1162 | #else |
---|
1163 | #define CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(_queues) \ |
---|
1164 | _Configure_Object_RAM(_queues, sizeof(Message_queue_Control) ) |
---|
1165 | #endif |
---|
1166 | |
---|
1167 | #ifndef CONFIGURE_MAXIMUM_PARTITIONS |
---|
1168 | #define CONFIGURE_MAXIMUM_PARTITIONS 0 |
---|
1169 | #define CONFIGURE_MEMORY_FOR_PARTITIONS(_partitions) 0 |
---|
1170 | #else |
---|
1171 | #define CONFIGURE_MEMORY_FOR_PARTITIONS(_partitions) \ |
---|
1172 | _Configure_Object_RAM(_partitions, sizeof(Partition_Control) ) |
---|
1173 | #endif |
---|
1174 | |
---|
1175 | #ifndef CONFIGURE_MAXIMUM_REGIONS |
---|
1176 | #define CONFIGURE_MAXIMUM_REGIONS 0 |
---|
1177 | #define CONFIGURE_MEMORY_FOR_REGIONS(_regions) 0 |
---|
1178 | #else |
---|
1179 | #define CONFIGURE_MEMORY_FOR_REGIONS(_regions) \ |
---|
1180 | _Configure_Object_RAM(_regions, sizeof(Region_Control) ) |
---|
1181 | #endif |
---|
1182 | |
---|
1183 | #ifndef CONFIGURE_MAXIMUM_PORTS |
---|
1184 | #define CONFIGURE_MAXIMUM_PORTS 0 |
---|
1185 | #define CONFIGURE_MEMORY_FOR_PORTS(_ports) 0 |
---|
1186 | #else |
---|
1187 | #define CONFIGURE_MEMORY_FOR_PORTS(_ports) \ |
---|
1188 | _Configure_Object_RAM(_ports, sizeof(Dual_ported_memory_Control) ) |
---|
1189 | #endif |
---|
1190 | |
---|
1191 | #ifndef CONFIGURE_MAXIMUM_PERIODS |
---|
1192 | #define CONFIGURE_MAXIMUM_PERIODS 0 |
---|
1193 | #define CONFIGURE_MEMORY_FOR_PERIODS(_periods) 0 |
---|
1194 | #else |
---|
1195 | #define CONFIGURE_MEMORY_FOR_PERIODS(_periods) \ |
---|
1196 | _Configure_Object_RAM(_periods, sizeof(Rate_monotonic_Control) ) |
---|
1197 | #endif |
---|
1198 | |
---|
1199 | #ifndef CONFIGURE_MAXIMUM_BARRIERS |
---|
1200 | #define CONFIGURE_MAXIMUM_BARRIERS 0 |
---|
1201 | #define CONFIGURE_MEMORY_FOR_BARRIERS(_barriers) 0 |
---|
1202 | #else |
---|
1203 | #define CONFIGURE_MEMORY_FOR_BARRIERS(_barriers) \ |
---|
1204 | _Configure_Object_RAM(_barriers, sizeof(Barrier_Control) ) |
---|
1205 | #endif |
---|
1206 | |
---|
1207 | #ifndef CONFIGURE_MAXIMUM_USER_EXTENSIONS |
---|
1208 | #define CONFIGURE_MAXIMUM_USER_EXTENSIONS 0 |
---|
1209 | #define CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(_extensions) 0 |
---|
1210 | #else |
---|
1211 | #define CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(_extensions) \ |
---|
1212 | _Configure_Object_RAM(_extensions, sizeof(Extension_Control) ) |
---|
1213 | #endif |
---|
1214 | |
---|
1215 | #ifndef CONFIGURE_MICROSECONDS_PER_TICK |
---|
1216 | #define CONFIGURE_MICROSECONDS_PER_TICK \ |
---|
1217 | RTEMS_MILLISECONDS_TO_MICROSECONDS(10) |
---|
1218 | #endif |
---|
1219 | |
---|
1220 | #ifndef CONFIGURE_TICKS_PER_TIMESLICE |
---|
1221 | #define CONFIGURE_TICKS_PER_TIMESLICE 50 |
---|
1222 | #endif |
---|
1223 | |
---|
1224 | /* |
---|
1225 | * Initial Extension Set |
---|
1226 | */ |
---|
1227 | |
---|
1228 | #ifdef CONFIGURE_INIT |
---|
1229 | #ifdef CONFIGURE_STACK_CHECKER_ENABLED |
---|
1230 | #include <rtems/stackchk.h> |
---|
1231 | #endif |
---|
1232 | #include <rtems/libcsupport.h> |
---|
1233 | |
---|
1234 | #if defined(CONFIGURE_INITIAL_EXTENSIONS) || \ |
---|
1235 | defined(CONFIGURE_STACK_CHECKER_ENABLED) || \ |
---|
1236 | (defined(RTEMS_NEWLIB) && !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY)) |
---|
1237 | rtems_extensions_table Configuration_Initial_Extensions[] = { |
---|
1238 | #if !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY) |
---|
1239 | RTEMS_NEWLIB_EXTENSION, |
---|
1240 | #endif |
---|
1241 | #if defined(CONFIGURE_STACK_CHECKER_ENABLED) |
---|
1242 | RTEMS_STACK_CHECKER_EXTENSION, |
---|
1243 | #endif |
---|
1244 | #if defined(CONFIGURE_INITIAL_EXTENSIONS) |
---|
1245 | CONFIGURE_INITIAL_EXTENSIONS, |
---|
1246 | #endif |
---|
1247 | }; |
---|
1248 | |
---|
1249 | #define CONFIGURE_INITIAL_EXTENSION_TABLE Configuration_Initial_Extensions |
---|
1250 | #define CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS \ |
---|
1251 | ((sizeof(Configuration_Initial_Extensions) / \ |
---|
1252 | sizeof(rtems_extensions_table))) |
---|
1253 | #else |
---|
1254 | #define CONFIGURE_INITIAL_EXTENSION_TABLE NULL |
---|
1255 | #define CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS 0 |
---|
1256 | #endif |
---|
1257 | |
---|
1258 | |
---|
1259 | #endif |
---|
1260 | |
---|
1261 | /* |
---|
1262 | * POSIX API Configuration Parameters |
---|
1263 | */ |
---|
1264 | |
---|
1265 | #ifdef RTEMS_POSIX_API |
---|
1266 | |
---|
1267 | #include <sys/types.h> |
---|
1268 | #include <signal.h> |
---|
1269 | #include <limits.h> |
---|
1270 | #include <mqueue.h> |
---|
1271 | #include <rtems/posix/barrier.h> |
---|
1272 | #include <rtems/posix/cond.h> |
---|
1273 | #include <rtems/posix/mqueue.h> |
---|
1274 | #include <rtems/posix/mutex.h> |
---|
1275 | #include <rtems/posix/key.h> |
---|
1276 | #include <rtems/posix/psignal.h> |
---|
1277 | #include <rtems/posix/rwlock.h> |
---|
1278 | #include <rtems/posix/semaphore.h> |
---|
1279 | #include <rtems/posix/spinlock.h> |
---|
1280 | #include <rtems/posix/threadsup.h> |
---|
1281 | #include <rtems/posix/timer.h> |
---|
1282 | |
---|
1283 | /** |
---|
1284 | * Account for the object control structures plus the name |
---|
1285 | * of the object to be duplicated. |
---|
1286 | */ |
---|
1287 | #define _Configure_POSIX_Named_Object_RAM(_number, _size) \ |
---|
1288 | _Configure_Object_RAM( (_number), _size ) + \ |
---|
1289 | ((_number) + _Configure_From_workspace(NAME_MAX) ) |
---|
1290 | |
---|
1291 | #ifndef CONFIGURE_MAXIMUM_POSIX_THREADS |
---|
1292 | #define CONFIGURE_MAXIMUM_POSIX_THREADS 0 |
---|
1293 | #endif |
---|
1294 | |
---|
1295 | #define CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API \ |
---|
1296 | _Configure_From_workspace( \ |
---|
1297 | sizeof (POSIX_API_Control) + \ |
---|
1298 | (sizeof (void *) * (CONFIGURE_MAXIMUM_POSIX_KEYS)) \ |
---|
1299 | ) |
---|
1300 | |
---|
1301 | #ifndef CONFIGURE_MAXIMUM_POSIX_MUTEXES |
---|
1302 | #define CONFIGURE_MAXIMUM_POSIX_MUTEXES 0 |
---|
1303 | #define CONFIGURE_MEMORY_FOR_POSIX_MUTEXES(_mutexes) 0 |
---|
1304 | #else |
---|
1305 | #define CONFIGURE_MEMORY_FOR_POSIX_MUTEXES(_mutexes) \ |
---|
1306 | _Configure_Object_RAM(_mutexes, sizeof(POSIX_Mutex_Control) ) |
---|
1307 | #endif |
---|
1308 | |
---|
1309 | #ifndef CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES |
---|
1310 | #define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 0 |
---|
1311 | #define CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES(_condvars) 0 |
---|
1312 | #else |
---|
1313 | #define CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES(_condvars) \ |
---|
1314 | _Configure_Object_RAM(_condvars, \ |
---|
1315 | sizeof(POSIX_Condition_variables_Control) ) |
---|
1316 | #endif |
---|
1317 | |
---|
1318 | #ifndef CONFIGURE_MAXIMUM_POSIX_KEYS |
---|
1319 | #define CONFIGURE_MAXIMUM_POSIX_KEYS 0 |
---|
1320 | #define CONFIGURE_MEMORY_FOR_POSIX_KEYS(_keys) 0 |
---|
1321 | #else |
---|
1322 | #define CONFIGURE_MEMORY_FOR_POSIX_KEYS(_keys) \ |
---|
1323 | _Configure_Object_RAM(_keys, sizeof(POSIX_Keys_Control) ) |
---|
1324 | #endif |
---|
1325 | |
---|
1326 | #ifndef CONFIGURE_MAXIMUM_POSIX_TIMERS |
---|
1327 | #define CONFIGURE_MAXIMUM_POSIX_TIMERS 0 |
---|
1328 | #define CONFIGURE_MEMORY_FOR_POSIX_TIMERS(_timers) 0 |
---|
1329 | #else |
---|
1330 | #define CONFIGURE_MEMORY_FOR_POSIX_TIMERS(_timers) \ |
---|
1331 | _Configure_Object_RAM(_timers, sizeof(POSIX_Timer_Control) ) |
---|
1332 | #endif |
---|
1333 | |
---|
1334 | #ifndef CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS |
---|
1335 | #define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS 0 |
---|
1336 | #define CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS(_queued_signals) 0 |
---|
1337 | #else |
---|
1338 | #define CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS(_queued_signals) \ |
---|
1339 | _Configure_From_workspace( \ |
---|
1340 | (_queued_signals) * (sizeof(POSIX_signals_Siginfo_node)) ) |
---|
1341 | #endif |
---|
1342 | |
---|
1343 | #ifndef CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES |
---|
1344 | #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES 0 |
---|
1345 | #define CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES(_message_queues) 0 |
---|
1346 | #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS 0 |
---|
1347 | #define CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUE_DESCRIPTORS(_fds) 0 |
---|
1348 | #else |
---|
1349 | #define CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES(_message_queues) \ |
---|
1350 | _Configure_POSIX_Named_Object_RAM( \ |
---|
1351 | _message_queues, sizeof(POSIX_Message_queue_Control) ) |
---|
1352 | |
---|
1353 | /* default to same number */ |
---|
1354 | #ifndef CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS |
---|
1355 | #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS \ |
---|
1356 | CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES |
---|
1357 | #endif |
---|
1358 | |
---|
1359 | #define CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUE_DESCRIPTORS(_mqueue_fds) \ |
---|
1360 | _Configure_POSIX_Named_Object_RAM( \ |
---|
1361 | _mqueue_fds, sizeof(POSIX_Message_queue_Control_fd) ) |
---|
1362 | #endif |
---|
1363 | |
---|
1364 | #ifndef CONFIGURE_MAXIMUM_POSIX_SEMAPHORES |
---|
1365 | #define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES 0 |
---|
1366 | #define CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES(_semaphores) 0 |
---|
1367 | #else |
---|
1368 | #define CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES(_semaphores) \ |
---|
1369 | _Configure_POSIX_Named_Object_RAM( \ |
---|
1370 | _semaphores, sizeof(POSIX_Semaphore_Control) ) |
---|
1371 | #endif |
---|
1372 | |
---|
1373 | #ifndef CONFIGURE_MAXIMUM_POSIX_BARRIERS |
---|
1374 | #define CONFIGURE_MAXIMUM_POSIX_BARRIERS 0 |
---|
1375 | #define CONFIGURE_MEMORY_FOR_POSIX_BARRIERS(_barriers) 0 |
---|
1376 | #else |
---|
1377 | #define CONFIGURE_MEMORY_FOR_POSIX_BARRIERS(_barriers) \ |
---|
1378 | _Configure_Object_RAM(_barriers, sizeof(POSIX_Barrier_Control) ) |
---|
1379 | #endif |
---|
1380 | |
---|
1381 | #ifndef CONFIGURE_MAXIMUM_POSIX_SPINLOCKS |
---|
1382 | #define CONFIGURE_MAXIMUM_POSIX_SPINLOCKS 0 |
---|
1383 | #define CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS(_spinlocks) 0 |
---|
1384 | #else |
---|
1385 | #define CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS(_spinlocks) \ |
---|
1386 | _Configure_Object_RAM(_spinlocks, sizeof(POSIX_Spinlock_Control) ) |
---|
1387 | #endif |
---|
1388 | |
---|
1389 | #ifndef CONFIGURE_MAXIMUM_POSIX_RWLOCKS |
---|
1390 | #define CONFIGURE_MAXIMUM_POSIX_RWLOCKS 0 |
---|
1391 | #define CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS(_rwlocks) 0 |
---|
1392 | #else |
---|
1393 | #define CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS(_rwlocks) \ |
---|
1394 | _Configure_Object_RAM(_rwlocks, sizeof(POSIX_RWLock_Control) ) |
---|
1395 | #endif |
---|
1396 | |
---|
1397 | #ifdef CONFIGURE_POSIX_INIT_THREAD_TABLE |
---|
1398 | |
---|
1399 | #ifdef CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE |
---|
1400 | |
---|
1401 | /* |
---|
1402 | * The user is defining their own table information and setting the |
---|
1403 | * appropriate variables for the POSIX Initialization Thread Table. |
---|
1404 | */ |
---|
1405 | |
---|
1406 | #else |
---|
1407 | |
---|
1408 | #ifndef CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT |
---|
1409 | #define CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT POSIX_Init |
---|
1410 | #endif |
---|
1411 | |
---|
1412 | #ifndef CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE |
---|
1413 | #define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE \ |
---|
1414 | (CONFIGURE_MINIMUM_TASK_STACK_SIZE * 2) |
---|
1415 | #endif |
---|
1416 | |
---|
1417 | #ifdef CONFIGURE_INIT |
---|
1418 | posix_initialization_threads_table POSIX_Initialization_threads[] = { |
---|
1419 | { CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT, \ |
---|
1420 | CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE } |
---|
1421 | }; |
---|
1422 | #endif |
---|
1423 | |
---|
1424 | #define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME \ |
---|
1425 | POSIX_Initialization_threads |
---|
1426 | |
---|
1427 | #define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE \ |
---|
1428 | sizeof(CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME) / \ |
---|
1429 | sizeof(posix_initialization_threads_table) |
---|
1430 | |
---|
1431 | #endif /* CONFIGURE_POSIX_HAS_OWN_INIT_TASK_TABLE */ |
---|
1432 | |
---|
1433 | #else /* CONFIGURE_POSIX_INIT_THREAD_TABLE */ |
---|
1434 | |
---|
1435 | #define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME NULL |
---|
1436 | #define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE 0 |
---|
1437 | |
---|
1438 | #endif |
---|
1439 | |
---|
1440 | #define CONFIGURE_MEMORY_FOR_POSIX \ |
---|
1441 | ( CONFIGURE_MEMORY_FOR_POSIX_MUTEXES( CONFIGURE_MAXIMUM_POSIX_MUTEXES ) + \ |
---|
1442 | CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES( \ |
---|
1443 | CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES ) + \ |
---|
1444 | CONFIGURE_MEMORY_FOR_POSIX_KEYS( CONFIGURE_MAXIMUM_POSIX_KEYS ) + \ |
---|
1445 | CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS( \ |
---|
1446 | CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS ) + \ |
---|
1447 | CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES( \ |
---|
1448 | CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES ) + \ |
---|
1449 | CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUE_DESCRIPTORS( \ |
---|
1450 | CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS ) + \ |
---|
1451 | CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES( \ |
---|
1452 | CONFIGURE_MAXIMUM_POSIX_SEMAPHORES ) + \ |
---|
1453 | CONFIGURE_MEMORY_FOR_POSIX_BARRIERS(CONFIGURE_MAXIMUM_POSIX_BARRIERS) + \ |
---|
1454 | CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS( \ |
---|
1455 | CONFIGURE_MAXIMUM_POSIX_SPINLOCKS ) + \ |
---|
1456 | CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS( \ |
---|
1457 | CONFIGURE_MAXIMUM_POSIX_RWLOCKS ) + \ |
---|
1458 | CONFIGURE_MEMORY_FOR_POSIX_TIMERS( CONFIGURE_MAXIMUM_POSIX_TIMERS ) + \ |
---|
1459 | (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE) \ |
---|
1460 | ) |
---|
1461 | #else |
---|
1462 | |
---|
1463 | #define CONFIGURE_MAXIMUM_POSIX_THREADS 0 |
---|
1464 | #define CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API 0 |
---|
1465 | #define CONFIGURE_MEMORY_FOR_POSIX 0 |
---|
1466 | |
---|
1467 | #endif /* RTEMS_POSIX_API */ |
---|
1468 | |
---|
1469 | #ifndef CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE |
---|
1470 | #define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE 0 |
---|
1471 | #endif |
---|
1472 | |
---|
1473 | /* |
---|
1474 | * This block of defines are for applications which use GNAT/RTEMS. |
---|
1475 | * GNAT implements each Ada task as a POSIX thread. |
---|
1476 | */ |
---|
1477 | #ifdef CONFIGURE_GNAT_RTEMS |
---|
1478 | |
---|
1479 | /** |
---|
1480 | * The GNAT run-time needs something less than (10) POSIX mutexes. |
---|
1481 | * We may be able to get by with less but why bother. |
---|
1482 | */ |
---|
1483 | #define CONFIGURE_GNAT_MUTEXES 10 |
---|
1484 | |
---|
1485 | /** |
---|
1486 | * This is the maximum number of Ada tasks which can be concurrently |
---|
1487 | * in existence. Twenty (20) are required to run all tests in the |
---|
1488 | * ACATS (formerly ACVC). |
---|
1489 | */ |
---|
1490 | #ifndef CONFIGURE_MAXIMUM_ADA_TASKS |
---|
1491 | #define CONFIGURE_MAXIMUM_ADA_TASKS 20 |
---|
1492 | #endif |
---|
1493 | |
---|
1494 | /** |
---|
1495 | * This is the number of non-Ada tasks which invoked Ada code. |
---|
1496 | */ |
---|
1497 | #ifndef CONFIGURE_MAXIMUM_FAKE_ADA_TASKS |
---|
1498 | #define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0 |
---|
1499 | #endif |
---|
1500 | |
---|
1501 | /** |
---|
1502 | * Ada tasks are allocated twice the minimum stack space. |
---|
1503 | */ |
---|
1504 | #define CONFIGURE_ADA_TASKS_STACK \ |
---|
1505 | (CONFIGURE_MAXIMUM_ADA_TASKS * \ |
---|
1506 | (CONFIGURE_MINIMUM_TASK_STACK_SIZE + (6 * 1024))) |
---|
1507 | |
---|
1508 | #else |
---|
1509 | #define CONFIGURE_GNAT_MUTEXES 0 |
---|
1510 | #define CONFIGURE_MAXIMUM_ADA_TASKS 0 |
---|
1511 | #define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0 |
---|
1512 | #define CONFIGURE_ADA_TASKS_STACK 0 |
---|
1513 | #endif |
---|
1514 | |
---|
1515 | /* |
---|
1516 | * ITRON API Configuration Parameters |
---|
1517 | */ |
---|
1518 | |
---|
1519 | #ifdef RTEMS_ITRON_API |
---|
1520 | |
---|
1521 | #include <rtems/itron.h> |
---|
1522 | #include <rtems/itron/config.h> |
---|
1523 | #include <rtems/itron/eventflags.h> |
---|
1524 | #include <rtems/itron/fmempool.h> |
---|
1525 | #include <rtems/itron/mbox.h> |
---|
1526 | #include <rtems/itron/msgbuffer.h> |
---|
1527 | #include <rtems/itron/port.h> |
---|
1528 | #include <rtems/itron/semaphore.h> |
---|
1529 | #include <rtems/itron/task.h> |
---|
1530 | #include <rtems/itron/vmempool.h> |
---|
1531 | |
---|
1532 | #ifndef CONFIGURE_MAXIMUM_ITRON_TASKS |
---|
1533 | #define CONFIGURE_MAXIMUM_ITRON_TASKS 0 |
---|
1534 | #endif |
---|
1535 | #define CONFIGURE_MEMORY_PER_TASK_FOR_ITRON_API 0 |
---|
1536 | |
---|
1537 | #ifndef CONFIGURE_MAXIMUM_ITRON_SEMAPHORES |
---|
1538 | #define CONFIGURE_MAXIMUM_ITRON_SEMAPHORES 0 |
---|
1539 | #define CONFIGURE_MEMORY_FOR_ITRON_SEMAPHORES(_semaphores) 0 |
---|
1540 | #else |
---|
1541 | #define CONFIGURE_MEMORY_FOR_ITRON_SEMAPHORES(_semaphores) \ |
---|
1542 | _Configure_Object_RAM(_semaphores, sizeof(ITRON_Semaphore_Control)) |
---|
1543 | #endif |
---|
1544 | |
---|
1545 | #ifndef CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS |
---|
1546 | #define CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS 0 |
---|
1547 | #define CONFIGURE_MEMORY_FOR_ITRON_EVENTFLAGS(_eventflags) 0 |
---|
1548 | #else |
---|
1549 | #define CONFIGURE_MEMORY_FOR_ITRON_EVENTFLAGS(_eventflags) \ |
---|
1550 | _Configure_Object_RAM(_eventflags, sizeof(ITRON_Eventflags_Control)) |
---|
1551 | #endif |
---|
1552 | |
---|
1553 | #ifndef CONFIGURE_MAXIMUM_ITRON_MAILBOXES |
---|
1554 | #define CONFIGURE_MAXIMUM_ITRON_MAILBOXES 0 |
---|
1555 | #define CONFIGURE_MEMORY_FOR_ITRON_MAILBOXES(_mailboxes) 0 |
---|
1556 | #else |
---|
1557 | #define CONFIGURE_MEMORY_FOR_ITRON_MAILBOXES(_mailboxes) \ |
---|
1558 | _Configure_Object_RAM(_mailboxes, sizeof(ITRON_Mailbox_Control)) |
---|
1559 | #endif |
---|
1560 | |
---|
1561 | #ifndef CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS |
---|
1562 | #define CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS 0 |
---|
1563 | #define CONFIGURE_MEMORY_FOR_ITRON_MESSAGE_BUFFERS(_message_buffers) 0 |
---|
1564 | #else |
---|
1565 | #define CONFIGURE_MEMORY_FOR_ITRON_MESSAGE_BUFFERS(_message_buffers) \ |
---|
1566 | _Configure_Object_RAM(_message_buffers, \ |
---|
1567 | sizeof(ITRON_Message_buffer_Control)) |
---|
1568 | #endif |
---|
1569 | |
---|
1570 | #ifndef CONFIGURE_MAXIMUM_ITRON_PORTS |
---|
1571 | #define CONFIGURE_MAXIMUM_ITRON_PORTS 0 |
---|
1572 | #define CONFIGURE_MEMORY_FOR_ITRON_PORTS(_ports) 0 |
---|
1573 | #else |
---|
1574 | #define CONFIGURE_MEMORY_FOR_ITRON_PORTS(_ports) \ |
---|
1575 | _Configure_Object_RAM(_ports, sizeof(ITRON_Port_Control)) |
---|
1576 | #endif |
---|
1577 | |
---|
1578 | #ifndef CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS |
---|
1579 | #define CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS 0 |
---|
1580 | #define CONFIGURE_MEMORY_FOR_ITRON_MEMORY_POOLS(_pools) 0 |
---|
1581 | #else |
---|
1582 | #define CONFIGURE_MEMORY_FOR_ITRON_MEMORY_POOLS(_pools) \ |
---|
1583 | _Configure_Object_RAM( _pools, sizeof(ITRON_Variable_memory_pool_Control)) |
---|
1584 | #endif |
---|
1585 | |
---|
1586 | #ifndef CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS |
---|
1587 | #define CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS 0 |
---|
1588 | #define CONFIGURE_MEMORY_FOR_ITRON_FIXED_MEMORY_POOLS(_pools) 0 |
---|
1589 | #else |
---|
1590 | #define CONFIGURE_MEMORY_FOR_ITRON_FIXED_MEMORY_POOLS(_pools) \ |
---|
1591 | _Configure_Object_RAM(_pools, sizeof(ITRON_Fixed_memory_pool_Control)) |
---|
1592 | #endif |
---|
1593 | |
---|
1594 | #ifdef CONFIGURE_ITRON_INIT_TASK_TABLE |
---|
1595 | |
---|
1596 | #ifdef CONFIGURE_ITRON_HAS_OWN_INIT_TASK_TABLE |
---|
1597 | |
---|
1598 | /* |
---|
1599 | * The user is defining their own table information and setting the |
---|
1600 | * appropriate variables for the ITRON Initialization Task Table. |
---|
1601 | */ |
---|
1602 | |
---|
1603 | #else |
---|
1604 | |
---|
1605 | #ifndef CONFIGURE_ITRON_INIT_TASK_ENTRY_POINT |
---|
1606 | #define CONFIGURE_ITRON_INIT_TASK_ENTRY_POINT ITRON_Init |
---|
1607 | #endif |
---|
1608 | |
---|
1609 | #ifndef CONFIGURE_ITRON_INIT_TASK_ATTRIBUTES |
---|
1610 | #define CONFIGURE_ITRON_INIT_TASK_ATTRIBUTES TA_HLNG |
---|
1611 | #endif |
---|
1612 | |
---|
1613 | #ifndef CONFIGURE_ITRON_INIT_TASK_PRIORITY |
---|
1614 | #define CONFIGURE_ITRON_INIT_TASK_PRIORITY 1 |
---|
1615 | #endif |
---|
1616 | |
---|
1617 | #ifndef CONFIGURE_ITRON_INIT_TASK_STACK_SIZE |
---|
1618 | #define CONFIGURE_ITRON_INIT_TASK_STACK_SIZE \ |
---|
1619 | CONFIGURE_MINIMUM_TASK_STACK_SIZE |
---|
1620 | #endif |
---|
1621 | |
---|
1622 | #ifdef CONFIGURE_INIT |
---|
1623 | itron_initialization_tasks_table ITRON_Initialization_tasks[] = { |
---|
1624 | { 1, /* ID */ |
---|
1625 | { (VP) 0, /* exinfo */ |
---|
1626 | CONFIGURE_ITRON_INIT_TASK_ATTRIBUTES, /* task attributes */ |
---|
1627 | CONFIGURE_ITRON_INIT_TASK_ENTRY_POINT, /* task start address */ |
---|
1628 | CONFIGURE_ITRON_INIT_TASK_PRIORITY, /* initial task priority */ |
---|
1629 | CONFIGURE_ITRON_INIT_TASK_STACK_SIZE /* stack size */ |
---|
1630 | } |
---|
1631 | } |
---|
1632 | }; |
---|
1633 | #endif |
---|
1634 | |
---|
1635 | #define CONFIGURE_ITRON_INIT_TASK_TABLE_NAME ITRON_Initialization_tasks |
---|
1636 | |
---|
1637 | #define CONFIGURE_ITRON_INIT_TASK_TABLE_SIZE \ |
---|
1638 | sizeof(CONFIGURE_ITRON_INIT_TASK_TABLE_NAME) / \ |
---|
1639 | sizeof(itron_initialization_tasks_table) |
---|
1640 | |
---|
1641 | #endif /* CONFIGURE_ITRON_HAS_OWN_INIT_TASK_TABLE */ |
---|
1642 | |
---|
1643 | #else /* CONFIGURE_ITRON_INIT_TASK_TABLE */ |
---|
1644 | |
---|
1645 | #define CONFIGURE_ITRON_INIT_TASK_TABLE_NAME NULL |
---|
1646 | #define CONFIGURE_ITRON_INIT_TASK_TABLE_SIZE 0 |
---|
1647 | #define CONFIGURE_ITRON_INIT_TASK_STACK_SIZE 0 |
---|
1648 | |
---|
1649 | #endif |
---|
1650 | |
---|
1651 | #define CONFIGURE_MEMORY_FOR_ITRON \ |
---|
1652 | ( CONFIGURE_MEMORY_FOR_ITRON_SEMAPHORES( \ |
---|
1653 | CONFIGURE_MAXIMUM_ITRON_SEMAPHORES ) + \ |
---|
1654 | CONFIGURE_MEMORY_FOR_ITRON_EVENTFLAGS( \ |
---|
1655 | CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS ) + \ |
---|
1656 | CONFIGURE_MEMORY_FOR_ITRON_MAILBOXES( \ |
---|
1657 | CONFIGURE_MAXIMUM_ITRON_MAILBOXES ) + \ |
---|
1658 | CONFIGURE_MEMORY_FOR_ITRON_MESSAGE_BUFFERS( \ |
---|
1659 | CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS ) + \ |
---|
1660 | CONFIGURE_MEMORY_FOR_ITRON_PORTS( \ |
---|
1661 | CONFIGURE_MAXIMUM_ITRON_PORTS ) + \ |
---|
1662 | CONFIGURE_MEMORY_FOR_ITRON_MEMORY_POOLS( \ |
---|
1663 | CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS ) + \ |
---|
1664 | CONFIGURE_MEMORY_FOR_ITRON_FIXED_MEMORY_POOLS( \ |
---|
1665 | CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS ) + \ |
---|
1666 | CONFIGURE_ITRON_INIT_TASK_STACK_SIZE \ |
---|
1667 | ) |
---|
1668 | |
---|
1669 | #else |
---|
1670 | |
---|
1671 | #define CONFIGURE_MAXIMUM_ITRON_TASKS 0 |
---|
1672 | #define CONFIGURE_MAXIMUM_ITRON_SEMAPHORES 0 |
---|
1673 | #define CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS 0 |
---|
1674 | #define CONFIGURE_MAXIMUM_ITRON_MAILBOXES 0 |
---|
1675 | #define CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS 0 |
---|
1676 | #define CONFIGURE_MAXIMUM_ITRON_PORTS 0 |
---|
1677 | #define CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS 0 |
---|
1678 | #define CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS 0 |
---|
1679 | #define CONFIGURE_MEMORY_PER_TASK_FOR_ITRON_API 0 |
---|
1680 | #define CONFIGURE_MEMORY_FOR_ITRON 0 |
---|
1681 | |
---|
1682 | #endif /* RTEMS_ITRON_API */ |
---|
1683 | |
---|
1684 | /** |
---|
1685 | * This macro specifies the amount of memory to be reserved for the |
---|
1686 | * Newlib C Library reentrancy structure -- if we are using newlib. |
---|
1687 | */ |
---|
1688 | |
---|
1689 | #if (defined(RTEMS_NEWLIB) && !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY)) |
---|
1690 | #include <reent.h> |
---|
1691 | |
---|
1692 | #define CONFIGURE_MEMORY_PER_TASK_FOR_NEWLIB \ |
---|
1693 | _Configure_From_workspace(sizeof(struct _reent)) |
---|
1694 | #else |
---|
1695 | #define CONFIGURE_MEMORY_PER_TASK_FOR_NEWLIB 0 |
---|
1696 | #endif |
---|
1697 | |
---|
1698 | /* |
---|
1699 | * Calculate the RAM size based on the maximum number of objects configured. |
---|
1700 | */ |
---|
1701 | |
---|
1702 | #ifndef CONFIGURE_EXECUTIVE_RAM_SIZE |
---|
1703 | |
---|
1704 | /** |
---|
1705 | * Account for allocating the following per object |
---|
1706 | * + array of object control structures |
---|
1707 | * + local pointer table -- pointer per object plus a zero'th |
---|
1708 | * entry in the local pointer table. |
---|
1709 | */ |
---|
1710 | |
---|
1711 | #define CONFIGURE_MEMORY_FOR_TASKS(_tasks, _number_FP_tasks) \ |
---|
1712 | ( \ |
---|
1713 | _Configure_Object_RAM(_tasks, sizeof(Thread_Control)) + \ |
---|
1714 | (_Configure_Max_Objects(_tasks) * \ |
---|
1715 | (_Configure_From_workspace(CONFIGURE_MINIMUM_TASK_STACK_SIZE) + \ |
---|
1716 | CONFIGURE_MEMORY_PER_TASK_FOR_CLASSIC_API + \ |
---|
1717 | CONFIGURE_MEMORY_PER_TASK_FOR_NEWLIB + \ |
---|
1718 | CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API + \ |
---|
1719 | CONFIGURE_MEMORY_PER_TASK_FOR_ITRON_API)) + \ |
---|
1720 | _Configure_From_workspace( \ |
---|
1721 | _Configure_Max_Objects(_number_FP_tasks) * CONTEXT_FP_SIZE) + \ |
---|
1722 | _Configure_From_workspace( \ |
---|
1723 | (CONFIGURE_MAXIMUM_USER_EXTENSIONS + 1) * sizeof(void *)) \ |
---|
1724 | ) |
---|
1725 | |
---|
1726 | /** |
---|
1727 | * This defines the amount of memory configured for the multiprocessing |
---|
1728 | * support required by this application. |
---|
1729 | */ |
---|
1730 | #ifdef CONFIGURE_MP_APPLICATION |
---|
1731 | #define CONFIGURE_MEMORY_FOR_MP \ |
---|
1732 | (CONFIGURE_MEMORY_FOR_PROXIES(CONFIGURE_MP_MAXIMUM_PROXIES) + \ |
---|
1733 | CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS( \ |
---|
1734 | CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS) + \ |
---|
1735 | CONFIGURE_MEMORY_FOR_TASKS(1, 1) + \ |
---|
1736 | CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK \ |
---|
1737 | ) |
---|
1738 | #else |
---|
1739 | #define CONFIGURE_MEMORY_FOR_MP 0 |
---|
1740 | #endif |
---|
1741 | |
---|
1742 | /** |
---|
1743 | * This is so we can account for tasks with stacks greater than minimum |
---|
1744 | * size. This is in bytes. |
---|
1745 | */ |
---|
1746 | #ifndef CONFIGURE_EXTRA_TASK_STACKS |
---|
1747 | #define CONFIGURE_EXTRA_TASK_STACKS 0 |
---|
1748 | #endif |
---|
1749 | |
---|
1750 | /** |
---|
1751 | * The following macro is used to calculate the memory allocated by RTEMS |
---|
1752 | * for the message buffers associated with a particular message queue. |
---|
1753 | * There is a fixed amount of overhead per message. |
---|
1754 | */ |
---|
1755 | #define CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(_messages, _size) \ |
---|
1756 | _Configure_From_workspace( \ |
---|
1757 | (_messages) * ((_size) + sizeof(CORE_message_queue_Buffer_control))) |
---|
1758 | |
---|
1759 | /** |
---|
1760 | * This macros is set to the amount of memory required for pending message |
---|
1761 | * buffers in bytes. It should be constructed by adding together a |
---|
1762 | * set of values determined by CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE. |
---|
1763 | */ |
---|
1764 | #ifndef CONFIGURE_MESSAGE_BUFFER_MEMORY |
---|
1765 | #define CONFIGURE_MESSAGE_BUFFER_MEMORY 0 |
---|
1766 | #endif |
---|
1767 | |
---|
1768 | /** |
---|
1769 | * This macro is available just in case the confdefs.h file underallocates |
---|
1770 | * memory for a particular application. This lets the user add some extra |
---|
1771 | * memory in case something broken and underestimates. |
---|
1772 | * |
---|
1773 | * It is also possible for cases where confdefs.h overallocates memory, |
---|
1774 | * you could substract memory from the allocated. The estimate is just |
---|
1775 | * that, an estimate, and assumes worst case alignment and padding on |
---|
1776 | * each allocated element. So in some cases it could be too conservative. |
---|
1777 | * |
---|
1778 | * @note Historically this was used for message buffers. |
---|
1779 | */ |
---|
1780 | #ifndef CONFIGURE_MEMORY_OVERHEAD |
---|
1781 | #define CONFIGURE_MEMORY_OVERHEAD 0 |
---|
1782 | #endif |
---|
1783 | |
---|
1784 | /** |
---|
1785 | * On architectures that use Simple Vectored Interrupts, it is RTEMS |
---|
1786 | * responsibility to allocate the vector table. This avoids reserving |
---|
1787 | * the memory on architectures that use the Programmable Interrupt |
---|
1788 | * Controller Vectored Interrupts. |
---|
1789 | */ |
---|
1790 | #if (CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE) |
---|
1791 | /* |
---|
1792 | * This is a (hopefully) temporary hack. On the mips, the number of |
---|
1793 | * vectors is NOT statically defined. But it has to be statically |
---|
1794 | * defined for this to work. This is an issue looking for a nice |
---|
1795 | * solution. |
---|
1796 | */ |
---|
1797 | #if defined(__mips__) |
---|
1798 | #define CONFIGURE_INTERRUPT_VECTOR_TABLE \ |
---|
1799 | _Configure_From_workspace( (sizeof(ISR_Handler_entry) * 256)) |
---|
1800 | #else |
---|
1801 | #define CONFIGURE_INTERRUPT_VECTOR_TABLE \ |
---|
1802 | _Configure_From_workspace( \ |
---|
1803 | (sizeof(ISR_Handler_entry) * ISR_NUMBER_OF_VECTORS)) |
---|
1804 | #endif |
---|
1805 | #else |
---|
1806 | #define CONFIGURE_INTERRUPT_VECTOR_TABLE 0 |
---|
1807 | #endif |
---|
1808 | |
---|
1809 | /** |
---|
1810 | * RTEMS uses one instance of an internal mutex class. This accounts |
---|
1811 | * for that mutex |
---|
1812 | */ |
---|
1813 | #define CONFIGURE_API_MUTEX_MEMORY \ |
---|
1814 | _Configure_Object_RAM(1, sizeof(API_Mutex_Control)) |
---|
1815 | |
---|
1816 | /** |
---|
1817 | * This defines the memory used by the thread ready chains. There is |
---|
1818 | * one chain per priority. |
---|
1819 | */ |
---|
1820 | #define CONFIGURE_MEMORY_FOR_THREAD_READY_CHAINS \ |
---|
1821 | _Configure_From_workspace( \ |
---|
1822 | ((CONFIGURE_MAXIMUM_PRIORITY+1) * sizeof(Chain_Control)) ) |
---|
1823 | /** |
---|
1824 | * This defines the amount of memory reserved for the IDLE task |
---|
1825 | * control structures and stack. |
---|
1826 | */ |
---|
1827 | #define CONFIGURE_MEMORY_FOR_IDLE_TASK \ |
---|
1828 | (CONFIGURE_MEMORY_FOR_TASKS(1, 0) + \ |
---|
1829 | (CONFIGURE_IDLE_TASK_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE)) |
---|
1830 | |
---|
1831 | /** |
---|
1832 | * This macro accounts for general RTEMS system overhead. |
---|
1833 | */ |
---|
1834 | #define CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD \ |
---|
1835 | ( CONFIGURE_MEMORY_FOR_IDLE_TASK + /* IDLE and stack */ \ |
---|
1836 | CONFIGURE_MEMORY_FOR_THREAD_READY_CHAINS + /* Ready chains */ \ |
---|
1837 | CONFIGURE_INTERRUPT_VECTOR_TABLE + /* interrupt vectors */ \ |
---|
1838 | CONFIGURE_INTERRUPT_STACK_MEMORY + /* interrupt stack */ \ |
---|
1839 | CONFIGURE_API_MUTEX_MEMORY /* allocation mutex */ \ |
---|
1840 | ) |
---|
1841 | |
---|
1842 | /* |
---|
1843 | * Now account for any extra memory that initialization tasks or threads |
---|
1844 | * may have requested. |
---|
1845 | */ |
---|
1846 | |
---|
1847 | /** |
---|
1848 | * This accounts for any extra memory required by the Classic API |
---|
1849 | * Initialization Task. |
---|
1850 | */ |
---|
1851 | #if (CONFIGURE_INIT_TASK_STACK_SIZE > CONFIGURE_MINIMUM_TASK_STACK_SIZE) |
---|
1852 | #define CONFIGURE_INITIALIZATION_THREADS_STACKS_CLASSIC_PART \ |
---|
1853 | (CONFIGURE_INIT_TASK_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE) |
---|
1854 | #else |
---|
1855 | #define CONFIGURE_INITIALIZATION_THREADS_STACKS_CLASSIC_PART 0 |
---|
1856 | #endif |
---|
1857 | |
---|
1858 | /** |
---|
1859 | * This accounts for any extra memory required by the POSIX API |
---|
1860 | * Initialization Thread. |
---|
1861 | */ |
---|
1862 | #if defined(RTEMS_POSIX_API) && \ |
---|
1863 | (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE > CONFIGURE_MINIMUM_TASK_STACK_SIZE) |
---|
1864 | #define CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART \ |
---|
1865 | (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE) |
---|
1866 | #else |
---|
1867 | #define CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART 0 |
---|
1868 | #endif |
---|
1869 | |
---|
1870 | /** |
---|
1871 | * This accounts for any extra memory required by the ITRON API |
---|
1872 | * Initialization Task. |
---|
1873 | */ |
---|
1874 | #if defined(RTEMS_ITRON_API) && \ |
---|
1875 | (CONFIGURE_ITRON_INIT_TASK_STACK_SIZE > CONFIGURE_MINIMUM_TASK_STACK_SIZE) |
---|
1876 | #define CONFIGURE_INITIALIZATION_THREADS_STACKS_ITRON_PART \ |
---|
1877 | (CONFIGURE_ITRON_INIT_TASK_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE) |
---|
1878 | #else |
---|
1879 | #define CONFIGURE_INITIALIZATION_THREADS_STACKS_ITRON_PART 0 |
---|
1880 | #endif |
---|
1881 | |
---|
1882 | /** |
---|
1883 | * This macro provides a summation of the various initialization task |
---|
1884 | * and thread stack requirements. |
---|
1885 | */ |
---|
1886 | #define CONFIGURE_INITIALIZATION_THREADS_STACKS \ |
---|
1887 | (CONFIGURE_INITIALIZATION_THREADS_STACKS_CLASSIC_PART + \ |
---|
1888 | CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART + \ |
---|
1889 | CONFIGURE_INITIALIZATION_THREADS_STACKS_ITRON_PART) |
---|
1890 | |
---|
1891 | /** |
---|
1892 | * This macro provides a summation of the various task and thread |
---|
1893 | * requirements. |
---|
1894 | */ |
---|
1895 | #define CONFIGURE_TOTAL_TASKS_AND_THREADS \ |
---|
1896 | (CONFIGURE_MAXIMUM_TASKS + \ |
---|
1897 | CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_ADA_TASKS + \ |
---|
1898 | CONFIGURE_MAXIMUM_ITRON_TASKS \ |
---|
1899 | ) |
---|
1900 | |
---|
1901 | /** |
---|
1902 | * This macro reserves the memory required by the statically configured |
---|
1903 | * user extensions. |
---|
1904 | */ |
---|
1905 | #define CONFIGURE_MEMORY_FOR_STATIC_EXTENSIONS \ |
---|
1906 | ((CONFIGURE_NEWLIB_EXTENSION * \ |
---|
1907 | _Configure_From_workspace( sizeof(User_extensions_Control))) + \ |
---|
1908 | (CONFIGURE_STACK_CHECKER_EXTENSION * \ |
---|
1909 | _Configure_From_workspace( sizeof(User_extensions_Control))) \ |
---|
1910 | ) |
---|
1911 | |
---|
1912 | /** |
---|
1913 | * This macro provides a summation of the memory required by the |
---|
1914 | * Classic API as configured. |
---|
1915 | */ |
---|
1916 | #define CONFIGURE_MEMORY_FOR_CLASSIC \ |
---|
1917 | (CONFIGURE_MEMORY_FOR_TASK_VARIABLES(CONFIGURE_MAXIMUM_TASK_VARIABLES) + \ |
---|
1918 | CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS + \ |
---|
1919 | CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER ) + \ |
---|
1920 | CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_SEMAPHORES) + \ |
---|
1921 | CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(CONFIGURE_MAXIMUM_MESSAGE_QUEUES) + \ |
---|
1922 | CONFIGURE_MEMORY_FOR_PARTITIONS(CONFIGURE_MAXIMUM_PARTITIONS) + \ |
---|
1923 | CONFIGURE_MEMORY_FOR_REGIONS( CONFIGURE_MAXIMUM_REGIONS ) + \ |
---|
1924 | CONFIGURE_MEMORY_FOR_PORTS(CONFIGURE_MAXIMUM_PORTS) + \ |
---|
1925 | CONFIGURE_MEMORY_FOR_PERIODS(CONFIGURE_MAXIMUM_PERIODS) + \ |
---|
1926 | CONFIGURE_MEMORY_FOR_BARRIERS(CONFIGURE_MAXIMUM_BARRIERS) + \ |
---|
1927 | CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(CONFIGURE_MAXIMUM_USER_EXTENSIONS) \ |
---|
1928 | ) |
---|
1929 | |
---|
1930 | #if defined(CONFIGURE_CONFDEFS_DEBUG) && defined(CONFIGURE_INIT) |
---|
1931 | /** |
---|
1932 | * This is a debug mechanism, so if you need to, the executable will |
---|
1933 | * have a structure with various partial values. Add to this as you |
---|
1934 | * need to. Viewing this structure in gdb combined with dumping |
---|
1935 | * the Configuration structures generated should help a lot in tracing |
---|
1936 | * down errors and analyzing where over and under allocations are. |
---|
1937 | */ |
---|
1938 | typedef struct { |
---|
1939 | uint32_t SYSTEM_OVERHEAD; |
---|
1940 | uint32_t STATIC_EXTENSIONS; |
---|
1941 | uint32_t INITIALIZATION_THREADS_STACKS; |
---|
1942 | |
---|
1943 | uint32_t PER_INTEGER_TASK; |
---|
1944 | uint32_t FP_OVERHEAD; |
---|
1945 | uint32_t CLASSIC; |
---|
1946 | uint32_t POSIX; |
---|
1947 | uint32_t ITRON; |
---|
1948 | |
---|
1949 | /* System overhead pieces */ |
---|
1950 | uint32_t INTERRUPT_VECTOR_TABLE; |
---|
1951 | uint32_t INTERRUPT_STACK_MEMORY; |
---|
1952 | uint32_t THREAD_READY_CHAINS; |
---|
1953 | uint32_t MEMORY_FOR_IDLE_TASK; |
---|
1954 | |
---|
1955 | /* Classic API Pieces */ |
---|
1956 | uint32_t CLASSIC_TASKS; |
---|
1957 | uint32_t TASK_VARIABLES; |
---|
1958 | uint32_t TIMERS; |
---|
1959 | uint32_t SEMAPHORES; |
---|
1960 | uint32_t MESSAGE_QUEUES; |
---|
1961 | uint32_t PARTITIONS; |
---|
1962 | uint32_t REGIONS; |
---|
1963 | uint32_t PORTS; |
---|
1964 | uint32_t PERIODS; |
---|
1965 | uint32_t BARRIERS; |
---|
1966 | uint32_t USER_EXTENSIONS; |
---|
1967 | #ifdef RTEMS_POSIX_API |
---|
1968 | /* POSIX API Pieces */ |
---|
1969 | uint32_t POSIX_MUTEXES; |
---|
1970 | uint32_t POSIX_CONDITION_VARIABLES; |
---|
1971 | uint32_t POSIX_KEYS; |
---|
1972 | uint32_t POSIX_TIMERS; |
---|
1973 | uint32_t POSIX_QUEUED_SIGNALS; |
---|
1974 | uint32_t POSIX_MESSAGE_QUEUES; |
---|
1975 | uint32_t POSIX_SEMAPHORES; |
---|
1976 | uint32_t POSIX_BARRIERS; |
---|
1977 | uint32_t POSIX_SPINLOCKS; |
---|
1978 | uint32_t POSIX_RWLOCKS; |
---|
1979 | #endif |
---|
1980 | #ifdef RTEMS_ITRON_API |
---|
1981 | /* ITRON API Pieces */ |
---|
1982 | uint32_t ITRON_SEMAPHORES; |
---|
1983 | uint32_t ITRON_EVENTFLAGS; |
---|
1984 | uint32_t ITRON_MAILBOXES; |
---|
1985 | uint32_t ITRON_MESSAGE_BUFFERS; |
---|
1986 | uint32_t ITRON_PORTS; |
---|
1987 | uint32_t ITRON_MEMORY_POOLS; |
---|
1988 | uint32_t ITRON_FIXED_MEMORY_POOLS; |
---|
1989 | #endif |
---|
1990 | } Configuration_Debug_t; |
---|
1991 | |
---|
1992 | Configuration_Debug_t Configuration_Memory_Debug = { |
---|
1993 | /* General Information */ |
---|
1994 | CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD, |
---|
1995 | CONFIGURE_MEMORY_FOR_STATIC_EXTENSIONS, |
---|
1996 | CONFIGURE_INITIALIZATION_THREADS_STACKS, |
---|
1997 | CONFIGURE_MEMORY_FOR_TASKS(1, 0), |
---|
1998 | CONFIGURE_MEMORY_FOR_TASKS(0, 1), |
---|
1999 | CONFIGURE_MEMORY_FOR_CLASSIC, |
---|
2000 | CONFIGURE_MEMORY_FOR_POSIX, |
---|
2001 | CONFIGURE_MEMORY_FOR_ITRON, |
---|
2002 | |
---|
2003 | /* System overhead pieces */ |
---|
2004 | CONFIGURE_INTERRUPT_VECTOR_TABLE, |
---|
2005 | CONFIGURE_INTERRUPT_STACK_MEMORY, |
---|
2006 | CONFIGURE_MEMORY_FOR_THREAD_READY_CHAINS, |
---|
2007 | CONFIGURE_MEMORY_FOR_IDLE_TASK, |
---|
2008 | |
---|
2009 | /* Classic API Pieces */ |
---|
2010 | CONFIGURE_MEMORY_FOR_TASKS(CONFIGURE_MAXIMUM_TASKS, 0), |
---|
2011 | CONFIGURE_MEMORY_FOR_TASK_VARIABLES(CONFIGURE_MAXIMUM_TASK_VARIABLES), |
---|
2012 | CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS), |
---|
2013 | CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_SEMAPHORES), |
---|
2014 | CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(CONFIGURE_MAXIMUM_MESSAGE_QUEUES), |
---|
2015 | CONFIGURE_MEMORY_FOR_PARTITIONS(CONFIGURE_MAXIMUM_PARTITIONS), |
---|
2016 | CONFIGURE_MEMORY_FOR_REGIONS( CONFIGURE_MAXIMUM_REGIONS ), |
---|
2017 | CONFIGURE_MEMORY_FOR_PORTS(CONFIGURE_MAXIMUM_PORTS), |
---|
2018 | CONFIGURE_MEMORY_FOR_PERIODS(CONFIGURE_MAXIMUM_PERIODS), |
---|
2019 | CONFIGURE_MEMORY_FOR_BARRIERS(CONFIGURE_MAXIMUM_BARRIERS), |
---|
2020 | CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(CONFIGURE_MAXIMUM_USER_EXTENSIONS), |
---|
2021 | |
---|
2022 | #ifdef RTEMS_POSIX_API |
---|
2023 | /* POSIX API Pieces */ |
---|
2024 | CONFIGURE_MEMORY_FOR_POSIX_MUTEXES( CONFIGURE_MAXIMUM_POSIX_MUTEXES ), |
---|
2025 | CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES( |
---|
2026 | CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES ), |
---|
2027 | CONFIGURE_MEMORY_FOR_POSIX_KEYS( CONFIGURE_MAXIMUM_POSIX_KEYS ), |
---|
2028 | CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS( |
---|
2029 | CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS ), |
---|
2030 | CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES( |
---|
2031 | CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES ), |
---|
2032 | CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES( CONFIGURE_MAXIMUM_POSIX_SEMAPHORES ), |
---|
2033 | CONFIGURE_MEMORY_FOR_POSIX_BARRIERS( CONFIGURE_MAXIMUM_POSIX_BARRIERS ), |
---|
2034 | CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS( CONFIGURE_MAXIMUM_POSIX_SPINLOCKS ), |
---|
2035 | CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS( CONFIGURE_MAXIMUM_POSIX_RWLOCKS ), |
---|
2036 | CONFIGURE_MEMORY_FOR_POSIX_TIMERS( CONFIGURE_MAXIMUM_POSIX_TIMERS ), |
---|
2037 | #endif |
---|
2038 | |
---|
2039 | #ifdef RTEMS_ITRON_API |
---|
2040 | /* ITRON API Pieces */ |
---|
2041 | CONFIGURE_MEMORY_FOR_ITRON_SEMAPHORES( CONFIGURE_MAXIMUM_ITRON_SEMAPHORES ), |
---|
2042 | CONFIGURE_MEMORY_FOR_ITRON_EVENTFLAGS( CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS ), |
---|
2043 | CONFIGURE_MEMORY_FOR_ITRON_MAILBOXES( CONFIGURE_MAXIMUM_ITRON_MAILBOXES ), |
---|
2044 | CONFIGURE_MEMORY_FOR_ITRON_MESSAGE_BUFFERS( |
---|
2045 | CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS ), |
---|
2046 | CONFIGURE_MEMORY_FOR_ITRON_PORTS( CONFIGURE_MAXIMUM_ITRON_PORTS ), |
---|
2047 | CONFIGURE_MEMORY_FOR_ITRON_MEMORY_POOLS( |
---|
2048 | CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS ), |
---|
2049 | CONFIGURE_MEMORY_FOR_ITRON_FIXED_MEMORY_POOLS( |
---|
2050 | CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS ), |
---|
2051 | #endif |
---|
2052 | }; |
---|
2053 | #endif |
---|
2054 | |
---|
2055 | /** |
---|
2056 | * This calculates the memory required for the executive workspace. |
---|
2057 | */ |
---|
2058 | #define CONFIGURE_EXECUTIVE_RAM_SIZE \ |
---|
2059 | (( \ |
---|
2060 | CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD + \ |
---|
2061 | CONFIGURE_MEMORY_FOR_DEVFS + \ |
---|
2062 | CONFIGURE_MEMORY_FOR_TASKS( \ |
---|
2063 | CONFIGURE_TOTAL_TASKS_AND_THREADS, CONFIGURE_TOTAL_TASKS_AND_THREADS) + \ |
---|
2064 | CONFIGURE_MEMORY_FOR_CLASSIC + \ |
---|
2065 | CONFIGURE_MEMORY_FOR_POSIX + \ |
---|
2066 | (CONFIGURE_MAXIMUM_POSIX_THREADS * CONFIGURE_MINIMUM_TASK_STACK_SIZE ) + \ |
---|
2067 | CONFIGURE_MEMORY_FOR_ITRON + \ |
---|
2068 | CONFIGURE_INITIALIZATION_THREADS_STACKS + \ |
---|
2069 | CONFIGURE_MEMORY_FOR_STATIC_EXTENSIONS + \ |
---|
2070 | CONFIGURE_MEMORY_FOR_MP + \ |
---|
2071 | CONFIGURE_MESSAGE_BUFFER_MEMORY + \ |
---|
2072 | (CONFIGURE_MEMORY_OVERHEAD * 1024) + \ |
---|
2073 | (CONFIGURE_EXTRA_TASK_STACKS) + (CONFIGURE_ADA_TASKS_STACK) \ |
---|
2074 | ) & ~0x7) |
---|
2075 | #endif |
---|
2076 | |
---|
2077 | #ifdef CONFIGURE_INIT |
---|
2078 | /** |
---|
2079 | * This is the Classic API Configuration Table. |
---|
2080 | */ |
---|
2081 | rtems_api_configuration_table Configuration_RTEMS_API = { |
---|
2082 | CONFIGURE_MAXIMUM_TASKS, |
---|
2083 | CONFIGURE_NOTEPADS_ENABLED, |
---|
2084 | CONFIGURE_MAXIMUM_TIMERS + CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER, |
---|
2085 | CONFIGURE_SEMAPHORES, |
---|
2086 | CONFIGURE_MAXIMUM_MESSAGE_QUEUES, |
---|
2087 | CONFIGURE_MAXIMUM_PARTITIONS, |
---|
2088 | CONFIGURE_MAXIMUM_REGIONS, |
---|
2089 | CONFIGURE_MAXIMUM_PORTS, |
---|
2090 | CONFIGURE_MAXIMUM_PERIODS, |
---|
2091 | CONFIGURE_MAXIMUM_BARRIERS, |
---|
2092 | CONFIGURE_INIT_TASK_TABLE_SIZE, |
---|
2093 | CONFIGURE_INIT_TASK_TABLE |
---|
2094 | }; |
---|
2095 | |
---|
2096 | #ifdef RTEMS_POSIX_API |
---|
2097 | /** |
---|
2098 | * This is the POSIX API Configuration Table. |
---|
2099 | */ |
---|
2100 | posix_api_configuration_table Configuration_POSIX_API = { |
---|
2101 | CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_ADA_TASKS, |
---|
2102 | CONFIGURE_MAXIMUM_POSIX_MUTEXES + CONFIGURE_GNAT_MUTEXES + |
---|
2103 | CONFIGURE_MAXIMUM_ADA_TASKS + CONFIGURE_MAXIMUM_FAKE_ADA_TASKS, |
---|
2104 | CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES + |
---|
2105 | CONFIGURE_MAXIMUM_ADA_TASKS + CONFIGURE_MAXIMUM_FAKE_ADA_TASKS, |
---|
2106 | CONFIGURE_MAXIMUM_POSIX_KEYS, |
---|
2107 | CONFIGURE_MAXIMUM_POSIX_TIMERS, |
---|
2108 | CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS, |
---|
2109 | CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES, |
---|
2110 | CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS, |
---|
2111 | CONFIGURE_MAXIMUM_POSIX_SEMAPHORES, |
---|
2112 | CONFIGURE_MAXIMUM_POSIX_BARRIERS, |
---|
2113 | CONFIGURE_MAXIMUM_POSIX_RWLOCKS, |
---|
2114 | CONFIGURE_MAXIMUM_POSIX_SPINLOCKS, |
---|
2115 | CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE, |
---|
2116 | CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME |
---|
2117 | }; |
---|
2118 | #endif |
---|
2119 | |
---|
2120 | #ifdef RTEMS_ITRON_API |
---|
2121 | /** |
---|
2122 | * This is the ITRON API Configuration Table. |
---|
2123 | */ |
---|
2124 | itron_api_configuration_table Configuration_ITRON_API = { |
---|
2125 | CONFIGURE_MAXIMUM_ITRON_TASKS, |
---|
2126 | CONFIGURE_MAXIMUM_ITRON_SEMAPHORES, |
---|
2127 | CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS, |
---|
2128 | CONFIGURE_MAXIMUM_ITRON_MAILBOXES, |
---|
2129 | CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS, |
---|
2130 | CONFIGURE_MAXIMUM_ITRON_PORTS, |
---|
2131 | CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS, |
---|
2132 | CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS, |
---|
2133 | CONFIGURE_ITRON_INIT_TASK_TABLE_SIZE, |
---|
2134 | CONFIGURE_ITRON_INIT_TASK_TABLE_NAME |
---|
2135 | }; |
---|
2136 | #endif |
---|
2137 | |
---|
2138 | /** This variable specifies the minimum stack size for tasks in an RTEMS |
---|
2139 | * application. |
---|
2140 | * |
---|
2141 | * @note This is left as a simple uint32_t so it can be externed as |
---|
2142 | * needed without requring being high enough logical to |
---|
2143 | * include the full configuration table. |
---|
2144 | */ |
---|
2145 | uint32_t rtems_minimum_stack_size = |
---|
2146 | CONFIGURE_MINIMUM_TASK_STACK_SIZE; |
---|
2147 | |
---|
2148 | /** This variable specifies the maximum priority value that |
---|
2149 | * a task may have. This must be a power of 2 between 4 |
---|
2150 | * and 256 and is specified in terms of Classic API |
---|
2151 | * priority values. |
---|
2152 | * |
---|
2153 | * @note This is left as a simple uint8_t so it can be externed as |
---|
2154 | * needed without requring being high enough logical to |
---|
2155 | * include the full configuration table. |
---|
2156 | */ |
---|
2157 | uint8_t rtems_maximum_priority = CONFIGURE_MAXIMUM_PRIORITY; |
---|
2158 | |
---|
2159 | /** |
---|
2160 | * This is the primary Configuration Table for this application. |
---|
2161 | */ |
---|
2162 | rtems_configuration_table Configuration = { |
---|
2163 | NULL, /* filled in by BSP */ |
---|
2164 | CONFIGURE_EXECUTIVE_RAM_SIZE, /* required RTEMS workspace */ |
---|
2165 | CONFIGURE_MAXIMUM_USER_EXTENSIONS, /* maximum dynamic extensions */ |
---|
2166 | CONFIGURE_MICROSECONDS_PER_TICK, /* microseconds per clock tick */ |
---|
2167 | CONFIGURE_TICKS_PER_TIMESLICE, /* ticks per timeslice quantum */ |
---|
2168 | CONFIGURE_IDLE_TASK_BODY, /* user's IDLE task */ |
---|
2169 | CONFIGURE_IDLE_TASK_STACK_SIZE, /* IDLE task stack size */ |
---|
2170 | CONFIGURE_INTERRUPT_STACK_SIZE, /* interrupt stack size */ |
---|
2171 | CONFIGURE_TASK_STACK_ALLOCATOR, /* stack allocator */ |
---|
2172 | CONFIGURE_TASK_STACK_DEALLOCATOR, /* stack deallocator */ |
---|
2173 | CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY, /* true to clear memory */ |
---|
2174 | CONFIGURE_MAXIMUM_DRIVERS, /* maximum device drivers */ |
---|
2175 | CONFIGURE_NUMBER_OF_DRIVERS, /* static device drivers */ |
---|
2176 | Device_drivers, /* pointer to driver table */ |
---|
2177 | CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS, /* number of static extensions */ |
---|
2178 | CONFIGURE_INITIAL_EXTENSION_TABLE, /* pointer to static extensions */ |
---|
2179 | #if defined(RTEMS_MULTIPROCESSING) |
---|
2180 | CONFIGURE_MULTIPROCESSING_TABLE, /* pointer to MP config table */ |
---|
2181 | #endif |
---|
2182 | }; |
---|
2183 | #endif |
---|
2184 | |
---|
2185 | #endif /* CONFIGURE_HAS_OWN_CONFIGURATION_TABLE */ |
---|
2186 | |
---|
2187 | /* |
---|
2188 | * If the user has configured a set of Classic API Initialization Tasks, |
---|
2189 | * then we need to install the code that runs that loop. |
---|
2190 | */ |
---|
2191 | #ifdef CONFIGURE_INIT |
---|
2192 | #if defined(CONFIGURE_RTEMS_INIT_TASKS_TABLE) || \ |
---|
2193 | defined(CONFIGURE_HAS_OWN_INIT_TASK_TABLE) |
---|
2194 | void (_RTEMS_tasks_Initialize_user_tasks_body)(void); |
---|
2195 | void (*_RTEMS_tasks_Initialize_user_tasks_p)(void) = |
---|
2196 | _RTEMS_tasks_Initialize_user_tasks_body; |
---|
2197 | #else |
---|
2198 | void (*_RTEMS_tasks_Initialize_user_tasks_p)(void) = NULL; |
---|
2199 | #endif |
---|
2200 | #endif |
---|
2201 | |
---|
2202 | /* |
---|
2203 | * If the user has configured a set of POSIX Initialization Threads, |
---|
2204 | * then we need to install the code that runs that loop. |
---|
2205 | */ |
---|
2206 | #ifdef RTEMS_POSIX_API |
---|
2207 | #ifdef CONFIGURE_INIT |
---|
2208 | #if defined(CONFIGURE_POSIX_INIT_THREAD_TABLE) || \ |
---|
2209 | defined(CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE) |
---|
2210 | void _POSIX_Threads_Initialize_user_threads_body(void); |
---|
2211 | void (*_POSIX_Threads_Initialize_user_threads_p)(void) = |
---|
2212 | _POSIX_Threads_Initialize_user_threads_body; |
---|
2213 | #else |
---|
2214 | void (*_POSIX_Threads_Initialize_user_threads_p)(void) = NULL; |
---|
2215 | #endif |
---|
2216 | #endif |
---|
2217 | #endif |
---|
2218 | |
---|
2219 | /* |
---|
2220 | * If the user has configured a set of ITRON Initialization Tasks, |
---|
2221 | * then we need to install the code that runs that loop. |
---|
2222 | */ |
---|
2223 | #ifdef RTEMS_ITRON_API |
---|
2224 | #ifdef CONFIGURE_INIT |
---|
2225 | #if defined(CONFIGURE_ITRON_INIT_TASK_TABLE) || \ |
---|
2226 | defined(CONFIGURE_ITRON_HAS_OWN_INIT_TASK_TABLE) |
---|
2227 | void _ITRON_Task_Initialize_user_tasks_body(void); |
---|
2228 | void (*_ITRON_Initialize_user_tasks_p)(void) = |
---|
2229 | _ITRON_Task_Initialize_user_tasks_body; |
---|
2230 | #else |
---|
2231 | void (*_ITRON_Initialize_user_tasks_p)(void) = NULL; |
---|
2232 | #endif |
---|
2233 | #endif |
---|
2234 | #endif |
---|
2235 | |
---|
2236 | #ifdef __cplusplus |
---|
2237 | } |
---|
2238 | #endif |
---|
2239 | |
---|
2240 | /****************************************************************** |
---|
2241 | ****************************************************************** |
---|
2242 | ****************************************************************** |
---|
2243 | * CONFIGURATION WARNINGS AND ERROR CHECKING * |
---|
2244 | ****************************************************************** |
---|
2245 | ****************************************************************** |
---|
2246 | ****************************************************************** |
---|
2247 | */ |
---|
2248 | |
---|
2249 | /* |
---|
2250 | * Make sure a task/thread of some sort is configured. |
---|
2251 | * |
---|
2252 | * When analyzing RTEMS to find the smallest possible of memory |
---|
2253 | * that must be allocated, you probably do want to configure 0 |
---|
2254 | * tasks/threads so there is a smaller set of calls to _Workspace_Allocate |
---|
2255 | * to analyze. |
---|
2256 | */ |
---|
2257 | #if !defined(CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION) |
---|
2258 | #if (CONFIGURE_MAXIMUM_TASKS == 0) && \ |
---|
2259 | (CONFIGURE_MAXIMUM_POSIX_THREADS == 0) && \ |
---|
2260 | (CONFIGURE_MAXIMUM_ADA_TASKS == 0) && \ |
---|
2261 | (CONFIGURE_MAXIMUM_ITRON_TASKS == 0) |
---|
2262 | #error "CONFIGURATION ERROR: No tasks or threads configured!!" |
---|
2263 | #endif |
---|
2264 | #endif |
---|
2265 | |
---|
2266 | /* |
---|
2267 | * Make sure at least one of the initialization task/thread |
---|
2268 | * tables was defined. |
---|
2269 | */ |
---|
2270 | #if !defined(CONFIGURE_RTEMS_INIT_TASKS_TABLE) && \ |
---|
2271 | !defined(CONFIGURE_POSIX_INIT_THREAD_TABLE) && \ |
---|
2272 | !defined(CONFIGURE_ITRON_INIT_TASK_TABLE) && \ |
---|
2273 | !defined(CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION) |
---|
2274 | #error "CONFIGURATION ERROR: No initialization tasks or threads configured!!" |
---|
2275 | #endif |
---|
2276 | |
---|
2277 | /* |
---|
2278 | * If the user is trying to configure a multiprocessing application and |
---|
2279 | * RTEMS was not configured and built multiprocessing, then error out. |
---|
2280 | */ |
---|
2281 | #if defined(CONFIGURE_MP_APPLICATION) && \ |
---|
2282 | !defined(RTEMS_MULTIPROCESSING) |
---|
2283 | #error "CONFIGURATION ERROR: RTEMS not configured for multiprocessing!!" |
---|
2284 | #endif |
---|
2285 | |
---|
2286 | /* |
---|
2287 | * If an attempt was made to configure POSIX objects and |
---|
2288 | * the POSIX API was not configured into RTEMS, error out. |
---|
2289 | */ |
---|
2290 | #if !defined(RTEMS_POSIX_API) |
---|
2291 | #if ((CONFIGURE_MAXIMUM_POSIX_THREADS != 0) || \ |
---|
2292 | (CONFIGURE_MAXIMUM_POSIX_MUTEXES != 0) || \ |
---|
2293 | (CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES != 0) || \ |
---|
2294 | (CONFIGURE_MAXIMUM_POSIX_KEYS != 0) || \ |
---|
2295 | (CONFIGURE_MAXIMUM_POSIX_TIMERS != 0) || \ |
---|
2296 | (CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS != 0) || \ |
---|
2297 | (CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES != 0) || \ |
---|
2298 | (CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS != 0) || \ |
---|
2299 | (CONFIGURE_MAXIMUM_POSIX_SEMAPHORES != 0) || \ |
---|
2300 | (CONFIGURE_MAXIMUM_POSIX_BARRIERS != 0) || \ |
---|
2301 | (CONFIGURE_MAXIMUM_POSIX_SPINLOCKS != 0) || \ |
---|
2302 | (CONFIGURE_MAXIMUM_POSIX_RWLOCKS != 0) || \ |
---|
2303 | defined(CONFIGURE_POSIX_INIT_THREAD_TABLE)) |
---|
2304 | #error "CONFIGURATION ERROR: POSIX API support not configured!!" |
---|
2305 | #endif |
---|
2306 | #endif |
---|
2307 | |
---|
2308 | /* |
---|
2309 | * If an attempt was made to configure ITRON objects and |
---|
2310 | * the ITRON API was not configured into RTEMS, error out. |
---|
2311 | */ |
---|
2312 | #if !defined(RTEMS_ITRON_API) |
---|
2313 | #if ((CONFIGURE_MAXIMUM_ITRON_TASKS != 0) || \ |
---|
2314 | (CONFIGURE_MAXIMUM_ITRON_SEMAPHORES != 0) || \ |
---|
2315 | (CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS != 0) || \ |
---|
2316 | (CONFIGURE_MAXIMUM_ITRON_MAILBOXES != 0) || \ |
---|
2317 | (CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS != 0) || \ |
---|
2318 | (CONFIGURE_MAXIMUM_ITRON_PORTS != 0) || \ |
---|
2319 | (CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS != 0) || \ |
---|
2320 | (CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS != 0) || \ |
---|
2321 | defined(CONFIGURE_ITRON_INIT_TASK_TABLE)) |
---|
2322 | #error "CONFIGURATION ERROR: ITRON API support not configured!!" |
---|
2323 | #endif |
---|
2324 | #endif |
---|
2325 | |
---|
2326 | /* |
---|
2327 | * You must either explicity include or exclude the clock driver. |
---|
2328 | * It is such a common newbie error to leave it out. Maybe this |
---|
2329 | * will put an end to it. |
---|
2330 | * |
---|
2331 | * NOTE: If you are using the timer driver, it is considered |
---|
2332 | * mutually exclusive with the clock driver because the |
---|
2333 | * drivers are assumed to use the same "timer" hardware |
---|
2334 | * on many boards. |
---|
2335 | */ |
---|
2336 | #if !defined(CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE) |
---|
2337 | #if !defined(CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER) && \ |
---|
2338 | !defined(CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER) && \ |
---|
2339 | !defined(CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER) |
---|
2340 | #error "CONFIGURATION ERROR: Do you want the clock driver or not?!?" |
---|
2341 | #endif |
---|
2342 | #endif |
---|
2343 | |
---|
2344 | /* |
---|
2345 | * These names have been obsoleted so make the user application stop compiling |
---|
2346 | */ |
---|
2347 | #if defined(CONFIGURE_TEST_NEEDS_TIMER_DRIVER) || \ |
---|
2348 | defined(CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER) || \ |
---|
2349 | defined(CONFIGURE_TEST_NEEDS_CLOCK_DRIVER) || \ |
---|
2350 | defined(CONFIGURE_TEST_NEEDS_RTC_DRIVER) || \ |
---|
2351 | defined(CONFIGURE_TEST_NEEDS_STUB_DRIVER) |
---|
2352 | #error "CONFIGURATION ERROR: CONFIGURE_TEST_XXX constants are obsolete" |
---|
2353 | #endif |
---|
2354 | |
---|
2355 | /* |
---|
2356 | * Validate the configured maximum priority |
---|
2357 | */ |
---|
2358 | #if ((CONFIGURE_MAXIMUM_PRIORITY != 3) && \ |
---|
2359 | (CONFIGURE_MAXIMUM_PRIORITY != 7) && \ |
---|
2360 | (CONFIGURE_MAXIMUM_PRIORITY != 15) && \ |
---|
2361 | (CONFIGURE_MAXIMUM_PRIORITY != 31) && \ |
---|
2362 | (CONFIGURE_MAXIMUM_PRIORITY != 63) && \ |
---|
2363 | (CONFIGURE_MAXIMUM_PRIORITY != 127) && \ |
---|
2364 | (CONFIGURE_MAXIMUM_PRIORITY != 255)) |
---|
2365 | #error "Maximum priority is not 1 less than a power of 2 between 4 and 256" |
---|
2366 | #endif |
---|
2367 | |
---|
2368 | #if (CONFIGURE_MAXIMUM_PRIORITY > PRIORITY_DEFAULT_MAXIMUM) |
---|
2369 | #error "Maximum priority configured higher than supported by target." |
---|
2370 | #endif |
---|
2371 | |
---|
2372 | /* |
---|
2373 | * If you have fewer POSIX Message Queue Descriptors than actual |
---|
2374 | * POSIX Message Queues, then you will not be able to open all the |
---|
2375 | * queues. |
---|
2376 | */ |
---|
2377 | #if (CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS < \ |
---|
2378 | CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES) |
---|
2379 | #error "Fewer POSIX Message Queue descriptors than Queues!" |
---|
2380 | #endif |
---|
2381 | |
---|
2382 | #endif |
---|
2383 | /* end of include file */ |
---|