[Bug 1924] New: Enhanced stack allocator configuration
bugzilla-daemon at rtems.org
bugzilla-daemon at rtems.org
Fri Sep 30 09:28:08 UTC 2011
https://www.rtems.org/bugzilla/show_bug.cgi?id=1924
Summary: Enhanced stack allocator configuration
Product: RTEMS
Version: HEAD
Platform: All
OS/Version: RTEMS
Status: NEW
Severity: normal
Priority: P3
Component: cpukit
AssignedTo: joel.sherrill at oarcorp.com
ReportedBy: sebastian.huber at embedded-brains.de
The RTEMS application configuration may provide a special task stack allocator:
http://rtems.org/onlinedocs/doc-current/share/rtems/html/c_user/c_user00419.html
CONFIGURE_TASK_STACK_ALLOCATOR may point to a user provided routine to allocate
task stacks. The default value for this field is NULL which indicates that task
stacks will be allocated from the RTEMS Workspace.
CONFIGURE_TASK_STACK_DEALLOCATOR may point to a user provided routine to free
task stacks. The default value for this field is NULL which indicates that task
stacks will be allocated from the RTEMS Workspace.
The current structure has two problems:
A) There is no standard way to initialize the allocator
B) The task stack area size is unknown to the allocator and the stack area size
is accounted in the work space size estimate (thus the work space is larger
than necessary).
To address problem A we should add an optional initialization function:
CONFIGURE_TASK_STACK_ALLOCATOR_INIT may point to a user provided routine to
initialize the task stack allocator. The default value for this field is NULL
which indicates that task stacks will be allocated from the RTEMS Workspace.
The prototype should be:
void (*stack_allocator_init_hook)(uintptr_t stack_area_size);
The function should be called right before _Thread_Create_idle() in
rtems_initialize_data_structures().
To address problem B we should add an additional field to the Configuration:
typedef struct {
void *work_space_start;
uintptr_t work_space_size;
uintptr_t stack_space_size;
[...]
void (*stack_allocator_init_hook)( uintptr_t );
void * (*stack_allocate_hook)( size_t );
void (*stack_free_hook)( void *);
[...]
} rtems_configuration_table;
The confdefs.h must be modified to separate the stack area estimate from the
overall work space estimate. In case no stack allocator is configured the work
space size is increased by the stack space size.
--
Configure bugmail: https://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.
More information about the bugs
mailing list