source: rtems/cpukit/sapi/include/confdefs.h @ 21389c06

5
Last change on this file since 21389c06 was 21389c06, checked in by Sebastian Huber <sebastian.huber@…>, on 07/06/17 at 13:59:43

score: Make EDF the default SMP scheduler

The EDF SMP scheduler supports simple thread processor affinities
(see #3059) with a small run-time overhead. The current default SMP
scheduler lacks support for thread processor affinities at all. The EDF
SMP scheduler offers a good feature set for most applications. So, use
it by default. Run-time libraries like libgomp, MTAPI, work stealing
schedulers, language interpreters (e.g. Erlang virtual machine),
maintainence of per-processor data (e.g. Universal Memory Allocator
(UMA)), etc. use a one-to-one thread processor affinity for example.

Update #3063.

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