about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorAndré Zwing <nerv@dawncrow.de>2025-05-22 21:19:16 +0200
committerAndré Zwing <nerv@dawncrow.de>2025-05-22 21:27:02 +0200
commitfa874ffcbca0908493aea5e45503d52df998b099 (patch)
tree92153d2d823c013b6c66584786fac0dd6da4b85a /src
parentb729e3e37b37b5c14ab556d674aa71c24edcdffe (diff)
downloadbox64-fa874ffcbca0908493aea5e45503d52df998b099.tar.gz
box64-fa874ffcbca0908493aea5e45503d52df998b099.zip
[WOW64] Implement syscalls
Diffstat (limited to 'src')
-rw-r--r--src/dynarec/arm64/dynarec_arm64_00.c19
-rw-r--r--src/include/os.h2
2 files changed, 21 insertions, 0 deletions
diff --git a/src/dynarec/arm64/dynarec_arm64_00.c b/src/dynarec/arm64/dynarec_arm64_00.c
index 351e1e0a..3ab1e5c4 100644
--- a/src/dynarec/arm64/dynarec_arm64_00.c
+++ b/src/dynarec/arm64/dynarec_arm64_00.c
@@ -2646,6 +2646,25 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
             break;
         case 0xCD:
             u8 = F8;
+#ifdef _WIN32
+            NOTEST(x1);
+            SMEND();
+            GETIP(addr);
+            STORE_XEMU_CALL(xRIP);
+            MOV32w(x1, u8);
+            LDRx_U12(xR8, xEmu, offsetof(x64emu_t, win64_teb));
+            CALL_S(x86Int, -1);
+            LOAD_XEMU_CALL(xRIP);
+            TABLE64(x3, addr); // expected return address
+            CMPSx_REG(xRIP, x3);
+            B_MARK(cNE);
+            LDRw_U12(w1, xEmu, offsetof(x64emu_t, quit));
+            CBZw_NEXT(w1);
+            MARK;
+            LOAD_XEMU_REM();
+            jump_to_epilog(dyn, 0, xRIP, ninst);
+            break;
+#endif
             if(box64_wine && (u8==0x2D || u8==0x2C || u8==0x29)) {
                 INST_NAME("INT 29/2c/2d");
                 // lets do nothing
diff --git a/src/include/os.h b/src/include/os.h
index 1257cc48..f141e99e 100644
--- a/src/include/os.h
+++ b/src/include/os.h
@@ -26,6 +26,8 @@ void* mmap(void* addr, size_t length, int prot, int flags, int fd, off_t offset)
 int munmap(void* addr, size_t length);
 int mprotect(void* addr, size_t len, int prot);
 
+void x86Int(void* emu, int code);
+
 void* WinMalloc(size_t size);
 void* WinRealloc(void* ptr, size_t size);
 void* WinCalloc(size_t nmemb, size_t size);