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.
This commit is contained in:
Billy Laws committed 2024-12-12 21:28:37 +00:00
1 parent af1d2d6005
commit d080180e85
1 file changed
+3
+3
View File
@@ -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.