Skip to content

Commit

Permalink
Introduce BOX64_CPUTYPE to choose emulating Intel or AMD cpus (no AMD…
Browse files Browse the repository at this point in the history
… specific extension yet)
  • Loading branch information
ptitSeb committed Dec 27, 2024
1 parent 26ba114 commit a54f516
Show file tree
Hide file tree
Showing 4 changed files with 328 additions and 123 deletions.
9 changes: 9 additions & 0 deletions src/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ path_collection_t box64_addlibs = {0};
int box64_maxcpu = 0;
int box64_maxcpu_immutable = 0;
int box64_is32bits = 0;
int box64_cputype = 0;
#if defined(SD845) || defined(SD888) || defined(SD8G2) || defined(TEGRAX1)
int box64_mmap32 = 1;
#else
Expand Down Expand Up @@ -1308,6 +1309,14 @@ void LoadLogEnv()
else
printf_log(LOG_INFO, "Will not use 32bits address in priority for external MMAP (when 32bits process are detected)\n");
}
p = getenv("BOX64_CPUTYPE");
if(p) {
if(strlen(p)==1) {
if(p[0]>='0' && p[0]<='0'+1)
box64_cputype = p[0]-'0';
}
printf_log(LOG_INFO, "Will emulate an %s CPU\n", box64_cputype?"AMD":"Intel");
}
p = getenv("BOX64_IGNOREINT3");
if(p) {
if(strlen(p)==1) {
Expand Down
1 change: 1 addition & 0 deletions src/include/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ extern uint8_t box64_rdtsc_shift;
extern int box64_is32bits;
extern int box64_x11sync;
extern int box64_dynarec_gdbjit;
extern int box64_cputype;
#ifdef DYNAREC
extern int box64_dynarec_dump;
extern int box64_dynarec_trace;
Expand Down
Loading

0 comments on commit a54f516

Please sign in to comment.