From d080180e858789ec0eefcc15bfe159fa594057c5 Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Tue, 23 Jul 2024 20:35:17 +0000 Subject: [PATCH] ARM64EC: Process pending cross-process work on syscalls and exceptions This is used to notify the JIT of e.g. memory writes by a debugger. --- Source/Windows/ARM64EC/Module.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/Windows/ARM64EC/Module.cpp b/Source/Windows/ARM64EC/Module.cpp index c4d0b8ba9..a24963412 100644 --- a/Source/Windows/ARM64EC/Module.cpp +++ b/Source/Windows/ARM64EC/Module.cpp @@ -467,6 +467,8 @@ public: } uint64_t HandleSyscall(FEXCore::Core::CpuStateFrame* Frame, FEXCore::HLE::SyscallArguments* Args) override { + ProcessPendingCrossProcessEmulatorWork(); + // Manually raise an exeption with the current JIT state packed into a native context, ntdll handles this and // reenters the JIT (see dlls/ntdll/signal_arm64ec.c in wine). uint64_t FPCR, FPSR; @@ -505,6 +507,7 @@ public: } // namespace Exception extern "C" void SyncThreadContext(CONTEXT* Context) { + ProcessPendingCrossProcessEmulatorWork(); auto* Thread = GetCPUArea().ThreadState(); // All other EFlags bits are lost when converting to/from an ARM64EC context, so merge them in from the current JIT state. // This is advisable over dropping their values as thread suspend/resume uses this function, and that can happen at any point in guest code.