[b96254f] | 1 | /** |
---|
| 2 | * @file rtems/confdefs.h |
---|
[08bae5e6] | 3 | * |
---|
| 4 | * This include file contains the configuration table template that will |
---|
[df49c60] | 5 | * be instantiated by an application based on the setting of a number |
---|
| 6 | * of macros. The macros are documented in the Configuring a System |
---|
| 7 | * chapter of the Classic API User's Guide |
---|
[08bae5e6] | 8 | * |
---|
[df49c60] | 9 | * The model is to estimate the memory required for each configured item |
---|
| 10 | * and sum those estimates. The estimate can be too high or too low for |
---|
| 11 | * a variety of reasons: |
---|
| 12 | * |
---|
| 13 | * Reasons estimate is too high: |
---|
| 14 | * + FP contexts (not all tasks are FP) |
---|
| 15 | * |
---|
| 16 | * Reasons estimate is too low: |
---|
| 17 | * + stacks greater than minimum size |
---|
| 18 | * + messages |
---|
| 19 | * + application must account for device driver resources |
---|
| 20 | * + application must account for add-on library resource requirements |
---|
| 21 | * |
---|
| 22 | * NOTE: Eventually this may be able to take into account some of |
---|
| 23 | * the above. This procedure has evolved from just enough to |
---|
| 24 | * support the RTEMS Test Suites into something that can be |
---|
| 25 | * used remarkably reliably by most applications. |
---|
[b96254f] | 26 | */ |
---|
| 27 | |
---|
| 28 | /* |
---|
[76deaf0c] | 29 | * COPYRIGHT (c) 1989-2008. |
---|
[08bae5e6] | 30 | * On-Line Applications Research Corporation (OAR). |
---|
| 31 | * |
---|
[98e4ebf5] | 32 | * The license and distribution terms for this file may be |
---|
| 33 | * found in the file LICENSE in this distribution or at |
---|
[2ba508b] | 34 | * http://www.rtems.com/license/LICENSE. |
---|
[08bae5e6] | 35 | * |
---|
| 36 | * $Id$ |
---|
| 37 | */ |
---|
| 38 | |
---|
| 39 | #ifndef __CONFIGURATION_TEMPLATE_h |
---|
| 40 | #define __CONFIGURATION_TEMPLATE_h |
---|
[8486081] | 41 | |
---|
[9c63d90] | 42 | /* |
---|
| 43 | * Include the executive's configuration |
---|
| 44 | */ |
---|
| 45 | #include <rtems/score/cpuopts.h> |
---|
[b2b143f4] | 46 | #include <rtems/score/apimutex.h> |
---|
[9c63d90] | 47 | |
---|
[5877cc3a] | 48 | #ifdef __cplusplus |
---|
| 49 | extern "C" { |
---|
| 50 | #endif |
---|
| 51 | |
---|
[08bae5e6] | 52 | extern rtems_initialization_tasks_table Initialization_tasks[]; |
---|
| 53 | extern rtems_driver_address_table Device_drivers[]; |
---|
| 54 | extern rtems_configuration_table Configuration; |
---|
[976162a6] | 55 | #if defined(RTEMS_MULTIPROCESSING) |
---|
| 56 | extern rtems_multiprocessing_table Multiprocessing_configuration; |
---|
| 57 | #endif |
---|
[2eba45d] | 58 | #ifdef RTEMS_POSIX_API |
---|
[5877cc3a] | 59 | extern posix_api_configuration_table Configuration_POSIX_API; |
---|
[2eba45d] | 60 | #endif |
---|
[352c9b2] | 61 | #ifdef RTEMS_ITRON_API |
---|
[5877cc3a] | 62 | extern itron_api_configuration_table Configuration_ITRON_API; |
---|
[352c9b2] | 63 | #endif |
---|
[08bae5e6] | 64 | |
---|
[5877cc3a] | 65 | /** |
---|
| 66 | * This macro determines whether the RTEMS reentrancy support for |
---|
| 67 | * the Newlib C Library is enabled. |
---|
[3b89891] | 68 | */ |
---|
[5877cc3a] | 69 | #if (defined(RTEMS_NEWLIB) && !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY)) |
---|
[c3db01d0] | 70 | #define CONFIGURE_NEWLIB_EXTENSION 1 |
---|
[623893c] | 71 | #else |
---|
[c3db01d0] | 72 | #define CONFIGURE_NEWLIB_EXTENSION 0 |
---|
[9c63d90] | 73 | #endif |
---|
[623893c] | 74 | |
---|
[d40da79b] | 75 | |
---|
| 76 | #include <rtems/libio.h> |
---|
| 77 | |
---|
| 78 | #ifdef CONFIGURE_INIT |
---|
| 79 | rtems_libio_init_functions_t rtems_libio_init_helper = |
---|
| 80 | #ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM |
---|
| 81 | NULL; |
---|
| 82 | #else |
---|
| 83 | rtems_libio_init; |
---|
| 84 | #endif |
---|
| 85 | |
---|
| 86 | rtems_libio_supp_functions_t rtems_libio_supp_helper = |
---|
| 87 | #ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM |
---|
| 88 | NULL; |
---|
| 89 | #else |
---|
| 90 | open_dev_console; |
---|
| 91 | #endif |
---|
| 92 | |
---|
| 93 | rtems_fs_init_functions_t rtems_fs_init_helper = |
---|
| 94 | #ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM |
---|
| 95 | NULL; |
---|
| 96 | #else |
---|
| 97 | rtems_filesystem_initialize; |
---|
| 98 | #endif |
---|
| 99 | #endif |
---|
| 100 | |
---|
| 101 | |
---|
| 102 | #ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM |
---|
| 103 | #define CONFIGURE_HAS_OWN_MOUNT_TABLE |
---|
| 104 | #endif |
---|
| 105 | |
---|
[5877cc3a] | 106 | /** |
---|
| 107 | * This macro defines the number of POSIX file descriptors allocated |
---|
| 108 | * and managed by libio. These are the "integer" file descriptors that |
---|
| 109 | * are used by calls like open(2) and read(2). |
---|
[df49c60] | 110 | */ |
---|
[bd9c3d1] | 111 | #ifndef CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS |
---|
[5877cc3a] | 112 | #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 3 |
---|
[bd9c3d1] | 113 | #endif |
---|
| 114 | |
---|
[5877cc3a] | 115 | /** |
---|
| 116 | * From the number of file descriptors, we can determine how many |
---|
| 117 | * semaphores the implementation will require. |
---|
| 118 | */ |
---|
[bd9c3d1] | 119 | #define CONFIGURE_LIBIO_SEMAPHORES \ |
---|
| 120 | (CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS + 1) |
---|
| 121 | |
---|
[43908825] | 122 | #ifdef CONFIGURE_INIT |
---|
[5877cc3a] | 123 | /** |
---|
| 124 | * When instantiating the configuration tables, this variable is |
---|
| 125 | * initialized to specify the maximum number of file descriptors. |
---|
| 126 | */ |
---|
| 127 | uint32_t rtems_libio_number_iops = CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS; |
---|
[43908825] | 128 | #endif |
---|
| 129 | |
---|
[5877cc3a] | 130 | /** |
---|
| 131 | * This macro determines if termios is disabled by this application. |
---|
| 132 | * This only means that resources will not be reserved. If you end |
---|
| 133 | * up using termios, it will fail. |
---|
[df49c60] | 134 | */ |
---|
| 135 | #ifdef CONFIGURE_TERMIOS_DISABLED |
---|
[5877cc3a] | 136 | #define CONFIGURE_TERMIOS_SEMAPHORES 0 |
---|
[df49c60] | 137 | #else |
---|
[5877cc3a] | 138 | /** |
---|
| 139 | * This macro specifies the number of serial or PTY ports that will |
---|
| 140 | * use termios. |
---|
| 141 | */ |
---|
| 142 | #ifndef CONFIGURE_NUMBER_OF_TERMIOS_PORTS |
---|
| 143 | #define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 1 |
---|
| 144 | #endif |
---|
[df49c60] | 145 | |
---|
[5877cc3a] | 146 | /** |
---|
| 147 | * This macro reserves the number of semaphores required by termios |
---|
| 148 | * based upon the number of communication ports that will use it. |
---|
| 149 | */ |
---|
| 150 | #define CONFIGURE_TERMIOS_SEMAPHORES \ |
---|
| 151 | ((CONFIGURE_NUMBER_OF_TERMIOS_PORTS * 4) + 1) |
---|
[df49c60] | 152 | #endif |
---|
| 153 | |
---|
[5877cc3a] | 154 | /** |
---|
| 155 | * This macro specifies the number of PTYs that can be concurrently |
---|
| 156 | * active. |
---|
[d3d2afdf] | 157 | */ |
---|
| 158 | #ifndef CONFIGURE_MAXIMUM_PTYS |
---|
[5877cc3a] | 159 | #define CONFIGURE_MAXIMUM_PTYS 0 |
---|
[d3d2afdf] | 160 | #endif |
---|
| 161 | |
---|
[5877cc3a] | 162 | /** |
---|
| 163 | * This variable contains the maximum number of PTYs that can be |
---|
| 164 | * concurrently active. |
---|
| 165 | */ |
---|
[d3d2afdf] | 166 | #ifdef CONFIGURE_INIT |
---|
[396e3258] | 167 | int rtems_telnetd_maximum_ptys = CONFIGURE_MAXIMUM_PTYS; |
---|
[d3d2afdf] | 168 | #else |
---|
[396e3258] | 169 | extern int rtems_telnetd_maximum_ptys; |
---|
[d3d2afdf] | 170 | #endif |
---|
| 171 | |
---|
[d40da79b] | 172 | #ifdef CONFIGURE_INIT |
---|
| 173 | #ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM |
---|
| 174 | extern uint32_t rtems_device_table_size; |
---|
| 175 | #define CONFIGURE_MEMORY_FOR_DEVFS 0 |
---|
| 176 | #elif defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM) |
---|
| 177 | #ifndef CONFIGURE_MAXIMUM_DEVICES |
---|
| 178 | #define CONFIGURE_MAXIMUM_DEVICES 4 |
---|
| 179 | #endif |
---|
| 180 | #include <rtems/devfs.h> |
---|
| 181 | uint32_t rtems_device_table_size = CONFIGURE_MAXIMUM_DEVICES; |
---|
| 182 | #define CONFIGURE_MEMORY_FOR_DEVFS _Configure_Object_RAM(CONFIGURE_MAXIMUM_DEVICES, sizeof (rtems_device_name_t)) |
---|
| 183 | #else |
---|
| 184 | #define CONFIGURE_MEMORY_FOR_DEVFS 0 |
---|
| 185 | #endif |
---|
| 186 | #endif |
---|
| 187 | |
---|
[43f7a90] | 188 | /* |
---|
| 189 | * Mount Table Configuration |
---|
| 190 | */ |
---|
[ebbe119e] | 191 | #include <rtems/imfs.h> |
---|
[43f7a90] | 192 | |
---|
[5877cc3a] | 193 | /** |
---|
| 194 | * This specifies the number of bytes per block for files within |
---|
| 195 | * the IMFS. There are a maximum number of blocks per file so |
---|
| 196 | * this dictates the maximum size of a file. This has to be balanced |
---|
| 197 | * with the unused portion of each block that might be wasted. |
---|
| 198 | */ |
---|
[c9b005a9] | 199 | #ifndef CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK |
---|
[5877cc3a] | 200 | #define CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK \ |
---|
[4175abd] | 201 | IMFS_MEMFILE_DEFAULT_BYTES_PER_BLOCK |
---|
[c9b005a9] | 202 | #endif |
---|
[43f7a90] | 203 | #ifdef CONFIGURE_INIT |
---|
[c9b005a9] | 204 | int imfs_rq_memfile_bytes_per_block = CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK; |
---|
| 205 | #endif /* CONFIGURE_INIT */ |
---|
[43f7a90] | 206 | |
---|
[c9b005a9] | 207 | #ifdef CONFIGURE_INIT |
---|
[4c0d483b] | 208 | /** |
---|
| 209 | * This disables the inclusion of pipe support in the full IMFS. |
---|
| 210 | */ |
---|
| 211 | #if !defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM) |
---|
| 212 | #if defined(CONFIGURE_PIPES_ENABLED) |
---|
| 213 | bool rtems_pipe_configured = true; |
---|
| 214 | #else |
---|
| 215 | bool rtems_pipe_configured = false; |
---|
| 216 | #endif |
---|
| 217 | #endif |
---|
| 218 | |
---|
[c3db01d0] | 219 | #ifndef CONFIGURE_HAS_OWN_MOUNT_TABLE |
---|
[bf95ccb5] | 220 | const rtems_filesystem_mount_table_t configuration_mount_table = { |
---|
[c3db01d0] | 221 | #ifdef CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM |
---|
| 222 | &IMFS_ops, |
---|
[d40da79b] | 223 | #elif defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM) |
---|
| 224 | &devFS_ops, |
---|
[c3db01d0] | 225 | #else /* using miniIMFS as base filesystem */ |
---|
| 226 | &miniIMFS_ops, |
---|
| 227 | #endif |
---|
| 228 | RTEMS_FILESYSTEM_READ_WRITE, |
---|
| 229 | NULL, |
---|
| 230 | NULL |
---|
| 231 | }; |
---|
| 232 | |
---|
[bf95ccb5] | 233 | const rtems_filesystem_mount_table_t |
---|
[4175abd] | 234 | *rtems_filesystem_mount_table = &configuration_mount_table; |
---|
[bf95ccb5] | 235 | const int rtems_filesystem_mount_table_size = 1; |
---|
[c3db01d0] | 236 | #endif |
---|
[43f7a90] | 237 | #endif |
---|
| 238 | |
---|
[4afd6f4] | 239 | /* |
---|
| 240 | * STACK_CHECER_ON was still available in 4.9 so give a warning for now. |
---|
| 241 | */ |
---|
| 242 | #if defined(STACK_CHECKER_ON) |
---|
| 243 | #define CONFIGURE_STACK_CHECKER_ENABLED |
---|
| 244 | #warning "STACK_CHECKER_ON deprecated -- use CONFIGURE_STACK_CHECKER_ENABLED" |
---|
| 245 | #endif |
---|
| 246 | |
---|
[5877cc3a] | 247 | /** |
---|
| 248 | * This configures the stack checker user extension. |
---|
[ab97da95] | 249 | */ |
---|
[4afd6f4] | 250 | #ifdef CONFIGURE_STACK_CHECKER_ENABLED |
---|
[5877cc3a] | 251 | #define CONFIGURE_STACK_CHECKER_EXTENSION 1 |
---|
[ab97da95] | 252 | #else |
---|
[5877cc3a] | 253 | #define CONFIGURE_STACK_CHECKER_EXTENSION 0 |
---|
[ab97da95] | 254 | #endif |
---|
| 255 | |
---|
[80f9d77] | 256 | /** |
---|
| 257 | * @brief Maximum Priority configuration |
---|
| 258 | * |
---|
| 259 | * This configures the maximum priority value that |
---|
| 260 | * a task may have. |
---|
| 261 | * |
---|
| 262 | * By reducing the number of priorities in a system, |
---|
| 263 | * the amount of RAM required by RTEMS can be significantly |
---|
| 264 | * reduced. RTEMS allocates a Chain_Control structure per |
---|
| 265 | * priority and this structure contains 3 pointers. So |
---|
| 266 | * the default is (256 * 12) = 3K on 32-bit architectures. |
---|
| 267 | * |
---|
| 268 | * This must be one less than a power of 2 between |
---|
| 269 | * 4 and 256. Valid values along with the application |
---|
| 270 | * priority levels and memory saved when pointers are |
---|
| 271 | * 32-bits in size are: |
---|
| 272 | * |
---|
| 273 | * + 3, 2 application priorities, 3024 bytes saved |
---|
| 274 | * + 7, 5 application priorities, 2976 bytes saved |
---|
| 275 | * + 15, 13 application priorities, 2880 bytes saved |
---|
| 276 | * + 31, 29 application priorities, 2688 bytes saved |
---|
| 277 | * + 63, 61 application priorities, 2304 bytes saved |
---|
| 278 | * + 127, 125 application priorities, 1536 bytes saved |
---|
| 279 | * + 255, 253 application priorities, 0 bytes saved |
---|
| 280 | * |
---|
| 281 | * It is specified in terms of Classic API |
---|
| 282 | * priority values. |
---|
| 283 | */ |
---|
| 284 | #ifndef CONFIGURE_MAXIMUM_PRIORITY |
---|
[8f25cec] | 285 | #define CONFIGURE_MAXIMUM_PRIORITY PRIORITY_DEFAULT_MAXIMUM |
---|
[80f9d77] | 286 | #endif |
---|
| 287 | |
---|
| 288 | /* |
---|
| 289 | * If you said the IDLE task was going to do application initialization |
---|
| 290 | * and didn't override the IDLE body, then something is amiss. |
---|
| 291 | */ |
---|
| 292 | #if (defined(CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION) && \ |
---|
| 293 | !defined(CONFIGURE_IDLE_TASK_BODY)) |
---|
[805cddc] | 294 | #error "CONFIGURE_ERROR: You did not override the IDLE task body." |
---|
[80f9d77] | 295 | #endif |
---|
| 296 | |
---|
[5877cc3a] | 297 | /** |
---|
| 298 | * @brief Idle task body configuration |
---|
[976162a6] | 299 | * |
---|
| 300 | * There is a default IDLE thread body provided by RTEMS which |
---|
| 301 | * has the possibility of being CPU specific. There may be a |
---|
| 302 | * BSP specific override of the RTEMS default body and in turn, |
---|
| 303 | * the application may override and provide its own. |
---|
| 304 | */ |
---|
| 305 | #ifndef CONFIGURE_IDLE_TASK_BODY |
---|
[6c71b25] | 306 | #if defined(BSP_IDLE_TASK_BODY) |
---|
[976162a6] | 307 | #define CONFIGURE_IDLE_TASK_BODY BSP_IDLE_TASK_BODY |
---|
[6c71b25] | 308 | #elif (CPU_PROVIDES_IDLE_THREAD_BODY == TRUE) |
---|
| 309 | #define CONFIGURE_IDLE_TASK_BODY _CPU_Thread_Idle_body |
---|
[976162a6] | 310 | #else |
---|
[6c71b25] | 311 | #define CONFIGURE_IDLE_TASK_BODY _Thread_Idle_body |
---|
[976162a6] | 312 | #endif |
---|
| 313 | #endif |
---|
| 314 | |
---|
[ecf0f4c] | 315 | /** |
---|
| 316 | * By default, use the minimum stack size requested by this port. |
---|
| 317 | */ |
---|
| 318 | #ifndef CONFIGURE_MINIMUM_TASK_STACK_SIZE |
---|
| 319 | #define CONFIGURE_MINIMUM_TASK_STACK_SIZE CPU_STACK_MINIMUM_SIZE |
---|
| 320 | #endif |
---|
| 321 | |
---|
[5877cc3a] | 322 | /** |
---|
| 323 | * @brief Idle task stack size configuration |
---|
[976162a6] | 324 | * |
---|
| 325 | * By default, the IDLE task will have a stack of minimum size. |
---|
| 326 | * The BSP or application may override this value. |
---|
| 327 | */ |
---|
| 328 | #ifndef CONFIGURE_IDLE_TASK_STACK_SIZE |
---|
| 329 | #ifdef BSP_IDLE_TASK_STACK_SIZE |
---|
| 330 | #define CONFIGURE_IDLE_TASK_STACK_SIZE BSP_IDLE_TASK_STACK_SIZE |
---|
| 331 | #else |
---|
[ecf0f4c] | 332 | #define CONFIGURE_IDLE_TASK_STACK_SIZE CONFIGURE_MINIMUM_TASK_STACK_SIZE |
---|
[976162a6] | 333 | #endif |
---|
| 334 | #endif |
---|
| 335 | |
---|
[5877cc3a] | 336 | /** |
---|
| 337 | * @brief Interrupt stack size configuration |
---|
[6aa25da] | 338 | * |
---|
| 339 | * By default, the interrupt stack will be of minimum size. |
---|
| 340 | * The BSP or application may override this value. |
---|
| 341 | */ |
---|
| 342 | #ifndef CONFIGURE_INTERRUPT_STACK_SIZE |
---|
| 343 | #ifdef BSP_INTERRUPT_STACK_SIZE |
---|
| 344 | #define CONFIGURE_INTERRUPT_STACK_SIZE BSP_INTERRUPT_STACK_SIZE |
---|
| 345 | #else |
---|
[ecf0f4c] | 346 | #define CONFIGURE_INTERRUPT_STACK_SIZE CONFIGURE_MINIMUM_TASK_STACK_SIZE |
---|
[6aa25da] | 347 | #endif |
---|
| 348 | #endif |
---|
| 349 | |
---|
[5877cc3a] | 350 | /** |
---|
| 351 | * This reserves memory for the interrupt stack if it is to be allocated |
---|
| 352 | * by RTEMS rather than the BSP. |
---|
| 353 | * |
---|
| 354 | * @todo Try to get to the point where all BSPs support allocating the |
---|
| 355 | * memory from the Workspace. |
---|
[6aa25da] | 356 | */ |
---|
| 357 | #if (CPU_ALLOCATE_INTERRUPT_STACK == 0) |
---|
[d875597c] | 358 | #define CONFIGURE_INTERRUPT_STACK_MEMORY 0 |
---|
| 359 | #else |
---|
[94a88c1c] | 360 | #define CONFIGURE_INTERRUPT_STACK_MEMORY \ |
---|
| 361 | _Configure_From_workspace( CONFIGURE_INTERRUPT_STACK_SIZE ) |
---|
[6aa25da] | 362 | #endif |
---|
| 363 | |
---|
[5877cc3a] | 364 | /** |
---|
| 365 | * Configure the very much optional task stack allocator |
---|
[976162a6] | 366 | */ |
---|
| 367 | #ifndef CONFIGURE_TASK_STACK_ALLOCATOR |
---|
| 368 | #define CONFIGURE_TASK_STACK_ALLOCATOR NULL |
---|
| 369 | #endif |
---|
| 370 | |
---|
[5877cc3a] | 371 | /** |
---|
| 372 | * Configure the very much optional task stack deallocator |
---|
| 373 | */ |
---|
[976162a6] | 374 | #ifndef CONFIGURE_TASK_STACK_DEALLOCATOR |
---|
| 375 | #define CONFIGURE_TASK_STACK_DEALLOCATOR NULL |
---|
| 376 | #endif |
---|
| 377 | |
---|
[5877cc3a] | 378 | /** |
---|
[976162a6] | 379 | * Should the RTEMS Workspace and C Program Heap be cleared automatically |
---|
| 380 | * at system start up? |
---|
| 381 | */ |
---|
| 382 | #ifndef CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY |
---|
| 383 | #ifdef BSP_ZERO_WORKSPACE_AUTOMATICALLY |
---|
| 384 | #define CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY \ |
---|
| 385 | BSP_ZERO_WORKSPACE_AUTOMATICALLY |
---|
| 386 | #else |
---|
| 387 | #define CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY FALSE |
---|
| 388 | #endif |
---|
| 389 | #endif |
---|
| 390 | |
---|
[cfcc4e20] | 391 | /* |
---|
| 392 | * RTEMS Malloc configuration |
---|
| 393 | */ |
---|
| 394 | |
---|
| 395 | #include <rtems/malloc.h> |
---|
| 396 | |
---|
[bd5984de] | 397 | #ifdef CONFIGURE_INIT |
---|
| 398 | /** |
---|
| 399 | * By default, RTEMS uses separate heaps for the RTEMS Workspace and |
---|
| 400 | * the C Program Heap. On many BSPs, these can be optionally |
---|
| 401 | * combined provided one larger memory pool. This is particularly |
---|
| 402 | * useful in combination with the unlimited objects configuration. |
---|
| 403 | */ |
---|
| 404 | #ifdef CONFIGURE_UNIFIED_WORK_AREAS |
---|
| 405 | #include <rtems/score/wkspace.h> |
---|
| 406 | Heap_Control *RTEMS_Malloc_Heap = &_Workspace_Area; |
---|
| 407 | bool rtems_unified_work_area = true; |
---|
| 408 | #else |
---|
| 409 | Heap_Control RTEMS_Malloc_Area; |
---|
| 410 | Heap_Control *RTEMS_Malloc_Heap = &RTEMS_Malloc_Area; |
---|
| 411 | bool rtems_unified_work_area = false; |
---|
| 412 | #endif |
---|
| 413 | #endif |
---|
| 414 | |
---|
[cfcc4e20] | 415 | #ifdef CONFIGURE_INIT |
---|
[5877cc3a] | 416 | /** |
---|
| 417 | * This configures the malloc family statistics to be available. |
---|
| 418 | * By default only function call counts are kept. |
---|
| 419 | */ |
---|
[cfcc4e20] | 420 | rtems_malloc_statistics_functions_t *rtems_malloc_statistics_helpers = |
---|
| 421 | #ifndef CONFIGURE_MALLOC_STATISTICS |
---|
| 422 | NULL; |
---|
| 423 | #else |
---|
| 424 | &rtems_malloc_statistics_helpers_table; |
---|
| 425 | #endif |
---|
| 426 | #endif |
---|
| 427 | |
---|
| 428 | #ifdef CONFIGURE_INIT |
---|
[5877cc3a] | 429 | /** |
---|
| 430 | * This configures the sbrk() support for the malloc family. |
---|
| 431 | * By default it is assumed that the BSP provides all available |
---|
| 432 | * RAM to the malloc family implementation so sbrk()'ing to get |
---|
| 433 | * more memory would always fail anyway. |
---|
| 434 | */ |
---|
[cfcc4e20] | 435 | rtems_malloc_sbrk_functions_t *rtems_malloc_sbrk_helpers = |
---|
| 436 | #ifndef CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK |
---|
| 437 | NULL; |
---|
| 438 | #else |
---|
| 439 | &rtems_malloc_sbrk_helpers_table; |
---|
| 440 | #endif |
---|
| 441 | #endif |
---|
| 442 | |
---|
[bfc54b0] | 443 | #ifdef CONFIGURE_INIT |
---|
[5877cc3a] | 444 | /** |
---|
| 445 | * This configures the malloc family plugin which dirties memory |
---|
| 446 | * allocated. This is helpful for finding unitialized data structure |
---|
| 447 | * problems. |
---|
| 448 | */ |
---|
[bfc54b0] | 449 | rtems_malloc_dirtier_t *rtems_malloc_dirty_helper = |
---|
| 450 | #if defined(CONFIGURE_MALLOC_DIRTY) |
---|
| 451 | rtems_malloc_dirty_memory; |
---|
| 452 | #else |
---|
| 453 | NULL; |
---|
| 454 | #endif |
---|
| 455 | #endif |
---|
| 456 | |
---|
[5877cc3a] | 457 | /** |
---|
| 458 | * This is a helper macro used in calculations in this file. It is used |
---|
| 459 | * to noted when an element is allocated from the RTEMS Workspace and adds |
---|
| 460 | * a factor to account for heap overhead plus an alignment factor that |
---|
| 461 | * may be applied. |
---|
| 462 | */ |
---|
| 463 | #define _Configure_From_workspace(_size) \ |
---|
[4c09f4b] | 464 | (ssize_t)((_size) + (2 * sizeof(uint32_t)) + CPU_ALIGNMENT) |
---|
[5877cc3a] | 465 | |
---|
[dee98ce] | 466 | /** |
---|
| 467 | * Do not use the unlimited bit as part of the multiplication |
---|
| 468 | * for memory usage. |
---|
| 469 | */ |
---|
| 470 | #define _Configure_Max_Objects(_max) \ |
---|
| 471 | ((_max) & ~RTEMS_UNLIMITED_OBJECTS) |
---|
| 472 | |
---|
[5877cc3a] | 473 | /** |
---|
| 474 | * This macro accounts for how memory for a set of configured objects is |
---|
| 475 | * allocated from the Executive Workspace. |
---|
| 476 | * |
---|
| 477 | * NOTE: It does NOT attempt to address the more complex case of unlimited |
---|
| 478 | * objects. |
---|
| 479 | */ |
---|
| 480 | #define _Configure_Object_RAM(_number, _size) \ |
---|
[dee98ce] | 481 | ( _Configure_From_workspace(_Configure_Max_Objects(_number) * (_size)) + \ |
---|
[5877cc3a] | 482 | _Configure_From_workspace( \ |
---|
[dee98ce] | 483 | ((_Configure_Max_Objects(_number) + 1) * sizeof(Objects_Control *)) + \ |
---|
[5877cc3a] | 484 | (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) \ |
---|
| 485 | ) \ |
---|
| 486 | ) |
---|
| 487 | |
---|
[08bae5e6] | 488 | /* |
---|
| 489 | * Default User Initialization Task Table. This table guarantees that |
---|
| 490 | * one user initialization table is defined. |
---|
| 491 | */ |
---|
| 492 | |
---|
[be1c11ed] | 493 | #ifdef CONFIGURE_RTEMS_INIT_TASKS_TABLE |
---|
| 494 | |
---|
| 495 | #ifdef CONFIGURE_HAS_OWN_INIT_TASK_TABLE |
---|
| 496 | |
---|
| 497 | /* |
---|
[8486081] | 498 | * The user is defining their own table information and setting the |
---|
[be1c11ed] | 499 | * appropriate variables. |
---|
| 500 | */ |
---|
| 501 | |
---|
| 502 | #else |
---|
[08bae5e6] | 503 | |
---|
| 504 | #ifndef CONFIGURE_INIT_TASK_NAME |
---|
[5877cc3a] | 505 | #define CONFIGURE_INIT_TASK_NAME rtems_build_name('U', 'I', '1', ' ') |
---|
[08bae5e6] | 506 | #endif |
---|
| 507 | |
---|
| 508 | #ifndef CONFIGURE_INIT_TASK_STACK_SIZE |
---|
[ecf0f4c] | 509 | #define CONFIGURE_INIT_TASK_STACK_SIZE CONFIGURE_MINIMUM_TASK_STACK_SIZE |
---|
[08bae5e6] | 510 | #endif |
---|
| 511 | |
---|
| 512 | #ifndef CONFIGURE_INIT_TASK_PRIORITY |
---|
[5877cc3a] | 513 | #define CONFIGURE_INIT_TASK_PRIORITY 1 |
---|
[08bae5e6] | 514 | #endif |
---|
| 515 | |
---|
| 516 | #ifndef CONFIGURE_INIT_TASK_ATTRIBUTES |
---|
[5877cc3a] | 517 | #define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_DEFAULT_ATTRIBUTES |
---|
[08bae5e6] | 518 | #endif |
---|
| 519 | |
---|
| 520 | #ifndef CONFIGURE_INIT_TASK_ENTRY_POINT |
---|
[5877cc3a] | 521 | #define CONFIGURE_INIT_TASK_ENTRY_POINT Init |
---|
[08bae5e6] | 522 | #endif |
---|
| 523 | |
---|
| 524 | #ifndef CONFIGURE_INIT_TASK_INITIAL_MODES |
---|
[5877cc3a] | 525 | #define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_NO_PREEMPT |
---|
[08bae5e6] | 526 | #endif |
---|
| 527 | |
---|
| 528 | #ifndef CONFIGURE_INIT_TASK_ARGUMENTS |
---|
[5877cc3a] | 529 | #define CONFIGURE_INIT_TASK_ARGUMENTS 0 |
---|
[08bae5e6] | 530 | #endif |
---|
| 531 | |
---|
| 532 | #ifdef CONFIGURE_INIT |
---|
[5877cc3a] | 533 | rtems_initialization_tasks_table Initialization_tasks[] = { |
---|
| 534 | { CONFIGURE_INIT_TASK_NAME, |
---|
| 535 | CONFIGURE_INIT_TASK_STACK_SIZE, |
---|
| 536 | CONFIGURE_INIT_TASK_PRIORITY, |
---|
| 537 | CONFIGURE_INIT_TASK_ATTRIBUTES, |
---|
| 538 | CONFIGURE_INIT_TASK_ENTRY_POINT, |
---|
| 539 | CONFIGURE_INIT_TASK_INITIAL_MODES, |
---|
| 540 | CONFIGURE_INIT_TASK_ARGUMENTS |
---|
| 541 | } |
---|
| 542 | }; |
---|
[08bae5e6] | 543 | #endif |
---|
| 544 | |
---|
[d9a0689e] | 545 | #define CONFIGURE_INIT_TASK_TABLE Initialization_tasks |
---|
| 546 | |
---|
| 547 | #define CONFIGURE_INIT_TASK_TABLE_SIZE \ |
---|
| 548 | sizeof(CONFIGURE_INIT_TASK_TABLE) / sizeof(rtems_initialization_tasks_table) |
---|
| 549 | |
---|
[be1c11ed] | 550 | #endif /* CONFIGURE_HAS_OWN_INIT_TASK_TABLE */ |
---|
| 551 | |
---|
| 552 | #else /* CONFIGURE_RTEMS_INIT_TASKS_TABLE */ |
---|
| 553 | |
---|
| 554 | #define CONFIGURE_INIT_TASK_TABLE NULL |
---|
| 555 | #define CONFIGURE_INIT_TASK_TABLE_SIZE 0 |
---|
[45c3da3] | 556 | #define CONFIGURE_INIT_TASK_STACK_SIZE 0 |
---|
[be1c11ed] | 557 | |
---|
[08bae5e6] | 558 | #endif |
---|
| 559 | |
---|
| 560 | /* |
---|
| 561 | * Default Device Driver Table. Each driver needed by the test is explicitly |
---|
| 562 | * choosen by that test. There is always a null driver entry. |
---|
| 563 | */ |
---|
| 564 | |
---|
| 565 | #define NULL_DRIVER_TABLE_ENTRY \ |
---|
| 566 | { NULL, NULL, NULL, NULL, NULL, NULL } |
---|
| 567 | |
---|
[df49c60] | 568 | #ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
---|
[5877cc3a] | 569 | #include <rtems/console.h> |
---|
[df49c60] | 570 | #endif |
---|
| 571 | |
---|
| 572 | #ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER |
---|
[5877cc3a] | 573 | #include <rtems/clockdrv.h> |
---|
[df49c60] | 574 | #endif |
---|
| 575 | |
---|
| 576 | #ifdef CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER |
---|
[5877cc3a] | 577 | #include <rtems/timerdrv.h> |
---|
[08bae5e6] | 578 | #endif |
---|
| 579 | |
---|
[1d4bac9] | 580 | #ifdef CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER |
---|
[5877cc3a] | 581 | #include <rtems/rtc.h> |
---|
[1d4bac9] | 582 | #endif |
---|
| 583 | |
---|
[d2018f71] | 584 | #ifdef CONFIGURE_APPLICATION_NEEDS_WATCHDOG_DRIVER |
---|
[5877cc3a] | 585 | #include <rtems/watchdogdrv.h> |
---|
[d2018f71] | 586 | #endif |
---|
| 587 | |
---|
[df49c60] | 588 | #ifdef CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER |
---|
[5877cc3a] | 589 | #include <rtems/devnull.h> |
---|
[08bae5e6] | 590 | #endif |
---|
| 591 | |
---|
[c9b005a9] | 592 | #ifdef CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER |
---|
| 593 | /* the ide driver needs the ATA driver */ |
---|
[5877cc3a] | 594 | #ifndef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER |
---|
| 595 | #define CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER |
---|
| 596 | #endif |
---|
| 597 | #include <libchip/ide_ctrl.h> |
---|
[c9b005a9] | 598 | #endif |
---|
| 599 | |
---|
| 600 | #ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER |
---|
[5877cc3a] | 601 | #include <libchip/ata.h> |
---|
[c9b005a9] | 602 | #endif |
---|
| 603 | |
---|
[08bae5e6] | 604 | #ifndef CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE |
---|
| 605 | |
---|
| 606 | #ifdef CONFIGURE_INIT |
---|
[5877cc3a] | 607 | rtems_driver_address_table Device_drivers[] = { |
---|
[09daf222] | 608 | #ifdef CONFIGURE_BSP_PREREQUISITE_DRIVERS |
---|
| 609 | CONFIGURE_BSP_PREREQUISITE_DRIVERS, |
---|
| 610 | #endif |
---|
| 611 | #ifdef CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS |
---|
| 612 | CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS, |
---|
| 613 | #endif |
---|
[5877cc3a] | 614 | #ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
---|
| 615 | CONSOLE_DRIVER_TABLE_ENTRY, |
---|
| 616 | #endif |
---|
| 617 | #ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER |
---|
| 618 | CLOCK_DRIVER_TABLE_ENTRY, |
---|
| 619 | #endif |
---|
| 620 | #ifdef CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER |
---|
| 621 | RTC_DRIVER_TABLE_ENTRY, |
---|
| 622 | #endif |
---|
| 623 | #ifdef CONFIGURE_APPLICATION_NEEDS_WATCHDOG_DRIVER |
---|
| 624 | WATCHDOG_DRIVER_TABLE_ENTRY, |
---|
| 625 | #endif |
---|
| 626 | #ifdef CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER |
---|
| 627 | DEVNULL_DRIVER_TABLE_ENTRY, |
---|
| 628 | #endif |
---|
| 629 | #ifdef CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER |
---|
| 630 | IDE_CONTROLLER_DRIVER_TABLE_ENTRY, |
---|
| 631 | #endif |
---|
| 632 | #ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER |
---|
| 633 | ATA_DRIVER_TABLE_ENTRY, |
---|
| 634 | #endif |
---|
| 635 | #ifdef CONFIGURE_APPLICATION_EXTRA_DRIVERS |
---|
| 636 | CONFIGURE_APPLICATION_EXTRA_DRIVERS, |
---|
| 637 | #endif |
---|
| 638 | #ifdef CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER |
---|
| 639 | NULL_DRIVER_TABLE_ENTRY |
---|
| 640 | #elif !defined(CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER) && \ |
---|
[4175abd] | 641 | !defined(CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER) && \ |
---|
| 642 | !defined(CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER) && \ |
---|
| 643 | !defined(CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER) && \ |
---|
| 644 | !defined(CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER) && \ |
---|
| 645 | !defined(CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER) && \ |
---|
| 646 | !defined(CONFIGURE_APPLICATION_EXTRA_DRIVERS) |
---|
[5877cc3a] | 647 | NULL_DRIVER_TABLE_ENTRY |
---|
| 648 | #endif |
---|
| 649 | }; |
---|
[08bae5e6] | 650 | #endif |
---|
| 651 | |
---|
| 652 | #endif /* CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE */ |
---|
| 653 | |
---|
[059a3714] | 654 | /* |
---|
| 655 | * Default the number of drivers per node. This value may be |
---|
| 656 | * overridden by the user. |
---|
| 657 | */ |
---|
| 658 | |
---|
[96e6a86c] | 659 | #define CONFIGURE_NUMBER_OF_DRIVERS \ |
---|
| 660 | ((sizeof(Device_drivers) / sizeof(rtems_driver_address_table))) |
---|
| 661 | |
---|
[5877cc3a] | 662 | /** |
---|
| 663 | * This specifies the maximum number of device drivers that |
---|
| 664 | * can be installed in the system at one time. It must account |
---|
| 665 | * for both the statically and dynamically installed drivers. |
---|
| 666 | */ |
---|
[059a3714] | 667 | #ifndef CONFIGURE_MAXIMUM_DRIVERS |
---|
[5877cc3a] | 668 | #define CONFIGURE_MAXIMUM_DRIVERS CONFIGURE_NUMBER_OF_DRIVERS |
---|
[059a3714] | 669 | #endif |
---|
| 670 | |
---|
[08bae5e6] | 671 | |
---|
[c9b005a9] | 672 | #ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER |
---|
| 673 | /* |
---|
| 674 | * configure the priority of the ATA driver task |
---|
| 675 | */ |
---|
[5877cc3a] | 676 | #ifndef CONFIGURE_ATA_DRIVER_TASK_PRIORITY |
---|
| 677 | #define CONFIGURE_ATA_DRIVER_TASK_PRIORITY ATA_DRIVER_TASK_DEFAULT_PRIORITY |
---|
| 678 | #endif |
---|
| 679 | #ifdef CONFIGURE_INIT |
---|
[3899a537] | 680 | rtems_task_priority rtems_ata_driver_task_priority |
---|
[5877cc3a] | 681 | = CONFIGURE_ATA_DRIVER_TASK_PRIORITY; |
---|
| 682 | #endif /* CONFIGURE_INIT */ |
---|
[c9b005a9] | 683 | #endif |
---|
| 684 | |
---|
| 685 | /* |
---|
| 686 | * add bdbuf configuration and values for swapout task priority |
---|
| 687 | */ |
---|
| 688 | #ifdef CONFIGURE_APPLICATION_NEEDS_LIBBLOCK |
---|
[5877cc3a] | 689 | #include <rtems/bdbuf.h> |
---|
| 690 | /* |
---|
[3899a537] | 691 | * configure the bdbuf cache parameters |
---|
[5877cc3a] | 692 | */ |
---|
[3899a537] | 693 | #ifndef CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS |
---|
| 694 | #define CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS \ |
---|
| 695 | RTEMS_BDBUF_MAX_READ_AHEAD_BLOCKS_DEFAULT |
---|
| 696 | #endif |
---|
| 697 | #ifndef CONFIGURE_BDBUF_MAX_WRITE_BLOCKS |
---|
| 698 | #define CONFIGURE_BDBUF_MAX_WRITE_BLOCKS \ |
---|
| 699 | RTEMS_BDBUF_MAX_WRITE_BLOCKS_DEFAULT |
---|
| 700 | #endif |
---|
[5877cc3a] | 701 | #ifndef CONFIGURE_SWAPOUT_TASK_PRIORITY |
---|
[3899a537] | 702 | #define CONFIGURE_SWAPOUT_TASK_PRIORITY \ |
---|
| 703 | RTEMS_BDBUF_SWAPOUT_TASK_PRIORITY_DEFAULT |
---|
| 704 | #endif |
---|
| 705 | #ifndef CONFIGURE_SWAPOUT_SWAP_PERIOD |
---|
| 706 | #define CONFIGURE_SWAPOUT_SWAP_PERIOD \ |
---|
| 707 | RTEMS_BDBUF_SWAPOUT_TASK_SWAP_PERIOD_DEFAULT |
---|
| 708 | #endif |
---|
| 709 | #ifndef CONFIGURE_SWAPOUT_BLOCK_HOLD |
---|
| 710 | #define CONFIGURE_SWAPOUT_BLOCK_HOLD \ |
---|
| 711 | RTEMS_BDBUF_SWAPOUT_TASK_BLOCK_HOLD_DEFAULT |
---|
[5877cc3a] | 712 | #endif |
---|
| 713 | #ifdef CONFIGURE_INIT |
---|
[3899a537] | 714 | rtems_bdbuf_config rtems_bdbuf_configuration = { |
---|
| 715 | CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS, |
---|
| 716 | CONFIGURE_BDBUF_MAX_WRITE_BLOCKS, |
---|
| 717 | CONFIGURE_SWAPOUT_TASK_PRIORITY, |
---|
| 718 | CONFIGURE_SWAPOUT_SWAP_PERIOD, |
---|
| 719 | CONFIGURE_SWAPOUT_BLOCK_HOLD |
---|
| 720 | }; |
---|
[5877cc3a] | 721 | #endif |
---|
| 722 | #ifndef CONFIGURE_HAS_OWN_BDBUF_TABLE |
---|
| 723 | #ifndef CONFIGURE_BDBUF_BUFFER_COUNT |
---|
| 724 | #define CONFIGURE_BDBUF_BUFFER_COUNT 64 |
---|
| 725 | #endif |
---|
| 726 | |
---|
| 727 | #ifndef CONFIGURE_BDBUF_BUFFER_SIZE |
---|
| 728 | #define CONFIGURE_BDBUF_BUFFER_SIZE 512 |
---|
| 729 | #endif |
---|
| 730 | #ifdef CONFIGURE_INIT |
---|
[3899a537] | 731 | rtems_bdbuf_pool_config rtems_bdbuf_pool_configuration[] = { |
---|
[5877cc3a] | 732 | {CONFIGURE_BDBUF_BUFFER_SIZE, CONFIGURE_BDBUF_BUFFER_COUNT, NULL} |
---|
| 733 | }; |
---|
[3899a537] | 734 | int rtems_bdbuf_pool_configuration_size = |
---|
| 735 | (sizeof(rtems_bdbuf_pool_configuration) / |
---|
| 736 | sizeof(rtems_bdbuf_pool_configuration[0])); |
---|
[5877cc3a] | 737 | #endif /* CONFIGURE_INIT */ |
---|
| 738 | #endif /* CONFIGURE_HAS_OWN_BDBUF_TABLE */ |
---|
[c9b005a9] | 739 | #endif /* CONFIGURE_APPLICATION_NEEDS_LIBBLOCK */ |
---|
[976162a6] | 740 | |
---|
| 741 | #if defined(RTEMS_MULTIPROCESSING) |
---|
[5877cc3a] | 742 | /* |
---|
| 743 | * Default Multiprocessing Configuration Table. The defaults are |
---|
| 744 | * appropriate for most of the RTEMS Multiprocessor Test Suite. Each |
---|
| 745 | * value may be overridden within each test to customize the environment. |
---|
| 746 | */ |
---|
[08bae5e6] | 747 | |
---|
[5877cc3a] | 748 | #ifdef CONFIGURE_MP_APPLICATION |
---|
[f0f450a] | 749 | #define CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER 1 |
---|
| 750 | |
---|
[5877cc3a] | 751 | #ifndef CONFIGURE_HAS_OWN_MULTIPROCESSING_TABLE |
---|
[08bae5e6] | 752 | |
---|
[5877cc3a] | 753 | #ifndef CONFIGURE_MP_NODE_NUMBER |
---|
| 754 | #define CONFIGURE_MP_NODE_NUMBER NODE_NUMBER |
---|
| 755 | #endif |
---|
[08bae5e6] | 756 | |
---|
[5877cc3a] | 757 | #ifndef CONFIGURE_MP_MAXIMUM_NODES |
---|
[4175abd] | 758 | #define CONFIGURE_MP_MAXIMUM_NODES 2 |
---|
[5877cc3a] | 759 | #endif |
---|
[08bae5e6] | 760 | |
---|
[5877cc3a] | 761 | #ifndef CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS |
---|
[4175abd] | 762 | #define CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS 32 |
---|
[5877cc3a] | 763 | #endif |
---|
[f2a776ac] | 764 | #define CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS(_global_objects) \ |
---|
[4175abd] | 765 | _Configure_Object_RAM((_global_objects), sizeof(Objects_MP_Control)) |
---|
[08bae5e6] | 766 | |
---|
[5877cc3a] | 767 | #ifndef CONFIGURE_MP_MAXIMUM_PROXIES |
---|
[4175abd] | 768 | #define CONFIGURE_MP_MAXIMUM_PROXIES 32 |
---|
[5877cc3a] | 769 | #endif |
---|
[f2a776ac] | 770 | #define CONFIGURE_MEMORY_FOR_PROXIES(_proxies) \ |
---|
[4175abd] | 771 | _Configure_Object_RAM((_proxies) + 1, sizeof(Thread_Proxy_control) ) |
---|
[08bae5e6] | 772 | |
---|
[5877cc3a] | 773 | #ifndef CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK |
---|
[4175abd] | 774 | #define CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK 0 |
---|
[5877cc3a] | 775 | #endif |
---|
[def9eef] | 776 | |
---|
[5877cc3a] | 777 | #ifndef CONFIGURE_MP_MPCI_TABLE_POINTER |
---|
[4175abd] | 778 | #include <mpci.h> |
---|
| 779 | #define CONFIGURE_MP_MPCI_TABLE_POINTER &MPCI_table |
---|
[5877cc3a] | 780 | #endif |
---|
[08bae5e6] | 781 | |
---|
[5877cc3a] | 782 | #ifdef CONFIGURE_INIT |
---|
[4175abd] | 783 | rtems_multiprocessing_table Multiprocessing_configuration = { |
---|
| 784 | CONFIGURE_MP_NODE_NUMBER, /* local node number */ |
---|
| 785 | CONFIGURE_MP_MAXIMUM_NODES, /* maximum # nodes */ |
---|
| 786 | CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS, /* maximum # global objects */ |
---|
| 787 | CONFIGURE_MP_MAXIMUM_PROXIES, /* maximum # proxies */ |
---|
| 788 | CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK, /* MPCI stack > minimum */ |
---|
| 789 | CONFIGURE_MP_MPCI_TABLE_POINTER /* ptr to MPCI config table */ |
---|
| 790 | }; |
---|
[5877cc3a] | 791 | #endif |
---|
[08bae5e6] | 792 | |
---|
[5877cc3a] | 793 | #define CONFIGURE_MULTIPROCESSING_TABLE &Multiprocessing_configuration |
---|
[08bae5e6] | 794 | |
---|
[5877cc3a] | 795 | #endif /* CONFIGURE_HAS_OWN_MULTIPROCESSING_TABLE */ |
---|
[08bae5e6] | 796 | |
---|
[5877cc3a] | 797 | #else |
---|
[08bae5e6] | 798 | |
---|
[5877cc3a] | 799 | #define CONFIGURE_MULTIPROCESSING_TABLE NULL |
---|
[08bae5e6] | 800 | |
---|
[5877cc3a] | 801 | #endif /* CONFIGURE_MP_APPLICATION */ |
---|
[976162a6] | 802 | #endif /* RTEMS_MULTIPROCESSING */ |
---|
[8486081] | 803 | |
---|
[913ede4f] | 804 | #ifndef CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER |
---|
| 805 | #define CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER 0 |
---|
| 806 | #endif |
---|
| 807 | |
---|
| 808 | |
---|
[08bae5e6] | 809 | /* |
---|
[8486081] | 810 | * Default Configuration Table. |
---|
[08bae5e6] | 811 | */ |
---|
| 812 | |
---|
| 813 | #ifndef CONFIGURE_HAS_OWN_CONFIGURATION_TABLE |
---|
[8486081] | 814 | |
---|
[5877cc3a] | 815 | #ifndef CONFIGURE_MAXIMUM_TASKS |
---|
| 816 | #define CONFIGURE_MAXIMUM_TASKS 0 |
---|
| 817 | #endif |
---|
[08bae5e6] | 818 | |
---|
[4cb19041] | 819 | #ifndef CONFIGURE_DISABLE_CLASSIC_API_NOTEPADS |
---|
[f2a776ac] | 820 | #define CONFIGURE_NOTEPADS_ENABLED TRUE |
---|
| 821 | #else |
---|
[4cb19041] | 822 | #define CONFIGURE_NOTEPADS_ENABLED FALSE |
---|
[f2a776ac] | 823 | #endif |
---|
| 824 | |
---|
| 825 | #ifndef CONFIGURE_DISABLE_CLASSIC_NOTEPADS |
---|
| 826 | #define CONFIGURE_MEMORY_PER_TASK_FOR_CLASSIC_API \ |
---|
[94a88c1c] | 827 | _Configure_From_workspace( sizeof(RTEMS_API_Control) ) |
---|
[4cb19041] | 828 | #else |
---|
[f2a776ac] | 829 | #define CONFIGURE_MEMORY_PER_TASK_FOR_CLASSIC_API \ |
---|
[94a88c1c] | 830 | _Configure_From_workspace( sizeof(RTEMS_API_Control) - \ |
---|
| 831 | (RTEMS_NUMBER_NOTEPADS * sizeof(uint32_t))) |
---|
[4cb19041] | 832 | #endif |
---|
| 833 | |
---|
[f2a776ac] | 834 | /** |
---|
| 835 | * This macro calculates the memory required for task variables. |
---|
| 836 | * |
---|
| 837 | * @note Each task variable is individually allocated from the Workspace. |
---|
| 838 | * Hence, we do the multiplication on the configured size. |
---|
| 839 | */ |
---|
[5877cc3a] | 840 | #ifndef CONFIGURE_MAXIMUM_TASK_VARIABLES |
---|
[f2a776ac] | 841 | #define CONFIGURE_MAXIMUM_TASK_VARIABLES 0 |
---|
| 842 | #define CONFIGURE_MEMORY_FOR_TASK_VARIABLES(_task_variables) 0 |
---|
| 843 | #else |
---|
| 844 | #define CONFIGURE_MEMORY_FOR_TASK_VARIABLES(_task_variables) \ |
---|
| 845 | (_task_variables) * \ |
---|
| 846 | _Configure_From_workspace(sizeof(rtems_task_variable_t)) |
---|
[5877cc3a] | 847 | #endif |
---|
[08bae5e6] | 848 | |
---|
[5877cc3a] | 849 | #ifndef CONFIGURE_MAXIMUM_TIMERS |
---|
[f2a776ac] | 850 | #define CONFIGURE_MAXIMUM_TIMERS 0 |
---|
| 851 | #define CONFIGURE_MEMORY_FOR_TIMERS(_timers) 0 |
---|
| 852 | #else |
---|
| 853 | #define CONFIGURE_MEMORY_FOR_TIMERS(_timers) \ |
---|
| 854 | _Configure_Object_RAM(_timers, sizeof(Timer_Control) ) |
---|
[5877cc3a] | 855 | #endif |
---|
[08bae5e6] | 856 | |
---|
[5877cc3a] | 857 | #ifndef CONFIGURE_MAXIMUM_SEMAPHORES |
---|
[f2a776ac] | 858 | #define CONFIGURE_MAXIMUM_SEMAPHORES 0 |
---|
| 859 | #else |
---|
| 860 | #endif |
---|
| 861 | |
---|
| 862 | /* |
---|
| 863 | * If there are no user or support semaphores defined, then we can assume |
---|
| 864 | * that no memory need be allocated at all for semaphores. |
---|
| 865 | */ |
---|
| 866 | #if ((CONFIGURE_MAXIMUM_SEMAPHORES == 0) && \ |
---|
| 867 | (CONFIGURE_LIBIO_SEMAPHORES == 0) && \ |
---|
| 868 | (CONFIGURE_TERMIOS_SEMAPHORES == 0)) |
---|
| 869 | #define CONFIGURE_MEMORY_FOR_SEMAPHORES(_semaphores) 0 |
---|
| 870 | #else |
---|
| 871 | #define CONFIGURE_MEMORY_FOR_SEMAPHORES(_semaphores) \ |
---|
| 872 | _Configure_Object_RAM(_semaphores, sizeof(Semaphore_Control) ) |
---|
[5877cc3a] | 873 | #endif |
---|
[08bae5e6] | 874 | |
---|
[5877cc3a] | 875 | #ifndef CONFIGURE_MAXIMUM_MESSAGE_QUEUES |
---|
[f2a776ac] | 876 | #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 0 |
---|
| 877 | #define CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(_queues) 0 |
---|
| 878 | #else |
---|
| 879 | #define CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(_queues) \ |
---|
| 880 | _Configure_Object_RAM(_queues, sizeof(Message_queue_Control) ) |
---|
[5877cc3a] | 881 | #endif |
---|
[08bae5e6] | 882 | |
---|
[5877cc3a] | 883 | #ifndef CONFIGURE_MAXIMUM_PARTITIONS |
---|
[f2a776ac] | 884 | #define CONFIGURE_MAXIMUM_PARTITIONS 0 |
---|
| 885 | #define CONFIGURE_MEMORY_FOR_PARTITIONS(_partitions) 0 |
---|
| 886 | #else |
---|
| 887 | #define CONFIGURE_MEMORY_FOR_PARTITIONS(_partitions) \ |
---|
| 888 | _Configure_Object_RAM(_partitions, sizeof(Partition_Control) ) |
---|
[5877cc3a] | 889 | #endif |
---|
[08bae5e6] | 890 | |
---|
[5877cc3a] | 891 | #ifndef CONFIGURE_MAXIMUM_REGIONS |
---|
[f2a776ac] | 892 | #define CONFIGURE_MAXIMUM_REGIONS 0 |
---|
| 893 | #define CONFIGURE_MEMORY_FOR_REGIONS(_regions) 0 |
---|
| 894 | #else |
---|
| 895 | #define CONFIGURE_MEMORY_FOR_REGIONS(_regions) \ |
---|
| 896 | _Configure_Object_RAM(_regions, sizeof(Region_Control) ) |
---|
[5877cc3a] | 897 | #endif |
---|
[08bae5e6] | 898 | |
---|
[5877cc3a] | 899 | #ifndef CONFIGURE_MAXIMUM_PORTS |
---|
[f2a776ac] | 900 | #define CONFIGURE_MAXIMUM_PORTS 0 |
---|
| 901 | #define CONFIGURE_MEMORY_FOR_PORTS(_ports) 0 |
---|
| 902 | #else |
---|
| 903 | #define CONFIGURE_MEMORY_FOR_PORTS(_ports) \ |
---|
| 904 | _Configure_Object_RAM(_ports, sizeof(Dual_ported_memory_Control) ) |
---|
[5877cc3a] | 905 | #endif |
---|
[08bae5e6] | 906 | |
---|
[5877cc3a] | 907 | #ifndef CONFIGURE_MAXIMUM_PERIODS |
---|
[f2a776ac] | 908 | #define CONFIGURE_MAXIMUM_PERIODS 0 |
---|
| 909 | #define CONFIGURE_MEMORY_FOR_PERIODS(_periods) 0 |
---|
| 910 | #else |
---|
| 911 | #define CONFIGURE_MEMORY_FOR_PERIODS(_periods) \ |
---|
| 912 | _Configure_Object_RAM(_periods, sizeof(Rate_monotonic_Control) ) |
---|
[5877cc3a] | 913 | #endif |
---|
[7fa1ce86] | 914 | |
---|
[5877cc3a] | 915 | #ifndef CONFIGURE_MAXIMUM_BARRIERS |
---|
[f2a776ac] | 916 | #define CONFIGURE_MAXIMUM_BARRIERS 0 |
---|
| 917 | #define CONFIGURE_MEMORY_FOR_BARRIERS(_barriers) 0 |
---|
| 918 | #else |
---|
| 919 | #define CONFIGURE_MEMORY_FOR_BARRIERS(_barriers) \ |
---|
| 920 | _Configure_Object_RAM(_barriers, sizeof(Barrier_Control) ) |
---|
[5877cc3a] | 921 | #endif |
---|
[08bae5e6] | 922 | |
---|
[5877cc3a] | 923 | #ifndef CONFIGURE_MAXIMUM_USER_EXTENSIONS |
---|
[f2a776ac] | 924 | #define CONFIGURE_MAXIMUM_USER_EXTENSIONS 0 |
---|
| 925 | #define CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(_extensions) 0 |
---|
| 926 | #else |
---|
| 927 | #define CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(_extensions) \ |
---|
| 928 | _Configure_Object_RAM(_extensions, sizeof(Extension_Control) ) |
---|
[5877cc3a] | 929 | #endif |
---|
[08bae5e6] | 930 | |
---|
[5877cc3a] | 931 | #ifndef CONFIGURE_MICROSECONDS_PER_TICK |
---|
| 932 | #define CONFIGURE_MICROSECONDS_PER_TICK \ |
---|
| 933 | RTEMS_MILLISECONDS_TO_MICROSECONDS(10) |
---|
| 934 | #endif |
---|
| 935 | |
---|
| 936 | #ifndef CONFIGURE_TICKS_PER_TIMESLICE |
---|
| 937 | #define CONFIGURE_TICKS_PER_TIMESLICE 50 |
---|
| 938 | #endif |
---|
[08bae5e6] | 939 | |
---|
[0451b44] | 940 | /* |
---|
| 941 | * Initial Extension Set |
---|
| 942 | */ |
---|
| 943 | |
---|
| 944 | #ifdef CONFIGURE_INIT |
---|
[4afd6f4] | 945 | #ifdef CONFIGURE_STACK_CHECKER_ENABLED |
---|
[31bce9b] | 946 | #include <rtems/stackchk.h> |
---|
[0451b44] | 947 | #endif |
---|
[c3db01d0] | 948 | #include <rtems/libcsupport.h> |
---|
[0451b44] | 949 | |
---|
[96e6a86c] | 950 | #if defined(CONFIGURE_INITIAL_EXTENSIONS) || \ |
---|
[4afd6f4] | 951 | defined(CONFIGURE_STACK_CHECKER_ENABLED) || \ |
---|
[c3db01d0] | 952 | (defined(RTEMS_NEWLIB) && !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY)) |
---|
| 953 | rtems_extensions_table Configuration_Initial_Extensions[] = { |
---|
| 954 | #if !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY) |
---|
| 955 | RTEMS_NEWLIB_EXTENSION, |
---|
| 956 | #endif |
---|
[4afd6f4] | 957 | #if defined(CONFIGURE_STACK_CHECKER_ENABLED) |
---|
[c3db01d0] | 958 | RTEMS_STACK_CHECKER_EXTENSION, |
---|
| 959 | #endif |
---|
| 960 | #if defined(CONFIGURE_INITIAL_EXTENSIONS) |
---|
| 961 | CONFIGURE_INITIAL_EXTENSIONS, |
---|
| 962 | #endif |
---|
| 963 | }; |
---|
| 964 | |
---|
| 965 | #define CONFIGURE_INITIAL_EXTENSION_TABLE Configuration_Initial_Extensions |
---|
| 966 | #define CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS \ |
---|
| 967 | ((sizeof(Configuration_Initial_Extensions) / \ |
---|
| 968 | sizeof(rtems_extensions_table))) |
---|
[96e6a86c] | 969 | #else |
---|
[c3db01d0] | 970 | #define CONFIGURE_INITIAL_EXTENSION_TABLE NULL |
---|
| 971 | #define CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS 0 |
---|
[96e6a86c] | 972 | #endif |
---|
| 973 | |
---|
[0451b44] | 974 | |
---|
[08bae5e6] | 975 | #endif |
---|
| 976 | |
---|
[2eba45d] | 977 | /* |
---|
| 978 | * POSIX API Configuration Parameters |
---|
| 979 | */ |
---|
| 980 | |
---|
| 981 | #ifdef RTEMS_POSIX_API |
---|
| 982 | |
---|
[5877cc3a] | 983 | #include <sys/types.h> |
---|
| 984 | #include <signal.h> |
---|
| 985 | #include <limits.h> |
---|
| 986 | #include <mqueue.h> |
---|
| 987 | #include <rtems/posix/barrier.h> |
---|
| 988 | #include <rtems/posix/cond.h> |
---|
| 989 | #include <rtems/posix/mqueue.h> |
---|
| 990 | #include <rtems/posix/mutex.h> |
---|
| 991 | #include <rtems/posix/key.h> |
---|
| 992 | #include <rtems/posix/psignal.h> |
---|
| 993 | #include <rtems/posix/rwlock.h> |
---|
| 994 | #include <rtems/posix/semaphore.h> |
---|
| 995 | #include <rtems/posix/spinlock.h> |
---|
| 996 | #include <rtems/posix/threadsup.h> |
---|
| 997 | #include <rtems/posix/timer.h> |
---|
| 998 | |
---|
[f2a776ac] | 999 | /** |
---|
| 1000 | * Account for the object control structures plus the name |
---|
| 1001 | * of the object to be duplicated. |
---|
| 1002 | */ |
---|
| 1003 | #define _Configure_POSIX_Named_Object_RAM(_number, _size) \ |
---|
| 1004 | _Configure_Object_RAM( (_number), _size ) + \ |
---|
| 1005 | ((_number) + _Configure_From_workspace(NAME_MAX) ) |
---|
| 1006 | |
---|
[5877cc3a] | 1007 | #ifndef CONFIGURE_MAXIMUM_POSIX_THREADS |
---|
| 1008 | #define CONFIGURE_MAXIMUM_POSIX_THREADS 0 |
---|
| 1009 | #endif |
---|
[2eba45d] | 1010 | |
---|
[f2a776ac] | 1011 | #define CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API \ |
---|
[4175abd] | 1012 | _Configure_From_workspace( \ |
---|
[f2a776ac] | 1013 | sizeof (POSIX_API_Control) + \ |
---|
| 1014 | (sizeof (void *) * (CONFIGURE_MAXIMUM_POSIX_KEYS)) \ |
---|
| 1015 | ) |
---|
| 1016 | |
---|
[5877cc3a] | 1017 | #ifndef CONFIGURE_MAXIMUM_POSIX_MUTEXES |
---|
[f2a776ac] | 1018 | #define CONFIGURE_MAXIMUM_POSIX_MUTEXES 0 |
---|
| 1019 | #define CONFIGURE_MEMORY_FOR_POSIX_MUTEXES(_mutexes) 0 |
---|
| 1020 | #else |
---|
| 1021 | #define CONFIGURE_MEMORY_FOR_POSIX_MUTEXES(_mutexes) \ |
---|
| 1022 | _Configure_Object_RAM(_mutexes, sizeof(POSIX_Mutex_Control) ) |
---|
[5877cc3a] | 1023 | #endif |
---|
[2eba45d] | 1024 | |
---|
[5877cc3a] | 1025 | #ifndef CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES |
---|
[f2a776ac] | 1026 | #define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 0 |
---|
| 1027 | #define CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES(_condvars) 0 |
---|
| 1028 | #else |
---|
| 1029 | #define CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES(_condvars) \ |
---|
| 1030 | _Configure_Object_RAM(_condvars, \ |
---|
[4175abd] | 1031 | sizeof(POSIX_Condition_variables_Control) ) |
---|
[5877cc3a] | 1032 | #endif |
---|
[2eba45d] | 1033 | |
---|
[5877cc3a] | 1034 | #ifndef CONFIGURE_MAXIMUM_POSIX_KEYS |
---|
[f2a776ac] | 1035 | #define CONFIGURE_MAXIMUM_POSIX_KEYS 0 |
---|
| 1036 | #define CONFIGURE_MEMORY_FOR_POSIX_KEYS(_keys) 0 |
---|
| 1037 | #else |
---|
| 1038 | #define CONFIGURE_MEMORY_FOR_POSIX_KEYS(_keys) \ |
---|
| 1039 | _Configure_Object_RAM(_keys, sizeof(POSIX_Keys_Control) ) |
---|
[5877cc3a] | 1040 | #endif |
---|
[da33d26] | 1041 | |
---|
[5877cc3a] | 1042 | #ifndef CONFIGURE_MAXIMUM_POSIX_TIMERS |
---|
[f2a776ac] | 1043 | #define CONFIGURE_MAXIMUM_POSIX_TIMERS 0 |
---|
| 1044 | #define CONFIGURE_MEMORY_FOR_POSIX_TIMERS(_timers) 0 |
---|
| 1045 | #else |
---|
| 1046 | #define CONFIGURE_MEMORY_FOR_POSIX_TIMERS(_timers) \ |
---|
| 1047 | _Configure_Object_RAM(_timers, sizeof(POSIX_Timer_Control) ) |
---|
[5877cc3a] | 1048 | #endif |
---|
[0747e2d] | 1049 | |
---|
[5877cc3a] | 1050 | #ifndef CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS |
---|
[f2a776ac] | 1051 | #define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS 0 |
---|
| 1052 | #define CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS(_queued_signals) 0 |
---|
| 1053 | #else |
---|
| 1054 | #define CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS(_queued_signals) \ |
---|
| 1055 | _Configure_From_workspace( \ |
---|
[4175abd] | 1056 | (_queued_signals) * (sizeof(POSIX_signals_Siginfo_node)) ) |
---|
[5877cc3a] | 1057 | #endif |
---|
[eb0551f] | 1058 | |
---|
[5877cc3a] | 1059 | #ifndef CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES |
---|
[f2a776ac] | 1060 | #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES 0 |
---|
| 1061 | #define CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES(_message_queues) 0 |
---|
| 1062 | #else |
---|
| 1063 | #define CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES(_message_queues) \ |
---|
| 1064 | _Configure_POSIX_Named_Object_RAM( \ |
---|
[4175abd] | 1065 | _message_queues, sizeof(POSIX_Message_queue_Control) ) |
---|
[5877cc3a] | 1066 | #endif |
---|
[be0fc099] | 1067 | |
---|
[5877cc3a] | 1068 | #ifndef CONFIGURE_MAXIMUM_POSIX_SEMAPHORES |
---|
[f2a776ac] | 1069 | #define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES 0 |
---|
| 1070 | #define CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES(_semaphores) 0 |
---|
| 1071 | #else |
---|
| 1072 | #define CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES(_semaphores) \ |
---|
| 1073 | _Configure_POSIX_Named_Object_RAM( \ |
---|
[4175abd] | 1074 | _semaphores, sizeof(POSIX_Semaphore_Control) ) |
---|
[5877cc3a] | 1075 | #endif |
---|
[be0fc099] | 1076 | |
---|
[5877cc3a] | 1077 | #ifndef CONFIGURE_MAXIMUM_POSIX_BARRIERS |
---|
[f2a776ac] | 1078 | #define CONFIGURE_MAXIMUM_POSIX_BARRIERS 0 |
---|
| 1079 | #define CONFIGURE_MEMORY_FOR_POSIX_BARRIERS(_barriers) 0 |
---|
| 1080 | #else |
---|
| 1081 | #define CONFIGURE_MEMORY_FOR_POSIX_BARRIERS(_barriers) \ |
---|
| 1082 | _Configure_Object_RAM(_barriers, sizeof(POSIX_Barrier_Control) ) |
---|
[5877cc3a] | 1083 | #endif |
---|
[7fa1ce86] | 1084 | |
---|
[5877cc3a] | 1085 | #ifndef CONFIGURE_MAXIMUM_POSIX_SPINLOCKS |
---|
[f2a776ac] | 1086 | #define CONFIGURE_MAXIMUM_POSIX_SPINLOCKS 0 |
---|
| 1087 | #define CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS(_spinlocks) 0 |
---|
| 1088 | #else |
---|
| 1089 | #define CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS(_spinlocks) \ |
---|
| 1090 | _Configure_Object_RAM(_spinlocks, sizeof(POSIX_Spinlock_Control) ) |
---|
[5877cc3a] | 1091 | #endif |
---|
[7fa1ce86] | 1092 | |
---|
[5877cc3a] | 1093 | #ifndef CONFIGURE_MAXIMUM_POSIX_RWLOCKS |
---|
[f2a776ac] | 1094 | #define CONFIGURE_MAXIMUM_POSIX_RWLOCKS 0 |
---|
| 1095 | #define CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS(_rwlocks) 0 |
---|
| 1096 | #else |
---|
| 1097 | #define CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS(_rwlocks) \ |
---|
| 1098 | _Configure_Object_RAM(_rwlocks, sizeof(POSIX_RWLock_Control) ) |
---|
[5877cc3a] | 1099 | #endif |
---|
[7fa1ce86] | 1100 | |
---|
[5877cc3a] | 1101 | #ifdef CONFIGURE_POSIX_INIT_THREAD_TABLE |
---|
[be1c11ed] | 1102 | |
---|
[5877cc3a] | 1103 | #ifdef CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE |
---|
[5240c71c] | 1104 | |
---|
[5877cc3a] | 1105 | /* |
---|
| 1106 | * The user is defining their own table information and setting the |
---|
| 1107 | * appropriate variables for the POSIX Initialization Thread Table. |
---|
| 1108 | */ |
---|
[8486081] | 1109 | |
---|
[5877cc3a] | 1110 | #else |
---|
[be1c11ed] | 1111 | |
---|
[5877cc3a] | 1112 | #ifndef CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT |
---|
[4175abd] | 1113 | #define CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT POSIX_Init |
---|
[5877cc3a] | 1114 | #endif |
---|
[5240c71c] | 1115 | |
---|
[5877cc3a] | 1116 | #ifndef CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE |
---|
[4175abd] | 1117 | #define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE \ |
---|
[ecf0f4c] | 1118 | (CONFIGURE_MINIMUM_TASK_STACK_SIZE * 2) |
---|
[5877cc3a] | 1119 | #endif |
---|
[adbb578] | 1120 | |
---|
[5877cc3a] | 1121 | #ifdef CONFIGURE_INIT |
---|
[4175abd] | 1122 | posix_initialization_threads_table POSIX_Initialization_threads[] = { |
---|
| 1123 | { CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT, \ |
---|
| 1124 | CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE } |
---|
| 1125 | }; |
---|
[5877cc3a] | 1126 | #endif |
---|
[2eba45d] | 1127 | |
---|
[5877cc3a] | 1128 | #define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME \ |
---|
| 1129 | POSIX_Initialization_threads |
---|
[8486081] | 1130 | |
---|
[5877cc3a] | 1131 | #define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE \ |
---|
[4175abd] | 1132 | sizeof(CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME) / \ |
---|
| 1133 | sizeof(posix_initialization_threads_table) |
---|
[5240c71c] | 1134 | |
---|
[5877cc3a] | 1135 | #endif /* CONFIGURE_POSIX_HAS_OWN_INIT_TASK_TABLE */ |
---|
[5240c71c] | 1136 | |
---|
[5877cc3a] | 1137 | #else /* CONFIGURE_POSIX_INIT_THREAD_TABLE */ |
---|
[be1c11ed] | 1138 | |
---|
[5877cc3a] | 1139 | #define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME NULL |
---|
| 1140 | #define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE 0 |
---|
[be1c11ed] | 1141 | |
---|
[5877cc3a] | 1142 | #endif |
---|
[be1c11ed] | 1143 | |
---|
[5877cc3a] | 1144 | #define CONFIGURE_MEMORY_FOR_POSIX \ |
---|
[4175abd] | 1145 | ( CONFIGURE_MEMORY_FOR_POSIX_MUTEXES( CONFIGURE_MAXIMUM_POSIX_MUTEXES ) + \ |
---|
[5877cc3a] | 1146 | CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES( \ |
---|
[4175abd] | 1147 | CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES ) + \ |
---|
[5877cc3a] | 1148 | CONFIGURE_MEMORY_FOR_POSIX_KEYS( CONFIGURE_MAXIMUM_POSIX_KEYS ) + \ |
---|
| 1149 | CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS( \ |
---|
[4175abd] | 1150 | CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS ) + \ |
---|
[5877cc3a] | 1151 | CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES( \ |
---|
[4175abd] | 1152 | CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES ) + \ |
---|
[5877cc3a] | 1153 | CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES( \ |
---|
[4175abd] | 1154 | CONFIGURE_MAXIMUM_POSIX_SEMAPHORES ) + \ |
---|
[5877cc3a] | 1155 | CONFIGURE_MEMORY_FOR_POSIX_BARRIERS(CONFIGURE_MAXIMUM_POSIX_BARRIERS) + \ |
---|
| 1156 | CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS( \ |
---|
[4175abd] | 1157 | CONFIGURE_MAXIMUM_POSIX_SPINLOCKS ) + \ |
---|
[5877cc3a] | 1158 | CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS( \ |
---|
[4175abd] | 1159 | CONFIGURE_MAXIMUM_POSIX_RWLOCKS ) + \ |
---|
[5877cc3a] | 1160 | CONFIGURE_MEMORY_FOR_POSIX_TIMERS( CONFIGURE_MAXIMUM_POSIX_TIMERS ) + \ |
---|
| 1161 | (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE) \ |
---|
| 1162 | ) |
---|
| 1163 | #else |
---|
[352c9b2] | 1164 | |
---|
[5877cc3a] | 1165 | #define CONFIGURE_MAXIMUM_POSIX_THREADS 0 |
---|
| 1166 | #define CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API 0 |
---|
| 1167 | #define CONFIGURE_MEMORY_FOR_POSIX 0 |
---|
[352c9b2] | 1168 | |
---|
[5877cc3a] | 1169 | #endif /* RTEMS_POSIX_API */ |
---|
[352c9b2] | 1170 | |
---|
[5877cc3a] | 1171 | #ifndef CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE |
---|
| 1172 | #define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE 0 |
---|
[352c9b2] | 1173 | #endif |
---|
| 1174 | |
---|
[5877cc3a] | 1175 | /* |
---|
| 1176 | * This block of defines are for applications which use GNAT/RTEMS. |
---|
| 1177 | * GNAT implements each Ada task as a POSIX thread. |
---|
| 1178 | */ |
---|
| 1179 | #ifdef CONFIGURE_GNAT_RTEMS |
---|
[352c9b2] | 1180 | |
---|
[5877cc3a] | 1181 | /** |
---|
| 1182 | * The GNAT run-time needs something less than (10) POSIX mutexes. |
---|
| 1183 | * We may be able to get by with less but why bother. |
---|
| 1184 | */ |
---|
| 1185 | #define CONFIGURE_GNAT_MUTEXES 10 |
---|
[352c9b2] | 1186 | |
---|
[5877cc3a] | 1187 | /** |
---|
| 1188 | * This is the maximum number of Ada tasks which can be concurrently |
---|
| 1189 | * in existence. Twenty (20) are required to run all tests in the |
---|
| 1190 | * ACATS (formerly ACVC). |
---|
| 1191 | */ |
---|
| 1192 | #ifndef CONFIGURE_MAXIMUM_ADA_TASKS |
---|
| 1193 | #define CONFIGURE_MAXIMUM_ADA_TASKS 20 |
---|
| 1194 | #endif |
---|
[352c9b2] | 1195 | |
---|
[5877cc3a] | 1196 | /** |
---|
| 1197 | * This is the number of non-Ada tasks which invoked Ada code. |
---|
| 1198 | */ |
---|
| 1199 | #ifndef CONFIGURE_MAXIMUM_FAKE_ADA_TASKS |
---|
| 1200 | #define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0 |
---|
| 1201 | #endif |
---|
[352c9b2] | 1202 | |
---|
[5877cc3a] | 1203 | /** |
---|
| 1204 | * Ada tasks are allocated twice the minimum stack space. |
---|
| 1205 | */ |
---|
| 1206 | #define CONFIGURE_ADA_TASKS_STACK \ |
---|
[ecf0f4c] | 1207 | (CONFIGURE_MAXIMUM_ADA_TASKS * \ |
---|
| 1208 | (CONFIGURE_MINIMUM_TASK_STACK_SIZE + (6 * 1024))) |
---|
[352c9b2] | 1209 | |
---|
[5877cc3a] | 1210 | #else |
---|
| 1211 | #define CONFIGURE_GNAT_MUTEXES 0 |
---|
| 1212 | #define CONFIGURE_MAXIMUM_ADA_TASKS 0 |
---|
| 1213 | #define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0 |
---|
| 1214 | #define CONFIGURE_ADA_TASKS_STACK 0 |
---|
[352c9b2] | 1215 | #endif |
---|
| 1216 | |
---|
| 1217 | /* |
---|
[5877cc3a] | 1218 | * ITRON API Configuration Parameters |
---|
[352c9b2] | 1219 | */ |
---|
| 1220 | |
---|
[5877cc3a] | 1221 | #ifdef RTEMS_ITRON_API |
---|
[352c9b2] | 1222 | |
---|
[5877cc3a] | 1223 | #include <rtems/itron.h> |
---|
| 1224 | #include <rtems/itron/config.h> |
---|
| 1225 | #include <rtems/itron/eventflags.h> |
---|
| 1226 | #include <rtems/itron/fmempool.h> |
---|
| 1227 | #include <rtems/itron/mbox.h> |
---|
| 1228 | #include <rtems/itron/msgbuffer.h> |
---|
| 1229 | #include <rtems/itron/port.h> |
---|
| 1230 | #include <rtems/itron/semaphore.h> |
---|
| 1231 | #include <rtems/itron/task.h> |
---|
| 1232 | #include <rtems/itron/vmempool.h> |
---|
| 1233 | |
---|
| 1234 | #ifndef CONFIGURE_MAXIMUM_ITRON_TASKS |
---|
| 1235 | #define CONFIGURE_MAXIMUM_ITRON_TASKS 0 |
---|
| 1236 | #endif |
---|
[f2a776ac] | 1237 | #define CONFIGURE_MEMORY_PER_TASK_FOR_ITRON_API 0 |
---|
[352c9b2] | 1238 | |
---|
[5877cc3a] | 1239 | #ifndef CONFIGURE_MAXIMUM_ITRON_SEMAPHORES |
---|
[f2a776ac] | 1240 | #define CONFIGURE_MAXIMUM_ITRON_SEMAPHORES 0 |
---|
| 1241 | #define CONFIGURE_MEMORY_FOR_ITRON_SEMAPHORES(_semaphores) 0 |
---|
| 1242 | #else |
---|
| 1243 | #define CONFIGURE_MEMORY_FOR_ITRON_SEMAPHORES(_semaphores) \ |
---|
| 1244 | _Configure_Object_RAM(_semaphores, sizeof(ITRON_Semaphore_Control)) |
---|
[5877cc3a] | 1245 | #endif |
---|
[352c9b2] | 1246 | |
---|
[5877cc3a] | 1247 | #ifndef CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS |
---|
[f2a776ac] | 1248 | #define CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS 0 |
---|
| 1249 | #define CONFIGURE_MEMORY_FOR_ITRON_EVENTFLAGS(_eventflags) 0 |
---|
| 1250 | #else |
---|
| 1251 | #define CONFIGURE_MEMORY_FOR_ITRON_EVENTFLAGS(_eventflags) \ |
---|
| 1252 | _Configure_Object_RAM(_eventflags, sizeof(ITRON_Eventflags_Control)) |
---|
[5877cc3a] | 1253 | #endif |
---|
[352c9b2] | 1254 | |
---|
[5877cc3a] | 1255 | #ifndef CONFIGURE_MAXIMUM_ITRON_MAILBOXES |
---|
[f2a776ac] | 1256 | #define CONFIGURE_MAXIMUM_ITRON_MAILBOXES 0 |
---|
| 1257 | #define CONFIGURE_MEMORY_FOR_ITRON_MAILBOXES(_mailboxes) 0 |
---|
| 1258 | #else |
---|
| 1259 | #define CONFIGURE_MEMORY_FOR_ITRON_MAILBOXES(_mailboxes) \ |
---|
| 1260 | _Configure_Object_RAM(_mailboxes, sizeof(ITRON_Mailbox_Control)) |
---|
[5877cc3a] | 1261 | #endif |
---|
[352c9b2] | 1262 | |
---|
[5877cc3a] | 1263 | #ifndef CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS |
---|
[f2a776ac] | 1264 | #define CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS 0 |
---|
| 1265 | #define CONFIGURE_MEMORY_FOR_ITRON_MESSAGE_BUFFERS(_message_buffers) 0 |
---|
| 1266 | #else |
---|
| 1267 | #define CONFIGURE_MEMORY_FOR_ITRON_MESSAGE_BUFFERS(_message_buffers) \ |
---|
| 1268 | _Configure_Object_RAM(_message_buffers, \ |
---|
[4175abd] | 1269 | sizeof(ITRON_Message_buffer_Control)) |
---|
[5877cc3a] | 1270 | #endif |
---|
[352c9b2] | 1271 | |
---|
[5877cc3a] | 1272 | #ifndef CONFIGURE_MAXIMUM_ITRON_PORTS |
---|
[f2a776ac] | 1273 | #define CONFIGURE_MAXIMUM_ITRON_PORTS 0 |
---|
| 1274 | #define CONFIGURE_MEMORY_FOR_ITRON_PORTS(_ports) 0 |
---|
| 1275 | #else |
---|
| 1276 | #define CONFIGURE_MEMORY_FOR_ITRON_PORTS(_ports) \ |
---|
| 1277 | _Configure_Object_RAM(_ports, sizeof(ITRON_Port_Control)) |
---|
[5877cc3a] | 1278 | #endif |
---|
| 1279 | |
---|
| 1280 | #ifndef CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS |
---|
[f2a776ac] | 1281 | #define CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS 0 |
---|
| 1282 | #define CONFIGURE_MEMORY_FOR_ITRON_MEMORY_POOLS(_pools) 0 |
---|
| 1283 | #else |
---|
| 1284 | #define CONFIGURE_MEMORY_FOR_ITRON_MEMORY_POOLS(_pools) \ |
---|
| 1285 | _Configure_Object_RAM( _pools, sizeof(ITRON_Variable_memory_pool_Control)) |
---|
[5877cc3a] | 1286 | #endif |
---|
[352c9b2] | 1287 | |
---|
[5877cc3a] | 1288 | #ifndef CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS |
---|
[f2a776ac] | 1289 | #define CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS 0 |
---|
| 1290 | #define CONFIGURE_MEMORY_FOR_ITRON_FIXED_MEMORY_POOLS(_pools) 0 |
---|
| 1291 | #else |
---|
| 1292 | #define CONFIGURE_MEMORY_FOR_ITRON_FIXED_MEMORY_POOLS(_pools) \ |
---|
| 1293 | _Configure_Object_RAM(_pools, sizeof(ITRON_Fixed_memory_pool_Control)) |
---|
[5877cc3a] | 1294 | #endif |
---|
[352c9b2] | 1295 | |
---|
[5877cc3a] | 1296 | #ifdef CONFIGURE_ITRON_INIT_TASK_TABLE |
---|
[352c9b2] | 1297 | |
---|
[5877cc3a] | 1298 | #ifdef CONFIGURE_ITRON_HAS_OWN_INIT_TASK_TABLE |
---|
[352c9b2] | 1299 | |
---|
[5877cc3a] | 1300 | /* |
---|
| 1301 | * The user is defining their own table information and setting the |
---|
| 1302 | * appropriate variables for the ITRON Initialization Task Table. |
---|
| 1303 | */ |
---|
[352c9b2] | 1304 | |
---|
[5877cc3a] | 1305 | #else |
---|
[352c9b2] | 1306 | |
---|
[5877cc3a] | 1307 | #ifndef CONFIGURE_ITRON_INIT_TASK_ENTRY_POINT |
---|
[4175abd] | 1308 | #define CONFIGURE_ITRON_INIT_TASK_ENTRY_POINT ITRON_Init |
---|
[5877cc3a] | 1309 | #endif |
---|
[352c9b2] | 1310 | |
---|
[5877cc3a] | 1311 | #ifndef CONFIGURE_ITRON_INIT_TASK_ATTRIBUTES |
---|
[4175abd] | 1312 | #define CONFIGURE_ITRON_INIT_TASK_ATTRIBUTES TA_HLNG |
---|
[5877cc3a] | 1313 | #endif |
---|
[352c9b2] | 1314 | |
---|
[5877cc3a] | 1315 | #ifndef CONFIGURE_ITRON_INIT_TASK_PRIORITY |
---|
[4175abd] | 1316 | #define CONFIGURE_ITRON_INIT_TASK_PRIORITY 1 |
---|
[5877cc3a] | 1317 | #endif |
---|
[352c9b2] | 1318 | |
---|
[5877cc3a] | 1319 | #ifndef CONFIGURE_ITRON_INIT_TASK_STACK_SIZE |
---|
[4175abd] | 1320 | #define CONFIGURE_ITRON_INIT_TASK_STACK_SIZE \ |
---|
[ecf0f4c] | 1321 | CONFIGURE_MINIMUM_TASK_STACK_SIZE |
---|
[5877cc3a] | 1322 | #endif |
---|
[352c9b2] | 1323 | |
---|
[5877cc3a] | 1324 | #ifdef CONFIGURE_INIT |
---|
[4175abd] | 1325 | itron_initialization_tasks_table ITRON_Initialization_tasks[] = { |
---|
| 1326 | { 1, /* ID */ |
---|
| 1327 | { (VP) 0, /* exinfo */ |
---|
| 1328 | CONFIGURE_ITRON_INIT_TASK_ATTRIBUTES, /* task attributes */ |
---|
| 1329 | CONFIGURE_ITRON_INIT_TASK_ENTRY_POINT, /* task start address */ |
---|
| 1330 | CONFIGURE_ITRON_INIT_TASK_PRIORITY, /* initial task priority */ |
---|
| 1331 | CONFIGURE_ITRON_INIT_TASK_STACK_SIZE /* stack size */ |
---|
| 1332 | } |
---|
| 1333 | } |
---|
| 1334 | }; |
---|
[5877cc3a] | 1335 | #endif |
---|
[352c9b2] | 1336 | |
---|
[5877cc3a] | 1337 | #define CONFIGURE_ITRON_INIT_TASK_TABLE_NAME ITRON_Initialization_tasks |
---|
[352c9b2] | 1338 | |
---|
[5877cc3a] | 1339 | #define CONFIGURE_ITRON_INIT_TASK_TABLE_SIZE \ |
---|
[4175abd] | 1340 | sizeof(CONFIGURE_ITRON_INIT_TASK_TABLE_NAME) / \ |
---|
| 1341 | sizeof(itron_initialization_tasks_table) |
---|
[352c9b2] | 1342 | |
---|
[5877cc3a] | 1343 | #endif /* CONFIGURE_ITRON_HAS_OWN_INIT_TASK_TABLE */ |
---|
[352c9b2] | 1344 | |
---|
[5877cc3a] | 1345 | #else /* CONFIGURE_ITRON_INIT_TASK_TABLE */ |
---|
[352c9b2] | 1346 | |
---|
[5877cc3a] | 1347 | #define CONFIGURE_ITRON_INIT_TASK_TABLE_NAME NULL |
---|
| 1348 | #define CONFIGURE_ITRON_INIT_TASK_TABLE_SIZE 0 |
---|
| 1349 | #define CONFIGURE_ITRON_INIT_TASK_STACK_SIZE 0 |
---|
[352c9b2] | 1350 | |
---|
[5877cc3a] | 1351 | #endif |
---|
| 1352 | |
---|
| 1353 | #define CONFIGURE_MEMORY_FOR_ITRON \ |
---|
[4175abd] | 1354 | ( CONFIGURE_MEMORY_FOR_ITRON_SEMAPHORES( \ |
---|
| 1355 | CONFIGURE_MAXIMUM_ITRON_SEMAPHORES ) + \ |
---|
[5877cc3a] | 1356 | CONFIGURE_MEMORY_FOR_ITRON_EVENTFLAGS( \ |
---|
[4175abd] | 1357 | CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS ) + \ |
---|
[5877cc3a] | 1358 | CONFIGURE_MEMORY_FOR_ITRON_MAILBOXES( \ |
---|
[4175abd] | 1359 | CONFIGURE_MAXIMUM_ITRON_MAILBOXES ) + \ |
---|
[5877cc3a] | 1360 | CONFIGURE_MEMORY_FOR_ITRON_MESSAGE_BUFFERS( \ |
---|
[4175abd] | 1361 | CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS ) + \ |
---|
[5877cc3a] | 1362 | CONFIGURE_MEMORY_FOR_ITRON_PORTS( \ |
---|
[4175abd] | 1363 | CONFIGURE_MAXIMUM_ITRON_PORTS ) + \ |
---|
[5877cc3a] | 1364 | CONFIGURE_MEMORY_FOR_ITRON_MEMORY_POOLS( \ |
---|
[4175abd] | 1365 | CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS ) + \ |
---|
[5877cc3a] | 1366 | CONFIGURE_MEMORY_FOR_ITRON_FIXED_MEMORY_POOLS( \ |
---|
[4175abd] | 1367 | CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS ) + \ |
---|
[5877cc3a] | 1368 | CONFIGURE_ITRON_INIT_TASK_STACK_SIZE \ |
---|
| 1369 | ) |
---|
[352c9b2] | 1370 | |
---|
| 1371 | #else |
---|
| 1372 | |
---|
[5877cc3a] | 1373 | #define CONFIGURE_MAXIMUM_ITRON_TASKS 0 |
---|
| 1374 | #define CONFIGURE_MAXIMUM_ITRON_SEMAPHORES 0 |
---|
| 1375 | #define CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS 0 |
---|
| 1376 | #define CONFIGURE_MAXIMUM_ITRON_MAILBOXES 0 |
---|
| 1377 | #define CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS 0 |
---|
| 1378 | #define CONFIGURE_MAXIMUM_ITRON_PORTS 0 |
---|
| 1379 | #define CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS 0 |
---|
| 1380 | #define CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS 0 |
---|
| 1381 | #define CONFIGURE_MEMORY_PER_TASK_FOR_ITRON_API 0 |
---|
| 1382 | #define CONFIGURE_MEMORY_FOR_ITRON 0 |
---|
[352c9b2] | 1383 | |
---|
| 1384 | #endif /* RTEMS_ITRON_API */ |
---|
| 1385 | |
---|
[4175abd] | 1386 | /** |
---|
| 1387 | * This macro specifies the amount of memory to be reserved for the |
---|
| 1388 | * Newlib C Library reentrancy structure -- if we are using newlib. |
---|
| 1389 | */ |
---|
| 1390 | |
---|
| 1391 | #if (defined(RTEMS_NEWLIB) && !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY)) |
---|
[5877cc3a] | 1392 | #include <reent.h> |
---|
| 1393 | |
---|
[4175abd] | 1394 | #define CONFIGURE_MEMORY_PER_TASK_FOR_NEWLIB \ |
---|
| 1395 | _Configure_From_workspace(sizeof(struct _reent)) |
---|
[5877cc3a] | 1396 | #else |
---|
[4175abd] | 1397 | #define CONFIGURE_MEMORY_PER_TASK_FOR_NEWLIB 0 |
---|
[5877cc3a] | 1398 | #endif |
---|
[352c9b2] | 1399 | |
---|
[8486081] | 1400 | /* |
---|
[3652ad35] | 1401 | * Calculate the RAM size based on the maximum number of objects configured. |
---|
| 1402 | */ |
---|
[08bae5e6] | 1403 | |
---|
| 1404 | #ifndef CONFIGURE_EXECUTIVE_RAM_SIZE |
---|
[3652ad35] | 1405 | |
---|
[5877cc3a] | 1406 | /** |
---|
| 1407 | * Account for allocating the following per object |
---|
| 1408 | * + array of object control structures |
---|
| 1409 | * + local pointer table -- pointer per object plus a zero'th |
---|
| 1410 | * entry in the local pointer table. |
---|
| 1411 | */ |
---|
[b2b143f4] | 1412 | |
---|
[5877cc3a] | 1413 | #define CONFIGURE_MEMORY_FOR_TASKS(_tasks, _number_FP_tasks) \ |
---|
| 1414 | ( \ |
---|
| 1415 | _Configure_Object_RAM(_tasks, sizeof(Thread_Control)) + \ |
---|
[dee98ce] | 1416 | (_Configure_Max_Objects(_tasks) * \ |
---|
[ecf0f4c] | 1417 | (_Configure_From_workspace(CONFIGURE_MINIMUM_TASK_STACK_SIZE) + \ |
---|
[4cb19041] | 1418 | _Configure_From_workspace(CONFIGURE_MEMORY_PER_TASK_FOR_CLASSIC_API) + \ |
---|
[4175abd] | 1419 | CONFIGURE_MEMORY_PER_TASK_FOR_NEWLIB + \ |
---|
| 1420 | CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API + \ |
---|
| 1421 | CONFIGURE_MEMORY_PER_TASK_FOR_ITRON_API)) + \ |
---|
[dee98ce] | 1422 | _Configure_From_workspace( \ |
---|
| 1423 | _Configure_Max_Objects(_number_FP_tasks) * CONTEXT_FP_SIZE) \ |
---|
[5877cc3a] | 1424 | ) |
---|
[b2b143f4] | 1425 | |
---|
[5877cc3a] | 1426 | /** |
---|
[f2a776ac] | 1427 | * This defines the amount of memory configured for the multiprocessing |
---|
| 1428 | * support required by this application. |
---|
[5877cc3a] | 1429 | */ |
---|
[df49c60] | 1430 | #ifdef CONFIGURE_MP_APPLICATION |
---|
[f2a776ac] | 1431 | #define CONFIGURE_MEMORY_FOR_MP \ |
---|
| 1432 | (CONFIGURE_MEMORY_FOR_PROXIES(CONFIGURE_MP_MAXIMUM_PROXIES) + \ |
---|
| 1433 | CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS( \ |
---|
| 1434 | CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS) + \ |
---|
| 1435 | CONFIGURE_MEMORY_FOR_TASKS(1, 1) + \ |
---|
| 1436 | CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK \ |
---|
[3652ad35] | 1437 | ) |
---|
| 1438 | #else |
---|
[f2a776ac] | 1439 | #define CONFIGURE_MEMORY_FOR_MP 0 |
---|
[3652ad35] | 1440 | #endif |
---|
[3b89891] | 1441 | |
---|
[5877cc3a] | 1442 | /** |
---|
[7042065] | 1443 | * This is so we can account for tasks with stacks greater than minimum |
---|
| 1444 | * size. This is in bytes. |
---|
| 1445 | */ |
---|
[308aed9b] | 1446 | #ifndef CONFIGURE_EXTRA_TASK_STACKS |
---|
[5877cc3a] | 1447 | #define CONFIGURE_EXTRA_TASK_STACKS 0 |
---|
[308aed9b] | 1448 | #endif |
---|
| 1449 | |
---|
[5877cc3a] | 1450 | /** |
---|
| 1451 | * The following macro is used to calculate the memory allocated by RTEMS |
---|
| 1452 | * for the message buffers associated with a particular message queue. |
---|
| 1453 | * There is a fixed amount of overhead per message. |
---|
| 1454 | */ |
---|
| 1455 | #define CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(_messages, _size) \ |
---|
| 1456 | _Configure_From_workspace( \ |
---|
| 1457 | (_messages) * ((_size) + sizeof(CORE_message_queue_Buffer_control))) |
---|
| 1458 | |
---|
| 1459 | /** |
---|
| 1460 | * This macros is set to the amount of memory required for pending message |
---|
| 1461 | * buffers in bytes. It should be constructed by adding together a |
---|
| 1462 | * set of values determined by CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE. |
---|
[7042065] | 1463 | */ |
---|
| 1464 | #ifndef CONFIGURE_MESSAGE_BUFFER_MEMORY |
---|
[5877cc3a] | 1465 | #define CONFIGURE_MESSAGE_BUFFER_MEMORY 0 |
---|
[7042065] | 1466 | #endif |
---|
| 1467 | |
---|
[5877cc3a] | 1468 | /** |
---|
| 1469 | * This macro is available just in case the confdefs.h file underallocates |
---|
| 1470 | * memory for a particular application. This lets the user add some extra |
---|
| 1471 | * memory in case something broken and underestimates. |
---|
| 1472 | * |
---|
| 1473 | * It is also possible for cases where confdefs.h overallocates memory, |
---|
| 1474 | * you could substract memory from the allocated. The estimate is just |
---|
| 1475 | * that, an estimate, and assumes worst case alignment and padding on |
---|
| 1476 | * each allocated element. So in some cases it could be too conservative. |
---|
| 1477 | * |
---|
| 1478 | * @note Historically this was used for message buffers. |
---|
[7042065] | 1479 | */ |
---|
| 1480 | #ifndef CONFIGURE_MEMORY_OVERHEAD |
---|
[5877cc3a] | 1481 | #define CONFIGURE_MEMORY_OVERHEAD 0 |
---|
| 1482 | #endif |
---|
| 1483 | |
---|
| 1484 | /** |
---|
| 1485 | * On architectures that use Simple Vectored Interrupts, it is RTEMS |
---|
| 1486 | * responsibility to allocate the vector table. This avoids reserving |
---|
| 1487 | * the memory on architectures that use the Programmable Interrupt |
---|
| 1488 | * Controller Vectored Interrupts. |
---|
| 1489 | */ |
---|
| 1490 | #if (CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE) |
---|
| 1491 | /* |
---|
| 1492 | * This is a (hopefully) temporary hack. On the mips, the number of |
---|
| 1493 | * vectors is NOT statically defined. But it has to be statically |
---|
| 1494 | * defined for this to work. This is an issue looking for a nice |
---|
| 1495 | * solution. |
---|
| 1496 | */ |
---|
| 1497 | #if defined(__mips__) |
---|
[94a88c1c] | 1498 | #define CONFIGURE_INTERRUPT_VECTOR_TABLE \ |
---|
| 1499 | _Configure_From_workspace( (sizeof(ISR_Handler_entry) * 256)) |
---|
[5877cc3a] | 1500 | #else |
---|
| 1501 | #define CONFIGURE_INTERRUPT_VECTOR_TABLE \ |
---|
[94a88c1c] | 1502 | _Configure_From_workspace( \ |
---|
| 1503 | (sizeof(ISR_Handler_entry) * ISR_NUMBER_OF_VECTORS)) |
---|
[5877cc3a] | 1504 | #endif |
---|
| 1505 | #else |
---|
| 1506 | #define CONFIGURE_INTERRUPT_VECTOR_TABLE 0 |
---|
[7042065] | 1507 | #endif |
---|
| 1508 | |
---|
[5877cc3a] | 1509 | /** |
---|
| 1510 | * RTEMS uses one instance of an internal mutex class. This accounts |
---|
| 1511 | * for that mutex |
---|
| 1512 | */ |
---|
[b2b143f4] | 1513 | #define CONFIGURE_API_MUTEX_MEMORY \ |
---|
[5877cc3a] | 1514 | _Configure_Object_RAM(1, sizeof(API_Mutex_Control)) |
---|
[b2b143f4] | 1515 | |
---|
[4175abd] | 1516 | /** |
---|
| 1517 | * This defines the memory used by the thread ready chains. There is |
---|
| 1518 | * one chain per priority. |
---|
| 1519 | */ |
---|
| 1520 | #define CONFIGURE_MEMORY_FOR_THREAD_READY_CHAINS \ |
---|
| 1521 | _Configure_From_workspace( \ |
---|
| 1522 | ((CONFIGURE_MAXIMUM_PRIORITY+1) * sizeof(Chain_Control)) ) |
---|
| 1523 | /** |
---|
| 1524 | * This defines the amount of memory reserved for the IDLE task |
---|
| 1525 | * control structures and stack. |
---|
| 1526 | */ |
---|
| 1527 | #define CONFIGURE_MEMORY_FOR_IDLE_TASK \ |
---|
| 1528 | (CONFIGURE_MEMORY_FOR_TASKS(1, 0) + \ |
---|
| 1529 | (CONFIGURE_IDLE_TASK_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE)) |
---|
| 1530 | |
---|
[5877cc3a] | 1531 | /** |
---|
| 1532 | * This macro accounts for general RTEMS system overhead. |
---|
| 1533 | */ |
---|
[df49c60] | 1534 | #define CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD \ |
---|
[4175abd] | 1535 | ( CONFIGURE_MEMORY_FOR_IDLE_TASK + /* IDLE and stack */ \ |
---|
| 1536 | CONFIGURE_MEMORY_FOR_THREAD_READY_CHAINS + /* Ready chains */ \ |
---|
| 1537 | CONFIGURE_INTERRUPT_VECTOR_TABLE + /* interrupt vectors */ \ |
---|
[5877cc3a] | 1538 | CONFIGURE_INTERRUPT_STACK_MEMORY + /* interrupt stack */ \ |
---|
[4175abd] | 1539 | CONFIGURE_API_MUTEX_MEMORY /* allocation mutex */ \ |
---|
[b3dcd9a2] | 1540 | ) |
---|
| 1541 | |
---|
[399c2e5d] | 1542 | /* |
---|
| 1543 | * Now account for any extra memory that initialization tasks or threads |
---|
| 1544 | * may have requested. |
---|
| 1545 | */ |
---|
| 1546 | |
---|
[5877cc3a] | 1547 | /** |
---|
| 1548 | * This accounts for any extra memory required by the Classic API |
---|
| 1549 | * Initialization Task. |
---|
| 1550 | */ |
---|
[ecf0f4c] | 1551 | #if (CONFIGURE_INIT_TASK_STACK_SIZE > CONFIGURE_MINIMUM_TASK_STACK_SIZE) |
---|
[5877cc3a] | 1552 | #define CONFIGURE_INITIALIZATION_THREADS_STACKS_CLASSIC_PART \ |
---|
[ecf0f4c] | 1553 | (CONFIGURE_INIT_TASK_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE) |
---|
[399c2e5d] | 1554 | #else |
---|
[5877cc3a] | 1555 | #define CONFIGURE_INITIALIZATION_THREADS_STACKS_CLASSIC_PART 0 |
---|
[399c2e5d] | 1556 | #endif |
---|
[5877cc3a] | 1557 | |
---|
| 1558 | /** |
---|
| 1559 | * This accounts for any extra memory required by the POSIX API |
---|
| 1560 | * Initialization Thread. |
---|
| 1561 | */ |
---|
| 1562 | #if defined(RTEMS_POSIX_API) && \ |
---|
[ecf0f4c] | 1563 | (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE > CONFIGURE_MINIMUM_TASK_STACK_SIZE) |
---|
[5877cc3a] | 1564 | #define CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART \ |
---|
[ecf0f4c] | 1565 | (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE) |
---|
[5877cc3a] | 1566 | #else |
---|
| 1567 | #define CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART 0 |
---|
| 1568 | #endif |
---|
| 1569 | |
---|
| 1570 | /** |
---|
| 1571 | * This accounts for any extra memory required by the ITRON API |
---|
| 1572 | * Initialization Task. |
---|
| 1573 | */ |
---|
| 1574 | #if defined(RTEMS_ITRON_API) && \ |
---|
[ecf0f4c] | 1575 | (CONFIGURE_ITRON_INIT_TASK_STACK_SIZE > CONFIGURE_MINIMUM_TASK_STACK_SIZE) |
---|
[5877cc3a] | 1576 | #define CONFIGURE_INITIALIZATION_THREADS_STACKS_ITRON_PART \ |
---|
[ecf0f4c] | 1577 | (CONFIGURE_ITRON_INIT_TASK_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE) |
---|
[399c2e5d] | 1578 | #else |
---|
[5877cc3a] | 1579 | #define CONFIGURE_INITIALIZATION_THREADS_STACKS_ITRON_PART 0 |
---|
[399c2e5d] | 1580 | #endif |
---|
| 1581 | |
---|
[5877cc3a] | 1582 | /** |
---|
| 1583 | * This macro provides a summation of the various initialization task |
---|
| 1584 | * and thread stack requirements. |
---|
| 1585 | */ |
---|
[563ed95] | 1586 | #define CONFIGURE_INITIALIZATION_THREADS_STACKS \ |
---|
[5877cc3a] | 1587 | (CONFIGURE_INITIALIZATION_THREADS_STACKS_CLASSIC_PART + \ |
---|
[399c2e5d] | 1588 | CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART + \ |
---|
| 1589 | CONFIGURE_INITIALIZATION_THREADS_STACKS_ITRON_PART) |
---|
[563ed95] | 1590 | |
---|
[5877cc3a] | 1591 | /** |
---|
| 1592 | * This macro provides a summation of the various task and thread |
---|
| 1593 | * requirements. |
---|
[7c5e3b3] | 1594 | */ |
---|
[5877cc3a] | 1595 | #define CONFIGURE_TOTAL_TASKS_AND_THREADS \ |
---|
| 1596 | (CONFIGURE_MAXIMUM_TASKS + \ |
---|
| 1597 | CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_ADA_TASKS + \ |
---|
| 1598 | CONFIGURE_MAXIMUM_ITRON_TASKS \ |
---|
| 1599 | ) |
---|
| 1600 | |
---|
| 1601 | /** |
---|
| 1602 | * This macro reserves the memory required by the statically configured |
---|
| 1603 | * user extensions. |
---|
| 1604 | */ |
---|
| 1605 | #define CONFIGURE_MEMORY_FOR_STATIC_EXTENSIONS \ |
---|
[94a88c1c] | 1606 | ((CONFIGURE_NEWLIB_EXTENSION * \ |
---|
| 1607 | _Configure_From_workspace( sizeof(User_extensions_Control))) + \ |
---|
| 1608 | (CONFIGURE_STACK_CHECKER_EXTENSION * \ |
---|
| 1609 | _Configure_From_workspace( sizeof(User_extensions_Control))) \ |
---|
| 1610 | ) |
---|
[5877cc3a] | 1611 | |
---|
| 1612 | /** |
---|
| 1613 | * This macro provides a summation of the memory required by the |
---|
| 1614 | * Classic API as configured. |
---|
| 1615 | */ |
---|
| 1616 | #define CONFIGURE_MEMORY_FOR_CLASSIC \ |
---|
| 1617 | (CONFIGURE_MEMORY_FOR_TASK_VARIABLES(CONFIGURE_MAXIMUM_TASK_VARIABLES) + \ |
---|
[f0f450a] | 1618 | CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS + \ |
---|
| 1619 | CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER ) + \ |
---|
[bd9c3d1] | 1620 | CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_MAXIMUM_SEMAPHORES + \ |
---|
[df49c60] | 1621 | CONFIGURE_LIBIO_SEMAPHORES + CONFIGURE_TERMIOS_SEMAPHORES) + \ |
---|
[3652ad35] | 1622 | CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(CONFIGURE_MAXIMUM_MESSAGE_QUEUES) + \ |
---|
| 1623 | CONFIGURE_MEMORY_FOR_PARTITIONS(CONFIGURE_MAXIMUM_PARTITIONS) + \ |
---|
[e746a88] | 1624 | CONFIGURE_MEMORY_FOR_REGIONS( CONFIGURE_MAXIMUM_REGIONS ) + \ |
---|
[3652ad35] | 1625 | CONFIGURE_MEMORY_FOR_PORTS(CONFIGURE_MAXIMUM_PORTS) + \ |
---|
| 1626 | CONFIGURE_MEMORY_FOR_PERIODS(CONFIGURE_MAXIMUM_PERIODS) + \ |
---|
[7fa1ce86] | 1627 | CONFIGURE_MEMORY_FOR_BARRIERS(CONFIGURE_MAXIMUM_BARRIERS) + \ |
---|
[5877cc3a] | 1628 | CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(CONFIGURE_MAXIMUM_USER_EXTENSIONS) \ |
---|
| 1629 | ) |
---|
| 1630 | |
---|
[4175abd] | 1631 | #if defined(CONFIGURE_CONFDEFS_DEBUG) && defined(CONFIGURE_INIT) |
---|
[5877cc3a] | 1632 | /** |
---|
| 1633 | * This is a debug mechanism, so if you need to, the executable will |
---|
| 1634 | * have a structure with various partial values. Add to this as you |
---|
| 1635 | * need to. Viewing this structure in gdb combined with dumping |
---|
| 1636 | * the Configuration structures generated should help a lot in tracing |
---|
| 1637 | * down errors and analyzing where over and under allocations are. |
---|
| 1638 | */ |
---|
| 1639 | typedef struct { |
---|
[4175abd] | 1640 | uint32_t SYSTEM_OVERHEAD; |
---|
| 1641 | uint32_t STATIC_EXTENSIONS; |
---|
| 1642 | uint32_t INITIALIZATION_THREADS_STACKS; |
---|
| 1643 | |
---|
[dad723f4] | 1644 | uint32_t PER_INTEGER_TASK; |
---|
| 1645 | uint32_t FP_OVERHEAD; |
---|
[4175abd] | 1646 | uint32_t CLASSIC; |
---|
[5877cc3a] | 1647 | uint32_t POSIX; |
---|
[4175abd] | 1648 | uint32_t ITRON; |
---|
| 1649 | |
---|
| 1650 | /* System overhead pieces */ |
---|
| 1651 | uint32_t INTERRUPT_VECTOR_TABLE; |
---|
| 1652 | uint32_t INTERRUPT_STACK_MEMORY; |
---|
| 1653 | uint32_t THREAD_READY_CHAINS; |
---|
| 1654 | uint32_t MEMORY_FOR_IDLE_TASK; |
---|
| 1655 | |
---|
| 1656 | /* Classic API Pieces */ |
---|
[dee98ce] | 1657 | uint32_t CLASSIC_TASKS; |
---|
[4175abd] | 1658 | uint32_t TASK_VARIABLES; |
---|
| 1659 | uint32_t TIMERS; |
---|
| 1660 | uint32_t SEMAPHORES; |
---|
| 1661 | uint32_t MESSAGE_QUEUES; |
---|
| 1662 | uint32_t PARTITIONS; |
---|
| 1663 | uint32_t REGIONS; |
---|
| 1664 | uint32_t PORTS; |
---|
| 1665 | uint32_t PERIODS; |
---|
| 1666 | uint32_t BARRIERS; |
---|
| 1667 | uint32_t USER_EXTENSIONS; |
---|
| 1668 | #ifdef RTEMS_POSIX_API |
---|
| 1669 | /* POSIX API Pieces */ |
---|
| 1670 | uint32_t POSIX_MUTEXES; |
---|
| 1671 | uint32_t POSIX_CONDITION_VARIABLES; |
---|
| 1672 | uint32_t POSIX_KEYS; |
---|
| 1673 | uint32_t POSIX_TIMERS; |
---|
| 1674 | uint32_t POSIX_QUEUED_SIGNALS; |
---|
| 1675 | uint32_t POSIX_MESSAGE_QUEUES; |
---|
| 1676 | uint32_t POSIX_SEMAPHORES; |
---|
| 1677 | uint32_t POSIX_BARRIERS; |
---|
| 1678 | uint32_t POSIX_SPINLOCKS; |
---|
| 1679 | uint32_t POSIX_RWLOCKS; |
---|
| 1680 | #endif |
---|
| 1681 | #ifdef RTEMS_ITRON_API |
---|
| 1682 | /* ITRON API Pieces */ |
---|
| 1683 | uint32_t ITRON_SEMAPHORES; |
---|
| 1684 | uint32_t ITRON_EVENTFLAGS; |
---|
| 1685 | uint32_t ITRON_MAILBOXES; |
---|
| 1686 | uint32_t ITRON_MESSAGE_BUFFERS; |
---|
| 1687 | uint32_t ITRON_PORTS; |
---|
| 1688 | uint32_t ITRON_MEMORY_POOLS; |
---|
| 1689 | uint32_t ITRON_FIXED_MEMORY_POOLS; |
---|
| 1690 | #endif |
---|
[5877cc3a] | 1691 | } Configuration_Debug_t; |
---|
| 1692 | |
---|
| 1693 | Configuration_Debug_t Configuration_Memory_Debug = { |
---|
[4175abd] | 1694 | /* General Information */ |
---|
| 1695 | CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD, |
---|
| 1696 | CONFIGURE_MEMORY_FOR_STATIC_EXTENSIONS, |
---|
| 1697 | CONFIGURE_INITIALIZATION_THREADS_STACKS, |
---|
[dad723f4] | 1698 | CONFIGURE_MEMORY_FOR_TASKS(1, 0), |
---|
| 1699 | CONFIGURE_MEMORY_FOR_TASKS(0, 1), |
---|
[4175abd] | 1700 | CONFIGURE_MEMORY_FOR_CLASSIC, |
---|
| 1701 | CONFIGURE_MEMORY_FOR_POSIX, |
---|
| 1702 | CONFIGURE_MEMORY_FOR_ITRON, |
---|
| 1703 | |
---|
| 1704 | /* System overhead pieces */ |
---|
| 1705 | CONFIGURE_INTERRUPT_VECTOR_TABLE, |
---|
| 1706 | CONFIGURE_INTERRUPT_STACK_MEMORY, |
---|
| 1707 | CONFIGURE_MEMORY_FOR_THREAD_READY_CHAINS, |
---|
| 1708 | CONFIGURE_MEMORY_FOR_IDLE_TASK, |
---|
| 1709 | |
---|
| 1710 | /* Classic API Pieces */ |
---|
[dee98ce] | 1711 | CONFIGURE_MEMORY_FOR_TASKS(CONFIGURE_MAXIMUM_TASKS, 0), |
---|
[4175abd] | 1712 | CONFIGURE_MEMORY_FOR_TASK_VARIABLES(CONFIGURE_MAXIMUM_TASK_VARIABLES), |
---|
| 1713 | CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS), |
---|
| 1714 | CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_MAXIMUM_SEMAPHORES + |
---|
| 1715 | CONFIGURE_LIBIO_SEMAPHORES + CONFIGURE_TERMIOS_SEMAPHORES), |
---|
| 1716 | CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(CONFIGURE_MAXIMUM_MESSAGE_QUEUES), |
---|
| 1717 | CONFIGURE_MEMORY_FOR_PARTITIONS(CONFIGURE_MAXIMUM_PARTITIONS), |
---|
| 1718 | CONFIGURE_MEMORY_FOR_REGIONS( CONFIGURE_MAXIMUM_REGIONS ), |
---|
| 1719 | CONFIGURE_MEMORY_FOR_PORTS(CONFIGURE_MAXIMUM_PORTS), |
---|
| 1720 | CONFIGURE_MEMORY_FOR_PERIODS(CONFIGURE_MAXIMUM_PERIODS), |
---|
| 1721 | CONFIGURE_MEMORY_FOR_BARRIERS(CONFIGURE_MAXIMUM_BARRIERS), |
---|
| 1722 | CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(CONFIGURE_MAXIMUM_USER_EXTENSIONS), |
---|
| 1723 | |
---|
| 1724 | #ifdef RTEMS_POSIX_API |
---|
| 1725 | /* POSIX API Pieces */ |
---|
| 1726 | CONFIGURE_MEMORY_FOR_POSIX_MUTEXES( CONFIGURE_MAXIMUM_POSIX_MUTEXES ), |
---|
| 1727 | CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES( |
---|
| 1728 | CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES ), |
---|
| 1729 | CONFIGURE_MEMORY_FOR_POSIX_KEYS( CONFIGURE_MAXIMUM_POSIX_KEYS ), |
---|
| 1730 | CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS( |
---|
| 1731 | CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS ), |
---|
| 1732 | CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES( |
---|
| 1733 | CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES ), |
---|
| 1734 | CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES( CONFIGURE_MAXIMUM_POSIX_SEMAPHORES ), |
---|
| 1735 | CONFIGURE_MEMORY_FOR_POSIX_BARRIERS( CONFIGURE_MAXIMUM_POSIX_BARRIERS ), |
---|
| 1736 | CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS( CONFIGURE_MAXIMUM_POSIX_SPINLOCKS ), |
---|
| 1737 | CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS( CONFIGURE_MAXIMUM_POSIX_RWLOCKS ), |
---|
| 1738 | CONFIGURE_MEMORY_FOR_POSIX_TIMERS( CONFIGURE_MAXIMUM_POSIX_TIMERS ), |
---|
| 1739 | #endif |
---|
| 1740 | |
---|
| 1741 | #ifdef RTEMS_ITRON_API |
---|
| 1742 | /* ITRON API Pieces */ |
---|
| 1743 | CONFIGURE_MEMORY_FOR_ITRON_SEMAPHORES( CONFIGURE_MAXIMUM_ITRON_SEMAPHORES ), |
---|
| 1744 | CONFIGURE_MEMORY_FOR_ITRON_EVENTFLAGS( CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS ), |
---|
| 1745 | CONFIGURE_MEMORY_FOR_ITRON_MAILBOXES( CONFIGURE_MAXIMUM_ITRON_MAILBOXES ), |
---|
| 1746 | CONFIGURE_MEMORY_FOR_ITRON_MESSAGE_BUFFERS( |
---|
| 1747 | CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS ), |
---|
| 1748 | CONFIGURE_MEMORY_FOR_ITRON_PORTS( CONFIGURE_MAXIMUM_ITRON_PORTS ), |
---|
| 1749 | CONFIGURE_MEMORY_FOR_ITRON_MEMORY_POOLS( |
---|
| 1750 | CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS ), |
---|
| 1751 | CONFIGURE_MEMORY_FOR_ITRON_FIXED_MEMORY_POOLS( |
---|
| 1752 | CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS ), |
---|
| 1753 | #endif |
---|
[5877cc3a] | 1754 | }; |
---|
| 1755 | #endif |
---|
| 1756 | |
---|
| 1757 | /** |
---|
| 1758 | * This calculates the memory required for the executive workspace. |
---|
| 1759 | */ |
---|
| 1760 | #define CONFIGURE_EXECUTIVE_RAM_SIZE \ |
---|
| 1761 | (( \ |
---|
[df49c60] | 1762 | CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD + \ |
---|
[d40da79b] | 1763 | CONFIGURE_MEMORY_FOR_DEVFS + \ |
---|
[5877cc3a] | 1764 | CONFIGURE_MEMORY_FOR_TASKS( \ |
---|
| 1765 | CONFIGURE_TOTAL_TASKS_AND_THREADS, CONFIGURE_TOTAL_TASKS_AND_THREADS) + \ |
---|
| 1766 | CONFIGURE_MEMORY_FOR_CLASSIC + \ |
---|
| 1767 | CONFIGURE_MEMORY_FOR_POSIX + \ |
---|
[ecf0f4c] | 1768 | (CONFIGURE_MAXIMUM_POSIX_THREADS * CONFIGURE_MINIMUM_TASK_STACK_SIZE ) + \ |
---|
[5877cc3a] | 1769 | CONFIGURE_MEMORY_FOR_ITRON + \ |
---|
| 1770 | CONFIGURE_INITIALIZATION_THREADS_STACKS + \ |
---|
| 1771 | CONFIGURE_MEMORY_FOR_STATIC_EXTENSIONS + \ |
---|
| 1772 | CONFIGURE_MEMORY_FOR_MP + \ |
---|
[7042065] | 1773 | CONFIGURE_MESSAGE_BUFFER_MEMORY + \ |
---|
| 1774 | (CONFIGURE_MEMORY_OVERHEAD * 1024) + \ |
---|
[bac7b61] | 1775 | (CONFIGURE_EXTRA_TASK_STACKS) + (CONFIGURE_ADA_TASKS_STACK) \ |
---|
[7042065] | 1776 | ) & ~0x7) |
---|
[08bae5e6] | 1777 | #endif |
---|
| 1778 | |
---|
| 1779 | #ifdef CONFIGURE_INIT |
---|
[5877cc3a] | 1780 | /** |
---|
| 1781 | * This is the Classic API Configuration Table. |
---|
| 1782 | */ |
---|
| 1783 | rtems_api_configuration_table Configuration_RTEMS_API = { |
---|
| 1784 | CONFIGURE_MAXIMUM_TASKS, |
---|
[4cb19041] | 1785 | CONFIGURE_NOTEPADS_ENABLED, |
---|
[f0f450a] | 1786 | CONFIGURE_MAXIMUM_TIMERS + CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER, |
---|
[5877cc3a] | 1787 | CONFIGURE_MAXIMUM_SEMAPHORES + CONFIGURE_LIBIO_SEMAPHORES + |
---|
| 1788 | CONFIGURE_TERMIOS_SEMAPHORES, |
---|
| 1789 | CONFIGURE_MAXIMUM_MESSAGE_QUEUES, |
---|
| 1790 | CONFIGURE_MAXIMUM_PARTITIONS, |
---|
| 1791 | CONFIGURE_MAXIMUM_REGIONS, |
---|
| 1792 | CONFIGURE_MAXIMUM_PORTS, |
---|
| 1793 | CONFIGURE_MAXIMUM_PERIODS, |
---|
| 1794 | CONFIGURE_MAXIMUM_BARRIERS, |
---|
| 1795 | CONFIGURE_INIT_TASK_TABLE_SIZE, |
---|
| 1796 | CONFIGURE_INIT_TASK_TABLE |
---|
| 1797 | }; |
---|
[e6d4b1d] | 1798 | |
---|
[5877cc3a] | 1799 | #ifdef RTEMS_POSIX_API |
---|
| 1800 | /** |
---|
| 1801 | * This is the POSIX API Configuration Table. |
---|
| 1802 | */ |
---|
| 1803 | posix_api_configuration_table Configuration_POSIX_API = { |
---|
| 1804 | CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_ADA_TASKS, |
---|
| 1805 | CONFIGURE_MAXIMUM_POSIX_MUTEXES + CONFIGURE_GNAT_MUTEXES + |
---|
[4175abd] | 1806 | CONFIGURE_MAXIMUM_ADA_TASKS + CONFIGURE_MAXIMUM_FAKE_ADA_TASKS, |
---|
[5877cc3a] | 1807 | CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES + |
---|
[4175abd] | 1808 | CONFIGURE_MAXIMUM_ADA_TASKS + CONFIGURE_MAXIMUM_FAKE_ADA_TASKS, |
---|
[5877cc3a] | 1809 | CONFIGURE_MAXIMUM_POSIX_KEYS, |
---|
| 1810 | CONFIGURE_MAXIMUM_POSIX_TIMERS, |
---|
| 1811 | CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS, |
---|
| 1812 | CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES, |
---|
| 1813 | CONFIGURE_MAXIMUM_POSIX_SEMAPHORES, |
---|
| 1814 | CONFIGURE_MAXIMUM_POSIX_BARRIERS, |
---|
| 1815 | CONFIGURE_MAXIMUM_POSIX_RWLOCKS, |
---|
| 1816 | CONFIGURE_MAXIMUM_POSIX_SPINLOCKS, |
---|
| 1817 | CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE, |
---|
| 1818 | CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME |
---|
| 1819 | }; |
---|
| 1820 | #endif |
---|
[2eba45d] | 1821 | |
---|
[5877cc3a] | 1822 | #ifdef RTEMS_ITRON_API |
---|
| 1823 | /** |
---|
| 1824 | * This is the ITRON API Configuration Table. |
---|
| 1825 | */ |
---|
| 1826 | itron_api_configuration_table Configuration_ITRON_API = { |
---|
| 1827 | CONFIGURE_MAXIMUM_ITRON_TASKS, |
---|
| 1828 | CONFIGURE_MAXIMUM_ITRON_SEMAPHORES, |
---|
| 1829 | CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS, |
---|
| 1830 | CONFIGURE_MAXIMUM_ITRON_MAILBOXES, |
---|
| 1831 | CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS, |
---|
| 1832 | CONFIGURE_MAXIMUM_ITRON_PORTS, |
---|
| 1833 | CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS, |
---|
| 1834 | CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS, |
---|
| 1835 | CONFIGURE_ITRON_INIT_TASK_TABLE_SIZE, |
---|
| 1836 | CONFIGURE_ITRON_INIT_TASK_TABLE_NAME |
---|
| 1837 | }; |
---|
| 1838 | #endif |
---|
[352c9b2] | 1839 | |
---|
[ecf0f4c] | 1840 | /** This variable specifies the minimum stack size for tasks in an RTEMS |
---|
| 1841 | * application. |
---|
| 1842 | * |
---|
| 1843 | * @note This is left as a simple uint32_t so it can be externed as |
---|
| 1844 | * needed without requring being high enough logical to |
---|
| 1845 | * include the full configuration table. |
---|
| 1846 | */ |
---|
| 1847 | uint32_t rtems_minimum_stack_size = |
---|
| 1848 | CONFIGURE_MINIMUM_TASK_STACK_SIZE; |
---|
| 1849 | |
---|
[80f9d77] | 1850 | /** This variable specifies the maximum priority value that |
---|
| 1851 | * a task may have. This must be a power of 2 between 4 |
---|
| 1852 | * and 256 and is specified in terms of Classic API |
---|
| 1853 | * priority values. |
---|
| 1854 | * |
---|
| 1855 | * @note This is left as a simple uint8_t so it can be externed as |
---|
| 1856 | * needed without requring being high enough logical to |
---|
| 1857 | * include the full configuration table. |
---|
| 1858 | */ |
---|
| 1859 | uint8_t rtems_maximum_priority = CONFIGURE_MAXIMUM_PRIORITY; |
---|
| 1860 | |
---|
[5877cc3a] | 1861 | /** |
---|
| 1862 | * This is the primary Configuration Table for this application. |
---|
| 1863 | */ |
---|
| 1864 | rtems_configuration_table Configuration = { |
---|
[aac75d3b] | 1865 | NULL, /* filled in by BSP */ |
---|
[5877cc3a] | 1866 | CONFIGURE_EXECUTIVE_RAM_SIZE, /* required RTEMS workspace */ |
---|
| 1867 | CONFIGURE_MAXIMUM_USER_EXTENSIONS, /* maximum dynamic extensions */ |
---|
| 1868 | CONFIGURE_MICROSECONDS_PER_TICK, /* microseconds per clock tick */ |
---|
| 1869 | CONFIGURE_TICKS_PER_TIMESLICE, /* ticks per timeslice quantum */ |
---|
| 1870 | CONFIGURE_IDLE_TASK_BODY, /* user's IDLE task */ |
---|
| 1871 | CONFIGURE_IDLE_TASK_STACK_SIZE, /* IDLE task stack size */ |
---|
| 1872 | CONFIGURE_INTERRUPT_STACK_SIZE, /* interrupt stack size */ |
---|
| 1873 | CONFIGURE_TASK_STACK_ALLOCATOR, /* stack allocator */ |
---|
| 1874 | CONFIGURE_TASK_STACK_DEALLOCATOR, /* stack deallocator */ |
---|
| 1875 | CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY, /* true to clear memory */ |
---|
| 1876 | CONFIGURE_MAXIMUM_DRIVERS, /* maximum device drivers */ |
---|
| 1877 | CONFIGURE_NUMBER_OF_DRIVERS, /* static device drivers */ |
---|
| 1878 | Device_drivers, /* pointer to driver table */ |
---|
| 1879 | CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS, /* number of static extensions */ |
---|
| 1880 | CONFIGURE_INITIAL_EXTENSION_TABLE, /* pointer to static extensions */ |
---|
| 1881 | #if defined(RTEMS_MULTIPROCESSING) |
---|
| 1882 | CONFIGURE_MULTIPROCESSING_TABLE, /* pointer to MP config table */ |
---|
| 1883 | #endif |
---|
| 1884 | }; |
---|
[08bae5e6] | 1885 | #endif |
---|
| 1886 | |
---|
| 1887 | #endif /* CONFIGURE_HAS_OWN_CONFIGURATION_TABLE */ |
---|
| 1888 | |
---|
[0ab34c90] | 1889 | /* |
---|
| 1890 | * If the user has configured a set of Classic API Initialization Tasks, |
---|
| 1891 | * then we need to install the code that runs that loop. |
---|
| 1892 | */ |
---|
| 1893 | #ifdef CONFIGURE_INIT |
---|
| 1894 | #ifdef CONFIGURE_RTEMS_INIT_TASKS_TABLE |
---|
| 1895 | void (_RTEMS_tasks_Initialize_user_tasks_body)(void); |
---|
| 1896 | void (*_RTEMS_tasks_Initialize_user_tasks_p)(void) = |
---|
| 1897 | _RTEMS_tasks_Initialize_user_tasks_body; |
---|
| 1898 | #else |
---|
| 1899 | void (*_RTEMS_tasks_Initialize_user_tasks_p)(void) = NULL; |
---|
| 1900 | #endif |
---|
| 1901 | #endif |
---|
| 1902 | |
---|
| 1903 | /* |
---|
| 1904 | * If the user has configured a set of POSIX Initialization Threads, |
---|
| 1905 | * then we need to install the code that runs that loop. |
---|
| 1906 | */ |
---|
[5a8bc44] | 1907 | #ifdef RTEMS_POSIX_API |
---|
| 1908 | #ifdef CONFIGURE_INIT |
---|
| 1909 | #ifdef CONFIGURE_POSIX_INIT_THREAD_TABLE |
---|
| 1910 | void _POSIX_Threads_Initialize_user_threads_body(void); |
---|
| 1911 | void (*_POSIX_Threads_Initialize_user_threads_p)(void) = |
---|
[4175abd] | 1912 | _POSIX_Threads_Initialize_user_threads_body; |
---|
[5a8bc44] | 1913 | #else |
---|
| 1914 | void (*_POSIX_Threads_Initialize_user_threads_p)(void) = NULL; |
---|
| 1915 | #endif |
---|
[0ab34c90] | 1916 | #endif |
---|
| 1917 | #endif |
---|
| 1918 | |
---|
| 1919 | /* |
---|
| 1920 | * If the user has configured a set of ITRON Initialization Tasks, |
---|
| 1921 | * then we need to install the code that runs that loop. |
---|
| 1922 | */ |
---|
[5a8bc44] | 1923 | #ifdef RTEMS_ITRON_API |
---|
| 1924 | #ifdef CONFIGURE_INIT |
---|
| 1925 | #ifdef CONFIGURE_ITRON_INIT_TASK_TABLE |
---|
| 1926 | void _ITRON_Task_Initialize_user_tasks_body(void); |
---|
| 1927 | void (*_ITRON_Initialize_user_tasks_p)(void) = |
---|
[4175abd] | 1928 | _ITRON_Task_Initialize_user_tasks_body; |
---|
[5a8bc44] | 1929 | #else |
---|
| 1930 | void (*_ITRON_Initialize_user_tasks_p)(void) = NULL; |
---|
| 1931 | #endif |
---|
[0ab34c90] | 1932 | #endif |
---|
| 1933 | #endif |
---|
| 1934 | |
---|
[08bae5e6] | 1935 | #ifdef __cplusplus |
---|
| 1936 | } |
---|
| 1937 | #endif |
---|
[8486081] | 1938 | |
---|
[df0bfdf] | 1939 | /****************************************************************** |
---|
| 1940 | ****************************************************************** |
---|
| 1941 | ****************************************************************** |
---|
| 1942 | * CONFIGURATION WARNINGS AND ERROR CHECKING * |
---|
| 1943 | ****************************************************************** |
---|
| 1944 | ****************************************************************** |
---|
| 1945 | ****************************************************************** |
---|
[df49c60] | 1946 | */ |
---|
| 1947 | |
---|
| 1948 | /* |
---|
[80f9d77] | 1949 | * Make sure a task/thread of some sort is configured. |
---|
| 1950 | * |
---|
| 1951 | * When analyzing RTEMS to find the smallest possible of memory |
---|
| 1952 | * that must be allocated, you probably do want to configure 0 |
---|
| 1953 | * tasks/threads so there is a smaller set of calls to _Workspace_Allocate |
---|
| 1954 | * to analyze. |
---|
| 1955 | */ |
---|
| 1956 | #if !defined(CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION) |
---|
| 1957 | #if (CONFIGURE_MAXIMUM_TASKS == 0) && \ |
---|
| 1958 | (CONFIGURE_MAXIMUM_POSIX_THREADS == 0) && \ |
---|
| 1959 | (CONFIGURE_MAXIMUM_ADA_TASKS == 0) && \ |
---|
| 1960 | (CONFIGURE_MAXIMUM_ITRON_TASKS == 0) |
---|
| 1961 | #error "CONFIGURATION ERROR: No tasks or threads configured!!" |
---|
| 1962 | #endif |
---|
[df49c60] | 1963 | #endif |
---|
| 1964 | |
---|
| 1965 | /* |
---|
| 1966 | * Make sure at least one of the initialization task/thread |
---|
| 1967 | * tables was defined. |
---|
| 1968 | */ |
---|
| 1969 | #if !defined(CONFIGURE_RTEMS_INIT_TASKS_TABLE) && \ |
---|
| 1970 | !defined(CONFIGURE_POSIX_INIT_THREAD_TABLE) && \ |
---|
[80f9d77] | 1971 | !defined(CONFIGURE_ITRON_INIT_TASK_TABLE) && \ |
---|
| 1972 | !defined(CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION) |
---|
[168ba07] | 1973 | #error "CONFIGURATION ERROR: No initialization tasks or threads configured!!" |
---|
[df49c60] | 1974 | #endif |
---|
| 1975 | |
---|
[df0bfdf] | 1976 | /* |
---|
| 1977 | * If the user is trying to configure a multiprocessing application and |
---|
| 1978 | * RTEMS was not configured and built multiprocessing, then error out. |
---|
| 1979 | */ |
---|
| 1980 | #if defined(CONFIGURE_MP_APPLICATION) && \ |
---|
| 1981 | !defined(RTEMS_MULTIPROCESSING) |
---|
| 1982 | #error "CONFIGURATION ERROR: RTEMS not configured for multiprocessing!!" |
---|
| 1983 | #endif |
---|
| 1984 | |
---|
| 1985 | /* |
---|
| 1986 | * If an attempt was made to configure POSIX objects and |
---|
| 1987 | * the POSIX API was not configured into RTEMS, error out. |
---|
| 1988 | */ |
---|
| 1989 | #if !defined(RTEMS_POSIX_API) |
---|
| 1990 | #if ((CONFIGURE_MAXIMUM_POSIX_THREADS != 0) || \ |
---|
| 1991 | (CONFIGURE_MAXIMUM_POSIX_MUTEXES != 0) || \ |
---|
| 1992 | (CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES != 0) || \ |
---|
| 1993 | (CONFIGURE_MAXIMUM_POSIX_KEYS != 0) || \ |
---|
| 1994 | (CONFIGURE_MAXIMUM_POSIX_TIMERS != 0) || \ |
---|
| 1995 | (CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS != 0) || \ |
---|
| 1996 | (CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES != 0) || \ |
---|
| 1997 | (CONFIGURE_MAXIMUM_POSIX_SEMAPHORES != 0) || \ |
---|
| 1998 | (CONFIGURE_MAXIMUM_POSIX_BARRIERS != 0) || \ |
---|
| 1999 | (CONFIGURE_MAXIMUM_POSIX_SPINLOCKS != 0) || \ |
---|
| 2000 | (CONFIGURE_MAXIMUM_POSIX_RWLOCKS != 0) || \ |
---|
[98e92b0a] | 2001 | defined(CONFIGURE_POSIX_INIT_THREAD_TABLE)) |
---|
[df0bfdf] | 2002 | #error "CONFIGURATION ERROR: POSIX API support not configured!!" |
---|
| 2003 | #endif |
---|
| 2004 | #endif |
---|
| 2005 | |
---|
| 2006 | /* |
---|
| 2007 | * If an attempt was made to configure ITRON objects and |
---|
| 2008 | * the ITRON API was not configured into RTEMS, error out. |
---|
| 2009 | */ |
---|
| 2010 | #if !defined(RTEMS_ITRON_API) |
---|
| 2011 | #if ((CONFIGURE_MAXIMUM_ITRON_TASKS != 0) || \ |
---|
| 2012 | (CONFIGURE_MAXIMUM_ITRON_SEMAPHORES != 0) || \ |
---|
| 2013 | (CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS != 0) || \ |
---|
| 2014 | (CONFIGURE_MAXIMUM_ITRON_MAILBOXES != 0) || \ |
---|
| 2015 | (CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS != 0) || \ |
---|
| 2016 | (CONFIGURE_MAXIMUM_ITRON_PORTS != 0) || \ |
---|
| 2017 | (CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS != 0) || \ |
---|
[98e92b0a] | 2018 | (CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS != 0) || \ |
---|
| 2019 | defined(CONFIGURE_ITRON_INIT_TASK_TABLE)) |
---|
[df0bfdf] | 2020 | #error "CONFIGURATION ERROR: ITRON API support not configured!!" |
---|
| 2021 | #endif |
---|
| 2022 | #endif |
---|
| 2023 | |
---|
| 2024 | /* |
---|
| 2025 | * You must either explicity include or exclude the clock driver. |
---|
| 2026 | * It is such a common newbie error to leave it out. Maybe this |
---|
| 2027 | * will put an end to it. |
---|
| 2028 | * |
---|
| 2029 | * NOTE: If you are using the timer driver, it is considered |
---|
[76deaf0c] | 2030 | * mutually exclusive with the clock driver because the |
---|
| 2031 | * drivers are assumed to use the same "timer" hardware |
---|
| 2032 | * on many boards. |
---|
[df0bfdf] | 2033 | */ |
---|
| 2034 | #if !defined(CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE) |
---|
| 2035 | #if !defined(CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER) && \ |
---|
| 2036 | !defined(CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER) && \ |
---|
| 2037 | !defined(CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER) |
---|
| 2038 | #error "CONFIGURATION ERROR: Do you want the clock driver or not?!?" |
---|
| 2039 | #endif |
---|
| 2040 | #endif |
---|
| 2041 | |
---|
[0ab34c90] | 2042 | /* |
---|
| 2043 | * These names have been obsoleted so make the user application stop compiling |
---|
| 2044 | */ |
---|
| 2045 | #if defined(CONFIGURE_TEST_NEEDS_TIMER_DRIVER) || \ |
---|
| 2046 | defined(CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER) || \ |
---|
| 2047 | defined(CONFIGURE_TEST_NEEDS_CLOCK_DRIVER) || \ |
---|
| 2048 | defined(CONFIGURE_TEST_NEEDS_RTC_DRIVER) || \ |
---|
| 2049 | defined(CONFIGURE_TEST_NEEDS_STUB_DRIVER) |
---|
| 2050 | #error "CONFIGURATION ERROR: CONFIGURE_TEST_XXX constants are obsolete" |
---|
| 2051 | #endif |
---|
| 2052 | |
---|
[80f9d77] | 2053 | /* |
---|
| 2054 | * Validate the configured maximum priority |
---|
| 2055 | */ |
---|
| 2056 | #if ((CONFIGURE_MAXIMUM_PRIORITY != 3) && \ |
---|
| 2057 | (CONFIGURE_MAXIMUM_PRIORITY != 7) && \ |
---|
| 2058 | (CONFIGURE_MAXIMUM_PRIORITY != 15) && \ |
---|
| 2059 | (CONFIGURE_MAXIMUM_PRIORITY != 31) && \ |
---|
| 2060 | (CONFIGURE_MAXIMUM_PRIORITY != 63) && \ |
---|
| 2061 | (CONFIGURE_MAXIMUM_PRIORITY != 127) && \ |
---|
| 2062 | (CONFIGURE_MAXIMUM_PRIORITY != 255)) |
---|
| 2063 | #error "Maximum priority is not 1 less than a power of 2 between 4 and 256" |
---|
| 2064 | #endif |
---|
| 2065 | |
---|
| 2066 | #if (CONFIGURE_MAXIMUM_PRIORITY > PRIORITY_DEFAULT_MAXIMUM) |
---|
| 2067 | #error "Maximum priority configured higher than supported by target." |
---|
| 2068 | #endif |
---|
| 2069 | |
---|
[08bae5e6] | 2070 | #endif |
---|
| 2071 | /* end of include file */ |
---|