From 4fdea7a7cab3283e7d2eec7538f5da0493c1d68d Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Fri, 26 Feb 2021 15:55:26 +0100 Subject: [PATCH] include: Add MSVC ARM version of NtCurrentTeb. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- include/winnt.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/winnt.h b/include/winnt.h index e594c89419a..e19f515eddb 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -2815,6 +2815,12 @@ static FORCEINLINE struct _TEB * WINAPI NtCurrentTeb(void) __asm__("mrc p15, 0, %0, c13, c0, 2" : "=r" (teb)); return teb; } +#elif defined(__arm__) && defined(_MSC_VER) +#pragma intrinsic(_MoveFromCoprocessor) +static FORCEINLINE struct _TEB * WINAPI NtCurrentTeb(void) +{ + return (struct _TEB *)(ULONG_PTR)_MoveFromCoprocessor(15, 0, 13, 0, 2); +} #else extern struct _TEB * WINAPI NtCurrentTeb(void); #endif