20 #ifndef KERNEL_PROCESSOR_PHYSICALMEMORYMANAGER_H 21 #define KERNEL_PROCESSOR_PHYSICALMEMORYMANAGER_H 23 #include "pedigree/kernel/compiler.h" 24 #include "pedigree/kernel/processor/types.h" 25 #include "pedigree/kernel/utilities/Vector.h" 44 static const size_t continuous = 1 << 0;
46 static const size_t nonRamMemory = 1 << 1;
50 static const size_t force = 1 << 2;
52 static const size_t virtualOnly = 1 << 3;
55 #if defined(X86_COMMON) 57 static const size_t below1MB = 1 << 4;
59 static const size_t below16MB = 1 << 5;
61 static const size_t below4GB = 1 << 6;
63 static const size_t below64GB = 1 << 7;
66 static const size_t addressConstraints =
67 below1MB | below16MB | below4GB | below64GB;
70 static const size_t anonymous = 1 << 8;
84 virtual physical_uintptr_t allocatePage(
size_t pageConstraints = 0) = 0;
87 virtual void freePage(physical_uintptr_t page) = 0;
98 virtual void pin(physical_uintptr_t page) = 0;
108 virtual bool allocateRegion(
109 MemoryRegion &Region,
size_t cPages,
size_t pageConstraints,
110 size_t Flags, physical_uintptr_t start = -1) = 0;
122 void *VirtualAddress, physical_uintptr_t PhysicalAddress,
123 size_t size,
const char *name)
125 sVirtualAddress(size), pName(name)
149 virtual size_t freePageCount()
const;
170 virtual void freePageUnlocked(physical_uintptr_t page) = 0;
static size_t getPageSize() PURE
physical_uintptr_t physicalAddress
A vector / dynamic array.
uintptr_t physicalAddress(physical_uintptr_t address) PURE
Special memory entity in the kernel's virtual address space.
MemoryRegionInfo(void *VirtualAddress, physical_uintptr_t PhysicalAddress, size_t size, const char *name)
Vector< MemoryRegion * > m_MemoryRegions