The Pedigree Project
0.1
|
Implementation of the PhysicalMemoryManager for common arm. More...
#include <PhysicalMemoryManager.h>
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 ArmV7PhysicalMemoryManager & | instance () |
Static Public Member Functions inherited from PhysicalMemoryManager | |
static PhysicalMemoryManager & | instance () |
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 &) | |
ArmV7PhysicalMemoryManager & | operator= (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 |
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.
|
protected |
The constructor
Definition at line 235 of file armv7/PhysicalMemoryManager.cc.
Referenced by pin().
|
protectedvirtual |
The destructor
Definition at line 240 of file armv7/PhysicalMemoryManager.cc.
Referenced by pin().
|
private |
The copy-constructor
|
virtual |
Definition at line 34 of file armv7/PhysicalMemoryManager.cc.
Referenced by instance().
|
virtual |
Allocate a memory-region with specific constraints the pages need to fullfill.
[in] | Region | reference to the MemoryRegion object |
[in] | cPages | the number of pages to allocate for the MemoryRegion object |
[in] | pageConstraints | the constraints the pages have to fullfill |
[in] | Flags | flags from the VirtualAddressSpace class namespace |
[in] | start | the physical address of the beginning of the region (optional) |
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().
|
virtual |
Free a page allocated with the allocatePage() function
[in] | page | physical address of the page |
Implements PhysicalMemoryManager.
Definition at line 42 of file armv7/PhysicalMemoryManager.cc.
Referenced by instance().
|
privatevirtual |
Same as freePage, but without the lock. Will panic if the lock is unlocked.
Implements PhysicalMemoryManager.
Definition at line 48 of file armv7/PhysicalMemoryManager.cc.
References FATAL.
Referenced by pin().
|
inlinestatic |
Get the ArmV7PhysicalMemoryManager instance
Definition at line 38 of file kernel/core/processor/armv7/PhysicalMemoryManager.h.
References allocatePage(), freePage(), and m_Instance.
Referenced by PhysicalMemoryManager::instance().
|
private |
The copy-constructor
Referenced by pin().
|
inlinevirtual |
Implements PhysicalMemoryManager.
Definition at line 49 of file kernel/core/processor/armv7/PhysicalMemoryManager.h.
References allocateRegion(), ArmV7PhysicalMemoryManager(), freePageUnlocked(), operator=(), unmapRegion(), and ~ArmV7PhysicalMemoryManager().
|
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().
|
staticprivate |
The ArmV7PhysicalMemoryManager class instance
Definition at line 133 of file kernel/core/processor/armv7/PhysicalMemoryManager.h.
Referenced by instance().
|
private |
To guard against multiprocessor reentrancy.
Definition at line 136 of file kernel/core/processor/armv7/PhysicalMemoryManager.h.
|
private |
RangeList of non-RAM memory
Definition at line 127 of file kernel/core/processor/armv7/PhysicalMemoryManager.h.
|
private |
The page stack
Definition at line 121 of file kernel/core/processor/armv7/PhysicalMemoryManager.h.
|
private |
RangeList of free physical memory
Definition at line 124 of file kernel/core/processor/armv7/PhysicalMemoryManager.h.
|
private |
Virtual-memory available for MemoryRegions
Definition at line 130 of file kernel/core/processor/armv7/PhysicalMemoryManager.h.