arch: arm64: Enable stack guard for v8R
Enable stack guard for v8R which is backed by MPU. Signed-off-by: Jaxson Han <jaxson.han@arm.com>
This commit is contained in:
parent
5878898328
commit
0928830409
3 changed files with 6 additions and 1 deletions
|
@ -23,6 +23,7 @@ config CPU_AARCH64_CORTEX_R
|
|||
select HAS_FLASH_LOAD_OFFSET
|
||||
select CPU_HAS_DCACHE
|
||||
select CPU_HAS_ICACHE
|
||||
select ARCH_HAS_STACK_PROTECTION
|
||||
select CPU_HAS_FPU
|
||||
imply FPU
|
||||
imply FPU_SHARING
|
||||
|
|
|
@ -115,7 +115,7 @@ SECTION_FUNC(TEXT, z_arm64_context_switch)
|
|||
str x2, [x4, #_cpu_offset_to_current_stack_limit]
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_USERSPACE
|
||||
#if defined(CONFIG_USERSPACE) || defined(CONFIG_ARM64_STACK_PROTECTION)
|
||||
str lr, [sp, #-16]!
|
||||
bl z_arm64_swap_mem_domains
|
||||
ldr lr, [sp], #16
|
||||
|
|
|
@ -145,6 +145,10 @@ void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
|
|||
thread->callee_saved.lr = (uint64_t)z_arm64_exit_exc;
|
||||
|
||||
thread->switch_handle = thread;
|
||||
#if defined(CONFIG_ARM64_STACK_PROTECTION)
|
||||
thread->arch.stack_limit = (uint64_t)stack + Z_ARM64_STACK_GUARD_SIZE;
|
||||
z_arm64_thread_mem_domains_init(thread);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef CONFIG_USERSPACE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue