[08bae5e6] | 1 | /* confdefs.h |
---|
| 2 | * |
---|
| 3 | * This include file contains the configuration table template that will |
---|
| 4 | * be used by the single processor tests to define its default configuration |
---|
| 5 | * parameters. |
---|
| 6 | * |
---|
[60b791ad] | 7 | * COPYRIGHT (c) 1989-1998. |
---|
[08bae5e6] | 8 | * On-Line Applications Research Corporation (OAR). |
---|
[03f2154e] | 9 | * Copyright assigned to U.S. Government, 1994. |
---|
[08bae5e6] | 10 | * |
---|
[98e4ebf5] | 11 | * The license and distribution terms for this file may be |
---|
| 12 | * found in the file LICENSE in this distribution or at |
---|
[03f2154e] | 13 | * http://www.OARcorp.com/rtems/license.html. |
---|
[08bae5e6] | 14 | * |
---|
| 15 | * $Id$ |
---|
| 16 | */ |
---|
| 17 | |
---|
| 18 | #ifndef __CONFIGURATION_TEMPLATE_h |
---|
| 19 | #define __CONFIGURATION_TEMPLATE_h |
---|
| 20 | |
---|
| 21 | #ifdef __cplusplus |
---|
| 22 | extern "C" { |
---|
| 23 | #endif |
---|
| 24 | |
---|
| 25 | extern rtems_initialization_tasks_table Initialization_tasks[]; |
---|
| 26 | extern rtems_driver_address_table Device_drivers[]; |
---|
| 27 | extern rtems_configuration_table Configuration; |
---|
| 28 | extern rtems_multiprocessing_table Multiprocessing_configuration; |
---|
[2eba45d] | 29 | #ifdef RTEMS_POSIX_API |
---|
[be1c11ed] | 30 | extern posix_api_configuration_table Configuration_POSIX_API; |
---|
[2eba45d] | 31 | #endif |
---|
[08bae5e6] | 32 | |
---|
[3b89891] | 33 | /* |
---|
| 34 | * RTEMS C Library and Newlib support |
---|
| 35 | * |
---|
| 36 | * NOTE: This ends up defining these even when newlib is not used. |
---|
| 37 | */ |
---|
| 38 | |
---|
| 39 | #define CONFIGURE_NEWLIB_EXTENSION 1 |
---|
| 40 | #define CONFIGURE_MALLOC_REGION 1 |
---|
| 41 | |
---|
[bd9c3d1] | 42 | #ifndef CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS |
---|
| 43 | #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 20 |
---|
| 44 | #endif |
---|
| 45 | |
---|
| 46 | #define CONFIGURE_LIBIO_SEMAPHORES \ |
---|
| 47 | (CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS + 1) |
---|
| 48 | |
---|
[43908825] | 49 | #ifdef CONFIGURE_INIT |
---|
| 50 | unsigned32 rtems_libio_number_iops = CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS; |
---|
| 51 | #endif |
---|
| 52 | |
---|
[ab97da95] | 53 | /* |
---|
| 54 | * Stack Checker Requirements |
---|
| 55 | */ |
---|
| 56 | |
---|
| 57 | #ifdef STACK_CHECKER_ON |
---|
| 58 | #define CONFIGURE_STACK_CHECKER_EXTENSION 1 |
---|
| 59 | #else |
---|
| 60 | #define CONFIGURE_STACK_CHECKER_EXTENSION 0 |
---|
| 61 | #endif |
---|
| 62 | |
---|
[01a4990] | 63 | /* |
---|
| 64 | * Interrupt Stack Space |
---|
| 65 | */ |
---|
| 66 | |
---|
| 67 | #if (CPU_ALLOCATE_INTERRUPT_STACK) |
---|
| 68 | #define CONFIGURE_INTERRUPT_STACK_MEMORY RTEMS_MINIMUM_STACK_SIZE |
---|
| 69 | #else |
---|
| 70 | #define CONFIGURE_INTERRUPT_STACK_MEMORY 0 |
---|
| 71 | #endif |
---|
| 72 | |
---|
[08bae5e6] | 73 | /* |
---|
| 74 | * Default User Initialization Task Table. This table guarantees that |
---|
| 75 | * one user initialization table is defined. |
---|
| 76 | */ |
---|
| 77 | |
---|
[be1c11ed] | 78 | #ifdef CONFIGURE_RTEMS_INIT_TASKS_TABLE |
---|
| 79 | |
---|
| 80 | #ifdef CONFIGURE_HAS_OWN_INIT_TASK_TABLE |
---|
| 81 | |
---|
| 82 | /* |
---|
| 83 | * The user is defining their own table information and setting the |
---|
| 84 | * appropriate variables. |
---|
| 85 | */ |
---|
| 86 | |
---|
| 87 | #else |
---|
[08bae5e6] | 88 | |
---|
| 89 | #ifndef CONFIGURE_INIT_TASK_NAME |
---|
| 90 | #define CONFIGURE_INIT_TASK_NAME rtems_build_name( 'U', 'I', '1', ' ' ) |
---|
| 91 | #endif |
---|
| 92 | |
---|
| 93 | #ifndef CONFIGURE_INIT_TASK_STACK_SIZE |
---|
| 94 | #define CONFIGURE_INIT_TASK_STACK_SIZE RTEMS_MINIMUM_STACK_SIZE |
---|
| 95 | #endif |
---|
| 96 | |
---|
| 97 | #ifndef CONFIGURE_INIT_TASK_PRIORITY |
---|
| 98 | #define CONFIGURE_INIT_TASK_PRIORITY 1 |
---|
| 99 | #endif |
---|
| 100 | |
---|
| 101 | #ifndef CONFIGURE_INIT_TASK_ATTRIBUTES |
---|
| 102 | #define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_DEFAULT_ATTRIBUTES |
---|
| 103 | #endif |
---|
| 104 | |
---|
| 105 | #ifndef CONFIGURE_INIT_TASK_ENTRY_POINT |
---|
| 106 | #define CONFIGURE_INIT_TASK_ENTRY_POINT Init |
---|
| 107 | #endif |
---|
| 108 | |
---|
| 109 | #ifndef CONFIGURE_INIT_TASK_INITIAL_MODES |
---|
| 110 | #define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_NO_PREEMPT |
---|
| 111 | #endif |
---|
| 112 | |
---|
| 113 | #ifndef CONFIGURE_INIT_TASK_ARGUMENTS |
---|
| 114 | #define CONFIGURE_INIT_TASK_ARGUMENTS 0 |
---|
| 115 | #endif |
---|
| 116 | |
---|
| 117 | #ifdef CONFIGURE_INIT |
---|
| 118 | rtems_initialization_tasks_table Initialization_tasks[] = { |
---|
| 119 | { CONFIGURE_INIT_TASK_NAME, |
---|
| 120 | CONFIGURE_INIT_TASK_STACK_SIZE, |
---|
| 121 | CONFIGURE_INIT_TASK_PRIORITY, |
---|
| 122 | CONFIGURE_INIT_TASK_ATTRIBUTES, |
---|
| 123 | CONFIGURE_INIT_TASK_ENTRY_POINT, |
---|
| 124 | CONFIGURE_INIT_TASK_INITIAL_MODES, |
---|
| 125 | CONFIGURE_INIT_TASK_ARGUMENTS |
---|
| 126 | } |
---|
| 127 | }; |
---|
| 128 | #endif |
---|
| 129 | |
---|
[d9a0689e] | 130 | #define CONFIGURE_INIT_TASK_TABLE Initialization_tasks |
---|
| 131 | |
---|
| 132 | #define CONFIGURE_INIT_TASK_TABLE_SIZE \ |
---|
| 133 | sizeof(CONFIGURE_INIT_TASK_TABLE) / sizeof(rtems_initialization_tasks_table) |
---|
| 134 | |
---|
[be1c11ed] | 135 | #endif /* CONFIGURE_HAS_OWN_INIT_TASK_TABLE */ |
---|
| 136 | |
---|
| 137 | #else /* CONFIGURE_RTEMS_INIT_TASKS_TABLE */ |
---|
| 138 | |
---|
| 139 | #define CONFIGURE_INIT_TASK_TABLE NULL |
---|
| 140 | #define CONFIGURE_INIT_TASK_TABLE_SIZE 0 |
---|
| 141 | |
---|
[08bae5e6] | 142 | #endif |
---|
| 143 | |
---|
| 144 | /* |
---|
| 145 | * Default Device Driver Table. Each driver needed by the test is explicitly |
---|
| 146 | * choosen by that test. There is always a null driver entry. |
---|
| 147 | */ |
---|
| 148 | |
---|
| 149 | #define NULL_DRIVER_TABLE_ENTRY \ |
---|
| 150 | { NULL, NULL, NULL, NULL, NULL, NULL } |
---|
| 151 | |
---|
| 152 | #ifdef CONFIGURE_TEST_NEEDS_TIMER_DRIVER |
---|
| 153 | #include <timerdrv.h> |
---|
| 154 | #endif |
---|
| 155 | |
---|
| 156 | #ifdef CONFIGURE_TEST_NEEDS_STUB_DRIVER |
---|
| 157 | #include <stubdrv.h> |
---|
| 158 | #endif |
---|
| 159 | |
---|
| 160 | #ifndef CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE |
---|
| 161 | |
---|
| 162 | #ifdef CONFIGURE_INIT |
---|
| 163 | rtems_driver_address_table Device_drivers[] = { |
---|
| 164 | #ifdef CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER |
---|
| 165 | CONSOLE_DRIVER_TABLE_ENTRY, |
---|
| 166 | #endif |
---|
| 167 | #ifdef CONFIGURE_TEST_NEEDS_CLOCK_DRIVER |
---|
| 168 | CLOCK_DRIVER_TABLE_ENTRY, |
---|
| 169 | #endif |
---|
| 170 | #ifdef CONFIGURE_TEST_NEEDS_STUB_DRIVER |
---|
| 171 | STUB_DRIVER_TABLE_ENTRY, |
---|
| 172 | #endif |
---|
| 173 | NULL_DRIVER_TABLE_ENTRY |
---|
| 174 | }; |
---|
| 175 | #endif |
---|
| 176 | |
---|
| 177 | #endif /* CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE */ |
---|
| 178 | |
---|
| 179 | /* |
---|
| 180 | * Default the number of devices per device driver. This value may be |
---|
| 181 | * overridden by the user. |
---|
| 182 | */ |
---|
| 183 | |
---|
| 184 | #ifndef CONFIGURE_HAS_OWN_NUMBER_OF_DEVICES |
---|
| 185 | |
---|
| 186 | #ifndef CONFIGURE_MAXIMUM_DEVICES |
---|
| 187 | #define CONFIGURE_MAXIMUM_DEVICES 20 |
---|
| 188 | #endif |
---|
| 189 | |
---|
| 190 | #endif /* CONFIGURE_HAS_OWN_NUMBER_OF_DEVICES */ |
---|
| 191 | |
---|
| 192 | /* |
---|
| 193 | * Default Configuration Table. This table contains the most values set in |
---|
| 194 | * the RTEMS Test Suite. Each value may be overridden within each test to |
---|
| 195 | * customize the environment. |
---|
| 196 | */ |
---|
| 197 | |
---|
| 198 | #ifdef CONFIGURE_MPTEST |
---|
| 199 | #ifndef CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE |
---|
| 200 | |
---|
| 201 | #ifndef CONFIGURE_MP_NODE_NUMBER |
---|
| 202 | #define CONFIGURE_MP_NODE_NUMBER NODE_NUMBER |
---|
| 203 | #endif |
---|
| 204 | |
---|
| 205 | #ifndef CONFIGURE_MP_MAXIMUM_NODES |
---|
| 206 | #define CONFIGURE_MP_MAXIMUM_NODES 2 |
---|
| 207 | #endif |
---|
| 208 | |
---|
| 209 | #ifndef CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS |
---|
| 210 | #define CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS 32 |
---|
| 211 | #endif |
---|
| 212 | |
---|
| 213 | #ifndef CONFIGURE_MP_MAXIMUM_PROXIES |
---|
| 214 | #define CONFIGURE_MP_MAXIMUM_PROXIES 32 |
---|
| 215 | #endif |
---|
| 216 | |
---|
| 217 | #ifndef CONFIGURE_MP_MPCI_TABLE_POINTER |
---|
| 218 | #include <mpci.h> |
---|
| 219 | #define CONFIGURE_MP_MPCI_TABLE_POINTER &MPCI_table |
---|
| 220 | #endif |
---|
| 221 | |
---|
| 222 | #ifdef CONFIGURE_INIT |
---|
| 223 | rtems_multiprocessing_table Multiprocessing_configuration = { |
---|
| 224 | CONFIGURE_MP_NODE_NUMBER, /* local node number */ |
---|
| 225 | CONFIGURE_MP_MAXIMUM_NODES, /* maximum # nodes in system */ |
---|
| 226 | CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS, /* maximum # global objects */ |
---|
| 227 | CONFIGURE_MP_MAXIMUM_PROXIES, /* maximum # proxies */ |
---|
| 228 | CONFIGURE_MP_MPCI_TABLE_POINTER /* pointer to MPCI config table */ |
---|
| 229 | }; |
---|
| 230 | #endif |
---|
| 231 | |
---|
| 232 | #define CONFIGURE_MULTIPROCESSING_TABLE &Multiprocessing_configuration |
---|
| 233 | |
---|
| 234 | #endif /* CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE */ |
---|
| 235 | |
---|
| 236 | #else |
---|
| 237 | |
---|
| 238 | #define CONFIGURE_MULTIPROCESSING_TABLE NULL |
---|
| 239 | |
---|
| 240 | #endif /* CONFIGURE_MPTEST */ |
---|
| 241 | |
---|
| 242 | /* |
---|
| 243 | * Default Configuration Table. This table contains the most values set in |
---|
| 244 | * the RTEMS Test Suite. Each value may be overridden within each test to |
---|
| 245 | * customize the environment. |
---|
| 246 | */ |
---|
| 247 | |
---|
| 248 | #ifndef CONFIGURE_HAS_OWN_CONFIGURATION_TABLE |
---|
| 249 | |
---|
| 250 | #ifndef CONFIGURE_EXECUTIVE_RAM_WORK_AREA |
---|
| 251 | #define CONFIGURE_EXECUTIVE_RAM_WORK_AREA NULL |
---|
| 252 | #endif |
---|
| 253 | |
---|
| 254 | #ifndef CONFIGURE_MAXIMUM_TASKS |
---|
| 255 | #define CONFIGURE_MAXIMUM_TASKS 10 |
---|
| 256 | #endif |
---|
| 257 | |
---|
| 258 | #ifndef CONFIGURE_MAXIMUM_TIMERS |
---|
| 259 | #define CONFIGURE_MAXIMUM_TIMERS 0 |
---|
| 260 | #endif |
---|
| 261 | |
---|
| 262 | #ifndef CONFIGURE_MAXIMUM_SEMAPHORES |
---|
| 263 | #define CONFIGURE_MAXIMUM_SEMAPHORES 0 |
---|
| 264 | #endif |
---|
| 265 | |
---|
| 266 | #ifndef CONFIGURE_MAXIMUM_MESSAGE_QUEUES |
---|
| 267 | #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 0 |
---|
| 268 | #endif |
---|
| 269 | |
---|
| 270 | #ifndef CONFIGURE_MAXIMUM_PARTITIONS |
---|
| 271 | #define CONFIGURE_MAXIMUM_PARTITIONS 0 |
---|
| 272 | #endif |
---|
| 273 | |
---|
| 274 | #ifndef CONFIGURE_MAXIMUM_REGIONS |
---|
| 275 | #define CONFIGURE_MAXIMUM_REGIONS 0 |
---|
| 276 | #endif |
---|
| 277 | |
---|
| 278 | #ifndef CONFIGURE_MAXIMUM_PORTS |
---|
| 279 | #define CONFIGURE_MAXIMUM_PORTS 0 |
---|
| 280 | #endif |
---|
| 281 | |
---|
| 282 | #ifndef CONFIGURE_MAXIMUM_PERIODS |
---|
| 283 | #define CONFIGURE_MAXIMUM_PERIODS 0 |
---|
| 284 | #endif |
---|
| 285 | |
---|
| 286 | #ifndef CONFIGURE_MAXIMUM_USER_EXTENSIONS |
---|
| 287 | #define CONFIGURE_MAXIMUM_USER_EXTENSIONS 0 |
---|
| 288 | #endif |
---|
| 289 | |
---|
| 290 | #ifndef CONFIGURE_MICROSECONDS_PER_TICK |
---|
| 291 | #define CONFIGURE_MICROSECONDS_PER_TICK RTEMS_MILLISECONDS_TO_MICROSECONDS(10) |
---|
| 292 | #endif |
---|
| 293 | |
---|
| 294 | #ifndef CONFIGURE_TICKS_PER_TIMESLICE |
---|
| 295 | #define CONFIGURE_TICKS_PER_TIMESLICE 50 |
---|
| 296 | #endif |
---|
| 297 | |
---|
[0451b44] | 298 | /* |
---|
| 299 | * Initial Extension Set |
---|
| 300 | */ |
---|
| 301 | |
---|
| 302 | #ifdef CONFIGURE_INIT |
---|
| 303 | #ifdef STACK_CHECKER_ON |
---|
| 304 | #include <stackchk.h> |
---|
| 305 | #endif |
---|
| 306 | |
---|
| 307 | rtems_extensions_table Configuration_Initial_Extensions[] = { |
---|
| 308 | #ifdef CONFIGURE_INITIAL_EXTENSIONS |
---|
| 309 | CONFIGURE_INITIAL_EXTENSIONS, |
---|
| 310 | #endif |
---|
| 311 | #ifdef STACK_CHECKER_ON |
---|
| 312 | STACK_CHECKER_EXTENSION, |
---|
| 313 | #endif |
---|
| 314 | { NULL, NULL, NULL, NULL, NULL, NULL, NULL } |
---|
| 315 | }; |
---|
| 316 | |
---|
| 317 | #define CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS \ |
---|
| 318 | ((sizeof(Configuration_Initial_Extensions) / \ |
---|
| 319 | sizeof(rtems_extensions_table)) - 1) |
---|
| 320 | |
---|
[08bae5e6] | 321 | #endif |
---|
| 322 | |
---|
[2eba45d] | 323 | /* |
---|
| 324 | * POSIX API Configuration Parameters |
---|
| 325 | */ |
---|
| 326 | |
---|
| 327 | #ifdef RTEMS_POSIX_API |
---|
| 328 | |
---|
[308aed9b] | 329 | #include <sys/types.h> |
---|
| 330 | #include <rtems/posix/cond.h> |
---|
| 331 | #include <rtems/posix/mutex.h> |
---|
| 332 | #include <rtems/posix/key.h> |
---|
| 333 | #include <rtems/posix/psignal.h> |
---|
| 334 | #include <rtems/posix/threadsup.h> |
---|
| 335 | |
---|
[2eba45d] | 336 | #ifndef CONFIGURE_MAXIMUM_POSIX_THREADS |
---|
| 337 | #define CONFIGURE_MAXIMUM_POSIX_THREADS 10 |
---|
| 338 | #endif |
---|
| 339 | |
---|
| 340 | #ifndef CONFIGURE_MAXIMUM_POSIX_MUTEXES |
---|
[da33d26] | 341 | #define CONFIGURE_MAXIMUM_POSIX_MUTEXES 0 |
---|
[2eba45d] | 342 | #endif |
---|
| 343 | |
---|
| 344 | #ifndef CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES |
---|
| 345 | #define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 0 |
---|
| 346 | #endif |
---|
| 347 | |
---|
[da33d26] | 348 | #ifndef CONFIGURE_MAXIMUM_POSIX_KEYS |
---|
| 349 | #define CONFIGURE_MAXIMUM_POSIX_KEYS 0 |
---|
| 350 | #endif |
---|
| 351 | |
---|
[eb0551f] | 352 | #ifndef CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS |
---|
| 353 | #define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS 0 |
---|
| 354 | #endif |
---|
| 355 | |
---|
[be1c11ed] | 356 | #ifdef CONFIGURE_POSIX_INIT_THREAD_TABLE |
---|
| 357 | |
---|
| 358 | #ifdef CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE |
---|
[5240c71c] | 359 | |
---|
[be1c11ed] | 360 | /* |
---|
| 361 | * The user is defining their own table information and setting the |
---|
| 362 | * appropriate variables. |
---|
| 363 | */ |
---|
| 364 | |
---|
| 365 | #else |
---|
| 366 | |
---|
| 367 | #ifndef CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT |
---|
| 368 | #define CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT POSIX_Init |
---|
[5240c71c] | 369 | #endif |
---|
| 370 | |
---|
| 371 | #ifdef CONFIGURE_INIT |
---|
[be1c11ed] | 372 | posix_initialization_threads_table POSIX_Initialization_threads[] = { |
---|
| 373 | { CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT } |
---|
[5240c71c] | 374 | }; |
---|
[2eba45d] | 375 | #endif |
---|
| 376 | |
---|
[be1c11ed] | 377 | #define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME POSIX_Initialization_threads |
---|
[5240c71c] | 378 | |
---|
[be1c11ed] | 379 | #define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE \ |
---|
| 380 | sizeof(CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME) / \ |
---|
| 381 | sizeof(posix_initialization_threads_table) |
---|
[5240c71c] | 382 | |
---|
| 383 | #endif /* CONFIGURE_POSIX_HAS_OWN_INIT_TASK_TABLE */ |
---|
| 384 | |
---|
[be1c11ed] | 385 | #else /* CONFIGURE_POSIX_INIT_THREAD_TABLE */ |
---|
| 386 | |
---|
| 387 | #define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME NULL |
---|
| 388 | #define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE 0 |
---|
| 389 | |
---|
| 390 | #endif |
---|
| 391 | |
---|
[308aed9b] | 392 | #define CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API \ |
---|
| 393 | ( \ |
---|
| 394 | sizeof (POSIX_API_Control) + \ |
---|
| 395 | (sizeof (void *) * (CONFIGURE_GNAT_KEYS + CONFIGURE_MAXIMUM_POSIX_KEYS)) \ |
---|
| 396 | ) |
---|
| 397 | |
---|
| 398 | #define CONFIGURE_MEMORY_FOR_POSIX_MUTEXES(_mutexes) \ |
---|
| 399 | ((_mutexes) * \ |
---|
| 400 | ( sizeof(POSIX_Mutex_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
| 401 | |
---|
| 402 | #define CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES(_condition_variables) \ |
---|
| 403 | ((_condition_variables) * \ |
---|
| 404 | ( sizeof(POSIX_Condition_variables_Control) + \ |
---|
| 405 | CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
| 406 | |
---|
| 407 | #define CONFIGURE_MEMORY_FOR_POSIX_KEYS(_keys) \ |
---|
| 408 | ((_keys) * \ |
---|
| 409 | ( sizeof(POSIX_Keys_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
| 410 | |
---|
| 411 | #define CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS(_queued_signals) \ |
---|
| 412 | ((_queued_signals) * \ |
---|
| 413 | ( sizeof(POSIX_signals_Siginfo_node) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
| 414 | |
---|
| 415 | |
---|
| 416 | |
---|
| 417 | #define CONFIGURE_MEMORY_FOR_POSIX \ |
---|
| 418 | ( \ |
---|
| 419 | CONFIGURE_MEMORY_FOR_POSIX_MUTEXES( CONFIGURE_MAXIMUM_POSIX_MUTEXES ) + \ |
---|
| 420 | CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES( \ |
---|
| 421 | CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES ) + \ |
---|
| 422 | CONFIGURE_MEMORY_FOR_POSIX_KEYS( CONFIGURE_MAXIMUM_POSIX_KEYS ) + \ |
---|
| 423 | CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS( \ |
---|
| 424 | CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS ) \ |
---|
| 425 | ) |
---|
| 426 | |
---|
| 427 | |
---|
| 428 | #else |
---|
| 429 | |
---|
| 430 | #define CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API 0 |
---|
| 431 | #define CONFIGURE_MEMORY_FOR_POSIX 0 |
---|
| 432 | |
---|
[5240c71c] | 433 | #endif /* RTEMS_POSIX_API */ |
---|
| 434 | |
---|
[3652ad35] | 435 | /* |
---|
| 436 | * Calculate the RAM size based on the maximum number of objects configured. |
---|
| 437 | * The model is to estimate the memory required for each configured item, |
---|
| 438 | * sum the memory requirements and insure that there is at least 32K greater |
---|
| 439 | * than that for things not directly addressed such as: |
---|
| 440 | * |
---|
| 441 | * + stacks greater than minimum size |
---|
| 442 | * + FP contexts |
---|
| 443 | * + API areas (should be optional) |
---|
| 444 | * + messages |
---|
| 445 | * + object name and local pointer table overhead |
---|
| 446 | * + per node memory requirements |
---|
| 447 | * + executive fixed requirements (including at least internal threads |
---|
| 448 | * and the Ready chains) |
---|
| 449 | * |
---|
| 450 | * NOTE: Eventually this should take into account some of the above. |
---|
| 451 | * Basically, this is a "back of the envelope" estimate for |
---|
| 452 | * memory requirements. It could be more accurate. |
---|
| 453 | */ |
---|
[08bae5e6] | 454 | |
---|
| 455 | #ifndef CONFIGURE_EXECUTIVE_RAM_SIZE |
---|
[3652ad35] | 456 | |
---|
| 457 | #define CONFIGURE_OBJECT_TABLE_STUFF \ |
---|
| 458 | ( sizeof(Objects_Control *) + sizeof(rtems_name *) + sizeof(rtems_name) ) |
---|
| 459 | |
---|
| 460 | #define CONFIGURE_MEMORY_FOR_TASKS(_tasks) \ |
---|
[b3dcd9a2] | 461 | (((_tasks) + 1 ) * \ |
---|
[3652ad35] | 462 | ((sizeof(Thread_Control) + CONTEXT_FP_SIZE + \ |
---|
| 463 | STACK_MINIMUM_SIZE + sizeof( RTEMS_API_Control ) + \ |
---|
[308aed9b] | 464 | CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API + \ |
---|
[3652ad35] | 465 | CONFIGURE_OBJECT_TABLE_STUFF)) \ |
---|
| 466 | ) |
---|
| 467 | |
---|
| 468 | #define CONFIGURE_MEMORY_FOR_TIMERS(_timers) \ |
---|
| 469 | ((_timers) * ( sizeof(Timer_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
| 470 | |
---|
| 471 | #define CONFIGURE_MEMORY_FOR_SEMAPHORES(_semaphores) \ |
---|
| 472 | ((_semaphores) * \ |
---|
| 473 | ( sizeof(Semaphore_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
| 474 | |
---|
| 475 | #define CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(_queues) \ |
---|
| 476 | ( (_queues) * \ |
---|
| 477 | ( sizeof(Message_queue_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
| 478 | |
---|
| 479 | #define CONFIGURE_MEMORY_FOR_PARTITIONS(_partitions) \ |
---|
| 480 | ( (_partitions) * \ |
---|
| 481 | ( sizeof(Partition_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
| 482 | |
---|
| 483 | #define CONFIGURE_MEMORY_FOR_REGIONS(_regions) \ |
---|
| 484 | ( (_regions) * \ |
---|
| 485 | ( sizeof(Region_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
| 486 | |
---|
| 487 | #define CONFIGURE_MEMORY_FOR_PORTS(_ports) \ |
---|
| 488 | ( (_ports) * \ |
---|
| 489 | ( sizeof(Dual_ported_memory_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
| 490 | |
---|
| 491 | #define CONFIGURE_MEMORY_FOR_PERIODS(_periods) \ |
---|
| 492 | ( (_periods) * \ |
---|
| 493 | ( sizeof(Rate_monotonic_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
| 494 | |
---|
| 495 | #define CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(_extensions) \ |
---|
| 496 | ( (_extensions) * \ |
---|
| 497 | ( sizeof(Extension_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) ) |
---|
| 498 | |
---|
| 499 | #define CONFIGURE_MEMORY_FOR_DEVICES(_devices) \ |
---|
| 500 | (((_devices) + 1) * ( sizeof(rtems_driver_name_t) ) ) |
---|
| 501 | |
---|
| 502 | #ifdef CONFIGURE_MPTEST |
---|
| 503 | |
---|
| 504 | #ifndef CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE |
---|
| 505 | |
---|
| 506 | #define CONFIGURE_MEMORY_FOR_PROXIES(_proxies) \ |
---|
| 507 | ( ((_proxies) + 1) * ( sizeof(Thread_Proxy_control) ) ) |
---|
| 508 | |
---|
| 509 | #define CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS(_global_objects) \ |
---|
| 510 | ((_global_objects) * ( sizeof(Objects_MP_Control) ) ) |
---|
| 511 | |
---|
| 512 | #define CONFIGURE_MEMORY_FOR_MP \ |
---|
| 513 | ( CONFIGURE_MEMORY_FOR_PROXIES(CONFIGURE_MP_MAXIMUM_PROXIES) + \ |
---|
[b3dcd9a2] | 514 | CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS(CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS) + \ |
---|
[a66186e] | 515 | CONFIGURE_MEMORY_FOR_TASKS(1) \ |
---|
[3652ad35] | 516 | ) |
---|
| 517 | |
---|
| 518 | #endif /* CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE */ |
---|
| 519 | |
---|
| 520 | #else |
---|
| 521 | |
---|
| 522 | #define CONFIGURE_MEMORY_FOR_MP 0 |
---|
| 523 | |
---|
| 524 | #endif |
---|
[3b89891] | 525 | |
---|
[0312defb] | 526 | #ifndef CONFIGURE_MEMORY_OVERHEAD |
---|
| 527 | #define CONFIGURE_MEMORY_OVERHEAD 0 |
---|
| 528 | #endif |
---|
| 529 | |
---|
[308aed9b] | 530 | #ifndef CONFIGURE_EXTRA_TASK_STACKS |
---|
| 531 | #define CONFIGURE_EXTRA_TASK_STACKS 0 |
---|
| 532 | #endif |
---|
| 533 | |
---|
[b3dcd9a2] | 534 | #define CONFIGURE_MEMORY_FOR_SYSTEM_OVEREHAD \ |
---|
| 535 | ( CONFIGURE_MEMORY_FOR_TASKS(1) + /* IDLE */ \ |
---|
| 536 | (256 * 12) + /* Ready chains */ \ |
---|
[01a4990] | 537 | 256 + /* name/ptr table overhead */ \ |
---|
| 538 | CONFIGURE_INTERRUPT_STACK_MEMORY /* interrupt stack */ \ |
---|
[b3dcd9a2] | 539 | ) |
---|
| 540 | |
---|
[08bae5e6] | 541 | #define CONFIGURE_EXECUTIVE_RAM_SIZE \ |
---|
[308aed9b] | 542 | (( CONFIGURE_MEMORY_FOR_POSIX + \ |
---|
| 543 | CONFIGURE_MEMORY_FOR_TASKS(CONFIGURE_MAXIMUM_TASKS + \ |
---|
| 544 | CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_ADA_TASKS ) + \ |
---|
[3652ad35] | 545 | CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS) + \ |
---|
[bd9c3d1] | 546 | CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_MAXIMUM_SEMAPHORES + \ |
---|
| 547 | CONFIGURE_LIBIO_SEMAPHORES) + \ |
---|
[3652ad35] | 548 | CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(CONFIGURE_MAXIMUM_MESSAGE_QUEUES) + \ |
---|
| 549 | CONFIGURE_MEMORY_FOR_PARTITIONS(CONFIGURE_MAXIMUM_PARTITIONS) + \ |
---|
[3b89891] | 550 | CONFIGURE_MEMORY_FOR_REGIONS( \ |
---|
| 551 | CONFIGURE_MAXIMUM_REGIONS + CONFIGURE_MALLOC_REGION ) + \ |
---|
[3652ad35] | 552 | CONFIGURE_MEMORY_FOR_PORTS(CONFIGURE_MAXIMUM_PORTS) + \ |
---|
| 553 | CONFIGURE_MEMORY_FOR_PERIODS(CONFIGURE_MAXIMUM_PERIODS) + \ |
---|
[3b89891] | 554 | CONFIGURE_MEMORY_FOR_USER_EXTENSIONS( \ |
---|
[ab97da95] | 555 | CONFIGURE_MAXIMUM_USER_EXTENSIONS + CONFIGURE_NEWLIB_EXTENSION + \ |
---|
| 556 | CONFIGURE_STACK_CHECKER_EXTENSION ) + \ |
---|
[3652ad35] | 557 | CONFIGURE_MEMORY_FOR_DEVICES(CONFIGURE_MAXIMUM_DEVICES) + \ |
---|
| 558 | CONFIGURE_MEMORY_FOR_MP + \ |
---|
[b3dcd9a2] | 559 | CONFIGURE_MEMORY_FOR_SYSTEM_OVEREHAD + \ |
---|
[b7be9c30] | 560 | (((CONFIGURE_MEMORY_OVERHEAD)+1) * 1024) + \ |
---|
| 561 | (CONFIGURE_EXTRA_TASK_STACKS) \ |
---|
[0312defb] | 562 | ) & 0xfffffc00) |
---|
[08bae5e6] | 563 | #endif |
---|
| 564 | |
---|
[b61e6e1] | 565 | #ifdef CONFIGURE_GNAT_RTEMS |
---|
| 566 | #define CONFIGURE_GNAT_MUTEXES 10 |
---|
[4f7fd59] | 567 | #define CONFIGURE_GNAT_KEYS 1 |
---|
[b61e6e1] | 568 | |
---|
| 569 | /* 20 are required to run all tests in the ACVC */ |
---|
| 570 | #ifndef CONFIGURE_MAXIMUM_ADA_TASKS |
---|
| 571 | #define CONFIGURE_MAXIMUM_ADA_TASKS 20 |
---|
| 572 | #endif |
---|
| 573 | |
---|
[308aed9b] | 574 | /* This is the number of non-Ada tasks which invoked Ada code. */ |
---|
| 575 | #ifndef CONFIGURE_MAXIMUM_FAKE_ADA_TASKS |
---|
| 576 | #define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0 |
---|
| 577 | #endif |
---|
| 578 | |
---|
| 579 | /* Ada tasks are allocated twice the minimum stack space */ |
---|
| 580 | #define CONFIGURE_ADA_TASKS_STACK \ |
---|
| 581 | (CONFIGURE_MAXIMUM_ADA_TASKS * RTEMS_MINIMUM_STACK_SIZE) |
---|
| 582 | |
---|
[b61e6e1] | 583 | #else |
---|
[4f7fd59] | 584 | #define CONFIGURE_GNAT_MUTEXES 0 |
---|
| 585 | #define CONFIGURE_GNAT_KEYS 0 |
---|
| 586 | #define CONFIGURE_MAXIMUM_ADA_TASKS 0 |
---|
| 587 | #define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0 |
---|
[308aed9b] | 588 | #define CONFIGURE_ADA_TASKS_STACK 0 |
---|
[b61e6e1] | 589 | #endif |
---|
| 590 | |
---|
| 591 | |
---|
[08bae5e6] | 592 | #ifdef CONFIGURE_INIT |
---|
[e6d4b1d] | 593 | |
---|
| 594 | rtems_api_configuration_table Configuration_RTEMS_API = { |
---|
[08bae5e6] | 595 | CONFIGURE_MAXIMUM_TASKS, |
---|
| 596 | CONFIGURE_MAXIMUM_TIMERS, |
---|
[43908825] | 597 | CONFIGURE_MAXIMUM_SEMAPHORES + CONFIGURE_LIBIO_SEMAPHORES, |
---|
[08bae5e6] | 598 | CONFIGURE_MAXIMUM_MESSAGE_QUEUES, |
---|
| 599 | CONFIGURE_MAXIMUM_PARTITIONS, |
---|
[3b89891] | 600 | CONFIGURE_MAXIMUM_REGIONS + CONFIGURE_MALLOC_REGION, |
---|
[08bae5e6] | 601 | CONFIGURE_MAXIMUM_PORTS, |
---|
| 602 | CONFIGURE_MAXIMUM_PERIODS, |
---|
[d9a0689e] | 603 | CONFIGURE_INIT_TASK_TABLE_SIZE, |
---|
| 604 | CONFIGURE_INIT_TASK_TABLE |
---|
[e6d4b1d] | 605 | }; |
---|
| 606 | |
---|
[2eba45d] | 607 | #ifdef RTEMS_POSIX_API |
---|
| 608 | posix_api_configuration_table Configuration_POSIX_API = { |
---|
[b61e6e1] | 609 | CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_ADA_TASKS, |
---|
[4f7fd59] | 610 | CONFIGURE_MAXIMUM_POSIX_MUTEXES + CONFIGURE_GNAT_MUTEXES + |
---|
| 611 | CONFIGURE_MAXIMUM_ADA_TASKS + CONFIGURE_MAXIMUM_FAKE_ADA_TASKS, |
---|
| 612 | CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES + |
---|
| 613 | CONFIGURE_MAXIMUM_ADA_TASKS + CONFIGURE_MAXIMUM_FAKE_ADA_TASKS, |
---|
| 614 | CONFIGURE_MAXIMUM_POSIX_KEYS + CONFIGURE_GNAT_KEYS, |
---|
[eb0551f] | 615 | CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS, |
---|
[be1c11ed] | 616 | CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE, |
---|
| 617 | CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME |
---|
[2eba45d] | 618 | }; |
---|
| 619 | #endif |
---|
| 620 | |
---|
[e6d4b1d] | 621 | rtems_configuration_table Configuration = { |
---|
| 622 | CONFIGURE_EXECUTIVE_RAM_WORK_AREA, |
---|
| 623 | CONFIGURE_EXECUTIVE_RAM_SIZE, |
---|
[ab97da95] | 624 | CONFIGURE_MAXIMUM_USER_EXTENSIONS + CONFIGURE_NEWLIB_EXTENSION + |
---|
| 625 | CONFIGURE_STACK_CHECKER_EXTENSION, |
---|
[08bae5e6] | 626 | CONFIGURE_MICROSECONDS_PER_TICK, |
---|
| 627 | CONFIGURE_TICKS_PER_TIMESLICE, |
---|
[e6d4b1d] | 628 | CONFIGURE_MAXIMUM_DEVICES, |
---|
[08bae5e6] | 629 | sizeof (Device_drivers)/ |
---|
| 630 | sizeof(rtems_driver_address_table), /* number of device drivers */ |
---|
| 631 | Device_drivers, /* pointer to driver table */ |
---|
[0451b44] | 632 | CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS, /* number of initial extensions */ |
---|
| 633 | Configuration_Initial_Extensions, /* pointer to initial extensions */ |
---|
[e6d4b1d] | 634 | CONFIGURE_MULTIPROCESSING_TABLE, /* pointer to MP config table */ |
---|
| 635 | &Configuration_RTEMS_API, /* pointer to RTEMS API config */ |
---|
[2eba45d] | 636 | #ifdef RTEMS_POSIX_API |
---|
| 637 | &Configuration_POSIX_API /* pointer to POSIX API config */ |
---|
| 638 | #else |
---|
| 639 | NULL /* pointer to POSIX API config */ |
---|
| 640 | #endif |
---|
[08bae5e6] | 641 | }; |
---|
| 642 | #endif |
---|
| 643 | |
---|
| 644 | #endif /* CONFIGURE_HAS_OWN_CONFIGURATION_TABLE */ |
---|
| 645 | |
---|
| 646 | #ifdef __cplusplus |
---|
| 647 | } |
---|
| 648 | #endif |
---|
| 649 | |
---|
| 650 | #endif |
---|
| 651 | /* end of include file */ |
---|