diff options
author | jake <jake@FreeBSD.org> | 2002-03-13 03:28:47 +0000 |
---|---|---|
committer | jake <jake@FreeBSD.org> | 2002-03-13 03:28:47 +0000 |
commit | 6ee80641df5b29b2e23004a1625d7a5cdb706110 (patch) | |
tree | 780df0e3e82efd0959942a12aee65faa687087d4 /sys/sparc64 | |
parent | 3e90296a6be161d9ebd2a8bd9c3ca934d8a09c50 (diff) | |
download | FreeBSD-src-6ee80641df5b29b2e23004a1625d7a5cdb706110.zip FreeBSD-src-6ee80641df5b29b2e23004a1625d7a5cdb706110.tar.gz |
Add an ATOMIC_CLEAR_INT macro.
Submitted by: tmm
Diffstat (limited to 'sys/sparc64')
-rw-r--r-- | sys/sparc64/include/asmacros.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/sparc64/include/asmacros.h b/sys/sparc64/include/asmacros.h index c289149..ead69f1 100644 --- a/sys/sparc64/include/asmacros.h +++ b/sys/sparc64/include/asmacros.h @@ -59,7 +59,7 @@ 9: sub r2, 1, r3 ; \ casa [r1] ASI_N, r2, r3 ; \ cmp r2, r3 ; \ - bne,pn %xcc, 9b ; \ + bne,pn %icc, 9b ; \ mov r3, r2 /* @@ -70,7 +70,18 @@ 9: add r2, 1, r3 ; \ casa [r1] ASI_N, r2, r3 ; \ cmp r2, r3 ; \ - bne,pn %xcc, 9b ; \ + bne,pn %icc, 9b ; \ + mov r3, r2 + +/* + * Atomically clear a number of bits of an integer in memory. + */ +#define ATOMIC_CLEAR_INT(r1, r2, r3, bits) \ + lduw [r1], r2 ; \ +9: andn r2, bits, r3 ; \ + casa [r1] ASI_N, r2, r3 ; \ + cmp r2, r3 ; \ + bne,pn %icc, 9b ; \ mov r3, r2 #define PCPU(member) %g7 + PC_ ## member |