about summary refs log tree commit diff stats
path: root/src/dynarec/dynarec_native.c
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2023-02-16 12:17:42 +0100
committerptitSeb <sebastien.chev@gmail.com>2023-02-16 12:17:42 +0100
commit8f4e8ed1e7b6dff16396a84c5cb23ab72008035a (patch)
treeba2a8f553261159ab398981b028c9ed98465cbfc /src/dynarec/dynarec_native.c
parent0e10ead81adc6756cebc075f8b041a22d08d3c2d (diff)
downloadbox64-8f4e8ed1e7b6dff16396a84c5cb23ab72008035a.tar.gz
box64-8f4e8ed1e7b6dff16396a84c5cb23ab72008035a.zip
[DYNAREC] Various small fixes and improvment on Dynarec
Diffstat (limited to 'src/dynarec/dynarec_native.c')
-rwxr-xr-xsrc/dynarec/dynarec_native.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/dynarec/dynarec_native.c b/src/dynarec/dynarec_native.c
index 506eaf0f..c2cf1387 100755
--- a/src/dynarec/dynarec_native.c
+++ b/src/dynarec/dynarec_native.c
@@ -425,6 +425,19 @@ void* CreateEmptyBlock(dynablock_t* block, uintptr_t addr) {
 }
 
 void* FillBlock64(dynablock_t* block, uintptr_t addr) {
+    /*
+        A Block must have this layout:
+
+        0x0000..0x0007  : dynablock_t* : self
+        0x0008..8+4*n   : actual Native instructions, (n is the total number)
+        A ..    A+8*n   : Table64: n 64bits values
+        B ..    B+7     : dynablock_t* : self (as part of JmpNext, that simulate another block)
+        B+8 ..  B+15    : 2 Native code for jmpnext (or jmp epilog in case of empty block)
+        B+16 .. B+23    : jmpnext (or jmp_epilog) address
+        B+24 .. B+31    : empty (in case an architecture needs more than 2 opcodes)
+        B+32 .. B+32+sz : instsize (compressed array with each instruction lenght on x64 and native side)
+
+    */
     if(IsInHotPage(addr)) {
         dynarec_log(LOG_DEBUG, "Cancelling dynarec FillBlock on hotpage for %p\n", (void*)addr);
         return NULL;