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

4.115
Last change on this file since a46e6b6d was a46e6b6d, checked in by Joel Sherrill <joel.sherrill@…>, on 07/30/10 at 18:44:46

2010-07-30 Vinu Rajashekhar <vinutheraj@…>

  • sapi/include/confdefs.h: Add configuration macros for Go requirements.
  • Property mode set to 100644
File size: 71.4 KB
Line 
1/**
2 * @file rtems/confdefs.h
3 *
4 *  This include file contains the configuration table template that will
5 *  be instantiated by an application based on the setting of a number
6 *  of macros.  The macros are documented in the Configuring a System
7 *  chapter of the Classic API User's Guide
8 *
9 *  The model is to estimate the memory required for each configured item
10 *  and sum those estimates.  The estimate can be too high or too low for
11 *  a variety of reasons:
12 *
13 *  Reasons estimate is too high:
14 *    + FP contexts (not all tasks are FP)
15 *
16 *  Reasons estimate is too low:
17 *    + stacks greater than minimum size
18 *    + messages
19 *    + application must account for device driver resources
20 *    + application must account for add-on library resource requirements
21 *
22 *  NOTE:  Eventually this may be able to take into account some of
23 *         the above.  This procedure has evolved from just enough to
24 *         support the RTEMS Test Suites into something that can be
25 *         used remarkably reliably by most applications.
26 */
27
28/*
29 *  COPYRIGHT (c) 1989-2010.
30 *  On-Line Applications Research Corporation (OAR).
31 *
32 *  The license and distribution terms for this file may be
33 *  found in the file LICENSE in this distribution or at
34 *  http://www.rtems.com/license/LICENSE.
35 *
36 *  $Id$
37 */
38
39#ifndef __CONFIGURATION_TEMPLATE_h
40#define __CONFIGURATION_TEMPLATE_h
41
42/*
43 * Include the executive's configuration
44 */
45#include <rtems/score/cpuopts.h>
46#include <rtems/score/apimutex.h>
47
48#ifdef __cplusplus
49extern "C" {
50#endif
51
52extern rtems_initialization_tasks_table Initialization_tasks[];
53extern rtems_driver_address_table       Device_drivers[];
54extern rtems_configuration_table        Configuration;
55#if defined(RTEMS_MULTIPROCESSING)
56  extern rtems_multiprocessing_table      Multiprocessing_configuration;
57#endif
58#ifdef RTEMS_POSIX_API
59  extern posix_api_configuration_table    Configuration_POSIX_API;
60#endif
61
62/**
63 *  This macro determines whether the RTEMS reentrancy support for
64 *  the Newlib C Library is enabled.
65 */
66#if (defined(RTEMS_NEWLIB) && !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY))
67  #define CONFIGURE_NEWLIB_EXTENSION 1
68#else
69  #define CONFIGURE_NEWLIB_EXTENSION 0
70#endif
71
72#include <rtems/libio.h>
73
74#ifdef CONFIGURE_INIT
75rtems_libio_init_functions_t rtems_libio_init_helper =
76    #ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM
77    NULL;
78    #else
79    rtems_libio_init;
80    #endif
81
82rtems_libio_supp_functions_t rtems_libio_supp_helper =
83    #ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM
84    NULL;
85    #else
86    open_dev_console;
87    #endif
88
89rtems_fs_init_functions_t    rtems_fs_init_helper =
90    #ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM
91    NULL;
92    #else
93    rtems_filesystem_initialize;
94    #endif
95#endif
96
97
98/*
99 *  If the application disables the filesystem, they will not need
100 *  a mount table, so do not produce one.
101 */
102#ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM
103  #define CONFIGURE_HAS_OWN_MOUNT_TABLE
104#endif
105
106/**
107 *  This macro defines the number of POSIX file descriptors allocated
108 *  and managed by libio.  These are the "integer" file descriptors that
109 *  are used by calls like open(2) and read(2).
110 */
111#ifndef CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS
112  #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 3
113#endif
114
115/**
116 *  From the number of file descriptors, we can determine how many
117 *  semaphores the implementation will require.
118 */
119#define CONFIGURE_LIBIO_SEMAPHORES \
120  (CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS + 1)
121
122#ifdef CONFIGURE_INIT
123  /**
124   *  When instantiating the configuration tables, this variable is
125   *  initialized to specify the maximum number of file descriptors.
126   */
127  uint32_t rtems_libio_number_iops = CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS;
128#endif
129
130/**
131 *  This macro determines if termios is disabled by this application.
132 *  This only means that resources will not be reserved.  If you end
133 *  up using termios, it will fail.
134 */
135#ifdef CONFIGURE_TERMIOS_DISABLED
136  #define CONFIGURE_TERMIOS_SEMAPHORES 0
137#else
138  /**
139   *  This macro specifies the number of serial or PTY ports that will
140   *  use termios.
141   */
142  #ifndef CONFIGURE_NUMBER_OF_TERMIOS_PORTS
143  #define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 1
144  #endif
145
146  /**
147   *  This macro reserves the number of semaphores required by termios
148   *  based upon the number of communication ports that will use it.
149   */
150  #define CONFIGURE_TERMIOS_SEMAPHORES \
151    ((CONFIGURE_NUMBER_OF_TERMIOS_PORTS * 4) + 1)
152#endif
153
154/**
155 *  This macro specifies the number of PTYs that can be concurrently
156 *  active.
157 */
158#ifndef CONFIGURE_MAXIMUM_PTYS
159  #define CONFIGURE_MAXIMUM_PTYS 0
160#endif
161
162/**
163 *  This variable contains the maximum number of PTYs that can be
164 *  concurrently active.
165 */
166#ifdef CONFIGURE_INIT
167  int rtems_telnetd_maximum_ptys = CONFIGURE_MAXIMUM_PTYS;
168#else
169  extern int rtems_telnetd_maximum_ptys;
170#endif
171
172/*
173 *  Filesystems and Mount Table Configuration.
174 *
175 *  Defines to control the file system:
176 *
177 *   CONFIGURE_APPLICATION_DISABLE_FILESYSTEM:
178 *     Disable the RTEMS filesystems. You get an empty DEVFS.
179 *
180 *   CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM:
181 *     Use the DEVFS as the root file system. Limited functions are
182 *     provided when this is used.
183 *
184 *   CONFIGURE_FILESYSTEM_ALL:
185 *     Add file filesystems to the default filesystem table.
186 *
187 *   List of available file systems. You can define as many as you like:
188 *     CONFIGURE_FILESYSTEM_MINIIMFS - MiniIMFS, use DEVFS now
189 *     CONFIGURE_FILESYSTEM_IMFS     - In Memory File System (IMFS)
190 *     CONFIGURE_FILESYSTEM_DEVFS    - Device File System (DSVFS)
191 *     CONFIGURE_FILESYSTEM_TFTPFS   - TFTP File System, networking enabled
192 *     CONFIGURE_FILESYSTEM_FTPFS    - FTP File System, networking enabled
193 *     CONFIGURE_FILESYSTEM_NFS      - Network File System, networking enabled
194 *     CONFIGURE_FILESYSTEM_DOSFS    - DOS File System, uses libblock
195 *     CONFIGURE_FILESYSTEM_RFS      - RTEMS File System (RFS), uses libblock
196 *
197 *   Combinations:
198 *
199 *    - If nothing is defined the base file system is the IMFS.
200 *
201 *    - If CONFIGURE_APPLICATION_DISABLE_FILESYSTEM is defined all filesystem
202 *      are disabled by force and an empty DEVFS is created.
203 *
204 *    - If CONFIGURE_USE_DEV_AS_BASE_FILESYSTEM is defined all filesystem
205 *      are disabled by force and DEVFS is defined.
206 */
207
208#ifdef CONFIGURE_INIT
209
210  /*
211   * Include all file systems. Do this before checking if the filesystem has
212   * been disabled.
213   */
214  #ifdef CONFIGURE_FILESYSTEM_ALL
215    #define CONFIGURE_FILESYSTEM_MINIIMFS
216    #define CONFIGURE_FILESYSTEM_IMFS
217    #define CONFIGURE_FILESYSTEM_DEVFS
218    #define CONFIGURE_FILESYSTEM_TFTPFS
219    #define CONFIGURE_FILESYSTEM_FTPFS
220    #define CONFIGURE_FILESYSTEM_NFS
221    #define CONFIGURE_FILESYSTEM_DOSFS
222    #define CONFIGURE_FILESYSTEM_RFS
223  #endif
224
225  /*
226   * If disabling the file system, give a compile error if the user has
227   * configured other filesystem parameters.
228   */
229  #if defined(CONFIGURE_APPLICATION_DISABLE_FILESYSTEM)
230     #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM) || \
231         defined(CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM)
232       #error "Filesystem disabled but a base filesystem configured."
233     #endif
234
235    #if defined(CONFIGURE_FILESYSTEM_MINIIMFS) || \
236        defined(CONFIGURE_FILESYSTEM_IMFS) || \
237        defined(CONFIGURE_FILESYSTEM_DEVFS) || \
238        defined(CONFIGURE_FILESYSTEM_TFTPFS) || \
239        defined(CONFIGURE_FILESYSTEM_FTPFS) || \
240        defined(CONFIGURE_FILESYSTEM_NFS) || \
241        defined(CONFIGURE_FILESYSTEM_DOSFS) || \
242        defined(CONFIGURE_FILESYSTEM_RFS)
243        #error "Configured filesystems but root filesystem was not IMFS!"
244        #error "Filesystems could be disabled, DEVFS is root, or"
245        #error "  miniIMFS is root!"
246     #endif
247  #endif
248
249  /*
250   * If the base filesystem is DEVFS define it else define IMFS.
251   * We will have either DEVFS or IMFS defined after this.
252   */
253  #if !defined(CONFIGURE_APPLICATION_DISABLE_FILESYSTEM)
254    #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM)
255      #define CONFIGURE_FILESYSTEM_DEVFS
256    #elif defined(CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM)
257      #define CONFIGURE_FILESYSTEM_MINIIMFS
258    #elif !defined(CONFIGURE_FILESYSTEM_IMFS)
259      #define CONFIGURE_FILESYSTEM_IMFS
260    #endif
261  #endif
262
263#endif
264
265/**
266 * IMFS
267 */
268#include <rtems/imfs.h>
269
270/**
271 *  This specifies the number of bytes per block for files within the IMFS.
272 *  There are a maximum number of blocks per file so this dictates the maximum
273 *  size of a file.  This has to be balanced with the unused portion of each
274 *  block that might be wasted.
275 */
276#ifndef CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK
277  #define CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK \
278                    IMFS_MEMFILE_DEFAULT_BYTES_PER_BLOCK
279#endif
280
281/**
282 *  This defines the miniIMFS file system table entry.
283 */
284#if !defined(CONFIGURE_FILESYSTEM_ENTRY_miniIMFS) && \
285    defined(CONFIGURE_FILESYSTEM_MINIIMFS)
286  #define CONFIGURE_FILESYSTEM_ENTRY_miniIMFS \
287    { RTEMS_FILESYSTEM_TYPE_MINIIMFS, miniIMFS_initialize }
288#endif
289
290/**
291 *  Internall it is called FIFOs not pipes
292 */
293#if defined(CONFIGURE_PIPES_ENABLED)
294  #define CONFIGURE_FIFOS_ENABLED
295#endif
296
297/**
298 *  This defines the IMFS file system table entry.
299 */
300#if !defined(CONFIGURE_FILESYSTEM_ENTRY_IMFS) && \
301    defined(CONFIGURE_FILESYSTEM_IMFS)
302  #if defined(CONFIGURE_FIFOS_ENABLED)
303    #define CONFIGURE_FILESYSTEM_ENTRY_IMFS \
304      { RTEMS_FILESYSTEM_TYPE_IMFS, fifoIMFS_initialize }
305  #else
306    #define CONFIGURE_FILESYSTEM_ENTRY_IMFS \
307      { RTEMS_FILESYSTEM_TYPE_IMFS, IMFS_initialize }
308  #endif
309#endif
310
311/**
312 *  This sets up the resources for the PIPES/FIFOs
313 */
314#if defined(CONFIGURE_FIFOS_ENABLED)
315  #if !defined(CONFIGURE_MAXIMUM_FIFOS) && !defined(CONFIGURE_MAXIMUM_PIPES)
316     #error "No FIFOs or PIPES configured"
317  #endif
318  #if !defined(CONFIGURE_MAXIMUM_FIFOS)
319    #define CONFIGURE_MAXIMUM_FIFOS 0
320  #endif
321  #if !defined(CONFIGURE_MAXIMUM_PIPES)
322    #define CONFIGURE_MAXIMUM_PIPES 0
323  #endif
324  #define CONFIGURE_BARRIERS_FOR_FIFOS \
325    (2 * (CONFIGURE_MAXIMUM_FIFOS + CONFIGURE_MAXIMUM_PIPES))
326  #define CONFIGURE_SEMAPHORES_FOR_FIFOS \
327    (1 + (CONFIGURE_MAXIMUM_FIFOS + CONFIGURE_MAXIMUM_PIPES))
328#else
329  #define CONFIGURE_BARRIERS_FOR_FIFOS   0
330  #define CONFIGURE_SEMAPHORES_FOR_FIFOS 0
331#endif
332
333/**
334 * DEVFS
335 */
336#if !defined(CONFIGURE_FILESYSTEM_ENTRY_DEVFS) && \
337    defined(CONFIGURE_FILESYSTEM_DEVFS)
338#include <rtems/devfs.h>
339  #define CONFIGURE_FILESYSTEM_ENTRY_DEVFS \
340    { RTEMS_FILESYSTEM_TYPE_DEVFS, devFS_initialize }
341#endif
342
343#ifdef RTEMS_NETWORKING
344  /**
345   * FTPFS
346   */
347  #if !defined(CONFIGURE_FILESYSTEM_ENTRY_FTPFS) && \
348      defined(CONFIGURE_FILESYSTEM_FTPFS)
349    #include <rtems/ftpfs.h>
350    #define CONFIGURE_FILESYSTEM_ENTRY_FTPFS \
351      { RTEMS_FILESYSTEM_TYPE_FTPFS, rtems_ftpfs_initialize }
352  #endif
353
354  /**
355   * TFTPFS
356   */
357  #if !defined(CONFIGURE_FILESYSTEM_ENTRY_TFTPFS) && \
358      defined(CONFIGURE_FILESYSTEM_TFTPFS)
359    #include <rtems/tftp.h>
360    #define CONFIGURE_FILESYSTEM_ENTRY_TFTPFS \
361      { RTEMS_FILESYSTEM_TYPE_TFTPFS, rtems_tftpfs_initialize }
362  #endif
363
364  /**
365   * NFS
366   */
367  #if !defined(CONFIGURE_FILESYSTEM_ENTRY_NFS) && \
368      defined(CONFIGURE_FILESYSTEM_NFS)
369    #include <librtemsNfs.h>
370    #define CONFIGURE_FILESYSTEM_ENTRY_NFS \
371      { RTEMS_FILESYSTEM_TYPE_NFS, rtems_nfs_initialize }
372  #endif
373#endif
374
375/**
376 * DOSFS
377 */
378#if !defined(CONFIGURE_FILESYSTEM_ENTRY_DOSFS) && \
379    defined(CONFIGURE_FILESYSTEM_DOSFS)
380  #include <rtems/dosfs.h>
381  #define CONFIGURE_FILESYSTEM_ENTRY_DOSFS \
382    { RTEMS_FILESYSTEM_TYPE_DOSFS, rtems_dosfs_initialize }
383#endif
384
385/**
386 * RFS
387 */
388#if !defined(CONFIGURE_FILESYSTEM_ENTRY_RFS) && \
389    defined(CONFIGURE_FILESYSTEM_RFS)
390  #include <rtems/rtems-rfs.h>
391  #define CONFIGURE_FILESYSTEM_ENTRY_RFS \
392    { RTEMS_FILESYSTEM_TYPE_RFS, rtems_rfs_rtems_initialise }
393#endif
394
395#ifdef CONFIGURE_INIT
396
397  /*
398   *  DEVFS variables.
399   */
400  #if defined(CONFIGURE_APPLICATION_DISABLE_FILESYSTEM)
401    #define CONFIGURE_MEMORY_FOR_DEVFS  0
402  #elif defined(CONFIGURE_FILESYSTEM_DEVFS)
403    #ifndef CONFIGURE_MAXIMUM_DEVICES
404      #define CONFIGURE_MAXIMUM_DEVICES 4
405    #endif
406    #include <rtems/devfs.h>
407    uint32_t rtems_device_table_size = CONFIGURE_MAXIMUM_DEVICES;
408    #define CONFIGURE_MEMORY_FOR_DEVFS \
409      _Configure_Object_RAM(CONFIGURE_MAXIMUM_DEVICES, \
410         sizeof (rtems_device_name_t))
411  #else
412    #define CONFIGURE_MEMORY_FOR_DEVFS  0
413  #endif
414
415  #if defined(CONFIGURE_FILESYSTEM_IMFS) || \
416      defined(CONFIGURE_FILESYSTEM_MINIIMFS)
417    int imfs_rq_memfile_bytes_per_block = CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK;
418  #endif
419
420  /**
421   * Table termination record.
422   */
423  #define CONFIGURE_FILESYSTEM_NULL { NULL, NULL }
424
425  /**
426   * The default file system table. Must be terminated with the NULL entry if
427   * you provide your own.
428   */
429  #ifndef CONFIGURE_HAS_OWN_FILESYSTEM_TABLE
430    const rtems_filesystem_table_t rtems_filesystem_table[] = {
431      #if defined(CONFIGURE_FILESYSTEM_MINIIMFS) && \
432          defined(CONFIGURE_FILESYSTEM_ENTRY_miniIMFS)
433        CONFIGURE_FILESYSTEM_ENTRY_miniIMFS,
434      #endif
435      #if defined(CONFIGURE_FILESYSTEM_IMFS) && \
436          defined(CONFIGURE_FILESYSTEM_ENTRY_IMFS)
437        CONFIGURE_FILESYSTEM_ENTRY_IMFS,
438      #endif
439      #if defined(CONFIGURE_FILESYSTEM_DEVFS) && \
440          defined(CONFIGURE_FILESYSTEM_ENTRY_DEVFS)
441        CONFIGURE_FILESYSTEM_ENTRY_DEVFS,
442      #endif
443      #if defined(CONFIGURE_FILESYSTEM_TFTPFS) && \
444          defined(CONFIGURE_FILESYSTEM_ENTRY_TFTPFS)
445        CONFIGURE_FILESYSTEM_ENTRY_TFTPFS,
446      #endif
447      #if defined(CONFIGURE_FILESYSTEM_FTPFS) && \
448          defined(CONFIGURE_FILESYSTEM_ENTRY_FTPFS)
449        CONFIGURE_FILESYSTEM_ENTRY_FTPFS,
450      #endif
451      #if defined(CONFIGURE_FILESYSTEM_NFS) && \
452          defined(CONFIGURE_FILESYSTEM_ENTRY_NFS)
453        CONFIGURE_FILESYSTEM_ENTRY_NFS,
454      #endif
455      #if defined(CONFIGURE_FILESYSTEM_DOSFS) && \
456          defined(CONFIGURE_FILESYSTEM_ENTRY_DOSFS)
457        CONFIGURE_FILESYSTEM_ENTRY_DOSFS,
458      #endif
459      #if defined(CONFIGURE_FILESYSTEM_RFS) && \
460          defined(CONFIGURE_FILESYSTEM_ENTRY_RFS)
461        CONFIGURE_FILESYSTEM_ENTRY_RFS,
462      #endif
463      CONFIGURE_FILESYSTEM_NULL
464    };
465  #endif
466
467  #ifndef CONFIGURE_HAS_OWN_MOUNT_TABLE
468    const rtems_filesystem_mount_table_t configuration_mount_table = {
469      #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM)
470        RTEMS_FILESYSTEM_TYPE_DEVFS,
471      #elif defined(CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM)
472        RTEMS_FILESYSTEM_TYPE_MINIIMFS,
473      #else  /* using IMFS as base filesystem */
474        RTEMS_FILESYSTEM_TYPE_IMFS,
475      #endif
476      RTEMS_FILESYSTEM_READ_WRITE,
477      NULL,
478      NULL
479    };
480
481    const rtems_filesystem_mount_table_t
482        *rtems_filesystem_mount_table = &configuration_mount_table;
483    const int rtems_filesystem_mount_table_size = 1;
484  #endif
485
486#endif
487
488/*
489 *  STACK_CHECER_ON was still available in 4.9 so give a warning for now.
490 */
491#if defined(STACK_CHECKER_ON)
492  #define CONFIGURE_STACK_CHECKER_ENABLED
493  #warning "STACK_CHECKER_ON deprecated -- use CONFIGURE_STACK_CHECKER_ENABLED"
494#endif
495
496/**
497 *  This configures the stack checker user extension.
498 */
499#ifdef CONFIGURE_STACK_CHECKER_ENABLED
500  #define CONFIGURE_STACK_CHECKER_EXTENSION 1
501#else
502  #define CONFIGURE_STACK_CHECKER_EXTENSION 0
503#endif
504
505/**
506 *  @brief Maximum Priority configuration
507 *
508 *  This configures the maximum priority value that
509 *  a task may have.
510 *
511 *  By reducing the number of priorities in a system,
512 *  the amount of RAM required by RTEMS can be significantly
513 *  reduced.  RTEMS allocates a Chain_Control structure per
514 *  priority and this structure contains 3 pointers.  So
515 *  the default is (256 * 12) = 3K on 32-bit architectures.
516 *
517 *  This must be one less than a power of 2 between
518 *  4 and 256.  Valid values along with the application
519 *  priority levels and memory saved when pointers are
520 *  32-bits in size are:
521 *
522 *    + 3,  2 application priorities, 3024 bytes saved
523 *    + 7, 5 application priorities, 2976 bytes saved
524 *    + 15, 13 application priorities, 2880 bytes saved
525 *    + 31, 29 application priorities, 2688 bytes saved
526 *    + 63, 61 application priorities, 2304 bytes saved
527 *    + 127, 125 application priorities, 1536 bytes saved
528 *    + 255, 253 application priorities, 0 bytes saved
529 *
530 *  It is specified in terms of Classic API
531 *  priority values.
532 */
533#ifndef CONFIGURE_MAXIMUM_PRIORITY
534  #define CONFIGURE_MAXIMUM_PRIORITY PRIORITY_DEFAULT_MAXIMUM
535#endif
536
537/*
538 *  If you said the IDLE task was going to do application initialization
539 *  and didn't override the IDLE body, then something is amiss.
540 */
541#if (defined(CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION) && \
542     !defined(CONFIGURE_IDLE_TASK_BODY))
543  #error "CONFIGURE_ERROR: You did not override the IDLE task body."
544#endif
545
546/**
547 *  @brief Idle task body configuration
548 *
549 *  There is a default IDLE thread body provided by RTEMS which
550 *  has the possibility of being CPU specific.  There may be a
551 *  BSP specific override of the RTEMS default body and in turn,
552 *  the application may override and provide its own.
553 */
554#ifndef CONFIGURE_IDLE_TASK_BODY
555  #if defined(BSP_IDLE_TASK_BODY)
556    #define CONFIGURE_IDLE_TASK_BODY BSP_IDLE_TASK_BODY
557  #elif (CPU_PROVIDES_IDLE_THREAD_BODY == TRUE)
558    #define CONFIGURE_IDLE_TASK_BODY _CPU_Thread_Idle_body
559  #else
560    /* only instantiate and compile if used */
561    #ifdef CONFIGURE_INIT
562      void *_Thread_Idle_body(uintptr_t ignored)
563      {
564        for( ; ; ) ;
565        return 0;   /* to avoid warning */
566      }
567    #endif
568    #define CONFIGURE_IDLE_TASK_BODY _Thread_Idle_body
569  #endif
570#endif
571
572/**
573 *  By default, use the minimum stack size requested by this port.
574 */
575#ifndef CONFIGURE_MINIMUM_TASK_STACK_SIZE
576  #define CONFIGURE_MINIMUM_TASK_STACK_SIZE CPU_STACK_MINIMUM_SIZE
577#endif
578
579/**
580 *  @brief Idle task stack size configuration
581 *
582 *  By default, the IDLE task will have a stack of minimum size.
583 *  The BSP or application may override this value.
584 */
585#ifndef CONFIGURE_IDLE_TASK_STACK_SIZE
586  #ifdef BSP_IDLE_TASK_STACK_SIZE
587    #define CONFIGURE_IDLE_TASK_STACK_SIZE BSP_IDLE_TASK_STACK_SIZE
588  #else
589    #define CONFIGURE_IDLE_TASK_STACK_SIZE CONFIGURE_MINIMUM_TASK_STACK_SIZE
590  #endif
591#endif
592
593/**
594 *  @brief Interrupt stack size configuration
595 *
596 *  By default, the interrupt stack will be of minimum size.
597 *  The BSP or application may override this value.
598 */
599#ifndef CONFIGURE_INTERRUPT_STACK_SIZE
600  #ifdef BSP_INTERRUPT_STACK_SIZE
601    #define CONFIGURE_INTERRUPT_STACK_SIZE BSP_INTERRUPT_STACK_SIZE
602  #else
603    #define CONFIGURE_INTERRUPT_STACK_SIZE CONFIGURE_MINIMUM_TASK_STACK_SIZE
604  #endif
605#endif
606
607/**
608 *  This reserves memory for the interrupt stack if it is to be allocated
609 *  by RTEMS rather than the BSP.
610 *
611 *  @todo Try to get to the point where all BSPs support allocating the
612 *        memory from the Workspace.
613 */
614#if (CPU_ALLOCATE_INTERRUPT_STACK == 0)
615  #define CONFIGURE_INTERRUPT_STACK_MEMORY 0
616#else
617  #define CONFIGURE_INTERRUPT_STACK_MEMORY \
618     _Configure_From_workspace( CONFIGURE_INTERRUPT_STACK_SIZE )
619#endif
620
621/**
622 *  Configure the very much optional task stack allocator
623 */
624#ifndef CONFIGURE_TASK_STACK_ALLOCATOR
625  #define CONFIGURE_TASK_STACK_ALLOCATOR NULL
626#endif
627
628/**
629 *  Configure the very much optional task stack deallocator
630 */
631#ifndef CONFIGURE_TASK_STACK_DEALLOCATOR
632  #define CONFIGURE_TASK_STACK_DEALLOCATOR NULL
633#endif
634
635/**
636 *  Should the RTEMS Workspace and C Program Heap be cleared automatically
637 *  at system start up?
638 */
639#ifndef CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY
640  #ifdef BSP_ZERO_WORKSPACE_AUTOMATICALLY
641    #define CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY \
642            BSP_ZERO_WORKSPACE_AUTOMATICALLY
643  #else
644    #define CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY FALSE
645  #endif
646#endif
647
648/*
649 *  RTEMS Malloc configuration
650 */
651
652#include <rtems/malloc.h>
653
654#ifdef CONFIGURE_INIT
655  /**
656   *  By default, RTEMS uses separate heaps for the RTEMS Workspace and
657   *  the C Program Heap.  On many BSPs, these can be optionally
658   *  combined provided one larger memory pool. This is particularly
659   *  useful in combination with the unlimited objects configuration.
660   */
661  #ifdef CONFIGURE_UNIFIED_WORK_AREAS
662    #include <rtems/score/wkspace.h>
663    Heap_Control  *RTEMS_Malloc_Heap = &_Workspace_Area;
664    bool           rtems_unified_work_area = true;
665  #else
666    Heap_Control   RTEMS_Malloc_Area;
667    Heap_Control  *RTEMS_Malloc_Heap = &RTEMS_Malloc_Area;
668    bool           rtems_unified_work_area = false;
669  #endif
670#endif
671
672#ifdef CONFIGURE_INIT
673  /**
674   *  This configures the malloc family statistics to be available.
675   *  By default only function call counts are kept.
676   */
677  rtems_malloc_statistics_functions_t *rtems_malloc_statistics_helpers =
678    #ifndef CONFIGURE_MALLOC_STATISTICS
679      NULL;
680    #else
681      &rtems_malloc_statistics_helpers_table;
682    #endif
683#endif
684
685#ifdef CONFIGURE_INIT
686  /**
687   *  This configures the sbrk() support for the malloc family.
688   *  By default it is assumed that the BSP provides all available
689   *  RAM to the malloc family implementation so sbrk()'ing to get
690   *  more memory would always fail anyway.
691   */
692  rtems_malloc_sbrk_functions_t *rtems_malloc_sbrk_helpers =
693    #ifndef CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK
694      NULL;
695    #else
696      &rtems_malloc_sbrk_helpers_table;
697    #endif
698#endif
699
700#ifdef CONFIGURE_INIT
701  /**
702   *  This configures the malloc family plugin which dirties memory
703   *  allocated.  This is helpful for finding unitialized data structure
704   *  problems.
705   */
706  rtems_malloc_dirtier_t rtems_malloc_dirty_helper =
707    #if defined(CONFIGURE_MALLOC_DIRTY)
708      rtems_malloc_dirty_memory;
709    #else
710      NULL;
711    #endif
712#endif
713
714/**
715 *  This is a helper macro used in calculations in this file.  It is used
716 *  to noted when an element is allocated from the RTEMS Workspace and adds
717 *  a factor to account for heap overhead plus an alignment factor that
718 *  may be applied.
719 */
720#define _Configure_From_workspace(_size) \
721  (ssize_t)((_size) + (2 * sizeof(uint32_t)) + CPU_ALIGNMENT)
722
723/**
724 *  Do not use the unlimited bit as part of the multiplication
725 *  for memory usage.
726 */
727#define _Configure_Max_Objects(_max) \
728  ((_max) & ~RTEMS_UNLIMITED_OBJECTS)
729
730/**
731 *  This macro accounts for how memory for a set of configured objects is
732 *  allocated from the Executive Workspace.
733 *
734 *  NOTE: It does NOT attempt to address the more complex case of unlimited
735 *        objects.
736 */
737#define _Configure_Object_RAM(_number, _size) \
738  ( _Configure_From_workspace(_Configure_Max_Objects(_number) * (_size)) + \
739    _Configure_From_workspace( \
740      ((_Configure_Max_Objects(_number) + 1) * sizeof(Objects_Control *)) + \
741      (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) \
742    ) \
743  )
744
745/*
746 *  Default User Initialization Task Table.  This table guarantees that
747 *  one user initialization table is defined.
748 */
749
750#ifdef CONFIGURE_RTEMS_INIT_TASKS_TABLE
751
752#ifdef CONFIGURE_HAS_OWN_INIT_TASK_TABLE
753
754/*
755 *  The user is defining their own table information and setting the
756 *  appropriate variables.
757 */
758
759#else
760
761#ifndef CONFIGURE_INIT_TASK_NAME
762  #define CONFIGURE_INIT_TASK_NAME          rtems_build_name('U', 'I', '1', ' ')
763#endif
764
765#ifndef CONFIGURE_INIT_TASK_STACK_SIZE
766  #define CONFIGURE_INIT_TASK_STACK_SIZE    CONFIGURE_MINIMUM_TASK_STACK_SIZE
767#endif
768
769#ifndef CONFIGURE_INIT_TASK_PRIORITY
770  #define CONFIGURE_INIT_TASK_PRIORITY      1
771#endif
772
773#ifndef CONFIGURE_INIT_TASK_ATTRIBUTES
774  #define CONFIGURE_INIT_TASK_ATTRIBUTES    RTEMS_DEFAULT_ATTRIBUTES
775#endif
776
777#ifndef CONFIGURE_INIT_TASK_ENTRY_POINT
778  #ifdef __cplusplus
779  extern "C" {
780  #endif
781    rtems_task Init (rtems_task_argument );
782  #ifdef __cplusplus
783  }
784  #endif
785  #define CONFIGURE_INIT_TASK_ENTRY_POINT   Init
786  extern const char* bsp_boot_cmdline;
787  #define CONFIGURE_INIT_TASK_ARGUMENTS     ((rtems_task_argument) &bsp_boot_cmdline)
788#endif
789
790#ifndef CONFIGURE_INIT_TASK_INITIAL_MODES
791  #define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_NO_PREEMPT
792#endif
793
794#ifndef CONFIGURE_INIT_TASK_ARGUMENTS
795  #define CONFIGURE_INIT_TASK_ARGUMENTS     0
796#endif
797
798#ifdef CONFIGURE_INIT
799  rtems_initialization_tasks_table Initialization_tasks[] = {
800    { CONFIGURE_INIT_TASK_NAME,
801      CONFIGURE_INIT_TASK_STACK_SIZE,
802      CONFIGURE_INIT_TASK_PRIORITY,
803      CONFIGURE_INIT_TASK_ATTRIBUTES,
804      CONFIGURE_INIT_TASK_ENTRY_POINT,
805      CONFIGURE_INIT_TASK_INITIAL_MODES,
806      CONFIGURE_INIT_TASK_ARGUMENTS
807    }
808  };
809#endif
810
811#define CONFIGURE_INIT_TASK_TABLE Initialization_tasks
812
813#define CONFIGURE_INIT_TASK_TABLE_SIZE \
814  sizeof(CONFIGURE_INIT_TASK_TABLE) / sizeof(rtems_initialization_tasks_table)
815
816#endif    /* CONFIGURE_HAS_OWN_INIT_TASK_TABLE */
817
818#else     /* CONFIGURE_RTEMS_INIT_TASKS_TABLE */
819
820#define CONFIGURE_INIT_TASK_TABLE      NULL
821#define CONFIGURE_INIT_TASK_TABLE_SIZE 0
822#define CONFIGURE_INIT_TASK_STACK_SIZE 0
823
824#endif
825
826/*
827 *  Default Device Driver Table.  Each driver needed by the test is explicitly
828 *  choosen by that test.  There is always a null driver entry.
829 */
830
831#define NULL_DRIVER_TABLE_ENTRY \
832 { NULL, NULL, NULL, NULL, NULL, NULL }
833
834#ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
835  #include <rtems/console.h>
836#endif
837
838#ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
839  #include <rtems/clockdrv.h>
840#endif
841
842#ifdef CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
843  #include <rtems/timerdrv.h>
844#endif
845
846#ifdef CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER
847  #include <rtems/rtc.h>
848#endif
849
850#ifdef CONFIGURE_APPLICATION_NEEDS_WATCHDOG_DRIVER
851  #include <rtems/watchdogdrv.h>
852#endif
853
854#ifdef CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER
855  #include <rtems/framebuffer.h>
856#endif
857
858#ifdef CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER
859  #include <rtems/devnull.h>
860#endif
861
862#ifdef CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER
863  /* the ide driver needs the ATA driver */
864  #ifndef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
865    #define CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
866  #endif
867  #include <libchip/ide_ctrl.h>
868#endif
869
870#ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
871  #include <libchip/ata.h>
872#endif
873
874#ifndef CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE
875
876#ifdef CONFIGURE_INIT
877  rtems_driver_address_table Device_drivers[] = {
878    #ifdef CONFIGURE_BSP_PREREQUISITE_DRIVERS
879      CONFIGURE_BSP_PREREQUISITE_DRIVERS,
880    #endif
881    #ifdef CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS
882      CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS,
883    #endif
884    #ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
885      CONSOLE_DRIVER_TABLE_ENTRY,
886    #endif
887    #ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
888      CLOCK_DRIVER_TABLE_ENTRY,
889    #endif
890    #ifdef CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER
891      RTC_DRIVER_TABLE_ENTRY,
892    #endif
893    #ifdef CONFIGURE_APPLICATION_NEEDS_WATCHDOG_DRIVER
894      WATCHDOG_DRIVER_TABLE_ENTRY,
895    #endif
896    #ifdef CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER
897      DEVNULL_DRIVER_TABLE_ENTRY,
898    #endif
899    #ifdef CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER
900      IDE_CONTROLLER_DRIVER_TABLE_ENTRY,
901    #endif
902    #ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
903      ATA_DRIVER_TABLE_ENTRY,
904    #endif
905    #ifdef CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER
906      FRAME_BUFFER_DRIVER_TABLE_ENTRY,
907    #endif
908    #ifdef CONFIGURE_APPLICATION_EXTRA_DRIVERS
909      CONFIGURE_APPLICATION_EXTRA_DRIVERS,
910    #endif
911    #ifdef CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER
912      NULL_DRIVER_TABLE_ENTRY
913    #elif !defined(CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER) && \
914        !defined(CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER) && \
915        !defined(CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER) && \
916        !defined(CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER) && \
917        !defined(CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER) && \
918        !defined(CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER) && \
919        !defined(CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER) && \
920        !defined(CONFIGURE_APPLICATION_EXTRA_DRIVERS)
921      NULL_DRIVER_TABLE_ENTRY
922    #endif
923  };
924#endif
925
926#endif  /* CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE */
927
928/*
929 *  Default the number of drivers per node.  This value may be
930 *  overridden by the user.
931 */
932
933#define CONFIGURE_NUMBER_OF_DRIVERS \
934  ((sizeof(Device_drivers) / sizeof(rtems_driver_address_table)))
935
936/**
937 *  This specifies the maximum number of device drivers that
938 *  can be installed in the system at one time.  It must account
939 *  for both the statically and dynamically installed drivers.
940 */
941#ifndef CONFIGURE_MAXIMUM_DRIVERS
942  #define CONFIGURE_MAXIMUM_DRIVERS CONFIGURE_NUMBER_OF_DRIVERS
943#endif
944
945
946#ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
947  /*
948   * configure the priority of the ATA driver task
949   */
950  #ifndef CONFIGURE_ATA_DRIVER_TASK_PRIORITY
951    #define CONFIGURE_ATA_DRIVER_TASK_PRIORITY ATA_DRIVER_TASK_DEFAULT_PRIORITY
952  #endif
953  #ifdef CONFIGURE_INIT
954    rtems_task_priority rtems_ata_driver_task_priority
955      = CONFIGURE_ATA_DRIVER_TASK_PRIORITY;
956  #endif /* CONFIGURE_INIT */
957#endif
958
959/*
960 * add bdbuf configuration and values for swapout task priority
961 */
962#ifdef CONFIGURE_APPLICATION_NEEDS_LIBBLOCK
963  #include <rtems/bdbuf.h>
964  /*
965   * configure the bdbuf cache parameters
966   */
967  #ifndef CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS
968    #define CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS \
969                              RTEMS_BDBUF_MAX_READ_AHEAD_BLOCKS_DEFAULT
970  #endif
971  #ifndef CONFIGURE_BDBUF_MAX_WRITE_BLOCKS
972    #define CONFIGURE_BDBUF_MAX_WRITE_BLOCKS \
973                              RTEMS_BDBUF_MAX_WRITE_BLOCKS_DEFAULT
974  #endif
975  #ifndef CONFIGURE_SWAPOUT_TASK_PRIORITY
976    #define CONFIGURE_SWAPOUT_TASK_PRIORITY \
977                              RTEMS_BDBUF_SWAPOUT_TASK_PRIORITY_DEFAULT
978  #endif
979  #ifndef CONFIGURE_SWAPOUT_SWAP_PERIOD
980    #define CONFIGURE_SWAPOUT_SWAP_PERIOD \
981                              RTEMS_BDBUF_SWAPOUT_TASK_SWAP_PERIOD_DEFAULT
982  #endif
983  #ifndef CONFIGURE_SWAPOUT_BLOCK_HOLD
984    #define CONFIGURE_SWAPOUT_BLOCK_HOLD \
985                              RTEMS_BDBUF_SWAPOUT_TASK_BLOCK_HOLD_DEFAULT
986  #endif
987  #ifndef CONFIGURE_SWAPOUT_WORKER_TASKS
988    #define CONFIGURE_SWAPOUT_WORKER_TASKS \
989                              RTEMS_BDBUF_SWAPOUT_WORKER_TASKS_DEFAULT
990  #endif
991  #ifndef CONFIGURE_SWAPOUT_WORKER_TASK_PRIORITY
992    #define CONFIGURE_SWAPOUT_WORKER_TASK_PRIORITY \
993                              RTEMS_BDBUF_SWAPOUT_WORKER_TASK_PRIORITY_DEFAULT
994  #endif
995  #ifndef CONFIGURE_BDBUF_CACHE_MEMORY_SIZE
996    #define CONFIGURE_BDBUF_CACHE_MEMORY_SIZE \
997                              RTEMS_BDBUF_CACHE_MEMORY_SIZE_DEFAULT
998  #endif
999  #ifndef CONFIGURE_BDBUF_BUFFER_MIN_SIZE
1000    #define CONFIGURE_BDBUF_BUFFER_MIN_SIZE \
1001                              RTEMS_BDBUF_BUFFER_MIN_SIZE_DEFAULT
1002  #endif
1003  #ifndef CONFIGURE_BDBUF_BUFFER_MAX_SIZE
1004    #define CONFIGURE_BDBUF_BUFFER_MAX_SIZE \
1005                              RTEMS_BDBUF_BUFFER_MAX_SIZE_DEFAULT
1006  #endif
1007  #ifdef CONFIGURE_INIT
1008    const rtems_bdbuf_config rtems_bdbuf_configuration = {
1009      CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS,
1010      CONFIGURE_BDBUF_MAX_WRITE_BLOCKS,
1011      CONFIGURE_SWAPOUT_TASK_PRIORITY,
1012      CONFIGURE_SWAPOUT_SWAP_PERIOD,
1013      CONFIGURE_SWAPOUT_BLOCK_HOLD,
1014      CONFIGURE_SWAPOUT_WORKER_TASKS,
1015      CONFIGURE_SWAPOUT_WORKER_TASK_PRIORITY,
1016      CONFIGURE_BDBUF_CACHE_MEMORY_SIZE,
1017      CONFIGURE_BDBUF_BUFFER_MIN_SIZE,
1018      CONFIGURE_BDBUF_BUFFER_MAX_SIZE
1019    };
1020  #endif
1021
1022  /*
1023   *  Semaphores:
1024   *    o disk lock
1025   *    o bdbuf lock
1026   *    o bdbuf sync lock
1027   *    o bdbuf access condition
1028   *    o bdbuf transfer condition
1029   *    o bdbuf buffer condition
1030   */
1031  #define CONFIGURE_LIBBLOCK_SEMAPHORES 6
1032
1033  #if defined(CONFIGURE_HAS_OWN_BDBUF_TABLE) || \
1034      defined(CONFIGURE_BDBUF_BUFFER_SIZE) || \
1035      defined(CONFIGURE_BDBUF_BUFFER_COUNT)
1036    #error BDBUF Cache does not use a buffer configuration table. Please remove.
1037  #endif
1038#else
1039  #define CONFIGURE_LIBBLOCK_SEMAPHORES 0
1040#endif /* CONFIGURE_APPLICATION_NEEDS_LIBBLOCK */
1041
1042#if defined(RTEMS_MULTIPROCESSING)
1043  /*
1044   *  Default Multiprocessing Configuration Table.  The defaults are
1045   *  appropriate for most of the RTEMS Multiprocessor Test Suite.  Each
1046   *  value may be overridden within each test to customize the environment.
1047   */
1048
1049  #ifdef CONFIGURE_MP_APPLICATION
1050    #define CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER 1
1051
1052    #ifndef CONFIGURE_HAS_OWN_MULTIPROCESSING_TABLE
1053
1054      #ifndef CONFIGURE_MP_NODE_NUMBER
1055        #define CONFIGURE_MP_NODE_NUMBER                NODE_NUMBER
1056      #endif
1057
1058      #ifndef CONFIGURE_MP_MAXIMUM_NODES
1059        #define CONFIGURE_MP_MAXIMUM_NODES              2
1060      #endif
1061
1062      #ifndef CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS
1063        #define CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS     32
1064      #endif
1065      #define CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS(_global_objects) \
1066        _Configure_Object_RAM((_global_objects), sizeof(Objects_MP_Control))
1067
1068      #ifndef CONFIGURE_MP_MAXIMUM_PROXIES
1069        #define CONFIGURE_MP_MAXIMUM_PROXIES            32
1070      #endif
1071      #define CONFIGURE_MEMORY_FOR_PROXIES(_proxies) \
1072        _Configure_Object_RAM((_proxies) + 1, sizeof(Thread_Proxy_control) )
1073
1074      #ifndef CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK
1075        #define CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK 0
1076      #endif
1077
1078      #ifndef CONFIGURE_MP_MPCI_TABLE_POINTER
1079        #include <mpci.h>
1080        #define CONFIGURE_MP_MPCI_TABLE_POINTER         &MPCI_table
1081      #endif
1082
1083      #ifdef CONFIGURE_INIT
1084        rtems_multiprocessing_table Multiprocessing_configuration = {
1085          CONFIGURE_MP_NODE_NUMBER,               /* local node number */
1086          CONFIGURE_MP_MAXIMUM_NODES,             /* maximum # nodes */
1087          CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS,    /* maximum # global objects */
1088          CONFIGURE_MP_MAXIMUM_PROXIES,           /* maximum # proxies */
1089          CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK, /* MPCI stack > minimum */
1090          CONFIGURE_MP_MPCI_TABLE_POINTER         /* ptr to MPCI config table */
1091        };
1092      #endif
1093
1094      #define CONFIGURE_MULTIPROCESSING_TABLE    &Multiprocessing_configuration
1095
1096    #endif /* CONFIGURE_HAS_OWN_MULTIPROCESSING_TABLE */
1097
1098  #else
1099
1100    #define CONFIGURE_MULTIPROCESSING_TABLE    NULL
1101
1102  #endif /* CONFIGURE_MP_APPLICATION */
1103#endif /* RTEMS_MULTIPROCESSING */
1104
1105#ifndef CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER
1106  #define CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER 0
1107#endif
1108
1109
1110/*
1111 *  Default Configuration Table.
1112 */
1113
1114#ifndef CONFIGURE_HAS_OWN_CONFIGURATION_TABLE
1115
1116  #ifndef CONFIGURE_MAXIMUM_TASKS
1117    #define CONFIGURE_MAXIMUM_TASKS               0
1118  #endif
1119
1120  #ifndef CONFIGURE_DISABLE_CLASSIC_API_NOTEPADS
1121    #define CONFIGURE_NOTEPADS_ENABLED           TRUE
1122  #else
1123    #define CONFIGURE_NOTEPADS_ENABLED           FALSE
1124  #endif
1125
1126  #ifndef CONFIGURE_DISABLE_CLASSIC_API_NOTEPADS
1127    #define CONFIGURE_MEMORY_PER_TASK_FOR_CLASSIC_API \
1128      _Configure_From_workspace( sizeof(RTEMS_API_Control) )
1129  #else
1130    #define CONFIGURE_MEMORY_PER_TASK_FOR_CLASSIC_API \
1131      _Configure_From_workspace( sizeof(RTEMS_API_Control) - \
1132        (RTEMS_NUMBER_NOTEPADS * sizeof(uint32_t)))
1133  #endif
1134
1135  /**
1136   *  This macro calculates the memory required for task variables.
1137   *
1138   *  @note Each task variable is individually allocated from the Workspace.
1139   *        Hence, we do the multiplication on the configured size.
1140   */
1141  #ifndef CONFIGURE_MAXIMUM_TASK_VARIABLES
1142    #define CONFIGURE_MAXIMUM_TASK_VARIABLES                     0
1143    #define CONFIGURE_MEMORY_FOR_TASK_VARIABLES(_task_variables) 0
1144  #else
1145    #define CONFIGURE_MEMORY_FOR_TASK_VARIABLES(_task_variables) \
1146      (_task_variables) * \
1147         _Configure_From_workspace(sizeof(rtems_task_variable_t))
1148  #endif
1149
1150  #ifndef CONFIGURE_MAXIMUM_TIMERS
1151    #define CONFIGURE_MAXIMUM_TIMERS             0
1152    #define CONFIGURE_MEMORY_FOR_TIMERS(_timers) 0
1153  #else
1154    #define CONFIGURE_MEMORY_FOR_TIMERS(_timers) \
1155      _Configure_Object_RAM(_timers, sizeof(Timer_Control) )
1156  #endif
1157
1158  #ifndef CONFIGURE_MAXIMUM_SEMAPHORES
1159    #define CONFIGURE_MAXIMUM_SEMAPHORES                 0
1160  #endif
1161
1162  #define CONFIGURE_SEMAPHORES \
1163    (CONFIGURE_MAXIMUM_SEMAPHORES + CONFIGURE_LIBIO_SEMAPHORES + \
1164      CONFIGURE_TERMIOS_SEMAPHORES + CONFIGURE_LIBBLOCK_SEMAPHORES + \
1165      CONFIGURE_SEMAPHORES_FOR_FIFOS)
1166
1167  /*
1168   * If there are no user or support semaphores defined, then we can assume
1169   * that no memory need be allocated at all for semaphores.
1170   */
1171  #if CONFIGURE_SEMAPHORES == 0
1172    #define CONFIGURE_MEMORY_FOR_SEMAPHORES(_semaphores) 0
1173  #else
1174    #define CONFIGURE_MEMORY_FOR_SEMAPHORES(_semaphores) \
1175      _Configure_Object_RAM(_semaphores, sizeof(Semaphore_Control) )
1176  #endif
1177
1178  #ifndef CONFIGURE_MAXIMUM_MESSAGE_QUEUES
1179    #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES             0
1180    #define CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(_queues) 0
1181  #else
1182    #define CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(_queues) \
1183      _Configure_Object_RAM(_queues, sizeof(Message_queue_Control) )
1184  #endif
1185
1186  #ifndef CONFIGURE_MAXIMUM_PARTITIONS
1187    #define CONFIGURE_MAXIMUM_PARTITIONS                 0
1188    #define CONFIGURE_MEMORY_FOR_PARTITIONS(_partitions) 0
1189  #else
1190    #define CONFIGURE_MEMORY_FOR_PARTITIONS(_partitions) \
1191      _Configure_Object_RAM(_partitions, sizeof(Partition_Control) )
1192  #endif
1193
1194  #ifndef CONFIGURE_MAXIMUM_REGIONS
1195    #define CONFIGURE_MAXIMUM_REGIONS              0
1196    #define CONFIGURE_MEMORY_FOR_REGIONS(_regions) 0
1197  #else
1198    #define CONFIGURE_MEMORY_FOR_REGIONS(_regions) \
1199      _Configure_Object_RAM(_regions, sizeof(Region_Control) )
1200  #endif
1201
1202  #ifndef CONFIGURE_MAXIMUM_PORTS
1203    #define CONFIGURE_MAXIMUM_PORTS            0
1204    #define CONFIGURE_MEMORY_FOR_PORTS(_ports) 0
1205  #else
1206    #define CONFIGURE_MEMORY_FOR_PORTS(_ports) \
1207      _Configure_Object_RAM(_ports, sizeof(Dual_ported_memory_Control) )
1208  #endif
1209
1210  #ifndef CONFIGURE_MAXIMUM_PERIODS
1211    #define CONFIGURE_MAXIMUM_PERIODS              0
1212    #define CONFIGURE_MEMORY_FOR_PERIODS(_periods) 0
1213  #else
1214    #define CONFIGURE_MEMORY_FOR_PERIODS(_periods) \
1215      _Configure_Object_RAM(_periods, sizeof(Rate_monotonic_Control) )
1216  #endif
1217
1218  #ifndef CONFIGURE_MAXIMUM_BARRIERS
1219    #define CONFIGURE_MAXIMUM_BARRIERS               0
1220  #endif
1221
1222  #define CONFIGURE_BARRIERS \
1223     (CONFIGURE_MAXIMUM_BARRIERS + CONFIGURE_BARRIERS_FOR_FIFOS)
1224
1225  #if CONFIGURE_BARRIERS == 0
1226    #define CONFIGURE_MEMORY_FOR_BARRIERS(_barriers) 0
1227  #else
1228    #define CONFIGURE_MEMORY_FOR_BARRIERS(_barriers) \
1229      _Configure_Object_RAM(_barriers, sizeof(Barrier_Control) )
1230  #endif
1231
1232  #ifndef CONFIGURE_MAXIMUM_USER_EXTENSIONS
1233    #define CONFIGURE_MAXIMUM_USER_EXTENSIONS                 0
1234    #define CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(_extensions) 0
1235  #else
1236    #define CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(_extensions) \
1237      _Configure_Object_RAM(_extensions, sizeof(Extension_Control) )
1238  #endif
1239
1240  #ifndef CONFIGURE_MICROSECONDS_PER_TICK
1241    #define CONFIGURE_MICROSECONDS_PER_TICK \
1242            RTEMS_MILLISECONDS_TO_MICROSECONDS(10)
1243  #endif
1244
1245  #ifndef CONFIGURE_TICKS_PER_TIMESLICE
1246    #define CONFIGURE_TICKS_PER_TIMESLICE        50
1247  #endif
1248
1249/*
1250 *  Initial Extension Set
1251 */
1252
1253#ifdef CONFIGURE_INIT
1254#ifdef CONFIGURE_STACK_CHECKER_ENABLED
1255#include <rtems/stackchk.h>
1256#endif
1257#include <rtems/libcsupport.h>
1258
1259#if defined(CONFIGURE_INITIAL_EXTENSIONS) || \
1260    defined(CONFIGURE_STACK_CHECKER_ENABLED) || \
1261    (defined(RTEMS_NEWLIB) && !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY))
1262  rtems_extensions_table Configuration_Initial_Extensions[] = {
1263    #if !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY)
1264      RTEMS_NEWLIB_EXTENSION,
1265    #endif
1266    #if defined(CONFIGURE_STACK_CHECKER_ENABLED)
1267      RTEMS_STACK_CHECKER_EXTENSION,
1268    #endif
1269    #if defined(CONFIGURE_INITIAL_EXTENSIONS)
1270      CONFIGURE_INITIAL_EXTENSIONS,
1271    #endif
1272  };
1273
1274  #define CONFIGURE_INITIAL_EXTENSION_TABLE Configuration_Initial_Extensions
1275  #define CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS \
1276    ((sizeof(Configuration_Initial_Extensions) / \
1277      sizeof(rtems_extensions_table)))
1278#else
1279  #define CONFIGURE_INITIAL_EXTENSION_TABLE NULL
1280  #define CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS 0
1281#endif
1282
1283
1284#endif
1285
1286/*
1287 *  POSIX API Configuration Parameters
1288 */
1289
1290#ifdef RTEMS_POSIX_API
1291
1292  #include <sys/types.h>
1293  #include <signal.h>
1294  #include <limits.h>
1295  #include <mqueue.h>
1296  #include <rtems/posix/barrier.h>
1297  #include <rtems/posix/cond.h>
1298  #include <rtems/posix/mqueue.h>
1299  #include <rtems/posix/mutex.h>
1300  #include <rtems/posix/key.h>
1301  #include <rtems/posix/psignal.h>
1302  #include <rtems/posix/rwlock.h>
1303  #include <rtems/posix/semaphore.h>
1304  #include <rtems/posix/spinlock.h>
1305  #include <rtems/posix/threadsup.h>
1306  #include <rtems/posix/timer.h>
1307
1308  /**
1309   *  Account for the object control structures plus the name
1310   *  of the object to be duplicated.
1311   */
1312  #define _Configure_POSIX_Named_Object_RAM(_number, _size) \
1313    _Configure_Object_RAM( (_number), _size ) + \
1314    ((_number) + _Configure_From_workspace(NAME_MAX) )
1315
1316  #ifndef CONFIGURE_MAXIMUM_POSIX_THREADS
1317    #define CONFIGURE_MAXIMUM_POSIX_THREADS      0
1318  #endif
1319
1320  #define CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API \
1321    _Configure_From_workspace( \
1322      sizeof (POSIX_API_Control) + \
1323     (sizeof (void *) * (CONFIGURE_MAXIMUM_POSIX_KEYS)) \
1324    )
1325
1326  #ifndef CONFIGURE_MAXIMUM_POSIX_MUTEXES
1327    #define CONFIGURE_MAXIMUM_POSIX_MUTEXES              0
1328    #define CONFIGURE_MEMORY_FOR_POSIX_MUTEXES(_mutexes) 0
1329  #else
1330    #define CONFIGURE_MEMORY_FOR_POSIX_MUTEXES(_mutexes) \
1331      _Configure_Object_RAM(_mutexes, sizeof(POSIX_Mutex_Control) )
1332  #endif
1333
1334  #ifndef CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES
1335    #define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES               0
1336    #define CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES(_condvars) 0
1337  #else
1338    #define CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES(_condvars) \
1339        _Configure_Object_RAM(_condvars, \
1340                            sizeof(POSIX_Condition_variables_Control) )
1341  #endif
1342
1343  #ifndef CONFIGURE_MAXIMUM_POSIX_KEYS
1344    #define CONFIGURE_MAXIMUM_POSIX_KEYS           0
1345    #define CONFIGURE_MEMORY_FOR_POSIX_KEYS(_keys) 0
1346  #else
1347    #define CONFIGURE_MEMORY_FOR_POSIX_KEYS(_keys) \
1348      _Configure_Object_RAM(_keys, sizeof(POSIX_Keys_Control) )
1349  #endif
1350
1351  #ifndef CONFIGURE_MAXIMUM_POSIX_TIMERS
1352    #define CONFIGURE_MAXIMUM_POSIX_TIMERS             0
1353    #define CONFIGURE_MEMORY_FOR_POSIX_TIMERS(_timers) 0
1354  #else
1355    #define CONFIGURE_MEMORY_FOR_POSIX_TIMERS(_timers) \
1356      _Configure_Object_RAM(_timers, sizeof(POSIX_Timer_Control) )
1357  #endif
1358
1359  #ifndef CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS
1360    #define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS                     0
1361    #define CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS(_queued_signals) 0
1362  #else
1363    #define CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS(_queued_signals) \
1364      _Configure_From_workspace( \
1365        (_queued_signals) * (sizeof(POSIX_signals_Siginfo_node)) )
1366  #endif
1367
1368  #ifndef CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES
1369    #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES                     0
1370    #define CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES(_message_queues) 0
1371    #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS          0
1372    #define CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUE_DESCRIPTORS(_fds) 0
1373  #else
1374    #define CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES(_message_queues) \
1375      _Configure_POSIX_Named_Object_RAM( \
1376         _message_queues, sizeof(POSIX_Message_queue_Control) )
1377
1378    /* default to same number */
1379    #ifndef CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS
1380       #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS \
1381               CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES
1382    #endif
1383
1384    #define CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUE_DESCRIPTORS(_mqueue_fds) \
1385      _Configure_POSIX_Named_Object_RAM( \
1386         _mqueue_fds, sizeof(POSIX_Message_queue_Control_fd) )
1387  #endif
1388
1389  #ifndef CONFIGURE_MAXIMUM_POSIX_SEMAPHORES
1390    #define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES                 0
1391    #define CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES(_semaphores) 0
1392  #else
1393    #define CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES(_semaphores) \
1394      _Configure_POSIX_Named_Object_RAM( \
1395         _semaphores, sizeof(POSIX_Semaphore_Control) )
1396  #endif
1397
1398  #ifndef CONFIGURE_MAXIMUM_POSIX_BARRIERS
1399    #define CONFIGURE_MAXIMUM_POSIX_BARRIERS               0
1400    #define CONFIGURE_MEMORY_FOR_POSIX_BARRIERS(_barriers) 0
1401  #else
1402    #define CONFIGURE_MEMORY_FOR_POSIX_BARRIERS(_barriers) \
1403      _Configure_Object_RAM(_barriers, sizeof(POSIX_Barrier_Control) )
1404  #endif
1405
1406  #ifndef CONFIGURE_MAXIMUM_POSIX_SPINLOCKS
1407    #define CONFIGURE_MAXIMUM_POSIX_SPINLOCKS                0
1408    #define CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS(_spinlocks) 0
1409  #else
1410    #define CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS(_spinlocks) \
1411      _Configure_Object_RAM(_spinlocks, sizeof(POSIX_Spinlock_Control) )
1412  #endif
1413
1414  #ifndef CONFIGURE_MAXIMUM_POSIX_RWLOCKS
1415    #define CONFIGURE_MAXIMUM_POSIX_RWLOCKS              0
1416    #define CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS(_rwlocks) 0
1417  #else
1418    #define CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS(_rwlocks) \
1419      _Configure_Object_RAM(_rwlocks, sizeof(POSIX_RWLock_Control) )
1420  #endif
1421
1422  #ifdef CONFIGURE_POSIX_INIT_THREAD_TABLE
1423
1424    #ifdef CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE
1425
1426      /*
1427       *  The user is defining their own table information and setting the
1428       *  appropriate variables for the POSIX Initialization Thread Table.
1429       */
1430
1431    #else
1432
1433      #ifndef CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT
1434        #define CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT   POSIX_Init
1435      #endif
1436
1437      #ifndef CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE
1438        #define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE \
1439                (CONFIGURE_MINIMUM_TASK_STACK_SIZE * 2)
1440      #endif
1441
1442      #ifdef CONFIGURE_INIT
1443        posix_initialization_threads_table POSIX_Initialization_threads[] = {
1444          { CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT, \
1445              CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE }
1446        };
1447      #endif
1448
1449      #define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME \
1450              POSIX_Initialization_threads
1451
1452      #define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE \
1453        sizeof(CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME) / \
1454            sizeof(posix_initialization_threads_table)
1455
1456    #endif    /* CONFIGURE_POSIX_HAS_OWN_INIT_TASK_TABLE */
1457
1458  #else     /* CONFIGURE_POSIX_INIT_THREAD_TABLE */
1459
1460    #define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME NULL
1461    #define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE 0
1462
1463  #endif
1464
1465  #define CONFIGURE_MEMORY_FOR_POSIX \
1466    ( CONFIGURE_MEMORY_FOR_POSIX_MUTEXES( CONFIGURE_MAXIMUM_POSIX_MUTEXES + \
1467          CONFIGURE_MAXIMUM_GO_CHANNELS + CONFIGURE_GO_INIT_MUTEXES) + \
1468      CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES( \
1469          CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES + \
1470          CONFIGURE_MAXIMUM_GO_CHANNELS + CONFIGURE_GO_INIT_CONDITION_VARIABLES) + \
1471      CONFIGURE_MEMORY_FOR_POSIX_KEYS( CONFIGURE_MAXIMUM_POSIX_KEYS ) + \
1472      CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS( \
1473          CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS ) + \
1474      CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES( \
1475          CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES ) + \
1476      CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUE_DESCRIPTORS( \
1477          CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS ) + \
1478      CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES( \
1479          CONFIGURE_MAXIMUM_POSIX_SEMAPHORES ) + \
1480      CONFIGURE_MEMORY_FOR_POSIX_BARRIERS(CONFIGURE_MAXIMUM_POSIX_BARRIERS) + \
1481      CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS( \
1482          CONFIGURE_MAXIMUM_POSIX_SPINLOCKS ) + \
1483      CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS( \
1484          CONFIGURE_MAXIMUM_POSIX_RWLOCKS ) + \
1485      CONFIGURE_MEMORY_FOR_POSIX_TIMERS( CONFIGURE_MAXIMUM_POSIX_TIMERS ) + \
1486      (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE) \
1487     )
1488#else
1489
1490  #define CONFIGURE_MAXIMUM_POSIX_THREADS         0
1491  #define CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API 0
1492  #define CONFIGURE_MEMORY_FOR_POSIX              0
1493
1494#endif    /* RTEMS_POSIX_API */
1495
1496#ifndef CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE
1497  #define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE    0
1498#endif
1499
1500/*
1501 *  This block of defines are for applications which use GNAT/RTEMS.
1502 *  GNAT implements each Ada task as a POSIX thread.
1503 */
1504#ifdef CONFIGURE_GNAT_RTEMS
1505
1506  /**
1507   *  The GNAT run-time needs something less than (10) POSIX mutexes.
1508   *  We may be able to get by with less but why bother.
1509   */
1510  #define CONFIGURE_GNAT_MUTEXES 10
1511
1512  /**
1513   *  This is the maximum number of Ada tasks which can be concurrently
1514   *  in existence.  Twenty (20) are required to run all tests in the
1515   *  ACATS (formerly ACVC).
1516   */
1517  #ifndef CONFIGURE_MAXIMUM_ADA_TASKS
1518    #define CONFIGURE_MAXIMUM_ADA_TASKS  20
1519  #endif
1520
1521  /**
1522   * This is the number of non-Ada tasks which invoked Ada code.
1523   */
1524  #ifndef CONFIGURE_MAXIMUM_FAKE_ADA_TASKS
1525    #define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0
1526  #endif
1527
1528  /**
1529   * Ada tasks are allocated twice the minimum stack space.
1530   */
1531  #define CONFIGURE_ADA_TASKS_STACK \
1532    (CONFIGURE_MAXIMUM_ADA_TASKS * \
1533      (CONFIGURE_MINIMUM_TASK_STACK_SIZE + (6 * 1024)))
1534
1535#else
1536  #define CONFIGURE_GNAT_MUTEXES           0
1537  #define CONFIGURE_MAXIMUM_ADA_TASKS      0
1538  #define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0
1539  #define CONFIGURE_ADA_TASKS_STACK        0
1540#endif
1541
1542#ifdef CONFIGURE_ENABLE_GO
1543
1544  #ifndef CONFIGURE_MAXIMUM_POSIX_THREADS
1545    #define CONFIGURE_MAXIMUM_POSIX_THREADS 1
1546  #endif
1547  #ifndef CONFIGURE_MAXIMUM_POSIX_MUTEXES
1548    #define CONFIGURE_MAXIMUM_POSIX_MUTEXES 1
1549  #endif
1550  #ifndef CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES
1551    #define CONFIGURE_MAXIMUM_CONDITION_VARIABLES 1
1552  #endif
1553
1554  #define CONFIGURE_GO_INIT_MUTEXES 77
1555  #define CONFIGURE_GO_INIT_CONDITION_VARIABLES 4
1556
1557  #ifndef CONFIGURE_MAXIMUM_GOROUTINES
1558    #define CONFIGURE_MAXIMUM_GOROUTINES 400
1559  #endif
1560
1561  #define CONFIGURE_GOROUTINES_TASK_VARIABLES \
1562    (2 * CONFIGURE_MAXIMUM_GOROUTINES)
1563
1564  #ifndef CONFIGURE_MAXIMUM_GO_CHANNELS
1565    #define CONFIGURE_MAXIMUM_GO_CHANNELS 500
1566  #endif
1567
1568#else
1569  #define CONFIGURE_GO_INIT_MUTEXES             0
1570  #define CONFIGURE_GO_INIT_CONDITION_VARIABLES 0
1571  #define CONFIGURE_MAXIMUM_GOROUTINES          0
1572  #define CONFIGURE_GOROUTINES_TASK_VARIABLES   0
1573  #define CONFIGURE_MAXIMUM_GO_CHANNELS         0
1574#endif
1575/**
1576 *  This macro specifies the amount of memory to be reserved for the
1577 *  Newlib C Library reentrancy structure -- if we are using newlib.
1578 */
1579
1580#if (defined(RTEMS_NEWLIB) && !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY))
1581  #include <reent.h>
1582
1583  #define CONFIGURE_MEMORY_PER_TASK_FOR_NEWLIB \
1584    _Configure_From_workspace(sizeof(struct _reent))
1585#else
1586  #define CONFIGURE_MEMORY_PER_TASK_FOR_NEWLIB 0
1587#endif
1588
1589/*
1590 *  Calculate the RAM size based on the maximum number of objects configured.
1591 */
1592
1593#ifndef CONFIGURE_EXECUTIVE_RAM_SIZE
1594
1595/**
1596 *  Account for allocating the following per object
1597 *    + array of object control structures
1598 *    + local pointer table -- pointer per object plus a zero'th
1599 *      entry in the local pointer table.
1600 */
1601
1602#define CONFIGURE_MEMORY_FOR_TASKS(_tasks, _number_FP_tasks) \
1603 ( \
1604  _Configure_Object_RAM(_tasks, sizeof(Thread_Control)) + \
1605  (_Configure_Max_Objects(_tasks) * \
1606   (_Configure_From_workspace(CONFIGURE_MINIMUM_TASK_STACK_SIZE) + \
1607    CONFIGURE_MEMORY_PER_TASK_FOR_CLASSIC_API + \
1608    CONFIGURE_MEMORY_PER_TASK_FOR_NEWLIB + \
1609    CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API))  + \
1610  _Configure_From_workspace( \
1611    _Configure_Max_Objects(_number_FP_tasks) * CONTEXT_FP_SIZE) + \
1612  _Configure_From_workspace( \
1613          (CONFIGURE_MAXIMUM_USER_EXTENSIONS + 1) * sizeof(void *)) \
1614 )
1615
1616/**
1617 *  This defines the amount of memory configured for the multiprocessing
1618 *  support required by this application.
1619 */
1620#ifdef CONFIGURE_MP_APPLICATION
1621  #define CONFIGURE_MEMORY_FOR_MP \
1622    (CONFIGURE_MEMORY_FOR_PROXIES(CONFIGURE_MP_MAXIMUM_PROXIES) + \
1623     CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS( \
1624             CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS) + \
1625     CONFIGURE_MEMORY_FOR_TASKS(1, 1) + \
1626     CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK \
1627  )
1628#else
1629  #define CONFIGURE_MEMORY_FOR_MP  0
1630#endif
1631
1632/**
1633 *  This is so we can account for tasks with stacks greater than minimum
1634 *  size.  This is in bytes.
1635 */
1636#ifndef CONFIGURE_EXTRA_TASK_STACKS
1637  #define CONFIGURE_EXTRA_TASK_STACKS 0
1638#endif
1639
1640/**
1641 *  The following macro is used to calculate the memory allocated by RTEMS
1642 *  for the message buffers associated with a particular message queue.
1643 *  There is a fixed amount of overhead per message.
1644 */
1645#define CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(_messages, _size) \
1646    _Configure_From_workspace( \
1647      (_messages) * ((_size) + sizeof(CORE_message_queue_Buffer_control)))
1648
1649/**
1650 *  This macros is set to the amount of memory required for pending message
1651 *  buffers in bytes.  It should be constructed by adding together a
1652 *  set of values determined by CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE.
1653 */
1654#ifndef CONFIGURE_MESSAGE_BUFFER_MEMORY
1655  #define CONFIGURE_MESSAGE_BUFFER_MEMORY 0
1656#endif
1657
1658/**
1659 *  This macro is available just in case the confdefs.h file underallocates
1660 *  memory for a particular application.  This lets the user add some extra
1661 *  memory in case something broken and underestimates.
1662 *
1663 *  It is also possible for cases where confdefs.h overallocates memory,
1664 *  you could substract memory from the allocated.  The estimate is just
1665 *  that, an estimate, and assumes worst case alignment and padding on
1666 *  each allocated element.  So in some cases it could be too conservative.
1667 *
1668 *  @note Historically this was used for message buffers.
1669 */
1670#ifndef CONFIGURE_MEMORY_OVERHEAD
1671  #define CONFIGURE_MEMORY_OVERHEAD 0
1672#endif
1673
1674/**
1675 *  On architectures that use Simple Vectored Interrupts, it is RTEMS
1676 *  responsibility to allocate the vector table.  This avoids reserving
1677 *  the memory on architectures that use the Programmable Interrupt
1678 *  Controller Vectored Interrupts.
1679 */
1680#if (CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE)
1681  /*
1682   *  This is a (hopefully) temporary hack.  On the mips, the number of
1683   *  vectors is NOT statically defined.  But it has to be statically
1684   *  defined for this to work.  This is an issue looking for a nice
1685   *  solution.
1686   */
1687  #if defined(__mips__)
1688    #define CONFIGURE_INTERRUPT_VECTOR_TABLE \
1689      _Configure_From_workspace( (sizeof(ISR_Handler_entry) * 256))
1690  #else
1691    #define CONFIGURE_INTERRUPT_VECTOR_TABLE \
1692      _Configure_From_workspace( \
1693        (sizeof(ISR_Handler_entry) * ISR_NUMBER_OF_VECTORS))
1694  #endif
1695#else
1696  #define CONFIGURE_INTERRUPT_VECTOR_TABLE 0
1697#endif
1698
1699/**
1700 *  RTEMS uses one instance of an internal mutex class.  This accounts
1701 *  for that mutex
1702 */
1703#define CONFIGURE_API_MUTEX_MEMORY \
1704  _Configure_Object_RAM(1, sizeof(API_Mutex_Control))
1705
1706/**
1707 *  This defines the memory used by the thread ready chains.  There is
1708 *  one chain per priority.
1709 */
1710#define CONFIGURE_MEMORY_FOR_THREAD_READY_CHAINS \
1711    _Configure_From_workspace( \
1712        ((CONFIGURE_MAXIMUM_PRIORITY+1) * sizeof(Chain_Control)) )
1713/**
1714 *  This defines the amount of memory reserved for the IDLE task
1715 *  control structures and stack.
1716 */
1717#define CONFIGURE_MEMORY_FOR_IDLE_TASK \
1718    (CONFIGURE_MEMORY_FOR_TASKS(1, 0) + \
1719     (CONFIGURE_IDLE_TASK_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE))
1720
1721/**
1722 *  This macro accounts for general RTEMS system overhead.
1723 */
1724#define CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD \
1725  ( CONFIGURE_MEMORY_FOR_IDLE_TASK +                /* IDLE and stack */ \
1726    CONFIGURE_MEMORY_FOR_THREAD_READY_CHAINS +     /* Ready chains */ \
1727    CONFIGURE_INTERRUPT_VECTOR_TABLE +             /* interrupt vectors */ \
1728    CONFIGURE_INTERRUPT_STACK_MEMORY +             /* interrupt stack */ \
1729    CONFIGURE_API_MUTEX_MEMORY                     /* allocation mutex */ \
1730  )
1731
1732/*
1733 *  Now account for any extra memory that initialization tasks or threads
1734 *  may have requested.
1735 */
1736
1737/**
1738 *  This accounts for any extra memory required by the Classic API
1739 *  Initialization Task.
1740 */
1741#if (CONFIGURE_INIT_TASK_STACK_SIZE > CONFIGURE_MINIMUM_TASK_STACK_SIZE)
1742  #define CONFIGURE_INITIALIZATION_THREADS_STACKS_CLASSIC_PART \
1743      (CONFIGURE_INIT_TASK_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE)
1744#else
1745  #define CONFIGURE_INITIALIZATION_THREADS_STACKS_CLASSIC_PART 0
1746#endif
1747
1748/**
1749 *  This accounts for any extra memory required by the POSIX API
1750 *  Initialization Thread.
1751 */
1752#if defined(RTEMS_POSIX_API) && \
1753    (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE > CONFIGURE_MINIMUM_TASK_STACK_SIZE)
1754  #define CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART \
1755    (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE)
1756#else
1757  #define CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART 0
1758#endif
1759
1760/**
1761 *  This macro provides a summation of the various initialization task
1762 *  and thread stack requirements.
1763 */
1764#define CONFIGURE_INITIALIZATION_THREADS_STACKS \
1765    (CONFIGURE_INITIALIZATION_THREADS_STACKS_CLASSIC_PART + \
1766    CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART)
1767
1768/**
1769 *  This macro provides a summation of the various task and thread
1770 *  requirements.
1771 */
1772#define CONFIGURE_TOTAL_TASKS_AND_THREADS \
1773   (CONFIGURE_MAXIMUM_TASKS + \
1774    CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_ADA_TASKS + \
1775    CONFIGURE_MAXIMUM_GOROUTINES)
1776
1777/**
1778 *  This macro reserves the memory required by the statically configured
1779 *  user extensions.
1780 */
1781#define CONFIGURE_MEMORY_FOR_STATIC_EXTENSIONS \
1782     ((CONFIGURE_NEWLIB_EXTENSION * \
1783        _Configure_From_workspace( sizeof(User_extensions_Control))) + \
1784      (CONFIGURE_STACK_CHECKER_EXTENSION * \
1785        _Configure_From_workspace( sizeof(User_extensions_Control))) \
1786     )
1787
1788/**
1789 *  This macro provides a summation of the memory required by the
1790 *  Classic API as configured.
1791 */
1792#define CONFIGURE_MEMORY_FOR_CLASSIC \
1793  (CONFIGURE_MEMORY_FOR_TASK_VARIABLES(CONFIGURE_MAXIMUM_TASK_VARIABLES + \
1794    CONFIGURE_GOROUTINES_TASK_VARIABLES) + \
1795   CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS + \
1796    CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER ) + \
1797   CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_SEMAPHORES) + \
1798   CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(CONFIGURE_MAXIMUM_MESSAGE_QUEUES) + \
1799   CONFIGURE_MEMORY_FOR_PARTITIONS(CONFIGURE_MAXIMUM_PARTITIONS) + \
1800   CONFIGURE_MEMORY_FOR_REGIONS( CONFIGURE_MAXIMUM_REGIONS ) + \
1801   CONFIGURE_MEMORY_FOR_PORTS(CONFIGURE_MAXIMUM_PORTS) + \
1802   CONFIGURE_MEMORY_FOR_PERIODS(CONFIGURE_MAXIMUM_PERIODS) + \
1803   CONFIGURE_MEMORY_FOR_BARRIERS(CONFIGURE_BARRIERS) + \
1804   CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(CONFIGURE_MAXIMUM_USER_EXTENSIONS) \
1805  )
1806
1807#if defined(CONFIGURE_CONFDEFS_DEBUG) && defined(CONFIGURE_INIT)
1808  /**
1809   *  This is a debug mechanism, so if you need to, the executable will
1810   *  have a structure with various partial values.  Add to this as you
1811   *  need to.  Viewing this structure in gdb combined with dumping
1812   *  the Configuration structures generated should help a lot in tracing
1813   *  down errors and analyzing where over and under allocations are.
1814   */
1815  typedef struct {
1816    uint32_t SYSTEM_OVERHEAD;
1817    uint32_t STATIC_EXTENSIONS;
1818    uint32_t INITIALIZATION_THREADS_STACKS;
1819
1820    uint32_t PER_INTEGER_TASK;
1821    uint32_t FP_OVERHEAD;
1822    uint32_t CLASSIC;
1823    uint32_t POSIX;
1824
1825    /* System overhead pieces */
1826    uint32_t INTERRUPT_VECTOR_TABLE;
1827    uint32_t INTERRUPT_STACK_MEMORY;
1828    uint32_t THREAD_READY_CHAINS;
1829    uint32_t MEMORY_FOR_IDLE_TASK;
1830
1831    /* Classic API Pieces */
1832    uint32_t CLASSIC_TASKS;
1833    uint32_t TASK_VARIABLES;
1834    uint32_t TIMERS;
1835    uint32_t SEMAPHORES;
1836    uint32_t MESSAGE_QUEUES;
1837    uint32_t PARTITIONS;
1838    uint32_t REGIONS;
1839    uint32_t PORTS;
1840    uint32_t PERIODS;
1841    uint32_t BARRIERS;
1842    uint32_t USER_EXTENSIONS;
1843#ifdef RTEMS_POSIX_API
1844    /* POSIX API Pieces */
1845    uint32_t POSIX_MUTEXES;
1846    uint32_t POSIX_CONDITION_VARIABLES;
1847    uint32_t POSIX_KEYS;
1848    uint32_t POSIX_TIMERS;
1849    uint32_t POSIX_QUEUED_SIGNALS;
1850    uint32_t POSIX_MESSAGE_QUEUES;
1851    uint32_t POSIX_SEMAPHORES;
1852    uint32_t POSIX_BARRIERS;
1853    uint32_t POSIX_SPINLOCKS;
1854    uint32_t POSIX_RWLOCKS;
1855#endif
1856  } Configuration_Debug_t;
1857
1858  Configuration_Debug_t Configuration_Memory_Debug = {
1859    /* General Information */
1860    CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD,
1861    CONFIGURE_MEMORY_FOR_STATIC_EXTENSIONS,
1862    CONFIGURE_INITIALIZATION_THREADS_STACKS,
1863    CONFIGURE_MEMORY_FOR_TASKS(1, 0),
1864    CONFIGURE_MEMORY_FOR_TASKS(0, 1),
1865    CONFIGURE_MEMORY_FOR_CLASSIC,
1866    CONFIGURE_MEMORY_FOR_POSIX,
1867
1868    /* System overhead pieces */
1869    CONFIGURE_INTERRUPT_VECTOR_TABLE,
1870    CONFIGURE_INTERRUPT_STACK_MEMORY,
1871    CONFIGURE_MEMORY_FOR_THREAD_READY_CHAINS,
1872    CONFIGURE_MEMORY_FOR_IDLE_TASK,
1873
1874    /* Classic API Pieces */
1875    CONFIGURE_MEMORY_FOR_TASKS(CONFIGURE_MAXIMUM_TASKS, 0),
1876    CONFIGURE_MEMORY_FOR_TASK_VARIABLES(CONFIGURE_MAXIMUM_TASK_VARIABLES +
1877      CONFIGURE_GOROUTINES_TASK_VARIABLES),
1878    CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS),
1879    CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_SEMAPHORES),
1880    CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(CONFIGURE_MAXIMUM_MESSAGE_QUEUES),
1881    CONFIGURE_MEMORY_FOR_PARTITIONS(CONFIGURE_MAXIMUM_PARTITIONS),
1882    CONFIGURE_MEMORY_FOR_REGIONS( CONFIGURE_MAXIMUM_REGIONS ),
1883    CONFIGURE_MEMORY_FOR_PORTS(CONFIGURE_MAXIMUM_PORTS),
1884    CONFIGURE_MEMORY_FOR_PERIODS(CONFIGURE_MAXIMUM_PERIODS),
1885    CONFIGURE_MEMORY_FOR_BARRIERS(CONFIGURE_BARRIERS),
1886    CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(CONFIGURE_MAXIMUM_USER_EXTENSIONS),
1887
1888#ifdef RTEMS_POSIX_API
1889    /* POSIX API Pieces */
1890    CONFIGURE_MEMORY_FOR_POSIX_MUTEXES( CONFIGURE_MAXIMUM_POSIX_MUTEXES +
1891      CONFIGURE_MAXIMUM_GO_CHANNELS + CONFIGURE_GO_INIT_MUTEXES),
1892    CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES(
1893      CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES +
1894      CONFIGURE_MAXIMUM_GO_CHANNELS + CONFIGURE_GO_INIT_CONDITION_VARIABLES),
1895    CONFIGURE_MEMORY_FOR_POSIX_KEYS( CONFIGURE_MAXIMUM_POSIX_KEYS ),
1896    CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS(
1897      CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS ),
1898    CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES(
1899      CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES ),
1900    CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES( CONFIGURE_MAXIMUM_POSIX_SEMAPHORES ),
1901    CONFIGURE_MEMORY_FOR_POSIX_BARRIERS( CONFIGURE_MAXIMUM_POSIX_BARRIERS ),
1902    CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS( CONFIGURE_MAXIMUM_POSIX_SPINLOCKS ),
1903    CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS( CONFIGURE_MAXIMUM_POSIX_RWLOCKS ),
1904    CONFIGURE_MEMORY_FOR_POSIX_TIMERS( CONFIGURE_MAXIMUM_POSIX_TIMERS ),
1905#endif
1906  };
1907#endif
1908
1909/**
1910 *  This calculates the memory required for the executive workspace.
1911 */
1912#define CONFIGURE_EXECUTIVE_RAM_SIZE \
1913(( \
1914   CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD + \
1915   CONFIGURE_MEMORY_FOR_DEVFS + \
1916   CONFIGURE_MEMORY_FOR_TASKS( \
1917     CONFIGURE_TOTAL_TASKS_AND_THREADS, CONFIGURE_TOTAL_TASKS_AND_THREADS) + \
1918   CONFIGURE_MEMORY_FOR_CLASSIC + \
1919   CONFIGURE_MEMORY_FOR_POSIX + \
1920   (CONFIGURE_MAXIMUM_POSIX_THREADS * CONFIGURE_MINIMUM_TASK_STACK_SIZE ) + \
1921   (CONFIGURE_MAXIMUM_GOROUTINES * CONFIGURE_MINIMUM_TASK_STACK_SIZE ) + \
1922   CONFIGURE_INITIALIZATION_THREADS_STACKS + \
1923   CONFIGURE_MEMORY_FOR_STATIC_EXTENSIONS + \
1924   CONFIGURE_MEMORY_FOR_MP + \
1925   CONFIGURE_MESSAGE_BUFFER_MEMORY + \
1926   (CONFIGURE_MEMORY_OVERHEAD * 1024) + \
1927   (CONFIGURE_EXTRA_TASK_STACKS) + (CONFIGURE_ADA_TASKS_STACK) \
1928) & ~0x7)
1929#endif
1930
1931#ifdef CONFIGURE_INIT
1932  /**
1933   *  This is the Classic API Configuration Table.
1934   */
1935  rtems_api_configuration_table Configuration_RTEMS_API = {
1936    CONFIGURE_MAXIMUM_TASKS,
1937    CONFIGURE_NOTEPADS_ENABLED,
1938    CONFIGURE_MAXIMUM_TIMERS + CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER,
1939    CONFIGURE_SEMAPHORES,
1940    CONFIGURE_MAXIMUM_MESSAGE_QUEUES,
1941    CONFIGURE_MAXIMUM_PARTITIONS,
1942    CONFIGURE_MAXIMUM_REGIONS,
1943    CONFIGURE_MAXIMUM_PORTS,
1944    CONFIGURE_MAXIMUM_PERIODS,
1945    CONFIGURE_BARRIERS,
1946    CONFIGURE_INIT_TASK_TABLE_SIZE,
1947    CONFIGURE_INIT_TASK_TABLE
1948  };
1949
1950  #ifdef RTEMS_POSIX_API
1951    /**
1952     *  This is the POSIX API Configuration Table.
1953     */
1954    posix_api_configuration_table Configuration_POSIX_API = {
1955      CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_ADA_TASKS +
1956        CONFIGURE_MAXIMUM_GOROUTINES,
1957      CONFIGURE_MAXIMUM_POSIX_MUTEXES + CONFIGURE_GNAT_MUTEXES +
1958        CONFIGURE_MAXIMUM_ADA_TASKS + CONFIGURE_MAXIMUM_FAKE_ADA_TASKS +
1959        CONFIGURE_GO_INIT_MUTEXES + CONFIGURE_MAXIMUM_GO_CHANNELS,
1960      CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES +
1961        CONFIGURE_MAXIMUM_ADA_TASKS + CONFIGURE_MAXIMUM_FAKE_ADA_TASKS +
1962        CONFIGURE_GO_INIT_CONDITION_VARIABLES + CONFIGURE_MAXIMUM_GO_CHANNELS,
1963      CONFIGURE_MAXIMUM_POSIX_KEYS,
1964      CONFIGURE_MAXIMUM_POSIX_TIMERS,
1965      CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS,
1966      CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES,
1967      CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS,
1968      CONFIGURE_MAXIMUM_POSIX_SEMAPHORES,
1969      CONFIGURE_MAXIMUM_POSIX_BARRIERS,
1970      CONFIGURE_MAXIMUM_POSIX_RWLOCKS,
1971      CONFIGURE_MAXIMUM_POSIX_SPINLOCKS,
1972      CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE,
1973      CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME
1974    };
1975  #endif
1976
1977  /** This variable specifies the minimum stack size for tasks in an RTEMS
1978   *  application.
1979   *
1980   *  @note This is left as a simple uint32_t so it can be externed as
1981   *        needed without requring being high enough logical to
1982   *        include the full configuration table.
1983   */
1984  uint32_t rtems_minimum_stack_size =
1985    CONFIGURE_MINIMUM_TASK_STACK_SIZE;
1986
1987  /** This variable specifies the maximum priority value that
1988   *  a task may have.  This must be a power of 2 between 4
1989   *  and 256 and is specified in terms of Classic API
1990   *  priority values.
1991   *
1992   *  @note This is left as a simple uint8_t so it can be externed as
1993   *        needed without requring being high enough logical to
1994   *        include the full configuration table.
1995   */
1996  uint8_t rtems_maximum_priority = CONFIGURE_MAXIMUM_PRIORITY;
1997
1998  /**
1999   *  This is the primary Configuration Table for this application.
2000   */
2001  rtems_configuration_table Configuration = {
2002    NULL,                                     /* filled in by BSP */
2003    CONFIGURE_EXECUTIVE_RAM_SIZE,             /* required RTEMS workspace */
2004    CONFIGURE_MAXIMUM_USER_EXTENSIONS,        /* maximum dynamic extensions */
2005    CONFIGURE_MICROSECONDS_PER_TICK,          /* microseconds per clock tick */
2006    CONFIGURE_TICKS_PER_TIMESLICE,            /* ticks per timeslice quantum */
2007    CONFIGURE_IDLE_TASK_BODY,                 /* user's IDLE task */
2008    CONFIGURE_IDLE_TASK_STACK_SIZE,           /* IDLE task stack size */
2009    CONFIGURE_INTERRUPT_STACK_SIZE,           /* interrupt stack size */
2010    CONFIGURE_TASK_STACK_ALLOCATOR,           /* stack allocator */
2011    CONFIGURE_TASK_STACK_DEALLOCATOR,         /* stack deallocator */
2012    CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY,   /* true to clear memory */
2013    CONFIGURE_MAXIMUM_DRIVERS,                /* maximum device drivers */
2014    CONFIGURE_NUMBER_OF_DRIVERS,              /* static device drivers */
2015    Device_drivers,                           /* pointer to driver table */
2016    CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS,   /* number of static extensions */
2017    CONFIGURE_INITIAL_EXTENSION_TABLE,        /* pointer to static extensions */
2018    #if defined(RTEMS_MULTIPROCESSING)
2019      CONFIGURE_MULTIPROCESSING_TABLE,        /* pointer to MP config table */
2020    #endif
2021  };
2022#endif
2023
2024#endif /* CONFIGURE_HAS_OWN_CONFIGURATION_TABLE */
2025
2026/*
2027 *  If the user has configured a set of Classic API Initialization Tasks,
2028 *  then we need to install the code that runs that loop.
2029 */
2030#ifdef CONFIGURE_INIT
2031  #if defined(CONFIGURE_RTEMS_INIT_TASKS_TABLE) || \
2032      defined(CONFIGURE_HAS_OWN_INIT_TASK_TABLE)
2033    void (_RTEMS_tasks_Initialize_user_tasks_body)(void);
2034    void (*_RTEMS_tasks_Initialize_user_tasks_p)(void) =
2035              _RTEMS_tasks_Initialize_user_tasks_body;
2036  #else
2037    void (*_RTEMS_tasks_Initialize_user_tasks_p)(void) = NULL;
2038  #endif
2039#endif
2040
2041/*
2042 *  If the user has configured a set of POSIX Initialization Threads,
2043 *  then we need to install the code that runs that loop.
2044 */
2045#ifdef RTEMS_POSIX_API
2046  #ifdef CONFIGURE_INIT
2047    #if defined(CONFIGURE_POSIX_INIT_THREAD_TABLE) || \
2048        defined(CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE)
2049      void _POSIX_Threads_Initialize_user_threads_body(void);
2050      void (*_POSIX_Threads_Initialize_user_threads_p)(void) =
2051                _POSIX_Threads_Initialize_user_threads_body;
2052    #else
2053      void (*_POSIX_Threads_Initialize_user_threads_p)(void) = NULL;
2054    #endif
2055  #endif
2056#endif
2057
2058#ifdef __cplusplus
2059}
2060#endif
2061
2062/******************************************************************
2063 ******************************************************************
2064 ******************************************************************
2065 *         CONFIGURATION WARNINGS AND ERROR CHECKING              *
2066 ******************************************************************
2067 ******************************************************************
2068 ******************************************************************
2069 */
2070
2071/*
2072 *  Make sure a task/thread of some sort is configured.
2073 *
2074 *  When analyzing RTEMS to find the smallest possible of memory
2075 *  that must be allocated, you probably do want to configure 0
2076 *  tasks/threads so there is a smaller set of calls to _Workspace_Allocate
2077 *  to analyze.
2078 */
2079#if !defined(CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION)
2080  #if (CONFIGURE_MAXIMUM_TASKS == 0) && \
2081      (CONFIGURE_MAXIMUM_POSIX_THREADS == 0) && \
2082      (CONFIGURE_MAXIMUM_ADA_TASKS == 0) && \
2083      (CONFIGURE_MAXIMUM_GOROUTINES == 0)
2084    #error "CONFIGURATION ERROR: No tasks or threads configured!!"
2085  #endif
2086#endif
2087
2088/*
2089 *  Make sure at least one of the initialization task/thread
2090 *  tables was defined.
2091 */
2092#if !defined(CONFIGURE_RTEMS_INIT_TASKS_TABLE) && \
2093    !defined(CONFIGURE_POSIX_INIT_THREAD_TABLE) && \
2094    !defined(CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION)
2095#error "CONFIGURATION ERROR: No initialization tasks or threads configured!!"
2096#endif
2097
2098/*
2099 *  If the user is trying to configure a multiprocessing application and
2100 *  RTEMS was not configured and built multiprocessing, then error out.
2101 */
2102#if defined(CONFIGURE_MP_APPLICATION) && \
2103    !defined(RTEMS_MULTIPROCESSING)
2104#error "CONFIGURATION ERROR: RTEMS not configured for multiprocessing!!"
2105#endif
2106
2107/*
2108 *  If an attempt was made to configure POSIX objects and
2109 *  the POSIX API was not configured into RTEMS, error out.
2110 */
2111#if !defined(RTEMS_POSIX_API)
2112  #if ((CONFIGURE_MAXIMUM_POSIX_THREADS != 0) || \
2113       (CONFIGURE_MAXIMUM_POSIX_MUTEXES != 0) || \
2114       (CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES != 0) || \
2115       (CONFIGURE_MAXIMUM_POSIX_KEYS != 0) || \
2116       (CONFIGURE_MAXIMUM_POSIX_TIMERS != 0) || \
2117       (CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS != 0) || \
2118       (CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES != 0) || \
2119       (CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS != 0) || \
2120       (CONFIGURE_MAXIMUM_POSIX_SEMAPHORES != 0) || \
2121       (CONFIGURE_MAXIMUM_POSIX_BARRIERS != 0) || \
2122       (CONFIGURE_MAXIMUM_POSIX_SPINLOCKS != 0) || \
2123       (CONFIGURE_MAXIMUM_POSIX_RWLOCKS != 0) || \
2124      defined(CONFIGURE_POSIX_INIT_THREAD_TABLE))
2125  #error "CONFIGURATION ERROR: POSIX API support not configured!!"
2126  #endif
2127#endif
2128
2129/*
2130 *  You must either explicity include or exclude the clock driver.
2131 *  It is such a common newbie error to leave it out.  Maybe this
2132 *  will put an end to it.
2133 *
2134 *  NOTE: If you are using the timer driver, it is considered
2135 *        mutually exclusive with the clock driver because the
2136 *        drivers are assumed to use the same "timer" hardware
2137 *        on many boards.
2138 */
2139#if !defined(CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE)
2140  #if !defined(CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER) && \
2141      !defined(CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER) && \
2142      !defined(CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER)
2143    #error "CONFIGURATION ERROR: Do you want the clock driver or not?!?"
2144   #endif
2145#endif
2146
2147/*
2148 *  These names have been obsoleted so make the user application stop compiling
2149 */
2150#if defined(CONFIGURE_TEST_NEEDS_TIMER_DRIVER) || \
2151    defined(CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER) || \
2152    defined(CONFIGURE_TEST_NEEDS_CLOCK_DRIVER) || \
2153    defined(CONFIGURE_TEST_NEEDS_RTC_DRIVER) || \
2154    defined(CONFIGURE_TEST_NEEDS_STUB_DRIVER)
2155#error "CONFIGURATION ERROR: CONFIGURE_TEST_XXX constants are obsolete"
2156#endif
2157
2158/*
2159 *  Validate the configured maximum priority
2160 */
2161#if ((CONFIGURE_MAXIMUM_PRIORITY != 3) && \
2162     (CONFIGURE_MAXIMUM_PRIORITY != 7) && \
2163     (CONFIGURE_MAXIMUM_PRIORITY != 15) && \
2164     (CONFIGURE_MAXIMUM_PRIORITY != 31) && \
2165     (CONFIGURE_MAXIMUM_PRIORITY != 63) && \
2166     (CONFIGURE_MAXIMUM_PRIORITY != 127) && \
2167     (CONFIGURE_MAXIMUM_PRIORITY != 255))
2168  #error "Maximum priority is not 1 less than a power of 2 between 4 and 256"
2169#endif
2170
2171#if (CONFIGURE_MAXIMUM_PRIORITY > PRIORITY_DEFAULT_MAXIMUM)
2172  #error "Maximum priority configured higher than supported by target."
2173#endif
2174
2175/*
2176 *  If you have fewer POSIX Message Queue Descriptors than actual
2177 *  POSIX Message Queues, then you will not be able to open all the
2178 *  queues.
2179 */
2180#if (CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS < \
2181     CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES)
2182  #error "Fewer POSIX Message Queue descriptors than Queues!"
2183#endif
2184
2185#endif
2186/* end of include file */
Note: See TracBrowser for help on using the repository browser.