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
7f088b0b
Commit
7f088b0b
authored
May 29, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Use x18 for the TEB on ARM64.
parent
62173699
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
43 deletions
+13
-43
ntdll.spec
dlls/ntdll/ntdll.spec
+1
-2
signal_arm64.c
dlls/ntdll/signal_arm64.c
+0
-10
loader.c
dlls/ntdll/unix/loader.c
+0
-7
signal_arm64.c
dlls/ntdll/unix/signal_arm64.c
+0
-24
winnt.h
include/winnt.h
+12
-0
No files found.
dlls/ntdll/ntdll.spec
View file @
7f088b0b
...
...
@@ -196,7 +196,7 @@
@ stdcall -syscall NtCreateTransaction(ptr long ptr ptr long long long long ptr ptr)
@ stdcall -syscall NtCreateUserProcess(ptr ptr long long ptr ptr long long ptr ptr ptr)
# @ stub NtCreateWaitablePort
@ stdcall -arch=i386
,arm64
NtCurrentTeb()
@ stdcall -arch=i386 NtCurrentTeb()
@ stdcall -syscall NtDebugActiveProcess(long long)
@ stdcall -syscall NtDebugContinue(long ptr long)
@ stdcall -syscall NtDelayExecution(long ptr)
...
...
@@ -1704,7 +1704,6 @@
@ extern -private __wine_syscall_dispatcher
@ extern -private __wine_unix_call_dispatcher
@ extern -private __wine_unixlib_handle
@ extern -arch=arm64 __wine_current_teb
# Debugging
@ stdcall -norelay __wine_dbg_write(ptr long)
...
...
dlls/ntdll/signal_arm64.c
View file @
7f088b0b
...
...
@@ -38,8 +38,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
seh
);
WINE_DECLARE_DEBUG_CHANNEL
(
threadname
);
TEB
*
(
*
WINAPI
__wine_current_teb
)(
void
)
=
NULL
;
typedef
struct
_SCOPE_TABLE
{
ULONG
Count
;
...
...
@@ -1548,12 +1546,4 @@ __ASM_STDCALL_FUNC( DbgUserBreakPoint, 0, "brk #0xf000; ret"
"
\n\t
nop; nop; nop; nop; nop; nop; nop; nop"
"
\n\t
nop; nop; nop; nop; nop; nop"
);
/**********************************************************************
* NtCurrentTeb (NTDLL.@)
*/
TEB
*
WINAPI
NtCurrentTeb
(
void
)
{
return
__wine_current_teb
();
}
#endif
/* __aarch64__ */
dlls/ntdll/unix/loader.c
View file @
7f088b0b
...
...
@@ -1834,13 +1834,6 @@ static void load_ntdll_functions( HMODULE module )
GET_FUNC
(
__wine_unixlib_handle
);
*
p__wine_unix_call_dispatcher
=
__wine_unix_call_dispatcher
;
*
p__wine_unixlib_handle
=
(
UINT_PTR
)
unix_call_funcs
;
#ifdef __aarch64__
{
void
**
p__wine_current_teb
;
GET_FUNC
(
__wine_current_teb
);
*
p__wine_current_teb
=
NtCurrentTeb
;
}
#endif
#undef GET_FUNC
}
...
...
dlls/ntdll/unix/signal_arm64.c
View file @
7f088b0b
...
...
@@ -1694,22 +1694,6 @@ __ASM_GLOBAL_FUNC( signal_exit_thread,
* __wine_syscall_dispatcher
*/
__ASM_GLOBAL_FUNC
(
__wine_syscall_dispatcher
,
/* FIXME: use x18 directly instead */
"stp x0, x1, [sp, #-96]!
\n\t
"
"stp x2, x3, [sp, #16]
\n\t
"
"stp x4, x5, [sp, #32]
\n\t
"
"stp x6, x7, [sp, #48]
\n\t
"
"stp x8, x9, [sp, #64]
\n\t
"
"str x30, [sp, #80]
\n\t
"
"bl "
__ASM_NAME
(
"NtCurrentTeb"
)
"
\n\t
"
"mov x18, x0
\n\t
"
"ldp x2, x3, [sp, #16]
\n\t
"
"ldp x4, x5, [sp, #32]
\n\t
"
"ldp x6, x7, [sp, #48]
\n\t
"
"ldp x8, x9, [sp, #64]
\n\t
"
"ldr x30, [sp, #80]
\n\t
"
"ldp x0, x1, [sp], #96
\n\t
"
"ldr x10, [x18, #0x2f8]
\n\t
"
/* arm64_thread_data()->syscall_frame */
"stp x18, x19, [x10, #0x90]
\n\t
"
"stp x20, x21, [x10, #0xa0]
\n\t
"
...
...
@@ -1822,14 +1806,6 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher,
* __wine_unix_call_dispatcher
*/
__ASM_GLOBAL_FUNC
(
__wine_unix_call_dispatcher
,
/* FIXME: use x18 directly instead */
"stp x0, x1, [sp, #-32]!
\n\t
"
"stp x2, x30,[sp, #16]
\n\t
"
"bl "
__ASM_NAME
(
"NtCurrentTeb"
)
"
\n\t
"
"mov x18, x0
\n\t
"
"ldp x2, x30,[sp, #16]
\n\t
"
"ldp x0, x1, [sp], #32
\n\t
"
"ldr x10, [x18, #0x2f8]
\n\t
"
/* arm64_thread_data()->syscall_frame */
"stp x18, x19, [x10, #0x90]
\n\t
"
"stp x20, x21, [x10, #0xa0]
\n\t
"
...
...
include/winnt.h
View file @
7f088b0b
...
...
@@ -2398,6 +2398,18 @@ static FORCEINLINE struct _TEB * WINAPI NtCurrentTeb(void)
{
return
(
struct
_TEB
*
)(
ULONG_PTR
)
_MoveFromCoprocessor
(
15
,
0
,
13
,
0
,
2
);
}
#elif defined(__aarch64__) && defined(__MINGW32__)
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)
#pragma intrinsic(__getReg)
static
FORCEINLINE
struct
_TEB
*
WINAPI
NtCurrentTeb
(
void
)
{
return
(
struct
_TEB
*
)
__getReg
(
18
);
}
#elif defined(__GNUC__)
extern
struct
_TEB
*
WINAPI
NtCurrentTeb
(
void
)
__attribute__
((
pure
));
#else
...
...
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