bcm64: fix kernels cmpswap() function
spectacular bug. cmpswap() had a sign extension bug using sign extending MOV to load the old compare value and LDXRW using zero extension while the CMP instruction compared 64 bit registers. this caused cmpswap with negative old value always to fail. interestingly, libc's version of this function was fine.
This commit is contained in:
parent
7de7414e88
commit
04066fe973
1 changed files with 2 additions and 2 deletions
|
@ -229,8 +229,8 @@ TEXT touser(SB), 1, $-4
|
|||
|
||||
TEXT cas(SB), 1, $-4
|
||||
TEXT cmpswap(SB), 1, $-4
|
||||
MOVW ov+8(FP), R1
|
||||
MOVW nv+16(FP), R2
|
||||
MOVWU ov+8(FP), R1
|
||||
MOVWU nv+16(FP), R2
|
||||
_cas1:
|
||||
LDXRW (R0), R3
|
||||
CMP R3, R1
|
||||
|
|
Loading…
Reference in a new issue