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

ARM second level page table implementation. More...

#include <ARMSecondTable.h>

Public Member Functions

MemoryContext::Result map (Address virt, Address phys, Memory::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 [256]
 Array of second level page table entries. More...
 

Detailed Description

ARM second level page table implementation.

Definition at line 39 of file ARMSecondTable.h.

Member Function Documentation

◆ access()

MemoryContext::Result ARMSecondTable::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 141 of file ARMSecondTable.cpp.

References Memory::Device, entry, Memory::InnerCached, MemoryContext::InvalidAddress, m_pages, Memory::OuterCached, PAGE2_AP_USER, PAGE2_APX, PAGE2_DEVICE_SHARED, PAGE2_PRESENT, PAGE2_UNCACHED, Memory::Readable, MemoryContext::Success, TABENTRY, Memory::Uncached, Memory::User, and Memory::Writable.

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

◆ flags()

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

Convert MemoryAccess to page table flags.

Parameters
accessMemory access flags
Returns
Page table access flags

Definition at line 168 of file ARMSecondTable.cpp.

References access(), Memory::Device, Memory::Executable, PAGE2_AP_SYS, PAGE2_AP_USER, PAGE2_APX, PAGE2_CACHE_WRITEBACK, PAGE2_DEVICE_SHARED, PAGE2_NOEXEC, PAGE2_UNCACHED, Memory::Uncached, Memory::User, and Memory::Writable.

Referenced by map().

◆ map()

MemoryContext::Result ARMSecondTable::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 107 of file ARMSecondTable.cpp.

References access(), MemoryContext::AlreadyExists, Cache::cleanData(), flags(), m_pages, PAGE2_PRESENT, PAGEMASK, MemoryContext::Success, and TABENTRY.

Referenced by ARMFirstTable::map().

◆ translate()

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

Translate virtual address to physical address.

Parameters
virtVirtual address to lookup as input
physPhysical address for output.
Returns
Result code

Definition at line 132 of file ARMSecondTable.cpp.

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

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

◆ unmap()

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

Remove virtual address mapping.

Parameters
virtVirtual address.
Returns
Result code

Definition at line 123 of file ARMSecondTable.cpp.

References Cache::cleanData(), m_pages, PAGE2_NONE, MemoryContext::Success, and TABENTRY.

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

Field Documentation

◆ m_pages

u32 ARMSecondTable::m_pages[256]
private

Array of second level page table entries.

Definition at line 99 of file ARMSecondTable.h.

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


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