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

4.104.115
Last change on this file since ce017afb was ce017afb, checked in by Joel Sherrill <joel.sherrill@…>, on 09/26/09 at 15:51:31

2009-09-26 Joel Sherrill <joel.sherrill@…>

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