mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-06-26 12:26:18 +00:00
libkernel: Fix sceKernelAllocateDirectMemory and sceKernelAvailableDirectMemorySize (#2803)
* AllocateDirectMemory fixes search_start and search_end were ignored in certain cases, this fixes that issue. I've also basically rewritten the function in the process, since the lack of documentation made it difficult to make the proper adjustments. * DirectQueryAvailable fixes remaining_size was calculated incorrectly in cases where a free dmem_area had a base earlier than search_start, or an end after search_end. * Reduce sceKernelGetDirectMemorySize log severity By this point, we've confirmed that sceKernelGetDirectMemorySize is hardware-accurate. There's no reason to clog logs with this function, which games usually call before every sceKernelAllocateDirectMemory call. * Clang * Fix phys_addr_out phys_addr_out should be equal to search_start in cases where search_start is greater than the dmem_area base. * Dividing by zero is fun Need to check for alignment when aligning things. * Update memory.cpp * Clang
This commit is contained in:
parent
df89241eb8
commit
20b11f2d63
2 changed files with 42 additions and 25 deletions
|
@ -19,7 +19,7 @@
|
|||
namespace Libraries::Kernel {
|
||||
|
||||
u64 PS4_SYSV_ABI sceKernelGetDirectMemorySize() {
|
||||
LOG_WARNING(Kernel_Vmm, "called");
|
||||
LOG_TRACE(Kernel_Vmm, "called");
|
||||
const auto* memory = Core::Memory::Instance();
|
||||
return memory->GetTotalDirectSize();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue