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-06-22 16:33:33 +0200
committerptitSeb <sebastien.chev@gmail.com>2023-06-22 16:33:33 +0200
commit6b0a1d286a0ff9a01370fb79320f85768e313549 (patch)
treee07d1e7f77aea04507152406061332ece0bcb57e /src/dynarec/dynarec_native.c
parente78cd0d62378c6de1bdc539626e0b27485b3c20f (diff)
downloadbox64-6b0a1d286a0ff9a01370fb79320f85768e313549.tar.gz
box64-6b0a1d286a0ff9a01370fb79320f85768e313549.zip
[32BITS][DYNAREC] Preparing Dynarec to handle 32bits code
Diffstat (limited to 'src/dynarec/dynarec_native.c')
-rwxr-xr-xsrc/dynarec/dynarec_native.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/dynarec/dynarec_native.c b/src/dynarec/dynarec_native.c
index 0f56828b..0d3bd780 100755
--- a/src/dynarec/dynarec_native.c
+++ b/src/dynarec/dynarec_native.c
@@ -398,10 +398,10 @@ void CancelBlock64(int need_lock)
         mutex_unlock(&my_context->mutex_dyndump);
 }
 
-uintptr_t native_pass0(dynarec_native_t* dyn, uintptr_t addr);
-uintptr_t native_pass1(dynarec_native_t* dyn, uintptr_t addr);
-uintptr_t native_pass2(dynarec_native_t* dyn, uintptr_t addr);
-uintptr_t native_pass3(dynarec_native_t* dyn, uintptr_t addr);
+uintptr_t native_pass0(dynarec_native_t* dyn, uintptr_t addr, int is32bits);
+uintptr_t native_pass1(dynarec_native_t* dyn, uintptr_t addr, int is32bits);
+uintptr_t native_pass2(dynarec_native_t* dyn, uintptr_t addr, int is32bits);
+uintptr_t native_pass3(dynarec_native_t* dyn, uintptr_t addr, int is32bits);
 
 void* CreateEmptyBlock(dynablock_t* block, uintptr_t addr) {
     block->isize = 0;
@@ -426,7 +426,7 @@ void* CreateEmptyBlock(dynablock_t* block, uintptr_t addr) {
     return block;
 }
 
-void* FillBlock64(dynablock_t* block, uintptr_t addr) {
+void* FillBlock64(dynablock_t* block, uintptr_t addr, int is32bits) {
     /*
         A Block must have this layout:
 
@@ -463,7 +463,7 @@ void* FillBlock64(dynablock_t* block, uintptr_t addr) {
     helper.cap = 128;
     helper.insts = (instruction_native_t*)customCalloc(helper.cap, sizeof(instruction_native_t));
     // pass 0, addresses, x64 jump addresses, overall size of the block
-    uintptr_t end = native_pass0(&helper, addr);
+    uintptr_t end = native_pass0(&helper, addr, is32bits);
     // no need for next anymore
     customFree(helper.next);
     helper.next_sz = helper.next_cap = 0;
@@ -514,10 +514,10 @@ void* FillBlock64(dynablock_t* block, uintptr_t addr) {
         pos = updateNeed(&helper, pos, 0);
 
     // pass 1, float optimisations, first pass for flags
-    native_pass1(&helper, addr);
+    native_pass1(&helper, addr, is32bits);
     
     // pass 2, instruction size
-    native_pass2(&helper, addr);
+    native_pass2(&helper, addr, is32bits);
     // keep size of instructions for signal handling
     size_t insts_rsize = (helper.insts_size+2)*sizeof(instsize_t);
     insts_rsize = (insts_rsize+7)&~7;   // round the size...
@@ -555,7 +555,7 @@ void* FillBlock64(dynablock_t* block, uintptr_t addr) {
     size_t oldnativesize = helper.native_size;
     helper.native_size = 0;
     helper.table64size = 0; // reset table64 (but not the cap)
-    native_pass3(&helper, addr);
+    native_pass3(&helper, addr, is32bits);
     // keep size of instructions for signal handling
     block->instsize = instsize;
     // ok, free the helper now