Module: wine Branch: master Commit: a50df817af8d6fdee679335ffe394781679d52c1 URL: https://gitlab.winehq.org/wine/wine/-/commit/a50df817af8d6fdee679335ffe39478...
Author: Alexandre Julliard julliard@winehq.org Date: Mon Nov 20 14:00:22 2023 +0100
ntdll: Get rid of the thread exit frame on i386.
---
dlls/ntdll/unix/signal_i386.c | 33 +++++---------------------------- 1 file changed, 5 insertions(+), 28 deletions(-)
diff --git a/dlls/ntdll/unix/signal_i386.c b/dlls/ntdll/unix/signal_i386.c index 57a525aaf97..a1454d8d291 100644 --- a/dlls/ntdll/unix/signal_i386.c +++ b/dlls/ntdll/unix/signal_i386.c @@ -480,16 +480,14 @@ struct x86_thread_data UINT dr3; /* 1e8 */ UINT dr6; /* 1ec */ UINT dr7; /* 1f0 */ - void *exit_frame; /* 1f4 exit frame pointer */ + SYSTEM_SERVICE_TABLE *syscall_table; /* 1f4 syscall table */ struct syscall_frame *syscall_frame; /* 1f8 frame pointer on syscall entry */ - SYSTEM_SERVICE_TABLE *syscall_table; /* 1fc syscall table */ };
C_ASSERT( sizeof(struct x86_thread_data) <= sizeof(((struct ntdll_thread_data *)0)->cpu_data) ); C_ASSERT( offsetof( TEB, GdiTebBatch ) + offsetof( struct x86_thread_data, gs ) == 0x1d8 ); -C_ASSERT( offsetof( TEB, GdiTebBatch ) + offsetof( struct x86_thread_data, exit_frame ) == 0x1f4 ); +C_ASSERT( offsetof( TEB, GdiTebBatch ) + offsetof( struct x86_thread_data, syscall_table ) == 0x1f4 ); C_ASSERT( offsetof( TEB, GdiTebBatch ) + offsetof( struct x86_thread_data, syscall_frame ) == 0x1f8 ); -C_ASSERT( offsetof( TEB, GdiTebBatch ) + offsetof( struct x86_thread_data, syscall_table ) == 0x1fc );
/* flags to control the behavior of the syscall dispatcher */ #define SYSCALL_HAVE_XSAVE 1 @@ -2508,10 +2506,8 @@ __ASM_GLOBAL_FUNC( signal_start_thread, "pushl %edi\n\t" __ASM_CFI(".cfi_rel_offset %edi,-12\n\t") "leal 8(%ebp),%edx\n\t" /* syscall_cfa */ - /* store exit frame */ - "movl 20(%ebp),%ecx\n\t" /* teb */ - "movl %ebp,0x1f4(%ecx)\n\t" /* x86_thread_data()->exit_frame */ /* set syscall frame */ + "movl 20(%ebp),%ecx\n\t" /* teb */ "movl 0x1f8(%ecx),%eax\n\t" /* x86_thread_data()->syscall_frame */ "orl %eax,%eax\n\t" "jnz 1f\n\t" @@ -2532,26 +2528,7 @@ __ASM_GLOBAL_FUNC( signal_start_thread, /*********************************************************************** * signal_exit_thread */ -__ASM_GLOBAL_FUNC( signal_exit_thread, - "movl 8(%esp),%ecx\n\t" - "movl 12(%esp),%esi\n\t" - "xorl %edx,%edx\n\t" - /* fetch exit frame */ - "xchgl %edx,0x1f4(%esi)\n\t" /* x86_thread_data()->exit_frame */ - "testl %edx,%edx\n\t" - "jnz 1f\n\t" - "jmp *%ecx\n\t" - /* switch to exit frame stack */ - "1:\tmovl 4(%esp),%eax\n\t" - "movl %edx,%ebp\n\t" - __ASM_CFI(".cfi_def_cfa %ebp,4\n\t") - __ASM_CFI(".cfi_rel_offset %ebp,0\n\t") - __ASM_CFI(".cfi_rel_offset %ebx,-4\n\t") - __ASM_CFI(".cfi_rel_offset %esi,-8\n\t") - __ASM_CFI(".cfi_rel_offset %edi,-12\n\t") - "leal -20(%ebp),%esp\n\t" - "pushl %eax\n\t" - "call *%ecx" ) +__ASM_GLOBAL_FUNC( signal_exit_thread, "jmp *8(%esp)" )
/*********************************************************************** @@ -2597,7 +2574,7 @@ __ASM_GLOBAL_FUNC( __wine_syscall_dispatcher, "movl %eax,%ebx\n\t" "shrl $8,%ebx\n\t" "andl $0x30,%ebx\n\t" /* syscall table number */ - "addl %fs:0x1fc,%ebx\n\t" /* x86_thread_data()->syscall_table */ + "addl %fs:0x1f4,%ebx\n\t" /* x86_thread_data()->syscall_table */ "testl $3,(%ecx)\n\t" /* frame->syscall_flags & (SYSCALL_HAVE_XSAVE | SYSCALL_HAVE_XSAVEC) */ "jz 2f\n\t" "movl $7,%eax\n\t"