Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Aug 2014 23:12:00 +0000 (UTC)
From:      Juergen Lock <nox@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r365703 - in head/emulators/qemu-devel: . files
Message-ID:  <201408222312.s7MNC0vT023998@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: nox
Date: Fri Aug 22 23:11:59 2014
New Revision: 365703
URL: http://svnweb.freebsd.org/changeset/ports/365703
QAT: https://qat.redports.org/buildarchive/r365703/

Log:
  - bsd-user: fix sysctl hw.physmem if host bitsize != target's.
  - Bump PORTREVISION.
  
  Reported by:	sbruno

Added:
  head/emulators/qemu-devel/files/extra-patch-sysctl-hw-physmem   (contents, props changed)
Modified:
  head/emulators/qemu-devel/Makefile

Modified: head/emulators/qemu-devel/Makefile
==============================================================================
--- head/emulators/qemu-devel/Makefile	Fri Aug 22 22:06:37 2014	(r365702)
+++ head/emulators/qemu-devel/Makefile	Fri Aug 22 23:11:59 2014	(r365703)
@@ -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-
 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

Added: head/emulators/qemu-devel/files/extra-patch-sysctl-hw-physmem
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/qemu-devel/files/extra-patch-sysctl-hw-physmem	Fri Aug 22 23:11:59 2014	(r365703)
@@ -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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201408222312.s7MNC0vT023998>