source: rtems/cpukit/include/rtems/confdefs.h @ 8ecbc38

5
Last change on this file since 8ecbc38 was 8ecbc38, checked in by Sebastian Huber <sebastian.huber@…>, on 02/04/20 at 12:56:41

sysinit: Add RTEMS_SYSINIT_ZERO_MEMORY

Use a dedicate system initialization step to zero the memory used for
the workspace and C program heap.

This avoids dead code in case CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY is
not configured.

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