2007-07-10 18:55:54 +02:00
|
|
|
Index: qemu/linux-user/mmap.c
|
2007-11-13 21:32:02 +01:00
|
|
|
================================================================================
|
|
|
|
--- qemu/linux-user/mmap.c
|
2007-07-10 18:55:54 +02:00
|
|
|
+++ qemu/linux-user/mmap.c
|
2007-06-20 19:21:29 +02:00
|
|
|
@@ -27,6 +27,10 @@
|
|
|
|
|
|
|
|
#include "qemu.h"
|
|
|
|
|
|
|
|
+#if !defined(MAP_32BIT)
|
|
|
|
+#define MAP_32BIT 0
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
//#define DEBUG_MMAP
|
|
|
|
|
|
|
|
/* NOTE: all the constants are the HOST ones, but addresses are target. */
|
2007-11-13 21:32:02 +01:00
|
|
|
@@ -119,7 +123,7 @@
|
2007-06-20 19:21:29 +02:00
|
|
|
if (prot1 == 0) {
|
|
|
|
/* no page was there, so we allocate one */
|
2007-11-13 21:32:02 +01:00
|
|
|
void *p = mmap(host_start, qemu_host_page_size, prot,
|
|
|
|
- flags | MAP_ANONYMOUS, -1, 0);
|
|
|
|
+ flags | MAP_ANONYMOUS | MAP_32BIT, -1, 0);
|
|
|
|
if (p == MAP_FAILED)
|
|
|
|
return -1;
|
2007-06-20 19:21:29 +02:00
|
|
|
prot1 = prot;
|
2007-11-13 21:32:02 +01:00
|
|
|
@@ -251,7 +255,7 @@
|
|
|
|
host_len = HOST_PAGE_ALIGN(host_len + qemu_host_page_size
|
|
|
|
- qemu_real_host_page_size);
|
|
|
|
p = mmap(real_start ? g2h(real_start) : NULL,
|
|
|
|
- host_len, prot, flags, fd, host_offset);
|
|
|
|
+ host_len, prot, flags | MAP_32BIT, fd, host_offset);
|
|
|
|
if (p == MAP_FAILED)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
@@ -277,7 +281,7 @@
|
|
|
|
} else {
|
|
|
|
/* if not fixed, no need to do anything */
|
|
|
|
void *p = mmap(real_start ? g2h(real_start) : NULL,
|
2007-06-20 19:21:29 +02:00
|
|
|
- host_len, prot, flags, fd, host_offset);
|
|
|
|
+ host_len, prot, flags | MAP_32BIT, fd, host_offset);
|
2007-11-13 21:32:02 +01:00
|
|
|
if (p == MAP_FAILED)
|
|
|
|
return -1;
|
2007-06-20 19:21:29 +02:00
|
|
|
/* update start so that it points to the file position at 'offset' */
|
2007-11-13 21:32:02 +01:00
|
|
|
@@ -434,7 +438,7 @@
|
|
|
|
unsigned long host_addr;
|
2007-06-20 19:21:29 +02:00
|
|
|
|
|
|
|
/* XXX: use 5 args syscall */
|
2007-11-13 21:32:02 +01:00
|
|
|
- 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);
|