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