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

4.104.114.84.95
Last change on this file since 1dbf307 was 1dbf307, checked in by Joel Sherrill <joel.sherrill@…>, on 11/16/99 at 18:28:06

Added categorized list of constants in confdefs.h.

  • Property mode set to 100644
File size: 53.8 KB
Line 
1@c  COPYRIGHT (c) 1988-1998.
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
12@c CONFIGURE_MALLOC_REGION
13@c CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS
14@c CONFIGURE_LIBIO_SEMAPHORES
15@c CONFIGURE_INIT
16@c CONFIGURE_INTERRUPT_STACK_MEMORY
17@c CONFIGURE_GNAT_RTEMS
18@c     CONFIGURE_GNAT_MUTEXES
19@c     CONFIGURE_GNAT_KEYS
20@c     CONFIGURE_MAXIMUM_ADA_TASKS
21@c     CONFIGURE_MAXIMUM_FAKE_ADA_TASKS
22@c     CONFIGURE_ADA_TASKS_STACK
23@c
24@c In addition, there should be examples of defining your own
25@c Device Driver Table, Init task table, etc.
26@c
27@c Regardless, this is a big step up. :)
28@c
29
30@chapter Configuring a System
31
32@section Automatic Generation of System Configuration
33
34@cindex confdefs.h
35@fnindex confdefs.h
36
37RTEMS provides the @code{confdefs.h} C language header file that
38based on the setting of a variety of macros can automatically
39produce nearly all of the configuration tables required
40by an RTEMS application.  Rather than building the individual
41tables by hand. the application simply specifies the values
42for the configuration parameters it wishes to set.  In the following
43example, the configuration information for a simple system with
44a message queue and a time slice of 50 milliseconds is configured:
45
46@example
47@group
48#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
49#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
50
51#define CONFIGURE_MICROSECONDS_PER_TICK   1000 /* 1 millisecond */
52#define CONFIGURE_TICKS_PER_TIMESLICE       50 /* 50 milliseconds */
53
54#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
55@end group
56@end example
57
58This system will begin execution with the single initialization task
59named @code{Init}.  It will be configured to have both a console
60device driver (for standard I/O) and a clock tick device driver.
61
62For each configuration parameter in the configuration tables, the
63macro corresponding to that field is discussed.  Most systems
64can be easily configured using the @code{confdefs.h} mechanism.
65
66The following subsection list all of the constants which can be
67set by the user.
68
69@subsection Library Support Definitions
70
71@itemize @bullet
72@item CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS
73@item CONFIGURE_HAS_OWN_MOUNT_TABLE
74@item CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM
75@item STACK_CHECKER_ON
76@item CONFIGURE_MEMORY_OVERHEAD
77@item CONFIGURE_EXTRA_TASK_STACKS
78@end itemize
79
80@subsection Basic System Information
81
82@itemize @bullet
83@item CONFIGURE_HAS_OWN_CONFIGURATION_TABLE
84@item CONFIGURE_INTERRUPT_STACK_MEMORY
85@item CONFIGURE_EXECUTIVE_RAM_WORK_AREA
86@item CONFIGURE_MICROSECONDS_PER_TICK
87@item CONFIGURE_TICKS_PER_TIMESLICE
88@end itemize
89
90NOTE: The required size of the Executive RAM Work Area is calculated
91automatically when using the @code{confdefs.h} mechanism.
92
93@subsection Device Driver Table
94
95@itemize @bullet
96@item CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE
97@item CONFIGURE_HAS_OWN_NUMBER_OF_DEVICES
98@item CONFIGURE_MAXIMUM_DEVICES
99@item CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
100@item CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
101@item CONFIGURE_TEST_NEEDS_STUB_DRIVER
102@end itemize
103
104@subsection Multiprocessing Configuration
105
106@itemize @bullet
107@item CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE
108@item CONFIGURE_MP_NODE_NUMBER
109@item CONFIGURE_MP_MAXIMUM_NODES
110@item CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS
111@item CONFIGURE_MP_MAXIMUM_PROXIES
112@item CONFIGURE_MP_MPCI_TABLE_POINTER
113@end itemize
114
115@subsection Classic API Configuration
116
117@itemize @bullet
118@item CONFIGURE_MAXIMUM_TASKS
119@item CONFIGURE_MAXIMUM_TIMERS
120@item CONFIGURE_MAXIMUM_SEMAPHORES
121@item CONFIGURE_MAXIMUM_MESSAGE_QUEUES
122@item CONFIGURE_MAXIMUM_PARTITIONS
123@item CONFIGURE_MAXIMUM_REGIONS
124@item CONFIGURE_MAXIMUM_PORTS
125@item CONFIGURE_MAXIMUM_PERIODS
126@item CONFIGURE_MAXIMUM_USER_EXTENSIONS
127@end itemize
128
129@subsection Initialization Tasks Table Configuration
130
131@itemize @bullet
132@item CONFIGURE_INIT_TASK_NAME
133@item CONFIGURE_INIT_TASK_STACK_SIZE
134@item CONFIGURE_INIT_TASK_PRIORITY
135@item CONFIGURE_INIT_TASK_ATTRIBUTES
136@item CONFIGURE_INIT_TASK_ENTRY_POINT
137@item CONFIGURE_INIT_TASK_INITIAL_MODES
138@item CONFIGURE_INIT_TASK_ARGUMENTS
139@end itemize
140
141
142@subsection POSIX API Configuration
143
144@itemize @bullet
145@item CONFIGURE_MAXIMUM_POSIX_THREADS
146@item CONFIGURE_MAXIMUM_POSIX_MUTEXES
147@item CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES
148@item CONFIGURE_MAXIMUM_POSIX_KEYS
149@item CONFIGURE_MAXIMUM_POSIX_TIMERS
150@item CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS
151@item CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES
152@item CONFIGURE_MAXIMUM_POSIX_SEMAPHORES
153@end itemize
154
155@subsection POSIX Initialization Thread Table Configuration
156
157@itemize @bullet
158@item CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT
159@item CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE
160@end itemize
161
162@subsection ITRON API Configuration
163
164@itemize @bullet
165@item CONFIGURE_MAXIMUM_ITRON_TASKS
166@item CONFIGURE_MAXIMUM_ITRON_SEMAPHORES
167@item CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS
168@item CONFIGURE_MAXIMUM_ITRON_MAILBOXES
169@item CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS
170@item CONFIGURE_MAXIMUM_ITRON_PORTS
171@item CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS
172@item CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS
173@end itemize
174
175@subsection ITRON Initialization Task Table Configuration
176
177@itemize @bullet
178@item CONFIGURE_ITRON_INIT_TASK_ENTRY_POINT
179@item CONFIGURE_ITRON_INIT_TASK_ATTRIBUTES
180@item CONFIGURE_ITRON_INIT_TASK_PRIORITY
181@item CONFIGURE_ITRON_INIT_TASK_STACK_SIZE
182@item CONFIGURE_ITRON_INIT_TASK_STACK_SIZES
183@end itemize
184
185@subsection Ada Tasks
186
187@itemize @bullet
188@item CONFIGURE_MAXIMUM_ADA_TASKS
189@item CONFIGURE_MAXIMUM_FAKE_ADA_TASKS
190@end itemize
191
192@section Configuration Table
193
194@cindex Configuration Table
195@cindex RTEMS Configuration Table
196
197The RTEMS Configuration Table is used to tailor an
198application for its specific needs.  For example, the user can
199configure the number of device drivers or which APIs may be used.
200THe address of the user-defined Configuration Table is passed as an
201argument to the @code{@value{DIRPREFIX}initialize_executive}
202directive, which MUST be the first RTEMS directive called. 
203The RTEMS Configuration Table
204is defined in the following @value{LANGUAGE} @value{STRUCTURE}:
205
206@ifset is-C
207@example
208@group
209typedef struct @{
210  void                             *work_space_start;
211  rtems_unsigned32                  work_space_size;
212  rtems_unsigned32                  maximum_extensions;
213  rtems_unsigned32                  microseconds_per_tick;
214  rtems_unsigned32                  ticks_per_timeslice;
215  rtems_unsigned32                  maximum_devices;
216  rtems_unsigned32                  number_of_device_drivers;
217  rtems_driver_address_table       *Device_driver_table;
218  rtems_unsigned32                  number_of_initial_extensions;
219  rtems_extensions_table           *User_extension_table;
220  rtems_multiprocessing_table      *User_multiprocessing_table;
221  rtems_api_configuration_table    *RTEMS_api_configuration;
222  posix_api_configuration_table    *POSIX_api_configuration;
223@} rtems_configuration_table;
224@end group
225@end example
226@end ifset
227
228@ifset is-Ada
229@example
230type Configuration_Table is
231   record
232       Work_Space_Start             : RTEMS.Address;
233       Work_Space_Size              : RTEMS.Unsigned32;
234       Maximum_Extensions           : RTEMS.Unsigned32;
235       Microseconds_Per_Tick        : RTEMS.Unsigned32;
236       Ticks_Per_Timeslice          : RTEMS.Unsigned32;
237       Maximum_Devices              : RTEMS.Unsigned32;
238       Number_Of_Device_Drivers     : RTEMS.Unsigned32;
239       Device_Driver_Table          :
240            RTEMS.Driver_Address_Table_Pointer;
241       Number_Of_Initial_Extensions : RTEMS.Unsigned32;
242       User_Extension_Table         : RTEMS.Extensions_Table_Pointer;
243       User_Multiprocessing_Table   :
244            RTEMS.Multiprocessing_Table_Pointer;
245       RTEMS_API_Configuration      :
246            RTEMS.API_Configuration_Table_Pointer;
247       POSIX_API_Configuration      :
248            RTEMS.POSIX_API_Configuration_Table_Pointer;
249   end record;
250
251type Configuration_Table_Pointer is access all Configuration_Table;
252@end example
253@end ifset
254
255@table @b
256@item work_space_start
257is the address of the RTEMS RAM Workspace. 
258This area contains items such as the
259various object control blocks (TCBs, QCBs, ...) and task stacks.
260If the address is not aligned on a four-word boundary, then
261RTEMS will invoke the fatal error handler during
262@code{@value{DIRPREFIX}initialize_executive}.
263When using the @code{confdefs.h} mechanism for configuring
264an RTEMS application, the value for this field corresponds
265to the setting of the macro @code{CONFIGURE_EXECUTIVE_RAM_WORK_AREA}.
266
267@item work_space_size
268is the calculated size of the
269RTEMS RAM Workspace.  The section Sizing the RTEMS RAM Workspace
270details how to arrive at this number.
271When using the @code{confdefs.h} mechanism for configuring
272an RTEMS application, the value for this field corresponds
273to the setting of the macro @code{CONFIGURE_EXECUTIVE_RAM_SIZE}
274and is calculated based on the other system configuration settings.
275
276@item microseconds_per_tick
277is number of microseconds per clock tick.
278When using the @code{confdefs.h} mechanism for configuring
279an RTEMS application, the value for this field corresponds
280to the setting of the macro @code{CONFIGURE_MICROSECONDS_PER_TICK}.
281If not defined by the application, then the @code{CONFIGURE_MAXIMUM_TASKS}
282macro defaults to 10.
283XXX
284
285@item ticks_per_timeslice
286is the number of clock ticks for a timeslice.
287When using the @code{confdefs.h} mechanism for configuring
288an RTEMS application, the value for this field corresponds
289to the setting of the macro @code{CONFIGURE_TICKS_PER_TIMESLICE}.
290
291@item maximum_devices
292is the maximum number of devices that can be registered.
293When using the @code{confdefs.h} mechanism for configuring
294an RTEMS application, the value for this field corresponds
295to the setting of the macro @code{CONFIGURE_MAXIMUM_DEVICES}.
296
297@item number_of_device_drivers
298is the number of device drivers for the system.  There should be
299the same number of entries in the Device Driver Table.  If this field
300is zero, then the @code{User_driver_address_table} entry should be NULL.
301When using the @code{confdefs.h} mechanism for configuring
302an RTEMS application, the value for this field is calculated
303automatically based on the number of entries in the
304Device Driver Table.  This calculation is based on the assumption
305that the Device Driver Table is named @code{Device_drivers}
306and defined in C.  This table may be generated automatically
307for simple applications using only the device drivers that correspond
308to the following macros:
309
310@itemize @bullet
311
312@item @code{CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER}
313@item @code{CONFIGURE_TEST_NEEDS_CLOCK_DRIVER}
314@item @code{CONFIGURE_TEST_NEEDS_TIMER_DRIVER}
315@item @code{CONFIGURE_TEST_NEEDS_RTC_DRIVER}
316@item @code{CONFIGURE_TEST_NEEDS_STUB_DRIVER}
317
318@end itemize
319
320Note that network device drivers are not configured in the
321Device Driver Table.
322
323@item Device_driver_table
324is the address of the Device Driver Table.  This table contains the entry
325points for each device driver.  If the number_of_device_drivers field is zero,
326then this entry should be NULL. The format of this table will be
327discussed below.
328When using the @code{confdefs.h} mechanism for configuring
329an RTEMS application, the Device Driver Table is assumed to be
330named @code{Device_drivers} and defined in C.  If the application is providing
331its own Device Driver Table, then the macro
332@code{CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE} must be defined to indicate
333this and prevent @code{confdefs.h} from generating the table.
334
335@item number_of_initial_extensions
336is the number of initial user extensions.  There should be
337the same number of entries as in the User_extension_table.  If this field
338is zero, then the User_driver_address_table entry should be NULL.
339When using the @code{confdefs.h} mechanism for configuring
340an RTEMS application, the value for this field corresponds
341to the setting of the macro @code{CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS}
342which is set automatically by @code{confdefs.h} based on the size
343of the User Extensions Table.
344
345@item User_extension_table
346is the address of the User
347Extension Table.  This table contains the entry points for the
348static set of optional user extensions.  If no user extensions
349are configured, then this entry should be NULL.  The format of
350this table will be discussed below.
351When using the @code{confdefs.h} mechanism for configuring
352an RTEMS application, the User Extensions Table is named
353@code{Configuration_Initial_Extensions} and defined in
354confdefs.h.  It is initialized based on the following
355macros:
356
357@itemize @bullet
358
359@item @code{CONFIGURE_INITIAL_EXTENSIONS}
360@item @code{STACK_CHECKER_EXTENSION}
361
362@end itemize
363
364The application may configure one or more initial user extension
365sets by setting the @code{CONFIGURE_INITIAL_EXTENSIONS} macro.  By
366defining the @code{STACK_CHECKER_EXTENSION} macro, the task stack bounds
367checking user extension set is automatically included in the
368application.
369
370@item User_multiprocessing_table
371is the address of the Multiprocessor Configuration Table.  This
372table contains information needed by RTEMS only when used in a multiprocessor
373configuration.  This field must be NULL when RTEMS is used in a
374single processor configuration.
375When using the @code{confdefs.h} mechanism for configuring
376an RTEMS application, the Multiprocessor Configuration Table
377is automatically generated when the @code{CONFIGURE_MPTEST}
378is defined.  If @code{CONFIGURE_MPTEST} is not defined, the this
379entry is set to NULL.  The generated table has the name
380@code{Multiprocessing_configuration}.
381
382@item RTEMS_api_configuration
383is the address of the RTEMS API Configuration Table.  This table
384contains information needed by the RTEMS API.  This field should be
385NULL if the RTEMS API is not used.  [NOTE: Currently the RTEMS API
386is required to support support components such as BSPs and libraries
387which use this API.]  This table is built automatically and this
388entry filled in, if using the @code{confdefs.h} application
389configuration mechanism.  The generated table has the name
390@code{Configuration_RTEMS_API}.
391
392@item POSIX_api_configuration
393is the address of the POSIX API Configuration Table.  This table
394contains information needed by the POSIX API.  This field should be
395NULL if the POSIX API is not used.  This table is built automatically
396and this entry filled in, if using the @code{confdefs.h} application
397configuration mechanism.  The @code{confdefs.h} application
398mechanism will fill this field in with the address of the
399@code{Configuration_POSIX_API} table of POSIX API is configured
400and NULL if the POSIX API is not configured.
401
402@end table
403
404@section RTEMS API Configuration Table
405
406@cindex RTEMS API Configuration Table
407
408The RTEMS API Configuration Table is used to configure the
409managers which constitute the RTEMS API for a particular application. 
410For example, the user can configure the maximum number of tasks for
411this application. The RTEMS API Configuration Table is defined in
412the following @value{LANGUAGE} @value{STRUCTURE}:
413
414@ifset is-C
415@example
416@group
417typedef struct @{
418  rtems_unsigned32                  maximum_tasks;
419  rtems_unsigned32                  maximum_timers;
420  rtems_unsigned32                  maximum_semaphores;
421  rtems_unsigned32                  maximum_message_queues;
422  rtems_unsigned32                  maximum_partitions;
423  rtems_unsigned32                  maximum_regions;
424  rtems_unsigned32                  maximum_ports;
425  rtems_unsigned32                  maximum_periods;
426  rtems_unsigned32                  number_of_initialization_tasks;
427  rtems_initialization_tasks_table *User_initialization_tasks_table;
428@} rtems_api_configuration_table;
429@end group
430@end example
431@end ifset
432
433@ifset is-Ada
434@example
435type API_Configuration_Table is
436   record
437      Maximum_Tasks                   : RTEMS.Unsigned32;
438      Maximum_Timers                  : RTEMS.Unsigned32;
439      Maximum_Semaphores              : RTEMS.Unsigned32;
440      Maximum_Message_queues          : RTEMS.Unsigned32;
441      Maximum_Partitions              : RTEMS.Unsigned32;
442      Maximum_Regions                 : RTEMS.Unsigned32;
443      Maximum_Ports                   : RTEMS.Unsigned32;
444      Maximum_Periods                 : RTEMS.Unsigned32;
445      Number_Of_Initialization_Tasks  : RTEMS.Unsigned32;
446      User_Initialization_Tasks_Table :
447           RTEMS.Initialization_Tasks_Table_Pointer;
448   end record;
449
450type API_Configuration_Table_Pointer is
451           access all API_Configuration_Table;
452@end example
453@end ifset
454
455@table @b
456@item maximum_tasks
457is the maximum number of tasks that
458can be concurrently active (created) in the system including
459initialization tasks.
460When using the @code{confdefs.h} mechanism for configuring
461an RTEMS application, the value for this field corresponds
462to the setting of the macro @code{CONFIGURE_MAXIMUM_TASKS}.
463If not defined by the application, then the @code{CONFIGURE_MAXIMUM_TASKS}
464macro defaults to 10.
465
466@item maximum_timers
467is the maximum number of timers
468that can be concurrently active in the system.
469When using the @code{confdefs.h} mechanism for configuring
470an RTEMS application, the value for this field corresponds
471to the setting of the macro @code{CONFIGURE_MAXIMUM_TIMERS}.
472If not defined by the application, then the @code{CONFIGURE_MAXIMUM_TIMERS}
473macro defaults to 0.
474
475@item maximum_semaphores
476is the maximum number of
477semaphores that can be concurrently active in the system.
478When using the @code{confdefs.h} mechanism for configuring
479an RTEMS application, the value for this field corresponds
480to the setting of the macro @code{CONFIGURE_MAXIMUM_SEMAPHORES}.
481If not defined by the application, then the @code{CONFIGURE_MAXIMUM_SEMAPHORES}
482macro defaults to 0.
483
484@item maximum_message_queues
485is the maximum number of
486message queues that can be concurrently active in the system.
487When using the @code{confdefs.h} mechanism for configuring
488an RTEMS application, the value for this field corresponds
489to the setting of the macro @code{CONFIGURE_MAXIMUM_MESSAGE_QUEUES}.
490If not defined by the application, then the
491@code{CONFIGURE_MAXIMUM_MESSAGE_QUEUES} macro defaults to 0.
492
493@item maximum_partitions
494is the maximum number of
495partitions that can be concurrently active in the system.
496When using the @code{confdefs.h} mechanism for configuring
497an RTEMS application, the value for this field corresponds
498to the setting of the macro @code{CONFIGURE_MAXIMUM_PARTITIONS}.
499If not defined by the application, then the @code{CONFIGURE_MAXIMUM_PARTITIONS}
500macro defaults to 0.
501
502@item maximum_regions
503is the maximum number of regions
504that can be concurrently active in the system.
505When using the @code{confdefs.h} mechanism for configuring
506an RTEMS application, the value for this field corresponds
507to the setting of the macro @code{CONFIGURE_MAXIMUM_REGIONS}.
508If not defined by the application, then the @code{CONFIGURE_MAXIMUM_REGIONS}
509macro defaults to 0.
510
511@item maximum_ports
512is the maximum number of ports into
513dual-port memory areas that can be concurrently active in the
514system.
515When using the @code{confdefs.h} mechanism for configuring
516an RTEMS application, the value for this field corresponds
517to the setting of the macro @code{CONFIGURE_MAXIMUM_PORTS}.
518If not defined by the application, then the @code{CONFIGURE_MAXIMUM_PORTS}
519macro defaults to 0.
520
521@item number_of_initialization_tasks
522is the number of initialization tasks configured.  At least one
523RTEMS initialization task or POSIX initializatin must be configured
524in order for the user's application to begin executing.
525When using the @code{confdefs.h} mechanism for configuring
526an RTEMS application, the user must define the
527@code{CONFIGURE_RTEMS_INIT_TASKS_TABLE} to indicate that there
528is one or more RTEMS initialization task.  If the application
529only has one RTEMS initialization task, then the automatically
530generated Initialization Task Table will be sufficient.  The following
531macros correspond to the single initialization task:
532 
533@itemize @bullet
534
535@item @code{CONFIGURE_INIT_TASK_NAME} - is the name of the task. 
536If this macro is not defined by the application, then this defaults
537to the task name of @code{"UI1 "} for User Initialization Task 1.
538
539@item @code{CONFIGURE_INIT_TASK_STACK_SIZE} - is the stack size
540of the single initialization task.  If this macro is not defined
541by the application, then this defaults to @code{RTEMS_MINIMUM_STACK_SIZE}.
542
543@item @code{CONFIGURE_INIT_TASK_PRIORITY} - is the initial priority
544of the single initialization task.  If this macro is not defined
545by the application, then this defaults to 1.
546
547@item @code{CONFIGURE_INIT_TASK_ATTRIBUTES} - is the attributes
548of the single initialization task.  If this macro is not defined
549by the application, then this defaults to @code{RTEMS_DEFAULT_ATTRIBUTES}.
550
551@item @code{CONFIGURE_INIT_TASK_ENTRY_POINT} - is the entry point
552of the single initialization task.  If this macro is not defined
553by the application, then this defaults to the C language routine
554@code{Init}.
555
556@item @code{CONFIGURE_INIT_TASK_INITIAL_MODES} - is the initial execution
557modes of the single initialization task.  If this macro is not defined
558by the application, then this defaults to @code{RTEMS_NO_PREEMPT}.
559
560@item @code{CONFIGURE_INIT_TASK_ARGUMENTS} - is the argument passed to the
561of the single initialization task.  If this macro is not defined
562by the application, then this defaults to 0.
563
564
565@end itemize
566
567
568has the option to have
569 value for this field corresponds
570to the setting of the macro @code{}.
571
572@item User_initialization_tasks_table
573is the address of the Initialization Task Table. This table contains the
574information needed to create and start each of the
575initialization tasks.  The format of this table will be discussed below.
576When using the @code{confdefs.h} mechanism for configuring
577an RTEMS application, the value for this field corresponds
578to the setting of the macro @code{CONFIGURE_EXECUTIVE_RAM_WORK_AREA}.
579
580@end table
581
582@section POSIX API Configuration Table
583
584@cindex POSIX API Configuration Table
585
586The POSIX API Configuration Table is used to configure the
587managers which constitute the POSIX API for a particular application.
588For example, the user can configure the maximum number of threads for
589this application. The POSIX API Configuration Table is defined in
590the following @value{LANGUAGE} @value{STRUCTURE}:
591 
592@ifset is-C
593@example
594@group
595typedef struct @{
596  void       *(*thread_entry)(void *);
597@} posix_initialization_threads_table;
598 
599typedef struct @{
600  int                                 maximum_threads;
601  int                                 maximum_mutexes;
602  int                                 maximum_condition_variables;
603  int                                 maximum_keys;
604  int                                 maximum_timers;
605  int                                 maximum_queued_signals;
606  int                                 number_of_initialization_tasks;
607  posix_initialization_threads_table *User_initialization_tasks_table;
608@} posix_api_configuration_table;
609@end group
610@end example
611@end ifset
612
613@ifset is-Ada
614@example
615   type POSIX_Thread_Entry is access procedure (
616      Argument : in     RTEMS.Address
617   );
618
619   type POSIX_Initialization_Threads_Table_Entry is
620   record
621      Thread_Entry : RTEMS.POSIX_Thread_Entry;
622   end record;
623
624   type POSIX_Initialization_Threads_Table is array
625       ( RTEMS.Unsigned32 range <> ) of
626       RTEMS.POSIX_Initialization_Threads_Table_Entry;
627
628   type POSIX_Initialization_Threads_Table_Pointer is access all
629       POSIX_Initialization_Threads_Table;
630
631   type POSIX_API_Configuration_Table_Entry is
632      record
633         Maximum_Threads                 : Interfaces.C.Int;
634         Maximum_Mutexes                 : Interfaces.C.Int;
635         Maximum_Condition_Variables     : Interfaces.C.Int;
636         Maximum_Keys                    : Interfaces.C.Int;
637         Maximum_Timers                  : Interfaces.C.Int;
638         Maximum_Queued_Signals          : Interfaces.C.Int;
639         Number_Of_Initialization_Tasks  : Interfaces.C.Int;
640         User_Initialization_Tasks_Table :
641            RTEMS.POSIX_Initialization_Threads_Table_Pointer;
642      end record;
643
644   type POSIX_API_Configuration_Table is array
645      ( RTEMS.Unsigned32 range <> ) of
646          RTEMS.POSIX_API_Configuration_Table_Entry;
647
648   type POSIX_API_Configuration_Table_Pointer is access all
649          RTEMS.POSIX_API_Configuration_Table;
650@end example
651@end ifset
652 
653@table @b
654@item maximum_threads
655is the maximum number of threads that
656can be concurrently active (created) in the system including
657initialization threads.
658When using the @code{confdefs.h} mechanism for configuring
659an RTEMS application, the value for this field corresponds
660to the setting of the macro @code{CONFIGURE_MAXIMUM_POSIX_THREADS}.
661If not defined by the application, then the
662@code{CONFIGURE_MAXIMUM_POSIX_THREADS} macro defaults to 10.
663
664@item maximum_mutexes
665is the maximum number of mutexes that can be concurrently
666active in the system.
667When using the @code{confdefs.h} mechanism for configuring
668an RTEMS application, the value for this field corresponds
669to the setting of the macro @code{CONFIGURE_MAXIMUM_POSIX_MUTEXES}.
670If not defined by the application, then the
671@code{CONFIGURE_MAXIMUM_POSIX_MUTEXES} macro defaults to 0.
672
673@item maximum_condition_variables
674is the maximum number of condition variables that can be
675concurrently active in the system.
676When using the @code{confdefs.h} mechanism for configuring
677an RTEMS application, the value for this field corresponds
678to the setting of the macro @code{CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES}.
679If not defined by the application, then the
680@code{CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES} macro defaults to 0.
681
682@item maximum_keys
683is the maximum number of keys that can be concurrently active in the system.
684When using the @code{confdefs.h} mechanism for configuring
685an RTEMS application, the value for this field corresponds
686to the setting of the macro @code{CONFIGURE_MAXIMUM_POSIX_KEYS}.
687If not defined by the application, then the
688@code{CONFIGURE_MAXIMUM_POSIX_KEYS} macro defaults to 0.
689
690@item maximum_timers
691is the maximum number of POSIX timers that can be concurrently active
692in the system.
693When using the @code{confdefs.h} mechanism for configuring
694an RTEMS application, the value for this field corresponds
695to the setting of the macro @code{CONFIGURE_MAXIMUM_POSIX_TIMERS}.
696If not defined by the application, then the
697@code{CONFIGURE_MAXIMUM_POSIX_TIMERS} macro defaults to 0.
698
699@item maximum_queued_signals
700is the maximum number of queued signals that can be concurrently
701pending in the system.
702When using the @code{confdefs.h} mechanism for configuring
703an RTEMS application, the value for this field corresponds
704to the setting of the macro @code{CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS}.
705If not defined by the application, then the
706@code{CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS} macro defaults to 0.
707
708@item number_of_initialization_threads
709is the number of initialization threads configured.  At least one
710initialization threads must be configured.
711When using the @code{confdefs.h} mechanism for configuring
712an RTEMS application, the user must define the
713@code{CONFIGURE_POSIX_INIT_THREAD_TABLE} to indicate that there
714is one or more POSIX initialization thread.  If the application
715only has one POSIX initialization thread, then the automatically
716generated POSIX Initialization Thread Table will be sufficient.  The following
717macros correspond to the single initialization task:
718
719@itemize @bullet
720
721@item @code{CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT} - is the entry
722point of the thread.  If this macro is not defined by the application,
723then this defaults to the C routine @code{POSIX_Init}.
724
725@item @code{CONFIGURE_POSIX_INIT_TASK_STACK_SIZE} - is the stack size
726of the single initialization thread.  If this macro is not defined
727by the application, then this defaults to
728@code{(RTEMS_MINIMUM_STACK_SIZE * 2)}.
729
730@end itemize
731 
732@item User_initialization_threads_table
733is the address of the Initialization Threads Table. This table contains the
734information needed to create and start each of the initialization threads. 
735The format of each entry in this table is defined in the
736@code{posix_initialization_threads_table} @value{STRUCTURE}.
737When using the @code{confdefs.h} mechanism for configuring
738an RTEMS application, the value for this field corresponds
739to the address of the @code{POSIX_Initialization_threads} structure.
740
741@end table
742
743@section CPU Dependent Information Table
744
745@cindex CPU Dependent Information Table
746
747The CPU Dependent Information Table is used to
748describe processor dependent information required by RTEMS.
749This table is generally used to supply RTEMS with information
750only known by the Board Support Package.  The contents of this
751table are discussed in the CPU Dependent Information Table
752chapter of the Applications Supplement document for a specific
753target processor.
754
755The @code{confdefs.h} mechanism does not support generating this
756table.  It is normally filled in by the Board Support Package.
757
758@section Initialization Task Table
759
760@cindex Initialization Tasks Table
761
762The Initialization Task Table is used to describe
763each of the user initialization tasks to the Initialization
764Manager.  The table contains one entry for each initialization
765task the user wishes to create and start.  The fields of this
766data structure directly correspond to arguments to the
767@code{@value{DIRPREFIX}task_create} and
768@code{@value{DIRPREFIX}task_start} directives.  The number of entries is
769found in the @code{number_of_initialization_tasks} entry in the
770Configuration Table. 
771
772The format of each entry in the
773Initialization Task Table is defined in the following @value{LANGUAGE}
774@value{STRUCTURE}:
775
776@ifset is-C
777@example
778typedef struct @{
779  rtems_name           name;
780  rtems_unsigned32     stack_size;
781  rtems_task_priority  initial_priority;
782  rtems_attribute      attribute_set;
783  rtems_task_entry     entry_point;
784  rtems_mode           mode_set;
785  rtems_task_argument  argument;
786@} rtems_initialization_tasks_table;
787@end example
788@end ifset
789
790@ifset is-Ada
791@example
792type Initialization_Tasks_Table_Entry is
793   record
794      Name             : RTEMS.Name;          -- task name
795      Stack_Size       : RTEMS.Unsigned32;    -- task stack size
796      Initial_Priority : RTEMS.Task_priority; -- task priority
797      Attribute_Set    : RTEMS.Attribute;     -- task attributes
798      Entry_Point      : RTEMS.Task_Entry;    -- task entry point
799      Mode_Set         : RTEMS.Mode;          -- task initial mode
800      Argument         : RTEMS.Unsigned32;    -- task argument
801   end record;
802
803type Initialization_Tasks_Table is array
804    ( RTEMS.Unsigned32 range <> ) of
805      RTEMS.Initialization_Tasks_Table_Entry;
806
807type Initialization_Tasks_Table_Pointer is access all
808     Initialization_Tasks_Table;
809@end example
810@end ifset
811
812@table @b
813@item name
814is the name of this initialization task.
815
816@item stack_size
817is the size of the stack for this initialization task.
818
819@item initial_priority
820is the priority of this initialization task.
821
822@item attribute_set
823is the attribute set used during creation of this initialization task.
824
825@item entry_point
826is the address of the entry point of this initialization task.
827
828@item mode_set
829is the initial execution mode of this initialization task.
830
831@item argument
832is the initial argument for this initialization task.
833
834@end table
835
836A typical declaration for an Initialization Task Table might appear as follows:
837
838@ifset is-C
839@example
840rtems_initialization_tasks_table
841Initialization_tasks[2] = @{
842   @{ INIT_1_NAME,
843     1024,
844     1,
845     DEFAULT_ATTRIBUTES,
846     Init_1,
847     DEFAULT_MODES,
848     1
849
850   @},
851   @{ INIT_2_NAME,
852     1024,
853     250,
854     FLOATING_POINT,
855     Init_2,
856     NO_PREEMPT,
857     2
858
859   @}
860@};
861@end example
862@end ifset
863
864@ifset is-Ada
865@example
866Initialization_Tasks : aliased
867  RTEMS.Initialization_Tasks_Table( 1 .. 2 ) := (
868   (INIT_1_NAME,
869    1024,
870    1,
871    RTEMS.Default_Attributes,
872    Init_1'Access,
873    RTEMS.Default_Modes,
874    1),
875   (INIT_2_NAME,
876    1024,
877    250,
878    RTEMS.Floating_Point,
879    Init_2'Access,
880    RTEMS.No_Preempt,
881    2)
882);
883@end example
884@end ifset
885
886@section Driver Address Table
887
888@cindex Device Driver Table
889
890The Device Driver Table is used to inform the I/O
891Manager of the set of entry points for each device driver
892configured in the system.  The table contains one entry for each
893device driver required by the application.  The number of
894entries is defined in the number_of_device_drivers entry in the
895Configuration Table.  The format of each entry in the Device
896Driver Table is defined in
897the following @value{LANGUAGE} @value{STRUCTURE}:
898
899@ifset is-C
900@example
901typedef struct @{
902  rtems_device_driver_entry initialization;
903  rtems_device_driver_entry open;
904  rtems_device_driver_entry close;
905  rtems_device_driver_entry read;
906  rtems_device_driver_entry write;
907  rtems_device_driver_entry control;
908@} rtems_driver_address_table;
909@end example
910@end ifset
911
912@ifset is-Ada
913@example
914type Driver_Address_Table_Entry is
915   record
916      Initialization : RTEMS.Device_Driver_Entry;
917      Open           : RTEMS.Device_Driver_Entry;
918      Close          : RTEMS.Device_Driver_Entry;
919      Read           : RTEMS.Device_Driver_Entry;
920      Write          : RTEMS.Device_Driver_Entry;
921      Control        : RTEMS.Device_Driver_Entry;
922   end record;
923
924type Driver_Address_Table is array ( RTEMS.Unsigned32 range <> ) of
925  RTEMS.Driver_Address_Table_Entry;
926
927type Driver_Address_Table_Pointer is access all Driver_Address_Table;
928@end example
929@end ifset
930
931@table @b
932@item initialization
933is the address of the entry point called by
934@code{@value{DIRPREFIX}io_initialize}
935to initialize a device driver and its associated devices.
936
937@item open
938is the address of the entry point called by @code{@value{DIRPREFIX}io_open}.
939
940@item close
941is the address of the entry point called by @code{@value{DIRPREFIX}io_close}.
942
943@item read
944is the address of the entry point called by @code{@value{DIRPREFIX}io_read}.
945
946@item write
947is the address of the entry point called by @code{@value{DIRPREFIX}io_write}.
948
949@item control
950is the address of the entry point called by @code{@value{DIRPREFIX}io_control}.
951
952@end table
953
954Driver entry points configured as NULL will always
955return a status code of @code{@value{RPREFIX}SUCCESSFUL}.  No user code will be
956executed in this situation.
957
958A typical declaration for a Device Driver Table might appear as follows:
959
960@ifset is-C
961@example
962rtems_driver_address_table Driver_table[2] = @{
963   @{ tty_initialize, tty_open,  tty_close,  /* major = 0 */
964     tty_read,       tty_write, tty_control
965   @},
966   @{ lp_initialize, lp_open,    lp_close,   /* major = 1 */
967     NULL,          lp_write,   lp_control
968   @}
969@};
970@end example
971@end ifset
972
973@ifset is-Ada
974@example
975@end example
976@end ifset
977
978More information regarding the construction and
979operation of device drivers is provided in the I/O Manager
980chapter.
981
982@section User Extensions Table
983
984@cindex User Extensions Table
985
986The User Extensions Table is used to inform RTEMS of
987the optional user-supplied static extension set.  This table
988contains one entry for each possible extension.  The entries are
989called at critical times in the life of the system and
990individual tasks.  The application may create dynamic extensions
991in addition to this single static set.  The format of each entry
992in the User Extensions Table is defined in the following @value{LANGUAGE}
993@value{STRUCTURE}:
994
995@ifset is-C
996@example
997typedef User_extensions_routine           rtems_extension;
998typedef User_extensions_thread_create_extension   
999           rtems_task_create_extension;
1000typedef User_extensions_thread_delete_extension   
1001           rtems_task_delete_extension;
1002typedef User_extensions_thread_start_extension   
1003           rtems_task_start_extension;
1004typedef User_extensions_thread_restart_extension 
1005           rtems_task_restart_extension;
1006typedef User_extensions_thread_switch_extension   
1007           rtems_task_switch_extension;
1008typedef User_extensions_thread_begin_extension   
1009           rtems_task_begin_extension;
1010typedef User_extensions_thread_exitted_extension 
1011           rtems_task_exitted_extension;
1012typedef User_extensions_fatal_extension   rtems_fatal_extension;
1013
1014typedef User_extensions_Table             rtems_extensions_table;
1015
1016typedef struct @{
1017  rtems_task_create_extension      thread_create;
1018  rtems_task_start_extension       thread_start;
1019  rtems_task_restart_extension     thread_restart;
1020  rtems_task_delete_extension      thread_delete;
1021  rtems_task_switch_extension      thread_switch;
1022  rtems_task_begin_extension       thread_begin;
1023  rtems_task_exitted_extension     thread_exitted;
1024  rtems_fatal_extension            fatal;
1025@} User_extensions_Table;
1026@end example
1027@end ifset
1028
1029@ifset is-Ada
1030@example
1031type Extensions_Table_Entry is
1032   record
1033      Thread_Create      : RTEMS.Thread_Create_Extension;
1034      Thread_Start       : RTEMS.Thread_Start_Extension;
1035      Thread_Restart     : RTEMS.Thread_Restart_Extension;
1036      Thread_Delete      : RTEMS.Thread_Delete_Extension;
1037      Thread_Switch      : RTEMS.Thread_Switch_Extension;
1038      Thread_Post_Switch : RTEMS.Thread_Post_Switch_Extension;
1039      Thread_Begin       : RTEMS.Thread_Begin_Extension;
1040      Thread_Exitted     : RTEMS.Thread_Exitted_Extension;
1041      Fatal            : RTEMS.Fatal_Error_Extension;
1042   end record;
1043@end example
1044@end ifset
1045
1046@table @b
1047
1048@item thread_create
1049is the address of the
1050user-supplied subroutine for the TASK_CREATE extension.  If this
1051extension for task creation is defined, it is called from the
1052task_create directive.  A value of NULL indicates that no
1053extension is provided.
1054
1055@item thread_start
1056is the address of the user-supplied
1057subroutine for the TASK_START extension.  If this extension for
1058task initiation is defined, it is called from the task_start
1059directive.  A value of NULL indicates that no extension is
1060provided.
1061
1062@item thread_restart
1063is the address of the user-supplied
1064subroutine for the TASK_RESTART extension.  If this extension
1065for task re-initiation is defined, it is called from the
1066task_restart directive.  A value of NULL indicates that no
1067extension is provided.
1068
1069@item thread_delete
1070is the address of the user-supplied
1071subroutine for the TASK_DELETE extension.  If this RTEMS
1072extension for task deletion is defined, it is called from the
1073task_delete directive.  A value of NULL indicates that no
1074extension is provided.
1075
1076@item thread_switch
1077is the address of the user-supplied
1078subroutine for the task context switch extension.  This
1079subroutine is called from RTEMS dispatcher after the current
1080task has been swapped out but before the new task has been
1081swapped in.  A value of NULL indicates that no extension is
1082provided.  As this routine is invoked after saving the current
1083task's context and before restoring the heir task's context, it
1084is not necessary for this routine to save and restore any
1085registers.
1086
1087@item thread_begin
1088is the address of the user-supplied
1089subroutine which is invoked immediately before a task begins
1090execution.  It is invoked in the context of the beginning task.
1091A value of NULL indicates that no extension is provided.
1092
1093@item thread_exitted
1094is the address of the user-supplied
1095subroutine which is invoked when a task exits.  This procedure
1096is responsible for some action which will allow the system to
1097continue execution (i.e. delete or restart the task) or to
1098terminate with a fatal error.  If this field is set to NULL, the
1099default RTEMS TASK_EXITTED handler will be invoked.
1100
1101@item fatal
1102is the address of the user-supplied
1103subroutine for the FATAL extension.  This RTEMS extension of
1104fatal error handling is called from the
1105@code{@value{DIRPREFIX}fatal_error_occurred}
1106directive.  If the user's fatal error handler returns or if this
1107entry is NULL then the default RTEMS fatal error handler will be
1108executed.
1109
1110@end table
1111
1112A typical declaration for a User Extension Table
1113which defines the TASK_CREATE, TASK_DELETE, TASK_SWITCH, and
1114FATAL extension might appear as follows:
1115
1116@ifset is-C
1117@example
1118rtems_extensions_table User_extensions = @{
1119   task_create_extension,
1120   NULL,
1121   NULL,
1122   task_delete_extension,
1123   task_switch_extension,
1124   NULL,
1125   NULL,
1126   fatal_extension
1127@};
1128@end example
1129@end ifset
1130
1131@ifset is-Ada
1132User_Extensions : RTEMS.Extensions_Table := (
1133   Task_Create_Extension'Access,
1134   null,
1135   null,
1136   Task_Delete_Extension'Access,
1137   Task_Switch_Extension'Access,
1138   null,
1139   null,
1140   Fatal_Extension'Access
1141);
1142@example
1143
1144@end example
1145@end ifset
1146
1147More information regarding the user extensions is
1148provided in the User Extensions chapter.
1149
1150@section Multiprocessor Configuration Table
1151
1152@cindex Multiprocessor Configuration Table
1153
1154The Multiprocessor Configuration Table contains
1155information needed when using RTEMS in a multiprocessor
1156configuration.  Many of the details associated with configuring
1157a multiprocessor system are dependent on the multiprocessor
1158communications layer provided by the user.  The address of the
1159Multiprocessor Configuration Table should be placed in the
1160@code{User_multiprocessing_table} entry in the primary Configuration
1161Table.  Further details regarding many of the entries in the
1162Multiprocessor Configuration Table will be provided in the
1163Multiprocessing chapter. 
1164
1165
1166When using the @code{confdefs.h} mechanism for configuring
1167an RTEMS application, the macro @code{CONFIGURE_MPTEST} must
1168be defined to automatically generate the Multiprocessor Configuration Table.
1169If @code{CONFIGURE_MPTEST}, is not defined, then a NULL pointer
1170is configured as the address of this table.
1171
1172The format of the Multiprocessor Configuration Table is defined in
1173the following @value{LANGUAGE} @value{STRUCTURE}:
1174
1175@ifset is-C
1176@example
1177typedef struct @{
1178  rtems_unsigned32  node;
1179  rtems_unsigned32  maximum_nodes;
1180  rtems_unsigned32  maximum_global_objects;
1181  rtems_unsigned32  maximum_proxies;
1182  rtems_mpci_table *User_mpci_table;
1183@} rtems_multiprocessing_table;
1184@end example
1185@end ifset
1186
1187@ifset is-Ada
1188@example
1189type Multiprocessing_Table is
1190   record
1191      Node                   : RTEMS.Unsigned32;
1192      Maximum_Nodes          : RTEMS.Unsigned32;
1193      Maximum_Global_Objects : RTEMS.Unsigned32;
1194      Maximum_Proxies        : RTEMS.Unsigned32;
1195      User_MPCI_Table        : RTEMS.MPCI_Table_Pointer;
1196   end record;
1197
1198type Multiprocessing_Table_Pointer is access all Multiprocessing_Table;
1199@end example
1200@end ifset
1201
1202@table @b
1203@item node
1204is a unique processor identifier
1205and is used in routing messages between nodes in a
1206multiprocessor configuration.  Each processor must have a unique
1207node number.  RTEMS assumes that node numbers start at one and
1208increase sequentially.  This assumption can be used to advantage
1209by the user-supplied MPCI layer.  Typically, this requirement is
1210made when the node numbers are used to calculate the address of
1211inter-processor communication links.  Zero should be avoided as
1212a node number because some MPCI layers use node zero to
1213represent broadcasted packets.  Thus, it is recommended that
1214node numbers start at one and increase sequentially.
1215When using the @code{confdefs.h} mechanism for configuring
1216an RTEMS application, the value for this field corresponds
1217to the setting of the macro @code{CONFIGURE_MP_NODE_NUMBER}.
1218If not defined by the application, then the @code{CONFIGURE_MP_NODE_NUMBER}
1219macro defaults to the value of the @code{NODE_NUMBER} macro which is
1220set on the compiler command line by the RTEMS Multiprocessing Test Suites.
1221
1222
1223@item maximum_nodes
1224is the number of processor nodes 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_MP_MAXIMUM_NODES}.
1228If not defined by the application, then the @code{CONFIGURE_MP_MAXIMUM_NODES}
1229macro defaults to the value 2.
1230
1231@item maximum_global_objects
1232is the maximum number of global objects which can exist at any
1233given moment in the entire system.  If this parameter is not the
1234same on all nodes in the system, then a fatal error is generated
1235to inform the user that the system is inconsistent.
1236When using the @code{confdefs.h} mechanism for configuring
1237an RTEMS application, the value for this field corresponds
1238to the setting of the macro @code{CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS}.
1239If not defined by the application, then the
1240@code{CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS} macro defaults to the value 32.
1241
1242
1243@item maximum_proxies
1244is the maximum number of proxies which can exist at any given moment
1245on this particular node.  A proxy is a substitute task control block
1246which represent a task residing on a remote node when that task blocks
1247on a remote object.  Proxies are used in situations in which delayed
1248interaction is required with a remote node.
1249When using the @code{confdefs.h} mechanism for configuring
1250an RTEMS application, the value for this field corresponds
1251to the setting of the macro @code{CONFIGURE_MP_MAXIMUM_PROXIES}.
1252If not defined by the application, then the @code{CONFIGURE_MP_MAXIMUM_PROXIES}
1253macro defaults to the value 32.
1254
1255
1256@item User_mpci_table
1257is the address of the Multiprocessor Communications Interface
1258Table.  This table contains the entry points of user-provided functions
1259which constitute the multiprocessor communications layer.  This table
1260must be provided in multiprocessor configurations with all
1261entries configured.  The format of this table and details
1262regarding its entries can be found in the next section.
1263When using the @code{confdefs.h} mechanism for configuring
1264an RTEMS application, the value for this field corresponds
1265to the setting of the macro @code{CONFIGURE_MP_MPCI_TABLE_POINTER}.
1266If not defined by the application, then the
1267@code{CONFIGURE_MP_MPCI_TABLE_POINTER} macro defaults to the
1268address of the table named @code{MPCI_table}.
1269
1270
1271@end table
1272
1273@section Multiprocessor Communications Interface Table
1274
1275@cindex  Multiprocessor Communications Interface Table
1276
1277This table defines the set of callouts that must be provided by
1278an Multiprocessor Communications Interface implementation. 
1279
1280When using the @code{confdefs.h} mechanism for configuring
1281an RTEMS application, the name of this table is assumed
1282to be @code{MPCI_table} unless the application sets
1283the @code{CONFIGURE_MP_MPCI_TABLE_POINTER} when configuring a
1284multiprocessing system.
1285
1286The format of this table is defined in
1287the following @value{LANGUAGE} @value{STRUCTURE}:
1288
1289@ifset is-C
1290@example
1291typedef struct @{
1292  rtems_unsigned32                 default_timeout; /* in ticks */
1293  rtems_unsigned32                 maximum_packet_size;
1294  rtems_mpci_initialization_entry initialization;
1295  rtems_mpci_get_packet_entry     get_packet;
1296  rtems_mpci_return_packet_entry  return_packet;
1297  rtems_mpci_send_entry           send;
1298  rtems_mpci_receive_entry        receive;
1299@} rtems_mpci_table;
1300@end example
1301@end ifset
1302
1303@ifset is-Ada
1304@example
1305type MPCI_Table is
1306   record
1307      Default_Timeout     : RTEMS.Unsigned32; -- in ticks
1308      Maximum_Packet_Size : RTEMS.Unsigned32;
1309      Initialization      : RTEMS.MPCI_Initialization_Entry;
1310      Get_Packet          : RTEMS.MPCI_Get_Packet_Entry;
1311      Return_Packet       : RTEMS.MPCI_Return_Packet_Entry;
1312      Send                : RTEMS.MPCI_Send_Entry;
1313      Receive             : RTEMS.MPCI_Receive_Entry;
1314   end record;
1315
1316type MPCI_Table_Pointer is access all MPCI_Table;
1317@end example
1318@end ifset
1319
1320@table @b
1321@item default_timeout
1322is the default maximum length of time a task should block waiting for
1323a response to a directive which results in communication with a remote node.
1324The maximum length of time is a function the user supplied
1325multiprocessor communications layer and the media used.  This
1326timeout only applies to directives which would not block if the
1327operation were performed locally.
1328
1329@item maximum_packet_size
1330is the size in bytes of the longest packet which the MPCI layer is capable
1331of sending.  This value should represent the total number of bytes available
1332for a RTEMS interprocessor messages.
1333
1334@item initialization
1335is the address of the entry point for the initialization procedure of the
1336user supplied multiprocessor communications layer.
1337
1338@item get_packet
1339is the address of the entry point for the procedure called by RTEMS to
1340obtain a packet from the user supplied multiprocessor communications layer.
1341
1342@item return_packet
1343is the address of the entry point for the procedure called by RTEMS to
1344return a packet to the user supplied multiprocessor communications layer.
1345
1346@item send
1347is the address of the entry point for the procedure called by RTEMS to
1348send an envelope to another node.  This procedure is part of the user
1349supplied multiprocessor communications layer.
1350
1351@item receive
1352is the address of the entry point for the
1353procedure called by RTEMS to retrieve an envelope containing a
1354message from another node.  This procedure is part of the user
1355supplied multiprocessor communications layer.
1356
1357@end table
1358
1359More information regarding the required functionality of these
1360entry points is provided in the Multiprocessor chapter.
1361
1362@section Determining Memory Requirements
1363
1364Since memory is a critical resource in many real-time
1365embedded systems, the RTEMS Classic API was specifically designed to allow
1366unused managers to be forcibly excluded from the run-time environment.
1367This allows the application designer the flexibility to tailor
1368RTEMS to most efficiently meet system requirements while still
1369satisfying even the most stringent memory constraints.  As
1370result, the size of the RTEMS executive is application
1371dependent.  A Memory Requirements worksheet is provided in the
1372Applications Supplement document for a specific target
1373processor.  This worksheet can be used to calculate the memory
1374requirements of a custom RTEMS run-time environment.  To insure
1375that enough memory is allocated for future versions of RTEMS,
1376the application designer should round these memory requirements
1377up.  The following Classic API managers may be optionally excluded:
1378
1379@itemize @bullet
1380@item signal
1381@item region
1382@item dual ported memory
1383@item event
1384@item multiprocessing
1385@item partition
1386@item timer
1387@item semaphore
1388@item message
1389@item rate monotonic
1390@end itemize
1391
1392RTEMS is designed to be built and installed as a library
1393that is linked into the application.  As such, much of
1394RTEMS is implemented in such a way that there is a single
1395entry point per source file.  This avoids having the
1396linker being forced to pull large object files in their
1397entirety into an application when the application references
1398a single symbol.
1399
1400RTEMS based applications must somehow provide memory
1401for RTEMS' code and data space.  Although RTEMS' data space must
1402be in RAM, its code space can be located in either ROM or RAM.
1403In addition, the user must allocate RAM for the RTEMS RAM
1404Workspace.  The size of this area is application dependent and
1405can be calculated using the formula provided in the Memory
1406Requirements chapter of the Applications Supplement document
1407for a specific target processor.
1408
1409All private RTEMS data variables and routine names used by
1410RTEMS begin with the underscore ( _ ) character followed by an
1411upper-case letter.  If RTEMS is linked with an application, then
1412the application code should NOT contain any symbols which begin
1413with the underscore character and followed by an upper-case
1414letter to avoid any naming conflicts.  All RTEMS directive names
1415should be treated as reserved words.
1416
1417@section Sizing the RTEMS RAM Workspace
1418
1419The RTEMS RAM Workspace is a user-specified block of
1420memory reserved for use by RTEMS.  The application should NOT
1421modify this memory.  This area consists primarily of the RTEMS
1422data structures whose exact size depends upon the values
1423specified in the Configuration Table.  In addition, task stacks
1424and floating point context areas are dynamically allocated from
1425the RTEMS RAM Workspace.
1426
1427The @code{confdefs.h} mechanism calcalutes the size
1428of the RTEMS RAM Workspace automatically.  It assumes that
1429all tasks are floating point and that all will be allocated
1430the miminum stack space.  This calculation also automatically
1431includes the memory that will be allocated for internal use
1432by RTEMS.  The following macros may be set
1433by the application to make the calculation
1434of memory required more accurate:
1435
1436@itemize @bullet
1437
1438CONFIGURE_MEMORY_OVERHEAD
1439CONFIGURE_EXTRA_TASK_STACKS
1440
1441@end itemize
1442
1443The starting address of the RTEMS RAM Workspace must
1444be aligned on a four-byte boundary.  Failure to properly align
1445the workspace area will result in the
1446@code{@value{DIRPREFIX}fatal_error_occurred}
1447directive being invoked with the
1448@code{@value{RPREFIX}INVALID_ADDRESS} error code.
1449
1450A worksheet is provided in the @b{Memory Requirements}
1451chapter of the Applications Supplement document for a specific
1452target processor to assist the user in calculating the minimum
1453size of the RTEMS RAM Workspace for each application.  The value
1454calculated with this worksheet is the minimum value that should
1455be specified as the @code{work_space_size} parameter of the
1456Configuration Table. 
1457
1458The allocation of objects can operate in two modes. The default mode
1459has an object number ceiling. No more than the specified number of
1460objects can be allocated from the RTEMS RAM Workspace. The number of objects
1461specified in the particular API Configuration table fields are
1462allocated at initialisation. The second mode allows the number of
1463objects to grow to use the available free memory in the RTEMS RAM Workspace.
1464
1465The auto-extending mode can be enabled individually for each object
1466type by using the macro @code{rtems_resource_unlimited}. This takes a value
1467as a parameter, and is used to set the object maximum number field in
1468an API Configuration table. The value is an allocation unit size. When
1469RTEMS is required to grow the object table it is grown by this
1470size. The kernel will return the object memory back to the RTEMS RAM Workspace
1471when an object is destroyed. The kernel will only return an allocated
1472block of objects to the RTEMS RAM Workspace if at least half the allocation
1473size of free objects remain allocated. RTEMS always keeps one
1474allocation block of objects allocated. Here is an example of using
1475@code{rtems_resource_unlimited}:
1476
1477@example
1478#define CONFIGURE_MAXIMUM_TASKS rtems_resource_unlimited(5)
1479@end example
1480
1481The user is cautioned that future versions of RTEMS may not have the
1482same memory requirements per object. Although the value calculated is
1483suficient for a particular target processor and release of RTEMS,
1484memory usage is subject to change across versions and target
1485processors.  The user is advised to allocate somewhat more memory than
1486the worksheet recommends to insure compatibility with future releases
1487for a specific target processor and other target processors. To avoid
1488problems, the user should recalculate the memory requirements each
1489time one of the following events occurs:
1490
1491@itemize @bullet
1492@item a configuration parameter is modified,
1493@item task or interrupt stack requirements change,
1494@item task floating point attribute is altered,
1495@item RTEMS is upgraded, or
1496@item the target processor is changed.
1497@end itemize
1498
1499Failure to provide enough space in the RTEMS RAM
1500Workspace will result in the
1501@code{@value{DIRPREFIX}fatal_error_occurred} directive
1502being invoked with the appropriate error code.
Note: See TracBrowser for help on using the repository browser.