|
The Pedigree Project 0.1
|
Special memory entity in the kernel's virtual address space. More...
#include <MemoryRegion.h>
Inheritance diagram for MemoryRegion:
Collaboration diagram for MemoryRegion: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 () |
| void | setAnonymous (bool b) |
| bool | getAnonymous () const |
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 |
| bool | m_bPageBacked |
| bool | m_bAnonymous |
Friends | |
| class | X86CommonPhysicalMemoryManager |
| class | HostedPhysicalMemoryManager |
| class | Arm64PhysicalMemoryManager |
| class | Armv7PhysicalMemoryManager |
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 33 of file MemoryRegion.cc.
References PhysicalMemoryManager::instance(), and PhysicalMemoryManager::unmapRegion().
|
private |
The copy-constructor
| T * MemoryRegion::convertPhysicalPointer | ( | physical_uintptr_t | address | ) |
Definition at line 105 of file MemoryRegion.h.
| void MemoryRegion::free | ( | ) |
Definition at line 37 of file MemoryRegion.cc.
| bool MemoryRegion::getAnonymous | ( | ) | const |
Definition at line 87 of file MemoryRegion.cc.
| bool MemoryRegion::getForced | ( | ) |
Definition at line 79 of file MemoryRegion.cc.
| bool MemoryRegion::getNonRamMemory | ( | ) |
Definition at line 71 of file MemoryRegion.cc.
| const char * MemoryRegion::name | ( | ) | const |
Get the name of the memory-region
Definition at line 53 of file MemoryRegion.cc.
References m_pName.
Referenced by MemoryPool::initialise().
Here is the caller graph for this function:| MemoryRegion::operator bool | ( | ) | const |
Definition at line 57 of file MemoryRegion.cc.
|
private |
The copy-constructor
| physical_uintptr_t MemoryRegion::physicalAddress | ( | ) | const |
Get the physical address of the beginning of the MemoryRegion
Definition at line 45 of file MemoryRegion.cc.
References m_PhysicalAddress.
Referenced by BusMasterIde::initialise(), Nic3C90x::Nic3C90x(), HostedPhysicalMemoryManager::unmapRegion(), and X86CommonPhysicalMemoryManager::unmapRegion().
Here is the caller graph for this function:| bool MemoryRegion::physicalBoundsCheck | ( | physical_uintptr_t | address | ) |
Definition at line 61 of file MemoryRegion.cc.
| void MemoryRegion::setAnonymous | ( | bool | b | ) |
Definition at line 83 of file MemoryRegion.cc.
| void MemoryRegion::setForced | ( | bool | b | ) |
Definition at line 75 of file MemoryRegion.cc.
| void MemoryRegion::setNonRamMemory | ( | bool | b | ) |
Definition at line 67 of file MemoryRegion.cc.
| size_t MemoryRegion::size | ( | ) | const |
Get the size of the MemoryRegion
Definition at line 49 of file MemoryRegion.cc.
References m_Size.
Referenced by BusMasterIde::add(), MemoryPool::allocateDoer(), MemoryPool::free(), MemoryPool::initialise(), MemoryMappedIo::size(), MemoryPool::trim(), HostedPhysicalMemoryManager::unmapRegion(), and X86CommonPhysicalMemoryManager::unmapRegion().
Here is the caller graph for this function:| void * MemoryRegion::virtualAddress | ( | ) | const |
Get the address of the beginning of the MemoryRegion in the virtual address space
Definition at line 41 of file MemoryRegion.cc.
References m_VirtualAddress.
Referenced by MemoryPool::allocateDoer(), Archive::Archive(), MemoryPool::free(), VirtioGpu::getFramebuffer(), VirtioGpu::GpuFramebuffer::getPhysicalPage(), HostedPhysicalMemoryManager::initialisationDone(), BusMasterIde::initialise(), Nic3C90x::Nic3C90x(), MemoryMappedIo::read16(), MemoryMappedIo::read32(), MemoryMappedIo::read64(), MemoryMappedIo::read8(), Xhci::releaseDeviceAddress(), Framebuffer::swCreateBuffer(), MemoryPool::trim(), HostedPhysicalMemoryManager::unmapRegion(), X86CommonPhysicalMemoryManager::unmapRegion(), MemoryMappedIo::write16(), MemoryMappedIo::write32(), MemoryMappedIo::write64(), and MemoryMappedIo::write8().
Here is the caller graph for this function:
|
friend |
Definition at line 40 of file MemoryRegion.h.
|
friend |
Definition at line 41 of file MemoryRegion.h.
|
friend |
As does HostedPhysicalMemoryManager.
Definition at line 39 of file MemoryRegion.h.
|
friend |
X86CommonPhysicalMemoryManager needs access to MemoryRegion's members
Definition at line 37 of file MemoryRegion.h.
|
private |
Definition at line 99 of file MemoryRegion.h.
|
private |
Definition at line 99 of file MemoryRegion.h.
|
private |
Definition at line 99 of file MemoryRegion.h.
|
private |
Definition at line 99 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 93 of file MemoryRegion.h.
Referenced by HostedPhysicalMemoryManager::allocateRegion(), X86CommonPhysicalMemoryManager::allocateRegion(), Arm64PhysicalMemoryManager::allocateRegion(), Armv7PhysicalMemoryManager::allocateRegion(), and physicalAddress().
|
private |
User-visible name of the memory-region
Definition at line 97 of file MemoryRegion.h.
Referenced by name().
|
private |
The size of the memory-region in bytes
Definition at line 95 of file MemoryRegion.h.
Referenced by HostedPhysicalMemoryManager::allocateRegion(), X86CommonPhysicalMemoryManager::allocateRegion(), Arm64PhysicalMemoryManager::allocateRegion(), Armv7PhysicalMemoryManager::allocateRegion(), size(), Arm64PhysicalMemoryManager::unmapRegion(), and Armv7PhysicalMemoryManager::unmapRegion().
|
private |
Pointer to the beginning of the memory region in the virtual address space.
Definition at line 90 of file MemoryRegion.h.
Referenced by HostedPhysicalMemoryManager::allocateRegion(), X86CommonPhysicalMemoryManager::allocateRegion(), Arm64PhysicalMemoryManager::allocateRegion(), Armv7PhysicalMemoryManager::allocateRegion(), Arm64PhysicalMemoryManager::unmapRegion(), Armv7PhysicalMemoryManager::unmapRegion(), and virtualAddress().