source: rtems/cpukit/sapi/include/confdefs.h @ 6c2b8a4b

Last change on this file since 6c2b8a4b was 6c2b8a4b, checked in by Sebastian Huber <sebastian.huber@…>, on Nov 29, 2017 at 5:23:27 AM

score: Use self-contained API mutex

Use a self-contained recursive mutex for API_Mutex_Control. The API
mutexes are protected against asynchronous thread cancellation.

Add dedicated mutexes for libatomic and TOD.

Close #2629.
Close #2630.

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