diff options
author | marius <marius@FreeBSD.org> | 2011-05-10 21:18:45 +0000 |
---|---|---|
committer | marius <marius@FreeBSD.org> | 2011-05-10 21:18:45 +0000 |
commit | 04f392fe120e6c859baeb0931882694d9cb92976 (patch) | |
tree | 3c830c63c90a2ce31c55350dba63f80db9401d12 | |
parent | 90a44bc764b0066314238d380516061c801d4b91 (diff) | |
download | FreeBSD-src-04f392fe120e6c859baeb0931882694d9cb92976.zip FreeBSD-src-04f392fe120e6c859baeb0931882694d9cb92976.tar.gz |
Add an ATOMIC_CLEAR_LONG.
-rw-r--r-- | sys/sparc64/include/asmacros.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/sparc64/include/asmacros.h b/sys/sparc64/include/asmacros.h index 840959f..777b35a 100644 --- a/sys/sparc64/include/asmacros.h +++ b/sys/sparc64/include/asmacros.h @@ -90,6 +90,17 @@ bne,pn %icc, 9b ; \ mov r3, r2 +/* + * Atomically clear a number of bits of an u_long in memory. + */ +#define ATOMIC_CLEAR_LONG(r1, r2, r3, bits) \ + ldx [r1], r2 ; \ +9: andn r2, bits, r3 ; \ + casxa [r1] ASI_N, r2, r3 ; \ + cmp r2, r3 ; \ + bne,pn %icc, 9b ; \ + mov r3, r2 + #define PCPU(member) PCPU_REG + PC_ ## member #define PCPU_ADDR(member, reg) \ add PCPU_REG, PC_ ## member, reg |