Created
July 7, 2017 23:42
-
-
Save mvankuipers/49549620ee76250fc29642bde95a33e1 to your computer and use it in GitHub Desktop.
Structure defining a page table (PT) entry in IA-32e paging.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef struct _PTE | |
{ | |
union | |
{ | |
struct | |
{ | |
ULONG64 Present : 1; // Must be 1, region invalid if 0. | |
ULONG64 ReadWrite : 1; // If 0, writes not allowed. | |
ULONG64 UserSupervisor : 1; // If 0, user-mode accesses not allowed. | |
ULONG64 PageWriteThrough : 1; // Determines the memory type used to access the memory. | |
ULONG64 PageCacheDisable : 1; // Determines the memory type used to access the memory. | |
ULONG64 Accessed : 1; // If 0, this entry has not been used for translation. | |
ULONG64 Dirty : 1; // If 0, the memory backing this page has not been written to. | |
ULONG64 PageAccessType : 1; // Determines the memory type used to access the memory. | |
ULONG64 Global: 1; // If 1 and the PGE bit of CR4 is set, translations are global. | |
ULONG64 Ignored2 : 3; | |
ULONG64 PageFrameNumber : 36; // The page frame number of the backing physical page. | |
ULONG64 Reserved : 4; | |
ULONG64 Ignored3 : 7; | |
ULONG64 ProtectionKey: 4; // If the PKE bit of CR4 is set, determines the protection key. | |
ULONG64 ExecuteDisable : 1; // If 1, instruction fetches not allowed. | |
}; | |
ULONG64 Value; | |
}; | |
} PTE, *PPTE; | |
static_assert(sizeof(PTE) == sizeof(PVOID), "Size mismatch, only 64-bit supported."); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment