Author: tkreuzer
Date: Mon Jul 28 16:39:55 2008
New Revision: 34916
URL:
http://svn.reactos.org/svn/reactos?rev=34916&view=rev
Log:
- add missing 64 bit intrinsic Interlocked functions
- readd Interlocked definitions to winddk.h that someone stole
Modified:
branches/ros-amd64-bringup/reactos/include/ddk/winddk.h
branches/ros-amd64-bringup/reactos/include/psdk/intrin_x86.h
Modified: branches/ros-amd64-bringup/reactos/include/ddk/winddk.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/inclu…
==============================================================================
--- branches/ros-amd64-bringup/reactos/include/ddk/winddk.h [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/include/ddk/winddk.h [iso-8859-1] Mon Jul 28
16:39:55 2008
@@ -5796,6 +5796,17 @@
#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 */
Modified: branches/ros-amd64-bringup/reactos/include/psdk/intrin_x86.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/inclu…
==============================================================================
--- branches/ros-amd64-bringup/reactos/include/psdk/intrin_x86.h [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/include/psdk/intrin_x86.h [iso-8859-1] Mon Jul 28
16:39:55 2008
@@ -147,6 +147,13 @@
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);
@@ -470,6 +477,18 @@
{
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)
{