From owner-svn-src-all@FreeBSD.ORG Wed Jul 16 23:32:09 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A92C09A9 for ; Wed, 16 Jul 2014 23:32:09 +0000 (UTC) Received: from mail-qa0-f53.google.com (mail-qa0-f53.google.com [209.85.216.53]) (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 6831620DC for ; Wed, 16 Jul 2014 23:32:09 +0000 (UTC) Received: by mail-qa0-f53.google.com with SMTP id v10so1275429qac.40 for ; Wed, 16 Jul 2014 16:32:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-type; bh=lDVJMeyfgcNbLn3GD+Di2kZEA7rwaSiXaB59W7QgIg8=; b=J+7ZdNiH+mE7FbV/dZut7Mc/wCoo5ssQVkQ7mQz+D/W9mteqbQWUEkTbL/GZ2mDsvO 2naFe00ux8kvjHC1mUV6ni5fjPawpf+Fmp+Hxa/u3g/a9n+iLEGlWgJHhZUOP0padAQh hmV/Ev+/RVRzI165jhk7wAOmLXxqU+8ykFZ+FqK7NeYd7u721usY9jeSSC13DZRkcvpe akdgiJQzQdC2ZZ+e4avkwHb0b4aOkmjTv3n32DFw0sFcvB+Uw4KhntKPFwNhXoTPQ/wU 7gKqskpmOZlDEOjDd8XN+jVww31hmcEn5Bdh0DE65Ep6Rov5QSeo9gd5+mXgrtx7ENXA xhKw== X-Gm-Message-State: ALoCoQm1reoyFRyWYtMNvpuYtHu07y8eeETIyBn8o8Cl8oGr1YjFhCWE0LTvJxZy56Ps9jfeDJAu X-Received: by 10.224.135.2 with SMTP id l2mr50808362qat.37.1405553522014; Wed, 16 Jul 2014 16:32:02 -0700 (PDT) MIME-Version: 1.0 Sender: jmmv@meroh.net Received: by 10.96.83.99 with HTTP; Wed, 16 Jul 2014 16:31:41 -0700 (PDT) X-Originating-IP: [184.153.117.174] In-Reply-To: <20140716221607.GV48710@ivaldir.etoilebsd.net> References: <201407162143.s6GLhOeO027919@svn.freebsd.org> <20140716221607.GV48710@ivaldir.etoilebsd.net> From: Julio Merino Date: Wed, 16 Jul 2014 19:31:41 -0400 X-Google-Sender-Auth: YD9_VWI6BgITd8quDU4rG7oMozg Message-ID: Subject: Re: svn commit: r268779 - head/share/man/man5 To: Baptiste Daroussin Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jul 2014 23:32:09 -0000 On Wed, Jul 16, 2014 at 6:16 PM, Baptiste Daroussin wrote: > On Wed, Jul 16, 2014 at 09:43:24PM +0000, Julio Merino wrote: >> Author: jmmv >> Date: Wed Jul 16 21:43:24 2014 >> New Revision: 268779 >> URL: http://svnweb.freebsd.org/changeset/base/268779 >> >> Log: >> Regen after r268778 to replace WITH_TESTS with WITHOUT_TESTS. >> >> Modified: >> head/share/man/man5/src.conf.5 >> >> Modified: head/share/man/man5/src.conf.5 >> ============================================================================== >> --- head/share/man/man5/src.conf.5 Wed Jul 16 21:40:11 2014 (r268778) >> +++ head/share/man/man5/src.conf.5 Wed Jul 16 21:43:24 2014 (r268779) >> @@ -1,7 +1,7 @@ >> .\" DO NOT EDIT-- this file is automatically generated. >> .\" from FreeBSD: head/tools/build/options/makeman 255964 2013-10-01 07:22:04Z des >> .\" $FreeBSD$ >> -.Dd July 10, 2014 >> +.Dd July 16, 2014 >> .Dt SRC.CONF 5 >> .Os >> .Sh NAME >> @@ -346,6 +346,8 @@ When set, it also enforces the following >> .It >> .Va WITHOUT_CLANG_FULL >> .It >> +.Va WITHOUT_GNUCXX >> +.It > The above looks unintended? I don't know. That came from running the makeman script and I was just trusting it to be right. From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 00:56:45 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 10C1155E; Thu, 17 Jul 2014 00:56:45 +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 897D6276A; Thu, 17 Jul 2014 00:56:44 +0000 (UTC) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.14.9/8.14.9) with ESMTP id s6H0ucQa042073 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 17 Jul 2014 03:56:39 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua s6H0ucQa042073 Received: (from kostik@localhost) by tom.home (8.14.9/8.14.9/Submit) id s6H0ucEf042072; Thu, 17 Jul 2014 03:56:38 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 17 Jul 2014 03:56:38 +0300 From: Konstantin Belousov To: Mateusz Guzik Subject: Re: svn commit: r267760 - head/sys/kern Message-ID: <20140717005638.GF93733@kib.kiev.ua> References: <20140623072519.GE93733@kib.kiev.ua> <20140623080501.GB27040@dft-labs.eu> <20140623081823.GG93733@kib.kiev.ua> <20140623131653.GC27040@dft-labs.eu> <20140623163523.GK93733@kib.kiev.ua> <20140711024351.GA18214@dft-labs.eu> <20140711095551.GA93733@kib.kiev.ua> <20140711111925.GB18214@dft-labs.eu> <20140713132652.GZ93733@kib.kiev.ua> <20140713213623.GA13241@dft-labs.eu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="z/MpV66pKPFGaNDq" Content-Disposition: inline In-Reply-To: <20140713213623.GA13241@dft-labs.eu> 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: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Mateusz Guzik X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 00:56:45 -0000 --z/MpV66pKPFGaNDq Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jul 13, 2014 at 11:36:24PM +0200, Mateusz Guzik wrote: > On Sun, Jul 13, 2014 at 04:26:52PM +0300, Konstantin Belousov wrote: > > On Fri, Jul 11, 2014 at 01:19:25PM +0200, Mateusz Guzik wrote: > > > On Fri, Jul 11, 2014 at 12:55:51PM +0300, Konstantin Belousov wrote: > > > > The nolock version requires two atomics on both entry and leave fro= m the > > > > protected region, while sx-locked variant requires only one atomic = for > > > > entry and leave. > > > >=20 > > > > I am not sure why you decided to acquire p->p_keeplock in after the > > > > proc lock in pget(), which indeed causes the complications of dropp= ing > > > > the proc_lock and rechecking to avoid LOR. Did you tried to add a = flag > > > > to pfind*() functions to indicate that p_keeplock should be acquire= d, > > > > instead ? > > >=20 > > > Lock is taken later to avoid waiting for finished exec/exit of proces= ses > > > we cannot return, so that e.g. procstat -fa does not trip over that > > > much. > > >=20 > > > Right now only PROC_LOCK guarantees stability of p->p_ucred across pg= et > > > operation. Without that the code would have to crget() and various > > > functions modified to accept cred instead of proc, or 'imagelock' > > > mechanism would have to be extended to also protect against cred > > > changes. > > No, you could get both locks, imagelock first, proc_lock next. > >=20 >=20 > Ignoring allproc_lock: >=20 > sx lock case: > filedesc out: slock + proc lock + proc unlock + sunlock > exit/exec: xlock + xunlock >=20 > counter case: > filedesc out: proc lock + proc unlock + proc lock + proc unlock > exit/exec: just wait for imagelock to be 0 This should be proc_lock/mwait/proc_lock, and proc_wait_imagelocked() does this. >=20 > counter can result in temporary errors due to catching the process > in exec, on the other hand slock before proc lock forces the caller to > wait even for processes it cannot read >=20 > I find the counter case better. >=20 > sx: > http://people.freebsd.org/~mjg/patches/sx-imagelock.patch >=20 > counter:=20 > http://people.freebsd.org/~mjg/patches/counter-imagelock.patch >=20 > There is an additional problem with slocked case: witness report a lor > with devfs vnodes. >=20 > lock order reversal: > 1st 0xfffff80006fe6ab0 process imagelock (process imagelock) @ /usr/src/= sys/kern/kern_proc.c:287 > 2nd 0xfffff80018c88240 devfs (devfs) @ /usr/src/sys/kern/vfs_cache.c:1241 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe01232= 4f120 > kdb_backtrace() at kdb_backtrace+0x39/frame 0xfffffe012324f1d0 > witness_checkorder() at witness_checkorder+0xdc2/frame 0xfffffe012324f260 > __lockmgr_args() at __lockmgr_args+0x588/frame 0xfffffe012324f3a0 > vop_stdlock() at vop_stdlock+0x3c/frame 0xfffffe012324f3c0 > VOP_LOCK1_APV() at VOP_LOCK1_APV+0xfc/frame 0xfffffe012324f3f0 > _vn_lock() at _vn_lock+0xaa/frame 0xfffffe012324f460 > vn_vptocnp_locked() at vn_vptocnp_locked+0xe8/frame 0xfffffe012324f4d0 > vn_fullpath1() at vn_fullpath1+0xb0/frame 0xfffffe012324f530 > vn_fullpath() at vn_fullpath+0xc1/frame 0xfffffe012324f580 > export_fd_to_sb() at export_fd_to_sb+0x489/frame 0xfffffe012324f7b0 > kern_proc_filedesc_out() at kern_proc_filedesc_out+0x1c6/frame 0xfffffe01= 2324f840 > sysctl_kern_proc_filedesc() at sysctl_kern_proc_filedesc+0x84/frame 0xfff= ffe012324f900 > sysctl_root_handler_locked() at sysctl_root_handler_locked+0x68/frame 0xf= ffffe012324f940 > sysctl_root() at sysctl_root+0x18e/frame 0xfffffe012324f990 > userland_sysctl() at userland_sysctl+0x192/frame 0xfffffe012324fa30 >=20 > witness detected the following lock orders: > devfs -> proctree Where is the dependency catched comes from ? I suspect it might be tty. I consider this case as an advantage of using sx over the hand-rolled lock, since the issue is/must be present with the counter as well, or the LOR is false positive, possibly due to sx taken in shared mode. But debugging features of sx give the warning, while counter is silent. That said, if the issue above is analyzed, I do not have any preference and will not object strongly against you decision. > proctree -> allproc > allproc -> imagelock > imagelock -> devfs --z/MpV66pKPFGaNDq Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJTxx9GAAoJEJDCuSvBvK1BSsgP/283TvnZJTq7tDIIrtAcWqZX B50YNLs1ok6kNkNF5CeqcKZ8eepgAImnnrXyJWDN3fy70z2uBgHnLmYlWuIEFl2Y 6mx2PQEG/pERmxWsTx6snnWhCwmhX6YXpjZ8qVBWU28mCUuSlKdN0hEjBFgxY+TA +EdUbfGrI6ytsvzfbfYxc3rcWZATLwGAISRb9IsxDJS/8FW5NJ963WDjPRHdVhrY wFJJETCj5K22UlOwxXJAnDVDyGbHFSUvwyjhLreTzT/SNsu/48m3oRWBqwQgHvET 05SkXsyPTfmX1tb4MZ7a99txj4Lz3ouANHEAsxrszctJayHn7BB3iP3iOKRStR35 PgZsIGDDoQ6LZLLWtAMECZnI2hWB1J3/5MMA+HtWDVxAkIMYUL4YmbweA+Xz9SaW xYIuxIRLz209A3WPtNFbQFrgT56/AMW/R6XjThvAVSUpiG4KuDlGghIfTY/tBhHq oxrv9Hg2jikL3fpYr231r4wms26XUURHpUHPSoBJgA9aKDbvfV4Qh95tpgEAYLZv e0PsDU5Z5snHSTbpje4uMQVR/UisJ6jGbOHKjeaJC0Wxqxpv6cdIyUQiBhT/fk6g r04D1F5+jHFJtopoNiner1nc7BTnL7tWG3F+Lv0PGIUEVzIGaf6ew2H6G84FpUk9 ja6Ty0dsc302dsK3T3// =Y4qb -----END PGP SIGNATURE----- --z/MpV66pKPFGaNDq-- From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 02:14:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6864BB5E; Thu, 17 Jul 2014 02:14:28 +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 52D1E2CE6; Thu, 17 Jul 2014 02:14:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6H2ES9N055903; Thu, 17 Jul 2014 02:14:28 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6H2EPnQ055888; Thu, 17 Jul 2014 02:14:25 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407170214.s6H2EPnQ055888@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 17 Jul 2014 02:14:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268782 - in stable/10/lib/libedit: . TEST X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 02:14:28 -0000 Author: pfg Date: Thu Jul 17 02:14:25 2014 New Revision: 268782 URL: http://svnweb.freebsd.org/changeset/base/268782 Log: MFC r268502: Sync some (mostly cosmetical) changes from NetBSD Makefile,v 1.37 tc1.c v 1.3 Rename TEST/test.c tc1.c common.c,v 1.23 pass lint on _LP64. emacs.c,v 1.22 pass lint on _LP64. filecomplete.h,v 1.8 mv NetBSD ID back from 1.9 as we don't have the widecharacter support. prompt.c,v 1.14 prompt.h,v 1.9 term.h,v 1.20 read.h,v 1.6 Update NetBSD version strings sys.h,v 1.12 Misc sun stuff. tty.c 1.31 handle EINTR in the termios operations Allow a single process to control multiple ttys (for pthreads using _REENTRANT) using multiple EditLine objects. pass lint on _LP64. Don't depend on side effects inside an assert Obtained from: NetBSD Added: stable/10/lib/libedit/TEST/tc1.c - copied unchanged from r268502, head/lib/libedit/TEST/tc1.c Deleted: stable/10/lib/libedit/TEST/test.c Modified: stable/10/lib/libedit/Makefile stable/10/lib/libedit/common.c stable/10/lib/libedit/emacs.c stable/10/lib/libedit/filecomplete.h stable/10/lib/libedit/histedit.h stable/10/lib/libedit/prompt.c stable/10/lib/libedit/prompt.h stable/10/lib/libedit/read.h stable/10/lib/libedit/sys.h stable/10/lib/libedit/term.h stable/10/lib/libedit/tty.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libedit/Makefile ============================================================================== --- stable/10/lib/libedit/Makefile Wed Jul 16 23:17:57 2014 (r268781) +++ stable/10/lib/libedit/Makefile Thu Jul 17 02:14:25 2014 (r268782) @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.34 2005/05/28 12:02:53 lukem Exp $ +# $NetBSD: Makefile,v 1.37 2009/01/18 12:17:49 lukem Exp $ # @(#)Makefile 8.1 (Berkeley) 6/4/93 # $FreeBSD$ @@ -70,9 +70,9 @@ editline.c: ${OSRCS} editline.o editline.po editline.So editline.ln: \ common.h emacs.h fcns.c fcns.h help.c help.h vi.h -test.o: ${.CURDIR}/TEST/test.c +tc1.o: ${.CURDIR}/TEST/tc1.c -test: test.o libedit.a ${DPADD} ${LIBTERMCAP} +test: tc1.o libedit.a ${DPADD} ${LIBTERMCAP} ${CC} ${CFLAGS} ${.ALLSRC} -o ${.TARGET} libedit.a ${LDADD} .include Copied: stable/10/lib/libedit/TEST/tc1.c (from r268502, head/lib/libedit/TEST/tc1.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/libedit/TEST/tc1.c Thu Jul 17 02:14:25 2014 (r268782, copy of r268502, head/lib/libedit/TEST/tc1.c) @@ -0,0 +1,298 @@ +/*- + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Christos Zoulas of Cornell University. + * + * 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. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. + */ + +#include +#ifndef lint +__COPYRIGHT("@(#) Copyright (c) 1992, 1993\n\ + The Regents of the University of California. All rights reserved.\n"); +#endif /* not lint */ + +#if !defined(lint) && !defined(SCCSID) +static char sccsid[] = "@(#)test.c 8.1 (Berkeley) 6/4/93"; +#endif /* not lint && not SCCSID */ +__RCSID("$NetBSD: test.c,v 1.3 2009/07/17 12:25:52 christos Exp $"); +__FBSDID("$FreeBSD$"); + +/* + * test.c: A little test program + */ +#include "sys.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include "histedit.h" + +static int continuation = 0; +volatile sig_atomic_t gotsig = 0; + +static unsigned char complete(EditLine *, int); + int main(int, char **); +static char *prompt(EditLine *); +static void sig(int); + +static char * +prompt(EditLine *el) +{ + static char a[] = "\1\e[7m\1Edit$\1\e[0m\1 "; + static char b[] = "Edit> "; + + return (continuation ? b : a); +} + +static void +sig(int i) +{ + gotsig = i; +} + +static unsigned char +complete(EditLine *el, int ch) +{ + DIR *dd = opendir("."); + struct dirent *dp; + const char* ptr; + const LineInfo *lf = el_line(el); + int len; + + /* + * Find the last word + */ + for (ptr = lf->cursor - 1; + !isspace((unsigned char)*ptr) && ptr > lf->buffer; ptr--) + continue; + len = lf->cursor - ++ptr; + + for (dp = readdir(dd); dp != NULL; dp = readdir(dd)) { + if (len > strlen(dp->d_name)) + continue; + if (strncmp(dp->d_name, ptr, len) == 0) { + closedir(dd); + if (el_insertstr(el, &dp->d_name[len]) == -1) + return (CC_ERROR); + else + return (CC_REFRESH); + } + } + + closedir(dd); + return (CC_ERROR); +} + +int +main(int argc, char *argv[]) +{ + EditLine *el = NULL; + int num; + const char *buf; + Tokenizer *tok; +#if 0 + int lastevent = 0; +#endif + int ncontinuation; + History *hist; + HistEvent ev; + + (void) signal(SIGINT, sig); + (void) signal(SIGQUIT, sig); + (void) signal(SIGHUP, sig); + (void) signal(SIGTERM, sig); + + hist = history_init(); /* Init the builtin history */ + /* Remember 100 events */ + history(hist, &ev, H_SETSIZE, 100); + + tok = tok_init(NULL); /* Initialize the tokenizer */ + + /* Initialize editline */ + el = el_init(*argv, stdin, stdout, stderr); + + el_set(el, EL_EDITOR, "vi"); /* Default editor is vi */ + el_set(el, EL_SIGNAL, 1); /* Handle signals gracefully */ + el_set(el, EL_PROMPT_ESC, prompt, '\1');/* Set the prompt function */ + + /* Tell editline to use this history interface */ + el_set(el, EL_HIST, history, hist); + + /* Add a user-defined function */ + el_set(el, EL_ADDFN, "ed-complete", "Complete argument", complete); + + /* Bind tab to it */ + el_set(el, EL_BIND, "^I", "ed-complete", NULL); + + /* + * Bind j, k in vi command mode to previous and next line, instead + * of previous and next history. + */ + el_set(el, EL_BIND, "-a", "k", "ed-prev-line", NULL); + el_set(el, EL_BIND, "-a", "j", "ed-next-line", NULL); + + /* + * Source the user's defaults file. + */ + el_source(el, NULL); + + while ((buf = el_gets(el, &num)) != NULL && num != 0) { + int ac, cc, co; +#ifdef DEBUG + int i; +#endif + const char **av; + const LineInfo *li; + li = el_line(el); +#ifdef DEBUG + (void) fprintf(stderr, "==> got %d %s", num, buf); + (void) fprintf(stderr, " > li `%.*s_%.*s'\n", + (li->cursor - li->buffer), li->buffer, + (li->lastchar - 1 - li->cursor), + (li->cursor >= li->lastchar) ? "" : li->cursor); + +#endif + if (gotsig) { + (void) fprintf(stderr, "Got signal %d.\n", (int)gotsig); + gotsig = 0; + el_reset(el); + } + + if (!continuation && num == 1) + continue; + + ac = cc = co = 0; + ncontinuation = tok_line(tok, li, &ac, &av, &cc, &co); + if (ncontinuation < 0) { + (void) fprintf(stderr, "Internal error\n"); + continuation = 0; + continue; + } +#ifdef DEBUG + (void) fprintf(stderr, " > nc %d ac %d cc %d co %d\n", + ncontinuation, ac, cc, co); +#endif +#if 0 + if (continuation) { + /* + * Append to the right event in case the user + * moved around in history. + */ + if (history(hist, &ev, H_SET, lastevent) == -1) + err(1, "%d: %s", lastevent, ev.str); + history(hist, &ev, H_ADD , buf); + } else { + history(hist, &ev, H_ENTER, buf); + lastevent = ev.num; + } +#else + /* Simpler */ + history(hist, &ev, continuation ? H_APPEND : H_ENTER, buf); +#endif + + continuation = ncontinuation; + ncontinuation = 0; + if (continuation) + continue; +#ifdef DEBUG + for (i = 0; i < ac; i++) { + (void) fprintf(stderr, " > arg# %2d ", i); + if (i != cc) + (void) fprintf(stderr, "`%s'\n", av[i]); + else + (void) fprintf(stderr, "`%.*s_%s'\n", + co, av[i], av[i] + co); + } +#endif + + if (strcmp(av[0], "history") == 0) { + int rv; + + switch (ac) { + case 1: + for (rv = history(hist, &ev, H_LAST); rv != -1; + rv = history(hist, &ev, H_PREV)) + (void) fprintf(stdout, "%4d %s", + ev.num, ev.str); + break; + + case 2: + if (strcmp(av[1], "clear") == 0) + history(hist, &ev, H_CLEAR); + else + goto badhist; + break; + + case 3: + if (strcmp(av[1], "load") == 0) + history(hist, &ev, H_LOAD, av[2]); + else if (strcmp(av[1], "save") == 0) + history(hist, &ev, H_SAVE, av[2]); + break; + + badhist: + default: + (void) fprintf(stderr, + "Bad history arguments\n"); + break; + } + } else if (el_parse(el, ac, av) == -1) { + switch (fork()) { + case 0: + execvp(av[0], __DECONST(char *const *, av)); + perror(av[0]); + _exit(1); + /*NOTREACHED*/ + break; + + case -1: + perror("fork"); + break; + + default: + if (wait(&num) == -1) + perror("wait"); + (void) fprintf(stderr, "Exit %x\n", num); + break; + } + } + + tok_reset(tok); + } + + el_end(el); + tok_end(tok); + history_end(hist); + + return (0); +} Modified: stable/10/lib/libedit/common.c ============================================================================== --- stable/10/lib/libedit/common.c Wed Jul 16 23:17:57 2014 (r268781) +++ stable/10/lib/libedit/common.c Thu Jul 17 02:14:25 2014 (r268782) @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $NetBSD: common.c,v 1.19 2006/03/06 21:11:56 christos Exp $ + * $NetBSD: common.c,v 1.23 2009/02/27 04:18:45 msaitoh Exp $ */ #if !defined(lint) && !defined(SCCSID) @@ -121,7 +121,7 @@ ed_delete_prev_word(EditLine *el, int c *kp++ = *p; el->el_chared.c_kill.last = kp; - c_delbefore(el, el->el_line.cursor - cp); /* delete before dot */ + c_delbefore(el, (int)(el->el_line.cursor - cp));/* delete before dot */ el->el_line.cursor = cp; if (el->el_line.cursor < el->el_line.buffer) el->el_line.cursor = el->el_line.buffer; /* bounds check */ @@ -208,9 +208,6 @@ ed_move_to_end(EditLine *el, int c __unu el->el_line.cursor = el->el_line.lastchar; if (el->el_map.type == MAP_VI) { -#ifdef VI_MOVE - el->el_line.cursor--; -#endif if (el->el_chared.c_vcmd.action != NOP) { cv_delfini(el); return (CC_REFRESH); Modified: stable/10/lib/libedit/emacs.c ============================================================================== --- stable/10/lib/libedit/emacs.c Wed Jul 16 23:17:57 2014 (r268781) +++ stable/10/lib/libedit/emacs.c Thu Jul 17 02:14:25 2014 (r268782) @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $NetBSD: emacs.c,v 1.21 2006/03/06 21:11:56 christos Exp $ + * $NetBSD: emacs.c,v 1.22 2009/02/15 21:55:23 christos Exp $ */ #if !defined(lint) && !defined(SCCSID) @@ -101,7 +101,7 @@ em_delete_next_word(EditLine *el, int c *kp++ = *p; el->el_chared.c_kill.last = kp; - c_delafter(el, cp - el->el_line.cursor); /* delete after dot */ + c_delafter(el, (int)(cp - el->el_line.cursor)); /* delete after dot */ if (el->el_line.cursor > el->el_line.lastchar) el->el_line.cursor = el->el_line.lastchar; /* bounds check */ @@ -131,7 +131,8 @@ em_yank(EditLine *el, int c __unused) cp = el->el_line.cursor; /* open the space, */ - c_insert(el, el->el_chared.c_kill.last - el->el_chared.c_kill.buf); + c_insert(el, + (int)(el->el_chared.c_kill.last - el->el_chared.c_kill.buf)); /* copy the chars */ for (kp = el->el_chared.c_kill.buf; kp < el->el_chared.c_kill.last; kp++) *cp++ = *kp; @@ -185,14 +186,14 @@ em_kill_region(EditLine *el, int c __unu while (cp < el->el_chared.c_kill.mark) *kp++ = *cp++; /* copy it */ el->el_chared.c_kill.last = kp; - c_delafter(el, cp - el->el_line.cursor); + c_delafter(el, (int)(cp - el->el_line.cursor)); } else { /* mark is before cursor */ cp = el->el_chared.c_kill.mark; kp = el->el_chared.c_kill.buf; while (cp < el->el_line.cursor) *kp++ = *cp++; /* copy it */ el->el_chared.c_kill.last = kp; - c_delbefore(el, cp - el->el_chared.c_kill.mark); + c_delbefore(el, (int)(cp - el->el_chared.c_kill.mark)); el->el_line.cursor = el->el_chared.c_kill.mark; } return (CC_REFRESH); @@ -446,7 +447,7 @@ em_copy_prev_word(EditLine *el, int c __ cp = c__prev_word(el->el_line.cursor, el->el_line.buffer, el->el_state.argument, ce__isword); - c_insert(el, oldc - cp); + c_insert(el, (int)(oldc - cp)); for (dp = oldc; cp < oldc && dp < el->el_line.lastchar; cp++) *dp++ = *cp; Modified: stable/10/lib/libedit/filecomplete.h ============================================================================== --- stable/10/lib/libedit/filecomplete.h Wed Jul 16 23:17:57 2014 (r268781) +++ stable/10/lib/libedit/filecomplete.h Thu Jul 17 02:14:25 2014 (r268782) @@ -26,7 +26,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $NetBSD: filecomplete.h,v 1.9 2009/12/30 22:37:40 christos Exp $ + * $NetBSD: filecomplete.h,v 1.8 2009/02/16 00:15:45 christos Exp $ * $FreeBSD$ */ #ifndef _FILECOMPLETE_H_ Modified: stable/10/lib/libedit/histedit.h ============================================================================== --- stable/10/lib/libedit/histedit.h Wed Jul 16 23:17:57 2014 (r268781) +++ stable/10/lib/libedit/histedit.h Thu Jul 17 02:14:25 2014 (r268782) @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)histedit.h 8.2 (Berkeley) 1/3/94 - * $NetBSD: histedit.h,v 1.32 2007/06/10 20:20:28 christos Exp $ + * $NetBSD: histedit.h,v 1.41 2009/09/07 21:24:33 christos Exp $ * $FreeBSD$ */ Modified: stable/10/lib/libedit/prompt.c ============================================================================== --- stable/10/lib/libedit/prompt.c Wed Jul 16 23:17:57 2014 (r268781) +++ stable/10/lib/libedit/prompt.c Thu Jul 17 02:14:25 2014 (r268782) @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $NetBSD: prompt.c,v 1.11 2003/08/07 16:44:32 agc Exp $ + * $NetBSD: prompt.c,v 1.14 2009/03/31 17:38:27 christos Exp $ */ #if !defined(lint) && !defined(SCCSID) Modified: stable/10/lib/libedit/prompt.h ============================================================================== --- stable/10/lib/libedit/prompt.h Wed Jul 16 23:17:57 2014 (r268781) +++ stable/10/lib/libedit/prompt.h Thu Jul 17 02:14:25 2014 (r268782) @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)prompt.h 8.1 (Berkeley) 6/4/93 - * $NetBSD: prompt.h,v 1.6 2003/08/07 16:44:32 agc Exp $ + * $NetBSD: prompt.h,v 1.9 2009/03/31 17:38:27 christos Exp $ * $FreeBSD$ */ @@ -45,8 +45,8 @@ typedef char * (*el_pfunc_t)(EditLine*); typedef struct el_prompt_t { - el_pfunc_t p_func; /* Function to return the prompt */ - coord_t p_pos; /* position in the line after prompt */ + el_pfunc_t p_func; /* Function to return the prompt */ + coord_t p_pos; /* position in the line after prompt */ char p_ignore; /* character to start/end literal */ } el_prompt_t; Modified: stable/10/lib/libedit/read.h ============================================================================== --- stable/10/lib/libedit/read.h Wed Jul 16 23:17:57 2014 (r268781) +++ stable/10/lib/libedit/read.h Thu Jul 17 02:14:25 2014 (r268782) @@ -26,7 +26,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $NetBSD: read.h,v 1.5 2006/08/21 12:45:30 christos Exp $ + * $NetBSD: read.h,v 1.6 2008/04/29 06:53:01 martin Exp $ * $FreeBSD$ */ Modified: stable/10/lib/libedit/sys.h ============================================================================== --- stable/10/lib/libedit/sys.h Wed Jul 16 23:17:57 2014 (r268781) +++ stable/10/lib/libedit/sys.h Thu Jul 17 02:14:25 2014 (r268782) @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)sys.h 8.1 (Berkeley) 6/4/93 - * $NetBSD: sys.h,v 1.9 2004/01/17 17:57:40 christos Exp $ + * $NetBSD: sys.h,v 1.12 2009/08/31 00:05:43 christos Exp $ * $FreeBSD$ */ @@ -70,6 +70,15 @@ typedef void *ioctl_t; #define REGEX /* Use POSIX.2 regular expression functions */ #undef REGEXP /* Use UNIX V8 regular expression functions */ +#if defined(__sun) +extern int tgetent(char *, const char *); +extern int tgetflag(char *); +extern int tgetnum(char *); +extern int tputs(const char *, int, int (*)(int)); +extern char* tgoto(const char*, int, int); +extern char* tgetstr(char*, char**); +#endif + #ifdef notdef # undef REGEX # undef REGEXP Modified: stable/10/lib/libedit/term.h ============================================================================== --- stable/10/lib/libedit/term.h Wed Jul 16 23:17:57 2014 (r268781) +++ stable/10/lib/libedit/term.h Thu Jul 17 02:14:25 2014 (r268782) @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)term.h 8.1 (Berkeley) 6/4/93 - * $NetBSD: term.h,v 1.18 2006/11/24 00:01:17 christos Exp $ + * $NetBSD: term.h,v 1.20 2009/03/31 17:38:27 christos Exp $ * $FreeBSD$ */ Modified: stable/10/lib/libedit/tty.c ============================================================================== --- stable/10/lib/libedit/tty.c Wed Jul 16 23:17:57 2014 (r268781) +++ stable/10/lib/libedit/tty.c Thu Jul 17 02:14:25 2014 (r268782) @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $NetBSD: tty.c,v 1.25 2006/03/18 09:09:41 christos Exp $ + * $NetBSD: tty.c,v 1.31 2009/07/22 15:58:09 christos Exp $ */ #if !defined(lint) && !defined(SCCSID) @@ -443,13 +443,12 @@ private const ttymodes_t ttymodes[] = { -#define tty_getty(el, td) tcgetattr((el)->el_infd, (td)) -#define tty_setty(el, td) tcsetattr((el)->el_infd, TCSADRAIN, (td)) - #define tty__gettabs(td) ((((td)->c_oflag & TAB3) == TAB3) ? 0 : 1) #define tty__geteightbit(td) (((td)->c_cflag & CSIZE) == CS8) #define tty__cooked_mode(td) ((td)->c_lflag & ICANON) +private int tty_getty(EditLine *, struct termios *); +private int tty_setty(EditLine *, int, const struct termios *); private int tty__getcharindex(int); private void tty__getchar(struct termios *, unsigned char *); private void tty__setchar(struct termios *, unsigned char *); @@ -458,6 +457,29 @@ private int tty_setup(EditLine *); #define t_qu t_ts +/* tty_getty(): + * Wrapper for tcgetattr to handle EINTR + */ +private int +tty_getty(EditLine *el, struct termios *t) +{ + int rv; + while ((rv = tcgetattr(el->el_infd, t)) == -1 && errno == EINTR) + continue; + return rv; +} + +/* tty_setty(): + * Wrapper for tcsetattr to handle EINTR + */ +private int +tty_setty(EditLine *el, int action, const struct termios *t) +{ + int rv; + while ((rv = tcsetattr(el->el_infd, action, t)) == -1 && errno == EINTR) + continue; + return rv; +} /* tty_setup(): * Get the tty parameters and initialize the editing state @@ -996,7 +1018,7 @@ tty_rawmode(EditLine *el) if (el->el_tty.t_mode == EX_IO) el->el_tty.t_ex = el->el_tty.t_ts; - if (tty_setty(el, &el->el_tty.t_ed) == -1) { + if (tty_setty(el, TCSADRAIN, &el->el_tty.t_ed) == -1) { #ifdef DEBUG_TTY (void) fprintf(el->el_errfile, "tty_rawmode: tty_setty: %s\n", strerror(errno)); @@ -1021,7 +1043,7 @@ tty_cookedmode(EditLine *el) if (el->el_flags & EDIT_DISABLED) return (0); - if (tty_setty(el, &el->el_tty.t_ex) == -1) { + if (tty_setty(el, TCSADRAIN, &el->el_tty.t_ex) == -1) { #ifdef DEBUG_TTY (void) fprintf(el->el_errfile, "tty_cookedmode: tty_setty: %s\n", @@ -1057,7 +1079,7 @@ tty_quotemode(EditLine *el) el->el_tty.t_qu.c_lflag &= ~el->el_tty.t_t[QU_IO][MD_LIN].t_clrmask; el->el_tty.t_qu.c_lflag |= el->el_tty.t_t[QU_IO][MD_LIN].t_setmask; - if (tty_setty(el, &el->el_tty.t_qu) == -1) { + if (tty_setty(el, TCSADRAIN, &el->el_tty.t_qu) == -1) { #ifdef DEBUG_TTY (void) fprintf(el->el_errfile, "QuoteModeOn: tty_setty: %s\n", strerror(errno)); @@ -1078,7 +1100,7 @@ tty_noquotemode(EditLine *el) if (el->el_tty.t_mode != QU_IO) return (0); - if (tty_setty(el, &el->el_tty.t_ed) == -1) { + if (tty_setty(el, TCSADRAIN, &el->el_tty.t_ed) == -1) { #ifdef DEBUG_TTY (void) fprintf(el->el_errfile, "QuoteModeOff: tty_setty: %s\n", strerror(errno)); @@ -1139,7 +1161,7 @@ tty_stty(EditLine *el, int argc __unused if (!argv || !*argv) { int i = -1; - int len = 0, st = 0, cu; + size_t len = 0, st = 0, cu; for (m = ttymodes; m->m_name; m++) { if (m->m_type != i) { (void) fprintf(el->el_outfile, "%s%s", @@ -1162,9 +1184,9 @@ tty_stty(EditLine *el, int argc __unused cu = strlen(m->m_name) + (x != '\0') + 1; - if (len + cu >= el->el_term.t_size.h) { + if (len + cu >= (size_t)el->el_term.t_size.h) { (void) fprintf(el->el_outfile, "\n%*s", - st, ""); + (int)st, ""); len = st + cu; } else len += cu; @@ -1208,7 +1230,8 @@ tty_stty(EditLine *el, int argc __unused int c = ffs((int)m->m_value); int v = *++p ? parse__escape((const char **) &p) : el->el_tty.t_vdisable; - assert(c-- != 0); + assert(c != 0); + c--; c = tty__getcharindex(c); assert(c != -1); tios->c_cc[c] = v; @@ -1229,6 +1252,17 @@ tty_stty(EditLine *el, int argc __unused break; } } + + if (el->el_tty.t_mode == z) { + if (tty_setty(el, TCSADRAIN, tios) == -1) { +#ifdef DEBUG_TTY + (void) fprintf(el->el_errfile, + "tty_stty: tty_setty: %s\n", strerror(errno)); +#endif /* DEBUG_TTY */ + return (-1); + } + } + return (0); } From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 02:22:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 46FFECE0; Thu, 17 Jul 2014 02:22:06 +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 312162D85; Thu, 17 Jul 2014 02:22:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6H2M6ji060167; Thu, 17 Jul 2014 02:22:06 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6H2M3D5060147; Thu, 17 Jul 2014 02:22:03 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407170222.s6H2M3D5060147@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 17 Jul 2014 02:22:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r268783 - in stable/9/lib/libedit: . TEST X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 02:22:06 -0000 Author: pfg Date: Thu Jul 17 02:22:03 2014 New Revision: 268783 URL: http://svnweb.freebsd.org/changeset/base/268783 Log: MFC r268502: Sync some (mostly cosmetical) changes from NetBSD Makefile,v 1.37 tc1.c v 1.3 Rename TEST/test.c tc1.c common.c,v 1.23 pass lint on _LP64. emacs.c,v 1.22 pass lint on _LP64. filecomplete.h,v 1.8 mv NetBSD ID back from 1.9 as we don't have the widecharacter support. prompt.c,v 1.14 prompt.h,v 1.9 term.h,v 1.20 read.h,v 1.6 Update NetBSD version strings sys.h,v 1.12 Misc sun stuff. tty.c 1.31 handle EINTR in the termios operations Allow a single process to control multiple ttys (for pthreads using _REENTRANT) using multiple EditLine objects. pass lint on _LP64. Don't depend on side effects inside an assert Obtained from: NetBSD Added: stable/9/lib/libedit/TEST/tc1.c - copied unchanged from r268502, head/lib/libedit/TEST/tc1.c Deleted: stable/9/lib/libedit/TEST/test.c Modified: stable/9/lib/libedit/Makefile stable/9/lib/libedit/common.c stable/9/lib/libedit/emacs.c stable/9/lib/libedit/filecomplete.h stable/9/lib/libedit/histedit.h stable/9/lib/libedit/prompt.c stable/9/lib/libedit/prompt.h stable/9/lib/libedit/read.h stable/9/lib/libedit/sys.h stable/9/lib/libedit/term.h stable/9/lib/libedit/tty.c Directory Properties: stable/9/lib/libedit/ (props changed) Modified: stable/9/lib/libedit/Makefile ============================================================================== --- stable/9/lib/libedit/Makefile Thu Jul 17 02:14:25 2014 (r268782) +++ stable/9/lib/libedit/Makefile Thu Jul 17 02:22:03 2014 (r268783) @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.34 2005/05/28 12:02:53 lukem Exp $ +# $NetBSD: Makefile,v 1.37 2009/01/18 12:17:49 lukem Exp $ # @(#)Makefile 8.1 (Berkeley) 6/4/93 # $FreeBSD$ @@ -70,9 +70,9 @@ editline.c: ${OSRCS} editline.o editline.po editline.So editline.ln: \ common.h emacs.h fcns.c fcns.h help.c help.h vi.h -test.o: ${.CURDIR}/TEST/test.c +tc1.o: ${.CURDIR}/TEST/tc1.c -test: test.o libedit.a ${DPADD} ${LIBTERMCAP} +test: tc1.o libedit.a ${DPADD} ${LIBTERMCAP} ${CC} ${CFLAGS} ${.ALLSRC} -o ${.TARGET} libedit.a ${LDADD} .include Copied: stable/9/lib/libedit/TEST/tc1.c (from r268502, head/lib/libedit/TEST/tc1.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/lib/libedit/TEST/tc1.c Thu Jul 17 02:22:03 2014 (r268783, copy of r268502, head/lib/libedit/TEST/tc1.c) @@ -0,0 +1,298 @@ +/*- + * Copyright (c) 1992, 1993 + * The Regents of the University of California. All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Christos Zoulas of Cornell University. + * + * 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. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. + */ + +#include +#ifndef lint +__COPYRIGHT("@(#) Copyright (c) 1992, 1993\n\ + The Regents of the University of California. All rights reserved.\n"); +#endif /* not lint */ + +#if !defined(lint) && !defined(SCCSID) +static char sccsid[] = "@(#)test.c 8.1 (Berkeley) 6/4/93"; +#endif /* not lint && not SCCSID */ +__RCSID("$NetBSD: test.c,v 1.3 2009/07/17 12:25:52 christos Exp $"); +__FBSDID("$FreeBSD$"); + +/* + * test.c: A little test program + */ +#include "sys.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include "histedit.h" + +static int continuation = 0; +volatile sig_atomic_t gotsig = 0; + +static unsigned char complete(EditLine *, int); + int main(int, char **); +static char *prompt(EditLine *); +static void sig(int); + +static char * +prompt(EditLine *el) +{ + static char a[] = "\1\e[7m\1Edit$\1\e[0m\1 "; + static char b[] = "Edit> "; + + return (continuation ? b : a); +} + +static void +sig(int i) +{ + gotsig = i; +} + +static unsigned char +complete(EditLine *el, int ch) +{ + DIR *dd = opendir("."); + struct dirent *dp; + const char* ptr; + const LineInfo *lf = el_line(el); + int len; + + /* + * Find the last word + */ + for (ptr = lf->cursor - 1; + !isspace((unsigned char)*ptr) && ptr > lf->buffer; ptr--) + continue; + len = lf->cursor - ++ptr; + + for (dp = readdir(dd); dp != NULL; dp = readdir(dd)) { + if (len > strlen(dp->d_name)) + continue; + if (strncmp(dp->d_name, ptr, len) == 0) { + closedir(dd); + if (el_insertstr(el, &dp->d_name[len]) == -1) + return (CC_ERROR); + else + return (CC_REFRESH); + } + } + + closedir(dd); + return (CC_ERROR); +} + +int +main(int argc, char *argv[]) +{ + EditLine *el = NULL; + int num; + const char *buf; + Tokenizer *tok; +#if 0 + int lastevent = 0; +#endif + int ncontinuation; + History *hist; + HistEvent ev; + + (void) signal(SIGINT, sig); + (void) signal(SIGQUIT, sig); + (void) signal(SIGHUP, sig); + (void) signal(SIGTERM, sig); + + hist = history_init(); /* Init the builtin history */ + /* Remember 100 events */ + history(hist, &ev, H_SETSIZE, 100); + + tok = tok_init(NULL); /* Initialize the tokenizer */ + + /* Initialize editline */ + el = el_init(*argv, stdin, stdout, stderr); + + el_set(el, EL_EDITOR, "vi"); /* Default editor is vi */ + el_set(el, EL_SIGNAL, 1); /* Handle signals gracefully */ + el_set(el, EL_PROMPT_ESC, prompt, '\1');/* Set the prompt function */ + + /* Tell editline to use this history interface */ + el_set(el, EL_HIST, history, hist); + + /* Add a user-defined function */ + el_set(el, EL_ADDFN, "ed-complete", "Complete argument", complete); + + /* Bind tab to it */ + el_set(el, EL_BIND, "^I", "ed-complete", NULL); + + /* + * Bind j, k in vi command mode to previous and next line, instead + * of previous and next history. + */ + el_set(el, EL_BIND, "-a", "k", "ed-prev-line", NULL); + el_set(el, EL_BIND, "-a", "j", "ed-next-line", NULL); + + /* + * Source the user's defaults file. + */ + el_source(el, NULL); + + while ((buf = el_gets(el, &num)) != NULL && num != 0) { + int ac, cc, co; +#ifdef DEBUG + int i; +#endif + const char **av; + const LineInfo *li; + li = el_line(el); +#ifdef DEBUG + (void) fprintf(stderr, "==> got %d %s", num, buf); + (void) fprintf(stderr, " > li `%.*s_%.*s'\n", + (li->cursor - li->buffer), li->buffer, + (li->lastchar - 1 - li->cursor), + (li->cursor >= li->lastchar) ? "" : li->cursor); + +#endif + if (gotsig) { + (void) fprintf(stderr, "Got signal %d.\n", (int)gotsig); + gotsig = 0; + el_reset(el); + } + + if (!continuation && num == 1) + continue; + + ac = cc = co = 0; + ncontinuation = tok_line(tok, li, &ac, &av, &cc, &co); + if (ncontinuation < 0) { + (void) fprintf(stderr, "Internal error\n"); + continuation = 0; + continue; + } +#ifdef DEBUG + (void) fprintf(stderr, " > nc %d ac %d cc %d co %d\n", + ncontinuation, ac, cc, co); +#endif +#if 0 + if (continuation) { + /* + * Append to the right event in case the user + * moved around in history. + */ + if (history(hist, &ev, H_SET, lastevent) == -1) + err(1, "%d: %s", lastevent, ev.str); + history(hist, &ev, H_ADD , buf); + } else { + history(hist, &ev, H_ENTER, buf); + lastevent = ev.num; + } +#else + /* Simpler */ + history(hist, &ev, continuation ? H_APPEND : H_ENTER, buf); +#endif + + continuation = ncontinuation; + ncontinuation = 0; + if (continuation) + continue; +#ifdef DEBUG + for (i = 0; i < ac; i++) { + (void) fprintf(stderr, " > arg# %2d ", i); + if (i != cc) + (void) fprintf(stderr, "`%s'\n", av[i]); + else + (void) fprintf(stderr, "`%.*s_%s'\n", + co, av[i], av[i] + co); + } +#endif + + if (strcmp(av[0], "history") == 0) { + int rv; + + switch (ac) { + case 1: + for (rv = history(hist, &ev, H_LAST); rv != -1; + rv = history(hist, &ev, H_PREV)) + (void) fprintf(stdout, "%4d %s", + ev.num, ev.str); + break; + + case 2: + if (strcmp(av[1], "clear") == 0) + history(hist, &ev, H_CLEAR); + else + goto badhist; + break; + + case 3: + if (strcmp(av[1], "load") == 0) + history(hist, &ev, H_LOAD, av[2]); + else if (strcmp(av[1], "save") == 0) + history(hist, &ev, H_SAVE, av[2]); + break; + + badhist: + default: + (void) fprintf(stderr, + "Bad history arguments\n"); + break; + } + } else if (el_parse(el, ac, av) == -1) { + switch (fork()) { + case 0: + execvp(av[0], __DECONST(char *const *, av)); + perror(av[0]); + _exit(1); + /*NOTREACHED*/ + break; + + case -1: + perror("fork"); + break; + + default: + if (wait(&num) == -1) + perror("wait"); + (void) fprintf(stderr, "Exit %x\n", num); + break; + } + } + + tok_reset(tok); + } + + el_end(el); + tok_end(tok); + history_end(hist); + + return (0); +} Modified: stable/9/lib/libedit/common.c ============================================================================== --- stable/9/lib/libedit/common.c Thu Jul 17 02:14:25 2014 (r268782) +++ stable/9/lib/libedit/common.c Thu Jul 17 02:22:03 2014 (r268783) @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $NetBSD: common.c,v 1.19 2006/03/06 21:11:56 christos Exp $ + * $NetBSD: common.c,v 1.23 2009/02/27 04:18:45 msaitoh Exp $ */ #if !defined(lint) && !defined(SCCSID) @@ -121,7 +121,7 @@ ed_delete_prev_word(EditLine *el, int c *kp++ = *p; el->el_chared.c_kill.last = kp; - c_delbefore(el, el->el_line.cursor - cp); /* delete before dot */ + c_delbefore(el, (int)(el->el_line.cursor - cp));/* delete before dot */ el->el_line.cursor = cp; if (el->el_line.cursor < el->el_line.buffer) el->el_line.cursor = el->el_line.buffer; /* bounds check */ @@ -208,9 +208,6 @@ ed_move_to_end(EditLine *el, int c __unu el->el_line.cursor = el->el_line.lastchar; if (el->el_map.type == MAP_VI) { -#ifdef VI_MOVE - el->el_line.cursor--; -#endif if (el->el_chared.c_vcmd.action != NOP) { cv_delfini(el); return (CC_REFRESH); Modified: stable/9/lib/libedit/emacs.c ============================================================================== --- stable/9/lib/libedit/emacs.c Thu Jul 17 02:14:25 2014 (r268782) +++ stable/9/lib/libedit/emacs.c Thu Jul 17 02:22:03 2014 (r268783) @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $NetBSD: emacs.c,v 1.21 2006/03/06 21:11:56 christos Exp $ + * $NetBSD: emacs.c,v 1.22 2009/02/15 21:55:23 christos Exp $ */ #if !defined(lint) && !defined(SCCSID) @@ -101,7 +101,7 @@ em_delete_next_word(EditLine *el, int c *kp++ = *p; el->el_chared.c_kill.last = kp; - c_delafter(el, cp - el->el_line.cursor); /* delete after dot */ + c_delafter(el, (int)(cp - el->el_line.cursor)); /* delete after dot */ if (el->el_line.cursor > el->el_line.lastchar) el->el_line.cursor = el->el_line.lastchar; /* bounds check */ @@ -131,7 +131,8 @@ em_yank(EditLine *el, int c __unused) cp = el->el_line.cursor; /* open the space, */ - c_insert(el, el->el_chared.c_kill.last - el->el_chared.c_kill.buf); + c_insert(el, + (int)(el->el_chared.c_kill.last - el->el_chared.c_kill.buf)); /* copy the chars */ for (kp = el->el_chared.c_kill.buf; kp < el->el_chared.c_kill.last; kp++) *cp++ = *kp; @@ -185,14 +186,14 @@ em_kill_region(EditLine *el, int c __unu while (cp < el->el_chared.c_kill.mark) *kp++ = *cp++; /* copy it */ el->el_chared.c_kill.last = kp; - c_delafter(el, cp - el->el_line.cursor); + c_delafter(el, (int)(cp - el->el_line.cursor)); } else { /* mark is before cursor */ cp = el->el_chared.c_kill.mark; kp = el->el_chared.c_kill.buf; while (cp < el->el_line.cursor) *kp++ = *cp++; /* copy it */ el->el_chared.c_kill.last = kp; - c_delbefore(el, cp - el->el_chared.c_kill.mark); + c_delbefore(el, (int)(cp - el->el_chared.c_kill.mark)); el->el_line.cursor = el->el_chared.c_kill.mark; } return (CC_REFRESH); @@ -446,7 +447,7 @@ em_copy_prev_word(EditLine *el, int c __ cp = c__prev_word(el->el_line.cursor, el->el_line.buffer, el->el_state.argument, ce__isword); - c_insert(el, oldc - cp); + c_insert(el, (int)(oldc - cp)); for (dp = oldc; cp < oldc && dp < el->el_line.lastchar; cp++) *dp++ = *cp; Modified: stable/9/lib/libedit/filecomplete.h ============================================================================== --- stable/9/lib/libedit/filecomplete.h Thu Jul 17 02:14:25 2014 (r268782) +++ stable/9/lib/libedit/filecomplete.h Thu Jul 17 02:22:03 2014 (r268783) @@ -26,7 +26,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $NetBSD: filecomplete.h,v 1.9 2009/12/30 22:37:40 christos Exp $ + * $NetBSD: filecomplete.h,v 1.8 2009/02/16 00:15:45 christos Exp $ * $FreeBSD$ */ #ifndef _FILECOMPLETE_H_ Modified: stable/9/lib/libedit/histedit.h ============================================================================== --- stable/9/lib/libedit/histedit.h Thu Jul 17 02:14:25 2014 (r268782) +++ stable/9/lib/libedit/histedit.h Thu Jul 17 02:22:03 2014 (r268783) @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)histedit.h 8.2 (Berkeley) 1/3/94 - * $NetBSD: histedit.h,v 1.32 2007/06/10 20:20:28 christos Exp $ + * $NetBSD: histedit.h,v 1.41 2009/09/07 21:24:33 christos Exp $ * $FreeBSD$ */ Modified: stable/9/lib/libedit/prompt.c ============================================================================== --- stable/9/lib/libedit/prompt.c Thu Jul 17 02:14:25 2014 (r268782) +++ stable/9/lib/libedit/prompt.c Thu Jul 17 02:22:03 2014 (r268783) @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $NetBSD: prompt.c,v 1.11 2003/08/07 16:44:32 agc Exp $ + * $NetBSD: prompt.c,v 1.14 2009/03/31 17:38:27 christos Exp $ */ #if !defined(lint) && !defined(SCCSID) Modified: stable/9/lib/libedit/prompt.h ============================================================================== --- stable/9/lib/libedit/prompt.h Thu Jul 17 02:14:25 2014 (r268782) +++ stable/9/lib/libedit/prompt.h Thu Jul 17 02:22:03 2014 (r268783) @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)prompt.h 8.1 (Berkeley) 6/4/93 - * $NetBSD: prompt.h,v 1.6 2003/08/07 16:44:32 agc Exp $ + * $NetBSD: prompt.h,v 1.9 2009/03/31 17:38:27 christos Exp $ * $FreeBSD$ */ @@ -45,8 +45,8 @@ typedef char * (*el_pfunc_t)(EditLine*); typedef struct el_prompt_t { - el_pfunc_t p_func; /* Function to return the prompt */ - coord_t p_pos; /* position in the line after prompt */ + el_pfunc_t p_func; /* Function to return the prompt */ + coord_t p_pos; /* position in the line after prompt */ char p_ignore; /* character to start/end literal */ } el_prompt_t; Modified: stable/9/lib/libedit/read.h ============================================================================== --- stable/9/lib/libedit/read.h Thu Jul 17 02:14:25 2014 (r268782) +++ stable/9/lib/libedit/read.h Thu Jul 17 02:22:03 2014 (r268783) @@ -26,7 +26,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $NetBSD: read.h,v 1.5 2006/08/21 12:45:30 christos Exp $ + * $NetBSD: read.h,v 1.6 2008/04/29 06:53:01 martin Exp $ * $FreeBSD$ */ Modified: stable/9/lib/libedit/sys.h ============================================================================== --- stable/9/lib/libedit/sys.h Thu Jul 17 02:14:25 2014 (r268782) +++ stable/9/lib/libedit/sys.h Thu Jul 17 02:22:03 2014 (r268783) @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)sys.h 8.1 (Berkeley) 6/4/93 - * $NetBSD: sys.h,v 1.9 2004/01/17 17:57:40 christos Exp $ + * $NetBSD: sys.h,v 1.12 2009/08/31 00:05:43 christos Exp $ * $FreeBSD$ */ @@ -70,6 +70,15 @@ typedef void *ioctl_t; #define REGEX /* Use POSIX.2 regular expression functions */ #undef REGEXP /* Use UNIX V8 regular expression functions */ +#if defined(__sun) +extern int tgetent(char *, const char *); +extern int tgetflag(char *); +extern int tgetnum(char *); +extern int tputs(const char *, int, int (*)(int)); +extern char* tgoto(const char*, int, int); +extern char* tgetstr(char*, char**); +#endif + #ifdef notdef # undef REGEX # undef REGEXP Modified: stable/9/lib/libedit/term.h ============================================================================== --- stable/9/lib/libedit/term.h Thu Jul 17 02:14:25 2014 (r268782) +++ stable/9/lib/libedit/term.h Thu Jul 17 02:22:03 2014 (r268783) @@ -30,7 +30,7 @@ * SUCH DAMAGE. * * @(#)term.h 8.1 (Berkeley) 6/4/93 - * $NetBSD: term.h,v 1.18 2006/11/24 00:01:17 christos Exp $ + * $NetBSD: term.h,v 1.20 2009/03/31 17:38:27 christos Exp $ * $FreeBSD$ */ Modified: stable/9/lib/libedit/tty.c ============================================================================== --- stable/9/lib/libedit/tty.c Thu Jul 17 02:14:25 2014 (r268782) +++ stable/9/lib/libedit/tty.c Thu Jul 17 02:22:03 2014 (r268783) @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $NetBSD: tty.c,v 1.25 2006/03/18 09:09:41 christos Exp $ + * $NetBSD: tty.c,v 1.31 2009/07/22 15:58:09 christos Exp $ */ #if !defined(lint) && !defined(SCCSID) @@ -443,13 +443,12 @@ private const ttymodes_t ttymodes[] = { -#define tty_getty(el, td) tcgetattr((el)->el_infd, (td)) -#define tty_setty(el, td) tcsetattr((el)->el_infd, TCSADRAIN, (td)) - #define tty__gettabs(td) ((((td)->c_oflag & TAB3) == TAB3) ? 0 : 1) #define tty__geteightbit(td) (((td)->c_cflag & CSIZE) == CS8) #define tty__cooked_mode(td) ((td)->c_lflag & ICANON) +private int tty_getty(EditLine *, struct termios *); +private int tty_setty(EditLine *, int, const struct termios *); private int tty__getcharindex(int); private void tty__getchar(struct termios *, unsigned char *); private void tty__setchar(struct termios *, unsigned char *); @@ -458,6 +457,29 @@ private int tty_setup(EditLine *); #define t_qu t_ts +/* tty_getty(): + * Wrapper for tcgetattr to handle EINTR + */ +private int +tty_getty(EditLine *el, struct termios *t) +{ + int rv; + while ((rv = tcgetattr(el->el_infd, t)) == -1 && errno == EINTR) + continue; + return rv; +} + +/* tty_setty(): + * Wrapper for tcsetattr to handle EINTR + */ +private int +tty_setty(EditLine *el, int action, const struct termios *t) +{ + int rv; + while ((rv = tcsetattr(el->el_infd, action, t)) == -1 && errno == EINTR) + continue; + return rv; +} /* tty_setup(): * Get the tty parameters and initialize the editing state @@ -996,7 +1018,7 @@ tty_rawmode(EditLine *el) if (el->el_tty.t_mode == EX_IO) el->el_tty.t_ex = el->el_tty.t_ts; - if (tty_setty(el, &el->el_tty.t_ed) == -1) { + if (tty_setty(el, TCSADRAIN, &el->el_tty.t_ed) == -1) { #ifdef DEBUG_TTY (void) fprintf(el->el_errfile, "tty_rawmode: tty_setty: %s\n", strerror(errno)); @@ -1021,7 +1043,7 @@ tty_cookedmode(EditLine *el) if (el->el_flags & EDIT_DISABLED) return (0); - if (tty_setty(el, &el->el_tty.t_ex) == -1) { + if (tty_setty(el, TCSADRAIN, &el->el_tty.t_ex) == -1) { #ifdef DEBUG_TTY (void) fprintf(el->el_errfile, "tty_cookedmode: tty_setty: %s\n", @@ -1057,7 +1079,7 @@ tty_quotemode(EditLine *el) el->el_tty.t_qu.c_lflag &= ~el->el_tty.t_t[QU_IO][MD_LIN].t_clrmask; el->el_tty.t_qu.c_lflag |= el->el_tty.t_t[QU_IO][MD_LIN].t_setmask; - if (tty_setty(el, &el->el_tty.t_qu) == -1) { + if (tty_setty(el, TCSADRAIN, &el->el_tty.t_qu) == -1) { #ifdef DEBUG_TTY (void) fprintf(el->el_errfile, "QuoteModeOn: tty_setty: %s\n", strerror(errno)); @@ -1078,7 +1100,7 @@ tty_noquotemode(EditLine *el) if (el->el_tty.t_mode != QU_IO) return (0); - if (tty_setty(el, &el->el_tty.t_ed) == -1) { + if (tty_setty(el, TCSADRAIN, &el->el_tty.t_ed) == -1) { #ifdef DEBUG_TTY (void) fprintf(el->el_errfile, "QuoteModeOff: tty_setty: %s\n", strerror(errno)); @@ -1139,7 +1161,7 @@ tty_stty(EditLine *el, int argc __unused if (!argv || !*argv) { int i = -1; - int len = 0, st = 0, cu; + size_t len = 0, st = 0, cu; for (m = ttymodes; m->m_name; m++) { if (m->m_type != i) { (void) fprintf(el->el_outfile, "%s%s", @@ -1162,9 +1184,9 @@ tty_stty(EditLine *el, int argc __unused cu = strlen(m->m_name) + (x != '\0') + 1; - if (len + cu >= el->el_term.t_size.h) { + if (len + cu >= (size_t)el->el_term.t_size.h) { (void) fprintf(el->el_outfile, "\n%*s", - st, ""); + (int)st, ""); len = st + cu; } else len += cu; @@ -1208,7 +1230,8 @@ tty_stty(EditLine *el, int argc __unused int c = ffs((int)m->m_value); int v = *++p ? parse__escape((const char **) &p) : el->el_tty.t_vdisable; - assert(c-- != 0); + assert(c != 0); + c--; c = tty__getcharindex(c); assert(c != -1); tios->c_cc[c] = v; @@ -1229,6 +1252,17 @@ tty_stty(EditLine *el, int argc __unused break; } } + + if (el->el_tty.t_mode == z) { + if (tty_setty(el, TCSADRAIN, tios) == -1) { +#ifdef DEBUG_TTY + (void) fprintf(el->el_errfile, + "tty_stty: tty_setty: %s\n", strerror(errno)); +#endif /* DEBUG_TTY */ + return (-1); + } + } + return (0); } From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 02:33:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AAAE1EB2; Thu, 17 Jul 2014 02:33: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 965CA2E43; Thu, 17 Jul 2014 02:33:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6H2Xf0f065103; Thu, 17 Jul 2014 02:33:41 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6H2Xfvx065100; Thu, 17 Jul 2014 02:33:41 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407170233.s6H2Xfvx065100@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 17 Jul 2014 02:33:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268784 - stable/10/sbin/fsck_msdosfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 02:33:41 -0000 Author: pfg Date: Thu Jul 17 02:33:40 2014 New Revision: 268784 URL: http://svnweb.freebsd.org/changeset/base/268784 Log: MFC r268628, r268631, r268635: Convert *rootDir from external to static. fsck_msdosfs: be a bit more permissive. The free space value in the FSInfo block is merely unitialized when it is 0xffffffff. This fixes a bug found in NetBSD. Respect FSFIXFAT. Fix some whitespace issues while here. Obtained from: NetBSD (CVS rev. 1.22, rev. 1.9), OpenBSD (misc) Modified: stable/10/sbin/fsck_msdosfs/check.c stable/10/sbin/fsck_msdosfs/ext.h stable/10/sbin/fsck_msdosfs/fat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/fsck_msdosfs/check.c ============================================================================== --- stable/10/sbin/fsck_msdosfs/check.c Thu Jul 17 02:22:03 2014 (r268783) +++ stable/10/sbin/fsck_msdosfs/check.c Thu Jul 17 02:33:40 2014 (r268784) @@ -142,7 +142,7 @@ checkfilesys(const char *fname) goto out; /* now write the FATs */ - if (mod & FSFATMOD) { + if (mod & (FSFATMOD|FSFIXFAT)) { if (ask(1, "Update FATs")) { mod |= writefat(dosfs, &boot, fat, mod & FSFIXFAT); if (mod & FSFATAL) Modified: stable/10/sbin/fsck_msdosfs/ext.h ============================================================================== --- stable/10/sbin/fsck_msdosfs/ext.h Thu Jul 17 02:22:03 2014 (r268783) +++ stable/10/sbin/fsck_msdosfs/ext.h Thu Jul 17 02:33:40 2014 (r268784) @@ -26,7 +26,7 @@ */ #ifndef EXT_H -#define EXT_H +#define EXT_H #include @@ -71,8 +71,8 @@ int checkfilesys(const char *); #define FSFATMOD 4 /* The FAT was modified */ #define FSERROR 8 /* Some unrecovered error remains */ #define FSFATAL 16 /* Some unrecoverable error occurred */ -#define FSDIRTY 32 /* File system is dirty */ -#define FSFIXFAT 64 /* Fix file system FAT */ +#define FSDIRTY 32 /* File system is dirty */ +#define FSFIXFAT 64 /* Fix file system FAT */ /* * read a boot block in a machine independent fashion and translate Modified: stable/10/sbin/fsck_msdosfs/fat.c ============================================================================== --- stable/10/sbin/fsck_msdosfs/fat.c Thu Jul 17 02:22:03 2014 (r268783) +++ stable/10/sbin/fsck_msdosfs/fat.c Thu Jul 17 02:33:40 2014 (r268784) @@ -242,7 +242,7 @@ readfat(int fs, struct bootblock *boot, ret |= FSDIRTY; else { /* just some odd byte sequence in FAT */ - + switch (boot->ClustMask) { case CLUST32_MASK: pwarn("%s (%02x%02x%02x%02x%02x%02x%02x%02x)\n", @@ -262,7 +262,7 @@ readfat(int fs, struct bootblock *boot, break; } - + if (ask(1, "Correct")) ret |= FSFIXFAT; } @@ -653,7 +653,7 @@ checklost(int dosfs, struct bootblock *b cl_t head; int mod = FSOK; int ret; - + for (head = CLUST_FIRST; head < boot->NumClusters; head++) { /* find next untravelled chain */ if (fat[head].head != head @@ -677,8 +677,9 @@ checklost(int dosfs, struct bootblock *b if (boot->bpbFSInfo) { ret = 0; - if (boot->FSFree != boot->NumFree) { - pwarn("Free space in FSInfo block (%d) not correct (%d)\n", + if (boot->FSFree != 0xffffffffU && + boot->FSFree != boot->NumFree) { + pwarn("Free space in FSInfo block (%u) not correct (%u)\n", boot->FSFree, boot->NumFree); if (ask(1, "Fix")) { boot->FSFree = boot->NumFree; From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 02:43:54 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D6A831E7; Thu, 17 Jul 2014 02:43:54 +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 C29B52F0E; Thu, 17 Jul 2014 02:43:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6H2hsCX069656; Thu, 17 Jul 2014 02:43:54 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6H2hsnj069644; Thu, 17 Jul 2014 02:43:54 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407170243.s6H2hsnj069644@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 17 Jul 2014 02:43:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r268785 - stable/9/sbin/fsck_msdosfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 02:43:55 -0000 Author: pfg Date: Thu Jul 17 02:43:53 2014 New Revision: 268785 URL: http://svnweb.freebsd.org/changeset/base/268785 Log: MFC r268628, r268631, r268635: Convert *rootDir from external to static. fsck_msdosfs: be a bit more permissive. The free space value in the FSInfo block is merely unitialized when it is 0xffffffff. This fixes a bug found in NetBSD. Respect FSFIXFAT. Fix some whitespace issues while here. Obtained from: NetBSD (CVS rev. 1.22, rev. 1.9), OpenBSD (misc) Modified: stable/9/sbin/fsck_msdosfs/check.c stable/9/sbin/fsck_msdosfs/dir.c stable/9/sbin/fsck_msdosfs/ext.h stable/9/sbin/fsck_msdosfs/fat.c Directory Properties: stable/9/sbin/fsck_msdosfs/ (props changed) Modified: stable/9/sbin/fsck_msdosfs/check.c ============================================================================== --- stable/9/sbin/fsck_msdosfs/check.c Thu Jul 17 02:33:40 2014 (r268784) +++ stable/9/sbin/fsck_msdosfs/check.c Thu Jul 17 02:43:53 2014 (r268785) @@ -142,7 +142,7 @@ checkfilesys(const char *fname) goto out; /* now write the FATs */ - if (mod & FSFATMOD) { + if (mod & (FSFATMOD|FSFIXFAT)) { if (ask(1, "Update FATs")) { mod |= writefat(dosfs, &boot, fat, mod & FSFIXFAT); if (mod & FSFATAL) Modified: stable/9/sbin/fsck_msdosfs/dir.c ============================================================================== --- stable/9/sbin/fsck_msdosfs/dir.c Thu Jul 17 02:33:40 2014 (r268784) +++ stable/9/sbin/fsck_msdosfs/dir.c Thu Jul 17 02:43:53 2014 (r268785) @@ -206,7 +206,7 @@ static char longName[DOSLONGNAMELEN] = " static u_char *buffer = NULL; static u_char *delbuf = NULL; -struct dosDirEntry *rootDir; +static struct dosDirEntry *rootDir; static struct dosDirEntry *lostDir; /* Modified: stable/9/sbin/fsck_msdosfs/ext.h ============================================================================== --- stable/9/sbin/fsck_msdosfs/ext.h Thu Jul 17 02:33:40 2014 (r268784) +++ stable/9/sbin/fsck_msdosfs/ext.h Thu Jul 17 02:43:53 2014 (r268785) @@ -26,7 +26,7 @@ */ #ifndef EXT_H -#define EXT_H +#define EXT_H #include @@ -43,8 +43,6 @@ extern int preen; /* we are preening */ extern int rdonly; /* device is opened read only (supersedes above) */ extern int skipclean; /* skip clean file systems if preening */ -extern struct dosDirEntry *rootDir; - /* * function declarations */ @@ -71,8 +69,8 @@ int checkfilesys(const char *); #define FSFATMOD 4 /* The FAT was modified */ #define FSERROR 8 /* Some unrecovered error remains */ #define FSFATAL 16 /* Some unrecoverable error occurred */ -#define FSDIRTY 32 /* File system is dirty */ -#define FSFIXFAT 64 /* Fix file system FAT */ +#define FSDIRTY 32 /* File system is dirty */ +#define FSFIXFAT 64 /* Fix file system FAT */ /* * read a boot block in a machine independent fashion and translate Modified: stable/9/sbin/fsck_msdosfs/fat.c ============================================================================== --- stable/9/sbin/fsck_msdosfs/fat.c Thu Jul 17 02:33:40 2014 (r268784) +++ stable/9/sbin/fsck_msdosfs/fat.c Thu Jul 17 02:43:53 2014 (r268785) @@ -240,7 +240,7 @@ readfat(int fs, struct bootblock *boot, ret |= FSDIRTY; else { /* just some odd byte sequence in FAT */ - + switch (boot->ClustMask) { case CLUST32_MASK: pwarn("%s (%02x%02x%02x%02x%02x%02x%02x%02x)\n", @@ -260,7 +260,7 @@ readfat(int fs, struct bootblock *boot, break; } - + if (ask(1, "Correct")) ret |= FSFIXFAT; } @@ -651,7 +651,7 @@ checklost(int dosfs, struct bootblock *b cl_t head; int mod = FSOK; int ret; - + for (head = CLUST_FIRST; head < boot->NumClusters; head++) { /* find next untravelled chain */ if (fat[head].head != head @@ -675,8 +675,9 @@ checklost(int dosfs, struct bootblock *b if (boot->bpbFSInfo) { ret = 0; - if (boot->FSFree != boot->NumFree) { - pwarn("Free space in FSInfo block (%d) not correct (%d)\n", + if (boot->FSFree != 0xffffffffU && + boot->FSFree != boot->NumFree) { + pwarn("Free space in FSInfo block (%u) not correct (%u)\n", boot->FSFree, boot->NumFree); if (ask(1, "Fix")) { boot->FSFree = boot->NumFree; From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 05:20:19 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B334B7BF; Thu, 17 Jul 2014 05:20:19 +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 955522B83; Thu, 17 Jul 2014 05:20:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6H5KJVt042098; Thu, 17 Jul 2014 05:20:19 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6H5KIYd042094; Thu, 17 Jul 2014 05:20:18 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407170520.s6H5KIYd042094@svn.freebsd.org> From: Xin LI Date: Thu, 17 Jul 2014 05:20:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268786 - in stable/10: cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 05:20:19 -0000 Author: delphij Date: Thu Jul 17 05:20:18 2014 New Revision: 268786 URL: http://svnweb.freebsd.org/changeset/base/268786 Log: MFC r268116: - Fix handling of "new" style of ioctl in compatiblity mode [1]; - Reorganize code and reduce diff from upstream; - Improve forward compatibility shims for previous kernel; Reported by: sbruno [1] Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c Thu Jul 17 02:43:53 2014 (r268785) +++ stable/10/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.c Thu Jul 17 05:20:18 2014 (r268786) @@ -72,16 +72,23 @@ zcmd_ioctl(int fd, int request, zfs_cmd_ if (zfs_ioctl_version == ZFS_IOCVER_UNDEF) zfs_ioctl_version = get_zfs_ioctl_version(); - if (zfs_ioctl_version == ZFS_IOCVER_LZC) - cflag = ZFS_CMD_COMPAT_LZC; - else if (zfs_ioctl_version == ZFS_IOCVER_DEADMAN) - cflag = ZFS_CMD_COMPAT_DEADMAN; - - /* - * If vfs.zfs.version.ioctl is not defined, assume we have v28 - * compatible binaries and use vfs.zfs.version.spa to test for v15 - */ - if (zfs_ioctl_version < ZFS_IOCVER_DEADMAN) { + if (zfs_ioctl_version >= ZFS_IOCVER_DEADMAN) { + switch (zfs_ioctl_version) { + case ZFS_IOCVER_ZCMD: + cflag = ZFS_CMD_COMPAT_ZCMD; + break; + case ZFS_IOCVER_LZC: + cflag = ZFS_CMD_COMPAT_LZC; + break; + case ZFS_IOCVER_DEADMAN: + cflag = ZFS_CMD_COMPAT_DEADMAN; + break; + } + } else { + /* + * If vfs.zfs.version.ioctl is not defined, assume we have v28 + * compatible binaries and use vfs.zfs.version.spa to test for v15 + */ cflag = ZFS_CMD_COMPAT_V28; if (zfs_spa_version < 0) Modified: stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c Thu Jul 17 02:43:53 2014 (r268785) +++ stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c Thu Jul 17 05:20:18 2014 (r268786) @@ -697,6 +697,12 @@ zcmd_ioctl_compat(int fd, int request, z zp.zfs_cmd_size = sizeof(zfs_cmd_t); zp.zfs_ioctl_version = ZFS_IOCVER_CURRENT; return (ioctl(fd, ncmd, &zp)); + case ZFS_CMD_COMPAT_ZCMD: + ncmd = _IOWR('Z', request, struct zfs_iocparm); + zp.zfs_cmd = (uint64_t)zc; + zp.zfs_cmd_size = sizeof(zfs_cmd_zcmd_t); + zp.zfs_ioctl_version = ZFS_IOCVER_ZCMD; + return (ioctl(fd, ncmd, &zp)); case ZFS_CMD_COMPAT_LZC: ncmd = _IOWR('Z', request, struct zfs_cmd); return (ioctl(fd, ncmd, zc)); @@ -794,7 +800,8 @@ zfs_ioctl_compat_innvl(zfs_cmd_t *zc, nv char *poolname, *snapname; int err; - if (cflag == ZFS_CMD_COMPAT_NONE || cflag == ZFS_CMD_COMPAT_LZC) + if (cflag == ZFS_CMD_COMPAT_NONE || cflag == ZFS_CMD_COMPAT_LZC || + cflag == ZFS_CMD_COMPAT_ZCMD) goto out; switch (vec) { @@ -945,7 +952,8 @@ zfs_ioctl_compat_outnvl(zfs_cmd_t *zc, n { nvlist_t *tmpnvl; - if (cflag == ZFS_CMD_COMPAT_NONE || cflag == ZFS_CMD_COMPAT_LZC) + if (cflag == ZFS_CMD_COMPAT_NONE || cflag == ZFS_CMD_COMPAT_LZC || + cflag == ZFS_CMD_COMPAT_ZCMD) return (outnvl); switch (vec) { Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Jul 17 02:43:53 2014 (r268785) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Jul 17 05:20:18 2014 (r268786) @@ -24,6 +24,7 @@ * Copyright (c) 2011-2012 Pawel Jakub Dawidek . * All rights reserved. * Copyright 2013 Martin Matuska . All rights reserved. + * Copyright 2014 Xin Li . All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2014, Joyent, Inc. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. @@ -5893,6 +5894,7 @@ zfsdev_ioctl(struct cdev *dev, u_long zc zfs_iocparm_t *zc_iocparm; int cflag, cmd, oldvecnum; boolean_t newioc, compat; + void *compat_zc = NULL; cred_t *cr = td->td_ucred; #endif const zfs_ioc_vec_t *vec; @@ -5901,10 +5903,10 @@ zfsdev_ioctl(struct cdev *dev, u_long zc cflag = ZFS_CMD_COMPAT_NONE; compat = B_FALSE; - newioc = B_TRUE; + newioc = B_TRUE; /* "new" style (zfs_iocparm_t) ioctl */ len = IOCPARM_LEN(zcmd); - cmd = zcmd & 0xff; + vecnum = cmd = zcmd & 0xff; /* * Check if we are talking to supported older binaries @@ -5912,96 +5914,112 @@ zfsdev_ioctl(struct cdev *dev, u_long zc */ if (len != sizeof(zfs_iocparm_t)) { newioc = B_FALSE; - if (len == sizeof(zfs_cmd_t)) { + compat = B_TRUE; + + vecnum = cmd; + + switch (len) { + case sizeof(zfs_cmd_zcmd_t): cflag = ZFS_CMD_COMPAT_LZC; - vecnum = cmd; - } else if (len == sizeof(zfs_cmd_deadman_t)) { + break; + case sizeof(zfs_cmd_deadman_t): cflag = ZFS_CMD_COMPAT_DEADMAN; - compat = B_TRUE; - vecnum = cmd; - } else if (len == sizeof(zfs_cmd_v28_t)) { + break; + case sizeof(zfs_cmd_v28_t): cflag = ZFS_CMD_COMPAT_V28; - compat = B_TRUE; - vecnum = cmd; - } else if (len == sizeof(zfs_cmd_v15_t)) { + break; + case sizeof(zfs_cmd_v15_t): cflag = ZFS_CMD_COMPAT_V15; - compat = B_TRUE; vecnum = zfs_ioctl_v15_to_v28[cmd]; - } else + + /* + * Return without further handling + * if the command is blacklisted. + */ + if (vecnum == ZFS_IOC_COMPAT_PASS) + return (0); + else if (vecnum == ZFS_IOC_COMPAT_FAIL) + return (ENOTSUP); + break; + default: return (EINVAL); - } else - vecnum = cmd; + } + } #ifdef illumos vecnum = cmd - ZFS_IOC_FIRST; ASSERT3U(getmajor(dev), ==, ddi_driver_major(zfs_dip)); #endif - if (compat) { - if (vecnum == ZFS_IOC_COMPAT_PASS) - return (0); - else if (vecnum == ZFS_IOC_COMPAT_FAIL) - return (ENOTSUP); - } - - /* - * Check if we have sufficient kernel memory allocated - * for the zfs_cmd_t request. Bail out if not so we - * will not access undefined memory region. - */ if (vecnum >= sizeof (zfs_ioc_vec) / sizeof (zfs_ioc_vec[0])) return (SET_ERROR(EINVAL)); vec = &zfs_ioc_vec[vecnum]; -#ifdef illumos zc = kmem_zalloc(sizeof(zfs_cmd_t), KM_SLEEP); - bzero(zc, sizeof(zfs_cmd_t)); +#ifdef illumos error = ddi_copyin((void *)arg, zc, sizeof (zfs_cmd_t), flag); if (error != 0) { error = SET_ERROR(EFAULT); goto out; } #else /* !illumos */ - /* - * We don't alloc/free zc only if talking to library ioctl version 2 - */ - if (cflag != ZFS_CMD_COMPAT_LZC) { - zc = kmem_zalloc(sizeof(zfs_cmd_t), KM_SLEEP); - bzero(zc, sizeof(zfs_cmd_t)); - } else { - zc = (void *)arg; - error = 0; - } + bzero(zc, sizeof(zfs_cmd_t)); if (newioc) { zc_iocparm = (void *)arg; - if (zc_iocparm->zfs_cmd_size != sizeof(zfs_cmd_t)) { - error = SET_ERROR(EFAULT); - goto out; - } - error = ddi_copyin((void *)(uintptr_t)zc_iocparm->zfs_cmd, zc, - sizeof(zfs_cmd_t), flag); - if (error != 0) { - error = SET_ERROR(EFAULT); + + switch (zc_iocparm->zfs_ioctl_version) { + case ZFS_IOCVER_CURRENT: + if (zc_iocparm->zfs_cmd_size != sizeof(zfs_cmd_t)) { + error = SET_ERROR(EINVAL); + goto out; + } + break; + case ZFS_IOCVER_ZCMD: + if (zc_iocparm->zfs_cmd_size > sizeof(zfs_cmd_t) || + zc_iocparm->zfs_cmd_size < sizeof(zfs_cmd_zcmd_t)) { + error = SET_ERROR(EFAULT); + goto out; + } + compat = B_TRUE; + cflag = ZFS_CMD_COMPAT_ZCMD; + break; + default: + error = SET_ERROR(EINVAL); goto out; + /* NOTREACHED */ } - if (zc_iocparm->zfs_ioctl_version != ZFS_IOCVER_CURRENT) { - compat = B_TRUE; - switch (zc_iocparm->zfs_ioctl_version) { - case ZFS_IOCVER_ZCMD: - cflag = ZFS_CMD_COMPAT_ZCMD; - break; - default: - error = SET_ERROR(EINVAL); + if (compat) { + ASSERT(sizeof(zfs_cmd_t) >= zc_iocparm->zfs_cmd_size); + compat_zc = kmem_zalloc(sizeof(zfs_cmd_t), KM_SLEEP); + bzero(compat_zc, sizeof(zfs_cmd_t)); + + error = ddi_copyin((void *)(uintptr_t)zc_iocparm->zfs_cmd, + compat_zc, zc_iocparm->zfs_cmd_size, flag); + if (error != 0) { + error = SET_ERROR(EFAULT); + goto out; + } + } else { + error = ddi_copyin((void *)(uintptr_t)zc_iocparm->zfs_cmd, + zc, zc_iocparm->zfs_cmd_size, flag); + if (error != 0) { + error = SET_ERROR(EFAULT); goto out; } } } if (compat) { - zfs_cmd_compat_get(zc, arg, cflag); + if (newioc) { + ASSERT(compat_zc != NULL); + zfs_cmd_compat_get(zc, compat_zc, cflag); + } else { + ASSERT(compat_zc == NULL); + zfs_cmd_compat_get(zc, arg, cflag); + } oldvecnum = vecnum; error = zfs_ioctl_compat_pre(zc, &vecnum, cflag); if (error != 0) @@ -6097,7 +6115,7 @@ zfsdev_ioctl(struct cdev *dev, u_long zc fnvlist_free(lognv); /* rewrite outnvl for backwards compatibility */ - if (cflag != ZFS_CMD_COMPAT_NONE && cflag != ZFS_CMD_COMPAT_LZC) + if (compat) outnvl = zfs_ioctl_compat_outnvl(zc, outnvl, vecnum, cflag); @@ -6122,17 +6140,30 @@ zfsdev_ioctl(struct cdev *dev, u_long zc out: nvlist_free(innvl); - if (compat) { - zfs_ioctl_compat_post(zc, cmd, cflag); - zfs_cmd_compat_put(zc, arg, vecnum, cflag); - } - #ifdef illumos rc = ddi_copyout(zc, (void *)arg, sizeof (zfs_cmd_t), flag); if (error == 0 && rc != 0) error = SET_ERROR(EFAULT); #else - if (newioc) { + if (compat) { + zfs_ioctl_compat_post(zc, cmd, cflag); + if (newioc) { + ASSERT(compat_zc != NULL); + ASSERT(sizeof(zfs_cmd_t) >= zc_iocparm->zfs_cmd_size); + + zfs_cmd_compat_put(zc, compat_zc, vecnum, cflag); + rc = ddi_copyout(compat_zc, + (void *)(uintptr_t)zc_iocparm->zfs_cmd, + zc_iocparm->zfs_cmd_size, flag); + if (error == 0 && rc != 0) + error = SET_ERROR(EFAULT); + kmem_free(compat_zc, sizeof (zfs_cmd_t)); + } else { + zfs_cmd_compat_put(zc, arg, vecnum, cflag); + } + } else { + ASSERT(newioc); + rc = ddi_copyout(zc, (void *)(uintptr_t)zc_iocparm->zfs_cmd, sizeof (zfs_cmd_t), flag); if (error == 0 && rc != 0) @@ -6149,15 +6180,7 @@ out: strfree(saved_poolname); } -#ifdef illumos kmem_free(zc, sizeof (zfs_cmd_t)); -#else - /* - * We don't alloc/free zc only if talking to library ioctl version 2 - */ - if (cflag != ZFS_CMD_COMPAT_LZC) - kmem_free(zc, sizeof (zfs_cmd_t)); -#endif return (error); } From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 05:21:17 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4237F97D; Thu, 17 Jul 2014 05:21:17 +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 3082D2BFB; Thu, 17 Jul 2014 05:21:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6H5LHHb042652; Thu, 17 Jul 2014 05:21:17 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6H5LGbx042649; Thu, 17 Jul 2014 05:21:16 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201407170521.s6H5LGbx042649@svn.freebsd.org> From: Kevin Lo Date: Thu, 17 Jul 2014 05:21:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268787 - in head/sys: kern net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 05:21:17 -0000 Author: kevlo Date: Thu Jul 17 05:21:16 2014 New Revision: 268787 URL: http://svnweb.freebsd.org/changeset/base/268787 Log: Deprecate m_act. Use m_nextpkt always. Modified: head/sys/kern/uipc_usrreq.c head/sys/net/if.c head/sys/net/if_spppsubr.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Thu Jul 17 05:20:18 2014 (r268786) +++ head/sys/kern/uipc_usrreq.c Thu Jul 17 05:21:16 2014 (r268787) @@ -2348,7 +2348,7 @@ unp_scan(struct mbuf *m0, void (*op)(str } } } - m0 = m0->m_act; + m0 = m0->m_nextpkt; } } Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Thu Jul 17 05:20:18 2014 (r268786) +++ head/sys/net/if.c Thu Jul 17 05:21:16 2014 (r268787) @@ -2087,7 +2087,7 @@ if_qflush(struct ifnet *ifp) #endif n = ifq->ifq_head; while ((m = n) != 0) { - n = m->m_act; + n = m->m_nextpkt; m_freem(m); } ifq->ifq_head = 0; Modified: head/sys/net/if_spppsubr.c ============================================================================== --- head/sys/net/if_spppsubr.c Thu Jul 17 05:20:18 2014 (r268786) +++ head/sys/net/if_spppsubr.c Thu Jul 17 05:21:16 2014 (r268787) @@ -4753,7 +4753,7 @@ sppp_qflush(struct ifqueue *ifq) n = ifq->ifq_head; while ((m = n)) { - n = m->m_act; + n = m->m_nextpkt; m_freem (m); } ifq->ifq_head = 0; From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 05:45:55 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 17AF91A7; Thu, 17 Jul 2014 05:45: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 066202DD3; Thu, 17 Jul 2014 05:45:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6H5jsB8055082; Thu, 17 Jul 2014 05:45:54 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6H5js9B055081; Thu, 17 Jul 2014 05:45:54 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201407170545.s6H5js9B055081@svn.freebsd.org> From: Adrian Chadd Date: Thu, 17 Jul 2014 05:45:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268788 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 05:45:55 -0000 Author: adrian Date: Thu Jul 17 05:45:54 2014 New Revision: 268788 URL: http://svnweb.freebsd.org/changeset/base/268788 Log: Oops - somehow I missed the IP option numbers clashing with the multicast numbers below. Move them to a new set of non-clashing numbers. Modified: head/sys/netinet/in.h Modified: head/sys/netinet/in.h ============================================================================== --- head/sys/netinet/in.h Thu Jul 17 05:21:16 2014 (r268787) +++ head/sys/netinet/in.h Thu Jul 17 05:45:54 2014 (r268788) @@ -470,10 +470,6 @@ __END_DECLS #define IP_MINTTL 66 /* minimum TTL for packet or drop */ #define IP_DONTFRAG 67 /* don't fragment packet */ #define IP_RECVTOS 68 /* bool; receive IP TOS w/dgram */ -#define IP_FLOWID 69 /* get flow id for the given socket/inp */ -#define IP_FLOWTYPE 70 /* get flow type (M_HASHTYPE) */ -/* 71 - XXX was IP_RSSCPUID - can recycle whenever */ -#define IP_RSSBUCKETID 72 /* get RSS flowid -> bucket mapping */ /* IPv4 Source Filter Multicast API [RFC3678] */ #define IP_ADD_SOURCE_MEMBERSHIP 70 /* join a source-specific group */ @@ -492,6 +488,11 @@ __END_DECLS #define MCAST_BLOCK_SOURCE 84 /* block a source */ #define MCAST_UNBLOCK_SOURCE 85 /* unblock a source */ +/* Flow and RSS definitions */ +#define IP_FLOWID 90 /* get flow id for the given socket/inp */ +#define IP_FLOWTYPE 91 /* get flow type (M_HASHTYPE) */ +#define IP_RSSBUCKETID 92 /* get RSS flowid -> bucket mapping */ + /* * Defaults and limits for options */ From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 06:21:59 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0FD718F4; Thu, 17 Jul 2014 06:21: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 F27542143; Thu, 17 Jul 2014 06:21:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6H6LwtW073358; Thu, 17 Jul 2014 06:21:58 GMT (envelope-from hiren@svn.freebsd.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6H6LwJ2073357; Thu, 17 Jul 2014 06:21:58 GMT (envelope-from hiren@svn.freebsd.org) Message-Id: <201407170621.s6H6LwJ2073357@svn.freebsd.org> From: Hiren Panchasara Date: Thu, 17 Jul 2014 06:21:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268790 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 06:21:59 -0000 Author: hiren Date: Thu Jul 17 06:21:58 2014 New Revision: 268790 URL: http://svnweb.freebsd.org/changeset/base/268790 Log: Fix a typo. PR: 191898 Submitted by: vsjcfm@gmail.com Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Thu Jul 17 05:54:58 2014 (r268789) +++ head/sys/dev/ixgbe/ixgbe.c Thu Jul 17 06:21:58 2014 (r268790) @@ -304,7 +304,7 @@ SYSCTL_INT(_hw_ix, OID_AUTO, num_queues, */ static int ixgbe_txd = PERFORM_TXD; SYSCTL_INT(_hw_ix, OID_AUTO, txd, CTLFLAG_RDTUN, &ixgbe_txd, 0, - "Number of receive descriptors per queue"); + "Number of transmit descriptors per queue"); /* Number of RX descriptors per ring */ static int ixgbe_rxd = PERFORM_RXD; From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 06:36:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 395B4CD3; Thu, 17 Jul 2014 06:36:23 +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 0CBC12277; Thu, 17 Jul 2014 06:36:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6H6aM6i078685; Thu, 17 Jul 2014 06:36:22 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6H6aMsE078681; Thu, 17 Jul 2014 06:36:22 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407170636.s6H6aMsE078681@svn.freebsd.org> From: Xin LI Date: Thu, 17 Jul 2014 06:36:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268791 - stable/10/usr.sbin/gstat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 06:36:23 -0000 Author: delphij Date: Thu Jul 17 06:36:22 2014 New Revision: 268791 URL: http://svnweb.freebsd.org/changeset/base/268791 Log: MFC r268238: Add an option, -p, which makes gstat(8) to only display physical providers (those with rank of 1). Modified: stable/10/usr.sbin/gstat/gstat.8 stable/10/usr.sbin/gstat/gstat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/gstat/gstat.8 ============================================================================== --- stable/10/usr.sbin/gstat/gstat.8 Thu Jul 17 06:21:58 2014 (r268790) +++ stable/10/usr.sbin/gstat/gstat.8 Thu Jul 17 06:36:22 2014 (r268791) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 17, 2014 +.Dd July 3, 2014 .Dt GSTAT 8 .Os .Sh NAME @@ -32,7 +32,7 @@ .Nd print statistics about GEOM disks .Sh SYNOPSIS .Nm -.Op Fl abcdo +.Op Fl abcdop .Op Fl f Ar filter .Op Fl I Ar interval .Sh DESCRIPTION @@ -84,6 +84,8 @@ or .Cm us (the default) indicates that the update interval is specified in seconds, milliseconds, or microseconds, respectively. +.It Fl p +Only display physical providers (those with rank of 1). .El .Sh EXIT STATUS .Ex -std Modified: stable/10/usr.sbin/gstat/gstat.c ============================================================================== --- stable/10/usr.sbin/gstat/gstat.c Thu Jul 17 06:21:58 2014 (r268790) +++ stable/10/usr.sbin/gstat/gstat.c Thu Jul 17 06:36:22 2014 (r268791) @@ -51,7 +51,7 @@ #include #include -static int flag_a, flag_b, flag_c, flag_d, flag_o; +static int flag_a, flag_b, flag_c, flag_d, flag_o, flag_p; static int flag_I = 1000000; #define PRINTMSG(...) do { \ @@ -104,7 +104,7 @@ main(int argc, char **argv) flag_b = 1; f_s[0] = '\0'; - while ((i = getopt(argc, argv, "abdcf:oI:")) != -1) { + while ((i = getopt(argc, argv, "abdcf:I:op")) != -1) { switch (i) { case 'a': flag_a = 1; @@ -143,6 +143,9 @@ main(int argc, char **argv) i *= 1; flag_I = i; break; + case 'p': + flag_p = 1; + break; case '?': default: usage(); @@ -254,6 +257,9 @@ main(int argc, char **argv) continue; if (gid->lg_what == ISCONSUMER && !flag_c) continue; + if (flag_p && gid->lg_what == ISPROVIDER && + ((struct gprovider *)(gid->lg_ptr))->lg_geom->lg_rank != 1) + continue; /* Do not print past end of window */ if (!flag_b) { getyx(stdscr, cury, curx); @@ -443,7 +449,7 @@ main(int argc, char **argv) static void usage(void) { - fprintf(stderr, "usage: gstat [-abcd] [-f filter] [-I interval]\n"); + fprintf(stderr, "usage: gstat [-abcdp] [-f filter] [-I interval]\n"); exit(EX_USAGE); /* NOTREACHED */ } From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 06:54:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 02C482C4; Thu, 17 Jul 2014 06:54:13 +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 E4EED242F; Thu, 17 Jul 2014 06:54:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6H6sCnH087430; Thu, 17 Jul 2014 06:54:12 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6H6sCSR087427; Thu, 17 Jul 2014 06:54:12 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201407170654.s6H6sCSR087427@svn.freebsd.org> From: Eitan Adler Date: Thu, 17 Jul 2014 06:54:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268792 - head/usr.bin/units X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 06:54:13 -0000 Author: eadler Date: Thu Jul 17 06:54:12 2014 New Revision: 268792 URL: http://svnweb.freebsd.org/changeset/base/268792 Log: units(1): Add support for output-format Add support for the output-format argument. This also exposes subtle rounding differences between GNU units and our units. Modified: head/usr.bin/units/units.1 head/usr.bin/units/units.c Modified: head/usr.bin/units/units.1 ============================================================================== --- head/usr.bin/units/units.1 Thu Jul 17 06:36:22 2014 (r268791) +++ head/usr.bin/units/units.1 Thu Jul 17 06:54:12 2014 (r268792) @@ -17,6 +17,8 @@ The following options are available: Show an overview of options .It Fl f Ar filename No , Fl -file Ar filename Specify the name of the units data file to load. +.It Fl e , Fl -exponential +Behave as if -o '%6e' was typed. .It Fl q No , Fl -quiet Suppress prompting of the user for units and the display of statistics about the number of units loaded. @@ -33,6 +35,8 @@ from other programs for easy to parse re .It Fl v No , Fl -verbose Print the units in the conversion output. Be more verbose in general. +.It Fl o Ar format No , Fl -output-format Ar format +Select the output format string by which numbers are printed. .It Fl V No , Fl -version Print the version number, usage, and then exit. .It Ar from-unit to-unit Modified: head/usr.bin/units/units.c ============================================================================== --- head/usr.bin/units/units.c Thu Jul 17 06:36:22 2014 (r268791) +++ head/usr.bin/units/units.c Thu Jul 17 06:54:12 2014 (r268792) @@ -75,6 +75,7 @@ static int unitcount; static int prefixcount; static bool verbose = false; static bool terse = false; +static const char * outputformat; static const char * havestr; static const char * wantstr; @@ -649,6 +650,7 @@ static void showanswer(struct unittype * have, struct unittype * want) { double ans; + char* oformat; if (compareunits(have, want)) { printf("conformability error\n"); @@ -668,11 +670,16 @@ showanswer(struct unittype * have, struc else if (have->offset != want->offset) { if (want->quantity) printf("WARNING: conversion of non-proportional quantities.\n"); - if (have->quantity) - printf("\t%.8g\n", + if (have->quantity) { + asprintf(&oformat, "\t%s\n", outputformat); + printf(oformat, (have->factor + have->offset-want->offset)/want->factor); + free(oformat); + } else { - printf("\t (-> x*%.8g %+.8g)\n\t (<- y*%.8g %+.8g)\n", + asprintf(&oformat, "\t (-> x*%sg %sg)\n\t (<- y*%sg %sg)\n", + outputformat, outputformat, outputformat, outputformat); + printf(oformat, have->factor / want->factor, (have->offset-want->offset)/want->factor, want->factor / have->factor, @@ -681,17 +688,33 @@ showanswer(struct unittype * have, struc } else { ans = have->factor / want->factor; - if (verbose) - printf("\t%s = %.8g * %s\n", havestr, ans, wantstr); - else if (terse) - printf("%.8g\n", ans); - else - printf("\t* %.8g\n", ans); - if (verbose) - printf("\t%s = (1 / %.8g) * %s\n", havestr, 1/ans, wantstr); - else if (!terse) - printf("\t/ %.8g\n", 1/ans); + if (verbose) { + printf("\t%s = ", havestr); + printf(outputformat, ans); + printf(" * %s", wantstr); + printf("\n"); + } + else if (terse) { + printf(outputformat, ans); + printf("\n"); + } + else { + printf("\t* "); + printf(outputformat, ans); + printf("\n"); + } + + if (verbose) { + printf("\t%s = (1 / ", havestr); + printf(outputformat, 1/ans); + printf(") * %s\n", wantstr); + } + else if (!terse) { + printf("\t/ "); + printf(outputformat, 1/ans); + printf("\n"); + } } } @@ -706,7 +729,9 @@ usage(void) static struct option longopts[] = { {"help", no_argument, NULL, 'h'}, + {"exponential", no_argument, NULL, 'e'}, {"file", required_argument, NULL, 'f'}, + {"output-format", required_argument, NULL, 'o'}, {"quiet", no_argument, NULL, 'q'}, {"terse", no_argument, NULL, 't'}, {"unitsfile", no_argument, NULL, 'U'}, @@ -731,8 +756,12 @@ main(int argc, char **argv) quiet = false; readfile = false; - while ((optchar = getopt_long(argc, argv, "+hf:qtvUV", longopts, NULL)) != -1) { + outputformat = "%.8g"; + while ((optchar = getopt_long(argc, argv, "+ehf:oqtvUV", longopts, NULL)) != -1) { switch (optchar) { + case 'e': + outputformat = "%6e"; + break; case 'f': readfile = true; if (strlen(optarg) == 0) @@ -746,6 +775,9 @@ main(int argc, char **argv) case 't': terse = true; break; + case 'o': + outputformat = optarg; + break; case 'v': verbose = true; break; From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 06:57:27 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 248D8485; Thu, 17 Jul 2014 06:57:27 +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 12C80245B; Thu, 17 Jul 2014 06:57:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6H6vQhs088020; Thu, 17 Jul 2014 06:57:26 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6H6vQlp088019; Thu, 17 Jul 2014 06:57:26 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201407170657.s6H6vQlp088019@svn.freebsd.org> From: Eitan Adler Date: Thu, 17 Jul 2014 06:57:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268793 - head/usr.sbin/chown/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 06:57:27 -0000 Author: eadler Date: Thu Jul 17 06:57:26 2014 New Revision: 268793 URL: http://svnweb.freebsd.org/changeset/base/268793 Log: chown: Fix chown test number Modified: head/usr.sbin/chown/tests/chown-f_test.sh Modified: head/usr.sbin/chown/tests/chown-f_test.sh ============================================================================== --- head/usr.sbin/chown/tests/chown-f_test.sh Thu Jul 17 06:54:12 2014 (r268792) +++ head/usr.sbin/chown/tests/chown-f_test.sh Thu Jul 17 06:57:26 2014 (r268793) @@ -7,7 +7,7 @@ echo "1..1" name="chown -f root:wheel file" if [ `id -u` -eq 0 ]; then - echo "ok 3 - $name # skip Test must not be uid 0." + echo "ok 1 - $name # skip Test must not be uid 0." else touch file output=$(chown -f root:wheel file 2>&1) From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 07:12:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70979951; Thu, 17 Jul 2014 07:12:13 +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 455D22614; Thu, 17 Jul 2014 07:12:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6H7CD0w096988; Thu, 17 Jul 2014 07:12:13 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6H7CCdw096979; Thu, 17 Jul 2014 07:12:12 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201407170712.s6H7CCdw096979@svn.freebsd.org> From: Eitan Adler Date: Thu, 17 Jul 2014 07:12:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268794 - in head: etc/mtree usr.bin/units usr.bin/units/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 07:12:13 -0000 Author: eadler Date: Thu Jul 17 07:12:12 2014 New Revision: 268794 URL: http://svnweb.freebsd.org/changeset/base/268794 Log: units(1): Add basic tests Add some tests to help avoid breaking units Added: head/usr.bin/units/tests/ head/usr.bin/units/tests/Makefile (contents, props changed) head/usr.bin/units/tests/units_basics.sh (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/usr.bin/units/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Thu Jul 17 06:57:26 2014 (r268793) +++ head/etc/mtree/BSD.tests.dist Thu Jul 17 07:12:12 2014 (r268794) @@ -256,6 +256,8 @@ tr .. truncate + .. + units .. uudecode .. Modified: head/usr.bin/units/Makefile ============================================================================== --- head/usr.bin/units/Makefile Thu Jul 17 06:57:26 2014 (r268793) +++ head/usr.bin/units/Makefile Thu Jul 17 07:12:12 2014 (r268794) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG= units FILES= units.lib FILESDIR= ${SHAREDIR}/misc @@ -7,4 +9,8 @@ FILESDIR= ${SHAREDIR}/misc LDADD+=-ledit -ltermcap DPADD+=${LIBEDIT} ${LIBTERMCAP} +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + .include Added: head/usr.bin/units/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/units/tests/Makefile Thu Jul 17 07:12:12 2014 (r268794) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.include + +TESTSDIR= ${TESTSBASE}/bin/chown + +TAP_TESTS_SH= units_basics + +.include Added: head/usr.bin/units/tests/units_basics.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/units/tests/units_basics.sh Thu Jul 17 07:12:12 2014 (r268794) @@ -0,0 +1,22 @@ +#!/bin/sh +# $FreeBSD$ + +base=`basename $0` + +echo "1..3" + +assert_equals() { + testnum="$1" + expected="$2" + fn="$3" + if [ "$expected" = "$($fn)" ] + then + echo "ok $testnum - $fn" + else + echo "not ok $testnum - $fn" + fi +} + +assert_equals 1 1 "units -t ft ft" +assert_equals 2 12 "units -t ft in" +assert_equals 3 0.083333333 "units -t in ft" From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 11:32:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D2491702; Thu, 17 Jul 2014 11:32:36 +0000 (UTC) Received: from smtp.dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id 3781F2C64; Thu, 17 Jul 2014 11:32:35 +0000 (UTC) Received: from terran (unknown [192.168.99.1]) (Authenticated sender: ray) by smtp.dlink.ua (Postfix) with ESMTPSA id CDF5DC4934; Thu, 17 Jul 2014 14:32:26 +0300 (EEST) Date: Thu, 17 Jul 2014 14:35:35 +0300 From: Aleksandr Rybalko To: Nathan Whitehorn Subject: Re: svn commit: r268771 - in head/sys: dev/fb dev/vt/hw/fb sys Message-Id: <20140717143535.0e337de530fd7d783edd4ad5@ddteam.net> In-Reply-To: <201407161849.s6GInkmG040492@svn.freebsd.org> References: <201407161849.s6GInkmG040492@svn.freebsd.org> X-Mailer: Sylpheed 3.3.1 (GTK+ 2.24.22; amd64-portbld-freebsd9.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 11:32:36 -0000 Hi Nathan! On Wed, 16 Jul 2014 18:49:46 +0000 (UTC) Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Wed Jul 16 18:49:46 2014 > New Revision: 268771 > URL: http://svnweb.freebsd.org/changeset/base/268771 > > Log: > Allow console drivers active from early boot to be used with xf86-video-scfb, > rather than only drivers attached later on. This involves a small amount of > code duplication with dev/fb/fbd.c, which will fixed later on. > > Also improve performance of vt_blank() by making it not read from the > framebuffer unnecessarily. > > Modified: > head/sys/dev/fb/fbd.c > head/sys/dev/vt/hw/fb/vt_fb.c > head/sys/dev/vt/hw/fb/vt_fb.h > head/sys/sys/fbio.h > > Modified: head/sys/dev/fb/fbd.c > ============================================================================== > --- head/sys/dev/fb/fbd.c Wed Jul 16 16:42:58 2014 (r268770) > +++ head/sys/dev/fb/fbd.c Wed Jul 16 18:49:46 2014 (r268771) > @@ -257,9 +257,6 @@ fb_probe(struct fb_info *info) > } else if (info->fb_vbase != 0) { > if (info->fb_pbase == 0) { > info->fb_flags |= FB_FLAG_NOMMAP; > - } else { > - if (info->fb_mmap == NULL) > - info->fb_mmap = &fb_mmap; > } > info->wr1 = &vt_fb_mem_wr1; > info->wr2 = &vt_fb_mem_wr2; > @@ -268,10 +265,6 @@ fb_probe(struct fb_info *info) > } else > return (ENXIO); > > - if (info->fb_ioctl == NULL) > - info->fb_ioctl = &fb_ioctl; > - > - > return (0); > } > > > Modified: head/sys/dev/vt/hw/fb/vt_fb.c > ============================================================================== > --- head/sys/dev/vt/hw/fb/vt_fb.c Wed Jul 16 16:42:58 2014 (r268770) > +++ head/sys/dev/vt/hw/fb/vt_fb.c Wed Jul 16 18:49:46 2014 (r268771) > @@ -41,10 +41,6 @@ __FBSDID("$FreeBSD$"); > #include > #include > > -static int vt_fb_ioctl(struct vt_device *vd, u_long cmd, caddr_t data, > - struct thread *td); > -static int vt_fb_mmap(struct vt_device *vd, vm_ooffset_t offset, > - vm_paddr_t *paddr, int prot, vm_memattr_t *memattr); > void vt_fb_drawrect(struct vt_device *vd, int x1, int y1, int x2, int y2, > int fill, term_color_t color); > void vt_fb_setpixel(struct vt_device *vd, int x, int y, term_color_t color); > @@ -65,20 +61,47 @@ static struct vt_driver vt_fb_driver = { > > VT_DRIVER_DECLARE(vt_fb, vt_fb_driver); > > -static int > +int > vt_fb_ioctl(struct vt_device *vd, u_long cmd, caddr_t data, struct thread *td) > { > struct fb_info *info; > + int error = 0; > > info = vd->vd_softc; > > - if (info->fb_ioctl == NULL) > - return (-1); > + switch (cmd) { > + case FBIOGTYPE: > + bcopy(info, (struct fbtype *)data, sizeof(struct fbtype)); > + break; > + > + case FBIO_GETWINORG: /* get frame buffer window origin */ > + *(u_int *)data = 0; > + break; > + > + case FBIO_GETDISPSTART: /* get display start address */ > + ((video_display_start_t *)data)->x = 0; > + ((video_display_start_t *)data)->y = 0; > + break; > + > + case FBIO_GETLINEWIDTH: /* get scan line width in bytes */ > + *(u_int *)data = info->fb_stride; > + break; > > - return (info->fb_ioctl(info->fb_cdev, cmd, data, 0, td)); > + case FBIO_BLANK: /* blank display */ > + if (vd->vd_driver->vd_blank == NULL) > + return (ENODEV); > + vd->vd_driver->vd_blank(vd, TC_BLACK); > + break; > + > + default: > + error = ENOIOCTL; > + break; > + } > + > + return (error); > } > > -static int > +int > vt_fb_mmap(struct vt_device *vd, vm_ooffset_t offset, vm_paddr_t *paddr, > int prot, vm_memattr_t *memattr) > { > @@ -86,10 +109,18 @@ vt_fb_mmap(struct vt_device *vd, vm_ooff > > info = vd->vd_softc; > > - if (info->fb_ioctl == NULL) > - return (ENXIO); > + if (info->fb_flags & FB_FLAG_NOMMAP) > + return (ENODEV); > > - return (info->fb_mmap(info->fb_cdev, offset, paddr, prot, memattr)); > + if (offset >= 0 && offset < info->fb_size) { > + *paddr = info->fb_pbase + offset; > + #ifdef VM_MEMATTR_WRITE_COMBINING > + *memattr = VM_MEMATTR_WRITE_COMBINING; > + #endif > + return (0); > + } > + > + return (EINVAL); > } > > void > @@ -147,41 +178,42 @@ vt_fb_blank(struct vt_device *vd, term_c > { > struct fb_info *info; > uint32_t c; > - u_int o; > + u_int o, h; > > info = vd->vd_softc; > c = info->fb_cmap[color]; > > switch (FBTYPE_GET_BYTESPP(info)) { > case 1: > - for (o = 0; o < info->fb_stride; o++) > - info->wr1(info, o, c); > + for (h = 0; h < info->fb_stride; h++) > + for (o = 0; o < info->fb_stride; o++) > + info->wr1(info, h*info->fb_stride + o, c); Tell me please, what is it? ^^^^^^ Looks like you mean "for (h = 0; h < info->fb_height; h++)", but anyway you can do one loop up to info->fb_size. > break; > case 2: > - for (o = 0; o < info->fb_stride; o += 2) > - info->wr2(info, o, c); > + for (h = 0; h < info->fb_stride; h++) > + for (o = 0; o < info->fb_stride; o += 2) > + info->wr2(info, h*info->fb_stride + o, c); > break; > case 3: > - /* line 0 */ > - for (o = 0; o < info->fb_stride; o += 3) { > - info->wr1(info, o, (c >> 16) & 0xff); > - info->wr1(info, o + 1, (c >> 8) & 0xff); > - info->wr1(info, o + 2, c & 0xff); > - } > + for (h = 0; h < info->fb_stride; h++) > + for (o = 0; o < info->fb_stride; o += 3) { > + info->wr1(info, h*info->fb_stride + o, > + (c >> 16) & 0xff); > + info->wr1(info, h*info->fb_stride + o + 1, > + (c >> 8) & 0xff); > + info->wr1(info, h*info->fb_stride + o + 2, > + c & 0xff); > + } > break; > case 4: > - for (o = 0; o < info->fb_stride; o += 4) > - info->wr4(info, o, c); > + for (h = 0; h < info->fb_stride; h++) > + for (o = 0; o < info->fb_stride; o += 4) > + info->wr4(info, o, c); > break; > default: > /* panic? */ > return; > } > - /* Copy line0 to all other lines. */ > - /* XXX will copy with borders. */ > - for (o = info->fb_stride; o < info->fb_size; o += info->fb_stride) { > - info->copy(info, o, 0, info->fb_stride); > - } > } > > void > > Modified: head/sys/dev/vt/hw/fb/vt_fb.h > ============================================================================== > --- head/sys/dev/vt/hw/fb/vt_fb.h Wed Jul 16 16:42:58 2014 (r268770) > +++ head/sys/dev/vt/hw/fb/vt_fb.h Wed Jul 16 18:49:46 2014 (r268771) > @@ -43,5 +43,7 @@ vd_blank_t vt_fb_blank; > vd_bitbltchr_t vt_fb_bitbltchr; > vd_maskbitbltchr_t vt_fb_maskbitbltchr; > vd_postswitch_t vt_fb_postswitch; > +vd_fb_ioctl_t vt_fb_ioctl; > +vd_fb_mmap_t vt_fb_mmap; > > #endif /* _DEV_VT_HW_FB_VT_FB_H_ */ > > Modified: head/sys/sys/fbio.h > ============================================================================== > --- head/sys/sys/fbio.h Wed Jul 16 16:42:58 2014 (r268770) > +++ head/sys/sys/fbio.h Wed Jul 16 18:49:46 2014 (r268771) > @@ -141,8 +141,6 @@ struct fb_info { > /* Methods. */ > fb_write_t *fb_write; /* if NULL, direct mem write. */ > fb_read_t *fb_read; /* if NULL, direct mem read. */ > - fb_ioctl_t *fb_ioctl; /* Can be NULL. */ > - fb_mmap_t *fb_mmap; /* Can be NULL. */ > > struct cdev *fb_cdev; > > Thanks! WBW -- Aleksandr Rybalko From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 11:38:37 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EDF808DE; Thu, 17 Jul 2014 11:38:37 +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 DB0962C99; Thu, 17 Jul 2014 11:38:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6HBcbkf024060; Thu, 17 Jul 2014 11:38:37 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6HBcbXK024059; Thu, 17 Jul 2014 11:38:37 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407171138.s6HBcbXK024059@svn.freebsd.org> From: Alexander Motin Date: Thu, 17 Jul 2014 11:38:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268795 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 11:38:38 -0000 Author: mav Date: Thu Jul 17 11:38:37 2014 New Revision: 268795 URL: http://svnweb.freebsd.org/changeset/base/268795 Log: Fix ctld crash on startup if target alias is not set. MFC after: 3 days Modified: head/usr.sbin/ctld/kernel.c Modified: head/usr.sbin/ctld/kernel.c ============================================================================== --- head/usr.sbin/ctld/kernel.c Thu Jul 17 07:12:12 2014 (r268794) +++ head/usr.sbin/ctld/kernel.c Thu Jul 17 11:38:37 2014 (r268795) @@ -851,9 +851,12 @@ kernel_port_add(struct target *targ) req.args[0].value = &port_id; req.args[0].flags = CTL_BEARG_WR; str_arg(&req.args[1], "cfiscsi_target", targ->t_name); - str_arg(&req.args[2], "cfiscsi_target_alias", targ->t_alias); snprintf(tagstr, sizeof(tagstr), "%d", targ->t_portal_group->pg_tag); - str_arg(&req.args[3], "cfiscsi_portal_group_tag", tagstr); + str_arg(&req.args[2], "cfiscsi_portal_group_tag", tagstr); + if (targ->t_alias) + str_arg(&req.args[3], "cfiscsi_target_alias", targ->t_alias); + else + req.num_args--; error = ioctl(ctl_fd, CTL_PORT_REQ, &req); free(req.args); From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 12:47:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 94B9B91; Thu, 17 Jul 2014 12:47:34 +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 8144C22DF; Thu, 17 Jul 2014 12:47:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6HClYMd057935; Thu, 17 Jul 2014 12:47:34 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6HClY2U057934; Thu, 17 Jul 2014 12:47:34 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201407171247.s6HClY2U057934@svn.freebsd.org> From: Nathan Whitehorn Date: Thu, 17 Jul 2014 12:47:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268796 - head/sys/dev/vt/hw/fb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 12:47:34 -0000 Author: nwhitehorn Date: Thu Jul 17 12:47:34 2014 New Revision: 268796 URL: http://svnweb.freebsd.org/changeset/base/268796 Log: Fix embarassing typos I made. Submitted by: rayddteam Modified: head/sys/dev/vt/hw/fb/vt_fb.c Modified: head/sys/dev/vt/hw/fb/vt_fb.c ============================================================================== --- head/sys/dev/vt/hw/fb/vt_fb.c Thu Jul 17 11:38:37 2014 (r268795) +++ head/sys/dev/vt/hw/fb/vt_fb.c Thu Jul 17 12:47:34 2014 (r268796) @@ -185,17 +185,17 @@ vt_fb_blank(struct vt_device *vd, term_c switch (FBTYPE_GET_BYTESPP(info)) { case 1: - for (h = 0; h < info->fb_stride; h++) + for (h = 0; h < info->fb_height; h++) for (o = 0; o < info->fb_stride; o++) info->wr1(info, h*info->fb_stride + o, c); break; case 2: - for (h = 0; h < info->fb_stride; h++) + for (h = 0; h < info->fb_height; h++) for (o = 0; o < info->fb_stride; o += 2) info->wr2(info, h*info->fb_stride + o, c); break; case 3: - for (h = 0; h < info->fb_stride; h++) + for (h = 0; h < info->fb_height; h++) for (o = 0; o < info->fb_stride; o += 3) { info->wr1(info, h*info->fb_stride + o, (c >> 16) & 0xff); @@ -206,9 +206,9 @@ vt_fb_blank(struct vt_device *vd, term_c } break; case 4: - for (h = 0; h < info->fb_stride; h++) + for (h = 0; h < info->fb_height; h++) for (o = 0; o < info->fb_stride; o += 4) - info->wr4(info, o, c); + info->wr4(info, h*info->fb_stride + o, c); break; default: /* panic? */ From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 12:48:56 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F0F4D1F4; Thu, 17 Jul 2014 12:48:56 +0000 (UTC) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (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 D79B422EC; Thu, 17 Jul 2014 12:48:56 +0000 (UTC) Received: from zeppelin.tachypleus.net (173-161-16-229-Illinois.hfc.comcastbusiness.net [173.161.16.229]) (authenticated bits=0) by c.mail.sonic.net (8.14.9/8.14.9) with ESMTP id s6HCmlZ9003146 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Thu, 17 Jul 2014 05:48:50 -0700 Message-ID: <53C7C62F.1090604@freebsd.org> Date: Thu, 17 Jul 2014 05:48:47 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Aleksandr Rybalko Subject: Re: svn commit: r268771 - in head/sys: dev/fb dev/vt/hw/fb sys References: <201407161849.s6GInkmG040492@svn.freebsd.org> <20140717143535.0e337de530fd7d783edd4ad5@ddteam.net> In-Reply-To: <20140717143535.0e337de530fd7d783edd4ad5@ddteam.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-ID: C;qv++sbAN5BGjGE2zUc16mQ== M;ACkrsrAN5BGjGE2zUc16mQ== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 12:48:57 -0000 On 07/17/14 04:35, Aleksandr Rybalko wrote: > Hi Nathan! > > On Wed, 16 Jul 2014 18:49:46 +0000 (UTC) > Nathan Whitehorn wrote: > >> Author: nwhitehorn >> Date: Wed Jul 16 18:49:46 2014 >> New Revision: 268771 >> URL: http://svnweb.freebsd.org/changeset/base/268771 >> >> Log: >> Allow console drivers active from early boot to be used with xf86-video-scfb, >> rather than only drivers attached later on. This involves a small amount of >> code duplication with dev/fb/fbd.c, which will fixed later on. >> >> Also improve performance of vt_blank() by making it not read from the >> framebuffer unnecessarily. >> >> Modified: >> head/sys/dev/fb/fbd.c >> head/sys/dev/vt/hw/fb/vt_fb.c >> head/sys/dev/vt/hw/fb/vt_fb.h >> head/sys/sys/fbio.h >> >> Modified: head/sys/dev/fb/fbd.c >> ============================================================================== >> --- head/sys/dev/fb/fbd.c Wed Jul 16 16:42:58 2014 (r268770) >> +++ head/sys/dev/fb/fbd.c Wed Jul 16 18:49:46 2014 (r268771) >> @@ -257,9 +257,6 @@ fb_probe(struct fb_info *info) >> } else if (info->fb_vbase != 0) { >> if (info->fb_pbase == 0) { >> info->fb_flags |= FB_FLAG_NOMMAP; >> - } else { >> - if (info->fb_mmap == NULL) >> - info->fb_mmap = &fb_mmap; >> } >> info->wr1 = &vt_fb_mem_wr1; >> info->wr2 = &vt_fb_mem_wr2; >> @@ -268,10 +265,6 @@ fb_probe(struct fb_info *info) >> } else >> return (ENXIO); >> >> - if (info->fb_ioctl == NULL) >> - info->fb_ioctl = &fb_ioctl; >> - >> - >> return (0); >> } >> >> >> Modified: head/sys/dev/vt/hw/fb/vt_fb.c >> ============================================================================== >> --- head/sys/dev/vt/hw/fb/vt_fb.c Wed Jul 16 16:42:58 2014 (r268770) >> +++ head/sys/dev/vt/hw/fb/vt_fb.c Wed Jul 16 18:49:46 2014 (r268771) >> @@ -41,10 +41,6 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> >> -static int vt_fb_ioctl(struct vt_device *vd, u_long cmd, caddr_t data, >> - struct thread *td); >> -static int vt_fb_mmap(struct vt_device *vd, vm_ooffset_t offset, >> - vm_paddr_t *paddr, int prot, vm_memattr_t *memattr); >> void vt_fb_drawrect(struct vt_device *vd, int x1, int y1, int x2, int y2, >> int fill, term_color_t color); >> void vt_fb_setpixel(struct vt_device *vd, int x, int y, term_color_t color); >> @@ -65,20 +61,47 @@ static struct vt_driver vt_fb_driver = { >> >> VT_DRIVER_DECLARE(vt_fb, vt_fb_driver); >> >> -static int >> +int >> vt_fb_ioctl(struct vt_device *vd, u_long cmd, caddr_t data, struct thread *td) >> { >> struct fb_info *info; >> + int error = 0; >> >> info = vd->vd_softc; >> >> - if (info->fb_ioctl == NULL) >> - return (-1); >> + switch (cmd) { >> + case FBIOGTYPE: >> + bcopy(info, (struct fbtype *)data, sizeof(struct fbtype)); >> + break; >> + >> + case FBIO_GETWINORG: /* get frame buffer window origin */ >> + *(u_int *)data = 0; >> + break; >> + >> + case FBIO_GETDISPSTART: /* get display start address */ >> + ((video_display_start_t *)data)->x = 0; >> + ((video_display_start_t *)data)->y = 0; >> + break; >> + >> + case FBIO_GETLINEWIDTH: /* get scan line width in bytes */ >> + *(u_int *)data = info->fb_stride; >> + break; >> >> - return (info->fb_ioctl(info->fb_cdev, cmd, data, 0, td)); >> + case FBIO_BLANK: /* blank display */ >> + if (vd->vd_driver->vd_blank == NULL) >> + return (ENODEV); >> + vd->vd_driver->vd_blank(vd, TC_BLACK); >> + break; >> + >> + default: >> + error = ENOIOCTL; >> + break; >> + } >> + >> + return (error); >> } >> >> -static int >> +int >> vt_fb_mmap(struct vt_device *vd, vm_ooffset_t offset, vm_paddr_t *paddr, >> int prot, vm_memattr_t *memattr) >> { >> @@ -86,10 +109,18 @@ vt_fb_mmap(struct vt_device *vd, vm_ooff >> >> info = vd->vd_softc; >> >> - if (info->fb_ioctl == NULL) >> - return (ENXIO); >> + if (info->fb_flags & FB_FLAG_NOMMAP) >> + return (ENODEV); >> >> - return (info->fb_mmap(info->fb_cdev, offset, paddr, prot, memattr)); >> + if (offset >= 0 && offset < info->fb_size) { >> + *paddr = info->fb_pbase + offset; >> + #ifdef VM_MEMATTR_WRITE_COMBINING >> + *memattr = VM_MEMATTR_WRITE_COMBINING; >> + #endif >> + return (0); >> + } >> + >> + return (EINVAL); >> } >> >> void >> @@ -147,41 +178,42 @@ vt_fb_blank(struct vt_device *vd, term_c >> { >> struct fb_info *info; >> uint32_t c; >> - u_int o; >> + u_int o, h; >> >> info = vd->vd_softc; >> c = info->fb_cmap[color]; >> >> switch (FBTYPE_GET_BYTESPP(info)) { >> case 1: >> - for (o = 0; o < info->fb_stride; o++) >> - info->wr1(info, o, c); >> + for (h = 0; h < info->fb_stride; h++) >> + for (o = 0; o < info->fb_stride; o++) >> + info->wr1(info, h*info->fb_stride + o, c); > Tell me please, what is it? ^^^^^^ > Looks like you mean "for (h = 0; h < info->fb_height; h++)", but anyway > you can do one loop up to info->fb_size. Wow. That's embarrassing. I just fixed it. Thanks! I didn't do fb_size in case the framebuffer were discontiguous. Maybe the caution is unnecessary, though. -Nathan >> break; >> case 2: >> - for (o = 0; o < info->fb_stride; o += 2) >> - info->wr2(info, o, c); >> + for (h = 0; h < info->fb_stride; h++) >> + for (o = 0; o < info->fb_stride; o += 2) >> + info->wr2(info, h*info->fb_stride + o, c); >> break; >> case 3: >> - /* line 0 */ >> - for (o = 0; o < info->fb_stride; o += 3) { >> - info->wr1(info, o, (c >> 16) & 0xff); >> - info->wr1(info, o + 1, (c >> 8) & 0xff); >> - info->wr1(info, o + 2, c & 0xff); >> - } >> + for (h = 0; h < info->fb_stride; h++) >> + for (o = 0; o < info->fb_stride; o += 3) { >> + info->wr1(info, h*info->fb_stride + o, >> + (c >> 16) & 0xff); >> + info->wr1(info, h*info->fb_stride + o + 1, >> + (c >> 8) & 0xff); >> + info->wr1(info, h*info->fb_stride + o + 2, >> + c & 0xff); >> + } >> break; >> case 4: >> - for (o = 0; o < info->fb_stride; o += 4) >> - info->wr4(info, o, c); >> + for (h = 0; h < info->fb_stride; h++) >> + for (o = 0; o < info->fb_stride; o += 4) >> + info->wr4(info, o, c); >> break; >> default: >> /* panic? */ >> return; >> } >> - /* Copy line0 to all other lines. */ >> - /* XXX will copy with borders. */ >> - for (o = info->fb_stride; o < info->fb_size; o += info->fb_stride) { >> - info->copy(info, o, 0, info->fb_stride); >> - } >> } >> >> void >> >> Modified: head/sys/dev/vt/hw/fb/vt_fb.h >> ============================================================================== >> --- head/sys/dev/vt/hw/fb/vt_fb.h Wed Jul 16 16:42:58 2014 (r268770) >> +++ head/sys/dev/vt/hw/fb/vt_fb.h Wed Jul 16 18:49:46 2014 (r268771) >> @@ -43,5 +43,7 @@ vd_blank_t vt_fb_blank; >> vd_bitbltchr_t vt_fb_bitbltchr; >> vd_maskbitbltchr_t vt_fb_maskbitbltchr; >> vd_postswitch_t vt_fb_postswitch; >> +vd_fb_ioctl_t vt_fb_ioctl; >> +vd_fb_mmap_t vt_fb_mmap; >> >> #endif /* _DEV_VT_HW_FB_VT_FB_H_ */ >> >> Modified: head/sys/sys/fbio.h >> ============================================================================== >> --- head/sys/sys/fbio.h Wed Jul 16 16:42:58 2014 (r268770) >> +++ head/sys/sys/fbio.h Wed Jul 16 18:49:46 2014 (r268771) >> @@ -141,8 +141,6 @@ struct fb_info { >> /* Methods. */ >> fb_write_t *fb_write; /* if NULL, direct mem write. */ >> fb_read_t *fb_read; /* if NULL, direct mem read. */ >> - fb_ioctl_t *fb_ioctl; /* Can be NULL. */ >> - fb_mmap_t *fb_mmap; /* Can be NULL. */ >> >> struct cdev *fb_cdev; >> >> > Thanks! > > WBW From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 13:42:20 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 242C6A0; Thu, 17 Jul 2014 13:42:20 +0000 (UTC) Received: from smtp.dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id 5FECF2872; Thu, 17 Jul 2014 13:42:19 +0000 (UTC) Received: from terran (unknown [192.168.99.1]) (Authenticated sender: ray) by smtp.dlink.ua (Postfix) with ESMTPA id B1521C492D; Thu, 17 Jul 2014 16:42:17 +0300 (EEST) Date: Thu, 17 Jul 2014 16:45:26 +0300 From: Aleksandr Rybalko To: Nathan Whitehorn Subject: Re: svn commit: r268771 - in head/sys: dev/fb dev/vt/hw/fb sys Message-Id: <20140717164526.b8e749e6cdd8593c0e497d5a@freebsd.org> In-Reply-To: <53C7C62F.1090604@freebsd.org> References: <201407161849.s6GInkmG040492@svn.freebsd.org> <20140717143535.0e337de530fd7d783edd4ad5@ddteam.net> <53C7C62F.1090604@freebsd.org> X-Mailer: Sylpheed 3.3.1 (GTK+ 2.24.22; amd64-portbld-freebsd9.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 13:42:20 -0000 On Thu, 17 Jul 2014 05:48:47 -0700 Nathan Whitehorn wrote: > > On 07/17/14 04:35, Aleksandr Rybalko wrote: > > Hi Nathan! > > > > On Wed, 16 Jul 2014 18:49:46 +0000 (UTC) > > Nathan Whitehorn wrote: > > > >> Author: nwhitehorn > >> Date: Wed Jul 16 18:49:46 2014 > >> New Revision: 268771 > >> URL: http://svnweb.freebsd.org/changeset/base/268771 > >> > >> Log: > >> Allow console drivers active from early boot to be used with xf86-video-scfb, > >> rather than only drivers attached later on. This involves a small amount of > >> code duplication with dev/fb/fbd.c, which will fixed later on. > >> > >> Also improve performance of vt_blank() by making it not read from the > >> framebuffer unnecessarily. > >> > >> Modified: > >> head/sys/dev/fb/fbd.c > >> head/sys/dev/vt/hw/fb/vt_fb.c > >> head/sys/dev/vt/hw/fb/vt_fb.h > >> head/sys/sys/fbio.h > >> > >> Modified: head/sys/dev/fb/fbd.c > >> ============================================================================== > >> --- head/sys/dev/fb/fbd.c Wed Jul 16 16:42:58 2014 (r268770) > >> +++ head/sys/dev/fb/fbd.c Wed Jul 16 18:49:46 2014 (r268771) > >> @@ -257,9 +257,6 @@ fb_probe(struct fb_info *info) > >> } else if (info->fb_vbase != 0) { > >> if (info->fb_pbase == 0) { > >> info->fb_flags |= FB_FLAG_NOMMAP; > >> - } else { > >> - if (info->fb_mmap == NULL) > >> - info->fb_mmap = &fb_mmap; > >> } > >> info->wr1 = &vt_fb_mem_wr1; > >> info->wr2 = &vt_fb_mem_wr2; > >> @@ -268,10 +265,6 @@ fb_probe(struct fb_info *info) > >> } else > >> return (ENXIO); > >> > >> - if (info->fb_ioctl == NULL) > >> - info->fb_ioctl = &fb_ioctl; > >> - > >> - > >> return (0); > >> } > >> > >> > >> Modified: head/sys/dev/vt/hw/fb/vt_fb.c > >> ============================================================================== > >> --- head/sys/dev/vt/hw/fb/vt_fb.c Wed Jul 16 16:42:58 2014 (r268770) > >> +++ head/sys/dev/vt/hw/fb/vt_fb.c Wed Jul 16 18:49:46 2014 (r268771) > >> @@ -41,10 +41,6 @@ __FBSDID("$FreeBSD$"); > >> #include > >> #include > >> > >> -static int vt_fb_ioctl(struct vt_device *vd, u_long cmd, caddr_t data, > >> - struct thread *td); > >> -static int vt_fb_mmap(struct vt_device *vd, vm_ooffset_t offset, > >> - vm_paddr_t *paddr, int prot, vm_memattr_t *memattr); > >> void vt_fb_drawrect(struct vt_device *vd, int x1, int y1, int x2, int y2, > >> int fill, term_color_t color); > >> void vt_fb_setpixel(struct vt_device *vd, int x, int y, term_color_t color); > >> @@ -65,20 +61,47 @@ static struct vt_driver vt_fb_driver = { > >> > >> VT_DRIVER_DECLARE(vt_fb, vt_fb_driver); > >> > >> -static int > >> +int > >> vt_fb_ioctl(struct vt_device *vd, u_long cmd, caddr_t data, struct thread *td) > >> { > >> struct fb_info *info; > >> + int error = 0; > >> > >> info = vd->vd_softc; > >> > >> - if (info->fb_ioctl == NULL) > >> - return (-1); > >> + switch (cmd) { > >> + case FBIOGTYPE: > >> + bcopy(info, (struct fbtype *)data, sizeof(struct fbtype)); > >> + break; > >> + > >> + case FBIO_GETWINORG: /* get frame buffer window origin */ > >> + *(u_int *)data = 0; > >> + break; > >> + > >> + case FBIO_GETDISPSTART: /* get display start address */ > >> + ((video_display_start_t *)data)->x = 0; > >> + ((video_display_start_t *)data)->y = 0; > >> + break; > >> + > >> + case FBIO_GETLINEWIDTH: /* get scan line width in bytes */ > >> + *(u_int *)data = info->fb_stride; > >> + break; > >> > >> - return (info->fb_ioctl(info->fb_cdev, cmd, data, 0, td)); > >> + case FBIO_BLANK: /* blank display */ > >> + if (vd->vd_driver->vd_blank == NULL) > >> + return (ENODEV); > >> + vd->vd_driver->vd_blank(vd, TC_BLACK); > >> + break; > >> + > >> + default: > >> + error = ENOIOCTL; > >> + break; > >> + } > >> + > >> + return (error); > >> } > >> > >> -static int > >> +int > >> vt_fb_mmap(struct vt_device *vd, vm_ooffset_t offset, vm_paddr_t *paddr, > >> int prot, vm_memattr_t *memattr) > >> { > >> @@ -86,10 +109,18 @@ vt_fb_mmap(struct vt_device *vd, vm_ooff > >> > >> info = vd->vd_softc; > >> > >> - if (info->fb_ioctl == NULL) > >> - return (ENXIO); > >> + if (info->fb_flags & FB_FLAG_NOMMAP) > >> + return (ENODEV); > >> > >> - return (info->fb_mmap(info->fb_cdev, offset, paddr, prot, memattr)); > >> + if (offset >= 0 && offset < info->fb_size) { > >> + *paddr = info->fb_pbase + offset; > >> + #ifdef VM_MEMATTR_WRITE_COMBINING > >> + *memattr = VM_MEMATTR_WRITE_COMBINING; > >> + #endif > >> + return (0); > >> + } > >> + > >> + return (EINVAL); > >> } > >> > >> void > >> @@ -147,41 +178,42 @@ vt_fb_blank(struct vt_device *vd, term_c > >> { > >> struct fb_info *info; > >> uint32_t c; > >> - u_int o; > >> + u_int o, h; > >> > >> info = vd->vd_softc; > >> c = info->fb_cmap[color]; > >> > >> switch (FBTYPE_GET_BYTESPP(info)) { > >> case 1: > >> - for (o = 0; o < info->fb_stride; o++) > >> - info->wr1(info, o, c); > >> + for (h = 0; h < info->fb_stride; h++) > >> + for (o = 0; o < info->fb_stride; o++) > >> + info->wr1(info, h*info->fb_stride + o, c); > > Tell me please, what is it? ^^^^^^ > > Looks like you mean "for (h = 0; h < info->fb_height; h++)", but anyway > > you can do one loop up to info->fb_size. > > Wow. That's embarrassing. I just fixed it. Thanks! I didn't do fb_size > in case the framebuffer were discontiguous. Maybe the caution is > unnecessary, though. > -Nathan You doing info->wr1(), so this method should care about access model. Anyway, thanks for doing that. Looks like I did overdesigned it with way for replacing every method. Just one thought to discussion (maybe): Is not it will be better to make default implementation of mmap/munmap methods and assign it if driver do not supply own? > > >> break; > >> case 2: > >> - for (o = 0; o < info->fb_stride; o += 2) > >> - info->wr2(info, o, c); > >> + for (h = 0; h < info->fb_stride; h++) > >> + for (o = 0; o < info->fb_stride; o += 2) > >> + info->wr2(info, h*info->fb_stride + o, c); > >> break; > >> case 3: > >> - /* line 0 */ > >> - for (o = 0; o < info->fb_stride; o += 3) { > >> - info->wr1(info, o, (c >> 16) & 0xff); > >> - info->wr1(info, o + 1, (c >> 8) & 0xff); > >> - info->wr1(info, o + 2, c & 0xff); > >> - } > >> + for (h = 0; h < info->fb_stride; h++) > >> + for (o = 0; o < info->fb_stride; o += 3) { > >> + info->wr1(info, h*info->fb_stride + o, > >> + (c >> 16) & 0xff); > >> + info->wr1(info, h*info->fb_stride + o + 1, > >> + (c >> 8) & 0xff); > >> + info->wr1(info, h*info->fb_stride + o + 2, > >> + c & 0xff); > >> + } > >> break; > >> case 4: > >> - for (o = 0; o < info->fb_stride; o += 4) > >> - info->wr4(info, o, c); > >> + for (h = 0; h < info->fb_stride; h++) > >> + for (o = 0; o < info->fb_stride; o += 4) > >> + info->wr4(info, o, c); > >> break; > >> default: > >> /* panic? */ > >> return; > >> } > >> - /* Copy line0 to all other lines. */ > >> - /* XXX will copy with borders. */ > >> - for (o = info->fb_stride; o < info->fb_size; o += info->fb_stride) { > >> - info->copy(info, o, 0, info->fb_stride); > >> - } > >> } > >> > >> void > >> > >> Modified: head/sys/dev/vt/hw/fb/vt_fb.h > >> ============================================================================== > >> --- head/sys/dev/vt/hw/fb/vt_fb.h Wed Jul 16 16:42:58 2014 (r268770) > >> +++ head/sys/dev/vt/hw/fb/vt_fb.h Wed Jul 16 18:49:46 2014 (r268771) > >> @@ -43,5 +43,7 @@ vd_blank_t vt_fb_blank; > >> vd_bitbltchr_t vt_fb_bitbltchr; > >> vd_maskbitbltchr_t vt_fb_maskbitbltchr; > >> vd_postswitch_t vt_fb_postswitch; > >> +vd_fb_ioctl_t vt_fb_ioctl; > >> +vd_fb_mmap_t vt_fb_mmap; > >> > >> #endif /* _DEV_VT_HW_FB_VT_FB_H_ */ > >> > >> Modified: head/sys/sys/fbio.h > >> ============================================================================== > >> --- head/sys/sys/fbio.h Wed Jul 16 16:42:58 2014 (r268770) > >> +++ head/sys/sys/fbio.h Wed Jul 16 18:49:46 2014 (r268771) > >> @@ -141,8 +141,6 @@ struct fb_info { > >> /* Methods. */ > >> fb_write_t *fb_write; /* if NULL, direct mem write. */ > >> fb_read_t *fb_read; /* if NULL, direct mem read. */ > >> - fb_ioctl_t *fb_ioctl; /* Can be NULL. */ > >> - fb_mmap_t *fb_mmap; /* Can be NULL. */ > >> > >> struct cdev *fb_cdev; > >> > >> > > Thanks! > > > > WBW > WBW -- Aleksandr Rybalko From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 14:16:18 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C54FA9F7; Thu, 17 Jul 2014 14:16:18 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A60D2BB8; Thu, 17 Jul 2014 14:16:17 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id s6HEG9LA068006 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 17 Jul 2014 18:16:09 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s6HEG9iX068005; Thu, 17 Jul 2014 18:16:09 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 17 Jul 2014 18:16:09 +0400 From: Gleb Smirnoff To: Neel Natu Subject: Re: svn commit: r268777 - in head: sys/amd64/include sys/amd64/vmm/intel usr.sbin/bhyve Message-ID: <20140717141609.GH87212@FreeBSD.org> References: <201407162126.s6GLQQ0u018990@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201407162126.s6GLQQ0u018990@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 14:16:18 -0000 On Wed, Jul 16, 2014 at 09:26:26PM +0000, Neel Natu wrote: N> Author: neel N> Date: Wed Jul 16 21:26:26 2014 N> New Revision: 268777 N> URL: http://svnweb.freebsd.org/changeset/base/268777 N> N> Log: N> Add emulation for legacy x86 task switching mechanism. N> N> FreeBSD/i386 uses task switching to handle double fault exceptions and this N> change enables that to work. N> N> Reported by: glebius Thanks a lot! -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 14:19:37 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3E775B5F; Thu, 17 Jul 2014 14:19:37 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B6AF82BD5; Thu, 17 Jul 2014 14:19:36 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id s6HEJYRi068029 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 17 Jul 2014 18:19:34 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s6HEJYVn068028; Thu, 17 Jul 2014 18:19:34 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 17 Jul 2014 18:19:34 +0400 From: Gleb Smirnoff To: Kevin Lo Subject: Re: svn commit: r268787 - in head/sys: kern net Message-ID: <20140717141934.GI87212@FreeBSD.org> References: <201407170521.s6H5LGbx042649@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201407170521.s6H5LGbx042649@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 14:19:37 -0000 On Thu, Jul 17, 2014 at 05:21:16AM +0000, Kevin Lo wrote: K> Author: kevlo K> Date: Thu Jul 17 05:21:16 2014 K> New Revision: 268787 K> URL: http://svnweb.freebsd.org/changeset/base/268787 K> K> Log: K> Deprecate m_act. Use m_nextpkt always. Thanks. IMHO, the define should go away from mbuf.h as well. -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 14:51:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E886847A; Thu, 17 Jul 2014 14:51:50 +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 D6ABF2F0F; Thu, 17 Jul 2014 14:51:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6HEpo3J018503; Thu, 17 Jul 2014 14:51:50 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6HEpoAB018502; Thu, 17 Jul 2014 14:51:50 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407171451.s6HEpoAB018502@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 17 Jul 2014 14:51:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268798 - head/usr.bin/grep X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 14:51:51 -0000 Author: pfg Date: Thu Jul 17 14:51:50 2014 New Revision: 268798 URL: http://svnweb.freebsd.org/changeset/base/268798 Log: grep: Fix type. Obtained from: NetBSD (CVS rev. 1.17) MFC after: 3 days Modified: head/usr.bin/grep/util.c Modified: head/usr.bin/grep/util.c ============================================================================== --- head/usr.bin/grep/util.c Thu Jul 17 13:39:18 2014 (r268797) +++ head/usr.bin/grep/util.c Thu Jul 17 14:51:50 2014 (r268798) @@ -302,7 +302,7 @@ procline(struct str *l, int nottext) r = REG_NOMATCH; /* Check for whole word match */ if (r == 0 && (wflag || fg_pattern[i].word)) { - wint_t wbegin, wend; + wchar_t wbegin, wend; wbegin = wend = L' '; if (pmatch.rm_so != 0 && From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 15:04:45 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1620CD66 for ; Thu, 17 Jul 2014 15:04:45 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (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 F0F43204C for ; Thu, 17 Jul 2014 15:04:44 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id s6HF4iwm010113 for ; Thu, 17 Jul 2014 15:04:44 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id s6HF4imI010111 for svn-src-all@freebsd.org; Thu, 17 Jul 2014 15:04:44 GMT (envelope-from bdrewery) Received: (qmail 87971 invoked from network); 17 Jul 2014 10:04:42 -0500 Received: from unknown (HELO blah) (freebsd@shatow.net@67.182.131.225) by sweb.xzibition.com with ESMTPA; 17 Jul 2014 10:04:42 -0500 Message-ID: <53C7E608.1030002@FreeBSD.org> Date: Thu, 17 Jul 2014 10:04:40 -0500 From: Bryan Drewery Organization: FreeBSD User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r268794 - in head: etc/mtree usr.bin/units usr.bin/units/tests References: <201407170712.s6H7CCdw096979@svn.freebsd.org> In-Reply-To: <201407170712.s6H7CCdw096979@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 15:04:45 -0000 On 7/17/14, 2:12 AM, Eitan Adler wrote: > Modified: head/etc/mtree/BSD.tests.dist > ============================================================================== > --- head/etc/mtree/BSD.tests.dist Thu Jul 17 06:57:26 2014 (r268793) > +++ head/etc/mtree/BSD.tests.dist Thu Jul 17 07:12:12 2014 (r268794) > @@ -256,6 +256,8 @@ > tr > .. > truncate > + .. > + units > .. > uudecode > .. These should be spaces as the rest of the file is. -- Regards, Bryan Drewery From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 15:48:12 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B7900A2B; Thu, 17 Jul 2014 15:48:12 +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 8B9B82408; Thu, 17 Jul 2014 15:48:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6HFmC4a045272; Thu, 17 Jul 2014 15:48:12 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6HFmCk5045268; Thu, 17 Jul 2014 15:48:12 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407171548.s6HFmCk5045268@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 17 Jul 2014 15:48:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268799 - head/usr.bin/grep X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 15:48:12 -0000 Author: pfg Date: Thu Jul 17 15:48:11 2014 New Revision: 268799 URL: http://svnweb.freebsd.org/changeset/base/268799 Log: grep: fix some memory leaks. Bring a couple of changes from NetBSD: queue.c (CVS Rev. 1.4. 1.5) Fix memory leaks. NULL does not need a cast. grep.c (CVS Rev. 1.6) Use the more portable getline. Obtained from: NetBSD MFC after: 3 days Modified: head/usr.bin/grep/grep.c head/usr.bin/grep/queue.c Modified: head/usr.bin/grep/grep.c ============================================================================== --- head/usr.bin/grep/grep.c Thu Jul 17 14:51:50 2014 (r268798) +++ head/usr.bin/grep/grep.c Thu Jul 17 15:48:11 2014 (r268799) @@ -1,4 +1,4 @@ -/* $NetBSD: grep.c,v 1.4 2011/02/16 01:31:33 joerg Exp $ */ +/* $NetBSD: grep.c,v 1.6 2011/04/18 03:48:23 joerg Exp $ */ /* $FreeBSD$ */ /* $OpenBSD: grep.c,v 1.42 2010/07/02 22:18:03 tedu Exp $ */ @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#define _WITH_GETLINE #include #include #include @@ -304,6 +305,7 @@ read_patterns(const char *fn) FILE *f; char *line; size_t len; + ssize_t rlen; if ((f = fopen(fn, "r")) == NULL) err(2, "%s", fn); @@ -311,8 +313,11 @@ read_patterns(const char *fn) fclose(f); return; } - while ((line = fgetln(f, &len)) != NULL) + len = 0; + line = NULL; + while ((rlen = getline(&line, &len, f)) != -1) add_pattern(line, line[0] == '\n' ? 0 : len); + free(line); if (ferror(f)) err(2, "%s", fn); fclose(f); Modified: head/usr.bin/grep/queue.c ============================================================================== --- head/usr.bin/grep/queue.c Thu Jul 17 14:51:50 2014 (r268798) +++ head/usr.bin/grep/queue.c Thu Jul 17 15:48:11 2014 (r268799) @@ -1,4 +1,4 @@ -/* $NetBSD: queue.c,v 1.2 2011/02/16 01:31:33 joerg Exp $ */ +/* $NetBSD: queue.c,v 1.5 2011/08/31 16:24:57 plunky Exp $ */ /* $FreeBSD$ */ /*- @@ -68,8 +68,11 @@ enqueue(struct str *x) STAILQ_INSERT_TAIL(&queue, item, list); - if (++count > Bflag) - free(dequeue()); + if (++count > Bflag) { + item = dequeue(); + free(item->data.dat); + free(item); + } } static struct qentry * @@ -92,7 +95,7 @@ printqueue(void) struct qentry *item; while ((item = dequeue()) != NULL) { - printline(&item->data, '-', (regmatch_t *)NULL, 0); + printline(&item->data, '-', NULL, 0); free(item); } } @@ -102,6 +105,8 @@ clearqueue(void) { struct qentry *item; - while ((item = dequeue()) != NULL) + while ((item = dequeue()) != NULL) { + free(item->data.dat); free(item); + } } From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 15:50:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 07DA2BA9; Thu, 17 Jul 2014 15:50: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 E9EA82423; Thu, 17 Jul 2014 15:50:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6HFoNSj045665; Thu, 17 Jul 2014 15:50:23 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6HFoNXk045664; Thu, 17 Jul 2014 15:50:23 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201407171550.s6HFoNXk045664@svn.freebsd.org> From: Bryan Drewery Date: Thu, 17 Jul 2014 15:50:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268800 - head/etc/mtree X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 15:50:24 -0000 Author: bdrewery Date: Thu Jul 17 15:50:23 2014 New Revision: 268800 URL: http://svnweb.freebsd.org/changeset/base/268800 Log: Fix indentation Modified: head/etc/mtree/BSD.tests.dist Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Thu Jul 17 15:48:11 2014 (r268799) +++ head/etc/mtree/BSD.tests.dist Thu Jul 17 15:50:23 2014 (r268800) @@ -256,8 +256,8 @@ tr .. truncate - .. - units + .. + units .. uudecode .. From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 15:59:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 02246DA3; Thu, 17 Jul 2014 15:59: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 E435524F0; Thu, 17 Jul 2014 15:59:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6HFxDcs050061; Thu, 17 Jul 2014 15:59:13 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6HFxDLB050060; Thu, 17 Jul 2014 15:59:13 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407171559.s6HFxDLB050060@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 17 Jul 2014 15:59:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268801 - head/usr.bin/grep X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 15:59:14 -0000 Author: pfg Date: Thu Jul 17 15:59:13 2014 New Revision: 268801 URL: http://svnweb.freebsd.org/changeset/base/268801 Log: grep: fix some memory leaks. Add memory leak fix missing from r268799. Obtained from: NetBSD Modified: head/usr.bin/grep/queue.c Modified: head/usr.bin/grep/queue.c ============================================================================== --- head/usr.bin/grep/queue.c Thu Jul 17 15:50:23 2014 (r268800) +++ head/usr.bin/grep/queue.c Thu Jul 17 15:59:13 2014 (r268801) @@ -96,6 +96,7 @@ printqueue(void) while ((item = dequeue()) != NULL) { printline(&item->data, '-', NULL, 0); + free(item->data.dat); free(item); } } From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 16:33:39 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 74E5E6B1; Thu, 17 Jul 2014 16:33:39 +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 5707828CC; Thu, 17 Jul 2014 16:33:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6HGXdPV068621; Thu, 17 Jul 2014 16:33:39 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6HGXdlY068620; Thu, 17 Jul 2014 16:33:39 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201407171633.s6HGXdlY068620@svn.freebsd.org> From: Marcel Moolenaar Date: Thu, 17 Jul 2014 16:33:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268802 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 16:33:39 -0000 Author: marcel Date: Thu Jul 17 16:33:38 2014 New Revision: 268802 URL: http://svnweb.freebsd.org/changeset/base/268802 Log: Add support for the fixed image type. The fixed image is effectively a raw image with a VHD footer appended. There's little value that I can see to use the fixed image type, but in order to make VHD images for use by Microsoft's Azure platform, they must be fixed VHD images. Support has been added by refactoring the code to re-use common code and by adding a second output format structure. To created fixed VHD images, specify "vhdf" as the output format. Modified: head/usr.bin/mkimg/vhd.c Modified: head/usr.bin/mkimg/vhd.c ============================================================================== --- head/usr.bin/mkimg/vhd.c Thu Jul 17 15:59:13 2014 (r268801) +++ head/usr.bin/mkimg/vhd.c Thu Jul 17 16:33:38 2014 (r268802) @@ -41,15 +41,18 @@ __FBSDID("$FreeBSD$"); #include "mkimg.h" /* - * Notes: + * General notes: * o File is in network byte order. - * o File layout: - * copy of disk footer - * dynamic disk header - * block allocation table (BAT) - * data blocks - * disk footer * o The timestamp is seconds since 1/1/2000 12:00:00 AM UTC + * + * This file is divided in 3 parts: + * 1. Common definitions + * 2. Dynamic VHD support + * 3. Fixed VHD support + */ + +/* + * PART 1: Common definitions */ #define VHD_SECTOR_SIZE 512 @@ -88,41 +91,6 @@ struct vhd_footer { _Static_assert(sizeof(struct vhd_footer) == VHD_SECTOR_SIZE, "Wrong size for footer"); -struct vhd_dyn_header { - uint64_t cookie; -#define VHD_HEADER_COOKIE 0x6378737061727365 - uint64_t data_offset; - uint64_t table_offset; - uint32_t version; - uint32_t max_entries; - uint32_t block_size; - uint32_t checksum; - uuid_t parent_id; - uint32_t parent_timestamp; - char _reserved1[4]; - uint16_t parent_name[256]; /* UTF-16 */ - struct { - uint32_t code; - uint32_t data_space; - uint32_t data_length; - uint32_t _reserved; - uint64_t data_offset; - } parent_locator[8]; - char _reserved2[256]; -}; -_Static_assert(sizeof(struct vhd_dyn_header) == VHD_SECTOR_SIZE * 2, - "Wrong size for header"); - -static int -vhd_resize(lba_t imgsz) -{ - uint64_t imagesz; - - imagesz = imgsz * secsz; - imagesz = (imagesz + VHD_BLOCK_SIZE - 1) & ~(VHD_BLOCK_SIZE - 1); - return (image_set_size(imagesz / secsz)); -} - static uint32_t vhd_checksum(void *buf, size_t sz) { @@ -136,36 +104,8 @@ vhd_checksum(void *buf, size_t sz) return (~sum); } -static uint32_t -vhd_timestamp(void) -{ - time_t t; - - if (!unit_testing) { - t = time(NULL); - return (t - 0x386d4380); - } - - return (0x01234567); -} - static void -vhd_uuid_enc(void *buf, const uuid_t *uuid) -{ - uint8_t *p = buf; - int i; - - be32enc(p, uuid->time_low); - be16enc(p + 4, uuid->time_mid); - be16enc(p + 6, uuid->time_hi_and_version); - p[8] = uuid->clock_seq_hi_and_reserved; - p[9] = uuid->clock_seq_low; - for (i = 0; i < _UUID_NODE_LEN; i++) - p[10 + i] = uuid->node[i]; -} - -static void -vhd_geometry(struct vhd_footer *footer) +vhd_geometry(struct vhd_footer *footer, uint64_t image_size) { lba_t imgsz; long cth; @@ -180,7 +120,7 @@ vhd_geometry(struct vhd_footer *footer) return; } - imgsz = (image_get_size() * secsz) / VHD_SECTOR_SIZE; + imgsz = image_size / VHD_SECTOR_SIZE; if (imgsz > 65536 * 16 * 255) imgsz = 65536 * 16 * 255; if (imgsz >= 65535 * 16 * 63) { @@ -207,12 +147,117 @@ vhd_geometry(struct vhd_footer *footer) be16enc(&footer->cylinders, cth / footer->heads); } +static uint32_t +vhd_timestamp(void) +{ + time_t t; + + if (!unit_testing) { + t = time(NULL); + return (t - 0x386d4380); + } + + return (0x01234567); +} + +static void +vhd_uuid_enc(void *buf, const uuid_t *uuid) +{ + uint8_t *p = buf; + int i; + + be32enc(p, uuid->time_low); + be16enc(p + 4, uuid->time_mid); + be16enc(p + 6, uuid->time_hi_and_version); + p[8] = uuid->clock_seq_hi_and_reserved; + p[9] = uuid->clock_seq_low; + for (i = 0; i < _UUID_NODE_LEN; i++) + p[10 + i] = uuid->node[i]; +} + +static void +vhd_make_footer(struct vhd_footer *footer, uint64_t image_size, + uint32_t disk_type, uint64_t data_offset) +{ + uuid_t id; + + memset(footer, 0, sizeof(*footer)); + be64enc(&footer->cookie, VHD_FOOTER_COOKIE); + be32enc(&footer->features, VHD_FEATURES_RESERVED); + be32enc(&footer->version, VHD_VERSION); + be64enc(&footer->data_offset, data_offset); + be32enc(&footer->timestamp, vhd_timestamp()); + be32enc(&footer->creator_tool, VHD_CREATOR_TOOL); + be32enc(&footer->creator_version, VHD_CREATOR_VERSION); + be32enc(&footer->creator_os, VHD_CREATOR_OS); + be64enc(&footer->original_size, image_size); + be64enc(&footer->current_size, image_size); + vhd_geometry(footer, image_size); + be32enc(&footer->disk_type, disk_type); + mkimg_uuid(&id); + vhd_uuid_enc(&footer->id, &id); + be32enc(&footer->checksum, vhd_checksum(footer, sizeof(*footer))); +} + +/* + * We round the image size to 2MB for both the dynamic and + * fixed VHD formats. For dynamic VHD, this is needed to + * have the image size be a multiple of the grain size. For + * fixed VHD this is not really needed, but makes sure that + * it's easy to convert from fixed VHD to dynamic VHD. + */ +static int +vhd_resize(lba_t imgsz) +{ + uint64_t imagesz; + + imagesz = imgsz * secsz; + imagesz = (imagesz + VHD_BLOCK_SIZE - 1) & ~(VHD_BLOCK_SIZE - 1); + return (image_set_size(imagesz / secsz)); +} + +/* + * PART 2: Dynamic VHD support + * + * Notes: + * o File layout: + * copy of disk footer + * dynamic disk header + * block allocation table (BAT) + * data blocks + * disk footer + */ + +struct vhd_dyn_header { + uint64_t cookie; +#define VHD_HEADER_COOKIE 0x6378737061727365 + uint64_t data_offset; + uint64_t table_offset; + uint32_t version; + uint32_t max_entries; + uint32_t block_size; + uint32_t checksum; + uuid_t parent_id; + uint32_t parent_timestamp; + char _reserved1[4]; + uint16_t parent_name[256]; /* UTF-16 */ + struct { + uint32_t code; + uint32_t data_space; + uint32_t data_length; + uint32_t _reserved; + uint64_t data_offset; + } parent_locator[8]; + char _reserved2[256]; +}; +_Static_assert(sizeof(struct vhd_dyn_header) == VHD_SECTOR_SIZE * 2, + "Wrong size for header"); + static int -vhd_write(int fd) +vhd_dyn_write(int fd) { struct vhd_footer footer; struct vhd_dyn_header header; - uuid_t id; uint64_t imgsz; lba_t blk, blkcnt, nblks; uint32_t *bat; @@ -224,22 +269,7 @@ vhd_write(int fd) imgsz = image_get_size() * secsz; bat_entries = imgsz / VHD_BLOCK_SIZE; - memset(&footer, 0, sizeof(footer)); - be64enc(&footer.cookie, VHD_FOOTER_COOKIE); - be32enc(&footer.features, VHD_FEATURES_RESERVED); - be32enc(&footer.version, VHD_VERSION); - be64enc(&footer.data_offset, sizeof(footer)); - be32enc(&footer.timestamp, vhd_timestamp()); - be32enc(&footer.creator_tool, VHD_CREATOR_TOOL); - be32enc(&footer.creator_version, VHD_CREATOR_VERSION); - be32enc(&footer.creator_os, VHD_CREATOR_OS); - be64enc(&footer.original_size, imgsz); - be64enc(&footer.current_size, imgsz); - vhd_geometry(&footer); - be32enc(&footer.disk_type, VHD_DISK_TYPE_DYNAMIC); - mkimg_uuid(&id); - vhd_uuid_enc(&footer.id, &id); - be32enc(&footer.checksum, vhd_checksum(&footer, sizeof(footer))); + vhd_make_footer(&footer, imgsz, VHD_DISK_TYPE_DYNAMIC, sizeof(footer)); if (sparse_write(fd, &footer, sizeof(footer)) < 0) return (errno); @@ -308,11 +338,41 @@ vhd_write(int fd) return (0); } -static struct mkimg_format vhd_format = { +static struct mkimg_format vhd_dyn_format = { .name = "vhd", .description = "Virtual Hard Disk", .resize = vhd_resize, - .write = vhd_write, + .write = vhd_dyn_write, +}; + +FORMAT_DEFINE(vhd_dyn_format); + +/* + * PART 2: Fixed VHD + */ + +static int +vhd_fix_write(int fd) +{ + struct vhd_footer footer; + uint64_t imgsz; + int error; + + error = image_copyout(fd); + if (!error) { + imgsz = image_get_size() * secsz; + vhd_make_footer(&footer, imgsz, VHD_DISK_TYPE_FIXED, ~0ULL); + if (sparse_write(fd, &footer, sizeof(footer)) < 0) + error = errno; + } + return (error); +} + +static struct mkimg_format vhd_fix_format = { + .name = "vhdf", + .description = "Fixed Virtual Hard Disk", + .resize = vhd_resize, + .write = vhd_fix_write, }; -FORMAT_DEFINE(vhd_format); +FORMAT_DEFINE(vhd_fix_format); From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 17:35:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E97B01C7; Thu, 17 Jul 2014 17:35:21 +0000 (UTC) Received: from mail-qa0-x235.google.com (mail-qa0-x235.google.com [IPv6:2607:f8b0:400d:c00::235]) (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 63E592DE6; Thu, 17 Jul 2014 17:35:21 +0000 (UTC) Received: by mail-qa0-f53.google.com with SMTP id v10so2127436qac.12 for ; Thu, 17 Jul 2014 10:35:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=v/C56IjsL2pB1SbMsD8ug+yfCFXBXxFXnl3G19KFt6c=; b=lNS8PaFfngHaaRjmjsvlJblvKg3ywRvk1C4KFy09A0uFwtmtSSq/xKxrxt0YDZEvLD V/Is7sioI8+l8VfEMkIiXjY9OA0GDSVvEpkWA5VXKjjjxruomFiHbY9bHE2tvvIStxJ4 Q2gU0BUbNBC8D8B/0cnSucNFZXtfKXU5tFiPrA2bDyPFnz44rfqBfrdcqy8xrwd1YAcm eqtWbJfw2OCKjOM6iXqZTK8Z1gv8oMqQXXBhaXl9pRsFvJCE8aCLE7oM7tMSRQ7I7kuF 0kbVQvoJSh5hkmgZ4dLKXyfhanNBWTg7Ebjut2AZHAHdkSzXGFlIuFnHPCABOityVQAx VAug== MIME-Version: 1.0 X-Received: by 10.224.130.201 with SMTP id u9mr58165603qas.98.1405618520237; Thu, 17 Jul 2014 10:35:20 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.202.193 with HTTP; Thu, 17 Jul 2014 10:35:20 -0700 (PDT) Received: by 10.224.202.193 with HTTP; Thu, 17 Jul 2014 10:35:20 -0700 (PDT) In-Reply-To: <20140717141934.GI87212@FreeBSD.org> References: <201407170521.s6H5LGbx042649@svn.freebsd.org> <20140717141934.GI87212@FreeBSD.org> Date: Thu, 17 Jul 2014 10:35:20 -0700 X-Google-Sender-Auth: _MM41nppjPNtyReAou6eWqACvOo Message-ID: Subject: Re: svn commit: r268787 - in head/sys: kern net From: Adrian Chadd To: Gleb Smirnoff Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: svn-src-head@freebsd.org, Kevin Lo , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 17:35:22 -0000 +1. Would you like to do it or should I? A On Jul 17, 2014 7:19 AM, "Gleb Smirnoff" wrote: > On Thu, Jul 17, 2014 at 05:21:16AM +0000, Kevin Lo wrote: > K> Author: kevlo > K> Date: Thu Jul 17 05:21:16 2014 > K> New Revision: 268787 > K> URL: http://svnweb.freebsd.org/changeset/base/268787 > K> > K> Log: > K> Deprecate m_act. Use m_nextpkt always. > > Thanks. IMHO, the define should go away from mbuf.h as well. > > -- > Totus tuus, Glebius. > > From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 17:41:33 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C9B853C9; Thu, 17 Jul 2014 17:41: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 B65A52E2F; Thu, 17 Jul 2014 17:41:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6HHfXn6000959; Thu, 17 Jul 2014 17:41:33 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6HHfWZs000954; Thu, 17 Jul 2014 17:41:32 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201407171741.s6HHfWZs000954@svn.freebsd.org> From: Alan Cox Date: Thu, 17 Jul 2014 17:41:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268803 - in head: . share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 17:41:34 -0000 Author: alc Date: Thu Jul 17 17:41:32 2014 New Revision: 268803 URL: http://svnweb.freebsd.org/changeset/base/268803 Log: Remove the man page for a pmap function that no longer exists. Modified: head/ObsoleteFiles.inc head/share/man/man9/Makefile head/share/man/man9/pmap.9 head/share/man/man9/pmap_clear_modify.9 head/share/man/man9/pmap_is_modified.9 Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu Jul 17 16:33:38 2014 (r268802) +++ head/ObsoleteFiles.inc Thu Jul 17 17:41:32 2014 (r268803) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20140717: Remove an obsolete man page +OLD_FILES+=usr/share/man/man9/pmap_clear_reference.9.gz # 20140716: Remove an incorrectly named man page OLD_FILES+=usr/share/man/man9/pmap_ts_modified.9.gz # 20140712: Removal of bsd.dtrace.mk Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Thu Jul 17 16:33:38 2014 (r268802) +++ head/share/man/man9/Makefile Thu Jul 17 17:41:32 2014 (r268803) @@ -1044,7 +1044,6 @@ MLINKS+=pfil.9 pfil_add_hook.9 \ pfil.9 pfil_hook_get.9 \ pfil.9 pfil_remove_hook.9 MLINKS+=pfind.9 zpfind.9 -MLINKS+=pmap_clear_modify.9 pmap_clear_reference.9 MLINKS+=pmap_copy.9 pmap_copy_page.9 MLINKS+=pmap_extract.9 pmap_extract_and_hold.9 MLINKS+=pmap_init.9 pmap_init2.9 Modified: head/share/man/man9/pmap.9 ============================================================================== --- head/share/man/man9/pmap.9 Thu Jul 17 16:33:38 2014 (r268802) +++ head/share/man/man9/pmap.9 Thu Jul 17 17:41:32 2014 (r268803) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2014 +.Dd July 17, 2014 .Dt PMAP 9 .Os .Sh NAME @@ -91,7 +91,6 @@ operation. .Xr pmap_activate 9 , .Xr pmap_change_wiring 9 , .Xr pmap_clear_modify 9 , -.Xr pmap_clear_reference 9 , .Xr pmap_copy 9 , .Xr pmap_copy_page 9 , .Xr pmap_enter 9 , Modified: head/share/man/man9/pmap_clear_modify.9 ============================================================================== --- head/share/man/man9/pmap_clear_modify.9 Thu Jul 17 16:33:38 2014 (r268802) +++ head/share/man/man9/pmap_clear_modify.9 Thu Jul 17 17:41:32 2014 (r268803) @@ -25,12 +25,11 @@ .\" .\" $FreeBSD$ .\" -.Dd July 21, 2003 +.Dd July 17, 2014 .Dt PMAP_CLEAR_MODIFY 9 .Os .Sh NAME -.Nm pmap_clear_modify , -.Nm pmap_clear_reference +.Nm pmap_clear_modify .Nd set information about physical pages .Sh SYNOPSIS .In sys/param.h @@ -38,8 +37,6 @@ .In vm/pmap.h .Ft void .Fn pmap_clear_modify "vm_page_t m" -.Ft void -.Fn pmap_clear_reference "vm_page_t m" .Sh DESCRIPTION The .Fn pmap_clear_modify @@ -47,17 +44,9 @@ function clears the .Dq modified bit on the physical page .Fa m . -.Pp -The -.Fn pmap_clear_reference -function clears the -.Dq referenced -bit on the physical page -.Fa m . .Sh SEE ALSO .Xr pmap 9 , -.Xr pmap_is_modified 9 , -.Xr pmap_ts_referenced 9 +.Xr pmap_is_modified 9 .Sh AUTHORS This manual page was written by .An Bruce M Simpson Aq Mt bms@spc.org . Modified: head/share/man/man9/pmap_is_modified.9 ============================================================================== --- head/share/man/man9/pmap_is_modified.9 Thu Jul 17 16:33:38 2014 (r268802) +++ head/share/man/man9/pmap_is_modified.9 Thu Jul 17 17:41:32 2014 (r268803) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 21, 2003 +.Dd July 17, 2014 .Dt PMAP_IS_MODIFIED 9 .Os .Sh NAME @@ -64,8 +64,7 @@ necessary that 0 only be returned when t bits set on the page. .Sh SEE ALSO .Xr pmap 9 , -.Xr pmap_clear_modify 9 , -.Xr pmap_clear_reference 9 +.Xr pmap_clear_modify 9 .Sh AUTHORS This manual page was written by .An Bruce M Simpson Aq Mt bms@spc.org . From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 18:24:43 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF09CADB; Thu, 17 Jul 2014 18:24:43 +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 984D62263; Thu, 17 Jul 2014 18:24:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6HIOhWQ021040; Thu, 17 Jul 2014 18:24:43 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6HIOZpg020943; Thu, 17 Jul 2014 18:24:35 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201407171824.s6HIOZpg020943@svn.freebsd.org> From: Brooks Davis Date: Thu, 17 Jul 2014 18:24:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268804 - in head: bin/csh bin/ls bin/sh games/grdc gnu/lib/libreadline/readline gnu/usr.bin/gdb/gdb gnu/usr.bin/gdb/gdbtui gnu/usr.bin/gdb/kgdb gnu/usr.bin/texinfo/info kerberos5/usr.b... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 18:24:43 -0000 Author: brooks Date: Thu Jul 17 18:24:34 2014 New Revision: 268804 URL: http://svnweb.freebsd.org/changeset/base/268804 Log: Replace all uses of libncurses and libtermcap with their wide character variants. This allows usable file system images (i.e. those with both a shell and an editor) to be created with only one copy of the curses library. Exp-run: antoine PR: 189842 Discussed with: bapt Sponsored by: DARPA, AFRL Modified: head/bin/csh/Makefile head/bin/ls/Makefile head/bin/sh/Makefile head/games/grdc/Makefile head/gnu/lib/libreadline/readline/Makefile head/gnu/usr.bin/gdb/gdb/Makefile head/gnu/usr.bin/gdb/gdbtui/Makefile head/gnu/usr.bin/gdb/kgdb/Makefile head/gnu/usr.bin/texinfo/info/Makefile head/kerberos5/usr.bin/kadmin/Makefile head/lib/libedit/Makefile head/libexec/telnetd/Makefile head/rescue/rescue/Makefile head/sbin/fsdb/Makefile head/sbin/gvinum/Makefile head/secure/usr.bin/sftp/Makefile head/tools/bsdbox/Makefile head/tools/tools/net80211/stumbler/Makefile head/usr.bin/clang/clang.prog.mk head/usr.bin/ee/Makefile head/usr.bin/ftp/Makefile head/usr.bin/less/Makefile head/usr.bin/msgs/Makefile head/usr.bin/ncal/Makefile head/usr.bin/tabs/Makefile head/usr.bin/telnet/Makefile head/usr.bin/tftp/Makefile head/usr.bin/tput/Makefile head/usr.bin/tset/Makefile head/usr.bin/ul/Makefile head/usr.bin/units/Makefile head/usr.bin/vi/Makefile head/usr.sbin/cdcontrol/Makefile head/usr.sbin/lpr/lpc/Makefile head/usr.sbin/ngctl/Makefile head/usr.sbin/ntp/ntpdc/Makefile head/usr.sbin/ntp/ntpq/Makefile head/usr.sbin/pmcstat/Makefile head/usr.sbin/pppctl/Makefile head/usr.sbin/watch/Makefile head/usr.sbin/wpa/wpa_cli/Makefile Modified: head/bin/csh/Makefile ============================================================================== --- head/bin/csh/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/bin/csh/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -40,8 +40,8 @@ MLINKS= csh.1 tcsh.1 # utilities of the same name are handled with the associated manpage, # builtin.1 in share/man/man1/. -DPADD= ${LIBTERMCAP} ${LIBCRYPT} -LDADD= -ltermcap -lcrypt +DPADD= ${LIBTERMCAPW} ${LIBCRYPT} +LDADD= -ltermcapw -lcrypt LINKS= ${BINDIR}/csh ${BINDIR}/tcsh Modified: head/bin/ls/Makefile ============================================================================== --- head/bin/ls/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/bin/ls/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -11,8 +11,8 @@ LDADD= -lutil .if !defined(RELEASE_CRUNCH) && \ ${MK_LS_COLORS} != no CFLAGS+= -DCOLORLS -DPADD+= ${LIBTERMCAP} -LDADD+= -ltermcap +DPADD+= ${LIBTERMCAPW} +LDADD+= -ltermcapw .endif .include Modified: head/bin/sh/Makefile ============================================================================== --- head/bin/sh/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/bin/sh/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -18,8 +18,8 @@ SRCS= ${SHSRCS} ${GENSRCS} ${GENHDRS} # utilities of the same name are handled with the associated manpage, # builtin.1 in share/man/man1/. -DPADD= ${LIBEDIT} ${LIBTERMCAP} -LDADD= -ledit -ltermcap +DPADD= ${LIBEDIT} ${LIBTERMCAPW} +LDADD= -ledit -ltermcapw CFLAGS+=-DSHELL -I. -I${.CURDIR} # for debug: Modified: head/games/grdc/Makefile ============================================================================== --- head/games/grdc/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/games/grdc/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -2,7 +2,7 @@ PROG= grdc MAN= grdc.6 -DPADD= ${LIBNCURSES} -LDADD= -lncurses +DPADD= ${LIBNCURSESW} +LDADD= -lncursesw .include Modified: head/gnu/lib/libreadline/readline/Makefile ============================================================================== --- head/gnu/lib/libreadline/readline/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/gnu/lib/libreadline/readline/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -23,7 +23,7 @@ ${.OBJDIR}/${_h}: ${SRCDIR}/${_h} ${INSTALL} ${.ALLSRC} ${.TARGET} .endfor -DPADD= ${LIBTERMCAP} -LDADD= -ltermcap +DPADD= ${LIBTERMCAPW} +LDADD= -ltermcapw .include Modified: head/gnu/usr.bin/gdb/gdb/Makefile ============================================================================== --- head/gnu/usr.bin/gdb/gdb/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/gnu/usr.bin/gdb/gdb/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -11,8 +11,8 @@ GDBLIBS= ${OBJ_GDB}/libgdb/libgdb.a # global symbols visible. LDFLAGS+= -Wl,-E -DPADD= ${GDBLIBS} ${BULIBS} ${LIBM} ${LIBREADLINE} ${LIBTERMCAP} ${LIBGNUREGEX} -LDADD= ${GDBLIBS} ${BULIBS} -lm ${LIBREADLINE} -ltermcap -lgnuregex +DPADD= ${GDBLIBS} ${BULIBS} ${LIBM} ${LIBREADLINE} ${LIBTERMCAPW} ${LIBGNUREGEX} +LDADD= ${GDBLIBS} ${BULIBS} -lm ${LIBREADLINE} -ltermcapw -lgnuregex NO_PIE= yes Modified: head/gnu/usr.bin/gdb/gdbtui/Makefile ============================================================================== --- head/gnu/usr.bin/gdb/gdbtui/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/gnu/usr.bin/gdb/gdbtui/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -12,8 +12,8 @@ GDBLIBS= ${OBJ_GDB}/libgdb/libgdb.a # global symbols visible. LDFLAGS+= -Wl,-E -DPADD= ${GDBLIBS} ${BULIBS} ${LIBM} ${LIBREADLINE} ${LIBTERMCAP} ${LIBGNUREGEX} -LDADD= ${GDBLIBS} ${BULIBS} -lm ${LIBREADLINE} -ltermcap -lgnuregex +DPADD= ${GDBLIBS} ${BULIBS} ${LIBM} ${LIBREADLINE} ${LIBTERMCAPW} ${LIBGNUREGEX} +LDADD= ${GDBLIBS} ${BULIBS} -lm ${LIBREADLINE} -ltermcapw -lgnuregex NO_PIE= yes Modified: head/gnu/usr.bin/gdb/kgdb/Makefile ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/gnu/usr.bin/gdb/kgdb/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -8,9 +8,9 @@ BULIBS= ${OBJ_BU}/libbfd/libbfd.a ${OBJ_ ${OBJ_BU}/libiberty/libiberty.a GDBLIBS= ${OBJ_GDB}/libgdb/libgdb.a -DPADD= ${GDBLIBS} ${BULIBS} ${LIBKVM} ${LIBM} ${LIBREADLINE} ${LIBTERMCAP} \ +DPADD= ${GDBLIBS} ${BULIBS} ${LIBKVM} ${LIBM} ${LIBREADLINE} ${LIBTERMCAPW} \ ${LIBGNUREGEX} -LDADD= ${GDBLIBS} ${BULIBS} -lkvm${GDB_SUFFIX} -lm ${LIBREADLINE} -ltermcap \ +LDADD= ${GDBLIBS} ${BULIBS} -lkvm${GDB_SUFFIX} -lm ${LIBREADLINE} -ltermcapw \ -lgnuregex .if defined(GDB_CROSS_DEBUGGER) Modified: head/gnu/usr.bin/texinfo/info/Makefile ============================================================================== --- head/gnu/usr.bin/texinfo/info/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/gnu/usr.bin/texinfo/info/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -10,8 +10,8 @@ SRCS= dir.c display.c doc.c dribble.c ec CFLAGS+= -DINFODIR=\"${INFODIR}:/usr/local/info:.\" -DPADD= ${LIBTERMCAP} ${LIBTXI} -LDADD= -ltermcap ${LIBTXI} +DPADD= ${LIBTERMCAPW} ${LIBTXI} +LDADD= -ltermcapw ${LIBTXI} NO_PIE= yes Modified: head/kerberos5/usr.bin/kadmin/Makefile ============================================================================== --- head/kerberos5/usr.bin/kadmin/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/kerberos5/usr.bin/kadmin/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -29,11 +29,11 @@ CFLAGS+=-I${KRB5DIR}/lib/asn1 -I${KRB5DI DPADD= ${LIBKADM5CLNT} ${LIBKADM5SRV} ${LIBHDB} ${LIBKRB5} ${LIBHX509} \ ${LIBSL} ${LIBROKEN} ${LIBVERS} ${LIBASN1} \ ${LIBCRYPTO} ${LIBCRYPT} ${LIBCOM_ERR} \ - ${LIBEDIT} ${LIBNCURSES} ${LDAPDPADD} + ${LIBEDIT} ${LIBNCURSESW} ${LDAPDPADD} LDADD= -lkadm5clnt -lkadm5srv -lhdb -lkrb5 -lhx509 \ ${LIBSL} -lroken ${LIBVERS} -lasn1 \ -lcrypto -lcrypt -lcom_err \ - -ledit -lncurses ${LDAPLDADD} + -ledit -lncursesw ${LDAPLDADD} LDFLAGS=${LDAPLDFLAGS} NO_PIE= yes Modified: head/lib/libedit/Makefile ============================================================================== --- head/lib/libedit/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/lib/libedit/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -10,8 +10,8 @@ OSRCS= chared.c common.c el.c emacs.c fc hist.c key.c map.c \ parse.c prompt.c read.c refresh.c search.c sig.c term.c tty.c vi.c -DPADD= ${LIBNCURSES} -LDADD= -lncurses +DPADD= ${LIBNCURSESW} +LDADD= -lncursesw MAN= editline.3 editrc.5 Modified: head/libexec/telnetd/Makefile ============================================================================== --- head/libexec/telnetd/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/libexec/telnetd/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -30,8 +30,8 @@ CFLAGS+= -I${TELNETDIR} LIBTELNET= ${.OBJDIR}/../../lib/libtelnet/libtelnet.a -DPADD= ${LIBUTIL} ${LIBTERMCAP} ${LIBTELNET} -LDADD= -lutil -ltermcap ${LIBTELNET} +DPADD= ${LIBUTIL} ${LIBTERMCAPW} ${LIBTELNET} +LDADD= -lutil -ltermcapw ${LIBTELNET} .if ${MK_OPENSSL} != "no" SRCS+= authenc.c Modified: head/rescue/rescue/Makefile ============================================================================== --- head/rescue/rescue/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/rescue/rescue/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -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 -ltermcap -lutil +CRUNCH_LIBS+= -lcrypt -ledit -ljail -lkvm -ll -ltermcapw -lutil CRUNCH_BUILDTOOLS+= bin/sh # Additional options for specific programs @@ -118,7 +118,7 @@ CRUNCH_PROGS_sbin+= zpool # crunchgen does not like C++ programs; this should be fixed someday # CRUNCH_PROGS+= devd -CRUNCH_LIBS+= -lalias -lcam -lcurses -ldevstat -lipsec +CRUNCH_LIBS+= -lalias -lcam -lncursesw -ldevstat -lipsec .if ${MK_ZFS} != "no" CRUNCH_LIBS+= -lavl -lzfs_core -lzfs -lnvpair -lpthread -luutil -lumem .endif Modified: head/sbin/fsdb/Makefile ============================================================================== --- head/sbin/fsdb/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/sbin/fsdb/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -9,8 +9,8 @@ SRCS= fsdb.c fsdbutil.c \ pass5.c setup.c utilities.c ffs_subr.c ffs_tables.c globs.c CFLAGS+= -I${.CURDIR}/../fsck_ffs WARNS?= 2 -LDADD= -ledit -ltermcap -DPADD= ${LIBEDIT} ${LIBTERMCAP} +LDADD= -ledit -ltermcapw +DPADD= ${LIBEDIT} ${LIBTERMCAPW} .PATH: ${.CURDIR}/../fsck_ffs ${.CURDIR}/../../sys/ufs/ffs .include Modified: head/sbin/gvinum/Makefile ============================================================================== --- head/sbin/gvinum/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/sbin/gvinum/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -7,8 +7,8 @@ MAN= gvinum.8 WARNS?= 2 CFLAGS+= -I${.CURDIR}/../../sys -I${DESTDIR}/${INCLUDEDIR}/edit -DPADD= ${LIBEDIT} ${LIBTERMCAP} ${LIBDEVSTAT} ${LIBKVM} ${LIBGEOM} -LDADD= -ledit -ltermcap -ldevstat -lkvm -lgeom +DPADD= ${LIBEDIT} ${LIBTERMCAPW} ${LIBDEVSTAT} ${LIBKVM} ${LIBGEOM} +LDADD= -ledit -ltermcapw -ldevstat -lkvm -lgeom .PATH: ${.CURDIR}/../../sys/geom/vinum Modified: head/secure/usr.bin/sftp/Makefile ============================================================================== --- head/secure/usr.bin/sftp/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/secure/usr.bin/sftp/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -11,8 +11,8 @@ CFLAGS+=-I${SSHDIR} -include ssh_namespa SRCS+= roaming_dummy.c .endif -DPADD= ${LIBSSH} ${LIBEDIT} ${LIBNCURSES} -LDADD= -lssh -ledit -lncurses +DPADD= ${LIBSSH} ${LIBEDIT} ${LIBNCURSESW} +LDADD= -lssh -ledit -lncursesw USEPRIVATELIB= ssh .if ${MK_LDNS} != "no" Modified: head/tools/bsdbox/Makefile ============================================================================== --- head/tools/bsdbox/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/tools/bsdbox/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -57,7 +57,7 @@ CRUNCH_SRCDIRS+= bin # statically - and that ends very badly. CRUNCH_SHLIBS+= -lc -lutil -lcrypt CRUNCH_LIBS+= -lkvm -lmemstat -lnetgraph -CRUNCH_LIBS+= -lcrypt -ledit -ll -ltermcap +CRUNCH_LIBS+= -lcrypt -ledit -ll -ltermcapw ################################################################### # Programs from standard /sbin @@ -70,7 +70,7 @@ CRUNCH_LIBS+= -lcrypt -ledit -ll -ltermc # CRUNCH_SRCDIRS+= sbin -CRUNCH_LIBS+= -lalias -lcam -lcurses -ldevstat -lipsec +CRUNCH_LIBS+= -lalias -lcam -lcursesw -ldevstat -lipsec # Don't forget this - ifconfig, etc -adrian CRUNCH_LIBS+= -lgeom -lbsdxml -ljail -lkiconv -lmd -lsbuf -lufs Modified: head/tools/tools/net80211/stumbler/Makefile ============================================================================== --- head/tools/tools/net80211/stumbler/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/tools/tools/net80211/stumbler/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -2,8 +2,8 @@ PROG= stumbler BINDIR= /usr/local/bin -DPADD= ${LIBPCAP} ${LIBNCURSES} -LDADD= -lpcap -lncurses +DPADD= ${LIBPCAP} ${LIBNCURSESW} +LDADD= -lpcap -lncursesw CFLAGS=-g MAN= Modified: head/usr.bin/clang/clang.prog.mk ============================================================================== --- head/usr.bin/clang/clang.prog.mk Thu Jul 17 17:41:32 2014 (r268803) +++ head/usr.bin/clang/clang.prog.mk Thu Jul 17 18:24:34 2014 (r268804) @@ -11,8 +11,8 @@ DPADD+= ${.OBJDIR}/../../../lib/clang/li LDADD+= ${.OBJDIR}/../../../lib/clang/lib${lib}/lib${lib}.a .endfor -DPADD+= ${LIBNCURSES} -LDADD+= -lncurses +DPADD+= ${LIBNCURSESW} +LDADD+= -lncursesw BINDIR?= /usr/bin Modified: head/usr.bin/ee/Makefile ============================================================================== --- head/usr.bin/ee/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/usr.bin/ee/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -8,8 +8,8 @@ CFLAGS+= -DHAS_NCURSES -DHAS_UNISTD -DHA PROG= ee LINKS= ${BINDIR}/ee ${BINDIR}/ree ${BINDIR}/ee ${BINDIR}/edit MLINKS= ee.1 ree.1 ee.1 edit.1 -DPADD= ${LIBNCURSES} -LDADD= -lncurses +DPADD= ${LIBNCURSESW} +LDADD= -lncursesw WARNS?= 2 Modified: head/usr.bin/ftp/Makefile ============================================================================== --- head/usr.bin/ftp/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/usr.bin/ftp/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -20,8 +20,8 @@ CFLAGS+= -DINET6 .endif CFLAGS+= -I${.CURDIR} -I${TNFTP} -LDADD= -ledit -ltermcap -lutil -DPADD= ${LIBEDIT} ${LIBTERMCAP} ${LIBUTIL} +LDADD= -ledit -ltermcapw -lutil +DPADD= ${LIBEDIT} ${LIBTERMCAPW} ${LIBUTIL} WARNS?= 2 Modified: head/usr.bin/less/Makefile ============================================================================== --- head/usr.bin/less/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/usr.bin/less/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -8,8 +8,8 @@ SRCS= main.c screen.c brac.c ch.c charse signal.c tags.c ttyin.c version.c SCRIPTS=lesspipe.sh zless.sh SCRIPTSNAME_lesspipe.sh=lesspipe.sh -DPADD= ${LIBTERMCAP} -LDADD= -ltermcap +DPADD= ${LIBTERMCAPW} +LDADD= -ltermcapw LINKS= ${BINDIR}/less ${BINDIR}/more \ ${BINDIR}/zless ${BINDIR}/bzless \ ${BINDIR}/zless ${BINDIR}/xzless \ Modified: head/usr.bin/msgs/Makefile ============================================================================== --- head/usr.bin/msgs/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/usr.bin/msgs/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -2,7 +2,7 @@ # $FreeBSD$ PROG= msgs -DPADD= ${LIBTERMCAP} -LDADD= -ltermcap +DPADD= ${LIBTERMCAPW} +LDADD= -ltermcapw .include Modified: head/usr.bin/ncal/Makefile ============================================================================== --- head/usr.bin/ncal/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/usr.bin/ncal/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -4,8 +4,8 @@ PROG= ncal -DPADD= ${LIBCALENDAR} ${LIBTERMCAP} -LDADD= -lcalendar -ltermcap +DPADD= ${LIBCALENDAR} ${LIBTERMCAPW} +LDADD= -lcalendar -ltermcapw LINKS= ${BINDIR}/ncal ${BINDIR}/cal MLINKS= ncal.1 cal.1 Modified: head/usr.bin/tabs/Makefile ============================================================================== --- head/usr.bin/tabs/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/usr.bin/tabs/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= tabs -DPADD= ${LIBTERMCAP} -LDADD= -ltermcap +DPADD= ${LIBTERMCAPW} +LDADD= -ltermcapw .include Modified: head/usr.bin/telnet/Makefile ============================================================================== --- head/usr.bin/telnet/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/usr.bin/telnet/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -23,8 +23,8 @@ WARNS?= 2 LIBTELNET= ${.OBJDIR}/../../lib/libtelnet/libtelnet.a -DPADD= ${LIBTERMCAP} ${LIBTELNET} -LDADD= -ltermcap ${LIBTELNET} +DPADD= ${LIBTERMCAPW} ${LIBTELNET} +LDADD= -ltermcapw ${LIBTELNET} .if !defined(RELEASE_CRUNCH) CFLAGS+= -DIPSEC Modified: head/usr.bin/tftp/Makefile ============================================================================== --- head/usr.bin/tftp/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/usr.bin/tftp/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -7,7 +7,7 @@ PROG= tftp SRCS= main.c tftp-file.c tftp-io.c tftp-options.c tftp-transfer.c SRCS+= tftp-utils.c tftp.c CFLAGS+=-I${.CURDIR}/../../libexec/tftpd -DPADD= ${LIBEDIT} ${LIBTERMCAP} -LDADD= -ledit -ltermcap +DPADD= ${LIBEDIT} ${LIBTERMCAPW} +LDADD= -ledit -ltermcapw .include Modified: head/usr.bin/tput/Makefile ============================================================================== --- head/usr.bin/tput/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/usr.bin/tput/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -2,8 +2,8 @@ # $FreeBSD$ PROG= tput -DPADD= ${LIBTERMCAP} -LDADD= -ltermcap +DPADD= ${LIBTERMCAPW} +LDADD= -ltermcapw SCRIPTS=clear.sh MLINKS= tput.1 clear.1 Modified: head/usr.bin/tset/Makefile ============================================================================== --- head/usr.bin/tset/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/usr.bin/tset/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -1,10 +1,11 @@ # @(#)Makefile 8.1 (Berkeley) 6/9/93 +# $FreeBSD$ PROG= tset SRCS= map.c misc.c set.c term.c tset.c wrterm.c -DPADD= ${LIBTERMCAP} -LDADD= -ltermcap +DPADD= ${LIBTERMCAPW} +LDADD= -ltermcapw LINKS= ${BINDIR}/tset ${BINDIR}/reset MLINKS= tset.1 reset.1 Modified: head/usr.bin/ul/Makefile ============================================================================== --- head/usr.bin/ul/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/usr.bin/ul/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -3,7 +3,7 @@ PROG= ul -DPADD= ${LIBTERMCAP} -LDADD= -ltermcap +DPADD= ${LIBTERMCAPW} +LDADD= -ltermcapw .include Modified: head/usr.bin/units/Makefile ============================================================================== --- head/usr.bin/units/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/usr.bin/units/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -6,8 +6,8 @@ PROG= units FILES= units.lib FILESDIR= ${SHAREDIR}/misc -LDADD+=-ledit -ltermcap -DPADD+=${LIBEDIT} ${LIBTERMCAP} +LDADD+=-ledit -ltermcapw +DPADD+=${LIBEDIT} ${LIBTERMCAPW} .if ${MK_TESTS} != "no" SUBDIR+= tests Modified: head/usr.bin/vi/Makefile ============================================================================== --- head/usr.bin/vi/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/usr.bin/vi/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -36,14 +36,9 @@ CFLAGS+=-I${.CURDIR} -I${SRCDIR} -I${SRC DPADD= ${LIBUTIL} LDADD= -lutil -.if defined(RESCUE) || defined(RELEASE_CRUNCH) -DPADD+= ${LIBNCURSES} -LDADD+= -lncurses -.else CFLAGS+= -DUSE_WIDECHAR DPADD+= ${LIBNCURSESW} LDADD+= -lncursesw -.endif .if ${MK_ICONV} == "yes" && !defined(RESCUE) && !defined(RELEASE_CRUNCH) CFLAGS+= -DUSE_ICONV Modified: head/usr.sbin/cdcontrol/Makefile ============================================================================== --- head/usr.sbin/cdcontrol/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/usr.sbin/cdcontrol/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -2,7 +2,7 @@ PROG= cdcontrol -DPADD= ${LIBEDIT} ${LIBTERMCAP} -LDADD= -ledit -ltermcap +DPADD= ${LIBEDIT} ${LIBTERMCAPW} +LDADD= -ledit -ltermcapw .include Modified: head/usr.sbin/lpr/lpc/Makefile ============================================================================== --- head/usr.sbin/lpr/lpc/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/usr.sbin/lpr/lpc/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -13,8 +13,8 @@ CFLAGS+= -I${.CURDIR}/../common_source WARNS?= 0 -DPADD= ${LIBLPR} ${LIBEDIT} ${LIBTERMCAP} -LDADD= ${LIBLPR} -ledit -ltermcap +DPADD= ${LIBLPR} ${LIBEDIT} ${LIBTERMCAPW} +LDADD= ${LIBLPR} -ledit -ltermcapw NO_PIE= yes Modified: head/usr.sbin/ngctl/Makefile ============================================================================== --- head/usr.sbin/ngctl/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/usr.sbin/ngctl/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -22,8 +22,8 @@ LDADD= -lnetgraph .if !defined(NGCTL_NO_LIBEDIT) CFLAGS+= -DEDITLINE -DPADD+= ${LIBPTHREAD} ${LIBEDIT} ${LIBTERMCAP} -LDADD+= -lpthread -ledit -ltermcap +DPADD+= ${LIBPTHREAD} ${LIBEDIT} ${LIBTERMCAPW} +LDADD+= -lpthread -ledit -ltermcapw .endif .include Modified: head/usr.sbin/ntp/ntpdc/Makefile ============================================================================== --- head/usr.sbin/ntp/ntpdc/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/usr.sbin/ntp/ntpdc/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -15,8 +15,8 @@ CFLAGS+= -I${.CURDIR}/../../../contrib/n DPADD= ${LIBNTP} ${LIBM} ${LIBMD} ${LIBOPTS} LDADD= ${LIBNTP} -lm -lmd ${LIBOPTS} -DPADD+= ${LIBEDIT} ${LIBTERMCAP} -LDADD+= -ledit -ltermcap +DPADD+= ${LIBEDIT} ${LIBTERMCAPW} +LDADD+= -ledit -ltermcapw CFLAGS+= -DHAVE_LIBEDIT -DHAVE_READLINE_READLINE_H \ -I${DESTDIR}/${INCLUDEDIR}/edit Modified: head/usr.sbin/ntp/ntpq/Makefile ============================================================================== --- head/usr.sbin/ntp/ntpq/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/usr.sbin/ntp/ntpq/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -17,8 +17,8 @@ CFLAGS+= -I${.CURDIR}/../../../contrib/n DPADD= ${LIBNTP} ${LIBM} ${LIBMD} ${LIBOPTS} LDADD= ${LIBNTP} -lm -lmd ${LIBOPTS} -DPADD+= ${LIBEDIT} ${LIBTERMCAP} -LDADD+= -ledit -ltermcap +DPADD+= ${LIBEDIT} ${LIBTERMCAPW} +LDADD+= -ledit -ltermcapw CFLAGS+= -DHAVE_LIBEDIT -DHAVE_READLINE_READLINE_H \ -I${DESTDIR}/${INCLUDEDIR}/edit Modified: head/usr.sbin/pmcstat/Makefile ============================================================================== --- head/usr.sbin/pmcstat/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/usr.sbin/pmcstat/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -5,8 +5,8 @@ PROG= pmcstat MAN= pmcstat.8 -DPADD= ${LIBELF} ${LIBKVM} ${LIBPMC} ${LIBM} ${LIBNCURSES} -LDADD= -lelf -lkvm -lpmc -lm -lncurses +DPADD= ${LIBELF} ${LIBKVM} ${LIBPMC} ${LIBM} ${LIBNCURSESW} +LDADD= -lelf -lkvm -lpmc -lm -lncursesw SRCS= pmcstat.c pmcstat.h pmcstat_log.c \ pmcpl_callgraph.c pmcpl_gprof.c pmcpl_annotate.c \ Modified: head/usr.sbin/pppctl/Makefile ============================================================================== --- head/usr.sbin/pppctl/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/usr.sbin/pppctl/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -5,7 +5,7 @@ MAN= pppctl.8 WARNS?= 2 -DPADD= ${LIBPTHREAD} ${LIBEDIT} ${LIBTERMCAP} -LDADD= -lpthread -ledit -ltermcap +DPADD= ${LIBPTHREAD} ${LIBEDIT} ${LIBTERMCAPW} +LDADD= -lpthread -ledit -ltermcapw .include Modified: head/usr.sbin/watch/Makefile ============================================================================== --- head/usr.sbin/watch/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/usr.sbin/watch/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -5,7 +5,7 @@ MAN= watch.8 WARNS?= 2 -DPADD= ${LIBTERMCAP} -LDADD= -ltermcap +DPADD= ${LIBTERMCAPW} +LDADD= -ltermcapw .include Modified: head/usr.sbin/wpa/wpa_cli/Makefile ============================================================================== --- head/usr.sbin/wpa/wpa_cli/Makefile Thu Jul 17 17:41:32 2014 (r268803) +++ head/usr.sbin/wpa/wpa_cli/Makefile Thu Jul 17 18:24:34 2014 (r268804) @@ -15,7 +15,7 @@ CFLAGS+= -DCONFIG_CTRL_IFACE_UNIX CFLAGS+= -D_DIRENT_HAVE_D_TYPE CFLAGS+= -DCONFIG_READLINE -I${DESTDIR}/${INCLUDEDIR}/edit -LDADD+= -ledit -ltermcap -lutil -DPADD+= ${LIBEDIT} ${LIBTERMCAP} ${LIBUTIL} +LDADD+= -ledit -ltermcapw -lutil +DPADD+= ${LIBEDIT} ${LIBTERMCAPW} ${LIBUTIL} .include From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 18:38:33 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E07531C4; Thu, 17 Jul 2014 18:38:33 +0000 (UTC) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "anubis.delphij.net", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id BD5AE23C4; Thu, 17 Jul 2014 18:38:33 +0000 (UTC) Received: from zeta.ixsystems.com (unknown [69.198.165.132]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by anubis.delphij.net (Postfix) with ESMTPSA id 2670D387B; Thu, 17 Jul 2014 11:38:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=delphij.net; s=anubis; t=1405622313; bh=nTZCtSlS5V72OEymozzs22q9+punMCCAyZFmNBVKoLs=; h=Date:From:Reply-To:To:Subject:References:In-Reply-To; b=4jtIkDtgSxfIlJpEa7qlcW9b8A6KVQexC+wd4J4t6h9pQVMVCNsLIlpA6ducuiTIO 68S+xoFkjb4UqWtf1l/S+wlcuNTJ8nfSHgqnBUyE03IXEMs/O7lyAykmNcQsCNXqWP Par9zZI29Gt/vHeLVyvi4j6BvzYuTAyRavMWtmVE= Message-ID: <53C81828.4080407@delphij.net> Date: Thu, 17 Jul 2014 11:38:32 -0700 From: Xin Li Reply-To: d@delphij.net Organization: The FreeBSD Project MIME-Version: 1.0 To: Brooks Davis , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r268804 - in head: bin/csh bin/ls bin/sh games/grdc gnu/lib/libreadline/readline gnu/usr.bin/gdb/gdb gnu/usr.bin/gdb/gdbtui gnu/usr.bin/gdb/kgdb gnu/usr.bin/texinfo/info kerberos5/usr.b... References: <201407171824.s6HIOZpg020943@svn.freebsd.org> In-Reply-To: <201407171824.s6HIOZpg020943@svn.freebsd.org> X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 18:38:34 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 07/17/14 11:24, Brooks Davis wrote: > Author: brooks Date: Thu Jul 17 18:24:34 2014 New Revision: 268804 > URL: http://svnweb.freebsd.org/changeset/base/268804 > > Log: Replace all uses of libncurses and libtermcap with their wide > character variants. This allows usable file system images (i.e. > those with both a shell and an editor) to be created with only one > copy of the curses library. > > Exp-run: antoine PR: 189842 Discussed with: bapt Sponsored by: > DARPA, AFRL MFC? Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0 iQIcBAEBCgAGBQJTyBgoAAoJEJW2GBstM+nsITcP/1b5qZEqUQEKd6XH/5WAVuNB SP+oHHidsrV0QviJZR9jVbk/c/25zYDvYQuJc6tYeKMBaDuLW+j0e63uEw6VGhCH 6ikrTTNH4J0dmGYNLerEHIv8e3ajvaiCt5BsI/GCLlshYWOVcxn4W4egzJ/QHT9h tG/l2paTfa7oKghXqGUpJE9WH3NX/kdVqGt7ihDRRwZypEJEqHbWQmmglNWSF/F3 DFbDb9C7kuMehjzKZAIxtuMUSrIX8K7maeuJUYT5VlwAlLhzx84yQ0Q9qB6o8ijO KoEuB6TvMztc8jv8n6UbqQvREGO8EZeJ1+5E3rZxJUhk6Jz0gNnYnqEUpmIJ9zMK VKw+tXxySM+Ih3RRGUu/ALEEy+G5VKtUXQVYLPHNCS+q2siCH8MUc+o5dvVW+aD4 HnWH38ifcx5HZmhPVKoS46V7+NW6GiLFKio/oNtTJTGj3qvwDK771vLSq/cn1Wgm 2ZHRI0A0KH9rqvIh3mWckSOINCG8ayXSg0EgcdrtEGHskU9gO/VRKKcDRmaRuOu1 K8duCcsDjiXLxIQDWIBjV1Ux7ZdNs+uURSXoamoOSVTVqOJRR4hIrAh973euy+ba PPC2Un4ca/C3jZfZ/QY3rEFMMcIJqpCwfCrZ5/qu6jq3iezG2ze1mkdm7Uy8CuVB d/8tzTIse/gR8USZwJwQ =eaTr -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 18:41:38 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 39F6A3C9; Thu, 17 Jul 2014 18:41:38 +0000 (UTC) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) by mx1.freebsd.org (Postfix) with ESMTP id 11344245D; Thu, 17 Jul 2014 18:41:37 +0000 (UTC) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 301CD5A9F0B; Thu, 17 Jul 2014 18:41:37 +0000 (UTC) Date: Thu, 17 Jul 2014 18:41:37 +0000 From: Brooks Davis To: d@delphij.net Subject: Re: svn commit: r268804 - in head: bin/csh bin/ls bin/sh games/grdc gnu/lib/libreadline/readline gnu/usr.bin/gdb/gdb gnu/usr.bin/gdb/gdbtui gnu/usr.bin/gdb/kgdb gnu/usr.bin/texinfo/info kerberos5/usr.b... Message-ID: <20140717184137.GA5099@spindle.one-eyed-alien.net> References: <201407171824.s6HIOZpg020943@svn.freebsd.org> <53C81828.4080407@delphij.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vtzGhvizbBRQ85DL" Content-Disposition: inline In-Reply-To: <53C81828.4080407@delphij.net> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Brooks Davis , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 18:41:38 -0000 --vtzGhvizbBRQ85DL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 17, 2014 at 11:38:32AM -0700, Xin Li wrote: > On 07/17/14 11:24, Brooks Davis wrote: > > Author: brooks Date: Thu Jul 17 18:24:34 2014 New Revision: 268804=20 > > URL: http://svnweb.freebsd.org/changeset/base/268804 > >=20 > > Log: Replace all uses of libncurses and libtermcap with their wide > > character variants. This allows usable file system images (i.e. > > those with both a shell and an editor) to be created with only one > > copy of the curses library. > >=20 > > Exp-run: antoine PR: 189842 Discussed with: bapt Sponsored by: > > DARPA, AFRL >=20 > MFC? Not currently planned because it changes the dependency list of libedit and libreadline. Assuming we find on problems with ports it may be worth doing. -- Brooks --vtzGhvizbBRQ85DL Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlPIGOAACgkQXY6L6fI4GtSvVACfZjMRbgTw4DtoH9FBJoSuU04i Y4kAn1RAfXbPKGQoD7bZzotEMHQ4uN+K =PHWp -----END PGP SIGNATURE----- --vtzGhvizbBRQ85DL-- From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 18:58:31 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6BCF06FB; Thu, 17 Jul 2014 18:58:31 +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 58A4D2580; Thu, 17 Jul 2014 18:58:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6HIwVxl035951; Thu, 17 Jul 2014 18:58:31 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6HIwVJR035950; Thu, 17 Jul 2014 18:58:31 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201407171858.s6HIwVJR035950@svn.freebsd.org> From: "Justin T. Gibbs" Date: Thu, 17 Jul 2014 18:58:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r268805 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 18:58:31 -0000 Author: gibbs Date: Thu Jul 17 18:58:30 2014 New Revision: 268805 URL: http://svnweb.freebsd.org/changeset/base/268805 Log: Release royger from mentorship. Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Thu Jul 17 18:24:34 2014 (r268804) +++ svnadmin/conf/mentors Thu Jul 17 18:58:30 2014 (r268805) @@ -30,7 +30,6 @@ monthadar adrian odeds jhb Co-mentor: alfred peterj jhb Co-mentor: grog pkelsey jmallett -royger gibbs slm ken Co-mentor: scottl, ambrisko snb dwmalone venkat delphij Co-mentor: luigi, jhb From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 20:03:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6D8C7C46; Thu, 17 Jul 2014 20:03:53 +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 57E5C2BD9; Thu, 17 Jul 2014 20:03:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6HK3rYS068666; Thu, 17 Jul 2014 20:03:53 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6HK3qOD068663; Thu, 17 Jul 2014 20:03:52 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201407172003.s6HK3qOD068663@svn.freebsd.org> From: Alan Cox Date: Thu, 17 Jul 2014 20:03:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268806 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 20:03:53 -0000 Author: alc Date: Thu Jul 17 20:03:52 2014 New Revision: 268806 URL: http://svnweb.freebsd.org/changeset/base/268806 Log: Add a man page for the new function pmap_unwire(). Added: head/share/man/man9/pmap_unwire.9 (contents, props changed) Modified: head/share/man/man9/Makefile head/share/man/man9/pmap.9 Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Thu Jul 17 18:58:30 2014 (r268805) +++ head/share/man/man9/Makefile Thu Jul 17 20:03:52 2014 (r268806) @@ -218,6 +218,7 @@ MAN= accept_filter.9 \ pmap_release.9 \ pmap_remove.9 \ pmap_resident_count.9 \ + pmap_unwire.9 \ pmap_zero_page.9 \ printf.9 \ prison_check.9 \ Modified: head/share/man/man9/pmap.9 ============================================================================== --- head/share/man/man9/pmap.9 Thu Jul 17 18:58:30 2014 (r268805) +++ head/share/man/man9/pmap.9 Thu Jul 17 20:03:52 2014 (r268806) @@ -119,6 +119,7 @@ operation. .Xr pmap_remove_pages 9 , .Xr pmap_resident_count 9 , .Xr pmap_ts_referenced 9 , +.Xr pmap_unwire 9 , .Xr pmap_wired_count 9 , .Xr pmap_zero_area 9 , .Xr pmap_zero_idle 9 , Added: head/share/man/man9/pmap_unwire.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/pmap_unwire.9 Thu Jul 17 20:03:52 2014 (r268806) @@ -0,0 +1,66 @@ +.\" +.\" Copyright (c) 2014 Alan L. Cox +.\" 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$ +.\" +.Dd July 17, 2014 +.Dt PMAP_UNWIRE 9 +.Os +.Sh NAME +.Nm pmap_unwire +.Nd unwire a range of virtual pages +.Sh SYNOPSIS +.In sys/param.h +.In vm/vm.h +.In vm/pmap.h +.Ft void +.Fo pmap_unwire +.Fa "pmap_t pmap" "vm_offset_t start" "vm_offset_t end" +.Fc +.Sh DESCRIPTION +.Pp +The function +.Fn pmap_unwire +removes the wired attribute from each of the virtual-to-physical page mappings +within the virtual address range from +.Fa start +to +.Fa end +of the physical map +.Fa pmap . +Every valid mapping within that range is required to have the wired attribute +set. +Invalid mappings are ignored, since they cannot have the wired attribute set. +.Sh NOTES +Only the function +.Xr pmap_enter 9 +can be used to set the wired attribute of a virtual-to-physical page mapping. +.Sh SEE ALSO +.Xr pmap 9 , +.Xr pmap_enter 9 , +.Xr pmap_wired_count 9 +.Sh AUTHORS +This manual page was written by +.An Alan L. Cox Aq alc@rice.edu . From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 20:28:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4C702DB0; Thu, 17 Jul 2014 20:28:52 +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 38BBC2E41; Thu, 17 Jul 2014 20:28:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6HKSqa6079219; Thu, 17 Jul 2014 20:28:52 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6HKSp8p079217; Thu, 17 Jul 2014 20:28:51 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407172028.s6HKSp8p079217@svn.freebsd.org> From: Alexander Motin Date: Thu, 17 Jul 2014 20:28:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268807 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 20:28:52 -0000 Author: mav Date: Thu Jul 17 20:28:51 2014 New Revision: 268807 URL: http://svnweb.freebsd.org/changeset/base/268807 Log: Reduce per-LUN memory usage from 18MB to 1.8MB. CTL never had use for CA support code since SPI has gone, and there is no even frontends supporting that. But it still was reserving 256 bytes of memory per LUN per every possible initiator on every possible port. Wrap unused code with ifdef's in case somebody even need it. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_private.h Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Thu Jul 17 20:03:52 2014 (r268806) +++ head/sys/cam/ctl/ctl.c Thu Jul 17 20:28:51 2014 (r268807) @@ -4607,7 +4607,7 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft * Set the poweron UA for all initiators on this LUN only. */ for (i = 0; i < CTL_MAX_INITIATORS; i++) - lun->pending_sense[i].ua_pending = CTL_UA_POWERON; + lun->pending_ua[i] = CTL_UA_POWERON; /* * Now, before we insert this lun on the lun list, set the lun @@ -4615,7 +4615,7 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft */ STAILQ_FOREACH(nlun, &ctl_softc->lun_list, links) { for (i = 0; i < CTL_MAX_INITIATORS; i++) { - nlun->pending_sense[i].ua_pending |= CTL_UA_LUN_CHANGE; + nlun->pending_ua[i] |= CTL_UA_LUN_CHANGE; } } @@ -4756,7 +4756,7 @@ ctl_free_lun(struct ctl_lun *lun) STAILQ_FOREACH(nlun, &softc->lun_list, links) { for (i = 0; i < CTL_MAX_INITIATORS; i++) { - nlun->pending_sense[i].ua_pending |= CTL_UA_LUN_CHANGE; + nlun->pending_ua[i] |= CTL_UA_LUN_CHANGE; } } @@ -5135,7 +5135,7 @@ ctl_lun_capacity_changed(struct ctl_be_l mtx_lock(&lun->lun_lock); for (i = 0; i < CTL_MAX_INITIATORS; i++) - lun->pending_sense[i].ua_pending |= CTL_UA_CAPACITY_CHANGED; + lun->pending_ua[i] |= CTL_UA_CAPACITY_CHANGED; mtx_unlock(&lun->lun_lock); } @@ -6237,8 +6237,7 @@ ctl_control_page_handler(struct ctl_scsi if (i == initidx) continue; - lun->pending_sense[i].ua_pending |= - CTL_UA_MODE_CHANGE; + lun->pending_ua[i] |= CTL_UA_MODE_CHANGE; } } mtx_unlock(&lun->lun_lock); @@ -8003,12 +8002,11 @@ ctl_pro_preempt(struct ctl_softc *softc, if (!persis_offset && i pending_sense[i].ua_pending |= + lun->pending_ua[i] |= CTL_UA_REG_PREEMPT; else if (persis_offset && i >= persis_offset) - lun->pending_sense[i-persis_offset - ].ua_pending |= + lun->pending_ua[i-persis_offset] |= CTL_UA_REG_PREEMPT; lun->per_res[i].registered = 0; memset(&lun->per_res[i].res_key, 0, @@ -8090,13 +8088,10 @@ ctl_pro_preempt(struct ctl_softc *softc, sizeof(struct scsi_per_res_key)); lun->pr_key_count--; - if (!persis_offset - && i < CTL_MAX_INITIATORS) - lun->pending_sense[i].ua_pending |= - CTL_UA_REG_PREEMPT; - else if (persis_offset - && i >= persis_offset) - lun->pending_sense[i-persis_offset].ua_pending|= + if (!persis_offset && i < CTL_MAX_INITIATORS) + lun->pending_ua[i] |= CTL_UA_REG_PREEMPT; + else if (persis_offset && i >= persis_offset) + lun->pending_ua[i-persis_offset] |= CTL_UA_REG_PREEMPT; } if (!found) { @@ -8187,27 +8182,23 @@ ctl_pro_preempt(struct ctl_softc *softc, if (!persis_offset && i < CTL_MAX_INITIATORS) - lun->pending_sense[i - ].ua_pending |= + lun->pending_ua[i] |= CTL_UA_REG_PREEMPT; else if (persis_offset && i >= persis_offset) - lun->pending_sense[ - i-persis_offset].ua_pending |= + lun->pending_ua[i-persis_offset] |= CTL_UA_REG_PREEMPT; } else if (type != lun->res_type && (lun->res_type == SPR_TYPE_WR_EX_RO || lun->res_type ==SPR_TYPE_EX_AC_RO)){ if (!persis_offset && i < CTL_MAX_INITIATORS) - lun->pending_sense[i - ].ua_pending |= + lun->pending_ua[i] |= CTL_UA_RES_RELEASE; else if (persis_offset && i >= persis_offset) - lun->pending_sense[ - i-persis_offset - ].ua_pending |= + lun->pending_ua[ + i-persis_offset] |= CTL_UA_RES_RELEASE; } } @@ -8256,12 +8247,11 @@ ctl_pro_preempt(struct ctl_softc *softc, if (!persis_offset && i < CTL_MAX_INITIATORS) - lun->pending_sense[i].ua_pending |= + lun->pending_ua[i] |= CTL_UA_REG_PREEMPT; else if (persis_offset && i >= persis_offset) - lun->pending_sense[ - i-persis_offset].ua_pending |= + lun->pending_ua[i-persis_offset] |= CTL_UA_REG_PREEMPT; } @@ -8323,11 +8313,10 @@ ctl_pro_preempt_other(struct ctl_lun *lu if (!persis_offset && i < CTL_MAX_INITIATORS) - lun->pending_sense[i].ua_pending |= + lun->pending_ua[i] |= CTL_UA_REG_PREEMPT; else if (persis_offset && i >= persis_offset) - lun->pending_sense[i - - persis_offset].ua_pending |= + lun->pending_ua[i - persis_offset] |= CTL_UA_REG_PREEMPT; lun->per_res[i].registered = 0; memset(&lun->per_res[i].res_key, 0, @@ -8354,12 +8343,11 @@ ctl_pro_preempt_other(struct ctl_lun *lu if (!persis_offset && i < persis_offset) - lun->pending_sense[i].ua_pending |= + lun->pending_ua[i] |= CTL_UA_REG_PREEMPT; else if (persis_offset && i >= persis_offset) - lun->pending_sense[i - - persis_offset].ua_pending |= + lun->pending_ua[i - persis_offset] |= CTL_UA_REG_PREEMPT; } } @@ -8382,25 +8370,22 @@ ctl_pro_preempt_other(struct ctl_lun *lu lun->pr_key_count--; if (!persis_offset && i < CTL_MAX_INITIATORS) - lun->pending_sense[i].ua_pending |= + lun->pending_ua[i] |= CTL_UA_REG_PREEMPT; else if (persis_offset && i >= persis_offset) - lun->pending_sense[i - - persis_offset].ua_pending |= + lun->pending_ua[i - persis_offset] |= CTL_UA_REG_PREEMPT; } else if (msg->pr.pr_info.res_type != lun->res_type && (lun->res_type == SPR_TYPE_WR_EX_RO || lun->res_type == SPR_TYPE_EX_AC_RO)) { if (!persis_offset && i < persis_offset) - lun->pending_sense[i - ].ua_pending |= + lun->pending_ua[i] |= CTL_UA_RES_RELEASE; else if (persis_offset && i >= persis_offset) - lun->pending_sense[i - - persis_offset].ua_pending |= + lun->pending_ua[i - persis_offset] |= CTL_UA_RES_RELEASE; } } @@ -8617,8 +8602,7 @@ ctl_persistent_reserve_out(struct ctl_sc i+persis_offset].registered == 0) continue; - lun->pending_sense[i - ].ua_pending |= + lun->pending_ua[i] |= CTL_UA_RES_RELEASE; } } @@ -8776,7 +8760,7 @@ ctl_persistent_reserve_out(struct ctl_sc if (lun->per_res[i+persis_offset].registered == 0) continue; - lun->pending_sense[i].ua_pending |= + lun->pending_ua[i] |= CTL_UA_RES_RELEASE; } @@ -8811,11 +8795,11 @@ ctl_persistent_reserve_out(struct ctl_sc for (i=0; i < 2*CTL_MAX_INITIATORS; i++) if (lun->per_res[i].registered) { if (!persis_offset && i < CTL_MAX_INITIATORS) - lun->pending_sense[i].ua_pending |= + lun->pending_ua[i] |= CTL_UA_RES_PREEMPT; else if (persis_offset && i >= persis_offset) - lun->pending_sense[i-persis_offset - ].ua_pending |= CTL_UA_RES_PREEMPT; + lun->pending_ua[i-persis_offset] |= + CTL_UA_RES_PREEMPT; memset(&lun->per_res[i].res_key, 0, sizeof(struct scsi_per_res_key)); @@ -8913,8 +8897,7 @@ ctl_hndl_per_res_out_on_other_sc(union c persis_offset].registered == 0) continue; - lun->pending_sense[i - ].ua_pending |= + lun->pending_ua[i] |= CTL_UA_RES_RELEASE; } } @@ -8945,7 +8928,7 @@ ctl_hndl_per_res_out_on_other_sc(union c && lun->res_type != SPR_TYPE_WR_EX) { for (i = 0; i < CTL_MAX_INITIATORS; i++) if (lun->per_res[i+persis_offset].registered) - lun->pending_sense[i].ua_pending |= + lun->pending_ua[i] |= CTL_UA_RES_RELEASE; } @@ -8968,11 +8951,10 @@ ctl_hndl_per_res_out_on_other_sc(union c continue; if (!persis_offset && i < CTL_MAX_INITIATORS) - lun->pending_sense[i].ua_pending |= - CTL_UA_RES_PREEMPT; + lun->pending_ua[i] |= CTL_UA_RES_PREEMPT; else if (persis_offset && i >= persis_offset) - lun->pending_sense[i-persis_offset].ua_pending|= + lun->pending_ua[i-persis_offset] |= CTL_UA_RES_PREEMPT; memset(&lun->per_res[i].res_key, 0, sizeof(struct scsi_per_res_key)); @@ -9540,8 +9522,7 @@ ctl_report_luns(struct ctl_scsiio *ctsio */ if (request_lun != NULL) { mtx_lock(&lun->lun_lock); - lun->pending_sense[initidx].ua_pending &= - ~CTL_UA_LUN_CHANGE; + lun->pending_ua[initidx] &= ~CTL_UA_LUN_CHANGE; mtx_unlock(&lun->lun_lock); } } @@ -9643,6 +9624,7 @@ ctl_request_sense(struct ctl_scsiio *cts * Pending sense gets returned first, then pending unit attentions. */ mtx_lock(&lun->lun_lock); +#ifdef CTL_WITH_CA if (ctl_is_set(lun->have_ca, initidx)) { scsi_sense_data_type stored_format; @@ -9650,8 +9632,7 @@ ctl_request_sense(struct ctl_scsiio *cts * Check to see which sense format was used for the stored * sense data. */ - stored_format = scsi_sense_type( - &lun->pending_sense[initidx].sense); + stored_format = scsi_sense_type(&lun->pending_sense[initidx]); /* * If the user requested a different sense format than the @@ -9666,29 +9647,31 @@ ctl_request_sense(struct ctl_scsiio *cts if ((stored_format == SSD_TYPE_FIXED) && (sense_format == SSD_TYPE_DESC)) ctl_sense_to_desc((struct scsi_sense_data_fixed *) - &lun->pending_sense[initidx].sense, + &lun->pending_sense[initidx], (struct scsi_sense_data_desc *)sense_ptr); else if ((stored_format == SSD_TYPE_DESC) && (sense_format == SSD_TYPE_FIXED)) ctl_sense_to_fixed((struct scsi_sense_data_desc *) - &lun->pending_sense[initidx].sense, + &lun->pending_sense[initidx], (struct scsi_sense_data_fixed *)sense_ptr); else - memcpy(sense_ptr, &lun->pending_sense[initidx].sense, + memcpy(sense_ptr, &lun->pending_sense[initidx], ctl_min(sizeof(*sense_ptr), - sizeof(lun->pending_sense[initidx].sense))); + sizeof(lun->pending_sense[initidx]))); ctl_clear_mask(lun->have_ca, initidx); have_error = 1; - } else if (lun->pending_sense[initidx].ua_pending != CTL_UA_NONE) { + } else +#endif + if (lun->pending_ua[initidx] != CTL_UA_NONE) { ctl_ua_type ua_type; - ua_type = ctl_build_ua(lun->pending_sense[initidx].ua_pending, + ua_type = ctl_build_ua(lun->pending_ua[initidx], sense_ptr, sense_format); if (ua_type != CTL_UA_NONE) { have_error = 1; /* We're reporting this UA, so clear it */ - lun->pending_sense[initidx].ua_pending &= ~ua_type; + lun->pending_ua[initidx] &= ~ua_type; } } mtx_unlock(&lun->lun_lock); @@ -11304,7 +11287,7 @@ ctl_failover(void) * Build Unit Attention */ for (i = 0; i < CTL_MAX_INITIATORS; i++) { - lun->pending_sense[i].ua_pending |= + lun->pending_ua[i] |= CTL_UA_ASYM_ACC_CHANGE; } } else if (((lun->flags & CTL_LUN_PRIMARY_SC) == 0) @@ -11399,7 +11382,7 @@ ctl_failover(void) * Build Unit Attention */ for (i = 0; i < CTL_MAX_INITIATORS; i++) { - lun->pending_sense[i].ua_pending |= + lun->pending_ua[i] |= CTL_UA_ASYM_ACC_CHANGE; } } else { @@ -11499,6 +11482,7 @@ ctl_scsiio_precheck(struct ctl_softc *ct initidx = ctl_get_initindex(&ctsio->io_hdr.nexus); +#ifdef CTL_WITH_CA /* * If we've got a request sense, it'll clear the contingent * allegiance condition. Otherwise, if we have a CA condition for @@ -11508,6 +11492,7 @@ ctl_scsiio_precheck(struct ctl_softc *ct if ((ctsio->cdb[0] != REQUEST_SENSE) && (ctl_is_set(lun->have_ca, initidx))) ctl_clear_mask(lun->have_ca, initidx); +#endif /* * If the command has this flag set, it handles its own unit @@ -11534,7 +11519,7 @@ ctl_scsiio_precheck(struct ctl_softc *ct if ((entry->flags & CTL_CMD_FLAG_NO_SENSE) == 0) { ctl_ua_type ua_type; - ua_type = lun->pending_sense[initidx].ua_pending; + ua_type = lun->pending_ua[initidx]; if (ua_type != CTL_UA_NONE) { scsi_sense_data_type sense_format; @@ -11552,8 +11537,7 @@ ctl_scsiio_precheck(struct ctl_softc *ct ctsio->io_hdr.status = CTL_SCSI_ERROR | CTL_AUTOSENSE; ctsio->sense_len = SSD_FULL_SIZE; - lun->pending_sense[initidx].ua_pending &= - ~ua_type; + lun->pending_ua[initidx] &= ~ua_type; mtx_unlock(&lun->lun_lock); ctl_done((union ctl_io *)ctsio); return (retval); @@ -11848,7 +11832,7 @@ ctl_lun_reset(struct ctl_lun *lun, union for (i = 0; i < CTL_MAX_INITIATORS; i++) { if (initindex == i) continue; - lun->pending_sense[i].ua_pending |= ua_type; + lun->pending_ua[i] |= ua_type; } #endif @@ -11863,8 +11847,10 @@ ctl_lun_reset(struct ctl_lun *lun, union lun->flags &= ~CTL_LUN_RESERVED; for (i = 0; i < CTL_MAX_INITIATORS; i++) { +#ifdef CTL_WITH_CA ctl_clear_mask(lun->have_ca, i); - lun->pending_sense[i].ua_pending |= ua_type; +#endif + lun->pending_ua[i] |= ua_type; } mtx_unlock(&lun->lun_lock); @@ -11964,8 +11950,10 @@ ctl_i_t_nexus_reset(union ctl_io *io) ctl_abort_tasks_lun(lun, io->io_hdr.nexus.targ_port, io->io_hdr.nexus.initid.id, (io->io_hdr.flags & CTL_FLAG_FROM_OTHER_SC) != 0); +#ifdef CTL_WITH_CA ctl_clear_mask(lun->have_ca, initindex); - lun->pending_sense[initindex].ua_pending |= CTL_UA_I_T_NEXUS_LOSS; +#endif + lun->pending_ua[initindex] |= CTL_UA_I_T_NEXUS_LOSS; mtx_unlock(&lun->lun_lock); } mtx_unlock(&softc->ctl_lock); @@ -13647,6 +13635,7 @@ bailout: return (CTL_RETVAL_COMPLETE); } +#ifdef CTL_WITH_CA /* * Front end should call this if it doesn't do autosense. When the request * sense comes back in from the initiator, we'll dequeue this and send it. @@ -13694,8 +13683,8 @@ ctl_queue_sense(union ctl_io *io) goto bailout; } - memcpy(&lun->pending_sense[initidx].sense, &io->scsiio.sense_data, - ctl_min(sizeof(lun->pending_sense[initidx].sense), + memcpy(&lun->pending_sense[initidx], &io->scsiio.sense_data, + ctl_min(sizeof(lun->pending_sense[initidx]), sizeof(io->scsiio.sense_data))); ctl_set_mask(lun->have_ca, initidx); mtx_unlock(&lun->lun_lock); @@ -13707,6 +13696,7 @@ bailout: return (CTL_RETVAL_COMPLETE); } +#endif /* * Primary command inlet from frontend ports. All SCSI and task I/O Modified: head/sys/cam/ctl/ctl_private.h ============================================================================== --- head/sys/cam/ctl/ctl_private.h Thu Jul 17 20:03:52 2014 (r268806) +++ head/sys/cam/ctl/ctl_private.h Thu Jul 17 20:28:51 2014 (r268807) @@ -332,11 +332,6 @@ struct ctl_mode_pages { struct ctl_page_index index[CTL_NUM_MODE_PAGES]; }; -struct ctl_pending_sense { - ctl_ua_type ua_pending; - struct scsi_sense_data sense; -}; - struct ctl_lun_delay_info { ctl_delay_type datamove_type; uint32_t datamove_delay; @@ -393,8 +388,11 @@ struct ctl_lun { STAILQ_ENTRY(ctl_lun) links; STAILQ_ENTRY(ctl_lun) run_links; struct ctl_nexus rsv_nexus; +#ifdef CTL_WITH_CA uint32_t have_ca[CTL_MAX_INITIATORS >> 5]; - struct ctl_pending_sense pending_sense[CTL_MAX_INITIATORS]; + struct scsi_sense_data pending_sense[CTL_MAX_INITIATORS]; +#endif + ctl_ua_type pending_ua[CTL_MAX_INITIATORS]; struct ctl_mode_pages mode_pages; struct ctl_lun_io_stats stats; struct ctl_per_res_info per_res[2*CTL_MAX_INITIATORS]; @@ -402,7 +400,7 @@ struct ctl_lun { int pr_key_count; uint16_t pr_res_idx; uint8_t res_type; - uint8_t write_buffer[524288]; + uint8_t write_buffer[262144]; struct ctl_devid *lun_devid; TAILQ_HEAD(tpc_lists, tpc_list) tpc_lists; }; From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 21:16:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B06A82EA; Thu, 17 Jul 2014 21:16:53 +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 918782282; Thu, 17 Jul 2014 21:16:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6HLGr7V002661; Thu, 17 Jul 2014 21:16:53 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6HLGqXE002653; Thu, 17 Jul 2014 21:16:52 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201407172116.s6HLGqXE002653@svn.freebsd.org> From: Alexander Motin Date: Thu, 17 Jul 2014 21:16:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268808 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 21:16:53 -0000 Author: mav Date: Thu Jul 17 21:16:52 2014 New Revision: 268808 URL: http://svnweb.freebsd.org/changeset/base/268808 Log: Increase maximal number of SCSI ports in CTL from 32 to 128. After I gave each iSCSI target its own port, the old limit appeared to be not so big. This change almost proportionally increases per-LUN memory use, but it is still three times better then it was before r268807. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_io.h head/sys/cam/ctl/ctl_ioctl.h head/sys/cam/ctl/ctl_private.h head/sys/cam/ctl/ctl_tpc.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Thu Jul 17 20:28:51 2014 (r268807) +++ head/sys/cam/ctl/ctl.c Thu Jul 17 21:16:52 2014 (r268808) @@ -8208,8 +8208,7 @@ ctl_pro_preempt(struct ctl_softc *softc, && lun->res_type != SPR_TYPE_EX_AC_AR) lun->pr_res_idx = residx; else - lun->pr_res_idx = - CTL_PR_ALL_REGISTRANTS; + lun->pr_res_idx = CTL_PR_ALL_REGISTRANTS; persis_io.hdr.nexus = ctsio->io_hdr.nexus; persis_io.hdr.msg_type = CTL_MSG_PERS_ACTION; Modified: head/sys/cam/ctl/ctl_io.h ============================================================================== --- head/sys/cam/ctl/ctl_io.h Thu Jul 17 20:28:51 2014 (r268807) +++ head/sys/cam/ctl/ctl_io.h Thu Jul 17 21:16:52 2014 (r268808) @@ -407,7 +407,7 @@ struct ctl_pr_info { ctl_pr_action action; uint8_t sa_res_key[8]; uint8_t res_type; - uint16_t residx; + uint32_t residx; }; struct ctl_ha_msg_hdr { Modified: head/sys/cam/ctl/ctl_ioctl.h ============================================================================== --- head/sys/cam/ctl/ctl_ioctl.h Thu Jul 17 20:28:51 2014 (r268807) +++ head/sys/cam/ctl/ctl_ioctl.h Thu Jul 17 21:16:52 2014 (r268808) @@ -70,7 +70,7 @@ /* * Maximum number of ports registered at one time. */ -#define CTL_MAX_PORTS 32 +#define CTL_MAX_PORTS 128 /* * Maximum number of initiators we support. Modified: head/sys/cam/ctl/ctl_private.h ============================================================================== --- head/sys/cam/ctl/ctl_private.h Thu Jul 17 20:28:51 2014 (r268807) +++ head/sys/cam/ctl/ctl_private.h Thu Jul 17 21:16:52 2014 (r268808) @@ -355,8 +355,8 @@ struct ctl_per_res_info { uint8_t registered; }; -#define CTL_PR_ALL_REGISTRANTS 0xFFFF -#define CTL_PR_NO_RESERVATION 0xFFF0 +#define CTL_PR_ALL_REGISTRANTS 0xFFFFFFFF +#define CTL_PR_NO_RESERVATION 0xFFFFFFF0 struct ctl_devid { int len; @@ -398,7 +398,7 @@ struct ctl_lun { struct ctl_per_res_info per_res[2*CTL_MAX_INITIATORS]; unsigned int PRGeneration; int pr_key_count; - uint16_t pr_res_idx; + uint32_t pr_res_idx; uint8_t res_type; uint8_t write_buffer[262144]; struct ctl_devid *lun_devid; Modified: head/sys/cam/ctl/ctl_tpc.c ============================================================================== --- head/sys/cam/ctl/ctl_tpc.c Thu Jul 17 20:28:51 2014 (r268807) +++ head/sys/cam/ctl/ctl_tpc.c Thu Jul 17 21:16:52 2014 (r268808) @@ -89,7 +89,7 @@ struct tpc_io { struct tpc_list { uint8_t service_action; int init_port; - uint16_t init_idx; + uint32_t init_idx; uint32_t list_id; uint8_t flags; uint8_t *params; From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 21:58:41 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 40FAA953; Thu, 17 Jul 2014 21:58: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 2AD6725BC; Thu, 17 Jul 2014 21:58:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6HLwfeg021351; Thu, 17 Jul 2014 21:58:41 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6HLwM4O021220; Thu, 17 Jul 2014 21:58:22 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201407172158.s6HLwM4O021220@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 17 Jul 2014 21:58:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r268809 - in vendor/byacc/dist: . package package/debian package/pkgsrc test test/btyacc test/yacc X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 21:58:41 -0000 Author: bapt Date: Thu Jul 17 21:58:22 2014 New Revision: 268809 URL: http://svnweb.freebsd.org/changeset/base/268809 Log: import byacc 20140715 Deleted: vendor/byacc/dist/NOTES-btyacc-Changes vendor/byacc/dist/NOTES-btyacc-Disposition Modified: vendor/byacc/dist/CHANGES vendor/byacc/dist/MANIFEST vendor/byacc/dist/VERSION vendor/byacc/dist/aclocal.m4 vendor/byacc/dist/main.c vendor/byacc/dist/package/byacc.spec vendor/byacc/dist/package/debian/changelog vendor/byacc/dist/package/mingw-byacc.spec vendor/byacc/dist/package/pkgsrc/Makefile vendor/byacc/dist/test/btyacc/big_b.output vendor/byacc/dist/test/btyacc/big_l.output vendor/byacc/dist/test/btyacc/err_inherit1.error vendor/byacc/dist/test/btyacc/err_inherit2.error vendor/byacc/dist/test/btyacc/err_inherit3.error vendor/byacc/dist/test/btyacc/err_inherit4.error vendor/byacc/dist/test/btyacc/err_inherit5.error vendor/byacc/dist/test/btyacc/err_syntax1.error vendor/byacc/dist/test/btyacc/err_syntax10.error vendor/byacc/dist/test/btyacc/err_syntax11.error vendor/byacc/dist/test/btyacc/err_syntax12.error vendor/byacc/dist/test/btyacc/err_syntax13.error vendor/byacc/dist/test/btyacc/err_syntax14.error vendor/byacc/dist/test/btyacc/err_syntax15.error vendor/byacc/dist/test/btyacc/err_syntax16.error vendor/byacc/dist/test/btyacc/err_syntax17.error vendor/byacc/dist/test/btyacc/err_syntax18.error vendor/byacc/dist/test/btyacc/err_syntax19.error vendor/byacc/dist/test/btyacc/err_syntax2.error vendor/byacc/dist/test/btyacc/err_syntax21.error vendor/byacc/dist/test/btyacc/err_syntax22.error vendor/byacc/dist/test/btyacc/err_syntax23.error vendor/byacc/dist/test/btyacc/err_syntax24.error vendor/byacc/dist/test/btyacc/err_syntax25.error vendor/byacc/dist/test/btyacc/err_syntax26.error vendor/byacc/dist/test/btyacc/err_syntax27.error vendor/byacc/dist/test/btyacc/err_syntax3.error vendor/byacc/dist/test/btyacc/err_syntax4.error vendor/byacc/dist/test/btyacc/err_syntax5.error vendor/byacc/dist/test/btyacc/err_syntax6.error vendor/byacc/dist/test/btyacc/err_syntax7.error vendor/byacc/dist/test/btyacc/err_syntax7a.error vendor/byacc/dist/test/btyacc/err_syntax7b.error vendor/byacc/dist/test/btyacc/err_syntax8.error vendor/byacc/dist/test/btyacc/err_syntax8a.error vendor/byacc/dist/test/btyacc/err_syntax9.error vendor/byacc/dist/test/btyacc/help.output vendor/byacc/dist/test/btyacc/no_b_opt.output vendor/byacc/dist/test/btyacc/no_output2.output vendor/byacc/dist/test/btyacc/no_p_opt.output vendor/byacc/dist/test/btyacc/nostdin.output vendor/byacc/dist/test/run_test.sh vendor/byacc/dist/test/yacc/big_b.output vendor/byacc/dist/test/yacc/big_l.output vendor/byacc/dist/test/yacc/err_syntax1.error vendor/byacc/dist/test/yacc/err_syntax10.error vendor/byacc/dist/test/yacc/err_syntax11.error vendor/byacc/dist/test/yacc/err_syntax12.error vendor/byacc/dist/test/yacc/err_syntax13.error vendor/byacc/dist/test/yacc/err_syntax14.error vendor/byacc/dist/test/yacc/err_syntax15.error vendor/byacc/dist/test/yacc/err_syntax16.error vendor/byacc/dist/test/yacc/err_syntax17.error vendor/byacc/dist/test/yacc/err_syntax18.error vendor/byacc/dist/test/yacc/err_syntax19.error vendor/byacc/dist/test/yacc/err_syntax2.error vendor/byacc/dist/test/yacc/err_syntax21.error vendor/byacc/dist/test/yacc/err_syntax22.error vendor/byacc/dist/test/yacc/err_syntax23.error vendor/byacc/dist/test/yacc/err_syntax24.error vendor/byacc/dist/test/yacc/err_syntax25.error vendor/byacc/dist/test/yacc/err_syntax26.error vendor/byacc/dist/test/yacc/err_syntax27.error vendor/byacc/dist/test/yacc/err_syntax3.error vendor/byacc/dist/test/yacc/err_syntax4.error vendor/byacc/dist/test/yacc/err_syntax5.error vendor/byacc/dist/test/yacc/err_syntax6.error vendor/byacc/dist/test/yacc/err_syntax7.error vendor/byacc/dist/test/yacc/err_syntax7a.error vendor/byacc/dist/test/yacc/err_syntax7b.error vendor/byacc/dist/test/yacc/err_syntax8.error vendor/byacc/dist/test/yacc/err_syntax8a.error vendor/byacc/dist/test/yacc/err_syntax9.error vendor/byacc/dist/test/yacc/help.output vendor/byacc/dist/test/yacc/no_b_opt.output vendor/byacc/dist/test/yacc/no_output2.output vendor/byacc/dist/test/yacc/no_p_opt.output vendor/byacc/dist/test/yacc/nostdin.output Modified: vendor/byacc/dist/CHANGES ============================================================================== --- vendor/byacc/dist/CHANGES Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/CHANGES Thu Jul 17 21:58:22 2014 (r268809) @@ -1,3 +1,38 @@ +2014-07-15 Thomas E. Dickey + + * aclocal.m4: resync with my-autoconf (no change to configure script) + + * VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile: + bump + + * test/run_test.sh: + make top-level "make check" work again, by adding another step to filtering + the test results. + +2014-07-14 Thomas E. Dickey + + * test/run_test.sh: changes from Garrett Cooper's patch: + a) ensure that the script returns an error-code if there are differences + b) escape "." character in left side of sed expression for $YACC + c) ensure that $ifBTYACC has a value + + * test/btyacc/big_b.output, test/btyacc/big_l.output, test/btyacc/help.output, test/btyacc/no_b_opt.output, test/btyacc/no_output2.output, test/btyacc/no_p_opt.output, test/btyacc/nostdin.output: + regen (reminder by Garrett Cooper) + +2014-07-14 Garrett.Cooper + + * test/btyacc/err_inherit1.error, test/btyacc/err_inherit2.error, test/btyacc/err_inherit3.error, test/btyacc/err_inherit4.error, test/btyacc/err_inherit5.error, test/btyacc/err_syntax1.error, test/btyacc/err_syntax10.error, test/btyacc/err_syntax11.error, test/btyacc/err_syntax12.error, test/btyacc/err_syntax13.error, test/btyacc/err_syntax14.error, test/btyacc/err_syntax15.error, test/btyacc/err_syntax16.error, test/btyacc/err_syntax17.error, test/btyacc/err_syntax18.error, test/btyacc/err_syntax19.error, test/btyacc/err_syntax2.error, test/btyacc/err_syntax21.error, test/btyacc/err_syntax22.error, test/btyacc/err_syntax23.error, test/btyacc/err_syntax24.error, test/btyacc/err_syntax25.error, test/btyacc/err_syntax26.error, test/btyacc/err_syntax27.error, test/btyacc/err_syntax3.error, test/btyacc/err_syntax4.error, test/btyacc/err_syntax5.error, test/btyacc/err_syntax6.error, test/btyacc/err_syntax7.error, test/btyacc/err_syntax7a.error, test/btyacc/err_syntax7b.error, test/btya cc/err_syntax8.error, test/btyacc/err_syntax8a.error, test/btyacc/err_syntax9.error, test/yacc/err_syntax1.error, test/yacc/err_syntax10.error, test/yacc/err_syntax11.error, test/yacc/err_syntax12.error, test/yacc/err_syntax13.error, test/yacc/err_syntax14.error, test/yacc/err_syntax15.error, test/yacc/err_syntax16.error, test/yacc/err_syntax17.error, test/yacc/err_syntax18.error, test/yacc/err_syntax19.error, test/yacc/err_syntax2.error, test/yacc/err_syntax21.error, test/yacc/err_syntax22.error, test/yacc/err_syntax23.error, test/yacc/err_syntax24.error, test/yacc/err_syntax25.error, test/yacc/err_syntax26.error, test/yacc/err_syntax27.error, test/yacc/err_syntax3.error, test/yacc/err_syntax4.error, test/yacc/err_syntax5.error, test/yacc/err_syntax6.error, test/yacc/err_syntax7.error, test/yacc/err_syntax7a.error, test/yacc/err_syntax7b.error, test/yacc/err_syntax8.error, test/yacc/err_syntax8a.error, test/yacc/err_syntax9.error: + regen + +2014-05-27 Tom.Shields + + * main.c: remove obsolete -D option from usage message + +2014-05-27 Thomas E. Dickey + + * VERSION, package/byacc.spec, package/debian/changelog, test/yacc/big_b.output, test/yacc/big_l.output, test/yacc/help.output, test/yacc/no_b_opt.output, test/yacc/no_output2.output, test/yacc/no_p_opt.output, test/yacc/nostdin.output: + bump + 2014-04-22 Thomas E. Dickey * mstring.c: Modified: vendor/byacc/dist/MANIFEST ============================================================================== --- vendor/byacc/dist/MANIFEST Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/MANIFEST Thu Jul 17 21:58:22 2014 (r268809) @@ -1,4 +1,4 @@ -MANIFEST for byacc-20140422, version t20140422 +MANIFEST for byacc-20140715, version t20140715 -------------------------------------------------------------------------------- MANIFEST this file ACKNOWLEDGEMENTS original version of byacc - 1993 Modified: vendor/byacc/dist/VERSION ============================================================================== --- vendor/byacc/dist/VERSION Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/VERSION Thu Jul 17 21:58:22 2014 (r268809) @@ -1 +1 @@ -20140422 +20140715 Modified: vendor/byacc/dist/aclocal.m4 ============================================================================== --- vendor/byacc/dist/aclocal.m4 Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/aclocal.m4 Thu Jul 17 21:58:22 2014 (r268809) @@ -1,4 +1,4 @@ -dnl $Id: aclocal.m4,v 1.34 2014/04/06 19:16:18 tom Exp $ +dnl $Id: aclocal.m4,v 1.35 2014/07/15 19:38:05 tom Exp $ dnl Macros for byacc configure script (Thomas E. Dickey) dnl --------------------------------------------------------------------------- dnl Copyright 2004-2013,2014 Thomas E. Dickey @@ -28,7 +28,7 @@ dnl sale, use or other dealings in this dnl authorization. dnl --------------------------------------------------------------------------- dnl --------------------------------------------------------------------------- -dnl CF_ACVERSION_CHECK version: 4 updated: 2013/03/04 19:52:56 +dnl CF_ACVERSION_CHECK version: 5 updated: 2014/06/04 19:11:49 dnl ------------------ dnl Conditionally generate script according to whether we're using a given autoconf. dnl @@ -37,7 +37,7 @@ dnl $2 = code to use if AC_ACVERSION is dnl $3 = code to use if AC_ACVERSION is older than $1. define([CF_ACVERSION_CHECK], [ -ifdef([AC_ACVERSION], ,[m4_copy([m4_PACKAGE_VERSION],[AC_ACVERSION])])dnl +ifdef([AC_ACVERSION], ,[ifdef([AC_AUTOCONF_VERSION],[m4_copy([AC_AUTOCONF_VERSION],[AC_ACVERSION])],[m4_copy([m4_PACKAGE_VERSION],[AC_ACVERSION])])])dnl ifdef([m4_version_compare], [m4_if(m4_version_compare(m4_defn([AC_ACVERSION]), [$1]), -1, [$3], [$2])], [CF_ACVERSION_COMPARE( @@ -930,7 +930,7 @@ AC_PROG_AWK test -z "$AWK" && AC_MSG_ERROR(No awk program found) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PROG_CC version: 3 updated: 2012/10/06 15:31:55 +dnl CF_PROG_CC version: 4 updated: 2014/07/12 18:57:58 dnl ---------- dnl standard check for CC, plus followup sanity checks dnl $1 = optional parameter to pass to AC_PROG_CC to specify compiler name @@ -940,7 +940,7 @@ CF_GCC_VERSION CF_ACVERSION_CHECK(2.52, [AC_PROG_CC_STDC], [CF_ANSI_CC_REQD]) -CF_CC_ENV_FLAGS +CF_CC_ENV_FLAGS ])dnl dnl --------------------------------------------------------------------------- dnl CF_PROG_LINT version: 2 updated: 2009/08/12 04:43:14 Modified: vendor/byacc/dist/main.c ============================================================================== --- vendor/byacc/dist/main.c Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/main.c Thu Jul 17 21:58:22 2014 (r268809) @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.50 2014/04/22 23:34:47 tom Exp $ */ +/* $Id: main.c,v 1.51 2014/05/28 02:01:55 Tom.Shields Exp $ */ #include #ifndef _WIN32 @@ -208,7 +208,6 @@ usage(void) ," -b file_prefix set filename prefix (default \"y.\")" ," -B create a backtracking parser" ," -d write definitions (" DEFINES_SUFFIX ")" - ," -D enable value stack memory reclamation" ," -i write interface (y.tab.i)" ," -g write a graphical description" ," -l suppress #line directives" Modified: vendor/byacc/dist/package/byacc.spec ============================================================================== --- vendor/byacc/dist/package/byacc.spec Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/package/byacc.spec Thu Jul 17 21:58:22 2014 (r268809) @@ -1,8 +1,8 @@ Summary: byacc - public domain Berkeley LALR Yacc parser generator %define AppProgram byacc -%define AppVersion 20140422 +%define AppVersion 20140715 %define UseProgram yacc -# $XTermId: byacc.spec,v 1.20 2014/04/22 08:13:20 tom Exp $ +# $XTermId: byacc.spec,v 1.22 2014/07/15 19:36:54 tom Exp $ Name: %{AppProgram} Version: %{AppVersion} Release: 1 Modified: vendor/byacc/dist/package/debian/changelog ============================================================================== --- vendor/byacc/dist/package/debian/changelog Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/package/debian/changelog Thu Jul 17 21:58:22 2014 (r268809) @@ -1,3 +1,15 @@ +byacc (20140715) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey Tue, 15 Jul 2014 15:36:54 -0400 + +byacc (20140527) unstable; urgency=low + + * remove obsolete option from usage message + + -- Thomas E. Dickey Tue, 27 May 2014 22:01:55 -0400 + byacc (20140422) unstable; urgency=low * maintenance updates Modified: vendor/byacc/dist/package/mingw-byacc.spec ============================================================================== --- vendor/byacc/dist/package/mingw-byacc.spec Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/package/mingw-byacc.spec Thu Jul 17 21:58:22 2014 (r268809) @@ -1,8 +1,8 @@ Summary: byacc - public domain Berkeley LALR Yacc parser generator %define AppProgram byacc -%define AppVersion 20140422 +%define AppVersion 20140715 %define UseProgram yacc -# $XTermId: mingw-byacc.spec,v 1.3 2014/04/22 08:13:20 tom Exp $ +# $XTermId: mingw-byacc.spec,v 1.4 2014/07/15 19:36:54 tom Exp $ Name: %{AppProgram} Version: %{AppVersion} Release: 1 Modified: vendor/byacc/dist/package/pkgsrc/Makefile ============================================================================== --- vendor/byacc/dist/package/pkgsrc/Makefile Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/package/pkgsrc/Makefile Thu Jul 17 21:58:22 2014 (r268809) @@ -1,7 +1,7 @@ # $NetBSD: Makefile,v 1.9 2008/07/24 17:13:00 tonnerre Exp $ # -DISTNAME= byacc-20140422 +DISTNAME= byacc-20140715 PKGREVISION= 1 CATEGORIES= devel MASTER_SITES= ftp://invisible-island.net/byacc/ Modified: vendor/byacc/dist/test/btyacc/big_b.output ============================================================================== --- vendor/byacc/dist/test/btyacc/big_b.output Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/big_b.output Thu Jul 17 21:58:22 2014 (r268809) @@ -4,7 +4,6 @@ Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives Modified: vendor/byacc/dist/test/btyacc/big_l.output ============================================================================== --- vendor/byacc/dist/test/btyacc/big_l.output Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/big_l.output Thu Jul 17 21:58:22 2014 (r268809) @@ -4,7 +4,6 @@ Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives Modified: vendor/byacc/dist/test/btyacc/err_inherit1.error ============================================================================== --- vendor/byacc/dist/test/btyacc/err_inherit1.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/err_inherit1.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1,3 +1,3 @@ -YACC: e - line 64 of "./test/err_inherit1.y", unterminated argument list +YACC: e - line 64 of "./err_inherit1.y", unterminated argument list namelist($c, $t ^ Modified: vendor/byacc/dist/test/btyacc/err_inherit2.error ============================================================================== --- vendor/byacc/dist/test/btyacc/err_inherit2.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/err_inherit2.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1,5 +1,5 @@ -YACC: w - line 64 of "./test/err_inherit2.y", number of arguments of namelist doesn't agree with previous declaration -YACC: w - line 64 of "./test/err_inherit2.y", type of argument 1 to namelist doesn't agree with previous declaration -YACC: e - line 64 of "./test/err_inherit2.y", bad formal argument list +YACC: w - line 64 of "./err_inherit2.y", number of arguments of namelist doesn't agree with previous declaration +YACC: w - line 64 of "./err_inherit2.y", type of argument 1 to namelist doesn't agree with previous declaration +YACC: e - line 64 of "./err_inherit2.y", bad formal argument list namelist($c, $t, extra): namelist NAME ^ Modified: vendor/byacc/dist/test/btyacc/err_inherit3.error ============================================================================== --- vendor/byacc/dist/test/btyacc/err_inherit3.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/err_inherit3.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1,23 +1,23 @@ -YACC: w - line 64 of "./test/err_inherit3.y", number of arguments of namelist doesn't agree with previous declaration -YACC: w - line 64 of "./test/err_inherit3.y", wrong number of arguments for namelist +YACC: w - line 64 of "./err_inherit3.y", number of arguments of namelist doesn't agree with previous declaration +YACC: w - line 64 of "./err_inherit3.y", wrong number of arguments for namelist namelist: namelist($c) NAME ^ -YACC: w - line 64 of "./test/err_inherit3.y", unknown argument $c -YACC: w - line 64 of "./test/err_inherit3.y", untyped argument $c -YACC: w - line 65 of "./test/err_inherit3.y", unknown argument $t +YACC: w - line 64 of "./err_inherit3.y", unknown argument $c +YACC: w - line 64 of "./err_inherit3.y", untyped argument $c +YACC: w - line 65 of "./err_inherit3.y", unknown argument $t { $$->s = mksymbol($t, $c, $2); ^ -YACC: w - line 65 of "./test/err_inherit3.y", unknown argument $c +YACC: w - line 65 of "./err_inherit3.y", unknown argument $c { $$->s = mksymbol($t, $c, $2); ^ -YACC: w - line 69 of "./test/err_inherit3.y", unknown argument $t +YACC: w - line 69 of "./err_inherit3.y", unknown argument $t { $$->s = mksymbol($t, $c, $1); ^ -YACC: w - line 69 of "./test/err_inherit3.y", untyped argument $t -YACC: w - line 69 of "./test/err_inherit3.y", unknown argument $c +YACC: w - line 69 of "./err_inherit3.y", untyped argument $t +YACC: w - line 69 of "./err_inherit3.y", unknown argument $c { $$->s = mksymbol($t, $c, $1); ^ -YACC: w - line 69 of "./test/err_inherit3.y", untyped argument $c -YACC: w - line 0 of "./test/err_inherit3.y", start symbol declaration requires arguments +YACC: w - line 69 of "./err_inherit3.y", untyped argument $c +YACC: w - line 0 of "./err_inherit3.y", start symbol declaration requires arguments YACC: 1 rule never reduced YACC: 3 shift/reduce conflicts. Modified: vendor/byacc/dist/test/btyacc/err_inherit4.error ============================================================================== --- vendor/byacc/dist/test/btyacc/err_inherit4.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/err_inherit4.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1,13 +1,13 @@ -YACC: w - line 32 of "./test/err_inherit4.y", destructor redeclared +YACC: w - line 32 of "./err_inherit4.y", destructor redeclared %destructor { ^ -YACC: w - line 77 of "./test/err_inherit4.y", wrong number of default arguments for namelist +YACC: w - line 77 of "./err_inherit4.y", wrong number of default arguments for namelist { $$ = $1; @$ = @2; } ^ -YACC: w - line 77 of "./test/err_inherit4.y", wrong type for default argument 2 to namelist +YACC: w - line 77 of "./err_inherit4.y", wrong type for default argument 2 to namelist { $$ = $1; @$ = @2; } ^ -YACC: w - line 77 of "./test/err_inherit4.y", wrong type for default argument 1 to namelist +YACC: w - line 77 of "./err_inherit4.y", wrong type for default argument 1 to namelist { $$ = $1; @$ = @2; } ^ -YACC: w - line 77 of "./test/err_inherit4.y", @2 references beyond the end of the current rule +YACC: w - line 77 of "./err_inherit4.y", @2 references beyond the end of the current rule Modified: vendor/byacc/dist/test/btyacc/err_inherit5.error ============================================================================== --- vendor/byacc/dist/test/btyacc/err_inherit5.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/err_inherit5.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1 +1 @@ -YACC: e - line 74 of "./test/err_inherit5.y", illegal @$ or @N reference +YACC: e - line 74 of "./err_inherit5.y", illegal @$ or @N reference Modified: vendor/byacc/dist/test/btyacc/err_syntax1.error ============================================================================== --- vendor/byacc/dist/test/btyacc/err_syntax1.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/err_syntax1.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1,3 +1,3 @@ -YACC: e - line 1 of "./test/err_syntax1.y", syntax error +YACC: e - line 1 of "./err_syntax1.y", syntax error ?% { ^ Modified: vendor/byacc/dist/test/btyacc/err_syntax10.error ============================================================================== --- vendor/byacc/dist/test/btyacc/err_syntax10.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/err_syntax10.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1,3 +1,3 @@ -YACC: w - line 7 of "./test/err_syntax10.y", the type of '(' has been redeclared -YACC: w - line 7 of "./test/err_syntax10.y", the type of '*' has been redeclared -YACC: w - line 7 of "./test/err_syntax10.y", the type of '&' has been redeclared +YACC: w - line 7 of "./err_syntax10.y", the type of '(' has been redeclared +YACC: w - line 7 of "./err_syntax10.y", the type of '*' has been redeclared +YACC: w - line 7 of "./err_syntax10.y", the type of '&' has been redeclared Modified: vendor/byacc/dist/test/btyacc/err_syntax11.error ============================================================================== --- vendor/byacc/dist/test/btyacc/err_syntax11.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/err_syntax11.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1 +1 @@ -YACC: w - line 7 of "./test/err_syntax11.y", the precedence of '|' has been redeclared +YACC: w - line 7 of "./err_syntax11.y", the precedence of '|' has been redeclared Modified: vendor/byacc/dist/test/btyacc/err_syntax12.error ============================================================================== --- vendor/byacc/dist/test/btyacc/err_syntax12.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/err_syntax12.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1 +1 @@ -YACC: w - line 7 of "./test/err_syntax12.y", the value of text has been redeclared +YACC: w - line 7 of "./err_syntax12.y", the value of text has been redeclared Modified: vendor/byacc/dist/test/btyacc/err_syntax13.error ============================================================================== --- vendor/byacc/dist/test/btyacc/err_syntax13.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/err_syntax13.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1 +1 @@ -YACC: e - line 7 of "./test/err_syntax13.y", the start symbol text is a token +YACC: e - line 7 of "./err_syntax13.y", the start symbol text is a token Modified: vendor/byacc/dist/test/btyacc/err_syntax14.error ============================================================================== --- vendor/byacc/dist/test/btyacc/err_syntax14.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/err_syntax14.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1,2 +1,2 @@ -YACC: w - line 7 of "./test/err_syntax14.y", the start symbol has been redeclared +YACC: w - line 7 of "./err_syntax14.y", the start symbol has been redeclared YACC: e - the start symbol text2 is undefined Modified: vendor/byacc/dist/test/btyacc/err_syntax15.error ============================================================================== --- vendor/byacc/dist/test/btyacc/err_syntax15.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/err_syntax15.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1 +1 @@ -YACC: e - line 9 of "./test/err_syntax15.y", no grammar has been specified +YACC: e - line 9 of "./err_syntax15.y", no grammar has been specified Modified: vendor/byacc/dist/test/btyacc/err_syntax16.error ============================================================================== --- vendor/byacc/dist/test/btyacc/err_syntax16.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/err_syntax16.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1 +1 @@ -YACC: e - line 14 of "./test/err_syntax16.y", a token appears on the lhs of a production +YACC: e - line 14 of "./err_syntax16.y", a token appears on the lhs of a production Modified: vendor/byacc/dist/test/btyacc/err_syntax17.error ============================================================================== --- vendor/byacc/dist/test/btyacc/err_syntax17.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/err_syntax17.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1,3 +1,3 @@ -YACC: e - line 8 of "./test/err_syntax17.y", unterminated action +YACC: e - line 8 of "./err_syntax17.y", unterminated action S: { error ^ Modified: vendor/byacc/dist/test/btyacc/err_syntax18.error ============================================================================== --- vendor/byacc/dist/test/btyacc/err_syntax18.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/err_syntax18.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1 +1 @@ -YACC: w - line 9 of "./test/err_syntax18.y", $4 references beyond the end of the current rule +YACC: w - line 9 of "./err_syntax18.y", $4 references beyond the end of the current rule Modified: vendor/byacc/dist/test/btyacc/err_syntax19.error ============================================================================== --- vendor/byacc/dist/test/btyacc/err_syntax19.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/err_syntax19.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1,3 +1,3 @@ -YACC: e - line 9 of "./test/err_syntax19.y", illegal $-name +YACC: e - line 9 of "./err_syntax19.y", illegal $-name { $$ = $; } ^ Modified: vendor/byacc/dist/test/btyacc/err_syntax2.error ============================================================================== --- vendor/byacc/dist/test/btyacc/err_syntax2.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/err_syntax2.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1,3 +1,3 @@ -YACC: e - line 1 of "./test/err_syntax2.y", unmatched /* +YACC: e - line 1 of "./err_syntax2.y", unmatched /* %{ /* ^ Modified: vendor/byacc/dist/test/btyacc/err_syntax21.error ============================================================================== --- vendor/byacc/dist/test/btyacc/err_syntax21.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/err_syntax21.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1 +1 @@ -YACC: e - line 12 of "./test/err_syntax21.y", $0 is untyped +YACC: e - line 12 of "./err_syntax21.y", $0 is untyped Modified: vendor/byacc/dist/test/btyacc/err_syntax22.error ============================================================================== --- vendor/byacc/dist/test/btyacc/err_syntax22.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/err_syntax22.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1 +1 @@ -YACC: e - line 17 of "./test/err_syntax22.y", $2 (recur) is untyped +YACC: e - line 17 of "./err_syntax22.y", $2 (recur) is untyped Modified: vendor/byacc/dist/test/btyacc/err_syntax23.error ============================================================================== --- vendor/byacc/dist/test/btyacc/err_syntax23.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/err_syntax23.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1 +1 @@ -YACC: e - line 18 of "./test/err_syntax23.y", $$ is untyped +YACC: e - line 18 of "./err_syntax23.y", $$ is untyped Modified: vendor/byacc/dist/test/btyacc/err_syntax24.error ============================================================================== --- vendor/byacc/dist/test/btyacc/err_syntax24.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/err_syntax24.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1,2 +1,2 @@ -YACC: w - line 21 of "./test/err_syntax24.y", the default action assigns an undefined value to $$ -YACC: e - line 22 of "./test/err_syntax24.y", $$ is untyped +YACC: w - line 21 of "./err_syntax24.y", the default action assigns an undefined value to $$ +YACC: e - line 22 of "./err_syntax24.y", $$ is untyped Modified: vendor/byacc/dist/test/btyacc/err_syntax25.error ============================================================================== --- vendor/byacc/dist/test/btyacc/err_syntax25.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/err_syntax25.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1,3 +1,3 @@ -YACC: e - line 11 of "./test/err_syntax25.y", too many %union declarations +YACC: e - line 11 of "./err_syntax25.y", too many %union declarations %union { ^ Modified: vendor/byacc/dist/test/btyacc/err_syntax26.error ============================================================================== --- vendor/byacc/dist/test/btyacc/err_syntax26.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/err_syntax26.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1 +1 @@ -YACC: e - line 6 of "./test/err_syntax26.y", unexpected end-of-file +YACC: e - line 6 of "./err_syntax26.y", unexpected end-of-file Modified: vendor/byacc/dist/test/btyacc/err_syntax27.error ============================================================================== --- vendor/byacc/dist/test/btyacc/err_syntax27.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/err_syntax27.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1 +1 @@ -YACC: e - line 3 of "./test/err_syntax27.y", missing '}' +YACC: e - line 3 of "./err_syntax27.y", missing '}' Modified: vendor/byacc/dist/test/btyacc/err_syntax3.error ============================================================================== --- vendor/byacc/dist/test/btyacc/err_syntax3.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/err_syntax3.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1,3 +1,3 @@ -YACC: e - line 6 of "./test/err_syntax3.y", unterminated string +YACC: e - line 6 of "./err_syntax3.y", unterminated string %token '(' '*' '& ^ Modified: vendor/byacc/dist/test/btyacc/err_syntax4.error ============================================================================== --- vendor/byacc/dist/test/btyacc/err_syntax4.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/err_syntax4.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1,3 +1,3 @@ -YACC: e - line 1 of "./test/err_syntax4.y", unmatched %{ +YACC: e - line 1 of "./err_syntax4.y", unmatched %{ %{ ^ Modified: vendor/byacc/dist/test/btyacc/err_syntax5.error ============================================================================== --- vendor/byacc/dist/test/btyacc/err_syntax5.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/err_syntax5.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1,3 +1,3 @@ -YACC: e - line 6 of "./test/err_syntax5.y", unterminated %union declaration +YACC: e - line 6 of "./err_syntax5.y", unterminated %union declaration %union { ^ Modified: vendor/byacc/dist/test/btyacc/err_syntax6.error ============================================================================== --- vendor/byacc/dist/test/btyacc/err_syntax6.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/err_syntax6.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1,3 +1,3 @@ -YACC: e - line 6 of "./test/err_syntax6.y", illegal tag +YACC: e - line 6 of "./err_syntax6.y", illegal tag %token '\777' ^ Modified: vendor/byacc/dist/test/btyacc/err_syntax7a.error ============================================================================== --- vendor/byacc/dist/test/btyacc/err_syntax7a.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/err_syntax7a.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1,3 +1,3 @@ -YACC: e - line 6 of "./test/err_syntax7a.y", illegal character +YACC: e - line 6 of "./err_syntax7a.y", illegal character %token '\xfff' ^ Modified: vendor/byacc/dist/test/btyacc/err_syntax7b.error ============================================================================== --- vendor/byacc/dist/test/btyacc/err_syntax7b.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/err_syntax7b.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1,3 +1,3 @@ -YACC: e - line 6 of "./test/err_syntax7b.y", illegal character +YACC: e - line 6 of "./err_syntax7b.y", illegal character %token '\x.' ^ Modified: vendor/byacc/dist/test/btyacc/err_syntax8.error ============================================================================== --- vendor/byacc/dist/test/btyacc/err_syntax8.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/err_syntax8.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1 +1 @@ -YACC: e - line 6 of "./test/err_syntax8.y", illegal use of reserved symbol . +YACC: e - line 6 of "./err_syntax8.y", illegal use of reserved symbol . Modified: vendor/byacc/dist/test/btyacc/err_syntax8a.error ============================================================================== --- vendor/byacc/dist/test/btyacc/err_syntax8a.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/err_syntax8a.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1 +1 @@ -YACC: e - line 6 of "./test/err_syntax8a.y", illegal use of reserved symbol $$123 +YACC: e - line 6 of "./err_syntax8a.y", illegal use of reserved symbol $$123 Modified: vendor/byacc/dist/test/btyacc/err_syntax9.error ============================================================================== --- vendor/byacc/dist/test/btyacc/err_syntax9.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/err_syntax9.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1 +1 @@ -YACC: e - line 7 of "./test/err_syntax9.y", the start symbol text cannot be declared to be a token +YACC: e - line 7 of "./err_syntax9.y", the start symbol text cannot be declared to be a token Modified: vendor/byacc/dist/test/btyacc/help.output ============================================================================== --- vendor/byacc/dist/test/btyacc/help.output Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/help.output Thu Jul 17 21:58:22 2014 (r268809) @@ -4,7 +4,6 @@ Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives Modified: vendor/byacc/dist/test/btyacc/no_b_opt.output ============================================================================== --- vendor/byacc/dist/test/btyacc/no_b_opt.output Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/no_b_opt.output Thu Jul 17 21:58:22 2014 (r268809) @@ -4,7 +4,6 @@ Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives Modified: vendor/byacc/dist/test/btyacc/no_output2.output ============================================================================== --- vendor/byacc/dist/test/btyacc/no_output2.output Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/no_output2.output Thu Jul 17 21:58:22 2014 (r268809) @@ -4,7 +4,6 @@ Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives Modified: vendor/byacc/dist/test/btyacc/no_p_opt.output ============================================================================== --- vendor/byacc/dist/test/btyacc/no_p_opt.output Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/no_p_opt.output Thu Jul 17 21:58:22 2014 (r268809) @@ -4,7 +4,6 @@ Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives Modified: vendor/byacc/dist/test/btyacc/nostdin.output ============================================================================== --- vendor/byacc/dist/test/btyacc/nostdin.output Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/btyacc/nostdin.output Thu Jul 17 21:58:22 2014 (r268809) @@ -4,7 +4,6 @@ Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives Modified: vendor/byacc/dist/test/run_test.sh ============================================================================== --- vendor/byacc/dist/test/run_test.sh Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/run_test.sh Thu Jul 17 21:58:22 2014 (r268809) @@ -1,7 +1,9 @@ #!/bin/sh -# $Id: run_test.sh,v 1.22 2014/04/09 11:00:45 tom Exp $ +# $Id: run_test.sh,v 1.24 2014/07/15 19:21:10 tom Exp $ # vi:ts=4 sw=4: +errors=0 + # NEW is the file created by the testcase # REF is the reference file against which to compare test_diffs() { @@ -11,13 +13,15 @@ test_diffs() { if test ! -f $CMP then echo "...not found $CMP" + errors=1 else sed -e s,$NEW,$REF, \ - -e "s%$YACC%YACC%" \ + -e "s%$YACC_escaped%YACC%" \ -e '/YYPATCH/s/[0-9][0-9]*/"yyyymmdd"/' \ -e '/#define YYPATCH/s/PATCH/CHECK/' \ -e 's,#line \([1-9][0-9]*\) "'$REF_DIR'/,#line \1 ",' \ -e 's,#line \([1-9][0-9]*\) "'$TEST_DIR'/,#line \1 ",' \ + -e 's,\(YACC:.* line [0-9][0-9]* of "\)'$TEST_DIR/',\1./,' \ < $CMP >$tmpfile \ && mv $tmpfile $CMP if test ! -f $REF @@ -31,6 +35,7 @@ test_diffs() { else echo "...diff $REF" diff -u $REF $CMP + errors=1 fi fi } @@ -62,10 +67,11 @@ else fi YACC=$PROG_DIR/yacc +YACC_escaped=`echo "$PROG_DIR/yacc" | sed -e 's/\./\\\./g'` tmpfile=temp$$ -ifBTYACC=`fgrep -l 'define YYBTYACC' config.h > /dev/null; test $? != 0; echo $?` +ifBTYACC=`fgrep -l 'define YYBTYACC' $PROG_DIR/config.h > /dev/null; test $? != 0; echo $?` if test $ifBTYACC = 0; then REF_DIR=${TEST_DIR}/yacc @@ -236,3 +242,5 @@ do ;; esac done + +exit $errors Modified: vendor/byacc/dist/test/yacc/big_b.output ============================================================================== --- vendor/byacc/dist/test/yacc/big_b.output Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/yacc/big_b.output Thu Jul 17 21:58:22 2014 (r268809) @@ -5,7 +5,6 @@ Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives Modified: vendor/byacc/dist/test/yacc/big_l.output ============================================================================== --- vendor/byacc/dist/test/yacc/big_l.output Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/yacc/big_l.output Thu Jul 17 21:58:22 2014 (r268809) @@ -5,7 +5,6 @@ Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives Modified: vendor/byacc/dist/test/yacc/err_syntax1.error ============================================================================== --- vendor/byacc/dist/test/yacc/err_syntax1.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/yacc/err_syntax1.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1,3 +1,3 @@ -YACC: e - line 1 of "./test/err_syntax1.y", syntax error +YACC: e - line 1 of "./err_syntax1.y", syntax error ?% { ^ Modified: vendor/byacc/dist/test/yacc/err_syntax10.error ============================================================================== --- vendor/byacc/dist/test/yacc/err_syntax10.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/yacc/err_syntax10.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1,3 +1,3 @@ -YACC: w - line 7 of "./test/err_syntax10.y", the type of '(' has been redeclared -YACC: w - line 7 of "./test/err_syntax10.y", the type of '*' has been redeclared -YACC: w - line 7 of "./test/err_syntax10.y", the type of '&' has been redeclared +YACC: w - line 7 of "./err_syntax10.y", the type of '(' has been redeclared +YACC: w - line 7 of "./err_syntax10.y", the type of '*' has been redeclared +YACC: w - line 7 of "./err_syntax10.y", the type of '&' has been redeclared Modified: vendor/byacc/dist/test/yacc/err_syntax11.error ============================================================================== --- vendor/byacc/dist/test/yacc/err_syntax11.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/yacc/err_syntax11.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1 +1 @@ -YACC: w - line 7 of "./test/err_syntax11.y", the precedence of '|' has been redeclared +YACC: w - line 7 of "./err_syntax11.y", the precedence of '|' has been redeclared Modified: vendor/byacc/dist/test/yacc/err_syntax12.error ============================================================================== --- vendor/byacc/dist/test/yacc/err_syntax12.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/yacc/err_syntax12.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1 +1 @@ -YACC: w - line 7 of "./test/err_syntax12.y", the value of text has been redeclared +YACC: w - line 7 of "./err_syntax12.y", the value of text has been redeclared Modified: vendor/byacc/dist/test/yacc/err_syntax13.error ============================================================================== --- vendor/byacc/dist/test/yacc/err_syntax13.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/yacc/err_syntax13.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1 +1 @@ -YACC: e - line 7 of "./test/err_syntax13.y", the start symbol text is a token +YACC: e - line 7 of "./err_syntax13.y", the start symbol text is a token Modified: vendor/byacc/dist/test/yacc/err_syntax14.error ============================================================================== --- vendor/byacc/dist/test/yacc/err_syntax14.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/yacc/err_syntax14.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1,2 +1,2 @@ -YACC: w - line 7 of "./test/err_syntax14.y", the start symbol has been redeclared +YACC: w - line 7 of "./err_syntax14.y", the start symbol has been redeclared YACC: e - the start symbol text2 is undefined Modified: vendor/byacc/dist/test/yacc/err_syntax15.error ============================================================================== --- vendor/byacc/dist/test/yacc/err_syntax15.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/yacc/err_syntax15.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1 +1 @@ -YACC: e - line 9 of "./test/err_syntax15.y", no grammar has been specified +YACC: e - line 9 of "./err_syntax15.y", no grammar has been specified Modified: vendor/byacc/dist/test/yacc/err_syntax16.error ============================================================================== --- vendor/byacc/dist/test/yacc/err_syntax16.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/yacc/err_syntax16.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1 +1 @@ -YACC: e - line 14 of "./test/err_syntax16.y", a token appears on the lhs of a production +YACC: e - line 14 of "./err_syntax16.y", a token appears on the lhs of a production Modified: vendor/byacc/dist/test/yacc/err_syntax17.error ============================================================================== --- vendor/byacc/dist/test/yacc/err_syntax17.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/yacc/err_syntax17.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1,3 +1,3 @@ -YACC: e - line 8 of "./test/err_syntax17.y", unterminated action +YACC: e - line 8 of "./err_syntax17.y", unterminated action S: { error ^ Modified: vendor/byacc/dist/test/yacc/err_syntax18.error ============================================================================== --- vendor/byacc/dist/test/yacc/err_syntax18.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/yacc/err_syntax18.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1 +1 @@ -YACC: w - line 9 of "./test/err_syntax18.y", $4 references beyond the end of the current rule +YACC: w - line 9 of "./err_syntax18.y", $4 references beyond the end of the current rule Modified: vendor/byacc/dist/test/yacc/err_syntax19.error ============================================================================== --- vendor/byacc/dist/test/yacc/err_syntax19.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/yacc/err_syntax19.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1,3 +1,3 @@ -YACC: e - line 9 of "./test/err_syntax19.y", illegal $-name +YACC: e - line 9 of "./err_syntax19.y", illegal $-name { $$ = $; } ^ Modified: vendor/byacc/dist/test/yacc/err_syntax2.error ============================================================================== --- vendor/byacc/dist/test/yacc/err_syntax2.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/yacc/err_syntax2.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1,3 +1,3 @@ -YACC: e - line 1 of "./test/err_syntax2.y", unmatched /* +YACC: e - line 1 of "./err_syntax2.y", unmatched /* %{ /* ^ Modified: vendor/byacc/dist/test/yacc/err_syntax21.error ============================================================================== --- vendor/byacc/dist/test/yacc/err_syntax21.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/yacc/err_syntax21.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1 +1 @@ -YACC: e - line 12 of "./test/err_syntax21.y", $0 is untyped +YACC: e - line 12 of "./err_syntax21.y", $0 is untyped Modified: vendor/byacc/dist/test/yacc/err_syntax22.error ============================================================================== --- vendor/byacc/dist/test/yacc/err_syntax22.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/yacc/err_syntax22.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1 +1 @@ -YACC: e - line 17 of "./test/err_syntax22.y", $2 (recur) is untyped +YACC: e - line 17 of "./err_syntax22.y", $2 (recur) is untyped Modified: vendor/byacc/dist/test/yacc/err_syntax23.error ============================================================================== --- vendor/byacc/dist/test/yacc/err_syntax23.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/yacc/err_syntax23.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1 +1 @@ -YACC: e - line 18 of "./test/err_syntax23.y", $$ is untyped +YACC: e - line 18 of "./err_syntax23.y", $$ is untyped Modified: vendor/byacc/dist/test/yacc/err_syntax24.error ============================================================================== --- vendor/byacc/dist/test/yacc/err_syntax24.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/yacc/err_syntax24.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1,2 +1,2 @@ -YACC: w - line 21 of "./test/err_syntax24.y", the default action assigns an undefined value to $$ -YACC: e - line 22 of "./test/err_syntax24.y", $$ is untyped +YACC: w - line 21 of "./err_syntax24.y", the default action assigns an undefined value to $$ +YACC: e - line 22 of "./err_syntax24.y", $$ is untyped Modified: vendor/byacc/dist/test/yacc/err_syntax25.error ============================================================================== --- vendor/byacc/dist/test/yacc/err_syntax25.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/yacc/err_syntax25.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1,3 +1,3 @@ -YACC: e - line 11 of "./test/err_syntax25.y", too many %union declarations +YACC: e - line 11 of "./err_syntax25.y", too many %union declarations %union { ^ Modified: vendor/byacc/dist/test/yacc/err_syntax26.error ============================================================================== --- vendor/byacc/dist/test/yacc/err_syntax26.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/yacc/err_syntax26.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1 +1 @@ -YACC: e - line 6 of "./test/err_syntax26.y", unexpected end-of-file +YACC: e - line 6 of "./err_syntax26.y", unexpected end-of-file Modified: vendor/byacc/dist/test/yacc/err_syntax27.error ============================================================================== --- vendor/byacc/dist/test/yacc/err_syntax27.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/yacc/err_syntax27.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1 +1 @@ -YACC: e - line 3 of "./test/err_syntax27.y", missing '}' +YACC: e - line 3 of "./err_syntax27.y", missing '}' Modified: vendor/byacc/dist/test/yacc/err_syntax3.error ============================================================================== --- vendor/byacc/dist/test/yacc/err_syntax3.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/yacc/err_syntax3.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1,3 +1,3 @@ -YACC: e - line 6 of "./test/err_syntax3.y", unterminated string +YACC: e - line 6 of "./err_syntax3.y", unterminated string %token '(' '*' '& ^ Modified: vendor/byacc/dist/test/yacc/err_syntax4.error ============================================================================== --- vendor/byacc/dist/test/yacc/err_syntax4.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/yacc/err_syntax4.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1,3 +1,3 @@ -YACC: e - line 1 of "./test/err_syntax4.y", unmatched %{ +YACC: e - line 1 of "./err_syntax4.y", unmatched %{ %{ ^ Modified: vendor/byacc/dist/test/yacc/err_syntax5.error ============================================================================== --- vendor/byacc/dist/test/yacc/err_syntax5.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/yacc/err_syntax5.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1,3 +1,3 @@ -YACC: e - line 6 of "./test/err_syntax5.y", unterminated %union declaration +YACC: e - line 6 of "./err_syntax5.y", unterminated %union declaration %union { ^ Modified: vendor/byacc/dist/test/yacc/err_syntax6.error ============================================================================== --- vendor/byacc/dist/test/yacc/err_syntax6.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/yacc/err_syntax6.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1,3 +1,3 @@ -YACC: e - line 6 of "./test/err_syntax6.y", illegal tag +YACC: e - line 6 of "./err_syntax6.y", illegal tag %token '\777' ^ Modified: vendor/byacc/dist/test/yacc/err_syntax7a.error ============================================================================== --- vendor/byacc/dist/test/yacc/err_syntax7a.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/yacc/err_syntax7a.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1,3 +1,3 @@ -YACC: e - line 6 of "./test/err_syntax7a.y", illegal character +YACC: e - line 6 of "./err_syntax7a.y", illegal character %token '\xfff' ^ Modified: vendor/byacc/dist/test/yacc/err_syntax7b.error ============================================================================== --- vendor/byacc/dist/test/yacc/err_syntax7b.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/yacc/err_syntax7b.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1,3 +1,3 @@ -YACC: e - line 6 of "./test/err_syntax7b.y", illegal character +YACC: e - line 6 of "./err_syntax7b.y", illegal character %token '\x.' ^ Modified: vendor/byacc/dist/test/yacc/err_syntax8.error ============================================================================== --- vendor/byacc/dist/test/yacc/err_syntax8.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/yacc/err_syntax8.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1 +1 @@ -YACC: e - line 6 of "./test/err_syntax8.y", illegal use of reserved symbol . +YACC: e - line 6 of "./err_syntax8.y", illegal use of reserved symbol . Modified: vendor/byacc/dist/test/yacc/err_syntax8a.error ============================================================================== --- vendor/byacc/dist/test/yacc/err_syntax8a.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/yacc/err_syntax8a.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1 +1 @@ -YACC: e - line 6 of "./test/err_syntax8a.y", illegal use of reserved symbol $$123 +YACC: e - line 6 of "./err_syntax8a.y", illegal use of reserved symbol $$123 Modified: vendor/byacc/dist/test/yacc/err_syntax9.error ============================================================================== --- vendor/byacc/dist/test/yacc/err_syntax9.error Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/yacc/err_syntax9.error Thu Jul 17 21:58:22 2014 (r268809) @@ -1 +1 @@ -YACC: e - line 7 of "./test/err_syntax9.y", the start symbol text cannot be declared to be a token +YACC: e - line 7 of "./err_syntax9.y", the start symbol text cannot be declared to be a token Modified: vendor/byacc/dist/test/yacc/help.output ============================================================================== --- vendor/byacc/dist/test/yacc/help.output Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/yacc/help.output Thu Jul 17 21:58:22 2014 (r268809) @@ -4,7 +4,6 @@ Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives Modified: vendor/byacc/dist/test/yacc/no_b_opt.output ============================================================================== --- vendor/byacc/dist/test/yacc/no_b_opt.output Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/yacc/no_b_opt.output Thu Jul 17 21:58:22 2014 (r268809) @@ -4,7 +4,6 @@ Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives Modified: vendor/byacc/dist/test/yacc/no_output2.output ============================================================================== --- vendor/byacc/dist/test/yacc/no_output2.output Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/yacc/no_output2.output Thu Jul 17 21:58:22 2014 (r268809) @@ -4,7 +4,6 @@ Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives Modified: vendor/byacc/dist/test/yacc/no_p_opt.output ============================================================================== --- vendor/byacc/dist/test/yacc/no_p_opt.output Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/yacc/no_p_opt.output Thu Jul 17 21:58:22 2014 (r268809) @@ -4,7 +4,6 @@ Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives Modified: vendor/byacc/dist/test/yacc/nostdin.output ============================================================================== --- vendor/byacc/dist/test/yacc/nostdin.output Thu Jul 17 21:16:52 2014 (r268808) +++ vendor/byacc/dist/test/yacc/nostdin.output Thu Jul 17 21:58:22 2014 (r268809) @@ -4,7 +4,6 @@ Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 21:59:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 33382A7D; Thu, 17 Jul 2014 21:59: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 0738025C5; Thu, 17 Jul 2014 21:59:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6HLxDM8021462; Thu, 17 Jul 2014 21:59:13 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6HLxD7T021461; Thu, 17 Jul 2014 21:59:13 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201407172159.s6HLxD7T021461@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 17 Jul 2014 21:59:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r268810 - vendor/byacc/20140715 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 21:59:14 -0000 Author: bapt Date: Thu Jul 17 21:59:13 2014 New Revision: 268810 URL: http://svnweb.freebsd.org/changeset/base/268810 Log: tag import of byacc 20140715 Added: vendor/byacc/20140715/ - copied from r268809, vendor/byacc/dist/ From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 22:22:57 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0BDECE32; Thu, 17 Jul 2014 22:22:57 +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 E8DDE27F7; Thu, 17 Jul 2014 22:22:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6HMMuYu035038; Thu, 17 Jul 2014 22:22:56 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6HMMcC6034903; Thu, 17 Jul 2014 22:22:38 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201407172222.s6HMMcC6034903@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 17 Jul 2014 22:22:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268811 - in head: contrib/byacc contrib/byacc/package contrib/byacc/package/debian contrib/byacc/package/pkgsrc contrib/byacc/test contrib/byacc/test/btyacc contrib/byacc/test/yacc usr... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 22:22:57 -0000 Author: bapt Date: Thu Jul 17 22:22:38 2014 New Revision: 268811 URL: http://svnweb.freebsd.org/changeset/base/268811 Log: Update to byacc 20140715 (only concerns regression tests being fixed) Directly use regression test from upstream PR: 191020 Submitted by: gcooper (yaneurabeya@gmail.com) Added: head/usr.bin/yacc/tests/yacc_tests.sh (contents, props changed) Deleted: head/contrib/byacc/NOTES-btyacc-Changes head/contrib/byacc/NOTES-btyacc-Disposition head/usr.bin/yacc/tests/calc.y head/usr.bin/yacc/tests/calc1.y head/usr.bin/yacc/tests/calc2.y head/usr.bin/yacc/tests/calc3.y head/usr.bin/yacc/tests/code_calc.y head/usr.bin/yacc/tests/code_error.y head/usr.bin/yacc/tests/error.y head/usr.bin/yacc/tests/ftp.y head/usr.bin/yacc/tests/grammar.y head/usr.bin/yacc/tests/legacy_test.sh head/usr.bin/yacc/tests/pure_calc.y head/usr.bin/yacc/tests/pure_error.y head/usr.bin/yacc/tests/quote_calc.y head/usr.bin/yacc/tests/quote_calc2.y head/usr.bin/yacc/tests/quote_calc3.y head/usr.bin/yacc/tests/quote_calc4.y head/usr.bin/yacc/tests/regress.00.out head/usr.bin/yacc/tests/regress.01.out head/usr.bin/yacc/tests/regress.02.out head/usr.bin/yacc/tests/regress.03.out head/usr.bin/yacc/tests/regress.04.out head/usr.bin/yacc/tests/regress.05.out head/usr.bin/yacc/tests/regress.06.out head/usr.bin/yacc/tests/regress.07.out head/usr.bin/yacc/tests/regress.08.out head/usr.bin/yacc/tests/regress.09.out head/usr.bin/yacc/tests/regress.10.out head/usr.bin/yacc/tests/regress.11.out head/usr.bin/yacc/tests/regress.12.out head/usr.bin/yacc/tests/regress.13.out head/usr.bin/yacc/tests/regress.14.out head/usr.bin/yacc/tests/regress.sh head/usr.bin/yacc/tests/undefined.y Modified: head/contrib/byacc/CHANGES head/contrib/byacc/MANIFEST head/contrib/byacc/VERSION head/contrib/byacc/aclocal.m4 head/contrib/byacc/main.c head/contrib/byacc/package/byacc.spec head/contrib/byacc/package/debian/changelog head/contrib/byacc/package/mingw-byacc.spec head/contrib/byacc/package/pkgsrc/Makefile head/contrib/byacc/test/btyacc/big_b.output head/contrib/byacc/test/btyacc/big_l.output head/contrib/byacc/test/btyacc/err_inherit1.error head/contrib/byacc/test/btyacc/err_inherit2.error head/contrib/byacc/test/btyacc/err_inherit3.error head/contrib/byacc/test/btyacc/err_inherit4.error head/contrib/byacc/test/btyacc/err_inherit5.error head/contrib/byacc/test/btyacc/err_syntax1.error head/contrib/byacc/test/btyacc/err_syntax10.error head/contrib/byacc/test/btyacc/err_syntax11.error head/contrib/byacc/test/btyacc/err_syntax12.error head/contrib/byacc/test/btyacc/err_syntax13.error head/contrib/byacc/test/btyacc/err_syntax14.error head/contrib/byacc/test/btyacc/err_syntax15.error head/contrib/byacc/test/btyacc/err_syntax16.error head/contrib/byacc/test/btyacc/err_syntax17.error head/contrib/byacc/test/btyacc/err_syntax18.error head/contrib/byacc/test/btyacc/err_syntax19.error head/contrib/byacc/test/btyacc/err_syntax2.error head/contrib/byacc/test/btyacc/err_syntax21.error head/contrib/byacc/test/btyacc/err_syntax22.error head/contrib/byacc/test/btyacc/err_syntax23.error head/contrib/byacc/test/btyacc/err_syntax24.error head/contrib/byacc/test/btyacc/err_syntax25.error head/contrib/byacc/test/btyacc/err_syntax26.error head/contrib/byacc/test/btyacc/err_syntax27.error head/contrib/byacc/test/btyacc/err_syntax3.error head/contrib/byacc/test/btyacc/err_syntax4.error head/contrib/byacc/test/btyacc/err_syntax5.error head/contrib/byacc/test/btyacc/err_syntax6.error head/contrib/byacc/test/btyacc/err_syntax7.error head/contrib/byacc/test/btyacc/err_syntax7a.error head/contrib/byacc/test/btyacc/err_syntax7b.error head/contrib/byacc/test/btyacc/err_syntax8.error head/contrib/byacc/test/btyacc/err_syntax8a.error head/contrib/byacc/test/btyacc/err_syntax9.error head/contrib/byacc/test/btyacc/help.output head/contrib/byacc/test/btyacc/no_b_opt.output head/contrib/byacc/test/btyacc/no_output2.output head/contrib/byacc/test/btyacc/no_p_opt.output head/contrib/byacc/test/btyacc/nostdin.output head/contrib/byacc/test/run_test.sh head/contrib/byacc/test/yacc/big_b.output head/contrib/byacc/test/yacc/big_l.output head/contrib/byacc/test/yacc/err_syntax1.error head/contrib/byacc/test/yacc/err_syntax10.error head/contrib/byacc/test/yacc/err_syntax11.error head/contrib/byacc/test/yacc/err_syntax12.error head/contrib/byacc/test/yacc/err_syntax13.error head/contrib/byacc/test/yacc/err_syntax14.error head/contrib/byacc/test/yacc/err_syntax15.error head/contrib/byacc/test/yacc/err_syntax16.error head/contrib/byacc/test/yacc/err_syntax17.error head/contrib/byacc/test/yacc/err_syntax18.error head/contrib/byacc/test/yacc/err_syntax19.error head/contrib/byacc/test/yacc/err_syntax2.error head/contrib/byacc/test/yacc/err_syntax21.error head/contrib/byacc/test/yacc/err_syntax22.error head/contrib/byacc/test/yacc/err_syntax23.error head/contrib/byacc/test/yacc/err_syntax24.error head/contrib/byacc/test/yacc/err_syntax25.error head/contrib/byacc/test/yacc/err_syntax26.error head/contrib/byacc/test/yacc/err_syntax27.error head/contrib/byacc/test/yacc/err_syntax3.error head/contrib/byacc/test/yacc/err_syntax4.error head/contrib/byacc/test/yacc/err_syntax5.error head/contrib/byacc/test/yacc/err_syntax6.error head/contrib/byacc/test/yacc/err_syntax7.error head/contrib/byacc/test/yacc/err_syntax7a.error head/contrib/byacc/test/yacc/err_syntax7b.error head/contrib/byacc/test/yacc/err_syntax8.error head/contrib/byacc/test/yacc/err_syntax8a.error head/contrib/byacc/test/yacc/err_syntax9.error head/contrib/byacc/test/yacc/help.output head/contrib/byacc/test/yacc/no_b_opt.output head/contrib/byacc/test/yacc/no_output2.output head/contrib/byacc/test/yacc/no_p_opt.output head/contrib/byacc/test/yacc/nostdin.output head/usr.bin/yacc/tests/Makefile Directory Properties: head/contrib/byacc/ (props changed) Modified: head/contrib/byacc/CHANGES ============================================================================== --- head/contrib/byacc/CHANGES Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/CHANGES Thu Jul 17 22:22:38 2014 (r268811) @@ -1,3 +1,38 @@ +2014-07-15 Thomas E. Dickey + + * aclocal.m4: resync with my-autoconf (no change to configure script) + + * VERSION, package/byacc.spec, package/debian/changelog, package/mingw-byacc.spec, package/pkgsrc/Makefile: + bump + + * test/run_test.sh: + make top-level "make check" work again, by adding another step to filtering + the test results. + +2014-07-14 Thomas E. Dickey + + * test/run_test.sh: changes from Garrett Cooper's patch: + a) ensure that the script returns an error-code if there are differences + b) escape "." character in left side of sed expression for $YACC + c) ensure that $ifBTYACC has a value + + * test/btyacc/big_b.output, test/btyacc/big_l.output, test/btyacc/help.output, test/btyacc/no_b_opt.output, test/btyacc/no_output2.output, test/btyacc/no_p_opt.output, test/btyacc/nostdin.output: + regen (reminder by Garrett Cooper) + +2014-07-14 Garrett.Cooper + + * test/btyacc/err_inherit1.error, test/btyacc/err_inherit2.error, test/btyacc/err_inherit3.error, test/btyacc/err_inherit4.error, test/btyacc/err_inherit5.error, test/btyacc/err_syntax1.error, test/btyacc/err_syntax10.error, test/btyacc/err_syntax11.error, test/btyacc/err_syntax12.error, test/btyacc/err_syntax13.error, test/btyacc/err_syntax14.error, test/btyacc/err_syntax15.error, test/btyacc/err_syntax16.error, test/btyacc/err_syntax17.error, test/btyacc/err_syntax18.error, test/btyacc/err_syntax19.error, test/btyacc/err_syntax2.error, test/btyacc/err_syntax21.error, test/btyacc/err_syntax22.error, test/btyacc/err_syntax23.error, test/btyacc/err_syntax24.error, test/btyacc/err_syntax25.error, test/btyacc/err_syntax26.error, test/btyacc/err_syntax27.error, test/btyacc/err_syntax3.error, test/btyacc/err_syntax4.error, test/btyacc/err_syntax5.error, test/btyacc/err_syntax6.error, test/btyacc/err_syntax7.error, test/btyacc/err_syntax7a.error, test/btyacc/err_syntax7b.error, test/btya cc/err_syntax8.error, test/btyacc/err_syntax8a.error, test/btyacc/err_syntax9.error, test/yacc/err_syntax1.error, test/yacc/err_syntax10.error, test/yacc/err_syntax11.error, test/yacc/err_syntax12.error, test/yacc/err_syntax13.error, test/yacc/err_syntax14.error, test/yacc/err_syntax15.error, test/yacc/err_syntax16.error, test/yacc/err_syntax17.error, test/yacc/err_syntax18.error, test/yacc/err_syntax19.error, test/yacc/err_syntax2.error, test/yacc/err_syntax21.error, test/yacc/err_syntax22.error, test/yacc/err_syntax23.error, test/yacc/err_syntax24.error, test/yacc/err_syntax25.error, test/yacc/err_syntax26.error, test/yacc/err_syntax27.error, test/yacc/err_syntax3.error, test/yacc/err_syntax4.error, test/yacc/err_syntax5.error, test/yacc/err_syntax6.error, test/yacc/err_syntax7.error, test/yacc/err_syntax7a.error, test/yacc/err_syntax7b.error, test/yacc/err_syntax8.error, test/yacc/err_syntax8a.error, test/yacc/err_syntax9.error: + regen + +2014-05-27 Tom.Shields + + * main.c: remove obsolete -D option from usage message + +2014-05-27 Thomas E. Dickey + + * VERSION, package/byacc.spec, package/debian/changelog, test/yacc/big_b.output, test/yacc/big_l.output, test/yacc/help.output, test/yacc/no_b_opt.output, test/yacc/no_output2.output, test/yacc/no_p_opt.output, test/yacc/nostdin.output: + bump + 2014-04-22 Thomas E. Dickey * mstring.c: Modified: head/contrib/byacc/MANIFEST ============================================================================== --- head/contrib/byacc/MANIFEST Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/MANIFEST Thu Jul 17 22:22:38 2014 (r268811) @@ -1,4 +1,4 @@ -MANIFEST for byacc-20140422, version t20140422 +MANIFEST for byacc-20140715, version t20140715 -------------------------------------------------------------------------------- MANIFEST this file ACKNOWLEDGEMENTS original version of byacc - 1993 Modified: head/contrib/byacc/VERSION ============================================================================== --- head/contrib/byacc/VERSION Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/VERSION Thu Jul 17 22:22:38 2014 (r268811) @@ -1 +1 @@ -20140422 +20140715 Modified: head/contrib/byacc/aclocal.m4 ============================================================================== --- head/contrib/byacc/aclocal.m4 Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/aclocal.m4 Thu Jul 17 22:22:38 2014 (r268811) @@ -1,4 +1,4 @@ -dnl $Id: aclocal.m4,v 1.34 2014/04/06 19:16:18 tom Exp $ +dnl $Id: aclocal.m4,v 1.35 2014/07/15 19:38:05 tom Exp $ dnl Macros for byacc configure script (Thomas E. Dickey) dnl --------------------------------------------------------------------------- dnl Copyright 2004-2013,2014 Thomas E. Dickey @@ -28,7 +28,7 @@ dnl sale, use or other dealings in this dnl authorization. dnl --------------------------------------------------------------------------- dnl --------------------------------------------------------------------------- -dnl CF_ACVERSION_CHECK version: 4 updated: 2013/03/04 19:52:56 +dnl CF_ACVERSION_CHECK version: 5 updated: 2014/06/04 19:11:49 dnl ------------------ dnl Conditionally generate script according to whether we're using a given autoconf. dnl @@ -37,7 +37,7 @@ dnl $2 = code to use if AC_ACVERSION is dnl $3 = code to use if AC_ACVERSION is older than $1. define([CF_ACVERSION_CHECK], [ -ifdef([AC_ACVERSION], ,[m4_copy([m4_PACKAGE_VERSION],[AC_ACVERSION])])dnl +ifdef([AC_ACVERSION], ,[ifdef([AC_AUTOCONF_VERSION],[m4_copy([AC_AUTOCONF_VERSION],[AC_ACVERSION])],[m4_copy([m4_PACKAGE_VERSION],[AC_ACVERSION])])])dnl ifdef([m4_version_compare], [m4_if(m4_version_compare(m4_defn([AC_ACVERSION]), [$1]), -1, [$3], [$2])], [CF_ACVERSION_COMPARE( @@ -930,7 +930,7 @@ AC_PROG_AWK test -z "$AWK" && AC_MSG_ERROR(No awk program found) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PROG_CC version: 3 updated: 2012/10/06 15:31:55 +dnl CF_PROG_CC version: 4 updated: 2014/07/12 18:57:58 dnl ---------- dnl standard check for CC, plus followup sanity checks dnl $1 = optional parameter to pass to AC_PROG_CC to specify compiler name @@ -940,7 +940,7 @@ CF_GCC_VERSION CF_ACVERSION_CHECK(2.52, [AC_PROG_CC_STDC], [CF_ANSI_CC_REQD]) -CF_CC_ENV_FLAGS +CF_CC_ENV_FLAGS ])dnl dnl --------------------------------------------------------------------------- dnl CF_PROG_LINT version: 2 updated: 2009/08/12 04:43:14 Modified: head/contrib/byacc/main.c ============================================================================== --- head/contrib/byacc/main.c Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/main.c Thu Jul 17 22:22:38 2014 (r268811) @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.50 2014/04/22 23:34:47 tom Exp $ */ +/* $Id: main.c,v 1.51 2014/05/28 02:01:55 Tom.Shields Exp $ */ #include #ifndef _WIN32 @@ -208,7 +208,6 @@ usage(void) ," -b file_prefix set filename prefix (default \"y.\")" ," -B create a backtracking parser" ," -d write definitions (" DEFINES_SUFFIX ")" - ," -D enable value stack memory reclamation" ," -i write interface (y.tab.i)" ," -g write a graphical description" ," -l suppress #line directives" Modified: head/contrib/byacc/package/byacc.spec ============================================================================== --- head/contrib/byacc/package/byacc.spec Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/package/byacc.spec Thu Jul 17 22:22:38 2014 (r268811) @@ -1,8 +1,8 @@ Summary: byacc - public domain Berkeley LALR Yacc parser generator %define AppProgram byacc -%define AppVersion 20140422 +%define AppVersion 20140715 %define UseProgram yacc -# $XTermId: byacc.spec,v 1.20 2014/04/22 08:13:20 tom Exp $ +# $XTermId: byacc.spec,v 1.22 2014/07/15 19:36:54 tom Exp $ Name: %{AppProgram} Version: %{AppVersion} Release: 1 Modified: head/contrib/byacc/package/debian/changelog ============================================================================== --- head/contrib/byacc/package/debian/changelog Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/package/debian/changelog Thu Jul 17 22:22:38 2014 (r268811) @@ -1,3 +1,15 @@ +byacc (20140715) unstable; urgency=low + + * maintenance updates + + -- Thomas E. Dickey Tue, 15 Jul 2014 15:36:54 -0400 + +byacc (20140527) unstable; urgency=low + + * remove obsolete option from usage message + + -- Thomas E. Dickey Tue, 27 May 2014 22:01:55 -0400 + byacc (20140422) unstable; urgency=low * maintenance updates Modified: head/contrib/byacc/package/mingw-byacc.spec ============================================================================== --- head/contrib/byacc/package/mingw-byacc.spec Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/package/mingw-byacc.spec Thu Jul 17 22:22:38 2014 (r268811) @@ -1,8 +1,8 @@ Summary: byacc - public domain Berkeley LALR Yacc parser generator %define AppProgram byacc -%define AppVersion 20140422 +%define AppVersion 20140715 %define UseProgram yacc -# $XTermId: mingw-byacc.spec,v 1.3 2014/04/22 08:13:20 tom Exp $ +# $XTermId: mingw-byacc.spec,v 1.4 2014/07/15 19:36:54 tom Exp $ Name: %{AppProgram} Version: %{AppVersion} Release: 1 Modified: head/contrib/byacc/package/pkgsrc/Makefile ============================================================================== --- head/contrib/byacc/package/pkgsrc/Makefile Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/package/pkgsrc/Makefile Thu Jul 17 22:22:38 2014 (r268811) @@ -1,7 +1,7 @@ # $NetBSD: Makefile,v 1.9 2008/07/24 17:13:00 tonnerre Exp $ # -DISTNAME= byacc-20140422 +DISTNAME= byacc-20140715 PKGREVISION= 1 CATEGORIES= devel MASTER_SITES= ftp://invisible-island.net/byacc/ Modified: head/contrib/byacc/test/btyacc/big_b.output ============================================================================== --- head/contrib/byacc/test/btyacc/big_b.output Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/big_b.output Thu Jul 17 22:22:38 2014 (r268811) @@ -4,7 +4,6 @@ Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives Modified: head/contrib/byacc/test/btyacc/big_l.output ============================================================================== --- head/contrib/byacc/test/btyacc/big_l.output Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/big_l.output Thu Jul 17 22:22:38 2014 (r268811) @@ -4,7 +4,6 @@ Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives Modified: head/contrib/byacc/test/btyacc/err_inherit1.error ============================================================================== --- head/contrib/byacc/test/btyacc/err_inherit1.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/err_inherit1.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1,3 +1,3 @@ -YACC: e - line 64 of "./test/err_inherit1.y", unterminated argument list +YACC: e - line 64 of "./err_inherit1.y", unterminated argument list namelist($c, $t ^ Modified: head/contrib/byacc/test/btyacc/err_inherit2.error ============================================================================== --- head/contrib/byacc/test/btyacc/err_inherit2.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/err_inherit2.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1,5 +1,5 @@ -YACC: w - line 64 of "./test/err_inherit2.y", number of arguments of namelist doesn't agree with previous declaration -YACC: w - line 64 of "./test/err_inherit2.y", type of argument 1 to namelist doesn't agree with previous declaration -YACC: e - line 64 of "./test/err_inherit2.y", bad formal argument list +YACC: w - line 64 of "./err_inherit2.y", number of arguments of namelist doesn't agree with previous declaration +YACC: w - line 64 of "./err_inherit2.y", type of argument 1 to namelist doesn't agree with previous declaration +YACC: e - line 64 of "./err_inherit2.y", bad formal argument list namelist($c, $t, extra): namelist NAME ^ Modified: head/contrib/byacc/test/btyacc/err_inherit3.error ============================================================================== --- head/contrib/byacc/test/btyacc/err_inherit3.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/err_inherit3.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1,23 +1,23 @@ -YACC: w - line 64 of "./test/err_inherit3.y", number of arguments of namelist doesn't agree with previous declaration -YACC: w - line 64 of "./test/err_inherit3.y", wrong number of arguments for namelist +YACC: w - line 64 of "./err_inherit3.y", number of arguments of namelist doesn't agree with previous declaration +YACC: w - line 64 of "./err_inherit3.y", wrong number of arguments for namelist namelist: namelist($c) NAME ^ -YACC: w - line 64 of "./test/err_inherit3.y", unknown argument $c -YACC: w - line 64 of "./test/err_inherit3.y", untyped argument $c -YACC: w - line 65 of "./test/err_inherit3.y", unknown argument $t +YACC: w - line 64 of "./err_inherit3.y", unknown argument $c +YACC: w - line 64 of "./err_inherit3.y", untyped argument $c +YACC: w - line 65 of "./err_inherit3.y", unknown argument $t { $$->s = mksymbol($t, $c, $2); ^ -YACC: w - line 65 of "./test/err_inherit3.y", unknown argument $c +YACC: w - line 65 of "./err_inherit3.y", unknown argument $c { $$->s = mksymbol($t, $c, $2); ^ -YACC: w - line 69 of "./test/err_inherit3.y", unknown argument $t +YACC: w - line 69 of "./err_inherit3.y", unknown argument $t { $$->s = mksymbol($t, $c, $1); ^ -YACC: w - line 69 of "./test/err_inherit3.y", untyped argument $t -YACC: w - line 69 of "./test/err_inherit3.y", unknown argument $c +YACC: w - line 69 of "./err_inherit3.y", untyped argument $t +YACC: w - line 69 of "./err_inherit3.y", unknown argument $c { $$->s = mksymbol($t, $c, $1); ^ -YACC: w - line 69 of "./test/err_inherit3.y", untyped argument $c -YACC: w - line 0 of "./test/err_inherit3.y", start symbol declaration requires arguments +YACC: w - line 69 of "./err_inherit3.y", untyped argument $c +YACC: w - line 0 of "./err_inherit3.y", start symbol declaration requires arguments YACC: 1 rule never reduced YACC: 3 shift/reduce conflicts. Modified: head/contrib/byacc/test/btyacc/err_inherit4.error ============================================================================== --- head/contrib/byacc/test/btyacc/err_inherit4.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/err_inherit4.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1,13 +1,13 @@ -YACC: w - line 32 of "./test/err_inherit4.y", destructor redeclared +YACC: w - line 32 of "./err_inherit4.y", destructor redeclared %destructor { ^ -YACC: w - line 77 of "./test/err_inherit4.y", wrong number of default arguments for namelist +YACC: w - line 77 of "./err_inherit4.y", wrong number of default arguments for namelist { $$ = $1; @$ = @2; } ^ -YACC: w - line 77 of "./test/err_inherit4.y", wrong type for default argument 2 to namelist +YACC: w - line 77 of "./err_inherit4.y", wrong type for default argument 2 to namelist { $$ = $1; @$ = @2; } ^ -YACC: w - line 77 of "./test/err_inherit4.y", wrong type for default argument 1 to namelist +YACC: w - line 77 of "./err_inherit4.y", wrong type for default argument 1 to namelist { $$ = $1; @$ = @2; } ^ -YACC: w - line 77 of "./test/err_inherit4.y", @2 references beyond the end of the current rule +YACC: w - line 77 of "./err_inherit4.y", @2 references beyond the end of the current rule Modified: head/contrib/byacc/test/btyacc/err_inherit5.error ============================================================================== --- head/contrib/byacc/test/btyacc/err_inherit5.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/err_inherit5.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1 +1 @@ -YACC: e - line 74 of "./test/err_inherit5.y", illegal @$ or @N reference +YACC: e - line 74 of "./err_inherit5.y", illegal @$ or @N reference Modified: head/contrib/byacc/test/btyacc/err_syntax1.error ============================================================================== --- head/contrib/byacc/test/btyacc/err_syntax1.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/err_syntax1.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1,3 +1,3 @@ -YACC: e - line 1 of "./test/err_syntax1.y", syntax error +YACC: e - line 1 of "./err_syntax1.y", syntax error ?% { ^ Modified: head/contrib/byacc/test/btyacc/err_syntax10.error ============================================================================== --- head/contrib/byacc/test/btyacc/err_syntax10.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/err_syntax10.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1,3 +1,3 @@ -YACC: w - line 7 of "./test/err_syntax10.y", the type of '(' has been redeclared -YACC: w - line 7 of "./test/err_syntax10.y", the type of '*' has been redeclared -YACC: w - line 7 of "./test/err_syntax10.y", the type of '&' has been redeclared +YACC: w - line 7 of "./err_syntax10.y", the type of '(' has been redeclared +YACC: w - line 7 of "./err_syntax10.y", the type of '*' has been redeclared +YACC: w - line 7 of "./err_syntax10.y", the type of '&' has been redeclared Modified: head/contrib/byacc/test/btyacc/err_syntax11.error ============================================================================== --- head/contrib/byacc/test/btyacc/err_syntax11.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/err_syntax11.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1 +1 @@ -YACC: w - line 7 of "./test/err_syntax11.y", the precedence of '|' has been redeclared +YACC: w - line 7 of "./err_syntax11.y", the precedence of '|' has been redeclared Modified: head/contrib/byacc/test/btyacc/err_syntax12.error ============================================================================== --- head/contrib/byacc/test/btyacc/err_syntax12.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/err_syntax12.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1 +1 @@ -YACC: w - line 7 of "./test/err_syntax12.y", the value of text has been redeclared +YACC: w - line 7 of "./err_syntax12.y", the value of text has been redeclared Modified: head/contrib/byacc/test/btyacc/err_syntax13.error ============================================================================== --- head/contrib/byacc/test/btyacc/err_syntax13.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/err_syntax13.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1 +1 @@ -YACC: e - line 7 of "./test/err_syntax13.y", the start symbol text is a token +YACC: e - line 7 of "./err_syntax13.y", the start symbol text is a token Modified: head/contrib/byacc/test/btyacc/err_syntax14.error ============================================================================== --- head/contrib/byacc/test/btyacc/err_syntax14.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/err_syntax14.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1,2 +1,2 @@ -YACC: w - line 7 of "./test/err_syntax14.y", the start symbol has been redeclared +YACC: w - line 7 of "./err_syntax14.y", the start symbol has been redeclared YACC: e - the start symbol text2 is undefined Modified: head/contrib/byacc/test/btyacc/err_syntax15.error ============================================================================== --- head/contrib/byacc/test/btyacc/err_syntax15.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/err_syntax15.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1 +1 @@ -YACC: e - line 9 of "./test/err_syntax15.y", no grammar has been specified +YACC: e - line 9 of "./err_syntax15.y", no grammar has been specified Modified: head/contrib/byacc/test/btyacc/err_syntax16.error ============================================================================== --- head/contrib/byacc/test/btyacc/err_syntax16.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/err_syntax16.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1 +1 @@ -YACC: e - line 14 of "./test/err_syntax16.y", a token appears on the lhs of a production +YACC: e - line 14 of "./err_syntax16.y", a token appears on the lhs of a production Modified: head/contrib/byacc/test/btyacc/err_syntax17.error ============================================================================== --- head/contrib/byacc/test/btyacc/err_syntax17.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/err_syntax17.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1,3 +1,3 @@ -YACC: e - line 8 of "./test/err_syntax17.y", unterminated action +YACC: e - line 8 of "./err_syntax17.y", unterminated action S: { error ^ Modified: head/contrib/byacc/test/btyacc/err_syntax18.error ============================================================================== --- head/contrib/byacc/test/btyacc/err_syntax18.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/err_syntax18.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1 +1 @@ -YACC: w - line 9 of "./test/err_syntax18.y", $4 references beyond the end of the current rule +YACC: w - line 9 of "./err_syntax18.y", $4 references beyond the end of the current rule Modified: head/contrib/byacc/test/btyacc/err_syntax19.error ============================================================================== --- head/contrib/byacc/test/btyacc/err_syntax19.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/err_syntax19.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1,3 +1,3 @@ -YACC: e - line 9 of "./test/err_syntax19.y", illegal $-name +YACC: e - line 9 of "./err_syntax19.y", illegal $-name { $$ = $; } ^ Modified: head/contrib/byacc/test/btyacc/err_syntax2.error ============================================================================== --- head/contrib/byacc/test/btyacc/err_syntax2.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/err_syntax2.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1,3 +1,3 @@ -YACC: e - line 1 of "./test/err_syntax2.y", unmatched /* +YACC: e - line 1 of "./err_syntax2.y", unmatched /* %{ /* ^ Modified: head/contrib/byacc/test/btyacc/err_syntax21.error ============================================================================== --- head/contrib/byacc/test/btyacc/err_syntax21.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/err_syntax21.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1 +1 @@ -YACC: e - line 12 of "./test/err_syntax21.y", $0 is untyped +YACC: e - line 12 of "./err_syntax21.y", $0 is untyped Modified: head/contrib/byacc/test/btyacc/err_syntax22.error ============================================================================== --- head/contrib/byacc/test/btyacc/err_syntax22.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/err_syntax22.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1 +1 @@ -YACC: e - line 17 of "./test/err_syntax22.y", $2 (recur) is untyped +YACC: e - line 17 of "./err_syntax22.y", $2 (recur) is untyped Modified: head/contrib/byacc/test/btyacc/err_syntax23.error ============================================================================== --- head/contrib/byacc/test/btyacc/err_syntax23.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/err_syntax23.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1 +1 @@ -YACC: e - line 18 of "./test/err_syntax23.y", $$ is untyped +YACC: e - line 18 of "./err_syntax23.y", $$ is untyped Modified: head/contrib/byacc/test/btyacc/err_syntax24.error ============================================================================== --- head/contrib/byacc/test/btyacc/err_syntax24.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/err_syntax24.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1,2 +1,2 @@ -YACC: w - line 21 of "./test/err_syntax24.y", the default action assigns an undefined value to $$ -YACC: e - line 22 of "./test/err_syntax24.y", $$ is untyped +YACC: w - line 21 of "./err_syntax24.y", the default action assigns an undefined value to $$ +YACC: e - line 22 of "./err_syntax24.y", $$ is untyped Modified: head/contrib/byacc/test/btyacc/err_syntax25.error ============================================================================== --- head/contrib/byacc/test/btyacc/err_syntax25.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/err_syntax25.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1,3 +1,3 @@ -YACC: e - line 11 of "./test/err_syntax25.y", too many %union declarations +YACC: e - line 11 of "./err_syntax25.y", too many %union declarations %union { ^ Modified: head/contrib/byacc/test/btyacc/err_syntax26.error ============================================================================== --- head/contrib/byacc/test/btyacc/err_syntax26.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/err_syntax26.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1 +1 @@ -YACC: e - line 6 of "./test/err_syntax26.y", unexpected end-of-file +YACC: e - line 6 of "./err_syntax26.y", unexpected end-of-file Modified: head/contrib/byacc/test/btyacc/err_syntax27.error ============================================================================== --- head/contrib/byacc/test/btyacc/err_syntax27.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/err_syntax27.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1 +1 @@ -YACC: e - line 3 of "./test/err_syntax27.y", missing '}' +YACC: e - line 3 of "./err_syntax27.y", missing '}' Modified: head/contrib/byacc/test/btyacc/err_syntax3.error ============================================================================== --- head/contrib/byacc/test/btyacc/err_syntax3.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/err_syntax3.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1,3 +1,3 @@ -YACC: e - line 6 of "./test/err_syntax3.y", unterminated string +YACC: e - line 6 of "./err_syntax3.y", unterminated string %token '(' '*' '& ^ Modified: head/contrib/byacc/test/btyacc/err_syntax4.error ============================================================================== --- head/contrib/byacc/test/btyacc/err_syntax4.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/err_syntax4.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1,3 +1,3 @@ -YACC: e - line 1 of "./test/err_syntax4.y", unmatched %{ +YACC: e - line 1 of "./err_syntax4.y", unmatched %{ %{ ^ Modified: head/contrib/byacc/test/btyacc/err_syntax5.error ============================================================================== --- head/contrib/byacc/test/btyacc/err_syntax5.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/err_syntax5.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1,3 +1,3 @@ -YACC: e - line 6 of "./test/err_syntax5.y", unterminated %union declaration +YACC: e - line 6 of "./err_syntax5.y", unterminated %union declaration %union { ^ Modified: head/contrib/byacc/test/btyacc/err_syntax6.error ============================================================================== --- head/contrib/byacc/test/btyacc/err_syntax6.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/err_syntax6.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1,3 +1,3 @@ -YACC: e - line 6 of "./test/err_syntax6.y", illegal tag +YACC: e - line 6 of "./err_syntax6.y", illegal tag %token '\777' ^ Modified: head/contrib/byacc/test/btyacc/err_syntax7a.error ============================================================================== --- head/contrib/byacc/test/btyacc/err_syntax7a.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/err_syntax7a.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1,3 +1,3 @@ -YACC: e - line 6 of "./test/err_syntax7a.y", illegal character +YACC: e - line 6 of "./err_syntax7a.y", illegal character %token '\xfff' ^ Modified: head/contrib/byacc/test/btyacc/err_syntax7b.error ============================================================================== --- head/contrib/byacc/test/btyacc/err_syntax7b.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/err_syntax7b.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1,3 +1,3 @@ -YACC: e - line 6 of "./test/err_syntax7b.y", illegal character +YACC: e - line 6 of "./err_syntax7b.y", illegal character %token '\x.' ^ Modified: head/contrib/byacc/test/btyacc/err_syntax8.error ============================================================================== --- head/contrib/byacc/test/btyacc/err_syntax8.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/err_syntax8.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1 +1 @@ -YACC: e - line 6 of "./test/err_syntax8.y", illegal use of reserved symbol . +YACC: e - line 6 of "./err_syntax8.y", illegal use of reserved symbol . Modified: head/contrib/byacc/test/btyacc/err_syntax8a.error ============================================================================== --- head/contrib/byacc/test/btyacc/err_syntax8a.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/err_syntax8a.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1 +1 @@ -YACC: e - line 6 of "./test/err_syntax8a.y", illegal use of reserved symbol $$123 +YACC: e - line 6 of "./err_syntax8a.y", illegal use of reserved symbol $$123 Modified: head/contrib/byacc/test/btyacc/err_syntax9.error ============================================================================== --- head/contrib/byacc/test/btyacc/err_syntax9.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/err_syntax9.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1 +1 @@ -YACC: e - line 7 of "./test/err_syntax9.y", the start symbol text cannot be declared to be a token +YACC: e - line 7 of "./err_syntax9.y", the start symbol text cannot be declared to be a token Modified: head/contrib/byacc/test/btyacc/help.output ============================================================================== --- head/contrib/byacc/test/btyacc/help.output Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/help.output Thu Jul 17 22:22:38 2014 (r268811) @@ -4,7 +4,6 @@ Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives Modified: head/contrib/byacc/test/btyacc/no_b_opt.output ============================================================================== --- head/contrib/byacc/test/btyacc/no_b_opt.output Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/no_b_opt.output Thu Jul 17 22:22:38 2014 (r268811) @@ -4,7 +4,6 @@ Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives Modified: head/contrib/byacc/test/btyacc/no_output2.output ============================================================================== --- head/contrib/byacc/test/btyacc/no_output2.output Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/no_output2.output Thu Jul 17 22:22:38 2014 (r268811) @@ -4,7 +4,6 @@ Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives Modified: head/contrib/byacc/test/btyacc/no_p_opt.output ============================================================================== --- head/contrib/byacc/test/btyacc/no_p_opt.output Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/no_p_opt.output Thu Jul 17 22:22:38 2014 (r268811) @@ -4,7 +4,6 @@ Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives Modified: head/contrib/byacc/test/btyacc/nostdin.output ============================================================================== --- head/contrib/byacc/test/btyacc/nostdin.output Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/btyacc/nostdin.output Thu Jul 17 22:22:38 2014 (r268811) @@ -4,7 +4,6 @@ Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives Modified: head/contrib/byacc/test/run_test.sh ============================================================================== --- head/contrib/byacc/test/run_test.sh Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/run_test.sh Thu Jul 17 22:22:38 2014 (r268811) @@ -1,7 +1,9 @@ #!/bin/sh -# $Id: run_test.sh,v 1.22 2014/04/09 11:00:45 tom Exp $ +# $Id: run_test.sh,v 1.24 2014/07/15 19:21:10 tom Exp $ # vi:ts=4 sw=4: +errors=0 + # NEW is the file created by the testcase # REF is the reference file against which to compare test_diffs() { @@ -11,13 +13,15 @@ test_diffs() { if test ! -f $CMP then echo "...not found $CMP" + errors=1 else sed -e s,$NEW,$REF, \ - -e "s%$YACC%YACC%" \ + -e "s%$YACC_escaped%YACC%" \ -e '/YYPATCH/s/[0-9][0-9]*/"yyyymmdd"/' \ -e '/#define YYPATCH/s/PATCH/CHECK/' \ -e 's,#line \([1-9][0-9]*\) "'$REF_DIR'/,#line \1 ",' \ -e 's,#line \([1-9][0-9]*\) "'$TEST_DIR'/,#line \1 ",' \ + -e 's,\(YACC:.* line [0-9][0-9]* of "\)'$TEST_DIR/',\1./,' \ < $CMP >$tmpfile \ && mv $tmpfile $CMP if test ! -f $REF @@ -31,6 +35,7 @@ test_diffs() { else echo "...diff $REF" diff -u $REF $CMP + errors=1 fi fi } @@ -62,10 +67,11 @@ else fi YACC=$PROG_DIR/yacc +YACC_escaped=`echo "$PROG_DIR/yacc" | sed -e 's/\./\\\./g'` tmpfile=temp$$ -ifBTYACC=`fgrep -l 'define YYBTYACC' config.h > /dev/null; test $? != 0; echo $?` +ifBTYACC=`fgrep -l 'define YYBTYACC' $PROG_DIR/config.h > /dev/null; test $? != 0; echo $?` if test $ifBTYACC = 0; then REF_DIR=${TEST_DIR}/yacc @@ -236,3 +242,5 @@ do ;; esac done + +exit $errors Modified: head/contrib/byacc/test/yacc/big_b.output ============================================================================== --- head/contrib/byacc/test/yacc/big_b.output Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/yacc/big_b.output Thu Jul 17 22:22:38 2014 (r268811) @@ -5,7 +5,6 @@ Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives Modified: head/contrib/byacc/test/yacc/big_l.output ============================================================================== --- head/contrib/byacc/test/yacc/big_l.output Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/yacc/big_l.output Thu Jul 17 22:22:38 2014 (r268811) @@ -5,7 +5,6 @@ Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives Modified: head/contrib/byacc/test/yacc/err_syntax1.error ============================================================================== --- head/contrib/byacc/test/yacc/err_syntax1.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/yacc/err_syntax1.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1,3 +1,3 @@ -YACC: e - line 1 of "./test/err_syntax1.y", syntax error +YACC: e - line 1 of "./err_syntax1.y", syntax error ?% { ^ Modified: head/contrib/byacc/test/yacc/err_syntax10.error ============================================================================== --- head/contrib/byacc/test/yacc/err_syntax10.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/yacc/err_syntax10.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1,3 +1,3 @@ -YACC: w - line 7 of "./test/err_syntax10.y", the type of '(' has been redeclared -YACC: w - line 7 of "./test/err_syntax10.y", the type of '*' has been redeclared -YACC: w - line 7 of "./test/err_syntax10.y", the type of '&' has been redeclared +YACC: w - line 7 of "./err_syntax10.y", the type of '(' has been redeclared +YACC: w - line 7 of "./err_syntax10.y", the type of '*' has been redeclared +YACC: w - line 7 of "./err_syntax10.y", the type of '&' has been redeclared Modified: head/contrib/byacc/test/yacc/err_syntax11.error ============================================================================== --- head/contrib/byacc/test/yacc/err_syntax11.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/yacc/err_syntax11.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1 +1 @@ -YACC: w - line 7 of "./test/err_syntax11.y", the precedence of '|' has been redeclared +YACC: w - line 7 of "./err_syntax11.y", the precedence of '|' has been redeclared Modified: head/contrib/byacc/test/yacc/err_syntax12.error ============================================================================== --- head/contrib/byacc/test/yacc/err_syntax12.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/yacc/err_syntax12.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1 +1 @@ -YACC: w - line 7 of "./test/err_syntax12.y", the value of text has been redeclared +YACC: w - line 7 of "./err_syntax12.y", the value of text has been redeclared Modified: head/contrib/byacc/test/yacc/err_syntax13.error ============================================================================== --- head/contrib/byacc/test/yacc/err_syntax13.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/yacc/err_syntax13.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1 +1 @@ -YACC: e - line 7 of "./test/err_syntax13.y", the start symbol text is a token +YACC: e - line 7 of "./err_syntax13.y", the start symbol text is a token Modified: head/contrib/byacc/test/yacc/err_syntax14.error ============================================================================== --- head/contrib/byacc/test/yacc/err_syntax14.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/yacc/err_syntax14.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1,2 +1,2 @@ -YACC: w - line 7 of "./test/err_syntax14.y", the start symbol has been redeclared +YACC: w - line 7 of "./err_syntax14.y", the start symbol has been redeclared YACC: e - the start symbol text2 is undefined Modified: head/contrib/byacc/test/yacc/err_syntax15.error ============================================================================== --- head/contrib/byacc/test/yacc/err_syntax15.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/yacc/err_syntax15.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1 +1 @@ -YACC: e - line 9 of "./test/err_syntax15.y", no grammar has been specified +YACC: e - line 9 of "./err_syntax15.y", no grammar has been specified Modified: head/contrib/byacc/test/yacc/err_syntax16.error ============================================================================== --- head/contrib/byacc/test/yacc/err_syntax16.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/yacc/err_syntax16.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1 +1 @@ -YACC: e - line 14 of "./test/err_syntax16.y", a token appears on the lhs of a production +YACC: e - line 14 of "./err_syntax16.y", a token appears on the lhs of a production Modified: head/contrib/byacc/test/yacc/err_syntax17.error ============================================================================== --- head/contrib/byacc/test/yacc/err_syntax17.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/yacc/err_syntax17.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1,3 +1,3 @@ -YACC: e - line 8 of "./test/err_syntax17.y", unterminated action +YACC: e - line 8 of "./err_syntax17.y", unterminated action S: { error ^ Modified: head/contrib/byacc/test/yacc/err_syntax18.error ============================================================================== --- head/contrib/byacc/test/yacc/err_syntax18.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/yacc/err_syntax18.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1 +1 @@ -YACC: w - line 9 of "./test/err_syntax18.y", $4 references beyond the end of the current rule +YACC: w - line 9 of "./err_syntax18.y", $4 references beyond the end of the current rule Modified: head/contrib/byacc/test/yacc/err_syntax19.error ============================================================================== --- head/contrib/byacc/test/yacc/err_syntax19.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/yacc/err_syntax19.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1,3 +1,3 @@ -YACC: e - line 9 of "./test/err_syntax19.y", illegal $-name +YACC: e - line 9 of "./err_syntax19.y", illegal $-name { $$ = $; } ^ Modified: head/contrib/byacc/test/yacc/err_syntax2.error ============================================================================== --- head/contrib/byacc/test/yacc/err_syntax2.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/yacc/err_syntax2.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1,3 +1,3 @@ -YACC: e - line 1 of "./test/err_syntax2.y", unmatched /* +YACC: e - line 1 of "./err_syntax2.y", unmatched /* %{ /* ^ Modified: head/contrib/byacc/test/yacc/err_syntax21.error ============================================================================== --- head/contrib/byacc/test/yacc/err_syntax21.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/yacc/err_syntax21.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1 +1 @@ -YACC: e - line 12 of "./test/err_syntax21.y", $0 is untyped +YACC: e - line 12 of "./err_syntax21.y", $0 is untyped Modified: head/contrib/byacc/test/yacc/err_syntax22.error ============================================================================== --- head/contrib/byacc/test/yacc/err_syntax22.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/yacc/err_syntax22.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1 +1 @@ -YACC: e - line 17 of "./test/err_syntax22.y", $2 (recur) is untyped +YACC: e - line 17 of "./err_syntax22.y", $2 (recur) is untyped Modified: head/contrib/byacc/test/yacc/err_syntax23.error ============================================================================== --- head/contrib/byacc/test/yacc/err_syntax23.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/yacc/err_syntax23.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1 +1 @@ -YACC: e - line 18 of "./test/err_syntax23.y", $$ is untyped +YACC: e - line 18 of "./err_syntax23.y", $$ is untyped Modified: head/contrib/byacc/test/yacc/err_syntax24.error ============================================================================== --- head/contrib/byacc/test/yacc/err_syntax24.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/yacc/err_syntax24.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1,2 +1,2 @@ -YACC: w - line 21 of "./test/err_syntax24.y", the default action assigns an undefined value to $$ -YACC: e - line 22 of "./test/err_syntax24.y", $$ is untyped +YACC: w - line 21 of "./err_syntax24.y", the default action assigns an undefined value to $$ +YACC: e - line 22 of "./err_syntax24.y", $$ is untyped Modified: head/contrib/byacc/test/yacc/err_syntax25.error ============================================================================== --- head/contrib/byacc/test/yacc/err_syntax25.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/yacc/err_syntax25.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1,3 +1,3 @@ -YACC: e - line 11 of "./test/err_syntax25.y", too many %union declarations +YACC: e - line 11 of "./err_syntax25.y", too many %union declarations %union { ^ Modified: head/contrib/byacc/test/yacc/err_syntax26.error ============================================================================== --- head/contrib/byacc/test/yacc/err_syntax26.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/yacc/err_syntax26.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1 +1 @@ -YACC: e - line 6 of "./test/err_syntax26.y", unexpected end-of-file +YACC: e - line 6 of "./err_syntax26.y", unexpected end-of-file Modified: head/contrib/byacc/test/yacc/err_syntax27.error ============================================================================== --- head/contrib/byacc/test/yacc/err_syntax27.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/yacc/err_syntax27.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1 +1 @@ -YACC: e - line 3 of "./test/err_syntax27.y", missing '}' +YACC: e - line 3 of "./err_syntax27.y", missing '}' Modified: head/contrib/byacc/test/yacc/err_syntax3.error ============================================================================== --- head/contrib/byacc/test/yacc/err_syntax3.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/yacc/err_syntax3.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1,3 +1,3 @@ -YACC: e - line 6 of "./test/err_syntax3.y", unterminated string +YACC: e - line 6 of "./err_syntax3.y", unterminated string %token '(' '*' '& ^ Modified: head/contrib/byacc/test/yacc/err_syntax4.error ============================================================================== --- head/contrib/byacc/test/yacc/err_syntax4.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/yacc/err_syntax4.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1,3 +1,3 @@ -YACC: e - line 1 of "./test/err_syntax4.y", unmatched %{ +YACC: e - line 1 of "./err_syntax4.y", unmatched %{ %{ ^ Modified: head/contrib/byacc/test/yacc/err_syntax5.error ============================================================================== --- head/contrib/byacc/test/yacc/err_syntax5.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/yacc/err_syntax5.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1,3 +1,3 @@ -YACC: e - line 6 of "./test/err_syntax5.y", unterminated %union declaration +YACC: e - line 6 of "./err_syntax5.y", unterminated %union declaration %union { ^ Modified: head/contrib/byacc/test/yacc/err_syntax6.error ============================================================================== --- head/contrib/byacc/test/yacc/err_syntax6.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/yacc/err_syntax6.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1,3 +1,3 @@ -YACC: e - line 6 of "./test/err_syntax6.y", illegal tag +YACC: e - line 6 of "./err_syntax6.y", illegal tag %token '\777' ^ Modified: head/contrib/byacc/test/yacc/err_syntax7a.error ============================================================================== --- head/contrib/byacc/test/yacc/err_syntax7a.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/yacc/err_syntax7a.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1,3 +1,3 @@ -YACC: e - line 6 of "./test/err_syntax7a.y", illegal character +YACC: e - line 6 of "./err_syntax7a.y", illegal character %token '\xfff' ^ Modified: head/contrib/byacc/test/yacc/err_syntax7b.error ============================================================================== --- head/contrib/byacc/test/yacc/err_syntax7b.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/yacc/err_syntax7b.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1,3 +1,3 @@ -YACC: e - line 6 of "./test/err_syntax7b.y", illegal character +YACC: e - line 6 of "./err_syntax7b.y", illegal character %token '\x.' ^ Modified: head/contrib/byacc/test/yacc/err_syntax8.error ============================================================================== --- head/contrib/byacc/test/yacc/err_syntax8.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/yacc/err_syntax8.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1 +1 @@ -YACC: e - line 6 of "./test/err_syntax8.y", illegal use of reserved symbol . +YACC: e - line 6 of "./err_syntax8.y", illegal use of reserved symbol . Modified: head/contrib/byacc/test/yacc/err_syntax8a.error ============================================================================== --- head/contrib/byacc/test/yacc/err_syntax8a.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/yacc/err_syntax8a.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1 +1 @@ -YACC: e - line 6 of "./test/err_syntax8a.y", illegal use of reserved symbol $$123 +YACC: e - line 6 of "./err_syntax8a.y", illegal use of reserved symbol $$123 Modified: head/contrib/byacc/test/yacc/err_syntax9.error ============================================================================== --- head/contrib/byacc/test/yacc/err_syntax9.error Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/yacc/err_syntax9.error Thu Jul 17 22:22:38 2014 (r268811) @@ -1 +1 @@ -YACC: e - line 7 of "./test/err_syntax9.y", the start symbol text cannot be declared to be a token +YACC: e - line 7 of "./err_syntax9.y", the start symbol text cannot be declared to be a token Modified: head/contrib/byacc/test/yacc/help.output ============================================================================== --- head/contrib/byacc/test/yacc/help.output Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/yacc/help.output Thu Jul 17 22:22:38 2014 (r268811) @@ -4,7 +4,6 @@ Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives Modified: head/contrib/byacc/test/yacc/no_b_opt.output ============================================================================== --- head/contrib/byacc/test/yacc/no_b_opt.output Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/yacc/no_b_opt.output Thu Jul 17 22:22:38 2014 (r268811) @@ -4,7 +4,6 @@ Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives Modified: head/contrib/byacc/test/yacc/no_output2.output ============================================================================== --- head/contrib/byacc/test/yacc/no_output2.output Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/yacc/no_output2.output Thu Jul 17 22:22:38 2014 (r268811) @@ -4,7 +4,6 @@ Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives Modified: head/contrib/byacc/test/yacc/no_p_opt.output ============================================================================== --- head/contrib/byacc/test/yacc/no_p_opt.output Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/yacc/no_p_opt.output Thu Jul 17 22:22:38 2014 (r268811) @@ -4,7 +4,6 @@ Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives Modified: head/contrib/byacc/test/yacc/nostdin.output ============================================================================== --- head/contrib/byacc/test/yacc/nostdin.output Thu Jul 17 21:59:13 2014 (r268810) +++ head/contrib/byacc/test/yacc/nostdin.output Thu Jul 17 22:22:38 2014 (r268811) @@ -4,7 +4,6 @@ Options: -b file_prefix set filename prefix (default "y.") -B create a backtracking parser -d write definitions (.tab.h) - -D enable value stack memory reclamation -i write interface (y.tab.i) -g write a graphical description -l suppress #line directives Modified: head/usr.bin/yacc/tests/Makefile ============================================================================== --- head/usr.bin/yacc/tests/Makefile Thu Jul 17 21:59:13 2014 (r268810) +++ head/usr.bin/yacc/tests/Makefile Thu Jul 17 22:22:38 2014 (r268811) @@ -1,41 +1,334 @@ # $FreeBSD$ +.include + +TEST_DIR= ${.CURDIR}/../../../contrib/byacc/test + +.PATH: ${TEST_DIR} ${TEST_DIR}/yacc + TESTSDIR= ${TESTSBASE}/usr.bin/yacc -TAP_TESTS_SH= legacy_test +PLAIN_TESTS_SH= yacc_tests + +SCRIPTS= run_test +SCRIPTSDIR= ${TESTSDIR} + +FILESGROUPS= FILEStest FILEStest_yacc + +FILEStestDIR= ${TESTSDIR} + +FILEStest+= btyacc_calc1.y +FILEStest+= btyacc_demo.y +FILEStest+= calc.y +FILEStest+= calc1.y +FILEStest+= calc2.y +FILEStest+= calc3.y +FILEStest+= code_calc.y +FILEStest+= code_debug.y +FILEStest+= code_error.y +FILEStest+= empty.y +FILEStest+= err_inherit1.y +FILEStest+= err_inherit2.y +FILEStest+= err_inherit3.y +FILEStest+= err_inherit4.y +FILEStest+= err_inherit5.y +FILEStest+= err_syntax1.y +FILEStest+= err_syntax10.y +FILEStest+= err_syntax11.y +FILEStest+= err_syntax12.y +FILEStest+= err_syntax13.y +FILEStest+= err_syntax14.y +FILEStest+= err_syntax15.y +FILEStest+= err_syntax16.y +FILEStest+= err_syntax17.y +FILEStest+= err_syntax18.y +FILEStest+= err_syntax19.y +FILEStest+= err_syntax2.y +FILEStest+= err_syntax20.y +FILEStest+= err_syntax21.y +FILEStest+= err_syntax22.y +FILEStest+= err_syntax23.y +FILEStest+= err_syntax24.y +FILEStest+= err_syntax25.y +FILEStest+= err_syntax26.y +FILEStest+= err_syntax27.y +FILEStest+= err_syntax3.y +FILEStest+= err_syntax4.y +FILEStest+= err_syntax5.y +FILEStest+= err_syntax6.y +FILEStest+= err_syntax7.y +FILEStest+= err_syntax7a.y +FILEStest+= err_syntax7b.y +FILEStest+= err_syntax8.y +FILEStest+= err_syntax8a.y +FILEStest+= err_syntax9.y +FILEStest+= error.y +FILEStest+= grammar.y +FILEStest+= inherit0.y +FILEStest+= inherit1.y +FILEStest+= inherit2.y +FILEStest+= ok_syntax1.y +FILEStest+= pure_calc.y +FILEStest+= pure_error.y +FILEStest+= quote_calc.y +FILEStest+= quote_calc2.y +FILEStest+= quote_calc3.y +FILEStest+= quote_calc4.y +FILEStest+= varsyntax_calc1.y + +FILEStest_yaccDIR= ${TESTSDIR}/yacc -FILESDIR= ${TESTSDIR} -FILES= calc.y -FILES+= calc1.y -FILES+= calc2.y -FILES+= calc3.y -FILES+= code_calc.y -FILES+= code_error.y -FILES+= error.y -FILES+= ftp.y -FILES+= grammar.y -FILES+= pure_calc.y -FILES+= pure_error.y -FILES+= quote_calc.y -FILES+= quote_calc2.y -FILES+= quote_calc3.y -FILES+= quote_calc4.y -FILES+= regress.00.out -FILES+= regress.01.out -FILES+= regress.02.out -FILES+= regress.03.out -FILES+= regress.04.out -FILES+= regress.05.out -FILES+= regress.06.out -FILES+= regress.07.out -FILES+= regress.08.out -FILES+= regress.09.out -FILES+= regress.10.out -FILES+= regress.11.out -FILES+= regress.12.out -FILES+= regress.13.out -FILES+= regress.14.out -FILES+= regress.sh -FILES+= undefined.y +FILEStest_yacc+= big_b.error +FILEStest_yacc+= big_b.output +FILEStest_yacc+= big_l.error +FILEStest_yacc+= big_l.output +FILEStest_yacc+= calc.error +FILEStest_yacc+= calc.output +FILEStest_yacc+= calc.tab.c +FILEStest_yacc+= calc.tab.h +FILEStest_yacc+= calc1.error +FILEStest_yacc+= calc1.output +FILEStest_yacc+= calc1.tab.c +FILEStest_yacc+= calc1.tab.h +FILEStest_yacc+= calc2.error +FILEStest_yacc+= calc2.output +FILEStest_yacc+= calc2.tab.c +FILEStest_yacc+= calc2.tab.h +FILEStest_yacc+= calc3.error +FILEStest_yacc+= calc3.output +FILEStest_yacc+= calc3.tab.c +FILEStest_yacc+= calc3.tab.h +FILEStest_yacc+= code_calc.code.c +FILEStest_yacc+= code_calc.error +FILEStest_yacc+= code_calc.output +FILEStest_yacc+= code_calc.tab.c +FILEStest_yacc+= code_calc.tab.h +FILEStest_yacc+= code_error.code.c +FILEStest_yacc+= code_error.error +FILEStest_yacc+= code_error.output +FILEStest_yacc+= code_error.tab.c +FILEStest_yacc+= code_error.tab.h +FILEStest_yacc+= empty.error +FILEStest_yacc+= empty.output +FILEStest_yacc+= empty.tab.c +FILEStest_yacc+= empty.tab.h +FILEStest_yacc+= err_syntax1.error +FILEStest_yacc+= err_syntax1.output +FILEStest_yacc+= err_syntax1.tab.c +FILEStest_yacc+= err_syntax1.tab.h +FILEStest_yacc+= err_syntax10.error +FILEStest_yacc+= err_syntax10.output +FILEStest_yacc+= err_syntax10.tab.c +FILEStest_yacc+= err_syntax10.tab.h +FILEStest_yacc+= err_syntax11.error +FILEStest_yacc+= err_syntax11.output +FILEStest_yacc+= err_syntax11.tab.c +FILEStest_yacc+= err_syntax11.tab.h +FILEStest_yacc+= err_syntax12.error +FILEStest_yacc+= err_syntax12.output +FILEStest_yacc+= err_syntax12.tab.c +FILEStest_yacc+= err_syntax12.tab.h +FILEStest_yacc+= err_syntax13.error +FILEStest_yacc+= err_syntax13.output +FILEStest_yacc+= err_syntax13.tab.c +FILEStest_yacc+= err_syntax13.tab.h +FILEStest_yacc+= err_syntax14.error +FILEStest_yacc+= err_syntax14.output +FILEStest_yacc+= err_syntax14.tab.c +FILEStest_yacc+= err_syntax14.tab.h +FILEStest_yacc+= err_syntax15.error +FILEStest_yacc+= err_syntax15.output +FILEStest_yacc+= err_syntax15.tab.c +FILEStest_yacc+= err_syntax15.tab.h +FILEStest_yacc+= err_syntax16.error +FILEStest_yacc+= err_syntax16.output +FILEStest_yacc+= err_syntax16.tab.c +FILEStest_yacc+= err_syntax16.tab.h +FILEStest_yacc+= err_syntax17.error +FILEStest_yacc+= err_syntax17.output +FILEStest_yacc+= err_syntax17.tab.c +FILEStest_yacc+= err_syntax17.tab.h +FILEStest_yacc+= err_syntax18.error +FILEStest_yacc+= err_syntax18.output +FILEStest_yacc+= err_syntax18.tab.c +FILEStest_yacc+= err_syntax18.tab.h +FILEStest_yacc+= err_syntax19.error +FILEStest_yacc+= err_syntax19.output +FILEStest_yacc+= err_syntax19.tab.c +FILEStest_yacc+= err_syntax19.tab.h +FILEStest_yacc+= err_syntax2.error +FILEStest_yacc+= err_syntax2.output +FILEStest_yacc+= err_syntax2.tab.c +FILEStest_yacc+= err_syntax2.tab.h +FILEStest_yacc+= err_syntax20.error +FILEStest_yacc+= err_syntax20.output *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 22:26:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9EA82219; Thu, 17 Jul 2014 22:26: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 8CB572830; Thu, 17 Jul 2014 22:26:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6HMQOpU035642; Thu, 17 Jul 2014 22:26:24 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6HMQO0a035641; Thu, 17 Jul 2014 22:26:24 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201407172226.s6HMQO0a035641@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 17 Jul 2014 22:26:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268812 - head/etc/mtree X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 22:26:24 -0000 Author: bapt Date: Thu Jul 17 22:26:24 2014 New Revision: 268812 URL: http://svnweb.freebsd.org/changeset/base/268812 Log: Add the mtree entry for yacc tests Modified: head/etc/mtree/BSD.tests.dist Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Thu Jul 17 22:22:38 2014 (r268811) +++ head/etc/mtree/BSD.tests.dist Thu Jul 17 22:26:24 2014 (r268812) @@ -266,6 +266,8 @@ xargs .. yacc + yacc + .. .. .. usr.sbin From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 22:31:48 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7B071399; Thu, 17 Jul 2014 22:31:48 +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 6716E28BD; Thu, 17 Jul 2014 22:31:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6HMVmS5039568; Thu, 17 Jul 2014 22:31:48 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6HMVkt7039555; Thu, 17 Jul 2014 22:31:46 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201407172231.s6HMVkt7039555@svn.freebsd.org> From: Warner Losh Date: Thu, 17 Jul 2014 22:31:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268813 - in stable/10: . sys/amd64/conf sys/arm/conf sys/conf sys/i386/conf sys/ia64/conf sys/sparc64/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 22:31:48 -0000 Author: imp Date: Thu Jul 17 22:31:46 2014 New Revision: 268813 URL: http://svnweb.freebsd.org/changeset/base/268813 Log: MFC r263749,267146: >r267146 | imp | 2014-06-05 22:08:55 -0600 (Thu, 05 Jun 2014) | 4 lines >Restore comments accidentally removed. >r263749 | imp | 2014-03-25 16:08:31 -0600 (Tue, 25 Mar 2014) | 18 lines >Rather than require a makeoptions DEBUG to get debug correct, >add it in kern.mk, but only if we're using clang. While this >option is supported by both clang and gcc, in the future there >may be changes to clang which change the defaults that require >a tweak to build our kernel such that other tools in our tree >will work. Set a good example by forcing -gdwarf-2 only for >clang builds, and only if the user hasn't specified another >dwarf level already. Update UPDATING to reflect the changed >state of affairs. This also keeps us from having to update >all the ARM kernels to add this, and also keeps us from >in the future having to update all the MIPS kernels and is >one less place the user will have to know to do something >special for clang and one less thing developers will need >to do when moving an architecture to clang. Modified: stable/10/UPDATING stable/10/sys/amd64/conf/GENERIC stable/10/sys/arm/conf/ZEDBOARD stable/10/sys/conf/kern.mk stable/10/sys/i386/conf/GENERIC stable/10/sys/i386/conf/XEN stable/10/sys/ia64/conf/GENERIC stable/10/sys/sparc64/conf/GENERIC Directory Properties: stable/10/ (props changed) Modified: stable/10/UPDATING ============================================================================== --- stable/10/UPDATING Thu Jul 17 22:26:24 2014 (r268812) +++ stable/10/UPDATING Thu Jul 17 22:31:46 2014 (r268813) @@ -16,6 +16,13 @@ from older versions of FreeBSD, try WITH stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. +20140717: + It is no longer necessary to include the dwarf version in your DEBUG + options in your kernel config file. The bug that required it to be + placed in the config file has bene fixed. DEBUG should now just + contain -g. The build system will automatically update things + to do the right thing. + 20140715: Several ABI breaking changes were merged to CTL and new iSCSI code. All CTL and iSCSI-related tools, such as ctladm, ctld, iscsid and Modified: stable/10/sys/amd64/conf/GENERIC ============================================================================== --- stable/10/sys/amd64/conf/GENERIC Thu Jul 17 22:26:24 2014 (r268812) +++ stable/10/sys/amd64/conf/GENERIC Thu Jul 17 22:31:46 2014 (r268813) @@ -21,7 +21,7 @@ cpu HAMMER ident GENERIC -makeoptions DEBUG=-gdwarf-2 # Build kernel with gdb(1) debug symbols +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support options SCHED_ULE # ULE scheduler Modified: stable/10/sys/arm/conf/ZEDBOARD ============================================================================== --- stable/10/sys/arm/conf/ZEDBOARD Thu Jul 17 22:26:24 2014 (r268812) +++ stable/10/sys/arm/conf/ZEDBOARD Thu Jul 17 22:31:46 2014 (r268813) @@ -59,7 +59,7 @@ options VFP # vfp/neon options SMP # Symmetric MultiProcessor Kernel # Debugging -makeoptions DEBUG=-g +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols options DDB options KDB # options BREAK_TO_DEBUGGER Modified: stable/10/sys/conf/kern.mk ============================================================================== --- stable/10/sys/conf/kern.mk Thu Jul 17 22:26:24 2014 (r268812) +++ stable/10/sys/conf/kern.mk Thu Jul 17 22:31:46 2014 (r268813) @@ -159,3 +159,10 @@ CFLAGS+= -ffreestanding ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" CFLAGS+= -fstack-protector .endif + +# +# Add -gdwarf-2 when compiling -g +# +.if ${COMPILER_TYPE} == "clang" && ${CFLAGS:M-g} != "" && ${CFLAGS:M-gdwarf} == "" +CFLAGS+= -gdwarf-2 +.endif Modified: stable/10/sys/i386/conf/GENERIC ============================================================================== --- stable/10/sys/i386/conf/GENERIC Thu Jul 17 22:26:24 2014 (r268812) +++ stable/10/sys/i386/conf/GENERIC Thu Jul 17 22:31:46 2014 (r268813) @@ -23,7 +23,7 @@ cpu I586_CPU cpu I686_CPU ident GENERIC -makeoptions DEBUG=-gdwarf-2 # Build kernel with gdb(1) debug symbols +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support options SCHED_ULE # ULE scheduler Modified: stable/10/sys/i386/conf/XEN ============================================================================== --- stable/10/sys/i386/conf/XEN Thu Jul 17 22:26:24 2014 (r268812) +++ stable/10/sys/i386/conf/XEN Thu Jul 17 22:31:46 2014 (r268813) @@ -6,7 +6,7 @@ cpu I686_CPU ident XEN -makeoptions DEBUG=-gdwarf-2 # Build kernel with gdb(1) debug symbols +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols # The following modules don't build with PAE and XEN enabled. makeoptions WITHOUT_MODULES="ctl cxgb dpt drm drm2 hptmv ida malo mwl rdma" Modified: stable/10/sys/ia64/conf/GENERIC ============================================================================== --- stable/10/sys/ia64/conf/GENERIC Thu Jul 17 22:26:24 2014 (r268812) +++ stable/10/sys/ia64/conf/GENERIC Thu Jul 17 22:31:46 2014 (r268813) @@ -23,7 +23,7 @@ cpu ITANIUM2 ident GENERIC -makeoptions DEBUG=-g # Build kernel with debug information. +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols options AUDIT # Security event auditing options CAPABILITY_MODE # Capsicum capability mode Modified: stable/10/sys/sparc64/conf/GENERIC ============================================================================== --- stable/10/sys/sparc64/conf/GENERIC Thu Jul 17 22:26:24 2014 (r268812) +++ stable/10/sys/sparc64/conf/GENERIC Thu Jul 17 22:31:46 2014 (r268813) @@ -21,7 +21,7 @@ cpu SUN4U ident GENERIC -makeoptions DEBUG=-gdwarf-2 # Build kernel with gdb(1) debug symbols +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols # Platforms supported # At this time all platforms are supported, as-is. From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 22:42:20 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D6A73604; Thu, 17 Jul 2014 22:42:20 +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 B7FCF299B; Thu, 17 Jul 2014 22:42:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6HMgKgw044778; Thu, 17 Jul 2014 22:42:20 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6HMgJD9044765; Thu, 17 Jul 2014 22:42:19 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201407172242.s6HMgJD9044765@svn.freebsd.org> From: Warner Losh Date: Thu, 17 Jul 2014 22:42:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r268814 - in stable/9: . sys/amd64/conf sys/conf sys/i386/conf sys/ia64/conf sys/sparc64/conf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 22:42:21 -0000 Author: imp Date: Thu Jul 17 22:42:18 2014 New Revision: 268814 URL: http://svnweb.freebsd.org/changeset/base/268814 Log: MFC r263749,267146: >r267146 | imp | 2014-06-05 22:08:55 -0600 (Thu, 05 Jun 2014) | 4 lines >Restore comments accidentally removed. >r263749 | imp | 2014-03-25 16:08:31 -0600 (Tue, 25 Mar 2014) | 18 lines >Rather than require a makeoptions DEBUG to get debug correct, >add it in kern.mk, but only if we're using clang. While this >option is supported by both clang and gcc, in the future there >may be changes to clang which change the defaults that require >a tweak to build our kernel such that other tools in our tree >will work. Set a good example by forcing -gdwarf-2 only for >clang builds, and only if the user hasn't specified another >dwarf level already. Update UPDATING to reflect the changed >state of affairs. This also keeps us from having to update >all the ARM kernels to add this, and also keeps us from >in the future having to update all the MIPS kernels and is >one less place the user will have to know to do something >special for clang and one less thing developers will need >to do when moving an architecture to clang. Note: Due to the funkadellic way we used to do merges, I've made a direct commit of the relevant text to UPDATING with no merge info being recorded for it so I could commit it at the same time as the other files. Modified: stable/9/UPDATING stable/9/sys/amd64/conf/GENERIC stable/9/sys/conf/kern.mk stable/9/sys/i386/conf/GENERIC stable/9/sys/i386/conf/XEN stable/9/sys/ia64/conf/GENERIC stable/9/sys/sparc64/conf/GENERIC Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/UPDATING ============================================================================== --- stable/9/UPDATING Thu Jul 17 22:31:46 2014 (r268813) +++ stable/9/UPDATING Thu Jul 17 22:42:18 2014 (r268814) @@ -11,6 +11,13 @@ handbook: Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20140717: + It is no longer necessary to include the dwarf version in your DEBUG + options in your kernel config file. The bug that required it to be + placed in the config file has bene fixed. DEBUG should now just + contain -g. The build system will automatically update things + to do the right thing. + 20140716: 9.3-RELEASE. Modified: stable/9/sys/amd64/conf/GENERIC ============================================================================== --- stable/9/sys/amd64/conf/GENERIC Thu Jul 17 22:31:46 2014 (r268813) +++ stable/9/sys/amd64/conf/GENERIC Thu Jul 17 22:42:18 2014 (r268814) @@ -21,7 +21,7 @@ cpu HAMMER ident GENERIC -makeoptions DEBUG=-gdwarf-2 # Build kernel with gdb(1) debug symbols +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support options SCHED_ULE # ULE scheduler Modified: stable/9/sys/conf/kern.mk ============================================================================== --- stable/9/sys/conf/kern.mk Thu Jul 17 22:31:46 2014 (r268813) +++ stable/9/sys/conf/kern.mk Thu Jul 17 22:42:18 2014 (r268814) @@ -151,3 +151,10 @@ CFLAGS+= -ffreestanding ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" CFLAGS+= -fstack-protector .endif + +# +# Add -gdwarf-2 when compiling -g +# +.if ${COMPILER_TYPE} == "clang" && ${CFLAGS:M-g} != "" && ${CFLAGS:M-gdwarf} == "" +CFLAGS+= -gdwarf-2 +.endif Modified: stable/9/sys/i386/conf/GENERIC ============================================================================== --- stable/9/sys/i386/conf/GENERIC Thu Jul 17 22:31:46 2014 (r268813) +++ stable/9/sys/i386/conf/GENERIC Thu Jul 17 22:42:18 2014 (r268814) @@ -23,7 +23,7 @@ cpu I586_CPU cpu I686_CPU ident GENERIC -makeoptions DEBUG=-gdwarf-2 # Build kernel with gdb(1) debug symbols +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols makeoptions WITH_CTF=1 # Run ctfconvert(1) for DTrace support options SCHED_ULE # ULE scheduler Modified: stable/9/sys/i386/conf/XEN ============================================================================== --- stable/9/sys/i386/conf/XEN Thu Jul 17 22:31:46 2014 (r268813) +++ stable/9/sys/i386/conf/XEN Thu Jul 17 22:42:18 2014 (r268814) @@ -6,7 +6,7 @@ cpu I686_CPU ident XEN -makeoptions DEBUG=-gdwarf-2 # Build kernel with gdb(1) debug symbols +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols # The following modules don't build with PAE and XEN enabled. makeoptions WITHOUT_MODULES="ctl dpt drm drm2 hptmv ida malo mwl rdma xfs" Modified: stable/9/sys/ia64/conf/GENERIC ============================================================================== --- stable/9/sys/ia64/conf/GENERIC Thu Jul 17 22:31:46 2014 (r268813) +++ stable/9/sys/ia64/conf/GENERIC Thu Jul 17 22:42:18 2014 (r268814) @@ -23,7 +23,7 @@ cpu ITANIUM2 ident GENERIC -makeoptions DEBUG=-g # Build kernel with debug information. +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols options AUDIT # Security event auditing options CD9660 # ISO 9660 Filesystem Modified: stable/9/sys/sparc64/conf/GENERIC ============================================================================== --- stable/9/sys/sparc64/conf/GENERIC Thu Jul 17 22:31:46 2014 (r268813) +++ stable/9/sys/sparc64/conf/GENERIC Thu Jul 17 22:42:18 2014 (r268814) @@ -21,7 +21,7 @@ cpu SUN4U ident GENERIC -makeoptions DEBUG=-gdwarf-2 # Build kernel with gdb(1) debug symbols +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols # Platforms supported # At this time all platforms are supported, as-is. From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 22:58:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 711E5851; Thu, 17 Jul 2014 22:58:06 +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 5E0522A87; Thu, 17 Jul 2014 22:58:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6HMw62r050672; Thu, 17 Jul 2014 22:58:06 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6HMw6QF050671; Thu, 17 Jul 2014 22:58:06 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201407172258.s6HMw6QF050671@svn.freebsd.org> From: Warner Losh Date: Thu, 17 Jul 2014 22:58:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268815 - stable/10/sys/cam/ata X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 22:58:06 -0000 Author: imp Date: Thu Jul 17 22:58:05 2014 New Revision: 268815 URL: http://svnweb.freebsd.org/changeset/base/268815 Log: MFC: >r268205 | imp | 2014-07-02 23:22:13 -0600 (Wed, 02 Jul 2014) | 9 lines >Rework the BIO_DELETE code slightly. Always queue the BIO_DELETE >requests on the trim_queue, even for the CFA ERASE. This allows us, in >the future, to collapse adjacent requests. Since CFA ERASE is only for >CF cards, and it is so restrictive in what it can do, the collapse >code is not presently here. This also brings the ada driver more in >line with the da driver's treatment of BIO_DELETEs. Modified: stable/10/sys/cam/ata/ata_da.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ata/ata_da.c ============================================================================== --- stable/10/sys/cam/ata/ata_da.c Thu Jul 17 22:42:18 2014 (r268814) +++ stable/10/sys/cam/ata/ata_da.c Thu Jul 17 22:58:05 2014 (r268815) @@ -727,8 +727,11 @@ adastrategy(struct bio *bp) /* * Place it in the queue of disk activities for this disk */ - if (bp->bio_cmd == BIO_DELETE && - (softc->flags & ADA_FLAG_CAN_TRIM)) { + if (bp->bio_cmd == BIO_DELETE) { + KASSERT((softc->flags & ADA_FLAG_CAN_TRIM) || + ((softc->flags & ADA_FLAG_CAN_CFA) && + !(softc->flags & ADA_FLAG_CAN_48BIT)), + ("BIO_DELETE but no supported TRIM method.")); if (ADA_SIO) bioq_disksort(&softc->trim_queue, bp); else @@ -1386,6 +1389,96 @@ adaregister(struct cam_periph *periph, v } static void +ada_dsmtrim(struct ada_softc *softc, struct bio *bp, struct ccb_ataio *ataio) +{ + struct trim_request *req = &softc->trim_req; + uint64_t lastlba = (uint64_t)-1; + int c, lastcount = 0, off, ranges = 0; + + bzero(req, sizeof(*req)); + TAILQ_INIT(&req->bps); + do { + uint64_t lba = bp->bio_pblkno; + int count = bp->bio_bcount / softc->params.secsize; + + bioq_remove(&softc->trim_queue, bp); + + /* Try to extend the previous range. */ + if (lba == lastlba) { + c = min(count, ATA_DSM_RANGE_MAX - lastcount); + lastcount += c; + off = (ranges - 1) * ATA_DSM_RANGE_SIZE; + req->data[off + 6] = lastcount & 0xff; + req->data[off + 7] = + (lastcount >> 8) & 0xff; + count -= c; + lba += c; + } + + while (count > 0) { + c = min(count, ATA_DSM_RANGE_MAX); + off = ranges * ATA_DSM_RANGE_SIZE; + req->data[off + 0] = lba & 0xff; + req->data[off + 1] = (lba >> 8) & 0xff; + req->data[off + 2] = (lba >> 16) & 0xff; + req->data[off + 3] = (lba >> 24) & 0xff; + req->data[off + 4] = (lba >> 32) & 0xff; + req->data[off + 5] = (lba >> 40) & 0xff; + req->data[off + 6] = c & 0xff; + req->data[off + 7] = (c >> 8) & 0xff; + lba += c; + count -= c; + lastcount = c; + ranges++; + /* + * Its the caller's responsibility to ensure the + * request will fit so we don't need to check for + * overrun here + */ + } + lastlba = lba; + TAILQ_INSERT_TAIL(&req->bps, bp, bio_queue); + bp = bioq_first(&softc->trim_queue); + if (bp == NULL || + bp->bio_bcount / softc->params.secsize > + (softc->trim_max_ranges - ranges) * ATA_DSM_RANGE_MAX) + break; + } while (1); + cam_fill_ataio(ataio, + ada_retry_count, + adadone, + CAM_DIR_OUT, + 0, + req->data, + ((ranges + ATA_DSM_BLK_RANGES - 1) / + ATA_DSM_BLK_RANGES) * ATA_DSM_BLK_SIZE, + ada_default_timeout * 1000); + ata_48bit_cmd(ataio, ATA_DATA_SET_MANAGEMENT, + ATA_DSM_TRIM, 0, (ranges + ATA_DSM_BLK_RANGES - + 1) / ATA_DSM_BLK_RANGES); +} + +static void +ada_cfaerase(struct ada_softc *softc, struct bio *bp, struct ccb_ataio *ataio) +{ + uint64_t lba = bp->bio_pblkno; + uint16_t count = bp->bio_bcount / softc->params.secsize; + + cam_fill_ataio(ataio, + ada_retry_count, + adadone, + CAM_DIR_NONE, + 0, + NULL, + 0, + ada_default_timeout*1000); + + if (count >= 256) + count = 0; + ata_28bit_cmd(ataio, ATA_CFA_ERASE, 0, lba, count); +} + +static void adastart(struct cam_periph *periph, union ccb *start_ccb) { struct ada_softc *softc = (struct ada_softc *)periph->softc; @@ -1402,76 +1495,15 @@ adastart(struct cam_periph *periph, unio /* Run TRIM if not running yet. */ if (!softc->trim_running && (bp = bioq_first(&softc->trim_queue)) != 0) { - struct trim_request *req = &softc->trim_req; - struct bio *bp1; - uint64_t lastlba = (uint64_t)-1; - int c, lastcount = 0, off, ranges = 0; - + if (softc->flags & ADA_FLAG_CAN_TRIM) { + ada_dsmtrim(softc, bp, ataio); + } else if ((softc->flags & ADA_FLAG_CAN_CFA) && + !(softc->flags & ADA_FLAG_CAN_48BIT)) { + ada_cfaerase(softc, bp, ataio); + } else { + panic("adastart: BIO_DELETE without method, not possible."); + } softc->trim_running = 1; - bzero(req, sizeof(*req)); - TAILQ_INIT(&req->bps); - bp1 = bp; - do { - uint64_t lba = bp1->bio_pblkno; - int count = bp1->bio_bcount / - softc->params.secsize; - - bioq_remove(&softc->trim_queue, bp1); - - /* Try to extend the previous range. */ - if (lba == lastlba) { - c = min(count, ATA_DSM_RANGE_MAX - lastcount); - lastcount += c; - off = (ranges - 1) * ATA_DSM_RANGE_SIZE; - req->data[off + 6] = lastcount & 0xff; - req->data[off + 7] = - (lastcount >> 8) & 0xff; - count -= c; - lba += c; - } - - while (count > 0) { - c = min(count, ATA_DSM_RANGE_MAX); - off = ranges * ATA_DSM_RANGE_SIZE; - req->data[off + 0] = lba & 0xff; - req->data[off + 1] = (lba >> 8) & 0xff; - req->data[off + 2] = (lba >> 16) & 0xff; - req->data[off + 3] = (lba >> 24) & 0xff; - req->data[off + 4] = (lba >> 32) & 0xff; - req->data[off + 5] = (lba >> 40) & 0xff; - req->data[off + 6] = c & 0xff; - req->data[off + 7] = (c >> 8) & 0xff; - lba += c; - count -= c; - lastcount = c; - ranges++; - /* - * Its the caller's responsibility to ensure the - * request will fit so we don't need to check for - * overrun here - */ - } - lastlba = lba; - TAILQ_INSERT_TAIL(&req->bps, bp1, bio_queue); - bp1 = bioq_first(&softc->trim_queue); - if (bp1 == NULL || - bp1->bio_bcount / softc->params.secsize > - (softc->trim_max_ranges - ranges) * - ATA_DSM_RANGE_MAX) - break; - } while (1); - cam_fill_ataio(ataio, - ada_retry_count, - adadone, - CAM_DIR_OUT, - 0, - req->data, - ((ranges + ATA_DSM_BLK_RANGES - 1) / - ATA_DSM_BLK_RANGES) * ATA_DSM_BLK_SIZE, - ada_default_timeout * 1000); - ata_48bit_cmd(ataio, ATA_DATA_SET_MANAGEMENT, - ATA_DSM_TRIM, 0, (ranges + ATA_DSM_BLK_RANGES - - 1) / ATA_DSM_BLK_RANGES); start_ccb->ccb_h.ccb_state = ADA_CCB_TRIM; start_ccb->ccb_h.flags |= CAM_UNLOCKED; goto out; @@ -1606,25 +1638,6 @@ adastart(struct cam_periph *periph, unio } break; } - case BIO_DELETE: - { - uint64_t lba = bp->bio_pblkno; - uint16_t count = bp->bio_bcount / softc->params.secsize; - - cam_fill_ataio(ataio, - ada_retry_count, - adadone, - CAM_DIR_NONE, - 0, - NULL, - 0, - ada_default_timeout*1000); - - if (count >= 256) - count = 0; - ata_28bit_cmd(ataio, ATA_CFA_ERASE, 0, lba, count); - break; - } case BIO_FLUSH: cam_fill_ataio(ataio, 1, From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 23:05:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3AD25AEA; Thu, 17 Jul 2014 23:05: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 0E7E92B44; Thu, 17 Jul 2014 23:05:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6HN5KoC055263; Thu, 17 Jul 2014 23:05:20 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6HN5KiV055259; Thu, 17 Jul 2014 23:05:20 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201407172305.s6HN5KiV055259@svn.freebsd.org> From: Warner Losh Date: Thu, 17 Jul 2014 23:05:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268816 - in stable/10/sys/cam: ata scsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 23:05:21 -0000 Author: imp Date: Thu Jul 17 23:05:20 2014 New Revision: 268816 URL: http://svnweb.freebsd.org/changeset/base/268816 Log: MFC: >r267118 | imp | 2014-06-05 11:13:42 -0600 (Thu, 05 Jun 2014) | 9 lines >The code that combines adjacent ranges for BIO_DELETEs to optimize >trims to the device assumes the list is sorted. Don't apply the >optimization of not sorting the queue when we have SSDs to the >delete_queue, since it causes more discard traffic to the drive. While >one could argue that the higher levels should coalesce the trims, >that's not done today, so some optimization at this level is needed. >CR: https://phabric.freebsd.org/D142 Modified: stable/10/sys/cam/ata/ata_da.c stable/10/sys/cam/scsi/scsi_da.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ata/ata_da.c ============================================================================== --- stable/10/sys/cam/ata/ata_da.c Thu Jul 17 22:58:05 2014 (r268815) +++ stable/10/sys/cam/ata/ata_da.c Thu Jul 17 23:05:20 2014 (r268816) @@ -732,10 +732,7 @@ adastrategy(struct bio *bp) ((softc->flags & ADA_FLAG_CAN_CFA) && !(softc->flags & ADA_FLAG_CAN_48BIT)), ("BIO_DELETE but no supported TRIM method.")); - if (ADA_SIO) - bioq_disksort(&softc->trim_queue, bp); - else - bioq_insert_tail(&softc->trim_queue, bp); + bioq_disksort(&softc->trim_queue, bp); } else { if (ADA_SIO) bioq_disksort(&softc->bio_queue, bp); Modified: stable/10/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/10/sys/cam/scsi/scsi_da.c Thu Jul 17 22:58:05 2014 (r268815) +++ stable/10/sys/cam/scsi/scsi_da.c Thu Jul 17 23:05:20 2014 (r268816) @@ -1383,10 +1383,7 @@ dastrategy(struct bio *bp) * Place it in the queue of disk activities for this disk */ if (bp->bio_cmd == BIO_DELETE) { - if (DA_SIO) - bioq_disksort(&softc->delete_queue, bp); - else - bioq_insert_tail(&softc->delete_queue, bp); + bioq_disksort(&softc->delete_queue, bp); } else if (DA_SIO) { bioq_disksort(&softc->bio_queue, bp); } else { @@ -2805,16 +2802,9 @@ cmd6workaround(union ccb *ccb) da_delete_method_desc[old_method], da_delete_method_desc[softc->delete_method]); - if (DA_SIO) { - while ((bp = bioq_takefirst(&softc->delete_run_queue)) - != NULL) - bioq_disksort(&softc->delete_queue, bp); - } else { - while ((bp = bioq_takefirst(&softc->delete_run_queue)) - != NULL) - bioq_insert_tail(&softc->delete_queue, bp); - } - bioq_insert_tail(&softc->delete_queue, + while ((bp = bioq_takefirst(&softc->delete_run_queue)) != NULL) + bioq_disksort(&softc->delete_queue, bp); + bioq_disksort(&softc->delete_queue, (struct bio *)ccb->ccb_h.ccb_bp); ccb->ccb_h.ccb_bp = NULL; return (0); From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 23:14:48 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 76C02E8C; Thu, 17 Jul 2014 23:14:48 +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 651AE2C1C; Thu, 17 Jul 2014 23:14:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6HNEmbd060464; Thu, 17 Jul 2014 23:14:48 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6HNEmVx060463; Thu, 17 Jul 2014 23:14:48 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407172314.s6HNEmVx060463@svn.freebsd.org> From: Xin LI Date: Thu, 17 Jul 2014 23:14:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268817 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 23:14:48 -0000 Author: delphij Date: Thu Jul 17 23:14:47 2014 New Revision: 268817 URL: http://svnweb.freebsd.org/changeset/base/268817 Log: Fix markup regression introduced in r268369. Modified: head/share/man/man9/timeout.9 Modified: head/share/man/man9/timeout.9 ============================================================================== --- head/share/man/man9/timeout.9 Thu Jul 17 23:05:20 2014 (r268816) +++ head/share/man/man9/timeout.9 Thu Jul 17 23:14:47 2014 (r268817) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 23, 2013 +.Dd July 17, 2014 .Dt TIMEOUT 9 .Os .Sh NAME @@ -371,7 +371,6 @@ Specifies relative event time precision divided by acceptable time deviation: 1 -- 1/2, 2 -- 1/4, etc. Smaller value allows to aggregate more events in one timer interrupt to reduce processing overhead and power consumption. -.El .It Dv C_HARDCLOCK Align the timeouts, if possible, to .Fn hardclock From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 23:23:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0B67118; Thu, 17 Jul 2014 23:23:02 +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 9EC722CE9; Thu, 17 Jul 2014 23:23:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6HNN2xg064908; Thu, 17 Jul 2014 23:23:02 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6HNN2iB064905; Thu, 17 Jul 2014 23:23:02 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407172323.s6HNN2iB064905@svn.freebsd.org> From: Xin LI Date: Thu, 17 Jul 2014 23:23:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268818 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 23:23:02 -0000 Author: delphij Date: Thu Jul 17 23:23:01 2014 New Revision: 268818 URL: http://svnweb.freebsd.org/changeset/base/268818 Log: Fix markups. Modified: head/share/man/man9/socket.9 head/share/man/man9/usbdi.9 Modified: head/share/man/man9/socket.9 ============================================================================== --- head/share/man/man9/socket.9 Thu Jul 17 23:14:47 2014 (r268817) +++ head/share/man/man9/socket.9 Thu Jul 17 23:23:01 2014 (r268818) @@ -391,7 +391,7 @@ If is .Pf non- Dv NULL , only the -.Pf uio_resid +.Fa uio_resid of .Fa uio is used. Modified: head/share/man/man9/usbdi.9 ============================================================================== --- head/share/man/man9/usbdi.9 Thu Jul 17 23:14:47 2014 (r268817) +++ head/share/man/man9/usbdi.9 Thu Jul 17 23:23:01 2014 (r268818) @@ -507,7 +507,7 @@ This flag causes a failing USB transfer queue except in the case of "xfer->error" equal to "USB_ERR_CANCELLED". No other USB transfers in the affected PIPE queue will be started until either: -.Bl -tag -width "1" +.Bl -tag -width "X" .It 1 The failing USB transfer is stopped using "usbd_transfer_stop()". .It 2 From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 23:24:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4370625E; Thu, 17 Jul 2014 23:24:34 +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 31BCB2CF0; Thu, 17 Jul 2014 23:24:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6HNOYdI065111; Thu, 17 Jul 2014 23:24:34 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6HNOYHI065110; Thu, 17 Jul 2014 23:24:34 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201407172324.s6HNOYHI065110@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 17 Jul 2014 23:24:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268819 - head/tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 23:24:34 -0000 Author: bapt Date: Thu Jul 17 23:24:33 2014 New Revision: 268819 URL: http://svnweb.freebsd.org/changeset/base/268819 Log: Remove texinfo manpages as well if built WITHOUT_INFO Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Thu Jul 17 23:23:01 2014 (r268818) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Thu Jul 17 23:24:33 2014 (r268819) @@ -1983,6 +1983,13 @@ OLD_FILES+=usr/bin/infokey OLD_FILES+=usr/bin/install-info OLD_FILES+=usr/bin/makeinfo OLD_FILES+=usr/bin/texindex +OLD_FILES+=share/man/info.1.gz +OLD_FILES+=share/man/infokey.1.gz +OLD_FILES+=share/man/install-info.1.gz +OLD_FILES+=share/man/makeinfo.1.gz +OLD_FILES+=share/man/texindex.1.gz +OLD_FILES+=share/man/texinfo.5.gz +OLD_FILES+=share/man/info.5.gz OLD_FILES+=usr/share/info/am-utils.info.gz OLD_FILES+=usr/share/info/as-utils.info.gz OLD_FILES+=usr/share/info/binutils.info.gz From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 23:30:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B95C4E0; Thu, 17 Jul 2014 23:30: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 295E52D9C; Thu, 17 Jul 2014 23:30:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6HNUUA5066967; Thu, 17 Jul 2014 23:30:30 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6HNUUN4066966; Thu, 17 Jul 2014 23:30:30 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201407172330.s6HNUUN4066966@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 17 Jul 2014 23:30:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268820 - head/tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 23:30:30 -0000 Author: bapt Date: Thu Jul 17 23:30:29 2014 New Revision: 268820 URL: http://svnweb.freebsd.org/changeset/base/268820 Log: Fix manpages path and sort entries Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Thu Jul 17 23:24:33 2014 (r268819) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Thu Jul 17 23:30:29 2014 (r268820) @@ -1983,13 +1983,6 @@ OLD_FILES+=usr/bin/infokey OLD_FILES+=usr/bin/install-info OLD_FILES+=usr/bin/makeinfo OLD_FILES+=usr/bin/texindex -OLD_FILES+=share/man/info.1.gz -OLD_FILES+=share/man/infokey.1.gz -OLD_FILES+=share/man/install-info.1.gz -OLD_FILES+=share/man/makeinfo.1.gz -OLD_FILES+=share/man/texindex.1.gz -OLD_FILES+=share/man/texinfo.5.gz -OLD_FILES+=share/man/info.5.gz OLD_FILES+=usr/share/info/am-utils.info.gz OLD_FILES+=usr/share/info/as-utils.info.gz OLD_FILES+=usr/share/info/binutils.info.gz @@ -2009,6 +2002,13 @@ OLD_FILES+=usr/share/info/regex.info.gz OLD_FILES+=usr/share/info/rluserman.info.gz OLD_FILES+=usr/share/info/stabs.info.gz OLD_FILES+=usr/share/info/texinfo.info.gz +OLD_FILES+=usr/share/man/man1/info.1.gz +OLD_FILES+=usr/share/man/man1/infokey.1.gz +OLD_FILES+=usr/share/man/man1/install-info.1.gz +OLD_FILES+=usr/share/man/man1/makeinfo.1.gz +OLD_FILES+=usr/share/man/man1/texindex.1.gz +OLD_FILES+=usr/share/man/man5/info.5.gz +OLD_FILES+=usr/share/man/man5/texinfo.5.gz .endif .if ${MK_IPFILTER} == no From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 23:49:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 723C87B0; Thu, 17 Jul 2014 23:49:02 +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 53A8F2EC8; Thu, 17 Jul 2014 23:49:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6HNn2g2074815; Thu, 17 Jul 2014 23:49:02 GMT (envelope-from truckman@svn.freebsd.org) Received: (from truckman@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6HNn2BQ074814; Thu, 17 Jul 2014 23:49:02 GMT (envelope-from truckman@svn.freebsd.org) Message-Id: <201407172349.s6HNn2BQ074814@svn.freebsd.org> From: Don Lewis Date: Thu, 17 Jul 2014 23:49:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268821 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 23:49:02 -0000 Author: truckman Date: Thu Jul 17 23:49:01 2014 New Revision: 268821 URL: http://svnweb.freebsd.org/changeset/base/268821 Log: MFC r268373 Declaration whitespace changes for style(9). Modified: stable/10/sys/kern/subr_rman.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/subr_rman.c ============================================================================== --- stable/10/sys/kern/subr_rman.c Thu Jul 17 23:30:29 2014 (r268820) +++ stable/10/sys/kern/subr_rman.c Thu Jul 17 23:49:01 2014 (r268821) @@ -94,12 +94,12 @@ struct resource_i { u_long r_end; /* index of the last entry (inclusive) */ u_int r_flags; void *r_virtual; /* virtual address of this resource */ - struct device *r_dev; /* device which has allocated this resource */ - struct rman *r_rm; /* resource manager from whence this came */ + struct device *r_dev; /* device which has allocated this resource */ + struct rman *r_rm; /* resource manager from whence this came */ int r_rid; /* optional rid for this resource. */ }; -static int rman_debug = 0; +static int rman_debug = 0; TUNABLE_INT("debug.rman_debug", &rman_debug); SYSCTL_INT(_debug, OID_AUTO, rman_debug, CTLFLAG_RW, &rman_debug, 0, "rman debug"); @@ -108,12 +108,12 @@ SYSCTL_INT(_debug, OID_AUTO, rman_debug, static MALLOC_DEFINE(M_RMAN, "rman", "Resource manager"); -struct rman_head rman_head; -static struct mtx rman_mtx; /* mutex to protect rman_head */ -static int int_rman_activate_resource(struct rman *rm, struct resource_i *r, +struct rman_head rman_head; +static struct mtx rman_mtx; /* mutex to protect rman_head */ +static int int_rman_activate_resource(struct rman *rm, struct resource_i *r, struct resource_i **whohas); -static int int_rman_deactivate_resource(struct resource_i *r); -static int int_rman_release_resource(struct rman *rm, struct resource_i *r); +static int int_rman_deactivate_resource(struct resource_i *r); +static int int_rman_release_resource(struct rman *rm, struct resource_i *r); static __inline struct resource_i * int_alloc_resource(int malloc_flag) @@ -317,8 +317,8 @@ rman_last_free_region(struct rman *rm, u int rman_adjust_resource(struct resource *rr, u_long start, u_long end) { - struct resource_i *r, *s, *t, *new; - struct rman *rm; + struct resource_i *r, *s, *t, *new; + struct rman *rm; /* Not supported for shared resources. */ r = rr->__r_i; @@ -439,12 +439,12 @@ rman_adjust_resource(struct resource *rr struct resource * rman_reserve_resource_bound(struct rman *rm, u_long start, u_long end, - u_long count, u_long bound, u_int flags, - struct device *dev) + u_long count, u_long bound, u_int flags, + struct device *dev) { - u_int new_rflags; - struct resource_i *r, *s, *rv; - u_long rstart, rend, amask, bmask; + u_int new_rflags; + struct resource_i *r, *s, *rv; + u_long rstart, rend, amask, bmask; rv = NULL; @@ -721,9 +721,9 @@ rman_activate_resource(struct resource * int rman_await_resource(struct resource *re, int pri, int timo) { - int rv; - struct resource_i *r, *whohas; - struct rman *rm; + int rv; + struct resource_i *r, *whohas; + struct rman *rm; r = re->__r_i; rm = r->r_rm; @@ -759,7 +759,7 @@ int_rman_deactivate_resource(struct reso int rman_deactivate_resource(struct resource *r) { - struct rman *rm; + struct rman *rm; rm = r->__r_i->r_rm; mtx_lock(rm->rm_mtx); @@ -771,7 +771,7 @@ rman_deactivate_resource(struct resource static int int_rman_release_resource(struct rman *rm, struct resource_i *r) { - struct resource_i *s, *t; + struct resource_i *s, *t; if (r->r_flags & RF_ACTIVE) int_rman_deactivate_resource(r); @@ -865,9 +865,9 @@ out: int rman_release_resource(struct resource *re) { - int rv; - struct resource_i *r; - struct rman *rm; + int rv; + struct resource_i *r; + struct rman *rm; r = re->__r_i; rm = r->r_rm; @@ -880,7 +880,7 @@ rman_release_resource(struct resource *r uint32_t rman_make_alignment_flags(uint32_t size) { - int i; + int i; /* * Find the hightest bit set, and add one if more than one bit @@ -898,96 +898,112 @@ rman_make_alignment_flags(uint32_t size) void rman_set_start(struct resource *r, u_long start) { + r->__r_i->r_start = start; } u_long rman_get_start(struct resource *r) { + return (r->__r_i->r_start); } void rman_set_end(struct resource *r, u_long end) { + r->__r_i->r_end = end; } u_long rman_get_end(struct resource *r) { + return (r->__r_i->r_end); } u_long rman_get_size(struct resource *r) { + return (r->__r_i->r_end - r->__r_i->r_start + 1); } u_int rman_get_flags(struct resource *r) { + return (r->__r_i->r_flags); } void rman_set_virtual(struct resource *r, void *v) { + r->__r_i->r_virtual = v; } void * rman_get_virtual(struct resource *r) { + return (r->__r_i->r_virtual); } void rman_set_bustag(struct resource *r, bus_space_tag_t t) { + r->r_bustag = t; } bus_space_tag_t rman_get_bustag(struct resource *r) { + return (r->r_bustag); } void rman_set_bushandle(struct resource *r, bus_space_handle_t h) { + r->r_bushandle = h; } bus_space_handle_t rman_get_bushandle(struct resource *r) { + return (r->r_bushandle); } void rman_set_rid(struct resource *r, int rid) { + r->__r_i->r_rid = rid; } int rman_get_rid(struct resource *r) { + return (r->__r_i->r_rid); } void rman_set_device(struct resource *r, struct device *dev) { + r->__r_i->r_dev = dev; } struct device * rman_get_device(struct resource *r) { + return (r->__r_i->r_dev); } From owner-svn-src-all@FreeBSD.ORG Thu Jul 17 23:50:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F4D092F; Thu, 17 Jul 2014 23:50:50 +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 60E942ED5; Thu, 17 Jul 2014 23:50:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6HNoofD075754; Thu, 17 Jul 2014 23:50:50 GMT (envelope-from truckman@svn.freebsd.org) Received: (from truckman@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6HNoofe075734; Thu, 17 Jul 2014 23:50:50 GMT (envelope-from truckman@svn.freebsd.org) Message-Id: <201407172350.s6HNoofe075734@svn.freebsd.org> From: Don Lewis Date: Thu, 17 Jul 2014 23:50:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r268822 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Jul 2014 23:50:50 -0000 Author: truckman Date: Thu Jul 17 23:50:49 2014 New Revision: 268822 URL: http://svnweb.freebsd.org/changeset/base/268822 Log: MFC r268373 Declaration whitespace changes for style(9). Modified: stable/9/sys/kern/subr_rman.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/subr_rman.c ============================================================================== --- stable/9/sys/kern/subr_rman.c Thu Jul 17 23:49:01 2014 (r268821) +++ stable/9/sys/kern/subr_rman.c Thu Jul 17 23:50:49 2014 (r268822) @@ -94,12 +94,12 @@ struct resource_i { u_long r_end; /* index of the last entry (inclusive) */ u_int r_flags; void *r_virtual; /* virtual address of this resource */ - struct device *r_dev; /* device which has allocated this resource */ - struct rman *r_rm; /* resource manager from whence this came */ + struct device *r_dev; /* device which has allocated this resource */ + struct rman *r_rm; /* resource manager from whence this came */ int r_rid; /* optional rid for this resource. */ }; -static int rman_debug = 0; +static int rman_debug = 0; TUNABLE_INT("debug.rman_debug", &rman_debug); SYSCTL_INT(_debug, OID_AUTO, rman_debug, CTLFLAG_RW, &rman_debug, 0, "rman debug"); @@ -108,12 +108,12 @@ SYSCTL_INT(_debug, OID_AUTO, rman_debug, static MALLOC_DEFINE(M_RMAN, "rman", "Resource manager"); -struct rman_head rman_head; -static struct mtx rman_mtx; /* mutex to protect rman_head */ -static int int_rman_activate_resource(struct rman *rm, struct resource_i *r, +struct rman_head rman_head; +static struct mtx rman_mtx; /* mutex to protect rman_head */ +static int int_rman_activate_resource(struct rman *rm, struct resource_i *r, struct resource_i **whohas); -static int int_rman_deactivate_resource(struct resource_i *r); -static int int_rman_release_resource(struct rman *rm, struct resource_i *r); +static int int_rman_deactivate_resource(struct resource_i *r); +static int int_rman_release_resource(struct rman *rm, struct resource_i *r); static __inline struct resource_i * int_alloc_resource(int malloc_flag) @@ -312,8 +312,8 @@ rman_last_free_region(struct rman *rm, u int rman_adjust_resource(struct resource *rr, u_long start, u_long end) { - struct resource_i *r, *s, *t, *new; - struct rman *rm; + struct resource_i *r, *s, *t, *new; + struct rman *rm; /* Not supported for shared resources. */ r = rr->__r_i; @@ -434,12 +434,12 @@ rman_adjust_resource(struct resource *rr struct resource * rman_reserve_resource_bound(struct rman *rm, u_long start, u_long end, - u_long count, u_long bound, u_int flags, - struct device *dev) + u_long count, u_long bound, u_int flags, + struct device *dev) { - u_int new_rflags; - struct resource_i *r, *s, *rv; - u_long rstart, rend, amask, bmask; + u_int new_rflags; + struct resource_i *r, *s, *rv; + u_long rstart, rend, amask, bmask; rv = NULL; @@ -716,9 +716,9 @@ rman_activate_resource(struct resource * int rman_await_resource(struct resource *re, int pri, int timo) { - int rv; - struct resource_i *r, *whohas; - struct rman *rm; + int rv; + struct resource_i *r, *whohas; + struct rman *rm; r = re->__r_i; rm = r->r_rm; @@ -754,7 +754,7 @@ int_rman_deactivate_resource(struct reso int rman_deactivate_resource(struct resource *r) { - struct rman *rm; + struct rman *rm; rm = r->__r_i->r_rm; mtx_lock(rm->rm_mtx); @@ -766,7 +766,7 @@ rman_deactivate_resource(struct resource static int int_rman_release_resource(struct rman *rm, struct resource_i *r) { - struct resource_i *s, *t; + struct resource_i *s, *t; if (r->r_flags & RF_ACTIVE) int_rman_deactivate_resource(r); @@ -860,9 +860,9 @@ out: int rman_release_resource(struct resource *re) { - int rv; - struct resource_i *r; - struct rman *rm; + int rv; + struct resource_i *r; + struct rman *rm; r = re->__r_i; rm = r->r_rm; @@ -875,7 +875,7 @@ rman_release_resource(struct resource *r uint32_t rman_make_alignment_flags(uint32_t size) { - int i; + int i; /* * Find the hightest bit set, and add one if more than one bit @@ -893,96 +893,112 @@ rman_make_alignment_flags(uint32_t size) void rman_set_start(struct resource *r, u_long start) { + r->__r_i->r_start = start; } u_long rman_get_start(struct resource *r) { + return (r->__r_i->r_start); } void rman_set_end(struct resource *r, u_long end) { + r->__r_i->r_end = end; } u_long rman_get_end(struct resource *r) { + return (r->__r_i->r_end); } u_long rman_get_size(struct resource *r) { + return (r->__r_i->r_end - r->__r_i->r_start + 1); } u_int rman_get_flags(struct resource *r) { + return (r->__r_i->r_flags); } void rman_set_virtual(struct resource *r, void *v) { + r->__r_i->r_virtual = v; } void * rman_get_virtual(struct resource *r) { + return (r->__r_i->r_virtual); } void rman_set_bustag(struct resource *r, bus_space_tag_t t) { + r->r_bustag = t; } bus_space_tag_t rman_get_bustag(struct resource *r) { + return (r->r_bustag); } void rman_set_bushandle(struct resource *r, bus_space_handle_t h) { + r->r_bushandle = h; } bus_space_handle_t rman_get_bushandle(struct resource *r) { + return (r->r_bushandle); } void rman_set_rid(struct resource *r, int rid) { + r->__r_i->r_rid = rid; } int rman_get_rid(struct resource *r) { + return (r->__r_i->r_rid); } void rman_set_device(struct resource *r, struct device *dev) { + r->__r_i->r_dev = dev; } struct device * rman_get_device(struct resource *r) { + return (r->__r_i->r_dev); } From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 00:31:07 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6FA1C149; Fri, 18 Jul 2014 00:31:07 +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 5D2F92219; Fri, 18 Jul 2014 00:31:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6I0V7Rg096005; Fri, 18 Jul 2014 00:31:07 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6I0V7eE096004; Fri, 18 Jul 2014 00:31:07 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201407180031.s6I0V7eE096004@svn.freebsd.org> From: Navdeep Parhar Date: Fri, 18 Jul 2014 00:31:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268823 - stable/10/sys/dev/cxgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 00:31:07 -0000 Author: np Date: Fri Jul 18 00:31:06 2014 New Revision: 268823 URL: http://svnweb.freebsd.org/changeset/base/268823 Log: MFC r268706: cxgbe(4): Display CF facility correctly in the device log. Modified: stable/10/sys/dev/cxgbe/t4_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_main.c Thu Jul 17 23:50:49 2014 (r268822) +++ stable/10/sys/dev/cxgbe/t4_main.c Fri Jul 18 00:31:06 2014 (r268823) @@ -5391,6 +5391,7 @@ const char *devlog_level_strings[] = { const char *devlog_facility_strings[] = { [FW_DEVLOG_FACILITY_CORE] = "CORE", + [FW_DEVLOG_FACILITY_CF] = "CF", [FW_DEVLOG_FACILITY_SCHED] = "SCHED", [FW_DEVLOG_FACILITY_TIMER] = "TIMER", [FW_DEVLOG_FACILITY_RES] = "RES", From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 00:32:17 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9ED432B1; Fri, 18 Jul 2014 00:32:17 +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 8BE5F22A2; Fri, 18 Jul 2014 00:32:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6I0WHc7098366; Fri, 18 Jul 2014 00:32:17 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6I0WHrE098365; Fri, 18 Jul 2014 00:32:17 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201407180032.s6I0WHrE098365@svn.freebsd.org> From: Navdeep Parhar Date: Fri, 18 Jul 2014 00:32:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r268824 - stable/9/sys/dev/cxgbe X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 00:32:17 -0000 Author: np Date: Fri Jul 18 00:32:17 2014 New Revision: 268824 URL: http://svnweb.freebsd.org/changeset/base/268824 Log: MFC r268706: cxgbe(4): Display CF facility correctly in the device log. Modified: stable/9/sys/dev/cxgbe/t4_main.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/9/sys/dev/cxgbe/t4_main.c Fri Jul 18 00:31:06 2014 (r268823) +++ stable/9/sys/dev/cxgbe/t4_main.c Fri Jul 18 00:32:17 2014 (r268824) @@ -5361,6 +5361,7 @@ const char *devlog_level_strings[] = { const char *devlog_facility_strings[] = { [FW_DEVLOG_FACILITY_CORE] = "CORE", + [FW_DEVLOG_FACILITY_CF] = "CF", [FW_DEVLOG_FACILITY_SCHED] = "SCHED", [FW_DEVLOG_FACILITY_TIMER] = "TIMER", [FW_DEVLOG_FACILITY_RES] = "RES", From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 01:35:21 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 786B3BE8; Fri, 18 Jul 2014 01:35: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 6651326DE; Fri, 18 Jul 2014 01:35:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6I1ZLVC027828; Fri, 18 Jul 2014 01:35:21 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6I1ZLcJ027827; Fri, 18 Jul 2014 01:35:21 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201407180135.s6I1ZLcJ027827@svn.freebsd.org> From: Kevin Lo Date: Fri, 18 Jul 2014 01:35:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268825 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 01:35:21 -0000 Author: kevlo Date: Fri Jul 18 01:35:20 2014 New Revision: 268825 URL: http://svnweb.freebsd.org/changeset/base/268825 Log: Remove deprecated definition "m_act". Suggested by: adrian, glebius Modified: head/sys/sys/mbuf.h Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Fri Jul 18 00:32:17 2014 (r268824) +++ head/sys/sys/mbuf.h Fri Jul 18 01:35:20 2014 (r268825) @@ -202,7 +202,6 @@ struct mbuf { #define m_type m_hdr.mh_type #define m_flags m_hdr.mh_flags #define m_nextpkt m_hdr.mh_nextpkt -#define m_act m_nextpkt #define m_pkthdr M_dat.MH.MH_pkthdr #define m_ext M_dat.MH.MH_dat.MH_ext #define m_pktdat M_dat.MH.MH_dat.MH_databuf From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 01:49:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6857DE04; Fri, 18 Jul 2014 01:49:36 +0000 (UTC) Received: from ns.kevlo.org (220-135-115-6.HINET-IP.hinet.net [220.135.115.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "ns.kevlo.org", Issuer "ns.kevlo.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0659C27C8; Fri, 18 Jul 2014 01:49:34 +0000 (UTC) Received: from ns.kevlo.org (localhost [127.0.0.1]) by ns.kevlo.org (8.14.8/8.14.8) with ESMTP id s6I1ZN0c006874 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 18 Jul 2014 09:35:24 +0800 (CST) (envelope-from kevlo@ns.kevlo.org) Received: (from kevlo@localhost) by ns.kevlo.org (8.14.8/8.14.8/Submit) id s6I1ZN6q006873; Fri, 18 Jul 2014 09:35:23 +0800 (CST) (envelope-from kevlo) Date: Fri, 18 Jul 2014 09:35:23 +0800 From: Kevin Lo To: Adrian Chadd Subject: Re: svn commit: r268787 - in head/sys: kern net Message-ID: <20140718013523.GA6861@ns.kevlo.org> References: <201407170521.s6H5LGbx042649@svn.freebsd.org> <20140717141934.GI87212@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Gleb Smirnoff , src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 01:49:36 -0000 On Thu, Jul 17, 2014 at 10:35:20AM -0700, Adrian Chadd wrote: > +1. Would you like to do it or should I? Committed as r268825. Thanks. > A > On Jul 17, 2014 7:19 AM, "Gleb Smirnoff" wrote: > > > On Thu, Jul 17, 2014 at 05:21:16AM +0000, Kevin Lo wrote: > > K> Author: kevlo > > K> Date: Thu Jul 17 05:21:16 2014 > > K> New Revision: 268787 > > K> URL: http://svnweb.freebsd.org/changeset/base/268787 > > K> > > K> Log: > > K> Deprecate m_act. Use m_nextpkt always. > > > > Thanks. IMHO, the define should go away from mbuf.h as well. > > > > -- > > Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 02:49:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0924C7AD; Fri, 18 Jul 2014 02:49:42 +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 EA60C2BB6; Fri, 18 Jul 2014 02:49:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6I2nfuj062644; Fri, 18 Jul 2014 02:49:41 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6I2nfiF062643; Fri, 18 Jul 2014 02:49:41 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407180249.s6I2nfiF062643@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 18 Jul 2014 02:49:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268826 - head/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 02:49:42 -0000 Author: pfg Date: Fri Jul 18 02:49:41 2014 New Revision: 268826 URL: http://svnweb.freebsd.org/changeset/base/268826 Log: Minor sorting to match the NetBSD header MFC after: 3 days Obtained from: NetBSD Modified: head/include/search.h Modified: head/include/search.h ============================================================================== --- head/include/search.h Fri Jul 18 01:35:20 2014 (r268825) +++ head/include/search.h Fri Jul 18 02:49:41 2014 (r268826) @@ -1,8 +1,8 @@ /*- - * Written by J.T. Conklin + * Written by J.T. Conklin * Public domain. * - * $NetBSD: search.h,v 1.12 1999/02/22 10:34:28 christos Exp $ + * $NetBSD: search.h,v 1.18 2005/07/06 15:47:15 drochner Exp $ * $FreeBSD$ */ @@ -49,12 +49,14 @@ __BEGIN_DECLS int hcreate(size_t); void hdestroy(void); ENTRY *hsearch(ENTRY, ACTION); -void insque(void *, void *); + void *lfind(const void *, const void *, size_t *, size_t, int (*)(const void *, const void *)); void *lsearch(const void *, void *, size_t *, size_t, int (*)(const void *, const void *)); +void insque(void *, void *); void remque(void *); + void *tdelete(const void * __restrict, void ** __restrict, int (*)(const void *, const void *)); void *tfind(const void *, void * const *, From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 04:36:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6926D595; Fri, 18 Jul 2014 04:36:13 +0000 (UTC) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 07F972473; Fri, 18 Jul 2014 04:36:12 +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 mail105.syd.optusnet.com.au (Postfix) with ESMTPS id CD8D41040C35; Fri, 18 Jul 2014 14:36:04 +1000 (EST) Date: Fri, 18 Jul 2014 14:35:56 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Pedro F. Giffuni" Subject: Re: svn commit: r268826 - head/include In-Reply-To: <201407180249.s6I2nfiF062643@svn.freebsd.org> Message-ID: <20140718131924.O1045@besplex.bde.org> References: <201407180249.s6I2nfiF062643@svn.freebsd.org> 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=dZS5gxne c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=Ogwn7adZBHkA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=_ctWjzdLAAAA:8 a=FhG0xCA1nSh1j4XmuWsA:9 a=CjuIK1q_8ugA:10 a=wV7um_r7rhMA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 04:36:13 -0000 On Fri, 18 Jul 2014, Pedro F. Giffuni wrote: > Log: > Minor sorting to match the NetBSD header Unsorting. 2 other style bugs (extra blank lines). > MFC after: 3 days > Obtained from: NetBSD Please no. > Modified: > head/include/search.h > > Modified: head/include/search.h > ============================================================================== > --- head/include/search.h Fri Jul 18 01:35:20 2014 (r268825) > +++ head/include/search.h Fri Jul 18 02:49:41 2014 (r268826) > @@ -1,8 +1,8 @@ > /*- > - * Written by J.T. Conklin > + * Written by J.T. Conklin > * Public domain. > * > - * $NetBSD: search.h,v 1.12 1999/02/22 10:34:28 christos Exp $ > + * $NetBSD: search.h,v 1.18 2005/07/06 15:47:15 drochner Exp $ > * $FreeBSD$ > */ > > @@ -49,12 +49,14 @@ __BEGIN_DECLS > int hcreate(size_t); > void hdestroy(void); > ENTRY *hsearch(ENTRY, ACTION); > -void insque(void *, void *); > + > void *lfind(const void *, const void *, size_t *, size_t, > int (*)(const void *, const void *)); > void *lsearch(const void *, void *, size_t *, size_t, > int (*)(const void *, const void *)); > +void insque(void *, void *); > void remque(void *); > + > void *tdelete(const void * __restrict, void ** __restrict, > int (*)(const void *, const void *)); > void *tfind(const void *, void * const *, This does less than undo the style fixes made in FreeBSD, mostly in 2002 (it doesn't undo removing __P(()) or the indentation fix for twalk). The churn for unsorting insque() and the extra blank lines was already very complicated and ugly: - originally (in 4.4BSD-Lite), lfind(), lsearch(), insque() and remque() were compatibility cruft in libcompat. This was reflected by intentionally not declaring them in any header. - then in 2000, search.h was imported from NetBSD. The deprecation of the functions was broken by declaring them there. It was only hinted at by unsorting them into a subsection in the middle of the file, with insque() unsorted internally exactly as above, and extra blank lines to delimit the subsection, exactly as above. The current commit is a not quite complete regression to this version. - then in rev.1.2 in 2000, the subsection was commented out and marked as depricated (sic). The style of the rest of the commit was as good as its spelling. It also commented out bsearch(). The "depricated" comment at the beginning of the section made the extra blank lines non-extra, but the commit also removed the leading blank line so the subsection looked like it was attached to the previous one. - then in rev.1.3 in 2000, after I complained about 1.2, all the style bugs were fixed by removing all the commented out sections and the remaining extra blank line. - then in rev.1.8 in 2002, a comment was added about insque(), lsearch() and remque() being missing. lfind() was missing in the comment. See below about where they were. - then in rev.1.9 in 2002, insque() and remque() were moved back here to go with moving them from libcompat to libc. They were correctly sorted and not placed in an subsection. - then in rev.1.10 in 2002, lfind() and lsearch() were moved back here. There was no unsorting to fix for them, and they were not placed in a subsection. bsearch() is in C90. C90 of course doesn't have , and it put bsearch() in . 4.4BSD also doesn't have , and declared bsearch() in the correct place. This was broken in FreeBSD in 2000 by importing the "original" version of from NetBSD. The bug (extra misplaced declaration of bsearch()) only lived for 6 days. The other 4 churned functions were standardized by POSIX in 2001, so importing them and search.h was just in time to prepare for this version of POSIX and removing them in search.h within 6 days of the import was just in time to break this. FreeBSD didn't declare the functions in any standard header before search.h was imported. They were intentionally left out and had been dead for 10-15 years before POSIX brought them back. FreeBSD just had rotting bits in several places. There was a private search.h in lib/libc/db/hash. This header came complete with a comment about insque being depricated (sic), but didn't declare it. ed/ed.h used to have a home made version of insque(), and ed/README still has rotted bits documenting the defunct option NEED_INSQUE for configuring this. Since the other 4 churned functions are now standard, they shouldn't be unsorted in a special unsorted undocumented subsection. They are precisely as standard as all of the other functions in search.h. search.h doesn't have any extensions, and the prototypes in it are exactly as in POSIX.1-2001, except for minor formatting differences and now the unsorting of insque() and the extra blank lines. Bruce From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 05:22:08 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 048629A1 for ; Fri, 18 Jul 2014 05:22:08 +0000 (UTC) Received: from nm37-vm1.bullet.mail.bf1.yahoo.com (nm37-vm1.bullet.mail.bf1.yahoo.com [72.30.238.201]) (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 AAD3F27BF for ; Fri, 18 Jul 2014 05:22:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1405660532; bh=75xiGiDu5IgxkkNbNyIlGWoTtk73zWrJcG+lm6VzeYs=; h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc:Content-Transfer-Encoding:Message-Id:References:To:X-Mailer; b=dVWbNdqRyY8C7DHMeaVI3Da4G40+kNAxSmDJzuiAt+fqA4Z8+fABrwT76UehMrCmYS1bSYG031wgSEG2gs/FRwz7hE8SJZka3mbL7itNTOa9KDj+slZaQ/fW+NIxOAHMJ+uNtLgv5ZAtdoGzfH/qS4IeMKXfnE9qUddjSENCiYsWuz7bmaM1oKpz0o6uhVVDc8NS56QfPm8WAyMOBIg+8OibCIk/6CvvObYMspKCxGXTXM4VTWi5L7MCkPA98RSS+0a5YY5DDq2t7Dqx4X64lpgO8hkT+PzBniErD8sG3zN1pya4dVjJcL3JY+uAX67D1noXqLepjtBiyWpGBlQ/Gw== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com; b=LAUwJ/gebpHAeDp+rXKkP0gjY1Eufgy9YUWOlCdE0abQDh+mPbnHqrPapBNDgKPRa1EvXSz0pCT2JqoqBUVwQZ6XVvSpSeuz6ZH/yhIEVcLtSmbRkgqOuJxYgyj0LG39r/+bZe9QYPaRSgSthMT9j//LFB9Xy5kMOS4KXhobU8oq1X38yh26rOkmvixrL/9yDn/YtPVAXs6n0NYcs5vQQTLTu+/Ikvl/Q+9eU8oJ2gJy5ynPnbDEQexcRQgceu1bbeVnMHIOAHFEWAX1YOKUouUKFGPZM6LtSMuuLhWI6FC6q+VWytToQs7ahfSg2kLR5Ygvy7RNuPHNwhZ01RGA8A==; Received: from [98.139.215.142] by nm37.bullet.mail.bf1.yahoo.com with NNFMP; 18 Jul 2014 05:15:32 -0000 Received: from [98.139.211.197] by tm13.bullet.mail.bf1.yahoo.com with NNFMP; 18 Jul 2014 05:15:32 -0000 Received: from [127.0.0.1] by smtp206.mail.bf1.yahoo.com with NNFMP; 18 Jul 2014 05:15:32 -0000 X-Yahoo-Newman-Id: 245052.95761.bm@smtp206.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: km92zJsVM1ksZHkiU59QTpzQAijCcZszI4bta8ZEwXovR7j 7JoJ0B1VvRmWOfVBSnf4D14TbwQj3KJFE9X82M47XdLXIgg9vhF2VCZYji1p fTmI1rPNzcLTtN4bDFgpuDnqOmuOkbyVxg4khWerSA_Um0jjuhOgn9b8Flqk MwSKkAu5fmuSvqN_T9FDROCJTGb5.t8nwARsbzKJefon2793zmE1wlIPHlJh SBuw2BTjQNLMu7vwLHlFC7Qpco86ebCAsI3Nfe_gw6lKlUQdAjGBdz3htWNt hvCZkMXs1Nn1OQjurteDdiY29oseiKT0rowRjg4nTGj.CSTeFHF09KcZ_xIj fgXCxHsG2HJ.JJe9NhBxvdmYPok3ZOIffmo40YOgOdWzyjnTu_BMnqUNiKdO o8T6Nim0XAjnfv.u8_fcc9l0QPTRsy0myyRZoVt3YsoukhnKQV5p3c_Jgf05 5YHsQt55n1WTc.bFWtDJRFcOlIrR._u.4VaHhMbZ2anlmgZvcTW_fjQbDPqQ TKboVJzGrbaOt5hEgwV7MEwbK X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r268826 - head/include From: Pedro Giffuni In-Reply-To: <20140718131924.O1045@besplex.bde.org> Date: Fri, 18 Jul 2014 00:15:30 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201407180249.s6I2nfiF062643@svn.freebsd.org> <20140718131924.O1045@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 05:22:08 -0000 Hi; Il giorno 17/lug/2014, alle ore 23:35, Bruce Evans = ha scritto: > On Fri, 18 Jul 2014, Pedro F. Giffuni wrote: >=20 >> Log: >> Minor sorting to match the NetBSD header >=20 > Unsorting. >=20 > 2 other style bugs (extra blank lines). >=20 >> MFC after: 3 days >> Obtained from: NetBSD >=20 > Please no. OK, I will revert. >=20 >> Modified: >> head/include/search.h >>=20 >> Modified: head/include/search.h >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/include/search.h Fri Jul 18 01:35:20 2014 = (r268825) >> +++ head/include/search.h Fri Jul 18 02:49:41 2014 = (r268826) >> @@ -1,8 +1,8 @@ >> /*- >> - * Written by J.T. Conklin >> + * Written by J.T. Conklin >> * Public domain. >> * >> - * $NetBSD: search.h,v 1.12 1999/02/22 10:34:28 christos Exp $ >> + * $NetBSD: search.h,v 1.18 2005/07/06 15:47:15 drochner Exp $ >> * $FreeBSD$ >> */ >>=20 >> @@ -49,12 +49,14 @@ __BEGIN_DECLS >> int hcreate(size_t); >> void hdestroy(void); >> ENTRY *hsearch(ENTRY, ACTION); >> -void insque(void *, void *); >> + >> void *lfind(const void *, const void *, size_t *, size_t, >> int (*)(const void *, const void *)); >> void *lsearch(const void *, void *, size_t *, size_t, >> int (*)(const void *, const void *)); >> +void insque(void *, void *); >> void remque(void *); >> + >> void *tdelete(const void * __restrict, void ** __restrict, >> int (*)(const void *, const void *)); >> void *tfind(const void *, void * const *, >=20 > This does less than undo the style fixes made in FreeBSD, mostly in > 2002 (it doesn't undo removing __P(()) or the indentation fix for > twalk). >=20 NetBSD also removed __P(()) on this header. I noticed those changes and also the lack of bsearch. > The churn for unsorting insque() and the extra blank lines was already > very complicated and ugly: > - originally (in 4.4BSD-Lite), lfind(), lsearch(), insque() and = remque() were > compatibility cruft in libcompat. This was reflected by = intentionally > not declaring them in any header. > - then in 2000, search.h was imported from NetBSD. The deprecation of = the > functions was broken by declaring them there. It was only hinted at = by > unsorting them into a subsection in the middle of the file, with = insque() > unsorted internally exactly as above, and extra blank lines to = delimit > the subsection, exactly as above. The current commit is a not quite > complete regression to this version. > - then in rev.1.2 in 2000, the subsection was commented out and marked > as depricated (sic). The style of the rest of the commit was as good > as its spelling. It also commented out bsearch(). The "depricated" > comment at the beginning of the section made the extra blank lines > non-extra, but the commit also removed the leading blank line so > the subsection looked like it was attached to the previous one. > - then in rev.1.3 in 2000, after I complained about 1.2, all the style > bugs were fixed by removing all the commented out sections and the > remaining extra blank line. > - then in rev.1.8 in 2002, a comment was added about insque(), = lsearch() > and remque() being missing. lfind() was missing in the comment. See > below about where they were. > - then in rev.1.9 in 2002, insque() and remque() were moved back here = to > go with moving them from libcompat to libc. They were correctly > sorted and not placed in an subsection. > - then in rev.1.10 in 2002, lfind() and lsearch() were moved back = here. > There was no unsorting to fix for them, and they were not placed in > a subsection. >=20 > bsearch() is in C90. C90 of course doesn't have , and it = put > bsearch() in . 4.4BSD also doesn't have , and > declared bsearch() in the correct place. This was broken in FreeBSD > in 2000 by importing the "original" version of from NetBSD. > The bug (extra misplaced declaration of bsearch()) only lived for 6 > days. >=20 > The other 4 churned functions were standardized by POSIX in 2001, so > importing them and search.h was just in time to prepare for this = version > of POSIX and removing them in search.h within 6 days of the import was > just in time to break this. FreeBSD didn't declare the functions in > any standard header before search.h was imported. They were = intentionally > left out and had been dead for 10-15 years before POSIX brought them > back. FreeBSD just had rotting bits in several places. There was a > private search.h in lib/libc/db/hash. This header came complete with > a comment about insque being depricated (sic), but didn't declare it. > ed/ed.h used to have a home made version of insque(), and ed/README > still has rotted bits documenting the defunct option NEED_INSQUE for > configuring this. >=20 > Since the other 4 churned functions are now standard, they shouldn't > be unsorted in a special unsorted undocumented subsection. They are > precisely as standard as all of the other functions in search.h. > search.h doesn't have any extensions, and the prototypes in it are > exactly as in POSIX.1-2001, except for minor formatting differences > and now the unsorting of insque() and the extra blank lines. >=20 The reason for re-sorting was that I want to bring the reentrant = versions hcreate_r(), hcdestroy_r() and hsearch_r() (GNU extensions) from = NetBSD. NetBSD also re-licensed their (hsearch.c) implementation under 2-clause BSD license after adding the reentrant versions. I will leave the reentrant functions properly #ifdef=92ed at the end of = the file. and I will post the code for review when it=92s ready. Pedro. From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 06:48:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D369B8F7; Fri, 18 Jul 2014 06:48:03 +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 C0DA82E1A; Fri, 18 Jul 2014 06:48:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6I6m2Yo075750; Fri, 18 Jul 2014 06:48:02 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6I6m2U7075749; Fri, 18 Jul 2014 06:48:02 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201407180648.s6I6m2U7075749@svn.freebsd.org> From: Peter Wemm Date: Fri, 18 Jul 2014 06:48:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268827 - head/usr.sbin/ndp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 06:48:03 -0000 Author: peter Date: Fri Jul 18 06:48:02 2014 New Revision: 268827 URL: http://svnweb.freebsd.org/changeset/base/268827 Log: Fix "ndp -d hostname". Modified: head/usr.sbin/ndp/ndp.c Modified: head/usr.sbin/ndp/ndp.c ============================================================================== --- head/usr.sbin/ndp/ndp.c Fri Jul 18 02:49:41 2014 (r268826) +++ head/usr.sbin/ndp/ndp.c Fri Jul 18 06:48:02 2014 (r268827) @@ -188,9 +188,9 @@ main(int argc, char **argv) mode = ch; arg = NULL; break; - case 'd': case 'f': exit(file(optarg) ? 1 : 0); + case 'd': case 'i': if (mode) { usage(); From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 06:49:20 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 19FD4A38; Fri, 18 Jul 2014 06:49:20 +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 047062E21; Fri, 18 Jul 2014 06:49:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6I6nJig075949; Fri, 18 Jul 2014 06:49:19 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6I6nIVn075940; Fri, 18 Jul 2014 06:49:18 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201407180649.s6I6nIVn075940@svn.freebsd.org> From: Baptiste Daroussin Date: Fri, 18 Jul 2014 06:49:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r268828 - in vendor/libucl/dist: . doc include src tests uthash X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 06:49:20 -0000 Author: bapt Date: Fri Jul 18 06:49:18 2014 New Revision: 268828 URL: http://svnweb.freebsd.org/changeset/base/268828 Log: Import libucl 2014-07-16 Added: vendor/libucl/dist/ChangeLog.md vendor/libucl/dist/src/ucl_emitter_streamline.c (contents, props changed) vendor/libucl/dist/src/ucl_emitter_utils.c (contents, props changed) vendor/libucl/dist/tests/streamline.res vendor/libucl/dist/tests/streamline.test (contents, props changed) vendor/libucl/dist/tests/test_streamline.c (contents, props changed) Modified: vendor/libucl/dist/configure.ac vendor/libucl/dist/doc/api.md vendor/libucl/dist/doc/libucl.3 vendor/libucl/dist/doc/pandoc.template vendor/libucl/dist/include/ucl.h vendor/libucl/dist/src/Makefile.am vendor/libucl/dist/src/ucl_emitter.c vendor/libucl/dist/src/ucl_internal.h vendor/libucl/dist/src/ucl_parser.c vendor/libucl/dist/tests/Makefile.am vendor/libucl/dist/tests/test_basic.c vendor/libucl/dist/uthash/utstring.h Added: vendor/libucl/dist/ChangeLog.md ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libucl/dist/ChangeLog.md Fri Jul 18 06:49:18 2014 (r268828) @@ -0,0 +1,6 @@ +# Version history + +## Libucl 0.5 + +- Streamline emitter has been added, so it is now possible to output partial `ucl` objects +- Emitter now is more flexible due to emitter_context structure Modified: vendor/libucl/dist/configure.ac ============================================================================== --- vendor/libucl/dist/configure.ac Fri Jul 18 06:48:02 2014 (r268827) +++ vendor/libucl/dist/configure.ac Fri Jul 18 06:49:18 2014 (r268828) @@ -1,7 +1,7 @@ m4_define([maj_ver], [0]) -m4_define([med_ver], [4]) -m4_define([min_ver], [1]) -m4_define([so_version], [1:0:0]) +m4_define([med_ver], [5]) +m4_define([min_ver], [0]) +m4_define([so_version], [2:0:0]) m4_define([ucl_version], [maj_ver.med_ver.min_ver]) AC_INIT([libucl],[ucl_version],[https://github.com/vstakhov/libucl],[libucl]) Modified: vendor/libucl/dist/doc/api.md ============================================================================== --- vendor/libucl/dist/doc/api.md Fri Jul 18 06:48:02 2014 (r268827) +++ vendor/libucl/dist/doc/api.md Fri Jul 18 06:49:18 2014 (r268828) @@ -52,15 +52,15 @@ Used to parse `ucl` files and provide in ### Emitting functions Convert `ucl` objects to some textual or binary representation. Currently, libucl supports the following exports: -- `JSON` - valid json format (can possibly loose some original data, such as implicit arrays) -- `Config` - human-readable configuration format (losseless) +- `JSON` - valid json format (can possibly lose some original data, such as implicit arrays) +- `Config` - human-readable configuration format (lossless) - `YAML` - embedded yaml format (has the same limitations as `json` output) ### Conversion functions Help to convert `ucl` objects to C types. These functions are used to convert `ucl_object_t` to C primitive types, such as numbers, strings or boolean values. ### Generation functions -Allow creating of `ucl` objects from C types and creating of complex `ucl` objects, such as hashes or arrays from primitive `ucl` objects, such as numbers or strings. +Allow creation of `ucl` objects from C types and creating of complex `ucl` objects, such as hashes or arrays from primitive `ucl` objects, such as numbers or strings. ### Iteration functions Iterate over `ucl` complex objects or over a chain of values, for example when a key in an object has multiple values (that can be treated as implicit array or implicit consolidation). @@ -148,7 +148,7 @@ bool ucl_parser_add_file (struct ucl_par const char *filename); ~~~ -Load file `filename` and parse it with the specified `parser`. This function uses `mmap` call to load file, therefore, it should not be `shrinked` during parsing. Otherwise, `libucl` can cause memory corruption and terminate the calling application. This function is also used by the internal handler of `include` macro, hence, this macro has the same limitation. +Load file `filename` and parse it with the specified `parser`. This function uses `mmap` call to load file, therefore, it should not be `shrunk` during parsing. Otherwise, `libucl` can cause memory corruption and terminate the calling application. This function is also used by the internal handler of `include` macro, hence, this macro has the same limitation. ### ucl_parser_get_object @@ -225,7 +225,7 @@ ucl_parser_add_chunk (parser, inbuf, r); fclose (in); if (ucl_parser_get_error (parser)) { - printf ("Error occured: %s\n", ucl_parser_get_error (parser)); + printf ("Error occurred: %s\n", ucl_parser_get_error (parser)); ret = 1; } else { @@ -251,7 +251,7 @@ Libucl can transform UCL objects to a nu - compact yaml: `UCL_EMIT_YAML` - compact YAML output Moreover, libucl API allows to select a custom set of emitting functions allowing -efficent and zero-copy output of libucl objects. Libucl uses the following structure to support this feature: +efficient and zero-copy output of libucl objects. Libucl uses the following structure to support this feature: ~~~C struct ucl_emitter_functions { @@ -298,12 +298,12 @@ This function is similar to the previous # Conversion functions -Conversion functions are used to convert UCL objects to primitive types, such as strings, numbers or boolean values. There are two types of conversion functions: +Conversion functions are used to convert UCL objects to primitive types, such as strings, numbers, or boolean values. There are two types of conversion functions: - safe: try to convert an ucl object to a primitive type and fail if such a conversion is not possible - unsafe: return primitive type without additional checks, if the object cannot be converted then some reasonable default is returned (NULL for strings and 0 for numbers) -Also there is a single `ucl_object_tostring_forced` function that converts any UCL object (including compound types - arrays and objects) to a string representation. For compound and numeric types this function performs emitting to a compact json format actually. +Also there is a single `ucl_object_tostring_forced` function that converts any UCL object (including compound types - arrays and objects) to a string representation. For objects, arrays, booleans and numeric types this function performs emitting to a compact json format actually. Here is a list of all conversion functions: @@ -311,14 +311,14 @@ Here is a list of all conversion functio - `ucl_object_todouble` - returns `double` of UCL object - `ucl_object_toboolean` - returns `bool` of UCL object - `ucl_object_tostring` - returns `const char *` of UCL object (this string is NULL terminated) -- `ucl_object_tolstring` - returns `const char *` and `size_t` len of UCL object (string can be not NULL terminated) +- `ucl_object_tolstring` - returns `const char *` and `size_t` len of UCL object (string does not need to be NULL terminated) - `ucl_object_tostring_forced` - returns string representation of any UCL object Strings returned by these pointers are associated with the UCL object and exist over its lifetime. A caller should not free this memory. # Generation functions -It is possible to generate UCL objects from C primitive types. Moreover, libucl permits to create and modify complex UCL objects, such as arrays or associative objects. +It is possible to generate UCL objects from C primitive types. Moreover, libucl allows creation and modifying complex UCL objects, such as arrays or associative objects. ## ucl_object_new ~~~C @@ -350,8 +350,8 @@ Libucl provides the functions similar to - `ucl_object_fromint` - converts `int64_t` to UCL object - `ucl_object_fromdouble` - converts `double` to UCL object - `ucl_object_fromboolean` - converts `bool` to UCL object -- `ucl_object_fromstring` - converts `const char *` to UCL object (this string is NULL terminated) -- `ucl_object_fromlstring` - converts `const char *` and `size_t` len to UCL object (string can be not NULL terminated) +- `ucl_object_fromstring` - converts `const char *` to UCL object (this string should be NULL terminated) +- `ucl_object_fromlstring` - converts `const char *` and `size_t` len to UCL object (string does not need to be NULL terminated) Also there is a function to generate UCL object from a string performing various parsing or conversion operations called `ucl_object_fromstring_common`. @@ -361,7 +361,7 @@ ucl_object_t * ucl_object_fromstring_com size_t len, enum ucl_string_flags flags) ~~~ -This function is used to convert a string `str` of size `len` to an UCL objects applying `flags` conversions. If `len` is equal to zero then a `str` is assumed as NULL-terminated. This function supports the following flags (a set of flags can be specified using logical `OR` operation): +This function is used to convert a string `str` of size `len` to a UCL object applying `flags` conversions. If `len` is equal to zero then a `str` is assumed as NULL-terminated. This function supports the following flags (a set of flags can be specified using logical `OR` operation): - `UCL_STRING_ESCAPE` - perform JSON escape - `UCL_STRING_TRIM` - trim leading and trailing whitespaces @@ -385,7 +385,7 @@ const ucl_object_t* ucl_iterate_object ( ucl_object_iter_t *iter, bool expand_values); ~~~ -This function accept opaque iterator pointer `iter`. In the first call this iterator *must* be initialized to `NULL`. Iterator is changed by this function call. `ucl_iterate_object` returns the next UCL object in the compound object `obj` or `NULL` if all objects have been iterated. The reference count of the object returned is not increased, so a caller should not unref the object or modify its content (e.g. by inserting to another compound object). The object `obj` should not be changed during the iteration process as well. `expand_values` flag speicifies whether `ucl_iterate_object` should expand keys with multiple values. The general rule is that if you need to iterate throught the *object* or *explicit array*, then you always need to set this flag to `true`. However, if you get some key in the object and want to extract all its values then you should set `expand_values` to `false`. Mixing of iteration types are not permitted since the iterator is set according to the iteration type and cannot be reused. Here is an example of iteration over the objects using libucl API (assuming that `top` is `UCL_OBJECT` in this example): +This function accepts opaque iterator pointer `iter`. In the first call this iterator *must* be initialized to `NULL`. Iterator is changed by this function call. `ucl_iterate_object` returns the next UCL object in the compound object `obj` or `NULL` if all objects have been iterated. The reference count of the object returned is not increased, so a caller should not unref the object or modify its content (e.g. by inserting to another compound object). The object `obj` should not be changed during the iteration process as well. `expand_values` flag speicifies whether `ucl_iterate_object` should expand keys with multiple values. The general rule is that if you need to iterate through the *object* or *explicit array*, then you always need to set this flag to `true`. However, if you get some key in the object and want to extract all its values then you should set `expand_values` to `false`. Mixing of iteration types is not permitted since the iterator is set according to the iteration t ype and cannot be reused. Here is an example of iteration over the objects using libucl API (assuming that `top` is `UCL_OBJECT` in this example): ~~~C ucl_object_iter_t it = NULL, it_obj = NULL; @@ -412,13 +412,13 @@ bool ucl_object_validate (const ucl_obje const ucl_object_t *obj, struct ucl_schema_error *err); ~~~ -This function uses ucl object `schema`, that must be valid in terms of `json-schema` draft v4, to validate input object `obj`. If this function returns `true` then validation procedure has been succeed. Otherwise, `false` is returned and `err` is set to a specific value. If caller set `err` to NULL then this function does not set any error just returning `false`. Error is the structure defined as following: +This function uses ucl object `schema`, that must be valid in terms of `json-schema` draft v4, to validate input object `obj`. If this function returns `true` then validation procedure has been succeed. Otherwise, `false` is returned and `err` is set to a specific value. If a caller sets `err` to NULL then this function does not set any error just returning `false`. Error is the structure defined as following: ~~~C struct ucl_schema_error { enum ucl_schema_error_code code; /* error code */ char msg[128]; /* error message */ - ucl_object_t *obj; /* object where error occured */ + ucl_object_t *obj; /* object where error occurred */ }; ~~~ @@ -436,4 +436,4 @@ enum ucl_schema_error_code { }; ~~~ -`msg` is a stiring description of an error and `obj` is an object where error has been occurred. Error object is not allocated by libucl, so there is no need to free it after validation (a static object should thus be used). \ No newline at end of file +`msg` is a string description of an error and `obj` is an object where error has occurred. Error object is not allocated by libucl, so there is no need to free it after validation (a static object should thus be used). Modified: vendor/libucl/dist/doc/libucl.3 ============================================================================== --- vendor/libucl/dist/doc/libucl.3 Fri Jul 18 06:48:02 2014 (r268827) +++ vendor/libucl/dist/doc/libucl.3 Fri Jul 18 06:49:18 2014 (r268828) @@ -1,4 +1,4 @@ -.TH LIBUCL 5 "March 20, 2014" "Libucl manual" +.TH "LIBUCL" "3" "July 26, 2014" "Libucl manual" "" .SH NAME .PP \f[B]ucl_parser_new\f[], \f[B]ucl_parser_register_macro\f[], @@ -32,10 +32,10 @@ In future, this limitation can be remove Convert \f[C]ucl\f[] objects to some textual or binary representation. Currently, libucl supports the following exports: .IP \[bu] 2 -\f[C]JSON\f[] \- valid json format (can possibly loose some original +\f[C]JSON\f[] \- valid json format (can possibly lose some original data, such as implicit arrays) .IP \[bu] 2 -\f[C]Config\f[] \- human\-readable configuration format (losseless) +\f[C]Config\f[] \- human\-readable configuration format (lossless) .IP \[bu] 2 \f[C]YAML\f[] \- embedded yaml format (has the same limitations as \f[C]json\f[] output) @@ -46,7 +46,7 @@ These functions are used to convert \f[C types, such as numbers, strings or boolean values. .SS Generation functions .PP -Allow creating of \f[C]ucl\f[] objects from C types and creating of +Allow creation of \f[C]ucl\f[] objects from C types and creating of complex \f[C]ucl\f[] objects, such as hashes or arrays from primitive \f[C]ucl\f[] objects, such as numbers or strings. .SS Iteration functions @@ -175,7 +175,7 @@ bool\ ucl_parser_add_file\ (struct\ ucl_ Load file \f[C]filename\f[] and parse it with the specified \f[C]parser\f[]. This function uses \f[C]mmap\f[] call to load file, therefore, it should -not be \f[C]shrinked\f[] during parsing. +not be \f[C]shrunk\f[] during parsing. Otherwise, \f[C]libucl\f[] can cause memory corruption and terminate the calling application. This function is also used by the internal handler of \f[C]include\f[] @@ -290,7 +290,7 @@ ucl_parser_add_chunk\ (parser,\ inbuf,\ fclose\ (in); if\ (ucl_parser_get_error\ (parser))\ { -\ \ \ \ printf\ ("Error\ occured:\ %s\\n",\ ucl_parser_get_error\ (parser)); +\ \ \ \ printf\ ("Error\ occurred:\ %s\\n",\ ucl_parser_get_error\ (parser)); \ \ \ \ ret\ =\ 1; } else\ { @@ -323,7 +323,7 @@ newlines and spaces compact yaml: \f[C]UCL_EMIT_YAML\f[] \- compact YAML output .PP Moreover, libucl API allows to select a custom set of emitting functions -allowing efficent and zero\-copy output of libucl objects. +allowing efficient and zero\-copy output of libucl objects. Libucl uses the following structure to support this feature: .IP .nf @@ -390,7 +390,7 @@ emitters (including C++ ones, for exampl .SH CONVERSION FUNCTIONS .PP Conversion functions are used to convert UCL objects to primitive types, -such as strings, numbers or boolean values. +such as strings, numbers, or boolean values. There are two types of conversion functions: .IP \[bu] 2 safe: try to convert an ucl object to a primitive type and fail if such @@ -403,8 +403,8 @@ strings and 0 for numbers) Also there is a single \f[C]ucl_object_tostring_forced\f[] function that converts any UCL object (including compound types \- arrays and objects) to a string representation. -For compound and numeric types this function performs emitting to a -compact json format actually. +For objects, arrays, booleans and numeric types this function performs +emitting to a compact json format actually. .PP Here is a list of all conversion functions: .IP \[bu] 2 @@ -418,7 +418,8 @@ Here is a list of all conversion functio object (this string is NULL terminated) .IP \[bu] 2 \f[C]ucl_object_tolstring\f[] \- returns \f[C]const\ char\ *\f[] and -\f[C]size_t\f[] len of UCL object (string can be not NULL terminated) +\f[C]size_t\f[] len of UCL object (string does not need to be NULL +terminated) .IP \[bu] 2 \f[C]ucl_object_tostring_forced\f[] \- returns string representation of any UCL object @@ -429,7 +430,7 @@ A caller should not free this memory. .SH GENERATION FUNCTIONS .PP It is possible to generate UCL objects from C primitive types. -Moreover, libucl permits to create and modify complex UCL objects, such +Moreover, libucl allows creation and modifying complex UCL objects, such as arrays or associative objects. .SS ucl_object_new .IP @@ -467,10 +468,10 @@ converts \f[C]int64_t\f[] to UCL object \f[C]ucl_object_fromdouble\f[] \- converts \f[C]double\f[] to UCL object \- \f[C]ucl_object_fromboolean\f[] \- converts \f[C]bool\f[] to UCL object \- \f[C]ucl_object_fromstring\f[] \- converts -\f[C]const\ char\ *\f[] to UCL object (this string is NULL terminated) -\- \f[C]ucl_object_fromlstring\f[] \- converts \f[C]const\ char\ *\f[] -and \f[C]size_t\f[] len to UCL object (string can be not NULL -terminated) +\f[C]const\ char\ *\f[] to UCL object (this string should be NULL +terminated) \- \f[C]ucl_object_fromlstring\f[] \- converts +\f[C]const\ char\ *\f[] and \f[C]size_t\f[] len to UCL object (string +does not need to be NULL terminated) .PP Also there is a function to generate UCL object from a string performing various parsing or conversion operations called @@ -485,7 +486,7 @@ ucl_object_t\ *\ ucl_object_fromstring_c .fi .PP This function is used to convert a string \f[C]str\f[] of size -\f[C]len\f[] to an UCL objects applying \f[C]flags\f[] conversions. +\f[C]len\f[] to a UCL object applying \f[C]flags\f[] conversions. If \f[C]len\f[] is equal to zero then a \f[C]str\f[] is assumed as NULL\-terminated. This function supports the following flags (a set of flags can be @@ -538,7 +539,7 @@ const\ ucl_object_t*\ ucl_iterate_object \f[] .fi .PP -This function accept opaque iterator pointer \f[C]iter\f[]. +This function accepts opaque iterator pointer \f[C]iter\f[]. In the first call this iterator \f[I]must\f[] be initialized to \f[C]NULL\f[]. Iterator is changed by this function call. @@ -551,12 +552,12 @@ The object \f[C]obj\f[] should not be ch process as well. \f[C]expand_values\f[] flag speicifies whether \f[C]ucl_iterate_object\f[] should expand keys with multiple values. -The general rule is that if you need to iterate throught the +The general rule is that if you need to iterate through the \f[I]object\f[] or \f[I]explicit array\f[], then you always need to set this flag to \f[C]true\f[]. However, if you get some key in the object and want to extract all its values then you should set \f[C]expand_values\f[] to \f[C]false\f[]. -Mixing of iteration types are not permitted since the iterator is set +Mixing of iteration types is not permitted since the iterator is set according to the iteration type and cannot be reused. Here is an example of iteration over the objects using libucl API (assuming that \f[C]top\f[] is \f[C]UCL_OBJECT\f[] in this example): @@ -599,8 +600,8 @@ If this function returns \f[C]true\f[] t been succeed. Otherwise, \f[C]false\f[] is returned and \f[C]err\f[] is set to a specific value. -If caller set \f[C]err\f[] to NULL then this function does not set any -error just returning \f[C]false\f[]. +If a caller sets \f[C]err\f[] to NULL then this function does not set +any error just returning \f[C]false\f[]. Error is the structure defined as following: .IP .nf @@ -608,7 +609,7 @@ Error is the structure defined as follow struct\ ucl_schema_error\ { \ \ \ \ enum\ ucl_schema_error_code\ code;\ \ \ \ /*\ error\ code\ */ \ \ \ \ char\ msg[128];\ \ \ \ \ \ \ \ \ \ \ \ \ \ /*\ error\ message\ */ -\ \ \ \ ucl_object_t\ *obj;\ \ \ \ \ \ \ \ \ \ /*\ object\ where\ error\ occured\ */ +\ \ \ \ ucl_object_t\ *obj;\ \ \ \ \ \ \ \ \ \ /*\ object\ where\ error\ occurred\ */ }; \f[] .fi @@ -629,8 +630,8 @@ enum\ ucl_schema_error_code\ { \f[] .fi .PP -\f[C]msg\f[] is a stiring description of an error and \f[C]obj\f[] is an -object where error has been occurred. +\f[C]msg\f[] is a string description of an error and \f[C]obj\f[] is an +object where error has occurred. Error object is not allocated by libucl, so there is no need to free it after validation (a static object should thus be used). .SH AUTHORS Modified: vendor/libucl/dist/doc/pandoc.template ============================================================================== --- vendor/libucl/dist/doc/pandoc.template Fri Jul 18 06:48:02 2014 (r268827) +++ vendor/libucl/dist/doc/pandoc.template Fri Jul 18 06:49:18 2014 (r268828) @@ -1,6 +1,6 @@ -% LIBUCL(5) Libucl manual +% LIBUCL(3) Libucl manual % Vsevolod Stakhov -% March 20, 2014 +% July 26, 2014 # Name Modified: vendor/libucl/dist/include/ucl.h ============================================================================== --- vendor/libucl/dist/include/ucl.h Fri Jul 18 06:48:02 2014 (r268827) +++ vendor/libucl/dist/include/ucl.h Fri Jul 18 06:49:18 2014 (r268828) @@ -786,6 +786,7 @@ UCL_EXTERN bool ucl_parser_set_filevars * @{ */ +struct ucl_emitter_context; /** * Structure using for emitter callbacks */ @@ -798,10 +799,49 @@ struct ucl_emitter_functions { int (*ucl_emitter_append_int) (int64_t elt, void *ud); /** Append floating point element */ int (*ucl_emitter_append_double) (double elt, void *ud); + /** Free userdata */ + void (*ucl_emitter_free_func)(void *ud); /** Opaque userdata pointer */ void *ud; }; +struct ucl_emitter_operations { + /** Write a primitive element */ + void (*ucl_emitter_write_elt) (struct ucl_emitter_context *ctx, + const ucl_object_t *obj, bool first, bool print_key); + /** Start ucl object */ + void (*ucl_emitter_start_object) (struct ucl_emitter_context *ctx, + const ucl_object_t *obj, bool print_key); + /** End ucl object */ + void (*ucl_emitter_end_object) (struct ucl_emitter_context *ctx, + const ucl_object_t *obj); + /** Start ucl array */ + void (*ucl_emitter_start_array) (struct ucl_emitter_context *ctx, + const ucl_object_t *obj, bool print_key); + void (*ucl_emitter_end_array) (struct ucl_emitter_context *ctx, + const ucl_object_t *obj); +}; + +/** + * Structure that defines emitter functions + */ +struct ucl_emitter_context { + /** Name of emitter (e.g. json, compact_json) */ + const char *name; + /** Unique id (e.g. UCL_EMIT_JSON for standard emitters */ + int id; + /** A set of output functions */ + const struct ucl_emitter_functions *func; + /** A set of output operations */ + const struct ucl_emitter_operations *ops; + /** Current amount of indent tabs */ + unsigned int ident; + /** Top level object */ + const ucl_object_t *top; + /** The rest of context */ + unsigned char data[1]; +}; + /** * Emit object to a string * @param obj object @@ -817,11 +857,81 @@ UCL_EXTERN unsigned char *ucl_object_emi * @param obj object * @param emit_type if type is #UCL_EMIT_JSON then emit json, if type is * #UCL_EMIT_CONFIG then emit config like object + * @param emitter a set of emitter functions * @return dump of an object (must be freed after using) or NULL in case of error */ UCL_EXTERN bool ucl_object_emit_full (const ucl_object_t *obj, enum ucl_emitter emit_type, struct ucl_emitter_functions *emitter); + +/** + * Start streamlined UCL object emitter + * @param obj top UCL object + * @param emit_type emit type + * @param emitter a set of emitter functions + * @return new streamlined context that should be freed by + * `ucl_object_emit_streamline_finish` + */ +UCL_EXTERN struct ucl_emitter_context* ucl_object_emit_streamline_new ( + const ucl_object_t *obj, enum ucl_emitter emit_type, + struct ucl_emitter_functions *emitter); + +/** + * Start object or array container for the streamlined output + * @param ctx streamlined context + * @param obj container object + */ +UCL_EXTERN void ucl_object_emit_streamline_start_container ( + struct ucl_emitter_context *ctx, const ucl_object_t *obj); +/** + * Add a complete UCL object to streamlined output + * @param ctx streamlined context + * @param obj object to output + */ +UCL_EXTERN void ucl_object_emit_streamline_add_object ( + struct ucl_emitter_context *ctx, const ucl_object_t *obj); +/** + * End previously added container + * @param ctx streamlined context + */ +UCL_EXTERN void ucl_object_emit_streamline_end_container ( + struct ucl_emitter_context *ctx); +/** + * Terminate streamlined container finishing all containers in it + * @param ctx streamlined context + */ +UCL_EXTERN void ucl_object_emit_streamline_finish ( + struct ucl_emitter_context *ctx); + +/** + * Returns functions to emit object to memory + * @param pmem target pointer (should be freed by caller) + * @return emitter functions structure + */ +UCL_EXTERN struct ucl_emitter_functions* ucl_object_emit_memory_funcs ( + void **pmem); + +/** + * Returns functions to emit object to FILE * + * @param fp FILE * object + * @return emitter functions structure + */ +UCL_EXTERN struct ucl_emitter_functions* ucl_object_emit_file_funcs ( + FILE *fp); +/** + * Returns functions to emit object to a file descriptor + * @param fd file descriptor + * @return emitter functions structure + */ +UCL_EXTERN struct ucl_emitter_functions* ucl_object_emit_fd_funcs ( + int fd); + +/** + * Free emitter functions + * @param f pointer to functions + */ +UCL_EXTERN void ucl_object_emit_funcs_free (struct ucl_emitter_functions *f); + /** @} */ /** Modified: vendor/libucl/dist/src/Makefile.am ============================================================================== --- vendor/libucl/dist/src/Makefile.am Fri Jul 18 06:48:02 2014 (r268827) +++ vendor/libucl/dist/src/Makefile.am Fri Jul 18 06:49:18 2014 (r268828) @@ -4,6 +4,8 @@ libucl_common_cflags= -I$(top_srcdir)/sr -Wall -W -Wno-unused-parameter -Wno-pointer-sign lib_LTLIBRARIES= libucl.la libucl_la_SOURCES= ucl_emitter.c \ + ucl_emitter_streamline.c \ + ucl_emitter_utils.c \ ucl_hash.c \ ucl_parser.c \ ucl_schema.c \ Modified: vendor/libucl/dist/src/ucl_emitter.c ============================================================================== --- vendor/libucl/dist/src/ucl_emitter.c Fri Jul 18 06:48:02 2014 (r268827) +++ vendor/libucl/dist/src/ucl_emitter.c Fri Jul 18 06:49:18 2014 (r268828) @@ -36,38 +36,55 @@ #endif /** - * @file rcl_emitter.c + * @file ucl_emitter.c * Serialise UCL object to various of output formats */ +static void ucl_emitter_common_elt (struct ucl_emitter_context *ctx, + const ucl_object_t *obj, bool first, bool print_key, bool compact); + +#define UCL_EMIT_TYPE_OPS(type) \ + static void ucl_emit_ ## type ## _elt (struct ucl_emitter_context *ctx, \ + const ucl_object_t *obj, bool first, bool print_key); \ + static void ucl_emit_ ## type ## _start_obj (struct ucl_emitter_context *ctx, \ + const ucl_object_t *obj, bool print_key); \ + static void ucl_emit_ ## type## _start_array (struct ucl_emitter_context *ctx, \ + const ucl_object_t *obj, bool print_key); \ + static void ucl_emit_ ##type## _end_object (struct ucl_emitter_context *ctx, \ + const ucl_object_t *obj); \ + static void ucl_emit_ ##type## _end_array (struct ucl_emitter_context *ctx, \ + const ucl_object_t *obj) + +/* + * JSON format operations + */ +UCL_EMIT_TYPE_OPS(json); +UCL_EMIT_TYPE_OPS(json_compact); +UCL_EMIT_TYPE_OPS(config); +UCL_EMIT_TYPE_OPS(yaml); + +#define UCL_EMIT_TYPE_CONTENT(type) { \ + .ucl_emitter_write_elt = ucl_emit_ ## type ## _elt, \ + .ucl_emitter_start_object = ucl_emit_ ## type ##_start_obj, \ + .ucl_emitter_start_array = ucl_emit_ ## type ##_start_array, \ + .ucl_emitter_end_object = ucl_emit_ ## type ##_end_object, \ + .ucl_emitter_end_array = ucl_emit_ ## type ##_end_array \ +} + + +const struct ucl_emitter_operations ucl_standartd_emitter_ops[] = { + [UCL_EMIT_JSON] = UCL_EMIT_TYPE_CONTENT(json), + [UCL_EMIT_JSON_COMPACT] = UCL_EMIT_TYPE_CONTENT(json_compact), + [UCL_EMIT_CONFIG] = UCL_EMIT_TYPE_CONTENT(config), + [UCL_EMIT_YAML] = UCL_EMIT_TYPE_CONTENT(yaml) +}; + +/* + * Utility to check whether we need a top object + */ +#define UCL_EMIT_IDENT_TOP_OBJ(ctx, obj) ((ctx)->top != (obj) || \ + ((ctx)->id == UCL_EMIT_JSON_COMPACT || (ctx)->id == UCL_EMIT_JSON)) -static void ucl_obj_write_json (const ucl_object_t *obj, - struct ucl_emitter_functions *func, - unsigned int tabs, - bool start_tabs, - bool compact); -static void ucl_elt_write_json (const ucl_object_t *obj, - struct ucl_emitter_functions *func, - unsigned int tabs, - bool start_tabs, - bool compact); -static void ucl_elt_write_config (const ucl_object_t *obj, - struct ucl_emitter_functions *func, - unsigned int tabs, - bool start_tabs, - bool is_top, - bool expand_array); -static void ucl_elt_write_yaml (const ucl_object_t *obj, - struct ucl_emitter_functions *func, - unsigned int tabs, - bool start_tabs, - bool compact, - bool expand_array); -static void ucl_elt_array_write_yaml (const ucl_object_t *obj, - struct ucl_emitter_functions *func, - unsigned int tabs, - bool start_tabs, - bool is_top); /** * Add tabulation to the output buffer @@ -75,689 +92,358 @@ static void ucl_elt_array_write_yaml (co * @param tabs number of tabs to add */ static inline void -ucl_add_tabs (struct ucl_emitter_functions *func, unsigned int tabs, bool compact) +ucl_add_tabs (const struct ucl_emitter_functions *func, unsigned int tabs, + bool compact) { - if (!compact) { + if (!compact && tabs > 0) { func->ucl_emitter_append_character (' ', tabs * 4, func->ud); } } /** - * Serialise string - * @param str string to emit - * @param buf target buffer + * Print key for the element + * @param ctx + * @param obj */ static void -ucl_elt_string_write_json (const char *str, size_t size, - struct ucl_emitter_functions *func) +ucl_emitter_print_key (bool print_key, struct ucl_emitter_context *ctx, + const ucl_object_t *obj, bool compact) { - const char *p = str, *c = str; - size_t len = 0; + const struct ucl_emitter_functions *func = ctx->func; - func->ucl_emitter_append_character ('"', 1, func->ud); - while (size) { - if (ucl_test_character (*p, UCL_CHARACTER_JSON_UNSAFE)) { - if (len > 0) { - func->ucl_emitter_append_len (c, len, func->ud); - } - switch (*p) { - case '\n': - func->ucl_emitter_append_len ("\\n", 2, func->ud); - break; - case '\r': - func->ucl_emitter_append_len ("\\r", 2, func->ud); - break; - case '\b': - func->ucl_emitter_append_len ("\\b", 2, func->ud); - break; - case '\t': - func->ucl_emitter_append_len ("\\t", 2, func->ud); - break; - case '\f': - func->ucl_emitter_append_len ("\\f", 2, func->ud); - break; - case '\\': - func->ucl_emitter_append_len ("\\\\", 2, func->ud); - break; - case '"': - func->ucl_emitter_append_len ("\\\"", 2, func->ud); - break; - } - len = 0; - c = ++p; + if (!print_key) { + return; + } + + if (ctx->id == UCL_EMIT_CONFIG) { + if (obj->flags & UCL_OBJECT_NEED_KEY_ESCAPE) { + ucl_elt_string_write_json (obj->key, obj->keylen, ctx); } else { - p ++; - len ++; + func->ucl_emitter_append_len (obj->key, obj->keylen, func->ud); } - size --; - } - if (len > 0) { - func->ucl_emitter_append_len (c, len, func->ud); - } - func->ucl_emitter_append_character ('"', 1, func->ud); -} -/** - * Write a single object to the buffer - * @param obj object to write - * @param buf target buffer - */ -static void -ucl_elt_obj_write_json (const ucl_object_t *obj, struct ucl_emitter_functions *func, - unsigned int tabs, bool start_tabs, bool compact) -{ - const ucl_object_t *cur; - ucl_hash_iter_t it = NULL; - - if (start_tabs) { - ucl_add_tabs (func, tabs, compact); - } - if (compact) { - func->ucl_emitter_append_character ('{', 1, func->ud); + if (obj->type != UCL_OBJECT && obj->type != UCL_ARRAY) { + func->ucl_emitter_append_len (" = ", 3, func->ud); + } + else { + func->ucl_emitter_append_character (' ', 1, func->ud); + } } else { - func->ucl_emitter_append_len ("{\n", 2, func->ud); - } - while ((cur = ucl_hash_iterate (obj->value.ov, &it))) { - ucl_add_tabs (func, tabs + 1, compact); - if (cur->keylen > 0) { - ucl_elt_string_write_json (cur->key, cur->keylen, func); + if (obj->keylen > 0) { + ucl_elt_string_write_json (obj->key, obj->keylen, ctx); } else { func->ucl_emitter_append_len ("null", 4, func->ud); } + if (compact) { func->ucl_emitter_append_character (':', 1, func->ud); } else { func->ucl_emitter_append_len (": ", 2, func->ud); } - ucl_obj_write_json (cur, func, tabs + 1, false, compact); - if (ucl_hash_iter_has_next (it)) { - if (compact) { - func->ucl_emitter_append_character (',', 1, func->ud); - } - else { - func->ucl_emitter_append_len (",\n", 2, func->ud); - } - } - else if (!compact) { - func->ucl_emitter_append_character ('\n', 1, func->ud); - } } - ucl_add_tabs (func, tabs, compact); - func->ucl_emitter_append_character ('}', 1, func->ud); } -/** - * Write a single array to the buffer - * @param obj array to write - * @param buf target buffer - */ static void -ucl_elt_array_write_json (const ucl_object_t *obj, struct ucl_emitter_functions *func, - unsigned int tabs, bool start_tabs, bool compact) +ucl_emitter_finish_object (struct ucl_emitter_context *ctx, + const ucl_object_t *obj, bool compact, bool is_array) { - const ucl_object_t *cur = obj; + const struct ucl_emitter_functions *func = ctx->func; - if (start_tabs) { - ucl_add_tabs (func, tabs, compact); - } - if (compact) { - func->ucl_emitter_append_character ('[', 1, func->ud); - } - else { - func->ucl_emitter_append_len ("[\n", 2, func->ud); - } - while (cur) { - ucl_elt_write_json (cur, func, tabs + 1, true, compact); - if (cur->next != NULL) { - if (compact) { - func->ucl_emitter_append_character (',', 1, func->ud); + if (ctx->id == UCL_EMIT_CONFIG && obj != ctx->top) { + if (obj->type != UCL_OBJECT && obj->type != UCL_ARRAY) { + if (!is_array) { + /* Objects are split by ';' */ + func->ucl_emitter_append_len (";\n", 2, func->ud); } else { + /* Use commas for arrays */ func->ucl_emitter_append_len (",\n", 2, func->ud); } } - else if (!compact) { - func->ucl_emitter_append_character ('\n', 1, func->ud); - } - cur = cur->next; - } - ucl_add_tabs (func, tabs, compact); - func->ucl_emitter_append_character (']', 1, func->ud); -} - -/** - * Emit a single element - * @param obj object - * @param buf buffer - */ -static void -ucl_elt_write_json (const ucl_object_t *obj, struct ucl_emitter_functions *func, - unsigned int tabs, bool start_tabs, bool compact) -{ - bool flag; - - switch (obj->type) { - case UCL_INT: - if (start_tabs) { - ucl_add_tabs (func, tabs, compact); - } - func->ucl_emitter_append_int (ucl_object_toint (obj), func->ud); - break; - case UCL_FLOAT: - case UCL_TIME: - if (start_tabs) { - ucl_add_tabs (func, tabs, compact); - } - func->ucl_emitter_append_double (ucl_object_todouble (obj), func->ud); - break; - case UCL_BOOLEAN: - if (start_tabs) { - ucl_add_tabs (func, tabs, compact); - } - flag = ucl_object_toboolean (obj); - if (flag) { - func->ucl_emitter_append_len ("true", 4, func->ud); - } else { - func->ucl_emitter_append_len ("false", 5, func->ud); - } - break; - case UCL_STRING: - if (start_tabs) { - ucl_add_tabs (func, tabs, compact); - } - ucl_elt_string_write_json (obj->value.sv, obj->len, func); - break; - case UCL_NULL: - if (start_tabs) { - ucl_add_tabs (func, tabs, compact); + func->ucl_emitter_append_character ('\n', 1, func->ud); } - func->ucl_emitter_append_len ("null", 4, func->ud); - break; - case UCL_OBJECT: - ucl_elt_obj_write_json (obj, func, tabs, start_tabs, compact); - break; - case UCL_ARRAY: - ucl_elt_array_write_json (obj->value.av, func, tabs, start_tabs, compact); - break; - case UCL_USERDATA: - break; } } /** - * Write a single object to the buffer - * @param obj object - * @param buf target buffer + * End standard ucl object + * @param ctx emitter context + * @param compact compact flag */ static void -ucl_obj_write_json (const ucl_object_t *obj, struct ucl_emitter_functions *func, - unsigned int tabs, bool start_tabs, bool compact) +ucl_emitter_common_end_object (struct ucl_emitter_context *ctx, + const ucl_object_t *obj, bool compact) { - const ucl_object_t *cur; - bool is_array = (obj->next != NULL); - - if (is_array) { - /* This is an array actually */ - if (start_tabs) { - ucl_add_tabs (func, tabs, compact); - } + const struct ucl_emitter_functions *func = ctx->func; + if (UCL_EMIT_IDENT_TOP_OBJ(ctx, obj)) { + ctx->ident --; if (compact) { - func->ucl_emitter_append_character ('[', 1, func->ud); + func->ucl_emitter_append_character ('}', 1, func->ud); } else { - func->ucl_emitter_append_len ("[\n", 2, func->ud); - } - cur = obj; - while (cur != NULL) { - ucl_elt_write_json (cur, func, tabs + 1, true, compact); - if (cur->next) { - func->ucl_emitter_append_character (',', 1, func->ud); - } - if (!compact) { + if (ctx->id != UCL_EMIT_CONFIG) { + /* newline is already added for this format */ func->ucl_emitter_append_character ('\n', 1, func->ud); } - cur = cur->next; + ucl_add_tabs (func, ctx->ident, compact); + func->ucl_emitter_append_character ('}', 1, func->ud); } - ucl_add_tabs (func, tabs, compact); - func->ucl_emitter_append_character (']', 1, func->ud); - } - else { - ucl_elt_write_json (obj, func, tabs, start_tabs, compact); } + ucl_emitter_finish_object (ctx, obj, compact, false); } /** - * Emit an object to json - * @param obj object - * @return json output (should be freed after using) + * End standard ucl array + * @param ctx emitter context + * @param compact compact flag */ static void -ucl_object_emit_json (const ucl_object_t *obj, bool compact, - struct ucl_emitter_functions *func) +ucl_emitter_common_end_array (struct ucl_emitter_context *ctx, + const ucl_object_t *obj, bool compact) { - ucl_obj_write_json (obj, func, 0, false, compact); -} - -/** - * Write a single object to the buffer - * @param obj object to write - * @param buf target buffer - */ -static void -ucl_elt_obj_write_config (const ucl_object_t *obj, struct ucl_emitter_functions *func, - unsigned int tabs, bool start_tabs, bool is_top) -{ - const ucl_object_t *cur, *cur_obj; - ucl_hash_iter_t it = NULL; + const struct ucl_emitter_functions *func = ctx->func; - if (start_tabs) { - ucl_add_tabs (func, tabs, is_top); - } - if (!is_top) { - func->ucl_emitter_append_len ("{\n", 2, func->ud); + ctx->ident --; + if (compact) { + func->ucl_emitter_append_character (']', 1, func->ud); } - - while ((cur = ucl_hash_iterate (obj->value.ov, &it))) { - LL_FOREACH (cur, cur_obj) { - ucl_add_tabs (func, tabs + 1, is_top); - if (cur_obj->flags & UCL_OBJECT_NEED_KEY_ESCAPE) { - ucl_elt_string_write_json (cur_obj->key, cur_obj->keylen, func); - } - else { - func->ucl_emitter_append_len (cur_obj->key, cur_obj->keylen, func->ud); - } - if (cur_obj->type != UCL_OBJECT && cur_obj->type != UCL_ARRAY) { - func->ucl_emitter_append_len (" = ", 3, func->ud); - } - else { - func->ucl_emitter_append_character (' ', 1, func->ud); - } - ucl_elt_write_config (cur_obj, func, - is_top ? tabs : tabs + 1, - false, false, false); - if (cur_obj->type != UCL_OBJECT && cur_obj->type != UCL_ARRAY) { - func->ucl_emitter_append_len (";\n", 2, func->ud); - } - else { - func->ucl_emitter_append_character ('\n', 1, func->ud); - } + else { + if (ctx->id != UCL_EMIT_CONFIG) { + /* newline is already added for this format */ + func->ucl_emitter_append_character ('\n', 1, func->ud); } + ucl_add_tabs (func, ctx->ident, compact); + func->ucl_emitter_append_character (']', 1, func->ud); } - ucl_add_tabs (func, tabs, is_top); - if (!is_top) { - func->ucl_emitter_append_character ('}', 1, func->ud); - } + ucl_emitter_finish_object (ctx, obj, compact, true); } /** - * Write a single array to the buffer - * @param obj array to write - * @param buf target buffer + * Start emit standard UCL array + * @param ctx emitter context + * @param obj object to write + * @param compact compact flag */ static void -ucl_elt_array_write_config (const ucl_object_t *obj, struct ucl_emitter_functions *func, - unsigned int tabs, bool start_tabs, bool is_top) +ucl_emitter_common_start_array (struct ucl_emitter_context *ctx, + const ucl_object_t *obj, bool print_key, bool compact) { - const ucl_object_t *cur = obj; - - if (start_tabs) { - ucl_add_tabs (func, tabs, false); - } + const ucl_object_t *cur; + const struct ucl_emitter_functions *func = ctx->func; + bool first = true; - func->ucl_emitter_append_len ("[\n", 2, func->ud); - while (cur) { - ucl_elt_write_config (cur, func, tabs + 1, true, false, false); - func->ucl_emitter_append_len (",\n", 2, func->ud); - cur = cur->next; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 06:50:34 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 657CFB8E; Fri, 18 Jul 2014 06:50:34 +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 393732E96; Fri, 18 Jul 2014 06:50:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6I6oYQD077035; Fri, 18 Jul 2014 06:50:34 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6I6oY0E077034; Fri, 18 Jul 2014 06:50:34 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201407180650.s6I6oY0E077034@svn.freebsd.org> From: Baptiste Daroussin Date: Fri, 18 Jul 2014 06:50:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r268829 - vendor/libucl/20140716 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 06:50:34 -0000 Author: bapt Date: Fri Jul 18 06:50:33 2014 New Revision: 268829 URL: http://svnweb.freebsd.org/changeset/base/268829 Log: Tag import of libucl 20140716 Added: vendor/libucl/20140716/ - copied from r268828, vendor/libucl/dist/ From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 06:56:25 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 49021DBC; Fri, 18 Jul 2014 06:56: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 3620C2EDD; Fri, 18 Jul 2014 06:56:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6I6uPit080150; Fri, 18 Jul 2014 06:56:25 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6I6uOle080136; Fri, 18 Jul 2014 06:56:24 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201407180656.s6I6uOle080136@svn.freebsd.org> From: Alan Cox Date: Fri, 18 Jul 2014 06:56:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268830 - in head: . share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 06:56:25 -0000 Author: alc Date: Fri Jul 18 06:56:24 2014 New Revision: 268830 URL: http://svnweb.freebsd.org/changeset/base/268830 Log: Remove an obsolete man page. Added: head/share/man/man9/pmap_protect.9 - copied, changed from r268597, head/share/man/man9/pmap_page_protect.9 Deleted: head/share/man/man9/pmap_page_protect.9 Modified: head/ObsoleteFiles.inc head/share/man/man9/Makefile head/share/man/man9/pmap.9 Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Jul 18 06:50:33 2014 (r268829) +++ head/ObsoleteFiles.inc Fri Jul 18 06:56:24 2014 (r268830) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20140718: Remove an obsolete man page +OLD_FILES+=usr/share/man/man9/pmap_page_protect.9.gz # 20140717: Remove an obsolete man page OLD_FILES+=usr/share/man/man9/pmap_clear_reference.9.gz # 20140716: Remove an incorrectly named man page Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Fri Jul 18 06:50:33 2014 (r268829) +++ head/share/man/man9/Makefile Fri Jul 18 06:56:24 2014 (r268830) @@ -212,8 +212,8 @@ MAN= accept_filter.9 \ pmap_object_init_pt.9 \ pmap_page_exists_quick.9 \ pmap_page_init.9 \ - pmap_page_protect.9 \ pmap_pinit.9 \ + pmap_protect.9 \ pmap_qenter.9 \ pmap_release.9 \ pmap_remove.9 \ @@ -1049,7 +1049,6 @@ MLINKS+=pmap_copy.9 pmap_copy_page.9 MLINKS+=pmap_extract.9 pmap_extract_and_hold.9 MLINKS+=pmap_init.9 pmap_init2.9 MLINKS+=pmap_is_modified.9 pmap_ts_referenced.9 -MLINKS+=pmap_page_protect.9 pmap_protect.9 MLINKS+=pmap_pinit.9 pmap_pinit0.9 \ pmap_pinit.9 pmap_pinit2.9 MLINKS+=pmap_qenter.9 pmap_qremove.9 Modified: head/share/man/man9/pmap.9 ============================================================================== --- head/share/man/man9/pmap.9 Fri Jul 18 06:50:33 2014 (r268829) +++ head/share/man/man9/pmap.9 Fri Jul 18 06:56:24 2014 (r268830) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 17, 2014 +.Dd July 18, 2014 .Dt PMAP 9 .Os .Sh NAME @@ -106,7 +106,6 @@ operation. .Xr pmap_object_init_pt 9 , .Xr pmap_page_exists_quick 9 , .Xr pmap_page_init 9 , -.Xr pmap_page_protect 9 , .Xr pmap_pinit 9 , .Xr pmap_pinit0 9 , .Xr pmap_pinit2 9 , Copied and modified: head/share/man/man9/pmap_protect.9 (from r268597, head/share/man/man9/pmap_page_protect.9) ============================================================================== --- head/share/man/man9/pmap_page_protect.9 Sun Jul 13 23:10:39 2014 (r268597, copy source) +++ head/share/man/man9/pmap_protect.9 Fri Jul 18 06:56:24 2014 (r268830) @@ -25,11 +25,10 @@ .\" .\" $FreeBSD$ .\" -.Dd July 21, 2003 +.Dd July 18, 2014 .Dt PMAP_PROTECT 9 .Os .Sh NAME -.Nm pmap_page_protect , .Nm pmap_protect .Nd set physical page protection .Sh SYNOPSIS @@ -37,20 +36,11 @@ .In vm/vm.h .In vm/pmap.h .Ft void -.Fn pmap_page_protect "vm_page_t m" "vm_prot_t prot" -.Ft void .Fo pmap_protect -.Fa "pmap_t pmap" "vm_offset_t sva" "vm_offset_t eva" "vm_prot_t pr" +.Fa "pmap_t pmap" "vm_offset_t sva" "vm_offset_t eva" "vm_prot_t prot" .Fc .Sh DESCRIPTION The -.Fn pmap_page_protect -function lowers the physical page permissions to -.Fa prot -for all mappings of a given page -.Fa m . -.Pp -The .Fn pmap_protect function sets the physical page permissions to .Fa prot From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 06:58:03 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C2AF2F17; Fri, 18 Jul 2014 06:58:03 +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 AC1FF2EEC; Fri, 18 Jul 2014 06:58:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6I6w3Qi080439; Fri, 18 Jul 2014 06:58:03 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6I6w2GI080422; Fri, 18 Jul 2014 06:58:02 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201407180658.s6I6w2GI080422@svn.freebsd.org> From: Baptiste Daroussin Date: Fri, 18 Jul 2014 06:58:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268831 - in head: contrib/libucl contrib/libucl/doc contrib/libucl/include contrib/libucl/src contrib/libucl/tests contrib/libucl/uthash lib/libucl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 06:58:03 -0000 Author: bapt Date: Fri Jul 18 06:58:01 2014 New Revision: 268831 URL: http://svnweb.freebsd.org/changeset/base/268831 Log: Update libucl to the 2014-07-16 snapshot This update brings streamlined ucl emitter support Added: head/contrib/libucl/ChangeLog.md - copied unchanged from r268829, vendor/libucl/dist/ChangeLog.md head/contrib/libucl/src/ucl_emitter_streamline.c - copied unchanged from r268829, vendor/libucl/dist/src/ucl_emitter_streamline.c head/contrib/libucl/src/ucl_emitter_utils.c - copied unchanged from r268829, vendor/libucl/dist/src/ucl_emitter_utils.c head/contrib/libucl/tests/streamline.res - copied unchanged from r268829, vendor/libucl/dist/tests/streamline.res head/contrib/libucl/tests/streamline.test - copied unchanged from r268829, vendor/libucl/dist/tests/streamline.test head/contrib/libucl/tests/test_streamline.c - copied unchanged from r268829, vendor/libucl/dist/tests/test_streamline.c Modified: head/contrib/libucl/configure.ac head/contrib/libucl/doc/api.md head/contrib/libucl/doc/libucl.3 head/contrib/libucl/doc/pandoc.template head/contrib/libucl/include/ucl.h head/contrib/libucl/src/Makefile.am head/contrib/libucl/src/ucl_emitter.c head/contrib/libucl/src/ucl_internal.h head/contrib/libucl/src/ucl_parser.c head/contrib/libucl/tests/Makefile.am head/contrib/libucl/tests/test_basic.c head/contrib/libucl/uthash/utstring.h head/lib/libucl/Makefile Directory Properties: head/contrib/libucl/ (props changed) Copied: head/contrib/libucl/ChangeLog.md (from r268829, vendor/libucl/dist/ChangeLog.md) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libucl/ChangeLog.md Fri Jul 18 06:58:01 2014 (r268831, copy of r268829, vendor/libucl/dist/ChangeLog.md) @@ -0,0 +1,6 @@ +# Version history + +## Libucl 0.5 + +- Streamline emitter has been added, so it is now possible to output partial `ucl` objects +- Emitter now is more flexible due to emitter_context structure Modified: head/contrib/libucl/configure.ac ============================================================================== --- head/contrib/libucl/configure.ac Fri Jul 18 06:56:24 2014 (r268830) +++ head/contrib/libucl/configure.ac Fri Jul 18 06:58:01 2014 (r268831) @@ -1,7 +1,7 @@ m4_define([maj_ver], [0]) -m4_define([med_ver], [4]) -m4_define([min_ver], [1]) -m4_define([so_version], [1:0:0]) +m4_define([med_ver], [5]) +m4_define([min_ver], [0]) +m4_define([so_version], [2:0:0]) m4_define([ucl_version], [maj_ver.med_ver.min_ver]) AC_INIT([libucl],[ucl_version],[https://github.com/vstakhov/libucl],[libucl]) Modified: head/contrib/libucl/doc/api.md ============================================================================== --- head/contrib/libucl/doc/api.md Fri Jul 18 06:56:24 2014 (r268830) +++ head/contrib/libucl/doc/api.md Fri Jul 18 06:58:01 2014 (r268831) @@ -52,15 +52,15 @@ Used to parse `ucl` files and provide in ### Emitting functions Convert `ucl` objects to some textual or binary representation. Currently, libucl supports the following exports: -- `JSON` - valid json format (can possibly loose some original data, such as implicit arrays) -- `Config` - human-readable configuration format (losseless) +- `JSON` - valid json format (can possibly lose some original data, such as implicit arrays) +- `Config` - human-readable configuration format (lossless) - `YAML` - embedded yaml format (has the same limitations as `json` output) ### Conversion functions Help to convert `ucl` objects to C types. These functions are used to convert `ucl_object_t` to C primitive types, such as numbers, strings or boolean values. ### Generation functions -Allow creating of `ucl` objects from C types and creating of complex `ucl` objects, such as hashes or arrays from primitive `ucl` objects, such as numbers or strings. +Allow creation of `ucl` objects from C types and creating of complex `ucl` objects, such as hashes or arrays from primitive `ucl` objects, such as numbers or strings. ### Iteration functions Iterate over `ucl` complex objects or over a chain of values, for example when a key in an object has multiple values (that can be treated as implicit array or implicit consolidation). @@ -148,7 +148,7 @@ bool ucl_parser_add_file (struct ucl_par const char *filename); ~~~ -Load file `filename` and parse it with the specified `parser`. This function uses `mmap` call to load file, therefore, it should not be `shrinked` during parsing. Otherwise, `libucl` can cause memory corruption and terminate the calling application. This function is also used by the internal handler of `include` macro, hence, this macro has the same limitation. +Load file `filename` and parse it with the specified `parser`. This function uses `mmap` call to load file, therefore, it should not be `shrunk` during parsing. Otherwise, `libucl` can cause memory corruption and terminate the calling application. This function is also used by the internal handler of `include` macro, hence, this macro has the same limitation. ### ucl_parser_get_object @@ -225,7 +225,7 @@ ucl_parser_add_chunk (parser, inbuf, r); fclose (in); if (ucl_parser_get_error (parser)) { - printf ("Error occured: %s\n", ucl_parser_get_error (parser)); + printf ("Error occurred: %s\n", ucl_parser_get_error (parser)); ret = 1; } else { @@ -251,7 +251,7 @@ Libucl can transform UCL objects to a nu - compact yaml: `UCL_EMIT_YAML` - compact YAML output Moreover, libucl API allows to select a custom set of emitting functions allowing -efficent and zero-copy output of libucl objects. Libucl uses the following structure to support this feature: +efficient and zero-copy output of libucl objects. Libucl uses the following structure to support this feature: ~~~C struct ucl_emitter_functions { @@ -298,12 +298,12 @@ This function is similar to the previous # Conversion functions -Conversion functions are used to convert UCL objects to primitive types, such as strings, numbers or boolean values. There are two types of conversion functions: +Conversion functions are used to convert UCL objects to primitive types, such as strings, numbers, or boolean values. There are two types of conversion functions: - safe: try to convert an ucl object to a primitive type and fail if such a conversion is not possible - unsafe: return primitive type without additional checks, if the object cannot be converted then some reasonable default is returned (NULL for strings and 0 for numbers) -Also there is a single `ucl_object_tostring_forced` function that converts any UCL object (including compound types - arrays and objects) to a string representation. For compound and numeric types this function performs emitting to a compact json format actually. +Also there is a single `ucl_object_tostring_forced` function that converts any UCL object (including compound types - arrays and objects) to a string representation. For objects, arrays, booleans and numeric types this function performs emitting to a compact json format actually. Here is a list of all conversion functions: @@ -311,14 +311,14 @@ Here is a list of all conversion functio - `ucl_object_todouble` - returns `double` of UCL object - `ucl_object_toboolean` - returns `bool` of UCL object - `ucl_object_tostring` - returns `const char *` of UCL object (this string is NULL terminated) -- `ucl_object_tolstring` - returns `const char *` and `size_t` len of UCL object (string can be not NULL terminated) +- `ucl_object_tolstring` - returns `const char *` and `size_t` len of UCL object (string does not need to be NULL terminated) - `ucl_object_tostring_forced` - returns string representation of any UCL object Strings returned by these pointers are associated with the UCL object and exist over its lifetime. A caller should not free this memory. # Generation functions -It is possible to generate UCL objects from C primitive types. Moreover, libucl permits to create and modify complex UCL objects, such as arrays or associative objects. +It is possible to generate UCL objects from C primitive types. Moreover, libucl allows creation and modifying complex UCL objects, such as arrays or associative objects. ## ucl_object_new ~~~C @@ -350,8 +350,8 @@ Libucl provides the functions similar to - `ucl_object_fromint` - converts `int64_t` to UCL object - `ucl_object_fromdouble` - converts `double` to UCL object - `ucl_object_fromboolean` - converts `bool` to UCL object -- `ucl_object_fromstring` - converts `const char *` to UCL object (this string is NULL terminated) -- `ucl_object_fromlstring` - converts `const char *` and `size_t` len to UCL object (string can be not NULL terminated) +- `ucl_object_fromstring` - converts `const char *` to UCL object (this string should be NULL terminated) +- `ucl_object_fromlstring` - converts `const char *` and `size_t` len to UCL object (string does not need to be NULL terminated) Also there is a function to generate UCL object from a string performing various parsing or conversion operations called `ucl_object_fromstring_common`. @@ -361,7 +361,7 @@ ucl_object_t * ucl_object_fromstring_com size_t len, enum ucl_string_flags flags) ~~~ -This function is used to convert a string `str` of size `len` to an UCL objects applying `flags` conversions. If `len` is equal to zero then a `str` is assumed as NULL-terminated. This function supports the following flags (a set of flags can be specified using logical `OR` operation): +This function is used to convert a string `str` of size `len` to a UCL object applying `flags` conversions. If `len` is equal to zero then a `str` is assumed as NULL-terminated. This function supports the following flags (a set of flags can be specified using logical `OR` operation): - `UCL_STRING_ESCAPE` - perform JSON escape - `UCL_STRING_TRIM` - trim leading and trailing whitespaces @@ -385,7 +385,7 @@ const ucl_object_t* ucl_iterate_object ( ucl_object_iter_t *iter, bool expand_values); ~~~ -This function accept opaque iterator pointer `iter`. In the first call this iterator *must* be initialized to `NULL`. Iterator is changed by this function call. `ucl_iterate_object` returns the next UCL object in the compound object `obj` or `NULL` if all objects have been iterated. The reference count of the object returned is not increased, so a caller should not unref the object or modify its content (e.g. by inserting to another compound object). The object `obj` should not be changed during the iteration process as well. `expand_values` flag speicifies whether `ucl_iterate_object` should expand keys with multiple values. The general rule is that if you need to iterate throught the *object* or *explicit array*, then you always need to set this flag to `true`. However, if you get some key in the object and want to extract all its values then you should set `expand_values` to `false`. Mixing of iteration types are not permitted since the iterator is set according to the iteration type and cannot be reused. Here is an example of iteration over the objects using libucl API (assuming that `top` is `UCL_OBJECT` in this example): +This function accepts opaque iterator pointer `iter`. In the first call this iterator *must* be initialized to `NULL`. Iterator is changed by this function call. `ucl_iterate_object` returns the next UCL object in the compound object `obj` or `NULL` if all objects have been iterated. The reference count of the object returned is not increased, so a caller should not unref the object or modify its content (e.g. by inserting to another compound object). The object `obj` should not be changed during the iteration process as well. `expand_values` flag speicifies whether `ucl_iterate_object` should expand keys with multiple values. The general rule is that if you need to iterate through the *object* or *explicit array*, then you always need to set this flag to `true`. However, if you get some key in the object and want to extract all its values then you should set `expand_values` to `false`. Mixing of iteration types is not permitted since the iterator is set according to the iteration t ype and cannot be reused. Here is an example of iteration over the objects using libucl API (assuming that `top` is `UCL_OBJECT` in this example): ~~~C ucl_object_iter_t it = NULL, it_obj = NULL; @@ -412,13 +412,13 @@ bool ucl_object_validate (const ucl_obje const ucl_object_t *obj, struct ucl_schema_error *err); ~~~ -This function uses ucl object `schema`, that must be valid in terms of `json-schema` draft v4, to validate input object `obj`. If this function returns `true` then validation procedure has been succeed. Otherwise, `false` is returned and `err` is set to a specific value. If caller set `err` to NULL then this function does not set any error just returning `false`. Error is the structure defined as following: +This function uses ucl object `schema`, that must be valid in terms of `json-schema` draft v4, to validate input object `obj`. If this function returns `true` then validation procedure has been succeed. Otherwise, `false` is returned and `err` is set to a specific value. If a caller sets `err` to NULL then this function does not set any error just returning `false`. Error is the structure defined as following: ~~~C struct ucl_schema_error { enum ucl_schema_error_code code; /* error code */ char msg[128]; /* error message */ - ucl_object_t *obj; /* object where error occured */ + ucl_object_t *obj; /* object where error occurred */ }; ~~~ @@ -436,4 +436,4 @@ enum ucl_schema_error_code { }; ~~~ -`msg` is a stiring description of an error and `obj` is an object where error has been occurred. Error object is not allocated by libucl, so there is no need to free it after validation (a static object should thus be used). \ No newline at end of file +`msg` is a string description of an error and `obj` is an object where error has occurred. Error object is not allocated by libucl, so there is no need to free it after validation (a static object should thus be used). Modified: head/contrib/libucl/doc/libucl.3 ============================================================================== --- head/contrib/libucl/doc/libucl.3 Fri Jul 18 06:56:24 2014 (r268830) +++ head/contrib/libucl/doc/libucl.3 Fri Jul 18 06:58:01 2014 (r268831) @@ -1,4 +1,4 @@ -.TH LIBUCL 5 "March 20, 2014" "Libucl manual" +.TH "LIBUCL" "3" "July 26, 2014" "Libucl manual" "" .SH NAME .PP \f[B]ucl_parser_new\f[], \f[B]ucl_parser_register_macro\f[], @@ -32,10 +32,10 @@ In future, this limitation can be remove Convert \f[C]ucl\f[] objects to some textual or binary representation. Currently, libucl supports the following exports: .IP \[bu] 2 -\f[C]JSON\f[] \- valid json format (can possibly loose some original +\f[C]JSON\f[] \- valid json format (can possibly lose some original data, such as implicit arrays) .IP \[bu] 2 -\f[C]Config\f[] \- human\-readable configuration format (losseless) +\f[C]Config\f[] \- human\-readable configuration format (lossless) .IP \[bu] 2 \f[C]YAML\f[] \- embedded yaml format (has the same limitations as \f[C]json\f[] output) @@ -46,7 +46,7 @@ These functions are used to convert \f[C types, such as numbers, strings or boolean values. .SS Generation functions .PP -Allow creating of \f[C]ucl\f[] objects from C types and creating of +Allow creation of \f[C]ucl\f[] objects from C types and creating of complex \f[C]ucl\f[] objects, such as hashes or arrays from primitive \f[C]ucl\f[] objects, such as numbers or strings. .SS Iteration functions @@ -175,7 +175,7 @@ bool\ ucl_parser_add_file\ (struct\ ucl_ Load file \f[C]filename\f[] and parse it with the specified \f[C]parser\f[]. This function uses \f[C]mmap\f[] call to load file, therefore, it should -not be \f[C]shrinked\f[] during parsing. +not be \f[C]shrunk\f[] during parsing. Otherwise, \f[C]libucl\f[] can cause memory corruption and terminate the calling application. This function is also used by the internal handler of \f[C]include\f[] @@ -290,7 +290,7 @@ ucl_parser_add_chunk\ (parser,\ inbuf,\ fclose\ (in); if\ (ucl_parser_get_error\ (parser))\ { -\ \ \ \ printf\ ("Error\ occured:\ %s\\n",\ ucl_parser_get_error\ (parser)); +\ \ \ \ printf\ ("Error\ occurred:\ %s\\n",\ ucl_parser_get_error\ (parser)); \ \ \ \ ret\ =\ 1; } else\ { @@ -323,7 +323,7 @@ newlines and spaces compact yaml: \f[C]UCL_EMIT_YAML\f[] \- compact YAML output .PP Moreover, libucl API allows to select a custom set of emitting functions -allowing efficent and zero\-copy output of libucl objects. +allowing efficient and zero\-copy output of libucl objects. Libucl uses the following structure to support this feature: .IP .nf @@ -390,7 +390,7 @@ emitters (including C++ ones, for exampl .SH CONVERSION FUNCTIONS .PP Conversion functions are used to convert UCL objects to primitive types, -such as strings, numbers or boolean values. +such as strings, numbers, or boolean values. There are two types of conversion functions: .IP \[bu] 2 safe: try to convert an ucl object to a primitive type and fail if such @@ -403,8 +403,8 @@ strings and 0 for numbers) Also there is a single \f[C]ucl_object_tostring_forced\f[] function that converts any UCL object (including compound types \- arrays and objects) to a string representation. -For compound and numeric types this function performs emitting to a -compact json format actually. +For objects, arrays, booleans and numeric types this function performs +emitting to a compact json format actually. .PP Here is a list of all conversion functions: .IP \[bu] 2 @@ -418,7 +418,8 @@ Here is a list of all conversion functio object (this string is NULL terminated) .IP \[bu] 2 \f[C]ucl_object_tolstring\f[] \- returns \f[C]const\ char\ *\f[] and -\f[C]size_t\f[] len of UCL object (string can be not NULL terminated) +\f[C]size_t\f[] len of UCL object (string does not need to be NULL +terminated) .IP \[bu] 2 \f[C]ucl_object_tostring_forced\f[] \- returns string representation of any UCL object @@ -429,7 +430,7 @@ A caller should not free this memory. .SH GENERATION FUNCTIONS .PP It is possible to generate UCL objects from C primitive types. -Moreover, libucl permits to create and modify complex UCL objects, such +Moreover, libucl allows creation and modifying complex UCL objects, such as arrays or associative objects. .SS ucl_object_new .IP @@ -467,10 +468,10 @@ converts \f[C]int64_t\f[] to UCL object \f[C]ucl_object_fromdouble\f[] \- converts \f[C]double\f[] to UCL object \- \f[C]ucl_object_fromboolean\f[] \- converts \f[C]bool\f[] to UCL object \- \f[C]ucl_object_fromstring\f[] \- converts -\f[C]const\ char\ *\f[] to UCL object (this string is NULL terminated) -\- \f[C]ucl_object_fromlstring\f[] \- converts \f[C]const\ char\ *\f[] -and \f[C]size_t\f[] len to UCL object (string can be not NULL -terminated) +\f[C]const\ char\ *\f[] to UCL object (this string should be NULL +terminated) \- \f[C]ucl_object_fromlstring\f[] \- converts +\f[C]const\ char\ *\f[] and \f[C]size_t\f[] len to UCL object (string +does not need to be NULL terminated) .PP Also there is a function to generate UCL object from a string performing various parsing or conversion operations called @@ -485,7 +486,7 @@ ucl_object_t\ *\ ucl_object_fromstring_c .fi .PP This function is used to convert a string \f[C]str\f[] of size -\f[C]len\f[] to an UCL objects applying \f[C]flags\f[] conversions. +\f[C]len\f[] to a UCL object applying \f[C]flags\f[] conversions. If \f[C]len\f[] is equal to zero then a \f[C]str\f[] is assumed as NULL\-terminated. This function supports the following flags (a set of flags can be @@ -538,7 +539,7 @@ const\ ucl_object_t*\ ucl_iterate_object \f[] .fi .PP -This function accept opaque iterator pointer \f[C]iter\f[]. +This function accepts opaque iterator pointer \f[C]iter\f[]. In the first call this iterator \f[I]must\f[] be initialized to \f[C]NULL\f[]. Iterator is changed by this function call. @@ -551,12 +552,12 @@ The object \f[C]obj\f[] should not be ch process as well. \f[C]expand_values\f[] flag speicifies whether \f[C]ucl_iterate_object\f[] should expand keys with multiple values. -The general rule is that if you need to iterate throught the +The general rule is that if you need to iterate through the \f[I]object\f[] or \f[I]explicit array\f[], then you always need to set this flag to \f[C]true\f[]. However, if you get some key in the object and want to extract all its values then you should set \f[C]expand_values\f[] to \f[C]false\f[]. -Mixing of iteration types are not permitted since the iterator is set +Mixing of iteration types is not permitted since the iterator is set according to the iteration type and cannot be reused. Here is an example of iteration over the objects using libucl API (assuming that \f[C]top\f[] is \f[C]UCL_OBJECT\f[] in this example): @@ -599,8 +600,8 @@ If this function returns \f[C]true\f[] t been succeed. Otherwise, \f[C]false\f[] is returned and \f[C]err\f[] is set to a specific value. -If caller set \f[C]err\f[] to NULL then this function does not set any -error just returning \f[C]false\f[]. +If a caller sets \f[C]err\f[] to NULL then this function does not set +any error just returning \f[C]false\f[]. Error is the structure defined as following: .IP .nf @@ -608,7 +609,7 @@ Error is the structure defined as follow struct\ ucl_schema_error\ { \ \ \ \ enum\ ucl_schema_error_code\ code;\ \ \ \ /*\ error\ code\ */ \ \ \ \ char\ msg[128];\ \ \ \ \ \ \ \ \ \ \ \ \ \ /*\ error\ message\ */ -\ \ \ \ ucl_object_t\ *obj;\ \ \ \ \ \ \ \ \ \ /*\ object\ where\ error\ occured\ */ +\ \ \ \ ucl_object_t\ *obj;\ \ \ \ \ \ \ \ \ \ /*\ object\ where\ error\ occurred\ */ }; \f[] .fi @@ -629,8 +630,8 @@ enum\ ucl_schema_error_code\ { \f[] .fi .PP -\f[C]msg\f[] is a stiring description of an error and \f[C]obj\f[] is an -object where error has been occurred. +\f[C]msg\f[] is a string description of an error and \f[C]obj\f[] is an +object where error has occurred. Error object is not allocated by libucl, so there is no need to free it after validation (a static object should thus be used). .SH AUTHORS Modified: head/contrib/libucl/doc/pandoc.template ============================================================================== --- head/contrib/libucl/doc/pandoc.template Fri Jul 18 06:56:24 2014 (r268830) +++ head/contrib/libucl/doc/pandoc.template Fri Jul 18 06:58:01 2014 (r268831) @@ -1,6 +1,6 @@ -% LIBUCL(5) Libucl manual +% LIBUCL(3) Libucl manual % Vsevolod Stakhov -% March 20, 2014 +% July 26, 2014 # Name Modified: head/contrib/libucl/include/ucl.h ============================================================================== --- head/contrib/libucl/include/ucl.h Fri Jul 18 06:56:24 2014 (r268830) +++ head/contrib/libucl/include/ucl.h Fri Jul 18 06:58:01 2014 (r268831) @@ -786,6 +786,7 @@ UCL_EXTERN bool ucl_parser_set_filevars * @{ */ +struct ucl_emitter_context; /** * Structure using for emitter callbacks */ @@ -798,10 +799,49 @@ struct ucl_emitter_functions { int (*ucl_emitter_append_int) (int64_t elt, void *ud); /** Append floating point element */ int (*ucl_emitter_append_double) (double elt, void *ud); + /** Free userdata */ + void (*ucl_emitter_free_func)(void *ud); /** Opaque userdata pointer */ void *ud; }; +struct ucl_emitter_operations { + /** Write a primitive element */ + void (*ucl_emitter_write_elt) (struct ucl_emitter_context *ctx, + const ucl_object_t *obj, bool first, bool print_key); + /** Start ucl object */ + void (*ucl_emitter_start_object) (struct ucl_emitter_context *ctx, + const ucl_object_t *obj, bool print_key); + /** End ucl object */ + void (*ucl_emitter_end_object) (struct ucl_emitter_context *ctx, + const ucl_object_t *obj); + /** Start ucl array */ + void (*ucl_emitter_start_array) (struct ucl_emitter_context *ctx, + const ucl_object_t *obj, bool print_key); + void (*ucl_emitter_end_array) (struct ucl_emitter_context *ctx, + const ucl_object_t *obj); +}; + +/** + * Structure that defines emitter functions + */ +struct ucl_emitter_context { + /** Name of emitter (e.g. json, compact_json) */ + const char *name; + /** Unique id (e.g. UCL_EMIT_JSON for standard emitters */ + int id; + /** A set of output functions */ + const struct ucl_emitter_functions *func; + /** A set of output operations */ + const struct ucl_emitter_operations *ops; + /** Current amount of indent tabs */ + unsigned int ident; + /** Top level object */ + const ucl_object_t *top; + /** The rest of context */ + unsigned char data[1]; +}; + /** * Emit object to a string * @param obj object @@ -817,11 +857,81 @@ UCL_EXTERN unsigned char *ucl_object_emi * @param obj object * @param emit_type if type is #UCL_EMIT_JSON then emit json, if type is * #UCL_EMIT_CONFIG then emit config like object + * @param emitter a set of emitter functions * @return dump of an object (must be freed after using) or NULL in case of error */ UCL_EXTERN bool ucl_object_emit_full (const ucl_object_t *obj, enum ucl_emitter emit_type, struct ucl_emitter_functions *emitter); + +/** + * Start streamlined UCL object emitter + * @param obj top UCL object + * @param emit_type emit type + * @param emitter a set of emitter functions + * @return new streamlined context that should be freed by + * `ucl_object_emit_streamline_finish` + */ +UCL_EXTERN struct ucl_emitter_context* ucl_object_emit_streamline_new ( + const ucl_object_t *obj, enum ucl_emitter emit_type, + struct ucl_emitter_functions *emitter); + +/** + * Start object or array container for the streamlined output + * @param ctx streamlined context + * @param obj container object + */ +UCL_EXTERN void ucl_object_emit_streamline_start_container ( + struct ucl_emitter_context *ctx, const ucl_object_t *obj); +/** + * Add a complete UCL object to streamlined output + * @param ctx streamlined context + * @param obj object to output + */ +UCL_EXTERN void ucl_object_emit_streamline_add_object ( + struct ucl_emitter_context *ctx, const ucl_object_t *obj); +/** + * End previously added container + * @param ctx streamlined context + */ +UCL_EXTERN void ucl_object_emit_streamline_end_container ( + struct ucl_emitter_context *ctx); +/** + * Terminate streamlined container finishing all containers in it + * @param ctx streamlined context + */ +UCL_EXTERN void ucl_object_emit_streamline_finish ( + struct ucl_emitter_context *ctx); + +/** + * Returns functions to emit object to memory + * @param pmem target pointer (should be freed by caller) + * @return emitter functions structure + */ +UCL_EXTERN struct ucl_emitter_functions* ucl_object_emit_memory_funcs ( + void **pmem); + +/** + * Returns functions to emit object to FILE * + * @param fp FILE * object + * @return emitter functions structure + */ +UCL_EXTERN struct ucl_emitter_functions* ucl_object_emit_file_funcs ( + FILE *fp); +/** + * Returns functions to emit object to a file descriptor + * @param fd file descriptor + * @return emitter functions structure + */ +UCL_EXTERN struct ucl_emitter_functions* ucl_object_emit_fd_funcs ( + int fd); + +/** + * Free emitter functions + * @param f pointer to functions + */ +UCL_EXTERN void ucl_object_emit_funcs_free (struct ucl_emitter_functions *f); + /** @} */ /** Modified: head/contrib/libucl/src/Makefile.am ============================================================================== --- head/contrib/libucl/src/Makefile.am Fri Jul 18 06:56:24 2014 (r268830) +++ head/contrib/libucl/src/Makefile.am Fri Jul 18 06:58:01 2014 (r268831) @@ -4,6 +4,8 @@ libucl_common_cflags= -I$(top_srcdir)/sr -Wall -W -Wno-unused-parameter -Wno-pointer-sign lib_LTLIBRARIES= libucl.la libucl_la_SOURCES= ucl_emitter.c \ + ucl_emitter_streamline.c \ + ucl_emitter_utils.c \ ucl_hash.c \ ucl_parser.c \ ucl_schema.c \ Modified: head/contrib/libucl/src/ucl_emitter.c ============================================================================== --- head/contrib/libucl/src/ucl_emitter.c Fri Jul 18 06:56:24 2014 (r268830) +++ head/contrib/libucl/src/ucl_emitter.c Fri Jul 18 06:58:01 2014 (r268831) @@ -36,38 +36,55 @@ #endif /** - * @file rcl_emitter.c + * @file ucl_emitter.c * Serialise UCL object to various of output formats */ +static void ucl_emitter_common_elt (struct ucl_emitter_context *ctx, + const ucl_object_t *obj, bool first, bool print_key, bool compact); + +#define UCL_EMIT_TYPE_OPS(type) \ + static void ucl_emit_ ## type ## _elt (struct ucl_emitter_context *ctx, \ + const ucl_object_t *obj, bool first, bool print_key); \ + static void ucl_emit_ ## type ## _start_obj (struct ucl_emitter_context *ctx, \ + const ucl_object_t *obj, bool print_key); \ + static void ucl_emit_ ## type## _start_array (struct ucl_emitter_context *ctx, \ + const ucl_object_t *obj, bool print_key); \ + static void ucl_emit_ ##type## _end_object (struct ucl_emitter_context *ctx, \ + const ucl_object_t *obj); \ + static void ucl_emit_ ##type## _end_array (struct ucl_emitter_context *ctx, \ + const ucl_object_t *obj) + +/* + * JSON format operations + */ +UCL_EMIT_TYPE_OPS(json); +UCL_EMIT_TYPE_OPS(json_compact); +UCL_EMIT_TYPE_OPS(config); +UCL_EMIT_TYPE_OPS(yaml); + +#define UCL_EMIT_TYPE_CONTENT(type) { \ + .ucl_emitter_write_elt = ucl_emit_ ## type ## _elt, \ + .ucl_emitter_start_object = ucl_emit_ ## type ##_start_obj, \ + .ucl_emitter_start_array = ucl_emit_ ## type ##_start_array, \ + .ucl_emitter_end_object = ucl_emit_ ## type ##_end_object, \ + .ucl_emitter_end_array = ucl_emit_ ## type ##_end_array \ +} + + +const struct ucl_emitter_operations ucl_standartd_emitter_ops[] = { + [UCL_EMIT_JSON] = UCL_EMIT_TYPE_CONTENT(json), + [UCL_EMIT_JSON_COMPACT] = UCL_EMIT_TYPE_CONTENT(json_compact), + [UCL_EMIT_CONFIG] = UCL_EMIT_TYPE_CONTENT(config), + [UCL_EMIT_YAML] = UCL_EMIT_TYPE_CONTENT(yaml) +}; + +/* + * Utility to check whether we need a top object + */ +#define UCL_EMIT_IDENT_TOP_OBJ(ctx, obj) ((ctx)->top != (obj) || \ + ((ctx)->id == UCL_EMIT_JSON_COMPACT || (ctx)->id == UCL_EMIT_JSON)) -static void ucl_obj_write_json (const ucl_object_t *obj, - struct ucl_emitter_functions *func, - unsigned int tabs, - bool start_tabs, - bool compact); -static void ucl_elt_write_json (const ucl_object_t *obj, - struct ucl_emitter_functions *func, - unsigned int tabs, - bool start_tabs, - bool compact); -static void ucl_elt_write_config (const ucl_object_t *obj, - struct ucl_emitter_functions *func, - unsigned int tabs, - bool start_tabs, - bool is_top, - bool expand_array); -static void ucl_elt_write_yaml (const ucl_object_t *obj, - struct ucl_emitter_functions *func, - unsigned int tabs, - bool start_tabs, - bool compact, - bool expand_array); -static void ucl_elt_array_write_yaml (const ucl_object_t *obj, - struct ucl_emitter_functions *func, - unsigned int tabs, - bool start_tabs, - bool is_top); /** * Add tabulation to the output buffer @@ -75,689 +92,358 @@ static void ucl_elt_array_write_yaml (co * @param tabs number of tabs to add */ static inline void -ucl_add_tabs (struct ucl_emitter_functions *func, unsigned int tabs, bool compact) +ucl_add_tabs (const struct ucl_emitter_functions *func, unsigned int tabs, + bool compact) { - if (!compact) { + if (!compact && tabs > 0) { func->ucl_emitter_append_character (' ', tabs * 4, func->ud); } } /** - * Serialise string - * @param str string to emit - * @param buf target buffer + * Print key for the element + * @param ctx + * @param obj */ static void -ucl_elt_string_write_json (const char *str, size_t size, - struct ucl_emitter_functions *func) +ucl_emitter_print_key (bool print_key, struct ucl_emitter_context *ctx, + const ucl_object_t *obj, bool compact) { - const char *p = str, *c = str; - size_t len = 0; + const struct ucl_emitter_functions *func = ctx->func; - func->ucl_emitter_append_character ('"', 1, func->ud); - while (size) { - if (ucl_test_character (*p, UCL_CHARACTER_JSON_UNSAFE)) { - if (len > 0) { - func->ucl_emitter_append_len (c, len, func->ud); - } - switch (*p) { - case '\n': - func->ucl_emitter_append_len ("\\n", 2, func->ud); - break; - case '\r': - func->ucl_emitter_append_len ("\\r", 2, func->ud); - break; - case '\b': - func->ucl_emitter_append_len ("\\b", 2, func->ud); - break; - case '\t': - func->ucl_emitter_append_len ("\\t", 2, func->ud); - break; - case '\f': - func->ucl_emitter_append_len ("\\f", 2, func->ud); - break; - case '\\': - func->ucl_emitter_append_len ("\\\\", 2, func->ud); - break; - case '"': - func->ucl_emitter_append_len ("\\\"", 2, func->ud); - break; - } - len = 0; - c = ++p; + if (!print_key) { + return; + } + + if (ctx->id == UCL_EMIT_CONFIG) { + if (obj->flags & UCL_OBJECT_NEED_KEY_ESCAPE) { + ucl_elt_string_write_json (obj->key, obj->keylen, ctx); } else { - p ++; - len ++; + func->ucl_emitter_append_len (obj->key, obj->keylen, func->ud); } - size --; - } - if (len > 0) { - func->ucl_emitter_append_len (c, len, func->ud); - } - func->ucl_emitter_append_character ('"', 1, func->ud); -} -/** - * Write a single object to the buffer - * @param obj object to write - * @param buf target buffer - */ -static void -ucl_elt_obj_write_json (const ucl_object_t *obj, struct ucl_emitter_functions *func, - unsigned int tabs, bool start_tabs, bool compact) -{ - const ucl_object_t *cur; - ucl_hash_iter_t it = NULL; - - if (start_tabs) { - ucl_add_tabs (func, tabs, compact); - } - if (compact) { - func->ucl_emitter_append_character ('{', 1, func->ud); + if (obj->type != UCL_OBJECT && obj->type != UCL_ARRAY) { + func->ucl_emitter_append_len (" = ", 3, func->ud); + } + else { + func->ucl_emitter_append_character (' ', 1, func->ud); + } } else { - func->ucl_emitter_append_len ("{\n", 2, func->ud); - } - while ((cur = ucl_hash_iterate (obj->value.ov, &it))) { - ucl_add_tabs (func, tabs + 1, compact); - if (cur->keylen > 0) { - ucl_elt_string_write_json (cur->key, cur->keylen, func); + if (obj->keylen > 0) { + ucl_elt_string_write_json (obj->key, obj->keylen, ctx); } else { func->ucl_emitter_append_len ("null", 4, func->ud); } + if (compact) { func->ucl_emitter_append_character (':', 1, func->ud); } else { func->ucl_emitter_append_len (": ", 2, func->ud); } - ucl_obj_write_json (cur, func, tabs + 1, false, compact); - if (ucl_hash_iter_has_next (it)) { - if (compact) { - func->ucl_emitter_append_character (',', 1, func->ud); - } - else { - func->ucl_emitter_append_len (",\n", 2, func->ud); - } - } - else if (!compact) { - func->ucl_emitter_append_character ('\n', 1, func->ud); - } } - ucl_add_tabs (func, tabs, compact); - func->ucl_emitter_append_character ('}', 1, func->ud); } -/** - * Write a single array to the buffer - * @param obj array to write - * @param buf target buffer - */ static void -ucl_elt_array_write_json (const ucl_object_t *obj, struct ucl_emitter_functions *func, - unsigned int tabs, bool start_tabs, bool compact) +ucl_emitter_finish_object (struct ucl_emitter_context *ctx, + const ucl_object_t *obj, bool compact, bool is_array) { - const ucl_object_t *cur = obj; + const struct ucl_emitter_functions *func = ctx->func; - if (start_tabs) { - ucl_add_tabs (func, tabs, compact); - } - if (compact) { - func->ucl_emitter_append_character ('[', 1, func->ud); - } - else { - func->ucl_emitter_append_len ("[\n", 2, func->ud); - } - while (cur) { - ucl_elt_write_json (cur, func, tabs + 1, true, compact); - if (cur->next != NULL) { - if (compact) { - func->ucl_emitter_append_character (',', 1, func->ud); + if (ctx->id == UCL_EMIT_CONFIG && obj != ctx->top) { + if (obj->type != UCL_OBJECT && obj->type != UCL_ARRAY) { + if (!is_array) { + /* Objects are split by ';' */ + func->ucl_emitter_append_len (";\n", 2, func->ud); } else { + /* Use commas for arrays */ func->ucl_emitter_append_len (",\n", 2, func->ud); } } - else if (!compact) { - func->ucl_emitter_append_character ('\n', 1, func->ud); - } - cur = cur->next; - } - ucl_add_tabs (func, tabs, compact); - func->ucl_emitter_append_character (']', 1, func->ud); -} - -/** - * Emit a single element - * @param obj object - * @param buf buffer - */ -static void -ucl_elt_write_json (const ucl_object_t *obj, struct ucl_emitter_functions *func, - unsigned int tabs, bool start_tabs, bool compact) -{ - bool flag; - - switch (obj->type) { - case UCL_INT: - if (start_tabs) { - ucl_add_tabs (func, tabs, compact); - } - func->ucl_emitter_append_int (ucl_object_toint (obj), func->ud); - break; - case UCL_FLOAT: - case UCL_TIME: - if (start_tabs) { - ucl_add_tabs (func, tabs, compact); - } - func->ucl_emitter_append_double (ucl_object_todouble (obj), func->ud); - break; - case UCL_BOOLEAN: - if (start_tabs) { - ucl_add_tabs (func, tabs, compact); - } - flag = ucl_object_toboolean (obj); - if (flag) { - func->ucl_emitter_append_len ("true", 4, func->ud); - } else { - func->ucl_emitter_append_len ("false", 5, func->ud); - } - break; - case UCL_STRING: - if (start_tabs) { - ucl_add_tabs (func, tabs, compact); - } - ucl_elt_string_write_json (obj->value.sv, obj->len, func); - break; - case UCL_NULL: - if (start_tabs) { - ucl_add_tabs (func, tabs, compact); + func->ucl_emitter_append_character ('\n', 1, func->ud); } - func->ucl_emitter_append_len ("null", 4, func->ud); - break; - case UCL_OBJECT: - ucl_elt_obj_write_json (obj, func, tabs, start_tabs, compact); - break; - case UCL_ARRAY: - ucl_elt_array_write_json (obj->value.av, func, tabs, start_tabs, compact); - break; - case UCL_USERDATA: - break; } } /** - * Write a single object to the buffer - * @param obj object - * @param buf target buffer + * End standard ucl object + * @param ctx emitter context + * @param compact compact flag */ static void -ucl_obj_write_json (const ucl_object_t *obj, struct ucl_emitter_functions *func, - unsigned int tabs, bool start_tabs, bool compact) +ucl_emitter_common_end_object (struct ucl_emitter_context *ctx, + const ucl_object_t *obj, bool compact) { - const ucl_object_t *cur; - bool is_array = (obj->next != NULL); - - if (is_array) { - /* This is an array actually */ - if (start_tabs) { - ucl_add_tabs (func, tabs, compact); - } + const struct ucl_emitter_functions *func = ctx->func; + if (UCL_EMIT_IDENT_TOP_OBJ(ctx, obj)) { + ctx->ident --; if (compact) { - func->ucl_emitter_append_character ('[', 1, func->ud); + func->ucl_emitter_append_character ('}', 1, func->ud); } else { - func->ucl_emitter_append_len ("[\n", 2, func->ud); - } - cur = obj; - while (cur != NULL) { - ucl_elt_write_json (cur, func, tabs + 1, true, compact); - if (cur->next) { - func->ucl_emitter_append_character (',', 1, func->ud); - } - if (!compact) { + if (ctx->id != UCL_EMIT_CONFIG) { + /* newline is already added for this format */ func->ucl_emitter_append_character ('\n', 1, func->ud); } - cur = cur->next; + ucl_add_tabs (func, ctx->ident, compact); + func->ucl_emitter_append_character ('}', 1, func->ud); } - ucl_add_tabs (func, tabs, compact); - func->ucl_emitter_append_character (']', 1, func->ud); - } - else { - ucl_elt_write_json (obj, func, tabs, start_tabs, compact); } + ucl_emitter_finish_object (ctx, obj, compact, false); } /** - * Emit an object to json - * @param obj object - * @return json output (should be freed after using) + * End standard ucl array + * @param ctx emitter context + * @param compact compact flag */ static void -ucl_object_emit_json (const ucl_object_t *obj, bool compact, - struct ucl_emitter_functions *func) +ucl_emitter_common_end_array (struct ucl_emitter_context *ctx, + const ucl_object_t *obj, bool compact) { - ucl_obj_write_json (obj, func, 0, false, compact); -} - -/** - * Write a single object to the buffer - * @param obj object to write - * @param buf target buffer - */ -static void -ucl_elt_obj_write_config (const ucl_object_t *obj, struct ucl_emitter_functions *func, - unsigned int tabs, bool start_tabs, bool is_top) -{ - const ucl_object_t *cur, *cur_obj; - ucl_hash_iter_t it = NULL; + const struct ucl_emitter_functions *func = ctx->func; - if (start_tabs) { - ucl_add_tabs (func, tabs, is_top); - } - if (!is_top) { - func->ucl_emitter_append_len ("{\n", 2, func->ud); + ctx->ident --; + if (compact) { + func->ucl_emitter_append_character (']', 1, func->ud); } - - while ((cur = ucl_hash_iterate (obj->value.ov, &it))) { - LL_FOREACH (cur, cur_obj) { - ucl_add_tabs (func, tabs + 1, is_top); - if (cur_obj->flags & UCL_OBJECT_NEED_KEY_ESCAPE) { - ucl_elt_string_write_json (cur_obj->key, cur_obj->keylen, func); - } - else { - func->ucl_emitter_append_len (cur_obj->key, cur_obj->keylen, func->ud); - } - if (cur_obj->type != UCL_OBJECT && cur_obj->type != UCL_ARRAY) { - func->ucl_emitter_append_len (" = ", 3, func->ud); - } - else { - func->ucl_emitter_append_character (' ', 1, func->ud); - } - ucl_elt_write_config (cur_obj, func, - is_top ? tabs : tabs + 1, - false, false, false); - if (cur_obj->type != UCL_OBJECT && cur_obj->type != UCL_ARRAY) { - func->ucl_emitter_append_len (";\n", 2, func->ud); - } - else { - func->ucl_emitter_append_character ('\n', 1, func->ud); - } + else { + if (ctx->id != UCL_EMIT_CONFIG) { + /* newline is already added for this format */ + func->ucl_emitter_append_character ('\n', 1, func->ud); } + ucl_add_tabs (func, ctx->ident, compact); + func->ucl_emitter_append_character (']', 1, func->ud); } - ucl_add_tabs (func, tabs, is_top); - if (!is_top) { - func->ucl_emitter_append_character ('}', 1, func->ud); - } + ucl_emitter_finish_object (ctx, obj, compact, true); } /** - * Write a single array to the buffer - * @param obj array to write - * @param buf target buffer + * Start emit standard UCL array + * @param ctx emitter context + * @param obj object to write + * @param compact compact flag */ static void -ucl_elt_array_write_config (const ucl_object_t *obj, struct ucl_emitter_functions *func, - unsigned int tabs, bool start_tabs, bool is_top) +ucl_emitter_common_start_array (struct ucl_emitter_context *ctx, + const ucl_object_t *obj, bool print_key, bool compact) { - const ucl_object_t *cur = obj; - - if (start_tabs) { - ucl_add_tabs (func, tabs, false); - } + const ucl_object_t *cur; + const struct ucl_emitter_functions *func = ctx->func; + bool first = true; - func->ucl_emitter_append_len ("[\n", 2, func->ud); - while (cur) { - ucl_elt_write_config (cur, func, tabs + 1, true, false, false); - func->ucl_emitter_append_len (",\n", 2, func->ud); - cur = cur->next; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 07:18:38 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 531A8C13; Fri, 18 Jul 2014 07:18: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 25F782234; Fri, 18 Jul 2014 07:18:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6I7IcQI090833; Fri, 18 Jul 2014 07:18:38 GMT (envelope-from royger@svn.freebsd.org) Received: (from royger@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6I7Icma090832; Fri, 18 Jul 2014 07:18:38 GMT (envelope-from royger@svn.freebsd.org) Message-Id: <201407180718.s6I7Icma090832@svn.freebsd.org> From: Roger Pau Monné Date: Fri, 18 Jul 2014 07:18:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r268832 - stable/9/sys/dev/xen/blkfront X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 07:18:38 -0000 Author: royger Date: Fri Jul 18 07:18:37 2014 New Revision: 268832 URL: http://svnweb.freebsd.org/changeset/base/268832 Log: MFC r256423: Allow FreeBSD to be booted from CDROM media on XenServer 6.2 and prior releases. PR: 164630 Modified: stable/9/sys/dev/xen/blkfront/blkfront.c Modified: stable/9/sys/dev/xen/blkfront/blkfront.c ============================================================================== --- stable/9/sys/dev/xen/blkfront/blkfront.c Fri Jul 18 06:58:01 2014 (r268831) +++ stable/9/sys/dev/xen/blkfront/blkfront.c Fri Jul 18 07:18:37 2014 (r268832) @@ -399,14 +399,44 @@ xb_dump(void *arg, void *virtual, vm_off static int blkfront_probe(device_t dev) { +#ifdef XENHVM + int error; + char *type; +#endif - if (!strcmp(xenbus_get_type(dev), "vbd")) { - device_set_desc(dev, "Virtual Block Device"); - device_quiet(dev); - return (0); + if (strcmp(xenbus_get_type(dev), "vbd") != 0) + return (ENXIO); + +#ifdef XENHVM + /* + * When running in an HVM domain, IDE disk emulation is + * disabled early in boot so that native drivers will + * not see emulated hardware. However, CDROM device + * emulation cannot be disabled. + * + * Through use of FreeBSD's vm_guest and xen_hvm_domain() + * APIs, we could modify the native CDROM driver to fail its + * probe when running under Xen. Unfortunatlely, the PV + * CDROM support in XenServer (up through at least version + * 6.2) isn't functional, so we instead rely on the emulated + * CDROM instance, and fail to attach the PV one here in + * the blkfront driver. + */ + error = xs_read(XST_NIL, xenbus_get_node(dev), + "device-type", NULL, (void **) &type); + if (error) + return (ENXIO); + + if (strncmp(type, "cdrom", 5) == 0) { + free(type, M_XENSTORE); + return (ENXIO); } + free(type, M_XENSTORE); +#endif - return (ENXIO); + device_set_desc(dev, "Virtual Block Device"); + device_quiet(dev); + return (0); } static void From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 07:41:38 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B32F73E8; Fri, 18 Jul 2014 07:41: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 A142724D4; Fri, 18 Jul 2014 07:41:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6I7fc0b003676; Fri, 18 Jul 2014 07:41:38 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6I7fcJn003675; Fri, 18 Jul 2014 07:41:38 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201407180741.s6I7fcJn003675@svn.freebsd.org> From: Peter Wemm Date: Fri, 18 Jul 2014 07:41:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268833 - head/sys/dev/bge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 07:41:38 -0000 Author: peter Date: Fri Jul 18 07:41:38 2014 New Revision: 268833 URL: http://svnweb.freebsd.org/changeset/base/268833 Log: Fix an apparent conversion error in bge to the new driver api. if_multiaddr_array() does the LLADDR work, don't do it twice. This broke IPv6 in "interesting" ways in the FreeBSD.org cluster. Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Fri Jul 18 07:18:37 2014 (r268832) +++ head/sys/dev/bge/if_bge.c Fri Jul 18 07:41:38 2014 (r268833) @@ -1646,8 +1646,8 @@ bge_setmulti(struct bge_softc *sc) if_multiaddr_array(ifp, mta, &mcnt, mc_count); for(i = 0; i < mcnt; i++) { - h = ether_crc32_le(LLADDR((struct sockaddr_dl *) - (mta + (i * ETHER_ADDR_LEN))), ETHER_ADDR_LEN) & 0x7F; + h = ether_crc32_le(mta + (i * ETHER_ADDR_LEN), + ETHER_ADDR_LEN) & 0x7F; hashes[(h & 0x60) >> 5] |= 1 << (h & 0x1F); } From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 07:47:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5E9076A6; Fri, 18 Jul 2014 07:47:52 +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 324192508; Fri, 18 Jul 2014 07:47:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6I7lqNF004985; Fri, 18 Jul 2014 07:47:52 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6I7loFI004973; Fri, 18 Jul 2014 07:47:50 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201407180747.s6I7loFI004973@svn.freebsd.org> From: Ruslan Bukin Date: Fri, 18 Jul 2014 07:47:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268834 - in head/sys: arm/conf arm/freescale/imx boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 07:47:52 -0000 Author: br Date: Fri Jul 18 07:47:50 2014 New Revision: 268834 URL: http://svnweb.freebsd.org/changeset/base/268834 Log: o Enable GPIO device driver for i.MX6. It was originally written for i.MX5 and compatible with newer chip. o Extend device tree information o style(9) fixes Discussed with: ian Modified: head/sys/arm/conf/IMX6 head/sys/arm/freescale/imx/files.imx6 head/sys/arm/freescale/imx/imx51_gpio.c head/sys/boot/fdt/dts/arm/imx6.dtsi head/sys/boot/fdt/dts/arm/wandboard-dual.dts head/sys/boot/fdt/dts/arm/wandboard-quad.dts head/sys/boot/fdt/dts/arm/wandboard-solo.dts Modified: head/sys/arm/conf/IMX6 ============================================================================== --- head/sys/arm/conf/IMX6 Fri Jul 18 07:41:38 2014 (r268833) +++ head/sys/arm/conf/IMX6 Fri Jul 18 07:47:50 2014 (r268834) @@ -82,6 +82,9 @@ device miibus # Required for etherne device bpf # Berkeley packet filter (required for DHCP) #device iomux # IO Multiplexor +# General-purpose input/output +device gpio + # Serial (COM) ports device uart # Multi-uart driver @@ -106,7 +109,7 @@ device u3g # USB modems #device ukbd # Allow keyboard like HIDs to control console #device ums # USB mouse -# USB Ethernet, requires miibus +# USB Ethernet, requires miibus #device aue # ADMtek USB Ethernet #device axe # ASIX Electronics USB Ethernet #device cdce # Generic USB over Ethernet Modified: head/sys/arm/freescale/imx/files.imx6 ============================================================================== --- head/sys/arm/freescale/imx/files.imx6 Fri Jul 18 07:41:38 2014 (r268833) +++ head/sys/arm/freescale/imx/files.imx6 Fri Jul 18 07:47:50 2014 (r268834) @@ -26,6 +26,7 @@ arm/freescale/imx/imx6_mp.c optional sm arm/freescale/imx/imx6_pl310.c standard arm/freescale/imx/imx_machdep.c standard arm/freescale/imx/imx_gpt.c standard +arm/freescale/imx/imx51_gpio.c optional gpio # # Optional devices. @@ -50,8 +51,6 @@ arm/freescale/imx/imx6_usbphy.c optiona # Not ready yet... # #arm/freescale/imx/imx51_iomux.c optional iomux -#arm/freescale/imx/imx51_gpio.c optional gpio #dev/ata/chipsets/ata-fsl.c optional imxata #arm/freescale/imx/i2c.c optional fsliic #arm/freescale/imx/imx51_ipuv3.c optional sc - Modified: head/sys/arm/freescale/imx/imx51_gpio.c ============================================================================== --- head/sys/arm/freescale/imx/imx51_gpio.c Fri Jul 18 07:41:38 2014 (r268833) +++ head/sys/arm/freescale/imx/imx51_gpio.c Fri Jul 18 07:47:50 2014 (r268834) @@ -102,6 +102,13 @@ struct imx51_gpio_softc { struct gpio_pin gpio_pins[NGPIO]; }; +static struct ofw_compat_data compat_data[] = { + {"fsl,imx6q-gpio", 1}, + {"fsl,imx53-gpio", 1}, + {"fsl,imx51-gpio", 1}, + {NULL, 0} +}; + static struct resource_spec imx_gpio_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, { SYS_RES_IRQ, 0, RF_ACTIVE }, @@ -373,9 +380,8 @@ imx51_gpio_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (ofw_bus_is_compatible(dev, "fsl,imx51-gpio") || - ofw_bus_is_compatible(dev, "fsl,imx53-gpio")) { - device_set_desc(dev, "i.MX515 GPIO Controller"); + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data != 0) { + device_set_desc(dev, "Freescale i.MX GPIO Controller"); return (BUS_PROBE_DEFAULT); } Modified: head/sys/boot/fdt/dts/arm/imx6.dtsi ============================================================================== --- head/sys/boot/fdt/dts/arm/imx6.dtsi Fri Jul 18 07:41:38 2014 (r268833) +++ head/sys/boot/fdt/dts/arm/imx6.dtsi Fri Jul 18 07:47:50 2014 (r268834) @@ -102,6 +102,20 @@ interrupts = <119 120>; }; + /* System Reset Controller */ + src: src@4006E000 { + compatible = "fsl,imx6-src"; + reg = <0x020D8000 0x100>; + }; + + sdma: sdma@020ec000 { + compatible = "fsl,imx6q-sdma"; + reg = <0x020ec000 0x4000>; + interrupt-parent = <&gic>; + interrupts = <34>; + status = "disabled"; + }; + anatop: anatop@020c8000 { compatible = "fsl,imx6q-anatop"; reg = <0x020c8000 0x1000>; @@ -115,87 +129,95 @@ interrupt-parent = <&gic>; interrupts = <87>; }; -// iomux@73fa8000 { -// compatible = "fsl,imx51-iomux"; -// reg = <0x73fa8000 0x4000>; -// interrupt-parent = <&gic>; interrupts = <7>; -// status = "disabled"; -// }; + iomux@020e0000 { + compatible = "fsl,imx6q-iomux"; + reg = <0x020e0000 0x4000>; + interrupt-parent = <&gic>; + interrupts = <32>; + status = "disabled"; + }; gpio1: gpio@0209c000 { compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio"; reg = <0x0209c000 0x4000>; - interrupts = <0 66 0x04 0 67 0x04>; + interrupts = < 98 99 >; gpio-controller; #gpio-cells = <2>; interrupt-controller; #interrupt-cells = <2>; + status = "disabled"; }; - + gpio2: gpio@020a0000 { compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio"; reg = <0x020a0000 0x4000>; - interrupts = <0 68 0x04 0 69 0x04>; + interrupts = < 100 101 >; gpio-controller; #gpio-cells = <2>; interrupt-controller; #interrupt-cells = <2>; + status = "disabled"; }; - + gpio3: gpio@020a4000 { compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio"; reg = <0x020a4000 0x4000>; - interrupts = <0 70 0x04 0 71 0x04>; + interrupts = < 102 103 >; gpio-controller; #gpio-cells = <2>; interrupt-controller; #interrupt-cells = <2>; + status = "disabled"; }; - + gpio4: gpio@020a8000 { compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio"; reg = <0x020a8000 0x4000>; - interrupts = <0 72 0x04 0 73 0x04>; + interrupts = < 104 105 >; gpio-controller; #gpio-cells = <2>; interrupt-controller; #interrupt-cells = <2>; + status = "disabled"; }; - + gpio5: gpio@020ac000 { compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio"; reg = <0x020ac000 0x4000>; - interrupts = <0 74 0x04 0 75 0x04>; + interrupts = < 106 107 >; gpio-controller; #gpio-cells = <2>; interrupt-controller; #interrupt-cells = <2>; + status = "disabled"; }; - + gpio6: gpio@020b0000 { compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio"; reg = <0x020b0000 0x4000>; - interrupts = <0 76 0x04 0 77 0x04>; + interrupts = < 108 109 >; gpio-controller; #gpio-cells = <2>; interrupt-controller; #interrupt-cells = <2>; + status = "disabled"; }; - + gpio7: gpio@020b4000 { compatible = "fsl,imx6q-gpio", "fsl,imx35-gpio"; reg = <0x020b4000 0x4000>; - interrupts = <0 78 0x04 0 79 0x04>; + interrupts = < 110 111 >; gpio-controller; #gpio-cells = <2>; interrupt-controller; #interrupt-cells = <2>; + status = "disabled"; }; uart1: serial@02020000 { compatible = "fsl,imx6q-uart"; reg = <0x02020000 0x4000>; - interrupt-parent = <&gic>; + interrupt-parent = <&gic>; interrupts = <58>; clock-frequency = <80000000>; status = "disabled"; @@ -204,7 +226,7 @@ uart2: serial@021e8000 { compatible = "fsl,imx6q-uart"; reg = <0x021e8000 0x4000>; - interrupt-parent = <&gic>; + interrupt-parent = <&gic>; interrupts = <59>; clock-frequency = <80000000>; status = "disabled"; @@ -213,7 +235,7 @@ uart3: serial@021ec000 { compatible = "fsl,imx6q-uart"; reg = <0x021ec000 0x4000>; - interrupt-parent = <&gic>; + interrupt-parent = <&gic>; interrupts = <60>; clock-frequency = <80000000>; status = "disabled"; @@ -222,7 +244,7 @@ uart4: serial@021f0000 { compatible = "fsl,imx6q-uart"; reg = <0x021f0000 0x4000>; - interrupt-parent = <&gic>; + interrupt-parent = <&gic>; interrupts = <61>; clock-frequency = <80000000>; status = "disabled"; @@ -231,7 +253,7 @@ uart5: serial@021f4000 { compatible = "fsl,imx6q-uart"; reg = <0x021f4000 0x4000>; - interrupt-parent = <&gic>; + interrupt-parent = <&gic>; interrupts = <62>; clock-frequency = <80000000>; status = "disabled"; @@ -243,14 +265,69 @@ interrupts = <44>; status = "disabled"; }; - + usbphy2: usbphy@020ca000 { compatible = "fsl,imx6q-usbphy", "fsl,imx23-usbphy"; reg = <0x020ca000 0x1000>; interrupts = <45>; status = "disabled"; }; - + + ecspi1: ecspi@02008000 { + compatible = "fsl,imx6q-ecspi"; + reg = <0x02008000 0x4000>; + interrupts = < 63 >; + status = "disabled"; + }; + + ecspi2: ecspi@0200C000 { + compatible = "fsl,imx6q-ecspi"; + reg = <0x0200C000 0x4000>; + interrupts = < 64 >; + status = "disabled"; + }; + + ecspi3: ecspi@02010000 { + compatible = "fsl,imx6q-ecspi"; + reg = <0x02010000 0x4000>; + interrupts = < 65 >; + status = "disabled"; + }; + + ecspi4: ecspi@02014000 { + compatible = "fsl,imx6q-ecspi"; + reg = <0x02014000 0x4000>; + interrupts = < 66 >; + status = "disabled"; + }; + + ecspi5: ecspi@02018000 { + compatible = "fsl,imx6q-ecspi"; + reg = <0x02018000 0x4000>; + interrupts = < 67 >; + status = "disabled"; + }; + + ssi1: ssi@02028000 { + compatible = "fsl,imx6q-ssi"; + reg = <0x02028000 0x4000>; + interrupts = < 78 >; + status = "disabled"; + }; + + ssi2: ssi@0202C000 { + compatible = "fsl,imx6q-ssi"; + reg = <0x0202C000 0x4000>; + interrupts = < 79 >; + status = "disabled"; + }; + + ssi3: ssi@02030000 { + compatible = "fsl,imx6q-ssi"; + reg = <0x02030000 0x4000>; + interrupts = < 80 >; + status = "disabled"; + }; }; aips@02100000 { /* AIPS2 */ @@ -267,7 +344,7 @@ interrupts = <150 151>; status = "disabled"; }; - + usbotg1: usb@02184000 { compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; reg = <0x02184000 0x200>; @@ -276,7 +353,7 @@ fsl,usbmisc = <&usbmisc 0>; status = "disabled"; }; - + usbh1: usb@02184200 { compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; reg = <0x02184200 0x200>; @@ -285,7 +362,7 @@ fsl,usbmisc = <&usbmisc 1>; status = "disabled"; }; - + usbh2: usb@02184400 { compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; reg = <0x02184400 0x200>; @@ -293,7 +370,7 @@ fsl,usbmisc = <&usbmisc 2>; status = "disabled"; }; - + usbh3: usb@02184600 { compatible = "fsl,imx6q-usb", "fsl,imx27-usb"; reg = <0x02184600 0x200>; @@ -301,7 +378,7 @@ fsl,usbmisc = <&usbmisc 3>; status = "disabled"; }; - + usbmisc: usbmisc@02184800 { #index-cells = <1>; compatible = "fsl,imx6q-usbmisc"; @@ -352,6 +429,12 @@ compatible = "fsl,imx6q-ocotp"; reg = <0x021bc000 0x4000>; }; + + audmux: audmux@021d8000 { + compatible = "fsl,imx6q-audmux"; + reg = <0x021d8000 0x4000>; + status = "disabled"; + }; }; }; }; Modified: head/sys/boot/fdt/dts/arm/wandboard-dual.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/wandboard-dual.dts Fri Jul 18 07:41:38 2014 (r268833) +++ head/sys/boot/fdt/dts/arm/wandboard-dual.dts Fri Jul 18 07:47:50 2014 (r268834) @@ -44,11 +44,14 @@ SOC: soc@00000000 { aips@02000000 { /* AIPS1 */ -// iomux@73fa8000 { status = "disabled"; }; -// gpio@0209C000 { status = "disabled"; }; -// gpio@020A0000 { status = "disabled"; }; -// gpio@020A4000 { status = "disabled"; }; -// gpio@020A8000 { status = "disabled"; }; + iomux@020e0000 { status = "disabled"; }; + gpio@0209c000 { status = "okay"; }; + gpio@020a0000 { status = "okay"; }; + gpio@020a4000 { status = "okay"; }; + gpio@020a8000 { status = "okay"; }; + gpio@020aC000 { status = "okay"; }; + gpio@020b0000 { status = "okay"; }; + gpio@020b4000 { status = "okay"; }; console:serial@02020000 { status = "okay"; }; serial@021e8000 { status = "disabled"; }; serial@021ec000 { status = "disabled"; }; @@ -58,7 +61,7 @@ usbphy@020ca000 { status = "okay"; }; }; aips@02100000 { /* AIPS2 */ - ethernet@02188000 { + ethernet@02188000 { status = "okay"; phy-mode = "rgmii"; phy-disable-preamble; Modified: head/sys/boot/fdt/dts/arm/wandboard-quad.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/wandboard-quad.dts Fri Jul 18 07:41:38 2014 (r268833) +++ head/sys/boot/fdt/dts/arm/wandboard-quad.dts Fri Jul 18 07:47:50 2014 (r268834) @@ -44,11 +44,14 @@ SOC: soc@00000000 { aips@02000000 { /* AIPS1 */ -// iomux@73fa8000 { status = "disabled"; }; -// gpio@0209C000 { status = "disabled"; }; -// gpio@020A0000 { status = "disabled"; }; -// gpio@020A4000 { status = "disabled"; }; -// gpio@020A8000 { status = "disabled"; }; + iomux@020e0000 { status = "disabled"; }; + gpio@0209c000 { status = "okay"; }; + gpio@020a0000 { status = "okay"; }; + gpio@020a4000 { status = "okay"; }; + gpio@020a8000 { status = "okay"; }; + gpio@020aC000 { status = "okay"; }; + gpio@020b0000 { status = "okay"; }; + gpio@020b4000 { status = "okay"; }; console:serial@02020000 { status = "okay"; }; serial@021e8000 { status = "disabled"; }; serial@021ec000 { status = "disabled"; }; @@ -58,7 +61,7 @@ usbphy@020ca000 { status = "okay"; }; }; aips@02100000 { /* AIPS2 */ - ethernet@02188000 { + ethernet@02188000 { status = "okay"; phy-mode = "rgmii"; phy-disable-preamble; Modified: head/sys/boot/fdt/dts/arm/wandboard-solo.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/wandboard-solo.dts Fri Jul 18 07:41:38 2014 (r268833) +++ head/sys/boot/fdt/dts/arm/wandboard-solo.dts Fri Jul 18 07:47:50 2014 (r268834) @@ -44,11 +44,14 @@ SOC: soc@00000000 { aips@02000000 { /* AIPS1 */ -// iomux@73fa8000 { status = "disabled"; }; -// gpio@0209C000 { status = "disabled"; }; -// gpio@020A0000 { status = "disabled"; }; -// gpio@020A4000 { status = "disabled"; }; -// gpio@020A8000 { status = "disabled"; }; + iomux@020e0000 { status = "disabled"; }; + gpio@0209c000 { status = "okay"; }; + gpio@020a0000 { status = "okay"; }; + gpio@020a4000 { status = "okay"; }; + gpio@020a8000 { status = "okay"; }; + gpio@020aC000 { status = "okay"; }; + gpio@020b0000 { status = "okay"; }; + gpio@020b4000 { status = "okay"; }; console:serial@02020000 { status = "okay"; }; serial@021e8000 { status = "disabled"; }; serial@021ec000 { status = "disabled"; }; @@ -58,7 +61,7 @@ usbphy@020ca000 { status = "okay"; }; }; aips@02100000 { /* AIPS2 */ - ethernet@02188000 { + ethernet@02188000 { status = "okay"; phy-mode = "rgmii"; phy-disable-preamble; From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 07:52:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7FCB5A05; Fri, 18 Jul 2014 07:52: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 5285525E2; Fri, 18 Jul 2014 07:52:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6I7qaAn008905; Fri, 18 Jul 2014 07:52:36 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6I7qZAO008899; Fri, 18 Jul 2014 07:52:35 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201407180752.s6I7qZAO008899@svn.freebsd.org> From: Ruslan Bukin Date: Fri, 18 Jul 2014 07:52:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268835 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 07:52:36 -0000 Author: br Date: Fri Jul 18 07:52:35 2014 New Revision: 268835 URL: http://svnweb.freebsd.org/changeset/base/268835 Log: Rename gpio driver file. Added: head/sys/arm/freescale/imx/imx_gpio.c - copied unchanged from r268834, head/sys/arm/freescale/imx/imx51_gpio.c Deleted: head/sys/arm/freescale/imx/imx51_gpio.c Modified: head/sys/arm/freescale/imx/files.imx51 head/sys/arm/freescale/imx/files.imx53 head/sys/arm/freescale/imx/files.imx6 Modified: head/sys/arm/freescale/imx/files.imx51 ============================================================================== --- head/sys/arm/freescale/imx/files.imx51 Fri Jul 18 07:47:50 2014 (r268834) +++ head/sys/arm/freescale/imx/files.imx51 Fri Jul 18 07:52:35 2014 (r268835) @@ -22,7 +22,7 @@ arm/freescale/imx/tzic.c standard arm/freescale/imx/imx51_iomux.c optional iomux # GPIO -arm/freescale/imx/imx51_gpio.c optional gpio +arm/freescale/imx/imx_gpio.c optional gpio # Generic Periodic Timer arm/freescale/imx/imx_gpt.c standard Modified: head/sys/arm/freescale/imx/files.imx53 ============================================================================== --- head/sys/arm/freescale/imx/files.imx53 Fri Jul 18 07:47:50 2014 (r268834) +++ head/sys/arm/freescale/imx/files.imx53 Fri Jul 18 07:52:35 2014 (r268835) @@ -25,7 +25,7 @@ arm/freescale/imx/tzic.c standard arm/freescale/imx/imx51_iomux.c optional iomux # GPIO -arm/freescale/imx/imx51_gpio.c optional gpio +arm/freescale/imx/imx_gpio.c optional gpio # Generic Periodic Timer arm/freescale/imx/imx_gpt.c standard Modified: head/sys/arm/freescale/imx/files.imx6 ============================================================================== --- head/sys/arm/freescale/imx/files.imx6 Fri Jul 18 07:47:50 2014 (r268834) +++ head/sys/arm/freescale/imx/files.imx6 Fri Jul 18 07:52:35 2014 (r268835) @@ -26,7 +26,7 @@ arm/freescale/imx/imx6_mp.c optional sm arm/freescale/imx/imx6_pl310.c standard arm/freescale/imx/imx_machdep.c standard arm/freescale/imx/imx_gpt.c standard -arm/freescale/imx/imx51_gpio.c optional gpio +arm/freescale/imx/imx_gpio.c optional gpio # # Optional devices. Copied: head/sys/arm/freescale/imx/imx_gpio.c (from r268834, head/sys/arm/freescale/imx/imx51_gpio.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/freescale/imx/imx_gpio.c Fri Jul 18 07:52:35 2014 (r268835, copy of r268834, head/sys/arm/freescale/imx/imx51_gpio.c) @@ -0,0 +1,491 @@ +/*- + * Copyright (c) 2012, 2013 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Oleksandr Rybalko under sponsorship + * from the FreeBSD Foundation. + * + * 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. + */ + +/* + * Freescale i.MX515 GPIO driver. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include "gpio_if.h" + +#define GPIO_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +#define GPIO_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) +#define GPIO_LOCK_INIT(_sc) mtx_init(&_sc->sc_mtx, \ + device_get_nameunit(_sc->sc_dev), "imx_gpio", MTX_DEF) +#define GPIO_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); +#define GPIO_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); +#define GPIO_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); + +#define WRITE4(_sc, _r, _v) \ + bus_space_write_4((_sc)->sc_iot, (_sc)->sc_ioh, (_r), (_v)) +#define READ4(_sc, _r) \ + bus_space_read_4((_sc)->sc_iot, (_sc)->sc_ioh, (_r)) +#define SET4(_sc, _r, _m) \ + WRITE4((_sc), (_r), READ4((_sc), (_r)) | (_m)) +#define CLEAR4(_sc, _r, _m) \ + WRITE4((_sc), (_r), READ4((_sc), (_r)) & ~(_m)) + +/* Registers definition for Freescale i.MX515 GPIO controller */ + +#define IMX_GPIO_DR_REG 0x000 /* Pin Data */ +#define IMX_GPIO_OE_REG 0x004 /* Set Pin Output */ +#define IMX_GPIO_PSR_REG 0x008 /* Pad Status */ +#define IMX_GPIO_ICR1_REG 0x00C /* Interrupt Configuration */ +#define IMX_GPIO_ICR2_REG 0x010 /* Interrupt Configuration */ +#define GPIO_ICR_COND_LOW 0 +#define GPIO_ICR_COND_HIGH 1 +#define GPIO_ICR_COND_RISE 2 +#define GPIO_ICR_COND_FALL 3 +#define IMX_GPIO_IMR_REG 0x014 /* Interrupt Mask Register */ +#define IMX_GPIO_ISR_REG 0x018 /* Interrupt Status Register */ +#define IMX_GPIO_EDGE_REG 0x01C /* Edge Detect Register */ + +#define DEFAULT_CAPS (GPIO_PIN_INPUT | GPIO_PIN_OUTPUT) +#define NGPIO 32 + +struct imx51_gpio_softc { + device_t dev; + struct mtx sc_mtx; + struct resource *sc_res[11]; /* 1 x mem, 2 x IRQ, 8 x IRQ */ + void *gpio_ih[11]; /* 1 ptr is not a big waste */ + int sc_l_irq; /* Last irq resource */ + bus_space_tag_t sc_iot; + bus_space_handle_t sc_ioh; + int gpio_npins; + struct gpio_pin gpio_pins[NGPIO]; +}; + +static struct ofw_compat_data compat_data[] = { + {"fsl,imx6q-gpio", 1}, + {"fsl,imx53-gpio", 1}, + {"fsl,imx51-gpio", 1}, + {NULL, 0} +}; + +static struct resource_spec imx_gpio_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 1, RF_ACTIVE }, + { -1, 0 } +}; + +static struct resource_spec imx_gpio0irq_spec[] = { + { SYS_RES_IRQ, 2, RF_ACTIVE }, + { SYS_RES_IRQ, 3, RF_ACTIVE }, + { SYS_RES_IRQ, 4, RF_ACTIVE }, + { SYS_RES_IRQ, 5, RF_ACTIVE }, + { SYS_RES_IRQ, 6, RF_ACTIVE }, + { SYS_RES_IRQ, 7, RF_ACTIVE }, + { SYS_RES_IRQ, 8, RF_ACTIVE }, + { SYS_RES_IRQ, 9, RF_ACTIVE }, + { -1, 0 } +}; + +/* + * Helpers + */ +static void imx51_gpio_pin_configure(struct imx51_gpio_softc *, + struct gpio_pin *, uint32_t); + +/* + * Driver stuff + */ +static int imx51_gpio_probe(device_t); +static int imx51_gpio_attach(device_t); +static int imx51_gpio_detach(device_t); +static int imx51_gpio_intr(void *); + +/* + * GPIO interface + */ +static int imx51_gpio_pin_max(device_t, int *); +static int imx51_gpio_pin_getcaps(device_t, uint32_t, uint32_t *); +static int imx51_gpio_pin_getflags(device_t, uint32_t, uint32_t *); +static int imx51_gpio_pin_getname(device_t, uint32_t, char *); +static int imx51_gpio_pin_setflags(device_t, uint32_t, uint32_t); +static int imx51_gpio_pin_set(device_t, uint32_t, unsigned int); +static int imx51_gpio_pin_get(device_t, uint32_t, unsigned int *); +static int imx51_gpio_pin_toggle(device_t, uint32_t pin); + +static void +imx51_gpio_pin_configure(struct imx51_gpio_softc *sc, struct gpio_pin *pin, + unsigned int flags) +{ + + GPIO_LOCK(sc); + + /* + * Manage input/output + */ + if (flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) { + pin->gp_flags &= ~(GPIO_PIN_INPUT|GPIO_PIN_OUTPUT); + if (flags & GPIO_PIN_OUTPUT) { + pin->gp_flags |= GPIO_PIN_OUTPUT; + SET4(sc, IMX_GPIO_OE_REG, (1 << pin->gp_pin)); + } + else { + pin->gp_flags |= GPIO_PIN_INPUT; + CLEAR4(sc, IMX_GPIO_OE_REG, (1 << pin->gp_pin)); + } + } + + GPIO_UNLOCK(sc); +} + +static int +imx51_gpio_pin_max(device_t dev, int *maxpin) +{ + + *maxpin = NGPIO - 1; + return (0); +} + +static int +imx51_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps) +{ + struct imx51_gpio_softc *sc; + int i; + + sc = device_get_softc(dev); + for (i = 0; i < sc->gpio_npins; i++) { + if (sc->gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= sc->gpio_npins) + return (EINVAL); + + GPIO_LOCK(sc); + *caps = sc->gpio_pins[i].gp_caps; + GPIO_UNLOCK(sc); + + return (0); +} + +static int +imx51_gpio_pin_getflags(device_t dev, uint32_t pin, uint32_t *flags) +{ + struct imx51_gpio_softc *sc; + int i; + + sc = device_get_softc(dev); + for (i = 0; i < sc->gpio_npins; i++) { + if (sc->gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= sc->gpio_npins) + return (EINVAL); + + GPIO_LOCK(sc); + *flags = sc->gpio_pins[i].gp_flags; + GPIO_UNLOCK(sc); + + return (0); +} + +static int +imx51_gpio_pin_getname(device_t dev, uint32_t pin, char *name) +{ + struct imx51_gpio_softc *sc; + int i; + + sc = device_get_softc(dev); + for (i = 0; i < sc->gpio_npins; i++) { + if (sc->gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= sc->gpio_npins) + return (EINVAL); + + GPIO_LOCK(sc); + memcpy(name, sc->gpio_pins[i].gp_name, GPIOMAXNAME); + GPIO_UNLOCK(sc); + + return (0); +} + +static int +imx51_gpio_pin_setflags(device_t dev, uint32_t pin, uint32_t flags) +{ + struct imx51_gpio_softc *sc; + int i; + + sc = device_get_softc(dev); + for (i = 0; i < sc->gpio_npins; i++) { + if (sc->gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= sc->gpio_npins) + return (EINVAL); + + /* Check for unwanted flags. */ + if ((flags & sc->gpio_pins[i].gp_caps) != flags) + return (EINVAL); + + /* Can't mix input/output together */ + if ((flags & (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) == + (GPIO_PIN_INPUT|GPIO_PIN_OUTPUT)) + return (EINVAL); + + imx51_gpio_pin_configure(sc, &sc->gpio_pins[i], flags); + + + return (0); +} + +static int +imx51_gpio_pin_set(device_t dev, uint32_t pin, unsigned int value) +{ + struct imx51_gpio_softc *sc; + int i; + + sc = device_get_softc(dev); + for (i = 0; i < sc->gpio_npins; i++) { + if (sc->gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= sc->gpio_npins) + return (EINVAL); + + GPIO_LOCK(sc); + if (value) + SET4(sc, IMX_GPIO_DR_REG, (1 << i)); + else + CLEAR4(sc, IMX_GPIO_DR_REG, (1 << i)); + GPIO_UNLOCK(sc); + + return (0); +} + +static int +imx51_gpio_pin_get(device_t dev, uint32_t pin, unsigned int *val) +{ + struct imx51_gpio_softc *sc; + int i; + + sc = device_get_softc(dev); + for (i = 0; i < sc->gpio_npins; i++) { + if (sc->gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= sc->gpio_npins) + return (EINVAL); + + GPIO_LOCK(sc); + *val = (READ4(sc, IMX_GPIO_DR_REG) >> i) & 1; + GPIO_UNLOCK(sc); + + return (0); +} + +static int +imx51_gpio_pin_toggle(device_t dev, uint32_t pin) +{ + struct imx51_gpio_softc *sc; + int i; + + sc = device_get_softc(dev); + for (i = 0; i < sc->gpio_npins; i++) { + if (sc->gpio_pins[i].gp_pin == pin) + break; + } + + if (i >= sc->gpio_npins) + return (EINVAL); + + GPIO_LOCK(sc); + WRITE4(sc, IMX_GPIO_DR_REG, + (READ4(sc, IMX_GPIO_DR_REG) ^ (1 << i))); + GPIO_UNLOCK(sc); + + return (0); +} + +static int +imx51_gpio_intr(void *arg) +{ + struct imx51_gpio_softc *sc; + uint32_t input, value; + + sc = arg; + input = READ4(sc, IMX_GPIO_ISR_REG); + value = input & READ4(sc, IMX_GPIO_IMR_REG); + WRITE4(sc, IMX_GPIO_ISR_REG, input); + + if (!value) + goto intr_done; + + /* TODO: interrupt handling */ + +intr_done: + return (FILTER_HANDLED); +} + +static int +imx51_gpio_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data != 0) { + device_set_desc(dev, "Freescale i.MX GPIO Controller"); + return (BUS_PROBE_DEFAULT); + } + + return (ENXIO); +} + +static int +imx51_gpio_attach(device_t dev) +{ + struct imx51_gpio_softc *sc; + int i, irq; + + sc = device_get_softc(dev); + mtx_init(&sc->sc_mtx, device_get_nameunit(dev), NULL, MTX_DEF); + + if (bus_alloc_resources(dev, imx_gpio_spec, sc->sc_res)) { + device_printf(dev, "could not allocate resources\n"); + return (ENXIO); + } + + sc->dev = dev; + sc->gpio_npins = NGPIO; + sc->sc_l_irq = 2; + sc->sc_iot = rman_get_bustag(sc->sc_res[0]); + sc->sc_ioh = rman_get_bushandle(sc->sc_res[0]); + + if (bus_alloc_resources(dev, imx_gpio0irq_spec, &sc->sc_res[3]) == 0) { + /* + * First GPIO unit able to serve +8 interrupts for 8 first + * pins. + */ + sc->sc_l_irq = 10; + } + + for (irq = 1; irq <= sc->sc_l_irq; irq ++) { + if ((bus_setup_intr(dev, sc->sc_res[irq], INTR_TYPE_MISC, + imx51_gpio_intr, NULL, sc, &sc->gpio_ih[irq]))) { + device_printf(dev, + "WARNING: unable to register interrupt handler\n"); + return (ENXIO); + } + } + + for (i = 0; i < sc->gpio_npins; i++) { + sc->gpio_pins[i].gp_pin = i; + sc->gpio_pins[i].gp_caps = DEFAULT_CAPS; + sc->gpio_pins[i].gp_flags = + (READ4(sc, IMX_GPIO_OE_REG) & (1 << i)) ? GPIO_PIN_OUTPUT: + GPIO_PIN_INPUT; + snprintf(sc->gpio_pins[i].gp_name, GPIOMAXNAME, + "imx_gpio%d.%d", device_get_unit(dev), i); + } + + device_add_child(dev, "gpioc", device_get_unit(dev)); + device_add_child(dev, "gpiobus", device_get_unit(dev)); + + return (bus_generic_attach(dev)); +} + +static int +imx51_gpio_detach(device_t dev) +{ + struct imx51_gpio_softc *sc; + + sc = device_get_softc(dev); + + KASSERT(mtx_initialized(&sc->sc_mtx), ("gpio mutex not initialized")); + + bus_generic_detach(dev); + + if (sc->sc_res[3]) + bus_release_resources(dev, imx_gpio0irq_spec, &sc->sc_res[3]); + + if (sc->sc_res[0]) + bus_release_resources(dev, imx_gpio_spec, sc->sc_res); + + mtx_destroy(&sc->sc_mtx); + + return(0); +} + +static device_method_t imx51_gpio_methods[] = { + DEVMETHOD(device_probe, imx51_gpio_probe), + DEVMETHOD(device_attach, imx51_gpio_attach), + DEVMETHOD(device_detach, imx51_gpio_detach), + + /* GPIO protocol */ + DEVMETHOD(gpio_pin_max, imx51_gpio_pin_max), + DEVMETHOD(gpio_pin_getname, imx51_gpio_pin_getname), + DEVMETHOD(gpio_pin_getflags, imx51_gpio_pin_getflags), + DEVMETHOD(gpio_pin_getcaps, imx51_gpio_pin_getcaps), + DEVMETHOD(gpio_pin_setflags, imx51_gpio_pin_setflags), + DEVMETHOD(gpio_pin_get, imx51_gpio_pin_get), + DEVMETHOD(gpio_pin_set, imx51_gpio_pin_set), + DEVMETHOD(gpio_pin_toggle, imx51_gpio_pin_toggle), + {0, 0}, +}; + +static driver_t imx51_gpio_driver = { + "gpio", + imx51_gpio_methods, + sizeof(struct imx51_gpio_softc), +}; +static devclass_t imx51_gpio_devclass; + +DRIVER_MODULE(imx51_gpio, simplebus, imx51_gpio_driver, imx51_gpio_devclass, + 0, 0); From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 08:08:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 17029FA1; Fri, 18 Jul 2014 08:08:46 +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 DF9FD26FD; Fri, 18 Jul 2014 08:08:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6I88jgL015154; Fri, 18 Jul 2014 08:08:45 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6I88jsL015149; Fri, 18 Jul 2014 08:08:45 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201407180808.s6I88jsL015149@svn.freebsd.org> From: Ruslan Bukin Date: Fri, 18 Jul 2014 08:08:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268836 - head/sys/boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 08:08:46 -0000 Author: br Date: Fri Jul 18 08:08:45 2014 New Revision: 268836 URL: http://svnweb.freebsd.org/changeset/base/268836 Log: Fix typo. Modified: head/sys/boot/fdt/dts/arm/wandboard-dual.dts head/sys/boot/fdt/dts/arm/wandboard-quad.dts head/sys/boot/fdt/dts/arm/wandboard-solo.dts Modified: head/sys/boot/fdt/dts/arm/wandboard-dual.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/wandboard-dual.dts Fri Jul 18 07:52:35 2014 (r268835) +++ head/sys/boot/fdt/dts/arm/wandboard-dual.dts Fri Jul 18 08:08:45 2014 (r268836) @@ -49,7 +49,7 @@ gpio@020a0000 { status = "okay"; }; gpio@020a4000 { status = "okay"; }; gpio@020a8000 { status = "okay"; }; - gpio@020aC000 { status = "okay"; }; + gpio@020ac000 { status = "okay"; }; gpio@020b0000 { status = "okay"; }; gpio@020b4000 { status = "okay"; }; console:serial@02020000 { status = "okay"; }; Modified: head/sys/boot/fdt/dts/arm/wandboard-quad.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/wandboard-quad.dts Fri Jul 18 07:52:35 2014 (r268835) +++ head/sys/boot/fdt/dts/arm/wandboard-quad.dts Fri Jul 18 08:08:45 2014 (r268836) @@ -49,7 +49,7 @@ gpio@020a0000 { status = "okay"; }; gpio@020a4000 { status = "okay"; }; gpio@020a8000 { status = "okay"; }; - gpio@020aC000 { status = "okay"; }; + gpio@020ac000 { status = "okay"; }; gpio@020b0000 { status = "okay"; }; gpio@020b4000 { status = "okay"; }; console:serial@02020000 { status = "okay"; }; Modified: head/sys/boot/fdt/dts/arm/wandboard-solo.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/wandboard-solo.dts Fri Jul 18 07:52:35 2014 (r268835) +++ head/sys/boot/fdt/dts/arm/wandboard-solo.dts Fri Jul 18 08:08:45 2014 (r268836) @@ -49,7 +49,7 @@ gpio@020a0000 { status = "okay"; }; gpio@020a4000 { status = "okay"; }; gpio@020a8000 { status = "okay"; }; - gpio@020aC000 { status = "okay"; }; + gpio@020ac000 { status = "okay"; }; gpio@020b0000 { status = "okay"; }; gpio@020b4000 { status = "okay"; }; console:serial@02020000 { status = "okay"; }; From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 08:22:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1EC415DE; Fri, 18 Jul 2014 08:22: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 0CC3828A7; Fri, 18 Jul 2014 08:22:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6I8MDH7023839; Fri, 18 Jul 2014 08:22:13 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6I8MD5a023838; Fri, 18 Jul 2014 08:22:13 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201407180822.s6I8MD5a023838@svn.freebsd.org> From: Adrian Chadd Date: Fri, 18 Jul 2014 08:22:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268837 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 08:22:14 -0000 Author: adrian Date: Fri Jul 18 08:22:13 2014 New Revision: 268837 URL: http://svnweb.freebsd.org/changeset/base/268837 Log: Update the default RSS hash to the Chelsio T5 firmware one - it provides markedly better distribution of IPv6 address/ports than the previous key. The previous key would hash large swaths of the port space for a given source/destination IP address to the same low handful of bits, effectively mapping them to the same queue. This made testing very .. special. Modified: head/sys/netinet/in_rss.c Modified: head/sys/netinet/in_rss.c ============================================================================== --- head/sys/netinet/in_rss.c Fri Jul 18 08:08:45 2014 (r268836) +++ head/sys/netinet/in_rss.c Fri Jul 18 08:22:13 2014 (r268837) @@ -149,16 +149,16 @@ SYSCTL_INT(_net_inet_rss, OID_AUTO, base * * XXXRW: And that we don't randomize it yet! * - * XXXRW: This default is actually the default key from Chelsio T3 cards, as + * XXXRW: This default is actually the default key from Chelsio T5 cards, as * it offers reasonable distribution, unlike all-0 keys which always * generate a hash of 0 (upsettingly). */ -static uint8_t rss_key[RSS_KEYSIZE] = { +static uint8_t rss_key[RSS_KEYSIZE] = { + 0xbe, 0xac, 0x01, 0xfa, 0x6a, 0x42, 0xb7, 0x3b, + 0x80, 0x30, 0xf2, 0x0c, 0x77, 0xcb, 0x2d, 0xa3, + 0xae, 0x7b, 0x30, 0xb4, 0xd0, 0xca, 0x2b, 0xcb, 0x43, 0xa3, 0x8f, 0xb0, 0x41, 0x67, 0x25, 0x3d, 0x25, 0x5b, 0x0e, 0xc2, 0x6d, 0x5a, 0x56, 0xda, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; /* From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 08:23:54 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7389E742; Fri, 18 Jul 2014 08:23:54 +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 5506228B6; Fri, 18 Jul 2014 08:23:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6I8NsuX024070; Fri, 18 Jul 2014 08:23:54 GMT (envelope-from br@svn.freebsd.org) Received: (from br@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6I8NsNF024068; Fri, 18 Jul 2014 08:23:54 GMT (envelope-from br@svn.freebsd.org) Message-Id: <201407180823.s6I8NsNF024068@svn.freebsd.org> From: Ruslan Bukin Date: Fri, 18 Jul 2014 08:23:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268838 - in head/sys: arm/conf boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 08:23:54 -0000 Author: br Date: Fri Jul 18 08:23:53 2014 New Revision: 268838 URL: http://svnweb.freebsd.org/changeset/base/268838 Log: Add support for Toradex Apalis i.MX6 development board. Sponsored by: Toradex AG Added: head/sys/arm/conf/APALIS-IMX6 (contents, props changed) head/sys/boot/fdt/dts/arm/apalis-imx6.dts (contents, props changed) Added: head/sys/arm/conf/APALIS-IMX6 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/APALIS-IMX6 Fri Jul 18 08:23:53 2014 (r268838) @@ -0,0 +1,31 @@ +# Kernel configuration for Toradex Apalis i.MX6 +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +#NO_UNIVERSE + +include "IMX6" +ident APALIS-IMX6 + +makeoptions MODULES_OVERRIDE="" +makeoptions WITHOUT_MODULES="ahc" + +# Flattened Device Tree +options FDT +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=apalis-imx6.dts Added: head/sys/boot/fdt/dts/arm/apalis-imx6.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/arm/apalis-imx6.dts Fri Jul 18 08:23:53 2014 (r268838) @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2014 Ruslan Bukin + * 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$ + */ + +/dts-v1/; +/include/ "imx6.dtsi" + +/ { + #address-cells = <1>; + #size-cells = <1>; + + model = "Toradex Apalis i.MX6"; + compatible = "toradex,imx6q-apalis", "fsl,imx6q"; + + memory { + reg = <0x10000000 0x40000000>; /* RAM 1GB */ + }; + + SOC: soc@00000000 { + aips@02000000 { /* AIPS1 */ + iomux@020e0000 { status = "okay"; }; + gpio@0209c000 { status = "okay"; }; + gpio@020a0000 { status = "okay"; }; + gpio@020a4000 { status = "okay"; }; + gpio@020a8000 { status = "okay"; }; + gpio@020ac000 { status = "okay"; }; + gpio@020b0000 { status = "okay"; }; + gpio@020b4000 { status = "okay"; }; + console:serial@02020000 { status = "okay"; }; + serial@021e8000 { status = "disabled"; }; + serial@021ec000 { status = "disabled"; }; + serial@021f0000 { status = "disabled"; }; + serial@021f4000 { status = "disabled"; }; + usbphy@020c9000 { status = "okay"; }; + usbphy@020ca000 { status = "okay"; }; + ecspi@02008000 { status = "okay"; }; + ssi@02028000 { status = "okay"; }; + sdma@020ec000 { status = "okay"; }; + }; + aips@02100000 { /* AIPS2 */ + ethernet@02188000 { + status = "okay"; + phy-mode = "rgmii"; + phy-disable-preamble; + }; + usb@02184000 { status = "okay"; }; + usb@02184200 { status = "okay"; }; + usb@02184400 { status = "disabled"; }; + usb@02184600 { status = "disabled"; }; + usdhc@02190000 { status = "disabled"; }; + usdhc@02194000 { status = "okay"; }; + usdhc@02198000 { status = "disabled"; }; + usdhc@0219c000 { status = "disabled"; }; + audmux@021d8000 { status = "okay"; }; + }; + }; + + chosen { + stdin = &console; + stdout = &console; + }; +}; From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 11:32:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 33E8739C; Fri, 18 Jul 2014 11:32:46 +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 1F0C328D6; Fri, 18 Jul 2014 11:32:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6IBWjl3014047; Fri, 18 Jul 2014 11:32:45 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6IBWi4w014033; Fri, 18 Jul 2014 11:32:44 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201407181132.s6IBWi4w014033@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Fri, 18 Jul 2014 11:32:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268839 - in head/contrib/unbound: doc services util X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 11:32:46 -0000 Author: des Date: Fri Jul 18 11:32:44 2014 New Revision: 268839 URL: http://svnweb.freebsd.org/changeset/base/268839 Log: Import unblock-lan-zones feature backported from upstream svn trunk. This is a partial fix for reverse lookups in RFC 1918 networks. With this option enabled, unbound no longer ignores these queries; however, it will still reject the answer it gets from the forwarder, because the RFC 1918 reverse zones are signed. Submitted by: "W.C.A. Wijngaards" Modified: head/contrib/unbound/doc/example.conf.in head/contrib/unbound/doc/unbound.conf.5 head/contrib/unbound/doc/unbound.conf.5.in head/contrib/unbound/services/localzone.c head/contrib/unbound/util/config_file.c head/contrib/unbound/util/config_file.h head/contrib/unbound/util/configlexer.c head/contrib/unbound/util/configlexer.lex head/contrib/unbound/util/configparser.c head/contrib/unbound/util/configparser.h head/contrib/unbound/util/configparser.y Modified: head/contrib/unbound/doc/example.conf.in ============================================================================== --- head/contrib/unbound/doc/example.conf.in Fri Jul 18 08:23:53 2014 (r268838) +++ head/contrib/unbound/doc/example.conf.in Fri Jul 18 11:32:44 2014 (r268839) @@ -437,7 +437,14 @@ server: # the amount of memory to use for the negative cache (used for DLV). # plain value in bytes or you can append k, m or G. default is "1Mb". # neg-cache-size: 1m - + + # if unbound is running service for the local host then it is useful + # to perform lan-wide lookups to the upstream, and unblock the + # long list of local-zones above. If this unbound is a dns server + # for a network of computers, disabled is better and stops information + # leakage of local lan information. + # unblock-lan-zones: no + # By default, for a number of zones a small default 'nothing here' # reply is built-in. Query traffic is thus blocked. If you # wish to serve such zone you can unblock them by uncommenting one Modified: head/contrib/unbound/doc/unbound.conf.5 ============================================================================== --- head/contrib/unbound/doc/unbound.conf.5 Fri Jul 18 08:23:53 2014 (r268838) +++ head/contrib/unbound/doc/unbound.conf.5 Fri Jul 18 11:32:44 2014 (r268839) @@ -778,6 +778,17 @@ Number of bytes size of the aggressive n A plain number is in bytes, append 'k', 'm' or 'g' for kilobytes, megabytes or gigabytes (1024*1024 bytes in a megabyte). .TP +.B unblock\-lan\-zones: \fI +Default is disabled. If enabled, then for private address space, +the reverse lookups are no longer filtered. This allows unbound when +running as dns service on a host where it provides service for that host, +to put out all of the queries for the 'lan' upstream. When enabled, +only localhost, 127.0.0.1 reverse and ::1 reverse zones are configured +with default local zones. Disable the option when unbound is running +as a (DHCP-) DNS network resolver for a group of machines, where such +lookups should be filtered (RFC compliance), this also stops potential +data leakage about the local network to the upstream DNS servers. +.TP .B local\-zone: \fI Configure a local zone. The type determines the answer to give if there is no match from local\-data. The types are deny, refuse, static, Modified: head/contrib/unbound/doc/unbound.conf.5.in ============================================================================== --- head/contrib/unbound/doc/unbound.conf.5.in Fri Jul 18 08:23:53 2014 (r268838) +++ head/contrib/unbound/doc/unbound.conf.5.in Fri Jul 18 11:32:44 2014 (r268839) @@ -778,6 +778,17 @@ Number of bytes size of the aggressive n A plain number is in bytes, append 'k', 'm' or 'g' for kilobytes, megabytes or gigabytes (1024*1024 bytes in a megabyte). .TP +.B unblock\-lan\-zones: \fI +Default is disabled. If enabled, then for private address space, +the reverse lookups are no longer filtered. This allows unbound when +running as dns service on a host where it provides service for that host, +to put out all of the queries for the 'lan' upstream. When enabled, +only localhost, 127.0.0.1 reverse and ::1 reverse zones are configured +with default local zones. Disable the option when unbound is running +as a (DHCP-) DNS network resolver for a group of machines, where such +lookups should be filtered (RFC compliance), this also stops potential +data leakage about the local network to the upstream DNS servers. +.TP .B local\-zone: \fI Configure a local zone. The type determines the answer to give if there is no match from local\-data. The types are deny, refuse, static, Modified: head/contrib/unbound/services/localzone.c ============================================================================== --- head/contrib/unbound/services/localzone.c Fri Jul 18 08:23:53 2014 (r268838) +++ head/contrib/unbound/services/localzone.c Fri Jul 18 11:32:44 2014 (r268839) @@ -594,6 +594,8 @@ lz_enter_defaults(struct local_zones* zo /* this list of zones is from RFC 6303 */ + /* block localhost level zones, first, later the LAN zones */ + /* localhost. zone */ if(!lz_exists(zones, "localhost.") && !lz_nodefault(cfg, "localhost.")) { @@ -650,6 +652,14 @@ lz_enter_defaults(struct local_zones* zo } lock_rw_unlock(&z->lock); } + + /* if unblock lan-zones, then do not add the zones below. + * we do add the zones above, about 127.0.0.1, because localhost is + * not on the lan. */ + if(cfg->unblock_lan_zones) + return 1; + + /* block LAN level zones */ if ( !add_as112_default(zones, cfg, "10.in-addr.arpa.") || !add_as112_default(zones, cfg, "16.172.in-addr.arpa.") || !add_as112_default(zones, cfg, "17.172.in-addr.arpa.") || Modified: head/contrib/unbound/util/config_file.c ============================================================================== --- head/contrib/unbound/util/config_file.c Fri Jul 18 08:23:53 2014 (r268838) +++ head/contrib/unbound/util/config_file.c Fri Jul 18 11:32:44 2014 (r268839) @@ -191,6 +191,7 @@ config_create(void) cfg->local_zones = NULL; cfg->local_zones_nodefault = NULL; cfg->local_data = NULL; + cfg->unblock_lan_zones = 0; cfg->python_script = NULL; cfg->remote_control_enable = 0; cfg->control_ifs = NULL; @@ -414,6 +415,7 @@ int config_set_option(struct config_file else S_YNO("minimal-responses:", minimal_responses) else S_YNO("rrset-roundrobin:", rrset_roundrobin) else S_STRLIST("local-data:", local_data) + else S_YNO("unblock-lan-zones:", unblock_lan_zones) else S_YNO("control-enable:", remote_control_enable) else S_STRLIST("control-interface:", control_ifs) else S_NUMBER_NONZERO("control-port:", control_port) @@ -678,6 +680,7 @@ config_get_option(struct config_file* cf else O_UNS(opt, "val-override-date", val_date_override) else O_YNO(opt, "minimal-responses", minimal_responses) else O_YNO(opt, "rrset-roundrobin", rrset_roundrobin) + else O_YNO(opt, "unblock-lan-zones", unblock_lan_zones) else O_DEC(opt, "max-udp-size", max_udp_size) else O_STR(opt, "python-script", python_script) else O_DEC(opt, "val-sig-skew-min", val_sig_skew_min) Modified: head/contrib/unbound/util/config_file.h ============================================================================== --- head/contrib/unbound/util/config_file.h Fri Jul 18 08:23:53 2014 (r268838) +++ head/contrib/unbound/util/config_file.h Fri Jul 18 11:32:44 2014 (r268839) @@ -273,6 +273,8 @@ struct config_file { struct config_strlist* local_zones_nodefault; /** local data RRs configged */ struct config_strlist* local_data; + /** unblock lan zones (reverse lookups for 10/8 and so on) */ + int unblock_lan_zones; /** remote control section. enable toggle. */ int remote_control_enable; Modified: head/contrib/unbound/util/configlexer.c ============================================================================== --- head/contrib/unbound/util/configlexer.c Fri Jul 18 08:23:53 2014 (r268838) +++ head/contrib/unbound/util/configlexer.c Fri Jul 18 11:32:44 2014 (r268839) @@ -375,8 +375,8 @@ static void yy_fatal_error (yyconst char *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 146 -#define YY_END_OF_BUFFER 147 +#define YY_NUM_RULES 147 +#define YY_END_OF_BUFFER 148 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -384,160 +384,162 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[1383] = +static yyconst flex_int16_t yy_accept[1399] = { 0, - 1, 1, 128, 128, 132, 132, 136, 136, 140, 140, - 1, 1, 147, 144, 1, 126, 126, 145, 2, 145, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 128, - 129, 129, 130, 145, 132, 133, 133, 134, 145, 139, - 136, 137, 137, 138, 145, 140, 141, 141, 142, 145, - 143, 127, 2, 131, 145, 143, 144, 0, 1, 2, - 2, 2, 2, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 128, 0, 132, 0, 139, 0, 136, 140, 0, - 143, 0, 2, 2, 143, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 143, 144, 144, 144, 144, 144, 144, 144, 144, 144, - - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 143, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 65, 144, 144, - - 144, 144, 144, 6, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 143, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 143, - 144, 144, 144, 144, 29, 144, 144, 144, 144, 144, - 144, 12, 13, 144, 15, 14, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 121, 144, 144, 144, 144, 144, 3, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - - 144, 144, 144, 144, 144, 144, 144, 144, 144, 143, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 135, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 32, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 33, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 80, 135, - - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 79, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 63, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 20, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 30, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - - 144, 144, 144, 144, 144, 144, 31, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 22, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 26, 144, 27, 144, 144, 144, 66, 144, - 67, 144, 64, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 5, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - - 144, 82, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 23, 144, 144, 144, 144, - 107, 106, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 34, 144, 144, 144, 144, 144, 144, 144, 144, - 69, 68, 144, 144, 144, 144, 144, 144, 103, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 50, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - - 54, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 105, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 4, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 100, 144, 144, 144, 144, 144, 144, 144, 115, 101, - 144, 21, 144, 144, 144, 144, 71, 144, 72, 70, - 144, 144, 144, 144, 144, 144, 78, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 102, 144, 144, 144, - - 144, 125, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 62, 144, 144, 144, 144, 144, 144, - 144, 144, 28, 144, 144, 17, 144, 144, 144, 16, - 144, 87, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 41, 42, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 73, 144, 144, 144, - 144, 144, 77, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 81, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 120, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - - 144, 144, 144, 144, 144, 91, 144, 95, 144, 144, - 144, 144, 76, 144, 144, 113, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 94, - 144, 144, 144, 144, 43, 44, 144, 49, 96, 144, - 108, 104, 144, 144, 37, 144, 98, 144, 144, 144, - 144, 144, 7, 144, 61, 112, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 83, 144, 144, 122, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 97, 144, 36, 38, - - 144, 144, 144, 144, 144, 60, 144, 144, 144, 144, - 116, 18, 19, 144, 144, 144, 144, 144, 144, 58, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 118, - 144, 144, 35, 144, 144, 144, 144, 144, 144, 11, - 144, 144, 144, 144, 144, 144, 144, 10, 144, 144, - 39, 144, 124, 117, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 144, 90, 89, 144, 119, 114, 144, - 144, 144, 144, 144, 144, 144, 144, 144, 144, 45, - 144, 123, 144, 144, 144, 144, 40, 144, 144, 144, - 84, 86, 144, 144, 144, 88, 144, 144, 144, 144, - - 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 24, 144, 144, 144, 144, 144, 144, 144, 144, 144, - 144, 144, 144, 111, 144, 144, 144, 144, 144, 144, - 144, 25, 144, 9, 144, 144, 109, 51, 144, 144, - 144, 93, 144, 74, 144, 144, 144, 53, 57, 52, - 144, 46, 144, 8, 144, 144, 92, 144, 144, 144, - 56, 144, 47, 144, 110, 144, 144, 85, 75, 55, - 48, 144, 144, 144, 144, 59, 144, 144, 144, 144, - 99, 0 + 1, 1, 129, 129, 133, 133, 137, 137, 141, 141, + 1, 1, 148, 145, 1, 127, 127, 146, 2, 146, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 129, + 130, 130, 131, 146, 133, 134, 134, 135, 146, 140, + 137, 138, 138, 139, 146, 141, 142, 142, 143, 146, + 144, 128, 2, 132, 146, 144, 145, 0, 1, 2, + 2, 2, 2, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 129, 0, 133, 0, 140, 0, 137, 141, 0, + 144, 0, 2, 2, 144, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 144, 145, 145, 145, 145, 145, 145, 145, 145, + + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 144, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 65, + + 145, 145, 145, 145, 145, 6, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 144, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 144, 145, 145, 145, 145, 29, 145, + 145, 145, 145, 145, 145, 12, 13, 145, 15, 14, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 122, 145, 145, + 145, 145, 145, 3, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 144, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 136, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 32, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 33, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + + 145, 145, 145, 145, 80, 136, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 79, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 63, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 20, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 30, 145, 145, 145, 145, 145, 145, 145, + + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 31, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 22, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 26, + 145, 27, 145, 145, 145, 66, 145, 67, 145, 64, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 5, 145, 145, 145, 145, + + 145, 145, 145, 145, 145, 145, 145, 145, 145, 82, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 23, 145, 145, 145, 145, 107, 106, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 34, + 145, 145, 145, 145, 145, 145, 145, 145, 69, 68, + 145, 145, 145, 145, 145, 145, 145, 103, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 50, 145, 145, 145, + + 145, 145, 145, 145, 145, 145, 145, 145, 145, 54, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 105, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 4, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 100, 145, 145, 145, 145, 145, 145, 145, 116, 101, + 145, 21, 145, 145, 145, 145, 71, 145, 72, 70, + 145, 145, 145, 145, 145, 145, 78, 145, 145, 145, + + 145, 145, 145, 145, 145, 145, 102, 145, 145, 145, + 145, 126, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 62, 145, 145, 145, 145, 145, 145, + 145, 145, 28, 145, 145, 17, 145, 145, 145, 16, + 145, 87, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 41, 42, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 73, 145, 145, + 145, 145, 145, 77, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 81, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + + 121, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 91, 145, 95, + 145, 145, 145, 145, 76, 145, 145, 114, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 94, 145, 145, 145, 145, 43, 44, 145, 49, + 96, 145, 108, 104, 145, 145, 37, 145, 98, 145, + 145, 145, 145, 145, 7, 145, 61, 113, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 83, 145, 145, 123, 145, 145, 145, + + 145, 145, 145, 145, 145, 145, 145, 145, 145, 97, + 145, 36, 38, 145, 145, 145, 145, 145, 60, 145, + 145, 145, 145, 117, 18, 19, 145, 145, 145, 145, + 145, 145, 145, 58, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 119, 145, 145, 35, 145, 145, 145, + 145, 145, 145, 11, 145, 145, 145, 145, 145, 145, + 145, 10, 145, 145, 39, 145, 125, 118, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 90, + 89, 145, 120, 115, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 45, 145, 124, 145, 145, 145, + + 145, 40, 145, 145, 145, 84, 86, 109, 145, 145, + 145, 88, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 24, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 112, + 145, 145, 145, 145, 145, 145, 145, 25, 145, 9, + 145, 145, 110, 51, 145, 145, 145, 93, 145, 74, + 145, 145, 145, 53, 57, 52, 145, 46, 145, 8, + 145, 145, 92, 145, 145, 145, 56, 145, 47, 145, + 111, 145, 145, 85, 75, 55, 48, 145, 145, 145, + 145, 59, 145, 145, 145, 145, 99, 0 + } ; static yyconst flex_int32_t yy_ec[256] = @@ -580,323 +582,327 @@ static yyconst flex_int32_t yy_meta[40] 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; -static yyconst flex_int16_t yy_base[1397] = +static yyconst flex_int16_t yy_base[1413] = { 0, 0, 0, 37, 40, 44, 51, 63, 75, 56, 68, - 87, 108, 2653, 2569, 50, 2760, 2760, 2760, 129, 94, + 87, 108, 2067, 1442, 50, 2793, 2793, 2793, 129, 94, 70, 104, 122, 90, 92, 115, 126, 95, 84, 132, - 135, 138, 50, 146, 148, 157, 167, 160, 151, 2566, - 2760, 2760, 2760, 70, 2404, 2760, 2760, 2760, 42, 2139, - 1931, 2760, 2760, 2760, 189, 1601, 2760, 2760, 2760, 195, - 1479, 2760, 199, 2760, 203, 111, 635, 209, 120, 0, + 135, 138, 50, 146, 148, 157, 167, 160, 151, 1368, + 2793, 2793, 2793, 70, 1259, 2793, 2793, 2793, 42, 1197, + 1142, 2793, 2793, 2793, 189, 824, 2793, 2793, 2793, 195, + 789, 2793, 199, 2793, 203, 111, 761, 209, 120, 0, 220, 0, 0, 103, 141, 149, 202, 189, 182, 204, 206, 210, 218, 215, 217, 221, 222, 223, 225, 228, 235, 248, 165, 244, 247, 233, 245, 252, 246, 251, 258, 260, 261, 262, 267, 263, 270, 271, 158, 274, - 276, 280, 277, 278, 282, 286, 283, 49, 287, 291, - 288, 588, 304, 558, 307, 386, 316, 354, 297, 320, - 236, 324, 328, 0, 321, 309, 330, 323, 226, 326, - 327, 334, 331, 337, 348, 339, 342, 344, 333, 346, - 353, 345, 351, 355, 354, 360, 363, 371, 373, 379, - 375, 382, 383, 381, 380, 392, 393, 399, 400, 396, - 402, 384, 405, 385, 406, 397, 409, 410, 413, 418, - 421, 419, 420, 417, 428, 425, 426, 438, 445, 430, - 431, 434, 442, 446, 447, 448, 451, 454, 455, 457, - - 458, 464, 461, 466, 467, 468, 473, 476, 474, 478, - 484, 490, 475, 483, 486, 487, 491, 493, 494, 496, - 502, 503, 504, 505, 509, 499, 510, 512, 526, 514, - 527, 515, 519, 531, 537, 533, 541, 539, 543, 549, - 545, 546, 547, 548, 553, 555, 561, 566, 557, 559, - 567, 570, 568, 590, 560, 576, 577, 580, 586, 583, - 596, 587, 595, 597, 613, 594, 611, 615, 619, 618, - 584, 621, 622, 624, 517, 623, 628, 630, 631, 627, - 629, 634, 649, 645, 646, 648, 647, 654, 661, 657, - 658, 659, 662, 663, 665, 668, 672, 2760, 674, 669, - - 676, 677, 679, 2760, 680, 681, 682, 683, 685, 692, - 694, 695, 697, 698, 699, 703, 704, 705, 725, 707, - 706, 716, 709, 734, 713, 736, 715, 728, 732, 723, - 739, 743, 710, 744, 745, 746, 754, 752, 753, 755, - 757, 758, 762, 766, 765, 772, 773, 777, 779, 787, - 784, 789, 790, 781, 791, 793, 799, 800, 798, 792, - 806, 805, 795, 808, 813, 807, 822, 815, 818, 819, - 826, 827, 828, 830, 829, 837, 836, 835, 844, 834, - 843, 848, 849, 850, 851, 860, 857, 858, 863, 869, - 870, 865, 871, 874, 875, 876, 877, 878, 879, 883, - - 885, 886, 894, 880, 890, 896, 902, 904, 887, 905, - 908, 909, 910, 911, 919, 912, 921, 913, 923, 926, - 929, 934, 925, 935, 2760, 945, 939, 941, 933, 759, - 927, 2760, 2760, 947, 2760, 2760, 948, 949, 950, 961, - 965, 958, 952, 960, 959, 974, 968, 978, 966, 986, - 988, 971, 980, 982, 989, 992, 990, 994, 998, 996, - 1004, 1007, 1006, 1008, 1010, 1011, 1013, 1015, 1016, 1022, - 1017, 1029, 1026, 2760, 1027, 1028, 1032, 1034, 1035, 2760, - 1036, 1039, 1037, 1040, 1041, 1047, 1043, 1050, 1048, 1051, - 1053, 1055, 1059, 1056, 1061, 1073, 1074, 1064, 1072, 1077, - - 1071, 1079, 1086, 1085, 1087, 1089, 1095, 1091, 1094, 1097, - 1098, 1099, 1100, 1101, 1104, 1126, 1106, 1107, 1108, 1109, - 1114, 1115, 1116, 1117, 1132, 1138, 1140, 1120, 1141, 1147, - 1149, 1143, 1152, 1150, 1156, 1157, 2760, 1163, 1159, 1160, - 1165, 1167, 1168, 1112, 1170, 1171, 1173, 1174, 1175, 1182, - 2760, 1180, 1183, 1181, 1185, 1186, 1192, 1194, 1204, 1200, - 2760, 1207, 1208, 1210, 1211, 1198, 1214, 1215, 1216, 1219, - 1222, 1223, 1225, 1230, 1232, 1220, 1234, 1227, 1233, 1235, - 1240, 1242, 1243, 1244, 1246, 1250, 1256, 1259, 1257, 1264, - 1258, 1260, 1266, 1269, 1267, 1270, 1268, 1271, 2760, 175, - - 1275, 1273, 1280, 1281, 1291, 1290, 1283, 1284, 1294, 1292, - 1293, 1282, 1303, 1304, 1305, 1306, 1309, 1310, 1312, 1313, - 1316, 1318, 1319, 1320, 1321, 1323, 1324, 1329, 1326, 1327, - 1330, 2760, 1343, 1336, 1337, 1346, 1348, 1356, 1349, 1352, - 1354, 1362, 1358, 1364, 1367, 1360, 1370, 1371, 1373, 1374, - 1380, 1382, 1378, 1381, 1384, 1386, 2760, 1390, 1388, 1389, - 1391, 1395, 1396, 1399, 1401, 1406, 1409, 1410, 1412, 2760, - 1415, 1416, 1417, 1423, 1420, 1427, 1424, 1433, 1428, 1430, - 1434, 1438, 1437, 1439, 1444, 2760, 1446, 1452, 1449, 1458, - 1450, 1456, 1457, 1461, 1462, 1463, 1469, 1465, 1467, 1466, - - 1470, 1472, 1473, 1476, 1474, 1478, 2760, 1496, 1477, 1481, - 1488, 1489, 1480, 1501, 1490, 1502, 1504, 1509, 1506, 1510, - 1512, 1511, 1513, 1514, 1517, 1520, 1522, 1528, 1534, 1535, - 1536, 2760, 1539, 1540, 1527, 1542, 1549, 1547, 1550, 1551, - 1552, 1553, 1554, 1562, 1555, 1556, 1558, 1563, 1559, 1564, - 1565, 1566, 1571, 1579, 1568, 1584, 1586, 1588, 1589, 1591, - 1590, 1597, 2760, 1596, 2760, 1598, 1599, 1607, 2760, 1605, - 2760, 1609, 2760, 1612, 1616, 1611, 1613, 1618, 1619, 1621, - 1622, 1624, 1627, 1628, 1629, 1631, 1630, 2760, 1636, 1632, - 1640, 1637, 1643, 1644, 1645, 1648, 1656, 1652, 1655, 1659, - - 1660, 2760, 1662, 1661, 1665, 1675, 1673, 1671, 1676, 1677, - 1678, 1679, 1680, 1682, 1687, 1688, 1684, 1690, 1691, 1696, - 1694, 1698, 1699, 1700, 1701, 2760, 1703, 1709, 1712, 1711, - 2760, 2760, 1714, 1723, 1725, 1715, 1728, 1717, 1729, 1733, - 1739, 1744, 1732, 1735, 1740, 1745, 1746, 1747, 1749, 1751, - 1754, 2760, 1760, 1756, 1762, 1763, 1753, 1766, 1764, 1775, - 2760, 2760, 1768, 1770, 1779, 1780, 1782, 1785, 2760, 1781, - 1786, 1787, 1788, 1789, 1791, 1795, 1796, 1805, 1802, 1807, - 1808, 1814, 1810, 1806, 1815, 1813, 1826, 2760, 1823, 1828, - 1834, 1817, 1830, 1831, 1836, 1833, 1840, 1842, 1848, 1844, - - 2760, 1850, 1837, 1857, 1846, 1859, 1860, 1867, 1854, 1856, - 1863, 1864, 1865, 1870, 1872, 1874, 1877, 2760, 1878, 1880, - 1881, 1882, 1885, 1888, 1890, 1892, 1893, 2760, 1895, 1904, - 1901, 1903, 1906, 1902, 1908, 1911, 1912, 1913, 1915, 1916, - 1919, 1924, 1925, 1934, 1926, 1929, 1940, 1938, 1949, 1950, - 1939, 1957, 1942, 1955, 1946, 1953, 1961, 1960, 1967, 1963, - 2760, 1965, 1970, 1972, 1973, 1976, 1974, 1977, 2760, 2760, - 1983, 2760, 1984, 1987, 1988, 1989, 2760, 1991, 2760, 2760, - 1992, 1999, 1993, 2000, 1964, 2003, 2760, 2004, 2007, 2008, - 2012, 2013, 2014, 2016, 2015, 2017, 2760, 2018, 2019, 2020, - - 2022, 2760, 2029, 2035, 2024, 2036, 2040, 2039, 2046, 2045, - 2032, 2053, 2049, 2760, 2047, 2055, 2057, 2058, 2059, 2060, - 2064, 2065, 2760, 2067, 2074, 2760, 2075, 2061, 2076, 2760, - 2078, 2760, 2080, 2082, 2085, 2090, 2087, 2098, 2083, 2091, - 2099, 2093, 2101, 2103, 2760, 2760, 2105, 2109, 2112, 2110, - 2115, 2117, 2116, 2118, 2119, 2124, 2760, 2125, 2127, 2126, - 2128, 2129, 2760, 2133, 2134, 2135, 2138, 2141, 2153, 2155, - 2144, 2159, 2161, 2156, 2163, 2165, 2166, 2760, 2167, 2169, - 2170, 2174, 2176, 2130, 2177, 2181, 2179, 2171, 2184, 2760, - 2187, 2188, 2191, 2193, 2195, 2196, 2198, 2199, 2200, 2203, - - 2204, 2206, 2209, 2210, 2213, 2760, 2211, 2760, 2216, 2226, - 2229, 2232, 2760, 2220, 2222, 2760, 2236, 2237, 2244, 2245, - 2247, 2252, 2248, 2238, 2255, 2240, 2256, 2262, 2263, 2760, - 2230, 2265, 2264, 2266, 2760, 2760, 2273, 2760, 2760, 2276, - 2760, 2760, 2277, 2279, 2760, 2281, 2760, 2288, 2284, 2271, - 2267, 2286, 2760, 2293, 2760, 2760, 2290, 2294, 2297, 2298, - 2300, 2302, 2305, 2306, 2307, 2308, 2309, 2310, 2312, 2314, - 2315, 2228, 2316, 2317, 2319, 2323, 2326, 2328, 2329, 2339, - 2760, 2327, 2340, 2760, 2347, 2342, 2335, 2331, 2348, 2352, - 2353, 2355, 2361, 2358, 2357, 2359, 2760, 2362, 2760, 2760, - - 2360, 2364, 2370, 2363, 2365, 2760, 2375, 2371, 2385, 2387, - 2760, 2760, 2760, 2388, 2377, 2382, 2392, 2393, 2394, 2760, - 2395, 2396, 2400, 2403, 2407, 2409, 2416, 2413, 2415, 2760, - 2417, 2419, 2760, 2420, 2421, 2424, 2426, 2427, 2429, 2760, - 2425, 2430, 2437, 2432, 2440, 2442, 2443, 2760, 2445, 2446, - 2760, 2452, 2760, 2760, 2447, 2455, 2457, 2462, 2464, 2453, - 2458, 2470, 2469, 2473, 2760, 2760, 2474, 2760, 2760, 2466, - 2475, 2476, 2478, 2481, 2482, 2484, 2486, 2489, 2488, 2760, - 2490, 2760, 2491, 2500, 2492, 2494, 2760, 2501, 2502, 2505, - 2760, 2760, 2506, 2515, 2513, 2760, 2518, 2517, 2519, 2520, - - 2525, 2527, 2521, 2528, 2531, 2529, 2507, 2532, 2541, 2543, - 2760, 2545, 2542, 2546, 2550, 2553, 2554, 2555, 2556, 2558, - 2559, 2561, 2563, 2760, 2564, 2565, 2575, 2580, 2584, 2572, - 2586, 2760, 2587, 2760, 2590, 2591, 2760, 2760, 2592, 2594, - 2597, 2760, 2598, 2760, 2581, 2605, 2595, 2760, 2760, 2760, - 2607, 2760, 2608, 2760, 2610, 2611, 2760, 2613, 2615, 2617, - 2760, 2619, 2760, 2621, 2760, 2622, 2623, 2760, 2760, 2760, - 2760, 2625, 2627, 2633, 2628, 2760, 2630, 2635, 2636, 2639, - 2760, 2760, 2668, 2675, 2682, 2689, 2696, 94, 2703, 2710, - 2717, 2724, 2731, 2738, 2745, 2752 + 276, 280, 277, 278, 282, 286, 283, 295, 287, 291, + 288, 653, 316, 558, 307, 417, 320, 388, 347, 324, + 236, 328, 332, 0, 310, 325, 333, 327, 226, 329, + 331, 339, 336, 343, 352, 345, 335, 348, 49, 355, + 357, 349, 350, 364, 360, 369, 367, 370, 371, 380, + 381, 388, 389, 296, 337, 391, 392, 398, 400, 396, + 399, 401, 402, 385, 404, 409, 406, 410, 411, 413, + 419, 416, 418, 422, 428, 425, 427, 434, 442, 443, + 445, 440, 430, 446, 453, 450, 441, 451, 457, 458, + + 459, 466, 470, 461, 463, 472, 476, 473, 479, 481, + 484, 486, 492, 468, 489, 490, 493, 496, 494, 498, + 501, 504, 500, 505, 508, 509, 510, 514, 520, 519, + 516, 523, 524, 530, 529, 534, 535, 536, 539, 542, + 548, 546, 547, 550, 549, 551, 556, 564, 568, 557, + 560, 561, 569, 571, 575, 591, 577, 579, 581, 582, + 584, 595, 609, 596, 585, 597, 613, 598, 611, 614, + 623, 617, 622, 624, 627, 626, 629, 630, 631, 634, + 635, 642, 632, 646, 654, 651, 658, 659, 639, 586, + 665, 650, 661, 663, 668, 666, 669, 673, 676, 2793, + + 678, 680, 681, 682, 683, 2793, 684, 685, 686, 687, + 688, 698, 690, 697, 699, 702, 703, 707, 709, 710, + 730, 713, 711, 721, 714, 715, 722, 724, 739, 728, + 732, 737, 734, 741, 742, 745, 748, 750, 751, 762, + 758, 759, 760, 769, 764, 766, 771, 772, 779, 775, + 781, 784, 790, 792, 794, 800, 786, 796, 798, 804, + 805, 803, 797, 811, 810, 812, 813, 818, 814, 827, + 820, 828, 830, 833, 823, 835, 837, 839, 846, 842, + 844, 849, 845, 843, 854, 855, 859, 858, 870, 871, + 864, 872, 879, 880, 857, 881, 867, 877, 884, 886, + + 887, 888, 889, 892, 893, 899, 896, 900, 898, 905, + 907, 909, 911, 913, 914, 917, 920, 918, 919, 928, + 929, 931, 933, 932, 935, 939, 934, 941, 2793, 949, + 948, 945, 951, 953, 956, 2793, 2793, 958, 2793, 2793, + 954, 959, 960, 967, 976, 968, 966, 972, 974, 982, + 979, 989, 970, 991, 993, 998, 987, 999, 1000, 1001, + 1004, 1005, 1006, 1010, 1017, 1020, 1013, 1021, 1014, 1024, + 1025, 1026, 1028, 1030, 1033, 1039, 1036, 2793, 1037, 1038, + 1044, 1042, 1047, 2793, 1046, 1048, 1049, 1051, 1054, 1059, + 1056, 1060, 1062, 1063, 1066, 1069, 1068, 1061, 1072, 1078, + + 1089, 1087, 1077, 1085, 1088, 1090, 1094, 1103, 1099, 1092, + 1100, 1106, 1104, 1108, 1115, 1105, 1112, 1109, 1117, 1118, + 1142, 1119, 1121, 1125, 1122, 1126, 1127, 1129, 1133, 1135, + 1154, 1144, 1138, 1134, 1156, 1159, 1161, 1163, 1165, 1167, + 1168, 2793, 1175, 1171, 1173, 1176, 1178, 1179, 1181, 1182, + 1186, 1185, 1188, 1187, 1199, 2793, 1193, 1195, 1200, 1203, + 1204, 1206, 1207, 1217, 1219, 2793, 1225, 1222, 1227, 1221, + 1228, 1229, 1210, 1233, 1234, 1235, 1237, 1240, 1243, 1245, + 1244, 1247, 1249, 1251, 1252, 1255, 1256, 1258, 1257, 1266, + 1260, 1264, 1278, 1279, 1265, 1282, 1277, 1283, 1286, 1288, + + 1285, 1290, 1287, 1289, 2793, 175, 1291, 1292, 1293, 1300, + 1309, 1310, 1294, 1302, 1312, 1311, 1318, 1301, 1322, 1319, + 1323, 1324, 1325, 1330, 1327, 1334, 1331, 1328, 1336, 1341, + 1339, 1342, 1347, 1348, 1345, 1349, 1350, 2793, 1357, 1356, + 1364, 1355, 1361, 1378, 1362, 1367, 1374, 1376, 1384, 1382, + 1386, 1388, 1390, 1392, 1379, 1394, 1400, 1401, 1398, 1402, + 1404, 1405, 2793, 1407, 1408, 1409, 1410, 1414, 1417, 1415, + 1419, 1421, 1431, 1426, 1435, 2793, 1436, 1438, 1428, 1445, + 1432, 1449, 1450, 1454, 1440, 1451, 1457, 1458, 1461, 1459, + 1464, 1466, 2793, 1472, 1474, 1471, 1480, 1478, 1479, 1481, + + 1483, 1468, 1484, 1490, 1486, 1489, 1493, 1494, 1496, 1497, + 1499, 1491, 1500, 2793, 1513, 1501, 1502, 1510, 1503, 1504, + 1519, 1518, 1525, 1526, 1528, 1529, 1530, 1531, 1532, 1533, + 1541, 1534, 1539, 1542, 1547, 1558, 1559, 1555, 2793, 1561, + 1557, 1564, 1546, 1571, 1568, 1569, 1572, 1573, 1574, 1575, + 1582, 1576, 1579, 1583, 1584, 1580, 1585, 1586, 1589, 1587, + 1596, 1597, 1604, 1605, 1608, 1609, 1611, 1612, 1621, 2793, + 1617, 2793, 1618, 1619, 1627, 2793, 1629, 2793, 1631, 2793, + 1633, 1637, 1624, 1626, 1634, 1640, 1641, 1643, 1644, 1646, + 1649, 1650, 1653, 1654, 1655, 2793, 1652, 1658, 1662, 1659, + + 1665, 1666, 1667, 1675, 1681, 1668, 1677, 1683, 1678, 2793, + 1687, 1674, 1690, 1694, 1695, 1697, 1698, 1700, 1701, 1702, + 1703, 1705, 1707, 1709, 1710, 1711, 1714, 1721, 1713, 1723, + 1716, 1719, 1722, 2793, 1729, 1734, 1737, 1724, 2793, 2793, + 1748, 1732, 1745, 1738, 1742, 1752, 1753, 1755, 1761, 1758, + 1759, 1760, 1763, 1766, 1767, 1768, 1769, 1772, 1775, 2793, + 1782, 1776, 1783, 1784, 1785, 1796, 1774, 1795, 2793, 2793, + 1789, 1799, 1800, 1801, 1807, 1803, 1806, 2793, 1808, 1809, + 1810, 1811, 1817, 1814, 1821, 1825, 1827, 1829, 1830, 1833, + 1836, 1834, 1832, 1835, 1838, 1848, 2793, 1849, 1852, 1859, + + 1839, 1853, 1855, 1857, 1861, 1863, 1865, 1871, 1867, 2793, + 1873, 1869, 1879, 1876, 1878, 1882, 1885, 1884, 1886, 1888, + 1889, 1890, 1892, 1893, 1894, 1897, 2793, 1904, 1900, 1905, + 1907, 1912, 1902, 1915, 1910, 1918, 2793, 1922, 1929, 1923, + 1925, 1931, 1933, 1926, 1937, 1939, 1940, 1941, 1942, 1944, + 1946, 1947, 1950, 1951, 1952, 1960, 1962, 1969, 1970, 1967, + 1971, 1978, 1974, 1975, 1976, 1977, 1985, 1981, 1987, 1984, + 2793, 1989, 1991, 1995, 1998, 2000, 2001, 1997, 2793, 2793, + 1999, 2793, 2008, 2010, 2012, 2013, 2793, 2015, 2793, 2793, + 2016, 2023, 2017, 2024, 2027, 2032, 2793, 2019, 2033, 2035, + + 2037, 2038, 2039, 2040, 2041, 2042, 2793, 2043, 2044, 2045, + 2055, 2793, 2047, 2060, 2049, 2065, 2066, 2067, 2069, 2071, + 2057, 2078, 2076, 2793, 2079, 2080, 2083, 2084, 2088, 2085, + 2086, 2090, 2793, 2099, 2101, 2793, 2092, 2091, 2093, 2793, + 2107, 2793, 2108, 2103, 2110, 2112, 2116, 2117, 2120, 2122, + 2123, 2124, 2125, 2131, 2128, 2793, 2793, 2133, 2140, 2143, + 2134, 2132, 2145, 2147, 2148, 2150, 2151, 2793, 2154, 2152, + 2156, 2155, 2158, 2793, 2160, 2161, 2168, 2169, 2165, 2173, + 2175, 2180, 2184, 2186, 2187, 2189, 2191, 2192, 2793, 2194, + 2196, 2197, 2201, 2202, 2157, 2204, 2208, 2213, 2198, 2215, + + 2793, 2219, 2203, 2221, 2223, 2225, 2205, 2226, 2227, 2228, + 2230, 2231, 2233, 2234, 2236, 2244, 2241, 2793, 2238, 2793, + 2247, 2252, 2259, 2260, 2793, 2248, 2255, 2793, 2262, 2266, + 2273, 2264, 2274, 2276, 2278, 2270, 2280, 2279, 2281, 2287, + 2285, 2793, 2288, 2289, 2292, 2293, 2793, 2793, 2296, 2793, + 2793, 2302, 2793, 2793, 2298, 2306, 2793, 2308, 2793, 2314, + 2310, 2312, 2313, 2315, 2793, 2317, 2793, 2793, 2318, 2319, + 2322, 2324, 2326, 2331, 2333, 2327, 2334, 2337, 2338, 2341, + 2340, 2342, 2344, 2346, 2347, 2348, 2351, 2354, 2356, 2357, + 2358, 2360, 2367, 2793, 2359, 2371, 2793, 2380, 2374, 2361, + + 2369, 2381, 2382, 2384, 2386, 2393, 2389, 2390, 2391, 2793, + 2394, 2793, 2793, 2392, 2397, 2396, 2401, 2402, 2793, 2406, + 2407, 2415, 2418, 2793, 2793, 2793, 2421, 2408, 2410, 2423, + 2424, 2425, 2427, 2793, 2431, 2432, 2433, 2434, 2440, 2442, + 2448, 2451, 2453, 2793, 2454, 2445, 2793, 2455, 2447, 2456, + 2461, 2462, 2464, 2793, 2466, 2467, 2469, 2471, 2475, 2476, + 2472, 2793, 2478, 2479, 2793, 2482, 2793, 2793, 2483, 2488, + 2490, 2495, 2497, 2499, 2491, 2500, 2506, 2505, 2507, 2793, + 2793, 2502, 2793, 2793, 2510, 2512, 2513, 2515, 2517, 2518, + 2519, 2521, 2522, 2524, 2793, 2525, 2793, 2527, 2535, 2526, + + 2537, 2793, 2540, 2536, 2538, 2793, 2793, 2793, 2550, 2541, + 2543, 2793, 2551, 2553, 2554, 2557, 2559, 2560, 2561, 2564, + 2566, 2565, 2567, 2568, 2576, 2579, 2793, 2581, 2571, 2578, + 2586, 2589, 2582, 2590, 2592, 2595, 2596, 2598, 2599, 2793, + 2603, 2604, 2606, 2611, 2614, 2615, 2622, 2793, 2623, 2793, + 2626, 2627, 2793, 2793, 2628, 2630, 2633, 2793, 2634, 2793, + 2631, 2641, 2642, 2793, 2793, 2793, 2644, 2793, 2645, 2793, + 2648, 2635, 2793, 2619, 2653, 2655, 2793, 2657, 2793, 2659, + 2793, 2660, 2661, 2793, 2793, 2793, 2793, 2663, 2664, 2666, + 2607, 2793, 2668, 2671, 2669, 2674, 2793, 2793, 2701, 2708, + 2715, 2722, 2729, 94, 2736, 2743, 2750, 2757, 2764, 2771, + 2778, 2785 } ; -static yyconst flex_int16_t yy_def[1397] = +static yyconst flex_int16_t yy_def[1413] = { 0, - 1382, 1, 1383, 1383, 1384, 1384, 1385, 1385, 1386, 1386, - 1387, 1387, 1382, 1388, 1382, 1382, 1382, 1382, 1389, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1390, - 1382, 1382, 1382, 1390, 1391, 1382, 1382, 1382, 1391, 1392, - 1382, 1382, 1382, 1382, 1392, 1393, 1382, 1382, 1382, 1393, - 1394, 1382, 1395, 1382, 1394, 1394, 1388, 1388, 1382, 1396, - 1389, 1396, 1389, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1390, 1390, 1391, 1391, 1392, 1392, 1382, 1393, 1393, - 1394, 1394, 1395, 1395, 1394, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1394, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1394, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1382, 1388, 1388, - - 1388, 1388, 1388, 1382, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1394, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1394, - 1388, 1388, 1388, 1388, 1382, 1388, 1388, 1388, 1388, 1388, - 1388, 1382, 1382, 1388, 1382, 1382, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1382, 1388, 1388, 1388, 1388, 1388, 1382, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1394, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1382, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1382, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1382, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1382, 1394, - - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1382, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1382, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1382, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1382, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - - 1388, 1388, 1388, 1388, 1388, 1388, 1382, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1382, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1382, 1388, 1382, 1388, 1388, 1388, 1382, 1388, - 1382, 1388, 1382, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1382, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - - 1388, 1382, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1382, 1388, 1388, 1388, 1388, - 1382, 1382, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1382, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1382, 1382, 1388, 1388, 1388, 1388, 1388, 1388, 1382, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1382, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - - 1382, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1382, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1382, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1382, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1382, 1382, - 1388, 1382, 1388, 1388, 1388, 1388, 1382, 1388, 1382, 1382, - 1388, 1388, 1388, 1388, 1388, 1388, 1382, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1382, 1388, 1388, 1388, - - 1388, 1382, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1382, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1382, 1388, 1388, 1382, 1388, 1388, 1388, 1382, - 1388, 1382, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1382, 1382, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1382, 1388, 1388, 1388, - 1388, 1388, 1382, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1382, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1382, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - - 1388, 1388, 1388, 1388, 1388, 1382, 1388, 1382, 1388, 1388, - 1388, 1388, 1382, 1388, 1388, 1382, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1382, - 1388, 1388, 1388, 1388, 1382, 1382, 1388, 1382, 1382, 1388, - 1382, 1382, 1388, 1388, 1382, 1388, 1382, 1388, 1388, 1388, - 1388, 1388, 1382, 1388, 1382, 1382, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1382, 1388, 1388, 1382, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1382, 1388, 1382, 1382, - - 1388, 1388, 1388, 1388, 1388, 1382, 1388, 1388, 1388, 1388, - 1382, 1382, 1382, 1388, 1388, 1388, 1388, 1388, 1388, 1382, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1382, - 1388, 1388, 1382, 1388, 1388, 1388, 1388, 1388, 1388, 1382, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1382, 1388, 1388, - 1382, 1388, 1382, 1382, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1388, 1382, 1382, 1388, 1382, 1382, 1388, - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1382, - 1388, 1382, 1388, 1388, 1388, 1388, 1382, 1388, 1388, 1388, - 1382, 1382, 1388, 1388, 1388, 1382, 1388, 1388, 1388, 1388, - - 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1382, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1388, 1388, 1382, 1388, 1388, 1388, 1388, 1388, 1388, - 1388, 1382, 1388, 1382, 1388, 1388, 1382, 1382, 1388, 1388, - 1388, 1382, 1388, 1382, 1388, 1388, 1388, 1382, 1382, 1382, - 1388, 1382, 1388, 1382, 1388, 1388, 1382, 1388, 1388, 1388, - 1382, 1388, 1382, 1388, 1382, 1388, 1388, 1382, 1382, 1382, - 1382, 1388, 1388, 1388, 1388, 1382, 1388, 1388, 1388, 1388, - 1382, 0, 1382, 1382, 1382, 1382, 1382, 1382, 1382, 1382, - 1382, 1382, 1382, 1382, 1382, 1382 + 1398, 1, 1399, 1399, 1400, 1400, 1401, 1401, 1402, 1402, + 1403, 1403, 1398, 1404, 1398, 1398, 1398, 1398, 1405, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1406, + 1398, 1398, 1398, 1406, 1407, 1398, 1398, 1398, 1407, 1408, + 1398, 1398, 1398, 1398, 1408, 1409, 1398, 1398, 1398, 1409, + 1410, 1398, 1411, 1398, 1410, 1410, 1404, 1404, 1398, 1412, + 1405, 1412, 1405, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1406, 1406, 1407, 1407, 1408, 1408, 1398, 1409, 1409, + 1410, 1410, 1411, 1411, 1410, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1410, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1410, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1398, + + 1404, 1404, 1404, 1404, 1404, 1398, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1410, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1410, 1404, 1404, 1404, 1404, 1398, 1404, + 1404, 1404, 1404, 1404, 1404, 1398, 1398, 1404, 1398, 1398, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1398, 1404, 1404, + 1404, 1404, 1404, 1398, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1410, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1398, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1398, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1398, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + + 1404, 1404, 1404, 1404, 1398, 1410, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1398, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1398, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1398, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1398, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1398, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1398, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, + 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, 1404, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 12:33:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E2786BD9; Fri, 18 Jul 2014 12:33:22 +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 CFA342E76; Fri, 18 Jul 2014 12:33:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6ICXMgb042849; Fri, 18 Jul 2014 12:33:22 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6ICXMY9042848; Fri, 18 Jul 2014 12:33:22 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201407181233.s6ICXMY9042848@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Fri, 18 Jul 2014 12:33:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268840 - head/usr.sbin/unbound/local-setup X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 12:33:23 -0000 Author: des Date: Fri Jul 18 12:33:22 2014 New Revision: 268840 URL: http://svnweb.freebsd.org/changeset/base/268840 Log: Use a combination of unblock-lan-zones (r268839) and domain-insecure to fix reverse lookups on networks using private addresses. Modified: head/usr.sbin/unbound/local-setup/local-unbound-setup.sh Modified: head/usr.sbin/unbound/local-setup/local-unbound-setup.sh ============================================================================== --- head/usr.sbin/unbound/local-setup/local-unbound-setup.sh Fri Jul 18 11:32:44 2014 (r268839) +++ head/usr.sbin/unbound/local-setup/local-unbound-setup.sh Fri Jul 18 12:33:22 2014 (r268840) @@ -33,6 +33,7 @@ user="" unbound_conf="" forward_conf="" +lanzones_conf="" workdir="" confdir="" chrootdir="" @@ -59,6 +60,7 @@ set_defaults() { : ${confdir:=${workdir}/conf.d} : ${unbound_conf:=${workdir}/unbound.conf} : ${forward_conf:=${workdir}/forward.conf} + : ${lanzones_conf:=${workdir}/lan-zones.conf} : ${anchor:=${workdir}/root.key} : ${pidfile:=/var/run/local_unbound.pid} : ${resolv_conf:=/etc/resolv.conf} @@ -73,7 +75,8 @@ set_defaults() { # set_chrootdir() { chrootdir="${workdir}" - for file in "${unbound_conf}" "${forward_conf}" "${anchor}" ; do + for file in "${unbound_conf}" "${forward_conf}" \ + "${lanzones_conf}" "${anchor}" ; do if [ "${file#${workdir%/}/}" = "${file}" ] ; then echo "warning: ${file} is outside ${workdir}" >&2 chrootdir="" @@ -171,6 +174,7 @@ gen_resolvconf_conf() { # gen_forward_conf() { echo "# Generated by $self" + echo "# Do not edit this file." echo "forward-zone:" echo " name: ." for forwarder ; do @@ -183,6 +187,42 @@ gen_forward_conf() { } # +# Generate lan-zones.conf +# +gen_lanzones_conf() { + echo "# Generated by $self" + echo "# Do not edit this file." + echo "server:" + echo " # Unblock reverse lookups for LAN addresses" + echo " unblock-lan-zones: yes" + echo " domain-insecure: 10.in-addr.arpa." + echo " domain-insecure: 127.in-addr.arpa." + echo " domain-insecure: 16.172.in-addr.arpa." + echo " domain-insecure: 17.172.in-addr.arpa." + echo " domain-insecure: 18.172.in-addr.arpa." + echo " domain-insecure: 19.172.in-addr.arpa." + echo " domain-insecure: 20.172.in-addr.arpa." + echo " domain-insecure: 21.172.in-addr.arpa." + echo " domain-insecure: 22.172.in-addr.arpa." + echo " domain-insecure: 23.172.in-addr.arpa." + echo " domain-insecure: 24.172.in-addr.arpa." + echo " domain-insecure: 25.172.in-addr.arpa." + echo " domain-insecure: 26.172.in-addr.arpa." + echo " domain-insecure: 27.172.in-addr.arpa." + echo " domain-insecure: 28.172.in-addr.arpa." + echo " domain-insecure: 29.172.in-addr.arpa." + echo " domain-insecure: 30.172.in-addr.arpa." + echo " domain-insecure: 31.172.in-addr.arpa." + echo " domain-insecure: 168.192.in-addr.arpa." + echo " domain-insecure: 254.169.in-addr.arpa." + echo " domain-insecure: d.f.ip6.arpa." + echo " domain-insecure: 8.e.ip6.arpa." + echo " domain-insecure: 9.e.ip6.arpa." + echo " domain-insecure: a.e.ip6.arpa." + echo " domain-insecure: b.e.ip6.arpa." +} + +# # Generate unbound.conf # gen_unbound_conf() { @@ -197,6 +237,9 @@ gen_unbound_conf() { if [ -f "${forward_conf}" ] ; then echo "include: ${forward_conf}" fi + if [ -f "${lanzones_conf}" ] ; then + echo "include: ${lanzones_conf}" + fi if [ -d "${confdir}" ] ; then echo "include: ${confdir}/*.conf" fi @@ -323,6 +366,13 @@ main() { fi # + # Generate lan-zones.conf. + # + local tmp_lanzones_conf=$(mktemp -u "${lanzones_conf}.XXXXX") + gen_lanzones_conf >"${tmp_lanzones_conf}" + replace "${lanzones_conf}" "${tmp_lanzones_conf}" + + # # Generate unbound.conf. # local tmp_unbound_conf=$(mktemp -u "${unbound_conf}.XXXXX") From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 12:51:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 36358FC8; Fri, 18 Jul 2014 12:51: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 23CA22F89; Fri, 18 Jul 2014 12:51:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6ICpal4052198; Fri, 18 Jul 2014 12:51:36 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6ICpaca052197; Fri, 18 Jul 2014 12:51:36 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201407181251.s6ICpaca052197@svn.freebsd.org> From: Gavin Atkinson Date: Fri, 18 Jul 2014 12:51:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268842 - head/usr.bin/iscsictl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 12:51:36 -0000 Author: gavin Date: Fri Jul 18 12:51:35 2014 New Revision: 268842 URL: http://svnweb.freebsd.org/changeset/base/268842 Log: Fix two typos in iscsictl.8 PR: 191581 Submitted by: Jimmy Olgeni MFC after: 3 days Modified: head/usr.bin/iscsictl/iscsictl.8 Modified: head/usr.bin/iscsictl/iscsictl.8 ============================================================================== --- head/usr.bin/iscsictl/iscsictl.8 Fri Jul 18 12:36:18 2014 (r268841) +++ head/usr.bin/iscsictl/iscsictl.8 Fri Jul 18 12:51:35 2014 (r268842) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 18, 2014 +.Dd July 18, 2014 .Dt ISCSICTL 8 .Os .Sh NAME @@ -96,7 +96,7 @@ The default is Target host name or address used for SendTargets discovery. When used, it will add a temporary discovery session. After discovery is done, sessions will be added for each discovered target, -and the temporary discovery sesion will be removed. +and the temporary discovery session will be removed. .It Fl i Session ID, as displayed by .Nm @@ -115,7 +115,7 @@ CHAP login. Verbose mode. .El .Pp -Certain parameters are neccessary when adding a session. +Certain parameters are necessary when adding a session. One can specify these either via command line (using the .Fl t , .Fl p , From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 14:05:45 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A5C26B31; Fri, 18 Jul 2014 14:05:45 +0000 (UTC) Received: from mail.xcllnt.net (mail.xcllnt.net [50.0.150.214]) (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 68BD22821; Fri, 18 Jul 2014 14:05:45 +0000 (UTC) Received: from [172.29.5.30] ([66.129.239.11]) (authenticated bits=0) by mail.xcllnt.net (8.14.9/8.14.9) with ESMTP id s6IE5LrL012403 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 18 Jul 2014 07:05:43 -0700 (PDT) (envelope-from marcel@xcllnt.net) Content-Type: multipart/signed; boundary="Apple-Mail=_C4670624-991B-4755-850E-A4C5E3A07560"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r268833 - head/sys/dev/bge From: Marcel Moolenaar In-Reply-To: <201407180741.s6I7fcJn003675@svn.freebsd.org> Date: Fri, 18 Jul 2014 07:05:42 -0700 Message-Id: <27D974F4-7F3B-49AF-BD9B-8D0ED3769451@xcllnt.net> References: <201407180741.s6I7fcJn003675@svn.freebsd.org> To: Peter Wemm X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 14:05:45 -0000 --Apple-Mail=_C4670624-991B-4755-850E-A4C5E3A07560 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On Jul 18, 2014, at 12:41 AM, Peter Wemm wrote: > Author: peter > Date: Fri Jul 18 07:41:38 2014 > New Revision: 268833 > URL: http://svnweb.freebsd.org/changeset/base/268833 > > Log: > Fix an apparent conversion error in bge to the new driver api. > if_multiaddr_array() does the LLADDR work, don't do it twice. Thanks! -- Marcel Moolenaar marcel@xcllnt.net --Apple-Mail=_C4670624-991B-4755-850E-A4C5E3A07560 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iEYEARECAAYFAlPJKbYACgkQpgWlLWHuifZo8gCfV49NVGaGw3dVPExqYvrb9+Uh eLoAnA6Ze7aGN9QC6FPV+hpw52bIIcLP =9Z0t -----END PGP SIGNATURE----- --Apple-Mail=_C4670624-991B-4755-850E-A4C5E3A07560-- From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 14:27:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ADF563EE; Fri, 18 Jul 2014 14:27:05 +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 8EB4B2A1D; Fri, 18 Jul 2014 14:27:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6IER5uG096793; Fri, 18 Jul 2014 14:27:05 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6IER4dE096790; Fri, 18 Jul 2014 14:27:04 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201407181427.s6IER4dE096790@svn.freebsd.org> From: Baptiste Daroussin Date: Fri, 18 Jul 2014 14:27:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268843 - in head: lib/libc/sys sys/kern sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 14:27:05 -0000 Author: bapt Date: Fri Jul 18 14:27:04 2014 New Revision: 268843 URL: http://svnweb.freebsd.org/changeset/base/268843 Log: Extend kqueue's EVFILT_TIMER by adding precision unit flags support Define the precision macros as bits sets to conform with XNU equivalent. Test fflags passed for EVFILT_TIMER and return EINVAL in case an invalid flag is passed. Phabric: https://phabric.freebsd.org/D421 Reviewed by: kib Modified: head/lib/libc/sys/kqueue.2 head/sys/kern/kern_event.c head/sys/sys/event.h Modified: head/lib/libc/sys/kqueue.2 ============================================================================== --- head/lib/libc/sys/kqueue.2 Fri Jul 18 12:51:35 2014 (r268842) +++ head/lib/libc/sys/kqueue.2 Fri Jul 18 14:27:04 2014 (r268843) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 7, 2014 +.Dd July 18, 2014 .Dt KQUEUE 2 .Os .Sh NAME @@ -454,7 +454,7 @@ Establishes an arbitrary timer identifie .Va ident . When adding a timer, .Va data -specifies the timeout period in milliseconds. +specifies the timeout period. The timer will be periodic unless EV_ONESHOT is specified. On return, .Va data @@ -465,8 +465,25 @@ There is a system wide limit on the numb which is controlled by the .Va kern.kq_calloutmax sysctl. +.Bl -tag -width XXNOTE_USECONDS +.It Dv NOTE_SECONDS +.Va data +is in seconds. +.It Dv NOTE_MSECONDS +.Va data +is in milliseconds. +.It Dv NOTE_USECONDS +.Va data +is in microseconds. +.It Dv NOTE_NSECONDS +.Va data +is in nanoseconds. +.It +.El .Pp -On return, +If +.Va fflags +is not set, the default is milliseconds. On return, .Va fflags contains the events which triggered the filter. .It Dv EVFILT_USER Modified: head/sys/kern/kern_event.c ============================================================================== --- head/sys/kern/kern_event.c Fri Jul 18 12:51:35 2014 (r268842) +++ head/sys/kern/kern_event.c Fri Jul 18 14:27:04 2014 (r268843) @@ -523,15 +523,38 @@ knote_fork(struct knlist *list, int pid) * XXX: EVFILT_TIMER should perhaps live in kern_time.c beside the * interval timer support code. */ + +#define NOTE_TIMER_PRECMASK (NOTE_SECONDS|NOTE_MSECONDS|NOTE_USECONDS| \ + NOTE_NSECONDS) + static __inline sbintime_t -timer2sbintime(intptr_t data) +timer2sbintime(intptr_t data, int flags) { + sbintime_t modifier; + + switch (flags & NOTE_TIMER_PRECMASK) { + case NOTE_SECONDS: + modifier = SBT_1S; + break; + case NOTE_MSECONDS: /* FALLTHROUGH */ + case 0: + modifier = SBT_1MS; + break; + case NOTE_USECONDS: + modifier = SBT_1US; + break; + case NOTE_NSECONDS: + modifier = SBT_1NS; + break; + default: + return (-1); + } #ifdef __LP64__ - if (data > SBT_MAX / SBT_1MS) + if (data > SBT_MAX / modifier) return (SBT_MAX); #endif - return (SBT_1MS * data); + return (modifier * data); } static void @@ -547,13 +570,13 @@ filt_timerexpire(void *knx) if ((kn->kn_flags & EV_ONESHOT) != EV_ONESHOT) { calloutp = (struct callout *)kn->kn_hook; callout_reset_sbt_on(calloutp, - timer2sbintime(kn->kn_sdata), 0 /* 1ms? */, + timer2sbintime(kn->kn_sdata, kn->kn_sfflags), 0, filt_timerexpire, kn, PCPU_GET(cpuid), 0); } } /* - * data contains amount of time to sleep, in milliseconds + * data contains amount of time to sleep */ static int filt_timerattach(struct knote *kn) @@ -566,7 +589,11 @@ filt_timerattach(struct knote *kn) return (EINVAL); if ((intptr_t)kn->kn_sdata == 0 && (kn->kn_flags & EV_ONESHOT) == 0) kn->kn_sdata = 1; - to = timer2sbintime(kn->kn_sdata); + /* Only precision unit are supported in flags so far */ + if (kn->kn_sfflags & ~NOTE_TIMER_PRECMASK) + return (EINVAL); + + to = timer2sbintime(kn->kn_sdata, kn->kn_sfflags); if (to < 0) return (EINVAL); @@ -583,7 +610,7 @@ filt_timerattach(struct knote *kn) calloutp = malloc(sizeof(*calloutp), M_KQUEUE, M_WAITOK); callout_init(calloutp, CALLOUT_MPSAFE); kn->kn_hook = calloutp; - callout_reset_sbt_on(calloutp, to, 0 /* 1ms? */, + callout_reset_sbt_on(calloutp, to, 0, filt_timerexpire, kn, PCPU_GET(cpuid), 0); return (0); Modified: head/sys/sys/event.h ============================================================================== --- head/sys/sys/event.h Fri Jul 18 12:51:35 2014 (r268842) +++ head/sys/sys/event.h Fri Jul 18 14:27:04 2014 (r268843) @@ -133,6 +133,12 @@ struct kevent { #define NOTE_TRACKERR 0x00000002 /* could not track child */ #define NOTE_CHILD 0x00000004 /* am a child process */ +/* additional flags for EVFILE_TIMER */ +#define NOTE_SECONDS 0x00000001 /* data is seconds */ +#define NOTE_MSECONDS 0x00000002 /* data is milliseconds */ +#define NOTE_USECONDS 0x00000004 /* data is microseconds */ +#define NOTE_NSECONDS 0x00000008 /* data is nanoseconds */ + struct knote; SLIST_HEAD(klist, knote); struct kqueue; From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 14:35:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 00A42A87; Fri, 18 Jul 2014 14:35:34 +0000 (UTC) Received: from mail-oa0-x22f.google.com (mail-oa0-x22f.google.com [IPv6:2607:f8b0:4003:c02::22f]) (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 99E4C2AF7; Fri, 18 Jul 2014 14:35:34 +0000 (UTC) Received: by mail-oa0-f47.google.com with SMTP id g18so3334290oah.6 for ; Fri, 18 Jul 2014 07:35:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=GzKUBMogl0J24kqIME4NARpy61gFRaffNMo9srHjQNQ=; b=U+OAG8Kv4mjMrw2XSB7ZnbpRmlmTHXbKGbbxfIfeEhZjRb3Lo3wkDZ/mCvNqpChb9K 08nGZkWDJMLlbJZQ4jPAmXzicxyoIwVYftJRhoaUYAf+CxwIGPST1NIzZ+CKxYePkWFd bPV22hkK242tJGoilOGcvY39SULzUn2PZnsT/wFEP3ZX78ukrJvrwEZyfDTmXlZ6LABE 0zlr2UAncZylFJuez6CTduQU8PaNsbaEDFdRDonOfve6Lsx2hWqTkh8p3Vbqa60s/vCS 3JMpKWLADXT9lzbVtsakt+9jjKDGWcDSLBM0GdKpVycMA6SlSFuuqRDcgucdb1orGqAz AGwA== MIME-Version: 1.0 X-Received: by 10.182.87.9 with SMTP id t9mr7588333obz.72.1405694133926; Fri, 18 Jul 2014 07:35:33 -0700 (PDT) Received: by 10.182.142.34 with HTTP; Fri, 18 Jul 2014 07:35:33 -0700 (PDT) In-Reply-To: <201407180648.s6I6m2U7075749@svn.freebsd.org> References: <201407180648.s6I6m2U7075749@svn.freebsd.org> Date: Fri, 18 Jul 2014 10:35:33 -0400 Message-ID: Subject: Re: svn commit: r268827 - head/usr.sbin/ndp From: Benjamin Kaduk To: Peter Wemm Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 14:35:35 -0000 On Fri, Jul 18, 2014 at 2:48 AM, Peter Wemm wrote: > Author: peter > Date: Fri Jul 18 06:48:02 2014 > New Revision: 268827 > URL: http://svnweb.freebsd.org/changeset/base/268827 > > Log: > Fix "ndp -d hostname". > > MFC? -Ben From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 14:59:36 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 82C557C3; Fri, 18 Jul 2014 14:59: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 703F92CF5; Fri, 18 Jul 2014 14:59:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6IExaxq011446; Fri, 18 Jul 2014 14:59:36 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6IExaig011445; Fri, 18 Jul 2014 14:59:36 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201407181459.s6IExaig011445@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 18 Jul 2014 14:59:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268844 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 14:59:36 -0000 Author: glebius Date: Fri Jul 18 14:59:35 2014 New Revision: 268844 URL: http://svnweb.freebsd.org/changeset/base/268844 Log: Use assignment instead of bcopy. Submitted by: jmg Modified: head/sys/kern/uipc_mbuf.c Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Fri Jul 18 14:27:04 2014 (r268843) +++ head/sys/kern/uipc_mbuf.c Fri Jul 18 14:59:35 2014 (r268844) @@ -377,7 +377,7 @@ mb_dupcl(struct mbuf *n, struct mbuf *m) atomic_add_int(m->m_ext.ext_cnt, 1); } - bcopy(&m->m_ext, &n->m_ext, sizeof(m->m_ext)); + n->m_ext = m->m_ext; n->m_flags |= M_EXT; n->m_flags |= m->m_flags & M_RDONLY; } From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 15:39:08 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8FB25613; Fri, 18 Jul 2014 15:39: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 7D00E20DD; Fri, 18 Jul 2014 15:39:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6IFd8uK030628; Fri, 18 Jul 2014 15:39:08 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6IFd8Da030624; Fri, 18 Jul 2014 15:39:08 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201407181539.s6IFd8Da030624@svn.freebsd.org> From: Alan Cox Date: Fri, 18 Jul 2014 15:39:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268845 - in head: . share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 15:39:08 -0000 Author: alc Date: Fri Jul 18 15:39:07 2014 New Revision: 268845 URL: http://svnweb.freebsd.org/changeset/base/268845 Log: Remove obsolete man pages. The corresponding code was removed in r255608. Deleted: head/share/man/man9/zero_copy.9 Modified: head/ObsoleteFiles.inc head/share/man/man9/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Jul 18 14:59:35 2014 (r268844) +++ head/ObsoleteFiles.inc Fri Jul 18 15:39:07 2014 (r268845) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20140718: Remove obsolete man pages +OLD_FILES+=usr/share/man/man9/zero_copy.9.gz +OLD_FILES+=usr/share/man/man9/zero_copy_sockets.9.gz # 20140718: Remove an obsolete man page OLD_FILES+=usr/share/man/man9/pmap_page_protect.9.gz # 20140717: Remove an obsolete man page Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Fri Jul 18 14:59:35 2014 (r268844) +++ head/share/man/man9/Makefile Fri Jul 18 15:39:07 2014 (r268845) @@ -384,7 +384,6 @@ MAN= accept_filter.9 \ vrele.9 \ vslock.9 \ watchdog.9 \ - zero_copy.9 \ zone.9 MLINKS= unr.9 alloc_unr.9 \ @@ -1574,7 +1573,6 @@ MLINKS+=vref.9 VREF.9 MLINKS+=vrele.9 vput.9 \ vrele.9 vunref.9 MLINKS+=vslock.9 vsunlock.9 -MLINKS+=zero_copy.9 zero_copy_sockets.9 MLINKS+=zone.9 uma.9 \ zone.9 uma_zalloc.9 \ zone.9 uma_zalloc_arg.9 \ From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 16:21:15 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DF4615D8; Fri, 18 Jul 2014 16:21: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 CC61624D4; Fri, 18 Jul 2014 16:21:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6IGLF9p053821; Fri, 18 Jul 2014 16:21:15 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6IGLFkD053820; Fri, 18 Jul 2014 16:21:15 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407181621.s6IGLFkD053820@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Fri, 18 Jul 2014 16:21:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268846 - head/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 16:21:16 -0000 Author: pfg Date: Fri Jul 18 16:21:15 2014 New Revision: 268846 URL: http://svnweb.freebsd.org/changeset/base/268846 Log: Revert r268826: The current ordering of this header is a feature as it is more consistent with POSIX. Also adding gratuitous newlines is not elegant. Pointed out by: bde Modified: head/include/search.h Modified: head/include/search.h ============================================================================== --- head/include/search.h Fri Jul 18 15:39:07 2014 (r268845) +++ head/include/search.h Fri Jul 18 16:21:15 2014 (r268846) @@ -1,8 +1,8 @@ /*- - * Written by J.T. Conklin + * Written by J.T. Conklin * Public domain. * - * $NetBSD: search.h,v 1.18 2005/07/06 15:47:15 drochner Exp $ + * $NetBSD: search.h,v 1.12 1999/02/22 10:34:28 christos Exp $ * $FreeBSD$ */ @@ -49,14 +49,12 @@ __BEGIN_DECLS int hcreate(size_t); void hdestroy(void); ENTRY *hsearch(ENTRY, ACTION); - +void insque(void *, void *); void *lfind(const void *, const void *, size_t *, size_t, int (*)(const void *, const void *)); void *lsearch(const void *, void *, size_t *, size_t, int (*)(const void *, const void *)); -void insque(void *, void *); void remque(void *); - void *tdelete(const void * __restrict, void ** __restrict, int (*)(const void *, const void *)); void *tfind(const void *, void * const *, From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 16:25:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9174E76A; Fri, 18 Jul 2014 16:25: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 7E93F257A; Fri, 18 Jul 2014 16:25:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6IGPZTx054560; Fri, 18 Jul 2014 16:25:35 GMT (envelope-from hiren@svn.freebsd.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6IGPZB2054559; Fri, 18 Jul 2014 16:25:35 GMT (envelope-from hiren@svn.freebsd.org) Message-Id: <201407181625.s6IGPZB2054559@svn.freebsd.org> From: Hiren Panchasara Date: Fri, 18 Jul 2014 16:25:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268847 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 16:25:35 -0000 Author: hiren Date: Fri Jul 18 16:25:35 2014 New Revision: 268847 URL: http://svnweb.freebsd.org/changeset/base/268847 Log: The description is a bit misleading. Trying to make it more obvious. Phabric: https://phabric.freebsd.org/D435 Reviewed by: gnn Modified: head/sys/dev/e1000/if_igb.c Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Fri Jul 18 16:21:15 2014 (r268846) +++ head/sys/dev/e1000/if_igb.c Fri Jul 18 16:25:35 2014 (r268847) @@ -5853,7 +5853,7 @@ igb_add_hw_stats(struct adapter *adapter "Transmit Descriptor Tail"); SYSCTL_ADD_QUAD(ctx, queue_list, OID_AUTO, "no_desc_avail", CTLFLAG_RD, &txr->no_desc_avail, - "Queue No Descriptor Available"); + "Queue Descriptors Unavailable"); SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "tx_packets", CTLFLAG_RD, &txr->total_packets, "Queue Packets Transmitted"); From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 17:55:14 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0D23900; Fri, 18 Jul 2014 17:55: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 91A602D2D; Fri, 18 Jul 2014 17:55:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6IHtEep096703; Fri, 18 Jul 2014 17:55:14 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6IHtDvN096689; Fri, 18 Jul 2014 17:55:13 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407181755.s6IHtDvN096689@svn.freebsd.org> From: Xin LI Date: Fri, 18 Jul 2014 17:55:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r268848 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/ztest X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 17:55:14 -0000 Author: delphij Date: Fri Jul 18 17:55:12 2014 New Revision: 268848 URL: http://svnweb.freebsd.org/changeset/base/268848 Log: 4958 zdb trips assert on pools with ashift >= 0xe Reviewed by: Matthew Ahrens Reviewed by: Max Grossman Reviewed by: George Wilson Reviewed by: Christopher Siden Approved by: Garrett D'Amore illumos/illumos-gate@2a104a5236475eb73aa41eaaf3ed9f3ccbe0ca55 Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_debug.c vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Changes in other areas also in this revision: Modified: vendor/illumos/dist/cmd/ztest/ztest.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c Fri Jul 18 16:25:35 2014 (r268847) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c Fri Jul 18 17:55:12 2014 (r268848) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. */ Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c Fri Jul 18 16:25:35 2014 (r268847) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c Fri Jul 18 17:55:12 2014 (r268848) @@ -62,6 +62,21 @@ uint64_t metaslab_gang_bang = SPA_MAXBLO int zfs_condense_pct = 200; /* + * Condensing a metaslab is not guaranteed to actually reduce the amount of + * space used on disk. In particular, a space map uses data in increments of + * MAX(1 << ashift, SPACE_MAP_INITIAL_BLOCKSIZE), so a metaslab might use the + * same number of blocks after condensing. Since the goal of condensing is to + * reduce the number of IOPs required to read the space map, we only want to + * condense when we can be sure we will reduce the number of blocks used by the + * space map. Unfortunately, we cannot precisely compute whether or not this is + * the case in metaslab_should_condense since we are holding ms_lock. Instead, + * we apply the following heuristic: do not condense a spacemap unless the + * uncondensed size consumes greater than zfs_metaslab_condense_block_threshold + * blocks. + */ +int zfs_metaslab_condense_block_threshold = 4; + +/* * The zfs_mg_noalloc_threshold defines which metaslab groups should * be eligible for allocation. The value is defined as a percentage of * a free space. Metaslab groups that have more free space than @@ -1279,6 +1294,8 @@ metaslab_group_preload(metaslab_group_t * times the size than the free space range tree representation * (i.e. zfs_condense_pct = 110 and in-core = 1MB, minimal = 1.1.MB). * + * 3. The on-disk size of the space map should actually decrease. + * * Checking the first condition is tricky since we don't want to walk * the entire AVL tree calculating the estimated on-disk size. Instead we * use the size-ordered range tree in the metaslab and calculate the @@ -1289,13 +1306,21 @@ metaslab_group_preload(metaslab_group_t * To determine the second criterion we use a best-case estimate and assume * each segment can be represented on-disk as a single 64-bit entry. We refer * to this best-case estimate as the space map's minimal form. + * + * Unfortunately, we cannot compute the on-disk size of the space map in this + * context because we cannot accurately compute the effects of compression, etc. + * Instead, we apply the heuristic described in the block comment for + * zfs_metaslab_condense_block_threshold - we only condense if the space used + * is greater than a threshold number of blocks. */ static boolean_t metaslab_should_condense(metaslab_t *msp) { space_map_t *sm = msp->ms_sm; range_seg_t *rs; - uint64_t size, entries, segsz; + uint64_t size, entries, segsz, object_size, optimal_size, record_size; + dmu_object_info_t doi; + uint64_t vdev_blocksize = 1 << msp->ms_group->mg_vd->vdev_ashift; ASSERT(MUTEX_HELD(&msp->ms_lock)); ASSERT(msp->ms_loaded); @@ -1319,9 +1344,15 @@ metaslab_should_condense(metaslab_t *msp entries = size / (MIN(size, SM_RUN_MAX)); segsz = entries * sizeof (uint64_t); - return (segsz <= space_map_length(msp->ms_sm) && - space_map_length(msp->ms_sm) >= (zfs_condense_pct * - sizeof (uint64_t) * avl_numnodes(&msp->ms_tree->rt_root)) / 100); + optimal_size = sizeof (uint64_t) * avl_numnodes(&msp->ms_tree->rt_root); + object_size = space_map_length(msp->ms_sm); + + dmu_object_info_from_db(sm->sm_dbuf, &doi); + record_size = MAX(doi.doi_data_block_size, vdev_blocksize); + + return (segsz <= object_size && + object_size >= (optimal_size * zfs_condense_pct / 100) && + object_size > zfs_metaslab_condense_block_threshold * record_size); } /* Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c Fri Jul 18 16:25:35 2014 (r268847) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c Fri Jul 18 17:55:12 2014 (r268848) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. */ Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_impl.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_impl.h Fri Jul 18 16:25:35 2014 (r268847) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_impl.h Fri Jul 18 17:55:12 2014 (r268848) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ #ifndef _SYS_VDEV_IMPL_H @@ -229,8 +229,11 @@ struct vdev { #define VDEV_PHYS_SIZE (112 << 10) #define VDEV_UBERBLOCK_RING (128 << 10) +/* The largest uberblock we support is 8k. */ +#define MAX_UBERBLOCK_SHIFT (13) #define VDEV_UBERBLOCK_SHIFT(vd) \ - MAX((vd)->vdev_top->vdev_ashift, UBERBLOCK_SHIFT) + MIN(MAX((vd)->vdev_top->vdev_ashift, UBERBLOCK_SHIFT), \ + MAX_UBERBLOCK_SHIFT) #define VDEV_UBERBLOCK_COUNT(vd) \ (VDEV_UBERBLOCK_RING >> VDEV_UBERBLOCK_SHIFT(vd)) #define VDEV_UBERBLOCK_OFFSET(vd, n) \ Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h Fri Jul 18 16:25:35 2014 (r268847) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h Fri Jul 18 17:55:12 2014 (r268848) @@ -165,19 +165,20 @@ enum zio_flag { ZIO_FLAG_RESILVER = 1 << 3, ZIO_FLAG_SCRUB = 1 << 4, ZIO_FLAG_SCAN_THREAD = 1 << 5, + ZIO_FLAG_PHYSICAL = 1 << 6, #define ZIO_FLAG_AGG_INHERIT (ZIO_FLAG_CANFAIL - 1) /* * Flags inherited by ddt, gang, and vdev children. */ - ZIO_FLAG_CANFAIL = 1 << 6, /* must be first for INHERIT */ - ZIO_FLAG_SPECULATIVE = 1 << 7, - ZIO_FLAG_CONFIG_WRITER = 1 << 8, - ZIO_FLAG_DONT_RETRY = 1 << 9, - ZIO_FLAG_DONT_CACHE = 1 << 10, - ZIO_FLAG_NODATA = 1 << 11, - ZIO_FLAG_INDUCE_DAMAGE = 1 << 12, + ZIO_FLAG_CANFAIL = 1 << 7, /* must be first for INHERIT */ + ZIO_FLAG_SPECULATIVE = 1 << 8, + ZIO_FLAG_CONFIG_WRITER = 1 << 9, + ZIO_FLAG_DONT_RETRY = 1 << 10, + ZIO_FLAG_DONT_CACHE = 1 << 11, + ZIO_FLAG_NODATA = 1 << 12, + ZIO_FLAG_INDUCE_DAMAGE = 1 << 13, #define ZIO_FLAG_DDT_INHERIT (ZIO_FLAG_IO_RETRY - 1) #define ZIO_FLAG_GANG_INHERIT (ZIO_FLAG_IO_RETRY - 1) @@ -185,27 +186,27 @@ enum zio_flag { /* * Flags inherited by vdev children. */ - ZIO_FLAG_IO_RETRY = 1 << 13, /* must be first for INHERIT */ - ZIO_FLAG_PROBE = 1 << 14, - ZIO_FLAG_TRYHARD = 1 << 15, - ZIO_FLAG_OPTIONAL = 1 << 16, + ZIO_FLAG_IO_RETRY = 1 << 14, /* must be first for INHERIT */ + ZIO_FLAG_PROBE = 1 << 15, + ZIO_FLAG_TRYHARD = 1 << 16, + ZIO_FLAG_OPTIONAL = 1 << 17, #define ZIO_FLAG_VDEV_INHERIT (ZIO_FLAG_DONT_QUEUE - 1) /* * Flags not inherited by any children. */ - ZIO_FLAG_DONT_QUEUE = 1 << 17, /* must be first for INHERIT */ - ZIO_FLAG_DONT_PROPAGATE = 1 << 18, - ZIO_FLAG_IO_BYPASS = 1 << 19, - ZIO_FLAG_IO_REWRITE = 1 << 20, - ZIO_FLAG_RAW = 1 << 21, - ZIO_FLAG_GANG_CHILD = 1 << 22, - ZIO_FLAG_DDT_CHILD = 1 << 23, - ZIO_FLAG_GODFATHER = 1 << 24, - ZIO_FLAG_NOPWRITE = 1 << 25, - ZIO_FLAG_REEXECUTED = 1 << 26, - ZIO_FLAG_DELEGATED = 1 << 27, + ZIO_FLAG_DONT_QUEUE = 1 << 18, /* must be first for INHERIT */ + ZIO_FLAG_DONT_PROPAGATE = 1 << 19, + ZIO_FLAG_IO_BYPASS = 1 << 20, + ZIO_FLAG_IO_REWRITE = 1 << 21, + ZIO_FLAG_RAW = 1 << 22, + ZIO_FLAG_GANG_CHILD = 1 << 23, + ZIO_FLAG_DDT_CHILD = 1 << 24, + ZIO_FLAG_GODFATHER = 1 << 25, + ZIO_FLAG_NOPWRITE = 1 << 26, + ZIO_FLAG_REEXECUTED = 1 << 27, + ZIO_FLAG_DELEGATED = 1 << 28, }; #define ZIO_FLAG_MUSTSUCCEED 0 Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_debug.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_debug.c Fri Jul 18 16:25:35 2014 (r268847) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_debug.c Fri Jul 18 17:55:12 2014 (r268848) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ #include @@ -57,7 +57,10 @@ zfs_dbgmsg_fini(void) * echo ::zfs_dbgmsg | mdb -k * * Monitor these messages by running: - * dtrace -q -n 'zfs-dbgmsg{printf("%s\n", stringof(arg0))}' + * dtrace -qn 'zfs-dbgmsg{printf("%s\n", stringof(arg0))}' + * + * When used with libzpool, monitor with: + * dtrace -qn 'zfs$pid::zfs_dbgmsg:probe1{printf("%s\n", copyinstr(arg1))}' */ void zfs_dbgmsg(const char *fmt, ...) Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Fri Jul 18 16:25:35 2014 (r268847) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Fri Jul 18 17:55:12 2014 (r268848) @@ -815,8 +815,8 @@ zio_read_phys(zio_t *pio, vdev_t *vd, ui ASSERT3U(offset + size, <=, vd->vdev_psize); zio = zio_create(pio, vd->vdev_spa, 0, NULL, data, size, done, private, - ZIO_TYPE_READ, priority, flags, vd, offset, NULL, - ZIO_STAGE_OPEN, ZIO_READ_PHYS_PIPELINE); + ZIO_TYPE_READ, priority, flags | ZIO_FLAG_PHYSICAL, vd, offset, + NULL, ZIO_STAGE_OPEN, ZIO_READ_PHYS_PIPELINE); zio->io_prop.zp_checksum = checksum; @@ -836,8 +836,8 @@ zio_write_phys(zio_t *pio, vdev_t *vd, u ASSERT3U(offset + size, <=, vd->vdev_psize); zio = zio_create(pio, vd->vdev_spa, 0, NULL, data, size, done, private, - ZIO_TYPE_WRITE, priority, flags, vd, offset, NULL, - ZIO_STAGE_OPEN, ZIO_WRITE_PHYS_PIPELINE); + ZIO_TYPE_WRITE, priority, flags | ZIO_FLAG_PHYSICAL, vd, offset, + NULL, ZIO_STAGE_OPEN, ZIO_WRITE_PHYS_PIPELINE); zio->io_prop.zp_checksum = checksum; @@ -2508,7 +2508,9 @@ zio_vdev_io_start(zio_t *zio) align = 1ULL << vd->vdev_top->vdev_ashift; - if (P2PHASE(zio->io_size, align) != 0) { + if (!(zio->io_flags & ZIO_FLAG_PHYSICAL) && + P2PHASE(zio->io_size, align) != 0) { + /* Transform logical writes to be a full physical block size. */ uint64_t asize = P2ROUNDUP(zio->io_size, align); char *abuf = zio_buf_alloc(asize); ASSERT(vd == vd->vdev_top); @@ -2519,8 +2521,22 @@ zio_vdev_io_start(zio_t *zio) zio_push_transform(zio, abuf, asize, asize, zio_subblock); } - ASSERT(P2PHASE(zio->io_offset, align) == 0); - ASSERT(P2PHASE(zio->io_size, align) == 0); + /* + * If this is not a physical io, make sure that it is properly aligned + * before proceeding. + */ + if (!(zio->io_flags & ZIO_FLAG_PHYSICAL)) { + ASSERT0(P2PHASE(zio->io_offset, align)); + ASSERT0(P2PHASE(zio->io_size, align)); + } else { + /* + * For physical writes, we allow 512b aligned writes and assume + * the device will perform a read-modify-write as necessary. + */ + ASSERT0(P2PHASE(zio->io_offset, SPA_MINBLOCKSIZE)); + ASSERT0(P2PHASE(zio->io_size, SPA_MINBLOCKSIZE)); + } + VERIFY(zio->io_type != ZIO_TYPE_WRITE || spa_writeable(spa)); /* From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 17:55:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 251BE8FF; Fri, 18 Jul 2014 17:55:13 +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 10C782D2C; Fri, 18 Jul 2014 17:55:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6IHtChh096684; Fri, 18 Jul 2014 17:55:12 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6IHtCko096683; Fri, 18 Jul 2014 17:55:12 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407181755.s6IHtCko096683@svn.freebsd.org> From: Xin LI Date: Fri, 18 Jul 2014 17:55:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r268848 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/ztest X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 17:55:13 -0000 Author: delphij Date: Fri Jul 18 17:55:12 2014 New Revision: 268848 URL: http://svnweb.freebsd.org/changeset/base/268848 Log: 4958 zdb trips assert on pools with ashift >= 0xe Reviewed by: Matthew Ahrens Reviewed by: Max Grossman Reviewed by: George Wilson Reviewed by: Christopher Siden Approved by: Garrett D'Amore illumos/illumos-gate@2a104a5236475eb73aa41eaaf3ed9f3ccbe0ca55 Modified: vendor/illumos/dist/cmd/ztest/ztest.c Changes in other areas also in this revision: Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_debug.c vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Modified: vendor/illumos/dist/cmd/ztest/ztest.c ============================================================================== --- vendor/illumos/dist/cmd/ztest/ztest.c Fri Jul 18 16:25:35 2014 (r268847) +++ vendor/illumos/dist/cmd/ztest/ztest.c Fri Jul 18 17:55:12 2014 (r268848) @@ -808,7 +808,7 @@ static uint64_t ztest_get_ashift(void) { if (ztest_opts.zo_ashift == 0) - return (SPA_MINBLOCKSHIFT + ztest_random(3)); + return (SPA_MINBLOCKSHIFT + ztest_random(5)); return (ztest_opts.zo_ashift); } @@ -967,11 +967,28 @@ ztest_random_spa_version(uint64_t initia return (version); } +/* + * Find the largest ashift used + */ +static uint64_t +ztest_spa_get_ashift() { + uint64_t i; + uint64_t ashift = SPA_MINBLOCKSHIFT; + vdev_t *rvd = ztest_spa->spa_root_vdev; + + for (i = 0; i < rvd->vdev_children; i++) { + ashift = MAX(ashift, rvd->vdev_child[i]->vdev_ashift); + } + return (ashift); +} + static int ztest_random_blocksize(void) { - return (1 << (SPA_MINBLOCKSHIFT + - ztest_random(SPA_MAXBLOCKSHIFT - SPA_MINBLOCKSHIFT + 1))); + // Choose a block size >= the ashift. + uint64_t block_shift = + ztest_random(SPA_MAXBLOCKSHIFT - ztest_spa_get_ashift() + 1); + return (1 << (SPA_MINBLOCKSHIFT + block_shift)); } static int @@ -5765,16 +5782,30 @@ ztest_freeze(void) spa_freeze(spa); /* + * Because it is hard to predict how much space a write will actually + * require beforehand, we leave ourselves some fudge space to write over + * capacity. + */ + uint64_t capacity = metaslab_class_get_space(spa_normal_class(spa)) / 2; + + /* * Run tests that generate log records but don't alter the pool config * or depend on DSL sync tasks (snapshots, objset create/destroy, etc). * We do a txg_wait_synced() after each iteration to force the txg * to increase well beyond the last synced value in the uberblock. * The ZIL should be OK with that. + * + * Run a random number of times less than zo_maxloops and ensure we do + * not run out of space on the pool. */ while (ztest_random(10) != 0 && - numloops++ < ztest_opts.zo_maxloops) { - ztest_dmu_write_parallel(zd, 0); - ztest_dmu_object_alloc_free(zd, 0); + numloops++ < ztest_opts.zo_maxloops && + metaslab_class_get_alloc(spa_normal_class(spa)) < capacity) { + ztest_od_t od; + ztest_od_init(&od, 0, FTAG, 0, DMU_OT_UINT64_OTHER, 0, 0); + VERIFY0(ztest_object_init(zd, &od, sizeof (od), B_FALSE)); + ztest_io(zd, od.od_object, + ztest_random(ZTEST_RANGE_LOCKS) << SPA_MAXBLOCKSHIFT); txg_wait_synced(spa_get_dsl(spa), 0); } From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 18:00:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 33412C49; Fri, 18 Jul 2014 18:00:02 +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 1EC332D67; Fri, 18 Jul 2014 18:00:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6II01vg097664; Fri, 18 Jul 2014 18:00:01 GMT (envelope-from truckman@svn.freebsd.org) Received: (from truckman@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6II01E0097615; Fri, 18 Jul 2014 18:00:01 GMT (envelope-from truckman@svn.freebsd.org) Message-Id: <201407181800.s6II01E0097615@svn.freebsd.org> From: Don Lewis Date: Fri, 18 Jul 2014 18:00:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r268849 - in stable/9/sys: amd64/conf dev/xen/netback dev/xen/netfront X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 18:00:02 -0000 Author: truckman Date: Fri Jul 18 18:00:00 2014 New Revision: 268849 URL: http://svnweb.freebsd.org/changeset/base/268849 Log: Merge r256868,257276-257277,257515,257913 from head. These are fixes required to make Xen buildable w/o INET. This is the same as r259541 in stable/10 by glebius. Modified: stable/9/sys/amd64/conf/NOTES stable/9/sys/dev/xen/netback/netback.c stable/9/sys/dev/xen/netback/netback_unit_tests.c stable/9/sys/dev/xen/netfront/netfront.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/amd64/conf/NOTES ============================================================================== --- stable/9/sys/amd64/conf/NOTES Fri Jul 18 17:55:12 2014 (r268848) +++ stable/9/sys/amd64/conf/NOTES Fri Jul 18 18:00:00 2014 (r268849) @@ -472,6 +472,12 @@ device virtio_blk # VirtIO Block device device virtio_scsi # VirtIO SCSI device device virtio_balloon # VirtIO Memory Balloon device +device hyperv # HyperV drivers + +# Xen HVM Guest Optimizations +options XENHVM # Xen HVM kernel infrastructure +device xenpci # Xen HVM Hypervisor services driver + ##################################################################### # Modified: stable/9/sys/dev/xen/netback/netback.c ============================================================================== --- stable/9/sys/dev/xen/netback/netback.c Fri Jul 18 17:55:12 2014 (r268848) +++ stable/9/sys/dev/xen/netback/netback.c Fri Jul 18 18:00:00 2014 (r268849) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); * from this FreeBSD domain to other domains. */ #include "opt_inet.h" +#include "opt_inet6.h" #include "opt_global.h" #include "opt_sctp.h" @@ -182,7 +183,6 @@ static int xnb_rxpkt2gnttab(const struct static int xnb_rxpkt2rsp(const struct xnb_pkt *pkt, const gnttab_copy_table gnttab, int n_entries, netif_rx_back_ring_t *ring); -static void xnb_add_mbuf_cksum(struct mbuf *mbufc); static void xnb_stop(struct xnb_softc*); static int xnb_ioctl(struct ifnet*, u_long, caddr_t); static void xnb_start_locked(struct ifnet*); @@ -193,6 +193,9 @@ static void xnb_ifinit(void*); static int xnb_unit_test_main(SYSCTL_HANDLER_ARGS); static int xnb_dump_rings(SYSCTL_HANDLER_ARGS); #endif +#if defined(INET) || defined(INET6) +static void xnb_add_mbuf_cksum(struct mbuf *mbufc); +#endif /*------------------------------ Data Structures -----------------------------*/ @@ -1780,7 +1783,9 @@ xnb_update_mbufc(struct mbuf *mbufc, con } mbufc->m_pkthdr.len = total_size; +#if defined(INET) || defined(INET6) xnb_add_mbuf_cksum(mbufc); +#endif } /** @@ -2123,6 +2128,7 @@ xnb_rxpkt2rsp(const struct xnb_pkt *pkt, return n_responses; } +#if defined(INET) || defined(INET6) /** * Add IP, TCP, and/or UDP checksums to every mbuf in a chain. The first mbuf * in the chain must start with a struct ether_header. @@ -2177,6 +2183,7 @@ xnb_add_mbuf_cksum(struct mbuf *mbufc) break; } } +#endif /* INET || INET6 */ static void xnb_stop(struct xnb_softc *xnb) @@ -2193,8 +2200,8 @@ static int xnb_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { struct xnb_softc *xnb = ifp->if_softc; -#ifdef INET struct ifreq *ifr = (struct ifreq*) data; +#ifdef INET struct ifaddr *ifa = (struct ifaddr*)data; #endif int error = 0; Modified: stable/9/sys/dev/xen/netback/netback_unit_tests.c ============================================================================== --- stable/9/sys/dev/xen/netback/netback_unit_tests.c Fri Jul 18 17:55:12 2014 (r268848) +++ stable/9/sys/dev/xen/netback/netback_unit_tests.c Fri Jul 18 18:00:00 2014 (r268849) @@ -104,10 +104,6 @@ struct test_fixture { typedef struct test_fixture test_fixture_t; -static void xnb_fill_eh_and_ip(struct mbuf *m, uint16_t ip_len, - uint16_t ip_id, uint16_t ip_p, - uint16_t ip_off, uint16_t ip_sum); -static void xnb_fill_tcp(struct mbuf *m); static int xnb_get1pkt(struct xnb_pkt *pkt, size_t size, uint16_t flags); static int xnb_unit_test_runner(test_fixture_t const tests[], int ntests, char *buffer, size_t buflen); @@ -163,17 +159,24 @@ static testcase_t xnb_rxpkt2rsp_extra; static testcase_t xnb_rxpkt2rsp_2short; static testcase_t xnb_rxpkt2rsp_2slots; static testcase_t xnb_rxpkt2rsp_copyerror; +static testcase_t xnb_sscanf_llu; +static testcase_t xnb_sscanf_lld; +static testcase_t xnb_sscanf_hhu; +static testcase_t xnb_sscanf_hhd; +static testcase_t xnb_sscanf_hhn; + +#if defined(INET) || defined(INET6) /* TODO: add test cases for xnb_add_mbuf_cksum for IPV6 tcp and udp */ static testcase_t xnb_add_mbuf_cksum_arp; static testcase_t xnb_add_mbuf_cksum_tcp; static testcase_t xnb_add_mbuf_cksum_udp; static testcase_t xnb_add_mbuf_cksum_icmp; static testcase_t xnb_add_mbuf_cksum_tcp_swcksum; -static testcase_t xnb_sscanf_llu; -static testcase_t xnb_sscanf_lld; -static testcase_t xnb_sscanf_hhu; -static testcase_t xnb_sscanf_hhd; -static testcase_t xnb_sscanf_hhn; +static void xnb_fill_eh_and_ip(struct mbuf *m, uint16_t ip_len, + uint16_t ip_id, uint16_t ip_p, + uint16_t ip_off, uint16_t ip_sum); +static void xnb_fill_tcp(struct mbuf *m); +#endif /* INET || INET6 */ /** Private data used by unit tests */ static struct { @@ -307,11 +310,13 @@ xnb_unit_test_main(SYSCTL_HANDLER_ARGS) {setup_pvt_data, xnb_rxpkt2rsp_2short, teardown_pvt_data}, {setup_pvt_data, xnb_rxpkt2rsp_2slots, teardown_pvt_data}, {setup_pvt_data, xnb_rxpkt2rsp_copyerror, teardown_pvt_data}, +#if defined(INET) || defined(INET6) {null_setup, xnb_add_mbuf_cksum_arp, null_teardown}, {null_setup, xnb_add_mbuf_cksum_icmp, null_teardown}, {null_setup, xnb_add_mbuf_cksum_tcp, null_teardown}, {null_setup, xnb_add_mbuf_cksum_tcp_swcksum, null_teardown}, {null_setup, xnb_add_mbuf_cksum_udp, null_teardown}, +#endif {null_setup, xnb_sscanf_hhd, null_teardown}, {null_setup, xnb_sscanf_hhu, null_teardown}, {null_setup, xnb_sscanf_lld, null_teardown}, @@ -2066,6 +2071,7 @@ xnb_rxpkt2rsp_copyerror(char *buffer, si safe_m_freem(&mbuf); } +#if defined(INET) || defined(INET6) /** * xnb_add_mbuf_cksum on an ARP request packet */ @@ -2430,6 +2436,7 @@ xnb_add_mbuf_cksum_tcp_swcksum(char *buf m_freem(mbufc); } +#endif /* INET || INET6 */ /** * sscanf on unsigned chars Modified: stable/9/sys/dev/xen/netfront/netfront.c ============================================================================== --- stable/9/sys/dev/xen/netfront/netfront.c Fri Jul 18 17:55:12 2014 (r268848) +++ stable/9/sys/dev/xen/netfront/netfront.c Fri Jul 18 18:00:00 2014 (r268849) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" +#include "opt_inet6.h" #include #include @@ -166,7 +167,6 @@ static int xn_configure_features(struct static void xn_watchdog(struct ifnet *); #endif -static void show_device(struct netfront_info *sc); #ifdef notyet static void netfront_closing(device_t dev); #endif @@ -645,8 +645,6 @@ setup_device(device_t dev, struct netfro goto fail; } - show_device(info); - return (0); fail: @@ -968,7 +966,7 @@ static void xn_rxeof(struct netfront_info *np) { struct ifnet *ifp; -#if __FreeBSD_version >= 700000 +#if __FreeBSD_version >= 700000 && (defined(INET) || defined(INET6)) struct lro_ctrl *lro = &np->xn_lro; struct lro_entry *queued; #endif @@ -1065,7 +1063,7 @@ xn_rxeof(struct netfront_info *np) * Do we really need to drop the rx lock? */ XN_RX_UNLOCK(np); -#if __FreeBSD_version >= 700000 +#if __FreeBSD_version >= 700000 && (defined(INET) || defined(INET6)) /* Use LRO if possible */ if ((ifp->if_capenable & IFCAP_LRO) == 0 || lro->lro_cnt == 0 || tcp_lro_rx(lro, m, 0)) { @@ -1083,7 +1081,7 @@ xn_rxeof(struct netfront_info *np) np->rx.rsp_cons = i; -#if __FreeBSD_version >= 700000 +#if __FreeBSD_version >= 700000 && (defined(INET) || defined(INET6)) /* * Flush any outstanding LRO work */ @@ -1970,25 +1968,6 @@ network_connect(struct netfront_info *np return (0); } -static void -show_device(struct netfront_info *sc) -{ -#ifdef DEBUG - if (sc) { - IPRINTK("\n", - sc->xn_ifno, - be_state_name[sc->xn_backend_state], - sc->xn_user_state ? "open" : "closed", - sc->xn_evtchn, - sc->xn_irq, - sc->xn_tx_if, - sc->xn_rx_if); - } else { - IPRINTK("\n"); - } -#endif -} - static void xn_query_features(struct netfront_info *np) { @@ -2025,14 +2004,14 @@ xn_configure_features(struct netfront_in int err; err = 0; -#if __FreeBSD_version >= 700000 +#if __FreeBSD_version >= 700000 && (defined(INET) || defined(INET6)) if ((np->xn_ifp->if_capenable & IFCAP_LRO) != 0) tcp_lro_free(&np->xn_lro); #endif np->xn_ifp->if_capenable = np->xn_ifp->if_capabilities & ~(IFCAP_LRO|IFCAP_TSO4); np->xn_ifp->if_hwassist &= ~CSUM_TSO; -#if __FreeBSD_version >= 700000 +#if __FreeBSD_version >= 700000 && (defined(INET) || defined(INET6)) if (xn_enable_lro && (np->xn_ifp->if_capabilities & IFCAP_LRO) != 0) { err = tcp_lro_init(&np->xn_lro); if (err) { From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 18:02:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BEB7ADC0; Fri, 18 Jul 2014 18:02: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 9F8012DFE; Fri, 18 Jul 2014 18:02:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6II2Z7K001452; Fri, 18 Jul 2014 18:02:35 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6II2ZW3001448; Fri, 18 Jul 2014 18:02:35 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407181802.s6II2ZW3001448@svn.freebsd.org> From: Xin LI Date: Fri, 18 Jul 2014 18:02:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r268850 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 18:02:35 -0000 Author: delphij Date: Fri Jul 18 18:02:34 2014 New Revision: 268850 URL: http://svnweb.freebsd.org/changeset/base/268850 Log: 4631 zvol_get_stats triggering too many reads Reviewed by: Adam Leventhal Reviewed by: Sebastien Roy Reviewed by: Matt Ahrens Approved by: Dan McDonald illumos/illumos-gate@bbfa8ea8bb4168c969ba27d632dfe0aeec3fc0da Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/arc.h Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Fri Jul 18 18:00:00 2014 (r268849) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Fri Jul 18 18:02:34 2014 (r268850) @@ -105,7 +105,7 @@ * with the buffer may be evicted prior to the callback. The callback * must be made with *no locks held* (to prevent deadlock). Additionally, * the users of callbacks must ensure that their private data is - * protected from simultaneous callbacks from arc_buf_evict() + * protected from simultaneous callbacks from arc_clear_callback() * and arc_do_user_evicts(). * * Note that the majority of the performance stats are manipulated @@ -1495,8 +1495,12 @@ arc_buf_data_free(arc_buf_t *buf, void ( } } +/* + * Free up buf->b_data and if 'remove' is set, then pull the + * arc_buf_t off of the the arc_buf_hdr_t's list and free it. + */ static void -arc_buf_destroy(arc_buf_t *buf, boolean_t recycle, boolean_t all) +arc_buf_destroy(arc_buf_t *buf, boolean_t recycle, boolean_t remove) { arc_buf_t **bufp; @@ -1547,7 +1551,7 @@ arc_buf_destroy(arc_buf_t *buf, boolean_ } /* only remove the buf if requested */ - if (!all) + if (!remove) return; /* remove the buf from the hdr list */ @@ -2121,7 +2125,7 @@ arc_do_user_evicts(void) mutex_exit(&arc_eviction_mtx); if (buf->b_efunc != NULL) - VERIFY(buf->b_efunc(buf) == 0); + VERIFY0(buf->b_efunc(buf->b_private)); buf->b_efunc = NULL; buf->b_private = NULL; @@ -3240,16 +3244,25 @@ arc_freed(spa_t *spa, const blkptr_t *bp } /* - * This is used by the DMU to let the ARC know that a buffer is - * being evicted, so the ARC should clean up. If this arc buf - * is not yet in the evicted state, it will be put there. + * Clear the user eviction callback set by arc_set_callback(), first calling + * it if it exists. Because the presence of a callback keeps an arc_buf cached + * clearing the callback may result in the arc_buf being destroyed. However, + * it will not result in the *last* arc_buf being destroyed, hence the data + * will remain cached in the ARC. We make a copy of the arc buffer here so + * that we can process the callback without holding any locks. + * + * It's possible that the callback is already in the process of being cleared + * by another thread. In this case we can not clear the callback. + * + * Returns B_TRUE if the callback was successfully called and cleared. */ -int -arc_buf_evict(arc_buf_t *buf) +boolean_t +arc_clear_callback(arc_buf_t *buf) { arc_buf_hdr_t *hdr; kmutex_t *hash_lock; - arc_buf_t **bufp; + arc_evict_func_t *efunc = buf->b_efunc; + void *private = buf->b_private; mutex_enter(&buf->b_evict_lock); hdr = buf->b_hdr; @@ -3259,17 +3272,16 @@ arc_buf_evict(arc_buf_t *buf) */ ASSERT(buf->b_data == NULL); mutex_exit(&buf->b_evict_lock); - return (0); + return (B_FALSE); } else if (buf->b_data == NULL) { - arc_buf_t copy = *buf; /* structure assignment */ /* * We are on the eviction list; process this buffer now * but let arc_do_user_evicts() do the reaping. */ buf->b_efunc = NULL; mutex_exit(&buf->b_evict_lock); - VERIFY(copy.b_efunc(©) == 0); - return (1); + VERIFY0(efunc(private)); + return (B_TRUE); } hash_lock = HDR_LOCK(hdr); mutex_enter(hash_lock); @@ -3279,48 +3291,21 @@ arc_buf_evict(arc_buf_t *buf) ASSERT3U(refcount_count(&hdr->b_refcnt), <, hdr->b_datacnt); ASSERT(hdr->b_state == arc_mru || hdr->b_state == arc_mfu); - /* - * Pull this buffer off of the hdr - */ - bufp = &hdr->b_buf; - while (*bufp != buf) - bufp = &(*bufp)->b_next; - *bufp = buf->b_next; - - ASSERT(buf->b_data != NULL); - arc_buf_destroy(buf, FALSE, FALSE); - - if (hdr->b_datacnt == 0) { - arc_state_t *old_state = hdr->b_state; - arc_state_t *evicted_state; - - ASSERT(hdr->b_buf == NULL); - ASSERT(refcount_is_zero(&hdr->b_refcnt)); - - evicted_state = - (old_state == arc_mru) ? arc_mru_ghost : arc_mfu_ghost; - - mutex_enter(&old_state->arcs_mtx); - mutex_enter(&evicted_state->arcs_mtx); - - arc_change_state(evicted_state, hdr, hash_lock); - ASSERT(HDR_IN_HASH_TABLE(hdr)); - hdr->b_flags |= ARC_IN_HASH_TABLE; - hdr->b_flags &= ~ARC_BUF_AVAILABLE; + buf->b_efunc = NULL; + buf->b_private = NULL; - mutex_exit(&evicted_state->arcs_mtx); - mutex_exit(&old_state->arcs_mtx); + if (hdr->b_datacnt > 1) { + mutex_exit(&buf->b_evict_lock); + arc_buf_destroy(buf, FALSE, TRUE); + } else { + ASSERT(buf == hdr->b_buf); + hdr->b_flags |= ARC_BUF_AVAILABLE; + mutex_exit(&buf->b_evict_lock); } - mutex_exit(hash_lock); - mutex_exit(&buf->b_evict_lock); - VERIFY(buf->b_efunc(buf) == 0); - buf->b_efunc = NULL; - buf->b_private = NULL; - buf->b_hdr = NULL; - buf->b_next = NULL; - kmem_cache_free(buf_cache, buf); - return (1); + mutex_exit(hash_lock); + VERIFY0(efunc(private)); + return (B_TRUE); } /* @@ -3466,17 +3451,6 @@ arc_released(arc_buf_t *buf) return (released); } -int -arc_has_callback(arc_buf_t *buf) -{ - int callback; - - mutex_enter(&buf->b_evict_lock); - callback = (buf->b_efunc != NULL); - mutex_exit(&buf->b_evict_lock); - return (callback); -} - #ifdef ZFS_DEBUG int arc_referenced(arc_buf_t *buf) Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Fri Jul 18 18:00:00 2014 (r268849) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Fri Jul 18 18:02:34 2014 (r268850) @@ -181,8 +181,7 @@ dbuf_hash_insert(dmu_buf_impl_t *db) } /* - * Remove an entry from the hash table. This operation will - * fail if there are any existing holds on the db. + * Remove an entry from the hash table. It must be in the EVICTING state. */ static void dbuf_hash_remove(dmu_buf_impl_t *db) @@ -194,7 +193,7 @@ dbuf_hash_remove(dmu_buf_impl_t *db) dmu_buf_impl_t *dbf, **dbp; /* - * We musn't hold db_mtx to maintin lock ordering: + * We musn't hold db_mtx to maintain lock ordering: * DBUF_HASH_MUTEX > db_mtx. */ ASSERT(refcount_is_zero(&db->db_holds)); @@ -431,7 +430,6 @@ static void dbuf_set_data(dmu_buf_impl_t *db, arc_buf_t *buf) { ASSERT(MUTEX_HELD(&db->db_mtx)); - ASSERT(db->db_buf == NULL || !arc_has_callback(db->db_buf)); db->db_buf = buf; if (buf != NULL) { ASSERT(buf->b_data != NULL); @@ -1544,12 +1542,15 @@ dbuf_assign_arcbuf(dmu_buf_impl_t *db, a * when we are not holding the dn_dbufs_mtx, we can't clear the * entry in the dn_dbufs list. We have to wait until dbuf_destroy() * in this case. For callers from the DMU we will usually see: - * dbuf_clear()->arc_buf_evict()->dbuf_do_evict()->dbuf_destroy() + * dbuf_clear()->arc_clear_callback()->dbuf_do_evict()->dbuf_destroy() * For the arc callback, we will usually see: * dbuf_do_evict()->dbuf_clear();dbuf_destroy() * Sometimes, though, we will get a mix of these two: - * DMU: dbuf_clear()->arc_buf_evict() + * DMU: dbuf_clear()->arc_clear_callback() * ARC: dbuf_do_evict()->dbuf_destroy() + * + * This routine will dissociate the dbuf from the arc, by calling + * arc_clear_callback(), but will not evict the data from the ARC. */ void dbuf_clear(dmu_buf_impl_t *db) @@ -1557,7 +1558,7 @@ dbuf_clear(dmu_buf_impl_t *db) dnode_t *dn; dmu_buf_impl_t *parent = db->db_parent; dmu_buf_impl_t *dndb; - int dbuf_gone = FALSE; + boolean_t dbuf_gone = B_FALSE; ASSERT(MUTEX_HELD(&db->db_mtx)); ASSERT(refcount_is_zero(&db->db_holds)); @@ -1603,7 +1604,7 @@ dbuf_clear(dmu_buf_impl_t *db) } if (db->db_buf) - dbuf_gone = arc_buf_evict(db->db_buf); + dbuf_gone = arc_clear_callback(db->db_buf); if (!dbuf_gone) mutex_exit(&db->db_mtx); @@ -1771,8 +1772,7 @@ dbuf_create(dnode_t *dn, uint8_t level, static int dbuf_do_evict(void *private) { - arc_buf_t *buf = private; - dmu_buf_impl_t *db = buf->b_private; + dmu_buf_impl_t *db = private; if (!MUTEX_HELD(&db->db_mtx)) mutex_enter(&db->db_mtx); @@ -2135,11 +2135,23 @@ dbuf_rele_and_unlock(dmu_buf_impl_t *db, * block on-disk. If so, then we simply evict * ourselves. */ - if (!DBUF_IS_CACHEABLE(db) || - arc_buf_eviction_needed(db->db_buf)) + if (!DBUF_IS_CACHEABLE(db)) { + if (db->db_blkptr != NULL && + !BP_IS_HOLE(db->db_blkptr) && + !BP_IS_EMBEDDED(db->db_blkptr)) { + spa_t *spa = + dmu_objset_spa(db->db_objset); + blkptr_t bp = *db->db_blkptr; + dbuf_clear(db); + arc_freed(spa, &bp); + } else { + dbuf_clear(db); + } + } else if (arc_buf_eviction_needed(db->db_buf)) { dbuf_clear(db); - else + } else { mutex_exit(&db->db_mtx); + } } } else { mutex_exit(&db->db_mtx); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/arc.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/arc.h Fri Jul 18 18:00:00 2014 (r268849) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/arc.h Fri Jul 18 18:02:34 2014 (r268850) @@ -95,7 +95,6 @@ boolean_t arc_buf_remove_ref(arc_buf_t * int arc_buf_size(arc_buf_t *buf); void arc_release(arc_buf_t *buf, void *tag); int arc_released(arc_buf_t *buf); -int arc_has_callback(arc_buf_t *buf); void arc_buf_freeze(arc_buf_t *buf); void arc_buf_thaw(arc_buf_t *buf); boolean_t arc_buf_eviction_needed(arc_buf_t *buf); @@ -114,7 +113,7 @@ zio_t *arc_write(zio_t *pio, spa_t *spa, void arc_freed(spa_t *spa, const blkptr_t *bp); void arc_set_callback(arc_buf_t *buf, arc_evict_func_t *func, void *private); -int arc_buf_evict(arc_buf_t *buf); +boolean_t arc_clear_callback(arc_buf_t *buf); void arc_flush(spa_t *spa); void arc_tempreserve_clear(uint64_t reserve); From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 18:05:10 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B9CE6F23; Fri, 18 Jul 2014 18:05:10 +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 A5D5B2E1C; Fri, 18 Jul 2014 18:05:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6II5AJe002006; Fri, 18 Jul 2014 18:05:10 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6II59HW001998; Fri, 18 Jul 2014 18:05:09 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407181805.s6II59HW001998@svn.freebsd.org> From: Xin LI Date: Fri, 18 Jul 2014 18:05:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r268851 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 18:05:10 -0000 Author: delphij Date: Fri Jul 18 18:05:09 2014 New Revision: 268851 URL: http://svnweb.freebsd.org/changeset/base/268851 Log: 4753 increase number of outstanding async writes when sync task is waiting Reviewed by: Matthew Ahrens Reviewed by: George Wilson Reviewed by: Adam Leventhal Reviewed by: Christopher Siden Reviewed by: Dan McDonald Approved by: Garrett D'Amore illumos/illumos-gate@73527f441cbbd953fa42cc5a30a413bad75f24a9 Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/txg.h vendor-sys/illumos/dist/uts/common/fs/zfs/txg.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_queue.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c Fri Jul 18 18:02:34 2014 (r268850) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c Fri Jul 18 18:05:09 2014 (r268851) @@ -1876,6 +1876,16 @@ spa_writeable(spa_t *spa) return (!!(spa->spa_mode & FWRITE)); } +/* + * Returns true if there is a pending sync task in any of the current + * syncing txg, the current quiescing txg, or the current open txg. + */ +boolean_t +spa_has_pending_synctask(spa_t *spa) +{ + return (!txg_all_lists_empty(&spa->spa_dsl_pool->dp_sync_tasks)); +} + int spa_mode(spa_t *spa) { Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h Fri Jul 18 18:02:34 2014 (r268850) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h Fri Jul 18 18:05:09 2014 (r268851) @@ -780,6 +780,7 @@ extern uint64_t bp_get_dsize(spa_t *spa, extern boolean_t spa_has_slogs(spa_t *spa); extern boolean_t spa_is_root(spa_t *spa); extern boolean_t spa_writeable(spa_t *spa); +extern boolean_t spa_has_pending_synctask(spa_t *spa); extern int spa_mode(spa_t *spa); extern uint64_t strtonum(const char *str, char **nptr); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/txg.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/txg.h Fri Jul 18 18:02:34 2014 (r268850) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/txg.h Fri Jul 18 18:05:09 2014 (r268851) @@ -23,7 +23,7 @@ * Use is subject to license terms. */ /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ #ifndef _SYS_TXG_H @@ -112,6 +112,7 @@ extern boolean_t txg_sync_waiting(struct extern void txg_list_create(txg_list_t *tl, size_t offset); extern void txg_list_destroy(txg_list_t *tl); extern boolean_t txg_list_empty(txg_list_t *tl, uint64_t txg); +extern boolean_t txg_all_lists_empty(txg_list_t *tl); extern boolean_t txg_list_add(txg_list_t *tl, void *p, uint64_t txg); extern boolean_t txg_list_add_tail(txg_list_t *tl, void *p, uint64_t txg); extern void *txg_list_remove(txg_list_t *tl, uint64_t txg); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/txg.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/txg.c Fri Jul 18 18:02:34 2014 (r268850) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/txg.c Fri Jul 18 18:05:09 2014 (r268851) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Portions Copyright 2011 Martin Matuska - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ #include @@ -718,6 +718,24 @@ txg_list_empty(txg_list_t *tl, uint64_t } /* + * Returns true if all txg lists are empty. + * + * Warning: this is inherently racy (an item could be added immediately after this + * function returns). We don't bother with the lock because it wouldn't change the + * semantics. + */ +boolean_t +txg_all_lists_empty(txg_list_t *tl) +{ + for (int i = 0; i < TXG_SIZE; i++) { + if (!txg_list_empty(tl, i)) { + return (B_FALSE); + } + } + return (B_TRUE); +} + +/* * Add an entry to the list (unless it's already on the list). * Returns B_TRUE if it was actually added. */ Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_queue.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_queue.c Fri Jul 18 18:02:34 2014 (r268850) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_queue.c Fri Jul 18 18:05:09 2014 (r268851) @@ -24,7 +24,7 @@ */ /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ #include @@ -350,14 +350,23 @@ vdev_queue_class_min_active(zio_priority } static int -vdev_queue_max_async_writes(uint64_t dirty) +vdev_queue_max_async_writes(spa_t *spa) { int writes; + uint64_t dirty = spa->spa_dsl_pool->dp_dirty_total; uint64_t min_bytes = zfs_dirty_data_max * zfs_vdev_async_write_active_min_dirty_percent / 100; uint64_t max_bytes = zfs_dirty_data_max * zfs_vdev_async_write_active_max_dirty_percent / 100; + /* + * Sync tasks correspond to interactive user actions. To reduce the + * execution time of those actions we push data out as fast as possible. + */ + if (spa_has_pending_synctask(spa)) { + return (zfs_vdev_async_write_max_active); + } + if (dirty < min_bytes) return (zfs_vdev_async_write_min_active); if (dirty > max_bytes) @@ -390,8 +399,7 @@ vdev_queue_class_max_active(spa_t *spa, case ZIO_PRIORITY_ASYNC_READ: return (zfs_vdev_async_read_max_active); case ZIO_PRIORITY_ASYNC_WRITE: - return (vdev_queue_max_async_writes( - spa->spa_dsl_pool->dp_dirty_total)); + return (vdev_queue_max_async_writes(spa)); case ZIO_PRIORITY_SCRUB: return (zfs_vdev_scrub_max_active); default: From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 18:09:22 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 83D42184; Fri, 18 Jul 2014 18:09:22 +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 64F2E2E7B; Fri, 18 Jul 2014 18:09:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6II9Mwn002819; Fri, 18 Jul 2014 18:09:22 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6II9KkB002810; Fri, 18 Jul 2014 18:09:20 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407181809.s6II9KkB002810@svn.freebsd.org> From: Xin LI Date: Fri, 18 Jul 2014 18:09:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r268852 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 18:09:22 -0000 Author: delphij Date: Fri Jul 18 18:09:20 2014 New Revision: 268852 URL: http://svnweb.freebsd.org/changeset/base/268852 Log: 5008 lock contention (rrw_exit) while running a read only load Reviewed by: Matthew Ahrens Reviewed by: George Wilson Reviewed by: Alex Reece Reviewed by: Christopher Siden Reviewed by: Richard Yao Reviewed by: Saso Kiselkov Approved by: Garrett D'Amore illumos/illumos-gate@c9030f6c93613fe30ee0c16f92b96da7816ac052 Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/rrwlock.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/rrwlock.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_vfsops.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_znode.h vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vfsops.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_znode.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/rrwlock.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/rrwlock.c Fri Jul 18 18:05:09 2014 (r268851) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/rrwlock.c Fri Jul 18 18:09:20 2014 (r268852) @@ -286,3 +286,91 @@ rrw_tsd_destroy(void *arg) (void *)curthread, (void *)rn->rn_rrl); } } + +/* + * A reader-mostly lock implementation, tuning above reader-writer locks + * for hightly parallel read acquisitions, while pessimizing writes. + * + * The idea is to split single busy lock into array of locks, so that + * each reader can lock only one of them for read, depending on result + * of simple hash function. That proportionally reduces lock congestion. + * Writer same time has to sequentially aquire write on all the locks. + * That makes write aquisition proportionally slower, but in places where + * it is used (filesystem unmount) performance is not critical. + * + * All the functions below are direct wrappers around functions above. + */ +void +rrm_init(rrmlock_t *rrl, boolean_t track_all) +{ + int i; + + for (i = 0; i < RRM_NUM_LOCKS; i++) + rrw_init(&rrl->locks[i], track_all); +} + +void +rrm_destroy(rrmlock_t *rrl) +{ + int i; + + for (i = 0; i < RRM_NUM_LOCKS; i++) + rrw_destroy(&rrl->locks[i]); +} + +void +rrm_enter(rrmlock_t *rrl, krw_t rw, void *tag) +{ + if (rw == RW_READER) + rrm_enter_read(rrl, tag); + else + rrm_enter_write(rrl); +} + +/* + * This maps the current thread to a specific lock. Note that the lock + * must be released by the same thread that acquired it. We do this + * mapping by taking the thread pointer mod a prime number. We examine + * only the low 32 bits of the thread pointer, because 32-bit division + * is faster than 64-bit division, and the high 32 bits have little + * entropy anyway. + */ +#define RRM_TD_LOCK() (((uint32_t)(uintptr_t)(curthread)) % RRM_NUM_LOCKS) + +void +rrm_enter_read(rrmlock_t *rrl, void *tag) +{ + rrw_enter_read(&rrl->locks[RRM_TD_LOCK()], tag); +} + +void +rrm_enter_write(rrmlock_t *rrl) +{ + int i; + + for (i = 0; i < RRM_NUM_LOCKS; i++) + rrw_enter_write(&rrl->locks[i]); +} + +void +rrm_exit(rrmlock_t *rrl, void *tag) +{ + int i; + + if (rrl->locks[0].rr_writer == curthread) { + for (i = 0; i < RRM_NUM_LOCKS; i++) + rrw_exit(&rrl->locks[i], tag); + } else { + rrw_exit(&rrl->locks[RRM_TD_LOCK()], tag); + } +} + +boolean_t +rrm_held(rrmlock_t *rrl, krw_t rw) +{ + if (rw == RW_WRITER) { + return (rrw_held(&rrl->locks[0], rw)); + } else { + return (rrw_held(&rrl->locks[RRM_TD_LOCK()], rw)); + } +} Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/rrwlock.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/rrwlock.h Fri Jul 18 18:05:09 2014 (r268851) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/rrwlock.h Fri Jul 18 18:09:20 2014 (r268852) @@ -80,6 +80,31 @@ void rrw_tsd_destroy(void *arg); #define RRW_LOCK_HELD(x) \ (rrw_held(x, RW_WRITER) || rrw_held(x, RW_READER)) +/* + * A reader-mostly lock implementation, tuning above reader-writer locks + * for hightly parallel read acquisitions, pessimizing write acquisitions. + * + * This should be a prime number. See comment in rrwlock.c near + * RRM_TD_LOCK() for details. + */ +#define RRM_NUM_LOCKS 17 +typedef struct rrmlock { + rrwlock_t locks[RRM_NUM_LOCKS]; +} rrmlock_t; + +void rrm_init(rrmlock_t *rrl, boolean_t track_all); +void rrm_destroy(rrmlock_t *rrl); +void rrm_enter(rrmlock_t *rrl, krw_t rw, void *tag); +void rrm_enter_read(rrmlock_t *rrl, void *tag); +void rrm_enter_write(rrmlock_t *rrl); +void rrm_exit(rrmlock_t *rrl, void *tag); +boolean_t rrm_held(rrmlock_t *rrl, krw_t rw); + +#define RRM_READ_HELD(x) rrm_held(x, RW_READER) +#define RRM_WRITE_HELD(x) rrm_held(x, RW_WRITER) +#define RRM_LOCK_HELD(x) \ + (rrm_held(x, RW_WRITER) || rrm_held(x, RW_READER)) + #ifdef __cplusplus } #endif Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_vfsops.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_vfsops.h Fri Jul 18 18:05:09 2014 (r268851) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_vfsops.h Fri Jul 18 18:09:20 2014 (r268852) @@ -64,7 +64,7 @@ struct zfsvfs { int z_norm; /* normalization flags */ boolean_t z_atime; /* enable atimes mount option */ boolean_t z_unmounted; /* unmounted */ - rrwlock_t z_teardown_lock; + rrmlock_t z_teardown_lock; krwlock_t z_teardown_inactive_lock; list_t z_all_znodes; /* all vnodes in the fs */ kmutex_t z_znodes_lock; /* lock for z_all_znodes */ Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_znode.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_znode.h Fri Jul 18 18:05:09 2014 (r268851) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_znode.h Fri Jul 18 18:09:20 2014 (r268852) @@ -238,7 +238,7 @@ typedef struct znode { /* Called on entry to each ZFS vnode and vfs operation */ #define ZFS_ENTER(zfsvfs) \ { \ - rrw_enter_read(&(zfsvfs)->z_teardown_lock, FTAG); \ + rrm_enter_read(&(zfsvfs)->z_teardown_lock, FTAG); \ if ((zfsvfs)->z_unmounted) { \ ZFS_EXIT(zfsvfs); \ return (EIO); \ @@ -246,7 +246,7 @@ typedef struct znode { } /* Must be called before exiting the vop */ -#define ZFS_EXIT(zfsvfs) rrw_exit(&(zfsvfs)->z_teardown_lock, FTAG) +#define ZFS_EXIT(zfsvfs) rrm_exit(&(zfsvfs)->z_teardown_lock, FTAG) /* Verifies the znode is valid */ #define ZFS_VERIFY_ZP(zp) \ Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c Fri Jul 18 18:05:09 2014 (r268851) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c Fri Jul 18 18:09:20 2014 (r268852) @@ -1420,7 +1420,7 @@ zfsvfs_hold(const char *name, void *tag, if (getzfsvfs(name, zfvp) != 0) error = zfsvfs_create(name, zfvp); if (error == 0) { - rrw_enter(&(*zfvp)->z_teardown_lock, (writer) ? RW_WRITER : + rrm_enter(&(*zfvp)->z_teardown_lock, (writer) ? RW_WRITER : RW_READER, tag); if ((*zfvp)->z_unmounted) { /* @@ -1428,7 +1428,7 @@ zfsvfs_hold(const char *name, void *tag, * thread should be just about to disassociate the * objset from the zfsvfs. */ - rrw_exit(&(*zfvp)->z_teardown_lock, tag); + rrm_exit(&(*zfvp)->z_teardown_lock, tag); return (SET_ERROR(EBUSY)); } } @@ -1438,7 +1438,7 @@ zfsvfs_hold(const char *name, void *tag, static void zfsvfs_rele(zfsvfs_t *zfsvfs, void *tag) { - rrw_exit(&zfsvfs->z_teardown_lock, tag); + rrm_exit(&zfsvfs->z_teardown_lock, tag); if (zfsvfs->z_vfs) { VFS_RELE(zfsvfs->z_vfs); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vfsops.c Fri Jul 18 18:05:09 2014 (r268851) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vfsops.c Fri Jul 18 18:09:20 2014 (r268852) @@ -1004,7 +1004,7 @@ zfsvfs_create(const char *osname, zfsvfs mutex_init(&zfsvfs->z_lock, NULL, MUTEX_DEFAULT, NULL); list_create(&zfsvfs->z_all_znodes, sizeof (znode_t), offsetof(znode_t, z_link_node)); - rrw_init(&zfsvfs->z_teardown_lock, B_FALSE); + rrm_init(&zfsvfs->z_teardown_lock, B_FALSE); rw_init(&zfsvfs->z_teardown_inactive_lock, NULL, RW_DEFAULT, NULL); rw_init(&zfsvfs->z_fuid_lock, NULL, RW_DEFAULT, NULL); for (i = 0; i != ZFS_OBJ_MTX_SZ; i++) @@ -1119,7 +1119,7 @@ zfsvfs_free(zfsvfs_t *zfsvfs) mutex_destroy(&zfsvfs->z_znodes_lock); mutex_destroy(&zfsvfs->z_lock); list_destroy(&zfsvfs->z_all_znodes); - rrw_destroy(&zfsvfs->z_teardown_lock); + rrm_destroy(&zfsvfs->z_teardown_lock); rw_destroy(&zfsvfs->z_teardown_inactive_lock); rw_destroy(&zfsvfs->z_fuid_lock); for (i = 0; i != ZFS_OBJ_MTX_SZ; i++) @@ -1784,7 +1784,7 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolea { znode_t *zp; - rrw_enter(&zfsvfs->z_teardown_lock, RW_WRITER, FTAG); + rrm_enter(&zfsvfs->z_teardown_lock, RW_WRITER, FTAG); if (!unmounting) { /* @@ -1814,7 +1814,7 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolea */ if (!unmounting && (zfsvfs->z_unmounted || zfsvfs->z_os == NULL)) { rw_exit(&zfsvfs->z_teardown_inactive_lock); - rrw_exit(&zfsvfs->z_teardown_lock, FTAG); + rrm_exit(&zfsvfs->z_teardown_lock, FTAG); return (SET_ERROR(EIO)); } @@ -1841,7 +1841,7 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolea */ if (unmounting) { zfsvfs->z_unmounted = B_TRUE; - rrw_exit(&zfsvfs->z_teardown_lock, FTAG); + rrm_exit(&zfsvfs->z_teardown_lock, FTAG); rw_exit(&zfsvfs->z_teardown_inactive_lock); } @@ -2073,7 +2073,7 @@ zfs_resume_fs(zfsvfs_t *zfsvfs, const ch znode_t *zp; uint64_t sa_obj = 0; - ASSERT(RRW_WRITE_HELD(&zfsvfs->z_teardown_lock)); + ASSERT(RRM_WRITE_HELD(&zfsvfs->z_teardown_lock)); ASSERT(RW_WRITE_HELD(&zfsvfs->z_teardown_inactive_lock)); /* @@ -2129,7 +2129,7 @@ zfs_resume_fs(zfsvfs_t *zfsvfs, const ch bail: /* release the VOPs */ rw_exit(&zfsvfs->z_teardown_inactive_lock); - rrw_exit(&zfsvfs->z_teardown_lock, FTAG); + rrm_exit(&zfsvfs->z_teardown_lock, FTAG); if (err) { /* Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_znode.c Fri Jul 18 18:05:09 2014 (r268851) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_znode.c Fri Jul 18 18:09:20 2014 (r268852) @@ -276,7 +276,7 @@ zfs_znode_move(void *buf, void *newbuf, * can safely ensure that the filesystem is not and will not be * unmounted. The next statement is equivalent to ZFS_ENTER(). */ - rrw_enter(&zfsvfs->z_teardown_lock, RW_READER, FTAG); + rrm_enter(&zfsvfs->z_teardown_lock, RW_READER, FTAG); if (zfsvfs->z_unmounted) { ZFS_EXIT(zfsvfs); rw_exit(&zfsvfs_lock); From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 18:11:25 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AA0E633C; Fri, 18 Jul 2014 18:11: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 96A002F25; Fri, 18 Jul 2014 18:11:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6IIBPDJ006460; Fri, 18 Jul 2014 18:11:25 GMT (envelope-from truckman@svn.freebsd.org) Received: (from truckman@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6IIBPkt006459; Fri, 18 Jul 2014 18:11:25 GMT (envelope-from truckman@svn.freebsd.org) Message-Id: <201407181811.s6IIBPkt006459@svn.freebsd.org> From: Don Lewis Date: Fri, 18 Jul 2014 18:11:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r268853 - stable/9/sys/modules/xenhvm X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 18:11:25 -0000 Author: truckman Date: Fri Jul 18 18:11:24 2014 New Revision: 268853 URL: http://svnweb.freebsd.org/changeset/base/268853 Log: Generate *all* the needed autogenerated header files. For some reason normal builds still work without this, but "make universe" requires it. Tested with "make universe". This is a direct commit to stable/9 because this module does not exist in head or stable/10. Modified: stable/9/sys/modules/xenhvm/Makefile Modified: stable/9/sys/modules/xenhvm/Makefile ============================================================================== --- stable/9/sys/modules/xenhvm/Makefile Fri Jul 18 18:09:20 2014 (r268852) +++ stable/9/sys/modules/xenhvm/Makefile Fri Jul 18 18:11:24 2014 (r268853) @@ -13,9 +13,11 @@ SRCS= xenhvm_mod.c \ balloon.c blkfront.c blkback.c control.c netback.c netfront.c \ xenpci.c evtchn.c gnttab.c features.c evtchn_dev.c \ xenbus.c xenbusb.c xenbusb_front.c xenbusb_back.c \ - xenbus_if.c xenbus_if.h xenbusb_if.c xenbusb_if.h \ - xenstore.c xenstore_dev.c -MFILES= xen/xenbus/xenbus_if.m xen/xenbus/xenbusb_if.m + xenbus_if.c xenbus_if.h xenbusb_if.c xenbusb_if.h \ + xenstore.c xenstore_dev.c \ + bus_if.h device_if.h pci_if.h vnode_if.h +MFILES= xen/xenbus/xenbus_if.m xen/xenbus/xenbusb_if.m \ + kern/bus_if.m kern/device_if.m dev/pci/pci_if.m CFLAGS+= -DXENHVM -DMODXENHVM .include From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 20:04:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1F6FDE77; Fri, 18 Jul 2014 20:04:13 +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 0C69C2978; Fri, 18 Jul 2014 20:04:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6IK4C7r059565; Fri, 18 Jul 2014 20:04:12 GMT (envelope-from davidcs@svn.freebsd.org) Received: (from davidcs@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6IK4CS0059556; Fri, 18 Jul 2014 20:04:12 GMT (envelope-from davidcs@svn.freebsd.org) Message-Id: <201407182004.s6IK4CS0059556@svn.freebsd.org> From: David C Somayajulu Date: Fri, 18 Jul 2014 20:04:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268854 - head/sys/dev/bxe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 20:04:13 -0000 Author: davidcs Date: Fri Jul 18 20:04:11 2014 New Revision: 268854 URL: http://svnweb.freebsd.org/changeset/base/268854 Log: Initiate error recovery stats fail to update after 3 retries. Change bxe_panic() ECORE_DBG_BREAK_IF() ECORE_BUG() ECORE_BUG_ON() to panic only if ECORE_STOP_ON_ERROR is defined. MFC after:5 days Modified: head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe.h head/sys/dev/bxe/bxe_stats.c head/sys/dev/bxe/ecore_reg.h head/sys/dev/bxe/ecore_sp.h Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Fri Jul 18 18:11:24 2014 (r268853) +++ head/sys/dev/bxe/bxe.c Fri Jul 18 20:04:11 2014 (r268854) @@ -11471,6 +11471,10 @@ bxe_process_kill(struct bxe_softc *sc, bxe_process_kill_chip_reset(sc, global); mb(); + /* clear errors in PGB */ + if (!CHIP_IS_E1(sc)) + REG_WR(sc, PGLUE_B_REG_LATCHED_ERRORS_CLR, 0x7f); + /* Recover after reset: */ /* MCP */ if (global && bxe_reset_mcp_comp(sc, val)) { Modified: head/sys/dev/bxe/bxe.h ============================================================================== --- head/sys/dev/bxe/bxe.h Fri Jul 18 18:11:24 2014 (r268853) +++ head/sys/dev/bxe/bxe.h Fri Jul 18 20:04:11 2014 (r268854) @@ -2301,11 +2301,20 @@ void ecore_storm_memset_struct(struct bx } \ } while(0) +#ifdef ECORE_STOP_ON_ERROR + #define bxe_panic(sc, msg) \ do { \ panic msg; \ } while (0) +#else + +#define bxe_panic(sc, msg) \ + device_printf((sc)->dev, "%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); + +#endif + #define CATC_TRIGGER(sc, data) REG_WR((sc), 0x2000, (data)); #define CATC_TRIGGER_START(sc) CATC_TRIGGER((sc), 0xcafecafe) Modified: head/sys/dev/bxe/bxe_stats.c ============================================================================== --- head/sys/dev/bxe/bxe_stats.c Fri Jul 18 18:11:24 2014 (r268853) +++ head/sys/dev/bxe/bxe_stats.c Fri Jul 18 20:04:11 2014 (r268854) @@ -1302,7 +1302,10 @@ bxe_stats_update(struct bxe_softc *sc) if (bxe_storm_stats_update(sc)) { if (sc->stats_pending++ == 3) { - bxe_panic(sc, ("storm stats not updated for 3 times\n")); + if (sc->ifnet->if_drv_flags & IFF_DRV_RUNNING) { + atomic_store_rel_long(&sc->chip_tq_flags, CHIP_TQ_REINIT); + taskqueue_enqueue(sc->chip_tq, &sc->chip_tq_task); + } } return; } Modified: head/sys/dev/bxe/ecore_reg.h ============================================================================== --- head/sys/dev/bxe/ecore_reg.h Fri Jul 18 18:11:24 2014 (r268853) +++ head/sys/dev/bxe/ecore_reg.h Fri Jul 18 20:04:11 2014 (r268854) @@ -1039,6 +1039,8 @@ __FBSDID("$FreeBSD$"); 0x942cUL #define PGLUE_B_REG_INTERNAL_PFID_ENABLE_TARGET_READ \ 0x9430UL +#define PGLUE_B_REG_LATCHED_ERRORS_CLR \ + 0x943CUL #define PGLUE_B_REG_PGLUE_B_INT_STS \ 0x9298UL #define PGLUE_B_REG_PGLUE_B_INT_STS_CLR \ Modified: head/sys/dev/bxe/ecore_sp.h ============================================================================== --- head/sys/dev/bxe/ecore_sp.h Fri Jul 18 18:11:24 2014 (r268853) +++ head/sys/dev/bxe/ecore_sp.h Fri Jul 18 20:04:11 2014 (r268854) @@ -223,6 +223,8 @@ ECORE_CRC32_LE(uint32_t seed, uint8_t *m #define ecore_sp_post(_sc, _a, _b, _c, _d) \ bxe_sp_post(_sc, _a, _b, U64_HI(_c), U64_LO(_c), _d) +#ifdef ECORE_STOP_ON_ERROR + #define ECORE_DBG_BREAK_IF(exp) \ do { \ if (__predict_false(exp)) { \ @@ -242,6 +244,20 @@ ECORE_CRC32_LE(uint32_t seed, uint8_t *m } \ } while (0) +#else + +#define ECORE_DBG_BREAK_IF(exp) \ + printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); + +#define ECORE_BUG(exp) \ + printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); + +#define ECORE_BUG_ON(exp) \ + printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); + + +#endif /* #ifdef ECORE_STOP_ON_ERROR */ + #define ECORE_ERR(str, ...) \ BLOGE(sc, "ECORE: " str, ##__VA_ARGS__) From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 20:16:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A0FAE43A; Fri, 18 Jul 2014 20:16:52 +0000 (UTC) Received: from mail-qc0-x22d.google.com (mail-qc0-x22d.google.com [IPv6:2607:f8b0:400d:c01::22d]) (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 3132A2AA6; Fri, 18 Jul 2014 20:16:52 +0000 (UTC) Received: by mail-qc0-f173.google.com with SMTP id c9so3756983qcz.18 for ; Fri, 18 Jul 2014 13:16:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=2QS+sOagHm+26cww5+ZkoB6HErXRw8E75gj7B89VW3c=; b=bgjFzeaubD0Aj7F5mXxJpkg6hPnXLgRMHxYmxbylTza9o1hiBbogdzIZV+M75nn80H 2jGOYaJvdsH3OGs9d2AjgWAhziQdnjyiFm8P+Ff7YleZ/5nxPMmDTXB7cwz14BUgpueq epjtvnQ9o6FPslYEmKI4wexMRe6iCNrwN9XTGney8CrLCgQrDJSXtKgOhz2B+PxIJB2D AfnNcCkzHsAQ2hGpOHA579M4Xwi4ESMfY/pxa0jg2ki5jeqxGyIqeDwsFIjFFSq67UVP 3Umk4suC9a+sWLn4XfJeYnIC+EVsiVcqbCcYZysGjl+r9BwVfGKY2z6oQ+f4dkL4SErc YW1A== MIME-Version: 1.0 X-Received: by 10.224.134.201 with SMTP id k9mr12084809qat.59.1405714611388; Fri, 18 Jul 2014 13:16:51 -0700 (PDT) Sender: carpeddiem@gmail.com Received: by 10.140.50.243 with HTTP; Fri, 18 Jul 2014 13:16:51 -0700 (PDT) In-Reply-To: <201407111238.23391.jhb@freebsd.org> References: <201407111616.s6BGGQFW060195@svn.freebsd.org> <201407111238.23391.jhb@freebsd.org> Date: Fri, 18 Jul 2014 16:16:51 -0400 X-Google-Sender-Auth: JPSRsLTK3UPQ1B_3bXMgwgJiMlY Message-ID: Subject: Re: Phabric IDs / URLs in commits From: Ed Maste To: John Baldwin Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 20:16:52 -0000 On 11 July 2014 12:38, John Baldwin wrote: >> CR: https://phabric.freebsd.org/D312 >> Reviewed by: jilles >> MFC after: 1 week > > Just picking my own commit here as a sample case. > > I think we should be annotating commits with phabricator code reviews in some > way when a change has gone through that review. It is very useful to get back > to the review details from the commit log message in svnweb, etc. FYI, Phabricator's canonical format for this is: Differential Revision: http://phabric.freebsd.org/D312 It will then automatically associate the commit with the review and close the review. See for example LLVM review D4563: Review: http://reviews.llvm.org/D4563 Commit: http://reviews.llvm.org/rL213304 (from LLVM's Phabricator repo browser; LLVM's viewvc seems to be down at the moment.) "Differential Revision" seems a bit unwieldy and "CR" does fit in better with our other tags. But we'll want to teach Phabricator to parse our custom tag if we go that way. From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 20:36:11 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E0DE7B9; Fri, 18 Jul 2014 20:36:11 +0000 (UTC) Received: from thebighonker.lerctr.org (thebighonker.lerctr.org [IPv6:2001:470:1f0f:3ad:223:7dff:fe9e:6e8a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "thebighonker.lerctr.org", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1B3CE2C19; Fri, 18 Jul 2014 20:36:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lerctr.org; s=lerami; h=Message-ID:References:In-Reply-To:Subject:Cc:To:From:Date:Content-Transfer-Encoding:Content-Type:MIME-Version; bh=F0uIIk74fyZ3ChvrhtAnw5S8Y+yOPQ/QkwEE1IYHGVo=; b=Uc2IxlYHdVorn+MDFrD9nOtq0p53siJCPoWsGGKXerNs0lDoeemawJXB0++B8FLEdXZW5ozyXN7HvKemGYce813BtuUEaZfFr5DbUX3GR0k5+GPXIrgGJiNYqMHjVpXX6q+Ggyy1vcynL/ypWaKVYx+BmCLnWykb0JmL4zP0F/0=; Received: from localhost.lerctr.org ([127.0.0.1]:49247 helo=webmail.lerctr.org) by thebighonker.lerctr.org with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.82_1-5b7a7c0-XX (FreeBSD)) (envelope-from ) id 1X8Esx-0006g3-T3; Fri, 18 Jul 2014 15:36:09 -0500 Received: from host.alcatel.com ([198.205.55.139]) by webmail.lerctr.org with HTTP (HTTP/1.1 POST); Fri, 18 Jul 2014 15:36:07 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Fri, 18 Jul 2014 15:36:07 -0500 From: Larry Rosenman To: =?UTF-8?Q?Dag-Erling_Sm=C3=83=C2=B8rgrav?= Subject: Re: svn commit: r268840 - head/usr.sbin/unbound/local-setup In-Reply-To: <201407181233.s6ICXMY9042848@svn.freebsd.org> References: <201407181233.s6ICXMY9042848@svn.freebsd.org> Message-ID: <10526bac1382f78c76281a0613e8ff5f@thebighonker.lerctr.org> X-Sender: ler@lerctr.org User-Agent: Roundcube Webmail/1.0.1 X-Spam-Score: -2.1 (--) X-LERCTR-Spam-Score: -2.1 (--) X-Spam-Report: SpamScore (-2.1/5.0) ALL_TRUSTED=-1, BAYES_00=-1.9, KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001 X-LERCTR-Spam-Report: SpamScore (-2.1/5.0) ALL_TRUSTED=-1, BAYES_00=-1.9, KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, owner-svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 20:36:11 -0000 should this be noted in UPDATING to re-gen the files locally or something? On 2014-07-18 07:33, Dag-Erling Smørgrav wrote: > Author: des > Date: Fri Jul 18 12:33:22 2014 > New Revision: 268840 > URL: http://svnweb.freebsd.org/changeset/base/268840 > > Log: > Use a combination of unblock-lan-zones (r268839) and domain-insecure > to fix reverse lookups on networks using private addresses. > > Modified: > head/usr.sbin/unbound/local-setup/local-unbound-setup.sh > > Modified: head/usr.sbin/unbound/local-setup/local-unbound-setup.sh > ============================================================================== > --- head/usr.sbin/unbound/local-setup/local-unbound-setup.sh Fri Jul > 18 11:32:44 2014 (r268839) > +++ head/usr.sbin/unbound/local-setup/local-unbound-setup.sh Fri Jul > 18 12:33:22 2014 (r268840) > @@ -33,6 +33,7 @@ > user="" > unbound_conf="" > forward_conf="" > +lanzones_conf="" > workdir="" > confdir="" > chrootdir="" > @@ -59,6 +60,7 @@ set_defaults() { > : ${confdir:=${workdir}/conf.d} > : ${unbound_conf:=${workdir}/unbound.conf} > : ${forward_conf:=${workdir}/forward.conf} > + : ${lanzones_conf:=${workdir}/lan-zones.conf} > : ${anchor:=${workdir}/root.key} > : ${pidfile:=/var/run/local_unbound.pid} > : ${resolv_conf:=/etc/resolv.conf} > @@ -73,7 +75,8 @@ set_defaults() { > # > set_chrootdir() { > chrootdir="${workdir}" > - for file in "${unbound_conf}" "${forward_conf}" "${anchor}" ; do > + for file in "${unbound_conf}" "${forward_conf}" \ > + "${lanzones_conf}" "${anchor}" ; do > if [ "${file#${workdir%/}/}" = "${file}" ] ; then > echo "warning: ${file} is outside ${workdir}" >&2 > chrootdir="" > @@ -171,6 +174,7 @@ gen_resolvconf_conf() { > # > gen_forward_conf() { > echo "# Generated by $self" > + echo "# Do not edit this file." > echo "forward-zone:" > echo " name: ." > for forwarder ; do > @@ -183,6 +187,42 @@ gen_forward_conf() { > } > > # > +# Generate lan-zones.conf > +# > +gen_lanzones_conf() { > + echo "# Generated by $self" > + echo "# Do not edit this file." > + echo "server:" > + echo " # Unblock reverse lookups for LAN addresses" > + echo " unblock-lan-zones: yes" > + echo " domain-insecure: 10.in-addr.arpa." > + echo " domain-insecure: 127.in-addr.arpa." > + echo " domain-insecure: 16.172.in-addr.arpa." > + echo " domain-insecure: 17.172.in-addr.arpa." > + echo " domain-insecure: 18.172.in-addr.arpa." > + echo " domain-insecure: 19.172.in-addr.arpa." > + echo " domain-insecure: 20.172.in-addr.arpa." > + echo " domain-insecure: 21.172.in-addr.arpa." > + echo " domain-insecure: 22.172.in-addr.arpa." > + echo " domain-insecure: 23.172.in-addr.arpa." > + echo " domain-insecure: 24.172.in-addr.arpa." > + echo " domain-insecure: 25.172.in-addr.arpa." > + echo " domain-insecure: 26.172.in-addr.arpa." > + echo " domain-insecure: 27.172.in-addr.arpa." > + echo " domain-insecure: 28.172.in-addr.arpa." > + echo " domain-insecure: 29.172.in-addr.arpa." > + echo " domain-insecure: 30.172.in-addr.arpa." > + echo " domain-insecure: 31.172.in-addr.arpa." > + echo " domain-insecure: 168.192.in-addr.arpa." > + echo " domain-insecure: 254.169.in-addr.arpa." > + echo " domain-insecure: d.f.ip6.arpa." > + echo " domain-insecure: 8.e.ip6.arpa." > + echo " domain-insecure: 9.e.ip6.arpa." > + echo " domain-insecure: a.e.ip6.arpa." > + echo " domain-insecure: b.e.ip6.arpa." > +} > + > +# > # Generate unbound.conf > # > gen_unbound_conf() { > @@ -197,6 +237,9 @@ gen_unbound_conf() { > if [ -f "${forward_conf}" ] ; then > echo "include: ${forward_conf}" > fi > + if [ -f "${lanzones_conf}" ] ; then > + echo "include: ${lanzones_conf}" > + fi > if [ -d "${confdir}" ] ; then > echo "include: ${confdir}/*.conf" > fi > @@ -323,6 +366,13 @@ main() { > fi > > # > + # Generate lan-zones.conf. > + # > + local tmp_lanzones_conf=$(mktemp -u "${lanzones_conf}.XXXXX") > + gen_lanzones_conf >"${tmp_lanzones_conf}" > + replace "${lanzones_conf}" "${tmp_lanzones_conf}" > + > + # > # Generate unbound.conf. > # > local tmp_unbound_conf=$(mktemp -u "${unbound_conf}.XXXXX") > _______________________________________________ > svn-src-all@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" -- Larry Rosenman http://www.lerctr.org/~ler Phone: +1 214-642-9640 (c) E-Mail: ler@lerctr.org US Mail: 108 Turvey Cove, Hutto, TX 78634-5688 From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 20:41:42 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EA642B42; Fri, 18 Jul 2014 20:41:42 +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 D4A432CF2; Fri, 18 Jul 2014 20:41:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6IKfgsY077982; Fri, 18 Jul 2014 20:41:42 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6IKffMR077972; Fri, 18 Jul 2014 20:41:41 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407182041.s6IKffMR077972@svn.freebsd.org> From: Xin LI Date: Fri, 18 Jul 2014 20:41:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268855 - in head: cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 20:41:43 -0000 Author: delphij Date: Fri Jul 18 20:41:40 2014 New Revision: 268855 URL: http://svnweb.freebsd.org/changeset/base/268855 Log: MFV r268848: Instead of asserting all zio's be properly aligned, only assert on the logical ones. Cap uberblocks at 8k, otherwise with ashift=17, there would be only one uberblock. This fixes a problem that zdb would trip assert on pools with ashift >= 0xe (8k). While there, also change the code so it only attempt to condense space map unless the uncondensed size consumes greater than zfs_metaslab_condense_block_threshold blocks. Illumos issue: 4958 zdb trips assert on pools with ashift >= 0xe MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Fri Jul 18 20:04:11 2014 (r268854) +++ head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Fri Jul 18 20:41:40 2014 (r268855) @@ -810,7 +810,7 @@ static uint64_t ztest_get_ashift(void) { if (ztest_opts.zo_ashift == 0) - return (SPA_MINBLOCKSHIFT + ztest_random(3)); + return (SPA_MINBLOCKSHIFT + ztest_random(5)); return (ztest_opts.zo_ashift); } @@ -969,11 +969,28 @@ ztest_random_spa_version(uint64_t initia return (version); } +/* + * Find the largest ashift used + */ +static uint64_t +ztest_spa_get_ashift() { + uint64_t i; + uint64_t ashift = SPA_MINBLOCKSHIFT; + vdev_t *rvd = ztest_spa->spa_root_vdev; + + for (i = 0; i < rvd->vdev_children; i++) { + ashift = MAX(ashift, rvd->vdev_child[i]->vdev_ashift); + } + return (ashift); +} + static int ztest_random_blocksize(void) { - return (1 << (SPA_MINBLOCKSHIFT + - ztest_random(SPA_MAXBLOCKSHIFT - SPA_MINBLOCKSHIFT + 1))); + // Choose a block size >= the ashift. + uint64_t block_shift = + ztest_random(SPA_MAXBLOCKSHIFT - ztest_spa_get_ashift() + 1); + return (1 << (SPA_MINBLOCKSHIFT + block_shift)); } static int @@ -5768,16 +5785,30 @@ ztest_freeze(void) spa_freeze(spa); /* + * Because it is hard to predict how much space a write will actually + * require beforehand, we leave ourselves some fudge space to write over + * capacity. + */ + uint64_t capacity = metaslab_class_get_space(spa_normal_class(spa)) / 2; + + /* * Run tests that generate log records but don't alter the pool config * or depend on DSL sync tasks (snapshots, objset create/destroy, etc). * We do a txg_wait_synced() after each iteration to force the txg * to increase well beyond the last synced value in the uberblock. * The ZIL should be OK with that. + * + * Run a random number of times less than zo_maxloops and ensure we do + * not run out of space on the pool. */ while (ztest_random(10) != 0 && - numloops++ < ztest_opts.zo_maxloops) { - ztest_dmu_write_parallel(zd, 0); - ztest_dmu_object_alloc_free(zd, 0); + numloops++ < ztest_opts.zo_maxloops && + metaslab_class_get_alloc(spa_normal_class(spa)) < capacity) { + ztest_od_t od; + ztest_od_init(&od, 0, FTAG, 0, DMU_OT_UINT64_OTHER, 0, 0); + VERIFY0(ztest_object_init(zd, &od, sizeof (od), B_FALSE)); + ztest_io(zd, od.od_object, + ztest_random(ZTEST_RANGE_LOCKS) << SPA_MAXBLOCKSHIFT); txg_wait_synced(spa_get_dsl(spa), 0); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Fri Jul 18 20:04:11 2014 (r268854) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Fri Jul 18 20:41:40 2014 (r268855) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Fri Jul 18 20:04:11 2014 (r268854) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Fri Jul 18 20:41:40 2014 (r268855) @@ -72,6 +72,21 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, condense_ " of in-memory counterpart"); /* + * Condensing a metaslab is not guaranteed to actually reduce the amount of + * space used on disk. In particular, a space map uses data in increments of + * MAX(1 << ashift, SPACE_MAP_INITIAL_BLOCKSIZE), so a metaslab might use the + * same number of blocks after condensing. Since the goal of condensing is to + * reduce the number of IOPs required to read the space map, we only want to + * condense when we can be sure we will reduce the number of blocks used by the + * space map. Unfortunately, we cannot precisely compute whether or not this is + * the case in metaslab_should_condense since we are holding ms_lock. Instead, + * we apply the following heuristic: do not condense a spacemap unless the + * uncondensed size consumes greater than zfs_metaslab_condense_block_threshold + * blocks. + */ +int zfs_metaslab_condense_block_threshold = 4; + +/* * The zfs_mg_noalloc_threshold defines which metaslab groups should * be eligible for allocation. The value is defined as a percentage of * a free space. Metaslab groups that have more free space than @@ -1356,6 +1371,8 @@ metaslab_group_preload(metaslab_group_t * times the size than the free space range tree representation * (i.e. zfs_condense_pct = 110 and in-core = 1MB, minimal = 1.1.MB). * + * 3. The on-disk size of the space map should actually decrease. + * * Checking the first condition is tricky since we don't want to walk * the entire AVL tree calculating the estimated on-disk size. Instead we * use the size-ordered range tree in the metaslab and calculate the @@ -1366,13 +1383,21 @@ metaslab_group_preload(metaslab_group_t * To determine the second criterion we use a best-case estimate and assume * each segment can be represented on-disk as a single 64-bit entry. We refer * to this best-case estimate as the space map's minimal form. + * + * Unfortunately, we cannot compute the on-disk size of the space map in this + * context because we cannot accurately compute the effects of compression, etc. + * Instead, we apply the heuristic described in the block comment for + * zfs_metaslab_condense_block_threshold - we only condense if the space used + * is greater than a threshold number of blocks. */ static boolean_t metaslab_should_condense(metaslab_t *msp) { space_map_t *sm = msp->ms_sm; range_seg_t *rs; - uint64_t size, entries, segsz; + uint64_t size, entries, segsz, object_size, optimal_size, record_size; + dmu_object_info_t doi; + uint64_t vdev_blocksize = 1 << msp->ms_group->mg_vd->vdev_ashift; ASSERT(MUTEX_HELD(&msp->ms_lock)); ASSERT(msp->ms_loaded); @@ -1396,9 +1421,15 @@ metaslab_should_condense(metaslab_t *msp entries = size / (MIN(size, SM_RUN_MAX)); segsz = entries * sizeof (uint64_t); - return (segsz <= space_map_length(msp->ms_sm) && - space_map_length(msp->ms_sm) >= (zfs_condense_pct * - sizeof (uint64_t) * avl_numnodes(&msp->ms_tree->rt_root)) / 100); + optimal_size = sizeof (uint64_t) * avl_numnodes(&msp->ms_tree->rt_root); + object_size = space_map_length(msp->ms_sm); + + dmu_object_info_from_db(sm->sm_dbuf, &doi); + record_size = MAX(doi.doi_data_block_size, vdev_blocksize); + + return (segsz <= object_size && + object_size >= (optimal_size * zfs_condense_pct / 100) && + object_size > zfs_metaslab_condense_block_threshold * record_size); } /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Fri Jul 18 20:04:11 2014 (r268854) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Fri Jul 18 20:41:40 2014 (r268855) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2011, 2014 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright 2013 Martin Matuska . All rights reserved. */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Fri Jul 18 20:04:11 2014 (r268854) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Fri Jul 18 20:41:40 2014 (r268855) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ #ifndef _SYS_VDEV_IMPL_H @@ -253,8 +253,11 @@ struct vdev { #define VDEV_PHYS_SIZE (112 << 10) #define VDEV_UBERBLOCK_RING (128 << 10) +/* The largest uberblock we support is 8k. */ +#define MAX_UBERBLOCK_SHIFT (13) #define VDEV_UBERBLOCK_SHIFT(vd) \ - MAX((vd)->vdev_top->vdev_ashift, UBERBLOCK_SHIFT) + MIN(MAX((vd)->vdev_top->vdev_ashift, UBERBLOCK_SHIFT), \ + MAX_UBERBLOCK_SHIFT) #define VDEV_UBERBLOCK_COUNT(vd) \ (VDEV_UBERBLOCK_RING >> VDEV_UBERBLOCK_SHIFT(vd)) #define VDEV_UBERBLOCK_OFFSET(vd, n) \ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Fri Jul 18 20:04:11 2014 (r268854) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Fri Jul 18 20:41:40 2014 (r268855) @@ -166,19 +166,20 @@ enum zio_flag { ZIO_FLAG_RESILVER = 1 << 3, ZIO_FLAG_SCRUB = 1 << 4, ZIO_FLAG_SCAN_THREAD = 1 << 5, + ZIO_FLAG_PHYSICAL = 1 << 6, #define ZIO_FLAG_AGG_INHERIT (ZIO_FLAG_CANFAIL - 1) /* * Flags inherited by ddt, gang, and vdev children. */ - ZIO_FLAG_CANFAIL = 1 << 6, /* must be first for INHERIT */ - ZIO_FLAG_SPECULATIVE = 1 << 7, - ZIO_FLAG_CONFIG_WRITER = 1 << 8, - ZIO_FLAG_DONT_RETRY = 1 << 9, - ZIO_FLAG_DONT_CACHE = 1 << 10, - ZIO_FLAG_NODATA = 1 << 11, - ZIO_FLAG_INDUCE_DAMAGE = 1 << 12, + ZIO_FLAG_CANFAIL = 1 << 7, /* must be first for INHERIT */ + ZIO_FLAG_SPECULATIVE = 1 << 8, + ZIO_FLAG_CONFIG_WRITER = 1 << 9, + ZIO_FLAG_DONT_RETRY = 1 << 10, + ZIO_FLAG_DONT_CACHE = 1 << 11, + ZIO_FLAG_NODATA = 1 << 12, + ZIO_FLAG_INDUCE_DAMAGE = 1 << 13, #define ZIO_FLAG_DDT_INHERIT (ZIO_FLAG_IO_RETRY - 1) #define ZIO_FLAG_GANG_INHERIT (ZIO_FLAG_IO_RETRY - 1) @@ -186,27 +187,27 @@ enum zio_flag { /* * Flags inherited by vdev children. */ - ZIO_FLAG_IO_RETRY = 1 << 13, /* must be first for INHERIT */ - ZIO_FLAG_PROBE = 1 << 14, - ZIO_FLAG_TRYHARD = 1 << 15, - ZIO_FLAG_OPTIONAL = 1 << 16, + ZIO_FLAG_IO_RETRY = 1 << 14, /* must be first for INHERIT */ + ZIO_FLAG_PROBE = 1 << 15, + ZIO_FLAG_TRYHARD = 1 << 16, + ZIO_FLAG_OPTIONAL = 1 << 17, #define ZIO_FLAG_VDEV_INHERIT (ZIO_FLAG_DONT_QUEUE - 1) /* * Flags not inherited by any children. */ - ZIO_FLAG_DONT_QUEUE = 1 << 17, /* must be first for INHERIT */ - ZIO_FLAG_DONT_PROPAGATE = 1 << 18, - ZIO_FLAG_IO_BYPASS = 1 << 19, - ZIO_FLAG_IO_REWRITE = 1 << 20, - ZIO_FLAG_RAW = 1 << 21, - ZIO_FLAG_GANG_CHILD = 1 << 22, - ZIO_FLAG_DDT_CHILD = 1 << 23, - ZIO_FLAG_GODFATHER = 1 << 24, - ZIO_FLAG_NOPWRITE = 1 << 25, - ZIO_FLAG_REEXECUTED = 1 << 26, - ZIO_FLAG_DELEGATED = 1 << 27, + ZIO_FLAG_DONT_QUEUE = 1 << 18, /* must be first for INHERIT */ + ZIO_FLAG_DONT_PROPAGATE = 1 << 19, + ZIO_FLAG_IO_BYPASS = 1 << 20, + ZIO_FLAG_IO_REWRITE = 1 << 21, + ZIO_FLAG_RAW = 1 << 22, + ZIO_FLAG_GANG_CHILD = 1 << 23, + ZIO_FLAG_DDT_CHILD = 1 << 24, + ZIO_FLAG_GODFATHER = 1 << 25, + ZIO_FLAG_NOPWRITE = 1 << 26, + ZIO_FLAG_REEXECUTED = 1 << 27, + ZIO_FLAG_DELEGATED = 1 << 28, ZIO_FLAG_QUEUE_IO_DONE = 1 << 28, }; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c Fri Jul 18 20:04:11 2014 (r268854) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c Fri Jul 18 20:41:40 2014 (r268855) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ #include @@ -57,7 +57,10 @@ zfs_dbgmsg_fini(void) * echo ::zfs_dbgmsg | mdb -k * * Monitor these messages by running: - * dtrace -q -n 'zfs-dbgmsg{printf("%s\n", stringof(arg0))}' + * dtrace -qn 'zfs-dbgmsg{printf("%s\n", stringof(arg0))}' + * + * When used with libzpool, monitor with: + * dtrace -qn 'zfs$pid::zfs_dbgmsg:probe1{printf("%s\n", copyinstr(arg1))}' */ void zfs_dbgmsg(const char *fmt, ...) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Jul 18 20:04:11 2014 (r268854) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Jul 18 20:41:40 2014 (r268855) @@ -883,8 +883,8 @@ zio_read_phys(zio_t *pio, vdev_t *vd, ui ASSERT3U(offset + size, <=, vd->vdev_psize); zio = zio_create(pio, vd->vdev_spa, 0, NULL, data, size, done, private, - ZIO_TYPE_READ, priority, flags, vd, offset, NULL, - ZIO_STAGE_OPEN, ZIO_READ_PHYS_PIPELINE); + ZIO_TYPE_READ, priority, flags | ZIO_FLAG_PHYSICAL, vd, offset, + NULL, ZIO_STAGE_OPEN, ZIO_READ_PHYS_PIPELINE); zio->io_prop.zp_checksum = checksum; @@ -904,8 +904,8 @@ zio_write_phys(zio_t *pio, vdev_t *vd, u ASSERT3U(offset + size, <=, vd->vdev_psize); zio = zio_create(pio, vd->vdev_spa, 0, NULL, data, size, done, private, - ZIO_TYPE_WRITE, priority, flags, vd, offset, NULL, - ZIO_STAGE_OPEN, ZIO_WRITE_PHYS_PIPELINE); + ZIO_TYPE_WRITE, priority, flags | ZIO_FLAG_PHYSICAL, vd, offset, + NULL, ZIO_STAGE_OPEN, ZIO_WRITE_PHYS_PIPELINE); zio->io_prop.zp_checksum = checksum; @@ -2624,7 +2624,9 @@ zio_vdev_io_start(zio_t **ziop) align = 1ULL << vd->vdev_top->vdev_ashift; - if (P2PHASE(zio->io_size, align) != 0) { + if (!(zio->io_flags & ZIO_FLAG_PHYSICAL) && + P2PHASE(zio->io_size, align) != 0) { + /* Transform logical writes to be a full physical block size. */ uint64_t asize = P2ROUNDUP(zio->io_size, align); char *abuf = NULL; if (zio->io_type == ZIO_TYPE_READ || @@ -2639,8 +2641,22 @@ zio_vdev_io_start(zio_t **ziop) zio_subblock); } - ASSERT(P2PHASE(zio->io_offset, align) == 0); - ASSERT(P2PHASE(zio->io_size, align) == 0); + /* + * If this is not a physical io, make sure that it is properly aligned + * before proceeding. + */ + if (!(zio->io_flags & ZIO_FLAG_PHYSICAL)) { + ASSERT0(P2PHASE(zio->io_offset, align)); + ASSERT0(P2PHASE(zio->io_size, align)); + } else { + /* + * For physical writes, we allow 512b aligned writes and assume + * the device will perform a read-modify-write as necessary. + */ + ASSERT0(P2PHASE(zio->io_offset, SPA_MINBLOCKSIZE)); + ASSERT0(P2PHASE(zio->io_size, SPA_MINBLOCKSIZE)); + } + VERIFY(zio->io_type == ZIO_TYPE_READ || spa_writeable(spa)); /* From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 21:25:06 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3718083A; Fri, 18 Jul 2014 21:25:06 +0000 (UTC) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id BA82A20CE; Fri, 18 Jul 2014 21:25:02 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 2213225D3A81; Fri, 18 Jul 2014 21:24:59 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 2D5D6C230D2; Fri, 18 Jul 2014 21:24:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id 2TDtJ7Um_kLc; Fri, 18 Jul 2014 21:24:55 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:f96b:217e:b03f:e2bd] (unknown [IPv6:fde9:577b:c1a9:4410:f96b:217e:b03f:e2bd]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 4B8B3BF8C2A; Fri, 18 Jul 2014 21:24:53 +0000 (UTC) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r268854 - head/sys/dev/bxe From: "Bjoern A. Zeeb" In-Reply-To: <201407182004.s6IK4CS0059556@svn.freebsd.org> Date: Fri, 18 Jul 2014 21:24:46 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <9A1F428A-45BC-4517-AC2F-9BD807F32B2D@lists.zabbadoz.net> References: <201407182004.s6IK4CS0059556@svn.freebsd.org> To: David C Somayajulu X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 21:25:06 -0000 On 18 Jul 2014, at 20:04 , David C Somayajulu = wrote: > Author: davidcs > Date: Fri Jul 18 20:04:11 2014 > New Revision: 268854 > URL: http://svnweb.freebsd.org/changeset/base/268854 >=20 > Log: > Initiate error recovery stats fail to update after 3 retries. > Change bxe_panic() ECORE_DBG_BREAK_IF() ECORE_BUG() ECORE_BUG_ON() to > panic only if ECORE_STOP_ON_ERROR is defined. >=20 > MFC after:5 days This broke builds: = /scratch/tmp/bz/head.svn/sys/modules/bxe/../../dev/bxe/bxe_stats.c:1305:11= : error: no member named 'ifnet' in 'struct bxe_softc' >=20 > Modified: > head/sys/dev/bxe/bxe.c > head/sys/dev/bxe/bxe.h > head/sys/dev/bxe/bxe_stats.c > head/sys/dev/bxe/ecore_reg.h > head/sys/dev/bxe/ecore_sp.h >=20 > Modified: head/sys/dev/bxe/bxe.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 > --- head/sys/dev/bxe/bxe.c Fri Jul 18 18:11:24 2014 = (r268853) > +++ head/sys/dev/bxe/bxe.c Fri Jul 18 20:04:11 2014 = (r268854) > @@ -11471,6 +11471,10 @@ bxe_process_kill(struct bxe_softc *sc, > bxe_process_kill_chip_reset(sc, global); > mb(); >=20 > + /* clear errors in PGB */ > + if (!CHIP_IS_E1(sc)) > + REG_WR(sc, PGLUE_B_REG_LATCHED_ERRORS_CLR, 0x7f); > + > /* Recover after reset: */ > /* MCP */ > if (global && bxe_reset_mcp_comp(sc, val)) { >=20 > Modified: head/sys/dev/bxe/bxe.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/dev/bxe/bxe.h Fri Jul 18 18:11:24 2014 = (r268853) > +++ head/sys/dev/bxe/bxe.h Fri Jul 18 20:04:11 2014 = (r268854) > @@ -2301,11 +2301,20 @@ void ecore_storm_memset_struct(struct bx > } \ > } while(0) >=20 > +#ifdef ECORE_STOP_ON_ERROR > + > #define bxe_panic(sc, msg) \ > do { \ > panic msg; \ > } while (0) >=20 > +#else > + > +#define bxe_panic(sc, msg) \ > + device_printf((sc)->dev, "%s (%s,%d)\n", __FUNCTION__, __FILE__, = __LINE__); > + > +#endif > + > #define CATC_TRIGGER(sc, data) REG_WR((sc), 0x2000, (data)); > #define CATC_TRIGGER_START(sc) CATC_TRIGGER((sc), 0xcafecafe) >=20 >=20 > Modified: head/sys/dev/bxe/bxe_stats.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 > --- head/sys/dev/bxe/bxe_stats.c Fri Jul 18 18:11:24 2014 = (r268853) > +++ head/sys/dev/bxe/bxe_stats.c Fri Jul 18 20:04:11 2014 = (r268854) > @@ -1302,7 +1302,10 @@ bxe_stats_update(struct bxe_softc *sc) >=20 > if (bxe_storm_stats_update(sc)) { > if (sc->stats_pending++ =3D=3D 3) { > - bxe_panic(sc, ("storm stats not updated for 3 = times\n")); > + if (sc->ifnet->if_drv_flags & IFF_DRV_RUNNING) { > + atomic_store_rel_long(&sc->chip_tq_flags, = CHIP_TQ_REINIT); > + taskqueue_enqueue(sc->chip_tq, = &sc->chip_tq_task); > + } > } > return; > } >=20 > Modified: head/sys/dev/bxe/ecore_reg.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/dev/bxe/ecore_reg.h Fri Jul 18 18:11:24 2014 = (r268853) > +++ head/sys/dev/bxe/ecore_reg.h Fri Jul 18 20:04:11 2014 = (r268854) > @@ -1039,6 +1039,8 @@ __FBSDID("$FreeBSD$"); > 0x942cUL > #define PGLUE_B_REG_INTERNAL_PFID_ENABLE_TARGET_READ \ > 0x9430UL > +#define PGLUE_B_REG_LATCHED_ERRORS_CLR \ > + 0x943CUL > #define PGLUE_B_REG_PGLUE_B_INT_STS \ > 0x9298UL > #define PGLUE_B_REG_PGLUE_B_INT_STS_CLR \ >=20 > Modified: head/sys/dev/bxe/ecore_sp.h > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/dev/bxe/ecore_sp.h Fri Jul 18 18:11:24 2014 = (r268853) > +++ head/sys/dev/bxe/ecore_sp.h Fri Jul 18 20:04:11 2014 = (r268854) > @@ -223,6 +223,8 @@ ECORE_CRC32_LE(uint32_t seed, uint8_t *m > #define ecore_sp_post(_sc, _a, _b, _c, _d) \ > bxe_sp_post(_sc, _a, _b, U64_HI(_c), U64_LO(_c), _d) >=20 > +#ifdef ECORE_STOP_ON_ERROR > + > #define ECORE_DBG_BREAK_IF(exp) \ > do { \ > if (__predict_false(exp)) { \ > @@ -242,6 +244,20 @@ ECORE_CRC32_LE(uint32_t seed, uint8_t *m > } \ > } while (0) >=20 > +#else > + > +#define ECORE_DBG_BREAK_IF(exp) \ > + printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); > + > +#define ECORE_BUG(exp) \ > + printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); > + > +#define ECORE_BUG_ON(exp) \ > + printf("%s (%s,%d)\n", __FUNCTION__, __FILE__, __LINE__); > + > + > +#endif /* #ifdef ECORE_STOP_ON_ERROR */ > + > #define ECORE_ERR(str, ...) \ > BLOGE(sc, "ECORE: " str, ##__VA_ARGS__) >=20 >=20 =97=20 Bjoern A. Zeeb "Come on. Learn, goddamn it.", WarGames, 1983 From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 21:29:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7CA4B9CD; Fri, 18 Jul 2014 21:29:00 +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 6AB9F20F3; Fri, 18 Jul 2014 21:29:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6ILT0rb098259; Fri, 18 Jul 2014 21:29:00 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6ILT0S2098258; Fri, 18 Jul 2014 21:29:00 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407182129.s6ILT0S2098258@svn.freebsd.org> From: Xin LI Date: Fri, 18 Jul 2014 21:29:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268856 - head/sys/dev/bxe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 21:29:00 -0000 Author: delphij Date: Fri Jul 18 21:28:59 2014 New Revision: 268856 URL: http://svnweb.freebsd.org/changeset/base/268856 Log: Fix build by using the driver API (driver converted in r266979 which should be upstreamed). X-MFC with: r268854 MFC after: 5 days Modified: head/sys/dev/bxe/bxe_stats.c Modified: head/sys/dev/bxe/bxe_stats.c ============================================================================== --- head/sys/dev/bxe/bxe_stats.c Fri Jul 18 20:41:40 2014 (r268855) +++ head/sys/dev/bxe/bxe_stats.c Fri Jul 18 21:28:59 2014 (r268856) @@ -1302,7 +1302,7 @@ bxe_stats_update(struct bxe_softc *sc) if (bxe_storm_stats_update(sc)) { if (sc->stats_pending++ == 3) { - if (sc->ifnet->if_drv_flags & IFF_DRV_RUNNING) { + if (if_getdrvflags(sc->ifp) & IFF_DRV_RUNNING) { atomic_store_rel_long(&sc->chip_tq_flags, CHIP_TQ_REINIT); taskqueue_enqueue(sc->chip_tq, &sc->chip_tq_task); } From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 21:29:59 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C3DB4B1E; Fri, 18 Jul 2014 21:29: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 B14ED20FE; Fri, 18 Jul 2014 21:29:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6ILTxRu098437; Fri, 18 Jul 2014 21:29:59 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6ILTxxI098436; Fri, 18 Jul 2014 21:29:59 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201407182129.s6ILTxxI098436@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 18 Jul 2014 21:29:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268857 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 21:29:59 -0000 Author: jilles Date: Fri Jul 18 21:29:59 2014 New Revision: 268857 URL: http://svnweb.freebsd.org/changeset/base/268857 Log: ttyname(3): Fix EBADF/ENOTTY error descriptions. Also, make sure to document the return values and errors for all three functions in the man page. PR: 191931 MFC after: 1 week Modified: head/lib/libc/gen/ttyname.3 Modified: head/lib/libc/gen/ttyname.3 ============================================================================== --- head/lib/libc/gen/ttyname.3 Fri Jul 18 21:28:59 2014 (r268856) +++ head/lib/libc/gen/ttyname.3 Fri Jul 18 21:29:59 2014 (r268857) @@ -28,7 +28,7 @@ .\" @(#)ttyname.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd May 14, 2005 +.Dd July 18, 2014 .Dt TTYNAME 3 .Os .Sh NAME @@ -76,6 +76,14 @@ function takes a buffer and length as arguments to avoid this problem. .Sh RETURN VALUES The +.Fn isatty +function returns 1 if +.Fa fd +refers to a terminal type device; +otherwise, it returns 0 and may set +.Va errno +to indicate the error. +The .Fn ttyname function returns the null terminated name if the device is found and @@ -89,15 +97,23 @@ The function returns 0 if successful. Otherwise an error number is returned. .Sh ERRORS -The -.Fn ttyname_r -may fail and return the following error codes: +These functions may fail if: .Bl -tag -width Er -.It Bq Er ENOTTY +.It Bq Er EBADF The .Fa fd argument is not a valid file descriptor. +.It Bq Er ENOTTY +The file associated with +.Fa fd +is not a terminal. +.El +.Pp +Additionally, +.Fn ttyname_r +may fail if: +.Bl -tag -width Er .It Bq Er ERANGE The .Fa bufsize From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 22:04:22 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B36D14F8; Fri, 18 Jul 2014 22:04:22 +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 95A63245F; Fri, 18 Jul 2014 22:04:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6IM4M9p017579; Fri, 18 Jul 2014 22:04:22 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6IM4Mex017576; Fri, 18 Jul 2014 22:04:22 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407182204.s6IM4Mex017576@svn.freebsd.org> From: Xin LI Date: Fri, 18 Jul 2014 22:04:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268858 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 22:04:22 -0000 Author: delphij Date: Fri Jul 18 22:04:21 2014 New Revision: 268858 URL: http://svnweb.freebsd.org/changeset/base/268858 Log: MFV r268850: Change the interaction between the DMU and ARC so that when the DMU is shutting down an objset, we do not evict the data from the ARC. Instead we simply coordinate the destruction of the DMU's data with the ARC. The only case where we actually need to explicitly evict from the ARC is when dbuf_rele_and_unlock() determines that the administrator has requested that it not be kept in memory, via the primarycache/secondarycache properties. In this case, we evict the data from the ARC by its blkptr_t, the same way as when a block is freed we explicitly evict it from the ARC. Illumos issue: 4631 zvol_get_stats triggering too many reads MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Jul 18 21:29:59 2014 (r268857) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Jul 18 22:04:21 2014 (r268858) @@ -104,7 +104,7 @@ * with the buffer may be evicted prior to the callback. The callback * must be made with *no locks held* (to prevent deadlock). Additionally, * the users of callbacks must ensure that their private data is - * protected from simultaneous callbacks from arc_buf_evict() + * protected from simultaneous callbacks from arc_clear_callback() * and arc_do_user_evicts(). * * Note that the majority of the performance stats are manipulated @@ -1645,8 +1645,12 @@ arc_buf_data_free(arc_buf_t *buf, void ( } } +/* + * Free up buf->b_data and if 'remove' is set, then pull the + * arc_buf_t off of the the arc_buf_hdr_t's list and free it. + */ static void -arc_buf_destroy(arc_buf_t *buf, boolean_t recycle, boolean_t all) +arc_buf_destroy(arc_buf_t *buf, boolean_t recycle, boolean_t remove) { arc_buf_t **bufp; @@ -1699,7 +1703,7 @@ arc_buf_destroy(arc_buf_t *buf, boolean_ } /* only remove the buf if requested */ - if (!all) + if (!remove) return; /* remove the buf from the hdr list */ @@ -2353,7 +2357,7 @@ restart: mutex_exit(&buf->b_evict_lock); if (buf->b_efunc != NULL) - VERIFY(buf->b_efunc(buf) == 0); + VERIFY0(buf->b_efunc(buf->b_private)); buf->b_efunc = NULL; buf->b_private = NULL; @@ -3488,16 +3492,25 @@ arc_freed(spa_t *spa, const blkptr_t *bp } /* - * This is used by the DMU to let the ARC know that a buffer is - * being evicted, so the ARC should clean up. If this arc buf - * is not yet in the evicted state, it will be put there. + * Clear the user eviction callback set by arc_set_callback(), first calling + * it if it exists. Because the presence of a callback keeps an arc_buf cached + * clearing the callback may result in the arc_buf being destroyed. However, + * it will not result in the *last* arc_buf being destroyed, hence the data + * will remain cached in the ARC. We make a copy of the arc buffer here so + * that we can process the callback without holding any locks. + * + * It's possible that the callback is already in the process of being cleared + * by another thread. In this case we can not clear the callback. + * + * Returns B_TRUE if the callback was successfully called and cleared. */ -int -arc_buf_evict(arc_buf_t *buf) +boolean_t +arc_clear_callback(arc_buf_t *buf) { arc_buf_hdr_t *hdr; kmutex_t *hash_lock; - arc_buf_t **bufp; + arc_evict_func_t *efunc = buf->b_efunc; + void *private = buf->b_private; list_t *list, *evicted_list; kmutex_t *lock, *evicted_lock; @@ -3509,17 +3522,16 @@ arc_buf_evict(arc_buf_t *buf) */ ASSERT(buf->b_data == NULL); mutex_exit(&buf->b_evict_lock); - return (0); + return (B_FALSE); } else if (buf->b_data == NULL) { - arc_buf_t copy = *buf; /* structure assignment */ /* * We are on the eviction list; process this buffer now * but let arc_do_user_evicts() do the reaping. */ buf->b_efunc = NULL; mutex_exit(&buf->b_evict_lock); - VERIFY(copy.b_efunc(©) == 0); - return (1); + VERIFY0(efunc(private)); + return (B_TRUE); } hash_lock = HDR_LOCK(hdr); mutex_enter(hash_lock); @@ -3529,50 +3541,21 @@ arc_buf_evict(arc_buf_t *buf) ASSERT3U(refcount_count(&hdr->b_refcnt), <, hdr->b_datacnt); ASSERT(hdr->b_state == arc_mru || hdr->b_state == arc_mfu); - /* - * Pull this buffer off of the hdr - */ - bufp = &hdr->b_buf; - while (*bufp != buf) - bufp = &(*bufp)->b_next; - *bufp = buf->b_next; - - ASSERT(buf->b_data != NULL); - arc_buf_destroy(buf, FALSE, FALSE); - - if (hdr->b_datacnt == 0) { - arc_state_t *old_state = hdr->b_state; - arc_state_t *evicted_state; - - ASSERT(hdr->b_buf == NULL); - ASSERT(refcount_is_zero(&hdr->b_refcnt)); - - evicted_state = - (old_state == arc_mru) ? arc_mru_ghost : arc_mfu_ghost; - - get_buf_info(hdr, old_state, &list, &lock); - get_buf_info(hdr, evicted_state, &evicted_list, &evicted_lock); - mutex_enter(lock); - mutex_enter(evicted_lock); - - arc_change_state(evicted_state, hdr, hash_lock); - ASSERT(HDR_IN_HASH_TABLE(hdr)); - hdr->b_flags |= ARC_IN_HASH_TABLE; - hdr->b_flags &= ~ARC_BUF_AVAILABLE; + buf->b_efunc = NULL; + buf->b_private = NULL; - mutex_exit(evicted_lock); - mutex_exit(lock); + if (hdr->b_datacnt > 1) { + mutex_exit(&buf->b_evict_lock); + arc_buf_destroy(buf, FALSE, TRUE); + } else { + ASSERT(buf == hdr->b_buf); + hdr->b_flags |= ARC_BUF_AVAILABLE; + mutex_exit(&buf->b_evict_lock); } - mutex_exit(hash_lock); - mutex_exit(&buf->b_evict_lock); - VERIFY(buf->b_efunc(buf) == 0); - buf->b_efunc = NULL; - buf->b_private = NULL; - buf->b_hdr = NULL; - buf->b_next = NULL; - kmem_cache_free(buf_cache, buf); - return (1); + mutex_exit(hash_lock); + VERIFY0(efunc(private)); + return (B_TRUE); } /* @@ -3722,17 +3705,6 @@ arc_released(arc_buf_t *buf) return (released); } -int -arc_has_callback(arc_buf_t *buf) -{ - int callback; - - mutex_enter(&buf->b_evict_lock); - callback = (buf->b_efunc != NULL); - mutex_exit(&buf->b_evict_lock); - return (callback); -} - #ifdef ZFS_DEBUG int arc_referenced(arc_buf_t *buf) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Fri Jul 18 21:29:59 2014 (r268857) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Fri Jul 18 22:04:21 2014 (r268858) @@ -181,8 +181,7 @@ dbuf_hash_insert(dmu_buf_impl_t *db) } /* - * Remove an entry from the hash table. This operation will - * fail if there are any existing holds on the db. + * Remove an entry from the hash table. It must be in the EVICTING state. */ static void dbuf_hash_remove(dmu_buf_impl_t *db) @@ -194,7 +193,7 @@ dbuf_hash_remove(dmu_buf_impl_t *db) dmu_buf_impl_t *dbf, **dbp; /* - * We musn't hold db_mtx to maintin lock ordering: + * We musn't hold db_mtx to maintain lock ordering: * DBUF_HASH_MUTEX > db_mtx. */ ASSERT(refcount_is_zero(&db->db_holds)); @@ -431,7 +430,6 @@ static void dbuf_set_data(dmu_buf_impl_t *db, arc_buf_t *buf) { ASSERT(MUTEX_HELD(&db->db_mtx)); - ASSERT(db->db_buf == NULL || !arc_has_callback(db->db_buf)); db->db_buf = buf; if (buf != NULL) { ASSERT(buf->b_data != NULL); @@ -1544,12 +1542,15 @@ dbuf_assign_arcbuf(dmu_buf_impl_t *db, a * when we are not holding the dn_dbufs_mtx, we can't clear the * entry in the dn_dbufs list. We have to wait until dbuf_destroy() * in this case. For callers from the DMU we will usually see: - * dbuf_clear()->arc_buf_evict()->dbuf_do_evict()->dbuf_destroy() + * dbuf_clear()->arc_clear_callback()->dbuf_do_evict()->dbuf_destroy() * For the arc callback, we will usually see: * dbuf_do_evict()->dbuf_clear();dbuf_destroy() * Sometimes, though, we will get a mix of these two: - * DMU: dbuf_clear()->arc_buf_evict() + * DMU: dbuf_clear()->arc_clear_callback() * ARC: dbuf_do_evict()->dbuf_destroy() + * + * This routine will dissociate the dbuf from the arc, by calling + * arc_clear_callback(), but will not evict the data from the ARC. */ void dbuf_clear(dmu_buf_impl_t *db) @@ -1557,7 +1558,7 @@ dbuf_clear(dmu_buf_impl_t *db) dnode_t *dn; dmu_buf_impl_t *parent = db->db_parent; dmu_buf_impl_t *dndb; - int dbuf_gone = FALSE; + boolean_t dbuf_gone = B_FALSE; ASSERT(MUTEX_HELD(&db->db_mtx)); ASSERT(refcount_is_zero(&db->db_holds)); @@ -1603,7 +1604,7 @@ dbuf_clear(dmu_buf_impl_t *db) } if (db->db_buf) - dbuf_gone = arc_buf_evict(db->db_buf); + dbuf_gone = arc_clear_callback(db->db_buf); if (!dbuf_gone) mutex_exit(&db->db_mtx); @@ -1771,8 +1772,7 @@ dbuf_create(dnode_t *dn, uint8_t level, static int dbuf_do_evict(void *private) { - arc_buf_t *buf = private; - dmu_buf_impl_t *db = buf->b_private; + dmu_buf_impl_t *db = private; if (!MUTEX_HELD(&db->db_mtx)) mutex_enter(&db->db_mtx); @@ -2135,11 +2135,23 @@ dbuf_rele_and_unlock(dmu_buf_impl_t *db, * block on-disk. If so, then we simply evict * ourselves. */ - if (!DBUF_IS_CACHEABLE(db) || - arc_buf_eviction_needed(db->db_buf)) + if (!DBUF_IS_CACHEABLE(db)) { + if (db->db_blkptr != NULL && + !BP_IS_HOLE(db->db_blkptr) && + !BP_IS_EMBEDDED(db->db_blkptr)) { + spa_t *spa = + dmu_objset_spa(db->db_objset); + blkptr_t bp = *db->db_blkptr; + dbuf_clear(db); + arc_freed(spa, &bp); + } else { + dbuf_clear(db); + } + } else if (arc_buf_eviction_needed(db->db_buf)) { dbuf_clear(db); - else + } else { mutex_exit(&db->db_mtx); + } } } else { mutex_exit(&db->db_mtx); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Fri Jul 18 21:29:59 2014 (r268857) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Fri Jul 18 22:04:21 2014 (r268858) @@ -95,7 +95,6 @@ boolean_t arc_buf_remove_ref(arc_buf_t * int arc_buf_size(arc_buf_t *buf); void arc_release(arc_buf_t *buf, void *tag); int arc_released(arc_buf_t *buf); -int arc_has_callback(arc_buf_t *buf); void arc_buf_freeze(arc_buf_t *buf); void arc_buf_thaw(arc_buf_t *buf); boolean_t arc_buf_eviction_needed(arc_buf_t *buf); @@ -114,7 +113,7 @@ zio_t *arc_write(zio_t *pio, spa_t *spa, void arc_freed(spa_t *spa, const blkptr_t *bp); void arc_set_callback(arc_buf_t *buf, arc_evict_func_t *func, void *priv); -int arc_buf_evict(arc_buf_t *buf); +boolean_t arc_clear_callback(arc_buf_t *buf); void arc_flush(spa_t *spa); void arc_tempreserve_clear(uint64_t reserve); From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 22:34:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D7E74BB0; Fri, 18 Jul 2014 22:34:02 +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 C44B126CF; Fri, 18 Jul 2014 22:34:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6IMY2Lx032560; Fri, 18 Jul 2014 22:34:02 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6IMY1L6032552; Fri, 18 Jul 2014 22:34:01 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407182234.s6IMY1L6032552@svn.freebsd.org> From: Xin LI Date: Fri, 18 Jul 2014 22:34:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268859 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 22:34:02 -0000 Author: delphij Date: Fri Jul 18 22:34:01 2014 New Revision: 268859 URL: http://svnweb.freebsd.org/changeset/base/268859 Log: MFV r268851: When a sync task is waiting for a txg to complete, we should hurry it along by increasing the number of outstanding async writes (i.e. make vdev_queue_max_async_writes() return a larger number). Illumos issue: 4753 increase number of outstanding async writes when sync task is waiting MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Fri Jul 18 22:04:21 2014 (r268858) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Fri Jul 18 22:34:01 2014 (r268859) @@ -1932,6 +1932,16 @@ spa_writeable(spa_t *spa) return (!!(spa->spa_mode & FWRITE)); } +/* + * Returns true if there is a pending sync task in any of the current + * syncing txg, the current quiescing txg, or the current open txg. + */ +boolean_t +spa_has_pending_synctask(spa_t *spa) +{ + return (!txg_all_lists_empty(&spa->spa_dsl_pool->dp_sync_tasks)); +} + int spa_mode(spa_t *spa) { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Fri Jul 18 22:04:21 2014 (r268858) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Fri Jul 18 22:34:01 2014 (r268859) @@ -800,6 +800,7 @@ extern uint64_t bp_get_dsize(spa_t *spa, extern boolean_t spa_has_slogs(spa_t *spa); extern boolean_t spa_is_root(spa_t *spa); extern boolean_t spa_writeable(spa_t *spa); +extern boolean_t spa_has_pending_synctask(spa_t *spa); extern int spa_mode(spa_t *spa); extern uint64_t zfs_strtonum(const char *str, char **nptr); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg.h Fri Jul 18 22:04:21 2014 (r268858) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg.h Fri Jul 18 22:34:01 2014 (r268859) @@ -23,7 +23,7 @@ * Use is subject to license terms. */ /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ #ifndef _SYS_TXG_H @@ -112,6 +112,7 @@ extern boolean_t txg_sync_waiting(struct extern void txg_list_create(txg_list_t *tl, size_t offset); extern void txg_list_destroy(txg_list_t *tl); extern boolean_t txg_list_empty(txg_list_t *tl, uint64_t txg); +extern boolean_t txg_all_lists_empty(txg_list_t *tl); extern boolean_t txg_list_add(txg_list_t *tl, void *p, uint64_t txg); extern boolean_t txg_list_add_tail(txg_list_t *tl, void *p, uint64_t txg); extern void *txg_list_remove(txg_list_t *tl, uint64_t txg); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Fri Jul 18 22:04:21 2014 (r268858) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Fri Jul 18 22:34:01 2014 (r268859) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Portions Copyright 2011 Martin Matuska - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ #include @@ -726,6 +726,24 @@ txg_list_empty(txg_list_t *tl, uint64_t } /* + * Returns true if all txg lists are empty. + * + * Warning: this is inherently racy (an item could be added immediately after this + * function returns). We don't bother with the lock because it wouldn't change the + * semantics. + */ +boolean_t +txg_all_lists_empty(txg_list_t *tl) +{ + for (int i = 0; i < TXG_SIZE; i++) { + if (!txg_list_empty(tl, i)) { + return (B_FALSE); + } + } + return (B_TRUE); +} + +/* * Add an entry to the list (unless it's already on the list). * Returns B_TRUE if it was actually added. */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Fri Jul 18 22:04:21 2014 (r268858) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Fri Jul 18 22:34:01 2014 (r268859) @@ -24,7 +24,7 @@ */ /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2014 by Delphix. All rights reserved. */ #include @@ -416,14 +416,23 @@ vdev_queue_class_min_active(zio_priority } static int -vdev_queue_max_async_writes(uint64_t dirty) +vdev_queue_max_async_writes(spa_t *spa) { int writes; + uint64_t dirty = spa->spa_dsl_pool->dp_dirty_total; uint64_t min_bytes = zfs_dirty_data_max * zfs_vdev_async_write_active_min_dirty_percent / 100; uint64_t max_bytes = zfs_dirty_data_max * zfs_vdev_async_write_active_max_dirty_percent / 100; + /* + * Sync tasks correspond to interactive user actions. To reduce the + * execution time of those actions we push data out as fast as possible. + */ + if (spa_has_pending_synctask(spa)) { + return (zfs_vdev_async_write_max_active); + } + if (dirty < min_bytes) return (zfs_vdev_async_write_min_active); if (dirty > max_bytes) @@ -456,8 +465,7 @@ vdev_queue_class_max_active(spa_t *spa, case ZIO_PRIORITY_ASYNC_READ: return (zfs_vdev_async_read_max_active); case ZIO_PRIORITY_ASYNC_WRITE: - return (vdev_queue_max_async_writes( - spa->spa_dsl_pool->dp_dirty_total)); + return (vdev_queue_max_async_writes(spa)); case ZIO_PRIORITY_SCRUB: return (zfs_vdev_scrub_max_active); case ZIO_PRIORITY_TRIM: From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 22:44:16 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6160F99; Fri, 18 Jul 2014 22:44:16 +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 4DE9727C0; Fri, 18 Jul 2014 22:44:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6IMiGOe037495; Fri, 18 Jul 2014 22:44:16 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6IMiF0W037493; Fri, 18 Jul 2014 22:44:15 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201407182244.s6IMiF0W037493@svn.freebsd.org> From: Devin Teske Date: Fri, 18 Jul 2014 22:44:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268860 - head/usr.sbin/sysrc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 22:44:16 -0000 Author: dteske Date: Fri Jul 18 22:44:15 2014 New Revision: 268860 URL: http://svnweb.freebsd.org/changeset/base/268860 Log: Minor enhancements, bug fixes, and man-page adjustments. + Make `sysrc -x foo' produce error status if foo is unset. NB: Reported by lme (everything else ``while I'm at it'') + Remove mention of SYSRC_VERBOSE from `sysrc --help' output. NB: False documentation leftover from an ancient precursor. + Make `sysrc -qc foo' work the same as `sysrc -ic foo' when foo is unset NB: For syntax convenience (my fingers know `-q' more than `-i'). + Update description of `-c' flag in help message/manual. + Update description of `-q' flag in help message/manual. + Make `sysrc -vc foo' work as documented in the manual NB: Show message stating whether foo is currently set. + Make `sysrc -vc foo=1' work as documented in the manual NB: Show message stating how value of foo would be changed (if at all). + Remove odd usage of parentheses in `-R dir' section of manual. + Clarify syntax section of manual w/respect to sysctl(8) similarities. + Add new/missing people to the `THANKS TO' section of the manual. Reported by: lme MFC after: 3 days X-MFC-to: stable/10, stable/9, ports Modified: head/usr.sbin/sysrc/sysrc head/usr.sbin/sysrc/sysrc.8 Modified: head/usr.sbin/sysrc/sysrc ============================================================================== --- head/usr.sbin/sysrc/sysrc Fri Jul 18 22:34:01 2014 (r268859) +++ head/usr.sbin/sysrc/sysrc Fri Jul 18 22:44:15 2014 (r268860) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2010-2013 Devin Teske +# Copyright (c) 2010-2014 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -40,7 +40,7 @@ BSDCFG_SHARE="/usr/share/bsdconfig" # # Version information # -SYSRC_VERSION="6.0 Nov-07,2013" +SYSRC_VERSION="6.1 Jul-18,2014" # # Options @@ -102,7 +102,7 @@ help() f_err "$optfmt" "-A" \ "Dump a list of all configuration variables (incl. defaults)." f_err "$optfmt" "-c" \ - "Check. Return success if no changes needed, else error." + "Check. Return success if set or no changes, else error." f_err "$optfmt" "-d" \ "Print a description of the given variable." f_err "$optfmt" "-D" \ @@ -134,7 +134,7 @@ help() f_err "$optfmt" "-N" \ "Show only variable names, not their values." f_err "$optfmt" "-q" \ - "Quiet. Ignore previous \`-v' and/or SYSRC_VERBOSE." + "Quiet. Disable verbose and hide certain errors." f_err "$optfmt" "-R dir" \ "Operate within the root directory \`dir' rather than \`/'." f_err "$optfmt" "-v" \ @@ -152,8 +152,6 @@ help() "Override default rc_conf_files (even if set to NULL)." f_err "$envfmt" "RC_DEFAULTS" \ "Location of \`/etc/defaults/rc.conf' file." - f_err "$envfmt" "SYSRC_VERBOSE" \ - "Default verbosity. Set to non-NULL to enable." die } @@ -527,7 +525,7 @@ fi # # Process command-line arguments # -costatus=$SUCCESS +status=$SUCCESS while [ $# -gt 0 ]; do NAME="${1%%=*}" @@ -558,7 +556,7 @@ while [ $# -gt 0 ]; do # desire to set some value # if [ "$DELETE" ]; then - f_sysrc_delete "$NAME" + f_sysrc_delete "$NAME" || status=$FAILURE shift 1 continue fi @@ -568,10 +566,23 @@ while [ $# -gt 0 ]; do # if [ "$CHECK_ONLY" ]; then if ! IGNORED=$( f_sysrc_get "$NAME?" ); then - costatus=$FAILURE - else - value=$( f_sysrc_get "$NAME" ) - [ "$value" = "${1#*=}" ] || costatus=$FAILURE + status=$FAILURE + [ "$SYSRC_VERBOSE" ] && + echo "$NAME: not currently set" + shift 1 + continue + fi + value=$( f_sysrc_get "$NAME" ) + if [ "$value" != "${1#*=}" ]; then + status=$FAILURE + if [ "$SYSRC_VERBOSE" ]; then + echo -n "$( f_sysrc_find "$NAME" ): " + echo -n "$NAME: would change from " + echo "\`$value' to \`${1#*=}'" + fi + elif [ "$SYSRC_VERBOSE" ]; then + echo -n "$( f_sysrc_find "$NAME" ): " + echo "$NAME: already set to \`$value'" fi shift 1 continue @@ -604,10 +615,10 @@ while [ $# -gt 0 ]; do ;; *) if ! IGNORED=$( f_sysrc_get "$NAME?" ); then - [ "$IGNORE_UNKNOWNS" ] || + [ "$IGNORE_UNKNOWNS" -o "$QUIET" ] || echo "$pgm: unknown variable '$NAME'" shift 1 - costatus=$FAILURE + status=$FAILURE continue fi @@ -631,7 +642,7 @@ while [ $# -gt 0 ]; do # If `-x' or `-X' is passed, delete the variable # if [ "$DELETE" ]; then - f_sysrc_delete "$NAME" + f_sysrc_delete "$NAME" || status=$FAILURE shift 1 continue fi @@ -667,7 +678,7 @@ while [ $# -gt 0 ]; do shift 1 done -[ ! "$CHECK_ONLY" ] || exit $costatus +exit $status # $SUCCESS unless error occurred with either `-c' or `-x' ################################################################################ # END Modified: head/usr.sbin/sysrc/sysrc.8 ============================================================================== --- head/usr.sbin/sysrc/sysrc.8 Fri Jul 18 22:34:01 2014 (r268859) +++ head/usr.sbin/sysrc/sysrc.8 Fri Jul 18 22:44:15 2014 (r268860) @@ -58,11 +58,14 @@ Dump a list of all non-default configura Dump a list of all configuration variables .Pq incl. defaults . .It Fl c -Check if the value will change when assigning a new value. +Check only. +For querying, return success if all requested variables are set +.Pq even if NULL , +otherwise return error status. +For assignments, return success if no changes are required, otherwise failure. If verbose .Pq see Dq Fl v -prints a message stating whether a change would occur. -Exits with success if no change is necessary, else returns error status. +prints a message stating whether variables are set and/or changes are required. .It Fl d Print a description of the given variable. .It Fl D @@ -108,14 +111,12 @@ Show only variable values, not their nam Show only variable names, not their values. .It Fl q Quiet. -Ignore previous occurrences of -.Fl v -flag. +Disable verbose and hide certain errors. .It Fl R Ar dir Operate within the root directory -.Pq Sq Ar dir +.Sq Ar dir rather than -.Pq Sq / . +.Sq / . .It Fl v Verbose. Print the pathname of the specific @@ -127,13 +128,13 @@ Print version information to stdout and Remove variable(s) from specified file(s). .El .Pp -This utility works similar to +This utility has a similar syntax to .Xr sysctl 8 . It shares the `-e' and `-n' options .Pq detailed above and also has the same .Ql name[=value] -syntax for querying/setting configuration options. +syntax for making queries/assignments. .Pp However, while .Xr sysctl 8 @@ -304,5 +305,5 @@ utility first appeared in .An Devin Teske Aq Mt dteske@FreeBSD.org .Sh THANKS TO Brandon Gooch, Garrett Cooper, Julian Elischer, Pawel Jakub Dawidek, -Cyrille Lefevre, Ross West, Stefan Esser, Marco Steinbach, and Jilles Tjoelker -for suggestions and help. +Cyrille Lefevre, Ross West, Stefan Esser, Marco Steinbach, Jilles Tjoelker, +Allan Jude, and Lars Engels for suggestions, help, and testing. From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 22:57:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 07F9B4AB; Fri, 18 Jul 2014 22:57:00 +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 CFEED28C6; Fri, 18 Jul 2014 22:56:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6IMux8E042653; Fri, 18 Jul 2014 22:56:59 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6IMuxoK042652; Fri, 18 Jul 2014 22:56:59 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201407182256.s6IMuxoK042652@svn.freebsd.org> From: Baptiste Daroussin Date: Fri, 18 Jul 2014 22:56:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268861 - head/usr.bin/timeout X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 22:57:00 -0000 Author: bapt Date: Fri Jul 18 22:56:59 2014 New Revision: 268861 URL: http://svnweb.freebsd.org/changeset/base/268861 Log: Improve timeout(1) man page Document the exit values and the duration format Improve wording Pet mandoc -Tlint Sort SEE ALSO Phabric: https://phabric.freebsd.org/D432 Reviewed by: wblock Modified: head/usr.bin/timeout/timeout.1 Modified: head/usr.bin/timeout/timeout.1 ============================================================================== --- head/usr.bin/timeout/timeout.1 Fri Jul 18 22:44:15 2014 (r268860) +++ head/usr.bin/timeout/timeout.1 Fri Jul 18 22:56:59 2014 (r268861) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2014 +.Dd July 19, 2014 .Dt TIMEOUT 1 .Os .Sh NAME @@ -44,9 +44,15 @@ starts the .Ar command with its -.Ar args -and kills if it is still runs after -.Ar duration . +.Ar args. +If +.Ar command +is still running after +.Ar duration , +it is killed. +By default, +.Ar SIGTERM. +is sent. .Bl -tag -width "-k time, --kill-after time" .It Fl -preserve-status Always exits with the same status as @@ -57,14 +63,52 @@ Do not propagate timeout to the .Ar command children. .It Fl s Ar sig , Fl -signal Ar sig -Speficy the signal to send on timeout by default +Specify the signal to send on timeout. +By default, .Ar SIGTERM . +is sent. .It Fl k Ar time , Fl -kill-after Ar time -Send a second kill if the +Send a second kill signal if .Ar command is still running after .Ar time -seconds after the first signal was sent +after the first signal was sent. +.El +.Sh DURATION FORMAT +.Ar duration +and +.Ar time +can be integer or decimal numbers. +Values without unit symbols are interpreted as seconds. +.Pp +Supported unit symbols are: +.Bl -tag -width indent -compact +.It s +seconds +.It m +minutes +.It h +hours +.It d +days +.El +.Sh EXIT STATUS +If the timeout was not reached, the exit status of +.Ar command +is returned. +.Pp +If the timeout was reached and +.Fl -preserve-status +is set, the exit status of +.Ar command +is returned. +If +.Fl -preserve-status +is not set, an exit status of 124 is returned. +.Pp +If +.Ar command +exits after receiving a signal, the exit status returned is the signal number plus 128. .Sh SEE ALSO -.Xr signal 3 , -.Xr kill 1 +.Xr kill 1 , +.Xr signal 3 From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 23:04:28 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70887817; Fri, 18 Jul 2014 23:04:28 +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 5E17C2985; Fri, 18 Jul 2014 23:04:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6IN4S8r047181; Fri, 18 Jul 2014 23:04:28 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6IN4SiU047180; Fri, 18 Jul 2014 23:04:28 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201407182304.s6IN4SiU047180@svn.freebsd.org> From: Baptiste Daroussin Date: Fri, 18 Jul 2014 23:04:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268862 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 23:04:28 -0000 Author: bapt Date: Fri Jul 18 23:04:27 2014 New Revision: 268862 URL: http://svnweb.freebsd.org/changeset/base/268862 Log: Add libsbuf.so.6 to obsolete libraries since it has been bumped to .so.7 Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Jul 18 22:56:59 2014 (r268861) +++ head/ObsoleteFiles.inc Fri Jul 18 23:04:27 2014 (r268862) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20140719: libsbuf version bump +OLD_LIBS+=lib/libsbuf.so.6 # 20140718: Remove obsolete man pages OLD_FILES+=usr/share/man/man9/zero_copy.9.gz OLD_FILES+=usr/share/man/man9/zero_copy_sockets.9.gz From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 23:23:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7DEDB69; Fri, 18 Jul 2014 23:23:52 +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 954592B25; Fri, 18 Jul 2014 23:23:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6INNqo2056640; Fri, 18 Jul 2014 23:23:52 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6INNqFc056639; Fri, 18 Jul 2014 23:23:52 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201407182323.s6INNqFc056639@svn.freebsd.org> From: Devin Teske Date: Fri, 18 Jul 2014 23:23:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268863 - head/usr.sbin/sysrc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 23:23:52 -0000 Author: dteske Date: Fri Jul 18 23:23:52 2014 New Revision: 268863 URL: http://svnweb.freebsd.org/changeset/base/268863 Log: Oops, forgot to bump manual date/copyright in r268860. MFC after: 3 days X-MFC-to: stable/10, stable/9, ports X-MFC-with: r268860 Modified: head/usr.sbin/sysrc/sysrc.8 Modified: head/usr.sbin/sysrc/sysrc.8 ============================================================================== --- head/usr.sbin/sysrc/sysrc.8 Fri Jul 18 23:04:27 2014 (r268862) +++ head/usr.sbin/sysrc/sysrc.8 Fri Jul 18 23:23:52 2014 (r268863) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2011-2013 Devin Teske +.\" Copyright (c) 2011-2014 Devin Teske .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Nov 20, 2013 +.Dd Jul 18, 2014 .Dt SYSRC 8 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 23:47:23 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E8A34B3 for ; Fri, 18 Jul 2014 23:47:23 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (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 CF5012CFA for ; Fri, 18 Jul 2014 23:47:23 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.9/8.14.9) with ESMTP id s6INlNPB077287 for ; Fri, 18 Jul 2014 23:47:23 GMT (envelope-from bdrewery@freefall.freebsd.org) Received: (from bdrewery@localhost) by freefall.freebsd.org (8.14.9/8.14.9/Submit) id s6INlNnT077283 for svn-src-all@freebsd.org; Fri, 18 Jul 2014 23:47:23 GMT (envelope-from bdrewery) Received: (qmail 27370 invoked from network); 18 Jul 2014 18:47:21 -0500 Received: from unknown (HELO roundcube.xk42.net) (10.10.5.5) by sweb.xzibition.com with SMTP; 18 Jul 2014 18:47:21 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 18 Jul 2014 18:47:20 -0500 From: Bryan Drewery To: Pietro Cerutti Subject: Re: svn commit: r268494 - in head: lib/libsbuf sys/kern sys/sys Organization: FreeBSD In-Reply-To: <201407101308.s6AD8pbR080041@svn.freebsd.org> References: <201407101308.s6AD8pbR080041@svn.freebsd.org> Message-ID: X-Sender: bdrewery@FreeBSD.org User-Agent: Roundcube Webmail/1.0.1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, owner-src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 23:47:24 -0000 On 2014-07-10 08:08, Pietro Cerutti wrote: > Author: gahr (ports committer) > Date: Thu Jul 10 13:08:51 2014 > New Revision: 268494 > URL: http://svnweb.freebsd.org/changeset/base/268494 > > Log: > Implement Short/Small String Optimization in SBUF(9) and change > lengths and > positions in the API from ssize_t and int to size_t. > > CR: D388 > Approved by: des, bapt > > Modified: > head/lib/libsbuf/Makefile > head/sys/kern/subr_sbuf.c > head/sys/sys/sbuf.h > > Modified: head/lib/libsbuf/Makefile > ============================================================================== > --- head/lib/libsbuf/Makefile Thu Jul 10 13:04:52 2014 (r268493) > +++ head/lib/libsbuf/Makefile Thu Jul 10 13:08:51 2014 (r268494) > @@ -4,7 +4,7 @@ LIB= sbuf > SHLIBDIR?= /lib > SRCS= subr_sbuf.c > > -SHLIB_MAJOR = 6 > +SHLIB_MAJOR = 7 > > SYMBOL_MAPS= ${.CURDIR}/Symbol.map > VERSION_DEF= ${.CURDIR}/Version.def > We have symbol versioning in libsbuf. Shouldn't need to bump the version. Just need to add a compat function for everything. It would be a lot of work, but bumping for ssize_t->size_t seems gratuitous to me. -- Regards, Bryan Drewery From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 00:01:48 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 97CC949B; Sat, 19 Jul 2014 00:01:48 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 5A0292E8E; Sat, 19 Jul 2014 00:01:47 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 7397473CB; Sat, 19 Jul 2014 00:01:40 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 33E605B2; Sat, 19 Jul 2014 02:01:20 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Larry Rosenman Subject: Re: svn commit: r268840 - head/usr.sbin/unbound/local-setup References: <201407181233.s6ICXMY9042848@svn.freebsd.org> <10526bac1382f78c76281a0613e8ff5f@thebighonker.lerctr.org> Date: Sat, 19 Jul 2014 02:01:20 +0200 In-Reply-To: <10526bac1382f78c76281a0613e8ff5f@thebighonker.lerctr.org> (Larry Rosenman's message of "Fri, 18 Jul 2014 15:36:07 -0500") Message-ID: <86tx6erzcf.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, owner-svn-src-all@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 00:01:48 -0000 Larry Rosenman writes: > should this be noted in UPDATING to re-gen the files locally or > something? Good point, thank you. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 00:11:51 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D62A4698; Sat, 19 Jul 2014 00:11:51 +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 C3FBF2F46; Sat, 19 Jul 2014 00:11:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6J0Bpqt080616; Sat, 19 Jul 2014 00:11:51 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6J0BpP7080615; Sat, 19 Jul 2014 00:11:51 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201407190011.s6J0BpP7080615@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sat, 19 Jul 2014 00:11:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268864 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 00:11:51 -0000 Author: des Date: Sat Jul 19 00:11:51 2014 New Revision: 268864 URL: http://svnweb.freebsd.org/changeset/base/268864 Log: Document the need to regenerate the local_unbound configuration. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Jul 18 23:23:52 2014 (r268863) +++ head/UPDATING Sat Jul 19 00:11:51 2014 (r268864) @@ -31,6 +31,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20140719: + The default unbound configuration has been modified to address + issues with reverse lookups on networks that use private + address ranges. If you use the local_unbound service, run + "service local_unbound setup" as root to regenerate your + configuration, then "service local_unbound reload" to load the + new configuration. + 20140709: The GNU texinfo and GNU info pages are not built and installed anymore, WITH_INFO knob has been added to allow to built and install From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 00:26:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1956A8DA; Sat, 19 Jul 2014 00:26:05 +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 058AB2040; Sat, 19 Jul 2014 00:26:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6J0Q484086153; Sat, 19 Jul 2014 00:26:04 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6J0Q3Ti086146; Sat, 19 Jul 2014 00:26:03 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201407190026.s6J0Q3Ti086146@svn.freebsd.org> From: Xin LI Date: Sat, 19 Jul 2014 00:26:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268865 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 00:26:05 -0000 Author: delphij Date: Sat Jul 19 00:26:03 2014 New Revision: 268865 URL: http://svnweb.freebsd.org/changeset/base/268865 Log: Reduce lock contention on the z_teardown_lock under heavily cached read workload by splitting the single teardown rrw lock into RRM_NUM_LOCKS (17) of them. Read acquisitions are randomly distributed among these locks based on curthread pointer. Write acquisitions are going to all the locks, which for the usage of this type of lock should be rare. Illumos issue: 5008 lock contention (rrw_exit) while running a read only load MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/rrwlock.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c Sat Jul 19 00:11:51 2014 (r268864) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/rrwlock.c Sat Jul 19 00:26:03 2014 (r268865) @@ -286,3 +286,91 @@ rrw_tsd_destroy(void *arg) (void *)curthread, (void *)rn->rn_rrl); } } + +/* + * A reader-mostly lock implementation, tuning above reader-writer locks + * for hightly parallel read acquisitions, while pessimizing writes. + * + * The idea is to split single busy lock into array of locks, so that + * each reader can lock only one of them for read, depending on result + * of simple hash function. That proportionally reduces lock congestion. + * Writer same time has to sequentially aquire write on all the locks. + * That makes write aquisition proportionally slower, but in places where + * it is used (filesystem unmount) performance is not critical. + * + * All the functions below are direct wrappers around functions above. + */ +void +rrm_init(rrmlock_t *rrl, boolean_t track_all) +{ + int i; + + for (i = 0; i < RRM_NUM_LOCKS; i++) + rrw_init(&rrl->locks[i], track_all); +} + +void +rrm_destroy(rrmlock_t *rrl) +{ + int i; + + for (i = 0; i < RRM_NUM_LOCKS; i++) + rrw_destroy(&rrl->locks[i]); +} + +void +rrm_enter(rrmlock_t *rrl, krw_t rw, void *tag) +{ + if (rw == RW_READER) + rrm_enter_read(rrl, tag); + else + rrm_enter_write(rrl); +} + +/* + * This maps the current thread to a specific lock. Note that the lock + * must be released by the same thread that acquired it. We do this + * mapping by taking the thread pointer mod a prime number. We examine + * only the low 32 bits of the thread pointer, because 32-bit division + * is faster than 64-bit division, and the high 32 bits have little + * entropy anyway. + */ +#define RRM_TD_LOCK() (((uint32_t)(uintptr_t)(curthread)) % RRM_NUM_LOCKS) + +void +rrm_enter_read(rrmlock_t *rrl, void *tag) +{ + rrw_enter_read(&rrl->locks[RRM_TD_LOCK()], tag); +} + +void +rrm_enter_write(rrmlock_t *rrl) +{ + int i; + + for (i = 0; i < RRM_NUM_LOCKS; i++) + rrw_enter_write(&rrl->locks[i]); +} + +void +rrm_exit(rrmlock_t *rrl, void *tag) +{ + int i; + + if (rrl->locks[0].rr_writer == curthread) { + for (i = 0; i < RRM_NUM_LOCKS; i++) + rrw_exit(&rrl->locks[i], tag); + } else { + rrw_exit(&rrl->locks[RRM_TD_LOCK()], tag); + } +} + +boolean_t +rrm_held(rrmlock_t *rrl, krw_t rw) +{ + if (rw == RW_WRITER) { + return (rrw_held(&rrl->locks[0], rw)); + } else { + return (rrw_held(&rrl->locks[RRM_TD_LOCK()], rw)); + } +} Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/rrwlock.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/rrwlock.h Sat Jul 19 00:11:51 2014 (r268864) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/rrwlock.h Sat Jul 19 00:26:03 2014 (r268865) @@ -79,6 +79,31 @@ void rrw_tsd_destroy(void *arg); #define RRW_LOCK_HELD(x) \ (rrw_held(x, RW_WRITER) || rrw_held(x, RW_READER)) +/* + * A reader-mostly lock implementation, tuning above reader-writer locks + * for hightly parallel read acquisitions, pessimizing write acquisitions. + * + * This should be a prime number. See comment in rrwlock.c near + * RRM_TD_LOCK() for details. + */ +#define RRM_NUM_LOCKS 17 +typedef struct rrmlock { + rrwlock_t locks[RRM_NUM_LOCKS]; +} rrmlock_t; + +void rrm_init(rrmlock_t *rrl, boolean_t track_all); +void rrm_destroy(rrmlock_t *rrl); +void rrm_enter(rrmlock_t *rrl, krw_t rw, void *tag); +void rrm_enter_read(rrmlock_t *rrl, void *tag); +void rrm_enter_write(rrmlock_t *rrl); +void rrm_exit(rrmlock_t *rrl, void *tag); +boolean_t rrm_held(rrmlock_t *rrl, krw_t rw); + +#define RRM_READ_HELD(x) rrm_held(x, RW_READER) +#define RRM_WRITE_HELD(x) rrm_held(x, RW_WRITER) +#define RRM_LOCK_HELD(x) \ + (rrm_held(x, RW_WRITER) || rrm_held(x, RW_READER)) + #ifdef __cplusplus } #endif Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h Sat Jul 19 00:11:51 2014 (r268864) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h Sat Jul 19 00:26:03 2014 (r268865) @@ -64,7 +64,7 @@ struct zfsvfs { int z_norm; /* normalization flags */ boolean_t z_atime; /* enable atimes mount option */ boolean_t z_unmounted; /* unmounted */ - rrwlock_t z_teardown_lock; + rrmlock_t z_teardown_lock; krwlock_t z_teardown_inactive_lock; list_t z_all_znodes; /* all vnodes in the fs */ kmutex_t z_znodes_lock; /* lock for z_all_znodes */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Sat Jul 19 00:11:51 2014 (r268864) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Sat Jul 19 00:26:03 2014 (r268865) @@ -256,7 +256,7 @@ VTOZ(vnode_t *vp) /* Called on entry to each ZFS vnode and vfs operation */ #define ZFS_ENTER(zfsvfs) \ { \ - rrw_enter_read(&(zfsvfs)->z_teardown_lock, FTAG); \ + rrm_enter_read(&(zfsvfs)->z_teardown_lock, FTAG); \ if ((zfsvfs)->z_unmounted) { \ ZFS_EXIT(zfsvfs); \ return (EIO); \ @@ -265,10 +265,10 @@ VTOZ(vnode_t *vp) /* Called on entry to each ZFS vnode and vfs operation that can not return EIO */ #define ZFS_ENTER_NOERROR(zfsvfs) \ - rrw_enter(&(zfsvfs)->z_teardown_lock, RW_READER, FTAG) + rrm_enter(&(zfsvfs)->z_teardown_lock, RW_READER, FTAG) /* Must be called before exiting the vop */ -#define ZFS_EXIT(zfsvfs) rrw_exit(&(zfsvfs)->z_teardown_lock, FTAG) +#define ZFS_EXIT(zfsvfs) rrm_exit(&(zfsvfs)->z_teardown_lock, FTAG) /* Verifies the znode is valid */ #define ZFS_VERIFY_ZP(zp) \ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sat Jul 19 00:11:51 2014 (r268864) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sat Jul 19 00:26:03 2014 (r268865) @@ -1465,7 +1465,7 @@ zfsvfs_hold(const char *name, void *tag, if (getzfsvfs(name, zfvp) != 0) error = zfsvfs_create(name, zfvp); if (error == 0) { - rrw_enter(&(*zfvp)->z_teardown_lock, (writer) ? RW_WRITER : + rrm_enter(&(*zfvp)->z_teardown_lock, (writer) ? RW_WRITER : RW_READER, tag); if ((*zfvp)->z_unmounted) { /* @@ -1473,7 +1473,7 @@ zfsvfs_hold(const char *name, void *tag, * thread should be just about to disassociate the * objset from the zfsvfs. */ - rrw_exit(&(*zfvp)->z_teardown_lock, tag); + rrm_exit(&(*zfvp)->z_teardown_lock, tag); return (SET_ERROR(EBUSY)); } } @@ -1483,7 +1483,7 @@ zfsvfs_hold(const char *name, void *tag, static void zfsvfs_rele(zfsvfs_t *zfsvfs, void *tag) { - rrw_exit(&zfsvfs->z_teardown_lock, tag); + rrm_exit(&zfsvfs->z_teardown_lock, tag); if (zfsvfs->z_vfs) { VFS_RELE(zfsvfs->z_vfs); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Jul 19 00:11:51 2014 (r268864) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Jul 19 00:26:03 2014 (r268865) @@ -987,7 +987,7 @@ zfsvfs_create(const char *osname, zfsvfs mutex_init(&zfsvfs->z_lock, NULL, MUTEX_DEFAULT, NULL); list_create(&zfsvfs->z_all_znodes, sizeof (znode_t), offsetof(znode_t, z_link_node)); - rrw_init(&zfsvfs->z_teardown_lock, B_FALSE); + rrm_init(&zfsvfs->z_teardown_lock, B_FALSE); rw_init(&zfsvfs->z_teardown_inactive_lock, NULL, RW_DEFAULT, NULL); rw_init(&zfsvfs->z_fuid_lock, NULL, RW_DEFAULT, NULL); for (i = 0; i != ZFS_OBJ_MTX_SZ; i++) @@ -1103,7 +1103,7 @@ zfsvfs_free(zfsvfs_t *zfsvfs) mutex_destroy(&zfsvfs->z_znodes_lock); mutex_destroy(&zfsvfs->z_lock); list_destroy(&zfsvfs->z_all_znodes); - rrw_destroy(&zfsvfs->z_teardown_lock); + rrm_destroy(&zfsvfs->z_teardown_lock); rw_destroy(&zfsvfs->z_teardown_inactive_lock); rw_destroy(&zfsvfs->z_fuid_lock); for (i = 0; i != ZFS_OBJ_MTX_SZ; i++) @@ -1832,7 +1832,7 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolea { znode_t *zp; - rrw_enter(&zfsvfs->z_teardown_lock, RW_WRITER, FTAG); + rrm_enter(&zfsvfs->z_teardown_lock, RW_WRITER, FTAG); if (!unmounting) { /* @@ -1865,7 +1865,7 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolea */ if (!unmounting && (zfsvfs->z_unmounted || zfsvfs->z_os == NULL)) { rw_exit(&zfsvfs->z_teardown_inactive_lock); - rrw_exit(&zfsvfs->z_teardown_lock, FTAG); + rrm_exit(&zfsvfs->z_teardown_lock, FTAG); return (SET_ERROR(EIO)); } @@ -1892,7 +1892,7 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolea */ if (unmounting) { zfsvfs->z_unmounted = B_TRUE; - rrw_exit(&zfsvfs->z_teardown_lock, FTAG); + rrm_exit(&zfsvfs->z_teardown_lock, FTAG); rw_exit(&zfsvfs->z_teardown_inactive_lock); } @@ -1969,9 +1969,9 @@ zfs_umount(vfs_t *vfsp, int fflag) * vflush(FORCECLOSE). This way we ensure no future vnops * will be called and risk operating on DOOMED vnodes. */ - rrw_enter(&zfsvfs->z_teardown_lock, RW_WRITER, FTAG); + rrm_enter(&zfsvfs->z_teardown_lock, RW_WRITER, FTAG); zfsvfs->z_unmounted = B_TRUE; - rrw_exit(&zfsvfs->z_teardown_lock, FTAG); + rrm_exit(&zfsvfs->z_teardown_lock, FTAG); } /* @@ -2239,7 +2239,7 @@ zfs_resume_fs(zfsvfs_t *zfsvfs, const ch znode_t *zp; uint64_t sa_obj = 0; - ASSERT(RRW_WRITE_HELD(&zfsvfs->z_teardown_lock)); + ASSERT(RRM_WRITE_HELD(&zfsvfs->z_teardown_lock)); ASSERT(RW_WRITE_HELD(&zfsvfs->z_teardown_inactive_lock)); /* @@ -2295,7 +2295,7 @@ zfs_resume_fs(zfsvfs_t *zfsvfs, const ch bail: /* release the VOPs */ rw_exit(&zfsvfs->z_teardown_inactive_lock); - rrw_exit(&zfsvfs->z_teardown_lock, FTAG); + rrm_exit(&zfsvfs->z_teardown_lock, FTAG); if (err) { /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sat Jul 19 00:11:51 2014 (r268864) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sat Jul 19 00:26:03 2014 (r268865) @@ -276,7 +276,7 @@ zfs_znode_move(void *buf, void *newbuf, * can safely ensure that the filesystem is not and will not be * unmounted. The next statement is equivalent to ZFS_ENTER(). */ - rrw_enter(&zfsvfs->z_teardown_lock, RW_READER, FTAG); + rrm_enter(&zfsvfs->z_teardown_lock, RW_READER, FTAG); if (zfsvfs->z_unmounted) { ZFS_EXIT(zfsvfs); rw_exit(&zfsvfs_lock); From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 01:15:01 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E4CFDBD; Sat, 19 Jul 2014 01:15:01 +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 D26432406; Sat, 19 Jul 2014 01:15:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6J1F1DG009406; Sat, 19 Jul 2014 01:15:01 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6J1F1hH009405; Sat, 19 Jul 2014 01:15:01 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201407190115.s6J1F1hH009405@svn.freebsd.org> From: Rick Macklem Date: Sat, 19 Jul 2014 01:15:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268866 - head/usr.sbin/nfsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 01:15:02 -0000 Author: rmacklem Date: Sat Jul 19 01:15:01 2014 New Revision: 268866 URL: http://svnweb.freebsd.org/changeset/base/268866 Log: r243637 changed the default number of nfsd threads created, but the man page did not reflect this. This is a content change. Reported by: bde MFC after: 2 weeks Modified: head/usr.sbin/nfsd/nfsd.8 Modified: head/usr.sbin/nfsd/nfsd.8 ============================================================================== --- head/usr.sbin/nfsd/nfsd.8 Sat Jul 19 00:26:03 2014 (r268865) +++ head/usr.sbin/nfsd/nfsd.8 Sat Jul 19 01:15:01 2014 (r268866) @@ -28,7 +28,7 @@ .\" @(#)nfsd.8 8.4 (Berkeley) 3/29/95 .\" $FreeBSD$ .\" -.Dd April 23, 2011 +.Dd July 18, 2014 .Dt NFSD 8 .Os .Sh NAME @@ -53,7 +53,7 @@ At least one .Nm must be running for a machine to operate as a server. .Pp -Unless otherwise specified, four servers for +Unless otherwise specified, eight servers per CPU for .Tn UDP transport are started. .Pp From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 01:53:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BC9B4655; Sat, 19 Jul 2014 01:53:52 +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 AA44026FF; Sat, 19 Jul 2014 01:53:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6J1rqtd027368; Sat, 19 Jul 2014 01:53:52 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6J1rqBn027367; Sat, 19 Jul 2014 01:53:52 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407190153.s6J1rqBn027367@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 19 Jul 2014 01:53:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268867 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 01:53:52 -0000 Author: pfg Date: Sat Jul 19 01:53:52 2014 New Revision: 268867 URL: http://svnweb.freebsd.org/changeset/base/268867 Log: Use unsigned optlen in getsourcefilter() Sizes can not be negative and the functions that use it expect an unsigned value anyways. Obtained from: Apple (Libc-997.90.3) MFC after: 1 week Modified: head/lib/libc/net/sourcefilter.c Modified: head/lib/libc/net/sourcefilter.c ============================================================================== --- head/lib/libc/net/sourcefilter.c Sat Jul 19 01:15:01 2014 (r268866) +++ head/lib/libc/net/sourcefilter.c Sat Jul 19 01:53:52 2014 (r268867) @@ -337,7 +337,8 @@ getsourcefilter(int s, uint32_t interfac { struct __msfilterreq msfr; sockunion_t *psu; - int err, level, nsrcs, optlen, optname; + int err, level, nsrcs, optname; + unsigned int optlen; if (interface == 0 || group == NULL || numsrc == NULL || fmode == NULL) { From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 02:27:33 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E3F03B4A; Sat, 19 Jul 2014 02:27:32 +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 D105E298D; Sat, 19 Jul 2014 02:27:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6J2RWUp042345; Sat, 19 Jul 2014 02:27:32 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6J2RWvL042340; Sat, 19 Jul 2014 02:27:32 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201407190227.s6J2RWvL042340@svn.freebsd.org> From: Mark Johnston Date: Sat, 19 Jul 2014 02:27:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268869 - in head/sys: amd64/amd64 cddl/dev/dtrace/amd64 cddl/dev/fbt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 02:27:33 -0000 Author: markj Date: Sat Jul 19 02:27:31 2014 New Revision: 268869 URL: http://svnweb.freebsd.org/changeset/base/268869 Log: Use a C wrapper for trap() instead of checking and calling the DTrace trap hook in assembly. Suggested by: kib Reviewed by: kib (original version) X-MFC-With: r268600 Modified: head/sys/amd64/amd64/exception.S head/sys/amd64/amd64/trap.c head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c head/sys/cddl/dev/fbt/fbt.c Modified: head/sys/amd64/amd64/exception.S ============================================================================== --- head/sys/amd64/amd64/exception.S Sat Jul 19 02:15:28 2014 (r268868) +++ head/sys/amd64/amd64/exception.S Sat Jul 19 02:27:31 2014 (r268869) @@ -228,24 +228,7 @@ alltraps_pushregs_no_rdi: .type calltrap,@function calltrap: movq %rsp,%rdi -#ifdef KDTRACE_HOOKS - /* - * Give DTrace a chance to vet this trap and skip the call to trap() if - * it turns out that it was caused by a DTrace probe. - */ - movq dtrace_trap_func,%rax - testq %rax,%rax - je skiphook - call *%rax - testq %rax,%rax - jne skiptrap - movq %rsp,%rdi -skiphook: -#endif - call trap -#ifdef KDTRACE_HOOKS -skiptrap: -#endif + call trap_check MEXITCOUNT jmp doreti /* Handle any pending ASTs */ Modified: head/sys/amd64/amd64/trap.c ============================================================================== --- head/sys/amd64/amd64/trap.c Sat Jul 19 02:15:28 2014 (r268868) +++ head/sys/amd64/amd64/trap.c Sat Jul 19 02:27:31 2014 (r268869) @@ -97,7 +97,8 @@ PMC_SOFT_DEFINE( , , page_fault, write); #include #endif -extern void trap(struct trapframe *frame); +extern void __noinline trap(struct trapframe *frame); +extern void trap_check(struct trapframe *frame); extern void syscall(struct trapframe *frame); void dblfault_handler(struct trapframe *frame); @@ -604,6 +605,19 @@ out: return; } +/* + * Ensure that we ignore any DTrace-induced faults. This function cannot + * be instrumented, so it cannot generate such faults itself. + */ +void +trap_check(struct trapframe *frame) +{ + + if (dtrace_trap_func != NULL && (*dtrace_trap_func)(frame)) + return; + trap(frame); +} + static int trap_pfault(frame, usermode) struct trapframe *frame; Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Sat Jul 19 02:15:28 2014 (r268868) +++ head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Sat Jul 19 02:27:31 2014 (r268869) @@ -462,9 +462,7 @@ dtrace_gethrestime(void) return (current_time.tv_sec * 1000000000ULL + current_time.tv_nsec); } -/* - * Function to handle DTrace traps during probes. See amd64/amd64/exception.S. - */ +/* Function to handle DTrace traps during probes. See amd64/amd64/trap.c. */ int dtrace_trap(struct trapframe *frame) { Modified: head/sys/cddl/dev/fbt/fbt.c ============================================================================== --- head/sys/cddl/dev/fbt/fbt.c Sat Jul 19 02:15:28 2014 (r268868) +++ head/sys/cddl/dev/fbt/fbt.c Sat Jul 19 02:27:31 2014 (r268869) @@ -232,13 +232,18 @@ fbt_provide_module_function(linker_file_ int size; u_int8_t *instr, *limit; - if (strncmp(name, "dtrace_", 7) == 0 && - strncmp(name, "dtrace_safe_", 12) != 0) { + if ((strncmp(name, "dtrace_", 7) == 0 && + strncmp(name, "dtrace_safe_", 12) != 0) || + strcmp(name, "trap_check") == 0) { /* * Anything beginning with "dtrace_" may be called * from probe context unless it explicitly indicates * that it won't be called from probe context by * using the prefix "dtrace_safe_". + * + * Additionally, we avoid instrumenting trap_check() to avoid + * the possibility of generating a fault in probe context before + * DTrace's fault handler is called. */ return (0); } From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 07:36:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2EA03F20; Sat, 19 Jul 2014 07:36:46 +0000 (UTC) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id E70512124; Sat, 19 Jul 2014 07:36:45 +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 mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 7C7BC3C567D; Sat, 19 Jul 2014 17:36:42 +1000 (EST) Date: Sat, 19 Jul 2014 17:36:42 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Pedro F. Giffuni" Subject: Re: svn commit: r268867 - head/lib/libc/net In-Reply-To: <201407190153.s6J1rqBn027367@svn.freebsd.org> Message-ID: <20140719171552.W874@besplex.bde.org> References: <201407190153.s6J1rqBn027367@svn.freebsd.org> 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=B4eAjodM c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=Nik8Deec72wA:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=Q-jsWnCd4DCEJM4vVo8A:9 a=CjuIK1q_8ugA:10 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 07:36:46 -0000 On Sat, 19 Jul 2014, Pedro F. Giffuni wrote: > Log: > Use unsigned optlen in getsourcefilter() > > Sizes can not be negative and the functions that use it > expect an unsigned value anyways. > > Obtained from: Apple (Libc-997.90.3) > MFC after: 1 week Most uses of unsigned types are bugs. This one is an exception, but the change is still wrong. The critical use of the type needs it to be socklen_t, not int or unsigned int. socklen_t happens to have type uint32_t (unsigned due to old bugs). It only accidentally has the same size as unsigned int. It has a different type to plain int so compilers should warn about the type mismatch with certain warning flags. > Modified: > head/lib/libc/net/sourcefilter.c > > Modified: head/lib/libc/net/sourcefilter.c > ============================================================================== > --- head/lib/libc/net/sourcefilter.c Sat Jul 19 01:15:01 2014 (r268866) > +++ head/lib/libc/net/sourcefilter.c Sat Jul 19 01:53:52 2014 (r268867) > @@ -337,7 +337,8 @@ getsourcefilter(int s, uint32_t interfac > { > struct __msfilterreq msfr; > sockunion_t *psu; > - int err, level, nsrcs, optlen, optname; > + int err, level, nsrcs, optname; > + unsigned int optlen; This has mounds of style bugs. 2 more now (unsorting, and not using u_int, except u_int is not just a style bug) Other uses of this variable: % optlen = sizeof(struct __msfilterreq); The rvalue has type size_t. Unsigned is actually correct for size_t. The lvalue has a smaller type in many cases and we need to know that the result fits. We know that it is small, so if fits just as well in an int as in an u_int. It is less clear that it fits in a socklen_t since that is supposed to be opaque. % memset(&msfr, 0, optlen); memset() takes a size_t for its 3rd arg, but any type that can represent the value works provided memset()'s prototype is in scope. % err = _getsockopt(s, level, optname, &msfr, &optlen); This use needs the correct type since the reference is indirect so the prototype can't adjust the type. The arg had type "int *" in 4.4BSD but has suffered from typedef poisoning so it is now "socklen_t *" 4.4BSD also doesn't have socklen_t. socklen_t is specified by POSIX as being an integer type with width at least 32 bits. It is not required to be unsigned, and there are portability problems from this. POSIX recommends that applications not store values larger than 2**31-1 in socklen_t. 2**31 would only work if it is unsigned. Bruce From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 10:42:38 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B2863DC6; Sat, 19 Jul 2014 10:42:38 +0000 (UTC) Received: from cyrus.watson.org (cyrus.watson.org [198.74.231.69]) by mx1.freebsd.org (Postfix) with ESMTP id 68B392F9E; Sat, 19 Jul 2014 10:42:38 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [198.74.231.63]) by cyrus.watson.org (Postfix) with ESMTPS id ED07646B09; Sat, 19 Jul 2014 06:42:36 -0400 (EDT) Date: Sat, 19 Jul 2014 11:42:36 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Xin LI Subject: Re: svn commit: r268852 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys In-Reply-To: <201407181809.s6II9KkB002810@svn.freebsd.org> Message-ID: References: <201407181809.s6II9KkB002810@svn.freebsd.org> User-Agent: Alpine 2.11 (BSF 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-vendor@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 10:42:38 -0000 On Fri, 18 Jul 2014, Xin LI wrote: > Log: > 5008 lock contention (rrw_exit) while running a read only load > Reviewed by: Matthew Ahrens > Reviewed by: George Wilson > Reviewed by: Alex Reece > Reviewed by: Christopher Siden > Reviewed by: Richard Yao > Reviewed by: Saso Kiselkov > Approved by: Garrett D'Amore > > illumos/illumos-gate@c9030f6c93613fe30ee0c16f92b96da7816ac052 Is there an opportunity to use our own read-mostly lock implementation here? It should be substantially more scalable, has integration with WITNESS, proper priority propagation, etc. Robert > > Modified: > vendor-sys/illumos/dist/uts/common/fs/zfs/rrwlock.c > vendor-sys/illumos/dist/uts/common/fs/zfs/sys/rrwlock.h > vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_vfsops.h > vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_znode.h > vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c > vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vfsops.c > vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_znode.c > > Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/rrwlock.c > ============================================================================== > --- vendor-sys/illumos/dist/uts/common/fs/zfs/rrwlock.c Fri Jul 18 18:05:09 2014 (r268851) > +++ vendor-sys/illumos/dist/uts/common/fs/zfs/rrwlock.c Fri Jul 18 18:09:20 2014 (r268852) > @@ -286,3 +286,91 @@ rrw_tsd_destroy(void *arg) > (void *)curthread, (void *)rn->rn_rrl); > } > } > + > +/* > + * A reader-mostly lock implementation, tuning above reader-writer locks > + * for hightly parallel read acquisitions, while pessimizing writes. > + * > + * The idea is to split single busy lock into array of locks, so that > + * each reader can lock only one of them for read, depending on result > + * of simple hash function. That proportionally reduces lock congestion. > + * Writer same time has to sequentially aquire write on all the locks. > + * That makes write aquisition proportionally slower, but in places where > + * it is used (filesystem unmount) performance is not critical. > + * > + * All the functions below are direct wrappers around functions above. > + */ > +void > +rrm_init(rrmlock_t *rrl, boolean_t track_all) > +{ > + int i; > + > + for (i = 0; i < RRM_NUM_LOCKS; i++) > + rrw_init(&rrl->locks[i], track_all); > +} > + > +void > +rrm_destroy(rrmlock_t *rrl) > +{ > + int i; > + > + for (i = 0; i < RRM_NUM_LOCKS; i++) > + rrw_destroy(&rrl->locks[i]); > +} > + > +void > +rrm_enter(rrmlock_t *rrl, krw_t rw, void *tag) > +{ > + if (rw == RW_READER) > + rrm_enter_read(rrl, tag); > + else > + rrm_enter_write(rrl); > +} > + > +/* > + * This maps the current thread to a specific lock. Note that the lock > + * must be released by the same thread that acquired it. We do this > + * mapping by taking the thread pointer mod a prime number. We examine > + * only the low 32 bits of the thread pointer, because 32-bit division > + * is faster than 64-bit division, and the high 32 bits have little > + * entropy anyway. > + */ > +#define RRM_TD_LOCK() (((uint32_t)(uintptr_t)(curthread)) % RRM_NUM_LOCKS) > + > +void > +rrm_enter_read(rrmlock_t *rrl, void *tag) > +{ > + rrw_enter_read(&rrl->locks[RRM_TD_LOCK()], tag); > +} > + > +void > +rrm_enter_write(rrmlock_t *rrl) > +{ > + int i; > + > + for (i = 0; i < RRM_NUM_LOCKS; i++) > + rrw_enter_write(&rrl->locks[i]); > +} > + > +void > +rrm_exit(rrmlock_t *rrl, void *tag) > +{ > + int i; > + > + if (rrl->locks[0].rr_writer == curthread) { > + for (i = 0; i < RRM_NUM_LOCKS; i++) > + rrw_exit(&rrl->locks[i], tag); > + } else { > + rrw_exit(&rrl->locks[RRM_TD_LOCK()], tag); > + } > +} > + > +boolean_t > +rrm_held(rrmlock_t *rrl, krw_t rw) > +{ > + if (rw == RW_WRITER) { > + return (rrw_held(&rrl->locks[0], rw)); > + } else { > + return (rrw_held(&rrl->locks[RRM_TD_LOCK()], rw)); > + } > +} > > Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/rrwlock.h > ============================================================================== > --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/rrwlock.h Fri Jul 18 18:05:09 2014 (r268851) > +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/rrwlock.h Fri Jul 18 18:09:20 2014 (r268852) > @@ -80,6 +80,31 @@ void rrw_tsd_destroy(void *arg); > #define RRW_LOCK_HELD(x) \ > (rrw_held(x, RW_WRITER) || rrw_held(x, RW_READER)) > > +/* > + * A reader-mostly lock implementation, tuning above reader-writer locks > + * for hightly parallel read acquisitions, pessimizing write acquisitions. > + * > + * This should be a prime number. See comment in rrwlock.c near > + * RRM_TD_LOCK() for details. > + */ > +#define RRM_NUM_LOCKS 17 > +typedef struct rrmlock { > + rrwlock_t locks[RRM_NUM_LOCKS]; > +} rrmlock_t; > + > +void rrm_init(rrmlock_t *rrl, boolean_t track_all); > +void rrm_destroy(rrmlock_t *rrl); > +void rrm_enter(rrmlock_t *rrl, krw_t rw, void *tag); > +void rrm_enter_read(rrmlock_t *rrl, void *tag); > +void rrm_enter_write(rrmlock_t *rrl); > +void rrm_exit(rrmlock_t *rrl, void *tag); > +boolean_t rrm_held(rrmlock_t *rrl, krw_t rw); > + > +#define RRM_READ_HELD(x) rrm_held(x, RW_READER) > +#define RRM_WRITE_HELD(x) rrm_held(x, RW_WRITER) > +#define RRM_LOCK_HELD(x) \ > + (rrm_held(x, RW_WRITER) || rrm_held(x, RW_READER)) > + > #ifdef __cplusplus > } > #endif > > Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_vfsops.h > ============================================================================== > --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_vfsops.h Fri Jul 18 18:05:09 2014 (r268851) > +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_vfsops.h Fri Jul 18 18:09:20 2014 (r268852) > @@ -64,7 +64,7 @@ struct zfsvfs { > int z_norm; /* normalization flags */ > boolean_t z_atime; /* enable atimes mount option */ > boolean_t z_unmounted; /* unmounted */ > - rrwlock_t z_teardown_lock; > + rrmlock_t z_teardown_lock; > krwlock_t z_teardown_inactive_lock; > list_t z_all_znodes; /* all vnodes in the fs */ > kmutex_t z_znodes_lock; /* lock for z_all_znodes */ > > Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_znode.h > ============================================================================== > --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_znode.h Fri Jul 18 18:05:09 2014 (r268851) > +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zfs_znode.h Fri Jul 18 18:09:20 2014 (r268852) > @@ -238,7 +238,7 @@ typedef struct znode { > /* Called on entry to each ZFS vnode and vfs operation */ > #define ZFS_ENTER(zfsvfs) \ > { \ > - rrw_enter_read(&(zfsvfs)->z_teardown_lock, FTAG); \ > + rrm_enter_read(&(zfsvfs)->z_teardown_lock, FTAG); \ > if ((zfsvfs)->z_unmounted) { \ > ZFS_EXIT(zfsvfs); \ > return (EIO); \ > @@ -246,7 +246,7 @@ typedef struct znode { > } > > /* Must be called before exiting the vop */ > -#define ZFS_EXIT(zfsvfs) rrw_exit(&(zfsvfs)->z_teardown_lock, FTAG) > +#define ZFS_EXIT(zfsvfs) rrm_exit(&(zfsvfs)->z_teardown_lock, FTAG) > > /* Verifies the znode is valid */ > #define ZFS_VERIFY_ZP(zp) \ > > Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c > ============================================================================== > --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c Fri Jul 18 18:05:09 2014 (r268851) > +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c Fri Jul 18 18:09:20 2014 (r268852) > @@ -1420,7 +1420,7 @@ zfsvfs_hold(const char *name, void *tag, > if (getzfsvfs(name, zfvp) != 0) > error = zfsvfs_create(name, zfvp); > if (error == 0) { > - rrw_enter(&(*zfvp)->z_teardown_lock, (writer) ? RW_WRITER : > + rrm_enter(&(*zfvp)->z_teardown_lock, (writer) ? RW_WRITER : > RW_READER, tag); > if ((*zfvp)->z_unmounted) { > /* > @@ -1428,7 +1428,7 @@ zfsvfs_hold(const char *name, void *tag, > * thread should be just about to disassociate the > * objset from the zfsvfs. > */ > - rrw_exit(&(*zfvp)->z_teardown_lock, tag); > + rrm_exit(&(*zfvp)->z_teardown_lock, tag); > return (SET_ERROR(EBUSY)); > } > } > @@ -1438,7 +1438,7 @@ zfsvfs_hold(const char *name, void *tag, > static void > zfsvfs_rele(zfsvfs_t *zfsvfs, void *tag) > { > - rrw_exit(&zfsvfs->z_teardown_lock, tag); > + rrm_exit(&zfsvfs->z_teardown_lock, tag); > > if (zfsvfs->z_vfs) { > VFS_RELE(zfsvfs->z_vfs); > > Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vfsops.c > ============================================================================== > --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vfsops.c Fri Jul 18 18:05:09 2014 (r268851) > +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_vfsops.c Fri Jul 18 18:09:20 2014 (r268852) > @@ -1004,7 +1004,7 @@ zfsvfs_create(const char *osname, zfsvfs > mutex_init(&zfsvfs->z_lock, NULL, MUTEX_DEFAULT, NULL); > list_create(&zfsvfs->z_all_znodes, sizeof (znode_t), > offsetof(znode_t, z_link_node)); > - rrw_init(&zfsvfs->z_teardown_lock, B_FALSE); > + rrm_init(&zfsvfs->z_teardown_lock, B_FALSE); > rw_init(&zfsvfs->z_teardown_inactive_lock, NULL, RW_DEFAULT, NULL); > rw_init(&zfsvfs->z_fuid_lock, NULL, RW_DEFAULT, NULL); > for (i = 0; i != ZFS_OBJ_MTX_SZ; i++) > @@ -1119,7 +1119,7 @@ zfsvfs_free(zfsvfs_t *zfsvfs) > mutex_destroy(&zfsvfs->z_znodes_lock); > mutex_destroy(&zfsvfs->z_lock); > list_destroy(&zfsvfs->z_all_znodes); > - rrw_destroy(&zfsvfs->z_teardown_lock); > + rrm_destroy(&zfsvfs->z_teardown_lock); > rw_destroy(&zfsvfs->z_teardown_inactive_lock); > rw_destroy(&zfsvfs->z_fuid_lock); > for (i = 0; i != ZFS_OBJ_MTX_SZ; i++) > @@ -1784,7 +1784,7 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolea > { > znode_t *zp; > > - rrw_enter(&zfsvfs->z_teardown_lock, RW_WRITER, FTAG); > + rrm_enter(&zfsvfs->z_teardown_lock, RW_WRITER, FTAG); > > if (!unmounting) { > /* > @@ -1814,7 +1814,7 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolea > */ > if (!unmounting && (zfsvfs->z_unmounted || zfsvfs->z_os == NULL)) { > rw_exit(&zfsvfs->z_teardown_inactive_lock); > - rrw_exit(&zfsvfs->z_teardown_lock, FTAG); > + rrm_exit(&zfsvfs->z_teardown_lock, FTAG); > return (SET_ERROR(EIO)); > } > > @@ -1841,7 +1841,7 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolea > */ > if (unmounting) { > zfsvfs->z_unmounted = B_TRUE; > - rrw_exit(&zfsvfs->z_teardown_lock, FTAG); > + rrm_exit(&zfsvfs->z_teardown_lock, FTAG); > rw_exit(&zfsvfs->z_teardown_inactive_lock); > } > > @@ -2073,7 +2073,7 @@ zfs_resume_fs(zfsvfs_t *zfsvfs, const ch > znode_t *zp; > uint64_t sa_obj = 0; > > - ASSERT(RRW_WRITE_HELD(&zfsvfs->z_teardown_lock)); > + ASSERT(RRM_WRITE_HELD(&zfsvfs->z_teardown_lock)); > ASSERT(RW_WRITE_HELD(&zfsvfs->z_teardown_inactive_lock)); > > /* > @@ -2129,7 +2129,7 @@ zfs_resume_fs(zfsvfs_t *zfsvfs, const ch > bail: > /* release the VOPs */ > rw_exit(&zfsvfs->z_teardown_inactive_lock); > - rrw_exit(&zfsvfs->z_teardown_lock, FTAG); > + rrm_exit(&zfsvfs->z_teardown_lock, FTAG); > > if (err) { > /* > > Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_znode.c > ============================================================================== > --- vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_znode.c Fri Jul 18 18:05:09 2014 (r268851) > +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_znode.c Fri Jul 18 18:09:20 2014 (r268852) > @@ -276,7 +276,7 @@ zfs_znode_move(void *buf, void *newbuf, > * can safely ensure that the filesystem is not and will not be > * unmounted. The next statement is equivalent to ZFS_ENTER(). > */ > - rrw_enter(&zfsvfs->z_teardown_lock, RW_READER, FTAG); > + rrm_enter(&zfsvfs->z_teardown_lock, RW_READER, FTAG); > if (zfsvfs->z_unmounted) { > ZFS_EXIT(zfsvfs); > rw_exit(&zfsvfs_lock); > > From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 10:46:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 91FFCFEC for ; Sat, 19 Jul 2014 10:46:35 +0000 (UTC) Received: from nm29-vm1.bullet.mail.bf1.yahoo.com (nm29-vm1.bullet.mail.bf1.yahoo.com [98.139.213.144]) (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 42D682FB7 for ; Sat, 19 Jul 2014 10:46:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1405766787; bh=xYEjUegxztYDWAiIf6J1yfpezV0uKIvN/8J6phFWfDU=; h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc:Content-Transfer-Encoding:Message-Id:References:To:X-Mailer; b=CZLWBvr8L9gBHjUGb4QKC+WHbDLWvQq2cx7zGdXJank1zMR27sSIFId/rfIVy6zhAyxqqEAIPayIVUUhQ+QUm+6oFjWrOBm2Uj7vvdvdj0/df+n6cjdO2R2+/3hNwVS8lNtaHAU1+hRFnELZzVsetqTJiofaqTlqX6b59q3EanrmQAUEGqKLbXe5/4/ZejIsDN02/odaYTCryRLW9DJWFRc+FM8A7EPcoXAWN20xTdWY/GhrgcdCkNRWh7zT3v7Na5o4bpkG5UiPVHmB0JMPxyoSFn2c9OH5UVqQ7Qe6dhD98/IsQBHruyT1WNwLeb1EgHm3BFYXOPsBADY92PRWGg== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com; b=HaYnEPzfk8XsONP/ElXI0lrWFXvkfE9T3Mf/uMk5n8uVxNHKD8lDG9pA1ZVoKCweJkgDwHBzoLbiKKd9PuW27SAuV6kyHIUxOrjPeGi0Fy7dgWms1qktgrjzm6+8Ji4JibUP0cHVliVW0XgjtUFr+WMrs2T2LzNaHYxflTRmbBq3/4RWr+RGVPCn4WGHMv6ap6By8xhGzGkAkuOgRMN9ZG6MNa9FJSoBbBOBMwUmUvTMokONuSt6rEu55TTk05oi4ixztOZN/HNIQVJhDxNaysFCaty1frrEzWj3joRWBnDERYckvnw55eK6L8UhuKIs8nICiwQGPj+RXp8Py+vycw==; Received: from [98.139.212.151] by nm29.bullet.mail.bf1.yahoo.com with NNFMP; 19 Jul 2014 10:46:27 -0000 Received: from [98.139.211.192] by tm8.bullet.mail.bf1.yahoo.com with NNFMP; 19 Jul 2014 10:46:27 -0000 Received: from [127.0.0.1] by smtp201.mail.bf1.yahoo.com with NNFMP; 19 Jul 2014 10:46:27 -0000 X-Yahoo-Newman-Id: 715477.91940.bm@smtp201.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 8uqhoFoVM1m7_4uPhq.GCYAyxB.U8dejN5_.8.T_WdVczyi PUIveUyd2sCJHYpjr7RVewt5ZbMWEzyyWE5nM65S07TgOJd33zouppNVsuVf p2AeWWzyC9AHrF3.BC5O4_7JvRGycp9ZlTEblpfowxEQHvXhYFgC7LCcRPZG c1hvh8ImBQdOJDWkFtLCm0JkQsC4ZhilTNt2zrCpcH4L7lHbqYXjFi4dMXlu _q410vlK7dBfyWa0NNPqrGjY8iZ7DNYNXZLAcXW.nHvZ4.YGksSZetJkE66Y Aa9UL7bTaIaMN8WU20avew1CajXcXZ2LzdINCYRAU9xSfO3SasCjv7JEGI9Q 1f614VN42g6mov3dVo3aB2xwFYcu3Eu5UYZ0JnJyKrLOwDJpLehjrjxzAcv4 BJcbufRXE.0qe8dzOWfvgNp.zPofq68h8GCByrPj5Gb4tw4j9GV1B0BDDkc9 sq9bSkdOG1NfxWplGN7UA5Sbdy0lj1GoMz2aOrO6mQ2iIBAduyxtRIlO3sLp 9dDCRgwA5bN2uUspGqG28 X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r268867 - head/lib/libc/net From: Pedro Giffuni In-Reply-To: <20140719171552.W874@besplex.bde.org> Date: Sat, 19 Jul 2014 05:46:23 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201407190153.s6J1rqBn027367@svn.freebsd.org> <20140719171552.W874@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 10:46:35 -0000 Hello; Il giorno 19/lug/2014, alle ore 02:36, Bruce Evans = ha scritto: > On Sat, 19 Jul 2014, Pedro F. Giffuni wrote: >=20 >> Log: >> Use unsigned optlen in getsourcefilter() >>=20 >> Sizes can not be negative and the functions that use it >> expect an unsigned value anyways. >>=20 >> Obtained from: Apple (Libc-997.90.3) >> MFC after: 1 week >=20 > Most uses of unsigned types are bugs. This one is an exception, but = the > change is still wrong. The critical use of the type needs it to be > socklen_t, not int or unsigned int. socklen_t happens to have type > uint32_t (unsigned due to old bugs). It only accidentally has the > same size as unsigned int. It has a different type to plain int so > compilers should warn about the type mismatch with certain warning > flags. >=20 Ah, yes, we have had this discussion before =85 in relation with ext2fs = ;). The compiler doesn=92t have a way to tell if socklen_t is of a certain = type "by accident=94. I will use socklen_t in this case instead of unsigned int, but I will = not MFC the changes as the original change has no functional (end-user) effect. =20 >> Modified: >> head/lib/libc/net/sourcefilter.c >>=20 >> Modified: head/lib/libc/net/sourcefilter.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 >> --- head/lib/libc/net/sourcefilter.c Sat Jul 19 01:15:01 2014 = (r268866) >> +++ head/lib/libc/net/sourcefilter.c Sat Jul 19 01:53:52 2014 = (r268867) >> @@ -337,7 +337,8 @@ getsourcefilter(int s, uint32_t interfac >> { >> struct __msfilterreq msfr; >> sockunion_t *psu; >> - int err, level, nsrcs, optlen, optname; >> + int err, level, nsrcs, optname; >> + unsigned int optlen; >=20 > This has mounds of style bugs. 2 more now (unsorting, and not using > u_int, except u_int is not just a style bug) >=20 While aesthetically it may be better to keep the sorting, it doesn=92t = seem correct to preserve it at the expense of setting the incorrect = type. Would you really want me to set optname in another line? > Other uses of this variable: >=20 > % optlen =3D sizeof(struct __msfilterreq); >=20 > The rvalue has type size_t. Unsigned is actually correct for size_t. > The lvalue has a smaller type in many cases and we need to know that > the result fits. We know that it is small, so if fits just as well > in an int as in an u_int. It is less clear that it fits in a = socklen_t > since that is supposed to be opaque. >=20 > % memset(&msfr, 0, optlen); >=20 > memset() takes a size_t for its 3rd arg, but any type that can = represent > the value works provided memset()'s prototype is in scope. >=20 > % err =3D _getsockopt(s, level, optname, &msfr, &optlen); >=20 > This use needs the correct type since the reference is indirect so the > prototype can't adjust the type. The arg had type "int *" in 4.4BSD > but has suffered from typedef poisoning so it is now "socklen_t *" > 4.4BSD also doesn't have socklen_t. socklen_t is specified by POSIX > as being an integer type with width at least 32 bits. It is not > required to be unsigned, and there are portability problems from this. > POSIX recommends that applications not store values larger than = 2**31-1 > in socklen_t. 2**31 would only work if it is unsigned. >=20 While locally the variable doesn=92t need to be unsigned, conceptually = it will never be less than zero. In this case, for the compiler, setting it to usigned int or to = socklen_t makes no difference. In practice changing it from signed to = unsigned has no effect either as the value will not be big enough to use = the extra bit. It=92s all just a waste of time I guess, so as I said, I won=92t MFC the = change. Pedro. =20 From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 11:29:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 64CC2A65; Sat, 19 Jul 2014 11:29:32 +0000 (UTC) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 11BCB23C3; Sat, 19 Jul 2014 11:29:31 +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 mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 3DA457841D6; Sat, 19 Jul 2014 21:29:24 +1000 (EST) Date: Sat, 19 Jul 2014 21:29:23 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Pedro Giffuni Subject: Re: svn commit: r268867 - head/lib/libc/net In-Reply-To: Message-ID: <20140719210009.O1782@besplex.bde.org> References: <201407190153.s6J1rqBn027367@svn.freebsd.org> <20140719171552.W874@besplex.bde.org> MIME-Version: 1.0 X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=dZS5gxne c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=Nik8Deec72wA:10 a=JzwRw_2MAAAA:8 a=nlC_4_pT8q9DhB4Ho9EA:9 a=cz2ZRIgtxKwA:10 a=wJWlkF7cXJYA:10 a=hsugvK8Fsgzgi7uuu4wA:9 a=45ClL6m2LaAA:10 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 11:29:32 -0000 On Sat, 19 Jul 2014, Pedro Giffuni wrote: > Il giorno 19/lug/2014, alle ore 02:36, Bruce Evans = ha scritto: > >> On Sat, 19 Jul 2014, Pedro F. Giffuni wrote: >> >>> Log: >>> Use unsigned optlen in getsourcefilter() >>> >>> Sizes can not be negative and the functions that use it >>> expect an unsigned value anyways. >>> >>> Obtained from:=09Apple (Libc-997.90.3) >>> MFC after:=091 week >> >> Most uses of unsigned types are bugs. This one is an exception, but the >> change is still wrong. The critical use of the type needs it to be >> socklen_t, not int or unsigned int. socklen_t happens to have type >> uint32_t (unsigned due to old bugs). It only accidentally has the >> same size as unsigned int. It has a different type to plain int so >> compilers should warn about the type mismatch with certain warning >> flags. >> > > Ah, yes, we have had this discussion before =85 in relation with ext2fs ;= ). Yes, it caused bugs in practice there. > The compiler doesn=92t have a way to tell if socklen_t is of a certain ty= pe "by accident=94. Yes, this is a fundamental problem with C typedefs -- they are too similar to their underlying type. Any size error would be detected more reliably than the sign error in furture when int is expanded by socklen_t stays 32 bits. Except the assumptions that int is 32 bits is even more established now than it was on vaxes, so no one would expand int. > I will use socklen_t in this case instead of unsigned int, but I will not= MFC the changes > as the original change has no functional (end-user) effect. > > >>> Modified: >>> head/lib/libc/net/sourcefilter.c >>> >>> Modified: head/lib/libc/net/sourcefilter.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 >>> --- head/lib/libc/net/sourcefilter.c=09Sat Jul 19 01:15:01 2014=09(r268= 866) >>> +++ head/lib/libc/net/sourcefilter.c=09Sat Jul 19 01:53:52 2014=09(r268= 867) >>> @@ -337,7 +337,8 @@ getsourcefilter(int s, uint32_t interfac >>> { >>> =09struct __msfilterreq=09 msfr; >>> =09sockunion_t=09=09*psu; >>> -=09int=09=09=09 err, level, nsrcs, optlen, optname; >>> +=09int=09=09=09 err, level, nsrcs, optname; >>> +=09unsigned int=09=09 optlen; >> >> This has mounds of style bugs. 2 more now (unsorting, and not using >> u_int, except u_int is not just a style bug) > > While aesthetically it may be better to keep the sorting, it doesn=92t se= em correct to preserve it at the expense of setting the incorrect type. Wou= ld you really want me to set optname in another line? You already had to change the sorting to split the declaration. When changing, it is better to put things in their correct place directly. u_int is sorted before int because it is a more complex type with a higher rank. socklen_t is sorted before int because it is a more complex type with an unknown (opaque) relative rank. >> % =09err =3D _getsockopt(s, level, optname, &msfr, &optlen); >> >> This use needs the correct type since the reference is indirect so the >> prototype can't adjust the type. The arg had type "int *" in 4.4BSD >> but has suffered from typedef poisoning so it is now "socklen_t *" >> 4.4BSD also doesn't have socklen_t. socklen_t is specified by POSIX >> as being an integer type with width at least 32 bits. It is not >> required to be unsigned, and there are portability problems from this. >> POSIX recommends that applications not store values larger than 2**31-1 >> in socklen_t. 2**31 would only work if it is unsigned. > > While locally the variable doesn=92t need to be unsigned, conceptually it= will never be less than zero. It is a common error to use unsigned types just because their value can never be less than zero. Most systems of arithmetic (floating point, bignums(?), ...) don't even have unsigned numbers. > In this case, for the compiler, setting it to usigned int or to socklen_t= makes no difference. In practice changing it from signed to unsigned has n= o effect either as the value will not be big enough to use the extra bit. > > It=92s all just a waste of time I guess, so as I said, I won=92t MFC the = change. It avoids warnings like: z.c:7: warning: pointer targets in passing arg 1 of `strlen' differ in sign= edness This warning is under -pedantic for gcc, so it is rarely seen. Other compilers may differ. With this warning and -Werror, you can't even pass a "u_char *" pointer to strlen(). Strings consist of plain chars so passing a "u_char *" to strlen() is a type mismatch. IIRC, the C standard requires a diagnostic for this, but gcc is not a C compiler even with -pedantic so it doesn't print the diagnostic without -pedantic. This sign mismatch may be a serious error even for the char type, but usually isn't. Bruce From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 14:06:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9211A371; Sat, 19 Jul 2014 14:06: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 6631E2EBC; Sat, 19 Jul 2014 14:06:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6JE6OeZ073928; Sat, 19 Jul 2014 14:06:24 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6JE6OmP073927; Sat, 19 Jul 2014 14:06:24 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201407191406.s6JE6OmP073927@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 19 Jul 2014 14:06:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268873 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 14:06:24 -0000 Author: jilles Date: Sat Jul 19 14:06:23 2014 New Revision: 268873 URL: http://svnweb.freebsd.org/changeset/base/268873 Log: sh: Deduplicate some code in ulimit builtin. Modified: head/bin/sh/miscbltin.c Modified: head/bin/sh/miscbltin.c ============================================================================== --- head/bin/sh/miscbltin.c Sat Jul 19 13:22:12 2014 (r268872) +++ head/bin/sh/miscbltin.c Sat Jul 19 14:06:23 2014 (r268873) @@ -411,12 +411,32 @@ static const struct limits limits[] = { { (char *) 0, (char *)0, 0, 0, '\0' } }; +enum limithow { SOFT = 0x1, HARD = 0x2 }; + +static void +printlimit(enum limithow how, const struct rlimit *limit, + const struct limits *l) +{ + rlim_t val = 0; + + if (how & SOFT) + val = limit->rlim_cur; + else if (how & HARD) + val = limit->rlim_max; + if (val == RLIM_INFINITY) + out1str("unlimited\n"); + else + { + val /= l->factor; + out1fmt("%jd\n", (intmax_t)val); + } +} + int ulimitcmd(int argc __unused, char **argv __unused) { rlim_t val = 0; - enum { SOFT = 0x1, HARD = 0x2 } - how = SOFT | HARD; + enum limithow how = SOFT | HARD; const struct limits *l; int set, all = 0; int optc, what; @@ -475,10 +495,6 @@ ulimitcmd(int argc __unused, char **argv char optbuf[40]; if (getrlimit(l->cmd, &limit) < 0) error("can't get limit: %s", strerror(errno)); - if (how & SOFT) - val = limit.rlim_cur; - else if (how & HARD) - val = limit.rlim_max; if (l->units) snprintf(optbuf, sizeof(optbuf), @@ -487,13 +503,7 @@ ulimitcmd(int argc __unused, char **argv snprintf(optbuf, sizeof(optbuf), "(-%c) ", l->option); out1fmt("%-18s %18s ", l->name, optbuf); - if (val == RLIM_INFINITY) - out1str("unlimited\n"); - else - { - val /= l->factor; - out1fmt("%jd\n", (intmax_t)val); - } + printlimit(how, &limit, l); } return 0; } @@ -507,19 +517,7 @@ ulimitcmd(int argc __unused, char **argv limit.rlim_max = val; if (setrlimit(l->cmd, &limit) < 0) error("bad limit: %s", strerror(errno)); - } else { - if (how & SOFT) - val = limit.rlim_cur; - else if (how & HARD) - val = limit.rlim_max; - - if (val == RLIM_INFINITY) - out1str("unlimited\n"); - else - { - val /= l->factor; - out1fmt("%jd\n", (intmax_t)val); - } - } + } else + printlimit(how, &limit, l); return 0; } From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 14:07:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BCE764C3; Sat, 19 Jul 2014 14:07:50 +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 A9ED92ED1; Sat, 19 Jul 2014 14:07:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6JE7om2074222; Sat, 19 Jul 2014 14:07:50 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6JE7oPJ074219; Sat, 19 Jul 2014 14:07:50 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201407191407.s6JE7oPJ074219@svn.freebsd.org> From: Baptiste Daroussin Date: Sat, 19 Jul 2014 14:07:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r268874 - in vendor/libucl/dist: src tests/basic X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 14:07:50 -0000 Author: bapt Date: Sat Jul 19 14:07:49 2014 New Revision: 268874 URL: http://svnweb.freebsd.org/changeset/base/268874 Log: Import libucl 20140718 (fixes a bug in the parser) Added: vendor/libucl/dist/tests/basic/11.in (contents, props changed) vendor/libucl/dist/tests/basic/11.res Modified: vendor/libucl/dist/src/ucl_parser.c Modified: vendor/libucl/dist/src/ucl_parser.c ============================================================================== --- vendor/libucl/dist/src/ucl_parser.c Sat Jul 19 14:06:23 2014 (r268873) +++ vendor/libucl/dist/src/ucl_parser.c Sat Jul 19 14:07:49 2014 (r268874) @@ -1661,6 +1661,11 @@ ucl_state_machine (struct ucl_parser *pa return false; } else { + /* Skip any spaces */ + while (p < chunk->end && ucl_test_character (*p, + UCL_CHARACTER_WHITESPACE_UNSAFE)) { + ucl_chunk_skipc (chunk, p); + } p = chunk->pos; if (*p == '[') { parser->state = UCL_STATE_VALUE; Added: vendor/libucl/dist/tests/basic/11.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libucl/dist/tests/basic/11.in Sat Jul 19 14:07:49 2014 (r268874) @@ -0,0 +1,3 @@ + + + {"key": "value"} Added: vendor/libucl/dist/tests/basic/11.res ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libucl/dist/tests/basic/11.res Sat Jul 19 14:07:49 2014 (r268874) @@ -0,0 +1,2 @@ +key = "value"; + From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 14:08:16 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9D14E5EC; Sat, 19 Jul 2014 14:08:16 +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 714022ED8; Sat, 19 Jul 2014 14:08:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6JE8GdV074357; Sat, 19 Jul 2014 14:08:16 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6JE8GTY074356; Sat, 19 Jul 2014 14:08:16 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201407191408.s6JE8GTY074356@svn.freebsd.org> From: Baptiste Daroussin Date: Sat, 19 Jul 2014 14:08:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r268875 - vendor/libucl/20140718 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 14:08:16 -0000 Author: bapt Date: Sat Jul 19 14:08:15 2014 New Revision: 268875 URL: http://svnweb.freebsd.org/changeset/base/268875 Log: Tag import of libucl 20140718 Added: vendor/libucl/20140718/ - copied from r268874, vendor/libucl/dist/ From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 14:10:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1AF5E835; Sat, 19 Jul 2014 14:10:32 +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 07CBA2EE9; Sat, 19 Jul 2014 14:10:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6JEAVQv075614; Sat, 19 Jul 2014 14:10:31 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6JEAVeT075610; Sat, 19 Jul 2014 14:10:31 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201407191410.s6JEAVeT075610@svn.freebsd.org> From: Baptiste Daroussin Date: Sat, 19 Jul 2014 14:10:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268876 - in head/contrib/libucl: src tests/basic X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 14:10:32 -0000 Author: bapt Date: Sat Jul 19 14:10:31 2014 New Revision: 268876 URL: http://svnweb.freebsd.org/changeset/base/268876 Log: Merge libucl 20140718 (fixes a bug in the parser) Added: head/contrib/libucl/tests/basic/11.in - copied unchanged from r268875, vendor/libucl/dist/tests/basic/11.in head/contrib/libucl/tests/basic/11.res - copied unchanged from r268875, vendor/libucl/dist/tests/basic/11.res Modified: head/contrib/libucl/src/ucl_parser.c Directory Properties: head/contrib/libucl/ (props changed) Modified: head/contrib/libucl/src/ucl_parser.c ============================================================================== --- head/contrib/libucl/src/ucl_parser.c Sat Jul 19 14:08:15 2014 (r268875) +++ head/contrib/libucl/src/ucl_parser.c Sat Jul 19 14:10:31 2014 (r268876) @@ -1661,6 +1661,11 @@ ucl_state_machine (struct ucl_parser *pa return false; } else { + /* Skip any spaces */ + while (p < chunk->end && ucl_test_character (*p, + UCL_CHARACTER_WHITESPACE_UNSAFE)) { + ucl_chunk_skipc (chunk, p); + } p = chunk->pos; if (*p == '[') { parser->state = UCL_STATE_VALUE; Copied: head/contrib/libucl/tests/basic/11.in (from r268875, vendor/libucl/dist/tests/basic/11.in) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libucl/tests/basic/11.in Sat Jul 19 14:10:31 2014 (r268876, copy of r268875, vendor/libucl/dist/tests/basic/11.in) @@ -0,0 +1,3 @@ + + + {"key": "value"} Copied: head/contrib/libucl/tests/basic/11.res (from r268875, vendor/libucl/dist/tests/basic/11.res) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libucl/tests/basic/11.res Sat Jul 19 14:10:31 2014 (r268876, copy of r268875, vendor/libucl/dist/tests/basic/11.res) @@ -0,0 +1,2 @@ +key = "value"; + From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 14:26:04 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 92DC4AC1; Sat, 19 Jul 2014 14:26:04 +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 8082D2039; Sat, 19 Jul 2014 14:26:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6JEQ4qk083863; Sat, 19 Jul 2014 14:26:04 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6JEQ4en083862; Sat, 19 Jul 2014 14:26:04 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201407191426.s6JEQ4en083862@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sat, 19 Jul 2014 14:26:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268877 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 14:26:04 -0000 Author: des Date: Sat Jul 19 14:26:04 2014 New Revision: 268877 URL: http://svnweb.freebsd.org/changeset/base/268877 Log: Use -o (output to file) instead of -t (print to stdout) and a redirect. MFC after: 1 week Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Sat Jul 19 14:10:31 2014 (r268876) +++ head/share/mk/bsd.dep.mk Sat Jul 19 14:26:04 2014 (r268877) @@ -82,7 +82,7 @@ ${_S:R}.o: ${_S} .for _LSRC in ${SRCS:M*.l:N*/*} .for _LC in ${_LSRC:R}.c ${_LC}: ${_LSRC} - ${LEX} -t ${LFLAGS} ${.ALLSRC} > ${.TARGET} + ${LEX} ${LFLAGS} -o ${.TARGET} ${.ALLSRC} .if !exists(${.OBJDIR}/${DEPENDFILE}) ${_LC:R}.o: ${_LC} .endif From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 14:34:07 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 49187C72; Sat, 19 Jul 2014 14:34:07 +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 3728E20D8; Sat, 19 Jul 2014 14:34:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6JEY7pW088195; Sat, 19 Jul 2014 14:34:07 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6JEY7g4088194; Sat, 19 Jul 2014 14:34:07 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407191434.s6JEY7g4088194@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 19 Jul 2014 14:34:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268878 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 14:34:07 -0000 Author: pfg Date: Sat Jul 19 14:34:06 2014 New Revision: 268878 URL: http://svnweb.freebsd.org/changeset/base/268878 Log: Clean r268867. Proposed by: bde Modified: head/lib/libc/net/sourcefilter.c Modified: head/lib/libc/net/sourcefilter.c ============================================================================== --- head/lib/libc/net/sourcefilter.c Sat Jul 19 14:26:04 2014 (r268877) +++ head/lib/libc/net/sourcefilter.c Sat Jul 19 14:34:06 2014 (r268878) @@ -337,8 +337,8 @@ getsourcefilter(int s, uint32_t interfac { struct __msfilterreq msfr; sockunion_t *psu; + socklen_t optlen; int err, level, nsrcs, optname; - unsigned int optlen; if (interface == 0 || group == NULL || numsrc == NULL || fmode == NULL) { From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 14:45:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A0447E41 for ; Sat, 19 Jul 2014 14:45:24 +0000 (UTC) Received: from nm42-vm5.bullet.mail.bf1.yahoo.com (nm42-vm5.bullet.mail.bf1.yahoo.com [216.109.114.204]) (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 425F2219C for ; Sat, 19 Jul 2014 14:45:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1405780782; bh=zvOkwxffsFhnrpnRkkGXIOG6uc7n9ny6Cj1OwcO4uo4=; h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=EXHeR+++pGjqTV/feCM9qyZPWsQMlnqlPXZ8dtFSKeyP0zBKewnyahMe/b9Hk1CbyiKctGkzClV0fO/JOyBG8jD6LU3eA7lBn5HezZD5ubApR+L3Vo7aysG+bFatmMRAKpo2mFBxgmrGSHwuHbYT1T1VurGTKjScc37cRBJEz5rmXTjTJQ1XMfUbE9xjm5t6aEfu7KiMqnZX/SCo6hsbuzgBwheVFFAOnqa1m3OP+Q8oOkknKCkHOni96Ox8+mwLoV++CkTkfj9R23TCzmBeSYuP7J4uakNLpdiXqnlH3UGd4ImDRiXCytF6v494YbLX1dtDJxWJgjnKt+KzDMy1kg== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com; b=N1dpRaUBEwv3K5RquNNtBZGyDYcJZ8ZDINNXcHPj7qpbuCzDSr9k003xw82jl/Id8EgGi1AGP0IOX72dAso1HY/NTRFDezF5DKtIES4/nDB+Fxa6qq3lKXJGmgnABfIhCWRgx1mU4UZLn2HUp6Z+CKamSGvITtorZLLcoihhVRThID3IYcHWJ3CLT/hq51l4DJGV9wCkf3fTXmEarRZ2WQ5nSGNfGldQ4g4YIT/tPWMBBjmgp2dD/lUxOQo+Pn4+XkQ8VE7IFVsBGukpDs/gaIr0Cg+a0bvxYdG5n6jG0YLUFNOLdODXkGYifW7+HBXE+tcMjptqgh4uoZHgM7oCKw==; Received: from [66.196.81.174] by nm42.bullet.mail.bf1.yahoo.com with NNFMP; 19 Jul 2014 14:39:42 -0000 Received: from [98.139.213.15] by tm20.bullet.mail.bf1.yahoo.com with NNFMP; 19 Jul 2014 14:39:42 -0000 Received: from [127.0.0.1] by smtp115.mail.bf1.yahoo.com with NNFMP; 19 Jul 2014 14:39:42 -0000 X-Yahoo-Newman-Id: 727504.65074.bm@smtp115.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: kJLmnDEVM1krQS6yQlYP6TtvJai.q12AArD5iI7pcRdULOA XcN5FloezKvzP8Ae7z1_nlS.blKnnv7pK2UN0uDoxxpHWbnpPKMUgNgDgj9j w57Fs1uNNttgla6qkY176gEgkUhL.guJY_7TSIEUjYkRp0OnNshfYXVE95RU HK95Hxz_LI0929cMB4om17op56ByUnDKT.JgyK29S9nnjAKPPHYCCztilAZw mOrLE8YpD6YNwRG9MC_9GLyGXFLSKgpT1JpBe4CHPgnv2ko3A.vuPq0FZSoc wdUcmCav_91_OEe5gspB.mALI5ENBQN7k_j5Ns5ba9o02M4r11QoVGV00pr9 nRwUL.tSCPPNyw7rM0VtU1Bm3ERIFI0rIVOxw19nbabbW143SKvlaJX25mou QPSgmrAjTaY42wLRiWp0NKlv9ZVUvQ0nZLKreP9ctTe.qAwPn47zMUd5t_kE BrZJ5rDs6e_jMO9BrKj2arqlT.G59xoy8J8BA0omn59F9dLDdMAfTbghkUe1 1fIX0tObW8h2CnzV_B8fLzEUIKb4- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Message-ID: <53CA8332.2060507@freebsd.org> Date: Sat, 19 Jul 2014 09:39:46 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Bruce Evans Subject: Re: svn commit: r268867 - head/lib/libc/net References: <201407190153.s6J1rqBn027367@svn.freebsd.org> <20140719171552.W874@besplex.bde.org> <20140719210009.O1782@besplex.bde.org> In-Reply-To: <20140719210009.O1782@besplex.bde.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 14:45:24 -0000 On 07/19/14 06:29, Bruce Evans wrote: > On Sat, 19 Jul 2014, Pedro Giffuni wrote: > >> Il giorno 19/lug/2014, alle ore 02:36, Bruce Evans >> ha scritto: >> >>> On Sat, 19 Jul 2014, Pedro F. Giffuni wrote: >>> >>>> Log: >>>> Use unsigned optlen in getsourcefilter() >>>> >>>> Sizes can not be negative and the functions that use it >>>> expect an unsigned value anyways. >>>> >>>> Obtained from: Apple (Libc-997.90.3) >>>> MFC after: 1 week >>> >>> Most uses of unsigned types are bugs. This one is an exception, but the >>> change is still wrong. The critical use of the type needs it to be >>> socklen_t, not int or unsigned int. socklen_t happens to have type >>> uint32_t (unsigned due to old bugs). It only accidentally has the >>> same size as unsigned int. It has a different type to plain int so >>> compilers should warn about the type mismatch with certain warning >>> flags. >>> >> >> Ah, yes, we have had this discussion before � in relation with ext2fs >> ;). > > Yes, it caused bugs in practice there. > >> The compiler doesn�t have a way to tell if socklen_t is of a certain >> type "by accident�. > > Yes, this is a fundamental problem with C typedefs -- they are too > similar > to their underlying type. > > Any size error would be detected more reliably than the sign error in > furture when int is expanded by socklen_t stays 32 bits. Except the > assumptions that int is 32 bits is even more established now than it > was on vaxes, so no one would expand int. > >> I will use socklen_t in this case instead of unsigned int, but I will >> not MFC the changes >> as the original change has no functional (end-user) effect. >> >> >>>> Modified: >>>> head/lib/libc/net/sourcefilter.c >>>> >>>> Modified: head/lib/libc/net/sourcefilter.c >>>> ============================================================================== >>>> >>>> --- head/lib/libc/net/sourcefilter.c Sat Jul 19 01:15:01 2014 >>>> (r268866) >>>> +++ head/lib/libc/net/sourcefilter.c Sat Jul 19 01:53:52 2014 >>>> (r268867) >>>> @@ -337,7 +337,8 @@ getsourcefilter(int s, uint32_t interfac >>>> { >>>> struct __msfilterreq msfr; >>>> sockunion_t *psu; >>>> - int err, level, nsrcs, optlen, optname; >>>> + int err, level, nsrcs, optname; >>>> + unsigned int optlen; >>> >>> This has mounds of style bugs. 2 more now (unsorting, and not using >>> u_int, except u_int is not just a style bug) >> >> While aesthetically it may be better to keep the sorting, it doesn�t >> seem correct to preserve it at the expense of setting the incorrect >> type. Would you really want me to set optname in another line? > > You already had to change the sorting to split the declaration. When > changing, it is better to put things in their correct place directly. > u_int is sorted before int because it is a more complex type with a > higher rank. socklen_t is sorted before int because it is a more > complex type with an unknown (opaque) relative rank. > Ugh.. wish they taught these type of things in books ... Hopefully I got it right this time ;). Thank you. From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 15:09:53 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B19BF18F; Sat, 19 Jul 2014 15:09:53 +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 9E879230F; Sat, 19 Jul 2014 15:09:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6JF9rFQ004207; Sat, 19 Jul 2014 15:09:53 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6JF9ruT004206; Sat, 19 Jul 2014 15:09:53 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201407191509.s6JF9ruT004206@svn.freebsd.org> From: Robert Watson Date: Sat, 19 Jul 2014 15:09:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268879 - head/usr.bin/procstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 15:09:53 -0000 Author: rwatson Date: Sat Jul 19 15:09:53 2014 New Revision: 268879 URL: http://svnweb.freebsd.org/changeset/base/268879 Log: Better align headers and data for 'procstat -f' with and without '-C'. MFC after: 3 days Sponsored by: DARPA, AFRL Modified: head/usr.bin/procstat/procstat_files.c Modified: head/usr.bin/procstat/procstat_files.c ============================================================================== --- head/usr.bin/procstat/procstat_files.c Sat Jul 19 14:34:06 2014 (r268878) +++ head/usr.bin/procstat/procstat_files.c Sat Jul 19 15:09:53 2014 (r268879) @@ -317,12 +317,12 @@ procstat_files(struct procstat *procstat if (!hflag) { if (Cflag) - printf("%5s %-16s %4s %1s %-9s %-*s " + printf("%5s %-16s %5s %1s %-8s %-*s " "%-3s %-12s\n", "PID", "COMM", "FD", "T", "FLAGS", capwidth, "CAPABILITIES", "PRO", "NAME"); else - printf("%5s %-16s %4s %1s %1s %-9s " + printf("%5s %-16s %5s %1s %1s %-8s " "%3s %7s %-3s %-12s\n", "PID", "COMM", "FD", "T", "V", "FLAGS", "REF", "OFFSET", "PRO", "NAME"); } @@ -450,6 +450,7 @@ procstat_files(struct procstat *procstat printf("%s", fst->fs_fflags & PS_FST_FFLAG_NONBLOCK ? "n" : "-"); printf("%s", fst->fs_fflags & PS_FST_FFLAG_DIRECT ? "d" : "-"); printf("%s", fst->fs_fflags & PS_FST_FFLAG_HASLOCK ? "l" : "-"); + printf(" "); if (!Cflag) { if (fst->fs_ref_count > -1) printf("%3d ", fst->fs_ref_count); From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 15:11:59 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D6BAB31F; Sat, 19 Jul 2014 15:11: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 A99C5238F; Sat, 19 Jul 2014 15:11:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6JFBxEV007868; Sat, 19 Jul 2014 15:11:59 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6JFBxd2007865; Sat, 19 Jul 2014 15:11:59 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201407191511.s6JFBxd2007865@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 19 Jul 2014 15:11:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268880 - in head/sys/powerpc: aim powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 15:11:59 -0000 Author: nwhitehorn Date: Sat Jul 19 15:11:58 2014 New Revision: 268880 URL: http://svnweb.freebsd.org/changeset/base/268880 Log: Allow mappings of memory not previously direct-mapped by the kernel when calling mmap on /dev/mem and add a handler for the possible userland machine checks that may result. Remove some pointless and wrong copy/paste that has been in here for a decade as well. This results in a /dev/mem with identical semantics to the x86 version. MFC after: 1 week Modified: head/sys/powerpc/aim/trap.c head/sys/powerpc/powerpc/mem.c Modified: head/sys/powerpc/aim/trap.c ============================================================================== --- head/sys/powerpc/aim/trap.c Sat Jul 19 15:09:53 2014 (r268879) +++ head/sys/powerpc/aim/trap.c Sat Jul 19 15:11:58 2014 (r268880) @@ -264,6 +264,15 @@ trap(struct trapframe *frame) } break; + case EXC_MCHK: + /* + * Note that this may not be recoverable for the user + * process, depending on the type of machine check, + * but it at least prevents the kernel from dying. + */ + sig = SIGBUS; + break; + default: trap_fatal(frame); } Modified: head/sys/powerpc/powerpc/mem.c ============================================================================== --- head/sys/powerpc/powerpc/mem.c Sat Jul 19 15:09:53 2014 (r268879) +++ head/sys/powerpc/powerpc/mem.c Sat Jul 19 15:11:58 2014 (r268880) @@ -179,22 +179,13 @@ memmmap(struct cdev *dev, vm_ooffset_t o { int i; - /* - * /dev/mem is the only one that makes sense through this - * interface. For /dev/kmem any physaddr we return here - * could be transient and hence incorrect or invalid at - * a later time. - */ - if (dev2unit(dev) != CDEV_MINOR_MEM) - return (-1); - - /* Only direct-mapped addresses. */ - if (mem_valid(offset, 0) - && pmap_dev_direct_mapped(offset, 0)) + if (dev2unit(dev) == CDEV_MINOR_MEM) + *paddr = offset; + else if (dev2unit(dev) == CDEV_MINOR_KMEM) + *paddr = vtophys(offset); + else return (EFAULT); - *paddr = offset; - for (i = 0; i < mem_range_softc.mr_ndesc; i++) { if (!(mem_range_softc.mr_desc[i].mr_flags & MDF_ACTIVE)) continue; @@ -231,9 +222,7 @@ ppc_mrinit(struct mem_range_softc *sc) sc->mr_cap = 0; sc->mr_ndesc = 8; /* XXX: Should be dynamically expandable */ sc->mr_desc = malloc(sc->mr_ndesc * sizeof(struct mem_range_desc), - M_MEMDESC, M_NOWAIT | M_ZERO); - if (sc->mr_desc == NULL) - panic("%s: malloc returns NULL", __func__); + M_MEMDESC, M_WAITOK | M_ZERO); } static int @@ -328,3 +317,4 @@ memioctl(struct cdev *dev __unused, u_lo } return (error); } + From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 15:12:38 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B2ECD45E; Sat, 19 Jul 2014 15:12: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 9F7672396; Sat, 19 Jul 2014 15:12:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6JFCcP2008051; Sat, 19 Jul 2014 15:12:38 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6JFCcMu008050; Sat, 19 Jul 2014 15:12:38 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201407191512.s6JFCcMu008050@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 19 Jul 2014 15:12:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268881 - stable/10/lib/libc/stdlib X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 15:12:38 -0000 Author: pfg Date: Sat Jul 19 15:12:38 2014 New Revision: 268881 URL: http://svnweb.freebsd.org/changeset/base/268881 Log: MFC r268569: strfmon: reduce unnecessary snprintf. No need for the snprintf/asprintf dance; use fixed width formats. Obtained from: NetBSD (CVS rev. 1.8) Modified: stable/10/lib/libc/stdlib/strfmon.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/stdlib/strfmon.c ============================================================================== --- stable/10/lib/libc/stdlib/strfmon.c Sat Jul 19 15:11:58 2014 (r268880) +++ stable/10/lib/libc/stdlib/strfmon.c Sat Jul 19 15:12:38 2014 (r268881) @@ -526,7 +526,6 @@ __format_grouped_double(double value, in char *rslt; char *avalue; int avalue_size; - char fmt[32]; size_t bufsize; char *bufend; @@ -567,14 +566,13 @@ __format_grouped_double(double value, in left_prec += get_groups(left_prec, grouping); /* convert to string */ - snprintf(fmt, sizeof(fmt), "%%%d.%df", left_prec + right_prec + 1, - right_prec); - avalue_size = asprintf(&avalue, fmt, value); + avalue_size = asprintf(&avalue, "%*.*f", left_prec + right_prec + 1, + right_prec, value); if (avalue_size < 0) return (NULL); /* make sure that we've enough space for result string */ - bufsize = strlen(avalue)*2+1; + bufsize = avalue_size * 2 + 1; rslt = calloc(1, bufsize); if (rslt == NULL) { free(avalue); From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 18:32:32 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 23D7D791; Sat, 19 Jul 2014 18:32:32 +0000 (UTC) Received: from mail-la0-x236.google.com (mail-la0-x236.google.com [IPv6:2a00:1450:4010:c03::236]) (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 DF4EA229F; Sat, 19 Jul 2014 18:32:30 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id el20so3663623lab.41 for ; Sat, 19 Jul 2014 11:32:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=/P8bDR/C8vDQkyKo5b8FgBE0ZxPQEL+Mn2H85N/mg/A=; b=V/7cW/aijadiijpphLvLlw6yLbrndJFheqzjukXhwbV7mzYklOzZBGr+NrpTaVpQ6K PTwqSmLRjIa9TQ9EI2QjBOcekuAqhVRl7rbtkgn/6bdaSUt8B2JuZvEUZuu+NgQnMDF/ xvKGze6wl+F/kRhtWfCHiVGbN+brpeDe3vPj75qd9fFwxWhj9a6uanZ+rQNVFs4zN2po fNSZAKkTIVLfGqgfcDfhzwn3GuT2aSXJwcaKtA55ieGEpa5mvqXd4bM3AF6scGHBpg6m 8WGZ9LYwxOZPYP2eSTmMR1EGIaq3RDKEbBUsYkoA4CBYN9sk4FGIIZLghtAqJhsQdwsl krxA== X-Received: by 10.152.5.105 with SMTP id r9mr13570231lar.37.1405794748460; Sat, 19 Jul 2014 11:32:28 -0700 (PDT) Received: from mavbook.mavhome.dp.ua ([91.198.175.1]) by mx.google.com with ESMTPSA id qv5sm15697162lbb.19.2014.07.19.11.32.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 19 Jul 2014 11:32:27 -0700 (PDT) Sender: Alexander Motin Message-ID: <53CAB9B9.6010504@FreeBSD.org> Date: Sat, 19 Jul 2014 21:32:25 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Robert Watson , Xin LI Subject: Re: svn commit: r268852 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys References: <201407181809.s6II9KkB002810@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-vendor@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 18:32:32 -0000 On 19.07.2014 13:42, Robert Watson wrote: > On Fri, 18 Jul 2014, Xin LI wrote: > >> Log: >> 5008 lock contention (rrw_exit) while running a read only load >> Reviewed by: Matthew Ahrens >> Reviewed by: George Wilson >> Reviewed by: Alex Reece >> Reviewed by: Christopher Siden >> Reviewed by: Richard Yao >> Reviewed by: Saso Kiselkov >> Approved by: Garrett D'Amore >> >> illumos/illumos-gate@c9030f6c93613fe30ee0c16f92b96da7816ac052 > > Is there an opportunity to use our own read-mostly lock implementation > here? It should be substantially more scalable, has integration with > WITNESS, proper priority propagation, etc. Our rmlock(4) tells: "Writers are permitted to sleep while holding a read-mostly lock, but readers are not." That is not acceptable for ZFS, which allocates memory in many places. Also the rrw locks used there have specific recursion semantics: readers are allowed to recurse on the lock even when there is waiting writer. But first read acquisition at the same situation is not allowed. I am not sure whether out rmlocks can do the same. -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 18:33:09 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9FABF8BD; Sat, 19 Jul 2014 18:33: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 8C5D322A8; Sat, 19 Jul 2014 18:33:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6JIX9ma003010; Sat, 19 Jul 2014 18:33:09 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6JIX9P8003009; Sat, 19 Jul 2014 18:33:09 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201407191833.s6JIX9P8003009@svn.freebsd.org> From: Dimitry Andric Date: Sat, 19 Jul 2014 18:33:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r268882 - in stable: 10/sys/conf 9/sys/conf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 18:33:09 -0000 Author: dim Date: Sat Jul 19 18:33:09 2014 New Revision: 268882 URL: http://svnweb.freebsd.org/changeset/base/268882 Log: MFC r268774: After r261991, clang warnings about unused functions in the kernel were completely silenced. Make sure these warnings appear again, so there is some incentive to fix them, but do not error out the whole kernel build for them. Noticed by: steven@pyro.eu.org PR: 191867 Modified: stable/9/sys/conf/kern.mk Directory Properties: stable/9/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/conf/kern.mk Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/conf/kern.mk ============================================================================== --- stable/9/sys/conf/kern.mk Sat Jul 19 15:12:38 2014 (r268881) +++ stable/9/sys/conf/kern.mk Sat Jul 19 18:33:09 2014 (r268882) @@ -30,7 +30,7 @@ NO_WSOMETIMES_UNINITIALIZED= -Wno-error- # enough to error out the whole kernel build. Display them anyway, so there is # some incentive to fix them eventually. CWARNEXTRA?= -Wno-error-tautological-compare -Wno-error-empty-body \ - -Wno-error-parentheses-equality -Wno-unused-function + -Wno-error-parentheses-equality -Wno-error-unused-function .endif # From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 18:33:10 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F1A368BE; Sat, 19 Jul 2014 18:33: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 DE23E22A9; Sat, 19 Jul 2014 18:33:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6JIX9ra003018; Sat, 19 Jul 2014 18:33:09 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6JIX9WR003017; Sat, 19 Jul 2014 18:33:09 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201407191833.s6JIX9WR003017@svn.freebsd.org> From: Dimitry Andric Date: Sat, 19 Jul 2014 18:33:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268882 - in stable: 10/sys/conf 9/sys/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 18:33:10 -0000 Author: dim Date: Sat Jul 19 18:33:09 2014 New Revision: 268882 URL: http://svnweb.freebsd.org/changeset/base/268882 Log: MFC r268774: After r261991, clang warnings about unused functions in the kernel were completely silenced. Make sure these warnings appear again, so there is some incentive to fix them, but do not error out the whole kernel build for them. Noticed by: steven@pyro.eu.org PR: 191867 Modified: stable/10/sys/conf/kern.mk Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/conf/kern.mk Directory Properties: stable/9/sys/ (props changed) Modified: stable/10/sys/conf/kern.mk ============================================================================== --- stable/10/sys/conf/kern.mk Sat Jul 19 15:12:38 2014 (r268881) +++ stable/10/sys/conf/kern.mk Sat Jul 19 18:33:09 2014 (r268882) @@ -29,7 +29,7 @@ NO_WSOMETIMES_UNINITIALIZED= -Wno-error- # enough to error out the whole kernel build. Display them anyway, so there is # some incentive to fix them eventually. CWARNEXTRA?= -Wno-error-tautological-compare -Wno-error-empty-body \ - -Wno-error-parentheses-equality -Wno-unused-function \ + -Wno-error-parentheses-equality -Wno-error-unused-function \ ${NO_WFORMAT} .endif From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 18:38:50 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1FD6CC36; Sat, 19 Jul 2014 18:38:50 +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 0B92B22EB; Sat, 19 Jul 2014 18:38:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6JIcnhO003947; Sat, 19 Jul 2014 18:38:49 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6JIcnKP003942; Sat, 19 Jul 2014 18:38:49 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201407191838.s6JIcnKP003942@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sat, 19 Jul 2014 18:38:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268883 - in head: contrib/unbound contrib/unbound/util lib/libunbound X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 18:38:50 -0000 Author: des Date: Sat Jul 19 18:38:48 2014 New Revision: 268883 URL: http://svnweb.freebsd.org/changeset/base/268883 Log: Clean up the libunbound build to avoid accidentally regenerating the configuration lexer and parser during buildworld. Instead of being included in the source as it is in the upstream distribution, the code is now always generated (in ${.OBJDIR}) at build time. PR: 190739 MFC after: 1 week Deleted: head/contrib/unbound/util/configlexer.c head/contrib/unbound/util/configparser.c head/contrib/unbound/util/configparser.h Modified: head/contrib/unbound/freebsd-configure.sh head/contrib/unbound/util/config_file.c head/contrib/unbound/util/configlexer.lex head/contrib/unbound/util/configparser.y head/lib/libunbound/Makefile Modified: head/contrib/unbound/freebsd-configure.sh ============================================================================== --- head/contrib/unbound/freebsd-configure.sh Sat Jul 19 18:33:09 2014 (r268882) +++ head/contrib/unbound/freebsd-configure.sh Sat Jul 19 18:38:48 2014 (r268883) @@ -32,13 +32,6 @@ autoheader --with-run-dir=/var/unbound \ --with-username=unbound -# Regenerate the configuration parser -{ -cat <util/configlexer.c - -/usr/bin/yacc -d -o util/configparser.c util/configparser.y +# Don't try to provide bogus memory usage statistics based on sbrk(2). +sed -n -i.orig -e '/HAVE_SBRK/!p' config.status +./config.status config.h Modified: head/contrib/unbound/util/config_file.c ============================================================================== --- head/contrib/unbound/util/config_file.c Sat Jul 19 18:33:09 2014 (r268882) +++ head/contrib/unbound/util/config_file.c Sat Jul 19 18:38:48 2014 (r268883) @@ -48,7 +48,7 @@ #include "util/log.h" #include "util/configyyrename.h" #include "util/config_file.h" -#include "util/configparser.h" +#include "configparser.h" #include "util/net_help.h" #include "util/data/msgparse.h" #include "util/module.h" Modified: head/contrib/unbound/util/configlexer.lex ============================================================================== --- head/contrib/unbound/util/configlexer.lex Sat Jul 19 18:33:09 2014 (r268882) +++ head/contrib/unbound/util/configlexer.lex Sat Jul 19 18:38:48 2014 (r268883) @@ -8,6 +8,8 @@ * */ +#include "config.h" + #include #include #include @@ -16,7 +18,7 @@ #endif #include "util/config_file.h" -#include "util/configparser.h" +#include "configparser.h" void ub_c_error(const char *message); #if 0 @@ -26,13 +28,13 @@ void ub_c_error(const char *message); #endif /** avoid warning in about fwrite return value */ -#define ECHO ub_c_error_msg("syntax error at text: %s", yytext) +#define ECHO ub_c_error_msg("syntax error at text: %s", ub_c_text) /** A parser variable, this is a statement in the config file which is * of the form variable: value1 value2 ... nargs is the number of values. */ #define YDVAR(nargs, var) \ num_args=(nargs); \ - LEXOUT(("v(%s%d) ", yytext, num_args)); \ + LEXOUT(("v(%s%d) ", ub_c_text, num_args)); \ if(num_args > 0) { BEGIN(val); } \ return (var); @@ -166,7 +168,7 @@ static void config_end_include(void) #define yy_set_bol(at_bol) \ { \ if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer = yy_create_buffer( ub_c_in, YY_BUF_SIZE ); \ yy_current_buffer->yy_ch_buf[0] = ((at_bol)?'\n':' '); \ } #endif @@ -200,7 +202,7 @@ SQANY [^\'\n\r\\]|\\. LEXOUT(("SP ")); /* ignore */ } {SPACE}*{COMMENT}.* { /* note that flex makes the longest match and '.' is any but not nl */ - LEXOUT(("comment(%s) ", yytext)); /* ignore */ } + LEXOUT(("comment(%s) ", ub_c_text)); /* ignore */ } server{COLON} { YDVAR(0, VAR_SERVER) } num-threads{COLON} { YDVAR(1, VAR_NUM_THREADS) } verbosity{COLON} { YDVAR(1, VAR_VERBOSITY) } @@ -331,71 +333,71 @@ max-udp-size{COLON} { YDVAR(1, VAR_MAX_ /* Quoted strings. Strip leading and ending quotes */ \" { BEGIN(quotedstring); LEXOUT(("QS ")); } <> { - yyerror("EOF inside quoted string"); + ub_c_error("EOF inside quoted string"); if(--num_args == 0) { BEGIN(INITIAL); } else { BEGIN(val); } } -{DQANY}* { LEXOUT(("STR(%s) ", yytext)); yymore(); } -{NEWLINE} { yyerror("newline inside quoted string, no end \""); +{DQANY}* { LEXOUT(("STR(%s) ", ub_c_text)); yymore(); } +{NEWLINE} { ub_c_error("newline inside quoted string, no end \""); cfg_parser->line++; BEGIN(INITIAL); } \" { LEXOUT(("QE ")); if(--num_args == 0) { BEGIN(INITIAL); } else { BEGIN(val); } - yytext[yyleng - 1] = '\0'; - yylval.str = strdup(yytext); - if(!yylval.str) - yyerror("out of memory"); + ub_c_text[ub_c_leng - 1] = '\0'; + ub_c_lval.str = strdup(ub_c_text); + if(!ub_c_lval.str) + ub_c_error("out of memory"); return STRING_ARG; } /* Single Quoted strings. Strip leading and ending quotes */ \' { BEGIN(singlequotedstr); LEXOUT(("SQS ")); } <> { - yyerror("EOF inside quoted string"); + ub_c_error("EOF inside quoted string"); if(--num_args == 0) { BEGIN(INITIAL); } else { BEGIN(val); } } -{SQANY}* { LEXOUT(("STR(%s) ", yytext)); yymore(); } -{NEWLINE} { yyerror("newline inside quoted string, no end '"); +{SQANY}* { LEXOUT(("STR(%s) ", ub_c_text)); yymore(); } +{NEWLINE} { ub_c_error("newline inside quoted string, no end '"); cfg_parser->line++; BEGIN(INITIAL); } \' { LEXOUT(("SQE ")); if(--num_args == 0) { BEGIN(INITIAL); } else { BEGIN(val); } - yytext[yyleng - 1] = '\0'; - yylval.str = strdup(yytext); - if(!yylval.str) - yyerror("out of memory"); + ub_c_text[ub_c_leng - 1] = '\0'; + ub_c_lval.str = strdup(ub_c_text); + if(!ub_c_lval.str) + ub_c_error("out of memory"); return STRING_ARG; } /* include: directive */ include{COLON} { - LEXOUT(("v(%s) ", yytext)); inc_prev = YYSTATE; BEGIN(include); } + LEXOUT(("v(%s) ", ub_c_text)); inc_prev = YYSTATE; BEGIN(include); } <> { - yyerror("EOF inside include directive"); + ub_c_error("EOF inside include directive"); BEGIN(inc_prev); } {SPACE}* { LEXOUT(("ISP ")); /* ignore */ } {NEWLINE} { LEXOUT(("NL\n")); cfg_parser->line++;} \" { LEXOUT(("IQS ")); BEGIN(include_quoted); } {UNQUOTEDLETTER}* { - LEXOUT(("Iunquotedstr(%s) ", yytext)); - config_start_include_glob(yytext); + LEXOUT(("Iunquotedstr(%s) ", ub_c_text)); + config_start_include_glob(ub_c_text); BEGIN(inc_prev); } <> { - yyerror("EOF inside quoted string"); + ub_c_error("EOF inside quoted string"); BEGIN(inc_prev); } -{DQANY}* { LEXOUT(("ISTR(%s) ", yytext)); yymore(); } -{NEWLINE} { yyerror("newline before \" in include name"); +{DQANY}* { LEXOUT(("ISTR(%s) ", ub_c_text)); yymore(); } +{NEWLINE} { ub_c_error("newline before \" in include name"); cfg_parser->line++; BEGIN(inc_prev); } \" { LEXOUT(("IQE ")); - yytext[yyleng - 1] = '\0'; - config_start_include_glob(yytext); + ub_c_text[ub_c_leng - 1] = '\0'; + config_start_include_glob(ub_c_text); BEGIN(inc_prev); } <> { @@ -404,21 +406,21 @@ max-udp-size{COLON} { YDVAR(1, VAR_MAX_ if (!config_include_stack) { yyterminate(); } else { - fclose(yyin); + fclose(ub_c_in); config_end_include(); } } -{UNQUOTEDLETTER}* { LEXOUT(("unquotedstr(%s) ", yytext)); +{UNQUOTEDLETTER}* { LEXOUT(("unquotedstr(%s) ", ub_c_text)); if(--num_args == 0) { BEGIN(INITIAL); } - yylval.str = strdup(yytext); return STRING_ARG; } + ub_c_lval.str = strdup(ub_c_text); return STRING_ARG; } {UNQUOTEDLETTER_NOCOLON}* { - ub_c_error_msg("unknown keyword '%s'", yytext); + ub_c_error_msg("unknown keyword '%s'", ub_c_text); } <*>. { - ub_c_error_msg("stray '%s'", yytext); + ub_c_error_msg("stray '%s'", ub_c_text); } %% Modified: head/contrib/unbound/util/configparser.y ============================================================================== --- head/contrib/unbound/util/configparser.y Sat Jul 19 18:33:09 2014 (r268882) +++ head/contrib/unbound/util/configparser.y Sat Jul 19 18:38:48 2014 (r268883) @@ -44,7 +44,6 @@ #include #include -#include "util/configyyrename.h" #include "util/config_file.h" #include "util/net_help.h" Modified: head/lib/libunbound/Makefile ============================================================================== --- head/lib/libunbound/Makefile Sat Jul 19 18:33:09 2014 (r268882) +++ head/lib/libunbound/Makefile Sat Jul 19 18:38:48 2014 (r268883) @@ -10,9 +10,9 @@ UNBOUNDDIR= ${.CURDIR}/../../contrib/unb LIB= unbound PRIVATELIB= -CFLAGS= -I${UNBOUNDDIR} -I${LDNSDIR} +CFLAGS= -I${UNBOUNDDIR} -I${LDNSDIR} -I${.OBJDIR} -SRCS= alloc.c autotrust.c config_file.c configlexer.c configparser.c \ +SRCS= alloc.c autotrust.c config_file.c configlexer.l configparser.y \ context.c dname.c dns.c dnstree.c fptr_wlist.c infra.c \ iter_delegpt.c iter_donotq.c iter_fwd.c iter_hints.c iter_priv.c \ iter_resptype.c iter_scrub.c iter_utils.c iterator.c keyraw.c \ @@ -31,4 +31,13 @@ WARNS?= 3 DPADD+= ${LIBSSL} ${LIBCRYPTO} ${LIBPTHREAD} LDADD+= -lssl -lcrypto -lpthread +# Misnamed file in upstream source +configlexer.l: configlexer.lex + cp -p ${.ALLSRC} ${.TARGET} +CLEANFILES+= configlexer.l + +# Symbol prefix for lex and yacc +LFLAGS= -Pub_c_ +YFLAGS= -pub_c_ -d + .include From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 19:56:24 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F3B2EA85; Sat, 19 Jul 2014 19:56:23 +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 E03442933; Sat, 19 Jul 2014 19:56:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6JJuN9B043182; Sat, 19 Jul 2014 19:56:23 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6JJuNEl043180; Sat, 19 Jul 2014 19:56:23 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201407191956.s6JJuNEl043180@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 19 Jul 2014 19:56:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268884 - stable/10/sys/dev/usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 19:56:24 -0000 Author: hselasky Date: Sat Jul 19 19:56:23 2014 New Revision: 268884 URL: http://svnweb.freebsd.org/changeset/base/268884 Log: MFC r268735: Improve support for Intel Lynx Point USB 3.0 controllers by using the USB 2.0 port mask in addition to the USB 3.0 port mask. The hardware does not always accept when writing -1U to the port switching registers. Modified: stable/10/sys/dev/usb/controller/xhci_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- stable/10/sys/dev/usb/controller/xhci_pci.c Sat Jul 19 18:38:48 2014 (r268883) +++ stable/10/sys/dev/usb/controller/xhci_pci.c Sat Jul 19 19:56:23 2014 (r268884) @@ -150,6 +150,8 @@ static int xhci_pci_port_route(device_t self, uint32_t set, uint32_t clear) { uint32_t temp; + uint32_t usb3_mask; + uint32_t usb2_mask; temp = pci_read_config(self, PCI_XHCI_INTEL_USB3_PSSEN, 4) | pci_read_config(self, PCI_XHCI_INTEL_XUSB2PR, 4); @@ -158,10 +160,11 @@ xhci_pci_port_route(device_t self, uint3 temp &= ~clear; /* Don't set bits which the hardware doesn't support */ - temp &= pci_read_config(self, PCI_XHCI_INTEL_USB3PRM, 4); + usb3_mask = pci_read_config(self, PCI_XHCI_INTEL_USB3PRM, 4); + usb2_mask = pci_read_config(self, PCI_XHCI_INTEL_USB2PRM, 4); - pci_write_config(self, PCI_XHCI_INTEL_USB3_PSSEN, temp, 4); - pci_write_config(self, PCI_XHCI_INTEL_XUSB2PR, temp, 4); + pci_write_config(self, PCI_XHCI_INTEL_USB3_PSSEN, temp & usb3_mask, 4); + pci_write_config(self, PCI_XHCI_INTEL_XUSB2PR, temp & usb2_mask, 4); device_printf(self, "Port routing mask set to 0x%08x\n", temp); From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 19:57:27 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ABC4ABCC; Sat, 19 Jul 2014 19:57:27 +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 982E4293C; Sat, 19 Jul 2014 19:57:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6JJvRQe043408; Sat, 19 Jul 2014 19:57:27 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6JJvRbs043406; Sat, 19 Jul 2014 19:57:27 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201407191957.s6JJvRbs043406@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 19 Jul 2014 19:57:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r268885 - stable/9/sys/dev/usb/controller X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 19:57:27 -0000 Author: hselasky Date: Sat Jul 19 19:57:27 2014 New Revision: 268885 URL: http://svnweb.freebsd.org/changeset/base/268885 Log: MFC r268735: Improve support for Intel Lynx Point USB 3.0 controllers by using the USB 2.0 port mask in addition to the USB 3.0 port mask. The hardware does not always accept when writing -1U to the port switching registers. Modified: stable/9/sys/dev/usb/controller/xhci_pci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- stable/9/sys/dev/usb/controller/xhci_pci.c Sat Jul 19 19:56:23 2014 (r268884) +++ stable/9/sys/dev/usb/controller/xhci_pci.c Sat Jul 19 19:57:27 2014 (r268885) @@ -140,6 +140,8 @@ static int xhci_pci_port_route(device_t self, uint32_t set, uint32_t clear) { uint32_t temp; + uint32_t usb3_mask; + uint32_t usb2_mask; temp = pci_read_config(self, PCI_XHCI_INTEL_USB3_PSSEN, 4) | pci_read_config(self, PCI_XHCI_INTEL_XUSB2PR, 4); @@ -148,10 +150,11 @@ xhci_pci_port_route(device_t self, uint3 temp &= ~clear; /* Don't set bits which the hardware doesn't support */ - temp &= pci_read_config(self, PCI_XHCI_INTEL_USB3PRM, 4); + usb3_mask = pci_read_config(self, PCI_XHCI_INTEL_USB3PRM, 4); + usb2_mask = pci_read_config(self, PCI_XHCI_INTEL_USB2PRM, 4); - pci_write_config(self, PCI_XHCI_INTEL_USB3_PSSEN, temp, 4); - pci_write_config(self, PCI_XHCI_INTEL_XUSB2PR, temp, 4); + pci_write_config(self, PCI_XHCI_INTEL_USB3_PSSEN, temp & usb3_mask, 4); + pci_write_config(self, PCI_XHCI_INTEL_XUSB2PR, temp & usb2_mask, 4); device_printf(self, "Port routing mask set to 0x%08x\n", temp); From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 19:58:26 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CEB4BDD8; Sat, 19 Jul 2014 19:58:26 +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 BB0B6294B; Sat, 19 Jul 2014 19:58:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6JJwQJ0043675; Sat, 19 Jul 2014 19:58:26 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6JJwQe4043674; Sat, 19 Jul 2014 19:58:26 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201407191958.s6JJwQe4043674@svn.freebsd.org> From: Hans Petter Selasky Date: Sat, 19 Jul 2014 19:58:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r268886 - stable/8/sys/dev/usb/controller X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 19:58:26 -0000 Author: hselasky Date: Sat Jul 19 19:58:26 2014 New Revision: 268886 URL: http://svnweb.freebsd.org/changeset/base/268886 Log: MFC r268735: Improve support for Intel Lynx Point USB 3.0 controllers by using the USB 2.0 port mask in addition to the USB 3.0 port mask. The hardware does not always accept when writing -1U to the port switching registers. Modified: stable/8/sys/dev/usb/controller/xhci_pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- stable/8/sys/dev/usb/controller/xhci_pci.c Sat Jul 19 19:57:27 2014 (r268885) +++ stable/8/sys/dev/usb/controller/xhci_pci.c Sat Jul 19 19:58:26 2014 (r268886) @@ -140,6 +140,8 @@ static int xhci_pci_port_route(device_t self, uint32_t set, uint32_t clear) { uint32_t temp; + uint32_t usb3_mask; + uint32_t usb2_mask; temp = pci_read_config(self, PCI_XHCI_INTEL_USB3_PSSEN, 4) | pci_read_config(self, PCI_XHCI_INTEL_XUSB2PR, 4); @@ -148,10 +150,11 @@ xhci_pci_port_route(device_t self, uint3 temp &= ~clear; /* Don't set bits which the hardware doesn't support */ - temp &= pci_read_config(self, PCI_XHCI_INTEL_USB3PRM, 4); + usb3_mask = pci_read_config(self, PCI_XHCI_INTEL_USB3PRM, 4); + usb2_mask = pci_read_config(self, PCI_XHCI_INTEL_USB2PRM, 4); - pci_write_config(self, PCI_XHCI_INTEL_USB3_PSSEN, temp, 4); - pci_write_config(self, PCI_XHCI_INTEL_XUSB2PR, temp, 4); + pci_write_config(self, PCI_XHCI_INTEL_USB3_PSSEN, temp & usb3_mask, 4); + pci_write_config(self, PCI_XHCI_INTEL_XUSB2PR, temp & usb2_mask, 4); device_printf(self, "Port routing mask set to 0x%08x\n", temp); From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 20:13:02 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9E8F82BF; Sat, 19 Jul 2014 20:13:02 +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 8A1912AD3; Sat, 19 Jul 2014 20:13:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6JKD2ln052728; Sat, 19 Jul 2014 20:13:02 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6JKD1NE052720; Sat, 19 Jul 2014 20:13:01 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201407192013.s6JKD1NE052720@svn.freebsd.org> From: John Baldwin Date: Sat, 19 Jul 2014 20:13:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268887 - stable/10/usr.sbin/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 20:13:02 -0000 Author: jhb Date: Sat Jul 19 20:13:01 2014 New Revision: 268887 URL: http://svnweb.freebsd.org/changeset/base/268887 Log: MFC 261904,261905,262143,262184,264921,265211,267169,267292,267294: Various PCI fixes: - Allow PCI devices to be configured on all valid bus numbers from 0 to 255. - Tweak the handling of PCI capabilities in emulated devices to remove the non-standard zero capability list terminator. - Add a check to validate that memory BARs of passthru devices are 4KB aligned. - Respect and track the enable bit in the PCI configuration address word. - Handle quad-word access to 32-bit register pairs. Modified: stable/10/usr.sbin/bhyve/acpi.c stable/10/usr.sbin/bhyve/bhyve.8 stable/10/usr.sbin/bhyve/bhyverun.c stable/10/usr.sbin/bhyve/mptbl.c stable/10/usr.sbin/bhyve/pci_emul.c stable/10/usr.sbin/bhyve/pci_emul.h stable/10/usr.sbin/bhyve/pci_lpc.c stable/10/usr.sbin/bhyve/pci_passthru.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/acpi.c ============================================================================== --- stable/10/usr.sbin/bhyve/acpi.c Sat Jul 19 19:58:26 2014 (r268886) +++ stable/10/usr.sbin/bhyve/acpi.c Sat Jul 19 20:13:01 2014 (r268887) @@ -713,7 +713,7 @@ basl_fwrite_dsdt(FILE *fp) pci_write_dsdt(); dsdt_line(""); - dsdt_line(" Scope (_SB.PCI0)"); + dsdt_line(" Scope (_SB.PC00)"); dsdt_line(" {"); dsdt_line(" Device (HPET)"); dsdt_line(" {"); Modified: stable/10/usr.sbin/bhyve/bhyve.8 ============================================================================== --- stable/10/usr.sbin/bhyve/bhyve.8 Sat Jul 19 19:58:26 2014 (r268886) +++ stable/10/usr.sbin/bhyve/bhyve.8 Sat Jul 19 20:13:01 2014 (r268887) @@ -100,12 +100,16 @@ There are 32 available slots, with the o per slot. .Bl -tag -width 10n .It Ar slot -.Ar pcislot Ns Op Ar :function +.Ar pcislot[:function] +.Ar bus:pcislot:function .Pp The .Ar pcislot -value is 0 to 31 and the optional function value is 0 to 7. +value is 0 to 31. The optional function value is 0 to 7. The optional +.Ar bus +value is 0 to 255. If not specified, the function value defaults to 0. +If not specified, the bus value defaults to 0. .It Ar emulation .Bl -tag -width 10n .It Li hostbridge | Li amd_hostbridge @@ -130,7 +134,8 @@ AHCI controller attached to a SATA hard- .It Li uart PCI 16550 serial device. .It Li lpc -LPC PCI-ISA bridge with COM1 and COM2 16550 serial ports. +LPC PCI-ISA bridge with COM1 and COM2 16550 serial ports. The LPC bridge +emulation can only be configured on bus 0. .El .It Op Ar conf This optional parameter describes the backend for device emulations. @@ -227,6 +232,8 @@ This is intended for debug purposes. Ignore accesses to unimplemented Model Specific Registers (MSRs). This is intended for debug purposes. .It Fl x The guest's local APIC is configured in x2APIC mode. +.It Fl Y +Disable MPtable generation. .It Fl h Print help message and exit. .It Ar vmname Modified: stable/10/usr.sbin/bhyve/bhyverun.c ============================================================================== --- stable/10/usr.sbin/bhyve/bhyverun.c Sat Jul 19 19:58:26 2014 (r268886) +++ stable/10/usr.sbin/bhyve/bhyverun.c Sat Jul 19 20:13:01 2014 (r268887) @@ -144,6 +144,7 @@ usage(int code) " -m: memory size in MB\n" " -w: ignore unimplemented MSRs\n" " -x: local apic is in x2APIC mode\n" + " -Y: disable MPtable generation\n" " -U: uuid\n", progname, (int)strlen(progname), ""); @@ -591,7 +592,7 @@ int main(int argc, char *argv[]) { int c, error, gdb_port, err, bvmcons; - int max_vcpus; + int max_vcpus, mptgen; struct vmctx *ctx; uint64_t rip; size_t memsize; @@ -601,8 +602,9 @@ main(int argc, char *argv[]) gdb_port = 0; guest_ncpus = 1; memsize = 256 * MB; + mptgen = 1; - while ((c = getopt(argc, argv, "abehwxAHIPWp:g:c:s:m:l:U:")) != -1) { + while ((c = getopt(argc, argv, "abehwxAHIPWYp:g:c:s:m:l:U:")) != -1) { switch (c) { case 'a': x2apic_mode = 0; @@ -668,6 +670,9 @@ main(int argc, char *argv[]) case 'x': x2apic_mode = 1; break; + case 'Y': + mptgen = 0; + break; case 'h': usage(0); default: @@ -727,7 +732,11 @@ main(int argc, char *argv[]) /* * build the guest tables, MP etc. */ - mptable_build(ctx, guest_ncpus); + if (mptgen) { + error = mptable_build(ctx, guest_ncpus); + if (error) + exit(1); + } error = smbios_build(ctx); assert(error == 0); Modified: stable/10/usr.sbin/bhyve/mptbl.c ============================================================================== --- stable/10/usr.sbin/bhyve/mptbl.c Sat Jul 19 19:58:26 2014 (r268886) +++ stable/10/usr.sbin/bhyve/mptbl.c Sat Jul 19 20:13:01 2014 (r268887) @@ -196,16 +196,21 @@ mpt_build_ioapic_entries(io_apic_entry_p static int mpt_count_ioint_entries(void) { + int bus, count; + + count = 0; + for (bus = 0; bus <= PCI_BUSMAX; bus++) + count += pci_count_lintr(bus); /* * Always include entries for the first 16 pins along with a entry * for each active PCI INTx pin. */ - return (16 + pci_count_lintr()); + return (16 + count); } static void -mpt_generate_pci_int(int slot, int pin, int ioapic_irq, void *arg) +mpt_generate_pci_int(int bus, int slot, int pin, int ioapic_irq, void *arg) { int_entry_ptr *mpiep, mpie; @@ -219,7 +224,7 @@ mpt_generate_pci_int(int slot, int pin, */ mpie->type = MPCT_ENTRY_INT; mpie->int_type = INTENTRY_TYPE_INT; - mpie->src_bus_id = 0; + mpie->src_bus_id = bus; mpie->src_bus_irq = slot << 2 | (pin - 1); mpie->dst_apic_id = mpie[-1].dst_apic_id; mpie->dst_apic_int = ioapic_irq; @@ -230,7 +235,7 @@ mpt_generate_pci_int(int slot, int pin, static void mpt_build_ioint_entries(int_entry_ptr mpie, int id) { - int pin; + int pin, bus; /* * The following config is taken from kernel mptable.c @@ -277,7 +282,8 @@ mpt_build_ioint_entries(int_entry_ptr mp } /* Next, generate entries for any PCI INTx interrupts. */ - pci_walk_lintr(mpt_generate_pci_int, &mpie); + for (bus = 0; bus <= PCI_BUSMAX; bus++) + pci_walk_lintr(bus, mpt_generate_pci_int, &mpie); } void @@ -297,16 +303,31 @@ mptable_build(struct vmctx *ctx, int ncp proc_entry_ptr mpep; mpfps_t mpfp; int_entry_ptr mpie; - int ioints; + int ioints, bus; char *curraddr; char *startaddr; startaddr = paddr_guest2host(ctx, MPTABLE_BASE, MPTABLE_MAX_LENGTH); if (startaddr == NULL) { - printf("mptable requires mapped mem\n"); + fprintf(stderr, "mptable requires mapped mem\n"); return (ENOMEM); } + /* + * There is no way to advertise multiple PCI hierarchies via MPtable + * so require that there is no PCI hierarchy with a non-zero bus + * number. + */ + for (bus = 1; bus <= PCI_BUSMAX; bus++) { + if (pci_bus_configured(bus)) { + fprintf(stderr, "MPtable is incompatible with " + "multiple PCI hierarchies.\r\n"); + fprintf(stderr, "MPtable generation can be disabled " + "by passing the -Y option to bhyve(8).\r\n"); + return (EINVAL); + } + } + curraddr = startaddr; mpfp = (mpfps_t)curraddr; mpt_build_mpfp(mpfp, MPTABLE_BASE); Modified: stable/10/usr.sbin/bhyve/pci_emul.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_emul.c Sat Jul 19 19:58:26 2014 (r268886) +++ stable/10/usr.sbin/bhyve/pci_emul.c Sat Jul 19 20:13:01 2014 (r268887) @@ -69,6 +69,7 @@ do { \ } \ } while (0) +#define MAXBUSES (PCI_BUSMAX + 1) #define MAXSLOTS (PCI_SLOTMAX + 1) #define MAXFUNCS (PCI_FUNCMAX + 1) @@ -86,7 +87,16 @@ struct intxinfo { struct slotinfo { struct intxinfo si_intpins[4]; struct funcinfo si_funcs[MAXFUNCS]; -} pci_slotinfo[MAXSLOTS]; +}; + +struct businfo { + uint16_t iobase, iolimit; /* I/O window */ + uint32_t membase32, memlimit32; /* mmio window below 4GB */ + uint64_t membase64, memlimit64; /* mmio window above 4GB */ + struct slotinfo slotinfo[MAXSLOTS]; +}; + +static struct businfo *pci_businfo[MAXBUSES]; SET_DECLARE(pci_devemu_set, struct pci_devemu); @@ -97,7 +107,7 @@ static uint64_t pci_emul_membase64; #define PCI_EMUL_IOBASE 0x2000 #define PCI_EMUL_IOLIMIT 0x10000 -#define PCI_EMUL_MEMLIMIT32 0xE0000000 /* 3.5GB */ +#define PCI_EMUL_MEMLIMIT32 0xE0000000 /* 3.5GB */ #define PCI_EMUL_MEMBASE64 0xD000000000UL #define PCI_EMUL_MEMLIMIT64 0xFD00000000UL @@ -105,7 +115,6 @@ static uint64_t pci_emul_membase64; static struct pci_devemu *pci_emul_finddev(char *name); static void pci_lintr_update(struct pci_devinst *pi); -static int pci_emul_devices; static struct mem_range pci_mem_hole; /* @@ -115,6 +124,7 @@ static struct mem_range pci_mem_hole; /* * Slot options are in the form: * + * ::,[,] * [:],[,] * * slot is 0..31 @@ -136,37 +146,53 @@ pci_parse_slot_usage(char *aopt) int pci_parse_slot(char *opt) { - char *slot, *func, *emul, *config; - char *str, *cpy; - int error, snum, fnum; + struct businfo *bi; + struct slotinfo *si; + char *emul, *config, *str, *cp; + int error, bnum, snum, fnum; error = -1; - str = cpy = strdup(opt); - - slot = strsep(&str, ","); - func = NULL; - if (strchr(slot, ':') != NULL) { - func = cpy; - (void) strsep(&func, ":"); - } - - emul = strsep(&str, ","); - config = str; + str = strdup(opt); - if (emul == NULL) { + emul = config = NULL; + if ((cp = strchr(str, ',')) != NULL) { + *cp = '\0'; + emul = cp + 1; + if ((cp = strchr(emul, ',')) != NULL) { + *cp = '\0'; + config = cp + 1; + } + } else { pci_parse_slot_usage(opt); goto done; } - snum = atoi(slot); - fnum = func ? atoi(func) : 0; + /* :: */ + if (sscanf(str, "%d:%d:%d", &bnum, &snum, &fnum) != 3) { + bnum = 0; + /* : */ + if (sscanf(str, "%d:%d", &snum, &fnum) != 2) { + fnum = 0; + /* */ + if (sscanf(str, "%d", &snum) != 1) { + snum = -1; + } + } + } - if (snum < 0 || snum >= MAXSLOTS || fnum < 0 || fnum >= MAXFUNCS) { + if (bnum < 0 || bnum >= MAXBUSES || snum < 0 || snum >= MAXSLOTS || + fnum < 0 || fnum >= MAXFUNCS) { pci_parse_slot_usage(opt); goto done; } - if (pci_slotinfo[snum].si_funcs[fnum].fi_name != NULL) { + if (pci_businfo[bnum] == NULL) + pci_businfo[bnum] = calloc(1, sizeof(struct businfo)); + + bi = pci_businfo[bnum]; + si = &bi->slotinfo[snum]; + + if (si->si_funcs[fnum].fi_name != NULL) { fprintf(stderr, "pci slot %d:%d already occupied!\n", snum, fnum); goto done; @@ -179,12 +205,12 @@ pci_parse_slot(char *opt) } error = 0; - pci_slotinfo[snum].si_funcs[fnum].fi_name = emul; - pci_slotinfo[snum].si_funcs[fnum].fi_param = config; + si->si_funcs[fnum].fi_name = emul; + si->si_funcs[fnum].fi_param = config; done: if (error) - free(cpy); + free(str); return (error); } @@ -346,10 +372,27 @@ pci_emul_mem_handler(struct vmctx *ctx, offset = addr - pdi->pi_bar[bidx].addr; - if (dir == MEM_F_WRITE) - (*pe->pe_barwrite)(ctx, vcpu, pdi, bidx, offset, size, *val); - else - *val = (*pe->pe_barread)(ctx, vcpu, pdi, bidx, offset, size); + if (dir == MEM_F_WRITE) { + if (size == 8) { + (*pe->pe_barwrite)(ctx, vcpu, pdi, bidx, offset, + 4, *val & 0xffffffff); + (*pe->pe_barwrite)(ctx, vcpu, pdi, bidx, offset + 4, + 4, *val >> 32); + } else { + (*pe->pe_barwrite)(ctx, vcpu, pdi, bidx, offset, + size, *val); + } + } else { + if (size == 8) { + *val = (*pe->pe_barread)(ctx, vcpu, pdi, bidx, + offset, 4); + *val |= (*pe->pe_barread)(ctx, vcpu, pdi, bidx, + offset + 4, 4) << 32; + } else { + *val = (*pe->pe_barread)(ctx, vcpu, pdi, bidx, + offset, size); + } + } return (0); } @@ -604,48 +647,39 @@ pci_emul_alloc_pbar(struct pci_devinst * static int pci_emul_add_capability(struct pci_devinst *pi, u_char *capdata, int caplen) { - int i, capoff, capid, reallen; + int i, capoff, reallen; uint16_t sts; - static u_char endofcap[4] = { - PCIY_RESERVED, 0, 0, 0 - }; - - assert(caplen > 0 && capdata[0] != PCIY_RESERVED); + assert(caplen > 0); reallen = roundup2(caplen, 4); /* dword aligned */ sts = pci_get_cfgdata16(pi, PCIR_STATUS); - if ((sts & PCIM_STATUS_CAPPRESENT) == 0) { + if ((sts & PCIM_STATUS_CAPPRESENT) == 0) capoff = CAP_START_OFFSET; - pci_set_cfgdata8(pi, PCIR_CAP_PTR, capoff); - pci_set_cfgdata16(pi, PCIR_STATUS, sts|PCIM_STATUS_CAPPRESENT); - } else { - capoff = pci_get_cfgdata8(pi, PCIR_CAP_PTR); - while (1) { - assert((capoff & 0x3) == 0); - capid = pci_get_cfgdata8(pi, capoff); - if (capid == PCIY_RESERVED) - break; - capoff = pci_get_cfgdata8(pi, capoff + 1); - } - } + else + capoff = pi->pi_capend + 1; /* Check if we have enough space */ - if (capoff + reallen + sizeof(endofcap) > PCI_REGMAX + 1) + if (capoff + reallen > PCI_REGMAX + 1) return (-1); + /* Set the previous capability pointer */ + if ((sts & PCIM_STATUS_CAPPRESENT) == 0) { + pci_set_cfgdata8(pi, PCIR_CAP_PTR, capoff); + pci_set_cfgdata16(pi, PCIR_STATUS, sts|PCIM_STATUS_CAPPRESENT); + } else + pci_set_cfgdata8(pi, pi->pi_prevcap + 1, capoff); + /* Copy the capability */ for (i = 0; i < caplen; i++) pci_set_cfgdata8(pi, capoff + i, capdata[i]); /* Set the next capability pointer */ - pci_set_cfgdata8(pi, capoff + 1, capoff + reallen); - - /* Copy of the reserved capability which serves as the end marker */ - for (i = 0; i < sizeof(endofcap); i++) - pci_set_cfgdata8(pi, capoff + reallen + i, endofcap[i]); + pci_set_cfgdata8(pi, capoff + 1, 0); + pi->pi_prevcap = capoff; + pi->pi_capend = capoff + reallen - 1; return (0); } @@ -665,8 +699,8 @@ pci_emul_finddev(char *name) } static int -pci_emul_init(struct vmctx *ctx, struct pci_devemu *pde, int slot, int func, - char *params) +pci_emul_init(struct vmctx *ctx, struct pci_devemu *pde, int bus, int slot, + int func, struct funcinfo *fi) { struct pci_devinst *pdi; int err; @@ -675,7 +709,7 @@ pci_emul_init(struct vmctx *ctx, struct bzero(pdi, sizeof(*pdi)); pdi->pi_vmctx = ctx; - pdi->pi_bus = 0; + pdi->pi_bus = bus; pdi->pi_slot = slot; pdi->pi_func = func; pthread_mutex_init(&pdi->pi_lintr.lock, NULL); @@ -692,13 +726,11 @@ pci_emul_init(struct vmctx *ctx, struct pci_set_cfgdata8(pdi, PCIR_COMMAND, PCIM_CMD_PORTEN | PCIM_CMD_MEMEN | PCIM_CMD_BUSMASTEREN); - err = (*pde->pe_init)(ctx, pdi, params); - if (err != 0) { + err = (*pde->pe_init)(ctx, pdi, fi->fi_param); + if (err == 0) + fi->fi_devi = pdi; + else free(pdi); - } else { - pci_emul_devices++; - pci_slotinfo[slot].si_funcs[func].fi_devi = pdi; - } return (err); } @@ -732,7 +764,7 @@ pci_emul_add_msicap(struct pci_devinst * static void pci_populate_msixcap(struct msixcap *msixcap, int msgnum, int barnum, - uint32_t msix_tab_size, int nextptr) + uint32_t msix_tab_size) { CTASSERT(sizeof(struct msixcap) == 12); @@ -740,7 +772,6 @@ pci_populate_msixcap(struct msixcap *msi bzero(msixcap, sizeof(struct msixcap)); msixcap->capid = PCIY_MSIX; - msixcap->nextptr = nextptr; /* * Message Control Register, all fields set to @@ -778,7 +809,6 @@ pci_msix_table_init(struct pci_devinst * int pci_emul_add_msixcap(struct pci_devinst *pi, int msgnum, int barnum) { - uint16_t pba_index; uint32_t tab_size; struct msixcap msixcap; @@ -795,14 +825,11 @@ pci_emul_add_msixcap(struct pci_devinst pi->pi_msix.table_offset = 0; pi->pi_msix.table_count = msgnum; pi->pi_msix.pba_offset = tab_size; - - /* calculate the MMIO size required for MSI-X PBA */ - pba_index = (msgnum - 1) / (PBA_TABLE_ENTRY_SIZE * 8); - pi->pi_msix.pba_size = (pba_index + 1) * PBA_TABLE_ENTRY_SIZE; + pi->pi_msix.pba_size = PBA_SIZE(msgnum); pci_msix_table_init(pi, msgnum); - pci_populate_msixcap(&msixcap, msgnum, barnum, tab_size, 0); + pci_populate_msixcap(&msixcap, msgnum, barnum, tab_size); /* allocate memory for MSI-X Table and PBA */ pci_emul_alloc_bar(pi, barnum, PCIBAR_MEM32, @@ -925,11 +952,9 @@ pci_emul_capwrite(struct pci_devinst *pi /* Find the capability that we want to update */ capoff = CAP_START_OFFSET; while (1) { - capid = pci_get_cfgdata8(pi, capoff); - if (capid == PCIY_RESERVED) - break; - nextoff = pci_get_cfgdata8(pi, capoff + 1); + if (nextoff == 0) + break; if (offset >= capoff && offset < nextoff) break; @@ -952,6 +977,7 @@ pci_emul_capwrite(struct pci_devinst *pi return; } + capid = pci_get_cfgdata8(pi, capoff); switch (capid) { case PCIY_MSI: msicap_cfgwrite(pi, capoff, offset, bytes, val); @@ -970,25 +996,14 @@ pci_emul_capwrite(struct pci_devinst *pi static int pci_emul_iscap(struct pci_devinst *pi, int offset) { - int found; uint16_t sts; - uint8_t capid, lastoff; - found = 0; sts = pci_get_cfgdata16(pi, PCIR_STATUS); if ((sts & PCIM_STATUS_CAPPRESENT) != 0) { - lastoff = pci_get_cfgdata8(pi, PCIR_CAP_PTR); - while (1) { - assert((lastoff & 0x3) == 0); - capid = pci_get_cfgdata8(pi, lastoff); - if (capid == PCIY_RESERVED) - break; - lastoff = pci_get_cfgdata8(pi, lastoff + 1); - } - if (offset >= CAP_START_OFFSET && offset <= lastoff) - found = 1; + if (offset >= CAP_START_OFFSET && offset <= pi->pi_capend) + return (1); } - return (found); + return (0); } static int @@ -1006,31 +1021,68 @@ pci_emul_fallback_handler(struct vmctx * return (0); } +#define BUSIO_ROUNDUP 32 +#define BUSMEM_ROUNDUP (1024 * 1024) + int init_pci(struct vmctx *ctx) { struct pci_devemu *pde; + struct businfo *bi; + struct slotinfo *si; struct funcinfo *fi; size_t lowmem; - int slot, func; + int bus, slot, func; int error; pci_emul_iobase = PCI_EMUL_IOBASE; pci_emul_membase32 = vm_get_lowmem_limit(ctx); pci_emul_membase64 = PCI_EMUL_MEMBASE64; - for (slot = 0; slot < MAXSLOTS; slot++) { - for (func = 0; func < MAXFUNCS; func++) { - fi = &pci_slotinfo[slot].si_funcs[func]; - if (fi->fi_name != NULL) { + for (bus = 0; bus < MAXBUSES; bus++) { + if ((bi = pci_businfo[bus]) == NULL) + continue; + /* + * Keep track of the i/o and memory resources allocated to + * this bus. + */ + bi->iobase = pci_emul_iobase; + bi->membase32 = pci_emul_membase32; + bi->membase64 = pci_emul_membase64; + + for (slot = 0; slot < MAXSLOTS; slot++) { + si = &bi->slotinfo[slot]; + for (func = 0; func < MAXFUNCS; func++) { + fi = &si->si_funcs[func]; + if (fi->fi_name == NULL) + continue; pde = pci_emul_finddev(fi->fi_name); assert(pde != NULL); - error = pci_emul_init(ctx, pde, slot, func, - fi->fi_param); + error = pci_emul_init(ctx, pde, bus, slot, + func, fi); if (error) return (error); } } + + /* + * Add some slop to the I/O and memory resources decoded by + * this bus to give a guest some flexibility if it wants to + * reprogram the BARs. + */ + pci_emul_iobase += BUSIO_ROUNDUP; + pci_emul_iobase = roundup2(pci_emul_iobase, BUSIO_ROUNDUP); + bi->iolimit = pci_emul_iobase; + + pci_emul_membase32 += BUSMEM_ROUNDUP; + pci_emul_membase32 = roundup2(pci_emul_membase32, + BUSMEM_ROUNDUP); + bi->memlimit32 = pci_emul_membase32; + + pci_emul_membase64 += BUSMEM_ROUNDUP; + pci_emul_membase64 = roundup2(pci_emul_membase64, + BUSMEM_ROUNDUP); + bi->memlimit64 = pci_emul_membase64; } /* @@ -1060,7 +1112,7 @@ init_pci(struct vmctx *ctx) } static void -pci_prt_entry(int slot, int pin, int ioapic_irq, void *arg) +pci_prt_entry(int bus, int slot, int pin, int ioapic_irq, void *arg) { int *count; @@ -1075,96 +1127,165 @@ pci_prt_entry(int slot, int pin, int ioa (*count)--; } -void -pci_write_dsdt(void) +/* + * A bhyve virtual machine has a flat PCI hierarchy with a root port + * corresponding to each PCI bus. + */ +static void +pci_bus_write_dsdt(int bus) { + struct businfo *bi; + struct slotinfo *si; struct pci_devinst *pi; int count, slot, func; + /* + * If there are no devices on this 'bus' then just return. + */ + if ((bi = pci_businfo[bus]) == NULL) { + /* + * Bus 0 is special because it decodes the I/O ports used + * for PCI config space access even if there are no devices + * on it. + */ + if (bus != 0) + return; + } + dsdt_indent(1); dsdt_line("Scope (_SB)"); dsdt_line("{"); - dsdt_line(" Device (PCI0)"); + dsdt_line(" Device (PC%02X)", bus); dsdt_line(" {"); dsdt_line(" Name (_HID, EisaId (\"PNP0A03\"))"); dsdt_line(" Name (_ADR, Zero)"); + + dsdt_line(" Method (_BBN, 0, NotSerialized)"); + dsdt_line(" {"); + dsdt_line(" Return (0x%08X)", bus); + dsdt_line(" }"); dsdt_line(" Name (_CRS, ResourceTemplate ()"); dsdt_line(" {"); dsdt_line(" WordBusNumber (ResourceProducer, MinFixed, " "MaxFixed, PosDecode,"); dsdt_line(" 0x0000, // Granularity"); - dsdt_line(" 0x0000, // Range Minimum"); - dsdt_line(" 0x00FF, // Range Maximum"); + dsdt_line(" 0x%04X, // Range Minimum", bus); + dsdt_line(" 0x%04X, // Range Maximum", bus); dsdt_line(" 0x0000, // Translation Offset"); - dsdt_line(" 0x0100, // Length"); + dsdt_line(" 0x0001, // Length"); dsdt_line(" ,, )"); - dsdt_indent(3); - dsdt_fixed_ioport(0xCF8, 8); - dsdt_unindent(3); - dsdt_line(" WordIO (ResourceProducer, MinFixed, MaxFixed, " - "PosDecode, EntireRange,"); - dsdt_line(" 0x0000, // Granularity"); - dsdt_line(" 0x0000, // Range Minimum"); - dsdt_line(" 0x0CF7, // Range Maximum"); - dsdt_line(" 0x0000, // Translation Offset"); - dsdt_line(" 0x0CF8, // Length"); - dsdt_line(" ,, , TypeStatic)"); + + if (bus == 0) { + dsdt_indent(3); + dsdt_fixed_ioport(0xCF8, 8); + dsdt_unindent(3); + + dsdt_line(" WordIO (ResourceProducer, MinFixed, MaxFixed, " + "PosDecode, EntireRange,"); + dsdt_line(" 0x0000, // Granularity"); + dsdt_line(" 0x0000, // Range Minimum"); + dsdt_line(" 0x0CF7, // Range Maximum"); + dsdt_line(" 0x0000, // Translation Offset"); + dsdt_line(" 0x0CF8, // Length"); + dsdt_line(" ,, , TypeStatic)"); + + dsdt_line(" WordIO (ResourceProducer, MinFixed, MaxFixed, " + "PosDecode, EntireRange,"); + dsdt_line(" 0x0000, // Granularity"); + dsdt_line(" 0x0D00, // Range Minimum"); + dsdt_line(" 0x%04X, // Range Maximum", + PCI_EMUL_IOBASE - 1); + dsdt_line(" 0x0000, // Translation Offset"); + dsdt_line(" 0x%04X, // Length", + PCI_EMUL_IOBASE - 0x0D00); + dsdt_line(" ,, , TypeStatic)"); + + if (bi == NULL) { + dsdt_line(" })"); + goto done; + } + } + assert(bi != NULL); + + /* i/o window */ dsdt_line(" WordIO (ResourceProducer, MinFixed, MaxFixed, " "PosDecode, EntireRange,"); dsdt_line(" 0x0000, // Granularity"); - dsdt_line(" 0x0D00, // Range Minimum"); - dsdt_line(" 0xFFFF, // Range Maximum"); + dsdt_line(" 0x%04X, // Range Minimum", bi->iobase); + dsdt_line(" 0x%04X, // Range Maximum", + bi->iolimit - 1); dsdt_line(" 0x0000, // Translation Offset"); - dsdt_line(" 0xF300, // Length"); + dsdt_line(" 0x%04X, // Length", + bi->iolimit - bi->iobase); dsdt_line(" ,, , TypeStatic)"); + + /* mmio window (32-bit) */ dsdt_line(" DWordMemory (ResourceProducer, PosDecode, " "MinFixed, MaxFixed, NonCacheable, ReadWrite,"); dsdt_line(" 0x00000000, // Granularity"); - dsdt_line(" 0x%08lX, // Range Minimum\n", - pci_mem_hole.base); + dsdt_line(" 0x%08X, // Range Minimum\n", bi->membase32); dsdt_line(" 0x%08X, // Range Maximum\n", - PCI_EMUL_MEMLIMIT32 - 1); + bi->memlimit32 - 1); dsdt_line(" 0x00000000, // Translation Offset"); - dsdt_line(" 0x%08lX, // Length\n", - PCI_EMUL_MEMLIMIT32 - pci_mem_hole.base); + dsdt_line(" 0x%08X, // Length\n", + bi->memlimit32 - bi->membase32); dsdt_line(" ,, , AddressRangeMemory, TypeStatic)"); + + /* mmio window (64-bit) */ dsdt_line(" QWordMemory (ResourceProducer, PosDecode, " "MinFixed, MaxFixed, NonCacheable, ReadWrite,"); dsdt_line(" 0x0000000000000000, // Granularity"); - dsdt_line(" 0x%016lX, // Range Minimum\n", - PCI_EMUL_MEMBASE64); + dsdt_line(" 0x%016lX, // Range Minimum\n", bi->membase64); dsdt_line(" 0x%016lX, // Range Maximum\n", - PCI_EMUL_MEMLIMIT64 - 1); + bi->memlimit64 - 1); dsdt_line(" 0x0000000000000000, // Translation Offset"); dsdt_line(" 0x%016lX, // Length\n", - PCI_EMUL_MEMLIMIT64 - PCI_EMUL_MEMBASE64); + bi->memlimit64 - bi->membase64); dsdt_line(" ,, , AddressRangeMemory, TypeStatic)"); dsdt_line(" })"); - count = pci_count_lintr(); + + count = pci_count_lintr(bus); if (count != 0) { dsdt_indent(2); dsdt_line("Name (_PRT, Package (0x%02X)", count); dsdt_line("{"); - pci_walk_lintr(pci_prt_entry, &count); + pci_walk_lintr(bus, pci_prt_entry, &count); dsdt_line("})"); dsdt_unindent(2); } dsdt_indent(2); for (slot = 0; slot < MAXSLOTS; slot++) { + si = &bi->slotinfo[slot]; for (func = 0; func < MAXFUNCS; func++) { - pi = pci_slotinfo[slot].si_funcs[func].fi_devi; + pi = si->si_funcs[func].fi_devi; if (pi != NULL && pi->pi_d->pe_write_dsdt != NULL) pi->pi_d->pe_write_dsdt(pi); } } dsdt_unindent(2); - +done: dsdt_line(" }"); dsdt_line("}"); dsdt_unindent(1); } +void +pci_write_dsdt(void) +{ + int bus; + + for (bus = 0; bus < MAXBUSES; bus++) + pci_bus_write_dsdt(bus); +} + +int +pci_bus_configured(int bus) +{ + assert(bus >= 0 && bus < MAXBUSES); + return (pci_businfo[bus] != NULL); +} + int pci_msi_enabled(struct pci_devinst *pi) { @@ -1231,13 +1352,17 @@ pci_lintr_permitted(struct pci_devinst * int pci_lintr_request(struct pci_devinst *pi) { + struct businfo *bi; struct slotinfo *si; int bestpin, bestcount, irq, pin; + bi = pci_businfo[pi->pi_bus]; + assert(bi != NULL); + /* * First, allocate a pin from our slot. */ - si = &pci_slotinfo[pi->pi_slot]; + si = &bi->slotinfo[pi->pi_slot]; bestpin = 0; bestcount = si->si_intpins[0].ii_count; for (pin = 1; pin < 4; pin++) { @@ -1318,31 +1443,41 @@ pci_lintr_update(struct pci_devinst *pi) } int -pci_count_lintr(void) +pci_count_lintr(int bus) { int count, slot, pin; + struct slotinfo *slotinfo; count = 0; - for (slot = 0; slot < MAXSLOTS; slot++) { - for (pin = 0; pin < 4; pin++) { - if (pci_slotinfo[slot].si_intpins[pin].ii_count != 0) - count++; + if (pci_businfo[bus] != NULL) { + for (slot = 0; slot < MAXSLOTS; slot++) { + slotinfo = &pci_businfo[bus]->slotinfo[slot]; + for (pin = 0; pin < 4; pin++) { + if (slotinfo->si_intpins[pin].ii_count != 0) + count++; + } } } return (count); } void -pci_walk_lintr(pci_lintr_cb cb, void *arg) +pci_walk_lintr(int bus, pci_lintr_cb cb, void *arg) { + struct businfo *bi; + struct slotinfo *si; struct intxinfo *ii; int slot, pin; + if ((bi = pci_businfo[bus]) == NULL) + return; + for (slot = 0; slot < MAXSLOTS; slot++) { + si = &bi->slotinfo[slot]; for (pin = 0; pin < 4; pin++) { - ii = &pci_slotinfo[slot].si_intpins[pin]; + ii = &si->si_intpins[pin]; if (ii->ii_count != 0) - cb(slot, pin + 1, ii->ii_ioapic_irq, arg); + cb(bus, slot, pin + 1, ii->ii_ioapic_irq, arg); } } } @@ -1352,14 +1487,19 @@ pci_walk_lintr(pci_lintr_cb cb, void *ar * Return 0 otherwise. */ static int -pci_emul_is_mfdev(int slot) +pci_emul_is_mfdev(int bus, int slot) { + struct businfo *bi; + struct slotinfo *si; int f, numfuncs; numfuncs = 0; - for (f = 0; f < MAXFUNCS; f++) { - if (pci_slotinfo[slot].si_funcs[f].fi_devi != NULL) { - numfuncs++; + if ((bi = pci_businfo[bus]) != NULL) { + si = &bi->slotinfo[slot]; + for (f = 0; f < MAXFUNCS; f++) { + if (si->si_funcs[f].fi_devi != NULL) { + numfuncs++; + } } } return (numfuncs > 1); @@ -1370,12 +1510,12 @@ pci_emul_is_mfdev(int slot) * whether or not is a multi-function being emulated in the pci 'slot'. */ static void -pci_emul_hdrtype_fixup(int slot, int off, int bytes, uint32_t *rv) +pci_emul_hdrtype_fixup(int bus, int slot, int off, int bytes, uint32_t *rv) { int mfdev; if (off <= PCIR_HDRTYPE && off + bytes > PCIR_HDRTYPE) { - mfdev = pci_emul_is_mfdev(slot); + mfdev = pci_emul_is_mfdev(bus, slot); switch (bytes) { case 1: case 2: @@ -1394,7 +1534,7 @@ pci_emul_hdrtype_fixup(int slot, int off } } -static int cfgbus, cfgslot, cfgfunc, cfgoff; +static int cfgenable, cfgbus, cfgslot, cfgfunc, cfgoff; static int pci_emul_cfgaddr(struct vmctx *ctx, int vcpu, int in, int port, int bytes, @@ -1413,9 +1553,12 @@ pci_emul_cfgaddr(struct vmctx *ctx, int (cfgslot << 11) | (cfgfunc << 8) | cfgoff; - *eax = x | CONF1_ENABLE; + if (cfgenable) + x |= CONF1_ENABLE; + *eax = x; } else { x = *eax; + cfgenable = (x & CONF1_ENABLE) == CONF1_ENABLE; cfgoff = x & PCI_REGMAX; cfgfunc = (x >> 8) & PCI_FUNCMAX; cfgslot = (x >> 11) & PCI_SLOTMAX; @@ -1492,16 +1635,19 @@ static int pci_emul_cfgdata(struct vmctx *ctx, int vcpu, int in, int port, int bytes, uint32_t *eax, void *arg) { + struct businfo *bi; + struct slotinfo *si; struct pci_devinst *pi; struct pci_devemu *pe; int coff, idx, needcfg; uint64_t addr, bar, mask; assert(bytes == 1 || bytes == 2 || bytes == 4); - - if (cfgbus == 0) - pi = pci_slotinfo[cfgslot].si_funcs[cfgfunc].fi_devi; - else + + if ((bi = pci_businfo[cfgbus]) != NULL) { + si = &bi->slotinfo[cfgslot]; + pi = si->si_funcs[cfgfunc].fi_devi; + } else pi = NULL; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 20:55:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B4D92C7B; Sat, 19 Jul 2014 20:55:13 +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 A21762DDD; Sat, 19 Jul 2014 20:55:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6JKtDuB071839; Sat, 19 Jul 2014 20:55:13 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6JKtD4o071838; Sat, 19 Jul 2014 20:55:13 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201407192055.s6JKtD4o071838@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sat, 19 Jul 2014 20:55:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268888 - head/lib/libpam/modules/pam_group X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 20:55:13 -0000 Author: des Date: Sat Jul 19 20:55:13 2014 New Revision: 268888 URL: http://svnweb.freebsd.org/changeset/base/268888 Log: Check if the specified group is the user's primary group before iterating over the (possibly empty) list of members. Otherwise, we get a false negative when the target group has no members listed in /etc/group. This went mostly unnoticed because root is explicitly listed as a member of wheel, so the bug is never triggered in the most common use case, which is su(8). PR: 109416 MFC after: 1 week Modified: head/lib/libpam/modules/pam_group/pam_group.c Modified: head/lib/libpam/modules/pam_group/pam_group.c ============================================================================== --- head/lib/libpam/modules/pam_group/pam_group.c Sat Jul 19 20:13:01 2014 (r268887) +++ head/lib/libpam/modules/pam_group/pam_group.c Sat Jul 19 20:55:13 2014 (r268888) @@ -96,14 +96,12 @@ pam_sm_authenticate(pam_handle_t *pamh, if ((grp = getgrnam(group)) == NULL || grp->gr_mem == NULL) goto failed; - /* check if the group is empty */ - if (*grp->gr_mem == NULL) - goto failed; - - /* check membership */ + /* check if user's own primary group */ if (pwd->pw_gid == grp->gr_gid) goto found; - for (list = grp->gr_mem; *list != NULL; ++list) + + /* iterate over members */ + for (list = grp->gr_mem; list != NULL && *list != NULL; ++list) if (strcmp(*list, pwd->pw_name) == 0) goto found; From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 20:59:10 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B385FEE8; Sat, 19 Jul 2014 20:59:10 +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 940F72E03; Sat, 19 Jul 2014 20:59:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6JKxAcB072556; Sat, 19 Jul 2014 20:59:10 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6JKx8un072543; Sat, 19 Jul 2014 20:59:08 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201407192059.s6JKx8un072543@svn.freebsd.org> From: Neel Natu Date: Sat, 19 Jul 2014 20:59:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268889 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel usr.sbin/bhyve usr.sbin/bhyvectl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 20:59:10 -0000 Author: neel Date: Sat Jul 19 20:59:08 2014 New Revision: 268889 URL: http://svnweb.freebsd.org/changeset/base/268889 Log: Handle nested exceptions in bhyve. A nested exception condition arises when a second exception is triggered while delivering the first exception. Most nested exceptions can be handled serially but some are converted into a double fault. If an exception is generated during delivery of a double fault then the virtual machine shuts down as a result of a triple fault. vm_exit_intinfo() is used to record that a VM-exit happened while an event was being delivered through the IDT. If an exception is triggered while handling the VM-exit it will be treated like a nested exception. vm_entry_intinfo() is used by processor-specific code to get the event to be injected into the guest on the next VM-entry. This function is responsible for deciding the disposition of nested exceptions. Modified: head/lib/libvmmapi/vmmapi.c head/lib/libvmmapi/vmmapi.h head/sys/amd64/include/vmm.h head/sys/amd64/include/vmm_dev.h head/sys/amd64/vmm/intel/vmx.c head/sys/amd64/vmm/vmm.c head/sys/amd64/vmm/vmm_dev.c head/usr.sbin/bhyve/bhyverun.c head/usr.sbin/bhyve/task_switch.c head/usr.sbin/bhyvectl/bhyvectl.c Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Sat Jul 19 20:55:13 2014 (r268888) +++ head/lib/libvmmapi/vmmapi.c Sat Jul 19 20:59:08 2014 (r268889) @@ -1106,3 +1106,32 @@ vm_activate_cpu(struct vmctx *ctx, int v error = ioctl(ctx->fd, VM_ACTIVATE_CPU, &ac); return (error); } + +int +vm_get_intinfo(struct vmctx *ctx, int vcpu, uint64_t *info1, uint64_t *info2) +{ + struct vm_intinfo vmii; + int error; + + bzero(&vmii, sizeof(struct vm_intinfo)); + vmii.vcpuid = vcpu; + error = ioctl(ctx->fd, VM_GET_INTINFO, &vmii); + if (error == 0) { + *info1 = vmii.info1; + *info2 = vmii.info2; + } + return (error); +} + +int +vm_set_intinfo(struct vmctx *ctx, int vcpu, uint64_t info1) +{ + struct vm_intinfo vmii; + int error; + + bzero(&vmii, sizeof(struct vm_intinfo)); + vmii.vcpuid = vcpu; + vmii.info1 = info1; + error = ioctl(ctx->fd, VM_SET_INTINFO, &vmii); + return (error); +} Modified: head/lib/libvmmapi/vmmapi.h ============================================================================== --- head/lib/libvmmapi/vmmapi.h Sat Jul 19 20:55:13 2014 (r268888) +++ head/lib/libvmmapi/vmmapi.h Sat Jul 19 20:59:08 2014 (r268889) @@ -104,6 +104,9 @@ int vm_setup_pptdev_msix(struct vmctx *c int func, int idx, uint64_t addr, uint64_t msg, uint32_t vector_control); +int vm_get_intinfo(struct vmctx *ctx, int vcpu, uint64_t *i1, uint64_t *i2); +int vm_set_intinfo(struct vmctx *ctx, int vcpu, uint64_t exit_intinfo); + /* * Return a pointer to the statistics buffer. Note that this is not MT-safe. */ Modified: head/sys/amd64/include/vmm.h ============================================================================== --- head/sys/amd64/include/vmm.h Sat Jul 19 20:55:13 2014 (r268888) +++ head/sys/amd64/include/vmm.h Sat Jul 19 20:59:08 2014 (r268889) @@ -34,6 +34,7 @@ enum vm_suspend_how { VM_SUSPEND_RESET, VM_SUSPEND_POWEROFF, VM_SUSPEND_HALT, + VM_SUSPEND_TRIPLEFAULT, VM_SUSPEND_LAST }; @@ -88,6 +89,16 @@ enum x2apic_state { X2APIC_STATE_LAST }; +#define VM_INTINFO_VECTOR(info) ((info) & 0xff) +#define VM_INTINFO_DEL_ERRCODE 0x800 +#define VM_INTINFO_RSVD 0x7ffff000 +#define VM_INTINFO_VALID 0x80000000 +#define VM_INTINFO_TYPE 0x700 +#define VM_INTINFO_HWINTR (0 << 8) +#define VM_INTINFO_NMI (2 << 8) +#define VM_INTINFO_HWEXCEPTION (3 << 8) +#define VM_INTINFO_SWINTR (4 << 8) + #ifdef _KERNEL #define VM_MAX_NAMELEN 32 @@ -278,14 +289,31 @@ struct vatpit *vm_atpit(struct vm *vm); int vm_inject_exception(struct vm *vm, int vcpuid, struct vm_exception *vme); /* - * Returns 0 if there is no exception pending for this vcpu. Returns 1 if an - * exception is pending and also updates 'vme'. The pending exception is - * cleared when this function returns. + * This function is called after a VM-exit that occurred during exception or + * interrupt delivery through the IDT. The format of 'intinfo' is described + * in Figure 15-1, "EXITINTINFO for All Intercepts", APM, Vol 2. * - * This function should only be called in the context of the thread that is - * executing this vcpu. + * If a VM-exit handler completes the event delivery successfully then it + * should call vm_exit_intinfo() to extinguish the pending event. For e.g., + * if the task switch emulation is triggered via a task gate then it should + * call this function with 'intinfo=0' to indicate that the external event + * is not pending anymore. + * + * Return value is 0 on success and non-zero on failure. */ -int vm_exception_pending(struct vm *vm, int vcpuid, struct vm_exception *vme); +int vm_exit_intinfo(struct vm *vm, int vcpuid, uint64_t intinfo); + +/* + * This function is called before every VM-entry to retrieve a pending + * event that should be injected into the guest. This function combines + * nested events into a double or triple fault. + * + * Returns 0 if there are no events that need to be injected into the guest + * and non-zero otherwise. + */ +int vm_entry_intinfo(struct vm *vm, int vcpuid, uint64_t *info); + +int vm_get_intinfo(struct vm *vm, int vcpuid, uint64_t *info1, uint64_t *info2); void vm_inject_gp(struct vm *vm, int vcpuid); /* general protection fault */ void vm_inject_ud(struct vm *vm, int vcpuid); /* undefined instruction fault */ Modified: head/sys/amd64/include/vmm_dev.h ============================================================================== --- head/sys/amd64/include/vmm_dev.h Sat Jul 19 20:55:13 2014 (r268888) +++ head/sys/amd64/include/vmm_dev.h Sat Jul 19 20:59:08 2014 (r268889) @@ -189,6 +189,12 @@ struct vm_cpuset { #define VM_ACTIVE_CPUS 0 #define VM_SUSPENDED_CPUS 1 +struct vm_intinfo { + int vcpuid; + uint64_t info1; + uint64_t info2; +}; + enum { /* general routines */ IOCNUM_ABIVERS = 0, @@ -211,6 +217,8 @@ enum { IOCNUM_GET_SEGMENT_DESCRIPTOR = 23, /* interrupt injection */ + IOCNUM_GET_INTINFO = 28, + IOCNUM_SET_INTINFO = 29, IOCNUM_INJECT_EXCEPTION = 30, IOCNUM_LAPIC_IRQ = 31, IOCNUM_INJECT_NMI = 32, @@ -324,4 +332,8 @@ enum { _IOW('v', IOCNUM_ACTIVATE_CPU, struct vm_activate_cpu) #define VM_GET_CPUS \ _IOW('v', IOCNUM_GET_CPUSET, struct vm_cpuset) +#define VM_SET_INTINFO \ + _IOW('v', IOCNUM_SET_INTINFO, struct vm_intinfo) +#define VM_GET_INTINFO \ + _IOWR('v', IOCNUM_GET_INTINFO, struct vm_intinfo) #endif Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Sat Jul 19 20:55:13 2014 (r268888) +++ head/sys/amd64/vmm/intel/vmx.c Sat Jul 19 20:59:08 2014 (r268889) @@ -1213,22 +1213,31 @@ vmx_inject_interrupts(struct vmx *vmx, i { struct vm_exception exc; int vector, need_nmi_exiting, extint_pending; - uint64_t rflags; + uint64_t rflags, entryinfo; uint32_t gi, info; - if (vm_exception_pending(vmx->vm, vcpu, &exc)) { - KASSERT(exc.vector >= 0 && exc.vector < 32, - ("%s: invalid exception vector %d", __func__, exc.vector)); + if (vm_entry_intinfo(vmx->vm, vcpu, &entryinfo)) { + KASSERT((entryinfo & VMCS_INTR_VALID) != 0, ("%s: entry " + "intinfo is not valid: %#lx", __func__, entryinfo)); info = vmcs_read(VMCS_ENTRY_INTR_INFO); KASSERT((info & VMCS_INTR_VALID) == 0, ("%s: cannot inject " "pending exception %d: %#x", __func__, exc.vector, info)); - info = exc.vector | VMCS_INTR_T_HWEXCEPTION | VMCS_INTR_VALID; - if (exc.error_code_valid) { - info |= VMCS_INTR_DEL_ERRCODE; - vmcs_write(VMCS_ENTRY_EXCEPTION_ERROR, exc.error_code); + info = entryinfo; + vector = info & 0xff; + if (vector == IDT_BP || vector == IDT_OF) { + /* + * VT-x requires #BP and #OF to be injected as software + * exceptions. + */ + info &= ~VMCS_INTR_T_MASK; + info |= VMCS_INTR_T_SWEXCEPTION; } + + if (info & VMCS_INTR_DEL_ERRCODE) + vmcs_write(VMCS_ENTRY_EXCEPTION_ERROR, entryinfo >> 32); + vmcs_write(VMCS_ENTRY_INTR_INFO, info); } @@ -1407,6 +1416,16 @@ vmx_clear_nmi_blocking(struct vmx *vmx, vmcs_write(VMCS_GUEST_INTERRUPTIBILITY, gi); } +static void +vmx_assert_nmi_blocking(struct vmx *vmx, int vcpuid) +{ + uint32_t gi; + + gi = vmcs_read(VMCS_GUEST_INTERRUPTIBILITY); + KASSERT(gi & VMCS_INTERRUPTIBILITY_NMI_BLOCKING, + ("NMI blocking is not in effect %#x", gi)); +} + static int vmx_emulate_xsetbv(struct vmx *vmx, int vcpu, struct vm_exit *vmexit) { @@ -2050,7 +2069,7 @@ vmx_exit_process(struct vmx *vmx, int vc struct vm_task_switch *ts; uint32_t eax, ecx, edx, idtvec_info, idtvec_err, intr_info, inst_info; uint32_t intr_type, reason; - uint64_t qual, gpa; + uint64_t exitintinfo, qual, gpa; bool retu; CTASSERT((PINBASED_CTLS_ONE_SETTING & PINBASED_VIRTUAL_NMI) != 0); @@ -2070,47 +2089,49 @@ vmx_exit_process(struct vmx *vmx, int vc * be handled specially by re-injecting the event if the IDT * vectoring information field's valid bit is set. * - * If the VM-exit is due to a task gate in the IDT then we don't - * reinject the event because emulating the task switch also - * completes the event delivery. - * * See "Information for VM Exits During Event Delivery" in Intel SDM * for details. */ - switch (reason) { - case EXIT_REASON_EPT_FAULT: - case EXIT_REASON_EPT_MISCONFIG: - case EXIT_REASON_APIC_ACCESS: - case EXIT_REASON_TASK_SWITCH: - case EXIT_REASON_EXCEPTION: - idtvec_info = vmcs_idt_vectoring_info(); - VCPU_CTR2(vmx->vm, vcpu, "vm exit %s: idtvec_info 0x%08x", - exit_reason_to_str(reason), idtvec_info); - if ((idtvec_info & VMCS_IDT_VEC_VALID) && - (reason != EXIT_REASON_TASK_SWITCH)) { - idtvec_info &= ~(1 << 12); /* clear undefined bit */ - vmcs_write(VMCS_ENTRY_INTR_INFO, idtvec_info); - if (idtvec_info & VMCS_IDT_VEC_ERRCODE_VALID) { - idtvec_err = vmcs_idt_vectoring_err(); - vmcs_write(VMCS_ENTRY_EXCEPTION_ERROR, - idtvec_err); - } - /* - * If 'virtual NMIs' are being used and the VM-exit - * happened while injecting an NMI during the previous - * VM-entry, then clear "blocking by NMI" in the Guest - * Interruptibility-state. - */ - if ((idtvec_info & VMCS_INTR_T_MASK) == - VMCS_INTR_T_NMI) { - vmx_clear_nmi_blocking(vmx, vcpu); - } + idtvec_info = vmcs_idt_vectoring_info(); + if (idtvec_info & VMCS_IDT_VEC_VALID) { + idtvec_info &= ~(1 << 12); /* clear undefined bit */ + exitintinfo = idtvec_info; + if (idtvec_info & VMCS_IDT_VEC_ERRCODE_VALID) { + idtvec_err = vmcs_idt_vectoring_err(); + exitintinfo |= (uint64_t)idtvec_err << 32; + } + error = vm_exit_intinfo(vmx->vm, vcpu, exitintinfo); + KASSERT(error == 0, ("%s: vm_set_intinfo error %d", + __func__, error)); + + /* + * If 'virtual NMIs' are being used and the VM-exit + * happened while injecting an NMI during the previous + * VM-entry, then clear "blocking by NMI" in the + * Guest Interruptibility-State so the NMI can be + * reinjected on the subsequent VM-entry. + * + * However, if the NMI was being delivered through a task + * gate, then the new task must start execution with NMIs + * blocked so don't clear NMI blocking in this case. + */ + intr_type = idtvec_info & VMCS_INTR_T_MASK; + if (intr_type == VMCS_INTR_T_NMI) { + if (reason != EXIT_REASON_TASK_SWITCH) + vmx_clear_nmi_blocking(vmx, vcpu); + else + vmx_assert_nmi_blocking(vmx, vcpu); + } + + /* + * Update VM-entry instruction length if the event being + * delivered was a software interrupt or software exception. + */ + if (intr_type == VMCS_INTR_T_SWINTR || + intr_type == VMCS_INTR_T_PRIV_SWEXCEPTION || + intr_type == VMCS_INTR_T_SWEXCEPTION) { vmcs_write(VMCS_ENTRY_INST_LENGTH, vmexit->inst_length); } - break; - default: - idtvec_info = 0; - break; } switch (reason) { @@ -2136,7 +2157,7 @@ vmx_exit_process(struct vmx *vmx, int vc */ if (ts->reason == TSR_IDT_GATE) { KASSERT(idtvec_info & VMCS_IDT_VEC_VALID, - ("invalid idtvec_info %x for IDT task switch", + ("invalid idtvec_info %#x for IDT task switch", idtvec_info)); intr_type = idtvec_info & VMCS_INTR_T_MASK; if (intr_type != VMCS_INTR_T_SWINTR && @@ -2302,6 +2323,7 @@ vmx_exit_process(struct vmx *vmx, int vc * the guest. * * See "Resuming Guest Software after Handling an Exception". + * See "Information for VM Exits Due to Vectored Events". */ if ((idtvec_info & VMCS_IDT_VEC_VALID) == 0 && (intr_info & 0xff) != IDT_DF && @@ -2519,6 +2541,13 @@ vmx_run(void *arg, int vcpu, register_t * pmap_invalidate_ept(). */ disable_intr(); + vmx_inject_interrupts(vmx, vcpu, vlapic); + + /* + * Check for vcpu suspension after injecting events because + * vmx_inject_interrupts() can suspend the vcpu due to a + * triple fault. + */ if (vcpu_suspended(suspend_cookie)) { enable_intr(); vm_exit_suspended(vmx->vm, vcpu, vmcs_guest_rip()); @@ -2539,7 +2568,6 @@ vmx_run(void *arg, int vcpu, register_t break; } - vmx_inject_interrupts(vmx, vcpu, vlapic); vmx_run_trace(vmx, vcpu); rc = vmx_enter_guest(vmxctx, vmx, launched); Modified: head/sys/amd64/vmm/vmm.c ============================================================================== --- head/sys/amd64/vmm/vmm.c Sat Jul 19 20:55:13 2014 (r268888) +++ head/sys/amd64/vmm/vmm.c Sat Jul 19 20:59:08 2014 (r268889) @@ -97,6 +97,7 @@ struct vcpu { int hostcpu; /* (o) vcpu's host cpu */ struct vlapic *vlapic; /* (i) APIC device model */ enum x2apic_state x2apic_state; /* (i) APIC mode */ + uint64_t exitintinfo; /* (i) events pending at VM exit */ int nmi_pending; /* (i) NMI pending */ int extint_pending; /* (i) INTR pending */ struct vm_exception exception; /* (x) exception collateral */ @@ -241,6 +242,7 @@ vcpu_init(struct vm *vm, int vcpu_id, bo vcpu->vlapic = VLAPIC_INIT(vm->cookie, vcpu_id); vm_set_x2apic_state(vm, vcpu_id, X2APIC_DISABLED); + vcpu->exitintinfo = 0; vcpu->nmi_pending = 0; vcpu->extint_pending = 0; vcpu->exception_pending = 0; @@ -1458,6 +1460,202 @@ restart: } int +vm_exit_intinfo(struct vm *vm, int vcpuid, uint64_t info) +{ + struct vcpu *vcpu; + int type, vector; + + if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + return (EINVAL); + + vcpu = &vm->vcpu[vcpuid]; + + if (info & VM_INTINFO_VALID) { + type = info & VM_INTINFO_TYPE; + vector = info & 0xff; + if (type == VM_INTINFO_NMI && vector != IDT_NMI) + return (EINVAL); + if (type == VM_INTINFO_HWEXCEPTION && vector >= 32) + return (EINVAL); + if (info & VM_INTINFO_RSVD) + return (EINVAL); + } else { + info = 0; + } + VCPU_CTR2(vm, vcpuid, "%s: info1(%#lx)", __func__, info); + vcpu->exitintinfo = info; + return (0); +} + +enum exc_class { + EXC_BENIGN, + EXC_CONTRIBUTORY, + EXC_PAGEFAULT +}; + +#define IDT_VE 20 /* Virtualization Exception (Intel specific) */ + +static enum exc_class +exception_class(uint64_t info) +{ + int type, vector; + + KASSERT(info & VM_INTINFO_VALID, ("intinfo must be valid: %#lx", info)); + type = info & VM_INTINFO_TYPE; + vector = info & 0xff; + + /* Table 6-4, "Interrupt and Exception Classes", Intel SDM, Vol 3 */ + switch (type) { + case VM_INTINFO_HWINTR: + case VM_INTINFO_SWINTR: + case VM_INTINFO_NMI: + return (EXC_BENIGN); + default: + /* + * Hardware exception. + * + * SVM and VT-x use identical type values to represent NMI, + * hardware interrupt and software interrupt. + * + * SVM uses type '3' for all exceptions. VT-x uses type '3' + * for exceptions except #BP and #OF. #BP and #OF use a type + * value of '5' or '6'. Therefore we don't check for explicit + * values of 'type' to classify 'intinfo' into a hardware + * exception. + */ + break; + } + + switch (vector) { + case IDT_PF: + case IDT_VE: + return (EXC_PAGEFAULT); + case IDT_DE: + case IDT_TS: + case IDT_NP: + case IDT_SS: + case IDT_GP: + return (EXC_CONTRIBUTORY); + default: + return (EXC_BENIGN); + } +} + +static int +nested_fault(struct vm *vm, int vcpuid, uint64_t info1, uint64_t info2, + uint64_t *retinfo) +{ + enum exc_class exc1, exc2; + int type1, vector1; + + KASSERT(info1 & VM_INTINFO_VALID, ("info1 %#lx is not valid", info1)); + KASSERT(info2 & VM_INTINFO_VALID, ("info2 %#lx is not valid", info2)); + + /* + * If an exception occurs while attempting to call the double-fault + * handler the processor enters shutdown mode (aka triple fault). + */ + type1 = info1 & VM_INTINFO_TYPE; + vector1 = info1 & 0xff; + if (type1 == VM_INTINFO_HWEXCEPTION && vector1 == IDT_DF) { + VCPU_CTR2(vm, vcpuid, "triple fault: info1(%#lx), info2(%#lx)", + info1, info2); + vm_suspend(vm, VM_SUSPEND_TRIPLEFAULT); + *retinfo = 0; + return (0); + } + + /* + * Table 6-5 "Conditions for Generating a Double Fault", Intel SDM, Vol3 + */ + exc1 = exception_class(info1); + exc2 = exception_class(info2); + if ((exc1 == EXC_CONTRIBUTORY && exc2 == EXC_CONTRIBUTORY) || + (exc1 == EXC_PAGEFAULT && exc2 != EXC_BENIGN)) { + /* Convert nested fault into a double fault. */ + *retinfo = IDT_DF; + *retinfo |= VM_INTINFO_VALID | VM_INTINFO_HWEXCEPTION; + *retinfo |= VM_INTINFO_DEL_ERRCODE; + } else { + /* Handle exceptions serially */ + *retinfo = info2; + } + return (1); +} + +static uint64_t +vcpu_exception_intinfo(struct vcpu *vcpu) +{ + uint64_t info = 0; + + if (vcpu->exception_pending) { + info = vcpu->exception.vector & 0xff; + info |= VM_INTINFO_VALID | VM_INTINFO_HWEXCEPTION; + if (vcpu->exception.error_code_valid) { + info |= VM_INTINFO_DEL_ERRCODE; + info |= (uint64_t)vcpu->exception.error_code << 32; + } + } + return (info); +} + +int +vm_entry_intinfo(struct vm *vm, int vcpuid, uint64_t *retinfo) +{ + struct vcpu *vcpu; + uint64_t info1, info2; + int valid; + + KASSERT(vcpuid >= 0 && vcpuid < VM_MAXCPU, ("invalid vcpu %d", vcpuid)); + + vcpu = &vm->vcpu[vcpuid]; + + info1 = vcpu->exitintinfo; + vcpu->exitintinfo = 0; + + info2 = 0; + if (vcpu->exception_pending) { + info2 = vcpu_exception_intinfo(vcpu); + vcpu->exception_pending = 0; + VCPU_CTR2(vm, vcpuid, "Exception %d delivered: %#lx", + vcpu->exception.vector, info2); + } + + if ((info1 & VM_INTINFO_VALID) && (info2 & VM_INTINFO_VALID)) { + valid = nested_fault(vm, vcpuid, info1, info2, retinfo); + } else if (info1 & VM_INTINFO_VALID) { + *retinfo = info1; + valid = 1; + } else if (info2 & VM_INTINFO_VALID) { + *retinfo = info2; + valid = 1; + } else { + valid = 0; + } + + if (valid) { + VCPU_CTR4(vm, vcpuid, "%s: info1(%#lx), info2(%#lx), " + "retinfo(%#lx)", __func__, info1, info2, *retinfo); + } + + return (valid); +} + +int +vm_get_intinfo(struct vm *vm, int vcpuid, uint64_t *info1, uint64_t *info2) +{ + struct vcpu *vcpu; + + if (vcpuid < 0 || vcpuid >= VM_MAXCPU) + return (EINVAL); + + vcpu = &vm->vcpu[vcpuid]; + *info1 = vcpu->exitintinfo; + *info2 = vcpu_exception_intinfo(vcpu); + return (0); +} + +int vm_inject_exception(struct vm *vm, int vcpuid, struct vm_exception *exception) { struct vcpu *vcpu; @@ -1468,6 +1666,14 @@ vm_inject_exception(struct vm *vm, int v if (exception->vector < 0 || exception->vector >= 32) return (EINVAL); + /* + * A double fault exception should never be injected directly into + * the guest. It is a derived exception that results from specific + * combinations of nested faults. + */ + if (exception->vector == IDT_DF) + return (EINVAL); + vcpu = &vm->vcpu[vcpuid]; if (vcpu->exception_pending) { @@ -1483,25 +1689,6 @@ vm_inject_exception(struct vm *vm, int v return (0); } -int -vm_exception_pending(struct vm *vm, int vcpuid, struct vm_exception *exception) -{ - struct vcpu *vcpu; - int pending; - - KASSERT(vcpuid >= 0 && vcpuid < VM_MAXCPU, ("invalid vcpu %d", vcpuid)); - - vcpu = &vm->vcpu[vcpuid]; - pending = vcpu->exception_pending; - if (pending) { - vcpu->exception_pending = 0; - *exception = vcpu->exception; - VCPU_CTR1(vm, vcpuid, "Exception %d delivered", - exception->vector); - } - return (pending); -} - static void vm_inject_fault(struct vm *vm, int vcpuid, struct vm_exception *exception) { Modified: head/sys/amd64/vmm/vmm_dev.c ============================================================================== --- head/sys/amd64/vmm/vmm_dev.c Sat Jul 19 20:55:13 2014 (r268888) +++ head/sys/amd64/vmm/vmm_dev.c Sat Jul 19 20:59:08 2014 (r268889) @@ -173,6 +173,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long c struct vm_gla2gpa *gg; struct vm_activate_cpu *vac; struct vm_cpuset *vm_cpuset; + struct vm_intinfo *vmii; sc = vmmdev_lookup2(cdev); if (sc == NULL) @@ -199,6 +200,8 @@ vmmdev_ioctl(struct cdev *cdev, u_long c case VM_SET_X2APIC_STATE: case VM_GLA2GPA: case VM_ACTIVATE_CPU: + case VM_SET_INTINFO: + case VM_GET_INTINFO: /* * XXX fragile, handle with care * Assumes that the first field of the ioctl data is the vcpu. @@ -470,6 +473,15 @@ vmmdev_ioctl(struct cdev *cdev, u_long c error = copyout(cpuset, vm_cpuset->cpus, size); free(cpuset, M_TEMP); break; + case VM_SET_INTINFO: + vmii = (struct vm_intinfo *)data; + error = vm_exit_intinfo(sc->vm, vmii->vcpuid, vmii->info1); + break; + case VM_GET_INTINFO: + vmii = (struct vm_intinfo *)data; + error = vm_get_intinfo(sc->vm, vmii->vcpuid, &vmii->info1, + &vmii->info2); + break; default: error = ENOTTY; break; Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Sat Jul 19 20:55:13 2014 (r268888) +++ head/usr.sbin/bhyve/bhyverun.c Sat Jul 19 20:59:08 2014 (r268889) @@ -534,6 +534,8 @@ vmexit_suspend(struct vmctx *ctx, struct exit(1); case VM_SUSPEND_HALT: exit(2); + case VM_SUSPEND_TRIPLEFAULT: + exit(3); default: fprintf(stderr, "vmexit_suspend: invalid reason %d\n", how); exit(100); Modified: head/usr.sbin/bhyve/task_switch.c ============================================================================== --- head/usr.sbin/bhyve/task_switch.c Sat Jul 19 20:55:13 2014 (r268888) +++ head/usr.sbin/bhyve/task_switch.c Sat Jul 19 20:59:08 2014 (r268889) @@ -904,10 +904,14 @@ vmexit_task_switch(struct vmctx *ctx, st */ /* - * XXX is the original task switch was triggered by a hardware - * exception then do we generate a double-fault if we encounter - * an exception during the task switch? + * If the task switch was triggered by an event delivered through + * the IDT then extinguish the pending event from the vcpu's + * exitintinfo. */ + if (task_switch->reason == TSR_IDT_GATE) { + error = vm_set_intinfo(ctx, vcpu, 0); + assert(error == 0); + } /* * XXX should inject debug exception if 'T' bit is 1 Modified: head/usr.sbin/bhyvectl/bhyvectl.c ============================================================================== --- head/usr.sbin/bhyvectl/bhyvectl.c Sat Jul 19 20:55:13 2014 (r268888) +++ head/usr.sbin/bhyvectl/bhyvectl.c Sat Jul 19 20:59:08 2014 (r268889) @@ -195,7 +195,8 @@ usage(void) " [--force-reset]\n" " [--force-poweroff]\n" " [--get-active-cpus]\n" - " [--get-suspended-cpus]\n", + " [--get-suspended-cpus]\n" + " [--get-intinfo]\n", progname); exit(1); } @@ -205,6 +206,7 @@ static int inject_nmi, assert_lapic_lvt; static int force_reset, force_poweroff; static const char *capname; static int create, destroy, get_lowmem, get_highmem; +static int get_intinfo; static int get_active_cpus, get_suspended_cpus; static uint64_t memsize; static int set_cr0, get_cr0, set_cr3, get_cr3, set_cr4, get_cr4; @@ -412,6 +414,37 @@ print_cpus(const char *banner, const cpu printf("\n"); } +static void +print_intinfo(const char *banner, uint64_t info) +{ + int type; + + printf("%s:\t", banner); + if (info & VM_INTINFO_VALID) { + type = info & VM_INTINFO_TYPE; + switch (type) { + case VM_INTINFO_HWINTR: + printf("extint"); + break; + case VM_INTINFO_NMI: + printf("nmi"); + break; + case VM_INTINFO_SWINTR: + printf("swint"); + break; + default: + printf("exception"); + break; + } + printf(" vector %d", (int)VM_INTINFO_VECTOR(info)); + if (info & VM_INTINFO_DEL_ERRCODE) + printf(" errcode %#x", (u_int)(info >> 32)); + } else { + printf("n/a"); + } + printf("\n"); +} + int main(int argc, char *argv[]) { @@ -420,7 +453,7 @@ main(int argc, char *argv[]) vm_paddr_t gpa, gpa_pmap; size_t len; struct vm_exit vmexit; - uint64_t ctl, eptp, bm, addr, u64, pteval[4], *pte; + uint64_t ctl, eptp, bm, addr, u64, pteval[4], *pte, info[2]; struct vmctx *ctx; int wired; cpuset_t cpus; @@ -595,6 +628,7 @@ main(int argc, char *argv[]) { "force-poweroff", NO_ARG, &force_poweroff, 1 }, { "get-active-cpus", NO_ARG, &get_active_cpus, 1 }, { "get-suspended-cpus", NO_ARG, &get_suspended_cpus, 1 }, + { "get-intinfo", NO_ARG, &get_intinfo, 1 }, { NULL, 0, NULL, 0 } }; @@ -1566,6 +1600,14 @@ main(int argc, char *argv[]) print_cpus("suspended cpus", &cpus); } + if (!error && (get_intinfo || get_all)) { + error = vm_get_intinfo(ctx, vcpu, &info[0], &info[1]); + if (!error) { + print_intinfo("pending", info[0]); + print_intinfo("current", info[1]); + } + } + if (!error && run) { error = vm_get_register(ctx, vcpu, VM_REG_GUEST_RIP, &rip); assert(error == 0); From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 21:04:22 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 357571DC; Sat, 19 Jul 2014 21:04:22 +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 089B72EA7; Sat, 19 Jul 2014 21:04:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6JL4Ls4076756; Sat, 19 Jul 2014 21:04:21 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6JL4LkC076754; Sat, 19 Jul 2014 21:04:21 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201407192104.s6JL4LkC076754@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sat, 19 Jul 2014 21:04:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268890 - head/lib/libpam/modules/pam_group X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 21:04:22 -0000 Author: des Date: Sat Jul 19 21:04:21 2014 New Revision: 268890 URL: http://svnweb.freebsd.org/changeset/base/268890 Log: Add support for the "account" facility. PR: 115164 MFC after: 1 week Modified: head/lib/libpam/modules/pam_group/pam_group.8 head/lib/libpam/modules/pam_group/pam_group.c Modified: head/lib/libpam/modules/pam_group/pam_group.8 ============================================================================== --- head/lib/libpam/modules/pam_group/pam_group.8 Sat Jul 19 20:59:08 2014 (r268889) +++ head/lib/libpam/modules/pam_group/pam_group.8 Sat Jul 19 21:04:21 2014 (r268890) @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 9, 2011 +.Dd July 19, 2014 .Dt PAM_GROUP 8 .Os .Sh NAME @@ -48,6 +48,11 @@ .Sh DESCRIPTION The group service module for PAM accepts or rejects users based on their membership in a particular file group. +.Nm pam_group +provides functionality for two PAM categories: authentication and +account management. +In terms of the module-type parameter, they are the ``auth'' and +``account'' features. .Pp The following options may be passed to the .Nm Modified: head/lib/libpam/modules/pam_group/pam_group.c ============================================================================== --- head/lib/libpam/modules/pam_group/pam_group.c Sat Jul 19 20:59:08 2014 (r268889) +++ head/lib/libpam/modules/pam_group/pam_group.c Sat Jul 19 21:04:21 2014 (r268890) @@ -47,15 +47,14 @@ __FBSDID("$FreeBSD$"); #include #define PAM_SM_AUTH +#define PAM_SM_ACCOUNT #include #include #include - -PAM_EXTERN int -pam_sm_authenticate(pam_handle_t *pamh, int flags __unused, - int argc __unused, const char *argv[] __unused) +static int +pam_group(pam_handle_t *pamh) { int local, remote; const char *group, *user; @@ -121,6 +120,14 @@ pam_sm_authenticate(pam_handle_t *pamh, } PAM_EXTERN int +pam_sm_authenticate(pam_handle_t *pamh, int flags __unused, + int argc __unused, const char *argv[] __unused) +{ + + return (pam_group(pamh)); +} + +PAM_EXTERN int pam_sm_setcred(pam_handle_t * pamh __unused, int flags __unused, int argc __unused, const char *argv[] __unused) { @@ -128,4 +135,12 @@ pam_sm_setcred(pam_handle_t * pamh __unu return (PAM_SUCCESS); } +PAM_EXTERN int +pam_sm_acct_mgmt(pam_handle_t *pamh, int flags __unused, + int argc __unused, const char *argv[] __unused) +{ + + return (pam_group(pamh)); +} + PAM_MODULE_ENTRY("pam_group"); From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 21:23:35 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 579D55C9; Sat, 19 Jul 2014 21:23:35 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (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 291A22034; Sat, 19 Jul 2014 21:23:34 +0000 (UTC) Received: from c-50-155-136-3.hsd1.co.comcast.net ([50.155.136.3] helo=ilsoft.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1X8c6K-000IUM-Hw; Sat, 19 Jul 2014 21:23:28 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id s6JLNRM9027341; Sat, 19 Jul 2014 15:23:27 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 50.155.136.3 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1+HBmXnZNy/kuxMPxUGn7bI X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: svn commit: r268877 - head/share/mk From: Ian Lepore To: Dag-Erling =?ISO-8859-1?Q?Sm=F8rgrav?= In-Reply-To: <201407191426.s6JEQ4en083862@svn.freebsd.org> References: <201407191426.s6JEQ4en083862@svn.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" Date: Sat, 19 Jul 2014 15:23:27 -0600 Message-ID: <1405805007.85788.24.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by ilsoft.org id s6JLNRM9027341 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 21:23:35 -0000 On Sat, 2014-07-19 at 14:26 +0000, Dag-Erling Sm=F8rgrav wrote: > Author: des > Date: Sat Jul 19 14:26:04 2014 > New Revision: 268877 > URL: http://svnweb.freebsd.org/changeset/base/268877 >=20 > Log: > Use -o (output to file) instead of -t (print to stdout) and a redirec= t. > =20 > MFC after: 1 week >=20 > Modified: > head/share/mk/bsd.dep.mk >=20 > Modified: head/share/mk/bsd.dep.mk > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/share/mk/bsd.dep.mk Sat Jul 19 14:10:31 2014 (r268876) > +++ head/share/mk/bsd.dep.mk Sat Jul 19 14:26:04 2014 (r268877) > @@ -82,7 +82,7 @@ ${_S:R}.o: ${_S} > .for _LSRC in ${SRCS:M*.l:N*/*} > .for _LC in ${_LSRC:R}.c > ${_LC}: ${_LSRC} > - ${LEX} -t ${LFLAGS} ${.ALLSRC} > ${.TARGET} > + ${LEX} ${LFLAGS} -o ${.TARGET} ${.ALLSRC} > .if !exists(${.OBJDIR}/${DEPENDFILE}) > ${_LC:R}.o: ${_LC} > .endif >=20 This change breaks the ability to bootstrap from versions prior to 10.0 because the older lex requires "-ofilename" rather than "-o filename". Even more annoying, it's not possible to fix it by building the new lex earlier in bootstrap because the new lex requires a newer m4 be built first, and building the new m4 requires running this rule which doesn't work with the old lex. Grrrr. It seems like the path of least resistance would be to remove the space between -o and ${TARGET}, which I'll leave for you if you agree, so that you can MFC them together when the time comes. -- Ian From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 22:06:49 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0990CFD8; Sat, 19 Jul 2014 22:06:49 +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 DEA0F2346; Sat, 19 Jul 2014 22:06:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6JM6msM005676; Sat, 19 Jul 2014 22:06:48 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6JM6lEv005666; Sat, 19 Jul 2014 22:06:47 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201407192206.s6JM6lEv005666@svn.freebsd.org> From: John Baldwin Date: Sat, 19 Jul 2014 22:06:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268891 - in stable/10: lib/libvmmapi sys/amd64/include sys/amd64/vmm sys/amd64/vmm/intel sys/amd64/vmm/io sys/modules/vmm usr.sbin/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 22:06:49 -0000 Author: jhb Date: Sat Jul 19 22:06:46 2014 New Revision: 268891 URL: http://svnweb.freebsd.org/changeset/base/268891 Log: MFC 259942,262274,263035,263054,263211,263744,264179,264324,264468,264631, 264648,264650,264651,266572,267558: Flesh out the AT PIC and 8254 PIT emulations and move them into the kernel. Added: stable/10/sys/amd64/vmm/io/vatpic.c - copied, changed from r263035, head/sys/amd64/vmm/io/vatpic.c stable/10/sys/amd64/vmm/io/vatpic.h - copied, changed from r263035, head/sys/amd64/vmm/io/vatpic.h stable/10/sys/amd64/vmm/io/vatpit.c - copied, changed from r263744, head/sys/amd64/vmm/io/vatpit.c stable/10/sys/amd64/vmm/io/vatpit.h - copied, changed from r263744, head/sys/amd64/vmm/io/vatpit.h stable/10/sys/amd64/vmm/vmm_ioport.c - copied, changed from r263035, head/sys/amd64/vmm/vmm_ioport.c stable/10/sys/amd64/vmm/vmm_ioport.h - copied, changed from r263035, head/sys/amd64/vmm/vmm_ioport.h Deleted: stable/10/usr.sbin/bhyve/atpic.c stable/10/usr.sbin/bhyve/elcr.c stable/10/usr.sbin/bhyve/pit_8254.c stable/10/usr.sbin/bhyve/pit_8254.h Modified: stable/10/lib/libvmmapi/vmmapi.c stable/10/lib/libvmmapi/vmmapi.h stable/10/sys/amd64/include/vmm.h stable/10/sys/amd64/include/vmm_dev.h stable/10/sys/amd64/vmm/intel/vmx.c stable/10/sys/amd64/vmm/io/vhpet.c stable/10/sys/amd64/vmm/io/vlapic.c stable/10/sys/amd64/vmm/vmm.c stable/10/sys/amd64/vmm/vmm_dev.c stable/10/sys/modules/vmm/Makefile stable/10/usr.sbin/bhyve/Makefile stable/10/usr.sbin/bhyve/inout.c stable/10/usr.sbin/bhyve/pci_lpc.c stable/10/usr.sbin/bhyve/pm.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libvmmapi/vmmapi.c ============================================================================== --- stable/10/lib/libvmmapi/vmmapi.c Sat Jul 19 21:04:21 2014 (r268890) +++ stable/10/lib/libvmmapi/vmmapi.c Sat Jul 19 22:06:46 2014 (r268891) @@ -458,6 +458,41 @@ vm_ioapic_pincount(struct vmctx *ctx, in } int +vm_isa_assert_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq) +{ + struct vm_isa_irq isa_irq; + + bzero(&isa_irq, sizeof(struct vm_isa_irq)); + isa_irq.atpic_irq = atpic_irq; + isa_irq.ioapic_irq = ioapic_irq; + + return (ioctl(ctx->fd, VM_ISA_ASSERT_IRQ, &isa_irq)); +} + +int +vm_isa_deassert_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq) +{ + struct vm_isa_irq isa_irq; + + bzero(&isa_irq, sizeof(struct vm_isa_irq)); + isa_irq.atpic_irq = atpic_irq; + isa_irq.ioapic_irq = ioapic_irq; + + return (ioctl(ctx->fd, VM_ISA_DEASSERT_IRQ, &isa_irq)); +} + +int +vm_isa_pulse_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq) +{ + struct vm_isa_irq isa_irq; + bzero(&isa_irq, sizeof(struct vm_isa_irq)); + isa_irq.atpic_irq = atpic_irq; + isa_irq.ioapic_irq = ioapic_irq; + + return (ioctl(ctx->fd, VM_ISA_PULSE_IRQ, &isa_irq)); +} + +int vm_inject_nmi(struct vmctx *ctx, int vcpu) { struct vm_nmi vmnmi; Modified: stable/10/lib/libvmmapi/vmmapi.h ============================================================================== --- stable/10/lib/libvmmapi/vmmapi.h Sat Jul 19 21:04:21 2014 (r268890) +++ stable/10/lib/libvmmapi/vmmapi.h Sat Jul 19 22:06:46 2014 (r268891) @@ -71,6 +71,9 @@ int vm_ioapic_assert_irq(struct vmctx *c int vm_ioapic_deassert_irq(struct vmctx *ctx, int irq); int vm_ioapic_pulse_irq(struct vmctx *ctx, int irq); int vm_ioapic_pincount(struct vmctx *ctx, int *pincount); +int vm_isa_assert_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq); +int vm_isa_deassert_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq); +int vm_isa_pulse_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq); int vm_inject_nmi(struct vmctx *ctx, int vcpu); int vm_capability_name2type(const char *capname); const char *vm_capability_type2name(int type); Modified: stable/10/sys/amd64/include/vmm.h ============================================================================== --- stable/10/sys/amd64/include/vmm.h Sat Jul 19 21:04:21 2014 (r268890) +++ stable/10/sys/amd64/include/vmm.h Sat Jul 19 22:06:46 2014 (r268891) @@ -117,6 +117,9 @@ int vm_run(struct vm *vm, struct vm_run int vm_inject_nmi(struct vm *vm, int vcpu); int vm_nmi_pending(struct vm *vm, int vcpuid); void vm_nmi_clear(struct vm *vm, int vcpuid); +int vm_inject_extint(struct vm *vm, int vcpu); +int vm_extint_pending(struct vm *vm, int vcpuid); +void vm_extint_clear(struct vm *vm, int vcpuid); uint64_t *vm_guest_msrs(struct vm *vm, int cpu); struct vlapic *vm_lapic(struct vm *vm, int cpu); struct vioapic *vm_ioapic(struct vm *vm); @@ -187,6 +190,8 @@ void vcpu_notify_event(struct vm *vm, in struct vmspace *vm_get_vmspace(struct vm *vm); int vm_assign_pptdev(struct vm *vm, int bus, int slot, int func); int vm_unassign_pptdev(struct vm *vm, int bus, int slot, int func); +struct vatpic *vm_atpic(struct vm *vm); +struct vatpit *vm_atpit(struct vm *vm); /* * Inject exception 'vme' into the guest vcpu. This function returns 0 on Modified: stable/10/sys/amd64/include/vmm_dev.h ============================================================================== --- stable/10/sys/amd64/include/vmm_dev.h Sat Jul 19 21:04:21 2014 (r268890) +++ stable/10/sys/amd64/include/vmm_dev.h Sat Jul 19 22:06:46 2014 (r268891) @@ -79,6 +79,11 @@ struct vm_ioapic_irq { int irq; }; +struct vm_isa_irq { + int atpic_irq; + int ioapic_irq; +}; + struct vm_capability { int cpuid; enum vm_cap_type captype; @@ -198,6 +203,11 @@ enum { IOCNUM_SET_X2APIC_STATE = 60, IOCNUM_GET_X2APIC_STATE = 61, IOCNUM_GET_HPET_CAPABILITIES = 62, + + /* legacy interrupt injection */ + IOCNUM_ISA_ASSERT_IRQ = 80, + IOCNUM_ISA_DEASSERT_IRQ = 81, + IOCNUM_ISA_PULSE_IRQ = 82, }; #define VM_RUN \ @@ -230,6 +240,12 @@ enum { _IOW('v', IOCNUM_IOAPIC_PULSE_IRQ, struct vm_ioapic_irq) #define VM_IOAPIC_PINCOUNT \ _IOR('v', IOCNUM_IOAPIC_PINCOUNT, int) +#define VM_ISA_ASSERT_IRQ \ + _IOW('v', IOCNUM_ISA_ASSERT_IRQ, struct vm_isa_irq) +#define VM_ISA_DEASSERT_IRQ \ + _IOW('v', IOCNUM_ISA_DEASSERT_IRQ, struct vm_isa_irq) +#define VM_ISA_PULSE_IRQ \ + _IOW('v', IOCNUM_ISA_PULSE_IRQ, struct vm_isa_irq) #define VM_SET_CAPABILITY \ _IOW('v', IOCNUM_SET_CAPABILITY, struct vm_capability) #define VM_GET_CAPABILITY \ Modified: stable/10/sys/amd64/vmm/intel/vmx.c ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmx.c Sat Jul 19 21:04:21 2014 (r268890) +++ stable/10/sys/amd64/vmm/intel/vmx.c Sat Jul 19 22:06:46 2014 (r268891) @@ -52,10 +52,12 @@ __FBSDID("$FreeBSD$"); #include #include #include "vmm_host.h" +#include "vmm_ioport.h" #include "vmm_ipi.h" #include "vmm_msr.h" #include "vmm_ktr.h" #include "vmm_stat.h" +#include "vatpic.h" #include "vlapic.h" #include "vlapic_priv.h" @@ -1046,6 +1048,7 @@ vmx_set_pcpu_defaults(struct vmx *vmx, i invvpid_desc._res1 = 0; invvpid_desc._res2 = 0; invvpid_desc.vpid = vmxstate->vpid; + invvpid_desc.linear_addr = 0; invvpid(INVVPID_TYPE_SINGLE_CONTEXT, invvpid_desc); } else { /* @@ -1143,7 +1146,7 @@ static void vmx_inject_interrupts(struct vmx *vmx, int vcpu, struct vlapic *vlapic) { struct vm_exception exc; - int vector, need_nmi_exiting; + int vector, need_nmi_exiting, extint_pending; uint64_t rflags; uint32_t gi, info; @@ -1195,7 +1198,9 @@ vmx_inject_interrupts(struct vmx *vmx, i vmx_set_nmi_window_exiting(vmx, vcpu); } - if (virtual_interrupt_delivery) { + extint_pending = vm_extint_pending(vmx->vm, vcpu); + + if (!extint_pending && virtual_interrupt_delivery) { vmx_inject_pir(vlapic); return; } @@ -1211,11 +1216,32 @@ vmx_inject_interrupts(struct vmx *vmx, i return; } - /* Ask the local apic for a vector to inject */ - if (!vlapic_pending_intr(vlapic, &vector)) - return; + if (!extint_pending) { + /* Ask the local apic for a vector to inject */ + if (!vlapic_pending_intr(vlapic, &vector)) + return; - KASSERT(vector >= 32 && vector <= 255, ("invalid vector %d", vector)); + /* + * From the Intel SDM, Volume 3, Section "Maskable + * Hardware Interrupts": + * - maskable interrupt vectors [16,255] can be delivered + * through the local APIC. + */ + KASSERT(vector >= 16 && vector <= 255, + ("invalid vector %d from local APIC", vector)); + } else { + /* Ask the legacy pic for a vector to inject */ + vatpic_pending_intr(vmx->vm, &vector); + + /* + * From the Intel SDM, Volume 3, Section "Maskable + * Hardware Interrupts": + * - maskable interrupt vectors [0,255] can be delivered + * through the INTR pin. + */ + KASSERT(vector >= 0 && vector <= 255, + ("invalid vector %d from INTR", vector)); + } /* Check RFLAGS.IF and the interruptibility state of the guest */ rflags = vmcs_read(VMCS_GUEST_RFLAGS); @@ -1251,8 +1277,22 @@ vmx_inject_interrupts(struct vmx *vmx, i info |= vector; vmcs_write(VMCS_ENTRY_INTR_INFO, info); - /* Update the Local APIC ISR */ - vlapic_intr_accepted(vlapic, vector); + if (!extint_pending) { + /* Update the Local APIC ISR */ + vlapic_intr_accepted(vlapic, vector); + } else { + vm_extint_clear(vmx->vm, vcpu); + vatpic_intr_accepted(vmx->vm, vector); + + /* + * After we accepted the current ExtINT the PIC may + * have posted another one. If that is the case, set + * the Interrupt Window Exiting execution control so + * we can inject that one too. + */ + if (vm_extint_pending(vmx->vm, vcpu)) + vmx_set_int_window_exiting(vmx, vcpu); + } VCPU_CTR1(vmx->vm, vcpu, "Injecting hwintr at vector %d", vector); @@ -1388,6 +1428,7 @@ vmx_emulate_cr_access(struct vmx *vmx, i if (cr != 0 && cr != 4) return (UNHANDLED); + regval = 0; /* silence gcc */ vmxctx = &vmx->ctx[vcpu]; /* @@ -1882,6 +1923,11 @@ vmx_exit_process(struct vmx *vmx, int vc vmexit->u.inout.rep = (qual & 0x20) ? 1 : 0; vmexit->u.inout.port = (uint16_t)(qual >> 16); vmexit->u.inout.eax = (uint32_t)(vmxctx->guest_rax); + error = emulate_ioport(vmx->vm, vcpu, vmexit); + if (error == 0) { + handled = 1; + vmxctx->guest_rax = vmexit->u.inout.eax; + } break; case EXIT_REASON_CPUID: vmm_stat_incr(vmx->vm, vcpu, VMEXIT_CPUID, 1); @@ -2719,7 +2765,7 @@ vmx_inject_pir(struct vlapic *vlapic) struct pir_desc *pir_desc; struct LAPIC *lapic; uint64_t val, pirval; - int rvi, pirbase; + int rvi, pirbase = -1; uint16_t intr_status_old, intr_status_new; vlapic_vtx = (struct vlapic_vtx *)vlapic; @@ -2731,6 +2777,7 @@ vmx_inject_pir(struct vlapic *vlapic) } pirval = 0; + pirbase = -1; lapic = vlapic->apic_page; val = atomic_readandclear_long(&pir_desc->pir[0]); @@ -2764,11 +2811,29 @@ vmx_inject_pir(struct vlapic *vlapic) pirbase = 192; pirval = val; } + VLAPIC_CTR_IRR(vlapic, "vmx_inject_pir"); /* * Update RVI so the processor can evaluate pending virtual * interrupts on VM-entry. + * + * It is possible for pirval to be 0 here, even though the + * pending bit has been set. The scenario is: + * CPU-Y is sending a posted interrupt to CPU-X, which + * is running a guest and processing posted interrupts in h/w. + * CPU-X will eventually exit and the state seen in s/w is + * the pending bit set, but no PIR bits set. + * + * CPU-X CPU-Y + * (vm running) (host running) + * rx posted interrupt + * CLEAR pending bit + * SET PIR bit + * READ/CLEAR PIR bits + * SET pending bit + * (vm exit) + * pending bit set, PIR 0 */ if (pirval != 0) { rvi = pirbase + flsl(pirval) - 1; Copied and modified: stable/10/sys/amd64/vmm/io/vatpic.c (from r263035, head/sys/amd64/vmm/io/vatpic.c) ============================================================================== --- head/sys/amd64/vmm/io/vatpic.c Tue Mar 11 16:56:00 2014 (r263035, copy source) +++ stable/10/sys/amd64/vmm/io/vatpic.c Sat Jul 19 22:06:46 2014 (r268891) @@ -67,6 +67,7 @@ struct atpic { bool aeoi; bool poll; bool rotate; + bool sfn; /* special fully-nested mode */ int irq_base; uint8_t request; /* Interrupt Request Register (IIR) */ @@ -75,6 +76,8 @@ struct atpic { int acnt[8]; /* sum of pin asserts and deasserts */ int priority; /* current pin priority */ + + bool intr_raised; }; struct vatpic { @@ -99,6 +102,7 @@ struct vatpic { #define VATPIC_CTR4(vatpic, fmt, a1, a2, a3, a4) \ VM_CTR4((vatpic)->vm, fmt, a1, a2, a3, a4) +static void vatpic_set_pinstate(struct vatpic *vatpic, int pin, bool newstate); static __inline int vatpic_get_highest_isrpin(struct atpic *atpic) @@ -120,13 +124,23 @@ vatpic_get_highest_isrpin(struct atpic * static __inline int vatpic_get_highest_irrpin(struct atpic *atpic) { + int serviced; int bit, pin; int i, j; + /* + * In 'Special Fully-Nested Mode' when an interrupt request from + * a slave is in service, the slave is not locked out from the + * master's priority logic. + */ + serviced = atpic->service; + if (atpic->sfn) + serviced &= ~(1 << 2); + for (i = 0; i <= 7; i++) { pin = ((i + 7 - atpic->priority) & 0x7); bit = (1 << pin); - if (atpic->service & bit) + if (serviced & bit) break; } @@ -148,17 +162,65 @@ vatpic_notify_intr(struct vatpic *vatpic KASSERT(VATPIC_LOCKED(vatpic), ("vatpic_notify_intr not locked")); - /* XXX master only */ - atpic = &vatpic->atpic[0]; + /* + * First check the slave. + */ + atpic = &vatpic->atpic[1]; + if (!atpic->intr_raised && + (pin = vatpic_get_highest_irrpin(atpic)) != -1) { + VATPIC_CTR4(vatpic, "atpic slave notify pin = %d " + "(imr 0x%x irr 0x%x isr 0x%x)", pin, + atpic->mask, atpic->request, atpic->service); + + /* + * Cascade the request from the slave to the master. + */ + atpic->intr_raised = true; + vatpic_set_pinstate(vatpic, 2, true); + vatpic_set_pinstate(vatpic, 2, false); + } else { + VATPIC_CTR3(vatpic, "atpic slave no eligible interrupts " + "(imr 0x%x irr 0x%x isr 0x%x)", + atpic->mask, atpic->request, atpic->service); + } - if ((pin = vatpic_get_highest_irrpin(atpic)) != -1) { - VATPIC_CTR4(vatpic, "atpic notify pin = %d " + /* + * Then check the master. + */ + atpic = &vatpic->atpic[0]; + if (!atpic->intr_raised && + (pin = vatpic_get_highest_irrpin(atpic)) != -1) { + VATPIC_CTR4(vatpic, "atpic master notify pin = %d " "(imr 0x%x irr 0x%x isr 0x%x)", pin, atpic->mask, atpic->request, atpic->service); + + /* + * PIC interrupts are routed to both the Local APIC + * and the I/O APIC to support operation in 1 of 3 + * modes. + * + * 1. Legacy PIC Mode: the PIC effectively bypasses + * all APIC components. In mode '1' the local APIC is + * disabled and LINT0 is reconfigured as INTR to + * deliver the PIC interrupt directly to the CPU. + * + * 2. Virtual Wire Mode: the APIC is treated as a + * virtual wire which delivers interrupts from the PIC + * to the CPU. In mode '2' LINT0 is programmed as + * ExtINT to indicate that the PIC is the source of + * the interrupt. + * + * 3. Symmetric I/O Mode: PIC interrupts are fielded + * by the I/O APIC and delivered to the appropriate + * CPU. In mode '3' the I/O APIC input 0 is + * programmed as ExtINT to indicate that the PIC is + * the source of the interrupt. + */ + atpic->intr_raised = true; lapic_set_local_intr(vatpic->vm, -1, APIC_LVT_LINT0); vioapic_pulse_irq(vatpic->vm, 0); } else { - VATPIC_CTR3(vatpic, "atpic no eligible interrupts " + VATPIC_CTR3(vatpic, "atpic master no eligible interrupts " "(imr 0x%x irr 0x%x isr 0x%x)", atpic->mask, atpic->request, atpic->service); } @@ -384,7 +446,7 @@ vatpic_pulse_irq(struct vm *vm, int irq) return (vatpic_set_irqstate(vm, irq, IRQSTATE_PULSE)); } -int +void vatpic_pending_intr(struct vm *vm, int *vecptr) { struct vatpic *vatpic; @@ -393,7 +455,6 @@ vatpic_pending_intr(struct vm *vm, int * vatpic = vm_atpic(vm); - /* XXX master only */ atpic = &vatpic->atpic[0]; VATPIC_LOCK(vatpic); @@ -401,37 +462,53 @@ vatpic_pending_intr(struct vm *vm, int * pin = vatpic_get_highest_irrpin(atpic); if (pin == -1) pin = 7; + if (pin == 2) { + atpic = &vatpic->atpic[1]; + pin = vatpic_get_highest_irrpin(atpic); + } *vecptr = atpic->irq_base + pin; VATPIC_UNLOCK(vatpic); +} - return (1); +static void +vatpic_pin_accepted(struct atpic *atpic, int pin) +{ + atpic->intr_raised = false; + + if (atpic->acnt[pin] == 0) + atpic->request &= ~(1 << pin); + + if (atpic->aeoi == true) { + if (atpic->rotate == true) + atpic->priority = pin; + } else { + atpic->service |= (1 << pin); + } } void vatpic_intr_accepted(struct vm *vm, int vector) { struct vatpic *vatpic; - struct atpic *atpic; int pin; vatpic = vm_atpic(vm); - /* XXX master only */ - atpic = &vatpic->atpic[0]; - VATPIC_LOCK(vatpic); - pin = vector & 0x7; - if (atpic->acnt[pin] == 0) - atpic->request &= ~(1 << pin); + pin = vector & 0x7; - if (atpic->aeoi == true) { - if (atpic->rotate == true) - atpic->priority = pin; + if ((vector & ~0x7) == vatpic->atpic[1].irq_base) { + vatpic_pin_accepted(&vatpic->atpic[1], pin); + /* + * If this vector originated from the slave, + * accept the cascaded interrupt too. + */ + vatpic_pin_accepted(&vatpic->atpic[0], 2); } else { - atpic->service |= (1 << pin); + vatpic_pin_accepted(&vatpic->atpic[0], pin); } vatpic_notify_intr(vatpic); @@ -439,51 +516,50 @@ vatpic_intr_accepted(struct vm *vm, int VATPIC_UNLOCK(vatpic); } -int -vatpic_master_handler(void *vm, int vcpuid, struct vm_exit *vmexit) +static int +vatpic_read(struct vatpic *vatpic, struct atpic *atpic, bool in, int port, + int bytes, uint32_t *eax) { - struct vatpic *vatpic; - struct atpic *atpic; - int error; - uint8_t val; - - vatpic = vm_atpic(vm); - atpic = &vatpic->atpic[0]; + VATPIC_LOCK(vatpic); - if (vmexit->u.inout.bytes != 1) + if (atpic->poll) { + VATPIC_CTR0(vatpic, "vatpic polled mode not supported"); + VATPIC_UNLOCK(vatpic); return (-1); - - if (vmexit->u.inout.in) { - VATPIC_LOCK(vatpic); - if (atpic->poll) { - VATPIC_CTR0(vatpic, "vatpic polled mode not " - "supported"); - VATPIC_UNLOCK(vatpic); - return (-1); + } else { + if (port & ICU_IMR_OFFSET) { + /* read interrrupt mask register */ + *eax = atpic->mask; } else { - if (vmexit->u.inout.port & ICU_IMR_OFFSET) { - /* read interrrupt mask register */ - vmexit->u.inout.eax = atpic->mask; + if (atpic->rd_cmd_reg == OCW3_RIS) { + /* read interrupt service register */ + *eax = atpic->service; } else { - if (atpic->rd_cmd_reg == OCW3_RIS) { - /* read interrupt service register */ - vmexit->u.inout.eax = atpic->service; - } else { - /* read interrupt request register */ - vmexit->u.inout.eax = atpic->request; - } + /* read interrupt request register */ + *eax = atpic->request; } } - VATPIC_UNLOCK(vatpic); - - return (0); } - val = vmexit->u.inout.eax; + VATPIC_UNLOCK(vatpic); + + return (0); + +} + +static int +vatpic_write(struct vatpic *vatpic, struct atpic *atpic, bool in, int port, + int bytes, uint32_t *eax) +{ + int error; + uint8_t val; + + error = 0; + val = *eax; VATPIC_LOCK(vatpic); - if (vmexit->u.inout.port & ICU_IMR_OFFSET) { + if (port & ICU_IMR_OFFSET) { if (atpic->ready) { error = vatpic_ocw1(vatpic, atpic, val); } else { @@ -520,41 +596,65 @@ vatpic_master_handler(void *vm, int vcpu } int -vatpic_slave_handler(void *vm, int vcpuid, struct vm_exit *vmexit) +vatpic_master_handler(void *vm, int vcpuid, bool in, int port, int bytes, + uint32_t *eax) { - if (vmexit->u.inout.bytes != 1) + struct vatpic *vatpic; + struct atpic *atpic; + + vatpic = vm_atpic(vm); + atpic = &vatpic->atpic[0]; + + if (bytes != 1) return (-1); - if (vmexit->u.inout.in) { - if (vmexit->u.inout.port & ICU_IMR_OFFSET) { - /* all interrupts masked */ - vmexit->u.inout.eax = 0xff; - } else { - vmexit->u.inout.eax = 0x00; - } + if (in) { + return (vatpic_read(vatpic, atpic, in, port, bytes, eax)); } - /* Pretend all accesses to the slave 8259 are alright */ - return (0); + return (vatpic_write(vatpic, atpic, in, port, bytes, eax)); } int -vatpic_elc_handler(void *vm, int vcpuid, struct vm_exit *vmexit) +vatpic_slave_handler(void *vm, int vcpuid, bool in, int port, int bytes, + uint32_t *eax) +{ + struct vatpic *vatpic; + struct atpic *atpic; + + vatpic = vm_atpic(vm); + atpic = &vatpic->atpic[1]; + + if (bytes != 1) + return (-1); + + if (in) { + return (vatpic_read(vatpic, atpic, in, port, bytes, eax)); + } + + return (vatpic_write(vatpic, atpic, in, port, bytes, eax)); +} + +int +vatpic_elc_handler(void *vm, int vcpuid, bool in, int port, int bytes, + uint32_t *eax) { struct vatpic *vatpic; bool is_master; vatpic = vm_atpic(vm); - is_master = (vmexit->u.inout.port == IO_ELCR1); + is_master = (port == IO_ELCR1); - if (vmexit->u.inout.bytes != 1) + if (bytes != 1) return (-1); - if (vmexit->u.inout.in) { + VATPIC_LOCK(vatpic); + + if (in) { if (is_master) - vmexit->u.inout.eax = vatpic->elc[0]; + *eax = vatpic->elc[0]; else - vmexit->u.inout.eax = vatpic->elc[1]; + *eax = vatpic->elc[1]; } else { /* * For the master PIC the cascade channel (IRQ2), the @@ -567,11 +667,13 @@ vatpic_elc_handler(void *vm, int vcpuid, * be programmed for level mode. */ if (is_master) - vatpic->elc[0] = (vmexit->u.inout.eax & 0xf8); + vatpic->elc[0] = (*eax & 0xf8); else - vatpic->elc[1] = (vmexit->u.inout.eax & 0xde); + vatpic->elc[1] = (*eax & 0xde); } + VATPIC_UNLOCK(vatpic); + return (0); } Copied and modified: stable/10/sys/amd64/vmm/io/vatpic.h (from r263035, head/sys/amd64/vmm/io/vatpic.h) ============================================================================== --- head/sys/amd64/vmm/io/vatpic.h Tue Mar 11 16:56:00 2014 (r263035, copy source) +++ stable/10/sys/amd64/vmm/io/vatpic.h Sat Jul 19 22:06:46 2014 (r268891) @@ -39,15 +39,18 @@ struct vatpic *vatpic_init(struct vm *vm); void vatpic_cleanup(struct vatpic *vatpic); -int vatpic_master_handler(void *vm, int vcpuid, struct vm_exit *vmexit); -int vatpic_slave_handler(void *vm, int vcpuid, struct vm_exit *vmexit); -int vatpic_elc_handler(void *vm, int vcpuid, struct vm_exit *vmexit); +int vatpic_master_handler(void *vm, int vcpuid, bool in, int port, int bytes, + uint32_t *eax); +int vatpic_slave_handler(void *vm, int vcpuid, bool in, int port, int bytes, + uint32_t *eax); +int vatpic_elc_handler(void *vm, int vcpuid, bool in, int port, int bytes, + uint32_t *eax); int vatpic_assert_irq(struct vm *vm, int irq); int vatpic_deassert_irq(struct vm *vm, int irq); int vatpic_pulse_irq(struct vm *vm, int irq); -int vatpic_pending_intr(struct vm *vm, int *vecptr); +void vatpic_pending_intr(struct vm *vm, int *vecptr); void vatpic_intr_accepted(struct vm *vm, int vector); #endif /* _VATPIC_H_ */ Copied and modified: stable/10/sys/amd64/vmm/io/vatpit.c (from r263744, head/sys/amd64/vmm/io/vatpit.c) ============================================================================== --- head/sys/amd64/vmm/io/vatpit.c Tue Mar 25 19:20:34 2014 (r263744, copy source) +++ stable/10/sys/amd64/vmm/io/vatpit.c Sat Jul 19 22:06:46 2014 (r268891) @@ -56,6 +56,17 @@ static MALLOC_DEFINE(M_VATPIT, "atpit", #define TIMER_MODE_MASK 0x0f #define TIMER_SEL_READBACK 0xc0 +#define TIMER_STS_OUT 0x80 +#define TIMER_STS_NULLCNT 0x40 + +#define TIMER_RB_LCTR 0x20 +#define TIMER_RB_LSTATUS 0x10 +#define TIMER_RB_CTR_2 0x08 +#define TIMER_RB_CTR_1 0x04 +#define TIMER_RB_CTR_0 0x02 + +#define TMR2_OUT_STS 0x20 + #define PIT_8254_FREQ 1193182 #define TIMER_DIV(freq, hz) (((freq) + (hz) / 2) / (hz)) @@ -71,6 +82,8 @@ struct channel { sbintime_t now_sbt; /* uptime when counter was loaded */ uint8_t cr[2]; uint8_t ol[2]; + bool slatched; /* status latched */ + uint8_t status; int crbyte; int olbyte; int frbyte; @@ -88,22 +101,29 @@ struct vatpit { struct channel channel[3]; }; -#define VATPIT_CTR0(vatpit, fmt) \ - VM_CTR0((vatpit)->vm, fmt) - -#define VATPIT_CTR1(vatpit, fmt, a1) \ - VM_CTR1((vatpit)->vm, fmt, a1) +static void pit_timer_start_cntr0(struct vatpit *vatpit); -#define VATPIT_CTR2(vatpit, fmt, a1, a2) \ - VM_CTR2((vatpit)->vm, fmt, a1, a2) +static int +vatpit_get_out(struct vatpit *vatpit, int channel) +{ + struct channel *c; + sbintime_t delta_ticks; + int out; -#define VATPIT_CTR3(vatpit, fmt, a1, a2, a3) \ - VM_CTR3((vatpit)->vm, fmt, a1, a2, a3) + c = &vatpit->channel[channel]; -#define VATPIT_CTR4(vatpit, fmt, a1, a2, a3, a4) \ - VM_CTR4((vatpit)->vm, fmt, a1, a2, a3, a4) + switch (c->mode) { + case TIMER_INTTC: + delta_ticks = (sbinuptime() - c->now_sbt) / vatpit->freq_sbt; + out = ((c->initial - delta_ticks) <= 0); + break; + default: + out = 0; + break; + } -static void pit_timer_start_cntr0(struct vatpit *vatpit); + return (out); +} static void vatpit_callout_handler(void *a) @@ -117,7 +137,7 @@ vatpit_callout_handler(void *a) c = &vatpit->channel[arg->channel_num]; callout = &c->callout; - VATPIT_CTR1(vatpit, "atpit t%d fired", arg->channel_num); + VM_CTR1(vatpit->vm, "atpit t%d fired", arg->channel_num); VATPIT_LOCK(vatpit); @@ -145,7 +165,7 @@ static void pit_timer_start_cntr0(struct vatpit *vatpit) { struct channel *c; - sbintime_t delta, precision; + sbintime_t now, delta, precision; c = &vatpit->channel[0]; if (c->initial != 0) { @@ -153,6 +173,15 @@ pit_timer_start_cntr0(struct vatpit *vat precision = delta >> tc_precexp; c->callout_sbt = c->callout_sbt + delta; + /* + * Reset 'callout_sbt' if the time that the callout + * was supposed to fire is more than 'c->initial' + * ticks in the past. + */ + now = sbinuptime(); + if (c->callout_sbt < now) + c->callout_sbt = now + delta; + callout_reset_sbt(&c->callout, c->callout_sbt, precision, vatpit_callout_handler, &c->callout_arg, C_ABSOLUTE); @@ -180,6 +209,7 @@ pit_update_counter(struct vatpit *vatpit */ c->initial = TIMER_DIV(PIT_8254_FREQ, 100); c->now_sbt = sbinuptime(); + c->status &= ~TIMER_STS_NULLCNT; } delta_ticks = (sbinuptime() - c->now_sbt) / vatpit->freq_sbt; @@ -196,6 +226,57 @@ pit_update_counter(struct vatpit *vatpit } static int +pit_readback1(struct vatpit *vatpit, int channel, uint8_t cmd) +{ + struct channel *c; + + c = &vatpit->channel[channel]; + + /* + * Latch the count/status of the timer if not already latched. + * N.B. that the count/status latch-select bits are active-low. + */ + if (!(cmd & TIMER_RB_LCTR) && !c->olbyte) { + (void) pit_update_counter(vatpit, c, true); + } + + if (!(cmd & TIMER_RB_LSTATUS) && !c->slatched) { + c->slatched = true; + /* + * For mode 0, see if the elapsed time is greater + * than the initial value - this results in the + * output pin being set to 1 in the status byte. + */ + if (c->mode == TIMER_INTTC && vatpit_get_out(vatpit, channel)) + c->status |= TIMER_STS_OUT; + else + c->status &= ~TIMER_STS_OUT; + } + + return (0); +} + +static int +pit_readback(struct vatpit *vatpit, uint8_t cmd) +{ + int error; + + /* + * The readback command can apply to all timers. + */ + error = 0; + if (cmd & TIMER_RB_CTR_0) + error = pit_readback1(vatpit, 0, cmd); + if (!error && cmd & TIMER_RB_CTR_1) + error = pit_readback1(vatpit, 1, cmd); + if (!error && cmd & TIMER_RB_CTR_2) + error = pit_readback1(vatpit, 2, cmd); + + return (error); +} + + +static int vatpit_update_mode(struct vatpit *vatpit, uint8_t val) { struct channel *c; @@ -206,7 +287,7 @@ vatpit_update_mode(struct vatpit *vatpit mode = val & TIMER_MODE_MASK; if (sel == TIMER_SEL_READBACK) - return (-1); + return (pit_readback(vatpit, val)); if (rw != TIMER_LATCH && rw != TIMER_16BIT) return (-1); @@ -229,53 +310,31 @@ vatpit_update_mode(struct vatpit *vatpit else { c->mode = mode; c->olbyte = 0; /* reset latch after reprogramming */ + c->status |= TIMER_STS_NULLCNT; } return (0); } -static int -vatpit_get_out(struct vatpit *vatpit, int channel) -{ - struct channel *c; - sbintime_t delta_ticks; - int out; - - c = &vatpit->channel[channel]; - - switch (c->mode) { - case TIMER_INTTC: - delta_ticks = (sbinuptime() - c->now_sbt) / vatpit->freq_sbt; - out = ((c->initial - delta_ticks) <= 0); - break; - default: - out = 0; - break; - } - - return (out); -} - int -vatpit_handler(void *vm, int vcpuid, struct vm_exit *vmexit) +vatpit_handler(void *vm, int vcpuid, bool in, int port, int bytes, + uint32_t *eax) { struct vatpit *vatpit; struct channel *c; - int port; uint8_t val; int error; vatpit = vm_atpit(vm); - if (vmexit->u.inout.bytes != 1) + if (bytes != 1) return (-1); - val = vmexit->u.inout.eax; - port = vmexit->u.inout.port; + val = *eax; if (port == TIMER_MODE) { - if (vmexit->u.inout.in != 0) { - VATPIT_CTR0(vatpit, "vatpit attempt to read mode"); + if (in) { + VM_CTR0(vatpit->vm, "vatpit attempt to read mode"); return (-1); } @@ -287,12 +346,19 @@ vatpit_handler(void *vm, int vcpuid, str } /* counter ports */ - KASSERT(port >= TIMER_CNTR0 && vmexit->u.inout.port <= TIMER_CNTR2, + KASSERT(port >= TIMER_CNTR0 && port <= TIMER_CNTR2, ("invalid port 0x%x", port)); c = &vatpit->channel[port - TIMER_CNTR0]; VATPIT_LOCK(vatpit); - if (vmexit->u.inout.in) { + if (in && c->slatched) { + /* + * Return the status byte if latched + */ + *eax = c->status; + c->slatched = false; + c->status = 0; + } else if (in) { /* * The spec says that once the output latch is completely * read it should revert to "following" the counter. Use @@ -307,13 +373,14 @@ vatpit_handler(void *vm, int vcpuid, str if (c->frbyte) tmp >>= 8; tmp &= 0xff; - vmexit->u.inout.eax = tmp; + *eax = tmp; c->frbyte ^= 1; } else - vmexit->u.inout.eax = c->ol[--c->olbyte]; + *eax = c->ol[--c->olbyte]; } else { - c->cr[c->crbyte++] = vmexit->u.inout.eax; + c->cr[c->crbyte++] = *eax; if (c->crbyte == 2) { + c->status &= ~TIMER_STS_NULLCNT; c->frbyte = 0; c->crbyte = 0; c->initial = c->cr[0] | (uint16_t)c->cr[1] << 8; @@ -332,6 +399,27 @@ vatpit_handler(void *vm, int vcpuid, str return (0); } +int +vatpit_nmisc_handler(void *vm, int vcpuid, bool in, int port, int bytes, + uint32_t *eax) +{ + struct vatpit *vatpit; + + vatpit = vm_atpit(vm); + + if (in) { + VATPIT_LOCK(vatpit); + if (vatpit_get_out(vatpit, 2)) + *eax = TMR2_OUT_STS; + else *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 22:13:13 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C03531E9; Sat, 19 Jul 2014 22:13:13 +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 A108823E2; Sat, 19 Jul 2014 22:13:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6JMDD5l010081; Sat, 19 Jul 2014 22:13:13 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6JMDDdH010079; Sat, 19 Jul 2014 22:13:13 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201407192213.s6JMDDdH010079@svn.freebsd.org> From: John Baldwin Date: Sat, 19 Jul 2014 22:13:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268892 - stable/10/usr.sbin/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 22:13:13 -0000 Author: jhb Date: Sat Jul 19 22:13:12 2014 New Revision: 268892 URL: http://svnweb.freebsd.org/changeset/base/268892 Log: MFC 262884,263236,265407: Various uart fixes: - Open the uart emulation's backing tty in non-blocking mode. - Support 16-bit register access. - Disable the 'uart_drain()' callback when the emulated receive FIFO is full. Modified: stable/10/usr.sbin/bhyve/pci_lpc.c stable/10/usr.sbin/bhyve/uart_emul.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/pci_lpc.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_lpc.c Sat Jul 19 22:06:46 2014 (r268891) +++ stable/10/usr.sbin/bhyve/pci_lpc.c Sat Jul 19 22:13:12 2014 (r268892) @@ -130,15 +130,27 @@ lpc_uart_io_handler(struct vmctx *ctx, i int offset; struct lpc_uart_softc *sc = arg; - if (bytes != 1) - return (-1); - offset = port - sc->iobase; - if (in) - *eax = uart_read(sc->uart_softc, offset); - else - uart_write(sc->uart_softc, offset, *eax); + switch (bytes) { + case 1: + if (in) + *eax = uart_read(sc->uart_softc, offset); + else + uart_write(sc->uart_softc, offset, *eax); + break; + case 2: + if (in) { + *eax = uart_read(sc->uart_softc, offset); + *eax |= uart_read(sc->uart_softc, offset + 1) << 8; + } else { + uart_write(sc->uart_softc, offset, *eax); + uart_write(sc->uart_softc, offset + 1, *eax >> 8); + } + break; + default: + return (-1); + } return (0); } Modified: stable/10/usr.sbin/bhyve/uart_emul.c ============================================================================== --- stable/10/usr.sbin/bhyve/uart_emul.c Sat Jul 19 22:06:46 2014 (r268891) +++ stable/10/usr.sbin/bhyve/uart_emul.c Sat Jul 19 22:13:12 2014 (r268892) @@ -110,6 +110,7 @@ struct uart_softc { uint8_t dlh; /* Baudrate divisor latch MSB */ struct fifo rxfifo; + struct mevent *mev; struct ttyfd tty; bool thre_int_pending; /* THRE interrupt pending */ @@ -145,34 +146,15 @@ ttyopen(struct ttyfd *tf) } } -static bool -tty_char_available(struct ttyfd *tf) -{ - fd_set rfds; - struct timeval tv; - - FD_ZERO(&rfds); - FD_SET(tf->fd, &rfds); - tv.tv_sec = 0; - tv.tv_usec = 0; - if (select(tf->fd + 1, &rfds, NULL, NULL, &tv) > 0 ) { - return (true); - } else { - return (false); - } -} - static int ttyread(struct ttyfd *tf) { - char rb; + unsigned char rb; - if (tty_char_available(tf)) { - read(tf->fd, &rb, 1); - return (rb & 0xff); - } else { + if (read(tf->fd, &rb, 1) == 1) + return (rb); + else return (-1); - } } static void @@ -183,62 +165,111 @@ ttywrite(struct ttyfd *tf, unsigned char } static void -fifo_reset(struct fifo *fifo, int size) +rxfifo_reset(struct uart_softc *sc, int size) { + char flushbuf[32]; + struct fifo *fifo; + ssize_t nread; + int error; + fifo = &sc->rxfifo; bzero(fifo, sizeof(struct fifo)); fifo->size = size; + + if (sc->tty.opened) { + /* + * Flush any unread input from the tty buffer. + */ + while (1) { + nread = read(sc->tty.fd, flushbuf, sizeof(flushbuf)); + if (nread != sizeof(flushbuf)) + break; + } + + /* + * Enable mevent to trigger when new characters are available + * on the tty fd. + */ + error = mevent_enable(sc->mev); + assert(error == 0); + } +} + +static int +rxfifo_available(struct uart_softc *sc) +{ + struct fifo *fifo; + + fifo = &sc->rxfifo; + return (fifo->num < fifo->size); } static int -fifo_putchar(struct fifo *fifo, uint8_t ch) +rxfifo_putchar(struct uart_softc *sc, uint8_t ch) { + struct fifo *fifo; + int error; + + fifo = &sc->rxfifo; if (fifo->num < fifo->size) { fifo->buf[fifo->windex] = ch; fifo->windex = (fifo->windex + 1) % fifo->size; fifo->num++; + if (!rxfifo_available(sc)) { + if (sc->tty.opened) { + /* + * Disable mevent callback if the FIFO is full. + */ + error = mevent_disable(sc->mev); + assert(error == 0); + } + } return (0); } else return (-1); } static int -fifo_getchar(struct fifo *fifo) +rxfifo_getchar(struct uart_softc *sc) { - int c; + struct fifo *fifo; + int c, error, wasfull; + wasfull = 0; + fifo = &sc->rxfifo; if (fifo->num > 0) { + if (!rxfifo_available(sc)) + wasfull = 1; c = fifo->buf[fifo->rindex]; fifo->rindex = (fifo->rindex + 1) % fifo->size; fifo->num--; + if (wasfull) { + if (sc->tty.opened) { + error = mevent_enable(sc->mev); + assert(error == 0); + } + } return (c); } else return (-1); } static int -fifo_numchars(struct fifo *fifo) +rxfifo_numchars(struct uart_softc *sc) { + struct fifo *fifo = &sc->rxfifo; return (fifo->num); } -static int -fifo_available(struct fifo *fifo) -{ - - return (fifo->num < fifo->size); -} - static void uart_opentty(struct uart_softc *sc) { - struct mevent *mev; ttyopen(&sc->tty); - mev = mevent_add(sc->tty.fd, EVF_READ, uart_drain, sc); - assert(mev); + sc->mev = mevent_add(sc->tty.fd, EVF_READ, uart_drain, sc); + assert(sc->mev != NULL); } /* @@ -255,7 +286,7 @@ uart_intr_reason(struct uart_softc *sc) if ((sc->lsr & LSR_OE) != 0 && (sc->ier & IER_ERLS) != 0) return (IIR_RLS); - else if (fifo_numchars(&sc->rxfifo) > 0 && (sc->ier & IER_ERXRDY) != 0) + else if (rxfifo_numchars(sc) > 0 && (sc->ier & IER_ERXRDY) != 0) return (IIR_RXTOUT); else if (sc->thre_int_pending && (sc->ier & IER_ETXRDY) != 0) return (IIR_TXRDY); @@ -274,7 +305,7 @@ uart_reset(struct uart_softc *sc) sc->dll = divisor; sc->dlh = divisor >> 16; - fifo_reset(&sc->rxfifo, 1); /* no fifo until enabled by software */ + rxfifo_reset(sc, 1); /* no fifo until enabled by software */ } /* @@ -315,9 +346,9 @@ uart_drain(int fd, enum ev_type ev, void if ((sc->mcr & MCR_LOOPBACK) != 0) { (void) ttyread(&sc->tty); } else { - while (fifo_available(&sc->rxfifo) && + while (rxfifo_available(sc) && ((ch = ttyread(&sc->tty)) != -1)) { - fifo_putchar(&sc->rxfifo, ch); + rxfifo_putchar(sc, ch); } uart_toggle_intr(sc); } @@ -351,7 +382,7 @@ uart_write(struct uart_softc *sc, int of switch (offset) { case REG_DATA: if (sc->mcr & MCR_LOOPBACK) { - if (fifo_putchar(&sc->rxfifo, value) != 0) + if (rxfifo_putchar(sc, value) != 0) sc->lsr |= LSR_OE; } else if (sc->tty.opened) { ttywrite(&sc->tty, value); @@ -372,7 +403,7 @@ uart_write(struct uart_softc *sc, int of */ if ((sc->fcr & FCR_ENABLE) ^ (value & FCR_ENABLE)) { fifosz = (value & FCR_ENABLE) ? FIFOSZ : 1; - fifo_reset(&sc->rxfifo, fifosz); + rxfifo_reset(sc, fifosz); } /* @@ -383,7 +414,7 @@ uart_write(struct uart_softc *sc, int of sc->fcr = 0; } else { if ((value & FCR_RCV_RST) != 0) - fifo_reset(&sc->rxfifo, FIFOSZ); + rxfifo_reset(sc, FIFOSZ); sc->fcr = value & (FCR_ENABLE | FCR_DMA | FCR_RX_MASK); @@ -480,7 +511,7 @@ uart_read(struct uart_softc *sc, int off switch (offset) { case REG_DATA: - reg = fifo_getchar(&sc->rxfifo); + reg = rxfifo_getchar(sc); break; case REG_IER: reg = sc->ier; @@ -511,7 +542,7 @@ uart_read(struct uart_softc *sc, int off sc->lsr |= LSR_TEMT | LSR_THRE; /* Check for new receive data */ - if (fifo_numchars(&sc->rxfifo) > 0) + if (rxfifo_numchars(sc) > 0) sc->lsr |= LSR_RXRDY; else sc->lsr &= ~LSR_RXRDY; @@ -585,7 +616,7 @@ uart_tty_backend(struct uart_softc *sc, retval = -1; - fd = open(opts, O_RDWR); + fd = open(opts, O_RDWR | O_NONBLOCK); if (fd > 0 && isatty(fd)) { sc->tty.fd = fd; sc->tty.opened = true; @@ -616,6 +647,10 @@ uart_set_backend(struct uart_softc *sc, retval = 0; } + /* Make the backend file descriptor non-blocking */ + if (retval == 0) + retval = fcntl(sc->tty.fd, F_SETFL, O_NONBLOCK); + if (retval == 0) uart_opentty(sc); From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 22:13:29 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2EAD3337; Sat, 19 Jul 2014 22:13: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 1A9A223E8; Sat, 19 Jul 2014 22:13:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6JMDSqK010195; Sat, 19 Jul 2014 22:13:28 GMT (envelope-from ian@svn.freebsd.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6JMDSPu010186; Sat, 19 Jul 2014 22:13:28 GMT (envelope-from ian@svn.freebsd.org) Message-Id: <201407192213.s6JMDSPu010186@svn.freebsd.org> From: Ian Lepore Date: Sat, 19 Jul 2014 22:13:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268893 - in head: lib/libc/arm lib/libc/arm/aeabi sys/arm/include sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 22:13:29 -0000 Author: ian Date: Sat Jul 19 22:13:27 2014 New Revision: 268893 URL: http://svnweb.freebsd.org/changeset/base/268893 Log: Add dl_unwind_find_exidx() for ARM EABI, required for C++ exception handling. For statically linked apps this uses the __exidx_start/end symbols set up by the linker. For dynamically linked apps it finds the shared object that contains the given address and returns the location and size of the exidx section in that shared object. The dl_unwind_find_exidx() name is used by other BSD projects and Android, and is mentioned in clang 3.5 comments as "the BSD interface" for finding exidx data. GCC (in libgcc_s) expects the exact same API and functionality to be provided by a function named __gnu_Unwind_Find_exidx(), so we provide that with an alias ("strong reference"). Reviewed by: kib@ MFC after: 1 week Added: head/lib/libc/arm/aeabi/aeabi_unwind_exidx.c (contents, props changed) Modified: head/lib/libc/arm/Symbol.map head/lib/libc/arm/aeabi/Makefile.inc head/sys/arm/include/elf.h head/sys/sys/link_elf.h Modified: head/lib/libc/arm/Symbol.map ============================================================================== --- head/lib/libc/arm/Symbol.map Sat Jul 19 22:13:12 2014 (r268892) +++ head/lib/libc/arm/Symbol.map Sat Jul 19 22:13:27 2014 (r268893) @@ -37,6 +37,11 @@ FBSD_1.3 { __flt_rounds; }; +FBSD_1.4 { + __gnu_Unwind_Find_exidx; + dl_unwind_find_exidx; +}; + FBSDprivate_1.0 { /* PSEUDO syscalls */ __sys_getlogin; Modified: head/lib/libc/arm/aeabi/Makefile.inc ============================================================================== --- head/lib/libc/arm/aeabi/Makefile.inc Sat Jul 19 22:13:12 2014 (r268892) +++ head/lib/libc/arm/aeabi/Makefile.inc Sat Jul 19 22:13:27 2014 (r268893) @@ -3,7 +3,8 @@ .PATH: ${LIBC_SRCTOP}/arm/aeabi SRCS+= aeabi_atexit.c \ - aeabi_unwind_cpp.c + aeabi_unwind_cpp.c \ + aeabi_unwind_exidx.c .if ${MACHINE_ARCH} != "armv6hf" SRCS+= aeabi_double.c \ aeabi_float.c Added: head/lib/libc/arm/aeabi/aeabi_unwind_exidx.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/arm/aeabi/aeabi_unwind_exidx.c Sat Jul 19 22:13:27 2014 (r268893) @@ -0,0 +1,104 @@ +/*- + * Copyright (c) 2014 Ian Lepore + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +/* + * ARM EABI unwind helper. + * + * This finds the exidx section address and size associated with a given code + * address. There are separate implementations for static and dynamic code. + * + * GCC expects this function to exist as __gnu_Unwind_Find_exidx(), clang and + * BSD tools expect it to be dl_unwind_find_exidx(). Both have the same API, so + * we set up an alias for GCC. + */ +__strong_reference(dl_unwind_find_exidx, __gnu_Unwind_Find_exidx); + +/* + * Each entry in the exidx section is a pair of 32-bit words. We don't + * interpret the contents of the entries here; this typedef is just a local + * convenience for using sizeof() and doing pointer math. + */ +typedef struct exidx_entry { + uint32_t data[2]; +} exidx_entry; + +#ifdef __PIC__ + +/* + * Unwind helper for dynamically linked code. + * + * This finds the shared object that contains the given address, and returns the + * address of the exidx section in that shared object along with the number of + * entries in that section, or NULL if it wasn't found. + */ +void * +dl_unwind_find_exidx(const void *pc, int *pcount) +{ + const Elf_Phdr *hdr; + struct dl_phdr_info info; + int i; + + if (_rtld_addr_phdr(pc, &info)) { + hdr = info.dlpi_phdr; + for (i = 0; i < info.dlpi_phnum; i++, hdr++) { + if (hdr->p_type == PT_ARM_EXIDX) { + *pcount = hdr->p_memsz / sizeof(exidx_entry); + return ((void *)(info.dlpi_addr + hdr->p_vaddr)); + } + } + } + return (NULL); +} + +#else /* !__PIC__ */ + +/* + * Unwind helper for statically linked code. + * + * In a statically linked program, the linker populates a pair of symbols with + * the addresses of the start and end of the exidx table, so returning the + * address and count of elements is pretty straighforward. + */ +void * +dl_unwind_find_exidx(const void *pc, int *pcount) +{ + extern struct exidx_entry __exidx_start; + extern struct exidx_entry __exidx_end; + + *pcount = (int)(&__exidx_end - &__exidx_start); + return (&__exidx_start); +} + +#endif /* __PIC__ */ + Modified: head/sys/arm/include/elf.h ============================================================================== --- head/sys/arm/include/elf.h Sat Jul 19 22:13:12 2014 (r268892) +++ head/sys/arm/include/elf.h Sat Jul 19 22:13:27 2014 (r268893) @@ -55,6 +55,9 @@ __ElfType(Auxinfo); #define ELF_MACHINE_OK(x) ((x) == EM_ARM) +/* Unwind info section type */ +#define PT_ARM_EXIDX (PT_LOPROC + 1) + /* * Relocation types. */ Modified: head/sys/sys/link_elf.h ============================================================================== --- head/sys/sys/link_elf.h Sat Jul 19 22:13:12 2014 (r268892) +++ head/sys/sys/link_elf.h Sat Jul 19 22:13:27 2014 (r268893) @@ -95,6 +95,10 @@ extern int dl_iterate_phdr(__dl_iterate_ int _rtld_addr_phdr(const void *, struct dl_phdr_info *); int _rtld_get_stack_prot(void); +#ifdef __ARM_EABI__ +void * dl_unwind_find_exidx(const void *, int *); +#endif + __END_DECLS #endif /* _SYS_LINK_ELF_H_ */ From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 22:19:44 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D7D94F3; Sat, 19 Jul 2014 22:19:44 +0000 (UTC) Received: from mail-qc0-x22d.google.com (mail-qc0-x22d.google.com [IPv6:2607:f8b0:400d:c01::22d]) (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 BED59240E; Sat, 19 Jul 2014 22:19:43 +0000 (UTC) Received: by mail-qc0-f173.google.com with SMTP id c9so4440814qcz.4 for ; Sat, 19 Jul 2014 15:19:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=GbbGu9kL+Zrp2s5plO/PEgkUJqnabTN0GoxhaJXxtQc=; b=aZVU1tgVGFXNL4PNq6b5RXQ5lFdJb3KqMRYFREWC4p3XCy83DclY/Xcq0WSTmUxgM5 fPc29169ZX7+bNENXbciqy9CrFVvO76RlsLbGO4lNbgBGuD8uugu627ZArTwOOrOY7zA ModQ/3gp8IU9YpRp+9MdJr4W695Q92XRwwAwJAr4nsuv4E1eUB2rOJpmGPPzg7FKYqCT ymNkOZypYbiewEKwihiw3qAtQXwTBUFNh0q26ijZTnvapIYI9tbXCSA4NG3vvXf3Fagc P5wjk4jLJ/o89mku9mZKlSblcNNdx+CvgSLSUhTvATOApWN4ZlBWBnhPVxspTLG/2NTf JWNQ== MIME-Version: 1.0 X-Received: by 10.224.71.198 with SMTP id i6mr24710406qaj.76.1405808382764; Sat, 19 Jul 2014 15:19:42 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.1.6 with HTTP; Sat, 19 Jul 2014 15:19:42 -0700 (PDT) In-Reply-To: <1405805007.85788.24.camel@revolution.hippie.lan> References: <201407191426.s6JEQ4en083862@svn.freebsd.org> <1405805007.85788.24.camel@revolution.hippie.lan> Date: Sat, 19 Jul 2014 15:19:42 -0700 X-Google-Sender-Auth: CrQhTJLnZ2BqAGeVsGsfncRLnrY Message-ID: Subject: Re: svn commit: r268877 - head/share/mk From: Adrian Chadd To: Ian Lepore Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 22:19:44 -0000 On 19 July 2014 14:23, Ian Lepore wrote: > On Sat, 2014-07-19 at 14:26 +0000, Dag-Erling Sm=C3=B8rgrav wrote: >> Author: des >> Date: Sat Jul 19 14:26:04 2014 >> New Revision: 268877 >> URL: http://svnweb.freebsd.org/changeset/base/268877 >> >> Log: >> Use -o (output to file) instead of -t (print to stdout) and a redirect= . >> >> MFC after: 1 week >> >> Modified: >> head/share/mk/bsd.dep.mk >> >> Modified: head/share/mk/bsd.dep.mk >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/share/mk/bsd.dep.mk Sat Jul 19 14:10:31 2014 (r268876) >> +++ head/share/mk/bsd.dep.mk Sat Jul 19 14:26:04 2014 (r268877) >> @@ -82,7 +82,7 @@ ${_S:R}.o: ${_S} >> .for _LSRC in ${SRCS:M*.l:N*/*} >> .for _LC in ${_LSRC:R}.c >> ${_LC}: ${_LSRC} >> - ${LEX} -t ${LFLAGS} ${.ALLSRC} > ${.TARGET} >> + ${LEX} ${LFLAGS} -o ${.TARGET} ${.ALLSRC} >> .if !exists(${.OBJDIR}/${DEPENDFILE}) >> ${_LC:R}.o: ${_LC} >> .endif >> > > This change breaks the ability to bootstrap from versions prior to 10.0 > because the older lex requires "-ofilename" rather than "-o filename". > Even more annoying, it's not possible to fix it by building the new lex > earlier in bootstrap because the new lex requires a newer m4 be built > first, and building the new m4 requires running this rule which doesn't > work with the old lex. Grrrr. > > It seems like the path of least resistance would be to remove the space > between -o and ${TARGET}, which I'll leave for you if you agree, so that > you can MFC them together when the time comes. Hm, why not build lex as a bootstrap tool then, or is this too early in the process? -a From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 22:24:30 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DB56B706; Sat, 19 Jul 2014 22:24: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 BD60D24A9; Sat, 19 Jul 2014 22:24:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6JMOUa5015086; Sat, 19 Jul 2014 22:24:30 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6JMOTYB015081; Sat, 19 Jul 2014 22:24:29 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201407192224.s6JMOTYB015081@svn.freebsd.org> From: John Baldwin Date: Sat, 19 Jul 2014 22:24:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268894 - stable/10/usr.sbin/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 22:24:31 -0000 Author: jhb Date: Sat Jul 19 22:24:29 2014 New Revision: 268894 URL: http://svnweb.freebsd.org/changeset/base/268894 Log: MFC 263432,265366,265376: Fixes for vcpu management in bhyve: - Use 'cpuset_t' to represent the vcpus active in a virtual machine. - Modify the "-p" option to be more flexible when associating a 'vcpu' with a 'hostcpu'. Modified: stable/10/usr.sbin/bhyve/bhyve.8 stable/10/usr.sbin/bhyve/bhyverun.c stable/10/usr.sbin/bhyve/bhyverun.h stable/10/usr.sbin/bhyve/spinup_ap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/bhyve.8 ============================================================================== --- stable/10/usr.sbin/bhyve/bhyve.8 Sat Jul 19 22:13:27 2014 (r268893) +++ stable/10/usr.sbin/bhyve/bhyve.8 Sat Jul 19 22:24:29 2014 (r268894) @@ -35,7 +35,7 @@ .Op Fl aehwxAHPW .Op Fl c Ar numcpus .Op Fl g Ar gdbport -.Op Fl p Ar pinnedcpu +.Op Fl p Ar vcpu:hostcpu .Op Fl s Ar slot,emulation Ns Op , Ns Ar conf .Op Fl l Ar lpcdev Ns Op , Ns Ar conf .Ar vmname @@ -79,12 +79,11 @@ For allow a remote kernel kgdb to be relayed to the guest kernel gdb stub via a local IPv4 address and this port. This option will be deprecated in a future version. -.It Fl p Ar pinnedcpu -Force guest virtual CPUs to be pinned to host CPUs. -Virtual CPU -.Em n -is pinned to host CPU -.Em pinnedcpu+n . +.It Fl p Ar vcpu:hostcpu +Pin guest's virtual CPU +.Em vcpu +to +.Em hostcpu . .It Fl P Force the guest virtual CPU to exit when a PAUSE instruction is detected. .It Fl W Modified: stable/10/usr.sbin/bhyve/bhyverun.c ============================================================================== --- stable/10/usr.sbin/bhyve/bhyverun.c Sat Jul 19 22:13:27 2014 (r268893) +++ stable/10/usr.sbin/bhyve/bhyverun.c Sat Jul 19 22:24:29 2014 (r268894) @@ -85,7 +85,6 @@ char *vmname; int guest_ncpus; char *guest_uuid_str; -static int pincpu = -1; static int guest_vmexit_on_hlt, guest_vmexit_on_pause; static int virtio_msix = 1; static int x2apic_mode = 0; /* default is xAPIC */ @@ -98,7 +97,7 @@ static int acpi; static char *progname; static const int BSP = 0; -static int cpumask; +static cpuset_t cpumask; static void vm_loop(struct vmctx *ctx, int vcpu, uint64_t rip); @@ -122,18 +121,20 @@ struct mt_vmm_info { int mt_vcpu; } mt_vmm_info[VM_MAXCPU]; +static cpuset_t *vcpumap[VM_MAXCPU] = { NULL }; + static void usage(int code) { fprintf(stderr, - "Usage: %s [-aehwAHIPW] [-g ] [-s ]\n" - " %*s [-c vcpus] [-p pincpu] [-m mem] [-l ] \n" + "Usage: %s [-aehwAHIPW] [-g ] [-s ] [-c vcpus]\n" + " %*s [-p vcpu:hostcpu] [-m mem] [-l ] \n" " -a: local apic is in xAPIC mode (deprecated)\n" " -A: create an ACPI table\n" " -g: gdb port\n" " -c: # cpus (default 1)\n" - " -p: pin vcpu 'n' to host cpu 'pincpu + n'\n" + " -p: pin 'vcpu' to 'hostcpu'\n" " -H: vmexit from the guest on hlt\n" " -P: vmexit from the guest on pause\n" " -W: force virtio to use single-vector MSI\n" @@ -151,6 +152,39 @@ usage(int code) exit(code); } +static int +pincpu_parse(const char *opt) +{ + int vcpu, pcpu; + + if (sscanf(opt, "%d:%d", &vcpu, &pcpu) != 2) { + fprintf(stderr, "invalid format: %s\n", opt); + return (-1); + } + + if (vcpu < 0 || vcpu >= VM_MAXCPU) { + fprintf(stderr, "vcpu '%d' outside valid range from 0 to %d\n", + vcpu, VM_MAXCPU - 1); + return (-1); + } + + if (pcpu < 0 || pcpu >= CPU_SETSIZE) { + fprintf(stderr, "hostcpu '%d' outside valid range from " + "0 to %d\n", pcpu, CPU_SETSIZE - 1); + return (-1); + } + + if (vcpumap[vcpu] == NULL) { + if ((vcpumap[vcpu] = malloc(sizeof(cpuset_t))) == NULL) { + perror("malloc"); + return (-1); + } + CPU_ZERO(vcpumap[vcpu]); + } + CPU_SET(pcpu, vcpumap[vcpu]); + return (0); +} + void * paddr_guest2host(struct vmctx *ctx, uintptr_t gaddr, size_t len) { @@ -200,30 +234,26 @@ fbsdrun_start_thread(void *param) } void -fbsdrun_addcpu(struct vmctx *ctx, int vcpu, uint64_t rip) +fbsdrun_addcpu(struct vmctx *ctx, int fromcpu, int newcpu, uint64_t rip) { int error; - if (cpumask & (1 << vcpu)) { - fprintf(stderr, "addcpu: attempting to add existing cpu %d\n", - vcpu); - exit(1); - } + assert(fromcpu == BSP); - atomic_set_int(&cpumask, 1 << vcpu); + CPU_SET_ATOMIC(newcpu, &cpumask); /* * Set up the vmexit struct to allow execution to start * at the given RIP */ - vmexit[vcpu].rip = rip; - vmexit[vcpu].inst_length = 0; + vmexit[newcpu].rip = rip; + vmexit[newcpu].inst_length = 0; - mt_vmm_info[vcpu].mt_ctx = ctx; - mt_vmm_info[vcpu].mt_vcpu = vcpu; + mt_vmm_info[newcpu].mt_ctx = ctx; + mt_vmm_info[newcpu].mt_vcpu = newcpu; - error = pthread_create(&mt_vmm_info[vcpu].mt_thr, NULL, - fbsdrun_start_thread, &mt_vmm_info[vcpu]); + error = pthread_create(&mt_vmm_info[newcpu].mt_thr, NULL, + fbsdrun_start_thread, &mt_vmm_info[newcpu]); assert(error == 0); } @@ -231,14 +261,13 @@ static int fbsdrun_deletecpu(struct vmctx *ctx, int vcpu) { - if ((cpumask & (1 << vcpu)) == 0) { - fprintf(stderr, "addcpu: attempting to delete unknown cpu %d\n", - vcpu); + if (!CPU_ISSET(vcpu, &cpumask)) { + fprintf(stderr, "Attempting to delete unknown cpu %d\n", vcpu); exit(1); } - atomic_clear_int(&cpumask, 1 << vcpu); - return (cpumask == 0); + CPU_CLR_ATOMIC(vcpu, &cpumask); + return (CPU_EMPTY(&cpumask)); } static int @@ -483,15 +512,12 @@ static vmexit_handler_t handler[VM_EXITC static void vm_loop(struct vmctx *ctx, int vcpu, uint64_t rip) { - cpuset_t mask; int error, rc, prevcpu; enum vm_exitcode exitcode; - if (pincpu >= 0) { - CPU_ZERO(&mask); - CPU_SET(pincpu + vcpu, &mask); + if (vcpumap[vcpu] != NULL) { error = pthread_setaffinity_np(pthread_self(), - sizeof(mask), &mask); + sizeof(cpuset_t), vcpumap[vcpu]); assert(error == 0); } @@ -616,7 +642,10 @@ main(int argc, char *argv[]) bvmcons = 1; break; case 'p': - pincpu = atoi(optarg); + if (pincpu_parse(optarg) != 0) { + errx(EX_USAGE, "invalid vcpu pinning " + "configuration '%s'", optarg); + } break; case 'c': guest_ncpus = atoi(optarg); @@ -754,7 +783,7 @@ main(int argc, char *argv[]) /* * Add CPU 0 */ - fbsdrun_addcpu(ctx, BSP, rip); + fbsdrun_addcpu(ctx, BSP, BSP, rip); /* * Head off to the main event dispatch loop Modified: stable/10/usr.sbin/bhyve/bhyverun.h ============================================================================== --- stable/10/usr.sbin/bhyve/bhyverun.h Sat Jul 19 22:13:27 2014 (r268893) +++ stable/10/usr.sbin/bhyve/bhyverun.h Sat Jul 19 22:24:29 2014 (r268894) @@ -43,7 +43,7 @@ extern char *vmname; void *paddr_guest2host(struct vmctx *ctx, uintptr_t addr, size_t len); void fbsdrun_set_capabilities(struct vmctx *ctx, int cpu); -void fbsdrun_addcpu(struct vmctx *ctx, int cpu, uint64_t rip); +void fbsdrun_addcpu(struct vmctx *ctx, int fromcpu, int newcpu, uint64_t rip); int fbsdrun_muxed(void); int fbsdrun_vmexit_on_hlt(void); int fbsdrun_vmexit_on_pause(void); Modified: stable/10/usr.sbin/bhyve/spinup_ap.c ============================================================================== --- stable/10/usr.sbin/bhyve/spinup_ap.c Sat Jul 19 22:13:27 2014 (r268893) +++ stable/10/usr.sbin/bhyve/spinup_ap.c Sat Jul 19 22:24:29 2014 (r268894) @@ -98,7 +98,7 @@ spinup_ap(struct vmctx *ctx, int vcpu, i spinup_ap_realmode(ctx, newcpu, &rip); - fbsdrun_addcpu(ctx, newcpu, rip); + fbsdrun_addcpu(ctx, vcpu, newcpu, rip); return (newcpu); } From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 22:45:05 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A3C17BCE; Sat, 19 Jul 2014 22:45:05 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (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 719ED2623; Sat, 19 Jul 2014 22:45:04 +0000 (UTC) Received: from c-50-155-136-3.hsd1.co.comcast.net ([50.155.136.3] helo=ilsoft.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1X8dNH-000CwW-PG; Sat, 19 Jul 2014 22:45:04 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id s6JMj2HN028128; Sat, 19 Jul 2014 16:45:02 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 50.155.136.3 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX19CwDxQjQAM2iNnmqUhTQSZ X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: svn commit: r268877 - head/share/mk From: Ian Lepore To: Adrian Chadd In-Reply-To: References: <201407191426.s6JEQ4en083862@svn.freebsd.org> <1405805007.85788.24.camel@revolution.hippie.lan> Content-Type: text/plain; charset="ISO-8859-1" Date: Sat, 19 Jul 2014 16:45:02 -0600 Message-ID: <1405809902.85788.39.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by ilsoft.org id s6JMj2HN028128 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Dag-Erling =?ISO-8859-1?Q?Sm=F8rgrav?= X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 22:45:05 -0000 On Sat, 2014-07-19 at 15:19 -0700, Adrian Chadd wrote: > On 19 July 2014 14:23, Ian Lepore wrote: > > On Sat, 2014-07-19 at 14:26 +0000, Dag-Erling Sm=F8rgrav wrote: > >> Author: des > >> Date: Sat Jul 19 14:26:04 2014 > >> New Revision: 268877 > >> URL: http://svnweb.freebsd.org/changeset/base/268877 > >> > >> Log: > >> Use -o (output to file) instead of -t (print to stdout) and a redi= rect. > >> > >> MFC after: 1 week > >> > >> Modified: > >> head/share/mk/bsd.dep.mk > >> > >> Modified: head/share/mk/bsd.dep.mk > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > >> --- head/share/mk/bsd.dep.mk Sat Jul 19 14:10:31 2014 (r2688= 76) > >> +++ head/share/mk/bsd.dep.mk Sat Jul 19 14:26:04 2014 (r2688= 77) > >> @@ -82,7 +82,7 @@ ${_S:R}.o: ${_S} > >> .for _LSRC in ${SRCS:M*.l:N*/*} > >> .for _LC in ${_LSRC:R}.c > >> ${_LC}: ${_LSRC} > >> - ${LEX} -t ${LFLAGS} ${.ALLSRC} > ${.TARGET} > >> + ${LEX} ${LFLAGS} -o ${.TARGET} ${.ALLSRC} > >> .if !exists(${.OBJDIR}/${DEPENDFILE}) > >> ${_LC:R}.o: ${_LC} > >> .endif > >> > > > > This change breaks the ability to bootstrap from versions prior to 10= .0 > > because the older lex requires "-ofilename" rather than "-o filename". > > Even more annoying, it's not possible to fix it by building the new l= ex > > earlier in bootstrap because the new lex requires a newer m4 be built > > first, and building the new m4 requires running this rule which doesn= 't > > work with the old lex. Grrrr. > > > > It seems like the path of least resistance would be to remove the spa= ce > > between -o and ${TARGET}, which I'll leave for you if you agree, so t= hat > > you can MFC them together when the time comes. >=20 > Hm, why not build lex as a bootstrap tool then, or is this too early > in the process? >=20 >=20 > -a >=20 >=20 Lex is a bootstrap tool and so is m4 and they're interdependant: Lex invokes m4 and pipes data through it, and it does so using command args that don't exist in old versions of m4, so the new m4 has to exist before the new lex will work. But building m4 requires lex, so it has to be possible to build m4 with the old lex before you can use the new lex. -- Ian From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 23:39:17 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D8D116E3; Sat, 19 Jul 2014 23:39:17 +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 C60642983; Sat, 19 Jul 2014 23:39:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6JNdHjg048795; Sat, 19 Jul 2014 23:39:17 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6JNdHHw048794; Sat, 19 Jul 2014 23:39:17 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201407192339.s6JNdHHw048794@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 19 Jul 2014 23:39:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r268895 - head/sys/powerpc/ps3 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 23:39:17 -0000 Author: nwhitehorn Date: Sat Jul 19 23:39:17 2014 New Revision: 268895 URL: http://svnweb.freebsd.org/changeset/base/268895 Log: Enable X11 via xf86-video-scfb on the Playstation 3. This commit made from an xterm running for the first time on said Playstation. Modified: head/sys/powerpc/ps3/ps3_syscons.c Modified: head/sys/powerpc/ps3/ps3_syscons.c ============================================================================== --- head/sys/powerpc/ps3/ps3_syscons.c Sat Jul 19 22:24:29 2014 (r268894) +++ head/sys/powerpc/ps3/ps3_syscons.c Sat Jul 19 23:39:17 2014 (r268895) @@ -78,6 +78,8 @@ static struct vt_driver vt_ps3fb_driver .vd_blank = vt_fb_blank, .vd_bitbltchr = vt_fb_bitbltchr, .vd_maskbitbltchr = vt_fb_maskbitbltchr, + .vd_fb_ioctl = vt_fb_ioctl, + .vd_fb_mmap = vt_fb_mmap, /* Better than VGA, but still generic driver. */ .vd_priority = VD_PRIORITY_GENERIC + 1, }; @@ -187,6 +189,7 @@ ps3fb_init(struct vt_device *vd) L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP, 1, 0, 0, 0); fb_probe(&sc->fb_info); + sc->fb_info.fb_flags &= ~FB_FLAG_NOMMAP; /* Set wrongly by fb_probe */ vt_fb_init(vd); /* Clear the screen. */ From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 23:45:00 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 371428A5; Sat, 19 Jul 2014 23:45:00 +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 1F61F2A21; Sat, 19 Jul 2014 23:45:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6JNj0vt052832; Sat, 19 Jul 2014 23:45:00 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6JNiwhg052804; Sat, 19 Jul 2014 23:44:58 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201407192344.s6JNiwhg052804@svn.freebsd.org> From: Baptiste Daroussin Date: Sat, 19 Jul 2014 23:44:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268896 - in stable/10: contrib/libucl contrib/libucl/cmake contrib/libucl/doc contrib/libucl/include contrib/libucl/src contrib/libucl/tests contrib/libucl/tests/basic contrib/libucl/t... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 23:45:00 -0000 Author: bapt Date: Sat Jul 19 23:44:57 2014 New Revision: 268896 URL: http://svnweb.freebsd.org/changeset/base/268896 Log: MFC: r263648, r264789, r266636 This brings: - schema validation - xpath-like interface for ucl objects Adapt pkg(7) to the new libucl API Added: stable/10/contrib/libucl/Makefile.am (contents, props changed) stable/10/contrib/libucl/autogen.sh (contents, props changed) stable/10/contrib/libucl/cmake/ stable/10/contrib/libucl/cmake/CMakeLists.txt (contents, props changed) stable/10/contrib/libucl/configure.ac stable/10/contrib/libucl/doc/Makefile.am (contents, props changed) stable/10/contrib/libucl/doc/libucl.3 (contents, props changed) stable/10/contrib/libucl/doc/pandoc.template stable/10/contrib/libucl/libucl.pc.in (contents, props changed) stable/10/contrib/libucl/src/Makefile.am (contents, props changed) stable/10/contrib/libucl/src/tree.h (contents, props changed) stable/10/contrib/libucl/src/ucl_schema.c (contents, props changed) stable/10/contrib/libucl/stamp-h.in (contents, props changed) stable/10/contrib/libucl/tests/.gitignore stable/10/contrib/libucl/tests/Makefile.am (contents, props changed) stable/10/contrib/libucl/tests/basic/ stable/10/contrib/libucl/tests/basic.test (contents, props changed) stable/10/contrib/libucl/tests/basic/1.in (contents, props changed) stable/10/contrib/libucl/tests/basic/1.res stable/10/contrib/libucl/tests/basic/10.in (contents, props changed) stable/10/contrib/libucl/tests/basic/2.in (contents, props changed) stable/10/contrib/libucl/tests/basic/2.res stable/10/contrib/libucl/tests/basic/3.in (contents, props changed) stable/10/contrib/libucl/tests/basic/3.res stable/10/contrib/libucl/tests/basic/4.in (contents, props changed) stable/10/contrib/libucl/tests/basic/4.res stable/10/contrib/libucl/tests/basic/6.in (contents, props changed) stable/10/contrib/libucl/tests/basic/6.res stable/10/contrib/libucl/tests/basic/8.in (contents, props changed) stable/10/contrib/libucl/tests/basic/8.res stable/10/contrib/libucl/tests/basic/9-comment.inc stable/10/contrib/libucl/tests/basic/9-empty.inc stable/10/contrib/libucl/tests/basic/9.in (contents, props changed) stable/10/contrib/libucl/tests/basic/9.inc stable/10/contrib/libucl/tests/basic/9.res stable/10/contrib/libucl/tests/generate.test (contents, props changed) stable/10/contrib/libucl/tests/schema/ stable/10/contrib/libucl/tests/schema.test (contents, props changed) stable/10/contrib/libucl/tests/schema/additionalItems.json stable/10/contrib/libucl/tests/schema/additionalProperties.json stable/10/contrib/libucl/tests/schema/allOf.json stable/10/contrib/libucl/tests/schema/anyOf.json stable/10/contrib/libucl/tests/schema/definitions.json stable/10/contrib/libucl/tests/schema/dependencies.json stable/10/contrib/libucl/tests/schema/enum.json stable/10/contrib/libucl/tests/schema/items.json stable/10/contrib/libucl/tests/schema/maxItems.json stable/10/contrib/libucl/tests/schema/maxLength.json stable/10/contrib/libucl/tests/schema/maxProperties.json stable/10/contrib/libucl/tests/schema/maximum.json stable/10/contrib/libucl/tests/schema/minItems.json stable/10/contrib/libucl/tests/schema/minLength.json stable/10/contrib/libucl/tests/schema/minProperties.json stable/10/contrib/libucl/tests/schema/minimum.json stable/10/contrib/libucl/tests/schema/multipleOf.json stable/10/contrib/libucl/tests/schema/not.json stable/10/contrib/libucl/tests/schema/oneOf.json stable/10/contrib/libucl/tests/schema/pattern.json stable/10/contrib/libucl/tests/schema/patternProperties.json stable/10/contrib/libucl/tests/schema/properties.json stable/10/contrib/libucl/tests/schema/ref.json stable/10/contrib/libucl/tests/schema/refRemote.json stable/10/contrib/libucl/tests/schema/required.json stable/10/contrib/libucl/tests/schema/type.json stable/10/contrib/libucl/tests/schema/uniqueItems.json stable/10/contrib/libucl/tests/speed.test (contents, props changed) stable/10/contrib/libucl/tests/test_schema.c (contents, props changed) stable/10/contrib/libucl/utils/Makefile.am (contents, props changed) Deleted: stable/10/contrib/libucl/.gitignore stable/10/contrib/libucl/tests/1.in stable/10/contrib/libucl/tests/1.res stable/10/contrib/libucl/tests/10.in stable/10/contrib/libucl/tests/2.in stable/10/contrib/libucl/tests/2.res stable/10/contrib/libucl/tests/3.in stable/10/contrib/libucl/tests/3.res stable/10/contrib/libucl/tests/4.in stable/10/contrib/libucl/tests/4.res stable/10/contrib/libucl/tests/5.in stable/10/contrib/libucl/tests/5.res stable/10/contrib/libucl/tests/6.in stable/10/contrib/libucl/tests/6.res stable/10/contrib/libucl/tests/7.in stable/10/contrib/libucl/tests/7.res stable/10/contrib/libucl/tests/8.in stable/10/contrib/libucl/tests/8.res stable/10/contrib/libucl/tests/9-comment.inc stable/10/contrib/libucl/tests/9-empty.inc stable/10/contrib/libucl/tests/9.in stable/10/contrib/libucl/tests/9.inc stable/10/contrib/libucl/tests/9.res Modified: stable/10/contrib/libucl/Makefile.unix stable/10/contrib/libucl/Makefile.w32 stable/10/contrib/libucl/README.md stable/10/contrib/libucl/doc/api.md stable/10/contrib/libucl/include/ucl.h stable/10/contrib/libucl/src/ucl_emitter.c stable/10/contrib/libucl/src/ucl_hash.c stable/10/contrib/libucl/src/ucl_hash.h stable/10/contrib/libucl/src/ucl_internal.h stable/10/contrib/libucl/src/ucl_parser.c stable/10/contrib/libucl/src/ucl_util.c stable/10/contrib/libucl/tests/run_tests.sh stable/10/contrib/libucl/tests/test_basic.c stable/10/contrib/libucl/tests/test_generate.c stable/10/contrib/libucl/tests/test_speed.c stable/10/contrib/libucl/utils/objdump.c stable/10/lib/libucl/Makefile stable/10/usr.sbin/pkg/config.c stable/10/usr.sbin/pkg/pkg.c Added: stable/10/contrib/libucl/Makefile.am ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/libucl/Makefile.am Sat Jul 19 23:44:57 2014 (r268896) @@ -0,0 +1,7 @@ +ACLOCAL_AMFLAGS = -I m4 +EXTRA_DIST = uthash README.md + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libucl.pc + +SUBDIRS = src tests utils doc \ No newline at end of file Modified: stable/10/contrib/libucl/Makefile.unix ============================================================================== --- stable/10/contrib/libucl/Makefile.unix Sat Jul 19 23:39:17 2014 (r268895) +++ stable/10/contrib/libucl/Makefile.unix Sat Jul 19 23:44:57 2014 (r268896) @@ -4,7 +4,7 @@ LD ?= gcc C_COMMON_FLAGS ?= -fPIC -Wall -W -Wno-unused-parameter -Wno-pointer-sign -I./include -I./uthash -I./src MAJOR_VERSION = 0 MINOR_VERSION = 2 -PATCH_VERSION = 8 +PATCH_VERSION = 9 VERSION = "$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_VERSION)" SONAME = libucl.so SONAME_FULL = $(SONAME).$(MAJOR_VERSION) @@ -21,8 +21,17 @@ LD_SHARED_FLAGS ?= -Wl,-soname,$(SONAME) LD_UCL_FLAGS ?= -L$(OBJDIR) -Wl,-rpath,$(OBJDIR) -lucl LD_ADD ?= -lrt COPT_FLAGS ?= -O2 -HDEPS = $(SRCDIR)/ucl_hash.h $(SRCDIR)/ucl_chartable.h $(SRCDIR)/ucl_internal.h $(INCLUDEDIR)/ucl.h $(SRCDIR)/xxhash.h -OBJECTS = $(OBJDIR)/ucl_hash.o $(OBJDIR)/ucl_util.o $(OBJDIR)/ucl_parser.o $(OBJDIR)/ucl_emitter.o $(OBJDIR)/xxhash.o +HDEPS = $(SRCDIR)/ucl_hash.h \ + $(SRCDIR)/ucl_chartable.h \ + $(SRCDIR)/ucl_internal.h \ + $(INCLUDEDIR)/ucl.h \ + $(SRCDIR)/xxhash.h +OBJECTS = $(OBJDIR)/ucl_hash.o \ + $(OBJDIR)/ucl_util.o \ + $(OBJDIR)/ucl_parser.o \ + $(OBJDIR)/ucl_emitter.o \ + $(OBJDIR)/ucl_schema.o \ + $(OBJDIR)/xxhash.o all: $(OBJDIR) $(OBJDIR)/$(SONAME) @@ -44,11 +53,13 @@ $(OBJDIR)/ucl_emitter.o: $(SRCDIR)/ucl_e $(CC) -o $(OBJDIR)/ucl_emitter.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_emitter.c $(OBJDIR)/ucl_hash.o: $(SRCDIR)/ucl_hash.c $(HDEPS) $(CC) -o $(OBJDIR)/ucl_hash.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_hash.c +$(OBJDIR)/ucl_schema.o: $(SRCDIR)/ucl_schema.c $(HDEPS) + $(CC) -o $(OBJDIR)/ucl_schema.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_schema.c $(OBJDIR)/xxhash.o: $(SRCDIR)/xxhash.c $(HDEPS) $(CC) -o $(OBJDIR)/xxhash.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/xxhash.c clean: - $(RM) $(OBJDIR)/*.o $(OBJDIR)/$(SONAME_FULL) $(OBJDIR)/$(SONAME) $(OBJDIR)/chargen $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/objdump $(OBJDIR)/test_generate + $(RM) $(OBJDIR)/*.o $(OBJDIR)/$(SONAME_FULL) $(OBJDIR)/$(SONAME) $(OBJDIR)/chargen $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/objdump $(OBJDIR)/test_generate $(OBJDIR)/test_schema || true $(RMDIR) $(OBJDIR) # Utils @@ -60,13 +71,15 @@ objdump: utils/objdump.c $(OBJDIR)/$(SON # Tests -test: $(OBJDIR) $(OBJDIR)/$(SONAME) $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/test_generate +test: $(OBJDIR) $(OBJDIR)/$(SONAME) $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/test_generate $(OBJDIR)/test_schema run-test: test - TEST_DIR=$(TESTDIR) $(TESTDIR)/run_tests.sh $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/test_generate + TEST_DIR=$(TESTDIR) $(TESTDIR)/run_tests.sh $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/test_generate $(OBJDIR)/test_schema $(OBJDIR)/test_basic: $(TESTDIR)/test_basic.c $(OBJDIR)/$(SONAME) $(CC) -o $(OBJDIR)/test_basic $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_basic.c $(LD_UCL_FLAGS) +$(OBJDIR)/test_schema: $(TESTDIR)/test_schema.c $(OBJDIR)/$(SONAME) + $(CC) -o $(OBJDIR)/test_schema $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_schema.c $(LD_UCL_FLAGS) $(OBJDIR)/test_speed: $(TESTDIR)/test_speed.c $(OBJDIR)/$(SONAME) $(CC) -o $(OBJDIR)/test_speed $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_speed.c $(LD_UCL_FLAGS) $(LD_ADD) $(OBJDIR)/test_generate: $(TESTDIR)/test_generate.c $(OBJDIR)/$(SONAME) Modified: stable/10/contrib/libucl/Makefile.w32 ============================================================================== --- stable/10/contrib/libucl/Makefile.w32 Sat Jul 19 23:39:17 2014 (r268895) +++ stable/10/contrib/libucl/Makefile.w32 Sat Jul 19 23:44:57 2014 (r268896) @@ -4,7 +4,7 @@ LD ?= gcc C_COMMON_FLAGS ?= -fPIC -Wall -W -Wno-unused-parameter -Wno-pointer-sign -I./include -I./uthash -I./src MAJOR_VERSION = 0 MINOR_VERSION = 2 -PATCH_VERSION = 8 +PATCH_VERSION = 9 VERSION = "$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_VERSION)" SONAME = libucl.dll OBJDIR ?= .obj @@ -24,8 +24,17 @@ LD_SHARED_FLAGS ?= -Wl,-soname,$(SONAME) LD_UCL_FLAGS ?= -L$(OBJDIR) -Wl,-rpath,$(OBJDIR) -lucl LD_ADD ?= -lrt COPT_FLAGS ?= -O2 -HDEPS = $(SRCDIR)/ucl_hash.h $(SRCDIR)/ucl_chartable.h $(SRCDIR)/ucl_internal.h $(INCLUDEDIR)/ucl.h $(SRCDIR)/xxhash.h -OBJECTS = $(OBJDIR)/ucl_hash.o $(OBJDIR)/ucl_util.o $(OBJDIR)/ucl_parser.o $(OBJDIR)/ucl_emitter.o $(OBJDIR)/xxhash.o +HDEPS = $(SRCDIR)/ucl_hash.h \ + $(SRCDIR)/ucl_chartable.h \ + $(SRCDIR)/ucl_internal.h \ + $(INCLUDEDIR)/ucl.h \ + $(SRCDIR)/xxhash.h +OBJECTS = $(OBJDIR)/ucl_hash.o \ + $(OBJDIR)/ucl_util.o \ + $(OBJDIR)/ucl_parser.o \ + $(OBJDIR)/ucl_emitter.o \ + $(OBJDIR)/ucl_schema.o \ + $(OBJDIR)/xxhash.o all: $(OBJDIR) $(OBJDIR)/$(SONAME) @@ -44,6 +53,8 @@ $(OBJDIR)/ucl_emitter.o: $(SRCDIR)/ucl_e $(CC) -o $(OBJDIR)/ucl_emitter.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_emitter.c $(OBJDIR)/ucl_hash.o: $(SRCDIR)/ucl_hash.c $(HDEPS) $(CC) -o $(OBJDIR)/ucl_hash.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_hash.c +$(OBJDIR)/ucl_schema.o: $(SRCDIR)/ucl_schema.c $(HDEPS) + $(CC) -o $(OBJDIR)/ucl_schema.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_schema.c $(OBJDIR)/xxhash.o: $(SRCDIR)/xxhash.c $(HDEPS) $(CC) -o $(OBJDIR)/xxhash.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/xxhash.c Modified: stable/10/contrib/libucl/README.md ============================================================================== --- stable/10/contrib/libucl/README.md Sat Jul 19 23:39:17 2014 (r268895) +++ stable/10/contrib/libucl/README.md Sat Jul 19 23:44:57 2014 (r268896) @@ -1,3 +1,26 @@ +# LIBUCL + +[![Build Status](https://travis-ci.org/vstakhov/libucl.svg?branch=master)](https://travis-ci.org/vstakhov/libucl) + +**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)* + +- [Introduction](#introduction) +- [Basic structure](#basic-structure) +- [Improvements to the json notation](#improvements-to-the-json-notation) + - [General syntax sugar](#general-syntax-sugar) + - [Automatic arrays creation](#automatic-arrays-creation) + - [Named keys hierarchy](#named-keys-hierarchy) + - [Convenient numbers and booleans](#convenient-numbers-and-booleans) +- [General improvements](#general-improvements) + - [Commments](#commments) + - [Macros support](#macros-support) + - [Variables support](#variables-support) + - [Multiline strings](#multiline-strings) +- [Emitter](#emitter) +- [Validation](#validation) +- [Performance](#performance) +- [Conclusion](#conclusion) + ## Introduction This document describes the main features and principles of the configuration @@ -262,6 +285,10 @@ Each UCL object can be serialized to one * `Configuration` - nginx like notation; * `YAML` - yaml inlined notation. +## Validation + +UCL allows validation of objects. It uses the same schema that is used for json: [json schema v4](http://json-schema.org). UCL supports the full set of json schema with the exception of remote references. This feature is unlikely useful for configuration objects. Of course, a schema definition can be in UCL format instead of JSON that simplifies schemas writing. Moreover, since UCL supports multiple values for keys in an object it is possible to specify generic integer constraints `maxValues` and `minValues` to define the limits of values count in a single key. UCL currently is not absolutely strict about validation schemas themselves, therefore UCL users should supply valid schemas (as it is defined in json-schema draft v4) to ensure that the input objects are validated properly. + ## Performance Are UCL parser and emitter fast enough? Well, there are some numbers. Added: stable/10/contrib/libucl/autogen.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/libucl/autogen.sh Sat Jul 19 23:44:57 2014 (r268896) @@ -0,0 +1,2 @@ +#!/bin/sh +autoreconf -i Added: stable/10/contrib/libucl/cmake/CMakeLists.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/libucl/cmake/CMakeLists.txt Sat Jul 19 23:44:57 2014 (r268896) @@ -0,0 +1,112 @@ +PROJECT(libucl C) + +SET(LIBUCL_VERSION_MAJOR 0) +SET(LIBUCL_VERSION_MINOR 2) +SET(LIBUCL_VERSION_PATCH 9) + +SET(LIBUCL_VERSION "${LIBUCL_VERSION_MAJOR}.${LIBUCL_VERSION_MINOR}.${LIBUCL_VERSION_PATCH}") + +INCLUDE(CheckCCompilerFlag) +INCLUDE(FindOpenSSL) +CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0 FATAL_ERROR) + +OPTION(ENABLE_URL_INCLUDE "Enable urls in ucl includes (requires libcurl or libfetch) [default: OFF]" OFF) +OPTION(ENABLE_URL_SIGN "Enable signatures check in ucl includes (requires openssl) [default: OFF]" OFF) +OPTION(BUILD_SHARED_LIBS "Build Shared Libraries [default: OFF]" OFF) + +IF(CMAKE_SYSTEM_NAME STREQUAL "Linux") + LIST(APPEND CMAKE_REQUIRED_LIBRARIES rt) +ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux") + +IF(ENABLE_URL_INCLUDE MATCHES "ON") + FIND_LIBRARY(LIBFETCH_LIBRARY NAMES fetch PATHS PATH_SUFFIXES lib64 lib + PATHS + ~/Library/Frameworks + /Library/Frameworks + /usr/local + /usr + /sw + /opt/local + /opt/csw + /opt + DOC "Path where the libfetch library can be found") + IF(LIBFETCH_LIBRARY) + FIND_FILE(HAVE_FETCH_H NAMES fetch.h PATHS /usr/include + /opt/include + /usr/local/include + DOC "Path to libfetch header") + ELSE(LIBFETCH_LIBRARY) + # Try to find libcurl + ProcessPackage(CURL libcurl) + IF(NOT CURL_FOUND) + MESSAGE(WARNING "Neither libcurl nor libfetch were found, no support of URL includes in configuration") + ENDIF(NOT CURL_FOUND) + ENDIF(LIBFETCH_LIBRARY) +ENDIF(ENABLE_URL_INCLUDE MATCHES "ON") + +SET(CMAKE_C_WARN_FLAGS "") +CHECK_C_COMPILER_FLAG(-Wall SUPPORT_WALL) +CHECK_C_COMPILER_FLAG(-W SUPPORT_W) +CHECK_C_COMPILER_FLAG(-Wno-unused-parameter SUPPORT_WPARAM) +CHECK_C_COMPILER_FLAG(-Wno-pointer-sign SUPPORT_WPOINTER_SIGN) +CHECK_C_COMPILER_FLAG(-Wstrict-prototypes SUPPORT_WSTRICT_PROTOTYPES) +IF(NOT "${CMAKE_C_COMPILER_ID}" MATCHES SunPro) + CHECK_C_COMPILER_FLAG("-std=c99" SUPPORT_STD_FLAG) +ENDIF(NOT "${CMAKE_C_COMPILER_ID}" MATCHES SunPro) +IF(SUPPORT_W) + SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -W") +ENDIF(SUPPORT_W) +IF(SUPPORT_WALL) + SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -Wall") +ENDIF(SUPPORT_WALL) +IF(SUPPORT_WPARAM) + SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -Wno-unused-parameter") +ENDIF(SUPPORT_WPARAM) +IF(SUPPORT_WPOINTER_SIGN) + SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -Wno-pointer-sign") +ENDIF(SUPPORT_WPOINTER_SIGN) +IF(SUPPORT_WSTRICT_PROTOTYPES) + SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -Wstrict-prototypes") +ENDIF(SUPPORT_WSTRICT_PROTOTYPES) +IF(SUPPORT_STD_FLAG) + SET(CMAKE_C_WARN_FLAGS "${CMAKE_C_WARN_FLAGS} -std=c99") +ENDIF(SUPPORT_STD_FLAG) + +IF(ENABLE_URL_SIGN MATCHES "ON") + IF(OPENSSL_FOUND) + SET(HAVE_OPENSSL 1) + INCLUDE_DIRECTORIES("${OPENSSL_INCLUDE_DIR}") + ENDIF(OPENSSL_FOUND) +ENDIF(ENABLE_URL_SIGN MATCHES "ON") + +INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/../src") +INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/../include") +INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/../uthash") + +SET(UCLSRC ../src/ucl_util.c + ../src/ucl_parser.c + ../src/ucl_emitter.c + ../src/ucl_hash.c + ../src/ucl_schema.c + ../src/xxhash.c) + + +SET (LIB_TYPE STATIC) +IF (BUILD_SHARED_LIBS) + SET (LIB_TYPE SHARED) +ENDIF (BUILD_SHARED_LIBS) +ADD_LIBRARY(ucl ${LIB_TYPE} ${UCLSRC}) +SET_TARGET_PROPERTIES(ucl PROPERTIES VERSION ${LIBUCL_VERSION} SOVERSION ${LIBUCL_VERSION_MAJOR}) + +IF(HAVE_FETCH_H) + TARGET_LINK_LIBRARIES(ucl fetch) +ELSE(HAVE_FETCH_H) + IF(CURL_FOUND) + TARGET_LINK_LIBRARIES(ucl ${CURL_LIBRARIES}) + ENDIF(CURL_FOUND) +ENDIF(HAVE_FETCH_H) +IF(ENABLE_URL_SIGN MATCHES "ON") + IF(OPENSSL_FOUND) + TARGET_LINK_LIBRARIES(ucl ${OPENSSL_LIBRARIES}) + ENDIF(OPENSSL_FOUND) +ENDIF(ENABLE_URL_SIGN MATCHES "ON") Added: stable/10/contrib/libucl/configure.ac ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/libucl/configure.ac Sat Jul 19 23:44:57 2014 (r268896) @@ -0,0 +1,163 @@ +m4_define([maj_ver], [0]) +m4_define([med_ver], [4]) +m4_define([min_ver], [1]) +m4_define([so_version], [1:0:0]) +m4_define([ucl_version], [maj_ver.med_ver.min_ver]) + +AC_INIT([libucl],[ucl_version],[https://github.com/vstakhov/libucl],[libucl]) +AC_CONFIG_SRCDIR([configure.ac]) +AM_INIT_AUTOMAKE([1.11 foreign silent-rules -Wall -Wportability no-dist-gzip dist-xz]) + +UCL_VERSION=ucl_version +SO_VERSION=so_version + +AC_SUBST(UCL_VERSION) +AC_SUBST(SO_VERSION) + +AC_PROG_CC_C99 +AM_PROG_CC_C_O +AM_PROG_AR +LT_INIT +AC_CONFIG_MACRO_DIR([m4]) +AC_CONFIG_HEADERS([config.h]) + +AC_C_CONST +AC_TYPE_SIZE_T + +AC_CHECK_HEADERS_ONCE([fcntl.h unistd.h]) +AC_TYPE_OFF_T +AC_FUNC_MMAP +AC_CHECK_HEADERS_ONCE([fcntl.h]) +AC_CHECK_HEADERS_ONCE([sys/types.h]) +AC_CHECK_HEADERS_ONCE([sys/stat.h]) +AC_CHECK_HEADERS_ONCE([sys/param.h]) +AC_CHECK_HEADERS_ONCE([sys/mman.h]) +AC_CHECK_HEADERS_ONCE([stdlib.h]) +AC_CHECK_HEADERS_ONCE([stddef.h]) +AC_CHECK_HEADERS_ONCE([stdarg.h]) +AC_CHECK_HEADERS_ONCE([stdbool.h]) +AC_CHECK_HEADERS_ONCE([stdint.h]) +AC_CHECK_HEADERS_ONCE([string.h]) +AC_CHECK_HEADERS_ONCE([unistd.h]) +AC_CHECK_HEADERS_ONCE([ctype.h]) +AC_CHECK_HEADERS_ONCE([errno.h]) +AC_CHECK_HEADERS_ONCE([limits.h]) +AC_CHECK_HEADERS_ONCE([libgen.h]) +AC_CHECK_HEADERS_ONCE([stdio.h]) +AC_CHECK_HEADERS_ONCE([float.h]) +AC_CHECK_HEADERS_ONCE([math.h]) + +dnl Example of default-disabled feature +AC_ARG_ENABLE([urls], AS_HELP_STRING([--enable-urls], + [Enable URLs fetch (requires libfetch or libcurl) @<:@default=no@:>@]), [], + [enable_urls=no]) +AC_ARG_ENABLE([regex], AS_HELP_STRING([--enable-regex], + [Enable regex checking for schema @<:@default=yes@:>@]), [], + [enable_regex=yes]) +AC_ARG_ENABLE([signatures], AS_HELP_STRING([--enable-signatures], + [Enable signatures check (requires openssl) @<:@default=no@:>@]), [], + [enable_signatures=no]) +AC_ARG_ENABLE([utils], + AS_HELP_STRING([--enable-utils], [Build and install utils @<:@default=no@:>@]), + [case "${enableval}" in + yes) utils=true ;; + no) utils=false ;; + *) AC_MSG_ERROR([bad value ${enableval} for --enable-utils]) ;; + esac],[utils=false]) +AM_CONDITIONAL([UTILS], [test x$utils = xtrue]) + +AS_IF([test "x$enable_signatures" = "xyes"], [ + AC_SEARCH_LIBS([EVP_MD_CTX_create], [crypto], [ + AC_DEFINE(HAVE_OPENSSL, 1, [Define to 1 if you have the 'crypto' library (-lcrypto).]) + LIBCRYPTO_LIB="-lcrypto" + LIBS_EXTRA="${LIBS_EXTRA} -lcrypto" + ], [AC_MSG_ERROR([unable to find the EVP_MD_CTX_create() function])]) +]) +AC_SUBST(LIBCRYPTO_LIB) +AC_PATH_PROG(PANDOC, pandoc, [/non/existent]) + +AC_SEARCH_LIBS([clock_gettime], [rt], [], [ + AC_CHECK_HEADER([mach/mach_time.h], [ + AC_DEFINE(HAVE_MACH_MACH_TIME_H, 1, [Define to 1 on Darwin]) + ], [AC_MSG_ERROR([unable to find clock_gettime or mach_absolute_time])]) +]) +AC_SEARCH_LIBS([remainder], [m], [], [AC_MSG_ERROR([unable to find remainder() function])]) + +AS_IF([test "x$enable_regex" = "xyes"], [ + AC_CHECK_HEADER([regex.h], [ + AC_DEFINE(HAVE_REGEX_H, 1, [Define to 1 if you have the header file.]) + AC_SEARCH_LIBS([regexec], [regex], [ + AS_IF([test "x$ac_cv_search_regexec" = "x-lregex"], [ + LIBREGEX_LIB="-lregex" + LIBS_EXTRA="${LIBS_EXTRA} -lregex" + ] + )], + [AC_MSG_ERROR([unable to find the regexec() function])])], + [AC_MSG_ERROR([unable to find the regex.h header]) + ], + [#include ]) +]) +AC_SUBST(LIBREGEX_LIB) + +AS_IF([test "x$enable_urls" = "xyes"], [ + AC_CHECK_HEADER([fetch.h], [ + AC_DEFINE(HAVE_FETCH_H, 1, [Define to 1 if you have the header file.]) + AC_CHECK_LIB(fetch, fetchXGet, [ + AC_DEFINE(HAVE_LIBFETCH, 1, [Define to 1 if you have the 'fetch' library (-lfetch).]) + LIBFETCH_LIBS="-lfetch" + have_libfetch="yes" + LIBS_EXTRA="${LIBS_EXTRA} -lfetch" + ]) + ], [],[ + #include + #ifdef HAVE_SYS_PARAM_H + #include + #endif + ]) + AC_SUBST(LIBFETCH_LIBS) + + AS_IF([ test "x$have_libfetch" != "xyes"], [ + dnl Fallback to libcurl + PKG_CHECK_MODULES([CURL], [libcurl], [ + AC_DEFINE(CURL_FOUND, 1, [Use libcurl]) + LIBS_EXTRA="${LIBS_EXTRA} -lcurl"], + [AC_MSG_ERROR([unable to find neither libfetch nor libcurl])]) + ]) + AC_SUBST(CURL_FOUND) + AC_SUBST(CURL_LIBS) + AC_SUBST(CURL_CFLAGS) +]) + +AC_SUBST(LIBS_EXTRA) + +AC_MSG_CHECKING(for GCC atomic builtins) +AC_LINK_IFELSE([ + AC_LANG_SOURCE([[ + int main() { + volatile unsigned long val = 1; + __sync_synchronize(); + __sync_val_compare_and_swap(&val, 1, 0); + __sync_add_and_fetch(&val, 1); + __sync_sub_and_fetch(&val, 1); + return 0; + } + ]]) +], +[ + AC_MSG_RESULT([yes]) + AC_DEFINE([HAVE_ATOMIC_BUILTINS], [1], [Has gcc/MSVC atomic intrinsics]) +], +[ + AC_MSG_RESULT([no]) + AC_DEFINE([HAVE_ATOMIC_BUILTINS], [0], [Has gcc/MSVC atomic intrinsics]) + AC_MSG_WARN([Libucl references could be thread-unsafe because atomic builtins are missing]) +]) + +AC_CONFIG_FILES(Makefile \ + src/Makefile \ + tests/Makefile \ + utils/Makefile \ + doc/Makefile \ + libucl.pc) +AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h]) +AC_OUTPUT Added: stable/10/contrib/libucl/doc/Makefile.am ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/libucl/doc/Makefile.am Sat Jul 19 23:44:57 2014 (r268896) @@ -0,0 +1,8 @@ +EXTRA_DIST = api.md + +dist_man_MANS = libucl.3 + +gen-man: @PANDOC@ + tail -n +$$(grep -n '# Synopsis' api.md | cut -d':' -f1) api.md | \ + cat pandoc.template - | sed -e 's/^# \(.*\)/# \U\1/' | \ + @PANDOC@ -s -f markdown -t man -o libucl.3 \ No newline at end of file Modified: stable/10/contrib/libucl/doc/api.md ============================================================================== --- stable/10/contrib/libucl/doc/api.md Sat Jul 19 23:39:17 2014 (r268895) +++ stable/10/contrib/libucl/doc/api.md Sat Jul 19 23:44:57 2014 (r268896) @@ -1,30 +1,75 @@ -Synopsis -======== +# API documentation + +**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)* + +- [Synopsis](#synopsis) +- [Description](#description) + - [Parser functions](#parser-functions) + - [Emitting functions](#emitting-functions) + - [Conversion functions](#conversion-functions) + - [Generation functions](#generation-functions) + - [Iteration functions](#iteration-functions) + - [Validation functions](#validation-functions) + - [Utility functions](#utility-functions) +- [Parser functions](#parser-functions-1) + - [ucl_parser_new](#ucl_parser_new) + - [ucl_parser_register_macro](#ucl_parser_register_macro) + - [ucl_parser_register_variable](#ucl_parser_register_variable) + - [ucl_parser_add_chunk](#ucl_parser_add_chunk) + - [ucl_parser_add_string](#ucl_parser_add_string) + - [ucl_parser_add_file](#ucl_parser_add_file) + - [ucl_parser_get_object](#ucl_parser_get_object) + - [ucl_parser_get_error](#ucl_parser_get_error) + - [ucl_parser_free](#ucl_parser_free) + - [ucl_pubkey_add](#ucl_pubkey_add) + - [ucl_parser_set_filevars](#ucl_parser_set_filevars) + - [Parser usage example](#parser-usage-example) +- [Emitting functions](#emitting-functions-1) + - [ucl_object_emit](#ucl_object_emit) + - [ucl_object_emit_full](#ucl_object_emit_full) +- [Conversion functions](#conversion-functions-1) +- [Generation functions](#generation-functions-1) + - [ucl_object_new](#ucl_object_new) + - [ucl_object_typed_new](#ucl_object_typed_new) + - [Primitive objects generation](#primitive-objects-generation) + - [ucl_object_fromstring_common](#ucl_object_fromstring_common) +- [Iteration functions](#iteration-functions-1) + - [ucl_iterate_object](#ucl_iterate_object) +- [Validation functions](#validation-functions-1) + - [ucl_object_validate](#ucl_object_validate) + +# Synopsis `#include ` -Description -=========== +# Description Libucl is a parser and `C` API to parse and generate `ucl` objects. Libucl consist of several groups of functions: ### Parser functions -Used to parse `ucl` files and provide interface to extract `ucl` object +Used to parse `ucl` files and provide interface to extract `ucl` object. Currently, `libucl` can parse only full `ucl` documents, for instance, it is impossible to parse a part of document and therefore it is impossible to use `libucl` as a streaming parser. In future, this limitation can be removed. ### Emitting functions -Convert `ucl` objects to some textual or binary representation. +Convert `ucl` objects to some textual or binary representation. Currently, libucl supports the following exports: + +- `JSON` - valid json format (can possibly loose some original data, such as implicit arrays) +- `Config` - human-readable configuration format (losseless) +- `YAML` - embedded yaml format (has the same limitations as `json` output) ### Conversion functions -Help to convert `ucl` objects to C types +Help to convert `ucl` objects to C types. These functions are used to convert `ucl_object_t` to C primitive types, such as numbers, strings or boolean values. ### Generation functions -Allow creating of `ucl` objects from C types +Allow creating of `ucl` objects from C types and creating of complex `ucl` objects, such as hashes or arrays from primitive `ucl` objects, such as numbers or strings. ### Iteration functions -Iterate over `ucl` objects +Iterate over `ucl` complex objects or over a chain of values, for example when a key in an object has multiple values (that can be treated as implicit array or implicit consolidation). + +### Validation functions +Validation functions are used to validate some object `obj` using json-schema compatible object `schema`. Both input and schema must be UCL objects to perform validation. ### Utility functions -Provide basic utilities to manage `ucl` objects +Provide basic utilities to manage `ucl` objects: creating, removing, retaining and releasing reference count and so on. # Parser functions @@ -40,6 +85,7 @@ Creates new parser with the specified fl - `UCL_PARSER_KEY_LOWERCASE` - lowercase keys parsed - `UCL_PARSER_ZEROCOPY` - try to use zero-copy mode when reading files (in zero-copy mode text chunk being parsed without copying strings so it should exist till any object parsed is used) +- `UCL_PARSER_NO_TIME` - treat time values as strings without parsing them as floats ### ucl_parser_register_macro @@ -87,6 +133,14 @@ while this one won't be parsed correctly This limitation may possible be removed in future. +### ucl_parser_add_string +~~~C +bool ucl_parser_add_string (struct ucl_parser *parser, + const char *data, size_t len); +~~~ + +This function acts exactly like `ucl_parser_add_chunk` does but if `len` argument is zero, then the string `data` must be zero-terminated and the actual length is calculated up to `\0` character. + ### ucl_parser_add_file ~~~C @@ -228,7 +282,7 @@ Libucl provides the following functions ### ucl_object_emit ~~~C -unsigned char *ucl_object_emit (ucl_object_t *obj, enum ucl_emitter emit_type); +unsigned char *ucl_object_emit (const ucl_object_t *obj, enum ucl_emitter emit_type); ~~~ Allocate a string that is suitable to fit the underlying UCL object `obj` and fill it with the textual representation of the object `obj` according to style `emit_type`. The caller should free the returned string after using. @@ -236,7 +290,7 @@ Allocate a string that is suitable to fi ### ucl_object_emit_full ~~~C -bool ucl_object_emit_full (ucl_object_t *obj, enum ucl_emitter emit_type, +bool ucl_object_emit_full (const ucl_object_t *obj, enum ucl_emitter emit_type, struct ucl_emitter_functions *emitter); ~~~ @@ -314,19 +368,20 @@ This function is used to convert a strin - `UCL_STRING_PARSE_BOOLEAN` - parse passed string and detect boolean - `UCL_STRING_PARSE_INT` - parse passed string and detect integer number - `UCL_STRING_PARSE_DOUBLE` - parse passed string and detect integer or float number -- `UCL_STRING_PARSE_NUMBER` - parse passed string and detect number (both float or integer types) -- `UCL_STRING_PARSE` - parse passed string (and detect booleans and numbers) +- `UCL_STRING_PARSE_TIME` - parse time values as floating point numbers +- `UCL_STRING_PARSE_NUMBER` - parse passed string and detect number (both float, integer and time types) +- `UCL_STRING_PARSE` - parse passed string (and detect booleans, numbers and time values) - `UCL_STRING_PARSE_BYTES` - assume that numeric multipliers are in bytes notation, for example `10k` means `10*1024` and not `10*1000` as assumed without this flag If parsing operations fail then the resulting UCL object will be a `UCL_STRING`. A caller should always check the type of the returned object and release it after using. -# Iteration function +# Iteration functions Iteration are used to iterate over UCL compound types: arrays and objects. Moreover, iterations could be performed over the keys with multiple values (implicit arrays). To iterate over an object, an array or a key with multiple values there is a function `ucl_iterate_object`. ## ucl_iterate_object ~~~C -ucl_object_t* ucl_iterate_object (ucl_object_t *obj, +const ucl_object_t* ucl_iterate_object (const ucl_object_t *obj, ucl_object_iter_t *iter, bool expand_values); ~~~ @@ -334,7 +389,7 @@ This function accept opaque iterator poi ~~~C ucl_object_iter_t it = NULL, it_obj = NULL; -ucl_object_t *cur, *tmp; +const ucl_object_t *cur, *tmp; /* Iterate over the object */ while ((obj = ucl_iterate_object (top, &it, true))) { @@ -345,4 +400,40 @@ while ((obj = ucl_iterate_object (top, & ucl_object_tostring_forced (cur)); } } -~~~ \ No newline at end of file +~~~ + +# Validation functions + +Currently, there is only one validation function called `ucl_object_validate`. It performs validation of object using the specified schema. This function is defined as following: + +## ucl_object_validate +~~~C +bool ucl_object_validate (const ucl_object_t *schema, + const ucl_object_t *obj, struct ucl_schema_error *err); +~~~ + +This function uses ucl object `schema`, that must be valid in terms of `json-schema` draft v4, to validate input object `obj`. If this function returns `true` then validation procedure has been succeed. Otherwise, `false` is returned and `err` is set to a specific value. If caller set `err` to NULL then this function does not set any error just returning `false`. Error is the structure defined as following: + +~~~C +struct ucl_schema_error { + enum ucl_schema_error_code code; /* error code */ + char msg[128]; /* error message */ + ucl_object_t *obj; /* object where error occured */ +}; +~~~ + +Caller may use `code` field to get a numeric error code: + +~~~C +enum ucl_schema_error_code { + UCL_SCHEMA_OK = 0, /* no error */ + UCL_SCHEMA_TYPE_MISMATCH, /* type of object is incorrect */ + UCL_SCHEMA_INVALID_SCHEMA, /* schema is invalid */ + UCL_SCHEMA_MISSING_PROPERTY,/* missing properties */ + UCL_SCHEMA_CONSTRAINT, /* constraint found */ + UCL_SCHEMA_MISSING_DEPENDENCY, /* missing dependency */ + UCL_SCHEMA_UNKNOWN /* generic error */ +}; +~~~ + +`msg` is a stiring description of an error and `obj` is an object where error has been occurred. Error object is not allocated by libucl, so there is no need to free it after validation (a static object should thus be used). \ No newline at end of file Added: stable/10/contrib/libucl/doc/libucl.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/libucl/doc/libucl.3 Sat Jul 19 23:44:57 2014 (r268896) @@ -0,0 +1,637 @@ +.TH LIBUCL 5 "March 20, 2014" "Libucl manual" +.SH NAME +.PP +\f[B]ucl_parser_new\f[], \f[B]ucl_parser_register_macro\f[], +\f[B]ucl_parser_register_variable\f[], \f[B]ucl_parser_add_chunk\f[], +\f[B]ucl_parser_add_string\f[], \f[B]ucl_parser_add_file\f[], +\f[B]ucl_parser_get_object\f[], \f[B]ucl_parser_get_error\f[], +\f[B]ucl_parser_free\f[], \f[B]ucl_pubkey_add\f[], +\f[B]ucl_parser_set_filevars\f[] \- universal configuration library +parser and utility functions +.SH LIBRARY +.PP +UCL library (libucl, \-lucl) +.SH SYNOPSIS +.PP +\f[C]#include\ \f[] +.SH DESCRIPTION +.PP +Libucl is a parser and \f[C]C\f[] API to parse and generate \f[C]ucl\f[] +objects. +Libucl consist of several groups of functions: +.SS Parser functions +.PP +Used to parse \f[C]ucl\f[] files and provide interface to extract +\f[C]ucl\f[] object. +Currently, \f[C]libucl\f[] can parse only full \f[C]ucl\f[] documents, +for instance, it is impossible to parse a part of document and therefore +it is impossible to use \f[C]libucl\f[] as a streaming parser. +In future, this limitation can be removed. +.SS Emitting functions +.PP +Convert \f[C]ucl\f[] objects to some textual or binary representation. +Currently, libucl supports the following exports: +.IP \[bu] 2 +\f[C]JSON\f[] \- valid json format (can possibly loose some original +data, such as implicit arrays) +.IP \[bu] 2 +\f[C]Config\f[] \- human\-readable configuration format (losseless) +.IP \[bu] 2 +\f[C]YAML\f[] \- embedded yaml format (has the same limitations as +\f[C]json\f[] output) +.SS Conversion functions +.PP +Help to convert \f[C]ucl\f[] objects to C types. +These functions are used to convert \f[C]ucl_object_t\f[] to C primitive +types, such as numbers, strings or boolean values. +.SS Generation functions +.PP +Allow creating of \f[C]ucl\f[] objects from C types and creating of +complex \f[C]ucl\f[] objects, such as hashes or arrays from primitive +\f[C]ucl\f[] objects, such as numbers or strings. +.SS Iteration functions +.PP +Iterate over \f[C]ucl\f[] complex objects or over a chain of values, for +example when a key in an object has multiple values (that can be treated +as implicit array or implicit consolidation). +.SS Validation functions +.PP +Validation functions are used to validate some object \f[C]obj\f[] using +json\-schema compatible object \f[C]schema\f[]. +Both input and schema must be UCL objects to perform validation. +.SS Utility functions +.PP +Provide basic utilities to manage \f[C]ucl\f[] objects: creating, +removing, retaining and releasing reference count and so on. +.SH PARSER FUNCTIONS +.PP +Parser functions operates with \f[C]struct\ ucl_parser\f[]. +.SS ucl_parser_new +.IP +.nf +\f[C] +struct\ ucl_parser*\ ucl_parser_new\ (int\ flags); +\f[] +.fi +.PP +Creates new parser with the specified flags: +.IP \[bu] 2 +\f[C]UCL_PARSER_KEY_LOWERCASE\f[] \- lowercase keys parsed +.IP \[bu] 2 +\f[C]UCL_PARSER_ZEROCOPY\f[] \- try to use zero\-copy mode when reading +files (in zero\-copy mode text chunk being parsed without copying +strings so it should exist till any object parsed is used) +.IP \[bu] 2 +\f[C]UCL_PARSER_NO_TIME\f[] \- treat time values as strings without +parsing them as floats +.SS ucl_parser_register_macro +.IP +.nf +\f[C] +void\ ucl_parser_register_macro\ (struct\ ucl_parser\ *parser, +\ \ \ \ const\ char\ *macro,\ ucl_macro_handler\ handler,\ void*\ ud); +\f[] +.fi +.PP +Register new macro with name .\f[C]macro\f[] parsed by handler +\f[C]handler\f[] that accepts opaque data pointer \f[C]ud\f[]. +Macro handler should be of the following type: +.IP +.nf +\f[C] +bool\ (*ucl_macro_handler)\ (const\ unsigned\ char\ *data, +\ \ \ \ size_t\ len,\ void*\ ud);` +\f[] +.fi +.PP +Handler function accepts macro text \f[C]data\f[] of length \f[C]len\f[] +and the opaque pointer \f[C]ud\f[]. +If macro is parsed successfully the handler should return \f[C]true\f[]. +\f[C]false\f[] indicates parsing failure and the parser can be +terminated. +.SS ucl_parser_register_variable +.IP +.nf +\f[C] +void\ ucl_parser_register_variable\ (struct\ ucl_parser\ *parser, +\ \ \ \ const\ char\ *var,\ const\ char\ *value); +\f[] +.fi +.PP +Register new variable $\f[C]var\f[] that should be replaced by the +parser to the \f[C]value\f[] string. +.SS ucl_parser_add_chunk +.IP +.nf +\f[C] +bool\ ucl_parser_add_chunk\ (struct\ ucl_parser\ *parser,\ +\ \ \ \ const\ unsigned\ char\ *data,\ size_t\ len); +\f[] +.fi +.PP +Add new text chunk with \f[C]data\f[] of length \f[C]len\f[] to the +parser. +At the moment, \f[C]libucl\f[] parser is not a streamlined parser and +chunk \f[I]must\f[] contain the \f[I]valid\f[] ucl object. +For example, this object should be valid: +.IP +.nf +\f[C] +{\ "var":\ "value"\ } +\f[] +.fi +.PP +while this one won\[aq]t be parsed correctly: +.IP +.nf +\f[C] +{\ "var":\ +\f[] +.fi +.PP +This limitation may possible be removed in future. +.SS ucl_parser_add_string +.IP +.nf +\f[C] +bool\ ucl_parser_add_string\ (struct\ ucl_parser\ *parser,\ +\ \ \ \ const\ char\ *data,\ size_t\ len); +\f[] +.fi +.PP +This function acts exactly like \f[C]ucl_parser_add_chunk\f[] does but +if \f[C]len\f[] argument is zero, then the string \f[C]data\f[] must be +zero\-terminated and the actual length is calculated up to \f[C]\\0\f[] +character. +.SS ucl_parser_add_file +.IP +.nf +\f[C] +bool\ ucl_parser_add_file\ (struct\ ucl_parser\ *parser,\ +\ \ \ \ const\ char\ *filename); +\f[] +.fi +.PP +Load file \f[C]filename\f[] and parse it with the specified +\f[C]parser\f[]. +This function uses \f[C]mmap\f[] call to load file, therefore, it should +not be \f[C]shrinked\f[] during parsing. +Otherwise, \f[C]libucl\f[] can cause memory corruption and terminate the +calling application. +This function is also used by the internal handler of \f[C]include\f[] +macro, hence, this macro has the same limitation. +.SS ucl_parser_get_object +.IP +.nf +\f[C] +ucl_object_t*\ ucl_parser_get_object\ (struct\ ucl_parser\ *parser); +\f[] +.fi +.PP +If the \f[C]ucl\f[] data has been parsed correctly this function returns +the top object for the parser. +Otherwise, this function returns the \f[C]NULL\f[] pointer. +The reference count for \f[C]ucl\f[] object returned is increased by +one, therefore, a caller should decrease reference by using +\f[C]ucl_object_unref\f[] to free object after usage. +.SS ucl_parser_get_error +.IP +.nf +\f[C] +const\ char\ *ucl_parser_get_error(struct\ ucl_parser\ *parser); +\f[] +.fi +.PP +Returns the constant error string for the parser object. +If no error occurred during parsing a \f[C]NULL\f[] object is returned. +A caller should not try to free or modify this string. +.SS ucl_parser_free +.IP +.nf +\f[C] +void\ ucl_parser_free\ (struct\ ucl_parser\ *parser); +\f[] +.fi +.PP +Frees memory occupied by the parser object. +The reference count for top object is decreased as well, however if the +function \f[C]ucl_parser_get_object\f[] was called previously then the +top object won\[aq]t be freed. +.SS ucl_pubkey_add +.IP +.nf +\f[C] +bool\ ucl_pubkey_add\ (struct\ ucl_parser\ *parser,\ +\ \ \ \ const\ unsigned\ char\ *key,\ size_t\ len); +\f[] +.fi +.PP +This function adds a public key from text blob \f[C]key\f[] of length +\f[C]len\f[] to the \f[C]parser\f[] object. +This public key should be in the \f[C]PEM\f[] format and can be used by +\f[C]\&.includes\f[] macro for checking signatures of files included. +\f[C]Openssl\f[] support should be enabled to make this function +working. +If a key cannot be added (e.g. +due to format error) or \f[C]openssl\f[] was not linked to +\f[C]libucl\f[] then this function returns \f[C]false\f[]. +.SS ucl_parser_set_filevars +.IP +.nf +\f[C] +bool\ ucl_parser_set_filevars\ (struct\ ucl_parser\ *parser,\ +\ \ \ \ const\ char\ *filename,\ bool\ need_expand); +\f[] +.fi +.PP +Add the standard file variables to the \f[C]parser\f[] based on the +\f[C]filename\f[] specified: +.IP \[bu] 2 +\f[C]$FILENAME\f[] \- a filename of \f[C]ucl\f[] input +.IP \[bu] 2 +\f[C]$CURDIR\f[] \- a current directory of the input +.PP +For example, if a \f[C]filename\f[] param is +\f[C]\&../something.conf\f[] then the variables will have the following +values: +.IP \[bu] 2 +\f[C]$FILENAME\f[] \- "../something.conf" +.IP \[bu] 2 +\f[C]$CURDIR\f[] \- ".." +.PP +if \f[C]need_expand\f[] parameter is \f[C]true\f[] then all relative +paths are expanded using \f[C]realpath\f[] call. +In this example if \f[C]\&..\f[] is \f[C]/etc/dir\f[] then variables +will have these values: +.IP \[bu] 2 +\f[C]$FILENAME\f[] \- "/etc/something.conf" +.IP \[bu] 2 +\f[C]$CURDIR\f[] \- "/etc" +.SS Parser usage example +.PP +The following example loads, parses and extracts \f[C]ucl\f[] object +from stdin using \f[C]libucl\f[] parser functions (the length of input +is limited to 8K): +.IP +.nf +\f[C] +char\ inbuf[8192]; +struct\ ucl_parser\ *parser\ =\ NULL; +int\ ret\ =\ 0,\ r\ =\ 0; +ucl_object_t\ *obj\ =\ NULL; +FILE\ *in; + +in\ =\ stdin; +parser\ =\ ucl_parser_new\ (0); +while\ (!feof\ (in)\ &&\ r\ <\ (int)sizeof\ (inbuf))\ { +\ \ \ \ r\ +=\ fread\ (inbuf\ +\ r,\ 1,\ sizeof\ (inbuf)\ \-\ r,\ in); +} +ucl_parser_add_chunk\ (parser,\ inbuf,\ r); +fclose\ (in); + +if\ (ucl_parser_get_error\ (parser))\ { +\ \ \ \ printf\ ("Error\ occured:\ %s\\n",\ ucl_parser_get_error\ (parser)); +\ \ \ \ ret\ =\ 1; +} +else\ { +\ \ \ \ obj\ =\ ucl_parser_get_object\ (parser); +} + +if\ (parser\ !=\ NULL)\ { +\ \ \ \ ucl_parser_free\ (parser); +} +if\ (obj\ !=\ NULL)\ { +\ \ \ \ ucl_object_unref\ (obj); +} +return\ ret; +\f[] +.fi +.SH EMITTING FUNCTIONS +.PP +Libucl can transform UCL objects to a number of tectual formats: +.IP \[bu] 2 +configuration (\f[C]UCL_EMIT_CONFIG\f[]) \- nginx like human readable +configuration file where implicit arrays are transformed to the +duplicate keys +.IP \[bu] 2 +compact json: \f[C]UCL_EMIT_JSON_COMPACT\f[] \- single line valid json +without spaces +.IP \[bu] 2 +formatted json: \f[C]UCL_EMIT_JSON\f[] \- pretty formatted JSON with +newlines and spaces +.IP \[bu] 2 +compact yaml: \f[C]UCL_EMIT_YAML\f[] \- compact YAML output +.PP +Moreover, libucl API allows to select a custom set of emitting functions +allowing efficent and zero\-copy output of libucl objects. +Libucl uses the following structure to support this feature: +.IP +.nf +\f[C] +struct\ ucl_emitter_functions\ { +\ \ \ \ /**\ Append\ a\ single\ character\ */ +\ \ \ \ int\ (*ucl_emitter_append_character)\ (unsigned\ char\ c,\ size_t\ nchars,\ void\ *ud); +\ \ \ \ /**\ Append\ a\ string\ of\ a\ specified\ length\ */ +\ \ \ \ int\ (*ucl_emitter_append_len)\ (unsigned\ const\ char\ *str,\ size_t\ len,\ void\ *ud); +\ \ \ \ /**\ Append\ a\ 64\ bit\ integer\ */ +\ \ \ \ int\ (*ucl_emitter_append_int)\ (int64_t\ elt,\ void\ *ud); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Jul 19 23:57:38 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CC80DD0B; Sat, 19 Jul 2014 23:57: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 B50F52B0B; Sat, 19 Jul 2014 23:57:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s6JNvcej057979; Sat, 19 Jul 2014 23:57:38 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s6JNvaaZ057965; Sat, 19 Jul 2014 23:57:36 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201407192357.s6JNvaaZ057965@svn.freebsd.org> From: Baptiste Daroussin Date: Sat, 19 Jul 2014 23:57:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r268897 - in stable/9: contrib/libucl contrib/libucl/cmake contrib/libucl/doc contrib/libucl/include contrib/libucl/src contrib/libucl/tests contrib/libucl/tests/basic contrib/libucl/te... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Jul 2014 23:57:38 -0000 Author: bapt Date: Sat Jul 19 23:57:36 2014 New Revision: 268897 URL: http://svnweb.freebsd.org/changeset/base/268897 Log: MFC: r263648, r264789, r266636 This brings: - schema validation - xpath-like interface for ucl objects Adapt pkg(7) to the new libucl API Added: stable/9/contrib/libucl/Makefile.am - copied unchanged from r263648, head/contrib/libucl/Makefile.am stable/9/contrib/libucl/autogen.sh - copied unchanged from r263648, head/contrib/libucl/autogen.sh stable/9/contrib/libucl/cmake/ - copied from r263648, head/contrib/libucl/cmake/ stable/9/contrib/libucl/configure.ac - copied, changed from r263648, head/contrib/libucl/configure.ac stable/9/contrib/libucl/doc/Makefile.am - copied unchanged from r263648, head/contrib/libucl/doc/Makefile.am stable/9/contrib/libucl/doc/libucl.3 - copied, changed from r263648, head/contrib/libucl/doc/libucl.3 stable/9/contrib/libucl/doc/pandoc.template - copied unchanged from r263648, head/contrib/libucl/doc/pandoc.template stable/9/contrib/libucl/libucl.pc.in - copied unchanged from r263648, head/contrib/libucl/libucl.pc.in stable/9/contrib/libucl/src/Makefile.am - copied, changed from r263648, head/contrib/libucl/src/Makefile.am stable/9/contrib/libucl/src/tree.h - copied unchanged from r263648, head/contrib/libucl/src/tree.h stable/9/contrib/libucl/src/ucl_schema.c - copied, changed from r263648, head/contrib/libucl/src/ucl_schema.c stable/9/contrib/libucl/stamp-h.in - copied unchanged from r263648, head/contrib/libucl/stamp-h.in stable/9/contrib/libucl/tests/.gitignore - copied unchanged from r263648, head/contrib/libucl/tests/.gitignore stable/9/contrib/libucl/tests/Makefile.am - copied unchanged from r263648, head/contrib/libucl/tests/Makefile.am stable/9/contrib/libucl/tests/basic/ - copied from r263648, head/contrib/libucl/tests/basic/ stable/9/contrib/libucl/tests/basic.test - copied unchanged from r263648, head/contrib/libucl/tests/basic.test stable/9/contrib/libucl/tests/generate.test - copied unchanged from r263648, head/contrib/libucl/tests/generate.test stable/9/contrib/libucl/tests/schema/ - copied from r263648, head/contrib/libucl/tests/schema/ stable/9/contrib/libucl/tests/schema.test - copied unchanged from r263648, head/contrib/libucl/tests/schema.test stable/9/contrib/libucl/tests/speed.test - copied unchanged from r263648, head/contrib/libucl/tests/speed.test stable/9/contrib/libucl/tests/test_schema.c - copied, changed from r263648, head/contrib/libucl/tests/test_schema.c stable/9/contrib/libucl/utils/Makefile.am - copied unchanged from r263648, head/contrib/libucl/utils/Makefile.am Deleted: stable/9/contrib/libucl/.gitignore stable/9/contrib/libucl/tests/1.in stable/9/contrib/libucl/tests/1.res stable/9/contrib/libucl/tests/10.in stable/9/contrib/libucl/tests/2.in stable/9/contrib/libucl/tests/2.res stable/9/contrib/libucl/tests/3.in stable/9/contrib/libucl/tests/3.res stable/9/contrib/libucl/tests/4.in stable/9/contrib/libucl/tests/4.res stable/9/contrib/libucl/tests/5.in stable/9/contrib/libucl/tests/5.res stable/9/contrib/libucl/tests/6.in stable/9/contrib/libucl/tests/6.res stable/9/contrib/libucl/tests/7.in stable/9/contrib/libucl/tests/7.res stable/9/contrib/libucl/tests/8.in stable/9/contrib/libucl/tests/8.res stable/9/contrib/libucl/tests/9-comment.inc stable/9/contrib/libucl/tests/9-empty.inc stable/9/contrib/libucl/tests/9.in stable/9/contrib/libucl/tests/9.inc stable/9/contrib/libucl/tests/9.res Modified: stable/9/contrib/libucl/Makefile.unix stable/9/contrib/libucl/Makefile.w32 stable/9/contrib/libucl/README.md stable/9/contrib/libucl/doc/api.md stable/9/contrib/libucl/include/ucl.h stable/9/contrib/libucl/src/ucl_emitter.c stable/9/contrib/libucl/src/ucl_hash.c stable/9/contrib/libucl/src/ucl_hash.h stable/9/contrib/libucl/src/ucl_internal.h stable/9/contrib/libucl/src/ucl_parser.c stable/9/contrib/libucl/src/ucl_util.c stable/9/contrib/libucl/tests/run_tests.sh stable/9/contrib/libucl/tests/test_basic.c stable/9/contrib/libucl/tests/test_generate.c stable/9/contrib/libucl/tests/test_speed.c stable/9/contrib/libucl/utils/objdump.c stable/9/lib/libucl/Makefile stable/9/usr.sbin/pkg/config.c stable/9/usr.sbin/pkg/pkg.c Directory Properties: stable/9/contrib/libucl/ (props changed) stable/9/lib/libucl/ (props changed) stable/9/usr.sbin/pkg/ (props changed) Copied: stable/9/contrib/libucl/Makefile.am (from r263648, head/contrib/libucl/Makefile.am) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/contrib/libucl/Makefile.am Sat Jul 19 23:57:36 2014 (r268897, copy of r263648, head/contrib/libucl/Makefile.am) @@ -0,0 +1,7 @@ +ACLOCAL_AMFLAGS = -I m4 +EXTRA_DIST = uthash README.md + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libucl.pc + +SUBDIRS = src tests utils doc \ No newline at end of file Modified: stable/9/contrib/libucl/Makefile.unix ============================================================================== --- stable/9/contrib/libucl/Makefile.unix Sat Jul 19 23:44:57 2014 (r268896) +++ stable/9/contrib/libucl/Makefile.unix Sat Jul 19 23:57:36 2014 (r268897) @@ -4,7 +4,7 @@ LD ?= gcc C_COMMON_FLAGS ?= -fPIC -Wall -W -Wno-unused-parameter -Wno-pointer-sign -I./include -I./uthash -I./src MAJOR_VERSION = 0 MINOR_VERSION = 2 -PATCH_VERSION = 8 +PATCH_VERSION = 9 VERSION = "$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_VERSION)" SONAME = libucl.so SONAME_FULL = $(SONAME).$(MAJOR_VERSION) @@ -21,8 +21,17 @@ LD_SHARED_FLAGS ?= -Wl,-soname,$(SONAME) LD_UCL_FLAGS ?= -L$(OBJDIR) -Wl,-rpath,$(OBJDIR) -lucl LD_ADD ?= -lrt COPT_FLAGS ?= -O2 -HDEPS = $(SRCDIR)/ucl_hash.h $(SRCDIR)/ucl_chartable.h $(SRCDIR)/ucl_internal.h $(INCLUDEDIR)/ucl.h $(SRCDIR)/xxhash.h -OBJECTS = $(OBJDIR)/ucl_hash.o $(OBJDIR)/ucl_util.o $(OBJDIR)/ucl_parser.o $(OBJDIR)/ucl_emitter.o $(OBJDIR)/xxhash.o +HDEPS = $(SRCDIR)/ucl_hash.h \ + $(SRCDIR)/ucl_chartable.h \ + $(SRCDIR)/ucl_internal.h \ + $(INCLUDEDIR)/ucl.h \ + $(SRCDIR)/xxhash.h +OBJECTS = $(OBJDIR)/ucl_hash.o \ + $(OBJDIR)/ucl_util.o \ + $(OBJDIR)/ucl_parser.o \ + $(OBJDIR)/ucl_emitter.o \ + $(OBJDIR)/ucl_schema.o \ + $(OBJDIR)/xxhash.o all: $(OBJDIR) $(OBJDIR)/$(SONAME) @@ -44,11 +53,13 @@ $(OBJDIR)/ucl_emitter.o: $(SRCDIR)/ucl_e $(CC) -o $(OBJDIR)/ucl_emitter.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_emitter.c $(OBJDIR)/ucl_hash.o: $(SRCDIR)/ucl_hash.c $(HDEPS) $(CC) -o $(OBJDIR)/ucl_hash.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_hash.c +$(OBJDIR)/ucl_schema.o: $(SRCDIR)/ucl_schema.c $(HDEPS) + $(CC) -o $(OBJDIR)/ucl_schema.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_schema.c $(OBJDIR)/xxhash.o: $(SRCDIR)/xxhash.c $(HDEPS) $(CC) -o $(OBJDIR)/xxhash.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/xxhash.c clean: - $(RM) $(OBJDIR)/*.o $(OBJDIR)/$(SONAME_FULL) $(OBJDIR)/$(SONAME) $(OBJDIR)/chargen $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/objdump $(OBJDIR)/test_generate + $(RM) $(OBJDIR)/*.o $(OBJDIR)/$(SONAME_FULL) $(OBJDIR)/$(SONAME) $(OBJDIR)/chargen $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/objdump $(OBJDIR)/test_generate $(OBJDIR)/test_schema || true $(RMDIR) $(OBJDIR) # Utils @@ -60,13 +71,15 @@ objdump: utils/objdump.c $(OBJDIR)/$(SON # Tests -test: $(OBJDIR) $(OBJDIR)/$(SONAME) $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/test_generate +test: $(OBJDIR) $(OBJDIR)/$(SONAME) $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/test_generate $(OBJDIR)/test_schema run-test: test - TEST_DIR=$(TESTDIR) $(TESTDIR)/run_tests.sh $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/test_generate + TEST_DIR=$(TESTDIR) $(TESTDIR)/run_tests.sh $(OBJDIR)/test_basic $(OBJDIR)/test_speed $(OBJDIR)/test_generate $(OBJDIR)/test_schema $(OBJDIR)/test_basic: $(TESTDIR)/test_basic.c $(OBJDIR)/$(SONAME) $(CC) -o $(OBJDIR)/test_basic $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_basic.c $(LD_UCL_FLAGS) +$(OBJDIR)/test_schema: $(TESTDIR)/test_schema.c $(OBJDIR)/$(SONAME) + $(CC) -o $(OBJDIR)/test_schema $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_schema.c $(LD_UCL_FLAGS) $(OBJDIR)/test_speed: $(TESTDIR)/test_speed.c $(OBJDIR)/$(SONAME) $(CC) -o $(OBJDIR)/test_speed $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) $(LDFLAGS) $(TESTDIR)/test_speed.c $(LD_UCL_FLAGS) $(LD_ADD) $(OBJDIR)/test_generate: $(TESTDIR)/test_generate.c $(OBJDIR)/$(SONAME) Modified: stable/9/contrib/libucl/Makefile.w32 ============================================================================== --- stable/9/contrib/libucl/Makefile.w32 Sat Jul 19 23:44:57 2014 (r268896) +++ stable/9/contrib/libucl/Makefile.w32 Sat Jul 19 23:57:36 2014 (r268897) @@ -4,7 +4,7 @@ LD ?= gcc C_COMMON_FLAGS ?= -fPIC -Wall -W -Wno-unused-parameter -Wno-pointer-sign -I./include -I./uthash -I./src MAJOR_VERSION = 0 MINOR_VERSION = 2 -PATCH_VERSION = 8 +PATCH_VERSION = 9 VERSION = "$(MAJOR_VERSION).$(MINOR_VERSION).$(PATCH_VERSION)" SONAME = libucl.dll OBJDIR ?= .obj @@ -24,8 +24,17 @@ LD_SHARED_FLAGS ?= -Wl,-soname,$(SONAME) LD_UCL_FLAGS ?= -L$(OBJDIR) -Wl,-rpath,$(OBJDIR) -lucl LD_ADD ?= -lrt COPT_FLAGS ?= -O2 -HDEPS = $(SRCDIR)/ucl_hash.h $(SRCDIR)/ucl_chartable.h $(SRCDIR)/ucl_internal.h $(INCLUDEDIR)/ucl.h $(SRCDIR)/xxhash.h -OBJECTS = $(OBJDIR)/ucl_hash.o $(OBJDIR)/ucl_util.o $(OBJDIR)/ucl_parser.o $(OBJDIR)/ucl_emitter.o $(OBJDIR)/xxhash.o +HDEPS = $(SRCDIR)/ucl_hash.h \ + $(SRCDIR)/ucl_chartable.h \ + $(SRCDIR)/ucl_internal.h \ + $(INCLUDEDIR)/ucl.h \ + $(SRCDIR)/xxhash.h +OBJECTS = $(OBJDIR)/ucl_hash.o \ + $(OBJDIR)/ucl_util.o \ + $(OBJDIR)/ucl_parser.o \ + $(OBJDIR)/ucl_emitter.o \ + $(OBJDIR)/ucl_schema.o \ + $(OBJDIR)/xxhash.o all: $(OBJDIR) $(OBJDIR)/$(SONAME) @@ -44,6 +53,8 @@ $(OBJDIR)/ucl_emitter.o: $(SRCDIR)/ucl_e $(CC) -o $(OBJDIR)/ucl_emitter.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_emitter.c $(OBJDIR)/ucl_hash.o: $(SRCDIR)/ucl_hash.c $(HDEPS) $(CC) -o $(OBJDIR)/ucl_hash.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_hash.c +$(OBJDIR)/ucl_schema.o: $(SRCDIR)/ucl_schema.c $(HDEPS) + $(CC) -o $(OBJDIR)/ucl_schema.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/ucl_schema.c $(OBJDIR)/xxhash.o: $(SRCDIR)/xxhash.c $(HDEPS) $(CC) -o $(OBJDIR)/xxhash.o $(CPPFLAGS) $(COPT_FLAGS) $(CFLAGS) $(C_COMMON_FLAGS) $(SSL_CFLAGS) $(FETCH_FLAGS) -c $(SRCDIR)/xxhash.c Modified: stable/9/contrib/libucl/README.md ============================================================================== --- stable/9/contrib/libucl/README.md Sat Jul 19 23:44:57 2014 (r268896) +++ stable/9/contrib/libucl/README.md Sat Jul 19 23:57:36 2014 (r268897) @@ -1,3 +1,26 @@ +# LIBUCL + +[![Build Status](https://travis-ci.org/vstakhov/libucl.svg?branch=master)](https://travis-ci.org/vstakhov/libucl) + +**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)* + +- [Introduction](#introduction) +- [Basic structure](#basic-structure) +- [Improvements to the json notation](#improvements-to-the-json-notation) + - [General syntax sugar](#general-syntax-sugar) + - [Automatic arrays creation](#automatic-arrays-creation) + - [Named keys hierarchy](#named-keys-hierarchy) + - [Convenient numbers and booleans](#convenient-numbers-and-booleans) +- [General improvements](#general-improvements) + - [Commments](#commments) + - [Macros support](#macros-support) + - [Variables support](#variables-support) + - [Multiline strings](#multiline-strings) +- [Emitter](#emitter) +- [Validation](#validation) +- [Performance](#performance) +- [Conclusion](#conclusion) + ## Introduction This document describes the main features and principles of the configuration @@ -262,6 +285,10 @@ Each UCL object can be serialized to one * `Configuration` - nginx like notation; * `YAML` - yaml inlined notation. +## Validation + +UCL allows validation of objects. It uses the same schema that is used for json: [json schema v4](http://json-schema.org). UCL supports the full set of json schema with the exception of remote references. This feature is unlikely useful for configuration objects. Of course, a schema definition can be in UCL format instead of JSON that simplifies schemas writing. Moreover, since UCL supports multiple values for keys in an object it is possible to specify generic integer constraints `maxValues` and `minValues` to define the limits of values count in a single key. UCL currently is not absolutely strict about validation schemas themselves, therefore UCL users should supply valid schemas (as it is defined in json-schema draft v4) to ensure that the input objects are validated properly. + ## Performance Are UCL parser and emitter fast enough? Well, there are some numbers. Copied: stable/9/contrib/libucl/autogen.sh (from r263648, head/contrib/libucl/autogen.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/contrib/libucl/autogen.sh Sat Jul 19 23:57:36 2014 (r268897, copy of r263648, head/contrib/libucl/autogen.sh) @@ -0,0 +1,2 @@ +#!/bin/sh +autoreconf -i Copied and modified: stable/9/contrib/libucl/configure.ac (from r263648, head/contrib/libucl/configure.ac) ============================================================================== --- head/contrib/libucl/configure.ac Sat Mar 22 17:28:14 2014 (r263648, copy source) +++ stable/9/contrib/libucl/configure.ac Sat Jul 19 23:57:36 2014 (r268897) @@ -1,7 +1,7 @@ m4_define([maj_ver], [0]) -m4_define([med_ver], [3]) -m4_define([min_ver], [0]) -m4_define([so_version], [maj_ver:med_ver]) +m4_define([med_ver], [4]) +m4_define([min_ver], [1]) +m4_define([so_version], [1:0:0]) m4_define([ucl_version], [maj_ver.med_ver.min_ver]) AC_INIT([libucl],[ucl_version],[https://github.com/vstakhov/libucl],[libucl]) @@ -48,11 +48,17 @@ AC_CHECK_HEADERS_ONCE([float.h]) AC_CHECK_HEADERS_ONCE([math.h]) dnl Example of default-disabled feature -AC_ARG_ENABLE([urls], AS_HELP_STRING([--enable-urls], [Enable URLs fetch (requires libfetch or libcurl)])) +AC_ARG_ENABLE([urls], AS_HELP_STRING([--enable-urls], + [Enable URLs fetch (requires libfetch or libcurl) @<:@default=no@:>@]), [], + [enable_urls=no]) +AC_ARG_ENABLE([regex], AS_HELP_STRING([--enable-regex], + [Enable regex checking for schema @<:@default=yes@:>@]), [], + [enable_regex=yes]) AC_ARG_ENABLE([signatures], AS_HELP_STRING([--enable-signatures], - [Enable signatures check (requires openssl)])) + [Enable signatures check (requires openssl) @<:@default=no@:>@]), [], + [enable_signatures=no]) AC_ARG_ENABLE([utils], - [--enable-utils Build and install utils], + AS_HELP_STRING([--enable-utils], [Build and install utils @<:@default=no@:>@]), [case "${enableval}" in yes) utils=true ;; no) utils=false ;; @@ -63,11 +69,11 @@ AM_CONDITIONAL([UTILS], [test x$utils = AS_IF([test "x$enable_signatures" = "xyes"], [ AC_SEARCH_LIBS([EVP_MD_CTX_create], [crypto], [ AC_DEFINE(HAVE_OPENSSL, 1, [Define to 1 if you have the 'crypto' library (-lcrypto).]) - LIBSSL_LIB="-lcrypto" + LIBCRYPTO_LIB="-lcrypto" LIBS_EXTRA="${LIBS_EXTRA} -lcrypto" ], [AC_MSG_ERROR([unable to find the EVP_MD_CTX_create() function])]) ]) - +AC_SUBST(LIBCRYPTO_LIB) AC_PATH_PROG(PANDOC, pandoc, [/non/existent]) AC_SEARCH_LIBS([clock_gettime], [rt], [], [ @@ -77,11 +83,21 @@ AC_SEARCH_LIBS([clock_gettime], [rt], [] ]) AC_SEARCH_LIBS([remainder], [m], [], [AC_MSG_ERROR([unable to find remainder() function])]) -AC_CHECK_HEADER([regex.h], [ - AC_DEFINE(HAVE_REGEX_H, 1, [Define to 1 if you have the header file.]) - ], - [AC_MSG_ERROR([unable to find the regex.h header])], - [#include ]) +AS_IF([test "x$enable_regex" = "xyes"], [ + AC_CHECK_HEADER([regex.h], [ + AC_DEFINE(HAVE_REGEX_H, 1, [Define to 1 if you have the header file.]) + AC_SEARCH_LIBS([regexec], [regex], [ + AS_IF([test "x$ac_cv_search_regexec" = "x-lregex"], [ + LIBREGEX_LIB="-lregex" + LIBS_EXTRA="${LIBS_EXTRA} -lregex" + ] + )], + [AC_MSG_ERROR([unable to find the regexec() function])])], + [AC_MSG_ERROR([unable to find the regex.h header]) + ], + [#include ]) +]) +AC_SUBST(LIBREGEX_LIB) AS_IF([test "x$enable_urls" = "xyes"], [ AC_CHECK_HEADER([fetch.h], [ @@ -114,6 +130,29 @@ AS_IF([test "x$enable_urls" = "xyes"], [ AC_SUBST(LIBS_EXTRA) +AC_MSG_CHECKING(for GCC atomic builtins) +AC_LINK_IFELSE([ + AC_LANG_SOURCE([[ + int main() { + volatile unsigned long val = 1; + __sync_synchronize(); + __sync_val_compare_and_swap(&val, 1, 0); + __sync_add_and_fetch(&val, 1); + __sync_sub_and_fetch(&val, 1); + return 0; + } + ]]) +], +[ + AC_MSG_RESULT([yes]) + AC_DEFINE([HAVE_ATOMIC_BUILTINS], [1], [Has gcc/MSVC atomic intrinsics]) +], +[ + AC_MSG_RESULT([no]) + AC_DEFINE([HAVE_ATOMIC_BUILTINS], [0], [Has gcc/MSVC atomic intrinsics]) + AC_MSG_WARN([Libucl references could be thread-unsafe because atomic builtins are missing]) +]) + AC_CONFIG_FILES(Makefile \ src/Makefile \ tests/Makefile \ Copied: stable/9/contrib/libucl/doc/Makefile.am (from r263648, head/contrib/libucl/doc/Makefile.am) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/contrib/libucl/doc/Makefile.am Sat Jul 19 23:57:36 2014 (r268897, copy of r263648, head/contrib/libucl/doc/Makefile.am) @@ -0,0 +1,8 @@ +EXTRA_DIST = api.md + +dist_man_MANS = libucl.3 + +gen-man: @PANDOC@ + tail -n +$$(grep -n '# Synopsis' api.md | cut -d':' -f1) api.md | \ + cat pandoc.template - | sed -e 's/^# \(.*\)/# \U\1/' | \ + @PANDOC@ -s -f markdown -t man -o libucl.3 \ No newline at end of file Modified: stable/9/contrib/libucl/doc/api.md ============================================================================== --- stable/9/contrib/libucl/doc/api.md Sat Jul 19 23:44:57 2014 (r268896) +++ stable/9/contrib/libucl/doc/api.md Sat Jul 19 23:57:36 2014 (r268897) @@ -1,30 +1,75 @@ -Synopsis -======== +# API documentation + +**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)* + +- [Synopsis](#synopsis) +- [Description](#description) + - [Parser functions](#parser-functions) + - [Emitting functions](#emitting-functions) + - [Conversion functions](#conversion-functions) + - [Generation functions](#generation-functions) + - [Iteration functions](#iteration-functions) + - [Validation functions](#validation-functions) + - [Utility functions](#utility-functions) +- [Parser functions](#parser-functions-1) + - [ucl_parser_new](#ucl_parser_new) + - [ucl_parser_register_macro](#ucl_parser_register_macro) + - [ucl_parser_register_variable](#ucl_parser_register_variable) + - [ucl_parser_add_chunk](#ucl_parser_add_chunk) + - [ucl_parser_add_string](#ucl_parser_add_string) + - [ucl_parser_add_file](#ucl_parser_add_file) + - [ucl_parser_get_object](#ucl_parser_get_object) + - [ucl_parser_get_error](#ucl_parser_get_error) + - [ucl_parser_free](#ucl_parser_free) + - [ucl_pubkey_add](#ucl_pubkey_add) + - [ucl_parser_set_filevars](#ucl_parser_set_filevars) + - [Parser usage example](#parser-usage-example) +- [Emitting functions](#emitting-functions-1) + - [ucl_object_emit](#ucl_object_emit) + - [ucl_object_emit_full](#ucl_object_emit_full) +- [Conversion functions](#conversion-functions-1) +- [Generation functions](#generation-functions-1) + - [ucl_object_new](#ucl_object_new) + - [ucl_object_typed_new](#ucl_object_typed_new) + - [Primitive objects generation](#primitive-objects-generation) + - [ucl_object_fromstring_common](#ucl_object_fromstring_common) +- [Iteration functions](#iteration-functions-1) + - [ucl_iterate_object](#ucl_iterate_object) +- [Validation functions](#validation-functions-1) + - [ucl_object_validate](#ucl_object_validate) + +# Synopsis `#include ` -Description -=========== +# Description Libucl is a parser and `C` API to parse and generate `ucl` objects. Libucl consist of several groups of functions: ### Parser functions -Used to parse `ucl` files and provide interface to extract `ucl` object +Used to parse `ucl` files and provide interface to extract `ucl` object. Currently, `libucl` can parse only full `ucl` documents, for instance, it is impossible to parse a part of document and therefore it is impossible to use `libucl` as a streaming parser. In future, this limitation can be removed. ### Emitting functions -Convert `ucl` objects to some textual or binary representation. +Convert `ucl` objects to some textual or binary representation. Currently, libucl supports the following exports: + +- `JSON` - valid json format (can possibly loose some original data, such as implicit arrays) +- `Config` - human-readable configuration format (losseless) +- `YAML` - embedded yaml format (has the same limitations as `json` output) ### Conversion functions -Help to convert `ucl` objects to C types +Help to convert `ucl` objects to C types. These functions are used to convert `ucl_object_t` to C primitive types, such as numbers, strings or boolean values. ### Generation functions -Allow creating of `ucl` objects from C types +Allow creating of `ucl` objects from C types and creating of complex `ucl` objects, such as hashes or arrays from primitive `ucl` objects, such as numbers or strings. ### Iteration functions -Iterate over `ucl` objects +Iterate over `ucl` complex objects or over a chain of values, for example when a key in an object has multiple values (that can be treated as implicit array or implicit consolidation). + +### Validation functions +Validation functions are used to validate some object `obj` using json-schema compatible object `schema`. Both input and schema must be UCL objects to perform validation. ### Utility functions -Provide basic utilities to manage `ucl` objects +Provide basic utilities to manage `ucl` objects: creating, removing, retaining and releasing reference count and so on. # Parser functions @@ -40,6 +85,7 @@ Creates new parser with the specified fl - `UCL_PARSER_KEY_LOWERCASE` - lowercase keys parsed - `UCL_PARSER_ZEROCOPY` - try to use zero-copy mode when reading files (in zero-copy mode text chunk being parsed without copying strings so it should exist till any object parsed is used) +- `UCL_PARSER_NO_TIME` - treat time values as strings without parsing them as floats ### ucl_parser_register_macro @@ -87,6 +133,14 @@ while this one won't be parsed correctly This limitation may possible be removed in future. +### ucl_parser_add_string +~~~C +bool ucl_parser_add_string (struct ucl_parser *parser, + const char *data, size_t len); +~~~ + +This function acts exactly like `ucl_parser_add_chunk` does but if `len` argument is zero, then the string `data` must be zero-terminated and the actual length is calculated up to `\0` character. + ### ucl_parser_add_file ~~~C @@ -228,7 +282,7 @@ Libucl provides the following functions ### ucl_object_emit ~~~C -unsigned char *ucl_object_emit (ucl_object_t *obj, enum ucl_emitter emit_type); +unsigned char *ucl_object_emit (const ucl_object_t *obj, enum ucl_emitter emit_type); ~~~ Allocate a string that is suitable to fit the underlying UCL object `obj` and fill it with the textual representation of the object `obj` according to style `emit_type`. The caller should free the returned string after using. @@ -236,7 +290,7 @@ Allocate a string that is suitable to fi ### ucl_object_emit_full ~~~C -bool ucl_object_emit_full (ucl_object_t *obj, enum ucl_emitter emit_type, +bool ucl_object_emit_full (const ucl_object_t *obj, enum ucl_emitter emit_type, struct ucl_emitter_functions *emitter); ~~~ @@ -314,19 +368,20 @@ This function is used to convert a strin - `UCL_STRING_PARSE_BOOLEAN` - parse passed string and detect boolean - `UCL_STRING_PARSE_INT` - parse passed string and detect integer number - `UCL_STRING_PARSE_DOUBLE` - parse passed string and detect integer or float number -- `UCL_STRING_PARSE_NUMBER` - parse passed string and detect number (both float or integer types) -- `UCL_STRING_PARSE` - parse passed string (and detect booleans and numbers) +- `UCL_STRING_PARSE_TIME` - parse time values as floating point numbers +- `UCL_STRING_PARSE_NUMBER` - parse passed string and detect number (both float, integer and time types) +- `UCL_STRING_PARSE` - parse passed string (and detect booleans, numbers and time values) - `UCL_STRING_PARSE_BYTES` - assume that numeric multipliers are in bytes notation, for example `10k` means `10*1024` and not `10*1000` as assumed without this flag If parsing operations fail then the resulting UCL object will be a `UCL_STRING`. A caller should always check the type of the returned object and release it after using. -# Iteration function +# Iteration functions Iteration are used to iterate over UCL compound types: arrays and objects. Moreover, iterations could be performed over the keys with multiple values (implicit arrays). To iterate over an object, an array or a key with multiple values there is a function `ucl_iterate_object`. ## ucl_iterate_object ~~~C -ucl_object_t* ucl_iterate_object (ucl_object_t *obj, +const ucl_object_t* ucl_iterate_object (const ucl_object_t *obj, ucl_object_iter_t *iter, bool expand_values); ~~~ @@ -334,7 +389,7 @@ This function accept opaque iterator poi ~~~C ucl_object_iter_t it = NULL, it_obj = NULL; -ucl_object_t *cur, *tmp; +const ucl_object_t *cur, *tmp; /* Iterate over the object */ while ((obj = ucl_iterate_object (top, &it, true))) { @@ -345,4 +400,40 @@ while ((obj = ucl_iterate_object (top, & ucl_object_tostring_forced (cur)); } } -~~~ \ No newline at end of file +~~~ + +# Validation functions + +Currently, there is only one validation function called `ucl_object_validate`. It performs validation of object using the specified schema. This function is defined as following: + +## ucl_object_validate +~~~C +bool ucl_object_validate (const ucl_object_t *schema, + const ucl_object_t *obj, struct ucl_schema_error *err); +~~~ + +This function uses ucl object `schema`, that must be valid in terms of `json-schema` draft v4, to validate input object `obj`. If this function returns `true` then validation procedure has been succeed. Otherwise, `false` is returned and `err` is set to a specific value. If caller set `err` to NULL then this function does not set any error just returning `false`. Error is the structure defined as following: + +~~~C +struct ucl_schema_error { + enum ucl_schema_error_code code; /* error code */ + char msg[128]; /* error message */ + ucl_object_t *obj; /* object where error occured */ +}; +~~~ + +Caller may use `code` field to get a numeric error code: + +~~~C +enum ucl_schema_error_code { + UCL_SCHEMA_OK = 0, /* no error */ + UCL_SCHEMA_TYPE_MISMATCH, /* type of object is incorrect */ + UCL_SCHEMA_INVALID_SCHEMA, /* schema is invalid */ + UCL_SCHEMA_MISSING_PROPERTY,/* missing properties */ + UCL_SCHEMA_CONSTRAINT, /* constraint found */ + UCL_SCHEMA_MISSING_DEPENDENCY, /* missing dependency */ + UCL_SCHEMA_UNKNOWN /* generic error */ +}; +~~~ + +`msg` is a stiring description of an error and `obj` is an object where error has been occurred. Error object is not allocated by libucl, so there is no need to free it after validation (a static object should thus be used). \ No newline at end of file Copied and modified: stable/9/contrib/libucl/doc/libucl.3 (from r263648, head/contrib/libucl/doc/libucl.3) ============================================================================== --- head/contrib/libucl/doc/libucl.3 Sat Mar 22 17:28:14 2014 (r263648, copy source) +++ stable/9/contrib/libucl/doc/libucl.3 Sat Jul 19 23:57:36 2014 (r268897) @@ -6,11 +6,11 @@ \f[B]ucl_parser_add_string\f[], \f[B]ucl_parser_add_file\f[], \f[B]ucl_parser_get_object\f[], \f[B]ucl_parser_get_error\f[], \f[B]ucl_parser_free\f[], \f[B]ucl_pubkey_add\f[], -\f[B]ucl_parser_set_filevars\f[] - universal configuration library +\f[B]ucl_parser_set_filevars\f[] \- universal configuration library parser and utility functions .SH LIBRARY .PP -UCL library (libucl, -lucl) +UCL library (libucl, \-lucl) .SH SYNOPSIS .PP \f[C]#include\ \f[] @@ -32,12 +32,12 @@ In future, this limitation can be remove Convert \f[C]ucl\f[] objects to some textual or binary representation. Currently, libucl supports the following exports: .IP \[bu] 2 -\f[C]JSON\f[] - valid json format (can possibly loose some original +\f[C]JSON\f[] \- valid json format (can possibly loose some original data, such as implicit arrays) .IP \[bu] 2 -\f[C]Config\f[] - human-readable configuration format (losseless) +\f[C]Config\f[] \- human\-readable configuration format (losseless) .IP \[bu] 2 -\f[C]YAML\f[] - embedded yaml format (has the same limitations as +\f[C]YAML\f[] \- embedded yaml format (has the same limitations as \f[C]json\f[] output) .SS Conversion functions .PP @@ -57,7 +57,7 @@ as implicit array or implicit consolidat .SS Validation functions .PP Validation functions are used to validate some object \f[C]obj\f[] using -json-schema compatible object \f[C]schema\f[]. +json\-schema compatible object \f[C]schema\f[]. Both input and schema must be UCL objects to perform validation. .SS Utility functions .PP @@ -76,13 +76,13 @@ struct\ ucl_parser*\ ucl_parser_new\ (in .PP Creates new parser with the specified flags: .IP \[bu] 2 -\f[C]UCL_PARSER_KEY_LOWERCASE\f[] - lowercase keys parsed +\f[C]UCL_PARSER_KEY_LOWERCASE\f[] \- lowercase keys parsed .IP \[bu] 2 -\f[C]UCL_PARSER_ZEROCOPY\f[] - try to use zero-copy mode when reading -files (in zero-copy mode text chunk being parsed without copying strings -so it should exist till any object parsed is used) +\f[C]UCL_PARSER_ZEROCOPY\f[] \- try to use zero\-copy mode when reading +files (in zero\-copy mode text chunk being parsed without copying +strings so it should exist till any object parsed is used) .IP \[bu] 2 -\f[C]UCL_PARSER_NO_TIME\f[] - treat time values as strings without +\f[C]UCL_PARSER_NO_TIME\f[] \- treat time values as strings without parsing them as floats .SS ucl_parser_register_macro .IP @@ -161,7 +161,7 @@ bool\ ucl_parser_add_string\ (struct\ uc .PP This function acts exactly like \f[C]ucl_parser_add_chunk\f[] does but if \f[C]len\f[] argument is zero, then the string \f[C]data\f[] must be -zero-terminated and the actual length is calculated up to \f[C]\\0\f[] +zero\-terminated and the actual length is calculated up to \f[C]\\0\f[] character. .SS ucl_parser_add_file .IP @@ -229,7 +229,7 @@ bool\ ucl_pubkey_add\ (struct\ ucl_parse This function adds a public key from text blob \f[C]key\f[] of length \f[C]len\f[] to the \f[C]parser\f[] object. This public key should be in the \f[C]PEM\f[] format and can be used by -\f[C].includes\f[] macro for checking signatures of files included. +\f[C]\&.includes\f[] macro for checking signatures of files included. \f[C]Openssl\f[] support should be enabled to make this function working. If a key cannot be added (e.g. @@ -247,25 +247,26 @@ bool\ ucl_parser_set_filevars\ (struct\ Add the standard file variables to the \f[C]parser\f[] based on the \f[C]filename\f[] specified: .IP \[bu] 2 -\f[C]$FILENAME\f[] - a filename of \f[C]ucl\f[] input +\f[C]$FILENAME\f[] \- a filename of \f[C]ucl\f[] input .IP \[bu] 2 -\f[C]$CURDIR\f[] - a current directory of the input +\f[C]$CURDIR\f[] \- a current directory of the input .PP -For example, if a \f[C]filename\f[] param is \f[C]../something.conf\f[] -then the variables will have the following values: +For example, if a \f[C]filename\f[] param is +\f[C]\&../something.conf\f[] then the variables will have the following +values: .IP \[bu] 2 -\f[C]$FILENAME\f[] - "../something.conf" +\f[C]$FILENAME\f[] \- "../something.conf" .IP \[bu] 2 -\f[C]$CURDIR\f[] - ".." +\f[C]$CURDIR\f[] \- ".." .PP if \f[C]need_expand\f[] parameter is \f[C]true\f[] then all relative paths are expanded using \f[C]realpath\f[] call. -In this example if \f[C]..\f[] is \f[C]/etc/dir\f[] then variables will -have these values: +In this example if \f[C]\&..\f[] is \f[C]/etc/dir\f[] then variables +will have these values: .IP \[bu] 2 -\f[C]$FILENAME\f[] - "/etc/something.conf" +\f[C]$FILENAME\f[] \- "/etc/something.conf" .IP \[bu] 2 -\f[C]$CURDIR\f[] - "/etc" +\f[C]$CURDIR\f[] \- "/etc" .SS Parser usage example .PP The following example loads, parses and extracts \f[C]ucl\f[] object @@ -283,7 +284,7 @@ FILE\ *in; in\ =\ stdin; parser\ =\ ucl_parser_new\ (0); while\ (!feof\ (in)\ &&\ r\ <\ (int)sizeof\ (inbuf))\ { -\ \ \ \ r\ +=\ fread\ (inbuf\ +\ r,\ 1,\ sizeof\ (inbuf)\ -\ r,\ in); +\ \ \ \ r\ +=\ fread\ (inbuf\ +\ r,\ 1,\ sizeof\ (inbuf)\ \-\ r,\ in); } ucl_parser_add_chunk\ (parser,\ inbuf,\ r); fclose\ (in); @@ -309,20 +310,20 @@ return\ ret; .PP Libucl can transform UCL objects to a number of tectual formats: .IP \[bu] 2 -configuration (\f[C]UCL_EMIT_CONFIG\f[]) - nginx like human readable +configuration (\f[C]UCL_EMIT_CONFIG\f[]) \- nginx like human readable configuration file where implicit arrays are transformed to the duplicate keys .IP \[bu] 2 -compact json: \f[C]UCL_EMIT_JSON_COMPACT\f[] - single line valid json +compact json: \f[C]UCL_EMIT_JSON_COMPACT\f[] \- single line valid json without spaces .IP \[bu] 2 -formatted json: \f[C]UCL_EMIT_JSON\f[] - pretty formatted JSON with +formatted json: \f[C]UCL_EMIT_JSON\f[] \- pretty formatted JSON with newlines and spaces .IP \[bu] 2 -compact yaml: \f[C]UCL_EMIT_YAML\f[] - compact YAML output +compact yaml: \f[C]UCL_EMIT_YAML\f[] \- compact YAML output .PP Moreover, libucl API allows to select a custom set of emitting functions -allowing efficent and zero-copy output of libucl objects. +allowing efficent and zero\-copy output of libucl objects. Libucl uses the following structure to support this feature: .IP .nf @@ -344,17 +345,17 @@ struct\ ucl_emitter_functions\ { .PP This structure defines the following callbacks: .IP \[bu] 2 -\f[C]ucl_emitter_append_character\f[] - a function that is called to +\f[C]ucl_emitter_append_character\f[] \- a function that is called to append \f[C]nchars\f[] characters equal to \f[C]c\f[] .IP \[bu] 2 -\f[C]ucl_emitter_append_len\f[] - used to append a string of length +\f[C]ucl_emitter_append_len\f[] \- used to append a string of length \f[C]len\f[] starting from pointer \f[C]str\f[] .IP \[bu] 2 -\f[C]ucl_emitter_append_int\f[] - this function applies to integer +\f[C]ucl_emitter_append_int\f[] \- this function applies to integer numbers .IP \[bu] 2 -\f[C]ucl_emitter_append_double\f[] - this function is intended to output -floating point variable +\f[C]ucl_emitter_append_double\f[] \- this function is intended to +output floating point variable .PP The set of these functions could be used to output text formats of \f[C]UCL\f[] objects to different structures or streams. @@ -364,7 +365,7 @@ Libucl provides the following functions .IP .nf \f[C] -unsigned\ char\ *ucl_object_emit\ (ucl_object_t\ *obj,\ enum\ ucl_emitter\ emit_type); +unsigned\ char\ *ucl_object_emit\ (const\ ucl_object_t\ *obj,\ enum\ ucl_emitter\ emit_type); \f[] .fi .PP @@ -376,7 +377,7 @@ The caller should free the returned stri .IP .nf \f[C] -bool\ ucl_object_emit_full\ (ucl_object_t\ *obj,\ enum\ ucl_emitter\ emit_type, +bool\ ucl_object_emit_full\ (const\ ucl_object_t\ *obj,\ enum\ ucl_emitter\ emit_type, \ \ \ \ \ \ \ \ struct\ ucl_emitter_functions\ *emitter); \f[] .fi @@ -400,26 +401,26 @@ cannot be converted then some reasonable strings and 0 for numbers) .PP Also there is a single \f[C]ucl_object_tostring_forced\f[] function that -converts any UCL object (including compound types - arrays and objects) +converts any UCL object (including compound types \- arrays and objects) to a string representation. For compound and numeric types this function performs emitting to a compact json format actually. .PP Here is a list of all conversion functions: .IP \[bu] 2 -\f[C]ucl_object_toint\f[] - returns \f[C]int64_t\f[] of UCL object +\f[C]ucl_object_toint\f[] \- returns \f[C]int64_t\f[] of UCL object .IP \[bu] 2 -\f[C]ucl_object_todouble\f[] - returns \f[C]double\f[] of UCL object +\f[C]ucl_object_todouble\f[] \- returns \f[C]double\f[] of UCL object .IP \[bu] 2 -\f[C]ucl_object_toboolean\f[] - returns \f[C]bool\f[] of UCL object +\f[C]ucl_object_toboolean\f[] \- returns \f[C]bool\f[] of UCL object .IP \[bu] 2 -\f[C]ucl_object_tostring\f[] - returns \f[C]const\ char\ *\f[] of UCL +\f[C]ucl_object_tostring\f[] \- returns \f[C]const\ char\ *\f[] of UCL object (this string is NULL terminated) .IP \[bu] 2 -\f[C]ucl_object_tolstring\f[] - returns \f[C]const\ char\ *\f[] and +\f[C]ucl_object_tolstring\f[] \- returns \f[C]const\ char\ *\f[] and \f[C]size_t\f[] len of UCL object (string can be not NULL terminated) .IP \[bu] 2 -\f[C]ucl_object_tostring_forced\f[] - returns string representation of +\f[C]ucl_object_tostring_forced\f[] \- returns string representation of any UCL object .PP Strings returned by these pointers are associated with the UCL object @@ -448,26 +449,28 @@ ucl_object_t\ *\ ucl_object_typed_new\ ( \f[] .fi .PP -Create an object of a specified type: - \f[C]UCL_OBJECT\f[] - UCL object -- key/value pairs - \f[C]UCL_ARRAY\f[] - UCL array - \f[C]UCL_INT\f[] - -integer number - \f[C]UCL_FLOAT\f[] - floating point number - -\f[C]UCL_STRING\f[] - NULL terminated string - \f[C]UCL_BOOLEAN\f[] - -boolean value - \f[C]UCL_TIME\f[] - time value (floating point number of -seconds) - \f[C]UCL_USERDATA\f[] - opaque userdata pointer (may be used -in macros) - \f[C]UCL_NULL\f[] - null value +Create an object of a specified type: \- \f[C]UCL_OBJECT\f[] \- UCL +object \- key/value pairs \- \f[C]UCL_ARRAY\f[] \- UCL array \- +\f[C]UCL_INT\f[] \- integer number \- \f[C]UCL_FLOAT\f[] \- floating +point number \- \f[C]UCL_STRING\f[] \- NULL terminated string \- +\f[C]UCL_BOOLEAN\f[] \- boolean value \- \f[C]UCL_TIME\f[] \- time value +(floating point number of seconds) \- \f[C]UCL_USERDATA\f[] \- opaque +userdata pointer (may be used in macros) \- \f[C]UCL_NULL\f[] \- null +value .PP This object should be released by caller. .SS Primitive objects generation .PP Libucl provides the functions similar to inverse conversion functions -called with the specific C type: - \f[C]ucl_object_fromint\f[] - -converts \f[C]int64_t\f[] to UCL object - \f[C]ucl_object_fromdouble\f[] -- converts \f[C]double\f[] to UCL object - -\f[C]ucl_object_fromboolean\f[] - converts \f[C]bool\f[] to UCL object - -\f[C]ucl_object_fromstring\f[] - converts \f[C]const\ char\ *\f[] to UCL -object (this string is NULL terminated) - -\f[C]ucl_object_fromlstring\f[] - converts \f[C]const\ char\ *\f[] and -\f[C]size_t\f[] len to UCL object (string can be not NULL terminated) +called with the specific C type: \- \f[C]ucl_object_fromint\f[] \- +converts \f[C]int64_t\f[] to UCL object \- +\f[C]ucl_object_fromdouble\f[] \- converts \f[C]double\f[] to UCL object +\- \f[C]ucl_object_fromboolean\f[] \- converts \f[C]bool\f[] to UCL +object \- \f[C]ucl_object_fromstring\f[] \- converts +\f[C]const\ char\ *\f[] to UCL object (this string is NULL terminated) +\- \f[C]ucl_object_fromlstring\f[] \- converts \f[C]const\ char\ *\f[] +and \f[C]size_t\f[] len to UCL object (string can be not NULL +terminated) .PP Also there is a function to generate UCL object from a string performing various parsing or conversion operations called @@ -484,35 +487,35 @@ ucl_object_t\ *\ ucl_object_fromstring_c This function is used to convert a string \f[C]str\f[] of size \f[C]len\f[] to an UCL objects applying \f[C]flags\f[] conversions. If \f[C]len\f[] is equal to zero then a \f[C]str\f[] is assumed as -NULL-terminated. +NULL\-terminated. This function supports the following flags (a set of flags can be specified using logical \f[C]OR\f[] operation): .IP \[bu] 2 -\f[C]UCL_STRING_ESCAPE\f[] - perform JSON escape +\f[C]UCL_STRING_ESCAPE\f[] \- perform JSON escape .IP \[bu] 2 -\f[C]UCL_STRING_TRIM\f[] - trim leading and trailing whitespaces +\f[C]UCL_STRING_TRIM\f[] \- trim leading and trailing whitespaces .IP \[bu] 2 -\f[C]UCL_STRING_PARSE_BOOLEAN\f[] - parse passed string and detect +\f[C]UCL_STRING_PARSE_BOOLEAN\f[] \- parse passed string and detect boolean .IP \[bu] 2 -\f[C]UCL_STRING_PARSE_INT\f[] - parse passed string and detect integer +\f[C]UCL_STRING_PARSE_INT\f[] \- parse passed string and detect integer number .IP \[bu] 2 -\f[C]UCL_STRING_PARSE_DOUBLE\f[] - parse passed string and detect +\f[C]UCL_STRING_PARSE_DOUBLE\f[] \- parse passed string and detect integer or float number .IP \[bu] 2 -\f[C]UCL_STRING_PARSE_TIME\f[] - parse time values as floating point +\f[C]UCL_STRING_PARSE_TIME\f[] \- parse time values as floating point numbers .IP \[bu] 2 -\f[C]UCL_STRING_PARSE_NUMBER\f[] - parse passed string and detect number -(both float, integer and time types) +\f[C]UCL_STRING_PARSE_NUMBER\f[] \- parse passed string and detect +number (both float, integer and time types) .IP \[bu] 2 -\f[C]UCL_STRING_PARSE\f[] - parse passed string (and detect booleans, +\f[C]UCL_STRING_PARSE\f[] \- parse passed string (and detect booleans, numbers and time values) .IP \[bu] 2 -\f[C]UCL_STRING_PARSE_BYTES\f[] - assume that numeric multipliers are in -bytes notation, for example \f[C]10k\f[] means \f[C]10*1024\f[] and not -\f[C]10*1000\f[] as assumed without this flag +\f[C]UCL_STRING_PARSE_BYTES\f[] \- assume that numeric multipliers are +in bytes notation, for example \f[C]10k\f[] means \f[C]10*1024\f[] and +not \f[C]10*1000\f[] as assumed without this flag .PP If parsing operations fail then the resulting UCL object will be a \f[C]UCL_STRING\f[]. @@ -530,7 +533,7 @@ is a function \f[C]ucl_iterate_object\f[ .IP .nf \f[C] -ucl_object_t*\ ucl_iterate_object\ (ucl_object_t\ *obj,\ +const\ ucl_object_t*\ ucl_iterate_object\ (const\ ucl_object_t\ *obj,\ \ \ \ \ ucl_object_iter_t\ *iter,\ bool\ expand_values); \f[] .fi @@ -561,7 +564,7 @@ Here is an example of iteration over the .nf \f[C] ucl_object_iter_t\ it\ =\ NULL,\ it_obj\ =\ NULL; -ucl_object_t\ *cur,\ *tmp; +const\ ucl_object_t\ *cur,\ *tmp; /*\ Iterate\ over\ the\ object\ */ while\ ((obj\ =\ ucl_iterate_object\ (top,\ &it,\ true)))\ { @@ -584,13 +587,13 @@ This function is defined as following: .IP .nf \f[C] -bool\ ucl_object_validate\ (ucl_object_t\ *schema, -\ \ \ \ ucl_object_t\ *obj,\ struct\ ucl_schema_error\ *err); +bool\ ucl_object_validate\ (const\ ucl_object_t\ *schema, +\ \ \ \ const\ ucl_object_t\ *obj,\ struct\ ucl_schema_error\ *err); \f[] .fi .PP This function uses ucl object \f[C]schema\f[], that must be valid in -terms of \f[C]json-schema\f[] draft v4, to validate input object +terms of \f[C]json\-schema\f[] draft v4, to validate input object \f[C]obj\f[]. If this function returns \f[C]true\f[] then validation procedure has been succeed. Copied: stable/9/contrib/libucl/doc/pandoc.template (from r263648, head/contrib/libucl/doc/pandoc.template) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/contrib/libucl/doc/pandoc.template Sat Jul 19 23:57:36 2014 (r268897, copy of r263648, head/contrib/libucl/doc/pandoc.template) @@ -0,0 +1,12 @@ +% LIBUCL(5) Libucl manual +% Vsevolod Stakhov +% March 20, 2014 + +# Name + +**ucl_parser_new**, **ucl_parser_register_macro**, **ucl_parser_register_variable**, **ucl_parser_add_chunk**, **ucl_parser_add_string**, **ucl_parser_add_file**, **ucl_parser_get_object**, **ucl_parser_get_error**, **ucl_parser_free**, **ucl_pubkey_add**, **ucl_parser_set_filevars** - universal configuration library parser and utility functions + +# Library + +UCL library (libucl, -lucl) + Modified: stable/9/contrib/libucl/include/ucl.h ============================================================================== --- stable/9/contrib/libucl/include/ucl.h Sat Jul 19 23:44:57 2014 (r268896) +++ stable/9/contrib/libucl/include/ucl.h Sat Jul 19 23:57:36 2014 (r268897) @@ -81,6 +81,14 @@ extern "C" { #define UCL_WARN_UNUSED_RESULT #endif +#ifdef __GNUC__ +#define UCL_DEPRECATED(func) func __attribute__ ((deprecated)) +#elif defined(_MSC_VER) +#define UCL_DEPRECATED(func) __declspec(deprecated) func +#else +#define UCL_DEPRECATED(func) func +#endif + /** * @defgroup structures Structures and types * UCL defines several enumeration types used for error reporting or specifying flags and attributes. @@ -138,7 +146,8 @@ typedef enum ucl_emitter { */ typedef enum ucl_parser_flags { UCL_PARSER_KEY_LOWERCASE = 0x1, /**< Convert all keys to lower case */ - UCL_PARSER_ZEROCOPY = 0x2 /**< Parse input in zero-copy mode if possible */ + UCL_PARSER_ZEROCOPY = 0x2, /**< Parse input in zero-copy mode if possible */ + UCL_PARSER_NO_TIME = 0x4 /**< Do not parse time and treat time values as strings */ } ucl_parser_flags_t; /** @@ -150,11 +159,12 @@ typedef enum ucl_string_flags { UCL_STRING_PARSE_BOOLEAN = 0x4, /**< Parse passed string and detect boolean */ UCL_STRING_PARSE_INT = 0x8, /**< Parse passed string and detect integer number */ UCL_STRING_PARSE_DOUBLE = 0x10, /**< Parse passed string and detect integer or float number */ - UCL_STRING_PARSE_NUMBER = UCL_STRING_PARSE_INT|UCL_STRING_PARSE_DOUBLE , /**< + UCL_STRING_PARSE_TIME = 0x20, /**< Parse time strings */ + UCL_STRING_PARSE_NUMBER = UCL_STRING_PARSE_INT|UCL_STRING_PARSE_DOUBLE|UCL_STRING_PARSE_TIME, /**< Parse passed string and detect number */ UCL_STRING_PARSE = UCL_STRING_PARSE_BOOLEAN|UCL_STRING_PARSE_NUMBER, /**< Parse passed string (and detect booleans and numbers) */ - UCL_STRING_PARSE_BYTES = 0x20 /**< Treat numbers as bytes */ + UCL_STRING_PARSE_BYTES = 0x40 /**< Treat numbers as bytes */ } ucl_string_flags_t; /** @@ -206,51 +216,33 @@ typedef struct ucl_object_s { * @param obj CL object * @return zero terminated key */ -UCL_EXTERN char* ucl_copy_key_trash (ucl_object_t *obj); +UCL_EXTERN char* ucl_copy_key_trash (const ucl_object_t *obj); /** * Copy and return a string value of an object, returned key is zero-terminated * @param obj CL object * @return zero terminated string representation of object value */ -UCL_EXTERN char* ucl_copy_value_trash (ucl_object_t *obj); +UCL_EXTERN char* ucl_copy_value_trash (const ucl_object_t *obj); /** * Creates a new object * @return new object */ -static inline ucl_object_t* ucl_object_new (void) UCL_WARN_UNUSED_RESULT; -static inline ucl_object_t * -ucl_object_new (void) -{ - ucl_object_t *new; - new = malloc (sizeof (ucl_object_t)); - if (new != NULL) { - memset (new, 0, sizeof (ucl_object_t)); - new->ref = 1; - new->type = UCL_NULL; - } - return new; -} +UCL_EXTERN ucl_object_t* ucl_object_new (void) UCL_WARN_UNUSED_RESULT; /** * Create new object with type specified * @param type type of a new object * @return new object */ -static inline ucl_object_t* ucl_object_typed_new (unsigned int type) UCL_WARN_UNUSED_RESULT; -static inline ucl_object_t * -ucl_object_typed_new (unsigned int type) -{ - ucl_object_t *new; - new = malloc (sizeof (ucl_object_t)); - if (new != NULL) { - memset (new, 0, sizeof (ucl_object_t)); - new->ref = 1; - new->type = (type <= UCL_NULL ? type : UCL_NULL); - } - return new; -} +UCL_EXTERN ucl_object_t* ucl_object_typed_new (ucl_type_t type) UCL_WARN_UNUSED_RESULT; + +/** + * Return the type of an object + * @return the object type + */ +UCL_EXTERN ucl_type_t ucl_object_type (const ucl_object_t *obj); /** * Convert any string to an ucl object making the specified transformations @@ -267,11 +259,7 @@ UCL_EXTERN ucl_object_t * ucl_object_fro * @param str NULL terminated string, will be json escaped * @return new object */ -static inline ucl_object_t * -ucl_object_fromstring (const char *str) -{ - return ucl_object_fromstring_common (str, 0, UCL_STRING_ESCAPE); -} +UCL_EXTERN ucl_object_t *ucl_object_fromstring (const char *str) UCL_WARN_UNUSED_RESULT; /** * Create a UCL object from the specified string @@ -279,68 +267,29 @@ ucl_object_fromstring (const char *str) * @param len length of a string * @return new object */ -static inline ucl_object_t * -ucl_object_fromlstring (const char *str, size_t len) -{ - return ucl_object_fromstring_common (str, len, UCL_STRING_ESCAPE); -} +UCL_EXTERN ucl_object_t *ucl_object_fromlstring (const char *str, + size_t len) UCL_WARN_UNUSED_RESULT; /** * Create an object from an integer number * @param iv number * @return new object */ -static inline ucl_object_t * -ucl_object_fromint (int64_t iv) -{ - ucl_object_t *obj; - - obj = ucl_object_new (); - if (obj != NULL) { - obj->type = UCL_INT; - obj->value.iv = iv; - } - - return obj; -} +UCL_EXTERN ucl_object_t* ucl_object_fromint (int64_t iv) UCL_WARN_UNUSED_RESULT; *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***