Commit 8e3b5183 authored by Alexandre Julliard's avatar Alexandre Julliard

winebuild: Store the syscall frame in the thread data on i386.

parent 3ba24075
......@@ -473,6 +473,17 @@ enum i386_trap_code
#endif
};
struct syscall_frame
{
struct syscall_frame *prev_frame;
DWORD edi;
DWORD esi;
DWORD ebx;
DWORD ebp;
DWORD thunk_addr;
DWORD ret_addr;
};
struct x86_thread_data
{
DWORD fs; /* 1d4 TEB selector */
......@@ -484,12 +495,13 @@ struct x86_thread_data
DWORD dr6; /* 1ec */
DWORD dr7; /* 1f0 */
void *exit_frame; /* 1f4 exit frame pointer */
/* the ntdll_thread_data structure follows here */
struct syscall_frame *syscall_frame; /* 1f8 frame pointer on syscall entry */
};
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_frame ) == 0x1f8 );
static inline struct x86_thread_data *x86_thread_data(void)
{
......
......@@ -1446,10 +1446,14 @@ void output_syscalls( DLLSPEC *spec )
output_cfi( ".cfi_rel_offset %%ebp,0\n" );
output( "\tmovl %%esp,%%ebp\n" );
output_cfi( ".cfi_def_cfa_register %%ebp\n" );
output( "\tpushl %%ebx\n" );
output_cfi( ".cfi_rel_offset %%ebx,-4\n" );
output( "\tpushl %%esi\n" );
output_cfi( ".cfi_rel_offset %%esi,-4\n" );
output_cfi( ".cfi_rel_offset %%esi,-8\n" );
output( "\tpushl %%edi\n" );
output_cfi( ".cfi_rel_offset %%edi,-8\n" );
output_cfi( ".cfi_rel_offset %%edi,-12\n" );
output( "\tpushl %%fs:0x1f8\n" ); /* x86_thread_data()->syscall_frame */
output( "\tmovl %%esp,%%fs:0x1f8\n" );
output( "\tcmpl $%u,%%eax\n", count );
output( "\tjae 3f\n" );
if (UsePIC)
......@@ -1471,11 +1475,14 @@ void output_syscalls( DLLSPEC *spec )
output( "\tcall *.Lsyscall_table-1b(%%eax,%%edx,4)\n" );
else
output( "\tcall *.Lsyscall_table(,%%eax,4)\n" );
output( "\tleal -8(%%ebp),%%esp\n" );
output( "2:\tpopl %%edi\n" );
output( "\tleal -16(%%ebp),%%esp\n" );
output( "2:\tpopl %%fs:0x1f8\n" );
output( "\tpopl %%edi\n" );
output_cfi( ".cfi_same_value %%edi\n" );
output( "\tpopl %%esi\n" );
output_cfi( ".cfi_same_value %%esi\n" );
output( "\tpopl %%ebx\n" );
output_cfi( ".cfi_same_value %%ebx\n" );
output( "\tpopl %%ebp\n" );
output_cfi( ".cfi_def_cfa %%esp,4\n" );
output_cfi( ".cfi_same_value %%ebp\n" );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment