Commit cdb9b601 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

include: Support ARM64EC target in winnt.h.

parent 71ebc22d
......@@ -33,7 +33,7 @@
#endif
#if defined(_MSC_VER) && (defined(__arm__) || defined(__aarch64__))
#if defined(_MSC_VER) && (defined(__arm__) || defined(__aarch64__) || defined(__arm64ec__))
#include <intrin.h>
#endif
......@@ -2405,6 +2405,17 @@ static FORCEINLINE struct _TEB * WINAPI NtCurrentTeb(void)
__asm mov teb, eax;
return teb;
}
#elif (defined(__aarch64__) || defined(__arm64ec__)) && defined(__GNUC__)
register struct _TEB *__wine_current_teb __asm__("x18");
static FORCEINLINE struct _TEB * WINAPI NtCurrentTeb(void)
{
return __wine_current_teb;
}
#elif (defined(__aarch64__) || defined(__arm64ec__)) && defined(_MSC_VER)
static FORCEINLINE struct _TEB * WINAPI NtCurrentTeb(void)
{
return (struct _TEB *)__getReg(18);
}
#elif defined(__x86_64__) && defined(__GNUC__)
static FORCEINLINE struct _TEB * WINAPI NtCurrentTeb(void)
{
......@@ -2432,17 +2443,6 @@ static FORCEINLINE struct _TEB * WINAPI NtCurrentTeb(void)
{
return (struct _TEB *)(ULONG_PTR)_MoveFromCoprocessor(15, 0, 13, 0, 2);
}
#elif defined(__aarch64__) && defined(__GNUC__)
register struct _TEB *__wine_current_teb __asm__("x18");
static FORCEINLINE struct _TEB * WINAPI NtCurrentTeb(void)
{
return __wine_current_teb;
}
#elif defined(__aarch64__) && defined(_MSC_VER)
static FORCEINLINE struct _TEB * WINAPI NtCurrentTeb(void)
{
return (struct _TEB *)__getReg(18);
}
#elif !defined(RC_INVOKED)
# error You must define NtCurrentTeb() for your architecture
#endif
......@@ -6902,6 +6902,13 @@ static FORCEINLINE void MemoryBarrier(void)
InterlockedOr(&dummy, 0);
}
#elif defined(__aarch64__) || defined(__arm64ec__)
static FORCEINLINE void MemoryBarrier(void)
{
__dmb(_ARM64_BARRIER_SY);
}
#elif defined(__x86_64__)
#pragma intrinsic(__faststorefence)
......@@ -6919,13 +6926,6 @@ static FORCEINLINE void MemoryBarrier(void)
__dmb(_ARM_BARRIER_SY);
}
#elif defined(__aarch64__)
static FORCEINLINE void MemoryBarrier(void)
{
__dmb(_ARM64_BARRIER_SY);
}
#endif /* __i386__ */
/* Since Visual Studio 2012, volatile accesses do not always imply acquire and
......@@ -7191,7 +7191,7 @@ unsigned char _InterlockedCompareExchange128(volatile __int64 *, __int64, __int6
static FORCEINLINE unsigned char InterlockedCompareExchange128( volatile __int64 *dest, __int64 xchg_high, __int64 xchg_low, __int64 *compare )
{
#ifdef __x86_64__
#if defined(__x86_64__) && !defined(__arm64ec__)
unsigned char ret;
__asm__ __volatile__( "lock cmpxchg16b %0; setz %b2"
: "=m" (dest[0]), "=m" (dest[1]), "=r" (ret),
......
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