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

4.115
Last change on this file since ce017f90 was ce017f90, checked in by Jennifer Averett <Jennifer.Averett@…>, on 11/18/11 at 20:04:02

2011-11-18 Jennifer Averett <Jennifer.Averett@…>

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