[Pkg-mono-svn-commits] [mono] 02/23: Simplify the ifdeffery in atomic.c/.h a bit. (cherry picked from commit fd6f60245f2f6651bf93da05b9a0b7c60ab9ded3)

Jo Shields directhex at alioth.debian.org
Wed Oct 23 22:14:28 UTC 2013


This is an automated email from the git hooks/post-receive script.

directhex pushed a commit to branch master-experimental-patches/atomics_support_on_fringe_32bit_platforms
in repository mono.

commit 4d3344a8bbbdfd5b4337391be75a8ba5567d7075
Author: Alex Rønne Petersen <alexrp at xamarin.com>
Date:   Tue Sep 24 17:14:55 2013 +0200

    Simplify the ifdeffery in atomic.c/.h a bit.
    (cherry picked from commit fd6f60245f2f6651bf93da05b9a0b7c60ab9ded3)
    
    Conflicts:
    	mono/utils/atomic.c
---
 mono/utils/atomic.c |   17 +++++++++++++----
 mono/utils/atomic.h |    7 +++----
 2 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/mono/utils/atomic.c b/mono/utils/atomic.c
index da3290a..a7071e2 100755
--- a/mono/utils/atomic.c
+++ b/mono/utils/atomic.c
@@ -13,7 +13,7 @@
 
 #include <mono/utils/atomic.h>
 
-#if defined (WAPI_NO_ATOMIC_ASM) || !defined (HAS_64BITS_ATOMIC)
+#if defined (WAPI_NO_ATOMIC_ASM) || defined (BROKEN_64BIT_ATOMICS_INTRINSIC)
 
 #include <pthread.h>
 
@@ -197,11 +197,13 @@ gint32 InterlockedExchangeAdd(volatile gint32 *dest, gint32 add)
 	return(ret);
 }
 
+#define NEED_64BIT_CMPXCHG_FALLBACK
+
 #endif
 
-#ifndef HAS_64BITS_ATOMICS
+#if defined (BROKEN_64BIT_ATOMICS_INTRINSIC)
 
-#if defined (TARGET_MACH) && defined (TARGET_ARM) && (defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7S__))
+#if defined (TARGET_MACH) && defined (TARGET_ARM) && defined (HAVE_ARMV7)
 
 gint64 InterlockedCompareExchange64(volatile gint64 *dest, gint64 exch, gint64 comp)  __attribute__ ((naked));
 
@@ -240,6 +242,14 @@ InterlockedCompareExchange64(volatile gint64 *dest, gint64 exch, gint64 comp)
 
 #else
 
+#define NEED_64BIT_CMPXCHG_FALLBACK
+
+#endif
+
+#endif
+
+#if defined (NEED_64BIT_CMPXCHG_FALLBACK)
+
 gint64
 InterlockedCompareExchange64(volatile gint64 *dest, gint64 exch, gint64 comp)
 {
@@ -256,4 +266,3 @@ InterlockedCompareExchange64(volatile gint64 *dest, gint64 exch, gint64 comp)
 }
 
 #endif
-#endif
diff --git a/mono/utils/atomic.h b/mono/utils/atomic.h
index 23e70ca..6d2e3d7 100755
--- a/mono/utils/atomic.h
+++ b/mono/utils/atomic.h
@@ -22,7 +22,6 @@
 #if defined(__WIN32__) || defined(_WIN32)
 
 #include <windows.h>
-#define HAS_64BITS_ATOMICS 1
 
 /* mingw is missing InterlockedCompareExchange64 () from winbase.h */
 #ifdef __MINGW32__
@@ -84,9 +83,7 @@ static inline gint32 InterlockedExchangeAdd(volatile gint32 *val, gint32 add)
 #define BROKEN_64BIT_ATOMICS_INTRINSIC 1
 #endif
 
-
 #if !defined (BROKEN_64BIT_ATOMICS_INTRINSIC)
-#define HAS_64BITS_ATOMICS 1
 
 static inline gint64 InterlockedCompareExchange64(volatile gint64 *dest, gint64 exch, gint64 comp)
 {
@@ -505,8 +502,10 @@ extern gint32 InterlockedExchangeAdd(volatile gint32 *dest, gint32 add);
 
 #endif
 
-#ifndef HAS_64BITS_ATOMICS
+#if defined (WAPI_NO_ATOMIC_ASM) || defined (BROKEN_64BIT_ATOMICS_INTRINSIC)
+
 extern gint64 InterlockedCompareExchange64(volatile gint64 *dest, gint64 exch, gint64 comp);
+
 #endif
 
 #endif /* _WAPI_ATOMIC_H_ */

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mono/packages/mono.git



More information about the Pkg-mono-svn-commits mailing list