Commit a9524538 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

include: Add MemoryBarrier().

parent 377f7213
......@@ -6983,7 +6983,50 @@ static FORCEINLINE void * WINAPI InterlockedExchangePointer( void *volatile *des
return (void *)_InterlockedExchange( (long volatile*)dest, (long)val );
}
#endif
#endif /* __i386__ */
#ifdef __i386__
static FORCEINLINE void MemoryBarrier(void)
{
LONG dummy;
InterlockedOr(&dummy, 0);
}
#elif defined(__x86_64__)
#pragma intrinsic(__faststorefence)
void __faststorefence(void);
static FORCEINLINE void MemoryBarrier(void)
{
__faststorefence();
}
#elif defined(__arm__)
#pragma intrinsic(__dmb)
void __dmb(void);
static FORCEINLINE void MemoryBarrier(void)
{
__dmb(_ARM_BARRIER_SY);
}
#elif defined(__aarch64__)
#pragma intrinsic(__dmb)
void __dmb(void);
static FORCEINLINE void MemoryBarrier(void)
{
__dmb(_ARM64_BARRIER_SY);
}
#endif /* __i386__ */
#elif defined(__GNUC__)
......@@ -7068,6 +7111,11 @@ static FORCEINLINE LONG WINAPI InterlockedOr( LONG volatile *dest, LONG val )
return __sync_fetch_and_or( dest, val );
}
static FORCEINLINE void MemoryBarrier(void)
{
__sync_synchronize();
}
#endif /* __GNUC__ */
#ifdef __cplusplus
......
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