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