source: rtems/doc/user/conf.t @ 3e066540

4.104.114.95
Last change on this file since 3e066540 was 3e066540, checked in by Joel Sherrill <joel.sherrill@…>, on 12/03/07 at 22:23:02

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

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