source: rtems/cpukit/sapi/include/confdefs.h @ c8982e5

5
Last change on this file since c8982e5 was c8982e5, checked in by Sebastian Huber <sebastian.huber@…>, on 04/26/16 at 19:20:31

posix: Simplify message queues

The mq_open() function returns a descriptor to a POSIX message queue
object identified by a name. This is similar to sem_open(). In
contrast to the POSIX semaphore the POSIX message queues use a separate
object for the descriptor. This extra object is superfluous, since the
object identifier can be used directly for this purpose, just like for
the semaphores.

Update #2702.
Update #2555.

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