source: rtems/cpukit/sapi/include/confdefs.h @ 365456cc

5
Last change on this file since 365456cc was a853c851, checked in by Sebastian Huber <sebastian.huber@…>, on 12/10/15 at 14:44:02

Optional Initial Extensions initialization

Update #2408.

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