20 #include "pedigree/kernel/processor/VirtualAddressSpace.h" 21 #include "pedigree/kernel/Log.h" 22 #include "pedigree/kernel/processor/PhysicalMemoryManager.h" 23 #include "pedigree/kernel/utilities/utility.h" 35 ERROR(
"Could not prepare zero page.");
47 void *newHeapEnd = adjust_pointer(
m_HeapEnd, incr);
53 uintptr_t newEnd =
reinterpret_cast<uintptr_t
>(newHeapEnd);
59 FATAL(
"expandHeap called for kernel heap!");
68 ERROR(
"Heap expansion no longer allowed; about to run into dynamic " 77 ERROR(
"Heap expansion no longer allowed; have run over userspace " 78 "stacks and about to run into kernel area.");
85 while (reinterpret_cast<uintptr_t>(newHeapEnd) <
93 physical_uintptr_t phys = 0;
94 size_t mappingFlags = 0;
114 while (reinterpret_cast<uintptr_t>(newHeapEnd) >
126 "VirtualAddressSpace::expandHeap() failed for " 149 void *virtualAddress,
size_t pageCount)
151 for (
size_t i = 0; i < pageCount; i++)
156 getMapping(virtualAddress, physicalAddress, flags);
162 unmap(virtualAddress);
165 virtualAddress = adjust_pointer(
171 physical_uintptr_t physAddress,
void *virtualAddress,
size_t count,
174 for (
size_t i = 0; i < count; ++i)
178 physAddress + addend, adjust_pointer(virtualAddress, addend),
virtual void unmap(void *virtualAddress)=0
static size_t getPageSize() PURE
static PhysicalMemoryManager & instance()
virtual void pin(physical_uintptr_t page)=0
virtual void getMapping(void *virtualAddress, physical_uintptr_t &physicalAddress, size_t &flags)=0
virtual physical_uintptr_t allocatePage(size_t pageConstraints=0)=0
virtual bool isMapped(void *virtualAddress)=0
virtual bool map(physical_uintptr_t physicalAddress, void *virtualAddress, size_t flags)=0
virtual uintptr_t getKernelStart() const =0
static physical_uintptr_t m_ZeroPage
static const size_t Write
uintptr_t physicalAddress(physical_uintptr_t address) PURE
void rollbackHeapExpansion(void *virtualAddress, size_t pageCount)
virtual uintptr_t getKernelHeapStart() const =0
virtual uintptr_t getDynamicStart() const
virtual void * expandHeap(ssize_t incr, size_t flags)
virtual void freePage(physical_uintptr_t page)=0
virtual bool mapHuge(physical_uintptr_t physAddress, void *virtualAddress, size_t count, size_t flags)
static const size_t CopyOnWrite