mirror of
https://github.com/reactos/reactos.git
synced 2024-09-29 22:16:01 +00:00
[NTOS] Deduplicate MiSynchronizeSystemPde(). #179
This commit is contained in:
parent
2367206744
commit
4d4e4bb68a
|
@ -2260,4 +2260,27 @@ MiRemoveZeroPageSafe(IN ULONG Color)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if (_MI_PAGING_LEVELS == 2)
|
||||
FORCEINLINE
|
||||
BOOLEAN
|
||||
MiSynchronizeSystemPde(PMMPDE PointerPde)
|
||||
{
|
||||
MMPDE SystemPde;
|
||||
ULONG Index;
|
||||
|
||||
/* Get the Index from the PDE */
|
||||
Index = ((ULONG_PTR)PointerPde & (SYSTEM_PD_SIZE - 1)) / sizeof(MMPTE);
|
||||
|
||||
/* Copy the PDE from the double-mapped system page directory */
|
||||
SystemPde = MmSystemPagePtes[Index];
|
||||
*PointerPde = SystemPde;
|
||||
|
||||
/* Make sure we re-read the PDE and PTE */
|
||||
KeMemoryBarrierWithoutFence();
|
||||
|
||||
/* Return, if we had success */
|
||||
return SystemPde.u.Hard.Valid != 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* EOF */
|
||||
|
|
|
@ -310,27 +310,6 @@ MiCheckVirtualAddress(IN PVOID VirtualAddress,
|
|||
}
|
||||
|
||||
#if (_MI_PAGING_LEVELS == 2)
|
||||
FORCEINLINE
|
||||
BOOLEAN
|
||||
MiSynchronizeSystemPde(PMMPDE PointerPde)
|
||||
{
|
||||
MMPDE SystemPde;
|
||||
ULONG Index;
|
||||
|
||||
/* Get the Index from the PDE */
|
||||
Index = ((ULONG_PTR)PointerPde & (SYSTEM_PD_SIZE - 1)) / sizeof(MMPTE);
|
||||
|
||||
/* Copy the PDE from the double-mapped system page directory */
|
||||
SystemPde = MmSystemPagePtes[Index];
|
||||
*PointerPde = SystemPde;
|
||||
|
||||
/* Make sure we re-read the PDE and PTE */
|
||||
KeMemoryBarrierWithoutFence();
|
||||
|
||||
/* Return, if we had success */
|
||||
return (BOOLEAN)SystemPde.u.Hard.Valid;
|
||||
}
|
||||
|
||||
NTSTATUS
|
||||
FASTCALL
|
||||
MiCheckPdeForSessionSpace(IN PVOID Address)
|
||||
|
|
|
@ -189,28 +189,6 @@ ProtectToPTE(ULONG flProtect)
|
|||
return(Attributes);
|
||||
}
|
||||
|
||||
/* Taken from ARM3/pagfault.c */
|
||||
FORCEINLINE
|
||||
BOOLEAN
|
||||
MiSynchronizeSystemPde(PMMPDE PointerPde)
|
||||
{
|
||||
MMPDE SystemPde;
|
||||
ULONG Index;
|
||||
|
||||
/* Get the Index from the PDE */
|
||||
Index = ((ULONG_PTR)PointerPde & (SYSTEM_PD_SIZE - 1)) / sizeof(MMPTE);
|
||||
|
||||
/* Copy the PDE from the double-mapped system page directory */
|
||||
SystemPde = MmSystemPagePtes[Index];
|
||||
*PointerPde = SystemPde;
|
||||
|
||||
/* Make sure we re-read the PDE and PTE */
|
||||
KeMemoryBarrierWithoutFence();
|
||||
|
||||
/* Return, if we had success */
|
||||
return SystemPde.u.Hard.Valid != 0;
|
||||
}
|
||||
|
||||
NTSTATUS
|
||||
NTAPI
|
||||
MiDispatchFault(IN BOOLEAN StoreInstruction,
|
||||
|
|
Loading…
Reference in a new issue