summaryrefslogtreecommitdiff
path: root/recipes/qemu/qemu-0.9.1+svn/qemu-amd64-32b-mapping-0.9.0.patch
blob: 02f093abb9d978b8ef1c09b419d519ea21ff4d8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
---
 linux-user/mmap.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Index: trunk/linux-user/mmap.c
===================================================================
--- trunk.orig/linux-user/mmap.c	2008-04-24 20:15:37.000000000 +0100
+++ trunk/linux-user/mmap.c	2008-04-24 20:16:16.000000000 +0100
@@ -29,6 +29,10 @@
 
 //#define DEBUG_MMAP
 
+#ifndef MAP_32BIT
+#define MAP_32BIT 0
+#endif
+
 /* NOTE: all the constants are the HOST ones, but addresses are target. */
 int target_mprotect(abi_ulong start, abi_ulong len, int prot)
 {
@@ -251,7 +255,7 @@
            especially important if qemu_host_page_size >
            qemu_real_host_page_size */
         p = mmap(g2h(mmap_start),
-                 host_len, prot, flags | MAP_FIXED, fd, host_offset);
+                 host_len, prot, flags | MAP_FIXED | MAP_32BIT, fd, host_offset);
         if (p == MAP_FAILED)
             return -1;
         /* update start so that it points to the file position at 'offset' */
@@ -406,7 +410,7 @@
     unsigned long host_addr;
 
     /* XXX: use 5 args syscall */
-    host_addr = (long)mremap(g2h(old_addr), old_size, new_size, flags);
+    host_addr = (long)mremap(g2h(old_addr), old_size, new_size, flags | MAP_32BIT);
     if (host_addr == -1)
         return -1;
     new_addr = h2g(host_addr);