[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 | /* |
---|
[1c6fa45a] | 29 | * COPYRIGHT (c) 1989-2007. |
---|
[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 | |
---|
[08bae5e6] | 42 | #ifdef __cplusplus |
---|
| 43 | extern "C" { |
---|
| 44 | #endif |
---|
[9c63d90] | 45 | |
---|
| 46 | /* |
---|
| 47 | * Include the executive's configuration |
---|
| 48 | */ |
---|
| 49 | #include <rtems/score/cpuopts.h> |
---|
[b2b143f4] | 50 | #include <rtems/score/apimutex.h> |
---|
[9c63d90] | 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 |
---|
[be1c11ed] | 59 | extern posix_api_configuration_table Configuration_POSIX_API; |
---|
[2eba45d] | 60 | #endif |
---|
[352c9b2] | 61 | #ifdef RTEMS_ITRON_API |
---|
| 62 | extern itron_api_configuration_table Configuration_ITRON_API; |
---|
| 63 | #endif |
---|
[08bae5e6] | 64 | |
---|
[3b89891] | 65 | /* |
---|
| 66 | * RTEMS C Library and Newlib support |
---|
| 67 | */ |
---|
| 68 | |
---|
[c3db01d0] | 69 | #if (defined(RTEMS_NEWLIB) && defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY)) |
---|
| 70 | #define CONFIGURE_NEWLIB_EXTENSION 1 |
---|
[623893c] | 71 | #else |
---|
[c3db01d0] | 72 | #define CONFIGURE_NEWLIB_EXTENSION 0 |
---|
[9c63d90] | 73 | #endif |
---|
[623893c] | 74 | |
---|
[df49c60] | 75 | /* |
---|
| 76 | * File descriptors managed by libio |
---|
| 77 | */ |
---|
| 78 | |
---|
[bd9c3d1] | 79 | #ifndef CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS |
---|
[df49c60] | 80 | #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 3 |
---|
[bd9c3d1] | 81 | #endif |
---|
| 82 | |
---|
| 83 | #define CONFIGURE_LIBIO_SEMAPHORES \ |
---|
| 84 | (CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS + 1) |
---|
| 85 | |
---|
[43908825] | 86 | #ifdef CONFIGURE_INIT |
---|
[8bd41178] | 87 | uint32_t rtems_libio_number_iops = CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS; |
---|
[43908825] | 88 | #endif |
---|
| 89 | |
---|
[df49c60] | 90 | /* |
---|
| 91 | * Termios resources |
---|
| 92 | */ |
---|
| 93 | |
---|
| 94 | #ifdef CONFIGURE_TERMIOS_DISABLED |
---|
| 95 | #define CONFIGURE_TERMIOS_SEMAPHORES 0 |
---|
| 96 | #else |
---|
| 97 | |
---|
| 98 | #ifndef CONFIGURE_NUMBER_OF_TERMIOS_PORTS |
---|
| 99 | #define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 1 |
---|
| 100 | #endif |
---|
| 101 | |
---|
| 102 | #define CONFIGURE_TERMIOS_SEMAPHORES \ |
---|
| 103 | ((CONFIGURE_NUMBER_OF_TERMIOS_PORTS * 4) + 1) |
---|
| 104 | #endif |
---|
| 105 | |
---|
[d3d2afdf] | 106 | /* |
---|
| 107 | * PTYs |
---|
| 108 | */ |
---|
| 109 | |
---|
| 110 | #ifndef CONFIGURE_MAXIMUM_PTYS |
---|
| 111 | #define CONFIGURE_MAXIMUM_PTYS 0 |
---|
| 112 | #endif |
---|
| 113 | |
---|
| 114 | #ifdef CONFIGURE_INIT |
---|
| 115 | int rtems_telnetd_maximum_ptys = CONFIGURE_MAXIMUM_PTYS; |
---|
| 116 | #else |
---|
| 117 | extern int rtems_telnetd_maximum_ptys; |
---|
| 118 | #endif |
---|
| 119 | |
---|
[43f7a90] | 120 | /* |
---|
| 121 | * Mount Table Configuration |
---|
| 122 | */ |
---|
| 123 | |
---|
[ebbe119e] | 124 | #include <rtems/imfs.h> |
---|
[43f7a90] | 125 | |
---|
[c9b005a9] | 126 | #ifndef CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK |
---|
| 127 | #define CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK \ |
---|
| 128 | IMFS_MEMFILE_DEFAULT_BYTES_PER_BLOCK |
---|
| 129 | #endif |
---|
[43f7a90] | 130 | #ifdef CONFIGURE_INIT |
---|
[c9b005a9] | 131 | int imfs_rq_memfile_bytes_per_block = CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK; |
---|
| 132 | #endif /* CONFIGURE_INIT */ |
---|
[43f7a90] | 133 | |
---|
[c9b005a9] | 134 | #ifdef CONFIGURE_INIT |
---|
[c3db01d0] | 135 | #ifndef CONFIGURE_HAS_OWN_MOUNT_TABLE |
---|
| 136 | rtems_filesystem_mount_table_t configuration_mount_table = { |
---|
| 137 | #ifdef CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM |
---|
| 138 | &IMFS_ops, |
---|
| 139 | #else /* using miniIMFS as base filesystem */ |
---|
| 140 | &miniIMFS_ops, |
---|
| 141 | #endif |
---|
| 142 | RTEMS_FILESYSTEM_READ_WRITE, |
---|
| 143 | NULL, |
---|
| 144 | NULL |
---|
| 145 | }; |
---|
| 146 | |
---|
| 147 | rtems_filesystem_mount_table_t |
---|
| 148 | *rtems_filesystem_mount_table = &configuration_mount_table; |
---|
| 149 | int rtems_filesystem_mount_table_size = 1; |
---|
| 150 | #endif |
---|
[43f7a90] | 151 | #endif |
---|
| 152 | |
---|
[ab97da95] | 153 | /* |
---|
| 154 | * Stack Checker Requirements |
---|
[458bd34] | 155 | * |
---|
| 156 | * NOTE: This does not automatically enable reporting at program exit. |
---|
[ab97da95] | 157 | */ |
---|
| 158 | |
---|
| 159 | #ifdef STACK_CHECKER_ON |
---|
| 160 | #define CONFIGURE_STACK_CHECKER_EXTENSION 1 |
---|
| 161 | #else |
---|
| 162 | #define CONFIGURE_STACK_CHECKER_EXTENSION 0 |
---|
| 163 | #endif |
---|
| 164 | |
---|
[01a4990] | 165 | /* |
---|
| 166 | * Interrupt Stack Space |
---|
[df49c60] | 167 | * |
---|
| 168 | * NOTE: There is currently no way for the application to override |
---|
| 169 | * the interrupt stack size set by the BSP. |
---|
[01a4990] | 170 | */ |
---|
| 171 | |
---|
[71d07b9d] | 172 | #if (CPU_ALLOCATE_INTERRUPT_STACK == 0) |
---|
[df49c60] | 173 | #undef CONFIGURE_INTERRUPT_STACK_MEMORY |
---|
[01a4990] | 174 | #define CONFIGURE_INTERRUPT_STACK_MEMORY 0 |
---|
[71d07b9d] | 175 | #else |
---|
| 176 | #ifndef CONFIGURE_INTERRUPT_STACK_MEMORY |
---|
| 177 | #define CONFIGURE_INTERRUPT_STACK_MEMORY RTEMS_MINIMUM_STACK_SIZE |
---|
| 178 | #endif |
---|
[01a4990] | 179 | #endif |
---|
| 180 | |
---|
[976162a6] | 181 | /* |
---|
| 182 | * Idle task body configuration |
---|
| 183 | * |
---|
| 184 | * There is a default IDLE thread body provided by RTEMS which |
---|
| 185 | * has the possibility of being CPU specific. There may be a |
---|
| 186 | * BSP specific override of the RTEMS default body and in turn, |
---|
| 187 | * the application may override and provide its own. |
---|
| 188 | */ |
---|
| 189 | #ifndef CONFIGURE_IDLE_TASK_BODY |
---|
| 190 | #ifdef BSP_IDLE_TASK_BODY |
---|
| 191 | #define CONFIGURE_IDLE_TASK_BODY BSP_IDLE_TASK_BODY |
---|
| 192 | #else |
---|
| 193 | #define CONFIGURE_IDLE_TASK_BODY NULL |
---|
| 194 | #endif |
---|
| 195 | #endif |
---|
| 196 | |
---|
| 197 | /* |
---|
| 198 | * Idle task stack size configuration |
---|
| 199 | * |
---|
| 200 | * By default, the IDLE task will have a stack of minimum size. |
---|
| 201 | * The BSP or application may override this value. |
---|
| 202 | */ |
---|
| 203 | #ifndef CONFIGURE_IDLE_TASK_STACK_SIZE |
---|
| 204 | #ifdef BSP_IDLE_TASK_STACK_SIZE |
---|
| 205 | #define CONFIGURE_IDLE_TASK_STACK_SIZE BSP_IDLE_TASK_STACK_SIZE |
---|
| 206 | #else |
---|
| 207 | #define CONFIGURE_IDLE_TASK_STACK_SIZE RTEMS_MINIMUM_STACK_SIZE |
---|
| 208 | #endif |
---|
| 209 | #endif |
---|
| 210 | |
---|
| 211 | /* |
---|
| 212 | * Task stack allocator configuration |
---|
| 213 | */ |
---|
| 214 | |
---|
| 215 | #ifndef CONFIGURE_TASK_STACK_ALLOCATOR |
---|
| 216 | #define CONFIGURE_TASK_STACK_ALLOCATOR NULL |
---|
| 217 | #endif |
---|
| 218 | |
---|
| 219 | #ifndef CONFIGURE_TASK_STACK_DEALLOCATOR |
---|
| 220 | #define CONFIGURE_TASK_STACK_DEALLOCATOR NULL |
---|
| 221 | #endif |
---|
| 222 | |
---|
| 223 | /* |
---|
| 224 | * Should the RTEMS Workspace and C Program Heap be cleared automatically |
---|
| 225 | * at system start up? |
---|
| 226 | */ |
---|
| 227 | |
---|
| 228 | #ifndef CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY |
---|
| 229 | #ifdef BSP_ZERO_WORKSPACE_AUTOMATICALLY |
---|
| 230 | #define CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY \ |
---|
| 231 | BSP_ZERO_WORKSPACE_AUTOMATICALLY |
---|
| 232 | #else |
---|
| 233 | #define CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY FALSE |
---|
| 234 | #endif |
---|
| 235 | #endif |
---|
| 236 | |
---|
[08bae5e6] | 237 | /* |
---|
| 238 | * Default User Initialization Task Table. This table guarantees that |
---|
| 239 | * one user initialization table is defined. |
---|
| 240 | */ |
---|
| 241 | |
---|
[be1c11ed] | 242 | #ifdef CONFIGURE_RTEMS_INIT_TASKS_TABLE |
---|
| 243 | |
---|
| 244 | #ifdef CONFIGURE_HAS_OWN_INIT_TASK_TABLE |
---|
| 245 | |
---|
| 246 | /* |
---|
[8486081] | 247 | * The user is defining their own table information and setting the |
---|
[be1c11ed] | 248 | * appropriate variables. |
---|
| 249 | */ |
---|
| 250 | |
---|
| 251 | #else |
---|
[08bae5e6] | 252 | |
---|
| 253 | #ifndef CONFIGURE_INIT_TASK_NAME |
---|
| 254 | #define CONFIGURE_INIT_TASK_NAME rtems_build_name( 'U', 'I', '1', ' ' ) |
---|
| 255 | #endif |
---|
| 256 | |
---|
| 257 | #ifndef CONFIGURE_INIT_TASK_STACK_SIZE |
---|
[8486081] | 258 | #define CONFIGURE_INIT_TASK_STACK_SIZE RTEMS_MINIMUM_STACK_SIZE |
---|
[08bae5e6] | 259 | #endif |
---|
| 260 | |
---|
| 261 | #ifndef CONFIGURE_INIT_TASK_PRIORITY |
---|
| 262 | #define CONFIGURE_INIT_TASK_PRIORITY 1 |
---|
| 263 | #endif |
---|
| 264 | |
---|
| 265 | #ifndef CONFIGURE_INIT_TASK_ATTRIBUTES |
---|
[8486081] | 266 | #define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_DEFAULT_ATTRIBUTES |
---|
[08bae5e6] | 267 | #endif |
---|
| 268 | |
---|
| 269 | #ifndef CONFIGURE_INIT_TASK_ENTRY_POINT |
---|
[8486081] | 270 | #define CONFIGURE_INIT_TASK_ENTRY_POINT Init |
---|
[08bae5e6] | 271 | #endif |
---|
| 272 | |
---|
| 273 | #ifndef CONFIGURE_INIT_TASK_INITIAL_MODES |
---|
[8486081] | 274 | #define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_NO_PREEMPT |
---|
[08bae5e6] | 275 | #endif |
---|
| 276 | |
---|
| 277 | #ifndef CONFIGURE_INIT_TASK_ARGUMENTS |
---|
[8486081] | 278 | #define CONFIGURE_INIT_TASK_ARGUMENTS 0 |
---|
[08bae5e6] | 279 | #endif |
---|
| 280 | |
---|
| 281 | #ifdef CONFIGURE_INIT |
---|
| 282 | rtems_initialization_tasks_table Initialization_tasks[] = { |
---|
| 283 | { CONFIGURE_INIT_TASK_NAME, |
---|
| 284 | CONFIGURE_INIT_TASK_STACK_SIZE, |
---|
| 285 | CONFIGURE_INIT_TASK_PRIORITY, |
---|
| 286 | CONFIGURE_INIT_TASK_ATTRIBUTES, |
---|
| 287 | CONFIGURE_INIT_TASK_ENTRY_POINT, |
---|
| 288 | CONFIGURE_INIT_TASK_INITIAL_MODES, |
---|
| 289 | CONFIGURE_INIT_TASK_ARGUMENTS |
---|
| 290 | } |
---|
| 291 | }; |
---|
| 292 | #endif |
---|
| 293 | |
---|
[d9a0689e] | 294 | #define CONFIGURE_INIT_TASK_TABLE Initialization_tasks |
---|
| 295 | |
---|
| 296 | #define CONFIGURE_INIT_TASK_TABLE_SIZE \ |
---|
| 297 | sizeof(CONFIGURE_INIT_TASK_TABLE) / sizeof(rtems_initialization_tasks_table) |
---|
| 298 | |
---|
[be1c11ed] | 299 | #endif /* CONFIGURE_HAS_OWN_INIT_TASK_TABLE */ |
---|
| 300 | |
---|
| 301 | #else /* CONFIGURE_RTEMS_INIT_TASKS_TABLE */ |
---|
| 302 | |
---|
| 303 | #define CONFIGURE_INIT_TASK_TABLE NULL |
---|
| 304 | #define CONFIGURE_INIT_TASK_TABLE_SIZE 0 |
---|
[45c3da3] | 305 | #define CONFIGURE_INIT_TASK_STACK_SIZE 0 |
---|
[be1c11ed] | 306 | |
---|
[08bae5e6] | 307 | #endif |
---|
| 308 | |
---|
| 309 | /* |
---|
| 310 | * Default Device Driver Table. Each driver needed by the test is explicitly |
---|
| 311 | * choosen by that test. There is always a null driver entry. |
---|
| 312 | */ |
---|
| 313 | |
---|
| 314 | #define NULL_DRIVER_TABLE_ENTRY \ |
---|
| 315 | { NULL, NULL, NULL, NULL, NULL, NULL } |
---|
| 316 | |
---|
[df49c60] | 317 | #ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
---|
[ebbe119e] | 318 | #include <rtems/console.h> |
---|
[df49c60] | 319 | #endif |
---|
| 320 | |
---|
| 321 | #ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER |
---|
[ebbe119e] | 322 | #include <rtems/clockdrv.h> |
---|
[df49c60] | 323 | #endif |
---|
| 324 | |
---|
| 325 | #ifdef CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER |
---|
[ebbe119e] | 326 | #include <rtems/timerdrv.h> |
---|
[08bae5e6] | 327 | #endif |
---|
| 328 | |
---|
[1d4bac9] | 329 | #ifdef CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER |
---|
[ebbe119e] | 330 | #include <rtems/rtc.h> |
---|
[1d4bac9] | 331 | #endif |
---|
| 332 | |
---|
[df49c60] | 333 | #ifdef CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER |
---|
[9c63d90] | 334 | #include <rtems/devnull.h> |
---|
[08bae5e6] | 335 | #endif |
---|
| 336 | |
---|
[c9b005a9] | 337 | #ifdef CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER |
---|
| 338 | /* the ide driver needs the ATA driver */ |
---|
| 339 | # ifndef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER |
---|
| 340 | # define CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER |
---|
| 341 | # endif |
---|
| 342 | #include <libchip/ide_ctrl.h> |
---|
| 343 | #endif |
---|
| 344 | |
---|
| 345 | #ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER |
---|
| 346 | #include <libchip/ata.h> |
---|
| 347 | #endif |
---|
| 348 | |
---|
[08bae5e6] | 349 | #ifndef CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE |
---|
| 350 | |
---|
| 351 | #ifdef CONFIGURE_INIT |
---|
| 352 | rtems_driver_address_table Device_drivers[] = { |
---|
[df49c60] | 353 | #ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
---|
[08bae5e6] | 354 | CONSOLE_DRIVER_TABLE_ENTRY, |
---|
| 355 | #endif |
---|
[df49c60] | 356 | #ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER |
---|
[08bae5e6] | 357 | CLOCK_DRIVER_TABLE_ENTRY, |
---|
| 358 | #endif |
---|
[1d4bac9] | 359 | #ifdef CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER |
---|
| 360 | RTC_DRIVER_TABLE_ENTRY, |
---|
| 361 | #endif |
---|
[df49c60] | 362 | #ifdef CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER |
---|
[9c63d90] | 363 | DEVNULL_DRIVER_TABLE_ENTRY, |
---|
[08bae5e6] | 364 | #endif |
---|
[c9b005a9] | 365 | #ifdef CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER |
---|
| 366 | IDE_CONTROLLER_DRIVER_TABLE_ENTRY, |
---|
| 367 | #endif |
---|
| 368 | #ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER |
---|
| 369 | ATA_DRIVER_TABLE_ENTRY, |
---|
| 370 | #endif |
---|
[1c6fa45a] | 371 | #ifdef CONFIGURE_APPLICATION_EXTRA_DRIVERS |
---|
| 372 | CONFIGURE_APPLICATION_EXTRA_DRIVERS, |
---|
| 373 | #endif |
---|
[96e6a86c] | 374 | #ifdef CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER |
---|
[08bae5e6] | 375 | NULL_DRIVER_TABLE_ENTRY |
---|
[96e6a86c] | 376 | #elif !defined(CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER) && \ |
---|
| 377 | !defined(CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER) && \ |
---|
| 378 | !defined(CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER) && \ |
---|
[c9b005a9] | 379 | !defined(CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER) && \ |
---|
[1c6fa45a] | 380 | !defined(CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER) && \ |
---|
| 381 | !defined(CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER) && \ |
---|
| 382 | !defined(CONFIGURE_APPLICATION_EXTRA_DRIVERS) |
---|
[96e6a86c] | 383 | NULL_DRIVER_TABLE_ENTRY |
---|
| 384 | #endif |
---|
[08bae5e6] | 385 | }; |
---|
| 386 | #endif |
---|
| 387 | |
---|
| 388 | #endif /* CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE */ |
---|
| 389 | |
---|
[059a3714] | 390 | /* |
---|
| 391 | * Default the number of drivers per node. This value may be |
---|
| 392 | * overridden by the user. |
---|
| 393 | */ |
---|
| 394 | |
---|
[96e6a86c] | 395 | #define CONFIGURE_NUMBER_OF_DRIVERS \ |
---|
| 396 | ((sizeof(Device_drivers) / sizeof(rtems_driver_address_table))) |
---|
| 397 | |
---|
[059a3714] | 398 | #ifndef CONFIGURE_MAXIMUM_DRIVERS |
---|
[96e6a86c] | 399 | #define CONFIGURE_MAXIMUM_DRIVERS CONFIGURE_NUMBER_OF_DRIVERS |
---|
[059a3714] | 400 | #endif |
---|
| 401 | |
---|
[08bae5e6] | 402 | /* |
---|
| 403 | * Default the number of devices per device driver. This value may be |
---|
| 404 | * overridden by the user. |
---|
[ff3f8c85] | 405 | * |
---|
| 406 | * NOTE: This configuration parameter is obsolete. Thus we will warn the |
---|
| 407 | * user that it is obsolete. |
---|
[08bae5e6] | 408 | */ |
---|
| 409 | |
---|
[ff3f8c85] | 410 | #ifdef CONFIGURE_MAXIMUM_DEVICES |
---|
| 411 | #warning "CONFIGURE_MAXIMUM_DEVICES is obsolete. Do not use any longer." |
---|
[08bae5e6] | 412 | #endif |
---|
| 413 | |
---|
[c9b005a9] | 414 | #ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER |
---|
| 415 | /* |
---|
| 416 | * configure the priority of the ATA driver task |
---|
| 417 | */ |
---|
| 418 | # ifndef CONFIGURE_ATA_DRIVER_TASK_PRIORITY |
---|
| 419 | # define CONFIGURE_ATA_DRIVER_TASK_PRIORITY ATA_DRIVER_TASK_DEFAULT_PRIORITY |
---|
| 420 | # endif |
---|
| 421 | # ifdef CONFIGURE_INIT |
---|
| 422 | rtems_task_priority ata_driver_task_priority |
---|
| 423 | = CONFIGURE_ATA_DRIVER_TASK_PRIORITY; |
---|
| 424 | # endif /* CONFIGURE_INIT */ |
---|
| 425 | #endif |
---|
| 426 | |
---|
| 427 | /* |
---|
| 428 | * add bdbuf configuration and values for swapout task priority |
---|
| 429 | */ |
---|
| 430 | #ifdef CONFIGURE_APPLICATION_NEEDS_LIBBLOCK |
---|
| 431 | #include <rtems/bdbuf.h> |
---|
| 432 | /* |
---|
| 433 | * configure the priority of the bdbuf swapout task |
---|
| 434 | */ |
---|
| 435 | #ifndef CONFIGURE_SWAPOUT_TASK_PRIORITY |
---|
| 436 | #define CONFIGURE_SWAPOUT_TASK_PRIORITY SWAPOUT_TASK_DEFAULT_PRIORITY |
---|
| 437 | #endif |
---|
| 438 | #ifdef CONFIGURE_INIT |
---|
| 439 | rtems_task_priority swapout_task_priority |
---|
| 440 | = CONFIGURE_SWAPOUT_TASK_PRIORITY; |
---|
| 441 | #endif /* CONFIGURE_INIT */ |
---|
| 442 | #ifndef CONFIGURE_HAS_OWN_BDBUF_TABLE |
---|
| 443 | |
---|
| 444 | #ifndef CONFIGURE_BDBUF_BUFFER_COUNT |
---|
| 445 | #define CONFIGURE_BDBUF_BUFFER_COUNT 64 |
---|
| 446 | #endif /* CONFIGURE_BDBUF_BUFFER_COUNT */ |
---|
| 447 | |
---|
| 448 | #ifndef CONFIGURE_BDBUF_BUFFER_SIZE |
---|
| 449 | #define CONFIGURE_BDBUF_BUFFER_SIZE 512 |
---|
| 450 | #endif /* CONFIGURE_BDBUF_BUFFER_SIZE */ |
---|
| 451 | #ifdef CONFIGURE_INIT |
---|
| 452 | rtems_bdbuf_config rtems_bdbuf_configuration[] = { |
---|
| 453 | {CONFIGURE_BDBUF_BUFFER_SIZE,CONFIGURE_BDBUF_BUFFER_COUNT,NULL} |
---|
| 454 | }; |
---|
| 455 | int rtems_bdbuf_configuration_size =( sizeof(rtems_bdbuf_configuration) |
---|
| 456 | /sizeof(rtems_bdbuf_configuration[0])); |
---|
| 457 | #endif /* CONFIGURE_INIT */ |
---|
| 458 | #endif /* CONFIGURE_HAS_OWN_BDBUF_TABLE */ |
---|
| 459 | #endif /* CONFIGURE_APPLICATION_NEEDS_LIBBLOCK */ |
---|
[976162a6] | 460 | |
---|
| 461 | #if defined(RTEMS_MULTIPROCESSING) |
---|
[08bae5e6] | 462 | /* |
---|
[df49c60] | 463 | * Default Multiprocessing Configuration Table. The defaults are |
---|
| 464 | * appropriate for most of the RTEMS Multiprocessor Test Suite. Each |
---|
[8486081] | 465 | * value may be overridden within each test to customize the environment. |
---|
[08bae5e6] | 466 | */ |
---|
| 467 | |
---|
[df49c60] | 468 | #ifdef CONFIGURE_MP_APPLICATION |
---|
[e2a8b99] | 469 | #ifndef CONFIGURE_HAS_OWN_MULTIPROCESSING_TABLE |
---|
[08bae5e6] | 470 | |
---|
| 471 | #ifndef CONFIGURE_MP_NODE_NUMBER |
---|
| 472 | #define CONFIGURE_MP_NODE_NUMBER NODE_NUMBER |
---|
| 473 | #endif |
---|
| 474 | |
---|
| 475 | #ifndef CONFIGURE_MP_MAXIMUM_NODES |
---|
| 476 | #define CONFIGURE_MP_MAXIMUM_NODES 2 |
---|
| 477 | #endif |
---|
| 478 | |
---|
| 479 | #ifndef CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS |
---|
| 480 | #define CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS 32 |
---|
| 481 | #endif |
---|
| 482 | |
---|
| 483 | #ifndef CONFIGURE_MP_MAXIMUM_PROXIES |
---|
| 484 | #define CONFIGURE_MP_MAXIMUM_PROXIES 32 |
---|
| 485 | #endif |
---|
| 486 | |
---|
| 487 | #ifndef CONFIGURE_MP_MPCI_TABLE_POINTER |
---|
| 488 | #include <mpci.h> |
---|
| 489 | #define CONFIGURE_MP_MPCI_TABLE_POINTER &MPCI_table |
---|
| 490 | #endif |
---|
| 491 | |
---|
| 492 | #ifdef CONFIGURE_INIT |
---|
| 493 | rtems_multiprocessing_table Multiprocessing_configuration = { |
---|
| 494 | CONFIGURE_MP_NODE_NUMBER, /* local node number */ |
---|
| 495 | CONFIGURE_MP_MAXIMUM_NODES, /* maximum # nodes in system */ |
---|
| 496 | CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS, /* maximum # global objects */ |
---|
| 497 | CONFIGURE_MP_MAXIMUM_PROXIES, /* maximum # proxies */ |
---|
| 498 | CONFIGURE_MP_MPCI_TABLE_POINTER /* pointer to MPCI config table */ |
---|
| 499 | }; |
---|
| 500 | #endif |
---|
| 501 | |
---|
| 502 | #define CONFIGURE_MULTIPROCESSING_TABLE &Multiprocessing_configuration |
---|
| 503 | |
---|
[e2a8b99] | 504 | #endif /* CONFIGURE_HAS_OWN_MULTIPROCESSING_TABLE */ |
---|
[08bae5e6] | 505 | |
---|
| 506 | #else |
---|
| 507 | |
---|
| 508 | #define CONFIGURE_MULTIPROCESSING_TABLE NULL |
---|
| 509 | |
---|
[df49c60] | 510 | #endif /* CONFIGURE_MP_APPLICATION */ |
---|
[976162a6] | 511 | #endif /* RTEMS_MULTIPROCESSING */ |
---|
[8486081] | 512 | |
---|
[08bae5e6] | 513 | /* |
---|
[8486081] | 514 | * Default Configuration Table. |
---|
[08bae5e6] | 515 | */ |
---|
| 516 | |
---|
| 517 | #ifndef CONFIGURE_HAS_OWN_CONFIGURATION_TABLE |
---|
[8486081] | 518 | |
---|
[08bae5e6] | 519 | #ifndef CONFIGURE_EXECUTIVE_RAM_WORK_AREA |
---|
| 520 | #define CONFIGURE_EXECUTIVE_RAM_WORK_AREA NULL |
---|
| 521 | #endif |
---|
| 522 | |
---|
| 523 | #ifndef CONFIGURE_MAXIMUM_TASKS |
---|
[df49c60] | 524 | #define CONFIGURE_MAXIMUM_TASKS 0 |
---|
[08bae5e6] | 525 | #endif |
---|
| 526 | |
---|
| 527 | #ifndef CONFIGURE_MAXIMUM_TIMERS |
---|
| 528 | #define CONFIGURE_MAXIMUM_TIMERS 0 |
---|
| 529 | #endif |
---|
| 530 | |
---|
| 531 | #ifndef CONFIGURE_MAXIMUM_SEMAPHORES |
---|
| 532 | #define CONFIGURE_MAXIMUM_SEMAPHORES 0 |
---|
| 533 | #endif |
---|
| 534 | |
---|
| 535 | #ifndef CONFIGURE_MAXIMUM_MESSAGE_QUEUES |
---|
| 536 | #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 0 |
---|
| 537 | #endif |
---|
| 538 | |
---|
| 539 | #ifndef CONFIGURE_MAXIMUM_PARTITIONS |
---|
| 540 | #define CONFIGURE_MAXIMUM_PARTITIONS 0 |
---|
| 541 | #endif |
---|
| 542 | |
---|
| 543 | #ifndef CONFIGURE_MAXIMUM_REGIONS |
---|
| 544 | #define CONFIGURE_MAXIMUM_REGIONS 0 |
---|
| 545 | #endif |
---|
| 546 | |
---|
| 547 | #ifndef CONFIGURE_MAXIMUM_PORTS |
---|
| 548 | #define CONFIGURE_MAXIMUM_PORTS 0 |
---|
| 549 | #endif |
---|
| 550 | |
---|
| 551 | #ifndef CONFIGURE_MAXIMUM_PERIODS |
---|
| 552 | #define CONFIGURE_MAXIMUM_PERIODS 0 |
---|
| 553 | #endif |
---|
| 554 | |
---|
[7fa1ce86] | 555 | #ifndef CONFIGURE_MAXIMUM_BARRIERS |
---|
| 556 | #define CONFIGURE_MAXIMUM_BARRIERS 0 |
---|
| 557 | #endif |
---|
| 558 | |
---|
[08bae5e6] | 559 | #ifndef CONFIGURE_MAXIMUM_USER_EXTENSIONS |
---|
| 560 | #define CONFIGURE_MAXIMUM_USER_EXTENSIONS 0 |
---|
| 561 | #endif |
---|
| 562 | |
---|
[8486081] | 563 | #ifndef CONFIGURE_MICROSECONDS_PER_TICK |
---|
[08bae5e6] | 564 | #define CONFIGURE_MICROSECONDS_PER_TICK RTEMS_MILLISECONDS_TO_MICROSECONDS(10) |
---|
| 565 | #endif |
---|
| 566 | |
---|
| 567 | #ifndef CONFIGURE_TICKS_PER_TIMESLICE |
---|
| 568 | #define CONFIGURE_TICKS_PER_TIMESLICE 50 |
---|
| 569 | #endif |
---|
| 570 | |
---|
[0451b44] | 571 | /* |
---|
| 572 | * Initial Extension Set |
---|
| 573 | */ |
---|
| 574 | |
---|
| 575 | #ifdef CONFIGURE_INIT |
---|
| 576 | #ifdef STACK_CHECKER_ON |
---|
[31bce9b] | 577 | #include <rtems/stackchk.h> |
---|
[0451b44] | 578 | #endif |
---|
[c3db01d0] | 579 | #include <rtems/libcsupport.h> |
---|
[0451b44] | 580 | |
---|
[96e6a86c] | 581 | #if defined(CONFIGURE_INITIAL_EXTENSIONS) || \ |
---|
[c3db01d0] | 582 | defined(STACK_CHECKER_ON) || \ |
---|
| 583 | (defined(RTEMS_NEWLIB) && !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY)) |
---|
| 584 | rtems_extensions_table Configuration_Initial_Extensions[] = { |
---|
| 585 | #if !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY) |
---|
| 586 | RTEMS_NEWLIB_EXTENSION, |
---|
| 587 | #endif |
---|
| 588 | #if defined(STACK_CHECKER_ON) |
---|
| 589 | RTEMS_STACK_CHECKER_EXTENSION, |
---|
| 590 | #endif |
---|
| 591 | #if defined(CONFIGURE_INITIAL_EXTENSIONS) |
---|
| 592 | CONFIGURE_INITIAL_EXTENSIONS, |
---|
| 593 | #endif |
---|
| 594 | }; |
---|
| 595 | |
---|
| 596 | #define CONFIGURE_INITIAL_EXTENSION_TABLE Configuration_Initial_Extensions |
---|
| 597 | #define CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS \ |
---|
| 598 | ((sizeof(Configuration_Initial_Extensions) / \ |
---|
| 599 | sizeof(rtems_extensions_table))) |
---|
[96e6a86c] | 600 | #else |
---|
[c3db01d0] | 601 | #define CONFIGURE_INITIAL_EXTENSION_TABLE NULL |
---|
| 602 | #define CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS 0 |
---|
[96e6a86c] | 603 | #endif |
---|
| 604 | |
---|
[0451b44] | 605 | |
---|
[08bae5e6] | 606 | #endif |
---|
| 607 | |
---|
[2eba45d] | 608 | /* |
---|
| 609 | * POSIX API Configuration Parameters |
---|
| 610 | */ |
---|
| 611 | |
---|
| 612 | #ifdef RTEMS_POSIX_API |
---|
| 613 | |
---|
[308aed9b] | 614 | #include <sys/types.h> |
---|
[72ad6aa] | 615 | #include <signal.h> |
---|
[b2b143f4] | 616 | #include <limits.h> |
---|
[be0fc099] | 617 | #include <mqueue.h> |
---|
[4741fcb7] | 618 | #include <rtems/posix/barrier.h> |
---|
[308aed9b] | 619 | #include <rtems/posix/cond.h> |
---|
[be0fc099] | 620 | #include <rtems/posix/mqueue.h> |
---|
[308aed9b] | 621 | #include <rtems/posix/mutex.h> |
---|
| 622 | #include <rtems/posix/key.h> |
---|
| 623 | #include <rtems/posix/psignal.h> |
---|
[4741fcb7] | 624 | #include <rtems/posix/rwlock.h> |
---|
[be0fc099] | 625 | #include <rtems/posix/semaphore.h> |
---|
[4741fcb7] | 626 | #include <rtems/posix/spinlock.h> |
---|
[308aed9b] | 627 | #include <rtems/posix/threadsup.h> |
---|
[8c51e48c] | 628 | #include <rtems/posix/timer.h> |
---|
[308aed9b] | 629 | |
---|
[2eba45d] | 630 | #ifndef CONFIGURE_MAXIMUM_POSIX_THREADS |
---|
[df49c60] | 631 | #define CONFIGURE_MAXIMUM_POSIX_THREADS 0 |
---|
[2eba45d] | 632 | #endif |
---|
| 633 | |
---|
| 634 | #ifndef CONFIGURE_MAXIMUM_POSIX_MUTEXES |
---|
[da33d26] | 635 | #define CONFIGURE_MAXIMUM_POSIX_MUTEXES 0 |
---|
[2eba45d] | 636 | #endif |
---|
| 637 | |
---|
| 638 | #ifndef CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES |
---|
| 639 | #define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 0 |
---|
| 640 | #endif |
---|
| 641 | |
---|
[da33d26] | 642 | #ifndef CONFIGURE_MAXIMUM_POSIX_KEYS |
---|
| 643 | #define CONFIGURE_MAXIMUM_POSIX_KEYS 0 |
---|
| 644 | #endif |
---|
| 645 | |
---|
[0747e2d] | 646 | #ifndef CONFIGURE_MAXIMUM_POSIX_TIMERS |
---|
| 647 | #define CONFIGURE_MAXIMUM_POSIX_TIMERS 0 |
---|
| 648 | #endif |
---|
| 649 | |
---|
[eb0551f] | 650 | #ifndef CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS |
---|
| 651 | #define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS 0 |
---|
| 652 | #endif |
---|
| 653 | |
---|
[be0fc099] | 654 | #ifndef CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES |
---|
| 655 | #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES 0 |
---|
| 656 | #endif |
---|
| 657 | |
---|
| 658 | #ifndef CONFIGURE_MAXIMUM_POSIX_SEMAPHORES |
---|
| 659 | #define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES 0 |
---|
| 660 | #endif |
---|
| 661 | |
---|
[7fa1ce86] | 662 | #ifndef CONFIGURE_MAXIMUM_POSIX_BARRIERS |
---|
| 663 | #define CONFIGURE_MAXIMUM_POSIX_BARRIERS 0 |
---|
| 664 | #endif |
---|
| 665 | |
---|
| 666 | #ifndef CONFIGURE_MAXIMUM_POSIX_SPINLOCKS |
---|
| 667 | #define CONFIGURE_MAXIMUM_POSIX_SPINLOCKS 0 |
---|
| 668 | #endif |
---|
| 669 | |
---|
| 670 | #ifndef CONFIGURE_MAXIMUM_POSIX_RWLOCKS |
---|
| 671 | #define CONFIGURE_MAXIMUM_POSIX_RWLOCKS 0 |
---|
| 672 | #endif |
---|
| 673 | |
---|
[be1c11ed] | 674 | #ifdef CONFIGURE_POSIX_INIT_THREAD_TABLE |
---|
| 675 | |
---|
| 676 | #ifdef CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE |
---|
[5240c71c] | 677 | |
---|
[be1c11ed] | 678 | /* |
---|
| 679 | * The user is defining their own table information and setting the |
---|
[df49c60] | 680 | * appropriate variables for the POSIX Initialization Thread Table. |
---|
[be1c11ed] | 681 | */ |
---|
[8486081] | 682 | |
---|
[be1c11ed] | 683 | #else |
---|
| 684 | |
---|
| 685 | #ifndef CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT |
---|
[8486081] | 686 | #define CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT POSIX_Init |
---|
[5240c71c] | 687 | #endif |
---|
| 688 | |
---|
[9583f6e] | 689 | #ifndef CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE |
---|
| 690 | #define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE (RTEMS_MINIMUM_STACK_SIZE * 2) |
---|
[adbb578] | 691 | #endif |
---|
| 692 | |
---|
[5240c71c] | 693 | #ifdef CONFIGURE_INIT |
---|
[be1c11ed] | 694 | posix_initialization_threads_table POSIX_Initialization_threads[] = { |
---|
[16775a5] | 695 | { CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT, \ |
---|
[9583f6e] | 696 | CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE } |
---|
[5240c71c] | 697 | }; |
---|
[2eba45d] | 698 | #endif |
---|
| 699 | |
---|
[be1c11ed] | 700 | #define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME POSIX_Initialization_threads |
---|
[8486081] | 701 | |
---|
[be1c11ed] | 702 | #define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE \ |
---|
| 703 | sizeof(CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME) / \ |
---|
| 704 | sizeof(posix_initialization_threads_table) |
---|
[5240c71c] | 705 | |
---|
| 706 | #endif /* CONFIGURE_POSIX_HAS_OWN_INIT_TASK_TABLE */ |
---|
| 707 | |
---|
[be1c11ed] | 708 | #else /* CONFIGURE_POSIX_INIT_THREAD_TABLE */ |
---|
| 709 | |
---|
| 710 | #define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME NULL |
---|
| 711 | #define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE 0 |
---|
| 712 | |
---|
| 713 | #endif |
---|
| 714 | |
---|
[308aed9b] | 715 | #define CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API \ |
---|
| 716 | ( \ |
---|
| 717 | sizeof (POSIX_API_Control) + \ |
---|
| 718 | (sizeof (void *) * (CONFIGURE_GNAT_KEYS + CONFIGURE_MAXIMUM_POSIX_KEYS)) \ |
---|
| 719 | ) |
---|
| 720 | |
---|
| 721 | #define CONFIGURE_MEMORY_FOR_POSIX_MUTEXES(_mutexes) \ |
---|
| 722 | ((_mutexes) * \ |
---|
[b2b143f4] | 723 | ( sizeof(POSIX_Mutex_Control) + CONFIGURE_OBJECT_TABLE_STUFF + \ |
---|
| 724 | NAME_MAX ) ) |
---|
[308aed9b] | 725 | |
---|
| 726 | #define CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES(_condition_variables) \ |
---|
| 727 | ((_condition_variables) * \ |
---|
| 728 | ( sizeof(POSIX_Condition_variables_Control) + \ |
---|
| 729 | CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
| 730 | |
---|
| 731 | #define CONFIGURE_MEMORY_FOR_POSIX_KEYS(_keys) \ |
---|
| 732 | ((_keys) * \ |
---|
| 733 | ( sizeof(POSIX_Keys_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
| 734 | |
---|
[0747e2d] | 735 | #define CONFIGURE_MEMORY_FOR_POSIX_TIMERS(_timers) \ |
---|
[8c51e48c] | 736 | ((_timers) * (sizeof(POSIX_Timer_Control) + CONFIGURE_OBJECT_TABLE_STUFF)) |
---|
[0747e2d] | 737 | |
---|
[308aed9b] | 738 | #define CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS(_queued_signals) \ |
---|
| 739 | ((_queued_signals) * \ |
---|
| 740 | ( sizeof(POSIX_signals_Siginfo_node) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
| 741 | |
---|
[be0fc099] | 742 | #define CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES(_message_queues) \ |
---|
| 743 | ((_message_queues) * \ |
---|
[b2b143f4] | 744 | ( sizeof( POSIX_Message_queue_Control) + \ |
---|
| 745 | CONFIGURE_OBJECT_TABLE_STUFF + \ |
---|
| 746 | NAME_MAX ) ) |
---|
[7fa1ce86] | 747 | |
---|
[be0fc099] | 748 | #define CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES(_semaphores) \ |
---|
| 749 | ((_semaphores) * \ |
---|
[b2b143f4] | 750 | ( sizeof( POSIX_Semaphore_Control) + \ |
---|
| 751 | CONFIGURE_OBJECT_TABLE_STUFF + \ |
---|
| 752 | NAME_MAX ) ) |
---|
[308aed9b] | 753 | |
---|
[7fb2bb2] | 754 | #define CONFIGURE_MEMORY_FOR_POSIX_BARRIERS(_barriers) \ |
---|
| 755 | ((_barriers) * \ |
---|
[7fa1ce86] | 756 | ( sizeof( POSIX_Barrier_Control) + \ |
---|
| 757 | CONFIGURE_OBJECT_TABLE_STUFF + \ |
---|
| 758 | NAME_MAX ) ) |
---|
| 759 | |
---|
| 760 | #define CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS(_spinlocks) \ |
---|
| 761 | ((_spinlocks) * \ |
---|
| 762 | ( sizeof( POSIX_Spinlock_Control) + \ |
---|
| 763 | CONFIGURE_OBJECT_TABLE_STUFF + \ |
---|
| 764 | NAME_MAX ) ) |
---|
| 765 | |
---|
| 766 | #define CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS(_rwlocks) \ |
---|
| 767 | ((_rwlocks) * \ |
---|
| 768 | ( sizeof( POSIX_RWLock_Control) + \ |
---|
| 769 | CONFIGURE_OBJECT_TABLE_STUFF + \ |
---|
| 770 | NAME_MAX ) ) |
---|
| 771 | |
---|
[308aed9b] | 772 | #define CONFIGURE_MEMORY_FOR_POSIX \ |
---|
| 773 | ( \ |
---|
| 774 | CONFIGURE_MEMORY_FOR_POSIX_MUTEXES( CONFIGURE_MAXIMUM_POSIX_MUTEXES ) + \ |
---|
| 775 | CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES( \ |
---|
| 776 | CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES ) + \ |
---|
| 777 | CONFIGURE_MEMORY_FOR_POSIX_KEYS( CONFIGURE_MAXIMUM_POSIX_KEYS ) + \ |
---|
| 778 | CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS( \ |
---|
[16775a5] | 779 | CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS ) + \ |
---|
[be0fc099] | 780 | CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES( \ |
---|
| 781 | CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES ) + \ |
---|
| 782 | CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES( \ |
---|
| 783 | CONFIGURE_MAXIMUM_POSIX_SEMAPHORES ) + \ |
---|
[7fa1ce86] | 784 | CONFIGURE_MEMORY_FOR_POSIX_BARRIERS( CONFIGURE_MAXIMUM_POSIX_BARRIERS ) + \ |
---|
| 785 | CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS( \ |
---|
| 786 | CONFIGURE_MAXIMUM_POSIX_SPINLOCKS ) + \ |
---|
| 787 | CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS( \ |
---|
| 788 | CONFIGURE_MAXIMUM_POSIX_RWLOCKS ) + \ |
---|
[8c51e48c] | 789 | CONFIGURE_MEMORY_FOR_POSIX_TIMERS( CONFIGURE_MAXIMUM_POSIX_TIMERS ) + \ |
---|
[9583f6e] | 790 | (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE) \ |
---|
[308aed9b] | 791 | ) |
---|
| 792 | #else |
---|
| 793 | |
---|
[10b3c9b] | 794 | #define CONFIGURE_MAXIMUM_POSIX_THREADS 0 |
---|
[308aed9b] | 795 | #define CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API 0 |
---|
| 796 | #define CONFIGURE_MEMORY_FOR_POSIX 0 |
---|
| 797 | |
---|
[cc17eba] | 798 | |
---|
[5240c71c] | 799 | #endif /* RTEMS_POSIX_API */ |
---|
| 800 | |
---|
[9583f6e] | 801 | #ifndef CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE |
---|
| 802 | #define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE 0 |
---|
[cc17eba] | 803 | #endif |
---|
| 804 | |
---|
[352c9b2] | 805 | /* |
---|
| 806 | * ITRON API Configuration Parameters |
---|
| 807 | */ |
---|
| 808 | |
---|
| 809 | #ifdef RTEMS_ITRON_API |
---|
| 810 | |
---|
[ebbe119e] | 811 | #include <rtems/itron.h> |
---|
[352c9b2] | 812 | #include <rtems/itron/config.h> |
---|
| 813 | #include <rtems/itron/eventflags.h> |
---|
| 814 | #include <rtems/itron/fmempool.h> |
---|
| 815 | #include <rtems/itron/mbox.h> |
---|
| 816 | #include <rtems/itron/msgbuffer.h> |
---|
| 817 | #include <rtems/itron/port.h> |
---|
| 818 | #include <rtems/itron/semaphore.h> |
---|
| 819 | #include <rtems/itron/task.h> |
---|
| 820 | #include <rtems/itron/vmempool.h> |
---|
| 821 | |
---|
| 822 | #ifndef CONFIGURE_MAXIMUM_ITRON_TASKS |
---|
[df49c60] | 823 | #define CONFIGURE_MAXIMUM_ITRON_TASKS 0 |
---|
[352c9b2] | 824 | #endif |
---|
| 825 | |
---|
| 826 | #ifndef CONFIGURE_MAXIMUM_ITRON_SEMAPHORES |
---|
| 827 | #define CONFIGURE_MAXIMUM_ITRON_SEMAPHORES 0 |
---|
| 828 | #endif |
---|
| 829 | |
---|
| 830 | #ifndef CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS |
---|
| 831 | #define CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS 0 |
---|
| 832 | #endif |
---|
| 833 | |
---|
| 834 | #ifndef CONFIGURE_MAXIMUM_ITRON_MAILBOXES |
---|
| 835 | #define CONFIGURE_MAXIMUM_ITRON_MAILBOXES 0 |
---|
| 836 | #endif |
---|
| 837 | |
---|
| 838 | #ifndef CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS |
---|
| 839 | #define CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS 0 |
---|
| 840 | #endif |
---|
| 841 | |
---|
| 842 | #ifndef CONFIGURE_MAXIMUM_ITRON_PORTS |
---|
| 843 | #define CONFIGURE_MAXIMUM_ITRON_PORTS 0 |
---|
| 844 | #endif |
---|
| 845 | |
---|
| 846 | #ifndef CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS |
---|
| 847 | #define CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS 0 |
---|
| 848 | #endif |
---|
| 849 | |
---|
| 850 | #ifndef CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS |
---|
| 851 | #define CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS 0 |
---|
| 852 | #endif |
---|
| 853 | |
---|
| 854 | #ifdef CONFIGURE_ITRON_INIT_TASK_TABLE |
---|
| 855 | |
---|
| 856 | #ifdef CONFIGURE_ITRON_HAS_OWN_INIT_TASK_TABLE |
---|
| 857 | |
---|
| 858 | /* |
---|
| 859 | * The user is defining their own table information and setting the |
---|
[df49c60] | 860 | * appropriate variables for the ITRON Initialization Task Table. |
---|
[352c9b2] | 861 | */ |
---|
| 862 | |
---|
| 863 | #else |
---|
| 864 | |
---|
| 865 | #ifndef CONFIGURE_ITRON_INIT_TASK_ENTRY_POINT |
---|
| 866 | #define CONFIGURE_ITRON_INIT_TASK_ENTRY_POINT ITRON_Init |
---|
| 867 | #endif |
---|
| 868 | |
---|
| 869 | #ifndef CONFIGURE_ITRON_INIT_TASK_ATTRIBUTES |
---|
| 870 | #define CONFIGURE_ITRON_INIT_TASK_ATTRIBUTES TA_HLNG |
---|
| 871 | #endif |
---|
| 872 | |
---|
| 873 | #ifndef CONFIGURE_ITRON_INIT_TASK_PRIORITY |
---|
| 874 | #define CONFIGURE_ITRON_INIT_TASK_PRIORITY 1 |
---|
| 875 | #endif |
---|
| 876 | |
---|
| 877 | #ifndef CONFIGURE_ITRON_INIT_TASK_STACK_SIZE |
---|
| 878 | #define CONFIGURE_ITRON_INIT_TASK_STACK_SIZE RTEMS_MINIMUM_STACK_SIZE |
---|
| 879 | #endif |
---|
| 880 | |
---|
| 881 | #ifdef CONFIGURE_INIT |
---|
| 882 | itron_initialization_tasks_table ITRON_Initialization_tasks[] = { |
---|
| 883 | { 1, /* ID */ |
---|
| 884 | { (VP) 0, /* exinfo */ |
---|
| 885 | CONFIGURE_ITRON_INIT_TASK_ATTRIBUTES, /* task attributes */ |
---|
| 886 | CONFIGURE_ITRON_INIT_TASK_ENTRY_POINT, /* task start address */ |
---|
| 887 | CONFIGURE_ITRON_INIT_TASK_PRIORITY, /* initial task priority */ |
---|
| 888 | CONFIGURE_ITRON_INIT_TASK_STACK_SIZE /* stack size */ |
---|
| 889 | } |
---|
| 890 | } |
---|
| 891 | }; |
---|
| 892 | #endif |
---|
| 893 | |
---|
| 894 | #define CONFIGURE_ITRON_INIT_TASK_TABLE_NAME ITRON_Initialization_tasks |
---|
| 895 | |
---|
| 896 | #define CONFIGURE_ITRON_INIT_TASK_TABLE_SIZE \ |
---|
| 897 | sizeof(CONFIGURE_ITRON_INIT_TASK_TABLE_NAME) / \ |
---|
| 898 | sizeof(itron_initialization_tasks_table) |
---|
| 899 | |
---|
| 900 | #endif /* CONFIGURE_ITRON_HAS_OWN_INIT_TASK_TABLE */ |
---|
| 901 | |
---|
| 902 | #else /* CONFIGURE_ITRON_INIT_TASK_TABLE */ |
---|
| 903 | |
---|
| 904 | #define CONFIGURE_ITRON_INIT_TASK_TABLE_NAME NULL |
---|
| 905 | #define CONFIGURE_ITRON_INIT_TASK_TABLE_SIZE 0 |
---|
| 906 | |
---|
| 907 | #endif |
---|
| 908 | |
---|
| 909 | #define CONFIGURE_MEMORY_PER_TASK_FOR_ITRON_API \ |
---|
| 910 | ( \ |
---|
| 911 | sizeof (ITRON_API_Control) \ |
---|
| 912 | ) |
---|
| 913 | |
---|
| 914 | #define CONFIGURE_MEMORY_FOR_ITRON_SEMAPHORES(_semaphores) \ |
---|
| 915 | ((_semaphores) * \ |
---|
| 916 | ( sizeof(ITRON_Semaphore_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
| 917 | |
---|
| 918 | #define CONFIGURE_MEMORY_FOR_ITRON_EVENTFLAGS(_eventflags) \ |
---|
| 919 | ((_eventflags) * \ |
---|
| 920 | ( sizeof(ITRON_Eventflags_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
| 921 | |
---|
| 922 | #define CONFIGURE_MEMORY_FOR_ITRON_MAILBOXES(_mailboxes) \ |
---|
| 923 | ((_mailboxes) * \ |
---|
| 924 | ( sizeof(ITRON_Mailbox_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
| 925 | |
---|
| 926 | #define CONFIGURE_MEMORY_FOR_ITRON_MESSAGE_BUFFERS(_message_buffers) \ |
---|
| 927 | ((_message_buffers) * \ |
---|
| 928 | ( sizeof(ITRON_Message_buffer_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
| 929 | |
---|
| 930 | #define CONFIGURE_MEMORY_FOR_ITRON_PORTS(_ports) \ |
---|
| 931 | ((_ports) * \ |
---|
| 932 | ( sizeof(ITRON_Port_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
| 933 | |
---|
| 934 | #define CONFIGURE_MEMORY_FOR_ITRON_MEMORY_POOLS(_memory_pools) \ |
---|
| 935 | ((_memory_pools) * \ |
---|
| 936 | (sizeof(ITRON_Variable_memory_pool_Control) + CONFIGURE_OBJECT_TABLE_STUFF)) |
---|
| 937 | |
---|
| 938 | #define CONFIGURE_MEMORY_FOR_ITRON_FIXED_MEMORY_POOLS(_fixed_memory_pools) \ |
---|
| 939 | ((_fixed_memory_pools) * \ |
---|
| 940 | ( sizeof(ITRON_Fixed_memory_pool_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
| 941 | |
---|
[399c2e5d] | 942 | #ifndef CONFIGURE_ITRON_INIT_TASK_STACK_SIZE |
---|
| 943 | #define CONFIGURE_ITRON_INIT_TASK_STACK_SIZE (RTEMS_MINIMUM_STACK_SIZE * 2) |
---|
[352c9b2] | 944 | #endif |
---|
| 945 | |
---|
| 946 | |
---|
| 947 | #define CONFIGURE_MEMORY_FOR_ITRON \ |
---|
| 948 | ( \ |
---|
| 949 | CONFIGURE_MEMORY_FOR_ITRON_SEMAPHORES( \ |
---|
| 950 | CONFIGURE_MAXIMUM_ITRON_SEMAPHORES ) + \ |
---|
| 951 | CONFIGURE_MEMORY_FOR_ITRON_EVENTFLAGS( \ |
---|
| 952 | CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS ) + \ |
---|
| 953 | CONFIGURE_MEMORY_FOR_ITRON_MAILBOXES( \ |
---|
| 954 | CONFIGURE_MAXIMUM_ITRON_MAILBOXES ) + \ |
---|
| 955 | CONFIGURE_MEMORY_FOR_ITRON_MESSAGE_BUFFERS( \ |
---|
| 956 | CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS ) + \ |
---|
| 957 | CONFIGURE_MEMORY_FOR_ITRON_PORTS( \ |
---|
| 958 | CONFIGURE_MAXIMUM_ITRON_PORTS ) + \ |
---|
| 959 | CONFIGURE_MEMORY_FOR_ITRON_MEMORY_POOLS( \ |
---|
| 960 | CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS ) + \ |
---|
| 961 | CONFIGURE_MEMORY_FOR_ITRON_FIXED_MEMORY_POOLS( \ |
---|
| 962 | CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS ) + \ |
---|
[399c2e5d] | 963 | CONFIGURE_ITRON_INIT_TASK_STACK_SIZE \ |
---|
[352c9b2] | 964 | ) |
---|
| 965 | |
---|
| 966 | |
---|
| 967 | #else |
---|
| 968 | |
---|
| 969 | #define CONFIGURE_MAXIMUM_ITRON_TASKS 0 |
---|
| 970 | #define CONFIGURE_MAXIMUM_ITRON_SEMAPHORES 0 |
---|
| 971 | #define CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS 0 |
---|
| 972 | #define CONFIGURE_MAXIMUM_ITRON_MAILBOXES 0 |
---|
| 973 | #define CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS 0 |
---|
| 974 | #define CONFIGURE_MAXIMUM_ITRON_PORTS 0 |
---|
| 975 | #define CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS 0 |
---|
| 976 | #define CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS 0 |
---|
| 977 | #define CONFIGURE_MEMORY_PER_TASK_FOR_ITRON_API 0 |
---|
| 978 | #define CONFIGURE_MEMORY_FOR_ITRON 0 |
---|
| 979 | |
---|
| 980 | #endif /* RTEMS_ITRON_API */ |
---|
| 981 | |
---|
| 982 | |
---|
[8486081] | 983 | /* |
---|
[3652ad35] | 984 | * Calculate the RAM size based on the maximum number of objects configured. |
---|
| 985 | */ |
---|
[08bae5e6] | 986 | |
---|
| 987 | #ifndef CONFIGURE_EXECUTIVE_RAM_SIZE |
---|
[3652ad35] | 988 | |
---|
| 989 | #define CONFIGURE_OBJECT_TABLE_STUFF \ |
---|
| 990 | ( sizeof(Objects_Control *) + sizeof(rtems_name *) + sizeof(rtems_name) ) |
---|
| 991 | |
---|
[b2b143f4] | 992 | #if defined(RTEMS_NEWLIB) |
---|
| 993 | #include <reent.h> |
---|
| 994 | |
---|
| 995 | #define CONFIGURE_MEMORY_PER_TASK_FOR_LIBC_REENTRANCY sizeof(struct _reent) |
---|
| 996 | #else |
---|
| 997 | #define CONFIGURE_MEMORY_PER_TASK_FOR_LIBC_REENTRANCY 0 |
---|
| 998 | #endif |
---|
| 999 | |
---|
[3652ad35] | 1000 | #define CONFIGURE_MEMORY_FOR_TASKS(_tasks) \ |
---|
[b3dcd9a2] | 1001 | (((_tasks) + 1 ) * \ |
---|
[3652ad35] | 1002 | ((sizeof(Thread_Control) + CONTEXT_FP_SIZE + \ |
---|
| 1003 | STACK_MINIMUM_SIZE + sizeof( RTEMS_API_Control ) + \ |
---|
[308aed9b] | 1004 | CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API + \ |
---|
[352c9b2] | 1005 | CONFIGURE_MEMORY_PER_TASK_FOR_ITRON_API + \ |
---|
[b2b143f4] | 1006 | CONFIGURE_MEMORY_PER_TASK_FOR_LIBC_REENTRANCY + \ |
---|
[3652ad35] | 1007 | CONFIGURE_OBJECT_TABLE_STUFF)) \ |
---|
| 1008 | ) |
---|
| 1009 | |
---|
| 1010 | #define CONFIGURE_MEMORY_FOR_TIMERS(_timers) \ |
---|
| 1011 | ((_timers) * ( sizeof(Timer_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
| 1012 | |
---|
| 1013 | #define CONFIGURE_MEMORY_FOR_SEMAPHORES(_semaphores) \ |
---|
| 1014 | ((_semaphores) * \ |
---|
| 1015 | ( sizeof(Semaphore_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
| 1016 | |
---|
| 1017 | #define CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(_queues) \ |
---|
| 1018 | ( (_queues) * \ |
---|
| 1019 | ( sizeof(Message_queue_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
| 1020 | |
---|
| 1021 | #define CONFIGURE_MEMORY_FOR_PARTITIONS(_partitions) \ |
---|
| 1022 | ( (_partitions) * \ |
---|
| 1023 | ( sizeof(Partition_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
| 1024 | |
---|
| 1025 | #define CONFIGURE_MEMORY_FOR_REGIONS(_regions) \ |
---|
| 1026 | ( (_regions) * \ |
---|
| 1027 | ( sizeof(Region_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
| 1028 | |
---|
| 1029 | #define CONFIGURE_MEMORY_FOR_PORTS(_ports) \ |
---|
| 1030 | ( (_ports) * \ |
---|
| 1031 | ( sizeof(Dual_ported_memory_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
| 1032 | |
---|
| 1033 | #define CONFIGURE_MEMORY_FOR_PERIODS(_periods) \ |
---|
| 1034 | ( (_periods) * \ |
---|
| 1035 | ( sizeof(Rate_monotonic_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
| 1036 | |
---|
[7fa1ce86] | 1037 | #define CONFIGURE_MEMORY_FOR_BARRIERS(_barriers) \ |
---|
| 1038 | ( (_barriers) * \ |
---|
| 1039 | ( sizeof(Barrier_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
| 1040 | |
---|
[3652ad35] | 1041 | #define CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(_extensions) \ |
---|
| 1042 | ( (_extensions) * \ |
---|
| 1043 | ( sizeof(Extension_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
| 1044 | |
---|
[df49c60] | 1045 | #ifdef CONFIGURE_MP_APPLICATION |
---|
[3652ad35] | 1046 | |
---|
| 1047 | #ifndef CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE |
---|
| 1048 | |
---|
| 1049 | #define CONFIGURE_MEMORY_FOR_PROXIES(_proxies) \ |
---|
| 1050 | ( ((_proxies) + 1) * ( sizeof(Thread_Proxy_control) ) ) |
---|
| 1051 | |
---|
| 1052 | #define CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS(_global_objects) \ |
---|
| 1053 | ((_global_objects) * ( sizeof(Objects_MP_Control) ) ) |
---|
| 1054 | |
---|
| 1055 | #define CONFIGURE_MEMORY_FOR_MP \ |
---|
| 1056 | ( CONFIGURE_MEMORY_FOR_PROXIES(CONFIGURE_MP_MAXIMUM_PROXIES) + \ |
---|
[b3dcd9a2] | 1057 | CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS(CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS) + \ |
---|
[a66186e] | 1058 | CONFIGURE_MEMORY_FOR_TASKS(1) \ |
---|
[3652ad35] | 1059 | ) |
---|
| 1060 | |
---|
| 1061 | #endif /* CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE */ |
---|
| 1062 | |
---|
| 1063 | #else |
---|
| 1064 | |
---|
| 1065 | #define CONFIGURE_MEMORY_FOR_MP 0 |
---|
| 1066 | |
---|
| 1067 | #endif |
---|
[3b89891] | 1068 | |
---|
[7042065] | 1069 | /* |
---|
| 1070 | * This is so we can account for tasks with stacks greater than minimum |
---|
| 1071 | * size. This is in bytes. |
---|
| 1072 | */ |
---|
[308aed9b] | 1073 | #ifndef CONFIGURE_EXTRA_TASK_STACKS |
---|
| 1074 | #define CONFIGURE_EXTRA_TASK_STACKS 0 |
---|
| 1075 | #endif |
---|
| 1076 | |
---|
[7042065] | 1077 | /* |
---|
| 1078 | * Account for pending message buffers in bytes. |
---|
| 1079 | */ |
---|
| 1080 | #ifndef CONFIGURE_MESSAGE_BUFFER_MEMORY |
---|
| 1081 | #define CONFIGURE_MESSAGE_BUFFER_MEMORY 0 |
---|
| 1082 | #endif |
---|
| 1083 | |
---|
| 1084 | /* |
---|
| 1085 | * Catch all for extra memory in case something broken and underestimates. |
---|
| 1086 | * Historically this was used for message buffers. |
---|
| 1087 | */ |
---|
| 1088 | #ifndef CONFIGURE_MEMORY_OVERHEAD |
---|
| 1089 | #define CONFIGURE_MEMORY_OVERHEAD 0 |
---|
| 1090 | #endif |
---|
| 1091 | |
---|
[b2b143f4] | 1092 | #define CONFIGURE_API_MUTEX_MEMORY \ |
---|
| 1093 | ( (1) * \ |
---|
| 1094 | ( sizeof(API_Mutex_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) \ |
---|
[8486081] | 1095 | ) |
---|
[b2b143f4] | 1096 | |
---|
[df49c60] | 1097 | #define CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD \ |
---|
[7a03c09b] | 1098 | ( CONFIGURE_MEMORY_FOR_TASKS(1) + /* IDLE */ \ |
---|
| 1099 | ((PRIORITY_MAXIMUM+1) * sizeof(Chain_Control)) + /* Ready chains */ \ |
---|
| 1100 | 256 + /* name/ptr table overhead */ \ |
---|
| 1101 | CONFIGURE_INTERRUPT_STACK_MEMORY + /* interrupt stack */ \ |
---|
| 1102 | CONFIGURE_API_MUTEX_MEMORY /* allocation mutex */ \ |
---|
[b3dcd9a2] | 1103 | ) |
---|
| 1104 | |
---|
[399c2e5d] | 1105 | /* |
---|
| 1106 | * Now account for any extra memory that initialization tasks or threads |
---|
| 1107 | * may have requested. |
---|
| 1108 | */ |
---|
| 1109 | |
---|
| 1110 | #ifdef RTEMS_POSIX_API |
---|
| 1111 | #define CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART \ |
---|
| 1112 | (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE - RTEMS_MINIMUM_STACK_SIZE) |
---|
| 1113 | #else |
---|
| 1114 | #define CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART 0 |
---|
| 1115 | #endif |
---|
| 1116 | #ifdef RTEMS_ITRON_API |
---|
| 1117 | #define CONFIGURE_INITIALIZATION_THREADS_STACKS_ITRON_PART \ |
---|
| 1118 | (CONFIGURE_ITRON_INIT_TASK_STACK_SIZE - RTEMS_MINIMUM_STACK_SIZE) |
---|
| 1119 | #else |
---|
| 1120 | #define CONFIGURE_INITIALIZATION_THREADS_STACKS_ITRON_PART 0 |
---|
| 1121 | #endif |
---|
| 1122 | |
---|
[563ed95] | 1123 | #define CONFIGURE_INITIALIZATION_THREADS_STACKS \ |
---|
| 1124 | ((CONFIGURE_INIT_TASK_STACK_SIZE - RTEMS_MINIMUM_STACK_SIZE) + \ |
---|
[399c2e5d] | 1125 | CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART + \ |
---|
| 1126 | CONFIGURE_INITIALIZATION_THREADS_STACKS_ITRON_PART) |
---|
[563ed95] | 1127 | |
---|
[7c5e3b3] | 1128 | /* |
---|
| 1129 | * POSIX Threads have a default stack size of 2x minimum. The code |
---|
| 1130 | * below CONFIGURE_MEMORY_FOR_TASKS(...) takes this into account. |
---|
| 1131 | */ |
---|
[08bae5e6] | 1132 | #define CONFIGURE_EXECUTIVE_RAM_SIZE \ |
---|
[308aed9b] | 1133 | (( CONFIGURE_MEMORY_FOR_POSIX + \ |
---|
[352c9b2] | 1134 | CONFIGURE_MEMORY_FOR_ITRON + \ |
---|
[308aed9b] | 1135 | CONFIGURE_MEMORY_FOR_TASKS(CONFIGURE_MAXIMUM_TASKS + \ |
---|
[352c9b2] | 1136 | CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_ADA_TASKS + \ |
---|
| 1137 | CONFIGURE_MAXIMUM_ITRON_TASKS ) + \ |
---|
[7c5e3b3] | 1138 | (CONFIGURE_MAXIMUM_POSIX_THREADS * RTEMS_MINIMUM_STACK_SIZE ) + \ |
---|
[563ed95] | 1139 | CONFIGURE_INITIALIZATION_THREADS_STACKS + \ |
---|
[3652ad35] | 1140 | CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS) + \ |
---|
[bd9c3d1] | 1141 | CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_MAXIMUM_SEMAPHORES + \ |
---|
[df49c60] | 1142 | CONFIGURE_LIBIO_SEMAPHORES + CONFIGURE_TERMIOS_SEMAPHORES) + \ |
---|
[3652ad35] | 1143 | CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(CONFIGURE_MAXIMUM_MESSAGE_QUEUES) + \ |
---|
| 1144 | CONFIGURE_MEMORY_FOR_PARTITIONS(CONFIGURE_MAXIMUM_PARTITIONS) + \ |
---|
[e746a88] | 1145 | CONFIGURE_MEMORY_FOR_REGIONS( CONFIGURE_MAXIMUM_REGIONS ) + \ |
---|
[3652ad35] | 1146 | CONFIGURE_MEMORY_FOR_PORTS(CONFIGURE_MAXIMUM_PORTS) + \ |
---|
| 1147 | CONFIGURE_MEMORY_FOR_PERIODS(CONFIGURE_MAXIMUM_PERIODS) + \ |
---|
[7fa1ce86] | 1148 | CONFIGURE_MEMORY_FOR_BARRIERS(CONFIGURE_MAXIMUM_BARRIERS) + \ |
---|
[3b89891] | 1149 | CONFIGURE_MEMORY_FOR_USER_EXTENSIONS( \ |
---|
[ab97da95] | 1150 | CONFIGURE_MAXIMUM_USER_EXTENSIONS + CONFIGURE_NEWLIB_EXTENSION + \ |
---|
| 1151 | CONFIGURE_STACK_CHECKER_EXTENSION ) + \ |
---|
[3652ad35] | 1152 | CONFIGURE_MEMORY_FOR_MP + \ |
---|
[df49c60] | 1153 | CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD + \ |
---|
[7042065] | 1154 | CONFIGURE_MESSAGE_BUFFER_MEMORY + \ |
---|
| 1155 | (CONFIGURE_MEMORY_OVERHEAD * 1024) + \ |
---|
[bac7b61] | 1156 | (CONFIGURE_EXTRA_TASK_STACKS) + (CONFIGURE_ADA_TASKS_STACK) \ |
---|
[7042065] | 1157 | ) & ~0x7) |
---|
[08bae5e6] | 1158 | #endif |
---|
| 1159 | |
---|
[b61e6e1] | 1160 | #ifdef CONFIGURE_GNAT_RTEMS |
---|
| 1161 | #define CONFIGURE_GNAT_MUTEXES 10 |
---|
[6c7928b] | 1162 | /* GNAT/RTEMS provides an optimized Ada self and does not use POSIX Keys */ |
---|
| 1163 | #define CONFIGURE_GNAT_KEYS 0 |
---|
[b61e6e1] | 1164 | |
---|
| 1165 | /* 20 are required to run all tests in the ACVC */ |
---|
| 1166 | #ifndef CONFIGURE_MAXIMUM_ADA_TASKS |
---|
| 1167 | #define CONFIGURE_MAXIMUM_ADA_TASKS 20 |
---|
| 1168 | #endif |
---|
| 1169 | |
---|
[308aed9b] | 1170 | /* This is the number of non-Ada tasks which invoked Ada code. */ |
---|
| 1171 | #ifndef CONFIGURE_MAXIMUM_FAKE_ADA_TASKS |
---|
| 1172 | #define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0 |
---|
| 1173 | #endif |
---|
| 1174 | |
---|
| 1175 | /* Ada tasks are allocated twice the minimum stack space */ |
---|
| 1176 | #define CONFIGURE_ADA_TASKS_STACK \ |
---|
[bac7b61] | 1177 | (CONFIGURE_MAXIMUM_ADA_TASKS * (RTEMS_MINIMUM_STACK_SIZE + (6 * 1024))) |
---|
[308aed9b] | 1178 | |
---|
[b61e6e1] | 1179 | #else |
---|
[4f7fd59] | 1180 | #define CONFIGURE_GNAT_MUTEXES 0 |
---|
| 1181 | #define CONFIGURE_GNAT_KEYS 0 |
---|
| 1182 | #define CONFIGURE_MAXIMUM_ADA_TASKS 0 |
---|
| 1183 | #define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0 |
---|
[308aed9b] | 1184 | #define CONFIGURE_ADA_TASKS_STACK 0 |
---|
[b61e6e1] | 1185 | #endif |
---|
| 1186 | |
---|
| 1187 | |
---|
[08bae5e6] | 1188 | #ifdef CONFIGURE_INIT |
---|
[e6d4b1d] | 1189 | |
---|
| 1190 | rtems_api_configuration_table Configuration_RTEMS_API = { |
---|
[08bae5e6] | 1191 | CONFIGURE_MAXIMUM_TASKS, |
---|
| 1192 | CONFIGURE_MAXIMUM_TIMERS, |
---|
[df49c60] | 1193 | CONFIGURE_MAXIMUM_SEMAPHORES + CONFIGURE_LIBIO_SEMAPHORES + |
---|
| 1194 | CONFIGURE_TERMIOS_SEMAPHORES, |
---|
[08bae5e6] | 1195 | CONFIGURE_MAXIMUM_MESSAGE_QUEUES, |
---|
| 1196 | CONFIGURE_MAXIMUM_PARTITIONS, |
---|
[e746a88] | 1197 | CONFIGURE_MAXIMUM_REGIONS, |
---|
[08bae5e6] | 1198 | CONFIGURE_MAXIMUM_PORTS, |
---|
| 1199 | CONFIGURE_MAXIMUM_PERIODS, |
---|
[7fa1ce86] | 1200 | CONFIGURE_MAXIMUM_BARRIERS, |
---|
[d9a0689e] | 1201 | CONFIGURE_INIT_TASK_TABLE_SIZE, |
---|
| 1202 | CONFIGURE_INIT_TASK_TABLE |
---|
[e6d4b1d] | 1203 | }; |
---|
| 1204 | |
---|
[2eba45d] | 1205 | #ifdef RTEMS_POSIX_API |
---|
| 1206 | posix_api_configuration_table Configuration_POSIX_API = { |
---|
[b61e6e1] | 1207 | CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_ADA_TASKS, |
---|
[4f7fd59] | 1208 | CONFIGURE_MAXIMUM_POSIX_MUTEXES + CONFIGURE_GNAT_MUTEXES + |
---|
| 1209 | CONFIGURE_MAXIMUM_ADA_TASKS + CONFIGURE_MAXIMUM_FAKE_ADA_TASKS, |
---|
| 1210 | CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES + |
---|
| 1211 | CONFIGURE_MAXIMUM_ADA_TASKS + CONFIGURE_MAXIMUM_FAKE_ADA_TASKS, |
---|
| 1212 | CONFIGURE_MAXIMUM_POSIX_KEYS + CONFIGURE_GNAT_KEYS, |
---|
[0747e2d] | 1213 | CONFIGURE_MAXIMUM_POSIX_TIMERS, |
---|
[eb0551f] | 1214 | CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS, |
---|
[be0fc099] | 1215 | CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES, |
---|
| 1216 | CONFIGURE_MAXIMUM_POSIX_SEMAPHORES, |
---|
[7fa1ce86] | 1217 | CONFIGURE_MAXIMUM_POSIX_BARRIERS, |
---|
| 1218 | CONFIGURE_MAXIMUM_POSIX_RWLOCKS, |
---|
| 1219 | CONFIGURE_MAXIMUM_POSIX_SPINLOCKS, |
---|
[be1c11ed] | 1220 | CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE, |
---|
| 1221 | CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME |
---|
[2eba45d] | 1222 | }; |
---|
| 1223 | #endif |
---|
| 1224 | |
---|
[352c9b2] | 1225 | #ifdef RTEMS_ITRON_API |
---|
| 1226 | itron_api_configuration_table Configuration_ITRON_API = { |
---|
| 1227 | CONFIGURE_MAXIMUM_ITRON_TASKS, |
---|
| 1228 | CONFIGURE_MAXIMUM_ITRON_SEMAPHORES, |
---|
| 1229 | CONFIGURE_MAXIMUM_ITRON_EVENTFLAGS, |
---|
| 1230 | CONFIGURE_MAXIMUM_ITRON_MAILBOXES, |
---|
| 1231 | CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS, |
---|
| 1232 | CONFIGURE_MAXIMUM_ITRON_PORTS, |
---|
| 1233 | CONFIGURE_MAXIMUM_ITRON_MEMORY_POOLS, |
---|
| 1234 | CONFIGURE_MAXIMUM_ITRON_FIXED_MEMORY_POOLS, |
---|
| 1235 | CONFIGURE_ITRON_INIT_TASK_TABLE_SIZE, |
---|
| 1236 | CONFIGURE_ITRON_INIT_TASK_TABLE_NAME |
---|
| 1237 | }; |
---|
| 1238 | #endif |
---|
| 1239 | |
---|
[e6d4b1d] | 1240 | rtems_configuration_table Configuration = { |
---|
| 1241 | CONFIGURE_EXECUTIVE_RAM_WORK_AREA, |
---|
[976162a6] | 1242 | CONFIGURE_EXECUTIVE_RAM_SIZE, /* required RTEMS workspace */ |
---|
[8486081] | 1243 | CONFIGURE_MAXIMUM_USER_EXTENSIONS + CONFIGURE_NEWLIB_EXTENSION + |
---|
[976162a6] | 1244 | CONFIGURE_STACK_CHECKER_EXTENSION, /* maximum user extensions */ |
---|
| 1245 | CONFIGURE_MICROSECONDS_PER_TICK, /* microseconds per clock tick */ |
---|
| 1246 | CONFIGURE_TICKS_PER_TIMESLICE, /* ticks per timeslice quantum */ |
---|
| 1247 | CONFIGURE_IDLE_TASK_BODY, /* user's IDLE task */ |
---|
| 1248 | CONFIGURE_IDLE_TASK_STACK_SIZE, /* IDLE task stack size */ |
---|
| 1249 | CONFIGURE_TASK_STACK_ALLOCATOR, /* stack allocator */ |
---|
| 1250 | CONFIGURE_TASK_STACK_DEALLOCATOR, /* stack deallocator */ |
---|
| 1251 | CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY, /* true to clear memory */ |
---|
| 1252 | CONFIGURE_MAXIMUM_DRIVERS, /* maximum device drivers */ |
---|
| 1253 | CONFIGURE_NUMBER_OF_DRIVERS, /* static device drivers */ |
---|
[08bae5e6] | 1254 | Device_drivers, /* pointer to driver table */ |
---|
[0451b44] | 1255 | CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS, /* number of initial extensions */ |
---|
[96e6a86c] | 1256 | CONFIGURE_INITIAL_EXTENSION_TABLE, /* pointer to initial extensions */ |
---|
[976162a6] | 1257 | #if defined(RTEMS_MULTIPROCESSING) |
---|
[e6d4b1d] | 1258 | CONFIGURE_MULTIPROCESSING_TABLE, /* pointer to MP config table */ |
---|
[976162a6] | 1259 | #endif |
---|
[e6d4b1d] | 1260 | &Configuration_RTEMS_API, /* pointer to RTEMS API config */ |
---|
[2eba45d] | 1261 | #ifdef RTEMS_POSIX_API |
---|
[352c9b2] | 1262 | &Configuration_POSIX_API, /* pointer to POSIX API config */ |
---|
| 1263 | #else |
---|
| 1264 | NULL, /* pointer to POSIX API config */ |
---|
| 1265 | #endif |
---|
| 1266 | #ifdef RTEMS_ITRON_API |
---|
| 1267 | &Configuration_ITRON_API /* pointer to ITRON API config */ |
---|
[2eba45d] | 1268 | #else |
---|
[352c9b2] | 1269 | NULL /* pointer to ITRON API config */ |
---|
[2eba45d] | 1270 | #endif |
---|
[08bae5e6] | 1271 | }; |
---|
| 1272 | #endif |
---|
| 1273 | |
---|
| 1274 | #endif /* CONFIGURE_HAS_OWN_CONFIGURATION_TABLE */ |
---|
| 1275 | |
---|
[0ab34c90] | 1276 | /* |
---|
| 1277 | * If the user has configured a set of Classic API Initialization Tasks, |
---|
| 1278 | * then we need to install the code that runs that loop. |
---|
| 1279 | */ |
---|
| 1280 | #ifdef CONFIGURE_INIT |
---|
| 1281 | #ifdef CONFIGURE_RTEMS_INIT_TASKS_TABLE |
---|
| 1282 | void (_RTEMS_tasks_Initialize_user_tasks_body)(void); |
---|
| 1283 | void (*_RTEMS_tasks_Initialize_user_tasks_p)(void) = |
---|
| 1284 | _RTEMS_tasks_Initialize_user_tasks_body; |
---|
| 1285 | #else |
---|
| 1286 | void (*_RTEMS_tasks_Initialize_user_tasks_p)(void) = NULL; |
---|
| 1287 | #endif |
---|
| 1288 | #endif |
---|
| 1289 | |
---|
| 1290 | /* |
---|
| 1291 | * If the user has configured a set of POSIX Initialization Threads, |
---|
| 1292 | * then we need to install the code that runs that loop. |
---|
| 1293 | */ |
---|
[5a8bc44] | 1294 | #ifdef RTEMS_POSIX_API |
---|
| 1295 | #ifdef CONFIGURE_INIT |
---|
| 1296 | #ifdef CONFIGURE_POSIX_INIT_THREAD_TABLE |
---|
| 1297 | void _POSIX_Threads_Initialize_user_threads_body(void); |
---|
| 1298 | void (*_POSIX_Threads_Initialize_user_threads_p)(void) = |
---|
| 1299 | _POSIX_Threads_Initialize_user_threads_body; |
---|
| 1300 | #else |
---|
| 1301 | void (*_POSIX_Threads_Initialize_user_threads_p)(void) = NULL; |
---|
| 1302 | #endif |
---|
[0ab34c90] | 1303 | #endif |
---|
| 1304 | #endif |
---|
| 1305 | |
---|
| 1306 | /* |
---|
| 1307 | * If the user has configured a set of ITRON Initialization Tasks, |
---|
| 1308 | * then we need to install the code that runs that loop. |
---|
| 1309 | */ |
---|
[5a8bc44] | 1310 | #ifdef RTEMS_ITRON_API |
---|
| 1311 | #ifdef CONFIGURE_INIT |
---|
| 1312 | #ifdef CONFIGURE_ITRON_INIT_TASK_TABLE |
---|
| 1313 | void _ITRON_Task_Initialize_user_tasks_body(void); |
---|
| 1314 | void (*_ITRON_Initialize_user_tasks_p)(void) = |
---|
| 1315 | _ITRON_Task_Initialize_user_tasks_body; |
---|
| 1316 | #else |
---|
| 1317 | void (*_ITRON_Initialize_user_tasks_p)(void) = NULL; |
---|
| 1318 | #endif |
---|
[0ab34c90] | 1319 | #endif |
---|
| 1320 | #endif |
---|
| 1321 | |
---|
[08bae5e6] | 1322 | #ifdef __cplusplus |
---|
| 1323 | } |
---|
| 1324 | #endif |
---|
[8486081] | 1325 | |
---|
[df49c60] | 1326 | /* |
---|
| 1327 | * Some warnings and error checking |
---|
| 1328 | */ |
---|
| 1329 | |
---|
| 1330 | /* |
---|
| 1331 | * Make sure a task/thread of some sort is configured |
---|
| 1332 | */ |
---|
| 1333 | |
---|
| 1334 | #if (CONFIGURE_MAXIMUM_TASKS == 0) && \ |
---|
| 1335 | (CONFIGURE_MAXIMUM_POSIX_THREADS == 0) && \ |
---|
| 1336 | (CONFIGURE_MAXIMUM_ADA_TASKS == 0) && \ |
---|
| 1337 | (CONFIGURE_MAXIMUM_ITRON_TASKS == 0) |
---|
[168ba07] | 1338 | #error "CONFIGURATION ERROR: No tasks or threads configured!!" |
---|
[df49c60] | 1339 | #endif |
---|
| 1340 | |
---|
| 1341 | /* |
---|
| 1342 | * Make sure at least one of the initialization task/thread |
---|
| 1343 | * tables was defined. |
---|
| 1344 | */ |
---|
| 1345 | |
---|
| 1346 | #if !defined(CONFIGURE_RTEMS_INIT_TASKS_TABLE) && \ |
---|
| 1347 | !defined(CONFIGURE_POSIX_INIT_THREAD_TABLE) && \ |
---|
| 1348 | !defined(CONFIGURE_ITRON_INIT_TASK_TABLE) |
---|
[168ba07] | 1349 | #error "CONFIGURATION ERROR: No initialization tasks or threads configured!!" |
---|
[df49c60] | 1350 | #endif |
---|
| 1351 | |
---|
[0ab34c90] | 1352 | /* |
---|
| 1353 | * These names have been obsoleted so make the user application stop compiling |
---|
| 1354 | */ |
---|
| 1355 | #if defined(CONFIGURE_TEST_NEEDS_TIMER_DRIVER) || \ |
---|
| 1356 | defined(CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER) || \ |
---|
| 1357 | defined(CONFIGURE_TEST_NEEDS_CLOCK_DRIVER) || \ |
---|
| 1358 | defined(CONFIGURE_TEST_NEEDS_RTC_DRIVER) || \ |
---|
| 1359 | defined(CONFIGURE_TEST_NEEDS_STUB_DRIVER) |
---|
| 1360 | #error "CONFIGURATION ERROR: CONFIGURE_TEST_XXX constants are obsolete" |
---|
| 1361 | #endif |
---|
| 1362 | |
---|
| 1363 | |
---|
[08bae5e6] | 1364 | #endif |
---|
| 1365 | /* end of include file */ |
---|