source: rtems/cpukit/include/rtems/confdefs.h @ b1b6dd71

5
Last change on this file since b1b6dd71 was b1b6dd71, checked in by Sebastian Huber <sebastian.huber@…>, on 12/11/19 at 15:45:37

pipe: Use condition variables

Use self-contained condition variables instead of Classic API barriers.
This simplifies the implementation and configuration.

Update #3840.

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