diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2022-02-27 19:06:21 +0800 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2022-02-27 19:06:21 +0800 |
| commit | 2f1024f16763165db359e7c30ad7034a4434d752 (patch) | |
| tree | 23423a5e8407bbd59516927c3bceb5bcd3b3ab04 /src/dynarec | |
| parent | 6d4183934128e58bcfe27d419a41a89ed073e0b7 (diff) | |
| download | box64-2f1024f16763165db359e7c30ad7034a4434d752.tar.gz box64-2f1024f16763165db359e7c30ad7034a4434d752.zip | |
[DYNAREC] More multi-arch work
Diffstat (limited to 'src/dynarec')
| -rwxr-xr-x | src/dynarec/dynarec.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/dynarec/dynarec.c b/src/dynarec/dynarec.c index 36fa85ad..694c5690 100755 --- a/src/dynarec/dynarec.c +++ b/src/dynarec/dynarec.c @@ -26,7 +26,15 @@ #ifdef ARM64 void arm64_prolog(x64emu_t* emu, void* addr) EXPORTDYN; void arm64_epilog() EXPORTDYN; -void arm64_epilog_fast() EXPORTDYN; +#define native_prolog arm64_prolog +#define native_epilog arm64_epilog +#elif defined(LA464) +void la464_prolog(x64emu_t* emu, void* addr) EXPORTDYN; +void la464_epilog() EXPORTDYN; +#define native_prolog la464_prolog +#define native_epilog la464_epilog +#else +#error Unsupported architecture #endif #endif @@ -59,18 +67,17 @@ void* LinkNext(x64emu_t* emu, uintptr_t addr, void* x2, uintptr_t* x3) dynablock_t* db = FindDynablockFromNativeAddress(x2-4); dynarec_log(LOG_INFO, "Warning, jumping to a no-block address %p from %p (db=%p, x64addr=%p)\n", (void*)addr, x2-4, db, db?(void*)getX64Address(db, (uintptr_t)x2-4):NULL); #endif - //tableupdate(arm64_epilog, addr, table); - return arm64_epilog; + //tableupdate(native_epilog, addr, table); + return native_epilog; } } if(!block->done) { // not finished yet... leave linker - //tableupdate(arm_linker, addr, table); - return arm64_epilog; + return native_epilog; } if(!(jblock=block->block)) { // null block, but done: go to epilog, no linker here - return arm64_epilog; + return native_epilog; } //dynablock_t *father = block->father?block->father:block; return jblock; @@ -131,9 +138,7 @@ void DynaCall(x64emu_t* emu, uintptr_t addr) dynarec_log(LOG_DEBUG, "%04d|Calling DynaRec Block @%p (%p) of %d x64 instructions (father=%p) emu=%p\n", GetTID(), (void*)R_RIP, block->block, block->isize ,block->father, emu); CHECK_FLAGS(emu); // block is here, let's run it! - #ifdef ARM64 - arm64_prolog(emu, block->block); - #endif + native_prolog(emu, block->block); block = NULL; } if(emu->fork) { @@ -212,9 +217,7 @@ int DynaRun(x64emu_t* emu) } else { dynarec_log(LOG_DEBUG, "%04d|Running DynaRec Block @%p (%p) of %d x64 insts (father=%p) emu=%p\n", GetTID(), (void*)R_RIP, block->block, block->isize, block->father, emu); // block is here, let's run it! - #ifdef ARM64 - arm64_prolog(emu, block->block); - #endif + native_prolog(emu, block->block); block = NULL; } if(emu->fork) { |