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

4.115
Last change on this file since c236082 was c236082, checked in by Sebastian Huber <sebastian.huber@…>, on 07/30/13 at 13:54:53

smp: Provide cache optimized Per_CPU_Control

Delete _Per_CPU_Information_p.

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