mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 01:39:16 -04:00
- bsd-user: fix sysctl hw.physmem if host bitsize != target's.
- Bump PORTREVISION. Reported by: sbruno
This commit is contained in:
parent
3badcfd910
commit
4502405c48
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=365703
2 changed files with 42 additions and 0 deletions
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
PORTNAME= qemu
|
PORTNAME= qemu
|
||||||
PORTVERSION= 2.0.2
|
PORTVERSION= 2.0.2
|
||||||
|
PORTREVISION= 1
|
||||||
CATEGORIES= emulators
|
CATEGORIES= emulators
|
||||||
MASTER_SITES= http://wiki.qemu.org/download/:release \
|
MASTER_SITES= http://wiki.qemu.org/download/:release \
|
||||||
LOCAL/nox:snapshot
|
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-bsd-user-trapsig
|
||||||
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-21927cffcc7bcacbb953155f778200846df9f60e
|
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-21927cffcc7bcacbb953155f778200846df9f60e
|
||||||
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-bsd-user-freebsd-os-sys.c
|
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-bsd-user-freebsd-os-sys.c
|
||||||
|
EXTRA_PATCHES+= ${FILESDIR}/extra-patch-sysctl-hw-physmem
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
CONFIGURE_ARGS+= --extra-ldflags=-L${LOCALBASE}/lib
|
CONFIGURE_ARGS+= --extra-ldflags=-L${LOCALBASE}/lib
|
||||||
|
|
40
emulators/qemu-devel/files/extra-patch-sysctl-hw-physmem
Normal file
40
emulators/qemu-devel/files/extra-patch-sysctl-hw-physmem
Normal file
|
@ -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;
|
Loading…
Add table
Reference in a new issue