Please sign in to comment.
arch: arm: switching stack pointer with assembly code
With -O0 optimizion, gcc compiler doesn't inline "static inline" marked function. So when function call return from function set_and_switch_to_psp which is to switch sp from MSP to PSP, the ending "mov sp, r7" instruction will overwrite the just updated sp value(PSP) with the beginning stack pointer(should be MSP) stored in r7 register, so the switch doesn't happen. And it causes unpredictable problems in the initialization process, the backward analysis for this problem can be found on Github issue #15794. Fixes: #15794. Signed-off-by: Wentong Wu <firstname.lastname@example.org>
- Loading branch information...
Showing with 37 additions and 48 deletions.