mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-16 12:00:46 +02:00
The vast majoirty of syscalls don't need anything in thread or frame. So lets save an indirection for all those syscalls. Most of the syscalls which do need Thread (or CTX via Thread are in Thread.cpp or Memory.cpp These have all been modifiy to fetch Thread from Frame
27 lines
958 B
C++
27 lines
958 B
C++
#include "Tests/LinuxSyscalls/Syscalls.h"
|
|
#include "Tests/LinuxSyscalls/x32/Syscalls.h"
|
|
|
|
#include <sys/mount.h>
|
|
#include <unistd.h>
|
|
|
|
namespace FEX::HLE::x32 {
|
|
void RegisterFS() {
|
|
REGISTER_SYSCALL_IMPL_X32(umount, [](FEXCore::Core::CpuStateFrame *Frame, const char *target) -> uint64_t {
|
|
uint64_t Result = ::umount(target);
|
|
SYSCALL_ERRNO();
|
|
});
|
|
|
|
REGISTER_SYSCALL_IMPL_X32(ftruncate64, [](FEXCore::Core::CpuStateFrame *Frame, int fd, uint32_t offset_low, uint32_t offset_high) -> uint64_t {
|
|
uint64_t Offset = offset_high;
|
|
Offset <<= 32;
|
|
Offset |= offset_low;
|
|
uint64_t Result = ::ftruncate(fd, Offset);
|
|
SYSCALL_ERRNO();
|
|
});
|
|
|
|
REGISTER_SYSCALL_IMPL_X32(sigprocmask, [](FEXCore::Core::CpuStateFrame *Frame, int how, const uint64_t *set, uint64_t *oldset, size_t sigsetsize) -> uint64_t {
|
|
return FEX::HLE::_SyscallHandler->GetSignalDelegator()->GuestSigProcMask(how, set, oldset);
|
|
});
|
|
}
|
|
}
|