mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 04:33:32 +00:00
[CRT]
- Remove _fltused from alldiv_asm.s / mscmain.c and use fltused.c instead. - Remove amd64/alldiv.S - Implement amd64 ceil, ceilf with sse [NTOSKNRL] - Fix amd64 exports [ASM] - Fix amd64 asm files to conform to the new syntax svn path=/trunk/; revision=54131
This commit is contained in:
parent
38ed2303d8
commit
e3a81ccca5
27 changed files with 129 additions and 126 deletions
|
@ -683,4 +683,6 @@ msgLoading:
|
||||||
|
|
||||||
.word HEX(0aa55) // BootSector signature
|
.word HEX(0aa55) // BootSector signature
|
||||||
|
|
||||||
|
.endcode16
|
||||||
|
|
||||||
END
|
END
|
||||||
|
|
|
@ -17,7 +17,7 @@ FUNC BaseFiberStartup
|
||||||
/* FIXME: TODO */
|
/* FIXME: TODO */
|
||||||
ret
|
ret
|
||||||
|
|
||||||
ENDFUNC BaseFiberStartup
|
ENDFUNC
|
||||||
|
|
||||||
|
|
||||||
PUBLIC SwitchToFiber
|
PUBLIC SwitchToFiber
|
||||||
|
@ -27,6 +27,6 @@ FUNC SwitchToFiber
|
||||||
UNIMPLEMENTED BaseFiberStartup
|
UNIMPLEMENTED BaseFiberStartup
|
||||||
/* FIXME: TODO */
|
/* FIXME: TODO */
|
||||||
ret
|
ret
|
||||||
ENDFUNC SwitchToFiber
|
ENDFUNC
|
||||||
|
|
||||||
END
|
END
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
.code64
|
.code64
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* VOID NTAPI
|
* VOID NTAPI
|
||||||
* RtlCaptureContext(
|
* RtlCaptureContext(
|
||||||
* PCONTEXT ContextRecord); <rcx>
|
* PCONTEXT ContextRecord); <rcx>
|
||||||
|
@ -96,7 +96,7 @@ PUBLIC RtlCaptureContext
|
||||||
/* Cleanup stack and return */
|
/* Cleanup stack and return */
|
||||||
add rsp, 8
|
add rsp, 8
|
||||||
ret
|
ret
|
||||||
.ENDP RtlCaptureContext
|
.ENDP
|
||||||
|
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS Run-Time Library
|
* PROJECT: ReactOS Run-Time Library
|
||||||
* PURPOSE: Memory functions for amd64
|
* PURPOSE: Memory functions for amd64
|
||||||
* FILE: lib/rtl/i386/rtlswap.S
|
* FILE: lib/rtl/amd64/rtlmem.S
|
||||||
* PROGRAMER: Timo Kreuzer (timo.kreuzer@reactos.org)
|
* PROGRAMER: Timo Kreuzer (timo.kreuzer@reactos.org)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
.code64
|
.code64
|
||||||
|
|
||||||
/* SIZE_T
|
/* SIZE_T
|
||||||
* RtlCompareMemory(
|
* RtlCompareMemory(
|
||||||
* IN CONST VOID *Source1, <rcx>
|
* IN CONST VOID *Source1, <rcx>
|
||||||
* IN CONST VOID *Source2, <rdx>
|
* IN CONST VOID *Source2, <rdx>
|
||||||
|
@ -81,7 +81,7 @@ RtlCompareMemory6:
|
||||||
pop rdi
|
pop rdi
|
||||||
pop rsi
|
pop rsi
|
||||||
ret
|
ret
|
||||||
.endp RtlCompareMemory
|
.endp
|
||||||
|
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
|
@ -123,6 +123,7 @@ list(APPEND CRT_SOURCE
|
||||||
misc/amsg.c
|
misc/amsg.c
|
||||||
misc/assert.c
|
misc/assert.c
|
||||||
misc/environ.c
|
misc/environ.c
|
||||||
|
misc/fltused.c
|
||||||
misc/getargs.c
|
misc/getargs.c
|
||||||
misc/i10output.c
|
misc/i10output.c
|
||||||
misc/initterm.c
|
misc/initterm.c
|
||||||
|
@ -384,7 +385,6 @@ elseif(ARCH MATCHES amd64)
|
||||||
float/amd64/fpreset.S
|
float/amd64/fpreset.S
|
||||||
float/amd64/logb.S
|
float/amd64/logb.S
|
||||||
float/i386/statfp.c
|
float/i386/statfp.c
|
||||||
math/amd64/alldiv.S
|
|
||||||
math/amd64/atan.S
|
math/amd64/atan.S
|
||||||
math/amd64/atan2.S
|
math/amd64/atan2.S
|
||||||
math/amd64/ceil.S
|
math/amd64/ceil.S
|
||||||
|
|
|
@ -20,13 +20,13 @@ FUNC __chkstk
|
||||||
.endprolog
|
.endprolog
|
||||||
UNIMPLEMENTED chkstk
|
UNIMPLEMENTED chkstk
|
||||||
ret
|
ret
|
||||||
ENDFUNC __chkstk
|
ENDFUNC
|
||||||
|
|
||||||
FUNC __alloca_probe
|
FUNC __alloca_probe
|
||||||
.endprolog
|
.endprolog
|
||||||
UNIMPLEMENTED alloca_probe
|
UNIMPLEMENTED alloca_probe
|
||||||
ret
|
ret
|
||||||
ENDFUNC __alloca_probe
|
ENDFUNC
|
||||||
|
|
||||||
END
|
END
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -30,36 +30,36 @@ PUBLIC _except_handler3
|
||||||
FUNC _unwind_handler
|
FUNC _unwind_handler
|
||||||
.endprolog
|
.endprolog
|
||||||
ret
|
ret
|
||||||
ENDFUNC _unwind_handler
|
ENDFUNC
|
||||||
|
|
||||||
FUNC _global_unwind2
|
FUNC _global_unwind2
|
||||||
.endprolog
|
.endprolog
|
||||||
ret
|
ret
|
||||||
ENDFUNC _global_unwind2
|
ENDFUNC
|
||||||
|
|
||||||
FUNC _abnormal_termination
|
FUNC _abnormal_termination
|
||||||
.endprolog
|
.endprolog
|
||||||
ret
|
ret
|
||||||
ENDFUNC _abnormal_termination
|
ENDFUNC
|
||||||
|
|
||||||
FUNC _local_unwind
|
FUNC _local_unwind
|
||||||
.endprolog
|
.endprolog
|
||||||
ret
|
ret
|
||||||
ENDFUNC _local_unwind
|
ENDFUNC
|
||||||
|
|
||||||
FUNC _local_unwind2
|
FUNC _local_unwind2
|
||||||
.endprolog
|
.endprolog
|
||||||
ret
|
ret
|
||||||
ENDFUNC _local_unwind2
|
ENDFUNC
|
||||||
|
|
||||||
FUNC _except_handler2
|
FUNC _except_handler2
|
||||||
.endprolog
|
.endprolog
|
||||||
ret
|
ret
|
||||||
ENDFUNC _except_handler2
|
ENDFUNC
|
||||||
|
|
||||||
FUNC _except_handler3
|
FUNC _except_handler3
|
||||||
.endprolog
|
.endprolog
|
||||||
ret
|
ret
|
||||||
ENDFUNC _except_handler3
|
ENDFUNC
|
||||||
|
|
||||||
END
|
END
|
||||||
|
|
|
@ -10,6 +10,6 @@ FUNC _clearfp
|
||||||
.ENDPROLOG
|
.ENDPROLOG
|
||||||
fnclex
|
fnclex
|
||||||
|
|
||||||
ENDFUNC _clearfp
|
ENDFUNC
|
||||||
|
|
||||||
END
|
END
|
||||||
|
|
|
@ -6,6 +6,6 @@
|
||||||
FUNC _fpreset
|
FUNC _fpreset
|
||||||
.endprolog
|
.endprolog
|
||||||
fninit
|
fninit
|
||||||
ENDFUNC _fpreset
|
ENDFUNC
|
||||||
|
|
||||||
END
|
END
|
||||||
|
|
|
@ -11,7 +11,7 @@ FUNC __getfpcw87
|
||||||
mov rax, [rsp]
|
mov rax, [rsp]
|
||||||
add rsp, 8
|
add rsp, 8
|
||||||
ret
|
ret
|
||||||
ENDFUNC __getfpcw87
|
ENDFUNC
|
||||||
|
|
||||||
PUBLIC __setfpcw87
|
PUBLIC __setfpcw87
|
||||||
FUNC __setfpcw87
|
FUNC __setfpcw87
|
||||||
|
@ -19,6 +19,6 @@ FUNC __setfpcw87
|
||||||
.ENDPROLOG
|
.ENDPROLOG
|
||||||
ldmxcsr [rsp + 8]
|
ldmxcsr [rsp + 8]
|
||||||
ret
|
ret
|
||||||
ENDFUNC __setfpcw87
|
ENDFUNC
|
||||||
|
|
||||||
END
|
END
|
||||||
|
|
|
@ -11,6 +11,6 @@ FUNC _logb
|
||||||
fxtract
|
fxtract
|
||||||
fstp st
|
fstp st
|
||||||
ret
|
ret
|
||||||
ENDFUNC _logb
|
ENDFUNC
|
||||||
|
|
||||||
END
|
END
|
||||||
|
|
|
@ -9,6 +9,7 @@ list(APPEND LIBCNTPR_SOURCE
|
||||||
mem/memccpy.c
|
mem/memccpy.c
|
||||||
mem/memcmp.c
|
mem/memcmp.c
|
||||||
mem/memicmp.c
|
mem/memicmp.c
|
||||||
|
misc/fltused.c
|
||||||
printf/_snprintf.c
|
printf/_snprintf.c
|
||||||
printf/_snwprintf.c
|
printf/_snwprintf.c
|
||||||
printf/_vcprintf.c
|
printf/_vcprintf.c
|
||||||
|
@ -104,7 +105,6 @@ elseif(ARCH MATCHES amd64)
|
||||||
setjmp/amd64/setjmp.s
|
setjmp/amd64/setjmp.s
|
||||||
math/cos.c
|
math/cos.c
|
||||||
math/sin.c
|
math/sin.c
|
||||||
math/amd64/alldiv.S
|
|
||||||
math/amd64/atan.S
|
math/amd64/atan.S
|
||||||
math/amd64/atan2.S
|
math/amd64/atan2.S
|
||||||
math/amd64/ceil.S
|
math/amd64/ceil.S
|
||||||
|
|
|
@ -1,30 +0,0 @@
|
||||||
/*
|
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
|
||||||
* PROJECT: ReactOS system libraries
|
|
||||||
* PURPOSE: Implementation of alldiv
|
|
||||||
* FILE: lib/sdk/crt/math/amd64/alldiv.S
|
|
||||||
* PROGRAMMER: Timo Kreuzer (timo.kreuzer@reactos.org)
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* INCLUDES ******************************************************************/
|
|
||||||
|
|
||||||
#include <asm.inc>
|
|
||||||
|
|
||||||
/* DATA **********************************************************************/
|
|
||||||
.code64
|
|
||||||
|
|
||||||
PUBLIC _fltused
|
|
||||||
_fltused:
|
|
||||||
.long HEX(9875)
|
|
||||||
|
|
||||||
/* CODE **********************************************************************/
|
|
||||||
.code64
|
|
||||||
|
|
||||||
FUNC alldiv
|
|
||||||
.endprolog
|
|
||||||
UNIMPLEMENTED alldiv
|
|
||||||
ret
|
|
||||||
|
|
||||||
ENDFUNC alldiv
|
|
||||||
|
|
||||||
END
|
|
|
@ -14,9 +14,42 @@
|
||||||
/* CODE **********************************************************************/
|
/* CODE **********************************************************************/
|
||||||
.code64
|
.code64
|
||||||
|
|
||||||
|
/* ceil(x) = - floor(-x)
|
||||||
|
*/
|
||||||
PUBLIC ceil
|
PUBLIC ceil
|
||||||
ceil:
|
.PROC ceil
|
||||||
UNIMPLEMENTED ceil
|
sub rsp, 16
|
||||||
|
.ENDPROLOG
|
||||||
|
|
||||||
|
/* Duplicate the bits into rax */
|
||||||
|
movd rax, xmm0
|
||||||
|
|
||||||
|
/* Invert the sign bit */
|
||||||
|
rol rax, 1
|
||||||
|
xor al, 1
|
||||||
|
ror rax, 1
|
||||||
|
|
||||||
|
/* Copy back to xmm0 */
|
||||||
|
movd xmm0, rax
|
||||||
|
|
||||||
|
/* Truncate xmm0 to integer (double precision) */
|
||||||
|
cvttsd2si rcx, xmm0
|
||||||
|
|
||||||
|
/* Shift all bits to the right, keeping the sign bit */
|
||||||
|
shr rax, 63
|
||||||
|
|
||||||
|
/* Substract the sign bit from the truncated value, so that
|
||||||
|
we get the correct result for negative values. */
|
||||||
|
sub rcx, rax
|
||||||
|
|
||||||
|
/* Now compensate for the previous negation */
|
||||||
|
neg rcx
|
||||||
|
|
||||||
|
/* Convert the result back to xmm0 (double precision) */
|
||||||
|
cvtsi2sd xmm0, rcx
|
||||||
|
|
||||||
|
add rsp, 16
|
||||||
ret
|
ret
|
||||||
|
.ENDP
|
||||||
|
|
||||||
END
|
END
|
||||||
|
|
|
@ -19,29 +19,33 @@ FUNC ceilf
|
||||||
sub rsp, 16
|
sub rsp, 16
|
||||||
.ENDPROLOG
|
.ENDPROLOG
|
||||||
|
|
||||||
/* Put parameter on the stack */
|
/* Duplicate the bits into eax (zero exteneded to rax) */
|
||||||
movss dword ptr [rsp], xmm0
|
movd eax, xmm0
|
||||||
fld dword ptr [rsp]
|
|
||||||
|
|
||||||
/* Change fpu control word to round up */
|
/* Invert the sign bit */
|
||||||
fstcw [rsp + 8]
|
xor eax, HEX(80000000)
|
||||||
mov eax, [rsp + 8]
|
|
||||||
or eax, HEX(00800)
|
|
||||||
and eax, HEX(0fbff)
|
|
||||||
mov [rsp + 12], eax
|
|
||||||
fldcw [rsp + 12]
|
|
||||||
|
|
||||||
/* Round to integer */
|
/* Copy back to xmm0 */
|
||||||
frndint
|
movd xmm0, eax
|
||||||
|
|
||||||
/* Restore fpu control word */
|
/* Truncate xmm0 to integer (single precision) */
|
||||||
fldcw [rsp + 8]
|
cvttss2si rcx, xmm0
|
||||||
|
|
||||||
fstp dword ptr [rsp]
|
/* Shift all bits to the right, keeping the sign bit */
|
||||||
movss xmm0, dword ptr [rsp]
|
shr rax, 31
|
||||||
|
|
||||||
|
/* Add the sign bit from the truncated value, so that
|
||||||
|
we get the correct result for negative values. */
|
||||||
|
add rcx, rax
|
||||||
|
|
||||||
|
/* Now compensate for the previous negation */
|
||||||
|
neg ecx
|
||||||
|
|
||||||
|
/* Convert the result back to xmm0 (single precision) */
|
||||||
|
cvtsi2ss xmm0, rcx
|
||||||
|
|
||||||
add rsp, 16
|
add rsp, 16
|
||||||
ret
|
ret
|
||||||
ENDFUNC ceilf
|
ENDFUNC
|
||||||
|
|
||||||
END
|
END
|
||||||
|
|
|
@ -36,6 +36,6 @@ FUNC floor
|
||||||
|
|
||||||
add rsp, 16
|
add rsp, 16
|
||||||
ret
|
ret
|
||||||
ENDFUNC floor
|
ENDFUNC
|
||||||
|
|
||||||
END
|
END
|
||||||
|
|
|
@ -36,6 +36,6 @@ FUNC floorf
|
||||||
|
|
||||||
add rsp, 16
|
add rsp, 16
|
||||||
ret
|
ret
|
||||||
ENDFUNC floorf
|
ENDFUNC
|
||||||
|
|
||||||
END
|
END
|
||||||
|
|
|
@ -6,20 +6,20 @@
|
||||||
* PROGRAMER: Alex Ionescu (alex@relsoft.net)
|
* PROGRAMER: Alex Ionescu (alex@relsoft.net)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2002 Michael Ringgaard.
|
* Copyright (C) 2002 Michael Ringgaard.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
* are met:
|
* are met:
|
||||||
*
|
*
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer.
|
* notice, this list of conditions and the following disclaimer.
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
* documentation and/or other materials provided with the distribution.
|
* documentation and/or other materials provided with the distribution.
|
||||||
* 3. Neither the name of the project nor the names of its contributors
|
* 3. Neither the name of the project nor the names of its contributors
|
||||||
* may be used to endorse or promote products derived from this software
|
* may be used to endorse or promote products derived from this software
|
||||||
* without specific prior written permission.
|
* without specific prior written permission.
|
||||||
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
@ -30,23 +30,18 @@
|
||||||
* OR SERVICES// LOSS OF USE, DATA, OR PROFITS// OR BUSINESS INTERRUPTION)
|
* OR SERVICES// LOSS OF USE, DATA, OR PROFITS// OR BUSINESS INTERRUPTION)
|
||||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <asm.inc>
|
#include <asm.inc>
|
||||||
|
|
||||||
PUBLIC __alldiv
|
PUBLIC __alldiv
|
||||||
PUBLIC __fltused
|
|
||||||
|
|
||||||
/* DATA ********************************************************************/
|
/* DATA ********************************************************************/
|
||||||
.data
|
.data
|
||||||
ASSUME CS:NOTHING, DS:NOTHING, ES:NOTHING, FS:NOTHING, GS:NOTHING
|
ASSUME CS:NOTHING, DS:NOTHING, ES:NOTHING, FS:NOTHING, GS:NOTHING
|
||||||
|
|
||||||
__fltused:
|
|
||||||
.long HEX(9875)
|
|
||||||
|
|
||||||
|
|
||||||
/* FUNCTIONS ***************************************************************/
|
/* FUNCTIONS ***************************************************************/
|
||||||
.code
|
.code
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
|
|
||||||
int _fltused;
|
int _fltused = 0x9875;
|
||||||
|
|
|
@ -51,8 +51,7 @@ if(ARCH MATCHES i386)
|
||||||
elseif(ARCH MATCHES amd64)
|
elseif(ARCH MATCHES amd64)
|
||||||
list(APPEND MSVCRTEX_SOURCE
|
list(APPEND MSVCRTEX_SOURCE
|
||||||
except/amd64/chkstk_asm.s
|
except/amd64/chkstk_asm.s
|
||||||
except/amd64/chkstk_ms.s
|
except/amd64/chkstk_ms.s)
|
||||||
math/amd64/alldiv.S)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
|
|
|
@ -77,7 +77,7 @@ FUNC _setjmp
|
||||||
movdqa [rcx + JUMP_BUFFER_Xmm15], xmm15
|
movdqa [rcx + JUMP_BUFFER_Xmm15], xmm15
|
||||||
xor rax, rax
|
xor rax, rax
|
||||||
ret
|
ret
|
||||||
ENDFUNC _setjmp
|
ENDFUNC
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* int _setjmpex(jmp_buf _Buf,void *_Ctx);
|
* int _setjmpex(jmp_buf _Buf,void *_Ctx);
|
||||||
|
@ -119,7 +119,7 @@ FUNC _setjmpex
|
||||||
movdqa [rcx + JUMP_BUFFER_Xmm15], xmm15
|
movdqa [rcx + JUMP_BUFFER_Xmm15], xmm15
|
||||||
xor rax, rax
|
xor rax, rax
|
||||||
ret
|
ret
|
||||||
ENDFUNC _setjmpex
|
ENDFUNC
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -164,6 +164,6 @@ FUNC longjmp
|
||||||
jnz l2
|
jnz l2
|
||||||
inc rax
|
inc rax
|
||||||
l2: jmp r8
|
l2: jmp r8
|
||||||
ENDFUNC longjmp
|
ENDFUNC
|
||||||
|
|
||||||
END
|
END
|
||||||
|
|
|
@ -7,8 +7,6 @@
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
int _fltused;
|
|
||||||
|
|
||||||
int __mingw_init_ehandler (void)
|
int __mingw_init_ehandler (void)
|
||||||
{
|
{
|
||||||
/* Nothing to do */
|
/* Nothing to do */
|
||||||
|
|
|
@ -78,7 +78,6 @@
|
||||||
/* MMPTE related defines */
|
/* MMPTE related defines */
|
||||||
#define MM_EMPTY_PTE_LIST ((ULONG64)0xFFFFFFFF)
|
#define MM_EMPTY_PTE_LIST ((ULONG64)0xFFFFFFFF)
|
||||||
#define MM_EMPTY_LIST ((ULONG_PTR)-1)
|
#define MM_EMPTY_LIST ((ULONG_PTR)-1)
|
||||||
#define PTE_PER_PAGE 0x200
|
|
||||||
|
|
||||||
#define ADDR_TO_PAGE_TABLE(v) ((ULONG)(((ULONG_PTR)(v)) / (512 * PAGE_SIZE)))
|
#define ADDR_TO_PAGE_TABLE(v) ((ULONG)(((ULONG_PTR)(v)) / (512 * PAGE_SIZE)))
|
||||||
#define ADDR_TO_PDE_OFFSET(v) ((ULONG)((((ULONG_PTR)(v)) / (512 * PAGE_SIZE))))
|
#define ADDR_TO_PDE_OFFSET(v) ((ULONG)((((ULONG_PTR)(v)) / (512 * PAGE_SIZE))))
|
||||||
|
|
|
@ -36,7 +36,7 @@ PUBLIC KiSwitchToBootStack
|
||||||
|
|
||||||
jmp KiSystemStartupBootStack
|
jmp KiSystemStartupBootStack
|
||||||
|
|
||||||
.ENDP KiSwitchToBootStack
|
.ENDP
|
||||||
|
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,7 @@ KiInitializeContextThread(IN PKTHREAD Thread,
|
||||||
|
|
||||||
/* Set the Thread's NPX State */
|
/* Set the Thread's NPX State */
|
||||||
Thread->NpxState = 0xA;
|
Thread->NpxState = 0xA;
|
||||||
Thread->DispatcherHeader.NpxIrql = PASSIVE_LEVEL;
|
Thread->Header.NpxIrql = PASSIVE_LEVEL;
|
||||||
|
|
||||||
/* Disable any debug regiseters */
|
/* Disable any debug regiseters */
|
||||||
Context->ContextFlags &= ~CONTEXT_DEBUG_REGISTERS;
|
Context->ContextFlags &= ~CONTEXT_DEBUG_REGISTERS;
|
||||||
|
|
|
@ -135,7 +135,7 @@ ENDR
|
||||||
|
|
||||||
add rsp, EXCEPTION_RECORD_LENGTH + KEXCEPTION_FRAME_LENGTH
|
add rsp, EXCEPTION_RECORD_LENGTH + KEXCEPTION_FRAME_LENGTH
|
||||||
ret
|
ret
|
||||||
.ENDP InternalDispatchException
|
.ENDP
|
||||||
|
|
||||||
|
|
||||||
/* SOFTWARE INTERRUPT SERVICES ***********************************************/
|
/* SOFTWARE INTERRUPT SERVICES ***********************************************/
|
||||||
|
@ -153,7 +153,7 @@ FUNC KiDivideErrorFault
|
||||||
|
|
||||||
/* Return */
|
/* Return */
|
||||||
ExitTrap TF_SAVE_ALL
|
ExitTrap TF_SAVE_ALL
|
||||||
ENDFUNC KiDivideErrorFault
|
ENDFUNC
|
||||||
|
|
||||||
|
|
||||||
PUBLIC KiDebugTrapOrFault
|
PUBLIC KiDebugTrapOrFault
|
||||||
|
@ -174,7 +174,7 @@ KiDebugTrapOrFaultKMode:
|
||||||
|
|
||||||
/* Return */
|
/* Return */
|
||||||
ExitTrap TF_SAVE_ALL
|
ExitTrap TF_SAVE_ALL
|
||||||
ENDFUNC KiDebugTrapOrFault
|
ENDFUNC
|
||||||
|
|
||||||
|
|
||||||
PUBLIC KiNmiInterrupt
|
PUBLIC KiNmiInterrupt
|
||||||
|
@ -187,7 +187,7 @@ FUNC KiNmiInterrupt
|
||||||
|
|
||||||
/* Return */
|
/* Return */
|
||||||
ExitTrap TF_SAVE_ALL
|
ExitTrap TF_SAVE_ALL
|
||||||
ENDFUNC KiNmiInterrupt
|
ENDFUNC
|
||||||
|
|
||||||
|
|
||||||
PUBLIC KiBreakpointTrap
|
PUBLIC KiBreakpointTrap
|
||||||
|
@ -200,7 +200,7 @@ FUNC KiBreakpointTrap
|
||||||
|
|
||||||
/* Return */
|
/* Return */
|
||||||
ExitTrap TF_SAVE_ALL
|
ExitTrap TF_SAVE_ALL
|
||||||
ENDFUNC KiBreakpointTrap
|
ENDFUNC
|
||||||
|
|
||||||
|
|
||||||
PUBLIC KiOverflowTrap
|
PUBLIC KiOverflowTrap
|
||||||
|
@ -216,7 +216,7 @@ FUNC KiOverflowTrap
|
||||||
|
|
||||||
/* Return */
|
/* Return */
|
||||||
ExitTrap TF_SAVE_ALL
|
ExitTrap TF_SAVE_ALL
|
||||||
ENDFUNC KiOverflowTrap
|
ENDFUNC
|
||||||
|
|
||||||
|
|
||||||
PUBLIC KiBoundFault
|
PUBLIC KiBoundFault
|
||||||
|
@ -240,7 +240,7 @@ KiBoundFaultUserMode:
|
||||||
|
|
||||||
/* Return */
|
/* Return */
|
||||||
ExitTrap TF_SAVE_ALL
|
ExitTrap TF_SAVE_ALL
|
||||||
ENDFUNC KiBoundFault
|
ENDFUNC
|
||||||
|
|
||||||
|
|
||||||
PUBLIC KiInvalidOpcodeFault
|
PUBLIC KiInvalidOpcodeFault
|
||||||
|
@ -265,7 +265,7 @@ KiInvalidOpcodeKernel:
|
||||||
|
|
||||||
/* Return */
|
/* Return */
|
||||||
ExitTrap TF_SAVE_ALL
|
ExitTrap TF_SAVE_ALL
|
||||||
ENDFUNC KiInvalidOpcodeFault
|
ENDFUNC
|
||||||
|
|
||||||
|
|
||||||
PUBLIC KiNpxNotAvailableFault
|
PUBLIC KiNpxNotAvailableFault
|
||||||
|
@ -287,7 +287,7 @@ FUNC KiNpxNotAvailableFault
|
||||||
KiNpxNotAvailableFaultExit:
|
KiNpxNotAvailableFaultExit:
|
||||||
/* Return */
|
/* Return */
|
||||||
ExitTrap TF_SAVE_ALL
|
ExitTrap TF_SAVE_ALL
|
||||||
ENDFUNC KiNpxNotAvailableFault
|
ENDFUNC
|
||||||
|
|
||||||
|
|
||||||
PUBLIC KiDoubleFaultAbort
|
PUBLIC KiDoubleFaultAbort
|
||||||
|
@ -298,7 +298,7 @@ FUNC KiDoubleFaultAbort
|
||||||
/* Bugcheck */
|
/* Bugcheck */
|
||||||
Fatal 8 // EXCEPTION_DOUBLE_FAULT
|
Fatal 8 // EXCEPTION_DOUBLE_FAULT
|
||||||
jmp $
|
jmp $
|
||||||
ENDFUNC KiDoubleFaultAbort
|
ENDFUNC
|
||||||
|
|
||||||
|
|
||||||
PUBLIC KiNpxSegmentOverrunAbort
|
PUBLIC KiNpxSegmentOverrunAbort
|
||||||
|
@ -309,7 +309,7 @@ FUNC KiNpxSegmentOverrunAbort
|
||||||
/* Bugcheck */
|
/* Bugcheck */
|
||||||
Fatal EXCEPTION_NPX_OVERRUN
|
Fatal EXCEPTION_NPX_OVERRUN
|
||||||
jmp $
|
jmp $
|
||||||
ENDFUNC KiNpxSegmentOverrunAbort
|
ENDFUNC
|
||||||
|
|
||||||
|
|
||||||
PUBLIC KiInvalidTssFault
|
PUBLIC KiInvalidTssFault
|
||||||
|
@ -320,7 +320,7 @@ FUNC KiInvalidTssFault
|
||||||
/* Bugcheck */
|
/* Bugcheck */
|
||||||
Fatal EXCEPTION_INVALID_TSS
|
Fatal EXCEPTION_INVALID_TSS
|
||||||
jmp $
|
jmp $
|
||||||
ENDFUNC KiInvalidTssFault
|
ENDFUNC
|
||||||
|
|
||||||
|
|
||||||
PUBLIC KiSegmentNotPresentFault
|
PUBLIC KiSegmentNotPresentFault
|
||||||
|
@ -331,7 +331,7 @@ FUNC KiSegmentNotPresentFault
|
||||||
/* Bugcheck */
|
/* Bugcheck */
|
||||||
Fatal EXCEPTION_SEGMENT_NOT_PRESENT
|
Fatal EXCEPTION_SEGMENT_NOT_PRESENT
|
||||||
jmp $
|
jmp $
|
||||||
ENDFUNC KiSegmentNotPresentFault
|
ENDFUNC
|
||||||
|
|
||||||
|
|
||||||
PUBLIC KiStackFault
|
PUBLIC KiStackFault
|
||||||
|
@ -342,7 +342,7 @@ FUNC KiStackFault
|
||||||
/* Bugcheck */
|
/* Bugcheck */
|
||||||
Fatal EXCEPTION_STACK_FAULT
|
Fatal EXCEPTION_STACK_FAULT
|
||||||
jmp $
|
jmp $
|
||||||
ENDFUNC KiStackFault
|
ENDFUNC
|
||||||
|
|
||||||
|
|
||||||
PUBLIC KiGeneralProtectionFault
|
PUBLIC KiGeneralProtectionFault
|
||||||
|
@ -376,7 +376,7 @@ KiGpfExit:
|
||||||
/* Return */
|
/* Return */
|
||||||
/* Return */
|
/* Return */
|
||||||
ExitTrap TF_SAVE_ALL
|
ExitTrap TF_SAVE_ALL
|
||||||
ENDFUNC KiGeneralProtectionFault
|
ENDFUNC
|
||||||
|
|
||||||
|
|
||||||
PUBLIC KiPageFault
|
PUBLIC KiPageFault
|
||||||
|
@ -435,7 +435,7 @@ SpecialCode:
|
||||||
PageFaultReturn:
|
PageFaultReturn:
|
||||||
/* Return */
|
/* Return */
|
||||||
ExitTrap TF_SAVE_ALL
|
ExitTrap TF_SAVE_ALL
|
||||||
ENDFUNC KiPageFault
|
ENDFUNC
|
||||||
|
|
||||||
|
|
||||||
PUBLIC KiFloatingErrorFault
|
PUBLIC KiFloatingErrorFault
|
||||||
|
@ -448,7 +448,7 @@ FUNC KiFloatingErrorFault
|
||||||
|
|
||||||
/* Return */
|
/* Return */
|
||||||
ExitTrap TF_SAVE_ALL
|
ExitTrap TF_SAVE_ALL
|
||||||
ENDFUNC KiFloatingErrorFault
|
ENDFUNC
|
||||||
|
|
||||||
|
|
||||||
PUBLIC KiAlignmentFault
|
PUBLIC KiAlignmentFault
|
||||||
|
@ -459,7 +459,7 @@ FUNC KiAlignmentFault
|
||||||
/* Bugcheck */
|
/* Bugcheck */
|
||||||
Fatal EXCEPTION_ALIGNMENT_CHECK
|
Fatal EXCEPTION_ALIGNMENT_CHECK
|
||||||
jmp $
|
jmp $
|
||||||
ENDFUNC KiAlignmentFault
|
ENDFUNC
|
||||||
|
|
||||||
|
|
||||||
PUBLIC KiMcheckAbort
|
PUBLIC KiMcheckAbort
|
||||||
|
@ -470,7 +470,7 @@ FUNC KiMcheckAbort
|
||||||
/* Bugcheck */
|
/* Bugcheck */
|
||||||
Fatal HEX(12)
|
Fatal HEX(12)
|
||||||
jmp $
|
jmp $
|
||||||
ENDFUNC KiMcheckAbort
|
ENDFUNC
|
||||||
|
|
||||||
|
|
||||||
PUBLIC KiXmmException
|
PUBLIC KiXmmException
|
||||||
|
@ -492,7 +492,7 @@ FUNC KiXmmException
|
||||||
KiXmmExit:
|
KiXmmExit:
|
||||||
/* Return */
|
/* Return */
|
||||||
ExitTrap TF_SAVE_ALL
|
ExitTrap TF_SAVE_ALL
|
||||||
ENDFUNC KiXmmException
|
ENDFUNC
|
||||||
|
|
||||||
|
|
||||||
PUBLIC KiRaiseAssertion
|
PUBLIC KiRaiseAssertion
|
||||||
|
@ -508,7 +508,7 @@ FUNC KiRaiseAssertion
|
||||||
|
|
||||||
/* Return */
|
/* Return */
|
||||||
ExitTrap TF_SAVE_ALL
|
ExitTrap TF_SAVE_ALL
|
||||||
ENDFUNC KiRaiseAssertion
|
ENDFUNC
|
||||||
|
|
||||||
|
|
||||||
PUBLIC KiDebugServiceTrap
|
PUBLIC KiDebugServiceTrap
|
||||||
|
@ -524,7 +524,7 @@ PUBLIC KiDebugServiceTrap
|
||||||
|
|
||||||
/* Return */
|
/* Return */
|
||||||
ExitTrap TF_SAVE_ALL
|
ExitTrap TF_SAVE_ALL
|
||||||
.ENDP KiDebugServiceTrap
|
.ENDP
|
||||||
|
|
||||||
|
|
||||||
PUBLIC KiApcInterrupt
|
PUBLIC KiApcInterrupt
|
||||||
|
@ -554,7 +554,7 @@ PUBLIC KiApcInterrupt
|
||||||
|
|
||||||
/* Return */
|
/* Return */
|
||||||
ExitTrap (TF_VOLATILES or TF_IRQL)
|
ExitTrap (TF_VOLATILES or TF_IRQL)
|
||||||
.ENDP KiApcInterrupt
|
.ENDP
|
||||||
|
|
||||||
|
|
||||||
PUBLIC KiDpcInterrupt
|
PUBLIC KiDpcInterrupt
|
||||||
|
@ -576,7 +576,7 @@ PUBLIC KiDpcInterrupt
|
||||||
|
|
||||||
/* Return */
|
/* Return */
|
||||||
ExitTrap (TF_VOLATILES or TF_IRQL)
|
ExitTrap (TF_VOLATILES or TF_IRQL)
|
||||||
.ENDP KiDpcInterrupt
|
.ENDP
|
||||||
|
|
||||||
|
|
||||||
PUBLIC KiIpiInterrupt
|
PUBLIC KiIpiInterrupt
|
||||||
|
@ -595,7 +595,7 @@ PUBLIC KiIpiInterrupt
|
||||||
|
|
||||||
/* Return */
|
/* Return */
|
||||||
ExitTrap (TF_VOLATILES or TF_IRQL)
|
ExitTrap (TF_VOLATILES or TF_IRQL)
|
||||||
.ENDP KiIpiInterrupt
|
.ENDP
|
||||||
|
|
||||||
|
|
||||||
PUBLIC KiUnexpectedInterrupt
|
PUBLIC KiUnexpectedInterrupt
|
||||||
|
@ -616,7 +616,7 @@ FUNC KiUnexpectedInterrupt
|
||||||
#endif
|
#endif
|
||||||
/* Return */
|
/* Return */
|
||||||
ExitTrap TF_SAVE_ALL
|
ExitTrap TF_SAVE_ALL
|
||||||
ENDFUNC KiUnexpectedInterrupt
|
ENDFUNC
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#undef lgdt
|
#undef lgdt
|
||||||
|
|
|
@ -627,7 +627,7 @@
|
||||||
@ stdcall KeLeaveCriticalRegion() _KeLeaveCriticalRegion
|
@ stdcall KeLeaveCriticalRegion() _KeLeaveCriticalRegion
|
||||||
@ stdcall KeLeaveGuardedRegion() _KeLeaveGuardedRegion
|
@ stdcall KeLeaveGuardedRegion() _KeLeaveGuardedRegion
|
||||||
@ extern KeLoaderBlock
|
@ extern KeLoaderBlock
|
||||||
@ cdecl -arch=x86_64 KeLowerIrql(long)
|
@ cdecl -arch=x86_64 -private KeLowerIrql(long)
|
||||||
@ extern KeNumberProcessors _KeNumberProcessors
|
@ extern KeNumberProcessors _KeNumberProcessors
|
||||||
@ stdcall -arch=i386,arm KeProfileInterrupt(ptr)
|
@ stdcall -arch=i386,arm KeProfileInterrupt(ptr)
|
||||||
@ stdcall KeProfileInterruptWithSource(ptr long)
|
@ stdcall KeProfileInterruptWithSource(ptr long)
|
||||||
|
@ -641,7 +641,7 @@
|
||||||
@ stdcall -arch=i386,arm KeQuerySystemTime(ptr)
|
@ stdcall -arch=i386,arm KeQuerySystemTime(ptr)
|
||||||
@ stdcall -arch=i386,arm KeQueryTickCount(ptr)
|
@ stdcall -arch=i386,arm KeQueryTickCount(ptr)
|
||||||
@ stdcall KeQueryTimeIncrement()
|
@ stdcall KeQueryTimeIncrement()
|
||||||
@ cdecl -arch=x86_64 KeRaiseIrqlToDpcLevel()
|
@ cdecl -arch=x86_64 -private KeRaiseIrqlToDpcLevel()
|
||||||
@ stdcall KeRaiseUserException(long)
|
@ stdcall KeRaiseUserException(long)
|
||||||
@ stdcall KeReadStateEvent(ptr)
|
@ stdcall KeReadStateEvent(ptr)
|
||||||
@ stdcall KeReadStateMutant(ptr)
|
@ stdcall KeReadStateMutant(ptr)
|
||||||
|
@ -654,6 +654,7 @@
|
||||||
@ stdcall KeRegisterNmiCallback(ptr ptr)
|
@ stdcall KeRegisterNmiCallback(ptr ptr)
|
||||||
@ fastcall KeReleaseGuardedMutex(ptr)
|
@ fastcall KeReleaseGuardedMutex(ptr)
|
||||||
@ fastcall KeReleaseGuardedMutexUnsafe(ptr)
|
@ fastcall KeReleaseGuardedMutexUnsafe(ptr)
|
||||||
|
@ cdecl -arch=x86_64 KeReleaseInStackQueuedSpinLock(ptr)
|
||||||
@ fastcall KeReleaseInStackQueuedSpinLockForDpc(ptr)
|
@ fastcall KeReleaseInStackQueuedSpinLockForDpc(ptr)
|
||||||
@ fastcall KeReleaseInStackQueuedSpinLockFromDpcLevel(ptr)
|
@ fastcall KeReleaseInStackQueuedSpinLockFromDpcLevel(ptr)
|
||||||
@ stdcall KeReleaseInterruptSpinLock(ptr long)
|
@ stdcall KeReleaseInterruptSpinLock(ptr long)
|
||||||
|
@ -716,7 +717,7 @@
|
||||||
@ fastcall -arch=i386,arm KefAcquireSpinLockAtDpcLevel(ptr)
|
@ fastcall -arch=i386,arm KefAcquireSpinLockAtDpcLevel(ptr)
|
||||||
@ fastcall -arch=i386,arm KefReleaseSpinLockFromDpcLevel(ptr)
|
@ fastcall -arch=i386,arm KefReleaseSpinLockFromDpcLevel(ptr)
|
||||||
@ stdcall -arch=i386 Kei386EoiHelper()
|
@ stdcall -arch=i386 Kei386EoiHelper()
|
||||||
@ cdecl -arch=x86_64 KfRaiseIrql(long)
|
@ cdecl -arch=x86_64 -private KfRaiseIrql(long)
|
||||||
@ fastcall -arch=i386 KiEoiHelper(ptr)
|
@ fastcall -arch=i386 KiEoiHelper(ptr)
|
||||||
@ fastcall -arch=i386,arm KiAcquireSpinLock(ptr)
|
@ fastcall -arch=i386,arm KiAcquireSpinLock(ptr)
|
||||||
@ extern KiBugCheckData
|
@ extern KiBugCheckData
|
||||||
|
@ -1080,6 +1081,8 @@
|
||||||
@ stdcall RtlConvertSidToUnicodeString(ptr ptr long)
|
@ stdcall RtlConvertSidToUnicodeString(ptr ptr long)
|
||||||
@ stdcall RtlConvertUlongToLargeInteger(long)
|
@ stdcall RtlConvertUlongToLargeInteger(long)
|
||||||
@ stdcall RtlCopyLuid(ptr ptr)
|
@ stdcall RtlCopyLuid(ptr ptr)
|
||||||
|
@ stdcall -arch=x86_64 RtlCopyMemory(ptr ptr int64) memmove
|
||||||
|
@ stdcall -arch=x86_64 RtlCopyMemoryNonTemporal(ptr ptr int64) memmove
|
||||||
@ stdcall RtlCopyRangeList(ptr ptr)
|
@ stdcall RtlCopyRangeList(ptr ptr)
|
||||||
@ stdcall RtlCopySid(long ptr ptr)
|
@ stdcall RtlCopySid(long ptr ptr)
|
||||||
@ stdcall RtlCopyString(ptr ptr)
|
@ stdcall RtlCopyString(ptr ptr)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue