source: rtems/doc/user/conf.t @ 6d00095

4.104.114.84.95
Last change on this file since 6d00095 was 6d00095, checked in by Joel Sherrill <joel.sherrill@…>, on 03/27/02 at 14:39:06

2002-03-22 Chris Johns <ccj@…>

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