The Pedigree Project  0.1
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
MemoryRegion Class Reference

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 ()
 

Private Member Functions

 MemoryRegion (const MemoryRegion &)
 
MemoryRegionoperator= (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
 

Detailed Description

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.

Constructor & Destructor Documentation

MemoryRegion::MemoryRegion ( const char *  pName)

The default constructor does nothing

Definition at line 23 of file MemoryRegion.cc.

MemoryRegion::~MemoryRegion ( )
virtual

The destructor unregisters itself from the PMM.

Definition at line 29 of file MemoryRegion.cc.

References PhysicalMemoryManager::instance(), and PhysicalMemoryManager::unmapRegion().

MemoryRegion::MemoryRegion ( const MemoryRegion )
private

The copy-constructor

Note
Not implemented

Member Function Documentation

const char * MemoryRegion::name ( ) const

Get the name of the memory-region

Returns
pointer to the name of the memory-region

Definition at line 54 of file MemoryRegion.cc.

References m_PhysicalAddress, m_pName, and m_Size.

MemoryRegion& MemoryRegion::operator= ( const MemoryRegion )
private

The copy-constructor

Note
Not implemented
physical_uintptr_t MemoryRegion::physicalAddress ( ) const

Get the physical address of the beginning of the MemoryRegion

Returns
pointer to the beginning of the MemoryRegion (in the physical address space)

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().

+ Here is the caller graph for this function:

size_t MemoryRegion::size ( ) const

Get the size of the MemoryRegion

Returns
size of the MemoryRegion in bytes

Definition at line 49 of file MemoryRegion.cc.

References m_Size.

Referenced by CdiIrqHandler::irq(), MemoryMappedIo::size(), PpcCommonPhysicalMemoryManager::unmapRegion(), HostedPhysicalMemoryManager::unmapRegion(), and X86CommonPhysicalMemoryManager::unmapRegion().

+ Here is the caller graph for this function:

void * MemoryRegion::virtualAddress ( ) const

Friends And Related Function Documentation

friend class ArmV7PhysicalMemoryManager
friend

As does ArmV7PhysicalMemoryManager.

Definition at line 42 of file MemoryRegion.h.

friend class HostedPhysicalMemoryManager
friend

As does HostedPhysicalMemoryManager.

Definition at line 44 of file MemoryRegion.h.

friend class PpcCommonPhysicalMemoryManager
friend

As does PpcCommonPhysicalMemoryManager.

Definition at line 40 of file MemoryRegion.h.

friend class X86CommonPhysicalMemoryManager
friend

X86CommonPhysicalMemoryManager needs access to MemoryRegion's members

Definition at line 38 of file MemoryRegion.h.

Member Data Documentation

physical_uintptr_t MemoryRegion::m_PhysicalAddress
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().

const char* MemoryRegion::m_pName
private

User-visible name of the memory-region

Definition at line 98 of file MemoryRegion.h.

Referenced by name().

size_t MemoryRegion::m_Size
private
void* MemoryRegion::m_VirtualAddress
private

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