qemu/qemu-0.9.0-mmap.x86_64.patch

34 lines
1.2 KiB
Diff

Index: qemu-0.9.0/linux-user/mmap.c
===================================================================
--- qemu-0.9.0.orig/linux-user/mmap.c
+++ qemu-0.9.0/linux-user/mmap.c
@@ -162,7 +162,7 @@ long target_mmap(target_ulong start, tar
{
target_ulong ret, end, real_start, real_end, retaddr, host_offset, host_len;
long host_start;
-#if defined(__alpha__) || defined(__sparc__) || defined(__x86_64__) || \
+#if defined(__alpha__) || defined(__sparc__) || \
defined(__ia64)
static target_ulong last_start = 0x40000000;
#elif defined(__CYGWIN__)
@@ -170,6 +170,10 @@ long target_mmap(target_ulong start, tar
static target_ulong last_start = 0x18000000;
#endif
+#if defined(__x86_64__)
+ flags |= MAP_32BIT;
+#endif
+
#ifdef DEBUG_MMAP
{
printf("mmap: start=0x%lx len=0x%lx prot=%c%c%c flags=",
@@ -207,7 +211,7 @@ long target_mmap(target_ulong start, tar
real_start = start & qemu_host_page_mask;
if (!(flags & MAP_FIXED)) {
-#if defined(__alpha__) || defined(__sparc__) || defined(__x86_64__) || \
+#if defined(__alpha__) || defined(__sparc__) || \
defined(__ia64) || defined(__CYGWIN__)
/* tell the kenel to search at the same place as i386 */
if (real_start == 0) {