source: rtems/cpukit/include/rtems/confdefs.h @ 7c19e50

5
Last change on this file since 7c19e50 was e7b0a72, checked in by Sebastian Huber <sebastian.huber@…>, on 12/14/18 at 07:07:08

config: Remove CONFIGURE_CONFDEFS_DEBUG

This configuration option was undocumented and not really helpful. To
debug issues in <rtems/confdefs.h> it is better to save the
preprocessesd file (GCC "-save-temps" option) and use the GCC "-Wp,-dD"
pre-processor option.

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