about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorYang Liu <numbksco@gmail.com>2025-05-31 03:18:22 +0800
committerYang Liu <numbksco@gmail.com>2025-05-31 03:18:22 +0800
commitab5d2eba64b29501c4ed369fa2d95447c07f3761 (patch)
tree02cd28911b83ea6915b037eeaf9636ab955f3251
parentb142c5a1817fb788b9692870ff6aa0cb3e622aea (diff)
downloadbox64-ab5d2eba64b29501c4ed369fa2d95447c07f3761.tar.gz
box64-ab5d2eba64b29501c4ed369fa2d95447c07f3761.zip
[WOW64] Improved RIP handling on INT n
-rw-r--r--src/dynarec/arm64/dynarec_arm64_00.c2
-rw-r--r--src/emu/x64run.c2
-rw-r--r--wow64/wowbox64.c6
3 files changed, 5 insertions, 5 deletions
diff --git a/src/dynarec/arm64/dynarec_arm64_00.c b/src/dynarec/arm64/dynarec_arm64_00.c
index 7b227e24..1baf4bb5 100644
--- a/src/dynarec/arm64/dynarec_arm64_00.c
+++ b/src/dynarec/arm64/dynarec_arm64_00.c
@@ -2649,7 +2649,7 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
             #ifdef _WIN32
             NOTEST(x1);
             SMEND();
-            GETIP(addr);
+            GETIP(ip);
             STORE_XEMU_CALL(xRIP);
             MOV32w(x1, u8);
             CALL_S(native_int, -1);
diff --git a/src/emu/x64run.c b/src/emu/x64run.c
index 078a7ea9..8b21ca83 100644
--- a/src/emu/x64run.c
+++ b/src/emu/x64run.c
@@ -1532,9 +1532,11 @@ x64emurun:
         case 0xCD:                      /* INT n */
             tmp8u = F8;
             #ifdef _WIN32
+            #ifndef TEST_INTERPRETER
             EmitInterruption(emu, tmp8u, (void*)R_RIP);
             STEP;
             addr = R_RIP;
+            #endif
             #else
             // this is a privilege opcode...
             if(box64_wine && tmp8u==0x2D) {
diff --git a/wow64/wowbox64.c b/wow64/wowbox64.c
index f0d9fd4b..b6e83e9e 100644
--- a/wow64/wowbox64.c
+++ b/wow64/wowbox64.c
@@ -349,8 +349,6 @@ NTSTATUS WINAPI BTCpuTurboThunkControl(ULONG enable)
 
 void EmitInterruptionImpl(x64emu_t *emu, int code)
 {
-    int inst_off = box64env.dynarec ? 2 : 0;
-
     if (code == 0x2e)  /* NT syscall */
     {
         WOW64_CPURESERVED *cpu = NtCurrentTeb()->TlsSlots[WOW64_TLS_CPURESERVED];
@@ -358,9 +356,9 @@ void EmitInterruptionImpl(x64emu_t *emu, int code)
         int id = R_EAX;
         BOOL is_unix_call = FALSE;
 
-        if (ULongToPtr(R_RIP-inst_off) == &unxcode)
+        if (ULongToPtr(R_RIP) == &unxcode)
             is_unix_call = TRUE;
-        else if (ULongToPtr(R_RIP-inst_off) != &bopcode)
+        else if (ULongToPtr(R_RIP) != &bopcode)
             return;
 
         R_RIP = Pop32(emu);