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

4.104.114.84.95
Last change on this file since c461430 was c461430, checked in by Ralf Corsepius <ralf.corsepius@…>, on Oct 18, 2006 at 10:43:41 AM

2006-10-18 Ralf Corsépius <ralf.corsepius@…>

  • sapi/include/confdefs.h: s/STACK_CHECKER_EXTENSION/RTEMS_STACK_CHECKER_EXTENSION/ (Reflect 2006-09-13's changes to libmisc/stackchk).
  • Property mode set to 100644
File size: 35.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-2006.
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#ifdef __cplusplus
43extern "C" {
44#endif
45
46/*
47 * Include the executive's configuration
48 */
49#include <rtems/score/cpuopts.h>
50#include <rtems/score/apimutex.h>
51
52extern rtems_initialization_tasks_table Initialization_tasks[];
53extern rtems_driver_address_table       Device_drivers[];
54extern rtems_configuration_table        Configuration;
55extern rtems_multiprocessing_table      Multiprocessing_configuration;
56#ifdef RTEMS_POSIX_API
57extern posix_api_configuration_table    Configuration_POSIX_API;
58#endif
59#ifdef RTEMS_ITRON_API
60extern itron_api_configuration_table    Configuration_ITRON_API;
61#endif
62
63/*
64 *  RTEMS C Library and Newlib support
65 */
66
67#ifdef RTEMS_NEWLIB
68#define CONFIGURE_NEWLIB_EXTENSION 1
69#else
70#define CONFIGURE_NEWLIB_EXTENSION 0
71#endif
72
73#define CONFIGURE_MALLOC_REGION 1
74
75/*
76 *  File descriptors managed by libio
77 */
78
79#ifndef CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS
80#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 3
81#endif
82
83#define CONFIGURE_LIBIO_SEMAPHORES \
84  (CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS + 1)
85
86#ifdef CONFIGURE_INIT
87uint32_t   rtems_libio_number_iops = CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS;
88#endif
89
90/*
91 *  Termios resources
92 */
93
94#ifdef CONFIGURE_TERMIOS_DISABLED
95#define CONFIGURE_TERMIOS_SEMAPHORES 0
96#else
97
98#ifndef CONFIGURE_NUMBER_OF_TERMIOS_PORTS
99#define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 1
100#endif
101
102#define CONFIGURE_TERMIOS_SEMAPHORES \
103  ((CONFIGURE_NUMBER_OF_TERMIOS_PORTS * 4) + 1)
104#endif
105
106/*
107 *  PTYs
108 */
109
110#ifndef CONFIGURE_MAXIMUM_PTYS
111#define CONFIGURE_MAXIMUM_PTYS 0
112#endif
113
114#ifdef CONFIGURE_INIT
115int rtems_telnetd_maximum_ptys = CONFIGURE_MAXIMUM_PTYS;
116#else
117extern int rtems_telnetd_maximum_ptys;
118#endif
119
120/*
121 *  Mount Table Configuration
122 */
123
124#include <rtems/imfs.h>
125
126#ifndef CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK
127#define CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK \
128                  IMFS_MEMFILE_DEFAULT_BYTES_PER_BLOCK
129#endif
130#ifdef CONFIGURE_INIT
131  int imfs_rq_memfile_bytes_per_block = CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK;
132#endif /* CONFIGURE_INIT */
133
134#ifdef CONFIGURE_INIT
135#ifndef CONFIGURE_HAS_OWN_MOUNT_TABLE
136rtems_filesystem_mount_table_t configuration_mount_table = {
137#ifdef CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
138  &IMFS_ops,
139#else  /* using miniIMFS as base filesystem */
140  &miniIMFS_ops,
141#endif
142  RTEMS_FILESYSTEM_READ_WRITE,
143  NULL,
144  NULL
145};
146
147rtems_filesystem_mount_table_t
148    *rtems_filesystem_mount_table = &configuration_mount_table;
149int rtems_filesystem_mount_table_size = 1;
150#endif
151
152#endif
153
154
155/*
156 *  Stack Checker Requirements
157 *
158 *  NOTE: This does not automatically enable reporting at program exit.
159 */
160
161#ifdef STACK_CHECKER_ON
162#define CONFIGURE_STACK_CHECKER_EXTENSION 1
163#else
164#define CONFIGURE_STACK_CHECKER_EXTENSION 0
165#endif
166
167/*
168 *  Interrupt Stack Space
169 *
170 *  NOTE: There is currently no way for the application to override
171 *        the interrupt stack size set by the BSP.
172 */
173
174#if (CPU_ALLOCATE_INTERRUPT_STACK == 0)
175#undef CONFIGURE_INTERRUPT_STACK_MEMORY
176#define CONFIGURE_INTERRUPT_STACK_MEMORY 0
177#else
178  #ifndef CONFIGURE_INTERRUPT_STACK_MEMORY
179  #define CONFIGURE_INTERRUPT_STACK_MEMORY RTEMS_MINIMUM_STACK_SIZE
180  #endif
181#endif
182
183/*
184 *  Default User Initialization Task Table.  This table guarantees that
185 *  one user initialization table is defined.
186 */
187
188#ifdef CONFIGURE_RTEMS_INIT_TASKS_TABLE
189
190#ifdef CONFIGURE_HAS_OWN_INIT_TASK_TABLE
191
192/*
193 *  The user is defining their own table information and setting the
194 *  appropriate variables.
195 */
196
197#else
198
199#ifndef CONFIGURE_INIT_TASK_NAME
200#define CONFIGURE_INIT_TASK_NAME          rtems_build_name( 'U', 'I', '1', ' ' )
201#endif
202
203#ifndef CONFIGURE_INIT_TASK_STACK_SIZE
204#define CONFIGURE_INIT_TASK_STACK_SIZE    RTEMS_MINIMUM_STACK_SIZE
205#endif
206
207#ifndef CONFIGURE_INIT_TASK_PRIORITY
208#define CONFIGURE_INIT_TASK_PRIORITY      1
209#endif
210
211#ifndef CONFIGURE_INIT_TASK_ATTRIBUTES
212#define CONFIGURE_INIT_TASK_ATTRIBUTES    RTEMS_DEFAULT_ATTRIBUTES
213#endif
214
215#ifndef CONFIGURE_INIT_TASK_ENTRY_POINT
216#define CONFIGURE_INIT_TASK_ENTRY_POINT   Init
217#endif
218
219#ifndef CONFIGURE_INIT_TASK_INITIAL_MODES
220#define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_NO_PREEMPT
221#endif
222
223#ifndef CONFIGURE_INIT_TASK_ARGUMENTS
224#define CONFIGURE_INIT_TASK_ARGUMENTS     0
225#endif
226
227#ifdef CONFIGURE_INIT
228rtems_initialization_tasks_table Initialization_tasks[] = {
229  { CONFIGURE_INIT_TASK_NAME,
230    CONFIGURE_INIT_TASK_STACK_SIZE,
231    CONFIGURE_INIT_TASK_PRIORITY,
232    CONFIGURE_INIT_TASK_ATTRIBUTES,
233    CONFIGURE_INIT_TASK_ENTRY_POINT,
234    CONFIGURE_INIT_TASK_INITIAL_MODES,
235    CONFIGURE_INIT_TASK_ARGUMENTS
236  }
237};
238#endif
239
240#define CONFIGURE_INIT_TASK_TABLE Initialization_tasks
241
242#define CONFIGURE_INIT_TASK_TABLE_SIZE \
243  sizeof(CONFIGURE_INIT_TASK_TABLE) / sizeof(rtems_initialization_tasks_table)
244
245#endif    /* CONFIGURE_HAS_OWN_INIT_TASK_TABLE */
246
247#else     /* CONFIGURE_RTEMS_INIT_TASKS_TABLE */
248
249#define CONFIGURE_INIT_TASK_TABLE      NULL
250#define CONFIGURE_INIT_TASK_TABLE_SIZE 0
251#define CONFIGURE_INIT_TASK_STACK_SIZE 0
252
253#endif
254
255/*
256 *  Map obsolete names to current ones
257 *
258 *  NOTE: These should be obsoleted in a future release.
259 */
260
261#ifdef CONFIGURE_TEST_NEEDS_TIMER_DRIVER
262#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
263#endif
264#ifdef CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
265#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
266#endif
267#ifdef CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
268#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
269#endif
270#ifdef CONFIGURE_TEST_NEEDS_RTC_DRIVER
271#define CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER
272#endif
273#ifdef CONFIGURE_TEST_NEEDS_STUB_DRIVER
274#define CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER
275#endif
276
277
278/*
279 *  Default Device Driver Table.  Each driver needed by the test is explicitly
280 *  choosen by that test.  There is always a null driver entry.
281 */
282
283#define NULL_DRIVER_TABLE_ENTRY \
284 { NULL, NULL, NULL, NULL, NULL, NULL }
285
286#ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
287#include <rtems/console.h>
288#endif
289
290#ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
291#include <rtems/clockdrv.h>
292#endif
293
294#ifdef CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
295#include <rtems/timerdrv.h>
296#endif
297
298#ifdef CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER
299#include <rtems/rtc.h>
300#endif
301
302#ifdef CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER
303#include <rtems/devnull.h>
304#endif
305
306#ifdef CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER
307  /* the ide driver needs the ATA driver */
308#  ifndef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
309#  define CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
310#  endif
311#include <libchip/ide_ctrl.h>
312#endif
313
314#ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
315#include <libchip/ata.h>
316#endif
317
318#ifndef CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE
319
320#ifdef CONFIGURE_INIT
321rtems_driver_address_table Device_drivers[] = {
322#ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
323  CONSOLE_DRIVER_TABLE_ENTRY,
324#endif
325#ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
326  CLOCK_DRIVER_TABLE_ENTRY,
327#endif
328#ifdef CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER
329  RTC_DRIVER_TABLE_ENTRY,
330#endif
331#ifdef CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER
332  DEVNULL_DRIVER_TABLE_ENTRY,
333#endif
334#ifdef CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER
335  IDE_CONTROLLER_DRIVER_TABLE_ENTRY,
336#endif
337#ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
338  ATA_DRIVER_TABLE_ENTRY,
339#endif
340#ifdef CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER
341  NULL_DRIVER_TABLE_ENTRY
342#elif !defined(CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER) && \
343    !defined(CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER) && \
344    !defined(CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER) && \
345    !defined(CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER) && \
346    !defined(CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER)  && \
347    !defined(CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER)
348  NULL_DRIVER_TABLE_ENTRY
349#endif
350};
351#endif
352
353#endif  /* CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE */
354
355/*
356 *  Default the number of drivers per node.  This value may be
357 *  overridden by the user.
358 */
359
360#define CONFIGURE_NUMBER_OF_DRIVERS \
361  ((sizeof(Device_drivers) / sizeof(rtems_driver_address_table)))
362
363#ifndef CONFIGURE_MAXIMUM_DRIVERS
364#define CONFIGURE_MAXIMUM_DRIVERS CONFIGURE_NUMBER_OF_DRIVERS
365#endif
366
367/*
368 *  Default the number of devices per device driver.  This value may be
369 *  overridden by the user.
370 */
371
372#ifndef CONFIGURE_MAXIMUM_DEVICES
373#define CONFIGURE_MAXIMUM_DEVICES   20
374#endif
375
376#ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
377  /*
378   * configure the priority of the ATA driver task
379   */
380#  ifndef CONFIGURE_ATA_DRIVER_TASK_PRIORITY
381#    define CONFIGURE_ATA_DRIVER_TASK_PRIORITY ATA_DRIVER_TASK_DEFAULT_PRIORITY
382#  endif
383#  ifdef CONFIGURE_INIT
384  rtems_task_priority ata_driver_task_priority
385    = CONFIGURE_ATA_DRIVER_TASK_PRIORITY;
386#  endif /* CONFIGURE_INIT */
387#endif
388
389/*
390 * add bdbuf configuration and values for swapout task priority
391 */
392#ifdef CONFIGURE_APPLICATION_NEEDS_LIBBLOCK
393#include <rtems/bdbuf.h>
394/*
395 * configure the priority of the bdbuf swapout task
396 */
397#ifndef CONFIGURE_SWAPOUT_TASK_PRIORITY
398#define CONFIGURE_SWAPOUT_TASK_PRIORITY SWAPOUT_TASK_DEFAULT_PRIORITY
399#endif
400#ifdef CONFIGURE_INIT
401  rtems_task_priority swapout_task_priority
402    = CONFIGURE_SWAPOUT_TASK_PRIORITY;
403#endif  /* CONFIGURE_INIT */
404#ifndef CONFIGURE_HAS_OWN_BDBUF_TABLE
405
406#ifndef CONFIGURE_BDBUF_BUFFER_COUNT
407#define CONFIGURE_BDBUF_BUFFER_COUNT 64
408#endif /* CONFIGURE_BDBUF_BUFFER_COUNT */
409
410#ifndef CONFIGURE_BDBUF_BUFFER_SIZE
411#define CONFIGURE_BDBUF_BUFFER_SIZE 512
412#endif /* CONFIGURE_BDBUF_BUFFER_SIZE */
413#ifdef CONFIGURE_INIT
414rtems_bdbuf_config rtems_bdbuf_configuration[] = {
415  {CONFIGURE_BDBUF_BUFFER_SIZE,CONFIGURE_BDBUF_BUFFER_COUNT,NULL}
416};
417int rtems_bdbuf_configuration_size =( sizeof(rtems_bdbuf_configuration)
418                                     /sizeof(rtems_bdbuf_configuration[0]));
419#endif /* CONFIGURE_INIT */
420#endif /* CONFIGURE_HAS_OWN_BDBUF_TABLE        */
421#endif /* CONFIGURE_APPLICATION_NEEDS_LIBBLOCK */
422/*
423 *  Default Multiprocessing Configuration Table.  The defaults are
424 *  appropriate for most of the RTEMS Multiprocessor Test Suite.  Each
425 *  value may be overridden within each test to customize the environment.
426 */
427
428#ifdef CONFIGURE_MP_APPLICATION
429#ifndef CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE
430
431#ifndef CONFIGURE_MP_NODE_NUMBER
432#define CONFIGURE_MP_NODE_NUMBER                NODE_NUMBER
433#endif
434
435#ifndef CONFIGURE_MP_MAXIMUM_NODES
436#define CONFIGURE_MP_MAXIMUM_NODES              2
437#endif
438
439#ifndef CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS
440#define CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS     32
441#endif
442
443#ifndef CONFIGURE_MP_MAXIMUM_PROXIES
444#define CONFIGURE_MP_MAXIMUM_PROXIES            32
445#endif
446
447#ifndef CONFIGURE_MP_MPCI_TABLE_POINTER
448#include <mpci.h>
449#define CONFIGURE_MP_MPCI_TABLE_POINTER         &MPCI_table
450#endif
451
452#ifdef CONFIGURE_INIT
453rtems_multiprocessing_table Multiprocessing_configuration = {
454  CONFIGURE_MP_NODE_NUMBER,              /* local node number */
455  CONFIGURE_MP_MAXIMUM_NODES,            /* maximum # nodes in system */
456  CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS,   /* maximum # global objects */
457  CONFIGURE_MP_MAXIMUM_PROXIES,          /* maximum # proxies */
458  CONFIGURE_MP_MPCI_TABLE_POINTER        /* pointer to MPCI config table */
459};
460#endif
461
462#define CONFIGURE_MULTIPROCESSING_TABLE    &Multiprocessing_configuration
463
464#endif /* CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE */
465
466#else
467
468#define CONFIGURE_MULTIPROCESSING_TABLE    NULL
469
470#endif /* CONFIGURE_MP_APPLICATION */
471
472/*
473 *  Default Configuration Table.
474 */
475
476#ifndef CONFIGURE_HAS_OWN_CONFIGURATION_TABLE
477
478#ifndef CONFIGURE_EXECUTIVE_RAM_WORK_AREA
479#define CONFIGURE_EXECUTIVE_RAM_WORK_AREA     NULL
480#endif
481
482#ifndef CONFIGURE_MAXIMUM_TASKS
483#define CONFIGURE_MAXIMUM_TASKS               0
484#endif
485
486#ifndef CONFIGURE_MAXIMUM_TIMERS
487#define CONFIGURE_MAXIMUM_TIMERS              0
488#endif
489
490#ifndef CONFIGURE_MAXIMUM_SEMAPHORES
491#define CONFIGURE_MAXIMUM_SEMAPHORES          0
492#endif
493
494#ifndef CONFIGURE_MAXIMUM_MESSAGE_QUEUES
495#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES      0
496#endif
497
498#ifndef CONFIGURE_MAXIMUM_PARTITIONS
499#define CONFIGURE_MAXIMUM_PARTITIONS          0
500#endif
501
502#ifndef CONFIGURE_MAXIMUM_REGIONS
503#define CONFIGURE_MAXIMUM_REGIONS             0
504#endif
505
506#ifndef CONFIGURE_MAXIMUM_PORTS
507#define CONFIGURE_MAXIMUM_PORTS               0
508#endif
509
510#ifndef CONFIGURE_MAXIMUM_PERIODS
511#define CONFIGURE_MAXIMUM_PERIODS             0
512#endif
513
514#ifndef CONFIGURE_MAXIMUM_BARRIERS
515#define CONFIGURE_MAXIMUM_BARRIERS            0
516#endif
517
518#ifndef CONFIGURE_MAXIMUM_USER_EXTENSIONS
519#define CONFIGURE_MAXIMUM_USER_EXTENSIONS     0
520#endif
521
522#ifndef CONFIGURE_MICROSECONDS_PER_TICK
523#define CONFIGURE_MICROSECONDS_PER_TICK RTEMS_MILLISECONDS_TO_MICROSECONDS(10)
524#endif
525
526#ifndef CONFIGURE_TICKS_PER_TIMESLICE
527#define CONFIGURE_TICKS_PER_TIMESLICE        50
528#endif
529
530/*
531 *  Initial Extension Set
532 */
533
534#ifdef CONFIGURE_INIT
535#ifdef STACK_CHECKER_ON
536#include <rtems/stackchk.h>
537#endif
538
539#if defined(CONFIGURE_INITIAL_EXTENSIONS) || \
540    defined(STACK_CHECKER_ON)
541rtems_extensions_table Configuration_Initial_Extensions[] = {
542#ifdef CONFIGURE_INITIAL_EXTENSIONS
543    CONFIGURE_INITIAL_EXTENSIONS,
544#endif
545#ifdef STACK_CHECKER_ON
546    RTEMS_STACK_CHECKER_EXTENSION,
547#endif
548};
549
550#define CONFIGURE_INITIAL_EXTENSION_TABLE Configuration_Initial_Extensions
551#define CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS \
552  ((sizeof(Configuration_Initial_Extensions) / \
553    sizeof(rtems_extensions_table)))
554#else
555#define CONFIGURE_INITIAL_EXTENSION_TABLE NULL
556#define CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS 0
557#endif
558
559
560#endif
561
562/*
563 *  POSIX API Configuration Parameters
564 */
565
566#ifdef RTEMS_POSIX_API
567
568#include <sys/types.h>
569#include <signal.h>
570#include <limits.h>
571#include <mqueue.h>
572/* #include <rtems/posix/barrier.h> */
573#include <rtems/posix/cond.h>
574#include <rtems/posix/mqueue.h>
575#include <rtems/posix/mutex.h>
576#include <rtems/posix/key.h>
577#include <rtems/posix/psignal.h>
578/* #include <rtems/posix/rwlock.h> */
579#include <rtems/posix/semaphore.h>
580/* #include <rtems/posix/spinlock.h> */
581#include <rtems/posix/threadsup.h>
582#include <rtems/posix/timer.h>
583
584#ifndef CONFIGURE_MAXIMUM_POSIX_THREADS
585#define CONFIGURE_MAXIMUM_POSIX_THREADS      0
586#endif
587
588#ifndef CONFIGURE_MAXIMUM_POSIX_MUTEXES
589#define CONFIGURE_MAXIMUM_POSIX_MUTEXES      0
590#endif
591
592#ifndef CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES
593#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES  0
594#endif
595
596#ifndef CONFIGURE_MAXIMUM_POSIX_KEYS
597#define CONFIGURE_MAXIMUM_POSIX_KEYS         0
598#endif
599
600#ifndef CONFIGURE_MAXIMUM_POSIX_TIMERS
601#define CONFIGURE_MAXIMUM_POSIX_TIMERS 0
602#endif
603
604#ifndef CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS
605#define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS 0
606#endif
607
608#ifndef CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES
609#define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES 0
610#endif
611
612#ifndef CONFIGURE_MAXIMUM_POSIX_SEMAPHORES
613#define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES 0
614#endif
615
616#ifndef CONFIGURE_MAXIMUM_POSIX_BARRIERS
617#define CONFIGURE_MAXIMUM_POSIX_BARRIERS 0
618#endif
619
620#ifndef CONFIGURE_MAXIMUM_POSIX_SPINLOCKS
621#define CONFIGURE_MAXIMUM_POSIX_SPINLOCKS 0
622#endif
623
624#ifndef CONFIGURE_MAXIMUM_POSIX_RWLOCKS
625#define CONFIGURE_MAXIMUM_POSIX_RWLOCKS 0
626#endif
627
628#ifdef CONFIGURE_POSIX_INIT_THREAD_TABLE
629
630#ifdef CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE
631
632/*
633 *  The user is defining their own table information and setting the
634 *  appropriate variables for the POSIX Initialization Thread Table.
635 */
636
637#else
638
639#ifndef CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT
640#define CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT   POSIX_Init
641#endif
642
643#ifndef CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE
644#define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE    (RTEMS_MINIMUM_STACK_SIZE * 2)
645#endif
646
647#ifdef CONFIGURE_INIT
648posix_initialization_threads_table POSIX_Initialization_threads[] = {
649  { CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT, \
650      CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE }
651};
652#endif
653
654#define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME POSIX_Initialization_threads
655
656#define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE \
657  sizeof(CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME) / \
658      sizeof(posix_initialization_threads_table)
659
660#endif    /* CONFIGURE_POSIX_HAS_OWN_INIT_TASK_TABLE */
661
662#else     /* CONFIGURE_POSIX_INIT_THREAD_TABLE */
663
664#define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME NULL
665#define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE 0
666
667#endif
668
669#define CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API \
670  ( \
671    sizeof (POSIX_API_Control) + \
672   (sizeof (void *) * (CONFIGURE_GNAT_KEYS + CONFIGURE_MAXIMUM_POSIX_KEYS)) \
673  )
674
675#define CONFIGURE_MEMORY_FOR_POSIX_MUTEXES(_mutexes) \
676  ((_mutexes) * \
677   ( sizeof(POSIX_Mutex_Control) + CONFIGURE_OBJECT_TABLE_STUFF + \
678     NAME_MAX ) )
679
680#define CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES(_condition_variables) \
681  ((_condition_variables) * \
682   ( sizeof(POSIX_Condition_variables_Control) + \
683        CONFIGURE_OBJECT_TABLE_STUFF ) )
684
685#define CONFIGURE_MEMORY_FOR_POSIX_KEYS(_keys) \
686  ((_keys) * \
687   ( sizeof(POSIX_Keys_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
688
689#define CONFIGURE_MEMORY_FOR_POSIX_TIMERS(_timers) \
690   ((_timers) * (sizeof(POSIX_Timer_Control) + CONFIGURE_OBJECT_TABLE_STUFF))
691
692#define CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS(_queued_signals) \
693  ((_queued_signals) * \
694   ( sizeof(POSIX_signals_Siginfo_node) + CONFIGURE_OBJECT_TABLE_STUFF ) )
695
696#define CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES(_message_queues) \
697  ((_message_queues) * \
698   ( sizeof( POSIX_Message_queue_Control) + \
699    CONFIGURE_OBJECT_TABLE_STUFF + \
700    NAME_MAX ) )
701
702#define CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES(_semaphores) \
703  ((_semaphores) * \
704   ( sizeof( POSIX_Semaphore_Control) + \
705    CONFIGURE_OBJECT_TABLE_STUFF + \
706    NAME_MAX ) )
707
708#define CONFIGURE_MEMORY_FOR_POSIX_BARRIERS(_barriers) 0
709#define CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS(_spinlocks) 0
710#define CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS(_rwlocks) 0
711
712#if 0
713#define CONFIGURE_MEMORY_FOR_POSIX_BARRIERS(_barriers) \
714  ((_barriers) * \
715   ( sizeof( POSIX_Barrier_Control) + \
716    CONFIGURE_OBJECT_TABLE_STUFF + \
717    NAME_MAX ) )
718
719#define CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS(_spinlocks) \
720  ((_spinlocks) * \
721   ( sizeof( POSIX_Spinlock_Control) + \
722    CONFIGURE_OBJECT_TABLE_STUFF + \
723    NAME_MAX ) )
724
725#define CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS(_rwlocks) \
726  ((_rwlocks) * \
727   ( sizeof( POSIX_RWLock_Control) + \
728    CONFIGURE_OBJECT_TABLE_STUFF + \
729    NAME_MAX ) )
730#endif
731
732#define CONFIGURE_MEMORY_FOR_POSIX \
733  ( \
734    CONFIGURE_MEMORY_FOR_POSIX_MUTEXES( CONFIGURE_MAXIMUM_POSIX_MUTEXES ) + \
735    CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES( \
736        CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES ) + \
737    CONFIGURE_MEMORY_FOR_POSIX_KEYS( CONFIGURE_MAXIMUM_POSIX_KEYS ) + \
738    CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS( \
739        CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS ) + \
740    CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES( \
741        CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES ) + \
742    CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES( \
743        CONFIGURE_MAXIMUM_POSIX_SEMAPHORES ) + \
744    CONFIGURE_MEMORY_FOR_POSIX_BARRIERS( CONFIGURE_MAXIMUM_POSIX_BARRIERS ) + \
745    CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS( \
746        CONFIGURE_MAXIMUM_POSIX_SPINLOCKS ) + \
747    CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS( \
748        CONFIGURE_MAXIMUM_POSIX_RWLOCKS ) + \
749    CONFIGURE_MEMORY_FOR_POSIX_TIMERS( CONFIGURE_MAXIMUM_POSIX_TIMERS ) + \
750    (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE) \
751   )
752#else
753
754#define CONFIGURE_MAXIMUM_POSIX_THREADS         0
755#define CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API 0
756#define CONFIGURE_MEMORY_FOR_POSIX              0
757
758
759#endif    /* RTEMS_POSIX_API */
760
761#ifndef CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE
762#define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE    0
763#endif
764
765/*
766 *  ITRON API Configuration Parameters
767 */
768
769#ifdef RTEMS_ITRON_API
770
771#include <rtems/itron.h>
772#include <rtems/itron/config.h>
773#include <rtems/itron/eventflags.h>
774#include <rtems/itron/fmempool.h>
775#include <rtems/itron/mbox.h>
776#include <rtems/itron/msgbuffer.h>
777#include <rtems/itron/port.h>
778#include <rtems/itron/semaphore.h>
779#include <rtems/itron/task.h>
780#include <rtems/itron/vmempool.h>
781
782#ifndef CONFIGURE_MAXIMUM_ITRON_TASKS
783#define CONFIGURE_MAXIMUM_ITRON_TASKS      0
784#endif
785
786#ifndef CONFIGURE_MAXIMUM_ITRON_SEMAPHORES
787#define CONFIGURE_MAXIMUM_ITRON_SEMAPHORES   0
788#endif
789
790#ifndef CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS
791#define CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS   0
792#endif
793
794#ifndef CONFIGURE_MAXIMUM_ITRON_MAILBOXES
795#define CONFIGURE_MAXIMUM_ITRON_MAILBOXES   0
796#endif
797
798#ifndef CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS
799#define CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS   0
800#endif
801
802#ifndef CONFIGURE_MAXIMUM_ITRON_PORTS
803#define CONFIGURE_MAXIMUM_ITRON_PORTS   0
804#endif
805
806#ifndef CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS
807#define CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS   0
808#endif
809
810#ifndef CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS
811#define CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS   0
812#endif
813
814#ifdef CONFIGURE_ITRON_INIT_TASK_TABLE
815
816#ifdef CONFIGURE_ITRON_HAS_OWN_INIT_TASK_TABLE
817
818/*
819 *  The user is defining their own table information and setting the
820 *  appropriate variables for the ITRON Initialization Task Table.
821 */
822
823#else
824
825#ifndef CONFIGURE_ITRON_INIT_TASK_ENTRY_POINT
826#define CONFIGURE_ITRON_INIT_TASK_ENTRY_POINT   ITRON_Init
827#endif
828
829#ifndef CONFIGURE_ITRON_INIT_TASK_ATTRIBUTES
830#define CONFIGURE_ITRON_INIT_TASK_ATTRIBUTES    TA_HLNG
831#endif
832
833#ifndef CONFIGURE_ITRON_INIT_TASK_PRIORITY
834#define CONFIGURE_ITRON_INIT_TASK_PRIORITY      1
835#endif
836
837#ifndef CONFIGURE_ITRON_INIT_TASK_STACK_SIZE
838#define CONFIGURE_ITRON_INIT_TASK_STACK_SIZE    RTEMS_MINIMUM_STACK_SIZE
839#endif
840
841#ifdef CONFIGURE_INIT
842itron_initialization_tasks_table ITRON_Initialization_tasks[] = {
843  { 1,                                    /* ID */
844    { (VP) 0,                                /* exinfo */
845      CONFIGURE_ITRON_INIT_TASK_ATTRIBUTES,  /* task attributes */
846      CONFIGURE_ITRON_INIT_TASK_ENTRY_POINT, /* task start address */
847      CONFIGURE_ITRON_INIT_TASK_PRIORITY,    /* initial task priority */
848      CONFIGURE_ITRON_INIT_TASK_STACK_SIZE   /* stack size */
849    }
850  }
851};
852#endif
853
854#define CONFIGURE_ITRON_INIT_TASK_TABLE_NAME ITRON_Initialization_tasks
855
856#define CONFIGURE_ITRON_INIT_TASK_TABLE_SIZE \
857  sizeof(CONFIGURE_ITRON_INIT_TASK_TABLE_NAME) / \
858      sizeof(itron_initialization_tasks_table)
859
860#endif    /* CONFIGURE_ITRON_HAS_OWN_INIT_TASK_TABLE */
861
862#else     /* CONFIGURE_ITRON_INIT_TASK_TABLE */
863
864#define CONFIGURE_ITRON_INIT_TASK_TABLE_NAME NULL
865#define CONFIGURE_ITRON_INIT_TASK_TABLE_SIZE 0
866
867#endif
868
869#define CONFIGURE_MEMORY_PER_TASK_FOR_ITRON_API \
870  ( \
871    sizeof (ITRON_API_Control) \
872  )
873
874#define CONFIGURE_MEMORY_FOR_ITRON_SEMAPHORES(_semaphores) \
875  ((_semaphores) * \
876   ( sizeof(ITRON_Semaphore_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
877
878#define CONFIGURE_MEMORY_FOR_ITRON_EVENTFLAGS(_eventflags) \
879  ((_eventflags) * \
880   ( sizeof(ITRON_Eventflags_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
881
882#define CONFIGURE_MEMORY_FOR_ITRON_MAILBOXES(_mailboxes) \
883  ((_mailboxes) * \
884   ( sizeof(ITRON_Mailbox_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
885
886#define CONFIGURE_MEMORY_FOR_ITRON_MESSAGE_BUFFERS(_message_buffers) \
887  ((_message_buffers) * \
888   ( sizeof(ITRON_Message_buffer_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
889
890#define CONFIGURE_MEMORY_FOR_ITRON_PORTS(_ports) \
891  ((_ports) * \
892   ( sizeof(ITRON_Port_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
893
894#define CONFIGURE_MEMORY_FOR_ITRON_MEMORY_POOLS(_memory_pools) \
895  ((_memory_pools) * \
896   (sizeof(ITRON_Variable_memory_pool_Control) + CONFIGURE_OBJECT_TABLE_STUFF))
897
898#define CONFIGURE_MEMORY_FOR_ITRON_FIXED_MEMORY_POOLS(_fixed_memory_pools) \
899  ((_fixed_memory_pools) * \
900   ( sizeof(ITRON_Fixed_memory_pool_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
901
902#ifndef CONFIGURE_ITRON_INIT_TASK_STACK_SIZE
903#define CONFIGURE_ITRON_INIT_TASK_STACK_SIZE (RTEMS_MINIMUM_STACK_SIZE * 2)
904#endif
905
906
907#define CONFIGURE_MEMORY_FOR_ITRON \
908  ( \
909    CONFIGURE_MEMORY_FOR_ITRON_SEMAPHORES( \
910        CONFIGURE_MAXIMUM_ITRON_SEMAPHORES ) + \
911    CONFIGURE_MEMORY_FOR_ITRON_EVENTFLAGS( \
912        CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS ) + \
913    CONFIGURE_MEMORY_FOR_ITRON_MAILBOXES( \
914        CONFIGURE_MAXIMUM_ITRON_MAILBOXES ) + \
915    CONFIGURE_MEMORY_FOR_ITRON_MESSAGE_BUFFERS( \
916        CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS ) + \
917    CONFIGURE_MEMORY_FOR_ITRON_PORTS( \
918        CONFIGURE_MAXIMUM_ITRON_PORTS ) + \
919    CONFIGURE_MEMORY_FOR_ITRON_MEMORY_POOLS( \
920        CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS ) + \
921    CONFIGURE_MEMORY_FOR_ITRON_FIXED_MEMORY_POOLS( \
922        CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS ) + \
923    CONFIGURE_ITRON_INIT_TASK_STACK_SIZE \
924   )
925
926
927#else
928
929#define CONFIGURE_MAXIMUM_ITRON_TASKS               0
930#define CONFIGURE_MAXIMUM_ITRON_SEMAPHORES          0
931#define CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS          0
932#define CONFIGURE_MAXIMUM_ITRON_MAILBOXES           0
933#define CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS     0
934#define CONFIGURE_MAXIMUM_ITRON_PORTS               0
935#define CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS        0
936#define CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS  0
937#define CONFIGURE_MEMORY_PER_TASK_FOR_ITRON_API     0
938#define CONFIGURE_MEMORY_FOR_ITRON                  0
939
940#endif    /* RTEMS_ITRON_API */
941
942
943/*
944 *  Calculate the RAM size based on the maximum number of objects configured.
945 */
946
947#ifndef CONFIGURE_EXECUTIVE_RAM_SIZE
948
949#define CONFIGURE_OBJECT_TABLE_STUFF \
950  ( sizeof(Objects_Control *) + sizeof(rtems_name *) + sizeof(rtems_name) )
951
952#if defined(RTEMS_NEWLIB)
953#include <reent.h>
954
955#define CONFIGURE_MEMORY_PER_TASK_FOR_LIBC_REENTRANCY sizeof(struct _reent)
956#else
957#define CONFIGURE_MEMORY_PER_TASK_FOR_LIBC_REENTRANCY 0
958#endif
959
960#define CONFIGURE_MEMORY_FOR_TASKS(_tasks) \
961  (((_tasks) + 1 ) * \
962   ((sizeof(Thread_Control) + CONTEXT_FP_SIZE + \
963      STACK_MINIMUM_SIZE + sizeof( RTEMS_API_Control ) + \
964      CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API + \
965      CONFIGURE_MEMORY_PER_TASK_FOR_ITRON_API + \
966      CONFIGURE_MEMORY_PER_TASK_FOR_LIBC_REENTRANCY + \
967      CONFIGURE_OBJECT_TABLE_STUFF)) \
968  )
969
970#define CONFIGURE_MEMORY_FOR_TIMERS(_timers) \
971  ((_timers) * ( sizeof(Timer_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
972
973#define CONFIGURE_MEMORY_FOR_SEMAPHORES(_semaphores) \
974  ((_semaphores) * \
975   ( sizeof(Semaphore_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
976
977#define CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(_queues) \
978  ( (_queues) * \
979    ( sizeof(Message_queue_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
980
981#define CONFIGURE_MEMORY_FOR_PARTITIONS(_partitions) \
982  ( (_partitions) * \
983    ( sizeof(Partition_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
984
985#define CONFIGURE_MEMORY_FOR_REGIONS(_regions) \
986  ( (_regions) * \
987    ( sizeof(Region_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
988
989#define CONFIGURE_MEMORY_FOR_PORTS(_ports) \
990  ( (_ports) * \
991    ( sizeof(Dual_ported_memory_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
992
993#define CONFIGURE_MEMORY_FOR_PERIODS(_periods) \
994  ( (_periods) * \
995    ( sizeof(Rate_monotonic_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
996
997#define CONFIGURE_MEMORY_FOR_BARRIERS(_barriers) \
998  ( (_barriers) * \
999    ( sizeof(Barrier_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
1000
1001#define CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(_extensions) \
1002  ( (_extensions) * \
1003    ( sizeof(Extension_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
1004
1005#define CONFIGURE_MEMORY_FOR_DEVICES(_devices) \
1006  (((_devices) + 1) * ( sizeof(rtems_driver_name_t) ) )
1007
1008#ifdef CONFIGURE_MP_APPLICATION
1009
1010#ifndef CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE
1011
1012#define CONFIGURE_MEMORY_FOR_PROXIES(_proxies) \
1013  ( ((_proxies) + 1) * ( sizeof(Thread_Proxy_control) )  )
1014
1015#define CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS(_global_objects) \
1016  ((_global_objects)  * ( sizeof(Objects_MP_Control) )  )
1017
1018#define CONFIGURE_MEMORY_FOR_MP \
1019  ( CONFIGURE_MEMORY_FOR_PROXIES(CONFIGURE_MP_MAXIMUM_PROXIES) + \
1020    CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS(CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS) + \
1021    CONFIGURE_MEMORY_FOR_TASKS(1) \
1022  )
1023
1024#endif  /* CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE */
1025
1026#else
1027
1028#define CONFIGURE_MEMORY_FOR_MP  0
1029
1030#endif
1031
1032#ifndef CONFIGURE_MEMORY_OVERHEAD
1033#define CONFIGURE_MEMORY_OVERHEAD 0
1034#endif
1035
1036#ifndef CONFIGURE_EXTRA_TASK_STACKS
1037#define CONFIGURE_EXTRA_TASK_STACKS 0
1038#endif
1039
1040#define CONFIGURE_API_MUTEX_MEMORY \
1041  ( (1) * \
1042    ( sizeof(API_Mutex_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) \
1043  )
1044
1045#define CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD \
1046  ( CONFIGURE_MEMORY_FOR_TASKS(1) +    /* IDLE */ \
1047    (256 * 12) +                       /* Ready chains */ \
1048    256        +                       /* name/ptr table overhead */ \
1049    CONFIGURE_INTERRUPT_STACK_MEMORY + /* interrupt stack */ \
1050    CONFIGURE_API_MUTEX_MEMORY         /* allocation mutex */ \
1051  )
1052
1053/*
1054 *  Now account for any extra memory that initialization tasks or threads
1055 *  may have requested.
1056 */
1057
1058#ifdef RTEMS_POSIX_API
1059#define CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART \
1060    (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE - RTEMS_MINIMUM_STACK_SIZE)
1061#else
1062#define CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART 0
1063#endif
1064#ifdef RTEMS_ITRON_API
1065#define CONFIGURE_INITIALIZATION_THREADS_STACKS_ITRON_PART \
1066    (CONFIGURE_ITRON_INIT_TASK_STACK_SIZE - RTEMS_MINIMUM_STACK_SIZE)
1067#else
1068#define CONFIGURE_INITIALIZATION_THREADS_STACKS_ITRON_PART 0
1069#endif
1070
1071#define CONFIGURE_INITIALIZATION_THREADS_STACKS \
1072   ((CONFIGURE_INIT_TASK_STACK_SIZE - RTEMS_MINIMUM_STACK_SIZE) + \
1073    CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART + \
1074    CONFIGURE_INITIALIZATION_THREADS_STACKS_ITRON_PART)
1075
1076#define CONFIGURE_EXECUTIVE_RAM_SIZE \
1077(( CONFIGURE_MEMORY_FOR_POSIX + \
1078   CONFIGURE_MEMORY_FOR_ITRON + \
1079   CONFIGURE_MEMORY_FOR_TASKS(CONFIGURE_MAXIMUM_TASKS + \
1080      CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_ADA_TASKS + \
1081      CONFIGURE_MAXIMUM_ITRON_TASKS ) + \
1082   CONFIGURE_INITIALIZATION_THREADS_STACKS + \
1083   CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS) + \
1084   CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_MAXIMUM_SEMAPHORES + \
1085     CONFIGURE_LIBIO_SEMAPHORES + CONFIGURE_TERMIOS_SEMAPHORES) + \
1086   CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(CONFIGURE_MAXIMUM_MESSAGE_QUEUES) + \
1087   CONFIGURE_MEMORY_FOR_PARTITIONS(CONFIGURE_MAXIMUM_PARTITIONS) + \
1088   CONFIGURE_MEMORY_FOR_REGIONS( \
1089      CONFIGURE_MAXIMUM_REGIONS + CONFIGURE_MALLOC_REGION ) + \
1090   CONFIGURE_MEMORY_FOR_PORTS(CONFIGURE_MAXIMUM_PORTS) + \
1091   CONFIGURE_MEMORY_FOR_PERIODS(CONFIGURE_MAXIMUM_PERIODS) + \
1092   CONFIGURE_MEMORY_FOR_BARRIERS(CONFIGURE_MAXIMUM_BARRIERS) + \
1093   CONFIGURE_MEMORY_FOR_USER_EXTENSIONS( \
1094      CONFIGURE_MAXIMUM_USER_EXTENSIONS + CONFIGURE_NEWLIB_EXTENSION + \
1095      CONFIGURE_STACK_CHECKER_EXTENSION ) + \
1096   CONFIGURE_MEMORY_FOR_DEVICES(CONFIGURE_MAXIMUM_DEVICES) + \
1097   CONFIGURE_MEMORY_FOR_MP + \
1098   CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD + \
1099   (((CONFIGURE_MEMORY_OVERHEAD)+1) * 1024) + \
1100   (CONFIGURE_EXTRA_TASK_STACKS) + (CONFIGURE_ADA_TASKS_STACK) \
1101) & 0xfffffc00)
1102#endif
1103
1104#ifdef CONFIGURE_GNAT_RTEMS
1105#define CONFIGURE_GNAT_MUTEXES 10
1106#define CONFIGURE_GNAT_KEYS    1
1107
1108/* 20 are required to run all tests in the ACVC */
1109#ifndef CONFIGURE_MAXIMUM_ADA_TASKS
1110#define CONFIGURE_MAXIMUM_ADA_TASKS  20
1111#endif
1112
1113/* This is the number of non-Ada tasks which invoked Ada code. */
1114#ifndef CONFIGURE_MAXIMUM_FAKE_ADA_TASKS
1115#define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0
1116#endif
1117
1118/* Ada tasks are allocated twice the minimum stack space */
1119#define CONFIGURE_ADA_TASKS_STACK \
1120  (CONFIGURE_MAXIMUM_ADA_TASKS * (RTEMS_MINIMUM_STACK_SIZE + (6 * 1024)))
1121
1122#else
1123#define CONFIGURE_GNAT_MUTEXES           0
1124#define CONFIGURE_GNAT_KEYS              0
1125#define CONFIGURE_MAXIMUM_ADA_TASKS      0
1126#define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0
1127#define CONFIGURE_ADA_TASKS_STACK        0
1128#endif
1129
1130
1131#ifdef CONFIGURE_INIT
1132
1133rtems_api_configuration_table Configuration_RTEMS_API = {
1134  CONFIGURE_MAXIMUM_TASKS,
1135  CONFIGURE_MAXIMUM_TIMERS,
1136  CONFIGURE_MAXIMUM_SEMAPHORES + CONFIGURE_LIBIO_SEMAPHORES +
1137    CONFIGURE_TERMIOS_SEMAPHORES,
1138  CONFIGURE_MAXIMUM_MESSAGE_QUEUES,
1139  CONFIGURE_MAXIMUM_PARTITIONS,
1140  CONFIGURE_MAXIMUM_REGIONS + CONFIGURE_MALLOC_REGION,
1141  CONFIGURE_MAXIMUM_PORTS,
1142  CONFIGURE_MAXIMUM_PERIODS,
1143  CONFIGURE_MAXIMUM_BARRIERS,
1144  CONFIGURE_INIT_TASK_TABLE_SIZE,
1145  CONFIGURE_INIT_TASK_TABLE
1146};
1147
1148#ifdef RTEMS_POSIX_API
1149posix_api_configuration_table Configuration_POSIX_API = {
1150  CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_ADA_TASKS,
1151  CONFIGURE_MAXIMUM_POSIX_MUTEXES + CONFIGURE_GNAT_MUTEXES +
1152    CONFIGURE_MAXIMUM_ADA_TASKS + CONFIGURE_MAXIMUM_FAKE_ADA_TASKS,
1153  CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES +
1154    CONFIGURE_MAXIMUM_ADA_TASKS + CONFIGURE_MAXIMUM_FAKE_ADA_TASKS,
1155  CONFIGURE_MAXIMUM_POSIX_KEYS + CONFIGURE_GNAT_KEYS,
1156  CONFIGURE_MAXIMUM_POSIX_TIMERS,
1157  CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS,
1158  CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES,
1159  CONFIGURE_MAXIMUM_POSIX_SEMAPHORES,
1160#if 0
1161  CONFIGURE_MAXIMUM_POSIX_BARRIERS,
1162  CONFIGURE_MAXIMUM_POSIX_RWLOCKS,
1163  CONFIGURE_MAXIMUM_POSIX_SPINLOCKS,
1164#endif
1165  CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE,
1166  CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME
1167};
1168#endif
1169
1170#ifdef RTEMS_ITRON_API
1171itron_api_configuration_table Configuration_ITRON_API = {
1172  CONFIGURE_MAXIMUM_ITRON_TASKS,
1173  CONFIGURE_MAXIMUM_ITRON_SEMAPHORES,
1174  CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS,
1175  CONFIGURE_MAXIMUM_ITRON_MAILBOXES,
1176  CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS,
1177  CONFIGURE_MAXIMUM_ITRON_PORTS,
1178  CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS,
1179  CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS,
1180  CONFIGURE_ITRON_INIT_TASK_TABLE_SIZE,
1181  CONFIGURE_ITRON_INIT_TASK_TABLE_NAME
1182};
1183#endif
1184
1185rtems_configuration_table Configuration = {
1186  CONFIGURE_EXECUTIVE_RAM_WORK_AREA,
1187  CONFIGURE_EXECUTIVE_RAM_SIZE,
1188  CONFIGURE_MAXIMUM_USER_EXTENSIONS + CONFIGURE_NEWLIB_EXTENSION +
1189      CONFIGURE_STACK_CHECKER_EXTENSION,
1190  CONFIGURE_MICROSECONDS_PER_TICK,
1191  CONFIGURE_TICKS_PER_TIMESLICE,
1192  CONFIGURE_MAXIMUM_DEVICES,
1193  CONFIGURE_MAXIMUM_DRIVERS,
1194  CONFIGURE_NUMBER_OF_DRIVERS,               /* number of device drivers */
1195  Device_drivers,                            /* pointer to driver table */
1196  CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS,    /* number of initial extensions */
1197  CONFIGURE_INITIAL_EXTENSION_TABLE,         /* pointer to initial extensions */
1198  CONFIGURE_MULTIPROCESSING_TABLE,           /* pointer to MP config table */
1199  &Configuration_RTEMS_API,                  /* pointer to RTEMS API config */
1200#ifdef RTEMS_POSIX_API
1201  &Configuration_POSIX_API,                  /* pointer to POSIX API config */
1202#else
1203  NULL,                                      /* pointer to POSIX API config */
1204#endif
1205#ifdef RTEMS_ITRON_API
1206  &Configuration_ITRON_API                   /* pointer to ITRON API config */
1207#else
1208  NULL                                       /* pointer to ITRON API config */
1209#endif
1210};
1211#endif
1212
1213#endif /* CONFIGURE_HAS_OWN_CONFIGURATION_TABLE */
1214
1215#ifdef __cplusplus
1216}
1217#endif
1218
1219/*
1220 *  Some warnings and error checking
1221 */
1222
1223/*
1224 *  Make sure a task/thread of some sort is configured
1225 */
1226
1227#if (CONFIGURE_MAXIMUM_TASKS == 0) && \
1228    (CONFIGURE_MAXIMUM_POSIX_THREADS == 0) && \
1229    (CONFIGURE_MAXIMUM_ADA_TASKS == 0) &&  \
1230    (CONFIGURE_MAXIMUM_ITRON_TASKS == 0)
1231#error "CONFIGURATION ERROR: No tasks or threads configured!!"
1232#endif
1233
1234/*
1235 *  Make sure at least one of the initialization task/thread
1236 *  tables was defined.
1237 */
1238
1239#if !defined(CONFIGURE_RTEMS_INIT_TASKS_TABLE) && \
1240    !defined(CONFIGURE_POSIX_INIT_THREAD_TABLE) && \
1241    !defined(CONFIGURE_ITRON_INIT_TASK_TABLE)
1242#error "CONFIGURATION ERROR: No initialization tasks or threads configured!!"
1243#endif
1244
1245#endif
1246/* end of include file */
Note: See TracBrowser for help on using the repository browser.