From: Rémi Bernon rbernon@codeweavers.com
--- dlls/ntdll/unix/signal_i386.c | 13 +++++++------ dlls/ntdll/unix/signal_x86_64.c | 5 +++-- 2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c index a321562c21c..e599ed1898d 100644 --- a/dlls/ntdll/unix/signal_i386.c +++ b/dlls/ntdll/unix/signal_i386.c @@ -2668,9 +2668,11 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, "cld\n\t" "rep; movsl\n\t" "call *(%edx,%eax,4)\n\t" - "leal -0x34(%ebp),%esp\n\t"
"\n.L__wine_syscall_dispatcher_restore:\n\t" + "leal -0x34(%ebp),%esp\n\t" + /* remember state when $ebp is pointing to "frame" */ + __ASM_CFI(".cfi_remember_state\n\t") __ASM_CFI_CFA_IS_AT1(esp, 0x0c) __ASM_CFI_REG_IS_AT1(esp, esp, 0x0c) __ASM_CFI_REG_IS_AT1(eip, esp, 0x08) @@ -2703,8 +2705,6 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, "\n.L__wine_syscall_dispatcher_fpu_restored:\n\t" "andl $~0x80000000,0(%esp)\n\t" /* frame->syscall_flags &= ~SYSCALL_FLAG_NOFPU */ "movl 0x2c(%esp),%edi\n\t" - /* remember state when $esp is pointing to "frame" */ - __ASM_CFI(".cfi_remember_state\n\t") __ASM_CFI(".cfi_same_value %edi\n\t") "movl 0x30(%esp),%esi\n\t" __ASM_CFI(".cfi_same_value %esi\n\t") @@ -2758,14 +2758,14 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, "iret\n\t"
"\n.L__wine_syscall_dispatcher_invalid_arg:\n\t" - /* $esp is now pointing to "frame" again */ + /* $ebp is now pointing to "frame" again */ __ASM_CFI("\t.cfi_restore_state\n\t") "movl $0xc000000d,%eax\n\t" /* STATUS_INVALID_PARAMETER */ "jmp .L__wine_syscall_dispatcher_restore\n\t"
".globl " __ASM_NAME("__wine_syscall_dispatcher_return") "\n" __ASM_NAME("__wine_syscall_dispatcher_return") ":\n\t" - /* remember state when $esp is pointing to "frame" */ + /* remember state when $ebp is pointing to "frame" */ __ASM_CFI(".cfi_remember_state\n\t") __ASM_CFI(".cfi_def_cfa %esp, 4\n\t") __ASM_CFI(".cfi_restore %esp\n\t") @@ -2776,7 +2776,8 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, __ASM_CFI(".cfi_restore %ebp\n\t") "movl 8(%esp),%eax\n\t" "movl 4(%esp),%esp\n\t" - /* $esp is now pointing to "frame" again */ + "leal 0x34(%esp),%ebp\n\t" + /* $ebp is now pointing to "frame" again */ __ASM_CFI(".cfi_restore_state\n\t") "jmp .L__wine_syscall_dispatcher_restore\n\t" )
diff --git a/dlls/ntdll/unix/signal_x86_64.c b/dlls/ntdll/unix/signal_x86_64.c index 9472acdbb26..6b8def37a7d 100644 --- a/dlls/ntdll/unix/signal_x86_64.c +++ b/dlls/ntdll/unix/signal_x86_64.c @@ -2779,11 +2779,11 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, "subq $0x20,%rsp\n\t" "movq (%rbx),%r10\n\t" /* table->ServiceTable */ "callq *(%r10,%rax,8)\n\t" + + "\n.L__wine_syscall_dispatcher_restore:\n\t" "leaq -0x98(%rbp),%rcx\n\t" /* $rcx is now pointing to "frame" again */ __ASM_CFI(".cfi_restore_state\n\t") - - "\n.L__wine_syscall_dispatcher_restore:\n\t" "movl 0x94(%rcx),%edx\n\t" /* frame->restore_flags */ #ifdef __linux__ "testl $4,%r14d\n\t" /* SYSCALL_HAVE_PTHREAD_TEB */ @@ -2883,6 +2883,7 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, __ASM_NAME("__wine_syscall_dispatcher_return") ":\n\t" "movl 0xb0(%rcx),%r14d\n\t" /* frame->syscall_flags */ "movq %rdx,%rax\n\t" + "leaq 0x98(%rcx),%rbp\n\t" "jmp .L__wine_syscall_dispatcher_restore\n\t" )