source: rtems/cpukit/sapi/include/confdefs.h @ 805cddc

4.104.114.9
Last change on this file since 805cddc was 805cddc, checked in by Chris Johns <chrisj@…>, on Jun 16, 2008 at 11:37:42 PM

hris Johns <chrisj@…>

  • cpukit/sapi/include/confdefs.h: Add missing quote to string to remove warning.
  • cpukit/score/cpu/m68k/rtems/score/m68k.h: Add the default priority level for large memory Coldfires.
  • Property mode set to 100644
File size: 57.7 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 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))
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  #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
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
252/**
253 *  @brief Idle task stack size configuration
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
262    #define CONFIGURE_IDLE_TASK_STACK_SIZE CONFIGURE_MINIMUM_TASK_STACK_SIZE
263  #endif
264#endif
265
266/**
267 *  @brief Interrupt stack size configuration
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
276    #define CONFIGURE_INTERRUPT_STACK_SIZE CONFIGURE_MINIMUM_TASK_STACK_SIZE
277  #endif
278#endif
279
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.
286 */
287#if (CPU_ALLOCATE_INTERRUPT_STACK == 0)
288  #define CONFIGURE_INTERRUPT_STACK_MEMORY 0
289#else
290  #define CONFIGURE_INTERRUPT_STACK_MEMORY CONFIGURE_INTERRUPT_STACK_SIZE
291#endif
292
293/**
294 *  Configure the very much optional task stack allocator
295 */
296#ifndef CONFIGURE_TASK_STACK_ALLOCATOR
297  #define CONFIGURE_TASK_STACK_ALLOCATOR NULL
298#endif
299
300/**
301 *  Configure the very much optional task stack deallocator
302 */
303#ifndef CONFIGURE_TASK_STACK_DEALLOCATOR
304  #define CONFIGURE_TASK_STACK_DEALLOCATOR NULL
305#endif
306
307/**
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
320/*
321 *  RTEMS Malloc configuration
322 */
323
324#include <rtems/malloc.h>
325
326#ifdef CONFIGURE_INIT
327  /**
328   *  This configures the malloc family statistics to be available.
329   *  By default only function call counts are kept.
330   */
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
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   */
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
354#ifdef CONFIGURE_INIT
355  /**
356   *  This configures the malloc family plugin which dirties memory
357   *  allocated.  This is helpful for finding unitialized data structure
358   *  problems.
359   */
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
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
392/*
393 *  Default User Initialization Task Table.  This table guarantees that
394 *  one user initialization table is defined.
395 */
396
397#ifdef CONFIGURE_RTEMS_INIT_TASKS_TABLE
398
399#ifdef CONFIGURE_HAS_OWN_INIT_TASK_TABLE
400
401/*
402 *  The user is defining their own table information and setting the
403 *  appropriate variables.
404 */
405
406#else
407
408#ifndef CONFIGURE_INIT_TASK_NAME
409  #define CONFIGURE_INIT_TASK_NAME          rtems_build_name('U', 'I', '1', ' ')
410#endif
411
412#ifndef CONFIGURE_INIT_TASK_STACK_SIZE
413  #define CONFIGURE_INIT_TASK_STACK_SIZE    CONFIGURE_MINIMUM_TASK_STACK_SIZE
414#endif
415
416#ifndef CONFIGURE_INIT_TASK_PRIORITY
417  #define CONFIGURE_INIT_TASK_PRIORITY      1
418#endif
419
420#ifndef CONFIGURE_INIT_TASK_ATTRIBUTES
421  #define CONFIGURE_INIT_TASK_ATTRIBUTES    RTEMS_DEFAULT_ATTRIBUTES
422#endif
423
424#ifndef CONFIGURE_INIT_TASK_ENTRY_POINT
425  #define CONFIGURE_INIT_TASK_ENTRY_POINT   Init
426#endif
427
428#ifndef CONFIGURE_INIT_TASK_INITIAL_MODES
429  #define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_NO_PREEMPT
430#endif
431
432#ifndef CONFIGURE_INIT_TASK_ARGUMENTS
433  #define CONFIGURE_INIT_TASK_ARGUMENTS     0
434#endif
435
436#ifdef CONFIGURE_INIT
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  };
447#endif
448
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
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
460#define CONFIGURE_INIT_TASK_STACK_SIZE 0
461
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
472#ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
473  #include <rtems/console.h>
474#endif
475
476#ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
477  #include <rtems/clockdrv.h>
478#endif
479
480#ifdef CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
481  #include <rtems/timerdrv.h>
482#endif
483
484#ifdef CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER
485  #include <rtems/rtc.h>
486#endif
487
488#ifdef CONFIGURE_APPLICATION_NEEDS_WATCHDOG_DRIVER
489  #include <rtems/watchdogdrv.h>
490#endif
491
492#ifdef CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER
493  #include <rtems/devnull.h>
494#endif
495
496#ifdef CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER
497  /* the ide driver needs the ATA driver */
498  #ifndef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
499    #define CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
500  #endif
501  #include <libchip/ide_ctrl.h>
502#endif
503
504#ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
505  #include <libchip/ata.h>
506#endif
507
508#ifndef CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE
509
510#ifdef CONFIGURE_INIT
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  };
548#endif
549
550#endif  /* CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE */
551
552/*
553 *  Default the number of drivers per node.  This value may be
554 *  overridden by the user.
555 */
556
557#define CONFIGURE_NUMBER_OF_DRIVERS \
558  ((sizeof(Device_drivers) / sizeof(rtems_driver_address_table)))
559
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 */
565#ifndef CONFIGURE_MAXIMUM_DRIVERS
566  #define CONFIGURE_MAXIMUM_DRIVERS CONFIGURE_NUMBER_OF_DRIVERS
567#endif
568
569/**
570 *  Default the number of devices per device driver.  This value may be
571 *  overridden by the user.
572 *
573 *  @note This configuration parameter is obsolete. Thus we will warn the
574 *        user that it is obsolete.
575 */
576#ifdef CONFIGURE_MAXIMUM_DEVICES
577  #warning "CONFIGURE_MAXIMUM_DEVICES is obsolete.  Do not use any longer."
578#endif
579
580#ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
581  /*
582   * configure the priority of the ATA driver task
583   */
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 */
591#endif
592
593/*
594 * add bdbuf configuration and values for swapout task priority
595 */
596#ifdef CONFIGURE_APPLICATION_NEEDS_LIBBLOCK
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        */
623#endif /* CONFIGURE_APPLICATION_NEEDS_LIBBLOCK */
624
625#if defined(RTEMS_MULTIPROCESSING)
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   */
631
632  #ifdef CONFIGURE_MP_APPLICATION
633    #ifndef CONFIGURE_HAS_OWN_MULTIPROCESSING_TABLE
634
635      #ifndef CONFIGURE_MP_NODE_NUMBER
636        #define CONFIGURE_MP_NODE_NUMBER                NODE_NUMBER
637      #endif
638
639      #ifndef CONFIGURE_MP_MAXIMUM_NODES
640        #define CONFIGURE_MP_MAXIMUM_NODES              2
641      #endif
642
643      #ifndef CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS
644        #define CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS     32
645      #endif
646
647      #ifndef CONFIGURE_MP_MAXIMUM_PROXIES
648        #define CONFIGURE_MP_MAXIMUM_PROXIES            32
649      #endif
650
651      #ifndef CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK
652        #define CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK 0
653      #endif
654
655      #ifndef CONFIGURE_MP_MPCI_TABLE_POINTER
656        #include <mpci.h>
657        #define CONFIGURE_MP_MPCI_TABLE_POINTER         &MPCI_table
658      #endif
659
660      #ifdef CONFIGURE_INIT
661        rtems_multiprocessing_table Multiprocessing_configuration = {
662          CONFIGURE_MP_NODE_NUMBER,               /* local node number */
663          CONFIGURE_MP_MAXIMUM_NODES,             /* maximum # nodes */
664          CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS,    /* maximum # global objects */
665          CONFIGURE_MP_MAXIMUM_PROXIES,           /* maximum # proxies */
666          CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK, /* MPCI stack > minimum */
667          CONFIGURE_MP_MPCI_TABLE_POINTER         /* ptr to MPCI config table */
668        };
669      #endif
670
671      #define CONFIGURE_MULTIPROCESSING_TABLE    &Multiprocessing_configuration
672
673    #endif /* CONFIGURE_HAS_OWN_MULTIPROCESSING_TABLE */
674
675  #else
676
677    #define CONFIGURE_MULTIPROCESSING_TABLE    NULL
678
679  #endif /* CONFIGURE_MP_APPLICATION */
680#endif /* RTEMS_MULTIPROCESSING */
681
682/*
683 *  Default Configuration Table.
684 */
685
686#ifndef CONFIGURE_HAS_OWN_CONFIGURATION_TABLE
687
688  #ifndef CONFIGURE_EXECUTIVE_RAM_WORK_AREA
689    #define CONFIGURE_EXECUTIVE_RAM_WORK_AREA     NULL
690  #endif
691
692  #ifndef CONFIGURE_MAXIMUM_TASKS
693    #define CONFIGURE_MAXIMUM_TASKS               0
694  #endif
695
696  #ifndef CONFIGURE_DISABLE_CLASSIC_API_NOTEPADS
697    #define CONFIGURE_NOTEPADS_ENABLED           FALSE
698  #else
699    #define CONFIGURE_NOTEPADS_ENABLED           TRUE
700  #endif
701
702  #ifndef CONFIGURE_MAXIMUM_TASK_VARIABLES
703    #define CONFIGURE_MAXIMUM_TASK_VARIABLES      0
704  #endif
705
706  #ifndef CONFIGURE_MAXIMUM_TIMERS
707    #define CONFIGURE_MAXIMUM_TIMERS              0
708  #endif
709
710  #ifndef CONFIGURE_MAXIMUM_SEMAPHORES
711    #define CONFIGURE_MAXIMUM_SEMAPHORES          0
712  #endif
713
714  #ifndef CONFIGURE_MAXIMUM_MESSAGE_QUEUES
715    #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES      0
716  #endif
717
718  #ifndef CONFIGURE_MAXIMUM_PARTITIONS
719    #define CONFIGURE_MAXIMUM_PARTITIONS          0
720  #endif
721
722  #ifndef CONFIGURE_MAXIMUM_REGIONS
723    #define CONFIGURE_MAXIMUM_REGIONS             0
724  #endif
725
726  #ifndef CONFIGURE_MAXIMUM_PORTS
727    #define CONFIGURE_MAXIMUM_PORTS               0
728  #endif
729
730  #ifndef CONFIGURE_MAXIMUM_PERIODS
731    #define CONFIGURE_MAXIMUM_PERIODS             0
732  #endif
733
734  #ifndef CONFIGURE_MAXIMUM_BARRIERS
735    #define CONFIGURE_MAXIMUM_BARRIERS            0
736  #endif
737
738  #ifndef CONFIGURE_MAXIMUM_USER_EXTENSIONS
739    #define CONFIGURE_MAXIMUM_USER_EXTENSIONS     0
740  #endif
741
742  #ifndef CONFIGURE_MICROSECONDS_PER_TICK
743    #define CONFIGURE_MICROSECONDS_PER_TICK \
744            RTEMS_MILLISECONDS_TO_MICROSECONDS(10)
745  #endif
746
747  #ifndef CONFIGURE_TICKS_PER_TIMESLICE
748    #define CONFIGURE_TICKS_PER_TIMESLICE        50
749  #endif
750
751  #ifndef CONFIGURE_DISABLE_CLASSIC_NOTEPADS
752    #define CONFIGURE_MEMORY_PER_TASK_FOR_CLASSIC_API \
753      sizeof(RTEMS_API_Control)
754  #else
755    #define CONFIGURE_MEMORY_PER_TASK_FOR_CLASSIC_API \
756      (sizeof(RTEMS_API_Control) - (RTEMS_NUMBER_NOTEPADS * sizeof(uint32_t)))
757  #endif
758
759/*
760 *  Initial Extension Set
761 */
762
763#ifdef CONFIGURE_INIT
764#ifdef STACK_CHECKER_ON
765#include <rtems/stackchk.h>
766#endif
767#include <rtems/libcsupport.h>
768
769#if defined(CONFIGURE_INITIAL_EXTENSIONS) || \
770    defined(STACK_CHECKER_ON) || \
771    (defined(RTEMS_NEWLIB) && !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY))
772  rtems_extensions_table Configuration_Initial_Extensions[] = {
773    #if !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY)
774      RTEMS_NEWLIB_EXTENSION,
775    #endif
776    #if defined(STACK_CHECKER_ON)
777      RTEMS_STACK_CHECKER_EXTENSION,
778    #endif
779    #if defined(CONFIGURE_INITIAL_EXTENSIONS)
780      CONFIGURE_INITIAL_EXTENSIONS,
781    #endif
782  };
783
784  #define CONFIGURE_INITIAL_EXTENSION_TABLE Configuration_Initial_Extensions
785  #define CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS \
786    ((sizeof(Configuration_Initial_Extensions) / \
787      sizeof(rtems_extensions_table)))
788#else
789  #define CONFIGURE_INITIAL_EXTENSION_TABLE NULL
790  #define CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS 0
791#endif
792
793
794#endif
795
796/*
797 *  POSIX API Configuration Parameters
798 */
799
800#ifdef RTEMS_POSIX_API
801
802  #include <sys/types.h>
803  #include <signal.h>
804  #include <limits.h>
805  #include <mqueue.h>
806  #include <rtems/posix/barrier.h>
807  #include <rtems/posix/cond.h>
808  #include <rtems/posix/mqueue.h>
809  #include <rtems/posix/mutex.h>
810  #include <rtems/posix/key.h>
811  #include <rtems/posix/psignal.h>
812  #include <rtems/posix/rwlock.h>
813  #include <rtems/posix/semaphore.h>
814  #include <rtems/posix/spinlock.h>
815  #include <rtems/posix/threadsup.h>
816  #include <rtems/posix/timer.h>
817
818  #ifndef CONFIGURE_MAXIMUM_POSIX_THREADS
819    #define CONFIGURE_MAXIMUM_POSIX_THREADS      0
820  #endif
821
822  #ifndef CONFIGURE_MAXIMUM_POSIX_MUTEXES
823    #define CONFIGURE_MAXIMUM_POSIX_MUTEXES      0
824  #endif
825
826  #ifndef CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES
827    #define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES  0
828  #endif
829
830  #ifndef CONFIGURE_MAXIMUM_POSIX_KEYS
831    #define CONFIGURE_MAXIMUM_POSIX_KEYS         0
832  #endif
833
834  #ifndef CONFIGURE_MAXIMUM_POSIX_TIMERS
835    #define CONFIGURE_MAXIMUM_POSIX_TIMERS 0
836  #endif
837
838  #ifndef CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS
839    #define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS 0
840  #endif
841
842  #ifndef CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES
843    #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES 0
844  #endif
845
846  #ifndef CONFIGURE_MAXIMUM_POSIX_SEMAPHORES
847    #define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES 0
848  #endif
849
850  #ifndef CONFIGURE_MAXIMUM_POSIX_BARRIERS
851    #define CONFIGURE_MAXIMUM_POSIX_BARRIERS 0
852  #endif
853
854  #ifndef CONFIGURE_MAXIMUM_POSIX_SPINLOCKS
855    #define CONFIGURE_MAXIMUM_POSIX_SPINLOCKS 0
856  #endif
857
858  #ifndef CONFIGURE_MAXIMUM_POSIX_RWLOCKS
859    #define CONFIGURE_MAXIMUM_POSIX_RWLOCKS 0
860  #endif
861
862  #ifdef CONFIGURE_POSIX_INIT_THREAD_TABLE
863
864    #ifdef CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE
865
866      /*
867       *  The user is defining their own table information and setting the
868       *  appropriate variables for the POSIX Initialization Thread Table.
869       */
870
871    #else
872
873      #ifndef CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT
874        #define CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT   POSIX_Init
875      #endif
876
877      #ifndef CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE
878        #define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE \
879                (CONFIGURE_MINIMUM_TASK_STACK_SIZE * 2)
880      #endif
881
882      #ifdef CONFIGURE_INIT
883        posix_initialization_threads_table POSIX_Initialization_threads[] = {
884          { CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT, \
885              CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE }
886        };
887      #endif
888
889      #define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME \
890              POSIX_Initialization_threads
891
892      #define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE \
893        sizeof(CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME) / \
894            sizeof(posix_initialization_threads_table)
895
896    #endif    /* CONFIGURE_POSIX_HAS_OWN_INIT_TASK_TABLE */
897
898  #else     /* CONFIGURE_POSIX_INIT_THREAD_TABLE */
899
900    #define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME NULL
901    #define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE 0
902
903  #endif
904
905  #define CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API \
906    ( \
907      sizeof (POSIX_API_Control) + \
908     (sizeof (void *) * (CONFIGURE_MAXIMUM_POSIX_KEYS)) \
909    )
910
911  #define CONFIGURE_MEMORY_FOR_POSIX_MUTEXES(_mutexes) \
912    _Configure_Object_RAM(_mutexes, sizeof(POSIX_Mutex_Control) )
913
914  #define CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES(_condition_variables) \
915    _Configure_Object_RAM(_condition_variables, \
916                          sizeof(POSIX_Condition_variables_Control) )
917
918  #define CONFIGURE_MEMORY_FOR_POSIX_KEYS(_keys) \
919    _Configure_Object_RAM(_keys, sizeof(POSIX_Keys_Control) )
920
921  #define CONFIGURE_MEMORY_FOR_POSIX_TIMERS(_timers) \
922    _Configure_Object_RAM(_timers, sizeof(POSIX_Timer_Control) )
923
924  #define CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS(_queued_signals) \
925    _Configure_From_workspace( \
926      (_queued_signals) * (sizeof(POSIX_signals_Siginfo_node)) )
927
928  /**
929   *  Account for the object control structures plus the name
930   *  of the object to be duplicated.
931   */
932  #define _Configure_POSIX_Named_Object_RAM(_number, _size) \
933    _Configure_Object_RAM( (_number), _size ) + \
934    ((_number) + _Configure_From_workspace(NAME_MAX) )
935
936  #define CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES(_message_queues) \
937    _Configure_POSIX_Named_Object_RAM( \
938       _message_queues, sizeof(POSIX_Message_queue_Control) )
939
940  #define CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES(_semaphores) \
941    _Configure_POSIX_Named_Object_RAM( \
942       _semaphores, sizeof(POSIX_Semaphore_Control) )
943
944  #define CONFIGURE_MEMORY_FOR_POSIX_BARRIERS(_barriers) \
945    _Configure_Object_RAM(_barriers, sizeof(POSIX_Barrier_Control) )
946
947  #define CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS(_spinlocks) \
948    _Configure_Object_RAM(_spinlocks, sizeof(POSIX_Spinlock_Control) )
949
950  #define CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS(_rwlocks) \
951    _Configure_Object_RAM(_rwlocks, sizeof(POSIX_RWLock_Control) )
952
953  #define CONFIGURE_MEMORY_FOR_POSIX \
954    ( \
955      CONFIGURE_MEMORY_FOR_POSIX_MUTEXES( CONFIGURE_MAXIMUM_POSIX_MUTEXES ) + \
956      CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES( \
957          CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES ) + \
958      CONFIGURE_MEMORY_FOR_POSIX_KEYS( CONFIGURE_MAXIMUM_POSIX_KEYS ) + \
959      CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS( \
960          CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS ) + \
961      CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES( \
962          CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES ) + \
963      CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES( \
964          CONFIGURE_MAXIMUM_POSIX_SEMAPHORES ) + \
965      CONFIGURE_MEMORY_FOR_POSIX_BARRIERS(CONFIGURE_MAXIMUM_POSIX_BARRIERS) + \
966      CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS( \
967          CONFIGURE_MAXIMUM_POSIX_SPINLOCKS ) + \
968      CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS( \
969          CONFIGURE_MAXIMUM_POSIX_RWLOCKS ) + \
970      CONFIGURE_MEMORY_FOR_POSIX_TIMERS( CONFIGURE_MAXIMUM_POSIX_TIMERS ) + \
971      (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE) \
972     )
973#else
974
975  #define CONFIGURE_MAXIMUM_POSIX_THREADS         0
976  #define CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API 0
977  #define CONFIGURE_MEMORY_FOR_POSIX              0
978
979#endif    /* RTEMS_POSIX_API */
980
981#ifndef CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE
982  #define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE    0
983#endif
984
985/*
986 *  This block of defines are for applications which use GNAT/RTEMS.
987 *  GNAT implements each Ada task as a POSIX thread.
988 */
989#ifdef CONFIGURE_GNAT_RTEMS
990
991  /**
992   *  The GNAT run-time needs something less than (10) POSIX mutexes.
993   *  We may be able to get by with less but why bother.
994   */
995  #define CONFIGURE_GNAT_MUTEXES 10
996
997  /**
998   *  This is the maximum number of Ada tasks which can be concurrently
999   *  in existence.  Twenty (20) are required to run all tests in the
1000   *  ACATS (formerly ACVC).
1001   */
1002  #ifndef CONFIGURE_MAXIMUM_ADA_TASKS
1003    #define CONFIGURE_MAXIMUM_ADA_TASKS  20
1004  #endif
1005
1006  /**
1007   * This is the number of non-Ada tasks which invoked Ada code.
1008   */
1009  #ifndef CONFIGURE_MAXIMUM_FAKE_ADA_TASKS
1010    #define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0
1011  #endif
1012
1013  /**
1014   * Ada tasks are allocated twice the minimum stack space.
1015   */
1016  #define CONFIGURE_ADA_TASKS_STACK \
1017    (CONFIGURE_MAXIMUM_ADA_TASKS * \
1018      (CONFIGURE_MINIMUM_TASK_STACK_SIZE + (6 * 1024)))
1019
1020#else
1021  #define CONFIGURE_GNAT_MUTEXES           0
1022  #define CONFIGURE_MAXIMUM_ADA_TASKS      0
1023  #define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0
1024  #define CONFIGURE_ADA_TASKS_STACK        0
1025#endif
1026
1027/*
1028 *  ITRON API Configuration Parameters
1029 */
1030
1031#ifdef RTEMS_ITRON_API
1032
1033  #include <rtems/itron.h>
1034  #include <rtems/itron/config.h>
1035  #include <rtems/itron/eventflags.h>
1036  #include <rtems/itron/fmempool.h>
1037  #include <rtems/itron/mbox.h>
1038  #include <rtems/itron/msgbuffer.h>
1039  #include <rtems/itron/port.h>
1040  #include <rtems/itron/semaphore.h>
1041  #include <rtems/itron/task.h>
1042  #include <rtems/itron/vmempool.h>
1043
1044  #ifndef CONFIGURE_MAXIMUM_ITRON_TASKS
1045    #define CONFIGURE_MAXIMUM_ITRON_TASKS      0
1046  #endif
1047
1048  #ifndef CONFIGURE_MAXIMUM_ITRON_SEMAPHORES
1049    #define CONFIGURE_MAXIMUM_ITRON_SEMAPHORES   0
1050  #endif
1051
1052  #ifndef CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS
1053    #define CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS   0
1054  #endif
1055
1056  #ifndef CONFIGURE_MAXIMUM_ITRON_MAILBOXES
1057    #define CONFIGURE_MAXIMUM_ITRON_MAILBOXES   0
1058  #endif
1059
1060  #ifndef CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS
1061    #define CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS   0
1062  #endif
1063
1064  #ifndef CONFIGURE_MAXIMUM_ITRON_PORTS
1065    #define CONFIGURE_MAXIMUM_ITRON_PORTS   0
1066  #endif
1067
1068  #ifndef CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS
1069    #define CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS   0
1070  #endif
1071
1072  #ifndef CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS
1073    #define CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS   0
1074  #endif
1075
1076  #ifdef CONFIGURE_ITRON_INIT_TASK_TABLE
1077
1078    #ifdef CONFIGURE_ITRON_HAS_OWN_INIT_TASK_TABLE
1079
1080      /*
1081       *  The user is defining their own table information and setting the
1082       *  appropriate variables for the ITRON Initialization Task Table.
1083       */
1084
1085    #else
1086
1087      #ifndef CONFIGURE_ITRON_INIT_TASK_ENTRY_POINT
1088        #define CONFIGURE_ITRON_INIT_TASK_ENTRY_POINT   ITRON_Init
1089      #endif
1090
1091      #ifndef CONFIGURE_ITRON_INIT_TASK_ATTRIBUTES
1092        #define CONFIGURE_ITRON_INIT_TASK_ATTRIBUTES    TA_HLNG
1093      #endif
1094
1095      #ifndef CONFIGURE_ITRON_INIT_TASK_PRIORITY
1096        #define CONFIGURE_ITRON_INIT_TASK_PRIORITY      1
1097      #endif
1098
1099      #ifndef CONFIGURE_ITRON_INIT_TASK_STACK_SIZE
1100        #define CONFIGURE_ITRON_INIT_TASK_STACK_SIZE \
1101                CONFIGURE_MINIMUM_TASK_STACK_SIZE
1102      #endif
1103
1104      #ifdef CONFIGURE_INIT
1105        itron_initialization_tasks_table ITRON_Initialization_tasks[] = {
1106          { 1,                                    /* ID */
1107            { (VP) 0,                                /* exinfo */
1108              CONFIGURE_ITRON_INIT_TASK_ATTRIBUTES,  /* task attributes */
1109              CONFIGURE_ITRON_INIT_TASK_ENTRY_POINT, /* task start address */
1110              CONFIGURE_ITRON_INIT_TASK_PRIORITY,    /* initial task priority */
1111              CONFIGURE_ITRON_INIT_TASK_STACK_SIZE   /* stack size */
1112            }
1113          }
1114        };
1115      #endif
1116
1117      #define CONFIGURE_ITRON_INIT_TASK_TABLE_NAME ITRON_Initialization_tasks
1118
1119      #define CONFIGURE_ITRON_INIT_TASK_TABLE_SIZE \
1120        sizeof(CONFIGURE_ITRON_INIT_TASK_TABLE_NAME) / \
1121            sizeof(itron_initialization_tasks_table)
1122
1123    #endif    /* CONFIGURE_ITRON_HAS_OWN_INIT_TASK_TABLE */
1124
1125  #else     /* CONFIGURE_ITRON_INIT_TASK_TABLE */
1126
1127    #define CONFIGURE_ITRON_INIT_TASK_TABLE_NAME NULL
1128    #define CONFIGURE_ITRON_INIT_TASK_TABLE_SIZE 0
1129    #define CONFIGURE_ITRON_INIT_TASK_STACK_SIZE 0
1130
1131  #endif
1132
1133  #define CONFIGURE_MEMORY_PER_TASK_FOR_ITRON_API 0
1134
1135  #define CONFIGURE_MEMORY_FOR_ITRON_SEMAPHORES(_semaphores) \
1136    _Configure_Object_RAM(_semaphores, sizeof(ITRON_Semaphore_Control))
1137
1138  #define CONFIGURE_MEMORY_FOR_ITRON_EVENTFLAGS(_eventflags) \
1139    _Configure_Object_RAM(_eventflags, sizeof(ITRON_Eventflags_Control))
1140
1141  #define CONFIGURE_MEMORY_FOR_ITRON_MAILBOXES(_mailboxes) \
1142    _Configure_Object_RAM(_mailboxes, sizeof(ITRON_Mailbox_Control))
1143
1144  #define CONFIGURE_MEMORY_FOR_ITRON_MESSAGE_BUFFERS(_message_buffers) \
1145    _Configure_Object_RAM(_message_buffers, \
1146      sizeof(ITRON_Message_buffer_Control))
1147
1148  #define CONFIGURE_MEMORY_FOR_ITRON_PORTS(_ports) \
1149    _Configure_Object_RAM(_ports, sizeof(ITRON_Port_Control))
1150
1151  #define CONFIGURE_MEMORY_FOR_ITRON_MEMORY_POOLS(_memory_pools) \
1152    _Configure_Object_RAM( \
1153      _memory_pools, sizeof(ITRON_Variable_memory_pool_Control))
1154
1155  #define CONFIGURE_MEMORY_FOR_ITRON_FIXED_MEMORY_POOLS(_fixed_memory_pools) \
1156    _Configure_Object_RAM( \
1157    _fixed_memory_pools, sizeof(ITRON_Fixed_memory_pool_Control))
1158
1159  #define CONFIGURE_MEMORY_FOR_ITRON \
1160    ( \
1161      CONFIGURE_MEMORY_FOR_ITRON_SEMAPHORES( \
1162          CONFIGURE_MAXIMUM_ITRON_SEMAPHORES ) + \
1163      CONFIGURE_MEMORY_FOR_ITRON_EVENTFLAGS( \
1164          CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS ) + \
1165      CONFIGURE_MEMORY_FOR_ITRON_MAILBOXES( \
1166          CONFIGURE_MAXIMUM_ITRON_MAILBOXES ) + \
1167      CONFIGURE_MEMORY_FOR_ITRON_MESSAGE_BUFFERS( \
1168          CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS ) + \
1169      CONFIGURE_MEMORY_FOR_ITRON_PORTS( \
1170          CONFIGURE_MAXIMUM_ITRON_PORTS ) + \
1171      CONFIGURE_MEMORY_FOR_ITRON_MEMORY_POOLS( \
1172          CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS ) + \
1173      CONFIGURE_MEMORY_FOR_ITRON_FIXED_MEMORY_POOLS( \
1174          CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS ) + \
1175      CONFIGURE_ITRON_INIT_TASK_STACK_SIZE \
1176     )
1177
1178#else
1179
1180  #define CONFIGURE_MAXIMUM_ITRON_TASKS               0
1181  #define CONFIGURE_MAXIMUM_ITRON_SEMAPHORES          0
1182  #define CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS          0
1183  #define CONFIGURE_MAXIMUM_ITRON_MAILBOXES           0
1184  #define CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS     0
1185  #define CONFIGURE_MAXIMUM_ITRON_PORTS               0
1186  #define CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS        0
1187  #define CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS  0
1188  #define CONFIGURE_MEMORY_PER_TASK_FOR_ITRON_API     0
1189  #define CONFIGURE_MEMORY_FOR_ITRON                  0
1190
1191#endif    /* RTEMS_ITRON_API */
1192
1193#if defined(RTEMS_NEWLIB)
1194  #include <reent.h>
1195
1196  #define CONFIGURE_MEMORY_PER_TASK_FOR_LIBC_REENTRANCY sizeof(struct _reent)
1197#else
1198  #define CONFIGURE_MEMORY_PER_TASK_FOR_LIBC_REENTRANCY 0
1199#endif
1200
1201/*
1202 *  Calculate the RAM size based on the maximum number of objects configured.
1203 */
1204
1205#ifndef CONFIGURE_EXECUTIVE_RAM_SIZE
1206
1207/**
1208 *  Account for allocating the following per object
1209 *    + array of object control structures
1210 *    + local pointer table -- pointer per object plus a zero'th
1211 *      entry in the local pointer table.
1212 */
1213
1214#define CONFIGURE_MEMORY_FOR_TASKS(_tasks, _number_FP_tasks) \
1215 ( \
1216  _Configure_Object_RAM(_tasks, sizeof(Thread_Control)) + \
1217  ((_tasks) * \
1218   (_Configure_From_workspace(CONFIGURE_MINIMUM_TASK_STACK_SIZE) + \
1219    _Configure_From_workspace(CONFIGURE_MEMORY_PER_TASK_FOR_CLASSIC_API) + \
1220    _Configure_From_workspace(CONFIGURE_MEMORY_PER_TASK_FOR_LIBC_REENTRANCY) + \
1221    _Configure_From_workspace(CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API) + \
1222    _Configure_From_workspace(CONFIGURE_MEMORY_PER_TASK_FOR_ITRON_API)))  + \
1223  _Configure_From_workspace((_number_FP_tasks) * CONTEXT_FP_SIZE) \
1224 )
1225
1226/**
1227 *  This macro calculates the memory required for task variables.
1228 *
1229 *  @note Each task variable is individually allocated from the Workspace.
1230 *        Hence, we do the multiplication on the configured size.
1231 */
1232#define CONFIGURE_MEMORY_FOR_TASK_VARIABLES(_task_variables) \
1233  (_task_variables) * _Configure_From_workspace(sizeof(rtems_task_variable_t))
1234
1235#define CONFIGURE_MEMORY_FOR_TIMERS(_timers) \
1236  _Configure_Object_RAM(_timers, sizeof(Timer_Control) )
1237
1238#define CONFIGURE_MEMORY_FOR_SEMAPHORES(_semaphores) \
1239_Configure_Object_RAM(_semaphores, sizeof(Semaphore_Control) )
1240
1241#define CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(_queues) \
1242_Configure_Object_RAM(_queues, sizeof(Message_queue_Control) )
1243
1244#define CONFIGURE_MEMORY_FOR_PARTITIONS(_partitions) \
1245_Configure_Object_RAM(_partitions, sizeof(Partition_Control) )
1246
1247#define CONFIGURE_MEMORY_FOR_REGIONS(_regions) \
1248_Configure_Object_RAM(_regions, sizeof(Region_Control) )
1249
1250#define CONFIGURE_MEMORY_FOR_PORTS(_ports) \
1251_Configure_Object_RAM(_ports, sizeof(Dual_ported_memory_Control) )
1252
1253#define CONFIGURE_MEMORY_FOR_PERIODS(_periods) \
1254_Configure_Object_RAM(_periods, sizeof(Rate_monotonic_Control) )
1255
1256#define CONFIGURE_MEMORY_FOR_BARRIERS(_barriers) \
1257_Configure_Object_RAM(_barriers, sizeof(Barrier_Control) )
1258
1259#define CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(_extensions) \
1260_Configure_Object_RAM(_extensions, sizeof(Extension_Control) )
1261
1262#ifdef CONFIGURE_MP_APPLICATION
1263
1264#ifndef CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE
1265
1266#define CONFIGURE_MEMORY_FOR_PROXIES(_proxies) \
1267  _Configure_Object_RAM((_proxies) + 1, sizeof(Thread_Proxy_control) )
1268
1269#define CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS(_global_objects) \
1270  _Configure_Object_RAM((_global_objects), sizeof(Objects_MP_Control))
1271
1272#define CONFIGURE_MEMORY_FOR_MP \
1273  ( CONFIGURE_MEMORY_FOR_PROXIES(CONFIGURE_MP_MAXIMUM_PROXIES) + \
1274    CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS(CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS) + \
1275    CONFIGURE_MEMORY_FOR_TASKS(1, 1) + \
1276    CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK \
1277  )
1278
1279#endif  /* CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE */
1280
1281#else
1282
1283#define CONFIGURE_MEMORY_FOR_MP  0
1284
1285#endif
1286
1287/**
1288 *  This is so we can account for tasks with stacks greater than minimum
1289 *  size.  This is in bytes.
1290 */
1291#ifndef CONFIGURE_EXTRA_TASK_STACKS
1292  #define CONFIGURE_EXTRA_TASK_STACKS 0
1293#endif
1294
1295/**
1296 *  The following macro is used to calculate the memory allocated by RTEMS
1297 *  for the message buffers associated with a particular message queue.
1298 *  There is a fixed amount of overhead per message.
1299 */
1300#define CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(_messages, _size) \
1301    _Configure_From_workspace( \
1302      (_messages) * ((_size) + sizeof(CORE_message_queue_Buffer_control)))
1303
1304/**
1305 *  This macros is set to the amount of memory required for pending message
1306 *  buffers in bytes.  It should be constructed by adding together a
1307 *  set of values determined by CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE.
1308 */
1309#ifndef CONFIGURE_MESSAGE_BUFFER_MEMORY
1310  #define CONFIGURE_MESSAGE_BUFFER_MEMORY 0
1311#endif
1312
1313/**
1314 *  This macro is available just in case the confdefs.h file underallocates
1315 *  memory for a particular application.  This lets the user add some extra
1316 *  memory in case something broken and underestimates.
1317 *
1318 *  It is also possible for cases where confdefs.h overallocates memory,
1319 *  you could substract memory from the allocated.  The estimate is just
1320 *  that, an estimate, and assumes worst case alignment and padding on
1321 *  each allocated element.  So in some cases it could be too conservative.
1322 *
1323 *  @note Historically this was used for message buffers.
1324 */
1325#ifndef CONFIGURE_MEMORY_OVERHEAD
1326  #define CONFIGURE_MEMORY_OVERHEAD 0
1327#endif
1328
1329/**
1330 *  On architectures that use Simple Vectored Interrupts, it is RTEMS
1331 *  responsibility to allocate the vector table.  This avoids reserving
1332 *  the memory on architectures that use the Programmable Interrupt
1333 *  Controller Vectored Interrupts.
1334 */
1335#if (CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE)
1336  /*
1337   *  This is a (hopefully) temporary hack.  On the mips, the number of
1338   *  vectors is NOT statically defined.  But it has to be statically
1339   *  defined for this to work.  This is an issue looking for a nice
1340   *  solution.
1341   */
1342  #if defined(__mips__)
1343    #define CONFIGURE_INTERRUPT_VECTOR_TABLE (sizeof(ISR_Handler_entry) * 256)
1344  #else
1345    #define CONFIGURE_INTERRUPT_VECTOR_TABLE \
1346      (sizeof(ISR_Handler_entry) * ISR_NUMBER_OF_VECTORS)
1347  #endif
1348#else
1349  #define CONFIGURE_INTERRUPT_VECTOR_TABLE 0
1350#endif
1351
1352/**
1353 *  RTEMS uses one instance of an internal mutex class.  This accounts
1354 *  for that mutex
1355 */
1356#define CONFIGURE_API_MUTEX_MEMORY \
1357  _Configure_Object_RAM(1, sizeof(API_Mutex_Control))
1358
1359/**
1360 *  This macro accounts for general RTEMS system overhead.
1361 */
1362#define CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD \
1363  ( \
1364    CONFIGURE_MEMORY_FOR_TASKS(1, 0) +              /* IDLE and stack */ \
1365    (CONFIGURE_IDLE_TASK_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE) + \
1366    _Configure_From_workspace(                        /* Ready chains */ \
1367        ((CONFIGURE_MAXIMUM_PRIORITY+1) * sizeof(Chain_Control)) ) + \
1368    CONFIGURE_INTERRUPT_VECTOR_TABLE +           /* interrupt vectors */ \
1369    CONFIGURE_INTERRUPT_STACK_MEMORY +             /* interrupt stack */ \
1370    CONFIGURE_API_MUTEX_MEMORY                    /* allocation mutex */ \
1371  )
1372
1373/*
1374 *  Now account for any extra memory that initialization tasks or threads
1375 *  may have requested.
1376 */
1377
1378/**
1379 *  This accounts for any extra memory required by the Classic API
1380 *  Initialization Task.
1381 */
1382#if (CONFIGURE_INIT_TASK_STACK_SIZE > CONFIGURE_MINIMUM_TASK_STACK_SIZE)
1383  #define CONFIGURE_INITIALIZATION_THREADS_STACKS_CLASSIC_PART \
1384      (CONFIGURE_INIT_TASK_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE)
1385#else
1386  #define CONFIGURE_INITIALIZATION_THREADS_STACKS_CLASSIC_PART 0
1387#endif
1388
1389/**
1390 *  This accounts for any extra memory required by the POSIX API
1391 *  Initialization Thread.
1392 */
1393#if defined(RTEMS_POSIX_API) && \
1394    (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE > CONFIGURE_MINIMUM_TASK_STACK_SIZE)
1395  #define CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART \
1396    (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE)
1397#else
1398  #define CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART 0
1399#endif
1400
1401/**
1402 *  This accounts for any extra memory required by the ITRON API
1403 *  Initialization Task.
1404 */
1405#if defined(RTEMS_ITRON_API) && \
1406    (CONFIGURE_ITRON_INIT_TASK_STACK_SIZE > CONFIGURE_MINIMUM_TASK_STACK_SIZE)
1407  #define CONFIGURE_INITIALIZATION_THREADS_STACKS_ITRON_PART \
1408      (CONFIGURE_ITRON_INIT_TASK_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE)
1409#else
1410  #define CONFIGURE_INITIALIZATION_THREADS_STACKS_ITRON_PART 0
1411#endif
1412
1413/**
1414 *  This macro provides a summation of the various initialization task
1415 *  and thread stack requirements.
1416 */
1417#define CONFIGURE_INITIALIZATION_THREADS_STACKS \
1418    (CONFIGURE_INITIALIZATION_THREADS_STACKS_CLASSIC_PART + \
1419    CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART + \
1420    CONFIGURE_INITIALIZATION_THREADS_STACKS_ITRON_PART)
1421
1422/**
1423 *  This macro provides a summation of the various task and thread
1424 *  requirements.
1425 */
1426#define CONFIGURE_TOTAL_TASKS_AND_THREADS \
1427   (CONFIGURE_MAXIMUM_TASKS + \
1428    CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_ADA_TASKS + \
1429    CONFIGURE_MAXIMUM_ITRON_TASKS \
1430   )
1431
1432/**
1433 *  This macro reserves the memory required by the statically configured
1434 *  user extensions.
1435 */
1436#define CONFIGURE_MEMORY_FOR_STATIC_EXTENSIONS \
1437   _Configure_From_workspace( \
1438     (CONFIGURE_NEWLIB_EXTENSION + CONFIGURE_STACK_CHECKER_EXTENSION) * \
1439      sizeof(User_extensions_Control) \
1440   )
1441
1442/**
1443 *  This macro provides a summation of the memory required by the
1444 *  Classic API as configured.
1445 */
1446#define CONFIGURE_MEMORY_FOR_CLASSIC \
1447  (CONFIGURE_MEMORY_FOR_TASK_VARIABLES(CONFIGURE_MAXIMUM_TASK_VARIABLES) + \
1448   CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS) + \
1449   CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_MAXIMUM_SEMAPHORES + \
1450     CONFIGURE_LIBIO_SEMAPHORES + CONFIGURE_TERMIOS_SEMAPHORES) + \
1451   CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(CONFIGURE_MAXIMUM_MESSAGE_QUEUES) + \
1452   CONFIGURE_MEMORY_FOR_PARTITIONS(CONFIGURE_MAXIMUM_PARTITIONS) + \
1453   CONFIGURE_MEMORY_FOR_REGIONS( CONFIGURE_MAXIMUM_REGIONS ) + \
1454   CONFIGURE_MEMORY_FOR_PORTS(CONFIGURE_MAXIMUM_PORTS) + \
1455   CONFIGURE_MEMORY_FOR_PERIODS(CONFIGURE_MAXIMUM_PERIODS) + \
1456   CONFIGURE_MEMORY_FOR_BARRIERS(CONFIGURE_MAXIMUM_BARRIERS) + \
1457   CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(CONFIGURE_MAXIMUM_USER_EXTENSIONS) \
1458  )
1459
1460#if 1 && defined(CONFIGURE_INIT)
1461  /**
1462   *  This is a debug mechanism, so if you need to, the executable will
1463   *  have a structure with various partial values.  Add to this as you
1464   *  need to.  Viewing this structure in gdb combined with dumping
1465   *  the Configuration structures generated should help a lot in tracing
1466   *  down errors and analyzing where over and under allocations are.
1467   */
1468  typedef struct {
1469    uint32_t Classic;
1470    uint32_t ITRON;
1471    uint32_t POSIX;
1472    uint32_t TASKS;
1473    uint32_t INIT_TASK_STACKS;
1474  } Configuration_Debug_t;
1475
1476  Configuration_Debug_t Configuration_Memory_Debug = {
1477    CONFIGURE_MEMORY_FOR_CLASSIC, /* MEMORY_CLASSIC */
1478    CONFIGURE_MEMORY_FOR_ITRON,   /* MEMORY_ITRON */
1479    CONFIGURE_MEMORY_FOR_POSIX,   /* MEMORY_POSIX */
1480    CONFIGURE_MEMORY_FOR_TASKS(   /* MEMORY_TASKS */
1481        CONFIGURE_TOTAL_TASKS_AND_THREADS, CONFIGURE_TOTAL_TASKS_AND_THREADS),
1482    CONFIGURE_INITIALIZATION_THREADS_STACKS /* INIT_TASK_STACKS */
1483  };
1484#endif
1485
1486/**
1487 *  This calculates the memory required for the executive workspace.
1488 */
1489#define CONFIGURE_EXECUTIVE_RAM_SIZE \
1490(( \
1491   CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD + \
1492   CONFIGURE_MEMORY_FOR_TASKS( \
1493     CONFIGURE_TOTAL_TASKS_AND_THREADS, CONFIGURE_TOTAL_TASKS_AND_THREADS) + \
1494   CONFIGURE_MEMORY_FOR_CLASSIC + \
1495   CONFIGURE_MEMORY_FOR_POSIX + \
1496   (CONFIGURE_MAXIMUM_POSIX_THREADS * CONFIGURE_MINIMUM_TASK_STACK_SIZE ) + \
1497   CONFIGURE_MEMORY_FOR_ITRON + \
1498   CONFIGURE_INITIALIZATION_THREADS_STACKS + \
1499   CONFIGURE_MEMORY_FOR_STATIC_EXTENSIONS + \
1500   CONFIGURE_MEMORY_FOR_MP + \
1501   CONFIGURE_MESSAGE_BUFFER_MEMORY + \
1502   (CONFIGURE_MEMORY_OVERHEAD * 1024) + \
1503   (CONFIGURE_EXTRA_TASK_STACKS) + (CONFIGURE_ADA_TASKS_STACK) \
1504) & ~0x7)
1505#endif
1506
1507#ifdef CONFIGURE_INIT
1508  /**
1509   *  This is the Classic API Configuration Table.
1510   */
1511  rtems_api_configuration_table Configuration_RTEMS_API = {
1512    CONFIGURE_MAXIMUM_TASKS,
1513    CONFIGURE_NOTEPADS_ENABLED,
1514    CONFIGURE_MAXIMUM_TIMERS,
1515    CONFIGURE_MAXIMUM_SEMAPHORES + CONFIGURE_LIBIO_SEMAPHORES +
1516      CONFIGURE_TERMIOS_SEMAPHORES,
1517    CONFIGURE_MAXIMUM_MESSAGE_QUEUES,
1518    CONFIGURE_MAXIMUM_PARTITIONS,
1519    CONFIGURE_MAXIMUM_REGIONS,
1520    CONFIGURE_MAXIMUM_PORTS,
1521    CONFIGURE_MAXIMUM_PERIODS,
1522    CONFIGURE_MAXIMUM_BARRIERS,
1523    CONFIGURE_INIT_TASK_TABLE_SIZE,
1524    CONFIGURE_INIT_TASK_TABLE
1525  };
1526
1527  #ifdef RTEMS_POSIX_API
1528    /**
1529     *  This is the POSIX API Configuration Table.
1530     */
1531    posix_api_configuration_table Configuration_POSIX_API = {
1532      CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_ADA_TASKS,
1533      CONFIGURE_MAXIMUM_POSIX_MUTEXES + CONFIGURE_GNAT_MUTEXES +
1534        CONFIGURE_MAXIMUM_ADA_TASKS + CONFIGURE_MAXIMUM_FAKE_ADA_TASKS,
1535      CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES +
1536        CONFIGURE_MAXIMUM_ADA_TASKS + CONFIGURE_MAXIMUM_FAKE_ADA_TASKS,
1537      CONFIGURE_MAXIMUM_POSIX_KEYS,
1538      CONFIGURE_MAXIMUM_POSIX_TIMERS,
1539      CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS,
1540      CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES,
1541      CONFIGURE_MAXIMUM_POSIX_SEMAPHORES,
1542      CONFIGURE_MAXIMUM_POSIX_BARRIERS,
1543      CONFIGURE_MAXIMUM_POSIX_RWLOCKS,
1544      CONFIGURE_MAXIMUM_POSIX_SPINLOCKS,
1545      CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE,
1546      CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME
1547    };
1548  #endif
1549
1550  #ifdef RTEMS_ITRON_API
1551    /**
1552     *  This is the ITRON API Configuration Table.
1553     */
1554    itron_api_configuration_table Configuration_ITRON_API = {
1555      CONFIGURE_MAXIMUM_ITRON_TASKS,
1556      CONFIGURE_MAXIMUM_ITRON_SEMAPHORES,
1557      CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS,
1558      CONFIGURE_MAXIMUM_ITRON_MAILBOXES,
1559      CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS,
1560      CONFIGURE_MAXIMUM_ITRON_PORTS,
1561      CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS,
1562      CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS,
1563      CONFIGURE_ITRON_INIT_TASK_TABLE_SIZE,
1564      CONFIGURE_ITRON_INIT_TASK_TABLE_NAME
1565    };
1566  #endif
1567
1568  /** This variable specifies the minimum stack size for tasks in an RTEMS
1569   *  application.
1570   *
1571   *  @note This is left as a simple uint32_t so it can be externed as
1572   *        needed without requring being high enough logical to
1573   *        include the full configuration table.
1574   */
1575  uint32_t rtems_minimum_stack_size = 
1576    CONFIGURE_MINIMUM_TASK_STACK_SIZE;
1577
1578  /** This variable specifies the maximum priority value that
1579   *  a task may have.  This must be a power of 2 between 4
1580   *  and 256 and is specified in terms of Classic API
1581   *  priority values.
1582   *
1583   *  @note This is left as a simple uint8_t so it can be externed as
1584   *        needed without requring being high enough logical to
1585   *        include the full configuration table.
1586   */
1587  uint8_t rtems_maximum_priority = CONFIGURE_MAXIMUM_PRIORITY;
1588
1589  /**
1590   *  This is the primary Configuration Table for this application.
1591   */
1592  rtems_configuration_table Configuration = {
1593    CONFIGURE_EXECUTIVE_RAM_WORK_AREA,
1594    CONFIGURE_EXECUTIVE_RAM_SIZE,             /* required RTEMS workspace */
1595    CONFIGURE_MAXIMUM_USER_EXTENSIONS,        /* maximum dynamic extensions */
1596    CONFIGURE_MICROSECONDS_PER_TICK,          /* microseconds per clock tick */
1597    CONFIGURE_TICKS_PER_TIMESLICE,            /* ticks per timeslice quantum */
1598    CONFIGURE_IDLE_TASK_BODY,                 /* user's IDLE task */
1599    CONFIGURE_IDLE_TASK_STACK_SIZE,           /* IDLE task stack size */
1600    CONFIGURE_INTERRUPT_STACK_SIZE,           /* interrupt stack size */
1601    CONFIGURE_TASK_STACK_ALLOCATOR,           /* stack allocator */
1602    CONFIGURE_TASK_STACK_DEALLOCATOR,         /* stack deallocator */
1603    CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY,   /* true to clear memory */
1604    CONFIGURE_MAXIMUM_DRIVERS,                /* maximum device drivers */
1605    CONFIGURE_NUMBER_OF_DRIVERS,              /* static device drivers */
1606    Device_drivers,                           /* pointer to driver table */
1607    CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS,   /* number of static extensions */
1608    CONFIGURE_INITIAL_EXTENSION_TABLE,        /* pointer to static extensions */
1609    #if defined(RTEMS_MULTIPROCESSING)
1610      CONFIGURE_MULTIPROCESSING_TABLE,        /* pointer to MP config table */
1611    #endif
1612    &Configuration_RTEMS_API,                 /* pointer to RTEMS API config */
1613    #ifdef RTEMS_POSIX_API
1614      &Configuration_POSIX_API,               /* pointer to POSIX API config */
1615    #else
1616      NULL,                                   /* pointer to POSIX API config */
1617    #endif
1618    #ifdef RTEMS_ITRON_API
1619      &Configuration_ITRON_API                /* pointer to ITRON API config */
1620    #else
1621      NULL                                    /* pointer to ITRON API config */
1622    #endif
1623  };
1624#endif
1625
1626#endif /* CONFIGURE_HAS_OWN_CONFIGURATION_TABLE */
1627
1628/*
1629 *  If the user has configured a set of Classic API Initialization Tasks,
1630 *  then we need to install the code that runs that loop.
1631 */
1632#ifdef CONFIGURE_INIT
1633  #ifdef CONFIGURE_RTEMS_INIT_TASKS_TABLE
1634    void (_RTEMS_tasks_Initialize_user_tasks_body)(void);
1635    void (*_RTEMS_tasks_Initialize_user_tasks_p)(void) =
1636              _RTEMS_tasks_Initialize_user_tasks_body;
1637  #else
1638    void (*_RTEMS_tasks_Initialize_user_tasks_p)(void) = NULL;
1639  #endif
1640#endif
1641
1642/*
1643 *  If the user has configured a set of POSIX Initialization Threads,
1644 *  then we need to install the code that runs that loop.
1645 */
1646#ifdef RTEMS_POSIX_API
1647  #ifdef CONFIGURE_INIT
1648    #ifdef CONFIGURE_POSIX_INIT_THREAD_TABLE
1649      void _POSIX_Threads_Initialize_user_threads_body(void);
1650      void (*_POSIX_Threads_Initialize_user_threads_p)(void) = 
1651                _POSIX_Threads_Initialize_user_threads_body;
1652    #else
1653      void (*_POSIX_Threads_Initialize_user_threads_p)(void) = NULL;
1654    #endif
1655  #endif
1656#endif
1657
1658/*
1659 *  If the user has configured a set of ITRON Initialization Tasks,
1660 *  then we need to install the code that runs that loop.
1661 */
1662#ifdef RTEMS_ITRON_API
1663  #ifdef CONFIGURE_INIT
1664    #ifdef CONFIGURE_ITRON_INIT_TASK_TABLE
1665      void _ITRON_Task_Initialize_user_tasks_body(void);
1666      void (*_ITRON_Initialize_user_tasks_p)(void) = 
1667                _ITRON_Task_Initialize_user_tasks_body;
1668    #else
1669      void (*_ITRON_Initialize_user_tasks_p)(void) = NULL;
1670    #endif
1671  #endif
1672#endif
1673
1674#ifdef __cplusplus
1675}
1676#endif
1677
1678/******************************************************************
1679 ******************************************************************
1680 ******************************************************************
1681 *         CONFIGURATION WARNINGS AND ERROR CHECKING              *
1682 ******************************************************************
1683 ******************************************************************
1684 ******************************************************************
1685 */
1686
1687/*
1688 *  Make sure a task/thread of some sort is configured.
1689 *
1690 *  When analyzing RTEMS to find the smallest possible of memory
1691 *  that must be allocated, you probably do want to configure 0
1692 *  tasks/threads so there is a smaller set of calls to _Workspace_Allocate
1693 *  to analyze.
1694 */
1695#if !defined(CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION)
1696  #if (CONFIGURE_MAXIMUM_TASKS == 0) && \
1697      (CONFIGURE_MAXIMUM_POSIX_THREADS == 0) && \
1698      (CONFIGURE_MAXIMUM_ADA_TASKS == 0) &&  \
1699      (CONFIGURE_MAXIMUM_ITRON_TASKS == 0)
1700    #error "CONFIGURATION ERROR: No tasks or threads configured!!"
1701  #endif
1702#endif
1703
1704/*
1705 *  Make sure at least one of the initialization task/thread
1706 *  tables was defined.
1707 */
1708#if !defined(CONFIGURE_RTEMS_INIT_TASKS_TABLE) && \
1709    !defined(CONFIGURE_POSIX_INIT_THREAD_TABLE) && \
1710    !defined(CONFIGURE_ITRON_INIT_TASK_TABLE) && \
1711    !defined(CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION)
1712#error "CONFIGURATION ERROR: No initialization tasks or threads configured!!"
1713#endif
1714
1715/*
1716 *  If the user is trying to configure a multiprocessing application and
1717 *  RTEMS was not configured and built multiprocessing, then error out.
1718 */
1719#if defined(CONFIGURE_MP_APPLICATION) && \
1720    !defined(RTEMS_MULTIPROCESSING)
1721#error "CONFIGURATION ERROR: RTEMS not configured for multiprocessing!!"
1722#endif
1723
1724/*
1725 *  If an attempt was made to configure POSIX objects and
1726 *  the POSIX API was not configured into RTEMS, error out.
1727 */
1728#if !defined(RTEMS_POSIX_API)
1729  #if ((CONFIGURE_MAXIMUM_POSIX_THREADS != 0) || \
1730       (CONFIGURE_MAXIMUM_POSIX_MUTEXES != 0) || \
1731       (CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES != 0) || \
1732       (CONFIGURE_MAXIMUM_POSIX_KEYS != 0) || \
1733       (CONFIGURE_MAXIMUM_POSIX_TIMERS != 0) || \
1734       (CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS != 0) || \
1735       (CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES != 0) || \
1736       (CONFIGURE_MAXIMUM_POSIX_SEMAPHORES != 0) || \
1737       (CONFIGURE_MAXIMUM_POSIX_BARRIERS != 0) || \
1738       (CONFIGURE_MAXIMUM_POSIX_SPINLOCKS != 0) || \
1739       (CONFIGURE_MAXIMUM_POSIX_RWLOCKS != 0) || \
1740      defined(CONFIGURE_POSIX_INIT_THREAD_TABLE))
1741  #error "CONFIGURATION ERROR: POSIX API support not configured!!"
1742  #endif
1743#endif
1744
1745/*
1746 *  If an attempt was made to configure ITRON objects and
1747 *  the ITRON API was not configured into RTEMS, error out.
1748 */
1749#if !defined(RTEMS_ITRON_API)
1750  #if ((CONFIGURE_MAXIMUM_ITRON_TASKS != 0) || \
1751       (CONFIGURE_MAXIMUM_ITRON_SEMAPHORES != 0) || \
1752       (CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS != 0) || \
1753       (CONFIGURE_MAXIMUM_ITRON_MAILBOXES != 0) || \
1754       (CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS != 0) || \
1755       (CONFIGURE_MAXIMUM_ITRON_PORTS != 0) || \
1756       (CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS != 0) || \
1757       (CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS != 0) || \
1758      defined(CONFIGURE_ITRON_INIT_TASK_TABLE))
1759  #error "CONFIGURATION ERROR: ITRON API support not configured!!"
1760  #endif
1761#endif
1762
1763/*
1764 *  You must either explicity include or exclude the clock driver.
1765 *  It is such a common newbie error to leave it out.  Maybe this
1766 *  will put an end to it.
1767 * 
1768 *  NOTE: If you are using the timer driver, it is considered
1769 *        mutually exclusive with the clock driver because the
1770 *        drivers are assumed to use the same "timer" hardware
1771 *        on many boards.
1772 */
1773#if !defined(CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE)
1774  #if !defined(CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER) && \
1775      !defined(CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER) && \
1776      !defined(CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER)
1777    #error "CONFIGURATION ERROR: Do you want the clock driver or not?!?"
1778   #endif
1779#endif
1780
1781/*
1782 *  These names have been obsoleted so make the user application stop compiling
1783 */
1784#if defined(CONFIGURE_TEST_NEEDS_TIMER_DRIVER) || \
1785    defined(CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER) || \
1786    defined(CONFIGURE_TEST_NEEDS_CLOCK_DRIVER) || \
1787    defined(CONFIGURE_TEST_NEEDS_RTC_DRIVER) || \
1788    defined(CONFIGURE_TEST_NEEDS_STUB_DRIVER)
1789#error "CONFIGURATION ERROR: CONFIGURE_TEST_XXX constants are obsolete"
1790#endif
1791
1792/*
1793 *  Validate the configured maximum priority
1794 */
1795#if ((CONFIGURE_MAXIMUM_PRIORITY != 3) && \
1796     (CONFIGURE_MAXIMUM_PRIORITY != 7) && \
1797     (CONFIGURE_MAXIMUM_PRIORITY != 15) && \
1798     (CONFIGURE_MAXIMUM_PRIORITY != 31) && \
1799     (CONFIGURE_MAXIMUM_PRIORITY != 63) && \
1800     (CONFIGURE_MAXIMUM_PRIORITY != 127) && \
1801     (CONFIGURE_MAXIMUM_PRIORITY != 255))
1802  #error "Maximum priority is not 1 less than a power of 2 between 4 and 256"
1803#endif
1804   
1805#if (CONFIGURE_MAXIMUM_PRIORITY > PRIORITY_DEFAULT_MAXIMUM)
1806  #error "Maximum priority configured higher than supported by target."
1807#endif
1808
1809#endif
1810/* end of include file */
Note: See TracBrowser for help on using the repository browser.