summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2014-03-26 16:09:48 +0000
committerReid Kleckner <reid@kleckner.net>2014-03-26 16:09:48 +0000
commit7dd8bc0a84bd5a04941728b18676e0c115c2a8d8 (patch)
tree887efc75e83cdc5a74ea3451216317a32f2ba5d6
parentea06727f03593389529c6bf22781bb5f0a31906e (diff)
downloadbcm5719-llvm-7dd8bc0a84bd5a04941728b18676e0c115c2a8d8.tar.gz
bcm5719-llvm-7dd8bc0a84bd5a04941728b18676e0c115c2a8d8.zip
Intrin.h: Implement _InterlockedExchangePointer
llvm-svn: 204827
-rw-r--r--clang/lib/Headers/Intrin.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Headers/Intrin.h b/clang/lib/Headers/Intrin.h
index 2ed88301cf9..90a218e6297 100644
--- a/clang/lib/Headers/Intrin.h
+++ b/clang/lib/Headers/Intrin.h
@@ -422,6 +422,7 @@ static __inline__
__int64 _InterlockedExchange64(__int64 volatile *_Target, __int64 _Value);
static __inline__
__int64 _InterlockedExchangeAdd64(__int64 volatile *_Addend, __int64 _Value);
+static __inline__
void *_InterlockedExchangePointer(void *volatile *_Target, void *_Value);
static __inline__
__int64 _InterlockedIncrement64(__int64 volatile *_Addend);
@@ -795,6 +796,11 @@ _InterlockedExchange64(__int64 volatile *_Target, __int64 _Value) {
__atomic_exchange(_Target, &_Value, &_Value, 0);
return _Value;
}
+static __inline__ void *__attribute__((__always_inline__, __nodebug__))
+_InterlockedExchangePointer(void *volatile *_Target, void *_Value) {
+ __atomic_exchange(_Target, &_Value, &_Value, 0);
+ return _Value;
+}
#endif
/*----------------------------------------------------------------------------*\
|* Interlocked Compare Exchange
OpenPOWER on IntegriCloud