Question about task stack allocation
Joel Sherrill
joel.sherrill at OARcorp.com
Thu Dec 18 15:49:01 UTC 2003
Scott J wrote:
> ------ 'Joel Sherrill' said the following on 2003-12-18 1:24 ------:
>
>> mikeci at acm.org wrote:
>>
>>>> Just read _Thread_Stack_Allocate(), I think maybe 'stack_allocate_hook'
>>>> in 'CPU Table' could help. For example you can configure
>>>> 'stack_allocate_hook' as 'malloc' so task stacks always allocated in
>>>> CRTL.
>>
>>
>>
>> In theory, but I think that the stack_allocate_hook is called from
>> a critical seciton which does not allow malloc() to be called. The
>
>
> Ahhh..yes I forgot that. So what about rtems partition? Is it safe to be
> called in critical section?
Unfortunately no. You will have to just use the RTEMS Chain handler
(chain.h) and manage it yourself.
>> general idea was to have a pre-allocated pool of task stacks and
>> you manage them in a more simple fashion. The original application
>> that used this ended up using an MMU and page management so tasks
>> that over or under ran their stack would get a fault.
>>
>>> Hi!
>>>
>>> I would like to allocate task stack for one task only. If I use
>>> stack_allocate_hook, this hook is for all tasks, right?
>>
>>
>>
>> Yes.
>>
>>> Regards
>>>
>>> Ivica
>>>
>>>
>>
>>
>>
>>
>
>
--
Joel Sherrill, Ph.D. Director of Research & Development
joel at OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985
More information about the users
mailing list