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
4e5b61bb
Commit
4e5b61bb
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: Store stack pointer in x86_64 syscall frame.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
accf7a09
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
+7
-8
signal_x86_64.c
dlls/ntdll/unix/signal_x86_64.c
+5
-8
import.c
tools/winebuild/import.c
+2
-0
No files found.
dlls/ntdll/unix/signal_x86_64.c
View file @
4e5b61bb
...
...
@@ -300,12 +300,9 @@ struct syscall_frame
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
)
==
0xa8
);
C_ASSERT
(
sizeof
(
struct
syscall_frame
)
==
0xa0
);
struct
amd64_thread_data
{
...
...
@@ -1944,7 +1941,7 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context )
}
if
(
needed_flags
&
CONTEXT_CONTROL
)
{
context
->
Rsp
=
(
ULONG64
)
&
frame
->
ret_addr
;
context
->
Rsp
=
frame
->
rsp
;
context
->
Rbp
=
frame
->
rbp
;
context
->
Rip
=
frame
->
rip
;
context
->
EFlags
=
frame
->
eflags
;
...
...
@@ -2104,7 +2101,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 0xa8(%rax),%rdx
\n\t
"
/* &amd64_thread_data()->syscall_frame->ret_addr
*/
"
movq 0x88(%rax),%rdx
\n\t
"
/* frame->rsp
*/
"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 */
...
...
@@ -2399,7 +2396,7 @@ static BOOL handle_syscall_fault( ucontext_t *sigcontext, EXCEPTION_RECORD *rec,
{
XMM_SAVE_AREA32
*
fpu
=
FPU_sig
(
sigcontext
);
TRACE
(
"returning to user mode ip=%016lx ret=%08x
\n
"
,
frame
->
r
et_addr
,
rec
->
ExceptionCode
);
TRACE
(
"returning to user mode ip=%016lx ret=%08x
\n
"
,
frame
->
r
ip
,
rec
->
ExceptionCode
);
RAX_sig
(
sigcontext
)
=
rec
->
ExceptionCode
;
RBX_sig
(
sigcontext
)
=
frame
->
rbx
;
RSI_sig
(
sigcontext
)
=
frame
->
rsi
;
...
...
@@ -2409,7 +2406,7 @@ static BOOL handle_syscall_fault( ucontext_t *sigcontext, EXCEPTION_RECORD *rec,
R13_sig
(
sigcontext
)
=
frame
->
r13
;
R14_sig
(
sigcontext
)
=
frame
->
r14
;
R15_sig
(
sigcontext
)
=
frame
->
r15
;
RSP_sig
(
sigcontext
)
=
(
ULONG_PTR
)
&
frame
->
ret_addr
;
RSP_sig
(
sigcontext
)
=
frame
->
rsp
;
RIP_sig
(
sigcontext
)
=
frame
->
rip
;
if
(
fpu
)
*
fpu
=
get_syscall_xsave
(
frame
)
->
xsave
;
amd64_thread_data
()
->
syscall_frame
=
NULL
;
...
...
tools/winebuild/import.c
View file @
4e5b61bb
...
...
@@ -1527,6 +1527,8 @@ void output_syscalls( DLLSPEC *spec )
output
(
"
\t
subq $0xb,0x8(%%rbp)
\n
"
);
output
(
"
\t
movq 0x8(%%rbp),%%rbx
\n
"
);
output
(
"
\t
movq %%rbx,-0x28(%%rbp)
\n
"
);
output
(
"
\t
leaq 0x10(%%rbp),%%rbx
\n
"
);
output
(
"
\t
movq %%rbx,-0x10(%%rbp)
\n
"
);
output
(
"
\t
fxsave64 (%%rsp)
\n
"
);
output
(
"
\t
movq %%gs:0x30,%%rcx
\n
"
);
output
(
"
\t
leaq -0x98(%%rbp),%%rbx
\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