source: rtems/cpukit/include/rtems/confdefs.h @ 0561cc1

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

config: Remove _Configure_Max_Objects()

Use rtems_resource_maximum_per_allocation() directly. The use of
_Configure_Zero_or_one() was superfluous.

Update #3875.

  • Property mode set to 100644
File size: 92.8 KB
RevLine 
[b96254f]1/**
[27f071cd]2 * @file
[08bae5e6]3 *
[9ab091e]4 * @brief Configuration Table Template that will be Instantiated
5 * by an Application
6 *
[27f071cd]7 * This include file contains the configuration table template that will
8 * be instantiated by an application based on the setting of a number
9 * of macros.  The macros are documented in the Configuring a System
10 * chapter of the Classic API User's Guide
[b96254f]11 */
[28352fae]12
13/*
[bfe6391]14 *  COPYRIGHT (c) 1989-2015.
[08bae5e6]15 *  On-Line Applications Research Corporation (OAR).
16 *
[98e4ebf5]17 *  The license and distribution terms for this file may be
18 *  found in the file LICENSE in this distribution or at
[c499856]19 *  http://www.rtems.org/license/LICENSE.
[08bae5e6]20 */
21
22#ifndef __CONFIGURATION_TEMPLATE_h
23#define __CONFIGURATION_TEMPLATE_h
[8486081]24
[9c63d90]25/*
26 * Include the executive's configuration
27 */
[58fa947]28#include <rtems.h>
[5fc855d]29#include <rtems/extensiondata.h>
[18ff889]30#include <rtems/ioimpl.h>
[a853c851]31#include <rtems/sysinit.h>
[b2b143f4]32#include <rtems/score/apimutex.h>
[fc398fd]33#include <rtems/score/context.h>
[48fed9a]34#include <rtems/score/percpu.h>
[a853c851]35#include <rtems/score/userextimpl.h>
[9fa3cf0d]36#include <rtems/score/wkspace.h>
[395a49e1]37#include <rtems/rtems/barrierdata.h>
[72a4a42]38#include <rtems/rtems/dpmemdata.h>
[257668d]39#include <rtems/rtems/messagedata.h>
[f00c5c6]40#include <rtems/rtems/partdata.h>
[78bbe59]41#include <rtems/rtems/ratemondata.h>
[e8e914b3]42#include <rtems/rtems/regiondata.h>
[739df1f5]43#include <rtems/rtems/semdata.h>
[b7af3e44]44#include <rtems/rtems/tasksdata.h>
[e1b7c188]45#include <rtems/rtems/timerdata.h>
[9318cfb0]46#include <rtems/posix/key.h>
[fe7aefd5]47#include <rtems/posix/mqueue.h>
[21275b58]48#include <rtems/posix/psignal.h>
[54f35888]49#include <rtems/posix/pthread.h>
[9318cfb0]50#include <rtems/posix/semaphore.h>
[701057e0]51#include <rtems/posix/shm.h>
[21275b58]52#include <rtems/posix/timer.h>
[9318cfb0]53
54#include <limits.h>
[9c63d90]55
[7571a23]56#ifdef CONFIGURE_DISABLE_BSP_SETTINGS
57  #undef BSP_DEFAULT_UNIFIED_WORK_AREAS
58  #undef BSP_IDLE_TASK_BODY
59  #undef BSP_IDLE_TASK_STACK_SIZE
60  #undef BSP_INITIAL_EXTENSION
61  #undef BSP_INTERRUPT_STACK_SIZE
62  #undef BSP_MAXIMUM_DEVICES
63  #undef CONFIGURE_BSP_PREREQUISITE_DRIVERS
64  #undef CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK
65#else
66  #include <bsp.h>
67#endif
68
[9c9b62d8]69#ifdef RTEMS_NEWLIB
70  #include <sys/reent.h>
71#endif
72
[5877cc3a]73#ifdef __cplusplus
74extern "C" {
75#endif
76
[07d71279]77/*
78 * Internal defines must be prefixed with _CONFIGURE to distinguish them from
79 * user-provided options which use a CONFIGURE prefix.
80 */
81
[bfe6391]82/**
83 * @defgroup Configuration RTEMS Configuration
84 *
85 * This module contains all RTEMS Configuration parameters.
86 *
87 * The model is to estimate the memory required for each configured item
88 * and sum those estimates.  The estimate can be too high or too low for
89 * a variety of reasons:
90 *
91 * Reasons estimate is too high:
92 *   + FP contexts (not all tasks are FP)
93 *
94 * Reasons estimate is too low:
95 *   + stacks greater than minimum size
96 *   + messages
97 *   + application must account for device driver resources
98 *   + application must account for add-on library resource requirements
99 *
100 * NOTE:  Eventually this may be able to take into account some of
101 *        the above.  This procedure has evolved from just enough to
102 *        support the RTEMS Test Suites into something that can be
103 *        used remarkably reliably by most applications.
104 */
105
[5877cc3a]106/**
[27f071cd]107 * This macro determines whether the RTEMS reentrancy support for
108 * the Newlib C Library is enabled.
[3b89891]109 */
[5aecf664]110#ifdef RTEMS_SCHEDSIM
111  #undef RTEMS_NEWLIB
112#endif
113
114#ifndef RTEMS_SCHEDSIM
[efd2965a]115#include <rtems/libio_.h>
[d40da79b]116
117#ifdef CONFIGURE_INIT
[3d36164f]118  #ifndef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM
119    RTEMS_SYSINIT_ITEM(
120      rtems_filesystem_initialize,
121      RTEMS_SYSINIT_ROOT_FILESYSTEM,
122      RTEMS_SYSINIT_ORDER_MIDDLE
123    );
[a290fbe9]124  #endif
[d40da79b]125#endif
[5aecf664]126#endif
[d40da79b]127
[3cec2df]128#ifdef CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS
129  #warning "CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS has been renamed to CONFIGURE_MAXIMUM_FILE_DESCRIPTORS since RTEMS 5.1"
130  #define CONFIGURE_MAXIMUM_FILE_DESCRIPTORS CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS
131#endif
132
[5877cc3a]133/**
[27f071cd]134 * This macro defines the number of POSIX file descriptors allocated
135 * and managed by libio.  These are the "integer" file descriptors that
136 * are used by calls like open(2) and read(2).
[df49c60]137 */
[3cec2df]138#ifndef CONFIGURE_MAXIMUM_FILE_DESCRIPTORS
139  #define CONFIGURE_MAXIMUM_FILE_DESCRIPTORS 3
[bd9c3d1]140#endif
141
[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
[bfe6391]1258/**@}*/
[5877cc3a]1259
[bfe6391]1260/**
1261 * @defgroup ConfigurationInitTasksTable Initialization Tasks Configuration
1262 *
1263 * @addtogroup Configuration
1264 *
1265 * This group contains the elements needed to define the Classic API
1266 * Initialization Tasks Table.
1267 *
[c232b37]1268 * Default User Initialization Task Table.  This table guarantees that
1269 * one user initialization table is defined.
[be1c11ed]1270 */
[6b0873f]1271#if defined(CONFIGURE_RTEMS_INIT_TASKS_TABLE)
[08bae5e6]1272
[bfe6391]1273/**
1274 * When using the default Classic API Initialization Tasks Table, this is
1275 * used to specify the name of the single Classic API task.
1276 */
[08bae5e6]1277#ifndef CONFIGURE_INIT_TASK_NAME
[5877cc3a]1278  #define CONFIGURE_INIT_TASK_NAME          rtems_build_name('U', 'I', '1', ' ')
[08bae5e6]1279#endif
1280
[bfe6391]1281/**
1282 * When using the default Classic API Initialization Tasks Table, this is
1283 * used to specify the stack size of the single Classic API task.
1284 */
[08bae5e6]1285#ifndef CONFIGURE_INIT_TASK_STACK_SIZE
[ecf0f4c]1286  #define CONFIGURE_INIT_TASK_STACK_SIZE    CONFIGURE_MINIMUM_TASK_STACK_SIZE
[08bae5e6]1287#endif
1288
[bfe6391]1289/**
1290 * When using the default Classic API Initialization Tasks Table, this is
1291 * used to specify the priority of the single Classic API task.
1292 */
[08bae5e6]1293#ifndef CONFIGURE_INIT_TASK_PRIORITY
[5877cc3a]1294  #define CONFIGURE_INIT_TASK_PRIORITY      1
[08bae5e6]1295#endif
1296
[bfe6391]1297/**
1298 * When using the default Classic API Initialization Tasks Table, this is
1299 * used to specify the attributes size of the single Classic API task.
1300 */
[08bae5e6]1301#ifndef CONFIGURE_INIT_TASK_ATTRIBUTES
[5877cc3a]1302  #define CONFIGURE_INIT_TASK_ATTRIBUTES    RTEMS_DEFAULT_ATTRIBUTES
[08bae5e6]1303#endif
1304
[bfe6391]1305/**
1306 * When using the default Classic API Initialization Tasks Table, this is
1307 * used to specify the entry point of the single Classic API task.
1308 */
[08bae5e6]1309#ifndef CONFIGURE_INIT_TASK_ENTRY_POINT
[d8b74dbe]1310  #ifdef __cplusplus
1311  extern "C" {
1312  #endif
1313    rtems_task Init (rtems_task_argument );
1314  #ifdef __cplusplus
1315  }
1316  #endif
[5877cc3a]1317  #define CONFIGURE_INIT_TASK_ENTRY_POINT   Init
[d8b74dbe]1318  extern const char* bsp_boot_cmdline;
1319  #define CONFIGURE_INIT_TASK_ARGUMENTS     ((rtems_task_argument) &bsp_boot_cmdline)
[08bae5e6]1320#endif
1321
[bfe6391]1322/**
1323 * When using the default Classic API Initialization Tasks Table, this is
1324 * used to specify the initial execution mode of the single Classic API task.
1325 */
[08bae5e6]1326#ifndef CONFIGURE_INIT_TASK_INITIAL_MODES
[5b8d80d7]1327  #ifdef RTEMS_SMP
[05e82bd7]1328    #define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_DEFAULT_MODES
1329  #else
1330    #define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_NO_PREEMPT
1331  #endif
[08bae5e6]1332#endif
1333
[bfe6391]1334/**
1335 * When using the default Classic API Initialization Tasks Table, this is
1336 * used to specify the initial argument to the single Classic API task.
1337 */
[08bae5e6]1338#ifndef CONFIGURE_INIT_TASK_ARGUMENTS
[5877cc3a]1339  #define CONFIGURE_INIT_TASK_ARGUMENTS     0
[08bae5e6]1340#endif
1341
[be1c11ed]1342#else     /* CONFIGURE_RTEMS_INIT_TASKS_TABLE */
1343
[07d71279]1344/*
[bfe6391]1345 * This is the stack size of the Initialization Task when none is configured.
1346 */
[45c3da3]1347#define CONFIGURE_INIT_TASK_STACK_SIZE 0
[be1c11ed]1348
[08bae5e6]1349#endif
[bfe6391]1350/**@}*/  /* end of Classic API Initialization Tasks Table */
[08bae5e6]1351
[bfe6391]1352/**
1353 * @defgroup ConfigurationDriverTable Device Driver Table Configuration
1354 *
1355 * @addtogroup Configuration
1356 *
1357 * This group contains parameters related to generating a Device Driver
1358 * Table.
1359 *
1360 * Default Device Driver Table.  Each driver needed by the test is explicitly
[0446f680]1361 * chosen by the application.  There is always a null driver entry.
[08bae5e6]1362 */
[bfe6391]1363/**@{*/
[08bae5e6]1364
[bfe6391]1365/**
1366 * This is an empty device driver slot.
1367 */
[08bae5e6]1368#define NULL_DRIVER_TABLE_ENTRY \
1369 { NULL, NULL, NULL, NULL, NULL, NULL }
1370
[337a186]1371#if (defined(CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER) && \
1372    defined(CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER)) || \
1373  (defined(CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER) && \
1374    defined(CONFIGURE_APPLICATION_NEEDS_SIMPLE_TASK_CONSOLE_DRIVER)) || \
1375  (defined(CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER) && \
1376    defined(CONFIGURE_APPLICATION_NEEDS_SIMPLE_TASK_CONSOLE_DRIVER))
1377#error "CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER, CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER, and CONFIGURE_APPLICATION_NEEDS_SIMPLE_TASK_CONSOLE_DRIVER are mutually exclusive"
[ac28f15]1378#endif
1379
[df49c60]1380#ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
[5877cc3a]1381  #include <rtems/console.h>
[df49c60]1382#endif
1383
[ac28f15]1384#ifdef CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
1385  #include <rtems/console.h>
1386
1387  #ifdef CONFIGURE_INIT
1388    RTEMS_SYSINIT_ITEM(
1389      _Console_simple_Initialize,
1390      RTEMS_SYSINIT_DEVICE_DRIVERS,
[337a186]1391      RTEMS_SYSINIT_ORDER_SECOND
1392    );
1393  #endif
1394#endif
1395
1396#ifdef CONFIGURE_APPLICATION_NEEDS_SIMPLE_TASK_CONSOLE_DRIVER
1397  #include <rtems/console.h>
1398
1399  #ifdef CONFIGURE_INIT
1400    RTEMS_SYSINIT_ITEM(
1401      _Console_simple_task_Initialize,
1402      RTEMS_SYSINIT_DEVICE_DRIVERS,
[ac28f15]1403      RTEMS_SYSINIT_ORDER_SECOND
1404    );
1405  #endif
1406#endif
1407
[df49c60]1408#ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
[5877cc3a]1409  #include <rtems/clockdrv.h>
[bb99cd0d]1410
1411  #ifdef CONFIGURE_INIT
1412    RTEMS_SYSINIT_ITEM(
1413      _Clock_Initialize,
1414      RTEMS_SYSINIT_DEVICE_DRIVERS,
1415      RTEMS_SYSINIT_ORDER_THIRD
1416    );
1417  #endif
[df49c60]1418#endif
1419
1420#ifdef CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
[8fbe2e6]1421  #include <rtems/btimer.h>
[08bae5e6]1422#endif
1423
[1d4bac9]1424#ifdef CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER
[5877cc3a]1425  #include <rtems/rtc.h>
[1d4bac9]1426#endif
1427
[d2018f71]1428#ifdef CONFIGURE_APPLICATION_NEEDS_WATCHDOG_DRIVER
[5877cc3a]1429  #include <rtems/watchdogdrv.h>
[d2018f71]1430#endif
1431
[ad4759ab]1432#ifdef CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER
1433  #include <rtems/framebuffer.h>
1434#endif
1435
[df49c60]1436#ifdef CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER
[5877cc3a]1437  #include <rtems/devnull.h>
[08bae5e6]1438#endif
1439
[5af951f]1440#ifdef CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER
1441  #include <rtems/devzero.h>
1442#endif
1443
[c9b005a9]1444#ifdef CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER
1445  /* the ide driver needs the ATA driver */
[5877cc3a]1446  #ifndef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
1447    #define CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
1448  #endif
1449  #include <libchip/ide_ctrl.h>
[c9b005a9]1450#endif
1451
1452#ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
[5877cc3a]1453  #include <libchip/ata.h>
[c9b005a9]1454#endif
1455
[263f4bec]1456/**
1457 * This specifies the maximum number of device drivers that
1458 * can be installed in the system at one time.  It must account
1459 * for both the statically and dynamically installed drivers.
1460 */
1461#ifndef CONFIGURE_MAXIMUM_DRIVERS
1462  #define CONFIGURE_MAXIMUM_DRIVERS
1463#endif
1464
[08bae5e6]1465#ifdef CONFIGURE_INIT
[263f4bec]1466  rtems_driver_address_table
1467    _IO_Driver_address_table[ CONFIGURE_MAXIMUM_DRIVERS ] = {
[09daf222]1468    #ifdef CONFIGURE_BSP_PREREQUISITE_DRIVERS
1469      CONFIGURE_BSP_PREREQUISITE_DRIVERS,
1470    #endif
1471    #ifdef CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS
1472      CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS,
1473    #endif
[5877cc3a]1474    #ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
1475      CONSOLE_DRIVER_TABLE_ENTRY,
1476    #endif
1477    #ifdef CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER
1478      RTC_DRIVER_TABLE_ENTRY,
1479    #endif
1480    #ifdef CONFIGURE_APPLICATION_NEEDS_WATCHDOG_DRIVER
1481      WATCHDOG_DRIVER_TABLE_ENTRY,
1482    #endif
1483    #ifdef CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER
1484      DEVNULL_DRIVER_TABLE_ENTRY,
1485    #endif
[5af951f]1486    #ifdef CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER
1487      DEVZERO_DRIVER_TABLE_ENTRY,
1488    #endif
[5877cc3a]1489    #ifdef CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER
1490      IDE_CONTROLLER_DRIVER_TABLE_ENTRY,
1491    #endif
1492    #ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
1493      ATA_DRIVER_TABLE_ENTRY,
1494    #endif
[ad4759ab]1495    #ifdef CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER
1496      FRAME_BUFFER_DRIVER_TABLE_ENTRY,
1497    #endif
[5877cc3a]1498    #ifdef CONFIGURE_APPLICATION_EXTRA_DRIVERS
1499      CONFIGURE_APPLICATION_EXTRA_DRIVERS,
1500    #endif
1501    #ifdef CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER
1502      NULL_DRIVER_TABLE_ENTRY
1503    #elif !defined(CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER) && \
[4175abd]1504        !defined(CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER) && \
1505        !defined(CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER) && \
[5af951f]1506        !defined(CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER) && \
[4175abd]1507        !defined(CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER) && \
1508        !defined(CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER) && \
[ad4759ab]1509        !defined(CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER) && \
[4175abd]1510        !defined(CONFIGURE_APPLICATION_EXTRA_DRIVERS)
[5877cc3a]1511      NULL_DRIVER_TABLE_ENTRY
1512    #endif
1513  };
[08bae5e6]1514
[263f4bec]1515  const size_t _IO_Number_of_drivers =
1516    RTEMS_ARRAY_SIZE( _IO_Driver_address_table );
[059a3714]1517#endif
1518
[c9b005a9]1519#ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
1520  /*
1521   * configure the priority of the ATA driver task
1522   */
[5877cc3a]1523  #ifndef CONFIGURE_ATA_DRIVER_TASK_PRIORITY
1524    #define CONFIGURE_ATA_DRIVER_TASK_PRIORITY ATA_DRIVER_TASK_DEFAULT_PRIORITY
1525  #endif
1526  #ifdef CONFIGURE_INIT
[3899a537]1527    rtems_task_priority rtems_ata_driver_task_priority
[5877cc3a]1528      = CONFIGURE_ATA_DRIVER_TASK_PRIORITY;
1529  #endif /* CONFIGURE_INIT */
[c9b005a9]1530#endif
[bfe6391]1531/**@}*/ /* end of Device Driver Table Configuration */
[c9b005a9]1532
[bfe6391]1533/**
1534 * @defgroup ConfigurationLibBlock Configuration of LIBBLOCK
1535 *
1536 * @addtogroup Configuration
1537 *
1538 * This module contains parameters related to the LIBBLOCK buffering
1539 * and caching subsystem. It requires tasks to swap out data to be
1540 * written to non-volatile storage.
[c9b005a9]1541 */
[bfe6391]1542/**@{*/
[c9b005a9]1543#ifdef CONFIGURE_APPLICATION_NEEDS_LIBBLOCK
[5877cc3a]1544  #include <rtems/bdbuf.h>
1545  /*
[3899a537]1546   * configure the bdbuf cache parameters
[5877cc3a]1547   */
[3899a537]1548  #ifndef CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS
1549    #define CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS \
1550                              RTEMS_BDBUF_MAX_READ_AHEAD_BLOCKS_DEFAULT
1551  #endif
1552  #ifndef CONFIGURE_BDBUF_MAX_WRITE_BLOCKS
1553    #define CONFIGURE_BDBUF_MAX_WRITE_BLOCKS \
1554                              RTEMS_BDBUF_MAX_WRITE_BLOCKS_DEFAULT
1555  #endif
[5877cc3a]1556  #ifndef CONFIGURE_SWAPOUT_TASK_PRIORITY
[3899a537]1557    #define CONFIGURE_SWAPOUT_TASK_PRIORITY \
1558                              RTEMS_BDBUF_SWAPOUT_TASK_PRIORITY_DEFAULT
1559  #endif
1560  #ifndef CONFIGURE_SWAPOUT_SWAP_PERIOD
1561    #define CONFIGURE_SWAPOUT_SWAP_PERIOD \
1562                              RTEMS_BDBUF_SWAPOUT_TASK_SWAP_PERIOD_DEFAULT
1563  #endif
1564  #ifndef CONFIGURE_SWAPOUT_BLOCK_HOLD
1565    #define CONFIGURE_SWAPOUT_BLOCK_HOLD \
1566                              RTEMS_BDBUF_SWAPOUT_TASK_BLOCK_HOLD_DEFAULT
[5877cc3a]1567  #endif
[0d15414e]1568  #ifndef CONFIGURE_SWAPOUT_WORKER_TASKS
1569    #define CONFIGURE_SWAPOUT_WORKER_TASKS \
1570                              RTEMS_BDBUF_SWAPOUT_WORKER_TASKS_DEFAULT
1571  #endif
1572  #ifndef CONFIGURE_SWAPOUT_WORKER_TASK_PRIORITY
1573    #define CONFIGURE_SWAPOUT_WORKER_TASK_PRIORITY \
1574                              RTEMS_BDBUF_SWAPOUT_WORKER_TASK_PRIORITY_DEFAULT
1575  #endif
[b6911069]1576  #ifndef CONFIGURE_BDBUF_TASK_STACK_SIZE
1577    #define CONFIGURE_BDBUF_TASK_STACK_SIZE \
1578                              RTEMS_BDBUF_TASK_STACK_SIZE_DEFAULT
1579  #endif
[0d15414e]1580  #ifndef CONFIGURE_BDBUF_CACHE_MEMORY_SIZE
1581    #define CONFIGURE_BDBUF_CACHE_MEMORY_SIZE \
1582                              RTEMS_BDBUF_CACHE_MEMORY_SIZE_DEFAULT
1583  #endif
1584  #ifndef CONFIGURE_BDBUF_BUFFER_MIN_SIZE
1585    #define CONFIGURE_BDBUF_BUFFER_MIN_SIZE \
1586                              RTEMS_BDBUF_BUFFER_MIN_SIZE_DEFAULT
1587  #endif
1588  #ifndef CONFIGURE_BDBUF_BUFFER_MAX_SIZE
1589    #define CONFIGURE_BDBUF_BUFFER_MAX_SIZE \
1590                              RTEMS_BDBUF_BUFFER_MAX_SIZE_DEFAULT
1591  #endif
[39ee704e]1592  #ifndef CONFIGURE_BDBUF_READ_AHEAD_TASK_PRIORITY
1593    #define CONFIGURE_BDBUF_READ_AHEAD_TASK_PRIORITY \
1594                              RTEMS_BDBUF_READ_AHEAD_TASK_PRIORITY_DEFAULT
1595  #endif
[5877cc3a]1596  #ifdef CONFIGURE_INIT
[28352fae]1597    const rtems_bdbuf_config rtems_bdbuf_configuration = {
[3899a537]1598      CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS,
1599      CONFIGURE_BDBUF_MAX_WRITE_BLOCKS,
1600      CONFIGURE_SWAPOUT_TASK_PRIORITY,
1601      CONFIGURE_SWAPOUT_SWAP_PERIOD,
[0d15414e]1602      CONFIGURE_SWAPOUT_BLOCK_HOLD,
1603      CONFIGURE_SWAPOUT_WORKER_TASKS,
1604      CONFIGURE_SWAPOUT_WORKER_TASK_PRIORITY,
[b6911069]1605      CONFIGURE_BDBUF_TASK_STACK_SIZE,
[0d15414e]1606      CONFIGURE_BDBUF_CACHE_MEMORY_SIZE,
1607      CONFIGURE_BDBUF_BUFFER_MIN_SIZE,
[39ee704e]1608      CONFIGURE_BDBUF_BUFFER_MAX_SIZE,
1609      CONFIGURE_BDBUF_READ_AHEAD_TASK_PRIORITY
[3899a537]1610    };
[5877cc3a]1611  #endif
[b2f216e1]1612
[07d71279]1613  #define _CONFIGURE_LIBBLOCK_TASKS \
[39ee704e]1614    (1 + CONFIGURE_SWAPOUT_WORKER_TASKS + \
1615    (CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS != 0))
[b6911069]1616
[07d71279]1617  #define _CONFIGURE_LIBBLOCK_TASK_EXTRA_STACKS \
1618    (_CONFIGURE_LIBBLOCK_TASKS * \
[b6911069]1619    (CONFIGURE_BDBUF_TASK_STACK_SIZE <= CONFIGURE_MINIMUM_TASK_STACK_SIZE ? \
1620    0 : CONFIGURE_BDBUF_TASK_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE))
1621
[0d15414e]1622  #if defined(CONFIGURE_HAS_OWN_BDBUF_TABLE) || \
1623      defined(CONFIGURE_BDBUF_BUFFER_SIZE) || \
1624      defined(CONFIGURE_BDBUF_BUFFER_COUNT)
1625    #error BDBUF Cache does not use a buffer configuration table. Please remove.
1626  #endif
[b2f216e1]1627#else
[bfe6391]1628  /** This specifies the number of libblock tasks. */
[07d71279]1629  #define _CONFIGURE_LIBBLOCK_TASKS 0
[bfe6391]1630  /** This specifies the extra stack space configured for libblock tasks. */
[07d71279]1631  #define _CONFIGURE_LIBBLOCK_TASK_EXTRA_STACKS 0
[bfe6391]1632  /** This specifies the number of Classic API semaphores needed by libblock. */
[c9b005a9]1633#endif /* CONFIGURE_APPLICATION_NEEDS_LIBBLOCK */
[bfe6391]1634/**@}*/
[976162a6]1635
[bfe6391]1636/**
1637 * @defgroup ConfigurationMultiprocessing Multiprocessing Configuration
1638 *
1639 * @addtogroup Configuration
1640 *
1641 * This module contains the parameters related to the Multiprocessing
1642 * configuration of RTEMS.
1643 *
1644 * In a single processor or SMP configuration, only two parameters are
1645 * needed and they are defaulted. The user should not have to specify
1646 * any parameters.
1647 */
1648/**@{*/
1649
1650/**
1651 * This defines the extra stack space required for the MPCI server thread.
1652 */
[b4f635e]1653#ifndef CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK
1654  #define CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK 0
1655#endif
1656
[976162a6]1657#if defined(RTEMS_MULTIPROCESSING)
[5877cc3a]1658  /*
1659   *  Default Multiprocessing Configuration Table.  The defaults are
1660   *  appropriate for most of the RTEMS Multiprocessor Test Suite.  Each
1661   *  value may be overridden within each test to customize the environment.
1662   */
[08bae5e6]1663
[5877cc3a]1664  #ifdef CONFIGURE_MP_APPLICATION
[d24b301]1665    #ifndef CONFIGURE_MP_NODE_NUMBER
1666      #define CONFIGURE_MP_NODE_NUMBER                NODE_NUMBER
1667    #endif
[08bae5e6]1668
[d24b301]1669    #ifndef CONFIGURE_MP_MAXIMUM_NODES
1670      #define CONFIGURE_MP_MAXIMUM_NODES              2
1671    #endif
[08bae5e6]1672
[d24b301]1673    #ifndef CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS
1674      #define CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS     32
1675    #endif
[08bae5e6]1676
[d24b301]1677    #ifndef CONFIGURE_MP_MAXIMUM_PROXIES
1678      #define CONFIGURE_MP_MAXIMUM_PROXIES            32
1679    #endif
1680
1681    #ifndef CONFIGURE_MP_MPCI_TABLE_POINTER
1682      #include <mpci.h>
1683      #define CONFIGURE_MP_MPCI_TABLE_POINTER         &MPCI_table
1684    #endif
[08bae5e6]1685
[d24b301]1686    #ifdef CONFIGURE_INIT
[24f8915]1687      #if CONFIGURE_MP_NODE_NUMBER < 1
1688        #error "CONFIGURE_MP_NODE_NUMBER must be greater than or equal to one"
1689      #endif
1690
1691      #if CONFIGURE_MP_NODE_NUMBER > CONFIGURE_MP_MAXIMUM_NODES
1692        #error "CONFIGURE_MP_NODE_NUMBER must be less than or equal to CONFIGURE_MP_MAXIMUM_NODES"
1693      #endif
1694
[3fba9de2]1695      Objects_MP_Control _Objects_MP_Controls[
1696        CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS
1697      ];
1698
[1d9f509e]1699      struct Thread_Configured_proxy_control {
1700        Thread_Proxy_control Control;
1701        Thread_queue_Configured_heads Heads;
1702      };
1703
1704      static Thread_Configured_proxy_control _Thread_MP_Configured_proxies[
1705        CONFIGURE_MP_MAXIMUM_PROXIES
1706      ];
1707
1708      Thread_Configured_proxy_control * const _Thread_MP_Proxies =
1709        &_Thread_MP_Configured_proxies[ 0 ];
1710
[24f8915]1711      const MPCI_Configuration _MPCI_Configuration = {
[d24b301]1712        CONFIGURE_MP_NODE_NUMBER,               /* local node number */
1713        CONFIGURE_MP_MAXIMUM_NODES,             /* maximum # nodes */
1714        CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS,    /* maximum # global objects */
1715        CONFIGURE_MP_MAXIMUM_PROXIES,           /* maximum # proxies */
1716        CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK, /* MPCI stack > minimum */
1717        CONFIGURE_MP_MPCI_TABLE_POINTER         /* ptr to MPCI config table */
1718      };
[32991495]1719
1720      char _MPCI_Receive_server_stack[
1721        CONFIGURE_MINIMUM_TASK_STACK_SIZE
1722          + CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK
1723          + CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK
1724          + CPU_ALL_TASKS_ARE_FP * CONTEXT_FP_SIZE
1725      ] RTEMS_ALIGNED( CPU_INTERRUPT_STACK_ALIGNMENT )
1726      RTEMS_SECTION( ".rtemsstack.mpci" );
[d24b301]1727    #endif
[08bae5e6]1728
[d24b301]1729    #define _CONFIGURE_MPCI_RECEIVE_SERVER_COUNT 1
[5877cc3a]1730  #else
[07d71279]1731    #define _CONFIGURE_MPCI_RECEIVE_SERVER_COUNT 0
[5877cc3a]1732  #endif /* CONFIGURE_MP_APPLICATION */
[9a972889]1733#else
[07d71279]1734  #define _CONFIGURE_MPCI_RECEIVE_SERVER_COUNT 0
[976162a6]1735#endif /* RTEMS_MULTIPROCESSING */
[bfe6391]1736/**@}*/ /* end of Multiprocessing Configuration */
[913ede4f]1737
[e53aae2]1738/**
1739 * This macro specifies that the user wants to use unlimited objects for any
1740 * classic or posix objects that have not already been given resource limits.
1741 */
1742#if defined(CONFIGURE_UNLIMITED_OBJECTS)
[2c1e7ff]1743  #if !defined(CONFIGURE_UNIFIED_WORK_AREAS) && \
1744     !defined(CONFIGURE_EXECUTIVE_RAM_SIZE) && \
1745     !defined(CONFIGURE_MEMORY_OVERHEAD)
1746     #error "CONFIGURE_UNLIMITED_OBJECTS requires a unified work area, an executive RAM size, or a defined workspace memory overhead"
1747  #endif
1748
[e53aae2]1749  #if !defined(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
1750  /**
1751   * This macro specifies a default allocation size for when auto-extending
1752   * unlimited objects if none was given by the user.
1753   */
1754    #define CONFIGURE_UNLIMITED_ALLOCATION_SIZE 8
1755  #endif
1756  #if !defined(CONFIGURE_MAXIMUM_TASKS)
1757    #define CONFIGURE_MAXIMUM_TASKS \
1758      rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
1759  #endif
1760  #if !defined(CONFIGURE_MAXIMUM_TIMERS)
1761    #define CONFIGURE_MAXIMUM_TIMERS \
1762      rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
1763  #endif
1764  #if !defined(CONFIGURE_MAXIMUM_SEMAPHORES)
1765    #define CONFIGURE_MAXIMUM_SEMAPHORES \
1766      rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
1767  #endif
1768  #if !defined(CONFIGURE_MAXIMUM_MESSAGE_QUEUES)
1769    #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES \
1770      rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
1771  #endif
1772  #if !defined(CONFIGURE_MAXIMUM_PARTITIONS)
1773    #define CONFIGURE_MAXIMUM_PARTITIONS \
1774      rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
1775  #endif
1776  #if !defined(CONFIGURE_MAXIMUM_REGIONS)
1777    #define CONFIGURE_MAXIMUM_REGIONS \
1778      rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
1779  #endif
1780  #if !defined(CONFIGURE_MAXIMUM_PORTS)
1781    #define CONFIGURE_MAXIMUM_PORTS \
1782      rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
1783  #endif
1784  #if !defined(CONFIGURE_MAXIMUM_PERIODS)
1785    #define CONFIGURE_MAXIMUM_PERIODS \
1786      rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
1787  #endif
1788  #if !defined(CONFIGURE_MAXIMUM_BARRIERS)
1789    #define CONFIGURE_MAXIMUM_BARRIERS \
1790      rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
1791  #endif
[0e98970]1792  #if !defined(CONFIGURE_MAXIMUM_POSIX_KEYS)
1793    #define CONFIGURE_MAXIMUM_POSIX_KEYS \
1794      rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
1795  #endif
1796  #if !defined(CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS)
1797    #define CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS \
1798      rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
1799  #endif
[fe7aefd5]1800  #if !defined(CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES)
1801    #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES \
1802      rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
1803  #endif
[9318cfb0]1804  #if !defined(CONFIGURE_MAXIMUM_POSIX_SEMAPHORES)
1805    #define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES \
1806      rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
1807  #endif
[701057e0]1808  #if !defined(CONFIGURE_MAXIMUM_POSIX_SHMS)
1809    #define CONFIGURE_MAXIMUM_POSIX_SHMS \
1810      rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
1811  #endif
[54f35888]1812  #if !defined(CONFIGURE_MAXIMUM_POSIX_THREADS)
1813    #define CONFIGURE_MAXIMUM_POSIX_THREADS \
1814      rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
1815  #endif
[e53aae2]1816
1817  #ifdef RTEMS_POSIX_API
1818    #if !defined(CONFIGURE_MAXIMUM_POSIX_TIMERS)
1819      #define CONFIGURE_MAXIMUM_POSIX_TIMERS \
1820        rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
1821    #endif
1822  #endif /* RTEMS_POSIX_API */
1823#endif /* CONFIGURE_UNLIMITED_OBJECTS */
1824
1825
[bfe6391]1826/**
1827 * @defgroup ConfigurationClassicAPI Classic API Configuration
1828 *
1829 * @ingroup Configuration
1830 *
1831 * This module contains the parameters related to configuration
1832 * of the Classic API services.
[08bae5e6]1833 */
[bfe6391]1834/**@{*/
[8486081]1835
[68f339b6]1836/** This configures the maximum number of Classic API tasks. */
1837#ifndef CONFIGURE_MAXIMUM_TASKS
1838  #define CONFIGURE_MAXIMUM_TASKS               0
1839#endif
1840
1841/*
1842 * This is calculated to account for the maximum number of Classic API
1843 * tasks used by the application and configured RTEMS capabilities.
1844 */
1845#define _CONFIGURE_TASKS \
1846  (CONFIGURE_MAXIMUM_TASKS + _CONFIGURE_LIBBLOCK_TASKS)
[08bae5e6]1847
[68f339b6]1848#ifndef CONFIGURE_MAXIMUM_TIMERS
1849  /** This specifies the maximum number of Classic API timers. */
1850  #define CONFIGURE_MAXIMUM_TIMERS             0
1851#endif
[b6911069]1852
[68f339b6]1853#ifndef CONFIGURE_MAXIMUM_SEMAPHORES
1854  /** This specifies the maximum number of Classic API semaphores. */
1855  #define CONFIGURE_MAXIMUM_SEMAPHORES                 0
1856#endif
[08bae5e6]1857
[68f339b6]1858#ifndef CONFIGURE_MAXIMUM_MESSAGE_QUEUES
1859  /**
1860   * This configuration parameter specifies the maximum number of
1861   * Classic API Message Queues.
1862   */
1863  #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES             0
1864#endif
1865
1866#ifndef CONFIGURE_MAXIMUM_PARTITIONS
1867  /**
1868   * This configuration parameter specifies the maximum number of
1869   * Classic API Partitions.
1870   */
1871  #define CONFIGURE_MAXIMUM_PARTITIONS                 0
1872#endif
[8fcafdd5]1873
[68f339b6]1874#ifndef CONFIGURE_MAXIMUM_REGIONS
1875  /**
1876   * This configuration parameter specifies the maximum number of
1877   * Classic API Regions.
1878   */
1879  #define CONFIGURE_MAXIMUM_REGIONS              0
1880#endif
[08bae5e6]1881
[68f339b6]1882#ifndef CONFIGURE_MAXIMUM_PORTS
1883  /**
1884   * This configuration parameter specifies the maximum number of
1885   * Classic API Dual-Ported Memory Ports.
1886   */
1887  #define CONFIGURE_MAXIMUM_PORTS            0
1888#endif
[08bae5e6]1889
[68f339b6]1890#ifndef CONFIGURE_MAXIMUM_PERIODS
1891  /**
1892   * This configuration parameter specifies the maximum number of
1893   * Classic API Rate Monotonic Periods.
1894   */
1895  #define CONFIGURE_MAXIMUM_PERIODS              0
1896#endif
[08bae5e6]1897
[68f339b6]1898/**
1899 * This configuration parameter specifies the maximum number of
1900 * Classic API Barriers.
1901 */
1902#ifndef CONFIGURE_MAXIMUM_BARRIERS
1903  #define CONFIGURE_MAXIMUM_BARRIERS               0
1904#endif
[08bae5e6]1905
[68f339b6]1906#ifndef CONFIGURE_MAXIMUM_USER_EXTENSIONS
[bfe6391]1907  /**
1908   * This configuration parameter specifies the maximum number of
[68f339b6]1909   * Classic API User Extensions.
[bfe6391]1910   */
[68f339b6]1911  #define CONFIGURE_MAXIMUM_USER_EXTENSIONS                 0
1912#endif
[08bae5e6]1913
[68f339b6]1914/**@}*/ /* end of Classic API Configuration */
[bfe6391]1915
[68f339b6]1916/**
1917 * @defgroup ConfigurationGeneral General System Configuration
1918 *
1919 * @ingroup Configuration
1920 *
1921 * This module contains configuration parameters that are independent
1922 * of any API but impact general system configuration.
1923 */
1924/**@{*/
[08bae5e6]1925
[68f339b6]1926/** The configures the number of microseconds per clock tick. */
1927#ifndef CONFIGURE_MICROSECONDS_PER_TICK
1928  #define CONFIGURE_MICROSECONDS_PER_TICK \
1929          RTEMS_MILLISECONDS_TO_MICROSECONDS(10)
1930#endif
[5877cc3a]1931
[68f339b6]1932#if 1000000 % CONFIGURE_MICROSECONDS_PER_TICK != 0
1933  #warning "The clock ticks per second is not an integer"
1934#endif
[381ef5c]1935
[68f339b6]1936#if CONFIGURE_MICROSECONDS_PER_TICK <= 0
1937  #error "The CONFIGURE_MICROSECONDS_PER_TICK must be positive"
1938#endif
[0ddffb76]1939
[b8648bd]1940#ifdef CONFIGURE_INIT
1941  const uint32_t _Watchdog_Microseconds_per_tick =
1942    CONFIGURE_MICROSECONDS_PER_TICK;
1943
1944  const uint32_t _Watchdog_Nanoseconds_per_tick =
1945    (uint32_t) 1000 * CONFIGURE_MICROSECONDS_PER_TICK;
1946
1947  const uint32_t _Watchdog_Ticks_per_second =
1948    1000000 / CONFIGURE_MICROSECONDS_PER_TICK;
1949#endif
[27cfe7c]1950
[68f339b6]1951/** The configures the number of clock ticks per timeslice. */
[308a2e0f]1952#if defined(CONFIGURE_TICKS_PER_TIMESLICE) && \
1953  CONFIGURE_TICKS_PER_TIMESLICE != WATCHDOG_TICKS_PER_TIMESLICE_DEFAULT
1954
1955#ifdef CONFIGURE_INIT
1956  const uint32_t _Watchdog_Ticks_per_timeslice =
1957    CONFIGURE_TICKS_PER_TIMESLICE;
[68f339b6]1958#endif
[08bae5e6]1959
[308a2e0f]1960#endif /* CONFIGURE_TICKS_PER_TIMESLICE */
1961
[bfe6391]1962/**@}*/ /* end of General Configuration */
1963
[0451b44]1964/*
1965 *  Initial Extension Set
1966 */
1967
1968#ifdef CONFIGURE_INIT
[26443da]1969#if CONFIGURE_RECORD_PER_PROCESSOR_ITEMS > 0
1970#include <rtems/record.h>
1971#endif
[4afd6f4]1972#ifdef CONFIGURE_STACK_CHECKER_ENABLED
[31bce9b]1973#include <rtems/stackchk.h>
[0451b44]1974#endif
[26443da]1975
[c3db01d0]1976#include <rtems/libcsupport.h>
[0451b44]1977
[228df42]1978#if defined(BSP_INITIAL_EXTENSION) || \
1979    defined(CONFIGURE_INITIAL_EXTENSIONS) || \
[4afd6f4]1980    defined(CONFIGURE_STACK_CHECKER_ENABLED) || \
[c3db01d0]1981    (defined(RTEMS_NEWLIB) && !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY))
[5ae6112]1982  const User_extensions_Table _User_extensions_Initial_extensions[] = {
[dca6184]1983    #if CONFIGURE_RECORD_PER_PROCESSOR_ITEMS > 0 && \
1984      defined(CONFIGURE_RECORD_EXTENSIONS_ENABLED)
1985      RECORD_EXTENSION,
1986    #endif
[c3db01d0]1987    #if !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY)
1988      RTEMS_NEWLIB_EXTENSION,
1989    #endif
[4afd6f4]1990    #if defined(CONFIGURE_STACK_CHECKER_ENABLED)
[c3db01d0]1991      RTEMS_STACK_CHECKER_EXTENSION,
1992    #endif
1993    #if defined(CONFIGURE_INITIAL_EXTENSIONS)
1994      CONFIGURE_INITIAL_EXTENSIONS,
1995    #endif
[228df42]1996    #if defined(BSP_INITIAL_EXTENSION)
1997      BSP_INITIAL_EXTENSION
1998    #endif
[c3db01d0]1999  };
2000
[5ae6112]2001  const size_t _User_extensions_Initial_count =
2002    RTEMS_ARRAY_SIZE( _User_extensions_Initial_extensions );
2003
2004  User_extensions_Switch_control _User_extensions_Initial_switch_controls[
2005    RTEMS_ARRAY_SIZE( _User_extensions_Initial_extensions )
2006  ];
[a853c851]2007
2008  RTEMS_SYSINIT_ITEM(
2009    _User_extensions_Handler_initialization,
2010    RTEMS_SYSINIT_INITIAL_EXTENSIONS,
2011    RTEMS_SYSINIT_ORDER_MIDDLE
2012  );
[96e6a86c]2013#endif
2014
[d1f7204]2015#if defined(RTEMS_NEWLIB) && !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY)
2016struct _reent *__getreent(void)
2017{
2018  return _Thread_Get_executing()->libc_reent;
2019}
[9c9b62d8]2020#endif
[0451b44]2021
[08bae5e6]2022#endif
2023
[bfe6391]2024/**
2025 * @defgroup ConfigurationPOSIXAPI POSIX API Configuration Parameters
2026 *
2027 * This module contains the parameters related to configuration
2028 * of the POSIX API services.
[2eba45d]2029 */
[bfe6391]2030/**@{*/
[2eba45d]2031
[bfe6391]2032/**
2033 * This configuration parameter specifies the maximum number of
2034 * POSIX API keys.
2035 *
2036 * POSIX Keys are available whether or not the POSIX API is enabled.
2037 */
[e6c87f7]2038#ifndef CONFIGURE_MAXIMUM_POSIX_KEYS
[5c0c0cf]2039  #define CONFIGURE_MAXIMUM_POSIX_KEYS 0
2040#endif
2041
[07d71279]2042/*
[bfe6391]2043 * This macro is calculated to specify the memory required for
2044 * POSIX API key/value pairs.
2045 */
[5c0c0cf]2046#ifndef CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS
2047  #define CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS \
2048    (CONFIGURE_MAXIMUM_POSIX_KEYS * \
2049     (CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_TASKS))
[e6c87f7]2050#endif
[2eba45d]2051
[54f35888]2052/**
2053 * This configuration parameter specifies the maximum number of
2054 * POSIX API threads.
2055 */
2056#ifndef CONFIGURE_MAXIMUM_POSIX_THREADS
2057  #define CONFIGURE_MAXIMUM_POSIX_THREADS 0
2058#endif
2059
[9318cfb0]2060/*
2061 * Account for the object control structures plus the name
2062 * of the object to be duplicated.
2063 */
2064#define _Configure_POSIX_Named_Object_RAM(_number, _size) \
[0561cc1]2065  (rtems_resource_maximum_per_allocation(_number) \
[21275b58]2066    * _Configure_From_workspace(_POSIX_PATH_MAX + 1))
[9318cfb0]2067
[fe7aefd5]2068/**
2069 * This configuration parameter specifies the maximum number of
2070 * POSIX API message queues.
2071 */
2072#ifndef CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES
2073  #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES 0
2074#endif
2075
2076/*
2077 * This macro is calculated to specify the memory required for
2078 * POSIX API message queues.
2079 */
2080#define _CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES(_message_queues) \
2081  _Configure_POSIX_Named_Object_RAM( \
2082     _message_queues, sizeof(POSIX_Message_queue_Control) )
2083
[9318cfb0]2084/**
2085 * This configuration parameter specifies the maximum number of
2086 * POSIX API semaphores.
2087 */
2088#ifndef CONFIGURE_MAXIMUM_POSIX_SEMAPHORES
2089  #define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES 0
2090#endif
2091
2092/*
2093 * This macro is calculated to specify the memory required for
2094 * POSIX API semaphores.
2095 */
2096#define _CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES(_semaphores) \
2097  _Configure_POSIX_Named_Object_RAM( \
2098     _semaphores, sizeof(POSIX_Semaphore_Control) )
2099
[701057e0]2100/**
2101 * Configure the maximum number of POSIX shared memory objects.
2102 */
2103#ifndef CONFIGURE_MAXIMUM_POSIX_SHMS
2104  #define CONFIGURE_MAXIMUM_POSIX_SHMS 0
2105#endif
2106
2107/*
2108 * This macro is calculated to specify the memory required for
2109 * POSIX API shared memory.
2110 */
2111#define _CONFIGURE_MEMORY_FOR_POSIX_SHMS(_shms) \
2112  _Configure_POSIX_Named_Object_RAM(_shms, sizeof(POSIX_Shm_Control) )
2113
[21275b58]2114/**
2115 * This configuration parameter specifies the maximum number of
2116 * POSIX API timers.
[e6c87f7]2117 */
[21275b58]2118#ifndef CONFIGURE_MAXIMUM_POSIX_TIMERS
2119  #define CONFIGURE_MAXIMUM_POSIX_TIMERS 0
2120#endif
[5877cc3a]2121
[21275b58]2122#if !defined(RTEMS_POSIX_API) && CONFIGURE_MAXIMUM_POSIX_TIMERS != 0
2123  #error "CONFIGURE_MAXIMUM_POSIX_TIMERS must be zero if POSIX API is disabled"
2124#endif
[bfe6391]2125
[21275b58]2126/**
2127 * This configuration parameter specifies the maximum number of
2128 * POSIX API queued signals.
2129 */
2130#ifndef CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS
2131  #define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS 0
2132#endif
[0747e2d]2133
[21275b58]2134#if !defined(RTEMS_POSIX_API) && CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS != 0
2135  #error "CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS must be zero if POSIX API is disabled"
2136#endif
[bfe6391]2137
[21275b58]2138#if CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS > 0
2139  #define _CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS \
2140    _Configure_From_workspace( (CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS) * \
2141      sizeof( POSIX_signals_Siginfo_node ) )
2142#else
2143  #define _CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS 0
2144#endif
[eb0551f]2145
[54f35888]2146#ifdef CONFIGURE_POSIX_INIT_THREAD_TABLE
[3b4795b4]2147  #ifndef CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT
2148    #define CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT   POSIX_Init
2149  #endif
[8486081]2150
[3b4795b4]2151  #ifndef CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE
2152    #define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE \
2153      CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE
2154  #endif
[54f35888]2155#endif /* CONFIGURE_POSIX_INIT_THREAD_TABLE */
[352c9b2]2156
[bfe6391]2157/**
2158 * This configuration parameter specifies the stack size of the
2159 * POSIX API Initialization thread (if used).
2160 */
[5877cc3a]2161#ifndef CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE
2162  #define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE    0
[352c9b2]2163#endif
[bfe6391]2164/**@}*/  /* end of POSIX API Configuration */
[352c9b2]2165
[b4f635e]2166/**
[27f071cd]2167 * This is so we can account for tasks with stacks greater than minimum
2168 * size.  This is in bytes.
[b4f635e]2169 */
2170#ifndef CONFIGURE_EXTRA_TASK_STACKS
2171  #define CONFIGURE_EXTRA_TASK_STACKS 0
2172#endif
[5aecf664]2173
[3f1bf0c]2174/*
2175 * We must be able to split the free block used for the second last allocation
2176 * into two parts so that we have a free block for the last allocation.  See
2177 * _Heap_Block_split().
2178 */
[07d71279]2179#define _CONFIGURE_HEAP_HANDLER_OVERHEAD \
[ffe14b26]2180  _Configure_Align_up( HEAP_BLOCK_HEADER_SIZE, CPU_HEAP_ALIGNMENT )
[3f1bf0c]2181
[21275b58]2182/**
2183 * This calculates the amount of memory reserved for the IDLE tasks.
2184 * In an SMP system, each CPU core has its own idle task.
2185 */
2186#define _CONFIGURE_IDLE_TASKS_COUNT _CONFIGURE_MAXIMUM_PROCESSORS
2187
[8486081]2188/*
[3652ad35]2189 *  Calculate the RAM size based on the maximum number of objects configured.
2190 */
[08bae5e6]2191#ifndef CONFIGURE_EXECUTIVE_RAM_SIZE
[3652ad35]2192
[5877cc3a]2193/**
[27f071cd]2194 * The following macro is used to calculate the memory allocated by RTEMS
2195 * for the message buffers associated with a particular message queue.
2196 * There is a fixed amount of overhead per message.
[5877cc3a]2197 */
2198#define CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(_messages, _size) \
2199    _Configure_From_workspace( \
[b1b6f3b0]2200      (_messages) * (_Configure_Align_up(_size, sizeof(uintptr_t)) \
2201        + sizeof(CORE_message_queue_Buffer_control)))
[5877cc3a]2202
[07d71279]2203/*
[bfe6391]2204 * This macro is set to the amount of memory required for pending message
[27f071cd]2205 * buffers in bytes.  It should be constructed by adding together a
2206 * set of values determined by CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE.
[7042065]2207 */
2208#ifndef CONFIGURE_MESSAGE_BUFFER_MEMORY
[5877cc3a]2209  #define CONFIGURE_MESSAGE_BUFFER_MEMORY 0
[7042065]2210#endif
2211
[5877cc3a]2212/**
[27f071cd]2213 * This macro is available just in case the confdefs.h file underallocates
2214 * memory for a particular application.  This lets the user add some extra
2215 * memory in case something broken and underestimates.
[5877cc3a]2216 *
[27f071cd]2217 * It is also possible for cases where confdefs.h overallocates memory,
2218 * you could substract memory from the allocated.  The estimate is just
2219 * that, an estimate, and assumes worst case alignment and padding on
2220 * each allocated element.  So in some cases it could be too conservative.
[5877cc3a]2221 *
[27f071cd]2222 * NOTE: Historically this was used for message buffers.
[7042065]2223 */
2224#ifndef CONFIGURE_MEMORY_OVERHEAD
[5877cc3a]2225  #define CONFIGURE_MEMORY_OVERHEAD 0
2226#endif
2227
2228/**
[27f071cd]2229 * This calculates the memory required for the executive workspace.
[bfe6391]2230 *
2231 * This is an internal parameter.
[5877cc3a]2232 */
2233#define CONFIGURE_EXECUTIVE_RAM_SIZE \
[3f1bf0c]2234( \
[fe7aefd5]2235   _CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES( \
2236     CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES) + \
[9318cfb0]2237   _CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES( \
2238     CONFIGURE_MAXIMUM_POSIX_SEMAPHORES) + \
[701057e0]2239   _CONFIGURE_MEMORY_FOR_POSIX_SHMS( \
2240     CONFIGURE_MAXIMUM_POSIX_SHMS) + \
[21275b58]2241   _CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS + \
[7042065]2242   CONFIGURE_MESSAGE_BUFFER_MEMORY + \
[3f1bf0c]2243   (CONFIGURE_MEMORY_OVERHEAD * 1024) + \
[07d71279]2244   _CONFIGURE_HEAP_HANDLER_OVERHEAD \
[3f1bf0c]2245)
[b4f635e]2246
2247/*
2248 *  Now account for any extra memory that initialization tasks or threads
2249 *  may have requested.
2250 */
2251
[07d71279]2252/*
[27f071cd]2253 * This accounts for any extra memory required by the Classic API
2254 * Initialization Task.
[b4f635e]2255 */
2256#if (CONFIGURE_INIT_TASK_STACK_SIZE > CONFIGURE_MINIMUM_TASK_STACK_SIZE)
[07d71279]2257  #define _CONFIGURE_INITIALIZATION_THREADS_STACKS_CLASSIC_PART \
[b4f635e]2258      (CONFIGURE_INIT_TASK_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE)
2259#else
[07d71279]2260  #define _CONFIGURE_INITIALIZATION_THREADS_STACKS_CLASSIC_PART 0
[08bae5e6]2261#endif
2262
[07d71279]2263/*
[27f071cd]2264 * This accounts for any extra memory required by the POSIX API
2265 * Initialization Thread.
[b4f635e]2266 */
[54f35888]2267#if (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE > \
[b4f635e]2268      CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE)
[07d71279]2269  #define _CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART \
[b4f635e]2270    (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE - \
2271      CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE)
2272#else
[07d71279]2273  #define _CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART 0
[b4f635e]2274#endif
2275
[07d71279]2276/*
[27f071cd]2277 * This macro provides a summation of the various initialization task
2278 * and thread stack requirements.
[b4f635e]2279 */
[07d71279]2280#define _CONFIGURE_INITIALIZATION_THREADS_EXTRA_STACKS \
2281    (_CONFIGURE_INITIALIZATION_THREADS_STACKS_CLASSIC_PART + \
2282    _CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART)
[b4f635e]2283
[07d71279]2284/*
[bfe6391]2285 * This macro is calculated to specify the memory required for
2286 * the stacks of all tasks.
2287 */
[07d71279]2288#define _CONFIGURE_TASKS_STACK \
[0561cc1]2289  (rtems_resource_maximum_per_allocation( _CONFIGURE_TASKS ) * \
[9fa3cf0d]2290    _Configure_From_stackspace( CONFIGURE_MINIMUM_TASK_STACK_SIZE ) )
[b4f635e]2291
[07d71279]2292/*
[bfe6391]2293 * This macro is calculated to specify the memory required for
2294 * the stacks of all POSIX threads.
2295 */
[07d71279]2296#define _CONFIGURE_POSIX_THREADS_STACK \
[0561cc1]2297  (rtems_resource_maximum_per_allocation( CONFIGURE_MAXIMUM_POSIX_THREADS ) * \
[9fa3cf0d]2298    _Configure_From_stackspace( CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE ) )
[b4f635e]2299
2300#else /* CONFIGURE_EXECUTIVE_RAM_SIZE */
2301
[07d71279]2302#define _CONFIGURE_INITIALIZATION_THREADS_EXTRA_STACKS 0
2303#define _CONFIGURE_TASKS_STACK 0
2304#define _CONFIGURE_POSIX_THREADS_STACK 0
[b4f635e]2305
2306#if CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK != 0
2307  #error "CONFIGURE_EXECUTIVE_RAM_SIZE defined with request for CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK"
2308#endif
2309
2310#if CONFIGURE_EXTRA_TASK_STACKS != 0
2311  #error "CONFIGURE_EXECUTIVE_RAM_SIZE defined with request for CONFIGURE_EXTRA_TASK_STACKS"
2312#endif
2313
2314#endif /* CONFIGURE_EXECUTIVE_RAM_SIZE */
2315
[07d71279]2316/*
[bfe6391]2317 * This macro is calculated to specify the memory required for
2318 * all tasks and threads of all varieties.
2319 */
[07d71279]2320#define _CONFIGURE_STACK_SPACE_SIZE \
[b4f635e]2321  ( \
[07d71279]2322    _CONFIGURE_INITIALIZATION_THREADS_EXTRA_STACKS + \
2323    _CONFIGURE_TASKS_STACK + \
2324    _CONFIGURE_POSIX_THREADS_STACK + \
2325    _CONFIGURE_LIBBLOCK_TASK_EXTRA_STACKS + \
[3f1bf0c]2326    CONFIGURE_EXTRA_TASK_STACKS + \
[07d71279]2327    _CONFIGURE_HEAP_HANDLER_OVERHEAD \
[b4f635e]2328  )
2329
[da6ad56]2330#ifndef CONFIGURE_MAXIMUM_THREAD_NAME_SIZE
[5ee70c5]2331  #define CONFIGURE_MAXIMUM_THREAD_NAME_SIZE THREAD_DEFAULT_MAXIMUM_NAME_SIZE
[da6ad56]2332#endif
2333
[08bae5e6]2334#ifdef CONFIGURE_INIT
[5d6b211]2335  typedef union {
2336    Scheduler_Node Base;
2337    #ifdef CONFIGURE_SCHEDULER_CBS
2338      Scheduler_CBS_Node CBS;
2339    #endif
2340    #ifdef CONFIGURE_SCHEDULER_EDF
2341      Scheduler_EDF_Node EDF;
2342    #endif
[f3d9f228]2343    #ifdef CONFIGURE_SCHEDULER_EDF_SMP
2344      Scheduler_EDF_SMP_Node EDF_SMP;
2345    #endif
[5d6b211]2346    #ifdef CONFIGURE_SCHEDULER_PRIORITY
2347      Scheduler_priority_Node Priority;
2348    #endif
2349    #ifdef CONFIGURE_SCHEDULER_SIMPLE_SMP
2350      Scheduler_SMP_Node Simple_SMP;
2351    #endif
2352    #ifdef CONFIGURE_SCHEDULER_PRIORITY_SMP
2353      Scheduler_priority_SMP_Node Priority_SMP;
2354    #endif
2355    #ifdef CONFIGURE_SCHEDULER_PRIORITY_AFFINITY_SMP
2356      Scheduler_priority_affinity_SMP_Node Priority_affinity_SMP;
2357    #endif
2358    #ifdef CONFIGURE_SCHEDULER_STRONG_APA
2359      Scheduler_strong_APA_Node Strong_APA;
2360    #endif
2361    #ifdef CONFIGURE_SCHEDULER_USER_PER_THREAD
2362      CONFIGURE_SCHEDULER_USER_PER_THREAD User;
2363    #endif
2364  } Configuration_Scheduler_node;
2365
2366  #ifdef RTEMS_SMP
2367    const size_t _Scheduler_Node_size = sizeof( Configuration_Scheduler_node );
2368  #endif
2369
[da6ad56]2370  const size_t _Thread_Maximum_name_size = CONFIGURE_MAXIMUM_THREAD_NAME_SIZE;
2371
[21275b58]2372  struct Thread_Configured_control {
[69aa3349]2373    Thread_Control Control;
2374    #if CONFIGURE_MAXIMUM_USER_EXTENSIONS > 0
2375      void *extensions[ CONFIGURE_MAXIMUM_USER_EXTENSIONS + 1 ];
2376    #endif
[61d5c886]2377    Configuration_Scheduler_node Scheduler_nodes[ _CONFIGURE_SCHEDULER_COUNT ];
[69aa3349]2378    RTEMS_API_Control API_RTEMS;
2379    #ifdef RTEMS_POSIX_API
2380      POSIX_API_Control API_POSIX;
2381    #endif
[da6ad56]2382    #if CONFIGURE_MAXIMUM_THREAD_NAME_SIZE > 1
2383      char name[ CONFIGURE_MAXIMUM_THREAD_NAME_SIZE ];
2384    #endif
[69aa3349]2385    #if !defined(RTEMS_SCHEDSIM) \
2386      && defined(RTEMS_NEWLIB) \
2387      && !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY)
2388      struct _reent Newlib;
2389    #else
2390      struct { /* Empty */ } Newlib;
2391    #endif
[21275b58]2392  };
[69aa3349]2393
2394  const Thread_Control_add_on _Thread_Control_add_ons[] = {
2395    {
[21275b58]2396      offsetof( Thread_Configured_control, Control.Scheduler.nodes ),
2397      offsetof( Thread_Configured_control, Scheduler_nodes )
[69aa3349]2398    }, {
2399      offsetof(
[21275b58]2400        Thread_Configured_control,
[69aa3349]2401        Control.API_Extensions[ THREAD_API_RTEMS ]
2402      ),
[21275b58]2403      offsetof( Thread_Configured_control, API_RTEMS )
[69aa3349]2404    }, {
2405      offsetof(
[21275b58]2406        Thread_Configured_control,
[69aa3349]2407        Control.libc_reent
2408      ),
[21275b58]2409      offsetof( Thread_Configured_control, Newlib )
[69aa3349]2410    }
[da6ad56]2411    #if CONFIGURE_MAXIMUM_THREAD_NAME_SIZE > 1
2412      , {
2413        offsetof(
[21275b58]2414          Thread_Configured_control,
[da6ad56]2415          Control.Join_queue.Queue.name
2416        ),
[21275b58]2417        offsetof( Thread_Configured_control, name )
[da6ad56]2418      }
2419    #endif
[69aa3349]2420    #ifdef RTEMS_POSIX_API
2421      , {
2422        offsetof(
[21275b58]2423          Thread_Configured_control,
[69aa3349]2424          Control.API_Extensions[ THREAD_API_POSIX ]
2425        ),
[21275b58]2426        offsetof( Thread_Configured_control, API_POSIX )
[69aa3349]2427      }
2428    #endif
2429  };
2430
2431  const size_t _Thread_Control_add_on_count =
2432    RTEMS_ARRAY_SIZE( _Thread_Control_add_ons );
2433
[21275b58]2434  #if defined(RTEMS_SMP)
2435    struct Thread_queue_Configured_heads {
2436      Thread_queue_Heads Heads;
2437        Thread_queue_Priority_queue Priority[ _CONFIGURE_SCHEDULER_COUNT ];
2438    };
2439
2440    const size_t _Thread_queue_Heads_size =
2441      sizeof( Thread_queue_Configured_heads );
2442  #endif
2443
[32991495]2444  const size_t _Thread_Initial_thread_count =
[21275b58]2445    rtems_resource_maximum_per_allocation( _CONFIGURE_TASKS ) +
[88c198b]2446    rtems_resource_maximum_per_allocation( CONFIGURE_MAXIMUM_POSIX_THREADS );
[21275b58]2447
2448  THREAD_INFORMATION_DEFINE(
2449    _Thread,
2450    OBJECTS_INTERNAL_API,
2451    OBJECTS_INTERNAL_THREADS,
2452    _CONFIGURE_IDLE_TASKS_COUNT + _CONFIGURE_MPCI_RECEIVE_SERVER_COUNT
2453  );
2454
[32991495]2455  char _Thread_Idle_stacks[
2456    _CONFIGURE_IDLE_TASKS_COUNT
2457      * ( CONFIGURE_IDLE_TASK_STACK_SIZE
2458        + CPU_IDLE_TASK_IS_FP * CONTEXT_FP_SIZE )
2459  ] RTEMS_ALIGNED( CPU_INTERRUPT_STACK_ALIGNMENT )
2460  RTEMS_SECTION( ".rtemsstack.idle" );
2461
[b1b6dd71]2462  #if CONFIGURE_MAXIMUM_BARRIERS > 0
2463    BARRIER_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_BARRIERS );
[21275b58]2464  #endif
2465
2466  #if CONFIGURE_MAXIMUM_MESSAGE_QUEUES > 0
2467    MESSAGE_QUEUE_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_MESSAGE_QUEUES );
2468  #endif
2469
2470  #if CONFIGURE_MAXIMUM_PARTITIONS > 0
2471    PARTITION_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_PARTITIONS );
2472  #endif
2473
2474  #if CONFIGURE_MAXIMUM_PERIODS > 0
2475    RATE_MONOTONIC_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_PERIODS );
2476  #endif
2477
2478  #if CONFIGURE_MAXIMUM_PORTS > 0
2479    DUAL_PORTED_MEMORY_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_PORTS );
2480  #endif
2481
2482  #if CONFIGURE_MAXIMUM_REGIONS > 0
2483    REGION_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_REGIONS );
2484  #endif
2485
2486  #if CONFIGURE_MAXIMUM_SEMAPHORES > 0
[46865542]2487    SEMAPHORE_INFORMATION_DEFINE(
2488      CONFIGURE_MAXIMUM_SEMAPHORES,
2489      _CONFIGURE_SCHEDULER_COUNT
2490    );
[21275b58]2491  #endif
2492
[84aee2e9]2493  #if CONFIGURE_MAXIMUM_TIMERS > 0
2494    TIMER_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_TIMERS );
[21275b58]2495  #endif
2496
2497  #if _CONFIGURE_TASKS > 0
2498    THREAD_INFORMATION_DEFINE(
2499      _RTEMS_tasks,
2500      OBJECTS_CLASSIC_API,
2501      OBJECTS_RTEMS_TASKS,
2502      _CONFIGURE_TASKS
2503    );
2504  #endif
2505
2506  #if CONFIGURE_MAXIMUM_USER_EXTENSIONS > 0
2507    EXTENSION_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_USER_EXTENSIONS );
2508  #endif
2509
2510  #if CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS > 0
2511    POSIX_Keys_Key_value_pair _POSIX_Keys_Key_value_pairs[
2512      rtems_resource_maximum_per_allocation(
2513        CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS
2514      )
2515    ];
2516
2517    const uint32_t _POSIX_Keys_Key_value_pair_maximum =
2518      CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS;
2519  #endif
2520
[ba74ebde]2521  #if CONFIGURE_MAXIMUM_POSIX_KEYS > 0
2522    POSIX_KEYS_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_POSIX_KEYS );
[21275b58]2523  #endif
2524
[e97806a]2525  #if CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES > 0
[21275b58]2526    POSIX_MESSAGE_QUEUE_INFORMATION_DEFINE(
2527      CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES
2528    );
[e97806a]2529  #endif
2530
2531  #if CONFIGURE_MAXIMUM_POSIX_SEMAPHORES > 0
[21275b58]2532    POSIX_SEMAPHORE_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_POSIX_SEMAPHORES );
[e97806a]2533  #endif
2534
2535  #if CONFIGURE_MAXIMUM_POSIX_SHMS > 0
[21275b58]2536    POSIX_SHM_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_POSIX_SHMS );
[e97806a]2537  #endif
2538
[88c198b]2539  #if CONFIGURE_MAXIMUM_POSIX_THREADS > 0
[21275b58]2540    THREAD_INFORMATION_DEFINE(
2541      _POSIX_Threads,
2542      OBJECTS_POSIX_API,
2543      OBJECTS_POSIX_THREADS,
2544      CONFIGURE_MAXIMUM_POSIX_THREADS
2545    );
[e97806a]2546  #endif
2547
[5877cc3a]2548  #ifdef RTEMS_POSIX_API
[e97806a]2549    #if CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS > 0
[b0e335c2]2550      const uint32_t _POSIX_signals_Maximum_queued_signals =
[e97806a]2551        CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS;
[1bf2f16]2552
2553      POSIX_signals_Siginfo_node _POSIX_signals_Siginfo_nodes[
2554        CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS
2555      ];
[e97806a]2556    #endif
[fd27bae]2557
[e97806a]2558    #if CONFIGURE_MAXIMUM_POSIX_TIMERS > 0
[21275b58]2559      POSIX_TIMER_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_POSIX_TIMERS );
[e97806a]2560    #endif
[5877cc3a]2561  #endif
[2eba45d]2562
[e6a8410]2563  const size_t _POSIX_Threads_Minimum_stack_size =
[e97806a]2564    CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE;
2565
[6784547]2566  /**
[27f071cd]2567   * This variable specifies the minimum stack size for tasks in an RTEMS
2568   * application.
[ecf0f4c]2569   *
[27f071cd]2570   * NOTE: This is left as a simple uint32_t so it can be externed as
2571   *       needed without requring being high enough logical to
2572   *       include the full configuration table.
[ecf0f4c]2573   */
[28352fae]2574  uint32_t rtems_minimum_stack_size =
[ecf0f4c]2575    CONFIGURE_MINIMUM_TASK_STACK_SIZE;
2576
[f4dbf37d]2577  const uintptr_t _Stack_Space_size = _CONFIGURE_STACK_SPACE_SIZE;
2578
[00c7ad4]2579  #if defined(CONFIGURE_TASK_STACK_ALLOCATOR) \
2580    && defined(CONFIGURE_TASK_STACK_DEALLOCATOR)
2581    #ifdef CONFIGURE_TASK_STACK_ALLOCATOR_AVOIDS_WORK_SPACE
2582      const bool _Stack_Allocator_avoids_workspace = true;
2583    #else
2584      const bool _Stack_Allocator_avoids_workspace = false;
2585    #endif
2586
2587    #ifdef CONFIGURE_TASK_STACK_ALLOCATOR_INIT
2588      const Stack_Allocator_initialize _Stack_Allocator_initialize =
2589        CONFIGURE_TASK_STACK_ALLOCATOR_INIT;
2590    #else
2591      const Stack_Allocator_initialize _Stack_Allocator_initialize = NULL;
2592    #endif
2593
2594    const Stack_Allocator_allocate _Stack_Allocator_allocate =
2595      CONFIGURE_TASK_STACK_ALLOCATOR;
2596
2597    const Stack_Allocator_free _Stack_Allocator_free =
2598      CONFIGURE_TASK_STACK_DEALLOCATOR;
2599  #elif defined(CONFIGURE_TASK_STACK_ALLOCATOR) \
2600    || defined(CONFIGURE_TASK_STACK_DEALLOCATOR)
2601    #error "CONFIGURE_TASK_STACK_ALLOCATOR and CONFIGURE_TASK_STACK_DEALLOCATOR must be both defined or both undefined"
2602  #endif
2603
[ba46b936]2604  #ifdef RTEMS_SMP
[567455b6]2605    const uint32_t _SMP_Processor_configured_maximum =
2606      _CONFIGURE_MAXIMUM_PROCESSORS;
2607  #endif
2608
[ba7b2df7]2609  const uintptr_t _Workspace_Size = CONFIGURE_EXECUTIVE_RAM_SIZE;
2610
[ad85c00]2611  #ifdef CONFIGURE_UNIFIED_WORK_AREAS
2612    const bool _Workspace_Is_unified = true;
2613  #endif
2614
[2d07ce6]2615  #ifdef CONFIGURE_DIRTY_MEMORY
2616    RTEMS_SYSINIT_ITEM(
2617      _Memory_Dirty_free_areas,
2618      RTEMS_SYSINIT_DIRTY_MEMORY,
2619      RTEMS_SYSINIT_ORDER_MIDDLE
2620    );
2621  #endif
2622
[8ecbc38]2623  #ifdef CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY
2624    const bool _Memory_Zero_before_use = true;
2625
2626    RTEMS_SYSINIT_ITEM(
2627      _Memory_Zero_free_areas,
2628      RTEMS_SYSINIT_ZERO_MEMORY,
2629      RTEMS_SYSINIT_ORDER_MIDDLE
2630    );
2631  #endif
2632
[dca6184]2633  #if CONFIGURE_RECORD_PER_PROCESSOR_ITEMS > 0
2634    #if (CONFIGURE_RECORD_PER_PROCESSOR_ITEMS & (CONFIGURE_RECORD_PER_PROCESSOR_ITEMS - 1)) != 0
2635      #error "CONFIGURE_RECORD_PER_PROCESSOR_ITEMS must be a power of two"
2636    #endif
2637
2638    #if CONFIGURE_RECORD_PER_PROCESSOR_ITEMS < 16
2639      #error "CONFIGURE_RECORD_PER_PROCESSOR_ITEMS must be at least 16"
2640    #endif
2641
[a2684c2b]2642    typedef struct {
[11f196d6]2643      Record_Control    Control;
[dca6184]2644      rtems_record_item Items[ CONFIGURE_RECORD_PER_PROCESSOR_ITEMS ];
[a2684c2b]2645    } Record_Configured_control;
[dca6184]2646
[a2684c2b]2647    static Record_Configured_control _Record_Controls[ _CONFIGURE_MAXIMUM_PROCESSORS ];
2648
2649    const Record_Configuration _Record_Configuration = {
2650      CONFIGURE_RECORD_PER_PROCESSOR_ITEMS,
2651      &_Record_Controls[ 0 ].Control
2652    };
[dca6184]2653
2654    RTEMS_SYSINIT_ITEM(
2655      _Record_Initialize,
2656      RTEMS_SYSINIT_RECORD,
2657      RTEMS_SYSINIT_ORDER_MIDDLE
2658    );
2659  #endif
[e44ae80]2660
2661  #ifdef CONFIGURE_VERBOSE_SYSTEM_INITIALIZATION
2662    RTEMS_SYSINIT_ITEM(
2663      _Sysinit_Verbose,
2664      RTEMS_SYSINIT_RECORD,
2665      RTEMS_SYSINIT_ORDER_LAST
2666    );
2667  #endif
[08bae5e6]2668#endif
2669
[06dcaf0]2670#if defined(RTEMS_SMP)
2671 /*
2672  * Instantiate the Per CPU information based upon the user configuration.
2673  */
2674 #if defined(CONFIGURE_INIT)
[334e1d2]2675   Per_CPU_Control_envelope _Per_CPU_Information[_CONFIGURE_MAXIMUM_PROCESSORS];
[06dcaf0]2676 #endif
2677
2678#endif
2679
[0ab34c90]2680/*
2681 *  If the user has configured a set of Classic API Initialization Tasks,
2682 *  then we need to install the code that runs that loop.
2683 */
2684#ifdef CONFIGURE_INIT
[6b0873f]2685  #if defined(CONFIGURE_RTEMS_INIT_TASKS_TABLE)
[9520ec3]2686    const rtems_initialization_tasks_table _RTEMS_tasks_User_task_table = {
2687      CONFIGURE_INIT_TASK_NAME,
2688      CONFIGURE_INIT_TASK_STACK_SIZE,
2689      CONFIGURE_INIT_TASK_PRIORITY,
2690      CONFIGURE_INIT_TASK_ATTRIBUTES,
2691      CONFIGURE_INIT_TASK_ENTRY_POINT,
2692      CONFIGURE_INIT_TASK_INITIAL_MODES,
2693      CONFIGURE_INIT_TASK_ARGUMENTS
2694    };
2695
[1ff8eca]2696    RTEMS_SYSINIT_ITEM(
[9520ec3]2697      _RTEMS_tasks_Initialize_user_task,
[1ff8eca]2698      RTEMS_SYSINIT_CLASSIC_USER_TASKS,
2699      RTEMS_SYSINIT_ORDER_MIDDLE
2700    );
[0ab34c90]2701  #endif
2702#endif
2703
2704/*
2705 *  If the user has configured a set of POSIX Initialization Threads,
2706 *  then we need to install the code that runs that loop.
2707 */
[54f35888]2708#ifdef CONFIGURE_INIT
[3b4795b4]2709  #if defined(CONFIGURE_POSIX_INIT_THREAD_TABLE)
2710    const posix_initialization_threads_table _POSIX_Threads_User_thread_table = {
2711      CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT,
2712      CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE
2713    };
[54f35888]2714
2715    RTEMS_SYSINIT_ITEM(
[3b4795b4]2716      _POSIX_Threads_Initialize_user_thread,
[54f35888]2717      RTEMS_SYSINIT_POSIX_USER_THREADS,
2718      RTEMS_SYSINIT_ORDER_MIDDLE
2719    );
[0ab34c90]2720  #endif
2721#endif
2722
[a31845f7]2723/*
2724 *  Select PCI Configuration Library
2725 */
2726#ifdef RTEMS_PCI_CONFIG_LIB
2727  #ifdef CONFIGURE_INIT
2728    #define PCI_LIB_NONE 0
2729    #define PCI_LIB_AUTO 1
2730    #define PCI_LIB_STATIC 2
2731    #define PCI_LIB_READ 3
2732    #define PCI_LIB_PERIPHERAL 4
2733    #if CONFIGURE_PCI_LIB == PCI_LIB_AUTO
2734      #define PCI_CFG_AUTO_LIB
2735      #include <pci/cfg.h>
2736      struct pci_bus pci_hb;
2737      #define PCI_LIB_INIT pci_config_auto
2738      #define PCI_LIB_CONFIG pci_config_auto_register
2739    #elif CONFIGURE_PCI_LIB == PCI_LIB_STATIC
2740      #define PCI_CFG_STATIC_LIB
2741      #include <pci/cfg.h>
2742      #define PCI_LIB_INIT pci_config_static
2743      #define PCI_LIB_CONFIG NULL
2744      /* Let user define PCI configuration (struct pci_bus pci_hb) */
2745    #elif CONFIGURE_PCI_LIB == PCI_LIB_READ
2746      #define PCI_CFG_READ_LIB
2747      #include <pci/cfg.h>
2748      #define PCI_LIB_INIT pci_config_read
2749      #define PCI_LIB_CONFIG NULL
2750      struct pci_bus pci_hb;
2751    #elif CONFIGURE_PCI_LIB == PCI_LIB_PERIPHERAL
2752      #define PCI_LIB_INIT pci_config_peripheral
2753      #define PCI_LIB_CONFIG NULL
2754      /* Let user define PCI configuration (struct pci_bus pci_hb) */
2755    #elif CONFIGURE_PCI_LIB == PCI_LIB_NONE
2756      #define PCI_LIB_INIT NULL
2757      #define PCI_LIB_CONFIG NULL
2758      /* No PCI Configuration at all, user can use/debug access routines */
2759    #else
2760      #error NO PCI LIBRARY DEFINED
2761    #endif
2762
2763    const int pci_config_lib_type = CONFIGURE_PCI_LIB;
2764    int (*pci_config_lib_init)(void) = PCI_LIB_INIT;
2765    void (*pci_config_lib_register)(void *config) = PCI_LIB_CONFIG;
2766  #endif
2767#endif
2768
[08bae5e6]2769#ifdef __cplusplus
2770}
2771#endif
[8486081]2772
[df0bfdf]2773/******************************************************************
2774 ******************************************************************
2775 ******************************************************************
2776 *         CONFIGURATION WARNINGS AND ERROR CHECKING              *
2777 ******************************************************************
2778 ******************************************************************
2779 ******************************************************************
[df49c60]2780 */
2781
2782/*
[80f9d77]2783 *  Make sure a task/thread of some sort is configured.
2784 *
2785 *  When analyzing RTEMS to find the smallest possible of memory
2786 *  that must be allocated, you probably do want to configure 0
2787 *  tasks/threads so there is a smaller set of calls to _Workspace_Allocate
2788 *  to analyze.
2789 */
[88c198b]2790#if !defined(CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION) \
2791  && CONFIGURE_MAXIMUM_TASKS == 0 \
2792  && CONFIGURE_MAXIMUM_POSIX_THREADS == 0
2793  #error "CONFIGURATION ERROR: No tasks or threads configured!!"
[df49c60]2794#endif
2795
[5aecf664]2796#ifndef RTEMS_SCHEDSIM
[df49c60]2797/*
2798 *  Make sure at least one of the initialization task/thread
2799 *  tables was defined.
2800 */
2801#if !defined(CONFIGURE_RTEMS_INIT_TASKS_TABLE) && \
2802    !defined(CONFIGURE_POSIX_INIT_THREAD_TABLE) && \
[80f9d77]2803    !defined(CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION)
[168ba07]2804#error "CONFIGURATION ERROR: No initialization tasks or threads configured!!"
[df49c60]2805#endif
[5aecf664]2806#endif
[df49c60]2807
[df0bfdf]2808/*
2809 *  If the user is trying to configure a multiprocessing application and
2810 *  RTEMS was not configured and built multiprocessing, then error out.
2811 */
2812#if defined(CONFIGURE_MP_APPLICATION) && \
2813    !defined(RTEMS_MULTIPROCESSING)
2814#error "CONFIGURATION ERROR: RTEMS not configured for multiprocessing!!"
2815#endif
2816
[6784547]2817#if !defined(RTEMS_SCHEDSIM)
[e6f2b54]2818/*
2819 *  You must either explicitly include or exclude the clock driver.
2820 *  It is such a common newbie error to leave it out.  Maybe this
2821 *  will put an end to it.
2822 *
2823 *  NOTE: If you are using the timer driver, it is considered
2824 *        mutually exclusive with the clock driver because the
2825 *        drivers are assumed to use the same "timer" hardware
2826 *        on many boards.
2827 */
2828#if !defined(CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER) && \
2829    !defined(CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER) && \
2830    !defined(CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER)
2831  #error "CONFIGURATION ERROR: Do you want the clock driver or not?!?"
2832 #endif
[6784547]2833
[e6f2b54]2834/*
2835 * Only one of the following three configuration parameters should be
2836 * defined at a time.
2837 */
2838#if ((defined(CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER) + \
2839      defined(CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER) + \
2840      defined(CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER)) > 1)
2841   #error "CONFIGURATION ERROR: More than one clock/timer driver configuration parameter specified?!?"
2842#endif
[6784547]2843#endif   /* !defined(RTEMS_SCHEDSIM) */
[df0bfdf]2844
[0ab34c90]2845/*
2846 *  These names have been obsoleted so make the user application stop compiling
2847 */
2848#if defined(CONFIGURE_TEST_NEEDS_TIMER_DRIVER) || \
2849    defined(CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER) || \
2850    defined(CONFIGURE_TEST_NEEDS_CLOCK_DRIVER) || \
2851    defined(CONFIGURE_TEST_NEEDS_RTC_DRIVER) || \
2852    defined(CONFIGURE_TEST_NEEDS_STUB_DRIVER)
2853#error "CONFIGURATION ERROR: CONFIGURE_TEST_XXX constants are obsolete"
2854#endif
2855
[80f9d77]2856/*
2857 *  Validate the configured maximum priority
2858 */
2859#if ((CONFIGURE_MAXIMUM_PRIORITY != 3) && \
2860     (CONFIGURE_MAXIMUM_PRIORITY != 7) && \
2861     (CONFIGURE_MAXIMUM_PRIORITY != 15) && \
2862     (CONFIGURE_MAXIMUM_PRIORITY != 31) && \
2863     (CONFIGURE_MAXIMUM_PRIORITY != 63) && \
2864     (CONFIGURE_MAXIMUM_PRIORITY != 127) && \
2865     (CONFIGURE_MAXIMUM_PRIORITY != 255))
2866  #error "Maximum priority is not 1 less than a power of 2 between 4 and 256"
2867#endif
[28352fae]2868
[80f9d77]2869#if (CONFIGURE_MAXIMUM_PRIORITY > PRIORITY_DEFAULT_MAXIMUM)
2870  #error "Maximum priority configured higher than supported by target."
2871#endif
2872
[68f339b6]2873#ifdef CONFIGURE_HAS_OWN_CONFIGURATION_TABLE
2874  #warning "The CONFIGURE_HAS_OWN_CONFIGURATION_TABLE configuration option is obsolete since RTEMS 5.1"
2875#endif
2876
[e6f2b54]2877#ifdef CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE
2878  #warning "The CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE configuration option is obsolete since RTEMS 5.1"
2879#endif
2880
[bd5cec41]2881#ifdef CONFIGURE_HAS_OWN_FILESYSTEM_TABLE
2882  #warning "The CONFIGURE_HAS_OWN_FILESYSTEM_TABLE configuration option is obsolete since RTEMS 5.1"
2883#endif
2884
[6b0873f]2885#ifdef CONFIGURE_HAS_OWN_INIT_TABLE
2886  #warning "The CONFIGURE_HAS_OWN_INIT_TABLE configuration option is obsolete since RTEMS 5.1"
2887#endif
2888
[5fa0a1f6]2889#ifdef CONFIGURE_HAS_OWN_MOUNT_TABLE
2890  #warning "The CONFIGURE_HAS_OWN_MOUNT_TABLE configuration option is obsolete since RTEMS 5.1"
2891#endif
2892
[d24b301]2893#ifdef CONFIGURE_HAS_OWN_MULTIPROCESSING_TABLE
2894  #warning "The CONFIGURE_HAS_OWN_MOUNT_TABLE configuration option is obsolete since RTEMS 5.1"
2895#endif
2896
[53b6484]2897#ifdef CONFIGURE_NUMBER_OF_TERMIOS_PORTS
2898  #warning "The CONFIGURE_NUMBER_OF_TERMIOS_PORTS configuration option is obsolete since RTEMS 5.1"
[2c12262]2899#endif
2900
[88c198b]2901#ifdef CONFIGURE_MAXIMUM_ADA_TASKS
2902  #warning "The CONFIGURE_MAXIMUM_ADA_TASKS configuration option is obsolete since RTEMS 5.1"
2903#endif
2904
2905#ifdef CONFIGURE_MAXIMUM_FAKE_ADA_TASKS
2906  #warning "The CONFIGURE_MAXIMUM_FAKE_ADA_TASKS configuration option is obsolete since RTEMS 5.1"
2907#endif
2908
[46865542]2909#ifdef CONFIGURE_MAXIMUM_MRSP_SEMAPHORES
2910  #warning "The CONFIGURE_MAXIMUM_MRSP_SEMAPHORES configuration option is obsolete since RTEMS 5.1"
2911#endif
2912
[9c0cefb]2913#ifdef CONFIGURE_MAXIMUM_POSIX_BARRIERS
[9526b034]2914  #warning "The CONFIGURE_MAXIMUM_POSIX_BARRIERS configuration option is obsolete since RTEMS 5.1"
[9c0cefb]2915#endif
2916
2917#ifdef CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES
[9526b034]2918  #warning "The CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES configuration option is obsolete since RTEMS 5.1"
[9c0cefb]2919#endif
2920
[c8982e5]2921#ifdef CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS
[9526b034]2922  #warning "The CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS configuration option is obsolete since RTEMS 5.1"
[9c0cefb]2923#endif
2924
2925#ifdef CONFIGURE_MAXIMUM_POSIX_MUTEXES
[9526b034]2926  #warning "The CONFIGURE_MAXIMUM_POSIX_MUTEXES configuration option is obsolete since RTEMS 5.1"
[9c0cefb]2927#endif
2928
2929#ifdef CONFIGURE_MAXIMUM_POSIX_RWLOCKS
[9526b034]2930  #warning "The CONFIGURE_MAXIMUM_POSIX_RWLOCKS configuration option is obsolete since RTEMS 5.1"
[9c0cefb]2931#endif
2932
2933#ifdef CONFIGURE_MAXIMUM_POSIX_SPINLOCKS
[9526b034]2934  #warning "The CONFIGURE_MAXIMUM_POSIX_SPINLOCKS configuration option is obsolete since RTEMS 5.1"
[ade17392]2935#endif
2936
[a346ebba]2937#ifdef CONFIGURE_MAXIMUM_PTYS
2938  #warning "The CONFIGURE_MAXIMUM_PTYS configuration option is obsolete since RTEMS 5.1"
2939#endif
2940
[3b4795b4]2941#ifdef CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE
2942  #warning "The CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE configuration option is obsolete since RTEMS 5.1"
2943#endif
2944
[53b6484]2945#ifdef CONFIGURE_TERMIOS_DISABLED
2946  #warning "The CONFIGURE_TERMIOS_DISABLED configuration option is obsolete since RTEMS 5.1"
2947#endif
2948
[b5c9064]2949/*
2950 * POSIX Key pair shouldn't be less than POSIX Key, which is highly
2951 * likely to be error.
2952 */
[e6c87f7]2953#if (CONFIGURE_MAXIMUM_POSIX_KEYS != 0) && \
2954    (CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS != 0)
2955  #if (CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS < CONFIGURE_MAXIMUM_POSIX_KEYS)
2956    #error "Fewer POSIX Key pairs than POSIX Key!"
2957  #endif
[b5c9064]2958#endif
2959
[69be1a22]2960/*
2961 * IMFS block size for in memory files (memfiles) must be a power of
2962 * two between 16 and 512 inclusive.
2963 */
2964#if ((CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK != 16) && \
2965     (CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK != 32) && \
2966     (CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK != 64) && \
2967     (CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK != 128) && \
2968     (CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK != 256) && \
2969     (CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK != 512))
2970  #error "IMFS Memfile block size must be a power of 2 between 16 and 512"
2971#endif
2972
[369bf2c4]2973#ifdef CONFIGURE_ENABLE_GO
2974  #warning "The CONFIGURE_ENABLE_GO configuration option is obsolete since RTEMS 5.1"
2975#endif
2976
[88c198b]2977#ifdef CONFIGURE_GNAT_RTEMS
2978  #warning "The CONFIGURE_GNAT_RTEMS configuration option is obsolete since RTEMS 5.1"
2979#endif
2980
[369bf2c4]2981#ifdef CONFIGURE_MAXIMUM_GOROUTINES
2982  #warning "The CONFIGURE_MAXIMUM_GOROUTINES configuration option is obsolete since RTEMS 5.1"
2983#endif
2984
2985#ifdef CONFIGURE_MAXIMUM_GO_CHANNELS
2986  #warning "The CONFIGURE_MAXIMUM_GO_CHANNELS configuration option is obsolete since RTEMS 5.1"
2987#endif
[69be1a22]2988
[08bae5e6]2989#endif
2990/* end of include file */
Note: See TracBrowser for help on using the repository browser.