CONFIGURE_MINIMUM_TASK_STACK_SIZE

Chris Johns chrisj at rtems.org
Wed Dec 7 22:01:42 UTC 2011


On 8/12/11 8:52 AM, Joel Sherrill wrote:
> On 12/07/2011 03:48 PM, Chris Johns wrote:
>> On 8/12/11 5:39 AM, Gedare Bloom wrote:
>>> CONFIGURE_MINIMUM_TASK_STACK_SIZE can be defined by an application to
>>> increase the size of all of its task stacks (and implicitly the init
>>> task and interrupt stacks). It seems wrong/wasteful to propagate the
>>> user-defined CONFIGURE_MINIMUM_TASK_STACK_SIZE to both the idle and
>>> interrupt stacks, perhaps these should be CPU_STACK_MINIMUM_SIZE
>>> unless defined by the user explicitly?
>>>
>> What does a minimum stack size mean ?
>>
>> I have always assumed this setting provides enough stack so the tests
>> could run across a number of platforms. I do not use it in any
>> applications I develop.
> It is more of a "enough to run hello" type of definition. If you
> have less than this, then you are likely in trouble. Many tests
> do 2-3 times minimum for their task stacks.
>> Yes it would seem to be wasteful for idle. The init task is tricky
>> because static constructors run on it.
> Nope. Static constructors run in the first init task.

Do you mean the BSP context before multi-tasking and after RTEMS has 
initialised ?

>> If you use the BSP init code in
>> bsp/shared where your entry point is main the network stack maybe
>> started. There is also the implicit stack in the BSP context that starts
>> RTEMS. These all require the user's involvement to make sure they are
>> big enough.
> The stack the BSP starts on is very special and has to be
> established outside RTEMS. We can't do much about that
> at this level.

Is this the first init stack ?

>
> With that said, many BSPs specify where this stack is in
> the linker script and have a variable like StackSize that
> you can -D on the ld command to increase.
>

At the risk of polluting the thread ...

I have to ask about using linker scripts this way. I tend to find they 
can get abused and over complicate things, eg some bsps has flags in 
bsp_spec files. What do we gain over just setting values in C code and 
using -D on the cc ?

> Your network example would impact the init task.

Which one ?

Chris



More information about the devel mailing list