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

5
Last change on this file since c42be504 was c42be504, checked in by Sebastian Huber <sebastian.huber@…>, on 11/16/16 at 13:50:09

posix: Add self-contained pthread spinlock

Turn pthread_spinlock_t into a self-contained object. On uni-processor
configurations, interrupts are disabled in the lock/trylock operations
and the previous interrupt status is restored in the corresponding
unlock operations. On SMP configurations, a ticket lock is a acquired
and released in addition.

The self-contained pthread_spinlock_t object is defined by Newlib in
<sys/_pthreadtypes.h>.

typedef struct {

struct _Ticket_lock_Control _lock;
uint32_t _interrupt_state;

} pthread_spinlock_t;

This implementation is simple and efficient. However, this test case of
the Linux Test Project would fail due to call of printf() and sleep()
during spin lock ownership:

https://github.com/linux-test-project/ltp/blob/master/testcases/open_posix_testsuite/conformance/interfaces/pthread_spin_lock/1-2.c

There is only limited support for profiling on SMP configurations.

Delete CORE spinlock implementation.

Update #2674.

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