Commit abf29377 authored by Alexandre Julliard's avatar Alexandre Julliard

kernel32: Export InterlockedCompareExchange64.

parent 98ca10c8
......@@ -726,6 +726,7 @@
@ stdcall InitializeCriticalSectionEx(ptr long long)
@ stdcall InitializeSListHead(ptr) ntdll.RtlInitializeSListHead
@ stdcall -arch=i386 InterlockedCompareExchange (ptr long long)
@ stdcall -arch=i386 -ret64 InterlockedCompareExchange64(ptr double double) ntdll.RtlInterlockedCompareExchange64
@ stdcall -arch=i386 InterlockedDecrement(ptr)
@ stdcall -arch=i386 InterlockedExchange(ptr long)
@ stdcall -arch=i386 InterlockedExchangeAdd (ptr long )
......
......@@ -2376,6 +2376,8 @@ static inline PVOID WINAPI InterlockedExchangePointer( PVOID volatile *dest, PVO
return (PVOID)InterlockedExchange( (LONG volatile*)dest, (LONG)val );
}
WINBASEAPI LONGLONG WINAPI InterlockedCompareExchange64(LONGLONG volatile*,LONGLONG,LONGLONG);
#else /* __i386__ */
static inline LONG WINAPI InterlockedCompareExchange( LONG volatile *dest, LONG xchg, LONG compare )
......@@ -2404,6 +2406,19 @@ static inline PVOID WINAPI InterlockedCompareExchangePointer( PVOID volatile *de
#endif
}
static inline LONGLONG WINAPI InterlockedCompareExchange64( LONGLONG volatile *dest, LONGLONG xchg, LONGLONG compare )
{
#if defined(__x86_64__) && defined(__GNUC__)
LONGLONG ret;
__asm__ __volatile__( "lock; cmpxchgq %2,(%1)"
: "=a" (ret) : "r" (dest), "r" (xchg), "0" (compare) : "memory" );
return ret;
#else
extern __int64 interlocked_cmpxchg64( __int64 *dest, __int64 xchg, __int64 compare );
return interlocked_cmpxchg64( (__int64 *)dest, xchg, compare );
#endif
}
static inline LONG WINAPI InterlockedExchange( LONG volatile *dest, LONG val )
{
#if defined(__x86_64__) && defined(__GNUC__)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment