Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
988d9ddb
Commit
988d9ddb
authored
Nov 09, 2022
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Don't inline NtCurrentTeb() in Unix libraries.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1ebf0f2b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
6 deletions
+18
-6
signal_arm.c
dlls/ntdll/unix/signal_arm.c
+5
-0
signal_x86_64.c
dlls/ntdll/unix/signal_x86_64.c
+5
-0
winnt.h
include/winnt.h
+8
-6
No files found.
dlls/ntdll/unix/signal_arm.c
View file @
988d9ddb
...
...
@@ -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__ */
dlls/ntdll/unix/signal_x86_64.c
View file @
988d9ddb
...
...
@@ -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__ */
include/winnt.h
View file @
988d9ddb
...
...
@@ -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\t
movl (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\t
movq (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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment