Public Types | Public Member Functions
page_table_x64 Class Reference

Public Types

using pointer = uintptr_t *
 
using integer_pointer = uintptr_t
 
using size_type = std::size_t
 
using memory_descriptor_list = std::vector< memory_descriptor >
 

Public Member Functions

 page_table_x64 (gsl::not_null< pointer > pte)
 
 ~page_table_x64 ()=default
 
page_table_entry_x64 add_page_1g (integer_pointer addr)
 
page_table_entry_x64 add_page_2m (integer_pointer addr)
 
page_table_entry_x64 add_page_4k (integer_pointer addr)
 
void remove_page (integer_pointer addr)
 
page_table_entry_x64 virt_to_pte (integer_pointer addr) const
 
memory_descriptor_list pt_to_mdl () const
 
 page_table_x64 (page_table_x64 &&) noexcept=default
 
page_table_x64operator= (page_table_x64 &&) noexcept=default
 
 page_table_x64 (const page_table_x64 &)=delete
 
page_table_x64operator= (const page_table_x64 &)=delete
 

Detailed Description

Definition at line 33 of file page_table_x64.h.

Member Typedef Documentation

◆ pointer

using page_table_x64::pointer = uintptr_t *

Definition at line 37 of file page_table_x64.h.

◆ integer_pointer

Definition at line 38 of file page_table_x64.h.

◆ size_type

using page_table_x64::size_type = std::size_t

Definition at line 39 of file page_table_x64.h.

◆ memory_descriptor_list

Definition at line 40 of file page_table_x64.h.

Constructor & Destructor Documentation

◆ page_table_x64() [1/3]

page_table_x64::page_table_x64 ( gsl::not_null< pointer pte)

Constructor

Creates a page table, and stores the parent entry that points to this entry so that you can modify the properties of this page table as needed.

Precondition
expects: none
Postcondition
ensures: none
Parameters
ptethe parent page table entry that points to this table

Definition at line 29 of file page_table_x64.cpp.

◆ ~page_table_x64()

page_table_x64::~page_table_x64 ( )
default

Destructor

Precondition
expects: none
Postcondition
ensures: none

◆ page_table_x64() [2/3]

page_table_x64::page_table_x64 ( page_table_x64 &&  )
defaultnoexcept

◆ page_table_x64() [3/3]

page_table_x64::page_table_x64 ( const page_table_x64 )
delete

Member Function Documentation

◆ add_page_1g()

page_table_entry_x64 page_table_x64::add_page_1g ( integer_pointer  addr)
inline

Add Page (1g Granularity)

Adds a page to the page table structure. Note that this is the public function, and should only be used to add pages to the PML4 page table. This function will call a private version that will parse through the different levels making sure the virtual address provided is valid.

Precondition
expects: none
Postcondition
ensures: none
Parameters
addrthe virtual address to the page to add
Returns
the resulting pte. Note that this pte is blank, and its properties (like present) should be set by the caller

Definition at line 77 of file page_table_x64.h.

◆ add_page_2m()

page_table_entry_x64 page_table_x64::add_page_2m ( integer_pointer  addr)
inline

Add Page (2m Granularity)

Adds a page to the page table structure. Note that this is the public function, and should only be used to add pages to the PML4 page table. This function will call a private version that will parse through the different levels making sure the virtual address provided is valid.

Precondition
expects: none
Postcondition
ensures: none
Parameters
addrthe virtual address to the page to add
Returns
the resulting pte. Note that this pte is blank, and its properties (like present) should be set by the caller

Definition at line 95 of file page_table_x64.h.

◆ add_page_4k()

page_table_entry_x64 page_table_x64::add_page_4k ( integer_pointer  addr)
inline

Add Page (4k Granularity)

Adds a page to the page table structure. Note that this is the public function, and should only be used to add pages to the PML4 page table. This function will call a private version that will parse through the different levels making sure the virtual address provided is valid.

Precondition
expects: none
Postcondition
ensures: none
Parameters
addrthe virtual address to the page to add
Returns
the resulting pte. Note that this pte is blank, and its properties (like present) should be set by the caller

Definition at line 113 of file page_table_x64.h.

◆ remove_page()

void page_table_x64::remove_page ( integer_pointer  addr)
inline

Remove Page

Removes a page from the page table. Note that this function cleans up as it goes, removing empty page tables if they are detected. For this reason, this operation can be expensive if mapping / unmapping occurs side by side with addresses that are similar (page tables will be needlessly removed)

Precondition
expects: none
Postcondition
ensures: none
Parameters
addrthe virtual address of the page to remove

Definition at line 129 of file page_table_x64.h.

◆ virt_to_pte()

page_table_entry_x64 page_table_x64::virt_to_pte ( integer_pointer  addr) const
inline

Virt to Page Table Entry

Returns the PTE associated with the provided virtual address. If no PTE exists for the virtual address provided, an exception is thrown.

Precondition
expects: none
Postcondition
ensures: none
Parameters
addrthe virtual address of the pte to locate

Definition at line 142 of file page_table_x64.h.

◆ pt_to_mdl()

memory_descriptor_list page_table_x64::pt_to_mdl ( ) const
inline

Page Table to Memory Descriptor List

This function converts the internal page table tree structure into a linear, memory descriptor list. Page table entry information is not provide, only the page tables. pages.

Precondition
expects:
Postcondition
ensures:
Returns
memory descriptor list

Definition at line 157 of file page_table_x64.h.

◆ operator=() [1/2]

page_table_x64& page_table_x64::operator= ( page_table_x64 &&  )
defaultnoexcept

◆ operator=() [2/2]

page_table_x64& page_table_x64::operator= ( const page_table_x64 )
delete

The documentation for this class was generated from the following files: