Commit d303d9dc authored by Alexandre Julliard's avatar Alexandre Julliard

kernel32: Add appropriate stdcall decorations to assembly functions.

parent 5c4612b3
......@@ -2210,37 +2210,37 @@ void WINAPI MapHInstSL16( CONTEXT86 *context )
/***************************************************************************
* MapHInstLS (KERNEL32.@)
*/
__ASM_GLOBAL_FUNC( MapHInstLS,
__ASM_STDCALL_FUNC( MapHInstLS, 0,
"pushl %eax\n\t"
"call " __ASM_NAME("MapHModuleLS") "\n\t"
"call " __ASM_NAME("MapHModuleLS") __ASM_STDCALL(4) "\n\t"
"ret" )
/***************************************************************************
* MapHInstSL (KERNEL32.@)
*/
__ASM_GLOBAL_FUNC( MapHInstSL,
__ASM_STDCALL_FUNC( MapHInstSL, 0,
"pushl %eax\n\t"
"call " __ASM_NAME("MapHModuleSL") "\n\t"
"call " __ASM_NAME("MapHModuleSL") __ASM_STDCALL(4) "\n\t"
"ret" )
/***************************************************************************
* MapHInstLS_PN (KERNEL32.@)
*/
__ASM_GLOBAL_FUNC( MapHInstLS_PN,
__ASM_STDCALL_FUNC( MapHInstLS_PN, 0,
"testl %eax,%eax\n\t"
"jz 1f\n\t"
"pushl %eax\n\t"
"call " __ASM_NAME("MapHModuleLS") "\n"
"call " __ASM_NAME("MapHModuleLS") __ASM_STDCALL(4) "\n"
"1:\tret" )
/***************************************************************************
* MapHInstSL_PN (KERNEL32.@)
*/
__ASM_GLOBAL_FUNC( MapHInstSL_PN,
__ASM_STDCALL_FUNC( MapHInstSL_PN, 0,
"andl $0xffff,%eax\n\t"
"jz 1f\n\t"
"pushl %eax\n\t"
"call " __ASM_NAME("MapHModuleSL") "\n"
"call " __ASM_NAME("MapHModuleSL") __ASM_STDCALL(4) "\n"
"1:\tret" )
#endif /* __i386__ */
......@@ -2215,13 +2215,13 @@ BOOL WINAPI TerminateProcess( HANDLE handle, DWORD exit_code )
* Nothing.
*/
#ifdef __i386__
__ASM_GLOBAL_FUNC( ExitProcess, /* Shrinker depend on this particular ExitProcess implementation */
__ASM_STDCALL_FUNC( ExitProcess, 4, /* Shrinker depend on this particular ExitProcess implementation */
"pushl %ebp\n\t"
".byte 0x8B, 0xEC\n\t" /* movl %esp, %ebp */
".byte 0x6A, 0x00\n\t" /* pushl $0 */
".byte 0x68, 0x00, 0x00, 0x00, 0x00\n\t" /* pushl $0 - 4 bytes immediate */
"pushl 8(%ebp)\n\t"
"call " __ASM_NAME("process_ExitProcess") "\n\t"
"call " __ASM_NAME("process_ExitProcess") __ASM_STDCALL(4) "\n\t"
"leave\n\t"
"ret $4" )
......
......@@ -565,7 +565,7 @@ LPVOID WINAPI MapSLFix( SEGPTR sptr )
* Must not change EAX, hence defined as asm function.
*/
#ifdef __i386__
__ASM_GLOBAL_FUNC( UnMapSLFixArray, "ret $8" )
__ASM_STDCALL_FUNC( UnMapSLFixArray, 8, "ret $8" )
#endif
......@@ -595,22 +595,22 @@ BOOL WINAPI GetThreadSelectorEntry( HANDLE hthread, DWORD sel, LPLDT_ENTRY ldten
/***********************************************************************
* SMapLS (KERNEL32.@)
*/
__ASM_GLOBAL_FUNC( SMapLS,
__ASM_STDCALL_FUNC( SMapLS, 0,
"xor %edx,%edx\n\t"
"testl $0xffff0000,%eax\n\t"
"jz 1f\n\t"
"pushl %eax\n\t"
"call " __ASM_NAME("MapLS") "\n\t"
"call " __ASM_NAME("MapLS") __ASM_STDCALL(4) "\n\t"
"movl %eax,%edx\n"
"1:\tret" )
/***********************************************************************
* SUnMapLS (KERNEL32.@)
*/
__ASM_GLOBAL_FUNC( SUnMapLS,
__ASM_STDCALL_FUNC( SUnMapLS, 0,
"pushl %eax\n\t" /* preserve eax */
"pushl %eax\n\t"
"call " __ASM_NAME("UnMapLS") "\n\t"
"call " __ASM_NAME("UnMapLS") __ASM_STDCALL(4) "\n\t"
"popl %eax\n\t"
"ret" )
......@@ -631,9 +631,9 @@ __ASM_GLOBAL_FUNC( SUnMapLS,
* unravel them at SUnMapLS. We just store the segmented pointer there.
*/
#define DEFINE_SMapLS(n) \
__ASM_GLOBAL_FUNC( SMapLS_IP_EBP_ ## n, \
__ASM_STDCALL_FUNC( SMapLS_IP_EBP_ ## n, 0, \
"movl " #n "(%ebp),%eax\n\t" \
"call " __ASM_NAME("SMapLS") "\n\t" \
"call " __ASM_NAME("SMapLS") __ASM_STDCALL(4) "\n\t" \
"movl %edx," #n "(%ebp)\n\t" \
"ret" )
......@@ -661,10 +661,10 @@ DEFINE_SMapLS(40)
*/
#define DEFINE_SUnMapLS(n) \
__ASM_GLOBAL_FUNC( SUnMapLS_IP_EBP_ ## n, \
__ASM_STDCALL_FUNC( SUnMapLS_IP_EBP_ ## n, 0, \
"pushl %eax\n\t" /* preserve eax */ \
"pushl " #n "(%ebp)\n\t" \
"call " __ASM_NAME("UnMapLS") "\n\t" \
"call " __ASM_NAME("UnMapLS") __ASM_STDCALL(4) "\n\t" \
"movl $0," #n "(%ebp)\n\t" \
"popl %eax\n\t" \
"ret" )
......
......@@ -2275,7 +2275,7 @@ BOOL WINAPI BindIoCompletionCallback( HANDLE FileHandle, LPOVERLAPPED_COMPLETION
* InterlockedCompareExchange (KERNEL32.@)
*/
/* LONG WINAPI InterlockedCompareExchange( PLONG dest, LONG xchg, LONG compare ); */
__ASM_GLOBAL_FUNC(InterlockedCompareExchange,
__ASM_STDCALL_FUNC(InterlockedCompareExchange, 12,
"movl 12(%esp),%eax\n\t"
"movl 8(%esp),%ecx\n\t"
"movl 4(%esp),%edx\n\t"
......@@ -2286,7 +2286,7 @@ __ASM_GLOBAL_FUNC(InterlockedCompareExchange,
* InterlockedExchange (KERNEL32.@)
*/
/* LONG WINAPI InterlockedExchange( PLONG dest, LONG val ); */
__ASM_GLOBAL_FUNC(InterlockedExchange,
__ASM_STDCALL_FUNC(InterlockedExchange, 8,
"movl 8(%esp),%eax\n\t"
"movl 4(%esp),%edx\n\t"
"lock; xchgl %eax,(%edx)\n\t"
......@@ -2296,7 +2296,7 @@ __ASM_GLOBAL_FUNC(InterlockedExchange,
* InterlockedExchangeAdd (KERNEL32.@)
*/
/* LONG WINAPI InterlockedExchangeAdd( PLONG dest, LONG incr ); */
__ASM_GLOBAL_FUNC(InterlockedExchangeAdd,
__ASM_STDCALL_FUNC(InterlockedExchangeAdd, 8,
"movl 8(%esp),%eax\n\t"
"movl 4(%esp),%edx\n\t"
"lock; xaddl %eax,(%edx)\n\t"
......@@ -2306,7 +2306,7 @@ __ASM_GLOBAL_FUNC(InterlockedExchangeAdd,
* InterlockedIncrement (KERNEL32.@)
*/
/* LONG WINAPI InterlockedIncrement( PLONG dest ); */
__ASM_GLOBAL_FUNC(InterlockedIncrement,
__ASM_STDCALL_FUNC(InterlockedIncrement, 4,
"movl 4(%esp),%edx\n\t"
"movl $1,%eax\n\t"
"lock; xaddl %eax,(%edx)\n\t"
......@@ -2316,7 +2316,7 @@ __ASM_GLOBAL_FUNC(InterlockedIncrement,
/***********************************************************************
* InterlockedDecrement (KERNEL32.@)
*/
__ASM_GLOBAL_FUNC(InterlockedDecrement,
__ASM_STDCALL_FUNC(InterlockedDecrement, 4,
"movl 4(%esp),%edx\n\t"
"movl $-1,%eax\n\t"
"lock; xaddl %eax,(%edx)\n\t"
......
......@@ -568,7 +568,7 @@ HANDLE WINAPI GetCurrentThread(void)
* SetLastError (KERNEL32.@)
*/
/* void WINAPI SetLastError( DWORD error ); */
__ASM_GLOBAL_FUNC( SetLastError,
__ASM_STDCALL_FUNC( SetLastError, 4,
"movl 4(%esp),%eax\n\t"
".byte 0x64\n\t"
"movl %eax,0x34\n\t"
......@@ -579,21 +579,21 @@ __ASM_GLOBAL_FUNC( SetLastError,
* GetLastError (KERNEL32.@)
*/
/* DWORD WINAPI GetLastError(void); */
__ASM_GLOBAL_FUNC( GetLastError, ".byte 0x64\n\tmovl 0x34,%eax\n\tret" )
__ASM_STDCALL_FUNC( GetLastError, 0, ".byte 0x64\n\tmovl 0x34,%eax\n\tret" )
/***********************************************************************
* GetCurrentProcessId (KERNEL.471)
* GetCurrentProcessId (KERNEL32.@)
*/
/* DWORD WINAPI GetCurrentProcessId(void) */
__ASM_GLOBAL_FUNC( GetCurrentProcessId, ".byte 0x64\n\tmovl 0x20,%eax\n\tret" )
__ASM_STDCALL_FUNC( GetCurrentProcessId, 0, ".byte 0x64\n\tmovl 0x20,%eax\n\tret" )
/***********************************************************************
* GetCurrentThreadId (KERNEL.462)
* GetCurrentThreadId (KERNEL32.@)
*/
/* DWORD WINAPI GetCurrentThreadId(void) */
__ASM_GLOBAL_FUNC( GetCurrentThreadId, ".byte 0x64\n\tmovl 0x24,%eax\n\tret" )
__ASM_STDCALL_FUNC( GetCurrentThreadId, 0, ".byte 0x64\n\tmovl 0x24,%eax\n\tret" )
#else /* __i386__ */
......
......@@ -645,7 +645,7 @@ DEFINE_REGS_ENTRYPOINT( FT_Thunk, 0 )
"leave\n\t"
#define DEFINE_FT_Exit(n) \
__ASM_GLOBAL_FUNC( FT_Exit ## n, FT_EXIT_RESTORE_REGS "ret $" #n )
__ASM_STDCALL_FUNC( FT_Exit ## n, 0, FT_EXIT_RESTORE_REGS "ret $" #n )
DEFINE_FT_Exit(0)
DEFINE_FT_Exit(4)
......
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