34 lines
1.0 KiB
Diff
34 lines
1.0 KiB
Diff
Index: qemu/linux-user/mmap.c
|
|
================================================================================
|
|
--- qemu-0.9.1/linux-user/mmap.c
|
|
+++ qemu-0.9.1/linux-user/mmap.c
|
|
@@ -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. */
|
|
@@ -119,7 +123,7 @@
|
|
if (prot1 == 0) {
|
|
/* no page was there, so we allocate one */
|
|
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;
|
|
prot1 = prot;
|
|
@@ -422,7 +426,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);
|