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

5
Last change on this file since ca4602e was ca4602e, checked in by Sebastian Huber <sebastian.huber@…>, on 01/25/16 at 21:03:00

Use linker set for libio initialization

Update #2408.

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