source: rtems/cpukit/sapi/include/confdefs.h @ 7a03c09b

4.104.114.84.95
Last change on this file since 7a03c09b was 7a03c09b, checked in by Joel Sherrill <joel.sherrill@…>, on 05/29/07 at 18:45:16

2007-05-29 Joel Sherrill <joel.sherrill@…>

  • sapi/include/confdefs.h, sapi/src/io.c: Readded code to copy driver table into Workspace but now it is only done if the application needs extra slots for dynamic driver registration. Cleaned up rtems_io_register_driver and rtems_io_unregister_driver code and added numerous error cases to register.
  • Property mode set to 100644
File size: 37.2 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#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_NEEDS_NULL_DRIVER
314  NULL_DRIVER_TABLE_ENTRY
315#elif !defined(CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER) && \
316    !defined(CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER) && \
317    !defined(CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER) && \
318    !defined(CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER) && \
319    !defined(CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER)  && \
320    !defined(CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER)
321  NULL_DRIVER_TABLE_ENTRY
322#endif
323};
324#endif
325
326#endif  /* CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE */
327
328/*
329 *  Default the number of drivers per node.  This value may be
330 *  overridden by the user.
331 */
332
333#define CONFIGURE_NUMBER_OF_DRIVERS \
334  ((sizeof(Device_drivers) / sizeof(rtems_driver_address_table)))
335
336#ifndef CONFIGURE_MAXIMUM_DRIVERS
337#define CONFIGURE_MAXIMUM_DRIVERS CONFIGURE_NUMBER_OF_DRIVERS
338#endif
339
340/*
341 *  Default the number of devices per device driver.  This value may be
342 *  overridden by the user.
343 *
344 *  NOTE: This configuration parameter is obsolete. Thus we will warn the
345 *        user that it is obsolete.
346 */
347
348#ifdef CONFIGURE_MAXIMUM_DEVICES
349#warning "CONFIGURE_MAXIMUM_DEVICES is obsolete.  Do not use any longer."
350#endif
351
352#ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER
353  /*
354   * configure the priority of the ATA driver task
355   */
356#  ifndef CONFIGURE_ATA_DRIVER_TASK_PRIORITY
357#    define CONFIGURE_ATA_DRIVER_TASK_PRIORITY ATA_DRIVER_TASK_DEFAULT_PRIORITY
358#  endif
359#  ifdef CONFIGURE_INIT
360  rtems_task_priority ata_driver_task_priority
361    = CONFIGURE_ATA_DRIVER_TASK_PRIORITY;
362#  endif /* CONFIGURE_INIT */
363#endif
364
365/*
366 * add bdbuf configuration and values for swapout task priority
367 */
368#ifdef CONFIGURE_APPLICATION_NEEDS_LIBBLOCK
369#include <rtems/bdbuf.h>
370/*
371 * configure the priority of the bdbuf swapout task
372 */
373#ifndef CONFIGURE_SWAPOUT_TASK_PRIORITY
374#define CONFIGURE_SWAPOUT_TASK_PRIORITY SWAPOUT_TASK_DEFAULT_PRIORITY
375#endif
376#ifdef CONFIGURE_INIT
377  rtems_task_priority swapout_task_priority
378    = CONFIGURE_SWAPOUT_TASK_PRIORITY;
379#endif  /* CONFIGURE_INIT */
380#ifndef CONFIGURE_HAS_OWN_BDBUF_TABLE
381
382#ifndef CONFIGURE_BDBUF_BUFFER_COUNT
383#define CONFIGURE_BDBUF_BUFFER_COUNT 64
384#endif /* CONFIGURE_BDBUF_BUFFER_COUNT */
385
386#ifndef CONFIGURE_BDBUF_BUFFER_SIZE
387#define CONFIGURE_BDBUF_BUFFER_SIZE 512
388#endif /* CONFIGURE_BDBUF_BUFFER_SIZE */
389#ifdef CONFIGURE_INIT
390rtems_bdbuf_config rtems_bdbuf_configuration[] = {
391  {CONFIGURE_BDBUF_BUFFER_SIZE,CONFIGURE_BDBUF_BUFFER_COUNT,NULL}
392};
393int rtems_bdbuf_configuration_size =( sizeof(rtems_bdbuf_configuration)
394                                     /sizeof(rtems_bdbuf_configuration[0]));
395#endif /* CONFIGURE_INIT */
396#endif /* CONFIGURE_HAS_OWN_BDBUF_TABLE        */
397#endif /* CONFIGURE_APPLICATION_NEEDS_LIBBLOCK */
398/*
399 *  Default Multiprocessing Configuration Table.  The defaults are
400 *  appropriate for most of the RTEMS Multiprocessor Test Suite.  Each
401 *  value may be overridden within each test to customize the environment.
402 */
403
404#ifdef CONFIGURE_MP_APPLICATION
405#ifndef CONFIGURE_HAS_OWN_MULTIPROCESSING_TABLE
406
407#ifndef CONFIGURE_MP_NODE_NUMBER
408#define CONFIGURE_MP_NODE_NUMBER                NODE_NUMBER
409#endif
410
411#ifndef CONFIGURE_MP_MAXIMUM_NODES
412#define CONFIGURE_MP_MAXIMUM_NODES              2
413#endif
414
415#ifndef CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS
416#define CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS     32
417#endif
418
419#ifndef CONFIGURE_MP_MAXIMUM_PROXIES
420#define CONFIGURE_MP_MAXIMUM_PROXIES            32
421#endif
422
423#ifndef CONFIGURE_MP_MPCI_TABLE_POINTER
424#include <mpci.h>
425#define CONFIGURE_MP_MPCI_TABLE_POINTER         &MPCI_table
426#endif
427
428#ifdef CONFIGURE_INIT
429rtems_multiprocessing_table Multiprocessing_configuration = {
430  CONFIGURE_MP_NODE_NUMBER,              /* local node number */
431  CONFIGURE_MP_MAXIMUM_NODES,            /* maximum # nodes in system */
432  CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS,   /* maximum # global objects */
433  CONFIGURE_MP_MAXIMUM_PROXIES,          /* maximum # proxies */
434  CONFIGURE_MP_MPCI_TABLE_POINTER        /* pointer to MPCI config table */
435};
436#endif
437
438#define CONFIGURE_MULTIPROCESSING_TABLE    &Multiprocessing_configuration
439
440#endif /* CONFIGURE_HAS_OWN_MULTIPROCESSING_TABLE */
441
442#else
443
444#define CONFIGURE_MULTIPROCESSING_TABLE    NULL
445
446#endif /* CONFIGURE_MP_APPLICATION */
447
448/*
449 *  Default Configuration Table.
450 */
451
452#ifndef CONFIGURE_HAS_OWN_CONFIGURATION_TABLE
453
454#ifndef CONFIGURE_EXECUTIVE_RAM_WORK_AREA
455#define CONFIGURE_EXECUTIVE_RAM_WORK_AREA     NULL
456#endif
457
458#ifndef CONFIGURE_MAXIMUM_TASKS
459#define CONFIGURE_MAXIMUM_TASKS               0
460#endif
461
462#ifndef CONFIGURE_MAXIMUM_TIMERS
463#define CONFIGURE_MAXIMUM_TIMERS              0
464#endif
465
466#ifndef CONFIGURE_MAXIMUM_SEMAPHORES
467#define CONFIGURE_MAXIMUM_SEMAPHORES          0
468#endif
469
470#ifndef CONFIGURE_MAXIMUM_MESSAGE_QUEUES
471#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES      0
472#endif
473
474#ifndef CONFIGURE_MAXIMUM_PARTITIONS
475#define CONFIGURE_MAXIMUM_PARTITIONS          0
476#endif
477
478#ifndef CONFIGURE_MAXIMUM_REGIONS
479#define CONFIGURE_MAXIMUM_REGIONS             0
480#endif
481
482#ifndef CONFIGURE_MAXIMUM_PORTS
483#define CONFIGURE_MAXIMUM_PORTS               0
484#endif
485
486#ifndef CONFIGURE_MAXIMUM_PERIODS
487#define CONFIGURE_MAXIMUM_PERIODS             0
488#endif
489
490#ifndef CONFIGURE_MAXIMUM_BARRIERS
491#define CONFIGURE_MAXIMUM_BARRIERS            0
492#endif
493
494#ifndef CONFIGURE_MAXIMUM_USER_EXTENSIONS
495#define CONFIGURE_MAXIMUM_USER_EXTENSIONS     0
496#endif
497
498#ifndef CONFIGURE_MICROSECONDS_PER_TICK
499#define CONFIGURE_MICROSECONDS_PER_TICK RTEMS_MILLISECONDS_TO_MICROSECONDS(10)
500#endif
501
502#ifndef CONFIGURE_TICKS_PER_TIMESLICE
503#define CONFIGURE_TICKS_PER_TIMESLICE        50
504#endif
505
506/*
507 *  Initial Extension Set
508 */
509
510#ifdef CONFIGURE_INIT
511#ifdef STACK_CHECKER_ON
512#include <rtems/stackchk.h>
513#endif
514#include <rtems/libcsupport.h>
515
516#if defined(CONFIGURE_INITIAL_EXTENSIONS) || \
517    defined(STACK_CHECKER_ON) || \
518    (defined(RTEMS_NEWLIB) && !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY))
519  rtems_extensions_table Configuration_Initial_Extensions[] = {
520    #if !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY)
521      RTEMS_NEWLIB_EXTENSION,
522    #endif
523    #if defined(STACK_CHECKER_ON)
524      RTEMS_STACK_CHECKER_EXTENSION,
525    #endif
526    #if defined(CONFIGURE_INITIAL_EXTENSIONS)
527      CONFIGURE_INITIAL_EXTENSIONS,
528    #endif
529  };
530
531  #define CONFIGURE_INITIAL_EXTENSION_TABLE Configuration_Initial_Extensions
532  #define CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS \
533    ((sizeof(Configuration_Initial_Extensions) / \
534      sizeof(rtems_extensions_table)))
535#else
536  #define CONFIGURE_INITIAL_EXTENSION_TABLE NULL
537  #define CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS 0
538#endif
539
540
541#endif
542
543/*
544 *  POSIX API Configuration Parameters
545 */
546
547#ifdef RTEMS_POSIX_API
548
549#include <sys/types.h>
550#include <signal.h>
551#include <limits.h>
552#include <mqueue.h>
553#include <rtems/posix/barrier.h>
554#include <rtems/posix/cond.h>
555#include <rtems/posix/mqueue.h>
556#include <rtems/posix/mutex.h>
557#include <rtems/posix/key.h>
558#include <rtems/posix/psignal.h>
559#include <rtems/posix/rwlock.h>
560#include <rtems/posix/semaphore.h>
561#include <rtems/posix/spinlock.h>
562#include <rtems/posix/threadsup.h>
563#include <rtems/posix/timer.h>
564
565#ifndef CONFIGURE_MAXIMUM_POSIX_THREADS
566#define CONFIGURE_MAXIMUM_POSIX_THREADS      0
567#endif
568
569#ifndef CONFIGURE_MAXIMUM_POSIX_MUTEXES
570#define CONFIGURE_MAXIMUM_POSIX_MUTEXES      0
571#endif
572
573#ifndef CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES
574#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES  0
575#endif
576
577#ifndef CONFIGURE_MAXIMUM_POSIX_KEYS
578#define CONFIGURE_MAXIMUM_POSIX_KEYS         0
579#endif
580
581#ifndef CONFIGURE_MAXIMUM_POSIX_TIMERS
582#define CONFIGURE_MAXIMUM_POSIX_TIMERS 0
583#endif
584
585#ifndef CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS
586#define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS 0
587#endif
588
589#ifndef CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES
590#define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES 0
591#endif
592
593#ifndef CONFIGURE_MAXIMUM_POSIX_SEMAPHORES
594#define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES 0
595#endif
596
597#ifndef CONFIGURE_MAXIMUM_POSIX_BARRIERS
598#define CONFIGURE_MAXIMUM_POSIX_BARRIERS 0
599#endif
600
601#ifndef CONFIGURE_MAXIMUM_POSIX_SPINLOCKS
602#define CONFIGURE_MAXIMUM_POSIX_SPINLOCKS 0
603#endif
604
605#ifndef CONFIGURE_MAXIMUM_POSIX_RWLOCKS
606#define CONFIGURE_MAXIMUM_POSIX_RWLOCKS 0
607#endif
608
609#ifdef CONFIGURE_POSIX_INIT_THREAD_TABLE
610
611#ifdef CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE
612
613/*
614 *  The user is defining their own table information and setting the
615 *  appropriate variables for the POSIX Initialization Thread Table.
616 */
617
618#else
619
620#ifndef CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT
621#define CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT   POSIX_Init
622#endif
623
624#ifndef CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE
625#define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE    (RTEMS_MINIMUM_STACK_SIZE * 2)
626#endif
627
628#ifdef CONFIGURE_INIT
629posix_initialization_threads_table POSIX_Initialization_threads[] = {
630  { CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT, \
631      CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE }
632};
633#endif
634
635#define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME POSIX_Initialization_threads
636
637#define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE \
638  sizeof(CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME) / \
639      sizeof(posix_initialization_threads_table)
640
641#endif    /* CONFIGURE_POSIX_HAS_OWN_INIT_TASK_TABLE */
642
643#else     /* CONFIGURE_POSIX_INIT_THREAD_TABLE */
644
645#define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME NULL
646#define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE 0
647
648#endif
649
650#define CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API \
651  ( \
652    sizeof (POSIX_API_Control) + \
653   (sizeof (void *) * (CONFIGURE_GNAT_KEYS + CONFIGURE_MAXIMUM_POSIX_KEYS)) \
654  )
655
656#define CONFIGURE_MEMORY_FOR_POSIX_MUTEXES(_mutexes) \
657  ((_mutexes) * \
658   ( sizeof(POSIX_Mutex_Control) + CONFIGURE_OBJECT_TABLE_STUFF + \
659     NAME_MAX ) )
660
661#define CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES(_condition_variables) \
662  ((_condition_variables) * \
663   ( sizeof(POSIX_Condition_variables_Control) + \
664        CONFIGURE_OBJECT_TABLE_STUFF ) )
665
666#define CONFIGURE_MEMORY_FOR_POSIX_KEYS(_keys) \
667  ((_keys) * \
668   ( sizeof(POSIX_Keys_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
669
670#define CONFIGURE_MEMORY_FOR_POSIX_TIMERS(_timers) \
671   ((_timers) * (sizeof(POSIX_Timer_Control) + CONFIGURE_OBJECT_TABLE_STUFF))
672
673#define CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS(_queued_signals) \
674  ((_queued_signals) * \
675   ( sizeof(POSIX_signals_Siginfo_node) + CONFIGURE_OBJECT_TABLE_STUFF ) )
676
677#define CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES(_message_queues) \
678  ((_message_queues) * \
679   ( sizeof( POSIX_Message_queue_Control) + \
680    CONFIGURE_OBJECT_TABLE_STUFF + \
681    NAME_MAX ) )
682
683#define CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES(_semaphores) \
684  ((_semaphores) * \
685   ( sizeof( POSIX_Semaphore_Control) + \
686    CONFIGURE_OBJECT_TABLE_STUFF + \
687    NAME_MAX ) )
688
689#define CONFIGURE_MEMORY_FOR_POSIX_BARRIERS(_barriers) \
690  ((_barriers) * \
691   ( sizeof( POSIX_Barrier_Control) + \
692    CONFIGURE_OBJECT_TABLE_STUFF + \
693    NAME_MAX ) )
694
695#define CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS(_spinlocks) \
696  ((_spinlocks) * \
697   ( sizeof( POSIX_Spinlock_Control) + \
698    CONFIGURE_OBJECT_TABLE_STUFF + \
699    NAME_MAX ) )
700
701#define CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS(_rwlocks) \
702  ((_rwlocks) * \
703   ( sizeof( POSIX_RWLock_Control) + \
704    CONFIGURE_OBJECT_TABLE_STUFF + \
705    NAME_MAX ) )
706
707#define CONFIGURE_MEMORY_FOR_POSIX \
708  ( \
709    CONFIGURE_MEMORY_FOR_POSIX_MUTEXES( CONFIGURE_MAXIMUM_POSIX_MUTEXES ) + \
710    CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES( \
711        CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES ) + \
712    CONFIGURE_MEMORY_FOR_POSIX_KEYS( CONFIGURE_MAXIMUM_POSIX_KEYS ) + \
713    CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS( \
714        CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS ) + \
715    CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES( \
716        CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES ) + \
717    CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES( \
718        CONFIGURE_MAXIMUM_POSIX_SEMAPHORES ) + \
719    CONFIGURE_MEMORY_FOR_POSIX_BARRIERS( CONFIGURE_MAXIMUM_POSIX_BARRIERS ) + \
720    CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS( \
721        CONFIGURE_MAXIMUM_POSIX_SPINLOCKS ) + \
722    CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS( \
723        CONFIGURE_MAXIMUM_POSIX_RWLOCKS ) + \
724    CONFIGURE_MEMORY_FOR_POSIX_TIMERS( CONFIGURE_MAXIMUM_POSIX_TIMERS ) + \
725    (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE) \
726   )
727#else
728
729#define CONFIGURE_MAXIMUM_POSIX_THREADS         0
730#define CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API 0
731#define CONFIGURE_MEMORY_FOR_POSIX              0
732
733
734#endif    /* RTEMS_POSIX_API */
735
736#ifndef CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE
737#define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE    0
738#endif
739
740/*
741 *  ITRON API Configuration Parameters
742 */
743
744#ifdef RTEMS_ITRON_API
745
746#include <rtems/itron.h>
747#include <rtems/itron/config.h>
748#include <rtems/itron/eventflags.h>
749#include <rtems/itron/fmempool.h>
750#include <rtems/itron/mbox.h>
751#include <rtems/itron/msgbuffer.h>
752#include <rtems/itron/port.h>
753#include <rtems/itron/semaphore.h>
754#include <rtems/itron/task.h>
755#include <rtems/itron/vmempool.h>
756
757#ifndef CONFIGURE_MAXIMUM_ITRON_TASKS
758#define CONFIGURE_MAXIMUM_ITRON_TASKS      0
759#endif
760
761#ifndef CONFIGURE_MAXIMUM_ITRON_SEMAPHORES
762#define CONFIGURE_MAXIMUM_ITRON_SEMAPHORES   0
763#endif
764
765#ifndef CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS
766#define CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS   0
767#endif
768
769#ifndef CONFIGURE_MAXIMUM_ITRON_MAILBOXES
770#define CONFIGURE_MAXIMUM_ITRON_MAILBOXES   0
771#endif
772
773#ifndef CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS
774#define CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS   0
775#endif
776
777#ifndef CONFIGURE_MAXIMUM_ITRON_PORTS
778#define CONFIGURE_MAXIMUM_ITRON_PORTS   0
779#endif
780
781#ifndef CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS
782#define CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS   0
783#endif
784
785#ifndef CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS
786#define CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS   0
787#endif
788
789#ifdef CONFIGURE_ITRON_INIT_TASK_TABLE
790
791#ifdef CONFIGURE_ITRON_HAS_OWN_INIT_TASK_TABLE
792
793/*
794 *  The user is defining their own table information and setting the
795 *  appropriate variables for the ITRON Initialization Task Table.
796 */
797
798#else
799
800#ifndef CONFIGURE_ITRON_INIT_TASK_ENTRY_POINT
801#define CONFIGURE_ITRON_INIT_TASK_ENTRY_POINT   ITRON_Init
802#endif
803
804#ifndef CONFIGURE_ITRON_INIT_TASK_ATTRIBUTES
805#define CONFIGURE_ITRON_INIT_TASK_ATTRIBUTES    TA_HLNG
806#endif
807
808#ifndef CONFIGURE_ITRON_INIT_TASK_PRIORITY
809#define CONFIGURE_ITRON_INIT_TASK_PRIORITY      1
810#endif
811
812#ifndef CONFIGURE_ITRON_INIT_TASK_STACK_SIZE
813#define CONFIGURE_ITRON_INIT_TASK_STACK_SIZE    RTEMS_MINIMUM_STACK_SIZE
814#endif
815
816#ifdef CONFIGURE_INIT
817itron_initialization_tasks_table ITRON_Initialization_tasks[] = {
818  { 1,                                    /* ID */
819    { (VP) 0,                                /* exinfo */
820      CONFIGURE_ITRON_INIT_TASK_ATTRIBUTES,  /* task attributes */
821      CONFIGURE_ITRON_INIT_TASK_ENTRY_POINT, /* task start address */
822      CONFIGURE_ITRON_INIT_TASK_PRIORITY,    /* initial task priority */
823      CONFIGURE_ITRON_INIT_TASK_STACK_SIZE   /* stack size */
824    }
825  }
826};
827#endif
828
829#define CONFIGURE_ITRON_INIT_TASK_TABLE_NAME ITRON_Initialization_tasks
830
831#define CONFIGURE_ITRON_INIT_TASK_TABLE_SIZE \
832  sizeof(CONFIGURE_ITRON_INIT_TASK_TABLE_NAME) / \
833      sizeof(itron_initialization_tasks_table)
834
835#endif    /* CONFIGURE_ITRON_HAS_OWN_INIT_TASK_TABLE */
836
837#else     /* CONFIGURE_ITRON_INIT_TASK_TABLE */
838
839#define CONFIGURE_ITRON_INIT_TASK_TABLE_NAME NULL
840#define CONFIGURE_ITRON_INIT_TASK_TABLE_SIZE 0
841
842#endif
843
844#define CONFIGURE_MEMORY_PER_TASK_FOR_ITRON_API \
845  ( \
846    sizeof (ITRON_API_Control) \
847  )
848
849#define CONFIGURE_MEMORY_FOR_ITRON_SEMAPHORES(_semaphores) \
850  ((_semaphores) * \
851   ( sizeof(ITRON_Semaphore_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
852
853#define CONFIGURE_MEMORY_FOR_ITRON_EVENTFLAGS(_eventflags) \
854  ((_eventflags) * \
855   ( sizeof(ITRON_Eventflags_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
856
857#define CONFIGURE_MEMORY_FOR_ITRON_MAILBOXES(_mailboxes) \
858  ((_mailboxes) * \
859   ( sizeof(ITRON_Mailbox_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
860
861#define CONFIGURE_MEMORY_FOR_ITRON_MESSAGE_BUFFERS(_message_buffers) \
862  ((_message_buffers) * \
863   ( sizeof(ITRON_Message_buffer_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
864
865#define CONFIGURE_MEMORY_FOR_ITRON_PORTS(_ports) \
866  ((_ports) * \
867   ( sizeof(ITRON_Port_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
868
869#define CONFIGURE_MEMORY_FOR_ITRON_MEMORY_POOLS(_memory_pools) \
870  ((_memory_pools) * \
871   (sizeof(ITRON_Variable_memory_pool_Control) + CONFIGURE_OBJECT_TABLE_STUFF))
872
873#define CONFIGURE_MEMORY_FOR_ITRON_FIXED_MEMORY_POOLS(_fixed_memory_pools) \
874  ((_fixed_memory_pools) * \
875   ( sizeof(ITRON_Fixed_memory_pool_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
876
877#ifndef CONFIGURE_ITRON_INIT_TASK_STACK_SIZE
878#define CONFIGURE_ITRON_INIT_TASK_STACK_SIZE (RTEMS_MINIMUM_STACK_SIZE * 2)
879#endif
880
881
882#define CONFIGURE_MEMORY_FOR_ITRON \
883  ( \
884    CONFIGURE_MEMORY_FOR_ITRON_SEMAPHORES( \
885        CONFIGURE_MAXIMUM_ITRON_SEMAPHORES ) + \
886    CONFIGURE_MEMORY_FOR_ITRON_EVENTFLAGS( \
887        CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS ) + \
888    CONFIGURE_MEMORY_FOR_ITRON_MAILBOXES( \
889        CONFIGURE_MAXIMUM_ITRON_MAILBOXES ) + \
890    CONFIGURE_MEMORY_FOR_ITRON_MESSAGE_BUFFERS( \
891        CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS ) + \
892    CONFIGURE_MEMORY_FOR_ITRON_PORTS( \
893        CONFIGURE_MAXIMUM_ITRON_PORTS ) + \
894    CONFIGURE_MEMORY_FOR_ITRON_MEMORY_POOLS( \
895        CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS ) + \
896    CONFIGURE_MEMORY_FOR_ITRON_FIXED_MEMORY_POOLS( \
897        CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS ) + \
898    CONFIGURE_ITRON_INIT_TASK_STACK_SIZE \
899   )
900
901
902#else
903
904#define CONFIGURE_MAXIMUM_ITRON_TASKS               0
905#define CONFIGURE_MAXIMUM_ITRON_SEMAPHORES          0
906#define CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS          0
907#define CONFIGURE_MAXIMUM_ITRON_MAILBOXES           0
908#define CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS     0
909#define CONFIGURE_MAXIMUM_ITRON_PORTS               0
910#define CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS        0
911#define CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS  0
912#define CONFIGURE_MEMORY_PER_TASK_FOR_ITRON_API     0
913#define CONFIGURE_MEMORY_FOR_ITRON                  0
914
915#endif    /* RTEMS_ITRON_API */
916
917
918/*
919 *  Calculate the RAM size based on the maximum number of objects configured.
920 */
921
922#ifndef CONFIGURE_EXECUTIVE_RAM_SIZE
923
924#define CONFIGURE_OBJECT_TABLE_STUFF \
925  ( sizeof(Objects_Control *) + sizeof(rtems_name *) + sizeof(rtems_name) )
926
927#if defined(RTEMS_NEWLIB)
928#include <reent.h>
929
930#define CONFIGURE_MEMORY_PER_TASK_FOR_LIBC_REENTRANCY sizeof(struct _reent)
931#else
932#define CONFIGURE_MEMORY_PER_TASK_FOR_LIBC_REENTRANCY 0
933#endif
934
935#define CONFIGURE_MEMORY_FOR_TASKS(_tasks) \
936  (((_tasks) + 1 ) * \
937   ((sizeof(Thread_Control) + CONTEXT_FP_SIZE + \
938      STACK_MINIMUM_SIZE + sizeof( RTEMS_API_Control ) + \
939      CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API + \
940      CONFIGURE_MEMORY_PER_TASK_FOR_ITRON_API + \
941      CONFIGURE_MEMORY_PER_TASK_FOR_LIBC_REENTRANCY + \
942      CONFIGURE_OBJECT_TABLE_STUFF)) \
943  )
944
945#define CONFIGURE_MEMORY_FOR_TIMERS(_timers) \
946  ((_timers) * ( sizeof(Timer_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
947
948#define CONFIGURE_MEMORY_FOR_SEMAPHORES(_semaphores) \
949  ((_semaphores) * \
950   ( sizeof(Semaphore_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
951
952#define CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(_queues) \
953  ( (_queues) * \
954    ( sizeof(Message_queue_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
955
956#define CONFIGURE_MEMORY_FOR_PARTITIONS(_partitions) \
957  ( (_partitions) * \
958    ( sizeof(Partition_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
959
960#define CONFIGURE_MEMORY_FOR_REGIONS(_regions) \
961  ( (_regions) * \
962    ( sizeof(Region_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
963
964#define CONFIGURE_MEMORY_FOR_PORTS(_ports) \
965  ( (_ports) * \
966    ( sizeof(Dual_ported_memory_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
967
968#define CONFIGURE_MEMORY_FOR_PERIODS(_periods) \
969  ( (_periods) * \
970    ( sizeof(Rate_monotonic_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
971
972#define CONFIGURE_MEMORY_FOR_BARRIERS(_barriers) \
973  ( (_barriers) * \
974    ( sizeof(Barrier_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
975
976#define CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(_extensions) \
977  ( (_extensions) * \
978    ( sizeof(Extension_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
979
980#ifdef CONFIGURE_MP_APPLICATION
981
982#ifndef CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE
983
984#define CONFIGURE_MEMORY_FOR_PROXIES(_proxies) \
985  ( ((_proxies) + 1) * ( sizeof(Thread_Proxy_control) )  )
986
987#define CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS(_global_objects) \
988  ((_global_objects)  * ( sizeof(Objects_MP_Control) )  )
989
990#define CONFIGURE_MEMORY_FOR_MP \
991  ( CONFIGURE_MEMORY_FOR_PROXIES(CONFIGURE_MP_MAXIMUM_PROXIES) + \
992    CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS(CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS) + \
993    CONFIGURE_MEMORY_FOR_TASKS(1) \
994  )
995
996#endif  /* CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE */
997
998#else
999
1000#define CONFIGURE_MEMORY_FOR_MP  0
1001
1002#endif
1003
1004/*
1005 *  This is so we can account for tasks with stacks greater than minimum
1006 *  size.  This is in bytes.
1007 */
1008#ifndef CONFIGURE_EXTRA_TASK_STACKS
1009#define CONFIGURE_EXTRA_TASK_STACKS 0
1010#endif
1011
1012/*
1013 * Account for pending message buffers in bytes.
1014 */
1015#ifndef CONFIGURE_MESSAGE_BUFFER_MEMORY
1016#define CONFIGURE_MESSAGE_BUFFER_MEMORY 0
1017#endif
1018
1019/*
1020 * Catch all for extra memory in case something broken and underestimates.
1021 * Historically this was used for message buffers.
1022 */
1023#ifndef CONFIGURE_MEMORY_OVERHEAD
1024#define CONFIGURE_MEMORY_OVERHEAD 0
1025#endif
1026
1027#define CONFIGURE_API_MUTEX_MEMORY \
1028  ( (1) * \
1029    ( sizeof(API_Mutex_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) \
1030  )
1031
1032#define CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD \
1033  ( CONFIGURE_MEMORY_FOR_TASKS(1) +                  /* IDLE */ \
1034    ((PRIORITY_MAXIMUM+1) * sizeof(Chain_Control)) + /* Ready chains */ \
1035    256 +                                 /* name/ptr table overhead */ \
1036    CONFIGURE_INTERRUPT_STACK_MEMORY +    /* interrupt stack */ \
1037    CONFIGURE_API_MUTEX_MEMORY            /* allocation mutex */ \
1038  )
1039
1040/*
1041 *  Now account for any extra memory that initialization tasks or threads
1042 *  may have requested.
1043 */
1044
1045#ifdef RTEMS_POSIX_API
1046#define CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART \
1047    (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE - RTEMS_MINIMUM_STACK_SIZE)
1048#else
1049#define CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART 0
1050#endif
1051#ifdef RTEMS_ITRON_API
1052#define CONFIGURE_INITIALIZATION_THREADS_STACKS_ITRON_PART \
1053    (CONFIGURE_ITRON_INIT_TASK_STACK_SIZE - RTEMS_MINIMUM_STACK_SIZE)
1054#else
1055#define CONFIGURE_INITIALIZATION_THREADS_STACKS_ITRON_PART 0
1056#endif
1057
1058#define CONFIGURE_INITIALIZATION_THREADS_STACKS \
1059   ((CONFIGURE_INIT_TASK_STACK_SIZE - RTEMS_MINIMUM_STACK_SIZE) + \
1060    CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART + \
1061    CONFIGURE_INITIALIZATION_THREADS_STACKS_ITRON_PART)
1062
1063#define CONFIGURE_EXECUTIVE_RAM_SIZE \
1064(( CONFIGURE_MEMORY_FOR_POSIX + \
1065   CONFIGURE_MEMORY_FOR_ITRON + \
1066   CONFIGURE_MEMORY_FOR_TASKS(CONFIGURE_MAXIMUM_TASKS + \
1067      CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_ADA_TASKS + \
1068      CONFIGURE_MAXIMUM_ITRON_TASKS ) + \
1069   CONFIGURE_INITIALIZATION_THREADS_STACKS + \
1070   CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS) + \
1071   CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_MAXIMUM_SEMAPHORES + \
1072     CONFIGURE_LIBIO_SEMAPHORES + CONFIGURE_TERMIOS_SEMAPHORES) + \
1073   CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(CONFIGURE_MAXIMUM_MESSAGE_QUEUES) + \
1074   CONFIGURE_MEMORY_FOR_PARTITIONS(CONFIGURE_MAXIMUM_PARTITIONS) + \
1075   CONFIGURE_MEMORY_FOR_REGIONS( CONFIGURE_MAXIMUM_REGIONS ) + \
1076   CONFIGURE_MEMORY_FOR_PORTS(CONFIGURE_MAXIMUM_PORTS) + \
1077   CONFIGURE_MEMORY_FOR_PERIODS(CONFIGURE_MAXIMUM_PERIODS) + \
1078   CONFIGURE_MEMORY_FOR_BARRIERS(CONFIGURE_MAXIMUM_BARRIERS) + \
1079   CONFIGURE_MEMORY_FOR_USER_EXTENSIONS( \
1080      CONFIGURE_MAXIMUM_USER_EXTENSIONS + CONFIGURE_NEWLIB_EXTENSION + \
1081      CONFIGURE_STACK_CHECKER_EXTENSION ) + \
1082   CONFIGURE_MEMORY_FOR_MP + \
1083   CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD + \
1084   CONFIGURE_MESSAGE_BUFFER_MEMORY + \
1085   (CONFIGURE_MEMORY_OVERHEAD * 1024) + \
1086   (CONFIGURE_EXTRA_TASK_STACKS) + (CONFIGURE_ADA_TASKS_STACK) \
1087) & ~0x7)
1088#endif
1089
1090#ifdef CONFIGURE_GNAT_RTEMS
1091#define CONFIGURE_GNAT_MUTEXES 10
1092/* GNAT/RTEMS provides an optimized Ada self and does not use POSIX Keys */
1093#define CONFIGURE_GNAT_KEYS    0
1094
1095/* 20 are required to run all tests in the ACVC */
1096#ifndef CONFIGURE_MAXIMUM_ADA_TASKS
1097#define CONFIGURE_MAXIMUM_ADA_TASKS  20
1098#endif
1099
1100/* This is the number of non-Ada tasks which invoked Ada code. */
1101#ifndef CONFIGURE_MAXIMUM_FAKE_ADA_TASKS
1102#define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0
1103#endif
1104
1105/* Ada tasks are allocated twice the minimum stack space */
1106#define CONFIGURE_ADA_TASKS_STACK \
1107  (CONFIGURE_MAXIMUM_ADA_TASKS * (RTEMS_MINIMUM_STACK_SIZE + (6 * 1024)))
1108
1109#else
1110#define CONFIGURE_GNAT_MUTEXES           0
1111#define CONFIGURE_GNAT_KEYS              0
1112#define CONFIGURE_MAXIMUM_ADA_TASKS      0
1113#define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0
1114#define CONFIGURE_ADA_TASKS_STACK        0
1115#endif
1116
1117
1118#ifdef CONFIGURE_INIT
1119
1120rtems_api_configuration_table Configuration_RTEMS_API = {
1121  CONFIGURE_MAXIMUM_TASKS,
1122  CONFIGURE_MAXIMUM_TIMERS,
1123  CONFIGURE_MAXIMUM_SEMAPHORES + CONFIGURE_LIBIO_SEMAPHORES +
1124    CONFIGURE_TERMIOS_SEMAPHORES,
1125  CONFIGURE_MAXIMUM_MESSAGE_QUEUES,
1126  CONFIGURE_MAXIMUM_PARTITIONS,
1127  CONFIGURE_MAXIMUM_REGIONS,
1128  CONFIGURE_MAXIMUM_PORTS,
1129  CONFIGURE_MAXIMUM_PERIODS,
1130  CONFIGURE_MAXIMUM_BARRIERS,
1131  CONFIGURE_INIT_TASK_TABLE_SIZE,
1132  CONFIGURE_INIT_TASK_TABLE
1133};
1134
1135#ifdef RTEMS_POSIX_API
1136posix_api_configuration_table Configuration_POSIX_API = {
1137  CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_ADA_TASKS,
1138  CONFIGURE_MAXIMUM_POSIX_MUTEXES + CONFIGURE_GNAT_MUTEXES +
1139    CONFIGURE_MAXIMUM_ADA_TASKS + CONFIGURE_MAXIMUM_FAKE_ADA_TASKS,
1140  CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES +
1141    CONFIGURE_MAXIMUM_ADA_TASKS + CONFIGURE_MAXIMUM_FAKE_ADA_TASKS,
1142  CONFIGURE_MAXIMUM_POSIX_KEYS + CONFIGURE_GNAT_KEYS,
1143  CONFIGURE_MAXIMUM_POSIX_TIMERS,
1144  CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS,
1145  CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES,
1146  CONFIGURE_MAXIMUM_POSIX_SEMAPHORES,
1147  CONFIGURE_MAXIMUM_POSIX_BARRIERS,
1148  CONFIGURE_MAXIMUM_POSIX_RWLOCKS,
1149  CONFIGURE_MAXIMUM_POSIX_SPINLOCKS,
1150  CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE,
1151  CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME
1152};
1153#endif
1154
1155#ifdef RTEMS_ITRON_API
1156itron_api_configuration_table Configuration_ITRON_API = {
1157  CONFIGURE_MAXIMUM_ITRON_TASKS,
1158  CONFIGURE_MAXIMUM_ITRON_SEMAPHORES,
1159  CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS,
1160  CONFIGURE_MAXIMUM_ITRON_MAILBOXES,
1161  CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS,
1162  CONFIGURE_MAXIMUM_ITRON_PORTS,
1163  CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS,
1164  CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS,
1165  CONFIGURE_ITRON_INIT_TASK_TABLE_SIZE,
1166  CONFIGURE_ITRON_INIT_TASK_TABLE_NAME
1167};
1168#endif
1169
1170rtems_configuration_table Configuration = {
1171  CONFIGURE_EXECUTIVE_RAM_WORK_AREA,
1172  CONFIGURE_EXECUTIVE_RAM_SIZE,
1173  CONFIGURE_MAXIMUM_USER_EXTENSIONS + CONFIGURE_NEWLIB_EXTENSION +
1174      CONFIGURE_STACK_CHECKER_EXTENSION,
1175  CONFIGURE_MICROSECONDS_PER_TICK,
1176  CONFIGURE_TICKS_PER_TIMESLICE,
1177  CONFIGURE_MAXIMUM_DRIVERS,
1178  CONFIGURE_NUMBER_OF_DRIVERS,               /* number of device drivers */
1179  Device_drivers,                            /* pointer to driver table */
1180  CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS,    /* number of initial extensions */
1181  CONFIGURE_INITIAL_EXTENSION_TABLE,         /* pointer to initial extensions */
1182  CONFIGURE_MULTIPROCESSING_TABLE,           /* pointer to MP config table */
1183  &Configuration_RTEMS_API,                  /* pointer to RTEMS API config */
1184#ifdef RTEMS_POSIX_API
1185  &Configuration_POSIX_API,                  /* pointer to POSIX API config */
1186#else
1187  NULL,                                      /* pointer to POSIX API config */
1188#endif
1189#ifdef RTEMS_ITRON_API
1190  &Configuration_ITRON_API                   /* pointer to ITRON API config */
1191#else
1192  NULL                                       /* pointer to ITRON API config */
1193#endif
1194};
1195#endif
1196
1197#endif /* CONFIGURE_HAS_OWN_CONFIGURATION_TABLE */
1198
1199/*
1200 *  If the user has configured a set of Classic API Initialization Tasks,
1201 *  then we need to install the code that runs that loop.
1202 */
1203#ifdef CONFIGURE_INIT
1204  #ifdef CONFIGURE_RTEMS_INIT_TASKS_TABLE
1205    void (_RTEMS_tasks_Initialize_user_tasks_body)(void);
1206    void (*_RTEMS_tasks_Initialize_user_tasks_p)(void) =
1207              _RTEMS_tasks_Initialize_user_tasks_body;
1208  #else
1209    void (*_RTEMS_tasks_Initialize_user_tasks_p)(void) = NULL;
1210  #endif
1211#endif
1212
1213/*
1214 *  If the user has configured a set of POSIX Initialization Threads,
1215 *  then we need to install the code that runs that loop.
1216 */
1217#ifdef CONFIGURE_INIT
1218  #ifdef CONFIGURE_POSIX_INIT_THREAD_TABLE
1219    void _POSIX_Threads_Initialize_user_threads_body(void);
1220    void (*_POSIX_Threads_Initialize_user_threads_p)(void) =
1221              _POSIX_Threads_Initialize_user_threads_body;
1222  #else
1223    void (*_POSIX_Threads_Initialize_user_threads_p)(void) = NULL;
1224  #endif
1225#endif
1226
1227/*
1228 *  If the user has configured a set of ITRON Initialization Tasks,
1229 *  then we need to install the code that runs that loop.
1230 */
1231#ifdef CONFIGURE_INIT
1232  #ifdef CONFIGURE_ITRON_INIT_TASK_TABLE
1233    void _ITRON_Task_Initialize_user_tasks_body(void);
1234    void (*_ITRON_Initialize_user_tasks_p)(void) =
1235              _ITRON_Task_Initialize_user_tasks_body;
1236  #else
1237    void (*_ITRON_Initialize_user_tasks_p)(void) = NULL;
1238  #endif
1239#endif
1240
1241#ifdef __cplusplus
1242}
1243#endif
1244
1245/*
1246 *  Some warnings and error checking
1247 */
1248
1249/*
1250 *  Make sure a task/thread of some sort is configured
1251 */
1252
1253#if (CONFIGURE_MAXIMUM_TASKS == 0) && \
1254    (CONFIGURE_MAXIMUM_POSIX_THREADS == 0) && \
1255    (CONFIGURE_MAXIMUM_ADA_TASKS == 0) &&  \
1256    (CONFIGURE_MAXIMUM_ITRON_TASKS == 0)
1257#error "CONFIGURATION ERROR: No tasks or threads configured!!"
1258#endif
1259
1260/*
1261 *  Make sure at least one of the initialization task/thread
1262 *  tables was defined.
1263 */
1264
1265#if !defined(CONFIGURE_RTEMS_INIT_TASKS_TABLE) && \
1266    !defined(CONFIGURE_POSIX_INIT_THREAD_TABLE) && \
1267    !defined(CONFIGURE_ITRON_INIT_TASK_TABLE)
1268#error "CONFIGURATION ERROR: No initialization tasks or threads configured!!"
1269#endif
1270
1271/*
1272 *  These names have been obsoleted so make the user application stop compiling
1273 */
1274#if defined(CONFIGURE_TEST_NEEDS_TIMER_DRIVER) || \
1275    defined(CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER) || \
1276    defined(CONFIGURE_TEST_NEEDS_CLOCK_DRIVER) || \
1277    defined(CONFIGURE_TEST_NEEDS_RTC_DRIVER) || \
1278    defined(CONFIGURE_TEST_NEEDS_STUB_DRIVER)
1279#error "CONFIGURATION ERROR: CONFIGURE_TEST_XXX constants are obsolete"
1280#endif
1281
1282
1283#endif
1284/* end of include file */
Note: See TracBrowser for help on using the repository browser.