[b96254f] | 1 | /** |
---|
[27f071cd] | 2 | * @file |
---|
[08bae5e6] | 3 | * |
---|
[9ab091e] | 4 | * @brief Configuration Table Template that will be Instantiated |
---|
| 5 | * by an Application |
---|
| 6 | * |
---|
[27f071cd] | 7 | * This include file contains the configuration table template that will |
---|
| 8 | * be instantiated by an application based on the setting of a number |
---|
| 9 | * of macros. The macros are documented in the Configuring a System |
---|
| 10 | * chapter of the Classic API User's Guide |
---|
[08bae5e6] | 11 | * |
---|
[27f071cd] | 12 | * The model is to estimate the memory required for each configured item |
---|
| 13 | * and sum those estimates. The estimate can be too high or too low for |
---|
| 14 | * a variety of reasons: |
---|
[df49c60] | 15 | * |
---|
[27f071cd] | 16 | * Reasons estimate is too high: |
---|
| 17 | * + FP contexts (not all tasks are FP) |
---|
[df49c60] | 18 | * |
---|
[27f071cd] | 19 | * Reasons estimate is too low: |
---|
| 20 | * + stacks greater than minimum size |
---|
| 21 | * + messages |
---|
| 22 | * + application must account for device driver resources |
---|
| 23 | * + application must account for add-on library resource requirements |
---|
[df49c60] | 24 | * |
---|
[27f071cd] | 25 | * NOTE: Eventually this may be able to take into account some of |
---|
| 26 | * the above. This procedure has evolved from just enough to |
---|
| 27 | * support the RTEMS Test Suites into something that can be |
---|
| 28 | * used remarkably reliably by most applications. |
---|
[b96254f] | 29 | */ |
---|
[28352fae] | 30 | |
---|
| 31 | /* |
---|
[010192d] | 32 | * COPYRIGHT (c) 1989-2011. |
---|
[08bae5e6] | 33 | * On-Line Applications Research Corporation (OAR). |
---|
| 34 | * |
---|
[98e4ebf5] | 35 | * The license and distribution terms for this file may be |
---|
| 36 | * found in the file LICENSE in this distribution or at |
---|
[2ba508b] | 37 | * http://www.rtems.com/license/LICENSE. |
---|
[08bae5e6] | 38 | */ |
---|
| 39 | |
---|
| 40 | #ifndef __CONFIGURATION_TEMPLATE_h |
---|
| 41 | #define __CONFIGURATION_TEMPLATE_h |
---|
[8486081] | 42 | |
---|
[9c63d90] | 43 | /* |
---|
| 44 | * Include the executive's configuration |
---|
| 45 | */ |
---|
[58fa947] | 46 | #include <rtems.h> |
---|
[b2b143f4] | 47 | #include <rtems/score/apimutex.h> |
---|
[9fa3cf0d] | 48 | #include <rtems/score/wkspace.h> |
---|
[9c63d90] | 49 | |
---|
[7571a23] | 50 | #ifdef CONFIGURE_DISABLE_BSP_SETTINGS |
---|
| 51 | #undef BSP_DEFAULT_UNIFIED_WORK_AREAS |
---|
| 52 | #undef BSP_IDLE_TASK_BODY |
---|
| 53 | #undef BSP_IDLE_TASK_STACK_SIZE |
---|
| 54 | #undef BSP_INITIAL_EXTENSION |
---|
| 55 | #undef BSP_INTERRUPT_STACK_SIZE |
---|
| 56 | #undef BSP_MAXIMUM_DEVICES |
---|
| 57 | #undef BSP_ZERO_WORKSPACE_AUTOMATICALLY |
---|
| 58 | #undef CONFIGURE_BSP_PREREQUISITE_DRIVERS |
---|
| 59 | #undef CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK |
---|
| 60 | #else |
---|
| 61 | #include <bsp.h> |
---|
| 62 | #endif |
---|
| 63 | |
---|
[9c9b62d8] | 64 | #ifdef RTEMS_NEWLIB |
---|
| 65 | #include <sys/reent.h> |
---|
| 66 | #endif |
---|
| 67 | |
---|
[5877cc3a] | 68 | #ifdef __cplusplus |
---|
| 69 | extern "C" { |
---|
| 70 | #endif |
---|
| 71 | |
---|
[08bae5e6] | 72 | extern rtems_initialization_tasks_table Initialization_tasks[]; |
---|
| 73 | extern rtems_driver_address_table Device_drivers[]; |
---|
[976162a6] | 74 | #if defined(RTEMS_MULTIPROCESSING) |
---|
| 75 | extern rtems_multiprocessing_table Multiprocessing_configuration; |
---|
| 76 | #endif |
---|
[2eba45d] | 77 | #ifdef RTEMS_POSIX_API |
---|
[5877cc3a] | 78 | extern posix_api_configuration_table Configuration_POSIX_API; |
---|
[2eba45d] | 79 | #endif |
---|
[08bae5e6] | 80 | |
---|
[5877cc3a] | 81 | /** |
---|
[27f071cd] | 82 | * This macro determines whether the RTEMS reentrancy support for |
---|
| 83 | * the Newlib C Library is enabled. |
---|
[3b89891] | 84 | */ |
---|
[5aecf664] | 85 | #ifdef RTEMS_SCHEDSIM |
---|
| 86 | #undef RTEMS_NEWLIB |
---|
| 87 | #endif |
---|
| 88 | |
---|
[5877cc3a] | 89 | #if (defined(RTEMS_NEWLIB) && !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY)) |
---|
[c3db01d0] | 90 | #define CONFIGURE_NEWLIB_EXTENSION 1 |
---|
[623893c] | 91 | #else |
---|
[c3db01d0] | 92 | #define CONFIGURE_NEWLIB_EXTENSION 0 |
---|
[9c63d90] | 93 | #endif |
---|
[623893c] | 94 | |
---|
[5aecf664] | 95 | #ifndef RTEMS_SCHEDSIM |
---|
[d40da79b] | 96 | #include <rtems/libio.h> |
---|
| 97 | |
---|
| 98 | #ifdef CONFIGURE_INIT |
---|
[a290fbe9] | 99 | const rtems_libio_helper rtems_libio_init_helper = |
---|
| 100 | #ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM |
---|
| 101 | rtems_libio_helper_null; |
---|
| 102 | #else |
---|
[d40da79b] | 103 | rtems_libio_init; |
---|
[a290fbe9] | 104 | #endif |
---|
[d40da79b] | 105 | |
---|
[5fa0e5c5] | 106 | const rtems_libio_helper rtems_libio_post_driver_helper = |
---|
[a290fbe9] | 107 | #ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM |
---|
| 108 | rtems_libio_helper_null; |
---|
| 109 | #else |
---|
[5fa0e5c5] | 110 | rtems_libio_post_driver; |
---|
[a290fbe9] | 111 | #endif |
---|
[d40da79b] | 112 | |
---|
[b7cf1ff7] | 113 | const rtems_libio_helper rtems_libio_exit_helper = |
---|
| 114 | #ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM |
---|
| 115 | rtems_libio_helper_null; |
---|
| 116 | #else |
---|
| 117 | rtems_libio_exit; |
---|
| 118 | #endif |
---|
| 119 | |
---|
[a290fbe9] | 120 | const rtems_libio_helper rtems_fs_init_helper = |
---|
| 121 | #ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM |
---|
| 122 | rtems_libio_helper_null; |
---|
| 123 | #else |
---|
[d40da79b] | 124 | rtems_filesystem_initialize; |
---|
[a290fbe9] | 125 | #endif |
---|
[d40da79b] | 126 | #endif |
---|
[5aecf664] | 127 | #endif |
---|
[d40da79b] | 128 | |
---|
[717391f5] | 129 | /* |
---|
[739329f] | 130 | * If the application disables the filesystem, they will not need |
---|
| 131 | * a mount table, so do not produce one. |
---|
[717391f5] | 132 | */ |
---|
[739329f] | 133 | #ifdef CONFIGURE_APPLICATION_DISABLE_FILESYSTEM |
---|
| 134 | #define CONFIGURE_HAS_OWN_MOUNT_TABLE |
---|
[d40da79b] | 135 | #endif |
---|
| 136 | |
---|
[5877cc3a] | 137 | /** |
---|
[27f071cd] | 138 | * This macro defines the number of POSIX file descriptors allocated |
---|
| 139 | * and managed by libio. These are the "integer" file descriptors that |
---|
| 140 | * are used by calls like open(2) and read(2). |
---|
[df49c60] | 141 | */ |
---|
[bd9c3d1] | 142 | #ifndef CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS |
---|
[5877cc3a] | 143 | #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 3 |
---|
[bd9c3d1] | 144 | #endif |
---|
| 145 | |
---|
[5877cc3a] | 146 | /** |
---|
[27f071cd] | 147 | * Semaphore count used by the IO library. |
---|
[5877cc3a] | 148 | */ |
---|
[5a4bb75] | 149 | #define CONFIGURE_LIBIO_SEMAPHORES 1 |
---|
[bd9c3d1] | 150 | |
---|
[43908825] | 151 | #ifdef CONFIGURE_INIT |
---|
[5877cc3a] | 152 | /** |
---|
[27f071cd] | 153 | * When instantiating the configuration tables, this variable is |
---|
| 154 | * initialized to specify the maximum number of file descriptors. |
---|
[5877cc3a] | 155 | */ |
---|
| 156 | uint32_t rtems_libio_number_iops = CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS; |
---|
[43908825] | 157 | #endif |
---|
| 158 | |
---|
[5877cc3a] | 159 | /** |
---|
[27f071cd] | 160 | * This macro determines if termios is disabled by this application. |
---|
| 161 | * This only means that resources will not be reserved. If you end |
---|
| 162 | * up using termios, it will fail. |
---|
[df49c60] | 163 | */ |
---|
| 164 | #ifdef CONFIGURE_TERMIOS_DISABLED |
---|
[5877cc3a] | 165 | #define CONFIGURE_TERMIOS_SEMAPHORES 0 |
---|
[df49c60] | 166 | #else |
---|
[5877cc3a] | 167 | /** |
---|
[27f071cd] | 168 | * This macro specifies the number of serial or PTY ports that will |
---|
| 169 | * use termios. |
---|
[5877cc3a] | 170 | */ |
---|
| 171 | #ifndef CONFIGURE_NUMBER_OF_TERMIOS_PORTS |
---|
| 172 | #define CONFIGURE_NUMBER_OF_TERMIOS_PORTS 1 |
---|
| 173 | #endif |
---|
[df49c60] | 174 | |
---|
[5877cc3a] | 175 | /** |
---|
[27f071cd] | 176 | * This macro reserves the number of semaphores required by termios |
---|
| 177 | * based upon the number of communication ports that will use it. |
---|
[5877cc3a] | 178 | */ |
---|
| 179 | #define CONFIGURE_TERMIOS_SEMAPHORES \ |
---|
| 180 | ((CONFIGURE_NUMBER_OF_TERMIOS_PORTS * 4) + 1) |
---|
[df49c60] | 181 | #endif |
---|
| 182 | |
---|
[5877cc3a] | 183 | /** |
---|
[27f071cd] | 184 | * This macro specifies the number of PTYs that can be concurrently |
---|
| 185 | * active. |
---|
[d3d2afdf] | 186 | */ |
---|
| 187 | #ifndef CONFIGURE_MAXIMUM_PTYS |
---|
[5877cc3a] | 188 | #define CONFIGURE_MAXIMUM_PTYS 0 |
---|
[d3d2afdf] | 189 | #endif |
---|
| 190 | |
---|
[5877cc3a] | 191 | /** |
---|
[27f071cd] | 192 | * This variable contains the maximum number of PTYs that can be |
---|
| 193 | * concurrently active. |
---|
[5877cc3a] | 194 | */ |
---|
[d3d2afdf] | 195 | #ifdef CONFIGURE_INIT |
---|
[396e3258] | 196 | int rtems_telnetd_maximum_ptys = CONFIGURE_MAXIMUM_PTYS; |
---|
[d3d2afdf] | 197 | #else |
---|
[396e3258] | 198 | extern int rtems_telnetd_maximum_ptys; |
---|
[d3d2afdf] | 199 | #endif |
---|
| 200 | |
---|
[06dcaf0] | 201 | #if defined(RTEMS_SMP) |
---|
| 202 | /* |
---|
| 203 | * If configured for SMP, then we need to know the maximum CPU cores. |
---|
| 204 | */ |
---|
| 205 | #if !defined(CONFIGURE_SMP_APPLICATION) |
---|
[9ab091e] | 206 | #if !defined(CONFIGURE_SMP_MAXIMUM_PROCESSORS) |
---|
[06dcaf0] | 207 | #define CONFIGURE_SMP_MAXIMUM_PROCESSORS 1 |
---|
| 208 | #endif |
---|
| 209 | #else |
---|
[9ab091e] | 210 | #if !defined(CONFIGURE_SMP_MAXIMUM_PROCESSORS) |
---|
[06dcaf0] | 211 | #error "CONFIGURE_SMP_MAXIMUM_PROCESSORS not specified for SMP Application" |
---|
| 212 | #endif |
---|
| 213 | #endif |
---|
| 214 | #endif |
---|
| 215 | |
---|
[29e92b0] | 216 | /* |
---|
| 217 | * Filesystems and Mount Table Configuration. |
---|
| 218 | * |
---|
| 219 | * Defines to control the file system: |
---|
| 220 | * |
---|
| 221 | * CONFIGURE_APPLICATION_DISABLE_FILESYSTEM: |
---|
| 222 | * Disable the RTEMS filesystems. You get an empty DEVFS. |
---|
| 223 | * |
---|
| 224 | * CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM: |
---|
| 225 | * Use the DEVFS as the root file system. Limited functions are |
---|
| 226 | * provided when this is used. |
---|
| 227 | * |
---|
| 228 | * CONFIGURE_FILESYSTEM_ALL: |
---|
| 229 | * Add file filesystems to the default filesystem table. |
---|
| 230 | * |
---|
| 231 | * List of available file systems. You can define as many as you like: |
---|
[59673224] | 232 | * CONFIGURE_FILESYSTEM_MINIIMFS - MiniIMFS, use DEVFS now |
---|
[29e92b0] | 233 | * CONFIGURE_FILESYSTEM_IMFS - In Memory File System (IMFS) |
---|
| 234 | * CONFIGURE_FILESYSTEM_DEVFS - Device File System (DSVFS) |
---|
| 235 | * CONFIGURE_FILESYSTEM_TFTPFS - TFTP File System, networking enabled |
---|
| 236 | * CONFIGURE_FILESYSTEM_FTPFS - FTP File System, networking enabled |
---|
[59673224] | 237 | * CONFIGURE_FILESYSTEM_NFS - Network File System, networking enabled |
---|
[29e92b0] | 238 | * CONFIGURE_FILESYSTEM_DOSFS - DOS File System, uses libblock |
---|
| 239 | * CONFIGURE_FILESYSTEM_RFS - RTEMS File System (RFS), uses libblock |
---|
| 240 | * |
---|
| 241 | * Combinations: |
---|
| 242 | * |
---|
| 243 | * - If nothing is defined the base file system is the IMFS. |
---|
| 244 | * |
---|
| 245 | * - If CONFIGURE_APPLICATION_DISABLE_FILESYSTEM is defined all filesystem |
---|
| 246 | * are disabled by force and an empty DEVFS is created. |
---|
| 247 | * |
---|
| 248 | * - If CONFIGURE_USE_DEV_AS_BASE_FILESYSTEM is defined all filesystem |
---|
| 249 | * are disabled by force and DEVFS is defined. |
---|
| 250 | */ |
---|
| 251 | |
---|
[d40da79b] | 252 | #ifdef CONFIGURE_INIT |
---|
[29e92b0] | 253 | |
---|
| 254 | /* |
---|
| 255 | * Include all file systems. Do this before checking if the filesystem has |
---|
| 256 | * been disabled. |
---|
| 257 | */ |
---|
| 258 | #ifdef CONFIGURE_FILESYSTEM_ALL |
---|
[59673224] | 259 | #define CONFIGURE_FILESYSTEM_MINIIMFS |
---|
[29e92b0] | 260 | #define CONFIGURE_FILESYSTEM_IMFS |
---|
| 261 | #define CONFIGURE_FILESYSTEM_DEVFS |
---|
| 262 | #define CONFIGURE_FILESYSTEM_TFTPFS |
---|
| 263 | #define CONFIGURE_FILESYSTEM_FTPFS |
---|
[59673224] | 264 | #define CONFIGURE_FILESYSTEM_NFS |
---|
[29e92b0] | 265 | #define CONFIGURE_FILESYSTEM_DOSFS |
---|
| 266 | #define CONFIGURE_FILESYSTEM_RFS |
---|
| 267 | #endif |
---|
| 268 | |
---|
| 269 | /* |
---|
[80c1577] | 270 | * If disabling the file system, give a compile error if the user has |
---|
| 271 | * configured other filesystem parameters. |
---|
[29e92b0] | 272 | */ |
---|
[80c1577] | 273 | #if defined(CONFIGURE_APPLICATION_DISABLE_FILESYSTEM) |
---|
| 274 | #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM) || \ |
---|
| 275 | defined(CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM) |
---|
| 276 | #error "Filesystem disabled but a base filesystem configured." |
---|
| 277 | #endif |
---|
| 278 | |
---|
| 279 | #if defined(CONFIGURE_FILESYSTEM_MINIIMFS) || \ |
---|
| 280 | defined(CONFIGURE_FILESYSTEM_IMFS) || \ |
---|
| 281 | defined(CONFIGURE_FILESYSTEM_DEVFS) || \ |
---|
| 282 | defined(CONFIGURE_FILESYSTEM_TFTPFS) || \ |
---|
| 283 | defined(CONFIGURE_FILESYSTEM_FTPFS) || \ |
---|
| 284 | defined(CONFIGURE_FILESYSTEM_NFS) || \ |
---|
| 285 | defined(CONFIGURE_FILESYSTEM_DOSFS) || \ |
---|
| 286 | defined(CONFIGURE_FILESYSTEM_RFS) |
---|
[9bd0258d] | 287 | #error "Configured filesystems but root filesystem was not IMFS!" |
---|
| 288 | #error "Filesystems could be disabled, DEVFS is root, or" |
---|
[80c1577] | 289 | #error " miniIMFS is root!" |
---|
[9ab091e] | 290 | #endif |
---|
[29e92b0] | 291 | #endif |
---|
| 292 | |
---|
| 293 | /* |
---|
| 294 | * If the base filesystem is DEVFS define it else define IMFS. |
---|
| 295 | * We will have either DEVFS or IMFS defined after this. |
---|
| 296 | */ |
---|
[f89c34bb] | 297 | #if !defined(CONFIGURE_APPLICATION_DISABLE_FILESYSTEM) |
---|
| 298 | #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM) |
---|
| 299 | #define CONFIGURE_FILESYSTEM_DEVFS |
---|
| 300 | #elif defined(CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM) |
---|
[59673224] | 301 | #define CONFIGURE_FILESYSTEM_MINIIMFS |
---|
[f89c34bb] | 302 | #elif !defined(CONFIGURE_FILESYSTEM_IMFS) |
---|
| 303 | #define CONFIGURE_FILESYSTEM_IMFS |
---|
| 304 | #endif |
---|
[29e92b0] | 305 | #endif |
---|
| 306 | |
---|
| 307 | #endif |
---|
| 308 | |
---|
[5aecf664] | 309 | #ifndef RTEMS_SCHEDSIM |
---|
[29e92b0] | 310 | /** |
---|
| 311 | * IMFS |
---|
| 312 | */ |
---|
| 313 | #include <rtems/imfs.h> |
---|
| 314 | |
---|
| 315 | /** |
---|
[27f071cd] | 316 | * This specifies the number of bytes per block for files within the IMFS. |
---|
| 317 | * There are a maximum number of blocks per file so this dictates the maximum |
---|
| 318 | * size of a file. This has to be balanced with the unused portion of each |
---|
| 319 | * block that might be wasted. |
---|
[29e92b0] | 320 | */ |
---|
| 321 | #ifndef CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK |
---|
| 322 | #define CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK \ |
---|
| 323 | IMFS_MEMFILE_DEFAULT_BYTES_PER_BLOCK |
---|
| 324 | #endif |
---|
| 325 | |
---|
| 326 | /** |
---|
[27f071cd] | 327 | * This defines the miniIMFS file system table entry. |
---|
[9ab091e] | 328 | */ |
---|
[29e92b0] | 329 | #if !defined(CONFIGURE_FILESYSTEM_ENTRY_miniIMFS) && \ |
---|
[59673224] | 330 | defined(CONFIGURE_FILESYSTEM_MINIIMFS) |
---|
[14fc3a77] | 331 | #define CONFIGURE_FILESYSTEM_ENTRY_miniIMFS \ |
---|
| 332 | { RTEMS_FILESYSTEM_TYPE_MINIIMFS, miniIMFS_initialize } |
---|
[29e92b0] | 333 | #endif |
---|
[5aecf664] | 334 | #endif |
---|
[29e92b0] | 335 | |
---|
[659019e] | 336 | /** |
---|
[27f071cd] | 337 | * Internall it is called FIFOs not pipes |
---|
[659019e] | 338 | */ |
---|
| 339 | #if defined(CONFIGURE_PIPES_ENABLED) |
---|
| 340 | #define CONFIGURE_FIFOS_ENABLED |
---|
| 341 | #endif |
---|
| 342 | |
---|
[5aecf664] | 343 | #ifndef RTEMS_SCHEDSIM |
---|
[29e92b0] | 344 | /** |
---|
[27f071cd] | 345 | * This defines the IMFS file system table entry. |
---|
[9ab091e] | 346 | */ |
---|
[29e92b0] | 347 | #if !defined(CONFIGURE_FILESYSTEM_ENTRY_IMFS) && \ |
---|
| 348 | defined(CONFIGURE_FILESYSTEM_IMFS) |
---|
[659019e] | 349 | #if defined(CONFIGURE_FIFOS_ENABLED) |
---|
[14fc3a77] | 350 | #define CONFIGURE_FILESYSTEM_ENTRY_IMFS \ |
---|
| 351 | { RTEMS_FILESYSTEM_TYPE_IMFS, fifoIMFS_initialize } |
---|
[241f4c96] | 352 | #else |
---|
[14fc3a77] | 353 | #define CONFIGURE_FILESYSTEM_ENTRY_IMFS \ |
---|
| 354 | { RTEMS_FILESYSTEM_TYPE_IMFS, IMFS_initialize } |
---|
[241f4c96] | 355 | #endif |
---|
[29e92b0] | 356 | #endif |
---|
[5aecf664] | 357 | #endif |
---|
[29e92b0] | 358 | |
---|
[659019e] | 359 | /** |
---|
[27f071cd] | 360 | * This sets up the resources for the PIPES/FIFOs |
---|
[659019e] | 361 | */ |
---|
| 362 | #if defined(CONFIGURE_FIFOS_ENABLED) |
---|
[46e69ff] | 363 | #if !defined(CONFIGURE_MAXIMUM_FIFOS) && !defined(CONFIGURE_MAXIMUM_PIPES) |
---|
| 364 | #error "No FIFOs or PIPES configured" |
---|
| 365 | #endif |
---|
[659019e] | 366 | #if !defined(CONFIGURE_MAXIMUM_FIFOS) |
---|
[46e69ff] | 367 | #define CONFIGURE_MAXIMUM_FIFOS 0 |
---|
| 368 | #endif |
---|
| 369 | #if !defined(CONFIGURE_MAXIMUM_PIPES) |
---|
| 370 | #define CONFIGURE_MAXIMUM_PIPES 0 |
---|
[659019e] | 371 | #endif |
---|
[46e69ff] | 372 | #define CONFIGURE_BARRIERS_FOR_FIFOS \ |
---|
| 373 | (2 * (CONFIGURE_MAXIMUM_FIFOS + CONFIGURE_MAXIMUM_PIPES)) |
---|
| 374 | #define CONFIGURE_SEMAPHORES_FOR_FIFOS \ |
---|
| 375 | (1 + (CONFIGURE_MAXIMUM_FIFOS + CONFIGURE_MAXIMUM_PIPES)) |
---|
[659019e] | 376 | #else |
---|
| 377 | #define CONFIGURE_BARRIERS_FOR_FIFOS 0 |
---|
| 378 | #define CONFIGURE_SEMAPHORES_FOR_FIFOS 0 |
---|
| 379 | #endif |
---|
| 380 | |
---|
[29e92b0] | 381 | /** |
---|
| 382 | * DEVFS |
---|
[9ab091e] | 383 | */ |
---|
[29e92b0] | 384 | #if !defined(CONFIGURE_FILESYSTEM_ENTRY_DEVFS) && \ |
---|
| 385 | defined(CONFIGURE_FILESYSTEM_DEVFS) |
---|
| 386 | #include <rtems/devfs.h> |
---|
[14fc3a77] | 387 | #define CONFIGURE_FILESYSTEM_ENTRY_DEVFS \ |
---|
| 388 | { RTEMS_FILESYSTEM_TYPE_DEVFS, devFS_initialize } |
---|
[29e92b0] | 389 | #endif |
---|
| 390 | |
---|
| 391 | #ifdef RTEMS_NETWORKING |
---|
| 392 | /** |
---|
| 393 | * FTPFS |
---|
[9ab091e] | 394 | */ |
---|
[29e92b0] | 395 | #if !defined(CONFIGURE_FILESYSTEM_ENTRY_FTPFS) && \ |
---|
[9ab091e] | 396 | defined(CONFIGURE_FILESYSTEM_FTPFS) |
---|
[29e92b0] | 397 | #include <rtems/ftpfs.h> |
---|
[14fc3a77] | 398 | #define CONFIGURE_FILESYSTEM_ENTRY_FTPFS \ |
---|
| 399 | { RTEMS_FILESYSTEM_TYPE_FTPFS, rtems_ftpfs_initialize } |
---|
[29e92b0] | 400 | #endif |
---|
| 401 | |
---|
| 402 | /** |
---|
| 403 | * TFTPFS |
---|
[9ab091e] | 404 | */ |
---|
[29e92b0] | 405 | #if !defined(CONFIGURE_FILESYSTEM_ENTRY_TFTPFS) && \ |
---|
| 406 | defined(CONFIGURE_FILESYSTEM_TFTPFS) |
---|
| 407 | #include <rtems/tftp.h> |
---|
[14fc3a77] | 408 | #define CONFIGURE_FILESYSTEM_ENTRY_TFTPFS \ |
---|
| 409 | { RTEMS_FILESYSTEM_TYPE_TFTPFS, rtems_tftpfs_initialize } |
---|
[29e92b0] | 410 | #endif |
---|
| 411 | |
---|
| 412 | /** |
---|
[59673224] | 413 | * NFS |
---|
[9ab091e] | 414 | */ |
---|
[59673224] | 415 | #if !defined(CONFIGURE_FILESYSTEM_ENTRY_NFS) && \ |
---|
| 416 | defined(CONFIGURE_FILESYSTEM_NFS) |
---|
[29e92b0] | 417 | #include <librtemsNfs.h> |
---|
[59673224] | 418 | #define CONFIGURE_FILESYSTEM_ENTRY_NFS \ |
---|
| 419 | { RTEMS_FILESYSTEM_TYPE_NFS, rtems_nfs_initialize } |
---|
[29e92b0] | 420 | #endif |
---|
| 421 | #endif |
---|
| 422 | |
---|
| 423 | /** |
---|
| 424 | * DOSFS |
---|
[9ab091e] | 425 | */ |
---|
[29e92b0] | 426 | #if !defined(CONFIGURE_FILESYSTEM_ENTRY_DOSFS) && \ |
---|
| 427 | defined(CONFIGURE_FILESYSTEM_DOSFS) |
---|
| 428 | #include <rtems/dosfs.h> |
---|
[14fc3a77] | 429 | #define CONFIGURE_FILESYSTEM_ENTRY_DOSFS \ |
---|
| 430 | { RTEMS_FILESYSTEM_TYPE_DOSFS, rtems_dosfs_initialize } |
---|
[29e92b0] | 431 | #endif |
---|
| 432 | |
---|
| 433 | /** |
---|
| 434 | * RFS |
---|
[9ab091e] | 435 | */ |
---|
[29e92b0] | 436 | #if !defined(CONFIGURE_FILESYSTEM_ENTRY_RFS) && \ |
---|
| 437 | defined(CONFIGURE_FILESYSTEM_RFS) |
---|
| 438 | #include <rtems/rtems-rfs.h> |
---|
[14fc3a77] | 439 | #define CONFIGURE_FILESYSTEM_ENTRY_RFS \ |
---|
| 440 | { RTEMS_FILESYSTEM_TYPE_RFS, rtems_rfs_rtems_initialise } |
---|
[29e92b0] | 441 | #endif |
---|
| 442 | |
---|
| 443 | #ifdef CONFIGURE_INIT |
---|
| 444 | |
---|
[84e1742] | 445 | /** |
---|
[27f071cd] | 446 | * DEVFS variables. |
---|
[84e1742] | 447 | * |
---|
[27f071cd] | 448 | * The number of individual devices that may be registered |
---|
| 449 | * in the system or the CONFIGURE_MAXIMUM_DEVICES variable |
---|
| 450 | * is defaulted to 4 when a filesystem is enabled, unless |
---|
| 451 | * the bsp overwrides this. In which case the value is set |
---|
| 452 | * to BSP_MAXIMUM_DEVICES. |
---|
[29e92b0] | 453 | */ |
---|
[3b7c123] | 454 | #ifdef CONFIGURE_FILESYSTEM_DEVFS |
---|
[d40da79b] | 455 | #ifndef CONFIGURE_MAXIMUM_DEVICES |
---|
[84e1742] | 456 | #if defined(BSP_MAXIMUM_DEVICES) |
---|
| 457 | #define CONFIGURE_MAXIMUM_DEVICES BSP_MAXIMUM_DEVICES |
---|
| 458 | #else |
---|
| 459 | #define CONFIGURE_MAXIMUM_DEVICES 4 |
---|
| 460 | #endif |
---|
[d40da79b] | 461 | #endif |
---|
| 462 | #include <rtems/devfs.h> |
---|
| 463 | #endif |
---|
| 464 | |
---|
[5aecf664] | 465 | #ifndef RTEMS_SCHEDSIM |
---|
[dfce6724] | 466 | #if defined(CONFIGURE_FILESYSTEM_IMFS) || \ |
---|
[59673224] | 467 | defined(CONFIGURE_FILESYSTEM_MINIIMFS) |
---|
[dfce6724] | 468 | int imfs_rq_memfile_bytes_per_block = CONFIGURE_IMFS_MEMFILE_BYTES_PER_BLOCK; |
---|
| 469 | #endif |
---|
[5aecf664] | 470 | #endif |
---|
[dfce6724] | 471 | |
---|
[29e92b0] | 472 | /** |
---|
| 473 | * Table termination record. |
---|
| 474 | */ |
---|
| 475 | #define CONFIGURE_FILESYSTEM_NULL { NULL, NULL } |
---|
[43f7a90] | 476 | |
---|
[5aecf664] | 477 | #ifndef RTEMS_SCHEDSIM |
---|
[29e92b0] | 478 | /** |
---|
| 479 | * The default file system table. Must be terminated with the NULL entry if |
---|
| 480 | * you provide your own. |
---|
| 481 | */ |
---|
| 482 | #ifndef CONFIGURE_HAS_OWN_FILESYSTEM_TABLE |
---|
[7d01d244] | 483 | const rtems_filesystem_table_t rtems_filesystem_table[] = { |
---|
[59673224] | 484 | #if defined(CONFIGURE_FILESYSTEM_MINIIMFS) && \ |
---|
[29e92b0] | 485 | defined(CONFIGURE_FILESYSTEM_ENTRY_miniIMFS) |
---|
| 486 | CONFIGURE_FILESYSTEM_ENTRY_miniIMFS, |
---|
| 487 | #endif |
---|
| 488 | #if defined(CONFIGURE_FILESYSTEM_IMFS) && \ |
---|
| 489 | defined(CONFIGURE_FILESYSTEM_ENTRY_IMFS) |
---|
| 490 | CONFIGURE_FILESYSTEM_ENTRY_IMFS, |
---|
| 491 | #endif |
---|
| 492 | #if defined(CONFIGURE_FILESYSTEM_DEVFS) && \ |
---|
| 493 | defined(CONFIGURE_FILESYSTEM_ENTRY_DEVFS) |
---|
| 494 | CONFIGURE_FILESYSTEM_ENTRY_DEVFS, |
---|
| 495 | #endif |
---|
| 496 | #if defined(CONFIGURE_FILESYSTEM_TFTPFS) && \ |
---|
| 497 | defined(CONFIGURE_FILESYSTEM_ENTRY_TFTPFS) |
---|
| 498 | CONFIGURE_FILESYSTEM_ENTRY_TFTPFS, |
---|
| 499 | #endif |
---|
| 500 | #if defined(CONFIGURE_FILESYSTEM_FTPFS) && \ |
---|
| 501 | defined(CONFIGURE_FILESYSTEM_ENTRY_FTPFS) |
---|
| 502 | CONFIGURE_FILESYSTEM_ENTRY_FTPFS, |
---|
| 503 | #endif |
---|
[59673224] | 504 | #if defined(CONFIGURE_FILESYSTEM_NFS) && \ |
---|
| 505 | defined(CONFIGURE_FILESYSTEM_ENTRY_NFS) |
---|
| 506 | CONFIGURE_FILESYSTEM_ENTRY_NFS, |
---|
[29e92b0] | 507 | #endif |
---|
| 508 | #if defined(CONFIGURE_FILESYSTEM_DOSFS) && \ |
---|
| 509 | defined(CONFIGURE_FILESYSTEM_ENTRY_DOSFS) |
---|
| 510 | CONFIGURE_FILESYSTEM_ENTRY_DOSFS, |
---|
| 511 | #endif |
---|
| 512 | #if defined(CONFIGURE_FILESYSTEM_RFS) && \ |
---|
| 513 | defined(CONFIGURE_FILESYSTEM_ENTRY_RFS) |
---|
| 514 | CONFIGURE_FILESYSTEM_ENTRY_RFS, |
---|
| 515 | #endif |
---|
| 516 | CONFIGURE_FILESYSTEM_NULL |
---|
| 517 | }; |
---|
| 518 | #endif |
---|
[43f7a90] | 519 | |
---|
[c3db01d0] | 520 | #ifndef CONFIGURE_HAS_OWN_MOUNT_TABLE |
---|
[3b7c123] | 521 | #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM) |
---|
| 522 | static devFS_node devFS_root_filesystem_nodes [CONFIGURE_MAXIMUM_DEVICES]; |
---|
| 523 | static const devFS_data devFS_root_filesystem_data = { |
---|
| 524 | devFS_root_filesystem_nodes, |
---|
| 525 | CONFIGURE_MAXIMUM_DEVICES |
---|
| 526 | }; |
---|
| 527 | #endif |
---|
| 528 | const rtems_filesystem_mount_configuration |
---|
| 529 | rtems_filesystem_root_configuration = { |
---|
| 530 | NULL, |
---|
| 531 | NULL, |
---|
[46969df] | 532 | #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM) |
---|
[14fc3a77] | 533 | RTEMS_FILESYSTEM_TYPE_DEVFS, |
---|
[46969df] | 534 | #elif defined(CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM) |
---|
[14fc3a77] | 535 | RTEMS_FILESYSTEM_TYPE_MINIIMFS, |
---|
[3b7c123] | 536 | #else |
---|
[14fc3a77] | 537 | RTEMS_FILESYSTEM_TYPE_IMFS, |
---|
[c3db01d0] | 538 | #endif |
---|
| 539 | RTEMS_FILESYSTEM_READ_WRITE, |
---|
[3b7c123] | 540 | #if defined(CONFIGURE_USE_DEVFS_AS_BASE_FILESYSTEM) |
---|
| 541 | &devFS_root_filesystem_data |
---|
| 542 | #else |
---|
| 543 | NULL |
---|
| 544 | #endif |
---|
[c3db01d0] | 545 | }; |
---|
| 546 | #endif |
---|
[29e92b0] | 547 | |
---|
[43f7a90] | 548 | #endif |
---|
[5aecf664] | 549 | #endif |
---|
[43f7a90] | 550 | |
---|
[4afd6f4] | 551 | /* |
---|
[b2b56cb9] | 552 | * STACK_CHECKER_ON was still available in 4.9 so give a warning for now. |
---|
[4afd6f4] | 553 | */ |
---|
| 554 | #if defined(STACK_CHECKER_ON) |
---|
| 555 | #define CONFIGURE_STACK_CHECKER_ENABLED |
---|
| 556 | #warning "STACK_CHECKER_ON deprecated -- use CONFIGURE_STACK_CHECKER_ENABLED" |
---|
| 557 | #endif |
---|
[28352fae] | 558 | |
---|
[5877cc3a] | 559 | /** |
---|
[27f071cd] | 560 | * This configures the stack checker user extension. |
---|
[ab97da95] | 561 | */ |
---|
[4afd6f4] | 562 | #ifdef CONFIGURE_STACK_CHECKER_ENABLED |
---|
[5877cc3a] | 563 | #define CONFIGURE_STACK_CHECKER_EXTENSION 1 |
---|
[ab97da95] | 564 | #else |
---|
[5877cc3a] | 565 | #define CONFIGURE_STACK_CHECKER_EXTENSION 0 |
---|
[ab97da95] | 566 | #endif |
---|
| 567 | |
---|
[80f9d77] | 568 | /** |
---|
[27f071cd] | 569 | * @brief Maximum priority configuration. |
---|
[80f9d77] | 570 | * |
---|
[27f071cd] | 571 | * This configures the maximum priority value that |
---|
| 572 | * a task may have. |
---|
[80f9d77] | 573 | * |
---|
[27f071cd] | 574 | * The following applies to the data space requirements |
---|
| 575 | * of the Priority Scheduler. |
---|
[010192d] | 576 | * |
---|
[27f071cd] | 577 | * By reducing the number of priorities in a system, |
---|
| 578 | * the amount of RAM required by RTEMS can be significantly |
---|
| 579 | * reduced. RTEMS allocates a Chain_Control structure per |
---|
| 580 | * priority and this structure contains 3 pointers. So |
---|
| 581 | * the default is (256 * 12) = 3K on 32-bit architectures. |
---|
[80f9d77] | 582 | * |
---|
[27f071cd] | 583 | * This must be one less than a power of 2 between |
---|
| 584 | * 4 and 256. Valid values along with the application |
---|
| 585 | * priority levels and memory saved when pointers are |
---|
| 586 | * 32-bits in size are: |
---|
[80f9d77] | 587 | * |
---|
[27f071cd] | 588 | * + 3, 2 application priorities, 3024 bytes saved |
---|
| 589 | * + 7, 5 application priorities, 2976 bytes saved |
---|
| 590 | * + 15, 13 application priorities, 2880 bytes saved |
---|
| 591 | * + 31, 29 application priorities, 2688 bytes saved |
---|
| 592 | * + 63, 61 application priorities, 2304 bytes saved |
---|
| 593 | * + 127, 125 application priorities, 1536 bytes saved |
---|
| 594 | * + 255, 253 application priorities, 0 bytes saved |
---|
[80f9d77] | 595 | * |
---|
[27f071cd] | 596 | * It is specified in terms of Classic API priority values. |
---|
[80f9d77] | 597 | */ |
---|
| 598 | #ifndef CONFIGURE_MAXIMUM_PRIORITY |
---|
[8f25cec] | 599 | #define CONFIGURE_MAXIMUM_PRIORITY PRIORITY_DEFAULT_MAXIMUM |
---|
[80f9d77] | 600 | #endif |
---|
| 601 | |
---|
[0faa9dad] | 602 | /* |
---|
| 603 | * Scheduler configuration. |
---|
| 604 | * |
---|
[9ab091e] | 605 | * The scheduler configuration allows an application to select the |
---|
[0faa9dad] | 606 | * scheduling policy to use. The supported configurations are: |
---|
[ba7bc099] | 607 | * CONFIGURE_SCHEDULER_USER - user provided scheduler |
---|
| 608 | * CONFIGURE_SCHEDULER_PRIORITY - Deterministic Priority Scheduler |
---|
| 609 | * CONFIGURE_SCHEDULER_SIMPLE - Light-weight Priority Scheduler |
---|
| 610 | * CONFIGURE_SCHEDULER_SIMPLE_SMP - Simple SMP Priority Scheduler |
---|
[5472ad41] | 611 | * CONFIGURE_SCHEDULER_EDF - EDF Scheduler |
---|
[82db8e56] | 612 | * CONFIGURE_SCHEDULER_CBS - CBS Scheduler |
---|
[9ab091e] | 613 | * |
---|
| 614 | * If no configuration is specified by the application, then |
---|
[0faa9dad] | 615 | * CONFIGURE_SCHEDULER_PRIORITY is assumed to be the default. |
---|
| 616 | * |
---|
| 617 | * An application can define its own scheduling policy by defining |
---|
[010192d] | 618 | * CONFIGURE_SCHEDULER_USER and the following: |
---|
[9ab091e] | 619 | * - CONFIGURE_SCHEDULER_ENTRY_POINTS |
---|
[010192d] | 620 | * - CONFIGURE_MEMORY_FOR_SCHEDULER - base memory |
---|
| 621 | * - CONFIGURE_MEMORY_PER_TASK_FOR_SCHEDULER - per task memory |
---|
[0faa9dad] | 622 | */ |
---|
| 623 | #include <rtems/score/scheduler.h> |
---|
| 624 | |
---|
[ba7bc099] | 625 | #if !defined(RTEMS_SMP) |
---|
| 626 | #undef CONFIGURE_SCHEDULER_SIMPLE_SMP |
---|
| 627 | #endif |
---|
| 628 | |
---|
[0faa9dad] | 629 | /* If no scheduler is specified, the priority scheduler is default. */ |
---|
| 630 | #if !defined(CONFIGURE_SCHEDULER_USER) && \ |
---|
[0118ed6] | 631 | !defined(CONFIGURE_SCHEDULER_PRIORITY) && \ |
---|
[ba7bc099] | 632 | !defined(CONFIGURE_SCHEDULER_SIMPLE) && \ |
---|
[5472ad41] | 633 | !defined(CONFIGURE_SCHEDULER_SIMPLE_SMP) && \ |
---|
[82db8e56] | 634 | !defined(CONFIGURE_SCHEDULER_EDF) && \ |
---|
| 635 | !defined(CONFIGURE_SCHEDULER_CBS) |
---|
[ba7bc099] | 636 | #if defined(RTEMS_SMP) && defined(CONFIGURE_SMP_APPLICATION) |
---|
| 637 | #define CONFIGURE_SCHEDULER_SIMPLE_SMP |
---|
| 638 | #else |
---|
| 639 | #define CONFIGURE_SCHEDULER_PRIORITY |
---|
| 640 | #endif |
---|
[0faa9dad] | 641 | #endif |
---|
| 642 | |
---|
[9ab091e] | 643 | /* |
---|
[4c794c8] | 644 | * If the Priority Scheduler is selected, then configure for it. |
---|
[0faa9dad] | 645 | */ |
---|
| 646 | #if defined(CONFIGURE_SCHEDULER_PRIORITY) |
---|
| 647 | #include <rtems/score/schedulerpriority.h> |
---|
[e58f80cb] | 648 | #define CONFIGURE_SCHEDULER_ENTRY_POINTS SCHEDULER_PRIORITY_ENTRY_POINTS |
---|
[0faa9dad] | 649 | |
---|
| 650 | /** |
---|
[4c794c8] | 651 | * This defines the memory used by the priority scheduler. |
---|
[0faa9dad] | 652 | */ |
---|
[010192d] | 653 | #define CONFIGURE_MEMORY_FOR_SCHEDULER ( \ |
---|
[0faa9dad] | 654 | _Configure_From_workspace( \ |
---|
| 655 | ((CONFIGURE_MAXIMUM_PRIORITY+1) * sizeof(Chain_Control)) ) \ |
---|
| 656 | ) |
---|
[010192d] | 657 | #define CONFIGURE_MEMORY_PER_TASK_FOR_SCHEDULER ( \ |
---|
[0faa9dad] | 658 | _Configure_From_workspace(sizeof(Scheduler_priority_Per_thread)) ) |
---|
| 659 | #endif |
---|
| 660 | |
---|
[9ab091e] | 661 | /* |
---|
[0118ed6] | 662 | * If the Simple Priority Scheduler is selected, then configure for it. |
---|
| 663 | */ |
---|
| 664 | #if defined(CONFIGURE_SCHEDULER_SIMPLE) |
---|
| 665 | #include <rtems/score/schedulersimple.h> |
---|
[e58f80cb] | 666 | #define CONFIGURE_SCHEDULER_ENTRY_POINTS SCHEDULER_SIMPLE_ENTRY_POINTS |
---|
[0118ed6] | 667 | |
---|
| 668 | /** |
---|
| 669 | * define the memory used by the simple scheduler |
---|
| 670 | */ |
---|
| 671 | #define CONFIGURE_MEMORY_FOR_SCHEDULER ( \ |
---|
| 672 | _Configure_From_workspace( sizeof(Chain_Control) ) \ |
---|
| 673 | ) |
---|
| 674 | #define CONFIGURE_MEMORY_PER_TASK_FOR_SCHEDULER (0) |
---|
| 675 | #endif |
---|
| 676 | |
---|
[ba7bc099] | 677 | /* |
---|
| 678 | * If the Simple SMP Priority Scheduler is selected, then configure for it. |
---|
| 679 | */ |
---|
| 680 | #if defined(CONFIGURE_SCHEDULER_SIMPLE_SMP) |
---|
| 681 | #include <rtems/score/schedulersimplesmp.h> |
---|
| 682 | #define CONFIGURE_SCHEDULER_ENTRY_POINTS SCHEDULER_SIMPLE_SMP_ENTRY_POINTS |
---|
| 683 | |
---|
| 684 | /** |
---|
| 685 | * Define the memory used by the Simple SMP Scheduler |
---|
| 686 | * |
---|
| 687 | * NOTE: This is the same as the Simple Scheduler |
---|
| 688 | */ |
---|
| 689 | #define CONFIGURE_MEMORY_FOR_SCHEDULER ( \ |
---|
[a936aa49] | 690 | _Configure_From_workspace( sizeof( Scheduler_simple_smp_Control ) ) \ |
---|
[ba7bc099] | 691 | ) |
---|
| 692 | #define CONFIGURE_MEMORY_PER_TASK_FOR_SCHEDULER (0) |
---|
| 693 | #endif |
---|
| 694 | |
---|
[5472ad41] | 695 | /* |
---|
| 696 | * If the EDF Scheduler is selected, then configure for it. |
---|
| 697 | */ |
---|
| 698 | #if defined(CONFIGURE_SCHEDULER_EDF) |
---|
| 699 | #include <rtems/score/scheduleredf.h> |
---|
| 700 | #define CONFIGURE_SCHEDULER_ENTRY_POINTS SCHEDULER_EDF_ENTRY_POINTS |
---|
| 701 | |
---|
| 702 | /** |
---|
| 703 | * define the memory used by the EDF scheduler |
---|
| 704 | */ |
---|
| 705 | #define CONFIGURE_MEMORY_FOR_SCHEDULER ( \ |
---|
| 706 | _Configure_From_workspace(0)) |
---|
| 707 | #define CONFIGURE_MEMORY_PER_TASK_FOR_SCHEDULER ( \ |
---|
| 708 | _Configure_From_workspace(sizeof(Scheduler_EDF_Per_thread))) |
---|
| 709 | #endif |
---|
| 710 | |
---|
[82db8e56] | 711 | /* |
---|
| 712 | * If the CBS Scheduler is selected, then configure for it. |
---|
| 713 | */ |
---|
| 714 | #if defined(CONFIGURE_SCHEDULER_CBS) |
---|
| 715 | #include <rtems/score/schedulercbs.h> |
---|
| 716 | #define CONFIGURE_SCHEDULER_ENTRY_POINTS SCHEDULER_CBS_ENTRY_POINTS |
---|
| 717 | |
---|
| 718 | #ifndef CONFIGURE_CBS_MAXIMUM_SERVERS |
---|
| 719 | #define CONFIGURE_CBS_MAXIMUM_SERVERS CONFIGURE_MAXIMUM_TASKS |
---|
| 720 | #endif |
---|
| 721 | |
---|
| 722 | #ifdef CONFIGURE_INIT |
---|
| 723 | uint32_t _Scheduler_CBS_Maximum_servers = CONFIGURE_CBS_MAXIMUM_SERVERS; |
---|
| 724 | #endif |
---|
| 725 | |
---|
| 726 | /** |
---|
| 727 | * define the memory used by the CBS scheduler |
---|
| 728 | */ |
---|
| 729 | #define CONFIGURE_MEMORY_FOR_SCHEDULER ( \ |
---|
| 730 | _Configure_From_workspace((sizeof(Scheduler_CBS_Server) + \ |
---|
| 731 | sizeof(Scheduler_CBS_Server*)) * CONFIGURE_CBS_MAXIMUM_SERVERS)) |
---|
| 732 | #define CONFIGURE_MEMORY_PER_TASK_FOR_SCHEDULER ( \ |
---|
| 733 | _Configure_From_workspace(sizeof(Scheduler_CBS_Per_thread))) |
---|
| 734 | #endif |
---|
| 735 | |
---|
[9ab091e] | 736 | /* |
---|
[010192d] | 737 | * Set up the scheduler entry points table. The scheduling code uses |
---|
| 738 | * this code to know which scheduler is configured by the user. |
---|
[0faa9dad] | 739 | */ |
---|
| 740 | #ifdef CONFIGURE_INIT |
---|
[010192d] | 741 | Scheduler_Control _Scheduler = { |
---|
[e58f80cb] | 742 | NULL, /* Scheduler Specific Data Pointer */ |
---|
| 743 | CONFIGURE_SCHEDULER_ENTRY_POINTS /* Scheduler Operations */ |
---|
[0faa9dad] | 744 | }; |
---|
| 745 | #endif |
---|
| 746 | |
---|
[80f9d77] | 747 | /* |
---|
| 748 | * If you said the IDLE task was going to do application initialization |
---|
| 749 | * and didn't override the IDLE body, then something is amiss. |
---|
| 750 | */ |
---|
| 751 | #if (defined(CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION) && \ |
---|
| 752 | !defined(CONFIGURE_IDLE_TASK_BODY)) |
---|
[805cddc] | 753 | #error "CONFIGURE_ERROR: You did not override the IDLE task body." |
---|
[80f9d77] | 754 | #endif |
---|
| 755 | |
---|
[5877cc3a] | 756 | /** |
---|
[27f071cd] | 757 | * @brief Idle task body configuration. |
---|
[976162a6] | 758 | * |
---|
[27f071cd] | 759 | * There is a default IDLE thread body provided by RTEMS which |
---|
| 760 | * has the possibility of being CPU specific. There may be a |
---|
| 761 | * BSP specific override of the RTEMS default body and in turn, |
---|
| 762 | * the application may override and provide its own. |
---|
[976162a6] | 763 | */ |
---|
| 764 | #ifndef CONFIGURE_IDLE_TASK_BODY |
---|
[6c71b25] | 765 | #if defined(BSP_IDLE_TASK_BODY) |
---|
[976162a6] | 766 | #define CONFIGURE_IDLE_TASK_BODY BSP_IDLE_TASK_BODY |
---|
[6c71b25] | 767 | #elif (CPU_PROVIDES_IDLE_THREAD_BODY == TRUE) |
---|
| 768 | #define CONFIGURE_IDLE_TASK_BODY _CPU_Thread_Idle_body |
---|
[976162a6] | 769 | #else |
---|
[93f7ea15] | 770 | /* only instantiate and compile if used */ |
---|
| 771 | #ifdef CONFIGURE_INIT |
---|
| 772 | void *_Thread_Idle_body(uintptr_t ignored) |
---|
| 773 | { |
---|
| 774 | for( ; ; ) ; |
---|
| 775 | return 0; /* to avoid warning */ |
---|
| 776 | } |
---|
| 777 | #endif |
---|
[6c71b25] | 778 | #define CONFIGURE_IDLE_TASK_BODY _Thread_Idle_body |
---|
[976162a6] | 779 | #endif |
---|
| 780 | #endif |
---|
| 781 | |
---|
[ecf0f4c] | 782 | /** |
---|
[27f071cd] | 783 | * By default, use the minimum stack size requested by this port. |
---|
[ecf0f4c] | 784 | */ |
---|
| 785 | #ifndef CONFIGURE_MINIMUM_TASK_STACK_SIZE |
---|
| 786 | #define CONFIGURE_MINIMUM_TASK_STACK_SIZE CPU_STACK_MINIMUM_SIZE |
---|
| 787 | #endif |
---|
| 788 | |
---|
[b4f635e] | 789 | #define CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE \ |
---|
| 790 | (2 * CONFIGURE_MINIMUM_TASK_STACK_SIZE) |
---|
| 791 | |
---|
[5877cc3a] | 792 | /** |
---|
[27f071cd] | 793 | * @brief Idle task stack size configuration. |
---|
[976162a6] | 794 | * |
---|
[27f071cd] | 795 | * By default, the IDLE task will have a stack of minimum size. |
---|
| 796 | * The BSP or application may override this value. |
---|
[976162a6] | 797 | */ |
---|
| 798 | #ifndef CONFIGURE_IDLE_TASK_STACK_SIZE |
---|
| 799 | #ifdef BSP_IDLE_TASK_STACK_SIZE |
---|
| 800 | #define CONFIGURE_IDLE_TASK_STACK_SIZE BSP_IDLE_TASK_STACK_SIZE |
---|
| 801 | #else |
---|
[ecf0f4c] | 802 | #define CONFIGURE_IDLE_TASK_STACK_SIZE CONFIGURE_MINIMUM_TASK_STACK_SIZE |
---|
[976162a6] | 803 | #endif |
---|
| 804 | #endif |
---|
[b4f635e] | 805 | #if CONFIGURE_IDLE_TASK_STACK_SIZE < CONFIGURE_MINIMUM_TASK_STACK_SIZE |
---|
| 806 | #error "CONFIGURE_IDLE_TASK_STACK_SIZE less than CONFIGURE_MINIMUM_TASK_STACK_SIZE" |
---|
| 807 | #endif |
---|
[976162a6] | 808 | |
---|
[5877cc3a] | 809 | /** |
---|
[27f071cd] | 810 | * @brief Interrupt stack size configuration. |
---|
[6aa25da] | 811 | * |
---|
[27f071cd] | 812 | * By default, the interrupt stack will be of minimum size. |
---|
| 813 | * The BSP or application may override this value. |
---|
[6aa25da] | 814 | */ |
---|
| 815 | #ifndef CONFIGURE_INTERRUPT_STACK_SIZE |
---|
| 816 | #ifdef BSP_INTERRUPT_STACK_SIZE |
---|
| 817 | #define CONFIGURE_INTERRUPT_STACK_SIZE BSP_INTERRUPT_STACK_SIZE |
---|
| 818 | #else |
---|
[ecf0f4c] | 819 | #define CONFIGURE_INTERRUPT_STACK_SIZE CONFIGURE_MINIMUM_TASK_STACK_SIZE |
---|
[6aa25da] | 820 | #endif |
---|
| 821 | #endif |
---|
| 822 | |
---|
[5877cc3a] | 823 | /** |
---|
[27f071cd] | 824 | * This reserves memory for the interrupt stack if it is to be allocated |
---|
| 825 | * by RTEMS rather than the BSP. |
---|
[5877cc3a] | 826 | * |
---|
[27f071cd] | 827 | * @todo Try to get to the point where all BSPs support allocating the |
---|
| 828 | * memory from the Workspace. |
---|
[6aa25da] | 829 | */ |
---|
| 830 | #if (CPU_ALLOCATE_INTERRUPT_STACK == 0) |
---|
[d875597c] | 831 | #define CONFIGURE_INTERRUPT_STACK_MEMORY 0 |
---|
| 832 | #else |
---|
[94a88c1c] | 833 | #define CONFIGURE_INTERRUPT_STACK_MEMORY \ |
---|
| 834 | _Configure_From_workspace( CONFIGURE_INTERRUPT_STACK_SIZE ) |
---|
[6aa25da] | 835 | #endif |
---|
| 836 | |
---|
[5877cc3a] | 837 | /** |
---|
[27f071cd] | 838 | * Configure the very much optional task stack allocator initialization |
---|
[976162a6] | 839 | */ |
---|
[9fa3cf0d] | 840 | #ifndef CONFIGURE_TASK_STACK_ALLOCATOR_INIT |
---|
| 841 | #define CONFIGURE_TASK_STACK_ALLOCATOR_INIT NULL |
---|
[976162a6] | 842 | #endif |
---|
| 843 | |
---|
[9fa3cf0d] | 844 | /* |
---|
| 845 | * Configure the very much optional task stack allocator and deallocator. |
---|
[5877cc3a] | 846 | */ |
---|
[9fa3cf0d] | 847 | #if !defined(CONFIGURE_TASK_STACK_ALLOCATOR) \ |
---|
| 848 | && !defined(CONFIGURE_TASK_STACK_DEALLOCATOR) |
---|
| 849 | #define CONFIGURE_TASK_STACK_ALLOCATOR _Workspace_Allocate |
---|
| 850 | #define CONFIGURE_TASK_STACK_DEALLOCATOR _Workspace_Free |
---|
| 851 | #elif (defined(CONFIGURE_TASK_STACK_ALLOCATOR) \ |
---|
| 852 | && !defined(CONFIGURE_TASK_STACK_DEALLOCATOR)) \ |
---|
| 853 | || (!defined(CONFIGURE_TASK_STACK_ALLOCATOR) \ |
---|
| 854 | && defined(CONFIGURE_TASK_STACK_DEALLOCATOR)) |
---|
| 855 | #error "CONFIGURE_TASK_STACK_ALLOCATOR and CONFIGURE_TASK_STACK_DEALLOCATOR must be both defined or both undefined" |
---|
[976162a6] | 856 | #endif |
---|
| 857 | |
---|
[5877cc3a] | 858 | /** |
---|
[27f071cd] | 859 | * Should the RTEMS Workspace and C Program Heap be cleared automatically |
---|
| 860 | * at system start up? |
---|
[976162a6] | 861 | */ |
---|
| 862 | #ifndef CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY |
---|
| 863 | #ifdef BSP_ZERO_WORKSPACE_AUTOMATICALLY |
---|
| 864 | #define CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY \ |
---|
| 865 | BSP_ZERO_WORKSPACE_AUTOMATICALLY |
---|
| 866 | #else |
---|
| 867 | #define CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY FALSE |
---|
| 868 | #endif |
---|
| 869 | #endif |
---|
| 870 | |
---|
[cfcc4e20] | 871 | /* |
---|
| 872 | * RTEMS Malloc configuration |
---|
| 873 | */ |
---|
| 874 | |
---|
| 875 | #include <rtems/malloc.h> |
---|
| 876 | |
---|
[bd5984de] | 877 | #ifdef CONFIGURE_INIT |
---|
| 878 | /** |
---|
[27f071cd] | 879 | * By default, RTEMS uses separate heaps for the RTEMS Workspace and |
---|
[92b33b8d] | 880 | * the C Program Heap. The application can choose optionally to combine |
---|
| 881 | * these to provide one larger memory pool. This is particularly |
---|
[27f071cd] | 882 | * useful in combination with the unlimited objects configuration. |
---|
[bd5984de] | 883 | */ |
---|
| 884 | #ifdef CONFIGURE_UNIFIED_WORK_AREAS |
---|
| 885 | Heap_Control *RTEMS_Malloc_Heap = &_Workspace_Area; |
---|
| 886 | #else |
---|
| 887 | Heap_Control RTEMS_Malloc_Area; |
---|
| 888 | Heap_Control *RTEMS_Malloc_Heap = &RTEMS_Malloc_Area; |
---|
| 889 | #endif |
---|
| 890 | #endif |
---|
| 891 | |
---|
[cfcc4e20] | 892 | #ifdef CONFIGURE_INIT |
---|
[5877cc3a] | 893 | /** |
---|
[27f071cd] | 894 | * This configures the malloc family statistics to be available. |
---|
| 895 | * By default only function call counts are kept. |
---|
[5877cc3a] | 896 | */ |
---|
[cfcc4e20] | 897 | rtems_malloc_statistics_functions_t *rtems_malloc_statistics_helpers = |
---|
| 898 | #ifndef CONFIGURE_MALLOC_STATISTICS |
---|
| 899 | NULL; |
---|
| 900 | #else |
---|
| 901 | &rtems_malloc_statistics_helpers_table; |
---|
| 902 | #endif |
---|
| 903 | #endif |
---|
| 904 | |
---|
| 905 | #ifdef CONFIGURE_INIT |
---|
[5877cc3a] | 906 | /** |
---|
[27f071cd] | 907 | * This configures the sbrk() support for the malloc family. |
---|
| 908 | * By default it is assumed that the BSP provides all available |
---|
| 909 | * RAM to the malloc family implementation so sbrk()'ing to get |
---|
| 910 | * more memory would always fail anyway. |
---|
[5877cc3a] | 911 | */ |
---|
[47a3cd8] | 912 | const rtems_heap_extend_handler rtems_malloc_extend_handler = |
---|
| 913 | #ifdef CONFIGURE_MALLOC_BSP_SUPPORTS_SBRK |
---|
| 914 | rtems_heap_extend_via_sbrk; |
---|
[cfcc4e20] | 915 | #else |
---|
[47a3cd8] | 916 | rtems_heap_null_extend; |
---|
[cfcc4e20] | 917 | #endif |
---|
| 918 | #endif |
---|
| 919 | |
---|
[bfc54b0] | 920 | #ifdef CONFIGURE_INIT |
---|
[5877cc3a] | 921 | /** |
---|
[27f071cd] | 922 | * This configures the malloc family plugin which dirties memory |
---|
| 923 | * allocated. This is helpful for finding unitialized data structure |
---|
| 924 | * problems. |
---|
[5877cc3a] | 925 | */ |
---|
[0de235f9] | 926 | rtems_malloc_dirtier_t rtems_malloc_dirty_helper = |
---|
[bfc54b0] | 927 | #if defined(CONFIGURE_MALLOC_DIRTY) |
---|
| 928 | rtems_malloc_dirty_memory; |
---|
| 929 | #else |
---|
| 930 | NULL; |
---|
| 931 | #endif |
---|
| 932 | #endif |
---|
| 933 | |
---|
[5877cc3a] | 934 | /** |
---|
[27f071cd] | 935 | * This is a helper macro used in calculations in this file. It is used |
---|
| 936 | * to noted when an element is allocated from the RTEMS Workspace and adds |
---|
| 937 | * a factor to account for heap overhead plus an alignment factor that |
---|
| 938 | * may be applied. |
---|
[5877cc3a] | 939 | */ |
---|
| 940 | #define _Configure_From_workspace(_size) \ |
---|
[5817297] | 941 | (ssize_t)((_size) + HEAP_BLOCK_HEADER_SIZE + CPU_HEAP_ALIGNMENT - 1) |
---|
[5877cc3a] | 942 | |
---|
[9fa3cf0d] | 943 | /** |
---|
[27f071cd] | 944 | * This is a helper macro used in stack space calculations in this file. It |
---|
| 945 | * may be provided by the application in case a special task stack allocator |
---|
| 946 | * is used. The default is allocation from the RTEMS Workspace. |
---|
[9fa3cf0d] | 947 | */ |
---|
| 948 | #ifdef CONFIGURE_TASK_STACK_FROM_ALLOCATOR |
---|
| 949 | #define _Configure_From_stackspace(_stack_size) \ |
---|
| 950 | CONFIGURE_TASK_STACK_FROM_ALLOCATOR(_stack_size) |
---|
| 951 | #else |
---|
| 952 | #define _Configure_From_stackspace(_stack_size) \ |
---|
| 953 | _Configure_From_workspace(_stack_size) |
---|
| 954 | #endif |
---|
| 955 | |
---|
[dee98ce] | 956 | /** |
---|
[27f071cd] | 957 | * Do not use the unlimited bit as part of the multiplication |
---|
| 958 | * for memory usage. |
---|
[dee98ce] | 959 | */ |
---|
| 960 | #define _Configure_Max_Objects(_max) \ |
---|
[5eb434e] | 961 | rtems_resource_maximum_per_allocation(_max) |
---|
[dee98ce] | 962 | |
---|
[5877cc3a] | 963 | /** |
---|
[27f071cd] | 964 | * This macro accounts for how memory for a set of configured objects is |
---|
| 965 | * allocated from the Executive Workspace. |
---|
[5877cc3a] | 966 | * |
---|
[27f071cd] | 967 | * NOTE: It does NOT attempt to address the more complex case of unlimited |
---|
| 968 | * objects. |
---|
[5877cc3a] | 969 | */ |
---|
| 970 | #define _Configure_Object_RAM(_number, _size) \ |
---|
[dee98ce] | 971 | ( _Configure_From_workspace(_Configure_Max_Objects(_number) * (_size)) + \ |
---|
[5877cc3a] | 972 | _Configure_From_workspace( \ |
---|
[dee98ce] | 973 | ((_Configure_Max_Objects(_number) + 1) * sizeof(Objects_Control *)) + \ |
---|
[5877cc3a] | 974 | (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) \ |
---|
| 975 | ) \ |
---|
| 976 | ) |
---|
| 977 | |
---|
[08bae5e6] | 978 | /* |
---|
| 979 | * Default User Initialization Task Table. This table guarantees that |
---|
| 980 | * one user initialization table is defined. |
---|
| 981 | */ |
---|
| 982 | |
---|
[be1c11ed] | 983 | #ifdef CONFIGURE_RTEMS_INIT_TASKS_TABLE |
---|
| 984 | |
---|
| 985 | #ifdef CONFIGURE_HAS_OWN_INIT_TASK_TABLE |
---|
| 986 | |
---|
| 987 | /* |
---|
[8486081] | 988 | * The user is defining their own table information and setting the |
---|
[be1c11ed] | 989 | * appropriate variables. |
---|
| 990 | */ |
---|
| 991 | |
---|
| 992 | #else |
---|
[08bae5e6] | 993 | |
---|
| 994 | #ifndef CONFIGURE_INIT_TASK_NAME |
---|
[5877cc3a] | 995 | #define CONFIGURE_INIT_TASK_NAME rtems_build_name('U', 'I', '1', ' ') |
---|
[08bae5e6] | 996 | #endif |
---|
| 997 | |
---|
| 998 | #ifndef CONFIGURE_INIT_TASK_STACK_SIZE |
---|
[ecf0f4c] | 999 | #define CONFIGURE_INIT_TASK_STACK_SIZE CONFIGURE_MINIMUM_TASK_STACK_SIZE |
---|
[08bae5e6] | 1000 | #endif |
---|
| 1001 | |
---|
| 1002 | #ifndef CONFIGURE_INIT_TASK_PRIORITY |
---|
[5877cc3a] | 1003 | #define CONFIGURE_INIT_TASK_PRIORITY 1 |
---|
[08bae5e6] | 1004 | #endif |
---|
| 1005 | |
---|
| 1006 | #ifndef CONFIGURE_INIT_TASK_ATTRIBUTES |
---|
[5877cc3a] | 1007 | #define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_DEFAULT_ATTRIBUTES |
---|
[08bae5e6] | 1008 | #endif |
---|
| 1009 | |
---|
| 1010 | #ifndef CONFIGURE_INIT_TASK_ENTRY_POINT |
---|
[d8b74dbe] | 1011 | #ifdef __cplusplus |
---|
| 1012 | extern "C" { |
---|
| 1013 | #endif |
---|
| 1014 | rtems_task Init (rtems_task_argument ); |
---|
| 1015 | #ifdef __cplusplus |
---|
| 1016 | } |
---|
| 1017 | #endif |
---|
[5877cc3a] | 1018 | #define CONFIGURE_INIT_TASK_ENTRY_POINT Init |
---|
[d8b74dbe] | 1019 | extern const char* bsp_boot_cmdline; |
---|
| 1020 | #define CONFIGURE_INIT_TASK_ARGUMENTS ((rtems_task_argument) &bsp_boot_cmdline) |
---|
[08bae5e6] | 1021 | #endif |
---|
| 1022 | |
---|
| 1023 | #ifndef CONFIGURE_INIT_TASK_INITIAL_MODES |
---|
[05e82bd7] | 1024 | #if defined(RTEMS_SMP) && defined(CONFIGURE_SMP_APPLICATION) |
---|
| 1025 | #define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_DEFAULT_MODES |
---|
| 1026 | #else |
---|
| 1027 | #define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_NO_PREEMPT |
---|
| 1028 | #endif |
---|
[08bae5e6] | 1029 | #endif |
---|
| 1030 | |
---|
| 1031 | #ifndef CONFIGURE_INIT_TASK_ARGUMENTS |
---|
[5877cc3a] | 1032 | #define CONFIGURE_INIT_TASK_ARGUMENTS 0 |
---|
[08bae5e6] | 1033 | #endif |
---|
| 1034 | |
---|
| 1035 | #ifdef CONFIGURE_INIT |
---|
[5877cc3a] | 1036 | rtems_initialization_tasks_table Initialization_tasks[] = { |
---|
| 1037 | { CONFIGURE_INIT_TASK_NAME, |
---|
| 1038 | CONFIGURE_INIT_TASK_STACK_SIZE, |
---|
| 1039 | CONFIGURE_INIT_TASK_PRIORITY, |
---|
| 1040 | CONFIGURE_INIT_TASK_ATTRIBUTES, |
---|
| 1041 | CONFIGURE_INIT_TASK_ENTRY_POINT, |
---|
| 1042 | CONFIGURE_INIT_TASK_INITIAL_MODES, |
---|
| 1043 | CONFIGURE_INIT_TASK_ARGUMENTS |
---|
| 1044 | } |
---|
| 1045 | }; |
---|
[08bae5e6] | 1046 | #endif |
---|
| 1047 | |
---|
[d9a0689e] | 1048 | #define CONFIGURE_INIT_TASK_TABLE Initialization_tasks |
---|
| 1049 | |
---|
| 1050 | #define CONFIGURE_INIT_TASK_TABLE_SIZE \ |
---|
[9ed2bef] | 1051 | RTEMS_ARRAY_SIZE(CONFIGURE_INIT_TASK_TABLE) |
---|
[d9a0689e] | 1052 | |
---|
[be1c11ed] | 1053 | #endif /* CONFIGURE_HAS_OWN_INIT_TASK_TABLE */ |
---|
| 1054 | |
---|
| 1055 | #else /* CONFIGURE_RTEMS_INIT_TASKS_TABLE */ |
---|
| 1056 | |
---|
| 1057 | #define CONFIGURE_INIT_TASK_TABLE NULL |
---|
| 1058 | #define CONFIGURE_INIT_TASK_TABLE_SIZE 0 |
---|
[45c3da3] | 1059 | #define CONFIGURE_INIT_TASK_STACK_SIZE 0 |
---|
[be1c11ed] | 1060 | |
---|
[08bae5e6] | 1061 | #endif |
---|
| 1062 | |
---|
| 1063 | /* |
---|
| 1064 | * Default Device Driver Table. Each driver needed by the test is explicitly |
---|
| 1065 | * choosen by that test. There is always a null driver entry. |
---|
| 1066 | */ |
---|
| 1067 | |
---|
| 1068 | #define NULL_DRIVER_TABLE_ENTRY \ |
---|
| 1069 | { NULL, NULL, NULL, NULL, NULL, NULL } |
---|
| 1070 | |
---|
[df49c60] | 1071 | #ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
---|
[5877cc3a] | 1072 | #include <rtems/console.h> |
---|
[df49c60] | 1073 | #endif |
---|
| 1074 | |
---|
| 1075 | #ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER |
---|
[5877cc3a] | 1076 | #include <rtems/clockdrv.h> |
---|
[df49c60] | 1077 | #endif |
---|
| 1078 | |
---|
| 1079 | #ifdef CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER |
---|
[5877cc3a] | 1080 | #include <rtems/timerdrv.h> |
---|
[08bae5e6] | 1081 | #endif |
---|
| 1082 | |
---|
[1d4bac9] | 1083 | #ifdef CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER |
---|
[5877cc3a] | 1084 | #include <rtems/rtc.h> |
---|
[1d4bac9] | 1085 | #endif |
---|
| 1086 | |
---|
[d2018f71] | 1087 | #ifdef CONFIGURE_APPLICATION_NEEDS_WATCHDOG_DRIVER |
---|
[5877cc3a] | 1088 | #include <rtems/watchdogdrv.h> |
---|
[d2018f71] | 1089 | #endif |
---|
| 1090 | |
---|
[ad4759ab] | 1091 | #ifdef CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER |
---|
| 1092 | #include <rtems/framebuffer.h> |
---|
| 1093 | #endif |
---|
| 1094 | |
---|
[df49c60] | 1095 | #ifdef CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER |
---|
[5877cc3a] | 1096 | #include <rtems/devnull.h> |
---|
[08bae5e6] | 1097 | #endif |
---|
| 1098 | |
---|
[5af951f] | 1099 | #ifdef CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER |
---|
| 1100 | #include <rtems/devzero.h> |
---|
| 1101 | #endif |
---|
| 1102 | |
---|
[c9b005a9] | 1103 | #ifdef CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER |
---|
| 1104 | /* the ide driver needs the ATA driver */ |
---|
[5877cc3a] | 1105 | #ifndef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER |
---|
| 1106 | #define CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER |
---|
| 1107 | #endif |
---|
| 1108 | #include <libchip/ide_ctrl.h> |
---|
[c9b005a9] | 1109 | #endif |
---|
| 1110 | |
---|
| 1111 | #ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER |
---|
[5877cc3a] | 1112 | #include <libchip/ata.h> |
---|
[c9b005a9] | 1113 | #endif |
---|
| 1114 | |
---|
[08bae5e6] | 1115 | #ifndef CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE |
---|
| 1116 | |
---|
| 1117 | #ifdef CONFIGURE_INIT |
---|
[5877cc3a] | 1118 | rtems_driver_address_table Device_drivers[] = { |
---|
[09daf222] | 1119 | #ifdef CONFIGURE_BSP_PREREQUISITE_DRIVERS |
---|
| 1120 | CONFIGURE_BSP_PREREQUISITE_DRIVERS, |
---|
| 1121 | #endif |
---|
| 1122 | #ifdef CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS |
---|
| 1123 | CONFIGURE_APPLICATION_PREREQUISITE_DRIVERS, |
---|
| 1124 | #endif |
---|
[5877cc3a] | 1125 | #ifdef CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
---|
| 1126 | CONSOLE_DRIVER_TABLE_ENTRY, |
---|
| 1127 | #endif |
---|
| 1128 | #ifdef CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER |
---|
| 1129 | CLOCK_DRIVER_TABLE_ENTRY, |
---|
| 1130 | #endif |
---|
| 1131 | #ifdef CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER |
---|
| 1132 | RTC_DRIVER_TABLE_ENTRY, |
---|
| 1133 | #endif |
---|
| 1134 | #ifdef CONFIGURE_APPLICATION_NEEDS_WATCHDOG_DRIVER |
---|
| 1135 | WATCHDOG_DRIVER_TABLE_ENTRY, |
---|
| 1136 | #endif |
---|
| 1137 | #ifdef CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER |
---|
| 1138 | DEVNULL_DRIVER_TABLE_ENTRY, |
---|
| 1139 | #endif |
---|
[5af951f] | 1140 | #ifdef CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER |
---|
| 1141 | DEVZERO_DRIVER_TABLE_ENTRY, |
---|
| 1142 | #endif |
---|
[5877cc3a] | 1143 | #ifdef CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER |
---|
| 1144 | IDE_CONTROLLER_DRIVER_TABLE_ENTRY, |
---|
| 1145 | #endif |
---|
| 1146 | #ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER |
---|
| 1147 | ATA_DRIVER_TABLE_ENTRY, |
---|
| 1148 | #endif |
---|
[ad4759ab] | 1149 | #ifdef CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER |
---|
| 1150 | FRAME_BUFFER_DRIVER_TABLE_ENTRY, |
---|
| 1151 | #endif |
---|
[5877cc3a] | 1152 | #ifdef CONFIGURE_APPLICATION_EXTRA_DRIVERS |
---|
| 1153 | CONFIGURE_APPLICATION_EXTRA_DRIVERS, |
---|
| 1154 | #endif |
---|
| 1155 | #ifdef CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER |
---|
| 1156 | NULL_DRIVER_TABLE_ENTRY |
---|
| 1157 | #elif !defined(CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER) && \ |
---|
[4175abd] | 1158 | !defined(CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER) && \ |
---|
| 1159 | !defined(CONFIGURE_APPLICATION_NEEDS_RTC_DRIVER) && \ |
---|
| 1160 | !defined(CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER) && \ |
---|
[5af951f] | 1161 | !defined(CONFIGURE_APPLICATION_NEEDS_ZERO_DRIVER) && \ |
---|
[4175abd] | 1162 | !defined(CONFIGURE_APPLICATION_NEEDS_IDE_DRIVER) && \ |
---|
| 1163 | !defined(CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER) && \ |
---|
[ad4759ab] | 1164 | !defined(CONFIGURE_APPLICATION_NEEDS_FRAME_BUFFER_DRIVER) && \ |
---|
[4175abd] | 1165 | !defined(CONFIGURE_APPLICATION_EXTRA_DRIVERS) |
---|
[5877cc3a] | 1166 | NULL_DRIVER_TABLE_ENTRY |
---|
| 1167 | #endif |
---|
| 1168 | }; |
---|
[08bae5e6] | 1169 | #endif |
---|
| 1170 | |
---|
| 1171 | #endif /* CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE */ |
---|
| 1172 | |
---|
[059a3714] | 1173 | /* |
---|
| 1174 | * Default the number of drivers per node. This value may be |
---|
| 1175 | * overridden by the user. |
---|
| 1176 | */ |
---|
| 1177 | |
---|
[96e6a86c] | 1178 | #define CONFIGURE_NUMBER_OF_DRIVERS \ |
---|
[9ed2bef] | 1179 | RTEMS_ARRAY_SIZE(Device_drivers) |
---|
[96e6a86c] | 1180 | |
---|
[5877cc3a] | 1181 | /** |
---|
[27f071cd] | 1182 | * This specifies the maximum number of device drivers that |
---|
| 1183 | * can be installed in the system at one time. It must account |
---|
| 1184 | * for both the statically and dynamically installed drivers. |
---|
[5877cc3a] | 1185 | */ |
---|
[059a3714] | 1186 | #ifndef CONFIGURE_MAXIMUM_DRIVERS |
---|
[5877cc3a] | 1187 | #define CONFIGURE_MAXIMUM_DRIVERS CONFIGURE_NUMBER_OF_DRIVERS |
---|
[059a3714] | 1188 | #endif |
---|
| 1189 | |
---|
[08bae5e6] | 1190 | |
---|
[c9b005a9] | 1191 | #ifdef CONFIGURE_APPLICATION_NEEDS_ATA_DRIVER |
---|
| 1192 | /* |
---|
| 1193 | * configure the priority of the ATA driver task |
---|
| 1194 | */ |
---|
[5877cc3a] | 1195 | #ifndef CONFIGURE_ATA_DRIVER_TASK_PRIORITY |
---|
| 1196 | #define CONFIGURE_ATA_DRIVER_TASK_PRIORITY ATA_DRIVER_TASK_DEFAULT_PRIORITY |
---|
| 1197 | #endif |
---|
| 1198 | #ifdef CONFIGURE_INIT |
---|
[3899a537] | 1199 | rtems_task_priority rtems_ata_driver_task_priority |
---|
[5877cc3a] | 1200 | = CONFIGURE_ATA_DRIVER_TASK_PRIORITY; |
---|
| 1201 | #endif /* CONFIGURE_INIT */ |
---|
[c9b005a9] | 1202 | #endif |
---|
| 1203 | |
---|
| 1204 | /* |
---|
| 1205 | * add bdbuf configuration and values for swapout task priority |
---|
| 1206 | */ |
---|
| 1207 | #ifdef CONFIGURE_APPLICATION_NEEDS_LIBBLOCK |
---|
[5877cc3a] | 1208 | #include <rtems/bdbuf.h> |
---|
| 1209 | /* |
---|
[3899a537] | 1210 | * configure the bdbuf cache parameters |
---|
[5877cc3a] | 1211 | */ |
---|
[3899a537] | 1212 | #ifndef CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS |
---|
| 1213 | #define CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS \ |
---|
| 1214 | RTEMS_BDBUF_MAX_READ_AHEAD_BLOCKS_DEFAULT |
---|
| 1215 | #endif |
---|
| 1216 | #ifndef CONFIGURE_BDBUF_MAX_WRITE_BLOCKS |
---|
| 1217 | #define CONFIGURE_BDBUF_MAX_WRITE_BLOCKS \ |
---|
| 1218 | RTEMS_BDBUF_MAX_WRITE_BLOCKS_DEFAULT |
---|
| 1219 | #endif |
---|
[5877cc3a] | 1220 | #ifndef CONFIGURE_SWAPOUT_TASK_PRIORITY |
---|
[3899a537] | 1221 | #define CONFIGURE_SWAPOUT_TASK_PRIORITY \ |
---|
| 1222 | RTEMS_BDBUF_SWAPOUT_TASK_PRIORITY_DEFAULT |
---|
| 1223 | #endif |
---|
| 1224 | #ifndef CONFIGURE_SWAPOUT_SWAP_PERIOD |
---|
| 1225 | #define CONFIGURE_SWAPOUT_SWAP_PERIOD \ |
---|
| 1226 | RTEMS_BDBUF_SWAPOUT_TASK_SWAP_PERIOD_DEFAULT |
---|
| 1227 | #endif |
---|
| 1228 | #ifndef CONFIGURE_SWAPOUT_BLOCK_HOLD |
---|
| 1229 | #define CONFIGURE_SWAPOUT_BLOCK_HOLD \ |
---|
| 1230 | RTEMS_BDBUF_SWAPOUT_TASK_BLOCK_HOLD_DEFAULT |
---|
[5877cc3a] | 1231 | #endif |
---|
[0d15414e] | 1232 | #ifndef CONFIGURE_SWAPOUT_WORKER_TASKS |
---|
| 1233 | #define CONFIGURE_SWAPOUT_WORKER_TASKS \ |
---|
| 1234 | RTEMS_BDBUF_SWAPOUT_WORKER_TASKS_DEFAULT |
---|
| 1235 | #endif |
---|
| 1236 | #ifndef CONFIGURE_SWAPOUT_WORKER_TASK_PRIORITY |
---|
| 1237 | #define CONFIGURE_SWAPOUT_WORKER_TASK_PRIORITY \ |
---|
| 1238 | RTEMS_BDBUF_SWAPOUT_WORKER_TASK_PRIORITY_DEFAULT |
---|
| 1239 | #endif |
---|
[b6911069] | 1240 | #ifndef CONFIGURE_BDBUF_TASK_STACK_SIZE |
---|
| 1241 | #define CONFIGURE_BDBUF_TASK_STACK_SIZE \ |
---|
| 1242 | RTEMS_BDBUF_TASK_STACK_SIZE_DEFAULT |
---|
| 1243 | #endif |
---|
[0d15414e] | 1244 | #ifndef CONFIGURE_BDBUF_CACHE_MEMORY_SIZE |
---|
| 1245 | #define CONFIGURE_BDBUF_CACHE_MEMORY_SIZE \ |
---|
| 1246 | RTEMS_BDBUF_CACHE_MEMORY_SIZE_DEFAULT |
---|
| 1247 | #endif |
---|
| 1248 | #ifndef CONFIGURE_BDBUF_BUFFER_MIN_SIZE |
---|
| 1249 | #define CONFIGURE_BDBUF_BUFFER_MIN_SIZE \ |
---|
| 1250 | RTEMS_BDBUF_BUFFER_MIN_SIZE_DEFAULT |
---|
| 1251 | #endif |
---|
| 1252 | #ifndef CONFIGURE_BDBUF_BUFFER_MAX_SIZE |
---|
| 1253 | #define CONFIGURE_BDBUF_BUFFER_MAX_SIZE \ |
---|
| 1254 | RTEMS_BDBUF_BUFFER_MAX_SIZE_DEFAULT |
---|
| 1255 | #endif |
---|
[39ee704e] | 1256 | #ifndef CONFIGURE_BDBUF_READ_AHEAD_TASK_PRIORITY |
---|
| 1257 | #define CONFIGURE_BDBUF_READ_AHEAD_TASK_PRIORITY \ |
---|
| 1258 | RTEMS_BDBUF_READ_AHEAD_TASK_PRIORITY_DEFAULT |
---|
| 1259 | #endif |
---|
[5877cc3a] | 1260 | #ifdef CONFIGURE_INIT |
---|
[28352fae] | 1261 | const rtems_bdbuf_config rtems_bdbuf_configuration = { |
---|
[3899a537] | 1262 | CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS, |
---|
| 1263 | CONFIGURE_BDBUF_MAX_WRITE_BLOCKS, |
---|
| 1264 | CONFIGURE_SWAPOUT_TASK_PRIORITY, |
---|
| 1265 | CONFIGURE_SWAPOUT_SWAP_PERIOD, |
---|
[0d15414e] | 1266 | CONFIGURE_SWAPOUT_BLOCK_HOLD, |
---|
| 1267 | CONFIGURE_SWAPOUT_WORKER_TASKS, |
---|
| 1268 | CONFIGURE_SWAPOUT_WORKER_TASK_PRIORITY, |
---|
[b6911069] | 1269 | CONFIGURE_BDBUF_TASK_STACK_SIZE, |
---|
[0d15414e] | 1270 | CONFIGURE_BDBUF_CACHE_MEMORY_SIZE, |
---|
| 1271 | CONFIGURE_BDBUF_BUFFER_MIN_SIZE, |
---|
[39ee704e] | 1272 | CONFIGURE_BDBUF_BUFFER_MAX_SIZE, |
---|
| 1273 | CONFIGURE_BDBUF_READ_AHEAD_TASK_PRIORITY |
---|
[3899a537] | 1274 | }; |
---|
[5877cc3a] | 1275 | #endif |
---|
[b2f216e1] | 1276 | |
---|
[39ee704e] | 1277 | #define CONFIGURE_LIBBLOCK_TASKS \ |
---|
| 1278 | (1 + CONFIGURE_SWAPOUT_WORKER_TASKS + \ |
---|
| 1279 | (CONFIGURE_BDBUF_MAX_READ_AHEAD_BLOCKS != 0)) |
---|
[b6911069] | 1280 | |
---|
| 1281 | #define CONFIGURE_LIBBLOCK_TASK_EXTRA_STACKS \ |
---|
| 1282 | (CONFIGURE_LIBBLOCK_TASKS * \ |
---|
| 1283 | (CONFIGURE_BDBUF_TASK_STACK_SIZE <= CONFIGURE_MINIMUM_TASK_STACK_SIZE ? \ |
---|
| 1284 | 0 : CONFIGURE_BDBUF_TASK_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE)) |
---|
| 1285 | |
---|
[b2f216e1] | 1286 | /* |
---|
| 1287 | * Semaphores: |
---|
| 1288 | * o disk lock |
---|
| 1289 | * o bdbuf lock |
---|
| 1290 | * o bdbuf sync lock |
---|
| 1291 | * o bdbuf access condition |
---|
| 1292 | * o bdbuf transfer condition |
---|
| 1293 | * o bdbuf buffer condition |
---|
| 1294 | */ |
---|
| 1295 | #define CONFIGURE_LIBBLOCK_SEMAPHORES 6 |
---|
| 1296 | |
---|
[0d15414e] | 1297 | #if defined(CONFIGURE_HAS_OWN_BDBUF_TABLE) || \ |
---|
| 1298 | defined(CONFIGURE_BDBUF_BUFFER_SIZE) || \ |
---|
| 1299 | defined(CONFIGURE_BDBUF_BUFFER_COUNT) |
---|
| 1300 | #error BDBUF Cache does not use a buffer configuration table. Please remove. |
---|
| 1301 | #endif |
---|
[b2f216e1] | 1302 | #else |
---|
[b6911069] | 1303 | #define CONFIGURE_LIBBLOCK_TASKS 0 |
---|
| 1304 | #define CONFIGURE_LIBBLOCK_TASK_EXTRA_STACKS 0 |
---|
[b2f216e1] | 1305 | #define CONFIGURE_LIBBLOCK_SEMAPHORES 0 |
---|
[c9b005a9] | 1306 | #endif /* CONFIGURE_APPLICATION_NEEDS_LIBBLOCK */ |
---|
[976162a6] | 1307 | |
---|
[b4f635e] | 1308 | #ifndef CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK |
---|
| 1309 | #define CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK 0 |
---|
| 1310 | #endif |
---|
| 1311 | |
---|
[976162a6] | 1312 | #if defined(RTEMS_MULTIPROCESSING) |
---|
[5877cc3a] | 1313 | /* |
---|
| 1314 | * Default Multiprocessing Configuration Table. The defaults are |
---|
| 1315 | * appropriate for most of the RTEMS Multiprocessor Test Suite. Each |
---|
| 1316 | * value may be overridden within each test to customize the environment. |
---|
| 1317 | */ |
---|
[08bae5e6] | 1318 | |
---|
[5877cc3a] | 1319 | #ifdef CONFIGURE_MP_APPLICATION |
---|
[f0f450a] | 1320 | #define CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER 1 |
---|
| 1321 | |
---|
[5877cc3a] | 1322 | #ifndef CONFIGURE_HAS_OWN_MULTIPROCESSING_TABLE |
---|
[08bae5e6] | 1323 | |
---|
[5877cc3a] | 1324 | #ifndef CONFIGURE_MP_NODE_NUMBER |
---|
| 1325 | #define CONFIGURE_MP_NODE_NUMBER NODE_NUMBER |
---|
| 1326 | #endif |
---|
[08bae5e6] | 1327 | |
---|
[5877cc3a] | 1328 | #ifndef CONFIGURE_MP_MAXIMUM_NODES |
---|
[4175abd] | 1329 | #define CONFIGURE_MP_MAXIMUM_NODES 2 |
---|
[5877cc3a] | 1330 | #endif |
---|
[08bae5e6] | 1331 | |
---|
[5877cc3a] | 1332 | #ifndef CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS |
---|
[4175abd] | 1333 | #define CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS 32 |
---|
[5877cc3a] | 1334 | #endif |
---|
[f2a776ac] | 1335 | #define CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS(_global_objects) \ |
---|
[4175abd] | 1336 | _Configure_Object_RAM((_global_objects), sizeof(Objects_MP_Control)) |
---|
[08bae5e6] | 1337 | |
---|
[5877cc3a] | 1338 | #ifndef CONFIGURE_MP_MAXIMUM_PROXIES |
---|
[4175abd] | 1339 | #define CONFIGURE_MP_MAXIMUM_PROXIES 32 |
---|
[5877cc3a] | 1340 | #endif |
---|
[f2a776ac] | 1341 | #define CONFIGURE_MEMORY_FOR_PROXIES(_proxies) \ |
---|
[4175abd] | 1342 | _Configure_Object_RAM((_proxies) + 1, sizeof(Thread_Proxy_control) ) |
---|
[08bae5e6] | 1343 | |
---|
[5877cc3a] | 1344 | #ifndef CONFIGURE_MP_MPCI_TABLE_POINTER |
---|
[4175abd] | 1345 | #include <mpci.h> |
---|
| 1346 | #define CONFIGURE_MP_MPCI_TABLE_POINTER &MPCI_table |
---|
[5877cc3a] | 1347 | #endif |
---|
[08bae5e6] | 1348 | |
---|
[5877cc3a] | 1349 | #ifdef CONFIGURE_INIT |
---|
[4175abd] | 1350 | rtems_multiprocessing_table Multiprocessing_configuration = { |
---|
| 1351 | CONFIGURE_MP_NODE_NUMBER, /* local node number */ |
---|
| 1352 | CONFIGURE_MP_MAXIMUM_NODES, /* maximum # nodes */ |
---|
| 1353 | CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS, /* maximum # global objects */ |
---|
| 1354 | CONFIGURE_MP_MAXIMUM_PROXIES, /* maximum # proxies */ |
---|
| 1355 | CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK, /* MPCI stack > minimum */ |
---|
| 1356 | CONFIGURE_MP_MPCI_TABLE_POINTER /* ptr to MPCI config table */ |
---|
| 1357 | }; |
---|
[5877cc3a] | 1358 | #endif |
---|
[08bae5e6] | 1359 | |
---|
[5877cc3a] | 1360 | #define CONFIGURE_MULTIPROCESSING_TABLE &Multiprocessing_configuration |
---|
[08bae5e6] | 1361 | |
---|
[5877cc3a] | 1362 | #endif /* CONFIGURE_HAS_OWN_MULTIPROCESSING_TABLE */ |
---|
[08bae5e6] | 1363 | |
---|
[5877cc3a] | 1364 | #else |
---|
[08bae5e6] | 1365 | |
---|
[5877cc3a] | 1366 | #define CONFIGURE_MULTIPROCESSING_TABLE NULL |
---|
[08bae5e6] | 1367 | |
---|
[5877cc3a] | 1368 | #endif /* CONFIGURE_MP_APPLICATION */ |
---|
[976162a6] | 1369 | #endif /* RTEMS_MULTIPROCESSING */ |
---|
[8486081] | 1370 | |
---|
[913ede4f] | 1371 | #ifndef CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER |
---|
| 1372 | #define CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER 0 |
---|
| 1373 | #endif |
---|
| 1374 | |
---|
| 1375 | |
---|
[e53aae2] | 1376 | /** |
---|
| 1377 | * This macro specifies that the user wants to use unlimited objects for any |
---|
| 1378 | * classic or posix objects that have not already been given resource limits. |
---|
| 1379 | */ |
---|
| 1380 | #if defined(CONFIGURE_UNLIMITED_OBJECTS) |
---|
| 1381 | #if !defined(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
| 1382 | /** |
---|
| 1383 | * This macro specifies a default allocation size for when auto-extending |
---|
| 1384 | * unlimited objects if none was given by the user. |
---|
| 1385 | */ |
---|
| 1386 | #define CONFIGURE_UNLIMITED_ALLOCATION_SIZE 8 |
---|
| 1387 | #endif |
---|
| 1388 | #if !defined(CONFIGURE_MAXIMUM_TASKS) |
---|
| 1389 | #define CONFIGURE_MAXIMUM_TASKS \ |
---|
| 1390 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
| 1391 | #endif |
---|
| 1392 | #if !defined(CONFIGURE_MAXIMUM_TIMERS) |
---|
| 1393 | #define CONFIGURE_MAXIMUM_TIMERS \ |
---|
| 1394 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
| 1395 | #endif |
---|
| 1396 | #if !defined(CONFIGURE_MAXIMUM_SEMAPHORES) |
---|
| 1397 | #define CONFIGURE_MAXIMUM_SEMAPHORES \ |
---|
| 1398 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
| 1399 | #endif |
---|
| 1400 | #if !defined(CONFIGURE_MAXIMUM_MESSAGE_QUEUES) |
---|
| 1401 | #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES \ |
---|
| 1402 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
| 1403 | #endif |
---|
| 1404 | #if !defined(CONFIGURE_MAXIMUM_PARTITIONS) |
---|
| 1405 | #define CONFIGURE_MAXIMUM_PARTITIONS \ |
---|
| 1406 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
| 1407 | #endif |
---|
| 1408 | #if !defined(CONFIGURE_MAXIMUM_REGIONS) |
---|
| 1409 | #define CONFIGURE_MAXIMUM_REGIONS \ |
---|
| 1410 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
| 1411 | #endif |
---|
| 1412 | #if !defined(CONFIGURE_MAXIMUM_PORTS) |
---|
| 1413 | #define CONFIGURE_MAXIMUM_PORTS \ |
---|
| 1414 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
| 1415 | #endif |
---|
| 1416 | #if !defined(CONFIGURE_MAXIMUM_PERIODS) |
---|
| 1417 | #define CONFIGURE_MAXIMUM_PERIODS \ |
---|
| 1418 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
| 1419 | #endif |
---|
| 1420 | #if !defined(CONFIGURE_MAXIMUM_BARRIERS) |
---|
| 1421 | #define CONFIGURE_MAXIMUM_BARRIERS \ |
---|
| 1422 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
| 1423 | #endif |
---|
| 1424 | |
---|
| 1425 | #ifdef RTEMS_POSIX_API |
---|
| 1426 | #if !defined(CONFIGURE_MAXIMUM_POSIX_THREADS) |
---|
| 1427 | #define CONFIGURE_MAXIMUM_POSIX_THREADS \ |
---|
| 1428 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
| 1429 | #endif |
---|
| 1430 | #if !defined(CONFIGURE_MAXIMUM_POSIX_MUTEXES) |
---|
| 1431 | #define CONFIGURE_MAXIMUM_POSIX_MUTEXES \ |
---|
| 1432 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
| 1433 | #endif |
---|
| 1434 | #if !defined(CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES) |
---|
| 1435 | #define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES \ |
---|
| 1436 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
| 1437 | #endif |
---|
| 1438 | /* |
---|
| 1439 | #if !defined(CONFIGURE_MAXIMUM_POSIX_KEYS) |
---|
| 1440 | #define CONFIGURE_MAXIMUM_POSIX_KEYS \ |
---|
| 1441 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
| 1442 | #endif |
---|
| 1443 | */ |
---|
| 1444 | #if !defined(CONFIGURE_MAXIMUM_POSIX_TIMERS) |
---|
| 1445 | #define CONFIGURE_MAXIMUM_POSIX_TIMERS \ |
---|
| 1446 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
| 1447 | #endif |
---|
| 1448 | /* |
---|
| 1449 | #if !defined(CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS) |
---|
| 1450 | #define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS \ |
---|
| 1451 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
| 1452 | #endif |
---|
| 1453 | */ |
---|
| 1454 | #if !defined(CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES) |
---|
| 1455 | #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES \ |
---|
| 1456 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
| 1457 | #endif |
---|
| 1458 | #if !defined(CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS) |
---|
| 1459 | #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS \ |
---|
| 1460 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
| 1461 | #endif |
---|
| 1462 | #if !defined(CONFIGURE_MAXIMUM_POSIX_SEMAPHORES) |
---|
| 1463 | #define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES \ |
---|
| 1464 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
| 1465 | #endif |
---|
| 1466 | #if !defined(CONFIGURE_MAXIMUM_POSIX_BARRIERS) |
---|
| 1467 | #define CONFIGURE_MAXIMUM_POSIX_BARRIERS \ |
---|
| 1468 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
| 1469 | #endif |
---|
| 1470 | #if !defined(CONFIGURE_MAXIMUM_POSIX_RWLOCKS) |
---|
| 1471 | #define CONFIGURE_MAXIMUM_POSIX_RWLOCKS \ |
---|
| 1472 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
| 1473 | #endif |
---|
| 1474 | #if !defined(CONFIGURE_MAXIMUM_POSIX_SPINLOCKS) |
---|
| 1475 | #define CONFIGURE_MAXIMUM_POSIX_SPINLOCKS \ |
---|
| 1476 | rtems_resource_unlimited(CONFIGURE_UNLIMITED_ALLOCATION_SIZE) |
---|
| 1477 | #endif |
---|
| 1478 | #endif /* RTEMS_POSIX_API */ |
---|
| 1479 | #endif /* CONFIGURE_UNLIMITED_OBJECTS */ |
---|
| 1480 | |
---|
| 1481 | |
---|
[08bae5e6] | 1482 | /* |
---|
[8486081] | 1483 | * Default Configuration Table. |
---|
[08bae5e6] | 1484 | */ |
---|
| 1485 | |
---|
| 1486 | #ifndef CONFIGURE_HAS_OWN_CONFIGURATION_TABLE |
---|
[8486081] | 1487 | |
---|
[5877cc3a] | 1488 | #ifndef CONFIGURE_MAXIMUM_TASKS |
---|
| 1489 | #define CONFIGURE_MAXIMUM_TASKS 0 |
---|
| 1490 | #endif |
---|
[08bae5e6] | 1491 | |
---|
[b6911069] | 1492 | #define CONFIGURE_TASKS \ |
---|
| 1493 | (CONFIGURE_MAXIMUM_TASKS + CONFIGURE_LIBBLOCK_TASKS) |
---|
| 1494 | |
---|
[4cb19041] | 1495 | #ifndef CONFIGURE_DISABLE_CLASSIC_API_NOTEPADS |
---|
[f2a776ac] | 1496 | #define CONFIGURE_NOTEPADS_ENABLED TRUE |
---|
| 1497 | #else |
---|
[4cb19041] | 1498 | #define CONFIGURE_NOTEPADS_ENABLED FALSE |
---|
[f2a776ac] | 1499 | #endif |
---|
| 1500 | |
---|
[7a09a7a] | 1501 | #ifndef CONFIGURE_DISABLE_CLASSIC_API_NOTEPADS |
---|
[f2a776ac] | 1502 | #define CONFIGURE_MEMORY_PER_TASK_FOR_CLASSIC_API \ |
---|
[94a88c1c] | 1503 | _Configure_From_workspace( sizeof(RTEMS_API_Control) ) |
---|
[4cb19041] | 1504 | #else |
---|
[f2a776ac] | 1505 | #define CONFIGURE_MEMORY_PER_TASK_FOR_CLASSIC_API \ |
---|
[94a88c1c] | 1506 | _Configure_From_workspace( sizeof(RTEMS_API_Control) - \ |
---|
| 1507 | (RTEMS_NUMBER_NOTEPADS * sizeof(uint32_t))) |
---|
[4cb19041] | 1508 | #endif |
---|
| 1509 | |
---|
[f2a776ac] | 1510 | /** |
---|
[27f071cd] | 1511 | * This macro calculates the memory required for task variables. |
---|
[f2a776ac] | 1512 | * |
---|
[27f071cd] | 1513 | * NOTE: Each task variable is individually allocated from the Workspace. |
---|
| 1514 | * Hence, we do the multiplication on the configured size. |
---|
[f2a776ac] | 1515 | */ |
---|
[5877cc3a] | 1516 | #ifndef CONFIGURE_MAXIMUM_TASK_VARIABLES |
---|
[f2a776ac] | 1517 | #define CONFIGURE_MAXIMUM_TASK_VARIABLES 0 |
---|
| 1518 | #define CONFIGURE_MEMORY_FOR_TASK_VARIABLES(_task_variables) 0 |
---|
| 1519 | #else |
---|
| 1520 | #define CONFIGURE_MEMORY_FOR_TASK_VARIABLES(_task_variables) \ |
---|
| 1521 | (_task_variables) * \ |
---|
| 1522 | _Configure_From_workspace(sizeof(rtems_task_variable_t)) |
---|
[5877cc3a] | 1523 | #endif |
---|
[08bae5e6] | 1524 | |
---|
[5877cc3a] | 1525 | #ifndef CONFIGURE_MAXIMUM_TIMERS |
---|
[f2a776ac] | 1526 | #define CONFIGURE_MAXIMUM_TIMERS 0 |
---|
| 1527 | #define CONFIGURE_MEMORY_FOR_TIMERS(_timers) 0 |
---|
| 1528 | #else |
---|
| 1529 | #define CONFIGURE_MEMORY_FOR_TIMERS(_timers) \ |
---|
| 1530 | _Configure_Object_RAM(_timers, sizeof(Timer_Control) ) |
---|
[5877cc3a] | 1531 | #endif |
---|
[08bae5e6] | 1532 | |
---|
[5877cc3a] | 1533 | #ifndef CONFIGURE_MAXIMUM_SEMAPHORES |
---|
[f2a776ac] | 1534 | #define CONFIGURE_MAXIMUM_SEMAPHORES 0 |
---|
| 1535 | #endif |
---|
| 1536 | |
---|
[b2f216e1] | 1537 | #define CONFIGURE_SEMAPHORES \ |
---|
| 1538 | (CONFIGURE_MAXIMUM_SEMAPHORES + CONFIGURE_LIBIO_SEMAPHORES + \ |
---|
[659019e] | 1539 | CONFIGURE_TERMIOS_SEMAPHORES + CONFIGURE_LIBBLOCK_SEMAPHORES + \ |
---|
| 1540 | CONFIGURE_SEMAPHORES_FOR_FIFOS) |
---|
[b2f216e1] | 1541 | |
---|
[f2a776ac] | 1542 | /* |
---|
| 1543 | * If there are no user or support semaphores defined, then we can assume |
---|
| 1544 | * that no memory need be allocated at all for semaphores. |
---|
| 1545 | */ |
---|
[b2f216e1] | 1546 | #if CONFIGURE_SEMAPHORES == 0 |
---|
[f2a776ac] | 1547 | #define CONFIGURE_MEMORY_FOR_SEMAPHORES(_semaphores) 0 |
---|
| 1548 | #else |
---|
| 1549 | #define CONFIGURE_MEMORY_FOR_SEMAPHORES(_semaphores) \ |
---|
| 1550 | _Configure_Object_RAM(_semaphores, sizeof(Semaphore_Control) ) |
---|
[5877cc3a] | 1551 | #endif |
---|
[08bae5e6] | 1552 | |
---|
[5877cc3a] | 1553 | #ifndef CONFIGURE_MAXIMUM_MESSAGE_QUEUES |
---|
[f2a776ac] | 1554 | #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 0 |
---|
| 1555 | #define CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(_queues) 0 |
---|
| 1556 | #else |
---|
| 1557 | #define CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(_queues) \ |
---|
| 1558 | _Configure_Object_RAM(_queues, sizeof(Message_queue_Control) ) |
---|
[5877cc3a] | 1559 | #endif |
---|
[08bae5e6] | 1560 | |
---|
[5877cc3a] | 1561 | #ifndef CONFIGURE_MAXIMUM_PARTITIONS |
---|
[f2a776ac] | 1562 | #define CONFIGURE_MAXIMUM_PARTITIONS 0 |
---|
| 1563 | #define CONFIGURE_MEMORY_FOR_PARTITIONS(_partitions) 0 |
---|
| 1564 | #else |
---|
| 1565 | #define CONFIGURE_MEMORY_FOR_PARTITIONS(_partitions) \ |
---|
| 1566 | _Configure_Object_RAM(_partitions, sizeof(Partition_Control) ) |
---|
[5877cc3a] | 1567 | #endif |
---|
[08bae5e6] | 1568 | |
---|
[5877cc3a] | 1569 | #ifndef CONFIGURE_MAXIMUM_REGIONS |
---|
[f2a776ac] | 1570 | #define CONFIGURE_MAXIMUM_REGIONS 0 |
---|
| 1571 | #define CONFIGURE_MEMORY_FOR_REGIONS(_regions) 0 |
---|
| 1572 | #else |
---|
| 1573 | #define CONFIGURE_MEMORY_FOR_REGIONS(_regions) \ |
---|
| 1574 | _Configure_Object_RAM(_regions, sizeof(Region_Control) ) |
---|
[5877cc3a] | 1575 | #endif |
---|
[08bae5e6] | 1576 | |
---|
[5877cc3a] | 1577 | #ifndef CONFIGURE_MAXIMUM_PORTS |
---|
[f2a776ac] | 1578 | #define CONFIGURE_MAXIMUM_PORTS 0 |
---|
| 1579 | #define CONFIGURE_MEMORY_FOR_PORTS(_ports) 0 |
---|
| 1580 | #else |
---|
| 1581 | #define CONFIGURE_MEMORY_FOR_PORTS(_ports) \ |
---|
| 1582 | _Configure_Object_RAM(_ports, sizeof(Dual_ported_memory_Control) ) |
---|
[5877cc3a] | 1583 | #endif |
---|
[08bae5e6] | 1584 | |
---|
[5877cc3a] | 1585 | #ifndef CONFIGURE_MAXIMUM_PERIODS |
---|
[f2a776ac] | 1586 | #define CONFIGURE_MAXIMUM_PERIODS 0 |
---|
| 1587 | #define CONFIGURE_MEMORY_FOR_PERIODS(_periods) 0 |
---|
| 1588 | #else |
---|
| 1589 | #define CONFIGURE_MEMORY_FOR_PERIODS(_periods) \ |
---|
| 1590 | _Configure_Object_RAM(_periods, sizeof(Rate_monotonic_Control) ) |
---|
[5877cc3a] | 1591 | #endif |
---|
[7fa1ce86] | 1592 | |
---|
[5877cc3a] | 1593 | #ifndef CONFIGURE_MAXIMUM_BARRIERS |
---|
[f2a776ac] | 1594 | #define CONFIGURE_MAXIMUM_BARRIERS 0 |
---|
[659019e] | 1595 | #endif |
---|
| 1596 | |
---|
| 1597 | #define CONFIGURE_BARRIERS \ |
---|
| 1598 | (CONFIGURE_MAXIMUM_BARRIERS + CONFIGURE_BARRIERS_FOR_FIFOS) |
---|
| 1599 | |
---|
| 1600 | #if CONFIGURE_BARRIERS == 0 |
---|
[f2a776ac] | 1601 | #define CONFIGURE_MEMORY_FOR_BARRIERS(_barriers) 0 |
---|
| 1602 | #else |
---|
| 1603 | #define CONFIGURE_MEMORY_FOR_BARRIERS(_barriers) \ |
---|
| 1604 | _Configure_Object_RAM(_barriers, sizeof(Barrier_Control) ) |
---|
[5877cc3a] | 1605 | #endif |
---|
[08bae5e6] | 1606 | |
---|
[5877cc3a] | 1607 | #ifndef CONFIGURE_MAXIMUM_USER_EXTENSIONS |
---|
[f2a776ac] | 1608 | #define CONFIGURE_MAXIMUM_USER_EXTENSIONS 0 |
---|
| 1609 | #define CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(_extensions) 0 |
---|
| 1610 | #else |
---|
| 1611 | #define CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(_extensions) \ |
---|
| 1612 | _Configure_Object_RAM(_extensions, sizeof(Extension_Control) ) |
---|
[5877cc3a] | 1613 | #endif |
---|
[08bae5e6] | 1614 | |
---|
[5877cc3a] | 1615 | #ifndef CONFIGURE_MICROSECONDS_PER_TICK |
---|
| 1616 | #define CONFIGURE_MICROSECONDS_PER_TICK \ |
---|
| 1617 | RTEMS_MILLISECONDS_TO_MICROSECONDS(10) |
---|
| 1618 | #endif |
---|
| 1619 | |
---|
| 1620 | #ifndef CONFIGURE_TICKS_PER_TIMESLICE |
---|
| 1621 | #define CONFIGURE_TICKS_PER_TIMESLICE 50 |
---|
| 1622 | #endif |
---|
[08bae5e6] | 1623 | |
---|
[0451b44] | 1624 | /* |
---|
| 1625 | * Initial Extension Set |
---|
| 1626 | */ |
---|
| 1627 | |
---|
| 1628 | #ifdef CONFIGURE_INIT |
---|
[4afd6f4] | 1629 | #ifdef CONFIGURE_STACK_CHECKER_ENABLED |
---|
[31bce9b] | 1630 | #include <rtems/stackchk.h> |
---|
[0451b44] | 1631 | #endif |
---|
[c3db01d0] | 1632 | #include <rtems/libcsupport.h> |
---|
[0451b44] | 1633 | |
---|
[228df42] | 1634 | #if defined(BSP_INITIAL_EXTENSION) || \ |
---|
| 1635 | defined(CONFIGURE_INITIAL_EXTENSIONS) || \ |
---|
[4afd6f4] | 1636 | defined(CONFIGURE_STACK_CHECKER_ENABLED) || \ |
---|
[c3db01d0] | 1637 | (defined(RTEMS_NEWLIB) && !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY)) |
---|
[2195fd27] | 1638 | static const rtems_extensions_table Configuration_Initial_Extensions[] = { |
---|
[c3db01d0] | 1639 | #if !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY) |
---|
| 1640 | RTEMS_NEWLIB_EXTENSION, |
---|
| 1641 | #endif |
---|
[4afd6f4] | 1642 | #if defined(CONFIGURE_STACK_CHECKER_ENABLED) |
---|
[c3db01d0] | 1643 | RTEMS_STACK_CHECKER_EXTENSION, |
---|
| 1644 | #endif |
---|
| 1645 | #if defined(CONFIGURE_INITIAL_EXTENSIONS) |
---|
| 1646 | CONFIGURE_INITIAL_EXTENSIONS, |
---|
| 1647 | #endif |
---|
[228df42] | 1648 | #if defined(BSP_INITIAL_EXTENSION) |
---|
| 1649 | BSP_INITIAL_EXTENSION |
---|
| 1650 | #endif |
---|
[c3db01d0] | 1651 | }; |
---|
| 1652 | |
---|
| 1653 | #define CONFIGURE_INITIAL_EXTENSION_TABLE Configuration_Initial_Extensions |
---|
| 1654 | #define CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS \ |
---|
[9ed2bef] | 1655 | RTEMS_ARRAY_SIZE(Configuration_Initial_Extensions) |
---|
[96e6a86c] | 1656 | #else |
---|
[c3db01d0] | 1657 | #define CONFIGURE_INITIAL_EXTENSION_TABLE NULL |
---|
| 1658 | #define CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS 0 |
---|
[96e6a86c] | 1659 | #endif |
---|
| 1660 | |
---|
[9c9b62d8] | 1661 | #if defined(RTEMS_NEWLIB) && defined(__DYNAMIC_REENT__) |
---|
| 1662 | struct _reent *__getreent(void) |
---|
| 1663 | { |
---|
| 1664 | #ifdef CONFIGURE_DISABLE_NEWLIB_REENTRANCY |
---|
| 1665 | return _GLOBAL_REENT; |
---|
| 1666 | #else |
---|
| 1667 | return _Thread_Get_executing()->libc_reent; |
---|
| 1668 | #endif |
---|
| 1669 | } |
---|
| 1670 | #endif |
---|
[0451b44] | 1671 | |
---|
[08bae5e6] | 1672 | #endif |
---|
| 1673 | |
---|
[2eba45d] | 1674 | /* |
---|
| 1675 | * POSIX API Configuration Parameters |
---|
| 1676 | */ |
---|
| 1677 | |
---|
| 1678 | #ifdef RTEMS_POSIX_API |
---|
| 1679 | |
---|
[5877cc3a] | 1680 | #include <sys/types.h> |
---|
| 1681 | #include <signal.h> |
---|
| 1682 | #include <limits.h> |
---|
| 1683 | #include <mqueue.h> |
---|
| 1684 | #include <rtems/posix/barrier.h> |
---|
| 1685 | #include <rtems/posix/cond.h> |
---|
| 1686 | #include <rtems/posix/mqueue.h> |
---|
| 1687 | #include <rtems/posix/mutex.h> |
---|
| 1688 | #include <rtems/posix/key.h> |
---|
| 1689 | #include <rtems/posix/psignal.h> |
---|
[f9340ed7] | 1690 | #include <rtems/posix/pthread.h> |
---|
[5877cc3a] | 1691 | #include <rtems/posix/rwlock.h> |
---|
| 1692 | #include <rtems/posix/semaphore.h> |
---|
| 1693 | #include <rtems/posix/spinlock.h> |
---|
| 1694 | #include <rtems/posix/threadsup.h> |
---|
| 1695 | #include <rtems/posix/timer.h> |
---|
| 1696 | |
---|
[f2a776ac] | 1697 | /** |
---|
[27f071cd] | 1698 | * Account for the object control structures plus the name |
---|
| 1699 | * of the object to be duplicated. |
---|
[f2a776ac] | 1700 | */ |
---|
| 1701 | #define _Configure_POSIX_Named_Object_RAM(_number, _size) \ |
---|
| 1702 | _Configure_Object_RAM( (_number), _size ) + \ |
---|
[e53aae2] | 1703 | (_Configure_Max_Objects(_number) * _Configure_From_workspace(NAME_MAX) ) |
---|
[f2a776ac] | 1704 | |
---|
[5877cc3a] | 1705 | #ifndef CONFIGURE_MAXIMUM_POSIX_THREADS |
---|
| 1706 | #define CONFIGURE_MAXIMUM_POSIX_THREADS 0 |
---|
| 1707 | #endif |
---|
[2eba45d] | 1708 | |
---|
[f2a776ac] | 1709 | #define CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API \ |
---|
[517bf08] | 1710 | _Configure_From_workspace(sizeof(POSIX_API_Control)) |
---|
[f2a776ac] | 1711 | |
---|
[5877cc3a] | 1712 | #ifndef CONFIGURE_MAXIMUM_POSIX_MUTEXES |
---|
[f2a776ac] | 1713 | #define CONFIGURE_MAXIMUM_POSIX_MUTEXES 0 |
---|
| 1714 | #define CONFIGURE_MEMORY_FOR_POSIX_MUTEXES(_mutexes) 0 |
---|
| 1715 | #else |
---|
| 1716 | #define CONFIGURE_MEMORY_FOR_POSIX_MUTEXES(_mutexes) \ |
---|
| 1717 | _Configure_Object_RAM(_mutexes, sizeof(POSIX_Mutex_Control) ) |
---|
[5877cc3a] | 1718 | #endif |
---|
[2eba45d] | 1719 | |
---|
[5877cc3a] | 1720 | #ifndef CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES |
---|
[f2a776ac] | 1721 | #define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 0 |
---|
| 1722 | #define CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES(_condvars) 0 |
---|
| 1723 | #else |
---|
| 1724 | #define CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES(_condvars) \ |
---|
| 1725 | _Configure_Object_RAM(_condvars, \ |
---|
[4175abd] | 1726 | sizeof(POSIX_Condition_variables_Control) ) |
---|
[5877cc3a] | 1727 | #endif |
---|
[2eba45d] | 1728 | |
---|
[5877cc3a] | 1729 | #ifndef CONFIGURE_MAXIMUM_POSIX_KEYS |
---|
[f2a776ac] | 1730 | #define CONFIGURE_MAXIMUM_POSIX_KEYS 0 |
---|
[b5c9064] | 1731 | #define CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS 0 |
---|
| 1732 | #define CONFIGURE_MEMORY_FOR_POSIX_KEYS(_keys, _key_value_pairs) 0 |
---|
[f2a776ac] | 1733 | #else |
---|
[b5c9064] | 1734 | #ifndef CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS |
---|
| 1735 | #define CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS \ |
---|
| 1736 | CONFIGURE_MAXIMUM_POSIX_KEYS \ |
---|
| 1737 | * (CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_TASKS) |
---|
| 1738 | #endif |
---|
| 1739 | #define CONFIGURE_MEMORY_FOR_POSIX_KEYS(_keys, _key_value_pairs) \ |
---|
[517bf08] | 1740 | (_Configure_Object_RAM(_keys, sizeof(POSIX_Keys_Control) ) \ |
---|
[b5c9064] | 1741 | + _Configure_From_workspace(_key_value_pairs * sizeof(POSIX_Keys_Key_value_pair))) |
---|
[5877cc3a] | 1742 | #endif |
---|
[da33d26] | 1743 | |
---|
[5877cc3a] | 1744 | #ifndef CONFIGURE_MAXIMUM_POSIX_TIMERS |
---|
[f2a776ac] | 1745 | #define CONFIGURE_MAXIMUM_POSIX_TIMERS 0 |
---|
| 1746 | #define CONFIGURE_MEMORY_FOR_POSIX_TIMERS(_timers) 0 |
---|
| 1747 | #else |
---|
| 1748 | #define CONFIGURE_MEMORY_FOR_POSIX_TIMERS(_timers) \ |
---|
| 1749 | _Configure_Object_RAM(_timers, sizeof(POSIX_Timer_Control) ) |
---|
[5877cc3a] | 1750 | #endif |
---|
[0747e2d] | 1751 | |
---|
[5877cc3a] | 1752 | #ifndef CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS |
---|
[f2a776ac] | 1753 | #define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS 0 |
---|
| 1754 | #define CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS(_queued_signals) 0 |
---|
| 1755 | #else |
---|
| 1756 | #define CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS(_queued_signals) \ |
---|
| 1757 | _Configure_From_workspace( \ |
---|
[4175abd] | 1758 | (_queued_signals) * (sizeof(POSIX_signals_Siginfo_node)) ) |
---|
[5877cc3a] | 1759 | #endif |
---|
[eb0551f] | 1760 | |
---|
[5877cc3a] | 1761 | #ifndef CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES |
---|
[f2a776ac] | 1762 | #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES 0 |
---|
| 1763 | #define CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES(_message_queues) 0 |
---|
[ade17392] | 1764 | #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS 0 |
---|
[2b558ffd] | 1765 | #define CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUE_DESCRIPTORS(_fds) 0 |
---|
[f2a776ac] | 1766 | #else |
---|
| 1767 | #define CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES(_message_queues) \ |
---|
| 1768 | _Configure_POSIX_Named_Object_RAM( \ |
---|
[4175abd] | 1769 | _message_queues, sizeof(POSIX_Message_queue_Control) ) |
---|
[ade17392] | 1770 | |
---|
| 1771 | /* default to same number */ |
---|
| 1772 | #ifndef CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS |
---|
| 1773 | #define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS \ |
---|
| 1774 | CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES |
---|
| 1775 | #endif |
---|
| 1776 | |
---|
[61ae99b] | 1777 | #define CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUE_DESCRIPTORS(_mqueue_fds) \ |
---|
[517bf08] | 1778 | _Configure_Object_RAM( \ |
---|
[ade17392] | 1779 | _mqueue_fds, sizeof(POSIX_Message_queue_Control_fd) ) |
---|
[5877cc3a] | 1780 | #endif |
---|
[be0fc099] | 1781 | |
---|
[5877cc3a] | 1782 | #ifndef CONFIGURE_MAXIMUM_POSIX_SEMAPHORES |
---|
[f2a776ac] | 1783 | #define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES 0 |
---|
| 1784 | #define CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES(_semaphores) 0 |
---|
| 1785 | #else |
---|
| 1786 | #define CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES(_semaphores) \ |
---|
| 1787 | _Configure_POSIX_Named_Object_RAM( \ |
---|
[4175abd] | 1788 | _semaphores, sizeof(POSIX_Semaphore_Control) ) |
---|
[5877cc3a] | 1789 | #endif |
---|
[be0fc099] | 1790 | |
---|
[5877cc3a] | 1791 | #ifndef CONFIGURE_MAXIMUM_POSIX_BARRIERS |
---|
[f2a776ac] | 1792 | #define CONFIGURE_MAXIMUM_POSIX_BARRIERS 0 |
---|
| 1793 | #define CONFIGURE_MEMORY_FOR_POSIX_BARRIERS(_barriers) 0 |
---|
| 1794 | #else |
---|
| 1795 | #define CONFIGURE_MEMORY_FOR_POSIX_BARRIERS(_barriers) \ |
---|
| 1796 | _Configure_Object_RAM(_barriers, sizeof(POSIX_Barrier_Control) ) |
---|
[5877cc3a] | 1797 | #endif |
---|
[7fa1ce86] | 1798 | |
---|
[5877cc3a] | 1799 | #ifndef CONFIGURE_MAXIMUM_POSIX_SPINLOCKS |
---|
[f2a776ac] | 1800 | #define CONFIGURE_MAXIMUM_POSIX_SPINLOCKS 0 |
---|
| 1801 | #define CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS(_spinlocks) 0 |
---|
| 1802 | #else |
---|
| 1803 | #define CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS(_spinlocks) \ |
---|
| 1804 | _Configure_Object_RAM(_spinlocks, sizeof(POSIX_Spinlock_Control) ) |
---|
[5877cc3a] | 1805 | #endif |
---|
[7fa1ce86] | 1806 | |
---|
[5877cc3a] | 1807 | #ifndef CONFIGURE_MAXIMUM_POSIX_RWLOCKS |
---|
[f2a776ac] | 1808 | #define CONFIGURE_MAXIMUM_POSIX_RWLOCKS 0 |
---|
| 1809 | #define CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS(_rwlocks) 0 |
---|
| 1810 | #else |
---|
| 1811 | #define CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS(_rwlocks) \ |
---|
| 1812 | _Configure_Object_RAM(_rwlocks, sizeof(POSIX_RWLock_Control) ) |
---|
[5877cc3a] | 1813 | #endif |
---|
[7fa1ce86] | 1814 | |
---|
[5877cc3a] | 1815 | #ifdef CONFIGURE_POSIX_INIT_THREAD_TABLE |
---|
[be1c11ed] | 1816 | |
---|
[5877cc3a] | 1817 | #ifdef CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE |
---|
[5240c71c] | 1818 | |
---|
[5877cc3a] | 1819 | /* |
---|
| 1820 | * The user is defining their own table information and setting the |
---|
| 1821 | * appropriate variables for the POSIX Initialization Thread Table. |
---|
| 1822 | */ |
---|
[8486081] | 1823 | |
---|
[5877cc3a] | 1824 | #else |
---|
[be1c11ed] | 1825 | |
---|
[5877cc3a] | 1826 | #ifndef CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT |
---|
[4175abd] | 1827 | #define CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT POSIX_Init |
---|
[5877cc3a] | 1828 | #endif |
---|
[5240c71c] | 1829 | |
---|
[5877cc3a] | 1830 | #ifndef CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE |
---|
[4175abd] | 1831 | #define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE \ |
---|
[b4f635e] | 1832 | CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE |
---|
[5877cc3a] | 1833 | #endif |
---|
[adbb578] | 1834 | |
---|
[5877cc3a] | 1835 | #ifdef CONFIGURE_INIT |
---|
[4175abd] | 1836 | posix_initialization_threads_table POSIX_Initialization_threads[] = { |
---|
| 1837 | { CONFIGURE_POSIX_INIT_THREAD_ENTRY_POINT, \ |
---|
| 1838 | CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE } |
---|
| 1839 | }; |
---|
[5877cc3a] | 1840 | #endif |
---|
[2eba45d] | 1841 | |
---|
[5877cc3a] | 1842 | #define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME \ |
---|
| 1843 | POSIX_Initialization_threads |
---|
[8486081] | 1844 | |
---|
[5877cc3a] | 1845 | #define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE \ |
---|
[9ed2bef] | 1846 | RTEMS_ARRAY_SIZE(CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME) |
---|
[5240c71c] | 1847 | |
---|
[5877cc3a] | 1848 | #endif /* CONFIGURE_POSIX_HAS_OWN_INIT_TASK_TABLE */ |
---|
[5240c71c] | 1849 | |
---|
[5877cc3a] | 1850 | #else /* CONFIGURE_POSIX_INIT_THREAD_TABLE */ |
---|
[be1c11ed] | 1851 | |
---|
[5877cc3a] | 1852 | #define CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME NULL |
---|
| 1853 | #define CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE 0 |
---|
[be1c11ed] | 1854 | |
---|
[5877cc3a] | 1855 | #endif |
---|
[be1c11ed] | 1856 | |
---|
[5877cc3a] | 1857 | #define CONFIGURE_MEMORY_FOR_POSIX \ |
---|
[a46e6b6d] | 1858 | ( CONFIGURE_MEMORY_FOR_POSIX_MUTEXES( CONFIGURE_MAXIMUM_POSIX_MUTEXES + \ |
---|
| 1859 | CONFIGURE_MAXIMUM_GO_CHANNELS + CONFIGURE_GO_INIT_MUTEXES) + \ |
---|
[5877cc3a] | 1860 | CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES( \ |
---|
[a46e6b6d] | 1861 | CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES + \ |
---|
| 1862 | CONFIGURE_MAXIMUM_GO_CHANNELS + CONFIGURE_GO_INIT_CONDITION_VARIABLES) + \ |
---|
[b5c9064] | 1863 | CONFIGURE_MEMORY_FOR_POSIX_KEYS( CONFIGURE_MAXIMUM_POSIX_KEYS, \ |
---|
| 1864 | CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS ) + \ |
---|
[5877cc3a] | 1865 | CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS( \ |
---|
[4175abd] | 1866 | CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS ) + \ |
---|
[5877cc3a] | 1867 | CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES( \ |
---|
[4175abd] | 1868 | CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES ) + \ |
---|
[61ae99b] | 1869 | CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUE_DESCRIPTORS( \ |
---|
| 1870 | CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS ) + \ |
---|
[5877cc3a] | 1871 | CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES( \ |
---|
[4175abd] | 1872 | CONFIGURE_MAXIMUM_POSIX_SEMAPHORES ) + \ |
---|
[5877cc3a] | 1873 | CONFIGURE_MEMORY_FOR_POSIX_BARRIERS(CONFIGURE_MAXIMUM_POSIX_BARRIERS) + \ |
---|
| 1874 | CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS( \ |
---|
[4175abd] | 1875 | CONFIGURE_MAXIMUM_POSIX_SPINLOCKS ) + \ |
---|
[5877cc3a] | 1876 | CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS( \ |
---|
[4175abd] | 1877 | CONFIGURE_MAXIMUM_POSIX_RWLOCKS ) + \ |
---|
[b4f635e] | 1878 | CONFIGURE_MEMORY_FOR_POSIX_TIMERS( CONFIGURE_MAXIMUM_POSIX_TIMERS ) \ |
---|
[5877cc3a] | 1879 | ) |
---|
| 1880 | #else |
---|
[352c9b2] | 1881 | |
---|
[5877cc3a] | 1882 | #define CONFIGURE_MAXIMUM_POSIX_THREADS 0 |
---|
| 1883 | #define CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API 0 |
---|
| 1884 | #define CONFIGURE_MEMORY_FOR_POSIX 0 |
---|
[352c9b2] | 1885 | |
---|
[5877cc3a] | 1886 | #endif /* RTEMS_POSIX_API */ |
---|
[352c9b2] | 1887 | |
---|
[5877cc3a] | 1888 | #ifndef CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE |
---|
| 1889 | #define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE 0 |
---|
[352c9b2] | 1890 | #endif |
---|
| 1891 | |
---|
[5877cc3a] | 1892 | /* |
---|
| 1893 | * This block of defines are for applications which use GNAT/RTEMS. |
---|
| 1894 | * GNAT implements each Ada task as a POSIX thread. |
---|
| 1895 | */ |
---|
| 1896 | #ifdef CONFIGURE_GNAT_RTEMS |
---|
[352c9b2] | 1897 | |
---|
[5877cc3a] | 1898 | /** |
---|
[27f071cd] | 1899 | * The GNAT run-time needs something less than (10) POSIX mutexes. |
---|
| 1900 | * We may be able to get by with less but why bother. |
---|
[5877cc3a] | 1901 | */ |
---|
| 1902 | #define CONFIGURE_GNAT_MUTEXES 10 |
---|
[352c9b2] | 1903 | |
---|
[5877cc3a] | 1904 | /** |
---|
[27f071cd] | 1905 | * This is the maximum number of Ada tasks which can be concurrently |
---|
| 1906 | * in existence. Twenty (20) are required to run all tests in the |
---|
| 1907 | * ACATS (formerly ACVC). |
---|
[5877cc3a] | 1908 | */ |
---|
| 1909 | #ifndef CONFIGURE_MAXIMUM_ADA_TASKS |
---|
| 1910 | #define CONFIGURE_MAXIMUM_ADA_TASKS 20 |
---|
| 1911 | #endif |
---|
[352c9b2] | 1912 | |
---|
[5877cc3a] | 1913 | /** |
---|
| 1914 | * This is the number of non-Ada tasks which invoked Ada code. |
---|
| 1915 | */ |
---|
| 1916 | #ifndef CONFIGURE_MAXIMUM_FAKE_ADA_TASKS |
---|
| 1917 | #define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0 |
---|
| 1918 | #endif |
---|
[352c9b2] | 1919 | |
---|
[5877cc3a] | 1920 | #else |
---|
| 1921 | #define CONFIGURE_GNAT_MUTEXES 0 |
---|
| 1922 | #define CONFIGURE_MAXIMUM_ADA_TASKS 0 |
---|
| 1923 | #define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0 |
---|
[352c9b2] | 1924 | #endif |
---|
| 1925 | |
---|
[a46e6b6d] | 1926 | #ifdef CONFIGURE_ENABLE_GO |
---|
| 1927 | |
---|
| 1928 | #ifndef CONFIGURE_MAXIMUM_POSIX_THREADS |
---|
| 1929 | #define CONFIGURE_MAXIMUM_POSIX_THREADS 1 |
---|
| 1930 | #endif |
---|
| 1931 | #ifndef CONFIGURE_MAXIMUM_POSIX_MUTEXES |
---|
| 1932 | #define CONFIGURE_MAXIMUM_POSIX_MUTEXES 1 |
---|
| 1933 | #endif |
---|
| 1934 | #ifndef CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES |
---|
| 1935 | #define CONFIGURE_MAXIMUM_CONDITION_VARIABLES 1 |
---|
| 1936 | #endif |
---|
| 1937 | |
---|
| 1938 | #define CONFIGURE_GO_INIT_MUTEXES 77 |
---|
| 1939 | #define CONFIGURE_GO_INIT_CONDITION_VARIABLES 4 |
---|
| 1940 | |
---|
| 1941 | #ifndef CONFIGURE_MAXIMUM_GOROUTINES |
---|
| 1942 | #define CONFIGURE_MAXIMUM_GOROUTINES 400 |
---|
| 1943 | #endif |
---|
| 1944 | |
---|
| 1945 | #define CONFIGURE_GOROUTINES_TASK_VARIABLES \ |
---|
| 1946 | (2 * CONFIGURE_MAXIMUM_GOROUTINES) |
---|
| 1947 | |
---|
| 1948 | #ifndef CONFIGURE_MAXIMUM_GO_CHANNELS |
---|
| 1949 | #define CONFIGURE_MAXIMUM_GO_CHANNELS 500 |
---|
| 1950 | #endif |
---|
| 1951 | |
---|
| 1952 | #else |
---|
| 1953 | #define CONFIGURE_GO_INIT_MUTEXES 0 |
---|
| 1954 | #define CONFIGURE_GO_INIT_CONDITION_VARIABLES 0 |
---|
| 1955 | #define CONFIGURE_MAXIMUM_GOROUTINES 0 |
---|
| 1956 | #define CONFIGURE_GOROUTINES_TASK_VARIABLES 0 |
---|
| 1957 | #define CONFIGURE_MAXIMUM_GO_CHANNELS 0 |
---|
| 1958 | #endif |
---|
[5aecf664] | 1959 | |
---|
| 1960 | #ifndef RTEMS_SCHEDSIM |
---|
[4175abd] | 1961 | /** |
---|
[27f071cd] | 1962 | * This macro specifies the amount of memory to be reserved for the |
---|
| 1963 | * Newlib C Library reentrancy structure -- if we are using newlib. |
---|
[4175abd] | 1964 | */ |
---|
| 1965 | |
---|
| 1966 | #if (defined(RTEMS_NEWLIB) && !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY)) |
---|
| 1967 | #define CONFIGURE_MEMORY_PER_TASK_FOR_NEWLIB \ |
---|
| 1968 | _Configure_From_workspace(sizeof(struct _reent)) |
---|
[5877cc3a] | 1969 | #else |
---|
[4175abd] | 1970 | #define CONFIGURE_MEMORY_PER_TASK_FOR_NEWLIB 0 |
---|
[5877cc3a] | 1971 | #endif |
---|
[352c9b2] | 1972 | |
---|
[5aecf664] | 1973 | #else |
---|
| 1974 | #define CONFIGURE_MEMORY_PER_TASK_FOR_NEWLIB 0 |
---|
| 1975 | #endif |
---|
| 1976 | |
---|
[b4f635e] | 1977 | /** |
---|
[27f071cd] | 1978 | * This is so we can account for tasks with stacks greater than minimum |
---|
| 1979 | * size. This is in bytes. |
---|
[b4f635e] | 1980 | */ |
---|
| 1981 | #ifndef CONFIGURE_EXTRA_TASK_STACKS |
---|
| 1982 | #define CONFIGURE_EXTRA_TASK_STACKS 0 |
---|
| 1983 | #endif |
---|
[5aecf664] | 1984 | |
---|
[8486081] | 1985 | /* |
---|
[3652ad35] | 1986 | * Calculate the RAM size based on the maximum number of objects configured. |
---|
| 1987 | */ |
---|
[08bae5e6] | 1988 | |
---|
| 1989 | #ifndef CONFIGURE_EXECUTIVE_RAM_SIZE |
---|
[3652ad35] | 1990 | |
---|
[5877cc3a] | 1991 | /** |
---|
[27f071cd] | 1992 | * Account for allocating the following per object |
---|
| 1993 | * + array of object control structures |
---|
| 1994 | * + local pointer table -- pointer per object plus a zero'th |
---|
| 1995 | * entry in the local pointer table. |
---|
[5877cc3a] | 1996 | */ |
---|
[b2b143f4] | 1997 | |
---|
[5877cc3a] | 1998 | #define CONFIGURE_MEMORY_FOR_TASKS(_tasks, _number_FP_tasks) \ |
---|
[3df4d74] | 1999 | ( \ |
---|
| 2000 | _Configure_Object_RAM(_tasks, sizeof(Thread_Control)) \ |
---|
| 2001 | + _Configure_Max_Objects(_tasks) \ |
---|
| 2002 | * ( \ |
---|
| 2003 | CONFIGURE_MEMORY_PER_TASK_FOR_CLASSIC_API \ |
---|
| 2004 | + CONFIGURE_MEMORY_PER_TASK_FOR_NEWLIB \ |
---|
| 2005 | + CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API \ |
---|
| 2006 | + CONFIGURE_MEMORY_PER_TASK_FOR_SCHEDULER \ |
---|
| 2007 | + _Configure_From_workspace( \ |
---|
| 2008 | (CONFIGURE_MAXIMUM_USER_EXTENSIONS + 1) * sizeof(void *) \ |
---|
| 2009 | ) \ |
---|
| 2010 | ) \ |
---|
| 2011 | + _Configure_Max_Objects(_number_FP_tasks) \ |
---|
| 2012 | * _Configure_From_workspace(CONTEXT_FP_SIZE) \ |
---|
| 2013 | * (CONTEXT_FP_SIZE != 0) \ |
---|
| 2014 | ) |
---|
[b2b143f4] | 2015 | |
---|
[5877cc3a] | 2016 | /** |
---|
[27f071cd] | 2017 | * This defines the amount of memory configured for the multiprocessing |
---|
| 2018 | * support required by this application. |
---|
[5877cc3a] | 2019 | */ |
---|
[df49c60] | 2020 | #ifdef CONFIGURE_MP_APPLICATION |
---|
[f2a776ac] | 2021 | #define CONFIGURE_MEMORY_FOR_MP \ |
---|
| 2022 | (CONFIGURE_MEMORY_FOR_PROXIES(CONFIGURE_MP_MAXIMUM_PROXIES) + \ |
---|
| 2023 | CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS( \ |
---|
| 2024 | CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS) + \ |
---|
[b4f635e] | 2025 | CONFIGURE_MEMORY_FOR_TASKS(1, 1) \ |
---|
[3652ad35] | 2026 | ) |
---|
| 2027 | #else |
---|
[f2a776ac] | 2028 | #define CONFIGURE_MEMORY_FOR_MP 0 |
---|
[3652ad35] | 2029 | #endif |
---|
[3b89891] | 2030 | |
---|
[5877cc3a] | 2031 | /** |
---|
[27f071cd] | 2032 | * The following macro is used to calculate the memory allocated by RTEMS |
---|
| 2033 | * for the message buffers associated with a particular message queue. |
---|
| 2034 | * There is a fixed amount of overhead per message. |
---|
[5877cc3a] | 2035 | */ |
---|
| 2036 | #define CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(_messages, _size) \ |
---|
| 2037 | _Configure_From_workspace( \ |
---|
| 2038 | (_messages) * ((_size) + sizeof(CORE_message_queue_Buffer_control))) |
---|
| 2039 | |
---|
| 2040 | /** |
---|
[27f071cd] | 2041 | * This macros is set to the amount of memory required for pending message |
---|
| 2042 | * buffers in bytes. It should be constructed by adding together a |
---|
| 2043 | * set of values determined by CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE. |
---|
[7042065] | 2044 | */ |
---|
| 2045 | #ifndef CONFIGURE_MESSAGE_BUFFER_MEMORY |
---|
[5877cc3a] | 2046 | #define CONFIGURE_MESSAGE_BUFFER_MEMORY 0 |
---|
[7042065] | 2047 | #endif |
---|
| 2048 | |
---|
[5877cc3a] | 2049 | /** |
---|
[27f071cd] | 2050 | * This macro is available just in case the confdefs.h file underallocates |
---|
| 2051 | * memory for a particular application. This lets the user add some extra |
---|
| 2052 | * memory in case something broken and underestimates. |
---|
[5877cc3a] | 2053 | * |
---|
[27f071cd] | 2054 | * It is also possible for cases where confdefs.h overallocates memory, |
---|
| 2055 | * you could substract memory from the allocated. The estimate is just |
---|
| 2056 | * that, an estimate, and assumes worst case alignment and padding on |
---|
| 2057 | * each allocated element. So in some cases it could be too conservative. |
---|
[5877cc3a] | 2058 | * |
---|
[27f071cd] | 2059 | * NOTE: Historically this was used for message buffers. |
---|
[7042065] | 2060 | */ |
---|
| 2061 | #ifndef CONFIGURE_MEMORY_OVERHEAD |
---|
[5877cc3a] | 2062 | #define CONFIGURE_MEMORY_OVERHEAD 0 |
---|
| 2063 | #endif |
---|
| 2064 | |
---|
| 2065 | /** |
---|
[27f071cd] | 2066 | * On architectures that use Simple Vectored Interrupts, it is RTEMS |
---|
| 2067 | * responsibility to allocate the vector table. This avoids reserving |
---|
| 2068 | * the memory on architectures that use the Programmable Interrupt |
---|
| 2069 | * Controller Vectored Interrupts. |
---|
[5877cc3a] | 2070 | */ |
---|
| 2071 | #if (CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE) |
---|
| 2072 | /* |
---|
| 2073 | * This is a (hopefully) temporary hack. On the mips, the number of |
---|
| 2074 | * vectors is NOT statically defined. But it has to be statically |
---|
| 2075 | * defined for this to work. This is an issue looking for a nice |
---|
| 2076 | * solution. |
---|
| 2077 | */ |
---|
| 2078 | #if defined(__mips__) |
---|
[94a88c1c] | 2079 | #define CONFIGURE_INTERRUPT_VECTOR_TABLE \ |
---|
| 2080 | _Configure_From_workspace( (sizeof(ISR_Handler_entry) * 256)) |
---|
[5877cc3a] | 2081 | #else |
---|
| 2082 | #define CONFIGURE_INTERRUPT_VECTOR_TABLE \ |
---|
[94a88c1c] | 2083 | _Configure_From_workspace( \ |
---|
| 2084 | (sizeof(ISR_Handler_entry) * ISR_NUMBER_OF_VECTORS)) |
---|
[5877cc3a] | 2085 | #endif |
---|
| 2086 | #else |
---|
| 2087 | #define CONFIGURE_INTERRUPT_VECTOR_TABLE 0 |
---|
[7042065] | 2088 | #endif |
---|
| 2089 | |
---|
[5877cc3a] | 2090 | /** |
---|
[27f071cd] | 2091 | * RTEMS uses one instance of an internal mutex class. This accounts |
---|
| 2092 | * for that mutex |
---|
[5877cc3a] | 2093 | */ |
---|
[b2b143f4] | 2094 | #define CONFIGURE_API_MUTEX_MEMORY \ |
---|
[5877cc3a] | 2095 | _Configure_Object_RAM(1, sizeof(API_Mutex_Control)) |
---|
[b2b143f4] | 2096 | |
---|
[06dcaf0] | 2097 | /** |
---|
[27f071cd] | 2098 | * This calculates the amount of memory reserved for the IDLE tasks. |
---|
| 2099 | * In an SMP system, each CPU core has its own idle task. |
---|
[4175abd] | 2100 | */ |
---|
[06dcaf0] | 2101 | #if defined(RTEMS_SMP) |
---|
[b4f635e] | 2102 | #define CONFIGURE_IDLE_TASKS_COUNT CONFIGURE_SMP_MAXIMUM_PROCESSORS |
---|
[06dcaf0] | 2103 | #else |
---|
[b4f635e] | 2104 | #define CONFIGURE_IDLE_TASKS_COUNT 1 |
---|
[06dcaf0] | 2105 | #endif |
---|
[4175abd] | 2106 | |
---|
[b4f635e] | 2107 | /** |
---|
[27f071cd] | 2108 | * This defines the formula used to compute the amount of memory |
---|
| 2109 | * reserved for IDLE task control structures. |
---|
[b4f635e] | 2110 | */ |
---|
| 2111 | #define CONFIGURE_MEMORY_FOR_IDLE_TASK \ |
---|
| 2112 | CONFIGURE_MEMORY_FOR_TASKS(CONFIGURE_IDLE_TASKS_COUNT, 0) |
---|
| 2113 | |
---|
[5877cc3a] | 2114 | /** |
---|
[27f071cd] | 2115 | * This macro accounts for general RTEMS system overhead. |
---|
[5877cc3a] | 2116 | */ |
---|
[df49c60] | 2117 | #define CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD \ |
---|
[4175abd] | 2118 | ( CONFIGURE_MEMORY_FOR_IDLE_TASK + /* IDLE and stack */ \ |
---|
[0faa9dad] | 2119 | CONFIGURE_MEMORY_FOR_SCHEDULER + /* Scheduler */ \ |
---|
[4175abd] | 2120 | CONFIGURE_INTERRUPT_VECTOR_TABLE + /* interrupt vectors */ \ |
---|
[5877cc3a] | 2121 | CONFIGURE_INTERRUPT_STACK_MEMORY + /* interrupt stack */ \ |
---|
[4175abd] | 2122 | CONFIGURE_API_MUTEX_MEMORY /* allocation mutex */ \ |
---|
[b3dcd9a2] | 2123 | ) |
---|
| 2124 | |
---|
[5877cc3a] | 2125 | /** |
---|
[27f071cd] | 2126 | * This macro provides a summation of the various task and thread |
---|
| 2127 | * requirements. |
---|
[7c5e3b3] | 2128 | */ |
---|
[5877cc3a] | 2129 | #define CONFIGURE_TOTAL_TASKS_AND_THREADS \ |
---|
[b6911069] | 2130 | (CONFIGURE_TASKS + \ |
---|
[a46e6b6d] | 2131 | CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_ADA_TASKS + \ |
---|
| 2132 | CONFIGURE_MAXIMUM_GOROUTINES) |
---|
[5877cc3a] | 2133 | |
---|
| 2134 | /** |
---|
[27f071cd] | 2135 | * This macro reserves the memory required by the statically configured |
---|
| 2136 | * user extensions. |
---|
[5877cc3a] | 2137 | */ |
---|
| 2138 | #define CONFIGURE_MEMORY_FOR_STATIC_EXTENSIONS \ |
---|
[466cf31d] | 2139 | (CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS == 0 ? 0 : \ |
---|
| 2140 | _Configure_From_workspace( \ |
---|
| 2141 | CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS \ |
---|
| 2142 | * sizeof(User_extensions_Switch_control) \ |
---|
| 2143 | )) |
---|
[5877cc3a] | 2144 | |
---|
| 2145 | /** |
---|
[27f071cd] | 2146 | * This macro provides a summation of the memory required by the |
---|
| 2147 | * Classic API as configured. |
---|
[5877cc3a] | 2148 | */ |
---|
| 2149 | #define CONFIGURE_MEMORY_FOR_CLASSIC \ |
---|
[a46e6b6d] | 2150 | (CONFIGURE_MEMORY_FOR_TASK_VARIABLES(CONFIGURE_MAXIMUM_TASK_VARIABLES + \ |
---|
| 2151 | CONFIGURE_GOROUTINES_TASK_VARIABLES) + \ |
---|
[f0f450a] | 2152 | CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS + \ |
---|
| 2153 | CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER ) + \ |
---|
[b2f216e1] | 2154 | CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_SEMAPHORES) + \ |
---|
[3652ad35] | 2155 | CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(CONFIGURE_MAXIMUM_MESSAGE_QUEUES) + \ |
---|
| 2156 | CONFIGURE_MEMORY_FOR_PARTITIONS(CONFIGURE_MAXIMUM_PARTITIONS) + \ |
---|
[e746a88] | 2157 | CONFIGURE_MEMORY_FOR_REGIONS( CONFIGURE_MAXIMUM_REGIONS ) + \ |
---|
[3652ad35] | 2158 | CONFIGURE_MEMORY_FOR_PORTS(CONFIGURE_MAXIMUM_PORTS) + \ |
---|
| 2159 | CONFIGURE_MEMORY_FOR_PERIODS(CONFIGURE_MAXIMUM_PERIODS) + \ |
---|
[659019e] | 2160 | CONFIGURE_MEMORY_FOR_BARRIERS(CONFIGURE_BARRIERS) + \ |
---|
[5877cc3a] | 2161 | CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(CONFIGURE_MAXIMUM_USER_EXTENSIONS) \ |
---|
| 2162 | ) |
---|
| 2163 | |
---|
[06dcaf0] | 2164 | #if defined(RTEMS_SMP) |
---|
| 2165 | #define CONFIGURE_MEMORY_FOR_SMP \ |
---|
| 2166 | (CONFIGURE_SMP_MAXIMUM_PROCESSORS * \ |
---|
| 2167 | _Configure_From_workspace( CONFIGURE_INTERRUPT_STACK_SIZE ) \ |
---|
| 2168 | ) |
---|
| 2169 | #else |
---|
| 2170 | #define CONFIGURE_MEMORY_FOR_SMP 0 |
---|
| 2171 | #endif |
---|
| 2172 | |
---|
[5877cc3a] | 2173 | /** |
---|
[27f071cd] | 2174 | * This calculates the memory required for the executive workspace. |
---|
[5877cc3a] | 2175 | */ |
---|
| 2176 | #define CONFIGURE_EXECUTIVE_RAM_SIZE \ |
---|
| 2177 | (( \ |
---|
[df49c60] | 2178 | CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD + \ |
---|
[5877cc3a] | 2179 | CONFIGURE_MEMORY_FOR_TASKS( \ |
---|
| 2180 | CONFIGURE_TOTAL_TASKS_AND_THREADS, CONFIGURE_TOTAL_TASKS_AND_THREADS) + \ |
---|
| 2181 | CONFIGURE_MEMORY_FOR_CLASSIC + \ |
---|
| 2182 | CONFIGURE_MEMORY_FOR_POSIX + \ |
---|
| 2183 | CONFIGURE_MEMORY_FOR_STATIC_EXTENSIONS + \ |
---|
| 2184 | CONFIGURE_MEMORY_FOR_MP + \ |
---|
[06dcaf0] | 2185 | CONFIGURE_MEMORY_FOR_SMP + \ |
---|
[7042065] | 2186 | CONFIGURE_MESSAGE_BUFFER_MEMORY + \ |
---|
[b4f635e] | 2187 | (CONFIGURE_MEMORY_OVERHEAD * 1024) \ |
---|
[7042065] | 2188 | ) & ~0x7) |
---|
[b4f635e] | 2189 | |
---|
| 2190 | /* |
---|
| 2191 | * Now account for any extra memory that initialization tasks or threads |
---|
| 2192 | * may have requested. |
---|
| 2193 | */ |
---|
| 2194 | |
---|
| 2195 | /** |
---|
[27f071cd] | 2196 | * This accounts for any extra memory required by the Classic API |
---|
| 2197 | * Initialization Task. |
---|
[b4f635e] | 2198 | */ |
---|
| 2199 | #if (CONFIGURE_INIT_TASK_STACK_SIZE > CONFIGURE_MINIMUM_TASK_STACK_SIZE) |
---|
| 2200 | #define CONFIGURE_INITIALIZATION_THREADS_STACKS_CLASSIC_PART \ |
---|
| 2201 | (CONFIGURE_INIT_TASK_STACK_SIZE - CONFIGURE_MINIMUM_TASK_STACK_SIZE) |
---|
| 2202 | #else |
---|
| 2203 | #define CONFIGURE_INITIALIZATION_THREADS_STACKS_CLASSIC_PART 0 |
---|
[08bae5e6] | 2204 | #endif |
---|
| 2205 | |
---|
[b4f635e] | 2206 | /** |
---|
[27f071cd] | 2207 | * This accounts for any extra memory required by the POSIX API |
---|
| 2208 | * Initialization Thread. |
---|
[b4f635e] | 2209 | */ |
---|
| 2210 | #if defined(RTEMS_POSIX_API) && \ |
---|
| 2211 | (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE > \ |
---|
| 2212 | CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE) |
---|
| 2213 | #define CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART \ |
---|
| 2214 | (CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE - \ |
---|
| 2215 | CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE) |
---|
| 2216 | #else |
---|
| 2217 | #define CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART 0 |
---|
| 2218 | #endif |
---|
| 2219 | |
---|
| 2220 | /** |
---|
[27f071cd] | 2221 | * This macro provides a summation of the various initialization task |
---|
| 2222 | * and thread stack requirements. |
---|
[b4f635e] | 2223 | */ |
---|
| 2224 | #define CONFIGURE_INITIALIZATION_THREADS_EXTRA_STACKS \ |
---|
| 2225 | (CONFIGURE_INITIALIZATION_THREADS_STACKS_CLASSIC_PART + \ |
---|
| 2226 | CONFIGURE_INITIALIZATION_THREADS_STACKS_POSIX_PART) |
---|
| 2227 | |
---|
| 2228 | #define CONFIGURE_IDLE_TASKS_STACK \ |
---|
| 2229 | (CONFIGURE_IDLE_TASKS_COUNT * \ |
---|
[9fa3cf0d] | 2230 | _Configure_From_stackspace( CONFIGURE_IDLE_TASK_STACK_SIZE ) ) |
---|
[b4f635e] | 2231 | |
---|
| 2232 | #define CONFIGURE_TASKS_STACK \ |
---|
[b6911069] | 2233 | (_Configure_Max_Objects( CONFIGURE_TASKS ) * \ |
---|
[9fa3cf0d] | 2234 | _Configure_From_stackspace( CONFIGURE_MINIMUM_TASK_STACK_SIZE ) ) |
---|
[b4f635e] | 2235 | |
---|
| 2236 | #define CONFIGURE_POSIX_THREADS_STACK \ |
---|
| 2237 | (_Configure_Max_Objects( CONFIGURE_MAXIMUM_POSIX_THREADS ) * \ |
---|
[9fa3cf0d] | 2238 | _Configure_From_stackspace( CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE ) ) |
---|
[b4f635e] | 2239 | |
---|
| 2240 | #define CONFIGURE_GOROUTINES_STACK \ |
---|
| 2241 | (_Configure_Max_Objects( CONFIGURE_MAXIMUM_GOROUTINES ) * \ |
---|
[9fa3cf0d] | 2242 | _Configure_From_stackspace( CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE ) ) |
---|
[b4f635e] | 2243 | |
---|
| 2244 | #define CONFIGURE_ADA_TASKS_STACK \ |
---|
| 2245 | (_Configure_Max_Objects( CONFIGURE_MAXIMUM_ADA_TASKS ) * \ |
---|
[9fa3cf0d] | 2246 | _Configure_From_stackspace( CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE ) ) |
---|
[b4f635e] | 2247 | |
---|
| 2248 | #else /* CONFIGURE_EXECUTIVE_RAM_SIZE */ |
---|
| 2249 | |
---|
| 2250 | #define CONFIGURE_IDLE_TASKS_STACK 0 |
---|
| 2251 | #define CONFIGURE_INITIALIZATION_THREADS_EXTRA_STACKS 0 |
---|
| 2252 | #define CONFIGURE_TASKS_STACK 0 |
---|
| 2253 | #define CONFIGURE_POSIX_THREADS_STACK 0 |
---|
| 2254 | #define CONFIGURE_GOROUTINES_STACK 0 |
---|
| 2255 | #define CONFIGURE_ADA_TASKS_STACK 0 |
---|
| 2256 | |
---|
| 2257 | #if CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK != 0 |
---|
| 2258 | #error "CONFIGURE_EXECUTIVE_RAM_SIZE defined with request for CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK" |
---|
| 2259 | #endif |
---|
| 2260 | |
---|
| 2261 | #if CONFIGURE_EXTRA_TASK_STACKS != 0 |
---|
| 2262 | #error "CONFIGURE_EXECUTIVE_RAM_SIZE defined with request for CONFIGURE_EXTRA_TASK_STACKS" |
---|
| 2263 | #endif |
---|
| 2264 | |
---|
| 2265 | #endif /* CONFIGURE_EXECUTIVE_RAM_SIZE */ |
---|
| 2266 | |
---|
| 2267 | #define CONFIGURE_STACK_SPACE_SIZE \ |
---|
| 2268 | ( \ |
---|
| 2269 | CONFIGURE_IDLE_TASKS_STACK + \ |
---|
| 2270 | CONFIGURE_INITIALIZATION_THREADS_EXTRA_STACKS + \ |
---|
| 2271 | CONFIGURE_TASKS_STACK + \ |
---|
| 2272 | CONFIGURE_POSIX_THREADS_STACK + \ |
---|
| 2273 | CONFIGURE_GOROUTINES_STACK + \ |
---|
| 2274 | CONFIGURE_ADA_TASKS_STACK + \ |
---|
| 2275 | CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK + \ |
---|
[b6911069] | 2276 | CONFIGURE_LIBBLOCK_TASK_EXTRA_STACKS + \ |
---|
[b4f635e] | 2277 | CONFIGURE_EXTRA_TASK_STACKS \ |
---|
| 2278 | ) |
---|
| 2279 | |
---|
[08bae5e6] | 2280 | #ifdef CONFIGURE_INIT |
---|
[5877cc3a] | 2281 | /** |
---|
[27f071cd] | 2282 | * This is the Classic API Configuration Table. |
---|
[5877cc3a] | 2283 | */ |
---|
| 2284 | rtems_api_configuration_table Configuration_RTEMS_API = { |
---|
[b6911069] | 2285 | CONFIGURE_TASKS, |
---|
[4cb19041] | 2286 | CONFIGURE_NOTEPADS_ENABLED, |
---|
[f0f450a] | 2287 | CONFIGURE_MAXIMUM_TIMERS + CONFIGURE_TIMER_FOR_SHARED_MEMORY_DRIVER, |
---|
[b2f216e1] | 2288 | CONFIGURE_SEMAPHORES, |
---|
[5877cc3a] | 2289 | CONFIGURE_MAXIMUM_MESSAGE_QUEUES, |
---|
| 2290 | CONFIGURE_MAXIMUM_PARTITIONS, |
---|
| 2291 | CONFIGURE_MAXIMUM_REGIONS, |
---|
| 2292 | CONFIGURE_MAXIMUM_PORTS, |
---|
| 2293 | CONFIGURE_MAXIMUM_PERIODS, |
---|
[659019e] | 2294 | CONFIGURE_BARRIERS, |
---|
[5877cc3a] | 2295 | CONFIGURE_INIT_TASK_TABLE_SIZE, |
---|
| 2296 | CONFIGURE_INIT_TASK_TABLE |
---|
| 2297 | }; |
---|
[e6d4b1d] | 2298 | |
---|
[5877cc3a] | 2299 | #ifdef RTEMS_POSIX_API |
---|
| 2300 | /** |
---|
[27f071cd] | 2301 | * This is the POSIX API Configuration Table. |
---|
[5877cc3a] | 2302 | */ |
---|
| 2303 | posix_api_configuration_table Configuration_POSIX_API = { |
---|
[a46e6b6d] | 2304 | CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_ADA_TASKS + |
---|
| 2305 | CONFIGURE_MAXIMUM_GOROUTINES, |
---|
[5877cc3a] | 2306 | CONFIGURE_MAXIMUM_POSIX_MUTEXES + CONFIGURE_GNAT_MUTEXES + |
---|
[a46e6b6d] | 2307 | CONFIGURE_MAXIMUM_ADA_TASKS + CONFIGURE_MAXIMUM_FAKE_ADA_TASKS + |
---|
| 2308 | CONFIGURE_GO_INIT_MUTEXES + CONFIGURE_MAXIMUM_GO_CHANNELS, |
---|
[5877cc3a] | 2309 | CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES + |
---|
[a46e6b6d] | 2310 | CONFIGURE_MAXIMUM_ADA_TASKS + CONFIGURE_MAXIMUM_FAKE_ADA_TASKS + |
---|
| 2311 | CONFIGURE_GO_INIT_CONDITION_VARIABLES + CONFIGURE_MAXIMUM_GO_CHANNELS, |
---|
[5877cc3a] | 2312 | CONFIGURE_MAXIMUM_POSIX_KEYS, |
---|
[b5c9064] | 2313 | CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS, |
---|
[5877cc3a] | 2314 | CONFIGURE_MAXIMUM_POSIX_TIMERS, |
---|
| 2315 | CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS, |
---|
| 2316 | CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES, |
---|
[ade17392] | 2317 | CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS, |
---|
[5877cc3a] | 2318 | CONFIGURE_MAXIMUM_POSIX_SEMAPHORES, |
---|
| 2319 | CONFIGURE_MAXIMUM_POSIX_BARRIERS, |
---|
| 2320 | CONFIGURE_MAXIMUM_POSIX_RWLOCKS, |
---|
| 2321 | CONFIGURE_MAXIMUM_POSIX_SPINLOCKS, |
---|
| 2322 | CONFIGURE_POSIX_INIT_THREAD_TABLE_SIZE, |
---|
| 2323 | CONFIGURE_POSIX_INIT_THREAD_TABLE_NAME |
---|
| 2324 | }; |
---|
| 2325 | #endif |
---|
[2eba45d] | 2326 | |
---|
[6784547] | 2327 | /** |
---|
[27f071cd] | 2328 | * This variable specifies the minimum stack size for tasks in an RTEMS |
---|
| 2329 | * application. |
---|
[ecf0f4c] | 2330 | * |
---|
[27f071cd] | 2331 | * NOTE: This is left as a simple uint32_t so it can be externed as |
---|
| 2332 | * needed without requring being high enough logical to |
---|
| 2333 | * include the full configuration table. |
---|
[ecf0f4c] | 2334 | */ |
---|
[28352fae] | 2335 | uint32_t rtems_minimum_stack_size = |
---|
[ecf0f4c] | 2336 | CONFIGURE_MINIMUM_TASK_STACK_SIZE; |
---|
| 2337 | |
---|
[6784547] | 2338 | /** |
---|
[27f071cd] | 2339 | * This variable specifies the maximum priority value that |
---|
| 2340 | * a task may have. This must be a power of 2 between 4 |
---|
| 2341 | * and 256 and is specified in terms of Classic API |
---|
| 2342 | * priority values. |
---|
[80f9d77] | 2343 | * |
---|
[27f071cd] | 2344 | * NOTE: This is left as a simple uint8_t so it can be externed as |
---|
| 2345 | * needed without requring being high enough logical to |
---|
| 2346 | * include the full configuration table. |
---|
[80f9d77] | 2347 | */ |
---|
| 2348 | uint8_t rtems_maximum_priority = CONFIGURE_MAXIMUM_PRIORITY; |
---|
| 2349 | |
---|
[5877cc3a] | 2350 | /** |
---|
[27f071cd] | 2351 | * This is the primary Configuration Table for this application. |
---|
[5877cc3a] | 2352 | */ |
---|
[ae4f125e] | 2353 | const rtems_configuration_table Configuration = { |
---|
[5877cc3a] | 2354 | CONFIGURE_EXECUTIVE_RAM_SIZE, /* required RTEMS workspace */ |
---|
[b4f635e] | 2355 | CONFIGURE_STACK_SPACE_SIZE, /* required stack space */ |
---|
[5877cc3a] | 2356 | CONFIGURE_MAXIMUM_USER_EXTENSIONS, /* maximum dynamic extensions */ |
---|
| 2357 | CONFIGURE_MICROSECONDS_PER_TICK, /* microseconds per clock tick */ |
---|
[50fc8f6] | 2358 | 1000 * CONFIGURE_MICROSECONDS_PER_TICK, /* nanoseconds per clock tick */ |
---|
[5877cc3a] | 2359 | CONFIGURE_TICKS_PER_TIMESLICE, /* ticks per timeslice quantum */ |
---|
| 2360 | CONFIGURE_IDLE_TASK_BODY, /* user's IDLE task */ |
---|
| 2361 | CONFIGURE_IDLE_TASK_STACK_SIZE, /* IDLE task stack size */ |
---|
| 2362 | CONFIGURE_INTERRUPT_STACK_SIZE, /* interrupt stack size */ |
---|
[9fa3cf0d] | 2363 | CONFIGURE_TASK_STACK_ALLOCATOR_INIT, /* stack allocator init */ |
---|
[5877cc3a] | 2364 | CONFIGURE_TASK_STACK_ALLOCATOR, /* stack allocator */ |
---|
| 2365 | CONFIGURE_TASK_STACK_DEALLOCATOR, /* stack deallocator */ |
---|
| 2366 | CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY, /* true to clear memory */ |
---|
[b4f635e] | 2367 | #ifdef CONFIGURE_UNIFIED_WORK_AREAS /* true for unified work areas */ |
---|
| 2368 | true, |
---|
| 2369 | #else |
---|
| 2370 | false, |
---|
| 2371 | #endif |
---|
| 2372 | #ifdef CONFIGURE_TASK_STACK_ALLOCATOR_AVOIDS_WORK_SPACE /* true to avoid |
---|
| 2373 | work space for thread stack |
---|
| 2374 | allocation */ |
---|
| 2375 | true, |
---|
| 2376 | #else |
---|
| 2377 | false, |
---|
| 2378 | #endif |
---|
[f913c79] | 2379 | #ifdef RTEMS_SMP |
---|
| 2380 | #ifdef CONFIGURE_SMP_APPLICATION |
---|
| 2381 | true, |
---|
| 2382 | #else |
---|
| 2383 | false, |
---|
| 2384 | #endif |
---|
| 2385 | #endif |
---|
[5877cc3a] | 2386 | CONFIGURE_MAXIMUM_DRIVERS, /* maximum device drivers */ |
---|
| 2387 | CONFIGURE_NUMBER_OF_DRIVERS, /* static device drivers */ |
---|
| 2388 | Device_drivers, /* pointer to driver table */ |
---|
| 2389 | CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS, /* number of static extensions */ |
---|
| 2390 | CONFIGURE_INITIAL_EXTENSION_TABLE, /* pointer to static extensions */ |
---|
| 2391 | #if defined(RTEMS_MULTIPROCESSING) |
---|
| 2392 | CONFIGURE_MULTIPROCESSING_TABLE, /* pointer to MP config table */ |
---|
| 2393 | #endif |
---|
[6c2eedc] | 2394 | #ifdef RTEMS_SMP |
---|
| 2395 | CONFIGURE_SMP_MAXIMUM_PROCESSORS |
---|
| 2396 | #endif |
---|
[5877cc3a] | 2397 | }; |
---|
[08bae5e6] | 2398 | #endif |
---|
| 2399 | |
---|
| 2400 | #endif /* CONFIGURE_HAS_OWN_CONFIGURATION_TABLE */ |
---|
| 2401 | |
---|
[06dcaf0] | 2402 | #if defined(RTEMS_SMP) |
---|
| 2403 | /* |
---|
| 2404 | * Instantiate the Per CPU information based upon the user configuration. |
---|
| 2405 | */ |
---|
| 2406 | #if defined(CONFIGURE_INIT) |
---|
[c236082] | 2407 | Per_CPU_Control_envelope _Per_CPU_Information[CONFIGURE_SMP_MAXIMUM_PROCESSORS]; |
---|
[06dcaf0] | 2408 | #endif |
---|
| 2409 | |
---|
| 2410 | #endif |
---|
| 2411 | |
---|
[0ab34c90] | 2412 | /* |
---|
| 2413 | * If the user has configured a set of Classic API Initialization Tasks, |
---|
| 2414 | * then we need to install the code that runs that loop. |
---|
| 2415 | */ |
---|
| 2416 | #ifdef CONFIGURE_INIT |
---|
[d15bae6] | 2417 | #if defined(CONFIGURE_RTEMS_INIT_TASKS_TABLE) || \ |
---|
| 2418 | defined(CONFIGURE_HAS_OWN_INIT_TASK_TABLE) |
---|
[0ab34c90] | 2419 | void (*_RTEMS_tasks_Initialize_user_tasks_p)(void) = |
---|
| 2420 | _RTEMS_tasks_Initialize_user_tasks_body; |
---|
| 2421 | #else |
---|
| 2422 | void (*_RTEMS_tasks_Initialize_user_tasks_p)(void) = NULL; |
---|
| 2423 | #endif |
---|
| 2424 | #endif |
---|
| 2425 | |
---|
| 2426 | /* |
---|
| 2427 | * If the user has configured a set of POSIX Initialization Threads, |
---|
| 2428 | * then we need to install the code that runs that loop. |
---|
| 2429 | */ |
---|
[5a8bc44] | 2430 | #ifdef RTEMS_POSIX_API |
---|
| 2431 | #ifdef CONFIGURE_INIT |
---|
[d15bae6] | 2432 | #if defined(CONFIGURE_POSIX_INIT_THREAD_TABLE) || \ |
---|
| 2433 | defined(CONFIGURE_POSIX_HAS_OWN_INIT_THREAD_TABLE) |
---|
[28352fae] | 2434 | void (*_POSIX_Threads_Initialize_user_threads_p)(void) = |
---|
[4175abd] | 2435 | _POSIX_Threads_Initialize_user_threads_body; |
---|
[5a8bc44] | 2436 | #else |
---|
| 2437 | void (*_POSIX_Threads_Initialize_user_threads_p)(void) = NULL; |
---|
| 2438 | #endif |
---|
[0ab34c90] | 2439 | #endif |
---|
| 2440 | #endif |
---|
| 2441 | |
---|
[08bae5e6] | 2442 | #ifdef __cplusplus |
---|
| 2443 | } |
---|
| 2444 | #endif |
---|
[8486081] | 2445 | |
---|
[df0bfdf] | 2446 | /****************************************************************** |
---|
| 2447 | ****************************************************************** |
---|
| 2448 | ****************************************************************** |
---|
| 2449 | * CONFIGURATION WARNINGS AND ERROR CHECKING * |
---|
| 2450 | ****************************************************************** |
---|
| 2451 | ****************************************************************** |
---|
| 2452 | ****************************************************************** |
---|
[df49c60] | 2453 | */ |
---|
| 2454 | |
---|
[b4f635e] | 2455 | #if defined(CONFIGURE_CONFDEFS_DEBUG) && defined(CONFIGURE_INIT) |
---|
| 2456 | /** |
---|
[27f071cd] | 2457 | * This is a debug mechanism, so if you need to, the executable will |
---|
| 2458 | * have a structure with various partial values. Add to this as you |
---|
| 2459 | * need to. Viewing this structure in gdb combined with dumping |
---|
| 2460 | * the Configuration structures generated should help a lot in tracing |
---|
| 2461 | * down errors and analyzing where over and under allocations are. |
---|
[b4f635e] | 2462 | */ |
---|
| 2463 | typedef struct { |
---|
| 2464 | uint32_t SYSTEM_OVERHEAD; |
---|
| 2465 | uint32_t STATIC_EXTENSIONS; |
---|
| 2466 | uint32_t INITIALIZATION_THREADS_STACKS; |
---|
| 2467 | |
---|
| 2468 | uint32_t PER_INTEGER_TASK; |
---|
| 2469 | uint32_t FP_OVERHEAD; |
---|
| 2470 | uint32_t CLASSIC; |
---|
| 2471 | uint32_t POSIX; |
---|
| 2472 | |
---|
| 2473 | /* System overhead pieces */ |
---|
| 2474 | uint32_t INTERRUPT_VECTOR_TABLE; |
---|
| 2475 | uint32_t INTERRUPT_STACK_MEMORY; |
---|
| 2476 | uint32_t MEMORY_FOR_IDLE_TASK; |
---|
| 2477 | uint32_t MEMORY_FOR_SCHEDULER; |
---|
| 2478 | uint32_t MEMORY_PER_TASK_FOR_SCHEDULER; |
---|
| 2479 | |
---|
| 2480 | /* Classic API Pieces */ |
---|
| 2481 | uint32_t CLASSIC_TASKS; |
---|
| 2482 | uint32_t TASK_VARIABLES; |
---|
| 2483 | uint32_t TIMERS; |
---|
| 2484 | uint32_t SEMAPHORES; |
---|
| 2485 | uint32_t MESSAGE_QUEUES; |
---|
| 2486 | uint32_t PARTITIONS; |
---|
| 2487 | uint32_t REGIONS; |
---|
| 2488 | uint32_t PORTS; |
---|
| 2489 | uint32_t PERIODS; |
---|
| 2490 | uint32_t BARRIERS; |
---|
| 2491 | uint32_t USER_EXTENSIONS; |
---|
| 2492 | |
---|
| 2493 | #ifdef RTEMS_POSIX_API |
---|
| 2494 | /* POSIX API Pieces */ |
---|
| 2495 | uint32_t POSIX_MUTEXES; |
---|
| 2496 | uint32_t POSIX_CONDITION_VARIABLES; |
---|
| 2497 | uint32_t POSIX_KEYS; |
---|
| 2498 | uint32_t POSIX_TIMERS; |
---|
| 2499 | uint32_t POSIX_QUEUED_SIGNALS; |
---|
| 2500 | uint32_t POSIX_MESSAGE_QUEUES; |
---|
| 2501 | uint32_t POSIX_SEMAPHORES; |
---|
| 2502 | uint32_t POSIX_BARRIERS; |
---|
| 2503 | uint32_t POSIX_SPINLOCKS; |
---|
| 2504 | uint32_t POSIX_RWLOCKS; |
---|
| 2505 | #endif |
---|
| 2506 | |
---|
| 2507 | /* Stack space sizes */ |
---|
| 2508 | uint32_t IDLE_TASKS_STACK; |
---|
| 2509 | uint32_t INITIALIZATION_THREADS_EXTRA_STACKS; |
---|
| 2510 | uint32_t TASKS_STACK; |
---|
| 2511 | uint32_t POSIX_THREADS_STACK; |
---|
| 2512 | uint32_t GOROUTINES_STACK; |
---|
| 2513 | uint32_t ADA_TASKS_STACK; |
---|
| 2514 | uint32_t EXTRA_MPCI_RECEIVE_SERVER_STACK; |
---|
| 2515 | uint32_t EXTRA_TASK_STACKS; |
---|
| 2516 | } Configuration_Debug_t; |
---|
| 2517 | |
---|
| 2518 | Configuration_Debug_t Configuration_Memory_Debug = { |
---|
| 2519 | /* General Information */ |
---|
| 2520 | CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD, |
---|
| 2521 | CONFIGURE_MEMORY_FOR_STATIC_EXTENSIONS, |
---|
| 2522 | CONFIGURE_INITIALIZATION_THREADS_EXTRA_STACKS, |
---|
| 2523 | CONFIGURE_MEMORY_FOR_TASKS(1, 0), |
---|
| 2524 | CONFIGURE_MEMORY_FOR_TASKS(0, 1), |
---|
| 2525 | CONFIGURE_MEMORY_FOR_CLASSIC, |
---|
| 2526 | CONFIGURE_MEMORY_FOR_POSIX, |
---|
| 2527 | |
---|
| 2528 | /* System overhead pieces */ |
---|
| 2529 | CONFIGURE_INTERRUPT_VECTOR_TABLE, |
---|
| 2530 | CONFIGURE_INTERRUPT_STACK_MEMORY, |
---|
| 2531 | CONFIGURE_MEMORY_FOR_IDLE_TASK, |
---|
| 2532 | CONFIGURE_MEMORY_FOR_SCHEDULER, |
---|
| 2533 | CONFIGURE_MEMORY_PER_TASK_FOR_SCHEDULER, |
---|
| 2534 | |
---|
| 2535 | /* Classic API Pieces */ |
---|
| 2536 | CONFIGURE_MEMORY_FOR_TASKS(CONFIGURE_MAXIMUM_TASKS, 0), |
---|
| 2537 | CONFIGURE_MEMORY_FOR_TASK_VARIABLES(CONFIGURE_MAXIMUM_TASK_VARIABLES + |
---|
| 2538 | CONFIGURE_GOROUTINES_TASK_VARIABLES), |
---|
| 2539 | CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS), |
---|
| 2540 | CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_SEMAPHORES), |
---|
| 2541 | CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(CONFIGURE_MAXIMUM_MESSAGE_QUEUES), |
---|
| 2542 | CONFIGURE_MEMORY_FOR_PARTITIONS(CONFIGURE_MAXIMUM_PARTITIONS), |
---|
| 2543 | CONFIGURE_MEMORY_FOR_REGIONS( CONFIGURE_MAXIMUM_REGIONS ), |
---|
| 2544 | CONFIGURE_MEMORY_FOR_PORTS(CONFIGURE_MAXIMUM_PORTS), |
---|
| 2545 | CONFIGURE_MEMORY_FOR_PERIODS(CONFIGURE_MAXIMUM_PERIODS), |
---|
| 2546 | CONFIGURE_MEMORY_FOR_BARRIERS(CONFIGURE_BARRIERS), |
---|
| 2547 | CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(CONFIGURE_MAXIMUM_USER_EXTENSIONS), |
---|
| 2548 | |
---|
| 2549 | #ifdef RTEMS_POSIX_API |
---|
| 2550 | /* POSIX API Pieces */ |
---|
| 2551 | CONFIGURE_MEMORY_FOR_POSIX_MUTEXES( CONFIGURE_MAXIMUM_POSIX_MUTEXES + |
---|
| 2552 | CONFIGURE_MAXIMUM_GO_CHANNELS + CONFIGURE_GO_INIT_MUTEXES), |
---|
| 2553 | CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES( |
---|
| 2554 | CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES + |
---|
| 2555 | CONFIGURE_MAXIMUM_GO_CHANNELS + CONFIGURE_GO_INIT_CONDITION_VARIABLES), |
---|
[b5c9064] | 2556 | CONFIGURE_MEMORY_FOR_POSIX_KEYS( CONFIGURE_MAXIMUM_POSIX_KEYS, \ |
---|
| 2557 | CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS ), |
---|
[b4f635e] | 2558 | CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS( |
---|
| 2559 | CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS ), |
---|
| 2560 | CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES( |
---|
| 2561 | CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES ), |
---|
| 2562 | CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES( CONFIGURE_MAXIMUM_POSIX_SEMAPHORES ), |
---|
| 2563 | CONFIGURE_MEMORY_FOR_POSIX_BARRIERS( CONFIGURE_MAXIMUM_POSIX_BARRIERS ), |
---|
| 2564 | CONFIGURE_MEMORY_FOR_POSIX_SPINLOCKS( CONFIGURE_MAXIMUM_POSIX_SPINLOCKS ), |
---|
| 2565 | CONFIGURE_MEMORY_FOR_POSIX_RWLOCKS( CONFIGURE_MAXIMUM_POSIX_RWLOCKS ), |
---|
| 2566 | CONFIGURE_MEMORY_FOR_POSIX_TIMERS( CONFIGURE_MAXIMUM_POSIX_TIMERS ), |
---|
| 2567 | #endif |
---|
| 2568 | |
---|
| 2569 | /* Stack space sizes */ |
---|
| 2570 | CONFIGURE_IDLE_TASKS_STACK, |
---|
| 2571 | CONFIGURE_INITIALIZATION_THREADS_EXTRA_STACKS, |
---|
| 2572 | CONFIGURE_TASKS_STACK, |
---|
| 2573 | CONFIGURE_POSIX_THREADS_STACK, |
---|
| 2574 | CONFIGURE_GOROUTINES_STACK, |
---|
| 2575 | CONFIGURE_ADA_TASKS_STACK, |
---|
| 2576 | CONFIGURE_EXTRA_MPCI_RECEIVE_SERVER_STACK, |
---|
| 2577 | CONFIGURE_EXTRA_TASK_STACKS |
---|
| 2578 | }; |
---|
| 2579 | #endif |
---|
| 2580 | |
---|
[df49c60] | 2581 | /* |
---|
[80f9d77] | 2582 | * Make sure a task/thread of some sort is configured. |
---|
| 2583 | * |
---|
| 2584 | * When analyzing RTEMS to find the smallest possible of memory |
---|
| 2585 | * that must be allocated, you probably do want to configure 0 |
---|
| 2586 | * tasks/threads so there is a smaller set of calls to _Workspace_Allocate |
---|
| 2587 | * to analyze. |
---|
| 2588 | */ |
---|
| 2589 | #if !defined(CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION) |
---|
| 2590 | #if (CONFIGURE_MAXIMUM_TASKS == 0) && \ |
---|
| 2591 | (CONFIGURE_MAXIMUM_POSIX_THREADS == 0) && \ |
---|
[a46e6b6d] | 2592 | (CONFIGURE_MAXIMUM_ADA_TASKS == 0) && \ |
---|
| 2593 | (CONFIGURE_MAXIMUM_GOROUTINES == 0) |
---|
[80f9d77] | 2594 | #error "CONFIGURATION ERROR: No tasks or threads configured!!" |
---|
| 2595 | #endif |
---|
[df49c60] | 2596 | #endif |
---|
| 2597 | |
---|
[5aecf664] | 2598 | #ifndef RTEMS_SCHEDSIM |
---|
[df49c60] | 2599 | /* |
---|
| 2600 | * Make sure at least one of the initialization task/thread |
---|
| 2601 | * tables was defined. |
---|
| 2602 | */ |
---|
| 2603 | #if !defined(CONFIGURE_RTEMS_INIT_TASKS_TABLE) && \ |
---|
| 2604 | !defined(CONFIGURE_POSIX_INIT_THREAD_TABLE) && \ |
---|
[80f9d77] | 2605 | !defined(CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION) |
---|
[168ba07] | 2606 | #error "CONFIGURATION ERROR: No initialization tasks or threads configured!!" |
---|
[df49c60] | 2607 | #endif |
---|
[5aecf664] | 2608 | #endif |
---|
[df49c60] | 2609 | |
---|
[df0bfdf] | 2610 | /* |
---|
| 2611 | * If the user is trying to configure a multiprocessing application and |
---|
| 2612 | * RTEMS was not configured and built multiprocessing, then error out. |
---|
| 2613 | */ |
---|
| 2614 | #if defined(CONFIGURE_MP_APPLICATION) && \ |
---|
| 2615 | !defined(RTEMS_MULTIPROCESSING) |
---|
| 2616 | #error "CONFIGURATION ERROR: RTEMS not configured for multiprocessing!!" |
---|
| 2617 | #endif |
---|
| 2618 | |
---|
| 2619 | /* |
---|
| 2620 | * If an attempt was made to configure POSIX objects and |
---|
| 2621 | * the POSIX API was not configured into RTEMS, error out. |
---|
| 2622 | */ |
---|
| 2623 | #if !defined(RTEMS_POSIX_API) |
---|
| 2624 | #if ((CONFIGURE_MAXIMUM_POSIX_THREADS != 0) || \ |
---|
| 2625 | (CONFIGURE_MAXIMUM_POSIX_MUTEXES != 0) || \ |
---|
| 2626 | (CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES != 0) || \ |
---|
| 2627 | (CONFIGURE_MAXIMUM_POSIX_KEYS != 0) || \ |
---|
[b5c9064] | 2628 | (CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS != 0) || \ |
---|
[df0bfdf] | 2629 | (CONFIGURE_MAXIMUM_POSIX_TIMERS != 0) || \ |
---|
| 2630 | (CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS != 0) || \ |
---|
| 2631 | (CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES != 0) || \ |
---|
[ade17392] | 2632 | (CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS != 0) || \ |
---|
[df0bfdf] | 2633 | (CONFIGURE_MAXIMUM_POSIX_SEMAPHORES != 0) || \ |
---|
| 2634 | (CONFIGURE_MAXIMUM_POSIX_BARRIERS != 0) || \ |
---|
| 2635 | (CONFIGURE_MAXIMUM_POSIX_SPINLOCKS != 0) || \ |
---|
| 2636 | (CONFIGURE_MAXIMUM_POSIX_RWLOCKS != 0) || \ |
---|
[98e92b0a] | 2637 | defined(CONFIGURE_POSIX_INIT_THREAD_TABLE)) |
---|
[df0bfdf] | 2638 | #error "CONFIGURATION ERROR: POSIX API support not configured!!" |
---|
| 2639 | #endif |
---|
| 2640 | #endif |
---|
| 2641 | |
---|
[6784547] | 2642 | #if !defined(RTEMS_SCHEDSIM) |
---|
| 2643 | #if !defined(CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE) |
---|
| 2644 | /* |
---|
| 2645 | * You must either explicity include or exclude the clock driver. |
---|
| 2646 | * It is such a common newbie error to leave it out. Maybe this |
---|
| 2647 | * will put an end to it. |
---|
| 2648 | * |
---|
| 2649 | * NOTE: If you are using the timer driver, it is considered |
---|
| 2650 | * mutually exclusive with the clock driver because the |
---|
| 2651 | * drivers are assumed to use the same "timer" hardware |
---|
| 2652 | * on many boards. |
---|
| 2653 | */ |
---|
| 2654 | #if !defined(CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER) && \ |
---|
| 2655 | !defined(CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER) && \ |
---|
| 2656 | !defined(CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER) |
---|
| 2657 | #error "CONFIGURATION ERROR: Do you want the clock driver or not?!?" |
---|
| 2658 | #endif |
---|
| 2659 | |
---|
| 2660 | /* |
---|
| 2661 | * Only one of the following three configuration parameters should be |
---|
| 2662 | * defined at a time. |
---|
| 2663 | */ |
---|
| 2664 | #if ((defined(CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER) + \ |
---|
| 2665 | defined(CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER) + \ |
---|
| 2666 | defined(CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER)) > 1) |
---|
| 2667 | #error "CONFIGURATION ERROR: More than one clock/timer driver configuration parameter specified?!?" |
---|
| 2668 | #endif |
---|
| 2669 | #endif /* !defined(CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE) */ |
---|
| 2670 | #endif /* !defined(RTEMS_SCHEDSIM) */ |
---|
[df0bfdf] | 2671 | |
---|
[0ab34c90] | 2672 | /* |
---|
| 2673 | * These names have been obsoleted so make the user application stop compiling |
---|
| 2674 | */ |
---|
| 2675 | #if defined(CONFIGURE_TEST_NEEDS_TIMER_DRIVER) || \ |
---|
| 2676 | defined(CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER) || \ |
---|
| 2677 | defined(CONFIGURE_TEST_NEEDS_CLOCK_DRIVER) || \ |
---|
| 2678 | defined(CONFIGURE_TEST_NEEDS_RTC_DRIVER) || \ |
---|
| 2679 | defined(CONFIGURE_TEST_NEEDS_STUB_DRIVER) |
---|
| 2680 | #error "CONFIGURATION ERROR: CONFIGURE_TEST_XXX constants are obsolete" |
---|
| 2681 | #endif |
---|
| 2682 | |
---|
[80f9d77] | 2683 | /* |
---|
| 2684 | * Validate the configured maximum priority |
---|
| 2685 | */ |
---|
| 2686 | #if ((CONFIGURE_MAXIMUM_PRIORITY != 3) && \ |
---|
| 2687 | (CONFIGURE_MAXIMUM_PRIORITY != 7) && \ |
---|
| 2688 | (CONFIGURE_MAXIMUM_PRIORITY != 15) && \ |
---|
| 2689 | (CONFIGURE_MAXIMUM_PRIORITY != 31) && \ |
---|
| 2690 | (CONFIGURE_MAXIMUM_PRIORITY != 63) && \ |
---|
| 2691 | (CONFIGURE_MAXIMUM_PRIORITY != 127) && \ |
---|
| 2692 | (CONFIGURE_MAXIMUM_PRIORITY != 255)) |
---|
| 2693 | #error "Maximum priority is not 1 less than a power of 2 between 4 and 256" |
---|
| 2694 | #endif |
---|
[28352fae] | 2695 | |
---|
[80f9d77] | 2696 | #if (CONFIGURE_MAXIMUM_PRIORITY > PRIORITY_DEFAULT_MAXIMUM) |
---|
| 2697 | #error "Maximum priority configured higher than supported by target." |
---|
| 2698 | #endif |
---|
| 2699 | |
---|
[ade17392] | 2700 | /* |
---|
| 2701 | * If you have fewer POSIX Message Queue Descriptors than actual |
---|
| 2702 | * POSIX Message Queues, then you will not be able to open all the |
---|
| 2703 | * queues. |
---|
| 2704 | */ |
---|
| 2705 | #if (CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUE_DESCRIPTORS < \ |
---|
| 2706 | CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES) |
---|
| 2707 | #error "Fewer POSIX Message Queue descriptors than Queues!" |
---|
| 2708 | #endif |
---|
| 2709 | |
---|
[b5c9064] | 2710 | /* |
---|
| 2711 | * POSIX Key pair shouldn't be less than POSIX Key, which is highly |
---|
| 2712 | * likely to be error. |
---|
| 2713 | */ |
---|
| 2714 | #if defined(RTEMS_POSIX_API) |
---|
| 2715 | #if (CONFIGURE_MAXIMUM_POSIX_KEYS != 0) && \ |
---|
| 2716 | (CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS != 0) |
---|
| 2717 | #if (CONFIGURE_MAXIMUM_POSIX_KEY_VALUE_PAIRS < \ |
---|
| 2718 | CONFIGURE_MAXIMUM_POSIX_KEYS) |
---|
| 2719 | #error "Fewer POSIX Key pairs than POSIX Key!" |
---|
| 2720 | #endif |
---|
| 2721 | #endif |
---|
| 2722 | #endif |
---|
| 2723 | |
---|
[08bae5e6] | 2724 | #endif |
---|
| 2725 | /* end of include file */ |
---|