svn commit: r221750 - head/sys/sparc64/include

Marius Strobl marius at FreeBSD.org
Tue May 10 21:18:45 UTC 2011


Author: marius
Date: Tue May 10 21:18:45 2011
New Revision: 221750
URL: http://svn.freebsd.org/changeset/base/221750

Log:
  Add an ATOMIC_CLEAR_LONG.

Modified:
  head/sys/sparc64/include/asmacros.h

Modified: head/sys/sparc64/include/asmacros.h
==============================================================================
--- head/sys/sparc64/include/asmacros.h	Tue May 10 18:44:40 2011	(r221749)
+++ head/sys/sparc64/include/asmacros.h	Tue May 10 21:18:45 2011	(r221750)
@@ -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


More information about the svn-src-head mailing list