2009-01-05 Joel Sherrill <joel.sherrill@OARcorp.com>

PR 1351/cpukit
	* sapi/include/confdefs.h: Mask off unlimited object bit before using
	configured number in calculations.
This commit is contained in:
Joel Sherrill
2009-01-05 20:15:51 +00:00
parent eb63fa523d
commit 8b6a056056
2 changed files with 20 additions and 4 deletions

View File

@@ -1,3 +1,9 @@
2009-01-05 Joel Sherrill <joel.sherrill@OARcorp.com>
PR 1351/cpukit
* sapi/include/confdefs.h: Mask off unlimited object bit before using
configured number in calculations.
2009-01-02 Ralf Corsépius <ralf.corsepius@rtems.org> 2009-01-02 Ralf Corsépius <ralf.corsepius@rtems.org>
* posix/include/aio.h, posix/src/aio_suspend.c: Make aio_suspend() * posix/include/aio.h, posix/src/aio_suspend.c: Make aio_suspend()

View File

@@ -377,6 +377,13 @@ extern rtems_configuration_table Configuration;
#define _Configure_From_workspace(_size) \ #define _Configure_From_workspace(_size) \
((_size) + (2 * sizeof(uint32_t)) + CPU_ALIGNMENT) ((_size) + (2 * sizeof(uint32_t)) + CPU_ALIGNMENT)
/**
* Do not use the unlimited bit as part of the multiplication
* for memory usage.
*/
#define _Configure_Max_Objects(_max) \
((_max) & ~RTEMS_UNLIMITED_OBJECTS)
/** /**
* This macro accounts for how memory for a set of configured objects is * This macro accounts for how memory for a set of configured objects is
* allocated from the Executive Workspace. * allocated from the Executive Workspace.
@@ -385,9 +392,9 @@ extern rtems_configuration_table Configuration;
* objects. * objects.
*/ */
#define _Configure_Object_RAM(_number, _size) \ #define _Configure_Object_RAM(_number, _size) \
( _Configure_From_workspace((_number) * (_size)) + \ ( _Configure_From_workspace(_Configure_Max_Objects(_number) * (_size)) + \
_Configure_From_workspace( \ _Configure_From_workspace( \
(((_number) + 1) * sizeof(Objects_Control *)) + \ ((_Configure_Max_Objects(_number) + 1) * sizeof(Objects_Control *)) + \
(sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) \ (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) \
) \ ) \
) )
@@ -1334,13 +1341,14 @@ extern rtems_configuration_table Configuration;
#define CONFIGURE_MEMORY_FOR_TASKS(_tasks, _number_FP_tasks) \ #define CONFIGURE_MEMORY_FOR_TASKS(_tasks, _number_FP_tasks) \
( \ ( \
_Configure_Object_RAM(_tasks, sizeof(Thread_Control)) + \ _Configure_Object_RAM(_tasks, sizeof(Thread_Control)) + \
((_tasks) * \ (_Configure_Max_Objects(_tasks) * \
(_Configure_From_workspace(CONFIGURE_MINIMUM_TASK_STACK_SIZE) + \ (_Configure_From_workspace(CONFIGURE_MINIMUM_TASK_STACK_SIZE) + \
_Configure_From_workspace(CONFIGURE_MEMORY_PER_TASK_FOR_CLASSIC_API) + \ _Configure_From_workspace(CONFIGURE_MEMORY_PER_TASK_FOR_CLASSIC_API) + \
CONFIGURE_MEMORY_PER_TASK_FOR_NEWLIB + \ CONFIGURE_MEMORY_PER_TASK_FOR_NEWLIB + \
CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API + \ CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_API + \
CONFIGURE_MEMORY_PER_TASK_FOR_ITRON_API)) + \ CONFIGURE_MEMORY_PER_TASK_FOR_ITRON_API)) + \
_Configure_From_workspace((_number_FP_tasks) * CONTEXT_FP_SIZE) \ _Configure_From_workspace( \
_Configure_Max_Objects(_number_FP_tasks) * CONTEXT_FP_SIZE) \
) )
/** /**
@@ -1574,6 +1582,7 @@ extern rtems_configuration_table Configuration;
uint32_t MEMORY_FOR_IDLE_TASK; uint32_t MEMORY_FOR_IDLE_TASK;
/* Classic API Pieces */ /* Classic API Pieces */
uint32_t CLASSIC_TASKS;
uint32_t TASK_VARIABLES; uint32_t TASK_VARIABLES;
uint32_t TIMERS; uint32_t TIMERS;
uint32_t SEMAPHORES; uint32_t SEMAPHORES;
@@ -1627,6 +1636,7 @@ extern rtems_configuration_table Configuration;
CONFIGURE_MEMORY_FOR_IDLE_TASK, CONFIGURE_MEMORY_FOR_IDLE_TASK,
/* Classic API Pieces */ /* Classic API Pieces */
CONFIGURE_MEMORY_FOR_TASKS(CONFIGURE_MAXIMUM_TASKS, 0),
CONFIGURE_MEMORY_FOR_TASK_VARIABLES(CONFIGURE_MAXIMUM_TASK_VARIABLES), CONFIGURE_MEMORY_FOR_TASK_VARIABLES(CONFIGURE_MAXIMUM_TASK_VARIABLES),
CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS), CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS),
CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_MAXIMUM_SEMAPHORES + CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_MAXIMUM_SEMAPHORES +