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

4.104.115
Last change on this file since d40da79b was d40da79b, checked in by Joel Sherrill <joel.sherrill@…>, on 09/17/08 at 16:12:04

2008-09-17 Miao Yan <yanmiaobest@…>

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