diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-01-05 20:15:51 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-01-05 20:15:51 +0000 |
commit | 8b6a0560564a03f05bbe90f94210795461f0a14f (patch) | |
tree | c383d9f363c4bf2612f1e3a55243512b1c60a575 /cpukit/sapi | |
parent | 2009-01-02 Ralf Corsépius <ralf.corsepius@rtems.org> (diff) | |
download | rtems-8b6a0560564a03f05bbe90f94210795461f0a14f.tar.bz2 |
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.
Diffstat (limited to 'cpukit/sapi')
-rw-r--r-- | cpukit/sapi/include/confdefs.h | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/cpukit/sapi/include/confdefs.h b/cpukit/sapi/include/confdefs.h index 4881ec2221..cfb1facc89 100644 --- a/cpukit/sapi/include/confdefs.h +++ b/cpukit/sapi/include/confdefs.h @@ -378,6 +378,13 @@ extern rtems_configuration_table Configuration; ((_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 * allocated from the Executive Workspace. * @@ -385,9 +392,9 @@ extern rtems_configuration_table Configuration; * objects. */ #define _Configure_Object_RAM(_number, _size) \ - ( _Configure_From_workspace((_number) * (_size)) + \ + ( _Configure_From_workspace(_Configure_Max_Objects(_number) * (_size)) + \ _Configure_From_workspace( \ - (((_number) + 1) * sizeof(Objects_Control *)) + \ + ((_Configure_Max_Objects(_number) + 1) * sizeof(Objects_Control *)) + \ (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) \ ( \ _Configure_Object_RAM(_tasks, sizeof(Thread_Control)) + \ - ((_tasks) * \ + (_Configure_Max_Objects(_tasks) * \ (_Configure_From_workspace(CONFIGURE_MINIMUM_TASK_STACK_SIZE) + \ _Configure_From_workspace(CONFIGURE_MEMORY_PER_TASK_FOR_CLASSIC_API) + \ CONFIGURE_MEMORY_PER_TASK_FOR_NEWLIB + \ CONFIGURE_MEMORY_PER_TASK_FOR_POSIX_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; /* Classic API Pieces */ + uint32_t CLASSIC_TASKS; uint32_t TASK_VARIABLES; uint32_t TIMERS; uint32_t SEMAPHORES; @@ -1627,6 +1636,7 @@ extern rtems_configuration_table Configuration; CONFIGURE_MEMORY_FOR_IDLE_TASK, /* Classic API Pieces */ + CONFIGURE_MEMORY_FOR_TASKS(CONFIGURE_MAXIMUM_TASKS, 0), CONFIGURE_MEMORY_FOR_TASK_VARIABLES(CONFIGURE_MAXIMUM_TASK_VARIABLES), CONFIGURE_MEMORY_FOR_TIMERS(CONFIGURE_MAXIMUM_TIMERS), CONFIGURE_MEMORY_FOR_SEMAPHORES(CONFIGURE_MAXIMUM_SEMAPHORES + |