diff --git a/xtoskrnl/includes/mm/amd64/pagemap.hh b/xtoskrnl/includes/mm/amd64/pagemap.hh index 9cc6d7e..d896ead 100644 --- a/xtoskrnl/includes/mm/amd64/pagemap.hh +++ b/xtoskrnl/includes/mm/amd64/pagemap.hh @@ -44,6 +44,8 @@ namespace MM PMMPTE StartPte); XTAPI ULONG GetPteOffset(IN PVOID Address); XTAPI ULONG GetPteSize(VOID); + XTAPI ULONG GetPteSoftwarePrototype(IN PMMPTE PtePointer); + XTAPI ULONG GetPteSoftwareTransition(IN PMMPTE PtePointer); VIRTUAL XTAPI PVOID GetPteVirtualAddress(IN PMMPTE PtePointer) = 0; XTAPI PMMPXE GetPxeAddress(IN PVOID Address); XTAPI ULONG GetPxeOffset(IN PVOID Address); diff --git a/xtoskrnl/includes/mm/amd64/paging.hh b/xtoskrnl/includes/mm/amd64/paging.hh index efbfe83..c8dc83a 100644 --- a/xtoskrnl/includes/mm/amd64/paging.hh +++ b/xtoskrnl/includes/mm/amd64/paging.hh @@ -41,6 +41,8 @@ namespace MM STATIC XTAPI LONG GetPteDistance(PMMPTE EndPte, PMMPTE StartPte); STATIC XTAPI ULONG GetPteSize(VOID); + STATIC XTAPI ULONG GetPteSoftwarePrototype(IN PMMPTE PtePointer); + STATIC XTAPI ULONG GetPteSoftwareTransition(IN PMMPTE PtePointer); STATIC XTAPI PVOID GetPteVirtualAddress(IN PMMPTE PtePointer); STATIC XTAPI PMMPXE GetPxeAddress(IN PVOID Address); STATIC XTAPI PVOID GetPxeVirtualAddress(IN PMMPXE PxePointer); diff --git a/xtoskrnl/includes/mm/i686/pagemap.hh b/xtoskrnl/includes/mm/i686/pagemap.hh index 30de3b6..1da4aeb 100644 --- a/xtoskrnl/includes/mm/i686/pagemap.hh +++ b/xtoskrnl/includes/mm/i686/pagemap.hh @@ -41,6 +41,8 @@ namespace MM VIRTUAL XTAPI LONG GetPteDistance(PMMPTE EndPte, PMMPTE StartPte) = 0; VIRTUAL XTAPI ULONG GetPteSize(VOID) = 0; + VIRTUAL XTAPI ULONG GetPteSoftwarePrototype(IN PMMPTE PtePointer) = 0; + VIRTUAL XTAPI ULONG GetPteSoftwareTransition(IN PMMPTE PtePointer) = 0; VIRTUAL XTAPI PVOID GetPteVirtualAddress(IN PMMPTE PtePointer) = 0; XTAPI BOOLEAN GetXpaStatus(); VIRTUAL XTAPI VOID InitializePageMapInfo(VOID) = 0; @@ -77,6 +79,8 @@ namespace MM XTAPI LONG GetPteDistance(PMMPTE EndPte, PMMPTE StartPte); XTAPI ULONG GetPteSize(VOID); + XTAPI ULONG GetPteSoftwarePrototype(IN PMMPTE PtePointer); + XTAPI ULONG GetPteSoftwareTransition(IN PMMPTE PtePointer); XTAPI PVOID GetPteVirtualAddress(IN PMMPTE PtePointer); XTAPI VOID InitializePageMapInfo(VOID); XTAPI BOOLEAN PteValid(IN PMMPTE PtePointer); @@ -111,6 +115,8 @@ namespace MM XTAPI LONG GetPteDistance(PMMPTE EndPte, PMMPTE StartPte); XTAPI ULONG GetPteSize(VOID); + XTAPI ULONG GetPteSoftwarePrototype(IN PMMPTE PtePointer); + XTAPI ULONG GetPteSoftwareTransition(IN PMMPTE PtePointer); XTAPI PVOID GetPteVirtualAddress(IN PMMPTE PtePointer); XTAPI VOID InitializePageMapInfo(VOID); XTAPI BOOLEAN PteValid(IN PMMPTE PtePointer); diff --git a/xtoskrnl/includes/mm/i686/paging.hh b/xtoskrnl/includes/mm/i686/paging.hh index 2c06d3c..69e8ced 100644 --- a/xtoskrnl/includes/mm/i686/paging.hh +++ b/xtoskrnl/includes/mm/i686/paging.hh @@ -39,6 +39,8 @@ namespace MM STATIC XTAPI LONG GetPteDistance(PMMPTE EndPte, PMMPTE StartPte); STATIC XTAPI ULONG GetPteSize(VOID); + STATIC XTAPI ULONG GetPteSoftwarePrototype(IN PMMPTE PtePointer); + STATIC XTAPI ULONG GetPteSoftwareTransition(IN PMMPTE PtePointer); STATIC XTAPI PVOID GetPteVirtualAddress(IN PMMPTE PtePointer); STATIC XTAPI BOOLEAN GetXpaStatus(VOID); STATIC XTAPI VOID InitializePageMapSupport(VOID); diff --git a/xtoskrnl/mm/amd64/pagemap.cc b/xtoskrnl/mm/amd64/pagemap.cc index e89b05b..5342d7e 100644 --- a/xtoskrnl/mm/amd64/pagemap.cc +++ b/xtoskrnl/mm/amd64/pagemap.cc @@ -363,6 +363,40 @@ MM::PageMap::GetPteSize(VOID) return sizeof(MMPTE); } +/** + * Gets the software prototype value of the corresponding Page Table Entry. + * + * @param PtePointer + * Specifies the address of the PTE. + * + * @return This routine returns the PTE software prototype value. + * + * @since XT 1.0 + */ +XTAPI +ULONG +MM::PageMap::GetPteSoftwarePrototype(IN PMMPTE PtePointer) +{ + return (ULONG)PtePointer->Software.Prototype; +} + +/** + * Gets the software transition value of the corresponding Page Table Entry. + * + * @param PtePointer + * Specifies the address of the PTE. + * + * @return This routine returns the PTE software transition value. + * + * @since XT 1.0 + */ +XTAPI +ULONG +MM::PageMap::GetPteSoftwareTransition(IN PMMPTE PtePointer) +{ + return (ULONG)PtePointer->Software.Transition; +} + /** * Gets the address of the PXE (Extended Page Entry), that maps given address. * diff --git a/xtoskrnl/mm/i686/pagemap.cc b/xtoskrnl/mm/i686/pagemap.cc index ee66229..2744f5c 100644 --- a/xtoskrnl/mm/i686/pagemap.cc +++ b/xtoskrnl/mm/i686/pagemap.cc @@ -355,6 +355,40 @@ MM::PageMapBasic::GetPteSize(VOID) return sizeof(MMPML2_PTE); } +/** + * Gets the software prototype value of the corresponding Page Table Entry. + * + * @param PtePointer + * Specifies the address of the PTE. + * + * @return This routine returns the PTE software prototype value. + * + * @since XT 1.0 + */ +XTAPI +ULONG +MM::PageMapBasic::GetPteSoftwarePrototype(IN PMMPTE PtePointer) +{ + return (ULONG)PtePointer->Pml2.Software.Prototype; +} + +/** + * Gets the software transition value of the corresponding Page Table Entry. + * + * @param PtePointer + * Specifies the address of the PTE. + * + * @return This routine returns the PTE software transition value. + * + * @since XT 1.0 + */ +XTAPI +ULONG +MM::PageMapBasic::GetPteSoftwareTransition(IN PMMPTE PtePointer) +{ + return (ULONG)PtePointer->Pml2.Software.Transition; +} + /** * Gets the virtual address that is mapped by a given Page Table Entry. * @@ -505,7 +539,7 @@ MM::PageMapBasic::SetPte(IN PMMPTE PtePointer, XTAPI VOID MM::PageMapBasic::SetPte(IN PMMPTE PtePointer, - IN ULONG_PTR Attributes) + IN ULONG_PTR Attributes) { PtePointer->Pml2.Long = Attributes; } @@ -743,6 +777,40 @@ MM::PageMapXpa::GetPteSize(VOID) return sizeof(MMPML3_PTE); } +/** + * Gets the software prototype value of the corresponding Page Table Entry. + * + * @param PtePointer + * Specifies the address of the PTE. + * + * @return This routine returns the PTE software prototype value. + * + * @since XT 1.0 + */ +XTAPI +ULONG +MM::PageMapXpa::GetPteSoftwarePrototype(IN PMMPTE PtePointer) +{ + return (ULONG)PtePointer->Pml3.Software.Prototype; +} + +/** + * Gets the software transition value of the corresponding Page Table Entry. + * + * @param PtePointer + * Specifies the address of the PTE. + * + * @return This routine returns the PTE software transition value. + * + * @since XT 1.0 + */ +XTAPI +ULONG +MM::PageMapXpa::GetPteSoftwareTransition(IN PMMPTE PtePointer) +{ + return (ULONG)PtePointer->Pml3.Software.Transition; +} + /** * Gets the virtual address that is mapped by a given Page Table Entry. * diff --git a/xtoskrnl/mm/paging.cc b/xtoskrnl/mm/paging.cc index 5a9562d..7196951 100644 --- a/xtoskrnl/mm/paging.cc +++ b/xtoskrnl/mm/paging.cc @@ -366,6 +366,40 @@ MM::Paging::GetPteSize(VOID) return PmlRoutines->GetPteSize(); } +/** + * Gets the software prototype value of the corresponding Page Table Entry. + * + * @param PtePointer + * Specifies the address of the PTE. + * + * @return This routine returns the PTE software prototype value. + * + * @since XT 1.0 + */ +XTAPI +ULONG +MM::Paging::GetPteSoftwarePrototype(IN PMMPTE PtePointer) +{ + return PmlRoutines->GetPteSoftwarePrototype(PtePointer); +} + +/** + * Gets the software transition value of the corresponding Page Table Entry. + * + * @param PtePointer + * Specifies the address of the PTE. + * + * @return This routine returns the PTE software transition value. + * + * @since XT 1.0 + */ +XTAPI +ULONG +MM::Paging::GetPteSoftwareTransition(IN PMMPTE PtePointer) +{ + return PmlRoutines->GetPteSoftwareTransition(PtePointer); +} + /** * Gets the virtual address that is mapped by a given Page Table Entry. *