summary refs log tree commit diff stats
path: root/linux-user
diff options
context:
space:
mode:
Diffstat (limited to 'linux-user')
-rw-r--r--linux-user/mmap.c9
-rw-r--r--linux-user/syscall.c5
2 files changed, 12 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 */
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 95806454d7..79d239ffa2 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -2402,9 +2402,14 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
         goto unimplemented;
     case TARGET_NR__llseek:
         {
+#if defined (__x86_64__)
+            ret = get_errno(lseek(arg1, ((uint64_t )arg2 << 32) | arg3, arg5));
+            *(int64_t *)arg4 = ret;
+#else
             int64_t res;
             ret = get_errno(_llseek(arg1, arg2, arg3, &res, arg5));
             *(int64_t *)arg4 = tswap64(res);
+#endif
         }
         break;
     case TARGET_NR_getdents: