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

4.104.114.95
Last change on this file since f2a776ac was f2a776ac, checked in by Joel Sherrill <joel.sherrill@…>, on 06/17/08 at 18:52:30

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

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