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