Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Apr 2014 21:54:49 +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: r350272 - in head/emulators/qemu-devel: . files
Message-ID:  <201404052154.s35LsnZY007311@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: nox
Date: Sat Apr  5 21:54:49 2014
New Revision: 350272
URL: http://svnweb.freebsd.org/changeset/ports/350272
QAT: https://qat.redports.org/buildarchive/r350272/

Log:
  - Three more bsd-user fixes:
    - Fix fchflags(). (typo) [1]
    - Fix hw.availpages sysctl. [1]
    - Fix sysctl kern.usrstack and kern.ps_strings invoked from sysctl(8).
  - Bump PORTREVISION.
  
  Reported by:	sbruno [1]

Added:
  head/emulators/qemu-devel/files/extra-patch-bsd-user-syscall.c   (contents, props changed)
  head/emulators/qemu-devel/files/extra-patch-sysctl-0oldlen   (contents, props changed)
  head/emulators/qemu-devel/files/extra-patch-sysctl-hw-availpages   (contents, props changed)
Modified:
  head/emulators/qemu-devel/Makefile

Modified: head/emulators/qemu-devel/Makefile
==============================================================================
--- head/emulators/qemu-devel/Makefile	Sat Apr  5 21:52:11 2014	(r350271)
+++ head/emulators/qemu-devel/Makefile	Sat Apr  5 21:54:49 2014	(r350272)
@@ -3,7 +3,7 @@
 
 PORTNAME=	qemu
 PORTVERSION=	1.7.1
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	emulators
 MASTER_SITES=	http://wiki.qemu.org/download/:release \
 		LOCAL/nox:snapshot
@@ -71,6 +71,9 @@ EXTRA_PATCHES+=	${FILESDIR}/extra-patch-
 EXTRA_PATCHES+=	${FILESDIR}/extra-patch-bsd-user-mips-target_arch_vmparam.h
 EXTRA_PATCHES+=	${FILESDIR}/extra-patch-inherit-interp_prefix
 EXTRA_PATCHES+=	${FILESDIR}/extra-patch-d62553b108aa27c0c020dbb771d29f8673807a3b
+EXTRA_PATCHES+=	${FILESDIR}/extra-patch-bsd-user-syscall.c
+EXTRA_PATCHES+=	${FILESDIR}/extra-patch-sysctl-hw-availpages
+EXTRA_PATCHES+=	${FILESDIR}/extra-patch-sysctl-0oldlen
 .endif
 
 CONFIGURE_ARGS+=	--extra-ldflags=-L${LOCALBASE}/lib

Added: head/emulators/qemu-devel/files/extra-patch-bsd-user-syscall.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/qemu-devel/files/extra-patch-bsd-user-syscall.c	Sat Apr  5 21:54:49 2014	(r350272)
@@ -0,0 +1,11 @@
+--- a/bsd-user/syscall.c
++++ b/bsd-user/syscall.c
+@@ -627,7 +627,7 @@ abi_long do_freebsd_syscall(void *cpu_en
+         break;
+ 
+     case TARGET_FREEBSD_NR_fchflags: /* fchflags(2) */
+-        ret = do_bsd_fchflags(arg2, arg2);
++        ret = do_bsd_fchflags(arg1, arg2);
+         break;
+ 
+     case TARGET_FREEBSD_NR_chroot: /* chroot(2) */

Added: head/emulators/qemu-devel/files/extra-patch-sysctl-0oldlen
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/qemu-devel/files/extra-patch-sysctl-0oldlen	Sat Apr  5 21:54:49 2014	(r350272)
@@ -0,0 +1,24 @@
+--- a/bsd-user/freebsd/os-sys.c
++++ b/bsd-user/freebsd/os-sys.c
+@@ -165,7 +165,9 @@ abi_long do_freebsd_sysctl(CPUArchState 
+         switch (snamep[1]) {
+         case KERN_USRSTACK:
+ #if TARGET_USRSTACK != 0
+-            (*(abi_ulong *)holdp) = tswapal(TARGET_USRSTACK);
++            if (oldlen) {
++                (*(abi_ulong *)holdp) = tswapal(TARGET_USRSTACK);
++            }
+             holdlen = sizeof(abi_ulong);
+             ret = 0;
+ #else
+@@ -175,7 +177,9 @@ abi_long do_freebsd_sysctl(CPUArchState 
+ 
+         case KERN_PS_STRINGS:
+ #if defined(TARGET_PS_STRINGS)
+-            (*(abi_ulong *)holdp) = tswapal(TARGET_PS_STRINGS);
++            if (oldlen) {
++                (*(abi_ulong *)holdp) = tswapal(TARGET_PS_STRINGS);
++            }
+             holdlen = sizeof(abi_ulong);
+             ret = 0;
+ #else

Added: head/emulators/qemu-devel/files/extra-patch-sysctl-hw-availpages
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/qemu-devel/files/extra-patch-sysctl-hw-availpages	Sat Apr  5 21:54:49 2014	(r350272)
@@ -0,0 +1,53 @@
+--- a/bsd-user/freebsd/os-sys.c
++++ b/bsd-user/freebsd/os-sys.c
+@@ -219,24 +219,36 @@ abi_long do_freebsd_sysctl(CPUArchState 
+             ret = 0;
+             goto out;
+ 
+-        case 851: /* hw.availpages */
++        default:
+             {
+-                long lvalue;
+-                size_t len = sizeof(lvalue);
++                static int oid_hw_availpages;
++
++                if (!oid_hw_availpages) {
++                    int real_oid[CTL_MAXNAME+2];
++                    size_t len = sizeof(real_oid) / sizeof(int);
+ 
+-                if (sysctlbyname("hw.availpages", &lvalue, &len, NULL, 0)
+-                        == -1) {
+-                    ret = -1;
+-                } else {
+-                    (*(abi_ulong *)holdp) = tswapal((abi_ulong)lvalue);
+-                    holdlen = sizeof(abi_ulong);
+-                    ret = 0;
++                    if (sysctlnametomib("hw.availpages", real_oid, &len) >= 0)
++                        oid_hw_availpages = real_oid[1];
+                 }
+-            }
+-            goto out;
+ 
+-        default:
+-            break;
++                if (oid_hw_availpages && snamep[1] == oid_hw_availpages) {
++                    long lvalue;
++                    size_t len = sizeof(lvalue);
++
++                    if (sysctlbyname("hw.availpages", &lvalue, &len, NULL, 0)
++                            == -1) {
++                        ret = -1;
++                    } else {
++                        if (oldlen) {
++                            (*(abi_ulong *)holdp) = tswapal((abi_ulong)lvalue);
++                        }
++                        holdlen = sizeof(abi_ulong);
++                        ret = 0;
++                    }
++                    goto out;
++                }
++                break;
++            }
+         }
+     default:
+         break;



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