source: rtems/cpukit/sapi/include/confdefs.h @ 1c5a7e5

4.115
Last change on this file since 1c5a7e5 was e7fade3, checked in by Daniel Hellstrom <daniel@…>, on 11/28/11 at 08:52:03

DRVMGR: added driver manager to cpukit/libdrvmgr

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