Question about task stack allocation

Joel Sherrill joel.sherrill at OARcorp.com
Wed Dec 17 17:24:01 UTC 2003


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
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
> 
> 





More information about the users mailing list