Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 May 2011 21:18:45 +0000 (UTC)
From:      Marius Strobl <marius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r221750 - head/sys/sparc64/include
Message-ID:  <201105102118.p4ALIjrD060522@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105102118.p4ALIjrD060522>