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

5
Last change on this file since e85f168 was e85f168, checked in by Sebastian Huber <sebastian.huber@…>, on 02/13/20 at 15:56:20

config: Remove unused configuration constant

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