kernel: thread: Allow stack in coherent memory

When allowing dynamic thread stack allocation the stack may come from
the heap in coherent memory, trying to use cached memory is over
complicated because of heap meta data and cache line sizes.
Also when userspace is enabled, stacks have to be page aligned and the
address of the stack is used to track kernel objects.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2024-02-06 17:02:27 +00:00 committed by Anas Nashif
commit d622533ca7

View file

@ -641,7 +641,14 @@ char *z_setup_new_thread(struct k_thread *new_thread,
* still cached!
*/
__ASSERT_NO_MSG(arch_mem_coherent(new_thread));
/* When dynamic thread stack is available, the stack may come from
* uncached area.
*/
#ifndef CONFIG_DYNAMIC_THREAD
__ASSERT_NO_MSG(!arch_mem_coherent(stack));
#endif /* CONFIG_DYNAMIC_THREAD */
#endif
arch_new_thread(new_thread, stack, stack_ptr, entry, p1, p2, p3);