about summary refs log tree commit diff stats
path: root/src/custommem.c
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2022-12-08 19:59:08 +0100
committerptitSeb <sebastien.chev@gmail.com>2022-12-08 19:59:08 +0100
commitdff14a868fdfe973243fc52c513d08f769ac2dc4 (patch)
tree88795a9f48554058a109f1446068bcc7eace2fc7 /src/custommem.c
parent4304301701b1990f855d30f9874e333ccb233f6a (diff)
downloadbox64-dff14a868fdfe973243fc52c513d08f769ac2dc4.tar.gz
box64-dff14a868fdfe973243fc52c513d08f769ac2dc4.zip
Some small fixes for pagesize != 4096
Diffstat (limited to 'src/custommem.c')
-rw-r--r--src/custommem.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/custommem.c b/src/custommem.c
index e11881d1..bb4ead49 100644
--- a/src/custommem.c
+++ b/src/custommem.c
@@ -1029,8 +1029,8 @@ void addMapMem(uintptr_t begin, uintptr_t end)
 {
     if(!mapmem)
         return;
-    begin &=~0xfff;
-    end = (end&~0xfff)+0xfff; // full page
+    begin &=~(box64_pagesize-1);
+    end = (end&~(box64_pagesize-1))+(box64_pagesize-1); // full page
     // sanitize values
     if(end<0x10000) return;
     if(!begin) begin = 0x10000;
@@ -1068,8 +1068,8 @@ void removeMapMem(uintptr_t begin, uintptr_t end)
 {
     if(!mapmem)
         return;
-    begin &=~0xfff;
-    end = (end&~0xfff)+0xfff; // full page
+    begin &=~(box64_pagesize-1);
+    end = (end&~(box64_pagesize-1))+(box64_pagesize-1); // full page
     // sanitize values
     if(end<0x10000) return;
     if(!begin) begin = 0x10000;