kernel32: Export InterlockedCompareExchange64.

This commit is contained in:
Alexandre Julliard 2010-02-05 12:31:48 +01:00
parent 98ca10c89d
commit abf29377ba
2 changed files with 16 additions and 0 deletions

View File

@ -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 )

View File

@ -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__)