source: rtems/cpukit/sapi/include/confdefs.h @ 34487537

5
Last change on this file since 34487537 was 34487537, checked in by Sebastian Huber <sebastian.huber@…>, on 07/04/17 at 07:57:30

score: Add simple affinity support to EDF SMP

Update #3059.

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