Add support for transitioning PTE to invalid state
This commit is contained in:
@@ -363,6 +363,24 @@ MM::PageMap::GetPteSize(VOID)
|
||||
return sizeof(MMPTE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the software protection value of the corresponding Page Table Entry.
|
||||
*
|
||||
* @param PtePointer
|
||||
* Specifies the address of the PTE.
|
||||
*
|
||||
* @return This routine returns the PTE software protection value.
|
||||
*
|
||||
* @since XT 1.0
|
||||
*/
|
||||
XTAPI
|
||||
ULONG
|
||||
MM::PageMap::GetPteSoftwareProtection(IN PMMPTE PtePointer)
|
||||
{
|
||||
/* Return PTE software protection value */
|
||||
return (ULONG)PtePointer->Software.Protection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the software prototype value of the corresponding Page Table Entry.
|
||||
*
|
||||
@@ -377,6 +395,7 @@ XTAPI
|
||||
ULONG
|
||||
MM::PageMap::GetPteSoftwarePrototype(IN PMMPTE PtePointer)
|
||||
{
|
||||
/* Return PTE software prototype value */
|
||||
return (ULONG)PtePointer->Software.Prototype;
|
||||
}
|
||||
|
||||
@@ -394,6 +413,7 @@ XTAPI
|
||||
ULONG
|
||||
MM::PageMap::GetPteSoftwareTransition(IN PMMPTE PtePointer)
|
||||
{
|
||||
/* Return PTE software transition value */
|
||||
return (ULONG)PtePointer->Software.Transition;
|
||||
}
|
||||
|
||||
@@ -588,6 +608,37 @@ MM::PageMap::SetPteCaching(IN PMMPTE PtePointer,
|
||||
PtePointer->Hardware.WriteThrough = WriteThrough;
|
||||
}
|
||||
|
||||
/**
|
||||
* Transitions a Page Table Entry (PTE) to invalid state
|
||||
*
|
||||
* @param PointerPte
|
||||
* Pointer to the page table entry (PTE) to transition.
|
||||
*
|
||||
* @param Protection
|
||||
* Specifies the protection attribute to apply to the PTE.
|
||||
*
|
||||
* @return This routine does not return any value.
|
||||
*
|
||||
* @since XT 1.0
|
||||
*/
|
||||
XTAPI
|
||||
VOID
|
||||
MM::PageMap::TransitionPte(IN PMMPTE PointerPte,
|
||||
IN ULONG_PTR Protection)
|
||||
{
|
||||
MMPTE TempPte;
|
||||
|
||||
/* Set transition PTE */
|
||||
TempPte = *PointerPte;
|
||||
TempPte.Software.Protection = Protection;
|
||||
TempPte.Software.Prototype = 0;
|
||||
TempPte.Software.Transition = 1;
|
||||
TempPte.Software.Valid = 0;
|
||||
|
||||
/* Write PTE value */
|
||||
*PointerPte = TempPte;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a Page Table Entry (PTE) with the specified value.
|
||||
*
|
||||
|
||||
@@ -355,6 +355,24 @@ MM::PageMapBasic::GetPteSize(VOID)
|
||||
return sizeof(MMPML2_PTE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the software protection value of the corresponding Page Table Entry.
|
||||
*
|
||||
* @param PtePointer
|
||||
* Specifies the address of the PTE.
|
||||
*
|
||||
* @return This routine returns the PTE software protection value.
|
||||
*
|
||||
* @since XT 1.0
|
||||
*/
|
||||
XTAPI
|
||||
ULONG
|
||||
MM::PageMapBasic::GetPteSoftwareProtection(IN PMMPTE PtePointer)
|
||||
{
|
||||
/* Return PTE software protection value */
|
||||
return (ULONG)PtePointer->Pml2.Software.Protection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the software prototype value of the corresponding Page Table Entry.
|
||||
*
|
||||
@@ -369,6 +387,7 @@ XTAPI
|
||||
ULONG
|
||||
MM::PageMapBasic::GetPteSoftwarePrototype(IN PMMPTE PtePointer)
|
||||
{
|
||||
/* Return PTE software prototype value */
|
||||
return (ULONG)PtePointer->Pml2.Software.Prototype;
|
||||
}
|
||||
|
||||
@@ -386,6 +405,7 @@ XTAPI
|
||||
ULONG
|
||||
MM::PageMapBasic::GetPteSoftwareTransition(IN PMMPTE PtePointer)
|
||||
{
|
||||
/* Return PTE software transition value */
|
||||
return (ULONG)PtePointer->Pml2.Software.Transition;
|
||||
}
|
||||
|
||||
@@ -571,6 +591,37 @@ MM::PageMapBasic::SetPteCaching(IN PMMPTE PtePointer,
|
||||
PtePointer->Pml2.Hardware.WriteThrough = WriteThrough;
|
||||
}
|
||||
|
||||
/**
|
||||
* Transitions a Page Table Entry (PTE) to invalid state
|
||||
*
|
||||
* @param PointerPte
|
||||
* Pointer to the page table entry (PTE) to transition.
|
||||
*
|
||||
* @param Protection
|
||||
* Specifies the protection attribute to apply to the PTE.
|
||||
*
|
||||
* @return This routine does not return any value.
|
||||
*
|
||||
* @since XT 1.0
|
||||
*/
|
||||
XTAPI
|
||||
VOID
|
||||
MM::PageMapBasic::TransitionPte(IN PMMPTE PointerPte,
|
||||
IN ULONG_PTR Protection)
|
||||
{
|
||||
MMPTE TempPte;
|
||||
|
||||
/* Set transition PTE */
|
||||
TempPte = *PointerPte;
|
||||
TempPte.Pml2.Software.Protection = Protection;
|
||||
TempPte.Pml2.Software.Prototype = 0;
|
||||
TempPte.Pml2.Software.Transition = 1;
|
||||
TempPte.Pml2.Software.Valid = 0;
|
||||
|
||||
/* Write PTE value */
|
||||
*PointerPte = TempPte;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a PML2 page table entry (PTE) with the specified value.
|
||||
*
|
||||
@@ -777,6 +828,24 @@ MM::PageMapXpa::GetPteSize(VOID)
|
||||
return sizeof(MMPML3_PTE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the software protection value of the corresponding Page Table Entry.
|
||||
*
|
||||
* @param PtePointer
|
||||
* Specifies the address of the PTE.
|
||||
*
|
||||
* @return This routine returns the PTE software protection value.
|
||||
*
|
||||
* @since XT 1.0
|
||||
*/
|
||||
XTAPI
|
||||
ULONG
|
||||
MM::PageMapXpa::GetPteSoftwareProtection(IN PMMPTE PtePointer)
|
||||
{
|
||||
/* Return PTE software protection value */
|
||||
return (ULONG)PtePointer->Pml3.Software.Protection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the software prototype value of the corresponding Page Table Entry.
|
||||
*
|
||||
@@ -791,6 +860,7 @@ XTAPI
|
||||
ULONG
|
||||
MM::PageMapXpa::GetPteSoftwarePrototype(IN PMMPTE PtePointer)
|
||||
{
|
||||
/* Return PTE software prototype value */
|
||||
return (ULONG)PtePointer->Pml3.Software.Prototype;
|
||||
}
|
||||
|
||||
@@ -808,6 +878,7 @@ XTAPI
|
||||
ULONG
|
||||
MM::PageMapXpa::GetPteSoftwareTransition(IN PMMPTE PtePointer)
|
||||
{
|
||||
/* Return PTE software transition value */
|
||||
return (ULONG)PtePointer->Pml3.Software.Transition;
|
||||
}
|
||||
|
||||
@@ -992,6 +1063,37 @@ MM::PageMapXpa::SetPteCaching(IN PMMPTE PtePointer,
|
||||
PtePointer->Pml3.Hardware.WriteThrough = WriteThrough;
|
||||
}
|
||||
|
||||
/**
|
||||
* Transitions a Page Table Entry (PTE) to invalid state
|
||||
*
|
||||
* @param PointerPte
|
||||
* Pointer to the page table entry (PTE) to transition.
|
||||
*
|
||||
* @param Protection
|
||||
* Specifies the protection attribute to apply to the PTE.
|
||||
*
|
||||
* @return This routine does not return any value.
|
||||
*
|
||||
* @since XT 1.0
|
||||
*/
|
||||
XTAPI
|
||||
VOID
|
||||
MM::PageMapXpa::TransitionPte(IN PMMPTE PointerPte,
|
||||
IN ULONG_PTR Protection)
|
||||
{
|
||||
MMPTE TempPte;
|
||||
|
||||
/* Set transition PTE */
|
||||
TempPte = *PointerPte;
|
||||
TempPte.Pml3.Software.Protection = Protection;
|
||||
TempPte.Pml3.Software.Prototype = 0;
|
||||
TempPte.Pml3.Software.Transition = 1;
|
||||
TempPte.Pml3.Software.Valid = 0;
|
||||
|
||||
/* Write PTE value */
|
||||
*PointerPte = TempPte;
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a PML3 page table entry (PTE) with the specified value.
|
||||
*
|
||||
|
||||
@@ -366,6 +366,24 @@ MM::Paging::GetPteSize(VOID)
|
||||
return PmlRoutines->GetPteSize();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the software protection value of the corresponding Page Table Entry.
|
||||
*
|
||||
* @param PtePointer
|
||||
* Specifies the address of the PTE.
|
||||
*
|
||||
* @return This routine returns the PTE software protection value.
|
||||
*
|
||||
* @since XT 1.0
|
||||
*/
|
||||
XTAPI
|
||||
ULONG
|
||||
MM::Paging::GetPteSoftwareProtection(IN PMMPTE PtePointer)
|
||||
{
|
||||
/* Return PTE software protection value */
|
||||
return PmlRoutines->GetPteSoftwareProtection(PtePointer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the software prototype value of the corresponding Page Table Entry.
|
||||
*
|
||||
@@ -380,6 +398,7 @@ XTAPI
|
||||
ULONG
|
||||
MM::Paging::GetPteSoftwarePrototype(IN PMMPTE PtePointer)
|
||||
{
|
||||
/* Return PTE software prototype value */
|
||||
return PmlRoutines->GetPteSoftwarePrototype(PtePointer);
|
||||
}
|
||||
|
||||
@@ -397,6 +416,7 @@ XTAPI
|
||||
ULONG
|
||||
MM::Paging::GetPteSoftwareTransition(IN PMMPTE PtePointer)
|
||||
{
|
||||
/* Return PTE software transition value */
|
||||
return PmlRoutines->GetPteSoftwareTransition(PtePointer);
|
||||
}
|
||||
|
||||
@@ -594,6 +614,28 @@ MM::Paging::SetPteCaching(IN PMMPTE PtePointer,
|
||||
PmlRoutines->SetPteCaching(PtePointer, CacheDisable, WriteThrough);
|
||||
}
|
||||
|
||||
/**
|
||||
* Transitions a Page Table Entry (PTE) to invalid state
|
||||
*
|
||||
* @param PointerPte
|
||||
* Pointer to the page table entry (PTE) to transition.
|
||||
*
|
||||
* @param Protection
|
||||
* Specifies the protection attribute to apply to the PTE.
|
||||
*
|
||||
* @return This routine does not return any value.
|
||||
*
|
||||
* @since XT 1.0
|
||||
*/
|
||||
XTAPI
|
||||
VOID
|
||||
MM::Paging::TransitionPte(IN PMMPTE PointerPte,
|
||||
IN ULONG_PTR Protection)
|
||||
{
|
||||
/* Transition PTE */
|
||||
PmlRoutines->TransitionPte(PointerPte, Protection);
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes a Page Table Entry (PTE) with the specified value.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user