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

4.104.115
Last change on this file since bd5984de was bd5984de, checked in by Joel Sherrill <joel.sherrill@…>, on 09/17/08 at 18:37:55

2008-09-17 Joel Sherrill <joel.sherrill@…>

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