source: rtems/cpukit/sapi/include/confdefs.h @ 249766c5

4.115
Last change on this file since 249766c5 was 249766c5, checked in by Sebastian Huber <sebastian.huber@…>, on 02/13/15 at 20:26:17

IMFS: Rename CONFIGURE_IMFS_DISABLE_FCHMOD

Rename CONFIGURE_IMFS_DISABLE_FCHMOD to CONFIGURE_IMFS_DISABLE_CHMOD.

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