source: rtems/cpukit/sapi/include/confdefs.h @ 976162a6

4.104.114.9
Last change on this file since 976162a6 was 976162a6, checked in by Joel Sherrill <joel.sherrill@…>, on Dec 3, 2007 at 10:23:13 PM

2007-12-03 Joel Sherrill <joel.sherrill@…>

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