aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--exec.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/exec.c b/exec.c
index 76163aa87f..a6d3bad747 100644
--- a/exec.c
+++ b/exec.c
@@ -307,13 +307,14 @@ static void page_init(void)
if (h2g_valid(endaddr)) {
endaddr = h2g(endaddr);
- page_set_flags(startaddr, endaddr, PAGE_RESERVED);
} else {
#if TARGET_ABI_BITS <= L1_MAP_ADDR_SPACE_BITS
endaddr = ~0ul;
- page_set_flags(startaddr, endaddr, PAGE_RESERVED);
+#else
+ endaddr = ((abi_ulong)1 << L1_MAP_ADDR_SPACE_BITS) - 1;
#endif
}
+ page_set_flags(startaddr, endaddr, PAGE_RESERVED);
}
}
free(freep);
@@ -324,11 +325,7 @@ static void page_init(void)
last_brk = (unsigned long)sbrk(0);
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
- f = fopen("/compat/linux/proc/self/maps", "r");
-#else
f = fopen("/proc/self/maps", "r");
-#endif
if (f) {
mmap_lock();
@@ -344,7 +341,11 @@ static void page_init(void)
if (h2g_valid(endaddr)) {
endaddr = h2g(endaddr);
} else {
+#if TARGET_ABI_BITS <= L1_MAP_ADDR_SPACE_BITS
endaddr = ~0ul;
+#else
+ endaddr = ((abi_ulong)1 << L1_MAP_ADDR_SPACE_BITS) - 1;
+#endif
}
page_set_flags(startaddr, endaddr, PAGE_RESERVED);
}