Page table mapping virtual page numbers to physical frames.
More...
#include <page_table.h>
|
| std::unique_ptr< Impl > | impl_ |
Page table mapping virtual page numbers to physical frames.
Each process has its own PageTable. The MMU uses it to translate virtual addresses and to decide which pages to swap in/out.
Definition at line 26 of file page_table.h.
◆ PageTable() [1/3]
| contur::PageTable::PageTable |
( |
std::size_t | pageCount | ) |
|
|
explicit |
Constructs a page table with the given number of virtual pages.
◆ ~PageTable()
| contur::PageTable::~PageTable |
( |
| ) |
|
◆ PageTable() [2/3]
| contur::PageTable::PageTable |
( |
const PageTable & | | ) |
|
|
delete |
◆ PageTable() [3/3]
| contur::PageTable::PageTable |
( |
PageTable && | | ) |
|
|
noexcept |
◆ clear()
| void contur::PageTable::clear |
( |
| ) |
|
Resets all entries to unmapped state.
◆ clearReferenced()
| Result< void > contur::PageTable::clearReferenced |
( |
std::size_t | virtualPage | ) |
|
|
nodiscard |
Clears the referenced bit for a virtual page.
◆ getEntry()
Returns the entry for a virtual page (read-only).
◆ map()
| Result< void > contur::PageTable::map |
( |
std::size_t | virtualPage, |
|
|
FrameId | frame ) |
|
nodiscard |
Maps a virtual page to a physical frame.
- Returns
- Success or InvalidAddress if virtualPage is out of range.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ pageCount()
| std::size_t contur::PageTable::pageCount |
( |
| ) |
const |
|
nodiscardnoexcept |
Returns the total number of virtual pages.
◆ presentCount()
| std::size_t contur::PageTable::presentCount |
( |
| ) |
const |
|
nodiscardnoexcept |
Returns the number of pages currently present in memory.
◆ setDirty()
| Result< void > contur::PageTable::setDirty |
( |
std::size_t | virtualPage, |
|
|
bool | value ) |
|
nodiscard |
◆ setReferenced()
| Result< void > contur::PageTable::setReferenced |
( |
std::size_t | virtualPage, |
|
|
bool | value ) |
|
nodiscard |
Marks a page as referenced (used by Clock/LRU algorithms).
◆ translate()
| Result< FrameId > contur::PageTable::translate |
( |
std::size_t | virtualPage | ) |
const |
|
nodiscard |
Translates a virtual page number to a physical frame.
- Returns
- The FrameId, or InvalidAddress if not mapped, or SegmentationFault if not present.
◆ unmap()
| Result< void > contur::PageTable::unmap |
( |
std::size_t | virtualPage | ) |
|
|
nodiscard |
Unmaps a virtual page (marks as not present, clears frame).
- Returns
- Success or InvalidAddress if virtualPage is out of range.
◆ impl_
| std::unique_ptr<Impl> contur::PageTable::impl_ |
|
private |
The documentation for this class was generated from the following file: