Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
arch: riscv: stacktrace: fix user thread stack bound check
According to the riscv's `arch.h`: +------------+ <- thread.arch.priv_stack_start | Guard | } Z_RISCV_STACK_GUARD_SIZE +------------+ | Priv Stack | } CONFIG_PRIVILEGED_STACK_SIZE +------------+ <- thread.arch.priv_stack_start + CONFIG_PRIVILEGED_STACK_SIZE + Z_RISCV_STACK_GUARD_SIZE The start of the privilege stack should be: `thread.arch.priv_stack_start + Z_RISCV_STACK_GUARD_SIZE` Instead of `thread.arch.priv_stack_start - CONFIG_PRIVILEGED_STACK_SIZE` For the `end`, use the same equation of `top_of_priv_stack` in the `arch_user_mode_enter()` Signed-off-by: Yong Cong Sin <ycsin@meta.com> (cherry picked from commit 7db18ab)
- Loading branch information