Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:24:48

0001 /* SPDX-License-Identifier: BSD-2-Clause */
0002 
0003 /**
0004  *  @file
0005  *
0006  *  This program is run to determine the data space and work space
0007  *  requirements of the current version of RTEMS.
0008  */
0009 
0010 /*
0011  *  COPYRIGHT (c) 1989-2014.
0012  *  On-Line Applications Research Corporation (OAR).
0013  *
0014  * Redistribution and use in source and binary forms, with or without
0015  * modification, are permitted provided that the following conditions
0016  * are met:
0017  * 1. Redistributions of source code must retain the above copyright
0018  *    notice, this list of conditions and the following disclaimer.
0019  * 2. Redistributions in binary form must reproduce the above copyright
0020  *    notice, this list of conditions and the following disclaimer in the
0021  *    documentation and/or other materials provided with the distribution.
0022  *
0023  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0024  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0025  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0026  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
0027  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0028  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0029  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0030  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
0031  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
0032  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
0033  * POSSIBILITY OF SUCH DAMAGE.
0034  */
0035 
0036 #ifdef HAVE_CONFIG_H
0037 #include "config.h"
0038 #endif
0039 
0040 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
0041 
0042 #include <rtems/config.h>
0043 #include <rtems/score/copyrt.h>
0044 #include <rtems/rtems/clock.h>
0045 #include <rtems/rtems/tasksimpl.h>
0046 #include <rtems/rtems/dpmemimpl.h>
0047 #include <rtems/rtems/eventimpl.h>
0048 #include <rtems/extensionimpl.h>
0049 #include <rtems/fatal.h>
0050 #include <rtems/init.h>
0051 #include <rtems/score/isr.h>
0052 #include <rtems/rtems/intr.h>
0053 #include <rtems/io.h>
0054 #include <rtems/rtems/messageimpl.h>
0055 #if defined(RTEMS_MULTIPROCESSING)
0056 #include <rtems/rtems/mp.h>
0057 #include <rtems/score/mpciimpl.h>
0058 #endif
0059 #include <rtems/rtems/partimpl.h>
0060 #include <rtems/score/priority.h>
0061 #include <rtems/rtems/ratemonimpl.h>
0062 #include <rtems/rtems/regionimpl.h>
0063 #include <rtems/rtems/semimpl.h>
0064 #include <rtems/rtems/signal.h>
0065 #include <rtems/score/scheduler.h>
0066 #include <rtems/score/sysstate.h>
0067 #include <rtems/score/thread.h>
0068 #include <rtems/rtems/timerimpl.h>
0069 #include <rtems/score/todimpl.h>
0070 #include <rtems/score/userextimpl.h>
0071 #include <rtems/score/watchdogimpl.h>
0072 #include <rtems/score/wkspace.h>
0073 #if defined(RTEMS_SMP)
0074   #include <rtems/score/smp.h>
0075 #endif
0076 
0077 #include <stdlib.h>
0078 #include <stdio.h>
0079 #include <unistd.h>
0080 #include <tmacros.h>
0081 
0082 #include "system.h"
0083 
0084 /* external function prototypes */
0085 int getint( void );
0086 void size_rtems(int mode);
0087 void help_size(void);
0088 void print_formula(void);
0089 
0090 
0091 /* These are always defined by the executive.
0092  *
0093  * #include <rtems/copyrt.h>
0094  * #include <rtems/tables.h>
0095  */
0096 #define  HEAP_OVHD        16    /* wasted heap space per task stack */
0097 #define  NAME_PTR_SIZE     8    /* size of name and pointer table entries */
0098 
0099 /*
0100  *  This assumes the default Priority Scheduler
0101  */
0102 #include <rtems/score/prioritybitmapimpl.h>
0103 #include <rtems/score/schedulerpriority.h>
0104 
0105 /* Priority scheduling per-thread consumption. Gets 
0106  * included in the PER_TASK consumption.
0107  */
0108 #define SCHEDULER_TASK_WKSP     (sizeof(Scheduler_priority_Node))
0109 
0110 /* Priority scheduling workspace consumption 
0111  *
0112  * Include allocation of ready queue.
0113  */
0114 #define SCHEDULER_WKSP_SIZE  \
0115     (sizeof(Scheduler_priority_Context) + \
0116      RTEMS_MAXIMUM_PRIORITY * sizeof(Chain_Control ))
0117 /****** END OF MEMORY USAGE OF DEFAULT PRIORITY SCHEDULER ******/
0118 
0119 #define PER_TASK      \
0120      (long) (sizeof (Thread_Control) + \
0121       NAME_PTR_SIZE + HEAP_OVHD + sizeof( RTEMS_API_Control ) + \
0122       SCHEDULER_TASK_WKSP )
0123 #define PER_SEMAPHORE \
0124      (long) (sizeof (Semaphore_Control) + NAME_PTR_SIZE)
0125 #define PER_TIMER     \
0126      (long) (sizeof (Timer_Control) + NAME_PTR_SIZE)
0127 #define PER_MSGQ      \
0128      (long) (sizeof (Message_queue_Control) + NAME_PTR_SIZE)
0129 #define PER_REGN      \
0130      (long) (sizeof (Region_Control) + NAME_PTR_SIZE)
0131 #define PER_PART      \
0132      (long) (sizeof (Partition_Control) + NAME_PTR_SIZE)
0133 #define PER_PERIOD      \
0134      (long) (sizeof (Rate_monotonic_Control) + NAME_PTR_SIZE)
0135 #define PER_PORT      \
0136      (long) (sizeof (Dual_ported_memory_Control) + NAME_PTR_SIZE)
0137 #define PER_EXTENSION     \
0138      (long) (sizeof (Extension_Control) + NAME_PTR_SIZE)
0139 
0140 #define PER_DRV       (long) (0)
0141 #define PER_FPTASK    (long) (CONTEXT_FP_SIZE)
0142 #define PER_GOBTBL    (long) (sizeof (Chain_Control)*4)
0143 #define PER_NODE      (long) PER_GOBTBL
0144 #if defined(RTEMS_MULTIPROCESSING)
0145 #define PER_GOBJECT   (long) (sizeof (Objects_MP_Control))
0146 #else
0147 #define PER_GOBJECT   (long) 0
0148 #endif
0149 #define PER_PROXY     (long) (sizeof (Thread_Proxy_control))
0150 
0151 #if !defined(RTEMS_MULTIPROCESSING) || (CPU_ALL_TASKS_ARE_FP != TRUE)
0152 #define MPCI_RECEIVE_SERVER_FP (long) 0
0153 #else
0154 #define MPCI_RECEIVE_SERVER_FP (long) (sizeof( Context_Control_fp ))
0155 #endif
0156 
0157 #if (CPU_IDLE_TASK_IS_FP == TRUE)
0158 #define SYSTEM_IDLE_FP (long) (sizeof( Context_Control_fp ))
0159 #else
0160 #define SYSTEM_IDLE_FP (long) 0
0161 #endif
0162 
0163 #if !defined(RTEMS_MULTIPROCESSING)
0164 #define MPCI_RECEIVE_SERVER_STACK_SIZE 0
0165 #endif
0166 
0167 #if defined(RTEMS_MULTIPROCESSING)
0168 #define MPCI_RECEIVE_SERVER_STACK_SIZE \
0169 
0170 #define MP_SYSTEM_TASKS \
0171    (STACK_MINIMUM_SIZE + CPU_MPCI_RECEIVE_SERVER_EXTRA_STACK + \
0172     sizeof(Thread_Control) + \
0173     MPCI_RECEIVE_SERVER_FP)
0174 
0175 extern CORE_semaphore_Control _MPCI_Semaphore;
0176 #else
0177 #define MP_SYSTEM_TASKS 0
0178 #endif
0179 
0180 /*
0181  *  Idle and the MPCI Receive Server Threads
0182  */
0183 
0184 #define SYSTEM_TASKS  \
0185     (STACK_MINIMUM_SIZE + sizeof(Thread_Control) + SYSTEM_IDLE_FP + \
0186      MP_SYSTEM_TASKS)
0187 
0188 /* FIXME: uint32_t doesn't seem right */
0189 uint32_t   sys_req;
0190 
0191 void size_rtems(
0192   int mode
0193 )
0194 {
0195 int uninitialized = 0;
0196 int initialized = 0;
0197 
0198 /*
0199  *  The following data is allocated for each Manager:
0200  *
0201  *    + Per Manager Object Information
0202  *      - local pointer table
0203  *      - local name table
0204  *      - the object's control blocks
0205  *      - global name chains
0206  *
0207  *  The following is the data allocate from the RTEMS Workspace Area.
0208  *  The order indicates the order in which RTEMS allocates it.
0209  *
0210  *    + Object MP
0211  *      - Global Object CB's
0212  *    + Thread MP
0213  *      - Proxies Chain
0214  *    + Scheduler
0215  *      - Ready queue
0216  *    + Interrupt Manager
0217  *      - Interrupt Stack
0218  *    + Timer Manager
0219  *      - per Manager Object Data
0220  *    + Extension Manager
0221  *      - per Manager Object Data
0222  *    + Message Queue Manager
0223  *      - per Manager Object Data
0224  *      - Message Buffers
0225  *    + Semaphore Manager
0226  *      - per Manager Object Data
0227  *    + Partition Manager
0228  *      - per Manager Object Data
0229  *    + Region Manager
0230  *      - per Manager Object Data
0231  *    + Dual Ported Memory Manager
0232  *      - per Manager Object Data
0233  *    + Rate Monotonic Manager
0234  *      - per Manager Object Data
0235  *    + Internal Threads Handler
0236  *      - MPCI Receive Server Thread TCB
0237  *      - IDLE Thread TCB
0238  *      - MPCI Receive Server Thread stack
0239  *      - MPCI Receive Server Thread FP area (if CPU requires this)
0240  *      - IDLE Thread stack
0241  *      - IDLE Thread FP area (if CPU requires this)
0242  *
0243  *  This does not take into account any CPU dependent alignment requirements.
0244  *
0245  *  The following calculates the overhead needed by RTEMS from the
0246  *  Workspace Area.
0247  */
0248 sys_req = SYSTEM_TASKS        +     /* MPCI Receive Server and IDLE */
0249           NAME_PTR_SIZE       +     /* Task Overhead */
0250           SCHEDULER_WKSP_SIZE +     /* Scheduler Overhead */
0251           NAME_PTR_SIZE       +     /* Timer Overhead */
0252           NAME_PTR_SIZE       +     /* Semaphore Overhead */
0253           NAME_PTR_SIZE       +     /* Message Queue Overhead */
0254           NAME_PTR_SIZE       +     /* Region Overhead */
0255           NAME_PTR_SIZE       +     /* Partition Overhead */
0256           NAME_PTR_SIZE       +     /* Dual-Ported Memory Overhead */
0257           NAME_PTR_SIZE       +     /* Rate Monotonic Overhead */
0258           NAME_PTR_SIZE       +     /* Extension Overhead */
0259           PER_NODE;                 /* Extra Gobject Table */
0260 
0261 uninitialized =
0262 /*address.h*/   0                                         +
0263 
0264 /*asr.h*/       0                                         +
0265 
0266 /*attr.h*/      0                                         +
0267 
0268 /*bitfield.h*/  0                                         +
0269 
0270 /*chain.h*/     0                                         +
0271 
0272 /*clock.h*/     0                                         +
0273 
0274 /*config.h*/    0                                         +
0275 
0276 /*context.h*/   (sizeof _Thread_Dispatch_necessary)        +
0277 
0278 /*copyrt.h*/    0                                         +
0279 
0280 /*dpmemimpl.h*/ (sizeof _Dual_ported_memory_Information)  +
0281 
0282 #if defined(RTEMS_MULTIPROCESSING)
0283 /*eventmp.h*/   0                                         +
0284 #endif
0285 
0286 /*extensionimpl.h*/ (sizeof _Extension_Information)       +
0287 
0288 /*fatal.h*/     0                                         +
0289 
0290 /*heap.h*/      0                                         +
0291 
0292 /*init.h*/      0                                         +
0293 
0294 /*intr.h*/      0                                         +
0295 
0296 /*isr.h*/       (sizeof _ISR_Nest_level)                  +
0297 #if (CPU_SIMPLE_VECTORED_INTERRUPTS == TRUE)
0298                 (sizeof _ISR_Vector_table)                +
0299 #endif
0300 
0301 /*messageimpl.h*/ (sizeof _Message_queue_Information)     +
0302 
0303 /*modes.h*/     0                                         +
0304 
0305 #if defined(RTEMS_MULTIPROCESSING)
0306 /*mp.h*/        0                                         +
0307 #endif
0308 
0309 #if defined(RTEMS_MULTIPROCESSING)
0310 /*mpciimpl.h*/  (sizeof _MPCI_Remote_blocked_threads)     +
0311                 (sizeof _MPCI_Semaphore)                  +
0312                 (sizeof _MPCI_table)                      +
0313                 (sizeof _MPCI_Receive_server_tcb)         +
0314                 (sizeof _MPCI_Packet_processors)          +
0315 #endif
0316 
0317 #if defined(RTEMS_MULTIPROCESSING)
0318 /*mppkt.h*/     0                                         +
0319 #endif
0320 
0321 #if defined(RTEMS_MULTIPROCESSING)
0322 /*mptables.h*/  0                                         +
0323 #endif
0324 
0325 #if defined(RTEMS_MULTIPROCESSING)
0326 /*msgmp.h*/     0                                         +
0327 #endif
0328 
0329 /*object.h*/    (sizeof _Objects_Local_node)              +
0330                 (sizeof _Objects_Maximum_nodes)           +
0331                 (sizeof _Objects_Information_table)       +
0332 
0333 /*options.h*/   0                                         +
0334 
0335 /*partimpl.h*/  (sizeof _Partition_Information)           +
0336 
0337 #if defined(RTEMS_MULTIPROCESSING)
0338 /*partmp.h*/    0                                         +
0339 #endif
0340 
0341 /*percpu.h*/    (_SMP_Get_processor_maximum() * sizeof(Per_CPU_Control))  +
0342 
0343 /*ratemonimpl.h*/ (sizeof _Rate_monotonic_Information)    +
0344 
0345 /*regionimpl.h*/ (sizeof _Region_Information)             +
0346 
0347 #if defined(RTEMS_MULTIPROCESSING)
0348 /*regionmp.h*/  0                                         +
0349 #endif
0350 
0351 /*rtems.h*/     /* Not applicable */
0352 
0353 /*semimpl.h*/   (sizeof _Semaphore_Information)           +
0354 
0355 #if defined(RTEMS_MULTIPROCESSING)
0356 /*semmp.h*/     0                                         +
0357 #endif
0358 
0359 /*signal.h*/    0                                         +
0360 
0361 /*signalmp.h*/  0                                         +
0362 
0363 /*stack.h*/     0                                         +
0364 
0365 /*states.h*/    0                                         +
0366 
0367 /*status.h*/    0                                         +
0368 
0369 /*sysstate.h*/  (sizeof _System_state_Current)            +
0370 #if defined(RTEMS_MULTIPROCESSING)
0371                 (sizeof _System_state_Is_multiprocessing) +
0372 #endif
0373 
0374 #if defined(RTEMS_MULTIPROCESSING)
0375 /*taskmp.h*/    0                                         +
0376 #endif
0377 
0378 /*tasksimpl.h*/ (sizeof _RTEMS_tasks_Information)         +
0379 
0380 /*thread.h*/    (sizeof _Thread_Dispatch_disable_level)   +
0381                 (sizeof _Thread_Executing)                +
0382                 (sizeof _Thread_Heir)                     +
0383 #if (CPU_HARDWARE_FP == 1) || (CPU_SOFTWARE_FP == 1)
0384                 (sizeof _Thread_Allocated_fp)             +
0385 #endif
0386                 (sizeof _Thread_Information)     +
0387 
0388 /*threadq.h*/
0389 
0390 /*timerimpl.h*/ (sizeof _Timer_Information)               +
0391 
0392 /*tqdata.h*/    0                                         +
0393 
0394 /*types.h*/     0                                         +
0395 
0396 /*userext.h*/   (sizeof _User_extensions_List)            +
0397 
0398 /*watchdog.h*/  (sizeof _Watchdog_Ticks_since_boot)       +
0399 
0400 /*wkspace.h*/   (sizeof _Workspace_Area);
0401 
0402 #ifndef unix  /* make sure this is not a native compile */
0403 
0404 #ifdef __i386__
0405 
0406 /* cpu.h */
0407 uninitialized += (sizeof _CPU_Null_fp_context);
0408 
0409 uninitialized += (sizeof _CPU_Interrupt_stack_low) +
0410                  (sizeof _CPU_Interrupt_stack_high);
0411 
0412 #endif
0413 
0414 #ifdef __mc68000__
0415 
0416 /* cpu.h */
0417 uninitialized += (sizeof _CPU_Interrupt_stack_low) +
0418                  (sizeof _CPU_Interrupt_stack_high);
0419 
0420 #endif
0421 
0422 #ifdef __sparc__
0423 
0424 /* cpu.h */
0425 uninitialized += (sizeof _CPU_Interrupt_stack_low) +
0426                  (sizeof _CPU_Interrupt_stack_high);
0427 
0428 #endif
0429 
0430 
0431 #ifdef no_cpu
0432 
0433 /* cpu.h */
0434 uninitialized += (sizeof _CPU_Null_fp_context) +
0435                  (sizeof _CPU_Interrupt_stack_low) +
0436                  (sizeof _CPU_Interrupt_stack_high) +
0437                  (sizeof _CPU_Thread_dispatch_pointer);
0438 
0439 #endif
0440 
0441 #ifdef __PPC__
0442 
0443 /* cpu.h */
0444 uninitialized += (sizeof _CPU_Interrupt_stack_low) +
0445                  (sizeof _CPU_Interrupt_stack_high);
0446 
0447 #endif
0448 #endif /* !unix */
0449 
0450 initialized +=
0451 /*copyrt.h*/    (strlen(_Copyright_Notice)+1)             +
0452                 (strlen(_RTEMS_version)+1);
0453 
0454 
0455 
0456 #ifndef unix /* make sure this is not native */
0457 #ifdef __sparc__
0458 
0459 initialized +=  (sizeof _CPU_Trap_slot_template);
0460 
0461 #endif
0462 #endif /* !unix */
0463 
0464 puts( "" );
0465 
0466   if ( mode == 0 ) help_size();
0467   else             print_formula();
0468 
0469 printf( "\n" );
0470 printf( "RTEMS uninitialized data consumes %d bytes\n", uninitialized );
0471 printf( "RTEMS initialized data consumes %d bytes\n", initialized );
0472 
0473 }
0474 
0475 void help_size()
0476 {
0477 int c = '\0';
0478 int break_loop;
0479 int total_size;
0480 int task_stacks;
0481 int interrupt_stack;
0482 int maximum_tasks, size_tasks;
0483 int maximum_sems, size_sems;
0484 int maximum_timers, size_timers;
0485 int maximum_msgqs, size_msgqs;
0486 int maximum_msgs, size_msgs_overhead;
0487 int maximum_regns, size_regns;
0488 int maximum_parts, size_parts;
0489 int maximum_ports, size_ports;
0490 int maximum_periods, size_periods;
0491 int maximum_extensions, size_extensions;
0492 int maximum_drvs, size_drvs;
0493 int maximum_fps, size_fps;
0494 int maximum_nodes, size_nodes;
0495 int maximum_gobjs, size_gobjs;
0496 int maximum_proxies, size_proxies;
0497 
0498 total_size = sys_req;    /* Fixed Overhead */
0499 printf( "What is maximum_tasks? " );
0500 maximum_tasks = getint();
0501 size_tasks = PER_TASK * maximum_tasks;
0502 total_size += size_tasks;
0503 
0504 printf( "What is maximum_semaphores? " );
0505 maximum_sems = getint();
0506 size_sems = PER_SEMAPHORE * maximum_sems;
0507 total_size += size_sems;
0508 
0509 printf( "What is maximum_timers? " );
0510 maximum_timers = getint();
0511 size_timers = PER_TIMER * maximum_timers;
0512 total_size += size_timers;
0513 
0514 printf( "What is maximum_message_queues? " );
0515 maximum_msgqs = getint();
0516 size_msgqs = PER_MSGQ * maximum_msgqs;
0517 total_size += size_msgqs;
0518 
0519 printf( "What is maximum_messages?  XXXX " );
0520 maximum_msgs = getint();
0521 size_msgs_overhead = 0;
0522 total_size += size_msgs_overhead;
0523 
0524 printf( "What is maximum_regions? " );
0525 maximum_regns = getint();
0526 size_regns = PER_REGN * maximum_regns;
0527 total_size += size_regns;
0528 
0529 printf( "What is maximum_partitions? " );
0530 maximum_parts = getint();
0531 size_parts = PER_PART * maximum_parts;
0532 total_size += size_parts;
0533 
0534 printf( "What is maximum_ports? " );
0535 maximum_ports = getint();
0536 size_ports = PER_PORT * maximum_ports;
0537 total_size += size_ports;
0538 
0539 printf( "What is maximum_periods? " );
0540 maximum_periods = getint();
0541 size_periods = PER_PERIOD * maximum_periods;
0542 total_size += size_periods;
0543 
0544 printf( "What is maximum_extensions? " );
0545 maximum_extensions = getint();
0546 size_extensions = PER_EXTENSION * maximum_extensions;
0547 total_size += size_extensions;
0548 
0549 printf( "What is number_of_device_drivers? " );
0550 maximum_drvs = getint();
0551 size_drvs = PER_DRV  * maximum_drvs;
0552 total_size += size_drvs;
0553 
0554 printf( "What will be total stack requirement for all tasks? " );
0555 task_stacks = getint();
0556 total_size += task_stacks;
0557 
0558 printf( "What is the size of the interrupt stack? " );
0559 interrupt_stack = getint();
0560 total_size += interrupt_stack;
0561 
0562 printf( "How many tasks will be created with the FP flag? " );
0563 maximum_fps = getint();
0564 size_fps = PER_FPTASK  * maximum_fps;
0565 total_size += size_fps;
0566 
0567 printf( "Is this a single processor system? " );
0568 for ( break_loop=0 ; !break_loop; c = getchar() ) {
0569   switch ( c ) {
0570     case 'Y':  case 'y':
0571     case 'N':  case 'n':
0572       break_loop = 1;
0573       break;
0574   }
0575 }
0576 printf( "%c\n", c );
0577 if ( c == 'n' || c == 'N' ) {
0578   printf( "What is maximum_nodes? " );
0579   maximum_nodes = getint();
0580   size_nodes = PER_NODE * maximum_nodes;
0581   total_size += size_nodes;
0582   printf( "What is maximum_global_objects? " );
0583   maximum_gobjs = getint();
0584   size_gobjs = PER_GOBJECT * maximum_gobjs;
0585   total_size += size_gobjs;
0586   printf( "What is maximum_proxies? " );
0587   maximum_proxies = getint();
0588   size_proxies = PER_PROXY * maximum_proxies;
0589   total_size += size_proxies;
0590 } else {
0591   maximum_nodes = 0;
0592   size_nodes = PER_NODE * 0;
0593   maximum_gobjs = 0;
0594   size_gobjs = PER_GOBJECT * 0;
0595   maximum_proxies = 0;
0596   size_proxies = PER_PROXY * 0;
0597 }
0598 
0599 printf( "\n\n" );
0600 printf( " ************** EXECUTIVE WORK SPACE REQUIRED **************\n" );
0601 printf( " Tasks                - %03d * %03ld            =  %ld\n",
0602           maximum_tasks, PER_TASK, (long) size_tasks );
0603 printf( " Semaphores           - %03d * %03ld            =  %ld\n",
0604           maximum_sems, PER_SEMAPHORE, (long) size_sems );
0605 printf( " Timers               - %03d * %03ld            =  %ld\n",
0606           maximum_timers, PER_TIMER, (long) size_timers );
0607 printf( " Msg Queues           - %03d * %03ld            =  %ld\n",
0608           maximum_msgqs, PER_MSGQ, (long) size_msgqs );
0609 printf( " Messages Overhead    - %03d * %03d            =  %ld\n",
0610           maximum_msgs, 0 /* PER_MSG_OVERHEAD */, (long) size_msgs_overhead );
0611 printf( " Regions              - %03d * %03ld            =  %ld\n",
0612           maximum_regns, PER_REGN, (long) size_regns);
0613 printf( " Partitions           - %03d * %03ld            =  %ld\n",
0614           maximum_parts, PER_PART, (long) size_parts );
0615 printf( " Periods              - %03d * %03ld            =  %ld\n",
0616           maximum_periods, PER_PERIOD, (long) size_periods );
0617 printf( " Extensions           - %03d * %03ld            =  %ld\n",
0618           maximum_extensions, PER_EXTENSION, (long) size_extensions );
0619 printf( " Device Drivers       - %03d * %03ld            =  %ld\n",
0620           maximum_drvs, PER_DRV, (long) size_drvs );
0621 
0622 printf( " System Requirements  - %04" PRIu32 "                 =  %"PRIu32 "\n",
0623           sys_req, sys_req );
0624 
0625 printf( " Floating Point Tasks - %03d * %03ld            =  %ld\n",
0626           maximum_fps, PER_FPTASK, (long) size_fps );
0627 printf( " Application Task Stacks -                     =  %d\n",
0628           task_stacks );
0629 printf( " Interrupt Stacks -                            =  %d\n",
0630           task_stacks );
0631 printf( " \n" );
0632 printf( " Global object tables - %03d * %03ld            =  %ld\n",
0633           maximum_nodes, PER_NODE, (long) size_nodes );
0634 printf( " Global objects       - %03d * %03ld            =  %ld\n",
0635           maximum_gobjs, PER_GOBJECT, (long) size_gobjs );
0636 printf( " Proxies              - %03d * %03ld            =  %ld\n",
0637           maximum_proxies, PER_PROXY, (long) size_proxies );
0638 printf( "\n\n" );
0639 printf( " TOTAL                                       = %d bytes\n",
0640       total_size );
0641 }
0642 
0643 void print_formula()
0644 {
0645 printf( " ************** EXECUTIVE WORK SPACE FORMULA **************\n" );
0646 printf( " Tasks                - maximum_tasks * %ld\n",      PER_TASK );
0647 printf( " Timers               - maximum_timers * %ld\n",     PER_TIMER );
0648 printf( " Semaphores           - maximum_semaphores * %ld\n", PER_SEMAPHORE);
0649 printf( " Message Queues       - maximum_message_queues * %ld\n", PER_MSGQ );
0650 printf( " Messages             -\n");
0651 printf( " Regions              - maximum_regions * %ld\n",    PER_REGN );
0652 printf( " Partitions           - maximum_partitions * %ld\n", PER_PART );
0653 printf( " Ports                - maximum_ports * %ld\n",      PER_PORT );
0654 printf( " Periods              - maximum_periods * %ld\n",    PER_PORT );
0655 printf( " Extensions           - maximum_extensions * %ld\n", PER_EXTENSION );
0656 printf( " Device Drivers       - number_of_device_drivers * %ld\n", PER_DRV);
0657 printf( " System Requirements  - %" PRIu32 "\n",              sys_req );
0658 printf( " Floating Point Tasks - FPMASK Tasks * %ld\n",       PER_FPTASK );
0659 printf( " User's Tasks' Stacks -\n" );
0660 printf( " Interrupt Stack      -\n" );
0661 printf( " \n" );
0662 printf( " Global object tables - maximum_nodes * %ld\n",          PER_NODE );
0663 printf( " Global objects       - maximum_global_objects * %ld\n", PER_GOBJECT );
0664 printf( " Proxies              - maximum_proxies * %ld\n",        PER_PROXY );
0665 }