Commit deaec125 authored by Alexandre Julliard's avatar Alexandre Julliard

Don't use the full 32 bits of %esp when called from 16-bit code.

parent b2848690
......@@ -705,8 +705,7 @@ static void output_import_thunk( FILE *outfile, const char *name, const char *ta
}
else
{
if (!strcmp( name, "__wine_call_from_32_regs" ) ||
!strcmp( name, "__wine_call_from_16_regs" ))
if (!strcmp( name, "__wine_call_from_32_regs" ))
{
/* special case: need to preserve all registers */
fprintf( outfile, " \"\\tpushl %%eax\\n\"\n" );
......@@ -720,6 +719,23 @@ static void output_import_thunk( FILE *outfile, const char *name, const char *ta
fprintf( outfile, " \"\\txchgl %%eax,(%%esp)\\n\"\n" );
fprintf( outfile, " \"\\tret\\n\"\n" );
}
else if (!strcmp( name, "__wine_call_from_16_regs" ))
{
/* special case: need to preserve all registers */
fprintf( outfile, " \"\\tpushl %%eax\\n\"\n" );
fprintf( outfile, " \"\\tpushl %%ecx\\n\"\n" );
fprintf( outfile, " \"\\tcall .L__wine_spec_%s\\n\"\n", name );
fprintf( outfile, " \".L__wine_spec_%s:\\n\"\n", name );
fprintf( outfile, " \"\\tpopl %%eax\\n\"\n" );
fprintf( outfile, " \"\\t.byte 0x2e\\n\"\n" );
fprintf( outfile, " \"\\tmovl %s+%d-.L__wine_spec_%s(%%eax),%%eax\\n\"\n",
asm_name(table), pos, name );
fprintf( outfile, " \"\\tmovzwl %%sp, %%ecx\\n\"\n" );
fprintf( outfile, " \"\\t.byte 0x36\\n\"\n" );
fprintf( outfile, " \"\\txchgl %%eax,4(%%ecx)\\n\"\n" );
fprintf( outfile, " \"\\tpopl %%ecx\\n\"\n" );
fprintf( outfile, " \"\\tret\\n\"\n" );
}
else
{
fprintf( outfile, " \"\\tcall .L__wine_spec_%s\\n\"\n", name );
......
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