Don't use the full 32 bits of %esp when called from 16-bit code.
This commit is contained in:
parent
b284869039
commit
deaec125ca
|
@ -705,8 +705,7 @@ static void output_import_thunk( FILE *outfile, const char *name, const char *ta
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!strcmp( name, "__wine_call_from_32_regs" ) ||
|
if (!strcmp( name, "__wine_call_from_32_regs" ))
|
||||||
!strcmp( name, "__wine_call_from_16_regs" ))
|
|
||||||
{
|
{
|
||||||
/* special case: need to preserve all registers */
|
/* special case: need to preserve all registers */
|
||||||
fprintf( outfile, " \"\\tpushl %%eax\\n\"\n" );
|
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, " \"\\txchgl %%eax,(%%esp)\\n\"\n" );
|
||||||
fprintf( outfile, " \"\\tret\\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
|
else
|
||||||
{
|
{
|
||||||
fprintf( outfile, " \"\\tcall .L__wine_spec_%s\\n\"\n", name );
|
fprintf( outfile, " \"\\tcall .L__wine_spec_%s\\n\"\n", name );
|
||||||
|
|
Loading…
Reference in New Issue