ntoskrnl.exe: Implement _chkstk.

These are just copied from ntdll.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alistair Leslie-Hughes 2018-03-26 22:58:55 +00:00 committed by Alexandre Julliard
parent f63474b6d5
commit 075cbd3474
2 changed files with 32 additions and 0 deletions

View File

@ -3373,3 +3373,33 @@ INT __cdecl NTOSKRNL_wcsncmp( LPCWSTR str1, LPCWSTR str2, INT n )
{
return strncmpW( str1, str2, n );
}
#ifdef __x86_64__
/**************************************************************************
* __chkstk (NTOSKRNL.@)
*
* Supposed to touch all the stack pages, but we shouldn't need that.
*/
__ASM_GLOBAL_FUNC( __chkstk, "ret" );
#elif defined(__i386__)
/**************************************************************************
* _chkstk (NTOSKRNL.@)
*/
__ASM_STDCALL_FUNC( _chkstk, 0,
"negl %eax\n\t"
"addl %esp,%eax\n\t"
"xchgl %esp,%eax\n\t"
"movl 0(%eax),%eax\n\t" /* copy return address from old location */
"movl %eax,0(%esp)\n\t"
"ret" )
#elif defined(__arm__)
/**************************************************************************
* __chkstk (NTDLL.@)
*
* Incoming r4 contains words to allocate, converting to bytes then return
*/
__ASM_GLOBAL_FUNC( __chkstk, "lsl r4, r4, #2\n\t"
"bx lr" )
#endif

View File

@ -1401,6 +1401,7 @@
@ stdcall -private ZwWaitForSingleObject(long long ptr) NtWaitForSingleObject
@ stdcall -private ZwWriteFile(long long ptr ptr ptr ptr long ptr ptr) NtWriteFile
@ stdcall -private ZwYieldExecution() NtYieldExecution
@ stdcall -private -arch=arm,x86_64 -norelay __chkstk()
@ cdecl -private -arch=i386 _CIcos() msvcrt._CIcos
@ cdecl -private -arch=i386 _CIsin() msvcrt._CIsin
@ cdecl -private -arch=i386 _CIsqrt() msvcrt._CIsqrt
@ -1416,6 +1417,7 @@
@ stub _aulldvrm
@ stdcall -private -arch=i386 -ret64 _aullrem(int64 int64)
@ stdcall -private -arch=i386 -ret64 _aullshr(int64 long)
@ stdcall -private -arch=i386 -norelay _chkstk()
@ cdecl -private -arch=i386 _except_handler2(ptr ptr ptr ptr) msvcrt._except_handler2
@ cdecl -private -arch=i386 _except_handler3(ptr ptr ptr ptr) msvcrt._except_handler3
@ cdecl -private -arch=i386 _global_unwind2(ptr) msvcrt._global_unwind2