Commit 22d2c527 authored by Ulrich Weigand's avatar Ulrich Weigand Committed by Alexandre Julliard

Bugfix: Reverted CallTo16 routines to STDCALL convention.

parent aec373ca
...@@ -20,53 +20,53 @@ extern int (*IF1632_CallLargeStack)( int (*func)(void), void *arg ); ...@@ -20,53 +20,53 @@ extern int (*IF1632_CallLargeStack)( int (*func)(void), void *arg );
typedef struct typedef struct
{ {
LONG (*CallRegisterShortProc)( CONTEXT86 *, INT ); LONG (CALLBACK *CallRegisterShortProc)( CONTEXT86 *, INT );
LONG (*CallRegisterLongProc)( CONTEXT86 *, INT ); LONG (CALLBACK *CallRegisterLongProc)( CONTEXT86 *, INT );
VOID (*CallFrom16WndProc)(void); VOID (CALLBACK *CallFrom16WndProc)(void);
LRESULT (*CallWndProc)( WNDPROC16, HWND16, UINT16, LRESULT (CALLBACK *CallWndProc)( WNDPROC16, HWND16, UINT16,
WPARAM16, LPARAM ); WPARAM16, LPARAM );
LRESULT (*CallDriverProc)( DRIVERPROC16, DWORD, HDRVR16, LRESULT (CALLBACK *CallDriverProc)( DRIVERPROC16, DWORD, HDRVR16,
UINT16, LPARAM, LPARAM ); UINT16, LPARAM, LPARAM );
LRESULT (*CallDriverCallback)( FARPROC16, HANDLE16, UINT16, LRESULT (CALLBACK *CallDriverCallback)( FARPROC16, HANDLE16, UINT16,
DWORD, LPARAM, LPARAM ); DWORD, LPARAM, LPARAM );
LRESULT (*CallTimeFuncProc)( FARPROC16, WORD, UINT16, LRESULT (CALLBACK *CallTimeFuncProc)( FARPROC16, WORD, UINT16,
DWORD, LPARAM, LPARAM ); DWORD, LPARAM, LPARAM );
INT16 (*CallWindowsExitProc)( FARPROC16, INT16 ); INT16 (CALLBACK *CallWindowsExitProc)( FARPROC16, INT16 );
INT16 (*CallWordBreakProc)( EDITWORDBREAKPROC16, SEGPTR, INT16, INT16 (CALLBACK *CallWordBreakProc)( EDITWORDBREAKPROC16, SEGPTR, INT16,
INT16, INT16 ); INT16, INT16 );
VOID (*CallBootAppProc)( FARPROC16, HANDLE16, HFILE16 ); VOID (CALLBACK *CallBootAppProc)( FARPROC16, HANDLE16, HFILE16 );
WORD (*CallLoadAppSegProc)( FARPROC16, HANDLE16, HFILE16, WORD ); WORD (CALLBACK *CallLoadAppSegProc)( FARPROC16, HANDLE16, HFILE16, WORD );
WORD (*CallLocalNotifyFunc)( FARPROC16, WORD, HLOCAL16, WORD ); WORD (CALLBACK *CallLocalNotifyFunc)( FARPROC16, WORD, HLOCAL16, WORD );
HGLOBAL16 (*CallResourceHandlerProc)( FARPROC16, HGLOBAL16, HMODULE16, HRSRC16 ); HGLOBAL16 (CALLBACK *CallResourceHandlerProc)( FARPROC16, HGLOBAL16, HMODULE16, HRSRC16 );
DWORD (*CallWOWCallbackProc)( FARPROC16, DWORD ); DWORD (CALLBACK *CallWOWCallbackProc)( FARPROC16, DWORD );
BOOL (*CallWOWCallback16Ex)( FARPROC16, DWORD, DWORD, LPVOID, BOOL (CALLBACK *CallWOWCallback16Ex)( FARPROC16, DWORD, DWORD, LPVOID,
LPDWORD ); LPDWORD );
DWORD (*CallUTProc)( FARPROC16, DWORD, DWORD ); DWORD (CALLBACK *CallUTProc)( FARPROC16, DWORD, DWORD );
LRESULT (*CallASPIPostProc)( FARPROC16, SEGPTR ); LRESULT (CALLBACK *CallASPIPostProc)( FARPROC16, SEGPTR );
/* Following are the graphics driver callbacks */ /* Following are the graphics driver callbacks */
WORD (*CallDrvControlProc)( FARPROC16, SEGPTR, WORD, WORD (CALLBACK *CallDrvControlProc)( FARPROC16, SEGPTR, WORD,
SEGPTR, SEGPTR ); SEGPTR, SEGPTR );
WORD (*CallDrvEnableProc)( FARPROC16, SEGPTR, WORD, SEGPTR, WORD (CALLBACK *CallDrvEnableProc)( FARPROC16, SEGPTR, WORD, SEGPTR,
SEGPTR, SEGPTR ); SEGPTR, SEGPTR );
WORD (*CallDrvEnumDFontsProc)( FARPROC16, SEGPTR, SEGPTR, WORD (CALLBACK *CallDrvEnumDFontsProc)( FARPROC16, SEGPTR, SEGPTR,
FARPROC16, SEGPTR ); FARPROC16, SEGPTR );
WORD (*CallDrvEnumObjProc)( FARPROC16, SEGPTR, WORD, FARPROC16, WORD (CALLBACK *CallDrvEnumObjProc)( FARPROC16, SEGPTR, WORD, FARPROC16,
SEGPTR ); SEGPTR );
WORD (*CallDrvOutputProc)( FARPROC16, SEGPTR, WORD, WORD, SEGPTR, WORD (CALLBACK *CallDrvOutputProc)( FARPROC16, SEGPTR, WORD, WORD, SEGPTR,
SEGPTR, SEGPTR, SEGPTR, SEGPTR ); SEGPTR, SEGPTR, SEGPTR, SEGPTR );
DWORD (*CallDrvRealizeProc)( FARPROC16, SEGPTR, WORD, SEGPTR, DWORD (CALLBACK *CallDrvRealizeProc)( FARPROC16, SEGPTR, WORD, SEGPTR,
SEGPTR, SEGPTR ); SEGPTR, SEGPTR );
WORD (*CallDrvStretchBltProc)( FARPROC16, SEGPTR, WORD, WORD, WORD (CALLBACK *CallDrvStretchBltProc)( FARPROC16, SEGPTR, WORD, WORD,
WORD, WORD, SEGPTR, WORD, WORD, WORD, WORD, SEGPTR, WORD, WORD,
WORD, WORD, DWORD, SEGPTR, SEGPTR, WORD, WORD, DWORD, SEGPTR, SEGPTR,
SEGPTR ); SEGPTR );
DWORD (*CallDrvExtTextOutProc)( FARPROC16, SEGPTR, WORD, WORD, DWORD (CALLBACK *CallDrvExtTextOutProc)( FARPROC16, SEGPTR, WORD, WORD,
SEGPTR, SEGPTR, INT16, SEGPTR, SEGPTR, SEGPTR, INT16, SEGPTR,
SEGPTR, SEGPTR, SEGPTR, SEGPTR, SEGPTR, SEGPTR, SEGPTR, SEGPTR,
WORD ); WORD );
WORD (*CallDrvGetCharWidthProc)( FARPROC16, SEGPTR, SEGPTR, WORD, WORD (CALLBACK *CallDrvGetCharWidthProc)( FARPROC16, SEGPTR, SEGPTR, WORD,
WORD, SEGPTR, SEGPTR, SEGPTR ); WORD, SEGPTR, SEGPTR, SEGPTR );
BOOL16 (*CallDrvAbortProc)( FARPROC16, HDC16, INT16 ); BOOL16 (CALLBACK *CallDrvAbortProc)( FARPROC16, HDC16, INT16 );
} CALLBACKS_TABLE; } CALLBACKS_TABLE;
extern const CALLBACKS_TABLE *Callbacks; extern const CALLBACKS_TABLE *Callbacks;
......
...@@ -24,8 +24,9 @@ typedef struct _STACK32FRAME ...@@ -24,8 +24,9 @@ typedef struct _STACK32FRAME
DWORD ecx; /* 18 */ DWORD ecx; /* 18 */
DWORD ebx; /* 1c */ DWORD ebx; /* 1c */
DWORD ebp; /* 20 saved 32-bit frame pointer */ DWORD ebp; /* 20 saved 32-bit frame pointer */
DWORD retaddr; /* 24 actual return address */ DWORD relay; /* 24 return address to relay stub */
DWORD args[1]; /* 28 arguments to 16-bit function */ DWORD retaddr; /* 28 actual return address */
DWORD args[1]; /* 2c arguments to 16-bit function */
} STACK32FRAME; } STACK32FRAME;
/* 16-bit stack layout after CallFrom16() */ /* 16-bit stack layout after CallFrom16() */
......
...@@ -21,7 +21,7 @@ DEFAULT_DEBUG_CHANNEL(relay) ...@@ -21,7 +21,7 @@ DEFAULT_DEBUG_CHANNEL(relay)
/********************************************************************** /**********************************************************************
* CALLBACK_CallWndProc * CALLBACK_CallWndProc
*/ */
static LRESULT CALLBACK_CallWndProc( WNDPROC16 proc, HWND16 hwnd, static LRESULT WINAPI CALLBACK_CallWndProc( WNDPROC16 proc, HWND16 hwnd,
UINT16 msg, WPARAM16 wParam, UINT16 msg, WPARAM16 wParam,
LPARAM lParam ) LPARAM lParam )
{ {
...@@ -39,7 +39,7 @@ static LRESULT CALLBACK_CallWndProc( WNDPROC16 proc, HWND16 hwnd, ...@@ -39,7 +39,7 @@ static LRESULT CALLBACK_CallWndProc( WNDPROC16 proc, HWND16 hwnd,
/********************************************************************** /**********************************************************************
* CALLBACK_CallRegisterProc * CALLBACK_CallRegisterProc
*/ */
static LONG CALLBACK_CallRegisterProc( CONTEXT86 *context, INT offset) static LONG WINAPI CALLBACK_CallRegisterProc( CONTEXT86 *context, INT offset)
{ {
ERR("Cannot call a register proc in Winelib\n" ); ERR("Cannot call a register proc in Winelib\n" );
assert( FALSE ); assert( FALSE );
...@@ -49,9 +49,9 @@ static LONG CALLBACK_CallRegisterProc( CONTEXT86 *context, INT offset) ...@@ -49,9 +49,9 @@ static LONG CALLBACK_CallRegisterProc( CONTEXT86 *context, INT offset)
/********************************************************************** /**********************************************************************
* CALLBACK_CallDriverProc * CALLBACK_CallDriverProc
*/ */
static LRESULT CALLBACK_CallDriverProc( DRIVERPROC16 proc, DWORD dwId, static LRESULT WINAPI CALLBACK_CallDriverProc( DRIVERPROC16 proc, DWORD dwId,
HDRVR16 hdrvr, UINT16 msg, HDRVR16 hdrvr, UINT16 msg,
LPARAM lp1, LPARAM lp2 ) LPARAM lp1, LPARAM lp2 )
{ {
ERR("Cannot call a 16-bit driver proc in Winelib\n" ); ERR("Cannot call a 16-bit driver proc in Winelib\n" );
assert( FALSE ); assert( FALSE );
...@@ -61,10 +61,10 @@ static LRESULT CALLBACK_CallDriverProc( DRIVERPROC16 proc, DWORD dwId, ...@@ -61,10 +61,10 @@ static LRESULT CALLBACK_CallDriverProc( DRIVERPROC16 proc, DWORD dwId,
/********************************************************************** /**********************************************************************
* CALLBACK_CallDriverCallback * CALLBACK_CallDriverCallback
*/ */
static LRESULT CALLBACK_CallDriverCallback( FARPROC16 proc, static LRESULT WINAPI CALLBACK_CallDriverCallback( FARPROC16 proc,
HANDLE16 hDev, UINT16 msg, HANDLE16 hDev, UINT16 msg,
DWORD dwUser, LPARAM lp1, DWORD dwUser, LPARAM lp1,
LPARAM lp2 ) LPARAM lp2 )
{ {
ERR("Cannot call a 16-bit driver proc in Winelib\n" ); ERR("Cannot call a 16-bit driver proc in Winelib\n" );
assert( FALSE ); assert( FALSE );
...@@ -74,35 +74,41 @@ static LRESULT CALLBACK_CallDriverCallback( FARPROC16 proc, ...@@ -74,35 +74,41 @@ static LRESULT CALLBACK_CallDriverCallback( FARPROC16 proc,
/********************************************************************** /**********************************************************************
* CALLBACK_CallTimeFuncProc * CALLBACK_CallTimeFuncProc
*/ */
static LRESULT CALLBACK_CallTimeFuncProc( FARPROC16 proc, WORD id, static LRESULT WINAPI CALLBACK_CallTimeFuncProc( FARPROC16 proc, WORD id,
UINT16 msg, DWORD dwUser, UINT16 msg, DWORD dwUser,
LPARAM lp1, LPARAM lp2 ) LPARAM lp1, LPARAM lp2 )
{ {
return proc( id, msg, dwUser, lp1, lp2 ); ERR("Cannot call a 16-bit multimedia timer proc in Winelib\n" );
assert( FALSE );
return 0;
} }
/********************************************************************** /**********************************************************************
* CALLBACK_CallWindowsExitProc * CALLBACK_CallWindowsExitProc
*/ */
static INT16 CALLBACK_CallWindowsExitProc( FARPROC16 proc, INT16 type) static INT16 WINAPI CALLBACK_CallWindowsExitProc( FARPROC16 proc, INT16 type)
{ {
return proc( type ); ERR("Cannot call a 16-bit WEP routine in Winelib\n" );
assert( FALSE );
return 0;
} }
/********************************************************************** /**********************************************************************
* CALLBACK_CallWordBreakProc * CALLBACK_CallWordBreakProc
*/ */
static INT16 CALLBACK_CallWordBreakProc( EDITWORDBREAKPROC16 proc, static INT16 WINAPI CALLBACK_CallWordBreakProc( EDITWORDBREAKPROC16 proc,
SEGPTR text, INT16 word, SEGPTR text, INT16 word,
INT16 len, INT16 action ) INT16 len, INT16 action )
{ {
return proc( (LPSTR)text, word, len, action ); ERR("Cannot call a 16-bit word break proc in Winelib\n" );
assert( FALSE );
return 0;
} }
/********************************************************************** /**********************************************************************
* CALLBACK_CallBootAppProc * CALLBACK_CallBootAppProc
*/ */
static void CALLBACK_CallBootAppProc( FARPROC16 proc, HANDLE16 module, static void WINAPI CALLBACK_CallBootAppProc( FARPROC16 proc, HANDLE16 module,
HFILE16 file ) HFILE16 file )
{ {
ERR("Cannot call a 16-bit self-load handler in Winelib\n" ); ERR("Cannot call a 16-bit self-load handler in Winelib\n" );
...@@ -113,7 +119,7 @@ static void CALLBACK_CallBootAppProc( FARPROC16 proc, HANDLE16 module, ...@@ -113,7 +119,7 @@ static void CALLBACK_CallBootAppProc( FARPROC16 proc, HANDLE16 module,
/********************************************************************** /**********************************************************************
* CALLBACK_CallLoadAppSegProc * CALLBACK_CallLoadAppSegProc
*/ */
static WORD CALLBACK_CallLoadAppSegProc( FARPROC16 proc, static WORD WINAPI CALLBACK_CallLoadAppSegProc( FARPROC16 proc,
HANDLE16 module, HFILE16 file, HANDLE16 module, HFILE16 file,
WORD seg ) WORD seg )
{ {
...@@ -125,8 +131,8 @@ static WORD CALLBACK_CallLoadAppSegProc( FARPROC16 proc, ...@@ -125,8 +131,8 @@ static WORD CALLBACK_CallLoadAppSegProc( FARPROC16 proc,
/********************************************************************** /**********************************************************************
* CALLBACK_CallLocalNotifyFunc * CALLBACK_CallLocalNotifyFunc
*/ */
static WORD CALLBACK_CallLocalNotifyFunc( FARPROC16 proc, static WORD WINAPI CALLBACK_CallLocalNotifyFunc( FARPROC16 proc,
WORD wMsg, HLOCAL16 hMem, WORD wArg ) WORD wMsg, HLOCAL16 hMem, WORD wArg )
{ {
ERR("Cannot call a 16-bit notification handler in Winelib\n" ); ERR("Cannot call a 16-bit notification handler in Winelib\n" );
assert( FALSE ); assert( FALSE );
...@@ -136,10 +142,10 @@ static WORD CALLBACK_CallLocalNotifyFunc( FARPROC16 proc, ...@@ -136,10 +142,10 @@ static WORD CALLBACK_CallLocalNotifyFunc( FARPROC16 proc,
/********************************************************************** /**********************************************************************
* CALLBACK_CallResourceHandlerProc * CALLBACK_CallResourceHandlerProc
*/ */
static HGLOBAL16 CALLBACK_CallResourceHandlerProc( FARPROC16 proc, static HGLOBAL16 WINAPI CALLBACK_CallResourceHandlerProc( FARPROC16 proc,
HGLOBAL16 hMemObj, HGLOBAL16 hMemObj,
HMODULE16 hModule, HMODULE16 hModule,
HRSRC16 hRsrc ) HRSRC16 hRsrc )
{ {
ERR("Cannot call a 16-bit resource handler in Winelib\n" ); ERR("Cannot call a 16-bit resource handler in Winelib\n" );
assert( FALSE ); assert( FALSE );
...@@ -149,15 +155,17 @@ static HGLOBAL16 CALLBACK_CallResourceHandlerProc( FARPROC16 proc, ...@@ -149,15 +155,17 @@ static HGLOBAL16 CALLBACK_CallResourceHandlerProc( FARPROC16 proc,
/********************************************************************** /**********************************************************************
* CALLBACK_CallASPIPostProc * CALLBACK_CallASPIPostProc
*/ */
static LRESULT CALLBACK_CallASPIPostProc( FARPROC16 proc, SEGPTR ptr ) static LRESULT WINAPI CALLBACK_CallASPIPostProc( FARPROC16 proc, SEGPTR ptr )
{ {
return proc( ptr ); ERR("Cannot call a 16-bit ASPI proc in Winelib\n" );
assert( FALSE );
return 0;
} }
/********************************************************************** /**********************************************************************
* CALLBACK_CallWOWCallbackProc * CALLBACK_CallWOWCallbackProc
*/ */
static DWORD CALLBACK_CallWOWCallbackProc( FARPROC16 proc, DWORD dw ) static DWORD WINAPI CALLBACK_CallWOWCallbackProc( FARPROC16 proc, DWORD dw )
{ {
ERR("Cannot call a WOW thunk proc in Winelib\n" ); ERR("Cannot call a WOW thunk proc in Winelib\n" );
assert( FALSE ); assert( FALSE );
...@@ -167,8 +175,8 @@ static DWORD CALLBACK_CallWOWCallbackProc( FARPROC16 proc, DWORD dw ) ...@@ -167,8 +175,8 @@ static DWORD CALLBACK_CallWOWCallbackProc( FARPROC16 proc, DWORD dw )
/********************************************************************** /**********************************************************************
* CALLBACK_CallWOWCallback16Ex * CALLBACK_CallWOWCallback16Ex
*/ */
static BOOL CALLBACK_CallWOWCallback16Ex( FARPROC16 proc, DWORD dwFlags, static BOOL WINAPI CALLBACK_CallWOWCallback16Ex( FARPROC16 proc, DWORD dwFlags,
DWORD cbArgs, LPVOID xargs, LPDWORD pdwret ) DWORD cbArgs, LPVOID xargs, LPDWORD pdwret )
{ {
ERR("Cannot call a WOW thunk proc in Winelib\n" ); ERR("Cannot call a WOW thunk proc in Winelib\n" );
assert( FALSE ); assert( FALSE );
...@@ -178,7 +186,7 @@ static BOOL CALLBACK_CallWOWCallback16Ex( FARPROC16 proc, DWORD dwFlags, ...@@ -178,7 +186,7 @@ static BOOL CALLBACK_CallWOWCallback16Ex( FARPROC16 proc, DWORD dwFlags,
/********************************************************************** /**********************************************************************
* CALLBACK_CallUTProc * CALLBACK_CallUTProc
*/ */
static DWORD CALLBACK_CallUTProc( FARPROC16 proc, DWORD w1, DWORD w2 ) static DWORD WINAPI CALLBACK_CallUTProc( FARPROC16 proc, DWORD w1, DWORD w2 )
{ {
ERR("Cannot call a UT thunk proc in Winelib\n" ); ERR("Cannot call a UT thunk proc in Winelib\n" );
assert( FALSE ); assert( FALSE );
......
...@@ -1741,6 +1741,19 @@ static void BuildCallTo16Func( FILE *outfile, char *profile, char *prefix ) ...@@ -1741,6 +1741,19 @@ static void BuildCallTo16Func( FILE *outfile, char *profile, char *prefix )
else else
fprintf( outfile, "\tcall " PREFIX "CallTo16Long\n" ); fprintf( outfile, "\tcall " PREFIX "CallTo16Long\n" );
/* Return to caller (using STDCALL calling convention) */
if ( strlen( args ) > 0 )
fprintf( outfile, "\tret $%d\n", strlen( args ) * 4 );
else
{
fprintf( outfile, "\tret\n" );
/* Note: the arg transfer routine must start exactly three bytes
after the return stub, hence the nop's */
fprintf( outfile, "\tnop\n" );
fprintf( outfile, "\tnop\n" );
}
/* /*
* The core routine will call here with registers set up as follows: * The core routine will call here with registers set up as follows:
* *
...@@ -2146,8 +2159,8 @@ static void BuildCallFrom16Core( FILE *outfile, int reg_func, int thunk ) ...@@ -2146,8 +2159,8 @@ static void BuildCallFrom16Core( FILE *outfile, int reg_func, int thunk )
* CallTo16Word and CallTo16Long are used by the 32->16 glue code * CallTo16Word and CallTo16Long are used by the 32->16 glue code
* as described above. The register functions can be called directly: * as described above. The register functions can be called directly:
* *
* extern void CallTo16RegisterShort( const CONTEXT86 *context, int nb_args ); * extern void CALLBACK CallTo16RegisterShort( const CONTEXT86 *context, int nb_args );
* extern void CallTo16RegisterLong ( const CONTEXT86 *context, int nb_args ); * extern void CALLBACK CallTo16RegisterLong ( const CONTEXT86 *context, int nb_args );
* *
* They call to 16-bit code with all registers except SS:SP set up as specified * They call to 16-bit code with all registers except SS:SP set up as specified
* by the 'context' structure, and SS:SP set to point to the current 16-bit * by the 'context' structure, and SS:SP set to point to the current 16-bit
...@@ -2169,9 +2182,9 @@ static void BuildCallTo16Core( FILE *outfile, int short_ret, int reg_func ) ...@@ -2169,9 +2182,9 @@ static void BuildCallTo16Core( FILE *outfile, int short_ret, int reg_func )
fprintf( outfile, "\t.globl " PREFIX "CallTo16%s\n", name ); fprintf( outfile, "\t.globl " PREFIX "CallTo16%s\n", name );
fprintf( outfile, PREFIX "CallTo16%s:\n", name ); fprintf( outfile, PREFIX "CallTo16%s:\n", name );
/* Retrieve relay target address */ /* No relay stub for 'register' functions */
if ( !reg_func ) if ( reg_func )
fprintf( outfile, "\tpopl %%eax\n" ); fprintf( outfile, "\tpushl $0\n" );
/* Function entry sequence */ /* Function entry sequence */
fprintf( outfile, "\tpushl %%ebp\n" ); fprintf( outfile, "\tpushl %%ebp\n" );
...@@ -2195,7 +2208,10 @@ static void BuildCallTo16Core( FILE *outfile, int short_ret, int reg_func ) ...@@ -2195,7 +2208,10 @@ static void BuildCallTo16Core( FILE *outfile, int short_ret, int reg_func )
/* Move relay target address to %edi */ /* Move relay target address to %edi */
if ( !reg_func ) if ( !reg_func )
fprintf( outfile, "\tmovl %%eax, %%edi\n" ); {
fprintf( outfile, "\tmovl 4(%%ebp), %%edi\n" );
fprintf( outfile, "\taddl $3, %%edi\n" );
}
/* Enter Win16 Mutex */ /* Enter Win16 Mutex */
if ( UsePIC ) if ( UsePIC )
...@@ -2210,10 +2226,10 @@ static void BuildCallTo16Core( FILE *outfile, int short_ret, int reg_func ) ...@@ -2210,10 +2226,10 @@ static void BuildCallTo16Core( FILE *outfile, int short_ret, int reg_func )
if ( reg_func ) if ( reg_func )
fprintf( outfile, "\tpushl $-1\n" ); fprintf( outfile, "\tpushl $-1\n" );
else else
fprintf( outfile, "\tpushl -9(%%edi)\n" ); fprintf( outfile, "\tpushl -12(%%edi)\n" );
/* Push the address of the first argument */ /* Push the address of the first argument */
fprintf( outfile, "\tleal 8(%%ebp),%%eax\n" ); fprintf( outfile, "\tleal 12(%%ebp),%%eax\n" );
fprintf( outfile, "\tpushl %%eax\n" ); fprintf( outfile, "\tpushl %%eax\n" );
if ( UsePIC ) if ( UsePIC )
...@@ -2286,7 +2302,14 @@ static void BuildCallTo16Core( FILE *outfile, int short_ret, int reg_func ) ...@@ -2286,7 +2302,14 @@ static void BuildCallTo16Core( FILE *outfile, int short_ret, int reg_func )
/* Function exit sequence */ /* Function exit sequence */
fprintf( outfile, "\tpopl %%ebp\n" ); fprintf( outfile, "\tpopl %%ebp\n" );
fprintf( outfile, "\tret\n" );
if ( !reg_func )
fprintf( outfile, "\tret\n" ); /* return to relay return stub */
else
{
fprintf( outfile, "\taddl $4, %%esp\n" );
fprintf( outfile, "\tret $8\n" );
}
/* Start of the actual CallTo16 routine */ /* Start of the actual CallTo16 routine */
......
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