This commit is contained in:
parent
c55634e3ed
commit
c828f62526
60
qemu-0.8.2-alt-mmap.patch
Normal file
60
qemu-0.8.2-alt-mmap.patch
Normal file
@ -0,0 +1,60 @@
|
||||
diff -uNr qemu-0.8.2.orig/linux-user/mmap.c qemu-0.8.2/linux-user/mmap.c
|
||||
--- qemu-0.8.2.orig/linux-user/mmap.c 2007-01-16 16:05:33 +0200
|
||||
+++ qemu-0.8.2/linux-user/mmap.c 2007-01-16 16:27:28 +0200
|
||||
@@ -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. */
|
||||
@@ -116,7 +120,7 @@
|
||||
if (prot1 == 0) {
|
||||
/* no page was there, so we allocate one */
|
||||
ret = (long)mmap(host_start, qemu_host_page_size, prot,
|
||||
- flags | MAP_ANONYMOUS, -1, 0);
|
||||
+ flags | MAP_ANONYMOUS | MAP_32BIT, -1, 0);
|
||||
if (ret == -1)
|
||||
return ret;
|
||||
prot1 = prot;
|
||||
@@ -217,7 +221,8 @@
|
||||
abort();
|
||||
host_len = HOST_PAGE_ALIGN(len) + qemu_host_page_size - TARGET_PAGE_SIZE;
|
||||
real_start = (long)mmap(g2h(real_start), host_len, PROT_NONE,
|
||||
- MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
|
||||
+ MAP_PRIVATE | MAP_ANONYMOUS | MAP_32BIT
|
||||
+ , -1, 0);
|
||||
if (real_start == -1)
|
||||
return real_start;
|
||||
real_end = real_start + host_len;
|
||||
@@ -234,7 +239,7 @@
|
||||
host_offset = offset & qemu_host_page_mask;
|
||||
host_len = len + offset - host_offset;
|
||||
host_start = (long)mmap(real_start ? g2h(real_start) : NULL,
|
||||
- host_len, prot, flags, fd, host_offset);
|
||||
+ host_len, prot, flags | MAP_32BIT, fd, host_offset);
|
||||
if (host_start == -1)
|
||||
return host_start;
|
||||
/* update start so that it points to the file position at 'offset' */
|
||||
@@ -312,7 +317,7 @@
|
||||
else
|
||||
offset1 = offset + real_start - start;
|
||||
ret = (long)mmap(g2h(real_start), real_end - real_start,
|
||||
- prot, flags, fd, offset1);
|
||||
+ prot, flags | MAP_32BIT, fd, offset1);
|
||||
if (ret == -1)
|
||||
return ret;
|
||||
}
|
||||
@@ -388,7 +393,7 @@
|
||||
int prot;
|
||||
|
||||
/* XXX: use 5 args syscall */
|
||||
- new_addr = (long)mremap(g2h(old_addr), old_size, new_size, flags);
|
||||
+ new_addr = (long)mremap(g2h(old_addr), old_size, new_size, flags | MAP_32BIT);
|
||||
if (new_addr == -1)
|
||||
return new_addr;
|
||||
new_addr = h2g(new_addr);
|
@ -1,33 +0,0 @@
|
||||
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) {
|
@ -1,3 +1,8 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Jun 20 14:38:47 CEST 2007 - agraf@suse.de
|
||||
|
||||
- applied proper fix for x86_64 and the MAP_32BIT flag
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Jun 20 10:59:11 CEST 2007 - uli@suse.de
|
||||
|
||||
|
@ -17,7 +17,7 @@ License: BSD License and BSD-like, GNU General Public License (GPL)
|
||||
Group: System/Emulators/Other
|
||||
Summary: Universal CPU emulator
|
||||
Version: 0.9.0
|
||||
Release: 37
|
||||
Release: 38
|
||||
Source: %name-%version.tar.bz2
|
||||
#Patch400: qemu-0.7.0-gcc4-dot-syms.patch
|
||||
#Patch401: qemu-0.8.0-gcc4-hacks.patch
|
||||
@ -52,7 +52,7 @@ Patch38: qemu-0.9.0-kvm-bios.patch
|
||||
Patch39: qemu-0.9.0-kvm-kqemu-window-caption.patch
|
||||
Patch40: qemu-z80.diff
|
||||
Patch41: qemu-0.9.0-sched.patch
|
||||
Patch42: qemu-0.9.0-mmap.x86_64.patch
|
||||
Patch42: qemu-0.8.2-alt-mmap.patch
|
||||
Patch43: qemu-0.9.0-futex.patch
|
||||
Patch44: qemu-0.9.0-robust_list.patch
|
||||
Patch45: qemu-0.9.0-wine.patch
|
||||
@ -332,6 +332,8 @@ rm -rf %{gcc33tmp}
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Wed Jun 20 2007 - agraf@suse.de
|
||||
- applied proper fix for x86_64 and the MAP_32BIT flag
|
||||
* Wed Jun 20 2007 - uli@suse.de
|
||||
- added secfixes (bug #252519)
|
||||
* Thu Jun 14 2007 - agraf@suse.de
|
||||
|
Loading…
Reference in New Issue
Block a user