about summary refs log tree commit diff stats
path: root/src/include
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2023-03-27 23:21:36 +0200
committerptitSeb <sebastien.chev@gmail.com>2023-03-27 23:21:36 +0200
commit9f75f28e7a464734bab8e719c1a60178280b224d (patch)
tree6c7d9c2d1e1c4d307e7acfbcbf92b04c7e83dea1 /src/include
parentfeb4a394577ea152b60393875860c551a7573adf (diff)
downloadbox64-9f75f28e7a464734bab8e719c1a60178280b224d.tar.gz
box64-9f75f28e7a464734bab8e719c1a60178280b224d.zip
[DYNAREC] Added BOX64_DYNAREC_TEST to run interpeter and dynarec at the same time and compare states
Diffstat (limited to 'src/include')
-rwxr-xr-xsrc/include/box64context.h1
-rwxr-xr-xsrc/include/debug.h1
-rwxr-xr-xsrc/include/dynarec.h3
-rwxr-xr-xsrc/include/x64emu.h1
-rwxr-xr-xsrc/include/x64run.h2
5 files changed, 8 insertions, 0 deletions
diff --git a/src/include/box64context.h b/src/include/box64context.h
index 1920bb8a..62e4bad5 100755
--- a/src/include/box64context.h
+++ b/src/include/box64context.h
@@ -136,6 +136,7 @@ typedef struct box64context_s {
     uint32_t            mutex_bridge;
     uintptr_t           max_db_size;    // the biggest (in x86_64 instructions bytes) built dynablock
     int                 trace_dynarec;
+    pthread_mutex_t     mutex_lock;     // this is for the Test interpreter
     #endif
 
     library_t           *libclib;       // shortcut to libc library (if loaded, so probably yes)
diff --git a/src/include/debug.h b/src/include/debug.h
index e13de642..37146e02 100755
--- a/src/include/debug.h
+++ b/src/include/debug.h
@@ -26,6 +26,7 @@ extern int box64_dynarec_bleeding_edge;
 extern int box64_dynarec_hotpage;
 extern int box64_dynarec_fastpage;
 extern int box64_dynarec_wait;
+extern int box64_dynarec_test;
 #ifdef ARM64
 extern int arm64_asimd;
 extern int arm64_aes;
diff --git a/src/include/dynarec.h b/src/include/dynarec.h
index a68c6d6a..c304cf1e 100755
--- a/src/include/dynarec.h
+++ b/src/include/dynarec.h
@@ -5,4 +5,7 @@ typedef struct x64emu_s x64emu_t;
 
 void DynaCall(x64emu_t* emu, uintptr_t addr); // try to use DynaRec... Fallback to EmuCall if no dynarec available
 
+void x64test_init(x64emu_t* ref);
+void x64test_check(x64emu_t* ref);
+
 #endif // __DYNAREC_H_
\ No newline at end of file
diff --git a/src/include/x64emu.h b/src/include/x64emu.h
index e7efbb07..17252b68 100755
--- a/src/include/x64emu.h
+++ b/src/include/x64emu.h
@@ -10,6 +10,7 @@ void SetupX64Emu(x64emu_t *emu);
 void FreeX64Emu(x64emu_t **x64emu);
 void FreeX64EmuFromStack(x64emu_t **emu);
 void CloneEmu(x64emu_t *newemu, const x64emu_t* emu);
+void CopyEmu(x64emu_t *newemu, const x64emu_t* emu);
 void SetTraceEmu(uintptr_t trace_start, uintptr_t trace_end);
 
 box64context_t* GetEmuContext(x64emu_t* emu);
diff --git a/src/include/x64run.h b/src/include/x64run.h
index 78903bbc..0e156341 100755
--- a/src/include/x64run.h
+++ b/src/include/x64run.h
@@ -3,7 +3,9 @@
 #include <stdint.h>
 
 typedef struct x64emu_s x64emu_t;
+typedef struct x64test_s x64test_t;
 int Run(x64emu_t *emu, int step); // 0 if run was successfull, 1 if error in x86 world
+int RunTest(x64test_t *test);
 int DynaRun(x64emu_t *emu);
 
 uint32_t LibSyscall(x64emu_t *emu);