mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-01-01 12:46:01 +00:00
Update sceBatchMap2 (#782)
* Update sceKernelBatchMap2 Improves placement of new BatchMap op types, and re-adds the BatchMap2 changes from https://github.com/shadps4-emu/shadPS4/pull/602. * Update some logs.
This commit is contained in:
parent
28feb77982
commit
89fb1a024f
|
@ -292,41 +292,16 @@ s32 PS4_SYSV_ABI sceKernelBatchMap2(OrbisKernelBatchMapEntry* entries, int numEn
|
||||||
}
|
}
|
||||||
case MemoryOpTypes::ORBIS_KERNEL_MAP_OP_UNMAP: {
|
case MemoryOpTypes::ORBIS_KERNEL_MAP_OP_UNMAP: {
|
||||||
result = sceKernelMunmap(entries[i].start, entries[i].length);
|
result = sceKernelMunmap(entries[i].start, entries[i].length);
|
||||||
LOG_INFO(Kernel_Vmm, "BatchMap: entry = {}, operation = {}, len = {:#x}, result = {}",
|
LOG_INFO(Kernel_Vmm, "entry = {}, operation = {}, len = {:#x}, result = {}", i,
|
||||||
i, entries[i].operation, entries[i].length, result);
|
entries[i].operation, entries[i].length, result);
|
||||||
|
break;
|
||||||
if (result == 0)
|
|
||||||
processed++;
|
|
||||||
}
|
}
|
||||||
case MemoryOpTypes::ORBIS_KERNEL_MAP_OP_PROTECT: {
|
case MemoryOpTypes::ORBIS_KERNEL_MAP_OP_PROTECT: {
|
||||||
result = sceKernelMProtect(entries[i].start, entries[i].length, entries[i].protection);
|
result = sceKernelMProtect(entries[i].start, entries[i].length, entries[i].protection);
|
||||||
LOG_INFO(Kernel_Vmm, "BatchMap: entry = {}, operation = {}, len = {:#x}, result = {}",
|
LOG_INFO(Kernel_Vmm, "entry = {}, operation = {}, len = {:#x}, result = {}", i,
|
||||||
i, entries[i].operation, entries[i].length, result);
|
entries[i].operation, entries[i].length, result);
|
||||||
if (result != ORBIS_OK) {
|
|
||||||
LOG_ERROR(Kernel_Vmm, "BatchMap: MProtect failed on entry {} with result {}", i,
|
|
||||||
result);
|
|
||||||
}
|
|
||||||
if (result == 0) {
|
|
||||||
processed++;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case MemoryOpTypes::ORBIS_KERNEL_MAP_OP_TYPE_PROTECT: {
|
|
||||||
result = sceKernelMTypeProtect(entries[i].start, entries[i].length, entries[i].type,
|
|
||||||
entries[i].protection);
|
|
||||||
LOG_INFO(Kernel_Vmm, "BatchMap: entry = {}, operation = {}, len = {:#x}, result = {}",
|
|
||||||
i, entries[i].operation, entries[i].length, result);
|
|
||||||
if (result != ORBIS_OK) {
|
|
||||||
LOG_ERROR(Kernel_Vmm, "BatchMap: MProtect failed on entry {} with result {}", i,
|
|
||||||
result);
|
|
||||||
}
|
|
||||||
if (result == 0) {
|
|
||||||
processed++;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case MemoryOpTypes::ORBIS_KERNEL_MAP_OP_MAP_FLEXIBLE: {
|
case MemoryOpTypes::ORBIS_KERNEL_MAP_OP_MAP_FLEXIBLE: {
|
||||||
result = sceKernelMapNamedFlexibleMemory(&entries[i].start, entries[i].length,
|
result = sceKernelMapNamedFlexibleMemory(&entries[i].start, entries[i].length,
|
||||||
entries[i].protection, flags, "");
|
entries[i].protection, flags, "");
|
||||||
|
@ -336,7 +311,13 @@ s32 PS4_SYSV_ABI sceKernelBatchMap2(OrbisKernelBatchMapEntry* entries, int numEn
|
||||||
i, entries[i].operation, entries[i].length, (u8)entries[i].type, result);
|
i, entries[i].operation, entries[i].length, (u8)entries[i].type, result);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case MemoryOpTypes::ORBIS_KERNEL_MAP_OP_TYPE_PROTECT: {
|
||||||
|
result = sceKernelMTypeProtect(entries[i].start, entries[i].length, entries[i].type,
|
||||||
|
entries[i].protection);
|
||||||
|
LOG_INFO(Kernel_Vmm, "entry = {}, operation = {}, len = {:#x}, result = {}", i,
|
||||||
|
entries[i].operation, entries[i].length, result);
|
||||||
|
break;
|
||||||
|
}
|
||||||
default: {
|
default: {
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
}
|
}
|
||||||
|
@ -346,8 +327,6 @@ s32 PS4_SYSV_ABI sceKernelBatchMap2(OrbisKernelBatchMapEntry* entries, int numEn
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOG_INFO(Kernel_Vmm, "sceKernelBatchMap2 finished: processed = {}, result = {}", processed,
|
|
||||||
result);
|
|
||||||
if (numEntriesOut != NULL) { // can be zero. do not return an error code.
|
if (numEntriesOut != NULL) { // can be zero. do not return an error code.
|
||||||
*numEntriesOut = processed;
|
*numEntriesOut = processed;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue