xtensa: mask interrupts earlier
When coming out of an exception, we need to mask interrupts to avoid races when decrementing the nested count. Move the instruction that does this earlier. Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
f38e27603d
commit
dafd3485bf
1 changed files with 7 additions and 5 deletions
|
@ -291,6 +291,12 @@ _switch_stacks_\@:
|
||||||
_do_call_\@:
|
_do_call_\@:
|
||||||
CROSS_STACK_CALL
|
CROSS_STACK_CALL
|
||||||
|
|
||||||
|
/* Mask interrupts (which have been unmasked during the handler
|
||||||
|
* execution) while we muck with the windows and decrement the nested
|
||||||
|
* count. The restore will unmask them correctly.
|
||||||
|
*/
|
||||||
|
rsil a0, XCHAL_NMILEVEL
|
||||||
|
|
||||||
/* Decrement nest count */
|
/* Decrement nest count */
|
||||||
rsr.\SR a3
|
rsr.\SR a3
|
||||||
l32i a0, a3, \NEST_OFF
|
l32i a0, a3, \NEST_OFF
|
||||||
|
@ -303,13 +309,9 @@ _do_call_\@:
|
||||||
* register spill before restoring, for obvious reasons.
|
* register spill before restoring, for obvious reasons.
|
||||||
* Remember to restore the A1 stack pointer as it existed at
|
* Remember to restore the A1 stack pointer as it existed at
|
||||||
* interrupt time so the caller of the interrupted function
|
* interrupt time so the caller of the interrupted function
|
||||||
* spills to the right place. Also mask interrupts (which
|
* spills to the right place.
|
||||||
* have been unmasked during the handler execution) while we
|
|
||||||
* muck with the windows. The restore will unmask them
|
|
||||||
* correctly.
|
|
||||||
*/
|
*/
|
||||||
beq a6, a1, _restore_\@
|
beq a6, a1, _restore_\@
|
||||||
rsil a0, XCHAL_NMILEVEL
|
|
||||||
l32i a1, a1, 0
|
l32i a1, a1, 0
|
||||||
addi a1, a1, BASE_SAVE_AREA_SIZE
|
addi a1, a1, BASE_SAVE_AREA_SIZE
|
||||||
SPILL_ALL_WINDOWS
|
SPILL_ALL_WINDOWS
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue