mirror of
https://github.com/golang/go
synced 2024-11-19 15:24:46 -07:00
runtime: fix use of STREX in various exitThread implementations
STREX does not permit using the same register for the value to store and the place where the result is returned. Also the code was wrong anyhow if the first store failed. Fixes #22248 Change-Id: I96013497410058514ffcb771c76c86faa1ec559b Reviewed-on: https://go-review.googlesource.com/70911 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com>
This commit is contained in:
parent
001fe1d57a
commit
5ddd3d588c
@ -107,10 +107,10 @@ TEXT exit1<>(SB),NOSPLIT,$0
|
||||
TEXT runtime·exitThread(SB),NOSPLIT,$0-4
|
||||
MOVW wait+0(FP), R0
|
||||
// We're done using the stack.
|
||||
MOVW $0, R1
|
||||
MOVW $0, R2
|
||||
storeloop:
|
||||
LDREX (R0), R4 // loads R4
|
||||
STREX R1, (R0), R1 // stores R2
|
||||
STREX R2, (R0), R1 // stores R2
|
||||
CMP $0, R1
|
||||
BNE storeloop
|
||||
JMP exit1<>(SB)
|
||||
|
@ -86,10 +86,10 @@ TEXT runtime·exit(SB),NOSPLIT,$-8
|
||||
TEXT runtime·exitThread(SB),NOSPLIT,$0-4
|
||||
MOVW wait+0(FP), R0
|
||||
// We're done using the stack.
|
||||
MOVW $0, R1
|
||||
MOVW $0, R2
|
||||
storeloop:
|
||||
LDREX (R0), R4 // loads R4
|
||||
STREX R1, (R0), R1 // stores R2
|
||||
STREX R2, (R0), R1 // stores R2
|
||||
CMP $0, R1
|
||||
BNE storeloop
|
||||
MOVW $0, R0 // arg 1 long *state
|
||||
|
@ -22,10 +22,10 @@ TEXT runtime·exit(SB),NOSPLIT,$-4
|
||||
TEXT runtime·exitThread(SB),NOSPLIT,$0-4
|
||||
MOVW wait+0(FP), R0
|
||||
// We're done using the stack.
|
||||
MOVW $0, R1
|
||||
MOVW $0, R2
|
||||
storeloop:
|
||||
LDREX (R0), R4 // loads R4
|
||||
STREX R1, (R0), R1 // stores R2
|
||||
STREX R2, (R0), R1 // stores R2
|
||||
CMP $0, R1
|
||||
BNE storeloop
|
||||
SWI $0xa00136 // sys__lwp_exit
|
||||
|
@ -26,10 +26,10 @@ TEXT runtime·exit(SB),NOSPLIT,$-4
|
||||
TEXT runtime·exitThread(SB),NOSPLIT,$0-4
|
||||
MOVW wait+0(FP), R0
|
||||
// We're done using the stack.
|
||||
MOVW $0, R1
|
||||
MOVW $0, R2
|
||||
storeloop:
|
||||
LDREX (R0), R4 // loads R4
|
||||
STREX R1, (R0), R1 // stores R2
|
||||
STREX R2, (R0), R1 // stores R2
|
||||
CMP $0, R1
|
||||
BNE storeloop
|
||||
MOVW $0, R0 // arg 1 - notdead
|
||||
|
Loading…
Reference in New Issue
Block a user