diff options
author | Joel Sherrill <joel@rtems.org> | 2021-10-07 17:28:26 -0500 |
---|---|---|
committer | Joel Sherrill <joel@rtems.org> | 2021-10-11 08:42:25 -0500 |
commit | 822ebb4cae2bb8bc9fe55915bd4acc4942fcd8ce (patch) | |
tree | d8b9f10c2f96ca59e190964557f8ab3b0c50af2a /cpukit/score/src/threadcreateidle.c | |
parent | score: _Thread_queue_Surrender_priority_ceiling() (diff) | |
download | rtems-822ebb4cae2bb8bc9fe55915bd4acc4942fcd8ce.tar.bz2 |
Add support for IDLE Thread stack allocator
Add a stack allocator hook specifically for allocation of IDLE thread stacks.
This allows the user to decide if IDLE thread stacks are statically allocated
or handled by the same custom allocator mechanism as other thread stacks.
Closes #4524.
Diffstat (limited to '')
-rw-r--r-- | cpukit/score/src/threadcreateidle.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/cpukit/score/src/threadcreateidle.c b/cpukit/score/src/threadcreateidle.c index f5ffc9bad8..86e117e70f 100644 --- a/cpukit/score/src/threadcreateidle.c +++ b/cpukit/score/src/threadcreateidle.c @@ -49,9 +49,15 @@ static void _Thread_Create_idle_for_CPU( Per_CPU_Control *cpu ) config.is_preemptible = true; config.stack_size = _Thread_Idle_stack_size + CPU_IDLE_TASK_IS_FP * CONTEXT_FP_SIZE; - config.stack_area = &_Thread_Idle_stacks[ - _Per_CPU_Get_index( cpu ) * config.stack_size - ]; + + /* + * The IDLE thread stacks may be statically allocated or there may be a + * custom allocator provided just as with user threads. + */ + config.stack_area = (*_Stack_Allocator_allocate_for_idle)( + _Per_CPU_Get_index( cpu ), + config.stack_size + ); /* * The entire workspace is zeroed during its initialization. Thus, all |