Rebase against afd5550b07f6d55e56738f61d829085d6bc82888.

This commit is contained in:
Alistair Leslie-Hughes
2021-06-17 10:06:41 +10:00
parent c933b26cb6
commit 876024f44f
5 changed files with 32 additions and 42 deletions

View File

@@ -1,4 +1,4 @@
From 7744cca9f58990ee47b74f4fa967eb99f3dee862 Mon Sep 17 00:00:00 2001
From 00b8fb5b21f01a3279c108fd15d587dc9b57c799 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,7 +10,7 @@ Subject: [PATCH] ntdll: Support x86_64 syscall emulation.
3 files changed, 120 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 8c74532dabc..36d2295c1ca 100644
index ade04399af0..3dabc0d33d1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -477,6 +477,7 @@ AC_CHECK_HEADERS(\
@@ -22,7 +22,7 @@ index 8c74532dabc..36d2295c1ca 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 4845d3dd5f4..9a80cafeadd 100644
index c36699589d9..e8c3099ae14 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 4845d3dd5f4..9a80cafeadd 100644
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "ntstatus.h"
@@ -2075,6 +2083,114 @@ static inline DWORD is_privileged_instr( CONTEXT *context )
@@ -2107,6 +2115,114 @@ static inline DWORD is_privileged_instr( CONTEXT *context )
return 0;
}
@@ -162,7 +162,7 @@ index 4845d3dd5f4..9a80cafeadd 100644
/***********************************************************************
* handle_interrupt
@@ -2560,6 +2676,7 @@ void signal_init_process(void)
@@ -2623,6 +2739,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 4845d3dd5f4..9a80cafeadd 100644
error:
diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c
index f92c1b89c9c..13e1a3bb929 100644
index a194ae50104..d5ef8fe2ba7 100644
--- a/tools/winebuild/import.c
+++ b/tools/winebuild/import.c
@@ -1551,6 +1551,7 @@ static void output_syscall_dispatcher(void)
output( "\tjmp 5b\n" );
break;
case CPU_x86_64:
@@ -1603,6 +1603,7 @@ static void output_syscall_dispatcher(void)
output( "\tleaq 0x28(%%rsp),%%rsi\n" ); /* first argument */
output( "\tmovq %%rcx,%%rsp\n" );
output( "\tmovq 0x00(%%rcx),%%rax\n" );
+ output( "\tsubq $0xf000,%%rax\n" );
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 )
output( "\tmovq 0x18(%%rcx),%%rdx\n" );
output( "\tmovl %%eax,%%ebx\n" );
output( "\tshrl $8,%%ebx\n" );
@@ -1942,7 +1943,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 */