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

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

config: Improve _Configure_From_workspace()

Commit 4c09f4b3fefc7ba5c5868a97ad00c1ee14a06677 changed the cast from
size_t to ssize_t to try to fix an workspace issue on 16-bit
architectures. This change was reverted by commit
7ff6115b8b913d848b8fe76daf72ca0b4bbf2548 for the workspace but not
_Configure_From_workspace(). Change the cast to uintptr_t to be in line
with the Heap Handler.

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