source: rtems/doc/user/conf.t @ d695dfc

4.104.114.95
Last change on this file since d695dfc was d695dfc, checked in by Joel Sherrill <joel.sherrill@…>, on 06/16/08 at 15:54:27

2008-06-16 Joel Sherrill <joel.sherrill@…>

  • user/conf.t: Add CONFIGURE_DISABLE_CLASSIC_API_NOTEPADS.
  • Property mode set to 100644
File size: 78.2 KB
Line 
1@c  COPYRIGHT (c) 1988-2008.
2@c  On-Line Applications Research Corporation (OAR).
3@c  All rights reserved.
4@c
5@c  $Id$
6@c
7
8@c The following macros from confdefs.h have not been discussed in this
9@c chapter:
10@c
11@c CONFIGURE_NEWLIB_EXTENSION - probably not needed
12@c
13@c In addition, there should be examples of defining your own
14@c Device Driver Table, Init task table, etc.
15@c
16@c Regardless, this is a big step up. :)
17@c
18
19@chapter Configuring a System
20
21@section Introduction
22
23RTEMS must be configured for an application.  This configuration
24information encompasses a variety of information including
25the length of each clock tick, the maximum number of each RTEMS
26object that can be created, the application initialization tasks,
27and the device drivers in the application.  This information
28is placed in data structures that are given to RTEMS at
29system initialization time.  This chapter details the
30format of these data structures as well as a simpler
31mechanism to automate the generation of these structures.
32
33@ifset is-Ada
34System configuration is ALWAYS done from C.  When developing
35an Ada application, the user is responsible for creating at
36least one C file which contains the Ada run-time initialization
37and the RTEMS System Configuration.  There is no Ada binding
38for RTEMS System Configuration information.  Thus all examples
39and data structures shown in this chapter are in C.
40@end ifset
41
42@section Automatic Generation of System Configuration
43
44@cindex confdefs.h
45@findex confdefs.h
46
47RTEMS provides the @code{rtems/confdefs.h} C language header file that
48based on the setting of a variety of macros can automatically
49produce nearly all of the configuration tables required
50by an RTEMS application.  Rather than building the individual
51tables by hand, the application simply specifies the values
52for the configuration parameters it wishes to set.  In the following
53example, the configuration information for a simple system with
54a message queue and a time slice of 50 milliseconds is configured:
55
56@example
57@group
58#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
59#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
60
61#define CONFIGURE_MICROSECONDS_PER_TICK   1000 /* 1 millisecond */
62#define CONFIGURE_TICKS_PER_TIMESLICE       50 /* 50 milliseconds */
63
64#define CONFIGURE_MAXIMUM_TASKS 4
65#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
66@end group
67@end example
68
69This system will begin execution with the single initialization task
70named @code{Init}.  It will be configured to have both a console
71device driver (for standard I/O) and a clock tick device driver.
72
73For each configuration parameter in the configuration tables, the
74macro corresponding to that field is discussed.  Most systems
75can be easily configured using the @code{rtems/confdefs.h} mechanism.
76
77The @code{CONFIGURE_INIT} constant must be defined in order to
78make @code{rtems/confdefs.h} instantiate the configuration data
79structures.  This can only be defined in one source file per
80application that includes @code{rtems/confdefs.h} or the symbol
81table will be instantiated multiple times and linking errors
82produced.
83
84The user should be aware that the defaults are intentionally
85set as low as possible.  By default, no application resources
86are configured.  The @code{rtems/confdefs.h} file ensures that
87at least one application tasks or thread is configured
88and that at least one of the initialization task/thread
89tables is configured.
90
91The @code{rtems/confdefs.h} file estimates the amount of
92memory required for the RTEMS Executive Workspace.  This
93estimate is only as accurate as the information given
94to @code{rtems/confdefs.h} and may be either too high or too
95low for a variety of reasons.  Some of the reasons that
96@code{rtems/confdefs.h} may reserve too much memory for RTEMS
97are:
98
99@itemize @bullet
100@item All tasks/threads are assumed to be floating point.
101@end itemize
102
103Conversely, there are many more reasons, the resource
104estimate could be too low:
105
106@itemize @bullet
107@item Task/thread stacks greater than minimum size must be
108accounted for explicitly by developer.
109
110@item Memory for messages is not included.
111
112@item Device driver requirements are not included.
113
114
115@item Network stack requirements are not included.
116
117@item Requirements for add-on libraries are not included.
118@end itemize
119
120In general, @code{rtems/confdefs.h} is very accurate when given
121enough information.  However, it is quite easy to use
122a library and not account for its resources.
123
124The following subsection list all of the constants which can be
125set by the user.
126
127@subsection Library Support Definitions
128
129This section defines the file system and IO library
130related configuration parameters supported by
131@code{rtems/confdefs.h}.
132
133@itemize @bullet
134@findex CONFIGURE_MALLOC_STATISTICS
135@item @code{CONFIGURE_MALLOC_STATISTICS} is defined when the application
136wishes to enable the gathering of more detailed statistics on the
137C Malloc Family of routines.
138
139@findex CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK
140@item @code{CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK} is defined by a BSP
141to indicate that it does not allocate all available memory to the
142C Program Heap used by the Malloc Family of routines.  If defined,
143when @code{malloc()} is unable to allocate memory, it will call
144the BSP supplied @code{sbrk()} to obtain more memory.
145
146@findex CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS
147@item @code{CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS} is set to the
148maximum number of files that can be concurrently open.  Libio requires
149a Classic RTEMS semaphore for each file descriptor as well as one
150global one.  The default value is 3 file descriptors which is
151enough to support standard input, output, and error output.
152
153@findex CONFIGURE_TERMIOS_DISABLED
154@item @code{CONFIGURE_TERMIOS_DISABLED} is defined if the
155software implementing POSIX termios functionality is
156not going to be used by this application.  By default, this
157is not defined and resources are reserved for the
158termios functionality.
159
160@findex CONFIGURE_NUMBER_OF_TERMIOS_PORTS
161@item @code{CONFIGURE_NUMBER_OF_TERMIOS_PORTS} is set to the
162number of ports using the termios functionality.  Each
163concurrently active termios port requires resources.
164By default, this is set to 1 so a console port can be
165used.
166
167@findex CONFIGURE_HAS_OWN_MOUNT_TABLE
168@item @code{CONFIGURE_HAS_OWN_MOUNT_TABLE} is defined when the
169application provides their own filesystem mount table.  The
170mount table is an array of @code{rtems_filesystem_mount_table_t}
171entries pointed to by the global variable
172@code{rtems_filesystem_mount_table}.  The number of
173entries in this table is in an integer variable named
174@code{rtems_filesystem_mount_table_t}.
175
176@findex CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM
177@item @code{CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM} is defined
178if the application wishes to use the full functionality
179IMFS.  By default, the miniIMFS is used.  The miniIMFS
180is a minimal functionality subset of the In-Memory
181FileSystem (IMFS).  The miniIMFS is comparable
182in functionality to the pseudo-filesystem name space provided
183before RTEMS release 4.5.0.  The miniIMFS supports
184only directories and device nodes and is smaller in executable
185code size than the full IMFS.
186
187@findex STACK_CHECKER_ON
188@item @code{STACK_CHECKER_ON} is defined when the application
189wishes to enable run-time stack bounds checking.  This increases
190the time required to create tasks as well as adding overhead
191to each context switch.  By default, this is not defined and
192thus stack checking is disabled.
193
194@end itemize
195
196@subsection Basic System Information
197
198This section defines the general system configuration parameters supported by
199@code{rtems/confdefs.h}.
200
201@itemize @bullet
202@findex CONFIGURE_HAS_OWN_CONFIGURATION_TABLE
203@item @code{CONFIGURE_HAS_OWN_CONFIGURATION_TABLE} should only be defined
204if the application is providing their own complete set of configuration
205tables.
206
207@findex CONFIGURE_EXECUTIVE_RAM_WORK_AREA
208@item @code{CONFIGURE_EXECUTIVE_RAM_WORK_AREA} is the base
209address of the RTEMS RAM Workspace.  By default, this value
210is NULL indicating that the BSP is to determine the location
211of the RTEMS RAM Workspace.
212
213@item @code{CONFIGURE_MICROSECONDS_PER_TICK} is the length
214of time between clock ticks.  By default, this is set to
21510000 microseconds.
216
217@findex CONFIGURE_TICKS_PER_TIMESLICE
218@item @code{CONFIGURE_TICKS_PER_TIMESLICE} is the length
219of the timeslice quantum in ticks for each task.  By
220default, this is 50.
221
222@findex CONFIGURE_MAXIMUM_PRIORITY
223@item @code{CONFIGURE_MAXIMUM_PRIORITY} is the maximum numeric priority
224of any task in the system and one less that the number of priority levels
225in the system.  The numerically greatest priority is the logically lowest
226priority in the system and will thus be used by the IDLE task.  Valid values
227for this configuration parameter must be one (1) less than than a power
228of two (2) between 4 and 256 inclusively.  In other words, valid values
229are 3, 7, 31, 63, 127, and 255.  Reducing the number of priorities in the
230system reduces the amount of memory allocated from the RTEMS Workspace.
231By default, RTEMS supports 256 priority levels ranging from 0 to 255 so
232the default value for this field is 255.
233
234@findex CONFIGURE_MICROSECONDS_PER_TICK
235@fnindex CONFIGURE_MINIMUM_STACK_SIZE
236@item @code{CONFIGURE_MINIMUM_STACK_SIZE} is set to the number of bytes
237the application wants the minimum stack size to be for every task or
238thread in the system.  By default, this is set to the recommended minimum
239stack size for this processor.
240
241@fnindex CONFIGURE_INTERRUPT_STACK_SIZE
242@item @code{CONFIGURE_INTERRUPT_STACK_SIZE} is set to the
243size of the interrupt stack.  The interrupt stack size is
244usually set by the BSP but since this memory may be allocated
245from the RTEMS Ram Workspace, it must be accounted for.  The
246default for this field is the configured minimum stack size.  [NOTE:
247In some BSPs, changing this constant does NOT change the
248size of the interrupt stack, only the amount of memory
249reserved for it.] If not specified, the interrupt stack
250will be of minimum size.  The default value is the configured
251minimum stack size.
252
253@findex CONFIGURE_TASK_STACK_ALLOCATOR
254@item @code{CONFIGURE_TASK_STACK_ALLOCATOR}
255may point to a user provided routine to allocate task stacks.
256The default value for this field is NULL which indicates that
257task stacks will be allocated from the RTEMS Workspace.
258
259@findex CONFIGURE_TASK_STACK_DEALLOCATOR
260@item @code{CONFIGURE_TASK_STACK_DEALLOCATOR}
261may point to a user provided routine to free task stacks.
262The default value for this field is NULL which indicates that
263task stacks will be allocated from the RTEMS Workspace.
264
265@findex CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY
266@item @code{CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY}
267indicates whether RTEMS should zero the RTEMS Workspace and
268C Program Heap as part of its initialization.  If set to
269TRUE, the Workspace is zeroed.  Otherwise, it is not.
270Unless overridden by the BSP, the default value for this
271field is FALSE.
272
273@findex CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE
274@item @code{CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE} is a helper macro
275which is used to assist in computing the total amount of memory
276required for message buffers.  Each message queue will have its
277own configuration with maximum message size and maximum number of
278pending messages.  The interface for this macro is as follows:
279
280@example
281CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(max_messages, size_per)
282@end example
283
284Where @code{max_messages} is the maximum number of pending messages
285and @code{size_per} is the size in bytes of the user message.
286
287@findex CONFIGURE_MESSAGE_BUFFER_MEMORY
288@item @code{CONFIGURE_MESSAGE_BUFFER_MEMORY} is set to the number of
289bytes the application requires to be reserved for pending message queue
290buffers.  This value should include memory for all buffers across
291all APIs.  The default value is 0.
292
293The following illustrates how the help macro
294@code{CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE} can be used to assist in
295calculating the message buffer memory required.  In this example, there
296are two message queues used in this application.  The first message
297queue has maximum of 24 pending messages with the message structure
298defined by the type @code{one_message_type}.  The other message queue
299has maximum of 500 pending messages with the message structure defined
300by the type @code{other_message_type}.
301
302@example
303
304#define CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE \
305 (CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE( \
306    24, sizeof(one_message_type) + \
307  CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE( \
308    500, sizeof(other_message_type) \
309 )
310@end example
311
312@findex CONFIGURE_MEMORY_OVERHEAD
313@item @code{CONFIGURE_MEMORY_OVERHEAD} is set to the number of
314kilobytes the application wishes to add to the requirements calculated
315by @code{rtems/confdefs.h}.  The default value is 0.
316
317@findex CONFIGURE_EXTRA_TASK_STACKS
318@item @code{CONFIGURE_EXTRA_TASK_STACKS} is set to the number of
319bytes the applications wishes to add to the task stack requirements
320calculated by @code{rtems/confdefs.h}.  This parameter is very important.
321If the application creates tasks with stacks larger then the
322minimum, then that memory is NOT accounted for by @code{rtems/confdefs.h}.
323The default value is 0.
324
325@end itemize
326
327NOTE: The required size of the Executive RAM Work Area is calculated
328automatically when using the @code{rtems/confdefs.h} mechanism.
329
330@c
331@c
332@c
333@subsection Idle Task Configuration
334
335This section defines the IDLE task related configuration parameters
336supported by @code{rtems/confdefs.h}.
337
338@itemize @bullet
339
340@fnindex CONFIGURE_IDLE_TASK_BODY
341@item @code{CONFIGURE_IDLE_TASK_BODY} is set to the method name
342corresponding to the application specific IDLE thread body.  If
343not specified, the BSP or RTEMS default IDLE thread body will
344be used.  The default value is NULL.
345
346@fnindex CONFIGURE_IDLE_TASK_STACK_SIZE
347@item @code{CONFIGURE_IDLE_TASK_STACK_SIZE} is set to the
348desired stack size for the IDLE task.  If not specified,
349the IDLE task will have a stack of minimum size.  The default
350value is the configured minimum stack size.
351
352@fnindex CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION
353@item @code{CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION} is set to
354indicate that the user has configured @b{NO} user initialization tasks
355or threads and that the user provided IDLE task will perform application
356initialization and then transform itself into an IDLE task.  If you
357use this option be careful, the user IDLE task @b{CANNOT} block at
358all during the initialization sequence.  Further, once application
359initialization is complete, it must make itself preemptible and
360enter an IDLE body loop.  By default, this is not the mode of operation
361and the user is assumed to provide one or more initialization tasks.
362
363@end itemize
364
365@c
366@c
367@c
368@subsection Device Driver Table
369
370This section defines the configuration parameters related
371to the automatic generation of a Device Driver Table.  As
372@code{rtems/confdefs.h} only is aware of a small set of
373standard device drivers, the generated Device Driver
374Table is suitable for simple applications with no
375custom device drivers.
376
377@itemize @bullet
378@findex CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE
379@item @code{CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE} is defined if
380the application wishes to provide their own Device Driver Table.
381The table generated is an array of @code{rtems_driver_address_table}
382entries named @code{Device_drivers}.  By default, this is not
383defined indicating the @code{rtems/confdefs.h} is providing the
384device driver table.
385
386@findex CONFIGURE_MAXIMUM_DRIVERS
387@item @code{CONFIGURE_MAXIMUM_DRIVERS} is defined
388as the number of device drivers per node.  By default, this is
389set to 10.
390
391@findex CONFIGURE_MAXIMUM_DEVICES
392@item @code{CONFIGURE_MAXIMUM_DEVICES} is defined
393to the number of individual devices that may be registered
394in the system.  By default, this is set to 20.
395
396@findex CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
397@item @code{CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER}
398is defined
399if the application wishes to include the Console Device Driver.
400This device driver is responsible for providing standard input
401and output using "/dev/console".  By default, this is not
402defined.
403
404@findex CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
405@item @code{CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER}
406is defined
407if the application wishes to include the Clock Device Driver.
408This device driver is responsible for providing a regular
409interrupt which invokes the @code{rtems_clock_tick} directive.
410By default, this is not defined.
411
412@findex CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER
413@item @code{CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER}
414is defined if the application wishes to include the Timer Driver.
415This device driver is used to benchmark execution times
416by the RTEMS Timing Test Suites.  By default, this is not
417defined.
418
419@findex CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
420@item @code{CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER} is defined
421when the application does @b{NOT} want the Clock Device Driver
422and is @b{NOT} using the Timer Driver.  The inclusion or
423exclusion of the Clock Driver must be explicit in typical
424user applications.  This is intended to prevent the common
425user error of using the Hello World example as the baseline
426for an application and leaving out a clock tick source.
427
428@findex CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER
429@item @code{CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER}
430is defined if the application wishes to include the Real-Time Clock Driver.
431By default, this is not defined.
432
433@findex CONFIGURE_APPLICATION_NEEDS_WATCHDOG_DRIVER
434@item @code{CONFIGURE_APPLICATION_NEEDS_WATCHDOG_DRIVER}
435is defined if the application wishes to include the Watchdog Driver.
436By default, this is not defined.
437
438@findex CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER
439@item @code{CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER}
440is defined if the application wishes to include the Stub Device Driver.
441This device driver simply provides entry points that return
442successful and is primarily a test fixture.
443By default, this is not defined.
444
445@findex CONFIGURE_APPLICATION_EXTRA_DRIVERS
446@item @code{CONFIGURE_APPLICATION_EXTRA_DRIVERS}
447is defined if the application has device drivers it needs to
448include in the Device Driver Table.  This should be defined
449to the set of device driver entries that will be placed in
450the table.  By default, this is not defined.
451
452@end itemize
453
454@subsection Multiprocessing Configuration
455
456This section defines the multiprocessing related
457system configuration parameters supported by @code{rtems/confdefs.h}.
458This class of Configuration Constants are only applicable if
459@code{CONFIGURE_MP_APPLICATION} is defined.
460
461@itemize @bullet
462@findex CONFIGURE_HAS_OWN_MULTIPROCESSING_TABLE
463@item @code{CONFIGURE_HAS_OWN_MULTIPROCESSING_TABLE} is defined
464if the application wishes to provide their own Multiprocessing
465Configuration Table.  The generated table is named
466@code{Multiprocessing_configuration}.  By default, this
467is not defined.
468
469@findex CONFIGURE_MP_NODE_NUMBER
470@item @code{CONFIGURE_MP_NODE_NUMBER} is the node number of
471this node in a multiprocessor system.  The default node number
472is @code{NODE_NUMBER} which is set directly in RTEMS test Makefiles.
473
474@findex CONFIGURE_MP_MAXIMUM_NODES
475@item @code{CONFIGURE_MP_MAXIMUM_NODES} is the maximum number
476of nodes in a multiprocessor system.  The default is 2.
477
478@findex CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS
479@item @code{CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS}
480is the maximum number
481of concurrently active global objects in a multiprocessor
482system.  The default is 32.
483
484@findex CONFIGURE_MP_MAXIMUM_PROXIES
485@item @code{CONFIGURE_MP_MAXIMUM_PROXIES} is the maximum number
486of concurrently active thread/task proxies in a multiprocessor
487system.  The default is 32.
488
489@findex CONFIGURE_MP_MPCI_TABLE_POINTER
490@item @code{CONFIGURE_MP_MPCI_TABLE_POINTER} is the pointer
491to the MPCI Configuration Table.  The default value of
492this field is @code{&MPCI_table}.
493@end itemize
494
495@subsection Classic API Configuration
496
497This section defines the Classic API related
498system configuration parameters supported by @code{rtems/confdefs.h}.
499
500@itemize @bullet
501@findex CONFIGURE_MAXIMUM_TASKS
502@item @code{CONFIGURE_MAXIMUM_TASKS} is the maximum number of
503Classic API tasks that can be concurrently active.
504The default for this field is 0.
505
506@findex CONFIGURE_DISABLE_CLASSIC_NOTEPADS
507@item @code{CONFIGURE_DISABLE_CLASSIC_NOTEPADS} should be defined
508if the user does not want to have support for Classic API Notepads
509in their application.  By default, this is not defined and Classic API
510Notepads are supported.
511
512@findex CONFIGURE_MAXIMUM_TIMERS
513@item @code{CONFIGURE_MAXIMUM_TIMERS} is the maximum number of
514Classic API timers that can be concurrently active.
515The default for this field is 0.
516
517@findex CONFIGURE_MAXIMUM_SEMAPHORES
518@item @code{CONFIGURE_MAXIMUM_SEMAPHORES} is the maximum number of
519Classic API semaphores that can be concurrently active.
520The default for this field is 0.
521
522@findex CONFIGURE_MAXIMUM_MESSAGE_QUEUES
523@item @code{CONFIGURE_MAXIMUM_MESSAGE_QUEUES} is the maximum number of
524Classic API message queues that can be concurrently active.
525The default for this field is 0.
526
527@findex CONFIGURE_MAXIMUM_PARTITIONS
528@item @code{CONFIGURE_MAXIMUM_PARTITIONS} is the maximum number of
529Classic API partitions that can be concurrently active.
530The default for this field is 0.
531
532@findex CONFIGURE_MAXIMUM_REGIONS
533@item @code{CONFIGURE_MAXIMUM_REGIONS} is the maximum number of
534Classic API regions that can be concurrently active.
535The default for this field is 0.
536
537@findex CONFIGURE_MAXIMUM_PORTS
538@item @code{CONFIGURE_MAXIMUM_PORTS} is the maximum number of
539Classic API ports that can be concurrently active.
540The default for this field is 0.
541
542@findex CONFIGURE_MAXIMUM_PERIODS
543@item @code{CONFIGURE_MAXIMUM_PERIODS} is the maximum number of
544Classic API rate monotonic periods that can be concurrently active.
545The default for this field is 0.
546
547@findex CONFIGURE_MAXIMUM_USER_EXTENSIONS
548@item @code{CONFIGURE_MAXIMUM_USER_EXTENSIONS} is the maximum number of
549Classic API user extensions that can be concurrently active.
550The default for this field is 0.
551
552@end itemize
553
554@subsection Classic API Initialization Tasks Table Configuration
555
556The @code{rtems/confdefs.h} configuration system can automatically
557generate an Initialization Tasks Table named
558@code{Initialization_tasks} with a single entry.  The following
559parameters control the generation of that table.
560
561@itemize @bullet
562@findex CONFIGURE_RTEMS_INIT_TASKS_TABLE
563@item @code{CONFIGURE_RTEMS_INIT_TASKS_TABLE} is defined
564if the user wishes to use a Classic RTEMS API Initialization
565Task Table.  The application may choose to use the initialization
566tasks or threads table from another API.  By default, this
567field is not defined as the user MUST select their own
568API for initialization tasks.
569
570@findex CONFIGURE_HAS_OWN_INIT_TASK_TABLE
571@item @code{CONFIGURE_HAS_OWN_INIT_TASK_TABLE} is defined
572if the user wishes to define their own Classic API Initialization
573Tasks Table.  This table should be named @code{Initialization_tasks}.
574By default, this is not defined.
575
576@findex CONFIGURE_INIT_TASK_NAME
577@item @code{CONFIGURE_INIT_TASK_NAME} is the name
578of the single initialization task defined by the
579Classic API Initialization Tasks Table.  By default
580the value is @code{rtems_build_name( 'U', 'I', '1', ' ' )}.
581
582@findex CONFIGURE_INIT_TASK_STACK_SIZE
583@item @code{CONFIGURE_INIT_TASK_STACK_SIZE}
584is the stack size
585of the single initialization task defined by the
586Classic API Initialization Tasks Table.  By default
587value is the configured minimum stack size.
588
589@findex CONFIGURE_INIT_TASK_PRIORITY
590@item @code{CONFIGURE_INIT_TASK_PRIORITY}
591is the initial priority
592of the single initialization task defined by the
593Classic API Initialization Tasks Table.  By default
594the value is 1 which is the highest priority
595in the Classic API.
596
597@findex CONFIGURE_INIT_TASK_ATTRIBUTES
598@item @code{CONFIGURE_INIT_TASK_ATTRIBUTES}
599is the task attributes
600of the single initialization task defined by the
601Classic API Initialization Tasks Table.  By default
602the value is @code{RTEMS_DEFAULT_ATTRIBUTES}.
603
604@findex CONFIGURE_INIT_TASK_ENTRY_POINT
605@item @code{CONFIGURE_INIT_TASK_ENTRY_POINT}
606is the entry point (a.k.a. function name)
607of the single initialization task defined by the
608Classic API Initialization Tasks Table.  By default
609the value is @code{Init}.
610
611@findex CONFIGURE_INIT_TASK_INITIAL_MODES
612@item @code{CONFIGURE_INIT_TASK_INITIAL_MODES}
613is the initial execution mode
614of the single initialization task defined by the
615Classic API Initialization Tasks Table.  By default
616the value is @code{RTEMS_NO_PREEMPT}.
617
618@findex CONFIGURE_INIT_TASK_ARGUMENTS
619@item @code{CONFIGURE_INIT_TASK_ARGUMENTS}
620is the task argument
621of the single initialization task defined by the
622Classic API Initialization Tasks Table.  By default
623the value is 0.
624
625@end itemize
626
627
628@subsection POSIX API Configuration
629
630The parameters in this section are used to configure resources
631for the RTEMS POSIX API.  They are only relevant if the POSIX API
632is enabled at configure time using the @code{--enable-posix} option.
633
634@itemize @bullet
635@findex CONFIGURE_MAXIMUM_POSIX_THREADS
636@item @code{CONFIGURE_MAXIMUM_POSIX_THREADS} is the maximum number of
637POSIX API threads that can be concurrently active.
638The default is 0.
639
640@findex CONFIGURE_MAXIMUM_POSIX_MUTEXES
641@item @code{CONFIGURE_MAXIMUM_POSIX_MUTEXES} is the maximum number of
642POSIX API mutexes that can be concurrently active.
643The default is 0.
644
645@findex CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES
646@item @code{CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES} is the maximum number of
647POSIX API condition variables that can be concurrently active.
648The default is 0.
649
650@findex CONFIGURE_MAXIMUM_POSIX_KEYS
651@item @code{CONFIGURE_MAXIMUM_POSIX_KEYS} is the maximum number of
652POSIX API keys that can be concurrently active.
653The default is 0.
654
655@findex CONFIGURE_MAXIMUM_POSIX_TIMERS
656@item @code{CONFIGURE_MAXIMUM_POSIX_TIMERS} is the maximum number of
657POSIX API timers that can be concurrently active.
658The default is 0.
659
660@findex CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS
661@item @code{CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS} is the maximum number of
662POSIX API queued signals that can be concurrently active.
663The default is 0.
664
665@findex CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES
666@item @code{CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES} is the maximum number of
667POSIX API message queues that can be concurrently active.
668The default is 0.
669
670@findex CONFIGURE_MAXIMUM_POSIX_SEMAPHORES
671@item @code{CONFIGURE_MAXIMUM_POSIX_SEMAPHORES} is the maximum number of
672POSIX API semaphores that can be concurrently active.
673The default is 0.
674
675@end itemize
676
677@subsection POSIX Initialization Threads Table Configuration
678
679The @code{rtems/confdefs.h} configuration system can automatically
680generate a POSIX Initialization Threads Table named
681@code{POSIX_Initialization_threads} with a single entry.  The following
682parameters control the generation of that table.
683
684@itemize @bullet
685@findex CONFIGURE_POSIX_INIT_THREAD_TABLE
686@item @code{CONFIGURE_POSIX_INIT_THREAD_TABLE}
687is defined
688if the user wishes to use a POSIX API Initialization
689Threads Table.  The application may choose to use the initialization
690tasks or threads table from another API.  By default, this
691field is not defined as the user MUST select their own
692API for initialization tasks.
693
694@findex CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE
695@item @code{CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE}
696is defined if the user wishes to define their own POSIX API Initialization
697Threads Table.  This table should be named @code{POSIX_Initialization_threads}.
698By default, this is not defined.
699
700@findex CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT
701@item @code{CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT}
702is the entry point (a.k.a. function name)
703of the single initialization thread defined by the
704POSIX API Initialization Threads Table.  By default
705the value is @code{POSIX_Init}.
706
707@findex CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE
708@item @code{CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE}
709is the stack size of the single initialization thread defined by the
710POSIX API Initialization Threads Table.  By default
711value is twice the configured minimum stack size.
712
713@end itemize
714
715@subsection ITRON API Configuration
716
717The parameters in this section are used to configure resources
718for the RTEMS ITRON API.  They are only relevant if the POSIX API
719is enabled at configure time using the @code{--enable-itron} option.
720
721@itemize @bullet
722@findex CONFIGURE_MAXIMUM_ITRON_TASKS
723@item @code{CONFIGURE_MAXIMUM_ITRON_TASKS}
724is the maximum number of
725ITRON API tasks that can be concurrently active.
726The default is 0.
727
728@findex CONFIGURE_MAXIMUM_ITRON_SEMAPHORES
729@item @code{CONFIGURE_MAXIMUM_ITRON_SEMAPHORES}
730is the maximum number of
731ITRON API semaphores that can be concurrently active.
732The default is 0.
733
734@findex CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS
735@item @code{CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS}
736is the maximum number of
737ITRON API eventflags that can be concurrently active.
738The default is 0.
739
740@findex CONFIGURE_MAXIMUM_ITRON_MAILBOXES
741@item @code{CONFIGURE_MAXIMUM_ITRON_MAILBOXES}
742is the maximum number of
743ITRON API mailboxes that can be concurrently active.
744The default is 0.
745
746@findex CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS
747@item @code{CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS}
748is the maximum number of
749ITRON API message buffers that can be concurrently active.
750The default is 0.
751
752@findex CONFIGURE_MAXIMUM_ITRON_PORTS
753@item @code{CONFIGURE_MAXIMUM_ITRON_PORTS}
754is the maximum number of
755ITRON API ports that can be concurrently active.
756The default is 0.
757
758@findex CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS
759@item @code{CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS}
760is the maximum number of
761ITRON API memory pools that can be concurrently active.
762The default is 0.
763
764@findex CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS
765@item @code{CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS}
766is the maximum number of
767ITRON API fixed memory pools that can be concurrently active.
768The default is 0.
769
770@end itemize
771
772@subsection ITRON Initialization Task Table Configuration
773
774The @code{rtems/confdefs.h} configuration system can automatically
775generate an ITRON Initialization Tasks Table named
776@code{ITRON_Initialization_tasks} with a single entry.  The following
777parameters control the generation of that table.
778
779@itemize @bullet
780@findex CONFIGURE_ITRON_INIT_TASK_TABLE
781@item @code{CONFIGURE_ITRON_INIT_TASK_TABLE} is defined
782if the user wishes to use a ITRON API Initialization
783Tasks Table.  The application may choose to use the initialization
784tasks or threads table from another API.  By default, this
785field is not defined as the user MUST select their own
786API for initialization tasks.
787
788@findex CONFIGURE_ITRON_HAS_OWN_INIT_TASK_TABLE
789@item @code{CONFIGURE_ITRON_HAS_OWN_INIT_TASK_TABLE}
790is defined if the user wishes to define their own ITRON API Initialization
791Tasks Table.  This table should be named @code{ITRON_Initialization_tasks}.
792By default, this is not defined.
793
794@findex CONFIGURE_ITRON_INIT_TASK_ENTRY_POINT
795@item @code{CONFIGURE_ITRON_INIT_TASK_ENTRY_POINT}
796is the entry point (a.k.a. function name)
797of the single initialization task defined by the
798ITRON API Initialization Tasks Table.  By default
799the value is @code{ITRON_Init}.
800
801@findex CONFIGURE_ITRON_INIT_TASK_ATTRIBUTES
802@item @code{CONFIGURE_ITRON_INIT_TASK_ATTRIBUTES}
803is the attribute set
804of the single initialization task defined by the
805ITRON API Initialization Tasks Table.  By default
806the value is @code{TA_HLNG}.
807
808@findex CONFIGURE_ITRON_INIT_TASK_PRIORITY
809@item @code{CONFIGURE_ITRON_INIT_TASK_PRIORITY}
810is the initial priority
811of the single initialization task defined by the
812ITRON API Initialization Tasks Table.  By default
813the value is @code{1} which is the highest priority
814in the ITRON API.
815
816@findex CONFIGURE_ITRON_INIT_TASK_STACK_SIZE
817@item @code{CONFIGURE_ITRON_INIT_TASK_STACK_SIZE}
818is the stack size of the single initialization task defined by the
819ITRON API Initialization Tasks Table.  By default
820value is the configured minimum stack size.
821
822@end itemize
823
824@subsection Ada Tasks
825
826This section defines the system configuration parameters supported
827by @code{rtems/confdefs.h} related to configuring RTEMS to support
828a task using Ada tasking with GNAT.
829
830@itemize @bullet
831@findex CONFIGURE_GNAT_RTEMS
832@item @code{CONFIGURE_GNAT_RTEMS} is defined to inform
833RTEMS that the GNAT Ada run-time is to be used by the
834application.  This configuration parameter is critical
835as it makes @code{rtems/confdefs.h} configure the resources
836(mutexes and keys) used implicitly by the GNAT run-time.
837By default, this parameter is not defined.
838
839@findex CONFIGURE_MAXIMUM_ADA_TASKS
840@item @code{CONFIGURE_MAXIMUM_ADA_TASKS} is the
841number of Ada tasks that can be concurrently active
842in the system.  By default, when @code{CONFIGURE_GNAT_RTEMS}
843is defined, this is set to 20.
844
845@findex CONFIGURE_MAXIMUM_FAKE_ADA_TASKS
846@item @code{CONFIGURE_MAXIMUM_FAKE_ADA_TASKS} is
847the number of "fake" Ada tasks that can be concurrently
848active in the system.  A "fake" Ada task is a non-Ada
849task that makes calls back into Ada code and thus
850implicitly uses the Ada run-time.
851
852@end itemize
853
854@section Configuration Table
855
856@cindex Configuration Table
857@cindex RTEMS Configuration Table
858
859The RTEMS Configuration Table is used to tailor an
860application for its specific needs.  For example, the user can
861configure the number of device drivers or which APIs may be used.
862THe address of the user-defined Configuration Table is passed as an
863argument to the @code{rtems_initialize_executive}
864directive, which MUST be the first RTEMS directive called. 
865The RTEMS Configuration Table is defined in the following C structure:
866
867@findex rtems_configuration_table
868@example
869@group
870typedef struct @{
871  void                           *work_space_start;
872  uint32_t                        work_space_size;
873  uint32_t                        maximum_extensions;
874  uint32_t                        microseconds_per_tick;
875  uint32_t                        ticks_per_timeslice;
876  void                          (*idle_task)( void );
877  uint32_t                        idle_task_stack_size;
878  uint32_t                        interrupt_stack_size;
879  void *                        (*stack_allocate_hook)( uint32_t );
880  void                          (*stack_free_hook)( void * );
881  boolean                         do_zero_of_workspace;
882  uint32_t                        maximum_drivers;
883  uint32_t                        number_of_device_drivers;
884  rtems_driver_address_table     *Device_driver_table;
885  uint32_t                        number_of_initial_extensions;
886  rtems_extensions_table         *User_extension_table;
887#if defined(RTEMS_MULTIPROCESSING)
888  rtems_multiprocessing_table    *User_multiprocessing_table;
889#endif
890  rtems_api_configuration_table  *RTEMS_api_configuration;
891  posix_api_configuration_table  *POSIX_api_configuration;
892  itron_api_configuration        *ITRON_api_configuration;
893@} rtems_configuration_table;
894@end group
895@end example
896
897@table @b
898@item work_space_start
899is the address of the RTEMS RAM Workspace. 
900This area contains items such as the
901various object control blocks (TCBs, QCBs, ...) and task stacks.
902If the address is not aligned on a four-word boundary, then
903RTEMS will invoke the fatal error handler during
904@code{rtems_initialize_executive}.
905When using the @code{rtems/confdefs.h} mechanism for configuring
906an RTEMS application, the value for this field corresponds
907to the setting of the macro @code{CONFIGURE_EXECUTIVE_RAM_WORK_AREA}
908which defaults to @code{NULL}.  Normally, this field should be
909configured as @code{NULL} as BSPs will assign memory for the
910RTEMS RAM Workspace as part of system initialization.
911
912@item work_space_size
913is the calculated size of the
914RTEMS RAM Workspace.  The section Sizing the RTEMS RAM Workspace
915details how to arrive at this number.
916When using the @code{rtems/confdefs.h} mechanism for configuring
917an RTEMS application, the value for this field corresponds
918to the setting of the macro @code{CONFIGURE_EXECUTIVE_RAM_SIZE}
919and is calculated based on the other system configuration settings.
920
921@item microseconds_per_tick
922is number of microseconds per clock tick.
923When using the @code{rtems/confdefs.h} mechanism for configuring
924an RTEMS application, the value for this field corresponds
925to the setting of the macro @code{CONFIGURE_MICROSECONDS_PER_TICK}.
926If not defined by the application, then the
927@code{CONFIGURE_MICROSECONDS_PER_TICK} macro defaults to 10000
928(10 milliseconds).
929
930@item ticks_per_timeslice
931is the number of clock ticks for a timeslice.
932When using the @code{rtems/confdefs.h} mechanism for configuring
933an RTEMS application, the value for this field corresponds
934to the setting of the macro @code{CONFIGURE_TICKS_PER_TIMESLICE}.
935
936@item idle_task
937is the address of the optional user
938provided routine which is used as the system's IDLE task.  If
939this field is not NULL, then the RTEMS default IDLE task is not
940used.  This field may be NULL to indicate that the default IDLE
941is to be used.  When using the @code{rtems/confdefs.h} mechanism
942for configuring an RTEMS application, the value for this field
943corresponds to the setting of the macro @code{CONFIGURE_IDLE_TASK_BODY}.
944
945@item idle_task_stack_size
946is the size of the RTEMS idle task stack in bytes.  If this number is less
947than the configured minimum stack size, then the idle task's stack will
948be set to the minimum.  When using the @code{rtems/confdefs.h} mechanism
949for configuring an RTEMS application, the value for this field corresponds
950to the setting of the macro @code{CONFIGURE_IDLE_TASK_STACK_SIZE}.
951
952@item interrupt_stack_size
953is the size of the RTEMS interrupt stack in bytes.  If this number is less
954than configured minimum stack size, then the interrupt stack will be set
955to the minimum.  When using the @code{rtems/confdefs.h} mechanism for
956configuring an RTEMS application, the value for this field corresponds
957to the setting of the macro @code{CONFIGURE_INTERRUPT_STACK_SIZE}.
958
959@item stack_allocate_hook
960may point to a user provided routine to allocate task stacks.
961The default is to allocate task stacks from the RTEMS Workspace.
962When using the @code{rtems/confdefs.h} mechanism
963for configuring an RTEMS application, the value for this field
964corresponds to the setting of the macro
965@code{CONFIGURE_TASK_STACK_ALLOCATOR}.
966
967@item stack_free_hook
968may point to a user provided routine to free task stacks.
969The default is to allocate task stacks from the RTEMS Workspace.
970When using the @code{rtems/confdefs.h} mechanism
971for configuring an RTEMS application, the value for this field
972corresponds to the setting of the macro
973@code{CONFIGURE_TASK_STACK_DEALLOCATOR}.
974
975@item do_zero_of_workspace
976indicates whether RTEMS should zero the RTEMS Workspace and
977C Program Heap as part of its initialization.  If set to
978TRUE, the Workspace is zeroed.  Otherwise, it is not.
979When using the @code{rtems/confdefs.h} mechanism
980for configuring an RTEMS application, the value for this field
981corresponds to the setting of the macro
982@code{CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY}.
983
984@item maximum_drivers
985is the maximum number of device drivers that can be registered.
986When using the @code{rtems/confdefs.h} mechanism for configuring
987an RTEMS application, the value for this field corresponds
988to the setting of the macro @code{CONFIGURE_MAXIMUM_DRIVERS}.
989
990@item number_of_device_drivers
991is the number of device drivers for the system.  There should be
992the same number of entries in the Device Driver Table.  If this field
993is zero, then the @code{User_driver_address_table} entry should be NULL.
994When using the @code{rtems/confdefs.h} mechanism for configuring
995an RTEMS application, the value for this field is calculated
996automatically based on the number of entries in the
997Device Driver Table.  This calculation is based on the assumption
998that the Device Driver Table is named @code{Device_drivers}
999and defined in C.  This table may be generated automatically
1000for simple applications using only the device drivers that correspond
1001to the following macros:
1002
1003@itemize @bullet
1004
1005@item @code{CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER}
1006@item @code{CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER}
1007@item @code{CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER}
1008@item @code{CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER}
1009@item @code{CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER}
1010
1011@end itemize
1012
1013Note that network device drivers are not configured in the
1014Device Driver Table.
1015
1016@item Device_driver_table
1017is the address of the Device Driver Table.  This table contains the entry
1018points for each device driver.  If the number_of_device_drivers field is zero,
1019then this entry should be NULL. The format of this table will be
1020discussed below.
1021When using the @code{rtems/confdefs.h} mechanism for configuring
1022an RTEMS application, the Device Driver Table is assumed to be
1023named @code{Device_drivers} and defined in C.  If the application is providing
1024its own Device Driver Table, then the macro
1025@code{CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE} must be defined to indicate
1026this and prevent @code{rtems/confdefs.h} from generating the table.
1027
1028@item number_of_initial_extensions
1029is the number of initial user extensions.  There should be
1030the same number of entries as in the User_extension_table.  If this field
1031is zero, then the User_driver_address_table entry should be NULL.
1032When using the @code{rtems/confdefs.h} mechanism for configuring
1033an RTEMS application, the value for this field corresponds
1034to the setting of the macro @code{CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS}
1035which is set automatically by @code{rtems/confdefs.h} based on the size
1036of the User Extensions Table.
1037
1038@item User_extension_table
1039is the address of the User
1040Extension Table.  This table contains the entry points for the
1041static set of optional user extensions.  If no user extensions
1042are configured, then this entry should be NULL.  The format of
1043this table will be discussed below.
1044When using the @code{rtems/confdefs.h} mechanism for configuring
1045an RTEMS application, the User Extensions Table is named
1046@code{Configuration_Initial_Extensions} and defined in
1047confdefs.h.  It is initialized based on the following
1048macros:
1049
1050@itemize @bullet
1051
1052@item @code{CONFIGURE_INITIAL_EXTENSIONS}
1053@item @code{STACK_CHECKER_EXTENSION}
1054
1055@end itemize
1056
1057The application may configure one or more initial user extension
1058sets by setting the @code{CONFIGURE_INITIAL_EXTENSIONS} macro.  By
1059defining the @code{STACK_CHECKER_EXTENSION} macro, the task stack bounds
1060checking user extension set is automatically included in the
1061application.
1062
1063@item User_multiprocessing_table
1064is the address of the Multiprocessor Configuration Table.  This
1065table contains information needed by RTEMS only when used in a multiprocessor
1066configuration.  This field must be NULL when RTEMS is used in a
1067single processor configuration.
1068When using the @code{rtems/confdefs.h} mechanism for configuring
1069an RTEMS application, the Multiprocessor Configuration Table
1070is automatically generated when the @code{CONFIGURE_MP_APPLICATION}
1071is defined.  If @code{CONFIGURE_MP_APPLICATION} is not defined, the this
1072entry is set to NULL.  The generated table has the name
1073@code{Multiprocessing_configuration}.
1074
1075@item RTEMS_api_configuration
1076is the address of the RTEMS API Configuration Table.  This table
1077contains information needed by the RTEMS API.  This field should be
1078NULL if the RTEMS API is not used.  [NOTE: Currently the RTEMS API
1079is required to support support components such as BSPs and libraries
1080which use this API.]  This table is built automatically and this
1081entry filled in, if using the @code{rtems/confdefs.h} application
1082configuration mechanism.  The generated table has the name
1083@code{Configuration_RTEMS_API}.
1084
1085@item POSIX_api_configuration
1086is the address of the POSIX API Configuration Table.  This table
1087contains information needed by the POSIX API.  This field should be
1088NULL if the POSIX API is not used.  This table is built automatically
1089and this entry filled in, if using the @code{rtems/confdefs.h} application
1090configuration mechanism.  The @code{rtems/confdefs.h} application
1091mechanism will fill this field in with the address of the
1092@code{Configuration_POSIX_API} table of POSIX API is configured
1093and NULL if the POSIX API is not configured.
1094
1095@end table
1096
1097@section RTEMS API Configuration Table
1098
1099@cindex RTEMS API Configuration Table
1100
1101The RTEMS API Configuration Table is used to configure the
1102managers which constitute the RTEMS API for a particular application. 
1103For example, the user can configure the maximum number of tasks for
1104this application. The RTEMS API Configuration Table is defined in
1105the following C structure:
1106
1107@findex rtems_api_configuration_table
1108@example
1109@group
1110typedef struct @{
1111  uint32_t  maximum_tasks;
1112  uint32_t  maximum_timers;
1113  uint32_t  maximum_semaphores;
1114  uint32_t  maximum_message_queues;
1115  uint32_t  maximum_partitions;
1116  uint32_t  maximum_regions;
1117  uint32_t  maximum_ports;
1118  uint32_t  maximum_periods;
1119  uint32_t  maximum_barriers;
1120  uint32_t  number_of_initialization_tasks;
1121  rtems_initialization_tasks_table *User_initialization_tasks_table;
1122@} rtems_api_configuration_table;
1123@end group
1124@end example
1125
1126@table @b
1127@item maximum_tasks
1128is the maximum number of tasks that
1129can be concurrently active (created) in the system including
1130initialization tasks.
1131When using the @code{rtems/confdefs.h} mechanism for configuring
1132an RTEMS application, the value for this field corresponds
1133to the setting of the macro @code{CONFIGURE_MAXIMUM_TASKS}.
1134If not defined by the application, then the @code{CONFIGURE_MAXIMUM_TASKS}
1135macro defaults to 0.
1136
1137@item maximum_timers
1138is the maximum number of timers
1139that can be concurrently active in the system.
1140When using the @code{rtems/confdefs.h} mechanism for configuring
1141an RTEMS application, the value for this field corresponds
1142to the setting of the macro @code{CONFIGURE_MAXIMUM_TIMERS}.
1143If not defined by the application, then the @code{CONFIGURE_MAXIMUM_TIMERS}
1144macro defaults to 0.
1145
1146@item maximum_semaphores
1147is the maximum number of
1148semaphores that can be concurrently active in the system.
1149When using the @code{rtems/confdefs.h} mechanism for configuring
1150an RTEMS application, the value for this field corresponds
1151to the setting of the macro @code{CONFIGURE_MAXIMUM_SEMAPHORES}.
1152If not defined by the application, then the @code{CONFIGURE_MAXIMUM_SEMAPHORES}
1153macro defaults to 0.
1154
1155@item maximum_message_queues
1156is the maximum number of
1157message queues that can be concurrently active in the system.
1158When using the @code{rtems/confdefs.h} mechanism for configuring
1159an RTEMS application, the value for this field corresponds
1160to the setting of the macro @code{CONFIGURE_MAXIMUM_MESSAGE_QUEUES}.
1161If not defined by the application, then the
1162@code{CONFIGURE_MAXIMUM_MESSAGE_QUEUES} macro defaults to 0.
1163
1164@item maximum_partitions
1165is the maximum number of
1166partitions that can be concurrently active in the system.
1167When using the @code{rtems/confdefs.h} mechanism for configuring
1168an RTEMS application, the value for this field corresponds
1169to the setting of the macro @code{CONFIGURE_MAXIMUM_PARTITIONS}.
1170If not defined by the application, then the @code{CONFIGURE_MAXIMUM_PARTITIONS}
1171macro defaults to 0.
1172
1173@item maximum_regions
1174is the maximum number of regions
1175that can be concurrently active in the system.
1176When using the @code{rtems/confdefs.h} mechanism for configuring
1177an RTEMS application, the value for this field corresponds
1178to the setting of the macro @code{CONFIGURE_MAXIMUM_REGIONS}.
1179If not defined by the application, then the @code{CONFIGURE_MAXIMUM_REGIONS}
1180macro defaults to 0.
1181
1182@item maximum_ports
1183is the maximum number of ports into
1184dual-port memory areas that can be concurrently active in the
1185system.
1186When using the @code{rtems/confdefs.h} mechanism for configuring
1187an RTEMS application, the value for this field corresponds
1188to the setting of the macro @code{CONFIGURE_MAXIMUM_PORTS}.
1189If not defined by the application, then the @code{CONFIGURE_MAXIMUM_PORTS}
1190macro defaults to 0.
1191
1192@item number_of_initialization_tasks
1193is the number of initialization tasks configured.  At least one
1194RTEMS initialization task or POSIX initializatin must be configured
1195in order for the user's application to begin executing.
1196When using the @code{rtems/confdefs.h} mechanism for configuring
1197an RTEMS application, the user must define the
1198@code{CONFIGURE_RTEMS_INIT_TASKS_TABLE} to indicate that there
1199is one or more RTEMS initialization task.  If the application
1200only has one RTEMS initialization task, then the automatically
1201generated Initialization Task Table will be sufficient.  The following
1202macros correspond to the single initialization task:
1203 
1204@itemize @bullet
1205
1206@item @code{CONFIGURE_INIT_TASK_NAME} - is the name of the task. 
1207If this macro is not defined by the application, then this defaults
1208to the task name of @code{"UI1 "} for User Initialization Task 1.
1209
1210@item @code{CONFIGURE_INIT_TASK_STACK_SIZE} - is the stack size
1211of the single initialization task.  If this macro is not defined
1212by the application, then this defaults to configured minimum
1213stack size.
1214
1215@item @code{CONFIGURE_INIT_TASK_PRIORITY} - is the initial priority
1216of the single initialization task.  If this macro is not defined
1217by the application, then this defaults to 1.
1218
1219@item @code{CONFIGURE_INIT_TASK_ATTRIBUTES} - is the attributes
1220of the single initialization task.  If this macro is not defined
1221by the application, then this defaults to @code{RTEMS_DEFAULT_ATTRIBUTES}.
1222
1223@item @code{CONFIGURE_INIT_TASK_ENTRY_POINT} - is the entry point
1224of the single initialization task.  If this macro is not defined
1225by the application, then this defaults to the C language routine
1226@code{Init}.
1227
1228@item @code{CONFIGURE_INIT_TASK_INITIAL_MODES} - is the initial execution
1229modes of the single initialization task.  If this macro is not defined
1230by the application, then this defaults to @code{RTEMS_NO_PREEMPT}.
1231
1232@item @code{CONFIGURE_INIT_TASK_ARGUMENTS} - is the argument passed to the
1233of the single initialization task.  If this macro is not defined
1234by the application, then this defaults to 0.
1235
1236
1237@end itemize
1238
1239
1240has the option to have
1241 value for this field corresponds
1242to the setting of the macro @code{}.
1243
1244@item User_initialization_tasks_table
1245is the address of the Initialization Task Table. This table contains the
1246information needed to create and start each of the
1247initialization tasks.  The format of this table will be discussed below.
1248When using the @code{rtems/confdefs.h} mechanism for configuring
1249an RTEMS application, the value for this field corresponds
1250to the setting of the macro @code{CONFIGURE_EXECUTIVE_RAM_WORK_AREA}.
1251
1252@end table
1253
1254@section POSIX API Configuration Table
1255
1256@cindex POSIX API Configuration Table
1257
1258The POSIX API Configuration Table is used to configure the
1259managers which constitute the POSIX API for a particular application.
1260For example, the user can configure the maximum number of threads for
1261this application. The POSIX API Configuration Table is defined in
1262the following C structure:
1263 
1264@findex posix_initialization_threads_table
1265@findex posix_api_configuration_table
1266@example
1267@group
1268typedef struct @{
1269  void       *(*thread_entry)(void *);
1270@} posix_initialization_threads_table;
1271 
1272typedef struct @{
1273  int                                 maximum_threads;
1274  int                                 maximum_mutexes;
1275  int                                 maximum_condition_variables;
1276  int                                 maximum_keys;
1277  int                                 maximum_timers;
1278  int                                 maximum_queued_signals;
1279  int                                 maximum_message_queues;
1280  int                                 maximum_semaphores;
1281  int                                 maximum_barriers;
1282  int                                 maximum_rwlocks;
1283  int                                 maximum_spinlocks;
1284  int                                 number_of_initialization_tasks;
1285  posix_initialization_threads_table *User_initialization_tasks_table;
1286@} posix_api_configuration_table;
1287@end group
1288@end example
1289 
1290@table @b
1291@item maximum_threads
1292is the maximum number of threads that
1293can be concurrently active (created) in the system including
1294initialization threads.
1295When using the @code{rtems/confdefs.h} mechanism for configuring
1296an RTEMS application, the value for this field corresponds
1297to the setting of the macro @code{CONFIGURE_MAXIMUM_POSIX_THREADS}.
1298If not defined by the application, then the
1299@code{CONFIGURE_MAXIMUM_POSIX_THREADS} macro defaults to 0.
1300
1301@item maximum_mutexes
1302is the maximum number of mutexes that can be concurrently
1303active in the system.
1304When using the @code{rtems/confdefs.h} mechanism for configuring
1305an RTEMS application, the value for this field corresponds
1306to the setting of the macro @code{CONFIGURE_MAXIMUM_POSIX_MUTEXES}.
1307If not defined by the application, then the
1308@code{CONFIGURE_MAXIMUM_POSIX_MUTEXES} macro defaults to 0.
1309
1310@item maximum_condition_variables
1311is the maximum number of condition variables that can be
1312concurrently active in the system.
1313When using the @code{rtems/confdefs.h} mechanism for configuring
1314an RTEMS application, the value for this field corresponds
1315to the setting of the macro @code{CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES}.
1316If not defined by the application, then the
1317@code{CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES} macro defaults to 0.
1318
1319@item maximum_keys
1320is the maximum number of keys that can be concurrently active in the system.
1321When using the @code{rtems/confdefs.h} mechanism for configuring
1322an RTEMS application, the value for this field corresponds
1323to the setting of the macro @code{CONFIGURE_MAXIMUM_POSIX_KEYS}.
1324If not defined by the application, then the
1325@code{CONFIGURE_MAXIMUM_POSIX_KEYS} macro defaults to 0.
1326
1327@item maximum_timers
1328is the maximum number of POSIX timers that can be concurrently active
1329in the system.
1330When using the @code{rtems/confdefs.h} mechanism for configuring
1331an RTEMS application, the value for this field corresponds
1332to the setting of the macro @code{CONFIGURE_MAXIMUM_POSIX_TIMERS}.
1333If not defined by the application, then the
1334@code{CONFIGURE_MAXIMUM_POSIX_TIMERS} macro defaults to 0.
1335
1336@item maximum_queued_signals
1337is the maximum number of queued signals that can be concurrently
1338pending in the system.
1339When using the @code{rtems/confdefs.h} mechanism for configuring
1340an RTEMS application, the value for this field corresponds
1341to the setting of the macro @code{CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS}.
1342If not defined by the application, then the
1343@code{CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS} macro defaults to 0.
1344
1345@item number_of_initialization_threads
1346is the number of initialization threads configured.  At least one
1347initialization threads must be configured.
1348When using the @code{rtems/confdefs.h} mechanism for configuring
1349an RTEMS application, the user must define the
1350@code{CONFIGURE_POSIX_INIT_THREAD_TABLE} to indicate that there
1351is one or more POSIX initialization thread.  If the application
1352only has one POSIX initialization thread, then the automatically
1353generated POSIX Initialization Thread Table will be sufficient.  The following
1354macros correspond to the single initialization task:
1355
1356@itemize @bullet
1357
1358@item @code{CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT} - is the entry
1359point of the thread.  If this macro is not defined by the application,
1360then this defaults to the C routine @code{POSIX_Init}.
1361
1362@item @code{CONFIGURE_POSIX_INIT_TASK_STACK_SIZE} - is the stack size
1363of the single initialization thread.  If this macro is not defined
1364by the application, then this defaults to twice the configured
1365minimum stack size.
1366
1367@end itemize
1368 
1369@item User_initialization_threads_table
1370is the address of the Initialization Threads Table. This table contains the
1371information needed to create and start each of the initialization threads. 
1372The format of each entry in this table is defined in the
1373@code{posix_initialization_threads_table} structure.
1374When using the @code{rtems/confdefs.h} mechanism for configuring
1375an RTEMS application, the value for this field corresponds
1376to the address of the @code{POSIX_Initialization_threads} structure.
1377
1378@end table
1379
1380@section CPU Dependent Information Table
1381
1382@cindex CPU Dependent Information Table
1383
1384The CPU Dependent Information Table is used to
1385describe processor dependent information required by RTEMS.
1386This table is generally used to supply RTEMS with information
1387only known by the Board Support Package.  The contents of this
1388table are discussed in the CPU Dependent Information Table
1389chapter of the Applications Supplement document for a specific
1390target processor.
1391
1392The @code{rtems/confdefs.h} mechanism does not support generating this
1393table.  It is normally filled in by the Board Support Package.
1394
1395@section Initialization Task Table
1396
1397@cindex Initialization Tasks Table
1398
1399The Initialization Task Table is used to describe
1400each of the user initialization tasks to the Initialization
1401Manager.  The table contains one entry for each initialization
1402task the user wishes to create and start.  The fields of this
1403data structure directly correspond to arguments to the
1404@code{@value{DIRPREFIX}task_create} and
1405@code{@value{DIRPREFIX}task_start} directives.  The number of entries is
1406found in the @code{number_of_initialization_tasks} entry in the
1407Configuration Table. 
1408
1409The format of each entry in the
1410Initialization Task Table is defined in the following C structure:
1411
1412@findex rtems_initialization_tasks_table
1413@example
1414typedef struct @{
1415  rtems_name           name;
1416  size_t               stack_size;
1417  rtems_task_priority  initial_priority;
1418  rtems_attribute      attribute_set;
1419  rtems_task_entry     entry_point;
1420  rtems_mode           mode_set;
1421  rtems_task_argument  argument;
1422@} rtems_initialization_tasks_table;
1423@end example
1424
1425@table @b
1426@item name
1427is the name of this initialization task.
1428
1429@item stack_size
1430is the size of the stack for this initialization task.
1431
1432@item initial_priority
1433is the priority of this initialization task.
1434
1435@item attribute_set
1436is the attribute set used during creation of this initialization task.
1437
1438@item entry_point
1439is the address of the entry point of this initialization task.
1440
1441@item mode_set
1442is the initial execution mode of this initialization task.
1443
1444@item argument
1445is the initial argument for this initialization task.
1446
1447@end table
1448
1449A typical declaration for an Initialization Task Table might appear as follows:
1450
1451@example
1452rtems_initialization_tasks_table
1453Initialization_tasks[2] = @{
1454   @{ INIT_1_NAME,
1455     1024,
1456     1,
1457     DEFAULT_ATTRIBUTES,
1458     Init_1,
1459     DEFAULT_MODES,
1460     1
1461
1462   @},
1463   @{ INIT_2_NAME,
1464     1024,
1465     250,
1466     FLOATING_POINT,
1467     Init_2,
1468     NO_PREEMPT,
1469     2
1470
1471   @}
1472@};
1473@end example
1474
1475@section Driver Address Table
1476
1477@cindex Device Driver Table
1478
1479The Device Driver Table is used to inform the I/O Manager of the set of
1480entry points for each device driver configured in the system.  The table
1481contains one entry for each device driver required by the application.
1482The number of entries is defined in the number_of_device_drivers entry
1483in the Configuration Table.  This table is copied to the Device Drive
1484Table during the IO Manager's initialization giving the entries in this
1485table the lower major numbers.  The format of each entry in the Device
1486Driver Table is defined in the following C structure:
1487
1488@findex rtems_driver_address_table
1489@example
1490typedef struct @{
1491  rtems_device_driver_entry initialization_entry;
1492  rtems_device_driver_entry open_entry;
1493  rtems_device_driver_entry close_entry;
1494  rtems_device_driver_entry read_entry;
1495  rtems_device_driver_entry write_entry;
1496  rtems_device_driver_entry control_entry;
1497@} rtems_driver_address_table;
1498@end example
1499
1500@table @b
1501@item initialization_entry
1502is the address of the entry point called by
1503@code{rtems_io_initialize}
1504to initialize a device driver and its associated devices.
1505
1506@item open_entry
1507is the address of the entry point called by @code{rtems_io_open}.
1508
1509@item close_entry
1510is the address of the entry point called by @code{rtems_io_close}.
1511
1512@item read_entry
1513is the address of the entry point called by @code{rtems_io_read}.
1514
1515@item write_entry
1516is the address of the entry point called by @code{rtems_io_write}.
1517
1518@item control_entry
1519is the address of the entry point called by @code{rtems_io_control}.
1520
1521@end table
1522
1523Driver entry points configured as NULL will always
1524return a status code of @code{@value{RPREFIX}SUCCESSFUL}.  No user code will be
1525executed in this situation.
1526
1527A typical declaration for a Device Driver Table might appear as follows:
1528
1529@example
1530rtems_driver_address_table Driver_table[2] = @{
1531   @{ tty_initialize, tty_open,  tty_close,  /* major = 0 */
1532     tty_read,       tty_write, tty_control
1533   @},
1534   @{ lp_initialize, lp_open,    lp_close,   /* major = 1 */
1535     NULL,          lp_write,   lp_control
1536   @}
1537@};
1538@end example
1539
1540More information regarding the construction and
1541operation of device drivers is provided in the I/O Manager
1542chapter.
1543
1544@section User Extensions Table
1545
1546@cindex User Extensions Table
1547
1548The User Extensions Table is used to inform RTEMS of
1549the optional user-supplied static extension set.  This table
1550contains one entry for each possible extension.  The entries are
1551called at critical times in the life of the system and
1552individual tasks.  The application may create dynamic extensions
1553in addition to this single static set.  The format of each entry
1554in the User Extensions Table is defined in the following C structure:
1555
1556@example
1557typedef void           rtems_extension;
1558typedef rtems_extension (*rtems_task_create_extension)(
1559   Thread_Control * /* executing */,
1560   Thread_Control * /* created */
1561);
1562typedef rtems_extension (*rtems_task_delete_extension)(
1563   Thread_Control * /* executing */,
1564   Thread_Control * /* deleted */
1565);
1566typedef rtems_extension (*rtems_task_start_extension)(
1567   Thread_Control * /* executing */,
1568   Thread_Control * /* started */
1569);
1570typedef rtems_extension (*rtems_task_restart_extension)(
1571   Thread_Control * /* executing */,
1572   Thread_Control * /* restarted */
1573);
1574typedef rtems_extension (*rtems_task_switch_extension)(
1575   Thread_Control * /* executing */,
1576   Thread_Control * /* heir */
1577);
1578typedef rtems_extension (*rtems_task_begin_extension)(
1579   Thread_Control * /* beginning */
1580);
1581typedef rtems_extension (*rtems_task_exitted_extension)(
1582   Thread_Control * /* exiting */
1583);
1584typedef rtems_extension (*rtems_fatal_extension)(
1585   Internal_errors_Source /* the_source */,
1586   boolean                /* is_internal */,
1587   uint32_t               /* the_error */
1588);
1589
1590typedef struct @{
1591  rtems_task_create_extension      thread_create;
1592  rtems_task_start_extension       thread_start;
1593  rtems_task_restart_extension     thread_restart;
1594  rtems_task_delete_extension      thread_delete;
1595  rtems_task_switch_extension      thread_switch;
1596  rtems_task_begin_extension       thread_begin;
1597  rtems_task_exitted_extension     thread_exitted;
1598  rtems_fatal_extension            fatal;
1599@} rtems_extensions_table;
1600@end example
1601
1602@table @b
1603
1604@item thread_create
1605is the address of the
1606user-supplied subroutine for the TASK_CREATE extension.  If this
1607extension for task creation is defined, it is called from the
1608task_create directive.  A value of NULL indicates that no
1609extension is provided.
1610
1611@item thread_start
1612is the address of the user-supplied
1613subroutine for the TASK_START extension.  If this extension for
1614task initiation is defined, it is called from the task_start
1615directive.  A value of NULL indicates that no extension is
1616provided.
1617
1618@item thread_restart
1619is the address of the user-supplied
1620subroutine for the TASK_RESTART extension.  If this extension
1621for task re-initiation is defined, it is called from the
1622task_restart directive.  A value of NULL indicates that no
1623extension is provided.
1624
1625@item thread_delete
1626is the address of the user-supplied
1627subroutine for the TASK_DELETE extension.  If this RTEMS
1628extension for task deletion is defined, it is called from the
1629task_delete directive.  A value of NULL indicates that no
1630extension is provided.
1631
1632@item thread_switch
1633is the address of the user-supplied
1634subroutine for the task context switch extension.  This
1635subroutine is called from RTEMS dispatcher after the current
1636task has been swapped out but before the new task has been
1637swapped in.  A value of NULL indicates that no extension is
1638provided.  As this routine is invoked after saving the current
1639task's context and before restoring the heir task's context, it
1640is not necessary for this routine to save and restore any
1641registers.
1642
1643@item thread_begin
1644is the address of the user-supplied
1645subroutine which is invoked immediately before a task begins
1646execution.  It is invoked in the context of the beginning task.
1647A value of NULL indicates that no extension is provided.
1648
1649@item thread_exitted
1650is the address of the user-supplied
1651subroutine which is invoked when a task exits.  This procedure
1652is responsible for some action which will allow the system to
1653continue execution (i.e. delete or restart the task) or to
1654terminate with a fatal error.  If this field is set to NULL, the
1655default RTEMS TASK_EXITTED handler will be invoked.
1656
1657@item fatal
1658is the address of the user-supplied
1659subroutine for the FATAL extension.  This RTEMS extension of
1660fatal error handling is called from the
1661@code{@value{DIRPREFIX}fatal_error_occurred}
1662directive.  If the user's fatal error handler returns or if this
1663entry is NULL then the default RTEMS fatal error handler will be
1664executed.
1665
1666@end table
1667
1668A typical declaration for a User Extension Table
1669which defines the TASK_CREATE, TASK_DELETE, TASK_SWITCH, and
1670FATAL extension might appear as follows:
1671
1672@example
1673rtems_extensions_table User_extensions = @{
1674   task_create_extension,
1675   NULL,
1676   NULL,
1677   task_delete_extension,
1678   task_switch_extension,
1679   NULL,
1680   NULL,
1681   fatal_extension
1682@};
1683@end example
1684
1685More information regarding the user extensions is
1686provided in the User Extensions chapter.
1687
1688@section Multiprocessor Configuration Table
1689
1690@cindex Multiprocessor Configuration Table
1691
1692The Multiprocessor Configuration Table contains
1693information needed when using RTEMS in a multiprocessor
1694configuration.  Many of the details associated with configuring
1695a multiprocessor system are dependent on the multiprocessor
1696communications layer provided by the user.  The address of the
1697Multiprocessor Configuration Table should be placed in the
1698@code{User_multiprocessing_table} entry in the primary Configuration
1699Table.  Further details regarding many of the entries in the
1700Multiprocessor Configuration Table will be provided in the
1701Multiprocessing chapter. 
1702
1703
1704When using the @code{rtems/confdefs.h} mechanism for configuring
1705an RTEMS application, the macro @code{CONFIGURE_MP_APPLICATION} must
1706be defined to automatically generate the Multiprocessor Configuration Table.
1707If @code{CONFIGURE_MP_APPLICATION}, is not defined, then a NULL pointer
1708is configured as the address of this table.
1709
1710The format of the Multiprocessor Configuration Table is defined in
1711the following C structure:
1712
1713@example
1714typedef struct @{
1715  uint32_t          node;
1716  uint32_t          maximum_nodes;
1717  uint32_t          maximum_global_objects;
1718  uint32_t          maximum_proxies;
1719  uint32_t          extra_mpci_receive_server_stack;
1720  rtems_mpci_table *User_mpci_table;
1721@} rtems_multiprocessing_table;
1722@end example
1723
1724@table @b
1725@item node
1726is a unique processor identifier
1727and is used in routing messages between nodes in a
1728multiprocessor configuration.  Each processor must have a unique
1729node number.  RTEMS assumes that node numbers start at one and
1730increase sequentially.  This assumption can be used to advantage
1731by the user-supplied MPCI layer.  Typically, this requirement is
1732made when the node numbers are used to calculate the address of
1733inter-processor communication links.  Zero should be avoided as
1734a node number because some MPCI layers use node zero to
1735represent broadcasted packets.  Thus, it is recommended that
1736node numbers start at one and increase sequentially.
1737When using the @code{rtems/confdefs.h} mechanism for configuring
1738an RTEMS application, the value for this field corresponds
1739to the setting of the macro @code{CONFIGURE_MP_NODE_NUMBER}.
1740If not defined by the application, then the @code{CONFIGURE_MP_NODE_NUMBER}
1741macro defaults to the value of the @code{NODE_NUMBER} macro which is
1742set on the compiler command line by the RTEMS Multiprocessing Test Suites.
1743
1744
1745@item maximum_nodes
1746is the number of processor nodes in the system.
1747When using the @code{rtems/confdefs.h} mechanism for configuring
1748an RTEMS application, the value for this field corresponds
1749to the setting of the macro @code{CONFIGURE_MP_MAXIMUM_NODES}.
1750If not defined by the application, then the @code{CONFIGURE_MP_MAXIMUM_NODES}
1751macro defaults to the value 2.
1752
1753@item maximum_global_objects
1754is the maximum number of global objects which can exist at any
1755given moment in the entire system.  If this parameter is not the
1756same on all nodes in the system, then a fatal error is generated
1757to inform the user that the system is inconsistent.
1758When using the @code{rtems/confdefs.h} mechanism for configuring
1759an RTEMS application, the value for this field corresponds
1760to the setting of the macro @code{CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS}.
1761If not defined by the application, then the
1762@code{CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS} macro defaults to the value 32.
1763
1764
1765@item maximum_proxies
1766is the maximum number of proxies which can exist at any given moment
1767on this particular node.  A proxy is a substitute task control block
1768which represent a task residing on a remote node when that task blocks
1769on a remote object.  Proxies are used in situations in which delayed
1770interaction is required with a remote node.
1771When using the @code{rtems/confdefs.h} mechanism for configuring
1772an RTEMS application, the value for this field corresponds
1773to the setting of the macro @code{CONFIGURE_MP_MAXIMUM_PROXIES}.
1774If not defined by the application, then the @code{CONFIGURE_MP_MAXIMUM_PROXIES}
1775macro defaults to the value 32.
1776
1777@item extra_mpci_receive_server_stack
1778is the extra stack space allocated for the RTEMS MPCI receive server task
1779in bytes.  The MPCI receive server may invoke nearly all directives and
1780may require extra stack space on some targets.
1781
1782@item User_mpci_table
1783is the address of the Multiprocessor Communications Interface
1784Table.  This table contains the entry points of user-provided functions
1785which constitute the multiprocessor communications layer.  This table
1786must be provided in multiprocessor configurations with all
1787entries configured.  The format of this table and details
1788regarding its entries can be found in the next section.
1789When using the @code{rtems/confdefs.h} mechanism for configuring
1790an RTEMS application, the value for this field corresponds
1791to the setting of the macro @code{CONFIGURE_MP_MPCI_TABLE_POINTER}.
1792If not defined by the application, then the
1793@code{CONFIGURE_MP_MPCI_TABLE_POINTER} macro defaults to the
1794address of the table named @code{MPCI_table}.
1795
1796
1797@end table
1798
1799@section Multiprocessor Communications Interface Table
1800
1801@cindex  Multiprocessor Communications Interface Table
1802
1803This table defines the set of callouts that must be provided by
1804an Multiprocessor Communications Interface implementation. 
1805
1806When using the @code{rtems/confdefs.h} mechanism for configuring
1807an RTEMS application, the name of this table is assumed
1808to be @code{MPCI_table} unless the application sets
1809the @code{CONFIGURE_MP_MPCI_TABLE_POINTER} when configuring a
1810multiprocessing system.
1811
1812The format of this table is defined in
1813the following C structure:
1814
1815@example
1816typedef struct @{
1817  uint32_t                        default_timeout; /* in ticks */
1818  uint32_t                        maximum_packet_size;
1819  rtems_mpci_initialization_entry initialization;
1820  rtems_mpci_get_packet_entry     get_packet;
1821  rtems_mpci_return_packet_entry  return_packet;
1822  rtems_mpci_send_entry           send_packet;
1823  rtems_mpci_receive_entry        receive_packet;
1824@} rtems_mpci_table;
1825@end example
1826
1827@table @b
1828@item default_timeout
1829is the default maximum length of time a task should block waiting for
1830a response to a directive which results in communication with a remote node.
1831The maximum length of time is a function the user supplied
1832multiprocessor communications layer and the media used.  This
1833timeout only applies to directives which would not block if the
1834operation were performed locally.
1835
1836@item maximum_packet_size
1837is the size in bytes of the longest packet which the MPCI layer is capable
1838of sending.  This value should represent the total number of bytes available
1839for a RTEMS interprocessor messages.
1840
1841@item initialization
1842is the address of the entry point for the initialization procedure of the
1843user supplied multiprocessor communications layer.
1844
1845@item get_packet
1846is the address of the entry point for the procedure called by RTEMS to
1847obtain a packet from the user supplied multiprocessor communications layer.
1848
1849@item return_packet
1850is the address of the entry point for the procedure called by RTEMS to
1851return a packet to the user supplied multiprocessor communications layer.
1852
1853@item send
1854is the address of the entry point for the procedure called by RTEMS to
1855send an envelope to another node.  This procedure is part of the user
1856supplied multiprocessor communications layer.
1857
1858@item receive
1859is the address of the entry point for the
1860procedure called by RTEMS to retrieve an envelope containing a
1861message from another node.  This procedure is part of the user
1862supplied multiprocessor communications layer.
1863
1864@end table
1865
1866More information regarding the required functionality of these
1867entry points is provided in the Multiprocessor chapter.
1868
1869@section Determining Memory Requirements
1870
1871Since memory is a critical resource in many real-time
1872embedded systems, the RTEMS Classic API was specifically designed to allow
1873unused managers to be forcibly excluded from the run-time environment.
1874This allows the application designer the flexibility to tailor
1875RTEMS to most efficiently meet system requirements while still
1876satisfying even the most stringent memory constraints.  As
1877result, the size of the RTEMS executive is application
1878dependent.
1879
1880It is not necessary for RTEMS Application Developers to calculate
1881the amount of memory required for the RTEMS Workspace.  This
1882is done automatically by @code{<rtems/confdefs.h>}. 
1883See @ref{Configuring a System Sizing the RTEMS RAM Workspace} for
1884more details on how
1885this works.  In the event, you are interested in the memory required
1886for an instance of a particular RTEMS object, please run the test
1887@code{spsize} on your target board.
1888
1889RTEMS is built to be a library and any routines that you do not
1890directly or indirectly require in your application will @b{NOT}
1891be included in your executable image.  However, some managers
1892may be explicitly excluded and no attempt to create these instances
1893of these objects will succeed even if they are configured.
1894The following Classic API managers may be optionally excluded:
1895
1896@itemize @bullet
1897@item signal
1898@item region
1899@item dual ported memory
1900@item event
1901@item multiprocessing
1902@item partition
1903@item timer
1904@item semaphore
1905@item message
1906@item rate monotonic
1907@end itemize
1908
1909RTEMS is designed to be built and installed as a library
1910that is linked into the application.  As such, much of
1911RTEMS is implemented in such a way that there is a single
1912entry point per source file.  This avoids having the
1913linker being forced to pull large object files in their
1914entirety into an application when the application references
1915a single symbol.  In the event you discover an RTEMS method
1916that is included in your executable but never entered, please
1917let us know.  It might be an opportunity to break a dependency
1918and shrink many RTEMS applications.
1919
1920RTEMS based applications must somehow provide memory
1921for RTEMS' code and data space.  Although RTEMS' data space must
1922be in RAM, its code space can be located in either ROM or RAM.
1923In addition, the user must allocate RAM for the RTEMS RAM
1924Workspace.  The size of this area is application dependent and
1925can be calculated using the formula provided in the Memory
1926Requirements chapter of the Applications Supplement document
1927for a specific target processor.
1928
1929All private RTEMS data variables and routine names used by
1930RTEMS begin with the underscore ( _ ) character followed by an
1931upper-case letter.  If RTEMS is linked with an application, then
1932the application code should NOT contain any symbols which begin
1933with the underscore character and followed by an upper-case
1934letter to avoid any naming conflicts.  All RTEMS directive names
1935should be treated as reserved words.
1936
1937@section Sizing the RTEMS RAM Workspace
1938
1939The RTEMS RAM Workspace is a user-specified block of
1940memory reserved for use by RTEMS.  The application should NOT
1941modify this memory.  This area consists primarily of the RTEMS
1942data structures whose exact size depends upon the values
1943specified in the Configuration Table.  In addition, task stacks
1944and floating point context areas are dynamically allocated from
1945the RTEMS RAM Workspace.
1946
1947The @code{rtems/confdefs.h} mechanism calcalutes the size
1948of the RTEMS RAM Workspace automatically.  It assumes that
1949all tasks are floating point and that all will be allocated
1950the miminum stack space.  This calculation also automatically
1951includes the memory that will be allocated for internal use
1952by RTEMS.  The following macros may be set
1953by the application to make the calculation
1954of memory required more accurate:
1955
1956@itemize @bullet
1957
1958@item @code{CONFIGURE_MEMORY_OVERHEAD}
1959@item @code{CONFIGURE_EXTRA_TASK_STACKS}
1960
1961@end itemize
1962
1963The starting address of the RTEMS RAM Workspace must
1964be aligned on a four-byte boundary.  Failure to properly align
1965the workspace area will result in the
1966@code{@value{DIRPREFIX}fatal_error_occurred}
1967directive being invoked with the
1968@code{@value{RPREFIX}INVALID_ADDRESS} error code.
1969
1970The file @code{<rtems/confdefs.h>} will calculate the
1971value that is specified as the @code{work_space_size}
1972parameter of the Configuration Table. There are many
1973parameters the application developer can specify to
1974help @code{<rtems/confdefs.h>} in its calculations.  Correctly
1975specifying the application requirements via parameters
1976such as @code{CONFIGURE_EXTRA_TASK_STACKS} and
1977@code{CONFIGURE_MAXIMUM_TASKS} is critical.
1978
1979The allocation of objects can operate in two modes. The default mode
1980has an object number ceiling. No more than the specified number of
1981objects can be allocated from the RTEMS RAM Workspace. The number of objects
1982specified in the particular API Configuration table fields are
1983allocated at initialisation. The second mode allows the number of
1984objects to grow to use the available free memory in the RTEMS RAM Workspace.
1985
1986The auto-extending mode can be enabled individually for each object
1987type by using the macro @code{rtems_resource_unlimited}. This takes a value
1988as a parameter, and is used to set the object maximum number field in
1989an API Configuration table. The value is an allocation unit size. When
1990RTEMS is required to grow the object table it is grown by this
1991size. The kernel will return the object memory back to the RTEMS RAM Workspace
1992when an object is destroyed. The kernel will only return an allocated
1993block of objects to the RTEMS RAM Workspace if at least half the allocation
1994size of free objects remain allocated. RTEMS always keeps one
1995allocation block of objects allocated. Here is an example of using
1996@code{rtems_resource_unlimited}:
1997
1998@example
1999#define CONFIGURE_MAXIMUM_TASKS rtems_resource_unlimited(5)
2000@end example
2001
2002The user is cautioned that future versions of RTEMS may not have the
2003same memory requirements per object. Although the value calculated is
2004suficient for a particular target processor and release of RTEMS,
2005memory usage is subject to change across versions and target
2006processors.  To avoid problems, the user should accurately
2007specify each configuration parameter and allow
2008@code{<rtems/confdefs.h>} to calculate the memory requirements.
2009The memory requirements are likely to change each
2010time one of the following events occurs:
2011
2012@itemize @bullet
2013@item a configuration parameter is modified,
2014@item task or interrupt stack requirements change,
2015@item task floating point attribute is altered,
2016@item RTEMS is upgraded, or
2017@item the target processor is changed.
2018@end itemize
2019
2020Failure to provide enough space in the RTEMS RAM
2021Workspace will result in the
2022@code{@value{DIRPREFIX}fatal_error_occurred} directive
2023being invoked with the appropriate error code.
Note: See TracBrowser for help on using the repository browser.