mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-14 18:00:46 +02:00
Sadly these things can't be split without breaking functionality so it turns in to a bit of a mess. SyscallHandler is very much something that is a Linux only construct and shouldn't be in FEXCore itself. Lets the frontend register a Syscallhandler with FEXCore. FEXCore itself is then aware of the current syscall ABI and handles the ABI in an optimal fashion. So it is not a 100% clean break otherwise we would lose performance. The SignalDelegator then needs to move to the frontend since the SyscallHandler requires it for signal based syscalls. The CPU backend signal handling still needs to happen in FEXCore because it is a very tight coupling with the CPU backend. Once we need to support more Signal handling we can give the backends cleaner support to select which specific OS handler to handle.
52 lines
1.9 KiB
C++
52 lines
1.9 KiB
C++
#include <FEXCore/Utils/LogManager.h>
|
|
#include "Tests/LinuxSyscalls/Syscalls.h"
|
|
#include "Tests/LinuxSyscalls/x64/Syscalls.h"
|
|
#include "Tests/LinuxSyscalls/x32/Syscalls.h"
|
|
|
|
#include <stdint.h>
|
|
#include <sys/epoll.h>
|
|
|
|
#define REGISTER_SYSCALL_NOT_IMPL(name) REGISTER_SYSCALL_IMPL(name, [](FEXCore::Core::InternalThreadState *Thread) -> uint64_t { \
|
|
LogMan::Msg::D("Using deprecated/removed syscall: " #name); \
|
|
return -ENOSYS; \
|
|
});
|
|
|
|
#define REGISTER_SYSCALL_NO_PERM(name) REGISTER_SYSCALL_IMPL(name, [](FEXCore::Core::InternalThreadState *Thread) -> uint64_t { \
|
|
return -EPERM; \
|
|
});
|
|
|
|
#define REGISTER_SYSCALL_NO_ACCESS(name) REGISTER_SYSCALL_IMPL(name, [](FEXCore::Core::InternalThreadState *Thread) -> uint64_t { \
|
|
return -EACCES; \
|
|
});
|
|
|
|
namespace FEX::HLE {
|
|
// these are removed/not implemented in the linux kernel we present
|
|
|
|
void RegisterNotImplemented() {
|
|
REGISTER_SYSCALL_NOT_IMPL(uselib);
|
|
REGISTER_SYSCALL_NOT_IMPL(create_module);
|
|
REGISTER_SYSCALL_NOT_IMPL(get_kernel_syms);
|
|
REGISTER_SYSCALL_NOT_IMPL(query_module);
|
|
REGISTER_SYSCALL_NOT_IMPL(nfsservctl); // Was removed in Linux 3.1
|
|
REGISTER_SYSCALL_NOT_IMPL(getpmsg);
|
|
REGISTER_SYSCALL_NOT_IMPL(putpmsg);
|
|
REGISTER_SYSCALL_NOT_IMPL(afs_syscall);
|
|
REGISTER_SYSCALL_NOT_IMPL(vserver);
|
|
REGISTER_SYSCALL_NOT_IMPL(_sysctl); // Was removed in Linux 5.5
|
|
|
|
REGISTER_SYSCALL_NO_PERM(vhangup);
|
|
REGISTER_SYSCALL_NO_PERM(pivot_root);
|
|
REGISTER_SYSCALL_NO_PERM(reboot)
|
|
REGISTER_SYSCALL_NO_PERM(sethostname);
|
|
REGISTER_SYSCALL_NO_PERM(setdomainname);
|
|
REGISTER_SYSCALL_NO_PERM(kexec_load);
|
|
REGISTER_SYSCALL_NO_PERM(finit_module);
|
|
REGISTER_SYSCALL_NO_PERM(bpf);
|
|
REGISTER_SYSCALL_NO_PERM(lookup_dcookie);
|
|
REGISTER_SYSCALL_NO_PERM(init_module)
|
|
REGISTER_SYSCALL_NO_PERM(delete_module);
|
|
REGISTER_SYSCALL_NO_PERM(quotactl);
|
|
REGISTER_SYSCALL_NO_ACCESS(perf_event_open);
|
|
}
|
|
}
|