source: rtems/doc/user/conf.t @ 1a0e1a7

4.104.115
Last change on this file since 1a0e1a7 was 1a0e1a7, checked in by Joel Sherrill <joel.sherrill@…>, on 12/14/08 at 22:48:33

2008-12-14 Joel Sherrill <joel.sherrill@…>

  • user/conf.t, user/region.t: Change sizes of heap/region and allocated objects in heap to intptr_t so they can be larger than a single allocatable object (e.g. size_t).
  • Property mode set to 100644
File size: 80.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_STUB_DRIVER
466@item @code{CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER}
467is defined if the application wishes to include the Stub Device Driver.
468This device driver simply provides entry points that return
469successful and is primarily a test fixture.
470By default, this is not defined.
471
472@findex CONFIGURE_BSP_PREREQUISITE_DRIVERS
473@item @code{CONFIGURE_BSP_PREREQUISITE_DRIVERS} is defined if the
474BSP has device drivers it needs to include in the Device Driver
475Table.  This should be defined to the set of device driver entries that
476will be placed in the table at the @b{FRONT} of the Device Driver Table
477and initialized before any other drivers @b{INCLUDING} any application
478prerequisite drivers.  By default,this is not defined.
479
480@findex CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS
481@item @code{CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS} is defined if the
482application has device drivers it needs to include in the Device Driver
483Table.  This should be defined to the set of device driver entries that
484will be placed in the table at the @b{FRONT} of the Device Driver Table
485and initialized before any other drivers @b{EXCEPT} any BSP prerequisite
486drivers.  By default,this is not defined.
487
488@findex CONFIGURE_APPLICATION_EXTRA_DRIVERS
489@item @code{CONFIGURE_APPLICATION_EXTRA_DRIVERS} is defined if the
490application has device drivers it needs to include in the Device Driver
491Table.  This should be defined to the set of device driver entries that
492will be placed in the table at the @b{END} of the Device Driver Table.
493By default,this is not defined.
494
495@end itemize
496
497@subsection Multiprocessing Configuration
498
499This section defines the multiprocessing related
500system configuration parameters supported by @code{rtems/confdefs.h}.
501This class of Configuration Constants are only applicable if
502@code{CONFIGURE_MP_APPLICATION} is defined.
503
504@itemize @bullet
505@findex CONFIGURE_HAS_OWN_MULTIPROCESSING_TABLE
506@item @code{CONFIGURE_HAS_OWN_MULTIPROCESSING_TABLE} is defined
507if the application wishes to provide their own Multiprocessing
508Configuration Table.  The generated table is named
509@code{Multiprocessing_configuration}.  By default, this
510is not defined.
511
512@findex CONFIGURE_MP_NODE_NUMBER
513@item @code{CONFIGURE_MP_NODE_NUMBER} is the node number of
514this node in a multiprocessor system.  The default node number
515is @code{NODE_NUMBER} which is set directly in RTEMS test Makefiles.
516
517@findex CONFIGURE_MP_MAXIMUM_NODES
518@item @code{CONFIGURE_MP_MAXIMUM_NODES} is the maximum number
519of nodes in a multiprocessor system.  The default is 2.
520
521@findex CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS
522@item @code{CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS}
523is the maximum number
524of concurrently active global objects in a multiprocessor
525system.  The default is 32.
526
527@findex CONFIGURE_MP_MAXIMUM_PROXIES
528@item @code{CONFIGURE_MP_MAXIMUM_PROXIES} is the maximum number
529of concurrently active thread/task proxies in a multiprocessor
530system.  The default is 32.
531
532@findex CONFIGURE_MP_MPCI_TABLE_POINTER
533@item @code{CONFIGURE_MP_MPCI_TABLE_POINTER} is the pointer
534to the MPCI Configuration Table.  The default value of
535this field is @code{&MPCI_table}.
536@end itemize
537
538@subsection Classic API Configuration
539
540This section defines the Classic API related
541system configuration parameters supported by @code{rtems/confdefs.h}.
542
543@itemize @bullet
544@findex CONFIGURE_MAXIMUM_TASKS
545@item @code{CONFIGURE_MAXIMUM_TASKS} is the maximum number of
546Classic API tasks that can be concurrently active.
547The default for this field is 0.
548
549@findex CONFIGURE_DISABLE_CLASSIC_NOTEPADS
550@item @code{CONFIGURE_DISABLE_CLASSIC_NOTEPADS} should be defined
551if the user does not want to have support for Classic API Notepads
552in their application.  By default, this is not defined and Classic API
553Notepads are supported.
554
555@findex CONFIGURE_MAXIMUM_TIMERS
556@item @code{CONFIGURE_MAXIMUM_TIMERS} is the maximum number of
557Classic API timers that can be concurrently active.
558The default for this field is 0.
559
560@findex CONFIGURE_MAXIMUM_SEMAPHORES
561@item @code{CONFIGURE_MAXIMUM_SEMAPHORES} is the maximum number of
562Classic API semaphores that can be concurrently active.
563The default for this field is 0.
564
565@findex CONFIGURE_MAXIMUM_MESSAGE_QUEUES
566@item @code{CONFIGURE_MAXIMUM_MESSAGE_QUEUES} is the maximum number of
567Classic API message queues that can be concurrently active.
568The default for this field is 0.
569
570@findex CONFIGURE_MAXIMUM_PARTITIONS
571@item @code{CONFIGURE_MAXIMUM_PARTITIONS} is the maximum number of
572Classic API partitions that can be concurrently active.
573The default for this field is 0.
574
575@findex CONFIGURE_MAXIMUM_REGIONS
576@item @code{CONFIGURE_MAXIMUM_REGIONS} is the maximum number of
577Classic API regions that can be concurrently active.
578The default for this field is 0.
579
580@findex CONFIGURE_MAXIMUM_PORTS
581@item @code{CONFIGURE_MAXIMUM_PORTS} is the maximum number of
582Classic API ports that can be concurrently active.
583The default for this field is 0.
584
585@findex CONFIGURE_MAXIMUM_PERIODS
586@item @code{CONFIGURE_MAXIMUM_PERIODS} is the maximum number of
587Classic API rate monotonic periods that can be concurrently active.
588The default for this field is 0.
589
590@findex CONFIGURE_MAXIMUM_USER_EXTENSIONS
591@item @code{CONFIGURE_MAXIMUM_USER_EXTENSIONS} is the maximum number of
592Classic API user extensions that can be concurrently active.
593The default for this field is 0.
594
595@end itemize
596
597@subsection Classic API Initialization Tasks Table Configuration
598
599The @code{rtems/confdefs.h} configuration system can automatically
600generate an Initialization Tasks Table named
601@code{Initialization_tasks} with a single entry.  The following
602parameters control the generation of that table.
603
604@itemize @bullet
605@findex CONFIGURE_RTEMS_INIT_TASKS_TABLE
606@item @code{CONFIGURE_RTEMS_INIT_TASKS_TABLE} is defined
607if the user wishes to use a Classic RTEMS API Initialization
608Task Table.  The application may choose to use the initialization
609tasks or threads table from another API.  By default, this
610field is not defined as the user MUST select their own
611API for initialization tasks.
612
613@findex CONFIGURE_HAS_OWN_INIT_TASK_TABLE
614@item @code{CONFIGURE_HAS_OWN_INIT_TASK_TABLE} is defined
615if the user wishes to define their own Classic API Initialization
616Tasks Table.  This table should be named @code{Initialization_tasks}.
617By default, this is not defined.
618
619@findex CONFIGURE_INIT_TASK_NAME
620@item @code{CONFIGURE_INIT_TASK_NAME} is the name
621of the single initialization task defined by the
622Classic API Initialization Tasks Table.  By default
623the value is @code{rtems_build_name( 'U', 'I', '1', ' ' )}.
624
625@findex CONFIGURE_INIT_TASK_STACK_SIZE
626@item @code{CONFIGURE_INIT_TASK_STACK_SIZE}
627is the stack size
628of the single initialization task defined by the
629Classic API Initialization Tasks Table.  By default
630value is the configured minimum stack size.
631
632@findex CONFIGURE_INIT_TASK_PRIORITY
633@item @code{CONFIGURE_INIT_TASK_PRIORITY}
634is the initial priority
635of the single initialization task defined by the
636Classic API Initialization Tasks Table.  By default
637the value is 1 which is the highest priority
638in the Classic API.
639
640@findex CONFIGURE_INIT_TASK_ATTRIBUTES
641@item @code{CONFIGURE_INIT_TASK_ATTRIBUTES}
642is the task attributes
643of the single initialization task defined by the
644Classic API Initialization Tasks Table.  By default
645the value is @code{RTEMS_DEFAULT_ATTRIBUTES}.
646
647@findex CONFIGURE_INIT_TASK_ENTRY_POINT
648@item @code{CONFIGURE_INIT_TASK_ENTRY_POINT}
649is the entry point (a.k.a. function name)
650of the single initialization task defined by the
651Classic API Initialization Tasks Table.  By default
652the value is @code{Init}.
653
654@findex CONFIGURE_INIT_TASK_INITIAL_MODES
655@item @code{CONFIGURE_INIT_TASK_INITIAL_MODES}
656is the initial execution mode
657of the single initialization task defined by the
658Classic API Initialization Tasks Table.  By default
659the value is @code{RTEMS_NO_PREEMPT}.
660
661@findex CONFIGURE_INIT_TASK_ARGUMENTS
662@item @code{CONFIGURE_INIT_TASK_ARGUMENTS}
663is the task argument
664of the single initialization task defined by the
665Classic API Initialization Tasks Table.  By default
666the value is 0.
667
668@end itemize
669
670
671@subsection POSIX API Configuration
672
673The parameters in this section are used to configure resources
674for the RTEMS POSIX API.  They are only relevant if the POSIX API
675is enabled at configure time using the @code{--enable-posix} option.
676
677@itemize @bullet
678@findex CONFIGURE_MAXIMUM_POSIX_THREADS
679@item @code{CONFIGURE_MAXIMUM_POSIX_THREADS} is the maximum number of
680POSIX API threads that can be concurrently active.
681The default is 0.
682
683@findex CONFIGURE_MAXIMUM_POSIX_MUTEXES
684@item @code{CONFIGURE_MAXIMUM_POSIX_MUTEXES} is the maximum number of
685POSIX API mutexes that can be concurrently active.
686The default is 0.
687
688@findex CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES
689@item @code{CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES} is the maximum number of
690POSIX API condition variables that can be concurrently active.
691The default is 0.
692
693@findex CONFIGURE_MAXIMUM_POSIX_KEYS
694@item @code{CONFIGURE_MAXIMUM_POSIX_KEYS} is the maximum number of
695POSIX API keys that can be concurrently active.
696The default is 0.
697
698@findex CONFIGURE_MAXIMUM_POSIX_TIMERS
699@item @code{CONFIGURE_MAXIMUM_POSIX_TIMERS} is the maximum number of
700POSIX API timers that can be concurrently active.
701The default is 0.
702
703@findex CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS
704@item @code{CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS} is the maximum number of
705POSIX API queued signals that can be concurrently active.
706The default is 0.
707
708@findex CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES
709@item @code{CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES} is the maximum number of
710POSIX API message queues that can be concurrently active.
711The default is 0.
712
713@findex CONFIGURE_MAXIMUM_POSIX_SEMAPHORES
714@item @code{CONFIGURE_MAXIMUM_POSIX_SEMAPHORES} is the maximum number of
715POSIX API semaphores that can be concurrently active.
716The default is 0.
717
718@end itemize
719
720@subsection POSIX Initialization Threads Table Configuration
721
722The @code{rtems/confdefs.h} configuration system can automatically
723generate a POSIX Initialization Threads Table named
724@code{POSIX_Initialization_threads} with a single entry.  The following
725parameters control the generation of that table.
726
727@itemize @bullet
728@findex CONFIGURE_POSIX_INIT_THREAD_TABLE
729@item @code{CONFIGURE_POSIX_INIT_THREAD_TABLE}
730is defined
731if the user wishes to use a POSIX API Initialization
732Threads Table.  The application may choose to use the initialization
733tasks or threads table from another API.  By default, this
734field is not defined as the user MUST select their own
735API for initialization tasks.
736
737@findex CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE
738@item @code{CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE}
739is defined if the user wishes to define their own POSIX API Initialization
740Threads Table.  This table should be named @code{POSIX_Initialization_threads}.
741By default, this is not defined.
742
743@findex CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT
744@item @code{CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT}
745is the entry point (a.k.a. function name)
746of the single initialization thread defined by the
747POSIX API Initialization Threads Table.  By default
748the value is @code{POSIX_Init}.
749
750@findex CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE
751@item @code{CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE}
752is the stack size of the single initialization thread defined by the
753POSIX API Initialization Threads Table.  By default
754value is twice the configured minimum stack size.
755
756@end itemize
757
758@subsection ITRON API Configuration
759
760The parameters in this section are used to configure resources
761for the RTEMS ITRON API.  They are only relevant if the POSIX API
762is enabled at configure time using the @code{--enable-itron} option.
763
764@itemize @bullet
765@findex CONFIGURE_MAXIMUM_ITRON_TASKS
766@item @code{CONFIGURE_MAXIMUM_ITRON_TASKS}
767is the maximum number of
768ITRON API tasks that can be concurrently active.
769The default is 0.
770
771@findex CONFIGURE_MAXIMUM_ITRON_SEMAPHORES
772@item @code{CONFIGURE_MAXIMUM_ITRON_SEMAPHORES}
773is the maximum number of
774ITRON API semaphores that can be concurrently active.
775The default is 0.
776
777@findex CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS
778@item @code{CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS}
779is the maximum number of
780ITRON API eventflags that can be concurrently active.
781The default is 0.
782
783@findex CONFIGURE_MAXIMUM_ITRON_MAILBOXES
784@item @code{CONFIGURE_MAXIMUM_ITRON_MAILBOXES}
785is the maximum number of
786ITRON API mailboxes that can be concurrently active.
787The default is 0.
788
789@findex CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS
790@item @code{CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS}
791is the maximum number of
792ITRON API message buffers that can be concurrently active.
793The default is 0.
794
795@findex CONFIGURE_MAXIMUM_ITRON_PORTS
796@item @code{CONFIGURE_MAXIMUM_ITRON_PORTS}
797is the maximum number of
798ITRON API ports that can be concurrently active.
799The default is 0.
800
801@findex CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS
802@item @code{CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS}
803is the maximum number of
804ITRON API memory pools that can be concurrently active.
805The default is 0.
806
807@findex CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS
808@item @code{CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS}
809is the maximum number of
810ITRON API fixed memory pools that can be concurrently active.
811The default is 0.
812
813@end itemize
814
815@subsection ITRON Initialization Task Table Configuration
816
817The @code{rtems/confdefs.h} configuration system can automatically
818generate an ITRON Initialization Tasks Table named
819@code{ITRON_Initialization_tasks} with a single entry.  The following
820parameters control the generation of that table.
821
822@itemize @bullet
823@findex CONFIGURE_ITRON_INIT_TASK_TABLE
824@item @code{CONFIGURE_ITRON_INIT_TASK_TABLE} is defined
825if the user wishes to use a ITRON API Initialization
826Tasks Table.  The application may choose to use the initialization
827tasks or threads table from another API.  By default, this
828field is not defined as the user MUST select their own
829API for initialization tasks.
830
831@findex CONFIGURE_ITRON_HAS_OWN_INIT_TASK_TABLE
832@item @code{CONFIGURE_ITRON_HAS_OWN_INIT_TASK_TABLE}
833is defined if the user wishes to define their own ITRON API Initialization
834Tasks Table.  This table should be named @code{ITRON_Initialization_tasks}.
835By default, this is not defined.
836
837@findex CONFIGURE_ITRON_INIT_TASK_ENTRY_POINT
838@item @code{CONFIGURE_ITRON_INIT_TASK_ENTRY_POINT}
839is the entry point (a.k.a. function name)
840of the single initialization task defined by the
841ITRON API Initialization Tasks Table.  By default
842the value is @code{ITRON_Init}.
843
844@findex CONFIGURE_ITRON_INIT_TASK_ATTRIBUTES
845@item @code{CONFIGURE_ITRON_INIT_TASK_ATTRIBUTES}
846is the attribute set
847of the single initialization task defined by the
848ITRON API Initialization Tasks Table.  By default
849the value is @code{TA_HLNG}.
850
851@findex CONFIGURE_ITRON_INIT_TASK_PRIORITY
852@item @code{CONFIGURE_ITRON_INIT_TASK_PRIORITY}
853is the initial priority
854of the single initialization task defined by the
855ITRON API Initialization Tasks Table.  By default
856the value is @code{1} which is the highest priority
857in the ITRON API.
858
859@findex CONFIGURE_ITRON_INIT_TASK_STACK_SIZE
860@item @code{CONFIGURE_ITRON_INIT_TASK_STACK_SIZE}
861is the stack size of the single initialization task defined by the
862ITRON API Initialization Tasks Table.  By default
863value is the configured minimum stack size.
864
865@end itemize
866
867@subsection Ada Tasks
868
869This section defines the system configuration parameters supported
870by @code{rtems/confdefs.h} related to configuring RTEMS to support
871a task using Ada tasking with GNAT.
872
873@itemize @bullet
874@findex CONFIGURE_GNAT_RTEMS
875@item @code{CONFIGURE_GNAT_RTEMS} is defined to inform
876RTEMS that the GNAT Ada run-time is to be used by the
877application.  This configuration parameter is critical
878as it makes @code{rtems/confdefs.h} configure the resources
879(mutexes and keys) used implicitly by the GNAT run-time.
880By default, this parameter is not defined.
881
882@findex CONFIGURE_MAXIMUM_ADA_TASKS
883@item @code{CONFIGURE_MAXIMUM_ADA_TASKS} is the
884number of Ada tasks that can be concurrently active
885in the system.  By default, when @code{CONFIGURE_GNAT_RTEMS}
886is defined, this is set to 20.
887
888@findex CONFIGURE_MAXIMUM_FAKE_ADA_TASKS
889@item @code{CONFIGURE_MAXIMUM_FAKE_ADA_TASKS} is
890the number of "fake" Ada tasks that can be concurrently
891active in the system.  A "fake" Ada task is a non-Ada
892task that makes calls back into Ada code and thus
893implicitly uses the Ada run-time.
894
895@end itemize
896
897@section Configuration Table
898
899@cindex Configuration Table
900@cindex RTEMS Configuration Table
901
902The RTEMS Configuration Table is used to tailor an
903application for its specific needs.  For example, the user can
904configure the number of device drivers or which APIs may be used.
905THe address of the user-defined Configuration Table is passed as an
906argument to the @code{rtems_initialize_executive}
907directive, which MUST be the first RTEMS directive called. 
908The RTEMS Configuration Table is defined in the following C structure:
909
910@findex rtems_configuration_table
911@example
912@group
913typedef struct @{
914  void                           *work_space_start;
915  intptr_t                        work_space_size;
916  uint32_t                        maximum_extensions;
917  uint32_t                        microseconds_per_tick;
918  uint32_t                        ticks_per_timeslice;
919  void                          (*idle_task)( void );
920  uint32_t                        idle_task_stack_size;
921  uint32_t                        interrupt_stack_size;
922  void *                        (*stack_allocate_hook)( uint32_t );
923  void                          (*stack_free_hook)( void * );
924  bool                            do_zero_of_workspace;
925  uint32_t                        maximum_drivers;
926  uint32_t                        number_of_device_drivers;
927  rtems_driver_address_table     *Device_driver_table;
928  uint32_t                        number_of_initial_extensions;
929  rtems_extensions_table         *User_extension_table;
930#if defined(RTEMS_MULTIPROCESSING)
931  rtems_multiprocessing_table    *User_multiprocessing_table;
932#endif
933  rtems_api_configuration_table  *RTEMS_api_configuration;
934  posix_api_configuration_table  *POSIX_api_configuration;
935  itron_api_configuration        *ITRON_api_configuration;
936@} rtems_configuration_table;
937@end group
938@end example
939
940@table @b
941@item work_space_start
942is the address of the RTEMS RAM Workspace. 
943This area contains items such as the
944various object control blocks (TCBs, QCBs, ...) and task stacks.
945If the address is not aligned on a four-word boundary, then
946RTEMS will invoke the fatal error handler during
947@code{rtems_initialize_executive}.
948When using the @code{rtems/confdefs.h} mechanism for configuring
949an RTEMS application, the value for this field corresponds
950to the setting of the macro @code{CONFIGURE_EXECUTIVE_RAM_WORK_AREA}
951which defaults to @code{NULL}.  Normally, this field should be
952configured as @code{NULL} as BSPs will assign memory for the
953RTEMS RAM Workspace as part of system initialization.
954
955@item work_space_size
956is the calculated size of the
957RTEMS RAM Workspace.  The section Sizing the RTEMS RAM Workspace
958details how to arrive at this number.
959When using the @code{rtems/confdefs.h} mechanism for configuring
960an RTEMS application, the value for this field corresponds
961to the setting of the macro @code{CONFIGURE_EXECUTIVE_RAM_SIZE}
962and is calculated based on the other system configuration settings.
963
964@item microseconds_per_tick
965is number of microseconds per clock tick.
966When using the @code{rtems/confdefs.h} mechanism for configuring
967an RTEMS application, the value for this field corresponds
968to the setting of the macro @code{CONFIGURE_MICROSECONDS_PER_TICK}.
969If not defined by the application, then the
970@code{CONFIGURE_MICROSECONDS_PER_TICK} macro defaults to 10000
971(10 milliseconds).
972
973@item ticks_per_timeslice
974is the number of clock ticks for a timeslice.
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_TICKS_PER_TIMESLICE}.
978
979@item idle_task
980is the address of the optional user
981provided routine which is used as the system's IDLE task.  If
982this field is not NULL, then the RTEMS default IDLE task is not
983used.  This field may be NULL to indicate that the default IDLE
984is to be used.  When using the @code{rtems/confdefs.h} mechanism
985for configuring an RTEMS application, the value for this field
986corresponds to the setting of the macro @code{CONFIGURE_IDLE_TASK_BODY}.
987
988@item idle_task_stack_size
989is the size of the RTEMS idle task stack in bytes.  If this number is less
990than the configured minimum stack size, then the idle task's stack will
991be set to the minimum.  When using the @code{rtems/confdefs.h} mechanism
992for configuring an RTEMS application, the value for this field corresponds
993to the setting of the macro @code{CONFIGURE_IDLE_TASK_STACK_SIZE}.
994
995@item interrupt_stack_size
996is the size of the RTEMS interrupt stack in bytes.  If this number is less
997than configured minimum stack size, then the interrupt stack will be set
998to the minimum.  When using the @code{rtems/confdefs.h} mechanism for
999configuring an RTEMS application, the value for this field corresponds
1000to the setting of the macro @code{CONFIGURE_INTERRUPT_STACK_SIZE}.
1001
1002@item stack_allocate_hook
1003may point to a user provided routine to allocate task stacks.
1004The default is to allocate task stacks from the RTEMS Workspace.
1005When using the @code{rtems/confdefs.h} mechanism
1006for configuring an RTEMS application, the value for this field
1007corresponds to the setting of the macro
1008@code{CONFIGURE_TASK_STACK_ALLOCATOR}.
1009
1010@item stack_free_hook
1011may point to a user provided routine to free task stacks.
1012The default is to allocate task stacks from the RTEMS Workspace.
1013When using the @code{rtems/confdefs.h} mechanism
1014for configuring an RTEMS application, the value for this field
1015corresponds to the setting of the macro
1016@code{CONFIGURE_TASK_STACK_DEALLOCATOR}.
1017
1018@item do_zero_of_workspace
1019indicates whether RTEMS should zero the RTEMS Workspace and
1020C Program Heap as part of its initialization.  If set to
1021TRUE, the Workspace is zeroed.  Otherwise, it is not.
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_ZERO_WORKSPACE_AUTOMATICALLY}.
1026
1027@item maximum_drivers
1028is the maximum number of device drivers that can be registered.
1029When using the @code{rtems/confdefs.h} mechanism for configuring
1030an RTEMS application, the value for this field corresponds
1031to the setting of the macro @code{CONFIGURE_MAXIMUM_DRIVERS}.
1032
1033@item number_of_device_drivers
1034is the number of device drivers for the system.  There should be
1035the same number of entries in the Device Driver Table.  If this field
1036is zero, then the @code{User_driver_address_table} entry should be NULL.
1037When using the @code{rtems/confdefs.h} mechanism for configuring
1038an RTEMS application, the value for this field is calculated
1039automatically based on the number of entries in the
1040Device Driver Table.  This calculation is based on the assumption
1041that the Device Driver Table is named @code{Device_drivers}
1042and defined in C.  This table may be generated automatically
1043for simple applications using only the device drivers that correspond
1044to the following macros:
1045
1046@itemize @bullet
1047
1048@item @code{CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER}
1049@item @code{CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER}
1050@item @code{CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER}
1051@item @code{CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER}
1052@item @code{CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER}
1053
1054@end itemize
1055
1056Note that network device drivers are not configured in the
1057Device Driver Table.
1058
1059@item Device_driver_table
1060is the address of the Device Driver Table.  This table contains the entry
1061points for each device driver.  If the number_of_device_drivers field is zero,
1062then this entry should be NULL. The format of this table will be
1063discussed below.
1064When using the @code{rtems/confdefs.h} mechanism for configuring
1065an RTEMS application, the Device Driver Table is assumed to be
1066named @code{Device_drivers} and defined in C.  If the application is providing
1067its own Device Driver Table, then the macro
1068@code{CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE} must be defined to indicate
1069this and prevent @code{rtems/confdefs.h} from generating the table.
1070
1071@item number_of_initial_extensions
1072is the number of initial user extensions.  There should be
1073the same number of entries as in the User_extension_table.  If this field
1074is zero, then the User_driver_address_table entry should be NULL.
1075When using the @code{rtems/confdefs.h} mechanism for configuring
1076an RTEMS application, the value for this field corresponds
1077to the setting of the macro @code{CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS}
1078which is set automatically by @code{rtems/confdefs.h} based on the size
1079of the User Extensions Table.
1080
1081@item User_extension_table
1082is the address of the User
1083Extension Table.  This table contains the entry points for the
1084static set of optional user extensions.  If no user extensions
1085are configured, then this entry should be NULL.  The format of
1086this table will be discussed below.
1087When using the @code{rtems/confdefs.h} mechanism for configuring
1088an RTEMS application, the User Extensions Table is named
1089@code{Configuration_Initial_Extensions} and defined in
1090confdefs.h.  It is initialized based on the following
1091macros:
1092
1093@itemize @bullet
1094
1095@item @code{CONFIGURE_INITIAL_EXTENSIONS}
1096@item @code{STACK_CHECKER_EXTENSION}
1097
1098@end itemize
1099
1100The application may configure one or more initial user extension
1101sets by setting the @code{CONFIGURE_INITIAL_EXTENSIONS} macro.  By
1102defining the @code{STACK_CHECKER_EXTENSION} macro, the task stack bounds
1103checking user extension set is automatically included in the
1104application.
1105
1106@item User_multiprocessing_table
1107is the address of the Multiprocessor Configuration Table.  This
1108table contains information needed by RTEMS only when used in a multiprocessor
1109configuration.  This field must be NULL when RTEMS is used in a
1110single processor configuration.
1111When using the @code{rtems/confdefs.h} mechanism for configuring
1112an RTEMS application, the Multiprocessor Configuration Table
1113is automatically generated when the @code{CONFIGURE_MP_APPLICATION}
1114is defined.  If @code{CONFIGURE_MP_APPLICATION} is not defined, the this
1115entry is set to NULL.  The generated table has the name
1116@code{Multiprocessing_configuration}.
1117
1118@item RTEMS_api_configuration
1119is the address of the RTEMS API Configuration Table.  This table
1120contains information needed by the RTEMS API.  This field should be
1121NULL if the RTEMS API is not used.  [NOTE: Currently the RTEMS API
1122is required to support support components such as BSPs and libraries
1123which use this API.]  This table is built automatically and this
1124entry filled in, if using the @code{rtems/confdefs.h} application
1125configuration mechanism.  The generated table has the name
1126@code{Configuration_RTEMS_API}.
1127
1128@item POSIX_api_configuration
1129is the address of the POSIX API Configuration Table.  This table
1130contains information needed by the POSIX API.  This field should be
1131NULL if the POSIX API is not used.  This table is built automatically
1132and this entry filled in, if using the @code{rtems/confdefs.h} application
1133configuration mechanism.  The @code{rtems/confdefs.h} application
1134mechanism will fill this field in with the address of the
1135@code{Configuration_POSIX_API} table of POSIX API is configured
1136and NULL if the POSIX API is not configured.
1137
1138@end table
1139
1140@section RTEMS API Configuration Table
1141
1142@cindex RTEMS API Configuration Table
1143
1144The RTEMS API Configuration Table is used to configure the
1145managers which constitute the RTEMS API for a particular application. 
1146For example, the user can configure the maximum number of tasks for
1147this application. The RTEMS API Configuration Table is defined in
1148the following C structure:
1149
1150@findex rtems_api_configuration_table
1151@example
1152@group
1153typedef struct @{
1154  uint32_t  maximum_tasks;
1155  uint32_t  maximum_timers;
1156  uint32_t  maximum_semaphores;
1157  uint32_t  maximum_message_queues;
1158  uint32_t  maximum_partitions;
1159  uint32_t  maximum_regions;
1160  uint32_t  maximum_ports;
1161  uint32_t  maximum_periods;
1162  uint32_t  maximum_barriers;
1163  uint32_t  number_of_initialization_tasks;
1164  rtems_initialization_tasks_table *User_initialization_tasks_table;
1165@} rtems_api_configuration_table;
1166@end group
1167@end example
1168
1169@table @b
1170@item maximum_tasks
1171is the maximum number of tasks that
1172can be concurrently active (created) in the system including
1173initialization tasks.
1174When using the @code{rtems/confdefs.h} mechanism for configuring
1175an RTEMS application, the value for this field corresponds
1176to the setting of the macro @code{CONFIGURE_MAXIMUM_TASKS}.
1177If not defined by the application, then the @code{CONFIGURE_MAXIMUM_TASKS}
1178macro defaults to 0.
1179
1180@item maximum_timers
1181is the maximum number of timers
1182that can be concurrently active in the system.
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_TIMERS}.
1186If not defined by the application, then the @code{CONFIGURE_MAXIMUM_TIMERS}
1187macro defaults to 0.
1188
1189@item maximum_semaphores
1190is the maximum number of
1191semaphores that 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_SEMAPHORES}.
1195If not defined by the application, then the @code{CONFIGURE_MAXIMUM_SEMAPHORES}
1196macro defaults to 0.
1197
1198@item maximum_message_queues
1199is the maximum number of
1200message queues 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_MESSAGE_QUEUES}.
1204If not defined by the application, then the
1205@code{CONFIGURE_MAXIMUM_MESSAGE_QUEUES} macro defaults to 0.
1206
1207@item maximum_partitions
1208is the maximum number of
1209partitions 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_PARTITIONS}.
1213If not defined by the application, then the @code{CONFIGURE_MAXIMUM_PARTITIONS}
1214macro defaults to 0.
1215
1216@item maximum_regions
1217is the maximum number of regions
1218that 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_REGIONS}.
1222If not defined by the application, then the @code{CONFIGURE_MAXIMUM_REGIONS}
1223macro defaults to 0.
1224
1225@item maximum_ports
1226is the maximum number of ports into
1227dual-port memory areas that can be concurrently active in the
1228system.
1229When using the @code{rtems/confdefs.h} mechanism for configuring
1230an RTEMS application, the value for this field corresponds
1231to the setting of the macro @code{CONFIGURE_MAXIMUM_PORTS}.
1232If not defined by the application, then the @code{CONFIGURE_MAXIMUM_PORTS}
1233macro defaults to 0.
1234
1235@item number_of_initialization_tasks
1236is the number of initialization tasks configured.  At least one
1237RTEMS initialization task or POSIX initializatin must be configured
1238in order for the user's application to begin executing.
1239When using the @code{rtems/confdefs.h} mechanism for configuring
1240an RTEMS application, the user must define the
1241@code{CONFIGURE_RTEMS_INIT_TASKS_TABLE} to indicate that there
1242is one or more RTEMS initialization task.  If the application
1243only has one RTEMS initialization task, then the automatically
1244generated Initialization Task Table will be sufficient.  The following
1245macros correspond to the single initialization task:
1246 
1247@itemize @bullet
1248
1249@item @code{CONFIGURE_INIT_TASK_NAME} - is the name of the task. 
1250If this macro is not defined by the application, then this defaults
1251to the task name of @code{"UI1 "} for User Initialization Task 1.
1252
1253@item @code{CONFIGURE_INIT_TASK_STACK_SIZE} - is the stack size
1254of the single initialization task.  If this macro is not defined
1255by the application, then this defaults to configured minimum
1256stack size.
1257
1258@item @code{CONFIGURE_INIT_TASK_PRIORITY} - is the initial priority
1259of the single initialization task.  If this macro is not defined
1260by the application, then this defaults to 1.
1261
1262@item @code{CONFIGURE_INIT_TASK_ATTRIBUTES} - is the attributes
1263of the single initialization task.  If this macro is not defined
1264by the application, then this defaults to @code{RTEMS_DEFAULT_ATTRIBUTES}.
1265
1266@item @code{CONFIGURE_INIT_TASK_ENTRY_POINT} - is the entry point
1267of the single initialization task.  If this macro is not defined
1268by the application, then this defaults to the C language routine
1269@code{Init}.
1270
1271@item @code{CONFIGURE_INIT_TASK_INITIAL_MODES} - is the initial execution
1272modes of the single initialization task.  If this macro is not defined
1273by the application, then this defaults to @code{RTEMS_NO_PREEMPT}.
1274
1275@item @code{CONFIGURE_INIT_TASK_ARGUMENTS} - is the argument passed to the
1276of the single initialization task.  If this macro is not defined
1277by the application, then this defaults to 0.
1278
1279
1280@end itemize
1281
1282
1283has the option to have
1284 value for this field corresponds
1285to the setting of the macro @code{}.
1286
1287@item User_initialization_tasks_table
1288is the address of the Initialization Task Table. This table contains the
1289information needed to create and start each of the
1290initialization tasks.  The format of this table will be discussed below.
1291When using the @code{rtems/confdefs.h} mechanism for configuring
1292an RTEMS application, the value for this field corresponds
1293to the setting of the macro @code{CONFIGURE_EXECUTIVE_RAM_WORK_AREA}.
1294
1295@end table
1296
1297@section POSIX API Configuration Table
1298
1299@cindex POSIX API Configuration Table
1300
1301The POSIX API Configuration Table is used to configure the
1302managers which constitute the POSIX API for a particular application.
1303For example, the user can configure the maximum number of threads for
1304this application. The POSIX API Configuration Table is defined in
1305the following C structure:
1306 
1307@findex posix_initialization_threads_table
1308@findex posix_api_configuration_table
1309@example
1310@group
1311typedef struct @{
1312  void       *(*thread_entry)(void *);
1313@} posix_initialization_threads_table;
1314 
1315typedef struct @{
1316  int                                 maximum_threads;
1317  int                                 maximum_mutexes;
1318  int                                 maximum_condition_variables;
1319  int                                 maximum_keys;
1320  int                                 maximum_timers;
1321  int                                 maximum_queued_signals;
1322  int                                 maximum_message_queues;
1323  int                                 maximum_semaphores;
1324  int                                 maximum_barriers;
1325  int                                 maximum_rwlocks;
1326  int                                 maximum_spinlocks;
1327  int                                 number_of_initialization_tasks;
1328  posix_initialization_threads_table *User_initialization_tasks_table;
1329@} posix_api_configuration_table;
1330@end group
1331@end example
1332 
1333@table @b
1334@item maximum_threads
1335is the maximum number of threads that
1336can be concurrently active (created) in the system including
1337initialization threads.
1338When using the @code{rtems/confdefs.h} mechanism for configuring
1339an RTEMS application, the value for this field corresponds
1340to the setting of the macro @code{CONFIGURE_MAXIMUM_POSIX_THREADS}.
1341If not defined by the application, then the
1342@code{CONFIGURE_MAXIMUM_POSIX_THREADS} macro defaults to 0.
1343
1344@item maximum_mutexes
1345is the maximum number of mutexes that can be concurrently
1346active in the system.
1347When using the @code{rtems/confdefs.h} mechanism for configuring
1348an RTEMS application, the value for this field corresponds
1349to the setting of the macro @code{CONFIGURE_MAXIMUM_POSIX_MUTEXES}.
1350If not defined by the application, then the
1351@code{CONFIGURE_MAXIMUM_POSIX_MUTEXES} macro defaults to 0.
1352
1353@item maximum_condition_variables
1354is the maximum number of condition variables that can be
1355concurrently active in the system.
1356When using the @code{rtems/confdefs.h} mechanism for configuring
1357an RTEMS application, the value for this field corresponds
1358to the setting of the macro @code{CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES}.
1359If not defined by the application, then the
1360@code{CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES} macro defaults to 0.
1361
1362@item maximum_keys
1363is the maximum number of keys that can be concurrently active in the system.
1364When using the @code{rtems/confdefs.h} mechanism for configuring
1365an RTEMS application, the value for this field corresponds
1366to the setting of the macro @code{CONFIGURE_MAXIMUM_POSIX_KEYS}.
1367If not defined by the application, then the
1368@code{CONFIGURE_MAXIMUM_POSIX_KEYS} macro defaults to 0.
1369
1370@item maximum_timers
1371is the maximum number of POSIX timers that can be concurrently active
1372in the system.
1373When using the @code{rtems/confdefs.h} mechanism for configuring
1374an RTEMS application, the value for this field corresponds
1375to the setting of the macro @code{CONFIGURE_MAXIMUM_POSIX_TIMERS}.
1376If not defined by the application, then the
1377@code{CONFIGURE_MAXIMUM_POSIX_TIMERS} macro defaults to 0.
1378
1379@item maximum_queued_signals
1380is the maximum number of queued signals that can be concurrently
1381pending in the system.
1382When using the @code{rtems/confdefs.h} mechanism for configuring
1383an RTEMS application, the value for this field corresponds
1384to the setting of the macro @code{CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS}.
1385If not defined by the application, then the
1386@code{CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS} macro defaults to 0.
1387
1388@item number_of_initialization_threads
1389is the number of initialization threads configured.  At least one
1390initialization threads must be configured.
1391When using the @code{rtems/confdefs.h} mechanism for configuring
1392an RTEMS application, the user must define the
1393@code{CONFIGURE_POSIX_INIT_THREAD_TABLE} to indicate that there
1394is one or more POSIX initialization thread.  If the application
1395only has one POSIX initialization thread, then the automatically
1396generated POSIX Initialization Thread Table will be sufficient.  The following
1397macros correspond to the single initialization task:
1398
1399@itemize @bullet
1400
1401@item @code{CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT} - is the entry
1402point of the thread.  If this macro is not defined by the application,
1403then this defaults to the C routine @code{POSIX_Init}.
1404
1405@item @code{CONFIGURE_POSIX_INIT_TASK_STACK_SIZE} - is the stack size
1406of the single initialization thread.  If this macro is not defined
1407by the application, then this defaults to twice the configured
1408minimum stack size.
1409
1410@end itemize
1411 
1412@item User_initialization_threads_table
1413is the address of the Initialization Threads Table. This table contains the
1414information needed to create and start each of the initialization threads. 
1415The format of each entry in this table is defined in the
1416@code{posix_initialization_threads_table} structure.
1417When using the @code{rtems/confdefs.h} mechanism for configuring
1418an RTEMS application, the value for this field corresponds
1419to the address of the @code{POSIX_Initialization_threads} structure.
1420
1421@end table
1422
1423@section CPU Dependent Information Table
1424
1425@cindex CPU Dependent Information Table
1426
1427The CPU Dependent Information Table is used to
1428describe processor dependent information required by RTEMS.
1429This table is generally used to supply RTEMS with information
1430only known by the Board Support Package.  The contents of this
1431table are discussed in the CPU Dependent Information Table
1432chapter of the Applications Supplement document for a specific
1433target processor.
1434
1435The @code{rtems/confdefs.h} mechanism does not support generating this
1436table.  It is normally filled in by the Board Support Package.
1437
1438@section Initialization Task Table
1439
1440@cindex Initialization Tasks Table
1441
1442The Initialization Task Table is used to describe
1443each of the user initialization tasks to the Initialization
1444Manager.  The table contains one entry for each initialization
1445task the user wishes to create and start.  The fields of this
1446data structure directly correspond to arguments to the
1447@code{@value{DIRPREFIX}task_create} and
1448@code{@value{DIRPREFIX}task_start} directives.  The number of entries is
1449found in the @code{number_of_initialization_tasks} entry in the
1450Configuration Table. 
1451
1452The format of each entry in the
1453Initialization Task Table is defined in the following C structure:
1454
1455@findex rtems_initialization_tasks_table
1456@example
1457typedef struct @{
1458  rtems_name           name;
1459  size_t               stack_size;
1460  rtems_task_priority  initial_priority;
1461  rtems_attribute      attribute_set;
1462  rtems_task_entry     entry_point;
1463  rtems_mode           mode_set;
1464  rtems_task_argument  argument;
1465@} rtems_initialization_tasks_table;
1466@end example
1467
1468@table @b
1469@item name
1470is the name of this initialization task.
1471
1472@item stack_size
1473is the size of the stack for this initialization task.
1474
1475@item initial_priority
1476is the priority of this initialization task.
1477
1478@item attribute_set
1479is the attribute set used during creation of this initialization task.
1480
1481@item entry_point
1482is the address of the entry point of this initialization task.
1483
1484@item mode_set
1485is the initial execution mode of this initialization task.
1486
1487@item argument
1488is the initial argument for this initialization task.
1489
1490@end table
1491
1492A typical declaration for an Initialization Task Table might appear as follows:
1493
1494@example
1495rtems_initialization_tasks_table
1496Initialization_tasks[2] = @{
1497   @{ INIT_1_NAME,
1498     1024,
1499     1,
1500     DEFAULT_ATTRIBUTES,
1501     Init_1,
1502     DEFAULT_MODES,
1503     1
1504
1505   @},
1506   @{ INIT_2_NAME,
1507     1024,
1508     250,
1509     FLOATING_POINT,
1510     Init_2,
1511     NO_PREEMPT,
1512     2
1513
1514   @}
1515@};
1516@end example
1517
1518@section Driver Address Table
1519
1520@cindex Device Driver Table
1521
1522The Device Driver Table is used to inform the I/O Manager of the set of
1523entry points for each device driver configured in the system.  The table
1524contains one entry for each device driver required by the application.
1525The number of entries is defined in the number_of_device_drivers entry
1526in the Configuration Table.  This table is copied to the Device Drive
1527Table during the IO Manager's initialization giving the entries in this
1528table the lower major numbers.  The format of each entry in the Device
1529Driver Table is defined in the following C structure:
1530
1531@findex rtems_driver_address_table
1532@example
1533typedef struct @{
1534  rtems_device_driver_entry initialization_entry;
1535  rtems_device_driver_entry open_entry;
1536  rtems_device_driver_entry close_entry;
1537  rtems_device_driver_entry read_entry;
1538  rtems_device_driver_entry write_entry;
1539  rtems_device_driver_entry control_entry;
1540@} rtems_driver_address_table;
1541@end example
1542
1543@table @b
1544@item initialization_entry
1545is the address of the entry point called by
1546@code{rtems_io_initialize}
1547to initialize a device driver and its associated devices.
1548
1549@item open_entry
1550is the address of the entry point called by @code{rtems_io_open}.
1551
1552@item close_entry
1553is the address of the entry point called by @code{rtems_io_close}.
1554
1555@item read_entry
1556is the address of the entry point called by @code{rtems_io_read}.
1557
1558@item write_entry
1559is the address of the entry point called by @code{rtems_io_write}.
1560
1561@item control_entry
1562is the address of the entry point called by @code{rtems_io_control}.
1563
1564@end table
1565
1566Driver entry points configured as NULL will always
1567return a status code of @code{@value{RPREFIX}SUCCESSFUL}.  No user code will be
1568executed in this situation.
1569
1570A typical declaration for a Device Driver Table might appear as follows:
1571
1572@example
1573rtems_driver_address_table Driver_table[2] = @{
1574   @{ tty_initialize, tty_open,  tty_close,  /* major = 0 */
1575     tty_read,       tty_write, tty_control
1576   @},
1577   @{ lp_initialize, lp_open,    lp_close,   /* major = 1 */
1578     NULL,          lp_write,   lp_control
1579   @}
1580@};
1581@end example
1582
1583More information regarding the construction and
1584operation of device drivers is provided in the I/O Manager
1585chapter.
1586
1587@section User Extensions Table
1588
1589@cindex User Extensions Table
1590
1591The User Extensions Table is used to inform RTEMS of
1592the optional user-supplied static extension set.  This table
1593contains one entry for each possible extension.  The entries are
1594called at critical times in the life of the system and
1595individual tasks.  The application may create dynamic extensions
1596in addition to this single static set.  The format of each entry
1597in the User Extensions Table is defined in the following C structure:
1598
1599@example
1600typedef void           rtems_extension;
1601typedef rtems_extension (*rtems_task_create_extension)(
1602   Thread_Control * /* executing */,
1603   Thread_Control * /* created */
1604);
1605typedef rtems_extension (*rtems_task_delete_extension)(
1606   Thread_Control * /* executing */,
1607   Thread_Control * /* deleted */
1608);
1609typedef rtems_extension (*rtems_task_start_extension)(
1610   Thread_Control * /* executing */,
1611   Thread_Control * /* started */
1612);
1613typedef rtems_extension (*rtems_task_restart_extension)(
1614   Thread_Control * /* executing */,
1615   Thread_Control * /* restarted */
1616);
1617typedef rtems_extension (*rtems_task_switch_extension)(
1618   Thread_Control * /* executing */,
1619   Thread_Control * /* heir */
1620);
1621typedef rtems_extension (*rtems_task_begin_extension)(
1622   Thread_Control * /* beginning */
1623);
1624typedef rtems_extension (*rtems_task_exitted_extension)(
1625   Thread_Control * /* exiting */
1626);
1627typedef rtems_extension (*rtems_fatal_extension)(
1628   Internal_errors_Source /* the_source */,
1629   bool                   /* is_internal */,
1630   uint32_t               /* the_error */
1631);
1632
1633typedef struct @{
1634  rtems_task_create_extension      thread_create;
1635  rtems_task_start_extension       thread_start;
1636  rtems_task_restart_extension     thread_restart;
1637  rtems_task_delete_extension      thread_delete;
1638  rtems_task_switch_extension      thread_switch;
1639  rtems_task_begin_extension       thread_begin;
1640  rtems_task_exitted_extension     thread_exitted;
1641  rtems_fatal_extension            fatal;
1642@} rtems_extensions_table;
1643@end example
1644
1645@table @b
1646
1647@item thread_create
1648is the address of the
1649user-supplied subroutine for the TASK_CREATE extension.  If this
1650extension for task creation is defined, it is called from the
1651task_create directive.  A value of NULL indicates that no
1652extension is provided.
1653
1654@item thread_start
1655is the address of the user-supplied
1656subroutine for the TASK_START extension.  If this extension for
1657task initiation is defined, it is called from the task_start
1658directive.  A value of NULL indicates that no extension is
1659provided.
1660
1661@item thread_restart
1662is the address of the user-supplied
1663subroutine for the TASK_RESTART extension.  If this extension
1664for task re-initiation is defined, it is called from the
1665task_restart directive.  A value of NULL indicates that no
1666extension is provided.
1667
1668@item thread_delete
1669is the address of the user-supplied
1670subroutine for the TASK_DELETE extension.  If this RTEMS
1671extension for task deletion is defined, it is called from the
1672task_delete directive.  A value of NULL indicates that no
1673extension is provided.
1674
1675@item thread_switch
1676is the address of the user-supplied
1677subroutine for the task context switch extension.  This
1678subroutine is called from RTEMS dispatcher after the current
1679task has been swapped out but before the new task has been
1680swapped in.  A value of NULL indicates that no extension is
1681provided.  As this routine is invoked after saving the current
1682task's context and before restoring the heir task's context, it
1683is not necessary for this routine to save and restore any
1684registers.
1685
1686@item thread_begin
1687is the address of the user-supplied
1688subroutine which is invoked immediately before a task begins
1689execution.  It is invoked in the context of the beginning task.
1690A value of NULL indicates that no extension is provided.
1691
1692@item thread_exitted
1693is the address of the user-supplied
1694subroutine which is invoked when a task exits.  This procedure
1695is responsible for some action which will allow the system to
1696continue execution (i.e. delete or restart the task) or to
1697terminate with a fatal error.  If this field is set to NULL, the
1698default RTEMS TASK_EXITTED handler will be invoked.
1699
1700@item fatal
1701is the address of the user-supplied
1702subroutine for the FATAL extension.  This RTEMS extension of
1703fatal error handling is called from the
1704@code{@value{DIRPREFIX}fatal_error_occurred}
1705directive.  If the user's fatal error handler returns or if this
1706entry is NULL then the default RTEMS fatal error handler will be
1707executed.
1708
1709@end table
1710
1711A typical declaration for a User Extension Table
1712which defines the TASK_CREATE, TASK_DELETE, TASK_SWITCH, and
1713FATAL extension might appear as follows:
1714
1715@example
1716rtems_extensions_table User_extensions = @{
1717   task_create_extension,
1718   NULL,
1719   NULL,
1720   task_delete_extension,
1721   task_switch_extension,
1722   NULL,
1723   NULL,
1724   fatal_extension
1725@};
1726@end example
1727
1728More information regarding the user extensions is
1729provided in the User Extensions chapter.
1730
1731@section Multiprocessor Configuration Table
1732
1733@cindex Multiprocessor Configuration Table
1734
1735The Multiprocessor Configuration Table contains
1736information needed when using RTEMS in a multiprocessor
1737configuration.  Many of the details associated with configuring
1738a multiprocessor system are dependent on the multiprocessor
1739communications layer provided by the user.  The address of the
1740Multiprocessor Configuration Table should be placed in the
1741@code{User_multiprocessing_table} entry in the primary Configuration
1742Table.  Further details regarding many of the entries in the
1743Multiprocessor Configuration Table will be provided in the
1744Multiprocessing chapter. 
1745
1746
1747When using the @code{rtems/confdefs.h} mechanism for configuring
1748an RTEMS application, the macro @code{CONFIGURE_MP_APPLICATION} must
1749be defined to automatically generate the Multiprocessor Configuration Table.
1750If @code{CONFIGURE_MP_APPLICATION}, is not defined, then a NULL pointer
1751is configured as the address of this table.
1752
1753The format of the Multiprocessor Configuration Table is defined in
1754the following C structure:
1755
1756@example
1757typedef struct @{
1758  uint32_t          node;
1759  uint32_t          maximum_nodes;
1760  uint32_t          maximum_global_objects;
1761  uint32_t          maximum_proxies;
1762  uint32_t          extra_mpci_receive_server_stack;
1763  rtems_mpci_table *User_mpci_table;
1764@} rtems_multiprocessing_table;
1765@end example
1766
1767@table @b
1768@item node
1769is a unique processor identifier
1770and is used in routing messages between nodes in a
1771multiprocessor configuration.  Each processor must have a unique
1772node number.  RTEMS assumes that node numbers start at one and
1773increase sequentially.  This assumption can be used to advantage
1774by the user-supplied MPCI layer.  Typically, this requirement is
1775made when the node numbers are used to calculate the address of
1776inter-processor communication links.  Zero should be avoided as
1777a node number because some MPCI layers use node zero to
1778represent broadcasted packets.  Thus, it is recommended that
1779node numbers start at one and increase sequentially.
1780When using the @code{rtems/confdefs.h} mechanism for configuring
1781an RTEMS application, the value for this field corresponds
1782to the setting of the macro @code{CONFIGURE_MP_NODE_NUMBER}.
1783If not defined by the application, then the @code{CONFIGURE_MP_NODE_NUMBER}
1784macro defaults to the value of the @code{NODE_NUMBER} macro which is
1785set on the compiler command line by the RTEMS Multiprocessing Test Suites.
1786
1787
1788@item maximum_nodes
1789is the number of processor nodes in the system.
1790When using the @code{rtems/confdefs.h} mechanism for configuring
1791an RTEMS application, the value for this field corresponds
1792to the setting of the macro @code{CONFIGURE_MP_MAXIMUM_NODES}.
1793If not defined by the application, then the @code{CONFIGURE_MP_MAXIMUM_NODES}
1794macro defaults to the value 2.
1795
1796@item maximum_global_objects
1797is the maximum number of global objects which can exist at any
1798given moment in the entire system.  If this parameter is not the
1799same on all nodes in the system, then a fatal error is generated
1800to inform the user that the system is inconsistent.
1801When using the @code{rtems/confdefs.h} mechanism for configuring
1802an RTEMS application, the value for this field corresponds
1803to the setting of the macro @code{CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS}.
1804If not defined by the application, then the
1805@code{CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS} macro defaults to the value 32.
1806
1807
1808@item maximum_proxies
1809is the maximum number of proxies which can exist at any given moment
1810on this particular node.  A proxy is a substitute task control block
1811which represent a task residing on a remote node when that task blocks
1812on a remote object.  Proxies are used in situations in which delayed
1813interaction is required with a remote node.
1814When using the @code{rtems/confdefs.h} mechanism for configuring
1815an RTEMS application, the value for this field corresponds
1816to the setting of the macro @code{CONFIGURE_MP_MAXIMUM_PROXIES}.
1817If not defined by the application, then the @code{CONFIGURE_MP_MAXIMUM_PROXIES}
1818macro defaults to the value 32.
1819
1820@item extra_mpci_receive_server_stack
1821is the extra stack space allocated for the RTEMS MPCI receive server task
1822in bytes.  The MPCI receive server may invoke nearly all directives and
1823may require extra stack space on some targets.
1824
1825@item User_mpci_table
1826is the address of the Multiprocessor Communications Interface
1827Table.  This table contains the entry points of user-provided functions
1828which constitute the multiprocessor communications layer.  This table
1829must be provided in multiprocessor configurations with all
1830entries configured.  The format of this table and details
1831regarding its entries can be found in the next section.
1832When using the @code{rtems/confdefs.h} mechanism for configuring
1833an RTEMS application, the value for this field corresponds
1834to the setting of the macro @code{CONFIGURE_MP_MPCI_TABLE_POINTER}.
1835If not defined by the application, then the
1836@code{CONFIGURE_MP_MPCI_TABLE_POINTER} macro defaults to the
1837address of the table named @code{MPCI_table}.
1838
1839
1840@end table
1841
1842@section Multiprocessor Communications Interface Table
1843
1844@cindex  Multiprocessor Communications Interface Table
1845
1846This table defines the set of callouts that must be provided by
1847an Multiprocessor Communications Interface implementation. 
1848
1849When using the @code{rtems/confdefs.h} mechanism for configuring
1850an RTEMS application, the name of this table is assumed
1851to be @code{MPCI_table} unless the application sets
1852the @code{CONFIGURE_MP_MPCI_TABLE_POINTER} when configuring a
1853multiprocessing system.
1854
1855The format of this table is defined in
1856the following C structure:
1857
1858@example
1859typedef struct @{
1860  uint32_t                        default_timeout; /* in ticks */
1861  uint32_t                        maximum_packet_size;
1862  rtems_mpci_initialization_entry initialization;
1863  rtems_mpci_get_packet_entry     get_packet;
1864  rtems_mpci_return_packet_entry  return_packet;
1865  rtems_mpci_send_entry           send_packet;
1866  rtems_mpci_receive_entry        receive_packet;
1867@} rtems_mpci_table;
1868@end example
1869
1870@table @b
1871@item default_timeout
1872is the default maximum length of time a task should block waiting for
1873a response to a directive which results in communication with a remote node.
1874The maximum length of time is a function the user supplied
1875multiprocessor communications layer and the media used.  This
1876timeout only applies to directives which would not block if the
1877operation were performed locally.
1878
1879@item maximum_packet_size
1880is the size in bytes of the longest packet which the MPCI layer is capable
1881of sending.  This value should represent the total number of bytes available
1882for a RTEMS interprocessor messages.
1883
1884@item initialization
1885is the address of the entry point for the initialization procedure of the
1886user supplied multiprocessor communications layer.
1887
1888@item get_packet
1889is the address of the entry point for the procedure called by RTEMS to
1890obtain a packet from the user supplied multiprocessor communications layer.
1891
1892@item return_packet
1893is the address of the entry point for the procedure called by RTEMS to
1894return a packet to the user supplied multiprocessor communications layer.
1895
1896@item send
1897is the address of the entry point for the procedure called by RTEMS to
1898send an envelope to another node.  This procedure is part of the user
1899supplied multiprocessor communications layer.
1900
1901@item receive
1902is the address of the entry point for the
1903procedure called by RTEMS to retrieve an envelope containing a
1904message from another node.  This procedure is part of the user
1905supplied multiprocessor communications layer.
1906
1907@end table
1908
1909More information regarding the required functionality of these
1910entry points is provided in the Multiprocessor chapter.
1911
1912@section Determining Memory Requirements
1913
1914Since memory is a critical resource in many real-time
1915embedded systems, the RTEMS Classic API was specifically designed to allow
1916unused managers to be forcibly excluded from the run-time environment.
1917This allows the application designer the flexibility to tailor
1918RTEMS to most efficiently meet system requirements while still
1919satisfying even the most stringent memory constraints.  As
1920result, the size of the RTEMS executive is application
1921dependent.
1922
1923It is not necessary for RTEMS Application Developers to calculate
1924the amount of memory required for the RTEMS Workspace.  This
1925is done automatically by @code{<rtems/confdefs.h>}. 
1926See @ref{Configuring a System Sizing the RTEMS RAM Workspace} for
1927more details on how
1928this works.  In the event, you are interested in the memory required
1929for an instance of a particular RTEMS object, please run the test
1930@code{spsize} on your target board.
1931
1932RTEMS is built to be a library and any routines that you do not
1933directly or indirectly require in your application will @b{NOT}
1934be included in your executable image.  However, some managers
1935may be explicitly excluded and no attempt to create these instances
1936of these objects will succeed even if they are configured.
1937The following Classic API managers may be optionally excluded:
1938
1939@itemize @bullet
1940@item signal
1941@item region
1942@item dual ported memory
1943@item event
1944@item multiprocessing
1945@item partition
1946@item timer
1947@item semaphore
1948@item message
1949@item rate monotonic
1950@end itemize
1951
1952RTEMS is designed to be built and installed as a library
1953that is linked into the application.  As such, much of
1954RTEMS is implemented in such a way that there is a single
1955entry point per source file.  This avoids having the
1956linker being forced to pull large object files in their
1957entirety into an application when the application references
1958a single symbol.  In the event you discover an RTEMS method
1959that is included in your executable but never entered, please
1960let us know.  It might be an opportunity to break a dependency
1961and shrink many RTEMS applications.
1962
1963RTEMS based applications must somehow provide memory
1964for RTEMS' code and data space.  Although RTEMS' data space must
1965be in RAM, its code space can be located in either ROM or RAM.
1966In addition, the user must allocate RAM for the RTEMS RAM
1967Workspace.  The size of this area is application dependent and
1968can be calculated using the formula provided in the Memory
1969Requirements chapter of the Applications Supplement document
1970for a specific target processor.
1971
1972All private RTEMS data variables and routine names used by
1973RTEMS begin with the underscore ( _ ) character followed by an
1974upper-case letter.  If RTEMS is linked with an application, then
1975the application code should NOT contain any symbols which begin
1976with the underscore character and followed by an upper-case
1977letter to avoid any naming conflicts.  All RTEMS directive names
1978should be treated as reserved words.
1979
1980@section Sizing the RTEMS RAM Workspace
1981
1982The RTEMS RAM Workspace is a user-specified block of
1983memory reserved for use by RTEMS.  The application should NOT
1984modify this memory.  This area consists primarily of the RTEMS
1985data structures whose exact size depends upon the values
1986specified in the Configuration Table.  In addition, task stacks
1987and floating point context areas are dynamically allocated from
1988the RTEMS RAM Workspace.
1989
1990The @code{rtems/confdefs.h} mechanism calcalutes the size
1991of the RTEMS RAM Workspace automatically.  It assumes that
1992all tasks are floating point and that all will be allocated
1993the miminum stack space.  This calculation also automatically
1994includes the memory that will be allocated for internal use
1995by RTEMS.  The following macros may be set
1996by the application to make the calculation
1997of memory required more accurate:
1998
1999@itemize @bullet
2000
2001@item @code{CONFIGURE_MEMORY_OVERHEAD}
2002@item @code{CONFIGURE_EXTRA_TASK_STACKS}
2003
2004@end itemize
2005
2006The starting address of the RTEMS RAM Workspace must
2007be aligned on a four-byte boundary.  Failure to properly align
2008the workspace area will result in the
2009@code{@value{DIRPREFIX}fatal_error_occurred}
2010directive being invoked with the
2011@code{@value{RPREFIX}INVALID_ADDRESS} error code.
2012
2013The file @code{<rtems/confdefs.h>} will calculate the
2014value that is specified as the @code{work_space_size}
2015parameter of the Configuration Table. There are many
2016parameters the application developer can specify to
2017help @code{<rtems/confdefs.h>} in its calculations.  Correctly
2018specifying the application requirements via parameters
2019such as @code{CONFIGURE_EXTRA_TASK_STACKS} and
2020@code{CONFIGURE_MAXIMUM_TASKS} is critical.
2021
2022The allocation of objects can operate in two modes. The default mode
2023has an object number ceiling. No more than the specified number of
2024objects can be allocated from the RTEMS RAM Workspace. The number of objects
2025specified in the particular API Configuration table fields are
2026allocated at initialisation. The second mode allows the number of
2027objects to grow to use the available free memory in the RTEMS RAM Workspace.
2028
2029The auto-extending mode can be enabled individually for each object
2030type by using the macro @code{rtems_resource_unlimited}. This takes a value
2031as a parameter, and is used to set the object maximum number field in
2032an API Configuration table. The value is an allocation unit size. When
2033RTEMS is required to grow the object table it is grown by this
2034size. The kernel will return the object memory back to the RTEMS RAM Workspace
2035when an object is destroyed. The kernel will only return an allocated
2036block of objects to the RTEMS RAM Workspace if at least half the allocation
2037size of free objects remain allocated. RTEMS always keeps one
2038allocation block of objects allocated. Here is an example of using
2039@code{rtems_resource_unlimited}:
2040
2041@example
2042#define CONFIGURE_MAXIMUM_TASKS rtems_resource_unlimited(5)
2043@end example
2044
2045The user is cautioned that future versions of RTEMS may not have the
2046same memory requirements per object. Although the value calculated is
2047suficient for a particular target processor and release of RTEMS,
2048memory usage is subject to change across versions and target
2049processors.  To avoid problems, the user should accurately
2050specify each configuration parameter and allow
2051@code{<rtems/confdefs.h>} to calculate the memory requirements.
2052The memory requirements are likely to change each
2053time one of the following events occurs:
2054
2055@itemize @bullet
2056@item a configuration parameter is modified,
2057@item task or interrupt stack requirements change,
2058@item task floating point attribute is altered,
2059@item RTEMS is upgraded, or
2060@item the target processor is changed.
2061@end itemize
2062
2063Failure to provide enough space in the RTEMS RAM
2064Workspace will result in the
2065@code{@value{DIRPREFIX}fatal_error_occurred} directive
2066being invoked with the appropriate error code.
Note: See TracBrowser for help on using the repository browser.