source: rtems/testsuites/sptests/spsize/size.c @ 8fbdf07

4.104.114.84.95
Last change on this file since 8fbdf07 was 08311cc3, checked in by Joel Sherrill <joel.sherrill@…>, on 11/17/99 at 17:51:34

Updated copyright notice.

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