mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-18 10:16:26 +00:00
ntdll: Don't inline NtCurrentTeb() in Unix libraries.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
1ebf0f2b31
commit
988d9ddbf5
|
@ -1770,4 +1770,9 @@ __ASM_GLOBAL_FUNC( __wine_longjmp,
|
|||
"mov r0, r1\n\t" /* retval */
|
||||
"bx r2" )
|
||||
|
||||
/**********************************************************************
|
||||
* NtCurrentTeb (NTDLL.@)
|
||||
*/
|
||||
__ASM_GLOBAL_FUNC( NtCurrentTeb, "mrc p15, 0, r0, c13, c0, 2; bx lr" )
|
||||
|
||||
#endif /* __arm__ */
|
||||
|
|
|
@ -2896,4 +2896,9 @@ __ASM_GLOBAL_FUNC( __wine_longjmp,
|
|||
"movq 0x10(%rcx),%rsp\n\t" /* jmp_buf->Rsp */
|
||||
"jmp *%rdx" )
|
||||
|
||||
/**********************************************************************
|
||||
* NtCurrentTeb (NTDLL.@)
|
||||
*/
|
||||
__ASM_GLOBAL_FUNC( NtCurrentTeb, "movq %gs:0x30,%rax; ret" )
|
||||
|
||||
#endif /* __x86_64__ */
|
||||
|
|
|
@ -2223,14 +2223,14 @@ typedef struct _NT_TIB
|
|||
|
||||
struct _TEB;
|
||||
|
||||
#if defined(__i386__) && defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 2)))
|
||||
#if defined(__i386__) && defined(__GNUC__) && !defined(WINE_UNIX_LIB)
|
||||
static FORCEINLINE struct _TEB * WINAPI NtCurrentTeb(void)
|
||||
{
|
||||
struct _TEB *teb;
|
||||
__asm__(".byte 0x64\n\tmovl (0x18),%0" : "=r" (teb));
|
||||
return teb;
|
||||
}
|
||||
#elif defined(__i386__) && defined(_MSC_VER)
|
||||
#elif defined(__i386__) && defined(_MSC_VER) && !defined(WINE_UNIX_LIB)
|
||||
static FORCEINLINE struct _TEB * WINAPI NtCurrentTeb(void)
|
||||
{
|
||||
struct _TEB *teb;
|
||||
|
@ -2238,33 +2238,35 @@ static FORCEINLINE struct _TEB * WINAPI NtCurrentTeb(void)
|
|||
__asm mov teb, eax;
|
||||
return teb;
|
||||
}
|
||||
#elif defined(__x86_64__) && defined(__GNUC__)
|
||||
#elif defined(__x86_64__) && defined(__GNUC__) && !defined(WINE_UNIX_LIB)
|
||||
static FORCEINLINE struct _TEB * WINAPI NtCurrentTeb(void)
|
||||
{
|
||||
struct _TEB *teb;
|
||||
__asm__(".byte 0x65\n\tmovq (0x30),%0" : "=r" (teb));
|
||||
return teb;
|
||||
}
|
||||
#elif defined(__x86_64__) && defined(_MSC_VER)
|
||||
#elif defined(__x86_64__) && defined(_MSC_VER) && !defined(WINE_UNIX_LIB)
|
||||
unsigned __int64 __readgsqword(unsigned long);
|
||||
#pragma intrinsic(__readgsqword)
|
||||
static FORCEINLINE struct _TEB * WINAPI NtCurrentTeb(void)
|
||||
{
|
||||
return (struct _TEB *)__readgsqword(FIELD_OFFSET(NT_TIB, Self));
|
||||
}
|
||||
#elif defined(__arm__) && defined(__GNUC__)
|
||||
#elif defined(__arm__) && defined(__GNUC__) && !defined(WINE_UNIX_LIB)
|
||||
static FORCEINLINE struct _TEB * WINAPI NtCurrentTeb(void)
|
||||
{
|
||||
struct _TEB *teb;
|
||||
__asm__("mrc p15, 0, %0, c13, c0, 2" : "=r" (teb));
|
||||
return teb;
|
||||
}
|
||||
#elif defined(__arm__) && defined(_MSC_VER)
|
||||
#elif defined(__arm__) && defined(_MSC_VER) && !defined(WINE_UNIX_LIB)
|
||||
#pragma intrinsic(_MoveFromCoprocessor)
|
||||
static FORCEINLINE struct _TEB * WINAPI NtCurrentTeb(void)
|
||||
{
|
||||
return (struct _TEB *)(ULONG_PTR)_MoveFromCoprocessor(15, 0, 13, 0, 2);
|
||||
}
|
||||
#elif defined(__GNUC__)
|
||||
extern struct _TEB * WINAPI NtCurrentTeb(void) __attribute__((pure));
|
||||
#else
|
||||
extern struct _TEB * WINAPI NtCurrentTeb(void);
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue