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

5
Last change on this file since ba46b936 was ba46b936, checked in by Sebastian Huber <sebastian.huber@…>, on 02/14/20 at 13:04:21

config: Add _SMP_Is_enabled

Move the is SMP enabled configuration constant out of the
configuration table.

Since this was the last configuration constant in
rtems_configuration_table, remove this type.

Update #3875.

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