mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
riscv/trap: fix sp restore logic
This fixes stack pointer restore logic to avoid parent stack corruption by forked child in PROTECTED build. Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
This commit is contained in:
parent
11ddd00470
commit
2fa7b9cc34
1 changed files with 4 additions and 0 deletions
|
|
@ -231,7 +231,11 @@ return_from_exception:
|
|||
|
||||
load_ctx sp
|
||||
|
||||
#ifdef CONFIG_ARCH_KERNEL_STACK
|
||||
REGLOAD sp, REG_SP(sp) /* restore original sp */
|
||||
#else
|
||||
addi sp, sp, XCPTCONTEXT_SIZE
|
||||
#endif
|
||||
|
||||
/* Return from exception */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue