From: Torge Matthies tmatthies@codeweavers.com
--- dlls/ntdll/unix/signal_x86_64.c | 18 +++++++++++++++++- tools/winebuild/import.c | 9 ++++++++- 2 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c index dfce344adbc..d43ba5b1493 100644 --- a/dlls/ntdll/unix/signal_x86_64.c +++ b/dlls/ntdll/unix/signal_x86_64.c @@ -2736,6 +2736,22 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, "jae 5f\n\t" "movq 24(%rbx),%rcx\n\t" /* table->ArgumentTable */ "movzbl (%rcx,%rax),%ecx\n\t" + "testb $1,%cl\n\t" + "jz 2f\n\t" + "subq $0x10,%rsi\n\t" /* first argument */ + "andq $~7,%rcx\n\t" + "subq $0x20,%rcx\n\t" + "jbe 1f\n\t" + "subq %rcx,%rsp\n\t" + "shrq $3,%rcx\n\t" + "andq $~15,%rsp\n\t" + "movq %rsp,%rdi\n\t" + "cld\n\t" + "rep; movsq\n" + "1:\tmovq %r10,%rcx\n\t" + "subq $0x20,%rsp\n\t" + "jmp 3f\n\t" + "2:\tandq $~7,%rcx\n\t" "subq $0x30,%rcx\n\t" "jbe 1f\n\t" "subq %rcx,%rsp\n\t" @@ -2751,7 +2767,7 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, "movq -0x10(%rbp),%r9\n\t" /* frame->rsp */ "movq 0x28(%r9),%r8\n\t" "movq 0x30(%r9),%r9\n\t" - "movq (%rbx),%r10\n\t" /* table->ServiceTable */ + "3:\tmovq (%rbx),%r10\n\t" /* table->ServiceTable */ "callq *(%r10,%rax,8)\n\t" "leaq -0x98(%rbp),%rcx\n\t" /* $rcx is now pointing to "frame" again */ diff --git a/tools/winebuild/import.c b/tools/winebuild/import.c index ee3c310546b..9462128e5d4 100644 --- a/tools/winebuild/import.c +++ b/tools/winebuild/import.c @@ -1531,7 +1531,14 @@ void output_syscalls( DLLSPEC *spec ) output( "%s\n", asm_globl("__wine_syscall_dispatcher") ); output( "\t%s 0\n", get_asm_ptr_keyword() ); output( "\t.short %u\n", count ); - for (i = 0; i < count; i++) output( "\t.byte %u\n", get_args_size( syscalls[i] )); + for (i = 0; i < count; i++) + { + ORDDEF *odp = syscalls[i]; + int args_size = get_args_size( syscalls[i] ); + if (odp->type == TYPE_CDECL) + args_size |= 1; + output( "\t.byte %u\n", args_size); + } }