source: rtems/cpukit/sapi/include/confdefs.h @ 599d71f

5
Last change on this file since 599d71f was d5154d0f, checked in by Aun-Ali Zaidi <admin@…>, on 12/23/15 at 20:44:02

api: Remove deprecated Notepads

Notepads where a feature of RTEMS' tasks that simply functioned in
the same way as POSIX keys or threaded local storage (TLS). They were
introduced well before per task variables, which are also deprecated,
and were barely used in favor of their POSIX alternatives.

In addition to their scarce usage, Notepads took up unnecessary memory.
For each task:

  • 16 32-bit integers were allocated.
  • A total of 64 bytes per task per thread.

This is especially critical in low memory and safety-critical applications.

They are also defined as uint32_t, and therefore are not guaranteed to
hold a pointer.

Lastly, they are not portable solutions for SMP and uniprocessor systems,
like POSIX keys and TLS.

updates #2493.

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