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