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

4.104.115
Last change on this file since 4c0d483b was 4c0d483b, checked in by Joel Sherrill <joel.sherrill@…>, on 12/01/08 at 23:28:53

2008-12-01 Joel Sherrill <joel.sherrill@…>

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