diff options
author | Joel Sherrill <joel@rtems.org> | 2021-10-01 14:56:34 -0500 |
---|---|---|
committer | Joel Sherrill <joel@rtems.org> | 2021-10-07 10:31:38 -0500 |
commit | c8a10609883c67629ea029be617a42b75d168f0f (patch) | |
tree | 77fb5ef6d9a04763840be4a205516d5fb542d6e4 /cpukit/score/src/threadcreateidle.c | |
parent | powerpc/motorola_powerpc: Map LibBSD bus space to the PCI base address (diff) | |
download | rtems-c8a10609883c67629ea029be617a42b75d168f0f.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 #4520.
Diffstat (limited to 'cpukit/score/src/threadcreateidle.c')
-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 1e18ad07cc..e888aa111f 100644 --- a/cpukit/score/src/threadcreateidle.c +++ b/cpukit/score/src/threadcreateidle.c @@ -53,9 +53,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 |