The Pedigree Project
0.1
|
Special memory entity in the kernel's virtual address space. More...
#include <MemoryRegion.h>
Public Member Functions | |
MemoryRegion (const char *pName) | |
virtual | ~MemoryRegion () |
void | free () |
void * | virtualAddress () const |
physical_uintptr_t | physicalAddress () const |
size_t | size () const |
const char * | name () const |
operator bool () const | |
bool | physicalBoundsCheck (physical_uintptr_t address) |
template<typename T > | |
T * | convertPhysicalPointer (physical_uintptr_t address) |
void | setNonRamMemory (bool b) |
bool | getNonRamMemory () |
void | setForced (bool b) |
bool | getForced () |
Private Member Functions | |
MemoryRegion (const MemoryRegion &) | |
MemoryRegion & | operator= (const MemoryRegion &) |
Private Attributes | |
void * | m_VirtualAddress |
physical_uintptr_t | m_PhysicalAddress |
size_t | m_Size |
const char * | m_pName |
bool | m_bNonRamMemory |
bool | m_bForced |
Friends | |
class | X86CommonPhysicalMemoryManager |
class | PpcCommonPhysicalMemoryManager |
class | ArmV7PhysicalMemoryManager |
class | HostedPhysicalMemoryManager |
Special memory entity in the kernel's virtual address space.
A MemoryRegion is a special memory entity that is mapped continuously in the virtual address space, but might not be continuous in the physical address space. These entities are allocated and freed via the PhysicalMemoryManager. A MemoryRegion is mapped into the kernel's virtual address space and as such accessible from kernel-mode within every process's virtual address space.
Definition at line 35 of file MemoryRegion.h.
MemoryRegion::MemoryRegion | ( | const char * | pName | ) |
The default constructor does nothing
Definition at line 23 of file MemoryRegion.cc.
|
virtual |
The destructor unregisters itself from the PMM.
Definition at line 29 of file MemoryRegion.cc.
References PhysicalMemoryManager::instance(), and PhysicalMemoryManager::unmapRegion().
|
private |
The copy-constructor
const char * MemoryRegion::name | ( | ) | const |
Get the name of the memory-region
Definition at line 54 of file MemoryRegion.cc.
References m_PhysicalAddress, m_pName, and m_Size.
|
private |
The copy-constructor
physical_uintptr_t MemoryRegion::physicalAddress | ( | ) | const |
Get the physical address of the beginning of the MemoryRegion
Definition at line 44 of file MemoryRegion.cc.
References m_PhysicalAddress.
Referenced by Ipc::IpcMessage::IpcMessage(), CdiIrqHandler::irq(), Nic3C90x::Nic3C90x(), HostedPhysicalMemoryManager::unmapRegion(), and X86CommonPhysicalMemoryManager::unmapRegion().
size_t MemoryRegion::size | ( | ) | const |
Get the size of the MemoryRegion
Definition at line 49 of file MemoryRegion.cc.
References m_Size.
Referenced by CdiIrqHandler::irq(), MemoryMappedIo::size(), PpcCommonPhysicalMemoryManager::unmapRegion(), HostedPhysicalMemoryManager::unmapRegion(), and X86CommonPhysicalMemoryManager::unmapRegion().
void * MemoryRegion::virtualAddress | ( | ) | const |
Get the address of the beginning of the MemoryRegion in the virtual address space
Definition at line 39 of file MemoryRegion.cc.
References m_VirtualAddress.
Referenced by Ipc::IpcMessage::getBuffer(), Archive::getFile(), Gpio::getGpioForPin(), X86Vga::getNumRows(), UsbUlpi::initialise(), PPCVga::initialise(), GPTimer::initialise(), ARMV7InterruptManager::initialiseProcessor(), ARMV7InterruptManager::interrupt(), GPTimer::interrupt(), Ipc::IpcMessage::IpcMessage(), CdiIrqHandler::irq(), VbeDisplay::newBuffer(), Nic3C90x::Nic3C90x(), ARMV7InterruptManager::registerInterruptHandler(), ARMV7InterruptManager::registerInterruptHandlerDebugger(), Framebuffer::swCreateBuffer(), PpcCommonPhysicalMemoryManager::unmapRegion(), HostedPhysicalMemoryManager::unmapRegion(), and X86CommonPhysicalMemoryManager::unmapRegion().
|
friend |
As does ArmV7PhysicalMemoryManager.
Definition at line 42 of file MemoryRegion.h.
|
friend |
As does HostedPhysicalMemoryManager.
Definition at line 44 of file MemoryRegion.h.
|
friend |
As does PpcCommonPhysicalMemoryManager.
Definition at line 40 of file MemoryRegion.h.
|
friend |
X86CommonPhysicalMemoryManager needs access to MemoryRegion's members
Definition at line 38 of file MemoryRegion.h.
|
private |
Pointer to the beginning of the memory region in the physical address space, if the region is physically continuous, otherwise 0.
Definition at line 94 of file MemoryRegion.h.
Referenced by ArmV7PhysicalMemoryManager::allocateRegion(), HostedPhysicalMemoryManager::allocateRegion(), PpcCommonPhysicalMemoryManager::allocateRegion(), X86CommonPhysicalMemoryManager::allocateRegion(), name(), and physicalAddress().
|
private |
User-visible name of the memory-region
Definition at line 98 of file MemoryRegion.h.
Referenced by name().
|
private |
The size of the memory-region in bytes
Definition at line 96 of file MemoryRegion.h.
Referenced by ArmV7PhysicalMemoryManager::allocateRegion(), HostedPhysicalMemoryManager::allocateRegion(), PpcCommonPhysicalMemoryManager::allocateRegion(), X86CommonPhysicalMemoryManager::allocateRegion(), name(), and size().
|
private |
Pointer to the beginning of the memory region in the virtual address space.
Definition at line 91 of file MemoryRegion.h.
Referenced by ArmV7PhysicalMemoryManager::allocateRegion(), PpcCommonPhysicalMemoryManager::allocateRegion(), HostedPhysicalMemoryManager::allocateRegion(), X86CommonPhysicalMemoryManager::allocateRegion(), and virtualAddress().