Rebase against c6a3072051fb88edd3847c750c2ec852f11870f6.

This commit is contained in:
Zebediah Figura
2021-02-17 20:40:31 -06:00
parent d0873d2c72
commit 2a9a56c4d0
10 changed files with 45 additions and 1039 deletions

View File

@@ -1,4 +1,4 @@
From 375a86a401828569803cde23143b024c72eb9383 Mon Sep 17 00:00:00 2001
From 32242051c19fcd4f4f0ada534ad5a1621df96b45 Mon Sep 17 00:00:00 2001
From: Paul Gofman <pgofman@codeweavers.com>
Date: Tue, 14 Jul 2020 15:00:34 +0300
Subject: [PATCH] ntdll: Support x86_64 syscall emulation.
@@ -10,10 +10,10 @@ Subject: [PATCH] ntdll: Support x86_64 syscall emulation.
3 files changed, 120 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 553b4c3df98e..d3b04ae90a04 100644
index 5e392ff5ed6..d814b6f85d7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -465,6 +465,7 @@ AC_CHECK_HEADERS(\
@@ -466,6 +466,7 @@ AC_CHECK_HEADERS(\
linux/joystick.h \
linux/major.h \
linux/param.h \
@@ -22,7 +22,7 @@ index 553b4c3df98e..d3b04ae90a04 100644
linux/types.h \
linux/ucdrom.h \
diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c
index 925de00545f7..6502a15592b6 100644
index 892d208e43a..bb820eee6e5 100644
--- a/dlls/ntdll/unix/signal_x86_64.c
+++ b/dlls/ntdll/unix/signal_x86_64.c
@@ -28,6 +28,7 @@
@@ -47,7 +47,7 @@ index 925de00545f7..6502a15592b6 100644
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "ntstatus.h"
@@ -2238,6 +2246,114 @@ static inline DWORD is_privileged_instr( CONTEXT *context )
@@ -2320,6 +2328,114 @@ static inline DWORD is_privileged_instr( CONTEXT *context )
return 0;
}
@@ -162,7 +162,7 @@ index 925de00545f7..6502a15592b6 100644
/***********************************************************************
* handle_interrupt
@@ -2725,6 +2841,7 @@ void signal_init_process(void)
@@ -2779,6 +2895,7 @@ void signal_init_process(void)
if (sigaction( SIGSEGV, &sig_act, NULL ) == -1) goto error;
if (sigaction( SIGILL, &sig_act, NULL ) == -1) goto error;
if (sigaction( SIGBUS, &sig_act, NULL ) == -1) goto error;
@@ -171,18 +171,18 @@ index 925de00545f7..6502a15592b6 100644
error:
diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c
index fb5c26da07f9..2c2606b21e56 100644
index 5645d3aa9af..441a3800726 100644
--- a/tools/winebuild/import.c
+++ b/tools/winebuild/import.c
@@ -1524,6 +1524,7 @@ void output_syscalls( DLLSPEC *spec )
@@ -1526,6 +1526,7 @@ void output_syscalls( DLLSPEC *spec )
/* Legends of Runeterra hooks the first system call return instruction, and
* depends on us returning to it. Adjust the return address accordingly. */
output( "\tsubq $0xb,0x8(%%rbp)\n" );
+ output( "\tsubq $0xf000,%%rax\n" );
output( "\tmovq %%rsp,0x328(%%rcx)\n" ); /* amd64_thread_data()->syscall_frame */
output( "\tcmpq $%u,%%rax\n", count );
output( "\tjae 4f\n" );
@@ -1717,7 +1718,7 @@ void output_syscalls( DLLSPEC *spec )
output( "\tmovq 0x8(%%rbp),%%rbx\n" );
output( "\tmovq %%rbx,-0x28(%%rbp)\n" );
output( "\tleaq 0x10(%%rbp),%%rbx\n" );
@@ -1746,7 +1747,7 @@ void output_syscalls( DLLSPEC *spec )
* validate that instruction, we can just put a jmp there instead. */
output( "\t.byte 0x4c,0x8b,0xd1\n" ); /* movq %rcx,%r10 */
output( "\t.byte 0xb8\n" ); /* movl $i,%eax */
@@ -192,5 +192,5 @@ index fb5c26da07f9..2c2606b21e56 100644
output( "\t.byte 0x75,0x03\n" ); /* jne 1f */
output( "\t.byte 0x0f,0x05\n" ); /* syscall */
--
2.29.2
2.20.1