source: rtems/cpukit/sapi/include/confdefs.h @ 3995e6d

Last change on this file since 3995e6d was 3995e6d, checked in by Sebastian Huber <sebastian.huber@…>, on Sep 2, 2015 at 9:58:54 AM

score: Implement SMP-specific priority queue

  • Property mode set to 100644
File size: 119.8 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   * Classic API notepads are a deprecated feature and will be removed
2090   * in a future release of RTEMS. Warn the user who uses them.
2091   */
2092  #if defined(CONFIGURE_DISABLE_CLASSIC_API_NOTEPADS)
2093    #warning "Classic API Notepads are deprecated and will be removed."
2094  #endif
2095  #if defined(CONFIGURE_ENABLE_CLASSIC_API_NOTEPADS)
2096    #warning "Classic API Notepads are deprecated and will be removed."
2097  #endif
2098
2099  /** This configuration parameter enables/disables Classic API notepads. */
2100  #ifdef CONFIGURE_ENABLE_CLASSIC_API_NOTEPADS
2101    #define CONFIGURE_NOTEPADS_ENABLED           TRUE
2102  #else
2103    #define CONFIGURE_NOTEPADS_ENABLED           FALSE
2104  #endif
2105
2106  /**
2107   * This macro calculates the memory required for task variables.
2108   *
2109   * @deprecated Task variables are deprecated.
2110   *
2111   * Each task variable is individually allocated from the Workspace.
2112   * Hence, we do the multiplication on the configured size.
2113   *
2114   * @note Per-task variables are disabled for SMP configurations.
2115   */
2116  #if defined(RTEMS_SMP)
2117    #ifdef CONFIGURE_MAXIMUM_TASK_VARIABLES
2118      #warning "Per-Task Variables are deprecated and will be removed."
2119      #error "Per-Task Variables are not safe for SMP systems and disabled."
2120    #endif
2121    #define CONFIGURE_MAXIMUM_TASK_VARIABLES                     0
2122    #define CONFIGURE_MEMORY_FOR_TASK_VARIABLES(_task_variables) 0
2123  #else
2124    #ifndef CONFIGURE_MAXIMUM_TASK_VARIABLES
2125      /** This macro specifies the maximum number of task variables. */
2126      #define CONFIGURE_MAXIMUM_TASK_VARIABLES                     0
2127      /**
2128       * This macro is calculated to specify the memory required for task
2129       * variables.
2130       *
2131       * This is an internal parameter.
2132       */
2133      #define CONFIGURE_MEMORY_FOR_TASK_VARIABLES(_task_variables) 0
2134    #else
2135      #warning "Per-Task Variables are deprecated and will be removed."
2136      #define CONFIGURE_MEMORY_FOR_TASK_VARIABLES(_task_variables) \
2137        (_task_variables) * \
2138           _Configure_From_workspace(sizeof(rtems_task_variable_t))
2139    #endif
2140  #endif
2141
2142  #ifndef CONFIGURE_MAXIMUM_TIMERS
2143    /** This specifies the maximum number of Classic API timers. */
2144    #define CONFIGURE_MAXIMUM_TIMERS             0
2145    /**
2146     * This macro is calculated to specify the memory required for
2147     * Classic API timers.
2148     *
2149     * This is an internal parameter.
2150     */
2151    #define CONFIGURE_MEMORY_FOR_TIMERS(_timers) 0
2152  #else
2153    #define CONFIGURE_MEMORY_FOR_TIMERS(_timers) \
2154      _Configure_Object_RAM(_timers, sizeof(Timer_Control) )
2155  #endif
2156
2157  #ifndef CONFIGURE_MAXIMUM_SEMAPHORES
2158    /** This specifies the maximum number of Classic API semaphores. */
2159    #define CONFIGURE_MAXIMUM_SEMAPHORES                 0
2160  #endif
2161
2162  /**
2163   * This specifies the number of Classic API semaphores required
2164   *
2165   * This is an internal parameter.
2166   */
2167  #ifdef RTEMS_NETWORKING
2168    #define CONFIGURE_NETWORKING_SEMAPHORES 1
2169  #else
2170    #define CONFIGURE_NETWORKING_SEMAPHORES 0
2171  #endif
2172
2173  /**
2174   * This macro is calculated to specify the number of Classic API
2175   * semaphores required by the application and configured RTEMS
2176   * capabilities.
2177   *
2178   * This is an internal parameter.
2179   */
2180  #define CONFIGURE_SEMAPHORES \
2181    (CONFIGURE_MAXIMUM_SEMAPHORES + CONFIGURE_LIBIO_SEMAPHORES + \
2182      CONFIGURE_TERMIOS_SEMAPHORES + CONFIGURE_LIBBLOCK_SEMAPHORES + \
2183      CONFIGURE_SEMAPHORES_FOR_FILE_SYSTEMS + \
2184      CONFIGURE_NETWORKING_SEMAPHORES + CONFIGURE_DRVMGR_SEMAPHORES)
2185
2186  /**
2187   * This macro is calculated to specify the memory required for
2188   * Classic API Semaphores using MRSP. This is only available in
2189   * SMP configurations.
2190   *
2191   * This is an internal parameter.
2192   */
2193  #if !defined(RTEMS_SMP) || \
2194    !defined(CONFIGURE_MAXIMUM_MRSP_SEMAPHORES)
2195    #define CONFIGURE_MEMORY_FOR_MRSP_SEMAPHORES 0
2196  #else
2197    #define CONFIGURE_MEMORY_FOR_MRSP_SEMAPHORES \
2198      CONFIGURE_MAXIMUM_MRSP_SEMAPHORES * \
2199        _Configure_From_workspace( \
2200          RTEMS_ARRAY_SIZE(_Scheduler_Table) * sizeof(Priority_Control) \
2201        )
2202  #endif
2203
2204  /**
2205   * This macro is calculated to specify the memory required for
2206   * Classic API Semaphores.
2207   *
2208   * If there are no user or support semaphores defined, then we can assume
2209   * that no memory need be allocated at all for semaphores.
2210   *
2211   * This is an internal parameter.
2212   */
2213  #if CONFIGURE_SEMAPHORES == 0
2214    #define CONFIGURE_MEMORY_FOR_SEMAPHORES(_semaphores) 0
2215  #else
2216    #define CONFIGURE_MEMORY_FOR_SEMAPHORES(_semaphores) \
2217      _Configure_Object_RAM(_semaphores, sizeof(Semaphore_Control) ) + \
2218        CONFIGURE_MEMORY_FOR_MRSP_SEMAPHORES
2219  #endif
2220
2221  #ifndef CONFIGURE_MAXIMUM_MESSAGE_QUEUES
2222    /**
2223     * This configuration parameter specifies the maximum number of
2224     * Classic API Message Queues.
2225     */
2226    #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES             0
2227    /**
2228     * This macro is calculated to specify the RTEMS Workspace required for
2229     * the Classic API Message Queues.
2230     *
2231     * This is an internal parameter.
2232     */
2233    #define CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(_queues) 0
2234  #else
2235    #define CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(_queues) \
2236      _Configure_Object_RAM(_queues, sizeof(Message_queue_Control) )
2237  #endif
2238
2239  #ifndef CONFIGURE_MAXIMUM_PARTITIONS
2240    /**
2241     * This configuration parameter specifies the maximum number of
2242     * Classic API Partitions.
2243     */
2244    #define CONFIGURE_MAXIMUM_PARTITIONS                 0
2245    /**
2246     * This macro is calculated to specify the memory required for
2247     * Classic API
2248     *
2249     * This is an internal parameter.
2250     */
2251    #define CONFIGURE_MEMORY_FOR_PARTITIONS(_partitions) 0
2252  #else
2253    #define CONFIGURE_MEMORY_FOR_PARTITIONS(_partitions) \
2254      _Configure_Object_RAM(_partitions, sizeof(Partition_Control) )
2255  #endif
2256
2257  #ifndef CONFIGURE_MAXIMUM_REGIONS
2258    /**
2259     * This configuration parameter specifies the maximum number of
2260     * Classic API Regions.
2261     */
2262    #define CONFIGURE_MAXIMUM_REGIONS              0
2263    /**
2264     * This macro is calculated to specify the memory required for
2265     * Classic API Regions.
2266     *
2267     * This is an internal parameter.
2268     */
2269    #define CONFIGURE_MEMORY_FOR_REGIONS(_regions) 0
2270  #else
2271    #define CONFIGURE_MEMORY_FOR_REGIONS(_regions) \
2272      _Configure_Object_RAM(_regions, sizeof(Region_Control) )
2273  #endif
2274
2275  #ifndef CONFIGURE_MAXIMUM_PORTS
2276    /**
2277     * This configuration parameter specifies the maximum number of
2278     * Classic API Dual-Ported Memory Ports.
2279     */
2280    #define CONFIGURE_MAXIMUM_PORTS            0
2281    /**
2282     * This macro is calculated to specify the memory required for
2283     * Classic API Dual-Ported Memory Ports.
2284     *
2285     * This is an internal parameter.
2286     */
2287    #define CONFIGURE_MEMORY_FOR_PORTS(_ports) 0
2288  #else
2289    #define CONFIGURE_MEMORY_FOR_PORTS(_ports) \
2290      _Configure_Object_RAM(_ports, sizeof(Dual_ported_memory_Control) )
2291  #endif
2292
2293  #ifndef CONFIGURE_MAXIMUM_PERIODS
2294    /**
2295     * This configuration parameter specifies the maximum number of
2296     * Classic API Rate Monotonic Periods.
2297     */
2298    #define CONFIGURE_MAXIMUM_PERIODS              0
2299    /**
2300     * This macro is calculated to specify the memory required for
2301     * Classic API Rate Monotonic Periods.
2302     *
2303     * This is an internal parameter.
2304     */
2305  #define CONFIGURE_MEMORY_FOR_PERIODS(_periods) 0
2306#else
2307    #define CONFIGURE_MEMORY_FOR_PERIODS(_periods) \
2308      _Configure_Object_RAM(_periods, sizeof(Rate_monotonic_Control) )
2309  #endif
2310
2311  /**
2312   * This configuration parameter specifies the maximum number of
2313   * Classic API Barriers.
2314   */
2315  #ifndef CONFIGURE_MAXIMUM_BARRIERS
2316    #define CONFIGURE_MAXIMUM_BARRIERS               0
2317  #endif
2318
2319  /**
2320   * This macro is calculated to specify the number of Classic API
2321   * Barriers required by the application and configured capabilities.
2322   *
2323   * This is an internal parameter.
2324   */
2325  #define CONFIGURE_BARRIERS \
2326     (CONFIGURE_MAXIMUM_BARRIERS + CONFIGURE_BARRIERS_FOR_FIFOS)
2327
2328  /**
2329   * This macro is calculated to specify the memory required for
2330   * Classic API Barriers.
2331   *
2332   * This is an internal parameter.
2333   */
2334  #if CONFIGURE_BARRIERS == 0
2335    #define CONFIGURE_MEMORY_FOR_BARRIERS(_barriers) 0
2336  #else
2337    #define CONFIGURE_MEMORY_FOR_BARRIERS(_barriers) \
2338      _Configure_Object_RAM(_barriers, sizeof(Barrier_Control) )
2339  #endif
2340
2341  #ifndef CONFIGURE_MAXIMUM_USER_EXTENSIONS
2342    /**
2343     * This configuration parameter specifies the maximum number of
2344     * Classic API User Extensions.
2345     */
2346    #define CONFIGURE_MAXIMUM_USER_EXTENSIONS                 0
2347    /**
2348     * This macro is calculated to specify the memory required for
2349     * Classic API User Extensions.
2350     *
2351     * This is an internal parameter.
2352     */
2353    #define CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(_extensions) 0
2354  #else
2355    #define CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(_extensions) \
2356      _Configure_Object_RAM(_extensions, sizeof(Extension_Control) )
2357  #endif
2358  /**@}*/ /* end of Classic API Configuration */
2359
2360  /**
2361   * @defgroup ConfigurationGeneral General System Configuration
2362   *
2363   * @ingroup Configuration
2364   *
2365   * This module contains configuration parameters that are independent
2366   * of any API but impact general system configuration.
2367   */
2368  /**@{*/
2369
2370  /** The configures the number of microseconds per clock tick. */
2371  #ifndef CONFIGURE_MICROSECONDS_PER_TICK
2372    #define CONFIGURE_MICROSECONDS_PER_TICK \
2373            RTEMS_MILLISECONDS_TO_MICROSECONDS(10)
2374  #endif
2375
2376  /** The configures the number of clock ticks per timeslice. */
2377  #ifndef CONFIGURE_TICKS_PER_TIMESLICE
2378    #define CONFIGURE_TICKS_PER_TIMESLICE        50
2379  #endif
2380
2381/**@}*/ /* end of General Configuration */
2382
2383/*
2384 *  Initial Extension Set
2385 */
2386
2387#ifdef CONFIGURE_INIT
2388#ifdef CONFIGURE_STACK_CHECKER_ENABLED
2389#include <rtems/stackchk.h>
2390#endif
2391#include <rtems/libcsupport.h>
2392
2393#if defined(BSP_INITIAL_EXTENSION) || \
2394    defined(CONFIGURE_INITIAL_EXTENSIONS) || \
2395    defined(CONFIGURE_STACK_CHECKER_ENABLED) || \
2396    (defined(RTEMS_NEWLIB) && !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY))
2397  static const rtems_extensions_table Configuration_Initial_Extensions[] = {
2398    #if !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY)
2399      RTEMS_NEWLIB_EXTENSION,
2400    #endif
2401    #if defined(CONFIGURE_STACK_CHECKER_ENABLED)
2402      RTEMS_STACK_CHECKER_EXTENSION,
2403    #endif
2404    #if defined(CONFIGURE_INITIAL_EXTENSIONS)
2405      CONFIGURE_INITIAL_EXTENSIONS,
2406    #endif
2407    #if defined(BSP_INITIAL_EXTENSION)
2408      BSP_INITIAL_EXTENSION
2409    #endif
2410  };
2411
2412  #define CONFIGURE_INITIAL_EXTENSION_TABLE Configuration_Initial_Extensions
2413  #define CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS \
2414    RTEMS_ARRAY_SIZE(Configuration_Initial_Extensions)
2415#else
2416  #define CONFIGURE_INITIAL_EXTENSION_TABLE NULL
2417  #define CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS 0
2418#endif
2419
2420#if defined(RTEMS_NEWLIB) && defined(__DYNAMIC_REENT__)
2421  struct _reent *__getreent(void)
2422  {
2423    #ifdef CONFIGURE_DISABLE_NEWLIB_REENTRANCY
2424      return _GLOBAL_REENT;
2425    #else
2426      return _Thread_Get_executing()->libc_reent;
2427    #endif
2428  }
2429#endif
2430
2431#endif
2432
2433/**
2434 * @defgroup ConfigurationPOSIXAPI POSIX API Configuration Parameters
2435 *
2436 * This module contains the parameters related to configuration
2437 * of the POSIX API services.
2438 */
2439/**@{*/
2440
2441#include <rtems/posix/key.h>
2442
2443/**
2444 * This configuration parameter specifies the maximum number of
2445 * POSIX API keys.
2446 *
2447 * POSIX Keys are available whether or not the POSIX API is enabled.
2448 */
2449#ifndef CONFIGURE_MAXIMUM_POSIX_KEYS
2450  #define CONFIGURE_MAXIMUM_POSIX_KEYS 0
2451#endif
2452
2453/**
2454 * This macro is calculated to specify the memory required for
2455 * POSIX API key/value pairs.
2456 *
2457 * This is an internal parameter.
2458 */
2459#ifndef CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS
2460  #define CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS \
2461    (CONFIGURE_MAXIMUM_POSIX_KEYS * \
2462     (CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_TASKS))
2463#endif
2464
2465/**
2466 * This macro is calculated to specify the total number of
2467 * POSIX API keys required by the application and configured
2468 * system capabilities.
2469 *
2470 * This is an internal parameter.
2471 */
2472#define CONFIGURE_POSIX_KEYS \
2473  (CONFIGURE_MAXIMUM_POSIX_KEYS + CONFIGURE_LIBIO_POSIX_KEYS)
2474
2475/**
2476 * This macro is calculated to specify the memory required for
2477 * POSIX API keys.
2478 *
2479 * This is an internal parameter.
2480 */
2481#define CONFIGURE_MEMORY_FOR_POSIX_KEYS(_keys, _key_value_pairs) \
2482   (_Configure_Object_RAM(_keys, sizeof(POSIX_Keys_Control) ) \
2483    + _Configure_From_workspace( \
2484        _key_value_pairs * sizeof(POSIX_Keys_Key_value_pair)))
2485
2486/*
2487 *  The rest of the POSIX threads API features are only available when
2488 *  POSIX is enabled.
2489 */
2490#ifdef RTEMS_POSIX_API
2491  #include <sys/types.h>
2492  #include <signal.h>
2493  #include <limits.h>
2494  #include <mqueue.h>
2495  #include <rtems/posix/barrier.h>
2496  #include <rtems/posix/cond.h>
2497  #include <rtems/posix/mqueue.h>
2498  #include <rtems/posix/mutex.h>
2499  #include <rtems/posix/psignal.h>
2500  #include <rtems/posix/pthread.h>
2501  #include <rtems/posix/rwlock.h>
2502  #include <rtems/posix/semaphore.h>
2503  #include <rtems/posix/spinlock.h>
2504  #include <rtems/posix/threadsup.h>
2505  #include <rtems/posix/timer.h>
2506
2507  /**
2508   * Account for the object control structures plus the name
2509   * of the object to be duplicated.
2510   *
2511   * This is an internal macro.
2512   */
2513  #define _Configure_POSIX_Named_Object_RAM(_number, _size) \
2514    _Configure_Object_RAM( (_number), _size ) + \
2515    (_Configure_Max_Objects(_number) * _Configure_From_workspace(NAME_MAX) )
2516
2517  /**
2518   * This configuration parameter specifies the maximum number of
2519   * POSIX API threads.
2520   */
2521  #ifndef CONFIGURE_MAXIMUM_POSIX_THREADS
2522    #define CONFIGURE_MAXIMUM_POSIX_THREADS 0
2523  #endif
2524
2525  /**
2526   * This configuration parameter specifies the maximum number of
2527   * POSIX API mutexes.
2528   */
2529  #ifndef CONFIGURE_MAXIMUM_POSIX_MUTEXES
2530    #define CONFIGURE_MAXIMUM_POSIX_MUTEXES 0
2531  #endif
2532
2533  /**
2534   * This macro is calculated to specify the memory required for
2535   * POSIX API mutexes.
2536   *
2537   * This is an internal parameter.
2538   */
2539  #define CONFIGURE_MEMORY_FOR_POSIX_MUTEXES(_mutexes) \
2540    _Configure_Object_RAM(_mutexes, sizeof(POSIX_Mutex_Control) )
2541
2542  /**
2543   * This configuration parameter specifies the maximum number of
2544   * POSIX API condition variables.
2545   */
2546  #ifndef CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES
2547    #define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 0
2548  #endif
2549
2550  /**
2551   * This macro is calculated to specify the memory required for
2552   * POSIX API condition variables.
2553   *
2554   * This is an internal parameter.
2555   */
2556  #define CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES(_condvars) \
2557      _Configure_Object_RAM(_condvars, \
2558                          sizeof(POSIX_Condition_variables_Control) )
2559
2560  /**
2561   * This configuration parameter specifies the maximum number of
2562   * POSIX API timers.
2563   */
2564  #ifndef CONFIGURE_MAXIMUM_POSIX_TIMERS
2565    #define CONFIGURE_MAXIMUM_POSIX_TIMERS 0
2566  #endif
2567
2568  /**
2569   * This macro is calculated to specify the memory required for
2570   * POSIX API timers.
2571   *
2572   * This is an internal parameter.
2573   */
2574  #define CONFIGURE_MEMORY_FOR_POSIX_TIMERS(_timers) \
2575    _Configure_Object_RAM(_timers, sizeof(POSIX_Timer_Control) )
2576
2577  /**
2578   * This configuration parameter specifies the maximum number of
2579   * POSIX API queued signals.
2580   */
2581  #ifndef CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS
2582    #define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS 0
2583  #endif
2584
2585  /**
2586   * This macro is calculated to specify the memory required for
2587   * POSIX API queued signals.
2588   *
2589   * This is an internal parameter.
2590   */
2591  #define CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS(_queued_signals) \
2592    _Configure_From_workspace( \
2593      (_queued_signals) * (sizeof(POSIX_signals_Siginfo_node)) )
2594
2595  /**
2596   * This configuration parameter specifies the maximum number of
2597   * POSIX API message queues.
2598   */
2599  #ifndef CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES
2600    #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES                     0
2601  #endif
2602
2603  /**
2604   * This configuration parameter specifies the maximum number of
2605   * POSIX API messages queue descriptors.
2606   *
2607   * This defaults to the number of POSIX API message queues.
2608   */
2609  #ifndef CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS
2610     #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS \
2611             CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES
2612  #endif
2613
2614  /**
2615   * This macro is calculated to specify the memory required for
2616   * POSIX API message queues.
2617   *
2618   * This is an internal parameter.
2619   */
2620  #define CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES(_message_queues) \
2621    _Configure_POSIX_Named_Object_RAM( \
2622       _message_queues, sizeof(POSIX_Message_queue_Control) )
2623
2624  /**
2625   * This macro is calculated to specify the memory required for
2626   * POSIX API message queue descriptors.
2627   *
2628   * This is an internal parameter.
2629   */
2630  #define CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUE_DESCRIPTORS(_mqueue_fds) \
2631    _Configure_Object_RAM( \
2632       _mqueue_fds, sizeof(POSIX_Message_queue_Control_fd) )
2633
2634  /**
2635   * This configuration parameter specifies the maximum number of
2636   * POSIX API semaphores.
2637   */
2638  #ifndef CONFIGURE_MAXIMUM_POSIX_SEMAPHORES
2639    #define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES 0
2640  #endif
2641
2642  /**
2643   * This macro is calculated to specify the memory required for
2644   * POSIX API semaphores.
2645   *
2646   * This is an internal parameter.
2647   */
2648  #define CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES(_semaphores) \
2649    _Configure_POSIX_Named_Object_RAM( \
2650       _semaphores, sizeof(POSIX_Semaphore_Control) )
2651
2652  /**
2653   * This configuration parameter specifies the maximum number of
2654   * POSIX API barriers.
2655   */
2656  #ifndef CONFIGURE_MAXIMUM_POSIX_BARRIERS
2657    #define CONFIGURE_MAXIMUM_POSIX_BARRIERS 0
2658  #endif
2659
2660  /**
2661   * This macro is calculated to specify the memory required for
2662   * POSIX API barriers.
2663   *
2664   * This is an internal parameter.
2665   */
2666  #define CONFIGURE_MEMORY_FOR_POSIX_BARRIERS(_barriers) \
2667    _Configure_Object_RAM(_barriers, sizeof(POSIX_Barrier_Control) )
2668
2669  /**
2670   * This configuration parameter specifies the maximum number of
2671   * POSIX API spinlocks.
2672   */
2673  #ifndef CONFIGURE_MAXIMUM_POSIX_SPINLOCKS
2674    #define CONFIGURE_MAXIMUM_POSIX_SPINLOCKS 0
2675  #endif
2676
2677  /**
2678   * This macro is calculated to specify the memory required for
2679   * POSIX API spinlocks.
2680   *
2681   * This is an internal parameter.
2682   */
2683  #define CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS(_spinlocks) \
2684    _Configure_Object_RAM(_spinlocks, sizeof(POSIX_Spinlock_Control) )
2685
2686  /**
2687   * This configuration parameter specifies the maximum number of
2688   * POSIX API rwlocks.
2689   */
2690  #ifndef CONFIGURE_MAXIMUM_POSIX_RWLOCKS
2691    #define CONFIGURE_MAXIMUM_POSIX_RWLOCKS 0
2692  #endif
2693
2694  /**
2695   * This macro is calculated to specify the memory required for
2696   * POSIX API rwlocks.
2697   *
2698   * This is an internal parameter.
2699   */
2700  #define CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS(_rwlocks) \
2701    _Configure_Object_RAM(_rwlocks, sizeof(POSIX_RWLock_Control) )
2702
2703  #ifdef CONFIGURE_POSIX_INIT_THREAD_TABLE
2704
2705    #ifdef CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE
2706
2707      /*
2708       *  The user is defining their own table information and setting the
2709       *  appropriate variables for the POSIX Initialization Thread Table.
2710       */
2711
2712    #else
2713
2714      #ifndef CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT
2715        #define CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT   POSIX_Init
2716      #endif
2717
2718      #ifndef CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE
2719        #define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE \
2720          CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE
2721      #endif
2722
2723      #ifdef CONFIGURE_INIT
2724        posix_initialization_threads_table POSIX_Initialization_threads[] = {
2725          { CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT, \
2726              CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE }
2727        };
2728      #endif
2729
2730      #define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME \
2731              POSIX_Initialization_threads
2732
2733      #define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE \
2734              RTEMS_ARRAY_SIZE(CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME)
2735
2736    #endif    /* CONFIGURE_POSIX_HAS_OWN_INIT_TASK_TABLE */
2737
2738  #else     /* CONFIGURE_POSIX_INIT_THREAD_TABLE */
2739
2740    #define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME NULL
2741    #define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE 0
2742
2743  #endif
2744
2745#else
2746
2747  /**
2748   * This configuration parameter specifies the maximum number of
2749   * POSIX API threads.
2750   */
2751  #define CONFIGURE_MAXIMUM_POSIX_THREADS         0
2752
2753#endif    /* RTEMS_POSIX_API */
2754
2755/**
2756 * This configuration parameter specifies the stack size of the
2757 * POSIX API Initialization thread (if used).
2758 */
2759#ifndef CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE
2760  #define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE    0
2761#endif
2762/**@}*/  /* end of POSIX API Configuration */
2763
2764/**
2765 * @defgroup ConfigurationGNAT GNAT/RTEMS Configuration
2766 *
2767 * @addtogroup Configuration
2768 *
2769 *  This modules includes configuration parameters for applications which
2770 *  use GNAT/RTEMS. GNAT implements each Ada task as a POSIX thread.
2771 */
2772/**@{*/
2773#ifdef CONFIGURE_GNAT_RTEMS
2774
2775  /**
2776   * The GNAT run-time needs something less than (10) POSIX mutexes.
2777   * We may be able to get by with less but why bother.
2778   */
2779  #define CONFIGURE_GNAT_MUTEXES 10
2780
2781  /**
2782   * This is the maximum number of Ada tasks which can be concurrently
2783   * in existence.  Twenty (20) are required to run all tests in the
2784   * ACATS (formerly ACVC).
2785   */
2786  #ifndef CONFIGURE_MAXIMUM_ADA_TASKS
2787    #define CONFIGURE_MAXIMUM_ADA_TASKS  20
2788  #endif
2789
2790  /**
2791   * This is the number of non-Ada tasks which invoked Ada code.
2792   */
2793  #ifndef CONFIGURE_MAXIMUM_FAKE_ADA_TASKS
2794    #define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0
2795  #endif
2796
2797#else
2798  /** This defines he number of POSIX mutexes GNAT needs. */
2799  #define CONFIGURE_GNAT_MUTEXES           0
2800  /** This defines he number of Ada tasks needed by the application. */
2801  #define CONFIGURE_MAXIMUM_ADA_TASKS      0
2802  /**
2803   * This defines he number of non-Ada tasks/threads that will invoke
2804   * Ada subprograms or functions.
2805   */
2806  #define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0
2807#endif
2808/**@}*/  /* end of GNAT Configuration */
2809
2810/**
2811 * @defgroup ConfigurationGo GCC Go Configuration
2812 *
2813 * @addtogroup Configuration
2814 *
2815 *  This modules includes configuration parameters for applications which
2816 *  use GCC Go.
2817 */
2818/**@{*/
2819#ifdef CONFIGURE_ENABLE_GO
2820
2821  #ifndef CONFIGURE_MAXIMUM_POSIX_THREADS
2822    #define CONFIGURE_MAXIMUM_POSIX_THREADS 1
2823  #endif
2824  #ifndef CONFIGURE_MAXIMUM_POSIX_MUTEXES
2825    #define CONFIGURE_MAXIMUM_POSIX_MUTEXES 1
2826  #endif
2827  #ifndef CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES
2828    #define CONFIGURE_MAXIMUM_CONDITION_VARIABLES 1
2829  #endif
2830
2831  #define CONFIGURE_GO_INIT_MUTEXES 77
2832  #define CONFIGURE_GO_INIT_CONDITION_VARIABLES 4
2833
2834  #ifndef CONFIGURE_MAXIMUM_GOROUTINES
2835    #define CONFIGURE_MAXIMUM_GOROUTINES 400
2836  #endif
2837
2838  #define CONFIGURE_GOROUTINES_TASK_VARIABLES \
2839    (2 * CONFIGURE_MAXIMUM_GOROUTINES)
2840
2841  #ifndef CONFIGURE_MAXIMUM_GO_CHANNELS
2842    #define CONFIGURE_MAXIMUM_GO_CHANNELS 500
2843  #endif
2844
2845#else
2846  /**
2847   * This specifies the number of mutexes required by the Go run-time
2848   * for its own use.
2849   *
2850   * This is an internal parameter.
2851   */
2852  #define CONFIGURE_GO_INIT_MUTEXES             0
2853
2854  /**
2855   * This specifies the number of condition variables required by the Go
2856   * run-time for its own use.
2857   *
2858   * This is an internal parameter.
2859   */
2860  #define CONFIGURE_GO_INIT_CONDITION_VARIABLES 0
2861
2862  /** This specifies the maximum number of Go co-routines. */
2863  #define CONFIGURE_MAXIMUM_GOROUTINES          0
2864
2865  /** This specifies the maximum number of Go per-task variables required. */
2866  #define CONFIGURE_GOROUTINES_TASK_VARIABLES   0
2867
2868  /** This specifies the maximum number of Go channels required. */
2869  #define CONFIGURE_MAXIMUM_GO_CHANNELS         0
2870#endif
2871/**@}*/  /* end of Go Configuration */
2872
2873/**
2874 * This is so we can account for tasks with stacks greater than minimum
2875 * size.  This is in bytes.
2876 */
2877#ifndef CONFIGURE_EXTRA_TASK_STACKS
2878  #define CONFIGURE_EXTRA_TASK_STACKS 0
2879#endif
2880
2881/**
2882 * This macro provides a summation of the various POSIX thread requirements.
2883 */
2884#define CONFIGURE_POSIX_THREADS \
2885   (CONFIGURE_MAXIMUM_POSIX_THREADS + \
2886     CONFIGURE_MAXIMUM_ADA_TASKS + \
2887     CONFIGURE_MAXIMUM_GOROUTINES)
2888
2889#ifdef RTEMS_POSIX_API
2890  /**
2891   * This macro provides summation of the POSIX Mutexes.
2892   */
2893  #define CONFIGURE_POSIX_MUTEXES \
2894    (CONFIGURE_MAXIMUM_POSIX_MUTEXES + \
2895      CONFIGURE_LIBBLOCK_POSIX_MUTEXES + \
2896      CONFIGURE_GNAT_MUTEXES + \
2897      CONFIGURE_MAXIMUM_ADA_TASKS + \
2898      CONFIGURE_MAXIMUM_FAKE_ADA_TASKS + \
2899      CONFIGURE_GO_INIT_MUTEXES + \
2900      CONFIGURE_MAXIMUM_GO_CHANNELS)
2901
2902  /**
2903   * This macro provides summation of the POSIX Condition Variables.
2904   *
2905   * This is an internal parameter.
2906   */
2907  #define CONFIGURE_POSIX_CONDITION_VARIABLES \
2908    (CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES + \
2909      CONFIGURE_LIBBLOCK_POSIX_CONDITION_VARIABLES + \
2910      CONFIGURE_MAXIMUM_ADA_TASKS + \
2911      CONFIGURE_MAXIMUM_FAKE_ADA_TASKS + \
2912      CONFIGURE_GO_INIT_CONDITION_VARIABLES + \
2913      CONFIGURE_MAXIMUM_GO_CHANNELS)
2914
2915  /**
2916   * This macro is calculated to specify the memory required for
2917   * the POSIX API in its entirety.
2918   *
2919   * This is an internal parameter.
2920   */
2921  #define CONFIGURE_MEMORY_FOR_POSIX \
2922    (CONFIGURE_MEMORY_FOR_POSIX_MUTEXES(CONFIGURE_POSIX_MUTEXES) + \
2923      CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES( \
2924        CONFIGURE_POSIX_CONDITION_VARIABLES) + \
2925      CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS( \
2926        CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS) + \
2927      CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES( \
2928        CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES) + \
2929      CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUE_DESCRIPTORS( \
2930        CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS) + \
2931      CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES( \
2932        CONFIGURE_MAXIMUM_POSIX_SEMAPHORES) + \
2933      CONFIGURE_MEMORY_FOR_POSIX_BARRIERS(CONFIGURE_MAXIMUM_POSIX_BARRIERS) + \
2934      CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS( \
2935        CONFIGURE_MAXIMUM_POSIX_SPINLOCKS) + \
2936      CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS( \
2937        CONFIGURE_MAXIMUM_POSIX_RWLOCKS) + \
2938      CONFIGURE_MEMORY_FOR_POSIX_TIMERS(CONFIGURE_MAXIMUM_POSIX_TIMERS))
2939#else
2940  /**
2941   * This macro is calculated to specify the memory required for
2942   * the POSIX API in its entirety.
2943   *
2944   * This is an internal parameter.
2945   */
2946  #define CONFIGURE_MEMORY_FOR_POSIX 0
2947#endif
2948
2949/*
2950 * We must be able to split the free block used for the second last allocation
2951 * into two parts so that we have a free block for the last allocation.  See
2952 * _Heap_Block_split().
2953 */
2954#define CONFIGURE_HEAP_HANDLER_OVERHEAD \
2955  _Configure_Align_up( HEAP_BLOCK_HEADER_SIZE, CPU_HEAP_ALIGNMENT )
2956
2957/*
2958 *  Calculate the RAM size based on the maximum number of objects configured.
2959 */
2960#ifndef CONFIGURE_EXECUTIVE_RAM_SIZE
2961
2962/**
2963 * Account for allocating the following per object
2964 *   + array of object control structures
2965 *   + local pointer table -- pointer per object plus a zero'th
2966 *     entry in the local pointer table.
2967 *
2968 * This is an internal parameter.
2969 */
2970#define CONFIGURE_MEMORY_FOR_TASKS(_tasks, _number_FP_tasks) \
2971  ( \
2972    _Configure_Object_RAM(_tasks, sizeof(Configuration_Thread_control)) \
2973      + _Configure_From_workspace(_Configure_Max_Objects(_tasks) \
2974        * THREAD_QUEUE_HEADS_SIZE(CONFIGURE_SCHEDULER_COUNT)) \
2975      + _Configure_Max_Objects(_number_FP_tasks) \
2976        * _Configure_From_workspace(CONTEXT_FP_SIZE) \
2977  )
2978
2979/**
2980 * This defines the amount of memory configured for the multiprocessing
2981 * support required by this application.
2982 *
2983 * This is an internal parameter.
2984 */
2985#ifdef CONFIGURE_MP_APPLICATION
2986  #define CONFIGURE_MEMORY_FOR_MP \
2987    (CONFIGURE_MEMORY_FOR_PROXIES(CONFIGURE_MP_MAXIMUM_PROXIES) + \
2988     CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS( \
2989             CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS) + \
2990     CONFIGURE_MEMORY_FOR_TASKS(1, 1) \
2991  )
2992#else
2993  #define CONFIGURE_MEMORY_FOR_MP  0
2994#endif
2995
2996/**
2997 * The following macro is used to calculate the memory allocated by RTEMS
2998 * for the message buffers associated with a particular message queue.
2999 * There is a fixed amount of overhead per message.
3000 */
3001#define CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(_messages, _size) \
3002    _Configure_From_workspace( \
3003      (_messages) * ((_size) + sizeof(CORE_message_queue_Buffer_control)))
3004
3005/**
3006 * This macro is set to the amount of memory required for pending message
3007 * buffers in bytes.  It should be constructed by adding together a
3008 * set of values determined by CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE.
3009 *
3010 * This is an internal parameter.
3011 */
3012#ifndef CONFIGURE_MESSAGE_BUFFER_MEMORY
3013  #define CONFIGURE_MESSAGE_BUFFER_MEMORY 0
3014#endif
3015
3016/**
3017 * This macro is available just in case the confdefs.h file underallocates
3018 * memory for a particular application.  This lets the user add some extra
3019 * memory in case something broken and underestimates.
3020 *
3021 * It is also possible for cases where confdefs.h overallocates memory,
3022 * you could substract memory from the allocated.  The estimate is just
3023 * that, an estimate, and assumes worst case alignment and padding on
3024 * each allocated element.  So in some cases it could be too conservative.
3025 *
3026 * NOTE: Historically this was used for message buffers.
3027 */
3028#ifndef CONFIGURE_MEMORY_OVERHEAD
3029  #define CONFIGURE_MEMORY_OVERHEAD 0
3030#endif
3031
3032/**
3033 * RTEMS uses two instance of an internal mutex class.  This accounts
3034 * for these mutexes.
3035 */
3036#define CONFIGURE_API_MUTEX_MEMORY \
3037  _Configure_Object_RAM(2, sizeof(API_Mutex_Control))
3038
3039/**
3040 * This calculates the amount of memory reserved for the IDLE tasks.
3041 * In an SMP system, each CPU core has its own idle task.
3042 */
3043#if defined(RTEMS_SMP)
3044  #define CONFIGURE_IDLE_TASKS_COUNT CONFIGURE_SMP_MAXIMUM_PROCESSORS
3045#else
3046  #define CONFIGURE_IDLE_TASKS_COUNT 1
3047#endif
3048
3049/**
3050 * This defines the formula used to compute the amount of memory
3051 * reserved for IDLE task control structures.
3052 */
3053#if CPU_IDLE_TASK_IS_FP == TRUE
3054  #define CONFIGURE_MEMORY_FOR_IDLE_TASK \
3055    CONFIGURE_MEMORY_FOR_TASKS( \
3056      CONFIGURE_IDLE_TASKS_COUNT, CONFIGURE_IDLE_TASKS_COUNT)
3057#else
3058  #define CONFIGURE_MEMORY_FOR_IDLE_TASK \
3059    CONFIGURE_MEMORY_FOR_TASKS(CONFIGURE_IDLE_TASKS_COUNT, 0)
3060#endif
3061
3062/**
3063 * This macro accounts for general RTEMS system overhead.
3064 */
3065#define CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD \
3066  ( CONFIGURE_MEMORY_FOR_IDLE_TASK +                /* IDLE and stack */ \
3067    CONFIGURE_INTERRUPT_STACK_MEMORY +             /* interrupt stack */ \
3068    CONFIGURE_API_MUTEX_MEMORY                     /* allocation mutex */ \
3069  )
3070
3071/**
3072 * This macro reserves the memory required by the statically configured
3073 * user extensions.
3074 */
3075#define CONFIGURE_MEMORY_FOR_STATIC_EXTENSIONS \
3076  (CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS == 0 ? 0 : \
3077    _Configure_From_workspace( \
3078      CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS \
3079        * sizeof(User_extensions_Switch_control) \
3080    ))
3081
3082/**
3083 * This macro provides a summation of the memory required by the
3084 * Classic API as configured.
3085 */
3086#define CONFIGURE_MEMORY_FOR_CLASSIC \
3087  (CONFIGURE_MEMORY_FOR_TASK_VARIABLES(CONFIGURE_MAXIMUM_TASK_VARIABLES + \
3088    CONFIGURE_GOROUTINES_TASK_VARIABLES) + \
3089   CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS + \
3090    CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER ) + \
3091   CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_SEMAPHORES) + \
3092   CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(CONFIGURE_MAXIMUM_MESSAGE_QUEUES) + \
3093   CONFIGURE_MEMORY_FOR_PARTITIONS(CONFIGURE_MAXIMUM_PARTITIONS) + \
3094   CONFIGURE_MEMORY_FOR_REGIONS( CONFIGURE_MAXIMUM_REGIONS ) + \
3095   CONFIGURE_MEMORY_FOR_PORTS(CONFIGURE_MAXIMUM_PORTS) + \
3096   CONFIGURE_MEMORY_FOR_PERIODS(CONFIGURE_MAXIMUM_PERIODS) + \
3097   CONFIGURE_MEMORY_FOR_BARRIERS(CONFIGURE_BARRIERS) + \
3098   CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(CONFIGURE_MAXIMUM_USER_EXTENSIONS) \
3099  )
3100
3101/**
3102 * This macro provides a summation of the memory required by SMP as configured.
3103 *
3104 * This is an internal parameter.
3105 */
3106#if defined(RTEMS_SMP)
3107  #define CONFIGURE_MEMORY_FOR_SMP \
3108     (CONFIGURE_SMP_MAXIMUM_PROCESSORS * \
3109      _Configure_From_workspace( CONFIGURE_INTERRUPT_STACK_SIZE ) \
3110     )
3111#else
3112  #define CONFIGURE_MEMORY_FOR_SMP 0
3113#endif
3114
3115/**
3116 * This calculates the memory required for the executive workspace.
3117 *
3118 * This is an internal parameter.
3119 */
3120#define CONFIGURE_EXECUTIVE_RAM_SIZE \
3121( \
3122   CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD + \
3123   CONFIGURE_MEMORY_FOR_TASKS( \
3124     CONFIGURE_TASKS, CONFIGURE_TASKS) + \
3125   CONFIGURE_MEMORY_FOR_TASKS( \
3126     CONFIGURE_POSIX_THREADS, CONFIGURE_POSIX_THREADS) + \
3127   CONFIGURE_MEMORY_FOR_CLASSIC + \
3128   CONFIGURE_MEMORY_FOR_POSIX_KEYS( \
3129      CONFIGURE_POSIX_KEYS, \
3130      CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS ) + \
3131   CONFIGURE_MEMORY_FOR_POSIX + \
3132   CONFIGURE_MEMORY_FOR_STATIC_EXTENSIONS + \
3133   CONFIGURE_MEMORY_FOR_MP + \
3134   CONFIGURE_MEMORY_FOR_SMP + \
3135   CONFIGURE_MESSAGE_BUFFER_MEMORY + \
3136   (CONFIGURE_MEMORY_OVERHEAD * 1024) + \
3137   CONFIGURE_HEAP_HANDLER_OVERHEAD \
3138)
3139
3140/*
3141 *  Now account for any extra memory that initialization tasks or threads
3142 *  may have requested.
3143 */
3144
3145/**
3146 * This accounts for any extra memory required by the Classic API
3147 * Initialization Task.
3148 *
3149 * This is an internal parameter.
3150 */
3151#if (CONFIGURE_INIT_TASK_STACK_SIZE > CONFIGURE_MINIMUM_TASK_STACK_SIZE)
3152  #define CONFIGURE_INITIALIZATION_THREADS_STACKS_CLASSIC_PART \
3153      (CONFIGURE_INIT_TASK_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE)
3154#else
3155  #define CONFIGURE_INITIALIZATION_THREADS_STACKS_CLASSIC_PART 0
3156#endif
3157
3158/**
3159 * This accounts for any extra memory required by the POSIX API
3160 * Initialization Thread.
3161 *
3162 * This is an internal parameter.
3163 */
3164#if defined(RTEMS_POSIX_API) && \
3165    (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE > \
3166      CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE)
3167  #define CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART \
3168    (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE - \
3169      CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE)
3170#else
3171  #define CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART 0
3172#endif
3173
3174/**
3175 * This macro provides a summation of the various initialization task
3176 * and thread stack requirements.
3177 *
3178 * This is an internal parameter.
3179 */
3180#define CONFIGURE_INITIALIZATION_THREADS_EXTRA_STACKS \
3181    (CONFIGURE_INITIALIZATION_THREADS_STACKS_CLASSIC_PART + \
3182    CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART)
3183
3184/**
3185 * This macro is calculated to specify the memory required for
3186 * the Idle tasks(s) stack.
3187 *
3188 * This is an internal parameter.
3189 */
3190#define CONFIGURE_IDLE_TASKS_STACK \
3191  (CONFIGURE_IDLE_TASKS_COUNT * \
3192    _Configure_From_stackspace( CONFIGURE_IDLE_TASK_STACK_SIZE ) )
3193
3194/**
3195 * This macro is calculated to specify the memory required for
3196 * the stacks of all tasks.
3197 *
3198 * This is an internal parameter.
3199 */
3200#define CONFIGURE_TASKS_STACK \
3201  (_Configure_Max_Objects( CONFIGURE_TASKS ) * \
3202    _Configure_From_stackspace( CONFIGURE_MINIMUM_TASK_STACK_SIZE ) )
3203
3204/**
3205 * This macro is calculated to specify the memory required for
3206 * the stacks of all POSIX threads.
3207 *
3208 * This is an internal parameter.
3209 */
3210#define CONFIGURE_POSIX_THREADS_STACK \
3211  (_Configure_Max_Objects( CONFIGURE_MAXIMUM_POSIX_THREADS ) * \
3212    _Configure_From_stackspace( CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE ) )
3213
3214/**
3215 * This macro is calculated to specify the memory required for
3216 * the stacks of all Ada tasks.
3217 *
3218 * This is an internal parameter.
3219 */
3220#define CONFIGURE_ADA_TASKS_STACK \
3221  (_Configure_Max_Objects( CONFIGURE_MAXIMUM_ADA_TASKS ) * \
3222    _Configure_From_stackspace( CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE ) )
3223
3224/**
3225 * This macro is calculated to specify the memory required for
3226 * the stacks of all Go routines.
3227 *
3228 * This is an internal parameter.
3229 */
3230#define CONFIGURE_GOROUTINES_STACK \
3231  (_Configure_Max_Objects( CONFIGURE_MAXIMUM_GOROUTINES ) * \
3232    _Configure_From_stackspace( CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE ) )
3233
3234#else /* CONFIGURE_EXECUTIVE_RAM_SIZE */
3235
3236#define CONFIGURE_IDLE_TASKS_STACK 0
3237#define CONFIGURE_INITIALIZATION_THREADS_EXTRA_STACKS 0
3238#define CONFIGURE_TASKS_STACK 0
3239#define CONFIGURE_POSIX_THREADS_STACK 0
3240#define CONFIGURE_GOROUTINES_STACK 0
3241#define CONFIGURE_ADA_TASKS_STACK 0
3242
3243#if CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK != 0
3244  #error "CONFIGURE_EXECUTIVE_RAM_SIZE defined with request for CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK"
3245#endif
3246
3247#if CONFIGURE_EXTRA_TASK_STACKS != 0
3248  #error "CONFIGURE_EXECUTIVE_RAM_SIZE defined with request for CONFIGURE_EXTRA_TASK_STACKS"
3249#endif
3250
3251#endif /* CONFIGURE_EXECUTIVE_RAM_SIZE */
3252
3253/**
3254 * This macro is calculated to specify the memory required for
3255 * all tasks and threads of all varieties.
3256 *
3257 * This is an internal parameter.
3258 */
3259#define CONFIGURE_STACK_SPACE_SIZE \
3260  ( \
3261    CONFIGURE_IDLE_TASKS_STACK + \
3262    CONFIGURE_INITIALIZATION_THREADS_EXTRA_STACKS + \
3263    CONFIGURE_TASKS_STACK + \
3264    CONFIGURE_POSIX_THREADS_STACK + \
3265    CONFIGURE_GOROUTINES_STACK + \
3266    CONFIGURE_ADA_TASKS_STACK + \
3267    CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK + \
3268    CONFIGURE_LIBBLOCK_TASK_EXTRA_STACKS + \
3269    CONFIGURE_EXTRA_TASK_STACKS + \
3270    CONFIGURE_HEAP_HANDLER_OVERHEAD \
3271  )
3272
3273#ifdef CONFIGURE_INIT
3274  typedef struct {
3275    Thread_Control Control;
3276    #if CONFIGURE_MAXIMUM_USER_EXTENSIONS > 0
3277      void *extensions[ CONFIGURE_MAXIMUM_USER_EXTENSIONS + 1 ];
3278    #endif
3279    union {
3280      Scheduler_Node Base;
3281      #ifdef CONFIGURE_SCHEDULER_CBS
3282        Scheduler_CBS_Node CBS;
3283      #endif
3284      #ifdef CONFIGURE_SCHEDULER_EDF
3285        Scheduler_EDF_Node EDF;
3286      #endif
3287      #ifdef CONFIGURE_SCHEDULER_PRIORITY
3288        Scheduler_priority_Node Priority;
3289      #endif
3290      #ifdef CONFIGURE_SCHEDULER_SIMPLE_SMP
3291        Scheduler_SMP_Node Simple_SMP;
3292      #endif
3293      #ifdef CONFIGURE_SCHEDULER_PRIORITY_SMP
3294        Scheduler_priority_SMP_Node Priority_SMP;
3295      #endif
3296      #ifdef CONFIGURE_SCHEDULER_PRIORITY_AFFINITY_SMP
3297        Scheduler_priority_affinity_SMP_Node Priority_affinity_SMP;
3298      #endif
3299      #ifdef CONFIGURE_SCHEDULER_USER_PER_THREAD
3300        CONFIGURE_SCHEDULER_USER_PER_THREAD User;
3301      #endif
3302    } Scheduler;
3303    RTEMS_API_Control API_RTEMS;
3304    #if defined(CONFIGURE_ENABLE_CLASSIC_API_NOTEPADS)
3305      uint32_t Notepads[ RTEMS_NUMBER_NOTEPADS ] RTEMS_COMPILER_DEPRECATED_ATTRIBUTE;
3306    #endif
3307    #ifdef RTEMS_POSIX_API
3308      POSIX_API_Control API_POSIX;
3309    #endif
3310    #if !defined(RTEMS_SCHEDSIM) \
3311      && defined(RTEMS_NEWLIB) \
3312      && !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY)
3313      struct _reent Newlib;
3314    #else
3315      struct { /* Empty */ } Newlib;
3316    #endif
3317  } Configuration_Thread_control;
3318
3319  const size_t _Thread_Control_size = sizeof( Configuration_Thread_control );
3320
3321  const Thread_Control_add_on _Thread_Control_add_ons[] = {
3322    {
3323      offsetof( Configuration_Thread_control, Control.Scheduler.node ),
3324      offsetof( Configuration_Thread_control, Scheduler )
3325    }, {
3326      offsetof(
3327        Configuration_Thread_control,
3328        Control.API_Extensions[ THREAD_API_RTEMS ]
3329      ),
3330      offsetof( Configuration_Thread_control, API_RTEMS )
3331    }, {
3332      offsetof(
3333        Configuration_Thread_control,
3334        Control.libc_reent
3335      ),
3336      offsetof( Configuration_Thread_control, Newlib )
3337    }
3338    #ifdef RTEMS_POSIX_API
3339      , {
3340        offsetof(
3341          Configuration_Thread_control,
3342          Control.API_Extensions[ THREAD_API_POSIX ]
3343        ),
3344        offsetof( Configuration_Thread_control, API_POSIX )
3345      }
3346    #endif
3347  };
3348
3349  const size_t _Thread_Control_add_on_count =
3350    RTEMS_ARRAY_SIZE( _Thread_Control_add_ons );
3351
3352  /**
3353   * This is the Classic API Configuration Table.
3354   */
3355  rtems_api_configuration_table Configuration_RTEMS_API = {
3356    CONFIGURE_TASKS,
3357    CONFIGURE_NOTEPADS_ENABLED,
3358    CONFIGURE_MAXIMUM_TIMERS + CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER,
3359    CONFIGURE_SEMAPHORES,
3360    CONFIGURE_MAXIMUM_MESSAGE_QUEUES,
3361    CONFIGURE_MAXIMUM_PARTITIONS,
3362    CONFIGURE_MAXIMUM_REGIONS,
3363    CONFIGURE_MAXIMUM_PORTS,
3364    CONFIGURE_MAXIMUM_PERIODS,
3365    CONFIGURE_BARRIERS,
3366    CONFIGURE_INIT_TASK_TABLE_SIZE,
3367    CONFIGURE_INIT_TASK_TABLE
3368  };
3369
3370  #ifdef RTEMS_POSIX_API
3371    /**
3372     * This is the POSIX API Configuration Table.
3373     */
3374    posix_api_configuration_table Configuration_POSIX_API = {
3375      CONFIGURE_POSIX_THREADS,
3376      CONFIGURE_POSIX_MUTEXES,
3377      CONFIGURE_POSIX_CONDITION_VARIABLES,
3378      CONFIGURE_MAXIMUM_POSIX_TIMERS,
3379      CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS,
3380      CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES,
3381      CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS,
3382      CONFIGURE_MAXIMUM_POSIX_SEMAPHORES,
3383      CONFIGURE_MAXIMUM_POSIX_BARRIERS,
3384      CONFIGURE_MAXIMUM_POSIX_RWLOCKS,
3385      CONFIGURE_MAXIMUM_POSIX_SPINLOCKS,
3386      CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE,
3387      CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME
3388    };
3389  #endif
3390
3391  /**
3392   * This variable specifies the minimum stack size for tasks in an RTEMS
3393   * application.
3394   *
3395   * NOTE: This is left as a simple uint32_t so it can be externed as
3396   *       needed without requring being high enough logical to
3397   *       include the full configuration table.
3398   */
3399  uint32_t rtems_minimum_stack_size =
3400    CONFIGURE_MINIMUM_TASK_STACK_SIZE;
3401
3402  /**
3403   * This variable specifies the maximum priority value that
3404   * a task may have.  This must be a power of 2 between 4
3405   * and 256 and is specified in terms of Classic API
3406   * priority values.
3407   *
3408   * NOTE: This is left as a simple uint8_t so it can be externed as
3409   *       needed without requring being high enough logical to
3410   *       include the full configuration table.
3411   */
3412  uint8_t rtems_maximum_priority = CONFIGURE_MAXIMUM_PRIORITY;
3413
3414  /**
3415   * This is the primary Configuration Table for this application.
3416   */
3417  const rtems_configuration_table Configuration = {
3418    CONFIGURE_EXECUTIVE_RAM_SIZE,             /* required RTEMS workspace */
3419    CONFIGURE_STACK_SPACE_SIZE,               /* required stack space */
3420    CONFIGURE_MAXIMUM_USER_EXTENSIONS,        /* maximum dynamic extensions */
3421    CONFIGURE_POSIX_KEYS,                     /* POSIX keys are always */
3422    CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS,  /*   enabled */
3423    CONFIGURE_MICROSECONDS_PER_TICK,          /* microseconds per clock tick */
3424    1000 * CONFIGURE_MICROSECONDS_PER_TICK,   /* nanoseconds per clock tick */
3425    CONFIGURE_TICKS_PER_TIMESLICE,            /* ticks per timeslice quantum */
3426    CONFIGURE_IDLE_TASK_BODY,                 /* user's IDLE task */
3427    CONFIGURE_IDLE_TASK_STACK_SIZE,           /* IDLE task stack size */
3428    CONFIGURE_INTERRUPT_STACK_SIZE,           /* interrupt stack size */
3429    CONFIGURE_TASK_STACK_ALLOCATOR_INIT,      /* stack allocator init */
3430    CONFIGURE_TASK_STACK_ALLOCATOR,           /* stack allocator */
3431    CONFIGURE_TASK_STACK_DEALLOCATOR,         /* stack deallocator */
3432    CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY,   /* true to clear memory */
3433    #ifdef CONFIGURE_UNIFIED_WORK_AREAS       /* true for unified work areas */
3434      true,
3435    #else
3436      false,
3437    #endif
3438    #ifdef CONFIGURE_TASK_STACK_ALLOCATOR_AVOIDS_WORK_SPACE /* true to avoid
3439                                                 work space for thread stack
3440                                                 allocation */
3441      true,
3442    #else
3443      false,
3444    #endif
3445    #ifdef RTEMS_SMP
3446      #ifdef CONFIGURE_SMP_APPLICATION
3447        true,
3448      #else
3449        false,
3450      #endif
3451    #endif
3452    CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS,   /* number of static extensions */
3453    CONFIGURE_INITIAL_EXTENSION_TABLE,        /* pointer to static extensions */
3454    #if defined(RTEMS_MULTIPROCESSING)
3455      CONFIGURE_MULTIPROCESSING_TABLE,        /* pointer to MP config table */
3456    #endif
3457    #ifdef RTEMS_SMP
3458      CONFIGURE_SMP_MAXIMUM_PROCESSORS,
3459    #endif
3460  };
3461#endif
3462
3463#endif /* CONFIGURE_HAS_OWN_CONFIGURATION_TABLE */
3464
3465#if defined(RTEMS_SMP)
3466 /*
3467  * Instantiate the Per CPU information based upon the user configuration.
3468  */
3469 #if defined(CONFIGURE_INIT)
3470   Per_CPU_Control_envelope _Per_CPU_Information[CONFIGURE_SMP_MAXIMUM_PROCESSORS];
3471 #endif
3472
3473#endif
3474
3475/*
3476 *  If the user has configured a set of Classic API Initialization Tasks,
3477 *  then we need to install the code that runs that loop.
3478 */
3479#ifdef CONFIGURE_INIT
3480  #if defined(CONFIGURE_RTEMS_INIT_TASKS_TABLE) || \
3481      defined(CONFIGURE_HAS_OWN_INIT_TASK_TABLE)
3482    void (*_RTEMS_tasks_Initialize_user_tasks_p)(void) =
3483              _RTEMS_tasks_Initialize_user_tasks_body;
3484  #else
3485    void (*_RTEMS_tasks_Initialize_user_tasks_p)(void) = NULL;
3486  #endif
3487#endif
3488
3489/*
3490 *  If the user has configured a set of POSIX Initialization Threads,
3491 *  then we need to install the code that runs that loop.
3492 */
3493#ifdef RTEMS_POSIX_API
3494  #ifdef CONFIGURE_INIT
3495    #if defined(CONFIGURE_POSIX_INIT_THREAD_TABLE) || \
3496        defined(CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE)
3497      void (*_POSIX_Threads_Initialize_user_threads_p)(void) =
3498                _POSIX_Threads_Initialize_user_threads_body;
3499    #else
3500      void (*_POSIX_Threads_Initialize_user_threads_p)(void) = NULL;
3501    #endif
3502  #endif
3503#endif
3504
3505/*
3506 *  Select PCI Configuration Library
3507 */
3508#ifdef RTEMS_PCI_CONFIG_LIB
3509  #ifdef CONFIGURE_INIT
3510    #define PCI_LIB_NONE 0
3511    #define PCI_LIB_AUTO 1
3512    #define PCI_LIB_STATIC 2
3513    #define PCI_LIB_READ 3
3514    #define PCI_LIB_PERIPHERAL 4
3515    #if CONFIGURE_PCI_LIB == PCI_LIB_AUTO
3516      #define PCI_CFG_AUTO_LIB
3517      #include <pci/cfg.h>
3518      struct pci_bus pci_hb;
3519      #define PCI_LIB_INIT pci_config_auto
3520      #define PCI_LIB_CONFIG pci_config_auto_register
3521    #elif CONFIGURE_PCI_LIB == PCI_LIB_STATIC
3522      #define PCI_CFG_STATIC_LIB
3523      #include <pci/cfg.h>
3524      #define PCI_LIB_INIT pci_config_static
3525      #define PCI_LIB_CONFIG NULL
3526      /* Let user define PCI configuration (struct pci_bus pci_hb) */
3527    #elif CONFIGURE_PCI_LIB == PCI_LIB_READ
3528      #define PCI_CFG_READ_LIB
3529      #include <pci/cfg.h>
3530      #define PCI_LIB_INIT pci_config_read
3531      #define PCI_LIB_CONFIG NULL
3532      struct pci_bus pci_hb;
3533    #elif CONFIGURE_PCI_LIB == PCI_LIB_PERIPHERAL
3534      #define PCI_LIB_INIT pci_config_peripheral
3535      #define PCI_LIB_CONFIG NULL
3536      /* Let user define PCI configuration (struct pci_bus pci_hb) */
3537    #elif CONFIGURE_PCI_LIB == PCI_LIB_NONE
3538      #define PCI_LIB_INIT NULL
3539      #define PCI_LIB_CONFIG NULL
3540      /* No PCI Configuration at all, user can use/debug access routines */
3541    #else
3542      #error NO PCI LIBRARY DEFINED
3543    #endif
3544
3545    const int pci_config_lib_type = CONFIGURE_PCI_LIB;
3546    int (*pci_config_lib_init)(void) = PCI_LIB_INIT;
3547    void (*pci_config_lib_register)(void *config) = PCI_LIB_CONFIG;
3548  #endif
3549#endif
3550
3551#ifdef __cplusplus
3552}
3553#endif
3554
3555/******************************************************************
3556 ******************************************************************
3557 ******************************************************************
3558 *         CONFIGURATION WARNINGS AND ERROR CHECKING              *
3559 ******************************************************************
3560 ******************************************************************
3561 ******************************************************************
3562 */
3563
3564#if defined(CONFIGURE_CONFDEFS_DEBUG) && defined(CONFIGURE_INIT)
3565  /**
3566   * This is a debug mechanism, so if you need to, the executable will
3567   * have a structure with various partial values.  Add to this as you
3568   * need to.  Viewing this structure in gdb combined with dumping
3569   * the Configuration structures generated should help a lot in tracing
3570   * down errors and analyzing where over and under allocations are.
3571   */
3572  typedef struct {
3573    uint32_t SYSTEM_OVERHEAD;
3574    uint32_t STATIC_EXTENSIONS;
3575    uint32_t INITIALIZATION_THREADS_STACKS;
3576
3577    uint32_t PER_INTEGER_TASK;
3578    uint32_t FP_OVERHEAD;
3579    uint32_t CLASSIC;
3580    uint32_t POSIX;
3581
3582    /* System overhead pieces */
3583    uint32_t INTERRUPT_STACK_MEMORY;
3584    uint32_t MEMORY_FOR_IDLE_TASK;
3585
3586    /* Classic API Pieces */
3587    uint32_t CLASSIC_TASKS;
3588    uint32_t TASK_VARIABLES;
3589    uint32_t TIMERS;
3590    uint32_t SEMAPHORES;
3591    uint32_t MESSAGE_QUEUES;
3592    uint32_t PARTITIONS;
3593    uint32_t REGIONS;
3594    uint32_t PORTS;
3595    uint32_t PERIODS;
3596    uint32_t BARRIERS;
3597    uint32_t USER_EXTENSIONS;
3598
3599    /* POSIX API managers that are always enabled */
3600    uint32_t POSIX_KEYS;
3601
3602#ifdef RTEMS_POSIX_API
3603    /* POSIX API Pieces */
3604    uint32_t POSIX_MUTEXES;
3605    uint32_t POSIX_CONDITION_VARIABLES;
3606    uint32_t POSIX_TIMERS;
3607    uint32_t POSIX_QUEUED_SIGNALS;
3608    uint32_t POSIX_MESSAGE_QUEUES;
3609    uint32_t POSIX_SEMAPHORES;
3610    uint32_t POSIX_BARRIERS;
3611    uint32_t POSIX_SPINLOCKS;
3612    uint32_t POSIX_RWLOCKS;
3613#endif
3614
3615    /* Stack space sizes */
3616    uint32_t IDLE_TASKS_STACK;
3617    uint32_t INITIALIZATION_THREADS_EXTRA_STACKS;
3618    uint32_t TASKS_STACK;
3619    uint32_t POSIX_THREADS_STACK;
3620    uint32_t GOROUTINES_STACK;
3621    uint32_t ADA_TASKS_STACK;
3622    uint32_t EXTRA_MPCI_RECEIVE_SERVER_STACK;
3623    uint32_t EXTRA_TASK_STACKS;
3624  } Configuration_Debug_t;
3625
3626  Configuration_Debug_t Configuration_Memory_Debug = {
3627    /* General Information */
3628    CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD,
3629    CONFIGURE_MEMORY_FOR_STATIC_EXTENSIONS,
3630    CONFIGURE_INITIALIZATION_THREADS_EXTRA_STACKS,
3631    CONFIGURE_MEMORY_FOR_TASKS(1, 0),
3632    CONFIGURE_MEMORY_FOR_TASKS(0, 1),
3633    CONFIGURE_MEMORY_FOR_CLASSIC,
3634    CONFIGURE_MEMORY_FOR_POSIX,
3635
3636    /* System overhead pieces */
3637    CONFIGURE_INTERRUPT_STACK_MEMORY,
3638    CONFIGURE_MEMORY_FOR_IDLE_TASK,
3639
3640    /* Classic API Pieces */
3641    CONFIGURE_MEMORY_FOR_TASKS(CONFIGURE_MAXIMUM_TASKS, 0),
3642    CONFIGURE_MEMORY_FOR_TASK_VARIABLES(CONFIGURE_MAXIMUM_TASK_VARIABLES +
3643      CONFIGURE_GOROUTINES_TASK_VARIABLES),
3644    CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS),
3645    CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_SEMAPHORES),
3646    CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(CONFIGURE_MAXIMUM_MESSAGE_QUEUES),
3647    CONFIGURE_MEMORY_FOR_PARTITIONS(CONFIGURE_MAXIMUM_PARTITIONS),
3648    CONFIGURE_MEMORY_FOR_REGIONS( CONFIGURE_MAXIMUM_REGIONS ),
3649    CONFIGURE_MEMORY_FOR_PORTS(CONFIGURE_MAXIMUM_PORTS),
3650    CONFIGURE_MEMORY_FOR_PERIODS(CONFIGURE_MAXIMUM_PERIODS),
3651    CONFIGURE_MEMORY_FOR_BARRIERS(CONFIGURE_BARRIERS),
3652    CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(CONFIGURE_MAXIMUM_USER_EXTENSIONS),
3653    CONFIGURE_MEMORY_FOR_POSIX_KEYS( CONFIGURE_POSIX_KEYS, \
3654                                     CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS ),
3655
3656#ifdef RTEMS_POSIX_API
3657    /* POSIX API Pieces */
3658    CONFIGURE_MEMORY_FOR_POSIX_MUTEXES( CONFIGURE_POSIX_MUTEXES ),
3659    CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES(
3660      CONFIGURE_POSIX_CONDITION_VARIABLES ),
3661    CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS(
3662      CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS ),
3663    CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES(
3664      CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES ),
3665    CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES( CONFIGURE_MAXIMUM_POSIX_SEMAPHORES ),
3666    CONFIGURE_MEMORY_FOR_POSIX_BARRIERS( CONFIGURE_MAXIMUM_POSIX_BARRIERS ),
3667    CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS( CONFIGURE_MAXIMUM_POSIX_SPINLOCKS ),
3668    CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS( CONFIGURE_MAXIMUM_POSIX_RWLOCKS ),
3669    CONFIGURE_MEMORY_FOR_POSIX_TIMERS( CONFIGURE_MAXIMUM_POSIX_TIMERS ),
3670#endif
3671
3672    /* Stack space sizes */
3673    CONFIGURE_IDLE_TASKS_STACK,
3674    CONFIGURE_INITIALIZATION_THREADS_EXTRA_STACKS,
3675    CONFIGURE_TASKS_STACK,
3676    CONFIGURE_POSIX_THREADS_STACK,
3677    CONFIGURE_GOROUTINES_STACK,
3678    CONFIGURE_ADA_TASKS_STACK,
3679    CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK,
3680    CONFIGURE_EXTRA_TASK_STACKS
3681  };
3682#endif
3683
3684/*
3685 *  Make sure a task/thread of some sort is configured.
3686 *
3687 *  When analyzing RTEMS to find the smallest possible of memory
3688 *  that must be allocated, you probably do want to configure 0
3689 *  tasks/threads so there is a smaller set of calls to _Workspace_Allocate
3690 *  to analyze.
3691 */
3692#if !defined(CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION)
3693  #if (CONFIGURE_MAXIMUM_TASKS == 0) && \
3694      (CONFIGURE_MAXIMUM_POSIX_THREADS == 0) && \
3695      (CONFIGURE_MAXIMUM_ADA_TASKS == 0) && \
3696      (CONFIGURE_MAXIMUM_GOROUTINES == 0)
3697    #error "CONFIGURATION ERROR: No tasks or threads configured!!"
3698  #endif
3699#endif
3700
3701#ifndef RTEMS_SCHEDSIM
3702/*
3703 *  Make sure at least one of the initialization task/thread
3704 *  tables was defined.
3705 */
3706#if !defined(CONFIGURE_RTEMS_INIT_TASKS_TABLE) && \
3707    !defined(CONFIGURE_POSIX_INIT_THREAD_TABLE) && \
3708    !defined(CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION)
3709#error "CONFIGURATION ERROR: No initialization tasks or threads configured!!"
3710#endif
3711#endif
3712
3713/*
3714 *  If the user is trying to configure a multiprocessing application and
3715 *  RTEMS was not configured and built multiprocessing, then error out.
3716 */
3717#if defined(CONFIGURE_MP_APPLICATION) && \
3718    !defined(RTEMS_MULTIPROCESSING)
3719#error "CONFIGURATION ERROR: RTEMS not configured for multiprocessing!!"
3720#endif
3721
3722/*
3723 *  If an attempt was made to configure POSIX objects and
3724 *  the POSIX API was not configured into RTEMS, error out.
3725 *
3726 *  @note POSIX Keys are always available so the parameters
3727 *        CONFIGURE_MAXIMUM_POSIX_KEYS and
3728 *        CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS  are not in this list.
3729 */
3730#if !defined(RTEMS_POSIX_API)
3731  #if ((CONFIGURE_MAXIMUM_POSIX_THREADS != 0) || \
3732       (CONFIGURE_MAXIMUM_POSIX_MUTEXES != 0) || \
3733       (CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES != 0) || \
3734       (CONFIGURE_MAXIMUM_POSIX_TIMERS != 0) || \
3735       (CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS != 0) || \
3736       (CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES != 0) || \
3737       (CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS != 0) || \
3738       (CONFIGURE_MAXIMUM_POSIX_SEMAPHORES != 0) || \
3739       (CONFIGURE_MAXIMUM_POSIX_BARRIERS != 0) || \
3740       (CONFIGURE_MAXIMUM_POSIX_SPINLOCKS != 0) || \
3741       (CONFIGURE_MAXIMUM_POSIX_RWLOCKS != 0) || \
3742      defined(CONFIGURE_POSIX_INIT_THREAD_TABLE))
3743  #error "CONFIGURATION ERROR: POSIX API support not configured!!"
3744  #endif
3745#endif
3746
3747#if !defined(RTEMS_SCHEDSIM)
3748  #if !defined(CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE)
3749    /*
3750     *  You must either explicity include or exclude the clock driver.
3751     *  It is such a common newbie error to leave it out.  Maybe this
3752     *  will put an end to it.
3753     *
3754     *  NOTE: If you are using the timer driver, it is considered
3755     *        mutually exclusive with the clock driver because the
3756     *        drivers are assumed to use the same "timer" hardware
3757     *        on many boards.
3758     */
3759    #if !defined(CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER) && \
3760        !defined(CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER) && \
3761        !defined(CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER)
3762      #error "CONFIGURATION ERROR: Do you want the clock driver or not?!?"
3763     #endif
3764
3765    /*
3766     * Only one of the following three configuration parameters should be
3767     * defined at a time.
3768     */
3769    #if ((defined(CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER) + \
3770          defined(CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER) + \
3771          defined(CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER)) > 1)
3772       #error "CONFIGURATION ERROR: More than one clock/timer driver configuration parameter specified?!?"
3773    #endif
3774  #endif /* !defined(CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE) */
3775#endif   /* !defined(RTEMS_SCHEDSIM) */
3776
3777/*
3778 *  These names have been obsoleted so make the user application stop compiling
3779 */
3780#if defined(CONFIGURE_TEST_NEEDS_TIMER_DRIVER) || \
3781    defined(CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER) || \
3782    defined(CONFIGURE_TEST_NEEDS_CLOCK_DRIVER) || \
3783    defined(CONFIGURE_TEST_NEEDS_RTC_DRIVER) || \
3784    defined(CONFIGURE_TEST_NEEDS_STUB_DRIVER)
3785#error "CONFIGURATION ERROR: CONFIGURE_TEST_XXX constants are obsolete"
3786#endif
3787
3788/*
3789 *  Validate the configured maximum priority
3790 */
3791#if ((CONFIGURE_MAXIMUM_PRIORITY != 3) && \
3792     (CONFIGURE_MAXIMUM_PRIORITY != 7) && \
3793     (CONFIGURE_MAXIMUM_PRIORITY != 15) && \
3794     (CONFIGURE_MAXIMUM_PRIORITY != 31) && \
3795     (CONFIGURE_MAXIMUM_PRIORITY != 63) && \
3796     (CONFIGURE_MAXIMUM_PRIORITY != 127) && \
3797     (CONFIGURE_MAXIMUM_PRIORITY != 255))
3798  #error "Maximum priority is not 1 less than a power of 2 between 4 and 256"
3799#endif
3800
3801#if (CONFIGURE_MAXIMUM_PRIORITY > PRIORITY_DEFAULT_MAXIMUM)
3802  #error "Maximum priority configured higher than supported by target."
3803#endif
3804
3805/*
3806 *  If you have fewer POSIX Message Queue Descriptors than actual
3807 *  POSIX Message Queues, then you will not be able to open all the
3808 *  queues.
3809 */
3810#if (CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS < \
3811     CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES)
3812  #error "Fewer POSIX Message Queue descriptors than Queues!"
3813#endif
3814
3815/*
3816 * POSIX Key pair shouldn't be less than POSIX Key, which is highly
3817 * likely to be error.
3818 */
3819#if (CONFIGURE_MAXIMUM_POSIX_KEYS != 0) && \
3820    (CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS != 0)
3821  #if (CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS < CONFIGURE_MAXIMUM_POSIX_KEYS)
3822    #error "Fewer POSIX Key pairs than POSIX Key!"
3823  #endif
3824#endif
3825
3826#endif
3827/* end of include file */
Note: See TracBrowser for help on using the repository browser.