source: rtems/cpukit/sapi/include/confdefs.h @ 0282e83

4.115
Last change on this file since 0282e83 was 3c96bee, checked in by Sebastian Huber <sebastian.huber@…>, on 09/12/13 at 13:32:07

JFFS2: Add RTEMS support

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