This commit is contained in:
wheremyfoodat 2025-08-05 22:33:44 +03:00
commit e9a2100b15

View file

@ -486,10 +486,12 @@ bool Memory::mapVirtualMemory(
// Map or unmap each physical block
for (auto& block : physicalList) {
if (newDstState == MemoryState::Free)
if (newDstState == MemoryState::Free) {
unmapPhysicalMemory(dstVaddr, block.paddr, block.pages);
else
} else {
mapPhysicalMemory(dstVaddr, block.paddr, block.pages, r, w, x);
}
dstVaddr += block.pages << 12;
}