about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-07-05 17:24:24 +0200
committerptitSeb <sebastien.chev@gmail.com>2021-07-05 17:24:24 +0200
commitc6119efb042c6f534d41417c4b77ca97e024b57f (patch)
tree5c5b69dcd9ce0cc3bd41eb919f3e12eefd25f1d2
parentd0dee6cb506a800727ce25b0afc35914c8708d32 (diff)
downloadbox64-c6119efb042c6f534d41417c4b77ca97e024b57f.tar.gz
box64-c6119efb042c6f534d41417c4b77ca97e024b57f.zip
[DYNAREC] Added 0F 05 opcode (for Wine64 and probbly a few others)
-rwxr-xr-xsrc/dynarec/dynarec_arm64_0f.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/dynarec/dynarec_arm64_0f.c b/src/dynarec/dynarec_arm64_0f.c
index e65a5aaa..6b7b964a 100755
--- a/src/dynarec/dynarec_arm64_0f.c
+++ b/src/dynarec/dynarec_arm64_0f.c
@@ -94,6 +94,22 @@ uintptr_t dynarec64_0F(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
 

     switch(opcode) {

 

+        case 0x05:

+            INST_NAME("SYSCALL");

+            GETIP(addr);

+            STORE_XEMU_CALL(xRIP);

+            CALL_S(x64Syscall, -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;

+

         case 0x0B:

             INST_NAME("UD2");

             SETFLAGS(X_ALL, SF_SET);    // Hack to set flags in "don't care" state