source: rtems/cpukit/include/rtems/confdefs.h @ 72a4a42

5
Last change on this file since 72a4a42 was 72a4a42, checked in by Sebastian Huber <sebastian.huber@…>, on 11/08/18 at 09:19:39

rtems: Move internal structures to dpmemdata.h

Update #3598.

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