about summary refs log tree commit diff stats
path: root/src/custommem.c
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-02-01 16:41:16 +0100
committerptitSeb <sebastien.chev@gmail.com>2024-02-01 16:42:16 +0100
commit1344b1837909da6d91153cf686557a4a10bcb468 (patch)
tree4094e4397b3b0c3d7170687ed2f9dd69bba5f5c5 /src/custommem.c
parent1deec05f3dfaa93b034d0bb7cf00b0f9d73d4016 (diff)
downloadbox64-1344b1837909da6d91153cf686557a4a10bcb468.tar.gz
box64-1344b1837909da6d91153cf686557a4a10bcb468.zip
[DYNAREC] Handling of memfd_create backed mmap on dynarec (help #1234 but doesn't solve it completly)
Diffstat (limited to 'src/custommem.c')
-rw-r--r--src/custommem.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/custommem.c b/src/custommem.c
index 9882f886..ac3643b0 100644
--- a/src/custommem.c
+++ b/src/custommem.c
@@ -994,7 +994,7 @@ uintptr_t getJumpAddress64(uintptr_t addr)
 // Remove the Write flag from an adress range, so DB can be executed safely
 void protectDBJumpTable(uintptr_t addr, size_t size, void* jump, void* ref)
 {
-    dynarec_log(LOG_DEBUG, "protectDB %p -> %p\n", (void*)addr, (void*)(addr+size-1));
+    dynarec_log(LOG_DEBUG, "protectDBJumpTable %p -> %p\n", (void*)addr, (void*)(addr+size-1));
 
     uintptr_t cur = addr&~(box64_pagesize-1);
     uintptr_t end = ALIGN(addr+size);
@@ -1010,7 +1010,7 @@ void protectDBJumpTable(uintptr_t addr, size_t size, void* jump, void* ref)
         uint32_t dyn = prot&PROT_DYN;
         if(!prot)
             prot = PROT_READ | PROT_WRITE | PROT_EXEC;
-        if(!(dyn&PROT_NOPROT)) {
+        if(!(dyn&PROT_NEVERPROT)) {
             prot&=~PROT_CUSTOM;
             if(prot&PROT_WRITE) {
                 if(!dyn) 
@@ -1047,7 +1047,7 @@ void protectDB(uintptr_t addr, uintptr_t size)
         uint32_t dyn = prot&PROT_DYN;
         if(!prot)
             prot = PROT_READ | PROT_WRITE | PROT_EXEC;
-        if(!(dyn&PROT_NOPROT)) {
+        if(!(dyn&PROT_NEVERPROT)) {
             prot&=~PROT_CUSTOM;
             if(prot&PROT_WRITE) {
                 if(!dyn) 
@@ -1085,7 +1085,7 @@ void unprotectDB(uintptr_t addr, size_t size, int mark)
         oprot = prot;
         if(bend>end)
             bend = end;
-        if(!(prot&PROT_NOPROT)) {
+        if(!(prot&PROT_NEVERPROT)) {
             if(prot&PROT_DYNAREC) {
                 prot&=~PROT_DYN;
                 if(mark)
@@ -1137,7 +1137,7 @@ void updateProtection(uintptr_t addr, size_t size, uint32_t prot)
         uint32_t oprot;
         rb_get_end(memprot, cur, &oprot, &bend);
         uint32_t dyn=(oprot&PROT_DYN);
-        if(!(dyn&PROT_NOPROT)) {
+        if(!(dyn&PROT_NEVERPROT)) {
             if(dyn && (prot&PROT_WRITE)) {   // need to remove the write protection from this block
                 dyn = PROT_DYNAREC;
                 mprotect((void*)cur, bend-cur, prot&~PROT_WRITE);