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
9a7c56d9
Commit
9a7c56d9
authored
Jul 28, 2020
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebuild: Store the syscall frame in the thread data on x86_64.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8e3b5183
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
15 deletions
+60
-15
signal_x86_64.c
dlls/ntdll/unix/signal_x86_64.c
+27
-7
import.c
tools/winebuild/import.c
+33
-8
No files found.
dlls/ntdll/unix/signal_x86_64.c
View file @
9a7c56d9
...
...
@@ -240,19 +240,39 @@ struct stack_layout
C_ASSERT
(
sizeof
(
struct
stack_layout
)
==
0x630
);
/* Should match the size in call_user_exception_dispatcher(). */
struct
syscall_frame
{
struct
syscall_frame
*
prev_frame
;
ULONG64
pad
;
ULONG64
xmm
[
10
*
2
];
/* xmm6-xmm15 */
ULONG64
mxcsr
;
ULONG64
r12
;
ULONG64
r13
;
ULONG64
r14
;
ULONG64
r15
;
ULONG64
rdi
;
ULONG64
rsi
;
ULONG64
rbx
;
ULONG64
rbp
;
ULONG64
thunk_addr
;
ULONG64
ret_addr
;
};
struct
amd64_thread_data
{
DWORD_PTR
dr0
;
/* 02f0 debug registers */
DWORD_PTR
dr1
;
DWORD_PTR
dr2
;
DWORD_PTR
dr3
;
DWORD_PTR
dr6
;
DWORD_PTR
dr7
;
void
*
exit_frame
;
/* 0320 exit frame pointer */
DWORD_PTR
dr0
;
/* 02f0 debug registers */
DWORD_PTR
dr1
;
/* 02f8 */
DWORD_PTR
dr2
;
/* 0300 */
DWORD_PTR
dr3
;
/* 0308 */
DWORD_PTR
dr6
;
/* 0310 */
DWORD_PTR
dr7
;
/* 0318 */
void
*
exit_frame
;
/* 0320 exit frame pointer */
struct
syscall_frame
*
syscall_frame
;
/* 0328 syscall frame pointer */
};
C_ASSERT
(
sizeof
(
struct
amd64_thread_data
)
<=
sizeof
(((
struct
ntdll_thread_data
*
)
0
)
->
cpu_data
)
);
C_ASSERT
(
offsetof
(
TEB
,
GdiTebBatch
)
+
offsetof
(
struct
amd64_thread_data
,
exit_frame
)
==
0x320
);
C_ASSERT
(
offsetof
(
TEB
,
GdiTebBatch
)
+
offsetof
(
struct
amd64_thread_data
,
syscall_frame
)
==
0x328
);
static
inline
struct
amd64_thread_data
*
amd64_thread_data
(
void
)
{
...
...
tools/winebuild/import.c
View file @
9a7c56d9
...
...
@@ -1496,10 +1496,31 @@ void output_syscalls( DLLSPEC *spec )
output_cfi
(
".cfi_rel_offset %%rbp,0"
);
output
(
"
\t
movq %%rsp,%%rbp
\n
"
);
output_cfi
(
".cfi_def_cfa_register %%rbp"
);
output
(
"
\t
pushq %%rsi
\n
"
);
output_cfi
(
".cfi_rel_offset %%rsi,-8"
);
output
(
"
\t
pushq %%rdi
\n
"
);
output_cfi
(
".cfi_rel_offset %%rdi,-16"
);
output
(
"
\t
leaq -0xe8(%%rbp),%%rsp
\n
"
);
output
(
"
\t
movq %%gs:0x30,%%rcx
\n
"
);
output
(
"
\t
pushq 0x328(%%rcx)
\n
"
);
/* amd64_thread_data()->syscall_frame */
output
(
"
\t
movq %%rsp,0x328(%%rcx)
\n
"
);
output
(
"
\t
movdqu %%xmm6,-0xe0(%%rbp)
\n
"
);
output
(
"
\t
movdqu %%xmm7,-0xd0(%%rbp)
\n
"
);
output
(
"
\t
movdqu %%xmm8,-0xc0(%%rbp)
\n
"
);
output
(
"
\t
movdqu %%xmm9,-0xb0(%%rbp)
\n
"
);
output
(
"
\t
movdqu %%xmm10,-0xa0(%%rbp)
\n
"
);
output
(
"
\t
movdqu %%xmm11,-0x90(%%rbp)
\n
"
);
output
(
"
\t
movdqu %%xmm12,-0x80(%%rbp)
\n
"
);
output
(
"
\t
movdqu %%xmm13,-0x70(%%rbp)
\n
"
);
output
(
"
\t
movdqu %%xmm14,-0x60(%%rbp)
\n
"
);
output
(
"
\t
movdqu %%xmm15,-0x50(%%rbp)
\n
"
);
output
(
"
\t
stmxcsr -0x40(%%rbp)
\n
"
);
output
(
"
\t
movq %%r12,-0x38(%%rbp)
\n
"
);
output
(
"
\t
movq %%r13,-0x30(%%rbp)
\n
"
);
output
(
"
\t
movq %%r14,-0x28(%%rbp)
\n
"
);
output
(
"
\t
movq %%r15,-0x20(%%rbp)
\n
"
);
output
(
"
\t
movq %%rdi,-0x18(%%rbp)
\n
"
);
output_cfi
(
".cfi_rel_offset %%rdi,-24"
);
output
(
"
\t
movq %%rsi,-0x10(%%rbp)
\n
"
);
output_cfi
(
".cfi_rel_offset %%rsi,-16"
);
output
(
"
\t
movq %%rbx,-0x08(%%rbp)
\n
"
);
output_cfi
(
".cfi_rel_offset %%rbx,-8"
);
/* Legends of Runeterra hooks the first system call return instruction, and
* depends on us returning to it. Adjust the return address accordingly. */
output
(
"
\t
subq $0xb,0x8(%%rbp)
\n
"
);
...
...
@@ -1522,13 +1543,17 @@ void output_syscalls( DLLSPEC *spec )
output
(
"
\t
subq $0x20,%%rsp
\n
"
);
output
(
"
\t
leaq .Lsyscall_table(%%rip),%%r10
\n
"
);
output
(
"
\t
callq *(%%r10,%%rax,8)
\n
"
);
output
(
"3:
\t
leaq -0x10(%%rbp),%%rsp
\n
"
);
output
(
"
\t
popq %%rdi
\n
"
);
output
(
"3:
\t
pushq -0xf0(%%rbp)
\n
"
);
output
(
"
\t
movq %%gs:0x30,%%rcx
\n
"
);
output
(
"
\t
popq 0x328(%%rcx)
\n
"
);
/* prev frame */
output
(
"
\t
movq -0x18(%%rbp),%%rdi
\n
"
);
output_cfi
(
".cfi_same_value %%rdi"
);
output
(
"
\t
popq
%%rsi
\n
"
);
output
(
"
\t
movq -0x10(%%rbp),
%%rsi
\n
"
);
output_cfi
(
".cfi_same_value %%rsi"
);
output
(
"
\t
movq -0x8(%%rbp),%%rbx
\n
"
);
output_cfi
(
".cfi_same_value %%rbx"
);
output_cfi
(
".cfi_def_cfa_register %%rsp"
);
output
(
"
\t
popq %%rbp
\n
"
);
output
(
"
\t
leave
\n
"
);
output_cfi
(
".cfi_adjust_cfa_offset -8"
);
output_cfi
(
".cfi_same_value %%rbp"
);
output
(
"
\t
ret
\n
"
);
...
...
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