source: rtems/cpukit/include/rtems/confdefs.h @ 1d9f509e

5
Last change on this file since 1d9f509e was 1d9f509e, checked in by Sebastian Huber <sebastian.huber@…>, on 12/12/19 at 07:43:06

config: Statically allocate MP thread proxies

Update #3735.

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