mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-17 23:28:15 +00:00
core: fix cases where riscv SP were not 16 byte aligned
RISC-V stack pointer should always be 16 byte aligned, but for some cases where we were doing manual SP manipulation this was not always the case.
This commit is contained in:
@@ -24,8 +24,9 @@ esp_shared_stack_invoke_function:
|
||||
/* Set shared stack as new stack pointer */
|
||||
mv sp, a1
|
||||
|
||||
/* store the ra and previous stack pointer in a safe place */
|
||||
addi sp,sp,-4
|
||||
/* store the ra and previous stack pointer in a safe place
|
||||
stack pointer for riscv should always be 16 byte aligned */
|
||||
addi sp,sp,-16
|
||||
sw t0, 0(sp)
|
||||
sw t1, 4(sp)
|
||||
|
||||
@@ -35,7 +36,7 @@ esp_shared_stack_invoke_function:
|
||||
/* gets the ra and stack pointer saved previously */
|
||||
lw t0, 0(sp)
|
||||
lw t1, 4(sp)
|
||||
addi sp, sp, 4
|
||||
addi sp, sp, 16
|
||||
|
||||
/* restore both ra and real stack pointer of current task */
|
||||
mv ra, t1
|
||||
|
Reference in New Issue
Block a user