source: rtems/cpukit/sapi/include/confdefs.h @ 22c28282

4.11
Last change on this file since 22c28282 was 22c28282, checked in by Joel Sherrill <joel.sherrill@…>, on Feb 21, 2011 at 5:00:51 PM

2011-02-21 Joel Sherrill <joel.sherrill@…>

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