From e3a81ccca5253a57d3512acac805a89ddbc7a600 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Fri, 14 Oct 2011 08:33:22 +0000 Subject: [PATCH] [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 --- reactos/boot/freeldr/bootsect/ext2.S | 2 + .../dll/win32/kernel32/client/amd64/fiber.S | 4 +- reactos/lib/rtl/amd64/except_asm.S | 4 +- reactos/lib/rtl/amd64/rtlmem.S | 6 +-- reactos/lib/sdk/crt/crt.cmake | 2 +- reactos/lib/sdk/crt/except/amd64/chkstk_asm.s | 4 +- reactos/lib/sdk/crt/except/amd64/seh.s | 14 ++--- reactos/lib/sdk/crt/float/amd64/clearfp.S | 2 +- reactos/lib/sdk/crt/float/amd64/fpreset.S | 2 +- reactos/lib/sdk/crt/float/amd64/getsetfpcw.S | 4 +- reactos/lib/sdk/crt/float/amd64/logb.S | 2 +- reactos/lib/sdk/crt/libcntpr.cmake | 2 +- reactos/lib/sdk/crt/math/amd64/alldiv.S | 30 ----------- reactos/lib/sdk/crt/math/amd64/ceil.S | 37 ++++++++++++- reactos/lib/sdk/crt/math/amd64/ceilf.S | 38 ++++++++------ reactos/lib/sdk/crt/math/amd64/floor.S | 2 +- reactos/lib/sdk/crt/math/amd64/floorf.S | 2 +- reactos/lib/sdk/crt/math/i386/alldiv_asm.s | 19 +++---- reactos/lib/sdk/crt/misc/fltused.c | 2 +- reactos/lib/sdk/crt/msvcrtex.cmake | 3 +- reactos/lib/sdk/crt/setjmp/amd64/setjmp.s | 6 +-- reactos/lib/sdk/crt/startup/mscmain.c | 2 - reactos/ntoskrnl/include/internal/amd64/mm.h | 1 - reactos/ntoskrnl/ke/amd64/boot.S | 2 +- reactos/ntoskrnl/ke/amd64/thrdini.c | 2 +- reactos/ntoskrnl/ke/amd64/trap.S | 52 +++++++++---------- reactos/ntoskrnl/ntoskrnl.spec | 9 ++-- 27 files changed, 129 insertions(+), 126 deletions(-) delete mode 100644 reactos/lib/sdk/crt/math/amd64/alldiv.S diff --git a/reactos/boot/freeldr/bootsect/ext2.S b/reactos/boot/freeldr/bootsect/ext2.S index e111db62ae6..2bc5b6d39ec 100644 --- a/reactos/boot/freeldr/bootsect/ext2.S +++ b/reactos/boot/freeldr/bootsect/ext2.S @@ -683,4 +683,6 @@ msgLoading: .word HEX(0aa55) // BootSector signature +.endcode16 + END diff --git a/reactos/dll/win32/kernel32/client/amd64/fiber.S b/reactos/dll/win32/kernel32/client/amd64/fiber.S index 9ff2728f5fa..a3b81d6eda8 100644 --- a/reactos/dll/win32/kernel32/client/amd64/fiber.S +++ b/reactos/dll/win32/kernel32/client/amd64/fiber.S @@ -17,7 +17,7 @@ FUNC BaseFiberStartup /* FIXME: TODO */ ret -ENDFUNC BaseFiberStartup +ENDFUNC PUBLIC SwitchToFiber @@ -27,6 +27,6 @@ FUNC SwitchToFiber UNIMPLEMENTED BaseFiberStartup /* FIXME: TODO */ ret -ENDFUNC SwitchToFiber +ENDFUNC END diff --git a/reactos/lib/rtl/amd64/except_asm.S b/reactos/lib/rtl/amd64/except_asm.S index 54f44ce445a..b56cc48f51c 100644 --- a/reactos/lib/rtl/amd64/except_asm.S +++ b/reactos/lib/rtl/amd64/except_asm.S @@ -15,7 +15,7 @@ .code64 -/* +/* * VOID NTAPI * RtlCaptureContext( * PCONTEXT ContextRecord); @@ -96,7 +96,7 @@ PUBLIC RtlCaptureContext /* Cleanup stack and return */ add rsp, 8 ret -.ENDP RtlCaptureContext +.ENDP END diff --git a/reactos/lib/rtl/amd64/rtlmem.S b/reactos/lib/rtl/amd64/rtlmem.S index e75161061ee..bc7b9021432 100644 --- a/reactos/lib/rtl/amd64/rtlmem.S +++ b/reactos/lib/rtl/amd64/rtlmem.S @@ -2,7 +2,7 @@ * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS Run-Time Library * PURPOSE: Memory functions for amd64 - * FILE: lib/rtl/i386/rtlswap.S + * FILE: lib/rtl/amd64/rtlmem.S * PROGRAMER: Timo Kreuzer (timo.kreuzer@reactos.org) */ @@ -14,7 +14,7 @@ .code64 -/* SIZE_T +/* SIZE_T * RtlCompareMemory( * IN CONST VOID *Source1, * IN CONST VOID *Source2, @@ -81,7 +81,7 @@ RtlCompareMemory6: pop rdi pop rsi ret -.endp RtlCompareMemory +.endp END diff --git a/reactos/lib/sdk/crt/crt.cmake b/reactos/lib/sdk/crt/crt.cmake index 9445bb6a2ae..14fd0fa5975 100644 --- a/reactos/lib/sdk/crt/crt.cmake +++ b/reactos/lib/sdk/crt/crt.cmake @@ -123,6 +123,7 @@ list(APPEND CRT_SOURCE misc/amsg.c misc/assert.c misc/environ.c + misc/fltused.c misc/getargs.c misc/i10output.c misc/initterm.c @@ -384,7 +385,6 @@ elseif(ARCH MATCHES amd64) float/amd64/fpreset.S float/amd64/logb.S float/i386/statfp.c - math/amd64/alldiv.S math/amd64/atan.S math/amd64/atan2.S math/amd64/ceil.S diff --git a/reactos/lib/sdk/crt/except/amd64/chkstk_asm.s b/reactos/lib/sdk/crt/except/amd64/chkstk_asm.s index 421ab55a772..f94d76461bc 100644 --- a/reactos/lib/sdk/crt/except/amd64/chkstk_asm.s +++ b/reactos/lib/sdk/crt/except/amd64/chkstk_asm.s @@ -20,13 +20,13 @@ FUNC __chkstk .endprolog UNIMPLEMENTED chkstk ret -ENDFUNC __chkstk +ENDFUNC FUNC __alloca_probe .endprolog UNIMPLEMENTED alloca_probe ret -ENDFUNC __alloca_probe +ENDFUNC END /* EOF */ diff --git a/reactos/lib/sdk/crt/except/amd64/seh.s b/reactos/lib/sdk/crt/except/amd64/seh.s index 6f8cba65e36..b0a3aeffe7e 100644 --- a/reactos/lib/sdk/crt/except/amd64/seh.s +++ b/reactos/lib/sdk/crt/except/amd64/seh.s @@ -30,36 +30,36 @@ PUBLIC _except_handler3 FUNC _unwind_handler .endprolog ret -ENDFUNC _unwind_handler +ENDFUNC FUNC _global_unwind2 .endprolog ret -ENDFUNC _global_unwind2 +ENDFUNC FUNC _abnormal_termination .endprolog ret -ENDFUNC _abnormal_termination +ENDFUNC FUNC _local_unwind .endprolog ret -ENDFUNC _local_unwind +ENDFUNC FUNC _local_unwind2 .endprolog ret -ENDFUNC _local_unwind2 +ENDFUNC FUNC _except_handler2 .endprolog ret -ENDFUNC _except_handler2 +ENDFUNC FUNC _except_handler3 .endprolog ret -ENDFUNC _except_handler3 +ENDFUNC END diff --git a/reactos/lib/sdk/crt/float/amd64/clearfp.S b/reactos/lib/sdk/crt/float/amd64/clearfp.S index 7d641008109..2df94a9b383 100644 --- a/reactos/lib/sdk/crt/float/amd64/clearfp.S +++ b/reactos/lib/sdk/crt/float/amd64/clearfp.S @@ -10,6 +10,6 @@ FUNC _clearfp .ENDPROLOG fnclex -ENDFUNC _clearfp +ENDFUNC END diff --git a/reactos/lib/sdk/crt/float/amd64/fpreset.S b/reactos/lib/sdk/crt/float/amd64/fpreset.S index c2732012180..8ab5f0f2a55 100644 --- a/reactos/lib/sdk/crt/float/amd64/fpreset.S +++ b/reactos/lib/sdk/crt/float/amd64/fpreset.S @@ -6,6 +6,6 @@ FUNC _fpreset .endprolog fninit -ENDFUNC _fpreset +ENDFUNC END diff --git a/reactos/lib/sdk/crt/float/amd64/getsetfpcw.S b/reactos/lib/sdk/crt/float/amd64/getsetfpcw.S index cbf23ca76c8..79ed731eb7f 100644 --- a/reactos/lib/sdk/crt/float/amd64/getsetfpcw.S +++ b/reactos/lib/sdk/crt/float/amd64/getsetfpcw.S @@ -11,7 +11,7 @@ FUNC __getfpcw87 mov rax, [rsp] add rsp, 8 ret -ENDFUNC __getfpcw87 +ENDFUNC PUBLIC __setfpcw87 FUNC __setfpcw87 @@ -19,6 +19,6 @@ FUNC __setfpcw87 .ENDPROLOG ldmxcsr [rsp + 8] ret -ENDFUNC __setfpcw87 +ENDFUNC END diff --git a/reactos/lib/sdk/crt/float/amd64/logb.S b/reactos/lib/sdk/crt/float/amd64/logb.S index 3293c24acf0..47f9630ea63 100644 --- a/reactos/lib/sdk/crt/float/amd64/logb.S +++ b/reactos/lib/sdk/crt/float/amd64/logb.S @@ -11,6 +11,6 @@ FUNC _logb fxtract fstp st ret -ENDFUNC _logb +ENDFUNC END diff --git a/reactos/lib/sdk/crt/libcntpr.cmake b/reactos/lib/sdk/crt/libcntpr.cmake index 8e7def2dfab..f922f536100 100644 --- a/reactos/lib/sdk/crt/libcntpr.cmake +++ b/reactos/lib/sdk/crt/libcntpr.cmake @@ -9,6 +9,7 @@ list(APPEND LIBCNTPR_SOURCE mem/memccpy.c mem/memcmp.c mem/memicmp.c + misc/fltused.c printf/_snprintf.c printf/_snwprintf.c printf/_vcprintf.c @@ -104,7 +105,6 @@ elseif(ARCH MATCHES amd64) setjmp/amd64/setjmp.s math/cos.c math/sin.c - math/amd64/alldiv.S math/amd64/atan.S math/amd64/atan2.S math/amd64/ceil.S diff --git a/reactos/lib/sdk/crt/math/amd64/alldiv.S b/reactos/lib/sdk/crt/math/amd64/alldiv.S deleted file mode 100644 index f4608b2102a..00000000000 --- a/reactos/lib/sdk/crt/math/amd64/alldiv.S +++ /dev/null @@ -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 - -/* DATA **********************************************************************/ -.code64 - -PUBLIC _fltused -_fltused: - .long HEX(9875) - -/* CODE **********************************************************************/ -.code64 - -FUNC alldiv - .endprolog - UNIMPLEMENTED alldiv - ret - -ENDFUNC alldiv - -END diff --git a/reactos/lib/sdk/crt/math/amd64/ceil.S b/reactos/lib/sdk/crt/math/amd64/ceil.S index c5b7d6dfc63..f88403e241c 100644 --- a/reactos/lib/sdk/crt/math/amd64/ceil.S +++ b/reactos/lib/sdk/crt/math/amd64/ceil.S @@ -14,9 +14,42 @@ /* CODE **********************************************************************/ .code64 +/* ceil(x) = - floor(-x) + */ PUBLIC ceil -ceil: - UNIMPLEMENTED ceil +.PROC 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 +.ENDP END diff --git a/reactos/lib/sdk/crt/math/amd64/ceilf.S b/reactos/lib/sdk/crt/math/amd64/ceilf.S index 66153351272..6063ddb1d5e 100644 --- a/reactos/lib/sdk/crt/math/amd64/ceilf.S +++ b/reactos/lib/sdk/crt/math/amd64/ceilf.S @@ -19,29 +19,33 @@ FUNC ceilf sub rsp, 16 .ENDPROLOG - /* Put parameter on the stack */ - movss dword ptr [rsp], xmm0 - fld dword ptr [rsp] + /* Duplicate the bits into eax (zero exteneded to rax) */ + movd eax, xmm0 - /* Change fpu control word to round up */ - fstcw [rsp + 8] - mov eax, [rsp + 8] - or eax, HEX(00800) - and eax, HEX(0fbff) - mov [rsp + 12], eax - fldcw [rsp + 12] + /* Invert the sign bit */ + xor eax, HEX(80000000) - /* Round to integer */ - frndint + /* Copy back to xmm0 */ + movd xmm0, eax - /* Restore fpu control word */ - fldcw [rsp + 8] + /* Truncate xmm0 to integer (single precision) */ + cvttss2si rcx, xmm0 - fstp dword ptr [rsp] - movss xmm0, dword ptr [rsp] + /* Shift all bits to the right, keeping the sign bit */ + 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 ret -ENDFUNC ceilf +ENDFUNC END diff --git a/reactos/lib/sdk/crt/math/amd64/floor.S b/reactos/lib/sdk/crt/math/amd64/floor.S index ca0343fab7e..95724686824 100644 --- a/reactos/lib/sdk/crt/math/amd64/floor.S +++ b/reactos/lib/sdk/crt/math/amd64/floor.S @@ -36,6 +36,6 @@ FUNC floor add rsp, 16 ret -ENDFUNC floor +ENDFUNC END diff --git a/reactos/lib/sdk/crt/math/amd64/floorf.S b/reactos/lib/sdk/crt/math/amd64/floorf.S index e3b30bad4d4..176c481ba4f 100644 --- a/reactos/lib/sdk/crt/math/amd64/floorf.S +++ b/reactos/lib/sdk/crt/math/amd64/floorf.S @@ -36,6 +36,6 @@ FUNC floorf add rsp, 16 ret -ENDFUNC floorf +ENDFUNC END diff --git a/reactos/lib/sdk/crt/math/i386/alldiv_asm.s b/reactos/lib/sdk/crt/math/i386/alldiv_asm.s index 5061fb7c21f..3b9a13d99df 100644 --- a/reactos/lib/sdk/crt/math/i386/alldiv_asm.s +++ b/reactos/lib/sdk/crt/math/i386/alldiv_asm.s @@ -6,20 +6,20 @@ * PROGRAMER: Alex Ionescu (alex@relsoft.net) * * Copyright (C) 2002 Michael Ringgaard. - * All rights reserved. + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * 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 * 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 * 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) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * 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. */ #include PUBLIC __alldiv -PUBLIC __fltused /* DATA ********************************************************************/ .data ASSUME CS:NOTHING, DS:NOTHING, ES:NOTHING, FS:NOTHING, GS:NOTHING -__fltused: - .long HEX(9875) - - /* FUNCTIONS ***************************************************************/ .code diff --git a/reactos/lib/sdk/crt/misc/fltused.c b/reactos/lib/sdk/crt/misc/fltused.c index bf706c69c52..366d6bf9a7a 100644 --- a/reactos/lib/sdk/crt/misc/fltused.c +++ b/reactos/lib/sdk/crt/misc/fltused.c @@ -1,2 +1,2 @@ -int _fltused; +int _fltused = 0x9875; diff --git a/reactos/lib/sdk/crt/msvcrtex.cmake b/reactos/lib/sdk/crt/msvcrtex.cmake index b54f1766334..066500a2870 100644 --- a/reactos/lib/sdk/crt/msvcrtex.cmake +++ b/reactos/lib/sdk/crt/msvcrtex.cmake @@ -51,8 +51,7 @@ if(ARCH MATCHES i386) elseif(ARCH MATCHES amd64) list(APPEND MSVCRTEX_SOURCE except/amd64/chkstk_asm.s - except/amd64/chkstk_ms.s - math/amd64/alldiv.S) + except/amd64/chkstk_ms.s) endif() if(MSVC) diff --git a/reactos/lib/sdk/crt/setjmp/amd64/setjmp.s b/reactos/lib/sdk/crt/setjmp/amd64/setjmp.s index 3c4b449c621..6aee6dbe07a 100644 --- a/reactos/lib/sdk/crt/setjmp/amd64/setjmp.s +++ b/reactos/lib/sdk/crt/setjmp/amd64/setjmp.s @@ -77,7 +77,7 @@ FUNC _setjmp movdqa [rcx + JUMP_BUFFER_Xmm15], xmm15 xor rax, rax ret -ENDFUNC _setjmp +ENDFUNC /*! * int _setjmpex(jmp_buf _Buf,void *_Ctx); @@ -119,7 +119,7 @@ FUNC _setjmpex movdqa [rcx + JUMP_BUFFER_Xmm15], xmm15 xor rax, rax ret -ENDFUNC _setjmpex +ENDFUNC /*! @@ -164,6 +164,6 @@ FUNC longjmp jnz l2 inc rax l2: jmp r8 -ENDFUNC longjmp +ENDFUNC END diff --git a/reactos/lib/sdk/crt/startup/mscmain.c b/reactos/lib/sdk/crt/startup/mscmain.c index 8917fd46b08..5c97b67f87b 100644 --- a/reactos/lib/sdk/crt/startup/mscmain.c +++ b/reactos/lib/sdk/crt/startup/mscmain.c @@ -7,8 +7,6 @@ #include #include -int _fltused; - int __mingw_init_ehandler (void) { /* Nothing to do */ diff --git a/reactos/ntoskrnl/include/internal/amd64/mm.h b/reactos/ntoskrnl/include/internal/amd64/mm.h index 946208dc69c..fcada6d9e49 100644 --- a/reactos/ntoskrnl/include/internal/amd64/mm.h +++ b/reactos/ntoskrnl/include/internal/amd64/mm.h @@ -78,7 +78,6 @@ /* MMPTE related defines */ #define MM_EMPTY_PTE_LIST ((ULONG64)0xFFFFFFFF) #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_PDE_OFFSET(v) ((ULONG)((((ULONG_PTR)(v)) / (512 * PAGE_SIZE)))) diff --git a/reactos/ntoskrnl/ke/amd64/boot.S b/reactos/ntoskrnl/ke/amd64/boot.S index 5be8adc21dc..2c77c51781b 100644 --- a/reactos/ntoskrnl/ke/amd64/boot.S +++ b/reactos/ntoskrnl/ke/amd64/boot.S @@ -36,7 +36,7 @@ PUBLIC KiSwitchToBootStack jmp KiSystemStartupBootStack -.ENDP KiSwitchToBootStack +.ENDP END diff --git a/reactos/ntoskrnl/ke/amd64/thrdini.c b/reactos/ntoskrnl/ke/amd64/thrdini.c index ce81b1398d6..058f34dd9de 100644 --- a/reactos/ntoskrnl/ke/amd64/thrdini.c +++ b/reactos/ntoskrnl/ke/amd64/thrdini.c @@ -90,7 +90,7 @@ KiInitializeContextThread(IN PKTHREAD Thread, /* Set the Thread's NPX State */ Thread->NpxState = 0xA; - Thread->DispatcherHeader.NpxIrql = PASSIVE_LEVEL; + Thread->Header.NpxIrql = PASSIVE_LEVEL; /* Disable any debug regiseters */ Context->ContextFlags &= ~CONTEXT_DEBUG_REGISTERS; diff --git a/reactos/ntoskrnl/ke/amd64/trap.S b/reactos/ntoskrnl/ke/amd64/trap.S index b2751756d73..42db568b35b 100644 --- a/reactos/ntoskrnl/ke/amd64/trap.S +++ b/reactos/ntoskrnl/ke/amd64/trap.S @@ -135,7 +135,7 @@ ENDR add rsp, EXCEPTION_RECORD_LENGTH + KEXCEPTION_FRAME_LENGTH ret -.ENDP InternalDispatchException +.ENDP /* SOFTWARE INTERRUPT SERVICES ***********************************************/ @@ -153,7 +153,7 @@ FUNC KiDivideErrorFault /* Return */ ExitTrap TF_SAVE_ALL -ENDFUNC KiDivideErrorFault +ENDFUNC PUBLIC KiDebugTrapOrFault @@ -174,7 +174,7 @@ KiDebugTrapOrFaultKMode: /* Return */ ExitTrap TF_SAVE_ALL -ENDFUNC KiDebugTrapOrFault +ENDFUNC PUBLIC KiNmiInterrupt @@ -187,7 +187,7 @@ FUNC KiNmiInterrupt /* Return */ ExitTrap TF_SAVE_ALL -ENDFUNC KiNmiInterrupt +ENDFUNC PUBLIC KiBreakpointTrap @@ -200,7 +200,7 @@ FUNC KiBreakpointTrap /* Return */ ExitTrap TF_SAVE_ALL -ENDFUNC KiBreakpointTrap +ENDFUNC PUBLIC KiOverflowTrap @@ -216,7 +216,7 @@ FUNC KiOverflowTrap /* Return */ ExitTrap TF_SAVE_ALL -ENDFUNC KiOverflowTrap +ENDFUNC PUBLIC KiBoundFault @@ -240,7 +240,7 @@ KiBoundFaultUserMode: /* Return */ ExitTrap TF_SAVE_ALL -ENDFUNC KiBoundFault +ENDFUNC PUBLIC KiInvalidOpcodeFault @@ -265,7 +265,7 @@ KiInvalidOpcodeKernel: /* Return */ ExitTrap TF_SAVE_ALL -ENDFUNC KiInvalidOpcodeFault +ENDFUNC PUBLIC KiNpxNotAvailableFault @@ -287,7 +287,7 @@ FUNC KiNpxNotAvailableFault KiNpxNotAvailableFaultExit: /* Return */ ExitTrap TF_SAVE_ALL -ENDFUNC KiNpxNotAvailableFault +ENDFUNC PUBLIC KiDoubleFaultAbort @@ -298,7 +298,7 @@ FUNC KiDoubleFaultAbort /* Bugcheck */ Fatal 8 // EXCEPTION_DOUBLE_FAULT jmp $ -ENDFUNC KiDoubleFaultAbort +ENDFUNC PUBLIC KiNpxSegmentOverrunAbort @@ -309,7 +309,7 @@ FUNC KiNpxSegmentOverrunAbort /* Bugcheck */ Fatal EXCEPTION_NPX_OVERRUN jmp $ -ENDFUNC KiNpxSegmentOverrunAbort +ENDFUNC PUBLIC KiInvalidTssFault @@ -320,7 +320,7 @@ FUNC KiInvalidTssFault /* Bugcheck */ Fatal EXCEPTION_INVALID_TSS jmp $ -ENDFUNC KiInvalidTssFault +ENDFUNC PUBLIC KiSegmentNotPresentFault @@ -331,7 +331,7 @@ FUNC KiSegmentNotPresentFault /* Bugcheck */ Fatal EXCEPTION_SEGMENT_NOT_PRESENT jmp $ -ENDFUNC KiSegmentNotPresentFault +ENDFUNC PUBLIC KiStackFault @@ -342,7 +342,7 @@ FUNC KiStackFault /* Bugcheck */ Fatal EXCEPTION_STACK_FAULT jmp $ -ENDFUNC KiStackFault +ENDFUNC PUBLIC KiGeneralProtectionFault @@ -376,7 +376,7 @@ KiGpfExit: /* Return */ /* Return */ ExitTrap TF_SAVE_ALL -ENDFUNC KiGeneralProtectionFault +ENDFUNC PUBLIC KiPageFault @@ -435,7 +435,7 @@ SpecialCode: PageFaultReturn: /* Return */ ExitTrap TF_SAVE_ALL -ENDFUNC KiPageFault +ENDFUNC PUBLIC KiFloatingErrorFault @@ -448,7 +448,7 @@ FUNC KiFloatingErrorFault /* Return */ ExitTrap TF_SAVE_ALL -ENDFUNC KiFloatingErrorFault +ENDFUNC PUBLIC KiAlignmentFault @@ -459,7 +459,7 @@ FUNC KiAlignmentFault /* Bugcheck */ Fatal EXCEPTION_ALIGNMENT_CHECK jmp $ -ENDFUNC KiAlignmentFault +ENDFUNC PUBLIC KiMcheckAbort @@ -470,7 +470,7 @@ FUNC KiMcheckAbort /* Bugcheck */ Fatal HEX(12) jmp $ -ENDFUNC KiMcheckAbort +ENDFUNC PUBLIC KiXmmException @@ -492,7 +492,7 @@ FUNC KiXmmException KiXmmExit: /* Return */ ExitTrap TF_SAVE_ALL -ENDFUNC KiXmmException +ENDFUNC PUBLIC KiRaiseAssertion @@ -508,7 +508,7 @@ FUNC KiRaiseAssertion /* Return */ ExitTrap TF_SAVE_ALL -ENDFUNC KiRaiseAssertion +ENDFUNC PUBLIC KiDebugServiceTrap @@ -524,7 +524,7 @@ PUBLIC KiDebugServiceTrap /* Return */ ExitTrap TF_SAVE_ALL -.ENDP KiDebugServiceTrap +.ENDP PUBLIC KiApcInterrupt @@ -554,7 +554,7 @@ PUBLIC KiApcInterrupt /* Return */ ExitTrap (TF_VOLATILES or TF_IRQL) -.ENDP KiApcInterrupt +.ENDP PUBLIC KiDpcInterrupt @@ -576,7 +576,7 @@ PUBLIC KiDpcInterrupt /* Return */ ExitTrap (TF_VOLATILES or TF_IRQL) -.ENDP KiDpcInterrupt +.ENDP PUBLIC KiIpiInterrupt @@ -595,7 +595,7 @@ PUBLIC KiIpiInterrupt /* Return */ ExitTrap (TF_VOLATILES or TF_IRQL) -.ENDP KiIpiInterrupt +.ENDP PUBLIC KiUnexpectedInterrupt @@ -616,7 +616,7 @@ FUNC KiUnexpectedInterrupt #endif /* Return */ ExitTrap TF_SAVE_ALL -ENDFUNC KiUnexpectedInterrupt +ENDFUNC #ifdef _MSC_VER #undef lgdt diff --git a/reactos/ntoskrnl/ntoskrnl.spec b/reactos/ntoskrnl/ntoskrnl.spec index 762b0efaa23..759d11716dc 100644 --- a/reactos/ntoskrnl/ntoskrnl.spec +++ b/reactos/ntoskrnl/ntoskrnl.spec @@ -627,7 +627,7 @@ @ stdcall KeLeaveCriticalRegion() _KeLeaveCriticalRegion @ stdcall KeLeaveGuardedRegion() _KeLeaveGuardedRegion @ extern KeLoaderBlock -@ cdecl -arch=x86_64 KeLowerIrql(long) +@ cdecl -arch=x86_64 -private KeLowerIrql(long) @ extern KeNumberProcessors _KeNumberProcessors @ stdcall -arch=i386,arm KeProfileInterrupt(ptr) @ stdcall KeProfileInterruptWithSource(ptr long) @@ -641,7 +641,7 @@ @ stdcall -arch=i386,arm KeQuerySystemTime(ptr) @ stdcall -arch=i386,arm KeQueryTickCount(ptr) @ stdcall KeQueryTimeIncrement() -@ cdecl -arch=x86_64 KeRaiseIrqlToDpcLevel() +@ cdecl -arch=x86_64 -private KeRaiseIrqlToDpcLevel() @ stdcall KeRaiseUserException(long) @ stdcall KeReadStateEvent(ptr) @ stdcall KeReadStateMutant(ptr) @@ -654,6 +654,7 @@ @ stdcall KeRegisterNmiCallback(ptr ptr) @ fastcall KeReleaseGuardedMutex(ptr) @ fastcall KeReleaseGuardedMutexUnsafe(ptr) +@ cdecl -arch=x86_64 KeReleaseInStackQueuedSpinLock(ptr) @ fastcall KeReleaseInStackQueuedSpinLockForDpc(ptr) @ fastcall KeReleaseInStackQueuedSpinLockFromDpcLevel(ptr) @ stdcall KeReleaseInterruptSpinLock(ptr long) @@ -716,7 +717,7 @@ @ fastcall -arch=i386,arm KefAcquireSpinLockAtDpcLevel(ptr) @ fastcall -arch=i386,arm KefReleaseSpinLockFromDpcLevel(ptr) @ 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,arm KiAcquireSpinLock(ptr) @ extern KiBugCheckData @@ -1080,6 +1081,8 @@ @ stdcall RtlConvertSidToUnicodeString(ptr ptr long) @ stdcall RtlConvertUlongToLargeInteger(long) @ 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 RtlCopySid(long ptr ptr) @ stdcall RtlCopyString(ptr ptr)