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