FreeNOS
Public Member Functions | Private Member Functions | Private Attributes
IntelPageTable Class Reference

Intel second level page table implementation. More...

#include <IntelPageTable.h>

Public Member Functions

MemoryContext::Result map (Address virt, Address phys, Memory::Access access)
 Map a virtual address to a physical address. More...
 
MemoryContext::Result unmap (Address virt)
 Remove virtual address mapping. More...
 
MemoryContext::Result translate (Address virt, Address *phys) const
 Translate virtual address to physical address. More...
 
MemoryContext::Result access (Address virt, Memory::Access *access) const
 Get Access flags for a virtual address. More...
 

Private Member Functions

u32 flags (Memory::Access access) const
 Convert MemoryAccess to page table flags. More...
 

Private Attributes

u32 m_pages [1024]
 Array of page table entries. More...
 

Detailed Description

Intel second level page table implementation.

Definition at line 39 of file IntelPageTable.h.

Member Function Documentation

◆ access()

MemoryContext::Result IntelPageTable::access ( Address  virt,
Memory::Access access 
) const

Get Access flags for a virtual address.

Parameters
virtVirtual address to get Access flags for.
accessMemoryAccess object pointer.
Returns
Result code.

Definition at line 66 of file IntelPageTable.cpp.

References entry, MemoryContext::InvalidAddress, m_pages, PAGE_PRESENT, PAGE_USER, PAGE_WRITE, Memory::Readable, MemoryContext::Success, TABENTRY, Memory::User, and Memory::Writable.

Referenced by IntelPageDirectory::access(), flags(), and map().

◆ flags()

u32 IntelPageTable::flags ( Memory::Access  access) const
private

Convert MemoryAccess to page table flags.

Parameters
accessMemory access flags to convert
Returns
Page table flags

Definition at line 81 of file IntelPageTable.cpp.

References access(), PAGE_USER, PAGE_WRITE, Memory::User, and Memory::Writable.

Referenced by map().

◆ map()

MemoryContext::Result IntelPageTable::map ( Address  virt,
Address  phys,
Memory::Access  access 
)

Map a virtual address to a physical address.

Parameters
virtVirtual address.
physPhysical address.
accessMemory access flags.
Returns
Result code

Definition at line 38 of file IntelPageTable.cpp.

References access(), MemoryContext::AlreadyExists, flags(), m_pages, PAGE_PRESENT, MemoryContext::Success, and TABENTRY.

Referenced by IntelPageDirectory::map().

◆ translate()

MemoryContext::Result IntelPageTable::translate ( Address  virt,
Address phys 
) const

Translate virtual address to physical address.

Parameters
virtVirtual address to lookup
physOn output contains the translated physical memory address
Returns
Result code

Definition at line 57 of file IntelPageTable.cpp.

References MemoryContext::InvalidAddress, m_pages, PAGE_PRESENT, PAGEMASK, MemoryContext::Success, and TABENTRY.

Referenced by IntelPageDirectory::releaseRange(), IntelPageDirectory::releaseSection(), and IntelPageDirectory::translate().

◆ unmap()

MemoryContext::Result IntelPageTable::unmap ( Address  virt)

Remove virtual address mapping.

Parameters
virtVirtual address.
Returns
Result code

Definition at line 51 of file IntelPageTable.cpp.

References m_pages, PAGE_NONE, MemoryContext::Success, and TABENTRY.

Referenced by IntelPageDirectory::releaseRange(), and IntelPageDirectory::unmap().

Field Documentation

◆ m_pages

u32 IntelPageTable::m_pages[1024]
private

Array of page table entries.

Definition at line 99 of file IntelPageTable.h.

Referenced by access(), map(), translate(), and unmap().


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