Changeset 308aed9b in rtems


Ignore:
Timestamp:
Apr 27, 1998, 1:49:42 PM (22 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
6ce14e7
Parents:
20fff72
Message:

Added numerous entries to make the memory calculation more accurate:

+ POSIX threads
+ Ada tasks
+ POSIX threads API support
+ POSIX condition variables
+ POSIX keys (still do not account for data fields)
+ POSIX mutexes
+ POSIX queued signals
+ added macro for extra memory for task stacks
+ default value for CONFIGURE_MAXIMUM_FAKE_ADA_TASKS
+ extra memory for Ada task stacks

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/sapi/headers/confdefs.h

    r20fff72 r308aed9b  
    327327#ifdef RTEMS_POSIX_API
    328328
     329#include <sys/types.h>
     330#include <rtems/posix/cond.h>
     331#include <rtems/posix/mutex.h>
     332#include <rtems/posix/key.h>
     333#include <rtems/posix/psignal.h>
     334#include <rtems/posix/threadsup.h>
     335
    329336#ifndef CONFIGURE_MAXIMUM_POSIX_THREADS
    330337#define CONFIGURE_MAXIMUM_POSIX_THREADS      10
     
    382389
    383390#endif
     391
     392#define CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API \
     393  ( \
     394    sizeof (POSIX_API_Control) + \
     395   (sizeof (void *) * (CONFIGURE_GNAT_KEYS + CONFIGURE_MAXIMUM_POSIX_KEYS)) \
     396  )
     397
     398#define CONFIGURE_MEMORY_FOR_POSIX_MUTEXES(_mutexes) \
     399  ((_mutexes) * \
     400   ( sizeof(POSIX_Mutex_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
     401
     402#define CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES(_condition_variables) \
     403  ((_condition_variables) * \
     404   ( sizeof(POSIX_Condition_variables_Control) + \
     405        CONFIGURE_OBJECT_TABLE_STUFF ) )
     406
     407#define CONFIGURE_MEMORY_FOR_POSIX_KEYS(_keys) \
     408  ((_keys) * \
     409   ( sizeof(POSIX_Keys_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
     410
     411#define CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS(_queued_signals) \
     412  ((_queued_signals) * \
     413   ( sizeof(POSIX_signals_Siginfo_node) + CONFIGURE_OBJECT_TABLE_STUFF ) )
     414
     415 
     416
     417#define CONFIGURE_MEMORY_FOR_POSIX \
     418  ( \
     419    CONFIGURE_MEMORY_FOR_POSIX_MUTEXES( CONFIGURE_MAXIMUM_POSIX_MUTEXES ) + \
     420    CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES( \
     421        CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES ) + \
     422    CONFIGURE_MEMORY_FOR_POSIX_KEYS( CONFIGURE_MAXIMUM_POSIX_KEYS ) + \
     423    CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS( \
     424        CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS ) \
     425   )
     426
     427
     428#else
     429
     430#define CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API 0
     431#define CONFIGURE_MEMORY_FOR_POSIX              0
    384432
    385433#endif    /* RTEMS_POSIX_API */
     
    414462   ((sizeof(Thread_Control) + CONTEXT_FP_SIZE + \
    415463      STACK_MINIMUM_SIZE + sizeof( RTEMS_API_Control ) + \
     464      CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API + \
    416465      CONFIGURE_OBJECT_TABLE_STUFF)) \
    417466  )
     
    477526#ifndef CONFIGURE_MEMORY_OVERHEAD
    478527#define CONFIGURE_MEMORY_OVERHEAD 0
     528#endif
     529
     530#ifndef CONFIGURE_EXTRA_TASK_STACKS
     531#define CONFIGURE_EXTRA_TASK_STACKS 0
    479532#endif
    480533
     
    487540
    488541#define CONFIGURE_EXECUTIVE_RAM_SIZE \
    489 (( CONFIGURE_MEMORY_FOR_TASKS(CONFIGURE_MAXIMUM_TASKS) + \
     542(( CONFIGURE_MEMORY_FOR_POSIX + \
     543   CONFIGURE_MEMORY_FOR_TASKS(CONFIGURE_MAXIMUM_TASKS + \
     544      CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_ADA_TASKS ) + \
    490545   CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS) + \
    491546   CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_MAXIMUM_SEMAPHORES + \
     
    504559   CONFIGURE_MEMORY_FOR_SYSTEM_OVEREHAD + \
    505560   (((CONFIGURE_MEMORY_OVERHEAD)+1) * 1024) \
     561   (((CONFIGURE_EXTRA_TASK_STACKS)+1) * 1024) \
    506562) & 0xfffffc00)
    507563#endif
     
    515571#define CONFIGURE_MAXIMUM_ADA_TASKS  20
    516572#endif
     573
     574/* This is the number of non-Ada tasks which invoked Ada code. */
     575#ifndef CONFIGURE_MAXIMUM_FAKE_ADA_TASKS
     576#define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0
     577#endif
     578
     579/* Ada tasks are allocated twice the minimum stack space */
     580#define CONFIGURE_ADA_TASKS_STACK \
     581  (CONFIGURE_MAXIMUM_ADA_TASKS * RTEMS_MINIMUM_STACK_SIZE)
    517582
    518583#else
     
    521586#define CONFIGURE_MAXIMUM_ADA_TASKS      0
    522587#define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0
     588#define CONFIGURE_ADA_TASKS_STACK        0
    523589#endif
    524590
  • c/src/exec/sapi/include/confdefs.h

    r20fff72 r308aed9b  
    327327#ifdef RTEMS_POSIX_API
    328328
     329#include <sys/types.h>
     330#include <rtems/posix/cond.h>
     331#include <rtems/posix/mutex.h>
     332#include <rtems/posix/key.h>
     333#include <rtems/posix/psignal.h>
     334#include <rtems/posix/threadsup.h>
     335
    329336#ifndef CONFIGURE_MAXIMUM_POSIX_THREADS
    330337#define CONFIGURE_MAXIMUM_POSIX_THREADS      10
     
    382389
    383390#endif
     391
     392#define CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API \
     393  ( \
     394    sizeof (POSIX_API_Control) + \
     395   (sizeof (void *) * (CONFIGURE_GNAT_KEYS + CONFIGURE_MAXIMUM_POSIX_KEYS)) \
     396  )
     397
     398#define CONFIGURE_MEMORY_FOR_POSIX_MUTEXES(_mutexes) \
     399  ((_mutexes) * \
     400   ( sizeof(POSIX_Mutex_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
     401
     402#define CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES(_condition_variables) \
     403  ((_condition_variables) * \
     404   ( sizeof(POSIX_Condition_variables_Control) + \
     405        CONFIGURE_OBJECT_TABLE_STUFF ) )
     406
     407#define CONFIGURE_MEMORY_FOR_POSIX_KEYS(_keys) \
     408  ((_keys) * \
     409   ( sizeof(POSIX_Keys_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
     410
     411#define CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS(_queued_signals) \
     412  ((_queued_signals) * \
     413   ( sizeof(POSIX_signals_Siginfo_node) + CONFIGURE_OBJECT_TABLE_STUFF ) )
     414
     415 
     416
     417#define CONFIGURE_MEMORY_FOR_POSIX \
     418  ( \
     419    CONFIGURE_MEMORY_FOR_POSIX_MUTEXES( CONFIGURE_MAXIMUM_POSIX_MUTEXES ) + \
     420    CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES( \
     421        CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES ) + \
     422    CONFIGURE_MEMORY_FOR_POSIX_KEYS( CONFIGURE_MAXIMUM_POSIX_KEYS ) + \
     423    CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS( \
     424        CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS ) \
     425   )
     426
     427
     428#else
     429
     430#define CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API 0
     431#define CONFIGURE_MEMORY_FOR_POSIX              0
    384432
    385433#endif    /* RTEMS_POSIX_API */
     
    414462   ((sizeof(Thread_Control) + CONTEXT_FP_SIZE + \
    415463      STACK_MINIMUM_SIZE + sizeof( RTEMS_API_Control ) + \
     464      CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API + \
    416465      CONFIGURE_OBJECT_TABLE_STUFF)) \
    417466  )
     
    477526#ifndef CONFIGURE_MEMORY_OVERHEAD
    478527#define CONFIGURE_MEMORY_OVERHEAD 0
     528#endif
     529
     530#ifndef CONFIGURE_EXTRA_TASK_STACKS
     531#define CONFIGURE_EXTRA_TASK_STACKS 0
    479532#endif
    480533
     
    487540
    488541#define CONFIGURE_EXECUTIVE_RAM_SIZE \
    489 (( CONFIGURE_MEMORY_FOR_TASKS(CONFIGURE_MAXIMUM_TASKS) + \
     542(( CONFIGURE_MEMORY_FOR_POSIX + \
     543   CONFIGURE_MEMORY_FOR_TASKS(CONFIGURE_MAXIMUM_TASKS + \
     544      CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_ADA_TASKS ) + \
    490545   CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS) + \
    491546   CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_MAXIMUM_SEMAPHORES + \
     
    504559   CONFIGURE_MEMORY_FOR_SYSTEM_OVEREHAD + \
    505560   (((CONFIGURE_MEMORY_OVERHEAD)+1) * 1024) \
     561   (((CONFIGURE_EXTRA_TASK_STACKS)+1) * 1024) \
    506562) & 0xfffffc00)
    507563#endif
     
    515571#define CONFIGURE_MAXIMUM_ADA_TASKS  20
    516572#endif
     573
     574/* This is the number of non-Ada tasks which invoked Ada code. */
     575#ifndef CONFIGURE_MAXIMUM_FAKE_ADA_TASKS
     576#define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0
     577#endif
     578
     579/* Ada tasks are allocated twice the minimum stack space */
     580#define CONFIGURE_ADA_TASKS_STACK \
     581  (CONFIGURE_MAXIMUM_ADA_TASKS * RTEMS_MINIMUM_STACK_SIZE)
    517582
    518583#else
     
    521586#define CONFIGURE_MAXIMUM_ADA_TASKS      0
    522587#define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0
     588#define CONFIGURE_ADA_TASKS_STACK        0
    523589#endif
    524590
  • cpukit/sapi/include/confdefs.h

    r20fff72 r308aed9b  
    327327#ifdef RTEMS_POSIX_API
    328328
     329#include <sys/types.h>
     330#include <rtems/posix/cond.h>
     331#include <rtems/posix/mutex.h>
     332#include <rtems/posix/key.h>
     333#include <rtems/posix/psignal.h>
     334#include <rtems/posix/threadsup.h>
     335
    329336#ifndef CONFIGURE_MAXIMUM_POSIX_THREADS
    330337#define CONFIGURE_MAXIMUM_POSIX_THREADS      10
     
    382389
    383390#endif
     391
     392#define CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API \
     393  ( \
     394    sizeof (POSIX_API_Control) + \
     395   (sizeof (void *) * (CONFIGURE_GNAT_KEYS + CONFIGURE_MAXIMUM_POSIX_KEYS)) \
     396  )
     397
     398#define CONFIGURE_MEMORY_FOR_POSIX_MUTEXES(_mutexes) \
     399  ((_mutexes) * \
     400   ( sizeof(POSIX_Mutex_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
     401
     402#define CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES(_condition_variables) \
     403  ((_condition_variables) * \
     404   ( sizeof(POSIX_Condition_variables_Control) + \
     405        CONFIGURE_OBJECT_TABLE_STUFF ) )
     406
     407#define CONFIGURE_MEMORY_FOR_POSIX_KEYS(_keys) \
     408  ((_keys) * \
     409   ( sizeof(POSIX_Keys_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
     410
     411#define CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS(_queued_signals) \
     412  ((_queued_signals) * \
     413   ( sizeof(POSIX_signals_Siginfo_node) + CONFIGURE_OBJECT_TABLE_STUFF ) )
     414
     415 
     416
     417#define CONFIGURE_MEMORY_FOR_POSIX \
     418  ( \
     419    CONFIGURE_MEMORY_FOR_POSIX_MUTEXES( CONFIGURE_MAXIMUM_POSIX_MUTEXES ) + \
     420    CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES( \
     421        CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES ) + \
     422    CONFIGURE_MEMORY_FOR_POSIX_KEYS( CONFIGURE_MAXIMUM_POSIX_KEYS ) + \
     423    CONFIGURE_MEMORY_FOR_POSIX_QUEUED_SIGNALS( \
     424        CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS ) \
     425   )
     426
     427
     428#else
     429
     430#define CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API 0
     431#define CONFIGURE_MEMORY_FOR_POSIX              0
    384432
    385433#endif    /* RTEMS_POSIX_API */
     
    414462   ((sizeof(Thread_Control) + CONTEXT_FP_SIZE + \
    415463      STACK_MINIMUM_SIZE + sizeof( RTEMS_API_Control ) + \
     464      CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API + \
    416465      CONFIGURE_OBJECT_TABLE_STUFF)) \
    417466  )
     
    477526#ifndef CONFIGURE_MEMORY_OVERHEAD
    478527#define CONFIGURE_MEMORY_OVERHEAD 0
     528#endif
     529
     530#ifndef CONFIGURE_EXTRA_TASK_STACKS
     531#define CONFIGURE_EXTRA_TASK_STACKS 0
    479532#endif
    480533
     
    487540
    488541#define CONFIGURE_EXECUTIVE_RAM_SIZE \
    489 (( CONFIGURE_MEMORY_FOR_TASKS(CONFIGURE_MAXIMUM_TASKS) + \
     542(( CONFIGURE_MEMORY_FOR_POSIX + \
     543   CONFIGURE_MEMORY_FOR_TASKS(CONFIGURE_MAXIMUM_TASKS + \
     544      CONFIGURE_MAXIMUM_POSIX_THREADS + CONFIGURE_MAXIMUM_ADA_TASKS ) + \
    490545   CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS) + \
    491546   CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_MAXIMUM_SEMAPHORES + \
     
    504559   CONFIGURE_MEMORY_FOR_SYSTEM_OVEREHAD + \
    505560   (((CONFIGURE_MEMORY_OVERHEAD)+1) * 1024) \
     561   (((CONFIGURE_EXTRA_TASK_STACKS)+1) * 1024) \
    506562) & 0xfffffc00)
    507563#endif
     
    515571#define CONFIGURE_MAXIMUM_ADA_TASKS  20
    516572#endif
     573
     574/* This is the number of non-Ada tasks which invoked Ada code. */
     575#ifndef CONFIGURE_MAXIMUM_FAKE_ADA_TASKS
     576#define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0
     577#endif
     578
     579/* Ada tasks are allocated twice the minimum stack space */
     580#define CONFIGURE_ADA_TASKS_STACK \
     581  (CONFIGURE_MAXIMUM_ADA_TASKS * RTEMS_MINIMUM_STACK_SIZE)
    517582
    518583#else
     
    521586#define CONFIGURE_MAXIMUM_ADA_TASKS      0
    522587#define CONFIGURE_MAXIMUM_FAKE_ADA_TASKS 0
     588#define CONFIGURE_ADA_TASKS_STACK        0
    523589#endif
    524590
Note: See TracChangeset for help on using the changeset viewer.