xtensa: save/restore scompare1 during context switch
Xtensa uses two instructions to perform atomic compare-and-set instruction: first the comparison register, then the actual instruction to do compare-and-set. There is a potential that context switching is performed before these two instructions. A restored context may have the wrong value in the comparison register. So we need to save and restore the comparison register during context switching. Fixes #21800 Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
parent
7a737a0084
commit
bf50aae693
3 changed files with 30 additions and 2 deletions
|
@ -110,6 +110,10 @@
|
|||
rsr.LCOUNT a0
|
||||
s32i a0, a1, BSA_LCOUNT_OFF
|
||||
#endif
|
||||
#if XCHAL_HAVE_S32C1I
|
||||
rsr.SCOMPARE1 a0
|
||||
s32i a0, a1, BSA_SCOMPARE1_OFF
|
||||
#endif
|
||||
.endm
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue