aboutsummaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorAurelien Jarno <aurelien@aurel32.net>2010-04-10 17:20:36 +0200
committerAurelien Jarno <aurelien@aurel32.net>2010-04-10 17:20:36 +0200
commitfd43690777b19e5072f6be22eba17c0894af9e73 (patch)
tree984c9f62e65766133e0dceacdc6baef00393a7ab /exec.c
parent837d987bb9aab751cdf92f81c852e2819094232f (diff)
Revert "Avoid page_set_flags() assert in qemu-user host page protection code"
This reverts commit 01c0bef1625d8e5d6d5c6abaf413214d667615ad. (breaks build on 32-bit hosts)
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/exec.c b/exec.c
index a6d3bad747..76163aa87f 100644
--- a/exec.c
+++ b/exec.c
@@ -307,14 +307,13 @@ 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;
-#else
- endaddr = ((abi_ulong)1 << L1_MAP_ADDR_SPACE_BITS) - 1;
+ page_set_flags(startaddr, endaddr, PAGE_RESERVED);
#endif
}
- page_set_flags(startaddr, endaddr, PAGE_RESERVED);
}
}
free(freep);
@@ -325,7 +324,11 @@ 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();
@@ -341,11 +344,7 @@ 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);
}