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

4.104.114.84.95
Last change on this file since adee5979 was adee5979, checked in by Joel Sherrill <joel.sherrill@…>, on 05/04/00 at 19:45:17

Numerous changes based on comments from Stephan Wilms <Stephan.Wilms@…>
including a new section in the Getting Started called "Where to
Go From Here", lots of index entries added, and more configuration
table information.

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