Applied feedback from @raphaelthegreat

This commit is contained in:
raziel1000 2024-07-25 01:13:14 -06:00 committed by georgemoralis
parent b62836d29f
commit fa76a723ad
6 changed files with 22 additions and 8 deletions

View file

@ -228,7 +228,8 @@ int PS4_SYSV_ABI sceKernelGetDirectMemoryType(u64 addr, int* directMemoryTypeOut
s32 PS4_SYSV_ABI sceKernelBatchMap(OrbisKernelBatchMapEntry* entries, int numEntries,
int* numEntriesOut) {
return sceKernelBatchMap2(entries, numEntries, numEntriesOut, 0x10); // 0x10 : Fixed / 0x410
return sceKernelBatchMap2(entries, numEntries, numEntriesOut,
MemoryFlags::SCE_KERNEL_MAP_FIXED); // 0x10, 0x410?
}
int PS4_SYSV_ABI sceKernelMunmap(void* addr, size_t len);
@ -243,7 +244,7 @@ s32 PS4_SYSV_ABI sceKernelBatchMap2(OrbisKernelBatchMapEntry* entries, int numEn
break; // break and assign a value to numEntriesOut.
}
if (entries[i].operation == 0) { // MAP_DIRECT
if (entries[i].operation == MemoryOpTypes::SCE_KERNEL_MAP_OP_MAP_DIRECT) {
result = sceKernelMapNamedDirectMemory(&entries[i].start, entries[i].length,
entries[i].protection, flags,
static_cast<s64>(entries[i].offset), 0, "");

View file

@ -31,6 +31,14 @@ enum MemoryProtection : u32 {
SCE_KERNEL_PROT_GPU_RW = 0x30 // Permit reads/writes from the GPU
};
enum MemoryOpTypes : u32 {
SCE_KERNEL_MAP_OP_MAP_DIRECT = 0,
SCE_KERNEL_MAP_OP_UNMAP = 1,
SCE_KERNEL_MAP_OP_PROTECT = 2,
SCE_KERNEL_MAP_OP_MAP_FLEXIBLE = 3,
SCE_KERNEL_MAP_OP_TYPE_PROTECT = 4
};
struct OrbisQueryInfo {
uintptr_t start;
uintptr_t end;

View file

@ -1336,6 +1336,10 @@ int PS4_SYSV_ABI posix_sem_wait(sem_t* sem) {
return sem_wait(sem);
}
int PS4_SYSV_ABI posix_sem_timedwait(sem_t* sem, const timespec* t) {
return sem_timedwait(sem, t);
}
int PS4_SYSV_ABI posix_sem_post(sem_t* sem) {
return sem_post(sem);
}
@ -1543,6 +1547,7 @@ void pthreadSymbolsRegister(Core::Loader::SymbolsResolver* sym) {
LIB_FUNCTION("Xs9hdiD7sAA", "libScePosix", 1, "libkernel", 1, 1, posix_pthread_setschedparam);
LIB_FUNCTION("pDuPEf3m4fI", "libScePosix", 1, "libkernel", 1, 1, posix_sem_init);
LIB_FUNCTION("YCV5dGGBcCo", "libScePosix", 1, "libkernel", 1, 1, posix_sem_wait);
LIB_FUNCTION("w5IHyvahg-o", "libScePosix", 1, "libkernel", 1, 1, posix_sem_timedwait);
LIB_FUNCTION("IKP8typ0QUk", "libScePosix", 1, "libkernel", 1, 1, posix_sem_post);
LIB_FUNCTION("cDW233RAwWo", "libScePosix", 1, "libkernel", 1, 1, posix_sem_destroy);
LIB_FUNCTION("Bq+LRV-N6Hk", "libScePosix", 1, "libkernel", 1, 1, posix_sem_getvalue);