The Pedigree Project  0.1
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
ArmV7PhysicalMemoryManager Class Reference

Implementation of the PhysicalMemoryManager for common arm. More...

#include <PhysicalMemoryManager.h>

+ Inheritance diagram for ArmV7PhysicalMemoryManager:
+ Collaboration diagram for ArmV7PhysicalMemoryManager:

Classes

class  PageStack
 The Stack of pages (below4GB, below64GB, no constraint). More...
 

Public Member Functions

virtual physical_uintptr_t allocatePage ()
 
virtual void freePage (physical_uintptr_t page)
 
virtual void pin (physical_uintptr_t page)
 
virtual bool allocateRegion (MemoryRegion &Region, size_t cPages, size_t pageConstraints, size_t Flags, physical_uintptr_t start=-1)
 
void initialise (const BootstrapStruct_t &info)
 
- Public Member Functions inherited from PhysicalMemoryManager
virtual physical_uintptr_t allocatePage (size_t pageConstraints=0)=0
 
void allocateMemoryRegionList (Vector< MemoryRegionInfo * > &MemoryRegions)
 
void freeMemoryRegionList (Vector< MemoryRegionInfo * > &MemoryRegions)
 
virtual size_t freePageCount () const
 

Static Public Member Functions

static ArmV7PhysicalMemoryManagerinstance ()
 
- Static Public Member Functions inherited from PhysicalMemoryManager
static PhysicalMemoryManagerinstance ()
 
static size_t getPageSize () PURE
 

Protected Member Functions

 ArmV7PhysicalMemoryManager ()
 
virtual ~ArmV7PhysicalMemoryManager ()
 
- Protected Member Functions inherited from PhysicalMemoryManager
 PhysicalMemoryManager ()
 
virtual ~PhysicalMemoryManager ()
 

Private Member Functions

 ArmV7PhysicalMemoryManager (const ArmV7PhysicalMemoryManager &)
 
ArmV7PhysicalMemoryManageroperator= (const ArmV7PhysicalMemoryManager &)
 
virtual void freePageUnlocked (physical_uintptr_t page)
 
virtual void unmapRegion (MemoryRegion *pRegion)
 

Private Attributes

PageStack m_PageStack
 
RangeList< physical_uintptr_t > m_PhysicalRanges
 
RangeList< physical_uintptr_t > m_NonRAMRanges
 
RangeList< uintptr_t > m_VirtualMemoryRegions
 
Spinlock m_Lock
 
Spinlock m_RegionLock
 

Static Private Attributes

static ArmV7PhysicalMemoryManager m_Instance
 

Additional Inherited Members

- Static Public Attributes inherited from PhysicalMemoryManager
static const size_t continuous = 1 << 0
 
static const size_t nonRamMemory = 1 << 1
 
static const size_t force = 1 << 2
 
static const size_t virtualOnly = 1 << 3
 
static const size_t below1MB = 1 << 4
 
static const size_t below16MB = 1 << 5
 
static const size_t below4GB = 1 << 6
 
static const size_t below64GB = 1 << 7
 
static const size_t addressConstraints
 
static const size_t anonymous = 1 << 8
 
- Protected Attributes inherited from PhysicalMemoryManager
Vector< MemoryRegion * > m_MemoryRegions
 

Detailed Description

Implementation of the PhysicalMemoryManager for common arm.

The common arm implementation of the PhysicalMemoryManager

Definition at line 33 of file kernel/core/processor/armv7/PhysicalMemoryManager.h.

Constructor & Destructor Documentation

ArmV7PhysicalMemoryManager::ArmV7PhysicalMemoryManager ( )
protected

The constructor

Definition at line 235 of file armv7/PhysicalMemoryManager.cc.

Referenced by pin().

+ Here is the caller graph for this function:

ArmV7PhysicalMemoryManager::~ArmV7PhysicalMemoryManager ( )
protectedvirtual

The destructor

Definition at line 240 of file armv7/PhysicalMemoryManager.cc.

Referenced by pin().

+ Here is the caller graph for this function:

ArmV7PhysicalMemoryManager::ArmV7PhysicalMemoryManager ( const ArmV7PhysicalMemoryManager )
private

The copy-constructor

Note
Not implemented (singleton)

Member Function Documentation

physical_uintptr_t ArmV7PhysicalMemoryManager::allocatePage ( )
virtual
Todo:
Cache compact if needed

Definition at line 34 of file armv7/PhysicalMemoryManager.cc.

Referenced by instance().

+ Here is the caller graph for this function:

