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

5
Last change on this file since c232b37 was c232b37, checked in by Joel Sherrill <joel@…>, on 02/19/18 at 19:05:57

confdefs.h: Minor rework to avoid warnings when CONFIGURE_HAS_OWN_INIT_TABLE

CONFIGURE_HAS_OWN_INIT_TABLE was used both with and without
defining CONFIGURE_RTEMS_INIT_TASKS_TABLE. This rework allows
it to work both ways without warnings.

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