Add architecture-specific GetPteDistance
Some checks failed
Builds / ExectOS (amd64, release) (push) Successful in 31s
Builds / ExectOS (amd64, debug) (push) Successful in 34s
Builds / ExectOS (i686, debug) (push) Failing after 22s
Builds / ExectOS (i686, release) (push) Failing after 21s

This commit is contained in:
2025-12-06 00:19:24 +01:00
parent c710ec4688
commit 7694df7744
7 changed files with 98 additions and 0 deletions

View File

@@ -289,6 +289,28 @@ MM::PageMap::GetPteAddress(IN PVOID Address)
return (PMMPTE)(PageMapInfo.PteBase + Offset);
}
/**
* Calculates the distance between two PTE pointers.
*
* @param EndPte
* Pointer to the ending Page Table Entry.
*
* @param StartPte
* Pointer to the starting Page Table Entry.
*
* @return This routine returns a signed value representing the number of PTEs between EndPte and StartPte.
*
* @since XT 1.0
*/
XTAPI
LONG
MM::PageMap::GetPteDistance(PMMPTE EndPte,
PMMPTE StartPte)
{
/* Return distance between PTE pointers */
return ((ULONG_PTR)EndPte - (ULONG_PTR)StartPte) / sizeof(MMPTE);
}
/**
* Gets the index of the PTE (Page Table Entry), that maps given address.
*