[ac7d5ef0] | 1 | /* main |
---|
| 2 | * |
---|
| 3 | * This program is run to determine the data space and work space |
---|
| 4 | * requirements of the current version of RTEMS. |
---|
| 5 | * |
---|
[bb9c80df] | 6 | * COPYRIGHT (c) 1989-2008. |
---|
[ac7d5ef0] | 7 | * On-Line Applications Research Corporation (OAR). |
---|
| 8 | * |
---|
[98e4ebf5] | 9 | * The license and distribution terms for this file may be |
---|
| 10 | * found in the file LICENSE in this distribution or at |
---|
[d2b93bfd] | 11 | * http://www.rtems.com/license/LICENSE. |
---|
[ac7d5ef0] | 12 | * |
---|
[3235ad9] | 13 | * $Id$ |
---|
[ac7d5ef0] | 14 | */ |
---|
| 15 | |
---|
| 16 | #include <rtems/system.h> |
---|
| 17 | #include <rtems/config.h> |
---|
[5e9b32b] | 18 | #include <rtems/score/apiext.h> |
---|
| 19 | #include <rtems/score/copyrt.h> |
---|
[3a4ae6c] | 20 | #include <rtems/rtems/clock.h> |
---|
| 21 | #include <rtems/rtems/tasks.h> |
---|
| 22 | #include <rtems/rtems/dpmem.h> |
---|
| 23 | #include <rtems/rtems/event.h> |
---|
[ac7d5ef0] | 24 | #include <rtems/extension.h> |
---|
| 25 | #include <rtems/fatal.h> |
---|
| 26 | #include <rtems/init.h> |
---|
[5e9b32b] | 27 | #include <rtems/score/isr.h> |
---|
[3a4ae6c] | 28 | #include <rtems/rtems/intr.h> |
---|
[ac7d5ef0] | 29 | #include <rtems/io.h> |
---|
[3a4ae6c] | 30 | #include <rtems/rtems/message.h> |
---|
[07a3253d] | 31 | #if defined(RTEMS_MULTIPROCESSING) |
---|
[3a4ae6c] | 32 | #include <rtems/rtems/mp.h> |
---|
[5e9b32b] | 33 | #include <rtems/score/mpci.h> |
---|
[07a3253d] | 34 | #endif |
---|
[3a4ae6c] | 35 | #include <rtems/rtems/part.h> |
---|
[5e9b32b] | 36 | #include <rtems/score/priority.h> |
---|
[3a4ae6c] | 37 | #include <rtems/rtems/ratemon.h> |
---|
| 38 | #include <rtems/rtems/region.h> |
---|
| 39 | #include <rtems/rtems/sem.h> |
---|
| 40 | #include <rtems/rtems/signal.h> |
---|
[5e9b32b] | 41 | #include <rtems/score/sysstate.h> |
---|
| 42 | #include <rtems/score/thread.h> |
---|
[3a4ae6c] | 43 | #include <rtems/rtems/timer.h> |
---|
[5e9b32b] | 44 | #include <rtems/score/tod.h> |
---|
| 45 | #include <rtems/score/userext.h> |
---|
| 46 | #include <rtems/score/wkspace.h> |
---|
[ac7d5ef0] | 47 | |
---|
[637df35] | 48 | #include <stdlib.h> |
---|
[3aa4c2e0] | 49 | #include <stdio.h> |
---|
[18ee864] | 50 | #include <unistd.h> |
---|
[3aa4c2e0] | 51 | #include <tmacros.h> |
---|
[637df35] | 52 | |
---|
[18ee864] | 53 | /* external function prototypes */ |
---|
| 54 | int getint( void ); |
---|
| 55 | |
---|
[ac7d5ef0] | 56 | /* These are always defined by the executive. |
---|
| 57 | * |
---|
| 58 | * #include <rtems/copyrt.h> |
---|
| 59 | * #include <rtems/tables.h> |
---|
| 60 | * #include <rtems/sptables.h> |
---|
| 61 | */ |
---|
| 62 | #define HEAP_OVHD 16 /* wasted heap space per task stack */ |
---|
| 63 | #define NAME_PTR_SIZE 8 /* size of name and pointer table entries */ |
---|
| 64 | #define READYCHAINS_SIZE \ |
---|
| 65 | ((RTEMS_MAXIMUM_PRIORITY + 1) * sizeof(Chain_Control )) |
---|
| 66 | |
---|
| 67 | #define PER_TASK \ |
---|
[f8700f77] | 68 | (long) (sizeof (Thread_Control) + \ |
---|
[c3dcd6e] | 69 | NAME_PTR_SIZE + HEAP_OVHD + sizeof( RTEMS_API_Control )) |
---|
[ac7d5ef0] | 70 | #define PER_SEMAPHORE \ |
---|
[f8700f77] | 71 | (long) (sizeof (Semaphore_Control) + NAME_PTR_SIZE) |
---|
[ac7d5ef0] | 72 | #define PER_TIMER \ |
---|
[f8700f77] | 73 | (long) (sizeof (Timer_Control) + NAME_PTR_SIZE) |
---|
[ac7d5ef0] | 74 | #define PER_MSGQ \ |
---|
[f8700f77] | 75 | (long) (sizeof (Message_queue_Control) + NAME_PTR_SIZE) |
---|
[ac7d5ef0] | 76 | #define PER_REGN \ |
---|
[f8700f77] | 77 | (long) (sizeof (Region_Control) + NAME_PTR_SIZE) |
---|
[ac7d5ef0] | 78 | #define PER_PART \ |
---|
[f8700f77] | 79 | (long) (sizeof (Partition_Control) + NAME_PTR_SIZE) |
---|
[ac7d5ef0] | 80 | #define PER_PERIOD \ |
---|
[f8700f77] | 81 | (long) (sizeof (Rate_monotonic_Control) + NAME_PTR_SIZE) |
---|
[ac7d5ef0] | 82 | #define PER_PORT \ |
---|
[f8700f77] | 83 | (long) (sizeof (Dual_ported_memory_Control) + NAME_PTR_SIZE) |
---|
[ac7d5ef0] | 84 | #define PER_EXTENSION \ |
---|
[f8700f77] | 85 | (long) (sizeof (Extension_Control) + NAME_PTR_SIZE) |
---|
[ac7d5ef0] | 86 | |
---|
[f8700f77] | 87 | #define PER_DRV (long) (0) |
---|
| 88 | #define PER_FPTASK (long) (CONTEXT_FP_SIZE) |
---|
| 89 | #define PER_GOBTBL (long) (sizeof (Chain_Control)*4) |
---|
| 90 | #define PER_NODE (long) PER_GOBTBL |
---|
[97e2729d] | 91 | #if defined(RTEMS_MULTIPROCESSING) |
---|
[f8700f77] | 92 | #define PER_GOBJECT (long) (sizeof (Objects_MP_Control)) |
---|
[97e2729d] | 93 | #else |
---|
| 94 | #define PER_GOBJECT (long) 0 |
---|
| 95 | #endif |
---|
[f8700f77] | 96 | #define PER_PROXY (long) (sizeof (Thread_Proxy_control)) |
---|
[ac7d5ef0] | 97 | |
---|
[97e2729d] | 98 | #if !defined(RTEMS_MULTIPROCESSING) || (CPU_ALL_TASKS_ARE_FP != TRUE) |
---|
[f8700f77] | 99 | #define MPCI_RECEIVE_SERVER_FP (long) 0 |
---|
[97e2729d] | 100 | #else |
---|
| 101 | #define MPCI_RECEIVE_SERVER_FP (long) (sizeof( Context_Control_fp )) |
---|
[ac7d5ef0] | 102 | #endif |
---|
| 103 | |
---|
| 104 | #if (CPU_IDLE_TASK_IS_FP == TRUE) |
---|
[f8700f77] | 105 | #define SYSTEM_IDLE_FP (long) (sizeof( Context_Control_fp )) |
---|
[ac7d5ef0] | 106 | #else |
---|
[f8700f77] | 107 | #define SYSTEM_IDLE_FP (long) 0 |
---|
[ac7d5ef0] | 108 | #endif |
---|
| 109 | |
---|
[62e1271a] | 110 | #if !defined(RTEMS_MULTIPROCESSING) |
---|
[97e2729d] | 111 | #define MPCI_RECEIVE_SERVER_STACK_SIZE 0 |
---|
| 112 | #endif |
---|
| 113 | |
---|
[07a3253d] | 114 | #if defined(RTEMS_MULTIPROCESSING) |
---|
[bbd655a3] | 115 | #define MPCI_RECEIVE_SERVER_STACK_SIZE \ |
---|
| 116 | |
---|
[07a3253d] | 117 | #define MP_SYSTEM_TASKS \ |
---|
[bbd655a3] | 118 | (STACK_MINIMUM_SIZE + CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK + \ |
---|
[07a3253d] | 119 | sizeof(Thread_Control) + \ |
---|
| 120 | MPCI_RECEIVE_SERVER_FP) |
---|
[40c2d41e] | 121 | |
---|
| 122 | extern CORE_semaphore_Control _MPCI_Semaphore; |
---|
[07a3253d] | 123 | #else |
---|
| 124 | #define MP_SYSTEM_TASKS 0 |
---|
| 125 | #endif |
---|
| 126 | |
---|
| 127 | /* |
---|
| 128 | * Idle and the MPCI Receive Server Threads |
---|
| 129 | */ |
---|
| 130 | |
---|
[ac7d5ef0] | 131 | #define SYSTEM_TASKS \ |
---|
[07a3253d] | 132 | (STACK_MINIMUM_SIZE + sizeof(Thread_Control) + SYSTEM_IDLE_FP + \ |
---|
| 133 | MP_SYSTEM_TASKS) |
---|
[ac7d5ef0] | 134 | |
---|
[c87608f] | 135 | uint32_t sys_req; |
---|
[ac7d5ef0] | 136 | |
---|
| 137 | void help_size(); |
---|
| 138 | void print_formula(); |
---|
| 139 | |
---|
| 140 | void size_rtems( |
---|
| 141 | int mode |
---|
| 142 | ) |
---|
| 143 | { |
---|
| 144 | int uninitialized = 0; |
---|
| 145 | int initialized = 0; |
---|
| 146 | |
---|
| 147 | /* |
---|
| 148 | * The following data is allocated for each Manager: |
---|
| 149 | * |
---|
| 150 | * + Per Manager Object Information |
---|
| 151 | * - local pointer table |
---|
| 152 | * - local name table |
---|
| 153 | * - the object's control blocks |
---|
| 154 | * - global name chains |
---|
| 155 | * |
---|
| 156 | * The following is the data allocate from the RTEMS Workspace Area. |
---|
| 157 | * The order indicates the order in which RTEMS allocates it. |
---|
| 158 | * |
---|
| 159 | * + Object MP |
---|
| 160 | * - Global Object CB's |
---|
| 161 | * + Thread |
---|
| 162 | * - Ready Chain |
---|
| 163 | * + Thread MP |
---|
| 164 | * - Proxies Chain |
---|
| 165 | * + Interrupt Manager |
---|
| 166 | * - Interrupt Stack |
---|
| 167 | * + Timer Manager |
---|
| 168 | * - per Manager Object Data |
---|
| 169 | * + Extension Manager |
---|
| 170 | * - per Manager Object Data |
---|
| 171 | * + Message Queue Manager |
---|
| 172 | * - per Manager Object Data |
---|
| 173 | * - Message Buffers |
---|
| 174 | * + Semaphore Manager |
---|
| 175 | * - per Manager Object Data |
---|
| 176 | * + Partition Manager |
---|
| 177 | * - per Manager Object Data |
---|
| 178 | * + Region Manager |
---|
| 179 | * - per Manager Object Data |
---|
| 180 | * + Dual Ported Memory Manager |
---|
| 181 | * - per Manager Object Data |
---|
| 182 | * + Rate Monotonic Manager |
---|
| 183 | * - per Manager Object Data |
---|
| 184 | * + Internal Threads Handler |
---|
[0e0d88b] | 185 | * - MPCI Receive Server Thread TCB |
---|
[ac7d5ef0] | 186 | * - IDLE Thread TCB |
---|
[0e0d88b] | 187 | * - MPCI Receive Server Thread stack |
---|
| 188 | * - MPCI Receive Server Thread FP area (if CPU requires this) |
---|
[ac7d5ef0] | 189 | * - IDLE Thread stack |
---|
| 190 | * - IDLE Thread FP area (if CPU requires this) |
---|
| 191 | * |
---|
| 192 | * This does not take into account any CPU dependent alignment requirements. |
---|
| 193 | * |
---|
| 194 | * The following calculates the overhead needed by RTEMS from the |
---|
| 195 | * Workspace Area. |
---|
| 196 | */ |
---|
[0e0d88b] | 197 | sys_req = SYSTEM_TASKS + /* MPCI Receive Server and IDLE */ |
---|
[ac7d5ef0] | 198 | NAME_PTR_SIZE + /* Task Overhead */ |
---|
| 199 | READYCHAINS_SIZE + /* Ready Chains */ |
---|
| 200 | NAME_PTR_SIZE + /* Timer Overhead */ |
---|
| 201 | NAME_PTR_SIZE + /* Semaphore Overhead */ |
---|
| 202 | NAME_PTR_SIZE + /* Message Queue Overhead */ |
---|
| 203 | NAME_PTR_SIZE + /* Region Overhead */ |
---|
| 204 | NAME_PTR_SIZE + /* Partition Overhead */ |
---|
| 205 | NAME_PTR_SIZE + /* Dual-Ported Memory Overhead */ |
---|
| 206 | NAME_PTR_SIZE + /* Rate Monotonic Overhead */ |
---|
| 207 | NAME_PTR_SIZE + /* Extension Overhead */ |
---|
| 208 | PER_NODE; /* Extra Gobject Table */ |
---|
| 209 | |
---|
| 210 | uninitialized = |
---|
| 211 | /*address.h*/ 0 + |
---|
| 212 | |
---|
[18c5378] | 213 | /*apiext.h*/ (sizeof _API_extensions_List) + |
---|
| 214 | |
---|
[ac7d5ef0] | 215 | /*asr.h*/ 0 + |
---|
| 216 | |
---|
| 217 | /*attr.h*/ 0 + |
---|
| 218 | |
---|
| 219 | /*bitfield.h*/ 0 + |
---|
| 220 | |
---|
| 221 | /*chain.h*/ 0 + |
---|
| 222 | |
---|
| 223 | /*clock.h*/ 0 + |
---|
| 224 | |
---|
[bb9c80df] | 225 | /*config.h*/ |
---|
[e58077c] | 226 | #if defined(RTEMS_MULTIPROCESSING) |
---|
[ac7d5ef0] | 227 | (sizeof _Configuration_MP_table) + |
---|
[e58077c] | 228 | #endif |
---|
[ac7d5ef0] | 229 | |
---|
| 230 | /*context.h*/ (sizeof _Context_Switch_necessary) + |
---|
| 231 | |
---|
| 232 | /*copyrt.h*/ 0 + |
---|
| 233 | |
---|
[3a4ae6c] | 234 | /*debug.h*/ (sizeof _Debug_Level) + |
---|
| 235 | |
---|
[ac7d5ef0] | 236 | /*dpmem.h*/ (sizeof _Dual_ported_memory_Information) + |
---|
| 237 | |
---|
[8c8a924] | 238 | /*event.h*/ (sizeof _Event_Sync_state) + |
---|
[ac7d5ef0] | 239 | |
---|
[97e2729d] | 240 | #if defined(RTEMS_MULTIPROCESSING) |
---|
[ac7d5ef0] | 241 | /*eventmp.h*/ 0 + |
---|
[97e2729d] | 242 | #endif |
---|
[ac7d5ef0] | 243 | |
---|
| 244 | /*eventset.h*/ 0 + |
---|
| 245 | |
---|
| 246 | /*extension.h*/ (sizeof _Extension_Information) + |
---|
| 247 | |
---|
| 248 | /*fatal.h*/ 0 + |
---|
| 249 | |
---|
| 250 | /*heap.h*/ 0 + |
---|
| 251 | |
---|
| 252 | /*init.h*/ 0 + |
---|
| 253 | |
---|
[d0941512] | 254 | /*interr.h*/ (sizeof _Internal_errors_What_happened) + |
---|
[3a4ae6c] | 255 | |
---|
[ac7d5ef0] | 256 | /*intr.h*/ 0 + |
---|
| 257 | |
---|
| 258 | /*io.h*/ (sizeof _IO_Number_of_drivers) + |
---|
| 259 | (sizeof _IO_Driver_address_table) + |
---|
| 260 | |
---|
| 261 | /*isr.h*/ (sizeof _ISR_Nest_level) + |
---|
[86db88d2] | 262 | #if (CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE) |
---|
[ac7d5ef0] | 263 | (sizeof _ISR_Vector_table) + |
---|
[86db88d2] | 264 | #endif |
---|
[ac7d5ef0] | 265 | (sizeof _ISR_Signals_to_thread_executing) + |
---|
| 266 | |
---|
[4b374f36] | 267 | /*message.h*/ (sizeof _Message_queue_Information) + |
---|
[ac7d5ef0] | 268 | |
---|
| 269 | /*modes.h*/ 0 + |
---|
| 270 | |
---|
[97e2729d] | 271 | #if defined(RTEMS_MULTIPROCESSING) |
---|
[ac7d5ef0] | 272 | /*mp.h*/ 0 + |
---|
[97e2729d] | 273 | #endif |
---|
[ac7d5ef0] | 274 | |
---|
[97e2729d] | 275 | #if defined(RTEMS_MULTIPROCESSING) |
---|
[ac7d5ef0] | 276 | /*mpci.h*/ (sizeof _MPCI_Remote_blocked_threads) + |
---|
[3a4ae6c] | 277 | (sizeof _MPCI_Semaphore) + |
---|
| 278 | (sizeof _MPCI_table) + |
---|
| 279 | (sizeof _MPCI_Receive_server_tcb) + |
---|
| 280 | (sizeof _MPCI_Packet_processors) + |
---|
[97e2729d] | 281 | #endif |
---|
[ac7d5ef0] | 282 | |
---|
[97e2729d] | 283 | #if defined(RTEMS_MULTIPROCESSING) |
---|
[ac7d5ef0] | 284 | /*mppkt.h*/ 0 + |
---|
[97e2729d] | 285 | #endif |
---|
[ac7d5ef0] | 286 | |
---|
[97e2729d] | 287 | #if defined(RTEMS_MULTIPROCESSING) |
---|
[ac7d5ef0] | 288 | /*mptables.h*/ 0 + |
---|
[97e2729d] | 289 | #endif |
---|
[ac7d5ef0] | 290 | |
---|
[97e2729d] | 291 | #if defined(RTEMS_MULTIPROCESSING) |
---|
[ac7d5ef0] | 292 | /*msgmp.h*/ 0 + |
---|
[97e2729d] | 293 | #endif |
---|
[ac7d5ef0] | 294 | |
---|
| 295 | /*object.h*/ (sizeof _Objects_Local_node) + |
---|
[3a4ae6c] | 296 | (sizeof _Objects_Maximum_nodes) + |
---|
| 297 | (sizeof _Objects_Information_table) + |
---|
[ac7d5ef0] | 298 | |
---|
[97e2729d] | 299 | #if defined(RTEMS_MULTIPROCESSING) |
---|
[3a4ae6c] | 300 | /*objectmp.h*/ (sizeof _Objects_MP_Maximum_global_objects) + |
---|
| 301 | (sizeof _Objects_MP_Inactive_global_objects) + |
---|
[97e2729d] | 302 | #endif |
---|
[ac7d5ef0] | 303 | |
---|
| 304 | /*options.h*/ 0 + |
---|
| 305 | |
---|
| 306 | /*part.h*/ (sizeof _Partition_Information) + |
---|
| 307 | |
---|
[97e2729d] | 308 | #if defined(RTEMS_MULTIPROCESSING) |
---|
[ac7d5ef0] | 309 | /*partmp.h*/ 0 + |
---|
[97e2729d] | 310 | #endif |
---|
[ac7d5ef0] | 311 | |
---|
| 312 | /*priority.h*/ (sizeof _Priority_Major_bit_map) + |
---|
| 313 | (sizeof _Priority_Bit_map) + |
---|
| 314 | |
---|
| 315 | /*ratemon.h*/ (sizeof _Rate_monotonic_Information) + |
---|
| 316 | |
---|
| 317 | /*region.h*/ (sizeof _Region_Information) + |
---|
| 318 | |
---|
[97e2729d] | 319 | #if defined(RTEMS_MULTIPROCESSING) |
---|
[ac7d5ef0] | 320 | /*regionmp.h*/ 0 + |
---|
[97e2729d] | 321 | #endif |
---|
[ac7d5ef0] | 322 | |
---|
| 323 | /*rtems.h*/ /* Not applicable */ |
---|
| 324 | |
---|
| 325 | /*sem.h*/ (sizeof _Semaphore_Information) + |
---|
| 326 | |
---|
[97e2729d] | 327 | #if defined(RTEMS_MULTIPROCESSING) |
---|
[ac7d5ef0] | 328 | /*semmp.h*/ 0 + |
---|
[97e2729d] | 329 | #endif |
---|
[ac7d5ef0] | 330 | |
---|
| 331 | /*signal.h*/ 0 + |
---|
| 332 | |
---|
| 333 | /*signalmp.h*/ 0 + |
---|
| 334 | |
---|
| 335 | /*stack.h*/ 0 + |
---|
| 336 | |
---|
| 337 | /*states.h*/ 0 + |
---|
| 338 | |
---|
| 339 | /*status.h*/ 0 + |
---|
| 340 | |
---|
[02d989c] | 341 | /*sysstate.h*/ (sizeof _System_state_Current) + |
---|
| 342 | #if defined(RTEMS_MULTIPROCESSING) |
---|
| 343 | (sizeof _System_state_Is_multiprocessing) + |
---|
| 344 | #endif |
---|
[ac7d5ef0] | 345 | |
---|
[97e2729d] | 346 | #if defined(RTEMS_MULTIPROCESSING) |
---|
[ac7d5ef0] | 347 | /*taskmp.h*/ 0 + |
---|
[97e2729d] | 348 | #endif |
---|
[ac7d5ef0] | 349 | |
---|
[5250ff39] | 350 | /*tasks.h*/ (sizeof _RTEMS_tasks_Information) + |
---|
[ac7d5ef0] | 351 | |
---|
[3a4ae6c] | 352 | /*thread.h*/ (sizeof _Thread_BSP_context) + |
---|
| 353 | (sizeof _Thread_Dispatch_disable_level) + |
---|
[022923e] | 354 | (sizeof _Thread_Do_post_task_switch_extension) + |
---|
[3a4ae6c] | 355 | (sizeof _Thread_Maximum_extensions) + |
---|
[ac7d5ef0] | 356 | (sizeof _Thread_Ticks_per_timeslice) + |
---|
| 357 | (sizeof _Thread_Ready_chain) + |
---|
| 358 | (sizeof _Thread_Executing) + |
---|
| 359 | (sizeof _Thread_Heir) + |
---|
[ca7858bb] | 360 | #if (CPU_HARDWARE_FP == 1) || (CPU_SOFTWARE_FP == 1) |
---|
[ac7d5ef0] | 361 | (sizeof _Thread_Allocated_fp) + |
---|
[ca7858bb] | 362 | #endif |
---|
[0e0d88b] | 363 | (sizeof _Thread_Internal_information) + |
---|
| 364 | (sizeof _Thread_Idle) + |
---|
[ac7d5ef0] | 365 | |
---|
[97e2729d] | 366 | #if defined(RTEMS_MULTIPROCESSING) |
---|
[0c30bc5] | 367 | /*threadmp.h*/ (sizeof _Thread_MP_Active_proxies) + |
---|
[ac7d5ef0] | 368 | (sizeof _Thread_MP_Inactive_proxies) + |
---|
[97e2729d] | 369 | #endif |
---|
[ac7d5ef0] | 370 | |
---|
[a9047a0] | 371 | /*threadq.h*/ |
---|
[ac7d5ef0] | 372 | |
---|
| 373 | /*timer.h*/ (sizeof _Timer_Information) + |
---|
| 374 | |
---|
[3c68f96d] | 375 | /*tod.h*/ (sizeof _TOD_Now) + |
---|
[dfa1f0bc] | 376 | (sizeof _TOD_Uptime) + |
---|
[ac7d5ef0] | 377 | |
---|
| 378 | /*tqdata.h*/ 0 + |
---|
| 379 | |
---|
| 380 | /*types.h*/ 0 + |
---|
| 381 | |
---|
[d07d3eec] | 382 | /*userext.h*/ (sizeof _User_extensions_List) + |
---|
[ac7d5ef0] | 383 | |
---|
[3a4ae6c] | 384 | /*watchdog.h*/ (sizeof _Watchdog_Sync_level) + |
---|
[88d594a] | 385 | (sizeof _Watchdog_Sync_count) + |
---|
[5e7b6272] | 386 | (sizeof _Watchdog_Ticks_since_boot) + |
---|
[3a4ae6c] | 387 | (sizeof _Watchdog_Ticks_chain) + |
---|
| 388 | (sizeof _Watchdog_Seconds_chain) + |
---|
[ac7d5ef0] | 389 | |
---|
| 390 | /*wkspace.h*/ (sizeof _Workspace_Area); |
---|
| 391 | |
---|
| 392 | uninitialized = 0; |
---|
| 393 | |
---|
[c4808ca] | 394 | #ifndef unix /* make sure this is not a native compile */ |
---|
| 395 | |
---|
[3ec7bfc] | 396 | #ifdef __i386__ |
---|
[ac7d5ef0] | 397 | |
---|
| 398 | /* cpu.h */ |
---|
[3dc936c1] | 399 | uninitialized += (sizeof _CPU_Null_fp_context); |
---|
| 400 | |
---|
| 401 | #if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) |
---|
| 402 | uninitialized += (sizeof _CPU_Interrupt_stack_low) + |
---|
[ac7d5ef0] | 403 | (sizeof _CPU_Interrupt_stack_high); |
---|
[3dc936c1] | 404 | #endif |
---|
[ac7d5ef0] | 405 | |
---|
| 406 | #endif |
---|
| 407 | |
---|
[3ec7bfc] | 408 | #ifdef __mc68000__ |
---|
[ac7d5ef0] | 409 | |
---|
| 410 | /* cpu.h */ |
---|
| 411 | uninitialized += (sizeof _CPU_Interrupt_stack_low) + |
---|
| 412 | (sizeof _CPU_Interrupt_stack_high); |
---|
| 413 | |
---|
| 414 | #endif |
---|
| 415 | |
---|
[3ec7bfc] | 416 | #ifdef __sparc__ |
---|
[1b4f2b30] | 417 | |
---|
[9700578] | 418 | /* cpu.h */ |
---|
| 419 | uninitialized += (sizeof _CPU_Interrupt_stack_low) + |
---|
| 420 | (sizeof _CPU_Interrupt_stack_high) + |
---|
[d135fc52] | 421 | (sizeof _CPU_Null_fp_context); |
---|
| 422 | |
---|
[9700578] | 423 | #endif |
---|
| 424 | |
---|
| 425 | |
---|
[ac7d5ef0] | 426 | #ifdef no_cpu |
---|
| 427 | |
---|
| 428 | /* cpu.h */ |
---|
| 429 | uninitialized += (sizeof _CPU_Null_fp_context) + |
---|
| 430 | (sizeof _CPU_Interrupt_stack_low) + |
---|
| 431 | (sizeof _CPU_Interrupt_stack_high) + |
---|
| 432 | (sizeof _CPU_Thread_dispatch_pointer); |
---|
| 433 | |
---|
| 434 | #endif |
---|
| 435 | |
---|
[3ec7bfc] | 436 | #ifdef __PPC__ |
---|
[3a4ae6c] | 437 | |
---|
| 438 | /* cpu.h */ |
---|
| 439 | uninitialized += (sizeof _CPU_Interrupt_stack_low) + |
---|
| 440 | (sizeof _CPU_Interrupt_stack_high) + |
---|
| 441 | (sizeof _CPU_IRQ_info); |
---|
| 442 | |
---|
| 443 | #endif |
---|
[c4808ca] | 444 | #endif /* !unix */ |
---|
[3a4ae6c] | 445 | |
---|
[ac7d5ef0] | 446 | initialized += |
---|
| 447 | /*copyrt.h*/ (strlen(_Copyright_Notice)+1) + |
---|
| 448 | |
---|
[eb5d942a] | 449 | #if defined(RTEMS_MULTIPROCESSING) |
---|
[3a4ae6c] | 450 | /*sptables.h*/ (sizeof _Initialization_Default_multiprocessing_table) + |
---|
[eb5d942a] | 451 | #endif |
---|
[3c68f96d] | 452 | (strlen(_RTEMS_version)+1); |
---|
[ac7d5ef0] | 453 | |
---|
| 454 | |
---|
| 455 | |
---|
[c4808ca] | 456 | #ifndef unix /* make sure this is not native */ |
---|
[3ec7bfc] | 457 | #ifdef __sparc__ |
---|
[9700578] | 458 | |
---|
| 459 | initialized += (sizeof _CPU_Trap_slot_template); |
---|
| 460 | |
---|
| 461 | #endif |
---|
[c4808ca] | 462 | #endif /* !unix */ |
---|
[9700578] | 463 | |
---|
[ac7d5ef0] | 464 | puts( "" ); |
---|
[9700578] | 465 | |
---|
[ac7d5ef0] | 466 | if ( mode == 0 ) help_size(); |
---|
| 467 | else print_formula(); |
---|
| 468 | |
---|
| 469 | printf( "\n" ); |
---|
| 470 | printf( "RTEMS uninitialized data consumes %d bytes\n", uninitialized ); |
---|
| 471 | printf( "RTEMS intialized data consumes %d bytes\n", initialized ); |
---|
| 472 | |
---|
| 473 | } |
---|
| 474 | |
---|
| 475 | void help_size() |
---|
| 476 | { |
---|
| 477 | int c = '\0'; |
---|
| 478 | int break_loop; |
---|
| 479 | int total_size; |
---|
| 480 | int task_stacks; |
---|
| 481 | int interrupt_stack; |
---|
| 482 | int maximum_tasks, size_tasks; |
---|
| 483 | int maximum_sems, size_sems; |
---|
| 484 | int maximum_timers, size_timers; |
---|
| 485 | int maximum_msgqs, size_msgqs; |
---|
[4b374f36] | 486 | int maximum_msgs, size_msgs_overhead; |
---|
[ac7d5ef0] | 487 | int maximum_regns, size_regns; |
---|
| 488 | int maximum_parts, size_parts; |
---|
| 489 | int maximum_ports, size_ports; |
---|
| 490 | int maximum_periods, size_periods; |
---|
| 491 | int maximum_extensions, size_extensions; |
---|
| 492 | int maximum_drvs, size_drvs; |
---|
| 493 | int maximum_fps, size_fps; |
---|
| 494 | int maximum_nodes, size_nodes; |
---|
| 495 | int maximum_gobjs, size_gobjs; |
---|
| 496 | int maximum_proxies, size_proxies; |
---|
| 497 | |
---|
| 498 | total_size = sys_req; /* Fixed Overhead */ |
---|
| 499 | printf( "What is maximum_tasks? " ); |
---|
| 500 | maximum_tasks = getint(); |
---|
| 501 | size_tasks = PER_TASK * maximum_tasks; |
---|
| 502 | total_size += size_tasks; |
---|
| 503 | |
---|
| 504 | printf( "What is maximum_semaphores? " ); |
---|
| 505 | maximum_sems = getint(); |
---|
| 506 | size_sems = PER_SEMAPHORE * maximum_sems; |
---|
| 507 | total_size += size_sems; |
---|
| 508 | |
---|
| 509 | printf( "What is maximum_timers? " ); |
---|
| 510 | maximum_timers = getint(); |
---|
| 511 | size_timers = PER_TIMER * maximum_timers; |
---|
| 512 | total_size += size_timers; |
---|
| 513 | |
---|
| 514 | printf( "What is maximum_message_queues? " ); |
---|
| 515 | maximum_msgqs = getint(); |
---|
| 516 | size_msgqs = PER_MSGQ * maximum_msgqs; |
---|
| 517 | total_size += size_msgqs; |
---|
| 518 | |
---|
[3652ad35] | 519 | printf( "What is maximum_messages? XXXX " ); |
---|
[ac7d5ef0] | 520 | maximum_msgs = getint(); |
---|
[3652ad35] | 521 | size_msgs_overhead = 0; |
---|
[4b374f36] | 522 | total_size += size_msgs_overhead; |
---|
[ac7d5ef0] | 523 | |
---|
| 524 | printf( "What is maximum_regions? " ); |
---|
| 525 | maximum_regns = getint(); |
---|
| 526 | size_regns = PER_REGN * maximum_regns; |
---|
| 527 | total_size += size_regns; |
---|
| 528 | |
---|
| 529 | printf( "What is maximum_partitions? " ); |
---|
| 530 | maximum_parts = getint(); |
---|
| 531 | size_parts = PER_PART * maximum_parts; |
---|
| 532 | total_size += size_parts; |
---|
| 533 | |
---|
| 534 | printf( "What is maximum_ports? " ); |
---|
| 535 | maximum_ports = getint(); |
---|
| 536 | size_ports = PER_PORT * maximum_ports; |
---|
| 537 | total_size += size_ports; |
---|
| 538 | |
---|
| 539 | printf( "What is maximum_periods? " ); |
---|
| 540 | maximum_periods = getint(); |
---|
| 541 | size_periods = PER_PORT * maximum_periods; |
---|
| 542 | total_size += size_periods; |
---|
| 543 | |
---|
| 544 | printf( "What is maximum_extensions? " ); |
---|
| 545 | maximum_extensions = getint(); |
---|
| 546 | size_extensions = PER_EXTENSION * maximum_extensions; |
---|
| 547 | total_size += size_extensions; |
---|
| 548 | |
---|
| 549 | printf( "What is number_of_device_drivers? " ); |
---|
| 550 | maximum_drvs = getint(); |
---|
| 551 | size_drvs = PER_DRV * maximum_drvs; |
---|
| 552 | total_size += size_drvs; |
---|
| 553 | |
---|
| 554 | printf( "What will be total stack requirement for all tasks? " ); |
---|
| 555 | task_stacks = getint(); |
---|
| 556 | total_size += task_stacks; |
---|
| 557 | |
---|
| 558 | printf( "What is the size of the interrupt stack? " ); |
---|
| 559 | interrupt_stack = getint(); |
---|
| 560 | total_size += interrupt_stack; |
---|
| 561 | |
---|
| 562 | printf( "How many tasks will be created with the FP flag? " ); |
---|
| 563 | maximum_fps = getint(); |
---|
| 564 | size_fps = PER_FPTASK * maximum_fps; |
---|
| 565 | total_size += size_fps; |
---|
| 566 | |
---|
| 567 | printf( "Is this a single processor system? " ); |
---|
| 568 | for ( break_loop=0 ; !break_loop; c = getchar() ) { |
---|
| 569 | switch ( c ) { |
---|
| 570 | case 'Y': case 'y': |
---|
| 571 | case 'N': case 'n': |
---|
| 572 | break_loop = 1; |
---|
| 573 | break; |
---|
| 574 | } |
---|
| 575 | } |
---|
| 576 | printf( "%c\n", c ); |
---|
| 577 | if ( c == 'n' || c == 'N' ) { |
---|
| 578 | printf( "What is maximum_nodes? " ); |
---|
| 579 | maximum_nodes = getint(); |
---|
| 580 | size_nodes = PER_NODE * maximum_nodes; |
---|
| 581 | total_size += size_nodes; |
---|
| 582 | printf( "What is maximum_global_objects? " ); |
---|
| 583 | maximum_gobjs = getint(); |
---|
| 584 | size_gobjs = PER_GOBJECT * maximum_gobjs; |
---|
| 585 | total_size += size_gobjs; |
---|
| 586 | printf( "What is maximum_proxies? " ); |
---|
| 587 | maximum_proxies = getint(); |
---|
| 588 | size_proxies = PER_PROXY * maximum_proxies; |
---|
| 589 | total_size += size_proxies; |
---|
| 590 | } else { |
---|
| 591 | maximum_nodes = 0; |
---|
| 592 | size_nodes = PER_NODE * 0; |
---|
| 593 | maximum_gobjs = 0; |
---|
| 594 | size_gobjs = PER_GOBJECT * 0; |
---|
| 595 | maximum_proxies = 0; |
---|
| 596 | size_proxies = PER_PROXY * 0; |
---|
| 597 | } |
---|
| 598 | |
---|
| 599 | printf( "\n\n" ); |
---|
| 600 | printf( " ************** EXECUTIVE WORK SPACE REQUIRED **************\n" ); |
---|
[f8700f77] | 601 | printf( " Tasks - %03d * %03ld = %ld\n", |
---|
| 602 | maximum_tasks, PER_TASK, (long) size_tasks ); |
---|
| 603 | printf( " Semaphores - %03d * %03ld = %ld\n", |
---|
| 604 | maximum_sems, PER_SEMAPHORE, (long) size_sems ); |
---|
| 605 | printf( " Timers - %03d * %03ld = %ld\n", |
---|
| 606 | maximum_timers, PER_TIMER, (long) size_timers ); |
---|
| 607 | printf( " Msg Queues - %03d * %03ld = %ld\n", |
---|
| 608 | maximum_msgqs, PER_MSGQ, (long) size_msgqs ); |
---|
| 609 | printf( " Messages Overhead - %03d * %03d = %ld\n", |
---|
| 610 | maximum_msgs, 0 /* PER_MSG_OVERHEAD */, (long) size_msgs_overhead ); |
---|
| 611 | printf( " Regions - %03d * %03ld = %ld\n", |
---|
| 612 | maximum_regns, PER_REGN, (long) size_regns); |
---|
| 613 | printf( " Partitions - %03d * %03ld = %ld\n", |
---|
| 614 | maximum_parts, PER_PART, (long) size_parts ); |
---|
| 615 | printf( " Periods - %03d * %03ld = %ld\n", |
---|
| 616 | maximum_periods, PER_PERIOD, (long) size_periods ); |
---|
| 617 | printf( " Extensions - %03d * %03ld = %ld\n", |
---|
| 618 | maximum_extensions, PER_EXTENSION, (long) size_extensions ); |
---|
| 619 | printf( " Device Drivers - %03d * %03ld = %ld\n", |
---|
| 620 | maximum_drvs, PER_DRV, (long) size_drvs ); |
---|
[ac7d5ef0] | 621 | |
---|
| 622 | printf( " System Requirements - %04d = %d\n", |
---|
| 623 | sys_req, sys_req ); |
---|
| 624 | |
---|
[f8700f77] | 625 | printf( " Floating Point Tasks - %03d * %03ld = %ld\n", |
---|
| 626 | maximum_fps, PER_FPTASK, (long) size_fps ); |
---|
[ac7d5ef0] | 627 | printf( " Application Task Stacks - = %d\n", |
---|
| 628 | task_stacks ); |
---|
| 629 | printf( " Interrupt Stacks - = %d\n", |
---|
| 630 | task_stacks ); |
---|
| 631 | printf( " \n" ); |
---|
[f8700f77] | 632 | printf( " Global object tables - %03d * %03ld = %ld\n", |
---|
| 633 | maximum_nodes, PER_NODE, (long) size_nodes ); |
---|
| 634 | printf( " Global objects - %03d * %03ld = %ld\n", |
---|
| 635 | maximum_gobjs, PER_GOBJECT, (long) size_gobjs ); |
---|
| 636 | printf( " Proxies - %03d * %03ld = %ld\n", |
---|
| 637 | maximum_proxies, PER_PROXY, (long) size_proxies ); |
---|
[ac7d5ef0] | 638 | printf( "\n\n" ); |
---|
| 639 | printf( " TOTAL = %d bytes\n", |
---|
| 640 | total_size ); |
---|
| 641 | } |
---|
| 642 | |
---|
| 643 | void print_formula() |
---|
| 644 | { |
---|
| 645 | printf( " ************** EXECUTIVE WORK SPACE FORMULA **************\n" ); |
---|
[f8700f77] | 646 | printf( " Tasks - maximum_tasks * %ld\n", PER_TASK ); |
---|
| 647 | printf( " Timers - maximum_timers * %ld\n", PER_TIMER ); |
---|
| 648 | printf( " Semaphores - maximum_semaphores * %ld\n", PER_SEMAPHORE); |
---|
| 649 | printf( " Message Queues - maximum_message_queues * %ld\n", PER_MSGQ ); |
---|
[4b374f36] | 650 | printf( " Messages -\n"); |
---|
[f8700f77] | 651 | printf( " Regions - maximum_regions * %ld\n", PER_REGN ); |
---|
| 652 | printf( " Partitions - maximum_partitions * %ld\n", PER_PART ); |
---|
| 653 | printf( " Ports - maximum_ports * %ld\n", PER_PORT ); |
---|
| 654 | printf( " Periods - maximum_periods * %ld\n", PER_PORT ); |
---|
| 655 | printf( " Extensions - maximum_extensions * %ld\n", PER_EXTENSION ); |
---|
| 656 | printf( " Device Drivers - number_of_device_drivers * %ld\n", PER_DRV); |
---|
| 657 | printf( " System Requirements - %d\n", sys_req ); |
---|
| 658 | printf( " Floating Point Tasks - FPMASK Tasks * %ld\n", PER_FPTASK ); |
---|
[ac7d5ef0] | 659 | printf( " User's Tasks' Stacks -\n" ); |
---|
| 660 | printf( " Interrupt Stack -\n" ); |
---|
| 661 | printf( " \n" ); |
---|
[f8700f77] | 662 | printf( " Global object tables - maximum_nodes * %ld\n", PER_NODE ); |
---|
| 663 | printf( " Global objects - maximum_global_objects * %ld\n", PER_GOBJECT ); |
---|
| 664 | printf( " Proxies - maximum_proxies * %ld\n", PER_PROXY ); |
---|
[ac7d5ef0] | 665 | } |
---|