mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 17:44:45 +00:00
[NTOS:KE] Rewrite KeZeroPages in assembly
We spend a lot of time in this function, let's optimize it.
This commit is contained in:
parent
240dc77e42
commit
51258295bd
3 changed files with 33 additions and 9 deletions
|
@ -1133,15 +1133,6 @@ KeInvalidateAllCaches(VOID)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
VOID
|
||||
FASTCALL
|
||||
KeZeroPages(IN PVOID Address,
|
||||
IN ULONG Size)
|
||||
{
|
||||
/* Not using XMMI in this routine */
|
||||
RtlZeroMemory(Address, Size);
|
||||
}
|
||||
|
||||
VOID
|
||||
NTAPI
|
||||
KiSaveProcessorState(IN PKTRAP_FRAME TrapFrame,
|
||||
|
|
32
ntoskrnl/ke/i386/zeropage.S
Normal file
32
ntoskrnl/ke/i386/zeropage.S
Normal file
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* 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
|
||||
|
||||
/*
|
||||
* VOID
|
||||
* FASTCALL
|
||||
* KeZeroPages(void* ptr, ULONG Size)
|
||||
*/
|
||||
PUBLIC @KeZeroPages@8
|
||||
FUNC @KeZeroPages@8
|
||||
FPO 0, 0, 0, 0, 0, FRAME_FPO
|
||||
|
||||
push edi
|
||||
mov edi, ecx
|
||||
mov ecx, edx
|
||||
shr ecx, 2
|
||||
xor eax, eax
|
||||
rep stosd
|
||||
pop edi
|
||||
ret
|
||||
ENDFUNC
|
||||
|
||||
END
|
|
@ -298,6 +298,7 @@ if(ARCH STREQUAL "i386")
|
|||
${REACTOS_SOURCE_DIR}/ntoskrnl/ke/i386/ctxswitch.S
|
||||
${REACTOS_SOURCE_DIR}/ntoskrnl/ke/i386/trap.s
|
||||
${REACTOS_SOURCE_DIR}/ntoskrnl/ke/i386/usercall_asm.S
|
||||
${REACTOS_SOURCE_DIR}/ntoskrnl/ke/i386/zeropage.S
|
||||
${REACTOS_SOURCE_DIR}/ntoskrnl/rtl/i386/stack.S)
|
||||
list(APPEND SOURCE
|
||||
${REACTOS_SOURCE_DIR}/ntoskrnl/config/i386/cmhardwr.c
|
||||
|
|
Loading…
Reference in a new issue