source: rtems/cpukit/sapi/include/confdefs.h @ 913ede4f

4.104.114.95
Last change on this file since 913ede4f was 913ede4f, checked in by Joel Sherrill <joel.sherrill@…>, on 09/05/08 at 16:42:47

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

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