MCPcopy Create free account
hub / github.com/FEX-Emu/FEX / ResetToConsistentState

Function ResetToConsistentState

Source/Windows/ARM64EC/Module.cpp:803–836  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

801}
802
803NTSTATUS ResetToConsistentState(EXCEPTION_RECORD* Exception, CONTEXT* GuestContext, ARM64_NT_CONTEXT* NativeContext) {
804 bool Cont {};
805 if (Exception->ExceptionCode == EXCEPTION_ACCESS_VIOLATION) {
806 const auto FaultAddress = static_cast<uint64_t>(Exception->ExceptionInformation[1]);
807
808 if (OvercommitTracker) {
809 {
810 ScopedCallbackDisable guard;
811 Cont = OvercommitTracker->HandleAccessViolation(FaultAddress);
812 }
813 if (Cont) {
814 NtContinueNative(NativeContext, false);
815 }
816 }
817 }
818
819 if (!GetCPUArea().ThreadState()) {
820 return STATUS_SUCCESS;
821 }
822
823 {
824
825 ScopedCallbackDisable guard;
826 Cont = ResetToConsistentStateImpl(Exception, GuestContext, NativeContext);
827 }
828
829 if (Cont) {
830 NtContinueNative(NativeContext, false);
831 }
832
833 GetCPUArea().Area->InSimulation = false;
834 GetCPUArea().Area->InSyscallCallback = false;
835 return STATUS_SUCCESS;
836}
837
838void NotifyMemoryAlloc(void* Address, SIZE_T Size, ULONG Type, ULONG Prot, BOOL After, NTSTATUS Status) {
839 if (!InvalidationTracker || !GetCPUArea().ThreadState()) {

Callers

nothing calls this directly

Calls 3

GetCPUAreaFunction · 0.85
HandleAccessViolationMethod · 0.80

Tested by

no test coverage detected