source: rtems/cpukit/sapi/include/confdefs.h @ 1c6fa45a

4.104.114.9
Last change on this file since 1c6fa45a was 1c6fa45a, checked in by Joel Sherrill <joel.sherrill@…>, on Nov 27, 2007 at 3:35:26 PM

2007-11-27 Joel Sherrill <joel.sherrill@…>

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