Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Jun 2013 08:23:53 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r251783 - head/sys/sparc64/include
Message-ID:  <201306150823.r5F8NrRW089579@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ed
Date: Sat Jun 15 08:23:53 2013
New Revision: 251783
URL: http://svnweb.freebsd.org/changeset/base/251783

Log:
  Remove conflicting macros from SPARC64's atomic(9) header.
  
  The atomic_load() and atomic_store() macros conflict with the equally
  named macros from <stdatomic.h>. Remove them, as they are only used to
  implement functions that are not present on any of the other
  architectures.

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

Modified: head/sys/sparc64/include/atomic.h
==============================================================================
--- head/sys/sparc64/include/atomic.h	Sat Jun 15 08:21:54 2013	(r251782)
+++ head/sys/sparc64/include/atomic.h	Sat Jun 15 08:23:53 2013	(r251783)
@@ -133,12 +133,9 @@
 	t;								\
 })
 
-#define	atomic_load(p, sz)						\
-	atomic_cas((p), 0, 0, sz)
-
 #define	atomic_load_acq(p, sz) ({					\
 	itype(sz) v;							\
-	v = atomic_load((p), sz);					\
+	v = atomic_cas((p), 0, 0, sz);					\
 	__compiler_membar();						\
 	v;								\
 })
@@ -153,8 +150,9 @@
 	e;								\
 })
 
-#define	atomic_store(p, v, sz) do {					\
+#define	atomic_store_rel(p, v, sz) do {					\
 	itype(sz) e, r;							\
+	membar(LoadStore | StoreStore);					\
 	for (e = *(volatile itype(sz) *)(p);; e = r) {			\
 		r = atomic_cas((p), e, (v), sz);			\
 		if (r == e)						\
@@ -162,11 +160,6 @@
 	}								\
 } while (0)
 
-#define	atomic_store_rel(p, v, sz) do {					\
-	membar(LoadStore | StoreStore);					\
-	atomic_store((p), (v), sz);					\
-} while (0)
-
 #define	ATOMIC_GEN(name, ptype, vtype, atype, sz)			\
 									\
 static __inline vtype							\
@@ -267,11 +260,6 @@ atomic_subtract_rel_ ## name(volatile pt
 }									\
 									\
 static __inline void							\
-atomic_store_ ## name(volatile ptype p, vtype v)			\
-{									\
-	atomic_store((p), (v), sz);					\
-}									\
-static __inline void							\
 atomic_store_rel_ ## name(volatile ptype p, vtype v)			\
 {									\
 	atomic_store_rel((p), (v), sz);					\



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