Formatting

This commit is contained in:
Stephen Miller 2025-05-09 19:54:17 -05:00
parent e434bc0811
commit 1cca6c4119

View File

@ -308,15 +308,16 @@ int MemoryManager::PoolCommit(VAddr virtual_addr, size_t size, MemoryProt prot)
auto& vma = FindVMA(mapped_addr)->second; auto& vma = FindVMA(mapped_addr)->second;
if (vma.type != VMAType::PoolReserved || vma.base + vma.size < virtual_addr + size) { if (vma.type != VMAType::PoolReserved || vma.base + vma.size < virtual_addr + size) {
// If the VMA isn't PoolReserved or if there's not enough space // If the VMA isn't PoolReserved or if there's not enough space to commit, return EINVAL
// to commit, this should return EINVAL LOG_ERROR(Kernel_Vmm,
LOG_ERROR(Kernel_Vmm, "Trying to PoolCommit non-pooled memory!"); "Pooled region {:#x} to {:#x} is not large enough to commit from {:#x} to {:#x}",
vma.base, vma.size, mapped_addr, size);
return ORBIS_KERNEL_ERROR_EINVAL; return ORBIS_KERNEL_ERROR_EINVAL;
} }
// Before mapping, the reserved VMA should have it's physical base incremented. // Before mapping, the reserved VMA should have it's physical base incremented.
vma.phys_base += size; vma.phys_base += size;
// Carve out the new VMA representing this mapping // Carve out the new VMA representing this mapping
const auto new_vma_handle = CarveVMA(mapped_addr, size); const auto new_vma_handle = CarveVMA(mapped_addr, size);
auto& new_vma = new_vma_handle->second; auto& new_vma = new_vma_handle->second;