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

4.104.115
Last change on this file since ade17392 was ade17392, checked in by Joel Sherrill <joel.sherrill@…>, on 08/05/09 at 15:29:19

2009-08-05 Joel Sherrill <joel.sherrill@…>

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