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

4.115
Last change on this file since a31845f7 was a31845f7, checked in by Daniel Hellstrom <daniel@…>, on Nov 28, 2011 at 9:11:10 AM

LIBPCI: added PCI layer to cpukit/libpci

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