From 10c3b2fb5d9051498e947ecc49c8ae620bb2a1be Mon Sep 17 00:00:00 2001 From: Lioncache Date: Wed, 8 Oct 2025 16:39:50 -0400 Subject: [PATCH] SyscallHandler: Shrink definition struct from 24 to 16 bytes Just a minor space saving, given how many syscall definitions we'll have. --- Source/Tools/LinuxEmulation/LinuxSyscalls/Syscalls.h | 6 +++--- Source/Tools/LinuxEmulation/LinuxSyscalls/x64/Syscalls.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/Tools/LinuxEmulation/LinuxSyscalls/Syscalls.h b/Source/Tools/LinuxEmulation/LinuxSyscalls/Syscalls.h index f9de63dae..d346ec6fa 100644 --- a/Source/Tools/LinuxEmulation/LinuxSyscalls/Syscalls.h +++ b/Source/Tools/LinuxEmulation/LinuxSyscalls/Syscalls.h @@ -128,8 +128,6 @@ public: using SyscallPtrArg6 = uint64_t (*)(FEXCore::Core::CpuStateFrame* Frame, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t); struct SyscallFunctionDefinition { - uint8_t NumArgs; - FEXCore::IR::SyscallFlags Flags; union { void* Ptr; SyscallPtrArg0 Ptr0; @@ -141,6 +139,8 @@ public: SyscallPtrArg6 Ptr6; }; int32_t HostSyscallNumber; + uint8_t NumArgs; + FEXCore::IR::SyscallFlags Flags; #ifdef DEBUG_STRACE fextl::string StraceFmt; #endif @@ -335,8 +335,8 @@ protected: fextl::vector Definitions {std::max(FEX::HLE::x64::SYSCALL_x64_MAX, FEX::HLE::x32::SYSCALL_x86_MAX), { - .NumArgs = 255, .Ptr = reinterpret_cast(&UnimplementedSyscall), + .NumArgs = 255, }}; std::mutex MMapMutex; diff --git a/Source/Tools/LinuxEmulation/LinuxSyscalls/x64/Syscalls.cpp b/Source/Tools/LinuxEmulation/LinuxSyscalls/x64/Syscalls.cpp index 40a3a164d..6e78e50d7 100644 --- a/Source/Tools/LinuxEmulation/LinuxSyscalls/x64/Syscalls.cpp +++ b/Source/Tools/LinuxEmulation/LinuxSyscalls/x64/Syscalls.cpp @@ -63,10 +63,10 @@ void x64SyscallHandler::RegisterSyscallHandlers() { constexpr int SYSCALL_GAP_END = 424; const SyscallFunctionDefinition InvalidSyscall { - .NumArgs = 0, - .Flags = FEXCore::IR::SyscallFlags::DEFAULT, .Ptr = reinterpret_cast(&UnimplementedSyscall), .HostSyscallNumber = SYSCALL_DEF(MAX), + .NumArgs = 0, + .Flags = FEXCore::IR::SyscallFlags::DEFAULT, #ifdef DEBUG_STRACE .StraceFmt = "Invalid", #endif