xtensa: use CONFIG_PRIVILEGED_STACK_SIZE for stack size

Instead of using CONFIG_MMU_PAGE_SIZE for size of the privileged
stack, use the actual kconfig CONFIG_PRIVILEGED_STACK_SIZE.
This allows for changing the size of privileged stack, and
also aligns to the usage of CONFIG_PRIVILEGED_STACK_SIZE.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
Daniel Leung 2024-03-04 11:32:42 -08:00 committed by Henrik Brix Andersen
commit 3fa291690f
3 changed files with 10 additions and 1 deletions

View file

@ -206,6 +206,10 @@ config XTENSA_MMU_DOUBLE_MAP
This invalidates all TLBs referred by the incoming thread's
memory domain when swapping page tables.
config PRIVILEGED_STACK_SIZE
# Must be multiple of CONFIG_MMU_PAGE_SIZE
default 4096
endif # XTENSA_MMU
config XTENSA_SYSCALL_USE_HELPER

View file

@ -9,6 +9,11 @@
#include <xtensa_mmu_priv.h>
#include <zephyr/cache.h>
#ifdef CONFIG_USERSPACE
BUILD_ASSERT((CONFIG_PRIVILEGED_STACK_SIZE > 0) &&
(CONFIG_PRIVILEGED_STACK_SIZE % CONFIG_MMU_PAGE_SIZE) == 0);
#endif
#define ASID_INVALID 0
struct tlb_regs {

View file

@ -47,7 +47,7 @@
/* thread stack */
#ifdef CONFIG_XTENSA_MMU
struct xtensa_thread_stack_header {
char privilege_stack[CONFIG_MMU_PAGE_SIZE];
char privilege_stack[CONFIG_PRIVILEGED_STACK_SIZE];
} __packed __aligned(XTENSA_STACK_BASE_ALIGN);
#define ARCH_THREAD_STACK_RESERVED \