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