1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief Configuration Table Template that will be Instantiated |
---|
5 | * by an Application |
---|
6 | * |
---|
7 | * This include file contains the configuration table template that will |
---|
8 | * be instantiated by an application based on the setting of a number |
---|
9 | * of macros. The macros are documented in the Configuring a System |
---|
10 | * chapter of the Classic API User's Guide |
---|
11 | */ |
---|
12 | |
---|
13 | /* |
---|
14 | * COPYRIGHT (c) 1989-2015. |
---|
15 | * On-Line Applications Research Corporation (OAR). |
---|
16 | * |
---|
17 | * The license and distribution terms for this file may be |
---|
18 | * found in the file LICENSE in this distribution or at |
---|
19 | * http://www.rtems.org/license/LICENSE. |
---|
20 | */ |
---|
21 | |
---|
22 | #ifndef __CONFIGURATION_TEMPLATE_h |
---|
23 | #define __CONFIGURATION_TEMPLATE_h |
---|
24 | |
---|
25 | /* |
---|
26 | * Include the executive's configuration |
---|
27 | */ |
---|
28 | #include <rtems.h> |
---|
29 | #include <rtems/ioimpl.h> |
---|
30 | #include <rtems/sysinit.h> |
---|
31 | #include <rtems/score/apimutex.h> |
---|
32 | #include <rtems/score/percpu.h> |
---|
33 | #include <rtems/score/userextimpl.h> |
---|
34 | #include <rtems/score/wkspace.h> |
---|
35 | |
---|
36 | #ifdef CONFIGURE_DISABLE_BSP_SETTINGS |
---|
37 | #undef BSP_DEFAULT_UNIFIED_WORK_AREAS |
---|
38 | #undef BSP_IDLE_TASK_BODY |
---|
39 | #undef BSP_IDLE_TASK_STACK_SIZE |
---|
40 | #undef BSP_INITIAL_EXTENSION |
---|
41 | #undef BSP_INTERRUPT_STACK_SIZE |
---|
42 | #undef BSP_MAXIMUM_DEVICES |
---|
43 | #undef BSP_ZERO_WORKSPACE_AUTOMATICALLY |
---|
44 | #undef CONFIGURE_BSP_PREREQUISITE_DRIVERS |
---|
45 | #undef CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK |
---|
46 | #else |
---|
47 | #include <bsp.h> |
---|
48 | #endif |
---|
49 | |
---|
50 | #ifdef RTEMS_NEWLIB |
---|
51 | #include <sys/reent.h> |
---|
52 | #endif |
---|
53 | |
---|
54 | #ifdef __cplusplus |
---|
55 | extern "C" { |
---|
56 | #endif |
---|
57 | |
---|
58 | /* |
---|
59 | * Internal defines must be prefixed with _CONFIGURE to distinguish them from |
---|
60 | * user-provided options which use a CONFIGURE prefix. |
---|
61 | */ |
---|
62 | |
---|
63 | /** |
---|
64 | * @defgroup Configuration RTEMS Configuration |
---|
65 | * |
---|
66 | * This module contains all RTEMS Configuration parameters. |
---|
67 | * |
---|
68 | * The model is to estimate the memory required for each configured item |
---|
69 | * and sum those estimates. The estimate can be too high or too low for |
---|
70 | * a variety of reasons: |
---|
71 | * |
---|
72 | * Reasons estimate is too high: |
---|
73 | * + FP contexts (not all tasks are FP) |
---|
74 | * |
---|
75 | * Reasons estimate is too low: |
---|
76 | * + stacks greater than minimum size |
---|
77 | * + messages |
---|
78 | * + application must account for device driver resources |
---|
79 | * + application must account for add-on library resource requirements |
---|
80 | * |
---|
81 | * NOTE: Eventually this may be able to take into account some of |
---|
82 | * the above. This procedure has evolved from just enough to |
---|
83 | * support the RTEMS Test Suites into something that can be |
---|
84 | * used remarkably reliably by most applications. |
---|
85 | */ |
---|
86 | |
---|
87 | /** |
---|
88 | * This is the Classic API initialization tasks table. |
---|
89 | */ |
---|
90 | extern rtems_initialization_tasks_table Initialization_tasks[]; |
---|
91 | |
---|
92 | #if defined(RTEMS_MULTIPROCESSING) |
---|
93 | /** |
---|
94 | * This it the distributed multiprocessing configuration table. |
---|
95 | */ |
---|
96 | extern rtems_multiprocessing_table Multiprocessing_configuration; |
---|
97 | #endif |
---|
98 | |
---|
99 | #ifdef RTEMS_POSIX_API |
---|
100 | /** |
---|
101 | * This it the POSIX API configuration table. |
---|
102 | */ |
---|
103 | extern posix_api_configuration_table Configuration_POSIX_API; |
---|
104 | #endif |
---|
105 | |
---|
106 | /** |
---|
107 | * This macro determines whether the RTEMS reentrancy support for |
---|
108 | * the Newlib C Library is enabled. |
---|
109 | */ |
---|
110 | #ifdef RTEMS_SCHEDSIM |
---|
111 | #undef RTEMS_NEWLIB |
---|
112 | #endif |
---|
113 | |
---|
114 | #if (defined(RTEMS_NEWLIB) && !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY)) |
---|
115 | #define _CONFIGURE_NEWLIB_EXTENSION 1 |
---|
116 | #else |
---|
117 | #define _CONFIGURE_NEWLIB_EXTENSION 0 |
---|
118 | #endif |
---|
119 | |
---|
120 | #ifndef RTEMS_SCHEDSIM |
---|
121 | #include <rtems/libio_.h> |
---|
122 | |
---|
123 | #ifdef CONFIGURE_INIT |
---|
124 | #ifndef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM |
---|
125 | RTEMS_SYSINIT_ITEM( |
---|
126 | rtems_filesystem_initialize, |
---|
127 | RTEMS_SYSINIT_ROOT_FILESYSTEM, |
---|
128 | RTEMS_SYSINIT_ORDER_MIDDLE |
---|
129 | ); |
---|
130 | #endif |
---|
131 | #endif |
---|
132 | #endif |
---|
133 | |
---|
134 | /** |
---|
135 | * This macro defines the number of POSIX file descriptors allocated |
---|
136 | * and managed by libio. These are the "integer" file descriptors that |
---|
137 | * are used by calls like open(2) and read(2). |
---|
138 | */ |
---|
139 | #ifndef CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS |
---|
140 | #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 3 |
---|
141 | #endif |
---|
142 | |
---|
143 | /* |
---|
144 | * Semaphore count used by the IO library. |
---|
145 | */ |
---|
146 | #define _CONFIGURE_LIBIO_SEMAPHORES 1 |
---|
147 | |
---|
148 | /* |
---|
149 | * POSIX key count used by the IO library. |
---|
150 | */ |
---|
151 | #define _CONFIGURE_LIBIO_POSIX_KEYS 1 |
---|
152 | |
---|
153 | /* |
---|
154 | * Driver Manager Configuration |
---|
155 | */ |
---|
156 | #ifdef RTEMS_DRVMGR_STARTUP |
---|
157 | #define _CONFIGURE_DRVMGR_SEMAPHORES 1 |
---|
158 | #else |
---|
159 | #define _CONFIGURE_DRVMGR_SEMAPHORES 0 |
---|
160 | #endif |
---|
161 | |
---|
162 | #ifdef CONFIGURE_INIT |
---|
163 | rtems_libio_t rtems_libio_iops[CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS]; |
---|
164 | |
---|
165 | /** |
---|
166 | * When instantiating the configuration tables, this variable is |
---|
167 | * initialized to specify the maximum number of file descriptors. |
---|
168 | */ |
---|
169 | const uint32_t rtems_libio_number_iops = RTEMS_ARRAY_SIZE(rtems_libio_iops); |
---|
170 | #endif |
---|
171 | |
---|
172 | /* |
---|
173 | * This macro determines if termios is disabled by this application. |
---|
174 | * This only means that resources will not be reserved. If you end |
---|
175 | * up using termios, it will fail. |
---|
176 | */ |
---|
177 | #ifdef CONFIGURE_TERMIOS_DISABLED |
---|
178 | #define _CONFIGURE_TERMIOS_SEMAPHORES 0 |
---|
179 | #else |
---|
180 | /** |
---|
181 | * This macro specifies the number of serial or PTY ports that will |
---|
182 | * use termios. |
---|
183 | */ |
---|
184 | #ifndef CONFIGURE_NUMBER_OF_TERMIOS_PORTS |
---|
185 | #define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 1 |
---|
186 | #endif |
---|
187 | |
---|
188 | /* |
---|
189 | * This macro reserves the number of semaphores required by termios |
---|
190 | * based upon the number of communication ports that will use it. |
---|
191 | */ |
---|
192 | #define _CONFIGURE_TERMIOS_SEMAPHORES \ |
---|
193 | ((CONFIGURE_NUMBER_OF_TERMIOS_PORTS * 4) + 1) |
---|
194 | #endif |
---|
195 | |
---|
196 | /** |
---|
197 | * This macro specifies the number of PTYs that can be concurrently |
---|
198 | * active. |
---|
199 | */ |
---|
200 | #ifndef CONFIGURE_MAXIMUM_PTYS |
---|
201 | #define CONFIGURE_MAXIMUM_PTYS 0 |
---|
202 | #endif |
---|
203 | |
---|
204 | /** |
---|
205 | * This variable contains the maximum number of PTYs that can be |
---|
206 | * concurrently active. |
---|
207 | */ |
---|
208 | #ifdef CONFIGURE_INIT |
---|
209 | int rtems_telnetd_maximum_ptys = CONFIGURE_MAXIMUM_PTYS; |
---|
210 | #else |
---|
211 | extern int rtems_telnetd_maximum_ptys; |
---|
212 | #endif |
---|
213 | |
---|
214 | #ifdef CONFIGURE_SMP_MAXIMUM_PROCESSORS |
---|
215 | #warning "CONFIGURE_SMP_MAXIMUM_PROCESSORS has been renamed to CONFIGURE_MAXIMUM_PROCESSORS since RTEMS 4.12" |
---|
216 | #define CONFIGURE_MAXIMUM_PROCESSORS CONFIGURE_SMP_MAXIMUM_PROCESSORS |
---|
217 | #endif |
---|
218 | |
---|
219 | #ifndef CONFIGURE_MAXIMUM_PROCESSORS |
---|
220 | #define CONFIGURE_MAXIMUM_PROCESSORS 1 |
---|
221 | #endif |
---|
222 | |
---|
223 | /* |
---|
224 | * An internal define to indicate that this is an SMP application |
---|
225 | * configuration. |
---|
226 | */ |
---|
227 | #ifdef RTEMS_SMP |
---|
228 | #if !defined(CONFIGURE_DISABLE_SMP_CONFIGURATION) |
---|
229 | #define _CONFIGURE_SMP_APPLICATION |
---|
230 | #elif CONFIGURE_MAXIMUM_PROCESSORS > 1 |
---|
231 | #error "CONFIGURE_DISABLE_SMP_CONFIGURATION and CONFIGURE_MAXIMUM_PROCESSORS > 1 makes no sense" |
---|
232 | #endif |
---|
233 | #endif |
---|
234 | |
---|
235 | #ifdef CONFIGURE_SMP_APPLICATION |
---|
236 | #warning "CONFIGURE_SMP_APPLICATION is obsolete since RTEMS 4.12" |
---|
237 | #endif |
---|
238 | |
---|
239 | /* |
---|
240 | * This sets up the resources for the FIFOs/pipes. |
---|
241 | */ |
---|
242 | |
---|
243 | /** |
---|
244 | * This is specified to configure the maximum number of POSIX FIFOs. |
---|
245 | */ |
---|
246 | #if !defined(CONFIGURE_MAXIMUM_FIFOS) |
---|
247 | #define CONFIGURE_MAXIMUM_FIFOS 0 |
---|
248 | #endif |
---|
249 | |
---|
250 | /** |
---|
251 | * This is specified to configure the maximum number of POSIX named pipes. |
---|
252 | */ |
---|
253 | #if !defined(CONFIGURE_MAXIMUM_PIPES) |
---|
254 | #define CONFIGURE_MAXIMUM_PIPES 0 |
---|
255 | #endif |
---|
256 | |
---|
257 | /* |
---|
258 | * This specifies the number of barriers required for the configured |
---|
259 | * number of FIFOs and named pipes. |
---|
260 | */ |
---|
261 | #if CONFIGURE_MAXIMUM_FIFOS > 0 || CONFIGURE_MAXIMUM_PIPES > 0 |
---|
262 | #define _CONFIGURE_BARRIERS_FOR_FIFOS \ |
---|
263 | (2 * (CONFIGURE_MAXIMUM_FIFOS + CONFIGURE_MAXIMUM_PIPES)) |
---|
264 | #else |
---|
265 | #define _CONFIGURE_BARRIERS_FOR_FIFOS 0 |
---|
266 | #endif |
---|
267 | |
---|
268 | /* |
---|
269 | * This specifies the number of semaphores required for the configured |
---|
270 | * number of FIFOs and named pipes. |
---|
271 | */ |
---|
272 | #if CONFIGURE_MAXIMUM_FIFOS > 0 || CONFIGURE_MAXIMUM_PIPES > 0 |
---|
273 | #define _CONFIGURE_SEMAPHORES_FOR_FIFOS \ |
---|
274 | (1 + (CONFIGURE_MAXIMUM_FIFOS + CONFIGURE_MAXIMUM_PIPES)) |
---|
275 | #else |
---|
276 | #define _CONFIGURE_SEMAPHORES_FOR_FIFOS 0 |
---|
277 | #endif |
---|
278 | |
---|
279 | /** |
---|
280 | * @defgroup ConfigFilesystems Filesystems and Mount Table Configuration |
---|
281 | * |
---|
282 | * @ingroup Configuration |
---|
283 | * |
---|
284 | * Defines to control the file system: |
---|
285 | * |
---|
286 | * - CONFIGURE_APPLICATION_DISABLE_FILESYSTEM: |
---|
287 | * Disable the RTEMS filesystems. You get an empty DEVFS. |
---|
288 | * |
---|
289 | * - CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM: |
---|
290 | * Use the DEVFS as the root file system. Limited functions are |
---|
291 | * provided when this is used. |
---|
292 | * |
---|
293 | * - CONFIGURE_FILESYSTEM_ALL: |
---|
294 | * Add file filesystems to the default filesystem table. |
---|
295 | * |
---|
296 | * List of available file systems. You can define as many as you like: |
---|
297 | * - CONFIGURE_FILESYSTEM_IMFS - In Memory File System (IMFS) |
---|
298 | * - CONFIGURE_FILESYSTEM_DEVFS - Device File System (DSVFS) |
---|
299 | * - CONFIGURE_FILESYSTEM_TFTPFS - TFTP File System, networking enabled |
---|
300 | * - CONFIGURE_FILESYSTEM_FTPFS - FTP File System, networking enabled |
---|
301 | * - CONFIGURE_FILESYSTEM_NFS - Network File System, networking enabled |
---|
302 | * - CONFIGURE_FILESYSTEM_DOSFS - DOS File System, uses libblock |
---|
303 | * - CONFIGURE_FILESYSTEM_RFS - RTEMS File System (RFS), uses libblock |
---|
304 | * - CONFIGURE_FILESYSTEM_JFFS2 - Journalling Flash File System, Version 2 |
---|
305 | * |
---|
306 | * Combinations: |
---|
307 | * |
---|
308 | * - If nothing is defined the base file system is the IMFS. |
---|
309 | * |
---|
310 | * - If CONFIGURE_APPLICATION_DISABLE_FILESYSTEM is defined all filesystems |
---|
311 | * are disabled by force. |
---|
312 | * |
---|
313 | * - If CONFIGURE_USE_DEV_AS_BASE_FILESYSTEM is defined all filesystems |
---|
314 | * are disabled by force and DEVFS is defined. |
---|
315 | */ |
---|
316 | /**@{*/ |
---|
317 | |
---|
318 | #ifdef CONFIGURE_INIT |
---|
319 | |
---|
320 | /* |
---|
321 | * Include all file systems. Do this before checking if the filesystem has |
---|
322 | * been disabled. |
---|
323 | */ |
---|
324 | #ifdef CONFIGURE_FILESYSTEM_ALL |
---|
325 | #define CONFIGURE_FILESYSTEM_IMFS |
---|
326 | #define CONFIGURE_FILESYSTEM_DEVFS |
---|
327 | #define CONFIGURE_FILESYSTEM_TFTPFS |
---|
328 | #define CONFIGURE_FILESYSTEM_FTPFS |
---|
329 | #define CONFIGURE_FILESYSTEM_NFS |
---|
330 | #define CONFIGURE_FILESYSTEM_DOSFS |
---|
331 | #define CONFIGURE_FILESYSTEM_RFS |
---|
332 | #define CONFIGURE_FILESYSTEM_JFFS2 |
---|
333 | #endif |
---|
334 | |
---|
335 | /* |
---|
336 | * If disabling the file system, give a compile error if the user has |
---|
337 | * configured other filesystem parameters. |
---|
338 | */ |
---|
339 | #if defined(CONFIGURE_APPLICATION_DISABLE_FILESYSTEM) |
---|
340 | #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM) |
---|
341 | #error "Filesystem disabled and a base filesystem configured." |
---|
342 | #endif |
---|
343 | |
---|
344 | #if defined(CONFIGURE_FILESYSTEM_IMFS) || \ |
---|
345 | defined(CONFIGURE_FILESYSTEM_DEVFS) || \ |
---|
346 | defined(CONFIGURE_FILESYSTEM_TFTPFS) || \ |
---|
347 | defined(CONFIGURE_FILESYSTEM_FTPFS) || \ |
---|
348 | defined(CONFIGURE_FILESYSTEM_NFS) || \ |
---|
349 | defined(CONFIGURE_FILESYSTEM_DOSFS) || \ |
---|
350 | defined(CONFIGURE_FILESYSTEM_RFS) || \ |
---|
351 | defined(CONFIGURE_FILESYSTEM_JFFS2) |
---|
352 | #error "Filesystem disabled and a filesystem configured." |
---|
353 | #endif |
---|
354 | #endif |
---|
355 | |
---|
356 | /* |
---|
357 | * If the base filesystem is DEVFS define it else define IMFS. |
---|
358 | * We will have either DEVFS or IMFS defined after this. |
---|
359 | */ |
---|
360 | #if !defined(CONFIGURE_APPLICATION_DISABLE_FILESYSTEM) |
---|
361 | #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM) |
---|
362 | #define CONFIGURE_FILESYSTEM_DEVFS |
---|
363 | #endif |
---|
364 | #endif |
---|
365 | |
---|
366 | #endif |
---|
367 | |
---|
368 | #ifndef RTEMS_SCHEDSIM |
---|
369 | /** |
---|
370 | * IMFS |
---|
371 | */ |
---|
372 | #include <rtems/imfs.h> |
---|
373 | |
---|
374 | /** |
---|
375 | * This specifies the number of bytes per block for files within the IMFS. |
---|
376 | * There are a maximum number of blocks per file so this dictates the maximum |
---|
377 | * size of a file. This has to be balanced with the unused portion of each |
---|
378 | * block that might be wasted. |
---|
379 | */ |
---|
380 | #ifndef CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK |
---|
381 | #define CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK \ |
---|
382 | IMFS_MEMFILE_DEFAULT_BYTES_PER_BLOCK |
---|
383 | #endif |
---|
384 | |
---|
385 | /** |
---|
386 | * This defines the IMFS file system table entry. |
---|
387 | */ |
---|
388 | #if !defined(CONFIGURE_FILESYSTEM_ENTRY_IMFS) && \ |
---|
389 | defined(CONFIGURE_FILESYSTEM_IMFS) |
---|
390 | #define CONFIGURE_FILESYSTEM_ENTRY_IMFS \ |
---|
391 | { RTEMS_FILESYSTEM_TYPE_IMFS, IMFS_initialize } |
---|
392 | #endif |
---|
393 | #endif |
---|
394 | |
---|
395 | #ifdef CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM |
---|
396 | #define CONFIGURE_IMFS_DISABLE_CHMOD |
---|
397 | #define CONFIGURE_IMFS_DISABLE_CHOWN |
---|
398 | #define CONFIGURE_IMFS_DISABLE_UTIME |
---|
399 | #define CONFIGURE_IMFS_DISABLE_LINK |
---|
400 | #define CONFIGURE_IMFS_DISABLE_SYMLINK |
---|
401 | #define CONFIGURE_IMFS_DISABLE_READLINK |
---|
402 | #define CONFIGURE_IMFS_DISABLE_RENAME |
---|
403 | #define CONFIGURE_IMFS_DISABLE_UNMOUNT |
---|
404 | #endif |
---|
405 | |
---|
406 | /** |
---|
407 | * DEVFS |
---|
408 | */ |
---|
409 | #if !defined(CONFIGURE_FILESYSTEM_ENTRY_DEVFS) && \ |
---|
410 | defined(CONFIGURE_FILESYSTEM_DEVFS) |
---|
411 | #include <rtems/devfs.h> |
---|
412 | #define CONFIGURE_FILESYSTEM_ENTRY_DEVFS \ |
---|
413 | { RTEMS_FILESYSTEM_TYPE_DEVFS, devFS_initialize } |
---|
414 | #endif |
---|
415 | |
---|
416 | /** |
---|
417 | * FTPFS |
---|
418 | */ |
---|
419 | #if !defined(CONFIGURE_FILESYSTEM_ENTRY_FTPFS) && \ |
---|
420 | defined(CONFIGURE_FILESYSTEM_FTPFS) |
---|
421 | #include <rtems/ftpfs.h> |
---|
422 | #define CONFIGURE_FILESYSTEM_ENTRY_FTPFS \ |
---|
423 | { RTEMS_FILESYSTEM_TYPE_FTPFS, rtems_ftpfs_initialize } |
---|
424 | #endif |
---|
425 | |
---|
426 | /** |
---|
427 | * TFTPFS |
---|
428 | */ |
---|
429 | #if !defined(CONFIGURE_FILESYSTEM_ENTRY_TFTPFS) && \ |
---|
430 | defined(CONFIGURE_FILESYSTEM_TFTPFS) |
---|
431 | #include <rtems/tftp.h> |
---|
432 | #define CONFIGURE_FILESYSTEM_ENTRY_TFTPFS \ |
---|
433 | { RTEMS_FILESYSTEM_TYPE_TFTPFS, rtems_tftpfs_initialize } |
---|
434 | #endif |
---|
435 | |
---|
436 | /** |
---|
437 | * NFS |
---|
438 | */ |
---|
439 | #if !defined(CONFIGURE_FILESYSTEM_ENTRY_NFS) && \ |
---|
440 | defined(CONFIGURE_FILESYSTEM_NFS) |
---|
441 | #include <librtemsNfs.h> |
---|
442 | #if !defined(CONFIGURE_MAXIMUM_NFS_MOUNTS) |
---|
443 | #define CONFIGURE_MAXIMUM_NFS_MOUNTS 1 |
---|
444 | #endif |
---|
445 | #define CONFIGURE_FILESYSTEM_ENTRY_NFS \ |
---|
446 | { RTEMS_FILESYSTEM_TYPE_NFS, rtems_nfs_initialize } |
---|
447 | #define _CONFIGURE_SEMAPHORES_FOR_NFS ((CONFIGURE_MAXIMUM_NFS_MOUNTS * 2) + 1) |
---|
448 | #else |
---|
449 | #define _CONFIGURE_SEMAPHORES_FOR_NFS 0 |
---|
450 | #endif |
---|
451 | |
---|
452 | /** |
---|
453 | * DOSFS |
---|
454 | */ |
---|
455 | #if !defined(CONFIGURE_FILESYSTEM_ENTRY_DOSFS) && \ |
---|
456 | defined(CONFIGURE_FILESYSTEM_DOSFS) |
---|
457 | #include <rtems/dosfs.h> |
---|
458 | #if !defined(CONFIGURE_MAXIMUM_DOSFS_MOUNTS) |
---|
459 | #define CONFIGURE_MAXIMUM_DOSFS_MOUNTS 1 |
---|
460 | #endif |
---|
461 | #define CONFIGURE_FILESYSTEM_ENTRY_DOSFS \ |
---|
462 | { RTEMS_FILESYSTEM_TYPE_DOSFS, rtems_dosfs_initialize } |
---|
463 | #define _CONFIGURE_SEMAPHORES_FOR_DOSFS CONFIGURE_MAXIMUM_DOSFS_MOUNTS |
---|
464 | #else |
---|
465 | #define _CONFIGURE_SEMAPHORES_FOR_DOSFS 0 |
---|
466 | #endif |
---|
467 | |
---|
468 | /** |
---|
469 | * RFS |
---|
470 | */ |
---|
471 | #if !defined(CONFIGURE_FILESYSTEM_ENTRY_RFS) && \ |
---|
472 | defined(CONFIGURE_FILESYSTEM_RFS) |
---|
473 | #include <rtems/rtems-rfs.h> |
---|
474 | #if !defined(CONFIGURE_MAXIMUM_RFS_MOUNTS) |
---|
475 | #define CONFIGURE_MAXIMUM_RFS_MOUNTS 1 |
---|
476 | #endif |
---|
477 | #define CONFIGURE_FILESYSTEM_ENTRY_RFS \ |
---|
478 | { RTEMS_FILESYSTEM_TYPE_RFS, rtems_rfs_rtems_initialise } |
---|
479 | #define _CONFIGURE_SEMAPHORES_FOR_RFS CONFIGURE_MAXIMUM_RFS_MOUNTS |
---|
480 | #else |
---|
481 | #define _CONFIGURE_SEMAPHORES_FOR_RFS 0 |
---|
482 | #endif |
---|
483 | |
---|
484 | /** |
---|
485 | * JFFS2 |
---|
486 | */ |
---|
487 | #if !defined(CONFIGURE_FILESYSTEM_ENTRY_JFFS2) && \ |
---|
488 | defined(CONFIGURE_FILESYSTEM_JFFS2) |
---|
489 | #include <rtems/jffs2.h> |
---|
490 | #if !defined(CONFIGURE_MAXIMUM_JFFS2_MOUNTS) |
---|
491 | #define CONFIGURE_MAXIMUM_JFFS2_MOUNTS 1 |
---|
492 | #endif |
---|
493 | #define CONFIGURE_FILESYSTEM_ENTRY_JFFS2 \ |
---|
494 | { RTEMS_FILESYSTEM_TYPE_JFFS2, rtems_jffs2_initialize } |
---|
495 | #define _CONFIGURE_SEMAPHORES_FOR_JFFS2 CONFIGURE_MAXIMUM_JFFS2_MOUNTS |
---|
496 | #else |
---|
497 | #define _CONFIGURE_SEMAPHORES_FOR_JFFS2 0 |
---|
498 | #endif |
---|
499 | |
---|
500 | /** |
---|
501 | * This computes the number of semaphores required for the various |
---|
502 | * file systems including the FIFO plugin to the IMFS. |
---|
503 | */ |
---|
504 | #define _CONFIGURE_SEMAPHORES_FOR_FILE_SYSTEMS \ |
---|
505 | (_CONFIGURE_SEMAPHORES_FOR_FIFOS + \ |
---|
506 | _CONFIGURE_SEMAPHORES_FOR_NFS + \ |
---|
507 | _CONFIGURE_SEMAPHORES_FOR_DOSFS + \ |
---|
508 | _CONFIGURE_SEMAPHORES_FOR_RFS + \ |
---|
509 | _CONFIGURE_SEMAPHORES_FOR_JFFS2) |
---|
510 | |
---|
511 | #ifdef CONFIGURE_INIT |
---|
512 | |
---|
513 | /** |
---|
514 | * DEVFS variables. |
---|
515 | * |
---|
516 | * The number of individual devices that may be registered |
---|
517 | * in the system or the CONFIGURE_MAXIMUM_DEVICES variable |
---|
518 | * is defaulted to 4 when a filesystem is enabled, unless |
---|
519 | * the bsp overwrides this. In which case the value is set |
---|
520 | * to BSP_MAXIMUM_DEVICES. |
---|
521 | */ |
---|
522 | #ifdef CONFIGURE_FILESYSTEM_DEVFS |
---|
523 | #ifndef CONFIGURE_MAXIMUM_DEVICES |
---|
524 | #if defined(BSP_MAXIMUM_DEVICES) |
---|
525 | #define CONFIGURE_MAXIMUM_DEVICES BSP_MAXIMUM_DEVICES |
---|
526 | #else |
---|
527 | #define CONFIGURE_MAXIMUM_DEVICES 4 |
---|
528 | #endif |
---|
529 | #endif |
---|
530 | #include <rtems/devfs.h> |
---|
531 | #endif |
---|
532 | |
---|
533 | /** |
---|
534 | * Table termination record. |
---|
535 | */ |
---|
536 | #define CONFIGURE_FILESYSTEM_NULL { NULL, NULL } |
---|
537 | |
---|
538 | #ifndef RTEMS_SCHEDSIM |
---|
539 | #if !defined(CONFIGURE_APPLICATION_DISABLE_FILESYSTEM) && \ |
---|
540 | !defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM) |
---|
541 | int imfs_rq_memfile_bytes_per_block = |
---|
542 | CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK; |
---|
543 | #endif |
---|
544 | |
---|
545 | /** |
---|
546 | * The default file system table. Must be terminated with the NULL entry if |
---|
547 | * you provide your own. |
---|
548 | */ |
---|
549 | #if !defined(CONFIGURE_HAS_OWN_FILESYSTEM_TABLE) && \ |
---|
550 | !defined(CONFIGURE_APPLICATION_DISABLE_FILESYSTEM) |
---|
551 | const rtems_filesystem_table_t rtems_filesystem_table[] = { |
---|
552 | #if !defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM) |
---|
553 | { "/", IMFS_initialize_support }, |
---|
554 | #endif |
---|
555 | #if defined(CONFIGURE_FILESYSTEM_IMFS) && \ |
---|
556 | defined(CONFIGURE_FILESYSTEM_ENTRY_IMFS) |
---|
557 | CONFIGURE_FILESYSTEM_ENTRY_IMFS, |
---|
558 | #endif |
---|
559 | #if defined(CONFIGURE_FILESYSTEM_DEVFS) && \ |
---|
560 | defined(CONFIGURE_FILESYSTEM_ENTRY_DEVFS) |
---|
561 | CONFIGURE_FILESYSTEM_ENTRY_DEVFS, |
---|
562 | #endif |
---|
563 | #if defined(CONFIGURE_FILESYSTEM_TFTPFS) && \ |
---|
564 | defined(CONFIGURE_FILESYSTEM_ENTRY_TFTPFS) |
---|
565 | CONFIGURE_FILESYSTEM_ENTRY_TFTPFS, |
---|
566 | #endif |
---|
567 | #if defined(CONFIGURE_FILESYSTEM_FTPFS) && \ |
---|
568 | defined(CONFIGURE_FILESYSTEM_ENTRY_FTPFS) |
---|
569 | CONFIGURE_FILESYSTEM_ENTRY_FTPFS, |
---|
570 | #endif |
---|
571 | #if defined(CONFIGURE_FILESYSTEM_NFS) && \ |
---|
572 | defined(CONFIGURE_FILESYSTEM_ENTRY_NFS) |
---|
573 | CONFIGURE_FILESYSTEM_ENTRY_NFS, |
---|
574 | #endif |
---|
575 | #if defined(CONFIGURE_FILESYSTEM_DOSFS) && \ |
---|
576 | defined(CONFIGURE_FILESYSTEM_ENTRY_DOSFS) |
---|
577 | CONFIGURE_FILESYSTEM_ENTRY_DOSFS, |
---|
578 | #endif |
---|
579 | #if defined(CONFIGURE_FILESYSTEM_RFS) && \ |
---|
580 | defined(CONFIGURE_FILESYSTEM_ENTRY_RFS) |
---|
581 | CONFIGURE_FILESYSTEM_ENTRY_RFS, |
---|
582 | #endif |
---|
583 | #if defined(CONFIGURE_FILESYSTEM_JFFS2) && \ |
---|
584 | defined(CONFIGURE_FILESYSTEM_ENTRY_JFFS2) |
---|
585 | CONFIGURE_FILESYSTEM_ENTRY_JFFS2, |
---|
586 | #endif |
---|
587 | CONFIGURE_FILESYSTEM_NULL |
---|
588 | }; |
---|
589 | #endif |
---|
590 | |
---|
591 | #if !defined(CONFIGURE_HAS_OWN_MOUNT_TABLE) && \ |
---|
592 | !defined(CONFIGURE_APPLICATION_DISABLE_FILESYSTEM) |
---|
593 | #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM) |
---|
594 | static devFS_node devFS_root_filesystem_nodes [CONFIGURE_MAXIMUM_DEVICES]; |
---|
595 | static const devFS_data devFS_root_filesystem_data = { |
---|
596 | devFS_root_filesystem_nodes, |
---|
597 | CONFIGURE_MAXIMUM_DEVICES |
---|
598 | }; |
---|
599 | #else |
---|
600 | static IMFS_fs_info_t _Configure_IMFS_fs_info; |
---|
601 | |
---|
602 | static const rtems_filesystem_operations_table _Configure_IMFS_ops = { |
---|
603 | rtems_filesystem_default_lock, |
---|
604 | rtems_filesystem_default_unlock, |
---|
605 | IMFS_eval_path, |
---|
606 | #ifdef CONFIGURE_IMFS_DISABLE_LINK |
---|
607 | rtems_filesystem_default_link, |
---|
608 | #else |
---|
609 | IMFS_link, |
---|
610 | #endif |
---|
611 | rtems_filesystem_default_are_nodes_equal, |
---|
612 | #ifdef CONFIGURE_IMFS_DISABLE_MKNOD |
---|
613 | rtems_filesystem_default_mknod, |
---|
614 | #else |
---|
615 | IMFS_mknod, |
---|
616 | #endif |
---|
617 | #ifdef CONFIGURE_IMFS_DISABLE_RMNOD |
---|
618 | rtems_filesystem_default_rmnod, |
---|
619 | #else |
---|
620 | IMFS_rmnod, |
---|
621 | #endif |
---|
622 | #ifdef CONFIGURE_IMFS_DISABLE_CHMOD |
---|
623 | rtems_filesystem_default_fchmod, |
---|
624 | #else |
---|
625 | IMFS_fchmod, |
---|
626 | #endif |
---|
627 | #ifdef CONFIGURE_IMFS_DISABLE_CHOWN |
---|
628 | rtems_filesystem_default_chown, |
---|
629 | #else |
---|
630 | IMFS_chown, |
---|
631 | #endif |
---|
632 | IMFS_node_clone, |
---|
633 | IMFS_node_free, |
---|
634 | #ifdef CONFIGURE_IMFS_DISABLE_MOUNT |
---|
635 | rtems_filesystem_default_mount, |
---|
636 | #else |
---|
637 | IMFS_mount, |
---|
638 | #endif |
---|
639 | #ifdef CONFIGURE_IMFS_DISABLE_UNMOUNT |
---|
640 | rtems_filesystem_default_unmount, |
---|
641 | #else |
---|
642 | IMFS_unmount, |
---|
643 | #endif |
---|
644 | rtems_filesystem_default_fsunmount, |
---|
645 | #ifdef CONFIGURE_IMFS_DISABLE_UTIME |
---|
646 | rtems_filesystem_default_utime, |
---|
647 | #else |
---|
648 | IMFS_utime, |
---|
649 | #endif |
---|
650 | #ifdef CONFIGURE_IMFS_DISABLE_SYMLINK |
---|
651 | rtems_filesystem_default_symlink, |
---|
652 | #else |
---|
653 | IMFS_symlink, |
---|
654 | #endif |
---|
655 | #ifdef CONFIGURE_IMFS_DISABLE_READLINK |
---|
656 | rtems_filesystem_default_readlink, |
---|
657 | #else |
---|
658 | IMFS_readlink, |
---|
659 | #endif |
---|
660 | #ifdef CONFIGURE_IMFS_DISABLE_RENAME |
---|
661 | rtems_filesystem_default_rename, |
---|
662 | #else |
---|
663 | IMFS_rename, |
---|
664 | #endif |
---|
665 | rtems_filesystem_default_statvfs |
---|
666 | }; |
---|
667 | |
---|
668 | static const IMFS_mknod_controls _Configure_IMFS_mknod_controls = { |
---|
669 | #ifdef CONFIGURE_IMFS_DISABLE_READDIR |
---|
670 | &IMFS_mknod_control_dir_minimal, |
---|
671 | #else |
---|
672 | &IMFS_mknod_control_dir_default, |
---|
673 | #endif |
---|
674 | &IMFS_mknod_control_device, |
---|
675 | #ifdef CONFIGURE_IMFS_DISABLE_MKNOD_FILE |
---|
676 | &IMFS_mknod_control_enosys, |
---|
677 | #else |
---|
678 | &IMFS_mknod_control_memfile, |
---|
679 | #endif |
---|
680 | #if CONFIGURE_MAXIMUM_FIFOS > 0 || CONFIGURE_MAXIMUM_PIPES > 0 |
---|
681 | &IMFS_mknod_control_fifo |
---|
682 | #else |
---|
683 | &IMFS_mknod_control_enosys |
---|
684 | #endif |
---|
685 | }; |
---|
686 | |
---|
687 | static const IMFS_mount_data _Configure_IMFS_mount_data = { |
---|
688 | &_Configure_IMFS_fs_info, |
---|
689 | &_Configure_IMFS_ops, |
---|
690 | &_Configure_IMFS_mknod_controls |
---|
691 | }; |
---|
692 | #endif |
---|
693 | |
---|
694 | const rtems_filesystem_mount_configuration |
---|
695 | rtems_filesystem_root_configuration = { |
---|
696 | NULL, |
---|
697 | NULL, |
---|
698 | #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM) |
---|
699 | RTEMS_FILESYSTEM_TYPE_DEVFS, |
---|
700 | #else |
---|
701 | "/", |
---|
702 | #endif |
---|
703 | RTEMS_FILESYSTEM_READ_WRITE, |
---|
704 | #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM) |
---|
705 | &devFS_root_filesystem_data |
---|
706 | #else |
---|
707 | &_Configure_IMFS_mount_data |
---|
708 | #endif |
---|
709 | }; |
---|
710 | #endif |
---|
711 | |
---|
712 | #endif |
---|
713 | #endif |
---|
714 | /**@}*/ /* end of file system group */ |
---|
715 | |
---|
716 | /* |
---|
717 | * STACK_CHECKER_ON was still available in 4.9 so give a warning for now. |
---|
718 | */ |
---|
719 | #if defined(STACK_CHECKER_ON) |
---|
720 | #define CONFIGURE_STACK_CHECKER_ENABLED |
---|
721 | #warning "STACK_CHECKER_ON deprecated -- use CONFIGURE_STACK_CHECKER_ENABLED" |
---|
722 | #endif |
---|
723 | |
---|
724 | /** |
---|
725 | * This configures the stack checker user extension. |
---|
726 | */ |
---|
727 | #ifdef CONFIGURE_STACK_CHECKER_ENABLED |
---|
728 | #define _CONFIGURE_STACK_CHECKER_EXTENSION 1 |
---|
729 | #else |
---|
730 | #define _CONFIGURE_STACK_CHECKER_EXTENSION 0 |
---|
731 | #endif |
---|
732 | |
---|
733 | /** |
---|
734 | * @brief Maximum priority configuration. |
---|
735 | * |
---|
736 | * This configures the maximum priority value that |
---|
737 | * a task may have. |
---|
738 | * |
---|
739 | * The following applies to the data space requirements |
---|
740 | * of the Priority Scheduler. |
---|
741 | * |
---|
742 | * By reducing the number of priorities in a system, |
---|
743 | * the amount of RAM required by RTEMS can be significantly |
---|
744 | * reduced. RTEMS allocates a Chain_Control structure per |
---|
745 | * priority and this structure contains 3 pointers. So |
---|
746 | * the default is (256 * 12) = 3K on 32-bit architectures. |
---|
747 | * |
---|
748 | * This must be one less than a power of 2 between |
---|
749 | * 4 and 256. Valid values along with the application |
---|
750 | * priority levels and memory saved when pointers are |
---|
751 | * 32-bits in size are: |
---|
752 | * |
---|
753 | * + 3, 2 application priorities, 3024 bytes saved |
---|
754 | * + 7, 5 application priorities, 2976 bytes saved |
---|
755 | * + 15, 13 application priorities, 2880 bytes saved |
---|
756 | * + 31, 29 application priorities, 2688 bytes saved |
---|
757 | * + 63, 61 application priorities, 2304 bytes saved |
---|
758 | * + 127, 125 application priorities, 1536 bytes saved |
---|
759 | * + 255, 253 application priorities, 0 bytes saved |
---|
760 | * |
---|
761 | * It is specified in terms of Classic API priority values. |
---|
762 | */ |
---|
763 | #ifndef CONFIGURE_MAXIMUM_PRIORITY |
---|
764 | #define CONFIGURE_MAXIMUM_PRIORITY PRIORITY_DEFAULT_MAXIMUM |
---|
765 | #endif |
---|
766 | |
---|
767 | /** |
---|
768 | * @defgroup ConfigScheduler Scheduler configuration |
---|
769 | * |
---|
770 | * @ingroup Configuration |
---|
771 | * |
---|
772 | * The scheduler configuration allows an application to select the |
---|
773 | * scheduling policy to use. The supported configurations are: |
---|
774 | * |
---|
775 | * - CONFIGURE_SCHEDULER_PRIORITY - Deterministic Priority Scheduler |
---|
776 | * - CONFIGURE_SCHEDULER_PRIORITY_SMP - Deterministic Priority SMP Scheduler |
---|
777 | * - CONFIGURE_SCHEDULER_PRIORITY_AFFINITY_SMP - Deterministic |
---|
778 | * Priority SMP Affinity Scheduler |
---|
779 | * - CONFIGURE_SCHEDULER_STRONG_APA - Strong APA Scheduler |
---|
780 | * - CONFIGURE_SCHEDULER_SIMPLE - Light-weight Priority Scheduler |
---|
781 | * - CONFIGURE_SCHEDULER_SIMPLE_SMP - Simple SMP Priority Scheduler |
---|
782 | * - CONFIGURE_SCHEDULER_EDF - EDF Scheduler |
---|
783 | * - CONFIGURE_SCHEDULER_CBS - CBS Scheduler |
---|
784 | * - CONFIGURE_SCHEDULER_USER - user provided scheduler |
---|
785 | * |
---|
786 | * If no configuration is specified by the application in a uniprocessor |
---|
787 | * configuration, then CONFIGURE_SCHEDULER_PRIORITY is the default. |
---|
788 | * |
---|
789 | * If no configuration is specified by the application in SMP |
---|
790 | * configuration, then CONFIGURE_SCHEDULER_PRIORITY_SMP is the default. |
---|
791 | * |
---|
792 | * An application can define its own scheduling policy by defining |
---|
793 | * CONFIGURE_SCHEDULER_USER and the following: |
---|
794 | * |
---|
795 | * - CONFIGURE_SCHEDULER_CONTEXT |
---|
796 | * - CONFIGURE_SCHEDULER_CONTROLS |
---|
797 | * - CONFIGURE_SCHEDULER_USER_PER_THREAD |
---|
798 | */ |
---|
799 | |
---|
800 | #if !defined(CONFIGURE_SCHEDULER_USER) && \ |
---|
801 | !defined(CONFIGURE_SCHEDULER_PRIORITY) && \ |
---|
802 | !defined(CONFIGURE_SCHEDULER_PRIORITY_SMP) && \ |
---|
803 | !defined(CONFIGURE_SCHEDULER_PRIORITY_AFFINITY_SMP) && \ |
---|
804 | !defined(CONFIGURE_SCHEDULER_STRONG_APA) && \ |
---|
805 | !defined(CONFIGURE_SCHEDULER_SIMPLE) && \ |
---|
806 | !defined(CONFIGURE_SCHEDULER_SIMPLE_SMP) && \ |
---|
807 | !defined(CONFIGURE_SCHEDULER_EDF) && \ |
---|
808 | !defined(CONFIGURE_SCHEDULER_CBS) |
---|
809 | #if defined(RTEMS_SMP) && CONFIGURE_MAXIMUM_PROCESSORS > 1 |
---|
810 | /** |
---|
811 | * If no scheduler is specified in an SMP configuration, the |
---|
812 | * priority scheduler is default. |
---|
813 | */ |
---|
814 | #define CONFIGURE_SCHEDULER_PRIORITY_SMP |
---|
815 | #else |
---|
816 | /** |
---|
817 | * If no scheduler is specified in a uniprocessor configuration, the |
---|
818 | * priority scheduler is default. |
---|
819 | */ |
---|
820 | #define CONFIGURE_SCHEDULER_PRIORITY |
---|
821 | #endif |
---|
822 | #endif |
---|
823 | |
---|
824 | #include <rtems/scheduler.h> |
---|
825 | |
---|
826 | /* |
---|
827 | * If the Priority Scheduler is selected, then configure for it. |
---|
828 | */ |
---|
829 | #if defined(CONFIGURE_SCHEDULER_PRIORITY) |
---|
830 | #if !defined(CONFIGURE_SCHEDULER_NAME) |
---|
831 | /** Configure the name of the scheduler instance */ |
---|
832 | #define CONFIGURE_SCHEDULER_NAME rtems_build_name('U', 'P', 'D', ' ') |
---|
833 | #endif |
---|
834 | |
---|
835 | #if !defined(CONFIGURE_SCHEDULER_CONTROLS) |
---|
836 | /** Configure the context needed by the scheduler instance */ |
---|
837 | #define CONFIGURE_SCHEDULER_CONTEXT \ |
---|
838 | RTEMS_SCHEDULER_CONTEXT_PRIORITY( \ |
---|
839 | dflt, \ |
---|
840 | CONFIGURE_MAXIMUM_PRIORITY + 1 \ |
---|
841 | ) |
---|
842 | |
---|
843 | /** Configure the controls for this scheduler instance */ |
---|
844 | #define CONFIGURE_SCHEDULER_CONTROLS \ |
---|
845 | RTEMS_SCHEDULER_CONTROL_PRIORITY(dflt, CONFIGURE_SCHEDULER_NAME) |
---|
846 | #endif |
---|
847 | #endif |
---|
848 | |
---|
849 | /* |
---|
850 | * If the Deterministic Priority SMP Scheduler is selected, then configure for |
---|
851 | * it. |
---|
852 | */ |
---|
853 | #if defined(CONFIGURE_SCHEDULER_PRIORITY_SMP) |
---|
854 | #if !defined(CONFIGURE_SCHEDULER_NAME) |
---|
855 | /** Configure the name of the scheduler instance */ |
---|
856 | #define CONFIGURE_SCHEDULER_NAME rtems_build_name('M', 'P', 'D', ' ') |
---|
857 | #endif |
---|
858 | |
---|
859 | #if !defined(CONFIGURE_SCHEDULER_CONTROLS) |
---|
860 | /** Configure the context needed by the scheduler instance */ |
---|
861 | #define CONFIGURE_SCHEDULER_CONTEXT \ |
---|
862 | RTEMS_SCHEDULER_CONTEXT_PRIORITY_SMP( \ |
---|
863 | dflt, \ |
---|
864 | CONFIGURE_MAXIMUM_PRIORITY + 1 \ |
---|
865 | ) |
---|
866 | |
---|
867 | /** Configure the controls for this scheduler instance */ |
---|
868 | #define CONFIGURE_SCHEDULER_CONTROLS \ |
---|
869 | RTEMS_SCHEDULER_CONTROL_PRIORITY_SMP(dflt, CONFIGURE_SCHEDULER_NAME) |
---|
870 | #endif |
---|
871 | #endif |
---|
872 | |
---|
873 | /* |
---|
874 | * If the Deterministic Priority Affinity SMP Scheduler is selected, then configure for |
---|
875 | * it. |
---|
876 | */ |
---|
877 | #if defined(CONFIGURE_SCHEDULER_PRIORITY_AFFINITY_SMP) |
---|
878 | #if !defined(CONFIGURE_SCHEDULER_NAME) |
---|
879 | /** Configure the name of the scheduler instance */ |
---|
880 | #define CONFIGURE_SCHEDULER_NAME rtems_build_name('M', 'P', 'A', ' ') |
---|
881 | #endif |
---|
882 | |
---|
883 | #if !defined(CONFIGURE_SCHEDULER_CONTROLS) |
---|
884 | /** Configure the context needed by the scheduler instance */ |
---|
885 | #define CONFIGURE_SCHEDULER_CONTEXT \ |
---|
886 | RTEMS_SCHEDULER_CONTEXT_PRIORITY_AFFINITY_SMP( \ |
---|
887 | dflt, \ |
---|
888 | CONFIGURE_MAXIMUM_PRIORITY + 1 \ |
---|
889 | ) |
---|
890 | |
---|
891 | /** Configure the controls for this scheduler instance */ |
---|
892 | #define CONFIGURE_SCHEDULER_CONTROLS \ |
---|
893 | RTEMS_SCHEDULER_CONTROL_PRIORITY_AFFINITY_SMP( \ |
---|
894 | dflt, \ |
---|
895 | CONFIGURE_SCHEDULER_NAME \ |
---|
896 | ) |
---|
897 | #endif |
---|
898 | #endif |
---|
899 | |
---|
900 | /* |
---|
901 | * If the Strong APA Scheduler is selected, then configure for |
---|
902 | * it. |
---|
903 | */ |
---|
904 | #if defined(CONFIGURE_SCHEDULER_STRONG_APA) |
---|
905 | #if !defined(CONFIGURE_SCHEDULER_NAME) |
---|
906 | /** Configure the name of the scheduler instance */ |
---|
907 | #define CONFIGURE_SCHEDULER_NAME rtems_build_name('M', 'A', 'P', 'A') |
---|
908 | #endif |
---|
909 | |
---|
910 | #if !defined(CONFIGURE_SCHEDULER_CONTROLS) |
---|
911 | /** Configure the context needed by the scheduler instance */ |
---|
912 | #define CONFIGURE_SCHEDULER_CONTEXT \ |
---|
913 | RTEMS_SCHEDULER_CONTEXT_STRONG_APA( \ |
---|
914 | dflt, \ |
---|
915 | CONFIGURE_MAXIMUM_PRIORITY + 1 \ |
---|
916 | ) |
---|
917 | |
---|
918 | /** Configure the controls for this scheduler instance */ |
---|
919 | #define CONFIGURE_SCHEDULER_CONTROLS \ |
---|
920 | RTEMS_SCHEDULER_CONTROL_STRONG_APA(dflt, CONFIGURE_SCHEDULER_NAME) |
---|
921 | #endif |
---|
922 | #endif |
---|
923 | |
---|
924 | /* |
---|
925 | * If the Simple Priority Scheduler is selected, then configure for it. |
---|
926 | */ |
---|
927 | #if defined(CONFIGURE_SCHEDULER_SIMPLE) |
---|
928 | #if !defined(CONFIGURE_SCHEDULER_NAME) |
---|
929 | /** Configure the name of the scheduler instance */ |
---|
930 | #define CONFIGURE_SCHEDULER_NAME rtems_build_name('U', 'P', 'S', ' ') |
---|
931 | #endif |
---|
932 | |
---|
933 | #if !defined(CONFIGURE_SCHEDULER_CONTROLS) |
---|
934 | /** Configure the context needed by the scheduler instance */ |
---|
935 | #define CONFIGURE_SCHEDULER_CONTEXT RTEMS_SCHEDULER_CONTEXT_SIMPLE(dflt) |
---|
936 | |
---|
937 | /** Configure the controls for this scheduler instance */ |
---|
938 | #define CONFIGURE_SCHEDULER_CONTROLS \ |
---|
939 | RTEMS_SCHEDULER_CONTROL_SIMPLE(dflt, CONFIGURE_SCHEDULER_NAME) |
---|
940 | #endif |
---|
941 | #endif |
---|
942 | |
---|
943 | /* |
---|
944 | * If the Simple SMP Priority Scheduler is selected, then configure for it. |
---|
945 | */ |
---|
946 | #if defined(CONFIGURE_SCHEDULER_SIMPLE_SMP) |
---|
947 | #if !defined(CONFIGURE_SCHEDULER_NAME) |
---|
948 | /** Configure the name of the scheduler instance */ |
---|
949 | #define CONFIGURE_SCHEDULER_NAME rtems_build_name('M', 'P', 'S', ' ') |
---|
950 | #endif |
---|
951 | |
---|
952 | #if !defined(CONFIGURE_SCHEDULER_CONTROLS) |
---|
953 | /** Configure the context needed by the scheduler instance */ |
---|
954 | #define CONFIGURE_SCHEDULER_CONTEXT \ |
---|
955 | RTEMS_SCHEDULER_CONTEXT_SIMPLE_SMP(dflt) |
---|
956 | |
---|
957 | /** Configure the controls for this scheduler instance */ |
---|
958 | #define CONFIGURE_SCHEDULER_CONTROLS \ |
---|
959 | RTEMS_SCHEDULER_CONTROL_SIMPLE_SMP(dflt, CONFIGURE_SCHEDULER_NAME) |
---|
960 | #endif |
---|
961 | #endif |
---|
962 | |
---|
963 | /* |
---|
964 | * If the EDF Scheduler is selected, then configure for it. |
---|
965 | */ |
---|
966 | #if defined(CONFIGURE_SCHEDULER_EDF) |
---|
967 | #if !defined(CONFIGURE_SCHEDULER_NAME) |
---|
968 | /** Configure the name of the scheduler instance */ |
---|
969 | #define CONFIGURE_SCHEDULER_NAME rtems_build_name('U', 'E', 'D', 'F') |
---|
970 | #endif |
---|
971 | |
---|
972 | #if !defined(CONFIGURE_SCHEDULER_CONTROLS) |
---|
973 | /** Configure the context needed by the scheduler instance */ |
---|
974 | #define CONFIGURE_SCHEDULER_CONTEXT RTEMS_SCHEDULER_CONTEXT_EDF(dflt) |
---|
975 | |
---|
976 | /** Configure the controls for this scheduler instance */ |
---|
977 | #define CONFIGURE_SCHEDULER_CONTROLS \ |
---|
978 | RTEMS_SCHEDULER_CONTROL_EDF(dflt, CONFIGURE_SCHEDULER_NAME) |
---|
979 | #endif |
---|
980 | #endif |
---|
981 | |
---|
982 | /* |
---|
983 | * If the CBS Scheduler is selected, then configure for it. |
---|
984 | */ |
---|
985 | #if defined(CONFIGURE_SCHEDULER_CBS) |
---|
986 | #if !defined(CONFIGURE_SCHEDULER_NAME) |
---|
987 | /** Configure the name of the scheduler instance */ |
---|
988 | #define CONFIGURE_SCHEDULER_NAME rtems_build_name('U', 'C', 'B', 'S') |
---|
989 | #endif |
---|
990 | |
---|
991 | #if !defined(CONFIGURE_SCHEDULER_CONTROLS) |
---|
992 | /** Configure the context needed by the scheduler instance */ |
---|
993 | #define CONFIGURE_SCHEDULER_CONTEXT RTEMS_SCHEDULER_CONTEXT_CBS(dflt) |
---|
994 | |
---|
995 | /** Configure the controls for this scheduler instance */ |
---|
996 | #define CONFIGURE_SCHEDULER_CONTROLS \ |
---|
997 | RTEMS_SCHEDULER_CONTROL_CBS(dflt, CONFIGURE_SCHEDULER_NAME) |
---|
998 | #endif |
---|
999 | |
---|
1000 | #ifndef CONFIGURE_CBS_MAXIMUM_SERVERS |
---|
1001 | #define CONFIGURE_CBS_MAXIMUM_SERVERS CONFIGURE_MAXIMUM_TASKS |
---|
1002 | #endif |
---|
1003 | |
---|
1004 | #ifdef CONFIGURE_INIT |
---|
1005 | const uint32_t _Scheduler_CBS_Maximum_servers = |
---|
1006 | CONFIGURE_CBS_MAXIMUM_SERVERS; |
---|
1007 | |
---|
1008 | Scheduler_CBS_Server |
---|
1009 | _Scheduler_CBS_Server_list[ CONFIGURE_CBS_MAXIMUM_SERVERS ]; |
---|
1010 | #endif |
---|
1011 | #endif |
---|
1012 | |
---|
1013 | /* |
---|
1014 | * Set up the scheduler entry points table. The scheduling code uses |
---|
1015 | * this code to know which scheduler is configured by the user. |
---|
1016 | */ |
---|
1017 | #ifdef CONFIGURE_INIT |
---|
1018 | #if defined(CONFIGURE_SCHEDULER_CONTEXT) |
---|
1019 | CONFIGURE_SCHEDULER_CONTEXT; |
---|
1020 | #endif |
---|
1021 | |
---|
1022 | const Scheduler_Control _Scheduler_Table[] = { |
---|
1023 | CONFIGURE_SCHEDULER_CONTROLS |
---|
1024 | }; |
---|
1025 | |
---|
1026 | #define CONFIGURE_SCHEDULER_COUNT RTEMS_ARRAY_SIZE( _Scheduler_Table ) |
---|
1027 | |
---|
1028 | #if defined(RTEMS_SMP) |
---|
1029 | const size_t _Scheduler_Count = CONFIGURE_SCHEDULER_COUNT; |
---|
1030 | |
---|
1031 | const Scheduler_Assignment _Scheduler_Initial_assignments[] = { |
---|
1032 | #if defined(CONFIGURE_SMP_SCHEDULER_ASSIGNMENTS) |
---|
1033 | CONFIGURE_SMP_SCHEDULER_ASSIGNMENTS |
---|
1034 | #else |
---|
1035 | #define _CONFIGURE_SMP_SCHEDULER_ASSIGN_OPT \ |
---|
1036 | RTEMS_SCHEDULER_ASSIGN( \ |
---|
1037 | 0, \ |
---|
1038 | RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL \ |
---|
1039 | ) |
---|
1040 | _CONFIGURE_SMP_SCHEDULER_ASSIGN_OPT |
---|
1041 | #if CONFIGURE_MAXIMUM_PROCESSORS >= 2 |
---|
1042 | , _CONFIGURE_SMP_SCHEDULER_ASSIGN_OPT |
---|
1043 | #endif |
---|
1044 | #if CONFIGURE_MAXIMUM_PROCESSORS >= 3 |
---|
1045 | , _CONFIGURE_SMP_SCHEDULER_ASSIGN_OPT |
---|
1046 | #endif |
---|
1047 | #if CONFIGURE_MAXIMUM_PROCESSORS >= 4 |
---|
1048 | , _CONFIGURE_SMP_SCHEDULER_ASSIGN_OPT |
---|
1049 | #endif |
---|
1050 | #if CONFIGURE_MAXIMUM_PROCESSORS >= 5 |
---|
1051 | , _CONFIGURE_SMP_SCHEDULER_ASSIGN_OPT |
---|
1052 | #endif |
---|
1053 | #if CONFIGURE_MAXIMUM_PROCESSORS >= 6 |
---|
1054 | , _CONFIGURE_SMP_SCHEDULER_ASSIGN_OPT |
---|
1055 | #endif |
---|
1056 | #if CONFIGURE_MAXIMUM_PROCESSORS >= 7 |
---|
1057 | , _CONFIGURE_SMP_SCHEDULER_ASSIGN_OPT |
---|
1058 | #endif |
---|
1059 | #if CONFIGURE_MAXIMUM_PROCESSORS >= 8 |
---|
1060 | , _CONFIGURE_SMP_SCHEDULER_ASSIGN_OPT |
---|
1061 | #endif |
---|
1062 | #if CONFIGURE_MAXIMUM_PROCESSORS >= 9 |
---|
1063 | , _CONFIGURE_SMP_SCHEDULER_ASSIGN_OPT |
---|
1064 | #endif |
---|
1065 | #if CONFIGURE_MAXIMUM_PROCESSORS >= 10 |
---|
1066 | , _CONFIGURE_SMP_SCHEDULER_ASSIGN_OPT |
---|
1067 | #endif |
---|
1068 | #if CONFIGURE_MAXIMUM_PROCESSORS >= 11 |
---|
1069 | , _CONFIGURE_SMP_SCHEDULER_ASSIGN_OPT |
---|
1070 | #endif |
---|
1071 | #if CONFIGURE_MAXIMUM_PROCESSORS >= 12 |
---|
1072 | , _CONFIGURE_SMP_SCHEDULER_ASSIGN_OPT |
---|
1073 | #endif |
---|
1074 | #if CONFIGURE_MAXIMUM_PROCESSORS >= 13 |
---|
1075 | , _CONFIGURE_SMP_SCHEDULER_ASSIGN_OPT |
---|
1076 | #endif |
---|
1077 | #if CONFIGURE_MAXIMUM_PROCESSORS >= 14 |
---|
1078 | , _CONFIGURE_SMP_SCHEDULER_ASSIGN_OPT |
---|
1079 | #endif |
---|
1080 | #if CONFIGURE_MAXIMUM_PROCESSORS >= 15 |
---|
1081 | , _CONFIGURE_SMP_SCHEDULER_ASSIGN_OPT |
---|
1082 | #endif |
---|
1083 | #if CONFIGURE_MAXIMUM_PROCESSORS >= 16 |
---|
1084 | , _CONFIGURE_SMP_SCHEDULER_ASSIGN_OPT |
---|
1085 | #endif |
---|
1086 | #if CONFIGURE_MAXIMUM_PROCESSORS >= 17 |
---|
1087 | , _CONFIGURE_SMP_SCHEDULER_ASSIGN_OPT |
---|
1088 | #endif |
---|
1089 | #if CONFIGURE_MAXIMUM_PROCESSORS >= 18 |
---|
1090 | , _CONFIGURE_SMP_SCHEDULER_ASSIGN_OPT |
---|
1091 | #endif |
---|
1092 | #if CONFIGURE_MAXIMUM_PROCESSORS >= 19 |
---|
1093 | , _CONFIGURE_SMP_SCHEDULER_ASSIGN_OPT |
---|
1094 | #endif |
---|
1095 | #if CONFIGURE_MAXIMUM_PROCESSORS >= 20 |
---|
1096 | , _CONFIGURE_SMP_SCHEDULER_ASSIGN_OPT |
---|
1097 | #endif |
---|
1098 | #if CONFIGURE_MAXIMUM_PROCESSORS >= 21 |
---|
1099 | , _CONFIGURE_SMP_SCHEDULER_ASSIGN_OPT |
---|
1100 | #endif |
---|
1101 | #if CONFIGURE_MAXIMUM_PROCESSORS >= 22 |
---|
1102 | , _CONFIGURE_SMP_SCHEDULER_ASSIGN_OPT |
---|
1103 | #endif |
---|
1104 | #if CONFIGURE_MAXIMUM_PROCESSORS >= 23 |
---|
1105 | , _CONFIGURE_SMP_SCHEDULER_ASSIGN_OPT |
---|
1106 | #endif |
---|
1107 | #if CONFIGURE_MAXIMUM_PROCESSORS >= 24 |
---|
1108 | , _CONFIGURE_SMP_SCHEDULER_ASSIGN_OPT |
---|
1109 | #endif |
---|
1110 | #if CONFIGURE_MAXIMUM_PROCESSORS >= 25 |
---|
1111 | , _CONFIGURE_SMP_SCHEDULER_ASSIGN_OPT |
---|
1112 | #endif |
---|
1113 | #if CONFIGURE_MAXIMUM_PROCESSORS >= 26 |
---|
1114 | , _CONFIGURE_SMP_SCHEDULER_ASSIGN_OPT |
---|
1115 | #endif |
---|
1116 | #if CONFIGURE_MAXIMUM_PROCESSORS >= 27 |
---|
1117 | , _CONFIGURE_SMP_SCHEDULER_ASSIGN_OPT |
---|
1118 | #endif |
---|
1119 | #if CONFIGURE_MAXIMUM_PROCESSORS >= 28 |
---|
1120 | , _CONFIGURE_SMP_SCHEDULER_ASSIGN_OPT |
---|
1121 | #endif |
---|
1122 | #if CONFIGURE_MAXIMUM_PROCESSORS >= 29 |
---|
1123 | , _CONFIGURE_SMP_SCHEDULER_ASSIGN_OPT |
---|
1124 | #endif |
---|
1125 | #if CONFIGURE_MAXIMUM_PROCESSORS >= 30 |
---|
1126 | , _CONFIGURE_SMP_SCHEDULER_ASSIGN_OPT |
---|
1127 | #endif |
---|
1128 | #if CONFIGURE_MAXIMUM_PROCESSORS >= 31 |
---|
1129 | , _CONFIGURE_SMP_SCHEDULER_ASSIGN_OPT |
---|
1130 | #endif |
---|
1131 | #if CONFIGURE_MAXIMUM_PROCESSORS >= 32 |
---|
1132 | , _CONFIGURE_SMP_SCHEDULER_ASSIGN_OPT |
---|
1133 | #endif |
---|
1134 | #undef _CONFIGURE_SMP_SCHEDULER_ASSIGN_OPT |
---|
1135 | #endif |
---|
1136 | }; |
---|
1137 | |
---|
1138 | RTEMS_STATIC_ASSERT( |
---|
1139 | CONFIGURE_MAXIMUM_PROCESSORS |
---|
1140 | == RTEMS_ARRAY_SIZE( _Scheduler_Initial_assignments ), |
---|
1141 | _Scheduler_Initial_assignments |
---|
1142 | ); |
---|
1143 | #endif |
---|
1144 | #endif |
---|
1145 | /**@}*/ /* end of Scheduler Configuration */ |
---|
1146 | |
---|
1147 | /** |
---|
1148 | * @defgroup ConfigurationIdle IDLE Thread Configuration |
---|
1149 | * |
---|
1150 | * @addtogroup Configuration |
---|
1151 | * |
---|
1152 | * This module contains configuration parameters related to the |
---|
1153 | * set of IDLE threads. On a uniprocessor system, there is one |
---|
1154 | * IDLE thread. On an SMP system, there is one for each core. |
---|
1155 | */ |
---|
1156 | |
---|
1157 | /* |
---|
1158 | * If you said the IDLE task was going to do application initialization |
---|
1159 | * and didn't override the IDLE body, then something is amiss. |
---|
1160 | */ |
---|
1161 | #if (defined(CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION) && \ |
---|
1162 | !defined(CONFIGURE_IDLE_TASK_BODY)) |
---|
1163 | #error "CONFIGURE_ERROR: You did not override the IDLE task body." |
---|
1164 | #endif |
---|
1165 | |
---|
1166 | /** |
---|
1167 | * @brief Idle task body configuration. |
---|
1168 | * |
---|
1169 | * There is a default IDLE thread body provided by RTEMS which |
---|
1170 | * has the possibility of being CPU specific. There may be a |
---|
1171 | * BSP specific override of the RTEMS default body and in turn, |
---|
1172 | * the application may override and provide its own. |
---|
1173 | */ |
---|
1174 | #ifndef CONFIGURE_IDLE_TASK_BODY |
---|
1175 | #if defined(BSP_IDLE_TASK_BODY) |
---|
1176 | #define CONFIGURE_IDLE_TASK_BODY BSP_IDLE_TASK_BODY |
---|
1177 | #elif (CPU_PROVIDES_IDLE_THREAD_BODY == TRUE) |
---|
1178 | #define CONFIGURE_IDLE_TASK_BODY _CPU_Thread_Idle_body |
---|
1179 | #else |
---|
1180 | /* only instantiate and compile if used */ |
---|
1181 | #ifdef CONFIGURE_INIT |
---|
1182 | void *_Thread_Idle_body(uintptr_t ignored) |
---|
1183 | { |
---|
1184 | for( ; ; ) ; |
---|
1185 | return 0; /* to avoid warning */ |
---|
1186 | } |
---|
1187 | #endif |
---|
1188 | #define CONFIGURE_IDLE_TASK_BODY _Thread_Idle_body |
---|
1189 | #endif |
---|
1190 | #endif |
---|
1191 | /**@}*/ /* end of IDLE thread configuration */ |
---|
1192 | |
---|
1193 | /** |
---|
1194 | * @defgroup ConfigurationStackSize Configuration Thread Stack Size |
---|
1195 | * |
---|
1196 | * @addtogroup Configuration |
---|
1197 | * |
---|
1198 | * This module contains parameters related to thread aand interrupt stacks. |
---|
1199 | */ |
---|
1200 | |
---|
1201 | /** |
---|
1202 | * By default, use the minimum stack size requested by this port. |
---|
1203 | */ |
---|
1204 | #ifndef CONFIGURE_MINIMUM_TASK_STACK_SIZE |
---|
1205 | #define CONFIGURE_MINIMUM_TASK_STACK_SIZE CPU_STACK_MINIMUM_SIZE |
---|
1206 | #endif |
---|
1207 | |
---|
1208 | /** |
---|
1209 | * This specifies the default POSIX thread stack size. By default, it is |
---|
1210 | * twice that recommended for the port. |
---|
1211 | */ |
---|
1212 | #define CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE \ |
---|
1213 | (2 * CONFIGURE_MINIMUM_TASK_STACK_SIZE) |
---|
1214 | |
---|
1215 | /** |
---|
1216 | * @brief Idle task stack size configuration. |
---|
1217 | * |
---|
1218 | * By default, the IDLE task will have a stack of minimum size. |
---|
1219 | * The BSP or application may override this value. |
---|
1220 | */ |
---|
1221 | #ifndef CONFIGURE_IDLE_TASK_STACK_SIZE |
---|
1222 | #ifdef BSP_IDLE_TASK_STACK_SIZE |
---|
1223 | #define CONFIGURE_IDLE_TASK_STACK_SIZE BSP_IDLE_TASK_STACK_SIZE |
---|
1224 | #else |
---|
1225 | #define CONFIGURE_IDLE_TASK_STACK_SIZE CONFIGURE_MINIMUM_TASK_STACK_SIZE |
---|
1226 | #endif |
---|
1227 | #endif |
---|
1228 | #if CONFIGURE_IDLE_TASK_STACK_SIZE < CONFIGURE_MINIMUM_TASK_STACK_SIZE |
---|
1229 | #error "CONFIGURE_IDLE_TASK_STACK_SIZE less than CONFIGURE_MINIMUM_TASK_STACK_SIZE" |
---|
1230 | #endif |
---|
1231 | |
---|
1232 | /** |
---|
1233 | * @brief Interrupt stack size configuration. |
---|
1234 | * |
---|
1235 | * By default, the interrupt stack will be of minimum size. |
---|
1236 | * The BSP or application may override this value. |
---|
1237 | */ |
---|
1238 | #ifndef CONFIGURE_INTERRUPT_STACK_SIZE |
---|
1239 | #ifdef BSP_INTERRUPT_STACK_SIZE |
---|
1240 | #define CONFIGURE_INTERRUPT_STACK_SIZE BSP_INTERRUPT_STACK_SIZE |
---|
1241 | #else |
---|
1242 | #define CONFIGURE_INTERRUPT_STACK_SIZE CONFIGURE_MINIMUM_TASK_STACK_SIZE |
---|
1243 | #endif |
---|
1244 | #endif |
---|
1245 | |
---|
1246 | /** |
---|
1247 | * This reserves memory for the interrupt stack if it is to be allocated |
---|
1248 | * by RTEMS rather than the BSP. |
---|
1249 | * |
---|
1250 | * @todo Try to get to the point where all BSPs support allocating the |
---|
1251 | * memory from the Workspace. |
---|
1252 | */ |
---|
1253 | #if (CPU_ALLOCATE_INTERRUPT_STACK == 0) |
---|
1254 | #define _CONFIGURE_INTERRUPT_STACK_MEMORY 0 |
---|
1255 | #else |
---|
1256 | #define _CONFIGURE_INTERRUPT_STACK_MEMORY \ |
---|
1257 | _Configure_From_workspace( CONFIGURE_INTERRUPT_STACK_SIZE ) |
---|
1258 | #endif |
---|
1259 | |
---|
1260 | /** |
---|
1261 | * Configure the very much optional task stack allocator initialization |
---|
1262 | */ |
---|
1263 | #ifndef CONFIGURE_TASK_STACK_ALLOCATOR_INIT |
---|
1264 | #define CONFIGURE_TASK_STACK_ALLOCATOR_INIT NULL |
---|
1265 | #endif |
---|
1266 | |
---|
1267 | /* |
---|
1268 | * Configure the very much optional task stack allocator and deallocator. |
---|
1269 | */ |
---|
1270 | #if !defined(CONFIGURE_TASK_STACK_ALLOCATOR) \ |
---|
1271 | && !defined(CONFIGURE_TASK_STACK_DEALLOCATOR) |
---|
1272 | /** |
---|
1273 | * This specifies the task stack allocator method. |
---|
1274 | */ |
---|
1275 | #define CONFIGURE_TASK_STACK_ALLOCATOR _Workspace_Allocate |
---|
1276 | /** |
---|
1277 | * This specifies the task stack deallocator method. |
---|
1278 | */ |
---|
1279 | #define CONFIGURE_TASK_STACK_DEALLOCATOR _Workspace_Free |
---|
1280 | #elif (defined(CONFIGURE_TASK_STACK_ALLOCATOR) \ |
---|
1281 | && !defined(CONFIGURE_TASK_STACK_DEALLOCATOR)) \ |
---|
1282 | || (!defined(CONFIGURE_TASK_STACK_ALLOCATOR) \ |
---|
1283 | && defined(CONFIGURE_TASK_STACK_DEALLOCATOR)) |
---|
1284 | #error "CONFIGURE_TASK_STACK_ALLOCATOR and CONFIGURE_TASK_STACK_DEALLOCATOR must be both defined or both undefined" |
---|
1285 | #endif |
---|
1286 | /**@}*/ /* end of thread/interrupt stack configuration */ |
---|
1287 | |
---|
1288 | /** |
---|
1289 | * @addtogroup Configuration |
---|
1290 | */ |
---|
1291 | /**@{*/ |
---|
1292 | |
---|
1293 | /** |
---|
1294 | * Should the RTEMS Workspace and C Program Heap be cleared automatically |
---|
1295 | * at system start up? |
---|
1296 | */ |
---|
1297 | #ifndef CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY |
---|
1298 | #ifdef BSP_ZERO_WORKSPACE_AUTOMATICALLY |
---|
1299 | #define CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY \ |
---|
1300 | BSP_ZERO_WORKSPACE_AUTOMATICALLY |
---|
1301 | #else |
---|
1302 | #define CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY FALSE |
---|
1303 | #endif |
---|
1304 | #endif |
---|
1305 | /**@}*/ /* end of add to group Configuration */ |
---|
1306 | |
---|
1307 | /** |
---|
1308 | * @defgroup ConfigurationMalloc RTEMS Malloc configuration |
---|
1309 | * |
---|
1310 | * This module contains parameters related to configuration of the RTEMS |
---|
1311 | * Malloc implementation. |
---|
1312 | */ |
---|
1313 | /**@{*/ |
---|
1314 | #include <rtems/malloc.h> |
---|
1315 | |
---|
1316 | #ifdef CONFIGURE_INIT |
---|
1317 | /** |
---|
1318 | * By default, RTEMS uses separate heaps for the RTEMS Workspace and |
---|
1319 | * the C Program Heap. The application can choose optionally to combine |
---|
1320 | * these to provide one larger memory pool. This is particularly |
---|
1321 | * useful in combination with the unlimited objects configuration. |
---|
1322 | */ |
---|
1323 | #ifdef CONFIGURE_UNIFIED_WORK_AREAS |
---|
1324 | Heap_Control *RTEMS_Malloc_Heap = &_Workspace_Area; |
---|
1325 | #else |
---|
1326 | Heap_Control RTEMS_Malloc_Area; |
---|
1327 | Heap_Control *RTEMS_Malloc_Heap = &RTEMS_Malloc_Area; |
---|
1328 | #endif |
---|
1329 | #endif |
---|
1330 | |
---|
1331 | #ifdef CONFIGURE_INIT |
---|
1332 | /** |
---|
1333 | * This configures the sbrk() support for the malloc family. |
---|
1334 | * By default it is assumed that the BSP provides all available |
---|
1335 | * RAM to the malloc family implementation so sbrk()'ing to get |
---|
1336 | * more memory would always fail anyway. |
---|
1337 | */ |
---|
1338 | const rtems_heap_extend_handler rtems_malloc_extend_handler = |
---|
1339 | #ifdef CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK |
---|
1340 | rtems_heap_extend_via_sbrk; |
---|
1341 | #else |
---|
1342 | rtems_heap_null_extend; |
---|
1343 | #endif |
---|
1344 | #endif |
---|
1345 | |
---|
1346 | #ifdef CONFIGURE_INIT |
---|
1347 | /** |
---|
1348 | * This configures the malloc family plugin which dirties memory |
---|
1349 | * allocated. This is helpful for finding unitialized data structure |
---|
1350 | * problems. |
---|
1351 | */ |
---|
1352 | rtems_malloc_dirtier_t rtems_malloc_dirty_helper = |
---|
1353 | #if defined(CONFIGURE_MALLOC_DIRTY) |
---|
1354 | rtems_malloc_dirty_memory; |
---|
1355 | #else |
---|
1356 | NULL; |
---|
1357 | #endif |
---|
1358 | #endif |
---|
1359 | /**@}*/ /* end of Malloc Configuration */ |
---|
1360 | |
---|
1361 | /** |
---|
1362 | * @defgroup ConfigurationHelpers Configuration Helpers |
---|
1363 | * |
---|
1364 | * @ingroup Configuration |
---|
1365 | * |
---|
1366 | * This module contains items which are used internally to ease |
---|
1367 | * the configuration calculations. |
---|
1368 | */ |
---|
1369 | /**@{*/ |
---|
1370 | |
---|
1371 | /** |
---|
1372 | * Zero of one returns 0 if the parameter is 0 else 1 is returned. |
---|
1373 | */ |
---|
1374 | #define _Configure_Zero_or_One(_number) ((_number) ? 1 : 0) |
---|
1375 | |
---|
1376 | /** |
---|
1377 | * General helper to align up a value. |
---|
1378 | */ |
---|
1379 | #define _Configure_Align_up(_val, _align) \ |
---|
1380 | (((_val) + (_align) - 1) - ((_val) + (_align) - 1) % (_align)) |
---|
1381 | |
---|
1382 | #define _CONFIGURE_HEAP_MIN_BLOCK_SIZE \ |
---|
1383 | _Configure_Align_up(sizeof(Heap_Block), CPU_HEAP_ALIGNMENT) |
---|
1384 | |
---|
1385 | /** |
---|
1386 | * This is a helper macro used in calculations in this file. It is used |
---|
1387 | * to noted when an element is allocated from the RTEMS Workspace and adds |
---|
1388 | * a factor to account for heap overhead plus an alignment factor that |
---|
1389 | * may be applied. |
---|
1390 | */ |
---|
1391 | #define _Configure_From_workspace(_size) \ |
---|
1392 | (ssize_t) (_Configure_Zero_or_One(_size) * \ |
---|
1393 | _Configure_Align_up(_size + HEAP_BLOCK_HEADER_SIZE, \ |
---|
1394 | _CONFIGURE_HEAP_MIN_BLOCK_SIZE)) |
---|
1395 | |
---|
1396 | /** |
---|
1397 | * This is a helper macro used in stack space calculations in this file. It |
---|
1398 | * may be provided by the application in case a special task stack allocator |
---|
1399 | * is used. The default is allocation from the RTEMS Workspace. |
---|
1400 | */ |
---|
1401 | #ifdef CONFIGURE_TASK_STACK_FROM_ALLOCATOR |
---|
1402 | #define _Configure_From_stackspace(_stack_size) \ |
---|
1403 | CONFIGURE_TASK_STACK_FROM_ALLOCATOR(_stack_size) |
---|
1404 | #else |
---|
1405 | #define _Configure_From_stackspace(_stack_size) \ |
---|
1406 | _Configure_From_workspace(_stack_size) |
---|
1407 | #endif |
---|
1408 | |
---|
1409 | /** |
---|
1410 | * Do not use the unlimited bit as part of the multiplication |
---|
1411 | * for memory usage. |
---|
1412 | */ |
---|
1413 | #define _Configure_Max_Objects(_max) \ |
---|
1414 | (_Configure_Zero_or_One(_max) * rtems_resource_maximum_per_allocation(_max)) |
---|
1415 | |
---|
1416 | /** |
---|
1417 | * This macro accounts for how memory for a set of configured objects is |
---|
1418 | * allocated from the Executive Workspace. |
---|
1419 | * |
---|
1420 | * NOTE: It does NOT attempt to address the more complex case of unlimited |
---|
1421 | * objects. |
---|
1422 | */ |
---|
1423 | #define _Configure_Object_RAM(_number, _size) ( \ |
---|
1424 | _Configure_From_workspace(_Configure_Max_Objects(_number) * (_size)) + \ |
---|
1425 | _Configure_From_workspace( \ |
---|
1426 | _Configure_Zero_or_One(_number) * ( \ |
---|
1427 | (_Configure_Max_Objects(_number) + 1) * sizeof(Objects_Control *) + \ |
---|
1428 | _Configure_Align_up(sizeof(void *), CPU_ALIGNMENT) + \ |
---|
1429 | _Configure_Align_up(sizeof(uint32_t), CPU_ALIGNMENT) \ |
---|
1430 | ) \ |
---|
1431 | ) \ |
---|
1432 | ) |
---|
1433 | /**@}*/ |
---|
1434 | |
---|
1435 | /** |
---|
1436 | * @defgroup ConfigurationInitTasksTable Initialization Tasks Configuration |
---|
1437 | * |
---|
1438 | * @addtogroup Configuration |
---|
1439 | * |
---|
1440 | * This group contains the elements needed to define the Classic API |
---|
1441 | * Initialization Tasks Table. |
---|
1442 | * |
---|
1443 | * Default User Initialization Task Table. This table guarantees that |
---|
1444 | * one user initialization table is defined. |
---|
1445 | */ |
---|
1446 | #ifdef CONFIGURE_RTEMS_INIT_TASKS_TABLE |
---|
1447 | |
---|
1448 | #ifdef CONFIGURE_HAS_OWN_INIT_TASK_TABLE |
---|
1449 | |
---|
1450 | /* |
---|
1451 | * The user is defining their own table information and setting the |
---|
1452 | * appropriate variables. |
---|
1453 | */ |
---|
1454 | |
---|
1455 | #else |
---|
1456 | |
---|
1457 | /** |
---|
1458 | * When using the default Classic API Initialization Tasks Table, this is |
---|
1459 | * used to specify the name of the single Classic API task. |
---|
1460 | */ |
---|
1461 | #ifndef CONFIGURE_INIT_TASK_NAME |
---|
1462 | #define CONFIGURE_INIT_TASK_NAME rtems_build_name('U', 'I', '1', ' ') |
---|
1463 | #endif |
---|
1464 | |
---|
1465 | /** |
---|
1466 | * When using the default Classic API Initialization Tasks Table, this is |
---|
1467 | * used to specify the stack size of the single Classic API task. |
---|
1468 | */ |
---|
1469 | #ifndef CONFIGURE_INIT_TASK_STACK_SIZE |
---|
1470 | #define CONFIGURE_INIT_TASK_STACK_SIZE CONFIGURE_MINIMUM_TASK_STACK_SIZE |
---|
1471 | #endif |
---|
1472 | |
---|
1473 | /** |
---|
1474 | * When using the default Classic API Initialization Tasks Table, this is |
---|
1475 | * used to specify the priority of the single Classic API task. |
---|
1476 | */ |
---|
1477 | #ifndef CONFIGURE_INIT_TASK_PRIORITY |
---|
1478 | #define CONFIGURE_INIT_TASK_PRIORITY 1 |
---|
1479 | #endif |
---|
1480 | |
---|
1481 | /** |
---|
1482 | * When using the default Classic API Initialization Tasks Table, this is |
---|
1483 | * used to specify the attributes size of the single Classic API task. |
---|
1484 | */ |
---|
1485 | #ifndef CONFIGURE_INIT_TASK_ATTRIBUTES |
---|
1486 | #define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_DEFAULT_ATTRIBUTES |
---|
1487 | #endif |
---|
1488 | |
---|
1489 | /** |
---|
1490 | * When using the default Classic API Initialization Tasks Table, this is |
---|
1491 | * used to specify the entry point of the single Classic API task. |
---|
1492 | */ |
---|
1493 | #ifndef CONFIGURE_INIT_TASK_ENTRY_POINT |
---|
1494 | #ifdef __cplusplus |
---|
1495 | extern "C" { |
---|
1496 | #endif |
---|
1497 | rtems_task Init (rtems_task_argument ); |
---|
1498 | #ifdef __cplusplus |
---|
1499 | } |
---|
1500 | #endif |
---|
1501 | #define CONFIGURE_INIT_TASK_ENTRY_POINT Init |
---|
1502 | extern const char* bsp_boot_cmdline; |
---|
1503 | #define CONFIGURE_INIT_TASK_ARGUMENTS ((rtems_task_argument) &bsp_boot_cmdline) |
---|
1504 | #endif |
---|
1505 | |
---|
1506 | /** |
---|
1507 | * When using the default Classic API Initialization Tasks Table, this is |
---|
1508 | * used to specify the initial execution mode of the single Classic API task. |
---|
1509 | */ |
---|
1510 | #ifndef CONFIGURE_INIT_TASK_INITIAL_MODES |
---|
1511 | #ifdef _CONFIGURE_SMP_APPLICATION |
---|
1512 | #define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_DEFAULT_MODES |
---|
1513 | #else |
---|
1514 | #define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_NO_PREEMPT |
---|
1515 | #endif |
---|
1516 | #endif |
---|
1517 | |
---|
1518 | /** |
---|
1519 | * When using the default Classic API Initialization Tasks Table, this is |
---|
1520 | * used to specify the initial argument to the single Classic API task. |
---|
1521 | */ |
---|
1522 | #ifndef CONFIGURE_INIT_TASK_ARGUMENTS |
---|
1523 | #define CONFIGURE_INIT_TASK_ARGUMENTS 0 |
---|
1524 | #endif |
---|
1525 | |
---|
1526 | #ifdef CONFIGURE_INIT |
---|
1527 | rtems_initialization_tasks_table Initialization_tasks[] = { |
---|
1528 | { CONFIGURE_INIT_TASK_NAME, |
---|
1529 | CONFIGURE_INIT_TASK_STACK_SIZE, |
---|
1530 | CONFIGURE_INIT_TASK_PRIORITY, |
---|
1531 | CONFIGURE_INIT_TASK_ATTRIBUTES, |
---|
1532 | CONFIGURE_INIT_TASK_ENTRY_POINT, |
---|
1533 | CONFIGURE_INIT_TASK_INITIAL_MODES, |
---|
1534 | CONFIGURE_INIT_TASK_ARGUMENTS |
---|
1535 | } |
---|
1536 | }; |
---|
1537 | #endif |
---|
1538 | |
---|
1539 | /** |
---|
1540 | * This is the name of the Initialization Tasks Table generated. |
---|
1541 | */ |
---|
1542 | #define CONFIGURE_INIT_TASK_TABLE Initialization_tasks |
---|
1543 | |
---|
1544 | /* |
---|
1545 | * This is the size of the Initialization Tasks Table generated. |
---|
1546 | */ |
---|
1547 | #define CONFIGURE_INIT_TASK_TABLE_SIZE \ |
---|
1548 | RTEMS_ARRAY_SIZE(CONFIGURE_INIT_TASK_TABLE) |
---|
1549 | |
---|
1550 | #endif /* CONFIGURE_HAS_OWN_INIT_TASK_TABLE */ |
---|
1551 | |
---|
1552 | #else /* CONFIGURE_RTEMS_INIT_TASKS_TABLE */ |
---|
1553 | |
---|
1554 | /* |
---|
1555 | * This is the name of the Initialization Task when none is configured. |
---|
1556 | */ |
---|
1557 | #define CONFIGURE_INIT_TASK_TABLE NULL |
---|
1558 | |
---|
1559 | /* |
---|
1560 | * This is the size of the Initialization Task when none is configured. |
---|
1561 | */ |
---|
1562 | #define CONFIGURE_INIT_TASK_TABLE_SIZE 0 |
---|
1563 | |
---|
1564 | /* |
---|
1565 | * This is the stack size of the Initialization Task when none is configured. |
---|
1566 | */ |
---|
1567 | #define CONFIGURE_INIT_TASK_STACK_SIZE 0 |
---|
1568 | |
---|
1569 | #endif |
---|
1570 | /**@}*/ /* end of Classic API Initialization Tasks Table */ |
---|
1571 | |
---|
1572 | /** |
---|
1573 | * @defgroup ConfigurationDriverTable Device Driver Table Configuration |
---|
1574 | * |
---|
1575 | * @addtogroup Configuration |
---|
1576 | * |
---|
1577 | * This group contains parameters related to generating a Device Driver |
---|
1578 | * Table. |
---|
1579 | * |
---|
1580 | * Default Device Driver Table. Each driver needed by the test is explicitly |
---|
1581 | * choosen by the application. There is always a null driver entry. |
---|
1582 | */ |
---|
1583 | /**@{*/ |
---|
1584 | |
---|
1585 | /** |
---|
1586 | * This is an empty device driver slot. |
---|
1587 | */ |
---|
1588 | #define NULL_DRIVER_TABLE_ENTRY \ |
---|
1589 | { NULL, NULL, NULL, NULL, NULL, NULL } |
---|
1590 | |
---|
1591 | #ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
---|
1592 | #include <rtems/console.h> |
---|
1593 | #endif |
---|
1594 | |
---|
1595 | #ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER |
---|
1596 | #include <rtems/clockdrv.h> |
---|
1597 | #endif |
---|
1598 | |
---|
1599 | #ifdef CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER |
---|
1600 | #include <rtems/btimer.h> |
---|
1601 | #endif |
---|
1602 | |
---|
1603 | #ifdef CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER |
---|
1604 | #include <rtems/rtc.h> |
---|
1605 | #endif |
---|
1606 | |
---|
1607 | #ifdef CONFIGURE_APPLICATION_NEEDS_WATCHDOG_DRIVER |
---|
1608 | #include <rtems/watchdogdrv.h> |
---|
1609 | #endif |
---|
1610 | |
---|
1611 | #ifdef CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER |
---|
1612 | #include <rtems/framebuffer.h> |
---|
1613 | #endif |
---|
1614 | |
---|
1615 | #ifdef CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER |
---|
1616 | #include <rtems/devnull.h> |
---|
1617 | #endif |
---|
1618 | |
---|
1619 | #ifdef CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER |
---|
1620 | #include <rtems/devzero.h> |
---|
1621 | #endif |
---|
1622 | |
---|
1623 | #ifdef CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER |
---|
1624 | /* the ide driver needs the ATA driver */ |
---|
1625 | #ifndef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER |
---|
1626 | #define CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER |
---|
1627 | #endif |
---|
1628 | #include <libchip/ide_ctrl.h> |
---|
1629 | #endif |
---|
1630 | |
---|
1631 | #ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER |
---|
1632 | #include <libchip/ata.h> |
---|
1633 | #endif |
---|
1634 | |
---|
1635 | #ifndef CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE |
---|
1636 | |
---|
1637 | /** |
---|
1638 | * This specifies the maximum number of device drivers that |
---|
1639 | * can be installed in the system at one time. It must account |
---|
1640 | * for both the statically and dynamically installed drivers. |
---|
1641 | */ |
---|
1642 | #ifndef CONFIGURE_MAXIMUM_DRIVERS |
---|
1643 | #define CONFIGURE_MAXIMUM_DRIVERS |
---|
1644 | #endif |
---|
1645 | |
---|
1646 | #ifdef CONFIGURE_INIT |
---|
1647 | rtems_driver_address_table |
---|
1648 | _IO_Driver_address_table[ CONFIGURE_MAXIMUM_DRIVERS ] = { |
---|
1649 | #ifdef CONFIGURE_BSP_PREREQUISITE_DRIVERS |
---|
1650 | CONFIGURE_BSP_PREREQUISITE_DRIVERS, |
---|
1651 | #endif |
---|
1652 | #ifdef CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS |
---|
1653 | CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS, |
---|
1654 | #endif |
---|
1655 | #ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
---|
1656 | CONSOLE_DRIVER_TABLE_ENTRY, |
---|
1657 | #endif |
---|
1658 | #ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER |
---|
1659 | CLOCK_DRIVER_TABLE_ENTRY, |
---|
1660 | #endif |
---|
1661 | #ifdef CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER |
---|
1662 | RTC_DRIVER_TABLE_ENTRY, |
---|
1663 | #endif |
---|
1664 | #ifdef CONFIGURE_APPLICATION_NEEDS_WATCHDOG_DRIVER |
---|
1665 | WATCHDOG_DRIVER_TABLE_ENTRY, |
---|
1666 | #endif |
---|
1667 | #ifdef CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER |
---|
1668 | DEVNULL_DRIVER_TABLE_ENTRY, |
---|
1669 | #endif |
---|
1670 | #ifdef CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER |
---|
1671 | DEVZERO_DRIVER_TABLE_ENTRY, |
---|
1672 | #endif |
---|
1673 | #ifdef CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER |
---|
1674 | IDE_CONTROLLER_DRIVER_TABLE_ENTRY, |
---|
1675 | #endif |
---|
1676 | #ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER |
---|
1677 | ATA_DRIVER_TABLE_ENTRY, |
---|
1678 | #endif |
---|
1679 | #ifdef CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER |
---|
1680 | FRAME_BUFFER_DRIVER_TABLE_ENTRY, |
---|
1681 | #endif |
---|
1682 | #ifdef CONFIGURE_APPLICATION_EXTRA_DRIVERS |
---|
1683 | CONFIGURE_APPLICATION_EXTRA_DRIVERS, |
---|
1684 | #endif |
---|
1685 | #ifdef CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER |
---|
1686 | NULL_DRIVER_TABLE_ENTRY |
---|
1687 | #elif !defined(CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER) && \ |
---|
1688 | !defined(CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER) && \ |
---|
1689 | !defined(CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER) && \ |
---|
1690 | !defined(CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER) && \ |
---|
1691 | !defined(CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER) && \ |
---|
1692 | !defined(CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER) && \ |
---|
1693 | !defined(CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER) && \ |
---|
1694 | !defined(CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER) && \ |
---|
1695 | !defined(CONFIGURE_APPLICATION_EXTRA_DRIVERS) |
---|
1696 | NULL_DRIVER_TABLE_ENTRY |
---|
1697 | #endif |
---|
1698 | }; |
---|
1699 | |
---|
1700 | const size_t _IO_Number_of_drivers = |
---|
1701 | RTEMS_ARRAY_SIZE( _IO_Driver_address_table ); |
---|
1702 | #endif |
---|
1703 | |
---|
1704 | #endif /* CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE */ |
---|
1705 | |
---|
1706 | #ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER |
---|
1707 | /* |
---|
1708 | * configure the priority of the ATA driver task |
---|
1709 | */ |
---|
1710 | #ifndef CONFIGURE_ATA_DRIVER_TASK_PRIORITY |
---|
1711 | #define CONFIGURE_ATA_DRIVER_TASK_PRIORITY ATA_DRIVER_TASK_DEFAULT_PRIORITY |
---|
1712 | #endif |
---|
1713 | #ifdef CONFIGURE_INIT |
---|
1714 | rtems_task_priority rtems_ata_driver_task_priority |
---|
1715 | = CONFIGURE_ATA_DRIVER_TASK_PRIORITY; |
---|
1716 | #endif /* CONFIGURE_INIT */ |
---|
1717 | #endif |
---|
1718 | /**@}*/ /* end of Device Driver Table Configuration */ |
---|
1719 | |
---|
1720 | /** |
---|
1721 | * @defgroup ConfigurationLibBlock Configuration of LIBBLOCK |
---|
1722 | * |
---|
1723 | * @addtogroup Configuration |
---|
1724 | * |
---|
1725 | * This module contains parameters related to the LIBBLOCK buffering |
---|
1726 | * and caching subsystem. It requires tasks to swap out data to be |
---|
1727 | * written to non-volatile storage. |
---|
1728 | */ |
---|
1729 | /**@{*/ |
---|
1730 | #ifdef CONFIGURE_APPLICATION_NEEDS_LIBBLOCK |
---|
1731 | #include <rtems/bdbuf.h> |
---|
1732 | /* |
---|
1733 | * configure the bdbuf cache parameters |
---|
1734 | */ |
---|
1735 | #ifndef CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS |
---|
1736 | #define CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS \ |
---|
1737 | RTEMS_BDBUF_MAX_READ_AHEAD_BLOCKS_DEFAULT |
---|
1738 | #endif |
---|
1739 | #ifndef CONFIGURE_BDBUF_MAX_WRITE_BLOCKS |
---|
1740 | #define CONFIGURE_BDBUF_MAX_WRITE_BLOCKS \ |
---|
1741 | RTEMS_BDBUF_MAX_WRITE_BLOCKS_DEFAULT |
---|
1742 | #endif |
---|
1743 | #ifndef CONFIGURE_SWAPOUT_TASK_PRIORITY |
---|
1744 | #define CONFIGURE_SWAPOUT_TASK_PRIORITY \ |
---|
1745 | RTEMS_BDBUF_SWAPOUT_TASK_PRIORITY_DEFAULT |
---|
1746 | #endif |
---|
1747 | #ifndef CONFIGURE_SWAPOUT_SWAP_PERIOD |
---|
1748 | #define CONFIGURE_SWAPOUT_SWAP_PERIOD \ |
---|
1749 | RTEMS_BDBUF_SWAPOUT_TASK_SWAP_PERIOD_DEFAULT |
---|
1750 | #endif |
---|
1751 | #ifndef CONFIGURE_SWAPOUT_BLOCK_HOLD |
---|
1752 | #define CONFIGURE_SWAPOUT_BLOCK_HOLD \ |
---|
1753 | RTEMS_BDBUF_SWAPOUT_TASK_BLOCK_HOLD_DEFAULT |
---|
1754 | #endif |
---|
1755 | #ifndef CONFIGURE_SWAPOUT_WORKER_TASKS |
---|
1756 | #define CONFIGURE_SWAPOUT_WORKER_TASKS \ |
---|
1757 | RTEMS_BDBUF_SWAPOUT_WORKER_TASKS_DEFAULT |
---|
1758 | #endif |
---|
1759 | #ifndef CONFIGURE_SWAPOUT_WORKER_TASK_PRIORITY |
---|
1760 | #define CONFIGURE_SWAPOUT_WORKER_TASK_PRIORITY \ |
---|
1761 | RTEMS_BDBUF_SWAPOUT_WORKER_TASK_PRIORITY_DEFAULT |
---|
1762 | #endif |
---|
1763 | #ifndef CONFIGURE_BDBUF_TASK_STACK_SIZE |
---|
1764 | #define CONFIGURE_BDBUF_TASK_STACK_SIZE \ |
---|
1765 | RTEMS_BDBUF_TASK_STACK_SIZE_DEFAULT |
---|
1766 | #endif |
---|
1767 | #ifndef CONFIGURE_BDBUF_CACHE_MEMORY_SIZE |
---|
1768 | #define CONFIGURE_BDBUF_CACHE_MEMORY_SIZE \ |
---|
1769 | RTEMS_BDBUF_CACHE_MEMORY_SIZE_DEFAULT |
---|
1770 | #endif |
---|
1771 | #ifndef CONFIGURE_BDBUF_BUFFER_MIN_SIZE |
---|
1772 | #define CONFIGURE_BDBUF_BUFFER_MIN_SIZE \ |
---|
1773 | RTEMS_BDBUF_BUFFER_MIN_SIZE_DEFAULT |
---|
1774 | #endif |
---|
1775 | #ifndef CONFIGURE_BDBUF_BUFFER_MAX_SIZE |
---|
1776 | #define CONFIGURE_BDBUF_BUFFER_MAX_SIZE \ |
---|
1777 | RTEMS_BDBUF_BUFFER_MAX_SIZE_DEFAULT |
---|
1778 | #endif |
---|
1779 | #ifndef CONFIGURE_BDBUF_READ_AHEAD_TASK_PRIORITY |
---|
1780 | #define CONFIGURE_BDBUF_READ_AHEAD_TASK_PRIORITY \ |
---|
1781 | RTEMS_BDBUF_READ_AHEAD_TASK_PRIORITY_DEFAULT |
---|
1782 | #endif |
---|
1783 | #ifdef CONFIGURE_INIT |
---|
1784 | const rtems_bdbuf_config rtems_bdbuf_configuration = { |
---|
1785 | CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS, |
---|
1786 | CONFIGURE_BDBUF_MAX_WRITE_BLOCKS, |
---|
1787 | CONFIGURE_SWAPOUT_TASK_PRIORITY, |
---|
1788 | CONFIGURE_SWAPOUT_SWAP_PERIOD, |
---|
1789 | CONFIGURE_SWAPOUT_BLOCK_HOLD, |
---|
1790 | CONFIGURE_SWAPOUT_WORKER_TASKS, |
---|
1791 | CONFIGURE_SWAPOUT_WORKER_TASK_PRIORITY, |
---|
1792 | CONFIGURE_BDBUF_TASK_STACK_SIZE, |
---|
1793 | CONFIGURE_BDBUF_CACHE_MEMORY_SIZE, |
---|
1794 | CONFIGURE_BDBUF_BUFFER_MIN_SIZE, |
---|
1795 | CONFIGURE_BDBUF_BUFFER_MAX_SIZE, |
---|
1796 | CONFIGURE_BDBUF_READ_AHEAD_TASK_PRIORITY |
---|
1797 | }; |
---|
1798 | #endif |
---|
1799 | |
---|
1800 | #define _CONFIGURE_LIBBLOCK_TASKS \ |
---|
1801 | (1 + CONFIGURE_SWAPOUT_WORKER_TASKS + \ |
---|
1802 | (CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS != 0)) |
---|
1803 | |
---|
1804 | #define _CONFIGURE_LIBBLOCK_TASK_EXTRA_STACKS \ |
---|
1805 | (_CONFIGURE_LIBBLOCK_TASKS * \ |
---|
1806 | (CONFIGURE_BDBUF_TASK_STACK_SIZE <= CONFIGURE_MINIMUM_TASK_STACK_SIZE ? \ |
---|
1807 | 0 : CONFIGURE_BDBUF_TASK_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE)) |
---|
1808 | |
---|
1809 | #ifdef RTEMS_BDBUF_USE_PTHREAD |
---|
1810 | /* |
---|
1811 | * Semaphores: |
---|
1812 | * o disk lock |
---|
1813 | */ |
---|
1814 | #define _CONFIGURE_LIBBLOCK_SEMAPHORES 1 |
---|
1815 | |
---|
1816 | /* |
---|
1817 | * POSIX Mutexes: |
---|
1818 | * o bdbuf lock |
---|
1819 | * o bdbuf sync lock |
---|
1820 | */ |
---|
1821 | #define _CONFIGURE_LIBBLOCK_POSIX_MUTEXES 2 |
---|
1822 | |
---|
1823 | /* |
---|
1824 | * POSIX Condition Variables: |
---|
1825 | * o bdbuf access condition |
---|
1826 | * o bdbuf transfer condition |
---|
1827 | * o bdbuf buffer condition |
---|
1828 | */ |
---|
1829 | #define _CONFIGURE_LIBBLOCK_POSIX_CONDITION_VARIABLES 3 |
---|
1830 | #else |
---|
1831 | /* |
---|
1832 | * Semaphores: |
---|
1833 | * o disk lock |
---|
1834 | * o bdbuf lock |
---|
1835 | * o bdbuf sync lock |
---|
1836 | * o bdbuf access condition |
---|
1837 | * o bdbuf transfer condition |
---|
1838 | * o bdbuf buffer condition |
---|
1839 | */ |
---|
1840 | #define _CONFIGURE_LIBBLOCK_SEMAPHORES 6 |
---|
1841 | |
---|
1842 | #define _CONFIGURE_LIBBLOCK_POSIX_MUTEXES 0 |
---|
1843 | #define _CONFIGURE_LIBBLOCK_POSIX_CONDITION_VARIABLES 0 |
---|
1844 | #endif |
---|
1845 | |
---|
1846 | #if defined(CONFIGURE_HAS_OWN_BDBUF_TABLE) || \ |
---|
1847 | defined(CONFIGURE_BDBUF_BUFFER_SIZE) || \ |
---|
1848 | defined(CONFIGURE_BDBUF_BUFFER_COUNT) |
---|
1849 | #error BDBUF Cache does not use a buffer configuration table. Please remove. |
---|
1850 | #endif |
---|
1851 | #else |
---|
1852 | /** This specifies the number of libblock tasks. */ |
---|
1853 | #define _CONFIGURE_LIBBLOCK_TASKS 0 |
---|
1854 | /** This specifies the extra stack space configured for libblock tasks. */ |
---|
1855 | #define _CONFIGURE_LIBBLOCK_TASK_EXTRA_STACKS 0 |
---|
1856 | /** This specifies the number of Classic API semaphores needed by libblock. */ |
---|
1857 | #define _CONFIGURE_LIBBLOCK_SEMAPHORES 0 |
---|
1858 | /** This specifies the number of POSIX Mutexes needed by libblock. */ |
---|
1859 | #define _CONFIGURE_LIBBLOCK_POSIX_MUTEXES 0 |
---|
1860 | /** |
---|
1861 | * This specifies the number of POSIX Condition Variables needed |
---|
1862 | * by libblock. |
---|
1863 | */ |
---|
1864 | #define _CONFIGURE_LIBBLOCK_POSIX_CONDITION_VARIABLES 0 |
---|
1865 | #endif /* CONFIGURE_APPLICATION_NEEDS_LIBBLOCK */ |
---|
1866 | /**@}*/ |
---|
1867 | |
---|
1868 | /** |
---|
1869 | * @defgroup ConfigurationMultiprocessing Multiprocessing Configuration |
---|
1870 | * |
---|
1871 | * @addtogroup Configuration |
---|
1872 | * |
---|
1873 | * This module contains the parameters related to the Multiprocessing |
---|
1874 | * configuration of RTEMS. |
---|
1875 | * |
---|
1876 | * In a single processor or SMP configuration, only two parameters are |
---|
1877 | * needed and they are defaulted. The user should not have to specify |
---|
1878 | * any parameters. |
---|
1879 | */ |
---|
1880 | /**@{*/ |
---|
1881 | |
---|
1882 | /** |
---|
1883 | * This defines the extra stack space required for the MPCI server thread. |
---|
1884 | */ |
---|
1885 | #ifndef CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK |
---|
1886 | #define CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK 0 |
---|
1887 | #endif |
---|
1888 | |
---|
1889 | /** |
---|
1890 | * This defines the timers required for the shared memory driver in |
---|
1891 | * a multiprocessing configuration. |
---|
1892 | */ |
---|
1893 | #ifndef _CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER |
---|
1894 | #define _CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER 0 |
---|
1895 | #endif |
---|
1896 | |
---|
1897 | |
---|
1898 | #if defined(RTEMS_MULTIPROCESSING) |
---|
1899 | /* |
---|
1900 | * Default Multiprocessing Configuration Table. The defaults are |
---|
1901 | * appropriate for most of the RTEMS Multiprocessor Test Suite. Each |
---|
1902 | * value may be overridden within each test to customize the environment. |
---|
1903 | */ |
---|
1904 | |
---|
1905 | #ifdef CONFIGURE_MP_APPLICATION |
---|
1906 | #define _CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER 1 |
---|
1907 | |
---|
1908 | #ifndef CONFIGURE_HAS_OWN_MULTIPROCESSING_TABLE |
---|
1909 | |
---|
1910 | #ifndef CONFIGURE_MP_NODE_NUMBER |
---|
1911 | #define CONFIGURE_MP_NODE_NUMBER NODE_NUMBER |
---|
1912 | #endif |
---|
1913 | |
---|
1914 | #ifndef CONFIGURE_MP_MAXIMUM_NODES |
---|
1915 | #define CONFIGURE_MP_MAXIMUM_NODES 2 |
---|
1916 | #endif |
---|
1917 | |
---|
1918 | #ifndef CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS |
---|
1919 | #define CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS 32 |
---|
1920 | #endif |
---|
1921 | #define _CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS(_global_objects) \ |
---|
1922 | _Configure_From_workspace( \ |
---|
1923 | (_global_objects) * sizeof(Objects_MP_Control) \ |
---|
1924 | ) |
---|
1925 | |
---|
1926 | #ifndef CONFIGURE_MP_MAXIMUM_PROXIES |
---|
1927 | #define CONFIGURE_MP_MAXIMUM_PROXIES 32 |
---|
1928 | #endif |
---|
1929 | #define _CONFIGURE_MEMORY_FOR_PROXIES(_proxies) \ |
---|
1930 | _Configure_From_workspace((_proxies) \ |
---|
1931 | * (sizeof(Thread_Proxy_control) \ |
---|
1932 | + THREAD_QUEUE_HEADS_SIZE(CONFIGURE_SCHEDULER_COUNT))) |
---|
1933 | |
---|
1934 | #ifndef CONFIGURE_MP_MPCI_TABLE_POINTER |
---|
1935 | #include <mpci.h> |
---|
1936 | #define CONFIGURE_MP_MPCI_TABLE_POINTER &MPCI_table |
---|
1937 | #endif |
---|
1938 | |
---|
1939 | #ifdef CONFIGURE_INIT |
---|
1940 | rtems_multiprocessing_table Multiprocessing_configuration = { |
---|
1941 | CONFIGURE_MP_NODE_NUMBER, /* local node number */ |
---|
1942 | CONFIGURE_MP_MAXIMUM_NODES, /* maximum # nodes */ |
---|
1943 | CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS, /* maximum # global objects */ |
---|
1944 | CONFIGURE_MP_MAXIMUM_PROXIES, /* maximum # proxies */ |
---|
1945 | CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK, /* MPCI stack > minimum */ |
---|
1946 | CONFIGURE_MP_MPCI_TABLE_POINTER /* ptr to MPCI config table */ |
---|
1947 | }; |
---|
1948 | #endif |
---|
1949 | |
---|
1950 | #define CONFIGURE_MULTIPROCESSING_TABLE &Multiprocessing_configuration |
---|
1951 | |
---|
1952 | #define _CONFIGURE_MPCI_RECEIVE_SERVER_COUNT 1 |
---|
1953 | |
---|
1954 | #endif /* CONFIGURE_HAS_OWN_MULTIPROCESSING_TABLE */ |
---|
1955 | |
---|
1956 | #else |
---|
1957 | |
---|
1958 | #define CONFIGURE_MULTIPROCESSING_TABLE NULL |
---|
1959 | |
---|
1960 | #define _CONFIGURE_MPCI_RECEIVE_SERVER_COUNT 0 |
---|
1961 | |
---|
1962 | #endif /* CONFIGURE_MP_APPLICATION */ |
---|
1963 | #else |
---|
1964 | #define _CONFIGURE_MPCI_RECEIVE_SERVER_COUNT 0 |
---|
1965 | #endif /* RTEMS_MULTIPROCESSING */ |
---|
1966 | /**@}*/ /* end of Multiprocessing Configuration */ |
---|
1967 | |
---|
1968 | /** |
---|
1969 | * This macro specifies that the user wants to use unlimited objects for any |
---|
1970 | * classic or posix objects that have not already been given resource limits. |
---|
1971 | */ |
---|
1972 | #if defined(CONFIGURE_UNLIMITED_OBJECTS) |
---|
1973 | #if !defined(CONFIGURE_UNIFIED_WORK_AREAS) && \ |
---|
1974 | !defined(CONFIGURE_EXECUTIVE_RAM_SIZE) && \ |
---|
1975 | !defined(CONFIGURE_MEMORY_OVERHEAD) |
---|
1976 | #error "CONFIGURE_UNLIMITED_OBJECTS requires a unified work area, an executive RAM size, or a defined workspace memory overhead" |
---|
1977 | #endif |
---|
1978 | |
---|
1979 | #if !defined(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
1980 | /** |
---|
1981 | * This macro specifies a default allocation size for when auto-extending |
---|
1982 | * unlimited objects if none was given by the user. |
---|
1983 | */ |
---|
1984 | #define CONFIGURE_UNLIMITED_ALLOCATION_SIZE 8 |
---|
1985 | #endif |
---|
1986 | #if !defined(CONFIGURE_MAXIMUM_TASKS) |
---|
1987 | #define CONFIGURE_MAXIMUM_TASKS \ |
---|
1988 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
1989 | #endif |
---|
1990 | #if !defined(CONFIGURE_MAXIMUM_TIMERS) |
---|
1991 | #define CONFIGURE_MAXIMUM_TIMERS \ |
---|
1992 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
1993 | #endif |
---|
1994 | #if !defined(CONFIGURE_MAXIMUM_SEMAPHORES) |
---|
1995 | #define CONFIGURE_MAXIMUM_SEMAPHORES \ |
---|
1996 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
1997 | #endif |
---|
1998 | #if !defined(CONFIGURE_MAXIMUM_MESSAGE_QUEUES) |
---|
1999 | #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES \ |
---|
2000 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
2001 | #endif |
---|
2002 | #if !defined(CONFIGURE_MAXIMUM_PARTITIONS) |
---|
2003 | #define CONFIGURE_MAXIMUM_PARTITIONS \ |
---|
2004 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
2005 | #endif |
---|
2006 | #if !defined(CONFIGURE_MAXIMUM_REGIONS) |
---|
2007 | #define CONFIGURE_MAXIMUM_REGIONS \ |
---|
2008 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
2009 | #endif |
---|
2010 | #if !defined(CONFIGURE_MAXIMUM_PORTS) |
---|
2011 | #define CONFIGURE_MAXIMUM_PORTS \ |
---|
2012 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
2013 | #endif |
---|
2014 | #if !defined(CONFIGURE_MAXIMUM_PERIODS) |
---|
2015 | #define CONFIGURE_MAXIMUM_PERIODS \ |
---|
2016 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
2017 | #endif |
---|
2018 | #if !defined(CONFIGURE_MAXIMUM_BARRIERS) |
---|
2019 | #define CONFIGURE_MAXIMUM_BARRIERS \ |
---|
2020 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
2021 | #endif |
---|
2022 | #if !defined(CONFIGURE_MAXIMUM_POSIX_KEYS) |
---|
2023 | #define CONFIGURE_MAXIMUM_POSIX_KEYS \ |
---|
2024 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
2025 | #endif |
---|
2026 | #if !defined(CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS) |
---|
2027 | #define CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS \ |
---|
2028 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
2029 | #endif |
---|
2030 | |
---|
2031 | #ifdef RTEMS_POSIX_API |
---|
2032 | #if !defined(CONFIGURE_MAXIMUM_POSIX_THREADS) |
---|
2033 | #define CONFIGURE_MAXIMUM_POSIX_THREADS \ |
---|
2034 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
2035 | #endif |
---|
2036 | #if !defined(CONFIGURE_MAXIMUM_POSIX_MUTEXES) |
---|
2037 | #define CONFIGURE_MAXIMUM_POSIX_MUTEXES \ |
---|
2038 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
2039 | #endif |
---|
2040 | #if !defined(CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES) |
---|
2041 | #define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES \ |
---|
2042 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
2043 | #endif |
---|
2044 | #if !defined(CONFIGURE_MAXIMUM_POSIX_TIMERS) |
---|
2045 | #define CONFIGURE_MAXIMUM_POSIX_TIMERS \ |
---|
2046 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
2047 | #endif |
---|
2048 | /* |
---|
2049 | #if !defined(CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS) |
---|
2050 | #define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS \ |
---|
2051 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
2052 | #endif |
---|
2053 | */ |
---|
2054 | #if !defined(CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES) |
---|
2055 | #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES \ |
---|
2056 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
2057 | #endif |
---|
2058 | #if !defined(CONFIGURE_MAXIMUM_POSIX_SEMAPHORES) |
---|
2059 | #define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES \ |
---|
2060 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
2061 | #endif |
---|
2062 | #if !defined(CONFIGURE_MAXIMUM_POSIX_BARRIERS) |
---|
2063 | #define CONFIGURE_MAXIMUM_POSIX_BARRIERS \ |
---|
2064 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
2065 | #endif |
---|
2066 | #if !defined(CONFIGURE_MAXIMUM_POSIX_RWLOCKS) |
---|
2067 | #define CONFIGURE_MAXIMUM_POSIX_RWLOCKS \ |
---|
2068 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
2069 | #endif |
---|
2070 | #if !defined(CONFIGURE_MAXIMUM_POSIX_SHMS) |
---|
2071 | #define CONFIGURE_MAXIMUM_POSIX_SHMS \ |
---|
2072 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
2073 | #endif |
---|
2074 | #endif /* RTEMS_POSIX_API */ |
---|
2075 | #endif /* CONFIGURE_UNLIMITED_OBJECTS */ |
---|
2076 | |
---|
2077 | |
---|
2078 | /** |
---|
2079 | * @defgroup ConfigurationClassicAPI Classic API Configuration |
---|
2080 | * |
---|
2081 | * @ingroup Configuration |
---|
2082 | * |
---|
2083 | * This module contains the parameters related to configuration |
---|
2084 | * of the Classic API services. |
---|
2085 | */ |
---|
2086 | /**@{*/ |
---|
2087 | #ifndef CONFIGURE_HAS_OWN_CONFIGURATION_TABLE |
---|
2088 | |
---|
2089 | /** This configures the maximum number of Classic API tasks. */ |
---|
2090 | #ifndef CONFIGURE_MAXIMUM_TASKS |
---|
2091 | #define CONFIGURE_MAXIMUM_TASKS 0 |
---|
2092 | #endif |
---|
2093 | |
---|
2094 | /* |
---|
2095 | * This is calculated to account for the maximum number of Classic API |
---|
2096 | * tasks used by the application and configured RTEMS capabilities. |
---|
2097 | */ |
---|
2098 | #define _CONFIGURE_TASKS \ |
---|
2099 | (CONFIGURE_MAXIMUM_TASKS + _CONFIGURE_LIBBLOCK_TASKS) |
---|
2100 | |
---|
2101 | #ifndef CONFIGURE_MAXIMUM_TIMERS |
---|
2102 | /** This specifies the maximum number of Classic API timers. */ |
---|
2103 | #define CONFIGURE_MAXIMUM_TIMERS 0 |
---|
2104 | /* |
---|
2105 | * This macro is calculated to specify the memory required for |
---|
2106 | * Classic API timers. |
---|
2107 | */ |
---|
2108 | #define _CONFIGURE_MEMORY_FOR_TIMERS(_timers) 0 |
---|
2109 | #else |
---|
2110 | #define _CONFIGURE_MEMORY_FOR_TIMERS(_timers) \ |
---|
2111 | _Configure_Object_RAM(_timers, sizeof(Timer_Control) ) |
---|
2112 | #endif |
---|
2113 | |
---|
2114 | #ifndef CONFIGURE_MAXIMUM_SEMAPHORES |
---|
2115 | /** This specifies the maximum number of Classic API semaphores. */ |
---|
2116 | #define CONFIGURE_MAXIMUM_SEMAPHORES 0 |
---|
2117 | #endif |
---|
2118 | |
---|
2119 | /* |
---|
2120 | * This specifies the number of Classic API semaphores required |
---|
2121 | */ |
---|
2122 | #ifdef RTEMS_NETWORKING |
---|
2123 | #define _CONFIGURE_NETWORKING_SEMAPHORES 1 |
---|
2124 | #else |
---|
2125 | #define _CONFIGURE_NETWORKING_SEMAPHORES 0 |
---|
2126 | #endif |
---|
2127 | |
---|
2128 | /* |
---|
2129 | * This macro is calculated to specify the number of Classic API |
---|
2130 | * semaphores required by the application and configured RTEMS |
---|
2131 | * capabilities. |
---|
2132 | */ |
---|
2133 | #define _CONFIGURE_SEMAPHORES \ |
---|
2134 | (CONFIGURE_MAXIMUM_SEMAPHORES + _CONFIGURE_LIBIO_SEMAPHORES + \ |
---|
2135 | _CONFIGURE_TERMIOS_SEMAPHORES + _CONFIGURE_LIBBLOCK_SEMAPHORES + \ |
---|
2136 | _CONFIGURE_SEMAPHORES_FOR_FILE_SYSTEMS + \ |
---|
2137 | _CONFIGURE_NETWORKING_SEMAPHORES + _CONFIGURE_DRVMGR_SEMAPHORES) |
---|
2138 | |
---|
2139 | /* |
---|
2140 | * This macro is calculated to specify the memory required for |
---|
2141 | * Classic API Semaphores using MRSP. This is only available in |
---|
2142 | * SMP configurations. |
---|
2143 | */ |
---|
2144 | #if !defined(RTEMS_SMP) || \ |
---|
2145 | !defined(CONFIGURE_MAXIMUM_MRSP_SEMAPHORES) |
---|
2146 | #define _CONFIGURE_MEMORY_FOR_MRSP_SEMAPHORES 0 |
---|
2147 | #else |
---|
2148 | #define _CONFIGURE_MEMORY_FOR_MRSP_SEMAPHORES \ |
---|
2149 | CONFIGURE_MAXIMUM_MRSP_SEMAPHORES * \ |
---|
2150 | _Configure_From_workspace( \ |
---|
2151 | RTEMS_ARRAY_SIZE(_Scheduler_Table) * sizeof(Priority_Control) \ |
---|
2152 | ) |
---|
2153 | #endif |
---|
2154 | |
---|
2155 | /* |
---|
2156 | * This macro is calculated to specify the memory required for |
---|
2157 | * Classic API Semaphores. |
---|
2158 | * |
---|
2159 | * If there are no user or support semaphores defined, then we can assume |
---|
2160 | * that no memory need be allocated at all for semaphores. |
---|
2161 | */ |
---|
2162 | #if _CONFIGURE_SEMAPHORES == 0 |
---|
2163 | #define _CONFIGURE_MEMORY_FOR_SEMAPHORES(_semaphores) 0 |
---|
2164 | #else |
---|
2165 | #define _CONFIGURE_MEMORY_FOR_SEMAPHORES(_semaphores) \ |
---|
2166 | _Configure_Object_RAM(_semaphores, sizeof(Semaphore_Control) ) + \ |
---|
2167 | _CONFIGURE_MEMORY_FOR_MRSP_SEMAPHORES |
---|
2168 | #endif |
---|
2169 | |
---|
2170 | #ifndef CONFIGURE_MAXIMUM_MESSAGE_QUEUES |
---|
2171 | /** |
---|
2172 | * This configuration parameter specifies the maximum number of |
---|
2173 | * Classic API Message Queues. |
---|
2174 | */ |
---|
2175 | #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 0 |
---|
2176 | /* |
---|
2177 | * This macro is calculated to specify the RTEMS Workspace required for |
---|
2178 | * the Classic API Message Queues. |
---|
2179 | */ |
---|
2180 | #define _CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(_queues) 0 |
---|
2181 | #else |
---|
2182 | #define _CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(_queues) \ |
---|
2183 | _Configure_Object_RAM(_queues, sizeof(Message_queue_Control) ) |
---|
2184 | #endif |
---|
2185 | |
---|
2186 | #ifndef CONFIGURE_MAXIMUM_PARTITIONS |
---|
2187 | /** |
---|
2188 | * This configuration parameter specifies the maximum number of |
---|
2189 | * Classic API Partitions. |
---|
2190 | */ |
---|
2191 | #define CONFIGURE_MAXIMUM_PARTITIONS 0 |
---|
2192 | /* |
---|
2193 | * This macro is calculated to specify the memory required for |
---|
2194 | * Classic API |
---|
2195 | */ |
---|
2196 | #define _CONFIGURE_MEMORY_FOR_PARTITIONS(_partitions) 0 |
---|
2197 | #else |
---|
2198 | #define _CONFIGURE_MEMORY_FOR_PARTITIONS(_partitions) \ |
---|
2199 | _Configure_Object_RAM(_partitions, sizeof(Partition_Control) ) |
---|
2200 | #endif |
---|
2201 | |
---|
2202 | #ifndef CONFIGURE_MAXIMUM_REGIONS |
---|
2203 | /** |
---|
2204 | * This configuration parameter specifies the maximum number of |
---|
2205 | * Classic API Regions. |
---|
2206 | */ |
---|
2207 | #define CONFIGURE_MAXIMUM_REGIONS 0 |
---|
2208 | /* |
---|
2209 | * This macro is calculated to specify the memory required for |
---|
2210 | * Classic API Regions. |
---|
2211 | */ |
---|
2212 | #define _CONFIGURE_MEMORY_FOR_REGIONS(_regions) 0 |
---|
2213 | #else |
---|
2214 | #define _CONFIGURE_MEMORY_FOR_REGIONS(_regions) \ |
---|
2215 | _Configure_Object_RAM(_regions, sizeof(Region_Control) ) |
---|
2216 | #endif |
---|
2217 | |
---|
2218 | #ifndef CONFIGURE_MAXIMUM_PORTS |
---|
2219 | /** |
---|
2220 | * This configuration parameter specifies the maximum number of |
---|
2221 | * Classic API Dual-Ported Memory Ports. |
---|
2222 | */ |
---|
2223 | #define CONFIGURE_MAXIMUM_PORTS 0 |
---|
2224 | /** |
---|
2225 | * This macro is calculated to specify the memory required for |
---|
2226 | * Classic API Dual-Ported Memory Ports. |
---|
2227 | */ |
---|
2228 | #define _CONFIGURE_MEMORY_FOR_PORTS(_ports) 0 |
---|
2229 | #else |
---|
2230 | #define _CONFIGURE_MEMORY_FOR_PORTS(_ports) \ |
---|
2231 | _Configure_Object_RAM(_ports, sizeof(Dual_ported_memory_Control) ) |
---|
2232 | #endif |
---|
2233 | |
---|
2234 | #ifndef CONFIGURE_MAXIMUM_PERIODS |
---|
2235 | /** |
---|
2236 | * This configuration parameter specifies the maximum number of |
---|
2237 | * Classic API Rate Monotonic Periods. |
---|
2238 | */ |
---|
2239 | #define CONFIGURE_MAXIMUM_PERIODS 0 |
---|
2240 | /* |
---|
2241 | * This macro is calculated to specify the memory required for |
---|
2242 | * Classic API Rate Monotonic Periods. |
---|
2243 | */ |
---|
2244 | #define _CONFIGURE_MEMORY_FOR_PERIODS(_periods) 0 |
---|
2245 | #else |
---|
2246 | #define _CONFIGURE_MEMORY_FOR_PERIODS(_periods) \ |
---|
2247 | _Configure_Object_RAM(_periods, sizeof(Rate_monotonic_Control) ) |
---|
2248 | #endif |
---|
2249 | |
---|
2250 | /** |
---|
2251 | * This configuration parameter specifies the maximum number of |
---|
2252 | * Classic API Barriers. |
---|
2253 | */ |
---|
2254 | #ifndef CONFIGURE_MAXIMUM_BARRIERS |
---|
2255 | #define CONFIGURE_MAXIMUM_BARRIERS 0 |
---|
2256 | #endif |
---|
2257 | |
---|
2258 | /* |
---|
2259 | * This macro is calculated to specify the number of Classic API |
---|
2260 | * Barriers required by the application and configured capabilities. |
---|
2261 | */ |
---|
2262 | #define _CONFIGURE_BARRIERS \ |
---|
2263 | (CONFIGURE_MAXIMUM_BARRIERS + _CONFIGURE_BARRIERS_FOR_FIFOS) |
---|
2264 | |
---|
2265 | /* |
---|
2266 | * This macro is calculated to specify the memory required for |
---|
2267 | * Classic API Barriers. |
---|
2268 | */ |
---|
2269 | #if _CONFIGURE_BARRIERS == 0 |
---|
2270 | #define _CONFIGURE_MEMORY_FOR_BARRIERS(_barriers) 0 |
---|
2271 | #else |
---|
2272 | #define _CONFIGURE_MEMORY_FOR_BARRIERS(_barriers) \ |
---|
2273 | _Configure_Object_RAM(_barriers, sizeof(Barrier_Control) ) |
---|
2274 | #endif |
---|
2275 | |
---|
2276 | #ifndef CONFIGURE_MAXIMUM_USER_EXTENSIONS |
---|
2277 | /** |
---|
2278 | * This configuration parameter specifies the maximum number of |
---|
2279 | * Classic API User Extensions. |
---|
2280 | */ |
---|
2281 | #define CONFIGURE_MAXIMUM_USER_EXTENSIONS 0 |
---|
2282 | /* |
---|
2283 | * This macro is calculated to specify the memory required for |
---|
2284 | * Classic API User Extensions. |
---|
2285 | */ |
---|
2286 | #define _CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(_extensions) 0 |
---|
2287 | #else |
---|
2288 | #define _CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(_extensions) \ |
---|
2289 | _Configure_Object_RAM(_extensions, sizeof(Extension_Control) ) |
---|
2290 | #endif |
---|
2291 | /**@}*/ /* end of Classic API Configuration */ |
---|
2292 | |
---|
2293 | /** |
---|
2294 | * @defgroup ConfigurationGeneral General System Configuration |
---|
2295 | * |
---|
2296 | * @ingroup Configuration |
---|
2297 | * |
---|
2298 | * This module contains configuration parameters that are independent |
---|
2299 | * of any API but impact general system configuration. |
---|
2300 | */ |
---|
2301 | /**@{*/ |
---|
2302 | |
---|
2303 | /** The configures the number of microseconds per clock tick. */ |
---|
2304 | #ifndef CONFIGURE_MICROSECONDS_PER_TICK |
---|
2305 | #define CONFIGURE_MICROSECONDS_PER_TICK \ |
---|
2306 | RTEMS_MILLISECONDS_TO_MICROSECONDS(10) |
---|
2307 | #endif |
---|
2308 | |
---|
2309 | /** The configures the number of clock ticks per timeslice. */ |
---|
2310 | #ifndef CONFIGURE_TICKS_PER_TIMESLICE |
---|
2311 | #define CONFIGURE_TICKS_PER_TIMESLICE 50 |
---|
2312 | #endif |
---|
2313 | |
---|
2314 | /**@}*/ /* end of General Configuration */ |
---|
2315 | |
---|
2316 | /* |
---|
2317 | * Initial Extension Set |
---|
2318 | */ |
---|
2319 | |
---|
2320 | #ifdef CONFIGURE_INIT |
---|
2321 | #ifdef CONFIGURE_STACK_CHECKER_ENABLED |
---|
2322 | #include <rtems/stackchk.h> |
---|
2323 | #endif |
---|
2324 | #include <rtems/libcsupport.h> |
---|
2325 | |
---|
2326 | #if defined(BSP_INITIAL_EXTENSION) || \ |
---|
2327 | defined(CONFIGURE_INITIAL_EXTENSIONS) || \ |
---|
2328 | defined(CONFIGURE_STACK_CHECKER_ENABLED) || \ |
---|
2329 | (defined(RTEMS_NEWLIB) && !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY)) |
---|
2330 | static const rtems_extensions_table Configuration_Initial_Extensions[] = { |
---|
2331 | #if !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY) |
---|
2332 | RTEMS_NEWLIB_EXTENSION, |
---|
2333 | #endif |
---|
2334 | #if defined(CONFIGURE_STACK_CHECKER_ENABLED) |
---|
2335 | RTEMS_STACK_CHECKER_EXTENSION, |
---|
2336 | #endif |
---|
2337 | #if defined(CONFIGURE_INITIAL_EXTENSIONS) |
---|
2338 | CONFIGURE_INITIAL_EXTENSIONS, |
---|
2339 | #endif |
---|
2340 | #if defined(BSP_INITIAL_EXTENSION) |
---|
2341 | BSP_INITIAL_EXTENSION |
---|
2342 | #endif |
---|
2343 | }; |
---|
2344 | |
---|
2345 | #define CONFIGURE_INITIAL_EXTENSION_TABLE Configuration_Initial_Extensions |
---|
2346 | #define _CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS \ |
---|
2347 | RTEMS_ARRAY_SIZE(Configuration_Initial_Extensions) |
---|
2348 | |
---|
2349 | RTEMS_SYSINIT_ITEM( |
---|
2350 | _User_extensions_Handler_initialization, |
---|
2351 | RTEMS_SYSINIT_INITIAL_EXTENSIONS, |
---|
2352 | RTEMS_SYSINIT_ORDER_MIDDLE |
---|
2353 | ); |
---|
2354 | #else |
---|
2355 | #define CONFIGURE_INITIAL_EXTENSION_TABLE NULL |
---|
2356 | #define _CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS 0 |
---|
2357 | #endif |
---|
2358 | |
---|
2359 | #if defined(RTEMS_NEWLIB) |
---|
2360 | struct _reent *__getreent(void) |
---|
2361 | { |
---|
2362 | #ifdef CONFIGURE_DISABLE_NEWLIB_REENTRANCY |
---|
2363 | return _GLOBAL_REENT; |
---|
2364 | #else |
---|
2365 | return _Thread_Get_executing()->libc_reent; |
---|
2366 | #endif |
---|
2367 | } |
---|
2368 | #endif |
---|
2369 | |
---|
2370 | #endif |
---|
2371 | |
---|
2372 | /** |
---|
2373 | * @defgroup ConfigurationPOSIXAPI POSIX API Configuration Parameters |
---|
2374 | * |
---|
2375 | * This module contains the parameters related to configuration |
---|
2376 | * of the POSIX API services. |
---|
2377 | */ |
---|
2378 | /**@{*/ |
---|
2379 | |
---|
2380 | #include <rtems/posix/key.h> |
---|
2381 | |
---|
2382 | /** |
---|
2383 | * This configuration parameter specifies the maximum number of |
---|
2384 | * POSIX API keys. |
---|
2385 | * |
---|
2386 | * POSIX Keys are available whether or not the POSIX API is enabled. |
---|
2387 | */ |
---|
2388 | #ifndef CONFIGURE_MAXIMUM_POSIX_KEYS |
---|
2389 | #define CONFIGURE_MAXIMUM_POSIX_KEYS 0 |
---|
2390 | #endif |
---|
2391 | |
---|
2392 | /* |
---|
2393 | * This macro is calculated to specify the memory required for |
---|
2394 | * POSIX API key/value pairs. |
---|
2395 | */ |
---|
2396 | #ifndef CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS |
---|
2397 | #define CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS \ |
---|
2398 | (CONFIGURE_MAXIMUM_POSIX_KEYS * \ |
---|
2399 | (CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_TASKS)) |
---|
2400 | #endif |
---|
2401 | |
---|
2402 | /* |
---|
2403 | * This macro is calculated to specify the total number of |
---|
2404 | * POSIX API keys required by the application and configured |
---|
2405 | * system capabilities. |
---|
2406 | */ |
---|
2407 | #define _CONFIGURE_POSIX_KEYS \ |
---|
2408 | (CONFIGURE_MAXIMUM_POSIX_KEYS + _CONFIGURE_LIBIO_POSIX_KEYS) |
---|
2409 | |
---|
2410 | /* |
---|
2411 | * This macro is calculated to specify the memory required for |
---|
2412 | * POSIX API keys. |
---|
2413 | */ |
---|
2414 | #define _CONFIGURE_MEMORY_FOR_POSIX_KEYS(_keys, _key_value_pairs) \ |
---|
2415 | (_Configure_Object_RAM(_keys, sizeof(POSIX_Keys_Control) ) \ |
---|
2416 | + _Configure_From_workspace( \ |
---|
2417 | _key_value_pairs * sizeof(POSIX_Keys_Key_value_pair))) |
---|
2418 | |
---|
2419 | /* |
---|
2420 | * The rest of the POSIX threads API features are only available when |
---|
2421 | * POSIX is enabled. |
---|
2422 | */ |
---|
2423 | #ifdef RTEMS_POSIX_API |
---|
2424 | #include <sys/types.h> |
---|
2425 | #include <signal.h> |
---|
2426 | #include <limits.h> |
---|
2427 | #include <mqueue.h> |
---|
2428 | #include <rtems/posix/barrier.h> |
---|
2429 | #include <rtems/posix/cond.h> |
---|
2430 | #include <rtems/posix/mqueue.h> |
---|
2431 | #include <rtems/posix/mutex.h> |
---|
2432 | #include <rtems/posix/psignal.h> |
---|
2433 | #include <rtems/posix/pthread.h> |
---|
2434 | #include <rtems/posix/rwlock.h> |
---|
2435 | #include <rtems/posix/semaphore.h> |
---|
2436 | #include <rtems/posix/shm.h> |
---|
2437 | #include <rtems/posix/threadsup.h> |
---|
2438 | #include <rtems/posix/timer.h> |
---|
2439 | |
---|
2440 | /* |
---|
2441 | * Account for the object control structures plus the name |
---|
2442 | * of the object to be duplicated. |
---|
2443 | */ |
---|
2444 | #define _Configure_POSIX_Named_Object_RAM(_number, _size) \ |
---|
2445 | (_Configure_Object_RAM(_number, _size) \ |
---|
2446 | + _Configure_Max_Objects(_number) \ |
---|
2447 | * _Configure_From_workspace(_POSIX_PATH_MAX + 1)) |
---|
2448 | |
---|
2449 | /** |
---|
2450 | * This configuration parameter specifies the maximum number of |
---|
2451 | * POSIX API threads. |
---|
2452 | */ |
---|
2453 | #ifndef CONFIGURE_MAXIMUM_POSIX_THREADS |
---|
2454 | #define CONFIGURE_MAXIMUM_POSIX_THREADS 0 |
---|
2455 | #endif |
---|
2456 | |
---|
2457 | /** |
---|
2458 | * This configuration parameter specifies the maximum number of |
---|
2459 | * POSIX API mutexes. |
---|
2460 | */ |
---|
2461 | #ifndef CONFIGURE_MAXIMUM_POSIX_MUTEXES |
---|
2462 | #define CONFIGURE_MAXIMUM_POSIX_MUTEXES 0 |
---|
2463 | #endif |
---|
2464 | |
---|
2465 | /* |
---|
2466 | * This macro is calculated to specify the memory required for |
---|
2467 | * POSIX API mutexes. |
---|
2468 | */ |
---|
2469 | #define _CONFIGURE_MEMORY_FOR_POSIX_MUTEXES(_mutexes) \ |
---|
2470 | _Configure_Object_RAM(_mutexes, sizeof(POSIX_Mutex_Control) ) |
---|
2471 | |
---|
2472 | /** |
---|
2473 | * This configuration parameter specifies the maximum number of |
---|
2474 | * POSIX API condition variables. |
---|
2475 | */ |
---|
2476 | #ifndef CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES |
---|
2477 | #define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 0 |
---|
2478 | #endif |
---|
2479 | |
---|
2480 | /* |
---|
2481 | * This macro is calculated to specify the memory required for |
---|
2482 | * POSIX API condition variables. |
---|
2483 | */ |
---|
2484 | #define _CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES(_condvars) \ |
---|
2485 | _Configure_Object_RAM(_condvars, \ |
---|
2486 | sizeof(POSIX_Condition_variables_Control) ) |
---|
2487 | |
---|
2488 | /** |
---|
2489 | * This configuration parameter specifies the maximum number of |
---|
2490 | * POSIX API timers. |
---|
2491 | */ |
---|
2492 | #ifndef CONFIGURE_MAXIMUM_POSIX_TIMERS |
---|
2493 | #define CONFIGURE_MAXIMUM_POSIX_TIMERS 0 |
---|
2494 | #endif |
---|
2495 | |
---|
2496 | /* |
---|
2497 | * This macro is calculated to specify the memory required for |
---|
2498 | * POSIX API timers. |
---|
2499 | */ |
---|
2500 | #define _CONFIGURE_MEMORY_FOR_POSIX_TIMERS(_timers) \ |
---|
2501 | _Configure_Object_RAM(_timers, sizeof(POSIX_Timer_Control) ) |
---|
2502 | |
---|
2503 | /** |
---|
2504 | * This configuration parameter specifies the maximum number of |
---|
2505 | * POSIX API queued signals. |
---|
2506 | */ |
---|
2507 | #ifndef CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS |
---|
2508 | #define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS 0 |
---|
2509 | #endif |
---|
2510 | |
---|
2511 | /* |
---|
2512 | * This macro is calculated to specify the memory required for |
---|
2513 | * POSIX API queued signals. |
---|
2514 | */ |
---|
2515 | #define _CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS(_queued_signals) \ |
---|
2516 | _Configure_From_workspace( \ |
---|
2517 | (_queued_signals) * (sizeof(POSIX_signals_Siginfo_node)) ) |
---|
2518 | |
---|
2519 | /** |
---|
2520 | * This configuration parameter specifies the maximum number of |
---|
2521 | * POSIX API message queues. |
---|
2522 | */ |
---|
2523 | #ifndef CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES |
---|
2524 | #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES 0 |
---|
2525 | #endif |
---|
2526 | |
---|
2527 | /* |
---|
2528 | * This macro is calculated to specify the memory required for |
---|
2529 | * POSIX API message queues. |
---|
2530 | */ |
---|
2531 | #define _CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES(_message_queues) \ |
---|
2532 | _Configure_POSIX_Named_Object_RAM( \ |
---|
2533 | _message_queues, sizeof(POSIX_Message_queue_Control) ) |
---|
2534 | |
---|
2535 | /** |
---|
2536 | * This configuration parameter specifies the maximum number of |
---|
2537 | * POSIX API semaphores. |
---|
2538 | */ |
---|
2539 | #ifndef CONFIGURE_MAXIMUM_POSIX_SEMAPHORES |
---|
2540 | #define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES 0 |
---|
2541 | #endif |
---|
2542 | |
---|
2543 | /* |
---|
2544 | * This macro is calculated to specify the memory required for |
---|
2545 | * POSIX API semaphores. |
---|
2546 | */ |
---|
2547 | #define _CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES(_semaphores) \ |
---|
2548 | _Configure_POSIX_Named_Object_RAM( \ |
---|
2549 | _semaphores, sizeof(POSIX_Semaphore_Control) ) |
---|
2550 | |
---|
2551 | /** |
---|
2552 | * This configuration parameter specifies the maximum number of |
---|
2553 | * POSIX API barriers. |
---|
2554 | */ |
---|
2555 | #ifndef CONFIGURE_MAXIMUM_POSIX_BARRIERS |
---|
2556 | #define CONFIGURE_MAXIMUM_POSIX_BARRIERS 0 |
---|
2557 | #endif |
---|
2558 | |
---|
2559 | /* |
---|
2560 | * This macro is calculated to specify the memory required for |
---|
2561 | * POSIX API barriers. |
---|
2562 | */ |
---|
2563 | #define _CONFIGURE_MEMORY_FOR_POSIX_BARRIERS(_barriers) \ |
---|
2564 | _Configure_Object_RAM(_barriers, sizeof(POSIX_Barrier_Control) ) |
---|
2565 | |
---|
2566 | /** |
---|
2567 | * This configuration parameter specifies the maximum number of |
---|
2568 | * POSIX API rwlocks. |
---|
2569 | */ |
---|
2570 | #ifndef CONFIGURE_MAXIMUM_POSIX_RWLOCKS |
---|
2571 | #define CONFIGURE_MAXIMUM_POSIX_RWLOCKS 0 |
---|
2572 | #endif |
---|
2573 | |
---|
2574 | /* |
---|
2575 | * This macro is calculated to specify the memory required for |
---|
2576 | * POSIX API rwlocks. |
---|
2577 | */ |
---|
2578 | #define _CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS(_rwlocks) \ |
---|
2579 | _Configure_Object_RAM(_rwlocks, sizeof(POSIX_RWLock_Control) ) |
---|
2580 | |
---|
2581 | /** |
---|
2582 | * Configure the maximum number of POSIX shared memory objects. |
---|
2583 | */ |
---|
2584 | #if !defined(CONFIGURE_MAXIMUM_POSIX_SHMS) |
---|
2585 | #define CONFIGURE_MAXIMUM_POSIX_SHMS 0 |
---|
2586 | #else |
---|
2587 | #ifdef CONFIGURE_INIT |
---|
2588 | #if !defined(CONFIGURE_HAS_OWN_POSIX_SHM_OBJECT_OPERATIONS) |
---|
2589 | const POSIX_Shm_Object_operations _POSIX_Shm_Object_operations = { |
---|
2590 | _POSIX_Shm_Object_create_from_workspace, |
---|
2591 | _POSIX_Shm_Object_resize_from_workspace, |
---|
2592 | _POSIX_Shm_Object_delete_from_workspace, |
---|
2593 | _POSIX_Shm_Object_read_from_workspace, |
---|
2594 | _POSIX_Shm_Object_mmap_from_workspace |
---|
2595 | }; |
---|
2596 | #endif |
---|
2597 | #endif |
---|
2598 | #endif |
---|
2599 | |
---|
2600 | /* |
---|
2601 | * This macro is calculated to specify the memory required for |
---|
2602 | * POSIX API shared memory. |
---|
2603 | */ |
---|
2604 | #define _CONFIGURE_MEMORY_FOR_POSIX_SHMS(_shms) \ |
---|
2605 | _Configure_POSIX_Named_Object_RAM(_shms, sizeof(POSIX_Shm_Control) ) |
---|
2606 | |
---|
2607 | |
---|
2608 | #ifdef CONFIGURE_POSIX_INIT_THREAD_TABLE |
---|
2609 | |
---|
2610 | #ifdef CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE |
---|
2611 | |
---|
2612 | /* |
---|
2613 | * The user is defining their own table information and setting the |
---|
2614 | * appropriate variables for the POSIX Initialization Thread Table. |
---|
2615 | */ |
---|
2616 | |
---|
2617 | #else |
---|
2618 | |
---|
2619 | #ifndef CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT |
---|
2620 | #define CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT POSIX_Init |
---|
2621 | #endif |
---|
2622 | |
---|
2623 | #ifndef CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE |
---|
2624 | #define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE \ |
---|
2625 | CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE |
---|
2626 | #endif |
---|
2627 | |
---|
2628 | #ifdef CONFIGURE_INIT |
---|
2629 | posix_initialization_threads_table POSIX_Initialization_threads[] = { |
---|
2630 | { CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT, \ |
---|
2631 | CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE } |
---|
2632 | }; |
---|
2633 | #endif |
---|
2634 | |
---|
2635 | #define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME \ |
---|
2636 | POSIX_Initialization_threads |
---|
2637 | |
---|
2638 | #define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE \ |
---|
2639 | RTEMS_ARRAY_SIZE(CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME) |
---|
2640 | |
---|
2641 | #endif /* CONFIGURE_POSIX_HAS_OWN_INIT_TASK_TABLE */ |
---|
2642 | |
---|
2643 | #else /* CONFIGURE_POSIX_INIT_THREAD_TABLE */ |
---|
2644 | |
---|
2645 | #define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME NULL |
---|
2646 | #define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE 0 |
---|
2647 | |
---|
2648 | #endif |
---|
2649 | |
---|
2650 | #else |
---|
2651 | |
---|
2652 | /** |
---|
2653 | * This configuration parameter specifies the maximum number of |
---|
2654 | * POSIX API threads. |
---|
2655 | */ |
---|
2656 | #define CONFIGURE_MAXIMUM_POSIX_THREADS 0 |
---|
2657 | |
---|
2658 | #endif /* RTEMS_POSIX_API */ |
---|
2659 | |
---|
2660 | /** |
---|
2661 | * This configuration parameter specifies the stack size of the |
---|
2662 | * POSIX API Initialization thread (if used). |
---|
2663 | */ |
---|
2664 | #ifndef CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE |
---|
2665 | #define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE 0 |
---|
2666 | #endif |
---|
2667 | /**@}*/ /* end of POSIX API Configuration */ |
---|
2668 | |
---|
2669 | /** |
---|
2670 | * @defgroup ConfigurationGNAT GNAT/RTEMS Configuration |
---|
2671 | * |
---|
2672 | * @addtogroup Configuration |
---|
2673 | * |
---|
2674 | * This modules includes configuration parameters for applications which |
---|
2675 | * use GNAT/RTEMS. GNAT implements each Ada task as a POSIX thread. |
---|
2676 | */ |
---|
2677 | /**@{*/ |
---|
2678 | #ifdef CONFIGURE_GNAT_RTEMS |
---|
2679 | |
---|
2680 | /** |
---|
2681 | * The GNAT run-time needs something less than (10) POSIX mutexes. |
---|
2682 | * We may be able to get by with less but why bother. |
---|
2683 | */ |
---|
2684 | #define _CONFIGURE_GNAT_MUTEXES 10 |
---|
2685 | |
---|
2686 | /** |
---|
2687 | * This is the maximum number of Ada tasks which can be concurrently |
---|
2688 | * in existence. Twenty (20) are required to run all tests in the |
---|
2689 | * ACATS (formerly ACVC). |
---|
2690 | */ |
---|
2691 | #ifndef CONFIGURE_MAXIMUM_ADA_TASKS |
---|
2692 | #define CONFIGURE_MAXIMUM_ADA_TASKS 20 |
---|
2693 | #endif |
---|
2694 | |
---|
2695 | /** |
---|
2696 | * This is the number of non-Ada tasks which invoked Ada code. |
---|
2697 | */ |
---|
2698 | #ifndef CONFIGURE_MAXIMUM_FAKE_ADA_TASKS |
---|
2699 | #define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0 |
---|
2700 | #endif |
---|
2701 | |
---|
2702 | #else |
---|
2703 | /** This defines he number of POSIX mutexes GNAT needs. */ |
---|
2704 | #define _CONFIGURE_GNAT_MUTEXES 0 |
---|
2705 | /** This defines he number of Ada tasks needed by the application. */ |
---|
2706 | #define CONFIGURE_MAXIMUM_ADA_TASKS 0 |
---|
2707 | /** |
---|
2708 | * This defines he number of non-Ada tasks/threads that will invoke |
---|
2709 | * Ada subprograms or functions. |
---|
2710 | */ |
---|
2711 | #define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0 |
---|
2712 | #endif |
---|
2713 | /**@}*/ /* end of GNAT Configuration */ |
---|
2714 | |
---|
2715 | /** |
---|
2716 | * @defgroup ConfigurationGo GCC Go Configuration |
---|
2717 | * |
---|
2718 | * @addtogroup Configuration |
---|
2719 | * |
---|
2720 | * This modules includes configuration parameters for applications which |
---|
2721 | * use GCC Go. |
---|
2722 | */ |
---|
2723 | /**@{*/ |
---|
2724 | #ifdef CONFIGURE_ENABLE_GO |
---|
2725 | |
---|
2726 | #ifndef CONFIGURE_MAXIMUM_POSIX_THREADS |
---|
2727 | #define CONFIGURE_MAXIMUM_POSIX_THREADS 1 |
---|
2728 | #endif |
---|
2729 | #ifndef CONFIGURE_MAXIMUM_POSIX_MUTEXES |
---|
2730 | #define CONFIGURE_MAXIMUM_POSIX_MUTEXES 1 |
---|
2731 | #endif |
---|
2732 | #ifndef CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES |
---|
2733 | #define CONFIGURE_MAXIMUM_CONDITION_VARIABLES 1 |
---|
2734 | #endif |
---|
2735 | |
---|
2736 | #define _CONFIGURE_GO_INIT_MUTEXES 77 |
---|
2737 | #define _CONFIGURE_GO_INIT_CONDITION_VARIABLES 4 |
---|
2738 | |
---|
2739 | #ifndef CONFIGURE_MAXIMUM_GOROUTINES |
---|
2740 | #define CONFIGURE_MAXIMUM_GOROUTINES 400 |
---|
2741 | #endif |
---|
2742 | |
---|
2743 | #ifndef CONFIGURE_MAXIMUM_GO_CHANNELS |
---|
2744 | #define CONFIGURE_MAXIMUM_GO_CHANNELS 500 |
---|
2745 | #endif |
---|
2746 | |
---|
2747 | #else |
---|
2748 | /* |
---|
2749 | * This specifies the number of mutexes required by the Go run-time |
---|
2750 | * for its own use. |
---|
2751 | */ |
---|
2752 | #define _CONFIGURE_GO_INIT_MUTEXES 0 |
---|
2753 | |
---|
2754 | /* |
---|
2755 | * This specifies the number of condition variables required by the Go |
---|
2756 | * run-time for its own use. |
---|
2757 | */ |
---|
2758 | #define _CONFIGURE_GO_INIT_CONDITION_VARIABLES 0 |
---|
2759 | |
---|
2760 | /** This specifies the maximum number of Go co-routines. */ |
---|
2761 | #define CONFIGURE_MAXIMUM_GOROUTINES 0 |
---|
2762 | |
---|
2763 | /** This specifies the maximum number of Go channels required. */ |
---|
2764 | #define CONFIGURE_MAXIMUM_GO_CHANNELS 0 |
---|
2765 | #endif |
---|
2766 | /**@}*/ /* end of Go Configuration */ |
---|
2767 | |
---|
2768 | /** |
---|
2769 | * This is so we can account for tasks with stacks greater than minimum |
---|
2770 | * size. This is in bytes. |
---|
2771 | */ |
---|
2772 | #ifndef CONFIGURE_EXTRA_TASK_STACKS |
---|
2773 | #define CONFIGURE_EXTRA_TASK_STACKS 0 |
---|
2774 | #endif |
---|
2775 | |
---|
2776 | /** |
---|
2777 | * This macro provides a summation of the various POSIX thread requirements. |
---|
2778 | */ |
---|
2779 | #define _CONFIGURE_POSIX_THREADS \ |
---|
2780 | (CONFIGURE_MAXIMUM_POSIX_THREADS + \ |
---|
2781 | CONFIGURE_MAXIMUM_ADA_TASKS + \ |
---|
2782 | CONFIGURE_MAXIMUM_GOROUTINES) |
---|
2783 | |
---|
2784 | #ifdef RTEMS_POSIX_API |
---|
2785 | /** |
---|
2786 | * This macro provides summation of the POSIX Mutexes. |
---|
2787 | */ |
---|
2788 | #define _CONFIGURE_POSIX_MUTEXES \ |
---|
2789 | (CONFIGURE_MAXIMUM_POSIX_MUTEXES + \ |
---|
2790 | _CONFIGURE_LIBBLOCK_POSIX_MUTEXES + \ |
---|
2791 | _CONFIGURE_GNAT_MUTEXES + \ |
---|
2792 | CONFIGURE_MAXIMUM_ADA_TASKS + \ |
---|
2793 | CONFIGURE_MAXIMUM_FAKE_ADA_TASKS + \ |
---|
2794 | _CONFIGURE_GO_INIT_MUTEXES + \ |
---|
2795 | CONFIGURE_MAXIMUM_GO_CHANNELS) |
---|
2796 | |
---|
2797 | /* |
---|
2798 | * This macro provides summation of the POSIX Condition Variables. |
---|
2799 | */ |
---|
2800 | #define _CONFIGURE_POSIX_CONDITION_VARIABLES \ |
---|
2801 | (CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES + \ |
---|
2802 | _CONFIGURE_LIBBLOCK_POSIX_CONDITION_VARIABLES + \ |
---|
2803 | CONFIGURE_MAXIMUM_ADA_TASKS + \ |
---|
2804 | CONFIGURE_MAXIMUM_FAKE_ADA_TASKS + \ |
---|
2805 | _CONFIGURE_GO_INIT_CONDITION_VARIABLES + \ |
---|
2806 | CONFIGURE_MAXIMUM_GO_CHANNELS) |
---|
2807 | |
---|
2808 | /* |
---|
2809 | * This macro is calculated to specify the memory required for |
---|
2810 | * the POSIX API in its entirety. |
---|
2811 | */ |
---|
2812 | #define _CONFIGURE_MEMORY_FOR_POSIX \ |
---|
2813 | (_CONFIGURE_MEMORY_FOR_POSIX_MUTEXES(_CONFIGURE_POSIX_MUTEXES) + \ |
---|
2814 | _CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES( \ |
---|
2815 | _CONFIGURE_POSIX_CONDITION_VARIABLES) + \ |
---|
2816 | _CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS( \ |
---|
2817 | CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS) + \ |
---|
2818 | _CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES( \ |
---|
2819 | CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES) + \ |
---|
2820 | _CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES( \ |
---|
2821 | CONFIGURE_MAXIMUM_POSIX_SEMAPHORES) + \ |
---|
2822 | _CONFIGURE_MEMORY_FOR_POSIX_BARRIERS(CONFIGURE_MAXIMUM_POSIX_BARRIERS) + \ |
---|
2823 | _CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS( \ |
---|
2824 | CONFIGURE_MAXIMUM_POSIX_RWLOCKS) + \ |
---|
2825 | _CONFIGURE_MEMORY_FOR_POSIX_SHMS( \ |
---|
2826 | CONFIGURE_MAXIMUM_POSIX_SHMS) + \ |
---|
2827 | _CONFIGURE_MEMORY_FOR_POSIX_TIMERS(CONFIGURE_MAXIMUM_POSIX_TIMERS)) |
---|
2828 | #else |
---|
2829 | /* |
---|
2830 | * This macro is calculated to specify the memory required for |
---|
2831 | * the POSIX API in its entirety. |
---|
2832 | */ |
---|
2833 | #define _CONFIGURE_MEMORY_FOR_POSIX 0 |
---|
2834 | #endif |
---|
2835 | |
---|
2836 | /* |
---|
2837 | * We must be able to split the free block used for the second last allocation |
---|
2838 | * into two parts so that we have a free block for the last allocation. See |
---|
2839 | * _Heap_Block_split(). |
---|
2840 | */ |
---|
2841 | #define _CONFIGURE_HEAP_HANDLER_OVERHEAD \ |
---|
2842 | _Configure_Align_up( HEAP_BLOCK_HEADER_SIZE, CPU_HEAP_ALIGNMENT ) |
---|
2843 | |
---|
2844 | /* |
---|
2845 | * Calculate the RAM size based on the maximum number of objects configured. |
---|
2846 | */ |
---|
2847 | #ifndef CONFIGURE_EXECUTIVE_RAM_SIZE |
---|
2848 | |
---|
2849 | /* |
---|
2850 | * Account for allocating the following per object |
---|
2851 | * + array of object control structures |
---|
2852 | * + local pointer table -- pointer per object plus a zero'th |
---|
2853 | * entry in the local pointer table. |
---|
2854 | */ |
---|
2855 | #define _CONFIGURE_MEMORY_FOR_TASKS(_tasks, _number_FP_tasks) \ |
---|
2856 | ( \ |
---|
2857 | _Configure_Object_RAM(_tasks, sizeof(Configuration_Thread_control)) \ |
---|
2858 | + _Configure_From_workspace(_Configure_Max_Objects(_tasks) \ |
---|
2859 | * THREAD_QUEUE_HEADS_SIZE(CONFIGURE_SCHEDULER_COUNT)) \ |
---|
2860 | + _Configure_Max_Objects(_number_FP_tasks) \ |
---|
2861 | * _Configure_From_workspace(CONTEXT_FP_SIZE) \ |
---|
2862 | ) |
---|
2863 | |
---|
2864 | /* |
---|
2865 | * This defines the amount of memory configured for the multiprocessing |
---|
2866 | * support required by this application. |
---|
2867 | */ |
---|
2868 | #ifdef CONFIGURE_MP_APPLICATION |
---|
2869 | #define _CONFIGURE_MEMORY_FOR_MP \ |
---|
2870 | (_CONFIGURE_MEMORY_FOR_PROXIES(CONFIGURE_MP_MAXIMUM_PROXIES) + \ |
---|
2871 | _CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS(CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS)) |
---|
2872 | #else |
---|
2873 | #define _CONFIGURE_MEMORY_FOR_MP 0 |
---|
2874 | #endif |
---|
2875 | |
---|
2876 | /** |
---|
2877 | * The following macro is used to calculate the memory allocated by RTEMS |
---|
2878 | * for the message buffers associated with a particular message queue. |
---|
2879 | * There is a fixed amount of overhead per message. |
---|
2880 | */ |
---|
2881 | #define CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(_messages, _size) \ |
---|
2882 | _Configure_From_workspace( \ |
---|
2883 | (_messages) * (_Configure_Align_up(_size, sizeof(uintptr_t)) \ |
---|
2884 | + sizeof(CORE_message_queue_Buffer_control))) |
---|
2885 | |
---|
2886 | /* |
---|
2887 | * This macro is set to the amount of memory required for pending message |
---|
2888 | * buffers in bytes. It should be constructed by adding together a |
---|
2889 | * set of values determined by CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE. |
---|
2890 | */ |
---|
2891 | #ifndef CONFIGURE_MESSAGE_BUFFER_MEMORY |
---|
2892 | #define CONFIGURE_MESSAGE_BUFFER_MEMORY 0 |
---|
2893 | #endif |
---|
2894 | |
---|
2895 | /** |
---|
2896 | * This macro is available just in case the confdefs.h file underallocates |
---|
2897 | * memory for a particular application. This lets the user add some extra |
---|
2898 | * memory in case something broken and underestimates. |
---|
2899 | * |
---|
2900 | * It is also possible for cases where confdefs.h overallocates memory, |
---|
2901 | * you could substract memory from the allocated. The estimate is just |
---|
2902 | * that, an estimate, and assumes worst case alignment and padding on |
---|
2903 | * each allocated element. So in some cases it could be too conservative. |
---|
2904 | * |
---|
2905 | * NOTE: Historically this was used for message buffers. |
---|
2906 | */ |
---|
2907 | #ifndef CONFIGURE_MEMORY_OVERHEAD |
---|
2908 | #define CONFIGURE_MEMORY_OVERHEAD 0 |
---|
2909 | #endif |
---|
2910 | |
---|
2911 | /** |
---|
2912 | * RTEMS uses two instance of an internal mutex class. This accounts |
---|
2913 | * for these mutexes. |
---|
2914 | */ |
---|
2915 | #define _CONFIGURE_API_MUTEX_MEMORY \ |
---|
2916 | _Configure_Object_RAM(2, sizeof(API_Mutex_Control)) |
---|
2917 | |
---|
2918 | /** |
---|
2919 | * This calculates the amount of memory reserved for the IDLE tasks. |
---|
2920 | * In an SMP system, each CPU core has its own idle task. |
---|
2921 | */ |
---|
2922 | #define _CONFIGURE_IDLE_TASKS_COUNT CONFIGURE_MAXIMUM_PROCESSORS |
---|
2923 | |
---|
2924 | /** |
---|
2925 | * This defines the formula used to compute the amount of memory |
---|
2926 | * reserved for internal task control structures. |
---|
2927 | */ |
---|
2928 | #if CPU_IDLE_TASK_IS_FP == TRUE |
---|
2929 | #define _CONFIGURE_MEMORY_FOR_INTERNAL_TASKS \ |
---|
2930 | _CONFIGURE_MEMORY_FOR_TASKS( \ |
---|
2931 | _CONFIGURE_IDLE_TASKS_COUNT + _CONFIGURE_MPCI_RECEIVE_SERVER_COUNT, \ |
---|
2932 | _CONFIGURE_IDLE_TASKS_COUNT + _CONFIGURE_MPCI_RECEIVE_SERVER_COUNT \ |
---|
2933 | ) |
---|
2934 | #else |
---|
2935 | #define _CONFIGURE_MEMORY_FOR_INTERNAL_TASKS \ |
---|
2936 | _CONFIGURE_MEMORY_FOR_TASKS( \ |
---|
2937 | _CONFIGURE_IDLE_TASKS_COUNT + _CONFIGURE_MPCI_RECEIVE_SERVER_COUNT, \ |
---|
2938 | _CONFIGURE_MPCI_RECEIVE_SERVER_COUNT \ |
---|
2939 | ) |
---|
2940 | #endif |
---|
2941 | |
---|
2942 | /** |
---|
2943 | * This macro accounts for general RTEMS system overhead. |
---|
2944 | */ |
---|
2945 | #define _CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD \ |
---|
2946 | ( _CONFIGURE_MEMORY_FOR_INTERNAL_TASKS + \ |
---|
2947 | _CONFIGURE_INTERRUPT_STACK_MEMORY + \ |
---|
2948 | _CONFIGURE_API_MUTEX_MEMORY \ |
---|
2949 | ) |
---|
2950 | |
---|
2951 | /** |
---|
2952 | * This macro reserves the memory required by the statically configured |
---|
2953 | * user extensions. |
---|
2954 | */ |
---|
2955 | #define _CONFIGURE_MEMORY_FOR_STATIC_EXTENSIONS \ |
---|
2956 | (_CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS == 0 ? 0 : \ |
---|
2957 | _Configure_From_workspace( \ |
---|
2958 | _CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS \ |
---|
2959 | * sizeof(User_extensions_Switch_control) \ |
---|
2960 | )) |
---|
2961 | |
---|
2962 | /** |
---|
2963 | * This macro provides a summation of the memory required by the |
---|
2964 | * Classic API as configured. |
---|
2965 | */ |
---|
2966 | #define _CONFIGURE_MEMORY_FOR_CLASSIC \ |
---|
2967 | (_CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS + \ |
---|
2968 | _CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER ) + \ |
---|
2969 | _CONFIGURE_MEMORY_FOR_SEMAPHORES(_CONFIGURE_SEMAPHORES) + \ |
---|
2970 | _CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(CONFIGURE_MAXIMUM_MESSAGE_QUEUES) + \ |
---|
2971 | _CONFIGURE_MEMORY_FOR_PARTITIONS(CONFIGURE_MAXIMUM_PARTITIONS) + \ |
---|
2972 | _CONFIGURE_MEMORY_FOR_REGIONS( CONFIGURE_MAXIMUM_REGIONS ) + \ |
---|
2973 | _CONFIGURE_MEMORY_FOR_PORTS(CONFIGURE_MAXIMUM_PORTS) + \ |
---|
2974 | _CONFIGURE_MEMORY_FOR_PERIODS(CONFIGURE_MAXIMUM_PERIODS) + \ |
---|
2975 | _CONFIGURE_MEMORY_FOR_BARRIERS(_CONFIGURE_BARRIERS) + \ |
---|
2976 | _CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(CONFIGURE_MAXIMUM_USER_EXTENSIONS) \ |
---|
2977 | ) |
---|
2978 | |
---|
2979 | /* |
---|
2980 | * This macro provides a summation of the memory required by SMP as configured. |
---|
2981 | */ |
---|
2982 | #if defined(RTEMS_SMP) |
---|
2983 | #define _CONFIGURE_MEMORY_FOR_SMP \ |
---|
2984 | (CONFIGURE_MAXIMUM_PROCESSORS * \ |
---|
2985 | _Configure_From_workspace( CONFIGURE_INTERRUPT_STACK_SIZE ) \ |
---|
2986 | ) |
---|
2987 | #else |
---|
2988 | #define _CONFIGURE_MEMORY_FOR_SMP 0 |
---|
2989 | #endif |
---|
2990 | |
---|
2991 | /** |
---|
2992 | * This calculates the memory required for the executive workspace. |
---|
2993 | * |
---|
2994 | * This is an internal parameter. |
---|
2995 | */ |
---|
2996 | #define CONFIGURE_EXECUTIVE_RAM_SIZE \ |
---|
2997 | ( \ |
---|
2998 | _CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD + \ |
---|
2999 | _CONFIGURE_MEMORY_FOR_TASKS( \ |
---|
3000 | _CONFIGURE_TASKS, _CONFIGURE_TASKS) + \ |
---|
3001 | _CONFIGURE_MEMORY_FOR_TASKS( \ |
---|
3002 | _CONFIGURE_POSIX_THREADS, _CONFIGURE_POSIX_THREADS) + \ |
---|
3003 | _CONFIGURE_MEMORY_FOR_CLASSIC + \ |
---|
3004 | _CONFIGURE_MEMORY_FOR_POSIX_KEYS( \ |
---|
3005 | _CONFIGURE_POSIX_KEYS, \ |
---|
3006 | CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS ) + \ |
---|
3007 | _CONFIGURE_MEMORY_FOR_POSIX + \ |
---|
3008 | _CONFIGURE_MEMORY_FOR_STATIC_EXTENSIONS + \ |
---|
3009 | _CONFIGURE_MEMORY_FOR_MP + \ |
---|
3010 | _CONFIGURE_MEMORY_FOR_SMP + \ |
---|
3011 | CONFIGURE_MESSAGE_BUFFER_MEMORY + \ |
---|
3012 | (CONFIGURE_MEMORY_OVERHEAD * 1024) + \ |
---|
3013 | _CONFIGURE_HEAP_HANDLER_OVERHEAD \ |
---|
3014 | ) |
---|
3015 | |
---|
3016 | /* |
---|
3017 | * Now account for any extra memory that initialization tasks or threads |
---|
3018 | * may have requested. |
---|
3019 | */ |
---|
3020 | |
---|
3021 | /* |
---|
3022 | * This accounts for any extra memory required by the Classic API |
---|
3023 | * Initialization Task. |
---|
3024 | */ |
---|
3025 | #if (CONFIGURE_INIT_TASK_STACK_SIZE > CONFIGURE_MINIMUM_TASK_STACK_SIZE) |
---|
3026 | #define _CONFIGURE_INITIALIZATION_THREADS_STACKS_CLASSIC_PART \ |
---|
3027 | (CONFIGURE_INIT_TASK_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE) |
---|
3028 | #else |
---|
3029 | #define _CONFIGURE_INITIALIZATION_THREADS_STACKS_CLASSIC_PART 0 |
---|
3030 | #endif |
---|
3031 | |
---|
3032 | /* |
---|
3033 | * This accounts for any extra memory required by the POSIX API |
---|
3034 | * Initialization Thread. |
---|
3035 | */ |
---|
3036 | #if defined(RTEMS_POSIX_API) && \ |
---|
3037 | (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE > \ |
---|
3038 | CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE) |
---|
3039 | #define _CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART \ |
---|
3040 | (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE - \ |
---|
3041 | CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE) |
---|
3042 | #else |
---|
3043 | #define _CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART 0 |
---|
3044 | #endif |
---|
3045 | |
---|
3046 | /* |
---|
3047 | * This macro provides a summation of the various initialization task |
---|
3048 | * and thread stack requirements. |
---|
3049 | */ |
---|
3050 | #define _CONFIGURE_INITIALIZATION_THREADS_EXTRA_STACKS \ |
---|
3051 | (_CONFIGURE_INITIALIZATION_THREADS_STACKS_CLASSIC_PART + \ |
---|
3052 | _CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART) |
---|
3053 | |
---|
3054 | /* |
---|
3055 | * This macro is calculated to specify the memory required for |
---|
3056 | * the Idle tasks(s) stack. |
---|
3057 | */ |
---|
3058 | #define _CONFIGURE_IDLE_TASKS_STACK \ |
---|
3059 | (_CONFIGURE_IDLE_TASKS_COUNT * \ |
---|
3060 | _Configure_From_stackspace( CONFIGURE_IDLE_TASK_STACK_SIZE ) ) |
---|
3061 | |
---|
3062 | /* |
---|
3063 | * This macro is calculated to specify the stack memory required for the MPCI |
---|
3064 | * task. |
---|
3065 | */ |
---|
3066 | #define _CONFIGURE_MPCI_RECEIVE_SERVER_STACK \ |
---|
3067 | (_CONFIGURE_MPCI_RECEIVE_SERVER_COUNT * \ |
---|
3068 | _Configure_From_stackspace(CONFIGURE_MINIMUM_TASK_STACK_SIZE)) |
---|
3069 | |
---|
3070 | /* |
---|
3071 | * This macro is calculated to specify the memory required for |
---|
3072 | * the stacks of all tasks. |
---|
3073 | */ |
---|
3074 | #define _CONFIGURE_TASKS_STACK \ |
---|
3075 | (_Configure_Max_Objects( _CONFIGURE_TASKS ) * \ |
---|
3076 | _Configure_From_stackspace( CONFIGURE_MINIMUM_TASK_STACK_SIZE ) ) |
---|
3077 | |
---|
3078 | /* |
---|
3079 | * This macro is calculated to specify the memory required for |
---|
3080 | * the stacks of all POSIX threads. |
---|
3081 | */ |
---|
3082 | #define _CONFIGURE_POSIX_THREADS_STACK \ |
---|
3083 | (_Configure_Max_Objects( CONFIGURE_MAXIMUM_POSIX_THREADS ) * \ |
---|
3084 | _Configure_From_stackspace( CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE ) ) |
---|
3085 | |
---|
3086 | /* |
---|
3087 | * This macro is calculated to specify the memory required for |
---|
3088 | * the stacks of all Ada tasks. |
---|
3089 | */ |
---|
3090 | #define _CONFIGURE_ADA_TASKS_STACK \ |
---|
3091 | (_Configure_Max_Objects( CONFIGURE_MAXIMUM_ADA_TASKS ) * \ |
---|
3092 | _Configure_From_stackspace( CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE ) ) |
---|
3093 | |
---|
3094 | /* |
---|
3095 | * This macro is calculated to specify the memory required for |
---|
3096 | * the stacks of all Go routines. |
---|
3097 | */ |
---|
3098 | #define _CONFIGURE_GOROUTINES_STACK \ |
---|
3099 | (_Configure_Max_Objects( CONFIGURE_MAXIMUM_GOROUTINES ) * \ |
---|
3100 | _Configure_From_stackspace( CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE ) ) |
---|
3101 | |
---|
3102 | #else /* CONFIGURE_EXECUTIVE_RAM_SIZE */ |
---|
3103 | |
---|
3104 | #define _CONFIGURE_IDLE_TASKS_STACK 0 |
---|
3105 | #define _CONFIGURE_MPCI_RECEIVE_SERVER_STACK 0 |
---|
3106 | #define _CONFIGURE_INITIALIZATION_THREADS_EXTRA_STACKS 0 |
---|
3107 | #define _CONFIGURE_TASKS_STACK 0 |
---|
3108 | #define _CONFIGURE_POSIX_THREADS_STACK 0 |
---|
3109 | #define _CONFIGURE_GOROUTINES_STACK 0 |
---|
3110 | #define _CONFIGURE_ADA_TASKS_STACK 0 |
---|
3111 | |
---|
3112 | #if CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK != 0 |
---|
3113 | #error "CONFIGURE_EXECUTIVE_RAM_SIZE defined with request for CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK" |
---|
3114 | #endif |
---|
3115 | |
---|
3116 | #if CONFIGURE_EXTRA_TASK_STACKS != 0 |
---|
3117 | #error "CONFIGURE_EXECUTIVE_RAM_SIZE defined with request for CONFIGURE_EXTRA_TASK_STACKS" |
---|
3118 | #endif |
---|
3119 | |
---|
3120 | #endif /* CONFIGURE_EXECUTIVE_RAM_SIZE */ |
---|
3121 | |
---|
3122 | /* |
---|
3123 | * This macro is calculated to specify the memory required for |
---|
3124 | * all tasks and threads of all varieties. |
---|
3125 | */ |
---|
3126 | #define _CONFIGURE_STACK_SPACE_SIZE \ |
---|
3127 | ( \ |
---|
3128 | _CONFIGURE_IDLE_TASKS_STACK + \ |
---|
3129 | _CONFIGURE_MPCI_RECEIVE_SERVER_STACK + \ |
---|
3130 | _CONFIGURE_INITIALIZATION_THREADS_EXTRA_STACKS + \ |
---|
3131 | _CONFIGURE_TASKS_STACK + \ |
---|
3132 | _CONFIGURE_POSIX_THREADS_STACK + \ |
---|
3133 | _CONFIGURE_GOROUTINES_STACK + \ |
---|
3134 | _CONFIGURE_ADA_TASKS_STACK + \ |
---|
3135 | CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK + \ |
---|
3136 | _CONFIGURE_LIBBLOCK_TASK_EXTRA_STACKS + \ |
---|
3137 | CONFIGURE_EXTRA_TASK_STACKS + \ |
---|
3138 | _CONFIGURE_HEAP_HANDLER_OVERHEAD \ |
---|
3139 | ) |
---|
3140 | |
---|
3141 | #ifndef CONFIGURE_MAXIMUM_THREAD_NAME_SIZE |
---|
3142 | #define CONFIGURE_MAXIMUM_THREAD_NAME_SIZE 16 |
---|
3143 | #endif |
---|
3144 | |
---|
3145 | #ifdef CONFIGURE_INIT |
---|
3146 | typedef union { |
---|
3147 | Scheduler_Node Base; |
---|
3148 | #ifdef CONFIGURE_SCHEDULER_CBS |
---|
3149 | Scheduler_CBS_Node CBS; |
---|
3150 | #endif |
---|
3151 | #ifdef CONFIGURE_SCHEDULER_EDF |
---|
3152 | Scheduler_EDF_Node EDF; |
---|
3153 | #endif |
---|
3154 | #ifdef CONFIGURE_SCHEDULER_PRIORITY |
---|
3155 | Scheduler_priority_Node Priority; |
---|
3156 | #endif |
---|
3157 | #ifdef CONFIGURE_SCHEDULER_SIMPLE_SMP |
---|
3158 | Scheduler_SMP_Node Simple_SMP; |
---|
3159 | #endif |
---|
3160 | #ifdef CONFIGURE_SCHEDULER_PRIORITY_SMP |
---|
3161 | Scheduler_priority_SMP_Node Priority_SMP; |
---|
3162 | #endif |
---|
3163 | #ifdef CONFIGURE_SCHEDULER_PRIORITY_AFFINITY_SMP |
---|
3164 | Scheduler_priority_affinity_SMP_Node Priority_affinity_SMP; |
---|
3165 | #endif |
---|
3166 | #ifdef CONFIGURE_SCHEDULER_STRONG_APA |
---|
3167 | Scheduler_strong_APA_Node Strong_APA; |
---|
3168 | #endif |
---|
3169 | #ifdef CONFIGURE_SCHEDULER_USER_PER_THREAD |
---|
3170 | CONFIGURE_SCHEDULER_USER_PER_THREAD User; |
---|
3171 | #endif |
---|
3172 | } Configuration_Scheduler_node; |
---|
3173 | |
---|
3174 | #ifdef RTEMS_SMP |
---|
3175 | const size_t _Scheduler_Node_size = sizeof( Configuration_Scheduler_node ); |
---|
3176 | #endif |
---|
3177 | |
---|
3178 | const size_t _Thread_Maximum_name_size = CONFIGURE_MAXIMUM_THREAD_NAME_SIZE; |
---|
3179 | |
---|
3180 | typedef struct { |
---|
3181 | Thread_Control Control; |
---|
3182 | #if CONFIGURE_MAXIMUM_USER_EXTENSIONS > 0 |
---|
3183 | void *extensions[ CONFIGURE_MAXIMUM_USER_EXTENSIONS + 1 ]; |
---|
3184 | #endif |
---|
3185 | Configuration_Scheduler_node Scheduler_nodes[ CONFIGURE_SCHEDULER_COUNT ]; |
---|
3186 | RTEMS_API_Control API_RTEMS; |
---|
3187 | #ifdef RTEMS_POSIX_API |
---|
3188 | POSIX_API_Control API_POSIX; |
---|
3189 | #endif |
---|
3190 | #if CONFIGURE_MAXIMUM_THREAD_NAME_SIZE > 1 |
---|
3191 | char name[ CONFIGURE_MAXIMUM_THREAD_NAME_SIZE ]; |
---|
3192 | #endif |
---|
3193 | #if !defined(RTEMS_SCHEDSIM) \ |
---|
3194 | && defined(RTEMS_NEWLIB) \ |
---|
3195 | && !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY) |
---|
3196 | struct _reent Newlib; |
---|
3197 | #else |
---|
3198 | struct { /* Empty */ } Newlib; |
---|
3199 | #endif |
---|
3200 | } Configuration_Thread_control; |
---|
3201 | |
---|
3202 | const size_t _Thread_Control_size = sizeof( Configuration_Thread_control ); |
---|
3203 | |
---|
3204 | const Thread_Control_add_on _Thread_Control_add_ons[] = { |
---|
3205 | { |
---|
3206 | offsetof( Configuration_Thread_control, Control.Scheduler.nodes ), |
---|
3207 | offsetof( Configuration_Thread_control, Scheduler_nodes ) |
---|
3208 | }, { |
---|
3209 | offsetof( |
---|
3210 | Configuration_Thread_control, |
---|
3211 | Control.API_Extensions[ THREAD_API_RTEMS ] |
---|
3212 | ), |
---|
3213 | offsetof( Configuration_Thread_control, API_RTEMS ) |
---|
3214 | }, { |
---|
3215 | offsetof( |
---|
3216 | Configuration_Thread_control, |
---|
3217 | Control.libc_reent |
---|
3218 | ), |
---|
3219 | offsetof( Configuration_Thread_control, Newlib ) |
---|
3220 | } |
---|
3221 | #if CONFIGURE_MAXIMUM_THREAD_NAME_SIZE > 1 |
---|
3222 | , { |
---|
3223 | offsetof( |
---|
3224 | Configuration_Thread_control, |
---|
3225 | Control.Join_queue.Queue.name |
---|
3226 | ), |
---|
3227 | offsetof( Configuration_Thread_control, name ) |
---|
3228 | } |
---|
3229 | #endif |
---|
3230 | #ifdef RTEMS_POSIX_API |
---|
3231 | , { |
---|
3232 | offsetof( |
---|
3233 | Configuration_Thread_control, |
---|
3234 | Control.API_Extensions[ THREAD_API_POSIX ] |
---|
3235 | ), |
---|
3236 | offsetof( Configuration_Thread_control, API_POSIX ) |
---|
3237 | } |
---|
3238 | #endif |
---|
3239 | }; |
---|
3240 | |
---|
3241 | const size_t _Thread_Control_add_on_count = |
---|
3242 | RTEMS_ARRAY_SIZE( _Thread_Control_add_ons ); |
---|
3243 | |
---|
3244 | /** |
---|
3245 | * This is the Classic API Configuration Table. |
---|
3246 | */ |
---|
3247 | rtems_api_configuration_table Configuration_RTEMS_API = { |
---|
3248 | _CONFIGURE_TASKS, |
---|
3249 | CONFIGURE_MAXIMUM_TIMERS + _CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER, |
---|
3250 | _CONFIGURE_SEMAPHORES, |
---|
3251 | CONFIGURE_MAXIMUM_MESSAGE_QUEUES, |
---|
3252 | CONFIGURE_MAXIMUM_PARTITIONS, |
---|
3253 | CONFIGURE_MAXIMUM_REGIONS, |
---|
3254 | CONFIGURE_MAXIMUM_PORTS, |
---|
3255 | CONFIGURE_MAXIMUM_PERIODS, |
---|
3256 | _CONFIGURE_BARRIERS, |
---|
3257 | CONFIGURE_INIT_TASK_TABLE_SIZE, |
---|
3258 | CONFIGURE_INIT_TASK_TABLE |
---|
3259 | }; |
---|
3260 | |
---|
3261 | #ifdef RTEMS_POSIX_API |
---|
3262 | /** |
---|
3263 | * This is the POSIX API Configuration Table. |
---|
3264 | */ |
---|
3265 | posix_api_configuration_table Configuration_POSIX_API = { |
---|
3266 | _CONFIGURE_POSIX_THREADS, |
---|
3267 | _CONFIGURE_POSIX_MUTEXES, |
---|
3268 | _CONFIGURE_POSIX_CONDITION_VARIABLES, |
---|
3269 | CONFIGURE_MAXIMUM_POSIX_TIMERS, |
---|
3270 | CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS, |
---|
3271 | CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES, |
---|
3272 | CONFIGURE_MAXIMUM_POSIX_SEMAPHORES, |
---|
3273 | CONFIGURE_MAXIMUM_POSIX_BARRIERS, |
---|
3274 | CONFIGURE_MAXIMUM_POSIX_RWLOCKS, |
---|
3275 | CONFIGURE_MAXIMUM_POSIX_SHMS, |
---|
3276 | CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE, |
---|
3277 | CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME |
---|
3278 | }; |
---|
3279 | #endif |
---|
3280 | |
---|
3281 | /** |
---|
3282 | * This variable specifies the minimum stack size for tasks in an RTEMS |
---|
3283 | * application. |
---|
3284 | * |
---|
3285 | * NOTE: This is left as a simple uint32_t so it can be externed as |
---|
3286 | * needed without requring being high enough logical to |
---|
3287 | * include the full configuration table. |
---|
3288 | */ |
---|
3289 | uint32_t rtems_minimum_stack_size = |
---|
3290 | CONFIGURE_MINIMUM_TASK_STACK_SIZE; |
---|
3291 | |
---|
3292 | /** |
---|
3293 | * This is the primary Configuration Table for this application. |
---|
3294 | */ |
---|
3295 | const rtems_configuration_table Configuration = { |
---|
3296 | CONFIGURE_EXECUTIVE_RAM_SIZE, /* required RTEMS workspace */ |
---|
3297 | _CONFIGURE_STACK_SPACE_SIZE, /* required stack space */ |
---|
3298 | CONFIGURE_MAXIMUM_USER_EXTENSIONS, /* maximum dynamic extensions */ |
---|
3299 | _CONFIGURE_POSIX_KEYS, /* POSIX keys are always */ |
---|
3300 | CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS, /* enabled */ |
---|
3301 | CONFIGURE_MICROSECONDS_PER_TICK, /* microseconds per clock tick */ |
---|
3302 | 1000 * CONFIGURE_MICROSECONDS_PER_TICK, /* nanoseconds per clock tick */ |
---|
3303 | CONFIGURE_TICKS_PER_TIMESLICE, /* ticks per timeslice quantum */ |
---|
3304 | CONFIGURE_IDLE_TASK_BODY, /* user's IDLE task */ |
---|
3305 | CONFIGURE_IDLE_TASK_STACK_SIZE, /* IDLE task stack size */ |
---|
3306 | CONFIGURE_INTERRUPT_STACK_SIZE, /* interrupt stack size */ |
---|
3307 | CONFIGURE_TASK_STACK_ALLOCATOR_INIT, /* stack allocator init */ |
---|
3308 | CONFIGURE_TASK_STACK_ALLOCATOR, /* stack allocator */ |
---|
3309 | CONFIGURE_TASK_STACK_DEALLOCATOR, /* stack deallocator */ |
---|
3310 | CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY, /* true to clear memory */ |
---|
3311 | #ifdef CONFIGURE_UNIFIED_WORK_AREAS /* true for unified work areas */ |
---|
3312 | true, |
---|
3313 | #else |
---|
3314 | false, |
---|
3315 | #endif |
---|
3316 | #ifdef CONFIGURE_TASK_STACK_ALLOCATOR_AVOIDS_WORK_SPACE /* true to avoid |
---|
3317 | work space for thread stack |
---|
3318 | allocation */ |
---|
3319 | true, |
---|
3320 | #else |
---|
3321 | false, |
---|
3322 | #endif |
---|
3323 | #ifdef RTEMS_SMP |
---|
3324 | #ifdef _CONFIGURE_SMP_APPLICATION |
---|
3325 | true, |
---|
3326 | #else |
---|
3327 | false, |
---|
3328 | #endif |
---|
3329 | #endif |
---|
3330 | _CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS, /* number of static extensions */ |
---|
3331 | CONFIGURE_INITIAL_EXTENSION_TABLE, /* pointer to static extensions */ |
---|
3332 | #if defined(RTEMS_MULTIPROCESSING) |
---|
3333 | CONFIGURE_MULTIPROCESSING_TABLE, /* pointer to MP config table */ |
---|
3334 | #endif |
---|
3335 | #ifdef RTEMS_SMP |
---|
3336 | CONFIGURE_MAXIMUM_PROCESSORS, |
---|
3337 | #endif |
---|
3338 | }; |
---|
3339 | #endif |
---|
3340 | |
---|
3341 | #endif /* CONFIGURE_HAS_OWN_CONFIGURATION_TABLE */ |
---|
3342 | |
---|
3343 | #if defined(RTEMS_SMP) |
---|
3344 | /* |
---|
3345 | * Instantiate the Per CPU information based upon the user configuration. |
---|
3346 | */ |
---|
3347 | #if defined(CONFIGURE_INIT) |
---|
3348 | Per_CPU_Control_envelope _Per_CPU_Information[CONFIGURE_MAXIMUM_PROCESSORS]; |
---|
3349 | #endif |
---|
3350 | |
---|
3351 | #endif |
---|
3352 | |
---|
3353 | /* |
---|
3354 | * If the user has configured a set of Classic API Initialization Tasks, |
---|
3355 | * then we need to install the code that runs that loop. |
---|
3356 | */ |
---|
3357 | #ifdef CONFIGURE_INIT |
---|
3358 | #if defined(CONFIGURE_RTEMS_INIT_TASKS_TABLE) || \ |
---|
3359 | defined(CONFIGURE_HAS_OWN_INIT_TASK_TABLE) |
---|
3360 | RTEMS_SYSINIT_ITEM( |
---|
3361 | _RTEMS_tasks_Initialize_user_tasks_body, |
---|
3362 | RTEMS_SYSINIT_CLASSIC_USER_TASKS, |
---|
3363 | RTEMS_SYSINIT_ORDER_MIDDLE |
---|
3364 | ); |
---|
3365 | #endif |
---|
3366 | #endif |
---|
3367 | |
---|
3368 | /* |
---|
3369 | * If the user has configured a set of POSIX Initialization Threads, |
---|
3370 | * then we need to install the code that runs that loop. |
---|
3371 | */ |
---|
3372 | #ifdef RTEMS_POSIX_API |
---|
3373 | #ifdef CONFIGURE_INIT |
---|
3374 | #if defined(CONFIGURE_POSIX_INIT_THREAD_TABLE) || \ |
---|
3375 | defined(CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE) |
---|
3376 | RTEMS_SYSINIT_ITEM( |
---|
3377 | _POSIX_Threads_Initialize_user_threads_body, |
---|
3378 | RTEMS_SYSINIT_POSIX_USER_THREADS, |
---|
3379 | RTEMS_SYSINIT_ORDER_MIDDLE |
---|
3380 | ); |
---|
3381 | #endif |
---|
3382 | #endif |
---|
3383 | #endif |
---|
3384 | |
---|
3385 | /* |
---|
3386 | * Select PCI Configuration Library |
---|
3387 | */ |
---|
3388 | #ifdef RTEMS_PCI_CONFIG_LIB |
---|
3389 | #ifdef CONFIGURE_INIT |
---|
3390 | #define PCI_LIB_NONE 0 |
---|
3391 | #define PCI_LIB_AUTO 1 |
---|
3392 | #define PCI_LIB_STATIC 2 |
---|
3393 | #define PCI_LIB_READ 3 |
---|
3394 | #define PCI_LIB_PERIPHERAL 4 |
---|
3395 | #if CONFIGURE_PCI_LIB == PCI_LIB_AUTO |
---|
3396 | #define PCI_CFG_AUTO_LIB |
---|
3397 | #include <pci/cfg.h> |
---|
3398 | struct pci_bus pci_hb; |
---|
3399 | #define PCI_LIB_INIT pci_config_auto |
---|
3400 | #define PCI_LIB_CONFIG pci_config_auto_register |
---|
3401 | #elif CONFIGURE_PCI_LIB == PCI_LIB_STATIC |
---|
3402 | #define PCI_CFG_STATIC_LIB |
---|
3403 | #include <pci/cfg.h> |
---|
3404 | #define PCI_LIB_INIT pci_config_static |
---|
3405 | #define PCI_LIB_CONFIG NULL |
---|
3406 | /* Let user define PCI configuration (struct pci_bus pci_hb) */ |
---|
3407 | #elif CONFIGURE_PCI_LIB == PCI_LIB_READ |
---|
3408 | #define PCI_CFG_READ_LIB |
---|
3409 | #include <pci/cfg.h> |
---|
3410 | #define PCI_LIB_INIT pci_config_read |
---|
3411 | #define PCI_LIB_CONFIG NULL |
---|
3412 | struct pci_bus pci_hb; |
---|
3413 | #elif CONFIGURE_PCI_LIB == PCI_LIB_PERIPHERAL |
---|
3414 | #define PCI_LIB_INIT pci_config_peripheral |
---|
3415 | #define PCI_LIB_CONFIG NULL |
---|
3416 | /* Let user define PCI configuration (struct pci_bus pci_hb) */ |
---|
3417 | #elif CONFIGURE_PCI_LIB == PCI_LIB_NONE |
---|
3418 | #define PCI_LIB_INIT NULL |
---|
3419 | #define PCI_LIB_CONFIG NULL |
---|
3420 | /* No PCI Configuration at all, user can use/debug access routines */ |
---|
3421 | #else |
---|
3422 | #error NO PCI LIBRARY DEFINED |
---|
3423 | #endif |
---|
3424 | |
---|
3425 | const int pci_config_lib_type = CONFIGURE_PCI_LIB; |
---|
3426 | int (*pci_config_lib_init)(void) = PCI_LIB_INIT; |
---|
3427 | void (*pci_config_lib_register)(void *config) = PCI_LIB_CONFIG; |
---|
3428 | #endif |
---|
3429 | #endif |
---|
3430 | |
---|
3431 | #ifdef __cplusplus |
---|
3432 | } |
---|
3433 | #endif |
---|
3434 | |
---|
3435 | /****************************************************************** |
---|
3436 | ****************************************************************** |
---|
3437 | ****************************************************************** |
---|
3438 | * CONFIGURATION WARNINGS AND ERROR CHECKING * |
---|
3439 | ****************************************************************** |
---|
3440 | ****************************************************************** |
---|
3441 | ****************************************************************** |
---|
3442 | */ |
---|
3443 | |
---|
3444 | #if defined(CONFIGURE_CONFDEFS_DEBUG) && defined(CONFIGURE_INIT) |
---|
3445 | /** |
---|
3446 | * This is a debug mechanism, so if you need to, the executable will |
---|
3447 | * have a structure with various partial values. Add to this as you |
---|
3448 | * need to. Viewing this structure in gdb combined with dumping |
---|
3449 | * the Configuration structures generated should help a lot in tracing |
---|
3450 | * down errors and analyzing where over and under allocations are. |
---|
3451 | */ |
---|
3452 | typedef struct { |
---|
3453 | uint32_t SYSTEM_OVERHEAD; |
---|
3454 | uint32_t STATIC_EXTENSIONS; |
---|
3455 | uint32_t INITIALIZATION_THREADS_STACKS; |
---|
3456 | |
---|
3457 | uint32_t PER_INTEGER_TASK; |
---|
3458 | uint32_t FP_OVERHEAD; |
---|
3459 | uint32_t CLASSIC; |
---|
3460 | uint32_t POSIX; |
---|
3461 | |
---|
3462 | /* System overhead pieces */ |
---|
3463 | uint32_t INTERRUPT_STACK_MEMORY; |
---|
3464 | uint32_t MEMORY_FOR_IDLE_TASK; |
---|
3465 | |
---|
3466 | /* Classic API Pieces */ |
---|
3467 | uint32_t CLASSIC_TASKS; |
---|
3468 | uint32_t TIMERS; |
---|
3469 | uint32_t SEMAPHORES; |
---|
3470 | uint32_t MESSAGE_QUEUES; |
---|
3471 | uint32_t PARTITIONS; |
---|
3472 | uint32_t REGIONS; |
---|
3473 | uint32_t PORTS; |
---|
3474 | uint32_t PERIODS; |
---|
3475 | uint32_t BARRIERS; |
---|
3476 | uint32_t USER_EXTENSIONS; |
---|
3477 | |
---|
3478 | /* POSIX API managers that are always enabled */ |
---|
3479 | uint32_t POSIX_KEYS; |
---|
3480 | |
---|
3481 | #ifdef RTEMS_POSIX_API |
---|
3482 | /* POSIX API Pieces */ |
---|
3483 | uint32_t POSIX_MUTEXES; |
---|
3484 | uint32_t POSIX_CONDITION_VARIABLES; |
---|
3485 | uint32_t POSIX_TIMERS; |
---|
3486 | uint32_t POSIX_QUEUED_SIGNALS; |
---|
3487 | uint32_t POSIX_MESSAGE_QUEUES; |
---|
3488 | uint32_t POSIX_SEMAPHORES; |
---|
3489 | uint32_t POSIX_BARRIERS; |
---|
3490 | uint32_t POSIX_RWLOCKS; |
---|
3491 | uint32_t POSIX_SHMS; |
---|
3492 | #endif |
---|
3493 | |
---|
3494 | /* Stack space sizes */ |
---|
3495 | uint32_t IDLE_TASKS_STACK; |
---|
3496 | uint32_t INITIALIZATION_THREADS_EXTRA_STACKS; |
---|
3497 | uint32_t TASKS_STACK; |
---|
3498 | uint32_t POSIX_THREADS_STACK; |
---|
3499 | uint32_t GOROUTINES_STACK; |
---|
3500 | uint32_t ADA_TASKS_STACK; |
---|
3501 | uint32_t EXTRA_MPCI_RECEIVE_SERVER_STACK; |
---|
3502 | uint32_t EXTRA_TASK_STACKS; |
---|
3503 | } Configuration_Debug_t; |
---|
3504 | |
---|
3505 | Configuration_Debug_t Configuration_Memory_Debug = { |
---|
3506 | /* General Information */ |
---|
3507 | _CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD, |
---|
3508 | _CONFIGURE_MEMORY_FOR_STATIC_EXTENSIONS, |
---|
3509 | _CONFIGURE_INITIALIZATION_THREADS_EXTRA_STACKS, |
---|
3510 | _CONFIGURE_MEMORY_FOR_TASKS(1, 0), |
---|
3511 | _CONFIGURE_MEMORY_FOR_TASKS(0, 1), |
---|
3512 | _CONFIGURE_MEMORY_FOR_CLASSIC, |
---|
3513 | _CONFIGURE_MEMORY_FOR_POSIX, |
---|
3514 | |
---|
3515 | /* System overhead pieces */ |
---|
3516 | _CONFIGURE_INTERRUPT_STACK_MEMORY, |
---|
3517 | _CONFIGURE_MEMORY_FOR_INTERNAL_TASKS, |
---|
3518 | |
---|
3519 | /* Classic API Pieces */ |
---|
3520 | _CONFIGURE_MEMORY_FOR_TASKS(CONFIGURE_MAXIMUM_TASKS, 0), |
---|
3521 | _CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS), |
---|
3522 | _CONFIGURE_MEMORY_FOR_SEMAPHORES(_CONFIGURE_SEMAPHORES), |
---|
3523 | _CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(CONFIGURE_MAXIMUM_MESSAGE_QUEUES), |
---|
3524 | _CONFIGURE_MEMORY_FOR_PARTITIONS(CONFIGURE_MAXIMUM_PARTITIONS), |
---|
3525 | _CONFIGURE_MEMORY_FOR_REGIONS( CONFIGURE_MAXIMUM_REGIONS ), |
---|
3526 | _CONFIGURE_MEMORY_FOR_PORTS(CONFIGURE_MAXIMUM_PORTS), |
---|
3527 | _CONFIGURE_MEMORY_FOR_PERIODS(CONFIGURE_MAXIMUM_PERIODS), |
---|
3528 | _CONFIGURE_MEMORY_FOR_BARRIERS(_CONFIGURE_BARRIERS), |
---|
3529 | _CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(CONFIGURE_MAXIMUM_USER_EXTENSIONS), |
---|
3530 | _CONFIGURE_MEMORY_FOR_POSIX_KEYS( _CONFIGURE_POSIX_KEYS, \ |
---|
3531 | CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS ), |
---|
3532 | |
---|
3533 | #ifdef RTEMS_POSIX_API |
---|
3534 | /* POSIX API Pieces */ |
---|
3535 | _CONFIGURE_MEMORY_FOR_POSIX_MUTEXES( _CONFIGURE_POSIX_MUTEXES ), |
---|
3536 | _CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES( |
---|
3537 | _CONFIGURE_POSIX_CONDITION_VARIABLES ), |
---|
3538 | _CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS( |
---|
3539 | CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS ), |
---|
3540 | _CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES( |
---|
3541 | CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES ), |
---|
3542 | _CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES( CONFIGURE_MAXIMUM_POSIX_SEMAPHORES ), |
---|
3543 | _CONFIGURE_MEMORY_FOR_POSIX_BARRIERS( CONFIGURE_MAXIMUM_POSIX_BARRIERS ), |
---|
3544 | _CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS( CONFIGURE_MAXIMUM_POSIX_RWLOCKS ), |
---|
3545 | _CONFIGURE_MEMORY_FOR_POSIX_SHMS( CONFIGURE_MAXIMUM_POSIX_SHMS ), |
---|
3546 | _CONFIGURE_MEMORY_FOR_POSIX_TIMERS( CONFIGURE_MAXIMUM_POSIX_TIMERS ), |
---|
3547 | #endif |
---|
3548 | |
---|
3549 | /* Stack space sizes */ |
---|
3550 | _CONFIGURE_IDLE_TASKS_STACK, |
---|
3551 | _CONFIGURE_INITIALIZATION_THREADS_EXTRA_STACKS, |
---|
3552 | _CONFIGURE_TASKS_STACK, |
---|
3553 | _CONFIGURE_POSIX_THREADS_STACK, |
---|
3554 | _CONFIGURE_GOROUTINES_STACK, |
---|
3555 | _CONFIGURE_ADA_TASKS_STACK, |
---|
3556 | CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK, |
---|
3557 | CONFIGURE_EXTRA_TASK_STACKS |
---|
3558 | }; |
---|
3559 | #endif |
---|
3560 | |
---|
3561 | /* |
---|
3562 | * Make sure a task/thread of some sort is configured. |
---|
3563 | * |
---|
3564 | * When analyzing RTEMS to find the smallest possible of memory |
---|
3565 | * that must be allocated, you probably do want to configure 0 |
---|
3566 | * tasks/threads so there is a smaller set of calls to _Workspace_Allocate |
---|
3567 | * to analyze. |
---|
3568 | */ |
---|
3569 | #if !defined(CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION) |
---|
3570 | #if (CONFIGURE_MAXIMUM_TASKS == 0) && \ |
---|
3571 | (CONFIGURE_MAXIMUM_POSIX_THREADS == 0) && \ |
---|
3572 | (CONFIGURE_MAXIMUM_ADA_TASKS == 0) && \ |
---|
3573 | (CONFIGURE_MAXIMUM_GOROUTINES == 0) |
---|
3574 | #error "CONFIGURATION ERROR: No tasks or threads configured!!" |
---|
3575 | #endif |
---|
3576 | #endif |
---|
3577 | |
---|
3578 | #ifndef RTEMS_SCHEDSIM |
---|
3579 | /* |
---|
3580 | * Make sure at least one of the initialization task/thread |
---|
3581 | * tables was defined. |
---|
3582 | */ |
---|
3583 | #if !defined(CONFIGURE_RTEMS_INIT_TASKS_TABLE) && \ |
---|
3584 | !defined(CONFIGURE_POSIX_INIT_THREAD_TABLE) && \ |
---|
3585 | !defined(CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION) |
---|
3586 | #error "CONFIGURATION ERROR: No initialization tasks or threads configured!!" |
---|
3587 | #endif |
---|
3588 | #endif |
---|
3589 | |
---|
3590 | /* |
---|
3591 | * If the user is trying to configure a multiprocessing application and |
---|
3592 | * RTEMS was not configured and built multiprocessing, then error out. |
---|
3593 | */ |
---|
3594 | #if defined(CONFIGURE_MP_APPLICATION) && \ |
---|
3595 | !defined(RTEMS_MULTIPROCESSING) |
---|
3596 | #error "CONFIGURATION ERROR: RTEMS not configured for multiprocessing!!" |
---|
3597 | #endif |
---|
3598 | |
---|
3599 | /* |
---|
3600 | * If an attempt was made to configure POSIX objects and |
---|
3601 | * the POSIX API was not configured into RTEMS, error out. |
---|
3602 | * |
---|
3603 | * @note POSIX Keys are always available so the parameters |
---|
3604 | * CONFIGURE_MAXIMUM_POSIX_KEYS and |
---|
3605 | * CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS are not in this list. |
---|
3606 | */ |
---|
3607 | #if !defined(RTEMS_POSIX_API) |
---|
3608 | #if ((CONFIGURE_MAXIMUM_POSIX_THREADS != 0) || \ |
---|
3609 | (CONFIGURE_MAXIMUM_POSIX_MUTEXES != 0) || \ |
---|
3610 | (CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES != 0) || \ |
---|
3611 | (CONFIGURE_MAXIMUM_POSIX_TIMERS != 0) || \ |
---|
3612 | (CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS != 0) || \ |
---|
3613 | (CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES != 0) || \ |
---|
3614 | (CONFIGURE_MAXIMUM_POSIX_SEMAPHORES != 0) || \ |
---|
3615 | (CONFIGURE_MAXIMUM_POSIX_BARRIERS != 0) || \ |
---|
3616 | (CONFIGURE_MAXIMUM_POSIX_RWLOCKS != 0) || \ |
---|
3617 | (CONFIGURE_MAXIMUM_POSIX_SHMS != 0) || \ |
---|
3618 | defined(CONFIGURE_POSIX_INIT_THREAD_TABLE)) |
---|
3619 | #error "CONFIGURATION ERROR: POSIX API support not configured!!" |
---|
3620 | #endif |
---|
3621 | #endif |
---|
3622 | |
---|
3623 | #if !defined(RTEMS_SCHEDSIM) |
---|
3624 | #if !defined(CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE) |
---|
3625 | /* |
---|
3626 | * You must either explicity include or exclude the clock driver. |
---|
3627 | * It is such a common newbie error to leave it out. Maybe this |
---|
3628 | * will put an end to it. |
---|
3629 | * |
---|
3630 | * NOTE: If you are using the timer driver, it is considered |
---|
3631 | * mutually exclusive with the clock driver because the |
---|
3632 | * drivers are assumed to use the same "timer" hardware |
---|
3633 | * on many boards. |
---|
3634 | */ |
---|
3635 | #if !defined(CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER) && \ |
---|
3636 | !defined(CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER) && \ |
---|
3637 | !defined(CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER) |
---|
3638 | #error "CONFIGURATION ERROR: Do you want the clock driver or not?!?" |
---|
3639 | #endif |
---|
3640 | |
---|
3641 | /* |
---|
3642 | * Only one of the following three configuration parameters should be |
---|
3643 | * defined at a time. |
---|
3644 | */ |
---|
3645 | #if ((defined(CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER) + \ |
---|
3646 | defined(CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER) + \ |
---|
3647 | defined(CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER)) > 1) |
---|
3648 | #error "CONFIGURATION ERROR: More than one clock/timer driver configuration parameter specified?!?" |
---|
3649 | #endif |
---|
3650 | #endif /* !defined(CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE) */ |
---|
3651 | #endif /* !defined(RTEMS_SCHEDSIM) */ |
---|
3652 | |
---|
3653 | /* |
---|
3654 | * These names have been obsoleted so make the user application stop compiling |
---|
3655 | */ |
---|
3656 | #if defined(CONFIGURE_TEST_NEEDS_TIMER_DRIVER) || \ |
---|
3657 | defined(CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER) || \ |
---|
3658 | defined(CONFIGURE_TEST_NEEDS_CLOCK_DRIVER) || \ |
---|
3659 | defined(CONFIGURE_TEST_NEEDS_RTC_DRIVER) || \ |
---|
3660 | defined(CONFIGURE_TEST_NEEDS_STUB_DRIVER) |
---|
3661 | #error "CONFIGURATION ERROR: CONFIGURE_TEST_XXX constants are obsolete" |
---|
3662 | #endif |
---|
3663 | |
---|
3664 | /* |
---|
3665 | * Validate the configured maximum priority |
---|
3666 | */ |
---|
3667 | #if ((CONFIGURE_MAXIMUM_PRIORITY != 3) && \ |
---|
3668 | (CONFIGURE_MAXIMUM_PRIORITY != 7) && \ |
---|
3669 | (CONFIGURE_MAXIMUM_PRIORITY != 15) && \ |
---|
3670 | (CONFIGURE_MAXIMUM_PRIORITY != 31) && \ |
---|
3671 | (CONFIGURE_MAXIMUM_PRIORITY != 63) && \ |
---|
3672 | (CONFIGURE_MAXIMUM_PRIORITY != 127) && \ |
---|
3673 | (CONFIGURE_MAXIMUM_PRIORITY != 255)) |
---|
3674 | #error "Maximum priority is not 1 less than a power of 2 between 4 and 256" |
---|
3675 | #endif |
---|
3676 | |
---|
3677 | #if (CONFIGURE_MAXIMUM_PRIORITY > PRIORITY_DEFAULT_MAXIMUM) |
---|
3678 | #error "Maximum priority configured higher than supported by target." |
---|
3679 | #endif |
---|
3680 | |
---|
3681 | #ifdef CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS |
---|
3682 | #warning "The CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTOR configuration option is obsolete!" |
---|
3683 | #endif |
---|
3684 | |
---|
3685 | /* |
---|
3686 | * POSIX Key pair shouldn't be less than POSIX Key, which is highly |
---|
3687 | * likely to be error. |
---|
3688 | */ |
---|
3689 | #if (CONFIGURE_MAXIMUM_POSIX_KEYS != 0) && \ |
---|
3690 | (CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS != 0) |
---|
3691 | #if (CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS < CONFIGURE_MAXIMUM_POSIX_KEYS) |
---|
3692 | #error "Fewer POSIX Key pairs than POSIX Key!" |
---|
3693 | #endif |
---|
3694 | #endif |
---|
3695 | |
---|
3696 | /* |
---|
3697 | * IMFS block size for in memory files (memfiles) must be a power of |
---|
3698 | * two between 16 and 512 inclusive. |
---|
3699 | */ |
---|
3700 | #if ((CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK != 16) && \ |
---|
3701 | (CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK != 32) && \ |
---|
3702 | (CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK != 64) && \ |
---|
3703 | (CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK != 128) && \ |
---|
3704 | (CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK != 256) && \ |
---|
3705 | (CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK != 512)) |
---|
3706 | #error "IMFS Memfile block size must be a power of 2 between 16 and 512" |
---|
3707 | #endif |
---|
3708 | |
---|
3709 | |
---|
3710 | #endif |
---|
3711 | /* end of include file */ |
---|