about summary refs log tree commit diff stats
path: root/src/custommem.c
diff options
context:
space:
mode:
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;