This commit is contained in:
mailwl 2025-07-21 05:27:24 -03:00 committed by GitHub
commit e2791322f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 6 deletions

View File

@ -57,17 +57,17 @@ s32 PS4_SYSV_ABI sceKernelAllocateDirectMemory(s64 searchStart, s64 searchEnd, u
auto* memory = Core::Memory::Instance(); auto* memory = Core::Memory::Instance();
PAddr phys_addr = memory->Allocate(searchStart, searchEnd, len, alignment, memoryType); PAddr phys_addr = memory->Allocate(searchStart, searchEnd, len, alignment, memoryType);
if (phys_addr == -1) {
return ORBIS_KERNEL_ERROR_EAGAIN;
}
*physAddrOut = static_cast<s64>(phys_addr);
LOG_INFO(Kernel_Vmm, LOG_INFO(Kernel_Vmm,
"searchStart = {:#x}, searchEnd = {:#x}, len = {:#x}, " "searchStart = {:#x}, searchEnd = {:#x}, len = {:#x}, "
"alignment = {:#x}, memoryType = {:#x}, physAddrOut = {:#x}", "alignment = {:#x}, memoryType = {:#x}, physAddrOut = {:#x}",
searchStart, searchEnd, len, alignment, memoryType, phys_addr); searchStart, searchEnd, len, alignment, memoryType, phys_addr);
if (phys_addr == -1) {
return ORBIS_KERNEL_ERROR_EAGAIN;
}
*physAddrOut = static_cast<s64>(phys_addr);
return ORBIS_OK; return ORBIS_OK;
} }

View File

@ -214,7 +214,10 @@ PAddr MemoryManager::Allocate(PAddr search_start, PAddr search_end, u64 size, u6
if (dmem_area == dmem_map.end()) { if (dmem_area == dmem_map.end()) {
// There are no suitable mappings in this range // There are no suitable mappings in this range
LOG_ERROR(Kernel_Vmm, "Unable to find free direct memory area: size = {:#x}", size); auto exceed = mapping_end - search_end;
LOG_ERROR(Kernel_Vmm,
"Unable to find free direct memory area: size = {:#x}, exceed = {:#x}", size,
exceed);
return -1; return -1;
} }