1 | @c |
---|
2 | @c COPYRIGHT (c) 1996. |
---|
3 | @c On-Line Applications Research Corporation (OAR). |
---|
4 | @c All rights reserved. |
---|
5 | @c |
---|
6 | |
---|
7 | @ifinfo |
---|
8 | @node Configuring a System, Configuring a System Configuration Table, EXTENSION_DELETE - Delete a extension set, Top |
---|
9 | @end ifinfo |
---|
10 | @chapter Configuring a System |
---|
11 | @ifinfo |
---|
12 | @menu |
---|
13 | * Configuring a System Configuration Table:: |
---|
14 | * Configuring a System RTEMS API Configuration Table:: |
---|
15 | * Configuring a System POSIX API Configuration Table:: |
---|
16 | * Configuring a System CPU Dependent Information Table:: |
---|
17 | * Configuring a System Initialization Task Table:: |
---|
18 | * Configuring a System Driver Address Table:: |
---|
19 | * Configuring a System User Extensions Table:: |
---|
20 | * Configuring a System Multiprocessor Configuration Table:: |
---|
21 | * Configuring a System Multiprocessor Communications Interface Table:: |
---|
22 | * Configuring a System Determining Memory Requirements:: |
---|
23 | * Configuring a System Sizing the RTEMS RAM Workspace:: |
---|
24 | @end menu |
---|
25 | @end ifinfo |
---|
26 | |
---|
27 | @ifinfo |
---|
28 | @node Configuring a System Configuration Table, Configuring a System RTEMS API Configuration Table, Configuring a System, Configuring a System |
---|
29 | @end ifinfo |
---|
30 | @section Configuration Table |
---|
31 | |
---|
32 | The RTEMS Configuration Table is used to tailor an |
---|
33 | application for its specific needs. For example, the user can |
---|
34 | configure the number of device drivers or which APIs may be used. |
---|
35 | THe address of the user-defined Configuration Table is passed as an |
---|
36 | argument to the initialize_executive directive, which MUST be |
---|
37 | the first RTEMS directive called. The RTEMS Configuration Table |
---|
38 | is defined in the following @value{RTEMS-LANGUAGE} @value{RTEMS-STRUCTURE}: |
---|
39 | |
---|
40 | @example |
---|
41 | @group |
---|
42 | typedef struct @{ |
---|
43 | void *work_space_start; |
---|
44 | rtems_unsigned32 work_space_size; |
---|
45 | rtems_unsigned32 maximum_extensions; |
---|
46 | rtems_unsigned32 microseconds_per_tick; |
---|
47 | rtems_unsigned32 ticks_per_timeslice; |
---|
48 | rtems_unsigned32 maximum_devices; |
---|
49 | rtems_unsigned32 number_of_device_drivers; |
---|
50 | rtems_driver_address_table *Device_driver_table; |
---|
51 | rtems_extensions_table *User_extension_table; |
---|
52 | rtems_multiprocessing_table *User_multiprocessing_table; |
---|
53 | rtems_api_configuration_table *RTEMS_api_configuration; |
---|
54 | posix_api_configuration_table *POSIX_api_configuration; |
---|
55 | @} rtems_configuration_table; |
---|
56 | @end group |
---|
57 | @end example |
---|
58 | |
---|
59 | @table @b |
---|
60 | @item work_space_start |
---|
61 | is the address of the RTEMS RAM Workspace. |
---|
62 | This area contains items such as the |
---|
63 | various object control blocks (TCBs, QCBs, ...) and task stacks. |
---|
64 | If the address is not aligned on a four-word boundary, then |
---|
65 | RTEMS will invoke the fatal error handler during |
---|
66 | initialize_executive. |
---|
67 | |
---|
68 | @item work_space_size |
---|
69 | is the calculated size of the |
---|
70 | RTEMS RAM Workspace. The section Sizing the RTEMS RAM Workspace |
---|
71 | details how to arrive at this number. |
---|
72 | |
---|
73 | @item microseconds_per_tick |
---|
74 | is number of microseconds per clock tick. |
---|
75 | |
---|
76 | @item ticks_per_timeslice |
---|
77 | is the number of clock ticks for a timeslice. |
---|
78 | |
---|
79 | @item maximum_devices |
---|
80 | is the maximum number of devices that can be registered. |
---|
81 | |
---|
82 | @item number_of_device_drivers |
---|
83 | is the number of device drivers for the system. There should be |
---|
84 | the same number of entries in the Device Driver Table. If this field |
---|
85 | is zero, then the User_driver_address_table entry should be NULL. |
---|
86 | |
---|
87 | @item Device_driver_table |
---|
88 | is the address of the Device Driver Table. This table contains the entry |
---|
89 | points for each device driver. If the number_of_device_drivers field is zero, |
---|
90 | then this entry should be NULL. The format of this table will be |
---|
91 | discussed below. |
---|
92 | |
---|
93 | @item User_extension_table |
---|
94 | is the address of the User |
---|
95 | Extension Table. This table contains the entry points for the |
---|
96 | static set of optional user extensions. If no user extensions |
---|
97 | are configured, then this entry should be NULL. The format of |
---|
98 | this table will be discussed below. |
---|
99 | |
---|
100 | @item User_multiprocessing_table |
---|
101 | is the address of the Multiprocessor Configuration Table. This |
---|
102 | table contains information needed by RTEMS only when used in a multiprocessor |
---|
103 | configuration. This field must be NULL when RTEMS is used in a |
---|
104 | single processor configuration. |
---|
105 | |
---|
106 | @item RTEMS_api_configuration |
---|
107 | is the address of the RTEMS API Configuration Table. This table |
---|
108 | contains information needed by the RTEMS API. This field should be |
---|
109 | NULL if the RTEMS API is not used. [NOTE: Currently the RTEMS API |
---|
110 | is required to support support components such as BSPs and libraries |
---|
111 | which use this API.] |
---|
112 | |
---|
113 | @item POSIX_api_configuration |
---|
114 | is the address of the POSIX API Configuration Table. This table |
---|
115 | contains information needed by the POSIX API. This field should be |
---|
116 | NULL if the POSIX API is not used. |
---|
117 | |
---|
118 | @end table |
---|
119 | |
---|
120 | @ifinfo |
---|
121 | @node Configuring a System RTEMS API Configuration Table, Configuring a System POSIX API Configuration Table, Configuring a System Configuration Table, Configuring a System |
---|
122 | @end ifinfo |
---|
123 | @section RTEMS API Configuration Table |
---|
124 | |
---|
125 | The RTEMS API Configuration Table is used to configure the |
---|
126 | managers which constitute the RTEMS API for a particular application. |
---|
127 | For example, the user can configure the maximum number of tasks for |
---|
128 | this application. The RTEMS API Configuration Table is defined in |
---|
129 | the following @value{RTEMS-LANGUAGE} @value{RTEMS-STRUCTURE}: |
---|
130 | |
---|
131 | @example |
---|
132 | @group |
---|
133 | typedef struct @{ |
---|
134 | rtems_unsigned32 maximum_tasks; |
---|
135 | rtems_unsigned32 maximum_timers; |
---|
136 | rtems_unsigned32 maximum_semaphores; |
---|
137 | rtems_unsigned32 maximum_message_queues; |
---|
138 | rtems_unsigned32 maximum_partitions; |
---|
139 | rtems_unsigned32 maximum_regions; |
---|
140 | rtems_unsigned32 maximum_ports; |
---|
141 | rtems_unsigned32 maximum_periods; |
---|
142 | rtems_unsigned32 number_of_initialization_tasks; |
---|
143 | rtems_initialization_tasks_table *User_initialization_tasks_table; |
---|
144 | @} rtems_api_configuration_table; |
---|
145 | @end group |
---|
146 | @end example |
---|
147 | |
---|
148 | @table @b |
---|
149 | @item maximum_tasks |
---|
150 | is the maximum number of tasks that |
---|
151 | can be concurrently active (created) in the system including |
---|
152 | initialization tasks. |
---|
153 | |
---|
154 | @item maximum_timers |
---|
155 | is the maximum number of timers |
---|
156 | that can be concurrently active in the system. |
---|
157 | |
---|
158 | @item maximum_semaphores |
---|
159 | is the maximum number of |
---|
160 | semaphores that can be concurrently active in the system. |
---|
161 | |
---|
162 | @item maximum_message_queues |
---|
163 | is the maximum number of |
---|
164 | message queues that can be concurrently active in the system. |
---|
165 | |
---|
166 | @item maximum_partitions |
---|
167 | is the maximum number of |
---|
168 | partitions that can be concurrently active in the system. |
---|
169 | |
---|
170 | @item maximum_regions |
---|
171 | is the maximum number of regions |
---|
172 | that can be concurrently active in the system. |
---|
173 | |
---|
174 | @item maximum_ports |
---|
175 | is the maximum number of ports into |
---|
176 | dual-port memory areas that can be concurrently active in the |
---|
177 | system. |
---|
178 | |
---|
179 | @item number_of_initialization_tasks |
---|
180 | is the number of initialization tasks configured. At least one |
---|
181 | initialization task must be configured. |
---|
182 | |
---|
183 | @item User_initialization_tasks_table |
---|
184 | is the address of the Initialization Task Table. This table contains the |
---|
185 | information needed to create and start each of the |
---|
186 | initialization tasks. The format of this table will be discussed below. |
---|
187 | |
---|
188 | @end table |
---|
189 | |
---|
190 | @ifinfo |
---|
191 | @node Configuring a System POSIX API Configuration Table, Configuring a System CPU Dependent Information Table, Configuring a System RTEMS API Configuration Table, Configuring a System |
---|
192 | @end ifinfo |
---|
193 | @section POSIX API Configuration Table |
---|
194 | |
---|
195 | The POSIX API Configuration Table is used to configure the |
---|
196 | managers which constitute the POSIX API for a particular application. |
---|
197 | For example, the user can configure the maximum number of threads for |
---|
198 | this application. The POSIX API Configuration Table is defined in |
---|
199 | the following @value{RTEMS-LANGUAGE} @value{RTEMS-STRUCTURE}: |
---|
200 | |
---|
201 | @example |
---|
202 | @group |
---|
203 | typedef struct @{ |
---|
204 | void *(*entry)(void *); |
---|
205 | @} posix_initialization_threads_table; |
---|
206 | |
---|
207 | typedef struct @{ |
---|
208 | int maximum_threads; |
---|
209 | int maximum_mutexes; |
---|
210 | int maximum_condition_variables; |
---|
211 | int maximum_keys; |
---|
212 | int maximum_queued_signals; |
---|
213 | int number_of_initialization_tasks; |
---|
214 | posix_initialization_threads_table *User_initialization_tasks_table; |
---|
215 | @} posix_api_configuration_table; |
---|
216 | @end group |
---|
217 | @end example |
---|
218 | |
---|
219 | @table @b |
---|
220 | @item maximum_threads |
---|
221 | is the maximum number of threads that |
---|
222 | can be concurrently active (created) in the system including |
---|
223 | initialization threads. |
---|
224 | |
---|
225 | @item maximum_mutexes |
---|
226 | is the maximum number of mutexes that can be concurrently |
---|
227 | active in the system. |
---|
228 | |
---|
229 | @item maximum_condition_variables |
---|
230 | is the maximum number of condition variables that can be |
---|
231 | concurrently active in the system. |
---|
232 | |
---|
233 | @item maximum_keys |
---|
234 | is the maximum number of keys that can be concurrently active in the system. |
---|
235 | |
---|
236 | @item maximum_queued_signals |
---|
237 | is the maximum number of queued signals that can be concurrently |
---|
238 | pending in the system. |
---|
239 | |
---|
240 | @item number_of_initialization_threads |
---|
241 | is the number of initialization threads configured. At least one |
---|
242 | initialization threads must be configured. |
---|
243 | |
---|
244 | @item User_initialization_threads_table |
---|
245 | is the address of the Initialization Threads Table. This table contains the |
---|
246 | information needed to create and start each of the initialization threads. |
---|
247 | The format of each entry in this table is defined in the |
---|
248 | posix_initialization_threads_table structure. |
---|
249 | |
---|
250 | @end table |
---|
251 | |
---|
252 | @ifinfo |
---|
253 | @node Configuring a System CPU Dependent Information Table, Configuring a System Initialization Task Table, Configuring a System POSIX API Configuration Table, Configuring a System |
---|
254 | @end ifinfo |
---|
255 | @section CPU Dependent Information Table |
---|
256 | |
---|
257 | The CPU Dependent Information Table is used to |
---|
258 | describe processor dependent information required by RTEMS. |
---|
259 | This table is generally used to supply RTEMS with information |
---|
260 | only known by the Board Support Package. The contents of this |
---|
261 | table are discussed in the CPU Dependent Information Table |
---|
262 | chapter of the C Applications Supplement document for a specific |
---|
263 | target processor. |
---|
264 | |
---|
265 | @ifinfo |
---|
266 | @node Configuring a System Initialization Task Table, Configuring a System Driver Address Table, Configuring a System CPU Dependent Information Table, Configuring a System |
---|
267 | @end ifinfo |
---|
268 | @section Initialization Task Table |
---|
269 | |
---|
270 | The Initialization Task Table is used to describe |
---|
271 | each of the user initialization tasks to the Initialization |
---|
272 | Manager. The table contains one entry for each initialization |
---|
273 | task the user wishes to create and start. The fields of this |
---|
274 | data structure directly correspond to arguments to the |
---|
275 | task_create and task_start directives. The number of entries is |
---|
276 | found in the number_of_initialization_tasks entry in the |
---|
277 | Configuration Table. The format of each entry in the |
---|
278 | Initialization Task Table is defined in the following C |
---|
279 | structure: |
---|
280 | |
---|
281 | @example |
---|
282 | typedef struct @{ |
---|
283 | rtems_name name; |
---|
284 | rtems_unsigned32 stack_size; |
---|
285 | rtems_task_priority initial_priority; |
---|
286 | rtems_attribute attribute_set; |
---|
287 | rtems_task_entry entry_point; |
---|
288 | rtems_mode mode_set; |
---|
289 | rtems_task_argument argument; |
---|
290 | @} rtems_initialization_tasks_table; |
---|
291 | @end example |
---|
292 | |
---|
293 | @table @b |
---|
294 | @item name |
---|
295 | is the name of this initialization task. |
---|
296 | |
---|
297 | @item stack_size |
---|
298 | is the size of the stack for this initialization task. |
---|
299 | |
---|
300 | @item initial_priority |
---|
301 | is the priority of this initialization task. |
---|
302 | |
---|
303 | @item attribute_set |
---|
304 | is the attribute set used during creation of this initialization task. |
---|
305 | |
---|
306 | @item entry_point |
---|
307 | is the address of the entry point of this initialization task. |
---|
308 | |
---|
309 | @item mode_set |
---|
310 | is the initial execution mode of this initialization task. |
---|
311 | |
---|
312 | @item argument |
---|
313 | is the initial argument for this initialization task. |
---|
314 | |
---|
315 | @end table |
---|
316 | |
---|
317 | A typical declaration for an Initialization Task Table might appear as follows: |
---|
318 | |
---|
319 | @example |
---|
320 | rtems_initialization_tasks_table |
---|
321 | Initialization_tasks[2] = @{ |
---|
322 | @{ INIT_1_NAME, |
---|
323 | 1024, |
---|
324 | 1, |
---|
325 | DEFAULT_ATTRIBUTES, |
---|
326 | Init_1, |
---|
327 | DEFAULT_MODES, |
---|
328 | 1 |
---|
329 | |
---|
330 | @}, |
---|
331 | @{ INIT_2_NAME, |
---|
332 | 1024, |
---|
333 | 250, |
---|
334 | FLOATING_POINT, |
---|
335 | Init_2, |
---|
336 | INTERRUPT_LEVEL(0)|NO_PREEMPT, |
---|
337 | 2 |
---|
338 | |
---|
339 | @} |
---|
340 | @}; |
---|
341 | @end example |
---|
342 | |
---|
343 | @ifinfo |
---|
344 | @node Configuring a System Driver Address Table, Configuring a System User Extensions Table, Configuring a System Initialization Task Table, Configuring a System |
---|
345 | @end ifinfo |
---|
346 | @section Driver Address Table |
---|
347 | |
---|
348 | The Device Driver Table is used to inform the I/O |
---|
349 | Manager of the set of entry points for each device driver |
---|
350 | configured in the system. The table contains one entry for each |
---|
351 | device driver required by the application. The number of |
---|
352 | entries is defined in the number_of_device_drivers entry in the |
---|
353 | Configuration Table. The format of each entry in the Device |
---|
354 | Driver Table is defined in |
---|
355 | the following @value{RTEMS-LANGUAGE} @value{RTEMS-STRUCTURE}: |
---|
356 | |
---|
357 | @example |
---|
358 | typedef struct @{ |
---|
359 | rtems_device_driver_entry initialization; |
---|
360 | rtems_device_driver_entry open; |
---|
361 | rtems_device_driver_entry close; |
---|
362 | rtems_device_driver_entry read; |
---|
363 | rtems_device_driver_entry write; |
---|
364 | rtems_device_driver_entry control; |
---|
365 | @} rtems_driver_address_table; |
---|
366 | @end example |
---|
367 | |
---|
368 | @table @b |
---|
369 | @item initialization |
---|
370 | is the address of the entry point called by io_initialize |
---|
371 | to initialize a device driver and its associated devices. |
---|
372 | |
---|
373 | @item open |
---|
374 | is the address of the entry point called by io_open. |
---|
375 | |
---|
376 | @item close |
---|
377 | is the address of the entry point called by io_close. |
---|
378 | |
---|
379 | @item read |
---|
380 | is the address of the entry point called by io_read. |
---|
381 | |
---|
382 | @item write |
---|
383 | is the address of the entry point called by io_write. |
---|
384 | |
---|
385 | @item control |
---|
386 | is the address of the entry point called by io_control. |
---|
387 | |
---|
388 | @end table |
---|
389 | |
---|
390 | Driver entry points configured as NULL will always |
---|
391 | return a status code of SUCCESSFUL. No user code will be |
---|
392 | executed in this situation. |
---|
393 | |
---|
394 | A typical declaration for a Device Driver Table might appear as follows: |
---|
395 | |
---|
396 | @example |
---|
397 | rtems_driver_address_table Driver_table[2] = @{ |
---|
398 | @{ tty_initialize, tty_open, tty_close, /* major = 0 */ |
---|
399 | tty_read, tty_write, tty_control |
---|
400 | @}, |
---|
401 | @{ lp_initialize, lp_open, lp_close, /* major = 1 */ |
---|
402 | NULL, lp_write, lp_control |
---|
403 | @} |
---|
404 | @}; |
---|
405 | @end example |
---|
406 | |
---|
407 | More information regarding the construction and |
---|
408 | operation of device drivers is provided in the I/O Manager |
---|
409 | chapter. |
---|
410 | |
---|
411 | @ifinfo |
---|
412 | @node Configuring a System User Extensions Table, Configuring a System Multiprocessor Configuration Table, Configuring a System Driver Address Table, Configuring a System |
---|
413 | @end ifinfo |
---|
414 | @section User Extensions Table |
---|
415 | |
---|
416 | The User Extensions Table is used to inform RTEMS of |
---|
417 | the optional user-supplied static extension set. This table |
---|
418 | contains one entry for each possible extension. The entries are |
---|
419 | called at critical times in the life of the system and |
---|
420 | individual tasks. The application may create dynamic extensions |
---|
421 | in addition to this single static set. The format of each entry |
---|
422 | in the User Extensions Table is defined in the following C |
---|
423 | structure: |
---|
424 | |
---|
425 | @example |
---|
426 | typedef struct @{ |
---|
427 | User_extensions_thread_create_extension thread_create; |
---|
428 | User_extensions_thread_start_extension thread_start; |
---|
429 | User_extensions_thread_restart_extension thread_restart; |
---|
430 | User_extensions_thread_delete_extension thread_delete; |
---|
431 | User_extensions_thread_switch_extension thread_switch; |
---|
432 | User_extensions_thread_post_switch_extension thread_post_switch; |
---|
433 | User_extensions_thread_begin_extension thread_begin; |
---|
434 | User_extensions_thread_exitted_extension thread_exitted; |
---|
435 | User_extensions_fatal_error_extension fatal; |
---|
436 | @} User_extensions_Table; |
---|
437 | @end example |
---|
438 | |
---|
439 | @table @b |
---|
440 | |
---|
441 | @item thread_create |
---|
442 | is the address of the |
---|
443 | user-supplied subroutine for the TASK_CREATE extension. If this |
---|
444 | extension for task creation is defined, it is called from the |
---|
445 | task_create directive. A value of NULL indicates that no |
---|
446 | extension is provided. |
---|
447 | |
---|
448 | @item thread_start |
---|
449 | is the address of the user-supplied |
---|
450 | subroutine for the TASK_START extension. If this extension for |
---|
451 | task initiation is defined, it is called from the task_start |
---|
452 | directive. A value of NULL indicates that no extension is |
---|
453 | provided. |
---|
454 | |
---|
455 | @item thread_restart |
---|
456 | is the address of the user-supplied |
---|
457 | subroutine for the TASK_RESTART extension. If this extension |
---|
458 | for task re-initiation is defined, it is called from the |
---|
459 | task_restart directive. A value of NULL indicates that no |
---|
460 | extension is provided. |
---|
461 | |
---|
462 | @item thread_delete |
---|
463 | is the address of the user-supplied |
---|
464 | subroutine for the TASK_DELETE extension. If this RTEMS |
---|
465 | extension for task deletion is defined, it is called from the |
---|
466 | task_delete directive. A value of NULL indicates that no |
---|
467 | extension is provided. |
---|
468 | |
---|
469 | @item thread_switch |
---|
470 | is the address of the user-supplied |
---|
471 | subroutine for the task context switch extension. This |
---|
472 | subroutine is called from RTEMS dispatcher after the current |
---|
473 | task has been swapped out but before the new task has been |
---|
474 | swapped in. A value of NULL indicates that no extension is |
---|
475 | provided. As this routine is invoked after saving the current |
---|
476 | task's context and before restoring the heir task's context, it |
---|
477 | is not necessary for this routine to save and restore any |
---|
478 | registers. |
---|
479 | |
---|
480 | @item thread_post_switch |
---|
481 | is the address of the |
---|
482 | user-supplied subroutine for the post task context switch |
---|
483 | extension. This subroutine is called from RTEMS dispatcher in |
---|
484 | the context of the task which has just been swapped in. |
---|
485 | |
---|
486 | @item thread_begin |
---|
487 | is the address of the user-supplied |
---|
488 | subroutine which is invoked immediately before a task begins |
---|
489 | execution. It is invoked in the context of the beginning task. |
---|
490 | A value of NULL indicates that no extension is provided. |
---|
491 | |
---|
492 | @item thread_exitted |
---|
493 | is the address of the user-supplied |
---|
494 | subroutine which is invoked when a task exits. This procedure |
---|
495 | is responsible for some action which will allow the system to |
---|
496 | continue execution (i.e. delete or restart the task) or to |
---|
497 | terminate with a fatal error. If this field is set to NULL, the |
---|
498 | default RTEMS task_exitted handler will be invoked. |
---|
499 | |
---|
500 | @item fatal |
---|
501 | is the address of the user-supplied |
---|
502 | subroutine for the FATAL extension. This RTEMS extension of |
---|
503 | fatal error handling is called from the fatal_error_occurred |
---|
504 | directive. If the user's fatal error handler returns or if this |
---|
505 | entry is NULL then the default RTEMS fatal error handler will be |
---|
506 | executed. |
---|
507 | |
---|
508 | @end table |
---|
509 | |
---|
510 | A typical declaration for a User Extension Table |
---|
511 | which defines the TASK_CREATE, TASK_DELETE, TASK_SWITCH, and |
---|
512 | FATAL extension might appear as follows: |
---|
513 | |
---|
514 | @example |
---|
515 | rtems_extensions_table User_extensions = @{ |
---|
516 | task_create_extension, |
---|
517 | NULL, |
---|
518 | NULL, |
---|
519 | task_delete_extension, |
---|
520 | task_switch_extension, |
---|
521 | NULL, |
---|
522 | NULL, |
---|
523 | fatal_extension |
---|
524 | @}; |
---|
525 | @end example |
---|
526 | |
---|
527 | More information regarding the user extensions is |
---|
528 | provided in the User Extensions chapter. |
---|
529 | |
---|
530 | @ifinfo |
---|
531 | @node Configuring a System Multiprocessor Configuration Table, Configuring a System Multiprocessor Communications Interface Table, Configuring a System User Extensions Table, Configuring a System |
---|
532 | @end ifinfo |
---|
533 | @section Multiprocessor Configuration Table |
---|
534 | |
---|
535 | The Multiprocessor Configuration Table contains |
---|
536 | information needed when using RTEMS in a multiprocessor |
---|
537 | configuration. Many of the details associated with configuring |
---|
538 | a multiprocessor system are dependent on the multiprocessor |
---|
539 | communications layer provided by the user. The address of the |
---|
540 | Multiprocessor Configuration Table should be placed in the |
---|
541 | User_multiprocessing_table entry in the primary Configuration |
---|
542 | Table. Further details regarding many of the entries in the |
---|
543 | Multiprocessor Configuration Table will be provided in the |
---|
544 | Multiprocessing chapter. The format of the Multiprocessor |
---|
545 | Configuration Table is defined in |
---|
546 | the following @value{RTEMS-LANGUAGE} @value{RTEMS-STRUCTURE}: |
---|
547 | |
---|
548 | @example |
---|
549 | typedef struct @{ |
---|
550 | rtems_unsigned32 node; |
---|
551 | rtems_unsigned32 maximum_nodes; |
---|
552 | rtems_unsigned32 maximum_global_objects; |
---|
553 | rtems_unsigned32 maximum_proxies; |
---|
554 | rtems_mpci_table *User_mpci_table; |
---|
555 | @} rtems_multiprocessing_table; |
---|
556 | @end example |
---|
557 | |
---|
558 | @table @b |
---|
559 | @item node |
---|
560 | is a unique processor identifier |
---|
561 | and is used in routing messages between nodes in a |
---|
562 | multiprocessor configuration. Each processor must have a unique |
---|
563 | node number. RTEMS assumes that node numbers start at one and |
---|
564 | increase sequentially. This assumption can be used to advantage |
---|
565 | by the user-supplied MPCI layer. Typically, this requirement is |
---|
566 | made when the node numbers are used to calculate the address of |
---|
567 | inter-processor communication links. Zero should be avoided as |
---|
568 | a node number because some MPCI layers use node zero to |
---|
569 | represent broadcasted packets. Thus, it is recommended that |
---|
570 | node numbers start at one and increase sequentially. |
---|
571 | |
---|
572 | @item maximum_nodes |
---|
573 | is the number of processor nodes in the system. |
---|
574 | |
---|
575 | @item maximum_global_objects |
---|
576 | is the maximum number of global objects which can exist at any |
---|
577 | given moment in the entire system. If this parameter is not the |
---|
578 | same on all nodes in the system, then a fatal error is generated |
---|
579 | to inform the user that the system is inconsistent. |
---|
580 | |
---|
581 | @item maximum_proxies |
---|
582 | is the maximum number of proxies which can exist at any given moment |
---|
583 | on this particular node. A proxy is a substitute task control block |
---|
584 | which represent a task residing on a remote node when that task blocks |
---|
585 | on a remote object. Proxies are used in situations in which delayed |
---|
586 | interaction is required with a remote node. |
---|
587 | |
---|
588 | @item User_mpci_table |
---|
589 | is the address of the Multiprocessor Communications Interface |
---|
590 | Table. This table contains the entry points of user-provided functions |
---|
591 | which constitute the multiprocessor communications layer. This table |
---|
592 | must be provided in multiprocessor configurations with all |
---|
593 | entries configured. The format of this table and details |
---|
594 | regarding its entries can be found in the next section. |
---|
595 | |
---|
596 | @end table |
---|
597 | |
---|
598 | @ifinfo |
---|
599 | @node Configuring a System Multiprocessor Communications Interface Table, Configuring a System Determining Memory Requirements, Configuring a System Multiprocessor Configuration Table, Configuring a System |
---|
600 | @end ifinfo |
---|
601 | @section Multiprocessor Communications Interface Table |
---|
602 | |
---|
603 | The format of this table is defined in |
---|
604 | the following @value{RTEMS-LANGUAGE} @value{RTEMS-STRUCTURE}: |
---|
605 | |
---|
606 | @example |
---|
607 | typedef struct @{ |
---|
608 | rtems_unsigned32 default_timeout; /* in ticks */ |
---|
609 | rtems_unsigned32 maximum_packet_size; |
---|
610 | rtems_mpci_initialization_entry initialization; |
---|
611 | rtems_mpci_get_packet_entry get_packet; |
---|
612 | rtems_mpci_return_packet_entry return_packet; |
---|
613 | rtems_mpci_send_entry send; |
---|
614 | rtems_mpci_receive_entry receive; |
---|
615 | @} rtems_mpci_table; |
---|
616 | @end example |
---|
617 | |
---|
618 | @table @b |
---|
619 | @item default_timeout |
---|
620 | is the default maximum length of time a task should block waiting for |
---|
621 | a response to a directive which results in communication with a remote node. |
---|
622 | The maximum length of time is a function the user supplied |
---|
623 | multiprocessor communications layer and the media used. This |
---|
624 | timeout only applies to directives which would not block if the |
---|
625 | operation were performed locally. |
---|
626 | |
---|
627 | @item maximum_packet_size |
---|
628 | is the size in bytes of the longest packet which the MPCI layer is capable |
---|
629 | of sending. This value should represent the total number of bytes available |
---|
630 | for a RTEMS interprocessor messages. |
---|
631 | |
---|
632 | @item initialization |
---|
633 | is the address of the entry point for the initialization procedure of the |
---|
634 | user supplied multiprocessor communications layer. |
---|
635 | |
---|
636 | @item get_packet |
---|
637 | is the address of the entry point for the procedure called by RTEMS to |
---|
638 | obtain a packet from the user supplied multiprocessor communications layer. |
---|
639 | |
---|
640 | @item return_packet |
---|
641 | is the address of the entry point for the procedure called by RTEMS to |
---|
642 | return a packet to the user supplied multiprocessor communications layer. |
---|
643 | |
---|
644 | @item send |
---|
645 | is the address of the entry point for the procedure called by RTEMS to |
---|
646 | send an envelope to another node. This procedure is part of the user |
---|
647 | supplied multiprocessor communications layer. |
---|
648 | |
---|
649 | @item receive |
---|
650 | is the address of the entry point for the |
---|
651 | procedure called by RTEMS to retrieve an envelope containing a |
---|
652 | message from another node. This procedure is part of the user |
---|
653 | supplied multiprocessor communications layer. |
---|
654 | |
---|
655 | @end table |
---|
656 | |
---|
657 | More information regarding the required functionality of these |
---|
658 | entry points is provided in the Multiprocessor chapter. |
---|
659 | |
---|
660 | @ifinfo |
---|
661 | @node Configuring a System Determining Memory Requirements, Configuring a System Sizing the RTEMS RAM Workspace, Configuring a System Multiprocessor Communications Interface Table, Configuring a System |
---|
662 | @end ifinfo |
---|
663 | @section Determining Memory Requirements |
---|
664 | |
---|
665 | Since memory is a critical resource in many real-time |
---|
666 | embedded systems, RTEMS was specifically designed to allow |
---|
667 | unused managers to be excluded from the run-time environment. |
---|
668 | This allows the application designer the flexibility to tailor |
---|
669 | RTEMS to most efficiently meet system requirements while still |
---|
670 | satisfying even the most stringent memory constraints. As |
---|
671 | result, the size of the RTEMS executive is application |
---|
672 | dependent. A Memory Requirements worksheet is provided in the C |
---|
673 | Applications Supplement document for a specific target |
---|
674 | processor. This worksheet can be used to calculate the memory |
---|
675 | requirements of a custom RTEMS run-time environment. To insure |
---|
676 | that enough memory is allocated for future versions of RTEMS, |
---|
677 | the application designer should round these memory requirements |
---|
678 | up. The following managers may be optionally excluded: |
---|
679 | |
---|
680 | @itemize @bullet |
---|
681 | @item signal |
---|
682 | @item region |
---|
683 | @item dual ported memory |
---|
684 | @item event |
---|
685 | @item multiprocessing |
---|
686 | @item partition |
---|
687 | @item timer |
---|
688 | @item semaphore |
---|
689 | @item message |
---|
690 | @item rate monotonic |
---|
691 | @end itemize |
---|
692 | |
---|
693 | RTEMS based applications must somehow provide memory |
---|
694 | for RTEMS' code and data space. Although RTEMS' data space must |
---|
695 | be in RAM, its code space can be located in either ROM or RAM. |
---|
696 | In addition, the user must allocate RAM for the RTEMS RAM |
---|
697 | Workspace. The size of this area is application dependent and |
---|
698 | can be calculated using the formula provided in the Memory |
---|
699 | Requirements chapter of the C Applications Supplement document |
---|
700 | for a specific target processor. |
---|
701 | |
---|
702 | All RTEMS data variables and routine names used by |
---|
703 | RTEMS begin with the underscore ( _ ) character followed by an |
---|
704 | upper-case letter. If RTEMS is linked with an application, then |
---|
705 | the application code should NOT contain any symbols which begin |
---|
706 | with the underscore character and followed by an upper-case |
---|
707 | letter to avoid any naming conflicts. All RTEMS directive names |
---|
708 | should be treated as reserved words. |
---|
709 | |
---|
710 | @ifinfo |
---|
711 | @node Configuring a System Sizing the RTEMS RAM Workspace, Multiprocessing Manager, Configuring a System Determining Memory Requirements, Configuring a System |
---|
712 | @end ifinfo |
---|
713 | @section Sizing the RTEMS RAM Workspace |
---|
714 | |
---|
715 | The RTEMS RAM Workspace is a user-specified block of |
---|
716 | memory reserved for use by RTEMS. The application should NOT |
---|
717 | modify this memory. This area consists primarily of the RTEMS |
---|
718 | data structures whose exact size depends upon the values |
---|
719 | specified in the Configuration Table. In addition, task stacks |
---|
720 | and floating point context areas are dynamically allocated from |
---|
721 | the RTEMS RAM Workspace. |
---|
722 | |
---|
723 | The starting address of the RTEMS RAM Workspace must |
---|
724 | be aligned on a four-byte boundary. Failure to properly align |
---|
725 | the workspace area will result in the fatal_error_occurred |
---|
726 | directive being invoked with the INVALID_ADDRESS error code. |
---|
727 | |
---|
728 | A worksheet is provided in the Memory Requirements |
---|
729 | chapter of the C Applications Supplement document for a specific |
---|
730 | target processor to assist the user in calculating the minimum |
---|
731 | size of the RTEMS RAM Workspace for each application. The value |
---|
732 | calculated with this worksheet is the minimum value that should |
---|
733 | be specified as the work_space_size parameter of the |
---|
734 | Configuration Table. The user is cautioned that future versions |
---|
735 | of RTEMS may not have the same memory requirements per object. |
---|
736 | Although the value calculated is sufficient for a particular |
---|
737 | target processor and release of RTEMS, memory usage is subject |
---|
738 | to change across versions and target processors. The user is |
---|
739 | advised to allocate somewhat more memory than the worksheet |
---|
740 | recommends to insure compatibility with future releases for a |
---|
741 | specific target processor and other target processors. To avoid |
---|
742 | problems, the user should recalculate the memory requirements |
---|
743 | each time one of the following events occurs: |
---|
744 | |
---|
745 | @itemize @bullet |
---|
746 | @item a configuration parameter is modified, |
---|
747 | @item task or interrupt stack requirements change, |
---|
748 | @item task floating point attribute is altered, |
---|
749 | @item RTEMS is upgraded, or |
---|
750 | @item the target processor is changed. |
---|
751 | @end itemize |
---|
752 | |
---|
753 | Failure to provide enough space in the RTEMS RAM |
---|
754 | Workspace will result in the fatal_error_occurred directive |
---|
755 | being invoked with the appropriate error code. |
---|