Changeset 3652ad35 in rtems for cpukit/sapi


Ignore:
Timestamp:
Sep 19, 1995, 2:53:29 PM (25 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
38ffa0c
Parents:
b3ac6a8d
Message:

Minor bug fixes to get all targets compilable and running. The
single biggest changes were the expansion of the workspace size
macro to include other types of objects and the increase in the
minimum stack size for most CPUs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/sapi/include/confdefs.h

    rb3ac6a8d r3652ad35  
    237237#endif
    238238
    239 /* Calculate the RAM size based on the maximum number of tasks configured */
     239/*
     240 *  Calculate the RAM size based on the maximum number of objects configured.
     241 *  The model is to estimate the memory required for each configured item,
     242 *  sum the memory requirements and insure that there is at least 32K greater
     243 *  than that for things not directly addressed such as:
     244 *
     245 *    + stacks greater than minimum size
     246 *    + FP contexts
     247 *    + API areas (should be optional)
     248 *    + messages
     249 *    + object name and local pointer table overhead
     250 *    + per node memory requirements
     251 *    + executive fixed requirements (including at least internal threads
     252 *       and the Ready chains)
     253 *
     254 *  NOTE:  Eventually this should take into account some of the above.
     255 *         Basically, this is a "back of the envelope" estimate for
     256 *         memory requirements.  It could be more accurate.
     257 */
    240258
    241259#ifndef CONFIGURE_EXECUTIVE_RAM_SIZE
    242 #define CONFIGURE_MEMORY_REQUIRED(_tasks) \
    243   (_tasks) * ( (sizeof(Thread_Control) + CONTEXT_FP_SIZE + STACK_MINIMUM_SIZE))
     260
     261#define CONFIGURE_OBJECT_TABLE_STUFF \
     262  ( sizeof(Objects_Control *) + sizeof(rtems_name *) + sizeof(rtems_name) )
     263
     264#define CONFIGURE_MEMORY_FOR_TASKS(_tasks) \
     265  ((_tasks) * \
     266   ((sizeof(Thread_Control) + CONTEXT_FP_SIZE + \
     267      STACK_MINIMUM_SIZE + sizeof( RTEMS_API_Control ) + \
     268      CONFIGURE_OBJECT_TABLE_STUFF)) \
     269  )
     270
     271#define CONFIGURE_MEMORY_FOR_TIMERS(_timers) \
     272  ((_timers) * ( sizeof(Timer_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
     273
     274#define CONFIGURE_MEMORY_FOR_SEMAPHORES(_semaphores) \
     275  ((_semaphores) * \
     276   ( sizeof(Semaphore_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
     277
     278#define CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(_queues) \
     279  ( (_queues) * \
     280    ( sizeof(Message_queue_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
     281
     282#define CONFIGURE_MEMORY_FOR_PARTITIONS(_partitions) \
     283  ( (_partitions) * \
     284    ( sizeof(Partition_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
     285
     286#define CONFIGURE_MEMORY_FOR_REGIONS(_regions) \
     287  ( (_regions) * \
     288    ( sizeof(Region_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
     289
     290#define CONFIGURE_MEMORY_FOR_PORTS(_ports) \
     291  ( (_ports) * \
     292    ( sizeof(Dual_ported_memory_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
     293
     294#define CONFIGURE_MEMORY_FOR_PERIODS(_periods) \
     295  ( (_periods) * \
     296    ( sizeof(Rate_monotonic_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
     297
     298#define CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(_extensions) \
     299  ( (_extensions) * \
     300    ( sizeof(Extension_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
     301
     302#define CONFIGURE_MEMORY_FOR_DEVICES(_devices) \
     303  (((_devices) + 1) * ( sizeof(rtems_driver_name_t) ) )
     304
     305#ifdef CONFIGURE_MPTEST
     306
     307#ifndef CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE
     308
     309#define CONFIGURE_MEMORY_FOR_PROXIES(_proxies) \
     310  ( ((_proxies) + 1) * ( sizeof(Thread_Proxy_control) )  )
     311
     312#define CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS(_global_objects) \
     313  ((_global_objects)  * ( sizeof(Objects_MP_Control) )  )
     314
     315#define CONFIGURE_MEMORY_FOR_MP \
     316  ( CONFIGURE_MEMORY_FOR_PROXIES(CONFIGURE_MP_MAXIMUM_PROXIES) + \
     317    CONFIGURE_MEMORY_FOR_GLOBAL_OBJECTS(CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS) \
     318  )
     319
     320#endif  /* CONFIGURE_HAS_OWN_MULTIPROCESING_TABLE */
     321
     322#else
     323
     324#define CONFIGURE_MEMORY_FOR_MP  0
     325
     326#endif
    244327#define CONFIGURE_EXECUTIVE_RAM_SIZE \
    245 ( (CONFIGURE_MEMORY_REQUIRED(CONFIGURE_MAXIMUM_TASKS) + (128*1024)) &0xffff0000)
     328(( CONFIGURE_MEMORY_FOR_TASKS(CONFIGURE_MAXIMUM_TASKS) + \
     329   CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS) + \
     330   CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_MAXIMUM_SEMAPHORES) + \
     331   CONFIGURE_MEMORY_FOR_MESSAGE_QUEUES(CONFIGURE_MAXIMUM_MESSAGE_QUEUES) + \
     332   CONFIGURE_MEMORY_FOR_PARTITIONS(CONFIGURE_MAXIMUM_PARTITIONS) + \
     333   CONFIGURE_MEMORY_FOR_REGIONS(CONFIGURE_MAXIMUM_REGIONS) + \
     334   CONFIGURE_MEMORY_FOR_PORTS(CONFIGURE_MAXIMUM_PORTS) + \
     335   CONFIGURE_MEMORY_FOR_PERIODS(CONFIGURE_MAXIMUM_PERIODS) + \
     336   CONFIGURE_MEMORY_FOR_USER_EXTENSIONS(CONFIGURE_MAXIMUM_USER_EXTENSIONS) + \
     337   CONFIGURE_MEMORY_FOR_DEVICES(CONFIGURE_MAXIMUM_DEVICES) + \
     338   CONFIGURE_MEMORY_FOR_MP + \
     339   (96*1024) \
     340) & 0xffff8000)
    246341#endif
    247342
Note: See TracChangeset for help on using the changeset viewer.