about summary refs log tree commit diff stats
path: root/src/custommmap.c
diff options
context:
space:
mode:
authorYang Liu <liuyang22@iscas.ac.cn>2025-01-21 23:13:51 +0800
committerGitHub <noreply@github.com>2025-01-21 16:13:51 +0100
commit044dec0bfa0f3f8f62f7703d6b0a8600c1354dc5 (patch)
treedc41c611965cec299dcb62185c5fba4935b6251f /src/custommmap.c
parented8b6fe9db863a8d9e473a645e84700c7291bb06 (diff)
downloadbox64-044dec0bfa0f3f8f62f7703d6b0a8600c1354dc5.tar.gz
box64-044dec0bfa0f3f8f62f7703d6b0a8600c1354dc5.zip
[ENV] Initial refactor of env variables infrastructure (#2274)
* [ENV] Initial refactor of env variables infrastructure

* Ported BOX64_DYNAREC_LOG

* Ported more options

* Ported BOX64_MALLOC_HACK

* Ported BOX64_DYNAREC_TEST

* Ported more options

* Ported more options

* Ported more options

* Ported all options

* Removed old rcfile parser

* Fix

* review

* fix

* fix

* more fixes
Diffstat (limited to 'src/custommmap.c')
-rw-r--r--src/custommmap.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/custommmap.c b/src/custommmap.c
index c33841f8..4f506f32 100644
--- a/src/custommmap.c
+++ b/src/custommmap.c
@@ -2,6 +2,8 @@
 #include <unistd.h>
 #include <stdint.h>
 
+#include "env.h"
+
 #ifndef MAP_FAILED
 #define MAP_FAILED ((void *) -1)
 #endif
@@ -29,12 +31,12 @@ void* box_mmap(void *addr, unsigned long length, int prot, int flags, int fd, ss
 void* my_mmap64(x64emu_t* emu, void *addr, unsigned long length, int prot, int flags, int fd, ssize_t offset);
 
 extern int running32bits;
-extern int box64_mmap32;
+extern box64env_t box64env;
 
 EXPORT void* mmap64(void *addr, unsigned long length, int prot, int flags, int fd, ssize_t offset)
 {
     void* ret;
-    if(!addr && ((running32bits && box64_mmap32) || (flags&MAP_32BIT) || box64_is32bits))
+    if(!addr && ((running32bits && BOX64ENV(mmap32)) || (flags&MAP_32BIT) || box64_is32bits))
         ret = box_mmap(addr, length, prot, flags | MAP_32BIT, fd, offset);
     else
         ret = internal_mmap(addr, length, prot, flags, fd, offset);