Mtrack/x86: Track shmat, shmdt via ipc syscall as well

This commit is contained in:
Stefanos Kornilios Misis Poiitidis committed 2022-06-03 12:41:32 +03:00
1 parent 3bbff8a948
commit 096ed29b5e
2 files changed
+10

No files matched your search

@@ -112,6 +112,7 @@ namespace FEX::HLE::x32 {
});
REGISTER_SYSCALL_IMPL_X32(shmat, [](FEXCore::Core::CpuStateFrame *Frame, int shmid, const void *shmaddr, int shmflg) -> uint64_t {
// also implemented in ipc:OP_SHMAT
uint32_t ResultAddr{};
uint64_t Result = static_cast<FEX::HLE::x32::x32SyscallHandler*>(FEX::HLE::_SyscallHandler)->GetAllocator()->
shmat(shmid, reinterpret_cast<const void*>(shmaddr), shmflg, &ResultAddr);
@@ -126,6 +127,7 @@ namespace FEX::HLE::x32 {
});
REGISTER_SYSCALL_IMPL_X32(shmdt, [](FEXCore::Core::CpuStateFrame *Frame, const void *shmaddr) -> uint64_t {
// also implemented in ipc:OP_SHMDT
uint64_t Result = static_cast<FEX::HLE::x32::x32SyscallHandler*>(FEX::HLE::_SyscallHandler)->GetAllocator()->
shmdt(shmaddr);
@@ -279,13 +279,21 @@ namespace FEX::HLE::x32 {
break;
}
case OP_SHMAT: {
// also implemented in memory:shmat
Result = static_cast<FEX::HLE::x32::x32SyscallHandler*>(FEX::HLE::_SyscallHandler)->GetAllocator()->
shmat(first, reinterpret_cast<const void*>(ptr), second, reinterpret_cast<uint32_t*>(third));
if (!FEX::HLE::HasSyscallError(Result)) {
FEX::HLE::_SyscallHandler->TrackShmat(first, *reinterpret_cast<uint32_t*>(third), second);
}
break;
}
case OP_SHMDT: {
// also implemented in memory:shmdt
Result = static_cast<FEX::HLE::x32::x32SyscallHandler*>(FEX::HLE::_SyscallHandler)->GetAllocator()->
shmdt(reinterpret_cast<void*>(ptr));
if (!FEX::HLE::HasSyscallError(Result)) {
FEX::HLE::_SyscallHandler->TrackShmdt(ptr);
}
break;
}
case OP_SHMGET: {