Prefix the internal name of all register functions with __regs_ for

better consistency and to make automated checking possible.
This commit is contained in:
Alexandre Julliard 2005-05-07 18:10:30 +00:00
parent bf961bb144
commit 26050b49d5
9 changed files with 49 additions and 52 deletions

View File

@ -364,7 +364,7 @@ static DWORD cxx_frame_handler( PEXCEPTION_RECORD rec, cxx_exception_frame* fram
/*********************************************************************
* __CxxFrameHandler (MSVCRT.@)
*/
void MSVCRT__CxxFrameHandler( PEXCEPTION_RECORD rec, EXCEPTION_REGISTRATION_RECORD* frame,
void WINAPI __regs___CxxFrameHandler( PEXCEPTION_RECORD rec, EXCEPTION_REGISTRATION_RECORD* frame,
PCONTEXT exc_context, EXCEPTION_REGISTRATION_RECORD** dispatch,
CONTEXT86 *context )
{
@ -372,7 +372,7 @@ void MSVCRT__CxxFrameHandler( PEXCEPTION_RECORD rec, EXCEPTION_REGISTRATION_RECO
context->Eax = cxx_frame_handler( rec, (cxx_exception_frame *)frame,
exc_context, dispatch, descr, NULL, 0, context );
}
DEFINE_REGS_ENTRYPOINT( __CxxFrameHandler, MSVCRT__CxxFrameHandler, 16, 0 );
DEFINE_REGS_ENTRYPOINT( __CxxFrameHandler, 16, 0 );
#endif /* __i386__ */

View File

@ -276,8 +276,8 @@ typedef void (*MSVCRT_unwind_function)(const void*);
/*******************************************************************
* _setjmp (MSVCRT.@)
*/
DEFINE_REGS_ENTRYPOINT( MSVCRT__setjmp, _MSVCRT__setjmp, 4, 0 );
void _MSVCRT__setjmp(struct MSVCRT___JUMP_BUFFER *jmp, CONTEXT86* context)
DEFINE_REGS_ENTRYPOINT( MSVCRT__setjmp, 4, 0 );
void WINAPI __regs_MSVCRT__setjmp(struct MSVCRT___JUMP_BUFFER *jmp, CONTEXT86* context)
{
TRACE("(%p)\n",jmp);
jmp->Ebp = context->Ebp;
@ -298,8 +298,8 @@ void _MSVCRT__setjmp(struct MSVCRT___JUMP_BUFFER *jmp, CONTEXT86* context)
/*******************************************************************
* _setjmp3 (MSVCRT.@)
*/
DEFINE_REGS_ENTRYPOINT( MSVCRT__setjmp3, _MSVCRT__setjmp3, 8, 0 );
void _MSVCRT__setjmp3(struct MSVCRT___JUMP_BUFFER *jmp, int nb_args, CONTEXT86* context)
DEFINE_REGS_ENTRYPOINT( MSVCRT__setjmp3, 8, 0 );
void WINAPI __regs_MSVCRT__setjmp3(struct MSVCRT___JUMP_BUFFER *jmp, int nb_args, CONTEXT86* context)
{
TRACE("(%p,%d)\n",jmp,nb_args);
jmp->Ebp = context->Ebp;
@ -335,8 +335,8 @@ void _MSVCRT__setjmp3(struct MSVCRT___JUMP_BUFFER *jmp, int nb_args, CONTEXT86*
/*********************************************************************
* longjmp (MSVCRT.@)
*/
DEFINE_REGS_ENTRYPOINT( MSVCRT_longjmp, _MSVCRT_longjmp, 8, 0 );
void _MSVCRT_longjmp(struct MSVCRT___JUMP_BUFFER *jmp, int retval, CONTEXT86* context)
DEFINE_REGS_ENTRYPOINT( MSVCRT_longjmp, 8, 0 );
void WINAPI __regs_MSVCRT_longjmp(struct MSVCRT___JUMP_BUFFER *jmp, int retval, CONTEXT86* context)
{
unsigned long cur_frame = 0;

View File

@ -224,7 +224,7 @@ static void EXC_DefaultHandling( EXCEPTION_RECORD *rec, CONTEXT *context )
/***********************************************************************
* RtlRaiseException (NTDLL.@)
*/
void WINAPI EXC_RtlRaiseException( EXCEPTION_RECORD *rec, CONTEXT *context )
void WINAPI __regs_RtlRaiseException( EXCEPTION_RECORD *rec, CONTEXT *context )
{
EXCEPTION_REGISTRATION_RECORD *frame, *dispatch, *nested_frame;
EXCEPTION_RECORD newrec;
@ -313,13 +313,13 @@ void WINAPI EXC_RtlRaiseException( EXCEPTION_RECORD *rec, CONTEXT *context )
/**********************************************************************/
#ifdef DEFINE_REGS_ENTRYPOINT
DEFINE_REGS_ENTRYPOINT( RtlRaiseException, EXC_RtlRaiseException, 4, 4 );
DEFINE_REGS_ENTRYPOINT( RtlRaiseException, 4, 4 );
#else
void WINAPI RtlRaiseException( EXCEPTION_RECORD *rec )
{
CONTEXT context;
memset( &context, 0, sizeof(context) );
EXC_RtlRaiseException( rec, &context );
__regs_RtlRaiseException( rec, &context );
}
#endif
@ -327,7 +327,7 @@ void WINAPI RtlRaiseException( EXCEPTION_RECORD *rec )
/*******************************************************************
* RtlUnwind (NTDLL.@)
*/
void WINAPI EXC_RtlUnwind( EXCEPTION_REGISTRATION_RECORD* pEndFrame, PVOID unusedEip,
void WINAPI __regs_RtlUnwind( EXCEPTION_REGISTRATION_RECORD* pEndFrame, PVOID unusedEip,
PEXCEPTION_RECORD pRecord, PVOID returnEax, CONTEXT *context )
{
EXCEPTION_RECORD record, newrec;
@ -400,14 +400,14 @@ void WINAPI EXC_RtlUnwind( EXCEPTION_REGISTRATION_RECORD* pEndFrame, PVOID unuse
/**********************************************************************/
#ifdef DEFINE_REGS_ENTRYPOINT
DEFINE_REGS_ENTRYPOINT( RtlUnwind, EXC_RtlUnwind, 16, 16 );
DEFINE_REGS_ENTRYPOINT( RtlUnwind, 16, 16 );
#else
void WINAPI RtlUnwind( PVOID pEndFrame, PVOID unusedEip,
PEXCEPTION_RECORD pRecord, PVOID returnEax )
{
CONTEXT context;
memset( &context, 0, sizeof(context) );
EXC_RtlUnwind( pEndFrame, unusedEip, pRecord, returnEax, &context );
__regs_RtlUnwind( pEndFrame, unusedEip, pRecord, returnEax, &context );
}
#endif
@ -415,21 +415,21 @@ void WINAPI RtlUnwind( PVOID pEndFrame, PVOID unusedEip,
/*******************************************************************
* NtRaiseException (NTDLL.@)
*/
void WINAPI EXC_NtRaiseException( EXCEPTION_RECORD *rec, CONTEXT *ctx,
void WINAPI __regs_NtRaiseException( EXCEPTION_RECORD *rec, CONTEXT *ctx,
BOOL first, CONTEXT *context )
{
EXC_RtlRaiseException( rec, ctx );
__regs_RtlRaiseException( rec, ctx );
*context = *ctx;
}
#ifdef DEFINE_REGS_ENTRYPOINT
DEFINE_REGS_ENTRYPOINT( NtRaiseException, EXC_NtRaiseException, 12, 12 );
DEFINE_REGS_ENTRYPOINT( NtRaiseException, 12, 12 );
#else
void WINAPI NtRaiseException( EXCEPTION_RECORD *rec, CONTEXT *ctx, BOOL first )
{
CONTEXT context;
memset( &context, 0, sizeof(context) );
EXC_NtRaiseException( rec, ctx, first, &context );
__regs_NtRaiseException( rec, ctx, first, &context );
}
#endif

View File

@ -37,6 +37,8 @@
#define SIGNAL_STACK_SIZE 0 /* we don't need a signal stack on non-i386 */
#endif
extern void WINAPI __regs_RtlRaiseException( PEXCEPTION_RECORD, PCONTEXT );
/* debug helper */
extern LPCSTR debugstr_us( const UNICODE_STRING *str );
extern void dump_ObjectAttributes (const OBJECT_ATTRIBUTES *ObjectAttributes);

View File

@ -378,11 +378,11 @@ BOOLEAN WINAPI RtlGetNtProductType(LPDWORD type)
* Glorified "enter xxxx".
*/
#ifdef __i386__
void WINAPI NTDLL_chkstk( CONTEXT86 *context )
void WINAPI __regs__chkstk( CONTEXT86 *context )
{
context->Esp -= context->Eax;
}
DEFINE_REGS_ENTRYPOINT( _chkstk, NTDLL_chkstk, 0, 0 );
DEFINE_REGS_ENTRYPOINT( _chkstk, 0, 0 );
#endif
/**************************************************************************
@ -391,11 +391,11 @@ DEFINE_REGS_ENTRYPOINT( _chkstk, NTDLL_chkstk, 0, 0 );
* Glorified "enter xxxx".
*/
#ifdef __i386__
void WINAPI NTDLL_alloca_probe( CONTEXT86 *context )
void WINAPI __regs__alloca_probe( CONTEXT86 *context )
{
context->Esp -= context->Eax;
}
DEFINE_REGS_ENTRYPOINT( _alloca_probe, NTDLL_alloca_probe, 0, 0 );
DEFINE_REGS_ENTRYPOINT( _alloca_probe, 0, 0 );
#endif

View File

@ -450,7 +450,6 @@ typedef int (*wine_signal_handler)(unsigned int sig);
static wine_signal_handler handlers[256];
extern void WINAPI EXC_RtlRaiseException( PEXCEPTION_RECORD, PCONTEXT );
extern void DECLSPEC_NORETURN __wine_call_from_32_restore_regs( CONTEXT context );
@ -616,7 +615,7 @@ static void merge_vm86_pending_flags( EXCEPTION_RECORD *rec )
vcontext.EFlags &= ~VIP_MASK;
NtCurrentTeb()->vm86_pending = 0;
EXC_RtlRaiseException( rec, &vcontext );
__regs_RtlRaiseException( rec, &vcontext );
restore_vm86_context( &vcontext, vm86 );
check_pending = TRUE;
@ -884,7 +883,7 @@ static void WINAPI raise_segv_exception( EXCEPTION_RECORD *rec, CONTEXT *context
}
break;
}
EXC_RtlRaiseException( rec, context );
__regs_RtlRaiseException( rec, context );
}
@ -920,7 +919,7 @@ static void WINAPI raise_trap_exception( EXCEPTION_RECORD *rec, CONTEXT *context
dr6 = context->Dr6;
dr7 = context->Dr7;
EXC_RtlRaiseException( rec, context );
__regs_RtlRaiseException( rec, context );
if (dr0 != context->Dr0 || dr1 != context->Dr1 || dr2 != context->Dr2 ||
dr3 != context->Dr3 || dr6 != context->Dr6 || dr7 != context->Dr7)
@ -937,7 +936,7 @@ static void WINAPI raise_trap_exception( EXCEPTION_RECORD *rec, CONTEXT *context
*/
static void WINAPI raise_fpu_exception( EXCEPTION_RECORD *rec, CONTEXT *context )
{
EXC_RtlRaiseException( rec, context );
__regs_RtlRaiseException( rec, context );
restore_fpu( context );
}
@ -967,7 +966,7 @@ static void WINAPI raise_vm86_sti_exception( EXCEPTION_RECORD *rec, CONTEXT *con
{
/* Executing DPMI code and virtual interrupts are enabled. */
NtCurrentTeb()->vm86_pending = 0;
EXC_RtlRaiseException( rec, context );
__regs_RtlRaiseException( rec, context );
}
}
@ -1114,7 +1113,7 @@ static HANDLER_DEF(int_handler)
init_handler( HANDLER_CONTEXT );
if (!dispatch_signal(SIGINT))
{
EXCEPTION_RECORD *rec = setup_exception( HANDLER_CONTEXT, EXC_RtlRaiseException );
EXCEPTION_RECORD *rec = setup_exception( HANDLER_CONTEXT, __regs_RtlRaiseException );
rec->ExceptionCode = CONTROL_C_EXIT;
}
}
@ -1126,7 +1125,7 @@ static HANDLER_DEF(int_handler)
*/
static HANDLER_DEF(abrt_handler)
{
EXCEPTION_RECORD *rec = setup_exception( HANDLER_CONTEXT, EXC_RtlRaiseException );
EXCEPTION_RECORD *rec = setup_exception( HANDLER_CONTEXT, __regs_RtlRaiseException );
rec->ExceptionCode = EXCEPTION_WINE_ASSERTION;
rec->ExceptionFlags = EH_NONCONTINUABLE;
}
@ -1336,7 +1335,7 @@ void __wine_enter_vm86( CONTEXT *context )
ERR( "unhandled result from vm86 mode %x\n", res );
continue;
}
EXC_RtlRaiseException( &rec, context );
__regs_RtlRaiseException( &rec, context );
}
}

View File

@ -165,8 +165,6 @@ typedef int (*wine_signal_handler)(unsigned int sig);
static wine_signal_handler handlers[256];
extern void WINAPI EXC_RtlRaiseException( PEXCEPTION_RECORD, PCONTEXT );
/***********************************************************************
* dispatch_signal
*/
@ -382,7 +380,7 @@ static void do_segv( CONTEXT *context, int trap, int err, int code, void * addr
}
break;
}
EXC_RtlRaiseException( &rec, context );
__regs_RtlRaiseException( &rec, context );
}
/**********************************************************************
@ -414,7 +412,7 @@ static void do_trap( CONTEXT *context, int code, void * addr )
default:FIXME("Unhandled SIGTRAP/%x\n", code);
break;
}
EXC_RtlRaiseException( &rec, context );
__regs_RtlRaiseException( &rec, context );
}
/**********************************************************************
@ -473,7 +471,7 @@ static void do_fpe( CONTEXT *context, int code, void * addr )
rec.ExceptionRecord = NULL;
rec.ExceptionAddress = addr;
rec.NumberParameters = 0;
EXC_RtlRaiseException( &rec, context );
__regs_RtlRaiseException( &rec, context );
}
/**********************************************************************
@ -535,7 +533,7 @@ static HANDLER_DEF(int_handler)
rec.ExceptionRecord = NULL;
rec.ExceptionAddress = (LPVOID)context.Iar;
rec.NumberParameters = 0;
EXC_RtlRaiseException( &rec, &context );
__regs_RtlRaiseException( &rec, &context );
restore_context( &context, HANDLER_CONTEXT );
}
}
@ -557,7 +555,7 @@ static HANDLER_DEF(abrt_handler)
rec.ExceptionRecord = NULL;
rec.ExceptionAddress = (LPVOID)context.Iar;
rec.NumberParameters = 0;
EXC_RtlRaiseException( &rec, &context ); /* Should never return.. */
__regs_RtlRaiseException( &rec, &context ); /* Should never return.. */
restore_context( &context, HANDLER_CONTEXT );
}

View File

@ -51,8 +51,6 @@ typedef int (*wine_signal_handler)(unsigned int sig);
static wine_signal_handler handlers[256];
extern void WINAPI EXC_RtlRaiseException( PEXCEPTION_RECORD, PCONTEXT );
/***********************************************************************
* dispatch_signal
*/
@ -173,7 +171,7 @@ static void segv_handler( int signal, siginfo_t *info, ucontext_t *ucontext )
rec.ExceptionInformation[0] = 0; /* FIXME: read/write access ? */
rec.ExceptionInformation[1] = (ULONG_PTR)info->si_addr;
EXC_RtlRaiseException( &rec, &context );
__regs_RtlRaiseException( &rec, &context );
restore_context( &context, ucontext );
}
@ -198,7 +196,7 @@ static void bus_handler( int signal, siginfo_t *info, ucontext_t *ucontext )
else
rec.ExceptionCode = EXCEPTION_ACCESS_VIOLATION;
EXC_RtlRaiseException( &rec, &context );
__regs_RtlRaiseException( &rec, &context );
restore_context( &context, ucontext );
}
@ -237,7 +235,7 @@ static void ill_handler( int signal, siginfo_t *info, ucontext_t *ucontext )
rec.ExceptionFlags = EXCEPTION_CONTINUABLE;
rec.ExceptionAddress = (LPVOID)context.pc;
rec.NumberParameters = 0;
EXC_RtlRaiseException( &rec, &context );
__regs_RtlRaiseException( &rec, &context );
restore_context( &context, ucontext );
}
@ -268,7 +266,7 @@ static void trap_handler( int signal, siginfo_t *info, ucontext_t *ucontext )
rec.ExceptionRecord = NULL;
rec.ExceptionAddress = (LPVOID)context.pc;
rec.NumberParameters = 0;
EXC_RtlRaiseException( &rec, &context );
__regs_RtlRaiseException( &rec, &context );
restore_context( &context, ucontext );
}
@ -318,7 +316,7 @@ static void fpe_handler( int signal, siginfo_t *info, ucontext_t *ucontext )
rec.ExceptionRecord = NULL;
rec.ExceptionAddress = (LPVOID)context.pc;
rec.NumberParameters = 0;
EXC_RtlRaiseException( &rec, &context );
__regs_RtlRaiseException( &rec, &context );
restore_context( &context, ucontext );
restore_fpu( &context, ucontext );
}
@ -342,7 +340,7 @@ static void int_handler( int signal, siginfo_t *info, ucontext_t *ucontext )
rec.ExceptionRecord = NULL;
rec.ExceptionAddress = (LPVOID)context.pc;
rec.NumberParameters = 0;
EXC_RtlRaiseException( &rec, &context );
__regs_RtlRaiseException( &rec, &context );
restore_context( &context, ucontext );
}
}
@ -363,7 +361,7 @@ static HANDLER_DEF(abrt_handler)
rec.ExceptionRecord = NULL;
rec.ExceptionAddress = (LPVOID)context.pc;
rec.NumberParameters = 0;
EXC_RtlRaiseException( &rec, &context ); /* Should never return.. */
__regs_RtlRaiseException( &rec, &context ); /* Should never return.. */
restore_context( &context, HANDLER_CONTEXT );
}

View File

@ -238,10 +238,10 @@ struct statvfs
/* Register functions */
#ifdef __i386__
#define DEFINE_REGS_ENTRYPOINT( name, fn, args, pop_args ) \
#define DEFINE_REGS_ENTRYPOINT( name, args, pop_args ) \
__ASM_GLOBAL_FUNC( name, \
"call " __ASM_NAME("__wine_call_from_32_regs") "\n\t" \
".long " __ASM_NAME(#fn) "\n\t" \
".long " __ASM_NAME("__regs_") #name "\n\t" \
".byte " #args "," #pop_args )
/* FIXME: add support for other CPUs */
#endif /* __i386__ */