about summary refs log tree commit diff stats
path: root/src/core.c
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-08-18 16:02:27 +0200
committerGitHub <noreply@github.com>2024-08-18 16:02:27 +0200
commitfda0e9a4cba9b71de60f974fadfa74c7fbff5b15 (patch)
treef18d6631d62761d1556abd18a91d4729bd1f41e1 /src/core.c
parentf1da5d433a707a1308732884c455ae50ffbe4fe1 (diff)
parentdead2003fa59cbfa6a2fd8ba285bdf28aac953f3 (diff)
downloadbox64-fda0e9a4cba9b71de60f974fadfa74c7fbff5b15.tar.gz
box64-fda0e9a4cba9b71de60f974fadfa74c7fbff5b15.zip
Merge branch 'box32' into main
Diffstat (limited to 'src/core.c')
-rw-r--r--src/core.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core.c b/src/core.c
index e93a75ea..3283a6c2 100644
--- a/src/core.c
+++ b/src/core.c
@@ -58,6 +58,7 @@ int box64_dynarec_test = 0;
 path_collection_t box64_addlibs = {0};
 int box64_maxcpu = 0;
 int box64_maxcpu_immutable = 0;
+int box64_is32bits = 0;
 #if defined(SD845) || defined(SD888) || defined(SD8G2) || defined(TEGRAX1)
 int box64_mmap32 = 1;
 #else
@@ -2084,6 +2085,13 @@ int initialize(int argc, const char **argv, char** env, x64emu_t** emulator, elf
         FreeCollection(&ld_preload);
         return -1;
     }
+    #ifdef BOX32
+    box64_is32bits = FileIsX86ELF(my_context->fullpath);
+    if(box64_is32bits) {
+        printf_log(LOG_INFO, "BOX64: Using Box32 to load 32bits elf\n");
+        reserveHighMem();
+    }
+    #endif
     elfheader_t *elf_header = LoadAndCheckElfHeader(f, my_context->fullpath, 1);
     if(!elf_header) {
         int x86 = my_context->box86path?FileIsX86ELF(my_context->fullpath):0;