diff options
author | nox <nox@FreeBSD.org> | 2014-08-23 07:11:59 +0800 |
---|---|---|
committer | nox <nox@FreeBSD.org> | 2014-08-23 07:11:59 +0800 |
commit | e399e9e7b09969d42f647d4baff54260564883d7 (patch) | |
tree | 968057bbaf66d146b1d49192a83ce7dbb1602e5a /emulators | |
parent | fa198b78817ec580fc37ce9cc4338bc8b675f884 (diff) | |
download | freebsd-ports-gnome-e399e9e7b09969d42f647d4baff54260564883d7.tar.gz freebsd-ports-gnome-e399e9e7b09969d42f647d4baff54260564883d7.tar.zst freebsd-ports-gnome-e399e9e7b09969d42f647d4baff54260564883d7.zip |
- bsd-user: fix sysctl hw.physmem if host bitsize != target's.
- Bump PORTREVISION.
Reported by: sbruno
Diffstat (limited to 'emulators')
-rw-r--r-- | emulators/qemu-devel/Makefile | 2 | ||||
-rw-r--r-- | emulators/qemu-devel/files/extra-patch-sysctl-hw-physmem | 40 |
2 files changed, 42 insertions, 0 deletions
diff --git a/emulators/qemu-devel/Makefile b/emulators/qemu-devel/Makefile index bb21aa417a38..8f58491ab925 100644 --- a/emulators/qemu-devel/Makefile +++ b/emulators/qemu-devel/Makefile @@ -3,6 +3,7 @@ PORTNAME= qemu PORTVERSION= 2.0.2 +PORTREVISION= 1 CATEGORIES= emulators MASTER_SITES= http://wiki.qemu.org/download/:release \ LOCAL/nox:snapshot @@ -76,6 +77,7 @@ EXTRA_PATCHES+= ${FILESDIR}/extra-patch-bsd-user-sparc64-target_arch_cpu.h EXTRA_PATCHES+= ${FILESDIR}/extra-patch-bsd-user-trapsig EXTRA_PATCHES+= ${FILESDIR}/extra-patch-21927cffcc7bcacbb953155f778200846df9f60e EXTRA_PATCHES+= ${FILESDIR}/extra-patch-bsd-user-freebsd-os-sys.c +EXTRA_PATCHES+= ${FILESDIR}/extra-patch-sysctl-hw-physmem .endif CONFIGURE_ARGS+= --extra-ldflags=-L${LOCALBASE}/lib diff --git a/emulators/qemu-devel/files/extra-patch-sysctl-hw-physmem b/emulators/qemu-devel/files/extra-patch-sysctl-hw-physmem new file mode 100644 index 000000000000..ae7ff4bdac85 --- /dev/null +++ b/emulators/qemu-devel/files/extra-patch-sysctl-hw-physmem @@ -0,0 +1,40 @@ +From nox Mon Sep 17 00:00:00 2001 +From: Juergen Lock <nox@jelal.kn-bremen.de> +Date: 23 Aug 2014 00:24:00 +0200 +Subject: Fix FreeBSD sysctl hw.physmem + +Fix FreeBSD sysctl hw.physmem if host bitsize != target's. + +Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de> + +--- a/bsd-user/freebsd/os-sys.c ++++ b/bsd-user/freebsd/os-sys.c +@@ -338,6 +338,28 @@ abi_long do_freebsd_sysctl(CPUArchState + ret = 0; + goto out; + ++#if TARGET_ABI_BITS != HOST_LONG_BITS ++ case HW_PHYSMEM: ++ holdlen = sizeof(abi_ulong); ++ ret = 0; ++ ++ if (oldlen) { ++ unsigned long lvalue; ++ size_t len = sizeof(lvalue); ++ ++ if (sysctlbyname("hw.physmem", &lvalue, &len, NULL, 0) ++ == -1) { ++ ret = -1; ++ } else { ++ abi_ulong maxmem = -0x100c000; ++ if (((unsigned long)maxmem) < lvalue) ++ lvalue = maxmem; ++ (*(abi_ulong *)holdp) = lvalue; ++ } ++ } ++ goto out; ++#endif ++ + default: + { + static int oid_hw_availpages; |