- add missing 64 bit intrinsic Interlocked functions
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Mon, 28 Jul 2008 21:39:55 +0000 (21:39 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Mon, 28 Jul 2008 21:39:55 +0000 (21:39 +0000)
- readd Interlocked definitions to winddk.h that someone stole

svn path=/branches/ros-amd64-bringup/; revision=34916

reactos/include/ddk/winddk.h
reactos/include/psdk/intrin_x86.h

index 35e52d6..a5f2414 100644 (file)
@@ -5796,6 +5796,17 @@ InterlockedExchangeAdd(
 #define InterlockedCompareExchangePointer _InterlockedCompareExchangePointer
 #define InterlockedExchangePointer _InterlockedExchangePointer
 
+#define ExInterlockedPopEntrySList(Head, Lock) ExpInterlockedPopEntrySList(Head)
+#define ExInterlockedPushEntrySList(Head, Entry, Lock) ExpInterlockedPushEntrySList(Head, Entry)
+#define ExInterlockedFlushSList(Head) ExpInterlockedFlushSList(Head)
+
+#if !defined(_WINBASE_)
+#define InterlockedPopEntrySList(Head) ExpInterlockedPopEntrySList(Head)
+#define InterlockedPushEntrySList(Head, Entry) ExpInterlockedPushEntrySList(Head, Entry)
+#define InterlockedFlushSList(Head) ExpInterlockedFlushSList(Head)
+#define QueryDepthSList(Head) ExQueryDepthSList(Head)
+#endif // !defined(_WINBASE_
+
 #endif // _M_AMD64
 
 #endif /* !__INTERLOCKED_DECLARED */
index e30367e..6bd172e 100644 (file)
@@ -147,6 +147,13 @@ static __inline__ __attribute__((always_inline)) long _InterlockedExchangeAdd(vo
        return __sync_fetch_and_add(Addend, Value);
 }
 
+#if defined(_M_AMD64)
+static __inline__ __attribute__((always_inline)) long long _InterlockedExchangeAdd64(volatile long long * const Addend, const long long Value)
+{
+       return __sync_fetch_and_add(Addend, Value);
+}
+#endif
+
 static __inline__ __attribute__((always_inline)) char _InterlockedAnd8(volatile char * const value, const char mask)
 {
        return __sync_fetch_and_and(value, mask);
@@ -471,6 +478,18 @@ static __inline__ __attribute__((always_inline)) long _InterlockedIncrement16(vo
        return _InterlockedExchangeAdd16(lpAddend, 1) + 1;
 }
 
+#if defined(_M_AMD64)
+static __inline__ __attribute__((always_inline)) long long _InterlockedDecrement64(volatile long long * const lpAddend)
+{
+       return _InterlockedExchangeAdd(lpAddend, -1) - 1;
+}
+
+static __inline__ __attribute__((always_inline)) long long _InterlockedIncrement64(volatile long long * const lpAddend)
+{
+       return _InterlockedExchangeAdd64(lpAddend, 1) + 1;
+}
+#endif
+
 static __inline__ __attribute__((always_inline)) unsigned char _interlockedbittestandreset(volatile long * a, const long b)
 {
        unsigned char retval;