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