From 86fc30c10540dc5ed225e547032ca1dd2d21433f Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Wed, 20 Jan 2021 22:35:47 -0600 Subject: [PATCH] include: Add YieldProcessor(). Signed-off-by: Zebediah Figura Signed-off-by: Alexandre Julliard --- include/winnt.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/winnt.h b/include/winnt.h index d8abb8bde70..83f03b62ade 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -7154,6 +7154,19 @@ static FORCEINLINE void MemoryBarrier(void) #endif /* __GNUC__ */ +static FORCEINLINE void YieldProcessor(void) +{ +#ifdef __GNUC__ +#if defined(__i386__) || defined(__x86_64__) + __asm__ __volatile__( "rep; nop" : : : "memory" ); +#elif defined(__arm__) || defined(__aarch64__) + __asm__ __volatile__( "dmb ishst\n\tyield" : : : "memory" ); +#else + __asm__ __volatile__( "" : : : "memory" ); +#endif +#endif +} + #ifdef __cplusplus } #endif