Jacek Caban : winnt.h: Provide inline NtCurrentTeb implementation for mingw arm builds.

Alexandre Julliard julliard at winehq.org
Tue Nov 10 13:46:21 CST 2020


Module: wine
Branch: stable
Commit: 021799db66ab489c6519a4ccb93af2ef86653830
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=021799db66ab489c6519a4ccb93af2ef86653830

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed May 27 20:19:04 2020 +0200

winnt.h: Provide inline NtCurrentTeb implementation for mingw arm builds.

Based on mingw-w64.

Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 6a05b84ecaf6fa1f3343011351f9bdd2e4e5eaf2)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 include/winnt.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/include/winnt.h b/include/winnt.h
index 41fb6a82897..4c7fd3544a9 100644
--- a/include/winnt.h
+++ b/include/winnt.h
@@ -2668,6 +2668,13 @@ static FORCEINLINE struct _TEB * WINAPI NtCurrentTeb(void)
 {
     return (struct _TEB *)__readgsqword(FIELD_OFFSET(NT_TIB, Self));
 }
+#elif defined(__arm__) && defined(__MINGW32__)
+static FORCEINLINE struct _TEB * WINAPI NtCurrentTeb(void)
+{
+    struct _TEB *teb;
+    __asm__("mrc p15, 0, %0, c13, c0, 2" : "=r" (teb));
+    return teb;
+}
 #else
 extern struct _TEB * WINAPI NtCurrentTeb(void);
 #endif




More information about the wine-cvs mailing list