Ticket #586: confdef.diff

File confdef.diff, 3.1 KB (added by Joel Sherrill, on Dec 3, 2006 at 1:31:13 PM)

confdef.diff

  • cpukit/sapi/include/confdefs.h

    RCS file: /usr1/CVS/rtems/cpukit/sapi/include/confdefs.h,v
    retrieving revision 1.55.2.1
    diff -u -r1.55.2.1 confdefs.h
     
    4444 * Include the executive's configuration
    4545 */
    4646#include <rtems/score/cpuopts.h>
     47#include <rtems/score/apimutex.h>
    4748
    4849extern rtems_initialization_tasks_table Initialization_tasks[];
    4950extern rtems_driver_address_table       Device_drivers[];
     
    472473
    473474#include <sys/types.h>
    474475#include <signal.h>
     476#include <limits.h>
    475477#include <mqueue.h>
    476478#include <rtems/posix/cond.h>
    477479#include <rtems/posix/mqueue.h>
     
    562564
    563565#define CONFIGURE_MEMORY_FOR_POSIX_MUTEXES(_mutexes) \
    564566  ((_mutexes) * \
    565    ( sizeof(POSIX_Mutex_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
     567   ( sizeof(POSIX_Mutex_Control) + CONFIGURE_OBJECT_TABLE_STUFF + \
     568     NAME_MAX ) )
    566569
    567570#define CONFIGURE_MEMORY_FOR_POSIX_CONDITION_VARIABLES(_condition_variables) \
    568571  ((_condition_variables) * \
     
    583586
    584587#define CONFIGURE_MEMORY_FOR_POSIX_MESSAGE_QUEUES(_message_queues) \
    585588  ((_message_queues) * \
    586    ( sizeof( POSIX_Message_queue_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
     589   ( sizeof( POSIX_Message_queue_Control) + \
     590    CONFIGURE_OBJECT_TABLE_STUFF + \
     591    NAME_MAX ) )
    587592#define CONFIGURE_MEMORY_FOR_POSIX_SEMAPHORES(_semaphores) \
    588593  ((_semaphores) * \
    589    ( sizeof( POSIX_Semaphore_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) )
    590  
     594   ( sizeof( POSIX_Semaphore_Control) + \
     595    CONFIGURE_OBJECT_TABLE_STUFF + \
     596    NAME_MAX ) )
    591597
    592598#define CONFIGURE_MEMORY_FOR_POSIX \
    593599  ( \
     
    805811#define CONFIGURE_OBJECT_TABLE_STUFF \
    806812  ( sizeof(Objects_Control *) + sizeof(rtems_name *) + sizeof(rtems_name) )
    807813
     814#if defined(RTEMS_NEWLIB)
     815#include <reent.h>
     816
     817#define CONFIGURE_MEMORY_PER_TASK_FOR_LIBC_REENTRANCY sizeof(struct _reent)
     818#else
     819#define CONFIGURE_MEMORY_PER_TASK_FOR_LIBC_REENTRANCY 0
     820#endif
     821
    808822#define CONFIGURE_MEMORY_FOR_TASKS(_tasks) \
    809823  (((_tasks) + 1 ) * \
    810824   ((sizeof(Thread_Control) + CONTEXT_FP_SIZE + \
    811825      STACK_MINIMUM_SIZE + sizeof( RTEMS_API_Control ) + \
    812826      CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API + \
    813827      CONFIGURE_MEMORY_PER_TASK_FOR_ITRON_API + \
     828      CONFIGURE_MEMORY_PER_TASK_FOR_LIBC_REENTRANCY + \
    814829      CONFIGURE_OBJECT_TABLE_STUFF)) \
    815830  )
    816831
     
    880895#define CONFIGURE_EXTRA_TASK_STACKS 0
    881896#endif
    882897
     898#define CONFIGURE_API_MUTEX_MEMORY \
     899  ( (1) * \
     900    ( sizeof(API_Mutex_Control) + CONFIGURE_OBJECT_TABLE_STUFF ) \
     901  )
     902
    883903#define CONFIGURE_MEMORY_FOR_SYSTEM_OVERHEAD \
    884904  ( CONFIGURE_MEMORY_FOR_TASKS(1) +    /* IDLE */ \
    885905    (256 * 12) +                       /* Ready chains */ \
    886906    256        +                       /* name/ptr table overhead */ \
    887     CONFIGURE_INTERRUPT_STACK_MEMORY   /* interrupt stack */ \
     907    CONFIGURE_INTERRUPT_STACK_MEMORY + /* interrupt stack */ \
     908    CONFIGURE_API_MUTEX_MEMORY         /* allocation mutex */ \
    888909  )
    889910
    890911/*