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
6d2f08cf
Commit
6d2f08cf
authored
Feb 15, 2021
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 17, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Reserve space for all registers in x86_64 syscall frame.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
877f06d1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
31 deletions
+48
-31
signal_x86_64.c
dlls/ntdll/unix/signal_x86_64.c
+32
-15
import.c
tools/winebuild/import.c
+16
-16
No files found.
dlls/ntdll/unix/signal_x86_64.c
View file @
6d2f08cf
...
...
@@ -275,20 +275,37 @@ C_ASSERT( sizeof(struct syscall_xsave) == 0x200 );
struct
syscall_frame
{
ULONG64
r12
;
ULONG64
r13
;
ULONG64
r14
;
ULONG64
r15
;
ULONG64
rdi
;
ULONG64
rsi
;
ULONG64
rbx
;
ULONG64
rbp
;
ULONG64
rax
;
/* 0000 */
ULONG64
rbx
;
/* 0008 */
ULONG64
rcx
;
/* 0010 */
ULONG64
rdx
;
/* 0018 */
ULONG64
rsi
;
/* 0020 */
ULONG64
rdi
;
/* 0028 */
ULONG64
r8
;
/* 0030 */
ULONG64
r9
;
/* 0038 */
ULONG64
r10
;
/* 0040 */
ULONG64
r11
;
/* 0048 */
ULONG64
r12
;
/* 0050 */
ULONG64
r13
;
/* 0058 */
ULONG64
r14
;
/* 0060 */
ULONG64
r15
;
/* 0068 */
ULONG64
rip
;
/* 0070 */
WORD
cs
;
/* 0078 */
WORD
ds
;
/* 007a */
WORD
es
;
/* 007c */
WORD
fs
;
/* 007e */
ULONG64
eflags
;
/* 0080 */
ULONG64
rsp
;
/* 0088 */
WORD
ss
;
/* 0090 */
WORD
gs
;
/* 0092 */
WORD
pad
[
2
];
/* 0094 */
ULONG64
rbp
;
/* 0098 */
ULONG64
thunk_addr
;
ULONG64
ret_addr
;
};
/* Should match the offset in call_user_apc_dispatcher(). */
C_ASSERT
(
offsetof
(
struct
syscall_frame
,
ret_addr
)
==
0x
4
8
);
C_ASSERT
(
offsetof
(
struct
syscall_frame
,
ret_addr
)
==
0x
a
8
);
struct
amd64_thread_data
{
...
...
@@ -2087,7 +2104,7 @@ __ASM_GLOBAL_FUNC( call_user_apc_dispatcher,
"movq 0x98(%rcx),%rdx
\n\t
"
/* context->Rsp */
"jmp 2f
\n\t
"
"1:
\t
movq 0x328(%rbx),%rax
\n\t
"
/* amd64_thread_data()->syscall_frame */
"leaq 0x
4
8(%rax),%rdx
\n\t
"
/* &amd64_thread_data()->syscall_frame->ret_addr */
"leaq 0x
a
8(%rax),%rdx
\n\t
"
/* &amd64_thread_data()->syscall_frame->ret_addr */
"2:
\t
subq $0x510,%rdx
\n\t
"
/* sizeof(struct apc_stack_layout) */
"andq $~0xf,%rdx
\n\t
"
"addq $8,%rsp
\n\t
"
/* pop return address */
...
...
@@ -2135,12 +2152,12 @@ __ASM_GLOBAL_FUNC( call_raise_user_exception_dispatcher,
"leaq -0x200(%rax),%r8
\n\t
"
"andq $~63,%r8
\n\t
"
"fxrstor64 (%r8)
\n\t
"
"movq 0x
20(%rax),%rdi
\n\t
"
/* frame->rdi
*/
"movq 0x2
8
(%rax),%rsi
\n\t
"
/* frame->rsi */
"movq 0x
30(%rax),%rbx
\n\t
"
/* frame->rbx
*/
"movq 0x
3
8(%rax),%rbp
\n\t
"
/* frame->rbp */
"movq 0x
8(%rax),%rbx
\n\t
"
/* frame->rbx
*/
"movq 0x2
0
(%rax),%rsi
\n\t
"
/* frame->rsi */
"movq 0x
28(%rax),%rdi
\n\t
"
/* frame->rdi
*/
"movq 0x
9
8(%rax),%rbp
\n\t
"
/* frame->rbp */
"movq $0,0x328(%rdx)
\n\t
"
"leaq 0x
4
8(%rax),%rsp
\n\t
"
"leaq 0x
a
8(%rax),%rsp
\n\t
"
"jmpq *%rcx"
)
...
...
tools/winebuild/import.c
View file @
6d2f08cf
...
...
@@ -1508,24 +1508,24 @@ 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
leaq -0x2
3
8(%%rbp),%%rsp
\n
"
);
output
(
"
\t
leaq -0x2
a
8(%%rbp),%%rsp
\n
"
);
output
(
"
\t
andq $~63,%%rsp
\n
"
);
output
(
"
\t
movq %%gs:0x30,%%rcx
\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"
);
output
(
"
\t
movq %%rbx,-0x90(%%rbp)
\n
"
);
output_cfi
(
".cfi_rel_offset %%rbx,-144"
);
output
(
"
\t
movq %%rsi,-0x78(%%rbp)
\n
"
);
output_cfi
(
".cfi_rel_offset %%rsi,-120"
);
output
(
"
\t
movq %%rdi,-0x70(%%rbp)
\n
"
);
output_cfi
(
".cfi_rel_offset %%rdi,-112"
);
output
(
"
\t
movq %%r12,-0x48(%%rbp)
\n
"
);
output
(
"
\t
movq %%r13,-0x40(%%rbp)
\n
"
);
output
(
"
\t
movq %%r14,-0x38(%%rbp)
\n
"
);
output
(
"
\t
movq %%r15,-0x30(%%rbp)
\n
"
);
output
(
"
\t
fxsave64 (%%rsp)
\n
"
);
/* 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
"
);
output
(
"
\t
leaq -0x38(%%rbp),%%rbx
\n
"
);
output
(
"
\t
movq %%gs:0x30,%%rcx
\n
"
);
output
(
"
\t
leaq -0x98(%%rbp),%%rbx
\n
"
);
output
(
"
\t
movq %%rbx,0x328(%%rcx)
\n
"
);
/* amd64_thread_data()->syscall_frame */
output
(
"
\t
cmpq $%u,%%rax
\n
"
,
count
);
output
(
"
\t
jae 3f
\n
"
);
...
...
@@ -1546,11 +1546,11 @@ void output_syscalls( DLLSPEC *spec )
output
(
"
\t
callq *(%%r10,%%rax,8)
\n
"
);
output
(
"2:
\t
movq %%gs:0x30,%%rcx
\n
"
);
output
(
"
\t
movq $0,0x328(%%rcx)
\n
"
);
output
(
"
\t
movq -0x
18
(%%rbp),%%rdi
\n
"
);
output
(
"
\t
movq -0x
70
(%%rbp),%%rdi
\n
"
);
output_cfi
(
".cfi_same_value %%rdi"
);
output
(
"
\t
movq -0x
10
(%%rbp),%%rsi
\n
"
);
output
(
"
\t
movq -0x
78
(%%rbp),%%rsi
\n
"
);
output_cfi
(
".cfi_same_value %%rsi"
);
output
(
"
\t
movq -0x
8
(%%rbp),%%rbx
\n
"
);
output
(
"
\t
movq -0x
90
(%%rbp),%%rbx
\n
"
);
output_cfi
(
".cfi_same_value %%rbx"
);
output_cfi
(
".cfi_def_cfa_register %%rsp"
);
output
(
"
\t
leave
\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