mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 17:44:45 +00:00
[NTOS:KE] Also rewrite KeZeroPages in assembly for amd64
Let's stick with "rep movsq" until we are able to have more precise benchmarks
This commit is contained in:
parent
51258295bd
commit
42bec35f65
3 changed files with 47 additions and 11 deletions
|
@ -88,16 +88,6 @@ KiDpcInterruptHandler(VOID)
|
|||
KeLowerIrql(OldIrql);
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
FASTCALL
|
||||
KeZeroPages(IN PVOID Address,
|
||||
IN ULONG Size)
|
||||
{
|
||||
/* Not using XMMI in this routine */
|
||||
RtlZeroMemory(Address, Size);
|
||||
}
|
||||
|
||||
PVOID
|
||||
KiSwitchKernelStackHelper(
|
||||
LONG_PTR StackOffset,
|
||||
|
|
45
ntoskrnl/ke/amd64/zeropage.S
Normal file
45
ntoskrnl/ke/amd64/zeropage.S
Normal file
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* PROJECT: ReactOS Kernel
|
||||
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
|
||||
* PURPOSE: Fast zeroing of pages
|
||||
* COPYRIGHT: Copyright 2021 Jérôme Gardou <jerome.gardou@reactos.org>
|
||||
*/
|
||||
|
||||
#include <asm.inc>
|
||||
|
||||
/* FUNCTIONS ****************************************************************/
|
||||
.code
|
||||
|
||||
/* Benchmarking from Timo on some AMD machine:
|
||||
rep movsq : 128
|
||||
movaps 175
|
||||
movnti 620
|
||||
movntdq: 620
|
||||
movntps: 620
|
||||
MS KeZeroPages (movnti unrolled): 883
|
||||
MS KeZeroSinglePage (mov): 346
|
||||
|
||||
whole discussion in https://github.com/reactos/reactos/pull/3765
|
||||
We stick with rep stosq.
|
||||
*/
|
||||
|
||||
/*
|
||||
* VOID
|
||||
* KeZeroPages(PVOID Ptr, ULONG Size);
|
||||
*/
|
||||
PUBLIC KeZeroPages
|
||||
FUNC KeZeroPages
|
||||
push rdi
|
||||
.PUSHREG rdi
|
||||
.ENDPROLOG
|
||||
|
||||
mov rdi, rcx
|
||||
mov ecx, edx
|
||||
shr ecx, 3
|
||||
xor rax, rax
|
||||
rep stosq
|
||||
pop rdi
|
||||
ret
|
||||
ENDFUNC
|
||||
|
||||
END
|
|
@ -328,7 +328,8 @@ elseif(ARCH STREQUAL "amd64")
|
|||
${REACTOS_SOURCE_DIR}/ntoskrnl/ke/amd64/boot.S
|
||||
${REACTOS_SOURCE_DIR}/ntoskrnl/ke/amd64/ctxswitch.S
|
||||
${REACTOS_SOURCE_DIR}/ntoskrnl/ke/amd64/trap.S
|
||||
${REACTOS_SOURCE_DIR}/ntoskrnl/ke/amd64/usercall_asm.S)
|
||||
${REACTOS_SOURCE_DIR}/ntoskrnl/ke/amd64/usercall_asm.S
|
||||
${REACTOS_SOURCE_DIR}/ntoskrnl/ke/amd64/zeropage.S)
|
||||
list(APPEND SOURCE
|
||||
${REACTOS_SOURCE_DIR}/ntoskrnl/config/i386/cmhardwr.c
|
||||
${REACTOS_SOURCE_DIR}/ntoskrnl/mm/i386/page.c
|
||||
|
|
Loading…
Reference in a new issue