summaryrefslogtreecommitdiff
path: root/linux-user/mmap.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-04-26 19:44:02 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-04-26 19:44:02 +0000
commit4f2ac237840677ffcb1b3ca30d04a4c2d360f7c7 (patch)
tree704572756ba55ed1631f64d1efc9511cec24560f /linux-user/mmap.c
parentf658b4db792285d0ddc044d7532451b8ec3c4a08 (diff)
downloadqemu-4f2ac237840677ffcb1b3ca30d04a4c2d360f7c7.zip
amd64 port (Jocelyn Mayer)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@762 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'linux-user/mmap.c')
-rw-r--r--linux-user/mmap.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index 4f937443e7..312af9b1de 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -152,6 +152,9 @@ long target_mmap(unsigned long start, unsigned long len, int prot,
int flags, int fd, unsigned long offset)
{
unsigned long ret, end, host_start, host_end, retaddr, host_offset, host_len;
+#if defined(__alpha__) || defined(__sparc__) || defined(__x86_64__)
+ static unsigned long last_start = 0x40000000;
+#endif
#ifdef DEBUG_MMAP
{
@@ -190,8 +193,10 @@ long target_mmap(unsigned long start, unsigned long len, int prot,
if (!(flags & MAP_FIXED)) {
#if defined(__alpha__) || defined(__sparc__) || defined(__x86_64__)
/* tell the kenel to search at the same place as i386 */
- if (host_start == 0)
- host_start = 0x40000000;
+ if (host_start == 0) {
+ host_start = last_start;
+ last_start += HOST_PAGE_ALIGN(len);
+ }
#endif
if (host_page_size != real_host_page_size) {
/* NOTE: this code is only for debugging with '-p' option */