source: rtems/cpukit/sapi/include/confdefs.h @ 4afd6f4

4.104.115
Last change on this file since 4afd6f4 was 4afd6f4, checked in by Joel Sherrill <joel.sherrill@…>, on 09/17/08 at 19:30:36

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

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