Add architecture-specific GetPteDistance
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user