mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-06 20:00:16 +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.
25 lines
997 B
C++
25 lines
997 B
C++
#include <FEXCore/Utils/LogManager.h>
|
|
#include "Tests/LinuxSyscalls/Syscalls.h"
|
|
#include "Tests/LinuxSyscalls/x64/Syscalls.h"
|
|
|
|
namespace FEX::HLE::x64 {
|
|
#define REGISTER_SYSCALL_NOT_IMPL_X64(name) REGISTER_SYSCALL_IMPL_X64(name, [](FEXCore::Core::InternalThreadState *Thread) -> uint64_t { \
|
|
LogMan::Msg::D("Using deprecated/removed syscall: " #name); \
|
|
return -ENOSYS; \
|
|
});
|
|
#define REGISTER_SYSCALL_NO_PERM_X64(name) REGISTER_SYSCALL_IMPL_X64(name, [](FEXCore::Core::InternalThreadState *Thread) -> uint64_t { \
|
|
return -EPERM; \
|
|
});
|
|
|
|
// these are removed/not implemented in the linux kernel we present
|
|
void RegisterNotImplemented() {
|
|
REGISTER_SYSCALL_NOT_IMPL_X64(tuxcall);
|
|
REGISTER_SYSCALL_NOT_IMPL_X64(security);
|
|
REGISTER_SYSCALL_NOT_IMPL_X64(set_thread_area);
|
|
REGISTER_SYSCALL_NOT_IMPL_X64(get_thread_area);
|
|
REGISTER_SYSCALL_NOT_IMPL_X64(epoll_ctl_old);
|
|
REGISTER_SYSCALL_NOT_IMPL_X64(epoll_wait_old);
|
|
REGISTER_SYSCALL_NO_PERM_X64(kexec_file_load);
|
|
}
|
|
}
|