rbheap memory protection

Sebastian Huber sebastian.huber at embedded-brains.de
Wed May 9 15:15:44 UTC 2012

On 05/09/2012 05:03 PM, Hesham Moustafa wrote:
>   * The red-black tree heap provides a memory allocator suitable to implement
>   * the malloc() and free() interface.  It uses a first-fit allocation strategy.
>   * In the red-black tree heap the administration data structures are not
>   * contained in the managed memory area.  Thus writing beyond the boundaries of
>   * a chunk does not damage the data to maintain the heap.  This can be used for
>   * example in a task stack allocator which protects the task stacks from access
>   * by other tasks.  The allocated and free memory parts of the managed area are
>   * called chunks.  Each chunk needs a descriptor which is stored outside of the
>   * managed area.
>   The comment (which is in the rbheap.h file )indicated that we can use rbheap
> as a task stack allocator and protect each  task stacks from access by other
> tasks. I guessed that memory protection attributes would exist
> in rtems_rbheap_chunk struct ,
> but i did not found anything related to memory protection so far. So my
> question how rbheap could be used to allocate stacks for tasks that one task
> can not corrupt other task stack ?

The red-black heap is only a special heap.  It can be used to allocate task 
stacks.  The actual protection via MMU, MPU or what ever is done elsewhere. 
For example each task may have only access to its own task stack.  A task 
switch will change the view to the current task stack.

Sebastian Huber, embedded brains GmbH

Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone   : +49 89 18 90 80 79-6
Fax     : +49 89 18 90 80 79-9
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.

More information about the devel mailing list