ARM64EC: Switch to the emulator stack in BeginSimulation

Windows calls this function on the guest stack for some reason.
This commit is contained in:
Billy Laws committed 2024-08-01 12:06:05 +00:00
1 parent fa72be2ec5
commit f48071dcbe
1 file changed
+3
+3
View File
@@ -41,6 +41,9 @@ enter_jit:
// Expects a CONTEXT pointer in x0
.global BeginSimulation
BeginSimulation:
ldr x17, [x18, #0x1788] // TEB->ChpeV2CpuAreaInfo
ldr x16, [x17, #0x8] // ChpeV2CpuAreaInfo->EmulatorStackBase
mov sp, x16
bl "#SyncThreadContext"
ldr x17, [x18, #0x1788] // TEB->ChpeV2CpuAreaInfo
ldr x16, [x17, #0x48] // ChpeV2CpuAreaInfo->EmulatorData[3] - DispatcherLoopTopEnterECFillSRA