From owner-svn-src-user@FreeBSD.ORG Sun Nov 2 14:23:59 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6ACC1185; Sun, 2 Nov 2014 14:23:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5769AB16; Sun, 2 Nov 2014 14:23:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2ENxDR039143; Sun, 2 Nov 2014 14:23:59 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2ENxj3039142; Sun, 2 Nov 2014 14:23:59 GMT (envelope-from pho@FreeBSD.org) Message-Id: <201411021423.sA2ENxj3039142@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Sun, 2 Nov 2014 14:23:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r273971 - user/pho/stress2/misc X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 14:23:59 -0000 Author: pho Date: Sun Nov 2 14:23:58 2014 New Revision: 273971 URL: https://svnweb.freebsd.org/changeset/base/273971 Log: Added regression test for r273966. Sponsored by: EMC / Isilon storage division Added: user/pho/stress2/misc/spin.sh (contents, props changed) Added: user/pho/stress2/misc/spin.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/spin.sh Sun Nov 2 14:23:58 2014 (r273971) @@ -0,0 +1,129 @@ +#!/bin/sh + +# +# Copyright (c) 2014 EMC Corp. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +# Demonstrate starvation: Thread stuck in "ufs" for minutes. +# Only seen with >= 16 CPUs. +# Not a problem with 4BSD. +# http://people.freebsd.org/~pho/stress/log/spin.txt +# Fixed by r273966. + +mntpoint=/mnt +mdstart=5 +part=a +timeout=1200 +[ -r ../default.cfg ] && . ../default.cfg + +here=`pwd` +cd /tmp +sed '1,/^EOF/d' < $here/$0 > spin.c +cc -o spin -Wall -Wextra -O0 spin.c || exit 1 +rm -f spin.c +cd $here + +mount | grep $mntpoint | grep -q /dev/md && umount -f $mntpoint +mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart + +mdconfig -a -t swap -s 1g -u $mdstart || exit 1 +bsdlabel -w md$mdstart auto +newfs $newfs_flags -n md${mdstart}$part > /dev/null +mount /dev/md${mdstart}$part $mntpoint + +cpus=`sysctl hw.ncpu | sed 's/.*: //'` +(cd $mntpoint; /tmp/spin $((cpus + 1))) & +error=0 +n=0 +while kill -0 $! 2>/dev/null; do + sleep 1 + n=$((n + 1)) + if [ $n -gt $timeout ]; then + echo FAIL + ps -l | grep -v sed | sed -n '1p;/ufs/p' + pkill spin + error=1 + fi +done +wait + +while mount | grep $mntpoint | grep -q /dev/md; do + umount $mntpoint || sleep 1 +done +mdconfig -d -u $mdstart +rm -f /tmp/spin +exit $error +EOF +#include +#include + +#include +#include +#include +#include +#include + +void +work(void) +{ + + while (access("rendezvous", R_OK) != 0) + ; + + _exit(0); +} + +int +main(int argc, char **argv) +{ + int fd, i, parallel; + + if (argc == 2) + parallel = atoi(argv[1]); + else + errx(1, "Usage: %s ", argv[0]); + + for (i = 0; i < parallel; i++) { + if (fork() == 0) + work(); + } + + /* open(2) blocked on "ufs" for minutes */ + if ((fd = open("rendezvous", O_CREAT, 0644)) == -1) + err(1, "open()"); + close(fd); + + for (i = 0; i < parallel; i++) + wait(NULL); + + if (unlink("rendezvous") == -1) + err(1, "unlink()"); + + return (0); +} From owner-svn-src-user@FreeBSD.ORG Sun Nov 2 14:28:21 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8054D4AE; Sun, 2 Nov 2014 14:28:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D5EBB57; Sun, 2 Nov 2014 14:28:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA2ESLbf040103; Sun, 2 Nov 2014 14:28:21 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA2ESLoY040102; Sun, 2 Nov 2014 14:28:21 GMT (envelope-from pho@FreeBSD.org) Message-Id: <201411021428.sA2ESLoY040102@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Sun, 2 Nov 2014 14:28:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r273972 - user/pho/stress2/misc X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 14:28:21 -0000 Author: pho Date: Sun Nov 2 14:28:20 2014 New Revision: 273972 URL: https://svnweb.freebsd.org/changeset/base/273972 Log: Added comment for problem found and fixed by r273967. Sponsored by: EMC / Isilon storage division Modified: user/pho/stress2/misc/crossmp3.sh Modified: user/pho/stress2/misc/crossmp3.sh ============================================================================== --- user/pho/stress2/misc/crossmp3.sh Sun Nov 2 14:23:58 2014 (r273971) +++ user/pho/stress2/misc/crossmp3.sh Sun Nov 2 14:28:20 2014 (r273972) @@ -33,6 +33,9 @@ # http://people.freebsd.org/~pho/stress/log/crossmp3.txt # Fixed in r269853 +# panic: softdep_waitidle: work added after flush: +# http://people.freebsd.org/~pho/stress/log/crossmp3-2.txt, fixed by r273967. + [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 . ../default.cfg From owner-svn-src-user@FreeBSD.ORG Thu Nov 6 20:53:24 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 462B978F; Thu, 6 Nov 2014 20:53:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32812849; Thu, 6 Nov 2014 20:53:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6KrOSQ066010; Thu, 6 Nov 2014 20:53:24 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA6KrOVa066009; Thu, 6 Nov 2014 20:53:24 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201411062053.sA6KrOVa066009@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Thu, 6 Nov 2014 20:53:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r274194 - user/dchagin/lemul/sys/amd64/linux X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 20:53:24 -0000 Author: dchagin Date: Thu Nov 6 20:53:23 2014 New Revision: 274194 URL: https://svnweb.freebsd.org/changeset/base/274194 Log: Fix bug in LINUX_SIGADSSET(). Modified: user/dchagin/lemul/sys/amd64/linux/linux.h Modified: user/dchagin/lemul/sys/amd64/linux/linux.h ============================================================================== --- user/dchagin/lemul/sys/amd64/linux/linux.h Thu Nov 6 20:23:57 2014 (r274193) +++ user/dchagin/lemul/sys/amd64/linux/linux.h Thu Nov 6 20:53:23 2014 (r274194) @@ -189,7 +189,7 @@ struct l_newstat { (1UL & ((set).__bits[0] >> _SIG_IDX(sig))) #define LINUX_SIGADDSET(set, sig) \ - (set).__bits[0] = 1UL << _SIG_IDX(sig) + (set).__bits[0] |= 1UL << _SIG_IDX(sig) /* sigaltstack */ #define LINUX_MINSIGSTKSZ 2048 From owner-svn-src-user@FreeBSD.ORG Thu Nov 6 20:56:30 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CEA49909; Thu, 6 Nov 2014 20:56:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB131883; Thu, 6 Nov 2014 20:56:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6KuUBV066456; Thu, 6 Nov 2014 20:56:30 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA6KuUwr066454; Thu, 6 Nov 2014 20:56:30 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201411062056.sA6KuUwr066454@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Thu, 6 Nov 2014 20:56:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r274195 - user/dchagin/lemul/sys/compat/linux X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 20:56:30 -0000 Author: dchagin Date: Thu Nov 6 20:56:29 2014 New Revision: 274195 URL: https://svnweb.freebsd.org/changeset/base/274195 Log: td_sigmask of a newly created thread copied from td. Remove excess initialization of td_sigmask. Modified: user/dchagin/lemul/sys/compat/linux/linux_fork.c Modified: user/dchagin/lemul/sys/compat/linux/linux_fork.c ============================================================================== --- user/dchagin/lemul/sys/compat/linux/linux_fork.c Thu Nov 6 20:53:23 2014 (r274194) +++ user/dchagin/lemul/sys/compat/linux/linux_fork.c Thu Nov 6 20:56:29 2014 (r274195) @@ -332,7 +332,6 @@ linux_clone_thread(struct thread *td, st PROC_LOCK(p); p->p_flag |= P_HADTHREADS; - newtd->td_sigmask = td->td_sigmask; bcopy(p->p_comm, newtd->td_name, sizeof(newtd->td_name)); if (args->flags & LINUX_CLONE_PARENT) From owner-svn-src-user@FreeBSD.ORG Thu Nov 6 21:49:41 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6D36D85C; Thu, 6 Nov 2014 21:49:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5519BEB5; Thu, 6 Nov 2014 21:49:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6LnfXM090240; Thu, 6 Nov 2014 21:49:41 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA6Lnbwq090221; Thu, 6 Nov 2014 21:49:37 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201411062149.sA6Lnbwq090221@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Thu, 6 Nov 2014 21:49:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r274196 - in user/dchagin/lemul: . bin/sh bin/sh/tests/expansion bin/sh/tests/parameters contrib/atf contrib/atf/atf-c contrib/atf/atf-c++ contrib/atf/atf-c++/detail contrib/atf/atf-c/d... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 21:49:41 -0000 Author: dchagin Date: Thu Nov 6 21:49:35 2014 New Revision: 274196 URL: https://svnweb.freebsd.org/changeset/base/274196 Log: MFH. + imp@ ${SYSDIR} changes in linux modules Makefiles. Added: user/dchagin/lemul/bin/sh/tests/expansion/redir1.0 - copied unchanged from r274195, head/bin/sh/tests/expansion/redir1.0 user/dchagin/lemul/bin/sh/tests/parameters/positional6.0 - copied unchanged from r274195, head/bin/sh/tests/parameters/positional6.0 user/dchagin/lemul/bin/sh/tests/parameters/positional7.0 - copied unchanged from r274195, head/bin/sh/tests/parameters/positional7.0 user/dchagin/lemul/contrib/atf/atf-c++/atf-c++.3 - copied unchanged from r274195, head/contrib/atf/atf-c++/atf-c++.3 user/dchagin/lemul/contrib/atf/atf-c/atf-c.3 - copied unchanged from r274195, head/contrib/atf/atf-c/atf-c.3 user/dchagin/lemul/contrib/atf/atf-sh/atf-sh.3 - copied unchanged from r274195, head/contrib/atf/atf-sh/atf-sh.3 user/dchagin/lemul/contrib/atf/config.h - copied unchanged from r274195, head/contrib/atf/config.h user/dchagin/lemul/contrib/atf/doc/atf.7.in - copied unchanged from r274195, head/contrib/atf/doc/atf.7.in user/dchagin/lemul/contrib/ofed/libcxgb4/ - copied from r274195, head/contrib/ofed/libcxgb4/ user/dchagin/lemul/contrib/ofed/librdmacm/examples/build/ - copied from r274195, head/contrib/ofed/librdmacm/examples/build/ user/dchagin/lemul/contrib/ofed/usr.lib/libcxgb4/ - copied from r274195, head/contrib/ofed/usr.lib/libcxgb4/ user/dchagin/lemul/etc/rc.d/growfs - copied unchanged from r274195, head/etc/rc.d/growfs user/dchagin/lemul/lib/libarchive/libarchive.pc - copied unchanged from r274195, head/lib/libarchive/libarchive.pc user/dchagin/lemul/lib/libc/Makefile.amd64 - copied unchanged from r274195, head/lib/libc/Makefile.amd64 user/dchagin/lemul/lib/libc/Makefile.i386 - copied unchanged from r274195, head/lib/libc/Makefile.i386 user/dchagin/lemul/lib/libc/tests/ - copied from r274195, head/lib/libc/tests/ user/dchagin/lemul/lib/libdpv/ - copied from r274195, head/lib/libdpv/ user/dchagin/lemul/lib/libfigpar/ - copied from r274195, head/lib/libfigpar/ user/dchagin/lemul/lib/libnetbsd/sys/time.h - copied unchanged from r274195, head/lib/libnetbsd/sys/time.h user/dchagin/lemul/lib/libpam/libpam/tests/ - copied from r274195, head/lib/libpam/libpam/tests/ user/dchagin/lemul/share/doc/pjdfstest/ - copied from r274195, head/share/doc/pjdfstest/ user/dchagin/lemul/share/man/man7/growfs.7 - copied unchanged from r274195, head/share/man/man7/growfs.7 user/dchagin/lemul/share/man/man9/casuword.9 - copied unchanged from r274195, head/share/man/man9/casuword.9 user/dchagin/lemul/share/mk/netbsd-tests.test.mk - copied unchanged from r274195, head/share/mk/netbsd-tests.test.mk user/dchagin/lemul/sys/boot/fdt/fdt_platform.h - copied unchanged from r274195, head/sys/boot/fdt/fdt_platform.h user/dchagin/lemul/sys/boot/uboot/fdt/ - copied from r274195, head/sys/boot/uboot/fdt/ user/dchagin/lemul/sys/compat/svr4/README - copied unchanged from r274195, head/sys/compat/svr4/README user/dchagin/lemul/sys/compat/svr4/TO-DO - copied unchanged from r274195, head/sys/compat/svr4/TO-DO user/dchagin/lemul/sys/dev/random/build.sh - copied unchanged from r274195, head/sys/dev/random/build.sh user/dchagin/lemul/sys/dev/random/fortuna.c - copied unchanged from r274195, head/sys/dev/random/fortuna.c user/dchagin/lemul/sys/dev/random/fortuna.h - copied unchanged from r274195, head/sys/dev/random/fortuna.h user/dchagin/lemul/sys/dev/random/uint128.h - copied unchanged from r274195, head/sys/dev/random/uint128.h user/dchagin/lemul/sys/dev/random/unit_test.c - copied unchanged from r274195, head/sys/dev/random/unit_test.c user/dchagin/lemul/sys/dev/random/unit_test.h - copied unchanged from r274195, head/sys/dev/random/unit_test.h user/dchagin/lemul/sys/modules/padlock_rng/ - copied from r274195, head/sys/modules/padlock_rng/ user/dchagin/lemul/sys/modules/rdrand_rng/ - copied from r274195, head/sys/modules/rdrand_rng/ user/dchagin/lemul/sys/x86/include/vmware.h - copied unchanged from r274195, head/sys/x86/include/vmware.h user/dchagin/lemul/tests/sys/pjdfstest/ - copied from r274195, head/tests/sys/pjdfstest/ user/dchagin/lemul/usr.bin/dpv/ - copied from r274195, head/usr.bin/dpv/ user/dchagin/lemul/usr.bin/timeout/tests/ - copied from r274195, head/usr.bin/timeout/tests/ Deleted: user/dchagin/lemul/contrib/atf/atf-c++/config.cpp user/dchagin/lemul/contrib/atf/atf-c++/config.hpp user/dchagin/lemul/contrib/atf/atf-c++/config_test.cpp user/dchagin/lemul/contrib/atf/atf-c++/detail/sanity_test.cpp user/dchagin/lemul/contrib/atf/atf-c/config.c user/dchagin/lemul/contrib/atf/atf-c/config.h user/dchagin/lemul/contrib/atf/atf-c/config_test.c user/dchagin/lemul/contrib/atf/bconfig.h user/dchagin/lemul/etc/rc.d/initrandom user/dchagin/lemul/etc/rc.d/postrandom user/dchagin/lemul/sys/dev/random/harvest.c user/dchagin/lemul/sys/dev/random/rwfile.c user/dchagin/lemul/sys/dev/random/rwfile.h user/dchagin/lemul/sys/modules/svr4/README user/dchagin/lemul/sys/modules/svr4/TO-DO user/dchagin/lemul/tests/lib/ Modified: user/dchagin/lemul/MAINTAINERS (contents, props changed) user/dchagin/lemul/ObsoleteFiles.inc user/dchagin/lemul/UPDATING user/dchagin/lemul/bin/sh/expand.c user/dchagin/lemul/bin/sh/tests/expansion/Makefile user/dchagin/lemul/bin/sh/tests/parameters/Makefile user/dchagin/lemul/contrib/atf/FREEBSD-Xlist user/dchagin/lemul/contrib/atf/NEWS user/dchagin/lemul/contrib/atf/atf-c++.hpp user/dchagin/lemul/contrib/atf/atf-c++/Kyuafile user/dchagin/lemul/contrib/atf/atf-c++/atf_c++_test.cpp user/dchagin/lemul/contrib/atf/atf-c++/build.cpp user/dchagin/lemul/contrib/atf/atf-c++/build.hpp user/dchagin/lemul/contrib/atf/atf-c++/build_test.cpp user/dchagin/lemul/contrib/atf/atf-c++/check.cpp user/dchagin/lemul/contrib/atf/atf-c++/check.hpp user/dchagin/lemul/contrib/atf/atf-c++/check_test.cpp user/dchagin/lemul/contrib/atf/atf-c++/detail/Kyuafile user/dchagin/lemul/contrib/atf/atf-c++/detail/application.cpp user/dchagin/lemul/contrib/atf/atf-c++/detail/application.hpp user/dchagin/lemul/contrib/atf/atf-c++/detail/application_test.cpp user/dchagin/lemul/contrib/atf/atf-c++/detail/auto_array.hpp user/dchagin/lemul/contrib/atf/atf-c++/detail/auto_array_test.cpp user/dchagin/lemul/contrib/atf/atf-c++/detail/env.cpp user/dchagin/lemul/contrib/atf/atf-c++/detail/env.hpp user/dchagin/lemul/contrib/atf/atf-c++/detail/env_test.cpp user/dchagin/lemul/contrib/atf/atf-c++/detail/exceptions.cpp user/dchagin/lemul/contrib/atf/atf-c++/detail/exceptions.hpp user/dchagin/lemul/contrib/atf/atf-c++/detail/exceptions_test.cpp user/dchagin/lemul/contrib/atf/atf-c++/detail/fs.cpp user/dchagin/lemul/contrib/atf/atf-c++/detail/fs.hpp user/dchagin/lemul/contrib/atf/atf-c++/detail/fs_test.cpp user/dchagin/lemul/contrib/atf/atf-c++/detail/process.cpp user/dchagin/lemul/contrib/atf/atf-c++/detail/process.hpp user/dchagin/lemul/contrib/atf/atf-c++/detail/process_test.cpp user/dchagin/lemul/contrib/atf/atf-c++/detail/sanity.hpp user/dchagin/lemul/contrib/atf/atf-c++/detail/test_helpers.cpp user/dchagin/lemul/contrib/atf/atf-c++/detail/test_helpers.hpp user/dchagin/lemul/contrib/atf/atf-c++/detail/text.cpp user/dchagin/lemul/contrib/atf/atf-c++/detail/text.hpp user/dchagin/lemul/contrib/atf/atf-c++/detail/text_test.cpp user/dchagin/lemul/contrib/atf/atf-c++/detail/version_helper.cpp user/dchagin/lemul/contrib/atf/atf-c++/macros.hpp user/dchagin/lemul/contrib/atf/atf-c++/macros_hpp_test.cpp user/dchagin/lemul/contrib/atf/atf-c++/macros_test.cpp user/dchagin/lemul/contrib/atf/atf-c++/pkg_config_test.sh user/dchagin/lemul/contrib/atf/atf-c++/tests.cpp user/dchagin/lemul/contrib/atf/atf-c++/tests.hpp user/dchagin/lemul/contrib/atf/atf-c++/tests_test.cpp user/dchagin/lemul/contrib/atf/atf-c++/unused_test.cpp user/dchagin/lemul/contrib/atf/atf-c++/utils.cpp user/dchagin/lemul/contrib/atf/atf-c++/utils.hpp user/dchagin/lemul/contrib/atf/atf-c++/utils_test.cpp user/dchagin/lemul/contrib/atf/atf-c.h user/dchagin/lemul/contrib/atf/atf-c/Kyuafile user/dchagin/lemul/contrib/atf/atf-c/atf_c_test.c user/dchagin/lemul/contrib/atf/atf-c/build.c user/dchagin/lemul/contrib/atf/atf-c/build.h user/dchagin/lemul/contrib/atf/atf-c/build_test.c user/dchagin/lemul/contrib/atf/atf-c/check.c user/dchagin/lemul/contrib/atf/atf-c/check.h user/dchagin/lemul/contrib/atf/atf-c/check_test.c user/dchagin/lemul/contrib/atf/atf-c/defs.h.in user/dchagin/lemul/contrib/atf/atf-c/detail/dynstr.c user/dchagin/lemul/contrib/atf/atf-c/detail/dynstr.h user/dchagin/lemul/contrib/atf/atf-c/detail/dynstr_test.c user/dchagin/lemul/contrib/atf/atf-c/detail/env.c user/dchagin/lemul/contrib/atf/atf-c/detail/env.h user/dchagin/lemul/contrib/atf/atf-c/detail/env_test.c user/dchagin/lemul/contrib/atf/atf-c/detail/fs.c user/dchagin/lemul/contrib/atf/atf-c/detail/fs.h user/dchagin/lemul/contrib/atf/atf-c/detail/fs_test.c user/dchagin/lemul/contrib/atf/atf-c/detail/list.c user/dchagin/lemul/contrib/atf/atf-c/detail/list.h user/dchagin/lemul/contrib/atf/atf-c/detail/list_test.c user/dchagin/lemul/contrib/atf/atf-c/detail/map.c user/dchagin/lemul/contrib/atf/atf-c/detail/map.h user/dchagin/lemul/contrib/atf/atf-c/detail/map_test.c user/dchagin/lemul/contrib/atf/atf-c/detail/process.c user/dchagin/lemul/contrib/atf/atf-c/detail/process.h user/dchagin/lemul/contrib/atf/atf-c/detail/process_helpers.c user/dchagin/lemul/contrib/atf/atf-c/detail/process_test.c user/dchagin/lemul/contrib/atf/atf-c/detail/sanity.c user/dchagin/lemul/contrib/atf/atf-c/detail/sanity.h user/dchagin/lemul/contrib/atf/atf-c/detail/sanity_test.c user/dchagin/lemul/contrib/atf/atf-c/detail/test_helpers.c user/dchagin/lemul/contrib/atf/atf-c/detail/test_helpers.h user/dchagin/lemul/contrib/atf/atf-c/detail/text.c user/dchagin/lemul/contrib/atf/atf-c/detail/text.h user/dchagin/lemul/contrib/atf/atf-c/detail/text_test.c user/dchagin/lemul/contrib/atf/atf-c/detail/tp_main.c user/dchagin/lemul/contrib/atf/atf-c/detail/user.c user/dchagin/lemul/contrib/atf/atf-c/detail/user.h user/dchagin/lemul/contrib/atf/atf-c/detail/user_test.c user/dchagin/lemul/contrib/atf/atf-c/detail/version_helper.c user/dchagin/lemul/contrib/atf/atf-c/error.c user/dchagin/lemul/contrib/atf/atf-c/error.h user/dchagin/lemul/contrib/atf/atf-c/error_fwd.h user/dchagin/lemul/contrib/atf/atf-c/error_test.c user/dchagin/lemul/contrib/atf/atf-c/h_build.h user/dchagin/lemul/contrib/atf/atf-c/macros.h user/dchagin/lemul/contrib/atf/atf-c/macros_h_test.c user/dchagin/lemul/contrib/atf/atf-c/macros_test.c user/dchagin/lemul/contrib/atf/atf-c/pkg_config_test.sh user/dchagin/lemul/contrib/atf/atf-c/tc.c user/dchagin/lemul/contrib/atf/atf-c/tc.h user/dchagin/lemul/contrib/atf/atf-c/tc_test.c user/dchagin/lemul/contrib/atf/atf-c/tp.c user/dchagin/lemul/contrib/atf/atf-c/tp.h user/dchagin/lemul/contrib/atf/atf-c/tp_test.c user/dchagin/lemul/contrib/atf/atf-c/unused_test.c user/dchagin/lemul/contrib/atf/atf-c/utils.c user/dchagin/lemul/contrib/atf/atf-c/utils.h user/dchagin/lemul/contrib/atf/atf-c/utils_test.c user/dchagin/lemul/contrib/atf/atf-sh/atf-check.1 user/dchagin/lemul/contrib/atf/atf-sh/atf-check.cpp user/dchagin/lemul/contrib/atf/atf-sh/atf-check_test.sh user/dchagin/lemul/contrib/atf/atf-sh/atf-sh.1 user/dchagin/lemul/contrib/atf/atf-sh/atf-sh.cpp user/dchagin/lemul/contrib/atf/atf-sh/atf_check_test.sh user/dchagin/lemul/contrib/atf/atf-sh/config_test.sh user/dchagin/lemul/contrib/atf/atf-sh/integration_test.sh user/dchagin/lemul/contrib/atf/atf-sh/libatf-sh.subr user/dchagin/lemul/contrib/atf/atf-sh/misc_helpers.sh user/dchagin/lemul/contrib/atf/atf-sh/normalize_test.sh user/dchagin/lemul/contrib/atf/atf-sh/tc_test.sh user/dchagin/lemul/contrib/atf/atf-sh/tp_test.sh user/dchagin/lemul/contrib/atf/doc/atf-test-case.4 user/dchagin/lemul/contrib/atf/doc/atf-test-program.1 user/dchagin/lemul/contrib/atf/test-programs/c_helpers.c user/dchagin/lemul/contrib/atf/test-programs/common.sh user/dchagin/lemul/contrib/atf/test-programs/config_test.sh user/dchagin/lemul/contrib/atf/test-programs/cpp_helpers.cpp user/dchagin/lemul/contrib/atf/test-programs/expect_test.sh user/dchagin/lemul/contrib/atf/test-programs/meta_data_test.sh user/dchagin/lemul/contrib/atf/test-programs/result_test.sh user/dchagin/lemul/contrib/atf/test-programs/sh_helpers.sh user/dchagin/lemul/contrib/atf/test-programs/srcdir_test.sh user/dchagin/lemul/contrib/mtree/create.c user/dchagin/lemul/contrib/mtree/extern.h user/dchagin/lemul/contrib/mtree/getid.c user/dchagin/lemul/contrib/mtree/mtree.c user/dchagin/lemul/contrib/mtree/spec.c user/dchagin/lemul/contrib/netbsd-tests/include/t_paths.c user/dchagin/lemul/contrib/netbsd-tests/lib/libc/db/t_db.sh user/dchagin/lemul/contrib/netbsd-tests/lib/libc/gen/t_floatunditf.c user/dchagin/lemul/contrib/netbsd-tests/lib/libc/gen/t_fpsetmask.c user/dchagin/lemul/contrib/netbsd-tests/lib/libc/gen/t_isnan.c user/dchagin/lemul/contrib/netbsd-tests/lib/libc/gen/t_sethostname.c user/dchagin/lemul/contrib/netbsd-tests/lib/libc/gen/t_siginfo.c user/dchagin/lemul/contrib/netbsd-tests/lib/libc/hash/h_hash.c user/dchagin/lemul/contrib/netbsd-tests/lib/libc/hash/t_sha2.c user/dchagin/lemul/contrib/netbsd-tests/lib/libc/inet/t_inet_network.c user/dchagin/lemul/contrib/netbsd-tests/lib/libc/locale/t_io.c user/dchagin/lemul/contrib/netbsd-tests/lib/libc/net/h_dns_server.c user/dchagin/lemul/contrib/netbsd-tests/lib/libc/net/t_ether_aton.c user/dchagin/lemul/contrib/netbsd-tests/lib/libc/net/t_servent.sh user/dchagin/lemul/contrib/netbsd-tests/lib/libc/rpc/t_rpc.c user/dchagin/lemul/contrib/netbsd-tests/lib/libc/ssp/h_memset.c user/dchagin/lemul/contrib/netbsd-tests/lib/libc/ssp/h_read.c user/dchagin/lemul/contrib/netbsd-tests/lib/libc/ssp/h_readlink.c user/dchagin/lemul/contrib/netbsd-tests/lib/libc/ssp/h_snprintf.c user/dchagin/lemul/contrib/netbsd-tests/lib/libc/ssp/t_ssp.sh user/dchagin/lemul/contrib/netbsd-tests/lib/libc/stdio/t_fflush.c user/dchagin/lemul/contrib/netbsd-tests/lib/libc/stdio/t_fmemopen.c user/dchagin/lemul/contrib/netbsd-tests/lib/libc/stdio/t_fopen.c user/dchagin/lemul/contrib/netbsd-tests/lib/libc/stdio/t_printf.c user/dchagin/lemul/contrib/netbsd-tests/lib/libc/stdio/t_scanf.c user/dchagin/lemul/contrib/netbsd-tests/lib/libc/stdlib/h_atexit.c user/dchagin/lemul/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c user/dchagin/lemul/contrib/netbsd-tests/lib/libc/sys/t_dup.c user/dchagin/lemul/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c user/dchagin/lemul/contrib/netbsd-tests/lib/libc/sys/t_getitimer.c user/dchagin/lemul/contrib/netbsd-tests/lib/libc/sys/t_kevent.c user/dchagin/lemul/contrib/netbsd-tests/lib/libc/sys/t_mincore.c user/dchagin/lemul/contrib/netbsd-tests/lib/libc/sys/t_sigaction.c user/dchagin/lemul/contrib/netbsd-tests/lib/libc/time/t_mktime.c user/dchagin/lemul/contrib/netbsd-tests/lib/libexecinfo/t_backtrace.c user/dchagin/lemul/contrib/netbsd-tests/lib/libm/t_ldexp.c user/dchagin/lemul/contrib/netbsd-tests/lib/libm/t_log.c user/dchagin/lemul/contrib/netbsd-tests/lib/libm/t_precision.c user/dchagin/lemul/contrib/netbsd-tests/lib/libpthread/t_mutex.c user/dchagin/lemul/contrib/netbsd-tests/lib/libpthread/t_sem.c user/dchagin/lemul/contrib/netbsd-tests/usr.sbin/mtree/t_mtree.sh user/dchagin/lemul/contrib/ofed/librdmacm/examples/rping.c user/dchagin/lemul/contrib/ofed/usr.lib/Makefile user/dchagin/lemul/contrib/ofed/usr.lib/Makefile.inc user/dchagin/lemul/contrib/openpam/t/t_openpam_ctype.c user/dchagin/lemul/contrib/openpam/t/t_openpam_readlinev.c user/dchagin/lemul/contrib/openpam/t/t_openpam_readword.c user/dchagin/lemul/contrib/tnftp/src/fetch.c user/dchagin/lemul/etc/defaults/rc.conf user/dchagin/lemul/etc/motd user/dchagin/lemul/etc/mtree/BSD.debug.dist user/dchagin/lemul/etc/mtree/BSD.tests.dist user/dchagin/lemul/etc/periodic/security/Makefile user/dchagin/lemul/etc/rc.d/Makefile user/dchagin/lemul/etc/rc.d/adjkerntz user/dchagin/lemul/etc/rc.d/geli user/dchagin/lemul/etc/rc.d/random user/dchagin/lemul/etc/rc.d/syscons user/dchagin/lemul/etc/rc.d/syslogd user/dchagin/lemul/lib/Makefile user/dchagin/lemul/lib/atf/Makefile.inc user/dchagin/lemul/lib/atf/common.mk user/dchagin/lemul/lib/atf/libatf-c++/Makefile user/dchagin/lemul/lib/atf/libatf-c++/tests/Makefile user/dchagin/lemul/lib/atf/libatf-c++/tests/detail/Makefile user/dchagin/lemul/lib/atf/libatf-c/Makefile user/dchagin/lemul/lib/atf/libatf-c/tests/Makefile user/dchagin/lemul/lib/atf/libatf-c/tests/detail/Makefile user/dchagin/lemul/lib/libarchive/Makefile user/dchagin/lemul/lib/libc/Makefile user/dchagin/lemul/lib/libc/posix1e/acl.3 user/dchagin/lemul/lib/libc/posix1e/acl_add_flag_np.3 user/dchagin/lemul/lib/libc/posix1e/acl_clear_flags_np.3 user/dchagin/lemul/lib/libc/posix1e/acl_delete_flag_np.3 user/dchagin/lemul/lib/libc/posix1e/acl_get_flag_np.3 user/dchagin/lemul/lib/libc/posix1e/acl_get_flagset_np.3 user/dchagin/lemul/lib/libc/posix1e/acl_set_entry_type_np.3 user/dchagin/lemul/lib/libc/posix1e/acl_set_flagset_np.3 user/dchagin/lemul/lib/libc/sys/utrace.2 user/dchagin/lemul/lib/libpam/libpam/Makefile user/dchagin/lemul/lib/libutil/gr_util.c user/dchagin/lemul/lib/libutil/login_class.c user/dchagin/lemul/libexec/atf/atf-check/Makefile user/dchagin/lemul/libexec/atf/atf-sh/Makefile user/dchagin/lemul/libexec/atf/atf-sh/tests/Makefile user/dchagin/lemul/libexec/save-entropy/save-entropy.sh user/dchagin/lemul/release/Makefile user/dchagin/lemul/release/doc/en_US.ISO8859-1/hardware/article.xml user/dchagin/lemul/sbin/fsck_msdosfs/boot.c user/dchagin/lemul/sbin/fsck_msdosfs/dosfs.h user/dchagin/lemul/sbin/fsirand/Makefile user/dchagin/lemul/sbin/mount_nfs/Makefile user/dchagin/lemul/sbin/mount_nfs/mount_nfs.8 user/dchagin/lemul/sbin/mount_nfs/mount_nfs.c user/dchagin/lemul/sbin/route/route.c user/dchagin/lemul/share/doc/Makefile user/dchagin/lemul/share/examples/kld/random_adaptor/random_adaptor_example.c user/dchagin/lemul/share/man/man4/tap.4 user/dchagin/lemul/share/man/man4/vt.4 user/dchagin/lemul/share/man/man7/Makefile user/dchagin/lemul/share/man/man9/Makefile user/dchagin/lemul/share/man/man9/domain.9 user/dchagin/lemul/share/man/man9/fetch.9 user/dchagin/lemul/share/man/man9/lock.9 user/dchagin/lemul/share/man/man9/store.9 user/dchagin/lemul/share/mk/atf.test.mk user/dchagin/lemul/share/mk/bsd.libnames.mk user/dchagin/lemul/share/mk/bsd.obj.mk user/dchagin/lemul/share/mk/bsd.progs.mk user/dchagin/lemul/share/mk/bsd.test.mk user/dchagin/lemul/share/mk/plain.test.mk user/dchagin/lemul/share/mk/tap.test.mk user/dchagin/lemul/sys/amd64/amd64/genassym.c user/dchagin/lemul/sys/amd64/amd64/support.S user/dchagin/lemul/sys/amd64/amd64/sys_machdep.c user/dchagin/lemul/sys/amd64/amd64/vm_machdep.c user/dchagin/lemul/sys/amd64/conf/GENERIC user/dchagin/lemul/sys/amd64/conf/NOTES user/dchagin/lemul/sys/amd64/ia32/ia32_syscall.c user/dchagin/lemul/sys/amd64/include/md_var.h user/dchagin/lemul/sys/amd64/vmm/amd/vmcb.c (contents, props changed) user/dchagin/lemul/sys/arm/allwinner/a10_gpio.c user/dchagin/lemul/sys/arm/arm/busdma_machdep-v6.c user/dchagin/lemul/sys/arm/arm/machdep.c user/dchagin/lemul/sys/arm/broadcom/bcm2835/bcm2835_gpio.c user/dchagin/lemul/sys/arm/freescale/imx/imx_gpio.c user/dchagin/lemul/sys/arm/freescale/vybrid/vf_gpio.c user/dchagin/lemul/sys/arm/include/param.h user/dchagin/lemul/sys/arm/lpc/lpc_gpio.c user/dchagin/lemul/sys/arm/rockchip/rk30xx_gpio.c user/dchagin/lemul/sys/arm/samsung/exynos/exynos5_pad.c user/dchagin/lemul/sys/arm/ti/ti_gpio.c user/dchagin/lemul/sys/arm/xilinx/zy7_gpio.c user/dchagin/lemul/sys/arm/xscale/ixp425/avila_gpio.c user/dchagin/lemul/sys/arm/xscale/ixp425/cambria_gpio.c user/dchagin/lemul/sys/boot/amd64/boot1.efi/boot1.c user/dchagin/lemul/sys/boot/arm/uboot/Makefile user/dchagin/lemul/sys/boot/common/install.c user/dchagin/lemul/sys/boot/common/misc.c user/dchagin/lemul/sys/boot/fdt/Makefile user/dchagin/lemul/sys/boot/fdt/fdt_loader_cmd.c user/dchagin/lemul/sys/boot/powerpc/uboot/Makefile user/dchagin/lemul/sys/boot/uboot/Makefile user/dchagin/lemul/sys/boot/uboot/common/metadata.c user/dchagin/lemul/sys/boot/uboot/lib/Makefile user/dchagin/lemul/sys/boot/uboot/lib/libuboot.h user/dchagin/lemul/sys/boot/uboot/lib/module.c user/dchagin/lemul/sys/cam/ctl/ctl.c user/dchagin/lemul/sys/cam/ctl/ctl.h user/dchagin/lemul/sys/cam/ctl/ctl_backend.h user/dchagin/lemul/sys/cam/ctl/ctl_backend_block.c user/dchagin/lemul/sys/cam/ctl/ctl_error.c user/dchagin/lemul/sys/cam/ctl/ctl_error.h user/dchagin/lemul/sys/cam/ctl/ctl_frontend_iscsi.c user/dchagin/lemul/sys/cam/ctl/ctl_private.h user/dchagin/lemul/sys/cam/ctl/scsi_ctl.c user/dchagin/lemul/sys/cam/scsi/scsi_all.c user/dchagin/lemul/sys/cam/scsi/scsi_all.h user/dchagin/lemul/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c user/dchagin/lemul/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c user/dchagin/lemul/sys/compat/freebsd32/freebsd32_misc.c user/dchagin/lemul/sys/conf/NOTES user/dchagin/lemul/sys/conf/files user/dchagin/lemul/sys/conf/files.amd64 user/dchagin/lemul/sys/conf/files.i386 user/dchagin/lemul/sys/conf/kmod.mk user/dchagin/lemul/sys/conf/options user/dchagin/lemul/sys/dev/acpi_support/acpi_ibm.c user/dchagin/lemul/sys/dev/acpica/acpi.c user/dchagin/lemul/sys/dev/agp/agp.c user/dchagin/lemul/sys/dev/agp/agp_amd.c user/dchagin/lemul/sys/dev/agp/agp_amd64.c user/dchagin/lemul/sys/dev/agp/agp_apple.c user/dchagin/lemul/sys/dev/agp/agp_ati.c user/dchagin/lemul/sys/dev/agp/agp_i810.c user/dchagin/lemul/sys/dev/agp/agppriv.h user/dchagin/lemul/sys/dev/agp/agpvar.h user/dchagin/lemul/sys/dev/ahci/ahci.c user/dchagin/lemul/sys/dev/asmc/asmc.c user/dchagin/lemul/sys/dev/cxgbe/tom/t4_cpl_io.c user/dchagin/lemul/sys/dev/drm2/drm_agpsupport.c user/dchagin/lemul/sys/dev/drm2/drm_edid.c user/dchagin/lemul/sys/dev/drm2/drm_fb_helper.c user/dchagin/lemul/sys/dev/drm2/drm_fb_helper.h user/dchagin/lemul/sys/dev/drm2/radeon/radeon.h user/dchagin/lemul/sys/dev/drm2/radeon/radeon_connectors.c user/dchagin/lemul/sys/dev/drm2/radeon/radeon_device.c user/dchagin/lemul/sys/dev/drm2/radeon/radeon_ttm.c user/dchagin/lemul/sys/dev/drm2/ttm/ttm_agp_backend.c user/dchagin/lemul/sys/dev/drm2/ttm/ttm_bo_driver.h user/dchagin/lemul/sys/dev/drm2/ttm/ttm_bo_util.c user/dchagin/lemul/sys/dev/drm2/ttm/ttm_page_alloc.c user/dchagin/lemul/sys/dev/glxsb/glxsb.c user/dchagin/lemul/sys/dev/gpio/gpiobus.c user/dchagin/lemul/sys/dev/gpio/gpiobus_if.m user/dchagin/lemul/sys/dev/gpio/gpiobusvar.h user/dchagin/lemul/sys/dev/gpio/gpioiic.c user/dchagin/lemul/sys/dev/gpio/gpioled.c user/dchagin/lemul/sys/dev/hwpmc/hwpmc_mod.c user/dchagin/lemul/sys/dev/ida/ida_eisa.c user/dchagin/lemul/sys/dev/iscsi/icl.c user/dchagin/lemul/sys/dev/iscsi/icl.h user/dchagin/lemul/sys/dev/iscsi/iscsi.c user/dchagin/lemul/sys/dev/random/dummy_rng.c user/dchagin/lemul/sys/dev/random/hash.c user/dchagin/lemul/sys/dev/random/hash.h user/dchagin/lemul/sys/dev/random/ivy.c user/dchagin/lemul/sys/dev/random/live_entropy_sources.c user/dchagin/lemul/sys/dev/random/live_entropy_sources.h user/dchagin/lemul/sys/dev/random/nehemiah.c user/dchagin/lemul/sys/dev/random/random_adaptors.c user/dchagin/lemul/sys/dev/random/random_adaptors.h user/dchagin/lemul/sys/dev/random/random_harvestq.c user/dchagin/lemul/sys/dev/random/random_harvestq.h user/dchagin/lemul/sys/dev/random/randomdev.c user/dchagin/lemul/sys/dev/random/randomdev.h user/dchagin/lemul/sys/dev/random/randomdev_soft.c user/dchagin/lemul/sys/dev/random/randomdev_soft.h user/dchagin/lemul/sys/dev/random/yarrow.c user/dchagin/lemul/sys/dev/random/yarrow.h user/dchagin/lemul/sys/dev/safe/safe.c user/dchagin/lemul/sys/dev/sound/isa/gusc.c user/dchagin/lemul/sys/dev/sound/isa/sb16.c user/dchagin/lemul/sys/dev/sound/isa/sbc.c user/dchagin/lemul/sys/dev/sound/midi/sequencer.c user/dchagin/lemul/sys/dev/sound/pci/als4000.c user/dchagin/lemul/sys/dev/sound/pci/cs4281.c user/dchagin/lemul/sys/dev/sound/pci/csa.c user/dchagin/lemul/sys/dev/sound/pci/emu10kx.c user/dchagin/lemul/sys/dev/sound/pci/envy24.c user/dchagin/lemul/sys/dev/sound/pci/envy24ht.c user/dchagin/lemul/sys/dev/sound/pci/maestro.c user/dchagin/lemul/sys/dev/sound/pci/spicds.c user/dchagin/lemul/sys/dev/sound/pci/vibes.c user/dchagin/lemul/sys/dev/sound/pcm/dsp.c user/dchagin/lemul/sys/dev/sound/pcm/mixer.c user/dchagin/lemul/sys/dev/sound/pcm/sound.c user/dchagin/lemul/sys/dev/sound/pcm/sound.h user/dchagin/lemul/sys/dev/usb/usb_hub.c user/dchagin/lemul/sys/dev/virtio/console/virtio_console.c user/dchagin/lemul/sys/dev/vt/vt.h user/dchagin/lemul/sys/dev/vt/vt_buf.c user/dchagin/lemul/sys/dev/vt/vt_core.c user/dchagin/lemul/sys/fs/devfs/devfs_vnops.c user/dchagin/lemul/sys/fs/nfsclient/nfs_clvfsops.c user/dchagin/lemul/sys/geom/geom_dev.c user/dchagin/lemul/sys/i386/conf/NOTES user/dchagin/lemul/sys/i386/i386/genassym.c user/dchagin/lemul/sys/i386/i386/initcpu.c user/dchagin/lemul/sys/i386/i386/locore.s user/dchagin/lemul/sys/i386/i386/machdep.c user/dchagin/lemul/sys/i386/i386/mp_machdep.c user/dchagin/lemul/sys/i386/i386/ptrace_machdep.c user/dchagin/lemul/sys/i386/i386/support.s user/dchagin/lemul/sys/i386/i386/sys_machdep.c user/dchagin/lemul/sys/i386/i386/trap.c user/dchagin/lemul/sys/i386/i386/vm86bios.s user/dchagin/lemul/sys/i386/i386/vm_machdep.c user/dchagin/lemul/sys/i386/include/cpufunc.h user/dchagin/lemul/sys/i386/include/md_var.h user/dchagin/lemul/sys/i386/include/npx.h user/dchagin/lemul/sys/i386/include/pcb.h user/dchagin/lemul/sys/i386/isa/npx.c user/dchagin/lemul/sys/i386/linux/linux_ptrace.c user/dchagin/lemul/sys/i386/linux/linux_sysvec.c user/dchagin/lemul/sys/i386/svr4/svr4_machdep.c user/dchagin/lemul/sys/i386/xen/mp_machdep.c user/dchagin/lemul/sys/kern/init_main.c user/dchagin/lemul/sys/kern/kern_cons.c user/dchagin/lemul/sys/kern/kern_descrip.c user/dchagin/lemul/sys/kern/kern_exec.c user/dchagin/lemul/sys/kern/kern_ffclock.c user/dchagin/lemul/sys/kern/kern_intr.c user/dchagin/lemul/sys/kern/kern_lock.c user/dchagin/lemul/sys/kern/kern_mutex.c user/dchagin/lemul/sys/kern/kern_prot.c user/dchagin/lemul/sys/kern/kern_rwlock.c user/dchagin/lemul/sys/kern/kern_sx.c user/dchagin/lemul/sys/kern/kern_syscalls.c user/dchagin/lemul/sys/kern/kern_thr.c user/dchagin/lemul/sys/kern/kern_umtx.c user/dchagin/lemul/sys/kern/subr_bus.c user/dchagin/lemul/sys/kern/subr_param.c user/dchagin/lemul/sys/kern/subr_terminal.c user/dchagin/lemul/sys/kern/subr_uio.c user/dchagin/lemul/sys/kern/sys_generic.c user/dchagin/lemul/sys/kern/sys_pipe.c user/dchagin/lemul/sys/kern/uipc_debug.c user/dchagin/lemul/sys/kern/vfs_acl.c user/dchagin/lemul/sys/kern/vfs_export.c user/dchagin/lemul/sys/kern/vfs_lookup.c user/dchagin/lemul/sys/mips/atheros/ar71xx_gpio.c user/dchagin/lemul/sys/mips/cavium/octeon_gpio.c user/dchagin/lemul/sys/mips/conf/PICOSTATION_M2HP.hints user/dchagin/lemul/sys/mips/include/param.h user/dchagin/lemul/sys/mips/rt305x/rt305x_gpio.c user/dchagin/lemul/sys/modules/Makefile user/dchagin/lemul/sys/modules/drm2/drm2/Makefile user/dchagin/lemul/sys/modules/linux/Makefile user/dchagin/lemul/sys/modules/linux64/Makefile user/dchagin/lemul/sys/modules/mrsas/Makefile user/dchagin/lemul/sys/modules/random/Makefile user/dchagin/lemul/sys/modules/sound/sound/Makefile user/dchagin/lemul/sys/modules/svr4/Makefile user/dchagin/lemul/sys/modules/vmm/Makefile user/dchagin/lemul/sys/net/bpf.c user/dchagin/lemul/sys/net/if.c user/dchagin/lemul/sys/net/if_disc.c user/dchagin/lemul/sys/net/if_ethersubr.c user/dchagin/lemul/sys/net/if_faith.c user/dchagin/lemul/sys/net/if_loop.c user/dchagin/lemul/sys/net/if_spppsubr.c user/dchagin/lemul/sys/net/if_stf.c user/dchagin/lemul/sys/net/if_tun.c user/dchagin/lemul/sys/net/if_var.h user/dchagin/lemul/sys/net/route.c user/dchagin/lemul/sys/netgraph/ng_bridge.c user/dchagin/lemul/sys/netgraph/ng_frame_relay.c user/dchagin/lemul/sys/netgraph/ng_iface.c user/dchagin/lemul/sys/netinet/cc/cc.c user/dchagin/lemul/sys/netinet/in_gif.c user/dchagin/lemul/sys/netinet/in_proto.c user/dchagin/lemul/sys/netinet/in_rmx.c user/dchagin/lemul/sys/netinet/sctp_sysctl.c user/dchagin/lemul/sys/netinet/siftr.c user/dchagin/lemul/sys/netinet/tcp_syncache.c user/dchagin/lemul/sys/netinet/tcp_timer.c user/dchagin/lemul/sys/netinet/tcp_timer.h user/dchagin/lemul/sys/netinet/tcp_timewait.c user/dchagin/lemul/sys/netinet/tcp_usrreq.c user/dchagin/lemul/sys/netinet/tcp_var.h user/dchagin/lemul/sys/netinet6/in6.c user/dchagin/lemul/sys/netinet6/in6_ifattach.c user/dchagin/lemul/sys/netinet6/in6_mcast.c user/dchagin/lemul/sys/netinet6/in6_proto.c user/dchagin/lemul/sys/netinet6/in6_rmx.c user/dchagin/lemul/sys/netinet6/in6_var.h user/dchagin/lemul/sys/netinet6/nd6.c user/dchagin/lemul/sys/netipsec/ipsec_input.c user/dchagin/lemul/sys/netipsec/key.c user/dchagin/lemul/sys/netpfil/ipfw/ip_fw_table.c user/dchagin/lemul/sys/ofed/drivers/net/mlx4/mcg.c user/dchagin/lemul/sys/powerpc/powerpc/copyinout.c user/dchagin/lemul/sys/powerpc/wii/wii_gpio.c user/dchagin/lemul/sys/sparc64/include/param.h user/dchagin/lemul/sys/sys/buf_ring.h user/dchagin/lemul/sys/sys/disk.h user/dchagin/lemul/sys/sys/domain.h user/dchagin/lemul/sys/sys/filedesc.h user/dchagin/lemul/sys/sys/lockmgr.h user/dchagin/lemul/sys/sys/param.h user/dchagin/lemul/sys/sys/random.h user/dchagin/lemul/sys/sys/seq.h user/dchagin/lemul/sys/sys/sysctl.h user/dchagin/lemul/sys/sys/sysent.h user/dchagin/lemul/sys/sys/systm.h user/dchagin/lemul/sys/sys/terminal.h user/dchagin/lemul/sys/sys/ucred.h user/dchagin/lemul/sys/sys/user.h user/dchagin/lemul/sys/ufs/ffs/ffs_softdep.c user/dchagin/lemul/sys/vm/default_pager.c user/dchagin/lemul/sys/vm/swap_pager.c user/dchagin/lemul/sys/vm/uma_core.c user/dchagin/lemul/sys/vm/vm_page.c user/dchagin/lemul/sys/x86/acpica/acpi_wakeup.c user/dchagin/lemul/sys/x86/x86/identcpu.c user/dchagin/lemul/sys/x86/x86/tsc.c user/dchagin/lemul/tests/sys/Makefile user/dchagin/lemul/tools/build/mk/OptionalObsoleteFiles.inc user/dchagin/lemul/tools/sched/schedgraph.py user/dchagin/lemul/usr.bin/Makefile user/dchagin/lemul/usr.bin/ftp/Makefile user/dchagin/lemul/usr.bin/hexdump/hexdump.1 user/dchagin/lemul/usr.bin/iconv/Makefile user/dchagin/lemul/usr.bin/id/Makefile user/dchagin/lemul/usr.bin/iscsictl/token.l user/dchagin/lemul/usr.bin/timeout/Makefile user/dchagin/lemul/usr.bin/timeout/timeout.1 user/dchagin/lemul/usr.bin/timeout/timeout.c user/dchagin/lemul/usr.bin/top/machine.c user/dchagin/lemul/usr.bin/w/Makefile user/dchagin/lemul/usr.bin/w/pr_time.c user/dchagin/lemul/usr.bin/w/w.1 user/dchagin/lemul/usr.bin/w/w.c user/dchagin/lemul/usr.bin/wc/Makefile user/dchagin/lemul/usr.bin/wc/wc.1 user/dchagin/lemul/usr.bin/wc/wc.c user/dchagin/lemul/usr.sbin/bhyve/block_if.c user/dchagin/lemul/usr.sbin/bhyve/pci_ahci.c user/dchagin/lemul/usr.sbin/bsdconfig/Makefile user/dchagin/lemul/usr.sbin/bsdconfig/console/Makefile user/dchagin/lemul/usr.sbin/bsdconfig/console/include/Makefile user/dchagin/lemul/usr.sbin/bsdconfig/diskmgmt/Makefile user/dchagin/lemul/usr.sbin/bsdconfig/diskmgmt/include/Makefile user/dchagin/lemul/usr.sbin/bsdconfig/docsinstall/Makefile user/dchagin/lemul/usr.sbin/bsdconfig/docsinstall/include/Makefile user/dchagin/lemul/usr.sbin/bsdconfig/dot/Makefile user/dchagin/lemul/usr.sbin/bsdconfig/dot/include/Makefile user/dchagin/lemul/usr.sbin/bsdconfig/examples/Makefile user/dchagin/lemul/usr.sbin/bsdconfig/include/Makefile user/dchagin/lemul/usr.sbin/bsdconfig/includes/Makefile user/dchagin/lemul/usr.sbin/bsdconfig/includes/include/Makefile user/dchagin/lemul/usr.sbin/bsdconfig/mouse/Makefile user/dchagin/lemul/usr.sbin/bsdconfig/mouse/include/Makefile user/dchagin/lemul/usr.sbin/bsdconfig/networking/Makefile user/dchagin/lemul/usr.sbin/bsdconfig/networking/include/Makefile user/dchagin/lemul/usr.sbin/bsdconfig/networking/share/Makefile user/dchagin/lemul/usr.sbin/bsdconfig/packages/Makefile user/dchagin/lemul/usr.sbin/bsdconfig/packages/include/Makefile user/dchagin/lemul/usr.sbin/bsdconfig/password/Makefile user/dchagin/lemul/usr.sbin/bsdconfig/password/include/Makefile user/dchagin/lemul/usr.sbin/bsdconfig/password/share/Makefile user/dchagin/lemul/usr.sbin/bsdconfig/security/Makefile user/dchagin/lemul/usr.sbin/bsdconfig/security/include/Makefile user/dchagin/lemul/usr.sbin/bsdconfig/share/Makefile user/dchagin/lemul/usr.sbin/bsdconfig/share/media/Makefile user/dchagin/lemul/usr.sbin/bsdconfig/share/packages/Makefile user/dchagin/lemul/usr.sbin/bsdconfig/startup/Makefile user/dchagin/lemul/usr.sbin/bsdconfig/startup/include/Makefile user/dchagin/lemul/usr.sbin/bsdconfig/startup/share/Makefile user/dchagin/lemul/usr.sbin/bsdconfig/timezone/Makefile user/dchagin/lemul/usr.sbin/bsdconfig/timezone/include/Makefile user/dchagin/lemul/usr.sbin/bsdconfig/timezone/share/Makefile user/dchagin/lemul/usr.sbin/bsdconfig/ttys/Makefile user/dchagin/lemul/usr.sbin/bsdconfig/ttys/include/Makefile user/dchagin/lemul/usr.sbin/bsdconfig/usermgmt/Makefile user/dchagin/lemul/usr.sbin/bsdconfig/usermgmt/include/Makefile user/dchagin/lemul/usr.sbin/bsdconfig/usermgmt/share/Makefile user/dchagin/lemul/usr.sbin/bsdinstall/bsdinstall.8 user/dchagin/lemul/usr.sbin/ctladm/ctladm.8 user/dchagin/lemul/usr.sbin/ctld/ctl.conf.5 user/dchagin/lemul/usr.sbin/ctld/ctld.c user/dchagin/lemul/usr.sbin/ctld/ctld.h user/dchagin/lemul/usr.sbin/ctld/discovery.c user/dchagin/lemul/usr.sbin/ctld/login.c user/dchagin/lemul/usr.sbin/ctld/parse.y user/dchagin/lemul/usr.sbin/ctld/token.l user/dchagin/lemul/usr.sbin/etcupdate/etcupdate.8 user/dchagin/lemul/usr.sbin/fifolog/fifolog_reader/Makefile user/dchagin/lemul/usr.sbin/fifolog/fifolog_writer/Makefile user/dchagin/lemul/usr.sbin/iscsid/Makefile user/dchagin/lemul/usr.sbin/pkg/Makefile user/dchagin/lemul/usr.sbin/pw/pw_group.c user/dchagin/lemul/usr.sbin/pw/pw_user.c user/dchagin/lemul/usr.sbin/pw/tests/Makefile user/dchagin/lemul/usr.sbin/pw/tests/pw_delete.sh user/dchagin/lemul/usr.sbin/pw/tests/pw_modify.sh user/dchagin/lemul/usr.sbin/rpcbind/Makefile user/dchagin/lemul/usr.sbin/sysrc/sysrc user/dchagin/lemul/usr.sbin/sysrc/sysrc.8 Directory Properties: user/dchagin/lemul/ (props changed) user/dchagin/lemul/contrib/atf/ (props changed) user/dchagin/lemul/contrib/mtree/ (props changed) user/dchagin/lemul/contrib/openpam/ (props changed) user/dchagin/lemul/contrib/tnftp/ (props changed) user/dchagin/lemul/etc/ (props changed) user/dchagin/lemul/lib/libc/ (props changed) user/dchagin/lemul/lib/libutil/ (props changed) user/dchagin/lemul/sbin/ (props changed) user/dchagin/lemul/share/ (props changed) user/dchagin/lemul/share/man/man4/ (props changed) user/dchagin/lemul/sys/ (props changed) user/dchagin/lemul/sys/amd64/vmm/ (props changed) user/dchagin/lemul/sys/boot/ (props changed) user/dchagin/lemul/sys/cddl/contrib/opensolaris/ (props changed) user/dchagin/lemul/sys/conf/ (props changed) user/dchagin/lemul/sys/modules/vmm/ (props changed) user/dchagin/lemul/usr.sbin/bhyve/ (props changed) Modified: user/dchagin/lemul/MAINTAINERS ============================================================================== --- user/dchagin/lemul/MAINTAINERS Thu Nov 6 20:56:29 2014 (r274195) +++ user/dchagin/lemul/MAINTAINERS Thu Nov 6 21:49:35 2014 (r274196) @@ -78,7 +78,6 @@ inetd dwmalone Recommends pre-commit re contrib/smbfs bp Open for in-tree committs. In case of functional changes pre-commit review requested. contrib/pf glebius Pre-commit review recommended. -binutils obrien Insists on BU blocked from unapproved commits file obrien Insists to keep file blocked from other's unapproved commits contrib/bzip2 obrien Pre-commit review required. Modified: user/dchagin/lemul/ObsoleteFiles.inc ============================================================================== --- user/dchagin/lemul/ObsoleteFiles.inc Thu Nov 6 20:56:29 2014 (r274195) +++ user/dchagin/lemul/ObsoleteFiles.inc Thu Nov 6 21:49:35 2014 (r274196) @@ -38,6 +38,15 @@ # xargs -n1 | sort | uniq -d; # done +# 20141102: postrandom obsoleted by new /dev/random code +OLD_FILES+=etc/rc.d/postrandom +# 20141031: initrandom obsoleted by new /dev/random code +OLD_FILES+=etc/rc.d/initrandom +# 20141028: debug files accidentally installed as directory name +OLD_FILES+=usr/lib/debug/usr/lib/i18n +OLD_FILES+=usr/lib/debug/usr/lib/private +OLD_FILES+=usr/lib/debug/usr/lib32/i18n +OLD_FILES+=usr/lib/debug/usr/lib32/private # 20141015: OpenSSL 1.0.1j import OLD_FILES+=usr/share/openssl/man/man3/CMS_sign_add1_signer.3.gz # 20140922: sleepq_calc_signal_retval.9 and sleepq_catch_signals.9 removed @@ -46,7 +55,6 @@ OLD_FILES+=usr/share/man/man9/sleepq_cat # 20140917: hv_kvpd rc.d script removed in favor of devd configuration OLD_FILES+=etc/rc.d/hv_kvpd # 20140917: libnv was accidentally being installed to /usr/lib instead of /lib -OLD_LIBS+=usr/lib/libnv.a OLD_LIBS+=usr/lib/libnv.so.0 # 20140829: rc.d/kerberos removed OLD_FILES+=etc/rc.d/kerberos @@ -368,7 +376,6 @@ OLD_FILES+=usr/share/man/man1/atf-report OLD_FILES+=usr/share/man/man1/atf-run.1.gz OLD_FILES+=usr/share/man/man1/atf-version.1.gz OLD_FILES+=usr/share/man/man5/atf-formats.5.gz -OLD_FILES+=usr/share/man/man7/atf.7.gz OLD_FILES+=usr/share/xml/atf/tests-results.dtd OLD_FILES+=usr/share/xsl/atf/tests-results.xsl # 20131009: freebsd-version moved from /libexec to /bin Modified: user/dchagin/lemul/UPDATING ============================================================================== --- user/dchagin/lemul/UPDATING Thu Nov 6 20:56:29 2014 (r274195) +++ user/dchagin/lemul/UPDATING Thu Nov 6 21:49:35 2014 (r274196) @@ -31,6 +31,29 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20141104: + vt(4), the new console driver, is enabled by default. It brings + support for Unicode and double-width characters, as well as + support for UEFI and integration with the KMS kernel video + drivers. + + You may need to update your console settings in /etc/rc.conf, + most probably the keymap. During boot, /etc/rc.d/syscons will + indicate what you need to do. + + vt(4) still has issues and lacks some features compared to + syscons(4). See the wiki for up-to-date information: + https://wiki.freebsd.org/Newcons + + If you want to keep using syscons(4), you can do so by adding + the following line to /boot/loader.conf: + kern.vty=sc + +20141102: + pjdfstest has been integrated into kyua as an opt-in test suite. + Please see share/doc/pjdfstest/README for a more details on how to + execute it. + 20141009: gperf has been removed from the base system for architectures that use clang. Ports that require gperf will obtain it from the Modified: user/dchagin/lemul/bin/sh/expand.c ============================================================================== --- user/dchagin/lemul/bin/sh/expand.c Thu Nov 6 20:56:29 2014 (r274195) +++ user/dchagin/lemul/bin/sh/expand.c Thu Nov 6 21:49:35 2014 (r274196) @@ -862,7 +862,7 @@ varisset(const char *name, int nulok) static void strtodest(const char *p, int flag, int subtype, int quoted) { - if (flag & (EXP_FULL | EXP_CASE) && subtype != VSLENGTH) + if (flag & (EXP_FULL | EXP_CASE | EXP_REDIR) && subtype != VSLENGTH) STPUTS_QUOTES(p, quoted ? DQSYNTAX : BASESYNTAX, expdest); else STPUTS(p, expdest); @@ -878,7 +878,7 @@ varvalue(const char *name, int quoted, i int num; char *p; int i; - char sep; + char sep[2]; char **ap; switch (*name) { @@ -912,15 +912,18 @@ varvalue(const char *name, int quoted, i /* FALLTHROUGH */ case '*': if (ifsset()) - sep = ifsval()[0]; + sep[0] = ifsval()[0]; else - sep = ' '; + sep[0] = ' '; + sep[1] = '\0'; for (ap = shellparam.p ; (p = *ap++) != NULL ; ) { strtodest(p, flag, subtype, quoted); if (!*ap) break; - if (sep || (flag & EXP_FULL && !quoted && **ap != '\0')) - STPUTC(sep, expdest); + if (sep[0]) + strtodest(sep, flag, subtype, quoted); + else if (flag & EXP_FULL && !quoted && **ap != '\0') + STPUTC('\0', expdest); } return; default: Modified: user/dchagin/lemul/bin/sh/tests/expansion/Makefile ============================================================================== --- user/dchagin/lemul/bin/sh/tests/expansion/Makefile Thu Nov 6 20:56:29 2014 (r274195) +++ user/dchagin/lemul/bin/sh/tests/expansion/Makefile Thu Nov 6 21:49:35 2014 (r274196) @@ -72,6 +72,7 @@ FILES+= plus-minus7.0 FILES+= plus-minus8.0 FILES+= question1.0 FILES+= readonly1.0 +FILES+= redir1.0 FILES+= set-u1.0 FILES+= set-u2.0 FILES+= set-u3.0 Copied: user/dchagin/lemul/bin/sh/tests/expansion/redir1.0 (from r274195, head/bin/sh/tests/expansion/redir1.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/dchagin/lemul/bin/sh/tests/expansion/redir1.0 Thu Nov 6 21:49:35 2014 (r274196, copy of r274195, head/bin/sh/tests/expansion/redir1.0) @@ -0,0 +1,26 @@ +# $FreeBSD$ + +bad=0 +for i in 0 1 2 3; do + for j in 0 1 2 3 4 5 6 7; do + for k in 0 1 2 3 4 5 6 7; do + case $i$j$k in + 000) continue ;; + esac + set -- "$(printf \\$i$j$k@)" + set -- "${1%@}" + ff= + for f in /dev/null /dev/zero /; do + if [ -e "$f" ] && [ ! -e "$f$1" ]; then + ff=$f + fi + done + [ -n "$ff" ] || continue + if { true <$ff$1; } 2>/dev/null; then + echo "Bad: $i$j$k ($ff)" >&2 + : $((bad += 1)) + fi + done + done +done +exit $((bad ? 2 : 0)) Modified: user/dchagin/lemul/bin/sh/tests/parameters/Makefile ============================================================================== --- user/dchagin/lemul/bin/sh/tests/parameters/Makefile Thu Nov 6 20:56:29 2014 (r274195) +++ user/dchagin/lemul/bin/sh/tests/parameters/Makefile Thu Nov 6 21:49:35 2014 (r274196) @@ -18,6 +18,8 @@ FILES+= positional2.0 FILES+= positional3.0 FILES+= positional4.0 FILES+= positional5.0 +FILES+= positional6.0 +FILES+= positional7.0 FILES+= pwd1.0 FILES+= pwd2.0 Copied: user/dchagin/lemul/bin/sh/tests/parameters/positional6.0 (from r274195, head/bin/sh/tests/parameters/positional6.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/dchagin/lemul/bin/sh/tests/parameters/positional6.0 Thu Nov 6 21:49:35 2014 (r274196, copy of r274195, head/bin/sh/tests/parameters/positional6.0) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +IFS=? +set p r +v=pqrs +r=${v#"$*"} +[ "$r" = pqrs ] Copied: user/dchagin/lemul/bin/sh/tests/parameters/positional7.0 (from r274195, head/bin/sh/tests/parameters/positional7.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/dchagin/lemul/bin/sh/tests/parameters/positional7.0 Thu Nov 6 21:49:35 2014 (r274196, copy of r274195, head/bin/sh/tests/parameters/positional7.0) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +set -- / '' +IFS=* +set -- "$*" +IFS=: +args="$*" +[ "$#:$args" = "1:/*" ] Modified: user/dchagin/lemul/contrib/atf/FREEBSD-Xlist ============================================================================== --- user/dchagin/lemul/contrib/atf/FREEBSD-Xlist Thu Nov 6 20:56:29 2014 (r274195) +++ user/dchagin/lemul/contrib/atf/FREEBSD-Xlist Thu Nov 6 21:49:35 2014 (r274196) @@ -1,22 +1,12 @@ -*/*/Atffile */*/Makefile* -*/Atffile */Makefile* */*.m4 */*.pc.in -Atffile INSTALL Makefile* aclocal.m4 admin/ -atf-config/ -atf-report/ -atf-run/ -atf-version/ -bconfig.h.in +config.h.in bootstrap/ configure* -doc/atf-formats.5 -doc/atf.7.in m4/ -tools/ Modified: user/dchagin/lemul/contrib/atf/NEWS ============================================================================== --- user/dchagin/lemul/contrib/atf/NEWS Thu Nov 6 20:56:29 2014 (r274195) +++ user/dchagin/lemul/contrib/atf/NEWS Thu Nov 6 21:49:35 2014 (r274196) @@ -1,6 +1,62 @@ Major changes between releases Automated Testing Framework =========================================================================== +Changes in version 0.21 +*********************** + +Released on October 23rd, 2014. + +* Restored the atf(7) manual page to serve as a reference to all the other + manual pages shipped by ATF. + +* Added the -s flag to atf-sh to support specifying the shell interpreter + to be used. + +* Removed ATF_WORKDIR. The only remaining consumers have been converted to + use the standard TMPDIR environment variable. As a benefit, and because + Kyua forces the TMPDIR to live within the test case's work directory, + any stale files left behind by ATF will be automatically cleaned up. + +* Documented the environment variables recognized by each component in the + relevant manual pages. This information was lost with the atf-config(1) + removal. + +* Added a new "require.diskspace" metadata property to test cases so that + they can specify the minimum amount of disk space required for the test + to run. + +* Renamed the atf-{c,c++,sh}-api(3) manual pages to atf-{c,c++,sh}(3) for + discoverability purposes. Symbolic links are provided for the time + being to still make the old names visible. + +* Issue #5: Recommend the (expected, actual) idiom for calls to the test + macros in the manual pages. + +* Issue #7: Stopped catching unhandled exceptions in atf-c++ tests. This + propagates the crash to the caller, which in turn allows it to obtain + proper debugging information. In particular, Kyua should now be able to + extract a stacktrace pinpointing the problem. + +* Issue #8: Fixed atf-c/macros_test:use test failures spotted by the clang + that ships with FreeBSD 11.0-CURRENT. + +* Issue #12: Improved documentation of atf-sh(3) and atf-check(1) by better + explaining how they relate to each other. + +* Issue #14: Stopped setting 'set -e' in atf-sh. This setting was + initially added as a way to enable a "strict" mode in the library and to + make test cases fail fast when they run unprotected commands. However, + doing so in the library is surprising as the responsibility of enabling + 'set -e' should be on the user's code. Also, 'set -e' introduces + inconsistent behavior on subshells and users do not expect that. + +* Issue #15: Fixed atf_utils_{fork,wait} to support nested calls. + +* Issue #16: Fixed test failures (by removing a long-standing hack) on + systems that lack \e support in printf(1). + +* Issue #19: Removed stale references to atf-config and atf-run. + Changes in version 0.20 *********************** Modified: user/dchagin/lemul/contrib/atf/atf-c++.hpp ============================================================================== --- user/dchagin/lemul/contrib/atf/atf-c++.hpp Thu Nov 6 20:56:29 2014 (r274195) +++ user/dchagin/lemul/contrib/atf/atf-c++.hpp Thu Nov 6 21:49:35 2014 (r274196) @@ -1,6 +1,3 @@ -// -// Automated Testing Framework (atf) -// // Copyright (c) 2007 The NetBSD Foundation, Inc. // All rights reserved. // @@ -25,12 +22,11 @@ // IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN // IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -#if !defined(_ATF_CXX_HPP_) -#define _ATF_CXX_HPP_ +#if !defined(ATF_CXX_HPP) +#define ATF_CXX_HPP #include #include -#endif // !defined(_ATF_CXX_HPP_) +#endif // !defined(ATF_CXX_HPP) Modified: user/dchagin/lemul/contrib/atf/atf-c++/Kyuafile ============================================================================== --- user/dchagin/lemul/contrib/atf/atf-c++/Kyuafile Thu Nov 6 20:56:29 2014 (r274195) +++ user/dchagin/lemul/contrib/atf/atf-c++/Kyuafile Thu Nov 6 21:49:35 2014 (r274196) @@ -5,7 +5,6 @@ test_suite("atf") atf_test_program{name="atf_c++_test"} atf_test_program{name="build_test"} atf_test_program{name="check_test"} -atf_test_program{name="config_test"} atf_test_program{name="macros_test"} atf_test_program{name="pkg_config_test"} atf_test_program{name="tests_test"} Copied: user/dchagin/lemul/contrib/atf/atf-c++/atf-c++.3 (from r274195, head/contrib/atf/atf-c++/atf-c++.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/dchagin/lemul/contrib/atf/atf-c++/atf-c++.3 Thu Nov 6 21:49:35 2014 (r274196, copy of r274195, head/contrib/atf/atf-c++/atf-c++.3) @@ -0,0 +1,649 @@ +.\" Copyright (c) 2008 The NetBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND +.\" CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, +.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY +.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +.\" GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +.\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +.\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.Dd October 13, 2014 +.Dt ATF-C++ 3 +.Os +.Sh NAME +.Nm atf-c++ , +.Nm ATF_ADD_TEST_CASE , +.Nm ATF_CHECK_ERRNO , +.Nm ATF_FAIL , +.Nm ATF_INIT_TEST_CASES , +.Nm ATF_PASS , +.Nm ATF_REQUIRE , +.Nm ATF_REQUIRE_EQ , +.Nm ATF_REQUIRE_ERRNO , +.Nm ATF_REQUIRE_IN , +.Nm ATF_REQUIRE_MATCH , +.Nm ATF_REQUIRE_NOT_IN , +.Nm ATF_REQUIRE_THROW , +.Nm ATF_REQUIRE_THROW_RE , +.Nm ATF_SKIP , +.Nm ATF_TEST_CASE , +.Nm ATF_TEST_CASE_BODY , +.Nm ATF_TEST_CASE_CLEANUP , +.Nm ATF_TEST_CASE_HEAD , +.Nm ATF_TEST_CASE_NAME , +.Nm ATF_TEST_CASE_USE , +.Nm ATF_TEST_CASE_WITH_CLEANUP , +.Nm ATF_TEST_CASE_WITHOUT_HEAD , +.Nm atf::utils::cat_file , +.Nm atf::utils::compare_file , +.Nm atf::utils::copy_file , +.Nm atf::utils::create_file , +.Nm atf::utils::file_exists , +.Nm atf::utils::fork , +.Nm atf::utils::grep_collection , +.Nm atf::utils::grep_file , +.Nm atf::utils::grep_string , +.Nm atf::utils::redirect , +.Nm atf::utils::wait +.Nd C++ API to write ATF-based test programs +.Sh SYNOPSIS +.In atf-c++.hpp +.Fn ATF_ADD_TEST_CASE "tcs" "name" +.Fn ATF_CHECK_ERRNO "expected_errno" "bool_expression" +.Fn ATF_FAIL "reason" +.Fn ATF_INIT_TEST_CASES "tcs" +.Fn ATF_PASS +.Fn ATF_REQUIRE "expression" +.Fn ATF_REQUIRE_EQ "expected_expression" "actual_expression" +.Fn ATF_REQUIRE_ERRNO "expected_errno" "bool_expression" +.Fn ATF_REQUIRE_IN "element" "collection" +.Fn ATF_REQUIRE_MATCH "regexp" "string_expression" +.Fn ATF_REQUIRE_NOT_IN "element" "collection" +.Fn ATF_REQUIRE_THROW "expected_exception" "statement" +.Fn ATF_REQUIRE_THROW_RE "expected_exception" "regexp" "statement" +.Fn ATF_SKIP "reason" +.Fn ATF_TEST_CASE "name" +.Fn ATF_TEST_CASE_BODY "name" +.Fn ATF_TEST_CASE_CLEANUP "name" +.Fn ATF_TEST_CASE_HEAD "name" +.Fn ATF_TEST_CASE_NAME "name" +.Fn ATF_TEST_CASE_USE "name" +.Fn ATF_TEST_CASE_WITH_CLEANUP "name" +.Fn ATF_TEST_CASE_WITHOUT_HEAD "name" +.Ft void +.Fo atf::utils::cat_file +.Fa "const std::string& path" +.Fa "const std::string& prefix" +.Fc +.Ft bool +.Fo atf::utils::compare_file +.Fa "const std::string& path" +.Fa "const std::string& contents" +.Fc +.Ft void +.Fo atf::utils::copy_file +.Fa "const std::string& source" +.Fa "const std::string& destination" +.Fc +.Ft void +.Fo atf::utils::create_file +.Fa "const std::string& path" +.Fa "const std::string& contents" +.Fc +.Ft void +.Fo atf::utils::file_exists +.Fa "const std::string& path" +.Fc +.Ft pid_t +.Fo atf::utils::fork +.Fa "void" +.Fc +.Ft bool +.Fo atf::utils::grep_collection +.Fa "const std::string& regexp" +.Fa "const Collection& collection" +.Fc +.Ft bool +.Fo atf::utils::grep_file +.Fa "const std::string& regexp" +.Fa "const std::string& path" +.Fc +.Ft bool +.Fo atf::utils::grep_string +.Fa "const std::string& regexp" +.Fa "const std::string& path" +.Fc +.Ft void +.Fo atf::utils::redirect +.Fa "const int fd" +.Fa "const std::string& path" +.Fc +.Ft void +.Fo atf::utils::wait +.Fa "const pid_t pid" +.Fa "const int expected_exit_status" +.Fa "const std::string& expected_stdout" +.Fa "const std::string& expected_stderr" +.Fc +.Sh DESCRIPTION +ATF provides a C++ programming interface to implement test programs. +C++-based test programs follow this template: +.Bd -literal -offset indent +extern "C" { +.Ns ... C-specific includes go here ... +} + +.Ns ... C++-specific includes go here ... + +#include + +ATF_TEST_CASE(tc1); +ATF_TEST_CASE_HEAD(tc1) +{ + ... first test case's header ... +} +ATF_TEST_CASE_BODY(tc1) +{ + ... first test case's body ... +} + +ATF_TEST_CASE_WITH_CLEANUP(tc2); +ATF_TEST_CASE_HEAD(tc2) +{ + ... second test case's header ... +} +ATF_TEST_CASE_BODY(tc2) +{ + ... second test case's body ... +} +ATF_TEST_CASE_CLEANUP(tc2) +{ + ... second test case's cleanup ... +} + +ATF_TEST_CASE(tc3); +ATF_TEST_CASE_BODY(tc3) +{ + ... third test case's body ... +} + +.Ns ... additional test cases ... + +ATF_INIT_TEST_CASES(tcs) +{ + ATF_ADD_TEST_CASE(tcs, tc1); + ATF_ADD_TEST_CASE(tcs, tc2); + ATF_ADD_TEST_CASE(tcs, tc3); + ... add additional test cases ... +} +.Ed +.Ss Definition of test cases +Test cases have an identifier and are composed of three different parts: +the header, the body and an optional cleanup routine, all of which are +described in +.Xr atf-test-case 4 . +To define test cases, one can use the +.Fn ATF_TEST_CASE , +.Fn ATF_TEST_CASE_WITH_CLEANUP +or the +.Fn ATF_TEST_CASE_WITHOUT_HEAD +macros, which take a single parameter specifiying the test case's +name. +.Fn ATF_TEST_CASE , +requires to define a head and a body for the test case, +.Fn ATF_TEST_CASE_WITH_CLEANUP +requires to define a head, a body and a cleanup for the test case and +.Fn ATF_TEST_CASE_WITHOUT_HEAD +requires only a body for the test case. +It is important to note that these +.Em do not +set the test case up for execution when the program is run. +In order to do so, a later registration is needed through the +.Fn ATF_ADD_TEST_CASE +macro detailed in +.Sx Program initialization . +.Pp +Later on, one must define the three parts of the body by means of three +functions. +Their headers are given by the +.Fn ATF_TEST_CASE_HEAD , +.Fn ATF_TEST_CASE_BODY +and +.Fn ATF_TEST_CASE_CLEANUP +macros, all of which take the test case's name. +Following each of these, a block of code is expected, surrounded by the +opening and closing brackets. +.Pp +Additionally, the +.Fn ATF_TEST_CASE_NAME +macro can be used to obtain the name of the class corresponding to a +particular test case, as the name is internally manged by the library to +prevent clashes with other user identifiers. +Similarly, the +.Fn ATF_TEST_CASE_USE +macro can be executed on a particular test case to mark it as "used" and +thus prevent compiler warnings regarding unused symbols. +Note that +.Em you should never have to use these macros during regular operation. +.Ss Program initialization +The library provides a way to easily define the test program's +.Fn main +function. +You should never define one on your own, but rely on the +library to do it for you. +This is done by using the +.Fn ATF_INIT_TEST_CASES +macro, which is passed the name of the list that will hold the test cases. +This name can be whatever you want as long as it is a valid variable value. +.Pp +After the macro, you are supposed to provide the body of a function, which +should only use the +.Fn ATF_ADD_TEST_CASE +macro to register the test cases the test program will execute. +The first parameter of this macro matches the name you provided in the +former call. +.Ss Header definitions +The test case's header can define the meta-data by using the +.Fn set_md_var +method, which takes two parameters: the first one specifies the +meta-data variable to be set and the second one specifies its value. +Both of them are strings. +.Ss Configuration variables +The test case has read-only access to the current configuration variables +by means of the +.Ft bool +.Fn has_config_var +and the +.Ft std::string +.Fn get_config_var +methods, which can be called in any of the three parts of a test case. +.Ss Access to the source directory +It is possible to get the path to the test case's source directory from any +of its three components by querying the +.Sq srcdir +configuration variable. +.Ss Requiring programs +Aside from the +.Va require.progs +meta-data variable available in the header only, one can also check for +additional programs in the test case's body by using the +.Fn require_prog +function, which takes the base name or full path of a single binary. +Relative paths are forbidden. +If it is not found, the test case will be automatically skipped. +.Ss Test case finalization +The test case finalizes either when the body reaches its end, at which +point the test is assumed to have +.Em passed , +or at any explicit call to +.Fn ATF_PASS , +.Fn ATF_FAIL +or +.Fn ATF_SKIP . +These three macros terminate the execution of the test case immediately. +The cleanup routine will be processed afterwards in a completely automated +way, regardless of the test case's termination reason. +.Pp +.Fn ATF_PASS +does not take any parameters. +.Fn ATF_FAIL +and +.Fn ATF_SKIP +take a single string that describes why the test case failed or +was skipped, respectively. +It is very important to provide a clear error message in both cases so that +the user can quickly know why the test did not pass. +.Ss Expectations +Everything explained in the previous section changes when the test case +expectations are redefined by the programmer. +.Pp +Each test case has an internal state called +.Sq expect +that describes what the test case expectations are at any point in time. +The value of this property can change during execution by any of: +.Bl -tag -width indent +.It Fn expect_death "reason" +Expects the test case to exit prematurely regardless of the nature of the +exit. +.It Fn expect_exit "exitcode" "reason" +Expects the test case to exit cleanly. +If +.Va exitcode +is not +.Sq -1 , +the runtime engine will validate that the exit code of the test case +matches the one provided in this call. +Otherwise, the exact value will be ignored. +.It Fn expect_fail "reason" +Any failure (be it fatal or non-fatal) raised in this mode is recorded. +However, such failures do not report the test case as failed; instead, the +test case finalizes cleanly and is reported as +.Sq expected failure ; +this report includes the provided +.Fa reason +as part of it. +If no error is raised while running in this mode, then the test case is +reported as +.Sq failed . +.Pp +This mode is useful to reproduce actual known bugs in tests. +Whenever the developer fixes the bug later on, the test case will start +reporting a failure, signaling the developer that the test case must be +adjusted to the new conditions. +In this situation, it is useful, for example, to set +.Fa reason +as the bug number for tracking purposes. +.It Fn expect_pass +This is the normal mode of execution. +In this mode, any failure is reported as such to the user and the test case +is marked as +.Sq failed . +.It Fn expect_race "reason" +Any failure or timeout during the execution of the test case will be +considered as if a race condition has been triggered and reported as such. +If no problems arise, the test will continue execution as usual. +.It Fn expect_signal "signo" "reason" +Expects the test case to terminate due to the reception of a signal. +If +.Va signo +is not +.Sq -1 , +the runtime engine will validate that the signal that terminated the test +case matches the one provided in this call. +Otherwise, the exact value will be ignored. +.It Fn expect_timeout "reason" +Expects the test case to execute for longer than its timeout. +.El +.Ss Helper macros for common checks +The library provides several macros that are very handy in multiple +situations. +These basically check some condition after executing a given statement or +processing a given expression and, if the condition is not met, they +automatically call +.Fn ATF_FAIL +with an appropriate error message. +.Pp +.Fn ATF_REQUIRE +takes an expression and raises a failure if it evaluates to false. +.Pp +.Fn ATF_REQUIRE_EQ +takes two expressions and raises a failure if the two do not evaluate to +the same exact value. +The common style is to put the expected value in the first parameter and the +actual value in the second parameter. +.Pp +.Fn ATF_REQUIRE_IN +takes an element and a collection and validates that the element is present in +the collection. +.Pp +.Fn ATF_REQUIRE_MATCH +takes a regular expression and a string and raises a failure if the regular +expression does not match the string. +.Pp +.Fn ATF_REQUIRE_NOT_IN +takes an element and a collection and validates that the element is not present +in the collection. +.Pp +.Fn ATF_REQUIRE_THROW +takes the name of an exception and a statement and raises a failure if +the statement does not throw the specified exception. +.Fn ATF_REQUIRE_THROW_RE +takes the name of an exception, a regular expresion and a statement and raises a +failure if the statement does not throw the specified exception and if the +message of the exception does not match the regular expression. +.Pp +.Fn ATF_CHECK_ERRNO +and +.Fn ATF_REQUIRE_ERRNO +take, first, the error code that the check is expecting to find in the +.Va errno +variable and, second, a boolean expression that, if evaluates to true, +means that a call failed and +.Va errno +has to be checked against the first value. +.Ss Utility functions +The following functions are provided as part of the +.Nm +API to simplify the creation of a variety of tests. +In particular, these are useful to write tests for command-line interfaces. +.Pp +.Ft void +.Fo atf::utils::cat_file +.Fa "const std::string& path" +.Fa "const std::string& prefix" +.Fc +.Bd -ragged -offset indent +Prints the contents of +.Fa path +to the standard output, prefixing every line with the string in +.Fa prefix . +.Ed +.Pp +.Ft bool +.Fo atf::utils::compare_file +.Fa "const std::string& path" +.Fa "const std::string& contents" +.Fc +.Bd -ragged -offset indent +Returns true if the given +.Fa path +matches exactly the expected inlined +.Fa contents . +.Ed +.Pp +.Ft void +.Fo atf::utils::copy_file +.Fa "const std::string& source" +.Fa "const std::string& destination" +.Fc +.Bd -ragged -offset indent +Copies the file +.Fa source +to +.Fa destination . +The permissions of the file are preserved during the code. +.Ed +.Pp +.Ft void +.Fo atf::utils::create_file +.Fa "const std::string& path" +.Fa "const std::string& contents" +.Fc +.Bd -ragged -offset indent +Creates +.Fa file +with the text given in +.Fa contents . +.Ed +.Pp +.Ft void +.Fo atf::utils::file_exists +.Fa "const std::string& path" +.Fc +.Bd -ragged -offset indent +Checks if +.Fa path +exists. +.Ed +.Pp +.Ft pid_t +.Fo atf::utils::fork +.Fa "void" +.Fc +.Bd -ragged -offset indent +Forks a process and redirects the standard output and standard error of the +child to files for later validation with +.Fn atf::utils::wait . +Fails the test case if the fork fails, so this does not return an error. +.Ed +.Pp +.Ft bool +.Fo atf::utils::grep_collection +.Fa "const std::string& regexp" +.Fa "const Collection& collection" +.Fc +.Bd -ragged -offset indent +Searches for the regular expression +.Fa regexp +in any of the strings contained in the +.Fa collection . +This is a template that accepts any one-dimensional container of strings. +.Ed +.Pp +.Ft bool +.Fo atf::utils::grep_file +.Fa "const std::string& regexp" +.Fa "const std::string& path" +.Fc +.Bd -ragged -offset indent +Searches for the regular expression +.Fa regexp +in the file +.Fa path . +The variable arguments are used to construct the regular expression. +.Ed +.Pp +.Ft bool +.Fo atf::utils::grep_string +.Fa "const std::string& regexp" +.Fa "const std::string& str" +.Fc +.Bd -ragged -offset indent +Searches for the regular expression +.Fa regexp +in the string +.Fa str . +.Ed +.Ft void +.Fo atf::utils::redirect +.Fa "const int fd" +.Fa "const std::string& path" +.Fc +.Bd -ragged -offset indent +Redirects the given file descriptor +.Fa fd +to the file +.Fa path . +This function exits the process in case of an error and does not properly mark +the test case as failed. +As a result, it should only be used in subprocesses of the test case; specially +those spawned by +.Fn atf::utils::fork . +.Ed +.Pp +.Ft void +.Fo atf::utils::wait +.Fa "const pid_t pid" +.Fa "const int expected_exit_status" +.Fa "const std::string& expected_stdout" +.Fa "const std::string& expected_stderr" +.Fc +.Bd -ragged -offset indent +Waits and validates the result of a subprocess spawned with +.Fn atf::utils::wait . +The validation involves checking that the subprocess exited cleanly and returned +the code specified in +.Fa expected_exit_status +and that its standard output and standard error match the strings given in +.Fa expected_stdout +and +.Fa expected_stderr . +.Pp +If any of the +.Fa expected_stdout +or +.Fa expected_stderr +strings are prefixed with +.Sq save: , +then they specify the name of the file into which to store the stdout or stderr +of the subprocess, and no comparison is performed. +.Ed +.Sh ENVIRONMENT +The following variables are recognized by +.Nm +but should not be overridden other than for testing purposes: +.Pp +.Bl -tag -width ATFXBUILDXCXXFLAGSXX -compact +.It Va ATF_BUILD_CC +Path to the C compiler. +.It Va ATF_BUILD_CFLAGS +C compiler flags. +.It Va ATF_BUILD_CPP +Path to the C/C++ preprocessor. +.It Va ATF_BUILD_CPPFLAGS +C/C++ preprocessor flags. +.It Va ATF_BUILD_CXX +Path to the C++ compiler. +.It Va ATF_BUILD_CXXFLAGS +C++ compiler flags. +.El +.Sh EXAMPLES +The following shows a complete test program with a single test case that +validates the addition operator: +.Bd -literal -offset indent +#include + +ATF_TEST_CASE(addition); +ATF_TEST_CASE_HEAD(addition) +{ + set_md_var("descr", "Sample tests for the addition operator"); +} +ATF_TEST_CASE_BODY(addition) +{ + ATF_REQUIRE_EQ(0, 0 + 0); + ATF_REQUIRE_EQ(1, 0 + 1); + ATF_REQUIRE_EQ(1, 1 + 0); + + ATF_REQUIRE_EQ(2, 1 + 1); + + ATF_REQUIRE_EQ(300, 100 + 200); +} + +ATF_TEST_CASE(open_failure); +ATF_TEST_CASE_HEAD(open_failure) +{ + set_md_var("descr", "Sample tests for the open function"); +} +ATF_TEST_CASE_BODY(open_failure) +{ + ATF_REQUIRE_ERRNO(ENOENT, open("non-existent", O_RDONLY) == -1); +} + +ATF_TEST_CASE(known_bug); +ATF_TEST_CASE_HEAD(known_bug) +{ + set_md_var("descr", "Reproduces a known bug"); +} +ATF_TEST_CASE_BODY(known_bug) +{ + expect_fail("See bug number foo/bar"); + ATF_REQUIRE_EQ(3, 1 + 1); + expect_pass(); + ATF_REQUIRE_EQ(3, 1 + 2); +} + +ATF_INIT_TEST_CASES(tcs) +{ + ATF_ADD_TEST_CASE(tcs, addition); + ATF_ADD_TEST_CASE(tcs, open_failure); + ATF_ADD_TEST_CASE(tcs, known_bug); +} +.Ed +.Sh SEE ALSO +.Xr atf-test-program 1 , +.Xr atf-test-case 4 Modified: user/dchagin/lemul/contrib/atf/atf-c++/atf_c++_test.cpp ============================================================================== --- user/dchagin/lemul/contrib/atf/atf-c++/atf_c++_test.cpp Thu Nov 6 20:56:29 2014 (r274195) +++ user/dchagin/lemul/contrib/atf/atf-c++/atf_c++_test.cpp Thu Nov 6 21:49:35 2014 (r274196) @@ -1,6 +1,3 @@ -// -// Automated Testing Framework (atf) -// // Copyright (c) 2009 The NetBSD Foundation, Inc. // All rights reserved. // @@ -25,11 +22,10 @@ // IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN // IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -#include "macros.hpp" +#include -#include "detail/test_helpers.hpp" +#include "atf-c++/detail/test_helpers.hpp" // ------------------------------------------------------------------------ // Tests cases for the header file. Modified: user/dchagin/lemul/contrib/atf/atf-c++/build.cpp ============================================================================== --- user/dchagin/lemul/contrib/atf/atf-c++/build.cpp Thu Nov 6 20:56:29 2014 (r274195) +++ user/dchagin/lemul/contrib/atf/atf-c++/build.cpp Thu Nov 6 21:49:35 2014 (r274196) @@ -1,6 +1,3 @@ -// -// Automated Testing Framework (atf) -// // Copyright (c) 2009 The NetBSD Foundation, Inc. // All rights reserved. // *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Thu Nov 6 21:59:24 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D37B2BE9; Thu, 6 Nov 2014 21:59:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BEDDFFE3; Thu, 6 Nov 2014 21:59:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6LxOR8095159; Thu, 6 Nov 2014 21:59:24 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA6LxOn2095158; Thu, 6 Nov 2014 21:59:24 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201411062159.sA6LxOn2095158@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Thu, 6 Nov 2014 21:59:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r274197 - user/dchagin/lemul/sys/compat/linux X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 21:59:24 -0000 Author: dchagin Date: Thu Nov 6 21:59:24 2014 New Revision: 274197 URL: https://svnweb.freebsd.org/changeset/base/274197 Log: Correctly fill si_status in the siginfo for the CLD_STOPPED and CLD_CONTINUED status. Modified: user/dchagin/lemul/sys/compat/linux/linux_signal.c Modified: user/dchagin/lemul/sys/compat/linux/linux_signal.c ============================================================================== --- user/dchagin/lemul/sys/compat/linux/linux_signal.c Thu Nov 6 21:49:35 2014 (r274196) +++ user/dchagin/lemul/sys/compat/linux/linux_signal.c Thu Nov 6 21:59:24 2014 (r274197) @@ -687,9 +687,17 @@ siginfo_to_lsiginfo(siginfo_t *si, l_sig lsi->lsi_band = si->si_band; break; case LINUX_SIGCHLD: + lsi->lsi_errno = 0; lsi->lsi_pid = si->si_pid; lsi->lsi_uid = si->si_uid; - lsi->lsi_status = si->si_status; + + if (si->si_code == CLD_STOPPED) + lsi->lsi_status = BSD_TO_LINUX_SIGNAL(si->si_status); + else if (si->si_code == CLD_CONTINUED) + lsi->lsi_status = BSD_TO_LINUX_SIGNAL(SIGCONT); + else + lsi->lsi_status = si->si_status; + break; case LINUX_SIGBUS: case LINUX_SIGILL: From owner-svn-src-user@FreeBSD.ORG Thu Nov 6 22:00:25 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9BB76CED; Thu, 6 Nov 2014 22:00:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 884AAFF3; Thu, 6 Nov 2014 22:00:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA6M0PJd095507; Thu, 6 Nov 2014 22:00:25 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA6M0Pgr095506; Thu, 6 Nov 2014 22:00:25 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201411062200.sA6M0Pgr095506@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Thu, 6 Nov 2014 22:00:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r274198 - user/dchagin/lemul/sys/compat/linux X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Nov 2014 22:00:25 -0000 Author: dchagin Date: Thu Nov 6 22:00:24 2014 New Revision: 274198 URL: https://svnweb.freebsd.org/changeset/base/274198 Log: Update Linux compat revision to 32. Modified: user/dchagin/lemul/sys/compat/linux/linux_mib.h Modified: user/dchagin/lemul/sys/compat/linux/linux_mib.h ============================================================================== --- user/dchagin/lemul/sys/compat/linux/linux_mib.h Thu Nov 6 21:59:24 2014 (r274197) +++ user/dchagin/lemul/sys/compat/linux/linux_mib.h Thu Nov 6 22:00:24 2014 (r274198) @@ -48,7 +48,7 @@ int linux_kernver(struct thread *td); #define LINUX_KVERSION 2 #define LINUX_KPATCHLEVEL 6 -#define LINUX_KSUBLEVEL 18 +#define LINUX_KSUBLEVEL 32 #define LINUX_KERNVER(a,b,c) (((a) << 16) + ((b) << 8) + (c)) #define LINUX_VERSION_CODE LINUX_KERNVER(LINUX_KVERSION, \ From owner-svn-src-user@FreeBSD.ORG Fri Nov 7 06:08:33 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 82389A0D; Fri, 7 Nov 2014 06:08:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63040D1C; Fri, 7 Nov 2014 06:08:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA768XJH027183; Fri, 7 Nov 2014 06:08:33 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA768WvE027178; Fri, 7 Nov 2014 06:08:32 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201411070608.sA768WvE027178@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Fri, 7 Nov 2014 06:08:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r274219 - in user/dchagin/lemul/sys: amd64/linux amd64/linux32 compat/linux X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 06:08:33 -0000 Author: dchagin Date: Fri Nov 7 06:08:32 2014 New Revision: 274219 URL: https://svnweb.freebsd.org/changeset/base/274219 Log: Move device handler to common module (after r268138). Modified: user/dchagin/lemul/sys/amd64/linux/linux_sysvec.c user/dchagin/lemul/sys/amd64/linux32/linux32_sysvec.c user/dchagin/lemul/sys/compat/linux/linux_common.c Modified: user/dchagin/lemul/sys/amd64/linux/linux_sysvec.c ============================================================================== --- user/dchagin/lemul/sys/amd64/linux/linux_sysvec.c Fri Nov 7 04:47:46 2014 (r274218) +++ user/dchagin/lemul/sys/amd64/linux/linux_sysvec.c Fri Nov 7 06:08:32 2014 (r274219) @@ -117,7 +117,6 @@ extern char _binary_linux_locore_o_end; extern struct sysent linux_sysent[LINUX_SYS_MAXSYSCALL]; SET_DECLARE(linux_ioctl_handler_set, struct linux_ioctl_handler); -SET_DECLARE(linux_device_handler_set, struct linux_device_handler); static register_t * linux_copyout_strings(struct image_params *imgp); static int elf_linux_fixup(register_t **stack_base, @@ -944,7 +943,6 @@ linux64_elf_modevent(module_t mod, int t Elf64_Brandinfo **brandinfo; int error; struct linux_ioctl_handler **lihp; - struct linux_device_handler **ldhp; error = 0; @@ -957,8 +955,6 @@ linux64_elf_modevent(module_t mod, int t if (error == 0) { SET_FOREACH(lihp, linux_ioctl_handler_set) linux_ioctl_register_handler(*lihp); - SET_FOREACH(ldhp, linux_device_handler_set) - linux_device_register_handler(*ldhp); LIST_INIT(&futex_list); mtx_init(&futex_mtx, "ftllk64", NULL, MTX_DEF); stclohz = (stathz ? stathz : hz); @@ -981,8 +977,6 @@ linux64_elf_modevent(module_t mod, int t if (error == 0) { SET_FOREACH(lihp, linux_ioctl_handler_set) linux_ioctl_unregister_handler(*lihp); - SET_FOREACH(ldhp, linux_device_handler_set) - linux_device_unregister_handler(*ldhp); mtx_destroy(&futex_mtx); if (bootverbose) printf("Linux ELF exec handler removed\n"); Modified: user/dchagin/lemul/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- user/dchagin/lemul/sys/amd64/linux32/linux32_sysvec.c Fri Nov 7 04:47:46 2014 (r274218) +++ user/dchagin/lemul/sys/amd64/linux32/linux32_sysvec.c Fri Nov 7 06:08:32 2014 (r274219) @@ -118,7 +118,6 @@ extern char _binary_linux32_locore_o_end extern struct sysent linux_sysent[LINUX_SYS_MAXSYSCALL]; SET_DECLARE(linux_ioctl_handler_set, struct linux_ioctl_handler); -SET_DECLARE(linux_device_handler_set, struct linux_device_handler); static int elf_linux_fixup(register_t **stack_base, struct image_params *iparams); @@ -1154,7 +1153,6 @@ linux_elf_modevent(module_t mod, int typ Elf32_Brandinfo **brandinfo; int error; struct linux_ioctl_handler **lihp; - struct linux_device_handler **ldhp; error = 0; @@ -1167,8 +1165,6 @@ linux_elf_modevent(module_t mod, int typ if (error == 0) { SET_FOREACH(lihp, linux_ioctl_handler_set) linux_ioctl_register_handler(*lihp); - SET_FOREACH(ldhp, linux_device_handler_set) - linux_device_register_handler(*ldhp); LIST_INIT(&futex_list); mtx_init(&futex_mtx, "ftllk", NULL, MTX_DEF); stclohz = (stathz ? stathz : hz); @@ -1191,8 +1187,6 @@ linux_elf_modevent(module_t mod, int typ if (error == 0) { SET_FOREACH(lihp, linux_ioctl_handler_set) linux_ioctl_unregister_handler(*lihp); - SET_FOREACH(ldhp, linux_device_handler_set) - linux_device_unregister_handler(*ldhp); mtx_destroy(&futex_mtx); if (bootverbose) printf("Linux ELF exec handler removed\n"); Modified: user/dchagin/lemul/sys/compat/linux/linux_common.c ============================================================================== --- user/dchagin/lemul/sys/compat/linux/linux_common.c Fri Nov 7 04:47:46 2014 (r274218) +++ user/dchagin/lemul/sys/compat/linux/linux_common.c Fri Nov 7 06:08:32 2014 (r274219) @@ -38,9 +38,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include MODULE_VERSION(linux_common, 1); +SET_DECLARE(linux_device_handler_set, struct linux_device_handler); static eventhandler_tag linux_exec_tag; static eventhandler_tag linux_thread_dtor_tag; @@ -50,6 +52,7 @@ static eventhandler_tag linux_exit_tag; static int linux_common_modevent(module_t mod, int type, void *data) { + struct linux_device_handler **ldhp; switch(type) { case MOD_LOAD: @@ -60,9 +63,13 @@ linux_common_modevent(module_t mod, int linux_proc_exec, NULL, 1000); linux_thread_dtor_tag = EVENTHANDLER_REGISTER(thread_dtor, linux_thread_dtor, NULL, EVENTHANDLER_PRI_ANY); + SET_FOREACH(ldhp, linux_device_handler_set) + linux_device_register_handler(*ldhp); break; case MOD_UNLOAD: linux_osd_jail_deregister(); + SET_FOREACH(ldhp, linux_device_handler_set) + linux_device_unregister_handler(*ldhp); EVENTHANDLER_DEREGISTER(process_exit, linux_exit_tag); EVENTHANDLER_DEREGISTER(process_exec, linux_exec_tag); EVENTHANDLER_DEREGISTER(thread_dtor, linux_thread_dtor_tag); From owner-svn-src-user@FreeBSD.ORG Fri Nov 7 06:11:55 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F16DB10; Fri, 7 Nov 2014 06:11:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51E75DB0; Fri, 7 Nov 2014 06:11:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA76BtQq031039; Fri, 7 Nov 2014 06:11:55 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA76BsEe031036; Fri, 7 Nov 2014 06:11:54 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201411070611.sA76BsEe031036@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Fri, 7 Nov 2014 06:11:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r274220 - user/dchagin/lemul/sys/compat/linux X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 06:11:55 -0000 Author: dchagin Date: Fri Nov 7 06:11:54 2014 New Revision: 274220 URL: https://svnweb.freebsd.org/changeset/base/274220 Log: Move FEATURE macros for v4l and v4l2 to the common module. Modified: user/dchagin/lemul/sys/compat/linux/linux_common.c user/dchagin/lemul/sys/compat/linux/linux_ioctl.c Modified: user/dchagin/lemul/sys/compat/linux/linux_common.c ============================================================================== --- user/dchagin/lemul/sys/compat/linux/linux_common.c Fri Nov 7 06:08:32 2014 (r274219) +++ user/dchagin/lemul/sys/compat/linux/linux_common.c Fri Nov 7 06:11:54 2014 (r274220) @@ -35,11 +35,15 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include +FEATURE(linuxulator_v4l, "V4L ioctl wrapper support in the linuxulator"); +FEATURE(linuxulator_v4l2, "V4L2 ioctl wrapper support in the linuxulator"); + MODULE_VERSION(linux_common, 1); SET_DECLARE(linux_device_handler_set, struct linux_device_handler); Modified: user/dchagin/lemul/sys/compat/linux/linux_ioctl.c ============================================================================== --- user/dchagin/lemul/sys/compat/linux/linux_ioctl.c Fri Nov 7 06:08:32 2014 (r274219) +++ user/dchagin/lemul/sys/compat/linux/linux_ioctl.c Fri Nov 7 06:11:54 2014 (r274220) @@ -95,14 +95,6 @@ __FBSDID("$FreeBSD$"); CTASSERT(LINUX_IFNAMSIZ == IFNAMSIZ); -#if defined(__amd64__) && !defined(COMPAT_LINUX32) -FEATURE(linuxulator64_v4l, "V4L ioctl wrapper support in the 64-bit linuxulator"); -FEATURE(linuxulator64_v4l2, "V4L2 ioctl wrapper support in the 64-bit linuxulator"); -#else -FEATURE(linuxulator_v4l, "V4L ioctl wrapper support in the linuxulator"); -FEATURE(linuxulator_v4l2, "V4L2 ioctl wrapper support in the linuxulator"); -#endif - static linux_ioctl_function_t linux_ioctl_cdrom; static linux_ioctl_function_t linux_ioctl_vfat; static linux_ioctl_function_t linux_ioctl_console; From owner-svn-src-user@FreeBSD.ORG Fri Nov 7 06:16:14 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F903C6E; Fri, 7 Nov 2014 06:16:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89AACDD5; Fri, 7 Nov 2014 06:16:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA76GEkW031670; Fri, 7 Nov 2014 06:16:14 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA76GBAX031650; Fri, 7 Nov 2014 06:16:11 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201411070616.sA76GBAX031650@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Fri, 7 Nov 2014 06:16:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r274221 - in user/dchagin/lemul: . bin/df rescue/rescue share/mk sys/cam/ctl sys/dev/ixl sys/dev/virtio/console sys/modules/ixlv tools/build usr.bin/wc X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 06:16:14 -0000 Author: dchagin Date: Fri Nov 7 06:16:10 2014 New Revision: 274221 URL: https://svnweb.freebsd.org/changeset/base/274221 Log: MFH. Added: user/dchagin/lemul/sys/dev/ixl/ixlv_vc_mgr.h - copied unchanged from r274220, head/sys/dev/ixl/ixlv_vc_mgr.h user/dchagin/lemul/tools/build/check-links.sh - copied unchanged from r274220, head/tools/build/check-links.sh Modified: user/dchagin/lemul/Makefile.inc1 user/dchagin/lemul/bin/df/Makefile user/dchagin/lemul/bin/df/df.1 user/dchagin/lemul/bin/df/df.c user/dchagin/lemul/rescue/rescue/Makefile user/dchagin/lemul/share/mk/bsd.lib.mk user/dchagin/lemul/share/mk/bsd.own.mk user/dchagin/lemul/share/mk/bsd.prog.mk user/dchagin/lemul/sys/cam/ctl/ctl.c user/dchagin/lemul/sys/cam/ctl/ctl_private.h user/dchagin/lemul/sys/dev/ixl/i40e_osdep.c user/dchagin/lemul/sys/dev/ixl/i40e_osdep.h user/dchagin/lemul/sys/dev/ixl/if_ixl.c user/dchagin/lemul/sys/dev/ixl/if_ixlv.c user/dchagin/lemul/sys/dev/ixl/ixl.h user/dchagin/lemul/sys/dev/ixl/ixl_txrx.c user/dchagin/lemul/sys/dev/ixl/ixlv.h user/dchagin/lemul/sys/dev/ixl/ixlvc.c user/dchagin/lemul/sys/dev/virtio/console/virtio_console.c user/dchagin/lemul/sys/modules/ixlv/Makefile user/dchagin/lemul/usr.bin/wc/wc.c Directory Properties: user/dchagin/lemul/ (props changed) user/dchagin/lemul/share/ (props changed) user/dchagin/lemul/sys/ (props changed) Modified: user/dchagin/lemul/Makefile.inc1 ============================================================================== --- user/dchagin/lemul/Makefile.inc1 Fri Nov 7 06:11:54 2014 (r274220) +++ user/dchagin/lemul/Makefile.inc1 Fri Nov 7 06:16:10 2014 (r274221) @@ -1537,6 +1537,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 ${_kerberos5_lib_libwind} \ lib/libbz2 ${_libcom_err} lib/libcrypt \ lib/libelf lib/libexpat \ + lib/libfigpar \ ${_lib_libgssapi} \ lib/libkiconv lib/libkvm lib/liblzma lib/libmd lib/libnv \ ${_lib_libcapsicum} \ @@ -1551,7 +1552,8 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 ${_cddl_lib_libctf} \ lib/libutil lib/libpjdlog ${_lib_libypclnt} lib/libz lib/msun \ ${_secure_lib_libcrypto} ${_lib_libldns} \ - ${_secure_lib_libssh} ${_secure_lib_libssl} + ${_secure_lib_libssh} ${_secure_lib_libssl} \ + gnu/lib/libdialog .if ${MK_GNUCXX} != "no" _prebuild_libs+= gnu/lib/libstdc++ gnu/lib/libsupc++ gnu/lib/libstdc++__L: lib/msun__L @@ -1669,6 +1671,8 @@ _lib_libypclnt= lib/libypclnt lib/libradius__L: lib/libmd__L .endif +gnu/lib/libdialog__L: lib/ncurses/ncursesw__L + .for _lib in ${_prereq_libs} ${_lib}__PL: .PHONY .MAKE .if exists(${.CURDIR}/${_lib}) Modified: user/dchagin/lemul/bin/df/Makefile ============================================================================== --- user/dchagin/lemul/bin/df/Makefile Fri Nov 7 06:11:54 2014 (r274220) +++ user/dchagin/lemul/bin/df/Makefile Fri Nov 7 06:16:10 2014 (r274221) @@ -9,7 +9,7 @@ SRCS= df.c vfslist.c CFLAGS+= -I${MOUNT} -DPADD= ${LIBUTIL} -LDADD= -lutil +DPADD= ${LIBUTIL} ${LIBXO} +LDADD= -lutil -lxo .include Modified: user/dchagin/lemul/bin/df/df.1 ============================================================================== --- user/dchagin/lemul/bin/df/df.1 Fri Nov 7 06:11:54 2014 (r274220) +++ user/dchagin/lemul/bin/df/df.1 Fri Nov 7 06:16:10 2014 (r274221) @@ -29,7 +29,7 @@ .\" @(#)df.1 8.3 (Berkeley) 5/8/95 .\" $FreeBSD$ .\" -.Dd January 16, 2014 +.Dd November 6, 2014 .Dt DF 1 .Os .Sh NAME @@ -37,6 +37,7 @@ .Nd display free disk space .Sh SYNOPSIS .Nm +.Op Fl -libxo .Op Fl b | g | H | h | k | m | P .Op Fl acilnT .Op Fl \&, @@ -193,7 +194,9 @@ If the value is outside, it will be set .Xr statfs 2 , .Xr getbsize 3 , .Xr getmntinfo 3 , +.Xr libxo 3 , .Xr localeconv 3 , +.Xr xo_parse_args 3 , .Xr fstab 5 , .Xr mount 8 , .Xr pstat 8 , Modified: user/dchagin/lemul/bin/df/df.c ============================================================================== --- user/dchagin/lemul/bin/df/df.c Fri Nov 7 06:11:54 2014 (r274220) +++ user/dchagin/lemul/bin/df/df.c Fri Nov 7 06:16:10 2014 (r274221) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "extern.h" @@ -82,7 +83,7 @@ static char *getmntpt(const char *); static int int64width(int64_t); static char *makenetvfslist(void); static void prthuman(const struct statfs *, int64_t); -static void prthumanval(int64_t); +static void prthumanval(const char *, int64_t); static intmax_t fsbtoblk(int64_t, uint64_t, u_long); static void prtstat(struct statfs *, struct maxwidths *); static size_t regetmntinfo(struct statfs **, long, const char **); @@ -119,6 +120,11 @@ main(int argc, char *argv[]) totalbuf.f_bsize = DEV_BSIZE; strlcpy(totalbuf.f_mntfromname, "total", MNAMELEN); vfslist = NULL; + + argc = xo_parse_args(argc, argv); + if (argc < 0) + exit(1); + while ((ch = getopt(argc, argv, "abcgHhiklmnPt:T,")) != -1) switch (ch) { case 'a': @@ -161,7 +167,7 @@ main(int argc, char *argv[]) break; case 'l': if (vfslist != NULL) - errx(1, "-l and -t are mutually exclusive."); + xo_errx(1, "-l and -t are mutually exclusive."); vfslist = makevfslist(makenetvfslist()); lflag = 1; break; @@ -174,9 +180,9 @@ main(int argc, char *argv[]) break; case 't': if (lflag) - errx(1, "-l and -t are mutually exclusive."); + xo_errx(1, "-l and -t are mutually exclusive."); if (vfslist != NULL) - errx(1, "only one -t option may be specified"); + xo_errx(1, "only one -t option may be specified"); fstype = optarg; vfslist = makevfslist(optarg); break; @@ -202,16 +208,19 @@ main(int argc, char *argv[]) /* just the filesystems specified on the command line */ mntbuf = malloc(argc * sizeof(*mntbuf)); if (mntbuf == NULL) - err(1, "malloc()"); + xo_err(1, "malloc()"); mntsize = 0; /* continued in for loop below */ } + xo_open_container("storage-system-information"); + xo_open_list("filesystem"); + /* iterate through specified filesystems */ for (; *argv; argv++) { if (stat(*argv, &stbuf) < 0) { if ((mntpt = getmntpt(*argv)) == NULL) { - warn("%s", *argv); + xo_warn("%s", *argv); rv = 1; continue; } @@ -220,20 +229,20 @@ main(int argc, char *argv[]) mdev.fspec = *argv; mntpath = strdup("/tmp/df.XXXXXX"); if (mntpath == NULL) { - warn("strdup failed"); + xo_warn("strdup failed"); rv = 1; continue; } mntpt = mkdtemp(mntpath); if (mntpt == NULL) { - warn("mkdtemp(\"%s\") failed", mntpath); + xo_warn("mkdtemp(\"%s\") failed", mntpath); rv = 1; free(mntpath); continue; } if (mount(fstype, mntpt, MNT_RDONLY, &mdev) != 0) { - warn("%s", *argv); + xo_warn("%s", *argv); rv = 1; (void)rmdir(mntpt); free(mntpath); @@ -244,7 +253,7 @@ main(int argc, char *argv[]) if (cflag) addstat(&totalbuf, &statfsbuf); } else { - warn("%s", *argv); + xo_warn("%s", *argv); rv = 1; } (void)unmount(mntpt, 0); @@ -260,7 +269,7 @@ main(int argc, char *argv[]) * implement nflag here. */ if (statfs(mntpt, &statfsbuf) < 0) { - warn("%s", mntpt); + xo_warn("%s", mntpt); rv = 1; continue; } @@ -294,8 +303,14 @@ main(int argc, char *argv[]) for (i = 0; i < mntsize; i++) if (aflag || (mntbuf[i].f_flags & MNT_IGNORE) == 0) prtstat(&mntbuf[i], &maxwidths); + + xo_close_list("filesystem"); + if (cflag) prtstat(&totalbuf, &maxwidths); + + xo_close_container("storage-system-information"); + xo_finish(); return (rv); } @@ -341,7 +356,7 @@ regetmntinfo(struct statfs **mntbufp, lo if (nflag || error < 0) if (i != j) { if (error < 0) - warnx("%s stats possibly stale", + xo_warnx("%s stats possibly stale", mntbuf[i].f_mntonname); mntbuf[j] = mntbuf[i]; } @@ -354,13 +369,13 @@ static void prthuman(const struct statfs *sfsp, int64_t used) { - prthumanval(sfsp->f_blocks * sfsp->f_bsize); - prthumanval(used * sfsp->f_bsize); - prthumanval(sfsp->f_bavail * sfsp->f_bsize); + prthumanval(" {:blocks/%6s}", sfsp->f_blocks * sfsp->f_bsize); + prthumanval(" {:used/%6s}", used * sfsp->f_bsize); + prthumanval(" {:available/%6s}", sfsp->f_bavail * sfsp->f_bsize); } static void -prthumanval(int64_t bytes) +prthumanval(const char *fmt, int64_t bytes) { char buf[6]; int flags; @@ -372,14 +387,15 @@ prthumanval(int64_t bytes) humanize_number(buf, sizeof(buf) - (bytes < 0 ? 0 : 1), bytes, "", HN_AUTOSCALE, flags); - (void)printf(" %6s", buf); + xo_attr("value", "%lld", (long long) bytes); + xo_emit(fmt, buf); } /* * Print an inode count in "human-readable" format. */ static void -prthumanvalinode(int64_t bytes) +prthumanvalinode(const char *fmt, int64_t bytes) { char buf[6]; int flags; @@ -389,7 +405,8 @@ prthumanvalinode(int64_t bytes) humanize_number(buf, sizeof(buf) - (bytes < 0 ? 0 : 1), bytes, "", HN_AUTOSCALE, flags); - (void)printf(" %5s", buf); + xo_attr("value", "%lld", (long long) bytes); + xo_emit(fmt, buf); } /* @@ -434,70 +451,77 @@ prtstat(struct statfs *sfsp, struct maxw mwp->used = imax(mwp->used, (int)strlen("Used")); mwp->avail = imax(mwp->avail, (int)strlen("Avail")); - (void)printf("%-*s", mwp->mntfrom, "Filesystem"); + xo_emit("{T:/%-*s}", mwp->mntfrom, "Filesystem"); if (Tflag) - (void)printf(" %-*s", mwp->fstype, "Type"); - (void)printf(" %*s %*s %*s Capacity", mwp->total, header, - mwp->used, "Used", mwp->avail, "Avail"); + xo_emit(" {T:/%-*s}", mwp->fstype, "Type"); + xo_emit(" {T:/%*s} {T:/%*s} {T:/%*s} Capacity", + mwp->total, header, + mwp->used, "Used", mwp->avail, "Avail"); if (iflag) { mwp->iused = imax(hflag ? 0 : mwp->iused, (int)strlen(" iused")); mwp->ifree = imax(hflag ? 0 : mwp->ifree, (int)strlen("ifree")); - (void)printf(" %*s %*s %%iused", + xo_emit(" {T:/%*s} {T:/%*s} {T:\%iused}", mwp->iused - 2, "iused", mwp->ifree, "ifree"); } - (void)printf(" Mounted on\n"); + xo_emit(" {T:Mounted on}\n"); } + + xo_open_instance("filesystem"); /* Check for 0 block size. Can this happen? */ if (sfsp->f_bsize == 0) { - warnx ("File system %s does not have a block size, assuming 512.", + xo_warnx ("File system %s does not have a block size, assuming 512.", sfsp->f_mntonname); sfsp->f_bsize = 512; } - (void)printf("%-*s", mwp->mntfrom, sfsp->f_mntfromname); + xo_emit("{tk:name/%-*s}", mwp->mntfrom, sfsp->f_mntfromname); if (Tflag) - (void)printf(" %-*s", mwp->fstype, sfsp->f_fstypename); + xo_emit(" {:type/%-*s}", mwp->fstype, sfsp->f_fstypename); used = sfsp->f_blocks - sfsp->f_bfree; availblks = sfsp->f_bavail + used; if (hflag) { prthuman(sfsp, used); } else { if (thousands) - format = " %*j'd %*j'd %*j'd"; + format = " {t:total-blocks/%*j'd} {t:used-blocks/%*j'd} " + "{t:available-blocks/%*j'd}"; else - format = " %*jd %*jd %*jd"; - (void)printf(format, + format = " {t:total-blocks/%*jd} {t:used-blocks/%*jd} " + "{t:available-blocks/%*jd}"; + xo_emit(format, mwp->total, fsbtoblk(sfsp->f_blocks, sfsp->f_bsize, blocksize), mwp->used, fsbtoblk(used, sfsp->f_bsize, blocksize), mwp->avail, fsbtoblk(sfsp->f_bavail, sfsp->f_bsize, blocksize)); } - (void)printf(" %5.0f%%", + xo_emit(" {:used-percent/%5.0f}{U:%%}", availblks == 0 ? 100.0 : (double)used / (double)availblks * 100.0); if (iflag) { inodes = sfsp->f_files; used = inodes - sfsp->f_ffree; if (hflag) { - (void)printf(" "); - prthumanvalinode(used); - prthumanvalinode(sfsp->f_ffree); + xo_emit(" "); + prthumanvalinode(" {:inodes-used/%5s}", used); + prthumanvalinode(" {:inodes-free/%5s}", sfsp->f_ffree); } else { if (thousands) - format = " %*j'd %*j'd"; + format = " {:inodes-used/%*j'd} {:inodes-free/%*j'd}"; else - format = " %*jd %*jd"; - (void)printf(format, mwp->iused, (intmax_t)used, + format = " {:inodes-used/%*jd} {:inodes-free/%*jd}"; + xo_emit(format, mwp->iused, (intmax_t)used, mwp->ifree, (intmax_t)sfsp->f_ffree); } - (void)printf(" %4.0f%% ", inodes == 0 ? 100.0 : - (double)used / (double)inodes * 100.0); + xo_emit(" {:inodes-used-percent/%4.0f}{U:%%} ", + inodes == 0 ? 100.0 : + (double)used / (double)inodes * 100.0); } else - (void)printf(" "); + xo_emit(" "); if (strncmp(sfsp->f_mntfromname, "total", MNAMELEN) != 0) - (void)printf(" %s", sfsp->f_mntonname); - (void)printf("\n"); + xo_emit(" {:mounted-on}", sfsp->f_mntonname); + xo_emit("\n"); + xo_close_instance("filesystem"); } static void @@ -564,7 +588,7 @@ static void usage(void) { - (void)fprintf(stderr, + xo_error( "usage: df [-b | -g | -H | -h | -k | -m | -P] [-acilnT] [-t type] [-,]\n" " [file | filesystem ...]\n"); exit(EX_USAGE); @@ -579,24 +603,24 @@ makenetvfslist(void) int cnt, i, maxvfsconf; if (sysctlbyname("vfs.conflist", NULL, &buflen, NULL, 0) < 0) { - warn("sysctl(vfs.conflist)"); + xo_warn("sysctl(vfs.conflist)"); return (NULL); } xvfsp = malloc(buflen); if (xvfsp == NULL) { - warnx("malloc failed"); + xo_warnx("malloc failed"); return (NULL); } keep_xvfsp = xvfsp; if (sysctlbyname("vfs.conflist", xvfsp, &buflen, NULL, 0) < 0) { - warn("sysctl(vfs.conflist)"); + xo_warn("sysctl(vfs.conflist)"); free(keep_xvfsp); return (NULL); } maxvfsconf = buflen / sizeof(struct xvfsconf); if ((listptr = malloc(sizeof(char*) * maxvfsconf)) == NULL) { - warnx("malloc failed"); + xo_warnx("malloc failed"); free(keep_xvfsp); return (NULL); } @@ -605,7 +629,7 @@ makenetvfslist(void) if (xvfsp->vfc_flags & VFCF_NETWORK) { listptr[cnt++] = strdup(xvfsp->vfc_name); if (listptr[cnt-1] == NULL) { - warnx("malloc failed"); + xo_warnx("malloc failed"); free(listptr); free(keep_xvfsp); return (NULL); @@ -617,7 +641,7 @@ makenetvfslist(void) if (cnt == 0 || (str = malloc(sizeof(char) * (32 * cnt + cnt + 2))) == NULL) { if (cnt > 0) - warnx("malloc failed"); + xo_warnx("malloc failed"); free(listptr); free(keep_xvfsp); return (NULL); Modified: user/dchagin/lemul/rescue/rescue/Makefile ============================================================================== --- user/dchagin/lemul/rescue/rescue/Makefile Fri Nov 7 06:11:54 2014 (r274220) +++ user/dchagin/lemul/rescue/rescue/Makefile Fri Nov 7 06:16:10 2014 (r274221) @@ -52,7 +52,7 @@ CRUNCH_SRCDIRS+= bin CRUNCH_PROGS_bin= cat chflags chio chmod cp date dd df echo \ ed expr getfacl hostname kenv kill ln ls mkdir mv \ pkill ps pwd realpath rm rmdir setfacl sh stty sync test -CRUNCH_LIBS+= -lcrypt -ledit -ljail -lkvm -ll -ltermcapw -lutil +CRUNCH_LIBS+= -lcrypt -ledit -ljail -lkvm -ll -ltermcapw -lutil -lxo CRUNCH_BUILDTOOLS+= bin/sh # Additional options for specific programs Modified: user/dchagin/lemul/share/mk/bsd.lib.mk ============================================================================== --- user/dchagin/lemul/share/mk/bsd.lib.mk Fri Nov 7 06:11:54 2014 (r274220) +++ user/dchagin/lemul/share/mk/bsd.lib.mk Fri Nov 7 06:16:10 2014 (r274221) @@ -36,7 +36,7 @@ NO_WERROR= .if defined(DEBUG_FLAGS) CFLAGS+= ${DEBUG_FLAGS} -.if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != "" +.if ${MK_CTF} != "no" CTFFLAGS+= -g .endif .else Modified: user/dchagin/lemul/share/mk/bsd.own.mk ============================================================================== --- user/dchagin/lemul/share/mk/bsd.own.mk Fri Nov 7 06:11:54 2014 (r274220) +++ user/dchagin/lemul/share/mk/bsd.own.mk Fri Nov 7 06:16:10 2014 (r274221) @@ -128,6 +128,7 @@ ____: .if ${MK_CTF} != "no" CTFCONVERT_CMD= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +DEBUG_FLAGS+= -g .elif defined(.PARSEDIR) || (defined(MAKE_VERSION) && ${MAKE_VERSION} >= 5201111300) CTFCONVERT_CMD= .else Modified: user/dchagin/lemul/share/mk/bsd.prog.mk ============================================================================== --- user/dchagin/lemul/share/mk/bsd.prog.mk Fri Nov 7 06:11:54 2014 (r274220) +++ user/dchagin/lemul/share/mk/bsd.prog.mk Fri Nov 7 06:16:10 2014 (r274221) @@ -20,7 +20,7 @@ NO_WERROR= CFLAGS+=${DEBUG_FLAGS} CXXFLAGS+=${DEBUG_FLAGS} -.if ${MK_CTF} != "no" && ${DEBUG_FLAGS:M-g} != "" +.if ${MK_CTF} != "no" CTFFLAGS+= -g .endif .endif Modified: user/dchagin/lemul/sys/cam/ctl/ctl.c ============================================================================== --- user/dchagin/lemul/sys/cam/ctl/ctl.c Fri Nov 7 06:11:54 2014 (r274220) +++ user/dchagin/lemul/sys/cam/ctl/ctl.c Fri Nov 7 06:16:10 2014 (r274221) @@ -4197,17 +4197,11 @@ ctl_init_page_index(struct ctl_lun *lun) * works out a fake geometry based on the capacity. */ memcpy(&lun->mode_pages.rigid_disk_page[ - CTL_PAGE_CURRENT], &rigid_disk_page_default, + CTL_PAGE_DEFAULT], &rigid_disk_page_default, sizeof(rigid_disk_page_default)); memcpy(&lun->mode_pages.rigid_disk_page[ CTL_PAGE_CHANGEABLE],&rigid_disk_page_changeable, sizeof(rigid_disk_page_changeable)); - memcpy(&lun->mode_pages.rigid_disk_page[ - CTL_PAGE_DEFAULT], &rigid_disk_page_default, - sizeof(rigid_disk_page_default)); - memcpy(&lun->mode_pages.rigid_disk_page[ - CTL_PAGE_SAVED], &rigid_disk_page_default, - sizeof(rigid_disk_page_default)); sectors_per_cylinder = CTL_DEFAULT_SECTORS_PER_TRACK * CTL_DEFAULT_HEADS; @@ -4244,16 +4238,21 @@ ctl_init_page_index(struct ctl_lun *lun) cylinders = 0xffffff; rigid_disk_page = &lun->mode_pages.rigid_disk_page[ - CTL_PAGE_CURRENT]; - scsi_ulto3b(cylinders, rigid_disk_page->cylinders); - - rigid_disk_page = &lun->mode_pages.rigid_disk_page[ CTL_PAGE_DEFAULT]; scsi_ulto3b(cylinders, rigid_disk_page->cylinders); - rigid_disk_page = &lun->mode_pages.rigid_disk_page[ - CTL_PAGE_SAVED]; - scsi_ulto3b(cylinders, rigid_disk_page->cylinders); + if ((value = ctl_get_opt(&lun->be_lun->options, + "rpm")) != NULL) { + scsi_ulto2b(strtol(value, NULL, 0), + rigid_disk_page->rotation_rate); + } + + memcpy(&lun->mode_pages.rigid_disk_page[CTL_PAGE_CURRENT], + &lun->mode_pages.rigid_disk_page[CTL_PAGE_DEFAULT], + sizeof(rigid_disk_page_default)); + memcpy(&lun->mode_pages.rigid_disk_page[CTL_PAGE_SAVED], + &lun->mode_pages.rigid_disk_page[CTL_PAGE_DEFAULT], + sizeof(rigid_disk_page_default)); page_index->page_data = (uint8_t *)lun->mode_pages.rigid_disk_page; @@ -10413,7 +10412,7 @@ ctl_inquiry_evpd_bdc(struct ctl_scsiio * (value = ctl_get_opt(&lun->be_lun->options, "rpm")) != NULL) i = strtol(value, NULL, 0); else - i = SVPD_NON_ROTATING; + i = CTL_DEFAULT_ROTATION_RATE; scsi_ulto2b(i, bdc_ptr->medium_rotation_rate); if (lun != NULL && (value = ctl_get_opt(&lun->be_lun->options, "formfactor")) != NULL) Modified: user/dchagin/lemul/sys/cam/ctl/ctl_private.h ============================================================================== --- user/dchagin/lemul/sys/cam/ctl/ctl_private.h Fri Nov 7 06:11:54 2014 (r274220) +++ user/dchagin/lemul/sys/cam/ctl/ctl_private.h Fri Nov 7 06:16:10 2014 (r274221) @@ -271,7 +271,7 @@ union ctl_softcs { #define CTL_DEFAULT_SECTORS_PER_TRACK 256 #define CTL_DEFAULT_HEADS 128 -#define CTL_DEFAULT_ROTATION_RATE 10000 +#define CTL_DEFAULT_ROTATION_RATE SVPD_NON_ROTATING struct ctl_page_index; Modified: user/dchagin/lemul/sys/dev/ixl/i40e_osdep.c ============================================================================== --- user/dchagin/lemul/sys/dev/ixl/i40e_osdep.c Fri Nov 7 06:11:54 2014 (r274220) +++ user/dchagin/lemul/sys/dev/ixl/i40e_osdep.c Fri Nov 7 06:16:10 2014 (r274221) @@ -107,6 +107,7 @@ i40e_allocate_dma_mem(struct i40e_hw *hw "error %u\n", err); goto fail_2; } + mem->nseg = 1; mem->size = size; bus_dmamap_sync(mem->tag, mem->map, BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE); Modified: user/dchagin/lemul/sys/dev/ixl/i40e_osdep.h ============================================================================== --- user/dchagin/lemul/sys/dev/ixl/i40e_osdep.h Fri Nov 7 06:11:54 2014 (r274220) +++ user/dchagin/lemul/sys/dev/ixl/i40e_osdep.h Fri Nov 7 06:16:10 2014 (r274221) @@ -147,8 +147,7 @@ void prefetch(void *x) #define prefetch(x) #endif -struct i40e_osdep -{ +struct i40e_osdep { bus_space_tag_t mem_bus_space_tag; bus_space_handle_t mem_bus_space_handle; bus_size_t mem_bus_space_size; Modified: user/dchagin/lemul/sys/dev/ixl/if_ixl.c ============================================================================== --- user/dchagin/lemul/sys/dev/ixl/if_ixl.c Fri Nov 7 06:11:54 2014 (r274220) +++ user/dchagin/lemul/sys/dev/ixl/if_ixl.c Fri Nov 7 06:16:10 2014 (r274221) @@ -40,7 +40,7 @@ /********************************************************************* * Driver version *********************************************************************/ -char ixl_driver_version[] = "1.2.2"; +char ixl_driver_version[] = "1.2.8"; /********************************************************************* * PCI Device ID Table @@ -109,6 +109,7 @@ static bool ixl_config_link(struct i40e_ static void ixl_config_rss(struct ixl_vsi *); static void ixl_set_queue_rx_itr(struct ixl_queue *); static void ixl_set_queue_tx_itr(struct ixl_queue *); +static int ixl_set_advertised_speeds(struct ixl_pf *, int); static void ixl_enable_rings(struct ixl_vsi *); static void ixl_disable_rings(struct ixl_vsi *); @@ -155,6 +156,7 @@ static void ixl_do_adminq(void *, int); static int ixl_set_flowcntl(SYSCTL_HANDLER_ARGS); static int ixl_set_advertise(SYSCTL_HANDLER_ARGS); static int ixl_current_speed(SYSCTL_HANDLER_ARGS); +static int ixl_sysctl_show_fw(SYSCTL_HANDLER_ARGS); /* Statistics */ static void ixl_add_hw_stats(struct ixl_pf *); @@ -176,7 +178,8 @@ static void ixl_stat_update32(struct i40 static int ixl_sysctl_link_status(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_phy_abilities(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_sw_filter_list(SYSCTL_HANDLER_ARGS); -static int ixl_sysctl_hw_res_info(SYSCTL_HANDLER_ARGS); +static int ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_ARGS); +static int ixl_sysctl_switch_config(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_dump_txd(SYSCTL_HANDLER_ARGS); #endif @@ -276,6 +279,7 @@ int ixl_atr_rate = 20; TUNABLE_INT("hw.ixl.atr_rate", &ixl_atr_rate); #endif + static char *ixl_fc_string[6] = { "None", "Rx", @@ -398,6 +402,11 @@ ixl_attach(device_t dev) OID_AUTO, "current_speed", CTLTYPE_STRING | CTLFLAG_RD, pf, 0, ixl_current_speed, "A", "Current Port Speed"); + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "fw_version", CTLTYPE_STRING | CTLFLAG_RD, + pf, 0, ixl_sysctl_show_fw, "A", "Firmware version"); + SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "rx_itr", CTLFLAG_RW, @@ -436,8 +445,13 @@ ixl_attach(device_t dev) SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "hw_res_info", CTLTYPE_STRING | CTLFLAG_RD, - pf, 0, ixl_sysctl_hw_res_info, "A", "HW Resource Allocation"); + OID_AUTO, "hw_res_alloc", CTLTYPE_STRING | CTLFLAG_RD, + pf, 0, ixl_sysctl_hw_res_alloc, "A", "HW Resource Allocation"); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "switch_config", CTLTYPE_STRING | CTLFLAG_RD, + pf, 0, ixl_sysctl_switch_config, "A", "HW Switch Configuration"); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), @@ -445,7 +459,7 @@ ixl_attach(device_t dev) pf, 0, ixl_sysctl_dump_txd, "I", "Desc dump"); #endif - /* Save off the information about this board */ + /* Save off the PCI information */ hw->vendor_id = pci_get_vendor(dev); hw->device_id = pci_get_device(dev); hw->revision_id = pci_read_config(dev, PCIR_REVID, 1); @@ -593,6 +607,7 @@ ixl_attach(device_t dev) bcopy(hw->mac.addr, hw->mac.perm_addr, ETHER_ADDR_LEN); i40e_get_port_mac_addr(hw, hw->mac.port_addr); + /* Set up VSI and queues */ if (ixl_setup_stations(pf) != 0) { device_printf(dev, "setup stations failed!\n"); error = ENOMEM; @@ -630,8 +645,11 @@ ixl_attach(device_t dev) "an unqualified module was detected\n"); /* Setup OS specific network interface */ - if (ixl_setup_interface(dev, vsi) != 0) + if (ixl_setup_interface(dev, vsi) != 0) { + device_printf(dev, "interface setup failed!\n"); + error = EIO; goto err_late; + } /* Get the bus configuration and set the shared code */ bus = ixl_get_bus_info(hw, dev); @@ -642,25 +660,32 @@ ixl_attach(device_t dev) ixl_update_stats_counters(pf); ixl_add_hw_stats(pf); + /* Reset port's advertised speeds */ + if (!i40e_is_40G_device(hw->device_id)) { + pf->advertised_speed = 0x7; + ixl_set_advertised_speeds(pf, 0x7); + } + /* Register for VLAN events */ vsi->vlan_attach = EVENTHANDLER_REGISTER(vlan_config, ixl_register_vlan, vsi, EVENTHANDLER_PRI_FIRST); vsi->vlan_detach = EVENTHANDLER_REGISTER(vlan_unconfig, ixl_unregister_vlan, vsi, EVENTHANDLER_PRI_FIRST); + INIT_DEBUGOUT("ixl_attach: end"); return (0); err_late: - ixl_free_vsi(vsi); + if (vsi->ifp != NULL) + if_free(vsi->ifp); err_mac_hmc: i40e_shutdown_lan_hmc(hw); err_get_cap: i40e_shutdown_adminq(hw); err_out: - if (vsi->ifp != NULL) - if_free(vsi->ifp); ixl_free_pci_resources(pf); + ixl_free_vsi(vsi); IXL_PF_LOCK_DESTROY(pf); return (error); } @@ -725,6 +750,7 @@ ixl_detach(device_t dev) ether_ifdetach(vsi->ifp); callout_drain(&pf->timer); + ixl_free_pci_resources(pf); bus_generic_detach(dev); if_free(vsi->ifp); @@ -2246,6 +2272,34 @@ early: return; } +static void +ixl_add_ifmedia(struct ixl_vsi *vsi, u32 phy_type) +{ + /* Display supported media types */ + if (phy_type & (1 << I40E_PHY_TYPE_100BASE_TX)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_100_TX, 0, NULL); + + if (phy_type & (1 << I40E_PHY_TYPE_1000BASE_T)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_1000_T, 0, NULL); + + if (phy_type & (1 << I40E_PHY_TYPE_10GBASE_CR1_CU) || + phy_type & (1 << I40E_PHY_TYPE_10GBASE_SFPP_CU)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_TWINAX, 0, NULL); + if (phy_type & (1 << I40E_PHY_TYPE_10GBASE_SR)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_SR, 0, NULL); + if (phy_type & (1 << I40E_PHY_TYPE_10GBASE_LR)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_LR, 0, NULL); + if (phy_type & (1 << I40E_PHY_TYPE_10GBASE_T)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_T, 0, NULL); + + if (phy_type & (1 << I40E_PHY_TYPE_40GBASE_CR4_CU) || + phy_type & (1 << I40E_PHY_TYPE_40GBASE_CR4)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_40G_CR4, 0, NULL); + if (phy_type & (1 << I40E_PHY_TYPE_40GBASE_SR4)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_40G_SR4, 0, NULL); + if (phy_type & (1 << I40E_PHY_TYPE_40GBASE_LR4)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_40G_LR4, 0, NULL); +} /********************************************************************* * @@ -2276,7 +2330,7 @@ ixl_setup_interface(device_t dev, struct ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = ixl_ioctl; -#if __FreeBSD_version >= 1100000 +#if __FreeBSD_version >= 1100036 if_setgetcounterfn(ifp, ixl_get_counter); #endif @@ -2286,8 +2340,6 @@ ixl_setup_interface(device_t dev, struct ifp->if_snd.ifq_maxlen = que->num_desc - 2; - ether_ifattach(ifp, hw->mac.addr); - vsi->max_frame_size = ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + ETHER_VLAN_ENCAP_LEN; @@ -2328,40 +2380,26 @@ ixl_setup_interface(device_t dev, struct ixl_media_status); aq_error = i40e_aq_get_phy_capabilities(hw, FALSE, TRUE, &abilities_resp, NULL); - if (aq_error) { - printf("Error getting supported media types, AQ error %d\n", aq_error); - return (EPERM); - } - - /* Display supported media types */ - if (abilities_resp.phy_type & (1 << I40E_PHY_TYPE_100BASE_TX)) - ifmedia_add(&vsi->media, IFM_ETHER | IFM_100_TX, 0, NULL); - - if (abilities_resp.phy_type & (1 << I40E_PHY_TYPE_1000BASE_T)) - ifmedia_add(&vsi->media, IFM_ETHER | IFM_1000_T, 0, NULL); - - if (abilities_resp.phy_type & (1 << I40E_PHY_TYPE_10GBASE_CR1_CU) || - abilities_resp.phy_type & (1 << I40E_PHY_TYPE_10GBASE_SFPP_CU)) - ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_TWINAX, 0, NULL); - if (abilities_resp.phy_type & (1 << I40E_PHY_TYPE_10GBASE_SR)) - ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_SR, 0, NULL); - if (abilities_resp.phy_type & (1 << I40E_PHY_TYPE_10GBASE_LR)) - ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_LR, 0, NULL); - if (abilities_resp.phy_type & (1 << I40E_PHY_TYPE_10GBASE_T)) - ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_T, 0, NULL); - - if (abilities_resp.phy_type & (1 << I40E_PHY_TYPE_40GBASE_CR4_CU) || - abilities_resp.phy_type & (1 << I40E_PHY_TYPE_40GBASE_CR4)) - ifmedia_add(&vsi->media, IFM_ETHER | IFM_40G_CR4, 0, NULL); - if (abilities_resp.phy_type & (1 << I40E_PHY_TYPE_40GBASE_SR4)) - ifmedia_add(&vsi->media, IFM_ETHER | IFM_40G_SR4, 0, NULL); - if (abilities_resp.phy_type & (1 << I40E_PHY_TYPE_40GBASE_LR4)) - ifmedia_add(&vsi->media, IFM_ETHER | IFM_40G_LR4, 0, NULL); + if (aq_error == I40E_ERR_UNKNOWN_PHY) { + /* Need delay to detect fiber correctly */ + i40e_msec_delay(200); + aq_error = i40e_aq_get_phy_capabilities(hw, FALSE, TRUE, &abilities_resp, NULL); + if (aq_error == I40E_ERR_UNKNOWN_PHY) + device_printf(dev, "Unknown PHY type detected!\n"); + else + ixl_add_ifmedia(vsi, abilities_resp.phy_type); + } else if (aq_error) { + device_printf(dev, "Error getting supported media types, err %d," + " AQ error %d\n", aq_error, hw->aq.asq_last_status); + } else + ixl_add_ifmedia(vsi, abilities_resp.phy_type); /* Use autoselect media by default */ ifmedia_add(&vsi->media, IFM_ETHER | IFM_AUTO, 0, NULL); ifmedia_set(&vsi->media, IFM_ETHER | IFM_AUTO); + ether_ifattach(ifp, hw->mac.addr); + return (0); } @@ -3728,10 +3766,6 @@ ixl_update_stats_counters(struct ixl_pf pf->stat_offsets_loaded, &osd->eth.rx_discards, &nsd->eth.rx_discards); - ixl_stat_update32(hw, I40E_GLPRT_TDPC(hw->port), - pf->stat_offsets_loaded, - &osd->eth.tx_discards, - &nsd->eth.tx_discards); ixl_stat_update48(hw, I40E_GLPRT_UPRCH(hw->port), I40E_GLPRT_UPRCL(hw->port), pf->stat_offsets_loaded, @@ -3915,8 +3949,8 @@ ixl_do_adminq(void *context, int pending u32 reg, loop = 0; u16 opcode, result; - event.msg_len = IXL_AQ_BUF_SZ; - event.msg_buf = malloc(event.msg_len, + event.buf_len = IXL_AQ_BUF_SZ; + event.msg_buf = malloc(event.buf_len, M_DEVBUF, M_NOWAIT | M_ZERO); if (!event.msg_buf) { printf("Unable to allocate adminq memory\n"); @@ -4300,6 +4334,52 @@ ixl_current_speed(SYSCTL_HANDLER_ARGS) return (error); } +static int +ixl_set_advertised_speeds(struct ixl_pf *pf, int speeds) +{ + struct i40e_hw *hw = &pf->hw; + device_t dev = pf->dev; + struct i40e_aq_get_phy_abilities_resp abilities; + struct i40e_aq_set_phy_config config; + enum i40e_status_code aq_error = 0; + + /* Get current capability information */ + aq_error = i40e_aq_get_phy_capabilities(hw, FALSE, FALSE, &abilities, NULL); + if (aq_error) { + device_printf(dev, "%s: Error getting phy capabilities %d," + " aq error: %d\n", __func__, aq_error, + hw->aq.asq_last_status); + return (EAGAIN); + } + + /* Prepare new config */ + bzero(&config, sizeof(config)); + config.phy_type = abilities.phy_type; + config.abilities = abilities.abilities + | I40E_AQ_PHY_ENABLE_ATOMIC_LINK; + config.eee_capability = abilities.eee_capability; + config.eeer = abilities.eeer_val; + config.low_power_ctrl = abilities.d3_lpan; + /* Translate into aq cmd link_speed */ + if (speeds & 0x4) + config.link_speed |= I40E_LINK_SPEED_10GB; + if (speeds & 0x2) + config.link_speed |= I40E_LINK_SPEED_1GB; + if (speeds & 0x1) + config.link_speed |= I40E_LINK_SPEED_100MB; + + /* Do aq command & restart link */ + aq_error = i40e_aq_set_phy_config(hw, &config, NULL); + if (aq_error) { + device_printf(dev, "%s: Error setting new phy config %d," + " aq error: %d\n", __func__, aq_error, + hw->aq.asq_last_status); + return (EAGAIN); + } + + return (0); +} + /* ** Control link advertise speed: ** Flags: @@ -4315,10 +4395,7 @@ ixl_set_advertise(SYSCTL_HANDLER_ARGS) struct ixl_pf *pf = (struct ixl_pf *)arg1; struct i40e_hw *hw = &pf->hw; device_t dev = pf->dev; - struct i40e_aq_get_phy_abilities_resp abilities; - struct i40e_aq_set_phy_config config; int requested_ls = 0; - enum i40e_status_code aq_error = 0; int error = 0; /* @@ -4343,39 +4420,9 @@ ixl_set_advertise(SYSCTL_HANDLER_ARGS) if (pf->advertised_speed == requested_ls) return (0); - /* Get current capability information */ - aq_error = i40e_aq_get_phy_capabilities(hw, FALSE, FALSE, &abilities, NULL); - if (aq_error) { - device_printf(dev, "%s: Error getting phy capabilities %d," - " aq error: %d\n", __func__, aq_error, - hw->aq.asq_last_status); - return (EAGAIN); - } - - /* Prepare new config */ - bzero(&config, sizeof(config)); - config.phy_type = abilities.phy_type; - config.abilities = abilities.abilities - | I40E_AQ_PHY_ENABLE_ATOMIC_LINK; - config.eee_capability = abilities.eee_capability; - config.eeer = abilities.eeer_val; - config.low_power_ctrl = abilities.d3_lpan; - /* Translate into aq cmd link_speed */ - if (requested_ls & 0x4) - config.link_speed |= I40E_LINK_SPEED_10GB; - if (requested_ls & 0x2) - config.link_speed |= I40E_LINK_SPEED_1GB; - if (requested_ls & 0x1) - config.link_speed |= I40E_LINK_SPEED_100MB; - - /* Do aq command & restart link */ - aq_error = i40e_aq_set_phy_config(hw, &config, NULL); - if (aq_error) { - device_printf(dev, "%s: Error setting new phy config %d," - " aq error: %d\n", __func__, aq_error, - hw->aq.asq_last_status); - return (EAGAIN); - } + error = ixl_set_advertised_speeds(pf, requested_ls); + if (error) + return (error); pf->advertised_speed = requested_ls; ixl_update_link_status(pf); @@ -4454,6 +4501,26 @@ ixl_get_bus_info(struct i40e_hw *hw, dev return (link); } +static int +ixl_sysctl_show_fw(SYSCTL_HANDLER_ARGS) +{ + struct ixl_pf *pf = (struct ixl_pf *)arg1; + struct i40e_hw *hw = &pf->hw; + char buf[32]; + + snprintf(buf, sizeof(buf), + "f%d.%d a%d.%d n%02x.%02x e%08x", + hw->aq.fw_maj_ver, hw->aq.fw_min_ver, + hw->aq.api_maj_ver, hw->aq.api_min_ver, + (hw->nvm.version & IXL_NVM_VERSION_HI_MASK) >> + IXL_NVM_VERSION_HI_SHIFT, + (hw->nvm.version & IXL_NVM_VERSION_LO_MASK) >> + IXL_NVM_VERSION_LO_SHIFT, + hw->nvm.eetrack); + return (sysctl_handle_string(oidp, buf, strlen(buf), req)); +} + + #ifdef IXL_DEBUG static int ixl_sysctl_link_status(SYSCTL_HANDLER_ARGS) @@ -4563,7 +4630,7 @@ ixl_sysctl_sw_filter_list(SYSCTL_HANDLER #define IXL_SW_RES_SIZE 0x14 static int -ixl_sysctl_hw_res_info(SYSCTL_HANDLER_ARGS) +ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_ARGS) { struct ixl_pf *pf = (struct ixl_pf *)arg1; struct i40e_hw *hw = &pf->hw; @@ -4620,7 +4687,120 @@ ixl_sysctl_hw_res_info(SYSCTL_HANDLER_AR device_printf(dev, "sysctl error: %d\n", error); sbuf_delete(buf); return error; +} + +/* +** Caller must init and delete sbuf; this function will clear and +** finish it for caller. +*/ +static char * +ixl_switch_element_string(struct sbuf *s, u16 seid, bool uplink) +{ + sbuf_clear(s); + if (seid == 0 && uplink) + sbuf_cat(s, "Network"); + else if (seid == 0) + sbuf_cat(s, "Host"); + else if (seid == 1) + sbuf_cat(s, "EMP"); + else if (seid <= 5) + sbuf_printf(s, "MAC %d", seid - 2); + else if (seid <= 15) + sbuf_cat(s, "Reserved"); + else if (seid <= 31) + sbuf_printf(s, "PF %d", seid - 16); + else if (seid <= 159) + sbuf_printf(s, "VF %d", seid - 32); + else if (seid <= 287) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Fri Nov 7 06:37:21 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 67A2BC9; Fri, 7 Nov 2014 06:37:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54431FC9; Fri, 7 Nov 2014 06:37:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA76bLZt040963; Fri, 7 Nov 2014 06:37:21 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA76bL4L040962; Fri, 7 Nov 2014 06:37:21 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201411070637.sA76bL4L040962@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Fri, 7 Nov 2014 06:37:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r274222 - user/dchagin/lemul/sys/modules X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 06:37:21 -0000 Author: dchagin Date: Fri Nov 7 06:37:20 2014 New Revision: 274222 URL: https://svnweb.freebsd.org/changeset/base/274222 Log: linux_common & linux64 are amd64 specific. Submitted by: Jan Beich Modified: user/dchagin/lemul/sys/modules/Makefile Modified: user/dchagin/lemul/sys/modules/Makefile ============================================================================== --- user/dchagin/lemul/sys/modules/Makefile Fri Nov 7 06:16:10 2014 (r274221) +++ user/dchagin/lemul/sys/modules/Makefile Fri Nov 7 06:37:20 2014 (r274222) @@ -200,8 +200,8 @@ SUBDIR= \ ${_linprocfs} \ ${_linsysfs} \ ${_linux} \ + ${_linux_common} \ ${_linux64} \ - ${_linuxcommon} \ lmc \ lpt \ mac_biba \ @@ -576,8 +576,6 @@ _mlx4= mlx4 _mlx4ib= mlx4ib _mlxen= mlxen .endif -_linux64= linux64 -_linuxcommon= linux_common _mly= mly .if ${MK_OFED} != "no" || defined(ALL_MODULES) _mthca= mthca @@ -615,6 +613,8 @@ _qlxgb= qlxgb _qlxgbe= qlxgbe _sfxge= sfxge _vmm= vmm +_linux_common= linux_common +_linux64= linux64 .endif .if ${MACHINE_CPUARCH} == "i386" From owner-svn-src-user@FreeBSD.ORG Fri Nov 7 16:16:38 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 299BF40D; Fri, 7 Nov 2014 16:16:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16209AEE; Fri, 7 Nov 2014 16:16:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA7GGbUi016288; Fri, 7 Nov 2014 16:16:37 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA7GGbEE016287; Fri, 7 Nov 2014 16:16:37 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201411071616.sA7GGbEE016287@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Fri, 7 Nov 2014 16:16:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r274240 - user/dchagin/lemul/sys/amd64/linux X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 16:16:38 -0000 Author: dchagin Date: Fri Nov 7 16:16:37 2014 New Revision: 274240 URL: https://svnweb.freebsd.org/changeset/base/274240 Log: Rename l_sigval to l_sigval_t as other compat. Modified: user/dchagin/lemul/sys/amd64/linux/linux.h Modified: user/dchagin/lemul/sys/amd64/linux/linux.h ============================================================================== --- user/dchagin/lemul/sys/amd64/linux/linux.h Fri Nov 7 15:52:32 2014 (r274239) +++ user/dchagin/lemul/sys/amd64/linux/linux.h Fri Nov 7 16:16:37 2014 (r274240) @@ -275,10 +275,10 @@ struct l_ucontext { #define LINUX_SI_MAX_SIZE 128 #define LINUX_SI_PAD_SIZE ((LINUX_SI_MAX_SIZE - \ LINUX_SI_PREAMBLE_SIZE) / sizeof(l_int)) -union l_sigval { +typedef union l_sigval { l_int sival_int; l_uintptr_t sival_ptr; -}; +} l_sigval_t; typedef struct l_siginfo { l_int lsi_signo; @@ -303,7 +303,7 @@ typedef struct l_siginfo { struct { l_pid_t _pid; /* sender's pid */ l_uid_t _uid; /* sender's uid */ - union l_sigval _sigval; + union l_sigval _sigval; } _rt; struct { From owner-svn-src-user@FreeBSD.ORG Fri Nov 7 16:23:08 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CF8015B4; Fri, 7 Nov 2014 16:23:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B87D7BD2; Fri, 7 Nov 2014 16:23:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA7GN8wu020557; Fri, 7 Nov 2014 16:23:08 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA7GMx5T020495; Fri, 7 Nov 2014 16:22:59 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201411071622.sA7GMx5T020495@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Fri, 7 Nov 2014 16:22:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r274241 - in user/dchagin/lemul: gnu/lib/libdialog sys/dev/hyperv/netvsc sys/dev/ixl sys/dev/usb sys/dev/usb/serial sys/net sys/netgraph sys/netinet sys/netinet/cc sys/netinet6 sys/neti... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 16:23:08 -0000 Author: dchagin Date: Fri Nov 7 16:22:58 2014 New Revision: 274241 URL: https://svnweb.freebsd.org/changeset/base/274241 Log: MFH. Modified: user/dchagin/lemul/gnu/lib/libdialog/Makefile user/dchagin/lemul/sys/dev/hyperv/netvsc/hv_net_vsc.c user/dchagin/lemul/sys/dev/hyperv/netvsc/hv_net_vsc.h user/dchagin/lemul/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c user/dchagin/lemul/sys/dev/ixl/ixl_txrx.c user/dchagin/lemul/sys/dev/usb/serial/u3g.c user/dchagin/lemul/sys/dev/usb/usbdevs user/dchagin/lemul/sys/net/bpf.c user/dchagin/lemul/sys/net/flowtable.c user/dchagin/lemul/sys/net/if.c user/dchagin/lemul/sys/net/if_arp.h user/dchagin/lemul/sys/net/if_bridge.c user/dchagin/lemul/sys/net/if_ethersubr.c user/dchagin/lemul/sys/net/if_fddisubr.c user/dchagin/lemul/sys/net/if_gif.c user/dchagin/lemul/sys/net/if_iso88025subr.c user/dchagin/lemul/sys/net/if_mib.c user/dchagin/lemul/sys/net/vnet.h user/dchagin/lemul/sys/netgraph/ng_ether.c user/dchagin/lemul/sys/netinet/cc/cc.c user/dchagin/lemul/sys/netinet/cc/cc_cdg.c user/dchagin/lemul/sys/netinet/cc/cc_chd.c user/dchagin/lemul/sys/netinet/cc/cc_hd.c user/dchagin/lemul/sys/netinet/cc/cc_htcp.c user/dchagin/lemul/sys/netinet/cc/cc_vegas.c user/dchagin/lemul/sys/netinet/if_ether.c user/dchagin/lemul/sys/netinet/igmp.c user/dchagin/lemul/sys/netinet/in.c user/dchagin/lemul/sys/netinet/in_gif.c user/dchagin/lemul/sys/netinet/in_pcb.c user/dchagin/lemul/sys/netinet/in_rmx.c user/dchagin/lemul/sys/netinet/ip_carp.c user/dchagin/lemul/sys/netinet/ip_fastfwd.c user/dchagin/lemul/sys/netinet/ip_icmp.c user/dchagin/lemul/sys/netinet/ip_input.c user/dchagin/lemul/sys/netinet/ip_ipsec.c user/dchagin/lemul/sys/netinet/ip_mroute.c user/dchagin/lemul/sys/netinet/raw_ip.c user/dchagin/lemul/sys/netinet/tcp_hostcache.c user/dchagin/lemul/sys/netinet/tcp_input.c user/dchagin/lemul/sys/netinet/tcp_output.c user/dchagin/lemul/sys/netinet/tcp_sack.c user/dchagin/lemul/sys/netinet/tcp_subr.c user/dchagin/lemul/sys/netinet/tcp_syncache.c user/dchagin/lemul/sys/netinet/tcp_timewait.c user/dchagin/lemul/sys/netinet/udp_usrreq.c user/dchagin/lemul/sys/netinet6/in6_gif.c user/dchagin/lemul/sys/netinet6/in6_proto.c user/dchagin/lemul/sys/netinet6/in6_rmx.c user/dchagin/lemul/sys/netinet6/ip6_ipsec.c user/dchagin/lemul/sys/netinet6/mld6.c user/dchagin/lemul/sys/netinet6/nd6.c user/dchagin/lemul/sys/netinet6/scope6.c user/dchagin/lemul/sys/netipsec/ipsec.c user/dchagin/lemul/sys/netipsec/ipsec_input.c user/dchagin/lemul/sys/netipsec/key.c user/dchagin/lemul/sys/netipsec/xform_ah.c user/dchagin/lemul/sys/netipsec/xform_esp.c user/dchagin/lemul/sys/netipsec/xform_ipcomp.c user/dchagin/lemul/sys/netipsec/xform_ipip.c user/dchagin/lemul/sys/netpfil/ipfw/ip_fw2.c user/dchagin/lemul/sys/netpfil/ipfw/ip_fw_dynamic.c user/dchagin/lemul/sys/netpfil/ipfw/ip_fw_pfil.c user/dchagin/lemul/sys/netpfil/pf/if_pfsync.c Directory Properties: user/dchagin/lemul/ (props changed) user/dchagin/lemul/gnu/lib/ (props changed) user/dchagin/lemul/sys/ (props changed) user/dchagin/lemul/sys/dev/hyperv/ (props changed) Modified: user/dchagin/lemul/gnu/lib/libdialog/Makefile ============================================================================== --- user/dchagin/lemul/gnu/lib/libdialog/Makefile Fri Nov 7 16:16:37 2014 (r274240) +++ user/dchagin/lemul/gnu/lib/libdialog/Makefile Fri Nov 7 16:22:58 2014 (r274241) @@ -13,6 +13,9 @@ SRCS= argv.c arrows.c buildlist.c butto INCS= dialog.h dlg_colors.h dlg_config.h dlg_keys.h MAN= dialog.3 +DPADD= ${LIBNCURSESW} ${LIBM} +LDADD= -lncursesw -lm + CFLAGS+= -I${.CURDIR} -I${DIALOG} -D_XOPEN_SOURCE_EXTENDED -DGCC_UNUSED=__unused .PATH: ${DIALOG} WARNS?= 1 Modified: user/dchagin/lemul/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- user/dchagin/lemul/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Nov 7 16:16:37 2014 (r274240) +++ user/dchagin/lemul/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Nov 7 16:22:58 2014 (r274241) @@ -529,7 +529,7 @@ hv_nv_connect_to_vsp(struct hv_device *d int ret = 0; device_t dev = device->device; hn_softc_t *sc = device_get_softc(dev); - struct ifnet *ifp = sc->arpcom.ac_ifp; + struct ifnet *ifp = sc->hn_ifp; net_dev = hv_nv_get_outbound_net_device(device); if (!net_dev) { Modified: user/dchagin/lemul/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- user/dchagin/lemul/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Nov 7 16:16:37 2014 (r274240) +++ user/dchagin/lemul/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Nov 7 16:22:58 2014 (r274241) @@ -965,7 +965,6 @@ typedef struct { */ typedef struct hn_softc { struct ifnet *hn_ifp; - struct arpcom arpcom; device_t hn_dev; uint8_t hn_unit; int hn_carrier; Modified: user/dchagin/lemul/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- user/dchagin/lemul/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Nov 7 16:16:37 2014 (r274240) +++ user/dchagin/lemul/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Nov 7 16:22:58 2014 (r274241) @@ -255,7 +255,7 @@ netvsc_attach(device_t dev) sc->hn_dev_obj = device_ctx; - ifp = sc->hn_ifp = sc->arpcom.ac_ifp = if_alloc(IFT_ETHER); + ifp = sc->hn_ifp = if_alloc(IFT_ETHER); ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); @@ -634,8 +634,6 @@ netvsc_recv(struct hv_device *device_ctx } ifp = sc->hn_ifp; - - ifp = sc->arpcom.ac_ifp; if (!(ifp->if_drv_flags & IFF_DRV_RUNNING)) { return (0); Modified: user/dchagin/lemul/sys/dev/ixl/ixl_txrx.c ============================================================================== --- user/dchagin/lemul/sys/dev/ixl/ixl_txrx.c Fri Nov 7 16:16:37 2014 (r274240) +++ user/dchagin/lemul/sys/dev/ixl/ixl_txrx.c Fri Nov 7 16:22:58 2014 (r274241) @@ -1089,8 +1089,8 @@ int ixl_init_rx_ring(struct ixl_queue *que) { struct rx_ring *rxr = &que->rxr; -#if defined(INET6) || defined(INET) struct ixl_vsi *vsi = que->vsi; +#if defined(INET6) || defined(INET) struct ifnet *ifp = vsi->ifp; struct lro_ctrl *lro = &rxr->lro; #endif Modified: user/dchagin/lemul/sys/dev/usb/serial/u3g.c ============================================================================== --- user/dchagin/lemul/sys/dev/usb/serial/u3g.c Fri Nov 7 16:16:37 2014 (r274240) +++ user/dchagin/lemul/sys/dev/usb/serial/u3g.c Fri Nov 7 16:22:58 2014 (r274241) @@ -470,6 +470,8 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(QUALCOMMINC, E2003, 0), U3G_DEV(QUALCOMMINC, K3772_Z, 0), U3G_DEV(QUALCOMMINC, K3772_Z_INIT, U3GINIT_SCSIEJECT), + U3G_DEV(QUALCOMMINC, MF195E, 0), + U3G_DEV(QUALCOMMINC, MF195E_INIT, U3GINIT_SCSIEJECT), U3G_DEV(QUALCOMMINC, MF626, 0), U3G_DEV(QUALCOMMINC, MF628, 0), U3G_DEV(QUALCOMMINC, MF633R, 0), Modified: user/dchagin/lemul/sys/dev/usb/usbdevs ============================================================================== --- user/dchagin/lemul/sys/dev/usb/usbdevs Fri Nov 7 16:16:37 2014 (r274240) +++ user/dchagin/lemul/sys/dev/usb/usbdevs Fri Nov 7 16:22:58 2014 (r274241) @@ -3642,6 +3642,8 @@ product QUALCOMMINC E0086 0x0086 3G mode product QUALCOMMINC SURFSTICK 0x0117 1&1 Surf Stick product QUALCOMMINC K3772_Z_INIT 0x1179 K3772-Z Initial product QUALCOMMINC K3772_Z 0x1181 K3772-Z +product QUALCOMMINC MF195E_INIT 0x1514 MF195E initial +product QUALCOMMINC MF195E 0x1516 MF195E product QUALCOMMINC ZTE_STOR 0x2000 USB ZTE Storage product QUALCOMMINC E2002 0x2002 3G modem product QUALCOMMINC E2003 0x2003 3G modem Modified: user/dchagin/lemul/sys/net/bpf.c ============================================================================== --- user/dchagin/lemul/sys/net/bpf.c Fri Nov 7 16:16:37 2014 (r274240) +++ user/dchagin/lemul/sys/net/bpf.c Fri Nov 7 16:22:58 2014 (r274241) @@ -180,8 +180,8 @@ static SYSCTL_NODE(_net_bpf, OID_AUTO, s static VNET_DEFINE(int, bpf_optimize_writers) = 0; #define V_bpf_optimize_writers VNET(bpf_optimize_writers) -SYSCTL_VNET_INT(_net_bpf, OID_AUTO, optimize_writers, - CTLFLAG_RW, &VNET_NAME(bpf_optimize_writers), 0, +SYSCTL_INT(_net_bpf, OID_AUTO, optimize_writers, CTLFLAG_VNET | CTLFLAG_RW, + &VNET_NAME(bpf_optimize_writers), 0, "Do not send packets until BPF program is set"); static d_open_t bpfopen; Modified: user/dchagin/lemul/sys/net/flowtable.c ============================================================================== --- user/dchagin/lemul/sys/net/flowtable.c Fri Nov 7 16:16:37 2014 (r274240) +++ user/dchagin/lemul/sys/net/flowtable.c Fri Nov 7 16:22:58 2014 (r274241) @@ -171,7 +171,7 @@ static VNET_DEFINE(int, flowtable_enable static SYSCTL_NODE(_net, OID_AUTO, flowtable, CTLFLAG_RD, NULL, "flowtable"); -SYSCTL_VNET_INT(_net_flowtable, OID_AUTO, enable, CTLFLAG_RW, +SYSCTL_INT(_net_flowtable, OID_AUTO, enable, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(flowtable_enable), 0, "enable flowtable caching."); SYSCTL_UMA_MAX(_net_flowtable, OID_AUTO, maxflows, CTLFLAG_RW, &flow_zone, "Maximum number of flows allowed"); Modified: user/dchagin/lemul/sys/net/if.c ============================================================================== --- user/dchagin/lemul/sys/net/if.c Fri Nov 7 16:16:37 2014 (r274240) +++ user/dchagin/lemul/sys/net/if.c Fri Nov 7 16:22:58 2014 (r274241) @@ -99,10 +99,6 @@ #include #endif -struct ifindex_entry { - struct ifnet *ife_ifnet; -}; - SYSCTL_NODE(_net, PF_LINK, link, CTLFLAG_RW, 0, "Link layers"); SYSCTL_NODE(_net_link, 0, generic, CTLFLAG_RW, 0, "Generic link-management"); @@ -196,7 +192,7 @@ VNET_DEFINE(struct ifgrouphead, ifg_head static VNET_DEFINE(int, if_indexlim) = 8; /* Table of ifnet by index. */ -VNET_DEFINE(struct ifindex_entry *, ifindex_table); +VNET_DEFINE(struct ifnet **, ifindex_table); #define V_if_indexlim VNET(if_indexlim) #define V_ifindex_table VNET(ifindex_table) @@ -233,9 +229,9 @@ ifnet_byindex_locked(u_short idx) if (idx > V_if_index) return (NULL); - if (V_ifindex_table[idx].ife_ifnet == IFNET_HOLD) + if (V_ifindex_table[idx] == IFNET_HOLD) return (NULL); - return (V_ifindex_table[idx].ife_ifnet); + return (V_ifindex_table[idx]); } struct ifnet * @@ -282,7 +278,7 @@ retry: * next slot. */ for (idx = 1; idx <= V_if_index; idx++) { - if (V_ifindex_table[idx].ife_ifnet == NULL) + if (V_ifindex_table[idx] == NULL) break; } @@ -303,9 +299,9 @@ ifindex_free_locked(u_short idx) IFNET_WLOCK_ASSERT(); - V_ifindex_table[idx].ife_ifnet = NULL; + V_ifindex_table[idx] = NULL; while (V_if_index > 0 && - V_ifindex_table[V_if_index].ife_ifnet == NULL) + V_ifindex_table[V_if_index] == NULL) V_if_index--; } @@ -324,7 +320,7 @@ ifnet_setbyindex_locked(u_short idx, str IFNET_WLOCK_ASSERT(); - V_ifindex_table[idx].ife_ifnet = ifp; + V_ifindex_table[idx] = ifp; } static void @@ -402,7 +398,7 @@ if_grow(void) { int oldlim; u_int n; - struct ifindex_entry *e; + struct ifnet **e; IFNET_WLOCK_ASSERT(); oldlim = V_if_indexlim; @@ -2140,7 +2136,7 @@ do_link_state_change(void *arg, int pend (*vlan_link_state_p)(ifp); if ((ifp->if_type == IFT_ETHER || ifp->if_type == IFT_L2VLAN) && - IFP2AC(ifp)->ac_netgraph != NULL) + ifp->if_l2com != NULL) (*ng_ether_link_state_p)(ifp, link_state); if (ifp->if_carp) (*carp_linkstate_p)(ifp); Modified: user/dchagin/lemul/sys/net/if_arp.h ============================================================================== --- user/dchagin/lemul/sys/net/if_arp.h Fri Nov 7 16:16:37 2014 (r274240) +++ user/dchagin/lemul/sys/net/if_arp.h Fri Nov 7 16:22:58 2014 (r274241) @@ -97,20 +97,6 @@ struct arpreq { #define ATF_PUBL 0x08 /* publish entry (respond for other host) */ #define ATF_USETRAILERS 0x10 /* has requested trailers */ -#ifdef _KERNEL -/* - * Structure shared between the ethernet driver modules and - * the address resolution code. - */ -struct arpcom { - struct ifnet *ac_ifp; /* network-visible interface */ - void *ac_netgraph; /* ng_ether(4) netgraph node info */ -}; -#define IFP2AC(ifp) ((struct arpcom *)(ifp->if_l2com)) -#define AC2IFP(ac) ((ac)->ac_ifp) - -#endif /* _KERNEL */ - struct arpstat { /* Normal things that happen: */ uint64_t txrequests; /* # of ARP requests sent by this host. */ Modified: user/dchagin/lemul/sys/net/if_bridge.c ============================================================================== --- user/dchagin/lemul/sys/net/if_bridge.c Fri Nov 7 16:16:37 2014 (r274240) +++ user/dchagin/lemul/sys/net/if_bridge.c Fri Nov 7 16:22:58 2014 (r274241) @@ -111,7 +111,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include /* for struct arpcom */ +#include #include #include #include @@ -125,7 +125,7 @@ __FBSDID("$FreeBSD$"); #include #endif #include -#include /* for struct arpcom */ +#include #include #include #include @@ -406,8 +406,8 @@ SYSCTL_INT(_net_link_bridge, OID_AUTO, i static VNET_DEFINE(int, allow_llz_overlap) = 0; #define V_allow_llz_overlap VNET(allow_llz_overlap) -SYSCTL_VNET_INT(_net_link_bridge, OID_AUTO, allow_llz_overlap, - CTLFLAG_RW | CTLFLAG_VNET, &VNET_NAME(allow_llz_overlap), 0, +SYSCTL_INT(_net_link_bridge, OID_AUTO, allow_llz_overlap, + CTLFLAG_VNET | CTLFLAG_RW | CTLFLAG_VNET, &VNET_NAME(allow_llz_overlap), 0, "Allow overlap of link-local scope " "zones of a bridge interface and the member interfaces"); Modified: user/dchagin/lemul/sys/net/if_ethersubr.c ============================================================================== --- user/dchagin/lemul/sys/net/if_ethersubr.c Fri Nov 7 16:16:37 2014 (r274240) +++ user/dchagin/lemul/sys/net/if_ethersubr.c Fri Nov 7 16:22:58 2014 (r274241) @@ -119,9 +119,6 @@ static int ether_resolvemulti(struct ifn static void ether_reassign(struct ifnet *, struct vnet *, char *); #endif -/* XXX: should be in an arp support file, not here */ -static MALLOC_DEFINE(M_ARPCOM, "arpcom", "802.* interface internals"); - #define ETHER_IS_BROADCAST(addr) \ (bcmp(etherbroadcastaddr, (addr), ETHER_ADDR_LEN) == 0) @@ -330,7 +327,7 @@ ether_output(struct ifnet *ifp, struct m #endif /* Handle ng_ether(4) processing, if any */ - if (IFP2AC(ifp)->ac_netgraph != NULL) { + if (ifp->if_l2com != NULL) { KASSERT(ng_ether_output_p != NULL, ("ng_ether_output_p is NULL")); if ((error = (*ng_ether_output_p)(ifp, &m)) != 0) { @@ -521,7 +518,7 @@ ether_input_internal(struct ifnet *ifp, M_SETFIB(m, ifp->if_fib); /* Allow ng_ether(4) to claim this frame. */ - if (IFP2AC(ifp)->ac_netgraph != NULL) { + if (ifp->if_l2com != NULL) { KASSERT(ng_ether_input_p != NULL, ("%s: ng_ether_input_p is NULL", __func__)); m->m_flags &= ~M_PROMISC; @@ -780,7 +777,7 @@ discard: * hand the packet to it for last chance processing; * otherwise dispose of it. */ - if (IFP2AC(ifp)->ac_netgraph != NULL) { + if (ifp->if_l2com != NULL) { KASSERT(ng_ether_input_orphan_p != NULL, ("ng_ether_input_orphan_p is NULL")); /* @@ -866,7 +863,7 @@ ether_ifdetach(struct ifnet *ifp) sdl = (struct sockaddr_dl *)(ifp->if_addr->ifa_addr); uuid_ether_del(LLADDR(sdl)); - if (IFP2AC(ifp)->ac_netgraph != NULL) { + if (ifp->if_l2com != NULL) { KASSERT(ng_ether_detach_p != NULL, ("ng_ether_detach_p is NULL")); (*ng_ether_detach_p)(ifp); @@ -881,7 +878,7 @@ void ether_reassign(struct ifnet *ifp, struct vnet *new_vnet, char *unused __unused) { - if (IFP2AC(ifp)->ac_netgraph != NULL) { + if (ifp->if_l2com != NULL) { KASSERT(ng_ether_detach_p != NULL, ("ng_ether_detach_p is NULL")); (*ng_ether_detach_p)(ifp); @@ -1092,46 +1089,8 @@ ether_resolvemulti(struct ifnet *ifp, st } } -static void* -ether_alloc(u_char type, struct ifnet *ifp) -{ - struct arpcom *ac; - - ac = malloc(sizeof(struct arpcom), M_ARPCOM, M_WAITOK | M_ZERO); - ac->ac_ifp = ifp; - - return (ac); -} - -static void -ether_free(void *com, u_char type) -{ - - free(com, M_ARPCOM); -} - -static int -ether_modevent(module_t mod, int type, void *data) -{ - - switch (type) { - case MOD_LOAD: - if_register_com_alloc(IFT_ETHER, ether_alloc, ether_free); - break; - case MOD_UNLOAD: - if_deregister_com_alloc(IFT_ETHER); - break; - default: - return EOPNOTSUPP; - } - - return (0); -} - static moduledata_t ether_mod = { - "ether", - ether_modevent, - 0 + .name = "ether", }; void Modified: user/dchagin/lemul/sys/net/if_fddisubr.c ============================================================================== --- user/dchagin/lemul/sys/net/if_fddisubr.c Fri Nov 7 16:16:37 2014 (r274240) +++ user/dchagin/lemul/sys/net/if_fddisubr.c Fri Nov 7 16:22:58 2014 (r274241) @@ -92,7 +92,6 @@ static void fddi_input(struct ifnet *ifp * Encapsulate a packet of type family for the local net. * Use trailer local net encapsulation if enough data in first * packet leaves a multiple of 512 bytes of data in remainder. - * Assumes that ifp is actually pointer to arpcom structure. */ static int fddi_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, Modified: user/dchagin/lemul/sys/net/if_gif.c ============================================================================== --- user/dchagin/lemul/sys/net/if_gif.c Fri Nov 7 16:16:37 2014 (r274240) +++ user/dchagin/lemul/sys/net/if_gif.c Fri Nov 7 16:22:58 2014 (r274241) @@ -149,7 +149,7 @@ static SYSCTL_NODE(_net_link, IFT_GIF, g #endif static VNET_DEFINE(int, max_gif_nesting) = MAX_GIF_NEST; #define V_max_gif_nesting VNET(max_gif_nesting) -SYSCTL_VNET_INT(_net_link_gif, OID_AUTO, max_nesting, CTLFLAG_RW, +SYSCTL_INT(_net_link_gif, OID_AUTO, max_nesting, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(max_gif_nesting), 0, "Max nested tunnels"); /* @@ -163,8 +163,9 @@ static VNET_DEFINE(int, parallel_tunnels static VNET_DEFINE(int, parallel_tunnels) = 0; #endif #define V_parallel_tunnels VNET(parallel_tunnels) -SYSCTL_VNET_INT(_net_link_gif, OID_AUTO, parallel_tunnels, CTLFLAG_RW, - &VNET_NAME(parallel_tunnels), 0, "Allow parallel tunnels?"); +SYSCTL_INT(_net_link_gif, OID_AUTO, parallel_tunnels, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(parallel_tunnels), 0, + "Allow parallel tunnels?"); /* copy from src/sys/net/if_ethersubr.c */ static const u_char etherbroadcastaddr[ETHER_ADDR_LEN] = Modified: user/dchagin/lemul/sys/net/if_iso88025subr.c ============================================================================== --- user/dchagin/lemul/sys/net/if_iso88025subr.c Fri Nov 7 16:16:37 2014 (r274240) +++ user/dchagin/lemul/sys/net/if_iso88025subr.c Fri Nov 7 16:22:58 2014 (r274241) @@ -562,7 +562,6 @@ iso88025_input(ifp, m) case LLC_TEST_P: { struct sockaddr sa; - struct arpcom *ac; struct iso88025_sockaddr_data *th2; int i; u_char c; @@ -695,49 +694,8 @@ iso88025_resolvemulti (ifp, llsa, sa) return (0); } -static MALLOC_DEFINE(M_ISO88025, "arpcom", "802.5 interface internals"); - -static void* -iso88025_alloc(u_char type, struct ifnet *ifp) -{ - struct arpcom *ac; - - ac = malloc(sizeof(struct arpcom), M_ISO88025, M_WAITOK | M_ZERO); - ac->ac_ifp = ifp; - - return (ac); -} - -static void -iso88025_free(void *com, u_char type) -{ - - free(com, M_ISO88025); -} - -static int -iso88025_modevent(module_t mod, int type, void *data) -{ - - switch (type) { - case MOD_LOAD: - if_register_com_alloc(IFT_ISO88025, iso88025_alloc, - iso88025_free); - break; - case MOD_UNLOAD: - if_deregister_com_alloc(IFT_ISO88025); - break; - default: - return EOPNOTSUPP; - } - - return (0); -} - static moduledata_t iso88025_mod = { - "iso88025", - iso88025_modevent, - 0 + .name = "iso88025", }; DECLARE_MODULE(iso88025, iso88025_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); Modified: user/dchagin/lemul/sys/net/if_mib.c ============================================================================== --- user/dchagin/lemul/sys/net/if_mib.c Fri Nov 7 16:16:37 2014 (r274240) +++ user/dchagin/lemul/sys/net/if_mib.c Fri Nov 7 16:22:58 2014 (r274241) @@ -67,9 +67,9 @@ SYSCTL_DECL(_net_link_generic); static SYSCTL_NODE(_net_link_generic, IFMIB_SYSTEM, system, CTLFLAG_RW, 0, "Variables global to all interfaces"); -SYSCTL_VNET_INT(_net_link_generic_system, IFMIB_IFCOUNT, ifcount, CTLFLAG_RD, - &VNET_NAME(if_index), 0, - "Number of configured interfaces"); +SYSCTL_INT(_net_link_generic_system, IFMIB_IFCOUNT, ifcount, + CTLFLAG_VNET | CTLFLAG_RD, &VNET_NAME(if_index), 0, + "Number of configured interfaces"); static int sysctl_ifdata(SYSCTL_HANDLER_ARGS) /* XXX bad syntax! */ Modified: user/dchagin/lemul/sys/net/vnet.h ============================================================================== --- user/dchagin/lemul/sys/net/vnet.h Fri Nov 7 16:16:37 2014 (r274240) +++ user/dchagin/lemul/sys/net/vnet.h Fri Nov 7 16:22:58 2014 (r274241) @@ -119,6 +119,7 @@ vnet_##name##_uninit(const void *unused) VNET_SYSUNINIT(vnet_ ## name ## _uninit, SI_SUB_PROTO_IFATTACHDOMAIN, \ SI_ORDER_ANY, vnet_ ## name ## _uninit, NULL) +#ifdef SYSCTL_OID #define SYSCTL_VNET_PCPUSTAT(parent, nbr, name, type, array, desc) \ static int \ array##_sysctl(SYSCTL_HANDLER_ARGS) \ @@ -132,8 +133,9 @@ array##_sysctl(SYSCTL_HANDLER_ARGS) sizeof(type) / sizeof(uint64_t)); \ return (SYSCTL_OUT(req, &s, sizeof(type))); \ } \ -SYSCTL_VNET_PROC(parent, nbr, name, CTLTYPE_OPAQUE | CTLFLAG_RW, NULL, \ - 0, array ## _sysctl, "I", desc) +SYSCTL_PROC(parent, nbr, name, CTLFLAG_VNET | CTLTYPE_OPAQUE | CTLFLAG_RW, \ + NULL, 0, array ## _sysctl, "I", desc) +#endif /* SYSCTL_OID */ #ifdef VIMAGE #include @@ -283,48 +285,6 @@ void vnet_data_copy(void *start, int si void vnet_data_free(void *start_arg, int size); /* - * Sysctl variants for vnet-virtualized global variables. Include - * to expose these definitions. - * - * Note: SYSCTL_PROC() handler functions will need to resolve pointer - * arguments themselves, if required. - */ -#ifdef SYSCTL_OID -#define SYSCTL_VNET_INT(parent, nbr, name, access, ptr, val, descr) \ - SYSCTL_OID(parent, nbr, name, \ - CTLTYPE_INT|CTLFLAG_MPSAFE|CTLFLAG_VNET|(access), \ - ptr, val, sysctl_handle_int, "I", descr) -#define SYSCTL_VNET_PROC(parent, nbr, name, access, ptr, arg, handler, \ - fmt, descr) \ - CTASSERT(((access) & CTLTYPE) != 0); \ - SYSCTL_OID(parent, nbr, name, CTLFLAG_VNET|(access), ptr, arg, \ - handler, fmt, descr) -#define SYSCTL_VNET_OPAQUE(parent, nbr, name, access, ptr, len, fmt, \ - descr) \ - SYSCTL_OID(parent, nbr, name, \ - CTLTYPE_OPAQUE|CTLFLAG_VNET|(access), ptr, len, \ - sysctl_handle_opaque, fmt, descr) -#define SYSCTL_VNET_STRING(parent, nbr, name, access, arg, len, descr) \ - SYSCTL_OID(parent, nbr, name, \ - CTLTYPE_STRING|CTLFLAG_VNET|(access), \ - arg, len, sysctl_handle_string, "A", descr) -#define SYSCTL_VNET_STRUCT(parent, nbr, name, access, ptr, type, descr) \ - SYSCTL_OID(parent, nbr, name, \ - CTLTYPE_OPAQUE|CTLFLAG_VNET|(access), ptr, \ - sizeof(struct type), sysctl_handle_opaque, "S," #type, \ - descr) -#define SYSCTL_VNET_UINT(parent, nbr, name, access, ptr, val, descr) \ - SYSCTL_OID(parent, nbr, name, \ - CTLTYPE_UINT|CTLFLAG_MPSAFE|CTLFLAG_VNET|(access), \ - ptr, val, sysctl_handle_int, "IU", descr) -#define VNET_SYSCTL_ARG(req, arg1) do { \ - if (arg1 != NULL) \ - arg1 = (void *)(TD_TO_VNET((req)->td)->vnet_data_base + \ - (uintptr_t)(arg1)); \ -} while (0) -#endif /* SYSCTL_OID */ - -/* * Virtual sysinit mechanism, allowing network stack components to declare * startup and shutdown methods to be run when virtual network stack * instances are created and destroyed. @@ -447,29 +407,6 @@ do { \ #define VNET(n) (n) /* - * When VIMAGE isn't compiled into the kernel, virtaulized SYSCTLs simply - * become normal SYSCTLs. - */ -#ifdef SYSCTL_OID -#define SYSCTL_VNET_INT(parent, nbr, name, access, ptr, val, descr) \ - SYSCTL_INT(parent, nbr, name, access, ptr, val, descr) -#define SYSCTL_VNET_PROC(parent, nbr, name, access, ptr, arg, handler, \ - fmt, descr) \ - SYSCTL_PROC(parent, nbr, name, access, ptr, arg, handler, fmt, \ - descr) -#define SYSCTL_VNET_OPAQUE(parent, nbr, name, access, ptr, len, fmt, \ - descr) \ - SYSCTL_OPAQUE(parent, nbr, name, access, ptr, len, fmt, descr) -#define SYSCTL_VNET_STRING(parent, nbr, name, access, arg, len, descr) \ - SYSCTL_STRING(parent, nbr, name, access, arg, len, descr) -#define SYSCTL_VNET_STRUCT(parent, nbr, name, access, ptr, type, descr) \ - SYSCTL_STRUCT(parent, nbr, name, access, ptr, type, descr) -#define SYSCTL_VNET_UINT(parent, nbr, name, access, ptr, val, descr) \ - SYSCTL_UINT(parent, nbr, name, access, ptr, val, descr) -#define VNET_SYSCTL_ARG(req, arg1) -#endif /* SYSCTL_OID */ - -/* * When VIMAGE isn't compiled into the kernel, VNET_SYSINIT/VNET_SYSUNINIT * map into normal sysinits, which have the same ordering properties. */ Modified: user/dchagin/lemul/sys/netgraph/ng_ether.c ============================================================================== --- user/dchagin/lemul/sys/netgraph/ng_ether.c Fri Nov 7 16:16:37 2014 (r274240) +++ user/dchagin/lemul/sys/netgraph/ng_ether.c Fri Nov 7 16:22:58 2014 (r274241) @@ -74,7 +74,7 @@ MODULE_VERSION(ng_ether, 1); -#define IFP2NG(ifp) (IFP2AC((ifp))->ac_netgraph) +#define IFP2NG(ifp) ((ifp)->if_l2com) /* Per-node private data */ struct private { Modified: user/dchagin/lemul/sys/netinet/cc/cc.c ============================================================================== --- user/dchagin/lemul/sys/netinet/cc/cc.c Fri Nov 7 16:16:37 2014 (r274240) +++ user/dchagin/lemul/sys/netinet/cc/cc.c Fri Nov 7 16:22:58 2014 (r274241) @@ -318,7 +318,8 @@ SYSINIT(cc, SI_SUB_PROTO_IFATTACHDOMAIN, SYSCTL_NODE(_net_inet_tcp, OID_AUTO, cc, CTLFLAG_RW, NULL, "congestion control related settings"); -SYSCTL_VNET_PROC(_net_inet_tcp_cc, OID_AUTO, algorithm, CTLTYPE_STRING|CTLFLAG_RW, +SYSCTL_PROC(_net_inet_tcp_cc, OID_AUTO, algorithm, + CTLFLAG_VNET | CTLTYPE_STRING | CTLFLAG_RW, NULL, 0, cc_default_algo, "A", "default congestion control algorithm"); SYSCTL_PROC(_net_inet_tcp_cc, OID_AUTO, available, CTLTYPE_STRING|CTLFLAG_RD, Modified: user/dchagin/lemul/sys/netinet/cc/cc_cdg.c ============================================================================== --- user/dchagin/lemul/sys/netinet/cc/cc_cdg.c Fri Nov 7 16:16:37 2014 (r274240) +++ user/dchagin/lemul/sys/netinet/cc/cc_cdg.c Fri Nov 7 16:22:58 2014 (r274241) @@ -659,39 +659,39 @@ SYSCTL_STRING(_net_inet_tcp_cc_cdg, OID_ CTLFLAG_RD, CDG_VERSION, sizeof(CDG_VERSION) - 1, "Current algorithm/implementation version number"); -SYSCTL_VNET_UINT(_net_inet_tcp_cc_cdg, OID_AUTO, alpha_inc, - CTLFLAG_RW, &VNET_NAME(cdg_alpha_inc), 0, +SYSCTL_UINT(_net_inet_tcp_cc_cdg, OID_AUTO, alpha_inc, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(cdg_alpha_inc), 0, "Increment the window increase factor alpha by 1 MSS segment every " "alpha_inc RTTs during congestion avoidance mode."); -SYSCTL_VNET_PROC(_net_inet_tcp_cc_cdg, OID_AUTO, beta_delay, - CTLTYPE_UINT|CTLFLAG_RW, &VNET_NAME(cdg_beta_delay), 70, +SYSCTL_PROC(_net_inet_tcp_cc_cdg, OID_AUTO, beta_delay, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, &VNET_NAME(cdg_beta_delay), 70, &cdg_beta_handler, "IU", "Delay-based window decrease factor as a percentage " "(on delay-based backoff, w = w * beta_delay / 100)"); -SYSCTL_VNET_PROC(_net_inet_tcp_cc_cdg, OID_AUTO, beta_loss, - CTLTYPE_UINT|CTLFLAG_RW, &VNET_NAME(cdg_beta_loss), 50, +SYSCTL_PROC(_net_inet_tcp_cc_cdg, OID_AUTO, beta_loss, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, &VNET_NAME(cdg_beta_loss), 50, &cdg_beta_handler, "IU", "Loss-based window decrease factor as a percentage " "(on loss-based backoff, w = w * beta_loss / 100)"); -SYSCTL_VNET_PROC(_net_inet_tcp_cc_cdg, OID_AUTO, exp_backoff_scale, - CTLTYPE_UINT|CTLFLAG_RW, &VNET_NAME(cdg_exp_backoff_scale), 2, - &cdg_exp_backoff_scale_handler, "IU", +SYSCTL_PROC(_net_inet_tcp_cc_cdg, OID_AUTO, exp_backoff_scale, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, + &VNET_NAME(cdg_exp_backoff_scale), 2, &cdg_exp_backoff_scale_handler, "IU", "Scaling parameter for the probabilistic exponential backoff"); -SYSCTL_VNET_UINT(_net_inet_tcp_cc_cdg, OID_AUTO, smoothing_factor, - CTLFLAG_RW, &VNET_NAME(cdg_smoothing_factor), 8, +SYSCTL_UINT(_net_inet_tcp_cc_cdg, OID_AUTO, smoothing_factor, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(cdg_smoothing_factor), 8, "Number of samples used for moving average smoothing (0 = no smoothing)"); -SYSCTL_VNET_UINT(_net_inet_tcp_cc_cdg, OID_AUTO, loss_compete_consec_cong, - CTLFLAG_RW, &VNET_NAME(cdg_consec_cong), 5, +SYSCTL_UINT(_net_inet_tcp_cc_cdg, OID_AUTO, loss_compete_consec_cong, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(cdg_consec_cong), 5, "Number of consecutive delay-gradient based congestion episodes which will " "trigger loss based CC compatibility"); -SYSCTL_VNET_UINT(_net_inet_tcp_cc_cdg, OID_AUTO, loss_compete_hold_backoff, - CTLFLAG_RW, &VNET_NAME(cdg_hold_backoff), 5, +SYSCTL_UINT(_net_inet_tcp_cc_cdg, OID_AUTO, loss_compete_hold_backoff, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(cdg_hold_backoff), 5, "Number of consecutive delay-gradient based congestion episodes to hold " "the window backoff for loss based CC compatibility"); Modified: user/dchagin/lemul/sys/netinet/cc/cc_chd.c ============================================================================== --- user/dchagin/lemul/sys/netinet/cc/cc_chd.c Fri Nov 7 16:16:37 2014 (r274240) +++ user/dchagin/lemul/sys/netinet/cc/cc_chd.c Fri Nov 7 16:22:58 2014 (r274241) @@ -471,24 +471,27 @@ SYSCTL_DECL(_net_inet_tcp_cc_chd); SYSCTL_NODE(_net_inet_tcp_cc, OID_AUTO, chd, CTLFLAG_RW, NULL, "CAIA Hamilton delay-based congestion control related settings"); -SYSCTL_VNET_PROC(_net_inet_tcp_cc_chd, OID_AUTO, loss_fair, - CTLTYPE_UINT|CTLFLAG_RW, &VNET_NAME(chd_loss_fair), 1, &chd_loss_fair_handler, +SYSCTL_PROC(_net_inet_tcp_cc_chd, OID_AUTO, loss_fair, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, + &VNET_NAME(chd_loss_fair), 1, &chd_loss_fair_handler, "IU", "Flag to enable shadow window functionality."); -SYSCTL_VNET_PROC(_net_inet_tcp_cc_chd, OID_AUTO, pmax, - CTLTYPE_UINT|CTLFLAG_RW, &VNET_NAME(chd_pmax), 5, &chd_pmax_handler, +SYSCTL_PROC(_net_inet_tcp_cc_chd, OID_AUTO, pmax, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, + &VNET_NAME(chd_pmax), 5, &chd_pmax_handler, "IU", "Per RTT maximum backoff probability as a percentage"); -SYSCTL_VNET_PROC(_net_inet_tcp_cc_chd, OID_AUTO, queue_threshold, - CTLTYPE_UINT|CTLFLAG_RW, &VNET_NAME(chd_qthresh), 20, &chd_qthresh_handler, +SYSCTL_PROC(_net_inet_tcp_cc_chd, OID_AUTO, queue_threshold, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, + &VNET_NAME(chd_qthresh), 20, &chd_qthresh_handler, "IU", "Queueing congestion threshold in ticks"); -SYSCTL_VNET_UINT(_net_inet_tcp_cc_chd, OID_AUTO, queue_min, - CTLFLAG_RW, &VNET_NAME(chd_qmin), 5, +SYSCTL_UINT(_net_inet_tcp_cc_chd, OID_AUTO, queue_min, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(chd_qmin), 5, "Minimum queueing delay threshold in ticks"); -SYSCTL_VNET_UINT(_net_inet_tcp_cc_chd, OID_AUTO, use_max, - CTLFLAG_RW, &VNET_NAME(chd_use_max), 1, +SYSCTL_UINT(_net_inet_tcp_cc_chd, OID_AUTO, use_max, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(chd_use_max), 1, "Use the maximum RTT seen within the measurement period (RTT) " "as the basic delay measurement for the algorithm."); Modified: user/dchagin/lemul/sys/netinet/cc/cc_hd.c ============================================================================== --- user/dchagin/lemul/sys/netinet/cc/cc_hd.c Fri Nov 7 16:16:37 2014 (r274240) +++ user/dchagin/lemul/sys/netinet/cc/cc_hd.c Fri Nov 7 16:22:58 2014 (r274241) @@ -238,17 +238,18 @@ SYSCTL_DECL(_net_inet_tcp_cc_hd); SYSCTL_NODE(_net_inet_tcp_cc, OID_AUTO, hd, CTLFLAG_RW, NULL, "Hamilton delay-based congestion control related settings"); -SYSCTL_VNET_PROC(_net_inet_tcp_cc_hd, OID_AUTO, queue_threshold, - CTLTYPE_UINT|CTLFLAG_RW, &VNET_NAME(hd_qthresh), 20, &hd_qthresh_handler, - "IU", "queueing congestion threshold (qth) in ticks"); +SYSCTL_PROC(_net_inet_tcp_cc_hd, OID_AUTO, queue_threshold, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, &VNET_NAME(hd_qthresh), 20, + &hd_qthresh_handler, "IU", "queueing congestion threshold (qth) in ticks"); -SYSCTL_VNET_PROC(_net_inet_tcp_cc_hd, OID_AUTO, pmax, - CTLTYPE_UINT|CTLFLAG_RW, &VNET_NAME(hd_pmax), 5, &hd_pmax_handler, - "IU", "per packet maximum backoff probability as a percentage"); +SYSCTL_PROC(_net_inet_tcp_cc_hd, OID_AUTO, pmax, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, &VNET_NAME(hd_pmax), 5, + &hd_pmax_handler, "IU", + "per packet maximum backoff probability as a percentage"); -SYSCTL_VNET_PROC(_net_inet_tcp_cc_hd, OID_AUTO, queue_min, - CTLTYPE_UINT|CTLFLAG_RW, &VNET_NAME(hd_qmin), 5, &hd_qmin_handler, - "IU", "minimum queueing delay threshold (qmin) in ticks"); +SYSCTL_PROC(_net_inet_tcp_cc_hd, OID_AUTO, queue_min, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, &VNET_NAME(hd_qmin), 5, + &hd_qmin_handler, "IU", "minimum queueing delay threshold (qmin) in ticks"); DECLARE_CC_MODULE(hd, &hd_cc_algo); MODULE_DEPEND(hd, ertt, 1, 1, 1); Modified: user/dchagin/lemul/sys/netinet/cc/cc_htcp.c ============================================================================== --- user/dchagin/lemul/sys/netinet/cc/cc_htcp.c Fri Nov 7 16:16:37 2014 (r274240) +++ user/dchagin/lemul/sys/netinet/cc/cc_htcp.c Fri Nov 7 16:22:58 2014 (r274241) @@ -512,9 +512,11 @@ htcp_ssthresh_update(struct cc_var *ccv) SYSCTL_DECL(_net_inet_tcp_cc_htcp); SYSCTL_NODE(_net_inet_tcp_cc, OID_AUTO, htcp, CTLFLAG_RW, NULL, "H-TCP related settings"); -SYSCTL_VNET_UINT(_net_inet_tcp_cc_htcp, OID_AUTO, adaptive_backoff, CTLFLAG_RW, - &VNET_NAME(htcp_adaptive_backoff), 0, "enable H-TCP adaptive backoff"); -SYSCTL_VNET_UINT(_net_inet_tcp_cc_htcp, OID_AUTO, rtt_scaling, CTLFLAG_RW, - &VNET_NAME(htcp_rtt_scaling), 0, "enable H-TCP RTT scaling"); +SYSCTL_UINT(_net_inet_tcp_cc_htcp, OID_AUTO, adaptive_backoff, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(htcp_adaptive_backoff), 0, + "enable H-TCP adaptive backoff"); +SYSCTL_UINT(_net_inet_tcp_cc_htcp, OID_AUTO, rtt_scaling, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(htcp_rtt_scaling), 0, + "enable H-TCP RTT scaling"); DECLARE_CC_MODULE(htcp, &htcp_cc_algo); Modified: user/dchagin/lemul/sys/netinet/cc/cc_vegas.c ============================================================================== --- user/dchagin/lemul/sys/netinet/cc/cc_vegas.c Fri Nov 7 16:16:37 2014 (r274240) +++ user/dchagin/lemul/sys/netinet/cc/cc_vegas.c Fri Nov 7 16:22:58 2014 (r274241) @@ -295,13 +295,15 @@ SYSCTL_DECL(_net_inet_tcp_cc_vegas); SYSCTL_NODE(_net_inet_tcp_cc, OID_AUTO, vegas, CTLFLAG_RW, NULL, "Vegas related settings"); -SYSCTL_VNET_PROC(_net_inet_tcp_cc_vegas, OID_AUTO, alpha, - CTLTYPE_UINT|CTLFLAG_RW, &VNET_NAME(vegas_alpha), 1, &vegas_alpha_handler, - "IU", "vegas alpha, specified as number of \"buffers\" (0 < alpha < beta)"); +SYSCTL_PROC(_net_inet_tcp_cc_vegas, OID_AUTO, alpha, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, + &VNET_NAME(vegas_alpha), 1, &vegas_alpha_handler, "IU", + "vegas alpha, specified as number of \"buffers\" (0 < alpha < beta)"); -SYSCTL_VNET_PROC(_net_inet_tcp_cc_vegas, OID_AUTO, beta, - CTLTYPE_UINT|CTLFLAG_RW, &VNET_NAME(vegas_beta), 3, &vegas_beta_handler, - "IU", "vegas beta, specified as number of \"buffers\" (0 < alpha < beta)"); +SYSCTL_PROC(_net_inet_tcp_cc_vegas, OID_AUTO, beta, + CTLFLAG_VNET | CTLTYPE_UINT | CTLFLAG_RW, + &VNET_NAME(vegas_beta), 3, &vegas_beta_handler, "IU", + "vegas beta, specified as number of \"buffers\" (0 < alpha < beta)"); DECLARE_CC_MODULE(vegas, &vegas_cc_algo); MODULE_DEPEND(vegas, ertt, 1, 1, 1); Modified: user/dchagin/lemul/sys/netinet/if_ether.c ============================================================================== --- user/dchagin/lemul/sys/netinet/if_ether.c Fri Nov 7 16:16:37 2014 (r274240) +++ user/dchagin/lemul/sys/netinet/if_ether.c Fri Nov 7 16:22:58 2014 (r274241) @@ -103,21 +103,21 @@ static VNET_DEFINE(int, arp_maxhold) = 1 #define V_arp_proxyall VNET(arp_proxyall) #define V_arp_maxhold VNET(arp_maxhold) -SYSCTL_VNET_INT(_net_link_ether_inet, OID_AUTO, max_age, CTLFLAG_RW, +SYSCTL_INT(_net_link_ether_inet, OID_AUTO, max_age, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(arpt_keep), 0, "ARP entry lifetime in seconds"); -SYSCTL_VNET_INT(_net_link_ether_inet, OID_AUTO, maxtries, CTLFLAG_RW, +SYSCTL_INT(_net_link_ether_inet, OID_AUTO, maxtries, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(arp_maxtries), 0, "ARP resolution attempts before returning error"); -SYSCTL_VNET_INT(_net_link_ether_inet, OID_AUTO, proxyall, CTLFLAG_RW, +SYSCTL_INT(_net_link_ether_inet, OID_AUTO, proxyall, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(arp_proxyall), 0, "Enable proxy ARP for all suitable requests"); -SYSCTL_VNET_INT(_net_link_ether_inet, OID_AUTO, wait, CTLFLAG_RW, +SYSCTL_INT(_net_link_ether_inet, OID_AUTO, wait, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(arpt_down), 0, "Incomplete ARP entry lifetime in seconds"); SYSCTL_VNET_PCPUSTAT(_net_link_ether_arp, OID_AUTO, stats, struct arpstat, arpstat, "ARP statistics (struct arpstat, net/if_arp.h)"); -SYSCTL_VNET_INT(_net_link_ether_inet, OID_AUTO, maxhold, CTLFLAG_RW, +SYSCTL_INT(_net_link_ether_inet, OID_AUTO, maxhold, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(arp_maxhold), 0, "Number of packets to hold per ARP entry"); Modified: user/dchagin/lemul/sys/netinet/igmp.c ============================================================================== --- user/dchagin/lemul/sys/netinet/igmp.c Fri Nov 7 16:16:37 2014 (r274240) +++ user/dchagin/lemul/sys/netinet/igmp.c Fri Nov 7 16:22:58 2014 (r274241) @@ -249,32 +249,32 @@ static VNET_DEFINE(int, igmp_default_ver /* * Virtualized sysctls. */ -SYSCTL_VNET_STRUCT(_net_inet_igmp, IGMPCTL_STATS, stats, CTLFLAG_RW, +SYSCTL_STRUCT(_net_inet_igmp, IGMPCTL_STATS, stats, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(igmpstat), igmpstat, ""); -SYSCTL_VNET_INT(_net_inet_igmp, OID_AUTO, recvifkludge, CTLFLAG_RW, +SYSCTL_INT(_net_inet_igmp, OID_AUTO, recvifkludge, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(igmp_recvifkludge), 0, "Rewrite IGMPv1/v2 reports from 0.0.0.0 to contain subnet address"); -SYSCTL_VNET_INT(_net_inet_igmp, OID_AUTO, sendra, CTLFLAG_RW, +SYSCTL_INT(_net_inet_igmp, OID_AUTO, sendra, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(igmp_sendra), 0, "Send IP Router Alert option in IGMPv2/v3 messages"); -SYSCTL_VNET_INT(_net_inet_igmp, OID_AUTO, sendlocal, CTLFLAG_RW, +SYSCTL_INT(_net_inet_igmp, OID_AUTO, sendlocal, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(igmp_sendlocal), 0, "Send IGMP membership reports for 224.0.0.0/24 groups"); -SYSCTL_VNET_INT(_net_inet_igmp, OID_AUTO, v1enable, CTLFLAG_RW, +SYSCTL_INT(_net_inet_igmp, OID_AUTO, v1enable, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(igmp_v1enable), 0, "Enable backwards compatibility with IGMPv1"); -SYSCTL_VNET_INT(_net_inet_igmp, OID_AUTO, v2enable, CTLFLAG_RW, +SYSCTL_INT(_net_inet_igmp, OID_AUTO, v2enable, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(igmp_v2enable), 0, "Enable backwards compatibility with IGMPv2"); -SYSCTL_VNET_INT(_net_inet_igmp, OID_AUTO, legacysupp, CTLFLAG_RW, +SYSCTL_INT(_net_inet_igmp, OID_AUTO, legacysupp, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(igmp_legacysupp), 0, "Allow v1/v2 reports to suppress v3 group responses"); -SYSCTL_VNET_PROC(_net_inet_igmp, OID_AUTO, default_version, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, +SYSCTL_PROC(_net_inet_igmp, OID_AUTO, default_version, + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, &VNET_NAME(igmp_default_version), 0, sysctl_igmp_default_version, "I", "Default version of IGMP to run on each interface"); -SYSCTL_VNET_PROC(_net_inet_igmp, OID_AUTO, gsrdelay, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, +SYSCTL_PROC(_net_inet_igmp, OID_AUTO, gsrdelay, + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, &VNET_NAME(igmp_gsrdelay.tv_sec), 0, sysctl_igmp_gsr, "I", "Rate limit for IGMPv3 Group-and-Source queries in seconds"); Modified: user/dchagin/lemul/sys/netinet/in.c ============================================================================== --- user/dchagin/lemul/sys/netinet/in.c Fri Nov 7 16:16:37 2014 (r274240) +++ user/dchagin/lemul/sys/netinet/in.c Fri Nov 7 16:22:58 2014 (r274241) @@ -76,7 +76,7 @@ static void in_purgemaddrs(struct ifnet static VNET_DEFINE(int, nosameprefix); #define V_nosameprefix VNET(nosameprefix) -SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, no_same_prefix, CTLFLAG_RW, +SYSCTL_INT(_net_inet_ip, OID_AUTO, no_same_prefix, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nosameprefix), 0, "Refuse to create same prefixes on different interfaces"); Modified: user/dchagin/lemul/sys/netinet/in_gif.c ============================================================================== --- user/dchagin/lemul/sys/netinet/in_gif.c Fri Nov 7 16:16:37 2014 (r274240) +++ user/dchagin/lemul/sys/netinet/in_gif.c Fri Nov 7 16:22:58 2014 (r274241) @@ -85,7 +85,7 @@ struct protosw in_gif_protosw = { VNET_DEFINE(int, ip_gif_ttl) = GIF_TTL; #define V_ip_gif_ttl VNET(ip_gif_ttl) -SYSCTL_VNET_INT(_net_inet_ip, IPCTL_GIF_TTL, gifttl, CTLFLAG_RW, +SYSCTL_INT(_net_inet_ip, IPCTL_GIF_TTL, gifttl, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip_gif_ttl), 0, ""); int Modified: user/dchagin/lemul/sys/netinet/in_pcb.c ============================================================================== --- user/dchagin/lemul/sys/netinet/in_pcb.c Fri Nov 7 16:16:37 2014 (r274240) +++ user/dchagin/lemul/sys/netinet/in_pcb.c Fri Nov 7 16:22:58 2014 (r274241) @@ -164,34 +164,38 @@ sysctl_net_ipport_check(SYSCTL_HANDLER_A static SYSCTL_NODE(_net_inet_ip, IPPROTO_IP, portrange, CTLFLAG_RW, 0, "IP Ports"); -SYSCTL_VNET_PROC(_net_inet_ip_portrange, OID_AUTO, lowfirst, - CTLTYPE_INT|CTLFLAG_RW, &VNET_NAME(ipport_lowfirstauto), 0, - &sysctl_net_ipport_check, "I", ""); -SYSCTL_VNET_PROC(_net_inet_ip_portrange, OID_AUTO, lowlast, - CTLTYPE_INT|CTLFLAG_RW, &VNET_NAME(ipport_lowlastauto), 0, - &sysctl_net_ipport_check, "I", ""); -SYSCTL_VNET_PROC(_net_inet_ip_portrange, OID_AUTO, first, - CTLTYPE_INT|CTLFLAG_RW, &VNET_NAME(ipport_firstauto), 0, - &sysctl_net_ipport_check, "I", ""); -SYSCTL_VNET_PROC(_net_inet_ip_portrange, OID_AUTO, last, - CTLTYPE_INT|CTLFLAG_RW, &VNET_NAME(ipport_lastauto), 0, - &sysctl_net_ipport_check, "I", ""); -SYSCTL_VNET_PROC(_net_inet_ip_portrange, OID_AUTO, hifirst, - CTLTYPE_INT|CTLFLAG_RW, &VNET_NAME(ipport_hifirstauto), 0, - &sysctl_net_ipport_check, "I", ""); -SYSCTL_VNET_PROC(_net_inet_ip_portrange, OID_AUTO, hilast, - CTLTYPE_INT|CTLFLAG_RW, &VNET_NAME(ipport_hilastauto), 0, - &sysctl_net_ipport_check, "I", ""); -SYSCTL_VNET_INT(_net_inet_ip_portrange, OID_AUTO, reservedhigh, - CTLFLAG_RW|CTLFLAG_SECURE, &VNET_NAME(ipport_reservedhigh), 0, ""); -SYSCTL_VNET_INT(_net_inet_ip_portrange, OID_AUTO, reservedlow, +SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, lowfirst, + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW, + &VNET_NAME(ipport_lowfirstauto), 0, &sysctl_net_ipport_check, "I", ""); +SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, lowlast, + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW, + &VNET_NAME(ipport_lowlastauto), 0, &sysctl_net_ipport_check, "I", ""); +SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, first, + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW, + &VNET_NAME(ipport_firstauto), 0, &sysctl_net_ipport_check, "I", ""); +SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, last, + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW, + &VNET_NAME(ipport_lastauto), 0, &sysctl_net_ipport_check, "I", ""); +SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, hifirst, + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW, + &VNET_NAME(ipport_hifirstauto), 0, &sysctl_net_ipport_check, "I", ""); +SYSCTL_PROC(_net_inet_ip_portrange, OID_AUTO, hilast, + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW, + &VNET_NAME(ipport_hilastauto), 0, &sysctl_net_ipport_check, "I", ""); +SYSCTL_INT(_net_inet_ip_portrange, OID_AUTO, reservedhigh, + CTLFLAG_VNET | CTLFLAG_RW | CTLFLAG_SECURE, + &VNET_NAME(ipport_reservedhigh), 0, ""); +SYSCTL_INT(_net_inet_ip_portrange, OID_AUTO, reservedlow, CTLFLAG_RW|CTLFLAG_SECURE, &VNET_NAME(ipport_reservedlow), 0, ""); -SYSCTL_VNET_INT(_net_inet_ip_portrange, OID_AUTO, randomized, CTLFLAG_RW, +SYSCTL_INT(_net_inet_ip_portrange, OID_AUTO, randomized, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ipport_randomized), 0, "Enable random port allocation"); -SYSCTL_VNET_INT(_net_inet_ip_portrange, OID_AUTO, randomcps, CTLFLAG_RW, +SYSCTL_INT(_net_inet_ip_portrange, OID_AUTO, randomcps, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ipport_randomcps), 0, "Maximum number of random port " "allocations before switching to a sequental one"); -SYSCTL_VNET_INT(_net_inet_ip_portrange, OID_AUTO, randomtime, CTLFLAG_RW, +SYSCTL_INT(_net_inet_ip_portrange, OID_AUTO, randomtime, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ipport_randomtime), 0, "Minimum time to keep sequental port " "allocation before switching to a random one"); Modified: user/dchagin/lemul/sys/netinet/in_rmx.c ============================================================================== --- user/dchagin/lemul/sys/netinet/in_rmx.c Fri Nov 7 16:16:37 2014 (r274240) +++ user/dchagin/lemul/sys/netinet/in_rmx.c Fri Nov 7 16:22:58 2014 (r274241) @@ -134,21 +134,21 @@ in_matroute(void *v_arg, struct radix_no static VNET_DEFINE(int, rtq_reallyold) = 60*60; /* one hour is "really old" */ #define V_rtq_reallyold VNET(rtq_reallyold) -SYSCTL_VNET_INT(_net_inet_ip, IPCTL_RTEXPIRE, rtexpire, CTLFLAG_RW, +SYSCTL_INT(_net_inet_ip, IPCTL_RTEXPIRE, rtexpire, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(rtq_reallyold), 0, "Default expiration time on dynamically learned routes"); /* never automatically crank down to less */ static VNET_DEFINE(int, rtq_minreallyold) = 10; #define V_rtq_minreallyold VNET(rtq_minreallyold) -SYSCTL_VNET_INT(_net_inet_ip, IPCTL_RTMINEXPIRE, rtminexpire, CTLFLAG_RW, +SYSCTL_INT(_net_inet_ip, IPCTL_RTMINEXPIRE, rtminexpire, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(rtq_minreallyold), 0, "Minimum time to attempt to hold onto dynamically learned routes"); /* 128 cached routes is "too many" */ static VNET_DEFINE(int, rtq_toomany) = 128; #define V_rtq_toomany VNET(rtq_toomany) -SYSCTL_VNET_INT(_net_inet_ip, IPCTL_RTMAXCACHE, rtmaxcache, CTLFLAG_RW, +SYSCTL_INT(_net_inet_ip, IPCTL_RTMAXCACHE, rtmaxcache, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(rtq_toomany), 0, "Upper limit on dynamically learned routes"); Modified: user/dchagin/lemul/sys/netinet/ip_carp.c ============================================================================== --- user/dchagin/lemul/sys/netinet/ip_carp.c Fri Nov 7 16:16:37 2014 (r274240) +++ user/dchagin/lemul/sys/netinet/ip_carp.c Fri Nov 7 16:22:58 2014 (r274241) @@ -216,18 +216,21 @@ static VNET_DEFINE(int, carp_ifdown_adj) static int carp_demote_adj_sysctl(SYSCTL_HANDLER_ARGS); SYSCTL_NODE(_net_inet, IPPROTO_CARP, carp, CTLFLAG_RW, 0, "CARP"); -SYSCTL_VNET_INT(_net_inet_carp, OID_AUTO, allow, CTLFLAG_RW, +SYSCTL_INT(_net_inet_carp, OID_AUTO, allow, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(carp_allow), 0, "Accept incoming CARP packets"); -SYSCTL_VNET_INT(_net_inet_carp, OID_AUTO, preempt, CTLFLAG_RW, +SYSCTL_INT(_net_inet_carp, OID_AUTO, preempt, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(carp_preempt), 0, "High-priority backup preemption mode"); -SYSCTL_VNET_INT(_net_inet_carp, OID_AUTO, log, CTLFLAG_RW, +SYSCTL_INT(_net_inet_carp, OID_AUTO, log, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(carp_log), 0, "CARP log level"); -SYSCTL_VNET_PROC(_net_inet_carp, OID_AUTO, demotion, CTLTYPE_INT|CTLFLAG_RW, +SYSCTL_PROC(_net_inet_carp, OID_AUTO, demotion, + CTLFLAG_VNET | CTLTYPE_INT | CTLFLAG_RW, 0, 0, carp_demote_adj_sysctl, "I", "Adjust demotion factor (skew of advskew)"); -SYSCTL_VNET_INT(_net_inet_carp, OID_AUTO, senderr_demotion_factor, CTLFLAG_RW, +SYSCTL_INT(_net_inet_carp, OID_AUTO, senderr_demotion_factor, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(carp_senderr_adj), 0, "Send error demotion factor adjustment"); -SYSCTL_VNET_INT(_net_inet_carp, OID_AUTO, ifdown_demotion_factor, CTLFLAG_RW, +SYSCTL_INT(_net_inet_carp, OID_AUTO, ifdown_demotion_factor, + CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(carp_ifdown_adj), 0, "Interface down demotion factor adjustment"); Modified: user/dchagin/lemul/sys/netinet/ip_fastfwd.c ============================================================================== --- user/dchagin/lemul/sys/netinet/ip_fastfwd.c Fri Nov 7 16:16:37 2014 (r274240) +++ user/dchagin/lemul/sys/netinet/ip_fastfwd.c Fri Nov 7 16:22:58 2014 (r274241) @@ -111,7 +111,7 @@ __FBSDID("$FreeBSD$"); static VNET_DEFINE(int, ipfastforward_active); #define V_ipfastforward_active VNET(ipfastforward_active) -SYSCTL_VNET_INT(_net_inet_ip, OID_AUTO, fastforwarding, CTLFLAG_RW, +SYSCTL_INT(_net_inet_ip, OID_AUTO, fastforwarding, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ipfastforward_active), 0, "Enable fast IP forwarding"); static struct sockaddr_in * Modified: user/dchagin/lemul/sys/netinet/ip_icmp.c ============================================================================== --- user/dchagin/lemul/sys/netinet/ip_icmp.c Fri Nov 7 16:16:37 2014 (r274240) +++ user/dchagin/lemul/sys/netinet/ip_icmp.c Fri Nov 7 16:22:58 2014 (r274241) @@ -82,13 +82,13 @@ __FBSDID("$FreeBSD$"); */ static VNET_DEFINE(int, icmplim) = 200; #define V_icmplim VNET(icmplim) -SYSCTL_VNET_INT(_net_inet_icmp, ICMPCTL_ICMPLIM, icmplim, CTLFLAG_RW, +SYSCTL_INT(_net_inet_icmp, ICMPCTL_ICMPLIM, icmplim, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(icmplim), 0, "Maximum number of ICMP responses per second"); static VNET_DEFINE(int, icmplim_output) = 1; #define V_icmplim_output VNET(icmplim_output) -SYSCTL_VNET_INT(_net_inet_icmp, OID_AUTO, icmplim_output, CTLFLAG_RW, +SYSCTL_INT(_net_inet_icmp, OID_AUTO, icmplim_output, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(icmplim_output), 0, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@FreeBSD.ORG Fri Nov 7 16:25:08 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E9C2B700; Fri, 7 Nov 2014 16:25:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CAD78BE0; Fri, 7 Nov 2014 16:25:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA7GP8dW020873; Fri, 7 Nov 2014 16:25:08 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA7GP85K020870; Fri, 7 Nov 2014 16:25:08 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201411071625.sA7GP85K020870@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Fri, 7 Nov 2014 16:25:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r274242 - in user/dchagin/lemul/sys: kern sys X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 16:25:09 -0000 Author: dchagin Date: Fri Nov 7 16:25:07 2014 New Revision: 274242 URL: https://svnweb.freebsd.org/changeset/base/274242 Log: Split up sys_poll() into a sys_ and kern_ counterparts, add kern_ppoll() version needed by an upcoming Linuxulator change. Modified: user/dchagin/lemul/sys/kern/sys_generic.c user/dchagin/lemul/sys/sys/syscallsubr.h Modified: user/dchagin/lemul/sys/kern/sys_generic.c ============================================================================== --- user/dchagin/lemul/sys/kern/sys_generic.c Fri Nov 7 16:22:58 2014 (r274241) +++ user/dchagin/lemul/sys/kern/sys_generic.c Fri Nov 7 16:25:07 2014 (r274242) @@ -97,6 +97,8 @@ static int pollout(struct thread *, stru u_int); static int pollscan(struct thread *, struct pollfd *, u_int); static int pollrescan(struct thread *); +static int kern_poll(struct thread *, struct pollfd *, uint32_t, + sbintime_t, sbintime_t); static int selscan(struct thread *, fd_mask **, fd_mask **, int); static int selrescan(struct thread *, fd_mask **, fd_mask **); static void selfdalloc(struct thread *, void *); @@ -1301,30 +1303,12 @@ sys_poll(td, uap) struct thread *td; struct poll_args *uap; { - struct pollfd *bits; - struct pollfd smallbits[32]; sbintime_t asbt, precision, rsbt; - u_int nfds; - int error; - size_t ni; - nfds = uap->nfds; - if (nfds > maxfilesperproc && nfds > FD_SETSIZE) - return (EINVAL); - ni = nfds * sizeof(struct pollfd); - if (ni > sizeof(smallbits)) - bits = malloc(ni, M_TEMP, M_WAITOK); - else - bits = smallbits; - error = copyin(uap->fds, bits, ni); - if (error) - goto done; precision = 0; if (uap->timeout != INFTIM) { - if (uap->timeout < 0) { - error = EINVAL; - goto done; - } + if (uap->timeout < 0) + return (EINVAL); if (uap->timeout == 0) asbt = 0; else { @@ -1337,13 +1321,37 @@ sys_poll(td, uap) } } else asbt = -1; + + return (kern_poll(td, uap->fds, uap->nfds, asbt, precision)); +} + +static int +kern_poll(struct thread *td, struct pollfd *fds, uint32_t nfds, + sbintime_t sbt, sbintime_t prec) +{ + struct pollfd *bits; + struct pollfd smallbits[32]; + int error; + size_t ni; + + if (nfds > maxfilesperproc && nfds > FD_SETSIZE) + return (EINVAL); + ni = nfds * sizeof(struct pollfd); + if (ni > sizeof(smallbits)) + bits = malloc(ni, M_TEMP, M_WAITOK); + else + bits = smallbits; + error = copyin(fds, bits, ni); + if (error) + goto done; + seltdinit(td); /* Iterate until the timeout expires or descriptors become ready. */ for (;;) { error = pollscan(td, bits, nfds); if (error || td->td_retval[0] != 0) break; - error = seltdwait(td, asbt, precision); + error = seltdwait(td, sbt, prec); if (error) break; error = pollrescan(td); @@ -1359,7 +1367,7 @@ done: if (error == EWOULDBLOCK) error = 0; if (error == 0) { - error = pollout(td, bits, uap->fds, nfds); + error = pollout(td, bits, fds, nfds); if (error) goto out; } @@ -1369,6 +1377,59 @@ out: return (error); } +int +kern_ppoll(struct thread *td, struct pollfd *fds, uint32_t nfds, + struct timespec *tsp, sigset_t *uset) +{ + struct timespec ts; + sbintime_t sbt, precision, tmp; + time_t over; + int error; + + precision = 0; + if (tsp != NULL) { + if (tsp->tv_sec < 0) + return (EINVAL); + if (tsp->tv_nsec < 0 || tsp->tv_nsec >= 1000000000) + return (EINVAL); + if (tsp->tv_sec == 0 && tsp->tv_nsec == 0) + sbt = 0; + else { + ts = *tsp; + if (ts.tv_sec > INT32_MAX / 2) { + over = ts.tv_sec - INT32_MAX / 2; + ts.tv_sec -= over; + } else + over = 0; + tmp = tstosbt(ts); + precision = tmp; + precision >>= tc_precexp; + if (TIMESEL(&sbt, tmp)) + sbt += tc_tick_sbt; + sbt += tmp; + } + } else + sbt = -1; + + if (uset != NULL) { + error = kern_sigprocmask(td, SIG_SETMASK, uset, + &td->td_oldsigmask, 0); + if (error != 0) + return (error); + td->td_pflags |= TDP_OLDMASK; + /* + * Make sure that ast() is called on return to + * usermode and TDP_OLDMASK is cleared, restoring old + * sigmask. + */ + thread_lock(td); + td->td_flags |= TDF_ASTPENDING; + thread_unlock(td); + } + + return (kern_poll(td, fds, nfds, sbt, precision)); +} + static int pollrescan(struct thread *td) { Modified: user/dchagin/lemul/sys/sys/syscallsubr.h ============================================================================== --- user/dchagin/lemul/sys/sys/syscallsubr.h Fri Nov 7 16:22:58 2014 (r274241) +++ user/dchagin/lemul/sys/sys/syscallsubr.h Fri Nov 7 16:25:07 2014 (r274242) @@ -46,6 +46,7 @@ struct ksiginfo; struct mbuf; struct msghdr; struct msqid_ds; +struct pollfd; struct ogetdirentries_args; struct rlimit; struct rusage; @@ -169,6 +170,8 @@ int kern_pathconf(struct thread *td, cha int name, u_long flags); int kern_pipe(struct thread *td, int fildes[2]); int kern_pipe2(struct thread *td, int fildes[2], int flags); +int kern_ppoll(struct thread *td, struct pollfd *fds, uint32_t nfds, + struct timespec *tsp, sigset_t *uset); int kern_posix_fadvise(struct thread *td, int fd, off_t offset, off_t len, int advice); int kern_posix_fallocate(struct thread *td, int fd, off_t offset, From owner-svn-src-user@FreeBSD.ORG Fri Nov 7 16:33:36 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4AC91C3E; Fri, 7 Nov 2014 16:33:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 366CCCE0; Fri, 7 Nov 2014 16:33:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA7GXa7n025437; Fri, 7 Nov 2014 16:33:36 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA7GXYXH025427; Fri, 7 Nov 2014 16:33:34 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201411071633.sA7GXYXH025427@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Fri, 7 Nov 2014 16:33:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r274243 - in user/dchagin/lemul/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 16:33:36 -0000 Author: dchagin Date: Fri Nov 7 16:33:33 2014 New Revision: 274243 URL: https://svnweb.freebsd.org/changeset/base/274243 Log: Implement ppoll() system call. (need more test, ltp passed) Modified: user/dchagin/lemul/sys/amd64/linux/linux_dummy.c user/dchagin/lemul/sys/amd64/linux/syscalls.master user/dchagin/lemul/sys/amd64/linux32/linux32_dummy.c user/dchagin/lemul/sys/amd64/linux32/syscalls.master user/dchagin/lemul/sys/compat/linux/linux_misc.c user/dchagin/lemul/sys/i386/linux/linux_dummy.c user/dchagin/lemul/sys/i386/linux/syscalls.master Modified: user/dchagin/lemul/sys/amd64/linux/linux_dummy.c ============================================================================== --- user/dchagin/lemul/sys/amd64/linux/linux_dummy.c Fri Nov 7 16:25:07 2014 (r274242) +++ user/dchagin/lemul/sys/amd64/linux/linux_dummy.c Fri Nov 7 16:33:33 2014 (r274243) @@ -92,7 +92,6 @@ DUMMY(inotify_init); DUMMY(inotify_add_watch); DUMMY(inotify_rm_watch); DUMMY(migrate_pages); -DUMMY(ppoll); DUMMY(unshare); DUMMY(splice); DUMMY(tee); Modified: user/dchagin/lemul/sys/amd64/linux/syscalls.master ============================================================================== --- user/dchagin/lemul/sys/amd64/linux/syscalls.master Fri Nov 7 16:25:07 2014 (r274242) +++ user/dchagin/lemul/sys/amd64/linux/syscalls.master Fri Nov 7 16:33:33 2014 (r274243) @@ -456,7 +456,8 @@ l_fd_set *readfds, l_fd_set *writefds, \ l_fd_set *exceptfds, \ struct l_timespec *tsp, l_uintptr_t *sig); } -271 AUE_NULL STD { int linux_ppoll(void); } +271 AUE_POLL STD { int linux_ppoll(struct pollfd* fds, uint32_t nfds, \ + struct l_timespec *tsp, l_sigset_t *sset, l_size_t ssize); } 272 AUE_NULL STD { int linux_unshare(void); } 273 AUE_NULL STD { int linux_set_robust_list(struct linux_robust_list_head *head, \ l_size_t len); } Modified: user/dchagin/lemul/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- user/dchagin/lemul/sys/amd64/linux32/linux32_dummy.c Fri Nov 7 16:25:07 2014 (r274242) +++ user/dchagin/lemul/sys/amd64/linux32/linux32_dummy.c Fri Nov 7 16:33:33 2014 (r274243) @@ -92,7 +92,6 @@ DUMMY(inotify_add_watch); DUMMY(inotify_rm_watch); /* linux 2.6.16: */ DUMMY(migrate_pages); -DUMMY(ppoll); DUMMY(unshare); /* linux 2.6.17: */ DUMMY(splice); Modified: user/dchagin/lemul/sys/amd64/linux32/syscalls.master ============================================================================== --- user/dchagin/lemul/sys/amd64/linux32/syscalls.master Fri Nov 7 16:25:07 2014 (r274242) +++ user/dchagin/lemul/sys/amd64/linux32/syscalls.master Fri Nov 7 16:33:33 2014 (r274243) @@ -513,7 +513,8 @@ l_fd_set *readfds, l_fd_set *writefds, \ l_fd_set *exceptfds, \ struct l_timespec *tsp, l_uintptr_t *sig); } -309 AUE_NULL STD { int linux_ppoll(void); } +309 AUE_POLL STD { int linux_ppoll(struct pollfd* fds, uint32_t nfds, \ + struct l_timespec *tsp, l_sigset_t *sset, l_size_t ssize); } 310 AUE_NULL STD { int linux_unshare(void); } ; linux 2.6.17: 311 AUE_NULL STD { int linux_set_robust_list(struct linux_robust_list_head *head, \ Modified: user/dchagin/lemul/sys/compat/linux/linux_misc.c ============================================================================== --- user/dchagin/lemul/sys/compat/linux/linux_misc.c Fri Nov 7 16:25:07 2014 (r274242) +++ user/dchagin/lemul/sys/compat/linux/linux_misc.c Fri Nov 7 16:33:33 2014 (r274243) @@ -2170,6 +2170,61 @@ linux_pselect6(struct thread *td, struct return (error); } +int +linux_ppoll(struct thread *td, struct linux_ppoll_args *args) +{ + struct timespec ts0, ts1; + struct l_timespec lts; + struct timespec uts, *tsp; + l_sigset_t l_ss; + sigset_t *ssp; + sigset_t ss; + int error; + + if (args->sset) { + if (args->ssize != sizeof(l_ss)) + return (EINVAL); + error = copyin(args->sset, &l_ss, sizeof(l_ss)); + if (error) + return (error); + linux_to_bsd_sigset(&l_ss, &ss); + SIGDELSET(ss, SIGKILL); + SIGDELSET(ss, SIGSTOP); + ssp = &ss; + } else + ssp = NULL; + if (args->tsp) { + error = copyin(args->tsp, <s, sizeof(lts)); + if (error) + return (error); + uts.tv_sec = lts.tv_sec; + uts.tv_nsec = lts.tv_nsec; + + nanotime(&ts0); + tsp = &uts; + } else + tsp = NULL; + + error = kern_ppoll(td, args->fds, args->nfds, tsp, ssp); + + if (error == 0 && args->tsp) { + if (td->td_retval[0]) { + nanotime(&ts1); + timespecsub(&ts1, &ts0); + timespecsub(&uts, &ts1); + if (uts.tv_sec < 0) + timespecclear(&uts); + } else + timespecclear(&uts); + + lts.tv_sec = uts.tv_sec; + lts.tv_nsec = uts.tv_nsec; + error = copyout(<s, args->tsp, sizeof(lts)); + } + + return (error); +} + #if defined(DEBUG) || defined(KTR) /* XXX: can be removed when every ldebug(...) and KTR stuff are removed. */ Modified: user/dchagin/lemul/sys/i386/linux/linux_dummy.c ============================================================================== --- user/dchagin/lemul/sys/i386/linux/linux_dummy.c Fri Nov 7 16:25:07 2014 (r274242) +++ user/dchagin/lemul/sys/i386/linux/linux_dummy.c Fri Nov 7 16:33:33 2014 (r274243) @@ -88,7 +88,6 @@ DUMMY(inotify_add_watch); DUMMY(inotify_rm_watch); /* linux 2.6.16: */ DUMMY(migrate_pages); -DUMMY(ppoll); DUMMY(unshare); /* linux 2.6.17: */ DUMMY(splice); Modified: user/dchagin/lemul/sys/i386/linux/syscalls.master ============================================================================== --- user/dchagin/lemul/sys/i386/linux/syscalls.master Fri Nov 7 16:25:07 2014 (r274242) +++ user/dchagin/lemul/sys/i386/linux/syscalls.master Fri Nov 7 16:33:33 2014 (r274243) @@ -521,7 +521,8 @@ l_fd_set *readfds, l_fd_set *writefds, \ l_fd_set *exceptfds, \ struct l_timespec *tsp, l_uintptr_t *sig); } -309 AUE_NULL STD { int linux_ppoll(void); } +309 AUE_POLL STD { int linux_ppoll(struct pollfd* fds, uint32_t nfds, \ + struct l_timespec *tsp, l_sigset_t *sset, l_size_t ssize); } 310 AUE_NULL STD { int linux_unshare(void); } ; linux 2.6.17: 311 AUE_NULL STD { int linux_set_robust_list(struct linux_robust_list_head *head, \ From owner-svn-src-user@FreeBSD.ORG Fri Nov 7 16:35:35 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 354CEE2F; Fri, 7 Nov 2014 16:35:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2026ACF2; Fri, 7 Nov 2014 16:35:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA7GZZYx025768; Fri, 7 Nov 2014 16:35:35 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA7GZVF3025742; Fri, 7 Nov 2014 16:35:31 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201411071635.sA7GZVF3025742@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Fri, 7 Nov 2014 16:35:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r274244 - in user/dchagin/lemul/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 16:35:35 -0000 Author: dchagin Date: Fri Nov 7 16:35:31 2014 New Revision: 274244 URL: https://svnweb.freebsd.org/changeset/base/274244 Log: Regen for ppoll r274423. Modified: user/dchagin/lemul/sys/amd64/linux/linux_proto.h user/dchagin/lemul/sys/amd64/linux/linux_sysent.c user/dchagin/lemul/sys/amd64/linux/linux_systrace_args.c user/dchagin/lemul/sys/amd64/linux32/linux32_proto.h user/dchagin/lemul/sys/amd64/linux32/linux32_syscall.h user/dchagin/lemul/sys/amd64/linux32/linux32_syscalls.c user/dchagin/lemul/sys/amd64/linux32/linux32_sysent.c user/dchagin/lemul/sys/amd64/linux32/linux32_systrace_args.c user/dchagin/lemul/sys/i386/linux/linux_proto.h user/dchagin/lemul/sys/i386/linux/linux_syscall.h user/dchagin/lemul/sys/i386/linux/linux_syscalls.c user/dchagin/lemul/sys/i386/linux/linux_sysent.c user/dchagin/lemul/sys/i386/linux/linux_systrace_args.c Modified: user/dchagin/lemul/sys/amd64/linux/linux_proto.h ============================================================================== --- user/dchagin/lemul/sys/amd64/linux/linux_proto.h Fri Nov 7 16:33:33 2014 (r274243) +++ user/dchagin/lemul/sys/amd64/linux/linux_proto.h Fri Nov 7 16:35:31 2014 (r274244) @@ -951,7 +951,11 @@ struct linux_pselect6_args { char sig_l_[PADL_(l_uintptr_t *)]; l_uintptr_t * sig; char sig_r_[PADR_(l_uintptr_t *)]; }; struct linux_ppoll_args { - register_t dummy; + char fds_l_[PADL_(struct pollfd *)]; struct pollfd * fds; char fds_r_[PADR_(struct pollfd *)]; + char nfds_l_[PADL_(uint32_t)]; uint32_t nfds; char nfds_r_[PADR_(uint32_t)]; + char tsp_l_[PADL_(struct l_timespec *)]; struct l_timespec * tsp; char tsp_r_[PADR_(struct l_timespec *)]; + char sset_l_[PADL_(l_sigset_t *)]; l_sigset_t * sset; char sset_r_[PADR_(l_sigset_t *)]; + char ssize_l_[PADL_(l_size_t)]; l_size_t ssize; char ssize_r_[PADR_(l_size_t)]; }; struct linux_unshare_args { register_t dummy; @@ -1596,7 +1600,7 @@ int linux_finit_module(struct thread *, #define LINUX_SYS_AUE_linux_fchmodat AUE_FCHMODAT #define LINUX_SYS_AUE_linux_faccessat AUE_FACCESSAT #define LINUX_SYS_AUE_linux_pselect6 AUE_SELECT -#define LINUX_SYS_AUE_linux_ppoll AUE_NULL +#define LINUX_SYS_AUE_linux_ppoll AUE_POLL #define LINUX_SYS_AUE_linux_unshare AUE_NULL #define LINUX_SYS_AUE_linux_set_robust_list AUE_NULL #define LINUX_SYS_AUE_linux_get_robust_list AUE_NULL Modified: user/dchagin/lemul/sys/amd64/linux/linux_sysent.c ============================================================================== --- user/dchagin/lemul/sys/amd64/linux/linux_sysent.c Fri Nov 7 16:33:33 2014 (r274243) +++ user/dchagin/lemul/sys/amd64/linux/linux_sysent.c Fri Nov 7 16:35:31 2014 (r274244) @@ -289,7 +289,7 @@ struct sysent linux_sysent[] = { { AS(linux_fchmodat_args), (sy_call_t *)linux_fchmodat, AUE_FCHMODAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 268 = linux_fchmodat */ { AS(linux_faccessat_args), (sy_call_t *)linux_faccessat, AUE_FACCESSAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 269 = linux_faccessat */ { AS(linux_pselect6_args), (sy_call_t *)linux_pselect6, AUE_SELECT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 270 = linux_pselect6 */ - { 0, (sy_call_t *)linux_ppoll, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 271 = linux_ppoll */ + { AS(linux_ppoll_args), (sy_call_t *)linux_ppoll, AUE_POLL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 271 = linux_ppoll */ { 0, (sy_call_t *)linux_unshare, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 272 = linux_unshare */ { AS(linux_set_robust_list_args), (sy_call_t *)linux_set_robust_list, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 273 = linux_set_robust_list */ { AS(linux_get_robust_list_args), (sy_call_t *)linux_get_robust_list, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 274 = linux_get_robust_list */ Modified: user/dchagin/lemul/sys/amd64/linux/linux_systrace_args.c ============================================================================== --- user/dchagin/lemul/sys/amd64/linux/linux_systrace_args.c Fri Nov 7 16:33:33 2014 (r274243) +++ user/dchagin/lemul/sys/amd64/linux/linux_systrace_args.c Fri Nov 7 16:35:31 2014 (r274244) @@ -1994,7 +1994,13 @@ systrace_args(int sysnum, void *params, } /* linux_ppoll */ case 271: { - *n_args = 0; + struct linux_ppoll_args *p = params; + uarg[0] = (intptr_t) p->fds; /* struct pollfd * */ + uarg[1] = p->nfds; /* uint32_t */ + uarg[2] = (intptr_t) p->tsp; /* struct l_timespec * */ + uarg[3] = (intptr_t) p->sset; /* l_sigset_t * */ + iarg[4] = p->ssize; /* l_size_t */ + *n_args = 5; break; } /* linux_unshare */ @@ -5275,6 +5281,25 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_ppoll */ case 271: + switch(ndx) { + case 0: + p = "struct pollfd *"; + break; + case 1: + p = "uint32_t"; + break; + case 2: + p = "struct l_timespec *"; + break; + case 3: + p = "l_sigset_t *"; + break; + case 4: + p = "l_size_t"; + break; + default: + break; + }; break; /* linux_unshare */ case 272: @@ -6625,6 +6650,9 @@ systrace_return_setargdesc(int sysnum, i break; /* linux_ppoll */ case 271: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_unshare */ case 272: /* linux_set_robust_list */ Modified: user/dchagin/lemul/sys/amd64/linux32/linux32_proto.h ============================================================================== --- user/dchagin/lemul/sys/amd64/linux32/linux32_proto.h Fri Nov 7 16:33:33 2014 (r274243) +++ user/dchagin/lemul/sys/amd64/linux32/linux32_proto.h Fri Nov 7 16:35:31 2014 (r274244) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: user/dchagin/lemul/sys/amd64/linux32/syscalls.master 266316 2014-05-17 14:39:40Z dchagin + * created from FreeBSD: user/dchagin/lemul/sys/amd64/linux32/syscalls.master 274243 2014-11-07 16:33:33Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -1008,7 +1008,11 @@ struct linux_pselect6_args { char sig_l_[PADL_(l_uintptr_t *)]; l_uintptr_t * sig; char sig_r_[PADR_(l_uintptr_t *)]; }; struct linux_ppoll_args { - register_t dummy; + char fds_l_[PADL_(struct pollfd *)]; struct pollfd * fds; char fds_r_[PADR_(struct pollfd *)]; + char nfds_l_[PADL_(uint32_t)]; uint32_t nfds; char nfds_r_[PADR_(uint32_t)]; + char tsp_l_[PADL_(struct l_timespec *)]; struct l_timespec * tsp; char tsp_r_[PADR_(struct l_timespec *)]; + char sset_l_[PADL_(l_sigset_t *)]; l_sigset_t * sset; char sset_r_[PADR_(l_sigset_t *)]; + char ssize_l_[PADL_(l_size_t)]; l_size_t ssize; char ssize_r_[PADR_(l_size_t)]; }; struct linux_unshare_args { register_t dummy; @@ -1684,7 +1688,7 @@ int linux_process_vm_writev(struct threa #define LINUX_SYS_AUE_linux_fchmodat AUE_FCHMODAT #define LINUX_SYS_AUE_linux_faccessat AUE_FACCESSAT #define LINUX_SYS_AUE_linux_pselect6 AUE_SELECT -#define LINUX_SYS_AUE_linux_ppoll AUE_NULL +#define LINUX_SYS_AUE_linux_ppoll AUE_POLL #define LINUX_SYS_AUE_linux_unshare AUE_NULL #define LINUX_SYS_AUE_linux_set_robust_list AUE_NULL #define LINUX_SYS_AUE_linux_get_robust_list AUE_NULL Modified: user/dchagin/lemul/sys/amd64/linux32/linux32_syscall.h ============================================================================== --- user/dchagin/lemul/sys/amd64/linux32/linux32_syscall.h Fri Nov 7 16:33:33 2014 (r274243) +++ user/dchagin/lemul/sys/amd64/linux32/linux32_syscall.h Fri Nov 7 16:35:31 2014 (r274244) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: user/dchagin/lemul/sys/amd64/linux32/syscalls.master 266316 2014-05-17 14:39:40Z dchagin + * created from FreeBSD: user/dchagin/lemul/sys/amd64/linux32/syscalls.master 274243 2014-11-07 16:33:33Z dchagin */ #define LINUX_SYS_linux_exit 1 Modified: user/dchagin/lemul/sys/amd64/linux32/linux32_syscalls.c ============================================================================== --- user/dchagin/lemul/sys/amd64/linux32/linux32_syscalls.c Fri Nov 7 16:33:33 2014 (r274243) +++ user/dchagin/lemul/sys/amd64/linux32/linux32_syscalls.c Fri Nov 7 16:35:31 2014 (r274244) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: user/dchagin/lemul/sys/amd64/linux32/syscalls.master 266316 2014-05-17 14:39:40Z dchagin + * created from FreeBSD: user/dchagin/lemul/sys/amd64/linux32/syscalls.master 274243 2014-11-07 16:33:33Z dchagin */ const char *linux_syscallnames[] = { Modified: user/dchagin/lemul/sys/amd64/linux32/linux32_sysent.c ============================================================================== --- user/dchagin/lemul/sys/amd64/linux32/linux32_sysent.c Fri Nov 7 16:33:33 2014 (r274243) +++ user/dchagin/lemul/sys/amd64/linux32/linux32_sysent.c Fri Nov 7 16:35:31 2014 (r274244) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: user/dchagin/lemul/sys/amd64/linux32/syscalls.master 266316 2014-05-17 14:39:40Z dchagin + * created from FreeBSD: user/dchagin/lemul/sys/amd64/linux32/syscalls.master 274243 2014-11-07 16:33:33Z dchagin */ #include "opt_compat.h" @@ -328,7 +328,7 @@ struct sysent linux_sysent[] = { { AS(linux_fchmodat_args), (sy_call_t *)linux_fchmodat, AUE_FCHMODAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 306 = linux_fchmodat */ { AS(linux_faccessat_args), (sy_call_t *)linux_faccessat, AUE_FACCESSAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 307 = linux_faccessat */ { AS(linux_pselect6_args), (sy_call_t *)linux_pselect6, AUE_SELECT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 308 = linux_pselect6 */ - { 0, (sy_call_t *)linux_ppoll, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 309 = linux_ppoll */ + { AS(linux_ppoll_args), (sy_call_t *)linux_ppoll, AUE_POLL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 309 = linux_ppoll */ { 0, (sy_call_t *)linux_unshare, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 310 = linux_unshare */ { AS(linux_set_robust_list_args), (sy_call_t *)linux_set_robust_list, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 311 = linux_set_robust_list */ { AS(linux_get_robust_list_args), (sy_call_t *)linux_get_robust_list, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 312 = linux_get_robust_list */ Modified: user/dchagin/lemul/sys/amd64/linux32/linux32_systrace_args.c ============================================================================== --- user/dchagin/lemul/sys/amd64/linux32/linux32_systrace_args.c Fri Nov 7 16:33:33 2014 (r274243) +++ user/dchagin/lemul/sys/amd64/linux32/linux32_systrace_args.c Fri Nov 7 16:35:31 2014 (r274244) @@ -2096,7 +2096,13 @@ systrace_args(int sysnum, void *params, } /* linux_ppoll */ case 309: { - *n_args = 0; + struct linux_ppoll_args *p = params; + uarg[0] = (intptr_t) p->fds; /* struct pollfd * */ + uarg[1] = p->nfds; /* uint32_t */ + uarg[2] = (intptr_t) p->tsp; /* struct l_timespec * */ + uarg[3] = (intptr_t) p->sset; /* l_sigset_t * */ + iarg[4] = p->ssize; /* l_size_t */ + *n_args = 5; break; } /* linux_unshare */ @@ -5479,6 +5485,25 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_ppoll */ case 309: + switch(ndx) { + case 0: + p = "struct pollfd *"; + break; + case 1: + p = "uint32_t"; + break; + case 2: + p = "struct l_timespec *"; + break; + case 3: + p = "l_sigset_t *"; + break; + case 4: + p = "l_size_t"; + break; + default: + break; + }; break; /* linux_unshare */ case 310: @@ -6886,6 +6911,9 @@ systrace_return_setargdesc(int sysnum, i break; /* linux_ppoll */ case 309: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_unshare */ case 310: /* linux_set_robust_list */ Modified: user/dchagin/lemul/sys/i386/linux/linux_proto.h ============================================================================== --- user/dchagin/lemul/sys/i386/linux/linux_proto.h Fri Nov 7 16:33:33 2014 (r274243) +++ user/dchagin/lemul/sys/i386/linux/linux_proto.h Fri Nov 7 16:35:31 2014 (r274244) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: user/dchagin/lemul/sys/i386/linux/syscalls.master 266316 2014-05-17 14:39:40Z dchagin + * created from FreeBSD: user/dchagin/lemul/sys/i386/linux/syscalls.master 274243 2014-11-07 16:33:33Z dchagin */ #ifndef _LINUX_SYSPROTO_H_ @@ -1026,7 +1026,11 @@ struct linux_pselect6_args { char sig_l_[PADL_(l_uintptr_t *)]; l_uintptr_t * sig; char sig_r_[PADR_(l_uintptr_t *)]; }; struct linux_ppoll_args { - register_t dummy; + char fds_l_[PADL_(struct pollfd *)]; struct pollfd * fds; char fds_r_[PADR_(struct pollfd *)]; + char nfds_l_[PADL_(uint32_t)]; uint32_t nfds; char nfds_r_[PADR_(uint32_t)]; + char tsp_l_[PADL_(struct l_timespec *)]; struct l_timespec * tsp; char tsp_r_[PADR_(struct l_timespec *)]; + char sset_l_[PADL_(l_sigset_t *)]; l_sigset_t * sset; char sset_r_[PADR_(l_sigset_t *)]; + char ssize_l_[PADL_(l_size_t)]; l_size_t ssize; char ssize_r_[PADR_(l_size_t)]; }; struct linux_unshare_args { register_t dummy; @@ -1706,7 +1710,7 @@ int linux_process_vm_writev(struct threa #define LINUX_SYS_AUE_linux_fchmodat AUE_FCHMODAT #define LINUX_SYS_AUE_linux_faccessat AUE_FACCESSAT #define LINUX_SYS_AUE_linux_pselect6 AUE_SELECT -#define LINUX_SYS_AUE_linux_ppoll AUE_NULL +#define LINUX_SYS_AUE_linux_ppoll AUE_POLL #define LINUX_SYS_AUE_linux_unshare AUE_NULL #define LINUX_SYS_AUE_linux_set_robust_list AUE_NULL #define LINUX_SYS_AUE_linux_get_robust_list AUE_NULL Modified: user/dchagin/lemul/sys/i386/linux/linux_syscall.h ============================================================================== --- user/dchagin/lemul/sys/i386/linux/linux_syscall.h Fri Nov 7 16:33:33 2014 (r274243) +++ user/dchagin/lemul/sys/i386/linux/linux_syscall.h Fri Nov 7 16:35:31 2014 (r274244) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: user/dchagin/lemul/sys/i386/linux/syscalls.master 266316 2014-05-17 14:39:40Z dchagin + * created from FreeBSD: user/dchagin/lemul/sys/i386/linux/syscalls.master 274243 2014-11-07 16:33:33Z dchagin */ #define LINUX_SYS_linux_exit 1 Modified: user/dchagin/lemul/sys/i386/linux/linux_syscalls.c ============================================================================== --- user/dchagin/lemul/sys/i386/linux/linux_syscalls.c Fri Nov 7 16:33:33 2014 (r274243) +++ user/dchagin/lemul/sys/i386/linux/linux_syscalls.c Fri Nov 7 16:35:31 2014 (r274244) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: user/dchagin/lemul/sys/i386/linux/syscalls.master 266316 2014-05-17 14:39:40Z dchagin + * created from FreeBSD: user/dchagin/lemul/sys/i386/linux/syscalls.master 274243 2014-11-07 16:33:33Z dchagin */ const char *linux_syscallnames[] = { Modified: user/dchagin/lemul/sys/i386/linux/linux_sysent.c ============================================================================== --- user/dchagin/lemul/sys/i386/linux/linux_sysent.c Fri Nov 7 16:33:33 2014 (r274243) +++ user/dchagin/lemul/sys/i386/linux/linux_sysent.c Fri Nov 7 16:35:31 2014 (r274244) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: user/dchagin/lemul/sys/i386/linux/syscalls.master 266316 2014-05-17 14:39:40Z dchagin + * created from FreeBSD: user/dchagin/lemul/sys/i386/linux/syscalls.master 274243 2014-11-07 16:33:33Z dchagin */ #include @@ -327,7 +327,7 @@ struct sysent linux_sysent[] = { { AS(linux_fchmodat_args), (sy_call_t *)linux_fchmodat, AUE_FCHMODAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 306 = linux_fchmodat */ { AS(linux_faccessat_args), (sy_call_t *)linux_faccessat, AUE_FACCESSAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 307 = linux_faccessat */ { AS(linux_pselect6_args), (sy_call_t *)linux_pselect6, AUE_SELECT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 308 = linux_pselect6 */ - { 0, (sy_call_t *)linux_ppoll, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 309 = linux_ppoll */ + { AS(linux_ppoll_args), (sy_call_t *)linux_ppoll, AUE_POLL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 309 = linux_ppoll */ { 0, (sy_call_t *)linux_unshare, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 310 = linux_unshare */ { AS(linux_set_robust_list_args), (sy_call_t *)linux_set_robust_list, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 311 = linux_set_robust_list */ { AS(linux_get_robust_list_args), (sy_call_t *)linux_get_robust_list, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 312 = linux_get_robust_list */ Modified: user/dchagin/lemul/sys/i386/linux/linux_systrace_args.c ============================================================================== --- user/dchagin/lemul/sys/i386/linux/linux_systrace_args.c Fri Nov 7 16:33:33 2014 (r274243) +++ user/dchagin/lemul/sys/i386/linux/linux_systrace_args.c Fri Nov 7 16:35:31 2014 (r274244) @@ -2172,7 +2172,13 @@ systrace_args(int sysnum, void *params, } /* linux_ppoll */ case 309: { - *n_args = 0; + struct linux_ppoll_args *p = params; + uarg[0] = (intptr_t) p->fds; /* struct pollfd * */ + uarg[1] = p->nfds; /* uint32_t */ + uarg[2] = (intptr_t) p->tsp; /* struct l_timespec * */ + uarg[3] = (intptr_t) p->sset; /* l_sigset_t * */ + iarg[4] = p->ssize; /* l_size_t */ + *n_args = 5; break; } /* linux_unshare */ @@ -5710,6 +5716,25 @@ systrace_entry_setargdesc(int sysnum, in break; /* linux_ppoll */ case 309: + switch(ndx) { + case 0: + p = "struct pollfd *"; + break; + case 1: + p = "uint32_t"; + break; + case 2: + p = "struct l_timespec *"; + break; + case 3: + p = "l_sigset_t *"; + break; + case 4: + p = "l_size_t"; + break; + default: + break; + }; break; /* linux_unshare */ case 310: @@ -7164,6 +7189,9 @@ systrace_return_setargdesc(int sysnum, i break; /* linux_ppoll */ case 309: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* linux_unshare */ case 310: /* linux_set_robust_list */ From owner-svn-src-user@FreeBSD.ORG Fri Nov 7 17:00:30 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E14BC4FD; Fri, 7 Nov 2014 17:00:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C16ABF98; Fri, 7 Nov 2014 17:00:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA7H0TY5037750; Fri, 7 Nov 2014 17:00:29 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA7H0S84037746; Fri, 7 Nov 2014 17:00:28 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201411071700.sA7H0S84037746@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Fri, 7 Nov 2014 17:00:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r274245 - in user/dchagin/lemul/sys: amd64/linux amd64/linux32 i386/linux X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 17:00:30 -0000 Author: dchagin Date: Fri Nov 7 17:00:28 2014 New Revision: 274245 URL: https://svnweb.freebsd.org/changeset/base/274245 Log: 1. Linux always set WEXITED option, not a WUNTRACED|WNOHANG! This is a strange bug. 2. Fix siginfo in WNOHANG case waitid() system call. Modified: user/dchagin/lemul/sys/amd64/linux/linux_machdep.c user/dchagin/lemul/sys/amd64/linux32/linux32_machdep.c user/dchagin/lemul/sys/i386/linux/linux_machdep.c Modified: user/dchagin/lemul/sys/amd64/linux/linux_machdep.c ============================================================================== --- user/dchagin/lemul/sys/amd64/linux/linux_machdep.c Fri Nov 7 16:35:31 2014 (r274244) +++ user/dchagin/lemul/sys/amd64/linux/linux_machdep.c Fri Nov 7 17:00:28 2014 (r274245) @@ -503,11 +503,12 @@ linux_wait4(struct thread *td, struct li args->pid, (void *)args->status, args->options, (void *)args->rusage); #endif + if (args->options & ~(LINUX_WUNTRACED | LINUX_WNOHANG | + LINUX_WCONTINUED | __WCLONE | __WNOTHREAD | __WALL)) + return (EINVAL); - options = (args->options & (WNOHANG | WUNTRACED)); - /* WLINUXCLONE should be equal to __WCLONE, but we make sure */ - if (args->options & __WCLONE) - options |= WLINUXCLONE; + options = WEXITED; + linux_to_bsd_waitopts(args->options, &options); if (args->rusage != NULL) rup = &ru; @@ -530,6 +531,7 @@ linux_waitid(struct thread *td, struct l siginfo_t siginfo; l_siginfo_t lsi; idtype_t idtype; + struct proc *p; int error; options = 0; @@ -562,22 +564,23 @@ linux_waitid(struct thread *td, struct l &wru, &siginfo); if (error) return (error); - td->td_retval[0] = 0; - if (args->rusage != NULL) { error = copyout(&wru.wru_children, args->rusage, sizeof(wru.wru_children)); if (error) return (error); } - if (args->info != NULL) { - sig = siginfo.si_signo; - if (siginfo.si_signo <= td->td_proc->p_sysent->sv_sigsize) - sig = td->td_proc->p_sysent->sv_sigtbl[_SIG_IDX(sig)]; - siginfo_to_lsiginfo(&siginfo, &lsi, sig); + p = td->td_proc; + if (td->td_retval[0] == 0) + bzero(&lsi, sizeof(lsi)); + else { + sig = BSD_TO_LINUX_SIGNAL(siginfo.si_signo); + siginfo_to_lsiginfo(&siginfo, &lsi, sig); + } error = copyout(&lsi, args->info, sizeof(lsi)); } + td->td_retval[0] = 0; return (error); } Modified: user/dchagin/lemul/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- user/dchagin/lemul/sys/amd64/linux32/linux32_machdep.c Fri Nov 7 16:35:31 2014 (r274244) +++ user/dchagin/lemul/sys/amd64/linux32/linux32_machdep.c Fri Nov 7 17:00:28 2014 (r274245) @@ -1039,8 +1039,11 @@ linux_wait4(struct thread *td, struct li args->pid, (void *)args->status, args->options, (void *)args->rusage); #endif + if (args->options & ~(LINUX_WUNTRACED | LINUX_WNOHANG | + LINUX_WCONTINUED | __WCLONE | __WNOTHREAD | __WALL)) + return (EINVAL); - options = 0; + options = WEXITED; linux_to_bsd_waitopts(args->options, &options); if (args->rusage != NULL) @@ -1067,6 +1070,7 @@ linux_waitid(struct thread *td, struct l siginfo_t siginfo; l_siginfo_t lsi; idtype_t idtype; + struct proc *p; int error; options = 0; @@ -1099,20 +1103,23 @@ linux_waitid(struct thread *td, struct l &wru, &siginfo); if (error) return (error); - td->td_retval[0] = 0; - if (args->rusage != NULL) { bsd_to_linux_rusage(&wru.wru_children, &lru); error = copyout(&lru, args->rusage, sizeof(lru)); if (error) return (error); } - if (args->info != NULL) { - sig = BSD_TO_LINUX_SIGNAL(siginfo.si_signo); - siginfo_to_lsiginfo(&siginfo, &lsi, sig); + p = td->td_proc; + if (td->td_retval[0] == 0) + bzero(&lsi, sizeof(lsi)); + else { + sig = BSD_TO_LINUX_SIGNAL(siginfo.si_signo); + siginfo_to_lsiginfo(&siginfo, &lsi, sig); + } error = copyout(&lsi, args->info, sizeof(lsi)); } + td->td_retval[0] = 0; return (error); } Modified: user/dchagin/lemul/sys/i386/linux/linux_machdep.c ============================================================================== --- user/dchagin/lemul/sys/i386/linux/linux_machdep.c Fri Nov 7 16:35:31 2014 (r274244) +++ user/dchagin/lemul/sys/i386/linux/linux_machdep.c Fri Nov 7 17:00:28 2014 (r274245) @@ -1058,11 +1058,12 @@ linux_wait4(struct thread *td, struct li args->pid, (void *)args->status, args->options, (void *)args->rusage); #endif + if (args->options & ~(LINUX_WUNTRACED | LINUX_WNOHANG | + LINUX_WCONTINUED | __WCLONE | __WNOTHREAD | __WALL)) + return (EINVAL); - options = (args->options & (WNOHANG | WUNTRACED)); - /* WLINUXCLONE should be equal to __WCLONE, but we make sure */ - if (args->options & __WCLONE) - options |= WLINUXCLONE; + options = WEXITED; + linux_to_bsd_waitopts(args->options, &options); if (args->rusage != NULL) rup = &ru; @@ -1085,6 +1086,7 @@ linux_waitid(struct thread *td, struct l siginfo_t siginfo; l_siginfo_t lsi; idtype_t idtype; + struct proc *p; int error; options = 0; @@ -1117,22 +1119,24 @@ linux_waitid(struct thread *td, struct l &wru, &siginfo); if (error) return (error); - td->td_retval[0] = 0; - if (args->rusage != NULL) { error = copyout(&wru.wru_children, args->rusage, sizeof(wru.wru_children)); if (error) return (error); } - if (args->info != NULL) { - sig = siginfo.si_signo; - if (siginfo.si_signo <= td->td_proc->p_sysent->sv_sigsize) - sig = td->td_proc->p_sysent->sv_sigtbl[_SIG_IDX(sig)]; + p = td->td_proc; + if (td->td_retval[0] == 0) + bzero(&lsi, sizeof(lsi)); + else { + sig = BSD_TO_LINUX_SIGNAL(siginfo.si_signo); + siginfo_to_lsiginfo(&siginfo, &lsi, sig); + } siginfo_to_lsiginfo(&siginfo, &lsi, sig); error = copyout(&lsi, args->info, sizeof(lsi)); } + td->td_retval[0] = 0; return (error); } From owner-svn-src-user@FreeBSD.ORG Fri Nov 7 18:17:21 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3BD1E78F; Fri, 7 Nov 2014 18:17:21 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B8FCF99D; Fri, 7 Nov 2014 18:17:20 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id sA7IHE84011139 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 7 Nov 2014 20:17:14 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua sA7IHE84011139 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id sA7IHE6v011138; Fri, 7 Nov 2014 20:17:14 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 7 Nov 2014 20:17:14 +0200 From: Konstantin Belousov To: Dmitry Chagin Subject: Re: svn commit: r274242 - in user/dchagin/lemul/sys: kern sys Message-ID: <20141107181714.GT53947@kib.kiev.ua> References: <201411071625.sA7GP85K020870@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201411071625.sA7GP85K020870@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: src-committers@freebsd.org, svn-src-user@freebsd.org X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 18:17:21 -0000 On Fri, Nov 07, 2014 at 04:25:08PM +0000, Dmitry Chagin wrote: > Author: dchagin > Date: Fri Nov 7 16:25:07 2014 > New Revision: 274242 > URL: https://svnweb.freebsd.org/changeset/base/274242 > > Log: > Split up sys_poll() into a sys_ and kern_ counterparts, add kern_ppoll() > version needed by an upcoming Linuxulator change. I think there must be native ppoll(2) if you added a helper and plan Linux one. > > Modified: > user/dchagin/lemul/sys/kern/sys_generic.c > user/dchagin/lemul/sys/sys/syscallsubr.h > > Modified: user/dchagin/lemul/sys/kern/sys_generic.c > ============================================================================== > --- user/dchagin/lemul/sys/kern/sys_generic.c Fri Nov 7 16:22:58 2014 (r274241) > +++ user/dchagin/lemul/sys/kern/sys_generic.c Fri Nov 7 16:25:07 2014 (r274242) > @@ -97,6 +97,8 @@ static int pollout(struct thread *, stru > u_int); > static int pollscan(struct thread *, struct pollfd *, u_int); > static int pollrescan(struct thread *); > +static int kern_poll(struct thread *, struct pollfd *, uint32_t, > + sbintime_t, sbintime_t); > static int selscan(struct thread *, fd_mask **, fd_mask **, int); > static int selrescan(struct thread *, fd_mask **, fd_mask **); > static void selfdalloc(struct thread *, void *); > @@ -1301,30 +1303,12 @@ sys_poll(td, uap) > struct thread *td; > struct poll_args *uap; > { > - struct pollfd *bits; > - struct pollfd smallbits[32]; > sbintime_t asbt, precision, rsbt; > - u_int nfds; > - int error; > - size_t ni; > > - nfds = uap->nfds; > - if (nfds > maxfilesperproc && nfds > FD_SETSIZE) > - return (EINVAL); > - ni = nfds * sizeof(struct pollfd); > - if (ni > sizeof(smallbits)) > - bits = malloc(ni, M_TEMP, M_WAITOK); > - else > - bits = smallbits; > - error = copyin(uap->fds, bits, ni); > - if (error) > - goto done; > precision = 0; > if (uap->timeout != INFTIM) { > - if (uap->timeout < 0) { > - error = EINVAL; > - goto done; > - } > + if (uap->timeout < 0) > + return (EINVAL); > if (uap->timeout == 0) > asbt = 0; > else { > @@ -1337,13 +1321,37 @@ sys_poll(td, uap) > } > } else > asbt = -1; > + > + return (kern_poll(td, uap->fds, uap->nfds, asbt, precision)); > +} > + > +static int > +kern_poll(struct thread *td, struct pollfd *fds, uint32_t nfds, > + sbintime_t sbt, sbintime_t prec) uint32_t type fo nfds is weird and probably even wrong. Native syscalls use unsigned int for it, and this helper definitely should follow them. > +{ > + struct pollfd *bits; > + struct pollfd smallbits[32]; > + int error; > + size_t ni; > + > + if (nfds > maxfilesperproc && nfds > FD_SETSIZE) > + return (EINVAL); This line was moved from the original code intact, but it still looks strange. What is the purpose of FD_SETSIZE test ? > + ni = nfds * sizeof(struct pollfd); > + if (ni > sizeof(smallbits)) > + bits = malloc(ni, M_TEMP, M_WAITOK); > + else > + bits = smallbits; > + error = copyin(fds, bits, ni); > + if (error) > + goto done; > + > seltdinit(td); > /* Iterate until the timeout expires or descriptors become ready. */ > for (;;) { > error = pollscan(td, bits, nfds); > if (error || td->td_retval[0] != 0) > break; > - error = seltdwait(td, asbt, precision); > + error = seltdwait(td, sbt, prec); > if (error) > break; > error = pollrescan(td); > @@ -1359,7 +1367,7 @@ done: > if (error == EWOULDBLOCK) > error = 0; > if (error == 0) { > - error = pollout(td, bits, uap->fds, nfds); > + error = pollout(td, bits, fds, nfds); > if (error) > goto out; > } > @@ -1369,6 +1377,59 @@ out: > return (error); > } > > +int > +kern_ppoll(struct thread *td, struct pollfd *fds, uint32_t nfds, Same uint32_t. > + struct timespec *tsp, sigset_t *uset) > +{ > + struct timespec ts; > + sbintime_t sbt, precision, tmp; > + time_t over; > + int error; From owner-svn-src-user@FreeBSD.ORG Fri Nov 7 18:44:29 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4AFF1C00; Fri, 7 Nov 2014 18:44:29 +0000 (UTC) Received: from dchagin.static.corbina.net (dchagin.static.corbina.ru [78.107.232.239]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "dchagin.static.corbina.net", Issuer "dchagin.static.corbina.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C4DDDC1E; Fri, 7 Nov 2014 18:44:27 +0000 (UTC) Received: from dchagin.static.corbina.net (localhost [127.0.0.1]) by dchagin.static.corbina.net (8.14.9/8.14.9) with ESMTP id sA7IiPKc010316 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 7 Nov 2014 21:44:25 +0300 (MSK) (envelope-from dchagin@dchagin.static.corbina.net) Received: (from dchagin@localhost) by dchagin.static.corbina.net (8.14.9/8.14.9/Submit) id sA7IiPuk010315; Fri, 7 Nov 2014 21:44:25 +0300 (MSK) (envelope-from dchagin) Date: Fri, 7 Nov 2014 21:44:25 +0300 From: Chagin Dmitry To: Konstantin Belousov Subject: Re: svn commit: r274242 - in user/dchagin/lemul/sys: kern sys Message-ID: <20141107184425.GA10199@dchagin.static.corbina.net> References: <201411071625.sA7GP85K020870@svn.freebsd.org> <20141107181714.GT53947@kib.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="HlL+5n6rz5pIUxbD" Content-Disposition: inline In-Reply-To: <20141107181714.GT53947@kib.kiev.ua> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: src-committers@freebsd.org, svn-src-user@freebsd.org X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 18:44:29 -0000 --HlL+5n6rz5pIUxbD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 07, 2014 at 08:17:14PM +0200, Konstantin Belousov wrote: > On Fri, Nov 07, 2014 at 04:25:08PM +0000, Dmitry Chagin wrote: > > Author: dchagin > > Date: Fri Nov 7 16:25:07 2014 > > New Revision: 274242 > > URL: https://svnweb.freebsd.org/changeset/base/274242 > >=20 > > Log: > > Split up sys_poll() into a sys_ and kern_ counterparts, add kern_ppol= l() > > version needed by an upcoming Linuxulator change. > I think there must be native ppoll(2) if you added a helper and > plan Linux one. >=20 ok, > >=20 > > Modified: > > user/dchagin/lemul/sys/kern/sys_generic.c > > user/dchagin/lemul/sys/sys/syscallsubr.h > >=20 > > Modified: user/dchagin/lemul/sys/kern/sys_generic.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- user/dchagin/lemul/sys/kern/sys_generic.c Fri Nov 7 16:22:58 2014 = (r274241) > > +++ user/dchagin/lemul/sys/kern/sys_generic.c Fri Nov 7 16:25:07 2014 = (r274242) > > @@ -97,6 +97,8 @@ static int pollout(struct thread *, stru > > u_int); > > static int pollscan(struct thread *, struct pollfd *, u_int); > > static int pollrescan(struct thread *); > > +static int kern_poll(struct thread *, struct pollfd *, uint32_t, > > + sbintime_t, sbintime_t); > > static int selscan(struct thread *, fd_mask **, fd_mask **, int); > > static int selrescan(struct thread *, fd_mask **, fd_mask **); > > static void selfdalloc(struct thread *, void *); > > @@ -1301,30 +1303,12 @@ sys_poll(td, uap) > > struct thread *td; > > struct poll_args *uap; > > { > > - struct pollfd *bits; > > - struct pollfd smallbits[32]; > > sbintime_t asbt, precision, rsbt; > > - u_int nfds; > > - int error; > > - size_t ni; > > =20 > > - nfds =3D uap->nfds; > > - if (nfds > maxfilesperproc && nfds > FD_SETSIZE)=20 > > - return (EINVAL); > > - ni =3D nfds * sizeof(struct pollfd); > > - if (ni > sizeof(smallbits)) > > - bits =3D malloc(ni, M_TEMP, M_WAITOK); > > - else > > - bits =3D smallbits; > > - error =3D copyin(uap->fds, bits, ni); > > - if (error) > > - goto done; > > precision =3D 0; > > if (uap->timeout !=3D INFTIM) { > > - if (uap->timeout < 0) { > > - error =3D EINVAL; > > - goto done; > > - } > > + if (uap->timeout < 0) > > + return (EINVAL); > > if (uap->timeout =3D=3D 0) > > asbt =3D 0; > > else { > > @@ -1337,13 +1321,37 @@ sys_poll(td, uap) > > } > > } else > > asbt =3D -1; > > + > > + return (kern_poll(td, uap->fds, uap->nfds, asbt, precision)); > > +} > > + > > +static int > > +kern_poll(struct thread *td, struct pollfd *fds, uint32_t nfds, > > + sbintime_t sbt, sbintime_t prec) > uint32_t type fo nfds is weird and probably even wrong. > Native syscalls use unsigned int for it, and this helper definitely > should follow them. >=20 ok > > +{ > > + struct pollfd *bits; > > + struct pollfd smallbits[32]; > > + int error; > > + size_t ni; > > + > > + if (nfds > maxfilesperproc && nfds > FD_SETSIZE)=20 > > + return (EINVAL); > This line was moved from the original code intact, but it still > looks strange. What is the purpose of FD_SETSIZE test ? >=20 r72203, "we want to be reasonably safe, but not overly restrictive." there are no complains from users, possibly it is acceptable for all. thanks! > > + ni =3D nfds * sizeof(struct pollfd); > > + if (ni > sizeof(smallbits)) > > + bits =3D malloc(ni, M_TEMP, M_WAITOK); > > + else > > + bits =3D smallbits; > > + error =3D copyin(fds, bits, ni); > > + if (error) > > + goto done; > > + > > seltdinit(td); > > /* Iterate until the timeout expires or descriptors become ready. */ > > for (;;) { > > error =3D pollscan(td, bits, nfds); > > if (error || td->td_retval[0] !=3D 0) > > break; > > - error =3D seltdwait(td, asbt, precision); > > + error =3D seltdwait(td, sbt, prec); > > if (error) > > break; > > error =3D pollrescan(td); > > @@ -1359,7 +1367,7 @@ done: > > if (error =3D=3D EWOULDBLOCK) > > error =3D 0; > > if (error =3D=3D 0) { > > - error =3D pollout(td, bits, uap->fds, nfds); > > + error =3D pollout(td, bits, fds, nfds); > > if (error) > > goto out; > > } > > @@ -1369,6 +1377,59 @@ out: > > return (error); > > } > > =20 > > +int > > +kern_ppoll(struct thread *td, struct pollfd *fds, uint32_t nfds, > Same uint32_t. >=20 > > + struct timespec *tsp, sigset_t *uset) > > +{ > > + struct timespec ts; > > + sbintime_t sbt, precision, tmp; > > + time_t over; > > + int error; --=20 Have fun! chd --HlL+5n6rz5pIUxbD Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlRdEwkACgkQ0t2Tb3OO/O2MiACgnnO7i+NQ1ATfdAlpZxLBkjeQ IfQAnR/AMgP0stf3f1JwrawlvX4Ly60S =MS2D -----END PGP SIGNATURE----- --HlL+5n6rz5pIUxbD-- From owner-svn-src-user@FreeBSD.ORG Fri Nov 7 19:26:21 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EFC387F9; Fri, 7 Nov 2014 19:26:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2B5EFF8; Fri, 7 Nov 2014 19:26:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA7JQL8n006211; Fri, 7 Nov 2014 19:26:21 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA7JQLEn006206; Fri, 7 Nov 2014 19:26:21 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201411071926.sA7JQLEn006206@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Fri, 7 Nov 2014 19:26:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r274247 - in user/dchagin/lemul/sys: kern sys X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 19:26:22 -0000 Author: dchagin Date: Fri Nov 7 19:26:20 2014 New Revision: 274247 URL: https://svnweb.freebsd.org/changeset/base/274247 Log: Native syscalls use u_int for nfds parameter and helpers should follow them. Pointed out by: kib Modified: user/dchagin/lemul/sys/kern/sys_generic.c user/dchagin/lemul/sys/sys/syscallsubr.h Modified: user/dchagin/lemul/sys/kern/sys_generic.c ============================================================================== --- user/dchagin/lemul/sys/kern/sys_generic.c Fri Nov 7 19:13:19 2014 (r274246) +++ user/dchagin/lemul/sys/kern/sys_generic.c Fri Nov 7 19:26:20 2014 (r274247) @@ -97,7 +97,7 @@ static int pollout(struct thread *, stru u_int); static int pollscan(struct thread *, struct pollfd *, u_int); static int pollrescan(struct thread *); -static int kern_poll(struct thread *, struct pollfd *, uint32_t, +static int kern_poll(struct thread *, struct pollfd *, u_int, sbintime_t, sbintime_t); static int selscan(struct thread *, fd_mask **, fd_mask **, int); static int selrescan(struct thread *, fd_mask **, fd_mask **); @@ -1326,7 +1326,7 @@ sys_poll(td, uap) } static int -kern_poll(struct thread *td, struct pollfd *fds, uint32_t nfds, +kern_poll(struct thread *td, struct pollfd *fds, u_int nfds, sbintime_t sbt, sbintime_t prec) { struct pollfd *bits; @@ -1378,7 +1378,7 @@ out: } int -kern_ppoll(struct thread *td, struct pollfd *fds, uint32_t nfds, +kern_ppoll(struct thread *td, struct pollfd *fds, u_int nfds, struct timespec *tsp, sigset_t *uset) { struct timespec ts; Modified: user/dchagin/lemul/sys/sys/syscallsubr.h ============================================================================== --- user/dchagin/lemul/sys/sys/syscallsubr.h Fri Nov 7 19:13:19 2014 (r274246) +++ user/dchagin/lemul/sys/sys/syscallsubr.h Fri Nov 7 19:26:20 2014 (r274247) @@ -170,7 +170,7 @@ int kern_pathconf(struct thread *td, cha int name, u_long flags); int kern_pipe(struct thread *td, int fildes[2]); int kern_pipe2(struct thread *td, int fildes[2], int flags); -int kern_ppoll(struct thread *td, struct pollfd *fds, uint32_t nfds, +int kern_ppoll(struct thread *td, struct pollfd *fds, u_int nfds, struct timespec *tsp, sigset_t *uset); int kern_posix_fadvise(struct thread *td, int fd, off_t offset, off_t len, int advice); From owner-svn-src-user@FreeBSD.ORG Fri Nov 7 23:12:09 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2ED257A9; Fri, 7 Nov 2014 23:12:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1AA65B13; Fri, 7 Nov 2014 23:12:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA7NC8Nb017398; Fri, 7 Nov 2014 23:12:08 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA7NC86v017392; Fri, 7 Nov 2014 23:12:08 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201411072312.sA7NC86v017392@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Fri, 7 Nov 2014 23:12:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r274257 - in user/dchagin/lemul/sys: compat/freebsd32 kern X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 23:12:09 -0000 Author: dchagin Date: Fri Nov 7 23:12:07 2014 New Revision: 274257 URL: https://svnweb.freebsd.org/changeset/base/274257 Log: Add native ppoll system call. Modified: user/dchagin/lemul/sys/compat/freebsd32/freebsd32_misc.c user/dchagin/lemul/sys/compat/freebsd32/syscalls.master user/dchagin/lemul/sys/kern/sys_generic.c user/dchagin/lemul/sys/kern/syscalls.master Modified: user/dchagin/lemul/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- user/dchagin/lemul/sys/compat/freebsd32/freebsd32_misc.c Fri Nov 7 22:52:02 2014 (r274256) +++ user/dchagin/lemul/sys/compat/freebsd32/freebsd32_misc.c Fri Nov 7 23:12:07 2014 (r274257) @@ -3017,3 +3017,31 @@ freebsd32_fcntl(struct thread *td, struc } return (kern_fcntl_freebsd(td, uap->fd, uap->cmd, tmp)); } + +int +freebsd32_ppoll(struct thread *td, struct freebsd32_ppoll_args *uap) +{ + struct timespec32 ts32; + struct timespec ts, *tsp; + sigset_t set, *ssp; + int error; + + if (uap->ts != NULL) { + error = copyin(uap->ts, &ts32, sizeof(ts32)); + if (error != 0) + return (error); + CP(ts32, ts, tv_sec); + CP(ts32, ts, tv_nsec); + tsp = &ts; + } else + tsp = NULL; + if (uap->set != NULL) { + error = copyin(uap->set, &set, sizeof(set)); + if (error != 0) + return (error); + ssp = &set; + } else + ssp = NULL; + + return (kern_ppoll(td, uap->fds, uap->nfds, tsp, ssp)); +} Modified: user/dchagin/lemul/sys/compat/freebsd32/syscalls.master ============================================================================== --- user/dchagin/lemul/sys/compat/freebsd32/syscalls.master Fri Nov 7 22:52:02 2014 (r274256) +++ user/dchagin/lemul/sys/compat/freebsd32/syscalls.master Fri Nov 7 23:12:07 2014 (r274257) @@ -1066,3 +1066,6 @@ uint32_t id1, uint32_t id2, int com, \ void *data); } #endif +545 AUE_POLL STD { int freebsd32_ppoll(struct pollfd *fds, \ + u_int nfds, const struct timespec32 *ts, \ + const sigset_t *set); } Modified: user/dchagin/lemul/sys/kern/sys_generic.c ============================================================================== --- user/dchagin/lemul/sys/kern/sys_generic.c Fri Nov 7 22:52:02 2014 (r274256) +++ user/dchagin/lemul/sys/kern/sys_generic.c Fri Nov 7 23:12:07 2014 (r274257) @@ -1377,6 +1377,41 @@ out: return (error); } +#ifndef _SYS_SYSPROTO_H_ +struct ppoll_args { + struct pollfd *fds; + u_int nfds; + struct timespec *ts; + sigset_ *set; +}; +#endif +int +sys_ppoll(td, uap) + struct thread *td; + struct ppoll_args *uap; +{ + struct timespec ts, *tsp; + sigset_t set, *ssp; + int error; + + if (uap->ts != NULL) { + error = copyin(uap->ts, &ts, sizeof(ts)); + if (error) + return (error); + tsp = &ts; + } else + tsp = NULL; + if (uap->set != NULL) { + error = copyin(uap->set, &set, sizeof(set)); + if (error) + return (error); + ssp = &set; + } else + ssp = NULL; + + return (kern_ppoll(td, uap->fds, uap->nfds, tsp, ssp)); +} + int kern_ppoll(struct thread *td, struct pollfd *fds, u_int nfds, struct timespec *tsp, sigset_t *uset) Modified: user/dchagin/lemul/sys/kern/syscalls.master ============================================================================== --- user/dchagin/lemul/sys/kern/syscalls.master Fri Nov 7 22:52:02 2014 (r274256) +++ user/dchagin/lemul/sys/kern/syscalls.master Fri Nov 7 23:12:07 2014 (r274257) @@ -980,5 +980,8 @@ 543 AUE_NULL NOSTD { int aio_mlock(struct aiocb *aiocbp); } 544 AUE_NULL STD { int procctl(idtype_t idtype, id_t id, \ int com, void *data); } +545 AUE_POLL STD { int ppoll(struct pollfd *fds, u_int nfds, \ + const struct timespec *ts, \ + const sigset_t *set); } ; Please copy any additions and changes to the following compatability tables: ; sys/compat/freebsd32/syscalls.master From owner-svn-src-user@FreeBSD.ORG Fri Nov 7 23:14:15 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6778B977; Fri, 7 Nov 2014 23:14:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 485F2B3D; Fri, 7 Nov 2014 23:14:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sA7NEFKT017734; Fri, 7 Nov 2014 23:14:15 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sA7NECRj017716; Fri, 7 Nov 2014 23:14:12 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201411072314.sA7NECRj017716@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Fri, 7 Nov 2014 23:14:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r274258 - in user/dchagin/lemul/sys: compat/freebsd32 kern sys X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 23:14:15 -0000 Author: dchagin Date: Fri Nov 7 23:14:11 2014 New Revision: 274258 URL: https://svnweb.freebsd.org/changeset/base/274258 Log: Regen for r274257. Modified: user/dchagin/lemul/sys/compat/freebsd32/freebsd32_proto.h user/dchagin/lemul/sys/compat/freebsd32/freebsd32_syscall.h user/dchagin/lemul/sys/compat/freebsd32/freebsd32_syscalls.c user/dchagin/lemul/sys/compat/freebsd32/freebsd32_sysent.c user/dchagin/lemul/sys/compat/freebsd32/freebsd32_systrace_args.c user/dchagin/lemul/sys/kern/init_sysent.c user/dchagin/lemul/sys/kern/syscalls.c user/dchagin/lemul/sys/kern/systrace_args.c user/dchagin/lemul/sys/sys/syscall.h user/dchagin/lemul/sys/sys/syscall.mk user/dchagin/lemul/sys/sys/sysproto.h Modified: user/dchagin/lemul/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- user/dchagin/lemul/sys/compat/freebsd32/freebsd32_proto.h Fri Nov 7 23:12:07 2014 (r274257) +++ user/dchagin/lemul/sys/compat/freebsd32/freebsd32_proto.h Fri Nov 7 23:14:11 2014 (r274258) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 272823 2014-10-09 15:16:52Z marcel + * created from FreeBSD: user/dchagin/lemul/sys/compat/freebsd32/syscalls.master 274257 2014-11-07 23:12:07Z dchagin */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -687,6 +687,12 @@ struct freebsd32_procctl_args { char data_l_[PADL_(void *)]; void * data; char data_r_[PADR_(void *)]; }; #endif +struct freebsd32_ppoll_args { + char fds_l_[PADL_(struct pollfd *)]; struct pollfd * fds; char fds_r_[PADR_(struct pollfd *)]; + char nfds_l_[PADL_(u_int)]; u_int nfds; char nfds_r_[PADR_(u_int)]; + char ts_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * ts; char ts_r_[PADR_(const struct timespec32 *)]; + char set_l_[PADL_(const sigset_t *)]; const sigset_t * set; char set_r_[PADR_(const sigset_t *)]; +}; #if !defined(PAD64_REQUIRED) && (defined(__powerpc__) || defined(__mips__)) #define PAD64_REQUIRED #endif @@ -818,6 +824,7 @@ int freebsd32_procctl(struct thread *, s #else int freebsd32_procctl(struct thread *, struct freebsd32_procctl_args *); #endif +int freebsd32_ppoll(struct thread *, struct freebsd32_ppoll_args *); #ifdef COMPAT_43 @@ -1232,6 +1239,7 @@ int freebsd7_freebsd32_shmctl(struct thr #define FREEBSD32_SYS_AUE_freebsd32_aio_mlock AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_procctl AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_procctl AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_ppoll AUE_POLL #undef PAD_ #undef PADL_ Modified: user/dchagin/lemul/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- user/dchagin/lemul/sys/compat/freebsd32/freebsd32_syscall.h Fri Nov 7 23:12:07 2014 (r274257) +++ user/dchagin/lemul/sys/compat/freebsd32/freebsd32_syscall.h Fri Nov 7 23:14:11 2014 (r274258) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 272823 2014-10-09 15:16:52Z marcel + * created from FreeBSD: user/dchagin/lemul/sys/compat/freebsd32/syscalls.master 274257 2014-11-07 23:12:07Z dchagin */ #define FREEBSD32_SYS_syscall 0 @@ -452,4 +452,5 @@ #define FREEBSD32_SYS_freebsd32_aio_mlock 543 #define FREEBSD32_SYS_freebsd32_procctl 544 #define FREEBSD32_SYS_freebsd32_procctl 544 -#define FREEBSD32_SYS_MAXSYSCALL 545 +#define FREEBSD32_SYS_freebsd32_ppoll 545 +#define FREEBSD32_SYS_MAXSYSCALL 546 Modified: user/dchagin/lemul/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- user/dchagin/lemul/sys/compat/freebsd32/freebsd32_syscalls.c Fri Nov 7 23:12:07 2014 (r274257) +++ user/dchagin/lemul/sys/compat/freebsd32/freebsd32_syscalls.c Fri Nov 7 23:14:11 2014 (r274258) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 272823 2014-10-09 15:16:52Z marcel + * created from FreeBSD: user/dchagin/lemul/sys/compat/freebsd32/syscalls.master 274257 2014-11-07 23:12:07Z dchagin */ const char *freebsd32_syscallnames[] = { @@ -578,4 +578,5 @@ const char *freebsd32_syscallnames[] = { #else "freebsd32_procctl", /* 544 = freebsd32_procctl */ #endif + "freebsd32_ppoll", /* 545 = freebsd32_ppoll */ }; Modified: user/dchagin/lemul/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- user/dchagin/lemul/sys/compat/freebsd32/freebsd32_sysent.c Fri Nov 7 23:12:07 2014 (r274257) +++ user/dchagin/lemul/sys/compat/freebsd32/freebsd32_sysent.c Fri Nov 7 23:14:11 2014 (r274258) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 272823 2014-10-09 15:16:52Z marcel + * created from FreeBSD: user/dchagin/lemul/sys/compat/freebsd32/syscalls.master 274257 2014-11-07 23:12:07Z dchagin */ #include "opt_compat.h" @@ -615,4 +615,5 @@ struct sysent freebsd32_sysent[] = { #else { AS(freebsd32_procctl_args), (sy_call_t *)freebsd32_procctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 544 = freebsd32_procctl */ #endif + { AS(freebsd32_ppoll_args), (sy_call_t *)freebsd32_ppoll, AUE_POLL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 545 = freebsd32_ppoll */ }; Modified: user/dchagin/lemul/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- user/dchagin/lemul/sys/compat/freebsd32/freebsd32_systrace_args.c Fri Nov 7 23:12:07 2014 (r274257) +++ user/dchagin/lemul/sys/compat/freebsd32/freebsd32_systrace_args.c Fri Nov 7 23:14:11 2014 (r274258) @@ -3299,6 +3299,16 @@ systrace_args(int sysnum, void *params, break; } #endif + /* freebsd32_ppoll */ + case 545: { + struct freebsd32_ppoll_args *p = params; + uarg[0] = (intptr_t) p->fds; /* struct pollfd * */ + uarg[1] = p->nfds; /* u_int */ + uarg[2] = (intptr_t) p->ts; /* const struct timespec32 * */ + uarg[3] = (intptr_t) p->set; /* const sigset_t * */ + *n_args = 4; + break; + } default: *n_args = 0; break; @@ -8844,6 +8854,25 @@ systrace_entry_setargdesc(int sysnum, in }; break; #endif + /* freebsd32_ppoll */ + case 545: + switch(ndx) { + case 0: + p = "struct pollfd *"; + break; + case 1: + p = "u_int"; + break; + case 2: + p = "const struct timespec32 *"; + break; + case 3: + p = "const sigset_t *"; + break; + default: + break; + }; + break; default: break; }; @@ -10717,6 +10746,11 @@ systrace_return_setargdesc(int sysnum, i p = "int"; break; #endif + /* freebsd32_ppoll */ + case 545: + if (ndx == 0 || ndx == 1) + p = "int"; + break; default: break; }; Modified: user/dchagin/lemul/sys/kern/init_sysent.c ============================================================================== --- user/dchagin/lemul/sys/kern/init_sysent.c Fri Nov 7 23:12:07 2014 (r274257) +++ user/dchagin/lemul/sys/kern/init_sysent.c Fri Nov 7 23:14:11 2014 (r274258) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 272823 2014-10-09 15:16:52Z marcel + * created from FreeBSD: user/dchagin/lemul/sys/kern/syscalls.master 274257 2014-11-07 23:12:07Z dchagin */ #include "opt_compat.h" @@ -579,4 +579,5 @@ struct sysent sysent[] = { { AS(pipe2_args), (sy_call_t *)sys_pipe2, AUE_PIPE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 542 = pipe2 */ { AS(aio_mlock_args), (sy_call_t *)lkmressys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 543 = aio_mlock */ { AS(procctl_args), (sy_call_t *)sys_procctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 544 = procctl */ + { AS(ppoll_args), (sy_call_t *)sys_ppoll, AUE_POLL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 545 = ppoll */ }; Modified: user/dchagin/lemul/sys/kern/syscalls.c ============================================================================== --- user/dchagin/lemul/sys/kern/syscalls.c Fri Nov 7 23:12:07 2014 (r274257) +++ user/dchagin/lemul/sys/kern/syscalls.c Fri Nov 7 23:14:11 2014 (r274258) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 272823 2014-10-09 15:16:52Z marcel + * created from FreeBSD: user/dchagin/lemul/sys/kern/syscalls.master 274257 2014-11-07 23:12:07Z dchagin */ const char *syscallnames[] = { @@ -552,4 +552,5 @@ const char *syscallnames[] = { "pipe2", /* 542 = pipe2 */ "aio_mlock", /* 543 = aio_mlock */ "procctl", /* 544 = procctl */ + "ppoll", /* 545 = ppoll */ }; Modified: user/dchagin/lemul/sys/kern/systrace_args.c ============================================================================== --- user/dchagin/lemul/sys/kern/systrace_args.c Fri Nov 7 23:12:07 2014 (r274257) +++ user/dchagin/lemul/sys/kern/systrace_args.c Fri Nov 7 23:14:11 2014 (r274258) @@ -3372,6 +3372,16 @@ systrace_args(int sysnum, void *params, *n_args = 4; break; } + /* ppoll */ + case 545: { + struct ppoll_args *p = params; + uarg[0] = (intptr_t) p->fds; /* struct pollfd * */ + uarg[1] = p->nfds; /* u_int */ + uarg[2] = (intptr_t) p->ts; /* const struct timespec * */ + uarg[3] = (intptr_t) p->set; /* const sigset_t * */ + *n_args = 4; + break; + } default: *n_args = 0; break; @@ -8990,6 +9000,25 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; + /* ppoll */ + case 545: + switch(ndx) { + case 0: + p = "struct pollfd *"; + break; + case 1: + p = "u_int"; + break; + case 2: + p = "const struct timespec *"; + break; + case 3: + p = "const sigset_t *"; + break; + default: + break; + }; + break; default: break; }; @@ -10928,6 +10957,11 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; + /* ppoll */ + case 545: + if (ndx == 0 || ndx == 1) + p = "int"; + break; default: break; }; Modified: user/dchagin/lemul/sys/sys/syscall.h ============================================================================== --- user/dchagin/lemul/sys/sys/syscall.h Fri Nov 7 23:12:07 2014 (r274257) +++ user/dchagin/lemul/sys/sys/syscall.h Fri Nov 7 23:14:11 2014 (r274258) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 272823 2014-10-09 15:16:52Z marcel + * created from FreeBSD: user/dchagin/lemul/sys/kern/syscalls.master 274257 2014-11-07 23:12:07Z dchagin */ #define SYS_syscall 0 @@ -462,4 +462,5 @@ #define SYS_pipe2 542 #define SYS_aio_mlock 543 #define SYS_procctl 544 -#define SYS_MAXSYSCALL 545 +#define SYS_ppoll 545 +#define SYS_MAXSYSCALL 546 Modified: user/dchagin/lemul/sys/sys/syscall.mk ============================================================================== --- user/dchagin/lemul/sys/sys/syscall.mk Fri Nov 7 23:12:07 2014 (r274257) +++ user/dchagin/lemul/sys/sys/syscall.mk Fri Nov 7 23:14:11 2014 (r274258) @@ -1,7 +1,7 @@ # FreeBSD system call names. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD: head/sys/kern/syscalls.master 272823 2014-10-09 15:16:52Z marcel +# created from FreeBSD: user/dchagin/lemul/sys/kern/syscalls.master 274257 2014-11-07 23:12:07Z dchagin MIASM = \ syscall.o \ exit.o \ @@ -409,4 +409,5 @@ MIASM = \ accept4.o \ pipe2.o \ aio_mlock.o \ - procctl.o + procctl.o \ + ppoll.o Modified: user/dchagin/lemul/sys/sys/sysproto.h ============================================================================== --- user/dchagin/lemul/sys/sys/sysproto.h Fri Nov 7 23:12:07 2014 (r274257) +++ user/dchagin/lemul/sys/sys/sysproto.h Fri Nov 7 23:14:11 2014 (r274258) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 272823 2014-10-09 15:16:52Z marcel + * created from FreeBSD: user/dchagin/lemul/sys/kern/syscalls.master 274257 2014-11-07 23:12:07Z dchagin */ #ifndef _SYS_SYSPROTO_H_ @@ -1813,6 +1813,12 @@ struct procctl_args { char com_l_[PADL_(int)]; int com; char com_r_[PADR_(int)]; char data_l_[PADL_(void *)]; void * data; char data_r_[PADR_(void *)]; }; +struct ppoll_args { + char fds_l_[PADL_(struct pollfd *)]; struct pollfd * fds; char fds_r_[PADR_(struct pollfd *)]; + char nfds_l_[PADL_(u_int)]; u_int nfds; char nfds_r_[PADR_(u_int)]; + char ts_l_[PADL_(const struct timespec *)]; const struct timespec * ts; char ts_r_[PADR_(const struct timespec *)]; + char set_l_[PADL_(const sigset_t *)]; const sigset_t * set; char set_r_[PADR_(const sigset_t *)]; +}; int nosys(struct thread *, struct nosys_args *); void sys_sys_exit(struct thread *, struct sys_exit_args *); int sys_fork(struct thread *, struct fork_args *); @@ -2204,6 +2210,7 @@ int sys_accept4(struct thread *, struct int sys_pipe2(struct thread *, struct pipe2_args *); int sys_aio_mlock(struct thread *, struct aio_mlock_args *); int sys_procctl(struct thread *, struct procctl_args *); +int sys_ppoll(struct thread *, struct ppoll_args *); #ifdef COMPAT_43 @@ -2909,6 +2916,7 @@ int freebsd7_shmctl(struct thread *, str #define SYS_AUE_pipe2 AUE_PIPE #define SYS_AUE_aio_mlock AUE_NULL #define SYS_AUE_procctl AUE_NULL +#define SYS_AUE_ppoll AUE_POLL #undef PAD_ #undef PADL_ From owner-svn-src-user@FreeBSD.ORG Fri Nov 7 23:19:10 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34870BB0; Fri, 7 Nov 2014 23:19:10 +0000 (UTC) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id E8A83B77; Fri, 7 Nov 2014 23:19:09 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id DFDC2D66F19; Sat, 8 Nov 2014 10:19:07 +1100 (AEDT) Date: Sat, 8 Nov 2014 10:18:54 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov Subject: Re: svn commit: r274242 - in user/dchagin/lemul/sys: kern sys In-Reply-To: <20141107181714.GT53947@kib.kiev.ua> Message-ID: <20141108091009.A1763@besplex.bde.org> References: <201411071625.sA7GP85K020870@svn.freebsd.org> <20141107181714.GT53947@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=dMCfxopb c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=04mSCos3QsjlVVcB8JcA:9 a=1DSwelrRe4mSFjMK:21 a=nukrnVvTfnLa5VV2:21 a=CjuIK1q_8ugA:10 Cc: src-committers@freebsd.org, Dmitry Chagin , svn-src-user@freebsd.org X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 23:19:10 -0000 On Fri, 7 Nov 2014, Konstantin Belousov wrote: > On Fri, Nov 07, 2014 at 04:25:08PM +0000, Dmitry Chagin wrote: >> ... >> @@ -1337,13 +1321,37 @@ sys_poll(td, uap) >> } >> } else >> asbt = -1; >> + >> + return (kern_poll(td, uap->fds, uap->nfds, asbt, precision)); >> +} >> + >> +static int >> +kern_poll(struct thread *td, struct pollfd *fds, uint32_t nfds, >> + sbintime_t sbt, sbintime_t prec) > uint32_t type fo nfds is weird and probably even wrong. > Native syscalls use unsigned int for it, and this helper definitely > should follow them. > >> +{ >> + struct pollfd *bits; >> + struct pollfd smallbits[32]; >> + int error; >> + size_t ni; >> + >> + if (nfds > maxfilesperproc && nfds > FD_SETSIZE) >> + return (EINVAL); > This line was moved from the original code intact, but it still > looks strange. What is the purpose of FD_SETSIZE test ? This is a hack by peter IIRC. Old versions have a comment explaining it. I never liked it, but only changed the comment and fixed style bugs in the code. % Index: sys_generic.c % =================================================================== % RCS file: /home/ncvs/src/sys/kern/sys_generic.c,v % retrieving revision 1.131 % diff -u -2 -r1.131 sys_generic.c % --- sys_generic.c 5 Apr 2004 21:03:35 -0000 1.131 % +++ sys_generic.c 13 Aug 2009 11:21:29 -0000 % @@ -960,19 +945,27 @@ % */ % mtx_lock(&Giant); % + % /* % - * This is kinda bogus. We have fd limits, but that is not % - * really related to the size of the pollfd array. Make sure % - * we let the process use at least FD_SETSIZE entries and at % - * least enough for the current limits. We want to be reasonably % - * safe, but not overly restrictive. % + * Unlike for select(), the number of currently open files is % + * not really related to the size of the of the array (the array % + * may be packed or sparse). We have limits on the maximum % + * number of open files, but these are even less related to the % + * size of the array and may be too large anyway. Let the process % + * use up to p->p_fd->fd_nfiles or FD_SETSIZE entries, whichever % + * is greater. The first limit allows packed arrays containing % + * descriptors for all open files, and the second limit allows % + * sparse arrays with room for filling in the gaps with the % + * descriptors for about FD_SETSIZE files that will be opened % + * later. Standards require arrays with up to {OPEN_MAX} entries % + * to work, but we can't support that because {OPEN_MAX} might be % + * LONG_MAX. We support {OPEN_MAX} entries because the default for % + * OPEN_MAX is less than the default for FD_SETSIZE. Someday we % + * will have a reasonable limit on {OPEN_MAX} and then we can use % + * it here. % */ % - PROC_LOCK(td->td_proc); % - if ((nfds > lim_cur(td->td_proc, RLIMIT_NOFILE)) && % - (nfds > FD_SETSIZE)) { % - PROC_UNLOCK(td->td_proc); % + if (nfds > td->td_proc->p_fd->fd_nfiles && nfds > FD_SETSIZE) { % error = EINVAL; % goto done2; % } % - PROC_UNLOCK(td->td_proc); % ni = nfds * sizeof(struct pollfd); % if (ni > sizeof(smallbits)) -current already has the style fixes. Opps, I changed the code significantly by replacing the RLIMIT_NOFILE limit by an fd_nfiles limit. -current has the worse change of replacing it by a maxfilesperproc limit. My change has a better chance of not breaking poll() on descriptors that are larger than the current limit but are valid because they were opened when the limit was larger. It is a bug for both to limit the _number_ of fds using any limit on the maximum fd. My test allows an array containing all opened fds with no duplicates, but not arrays containing all open fds with duplicates. The comment has a bug for {OPEN_MAX}. We only support the default OPEN_MAX number of entries. {OPEN_MAX} is the runtime value. We don't support that properly. OPEN_MAX is broken by its existence, since the actual limit is variable. POSIX now specifies in more cases what happens to existing open fds when the limits are reduced below the fd numbers. That is for the rlimits. FreeBSD's administrative maxfiles and maxfilesperproc break the rlimits in ways not conforming to POSIX or documented in FreeBSD if these limits are actually changed (using sysctl), and are still applied in buggy ways: % /* ARGSUSED */ Bogus. The args are used. % int % sys_getdtablesize(struct thread *td, struct getdtablesize_args *uap) % { % struct proc *p = td->td_proc; Initialization in declaration. % uint64_t lim; % % PROC_LOCK(p); % td->td_retval[0] = % min((int)lim_cur(p, RLIMIT_NOFILE), maxfilesperproc); Type errors: - min() is for u_int types, but is applied to int types. This gives a bug only (?) when maxfilesproc is set to a silly negative value. - lim_cur() returns type rlim_t (64 bits). The possibility of the compiler warning about rruncation from this is broken by bogusly casting to int. But this is normally harmless because it is difficult to set the rlimit to a value that won't fit in an int. Old programs and libraries that try to be careful about fd limits mostly use this syscall. This is unportable, and newer programs should use {OPEN_MAX} via sysconf(). But these interfaces are incompatible -- {OPEN_MAX} is POSIXly correct, but more broken in practice since it doesn't apply the maxvilesperproc clamp. % lim = racct_get_limit(td->td_proc, RACCT_NOFILE); % PROC_UNLOCK(p); % if (lim < td->td_retval[0]) % td->td_retval[0] = lim; I don't understand racct. It is almost undocumented. RACCT_NOFILE is undocumented. But this clearly breaks the POSIX limits some more by enforcing another undocumented clamp that sysconf() doesn't know about. % return (0); % } % % static int % getmaxfd(struct proc *p) % { % int maxfd; % % PROC_LOCK(p); % maxfd = min((int)lim_cur(p, RLIMIT_NOFILE), maxfilesperproc); % PROC_UNLOCK(p); % Style bug. % return (maxfd); % } This is used internally. It is bug for bug compatible with getdtablesize() except possibly for handling of racct since it depends on the caller to do racct stuff and callers do it in a different order. This replaces several copies of similar code with the type errors and 1 copy of similar code without the type errors (2 copies without the type errors in my version). IIRC, POSIX now clarifies that operations with existing open fds are not affected by the changes to the limits. FreeBSD seems to conform to this for RLIMIT_NOFILE except for the clamp in poll(). It is broken for setting and reporting the limit that applies to new open fds. Bruce From owner-svn-src-user@FreeBSD.ORG Sat Nov 8 10:28:18 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DD66E5B5; Sat, 8 Nov 2014 10:28:18 +0000 (UTC) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 672B9DCC; Sat, 8 Nov 2014 10:28:18 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id sA8ASBgt025640 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 8 Nov 2014 12:28:12 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.9.2 kib.kiev.ua sA8ASBgt025640 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id sA8ASBhM025639; Sat, 8 Nov 2014 12:28:11 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 8 Nov 2014 12:28:11 +0200 From: Konstantin Belousov To: Dmitry Chagin Subject: Re: svn commit: r274257 - in user/dchagin/lemul/sys: compat/freebsd32 kern Message-ID: <20141108102811.GU53947@kib.kiev.ua> References: <201411072312.sA7NC86v017392@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201411072312.sA7NC86v017392@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on tom.home Cc: src-committers@freebsd.org, svn-src-user@freebsd.org X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 10:28:19 -0000 On Fri, Nov 07, 2014 at 11:12:08PM +0000, Dmitry Chagin wrote: > Author: dchagin > Date: Fri Nov 7 23:12:07 2014 > New Revision: 274257 > URL: https://svnweb.freebsd.org/changeset/base/274257 > > Log: > Add native ppoll system call. > > Modified: > user/dchagin/lemul/sys/compat/freebsd32/freebsd32_misc.c > user/dchagin/lemul/sys/compat/freebsd32/syscalls.master > user/dchagin/lemul/sys/kern/sys_generic.c > user/dchagin/lemul/sys/kern/syscalls.master > > Modified: user/dchagin/lemul/sys/compat/freebsd32/freebsd32_misc.c > ============================================================================== > --- user/dchagin/lemul/sys/compat/freebsd32/freebsd32_misc.c Fri Nov 7 22:52:02 2014 (r274256) > +++ user/dchagin/lemul/sys/compat/freebsd32/freebsd32_misc.c Fri Nov 7 23:12:07 2014 (r274257) > @@ -3017,3 +3017,31 @@ freebsd32_fcntl(struct thread *td, struc > } > return (kern_fcntl_freebsd(td, uap->fd, uap->cmd, tmp)); > } > + > +int > +freebsd32_ppoll(struct thread *td, struct freebsd32_ppoll_args *uap) > +{ > + struct timespec32 ts32; > + struct timespec ts, *tsp; > + sigset_t set, *ssp; > + int error; > + > + if (uap->ts != NULL) { > + error = copyin(uap->ts, &ts32, sizeof(ts32)); > + if (error != 0) > + return (error); > + CP(ts32, ts, tv_sec); > + CP(ts32, ts, tv_nsec); > + tsp = &ts; > + } else > + tsp = NULL; > + if (uap->set != NULL) { > + error = copyin(uap->set, &set, sizeof(set)); > + if (error != 0) > + return (error); > + ssp = &set; > + } else > + ssp = NULL; > + > + return (kern_ppoll(td, uap->fds, uap->nfds, tsp, ssp)); > +} > > Modified: user/dchagin/lemul/sys/compat/freebsd32/syscalls.master > ============================================================================== > --- user/dchagin/lemul/sys/compat/freebsd32/syscalls.master Fri Nov 7 22:52:02 2014 (r274256) > +++ user/dchagin/lemul/sys/compat/freebsd32/syscalls.master Fri Nov 7 23:12:07 2014 (r274257) > @@ -1066,3 +1066,6 @@ > uint32_t id1, uint32_t id2, int com, \ > void *data); } > #endif > +545 AUE_POLL STD { int freebsd32_ppoll(struct pollfd *fds, \ > + u_int nfds, const struct timespec32 *ts, \ > + const sigset_t *set); } > > Modified: user/dchagin/lemul/sys/kern/sys_generic.c > ============================================================================== > --- user/dchagin/lemul/sys/kern/sys_generic.c Fri Nov 7 22:52:02 2014 (r274256) > +++ user/dchagin/lemul/sys/kern/sys_generic.c Fri Nov 7 23:12:07 2014 (r274257) > @@ -1377,6 +1377,41 @@ out: > return (error); > } > > +#ifndef _SYS_SYSPROTO_H_ > +struct ppoll_args { > + struct pollfd *fds; > + u_int nfds; > + struct timespec *ts; > + sigset_ *set; This is spelled sigset_t. In fact, I do not think we should keep maintain the unused manually copied syscall arg structs definitions. At least, I never added them for new syscalls. > +}; > +#endif > +int > +sys_ppoll(td, uap) > + struct thread *td; > + struct ppoll_args *uap; Please use C89 function definitions for new code. > +{ > + struct timespec ts, *tsp; > + sigset_t set, *ssp; > + int error; > + > + if (uap->ts != NULL) { > + error = copyin(uap->ts, &ts, sizeof(ts)); > + if (error) > + return (error); > + tsp = &ts; > + } else > + tsp = NULL; > + if (uap->set != NULL) { > + error = copyin(uap->set, &set, sizeof(set)); > + if (error) > + return (error); > + ssp = &set; > + } else > + ssp = NULL; > + > + return (kern_ppoll(td, uap->fds, uap->nfds, tsp, ssp)); > +} > + > int > kern_ppoll(struct thread *td, struct pollfd *fds, u_int nfds, > struct timespec *tsp, sigset_t *uset) One more note about kern_ppoll(). As I see, tsp and uset are supposed to be in the KVA, while fds points to UVA. This is consistent with kern_select(), but is surprising for somebody who reads the code. Please add comments explaining the conventions. Also, I think ppoll(2) should be extracted from the branch and committed on its own. What about man page ? Or update of poll(2). From owner-svn-src-user@FreeBSD.ORG Sat Nov 8 14:16:46 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4803E48D; Sat, 8 Nov 2014 14:16:46 +0000 (UTC) Received: from dchagin.static.corbina.net (dchagin.static.corbina.ru [78.107.232.239]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "dchagin.static.corbina.net", Issuer "dchagin.static.corbina.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C189A403; Sat, 8 Nov 2014 14:16:44 +0000 (UTC) Received: from dchagin.static.corbina.net (localhost [127.0.0.1]) by dchagin.static.corbina.net (8.14.9/8.14.9) with ESMTP id sA8EGeRM018820 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 8 Nov 2014 17:16:40 +0300 (MSK) (envelope-from dchagin@dchagin.static.corbina.net) Received: (from dchagin@localhost) by dchagin.static.corbina.net (8.14.9/8.14.9/Submit) id sA8EGeMc018819; Sat, 8 Nov 2014 17:16:40 +0300 (MSK) (envelope-from dchagin) Date: Sat, 8 Nov 2014 17:16:40 +0300 From: Chagin Dmitry To: Konstantin Belousov Subject: Re: svn commit: r274257 - in user/dchagin/lemul/sys: compat/freebsd32 kern Message-ID: <20141108141640.GC15283@dchagin.static.corbina.net> References: <201411072312.sA7NC86v017392@svn.freebsd.org> <20141108102811.GU53947@kib.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="t0UkRYy7tHLRMCai" Content-Disposition: inline In-Reply-To: <20141108102811.GU53947@kib.kiev.ua> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: src-committers@freebsd.org, svn-src-user@freebsd.org X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 14:16:46 -0000 --t0UkRYy7tHLRMCai Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Nov 08, 2014 at 12:28:11PM +0200, Konstantin Belousov wrote: > On Fri, Nov 07, 2014 at 11:12:08PM +0000, Dmitry Chagin wrote: > > Author: dchagin > > Date: Fri Nov 7 23:12:07 2014 > > New Revision: 274257 > > URL: https://svnweb.freebsd.org/changeset/base/274257 > >=20 > > Log: > > Add native ppoll system call. > >=20 > > Modified: > > user/dchagin/lemul/sys/compat/freebsd32/freebsd32_misc.c > > user/dchagin/lemul/sys/compat/freebsd32/syscalls.master > > user/dchagin/lemul/sys/kern/sys_generic.c > > user/dchagin/lemul/sys/kern/syscalls.master > >=20 > > Modified: user/dchagin/lemul/sys/compat/freebsd32/freebsd32_misc.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- user/dchagin/lemul/sys/compat/freebsd32/freebsd32_misc.c Fri Nov 7= 22:52:02 2014 (r274256) > > +++ user/dchagin/lemul/sys/compat/freebsd32/freebsd32_misc.c Fri Nov 7= 23:12:07 2014 (r274257) > > @@ -3017,3 +3017,31 @@ freebsd32_fcntl(struct thread *td, struc > > } > > return (kern_fcntl_freebsd(td, uap->fd, uap->cmd, tmp)); > > } > > + > > +int > > +freebsd32_ppoll(struct thread *td, struct freebsd32_ppoll_args *uap) > > +{ > > + struct timespec32 ts32; > > + struct timespec ts, *tsp; > > + sigset_t set, *ssp; > > + int error; > > + > > + if (uap->ts !=3D NULL) { > > + error =3D copyin(uap->ts, &ts32, sizeof(ts32)); > > + if (error !=3D 0) > > + return (error); > > + CP(ts32, ts, tv_sec); > > + CP(ts32, ts, tv_nsec); > > + tsp =3D &ts; > > + } else > > + tsp =3D NULL; > > + if (uap->set !=3D NULL) { > > + error =3D copyin(uap->set, &set, sizeof(set)); > > + if (error !=3D 0) > > + return (error); > > + ssp =3D &set; > > + } else > > + ssp =3D NULL; > > + > > + return (kern_ppoll(td, uap->fds, uap->nfds, tsp, ssp)); > > +} > >=20 > > Modified: user/dchagin/lemul/sys/compat/freebsd32/syscalls.master > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- user/dchagin/lemul/sys/compat/freebsd32/syscalls.master Fri Nov 7 = 22:52:02 2014 (r274256) > > +++ user/dchagin/lemul/sys/compat/freebsd32/syscalls.master Fri Nov 7 = 23:12:07 2014 (r274257) > > @@ -1066,3 +1066,6 @@ > > uint32_t id1, uint32_t id2, int com, \ > > void *data); } > > #endif > > +545 AUE_POLL STD { int freebsd32_ppoll(struct pollfd *fds, \ > > + u_int nfds, const struct timespec32 *ts, \ > > + const sigset_t *set); } > >=20 > > Modified: user/dchagin/lemul/sys/kern/sys_generic.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- user/dchagin/lemul/sys/kern/sys_generic.c Fri Nov 7 22:52:02 2014 = (r274256) > > +++ user/dchagin/lemul/sys/kern/sys_generic.c Fri Nov 7 23:12:07 2014 = (r274257) > > @@ -1377,6 +1377,41 @@ out: > > return (error); > > } > > =20 > > +#ifndef _SYS_SYSPROTO_H_ > > +struct ppoll_args { > > + struct pollfd *fds; > > + u_int nfds; > > + struct timespec *ts; > > + sigset_ *set; > This is spelled sigset_t. In fact, I do not think we should keep maintain > the unused manually copied syscall arg structs definitions. At least, > I never added them for new syscalls. >=20 yeah, thank you! i'll fix soon. > > +}; > > +#endif > > +int > > +sys_ppoll(td, uap) > > + struct thread *td; > > + struct ppoll_args *uap; > Please use C89 function definitions for new code. >=20 sure > > +{ > > + struct timespec ts, *tsp; > > + sigset_t set, *ssp; > > + int error; > > + > > + if (uap->ts !=3D NULL) { > > + error =3D copyin(uap->ts, &ts, sizeof(ts)); > > + if (error) > > + return (error); > > + tsp =3D &ts; > > + } else > > + tsp =3D NULL; > > + if (uap->set !=3D NULL) { > > + error =3D copyin(uap->set, &set, sizeof(set)); > > + if (error) > > + return (error); > > + ssp =3D &set; > > + } else > > + ssp =3D NULL; > > + > > + return (kern_ppoll(td, uap->fds, uap->nfds, tsp, ssp)); > > +} > > + > > int > > kern_ppoll(struct thread *td, struct pollfd *fds, u_int nfds, > > struct timespec *tsp, sigset_t *uset) >=20 > One more note about kern_ppoll(). As I see, tsp and uset are supposed > to be in the KVA, while fds points to UVA. This is consistent with > kern_select(), but is surprising for somebody who reads the code. > Please add comments explaining the conventions. ok >=20 > Also, I think ppoll(2) should be extracted from the branch and committed > on its own. agree >=20 > What about man page ? Or update of poll(2). oh.. I'll try, it's not easy for me --=20 Have fun! chd --t0UkRYy7tHLRMCai Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlReJcgACgkQ0t2Tb3OO/O1EtACgzqCe6e3cEAkLBdWCoSxNXt6+ xrEAnj6advwUzAJ4SypxZ0tbIBPSBUHT =Bol4 -----END PGP SIGNATURE----- --t0UkRYy7tHLRMCai-- From owner-svn-src-user@FreeBSD.ORG Sat Nov 8 14:35:12 2014 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 75AA85F8; Sat, 8 Nov 2014 14:35:12 +0000 (UTC) Received: from mail-wi0-x233.google.com (mail-wi0-x233.google.com [IPv6:2a00:1450:400c:c05::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 06410796; Sat, 8 Nov 2014 14:35:11 +0000 (UTC) Received: by mail-wi0-f179.google.com with SMTP id h11so6827121wiw.6 for ; Sat, 08 Nov 2014 06:35:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=ZQLZJ/yaUW/NMjbDGNBBxDXA5oy95hiSIjsxbmXDVvE=; b=wfVLwjHnFw8UdRN3hmMa+HOIszHBzYtAstCi5IkGI3Ikbfpn2Qz4/cYEc2Vqd3TzSu WRZKzjgAHa47Y6xNBCBbIbQaWbhSyLlUsYFc277v9/IFFSrimBfKya5G8ITGP50FIu6C NNLZhq8qD06KpQDvN0r2AI4Q78KH/d/cH6wzsgogV8oARESUhbuR35lLQOh1IkwyCFz+ HFy/q6R6foVaWy2ElxhCN0M8BvydpvyO9Rwk5no1Ly/2yelQktnj4e5kj29sGJHj+Tkl /l05YCKZPf0o5zew9fIGXjWaq+90zi28QBaSdGBnXqsQAA6mdtsneDa6FHU0yT+fepYE l5EQ== X-Received: by 10.180.84.167 with SMTP id a7mr14655854wiz.39.1415457310044; Sat, 08 Nov 2014 06:35:10 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id x3sm5899858wiy.4.2014.11.08.06.35.08 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 08 Nov 2014 06:35:09 -0800 (PST) Sender: Baptiste Daroussin Date: Sat, 8 Nov 2014 15:35:06 +0100 From: Baptiste Daroussin To: Chagin Dmitry Subject: Re: svn commit: r274257 - in user/dchagin/lemul/sys: compat/freebsd32 kern Message-ID: <20141108143506.GF19308@ivaldir.etoilebsd.net> References: <201411072312.sA7NC86v017392@svn.freebsd.org> <20141108102811.GU53947@kib.kiev.ua> <20141108141640.GC15283@dchagin.static.corbina.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="AGZzQgpsuUlWC1xT" Content-Disposition: inline In-Reply-To: <20141108141640.GC15283@dchagin.static.corbina.net> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: Konstantin Belousov , src-committers@freebsd.org, svn-src-user@freebsd.org X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Nov 2014 14:35:12 -0000 --AGZzQgpsuUlWC1xT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Nov 08, 2014 at 05:16:40PM +0300, Chagin Dmitry wrote: > On Sat, Nov 08, 2014 at 12:28:11PM +0200, Konstantin Belousov wrote: > > On Fri, Nov 07, 2014 at 11:12:08PM +0000, Dmitry Chagin wrote: > > > Author: dchagin > > > Date: Fri Nov 7 23:12:07 2014 > > > New Revision: 274257 > > > URL: https://svnweb.freebsd.org/changeset/base/274257 > > >=20 > > > Log: > > > Add native ppoll system call. > > >=20 > > > Modified: > > > user/dchagin/lemul/sys/compat/freebsd32/freebsd32_misc.c > > > user/dchagin/lemul/sys/compat/freebsd32/syscalls.master > > > user/dchagin/lemul/sys/kern/sys_generic.c > > > user/dchagin/lemul/sys/kern/syscalls.master > > >=20 > > > Modified: user/dchagin/lemul/sys/compat/freebsd32/freebsd32_misc.c > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > > --- user/dchagin/lemul/sys/compat/freebsd32/freebsd32_misc.c Fri Nov = 7 22:52:02 2014 (r274256) > > > +++ user/dchagin/lemul/sys/compat/freebsd32/freebsd32_misc.c Fri Nov = 7 23:12:07 2014 (r274257) > > > @@ -3017,3 +3017,31 @@ freebsd32_fcntl(struct thread *td, struc > > > } > > > return (kern_fcntl_freebsd(td, uap->fd, uap->cmd, tmp)); > > > } > > > + > > > +int > > > +freebsd32_ppoll(struct thread *td, struct freebsd32_ppoll_args *uap) > > > +{ > > > + struct timespec32 ts32; > > > + struct timespec ts, *tsp; > > > + sigset_t set, *ssp; > > > + int error; > > > + > > > + if (uap->ts !=3D NULL) { > > > + error =3D copyin(uap->ts, &ts32, sizeof(ts32)); > > > + if (error !=3D 0) > > > + return (error); > > > + CP(ts32, ts, tv_sec); > > > + CP(ts32, ts, tv_nsec); > > > + tsp =3D &ts; > > > + } else > > > + tsp =3D NULL; > > > + if (uap->set !=3D NULL) { > > > + error =3D copyin(uap->set, &set, sizeof(set)); > > > + if (error !=3D 0) > > > + return (error); > > > + ssp =3D &set; > > > + } else > > > + ssp =3D NULL; > > > + > > > + return (kern_ppoll(td, uap->fds, uap->nfds, tsp, ssp)); > > > +} > > >=20 > > > Modified: user/dchagin/lemul/sys/compat/freebsd32/syscalls.master > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > > --- user/dchagin/lemul/sys/compat/freebsd32/syscalls.master Fri Nov = 7 22:52:02 2014 (r274256) > > > +++ user/dchagin/lemul/sys/compat/freebsd32/syscalls.master Fri Nov = 7 23:12:07 2014 (r274257) > > > @@ -1066,3 +1066,6 @@ > > > uint32_t id1, uint32_t id2, int com, \ > > > void *data); } > > > #endif > > > +545 AUE_POLL STD { int freebsd32_ppoll(struct pollfd *fds, \ > > > + u_int nfds, const struct timespec32 *ts, \ > > > + const sigset_t *set); } > > >=20 > > > Modified: user/dchagin/lemul/sys/kern/sys_generic.c > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > > --- user/dchagin/lemul/sys/kern/sys_generic.c Fri Nov 7 22:52:02 201= 4 (r274256) > > > +++ user/dchagin/lemul/sys/kern/sys_generic.c Fri Nov 7 23:12:07 201= 4 (r274257) > > > @@ -1377,6 +1377,41 @@ out: > > > return (error); > > > } > > > =20 > > > +#ifndef _SYS_SYSPROTO_H_ > > > +struct ppoll_args { > > > + struct pollfd *fds; > > > + u_int nfds; > > > + struct timespec *ts; > > > + sigset_ *set; > > This is spelled sigset_t. In fact, I do not think we should keep maint= ain > > the unused manually copied syscall arg structs definitions. At least, > > I never added them for new syscalls. > >=20 >=20 > yeah, thank you! i'll fix soon. >=20 >=20 > > > +}; > > > +#endif > > > +int > > > +sys_ppoll(td, uap) > > > + struct thread *td; > > > + struct ppoll_args *uap; > > Please use C89 function definitions for new code. > >=20 >=20 > sure >=20 > > > +{ > > > + struct timespec ts, *tsp; > > > + sigset_t set, *ssp; > > > + int error; > > > + > > > + if (uap->ts !=3D NULL) { > > > + error =3D copyin(uap->ts, &ts, sizeof(ts)); > > > + if (error) > > > + return (error); > > > + tsp =3D &ts; > > > + } else > > > + tsp =3D NULL; > > > + if (uap->set !=3D NULL) { > > > + error =3D copyin(uap->set, &set, sizeof(set)); > > > + if (error) > > > + return (error); > > > + ssp =3D &set; > > > + } else > > > + ssp =3D NULL; > > > + > > > + return (kern_ppoll(td, uap->fds, uap->nfds, tsp, ssp)); > > > +} > > > + > > > int > > > kern_ppoll(struct thread *td, struct pollfd *fds, u_int nfds, > > > struct timespec *tsp, sigset_t *uset) > >=20 > > One more note about kern_ppoll(). As I see, tsp and uset are supposed > > to be in the KVA, while fds points to UVA. This is consistent with > > kern_select(), but is surprising for somebody who reads the code. > > Please add comments explaining the conventions. >=20 > ok > >=20 > > Also, I think ppoll(2) should be extracted from the branch and committed > > on its own. >=20 > agree > >=20 > > What about man page ? Or update of poll(2). >=20 > oh.. I'll try, it's not easy for me >=20 If you need review/help on this you can use phabricator for asking some peo= ple to review there is a '#manpages' group with people willing to help on the manpage side of the code :) Best regards, Bapt --AGZzQgpsuUlWC1xT Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlReKhoACgkQ8kTtMUmk6EwPSQCfeIbxAX80Ozk2urN/o9P4MqqL VhYAni6GjAtKhxyCVlLD1WMW4VnPxsYJ =UAGu -----END PGP SIGNATURE----- --AGZzQgpsuUlWC1xT--