bool ArmV7PhysicalMemoryManager::allocateRegion ( MemoryRegion Region,
size_t  cPages,
size_t  pageConstraints,
size_t  Flags,
physical_uintptr_t  start = -1 
)
virtual

Allocate a memory-region with specific constraints the pages need to fullfill.

Parameters
[in]Regionreference to the MemoryRegion object
[in]cPagesthe number of pages to allocate for the MemoryRegion object
[in]pageConstraintsthe constraints the pages have to fullfill
[in]Flagsflags from the VirtualAddressSpace class namespace
[in]startthe physical address of the beginning of the region (optional)
Returns
true, if a valid MemoryRegion object is created, false otherwise

Implements PhysicalMemoryManager.

Definition at line 56 of file armv7/PhysicalMemoryManager.cc.

References PhysicalMemoryManager::continuous, PhysicalMemoryManager::force, VirtualAddressSpace::getKernelAddressSpace(), PhysicalMemoryManager::getPageSize(), Processor::information(), PhysicalMemoryManager::m_MemoryRegions, MemoryRegion::m_PhysicalAddress, MemoryRegion::m_Size, MemoryRegion::m_VirtualAddress, VirtualAddressSpace::map(), panic(), Vector< T >::pushBack(), and WARNING.

Referenced by pin().

+ Here is the caller graph for this function:

void ArmV7PhysicalMemoryManager::freePage ( physical_uintptr_t  page)
virtual

Free a page allocated with the allocatePage() function

Parameters
[in]pagephysical address of the page

Implements PhysicalMemoryManager.

Definition at line 42 of file armv7/PhysicalMemoryManager.cc.

Referenced by instance().

+ Here is the caller graph for this function:

void ArmV7PhysicalMemoryManager::freePageUnlocked ( physical_uintptr_t  page)
privatevirtual

Same as freePage, but without the lock. Will panic if the lock is unlocked.

Note
Use in the wrong place and you die.

Implements PhysicalMemoryManager.

Definition at line 48 of file armv7/PhysicalMemoryManager.cc.

References FATAL.

Referenced by pin().

+ Here is the caller graph for this function:

static ArmV7PhysicalMemoryManager& ArmV7PhysicalMemoryManager::instance ( )
inlinestatic

Get the ArmV7PhysicalMemoryManager instance

Returns
instance of the ArmV7PhysicalMemoryManager

Definition at line 38 of file kernel/core/processor/armv7/PhysicalMemoryManager.h.

References allocatePage(), freePage(), and m_Instance.

Referenced by PhysicalMemoryManager::instance().

+ Here is the caller graph for this function:

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

The copy-constructor

Note
Not implemented (singleton)

Referenced by pin().

+ Here is the caller graph for this function:

virtual void ArmV7PhysicalMemoryManager::pin ( physical_uintptr_t  page)
inlinevirtual
void ArmV7PhysicalMemoryManager::unmapRegion ( MemoryRegion pRegion)
privatevirtual

Unmaps a memory region - called ONLY from MemoryRegion's destructor.

Implements PhysicalMemoryManager.

Definition at line 192 of file armv7/PhysicalMemoryManager.cc.

Referenced by pin().

+ Here is the caller graph for this function:

Member Data Documentation

ArmV7PhysicalMemoryManager ArmV7PhysicalMemoryManager::m_Instance
staticprivate

The ArmV7PhysicalMemoryManager class instance

Definition at line 133 of file kernel/core/processor/armv7/PhysicalMemoryManager.h.

Referenced by instance().

Spinlock ArmV7PhysicalMemoryManager::m_Lock
private

To guard against multiprocessor reentrancy.

Definition at line 136 of file kernel/core/processor/armv7/PhysicalMemoryManager.h.

RangeList<physical_uintptr_t> ArmV7PhysicalMemoryManager::m_NonRAMRanges
private

RangeList of non-RAM memory

Definition at line 127 of file kernel/core/processor/armv7/PhysicalMemoryManager.h.

PageStack ArmV7PhysicalMemoryManager::m_PageStack
private

The page stack

Definition at line 121 of file kernel/core/processor/armv7/PhysicalMemoryManager.h.

RangeList<physical_uintptr_t> ArmV7PhysicalMemoryManager::m_PhysicalRanges
private

RangeList of free physical memory

Definition at line 124 of file kernel/core/processor/armv7/PhysicalMemoryManager.h.

RangeList<uintptr_t> ArmV7PhysicalMemoryManager::m_VirtualMemoryRegions
private

Virtual-memory available for MemoryRegions

Definition at line 130 of file kernel/core/processor/armv7/PhysicalMemoryManager.h.


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