Skip to content

Commit

Permalink
Merge pull request #4044 from bylaws/int2e
Browse files Browse the repository at this point in the history
OpcodeDispatcher: Do not forbid INT 2E syscalls on 64-bit Windows
  • Loading branch information
Sonicadvance1 authored Sep 6, 2024
2 parents f77841d + f7b911c commit bbef4d7
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4656,9 +4656,6 @@ void OpDispatchBuilder::INTOp(OpcodeArgs) {

#ifndef _WIN32
constexpr uint8_t SYSCALL_LITERAL = 0x80;
#else
constexpr uint8_t SYSCALL_LITERAL = 0x2E;
#endif
if (Literal == SYSCALL_LITERAL) {
if (CTX->Config.Is64BitMode()) [[unlikely]] {
ERROR_AND_DIE_FMT("[Unsupported] Trying to execute 32-bit syscall from a 64-bit process.");
Expand All @@ -4667,6 +4664,14 @@ void OpDispatchBuilder::INTOp(OpcodeArgs) {
SyscallOp(Op, false);
return;
}
#else
constexpr uint8_t SYSCALL_LITERAL = 0x2E;
if (Literal == SYSCALL_LITERAL) {
// Can be used for both 64-bit and 32-bit syscalls on windows
SyscallOp(Op, false);
return;
}
#endif

#ifdef _M_ARM_64EC
// This is used when QueryPerformanceCounter is called on recent Windows versions, it causes CNTVCT to be written into RAX.
Expand Down

0 comments on commit bbef4d7

Please sign in to comment.