atomic: clean up atomic_cmpxchg

This commit is contained in:
Michael Shaw 2024-03-19 00:15:28 -04:00
commit f482174458

View file

@ -9,10 +9,9 @@ atomic_cmpxchg:
lock cmpxchg %edx, (%rdi)
/* if ZF is set, the exchange was successful */
pushfq
popq %rax
andl $0x40, %eax
shrl $6, %eax
xorl $1, %eax
jnz nz
movq $0, %rax
ret
nz:
movq $1, %rax
ret