Rebase against f5bd0be6a44c1c7d69afb8b8eb6311923e7762a1.

This commit is contained in:
Zebediah Figura
2021-06-12 01:46:26 -05:00
parent 08912e4896
commit e3cca687be
11 changed files with 32 additions and 384 deletions

View File

@@ -1,4 +1,4 @@
From 8d1cfce5ceee03b91f9843e7b5123fed823687e7 Mon Sep 17 00:00:00 2001
From 7744cca9f58990ee47b74f4fa967eb99f3dee862 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 caff5d1fe52..d30b437320a 100644
index 8c74532dabc..36d2295c1ca 100644
--- a/configure.ac
+++ b/configure.ac
@@ -467,6 +467,7 @@ AC_CHECK_HEADERS(\
@@ -477,6 +477,7 @@ AC_CHECK_HEADERS(\
linux/joystick.h \
linux/major.h \
linux/param.h \
@@ -22,7 +22,7 @@ index caff5d1fe52..d30b437320a 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 8d3353e959d..a8a142c2ab1 100644
index 4845d3dd5f4..9a80cafeadd 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 8d3353e959d..a8a142c2ab1 100644
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "ntstatus.h"
@@ -2292,6 +2300,114 @@ static inline DWORD is_privileged_instr( CONTEXT *context )
@@ -2075,6 +2083,114 @@ static inline DWORD is_privileged_instr( CONTEXT *context )
return 0;
}
@@ -162,7 +162,7 @@ index 8d3353e959d..a8a142c2ab1 100644
/***********************************************************************
* handle_interrupt
@@ -2751,6 +2867,7 @@ void signal_init_process(void)
@@ -2560,6 +2676,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 8d3353e959d..a8a142c2ab1 100644
error:
diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c
index 0fddbaf6134..901423cc028 100644
index f92c1b89c9c..13e1a3bb929 100644
--- a/tools/winebuild/import.c
+++ b/tools/winebuild/import.c
@@ -1510,6 +1510,7 @@ static void output_syscall_dispatcher( int count, const char *variant )
/* 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" );
@@ -1551,6 +1551,7 @@ static void output_syscall_dispatcher(void)
output( "\tjmp 5b\n" );
break;
case CPU_x86_64:
+ output( "\tsubq $0xf000,%%rax\n" );
output( "\tmovq 0x8(%%rbp),%%rbx\n" );
output( "\tmovq %%rbx,-0x28(%%rbp)\n" );
output( "\tleaq 0x10(%%rbp),%%rbx\n" );
@@ -1779,7 +1780,7 @@ void output_syscalls( DLLSPEC *spec )
output( "\tmovq %%gs:0x30,%%rcx\n" );
output( "\tmovq 0x328(%%rcx),%%rcx\n" ); /* amd64_thread_data()->syscall_frame */
output( "\tmovq %%rax,0x00(%%rcx)\n" );
@@ -1940,7 +1941,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 0fddbaf6134..901423cc028 100644
output( "\t.byte 0x75,0x03\n" ); /* jne 1f */
output( "\t.byte 0x0f,0x05\n" ); /* syscall */
--
2.20.1
2.30.2