mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-06-16 07:33:14 +00:00
Implement sceKernelMapDirectMemory2 (#2940)
* Implement sceKernelMapDirectMemory2 Behaves similarly to sceKernelMapDirectMemory, but has a type parameter. * Simplify No need to copy all the MapDirectMemory code over, can just call the function, then do the SetDirectMemoryType call * Clang
This commit is contained in:
parent
aeb4536988
commit
18ff65efc8
3 changed files with 29 additions and 0 deletions
|
@ -783,6 +783,19 @@ int MemoryManager::DirectQueryAvailable(PAddr search_start, PAddr search_end, si
|
|||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
s32 MemoryManager::SetDirectMemoryType(s64 phys_addr, s32 memory_type) {
|
||||
std::scoped_lock lk{mutex};
|
||||
|
||||
auto& dmem_area = FindDmemArea(phys_addr)->second;
|
||||
|
||||
ASSERT_MSG(phys_addr <= dmem_area.GetEnd() && !dmem_area.is_free,
|
||||
"Direct memory area is not mapped");
|
||||
|
||||
dmem_area.memory_type = memory_type;
|
||||
|
||||
return ORBIS_OK;
|
||||
}
|
||||
|
||||
void MemoryManager::NameVirtualRange(VAddr virtual_addr, size_t size, std::string_view name) {
|
||||
auto it = FindVMA(virtual_addr);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue