mirror of
https://github.com/apache/nuttx.git
synced 2026-05-21 13:13:08 +08:00
arch: enable ARCH_KERNEL_STACK support in protected builds
Expand ARCH_KERNEL_STACK configuration to support both BUILD_KERNEL and BUILD_PROTECTED modes. Change Kconfig dependency from "depends on BUILD_KERNEL" to "depends on BUILD_KERNEL || BUILD_PROTECTED". Update pthread_create.c to remove redundant BUILD_KERNEL check when allocating kernel stacks with CONFIG_ARCH_KERNEL_STACK enabled. Enables protected builds to use separate kernel and user stacks for processes. Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
+1
-1
@@ -907,7 +907,7 @@ endif # ARCH_STACK_DYNAMIC
|
||||
config ARCH_KERNEL_STACK
|
||||
bool "Kernel process stack"
|
||||
default LIBC_EXECFUNCS
|
||||
depends on BUILD_KERNEL
|
||||
depends on BUILD_KERNEL || BUILD_PROTECTED
|
||||
---help---
|
||||
It this option is selected, then every user process will have two
|
||||
stacks: A large, potentially dynamically sized user stack and small
|
||||
|
||||
@@ -273,8 +273,7 @@ int nx_pthread_create(pthread_trampoline_t trampoline, FAR pthread_t *thread,
|
||||
goto errout_with_tcb;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_ARCH_ADDRENV) && \
|
||||
defined(CONFIG_BUILD_KERNEL) && defined(CONFIG_ARCH_KERNEL_STACK)
|
||||
#if defined(CONFIG_ARCH_ADDRENV) && defined(CONFIG_ARCH_KERNEL_STACK)
|
||||
/* Allocate the kernel stack */
|
||||
|
||||
ret = up_addrenv_kstackalloc(ptcb);
|
||||
|
||||
Reference in New Issue
Block a user