diff options
| author | Man, Jianting (Meco) <[email protected]> | 2023-02-25 13:52:37 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-02-25 13:52:37 -0500 |
| commit | 1acef4277b02e5084310ecd7028656ae535178f5 (patch) | |
| tree | 03b6b6f0b3df75a1cef301e1e7b2b3d234213390 /components/lwp/arch/risc-v/rv64/lwp_gcc.S | |
| parent | 759192f5f5af23ae360818483d35974ef5b91c78 (diff) | |
| parent | e63e33a3c64327aef3556fa811df0a8ec1e0e7ee (diff) | |
Merge pull request #6981 from RT-Thread/masterserialX-dev
sync from master
Diffstat (limited to 'components/lwp/arch/risc-v/rv64/lwp_gcc.S')
| -rw-r--r-- | components/lwp/arch/risc-v/rv64/lwp_gcc.S | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/components/lwp/arch/risc-v/rv64/lwp_gcc.S b/components/lwp/arch/risc-v/rv64/lwp_gcc.S index c54726bc45..3977553dbf 100644 --- a/components/lwp/arch/risc-v/rv64/lwp_gcc.S +++ b/components/lwp/arch/risc-v/rv64/lwp_gcc.S @@ -121,6 +121,16 @@ arch_signal_quit: * routine in user stack */ user_do_signal: + /* prefetch ustack to avoid corrupted status in RESTORE/STORE pair below */ + LOAD t0, FRAME_OFF_SP(sp) + addi t1, t0, -CTX_REG_NR * REGBYTES + LOAD t2, (t0) + li t3, -0x1000 +1: + add t0, t0, t3 + LOAD t2, (t0) + bgt t0, t1, 1b + /** restore and backup kernel sp carefully to avoid leaking */ addi t0, sp, CTX_REG_NR * REGBYTES csrw sscratch, t0 |
