20 #ifndef KERNEL_PROCESSOR_HOSTED_PHYSICALMEMORYMANAGER_H 21 #define KERNEL_PROCESSOR_HOSTED_PHYSICALMEMORYMANAGER_H 23 #include "pedigree/kernel/BootstrapInfo.h" 24 #include "pedigree/kernel/Spinlock.h" 25 #include "pedigree/kernel/compiler.h" 26 #include "pedigree/kernel/processor/PhysicalMemoryManager.h" 27 #include "pedigree/kernel/utilities/HashTable.h" 28 #include "pedigree/kernel/utilities/RangeList.h" 33 #define HOSTED_PHYSICAL_MEMORY_SIZE (1UL << 31) 55 virtual physical_uintptr_t allocatePage();
58 MemoryRegion &Region,
size_t cPages,
size_t pageConstraints,
59 size_t Flags, physical_uintptr_t start = -1);
61 virtual void pin(physical_uintptr_t page);
91 inline int getBackingFile()
const 114 physical_uintptr_t
allocate(
size_t constraints);
123 inline size_t freePages()
const 186 return p.m_Page == m_Page;
191 physical_uintptr_t m_Page;
197 page() : active(
false), refcount(0)
HostedPhysicalMemoryManager & operator=(const HostedPhysicalMemoryManager &)
Bootstrap structure passed to the kernel entry point.
static size_t getPageSize() PURE
virtual void freePage(physical_uintptr_t page)
The Stack of pages (below4GB, below64GB, no constraint).
physical_uintptr_t allocate(size_t constraints)
#define INITIALISATION_ONLY
size_t m_StackMax[StackCount]
virtual ~HostedPhysicalMemoryManager()
void initialisationDone()
void unmapRegion(MemoryRegion *pRegion)
uintptr_t physicalAddress(physical_uintptr_t address) PURE
HostedPhysicalMemoryManager() INITIALISATION_ONLY
Special memory entity in the kernel's virtual address space.
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) INITIALISATION_ONLY
RangeList< uintptr_t > m_MemoryRegions
virtual void pin(physical_uintptr_t page)
struct page * m_PageMetadata
Implementation of the PhysicalMemoryManager for common x86.
size_t m_StackSize[StackCount]
static const size_t StackCount
static HostedPhysicalMemoryManager m_Instance
static HostedPhysicalMemoryManager & instance()
bool operator==(const Iterator< originalT, Struct, FunctionPrev, FunctionNext, T1 > &x1, const Iterator< originalT, Struct, FunctionPrev, FunctionNext, T2 > &x2)
PageStack & operator=(const PageStack &)
RangeList< uint64_t > m_PhysicalRanges
PageStack() INITIALISATION_ONLY
virtual void freePageUnlocked(physical_uintptr_t page)
void * m_Stack[StackCount]
void free(uint64_t physicalAddress)