source: rtems/cpukit/include/rtems/confdefs.h @ 1608221

5
Last change on this file since 1608221 was 1608221, checked in by Sebastian Huber <sebastian.huber@…>, on 02/15/20 at 17:57:57

config: Add <rtems/confdefs/libio.h>

Remove all comments and copyrightable content from the moved content.
Use BSD-2-Clause license for new file.

Update #3053.
Update #3875.

  • Property mode set to 100644
File size: 67.2 KB
Line 
1/**
2 * @file
3 *
4 * @brief Configuration Table Template that will be Instantiated
5 * by an Application
6 *
7 * This include file contains the configuration table template that will
8 * be instantiated by an application based on the setting of a number
9 * of macros.  The macros are documented in the Configuring a System
10 * chapter of the Classic API User's Guide
11 */
12
13/*
14 *  COPYRIGHT (c) 1989-2015.
15 *  On-Line Applications Research Corporation (OAR).
16 *
17 *  The license and distribution terms for this file may be
18 *  found in the file LICENSE in this distribution or at
19 *  http://www.rtems.org/license/LICENSE.
20 */
21
22#ifndef __CONFIGURATION_TEMPLATE_h
23#define __CONFIGURATION_TEMPLATE_h
24
25/*
26 * Include the executive's configuration
27 */
28#include <rtems.h>
29#include <rtems/extensiondata.h>
30#include <rtems/ioimpl.h>
31#include <rtems/sysinit.h>
32#include <rtems/score/apimutex.h>
33#include <rtems/score/context.h>
34#include <rtems/score/userextimpl.h>
35#include <rtems/score/wkspace.h>
36#include <rtems/rtems/barrierdata.h>
37#include <rtems/rtems/dpmemdata.h>
38#include <rtems/rtems/messagedata.h>
39#include <rtems/rtems/partdata.h>
40#include <rtems/rtems/ratemondata.h>
41#include <rtems/rtems/regiondata.h>
42#include <rtems/rtems/semdata.h>
43#include <rtems/rtems/tasksdata.h>
44#include <rtems/rtems/timerdata.h>
45#include <rtems/posix/key.h>
46#include <rtems/posix/mqueue.h>
47#include <rtems/posix/psignal.h>
48#include <rtems/posix/pthread.h>
49#include <rtems/posix/semaphore.h>
50#include <rtems/posix/shm.h>
51#include <rtems/posix/timer.h>
52#include <rtems/confdefs/obsolete.h>
53#include <rtems/confdefs/libio.h>
54#include <rtems/confdefs/libpci.h>
55#include <rtems/confdefs/percpu.h>
56
57#include <limits.h>
58
59#ifdef RTEMS_NEWLIB
60  #include <sys/reent.h>
61#endif
62
63#ifdef __cplusplus
64extern "C" {
65#endif
66
67/*
68 * Internal defines must be prefixed with _CONFIGURE to distinguish them from
69 * user-provided options which use a CONFIGURE prefix.
70 */
71
72/**
73 * @defgroup Configuration RTEMS Configuration
74 *
75 * This module contains all RTEMS Configuration parameters.
76 *
77 * The model is to estimate the memory required for each configured item
78 * and sum those estimates.  The estimate can be too high or too low for
79 * a variety of reasons:
80 *
81 * Reasons estimate is too high:
82 *   + FP contexts (not all tasks are FP)
83 *
84 * Reasons estimate is too low:
85 *   + stacks greater than minimum size
86 *   + messages
87 *   + application must account for device driver resources
88 *   + application must account for add-on library resource requirements
89 *
90 * NOTE:  Eventually this may be able to take into account some of
91 *        the above.  This procedure has evolved from just enough to
92 *        support the RTEMS Test Suites into something that can be
93 *        used remarkably reliably by most applications.
94 */
95
96/**
97 * This macro determines whether the RTEMS reentrancy support for
98 * the Newlib C Library is enabled.
99 */
100#ifdef RTEMS_SCHEDSIM
101  #undef RTEMS_NEWLIB
102#endif
103
104/**
105 * @brief Maximum priority configuration.
106 *
107 * This configures the maximum priority value that
108 * a task may have.
109 *
110 * The following applies to the data space requirements
111 * of the Priority Scheduler.
112 *
113 * By reducing the number of priorities in a system,
114 * the amount of RAM required by RTEMS can be significantly
115 * reduced.  RTEMS allocates a Chain_Control structure per
116 * priority and this structure contains 3 pointers.  So
117 * the default is (256 * 12) = 3K on 32-bit architectures.
118 *
119 * This must be one less than a power of 2 between
120 * 4 and 256.  Valid values along with the application
121 * priority levels and memory saved when pointers are
122 * 32-bits in size are:
123 *
124 *   + 3,  2 application priorities, 3024 bytes saved
125 *   + 7, 5 application priorities, 2976 bytes saved
126 *   + 15, 13 application priorities, 2880 bytes saved
127 *   + 31, 29 application priorities, 2688 bytes saved
128 *   + 63, 61 application priorities, 2304 bytes saved
129 *   + 127, 125 application priorities, 1536 bytes saved
130 *   + 255, 253 application priorities, 0 bytes saved
131 *
132 * It is specified in terms of Classic API priority values.
133 */
134#ifndef CONFIGURE_MAXIMUM_PRIORITY
135  #define CONFIGURE_MAXIMUM_PRIORITY PRIORITY_DEFAULT_MAXIMUM
136#endif
137
138/**
139 *  @defgroup ConfigScheduler Scheduler configuration
140 *
141 *  @ingroup Configuration
142 *
143 * The scheduler configuration allows an application to select the
144 * scheduling policy to use.  The supported configurations are:
145 *
146 *  - CONFIGURE_SCHEDULER_PRIORITY - Deterministic Priority Scheduler
147 *  - CONFIGURE_SCHEDULER_PRIORITY_SMP - Deterministic Priority SMP Scheduler
148 *  - CONFIGURE_SCHEDULER_PRIORITY_AFFINITY_SMP - Deterministic
149 *    Priority SMP Affinity Scheduler
150 *  - CONFIGURE_SCHEDULER_STRONG_APA - Strong APA Scheduler
151 *  - CONFIGURE_SCHEDULER_SIMPLE - Light-weight Priority Scheduler
152 *  - CONFIGURE_SCHEDULER_SIMPLE_SMP - Simple SMP Priority Scheduler
153 *  - CONFIGURE_SCHEDULER_EDF - EDF Scheduler
154 *  - CONFIGURE_SCHEDULER_EDF_SMP - EDF SMP Scheduler
155 *  - CONFIGURE_SCHEDULER_CBS - CBS Scheduler
156 *  - CONFIGURE_SCHEDULER_USER  - user provided scheduler
157 *
158 * If no configuration is specified by the application in a uniprocessor
159 * configuration, then CONFIGURE_SCHEDULER_PRIORITY is the default.
160 *
161 * If no configuration is specified by the application in SMP
162 * configuration, then CONFIGURE_SCHEDULER_PRIORITY_SMP is the default.
163 *
164 * An application can define its own scheduling policy by defining
165 * CONFIGURE_SCHEDULER_USER and the following:
166 *
167 *    - CONFIGURE_SCHEDULER
168 *    - CONFIGURE_SCHEDULER_TABLE_ENTRIES
169 *    - CONFIGURE_SCHEDULER_USER_PER_THREAD
170 */
171
172#if !defined(CONFIGURE_SCHEDULER_USER) && \
173    !defined(CONFIGURE_SCHEDULER_PRIORITY) && \
174    !defined(CONFIGURE_SCHEDULER_PRIORITY_SMP) && \
175    !defined(CONFIGURE_SCHEDULER_PRIORITY_AFFINITY_SMP) && \
176    !defined(CONFIGURE_SCHEDULER_STRONG_APA) && \
177    !defined(CONFIGURE_SCHEDULER_SIMPLE) && \
178    !defined(CONFIGURE_SCHEDULER_SIMPLE_SMP) && \
179    !defined(CONFIGURE_SCHEDULER_EDF) && \
180    !defined(CONFIGURE_SCHEDULER_EDF_SMP) && \
181    !defined(CONFIGURE_SCHEDULER_CBS)
182  #if defined(RTEMS_SMP) && _CONFIGURE_MAXIMUM_PROCESSORS > 1
183    /**
184     * If no scheduler is specified in an SMP configuration, the
185     * EDF scheduler is default.
186     */
187    #define CONFIGURE_SCHEDULER_EDF_SMP
188  #else
189    /**
190     * If no scheduler is specified in a uniprocessor configuration, the
191     * priority scheduler is default.
192     */
193    #define CONFIGURE_SCHEDULER_PRIORITY
194  #endif
195#endif
196
197#include <rtems/scheduler.h>
198
199/*
200 * If the Priority Scheduler is selected, then configure for it.
201 */
202#if defined(CONFIGURE_SCHEDULER_PRIORITY)
203  #if !defined(CONFIGURE_SCHEDULER_NAME)
204    /** Configure the name of the scheduler instance */
205    #define CONFIGURE_SCHEDULER_NAME rtems_build_name('U', 'P', 'D', ' ')
206  #endif
207
208  #if !defined(CONFIGURE_SCHEDULER_TABLE_ENTRIES)
209    /** Configure the context needed by the scheduler instance */
210    #define CONFIGURE_SCHEDULER \
211      RTEMS_SCHEDULER_PRIORITY( \
212        dflt, \
213        CONFIGURE_MAXIMUM_PRIORITY + 1 \
214      )
215
216    /** Configure the controls for this scheduler instance */
217    #define CONFIGURE_SCHEDULER_TABLE_ENTRIES \
218      RTEMS_SCHEDULER_TABLE_PRIORITY(dflt, CONFIGURE_SCHEDULER_NAME)
219  #endif
220#endif
221
222/*
223 * If the Deterministic Priority SMP Scheduler is selected, then configure for
224 * it.
225 */
226#if defined(CONFIGURE_SCHEDULER_PRIORITY_SMP)
227  #if !defined(CONFIGURE_SCHEDULER_NAME)
228    /** Configure the name of the scheduler instance */
229    #define CONFIGURE_SCHEDULER_NAME rtems_build_name('M', 'P', 'D', ' ')
230  #endif
231
232  #if !defined(CONFIGURE_SCHEDULER_TABLE_ENTRIES)
233    /** Configure the context needed by the scheduler instance */
234    #define CONFIGURE_SCHEDULER \
235      RTEMS_SCHEDULER_PRIORITY_SMP( \
236        dflt, \
237        CONFIGURE_MAXIMUM_PRIORITY + 1 \
238      )
239
240    /** Configure the controls for this scheduler instance */
241    #define CONFIGURE_SCHEDULER_TABLE_ENTRIES \
242      RTEMS_SCHEDULER_TABLE_PRIORITY_SMP(dflt, CONFIGURE_SCHEDULER_NAME)
243  #endif
244#endif
245
246/*
247 * If the Deterministic Priority Affinity SMP Scheduler is selected, then configure for
248 * it.
249 */
250#if defined(CONFIGURE_SCHEDULER_PRIORITY_AFFINITY_SMP)
251  #if !defined(CONFIGURE_SCHEDULER_NAME)
252    /** Configure the name of the scheduler instance */
253    #define CONFIGURE_SCHEDULER_NAME rtems_build_name('M', 'P', 'A', ' ')
254  #endif
255
256  #if !defined(CONFIGURE_SCHEDULER_TABLE_ENTRIES)
257    /** Configure the context needed by the scheduler instance */
258    #define CONFIGURE_SCHEDULER \
259      RTEMS_SCHEDULER_PRIORITY_AFFINITY_SMP( \
260        dflt, \
261        CONFIGURE_MAXIMUM_PRIORITY + 1 \
262      )
263
264    /** Configure the controls for this scheduler instance */
265    #define CONFIGURE_SCHEDULER_TABLE_ENTRIES \
266      RTEMS_SCHEDULER_TABLE_PRIORITY_AFFINITY_SMP( \
267        dflt, \
268        CONFIGURE_SCHEDULER_NAME \
269      )
270  #endif
271#endif
272
273/*
274 * If the Strong APA Scheduler is selected, then configure for
275 * it.
276 */
277#if defined(CONFIGURE_SCHEDULER_STRONG_APA)
278  #if !defined(CONFIGURE_SCHEDULER_NAME)
279    /** Configure the name of the scheduler instance */
280    #define CONFIGURE_SCHEDULER_NAME rtems_build_name('M', 'A', 'P', 'A')
281  #endif
282
283  #if !defined(CONFIGURE_SCHEDULER_TABLE_ENTRIES)
284    /** Configure the context needed by the scheduler instance */
285    #define CONFIGURE_SCHEDULER \
286      RTEMS_SCHEDULER_STRONG_APA( \
287        dflt, \
288        CONFIGURE_MAXIMUM_PRIORITY + 1 \
289      )
290
291    /** Configure the controls for this scheduler instance */
292    #define CONFIGURE_SCHEDULER_TABLE_ENTRIES \
293      RTEMS_SCHEDULER_TABLE_STRONG_APA(dflt, CONFIGURE_SCHEDULER_NAME)
294  #endif
295#endif
296
297/*
298 * If the Simple Priority Scheduler is selected, then configure for it.
299 */
300#if defined(CONFIGURE_SCHEDULER_SIMPLE)
301  #if !defined(CONFIGURE_SCHEDULER_NAME)
302    /** Configure the name of the scheduler instance */
303    #define CONFIGURE_SCHEDULER_NAME rtems_build_name('U', 'P', 'S', ' ')
304  #endif
305
306  #if !defined(CONFIGURE_SCHEDULER_TABLE_ENTRIES)
307    /** Configure the context needed by the scheduler instance */
308    #define CONFIGURE_SCHEDULER RTEMS_SCHEDULER_SIMPLE(dflt)
309
310    /** Configure the controls for this scheduler instance */
311    #define CONFIGURE_SCHEDULER_TABLE_ENTRIES \
312      RTEMS_SCHEDULER_TABLE_SIMPLE(dflt, CONFIGURE_SCHEDULER_NAME)
313  #endif
314#endif
315
316/*
317 * If the Simple SMP Priority Scheduler is selected, then configure for it.
318 */
319#if defined(CONFIGURE_SCHEDULER_SIMPLE_SMP)
320  #if !defined(CONFIGURE_SCHEDULER_NAME)
321    /** Configure the name of the scheduler instance */
322    #define CONFIGURE_SCHEDULER_NAME rtems_build_name('M', 'P', 'S', ' ')
323  #endif
324
325  #if !defined(CONFIGURE_SCHEDULER_TABLE_ENTRIES)
326    /** Configure the context needed by the scheduler instance */
327    #define CONFIGURE_SCHEDULER \
328      RTEMS_SCHEDULER_SIMPLE_SMP(dflt)
329
330    /** Configure the controls for this scheduler instance */
331    #define CONFIGURE_SCHEDULER_TABLE_ENTRIES \
332      RTEMS_SCHEDULER_TABLE_SIMPLE_SMP(dflt, CONFIGURE_SCHEDULER_NAME)
333  #endif
334#endif
335
336/*
337 * If the EDF Scheduler is selected, then configure for it.
338 */
339#if defined(CONFIGURE_SCHEDULER_EDF)
340  #if !defined(CONFIGURE_SCHEDULER_NAME)
341    /** Configure the name of the scheduler instance */
342    #define CONFIGURE_SCHEDULER_NAME rtems_build_name('U', 'E', 'D', 'F')
343  #endif
344
345  #if !defined(CONFIGURE_SCHEDULER_TABLE_ENTRIES)
346    /** Configure the context needed by the scheduler instance */
347    #define CONFIGURE_SCHEDULER RTEMS_SCHEDULER_EDF(dflt)
348
349    /** Configure the controls for this scheduler instance */
350    #define CONFIGURE_SCHEDULER_TABLE_ENTRIES \
351      RTEMS_SCHEDULER_TABLE_EDF(dflt, CONFIGURE_SCHEDULER_NAME)
352  #endif
353#endif
354
355/*
356 * If the EDF SMP Scheduler is selected, then configure for it.
357 */
358#if defined(CONFIGURE_SCHEDULER_EDF_SMP)
359  #if !defined(CONFIGURE_SCHEDULER_NAME)
360    /** Configure the name of the scheduler instance */
361    #define CONFIGURE_SCHEDULER_NAME rtems_build_name('M', 'E', 'D', 'F')
362  #endif
363
364  #if !defined(CONFIGURE_SCHEDULER_TABLE_ENTRIES)
365    /** Configure the context needed by the scheduler instance */
366    #define CONFIGURE_SCHEDULER RTEMS_SCHEDULER_EDF_SMP(dflt)
367
368    /** Configure the controls for this scheduler instance */
369    #define CONFIGURE_SCHEDULER_TABLE_ENTRIES \
370      RTEMS_SCHEDULER_TABLE_EDF_SMP(dflt, CONFIGURE_SCHEDULER_NAME)
371  #endif
372#endif
373
374/*
375 * If the CBS Scheduler is selected, then configure for it.
376 */
377#if defined(CONFIGURE_SCHEDULER_CBS)
378  #if !defined(CONFIGURE_SCHEDULER_NAME)
379    /** Configure the name of the scheduler instance */
380    #define CONFIGURE_SCHEDULER_NAME rtems_build_name('U', 'C', 'B', 'S')
381  #endif
382
383  #if !defined(CONFIGURE_SCHEDULER_TABLE_ENTRIES)
384    /** Configure the context needed by the scheduler instance */
385    #define CONFIGURE_SCHEDULER RTEMS_SCHEDULER_CBS(dflt)
386
387    /** Configure the controls for this scheduler instance */
388    #define CONFIGURE_SCHEDULER_TABLE_ENTRIES \
389      RTEMS_SCHEDULER_TABLE_CBS(dflt, CONFIGURE_SCHEDULER_NAME)
390  #endif
391
392  #ifndef CONFIGURE_CBS_MAXIMUM_SERVERS
393    #define CONFIGURE_CBS_MAXIMUM_SERVERS CONFIGURE_MAXIMUM_TASKS
394  #endif
395
396  #ifdef CONFIGURE_INIT
397    const uint32_t _Scheduler_CBS_Maximum_servers =
398      CONFIGURE_CBS_MAXIMUM_SERVERS;
399
400    Scheduler_CBS_Server
401      _Scheduler_CBS_Server_list[ CONFIGURE_CBS_MAXIMUM_SERVERS ];
402  #endif
403#endif
404
405/*
406 * Set up the scheduler entry points table.  The scheduling code uses
407 * this code to know which scheduler is configured by the user.
408 */
409#ifdef CONFIGURE_INIT
410  #if defined(CONFIGURE_SCHEDULER)
411    CONFIGURE_SCHEDULER;
412  #endif
413
414  const Scheduler_Control _Scheduler_Table[] = {
415    CONFIGURE_SCHEDULER_TABLE_ENTRIES
416  };
417
418  #define _CONFIGURE_SCHEDULER_COUNT RTEMS_ARRAY_SIZE( _Scheduler_Table )
419
420  #if defined(RTEMS_SMP)
421    const size_t _Scheduler_Count = _CONFIGURE_SCHEDULER_COUNT;
422
423    const Scheduler_Assignment _Scheduler_Initial_assignments[] = {
424      #if defined(CONFIGURE_SCHEDULER_ASSIGNMENTS)
425        CONFIGURE_SCHEDULER_ASSIGNMENTS
426      #else
427        #define _CONFIGURE_SCHEDULER_ASSIGN \
428          RTEMS_SCHEDULER_ASSIGN( \
429            0, \
430            RTEMS_SCHEDULER_ASSIGN_PROCESSOR_OPTIONAL \
431          )
432        _CONFIGURE_SCHEDULER_ASSIGN
433        #if _CONFIGURE_MAXIMUM_PROCESSORS >= 2
434          , _CONFIGURE_SCHEDULER_ASSIGN
435        #endif
436        #if _CONFIGURE_MAXIMUM_PROCESSORS >= 3
437          , _CONFIGURE_SCHEDULER_ASSIGN
438        #endif
439        #if _CONFIGURE_MAXIMUM_PROCESSORS >= 4
440          , _CONFIGURE_SCHEDULER_ASSIGN
441        #endif
442        #if _CONFIGURE_MAXIMUM_PROCESSORS >= 5
443          , _CONFIGURE_SCHEDULER_ASSIGN
444        #endif
445        #if _CONFIGURE_MAXIMUM_PROCESSORS >= 6
446          , _CONFIGURE_SCHEDULER_ASSIGN
447        #endif
448        #if _CONFIGURE_MAXIMUM_PROCESSORS >= 7
449          , _CONFIGURE_SCHEDULER_ASSIGN
450        #endif
451        #if _CONFIGURE_MAXIMUM_PROCESSORS >= 8
452          , _CONFIGURE_SCHEDULER_ASSIGN
453        #endif
454        #if _CONFIGURE_MAXIMUM_PROCESSORS >= 9
455          , _CONFIGURE_SCHEDULER_ASSIGN
456        #endif
457        #if _CONFIGURE_MAXIMUM_PROCESSORS >= 10
458          , _CONFIGURE_SCHEDULER_ASSIGN
459        #endif
460        #if _CONFIGURE_MAXIMUM_PROCESSORS >= 11
461          , _CONFIGURE_SCHEDULER_ASSIGN
462        #endif
463        #if _CONFIGURE_MAXIMUM_PROCESSORS >= 12
464          , _CONFIGURE_SCHEDULER_ASSIGN
465        #endif
466        #if _CONFIGURE_MAXIMUM_PROCESSORS >= 13
467          , _CONFIGURE_SCHEDULER_ASSIGN
468        #endif
469        #if _CONFIGURE_MAXIMUM_PROCESSORS >= 14
470          , _CONFIGURE_SCHEDULER_ASSIGN
471        #endif
472        #if _CONFIGURE_MAXIMUM_PROCESSORS >= 15
473          , _CONFIGURE_SCHEDULER_ASSIGN
474        #endif
475        #if _CONFIGURE_MAXIMUM_PROCESSORS >= 16
476          , _CONFIGURE_SCHEDULER_ASSIGN
477        #endif
478        #if _CONFIGURE_MAXIMUM_PROCESSORS >= 17
479          , _CONFIGURE_SCHEDULER_ASSIGN
480        #endif
481        #if _CONFIGURE_MAXIMUM_PROCESSORS >= 18
482          , _CONFIGURE_SCHEDULER_ASSIGN
483        #endif
484        #if _CONFIGURE_MAXIMUM_PROCESSORS >= 19
485          , _CONFIGURE_SCHEDULER_ASSIGN
486        #endif
487        #if _CONFIGURE_MAXIMUM_PROCESSORS >= 20
488          , _CONFIGURE_SCHEDULER_ASSIGN
489        #endif
490        #if _CONFIGURE_MAXIMUM_PROCESSORS >= 21
491          , _CONFIGURE_SCHEDULER_ASSIGN
492        #endif
493        #if _CONFIGURE_MAXIMUM_PROCESSORS >= 22
494          , _CONFIGURE_SCHEDULER_ASSIGN
495        #endif
496        #if _CONFIGURE_MAXIMUM_PROCESSORS >= 23
497          , _CONFIGURE_SCHEDULER_ASSIGN
498        #endif
499        #if _CONFIGURE_MAXIMUM_PROCESSORS >= 24
500          , _CONFIGURE_SCHEDULER_ASSIGN
501        #endif
502        #if _CONFIGURE_MAXIMUM_PROCESSORS >= 25
503          , _CONFIGURE_SCHEDULER_ASSIGN
504        #endif
505        #if _CONFIGURE_MAXIMUM_PROCESSORS >= 26
506          , _CONFIGURE_SCHEDULER_ASSIGN
507        #endif
508        #if _CONFIGURE_MAXIMUM_PROCESSORS >= 27
509          , _CONFIGURE_SCHEDULER_ASSIGN
510        #endif
511        #if _CONFIGURE_MAXIMUM_PROCESSORS >= 28
512          , _CONFIGURE_SCHEDULER_ASSIGN
513        #endif
514        #if _CONFIGURE_MAXIMUM_PROCESSORS >= 29
515          , _CONFIGURE_SCHEDULER_ASSIGN
516        #endif
517        #if _CONFIGURE_MAXIMUM_PROCESSORS >= 30
518          , _CONFIGURE_SCHEDULER_ASSIGN
519        #endif
520        #if _CONFIGURE_MAXIMUM_PROCESSORS >= 31
521          , _CONFIGURE_SCHEDULER_ASSIGN
522        #endif
523        #if _CONFIGURE_MAXIMUM_PROCESSORS >= 32
524          , _CONFIGURE_SCHEDULER_ASSIGN
525        #endif
526        #undef _CONFIGURE_SCHEDULER_ASSIGN
527      #endif
528    };
529
530    RTEMS_STATIC_ASSERT(
531      _CONFIGURE_MAXIMUM_PROCESSORS
532        == RTEMS_ARRAY_SIZE( _Scheduler_Initial_assignments ),
533      _Scheduler_Initial_assignments
534    );
535  #endif
536#endif
537/**@}*/ /* end of Scheduler Configuration */
538
539/**
540 * @defgroup ConfigurationMalloc RTEMS Malloc configuration
541 *
542 * This module contains parameters related to configuration of the RTEMS
543 * Malloc implementation.
544 */
545/**@{*/
546#include <rtems/malloc.h>
547
548#ifdef CONFIGURE_INIT
549  /**
550   * This configures the sbrk() support for the malloc family.
551   * By default it is assumed that the BSP provides all available
552   * RAM to the malloc family implementation so sbrk()'ing to get
553   * more memory would always fail anyway.
554   */
555  const rtems_heap_extend_handler rtems_malloc_extend_handler =
556    #ifdef CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK
557      rtems_heap_extend_via_sbrk;
558    #else
559      rtems_heap_null_extend;
560    #endif
561#endif
562
563#ifdef CONFIGURE_INIT
564  /**
565   * This configures the malloc family plugin which dirties memory
566   * allocated.  This is helpful for finding unitialized data structure
567   * problems.
568   */
569  rtems_malloc_dirtier_t rtems_malloc_dirty_helper =
570    #if defined(CONFIGURE_MALLOC_DIRTY)
571      rtems_malloc_dirty_memory;
572    #else
573      NULL;
574    #endif
575#endif
576/**@}*/  /* end of Malloc Configuration */
577
578/**
579 * @defgroup ConfigurationHelpers Configuration Helpers
580 *
581 * @ingroup Configuration
582 *
583 * This module contains items which are used internally to ease
584 * the configuration calculations.
585 */
586/**@{*/
587
588/**
589 * Zero of one returns 0 if the parameter is 0 else 1 is returned.
590 */
591#define _Configure_Zero_or_One(_number) ((_number) != 0 ? 1 : 0)
592
593/**
594 * General helper to align up a value.
595 */
596#define _Configure_Align_up(_val, _align) \
597  (((_val) + (_align) - 1) - ((_val) + (_align) - 1) % (_align))
598
599#define _CONFIGURE_HEAP_MIN_BLOCK_SIZE \
600  _Configure_Align_up(sizeof(Heap_Block), CPU_HEAP_ALIGNMENT)
601
602/**
603 * This is a helper macro used in calculations in this file.  It is used
604 * to noted when an element is allocated from the RTEMS Workspace and adds
605 * a factor to account for heap overhead plus an alignment factor that
606 * may be applied.
607 */
608#define _Configure_From_workspace(_size) \
609  (uintptr_t) (_Configure_Zero_or_One(_size) * \
610    _Configure_Align_up(_size + HEAP_BLOCK_HEADER_SIZE, \
611      _CONFIGURE_HEAP_MIN_BLOCK_SIZE))
612
613/**
614 * This is a helper macro used in stack space calculations in this file.  It
615 * may be provided by the application in case a special task stack allocator
616 * is used.  The default is allocation from the RTEMS Workspace.
617 */
618#ifdef CONFIGURE_TASK_STACK_FROM_ALLOCATOR
619  #define _Configure_From_stackspace(_stack_size) \
620    CONFIGURE_TASK_STACK_FROM_ALLOCATOR(_stack_size + CONTEXT_FP_SIZE)
621#else
622  #define _Configure_From_stackspace(_stack_size) \
623    _Configure_From_workspace(_stack_size + CONTEXT_FP_SIZE)
624#endif
625/**@}*/
626
627/**
628 * @defgroup ConfigurationInitTasksTable Initialization Tasks Configuration
629 *
630 * @addtogroup Configuration
631 *
632 * This group contains the elements needed to define the Classic API
633 * Initialization Tasks Table.
634 *
635 * Default User Initialization Task Table.  This table guarantees that
636 * one user initialization table is defined.
637 */
638#if defined(CONFIGURE_RTEMS_INIT_TASKS_TABLE)
639
640/**
641 * When using the default Classic API Initialization Tasks Table, this is
642 * used to specify the name of the single Classic API task.
643 */
644#ifndef CONFIGURE_INIT_TASK_NAME
645  #define CONFIGURE_INIT_TASK_NAME          rtems_build_name('U', 'I', '1', ' ')
646#endif
647
648/**
649 * When using the default Classic API Initialization Tasks Table, this is
650 * used to specify the stack size of the single Classic API task.
651 */
652#ifndef CONFIGURE_INIT_TASK_STACK_SIZE
653  #define CONFIGURE_INIT_TASK_STACK_SIZE    CONFIGURE_MINIMUM_TASK_STACK_SIZE
654#endif
655
656/**
657 * When using the default Classic API Initialization Tasks Table, this is
658 * used to specify the priority of the single Classic API task.
659 */
660#ifndef CONFIGURE_INIT_TASK_PRIORITY
661  #define CONFIGURE_INIT_TASK_PRIORITY      1
662#endif
663
664/**
665 * When using the default Classic API Initialization Tasks Table, this is
666 * used to specify the attributes size of the single Classic API task.
667 */
668#ifndef CONFIGURE_INIT_TASK_ATTRIBUTES
669  #define CONFIGURE_INIT_TASK_ATTRIBUTES    RTEMS_DEFAULT_ATTRIBUTES
670#endif
671
672/**
673 * When using the default Classic API Initialization Tasks Table, this is
674 * used to specify the entry point of the single Classic API task.
675 */
676#ifndef CONFIGURE_INIT_TASK_ENTRY_POINT
677  #ifdef __cplusplus
678  extern "C" {
679  #endif
680    rtems_task Init (rtems_task_argument );
681  #ifdef __cplusplus
682  }
683  #endif
684  #define CONFIGURE_INIT_TASK_ENTRY_POINT   Init
685  extern const char* bsp_boot_cmdline;
686  #define CONFIGURE_INIT_TASK_ARGUMENTS     ((rtems_task_argument) &bsp_boot_cmdline)
687#endif
688
689/**
690 * When using the default Classic API Initialization Tasks Table, this is
691 * used to specify the initial execution mode of the single Classic API task.
692 */
693#ifndef CONFIGURE_INIT_TASK_INITIAL_MODES
694  #ifdef RTEMS_SMP
695    #define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_DEFAULT_MODES
696  #else
697    #define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_NO_PREEMPT
698  #endif
699#endif
700
701/**
702 * When using the default Classic API Initialization Tasks Table, this is
703 * used to specify the initial argument to the single Classic API task.
704 */
705#ifndef CONFIGURE_INIT_TASK_ARGUMENTS
706  #define CONFIGURE_INIT_TASK_ARGUMENTS     0
707#endif
708
709#else     /* CONFIGURE_RTEMS_INIT_TASKS_TABLE */
710
711/*
712 * This is the stack size of the Initialization Task when none is configured.
713 */
714#define CONFIGURE_INIT_TASK_STACK_SIZE 0
715
716#endif
717/**@}*/  /* end of Classic API Initialization Tasks Table */
718
719/**
720 * @defgroup ConfigurationDriverTable Device Driver Table Configuration
721 *
722 * @addtogroup Configuration
723 *
724 * This group contains parameters related to generating a Device Driver
725 * Table.
726 *
727 * Default Device Driver Table.  Each driver needed by the test is explicitly
728 * chosen by the application.  There is always a null driver entry.
729 */
730/**@{*/
731
732/**
733 * This is an empty device driver slot.
734 */
735#define NULL_DRIVER_TABLE_ENTRY \
736 { NULL, NULL, NULL, NULL, NULL, NULL }
737
738#if (defined(CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER) && \
739    defined(CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER)) || \
740  (defined(CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER) && \
741    defined(CONFIGURE_APPLICATION_NEEDS_SIMPLE_TASK_CONSOLE_DRIVER)) || \
742  (defined(CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER) && \
743    defined(CONFIGURE_APPLICATION_NEEDS_SIMPLE_TASK_CONSOLE_DRIVER))
744#error "CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER, CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER, and CONFIGURE_APPLICATION_NEEDS_SIMPLE_TASK_CONSOLE_DRIVER are mutually exclusive"
745#endif
746
747#ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
748  #include <rtems/console.h>
749#endif
750
751#ifdef CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER
752  #include <rtems/console.h>
753
754  #ifdef CONFIGURE_INIT
755    RTEMS_SYSINIT_ITEM(
756      _Console_simple_Initialize,
757      RTEMS_SYSINIT_DEVICE_DRIVERS,
758      RTEMS_SYSINIT_ORDER_SECOND
759    );
760  #endif
761#endif
762
763#ifdef CONFIGURE_APPLICATION_NEEDS_SIMPLE_TASK_CONSOLE_DRIVER
764  #include <rtems/console.h>
765
766  #ifdef CONFIGURE_INIT
767    RTEMS_SYSINIT_ITEM(
768      _Console_simple_task_Initialize,
769      RTEMS_SYSINIT_DEVICE_DRIVERS,
770      RTEMS_SYSINIT_ORDER_SECOND
771    );
772  #endif
773#endif
774
775#ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
776  #include <rtems/clockdrv.h>
777
778  #ifdef CONFIGURE_INIT
779    RTEMS_SYSINIT_ITEM(
780      _Clock_Initialize,
781      RTEMS_SYSINIT_DEVICE_DRIVERS,
782      RTEMS_SYSINIT_ORDER_THIRD
783    );
784  #endif
785#endif
786
787#ifdef CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
788  #include <rtems/btimer.h>
789#endif
790
791#ifdef CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER
792  #include <rtems/rtc.h>
793#endif
794
795#ifdef CONFIGURE_APPLICATION_NEEDS_WATCHDOG_DRIVER
796  #include <rtems/watchdogdrv.h>
797#endif
798
799#ifdef CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER
800  #include <rtems/framebuffer.h>
801#endif
802
803#ifdef CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER
804  #include <rtems/devnull.h>
805#endif
806
807#ifdef CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER
808  #include <rtems/devzero.h>
809#endif
810
811#ifdef CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER
812  /* the ide driver needs the ATA driver */
813  #ifndef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
814    #define CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
815  #endif
816  #include <libchip/ide_ctrl.h>
817#endif
818
819#ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
820  #include <libchip/ata.h>
821#endif
822
823/**
824 * This specifies the maximum number of device drivers that
825 * can be installed in the system at one time.  It must account
826 * for both the statically and dynamically installed drivers.
827 */
828#ifndef CONFIGURE_MAXIMUM_DRIVERS
829  #define CONFIGURE_MAXIMUM_DRIVERS
830#endif
831
832#ifdef CONFIGURE_INIT
833  rtems_driver_address_table
834    _IO_Driver_address_table[ CONFIGURE_MAXIMUM_DRIVERS ] = {
835    #ifdef CONFIGURE_BSP_PREREQUISITE_DRIVERS
836      CONFIGURE_BSP_PREREQUISITE_DRIVERS,
837    #endif
838    #ifdef CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS
839      CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS,
840    #endif
841    #ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
842      CONSOLE_DRIVER_TABLE_ENTRY,
843    #endif
844    #ifdef CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER
845      RTC_DRIVER_TABLE_ENTRY,
846    #endif
847    #ifdef CONFIGURE_APPLICATION_NEEDS_WATCHDOG_DRIVER
848      WATCHDOG_DRIVER_TABLE_ENTRY,
849    #endif
850    #ifdef CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER
851      DEVNULL_DRIVER_TABLE_ENTRY,
852    #endif
853    #ifdef CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER
854      DEVZERO_DRIVER_TABLE_ENTRY,
855    #endif
856    #ifdef CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER
857      IDE_CONTROLLER_DRIVER_TABLE_ENTRY,
858    #endif
859    #ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
860      ATA_DRIVER_TABLE_ENTRY,
861    #endif
862    #ifdef CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER
863      FRAME_BUFFER_DRIVER_TABLE_ENTRY,
864    #endif
865    #ifdef CONFIGURE_APPLICATION_EXTRA_DRIVERS
866      CONFIGURE_APPLICATION_EXTRA_DRIVERS,
867    #endif
868    #ifdef CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER
869      NULL_DRIVER_TABLE_ENTRY
870    #elif !defined(CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER) && \
871        !defined(CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER) && \
872        !defined(CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER) && \
873        !defined(CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER) && \
874        !defined(CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER) && \
875        !defined(CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER) && \
876        !defined(CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER) && \
877        !defined(CONFIGURE_APPLICATION_EXTRA_DRIVERS)
878      NULL_DRIVER_TABLE_ENTRY
879    #endif
880  };
881
882  const size_t _IO_Number_of_drivers =
883    RTEMS_ARRAY_SIZE( _IO_Driver_address_table );
884#endif
885
886#ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
887  /*
888   * configure the priority of the ATA driver task
889   */
890  #ifndef CONFIGURE_ATA_DRIVER_TASK_PRIORITY
891    #define CONFIGURE_ATA_DRIVER_TASK_PRIORITY ATA_DRIVER_TASK_DEFAULT_PRIORITY
892  #endif
893  #ifdef CONFIGURE_INIT
894    rtems_task_priority rtems_ata_driver_task_priority
895      = CONFIGURE_ATA_DRIVER_TASK_PRIORITY;
896  #endif /* CONFIGURE_INIT */
897#endif
898/**@}*/ /* end of Device Driver Table Configuration */
899
900/**
901 * @defgroup ConfigurationLibBlock Configuration of LIBBLOCK
902 *
903 * @addtogroup Configuration
904 *
905 * This module contains parameters related to the LIBBLOCK buffering
906 * and caching subsystem. It requires tasks to swap out data to be
907 * written to non-volatile storage.
908 */
909/**@{*/
910#ifdef CONFIGURE_APPLICATION_NEEDS_LIBBLOCK
911  #include <rtems/bdbuf.h>
912  /*
913   * configure the bdbuf cache parameters
914   */
915  #ifndef CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS
916    #define CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS \
917                              RTEMS_BDBUF_MAX_READ_AHEAD_BLOCKS_DEFAULT
918  #endif
919  #ifndef CONFIGURE_BDBUF_MAX_WRITE_BLOCKS
920    #define CONFIGURE_BDBUF_MAX_WRITE_BLOCKS \
921                              RTEMS_BDBUF_MAX_WRITE_BLOCKS_DEFAULT
922  #endif
923  #ifndef CONFIGURE_SWAPOUT_TASK_PRIORITY
924    #define CONFIGURE_SWAPOUT_TASK_PRIORITY \
925                              RTEMS_BDBUF_SWAPOUT_TASK_PRIORITY_DEFAULT
926  #endif
927  #ifndef CONFIGURE_SWAPOUT_SWAP_PERIOD
928    #define CONFIGURE_SWAPOUT_SWAP_PERIOD \
929                              RTEMS_BDBUF_SWAPOUT_TASK_SWAP_PERIOD_DEFAULT
930  #endif
931  #ifndef CONFIGURE_SWAPOUT_BLOCK_HOLD
932    #define CONFIGURE_SWAPOUT_BLOCK_HOLD \
933                              RTEMS_BDBUF_SWAPOUT_TASK_BLOCK_HOLD_DEFAULT
934  #endif
935  #ifndef CONFIGURE_SWAPOUT_WORKER_TASKS
936    #define CONFIGURE_SWAPOUT_WORKER_TASKS \
937                              RTEMS_BDBUF_SWAPOUT_WORKER_TASKS_DEFAULT
938  #endif
939  #ifndef CONFIGURE_SWAPOUT_WORKER_TASK_PRIORITY
940    #define CONFIGURE_SWAPOUT_WORKER_TASK_PRIORITY \
941                              RTEMS_BDBUF_SWAPOUT_WORKER_TASK_PRIORITY_DEFAULT
942  #endif
943  #ifndef CONFIGURE_BDBUF_TASK_STACK_SIZE
944    #define CONFIGURE_BDBUF_TASK_STACK_SIZE \
945                              RTEMS_BDBUF_TASK_STACK_SIZE_DEFAULT
946  #endif
947  #ifndef CONFIGURE_BDBUF_CACHE_MEMORY_SIZE
948    #define CONFIGURE_BDBUF_CACHE_MEMORY_SIZE \
949                              RTEMS_BDBUF_CACHE_MEMORY_SIZE_DEFAULT
950  #endif
951  #ifndef CONFIGURE_BDBUF_BUFFER_MIN_SIZE
952    #define CONFIGURE_BDBUF_BUFFER_MIN_SIZE \
953                              RTEMS_BDBUF_BUFFER_MIN_SIZE_DEFAULT
954  #endif
955  #ifndef CONFIGURE_BDBUF_BUFFER_MAX_SIZE
956    #define CONFIGURE_BDBUF_BUFFER_MAX_SIZE \
957                              RTEMS_BDBUF_BUFFER_MAX_SIZE_DEFAULT
958  #endif
959  #ifndef CONFIGURE_BDBUF_READ_AHEAD_TASK_PRIORITY
960    #define CONFIGURE_BDBUF_READ_AHEAD_TASK_PRIORITY \
961                              RTEMS_BDBUF_READ_AHEAD_TASK_PRIORITY_DEFAULT
962  #endif
963  #ifdef CONFIGURE_INIT
964    const rtems_bdbuf_config rtems_bdbuf_configuration = {
965      CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS,
966      CONFIGURE_BDBUF_MAX_WRITE_BLOCKS,
967      CONFIGURE_SWAPOUT_TASK_PRIORITY,
968      CONFIGURE_SWAPOUT_SWAP_PERIOD,
969      CONFIGURE_SWAPOUT_BLOCK_HOLD,
970      CONFIGURE_SWAPOUT_WORKER_TASKS,
971      CONFIGURE_SWAPOUT_WORKER_TASK_PRIORITY,
972      CONFIGURE_BDBUF_TASK_STACK_SIZE,
973      CONFIGURE_BDBUF_CACHE_MEMORY_SIZE,
974      CONFIGURE_BDBUF_BUFFER_MIN_SIZE,
975      CONFIGURE_BDBUF_BUFFER_MAX_SIZE,
976      CONFIGURE_BDBUF_READ_AHEAD_TASK_PRIORITY
977    };
978  #endif
979
980  #define _CONFIGURE_LIBBLOCK_TASKS \
981    (1 + CONFIGURE_SWAPOUT_WORKER_TASKS + \
982    (CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS != 0))
983
984  #define _CONFIGURE_LIBBLOCK_TASK_EXTRA_STACKS \
985    (_CONFIGURE_LIBBLOCK_TASKS * \
986    (CONFIGURE_BDBUF_TASK_STACK_SIZE <= CONFIGURE_MINIMUM_TASK_STACK_SIZE ? \
987    0 : CONFIGURE_BDBUF_TASK_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE))
988#else
989  /** This specifies the number of libblock tasks. */
990  #define _CONFIGURE_LIBBLOCK_TASKS 0
991  /** This specifies the extra stack space configured for libblock tasks. */
992  #define _CONFIGURE_LIBBLOCK_TASK_EXTRA_STACKS 0
993  /** This specifies the number of Classic API semaphores needed by libblock. */
994#endif /* CONFIGURE_APPLICATION_NEEDS_LIBBLOCK */
995/**@}*/
996
997/**
998 * @defgroup ConfigurationMultiprocessing Multiprocessing Configuration
999 *
1000 * @addtogroup Configuration
1001 *
1002 * This module contains the parameters related to the Multiprocessing
1003 * configuration of RTEMS.
1004 *
1005 * In a single processor or SMP configuration, only two parameters are
1006 * needed and they are defaulted. The user should not have to specify
1007 * any parameters.
1008 */
1009/**@{*/
1010
1011/**
1012 * This defines the extra stack space required for the MPCI server thread.
1013 */
1014#ifndef CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK
1015  #define CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK 0
1016#endif
1017
1018#if defined(RTEMS_MULTIPROCESSING)
1019  /*
1020   *  Default Multiprocessing Configuration Table.  The defaults are
1021   *  appropriate for most of the RTEMS Multiprocessor Test Suite.  Each
1022   *  value may be overridden within each test to customize the environment.
1023   */
1024
1025  #ifdef CONFIGURE_MP_APPLICATION
1026    #ifndef CONFIGURE_MP_NODE_NUMBER
1027      #define CONFIGURE_MP_NODE_NUMBER                NODE_NUMBER
1028    #endif
1029
1030    #ifndef CONFIGURE_MP_MAXIMUM_NODES
1031      #define CONFIGURE_MP_MAXIMUM_NODES              2
1032    #endif
1033
1034    #ifndef CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS
1035      #define CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS     32
1036    #endif
1037
1038    #ifndef CONFIGURE_MP_MAXIMUM_PROXIES
1039      #define CONFIGURE_MP_MAXIMUM_PROXIES            32
1040    #endif
1041
1042    #ifndef CONFIGURE_MP_MPCI_TABLE_POINTER
1043      #include <mpci.h>
1044      #define CONFIGURE_MP_MPCI_TABLE_POINTER         &MPCI_table
1045    #endif
1046
1047    #ifdef CONFIGURE_INIT
1048      #if CONFIGURE_MP_NODE_NUMBER < 1
1049        #error "CONFIGURE_MP_NODE_NUMBER must be greater than or equal to one"
1050      #endif
1051
1052      #if CONFIGURE_MP_NODE_NUMBER > CONFIGURE_MP_MAXIMUM_NODES
1053        #error "CONFIGURE_MP_NODE_NUMBER must be less than or equal to CONFIGURE_MP_MAXIMUM_NODES"
1054      #endif
1055
1056      Objects_MP_Control _Objects_MP_Controls[
1057        CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS
1058      ];
1059
1060      struct Thread_Configured_proxy_control {
1061        Thread_Proxy_control Control;
1062        Thread_queue_Configured_heads Heads;
1063      };
1064
1065      static Thread_Configured_proxy_control _Thread_MP_Configured_proxies[
1066        CONFIGURE_MP_MAXIMUM_PROXIES
1067      ];
1068
1069      Thread_Configured_proxy_control * const _Thread_MP_Proxies =
1070        &_Thread_MP_Configured_proxies[ 0 ];
1071
1072      const MPCI_Configuration _MPCI_Configuration = {
1073        CONFIGURE_MP_NODE_NUMBER,               /* local node number */
1074        CONFIGURE_MP_MAXIMUM_NODES,             /* maximum # nodes */
1075        CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS,    /* maximum # global objects */
1076        CONFIGURE_MP_MAXIMUM_PROXIES,           /* maximum # proxies */
1077        CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK, /* MPCI stack > minimum */
1078        CONFIGURE_MP_MPCI_TABLE_POINTER         /* ptr to MPCI config table */
1079      };
1080
1081      char _MPCI_Receive_server_stack[
1082        CONFIGURE_MINIMUM_TASK_STACK_SIZE
1083          + CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK
1084          + CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK
1085          + CPU_ALL_TASKS_ARE_FP * CONTEXT_FP_SIZE
1086      ] RTEMS_ALIGNED( CPU_INTERRUPT_STACK_ALIGNMENT )
1087      RTEMS_SECTION( ".rtemsstack.mpci" );
1088    #endif
1089
1090    #define _CONFIGURE_MPCI_RECEIVE_SERVER_COUNT 1
1091  #else
1092    #define _CONFIGURE_MPCI_RECEIVE_SERVER_COUNT 0
1093  #endif /* CONFIGURE_MP_APPLICATION */
1094#else
1095  #define _CONFIGURE_MPCI_RECEIVE_SERVER_COUNT 0
1096#endif /* RTEMS_MULTIPROCESSING */
1097/**@}*/ /* end of Multiprocessing Configuration */
1098
1099/**
1100 * This macro specifies that the user wants to use unlimited objects for any
1101 * classic or posix objects that have not already been given resource limits.
1102 */
1103#if defined(CONFIGURE_UNLIMITED_OBJECTS)
1104  #if !defined(CONFIGURE_UNIFIED_WORK_AREAS) && \
1105     !defined(CONFIGURE_EXECUTIVE_RAM_SIZE) && \
1106     !defined(CONFIGURE_MEMORY_OVERHEAD)
1107     #error "CONFIGURE_UNLIMITED_OBJECTS requires a unified work area, an executive RAM size, or a defined workspace memory overhead"
1108  #endif
1109
1110  #if !defined(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
1111  /**
1112   * This macro specifies a default allocation size for when auto-extending
1113   * unlimited objects if none was given by the user.
1114   */
1115    #define CONFIGURE_UNLIMITED_ALLOCATION_SIZE 8
1116  #endif
1117  #if !defined(CONFIGURE_MAXIMUM_TASKS)
1118    #define CONFIGURE_MAXIMUM_TASKS \
1119      rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
1120  #endif
1121  #if !defined(CONFIGURE_MAXIMUM_TIMERS)
1122    #define CONFIGURE_MAXIMUM_TIMERS \
1123      rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
1124  #endif
1125  #if !defined(CONFIGURE_MAXIMUM_SEMAPHORES)
1126    #define CONFIGURE_MAXIMUM_SEMAPHORES \
1127      rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
1128  #endif
1129  #if !defined(CONFIGURE_MAXIMUM_MESSAGE_QUEUES)
1130    #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES \
1131      rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
1132  #endif
1133  #if !defined(CONFIGURE_MAXIMUM_PARTITIONS)
1134    #define CONFIGURE_MAXIMUM_PARTITIONS \
1135      rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
1136  #endif
1137  #if !defined(CONFIGURE_MAXIMUM_REGIONS)
1138    #define CONFIGURE_MAXIMUM_REGIONS \
1139      rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
1140  #endif
1141  #if !defined(CONFIGURE_MAXIMUM_PORTS)
1142    #define CONFIGURE_MAXIMUM_PORTS \
1143      rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
1144  #endif
1145  #if !defined(CONFIGURE_MAXIMUM_PERIODS)
1146    #define CONFIGURE_MAXIMUM_PERIODS \
1147      rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
1148  #endif
1149  #if !defined(CONFIGURE_MAXIMUM_BARRIERS)
1150    #define CONFIGURE_MAXIMUM_BARRIERS \
1151      rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
1152  #endif
1153  #if !defined(CONFIGURE_MAXIMUM_POSIX_KEYS)
1154    #define CONFIGURE_MAXIMUM_POSIX_KEYS \
1155      rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
1156  #endif
1157  #if !defined(CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS)
1158    #define CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS \
1159      rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
1160  #endif
1161  #if !defined(CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES)
1162    #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES \
1163      rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
1164  #endif
1165  #if !defined(CONFIGURE_MAXIMUM_POSIX_SEMAPHORES)
1166    #define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES \
1167      rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
1168  #endif
1169  #if !defined(CONFIGURE_MAXIMUM_POSIX_SHMS)
1170    #define CONFIGURE_MAXIMUM_POSIX_SHMS \
1171      rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
1172  #endif
1173  #if !defined(CONFIGURE_MAXIMUM_POSIX_THREADS)
1174    #define CONFIGURE_MAXIMUM_POSIX_THREADS \
1175      rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
1176  #endif
1177
1178  #ifdef RTEMS_POSIX_API
1179    #if !defined(CONFIGURE_MAXIMUM_POSIX_TIMERS)
1180      #define CONFIGURE_MAXIMUM_POSIX_TIMERS \
1181        rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE)
1182    #endif
1183  #endif /* RTEMS_POSIX_API */
1184#endif /* CONFIGURE_UNLIMITED_OBJECTS */
1185
1186
1187/**
1188 * @defgroup ConfigurationClassicAPI Classic API Configuration
1189 *
1190 * @ingroup Configuration
1191 *
1192 * This module contains the parameters related to configuration
1193 * of the Classic API services.
1194 */
1195/**@{*/
1196
1197/** This configures the maximum number of Classic API tasks. */
1198#ifndef CONFIGURE_MAXIMUM_TASKS
1199  #define CONFIGURE_MAXIMUM_TASKS               0
1200#endif
1201
1202/*
1203 * This is calculated to account for the maximum number of Classic API
1204 * tasks used by the application and configured RTEMS capabilities.
1205 */
1206#define _CONFIGURE_TASKS \
1207  (CONFIGURE_MAXIMUM_TASKS + _CONFIGURE_LIBBLOCK_TASKS)
1208
1209#ifndef CONFIGURE_MAXIMUM_TIMERS
1210  /** This specifies the maximum number of Classic API timers. */
1211  #define CONFIGURE_MAXIMUM_TIMERS             0
1212#endif
1213
1214#ifndef CONFIGURE_MAXIMUM_SEMAPHORES
1215  /** This specifies the maximum number of Classic API semaphores. */
1216  #define CONFIGURE_MAXIMUM_SEMAPHORES                 0
1217#endif
1218
1219#ifndef CONFIGURE_MAXIMUM_MESSAGE_QUEUES
1220  /**
1221   * This configuration parameter specifies the maximum number of
1222   * Classic API Message Queues.
1223   */
1224  #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES             0
1225#endif
1226
1227#ifndef CONFIGURE_MAXIMUM_PARTITIONS
1228  /**
1229   * This configuration parameter specifies the maximum number of
1230   * Classic API Partitions.
1231   */
1232  #define CONFIGURE_MAXIMUM_PARTITIONS                 0
1233#endif
1234
1235#ifndef CONFIGURE_MAXIMUM_REGIONS
1236  /**
1237   * This configuration parameter specifies the maximum number of
1238   * Classic API Regions.
1239   */
1240  #define CONFIGURE_MAXIMUM_REGIONS              0
1241#endif
1242
1243#ifndef CONFIGURE_MAXIMUM_PORTS
1244  /**
1245   * This configuration parameter specifies the maximum number of
1246   * Classic API Dual-Ported Memory Ports.
1247   */
1248  #define CONFIGURE_MAXIMUM_PORTS            0
1249#endif
1250
1251#ifndef CONFIGURE_MAXIMUM_PERIODS
1252  /**
1253   * This configuration parameter specifies the maximum number of
1254   * Classic API Rate Monotonic Periods.
1255   */
1256  #define CONFIGURE_MAXIMUM_PERIODS              0
1257#endif
1258
1259/**
1260 * This configuration parameter specifies the maximum number of
1261 * Classic API Barriers.
1262 */
1263#ifndef CONFIGURE_MAXIMUM_BARRIERS
1264  #define CONFIGURE_MAXIMUM_BARRIERS               0
1265#endif
1266
1267#ifndef CONFIGURE_MAXIMUM_USER_EXTENSIONS
1268  /**
1269   * This configuration parameter specifies the maximum number of
1270   * Classic API User Extensions.
1271   */
1272  #define CONFIGURE_MAXIMUM_USER_EXTENSIONS                 0
1273#endif
1274
1275/**@}*/ /* end of Classic API Configuration */
1276
1277/**
1278 * @defgroup ConfigurationGeneral General System Configuration
1279 *
1280 * @ingroup Configuration
1281 *
1282 * This module contains configuration parameters that are independent
1283 * of any API but impact general system configuration.
1284 */
1285/**@{*/
1286
1287/** The configures the number of microseconds per clock tick. */
1288#ifndef CONFIGURE_MICROSECONDS_PER_TICK
1289  #define CONFIGURE_MICROSECONDS_PER_TICK \
1290          RTEMS_MILLISECONDS_TO_MICROSECONDS(10)
1291#endif
1292
1293#if 1000000 % CONFIGURE_MICROSECONDS_PER_TICK != 0
1294  #warning "The clock ticks per second is not an integer"
1295#endif
1296
1297#if CONFIGURE_MICROSECONDS_PER_TICK <= 0
1298  #error "The CONFIGURE_MICROSECONDS_PER_TICK must be positive"
1299#endif
1300
1301#ifdef CONFIGURE_INIT
1302  const uint32_t _Watchdog_Microseconds_per_tick =
1303    CONFIGURE_MICROSECONDS_PER_TICK;
1304
1305  const uint32_t _Watchdog_Nanoseconds_per_tick =
1306    (uint32_t) 1000 * CONFIGURE_MICROSECONDS_PER_TICK;
1307
1308  const uint32_t _Watchdog_Ticks_per_second =
1309    1000000 / CONFIGURE_MICROSECONDS_PER_TICK;
1310#endif
1311
1312/** The configures the number of clock ticks per timeslice. */
1313#if defined(CONFIGURE_TICKS_PER_TIMESLICE) && \
1314  CONFIGURE_TICKS_PER_TIMESLICE != WATCHDOG_TICKS_PER_TIMESLICE_DEFAULT
1315
1316#ifdef CONFIGURE_INIT
1317  const uint32_t _Watchdog_Ticks_per_timeslice =
1318    CONFIGURE_TICKS_PER_TIMESLICE;
1319#endif
1320
1321#endif /* CONFIGURE_TICKS_PER_TIMESLICE */
1322
1323/**@}*/ /* end of General Configuration */
1324
1325/*
1326 *  Initial Extension Set
1327 */
1328
1329#ifdef CONFIGURE_INIT
1330#if CONFIGURE_RECORD_PER_PROCESSOR_ITEMS > 0
1331#include <rtems/record.h>
1332#endif
1333#ifdef CONFIGURE_STACK_CHECKER_ENABLED
1334#include <rtems/stackchk.h>
1335#endif
1336
1337#include <rtems/libcsupport.h>
1338
1339#if defined(BSP_INITIAL_EXTENSION) || \
1340    defined(CONFIGURE_INITIAL_EXTENSIONS) || \
1341    defined(CONFIGURE_STACK_CHECKER_ENABLED) || \
1342    (defined(RTEMS_NEWLIB) && !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY))
1343  const User_extensions_Table _User_extensions_Initial_extensions[] = {
1344    #if CONFIGURE_RECORD_PER_PROCESSOR_ITEMS > 0 && \
1345      defined(CONFIGURE_RECORD_EXTENSIONS_ENABLED)
1346      RECORD_EXTENSION,
1347    #endif
1348    #if !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY)
1349      RTEMS_NEWLIB_EXTENSION,
1350    #endif
1351    #if defined(CONFIGURE_STACK_CHECKER_ENABLED)
1352      RTEMS_STACK_CHECKER_EXTENSION,
1353    #endif
1354    #if defined(CONFIGURE_INITIAL_EXTENSIONS)
1355      CONFIGURE_INITIAL_EXTENSIONS,
1356    #endif
1357    #if defined(BSP_INITIAL_EXTENSION)
1358      BSP_INITIAL_EXTENSION
1359    #endif
1360  };
1361
1362  const size_t _User_extensions_Initial_count =
1363    RTEMS_ARRAY_SIZE( _User_extensions_Initial_extensions );
1364
1365  User_extensions_Switch_control _User_extensions_Initial_switch_controls[
1366    RTEMS_ARRAY_SIZE( _User_extensions_Initial_extensions )
1367  ];
1368
1369  RTEMS_SYSINIT_ITEM(
1370    _User_extensions_Handler_initialization,
1371    RTEMS_SYSINIT_INITIAL_EXTENSIONS,
1372    RTEMS_SYSINIT_ORDER_MIDDLE
1373  );
1374#endif
1375
1376#if defined(RTEMS_NEWLIB) && !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY)
1377struct _reent *__getreent(void)
1378{
1379  return _Thread_Get_executing()->libc_reent;
1380}
1381#endif
1382
1383#endif
1384
1385/**
1386 * @defgroup ConfigurationPOSIXAPI POSIX API Configuration Parameters
1387 *
1388 * This module contains the parameters related to configuration
1389 * of the POSIX API services.
1390 */
1391/**@{*/
1392
1393/**
1394 * This configuration parameter specifies the maximum number of
1395 * POSIX API keys.
1396 *
1397 * POSIX Keys are available whether or not the POSIX API is enabled.
1398 */
1399#ifndef CONFIGURE_MAXIMUM_POSIX_KEYS
1400  #define CONFIGURE_MAXIMUM_POSIX_KEYS 0
1401#endif
1402
1403/*
1404 * This macro is calculated to specify the memory required for
1405 * POSIX API key/value pairs.
1406 */
1407#ifndef CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS
1408  #define CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS \
1409    (CONFIGURE_MAXIMUM_POSIX_KEYS * \
1410     (CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_TASKS))
1411#endif
1412
1413/**
1414 * This configuration parameter specifies the maximum number of
1415 * POSIX API threads.
1416 */
1417#ifndef CONFIGURE_MAXIMUM_POSIX_THREADS
1418  #define CONFIGURE_MAXIMUM_POSIX_THREADS 0
1419#endif
1420
1421/*
1422 * Account for the object control structures plus the name
1423 * of the object to be duplicated.
1424 */
1425#define _Configure_POSIX_Named_Object_RAM(_number, _size) \
1426  (rtems_resource_maximum_per_allocation(_number) \
1427    * _Configure_From_workspace(_POSIX_PATH_MAX + 1))
1428
1429/**
1430 * This configuration parameter specifies the maximum number of
1431 * POSIX API message queues.
1432 */
1433#ifndef CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES
1434  #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES 0
1435#endif
1436
1437/*
1438 * This macro is calculated to specify the memory required for
1439 * POSIX API message queues.
1440 */
1441#define _CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES(_message_queues) \
1442  _Configure_POSIX_Named_Object_RAM( \
1443     _message_queues, sizeof(POSIX_Message_queue_Control) )
1444
1445/**
1446 * This configuration parameter specifies the maximum number of
1447 * POSIX API semaphores.
1448 */
1449#ifndef CONFIGURE_MAXIMUM_POSIX_SEMAPHORES
1450  #define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES 0
1451#endif
1452
1453/*
1454 * This macro is calculated to specify the memory required for
1455 * POSIX API semaphores.
1456 */
1457#define _CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES(_semaphores) \
1458  _Configure_POSIX_Named_Object_RAM( \
1459     _semaphores, sizeof(POSIX_Semaphore_Control) )
1460
1461/**
1462 * Configure the maximum number of POSIX shared memory objects.
1463 */
1464#ifndef CONFIGURE_MAXIMUM_POSIX_SHMS
1465  #define CONFIGURE_MAXIMUM_POSIX_SHMS 0
1466#endif
1467
1468/*
1469 * This macro is calculated to specify the memory required for
1470 * POSIX API shared memory.
1471 */
1472#define _CONFIGURE_MEMORY_FOR_POSIX_SHMS(_shms) \
1473  _Configure_POSIX_Named_Object_RAM(_shms, sizeof(POSIX_Shm_Control) )
1474
1475/**
1476 * This configuration parameter specifies the maximum number of
1477 * POSIX API timers.
1478 */
1479#ifndef CONFIGURE_MAXIMUM_POSIX_TIMERS
1480  #define CONFIGURE_MAXIMUM_POSIX_TIMERS 0
1481#endif
1482
1483#if !defined(RTEMS_POSIX_API) && CONFIGURE_MAXIMUM_POSIX_TIMERS != 0
1484  #error "CONFIGURE_MAXIMUM_POSIX_TIMERS must be zero if POSIX API is disabled"
1485#endif
1486
1487/**
1488 * This configuration parameter specifies the maximum number of
1489 * POSIX API queued signals.
1490 */
1491#ifndef CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS
1492  #define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS 0
1493#endif
1494
1495#if !defined(RTEMS_POSIX_API) && CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS != 0
1496  #error "CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS must be zero if POSIX API is disabled"
1497#endif
1498
1499#if CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS > 0
1500  #define _CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS \
1501    _Configure_From_workspace( (CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS) * \
1502      sizeof( POSIX_signals_Siginfo_node ) )
1503#else
1504  #define _CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS 0
1505#endif
1506
1507#ifdef CONFIGURE_POSIX_INIT_THREAD_TABLE
1508  #ifndef CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT
1509    #define CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT   POSIX_Init
1510  #endif
1511
1512  #ifndef CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE
1513    #define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE \
1514      CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE
1515  #endif
1516#endif /* CONFIGURE_POSIX_INIT_THREAD_TABLE */
1517
1518/**
1519 * This configuration parameter specifies the stack size of the
1520 * POSIX API Initialization thread (if used).
1521 */
1522#ifndef CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE
1523  #define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE    0
1524#endif
1525/**@}*/  /* end of POSIX API Configuration */
1526
1527/**
1528 * This is so we can account for tasks with stacks greater than minimum
1529 * size.  This is in bytes.
1530 */
1531#ifndef CONFIGURE_EXTRA_TASK_STACKS
1532  #define CONFIGURE_EXTRA_TASK_STACKS 0
1533#endif
1534
1535/*
1536 * We must be able to split the free block used for the second last allocation
1537 * into two parts so that we have a free block for the last allocation.  See
1538 * _Heap_Block_split().
1539 */
1540#define _CONFIGURE_HEAP_HANDLER_OVERHEAD \
1541  _Configure_Align_up( HEAP_BLOCK_HEADER_SIZE, CPU_HEAP_ALIGNMENT )
1542
1543/*
1544 *  Calculate the RAM size based on the maximum number of objects configured.
1545 */
1546#ifndef CONFIGURE_EXECUTIVE_RAM_SIZE
1547
1548/**
1549 * The following macro is used to calculate the memory allocated by RTEMS
1550 * for the message buffers associated with a particular message queue.
1551 * There is a fixed amount of overhead per message.
1552 */
1553#define CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(_messages, _size) \
1554    _Configure_From_workspace( \
1555      (_messages) * (_Configure_Align_up(_size, sizeof(uintptr_t)) \
1556        + sizeof(CORE_message_queue_Buffer_control)))
1557
1558/*
1559 * This macro is set to the amount of memory required for pending message
1560 * buffers in bytes.  It should be constructed by adding together a
1561 * set of values determined by CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE.
1562 */
1563#ifndef CONFIGURE_MESSAGE_BUFFER_MEMORY
1564  #define CONFIGURE_MESSAGE_BUFFER_MEMORY 0
1565#endif
1566
1567/**
1568 * This macro is available just in case the confdefs.h file underallocates
1569 * memory for a particular application.  This lets the user add some extra
1570 * memory in case something broken and underestimates.
1571 *
1572 * It is also possible for cases where confdefs.h overallocates memory,
1573 * you could substract memory from the allocated.  The estimate is just
1574 * that, an estimate, and assumes worst case alignment and padding on
1575 * each allocated element.  So in some cases it could be too conservative.
1576 *
1577 * NOTE: Historically this was used for message buffers.
1578 */
1579#ifndef CONFIGURE_MEMORY_OVERHEAD
1580  #define CONFIGURE_MEMORY_OVERHEAD 0
1581#endif
1582
1583/**
1584 * This calculates the memory required for the executive workspace.
1585 *
1586 * This is an internal parameter.
1587 */
1588#define CONFIGURE_EXECUTIVE_RAM_SIZE \
1589( \
1590   _CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES( \
1591     CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES) + \
1592   _CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES( \
1593     CONFIGURE_MAXIMUM_POSIX_SEMAPHORES) + \
1594   _CONFIGURE_MEMORY_FOR_POSIX_SHMS( \
1595     CONFIGURE_MAXIMUM_POSIX_SHMS) + \
1596   _CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS + \
1597   CONFIGURE_MESSAGE_BUFFER_MEMORY + \
1598   (CONFIGURE_MEMORY_OVERHEAD * 1024) + \
1599   _CONFIGURE_HEAP_HANDLER_OVERHEAD \
1600)
1601
1602/*
1603 *  Now account for any extra memory that initialization tasks or threads
1604 *  may have requested.
1605 */
1606
1607/*
1608 * This accounts for any extra memory required by the Classic API
1609 * Initialization Task.
1610 */
1611#if (CONFIGURE_INIT_TASK_STACK_SIZE > CONFIGURE_MINIMUM_TASK_STACK_SIZE)
1612  #define _CONFIGURE_INITIALIZATION_THREADS_STACKS_CLASSIC_PART \
1613      (CONFIGURE_INIT_TASK_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE)
1614#else
1615  #define _CONFIGURE_INITIALIZATION_THREADS_STACKS_CLASSIC_PART 0
1616#endif
1617
1618/*
1619 * This accounts for any extra memory required by the POSIX API
1620 * Initialization Thread.
1621 */
1622#if (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE > \
1623      CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE)
1624  #define _CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART \
1625    (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE - \
1626      CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE)
1627#else
1628  #define _CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART 0
1629#endif
1630
1631/*
1632 * This macro provides a summation of the various initialization task
1633 * and thread stack requirements.
1634 */
1635#define _CONFIGURE_INITIALIZATION_THREADS_EXTRA_STACKS \
1636    (_CONFIGURE_INITIALIZATION_THREADS_STACKS_CLASSIC_PART + \
1637    _CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART)
1638
1639/*
1640 * This macro is calculated to specify the memory required for
1641 * the stacks of all tasks.
1642 */
1643#define _CONFIGURE_TASKS_STACK \
1644  (rtems_resource_maximum_per_allocation( _CONFIGURE_TASKS ) * \
1645    _Configure_From_stackspace( CONFIGURE_MINIMUM_TASK_STACK_SIZE ) )
1646
1647/*
1648 * This macro is calculated to specify the memory required for
1649 * the stacks of all POSIX threads.
1650 */
1651#define _CONFIGURE_POSIX_THREADS_STACK \
1652  (rtems_resource_maximum_per_allocation( CONFIGURE_MAXIMUM_POSIX_THREADS ) * \
1653    _Configure_From_stackspace( CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE ) )
1654
1655#else /* CONFIGURE_EXECUTIVE_RAM_SIZE */
1656
1657#define _CONFIGURE_INITIALIZATION_THREADS_EXTRA_STACKS 0
1658#define _CONFIGURE_TASKS_STACK 0
1659#define _CONFIGURE_POSIX_THREADS_STACK 0
1660
1661#if CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK != 0
1662  #error "CONFIGURE_EXECUTIVE_RAM_SIZE defined with request for CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK"
1663#endif
1664
1665#if CONFIGURE_EXTRA_TASK_STACKS != 0
1666  #error "CONFIGURE_EXECUTIVE_RAM_SIZE defined with request for CONFIGURE_EXTRA_TASK_STACKS"
1667#endif
1668
1669#endif /* CONFIGURE_EXECUTIVE_RAM_SIZE */
1670
1671/*
1672 * This macro is calculated to specify the memory required for
1673 * all tasks and threads of all varieties.
1674 */
1675#define _CONFIGURE_STACK_SPACE_SIZE \
1676  ( \
1677    _CONFIGURE_INITIALIZATION_THREADS_EXTRA_STACKS + \
1678    _CONFIGURE_TASKS_STACK + \
1679    _CONFIGURE_POSIX_THREADS_STACK + \
1680    _CONFIGURE_LIBBLOCK_TASK_EXTRA_STACKS + \
1681    CONFIGURE_EXTRA_TASK_STACKS + \
1682    _CONFIGURE_HEAP_HANDLER_OVERHEAD \
1683  )
1684
1685#ifndef CONFIGURE_MAXIMUM_THREAD_NAME_SIZE
1686  #define CONFIGURE_MAXIMUM_THREAD_NAME_SIZE THREAD_DEFAULT_MAXIMUM_NAME_SIZE
1687#endif
1688
1689#ifdef CONFIGURE_INIT
1690  typedef union {
1691    Scheduler_Node Base;
1692    #ifdef CONFIGURE_SCHEDULER_CBS
1693      Scheduler_CBS_Node CBS;
1694    #endif
1695    #ifdef CONFIGURE_SCHEDULER_EDF
1696      Scheduler_EDF_Node EDF;
1697    #endif
1698    #ifdef CONFIGURE_SCHEDULER_EDF_SMP
1699      Scheduler_EDF_SMP_Node EDF_SMP;
1700    #endif
1701    #ifdef CONFIGURE_SCHEDULER_PRIORITY
1702      Scheduler_priority_Node Priority;
1703    #endif
1704    #ifdef CONFIGURE_SCHEDULER_SIMPLE_SMP
1705      Scheduler_SMP_Node Simple_SMP;
1706    #endif
1707    #ifdef CONFIGURE_SCHEDULER_PRIORITY_SMP
1708      Scheduler_priority_SMP_Node Priority_SMP;
1709    #endif
1710    #ifdef CONFIGURE_SCHEDULER_PRIORITY_AFFINITY_SMP
1711      Scheduler_priority_affinity_SMP_Node Priority_affinity_SMP;
1712    #endif
1713    #ifdef CONFIGURE_SCHEDULER_STRONG_APA
1714      Scheduler_strong_APA_Node Strong_APA;
1715    #endif
1716    #ifdef CONFIGURE_SCHEDULER_USER_PER_THREAD
1717      CONFIGURE_SCHEDULER_USER_PER_THREAD User;
1718    #endif
1719  } Configuration_Scheduler_node;
1720
1721  #ifdef RTEMS_SMP
1722    const size_t _Scheduler_Node_size = sizeof( Configuration_Scheduler_node );
1723  #endif
1724
1725  const size_t _Thread_Maximum_name_size = CONFIGURE_MAXIMUM_THREAD_NAME_SIZE;
1726
1727  struct Thread_Configured_control {
1728    Thread_Control Control;
1729    #if CONFIGURE_MAXIMUM_USER_EXTENSIONS > 0
1730      void *extensions[ CONFIGURE_MAXIMUM_USER_EXTENSIONS + 1 ];
1731    #endif
1732    Configuration_Scheduler_node Scheduler_nodes[ _CONFIGURE_SCHEDULER_COUNT ];
1733    RTEMS_API_Control API_RTEMS;
1734    #ifdef RTEMS_POSIX_API
1735      POSIX_API_Control API_POSIX;
1736    #endif
1737    #if CONFIGURE_MAXIMUM_THREAD_NAME_SIZE > 1
1738      char name[ CONFIGURE_MAXIMUM_THREAD_NAME_SIZE ];
1739    #endif
1740    #if !defined(RTEMS_SCHEDSIM) \
1741      && defined(RTEMS_NEWLIB) \
1742      && !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY)
1743      struct _reent Newlib;
1744    #else
1745      struct { /* Empty */ } Newlib;
1746    #endif
1747  };
1748
1749  const Thread_Control_add_on _Thread_Control_add_ons[] = {
1750    {
1751      offsetof( Thread_Configured_control, Control.Scheduler.nodes ),
1752      offsetof( Thread_Configured_control, Scheduler_nodes )
1753    }, {
1754      offsetof(
1755        Thread_Configured_control,
1756        Control.API_Extensions[ THREAD_API_RTEMS ]
1757      ),
1758      offsetof( Thread_Configured_control, API_RTEMS )
1759    }, {
1760      offsetof(
1761        Thread_Configured_control,
1762        Control.libc_reent
1763      ),
1764      offsetof( Thread_Configured_control, Newlib )
1765    }
1766    #if CONFIGURE_MAXIMUM_THREAD_NAME_SIZE > 1
1767      , {
1768        offsetof(
1769          Thread_Configured_control,
1770          Control.Join_queue.Queue.name
1771        ),
1772        offsetof( Thread_Configured_control, name )
1773      }
1774    #endif
1775    #ifdef RTEMS_POSIX_API
1776      , {
1777        offsetof(
1778          Thread_Configured_control,
1779          Control.API_Extensions[ THREAD_API_POSIX ]
1780        ),
1781        offsetof( Thread_Configured_control, API_POSIX )
1782      }
1783    #endif
1784  };
1785
1786  const size_t _Thread_Control_add_on_count =
1787    RTEMS_ARRAY_SIZE( _Thread_Control_add_ons );
1788
1789  #if defined(RTEMS_SMP)
1790    struct Thread_queue_Configured_heads {
1791      Thread_queue_Heads Heads;
1792        Thread_queue_Priority_queue Priority[ _CONFIGURE_SCHEDULER_COUNT ];
1793    };
1794
1795    const size_t _Thread_queue_Heads_size =
1796      sizeof( Thread_queue_Configured_heads );
1797  #endif
1798
1799  const size_t _Thread_Initial_thread_count =
1800    rtems_resource_maximum_per_allocation( _CONFIGURE_TASKS ) +
1801    rtems_resource_maximum_per_allocation( CONFIGURE_MAXIMUM_POSIX_THREADS );
1802
1803  THREAD_INFORMATION_DEFINE(
1804    _Thread,
1805    OBJECTS_INTERNAL_API,
1806    OBJECTS_INTERNAL_THREADS,
1807    _CONFIGURE_MAXIMUM_PROCESSORS + _CONFIGURE_MPCI_RECEIVE_SERVER_COUNT
1808  );
1809
1810  #if CONFIGURE_MAXIMUM_BARRIERS > 0
1811    BARRIER_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_BARRIERS );
1812  #endif
1813
1814  #if CONFIGURE_MAXIMUM_MESSAGE_QUEUES > 0
1815    MESSAGE_QUEUE_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_MESSAGE_QUEUES );
1816  #endif
1817
1818  #if CONFIGURE_MAXIMUM_PARTITIONS > 0
1819    PARTITION_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_PARTITIONS );
1820  #endif
1821
1822  #if CONFIGURE_MAXIMUM_PERIODS > 0
1823    RATE_MONOTONIC_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_PERIODS );
1824  #endif
1825
1826  #if CONFIGURE_MAXIMUM_PORTS > 0
1827    DUAL_PORTED_MEMORY_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_PORTS );
1828  #endif
1829
1830  #if CONFIGURE_MAXIMUM_REGIONS > 0
1831    REGION_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_REGIONS );
1832  #endif
1833
1834  #if CONFIGURE_MAXIMUM_SEMAPHORES > 0
1835    SEMAPHORE_INFORMATION_DEFINE(
1836      CONFIGURE_MAXIMUM_SEMAPHORES,
1837      _CONFIGURE_SCHEDULER_COUNT
1838    );
1839  #endif
1840
1841  #if CONFIGURE_MAXIMUM_TIMERS > 0
1842    TIMER_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_TIMERS );
1843  #endif
1844
1845  #if _CONFIGURE_TASKS > 0
1846    THREAD_INFORMATION_DEFINE(
1847      _RTEMS_tasks,
1848      OBJECTS_CLASSIC_API,
1849      OBJECTS_RTEMS_TASKS,
1850      _CONFIGURE_TASKS
1851    );
1852  #endif
1853
1854  #if CONFIGURE_MAXIMUM_USER_EXTENSIONS > 0
1855    EXTENSION_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_USER_EXTENSIONS );
1856  #endif
1857
1858  #if CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS > 0
1859    POSIX_Keys_Key_value_pair _POSIX_Keys_Key_value_pairs[
1860      rtems_resource_maximum_per_allocation(
1861        CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS
1862      )
1863    ];
1864
1865    const uint32_t _POSIX_Keys_Key_value_pair_maximum =
1866      CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS;
1867  #endif
1868
1869  #if CONFIGURE_MAXIMUM_POSIX_KEYS > 0
1870    POSIX_KEYS_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_POSIX_KEYS );
1871  #endif
1872
1873  #if CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES > 0
1874    POSIX_MESSAGE_QUEUE_INFORMATION_DEFINE(
1875      CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES
1876    );
1877  #endif
1878
1879  #if CONFIGURE_MAXIMUM_POSIX_SEMAPHORES > 0
1880    POSIX_SEMAPHORE_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_POSIX_SEMAPHORES );
1881  #endif
1882
1883  #if CONFIGURE_MAXIMUM_POSIX_SHMS > 0
1884    POSIX_SHM_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_POSIX_SHMS );
1885  #endif
1886
1887  #if CONFIGURE_MAXIMUM_POSIX_THREADS > 0
1888    THREAD_INFORMATION_DEFINE(
1889      _POSIX_Threads,
1890      OBJECTS_POSIX_API,
1891      OBJECTS_POSIX_THREADS,
1892      CONFIGURE_MAXIMUM_POSIX_THREADS
1893    );
1894  #endif
1895
1896  #ifdef RTEMS_POSIX_API
1897    #if CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS > 0
1898      const uint32_t _POSIX_signals_Maximum_queued_signals =
1899        CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS;
1900
1901      POSIX_signals_Siginfo_node _POSIX_signals_Siginfo_nodes[
1902        CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS
1903      ];
1904    #endif
1905
1906    #if CONFIGURE_MAXIMUM_POSIX_TIMERS > 0
1907      POSIX_TIMER_INFORMATION_DEFINE( CONFIGURE_MAXIMUM_POSIX_TIMERS );
1908    #endif
1909  #endif
1910
1911  const size_t _POSIX_Threads_Minimum_stack_size =
1912    CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE;
1913
1914  /**
1915   * This variable specifies the minimum stack size for tasks in an RTEMS
1916   * application.
1917   *
1918   * NOTE: This is left as a simple uint32_t so it can be externed as
1919   *       needed without requring being high enough logical to
1920   *       include the full configuration table.
1921   */
1922  uint32_t rtems_minimum_stack_size =
1923    CONFIGURE_MINIMUM_TASK_STACK_SIZE;
1924
1925  const uintptr_t _Stack_Space_size = _CONFIGURE_STACK_SPACE_SIZE;
1926
1927  #if defined(CONFIGURE_TASK_STACK_ALLOCATOR) \
1928    && defined(CONFIGURE_TASK_STACK_DEALLOCATOR)
1929    #ifdef CONFIGURE_TASK_STACK_ALLOCATOR_AVOIDS_WORK_SPACE
1930      const bool _Stack_Allocator_avoids_workspace = true;
1931    #else
1932      const bool _Stack_Allocator_avoids_workspace = false;
1933    #endif
1934
1935    #ifdef CONFIGURE_TASK_STACK_ALLOCATOR_INIT
1936      const Stack_Allocator_initialize _Stack_Allocator_initialize =
1937        CONFIGURE_TASK_STACK_ALLOCATOR_INIT;
1938    #else
1939      const Stack_Allocator_initialize _Stack_Allocator_initialize = NULL;
1940    #endif
1941
1942    const Stack_Allocator_allocate _Stack_Allocator_allocate =
1943      CONFIGURE_TASK_STACK_ALLOCATOR;
1944
1945    const Stack_Allocator_free _Stack_Allocator_free =
1946      CONFIGURE_TASK_STACK_DEALLOCATOR;
1947  #elif defined(CONFIGURE_TASK_STACK_ALLOCATOR) \
1948    || defined(CONFIGURE_TASK_STACK_DEALLOCATOR)
1949    #error "CONFIGURE_TASK_STACK_ALLOCATOR and CONFIGURE_TASK_STACK_DEALLOCATOR must be both defined or both undefined"
1950  #endif
1951
1952  const uintptr_t _Workspace_Size = CONFIGURE_EXECUTIVE_RAM_SIZE;
1953
1954  #ifdef CONFIGURE_UNIFIED_WORK_AREAS
1955    const bool _Workspace_Is_unified = true;
1956  #endif
1957
1958  #ifdef CONFIGURE_DIRTY_MEMORY
1959    RTEMS_SYSINIT_ITEM(
1960      _Memory_Dirty_free_areas,
1961      RTEMS_SYSINIT_DIRTY_MEMORY,
1962      RTEMS_SYSINIT_ORDER_MIDDLE
1963    );
1964  #endif
1965
1966  #ifdef CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY
1967    const bool _Memory_Zero_before_use = true;
1968
1969    RTEMS_SYSINIT_ITEM(
1970      _Memory_Zero_free_areas,
1971      RTEMS_SYSINIT_ZERO_MEMORY,
1972      RTEMS_SYSINIT_ORDER_MIDDLE
1973    );
1974  #endif
1975
1976  #if CONFIGURE_RECORD_PER_PROCESSOR_ITEMS > 0
1977    #if (CONFIGURE_RECORD_PER_PROCESSOR_ITEMS & (CONFIGURE_RECORD_PER_PROCESSOR_ITEMS - 1)) != 0
1978      #error "CONFIGURE_RECORD_PER_PROCESSOR_ITEMS must be a power of two"
1979    #endif
1980
1981    #if CONFIGURE_RECORD_PER_PROCESSOR_ITEMS < 16
1982      #error "CONFIGURE_RECORD_PER_PROCESSOR_ITEMS must be at least 16"
1983    #endif
1984
1985    typedef struct {
1986      Record_Control    Control;
1987      rtems_record_item Items[ CONFIGURE_RECORD_PER_PROCESSOR_ITEMS ];
1988    } Record_Configured_control;
1989
1990    static Record_Configured_control _Record_Controls[ _CONFIGURE_MAXIMUM_PROCESSORS ];
1991
1992    const Record_Configuration _Record_Configuration = {
1993      CONFIGURE_RECORD_PER_PROCESSOR_ITEMS,
1994      &_Record_Controls[ 0 ].Control
1995    };
1996
1997    RTEMS_SYSINIT_ITEM(
1998      _Record_Initialize,
1999      RTEMS_SYSINIT_RECORD,
2000      RTEMS_SYSINIT_ORDER_MIDDLE
2001    );
2002  #endif
2003
2004  #ifdef CONFIGURE_VERBOSE_SYSTEM_INITIALIZATION
2005    RTEMS_SYSINIT_ITEM(
2006      _Sysinit_Verbose,
2007      RTEMS_SYSINIT_RECORD,
2008      RTEMS_SYSINIT_ORDER_LAST
2009    );
2010  #endif
2011#endif
2012
2013/*
2014 *  If the user has configured a set of Classic API Initialization Tasks,
2015 *  then we need to install the code that runs that loop.
2016 */
2017#ifdef CONFIGURE_INIT
2018  #if defined(CONFIGURE_RTEMS_INIT_TASKS_TABLE)
2019    const rtems_initialization_tasks_table _RTEMS_tasks_User_task_table = {
2020      CONFIGURE_INIT_TASK_NAME,
2021      CONFIGURE_INIT_TASK_STACK_SIZE,
2022      CONFIGURE_INIT_TASK_PRIORITY,
2023      CONFIGURE_INIT_TASK_ATTRIBUTES,
2024      CONFIGURE_INIT_TASK_ENTRY_POINT,
2025      CONFIGURE_INIT_TASK_INITIAL_MODES,
2026      CONFIGURE_INIT_TASK_ARGUMENTS
2027    };
2028
2029    RTEMS_SYSINIT_ITEM(
2030      _RTEMS_tasks_Initialize_user_task,
2031      RTEMS_SYSINIT_CLASSIC_USER_TASKS,
2032      RTEMS_SYSINIT_ORDER_MIDDLE
2033    );
2034  #endif
2035#endif
2036
2037/*
2038 *  If the user has configured a set of POSIX Initialization Threads,
2039 *  then we need to install the code that runs that loop.
2040 */
2041#ifdef CONFIGURE_INIT
2042  #if defined(CONFIGURE_POSIX_INIT_THREAD_TABLE)
2043    const posix_initialization_threads_table _POSIX_Threads_User_thread_table = {
2044      CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT,
2045      CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE
2046    };
2047
2048    RTEMS_SYSINIT_ITEM(
2049      _POSIX_Threads_Initialize_user_thread,
2050      RTEMS_SYSINIT_POSIX_USER_THREADS,
2051      RTEMS_SYSINIT_ORDER_MIDDLE
2052    );
2053  #endif
2054#endif
2055
2056#ifdef __cplusplus
2057}
2058#endif
2059
2060/******************************************************************
2061 ******************************************************************
2062 ******************************************************************
2063 *         CONFIGURATION WARNINGS AND ERROR CHECKING              *
2064 ******************************************************************
2065 ******************************************************************
2066 ******************************************************************
2067 */
2068
2069/*
2070 *  Make sure a task/thread of some sort is configured.
2071 *
2072 *  When analyzing RTEMS to find the smallest possible of memory
2073 *  that must be allocated, you probably do want to configure 0
2074 *  tasks/threads so there is a smaller set of calls to _Workspace_Allocate
2075 *  to analyze.
2076 */
2077#if !defined(CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION) \
2078  && CONFIGURE_MAXIMUM_TASKS == 0 \
2079  && CONFIGURE_MAXIMUM_POSIX_THREADS == 0
2080  #error "CONFIGURATION ERROR: No tasks or threads configured!!"
2081#endif
2082
2083#ifndef RTEMS_SCHEDSIM
2084/*
2085 *  Make sure at least one of the initialization task/thread
2086 *  tables was defined.
2087 */
2088#if !defined(CONFIGURE_RTEMS_INIT_TASKS_TABLE) && \
2089    !defined(CONFIGURE_POSIX_INIT_THREAD_TABLE) && \
2090    !defined(CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION)
2091#error "CONFIGURATION ERROR: No initialization tasks or threads configured!!"
2092#endif
2093#endif
2094
2095/*
2096 *  If the user is trying to configure a multiprocessing application and
2097 *  RTEMS was not configured and built multiprocessing, then error out.
2098 */
2099#if defined(CONFIGURE_MP_APPLICATION) && \
2100    !defined(RTEMS_MULTIPROCESSING)
2101#error "CONFIGURATION ERROR: RTEMS not configured for multiprocessing!!"
2102#endif
2103
2104#if !defined(RTEMS_SCHEDSIM)
2105/*
2106 *  You must either explicitly include or exclude the clock driver.
2107 *  It is such a common newbie error to leave it out.  Maybe this
2108 *  will put an end to it.
2109 *
2110 *  NOTE: If you are using the timer driver, it is considered
2111 *        mutually exclusive with the clock driver because the
2112 *        drivers are assumed to use the same "timer" hardware
2113 *        on many boards.
2114 */
2115#if !defined(CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER) && \
2116    !defined(CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER) && \
2117    !defined(CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER)
2118  #error "CONFIGURATION ERROR: Do you want the clock driver or not?!?"
2119 #endif
2120
2121/*
2122 * Only one of the following three configuration parameters should be
2123 * defined at a time.
2124 */
2125#if ((defined(CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER) + \
2126      defined(CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER) + \
2127      defined(CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER)) > 1)
2128   #error "CONFIGURATION ERROR: More than one clock/timer driver configuration parameter specified?!?"
2129#endif
2130#endif   /* !defined(RTEMS_SCHEDSIM) */
2131
2132/*
2133 *  Validate the configured maximum priority
2134 */
2135#if ((CONFIGURE_MAXIMUM_PRIORITY != 3) && \
2136     (CONFIGURE_MAXIMUM_PRIORITY != 7) && \
2137     (CONFIGURE_MAXIMUM_PRIORITY != 15) && \
2138     (CONFIGURE_MAXIMUM_PRIORITY != 31) && \
2139     (CONFIGURE_MAXIMUM_PRIORITY != 63) && \
2140     (CONFIGURE_MAXIMUM_PRIORITY != 127) && \
2141     (CONFIGURE_MAXIMUM_PRIORITY != 255))
2142  #error "Maximum priority is not 1 less than a power of 2 between 4 and 256"
2143#endif
2144
2145#if (CONFIGURE_MAXIMUM_PRIORITY > PRIORITY_DEFAULT_MAXIMUM)
2146  #error "Maximum priority configured higher than supported by target."
2147#endif
2148
2149/*
2150 * POSIX Key pair shouldn't be less than POSIX Key, which is highly
2151 * likely to be error.
2152 */
2153#if (CONFIGURE_MAXIMUM_POSIX_KEYS != 0) && \
2154    (CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS != 0)
2155  #if (CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS < CONFIGURE_MAXIMUM_POSIX_KEYS)
2156    #error "Fewer POSIX Key pairs than POSIX Key!"
2157  #endif
2158#endif
2159
2160#endif
2161/* end of include file */
Note: See TracBrowser for help on using the repository browser.