ntdll: Change the DEFINE_REGS_ENTRYPOINT macro to use a number of args instead of a size.

Also assume that all register functions are stdcall.
This commit is contained in:
Alexandre Julliard 2009-01-06 12:49:18 +01:00
parent bddf5e76ea
commit 4986f42b9f
4 changed files with 10 additions and 12 deletions

View File

@ -401,7 +401,7 @@ void WINAPI __regs_RtlCaptureContext( CONTEXT *context_out, CONTEXT *context_in
/**********************************************************************/
#ifdef DEFINE_REGS_ENTRYPOINT
DEFINE_REGS_ENTRYPOINT( RtlCaptureContext, 4, 4 )
DEFINE_REGS_ENTRYPOINT( RtlCaptureContext, 1 )
#else
void WINAPI RtlCaptureContext( CONTEXT *context_out )
{
@ -430,7 +430,7 @@ void WINAPI __regs_RtlRaiseException( EXCEPTION_RECORD *rec, CONTEXT *context )
/**********************************************************************/
#ifdef DEFINE_REGS_ENTRYPOINT
DEFINE_REGS_ENTRYPOINT( RtlRaiseException, 4, 4 )
DEFINE_REGS_ENTRYPOINT( RtlRaiseException, 1 )
#else
void WINAPI RtlRaiseException( EXCEPTION_RECORD *rec )
{
@ -522,7 +522,7 @@ void WINAPI __regs_RtlUnwind( EXCEPTION_REGISTRATION_RECORD* pEndFrame, PVOID un
/**********************************************************************/
#ifdef DEFINE_REGS_ENTRYPOINT
DEFINE_REGS_ENTRYPOINT( RtlUnwind, 16, 16 )
DEFINE_REGS_ENTRYPOINT( RtlUnwind, 4 )
#else
void WINAPI RtlUnwind( PVOID pEndFrame, PVOID unusedEip,
PEXCEPTION_RECORD pRecord, PVOID returnEax )

View File

@ -217,12 +217,12 @@ static inline struct ntdll_thread_regs *ntdll_get_thread_regs(void)
/* Register functions */
#ifdef __i386__
#define DEFINE_REGS_ENTRYPOINT( name, args, pop_args ) \
#define DEFINE_REGS_ENTRYPOINT( name, args ) \
__ASM_GLOBAL_FUNC( name, \
"pushl %eax\n\t" \
"call " __ASM_NAME("__wine_call_from_32_regs") "\n\t" \
".long " __ASM_NAME("__regs_") #name "-.\n\t" \
".byte " #args "," #pop_args )
".byte 4*" #args ",4*" #args )
/* FIXME: add support for other CPUs */
#endif

View File

@ -421,7 +421,6 @@ void WINAPI __regs_relay_call_regs( struct relay_descr *descr, unsigned int idx,
{
WORD ordinal = LOWORD(idx);
BYTE nb_args = LOBYTE(HIWORD(idx));
BYTE flags = HIBYTE(HIWORD(idx));
struct relay_private_data *data = descr->private;
struct relay_entry_point *entry_point = data->entry_points + ordinal;
BYTE *orig_func = entry_point->orig_func;
@ -431,8 +430,7 @@ void WINAPI __regs_relay_call_regs( struct relay_descr *descr, unsigned int idx,
/* restore the context to what it was before the relay thunk */
context->Eax = orig_eax;
context->Eip = ret_addr;
if (flags & 2) /* stdcall */
context->Esp += nb_args * sizeof(int);
context->Esp += nb_args * sizeof(int);
if (TRACE_ON(relay))
{
@ -479,7 +477,7 @@ void WINAPI __regs_relay_call_regs( struct relay_descr *descr, unsigned int idx,
}
}
extern void WINAPI relay_call_regs(void);
DEFINE_REGS_ENTRYPOINT( relay_call_regs, 16, 16 )
DEFINE_REGS_ENTRYPOINT( relay_call_regs, 4 )
#endif
@ -973,8 +971,8 @@ void WINAPI __regs_SNOOP_Return( CONTEXT86 *context )
}
/* assembly wrappers that save the context */
DEFINE_REGS_ENTRYPOINT( SNOOP_Entry, 0, 0 )
DEFINE_REGS_ENTRYPOINT( SNOOP_Return, 0, 0 )
DEFINE_REGS_ENTRYPOINT( SNOOP_Entry, 0 )
DEFINE_REGS_ENTRYPOINT( SNOOP_Return, 0 )
#else /* __i386__ */

View File

@ -896,7 +896,7 @@ void WINAPI __regs_get_cpu_context( CONTEXT *context, CONTEXT *regs )
if (fpux_support) save_fpux( context );
else save_fpu( context );
}
DEFINE_REGS_ENTRYPOINT( get_cpu_context, 4, 4 )
DEFINE_REGS_ENTRYPOINT( get_cpu_context, 1 )
/***********************************************************************