FreeNOS
|
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... | |
Intel second level page table implementation.
Definition at line 39 of file IntelPageTable.h.
MemoryContext::Result IntelPageTable::access | ( | Address | virt, |
Memory::Access * | access | ||
) | const |
Get Access flags for a virtual address.
virt | Virtual address to get Access flags for. |
access | MemoryAccess object pointer. |
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().
|
private |
Convert MemoryAccess to page table flags.
access | Memory access flags to convert |
Definition at line 81 of file IntelPageTable.cpp.
References access(), PAGE_USER, PAGE_WRITE, Memory::User, and Memory::Writable.
Referenced by map().
MemoryContext::Result IntelPageTable::map | ( | Address | virt, |
Address | phys, | ||
Memory::Access | access | ||
) |
Map a virtual address to a physical address.
virt | Virtual address. |
phys | Physical address. |
access | Memory access flags. |
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().
MemoryContext::Result IntelPageTable::translate | ( | Address | virt, |
Address * | phys | ||
) | const |
Translate virtual address to physical address.
virt | Virtual address to lookup |
phys | On output contains the translated physical memory address |
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().
MemoryContext::Result IntelPageTable::unmap | ( | Address | virt | ) |
Remove virtual address mapping.
virt | Virtual address. |
Definition at line 51 of file IntelPageTable.cpp.
References m_pages, PAGE_NONE, MemoryContext::Success, and TABENTRY.
Referenced by IntelPageDirectory::releaseRange(), and IntelPageDirectory::unmap().
|
private |
Array of page table entries.
Definition at line 99 of file IntelPageTable.h.
Referenced by access(), map(), translate(), and unmap().