summaryrefslogtreecommitdiffstats
path: root/sys/sparc64
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2011-05-10 21:18:45 +0000
committermarius <marius@FreeBSD.org>2011-05-10 21:18:45 +0000
commit04f392fe120e6c859baeb0931882694d9cb92976 (patch)
tree3c830c63c90a2ce31c55350dba63f80db9401d12 /sys/sparc64
parent90a44bc764b0066314238d380516061c801d4b91 (diff)
downloadFreeBSD-src-04f392fe120e6c859baeb0931882694d9cb92976.zip
FreeBSD-src-04f392fe120e6c859baeb0931882694d9cb92976.tar.gz
Add an ATOMIC_CLEAR_LONG.
Diffstat (limited to 'sys/sparc64')
-rw-r--r--sys/sparc64/include/asmacros.h11
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
OpenPOWER on IntegriCloud