summaryrefslogtreecommitdiff
path: root/linux-user/mmap.c
diff options
context:
space:
mode:
authorPaul Brook <paul@codesourcery.com>2010-05-05 16:32:59 +0100
committerPaul Brook <paul@codesourcery.com>2010-05-05 16:32:59 +0100
commit2e9a5713f0567fffaa3518f495b8d16a2b74f84a (patch)
treee7c2651dc7f83db54d27af18a7f8fac7bf848437 /linux-user/mmap.c
parent048d179f20c1499c7f55957df125392de664b6a7 (diff)
downloadqemu-2e9a5713f0567fffaa3518f495b8d16a2b74f84a.tar.gz
Remove PAGE_RESERVED
The usermode PAGE_RESERVED code is not required by the current mmap implementation, and is already broken when guest_base != 0. Unfortunately the bsd emulation still uses the old mmap implementation, so we can't rip it out altogether. Signed-off-by: Paul Brook <paul@codesourcery.com>
Diffstat (limited to 'linux-user/mmap.c')
-rw-r--r--linux-user/mmap.c19
1 files changed, 0 insertions, 19 deletions
diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index 46923c707c..9c062e7078 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -85,14 +85,6 @@ void *qemu_vmalloc(size_t size)
/* Use map and mark the pages as used. */
p = mmap(NULL, size, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
-
- if (h2g_valid(p)) {
- /* Allocated region overlaps guest address space. This may recurse. */
- abi_ulong addr = h2g(p);
- page_set_flags(addr & TARGET_PAGE_MASK, TARGET_PAGE_ALIGN(addr + size),
- PAGE_RESERVED);
- }
-
mmap_unlock();
return p;
}
@@ -484,9 +476,6 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot,
}
start = h2g(host_start);
} else {
- int flg;
- target_ulong addr;
-
if (start & ~TARGET_PAGE_MASK) {
errno = EINVAL;
goto fail;
@@ -504,14 +493,6 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot,
goto fail;
}
- for(addr = real_start; addr < real_end; addr += TARGET_PAGE_SIZE) {
- flg = page_get_flags(addr);
- if (flg & PAGE_RESERVED) {
- errno = ENXIO;
- goto fail;
- }
- }
-
/* worst case: we cannot map the file because the offset is not
aligned, so we read it */
if (!(flags & MAP_ANONYMOUS) &&