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