From owner-svn-src-stable@FreeBSD.ORG Sun Nov 18 06:21:46 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4DA34DF4; Sun, 18 Nov 2012 06:21:46 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3204D8FC14; Sun, 18 Nov 2012 06:21:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAI6LkQB068558; Sun, 18 Nov 2012 06:21:46 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAI6LkxT068557; Sun, 18 Nov 2012 06:21:46 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211180621.qAI6LkxT068557@svn.freebsd.org> From: Eitan Adler Date: Sun, 18 Nov 2012 06:21:46 +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: r243210 - stable/9/usr.sbin/ndiscvt X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2012 06:21:46 -0000 Author: eadler Date: Sun Nov 18 06:21:45 2012 New Revision: 243210 URL: http://svnweb.freebsd.org/changeset/base/243210 Log: MFC r243074: Add a missing check for fread Approved by: cperciva (implicit) Modified: stable/9/usr.sbin/ndiscvt/ndiscvt.c Directory Properties: stable/9/usr.sbin/ndiscvt/ (props changed) Modified: stable/9/usr.sbin/ndiscvt/ndiscvt.c ============================================================================== --- stable/9/usr.sbin/ndiscvt/ndiscvt.c Sun Nov 18 05:19:08 2012 (r243209) +++ stable/9/usr.sbin/ndiscvt/ndiscvt.c Sun Nov 18 06:21:45 2012 (r243210) @@ -325,6 +325,8 @@ main(int argc, char *argv[]) rewind (fp); img = calloc(fsize, 1); n = fread (img, fsize, 1, fp); + if (n == 0) + err(1, "reading .SYS file '%s' failed", sysfile); fclose(fp); From owner-svn-src-stable@FreeBSD.ORG Sun Nov 18 06:25:38 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 44278F73; Sun, 18 Nov 2012 06:25:38 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 284FB8FC12; Sun, 18 Nov 2012 06:25:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAI6Pc4S069155; Sun, 18 Nov 2012 06:25:38 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAI6PcYX069154; Sun, 18 Nov 2012 06:25:38 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211180625.qAI6PcYX069154@svn.freebsd.org> From: Eitan Adler Date: Sun, 18 Nov 2012 06:25:37 +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: r243211 - stable/9/usr.bin/bc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2012 06:25:38 -0000 Author: eadler Date: Sun Nov 18 06:25:37 2012 New Revision: 243211 URL: http://svnweb.freebsd.org/changeset/base/243211 Log: MFC r243075: Make definition match declaration Approved by: cperciva (implicit) Modified: stable/9/usr.bin/bc/bc.y Directory Properties: stable/9/usr.bin/bc/ (props changed) Modified: stable/9/usr.bin/bc/bc.y ============================================================================== --- stable/9/usr.bin/bc/bc.y Sun Nov 18 06:21:45 2012 (r243210) +++ stable/9/usr.bin/bc/bc.y Sun Nov 18 06:25:37 2012 (r243211) @@ -1085,7 +1085,7 @@ escape(const char *str) } /* ARGSUSED */ -void +static void sigchld(int signo) { pid_t pid; From owner-svn-src-stable@FreeBSD.ORG Sun Nov 18 07:08:56 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C8EAD3D7; Sun, 18 Nov 2012 07:08:56 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 467E08FC08; Sun, 18 Nov 2012 07:08:56 +0000 (UTC) Received: from tom.home (localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id qAI78la8033279; Sun, 18 Nov 2012 09:08:47 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.1 kib.kiev.ua qAI78la8033279 Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id qAI78l2T033278; Sun, 18 Nov 2012 09:08:47 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 18 Nov 2012 09:08:47 +0200 From: Konstantin Belousov To: Eitan Adler Subject: Re: svn commit: r243210 - stable/9/usr.sbin/ndiscvt Message-ID: <20121118070847.GF73505@kib.kiev.ua> References: <201211180621.qAI6LkxT068557@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="c2/+NrNR1GxQl8IM" Content-Disposition: inline In-Reply-To: <201211180621.qAI6LkxT068557@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=0.2 required=5.0 tests=ALL_TRUSTED, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2012 07:08:56 -0000 --c2/+NrNR1GxQl8IM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 18, 2012 at 06:21:46AM +0000, Eitan Adler wrote: > Author: eadler > Date: Sun Nov 18 06:21:45 2012 > New Revision: 243210 > URL: http://svnweb.freebsd.org/changeset/base/243210 >=20 > Log: > MFC r243074: > Add a missing check for fread > =20 > Approved by: cperciva (implicit) >=20 > Modified: > stable/9/usr.sbin/ndiscvt/ndiscvt.c > Directory Properties: > stable/9/usr.sbin/ndiscvt/ (props changed) >=20 > Modified: stable/9/usr.sbin/ndiscvt/ndiscvt.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 > --- stable/9/usr.sbin/ndiscvt/ndiscvt.c Sun Nov 18 05:19:08 2012 (r243209) > +++ stable/9/usr.sbin/ndiscvt/ndiscvt.c Sun Nov 18 06:21:45 2012 (r243210) > @@ -325,6 +325,8 @@ main(int argc, char *argv[]) > rewind (fp); > img =3D calloc(fsize, 1); > n =3D fread (img, fsize, 1, fp); > + if (n =3D=3D 0) > + err(1, "reading .SYS file '%s' failed", sysfile); > =20 AFAIR fread(3) can return 0 both for error and EOF. In the later case, errno is meaningless. Is the short read case fatal ? --c2/+NrNR1GxQl8IM Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJQqIl/AAoJEJDCuSvBvK1BNisP/iLBDmFpziiVTU8dGl+cSQ5J VV7XKVr5Njf157JMbE8oFoylc1xGosj3pEJDi4KAnjsRwT244AaMqexeN5WyJ1Gx tL2xr+cM/oz8VGUnhdgVf+fZOg04o4l2nxMNDCI5y5GMrHMuO4nvJ9kZ81rO2JX8 ZH11HdHcbT/IVVHfEl90e+XRpqF0O8i1mf2HB9TOHQJolRLJqF/XUE+PAvqS5rQb E+xGTeOgw3dbUgkY8Jteg0T6iDSLaxmHBfkVkOCKQWfVjfIAWJ35tg5SYMIVzy7q Wjwo9PmNm8N8RKP9VTf3GupbHXU2C1fjWtcNNjLuj5aLm++EQpMp66mS3/eZCGkU ZfwVjVCd37Oq0jHmYrtFm0MVg3ZuiU7xaqtCJnDn8d8vmoh5mqhxzCjslcitiQ4V 7hizRE8gXF8npj4RiYo7DeeKV03Vh0XTIZq5UHzv6P0ldHLQq6X6yZT+GWDk202s iqu5eK6Drsd8YcKyBAfvsxj1hs6KWEbhbkuIL7jLhRGDwuER1iEKR1bL1M26ssmy 0aWrWa7TzSTXYgP221hQjQfQEK7MTJSCjGSnlzHj00rjfh+mXvXDN4u2IWwnYup+ UaFTafyLG3njNrKK2GyTWTiG/27yVs9aq3nIbqPEj+qooT18s1boinT/ED8Sz8bD EWvREYpCvfmtIuhZ/z1S =gwVz -----END PGP SIGNATURE----- --c2/+NrNR1GxQl8IM-- From owner-svn-src-stable@FreeBSD.ORG Sun Nov 18 12:16:51 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5D203665; Sun, 18 Nov 2012 12:16:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3C8438FC12; Sun, 18 Nov 2012 12:16:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAICGpoH021406; Sun, 18 Nov 2012 12:16:51 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAICGpmO021405; Sun, 18 Nov 2012 12:16:51 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211181216.qAICGpmO021405@svn.freebsd.org> From: Andriy Gapon Date: Sun, 18 Nov 2012 12:16:51 +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: r243214 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2012 12:16:51 -0000 Author: avg Date: Sun Nov 18 12:16:50 2012 New Revision: 243214 URL: http://svnweb.freebsd.org/changeset/base/243214 Log: MFC r242566: zfs_freebsd_close: call zfs_close with count=1 instead of count=0 Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Nov 18 11:47:25 2012 (r243213) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Nov 18 12:16:50 2012 (r243214) @@ -5660,7 +5660,7 @@ zfs_freebsd_close(ap) } */ *ap; { - return (zfs_close(ap->a_vp, ap->a_fflag, 0, 0, ap->a_cred, NULL)); + return (zfs_close(ap->a_vp, ap->a_fflag, 1, 0, ap->a_cred, NULL)); } static int From owner-svn-src-stable@FreeBSD.ORG Sun Nov 18 12:17:14 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BC9AF8BC; Sun, 18 Nov 2012 12:17:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 909AC8FC08; Sun, 18 Nov 2012 12:17:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAICHDsm021547; Sun, 18 Nov 2012 12:17:13 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAICHDUH021545; Sun, 18 Nov 2012 12:17:13 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211181217.qAICHDUH021545@svn.freebsd.org> From: Andriy Gapon Date: Sun, 18 Nov 2012 12:17:13 +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: r243216 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2012 12:17:14 -0000 Author: avg Date: Sun Nov 18 12:17:13 2012 New Revision: 243216 URL: http://svnweb.freebsd.org/changeset/base/243216 Log: MFC r242566: zfs_freebsd_close: call zfs_close with count=1 instead of count=0 Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Nov 18 12:17:07 2012 (r243215) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Nov 18 12:17:13 2012 (r243216) @@ -5660,7 +5660,7 @@ zfs_freebsd_close(ap) } */ *ap; { - return (zfs_close(ap->a_vp, ap->a_fflag, 0, 0, ap->a_cred, NULL)); + return (zfs_close(ap->a_vp, ap->a_fflag, 1, 0, ap->a_cred, NULL)); } static int From owner-svn-src-stable@FreeBSD.ORG Sun Nov 18 12:20:12 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 04E08C20; Sun, 18 Nov 2012 12:20:12 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DCB818FC08; Sun, 18 Nov 2012 12:20:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAICKBJm022077; Sun, 18 Nov 2012 12:20:11 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAICKBhE022076; Sun, 18 Nov 2012 12:20:11 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211181220.qAICKBhE022076@svn.freebsd.org> From: Andriy Gapon Date: Sun, 18 Nov 2012 12:20:11 +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: r243217 - stable/9/sys/boot/i386/common X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2012 12:20:12 -0000 Author: avg Date: Sun Nov 18 12:20:11 2012 New Revision: 243217 URL: http://svnweb.freebsd.org/changeset/base/243217 Log: MFC r243025: boot: use packed attribute for edd_params* structures Modified: stable/9/sys/boot/i386/common/edd.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/i386/common/edd.h ============================================================================== --- stable/9/sys/boot/i386/common/edd.h Sun Nov 18 12:17:13 2012 (r243216) +++ stable/9/sys/boot/i386/common/edd.h Sun Nov 18 12:20:11 2012 (r243217) @@ -62,7 +62,7 @@ struct edd_params { uint16_t sector_size; uint16_t edd_params_seg; uint16_t edd_params_off; -}; +} __packed; struct edd_device_path_v3 { uint16_t key; @@ -74,12 +74,12 @@ struct edd_device_path_v3 { uint64_t device_path; uint8_t reserved2[1]; uint8_t checksum; -}; +} __packed; struct edd_params_v3 { struct edd_params params; struct edd_device_path_v3 device_path; -}; +} __packed; struct edd_device_path_v4 { uint16_t key; @@ -91,12 +91,12 @@ struct edd_device_path_v4 { uint64_t device_path[2]; uint8_t reserved2[1]; uint8_t checksum; -}; +} __packed; struct edd_params_v4 { struct edd_params params; struct edd_device_path_v4 device_path; -}; +} __packed; #define EDD_FLAGS_DMA_BOUNDARY_HANDLING 0x0001 #define EDD_FLAGS_REMOVABLE_MEDIA 0x0002 From owner-svn-src-stable@FreeBSD.ORG Sun Nov 18 12:20:23 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D6CBCDEB; Sun, 18 Nov 2012 12:20:23 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BC2CE8FC14; Sun, 18 Nov 2012 12:20:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAICKN6d022202; Sun, 18 Nov 2012 12:20:23 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAICKNTI022201; Sun, 18 Nov 2012 12:20:23 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211181220.qAICKNTI022201@svn.freebsd.org> From: Andriy Gapon Date: Sun, 18 Nov 2012 12:20:23 +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: r243218 - stable/8/sys/boot/i386/common X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2012 12:20:23 -0000 Author: avg Date: Sun Nov 18 12:20:23 2012 New Revision: 243218 URL: http://svnweb.freebsd.org/changeset/base/243218 Log: MFC r243025: boot: use packed attribute for edd_params* structures Modified: stable/8/sys/boot/i386/common/edd.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/boot/ (props changed) Modified: stable/8/sys/boot/i386/common/edd.h ============================================================================== --- stable/8/sys/boot/i386/common/edd.h Sun Nov 18 12:20:11 2012 (r243217) +++ stable/8/sys/boot/i386/common/edd.h Sun Nov 18 12:20:23 2012 (r243218) @@ -62,7 +62,7 @@ struct edd_params { uint16_t sector_size; uint16_t edd_params_seg; uint16_t edd_params_off; -}; +} __packed; struct edd_device_path_v3 { uint16_t key; @@ -74,12 +74,12 @@ struct edd_device_path_v3 { uint64_t device_path; uint8_t reserved2[1]; uint8_t checksum; -}; +} __packed; struct edd_params_v3 { struct edd_params params; struct edd_device_path_v3 device_path; -}; +} __packed; struct edd_device_path_v4 { uint16_t key; @@ -91,12 +91,12 @@ struct edd_device_path_v4 { uint64_t device_path[2]; uint8_t reserved2[1]; uint8_t checksum; -}; +} __packed; struct edd_params_v4 { struct edd_params params; struct edd_device_path_v4 device_path; -}; +} __packed; #define EDD_FLAGS_DMA_BOUNDARY_HANDLING 0x0001 #define EDD_FLAGS_REMOVABLE_MEDIA 0x0002 From owner-svn-src-stable@FreeBSD.ORG Sun Nov 18 12:28:29 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B7D46181; Sun, 18 Nov 2012 12:28:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9C3098FC08; Sun, 18 Nov 2012 12:28:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAICSTF0023518; Sun, 18 Nov 2012 12:28:29 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAICSTHS023514; Sun, 18 Nov 2012 12:28:29 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211181228.qAICSTHS023514@svn.freebsd.org> From: Andriy Gapon Date: Sun, 18 Nov 2012 12:28:29 +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: r243219 - in stable/9/sys/boot: ficl i386 userboot/ficl zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2012 12:28:29 -0000 Author: avg Date: Sun Nov 18 12:28:29 2012 New Revision: 243219 URL: http://svnweb.freebsd.org/changeset/base/243219 Log: MFC r241785: boot: use -march=i386 for both i386 and amd64 builds Modified: stable/9/sys/boot/ficl/Makefile stable/9/sys/boot/i386/Makefile.inc stable/9/sys/boot/userboot/ficl/Makefile stable/9/sys/boot/zfs/Makefile Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/ficl/Makefile ============================================================================== --- stable/9/sys/boot/ficl/Makefile Sun Nov 18 12:20:23 2012 (r243218) +++ stable/9/sys/boot/ficl/Makefile Sun Nov 18 12:28:29 2012 (r243219) @@ -8,6 +8,7 @@ SRCS= ${BASE_SRCS} sysdep.c softcore.c CLEANFILES= softcore.c testmain testmain.o CFLAGS+= -ffreestanding .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +CFLAGS+= -march=i386 CFLAGS+= -mpreferred-stack-boundary=2 CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float .endif @@ -39,7 +40,7 @@ SOFTWORDS= softcore.fr jhlocal.fr marker #SOFTWORDS+= oo.fr classes.fr .if ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -m32 -march=i386 -I. +CFLAGS+= -m32 -I. .endif .if ${MACHINE_ARCH} == "powerpc64" Modified: stable/9/sys/boot/i386/Makefile.inc ============================================================================== --- stable/9/sys/boot/i386/Makefile.inc Sun Nov 18 12:20:23 2012 (r243218) +++ stable/9/sys/boot/i386/Makefile.inc Sun Nov 18 12:28:29 2012 (r243219) @@ -5,12 +5,12 @@ BINDIR?= /boot LOADER_ADDRESS?=0x200000 -CFLAGS+= -ffreestanding -mpreferred-stack-boundary=2 \ +CFLAGS+= -march=i386 -ffreestanding -mpreferred-stack-boundary=2 \ -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float LDFLAGS+= -nostdlib .if ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -m32 -march=i386 +CFLAGS+= -m32 ACFLAGS+= -m32 LDFLAGS+= -m elf_i386_fbsd AFLAGS+= --32 Modified: stable/9/sys/boot/userboot/ficl/Makefile ============================================================================== --- stable/9/sys/boot/userboot/ficl/Makefile Sun Nov 18 12:20:23 2012 (r243218) +++ stable/9/sys/boot/userboot/ficl/Makefile Sun Nov 18 12:28:29 2012 (r243219) @@ -12,6 +12,7 @@ SRCS= ${BASE_SRCS} sysdep.c softcore.c CLEANFILES= softcore.c testmain testmain.o CFLAGS+= -ffreestanding -fPIC .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +#CFLAGS+= -march=i386 CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 .endif .if ${MACHINE_CPUARCH} == "i386" @@ -46,7 +47,7 @@ SOFTWORDS= softcore.fr jhlocal.fr marker #SOFTWORDS+= oo.fr classes.fr #.if ${MACHINE_CPUARCH} == "amd64" -#CFLAGS+= -m32 -march=i386 -I. +#CFLAGS+= -m32 -I. #.endif .if ${MACHINE_ARCH} == "powerpc64" Modified: stable/9/sys/boot/zfs/Makefile ============================================================================== --- stable/9/sys/boot/zfs/Makefile Sun Nov 18 12:20:23 2012 (r243218) +++ stable/9/sys/boot/zfs/Makefile Sun Nov 18 12:28:29 2012 (r243219) @@ -12,6 +12,7 @@ CFLAGS+= -I${.CURDIR}/../../cddl/boot/zf CFLAGS+= -ffreestanding .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +CFLAGS+= -march=i386 CFLAGS+= -mpreferred-stack-boundary=2 CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float .endif @@ -19,7 +20,7 @@ CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -m CFLAGS+= -msoft-float .endif .if ${MACHINE_CPUARCH} == "amd64" -CFLAGS+= -m32 -march=i386 +CFLAGS+= -m32 .endif CFLAGS+= -Wformat -Wall From owner-svn-src-stable@FreeBSD.ORG Sun Nov 18 12:30:05 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 92FF32EC; Sun, 18 Nov 2012 12:30:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5DF068FC0C; Sun, 18 Nov 2012 12:30:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAICU5Y6023808; Sun, 18 Nov 2012 12:30:05 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAICU55p023804; Sun, 18 Nov 2012 12:30:05 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211181230.qAICU55p023804@svn.freebsd.org> From: Andriy Gapon Date: Sun, 18 Nov 2012 12:30:05 +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: r243220 - in stable/8/sys/boot: ficl i386 zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2012 12:30:05 -0000 Author: avg Date: Sun Nov 18 12:30:04 2012 New Revision: 243220 URL: http://svnweb.freebsd.org/changeset/base/243220 Log: MFC r241785: boot: use -march=i386 for both i386 and amd64 builds Modified: stable/8/sys/boot/ficl/Makefile stable/8/sys/boot/i386/Makefile.inc stable/8/sys/boot/zfs/Makefile Directory Properties: stable/8/sys/ (props changed) stable/8/sys/boot/ (props changed) Modified: stable/8/sys/boot/ficl/Makefile ============================================================================== --- stable/8/sys/boot/ficl/Makefile Sun Nov 18 12:28:29 2012 (r243219) +++ stable/8/sys/boot/ficl/Makefile Sun Nov 18 12:30:04 2012 (r243220) @@ -8,6 +8,7 @@ SRCS= ${BASE_SRCS} sysdep.c softcore.c CLEANFILES= softcore.c testmain testmain.o CFLAGS+= -ffreestanding .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" +CFLAGS+= -march=i386 CFLAGS+= -mpreferred-stack-boundary=2 CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 .endif @@ -42,7 +43,7 @@ SOFTWORDS= softcore.fr jhlocal.fr marker #SOFTWORDS+= oo.fr classes.fr .if ${MACHINE_ARCH} == "amd64" -CFLAGS+= -m32 -march=i386 -I. +CFLAGS+= -m32 -I. .endif CFLAGS+= -I${.CURDIR} -I${.CURDIR}/${MACHINE_ARCH:S/amd64/i386/} \ Modified: stable/8/sys/boot/i386/Makefile.inc ============================================================================== --- stable/8/sys/boot/i386/Makefile.inc Sun Nov 18 12:28:29 2012 (r243219) +++ stable/8/sys/boot/i386/Makefile.inc Sun Nov 18 12:30:04 2012 (r243220) @@ -5,12 +5,12 @@ BINDIR?= /boot LOADER_ADDRESS?=0x200000 -CFLAGS+= -ffreestanding -mpreferred-stack-boundary=2 \ +CFLAGS+= -march=i386 -ffreestanding -mpreferred-stack-boundary=2 \ -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 LDFLAGS+= -nostdlib .if ${MACHINE_ARCH} == "amd64" -CFLAGS+= -m32 -march=i386 +CFLAGS+= -m32 LDFLAGS+= -m elf_i386_fbsd AFLAGS+= --32 .endif Modified: stable/8/sys/boot/zfs/Makefile ============================================================================== --- stable/8/sys/boot/zfs/Makefile Sun Nov 18 12:28:29 2012 (r243219) +++ stable/8/sys/boot/zfs/Makefile Sun Nov 18 12:30:04 2012 (r243220) @@ -12,6 +12,7 @@ CFLAGS+= -I${.CURDIR}/../../cddl/boot/zf CFLAGS+= -ffreestanding .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" +CFLAGS+= -march=i386 CFLAGS+= -mpreferred-stack-boundary=2 CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 .endif @@ -22,7 +23,7 @@ CFLAGS+= -mno-sse3 CFLAGS+= -msoft-float .endif .if ${MACHINE_ARCH} == "amd64" -CFLAGS+= -m32 -march=i386 +CFLAGS+= -m32 .endif CFLAGS+= -Wformat -Wall From owner-svn-src-stable@FreeBSD.ORG Sun Nov 18 16:07:54 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4865C3CB; Sun, 18 Nov 2012 16:07:54 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 23CA98FC08; Sun, 18 Nov 2012 16:07:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAIG7sY9060393; Sun, 18 Nov 2012 16:07:54 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAIG7rKK060389; Sun, 18 Nov 2012 16:07:53 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201211181607.qAIG7rKK060389@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 18 Nov 2012 16:07:53 +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: r243236 - stable/9/sys/boot/uboot/lib X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2012 16:07:54 -0000 Author: ae Date: Sun Nov 18 16:07:53 2012 New Revision: 243236 URL: http://svnweb.freebsd.org/changeset/base/243236 Log: MFC r234860 (by kientzle): Teach ubldr(8) about simple MBR partitioning. Modified: stable/9/sys/boot/uboot/lib/devicename.c stable/9/sys/boot/uboot/lib/disk.c stable/9/sys/boot/uboot/lib/libuboot.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/uboot/lib/devicename.c ============================================================================== --- stable/9/sys/boot/uboot/lib/devicename.c Sun Nov 18 16:06:51 2012 (r243235) +++ stable/9/sys/boot/uboot/lib/devicename.c Sun Nov 18 16:07:53 2012 (r243236) @@ -131,6 +131,10 @@ uboot_parsedev(struct uboot_devdesc **de *(cp + 1) != ':') { pnum = strtol(cp + 1, &cp, 10); ptype = PTYPE_GPT; + } else if (*cp == 's' && *(cp + 1) && + *(cp + 1) != ':') { + pnum = strtol(cp + 1, &cp, 10); + ptype = PTYPE_MBR; } else { pnum = *cp - 'a'; ptype = PTYPE_BSDLABEL; @@ -218,6 +222,9 @@ uboot_fmtdev(void *vdev) else if (dev->d_kind.disk.ptype == PTYPE_GPT) cp += sprintf(cp, "p%i", dev->d_kind.disk.pnum); + else if (dev->d_kind.disk.ptype == PTYPE_MBR) + cp += sprintf(cp, "s%i", + dev->d_kind.disk.pnum); } strcat(cp, ":"); Modified: stable/9/sys/boot/uboot/lib/disk.c ============================================================================== --- stable/9/sys/boot/uboot/lib/disk.c Sun Nov 18 16:06:51 2012 (r243235) +++ stable/9/sys/boot/uboot/lib/disk.c Sun Nov 18 16:07:53 2012 (r243236) @@ -398,6 +398,94 @@ out: } static int +stor_open_mbr(struct open_dev *od, struct uboot_devdesc *dev) +{ + char *buf = NULL; + struct dos_partition *dp; + int err, i, part; + + od->od_nparts = 0; + od->od_partitions = NULL; + + /* Block size must be at least 512 bytes. */ + if (od->od_bsize < 512) + return (ENXIO); + + /* Read MBR */ + buf = malloc(od->od_bsize); + if (!buf) { + stor_printf("could not allocate memory for MBR\n"); + return (ENOMEM); + } + err = stor_readdev(dev, 0, 1, buf); + if (err) { + stor_printf("MBR read error=%d\n", err); + err = EIO; + goto out; + } + + /* Check the slice table magic. */ + if (le16toh(*((uint16_t *)(buf + DOSMAGICOFFSET))) != DOSMAGIC) { + err = ENXIO; + goto out; + } + + /* Save information about partitions. */ + dp = (struct dos_partition *)(buf + DOSPARTOFF); + od->od_partitions = calloc(NDOSPART, sizeof(struct gpt_part)); + if (!od->od_partitions) { + stor_printf("could not allocate memory for MBR partitions\n"); + err = ENOMEM; + goto out; + } + + part = 0; + for (i = 0; i < NDOSPART; i++) { + u_int32_t start = le32dec(&dp[i].dp_start); + u_int32_t size = le32dec(&dp[i].dp_size); + uuid_t *u = NULL; + + /* Map MBR partition types to GPT partition types. */ + switch (dp[i].dp_typ) { + case DOSPTYP_386BSD: + u = &freebsd_ufs; + break; + /* XXX Other types XXX */ + } + + if (u) { + od->od_partitions[part].gp_type = *u; + od->od_partitions[part].gp_index = i + 1; + od->od_partitions[part].gp_start = start; + od->od_partitions[part].gp_end = start + size; + part += 1; + } + } + od->od_nparts = part; + + if (od->od_nparts == 0) { + err = EINVAL; + goto out; + } + + dev->d_disk.ptype = PTYPE_MBR; + + /* XXX Be smarter here? XXX */ + if (dev->d_disk.pnum == 0) + dev->d_disk.pnum = od->od_partitions[0].gp_index; + + for (i = 0; i < od->od_nparts; i++) + if (od->od_partitions[i].gp_index == dev->d_disk.pnum) + od->od_bstart = od->od_partitions[i].gp_start; + +out: + if (err && od->od_partitions) + free(od->od_partitions); + free(buf); + return (err); +} + +static int stor_open_bsdlabel(struct open_dev *od, struct uboot_devdesc *dev) { char *buf; @@ -443,7 +531,7 @@ stor_readdev(struct uboot_devdesc *dev, lbasize_t real_size; int err, handle; - debugf("reading size=%d @ 0x%08x\n", size, (uint32_t)buf); + debugf("reading blk=%d size=%d @ 0x%08x\n", (int)blk, size, (uint32_t)buf); handle = stor_info[dev->d_unit]; err = ub_dev_read(handle, buf, size, blk, &real_size); @@ -495,7 +583,10 @@ stor_opendev(struct open_dev **odp, stru od->od_bsize = di->di_stor.block_size; od->od_bstart = 0; - if ((err = stor_open_gpt(od, dev)) != 0) + err = stor_open_gpt(od, dev); + if (err != 0) + err = stor_open_mbr(od, dev); + if (err != 0) err = stor_open_bsdlabel(od, dev); if (err != 0) @@ -517,6 +608,8 @@ stor_closedev(struct uboot_devdesc *dev) od = (struct open_dev *)dev->d_disk.data; if (dev->d_disk.ptype == PTYPE_GPT && od->od_nparts != 0) free(od->od_partitions); + if (dev->d_disk.ptype == PTYPE_MBR && od->od_nparts != 0) + free(od->od_partitions); free(od); dev->d_disk.data = NULL; Modified: stable/9/sys/boot/uboot/lib/libuboot.h ============================================================================== --- stable/9/sys/boot/uboot/lib/libuboot.h Sun Nov 18 16:06:51 2012 (r243235) +++ stable/9/sys/boot/uboot/lib/libuboot.h Sun Nov 18 16:07:53 2012 (r243236) @@ -45,6 +45,7 @@ struct uboot_devdesc #define PTYPE_BSDLABEL 1 #define PTYPE_GPT 2 +#define PTYPE_MBR 3 /* * Default network packet alignment in memory From owner-svn-src-stable@FreeBSD.ORG Sun Nov 18 16:13:37 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0B330671; Sun, 18 Nov 2012 16:13:37 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E447A8FC1C; Sun, 18 Nov 2012 16:13:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAIGDatH061694; Sun, 18 Nov 2012 16:13:36 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAIGDaEu061683; Sun, 18 Nov 2012 16:13:36 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201211181613.qAIGDaEu061683@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 18 Nov 2012 16:13: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: r243237 - in stable/9/sys: geom/part sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2012 16:13:37 -0000 Author: ae Date: Sun Nov 18 16:13:36 2012 New Revision: 243237 URL: http://svnweb.freebsd.org/changeset/base/243237 Log: MFC r236023 (by marcel): Add a partition type for nandfs to the apm, bsd, gpt and vtoc8 schemes. The gpart alias for these partition types is "freebsd-nandfs". Modified: stable/9/sys/geom/part/g_part.c stable/9/sys/geom/part/g_part.h stable/9/sys/geom/part/g_part_apm.c stable/9/sys/geom/part/g_part_bsd.c stable/9/sys/geom/part/g_part_gpt.c stable/9/sys/geom/part/g_part_vtoc8.c stable/9/sys/sys/apm.h stable/9/sys/sys/disklabel.h stable/9/sys/sys/gpt.h stable/9/sys/sys/vtoc.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/part/g_part.c ============================================================================== --- stable/9/sys/geom/part/g_part.c Sun Nov 18 16:07:53 2012 (r243236) +++ stable/9/sys/geom/part/g_part.c Sun Nov 18 16:13:36 2012 (r243237) @@ -83,6 +83,7 @@ struct g_part_alias_list { { "fat32", G_PART_ALIAS_MS_FAT32 }, { "freebsd", G_PART_ALIAS_FREEBSD }, { "freebsd-boot", G_PART_ALIAS_FREEBSD_BOOT }, + { "freebsd-nandfs", G_PART_ALIAS_FREEBSD_NANDFS }, { "freebsd-swap", G_PART_ALIAS_FREEBSD_SWAP }, { "freebsd-ufs", G_PART_ALIAS_FREEBSD_UFS }, { "freebsd-vinum", G_PART_ALIAS_FREEBSD_VINUM }, Modified: stable/9/sys/geom/part/g_part.h ============================================================================== --- stable/9/sys/geom/part/g_part.h Sun Nov 18 16:07:53 2012 (r243236) +++ stable/9/sys/geom/part/g_part.h Sun Nov 18 16:13:36 2012 (r243237) @@ -46,6 +46,7 @@ enum g_part_alias { G_PART_ALIAS_EFI, /* A EFI system partition entry. */ G_PART_ALIAS_FREEBSD, /* A BSD labeled partition entry. */ G_PART_ALIAS_FREEBSD_BOOT, /* A FreeBSD boot partition entry. */ + G_PART_ALIAS_FREEBSD_NANDFS, /* A FreeBSD nandfs partition entry. */ G_PART_ALIAS_FREEBSD_SWAP, /* A swap partition entry. */ G_PART_ALIAS_FREEBSD_UFS, /* A UFS/UFS2 file system entry. */ G_PART_ALIAS_FREEBSD_VINUM, /* A Vinum partition entry. */ Modified: stable/9/sys/geom/part/g_part_apm.c ============================================================================== --- stable/9/sys/geom/part/g_part_apm.c Sun Nov 18 16:07:53 2012 (r243236) +++ stable/9/sys/geom/part/g_part_apm.c Sun Nov 18 16:13:36 2012 (r243237) @@ -159,6 +159,11 @@ apm_parse_type(const char *type, char *b strcpy(buf, APM_ENT_TYPE_FREEBSD); return (0); } + alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS); + if (!strcasecmp(type, alias)) { + strcpy(buf, APM_ENT_TYPE_FREEBSD_NANDFS); + return (0); + } alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP); if (!strcasecmp(type, alias)) { strcpy(buf, APM_ENT_TYPE_FREEBSD_SWAP); @@ -485,6 +490,8 @@ g_part_apm_type(struct g_part_table *bas return (g_part_alias_name(G_PART_ALIAS_APPLE_UFS)); if (!strcmp(type, APM_ENT_TYPE_FREEBSD)) return (g_part_alias_name(G_PART_ALIAS_FREEBSD)); + if (!strcmp(type, APM_ENT_TYPE_FREEBSD_NANDFS)) + return (g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS)); if (!strcmp(type, APM_ENT_TYPE_FREEBSD_SWAP)) return (g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP)); if (!strcmp(type, APM_ENT_TYPE_FREEBSD_UFS)) Modified: stable/9/sys/geom/part/g_part_bsd.c ============================================================================== --- stable/9/sys/geom/part/g_part_bsd.c Sun Nov 18 16:07:53 2012 (r243236) +++ stable/9/sys/geom/part/g_part_bsd.c Sun Nov 18 16:13:36 2012 (r243237) @@ -126,6 +126,11 @@ bsd_parse_type(const char *type, uint8_t *fstype = (u_int)lt; return (0); } + alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS); + if (!strcasecmp(type, alias)) { + *fstype = FS_NANDFS; + return (0); + } alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP); if (!strcasecmp(type, alias)) { *fstype = FS_SWAP; @@ -457,6 +462,8 @@ g_part_bsd_type(struct g_part_table *bas entry = (struct g_part_bsd_entry *)baseentry; type = entry->part.p_fstype; + if (type == FS_NANDFS) + return (g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS)); if (type == FS_SWAP) return (g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP)); if (type == FS_BSDFFS) Modified: stable/9/sys/geom/part/g_part_gpt.c ============================================================================== --- stable/9/sys/geom/part/g_part_gpt.c Sun Nov 18 16:07:53 2012 (r243236) +++ stable/9/sys/geom/part/g_part_gpt.c Sun Nov 18 16:13:36 2012 (r243237) @@ -155,6 +155,7 @@ static struct uuid gpt_uuid_bios_boot = static struct uuid gpt_uuid_efi = GPT_ENT_TYPE_EFI; static struct uuid gpt_uuid_freebsd = GPT_ENT_TYPE_FREEBSD; static struct uuid gpt_uuid_freebsd_boot = GPT_ENT_TYPE_FREEBSD_BOOT; +static struct uuid gpt_uuid_freebsd_nandfs = GPT_ENT_TYPE_FREEBSD_NANDFS; static struct uuid gpt_uuid_freebsd_swap = GPT_ENT_TYPE_FREEBSD_SWAP; static struct uuid gpt_uuid_freebsd_ufs = GPT_ENT_TYPE_FREEBSD_UFS; static struct uuid gpt_uuid_freebsd_vinum = GPT_ENT_TYPE_FREEBSD_VINUM; @@ -195,6 +196,7 @@ static struct g_part_uuid_alias { { &gpt_uuid_efi, G_PART_ALIAS_EFI, 0xee }, { &gpt_uuid_freebsd, G_PART_ALIAS_FREEBSD, 0xa5 }, { &gpt_uuid_freebsd_boot, G_PART_ALIAS_FREEBSD_BOOT, 0 }, + { &gpt_uuid_freebsd_nandfs, G_PART_ALIAS_FREEBSD_NANDFS, 0 }, { &gpt_uuid_freebsd_swap, G_PART_ALIAS_FREEBSD_SWAP, 0 }, { &gpt_uuid_freebsd_ufs, G_PART_ALIAS_FREEBSD_UFS, 0 }, { &gpt_uuid_freebsd_vinum, G_PART_ALIAS_FREEBSD_VINUM, 0 }, Modified: stable/9/sys/geom/part/g_part_vtoc8.c ============================================================================== --- stable/9/sys/geom/part/g_part_vtoc8.c Sun Nov 18 16:07:53 2012 (r243236) +++ stable/9/sys/geom/part/g_part_vtoc8.c Sun Nov 18 16:13:36 2012 (r243237) @@ -114,6 +114,11 @@ vtoc8_parse_type(const char *type, uint1 *tag = (uint16_t)lt; return (0); } + alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS); + if (!strcasecmp(type, alias)) { + *tag = VTOC_TAG_FREEBSD_NANDFS; + return (0); + } alias = g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP); if (!strcasecmp(type, alias)) { *tag = VTOC_TAG_FREEBSD_SWAP; @@ -487,6 +492,8 @@ g_part_vtoc8_type(struct g_part_table *b table = (struct g_part_vtoc8_table *)basetable; tag = be16dec(&table->vtoc.part[entry->gpe_index - 1].tag); + if (tag == VTOC_TAG_FREEBSD_NANDFS) + return (g_part_alias_name(G_PART_ALIAS_FREEBSD_NANDFS)); if (tag == VTOC_TAG_FREEBSD_SWAP) return (g_part_alias_name(G_PART_ALIAS_FREEBSD_SWAP)); if (tag == VTOC_TAG_FREEBSD_UFS) Modified: stable/9/sys/sys/apm.h ============================================================================== --- stable/9/sys/sys/apm.h Sun Nov 18 16:07:53 2012 (r243236) +++ stable/9/sys/sys/apm.h Sun Nov 18 16:13:36 2012 (r243237) @@ -56,6 +56,7 @@ struct apm_ent { #define APM_ENT_TYPE_UNUSED "Apple_Free" #define APM_ENT_TYPE_FREEBSD "FreeBSD" +#define APM_ENT_TYPE_FREEBSD_NANDFS "FreeBSD-nandfs" #define APM_ENT_TYPE_FREEBSD_SWAP "FreeBSD-swap" #define APM_ENT_TYPE_FREEBSD_UFS "FreeBSD-UFS" #define APM_ENT_TYPE_FREEBSD_VINUM "FreeBSD-Vinum" Modified: stable/9/sys/sys/disklabel.h ============================================================================== --- stable/9/sys/sys/disklabel.h Sun Nov 18 16:07:53 2012 (r243236) +++ stable/9/sys/sys/disklabel.h Sun Nov 18 16:13:36 2012 (r243237) @@ -232,6 +232,7 @@ static const char *dktypenames[] = { #define FS_UDF 24 /* UDF */ #define FS_EFS 26 /* SGI's Extent File system */ #define FS_ZFS 27 /* Sun's ZFS */ +#define FS_NANDFS 30 /* FreeBSD nandfs (NiLFS derived) */ #ifdef FSTYPENAMES static const char *fstypenames[] = { @@ -263,6 +264,9 @@ static const char *fstypenames[] = { "?", "EFS", "ZFS", + "?", + "?", + "nandfs", NULL }; #define FSMAXTYPES (sizeof(fstypenames) / sizeof(fstypenames[0]) - 1) Modified: stable/9/sys/sys/gpt.h ============================================================================== --- stable/9/sys/sys/gpt.h Sun Nov 18 16:07:53 2012 (r243236) +++ stable/9/sys/sys/gpt.h Sun Nov 18 16:13:36 2012 (r243237) @@ -79,6 +79,10 @@ struct gpt_ent { {0x024dee41,0x33e7,0x11d3,0x9d,0x69,{0x00,0x08,0xc7,0x81,0xf3,0x9f}} #define GPT_ENT_TYPE_FREEBSD \ {0x516e7cb4,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}} +#define GPT_ENT_TYPE_FREEBSD_BOOT \ + {0x83bd6b9d,0x7f41,0x11dc,0xbe,0x0b,{0x00,0x15,0x60,0xb8,0x4f,0x0f}} +#define GPT_ENT_TYPE_FREEBSD_NANDFS \ + {0x74ba7dd9,0xa689,0x11e1,0xbd,0x04,{0x00,0xe0,0x81,0x28,0x6a,0xcf}} #define GPT_ENT_TYPE_FREEBSD_SWAP \ {0x516e7cb5,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}} #define GPT_ENT_TYPE_FREEBSD_UFS \ @@ -87,8 +91,6 @@ struct gpt_ent { {0x516e7cb8,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}} #define GPT_ENT_TYPE_FREEBSD_ZFS \ {0x516e7cba,0x6ecf,0x11d6,0x8f,0xf8,{0x00,0x02,0x2d,0x09,0x71,0x2b}} -#define GPT_ENT_TYPE_FREEBSD_BOOT \ - {0x83bd6b9d,0x7f41,0x11dc,0xbe,0x0b,{0x00,0x15,0x60,0xb8,0x4f,0x0f}} /* * The following are unused but documented here to avoid reuse. Modified: stable/9/sys/sys/vtoc.h ============================================================================== --- stable/9/sys/sys/vtoc.h Sun Nov 18 16:07:53 2012 (r243236) +++ stable/9/sys/sys/vtoc.h Sun Nov 18 16:13:36 2012 (r243237) @@ -51,6 +51,7 @@ #define VTOC_TAG_FREEBSD_UFS 0x0902 #define VTOC_TAG_FREEBSD_VINUM 0x0903 #define VTOC_TAG_FREEBSD_ZFS 0x0904 +#define VTOC_TAG_FREEBSD_NANDFS 0x0905 #define VTOC_FLAG_UNMNT 0x01 /* unmountable partition */ #define VTOC_FLAG_RDONLY 0x10 /* partition is read/only */ From owner-svn-src-stable@FreeBSD.ORG Sun Nov 18 17:09:30 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 60589EAB; Sun, 18 Nov 2012 17:09:30 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4276E8FC08; Sun, 18 Nov 2012 17:09:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAIH9Uld072344; Sun, 18 Nov 2012 17:09:30 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAIH9UYN072337; Sun, 18 Nov 2012 17:09:30 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201211181709.qAIH9UYN072337@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 18 Nov 2012 17:09:30 +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: r243243 - in stable/9/sys/boot: arm/uboot common i386/libi386 i386/loader i386/pmbr powerpc/uboot sparc64/loader uboot/common uboot/lib userboot userboot/test userboot/userboot zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2012 17:09:30 -0000 Author: ae Date: Sun Nov 18 17:09:29 2012 New Revision: 243243 URL: http://svnweb.freebsd.org/changeset/base/243243 Log: MFC 239054,239057,239058,239060,239066,239067,239068,239070,239073, 239087,239088,239127,239210,239211,239230,239231,239232,239243, 239292,239293,239294,239325,240272,240273,240274,240275,240276, 240277,240335,240481,241023,241047,241053,241065,241068,241069, 241070,241164,241809,241876 239054: Create the interface to work with various partition tables from the loader(8). The following partition tables are supported: BSD label, GPT, MBR, EBR and VTOC8. 239057: Remove unused variables. 239058: Introduce new API to work with disks from the loader's drivers. It uses new API from the part.c to work with partition tables. 239060: When GPT signature is invalid in the primary GPT header, then try to read backup GPT header. 239066: Add offset field to the i386_devdesc structure to be compatible with disk_devdesc structure. Update biosdisk driver to the new disk API. 239067: Remove unneeded flag. 239068: Teach the ZFS use new partitions API when probing. Note: now ZFS does probe only for partitions with type "freebsd-zfs" and "freebsd". 239070: Add simple test program that uses the partition tables handling code. It is useful to test and debug how boot loader handles partition tables metadata. 239073: Bump USERBOOT_VERSION. 239087: Add to the debug output the offset from the parent partitioning scheme. 239088: Fix start offset calculation for the EBR partitions. 239127: As it turned out, there are some installations, where BSD label contains partitions with type zero. And it has worked. So, allow detect these partitions. 239210: Add more debug messages. 239211: Add another debug message. 239230: Unbreak booting from the true dedicated disks. When we open the disk, check the type of partition table, that has been detected. If this is BSD label, then we assume this is DD mode. 239231: Remove colons from the debug message, device name returned by the disk_fmtdev() already has the colons. 239232: Restore the old behaviour. If requested partition is a BSD slice, but d_partition isn't explicitly set, then try to open BSD label and its first partition. 239243: After r239066, reinitialize v86.ctl and v86.addr for int 13 EDD probing in sys/boot/i386/libi386/biosdisk.c. Otherwise, when DISK_DEBUG is enabled, the DEBUG() macros will clobber those fields, and cause the probing to always fail mysteriously when debugging is enabled. 239292: Explicitly terminate the string after strncpy(3). 239293: Rework r239232 to unbreak ZFS detection on MBR slices. 239294: Some BIOSes return incorrect number of sectors, make checks less strictly, to do not lost some partitions. 239325: Add comment why the code has been disabled. 240272: Make struct uboot_devdesc compatible with struct disk_devdesc. 240273: Use disk_fmtdev() and disk_parsedev() functions from the new DISK API. 240274: Update uboot's disk driver to use new DISK API. 240275: Build disk.c only when DISK_SUPPORT is enabled. 240276: Update according to the change of struct uboot_devdesc. 240277: Handle LOADER_NO_DISK_SUPPORT knob in the arm and powerpc ubldr. 240335: Slightly reduce an overhead for the open() call in the zfsloader. libstand(3) tries to detect file system in the predefined order, but zfsloader usually is used for the booting from ZFS, and there is no need to try detect several file system types for each open() call. 240481: The MBR data is not necessarily aligned. This is a problem on ARM. 241023: Make the loader a bit smarter, when it tries to open disk and the slice number is not exactly specified. When the disk has MBR, also try to read BSD label after ptable_getpart() call. When the disk has GPT, also set d_partition to 255. Mostly, this is how it worked before. 241047: Disable splitfs support, since we aren't support floppies for a long time. This slightly reduces an overhead, when loader tries to open file that doesn't exist. 241053: Almost each time when loader opens a file, this leads to calling disk_open(). Very often this is called several times for one file. This leads to reading partition table metadata for each call. To reduce the number of disk I/O we have a simple block cache, but it is very dumb and more than half of I/O operations related to reading metadata, misses this cache. Introduce new cache layer to resolve this problem. It is independent and doesn't need initialization like bcache, and will work by default for all loaders which use the new DISK API. A successful disk_open() call to each new disk or partition produces new entry in the cache. Even more, when disk was already open, now opening of any nested partitions does not require reading top level partition table. So, if without this cache, partition table metadata was read around 20-50 times during boot, now it reads only once. This affects the booting from GPT and MBR from the UFS. 241065: Fix disk_cleanup() to work without DISK_DEBUG too. 241068: Reduce the number of attempts to detect proper kld format for the amd64 loader. 241069: Remember the file format of the last loaded module and try to use it for next files. 241070: Fix the style. 241164: Replace all references to loader_callbacks_v1 with loader_callbacks. 241809: Add the flags parameter to the disk_open() function and DISK_F_NOCACHE flag, that disables the caching of partition tables metadata. Use this flag for floppies in the libi386/biosdisk driver. 241876: When loader tries to open GPT partition, but partition table is not GPT, then try automatically detect an appropriate partition type. Added: stable/9/sys/boot/common/part.c - copied, changed from r239054, head/sys/boot/common/part.c stable/9/sys/boot/common/part.h - copied unchanged from r239054, head/sys/boot/common/part.h Modified: stable/9/sys/boot/arm/uboot/Makefile stable/9/sys/boot/common/Makefile.inc stable/9/sys/boot/common/disk.c stable/9/sys/boot/common/disk.h stable/9/sys/boot/common/module.c stable/9/sys/boot/i386/libi386/Makefile stable/9/sys/boot/i386/libi386/biosdisk.c stable/9/sys/boot/i386/libi386/devicename.c stable/9/sys/boot/i386/libi386/libi386.h stable/9/sys/boot/i386/loader/Makefile stable/9/sys/boot/i386/loader/conf.c stable/9/sys/boot/i386/loader/main.c stable/9/sys/boot/i386/pmbr/pmbr.s stable/9/sys/boot/powerpc/uboot/Makefile stable/9/sys/boot/sparc64/loader/main.c stable/9/sys/boot/uboot/common/main.c stable/9/sys/boot/uboot/lib/Makefile stable/9/sys/boot/uboot/lib/devicename.c stable/9/sys/boot/uboot/lib/disk.c stable/9/sys/boot/uboot/lib/libuboot.h stable/9/sys/boot/userboot/test/test.c stable/9/sys/boot/userboot/userboot.h stable/9/sys/boot/userboot/userboot/Makefile stable/9/sys/boot/userboot/userboot/bootinfo32.c stable/9/sys/boot/userboot/userboot/copy.c stable/9/sys/boot/userboot/userboot/devicename.c stable/9/sys/boot/userboot/userboot/libuserboot.h stable/9/sys/boot/userboot/userboot/main.c stable/9/sys/boot/userboot/userboot/userboot_disk.c stable/9/sys/boot/zfs/zfs.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/arm/uboot/Makefile ============================================================================== --- stable/9/sys/boot/arm/uboot/Makefile Sun Nov 18 16:58:08 2012 (r243242) +++ stable/9/sys/boot/arm/uboot/Makefile Sun Nov 18 17:09:29 2012 (r243243) @@ -11,7 +11,11 @@ WARNS?= 1 # Architecture-specific loader code SRCS= start.S conf.c vers.c +.if !defined(LOADER_NO_DISK_SUPPORT) LOADER_DISK_SUPPORT?= yes +.else +LOADER_DISK_SUPPORT= no +.endif LOADER_UFS_SUPPORT?= yes LOADER_CD9660_SUPPORT?= no LOADER_EXT2FS_SUPPORT?= no Modified: stable/9/sys/boot/common/Makefile.inc ============================================================================== --- stable/9/sys/boot/common/Makefile.inc Sun Nov 18 16:58:08 2012 (r243242) +++ stable/9/sys/boot/common/Makefile.inc Sun Nov 18 17:09:29 2012 (r243243) @@ -1,6 +1,6 @@ # $FreeBSD$ -SRCS+= boot.c commands.c console.c devopen.c disk.c interp.c +SRCS+= boot.c commands.c console.c devopen.c interp.c SRCS+= interp_backslash.c interp_parse.c ls.c misc.c SRCS+= module.c panic.c @@ -24,6 +24,18 @@ SRCS+= load_elf64.c reloc_elf64.c SRCS+= dev_net.c .endif +.if !defined(LOADER_NO_DISK_SUPPORT) +SRCS+= disk.c part.c +CFLAGS+= -DLOADER_DISK_SUPPORT +.if !defined(LOADER_NO_GPT_SUPPORT) +SRCS+= crc32.c +CFLAGS+= -DLOADER_GPT_SUPPORT +.endif +.if !defined(LOADER_NO_MBR_SUPPORT) +CFLAGS+= -DLOADER_MBR_SUPPORT +.endif +.endif + .if defined(HAVE_BCACHE) SRCS+= bcache.c .endif Modified: stable/9/sys/boot/common/disk.c ============================================================================== --- stable/9/sys/boot/common/disk.c Sun Nov 18 16:58:08 2012 (r243242) +++ stable/9/sys/boot/common/disk.c Sun Nov 18 17:09:29 2012 (r243243) @@ -1,5 +1,6 @@ /*- * Copyright (c) 1998 Michael Smith + * Copyright (c) 2012 Andrey V. Elsukov * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -27,26 +28,12 @@ #include __FBSDID("$FreeBSD$"); -/* - * MBR/GPT partitioned disk device handling. - * - * Ideas and algorithms from: - * - * - NetBSD libi386/biosdisk.c - * - FreeBSD biosboot/disk.c - * - */ - +#include +#include #include - -#include -#include -#include - #include -#include - #include +#include #include "disk.h" @@ -56,53 +43,118 @@ __FBSDID("$FreeBSD$"); # define DEBUG(fmt, args...) #endif -/* - * Search for a slice with the following preferences: - * - * 1: Active FreeBSD slice - * 2: Non-active FreeBSD slice - * 3: Active Linux slice - * 4: non-active Linux slice - * 5: Active FAT/FAT32 slice - * 6: non-active FAT/FAT32 slice - */ -#define PREF_RAWDISK 0 -#define PREF_FBSD_ACT 1 -#define PREF_FBSD 2 -#define PREF_LINUX_ACT 3 -#define PREF_LINUX 4 -#define PREF_DOS_ACT 5 -#define PREF_DOS 6 -#define PREF_NONE 7 +struct open_disk { + struct ptable *table; + off_t mediasize; + u_int sectorsize; + u_int flags; + int rcnt; +}; -#ifdef LOADER_GPT_SUPPORT +struct print_args { + struct disk_devdesc *dev; + const char *prefix; + int verbose; +}; -struct gpt_part { - int gp_index; - uuid_t gp_type; - uint64_t gp_start; - uint64_t gp_end; +struct dentry { + const struct devsw *d_dev; + int d_unit; + int d_slice; + int d_partition; + + struct open_disk *od; + off_t d_offset; + STAILQ_ENTRY(dentry) entry; +#ifdef DISK_DEBUG + uint32_t count; +#endif }; -static uuid_t efi = GPT_ENT_TYPE_EFI; -static uuid_t freebsd_boot = GPT_ENT_TYPE_FREEBSD_BOOT; -static uuid_t freebsd_ufs = GPT_ENT_TYPE_FREEBSD_UFS; -static uuid_t freebsd_swap = GPT_ENT_TYPE_FREEBSD_SWAP; -static uuid_t freebsd_zfs = GPT_ENT_TYPE_FREEBSD_ZFS; -static uuid_t ms_basic_data = GPT_ENT_TYPE_MS_BASIC_DATA; +static STAILQ_HEAD(, dentry) opened_disks = + STAILQ_HEAD_INITIALIZER(opened_disks); +static int +disk_lookup(struct disk_devdesc *dev) +{ + struct dentry *entry; + int rc; + + rc = ENOENT; + STAILQ_FOREACH(entry, &opened_disks, entry) { + if (entry->d_dev != dev->d_dev || + entry->d_unit != dev->d_unit) + continue; + dev->d_opendata = entry->od; + if (entry->d_slice == dev->d_slice && + entry->d_partition == dev->d_partition) { + dev->d_offset = entry->d_offset; + DEBUG("%s offset %lld", disk_fmtdev(dev), + dev->d_offset); +#ifdef DISK_DEBUG + entry->count++; +#endif + return (0); + } + rc = EAGAIN; + } + return (rc); +} + +static void +disk_insert(struct disk_devdesc *dev) +{ + struct dentry *entry; + + entry = (struct dentry *)malloc(sizeof(struct dentry)); + if (entry == NULL) { + DEBUG("no memory"); + return; + } + entry->d_dev = dev->d_dev; + entry->d_unit = dev->d_unit; + entry->d_slice = dev->d_slice; + entry->d_partition = dev->d_partition; + entry->od = (struct open_disk *)dev->d_opendata; + entry->od->rcnt++; + entry->d_offset = dev->d_offset; +#ifdef DISK_DEBUG + entry->count = 1; #endif + STAILQ_INSERT_TAIL(&opened_disks, entry, entry); + DEBUG("%s cached", disk_fmtdev(dev)); +} + +#ifdef DISK_DEBUG +COMMAND_SET(dcachestat, "dcachestat", "get disk cache stats", + command_dcachestat); + +static int +command_dcachestat(int argc, char *argv[]) +{ + struct disk_devdesc dev; + struct dentry *entry; -#if defined(LOADER_GPT_SUPPORT) || defined(LOADER_MBR_SUPPORT) + STAILQ_FOREACH(entry, &opened_disks, entry) { + dev.d_dev = (struct devsw *)entry->d_dev; + dev.d_unit = entry->d_unit; + dev.d_slice = entry->d_slice; + dev.d_partition = entry->d_partition; + printf("%s %d => %p [%d]\n", disk_fmtdev(&dev), entry->count, + entry->od, entry->od->rcnt); + } + return (CMD_OK); +} +#endif /* DISK_DEBUG */ -/* Given a size in 512 byte sectors, convert it to a human-readable number. */ +/* Convert size to a human-readable number. */ static char * -display_size(uint64_t size) +display_size(uint64_t size, u_int sectorsize) { static char buf[80]; char unit; - size /= 2; + size = size * sectorsize / 1024; unit = 'K'; if (size >= 10485760000LL) { size /= 1073741824; @@ -114,687 +166,328 @@ display_size(uint64_t size) size /= 1024; unit = 'M'; } - sprintf(buf, "%.6ld%cB", (long)size, unit); + sprintf(buf, "%ld%cB", (long)size, unit); return (buf); } -#endif - -#ifdef LOADER_MBR_SUPPORT - -static void -disk_checkextended(struct disk_devdesc *dev, - struct dos_partition *slicetab, int slicenum, int *nslicesp) +static int +ptblread(void *d, void *buf, size_t blocks, off_t offset) { - uint8_t buf[DISK_SECSIZE]; - struct dos_partition *dp; - uint32_t base; - int rc, i, start, end; - - dp = &slicetab[slicenum]; - start = *nslicesp; - - if (dp->dp_size == 0) - goto done; - if (dp->dp_typ != DOSPTYP_EXT) - goto done; - rc = dev->d_dev->dv_strategy(dev, F_READ, dp->dp_start, DISK_SECSIZE, - (char *) buf, NULL); - if (rc) - goto done; - if (buf[0x1fe] != 0x55 || buf[0x1ff] != 0xaa) { - DEBUG("no magic in extended table"); - goto done; - } - base = dp->dp_start; - dp = (struct dos_partition *) &buf[DOSPARTOFF]; - for (i = 0; i < NDOSPART; i++, dp++) { - if (dp->dp_size == 0) - continue; - if (*nslicesp == NEXTDOSPART) - goto done; - dp->dp_start += base; - bcopy(dp, &slicetab[*nslicesp], sizeof(*dp)); - (*nslicesp)++; - } - end = *nslicesp; + struct disk_devdesc *dev; + struct open_disk *od; - /* - * now, recursively check the slices we just added - */ - for (i = start; i < end; i++) - disk_checkextended(dev, slicetab, i, nslicesp); -done: - return; + dev = (struct disk_devdesc *)d; + od = (struct open_disk *)dev->d_opendata; + return (dev->d_dev->dv_strategy(dev, F_READ, offset, + blocks * od->sectorsize, (char *)buf, NULL)); } -static int -disk_readslicetab(struct disk_devdesc *dev, - struct dos_partition **slicetabp, int *nslicesp) +#define PWIDTH 35 +static void +ptable_print(void *arg, const char *pname, const struct ptable_entry *part) { - struct dos_partition *slicetab = NULL; - int nslices, i; - int rc; - uint8_t buf[DISK_SECSIZE]; - - /* - * Find the slice in the DOS slice table. - */ - rc = dev->d_dev->dv_strategy(dev, F_READ, 0, DISK_SECSIZE, - (char *) buf, NULL); - if (rc) { - DEBUG("error reading MBR"); - return (rc); - } + struct print_args *pa, bsd; + struct open_disk *od; + struct ptable *table; + char line[80]; - /* - * Check the slice table magic. - */ - if (buf[0x1fe] != 0x55 || buf[0x1ff] != 0xaa) { - DEBUG("no slice table/MBR (no magic)"); - return (rc); + pa = (struct print_args *)arg; + od = (struct open_disk *)pa->dev->d_opendata; + sprintf(line, " %s%s: %s", pa->prefix, pname, + parttype2str(part->type)); + if (pa->verbose) + sprintf(line, "%-*s%s", PWIDTH, line, + display_size(part->end - part->start + 1, + od->sectorsize)); + strcat(line, "\n"); + pager_output(line); + if (part->type == PART_FREEBSD) { + /* Open slice with BSD label */ + pa->dev->d_offset = part->start; + table = ptable_open(pa->dev, part->end - part->start + 1, + od->sectorsize, ptblread); + if (table == NULL) + return; + sprintf(line, " %s%s", pa->prefix, pname); + bsd.dev = pa->dev; + bsd.prefix = line; + bsd.verbose = pa->verbose; + ptable_iterate(table, &bsd, ptable_print); + ptable_close(table); } - - /* - * copy the partition table, then pick up any extended partitions. - */ - slicetab = malloc(NEXTDOSPART * sizeof(struct dos_partition)); - bcopy(buf + DOSPARTOFF, slicetab, - sizeof(struct dos_partition) * NDOSPART); - nslices = NDOSPART; /* extended slices start here */ - for (i = 0; i < NDOSPART; i++) - disk_checkextended(dev, slicetab, i, &nslices); - - *slicetabp = slicetab; - *nslicesp = nslices; - return (0); } +#undef PWIDTH -/* - * Search for the best MBR slice (typically the first FreeBSD slice). - */ -static int -disk_bestslice(struct dos_partition *slicetab, int nslices) +void +disk_print(struct disk_devdesc *dev, char *prefix, int verbose) { - struct dos_partition *dp; - int pref, preflevel; - int i, prefslice; - - prefslice = 0; - preflevel = PREF_NONE; - - dp = &slicetab[0]; - for (i = 0; i < nslices; i++, dp++) { - switch (dp->dp_typ) { - case DOSPTYP_386BSD: /* FreeBSD */ - pref = dp->dp_flag & 0x80 ? PREF_FBSD_ACT : PREF_FBSD; - break; - - case DOSPTYP_LINUX: - pref = dp->dp_flag & 0x80 ? PREF_LINUX_ACT : PREF_LINUX; - break; - - case 0x01: /* DOS/Windows */ - case 0x04: - case 0x06: - case 0x0b: - case 0x0c: - case 0x0e: - pref = dp->dp_flag & 0x80 ? PREF_DOS_ACT : PREF_DOS; - break; + struct open_disk *od; + struct print_args pa; - default: - pref = PREF_NONE; - } - if (pref < preflevel) { - preflevel = pref; - prefslice = i + 1; - } - } - return (prefslice); + /* Disk should be opened */ + od = (struct open_disk *)dev->d_opendata; + pa.dev = dev; + pa.prefix = prefix; + pa.verbose = verbose; + ptable_iterate(od->table, &pa, ptable_print); } -static int -disk_openmbr(struct disk_devdesc *dev) +int +disk_open(struct disk_devdesc *dev, off_t mediasize, u_int sectorsize, + u_int flags) { - struct dos_partition *slicetab = NULL, *dptr; - int nslices, sector, slice; - int rc; - uint8_t buf[DISK_SECSIZE]; - struct disklabel *lp; - - /* - * Following calculations attempt to determine the correct value - * for dev->d_offset by looking for the slice and partition specified, - * or searching for reasonable defaults. - */ - rc = disk_readslicetab(dev, &slicetab, &nslices); - if (rc) - return (rc); + struct open_disk *od; + struct ptable *table; + struct ptable_entry part; + int rc, slice, partition; - /* - * if a slice number was supplied but not found, this is an error. - */ - if (dev->d_slice > 0) { - slice = dev->d_slice - 1; - if (slice >= nslices) { - DEBUG("slice %d not found", slice); - rc = EPART; - goto out; - } - } - - /* - * Check for the historically bogus MBR found on true dedicated disks - */ - if (slicetab[3].dp_typ == DOSPTYP_386BSD && - slicetab[3].dp_start == 0 && slicetab[3].dp_size == 50000) { - sector = 0; - goto unsliced; - } - - /* - * Try to auto-detect the best slice; this should always give - * a slice number - */ - if (dev->d_slice == 0) { - slice = disk_bestslice(slicetab, nslices); - if (slice == -1) { - rc = ENOENT; - goto out; - } - dev->d_slice = slice; + rc = 0; + if ((flags & DISK_F_NOCACHE) == 0) { + rc = disk_lookup(dev); + if (rc == 0) + return (0); } - - /* - * Accept the supplied slice number unequivocally (we may be looking - * at a DOS partition). - * Note: we number 1-4, offsets are 0-3 - */ - dptr = &slicetab[dev->d_slice - 1]; - sector = dptr->dp_start; - DEBUG("slice entry %d at %d, %d sectors", - dev->d_slice - 1, sector, dptr->dp_size); - -unsliced: /* - * Now we have the slice offset, look for the partition in the - * disklabel if we have a partition to start with. - * - * XXX we might want to check the label checksum. + * While we are reading disk metadata, make sure we do it relative + * to the start of the disk */ - if (dev->d_partition < 0) { - /* no partition, must be after the slice */ - DEBUG("opening raw slice"); - dev->d_offset = sector; - rc = 0; - goto out; - } - - rc = dev->d_dev->dv_strategy(dev, F_READ, sector + LABELSECTOR, - DISK_SECSIZE, (char *) buf, NULL); - if (rc) { - DEBUG("error reading disklabel"); - goto out; - } - - lp = (struct disklabel *) buf; - - if (lp->d_magic != DISKMAGIC) { - DEBUG("no disklabel"); - rc = ENOENT; - goto out; - } - if (dev->d_partition >= lp->d_npartitions) { - DEBUG("partition '%c' exceeds partitions in table (a-'%c')", - 'a' + dev->d_partition, - 'a' + lp->d_npartitions); - rc = EPART; + dev->d_offset = 0; + table = NULL; + slice = dev->d_slice; + partition = dev->d_partition; + if (rc == EAGAIN) { + /* + * This entire disk was already opened and there is no + * need to allocate new open_disk structure and open the + * main partition table. + */ + od = (struct open_disk *)dev->d_opendata; + DEBUG("%s unit %d, slice %d, partition %d => %p (cached)", + disk_fmtdev(dev), dev->d_unit, dev->d_slice, + dev->d_partition, od); + goto opened; + } else { + od = (struct open_disk *)malloc(sizeof(struct open_disk)); + if (od == NULL) { + DEBUG("no memory"); + return (ENOMEM); + } + dev->d_opendata = od; + od->rcnt = 0; + } + od->mediasize = mediasize; + od->sectorsize = sectorsize; + od->flags = flags; + DEBUG("%s unit %d, slice %d, partition %d => %p", + disk_fmtdev(dev), dev->d_unit, dev->d_slice, dev->d_partition, od); + + /* Determine disk layout. */ + od->table = ptable_open(dev, mediasize / sectorsize, sectorsize, + ptblread); + if (od->table == NULL) { + DEBUG("Can't read partition table"); + rc = ENXIO; goto out; } - - dev->d_offset = - lp->d_partitions[dev->d_partition].p_offset - - lp->d_partitions[RAW_PART].p_offset + - sector; +opened: rc = 0; - -out: - if (slicetab) - free(slicetab); - return (rc); -} - -/* - * Print out each valid partition in the disklabel of a FreeBSD slice. - * For size calculations, we assume a 512 byte sector size. - */ -static void -disk_printbsdslice(struct disk_devdesc *dev, daddr_t offset, - char *prefix, int verbose) -{ - char line[80]; - char buf[DISK_SECSIZE]; - struct disklabel *lp; - int i, rc, fstype; - - /* read disklabel */ - rc = dev->d_dev->dv_strategy(dev, F_READ, offset + LABELSECTOR, - DISK_SECSIZE, (char *) buf, NULL); - if (rc) - return; - lp =(struct disklabel *)(&buf[0]); - if (lp->d_magic != DISKMAGIC) { - sprintf(line, "%s: FFS bad disklabel\n", prefix); - pager_output(line); - return; - } - - /* Print partitions */ - for (i = 0; i < lp->d_npartitions; i++) { - /* - * For each partition, make sure we know what type of fs it - * is. If not, then skip it. - */ - fstype = lp->d_partitions[i].p_fstype; - if (fstype != FS_BSDFFS && - fstype != FS_SWAP && - fstype != FS_VINUM) - continue; - - /* Only print out statistics in verbose mode */ - if (verbose) - sprintf(line, " %s%c: %s %s (%d - %d)\n", - prefix, 'a' + i, - (fstype == FS_SWAP) ? "swap " : - (fstype == FS_VINUM) ? "vinum" : - "FFS ", - display_size(lp->d_partitions[i].p_size), - lp->d_partitions[i].p_offset, - (lp->d_partitions[i].p_offset - + lp->d_partitions[i].p_size)); + if (ptable_gettype(od->table) == PTABLE_BSD && + partition >= 0) { + /* It doesn't matter what value has d_slice */ + rc = ptable_getpart(od->table, &part, partition); + if (rc == 0) + dev->d_offset = part.start; + } else if (slice >= 0) { + /* Try to get information about partition */ + if (slice == 0) + rc = ptable_getbestpart(od->table, &part); else - sprintf(line, " %s%c: %s\n", prefix, 'a' + i, - (fstype == FS_SWAP) ? "swap" : - (fstype == FS_VINUM) ? "vinum" : - "FFS"); - pager_output(line); - } -} - -static void -disk_printslice(struct disk_devdesc *dev, int slice, - struct dos_partition *dp, char *prefix, int verbose) -{ - char stats[80]; - char line[80]; - - if (verbose) - sprintf(stats, " %s (%d - %d)", display_size(dp->dp_size), - dp->dp_start, dp->dp_start + dp->dp_size); - else - stats[0] = '\0'; - - switch (dp->dp_typ) { - case DOSPTYP_386BSD: - disk_printbsdslice(dev, (daddr_t)dp->dp_start, - prefix, verbose); - return; - case DOSPTYP_LINSWP: - sprintf(line, "%s: Linux swap%s\n", prefix, stats); - break; - case DOSPTYP_LINUX: + rc = ptable_getpart(od->table, &part, slice); + if (rc != 0) /* Partition doesn't exist */ + goto out; + dev->d_offset = part.start; + slice = part.index; + if (ptable_gettype(od->table) == PTABLE_GPT) { + partition = 255; + goto out; /* Nothing more to do */ + } else if (partition == 255) { + /* + * When we try to open GPT partition, but partition + * table isn't GPT, reset d_partition value to -1 + * and try to autodetect appropriate value. + */ + partition = -1; + } /* - * XXX - * read the superblock to confirm this is an ext2fs partition? + * If d_partition < 0 and we are looking at a BSD slice, + * then try to read BSD label, otherwise return the + * whole MBR slice. */ - sprintf(line, "%s: ext2fs%s\n", prefix, stats); - break; - case 0x00: /* unused partition */ - case DOSPTYP_EXT: - return; - case 0x01: - sprintf(line, "%s: FAT-12%s\n", prefix, stats); - break; - case 0x04: - case 0x06: - case 0x0e: - sprintf(line, "%s: FAT-16%s\n", prefix, stats); - break; - case 0x07: - sprintf(line, "%s: NTFS/HPFS%s\n", prefix, stats); - break; - case 0x0b: - case 0x0c: - sprintf(line, "%s: FAT-32%s\n", prefix, stats); - break; - default: - sprintf(line, "%s: Unknown fs: 0x%x %s\n", prefix, dp->dp_typ, - stats); - } - pager_output(line); -} - -static int -disk_printmbr(struct disk_devdesc *dev, char *prefix, int verbose) -{ - struct dos_partition *slicetab; - int nslices, i; - int rc; - char line[80]; - - rc = disk_readslicetab(dev, &slicetab, &nslices); - if (rc) - return (rc); - for (i = 0; i < nslices; i++) { - sprintf(line, "%ss%d", prefix, i + 1); - disk_printslice(dev, i, &slicetab[i], line, verbose); - } - free(slicetab); - return (0); -} - -#endif - -#ifdef LOADER_GPT_SUPPORT - -static int -disk_readgpt(struct disk_devdesc *dev, struct gpt_part **gptp, int *ngptp) -{ - struct dos_partition *dp; - struct gpt_hdr *hdr; - struct gpt_ent *ent; - struct gpt_part *gptab = NULL; - int entries_per_sec, rc, i, part; - daddr_t lba, elba; - uint8_t gpt[DISK_SECSIZE], tbl[DISK_SECSIZE]; - - /* - * Following calculations attempt to determine the correct value - * for dev->d_offset by looking for the slice and partition specified, - * or searching for reasonable defaults. - */ - rc = 0; - - /* First, read the MBR and see if we have a PMBR. */ - rc = dev->d_dev->dv_strategy(dev, F_READ, 0, DISK_SECSIZE, - (char *) tbl, NULL); - if (rc) { - DEBUG("error reading MBR"); - return (EIO); - } - - /* Check the slice table magic. */ - if (tbl[0x1fe] != 0x55 || tbl[0x1ff] != 0xaa) - return (ENXIO); - - /* Check for GPT slice. */ - part = 0; - dp = (struct dos_partition *)(tbl + DOSPARTOFF); - for (i = 0; i < NDOSPART; i++) { - if (dp[i].dp_typ == 0xee) - part++; - else if ((part != 1) && (dp[i].dp_typ != 0x00)) - return (EINVAL); - } - if (part != 1) - return (EINVAL); - - /* Read primary GPT table header. */ - rc = dev->d_dev->dv_strategy(dev, F_READ, 1, DISK_SECSIZE, - (char *) gpt, NULL); - if (rc) { - DEBUG("error reading GPT header"); - return (EIO); - } - hdr = (struct gpt_hdr *)gpt; - if (bcmp(hdr->hdr_sig, GPT_HDR_SIG, sizeof(hdr->hdr_sig)) != 0 || - hdr->hdr_lba_self != 1 || hdr->hdr_revision < 0x00010000 || - hdr->hdr_entsz < sizeof(*ent) || - DISK_SECSIZE % hdr->hdr_entsz != 0) { - DEBUG("Invalid GPT header\n"); - return (EINVAL); - } - - /* Walk the partition table to count valid partitions. */ - part = 0; - entries_per_sec = DISK_SECSIZE / hdr->hdr_entsz; - elba = hdr->hdr_lba_table + hdr->hdr_entries / entries_per_sec; - for (lba = hdr->hdr_lba_table; lba < elba; lba++) { - rc = dev->d_dev->dv_strategy(dev, F_READ, lba, DISK_SECSIZE, - (char *) tbl, NULL); - if (rc) { - DEBUG("error reading GPT table"); - return (EIO); + if (partition == -1 && + part.type != PART_FREEBSD) + goto out; + /* Try to read BSD label */ + table = ptable_open(dev, part.end - part.start + 1, + od->sectorsize, ptblread); + if (table == NULL) { + DEBUG("Can't read BSD label"); + rc = ENXIO; + goto out; } - for (i = 0; i < entries_per_sec; i++) { - ent = (struct gpt_ent *)(tbl + i * hdr->hdr_entsz); - if (uuid_is_nil(&ent->ent_type, NULL) || - ent->ent_lba_start == 0 || - ent->ent_lba_end < ent->ent_lba_start) - continue; - part++; + /* + * If slice contains BSD label and d_partition < 0, then + * assume the 'a' partition. Otherwise just return the + * whole MBR slice, because it can contain ZFS. + */ + if (partition < 0) { + if (ptable_gettype(table) != PTABLE_BSD) + goto out; + partition = 0; } + rc = ptable_getpart(table, &part, partition); + if (rc != 0) + goto out; + dev->d_offset += part.start; } +out: + if (table != NULL) + ptable_close(table); - /* Save the important information about all the valid partitions. */ - if (part != 0) { - gptab = malloc(part * sizeof(struct gpt_part)); - part = 0; - for (lba = hdr->hdr_lba_table; lba < elba; lba++) { - rc = dev->d_dev->dv_strategy(dev, F_READ, lba, DISK_SECSIZE, - (char *) tbl, NULL); - if (rc) { - DEBUG("error reading GPT table"); - free(gptab); - return (EIO); - } - for (i = 0; i < entries_per_sec; i++) { - ent = (struct gpt_ent *)(tbl + i * hdr->hdr_entsz); - if (uuid_is_nil(&ent->ent_type, NULL) || - ent->ent_lba_start == 0 || - ent->ent_lba_end < ent->ent_lba_start) - continue; - gptab[part].gp_index = (lba - hdr->hdr_lba_table) * - entries_per_sec + i + 1; - gptab[part].gp_type = ent->ent_type; - gptab[part].gp_start = ent->ent_lba_start; - gptab[part].gp_end = ent->ent_lba_end; - part++; - } - } + if (rc != 0) { + if (od->rcnt < 1) { + if (od->table != NULL) + ptable_close(od->table); + free(od); + } + DEBUG("%s could not open", disk_fmtdev(dev)); + } else { + if ((flags & DISK_F_NOCACHE) == 0) + disk_insert(dev); + /* Save the slice and partition number to the dev */ + dev->d_slice = slice; + dev->d_partition = partition; + DEBUG("%s offset %lld => %p", disk_fmtdev(dev), + dev->d_offset, od); } - - *gptp = gptab; - *ngptp = part; - return (0); + return (rc); } -static struct gpt_part * -disk_bestgpt(struct gpt_part *gpt, int ngpt) +int +disk_close(struct disk_devdesc *dev) { - struct gpt_part *gp, *prefpart; - int i, pref, preflevel; + struct open_disk *od; - prefpart = NULL; - preflevel = PREF_NONE; - - gp = gpt; - for (i = 0; i < ngpt; i++, gp++) { - /* Windows. XXX: Also Linux. */ - if (uuid_equal(&gp->gp_type, &ms_basic_data, NULL)) - pref = PREF_DOS; - /* FreeBSD */ - else if (uuid_equal(&gp->gp_type, &freebsd_ufs, NULL) || - uuid_equal(&gp->gp_type, &freebsd_zfs, NULL)) - pref = PREF_FBSD; - else - pref = PREF_NONE; - if (pref < preflevel) { - preflevel = pref; - prefpart = gp; - } + od = (struct open_disk *)dev->d_opendata; + DEBUG("%s closed => %p [%d]", disk_fmtdev(dev), od, od->rcnt); + if (od->flags & DISK_F_NOCACHE) { + ptable_close(od->table); + free(od); } - return (prefpart); + return (0); } -static int -disk_opengpt(struct disk_devdesc *dev) +void +disk_cleanup(const struct devsw *d_dev) { - struct gpt_part *gpt = NULL, *gp; - int rc, ngpt, i; - - rc = disk_readgpt(dev, &gpt, &ngpt); - if (rc) - return (rc); - - /* Is this a request for the whole disk? */ - if (dev->d_slice < 0) { - dev->d_offset = 0; - rc = 0; - goto out; - } - - /* - * If a partition number was supplied, then the user is trying to use - * an MBR address rather than a GPT address, so fail. - */ - if (dev->d_partition != 0xff) { - rc = ENOENT; - goto out; - } - - /* If a slice number was supplied but not found, this is an error. */ - gp = NULL; - if (dev->d_slice > 0) { - for (i = 0; i < ngpt; i++) { - if (gpt[i].gp_index == dev->d_slice) { - gp = &gpt[i]; - break; - } - } - if (gp == NULL) { - DEBUG("partition %d not found", dev->d_slice); - rc = ENOENT; - goto out; - } - } +#ifdef DISK_DEBUG + struct disk_devdesc dev; +#endif + struct dentry *entry, *tmp; - /* Try to auto-detect the best partition. */ - if (dev->d_slice == 0) { - gp = disk_bestgpt(gpt, ngpt); - if (gp == NULL) { - rc = ENOENT; - goto out; + STAILQ_FOREACH_SAFE(entry, &opened_disks, entry, tmp) { + if (entry->d_dev != d_dev) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Sun Nov 18 17:27:11 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2B2055B0; Sun, 18 Nov 2012 17:27:11 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0EE7A8FC18; Sun, 18 Nov 2012 17:27:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAIHRAMo075415; Sun, 18 Nov 2012 17:27:10 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAIHRArQ075414; Sun, 18 Nov 2012 17:27:10 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201211181727.qAIHRArQ075414@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 18 Nov 2012 17:27:10 +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: r243244 - stable/9/tools/tools/bootparttest X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Nov 2012 17:27:11 -0000 Author: ae Date: Sun Nov 18 17:27:10 2012 New Revision: 243244 URL: http://svnweb.freebsd.org/changeset/base/243244 Log: MFC r239070: Add simple test program that uses the partition tables handling code. It is useful to test and debug how boot loader handles partition tables metadata. MFC r239087: Add to the debug output the offset from the parent partitioning scheme. Added: stable/9/tools/tools/bootparttest/ - copied from r239070, head/tools/tools/bootparttest/ Modified: stable/9/tools/tools/bootparttest/bootparttest.c Directory Properties: stable/9/tools/tools/ (props changed) Modified: stable/9/tools/tools/bootparttest/bootparttest.c ============================================================================== --- head/tools/tools/bootparttest/bootparttest.c Sun Aug 5 15:40:16 2012 (r239070) +++ stable/9/tools/tools/bootparttest/bootparttest.c Sun Nov 18 17:27:10 2012 (r243244) @@ -54,8 +54,8 @@ diskread(void *arg, void *buf, size_t bl struct disk *dp; dp = (struct disk *)arg; - printf("%s: read %d blocks from the offset %jd\n", dp->name, - blocks, offset); + printf("%s: read %d blocks from the offset %jd [+%jd]\n", dp->name, + blocks, offset, dp->offset); if (offset >= dp->mediasize / dp->sectorsize) return (-1); From owner-svn-src-stable@FreeBSD.ORG Mon Nov 19 04:07:44 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5A0B11B6; Mon, 19 Nov 2012 04:07:44 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3A6808FC08; Mon, 19 Nov 2012 04:07:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJ47ioL077941; Mon, 19 Nov 2012 04:07:44 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJ47iG2077940; Mon, 19 Nov 2012 04:07:44 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211190407.qAJ47iG2077940@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Nov 2012 04:07:44 +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: r243256 - stable/9/usr.bin/chpass X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2012 04:07:44 -0000 Author: eadler Date: Mon Nov 19 04:07:43 2012 New Revision: 243256 URL: http://svnweb.freebsd.org/changeset/base/243256 Log: MFC r243081: Avoid possible null deref if ypclnt_new returns null PR: bin/172979 Approved by: cperciva (implicit) Modified: stable/9/usr.bin/chpass/chpass.c Directory Properties: stable/9/usr.bin/chpass/ (props changed) Modified: stable/9/usr.bin/chpass/chpass.c ============================================================================== --- stable/9/usr.bin/chpass/chpass.c Mon Nov 19 01:58:20 2012 (r243255) +++ stable/9/usr.bin/chpass/chpass.c Mon Nov 19 04:07:43 2012 (r243256) @@ -241,8 +241,11 @@ main(int argc, char *argv[]) #ifdef YP case _PWF_NIS: ypclnt = ypclnt_new(yp_domain, "passwd.byname", yp_host); - if (ypclnt == NULL || - ypclnt_connect(ypclnt) == -1 || + if (ypclnt == NULL) { + warnx("ypclnt_new failed"); + exit(1); + } + if (ypclnt_connect(ypclnt) == -1 || ypclnt_passwd(ypclnt, pw, password) == -1) { warnx("%s", ypclnt->error); ypclnt_free(ypclnt); From owner-svn-src-stable@FreeBSD.ORG Mon Nov 19 04:08:11 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 51D7232D; Mon, 19 Nov 2012 04:08:11 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3644A8FC0C; Mon, 19 Nov 2012 04:08:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJ48Bkb078061; Mon, 19 Nov 2012 04:08:11 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJ48BqN078060; Mon, 19 Nov 2012 04:08:11 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211190408.qAJ48BqN078060@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Nov 2012 04:08:11 +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: r243257 - stable/8/usr.bin/chpass X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2012 04:08:11 -0000 Author: eadler Date: Mon Nov 19 04:08:10 2012 New Revision: 243257 URL: http://svnweb.freebsd.org/changeset/base/243257 Log: MFC r243081: Avoid possible null deref if ypclnt_new returns null PR: bin/172979 Approved by: cperciva (implicit) Modified: stable/8/usr.bin/chpass/chpass.c Directory Properties: stable/8/usr.bin/chpass/ (props changed) Modified: stable/8/usr.bin/chpass/chpass.c ============================================================================== --- stable/8/usr.bin/chpass/chpass.c Mon Nov 19 04:07:43 2012 (r243256) +++ stable/8/usr.bin/chpass/chpass.c Mon Nov 19 04:08:10 2012 (r243257) @@ -241,8 +241,11 @@ main(int argc, char *argv[]) #ifdef YP case _PWF_NIS: ypclnt = ypclnt_new(yp_domain, "passwd.byname", yp_host); - if (ypclnt == NULL || - ypclnt_connect(ypclnt) == -1 || + if (ypclnt == NULL) { + warnx("ypclnt_new failed"); + exit(1); + } + if (ypclnt_connect(ypclnt) == -1 || ypclnt_passwd(ypclnt, pw, password) == -1) { warnx("%s", ypclnt->error); ypclnt_free(ypclnt); From owner-svn-src-stable@FreeBSD.ORG Mon Nov 19 04:08:20 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8292D43A; Mon, 19 Nov 2012 04:08:20 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 674158FC12; Mon, 19 Nov 2012 04:08:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJ48K5I078124; Mon, 19 Nov 2012 04:08:20 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJ48KrU078123; Mon, 19 Nov 2012 04:08:20 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211190408.qAJ48KrU078123@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Nov 2012 04:08:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r243258 - stable/7/usr.bin/chpass X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2012 04:08:20 -0000 Author: eadler Date: Mon Nov 19 04:08:20 2012 New Revision: 243258 URL: http://svnweb.freebsd.org/changeset/base/243258 Log: MFC r243081: Avoid possible null deref if ypclnt_new returns null PR: bin/172979 Approved by: cperciva (implicit) Modified: stable/7/usr.bin/chpass/chpass.c Directory Properties: stable/7/usr.bin/chpass/ (props changed) Modified: stable/7/usr.bin/chpass/chpass.c ============================================================================== --- stable/7/usr.bin/chpass/chpass.c Mon Nov 19 04:08:10 2012 (r243257) +++ stable/7/usr.bin/chpass/chpass.c Mon Nov 19 04:08:20 2012 (r243258) @@ -241,8 +241,11 @@ main(int argc, char *argv[]) #ifdef YP case _PWF_NIS: ypclnt = ypclnt_new(yp_domain, "passwd.byname", yp_host); - if (ypclnt == NULL || - ypclnt_connect(ypclnt) == -1 || + if (ypclnt == NULL) { + warnx("ypclnt_new failed"); + exit(1); + } + if (ypclnt_connect(ypclnt) == -1 || ypclnt_passwd(ypclnt, pw, password) == -1) { warnx("%s", ypclnt->error); ypclnt_free(ypclnt); From owner-svn-src-stable@FreeBSD.ORG Mon Nov 19 04:10:23 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BEA2D618; Mon, 19 Nov 2012 04:10:23 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9D5218FC12; Mon, 19 Nov 2012 04:10:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJ4ANRn078600; Mon, 19 Nov 2012 04:10:23 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJ4ANVe078599; Mon, 19 Nov 2012 04:10:23 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211190410.qAJ4ANVe078599@svn.freebsd.org> From: Eitan Adler Date: Mon, 19 Nov 2012 04:10:23 +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: r243259 - stable/9/share/termcap X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2012 04:10:23 -0000 Author: eadler Date: Mon Nov 19 04:10:23 2012 New Revision: 243259 URL: http://svnweb.freebsd.org/changeset/base/243259 Log: MFC r243073: Some software, notably dialog(1), can understand back-tab, which is typically bound to Shift-Tab. syscons produces ^]]Z for Shift-Tab, like many VT100-like terminal (emulators). The plain xterm does not produce this sequence, but ^I for both Tab and Shift-Tab. PR: conf/162787 PR: bin/151229 Approved by: cperciva (implicit) Modified: stable/9/share/termcap/termcap.src Directory Properties: stable/9/share/termcap/ (props changed) Modified: stable/9/share/termcap/termcap.src ============================================================================== --- stable/9/share/termcap/termcap.src Mon Nov 19 04:08:20 2012 (r243258) +++ stable/9/share/termcap/termcap.src Mon Nov 19 04:10:23 2012 (r243259) @@ -2825,7 +2825,7 @@ xterm-basic|modern xterm common:\ :as=\E(0:bl=^G:cd=\E[J:ce=\E[K:cl=\E[H\E[2J:\ :cm=\E[%i%d;%dH:cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:dl=\E[M:\ :ei=\E[4l:ho=\E[H:im=\E[4h:is=\E[!p\E[?3;4l\E[4l\E>:\ - :kD=\E[3~:kb=^H:ke=\E[?1l\E>:ks=\E[?1h\E=:le=^H:md=\E[1m:\ + :kD=\E[3~:kb=^H:ke=\E[?1l\E>:ks=\E[?1h\E=:kB=\E[Z:le=^H:md=\E[1m:\ :me=\E[m:ml=\El:mr=\E[7m:mu=\Em:nd=\E[C:op=\E[39;49m:\ :rc=\E8:rs=\E[!p\E[?3;4l\E[4l\E>:sc=\E7:se=\E[27m:sf=^J:\ :so=\E[7m:sr=\EM:st=\EH:\ From owner-svn-src-stable@FreeBSD.ORG Mon Nov 19 05:52:23 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7E06653E; Mon, 19 Nov 2012 05:52:23 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 62C1A8FC08; Mon, 19 Nov 2012 05:52:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJ5qNSW094183; Mon, 19 Nov 2012 05:52:23 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJ5qNr7094182; Mon, 19 Nov 2012 05:52:23 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211190552.qAJ5qNr7094182@svn.freebsd.org> From: Adrian Chadd Date: Mon, 19 Nov 2012 05:52:23 +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: r243261 - stable/9/sys/dev/ath/ath_hal/ar5416 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2012 05:52:23 -0000 Author: adrian Date: Mon Nov 19 05:52:23 2012 New Revision: 243261 URL: http://svnweb.freebsd.org/changeset/base/243261 Log: Merge r227468: Don't fondle this particular CCA register from extension channel. Modified: stable/9/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Modified: stable/9/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c ============================================================================== --- stable/9/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Mon Nov 19 05:24:33 2012 (r243260) +++ stable/9/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Mon Nov 19 05:52:23 2012 (r243261) @@ -342,11 +342,6 @@ ar5416AniControl(struct ath_hal *ah, HAL OS_REG_RMW_FIELD(ah, AR_PHY_TIMING5, AR_PHY_TIMING5_CYCPWR_THR1, params->cycPwrThr1[level]); - /* Only set the ext channel cycpwr_thr1 field for ht/40 */ - if (IEEE80211_IS_CHAN_HT40(AH_PRIVATE(ah)->ah_curchan)) - OS_REG_RMW_FIELD(ah, AR_PHY_EXT_CCA, - AR_PHY_EXT_TIMING5_CYCPWR_THR1, params->cycPwrThr1[level]); - if (level > aniState->spurImmunityLevel) ahp->ah_stats.ast_ani_spurup++; else if (level < aniState->spurImmunityLevel) From owner-svn-src-stable@FreeBSD.ORG Mon Nov 19 15:03:20 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7D92054E; Mon, 19 Nov 2012 15:03:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 607728FC12; Mon, 19 Nov 2012 15:03:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJF3Kcx077722; Mon, 19 Nov 2012 15:03:20 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJF3K2I077720; Mon, 19 Nov 2012 15:03:20 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191503.qAJF3K2I077720@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 15:03:20 +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: r243279 - stable/9/sbin/reboot X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2012 15:03:20 -0000 Author: emaste Date: Mon Nov 19 15:03:19 2012 New Revision: 243279 URL: http://svnweb.freebsd.org/changeset/base/243279 Log: MFC r230812: Add -e to set arbitrary kernel environment variables. Nextboot(8) can now set any combination of kernel name (-k), kernel options (-o), and environment strings (-e). As a result of this change -k also becomes optional. Modified: stable/9/sbin/reboot/nextboot.8 stable/9/sbin/reboot/nextboot.sh Directory Properties: stable/9/sbin/reboot/ (props changed) Modified: stable/9/sbin/reboot/nextboot.8 ============================================================================== --- stable/9/sbin/reboot/nextboot.8 Mon Nov 19 12:10:36 2012 (r243278) +++ stable/9/sbin/reboot/nextboot.8 Mon Nov 19 15:03:19 2012 (r243279) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 4, 2002 +.Dd November 19, 2012 .Dt NEXTBOOT 8 .Os .Sh NAME @@ -32,15 +32,17 @@ .Nd "specify an alternate kernel and boot flags for the next reboot" .Sh SYNOPSIS .Nm +.Op Fl e Ar variable=value .Op Fl f +.Op Fl k Ar kernel .Op Fl o Ar options -.Fl k Ar kernel .Nm .Fl D .Sh DESCRIPTION The .Nm -utility allows specifying an alternate kernel and/or boot flags for the +utility allows specifying some combination of an alternate kernel, boot flags +and kernel environment for the next time the machine is booted. Once the .Xr loader 8 @@ -58,6 +60,11 @@ with this option removes an existing .Nm configuration. +.It Fl e Ar variable=value +This option adds the provided variable and value to the kernel environment. +The value is quoted when written to the +.Nm +configuration. .It Fl f This option disables the sanity checking which checks if the kernel really exists Modified: stable/9/sbin/reboot/nextboot.sh ============================================================================== --- stable/9/sbin/reboot/nextboot.sh Mon Nov 19 12:10:36 2012 (r243278) +++ stable/9/sbin/reboot/nextboot.sh Mon Nov 19 15:03:19 2012 (r243279) @@ -2,31 +2,59 @@ # # Copyright 2002. Gordon Tetlow. # gordon@FreeBSD.org +# Copyright (c) 2012 Sandvine Incorporated. All rights reserved. # # $FreeBSD$ delete="NO" +kenv= force="NO" nextboot_file="/boot/nextboot.conf" +add_kenv() +{ + local var value + + var=$1 + # strip literal quotes if passed in + value=${2%\"*} + value=${value#*\"} + + if [ -n "${kenv}" ]; then + kenv="${kenv} +" + fi + kenv="${kenv}${var}=\"${value}\"" +} + display_usage() { - echo "Usage: nextboot [-f] [-o options] -k kernel" + echo "Usage: nextboot [-e variable=value] [-f] [-k kernel] [-o options]" echo " nextboot -D" } -while getopts "Dfk:o:" argument ; do +while getopts "De:fk:o:" argument ; do case "${argument}" in D) delete="YES" ;; + e) + var=${OPTARG%%=*} + value=${OPTARG#*=} + if [ -z "$var" -o -z "$value" ]; then + display_usage + exit 1 + fi + add_kenv "$var" "$value" + ;; f) force="YES" ;; k) kernel="${OPTARG}" + add_kenv kernel "$kernel" ;; o) - kernel_options="${OPTARG}" + add_kenv kernel_options "${OPTARG}" ;; *) display_usage @@ -40,12 +68,12 @@ if [ ${delete} = "YES" ]; then exit 0 fi -if [ "xxx${kernel}" = "xxx" ]; then +if [ -z "${kenv}" ]; then display_usage exit 1 fi -if [ ${force} = "NO" -a ! -d /boot/${kernel} ]; then +if [ -n "${kernel}" -a ${force} = "NO" -a ! -d /boot/${kernel} ]; then echo "Error: /boot/${kernel} doesn't exist. Use -f to override." exit 1 fi @@ -60,6 +88,5 @@ done cat > ${nextboot_file} << EOF nextboot_enable="YES" -kernel="${kernel}" -kernel_options="${kernel_options}" +$kenv EOF From owner-svn-src-stable@FreeBSD.ORG Mon Nov 19 15:24:20 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4EEB2193; Mon, 19 Nov 2012 15:24:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 335448FC0C; Mon, 19 Nov 2012 15:24:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJFOKqB082892; Mon, 19 Nov 2012 15:24:20 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJFOKjN082890; Mon, 19 Nov 2012 15:24:20 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191524.qAJFOKjN082890@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 15:24:20 +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: r243281 - stable/9/tools/tools/netmap X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2012 15:24:20 -0000 Author: emaste Date: Mon Nov 19 15:24:19 2012 New Revision: 243281 URL: http://svnweb.freebsd.org/changeset/base/243281 Log: MFC r237729: Fix ioctl type for compiling with clang MFC r241169: Clean up compiler warnings. MFC r241464: Make local function static. Sponsored by: ADARA Networks Modified: stable/9/tools/tools/netmap/bridge.c stable/9/tools/tools/netmap/pcap.c Directory Properties: stable/9/tools/tools/netmap/ (props changed) Modified: stable/9/tools/tools/netmap/bridge.c ============================================================================== --- stable/9/tools/tools/netmap/bridge.c Mon Nov 19 15:12:44 2012 (r243280) +++ stable/9/tools/tools/netmap/bridge.c Mon Nov 19 15:24:19 2012 (r243281) @@ -79,7 +79,7 @@ sigint_h(__unused int sig) static int -do_ioctl(struct my_ring *me, int what) +do_ioctl(struct my_ring *me, unsigned long what) { struct ifreq ifr; int error; @@ -98,7 +98,7 @@ do_ioctl(struct my_ring *me, int what) } error = ioctl(me->fd, what, &ifr); if (error) { - D("ioctl error %d", what); + D("ioctl error 0x%lx", what); return error; } switch (what) { Modified: stable/9/tools/tools/netmap/pcap.c ============================================================================== --- stable/9/tools/tools/netmap/pcap.c Mon Nov 19 15:12:44 2012 (r243280) +++ stable/9/tools/tools/netmap/pcap.c Mon Nov 19 15:24:19 2012 (r243281) @@ -38,7 +38,7 @@ #define MIN(a, b) ((a) < (b) ? (a) : (b)) -char *version = "$Id$"; +const char *version = "$Id$"; int verbose = 0; /* debug support */ @@ -49,7 +49,7 @@ int verbose = 0; __FUNCTION__, __LINE__, ##__VA_ARGS__); \ } while (0) -inline void prefetch (const void *x) +static inline void prefetch (const void *x) { __asm volatile("prefetcht0 %0" :: "m" (*(const unsigned long *)x)); } @@ -135,13 +135,12 @@ typedef enum { PCAP_D_OUT } pcap_direction_t; +struct bpf_program; typedef void (*pcap_handler)(u_char *user, const struct pcap_pkthdr *h, const u_char *bytes); -char errbuf[PCAP_ERRBUF_SIZE]; - pcap_t *pcap_open_live(const char *device, int snaplen, int promisc, int to_ms, char *errbuf); @@ -155,6 +154,24 @@ char *pcap_lookupdev(char *errbuf); int pcap_inject(pcap_t *p, const void *buf, size_t size); int pcap_fileno(pcap_t *p); const char *pcap_lib_version(void); +void pcap_freealldevs(pcap_if_t *); +pcap_t *pcap_create(const char *, char *); +int pcap_activate(pcap_t *); +int pcap_can_set_rfmon(pcap_t *); +int pcap_set_snaplen(pcap_t *, int); +int pcap_snapshot(pcap_t *); +int pcap_lookupnet(const char *, uint32_t *, uint32_t *, char *); +int pcap_set_promisc(pcap_t *, int); +int pcap_set_timeout(pcap_t *, int); +int pcap_compile(pcap_t *, struct bpf_program *, const char *, int, + uint32_t); +int pcap_setfilter(pcap_t *, struct bpf_program *); +int pcap_datalink(pcap_t *); +const char *pcap_datalink_val_to_name(int); +const char *pcap_datalink_val_to_description(int); +int pcap_stats(pcap_t *, struct pcap_stat *); +int pcap_loop(pcap_t *, int, pcap_handler, u_char *); +char *pcap_geterr(pcap_t *); struct eproto { @@ -201,7 +218,7 @@ struct my_ring { static int -do_ioctl(struct my_ring *me, int what) +do_ioctl(struct my_ring *me, unsigned long what) { struct ifreq ifr; int error; @@ -221,7 +238,7 @@ do_ioctl(struct my_ring *me, int what) } error = ioctl(me->fd, what, &ifr); if (error) { - D("ioctl 0x%x error %d", what, error); + D("ioctl 0x%lx error %d", what, error); return error; } switch (what) { @@ -739,7 +756,8 @@ pcap_loop(pcap_t *p, int cnt, pcap_handl #endif /* __PIC__ */ #ifndef __PIC__ -void do_send(u_char *user, const struct pcap_pkthdr *h, const u_char *buf) +static void +do_send(u_char *user, const struct pcap_pkthdr *h, const u_char *buf) { pcap_inject((pcap_t *)user, buf, h->caplen); } From owner-svn-src-stable@FreeBSD.ORG Mon Nov 19 15:26:04 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 535DB401; Mon, 19 Nov 2012 15:26:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 374928FC14; Mon, 19 Nov 2012 15:26:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJFQ4uw083525; Mon, 19 Nov 2012 15:26:04 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJFQ4Xq083523; Mon, 19 Nov 2012 15:26:04 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191526.qAJFQ4Xq083523@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 15:26:04 +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: r243282 - stable/9/sys/netinet/libalias X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2012 15:26:04 -0000 Author: emaste Date: Mon Nov 19 15:26:03 2012 New Revision: 243282 URL: http://svnweb.freebsd.org/changeset/base/243282 Log: MFC r241648: Avoid potential bad pointer dereference. Previously RuleAdd would leave entry->la unset for the first entry in the proxyList. Sponsored by: ADARA Networks Modified: stable/9/sys/netinet/libalias/alias_proxy.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/libalias/alias_proxy.c ============================================================================== --- stable/9/sys/netinet/libalias/alias_proxy.c Mon Nov 19 15:24:19 2012 (r243281) +++ stable/9/sys/netinet/libalias/alias_proxy.c Mon Nov 19 15:26:03 2012 (r243282) @@ -210,13 +210,13 @@ RuleAdd(struct libalias *la, struct prox LIBALIAS_LOCK_ASSERT(la); + entry->la = la; if (la->proxyList == NULL) { la->proxyList = entry; entry->last = NULL; entry->next = NULL; return; } - entry->la = la; rule_index = entry->rule_index; ptr = la->proxyList; From owner-svn-src-stable@FreeBSD.ORG Mon Nov 19 15:31:08 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7ECB9664; Mon, 19 Nov 2012 15:31:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 617098FC0C; Mon, 19 Nov 2012 15:31:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJFV8Ha085015; Mon, 19 Nov 2012 15:31:08 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJFV8FQ085014; Mon, 19 Nov 2012 15:31:08 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191531.qAJFV8FQ085014@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 15:31:08 +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: r243283 - stable/9/sys/net X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2012 15:31:08 -0000 Author: emaste Date: Mon Nov 19 15:31:07 2012 New Revision: 243283 URL: http://svnweb.freebsd.org/changeset/base/243283 Log: MFC r240945: Correct misspelling in debug output. Modified: stable/9/sys/net/if_tap.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/net/if_tap.c ============================================================================== --- stable/9/sys/net/if_tap.c Mon Nov 19 15:26:03 2012 (r243282) +++ stable/9/sys/net/if_tap.c Mon Nov 19 15:31:07 2012 (r243283) @@ -933,7 +933,7 @@ tapwrite(struct cdev *dev, struct uio *u struct ifnet *ifp = tp->tap_ifp; struct mbuf *m; - TAPDEBUG("%s writting, minor = %#x\n", + TAPDEBUG("%s writing, minor = %#x\n", ifp->if_xname, dev2unit(dev)); if (uio->uio_resid == 0) From owner-svn-src-stable@FreeBSD.ORG Mon Nov 19 15:57:55 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ABB1CDA8; Mon, 19 Nov 2012 15:57:55 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 901458FC0C; Mon, 19 Nov 2012 15:57:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJFvt3B091391; Mon, 19 Nov 2012 15:57:55 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJFvtPT091390; Mon, 19 Nov 2012 15:57:55 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191557.qAJFvtPT091390@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 15:57:55 +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: r243284 - stable/9/sys/geom/part X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2012 15:57:55 -0000 Author: emaste Date: Mon Nov 19 15:57:55 2012 New Revision: 243284 URL: http://svnweb.freebsd.org/changeset/base/243284 Log: MFC r230990: Correct typo in comment (numbver) Modified: stable/9/sys/geom/part/g_part.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/part/g_part.c ============================================================================== --- stable/9/sys/geom/part/g_part.c Mon Nov 19 15:31:07 2012 (r243283) +++ stable/9/sys/geom/part/g_part.c Mon Nov 19 15:57:55 2012 (r243284) @@ -221,7 +221,7 @@ g_part_geometry(struct g_part_table *tab continue; /* * Prefer a geometry with sectors > 1, but only if - * it doesn't bump down the numbver of heads to 1. + * it doesn't bump down the number of heads to 1. */ if (chs > bestchs || (chs == bestchs && heads > 1 && table->gpt_sectors == 1)) { From owner-svn-src-stable@FreeBSD.ORG Mon Nov 19 16:02:05 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5FCCAF6C; Mon, 19 Nov 2012 16:02:05 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2A6458FC19; Mon, 19 Nov 2012 16:02:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJG259H092588; Mon, 19 Nov 2012 16:02:05 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJG25vo092587; Mon, 19 Nov 2012 16:02:05 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191602.qAJG25vo092587@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 16:02:05 +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: r243285 - stable/9/sbin/reboot X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2012 16:02:05 -0000 Author: emaste Date: Mon Nov 19 16:02:04 2012 New Revision: 243285 URL: http://svnweb.freebsd.org/changeset/base/243285 Log: MFC r231129: Add BSD copyright notice. Modified: stable/9/sbin/reboot/nextboot.sh Directory Properties: stable/9/sbin/reboot/ (props changed) Modified: stable/9/sbin/reboot/nextboot.sh ============================================================================== --- stable/9/sbin/reboot/nextboot.sh Mon Nov 19 15:57:55 2012 (r243284) +++ stable/9/sbin/reboot/nextboot.sh Mon Nov 19 16:02:04 2012 (r243285) @@ -1,9 +1,29 @@ #! /bin/sh # -# Copyright 2002. Gordon Tetlow. -# gordon@FreeBSD.org +# Copyright (c) 2002 Gordon Tetlow. All rights reserved. # Copyright (c) 2012 Sandvine Incorporated. 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$ delete="NO" From owner-svn-src-stable@FreeBSD.ORG Mon Nov 19 16:16:34 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CEB50400; Mon, 19 Nov 2012 16:16:34 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B0C8D8FC13; Mon, 19 Nov 2012 16:16:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJGGYNt095912; Mon, 19 Nov 2012 16:16:34 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJGGYJo095911; Mon, 19 Nov 2012 16:16:34 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191616.qAJGGYJo095911@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 16:16:34 +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: r243286 - stable/9/sys/dev/aac X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2012 16:16:34 -0000 Author: emaste Date: Mon Nov 19 16:16:34 2012 New Revision: 243286 URL: http://svnweb.freebsd.org/changeset/base/243286 Log: MFC r231589: Add a sysctl to report the firmware build number. Some older firmware versions have issues that can be worked around by avoiding certain operations. Add a sysctl dev.aac.#.firmware_build to make it easy for scripts or userland tools to detect the firmware version. Modified: stable/9/sys/dev/aac/aac.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/aac/aac.c ============================================================================== --- stable/9/sys/dev/aac/aac.c Mon Nov 19 16:02:04 2012 (r243285) +++ stable/9/sys/dev/aac/aac.c Mon Nov 19 16:16:34 2012 (r243286) @@ -292,6 +292,15 @@ aac_attach(struct aac_softc *sc) aac_describe_controller(sc); /* + * Add sysctls. + */ + SYSCTL_ADD_INT(device_get_sysctl_ctx(sc->aac_dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(sc->aac_dev)), + OID_AUTO, "firmware_build", CTLFLAG_RD, + &sc->aac_revision.buildNumber, 0, + "firmware build number"); + + /* * Register to probe our containers later. */ sc->aac_ich.ich_func = aac_startup; From owner-svn-src-stable@FreeBSD.ORG Mon Nov 19 16:39:10 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5896FD3B; Mon, 19 Nov 2012 16:39:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3AC768FC16; Mon, 19 Nov 2012 16:39:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJGdAB6000750; Mon, 19 Nov 2012 16:39:10 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJGdAiM000749; Mon, 19 Nov 2012 16:39:10 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191639.qAJGdAiM000749@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 16:39:10 +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: r243287 - stable/8/sys/netinet/libalias X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2012 16:39:10 -0000 Author: emaste Date: Mon Nov 19 16:39:09 2012 New Revision: 243287 URL: http://svnweb.freebsd.org/changeset/base/243287 Log: MFC r241648: Avoid potential bad pointer dereference. Previously RuleAdd would leave entry->la unset for the first entry in the proxyList. Sponsored by: ADARA Networks Modified: stable/8/sys/netinet/libalias/alias_proxy.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/netinet/libalias/alias_proxy.c ============================================================================== --- stable/8/sys/netinet/libalias/alias_proxy.c Mon Nov 19 16:16:34 2012 (r243286) +++ stable/8/sys/netinet/libalias/alias_proxy.c Mon Nov 19 16:39:09 2012 (r243287) @@ -210,13 +210,13 @@ RuleAdd(struct libalias *la, struct prox LIBALIAS_LOCK_ASSERT(la); + entry->la = la; if (la->proxyList == NULL) { la->proxyList = entry; entry->last = NULL; entry->next = NULL; return; } - entry->la = la; rule_index = entry->rule_index; ptr = la->proxyList; From owner-svn-src-stable@FreeBSD.ORG Mon Nov 19 16:52:59 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F3F06286; Mon, 19 Nov 2012 16:52:58 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D81548FC12; Mon, 19 Nov 2012 16:52:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJGqwNL002873; Mon, 19 Nov 2012 16:52:58 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJGqwN6002872; Mon, 19 Nov 2012 16:52:58 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191652.qAJGqwN6002872@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 16:52:58 +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: r243288 - stable/9/sys/geom/part X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2012 16:52:59 -0000 Author: emaste Date: Mon Nov 19 16:52:58 2012 New Revision: 243288 URL: http://svnweb.freebsd.org/changeset/base/243288 Log: MFC r232680: Remove unactionable message about label geometry It's not clear to a user what they should do after seeing the "geometry does not match label" kernel message, and it does not appear to present a problem in practice. Thus, just remove the messages. Modified: stable/9/sys/geom/part/g_part_bsd.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/part/g_part_bsd.c ============================================================================== --- stable/9/sys/geom/part/g_part_bsd.c Mon Nov 19 16:39:09 2012 (r243287) +++ stable/9/sys/geom/part/g_part_bsd.c Mon Nov 19 16:52:58 2012 (r243288) @@ -394,10 +394,6 @@ g_part_bsd_read(struct g_part_table *bas goto invalid_label; if (heads != basetable->gpt_heads && !basetable->gpt_fixgeom) basetable->gpt_heads = heads; - if (sectors != basetable->gpt_sectors || heads != basetable->gpt_heads) - printf("GEOM: %s: geometry does not match label" - " (%uh,%us != %uh,%us).\n", pp->name, heads, sectors, - basetable->gpt_heads, basetable->gpt_sectors); chs = le32dec(buf + 60); if (chs < 1) @@ -407,9 +403,6 @@ g_part_bsd_read(struct g_part_table *bas chs = msize; le32enc(buf + 60, msize); } - if (chs != msize) - printf("GEOM: %s: media size does not match label.\n", - pp->name); basetable->gpt_first = 0; basetable->gpt_last = msize - 1; From owner-svn-src-stable@FreeBSD.ORG Mon Nov 19 17:06:22 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1A76C86A; Mon, 19 Nov 2012 17:06:22 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F1EA78FC16; Mon, 19 Nov 2012 17:06:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJH6L5U005363; Mon, 19 Nov 2012 17:06:21 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJH6Lr9005362; Mon, 19 Nov 2012 17:06:21 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191706.qAJH6Lr9005362@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 17:06:21 +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: r243289 - stable/9/sys/net X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2012 17:06:22 -0000 Author: emaste Date: Mon Nov 19 17:06:21 2012 New Revision: 243289 URL: http://svnweb.freebsd.org/changeset/base/243289 Log: MFC r238298: Restore error handling lost in r191603 This was missed in the change from IFQ_ENQUEUE to if_transmit. MFC r238346: Plug potential mbuf leak when bridging fragments If an error occurs when transmitting one mbuf in a chain of fragments, free the subsequent fragments instead of leaking them. MFC r238355: Simplify error case Submitted by: thompsa@ Sponsored by: ADARA Networks Modified: stable/9/sys/net/if_bridge.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/net/if_bridge.c ============================================================================== --- stable/9/sys/net/if_bridge.c Mon Nov 19 16:52:58 2012 (r243288) +++ stable/9/sys/net/if_bridge.c Mon Nov 19 17:06:21 2012 (r243289) @@ -1811,8 +1811,10 @@ bridge_enqueue(struct bridge_softc *sc, m->m_flags &= ~M_VLANTAG; } - if (err == 0) - dst_ifp->if_transmit(dst_ifp, m); + if ((err = dst_ifp->if_transmit(dst_ifp, m))) { + m_freem(m0); + break; + } } if (err == 0) { From owner-svn-src-stable@FreeBSD.ORG Mon Nov 19 17:33:46 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5918ED73; Mon, 19 Nov 2012 17:33:46 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 39CC58FC14; Mon, 19 Nov 2012 17:33:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJHXkeY009693; Mon, 19 Nov 2012 17:33:46 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJHXkLL009692; Mon, 19 Nov 2012 17:33:46 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191733.qAJHXkLL009692@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 17:33:46 +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: r243290 - stable/9/sbin/camcontrol X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2012 17:33:46 -0000 Author: emaste Date: Mon Nov 19 17:33:45 2012 New Revision: 243290 URL: http://svnweb.freebsd.org/changeset/base/243290 Log: MFC r236625 (joel): Minor spelling fixes. Modified: stable/9/sbin/camcontrol/camcontrol.8 Directory Properties: stable/9/sbin/camcontrol/ (props changed) Modified: stable/9/sbin/camcontrol/camcontrol.8 ============================================================================== --- stable/9/sbin/camcontrol/camcontrol.8 Mon Nov 19 17:06:21 2012 (r243289) +++ stable/9/sbin/camcontrol/camcontrol.8 Mon Nov 19 17:33:45 2012 (r243290) @@ -740,7 +740,7 @@ Set the partial pathway timeout value, i See the .Tn ANSI .Tn SAS -Protcol Layer (SPL) +Protocol Layer (SPL) specification for more information on this field. .It Fl a Ar enable|disable Enable or disable SATA slumber phy power conditions. @@ -1111,7 +1111,7 @@ Do not ask for confirmation. Run in simulation mode. Packet sizes that will be sent are shown, but no actual packet is sent to the device. -No confimation is asked in simulation mode. +No confirmation is asked in simulation mode. .It Fl v Besides showing sense information in case of a failure, the verbose option causes From owner-svn-src-stable@FreeBSD.ORG Mon Nov 19 18:18:24 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 97BD7B93; Mon, 19 Nov 2012 18:18:24 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 775B98FC13; Mon, 19 Nov 2012 18:18:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJIIOkO017304; Mon, 19 Nov 2012 18:18:24 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJIIOLH017303; Mon, 19 Nov 2012 18:18:24 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191818.qAJIIOLH017303@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 18:18:24 +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: r243293 - stable/9/usr.bin/w X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2012 18:18:24 -0000 Author: emaste Date: Mon Nov 19 18:18:24 2012 New Revision: 243293 URL: http://svnweb.freebsd.org/changeset/base/243293 Log: MFC r241484: Use CLOCK_UPTIME to get the uptime. Modified: stable/9/usr.bin/w/w.c Directory Properties: stable/9/usr.bin/w/ (props changed) Modified: stable/9/usr.bin/w/w.c ============================================================================== --- stable/9/usr.bin/w/w.c Mon Nov 19 18:09:00 2012 (r243292) +++ stable/9/usr.bin/w/w.c Mon Nov 19 18:18:24 2012 (r243293) @@ -448,7 +448,7 @@ pr_header(time_t *nowp, int nusers) /* * Print how long system has been up. */ - if (clock_gettime(CLOCK_MONOTONIC, &tp) != -1) { + if (clock_gettime(CLOCK_UPTIME, &tp) != -1) { uptime = tp.tv_sec; if (uptime > 60) uptime += 30; From owner-svn-src-stable@FreeBSD.ORG Mon Nov 19 18:20:28 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 55109D83; Mon, 19 Nov 2012 18:20:28 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2D0788FC14; Mon, 19 Nov 2012 18:20:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJIKSEE017707; Mon, 19 Nov 2012 18:20:28 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJIKRAM017703; Mon, 19 Nov 2012 18:20:27 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191820.qAJIKRAM017703@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 18:20: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: r243294 - stable/9/sbin/camcontrol X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2012 18:20:28 -0000 Author: emaste Date: Mon Nov 19 18:20:27 2012 New Revision: 243294 URL: http://svnweb.freebsd.org/changeset/base/243294 Log: MFC (part of) r241737 (ed): More -Wmissing-variable-declarations fixes. In addition to adding `static' where possible: ... - sbin/camcontrol: Move `verbose' into camcontrol.h and fix shadow warnings. ... Modified: stable/9/sbin/camcontrol/camcontrol.c stable/9/sbin/camcontrol/camcontrol.h stable/9/sbin/camcontrol/fwdownload.c stable/9/sbin/camcontrol/modeedit.c Directory Properties: stable/9/sbin/camcontrol/ (props changed) Modified: stable/9/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/9/sbin/camcontrol/camcontrol.c Mon Nov 19 18:18:24 2012 (r243293) +++ stable/9/sbin/camcontrol/camcontrol.c Mon Nov 19 18:20:27 2012 (r243294) @@ -5782,9 +5782,10 @@ bailout: #endif /* MINIMALISTIC */ void -usage(int verbose) +usage(int printlong) { - fprintf(verbose ? stdout : stderr, + + fprintf(printlong ? stdout : stderr, "usage: camcontrol [device id][generic args][command args]\n" " camcontrol devlist [-v]\n" #ifndef MINIMALISTIC @@ -5833,7 +5834,7 @@ usage(int verbose) " camcontrol fwdownload [dev_id][generic args] <-f fw_image> [-y][-s]\n" #endif /* MINIMALISTIC */ " camcontrol help\n"); - if (!verbose) + if (!printlong) return; #ifndef MINIMALISTIC fprintf(stdout, Modified: stable/9/sbin/camcontrol/camcontrol.h ============================================================================== --- stable/9/sbin/camcontrol/camcontrol.h Mon Nov 19 18:18:24 2012 (r243293) +++ stable/9/sbin/camcontrol/camcontrol.h Mon Nov 19 18:20:27 2012 (r243294) @@ -40,8 +40,10 @@ struct get_hook int got; }; +extern int verbose; + int fwdownload(struct cam_device *device, int argc, char **argv, - char *combinedopt, int verbose, int retry_count, int timeout, + char *combinedopt, int printerrors, int retry_count, int timeout, const char */*type*/); void mode_sense(struct cam_device *device, int mode_page, int page_control, int dbd, int retry_count, int timeout, u_int8_t *data, @@ -58,5 +60,5 @@ char *cget(void *hook, char *name); int iget(void *hook, char *name); void arg_put(void *hook, int letter, void *arg, int count, char *name); int get_confirmation(void); -void usage(int verbose); +void usage(int printlong); #endif /* _CAMCONTROL_H */ Modified: stable/9/sbin/camcontrol/fwdownload.c ============================================================================== --- stable/9/sbin/camcontrol/fwdownload.c Mon Nov 19 18:18:24 2012 (r243293) +++ stable/9/sbin/camcontrol/fwdownload.c Mon Nov 19 18:20:27 2012 (r243294) @@ -131,7 +131,7 @@ static char *fw_read_img(const char *fw_ const struct fw_vendor *vp, int *num_bytes); static int fw_download_img(struct cam_device *cam_dev, const struct fw_vendor *vp, char *buf, int img_size, - int sim_mode, int verbose, int retry_count, int timeout, + int sim_mode, int printerrors, int retry_count, int timeout, const char */*name*/, const char */*type*/); /* @@ -238,7 +238,7 @@ bailout1: */ static int fw_download_img(struct cam_device *cam_dev, const struct fw_vendor *vp, - char *buf, int img_size, int sim_mode, int verbose, int retry_count, + char *buf, int img_size, int sim_mode, int printerrors, int retry_count, int timeout, const char *imgname, const char *type) { struct scsi_write_buffer cdb; @@ -290,7 +290,7 @@ fw_download_img(struct cam_device *cam_d ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; if (cam_send_ccb(cam_dev, ccb) < 0) { warnx("Error sending identify/test unit ready"); - if (verbose) + if (printerrors) cam_error_print(cam_dev, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); cam_freeccb(ccb); @@ -298,7 +298,7 @@ fw_download_img(struct cam_device *cam_d } if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { warnx("Device is not ready"); - if (verbose) + if (printerrors) cam_error_print(cam_dev, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); cam_freeccb(ccb); @@ -372,7 +372,7 @@ fw_download_img(struct cam_device *cam_d /* Execute the command. */ if (cam_send_ccb(cam_dev, ccb) < 0) { warnx("Error writing image to device"); - if (verbose) + if (printerrors) cam_error_print(cam_dev, ccb, CAM_ESF_ALL, CAM_EPF_ALL, stderr); goto bailout; @@ -398,7 +398,7 @@ bailout: int fwdownload(struct cam_device *device, int argc, char **argv, - char *combinedopt, int verbose, int retry_count, int timeout, + char *combinedopt, int printerrors, int retry_count, int timeout, const char *type) { const struct fw_vendor *vp; @@ -450,7 +450,7 @@ fwdownload(struct cam_device *device, in if (sim_mode) fprintf(stdout, "Running in simulation mode\n"); - if (fw_download_img(device, vp, buf, img_size, sim_mode, verbose, + if (fw_download_img(device, vp, buf, img_size, sim_mode, printerrors, retry_count, timeout, fw_img_path, type) != 0) { fprintf(stderr, "Firmware download failed\n"); goto fail; Modified: stable/9/sbin/camcontrol/modeedit.c ============================================================================== --- stable/9/sbin/camcontrol/modeedit.c Mon Nov 19 18:18:24 2012 (r243293) +++ stable/9/sbin/camcontrol/modeedit.c Mon Nov 19 18:20:27 2012 (r243294) @@ -48,8 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include "camcontrol.h" -int verbose = 0; - #define DEFAULT_SCSI_MODE_DB "/usr/share/misc/scsi_modes" #define DEFAULT_EDITOR "vi" #define MAX_FORMAT_SPEC 4096 /* Max CDB format specifier. */ From owner-svn-src-stable@FreeBSD.ORG Mon Nov 19 18:25:04 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1A3F5F36; Mon, 19 Nov 2012 18:25:04 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D84C18FC12; Mon, 19 Nov 2012 18:25:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJIP3he018554; Mon, 19 Nov 2012 18:25:03 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJIP3md018553; Mon, 19 Nov 2012 18:25:03 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191825.qAJIP3md018553@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 18:25: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: r243295 - stable/9/sbin/camcontrol X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2012 18:25:04 -0000 Author: emaste Date: Mon Nov 19 18:25:03 2012 New Revision: 243295 URL: http://svnweb.freebsd.org/changeset/base/243295 Log: MFC (part of) r227081 (ed): Add missing static keywords for global variables to tools in sbin/. These tools declare global variables without using the static keyword, even though their use is limited to a single C-file, or without placing an extern declaration of them in the proper header file. Modified: stable/9/sbin/camcontrol/camcontrol.c Directory Properties: stable/9/sbin/camcontrol/ (props changed) Modified: stable/9/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/9/sbin/camcontrol/camcontrol.c Mon Nov 19 18:20:27 2012 (r243294) +++ stable/9/sbin/camcontrol/camcontrol.c Mon Nov 19 18:25:03 2012 (r243295) @@ -142,7 +142,7 @@ static const char smppc_opts[] = "a:A:d: static const char smpphylist_opts[] = "lq"; #endif -struct camcontrol_opts option_table[] = { +static struct camcontrol_opts option_table[] = { #ifndef MINIMALISTIC {"tur", CAM_CMD_TUR, CAM_ARG_NONE, NULL}, {"inquiry", CAM_CMD_INQUIRY, CAM_ARG_NONE, "DSR"}, @@ -210,8 +210,8 @@ struct cam_devlist { path_id_t path_id; }; -cam_cmdmask cmdlist; -cam_argmask arglist; +static cam_cmdmask cmdlist; +static cam_argmask arglist; camcontrol_optret getoption(struct camcontrol_opts *table, char *arg, uint32_t *cmdnum, cam_argmask *argnum, @@ -4780,7 +4780,7 @@ bailout: return (error); } -struct camcontrol_opts phy_ops[] = { +static struct camcontrol_opts phy_ops[] = { {"nop", SMP_PC_PHY_OP_NOP, CAM_ARG_NONE, NULL}, {"linkreset", SMP_PC_PHY_OP_LINK_RESET, CAM_ARG_NONE, NULL}, {"hardreset", SMP_PC_PHY_OP_HARD_RESET, CAM_ARG_NONE, NULL}, From owner-svn-src-stable@FreeBSD.ORG Mon Nov 19 18:26:09 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 51590122; Mon, 19 Nov 2012 18:26:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3082B8FC14; Mon, 19 Nov 2012 18:26:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJIQ9Dp018790; Mon, 19 Nov 2012 18:26:09 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJIQ98U018789; Mon, 19 Nov 2012 18:26:09 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191826.qAJIQ98U018789@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 18:26: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: r243296 - stable/9/sbin/camcontrol X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2012 18:26:09 -0000 Author: emaste Date: Mon Nov 19 18:26:08 2012 New Revision: 243296 URL: http://svnweb.freebsd.org/changeset/base/243296 Log: MFC (part of) r229778 (uqs): Spelling fixes for sbin Modified: stable/9/sbin/camcontrol/camcontrol.c Directory Properties: stable/9/sbin/camcontrol/ (props changed) Modified: stable/9/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/9/sbin/camcontrol/camcontrol.c Mon Nov 19 18:25:03 2012 (r243295) +++ stable/9/sbin/camcontrol/camcontrol.c Mon Nov 19 18:26:08 2012 (r243296) @@ -5890,7 +5890,7 @@ usage(int printlong) "defects arguments:\n" "-f format specify defect list format (block, bfi or phys)\n" "-G get the grown defect list\n" -"-P get the permanant defect list\n" +"-P get the permanent defect list\n" "inquiry arguments:\n" "-D get the standard inquiry data\n" "-S get the serial number\n" From owner-svn-src-stable@FreeBSD.ORG Mon Nov 19 18:43:13 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E68E7ABA; Mon, 19 Nov 2012 18:43:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C9ABA8FC18; Mon, 19 Nov 2012 18:43:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJIhDbm021927; Mon, 19 Nov 2012 18:43:13 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJIhDgU021926; Mon, 19 Nov 2012 18:43:13 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191843.qAJIhDgU021926@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 18:43:13 +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: r243297 - stable/9/usr.sbin/tzsetup X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2012 18:43:14 -0000 Author: emaste Date: Mon Nov 19 18:43:13 2012 New Revision: 243297 URL: http://svnweb.freebsd.org/changeset/base/243297 Log: MFC r232297: Grammar: tzsetup now has more than one option. Modified: stable/9/usr.sbin/tzsetup/tzsetup.8 Directory Properties: stable/9/usr.sbin/tzsetup/ (props changed) Modified: stable/9/usr.sbin/tzsetup/tzsetup.8 ============================================================================== --- stable/9/usr.sbin/tzsetup/tzsetup.8 Mon Nov 19 18:26:08 2012 (r243296) +++ stable/9/usr.sbin/tzsetup/tzsetup.8 Mon Nov 19 18:43:13 2012 (r243297) @@ -49,7 +49,7 @@ utility also determines whether any adju the hardware clock does not keep .Tn UTC . .Pp -The following option is available: +The following options are available: .Bl -tag -offset indent -width Fl .It Fl C Ar chroot_directory Open all files and directories relative to From owner-svn-src-stable@FreeBSD.ORG Mon Nov 19 18:54:37 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B0D95151; Mon, 19 Nov 2012 18:54:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 920268FC15; Mon, 19 Nov 2012 18:54:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJIsbk9023314; Mon, 19 Nov 2012 18:54:37 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJIsbVA023313; Mon, 19 Nov 2012 18:54:37 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191854.qAJIsbVA023313@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 18:54:37 +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: r243298 - stable/9/share/man/man4 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2012 18:54:37 -0000 Author: emaste Date: Mon Nov 19 18:54:37 2012 New Revision: 243298 URL: http://svnweb.freebsd.org/changeset/base/243298 Log: MFC r232678: Inbound TCP-MD5 digest validation is now supported MFC r232695: Correct markup, use proper reference for sysctl(3) Submitted by: brueffer@ MFC r232725: Remove undesired sysctl(3) xref Submitted by: bde Modified: stable/9/share/man/man4/tcp.4 Directory Properties: stable/9/share/man/ (props changed) stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/tcp.4 ============================================================================== --- stable/9/share/man/man4/tcp.4 Mon Nov 19 18:43:13 2012 (r243297) +++ stable/9/share/man/man4/tcp.4 Mon Nov 19 18:54:37 2012 (r243298) @@ -38,7 +38,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd February 5, 2012 +.Dd November 19, 2012 .Dt TCP 4 .Os .Sh NAME @@ -255,8 +255,10 @@ or the internal send buffer is filled. .It Dv TCP_MD5SIG This option enables the use of MD5 digests (also known as TCP-MD5) on writes to the specified socket. -In the current release, only outgoing traffic is digested; -digests on incoming traffic are not verified. +Outgoing traffic is digested; +digests on incoming traffic are verified if the +.Va net.inet.tcp.signature_verify_input +sysctl is nonzero. The current default behavior for the system is to respond to a system advertising this option with TCP-MD5; this may change. .Pp From owner-svn-src-stable@FreeBSD.ORG Mon Nov 19 19:14:26 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ECB4C8E3; Mon, 19 Nov 2012 19:14:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C68128FC12; Mon, 19 Nov 2012 19:14:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJJEPa1026304; Mon, 19 Nov 2012 19:14:25 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJJEPAk026303; Mon, 19 Nov 2012 19:14:25 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191914.qAJJEPAk026303@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 19:14: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: r243299 - stable/9/tools/tools/netmap X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2012 19:14:26 -0000 Author: emaste Date: Mon Nov 19 19:14:25 2012 New Revision: 243299 URL: http://svnweb.freebsd.org/changeset/base/243299 Log: Sync netmap pkt-gen with HEAD. MFC r238081, r238165, r238170, r238175, r239139, r239145, r240103, r238081: r238165: Allow threads to finish up when terminated by user Set a flag and allow worker threads to finish upon ^C, instead of immediately cancelling them, so that final packet count and rate stats can be displayed. r238170: Also report tx bandwidth with Ethernet overhead r238175: Allow continuous packet transmission (via -t 0) Also add a missing check for the cancel flag while waiting for the first packet in receive mode. r239139: Round displayed pps (instead of truncating) r239145: Be more descriptive about poll error / timeout when transmitting. r240103: Failure to open netmap device is unrecoverable. There's no reason to "fail later" since there's nothing this tool can do in netmap mode without /dev/netmap open. Sponsored by: ADARA Networks Modified: stable/9/tools/tools/netmap/pkt-gen.c Directory Properties: stable/9/tools/tools/netmap/ (props changed) Modified: stable/9/tools/tools/netmap/pkt-gen.c ============================================================================== --- stable/9/tools/tools/netmap/pkt-gen.c Mon Nov 19 18:54:37 2012 (r243298) +++ stable/9/tools/tools/netmap/pkt-gen.c Mon Nov 19 19:14:25 2012 (r243299) @@ -95,7 +95,7 @@ inline void prefetch (const void *x) __asm volatile("prefetcht0 %0" :: "m" (*(const unsigned long *)x)); } -// XXX only for multiples of 32 bytes, non overlapped. +// XXX only for multiples of 64 bytes, non overlapped. static inline void pkt_copy(void *_src, void *_dst, int l) { @@ -191,6 +191,7 @@ struct targ { struct glob_arg *g; int used; int completed; + int cancel; int fd; struct nmreq nmr; struct netmap_if *nifp; @@ -221,15 +222,8 @@ static int global_nthreads; static void sigint_h(__unused int sig) { - for (int i = 0; i < global_nthreads; i++) { - /* cancel active threads. */ - if (targs[i].used == 0) - continue; - - D("Cancelling thread #%d\n", i); - pthread_cancel(targs[i].thread); - targs[i].used = 0; - } + for (int i = 0; i < global_nthreads; i++) + targs[i].cancel = 1; signal(SIGINT, SIG_DFL); } @@ -474,13 +468,19 @@ static void * sender_body(void *data) { struct targ *targ = (struct targ *) data; - struct pollfd fds[1]; struct netmap_if *nifp = targ->nifp; struct netmap_ring *txring; - int i, n = targ->g->npackets / targ->g->nthreads, sent = 0; + int i, pkts_per_td = targ->g->npackets / targ->g->nthreads, sent = 0; + int continuous = 0; int options = targ->g->options | OPT_COPY; + int retval; + D("start"); + if (pkts_per_td == 0) { + continuous = 1; + pkts_per_td = 100000; + } if (setaffinity(targ->thread, targ->affinity)) goto quit; /* setup poll(2) mechanism. */ @@ -495,7 +495,7 @@ D("start"); void *pkt = &targ->pkt; pcap_t *p = targ->g->p; - for (i = 0; sent < n; i++) { + for (i = 0; (sent < pkts_per_td && !targ->cancel) || continuous; i++) { if (pcap_inject(p, pkt, size) != -1) sent++; if (i > 10000) { @@ -504,13 +504,19 @@ D("start"); } } } else { - while (sent < n) { + while (sent < pkts_per_td || continuous) { /* * wait for available room in the send queue(s) */ - if (poll(fds, 1, 2000) <= 0) { - D("poll error/timeout on queue %d\n", targ->me); + if ((retval = poll(fds, 1, 2000)) <= 0) { + if (targ->cancel) + break; + if (retval == 0) + D("poll timeout on queue %d\n", targ->me); + else + D("poll error on queue %d: %s\n", targ->me, + strerror(errno)); goto quit; } /* @@ -518,8 +524,10 @@ D("start"); */ if (sent > 100000 && !(targ->g->options & OPT_COPY) ) options &= ~OPT_COPY; - for (i = targ->qfirst; i < targ->qlast; i++) { - int m, limit = MIN(n - sent, targ->g->burst); + for (i = targ->qfirst; i < targ->qlast && !targ->cancel; i++) { + int m, limit = targ->g->burst; + if (!continuous && pkts_per_td - sent < limit) + limit = pkts_per_td - sent; txring = NETMAP_TXRING(nifp, i); if (txring->avail == 0) @@ -529,6 +537,8 @@ D("start"); sent += m; targ->count = sent; } + if (targ->cancel) + break; } /* flush any remaining packets */ ioctl(fds[0].fd, NIOCTXSYNC, NULL); @@ -604,7 +614,7 @@ receiver_body(void *data) fds[0].events = (POLLIN); /* unbounded wait for the first packet. */ - for (;;) { + while (!targ->cancel) { i = poll(fds, 1, 1000); if (i > 0 && !(fds[0].revents & POLLERR)) break; @@ -614,11 +624,11 @@ receiver_body(void *data) /* main loop, exit after 1s silence */ gettimeofday(&targ->tic, NULL); if (targ->g->use_pcap) { - for (;;) { + while (!targ->cancel) { pcap_dispatch(targ->g->p, targ->g->burst, receive_pcap, NULL); } } else { - while (1) { + while (!targ->cancel) { /* Once we started to receive packets, wait at most 1 seconds before quitting. */ if (poll(fds, 1, 1 * 1000) <= 0) { @@ -655,27 +665,41 @@ quit: return (NULL); } +static char * +scaled_val(double val) +{ + static char buf[64]; + const char *units[] = {"", "K", "M", "G"}; + int i = 0; + + while (val >= 1000 && i < 3) { + val /= 1000; + i++; + } + snprintf(buf, sizeof(buf), "%.2f%s", val, units[i]); + return (buf); +} + static void tx_output(uint64_t sent, int size, double delta) { - double amount = 8.0 * (1.0 * size * sent) / delta; + uint64_t bytes_sent = sent * size; + double bw = 8.0 * bytes_sent / delta; double pps = sent / delta; - char units[4] = { '\0', 'K', 'M', 'G' }; - int aunit = 0, punit = 0; - - while (amount >= 1000) { - amount /= 1000; - aunit += 1; - } - while (pps >= 1000) { - pps /= 1000; - punit += 1; - } + /* + * Assume Ethernet overhead of 24 bytes per packet excluding header: + * FCS 4 bytes + * Preamble 8 bytes + * IFG 12 bytes + */ + double bw_with_overhead = 8.0 * (bytes_sent + sent * 24) / delta; printf("Sent %" PRIu64 " packets, %d bytes each, in %.2f seconds.\n", sent, size, delta); - printf("Speed: %.2f%cpps. Bandwidth: %.2f%cbps.\n", - pps, units[punit], amount, units[aunit]); + printf("Speed: %spps. ", scaled_val(pps)); + printf("Bandwidth: %sbps ", scaled_val(bw)); + printf("(%sbps with overhead).\n", scaled_val(bw_with_overhead)); + } @@ -704,7 +728,7 @@ usage(void) "Usage:\n" "%s arguments\n" "\t-i interface interface name\n" - "\t-t pkts_to_send also forces send mode\n" + "\t-t pkts_to_send also forces send mode, 0 = continuous\n" "\t-r pkts_to_receive also forces receive mode\n" "\t-l pkts_size in bytes excluding CRC\n" "\t-d dst-ip end with %%n to sweep n addresses\n" @@ -868,7 +892,7 @@ main(int arc, char **argv) fd = open("/dev/netmap", O_RDWR); if (fd == -1) { D("Unable to open /dev/netmap"); - // fail later + exit(1); } else { if ((ioctl(fd, NIOCGINFO, &nmr)) == -1) { D("Unable to get if info without name"); @@ -1057,7 +1081,7 @@ main(int arc, char **argv) pps = toc.tv_sec* 1000000 + toc.tv_usec; if (pps < 10000) continue; - pps = (my_count - prev)*1000000 / pps; + pps = ((my_count - prev) * 1000000 + pps / 2) / pps; D("%" PRIu64 " pps", pps); prev = my_count; toc = now; From owner-svn-src-stable@FreeBSD.ORG Mon Nov 19 19:24:49 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 88F2FF7F; Mon, 19 Nov 2012 19:24:49 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 535FE8FC13; Mon, 19 Nov 2012 19:24:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJJOntv027652; Mon, 19 Nov 2012 19:24:49 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJJOnjY027650; Mon, 19 Nov 2012 19:24:49 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191924.qAJJOnjY027650@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 19:24:49 +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: r243301 - stable/9/sys/dev/netmap X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2012 19:24:49 -0000 Author: emaste Date: Mon Nov 19 19:24:48 2012 New Revision: 243301 URL: http://svnweb.freebsd.org/changeset/base/243301 Log: MFC r239140: Clarify comments about number of tx / rx rings MFC r239141: Fix whitespace (missing newline) Sponsored by: ADARA Networks Modified: stable/9/sys/dev/netmap/netmap.c stable/9/sys/dev/netmap/netmap_kern.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/netmap/netmap.c ============================================================================== --- stable/9/sys/dev/netmap/netmap.c Mon Nov 19 19:19:04 2012 (r243300) +++ stable/9/sys/dev/netmap/netmap.c Mon Nov 19 19:24:48 2012 (r243301) @@ -976,7 +976,9 @@ netmap_lock_wrapper(struct ifnet *dev, i * kring N+1 is only used for the selinfo for all queues. * Return 0 on success, ENOMEM otherwise. * - * na->num_tx_rings can be set for cards with different tx/rx setups + * By default the receive and transmit adapter ring counts are both initialized + * to num_queues. na->num_tx_rings can be set for cards with different tx/rx + * setups. */ int netmap_attach(struct netmap_adapter *na, int num_queues) Modified: stable/9/sys/dev/netmap/netmap_kern.h ============================================================================== --- stable/9/sys/dev/netmap/netmap_kern.h Mon Nov 19 19:19:04 2012 (r243300) +++ stable/9/sys/dev/netmap/netmap_kern.h Mon Nov 19 19:24:48 2012 (r243301) @@ -118,8 +118,8 @@ struct netmap_adapter { int separate_locks; /* set if the interface suports different locks for rx, tx and core. */ - u_int num_rx_rings; /* number of tx/rx ring pairs */ - u_int num_tx_rings; // if nonzero, overrides num_rx_rings + u_int num_rx_rings; /* number of adapter receive rings */ + u_int num_tx_rings; /* number of adapter transmit rings */ u_int num_tx_desc; /* number of descriptor in each queue */ u_int num_rx_desc; From owner-svn-src-stable@FreeBSD.ORG Mon Nov 19 19:26:59 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D1E822E0; Mon, 19 Nov 2012 19:26:59 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B5E918FC15; Mon, 19 Nov 2012 19:26:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJJQxdR027984; Mon, 19 Nov 2012 19:26:59 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJJQxSk027983; Mon, 19 Nov 2012 19:26:59 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191926.qAJJQxSk027983@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 19:26:59 +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: r243303 - stable/9/sys/dev/re X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2012 19:26:59 -0000 Author: emaste Date: Mon Nov 19 19:26:59 2012 New Revision: 243303 URL: http://svnweb.freebsd.org/changeset/base/243303 Log: MFC r239234: Use array notation for consistency. Modified: stable/9/sys/dev/re/if_re.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/re/if_re.c ============================================================================== --- stable/9/sys/dev/re/if_re.c Mon Nov 19 19:26:19 2012 (r243302) +++ stable/9/sys/dev/re/if_re.c Mon Nov 19 19:26:59 2012 (r243303) @@ -2111,8 +2111,8 @@ re_rxeof(struct rl_softc *sc, int *rx_np ifp = sc->rl_ifp; #ifdef DEV_NETMAP if (ifp->if_capenable & IFCAP_NETMAP) { - NA(ifp)->rx_rings->nr_kflags |= NKR_PENDINTR; - selwakeuppri(&NA(ifp)->rx_rings->si, PI_NET); + NA(ifp)->rx_rings[0].nr_kflags |= NKR_PENDINTR; + selwakeuppri(&NA(ifp)->rx_rings[0].si, PI_NET); return 0; } #endif /* DEV_NETMAP */ From owner-svn-src-stable@FreeBSD.ORG Mon Nov 19 19:30:31 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 02B1464F; Mon, 19 Nov 2012 19:30:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DA8098FC14; Mon, 19 Nov 2012 19:30:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJJUUDw028488; Mon, 19 Nov 2012 19:30:30 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJJUUOT028487; Mon, 19 Nov 2012 19:30:30 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191930.qAJJUUOT028487@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 19:30:30 +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: r243304 - stable/9/sys/dev/netmap X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2012 19:30:31 -0000 Author: emaste Date: Mon Nov 19 19:30:30 2012 New Revision: 243304 URL: http://svnweb.freebsd.org/changeset/base/243304 Log: MFC r241643: Avoid panic when a netmap instance cannot obtain memory. A uint32_t is always >= 0. Sponsored by: ADARA Networks Modified: stable/9/sys/dev/netmap/netmap_mem2.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/netmap/netmap_mem2.c ============================================================================== --- stable/9/sys/dev/netmap/netmap_mem2.c Mon Nov 19 19:26:59 2012 (r243303) +++ stable/9/sys/dev/netmap/netmap_mem2.c Mon Nov 19 19:30:30 2012 (r243304) @@ -324,7 +324,8 @@ netmap_new_bufs(struct netmap_if *nifp _ return; cleanup: - for (i--; i >= 0; i--) { + while (i > 0) { + i--; netmap_obj_free(nm_mem->nm_buf_pool, slot[i].buf_idx); } } From owner-svn-src-stable@FreeBSD.ORG Mon Nov 19 19:31:55 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B1D3A7D1; Mon, 19 Nov 2012 19:31:55 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7CF4B8FC08; Mon, 19 Nov 2012 19:31:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJJVt61028776; Mon, 19 Nov 2012 19:31:55 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJJVt90028775; Mon, 19 Nov 2012 19:31:55 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201211191931.qAJJVt90028775@svn.freebsd.org> From: Ed Maste Date: Mon, 19 Nov 2012 19:31:55 +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: r243306 - stable/9/sys/dev/netmap X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2012 19:31:55 -0000 Author: emaste Date: Mon Nov 19 19:31:55 2012 New Revision: 243306 URL: http://svnweb.freebsd.org/changeset/base/243306 Log: MFC r239242: Reword comment to try to improve clarity, and fix a typo. Modified: stable/9/sys/dev/netmap/ixgbe_netmap.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/netmap/ixgbe_netmap.h ============================================================================== --- stable/9/sys/dev/netmap/ixgbe_netmap.h Mon Nov 19 19:31:54 2012 (r243305) +++ stable/9/sys/dev/netmap/ixgbe_netmap.h Mon Nov 19 19:31:55 2012 (r243306) @@ -198,14 +198,17 @@ fail: * Reconcile kernel and user view of the transmit ring. * This routine might be called frequently so it must be efficient. * - * Userspace has filled tx slots up to ring->cur (excluded). - * The last unused slot previously known to the kernel was kring->nkr_hwcur, - * and the last interrupt reported kring->nr_hwavail slots available. + * ring->cur holds the userspace view of the current ring index. Userspace + * has filled the tx slots from the previous call's ring->cur up to but not + * including ring->cur for this call. In this function the kernel updates + * kring->nr_hwcur to ring->cur, thus slots [kring->nr_hwcur, ring->cur) are + * now ready to transmit. At the last interrupt kring->nr_hwavail slots were + * available. * * This function runs under lock (acquired from the caller or internally). * It must first update ring->avail to what the kernel knows, - * subtract the newly used slots (ring->cur - kring->nkr_hwcur) - * from both avail and nr_hwavail, and set ring->nkr_hwcur = ring->cur + * subtract the newly used slots (ring->cur - kring->nr_hwcur) + * from both avail and nr_hwavail, and set ring->nr_hwcur = ring->cur * issuing a dmamap_sync on all slots. * * Since ring comes from userspace, its content must be read only once, From owner-svn-src-stable@FreeBSD.ORG Mon Nov 19 21:10:53 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2E1BDE70; Mon, 19 Nov 2012 21:10:53 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 08A658FC08; Mon, 19 Nov 2012 21:10:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJLAqNk042056; Mon, 19 Nov 2012 21:10:52 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJLAqpr042055; Mon, 19 Nov 2012 21:10:52 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201211192110.qAJLAqpr042055@svn.freebsd.org> From: Mikolaj Golub Date: Mon, 19 Nov 2012 21:10:52 +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: r243308 - 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-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2012 21:10:53 -0000 Author: trociny Date: Mon Nov 19 21:10:52 2012 New Revision: 243308 URL: http://svnweb.freebsd.org/changeset/base/243308 Log: MFC r240997: Kernel and modules have "set_vnet" linker set, where virtualized global variables are placed. When a module is loaded by link_elf linker its variables from "set_vnet" linker set are copied to the kernel "set_vnet" ("modspace") and all references to these variables inside the module are relocated accordingly. The issue is when a module is loaded that has references to global variables from another, previously loaded module: these references are not relocated so an invalid address is used when the module tries to access the variable. The example is V_layer3_chain, defined in ipfw module and accessed from ipfw_nat. The same issue is with DPCPU variables, which use "set_pcpu" linker set. Fix this making the link_elf linker on a module load recognize "external" DPCPU/VNET variables defined in the previously loaded modules and relocate them accordingly. For this set_pcpu_list and set_vnet_list are used, where the addresses of modules' "set_pcpu" and "set_vnet" linker sets are stored. Note, archs that use link_elf_obj (amd64) were not affected by this issue. Reviewed by: jhb, julian, zec (initial version) Modified: stable/9/sys/kern/link_elf.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/link_elf.c ============================================================================== --- stable/9/sys/kern/link_elf.c Mon Nov 19 20:43:19 2012 (r243307) +++ stable/9/sys/kern/link_elf.c Mon Nov 19 21:10:52 2012 (r243308) @@ -123,6 +123,15 @@ typedef struct elf_file { #endif } *elf_file_t; +struct elf_set { + Elf_Addr es_start; + Elf_Addr es_stop; + Elf_Addr es_base; + TAILQ_ENTRY(elf_set) es_link; +}; + +TAILQ_HEAD(elf_set_head, elf_set); + #include static int link_elf_link_common_finish(linker_file_t); @@ -181,6 +190,75 @@ static int parse_dynamic(elf_file_t); static int relocate_file(elf_file_t); static int link_elf_preload_parse_symbols(elf_file_t); +static struct elf_set_head set_pcpu_list; +#ifdef VIMAGE +static struct elf_set_head set_vnet_list; +#endif + +static void +elf_set_add(struct elf_set_head *list, Elf_Addr start, Elf_Addr stop, Elf_Addr base) +{ + struct elf_set *set, *iter; + + set = malloc(sizeof(*set), M_LINKER, M_WAITOK); + set->es_start = start; + set->es_stop = stop; + set->es_base = base; + + TAILQ_FOREACH(iter, list, es_link) { + + KASSERT((set->es_start < iter->es_start && set->es_stop < iter->es_stop) || + (set->es_start > iter->es_start && set->es_stop > iter->es_stop), + ("linker sets intersection: to insert: 0x%jx-0x%jx; inserted: 0x%jx-0x%jx", + (uintmax_t)set->es_start, (uintmax_t)set->es_stop, + (uintmax_t)iter->es_start, (uintmax_t)iter->es_stop)); + + if (iter->es_start > set->es_start) { + TAILQ_INSERT_BEFORE(iter, set, es_link); + break; + } + } + + if (iter == NULL) + TAILQ_INSERT_TAIL(list, set, es_link); +} + +static int +elf_set_find(struct elf_set_head *list, Elf_Addr addr, Elf_Addr *start, Elf_Addr *base) +{ + struct elf_set *set; + + TAILQ_FOREACH(set, list, es_link) { + if (addr < set->es_start) + return (0); + if (addr < set->es_stop) { + *start = set->es_start; + *base = set->es_base; + return (1); + } + } + + return (0); +} + +static void +elf_set_delete(struct elf_set_head *list, Elf_Addr start) +{ + struct elf_set *set; + + TAILQ_FOREACH(set, list, es_link) { + if (start < set->es_start) + break; + if (start == set->es_start) { + TAILQ_REMOVE(list, set, es_link); + free(set, M_LINKER); + return; + } + } + KASSERT(0, ("deleting unknown linker set (start = 0x%jx)", + (uintmax_t)start)); +} + #ifdef GDB static void r_debug_state(struct r_debug *, struct link_map *); @@ -345,6 +423,10 @@ link_elf_init(void* arg) (void)link_elf_link_common_finish(linker_kernel_file); linker_kernel_file->flags |= LINKER_FILE_LINKED; + TAILQ_INIT(&set_pcpu_list); +#ifdef VIMAGE + TAILQ_INIT(&set_vnet_list); +#endif } SYSINIT(link_elf, SI_SUB_KLD, SI_ORDER_THIRD, link_elf_init, 0); @@ -515,6 +597,8 @@ parse_dpcpu(elf_file_t ef) return (ENOSPC); memcpy((void *)ef->pcpu_base, (void *)ef->pcpu_start, count); dpcpu_copy((void *)ef->pcpu_base, count); + elf_set_add(&set_pcpu_list, ef->pcpu_start, ef->pcpu_stop, + ef->pcpu_base); return (0); } @@ -544,6 +628,8 @@ parse_vnet(elf_file_t ef) return (ENOSPC); memcpy((void *)ef->vnet_base, (void *)ef->vnet_start, count); vnet_data_copy((void *)ef->vnet_base, count); + elf_set_add(&set_vnet_list, ef->vnet_start, ef->vnet_stop, + ef->vnet_base); return (0); } @@ -996,11 +1082,13 @@ link_elf_unload_file(linker_file_t file) if (ef->pcpu_base != 0) { dpcpu_free((void *)ef->pcpu_base, ef->pcpu_stop - ef->pcpu_start); + elf_set_delete(&set_pcpu_list, ef->pcpu_start); } #ifdef VIMAGE if (ef->vnet_base != 0) { vnet_data_free((void *)ef->vnet_base, ef->vnet_stop - ef->vnet_start); + elf_set_delete(&set_vnet_list, ef->vnet_start); } #endif #ifdef GDB @@ -1439,6 +1527,7 @@ elf_lookup(linker_file_t lf, Elf_Size sy elf_file_t ef = (elf_file_t)lf; const Elf_Sym *sym; const char *symbol; + Elf_Addr addr, start, base; /* Don't even try to lookup the symbol if the index is bogus. */ if (symidx >= ef->nchains) @@ -1470,7 +1559,15 @@ elf_lookup(linker_file_t lf, Elf_Size sy if (*symbol == 0) return (0); - return ((Elf_Addr)linker_file_lookup_symbol(lf, symbol, deps)); + addr = ((Elf_Addr)linker_file_lookup_symbol(lf, symbol, deps)); + + if (elf_set_find(&set_pcpu_list, addr, &start, &base)) + addr = addr - start + base; +#ifdef VIMAGE + else if (elf_set_find(&set_vnet_list, addr, &start, &base)) + addr = addr - start + base; +#endif + return addr; } static void From owner-svn-src-stable@FreeBSD.ORG Mon Nov 19 21:11:59 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 517481B4; Mon, 19 Nov 2012 21:11:59 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2B3CA8FC0C; Mon, 19 Nov 2012 21:11:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAJLBxlq042288; Mon, 19 Nov 2012 21:11:59 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAJLBxmA042287; Mon, 19 Nov 2012 21:11:59 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201211192111.qAJLBxmA042287@svn.freebsd.org> From: Mikolaj Golub Date: Mon, 19 Nov 2012 21:11:59 +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: r243309 - stable/8/sys/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Nov 2012 21:11:59 -0000 Author: trociny Date: Mon Nov 19 21:11:58 2012 New Revision: 243309 URL: http://svnweb.freebsd.org/changeset/base/243309 Log: MFC r240997: Kernel and modules have "set_vnet" linker set, where virtualized global variables are placed. When a module is loaded by link_elf linker its variables from "set_vnet" linker set are copied to the kernel "set_vnet" ("modspace") and all references to these variables inside the module are relocated accordingly. The issue is when a module is loaded that has references to global variables from another, previously loaded module: these references are not relocated so an invalid address is used when the module tries to access the variable. The example is V_layer3_chain, defined in ipfw module and accessed from ipfw_nat. The same issue is with DPCPU variables, which use "set_pcpu" linker set. Fix this making the link_elf linker on a module load recognize "external" DPCPU/VNET variables defined in the previously loaded modules and relocate them accordingly. For this set_pcpu_list and set_vnet_list are used, where the addresses of modules' "set_pcpu" and "set_vnet" linker sets are stored. Note, archs that use link_elf_obj (amd64) were not affected by this issue. Reviewed by: jhb, julian, zec (initial version) Modified: stable/8/sys/kern/link_elf.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/link_elf.c ============================================================================== --- stable/8/sys/kern/link_elf.c Mon Nov 19 21:10:52 2012 (r243308) +++ stable/8/sys/kern/link_elf.c Mon Nov 19 21:11:58 2012 (r243309) @@ -123,6 +123,15 @@ typedef struct elf_file { #endif } *elf_file_t; +struct elf_set { + Elf_Addr es_start; + Elf_Addr es_stop; + Elf_Addr es_base; + TAILQ_ENTRY(elf_set) es_link; +}; + +TAILQ_HEAD(elf_set_head, elf_set); + #include static int link_elf_link_common_finish(linker_file_t); @@ -181,6 +190,75 @@ static int parse_dynamic(elf_file_t); static int relocate_file(elf_file_t); static int link_elf_preload_parse_symbols(elf_file_t); +static struct elf_set_head set_pcpu_list; +#ifdef VIMAGE +static struct elf_set_head set_vnet_list; +#endif + +static void +elf_set_add(struct elf_set_head *list, Elf_Addr start, Elf_Addr stop, Elf_Addr base) +{ + struct elf_set *set, *iter; + + set = malloc(sizeof(*set), M_LINKER, M_WAITOK); + set->es_start = start; + set->es_stop = stop; + set->es_base = base; + + TAILQ_FOREACH(iter, list, es_link) { + + KASSERT((set->es_start < iter->es_start && set->es_stop < iter->es_stop) || + (set->es_start > iter->es_start && set->es_stop > iter->es_stop), + ("linker sets intersection: to insert: 0x%jx-0x%jx; inserted: 0x%jx-0x%jx", + (uintmax_t)set->es_start, (uintmax_t)set->es_stop, + (uintmax_t)iter->es_start, (uintmax_t)iter->es_stop)); + + if (iter->es_start > set->es_start) { + TAILQ_INSERT_BEFORE(iter, set, es_link); + break; + } + } + + if (iter == NULL) + TAILQ_INSERT_TAIL(list, set, es_link); +} + +static int +elf_set_find(struct elf_set_head *list, Elf_Addr addr, Elf_Addr *start, Elf_Addr *base) +{ + struct elf_set *set; + + TAILQ_FOREACH(set, list, es_link) { + if (addr < set->es_start) + return (0); + if (addr < set->es_stop) { + *start = set->es_start; + *base = set->es_base; + return (1); + } + } + + return (0); +} + +static void +elf_set_delete(struct elf_set_head *list, Elf_Addr start) +{ + struct elf_set *set; + + TAILQ_FOREACH(set, list, es_link) { + if (start < set->es_start) + break; + if (start == set->es_start) { + TAILQ_REMOVE(list, set, es_link); + free(set, M_LINKER); + return; + } + } + KASSERT(0, ("deleting unknown linker set (start = 0x%jx)", + (uintmax_t)start)); +} + #ifdef GDB static void r_debug_state(struct r_debug *, struct link_map *); @@ -345,6 +423,10 @@ link_elf_init(void* arg) (void)link_elf_link_common_finish(linker_kernel_file); linker_kernel_file->flags |= LINKER_FILE_LINKED; + TAILQ_INIT(&set_pcpu_list); +#ifdef VIMAGE + TAILQ_INIT(&set_vnet_list); +#endif } SYSINIT(link_elf, SI_SUB_KLD, SI_ORDER_THIRD, link_elf_init, 0); @@ -515,6 +597,8 @@ parse_dpcpu(elf_file_t ef) return (ENOSPC); memcpy((void *)ef->pcpu_base, (void *)ef->pcpu_start, count); dpcpu_copy((void *)ef->pcpu_base, count); + elf_set_add(&set_pcpu_list, ef->pcpu_start, ef->pcpu_stop, + ef->pcpu_base); return (0); } @@ -544,6 +628,8 @@ parse_vnet(elf_file_t ef) return (ENOSPC); memcpy((void *)ef->vnet_base, (void *)ef->vnet_start, count); vnet_data_copy((void *)ef->vnet_base, count); + elf_set_add(&set_vnet_list, ef->vnet_start, ef->vnet_stop, + ef->vnet_base); return (0); } @@ -995,11 +1081,13 @@ link_elf_unload_file(linker_file_t file) if (ef->pcpu_base != 0) { dpcpu_free((void *)ef->pcpu_base, ef->pcpu_stop - ef->pcpu_start); + elf_set_delete(&set_pcpu_list, ef->pcpu_start); } #ifdef VIMAGE if (ef->vnet_base != 0) { vnet_data_free((void *)ef->vnet_base, ef->vnet_stop - ef->vnet_start); + elf_set_delete(&set_vnet_list, ef->vnet_start); } #endif #ifdef GDB @@ -1438,6 +1526,7 @@ elf_lookup(linker_file_t lf, Elf_Size sy elf_file_t ef = (elf_file_t)lf; const Elf_Sym *sym; const char *symbol; + Elf_Addr addr, start, base; /* Don't even try to lookup the symbol if the index is bogus. */ if (symidx >= ef->nchains) @@ -1469,7 +1558,15 @@ elf_lookup(linker_file_t lf, Elf_Size sy if (*symbol == 0) return (0); - return ((Elf_Addr)linker_file_lookup_symbol(lf, symbol, deps)); + addr = ((Elf_Addr)linker_file_lookup_symbol(lf, symbol, deps)); + + if (elf_set_find(&set_pcpu_list, addr, &start, &base)) + addr = addr - start + base; +#ifdef VIMAGE + else if (elf_set_find(&set_vnet_list, addr, &start, &base)) + addr = addr - start + base; +#endif + return addr; } static void From owner-svn-src-stable@FreeBSD.ORG Tue Nov 20 11:47:23 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 330818AD; Tue, 20 Nov 2012 11:47:23 +0000 (UTC) (envelope-from demon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0C6618FC08; Tue, 20 Nov 2012 11:47:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAKBlM1v010777; Tue, 20 Nov 2012 11:47:22 GMT (envelope-from demon@svn.freebsd.org) Received: (from demon@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAKBlMFq010776; Tue, 20 Nov 2012 11:47:22 GMT (envelope-from demon@svn.freebsd.org) Message-Id: <201211201147.qAKBlMFq010776@svn.freebsd.org> From: Dmitry Sivachenko Date: Tue, 20 Nov 2012 11:47:22 +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: r243331 - stable/9/include/xlocale X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Nov 2012 11:47:23 -0000 Author: demon (ports committer) Date: Tue Nov 20 11:47:22 2012 New Revision: 243331 URL: http://svnweb.freebsd.org/changeset/base/243331 Log: MFC r243032: Use defined() to test macro definitions. Approved by: theraven Modified: stable/9/include/xlocale/_ctype.h Modified: stable/9/include/xlocale/_ctype.h ============================================================================== --- stable/9/include/xlocale/_ctype.h Tue Nov 20 10:59:41 2012 (r243330) +++ stable/9/include/xlocale/_ctype.h Tue Nov 20 11:47:22 2012 (r243331) @@ -53,7 +53,7 @@ _RuneLocale *__runes_for_locale(locale_t #endif #ifndef _XLOCALE_INLINE -#if __GNUC__ && !__GNUC_STDC_INLINE__ +#if defined(__GNUC__) && !defined(__GNUC_STDC_INLINE__) /* GNU89 inline has nonstandard semantics. */ #define _XLOCALE_INLINE extern __inline #else From owner-svn-src-stable@FreeBSD.ORG Wed Nov 21 00:31:57 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5CBE958C; Wed, 21 Nov 2012 00:31:57 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3E9B88FC12; Wed, 21 Nov 2012 00:31:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAL0Vvt9024951; Wed, 21 Nov 2012 00:31:57 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAL0Vvde024949; Wed, 21 Nov 2012 00:31:57 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211210031.qAL0Vvde024949@svn.freebsd.org> From: Eitan Adler Date: Wed, 21 Nov 2012 00:31:57 +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: r243350 - stable/9/usr.bin/mktemp X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2012 00:31:57 -0000 Author: eadler Date: Wed Nov 21 00:31:56 2012 New Revision: 243350 URL: http://svnweb.freebsd.org/changeset/base/243350 Log: MFC r243240: Use the macro for standard error return values. .Dd not bumped because there is no important content change. Obtained from: DragonflyBSD Approved by: cperciva (implicit) Modified: stable/9/usr.bin/mktemp/mktemp.1 Directory Properties: stable/9/usr.bin/mktemp/ (props changed) Modified: stable/9/usr.bin/mktemp/mktemp.1 ============================================================================== --- stable/9/usr.bin/mktemp/mktemp.1 Wed Nov 21 00:14:03 2012 (r243349) +++ stable/9/usr.bin/mktemp/mktemp.1 Wed Nov 21 00:31:56 2012 (r243350) @@ -158,10 +158,7 @@ Use of this option is not encouraged. .El .Sh EXIT STATUS -The -.Nm -utility -exits 0 on success, and 1 if an error occurs. +.Ex -std .Sh EXAMPLES The following .Xr sh 1 From owner-svn-src-stable@FreeBSD.ORG Wed Nov 21 00:31:57 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7F3AE58D; Wed, 21 Nov 2012 00:31:57 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6210E8FC13; Wed, 21 Nov 2012 00:31:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAL0VvtR024964; Wed, 21 Nov 2012 00:31:57 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAL0VvAY024963; Wed, 21 Nov 2012 00:31:57 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211210031.qAL0VvAY024963@svn.freebsd.org> From: Eitan Adler Date: Wed, 21 Nov 2012 00:31:57 +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: r243351 - stable/8/usr.bin/mktemp X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2012 00:31:57 -0000 Author: eadler Date: Wed Nov 21 00:31:56 2012 New Revision: 243351 URL: http://svnweb.freebsd.org/changeset/base/243351 Log: MFC r243240: Use the macro for standard error return values. .Dd not bumped because there is no important content change. Obtained from: DragonflyBSD Approved by: cperciva (implicit) Modified: stable/8/usr.bin/mktemp/mktemp.1 Directory Properties: stable/8/usr.bin/mktemp/ (props changed) Modified: stable/8/usr.bin/mktemp/mktemp.1 ============================================================================== --- stable/8/usr.bin/mktemp/mktemp.1 Wed Nov 21 00:31:56 2012 (r243350) +++ stable/8/usr.bin/mktemp/mktemp.1 Wed Nov 21 00:31:56 2012 (r243351) @@ -162,10 +162,7 @@ Use of this option is not encouraged. .El .Sh EXIT STATUS -The -.Nm -utility -exits 0 on success, and 1 if an error occurs. +.Ex -std .Sh EXAMPLES The following .Xr sh 1 From owner-svn-src-stable@FreeBSD.ORG Wed Nov 21 00:31:57 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E2B4658E; Wed, 21 Nov 2012 00:31:57 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C80178FC14; Wed, 21 Nov 2012 00:31:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAL0Vvow024979; Wed, 21 Nov 2012 00:31:57 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAL0VvY0024978; Wed, 21 Nov 2012 00:31:57 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211210031.qAL0VvY0024978@svn.freebsd.org> From: Eitan Adler Date: Wed, 21 Nov 2012 00:31:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r243352 - stable/7/usr.bin/mktemp X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2012 00:31:58 -0000 Author: eadler Date: Wed Nov 21 00:31:57 2012 New Revision: 243352 URL: http://svnweb.freebsd.org/changeset/base/243352 Log: MFC r243240: Use the macro for standard error return values. .Dd not bumped because there is no important content change. Obtained from: DragonflyBSD Approved by: cperciva (implicit) Modified: stable/7/usr.bin/mktemp/mktemp.1 Directory Properties: stable/7/usr.bin/mktemp/ (props changed) Modified: stable/7/usr.bin/mktemp/mktemp.1 ============================================================================== --- stable/7/usr.bin/mktemp/mktemp.1 Wed Nov 21 00:31:56 2012 (r243351) +++ stable/7/usr.bin/mktemp/mktemp.1 Wed Nov 21 00:31:57 2012 (r243352) @@ -162,10 +162,7 @@ Use of this option is not encouraged. .El .Sh EXIT STATUS -The -.Nm -utility -exits 0 on success, and 1 if an error occurs. +.Ex -std .Sh EXAMPLES The following .Xr sh 1 From owner-svn-src-stable@FreeBSD.ORG Wed Nov 21 00:40:27 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1AA4CBD1; Wed, 21 Nov 2012 00:40:27 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0000C8FC1B; Wed, 21 Nov 2012 00:40:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAL0eQNm026867; Wed, 21 Nov 2012 00:40:26 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAL0eQgx026865; Wed, 21 Nov 2012 00:40:26 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211210040.qAL0eQgx026865@svn.freebsd.org> From: Eitan Adler Date: Wed, 21 Nov 2012 00:40: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: r243353 - stable/8/share/man/man7 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2012 00:40:27 -0000 Author: eadler Date: Wed Nov 21 00:40:26 2012 New Revision: 243353 URL: http://svnweb.freebsd.org/changeset/base/243353 Log: MFC r243241: Modernize parts of the ports.7 manual page. Approved by: cperciva (implicit) Modified: stable/8/share/man/man7/ports.7 Directory Properties: stable/8/share/man/man7/ (props changed) Modified: stable/8/share/man/man7/ports.7 ============================================================================== --- stable/8/share/man/man7/ports.7 Wed Nov 21 00:31:57 2012 (r243352) +++ stable/8/share/man/man7/ports.7 Wed Nov 21 00:40:26 2012 (r243353) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 9, 2012 +.Dd November 18, 2012 .Dt PORTS 7 .Os .Sh NAME @@ -41,7 +41,7 @@ Each .Em port contains any patches necessary to make the original application source code compile and run on -.Bx . +.Fx . Compiling an application is as simple as typing .Nm make Cm build @@ -56,19 +56,6 @@ simply type .Nm make Cm install to install the application. .Pp -It is possible to download and use ports from the -.Fx -repository -that are newer than the installed system; however it is important to -install the appropriate -.Dq "Upgrade Kit" -from -.Pa http://www.FreeBSD.org/ports/ -first! -The -.Xr portcheckout 1 Pq Pa ports/ports-mgmt/portcheckout -script (also a port, of course!) will help to download new ports. -.Pp For more information about using ports, see .Dq "Packages and Ports" in From owner-svn-src-stable@FreeBSD.ORG Wed Nov 21 00:40:27 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 667F0BD2; Wed, 21 Nov 2012 00:40:27 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4BB6A8FC1C; Wed, 21 Nov 2012 00:40:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAL0eRG8026890; Wed, 21 Nov 2012 00:40:27 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAL0eRWm026889; Wed, 21 Nov 2012 00:40:27 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211210040.qAL0eRWm026889@svn.freebsd.org> From: Eitan Adler Date: Wed, 21 Nov 2012 00:40:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r243354 - stable/7/share/man/man7 X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2012 00:40:27 -0000 Author: eadler Date: Wed Nov 21 00:40:26 2012 New Revision: 243354 URL: http://svnweb.freebsd.org/changeset/base/243354 Log: MFC r243241: Modernize parts of the ports.7 manual page. Approved by: cperciva (implicit) Modified: stable/7/share/man/man7/ports.7 Directory Properties: stable/7/share/man/man7/ (props changed) Modified: stable/7/share/man/man7/ports.7 ============================================================================== --- stable/7/share/man/man7/ports.7 Wed Nov 21 00:40:26 2012 (r243353) +++ stable/7/share/man/man7/ports.7 Wed Nov 21 00:40:26 2012 (r243354) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 9, 2012 +.Dd November 18, 2012 .Dt PORTS 7 .Os .Sh NAME @@ -41,7 +41,7 @@ Each .Em port contains any patches necessary to make the original application source code compile and run on -.Bx . +.Fx . Compiling an application is as simple as typing .Nm make Cm build @@ -56,19 +56,6 @@ simply type .Nm make Cm install to install the application. .Pp -It is possible to download and use ports from the -.Fx -repository -that are newer than the installed system; however it is important to -install the appropriate -.Dq "Upgrade Kit" -from -.Pa http://www.FreeBSD.org/ports/ -first! -The -.Xr portcheckout 1 Pq Pa ports/ports-mgmt/portcheckout -script (also a port, of course!) will help to download new ports. -.Pp For more information about using ports, see .Dq "Packages and Ports" in From owner-svn-src-stable@FreeBSD.ORG Wed Nov 21 00:40:27 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B5AF0BD3; Wed, 21 Nov 2012 00:40:27 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9AD228FC1D; Wed, 21 Nov 2012 00:40:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAL0eR87026904; Wed, 21 Nov 2012 00:40:27 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAL0eRN1026903; Wed, 21 Nov 2012 00:40:27 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211210040.qAL0eRN1026903@svn.freebsd.org> From: Eitan Adler Date: Wed, 21 Nov 2012 00:40: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: r243355 - stable/9/share/man/man7 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2012 00:40:27 -0000 Author: eadler Date: Wed Nov 21 00:40:27 2012 New Revision: 243355 URL: http://svnweb.freebsd.org/changeset/base/243355 Log: MFC r243241: Modernize parts of the ports.7 manual page. Approved by: cperciva (implicit) Modified: stable/9/share/man/man7/ports.7 Directory Properties: stable/9/share/man/man7/ (props changed) Modified: stable/9/share/man/man7/ports.7 ============================================================================== --- stable/9/share/man/man7/ports.7 Wed Nov 21 00:40:26 2012 (r243354) +++ stable/9/share/man/man7/ports.7 Wed Nov 21 00:40:27 2012 (r243355) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 9, 2012 +.Dd November 18, 2012 .Dt PORTS 7 .Os .Sh NAME @@ -41,7 +41,7 @@ Each .Em port contains any patches necessary to make the original application source code compile and run on -.Bx . +.Fx . Compiling an application is as simple as typing .Nm make Cm build @@ -56,19 +56,6 @@ simply type .Nm make Cm install to install the application. .Pp -It is possible to download and use ports from the -.Fx -repository -that are newer than the installed system; however it is important to -install the appropriate -.Dq "Upgrade Kit" -from -.Pa http://www.FreeBSD.org/ports/ -first! -The -.Xr portcheckout 1 Pq Pa ports/ports-mgmt/portcheckout -script (also a port, of course!) will help to download new ports. -.Pp For more information about using ports, see .Dq "Packages and Ports" in From owner-svn-src-stable@FreeBSD.ORG Wed Nov 21 01:01:17 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DE73937F; Wed, 21 Nov 2012 01:01:17 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C04408FC12; Wed, 21 Nov 2012 01:01:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAL11HjG030895; Wed, 21 Nov 2012 01:01:17 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAL11HrK030894; Wed, 21 Nov 2012 01:01:17 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211210101.qAL11HrK030894@svn.freebsd.org> From: Eitan Adler Date: Wed, 21 Nov 2012 01:01: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: r243356 - stable/9/sys/dev/uart X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2012 01:01:18 -0000 Author: eadler Date: Wed Nov 21 01:01:17 2012 New Revision: 243356 URL: http://svnweb.freebsd.org/changeset/base/243356 Log: MFC r243000: Add support for CIR1000 - Cirrus Logic V34 to the uart driver Approved by: cperciva (implicit) Modified: stable/9/sys/dev/uart/uart_bus_isa.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/uart/uart_bus_isa.c ============================================================================== --- stable/9/sys/dev/uart/uart_bus_isa.c Wed Nov 21 00:40:27 2012 (r243355) +++ stable/9/sys/dev/uart/uart_bus_isa.c Wed Nov 21 01:01:17 2012 (r243356) @@ -79,6 +79,7 @@ static struct isa_pnp_id isa_ns8250_ids[ {0x0034490a, NULL}, /* BRI3400 - Internal ACF Modem */ {0x0094490a, NULL}, /* BRI9400 - Boca K56Flex PnP */ {0x00b4490a, NULL}, /* BRIB400 - Boca 56k PnP */ + {0x0010320d, NULL}, /* CIR1000 - Cirrus Logic V34 */ {0x0030320d, NULL}, /* CIR3000 - Cirrus Logic V43 */ {0x0100440e, NULL}, /* CRD0001 - Cardinal MVP288IV ? */ {0x01308c0e, NULL}, /* CTL3001 - Creative Labs Phoneblaster */ From owner-svn-src-stable@FreeBSD.ORG Wed Nov 21 01:01:19 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 65A58380; Wed, 21 Nov 2012 01:01:19 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4BC448FC13; Wed, 21 Nov 2012 01:01:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAL11Js9030965; Wed, 21 Nov 2012 01:01:19 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAL11Jwq030963; Wed, 21 Nov 2012 01:01:19 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211210101.qAL11Jwq030963@svn.freebsd.org> From: Eitan Adler Date: Wed, 21 Nov 2012 01:01:19 +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: r243357 - stable/8/sys/dev/uart X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2012 01:01:19 -0000 Author: eadler Date: Wed Nov 21 01:01:18 2012 New Revision: 243357 URL: http://svnweb.freebsd.org/changeset/base/243357 Log: MFC r243000: Add support for CIR1000 - Cirrus Logic V34 to the uart driver Approved by: cperciva (implicit) Modified: stable/8/sys/dev/uart/uart_bus_isa.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/uart/ (props changed) Modified: stable/8/sys/dev/uart/uart_bus_isa.c ============================================================================== --- stable/8/sys/dev/uart/uart_bus_isa.c Wed Nov 21 01:01:17 2012 (r243356) +++ stable/8/sys/dev/uart/uart_bus_isa.c Wed Nov 21 01:01:18 2012 (r243357) @@ -79,6 +79,7 @@ static struct isa_pnp_id isa_ns8250_ids[ {0x0034490a, NULL}, /* BRI3400 - Internal ACF Modem */ {0x0094490a, NULL}, /* BRI9400 - Boca K56Flex PnP */ {0x00b4490a, NULL}, /* BRIB400 - Boca 56k PnP */ + {0x0010320d, NULL}, /* CIR1000 - Cirrus Logic V34 */ {0x0030320d, NULL}, /* CIR3000 - Cirrus Logic V43 */ {0x0100440e, NULL}, /* CRD0001 - Cardinal MVP288IV ? */ {0x01308c0e, NULL}, /* CTL3001 - Creative Labs Phoneblaster */ From owner-svn-src-stable@FreeBSD.ORG Wed Nov 21 01:01:19 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8CC21381; Wed, 21 Nov 2012 01:01:19 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 732ED8FC14; Wed, 21 Nov 2012 01:01:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAL11JU3030973; Wed, 21 Nov 2012 01:01:19 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAL11Jr9030972; Wed, 21 Nov 2012 01:01:19 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211210101.qAL11Jr9030972@svn.freebsd.org> From: Eitan Adler Date: Wed, 21 Nov 2012 01:01:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r243358 - stable/7/sys/dev/uart X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2012 01:01:19 -0000 Author: eadler Date: Wed Nov 21 01:01:19 2012 New Revision: 243358 URL: http://svnweb.freebsd.org/changeset/base/243358 Log: MFC r243000: Add support for CIR1000 - Cirrus Logic V34 to the uart driver Approved by: cperciva (implicit) Modified: stable/7/sys/dev/uart/uart_bus_isa.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/dev/uart/uart_bus_isa.c ============================================================================== --- stable/7/sys/dev/uart/uart_bus_isa.c Wed Nov 21 01:01:18 2012 (r243357) +++ stable/7/sys/dev/uart/uart_bus_isa.c Wed Nov 21 01:01:19 2012 (r243358) @@ -76,6 +76,7 @@ static struct isa_pnp_id isa_ns8250_ids[ {0x0034490a, NULL}, /* BRI3400 - Internal ACF Modem */ {0x0094490a, NULL}, /* BRI9400 - Boca K56Flex PnP */ {0x00b4490a, NULL}, /* BRIB400 - Boca 56k PnP */ + {0x0010320d, NULL}, /* CIR1000 - Cirrus Logic V34 */ {0x0030320d, NULL}, /* CIR3000 - Cirrus Logic V43 */ {0x0100440e, NULL}, /* CRD0001 - Cardinal MVP288IV ? */ {0x01308c0e, NULL}, /* CTL3001 - Creative Labs Phoneblaster */ From owner-svn-src-stable@FreeBSD.ORG Wed Nov 21 18:27:03 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 82088FD1; Wed, 21 Nov 2012 18:27:03 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 65A9F8FC1B; Wed, 21 Nov 2012 18:27:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qALIR3qO008513; Wed, 21 Nov 2012 18:27:03 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qALIR3eu008509; Wed, 21 Nov 2012 18:27:03 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211211827.qALIR3eu008509@svn.freebsd.org> From: Dimitry Andric Date: Wed, 21 Nov 2012 18:27: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: r243375 - in stable/9/sys/ofed: drivers/infiniband/core drivers/infiniband/ulp/sdp include/linux X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2012 18:27:03 -0000 Author: dim Date: Wed Nov 21 18:27:02 2012 New Revision: 243375 URL: http://svnweb.freebsd.org/changeset/base/243375 Log: MFC r242933: Redo r242842, now actually fixing the warnings, as follows: - In sys/ofed/drivers/infiniband/core/cma.c, an enum struct member is interpreted as an int, so cast it to an int. - In sys/ofed/drivers/infiniband/core/ud_header.c, initialize the packet_length variable in ib_ud_header_init(), to prevent undefined behaviour. - In sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c, call rdma_notify() with the correct enum type and value. - In sys/ofed/include/linux/pci.h, change the PCI_DEVICE and PCI_VDEVICE macros to use C99 struct initializers, so additional members can be overridden. Reviewed by: delphij, Garrett Cooper Modified: stable/9/sys/ofed/drivers/infiniband/core/cma.c stable/9/sys/ofed/drivers/infiniband/core/ud_header.c stable/9/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c stable/9/sys/ofed/include/linux/pci.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ofed/drivers/infiniband/core/cma.c ============================================================================== --- stable/9/sys/ofed/drivers/infiniband/core/cma.c Wed Nov 21 18:12:28 2012 (r243374) +++ stable/9/sys/ofed/drivers/infiniband/core/cma.c Wed Nov 21 18:27:02 2012 (r243375) @@ -1312,7 +1312,7 @@ static int cma_iw_handler(struct iw_cm_i *sin = iw_event->local_addr; sin = (struct sockaddr_in *) &id_priv->id.route.addr.dst_addr; *sin = iw_event->remote_addr; - switch (iw_event->status) { + switch ((int)iw_event->status) { case 0: event.event = RDMA_CM_EVENT_ESTABLISHED; break; Modified: stable/9/sys/ofed/drivers/infiniband/core/ud_header.c ============================================================================== --- stable/9/sys/ofed/drivers/infiniband/core/ud_header.c Wed Nov 21 18:12:28 2012 (r243374) +++ stable/9/sys/ofed/drivers/infiniband/core/ud_header.c Wed Nov 21 18:27:02 2012 (r243375) @@ -230,7 +230,7 @@ void ib_ud_header_init(int pay int immediate_present, struct ib_ud_header *header) { - u16 packet_length; + u16 packet_length = 0; memset(header, 0, sizeof *header); Modified: stable/9/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c ============================================================================== --- stable/9/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c Wed Nov 21 18:12:28 2012 (r243374) +++ stable/9/sys/ofed/drivers/infiniband/ulp/sdp/sdp_rx.c Wed Nov 21 18:27:02 2012 (r243375) @@ -590,7 +590,7 @@ sdp_rx_comp_work(struct work_struct *wor if (unlikely(!ssk->poll_cq)) { struct rdma_cm_id *id = ssk->id; if (id && id->qp) - rdma_notify(id, RDMA_CM_EVENT_ESTABLISHED); + rdma_notify(id, IB_EVENT_COMM_EST); goto out; } Modified: stable/9/sys/ofed/include/linux/pci.h ============================================================================== --- stable/9/sys/ofed/include/linux/pci.h Wed Nov 21 18:12:28 2012 (r243374) +++ stable/9/sys/ofed/include/linux/pci.h Wed Nov 21 18:27:02 2012 (r243375) @@ -73,10 +73,12 @@ struct pci_device_id { #define PCI_DEVICE_ID_MELLANOX_SINAI 0x6274 -#define PCI_VDEVICE(vendor, device) \ - PCI_VENDOR_ID_##vendor, (device), PCI_ANY_ID, PCI_ANY_ID, 0, 0 -#define PCI_DEVICE(vendor, device) \ - (vendor), (device), PCI_ANY_ID, PCI_ANY_ID, 0, 0 +#define PCI_VDEVICE(_vendor, _device) \ + .vendor = PCI_VENDOR_ID_##_vendor, .device = (_device), \ + .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID +#define PCI_DEVICE(_vendor, _device) \ + .vendor = (_vendor), .device = (_device), \ + .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID #define to_pci_dev(n) container_of(n, struct pci_dev, dev) From owner-svn-src-stable@FreeBSD.ORG Wed Nov 21 18:38:57 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 15B3F526; Wed, 21 Nov 2012 18:38:57 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EDB978FC18; Wed, 21 Nov 2012 18:38:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qALIcugT010098; Wed, 21 Nov 2012 18:38:56 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qALIcuNv010090; Wed, 21 Nov 2012 18:38:56 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211211838.qALIcuNv010090@svn.freebsd.org> From: Dimitry Andric Date: Wed, 21 Nov 2012 18:38:56 +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: r243376 - in stable/9/contrib/libc++: . include src src/support X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2012 18:38:57 -0000 Author: dim Date: Wed Nov 21 18:38:56 2012 New Revision: 243376 URL: http://svnweb.freebsd.org/changeset/base/243376 Log: MFC r241903: Import libc++ trunk r165949. Among other improvements and bug fixes, this has many visibility problems fixed, which should help with compiling certain ports that exercise C++11 mode (i.e. Firefox). Also, belatedly add the LICENSE.TXT and accompanying CREDITS.TXT files, which are referred to in all the source files. MFC r241907: Fix two -Wsystem-header warnings in libc++ that were exposed by the new ATF import. These have also been sent upstream. Added: stable/9/contrib/libc++/CREDITS.TXT - copied unchanged from r241903, head/contrib/libc++/CREDITS.TXT stable/9/contrib/libc++/LICENSE.TXT - copied unchanged from r241903, head/contrib/libc++/LICENSE.TXT Deleted: stable/9/contrib/libc++/src/support/ Modified: stable/9/contrib/libc++/include/__bit_reference stable/9/contrib/libc++/include/__config stable/9/contrib/libc++/include/__hash_table stable/9/contrib/libc++/include/__locale stable/9/contrib/libc++/include/__mutex_base stable/9/contrib/libc++/include/__tree stable/9/contrib/libc++/include/__tuple stable/9/contrib/libc++/include/__undef_min_max stable/9/contrib/libc++/include/algorithm stable/9/contrib/libc++/include/array stable/9/contrib/libc++/include/atomic stable/9/contrib/libc++/include/bitset stable/9/contrib/libc++/include/chrono stable/9/contrib/libc++/include/cmath stable/9/contrib/libc++/include/complex stable/9/contrib/libc++/include/condition_variable stable/9/contrib/libc++/include/cstddef stable/9/contrib/libc++/include/cstdio stable/9/contrib/libc++/include/cstdlib stable/9/contrib/libc++/include/deque stable/9/contrib/libc++/include/exception stable/9/contrib/libc++/include/forward_list stable/9/contrib/libc++/include/fstream stable/9/contrib/libc++/include/functional stable/9/contrib/libc++/include/future stable/9/contrib/libc++/include/ios stable/9/contrib/libc++/include/iosfwd stable/9/contrib/libc++/include/istream stable/9/contrib/libc++/include/iterator stable/9/contrib/libc++/include/list stable/9/contrib/libc++/include/locale stable/9/contrib/libc++/include/map stable/9/contrib/libc++/include/memory stable/9/contrib/libc++/include/mutex stable/9/contrib/libc++/include/new stable/9/contrib/libc++/include/ostream stable/9/contrib/libc++/include/queue stable/9/contrib/libc++/include/random stable/9/contrib/libc++/include/regex stable/9/contrib/libc++/include/stack stable/9/contrib/libc++/include/streambuf stable/9/contrib/libc++/include/string stable/9/contrib/libc++/include/system_error stable/9/contrib/libc++/include/thread stable/9/contrib/libc++/include/tuple stable/9/contrib/libc++/include/type_traits stable/9/contrib/libc++/include/unordered_map stable/9/contrib/libc++/include/utility stable/9/contrib/libc++/include/valarray stable/9/contrib/libc++/include/vector stable/9/contrib/libc++/src/condition_variable.cpp stable/9/contrib/libc++/src/debug.cpp stable/9/contrib/libc++/src/exception.cpp stable/9/contrib/libc++/src/future.cpp stable/9/contrib/libc++/src/ios.cpp stable/9/contrib/libc++/src/iostream.cpp stable/9/contrib/libc++/src/locale.cpp stable/9/contrib/libc++/src/memory.cpp stable/9/contrib/libc++/src/mutex.cpp stable/9/contrib/libc++/src/new.cpp stable/9/contrib/libc++/src/random.cpp stable/9/contrib/libc++/src/stdexcept.cpp stable/9/contrib/libc++/src/thread.cpp stable/9/contrib/libc++/src/typeinfo.cpp Directory Properties: stable/9/contrib/libc++/ (props changed) Copied: stable/9/contrib/libc++/CREDITS.TXT (from r241903, head/contrib/libc++/CREDITS.TXT) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/contrib/libc++/CREDITS.TXT Wed Nov 21 18:38:56 2012 (r243376, copy of r241903, head/contrib/libc++/CREDITS.TXT) @@ -0,0 +1,76 @@ +This file is a partial list of people who have contributed to the LLVM/libc++ +project. If you have contributed a patch or made some other contribution to +LLVM/libc++, please submit a patch to this file to add yourself, and it will be +done! + +The list is sorted by surname and formatted to allow easy grepping and +beautification by scripts. The fields are: name (N), email (E), web-address +(W), PGP key ID and fingerprint (P), description (D), and snail-mail address +(S). + +N: Howard Hinnant +E: hhinnant@apple.com +D: Architect and primary author of libc++ + +N: Marshall Clow +E: mclow.lists@gmail.com +E: marshall@idio.com +D: Minor patches and bug fixes. + +N: Bjorn Reese +E: breese@users.sourceforge.net +D: Initial regex prototype + +N: David Chisnall +E: theraven at theravensnest dot org +D: FreeBSD and Solaris ports, libcxxrt support, some atomics work. + +N: Ruben Van Boxem +E: vanboxem dot ruben at gmail dot com +D: Initial Windows patches. + +N: Arvid Picciani +E: aep at exys dot org +D: Minor patches and musl port. + +N: Craig Silverstein +E: csilvers@google.com +D: Implemented Cityhash as the string hash function on 64-bit machines + +N: Google Inc. +D: Copyright owner and contributor of the CityHash algorithm + +N: Jeffrey Yasskin +E: jyasskin@gmail.com +E: jyasskin@google.com +D: Linux fixes. + +N: Jonathan Sauer +D: Minor patches, mostly related to constexpr + +N: Richard Smith +D: Minor patches. + +N: Andrew Morrow +E: andrew.c.morrow@gmail.com +D: Minor patches and Linux fixes. + +N: Hyeon-bin Jeong +E: tuhertz@gmail.com +D: Minor patches and bug fixes. + +N: Michel Morin +E: mimomorin@gmail.com +D: Minor patches to is_convertible. + +N: Dimitry Andric +E: dimitry@andric.com +D: Visibility fixes, minor FreeBSD portability patches. + +N: Holger Arnold +E: holgerar@gmail.com +D: Minor fix. + +N: Argyrios Kyrtzidis +E: kyrtzidis@apple.com +D: Bug fixes. Copied: stable/9/contrib/libc++/LICENSE.TXT (from r241903, head/contrib/libc++/LICENSE.TXT) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/contrib/libc++/LICENSE.TXT Wed Nov 21 18:38:56 2012 (r243376, copy of r241903, head/contrib/libc++/LICENSE.TXT) @@ -0,0 +1,76 @@ +============================================================================== +libc++ License +============================================================================== + +The libc++ library is dual licensed under both the University of Illinois +"BSD-Like" license and the MIT license. As a user of this code you may choose +to use it under either license. As a contributor, you agree to allow your code +to be used under both. + +Full text of the relevant licenses is included below. + +============================================================================== + +University of Illinois/NCSA +Open Source License + +Copyright (c) 2009-2012 by the contributors listed in CREDITS.TXT + +All rights reserved. + +Developed by: + + LLVM Team + + University of Illinois at Urbana-Champaign + + http://llvm.org + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal with +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimers. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimers in the + documentation and/or other materials provided with the distribution. + + * Neither the names of the LLVM Team, University of Illinois at + Urbana-Champaign, nor the names of its contributors may be used to + endorse or promote products derived from this Software without specific + prior written permission. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE +SOFTWARE. + +============================================================================== + +Copyright (c) 2009-2012 by the contributors listed in CREDITS.TXT + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. Modified: stable/9/contrib/libc++/include/__bit_reference ============================================================================== --- stable/9/contrib/libc++/include/__bit_reference Wed Nov 21 18:27:02 2012 (r243375) +++ stable/9/contrib/libc++/include/__bit_reference Wed Nov 21 18:38:56 2012 (r243376) @@ -22,7 +22,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD -template class __bit_iterator; +template class __bit_iterator; template class __bit_const_reference; template @@ -131,13 +131,14 @@ public: __bit_const_reference(const __bit_reference<_Cp>& __x) _NOEXCEPT : __seg_(__x.__seg_), __mask_(__x.__mask_) {} - _LIBCPP_INLINE_VISIBILITY operator bool() const _NOEXCEPT + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR operator bool() const _NOEXCEPT {return static_cast(*__seg_ & __mask_);} _LIBCPP_INLINE_VISIBILITY __bit_iterator<_Cp, true> operator&() const _NOEXCEPT {return __bit_iterator<_Cp, true>(__seg_, static_cast(__ctz(__mask_)));} private: _LIBCPP_INLINE_VISIBILITY + _LIBCPP_CONSTEXPR __bit_const_reference(__storage_pointer __s, __storage_type __m) _NOEXCEPT : __seg_(__s), __mask_(__m) {} @@ -146,11 +147,11 @@ private: // find -template -__bit_iterator<_Cp, false> -__find_bool_true(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n) +template +__bit_iterator<_Cp, _IsConst> +__find_bool_true(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type __n) { - typedef __bit_iterator<_Cp, false> _It; + typedef __bit_iterator<_Cp, _IsConst> _It; typedef typename _It::__storage_type __storage_type; static const unsigned __bits_per_word = _It::__bits_per_word; // do first partial word @@ -180,11 +181,11 @@ __find_bool_true(__bit_iterator<_Cp, fal return _It(__first.__seg_, static_cast(__n)); } -template -__bit_iterator<_Cp, false> -__find_bool_false(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n) +template +__bit_iterator<_Cp, _IsConst> +__find_bool_false(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type __n) { - typedef __bit_iterator<_Cp, false> _It; + typedef __bit_iterator<_Cp, _IsConst> _It; typedef typename _It::__storage_type __storage_type; static const unsigned __bits_per_word = _It::__bits_per_word; // do first partial word @@ -193,7 +194,7 @@ __find_bool_false(__bit_iterator<_Cp, fa __storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_); __storage_type __dn = _VSTD::min(__clz_f, __n); __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn)); - __storage_type __b = ~(*__first.__seg_ & __m); + __storage_type __b = ~*__first.__seg_ & __m; if (__b) return _It(__first.__seg_, static_cast(_VSTD::__ctz(__b))); __n -= __dn; @@ -210,17 +211,17 @@ __find_bool_false(__bit_iterator<_Cp, fa if (__n > 0) { __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n); - __storage_type __b = ~(*__first.__seg_ & __m); + __storage_type __b = ~*__first.__seg_ & __m; if (__b) return _It(__first.__seg_, static_cast(_VSTD::__ctz(__b))); } return _It(__first.__seg_, static_cast(__n)); } -template +template inline _LIBCPP_INLINE_VISIBILITY -__bit_iterator<_Cp, false> -find(__bit_iterator<_Cp, false> __first, __bit_iterator<_Cp, false> __last, const _Tp& __value_) +__bit_iterator<_Cp, _IsConst> +find(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, const _Tp& __value_) { if (static_cast(__value_)) return __find_bool_true(__first, static_cast(__last - __first)); @@ -229,11 +230,11 @@ find(__bit_iterator<_Cp, false> __first, // count -template -typename __bit_iterator<_Cp, false>::difference_type -__count_bool_true(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n) +template +typename __bit_iterator<_Cp, _IsConst>::difference_type +__count_bool_true(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type __n) { - typedef __bit_iterator<_Cp, false> _It; + typedef __bit_iterator<_Cp, _IsConst> _It; typedef typename _It::__storage_type __storage_type; typedef typename _It::difference_type difference_type; static const unsigned __bits_per_word = _It::__bits_per_word; @@ -260,11 +261,11 @@ __count_bool_true(__bit_iterator<_Cp, fa return __r; } -template -typename __bit_iterator<_Cp, false>::difference_type -__count_bool_false(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n) +template +typename __bit_iterator<_Cp, _IsConst>::difference_type +__count_bool_false(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type __n) { - typedef __bit_iterator<_Cp, false> _It; + typedef __bit_iterator<_Cp, _IsConst> _It; typedef typename _It::__storage_type __storage_type; typedef typename _It::difference_type difference_type; static const unsigned __bits_per_word = _It::__bits_per_word; @@ -275,7 +276,7 @@ __count_bool_false(__bit_iterator<_Cp, f __storage_type __clz_f = static_cast<__storage_type>(__bits_per_word - __first.__ctz_); __storage_type __dn = _VSTD::min(__clz_f, __n); __storage_type __m = (~__storage_type(0) << __first.__ctz_) & (~__storage_type(0) >> (__clz_f - __dn)); - __r = _VSTD::__pop_count(~(*__first.__seg_ & __m)); + __r = _VSTD::__pop_count(~*__first.__seg_ & __m); __n -= __dn; ++__first.__seg_; } @@ -286,15 +287,15 @@ __count_bool_false(__bit_iterator<_Cp, f if (__n > 0) { __storage_type __m = ~__storage_type(0) >> (__bits_per_word - __n); - __r += _VSTD::__pop_count(~(*__first.__seg_ & __m)); + __r += _VSTD::__pop_count(~*__first.__seg_ & __m); } return __r; } -template +template inline _LIBCPP_INLINE_VISIBILITY -typename __bit_iterator<_Cp, false>::difference_type -count(__bit_iterator<_Cp, false> __first, __bit_iterator<_Cp, false> __last, const _Tp& __value_) +typename __bit_iterator<_Cp, _IsConst>::difference_type +count(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, const _Tp& __value_) { if (static_cast(__value_)) return __count_bool_true(__first, static_cast(__last - __first)); @@ -926,12 +927,12 @@ rotate(__bit_iterator<_Cp, false> __firs // equal -template +template bool -__equal_unaligned(__bit_iterator<_Cp, true> __first1, __bit_iterator<_Cp, true> __last1, - __bit_iterator<_Cp, true> __first2) +__equal_unaligned(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1> __last1, + __bit_iterator<_Cp, _IC2> __first2) { - typedef __bit_iterator<_Cp, true> _It; + typedef __bit_iterator<_Cp, _IC1> _It; typedef typename _It::difference_type difference_type; typedef typename _It::__storage_type __storage_type; static const unsigned __bits_per_word = _It::__bits_per_word; @@ -1008,12 +1009,12 @@ __equal_unaligned(__bit_iterator<_Cp, tr return true; } -template +template bool -__equal_aligned(__bit_iterator<_Cp, true> __first1, __bit_iterator<_Cp, true> __last1, - __bit_iterator<_Cp, true> __first2) +__equal_aligned(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1> __last1, + __bit_iterator<_Cp, _IC2> __first2) { - typedef __bit_iterator<_Cp, true> _It; + typedef __bit_iterator<_Cp, _IC1> _It; typedef typename _It::difference_type difference_type; typedef typename _It::__storage_type __storage_type; static const unsigned __bits_per_word = _It::__bits_per_word; @@ -1061,7 +1062,8 @@ equal(__bit_iterator<_Cp, _IC1> __first1 return __equal_unaligned(__first1, __last1, __first2); } -template +template class __bit_iterator { public: @@ -1232,19 +1234,23 @@ private: template friend __bit_iterator<_Dp, false> rotate(__bit_iterator<_Dp, false>, __bit_iterator<_Dp, false>, __bit_iterator<_Dp, false>); - template friend bool __equal_aligned(__bit_iterator<_Dp, true>, - __bit_iterator<_Dp, true>, - __bit_iterator<_Dp, true>); - template friend bool __equal_unaligned(__bit_iterator<_Dp, true>, - __bit_iterator<_Dp, true>, - __bit_iterator<_Dp, true>); + template friend bool __equal_aligned(__bit_iterator<_Dp, _IC1>, + __bit_iterator<_Dp, _IC1>, + __bit_iterator<_Dp, _IC2>); + template friend bool __equal_unaligned(__bit_iterator<_Dp, _IC1>, + __bit_iterator<_Dp, _IC1>, + __bit_iterator<_Dp, _IC2>); template friend bool equal(__bit_iterator<_Dp, _IC1>, __bit_iterator<_Dp, _IC1>, __bit_iterator<_Dp, _IC2>); - template friend __bit_iterator<_Dp, false> __find_bool_true(__bit_iterator<_Dp, false>, + template friend __bit_iterator<_Dp, _IC> __find_bool_true(__bit_iterator<_Dp, _IC>, typename _Dp::size_type); - template friend __bit_iterator<_Dp, false> __find_bool_false(__bit_iterator<_Dp, false>, + template friend __bit_iterator<_Dp, _IC> __find_bool_false(__bit_iterator<_Dp, _IC>, typename _Dp::size_type); + template friend typename __bit_iterator<_Dp, _IC>::difference_type + __count_bool_true(__bit_iterator<_Dp, _IC>, typename _Dp::size_type); + template friend typename __bit_iterator<_Dp, _IC>::difference_type + __count_bool_false(__bit_iterator<_Dp, _IC>, typename _Dp::size_type); }; _LIBCPP_END_NAMESPACE_STD Modified: stable/9/contrib/libc++/include/__config ============================================================================== --- stable/9/contrib/libc++/include/__config Wed Nov 21 18:27:02 2012 (r243375) +++ stable/9/contrib/libc++/include/__config Wed Nov 21 18:38:56 2012 (r243376) @@ -15,7 +15,11 @@ #pragma GCC system_header #endif -#define _LIBCPP_VERSION 1001 +#ifdef __GNUC__ +#define _GNUC_VER (__GNUC__ * 100 + __GNUC_MINOR__) +#endif + +#define _LIBCPP_VERSION 1101 #define _LIBCPP_ABI_VERSION 1 @@ -53,7 +57,8 @@ # define _LIBCPP_LITTLE_ENDIAN 1 # define _LIBCPP_BIG_ENDIAN 0 // Compiler intrinsics (GCC or MSVC) -# if (defined(_MSC_VER) && _MSC_VER >= 1400) || (__GNUC__ >= 4 && __GNUC_MINOR__ > 3) +# if (defined(_MSC_VER) && _MSC_VER >= 1400) \ + || (defined(__GNUC__) && _GNUC_VER > 403) # define _LIBCP_HAS_IS_BASE_OF # endif #endif // _WIN32 @@ -145,8 +150,10 @@ #if defined(__clang__) #if __has_feature(cxx_alignas) +# define _ALIGNAS_TYPE(x) alignas(x) # define _ALIGNAS(x) alignas(x) #else +# define _ALIGNAS_TYPE(x) __attribute__((__aligned__(__alignof(x)))) # define _ALIGNAS(x) __attribute__((__aligned__(x))) #endif @@ -180,9 +187,9 @@ typedef __char32_t char32_t; #endif #if __has_feature(cxx_attributes) -# define _ATTRIBUTE(x) [[x]] +# define _LIBCPP_NORETURN [[noreturn]] #else -# define _ATTRIBUTE(x) __attribute__ ((x)) +# define _LIBCPP_NORETURN __attribute__ ((noreturn)) #endif #define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS @@ -245,8 +252,9 @@ typedef __char32_t char32_t; #define _LIBCPP_HAS_NO_CONSTEXPR #endif -#if __FreeBSD__ +#if __FreeBSD__ && (__ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L) #define _LIBCPP_HAS_QUICK_EXIT +#define _LIBCPP_HAS_C11_FEATURES #endif #if (__has_feature(cxx_noexcept)) @@ -274,8 +282,9 @@ namespace std { #elif defined(__GNUC__) #define _ALIGNAS(x) __attribute__((__aligned__(x))) +#define _ALIGNAS_TYPE(x) __attribute__((__aligned__(__alignof(x)))) -#define _ATTRIBUTE(x) __attribute__((x)) +#define _LIBCPP_NORETURN __attribute__((noreturn)) #if !__EXCEPTIONS #define _LIBCPP_NO_EXCEPTIONS @@ -305,15 +314,15 @@ namespace std { #define _LIBCPP_HAS_NO_TRAILING_RETURN #define _LIBCPP_HAS_NO_ALWAYS_INLINE_VARIADICS -#if !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) +#if _GNUC_VER < 403 #define _LIBCPP_HAS_NO_RVALUE_REFERENCES #endif -#if !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 3) +#if _GNUC_VER < 403 #define _LIBCPP_HAS_NO_STATIC_ASSERT #endif -#if !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 4) +#if _GNUC_VER < 404 #define _LIBCPP_HAS_NO_ADVANCED_SFINAE #define _LIBCPP_HAS_NO_DECLTYPE #define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS @@ -321,9 +330,9 @@ namespace std { #define _LIBCPP_HAS_NO_UNICODE_CHARS #define _LIBCPP_HAS_NO_VARIADICS #define _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS -#endif // !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 4) +#endif // _GNUC_VER < 404 -#if !(__GNUC__ >= 4 && __GNUC_MINOR__ >= 6) +#if _GNUC_VER < 406 #define _LIBCPP_HAS_NO_NULLPTR #endif @@ -347,7 +356,7 @@ using namespace _LIBCPP_NAMESPACE __attr #define _LIBCPP_HAS_NO_UNICODE_CHARS #define _LIBCPP_HAS_NO_DELETED_FUNCTIONS #define __alignof__ __alignof -#define _ATTRIBUTE __declspec +#define _LIBCPP_NORETURN __declspec(noreturn) #define _ALIGNAS(x) __declspec(align(x)) #define _LIBCPP_HAS_NO_VARIADICS @@ -389,6 +398,12 @@ template struct __static_asse #define _LIBCPP_CONSTEXPR constexpr #endif +#ifdef __GNUC__ +#define _NOALIAS __attribute__((malloc)) +#else +#define _NOALIAS +#endif + #ifndef __has_feature #define __has_feature(__x) 0 #endif @@ -404,6 +419,7 @@ template struct __static_asse #define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) \ _ __v_; \ _LIBCPP_ALWAYS_INLINE x(_ __v) : __v_(__v) {} \ + _LIBCPP_ALWAYS_INLINE explicit x(int __v) : __v_(static_cast<_>(__v)) {} \ _LIBCPP_ALWAYS_INLINE operator int() const {return __v_;} \ }; #else // _LIBCPP_HAS_NO_STRONG_ENUMS Modified: stable/9/contrib/libc++/include/__hash_table ============================================================================== --- stable/9/contrib/libc++/include/__hash_table Wed Nov 21 18:27:02 2012 (r243375) +++ stable/9/contrib/libc++/include/__hash_table Wed Nov 21 18:38:56 2012 (r243376) @@ -58,10 +58,31 @@ struct __hash_node value_type __value_; }; +inline _LIBCPP_INLINE_VISIBILITY +bool +__is_power2(size_t __bc) +{ + return __bc > 2 && !(__bc & (__bc - 1)); +} + +inline _LIBCPP_INLINE_VISIBILITY +size_t +__constrain_hash(size_t __h, size_t __bc) +{ + return !(__bc & (__bc - 1)) ? __h & (__bc - 1) : __h % __bc; +} + +inline _LIBCPP_INLINE_VISIBILITY +size_t +__next_pow2(size_t __n) +{ + return size_t(1) << (std::numeric_limits::digits - __clz(__n-1)); +} + template class __hash_table; -template class __hash_const_iterator; -template class __hash_map_iterator; -template class __hash_map_const_iterator; +template class _LIBCPP_VISIBLE __hash_const_iterator; +template class _LIBCPP_VISIBLE __hash_map_iterator; +template class _LIBCPP_VISIBLE __hash_map_const_iterator; template class _LIBCPP_VISIBLE unordered_map; @@ -240,7 +261,7 @@ public: __hash_local_iterator& operator++() { __node_ = __node_->__next_; - if (__node_ != nullptr && __node_->__hash_ % __bucket_count_ != __bucket_) + if (__node_ != nullptr && __constrain_hash(__node_->__hash_, __bucket_count_) != __bucket_) __node_ = nullptr; return *this; } @@ -330,7 +351,7 @@ public: __hash_const_local_iterator& operator++() { __node_ = __node_->__next_; - if (__node_ != nullptr && __node_->__hash_ % __bucket_count_ != __bucket_) + if (__node_ != nullptr && __constrain_hash(__node_->__hash_, __bucket_count_) != __bucket_) __node_ = nullptr; return *this; } @@ -637,7 +658,7 @@ public: template _LIBCPP_INLINE_VISIBILITY size_type bucket(const _Key& __k) const - {return hash_function()(__k) % bucket_count();} + {return __constrain_hash(hash_function()(__k), bucket_count());} template iterator find(const _Key& __x); @@ -871,7 +892,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> { if (size() > 0) { - __bucket_list_[__p1_.first().__next_->__hash_ % bucket_count()] = + __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash_, bucket_count())] = static_cast<__node_pointer>(_VSTD::addressof(__p1_.first())); __u.__p1_.first().__next_ = nullptr; __u.size() = 0; @@ -895,7 +916,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> { __p1_.first().__next_ = __u.__p1_.first().__next_; __u.__p1_.first().__next_ = nullptr; - __bucket_list_[__p1_.first().__next_->__hash_ % bucket_count()] = + __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash_, bucket_count())] = static_cast<__node_pointer>(_VSTD::addressof(__p1_.first())); size() = __u.size(); __u.size() = 0; @@ -992,7 +1013,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> __p1_.first().__next_ = __u.__p1_.first().__next_; if (size() > 0) { - __bucket_list_[__p1_.first().__next_->__hash_ % bucket_count()] = + __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash_, bucket_count())] = static_cast<__node_pointer>(_VSTD::addressof(__p1_.first())); __u.__p1_.first().__next_ = nullptr; __u.size() = 0; @@ -1190,12 +1211,12 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> size_t __chash; if (__bc != 0) { - __chash = __nd->__hash_ % __bc; + __chash = __constrain_hash(__nd->__hash_, __bc); __ndptr = __bucket_list_[__chash]; if (__ndptr != nullptr) { for (__ndptr = __ndptr->__next_; __ndptr != nullptr && - __ndptr->__hash_ % __bc == __chash; + __constrain_hash(__ndptr->__hash_, __bc) == __chash; __ndptr = __ndptr->__next_) { if (key_eq()(__ndptr->__value_, __nd->__value_)) @@ -1206,10 +1227,10 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> { if (size()+1 > __bc * max_load_factor() || __bc == 0) { - rehash(_VSTD::max(2 * __bc + 1, + rehash(_VSTD::max(2 * __bc + !__is_power2(__bc), size_type(ceil(float(size() + 1) / max_load_factor())))); __bc = bucket_count(); - __chash = __nd->__hash_ % __bc; + __chash = __constrain_hash(__nd->__hash_, __bc); } // insert_after __bucket_list_[__chash], or __first_node if bucket is null __node_pointer __pn = __bucket_list_[__chash]; @@ -1221,7 +1242,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> // fix up __bucket_list_ __bucket_list_[__chash] = __pn; if (__nd->__next_ != nullptr) - __bucket_list_[__nd->__next_->__hash_ % __bc] = __nd; + __bucket_list_[__constrain_hash(__nd->__next_->__hash_, __bc)] = __nd; } else { @@ -1245,11 +1266,11 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> size_type __bc = bucket_count(); if (size()+1 > __bc * max_load_factor() || __bc == 0) { - rehash(_VSTD::max(2 * __bc + 1, + rehash(_VSTD::max(2 * __bc + !__is_power2(__bc), size_type(ceil(float(size() + 1) / max_load_factor())))); __bc = bucket_count(); } - size_t __chash = __cp->__hash_ % __bc; + size_t __chash = __constrain_hash(__cp->__hash_, __bc); __node_pointer __pn = __bucket_list_[__chash]; if (__pn == nullptr) { @@ -1259,12 +1280,12 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> // fix up __bucket_list_ __bucket_list_[__chash] = __pn; if (__cp->__next_ != nullptr) - __bucket_list_[__cp->__next_->__hash_ % __bc] = __cp; + __bucket_list_[__constrain_hash(__cp->__next_->__hash_, __bc)] = __cp; } else { for (bool __found = false; __pn->__next_ != nullptr && - __pn->__next_->__hash_ % __bc == __chash; + __constrain_hash(__pn->__next_->__hash_, __bc) == __chash; __pn = __pn->__next_) { // __found key_eq() action @@ -1285,7 +1306,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> __pn->__next_ = __cp; if (__cp->__next_ != nullptr) { - size_t __nhash = __cp->__next_->__hash_ % __bc; + size_t __nhash = __constrain_hash(__cp->__next_->__hash_, __bc); if (__nhash != __chash) __bucket_list_[__nhash] = __cp; } @@ -1306,11 +1327,11 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> size_type __bc = bucket_count(); if (size()+1 > __bc * max_load_factor() || __bc == 0) { - rehash(_VSTD::max(2 * __bc + 1, + rehash(_VSTD::max(2 * __bc + !__is_power2(__bc), size_type(ceil(float(size() + 1) / max_load_factor())))); __bc = bucket_count(); } - size_t __chash = __cp->__hash_ % __bc; + size_t __chash = __constrain_hash(__cp->__hash_, __bc); __node_pointer __pp = __bucket_list_[__chash]; while (__pp->__next_ != __np) __pp = __pp->__next_; @@ -1333,12 +1354,12 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> size_t __chash; if (__bc != 0) { - __chash = __hash % __bc; + __chash = __constrain_hash(__hash, __bc); __nd = __bucket_list_[__chash]; if (__nd != nullptr) { for (__nd = __nd->__next_; __nd != nullptr && - __nd->__hash_ % __bc == __chash; + __constrain_hash(__nd->__hash_, __bc) == __chash; __nd = __nd->__next_) { if (key_eq()(__nd->__value_, __x)) @@ -1350,10 +1371,10 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> __node_holder __h = __construct_node(__x, __hash); if (size()+1 > __bc * max_load_factor() || __bc == 0) { - rehash(_VSTD::max(2 * __bc + 1, + rehash(_VSTD::max(2 * __bc + !__is_power2(__bc), size_type(ceil(float(size() + 1) / max_load_factor())))); __bc = bucket_count(); - __chash = __hash % __bc; + __chash = __constrain_hash(__hash, __bc); } // insert_after __bucket_list_[__chash], or __first_node if bucket is null __node_pointer __pn = __bucket_list_[__chash]; @@ -1365,7 +1386,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> // fix up __bucket_list_ __bucket_list_[__chash] = __pn; if (__h->__next_ != nullptr) - __bucket_list_[__h->__next_->__hash_ % __bc] = __h.get(); + __bucket_list_[__constrain_hash(__h->__next_->__hash_, __bc)] = __h.get(); } else { @@ -1489,16 +1510,20 @@ template ::rehash(size_type __n) { - __n = __next_prime(_VSTD::max(__n, size() > 0)); + if (__n == 1) + __n = 2; + else if (__n & (__n - 1)) + __n = __next_prime(__n); size_type __bc = bucket_count(); if (__n > __bc) __rehash(__n); - else + else if (__n < __bc) { __n = _VSTD::max ( __n, - __next_prime(size_t(ceil(float(size()) / max_load_factor()))) + __is_power2(__bc) ? __next_pow2(size_t(ceil(float(size()) / max_load_factor()))) : + __next_prime(size_t(ceil(float(size()) / max_load_factor()))) ); if (__n < __bc) __rehash(__n); @@ -1521,13 +1546,13 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> __node_pointer __cp = __pp->__next_; if (__cp != nullptr) { - size_type __chash = __cp->__hash_ % __nbc; + size_type __chash = __constrain_hash(__cp->__hash_, __nbc); __bucket_list_[__chash] = __pp; size_type __phash = __chash; for (__pp = __cp, __cp = __cp->__next_; __cp != nullptr; __cp = __pp->__next_) { - __chash = __cp->__hash_ % __nbc; + __chash = __constrain_hash(__cp->__hash_, __nbc); if (__chash == __phash) __pp = __cp; else @@ -1565,12 +1590,12 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> size_type __bc = bucket_count(); if (__bc != 0) { - size_t __chash = __hash % __bc; + size_t __chash = __constrain_hash(__hash, __bc); __node_pointer __nd = __bucket_list_[__chash]; if (__nd != nullptr) { for (__nd = __nd->__next_; __nd != nullptr && - __nd->__hash_ % __bc == __chash; + __constrain_hash(__nd->__hash_, __bc) == __chash; __nd = __nd->__next_) { if (key_eq()(__nd->__value_, __k)) @@ -1590,12 +1615,12 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> size_type __bc = bucket_count(); if (__bc != 0) { - size_t __chash = __hash % __bc; + size_t __chash = __constrain_hash(__hash, __bc); __node_const_pointer __nd = __bucket_list_[__chash]; if (__nd != nullptr) { for (__nd = __nd->__next_; __nd != nullptr && - __nd->__hash_ % __bc == __chash; + __constrain_hash(__nd->__hash_, __bc) == __chash; __nd = __nd->__next_) { if (key_eq()(__nd->__value_, __k)) @@ -1734,7 +1759,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> // current node __node_pointer __cn = const_cast<__node_pointer>(__p.__node_); size_type __bc = bucket_count(); - size_t __chash = __cn->__hash_ % __bc; + size_t __chash = __constrain_hash(__cn->__hash_, __bc); // find previous node __node_pointer __pn = __bucket_list_[__chash]; for (; __pn->__next_ != __cn; __pn = __pn->__next_) @@ -1742,15 +1767,15 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> // Fix up __bucket_list_ // if __pn is not in same bucket (before begin is not in same bucket) && // if __cn->__next_ is not in same bucket (nullptr is not in same bucket) - if (__pn == _VSTD::addressof(__p1_.first()) || __pn->__hash_ % __bc != __chash) + if (__pn == _VSTD::addressof(__p1_.first()) || __constrain_hash(__pn->__hash_, __bc) != __chash) { - if (__cn->__next_ == nullptr || __cn->__next_->__hash_ % __bc != __chash) + if (__cn->__next_ == nullptr || __constrain_hash(__cn->__next_->__hash_, __bc) != __chash) __bucket_list_[__chash] = nullptr; } // if __cn->__next_ is not in same bucket (nullptr is in same bucket) if (__cn->__next_ != nullptr) { - size_t __nhash = __cn->__next_->__hash_ % __bc; + size_t __nhash = __constrain_hash(__cn->__next_->__hash_, __bc); if (__nhash != __chash) __bucket_list_[__nhash] = __pn; } @@ -1881,10 +1906,10 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> __p2_.swap(__u.__p2_); __p3_.swap(__u.__p3_); if (size() > 0) - __bucket_list_[__p1_.first().__next_->__hash_ % bucket_count()] = + __bucket_list_[__constrain_hash(__p1_.first().__next_->__hash_, bucket_count())] = static_cast<__node_pointer>(_VSTD::addressof(__p1_.first())); if (__u.size() > 0) - __u.__bucket_list_[__u.__p1_.first().__next_->__hash_ % __u.bucket_count()] = + __u.__bucket_list_[__constrain_hash(__u.__p1_.first().__next_->__hash_, __u.bucket_count())] = static_cast<__node_pointer>(_VSTD::addressof(__u.__p1_.first())); } @@ -1898,7 +1923,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> if (__np != nullptr) { for (__np = __np->__next_; __np != nullptr && - __np->__hash_ % __bc == __n; + __constrain_hash(__np->__hash_, __bc) == __n; __np = __np->__next_, ++__r) ; } Modified: stable/9/contrib/libc++/include/__locale ============================================================================== --- stable/9/contrib/libc++/include/__locale Wed Nov 21 18:27:02 2012 (r243375) +++ stable/9/contrib/libc++/include/__locale Wed Nov 21 18:38:56 2012 (r243376) @@ -31,17 +31,24 @@ _LIBCPP_BEGIN_NAMESPACE_STD -class locale; +class _LIBCPP_VISIBLE locale; -template bool has_facet(const locale&) _NOEXCEPT; -template const _Facet& use_facet(const locale&); +template +_LIBCPP_INLINE_VISIBILITY +bool +has_facet(const locale&) _NOEXCEPT; + +template +_LIBCPP_INLINE_VISIBILITY +const _Facet& +use_facet(const locale&); class _LIBCPP_VISIBLE locale { public: // types: - class facet; - class id; + class _LIBCPP_VISIBLE facet; + class _LIBCPP_VISIBLE id; typedef int category; static const category // values assigned here are for exposition only @@ -119,7 +126,7 @@ class _LIBCPP_VISIBLE locale::id static int32_t __next_id; public: - _LIBCPP_INLINE_VISIBILITY id() {} + _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR id() :__id_(0) {} private: void __init(); void operator=(const id&); // = delete; Modified: stable/9/contrib/libc++/include/__mutex_base ============================================================================== --- stable/9/contrib/libc++/include/__mutex_base Wed Nov 21 18:27:02 2012 (r243375) +++ stable/9/contrib/libc++/include/__mutex_base Wed Nov 21 18:38:56 2012 (r243376) @@ -38,7 +38,11 @@ class _LIBCPP_VISIBLE mutex public: _LIBCPP_INLINE_VISIBILITY - mutex() {__m_ = (pthread_mutex_t)PTHREAD_MUTEX_INITIALIZER;} +#ifndef _LIBCPP_HAS_NO_CONSTEXPR + constexpr mutex() _NOEXCEPT : __m_(PTHREAD_MUTEX_INITIALIZER) {} +#else + mutex() _NOEXCEPT {__m_ = (pthread_mutex_t)PTHREAD_MUTEX_INITIALIZER;} +#endif ~mutex(); private: @@ -47,8 +51,8 @@ private: public: void lock(); - bool try_lock(); - void unlock(); + bool try_lock() _NOEXCEPT; + void unlock() _NOEXCEPT; typedef pthread_mutex_t* native_handle_type; _LIBCPP_INLINE_VISIBILITY native_handle_type native_handle() {return &__m_;} @@ -58,17 +62,19 @@ struct _LIBCPP_VISIBLE defer_lock_t {}; struct _LIBCPP_VISIBLE try_to_lock_t {}; struct _LIBCPP_VISIBLE adopt_lock_t {}; -//constexpr -extern const -defer_lock_t defer_lock; - -//constexpr -extern const -try_to_lock_t try_to_lock; - -//constexpr -extern const -adopt_lock_t adopt_lock; +#if defined(_LIBCPP_HAS_NO_CONSTEXPR) || defined(_LIBCPP_BUILDING_MUTEX) + +extern const defer_lock_t defer_lock; +extern const try_to_lock_t try_to_lock; +extern const adopt_lock_t adopt_lock; + +#else + +constexpr defer_lock_t defer_lock = defer_lock_t(); +constexpr try_to_lock_t try_to_lock = try_to_lock_t(); +constexpr adopt_lock_t adopt_lock = adopt_lock_t(); + +#endif template class _LIBCPP_VISIBLE lock_guard @@ -106,12 +112,12 @@ private: public: _LIBCPP_INLINE_VISIBILITY - unique_lock() : __m_(nullptr), __owns_(false) {} + unique_lock() _NOEXCEPT : __m_(nullptr), __owns_(false) {} _LIBCPP_INLINE_VISIBILITY explicit unique_lock(mutex_type& __m) : __m_(&__m), __owns_(true) {__m_->lock();} _LIBCPP_INLINE_VISIBILITY - unique_lock(mutex_type& __m, defer_lock_t) + unique_lock(mutex_type& __m, defer_lock_t) _NOEXCEPT : __m_(&__m), __owns_(false) {} _LIBCPP_INLINE_VISIBILITY unique_lock(mutex_type& __m, try_to_lock_t) @@ -141,11 +147,11 @@ private: public: #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES _LIBCPP_INLINE_VISIBILITY - unique_lock(unique_lock&& __u) + unique_lock(unique_lock&& __u) _NOEXCEPT : __m_(__u.__m_), __owns_(__u.__owns_) {__u.__m_ = nullptr; __u.__owns_ = false;} _LIBCPP_INLINE_VISIBILITY - unique_lock& operator=(unique_lock&& __u) + unique_lock& operator=(unique_lock&& __u) _NOEXCEPT { if (__owns_) __m_->unlock(); @@ -190,13 +196,13 @@ public: void unlock(); _LIBCPP_INLINE_VISIBILITY - void swap(unique_lock& __u) + void swap(unique_lock& __u) _NOEXCEPT { _VSTD::swap(__m_, __u.__m_); _VSTD::swap(__owns_, __u.__owns_); } _LIBCPP_INLINE_VISIBILITY - mutex_type* release() + mutex_type* release() _NOEXCEPT { mutex_type* __m = __m_; __m_ = nullptr; @@ -205,12 +211,12 @@ public: } _LIBCPP_INLINE_VISIBILITY *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Thu Nov 22 00:22:55 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7E4ACA16; Thu, 22 Nov 2012 00:22:55 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 619A38FC0C; Thu, 22 Nov 2012 00:22:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAM0MtBR060619; Thu, 22 Nov 2012 00:22:55 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAM0MtUN060613; Thu, 22 Nov 2012 00:22:55 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201211220022.qAM0MtUN060613@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 22 Nov 2012 00:22:55 +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: r243382 - stable/9/sys/netinet6 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2012 00:22:55 -0000 Author: ae Date: Thu Nov 22 00:22:54 2012 New Revision: 243382 URL: http://svnweb.freebsd.org/changeset/base/243382 Log: MFC r243028: zoneid has unsigned type. MFC r243029: SCOPE6_LOCK protects V_sid_default, no need to acquire it without any access to V_sid_default. MFC r243031: if_afdata lock was converted from mutex to rwlock a long ago, so we can replace IF_AFDATA_LOCK() macro depending to the access type. MFC r243148: Reduce the overhead of locking, use IF_AFDATA_RLOCK() when we are doing simple lookups. Modified: stable/9/sys/netinet6/icmp6.c stable/9/sys/netinet6/in6_src.c stable/9/sys/netinet6/ip6_input.c stable/9/sys/netinet6/nd6.c stable/9/sys/netinet6/nd6_rtr.c stable/9/sys/netinet6/scope6.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/icmp6.c ============================================================================== --- stable/9/sys/netinet6/icmp6.c Thu Nov 22 00:08:20 2012 (r243381) +++ stable/9/sys/netinet6/icmp6.c Thu Nov 22 00:22:54 2012 (r243382) @@ -2681,9 +2681,9 @@ icmp6_redirect_output(struct mbuf *m0, s struct nd_opt_hdr *nd_opt; char *lladdr; - IF_AFDATA_LOCK(ifp); + IF_AFDATA_RLOCK(ifp); ln = nd6_lookup(router_ll6, 0, ifp); - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); if (ln == NULL) goto nolladdropt; Modified: stable/9/sys/netinet6/in6_src.c ============================================================================== --- stable/9/sys/netinet6/in6_src.c Thu Nov 22 00:08:20 2012 (r243381) +++ stable/9/sys/netinet6/in6_src.c Thu Nov 22 00:22:54 2012 (r243382) @@ -608,9 +608,9 @@ selectroute(struct sockaddr_in6 *dstsock rt = ron->ro_rt; ifp = rt->rt_ifp; - IF_AFDATA_LOCK(ifp); + IF_AFDATA_RLOCK(ifp); la = lla_lookup(LLTABLE6(ifp), 0, (struct sockaddr *)&sin6_next->sin6_addr); - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); if (la != NULL) LLE_RUNLOCK(la); else { Modified: stable/9/sys/netinet6/ip6_input.c ============================================================================== --- stable/9/sys/netinet6/ip6_input.c Thu Nov 22 00:08:20 2012 (r243381) +++ stable/9/sys/netinet6/ip6_input.c Thu Nov 22 00:22:54 2012 (r243382) @@ -685,10 +685,10 @@ passin: dst6.sin6_len = sizeof(struct sockaddr_in6); dst6.sin6_addr = ip6->ip6_dst; ifp = m->m_pkthdr.rcvif; - IF_AFDATA_LOCK(ifp); + IF_AFDATA_RLOCK(ifp); lle = lla_lookup(LLTABLE6(ifp), 0, (struct sockaddr *)&dst6); - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); if ((lle != NULL) && (lle->la_flags & LLE_IFADDR)) { struct ifaddr *ifa; struct in6_ifaddr *ia6; Modified: stable/9/sys/netinet6/nd6.c ============================================================================== --- stable/9/sys/netinet6/nd6.c Thu Nov 22 00:08:20 2012 (r243381) +++ stable/9/sys/netinet6/nd6.c Thu Nov 22 00:22:54 2012 (r243382) @@ -978,12 +978,12 @@ nd6_is_addr_neighbor(struct sockaddr_in6 * Even if the address matches none of our addresses, it might be * in the neighbor cache. */ - IF_AFDATA_LOCK(ifp); + IF_AFDATA_RLOCK(ifp); if ((lle = nd6_lookup(&addr->sin6_addr, 0, ifp)) != NULL) { LLE_RUNLOCK(lle); rc = 1; } - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); return (rc); } @@ -1502,9 +1502,9 @@ nd6_ioctl(u_long cmd, caddr_t data, stru if ((error = in6_setscope(&nb_addr, ifp, NULL)) != 0) return (error); - IF_AFDATA_LOCK(ifp); + IF_AFDATA_RLOCK(ifp); ln = nd6_lookup(&nb_addr, 0, ifp); - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); if (ln == NULL) { error = EINVAL; @@ -2223,9 +2223,9 @@ nd6_storelladdr(struct ifnet *ifp, struc /* * the entry should have been created in nd6_store_lladdr */ - IF_AFDATA_LOCK(ifp); + IF_AFDATA_RLOCK(ifp); ln = lla_lookup(LLTABLE6(ifp), 0, dst); - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); if ((ln == NULL) || !(ln->la_flags & LLE_VALID)) { if (ln != NULL) LLE_RUNLOCK(ln); Modified: stable/9/sys/netinet6/nd6_rtr.c ============================================================================== --- stable/9/sys/netinet6/nd6_rtr.c Thu Nov 22 00:08:20 2012 (r243381) +++ stable/9/sys/netinet6/nd6_rtr.c Thu Nov 22 00:22:54 2012 (r243382) @@ -643,13 +643,13 @@ defrouter_select(void) * the ordering rule of the list described in defrtrlist_update(). */ TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) { - IF_AFDATA_LOCK(dr->ifp); + IF_AFDATA_RLOCK(dr->ifp); if (selected_dr == NULL && (ln = nd6_lookup(&dr->rtaddr, 0, dr->ifp)) && ND6_IS_LLINFO_PROBREACH(ln)) { selected_dr = dr; } - IF_AFDATA_UNLOCK(dr->ifp); + IF_AFDATA_RUNLOCK(dr->ifp); if (ln != NULL) { LLE_RUNLOCK(ln); ln = NULL; @@ -677,13 +677,13 @@ defrouter_select(void) else selected_dr = TAILQ_NEXT(installed_dr, dr_entry); } else if (installed_dr) { - IF_AFDATA_LOCK(installed_dr->ifp); + IF_AFDATA_RLOCK(installed_dr->ifp); if ((ln = nd6_lookup(&installed_dr->rtaddr, 0, installed_dr->ifp)) && ND6_IS_LLINFO_PROBREACH(ln) && rtpref(selected_dr) <= rtpref(installed_dr)) { selected_dr = installed_dr; } - IF_AFDATA_UNLOCK(installed_dr->ifp); + IF_AFDATA_RUNLOCK(installed_dr->ifp); if (ln != NULL) LLE_RUNLOCK(ln); } @@ -1326,9 +1326,9 @@ find_pfxlist_reachable_router(struct nd_ int canreach; LIST_FOREACH(pfxrtr, &pr->ndpr_advrtrs, pfr_entry) { - IF_AFDATA_LOCK(pfxrtr->router->ifp); + IF_AFDATA_RLOCK(pfxrtr->router->ifp); ln = nd6_lookup(&pfxrtr->router->rtaddr, 0, pfxrtr->router->ifp); - IF_AFDATA_UNLOCK(pfxrtr->router->ifp); + IF_AFDATA_RUNLOCK(pfxrtr->router->ifp); if (ln == NULL) continue; canreach = ND6_IS_LLINFO_PROBREACH(ln); Modified: stable/9/sys/netinet6/scope6.c ============================================================================== --- stable/9/sys/netinet6/scope6.c Thu Nov 22 00:08:20 2012 (r243381) +++ stable/9/sys/netinet6/scope6.c Thu Nov 22 00:22:54 2012 (r243382) @@ -121,11 +121,11 @@ scope6_set(struct ifnet *ifp, struct sco int error = 0; struct scope6_id *sid = NULL; - IF_AFDATA_LOCK(ifp); + IF_AFDATA_WLOCK(ifp); sid = SID(ifp); if (!sid) { /* paranoid? */ - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_WUNLOCK(ifp); return (EINVAL); } @@ -139,7 +139,6 @@ scope6_set(struct ifnet *ifp, struct sco * interface addresses, routing table entries, PCB entries... */ - SCOPE6_LOCK(); for (i = 0; i < 16; i++) { if (idlist->s6id_list[i] && idlist->s6id_list[i] != sid->s6id_list[i]) { @@ -149,8 +148,7 @@ scope6_set(struct ifnet *ifp, struct sco */ if (i == IPV6_ADDR_SCOPE_INTFACELOCAL && idlist->s6id_list[i] != ifp->if_index) { - IF_AFDATA_UNLOCK(ifp); - SCOPE6_UNLOCK(); + IF_AFDATA_WUNLOCK(ifp); return (EINVAL); } @@ -162,8 +160,7 @@ scope6_set(struct ifnet *ifp, struct sco * IDs, but we check the consistency for * safety in later use. */ - IF_AFDATA_UNLOCK(ifp); - SCOPE6_UNLOCK(); + IF_AFDATA_WUNLOCK(ifp); return (EINVAL); } @@ -175,8 +172,7 @@ scope6_set(struct ifnet *ifp, struct sco sid->s6id_list[i] = idlist->s6id_list[i]; } } - SCOPE6_UNLOCK(); - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_WUNLOCK(ifp); return (error); } @@ -184,20 +180,19 @@ scope6_set(struct ifnet *ifp, struct sco int scope6_get(struct ifnet *ifp, struct scope6_id *idlist) { - /* We only need to lock the interface's afdata for SID() to work. */ - IF_AFDATA_LOCK(ifp); - struct scope6_id *sid = SID(ifp); + struct scope6_id *sid; + /* We only need to lock the interface's afdata for SID() to work. */ + IF_AFDATA_RLOCK(ifp); + sid = SID(ifp); if (sid == NULL) { /* paranoid? */ - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); return (EINVAL); } - SCOPE6_LOCK(); *idlist = *sid; - SCOPE6_UNLOCK(); - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); return (0); } @@ -388,7 +383,7 @@ sa6_recoverscope(struct sockaddr_in6 *si zoneid = ntohs(sin6->sin6_addr.s6_addr16[1]); if (zoneid) { /* sanity check */ - if (zoneid < 0 || V_if_index < zoneid) + if (V_if_index < zoneid) return (ENXIO); if (!ifnet_byindex(zoneid)) return (ENXIO); @@ -414,7 +409,7 @@ in6_setscope(struct in6_addr *in6, struc u_int32_t zoneid = 0; struct scope6_id *sid; - IF_AFDATA_LOCK(ifp); + IF_AFDATA_RLOCK(ifp); sid = SID(ifp); @@ -431,19 +426,17 @@ in6_setscope(struct in6_addr *in6, struc */ if (IN6_IS_ADDR_LOOPBACK(in6)) { if (!(ifp->if_flags & IFF_LOOPBACK)) { - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); return (EINVAL); } else { if (ret_id != NULL) *ret_id = 0; /* there's no ambiguity */ - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); return (0); } } scope = in6_addrscope(in6); - - SCOPE6_LOCK(); switch (scope) { case IPV6_ADDR_SCOPE_INTFACELOCAL: /* should be interface index */ zoneid = sid->s6id_list[IPV6_ADDR_SCOPE_INTFACELOCAL]; @@ -465,8 +458,7 @@ in6_setscope(struct in6_addr *in6, struc zoneid = 0; /* XXX: treat as global. */ break; } - SCOPE6_UNLOCK(); - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); if (ret_id != NULL) *ret_id = zoneid; From owner-svn-src-stable@FreeBSD.ORG Thu Nov 22 00:25:58 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A0326BB1; Thu, 22 Nov 2012 00:25:58 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 85AD88FC0C; Thu, 22 Nov 2012 00:25:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAM0Pw8Q060979; Thu, 22 Nov 2012 00:25:58 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAM0PwVL060970; Thu, 22 Nov 2012 00:25:58 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201211220025.qAM0PwVL060970@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 22 Nov 2012 00:25:58 +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: r243383 - stable/8/sys/netinet6 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2012 00:25:58 -0000 Author: ae Date: Thu Nov 22 00:25:57 2012 New Revision: 243383 URL: http://svnweb.freebsd.org/changeset/base/243383 Log: MFC r243028: zoneid has unsigned type. MFC r243029: SCOPE6_LOCK protects V_sid_default, no need to acquire it without any access to V_sid_default. MFC r243031: if_afdata lock was converted from mutex to rwlock a long ago, so we can replace IF_AFDATA_LOCK() macro depending to the access type. MFC r243148: Reduce the overhead of locking, use IF_AFDATA_RLOCK() when we are doing simple lookups. Modified: stable/8/sys/netinet6/icmp6.c stable/8/sys/netinet6/in6_src.c stable/8/sys/netinet6/ip6_input.c stable/8/sys/netinet6/nd6.c stable/8/sys/netinet6/nd6_rtr.c stable/8/sys/netinet6/scope6.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/netinet6/ (props changed) Modified: stable/8/sys/netinet6/icmp6.c ============================================================================== --- stable/8/sys/netinet6/icmp6.c Thu Nov 22 00:22:54 2012 (r243382) +++ stable/8/sys/netinet6/icmp6.c Thu Nov 22 00:25:57 2012 (r243383) @@ -2600,9 +2600,9 @@ icmp6_redirect_output(struct mbuf *m0, s struct nd_opt_hdr *nd_opt; char *lladdr; - IF_AFDATA_LOCK(ifp); + IF_AFDATA_RLOCK(ifp); ln = nd6_lookup(router_ll6, 0, ifp); - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); if (ln == NULL) goto nolladdropt; Modified: stable/8/sys/netinet6/in6_src.c ============================================================================== --- stable/8/sys/netinet6/in6_src.c Thu Nov 22 00:22:54 2012 (r243382) +++ stable/8/sys/netinet6/in6_src.c Thu Nov 22 00:25:57 2012 (r243383) @@ -608,9 +608,9 @@ selectroute(struct sockaddr_in6 *dstsock rt = ron->ro_rt; ifp = rt->rt_ifp; - IF_AFDATA_LOCK(ifp); + IF_AFDATA_RLOCK(ifp); la = lla_lookup(LLTABLE6(ifp), 0, (struct sockaddr *)&sin6_next->sin6_addr); - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); if (la != NULL) LLE_RUNLOCK(la); else { Modified: stable/8/sys/netinet6/ip6_input.c ============================================================================== --- stable/8/sys/netinet6/ip6_input.c Thu Nov 22 00:22:54 2012 (r243382) +++ stable/8/sys/netinet6/ip6_input.c Thu Nov 22 00:25:57 2012 (r243383) @@ -542,10 +542,10 @@ passin: dst6.sin6_len = sizeof(struct sockaddr_in6); dst6.sin6_addr = ip6->ip6_dst; ifp = m->m_pkthdr.rcvif; - IF_AFDATA_LOCK(ifp); + IF_AFDATA_RLOCK(ifp); lle = lla_lookup(LLTABLE6(ifp), 0, (struct sockaddr *)&dst6); - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); if ((lle != NULL) && (lle->la_flags & LLE_IFADDR)) { struct ifaddr *ifa; struct in6_ifaddr *ia6; Modified: stable/8/sys/netinet6/nd6.c ============================================================================== --- stable/8/sys/netinet6/nd6.c Thu Nov 22 00:22:54 2012 (r243382) +++ stable/8/sys/netinet6/nd6.c Thu Nov 22 00:25:57 2012 (r243383) @@ -977,12 +977,12 @@ nd6_is_addr_neighbor(struct sockaddr_in6 * Even if the address matches none of our addresses, it might be * in the neighbor cache. */ - IF_AFDATA_LOCK(ifp); + IF_AFDATA_RLOCK(ifp); if ((lle = nd6_lookup(&addr->sin6_addr, 0, ifp)) != NULL) { LLE_RUNLOCK(lle); rc = 1; } - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); return (rc); } @@ -1402,9 +1402,9 @@ nd6_ioctl(u_long cmd, caddr_t data, stru if ((error = in6_setscope(&nb_addr, ifp, NULL)) != 0) return (error); - IF_AFDATA_LOCK(ifp); + IF_AFDATA_RLOCK(ifp); ln = nd6_lookup(&nb_addr, 0, ifp); - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); if (ln == NULL) { error = EINVAL; @@ -2096,9 +2096,9 @@ nd6_storelladdr(struct ifnet *ifp, struc /* * the entry should have been created in nd6_store_lladdr */ - IF_AFDATA_LOCK(ifp); + IF_AFDATA_RLOCK(ifp); ln = lla_lookup(LLTABLE6(ifp), 0, dst); - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); if ((ln == NULL) || !(ln->la_flags & LLE_VALID)) { if (ln != NULL) LLE_RUNLOCK(ln); Modified: stable/8/sys/netinet6/nd6_rtr.c ============================================================================== --- stable/8/sys/netinet6/nd6_rtr.c Thu Nov 22 00:22:54 2012 (r243382) +++ stable/8/sys/netinet6/nd6_rtr.c Thu Nov 22 00:25:57 2012 (r243383) @@ -647,13 +647,13 @@ defrouter_select(void) * the ordering rule of the list described in defrtrlist_update(). */ TAILQ_FOREACH(dr, &V_nd_defrouter, dr_entry) { - IF_AFDATA_LOCK(dr->ifp); + IF_AFDATA_RLOCK(dr->ifp); if (selected_dr == NULL && (ln = nd6_lookup(&dr->rtaddr, 0, dr->ifp)) && ND6_IS_LLINFO_PROBREACH(ln)) { selected_dr = dr; } - IF_AFDATA_UNLOCK(dr->ifp); + IF_AFDATA_RUNLOCK(dr->ifp); if (ln != NULL) { LLE_RUNLOCK(ln); ln = NULL; @@ -681,13 +681,13 @@ defrouter_select(void) else selected_dr = TAILQ_NEXT(installed_dr, dr_entry); } else if (installed_dr) { - IF_AFDATA_LOCK(installed_dr->ifp); + IF_AFDATA_RLOCK(installed_dr->ifp); if ((ln = nd6_lookup(&installed_dr->rtaddr, 0, installed_dr->ifp)) && ND6_IS_LLINFO_PROBREACH(ln) && rtpref(selected_dr) <= rtpref(installed_dr)) { selected_dr = installed_dr; } - IF_AFDATA_UNLOCK(installed_dr->ifp); + IF_AFDATA_RUNLOCK(installed_dr->ifp); if (ln != NULL) LLE_RUNLOCK(ln); } @@ -1330,9 +1330,9 @@ find_pfxlist_reachable_router(struct nd_ int canreach; LIST_FOREACH(pfxrtr, &pr->ndpr_advrtrs, pfr_entry) { - IF_AFDATA_LOCK(pfxrtr->router->ifp); + IF_AFDATA_RLOCK(pfxrtr->router->ifp); ln = nd6_lookup(&pfxrtr->router->rtaddr, 0, pfxrtr->router->ifp); - IF_AFDATA_UNLOCK(pfxrtr->router->ifp); + IF_AFDATA_RUNLOCK(pfxrtr->router->ifp); if (ln == NULL) continue; canreach = ND6_IS_LLINFO_PROBREACH(ln); Modified: stable/8/sys/netinet6/scope6.c ============================================================================== --- stable/8/sys/netinet6/scope6.c Thu Nov 22 00:22:54 2012 (r243382) +++ stable/8/sys/netinet6/scope6.c Thu Nov 22 00:25:57 2012 (r243383) @@ -121,11 +121,11 @@ scope6_set(struct ifnet *ifp, struct sco int error = 0; struct scope6_id *sid = NULL; - IF_AFDATA_LOCK(ifp); + IF_AFDATA_WLOCK(ifp); sid = SID(ifp); if (!sid) { /* paranoid? */ - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_WUNLOCK(ifp); return (EINVAL); } @@ -139,7 +139,6 @@ scope6_set(struct ifnet *ifp, struct sco * interface addresses, routing table entries, PCB entries... */ - SCOPE6_LOCK(); for (i = 0; i < 16; i++) { if (idlist->s6id_list[i] && idlist->s6id_list[i] != sid->s6id_list[i]) { @@ -149,8 +148,7 @@ scope6_set(struct ifnet *ifp, struct sco */ if (i == IPV6_ADDR_SCOPE_INTFACELOCAL && idlist->s6id_list[i] != ifp->if_index) { - IF_AFDATA_UNLOCK(ifp); - SCOPE6_UNLOCK(); + IF_AFDATA_WUNLOCK(ifp); return (EINVAL); } @@ -162,8 +160,7 @@ scope6_set(struct ifnet *ifp, struct sco * IDs, but we check the consistency for * safety in later use. */ - IF_AFDATA_UNLOCK(ifp); - SCOPE6_UNLOCK(); + IF_AFDATA_WUNLOCK(ifp); return (EINVAL); } @@ -175,8 +172,7 @@ scope6_set(struct ifnet *ifp, struct sco sid->s6id_list[i] = idlist->s6id_list[i]; } } - SCOPE6_UNLOCK(); - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_WUNLOCK(ifp); return (error); } @@ -184,20 +180,19 @@ scope6_set(struct ifnet *ifp, struct sco int scope6_get(struct ifnet *ifp, struct scope6_id *idlist) { - /* We only need to lock the interface's afdata for SID() to work. */ - IF_AFDATA_LOCK(ifp); - struct scope6_id *sid = SID(ifp); + struct scope6_id *sid; + /* We only need to lock the interface's afdata for SID() to work. */ + IF_AFDATA_RLOCK(ifp); + sid = SID(ifp); if (sid == NULL) { /* paranoid? */ - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); return (EINVAL); } - SCOPE6_LOCK(); *idlist = *sid; - SCOPE6_UNLOCK(); - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); return (0); } @@ -388,7 +383,7 @@ sa6_recoverscope(struct sockaddr_in6 *si zoneid = ntohs(sin6->sin6_addr.s6_addr16[1]); if (zoneid) { /* sanity check */ - if (zoneid < 0 || V_if_index < zoneid) + if (V_if_index < zoneid) return (ENXIO); if (!ifnet_byindex(zoneid)) return (ENXIO); @@ -414,7 +409,7 @@ in6_setscope(struct in6_addr *in6, struc u_int32_t zoneid = 0; struct scope6_id *sid; - IF_AFDATA_LOCK(ifp); + IF_AFDATA_RLOCK(ifp); sid = SID(ifp); @@ -431,19 +426,17 @@ in6_setscope(struct in6_addr *in6, struc */ if (IN6_IS_ADDR_LOOPBACK(in6)) { if (!(ifp->if_flags & IFF_LOOPBACK)) { - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); return (EINVAL); } else { if (ret_id != NULL) *ret_id = 0; /* there's no ambiguity */ - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); return (0); } } scope = in6_addrscope(in6); - - SCOPE6_LOCK(); switch (scope) { case IPV6_ADDR_SCOPE_INTFACELOCAL: /* should be interface index */ zoneid = sid->s6id_list[IPV6_ADDR_SCOPE_INTFACELOCAL]; @@ -465,8 +458,7 @@ in6_setscope(struct in6_addr *in6, struc zoneid = 0; /* XXX: treat as global. */ break; } - SCOPE6_UNLOCK(); - IF_AFDATA_UNLOCK(ifp); + IF_AFDATA_RUNLOCK(ifp); if (ret_id != NULL) *ret_id = zoneid; From owner-svn-src-stable@FreeBSD.ORG Thu Nov 22 12:11:34 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0C97D109; Thu, 22 Nov 2012 12:11:34 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E3FF58FC16; Thu, 22 Nov 2012 12:11:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAMCBXR4072429; Thu, 22 Nov 2012 12:11:33 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAMCBXSJ072398; Thu, 22 Nov 2012 12:11:33 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201211221211.qAMCBXSJ072398@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 22 Nov 2012 12:11:33 +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: r243401 - in stable/9/sys: conf contrib/pf/net modules/dummynet modules/ipfw modules/ipfw_nat net netgraph netinet/ipfw netpfil netpfil/ipfw X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2012 12:11:34 -0000 Author: glebius Date: Thu Nov 22 12:11:32 2012 New Revision: 243401 URL: http://svnweb.freebsd.org/changeset/base/243401 Log: Partially merge r240494, which moved netinet/ipfw to netpfil/ipfw, to make it easier to merge ipfw commits back to stable/9. Added: stable/9/sys/netpfil/ stable/9/sys/netpfil/ipfw/ - copied from r243400, stable/9/sys/netinet/ipfw/ Deleted: stable/9/sys/netinet/ipfw/ Modified: stable/9/sys/conf/files stable/9/sys/contrib/pf/net/pf.c stable/9/sys/modules/dummynet/Makefile stable/9/sys/modules/ipfw/Makefile stable/9/sys/modules/ipfw_nat/Makefile stable/9/sys/net/if_bridge.c stable/9/sys/net/if_ethersubr.c stable/9/sys/netgraph/ng_ipfw.c stable/9/sys/netpfil/ipfw/dn_heap.c stable/9/sys/netpfil/ipfw/dn_sched_fifo.c stable/9/sys/netpfil/ipfw/dn_sched_prio.c stable/9/sys/netpfil/ipfw/dn_sched_qfq.c stable/9/sys/netpfil/ipfw/dn_sched_rr.c stable/9/sys/netpfil/ipfw/dn_sched_wf2q.c stable/9/sys/netpfil/ipfw/ip_dn_glue.c stable/9/sys/netpfil/ipfw/ip_dn_io.c stable/9/sys/netpfil/ipfw/ip_dummynet.c stable/9/sys/netpfil/ipfw/ip_fw2.c stable/9/sys/netpfil/ipfw/ip_fw_dynamic.c stable/9/sys/netpfil/ipfw/ip_fw_log.c stable/9/sys/netpfil/ipfw/ip_fw_nat.c stable/9/sys/netpfil/ipfw/ip_fw_pfil.c stable/9/sys/netpfil/ipfw/ip_fw_sockopt.c stable/9/sys/netpfil/ipfw/ip_fw_table.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/conf/files Thu Nov 22 12:11:32 2012 (r243401) @@ -2842,26 +2842,9 @@ netinet/in_proto.c optional inet | inet compile-with "${NORMAL_C} -I$S/contrib/pf" netinet/in_rmx.c optional inet netinet/ip_divert.c optional inet ipdivert ipfirewall -netinet/ipfw/dn_heap.c optional inet dummynet -netinet/ipfw/dn_sched_fifo.c optional inet dummynet -netinet/ipfw/dn_sched_prio.c optional inet dummynet -netinet/ipfw/dn_sched_qfq.c optional inet dummynet -netinet/ipfw/dn_sched_rr.c optional inet dummynet -netinet/ipfw/dn_sched_wf2q.c optional inet dummynet -netinet/ipfw/ip_dummynet.c optional inet dummynet -netinet/ipfw/ip_dn_io.c optional inet dummynet -netinet/ipfw/ip_dn_glue.c optional inet dummynet netinet/ip_ecn.c optional inet | inet6 netinet/ip_encap.c optional inet | inet6 netinet/ip_fastfwd.c optional inet -netinet/ipfw/ip_fw2.c optional inet ipfirewall \ - compile-with "${NORMAL_C} -I$S/contrib/pf" -netinet/ipfw/ip_fw_dynamic.c optional inet ipfirewall -netinet/ipfw/ip_fw_log.c optional inet ipfirewall -netinet/ipfw/ip_fw_pfil.c optional inet ipfirewall -netinet/ipfw/ip_fw_sockopt.c optional inet ipfirewall -netinet/ipfw/ip_fw_table.c optional inet ipfirewall -netinet/ipfw/ip_fw_nat.c optional inet ipfirewall_nat netinet/ip_icmp.c optional inet | inet6 netinet/ip_input.c optional inet netinet/ip_ipsec.c optional inet ipsec @@ -2969,6 +2952,23 @@ netncp/ncp_nls.c optional ncp netncp/ncp_rq.c optional ncp netncp/ncp_sock.c optional ncp netncp/ncp_subr.c optional ncp +netpfil/ipfw/dn_heap.c optional inet dummynet +netpfil/ipfw/dn_sched_fifo.c optional inet dummynet +netpfil/ipfw/dn_sched_prio.c optional inet dummynet +netpfil/ipfw/dn_sched_qfq.c optional inet dummynet +netpfil/ipfw/dn_sched_rr.c optional inet dummynet +netpfil/ipfw/dn_sched_wf2q.c optional inet dummynet +netpfil/ipfw/ip_dummynet.c optional inet dummynet +netpfil/ipfw/ip_dn_io.c optional inet dummynet +netpfil/ipfw/ip_dn_glue.c optional inet dummynet +netpfil/ipfw/ip_fw2.c optional inet ipfirewall \ + compile-with "${NORMAL_C} -I$S/contrib/pf" +netpfil/ipfw/ip_fw_dynamic.c optional inet ipfirewall +netpfil/ipfw/ip_fw_log.c optional inet ipfirewall +netpfil/ipfw/ip_fw_pfil.c optional inet ipfirewall +netpfil/ipfw/ip_fw_sockopt.c optional inet ipfirewall +netpfil/ipfw/ip_fw_table.c optional inet ipfirewall +netpfil/ipfw/ip_fw_nat.c optional inet ipfirewall_nat netsmb/smb_conn.c optional netsmb netsmb/smb_crypt.c optional netsmb netsmb/smb_dev.c optional netsmb Modified: stable/9/sys/contrib/pf/net/pf.c ============================================================================== --- stable/9/sys/contrib/pf/net/pf.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/contrib/pf/net/pf.c Thu Nov 22 12:11:32 2012 (r243401) @@ -122,7 +122,7 @@ __FBSDID("$FreeBSD$"); #include #ifdef __FreeBSD__ #include -#include /* XXX: only for DIR_IN/DIR_OUT */ +#include /* XXX: only for DIR_IN/DIR_OUT */ #endif #ifndef __FreeBSD__ Modified: stable/9/sys/modules/dummynet/Makefile ============================================================================== --- stable/9/sys/modules/dummynet/Makefile Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/modules/dummynet/Makefile Thu Nov 22 12:11:32 2012 (r243401) @@ -2,7 +2,7 @@ .include -.PATH: ${.CURDIR}/../../netinet/ipfw +.PATH: ${.CURDIR}/../../netpfil/ipfw KMOD= dummynet SRCS= ip_dummynet.c SRCS+= ip_dn_glue.c ip_dn_io.c Modified: stable/9/sys/modules/ipfw/Makefile ============================================================================== --- stable/9/sys/modules/ipfw/Makefile Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/modules/ipfw/Makefile Thu Nov 22 12:11:32 2012 (r243401) @@ -2,7 +2,7 @@ .include -.PATH: ${.CURDIR}/../../netinet/ipfw +.PATH: ${.CURDIR}/../../netpfil/ipfw KMOD= ipfw SRCS= ip_fw2.c ip_fw_pfil.c Modified: stable/9/sys/modules/ipfw_nat/Makefile ============================================================================== --- stable/9/sys/modules/ipfw_nat/Makefile Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/modules/ipfw_nat/Makefile Thu Nov 22 12:11:32 2012 (r243401) @@ -1,6 +1,6 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../../netinet/ipfw +.PATH: ${.CURDIR}/../../netpfil/ipfw KMOD= ipfw_nat SRCS= ip_fw_nat.c Modified: stable/9/sys/net/if_bridge.c ============================================================================== --- stable/9/sys/net/if_bridge.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/net/if_bridge.c Thu Nov 22 12:11:32 2012 (r243401) @@ -132,7 +132,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include /* * Size of the route hash table. Must be a power of two. Modified: stable/9/sys/net/if_ethersubr.c ============================================================================== --- stable/9/sys/net/if_ethersubr.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/net/if_ethersubr.c Thu Nov 22 12:11:32 2012 (r243401) @@ -72,7 +72,7 @@ #include #include #include -#include +#include #endif #ifdef INET6 #include Modified: stable/9/sys/netgraph/ng_ipfw.c ============================================================================== --- stable/9/sys/netgraph/ng_ipfw.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/netgraph/ng_ipfw.c Thu Nov 22 12:11:32 2012 (r243401) @@ -48,11 +48,12 @@ #include #include #include -#include #include #include #include +#include + #include #include #include Modified: stable/9/sys/netpfil/ipfw/dn_heap.c ============================================================================== --- stable/9/sys/netinet/ipfw/dn_heap.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/netpfil/ipfw/dn_heap.c Thu Nov 22 12:11:32 2012 (r243401) @@ -37,7 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #ifndef log #define log(x, arg...) #endif Modified: stable/9/sys/netpfil/ipfw/dn_sched_fifo.c ============================================================================== --- stable/9/sys/netinet/ipfw/dn_sched_fifo.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/netpfil/ipfw/dn_sched_fifo.c Thu Nov 22 12:11:32 2012 (r243401) @@ -40,9 +40,9 @@ #include /* ipfw_rule_ref */ #include /* flow_id */ #include -#include -#include -#include +#include +#include +#include #else #include #endif Modified: stable/9/sys/netpfil/ipfw/dn_sched_prio.c ============================================================================== --- stable/9/sys/netinet/ipfw/dn_sched_prio.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/netpfil/ipfw/dn_sched_prio.c Thu Nov 22 12:11:32 2012 (r243401) @@ -39,9 +39,9 @@ #include /* ipfw_rule_ref */ #include /* flow_id */ #include -#include -#include -#include +#include +#include +#include #else #include #endif Modified: stable/9/sys/netpfil/ipfw/dn_sched_qfq.c ============================================================================== --- stable/9/sys/netinet/ipfw/dn_sched_qfq.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/netpfil/ipfw/dn_sched_qfq.c Thu Nov 22 12:11:32 2012 (r243401) @@ -40,9 +40,9 @@ #include /* ipfw_rule_ref */ #include /* flow_id */ #include -#include -#include -#include +#include +#include +#include #else #include #endif Modified: stable/9/sys/netpfil/ipfw/dn_sched_rr.c ============================================================================== --- stable/9/sys/netinet/ipfw/dn_sched_rr.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/netpfil/ipfw/dn_sched_rr.c Thu Nov 22 12:11:32 2012 (r243401) @@ -40,9 +40,9 @@ #include /* ipfw_rule_ref */ #include /* flow_id */ #include -#include -#include -#include +#include +#include +#include #else #include #endif Modified: stable/9/sys/netpfil/ipfw/dn_sched_wf2q.c ============================================================================== --- stable/9/sys/netinet/ipfw/dn_sched_wf2q.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/netpfil/ipfw/dn_sched_wf2q.c Thu Nov 22 12:11:32 2012 (r243401) @@ -41,9 +41,9 @@ #include /* ipfw_rule_ref */ #include /* flow_id */ #include -#include -#include -#include +#include +#include +#include #else #include #endif Modified: stable/9/sys/netpfil/ipfw/ip_dn_glue.c ============================================================================== --- stable/9/sys/netinet/ipfw/ip_dn_glue.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/netpfil/ipfw/ip_dn_glue.c Thu Nov 22 12:11:32 2012 (r243401) @@ -50,11 +50,12 @@ #include #include /* ip_output(), IP_FORWARDING */ #include -#include -#include #include -#include -#include + +#include +#include +#include +#include /* FREEBSD7.2 ip_dummynet.h r191715*/ Modified: stable/9/sys/netpfil/ipfw/ip_dn_io.c ============================================================================== --- stable/9/sys/netinet/ipfw/ip_dn_io.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/netpfil/ipfw/ip_dn_io.c Thu Nov 22 12:11:32 2012 (r243401) @@ -54,17 +54,16 @@ __FBSDID("$FreeBSD$"); #include /* ip_len, ip_off */ #include /* ip_output(), IP_FORWARDING */ #include -#include -#include #include -#include -#include - #include /* various ether_* routines */ - #include /* for ip6_input, ip6_output prototypes */ #include +#include +#include +#include +#include + /* * We keep a private variable for the simulation time, but we could * probably use an existing one ("softticks" in sys/kern/kern_timeout.c) Modified: stable/9/sys/netpfil/ipfw/ip_dummynet.c ============================================================================== --- stable/9/sys/netinet/ipfw/ip_dummynet.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/netpfil/ipfw/ip_dummynet.c Thu Nov 22 12:11:32 2012 (r243401) @@ -52,11 +52,12 @@ __FBSDID("$FreeBSD$"); #include #include /* ip_output(), IP_FORWARDING */ #include -#include -#include #include -#include -#include + +#include +#include +#include +#include /* which objects to copy */ #define DN_C_LINK 0x01 Modified: stable/9/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- stable/9/sys/netinet/ipfw/ip_fw2.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/netpfil/ipfw/ip_fw2.c Thu Nov 22 12:11:32 2012 (r243401) @@ -70,7 +70,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -86,6 +85,8 @@ __FBSDID("$FreeBSD$"); #include #endif +#include + #include /* XXX for in_cksum */ #ifdef MAC Modified: stable/9/sys/netpfil/ipfw/ip_fw_dynamic.c ============================================================================== --- stable/9/sys/netinet/ipfw/ip_fw_dynamic.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/netpfil/ipfw/ip_fw_dynamic.c Thu Nov 22 12:11:32 2012 (r243401) @@ -57,7 +57,6 @@ __FBSDID("$FreeBSD$"); #include #include /* ip_defttl */ #include -#include #include #include @@ -67,6 +66,8 @@ __FBSDID("$FreeBSD$"); #include #endif +#include + #include /* XXX for in_cksum */ #ifdef MAC Modified: stable/9/sys/netpfil/ipfw/ip_fw_log.c ============================================================================== --- stable/9/sys/netinet/ipfw/ip_fw_log.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/netpfil/ipfw/ip_fw_log.c Thu Nov 22 12:11:32 2012 (r243401) @@ -55,7 +55,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -65,6 +64,8 @@ __FBSDID("$FreeBSD$"); #include /* ip6_sprintf() */ #endif +#include + #ifdef MAC #include #endif Modified: stable/9/sys/netpfil/ipfw/ip_fw_nat.c ============================================================================== --- stable/9/sys/netinet/ipfw/ip_fw_nat.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/netpfil/ipfw/ip_fw_nat.c Thu Nov 22 12:11:32 2012 (r243401) @@ -46,10 +46,11 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include +#include + #include /* XXX for in_cksum */ static VNET_DEFINE(eventhandler_tag, ifaddr_event_tag); Modified: stable/9/sys/netpfil/ipfw/ip_fw_pfil.c ============================================================================== --- stable/9/sys/netinet/ipfw/ip_fw_pfil.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/netpfil/ipfw/ip_fw_pfil.c Thu Nov 22 12:11:32 2012 (r243401) @@ -59,9 +59,11 @@ __FBSDID("$FreeBSD$"); #include #include #endif -#include + #include +#include + #include static VNET_DEFINE(int, fw_enable) = 1; Modified: stable/9/sys/netpfil/ipfw/ip_fw_sockopt.c ============================================================================== --- stable/9/sys/netinet/ipfw/ip_fw_sockopt.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/netpfil/ipfw/ip_fw_sockopt.c Thu Nov 22 12:11:32 2012 (r243401) @@ -60,7 +60,8 @@ __FBSDID("$FreeBSD$"); #include #include /* hooks */ #include -#include + +#include #ifdef MAC #include Modified: stable/9/sys/netpfil/ipfw/ip_fw_table.c ============================================================================== --- stable/9/sys/netinet/ipfw/ip_fw_table.c Thu Nov 22 10:36:10 2012 (r243400) +++ stable/9/sys/netpfil/ipfw/ip_fw_table.c Thu Nov 22 12:11:32 2012 (r243401) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include /* ip_fw.h requires IFNAMSIZ */ #include #include @@ -61,8 +62,8 @@ __FBSDID("$FreeBSD$"); #include #include /* struct ipfw_rule_ref */ #include -#include /* LIST_HEAD */ -#include + +#include #ifdef MAC #include From owner-svn-src-stable@FreeBSD.ORG Thu Nov 22 13:50:52 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4F170A6E; Thu, 22 Nov 2012 13:50:52 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 359D68FC17; Thu, 22 Nov 2012 13:50:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAMDoqlN090694; Thu, 22 Nov 2012 13:50:52 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAMDoqxw090693; Thu, 22 Nov 2012 13:50:52 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201211221350.qAMDoqxw090693@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 22 Nov 2012 13:50:52 +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: r243402 - stable/9/bin/sh X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2012 13:50:52 -0000 Author: jilles Date: Thu Nov 22 13:50:51 2012 New Revision: 243402 URL: http://svnweb.freebsd.org/changeset/base/243402 Log: MFC r242766: sh: Fix two issues when an alias is redefined: * The last character is not displayed. * If the alias ends with itself (as a word), an infinite memory-eating loop occurs. If an alias is defined initially, a space is appended to avoid recursion but this did not happen when an alias was later modified. PR: bin/173418 Submitted by: Daniel F. Modified: stable/9/bin/sh/alias.c Directory Properties: stable/9/bin/sh/ (props changed) Modified: stable/9/bin/sh/alias.c ============================================================================== --- stable/9/bin/sh/alias.c Thu Nov 22 12:11:32 2012 (r243401) +++ stable/9/bin/sh/alias.c Thu Nov 22 13:50:51 2012 (r243402) @@ -68,7 +68,18 @@ setalias(const char *name, const char *v if (equal(name, ap->name)) { INTOFF; ckfree(ap->val); + /* See HACK below. */ +#ifdef notyet ap->val = savestr(val); +#else + { + size_t len = strlen(val); + ap->val = ckmalloc(len + 2); + memcpy(ap->val, val, len); + ap->val[len] = ' '; + ap->val[len+1] = '\0'; + } +#endif INTON; return; } From owner-svn-src-stable@FreeBSD.ORG Thu Nov 22 13:51:59 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9C271BE9; Thu, 22 Nov 2012 13:51:59 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 66D348FC0C; Thu, 22 Nov 2012 13:51:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAMDpx7A090940; Thu, 22 Nov 2012 13:51:59 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAMDpxBT090937; Thu, 22 Nov 2012 13:51:59 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201211221351.qAMDpxBT090937@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 22 Nov 2012 13:51:59 +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: r243403 - in stable/9/tools/regression/bin/sh: builtins parser X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2012 13:51:59 -0000 Author: jilles Date: Thu Nov 22 13:51:58 2012 New Revision: 243403 URL: http://svnweb.freebsd.org/changeset/base/243403 Log: MFC r242767,r243252: sh: Add tests for modifying an alias (r242766/r243402). Added: stable/9/tools/regression/bin/sh/builtins/alias3.0 - copied unchanged from r242767, head/tools/regression/bin/sh/builtins/alias3.0 stable/9/tools/regression/bin/sh/builtins/alias3.0.stdout - copied unchanged from r242767, head/tools/regression/bin/sh/builtins/alias3.0.stdout stable/9/tools/regression/bin/sh/parser/alias10.0 - copied, changed from r242767, head/tools/regression/bin/sh/parser/alias10.0 Modified: Directory Properties: stable/9/tools/regression/bin/sh/ (props changed) Copied: stable/9/tools/regression/bin/sh/builtins/alias3.0 (from r242767, head/tools/regression/bin/sh/builtins/alias3.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/builtins/alias3.0 Thu Nov 22 13:51:58 2012 (r243403, copy of r242767, head/tools/regression/bin/sh/builtins/alias3.0) @@ -0,0 +1,12 @@ +# $FreeBSD$ +set -e + +unalias -a +alias foo=bar +alias bar= +alias quux="1 2 3" +alias foo=bar +alias bar= +alias quux="1 2 3" +alias +alias foo Copied: stable/9/tools/regression/bin/sh/builtins/alias3.0.stdout (from r242767, head/tools/regression/bin/sh/builtins/alias3.0.stdout) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/builtins/alias3.0.stdout Thu Nov 22 13:51:58 2012 (r243403, copy of r242767, head/tools/regression/bin/sh/builtins/alias3.0.stdout) @@ -0,0 +1,4 @@ +bar='' +foo=bar +quux='1 2 3' +foo=bar Copied and modified: stable/9/tools/regression/bin/sh/parser/alias10.0 (from r242767, head/tools/regression/bin/sh/parser/alias10.0) ============================================================================== --- head/tools/regression/bin/sh/parser/alias10.0 Thu Nov 8 13:36:19 2012 (r242767, copy source) +++ stable/9/tools/regression/bin/sh/parser/alias10.0 Thu Nov 22 13:51:58 2012 (r243403) @@ -1,5 +1,9 @@ # $FreeBSD$ +# This test may start consuming memory indefinitely if it fails. +ulimit -t 5 2>/dev/null +ulimit -v 100000 2>/dev/null + alias echo='echo' alias echo='echo' [ "`eval echo b`" = b ] From owner-svn-src-stable@FreeBSD.ORG Thu Nov 22 15:19:54 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4D4185E8; Thu, 22 Nov 2012 15:19:54 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 311098FC18; Thu, 22 Nov 2012 15:19:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAMFJs0o007468; Thu, 22 Nov 2012 15:19:54 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAMFJroe007462; Thu, 22 Nov 2012 15:19:53 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201211221519.qAMFJroe007462@svn.freebsd.org> From: Ed Schouten Date: Thu, 22 Nov 2012 15:19:53 +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: r243405 - in stable/9: include lib/libc/stdlib X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2012 15:19:54 -0000 Author: ed Date: Thu Nov 22 15:19:53 2012 New Revision: 243405 URL: http://svnweb.freebsd.org/changeset/base/243405 Log: MFC r229848: Add aligned_alloc(3). The C11 folks reinvented the wheel by introducing an aligned version of malloc(3) called aligned_alloc(3), instead of posix_memalign(3). Instead of returning the allocation by reference, it returns the address, just like malloc(3). I'm MFCing this now, as it seems aligned_alloc(3) is needed to make the new version of libc++ work, which was merged back to FreeBSD 9 in r243376. Requested by: dim Added: stable/9/lib/libc/stdlib/aligned_alloc.3 - copied unchanged from r229848, head/lib/libc/stdlib/aligned_alloc.3 Deleted: stable/9/lib/libc/stdlib/posix_memalign.3 Modified: stable/9/include/stdlib.h stable/9/lib/libc/stdlib/Makefile.inc stable/9/lib/libc/stdlib/Symbol.map stable/9/lib/libc/stdlib/malloc.c Directory Properties: stable/9/include/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/include/stdlib.h ============================================================================== --- stable/9/include/stdlib.h Thu Nov 22 14:40:26 2012 (r243404) +++ stable/9/include/stdlib.h Thu Nov 22 15:19:53 2012 (r243405) @@ -155,6 +155,7 @@ _Noreturn void _Exit(int); * If we're in a mode greater than C99, expose C1x functions. */ #if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L +void * aligned_alloc(size_t, size_t); _Noreturn void quick_exit(int); int at_quick_exit(void (*)(void)); Modified: stable/9/lib/libc/stdlib/Makefile.inc ============================================================================== --- stable/9/lib/libc/stdlib/Makefile.inc Thu Nov 22 14:40:26 2012 (r243404) +++ stable/9/lib/libc/stdlib/Makefile.inc Thu Nov 22 15:19:53 2012 (r243405) @@ -18,17 +18,18 @@ SYM_MAPS+= ${.CURDIR}/stdlib/Symbol.map # machine-dependent stdlib sources .sinclude "${.CURDIR}/${LIBC_ARCH}/stdlib/Makefile.inc" -MAN+= a64l.3 abort.3 abs.3 alloca.3 atexit.3 atof.3 atoi.3 atol.3 \ - at_quick_exit.3 bsearch.3 \ +MAN+= a64l.3 abort.3 abs.3 aligned_alloc.3 alloca.3 atexit.3 atof.3 \ + atoi.3 atol.3 at_quick_exit.3 bsearch.3 \ div.3 exit.3 getenv.3 getopt.3 getopt_long.3 getsubopt.3 \ hcreate.3 imaxabs.3 imaxdiv.3 insque.3 labs.3 ldiv.3 llabs.3 lldiv.3 \ - lsearch.3 malloc.3 memory.3 posix_memalign.3 ptsname.3 qsort.3 \ + lsearch.3 malloc.3 memory.3 ptsname.3 qsort.3 \ quick_exit.3 \ radixsort.3 rand.3 random.3 \ realpath.3 strfmon.3 strtod.3 strtol.3 strtonum.3 strtoul.3 system.3 \ tsearch.3 MLINKS+=a64l.3 l64a.3 a64l.3 l64a_r.3 +MLINKS+=aligned_alloc.3 posix_memalign.3 MLINKS+=atol.3 atoll.3 MLINKS+=exit.3 _Exit.3 MLINKS+=getenv.3 putenv.3 getenv.3 setenv.3 getenv.3 unsetenv.3 Modified: stable/9/lib/libc/stdlib/Symbol.map ============================================================================== --- stable/9/lib/libc/stdlib/Symbol.map Thu Nov 22 14:40:26 2012 (r243404) +++ stable/9/lib/libc/stdlib/Symbol.map Thu Nov 22 15:19:53 2012 (r243405) @@ -93,6 +93,7 @@ FBSD_1.0 { }; FBSD_1.3 { + aligned_alloc; atof_l; atoi_l; atol_l; Copied: stable/9/lib/libc/stdlib/aligned_alloc.3 (from r229848, head/lib/libc/stdlib/aligned_alloc.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/lib/libc/stdlib/aligned_alloc.3 Thu Nov 22 15:19:53 2012 (r243405, copy of r229848, head/lib/libc/stdlib/aligned_alloc.3) @@ -0,0 +1,126 @@ +.\" Copyright (C) 2006 Jason Evans . +.\" 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(s), this list of conditions and the following disclaimer as +.\" the first lines of this file unmodified other than the possible +.\" addition of one or more copyright notices. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice(s), 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 COPYRIGHT HOLDER(S) ``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 COPYRIGHT HOLDER(S) 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 January 7, 2011 +.Dt ALIGNED_ALLOC 3 +.Os +.Sh NAME +.Nm aligned_alloc , +.Nm posix_memalign +.Nd aligned memory allocation +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In stdlib.h +.Ft void * +.Fn aligned_alloc "size_t alignment" "size_t size" +.Ft int +.Fn posix_memalign "void **ptr" "size_t alignment" "size_t size" +.Sh DESCRIPTION +The +.Fn aligned_alloc +and +.Fn posix_memalign +functions allocate +.Fa size +bytes of memory such that the allocation's base address is an even multiple of +.Fa alignment . +The +.Fn aligned_alloc +function returns the allocation, while the +.Fn posix_memalign +function stores the allocation in the value pointed to by +.Fa ptr . +.Pp +The requested +.Fa alignment +must be a power of 2 at least as large as +.Fn sizeof "void *" . +.Pp +Memory that is allocated via +.Fn aligned_alloc +and +.Fn posix_memalign +can be used as an argument in subsequent calls to +.Xr realloc 3 , +.Xr reallocf 3 , +and +.Xr free 3 . +.Sh RETURN VALUES +The +.Fn aligned_alloc +function returns a pointer to the allocation if successful; otherwise a +NULL pointer is returned and +.Va errno +is set to an error value. +.Pp +The +.Fn posix_memalign +function returns the value 0 if successful; otherwise it returns an error value. +.Sh ERRORS +The +.Fn aligned_alloc +and +.Fn posix_memalign +functions will fail if: +.Bl -tag -width Er +.It Bq Er EINVAL +The +.Fa alignment +parameter is not a power of 2 at least as large as +.Fn sizeof "void *" . +.It Bq Er ENOMEM +Memory allocation error. +.El +.Sh SEE ALSO +.Xr free 3 , +.Xr malloc 3 , +.Xr realloc 3 , +.Xr reallocf 3 , +.Xr valloc 3 +.Sh STANDARDS +The +.Fn aligned_alloc +function conforms to +.St -isoC-2011 . +.Pp +The +.Fn posix_memalign +function conforms to +.St -p1003.1-2001 . +.Sh HISTORY +The +.Fn posix_memalign +function first appeared in +.Fx 7.0 . +.Pp +The +.Fn aligned_alloc +function first appeared in +.Fx 10.0 . Modified: stable/9/lib/libc/stdlib/malloc.c ============================================================================== --- stable/9/lib/libc/stdlib/malloc.c Thu Nov 22 14:40:26 2012 (r243404) +++ stable/9/lib/libc/stdlib/malloc.c Thu Nov 22 15:19:53 2012 (r243405) @@ -6046,6 +6046,20 @@ RETURN: } void * +aligned_alloc(size_t alignment, size_t size) +{ + void *memptr; + int ret; + + ret = posix_memalign(&memptr, alignment, size); + if (ret != 0) { + errno = ret; + return (NULL); + } + return (memptr); +} + +void * calloc(size_t num, size_t size) { void *ret; From owner-svn-src-stable@FreeBSD.ORG Thu Nov 22 16:20:09 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7302277F; Thu, 22 Nov 2012 16:20:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 58ACC8FC18; Thu, 22 Nov 2012 16:20:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAMGK9Hj018867; Thu, 22 Nov 2012 16:20:09 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAMGK9wW018866; Thu, 22 Nov 2012 16:20:09 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201211221620.qAMGK9wW018866@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 22 Nov 2012 16:20: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: r243408 - stable/9/sys/dev/md X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2012 16:20:09 -0000 Author: kib Date: Thu Nov 22 16:20:08 2012 New Revision: 243408 URL: http://svnweb.freebsd.org/changeset/base/243408 Log: MFC r242744: Zero the newly allocated md(4) swap-backed page to prevent random kernel memory leakage to userspace. Modified: stable/9/sys/dev/md/md.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/md/md.c ============================================================================== --- stable/9/sys/dev/md/md.c Thu Nov 22 16:14:41 2012 (r243407) +++ stable/9/sys/dev/md/md.c Thu Nov 22 16:20:08 2012 (r243408) @@ -677,6 +677,15 @@ mdstart_swap(struct md_s *sc, struct bio sched_unpin(); vm_page_wakeup(m); break; + } else if (rv == VM_PAGER_FAIL) { + /* + * Pager does not have the page. Zero + * the allocated page, and mark it as + * valid. Do not set dirty, the page + * can be recreated if thrown out. + */ + bzero((void *)sf_buf_kva(sf), PAGE_SIZE); + m->valid = VM_PAGE_BITS_ALL; } bcopy((void *)(sf_buf_kva(sf) + offs), p, len); cpu_flush_dcache(p, len); From owner-svn-src-stable@FreeBSD.ORG Thu Nov 22 22:52:16 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3FCB6FF; Thu, 22 Nov 2012 22:52:16 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 21E2F8FC16; Thu, 22 Nov 2012 22:52:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAMMqFBh080181; Thu, 22 Nov 2012 22:52:15 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAMMqFu9080179; Thu, 22 Nov 2012 22:52:15 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <201211222252.qAMMqFu9080179@svn.freebsd.org> From: "Simon L. Nielsen" Date: Thu, 22 Nov 2012 22:52:15 +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: r243417 - releng/7.4 releng/7.4/contrib/bind9/bin/named releng/7.4/contrib/bind9/lib/dns releng/7.4/contrib/bind9/lib/dns/include/dns releng/7.4/sys/compat/linux releng/7.4/sys/conf rel... X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2012 22:52:16 -0000 Author: simon Date: Thu Nov 22 22:52:15 2012 New Revision: 243417 URL: http://svnweb.freebsd.org/changeset/base/243417 Log: Fix multiple Denial of Service vulnerabilities with named(8). Fix insufficient message length validation for EAP-TLS messages. Fix Linux compatibility layer input validation error. Security: FreeBSD-SA-12:06.bind Security: FreeBSD-SA-12:07.hostapd Security: FreeBSD-SA-12:08.linux Security: CVE-2012-4244, CVE-2012-5166, CVE-2012-4445, CVE-2012-4576 Approved by: re Approved by: security-officer Modified: stable/8/contrib/wpa/src/eap_server/eap_tls_common.c stable/8/sys/compat/linux/linux_ioctl.c Changes in other areas also in this revision: Modified: releng/7.4/UPDATING releng/7.4/contrib/bind9/bin/named/query.c releng/7.4/contrib/bind9/lib/dns/include/dns/rdata.h releng/7.4/contrib/bind9/lib/dns/master.c releng/7.4/contrib/bind9/lib/dns/rdata.c releng/7.4/sys/compat/linux/linux_ioctl.c releng/7.4/sys/conf/newvers.sh releng/8.3/UPDATING releng/8.3/contrib/bind9/bin/named/query.c releng/8.3/contrib/bind9/lib/dns/include/dns/rdata.h releng/8.3/contrib/bind9/lib/dns/master.c releng/8.3/contrib/bind9/lib/dns/rdata.c releng/8.3/contrib/wpa/src/eap_server/eap_tls_common.c releng/8.3/sys/compat/linux/linux_ioctl.c releng/8.3/sys/conf/newvers.sh releng/9.0/UPDATING releng/9.0/contrib/bind9/bin/named/query.c releng/9.0/contrib/bind9/lib/dns/include/dns/rdata.h releng/9.0/contrib/bind9/lib/dns/master.c releng/9.0/contrib/bind9/lib/dns/rdata.c releng/9.0/contrib/wpa/src/eap_server/eap_server_tls_common.c releng/9.0/sys/compat/linux/linux_ioctl.c releng/9.0/sys/conf/newvers.sh releng/9.1/contrib/wpa/src/eap_server/eap_server_tls_common.c releng/9.1/sys/compat/linux/linux_ioctl.c stable/9/contrib/wpa/src/eap_server/eap_server_tls_common.c stable/9/sys/compat/linux/linux_ioctl.c Modified: stable/8/contrib/wpa/src/eap_server/eap_tls_common.c ============================================================================== --- stable/8/contrib/wpa/src/eap_server/eap_tls_common.c Thu Nov 22 22:10:10 2012 (r243416) +++ stable/8/contrib/wpa/src/eap_server/eap_tls_common.c Thu Nov 22 22:52:15 2012 (r243417) @@ -220,6 +220,13 @@ static int eap_server_tls_process_fragme " over 64 kB)"); return -1; } + if (len > message_length) { + wpa_printf(MSG_INFO, "SSL: Too much data (%d bytes) in " + "first fragment of frame (TLS Message " + "Length %d bytes)", + (int) len, (int) message_length); + return -1; + } data->in_buf = wpabuf_alloc(message_length); if (data->in_buf == NULL) { Modified: stable/8/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/8/sys/compat/linux/linux_ioctl.c Thu Nov 22 22:10:10 2012 (r243416) +++ stable/8/sys/compat/linux/linux_ioctl.c Thu Nov 22 22:52:15 2012 (r243417) @@ -2253,8 +2253,9 @@ again: ifc.ifc_len = valid_len; sbuf_finish(sb); - memcpy(PTRIN(ifc.ifc_buf), sbuf_data(sb), ifc.ifc_len); - error = copyout(&ifc, uifc, sizeof(ifc)); + error = copyout(sbuf_data(sb), PTRIN(ifc.ifc_buf), ifc.ifc_len); + if (error == 0) + error = copyout(&ifc, uifc, sizeof(ifc)); sbuf_delete(sb); CURVNET_RESTORE(); From owner-svn-src-stable@FreeBSD.ORG Thu Nov 22 22:52:17 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 45226103; Thu, 22 Nov 2012 22:52:17 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 282A38FC19; Thu, 22 Nov 2012 22:52:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAMMqHKM080222; Thu, 22 Nov 2012 22:52:17 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAMMqHTU080220; Thu, 22 Nov 2012 22:52:17 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <201211222252.qAMMqHTU080220@svn.freebsd.org> From: "Simon L. Nielsen" Date: Thu, 22 Nov 2012 22:52:16 +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: r243417 - releng/7.4 releng/7.4/contrib/bind9/bin/named releng/7.4/contrib/bind9/lib/dns releng/7.4/contrib/bind9/lib/dns/include/dns releng/7.4/sys/compat/linux releng/7.4/sys/conf rel... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2012 22:52:17 -0000 Author: simon Date: Thu Nov 22 22:52:15 2012 New Revision: 243417 URL: http://svnweb.freebsd.org/changeset/base/243417 Log: Fix multiple Denial of Service vulnerabilities with named(8). Fix insufficient message length validation for EAP-TLS messages. Fix Linux compatibility layer input validation error. Security: FreeBSD-SA-12:06.bind Security: FreeBSD-SA-12:07.hostapd Security: FreeBSD-SA-12:08.linux Security: CVE-2012-4244, CVE-2012-5166, CVE-2012-4445, CVE-2012-4576 Approved by: re Approved by: security-officer Modified: stable/9/contrib/wpa/src/eap_server/eap_server_tls_common.c stable/9/sys/compat/linux/linux_ioctl.c Changes in other areas also in this revision: Modified: releng/7.4/UPDATING releng/7.4/contrib/bind9/bin/named/query.c releng/7.4/contrib/bind9/lib/dns/include/dns/rdata.h releng/7.4/contrib/bind9/lib/dns/master.c releng/7.4/contrib/bind9/lib/dns/rdata.c releng/7.4/sys/compat/linux/linux_ioctl.c releng/7.4/sys/conf/newvers.sh releng/8.3/UPDATING releng/8.3/contrib/bind9/bin/named/query.c releng/8.3/contrib/bind9/lib/dns/include/dns/rdata.h releng/8.3/contrib/bind9/lib/dns/master.c releng/8.3/contrib/bind9/lib/dns/rdata.c releng/8.3/contrib/wpa/src/eap_server/eap_tls_common.c releng/8.3/sys/compat/linux/linux_ioctl.c releng/8.3/sys/conf/newvers.sh releng/9.0/UPDATING releng/9.0/contrib/bind9/bin/named/query.c releng/9.0/contrib/bind9/lib/dns/include/dns/rdata.h releng/9.0/contrib/bind9/lib/dns/master.c releng/9.0/contrib/bind9/lib/dns/rdata.c releng/9.0/contrib/wpa/src/eap_server/eap_server_tls_common.c releng/9.0/sys/compat/linux/linux_ioctl.c releng/9.0/sys/conf/newvers.sh releng/9.1/contrib/wpa/src/eap_server/eap_server_tls_common.c releng/9.1/sys/compat/linux/linux_ioctl.c stable/8/contrib/wpa/src/eap_server/eap_tls_common.c stable/8/sys/compat/linux/linux_ioctl.c Modified: stable/9/contrib/wpa/src/eap_server/eap_server_tls_common.c ============================================================================== --- stable/9/contrib/wpa/src/eap_server/eap_server_tls_common.c Thu Nov 22 22:10:10 2012 (r243416) +++ stable/9/contrib/wpa/src/eap_server/eap_server_tls_common.c Thu Nov 22 22:52:15 2012 (r243417) @@ -225,6 +225,14 @@ static int eap_server_tls_process_fragme return -1; } + if (len > message_length) { + wpa_printf(MSG_INFO, "SSL: Too much data (%d bytes) in " + "first fragment of frame (TLS Message " + "Length %d bytes)", + (int) len, (int) message_length); + return -1; + } + data->tls_in = wpabuf_alloc(message_length); if (data->tls_in == NULL) { wpa_printf(MSG_DEBUG, "SSL: No memory for message"); Modified: stable/9/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/9/sys/compat/linux/linux_ioctl.c Thu Nov 22 22:10:10 2012 (r243416) +++ stable/9/sys/compat/linux/linux_ioctl.c Thu Nov 22 22:52:15 2012 (r243417) @@ -2260,8 +2260,9 @@ again: ifc.ifc_len = valid_len; sbuf_finish(sb); - memcpy(PTRIN(ifc.ifc_buf), sbuf_data(sb), ifc.ifc_len); - error = copyout(&ifc, uifc, sizeof(ifc)); + error = copyout(sbuf_data(sb), PTRIN(ifc.ifc_buf), ifc.ifc_len); + if (error == 0) + error = copyout(&ifc, uifc, sizeof(ifc)); sbuf_delete(sb); CURVNET_RESTORE(); From owner-svn-src-stable@FreeBSD.ORG Thu Nov 22 23:15:39 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6782586B; Thu, 22 Nov 2012 23:15:39 +0000 (UTC) (envelope-from simon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 47EFA8FC08; Thu, 22 Nov 2012 23:15:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAMNFd3i088463; Thu, 22 Nov 2012 23:15:39 GMT (envelope-from simon@svn.freebsd.org) Received: (from simon@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAMNFdcO088458; Thu, 22 Nov 2012 23:15:39 GMT (envelope-from simon@svn.freebsd.org) Message-Id: <201211222315.qAMNFdcO088458@svn.freebsd.org> From: "Simon L. Nielsen" Date: Thu, 22 Nov 2012 23:15:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r243418 - in stable/7: contrib/bind9/bin/named contrib/bind9/lib/dns contrib/bind9/lib/dns/include/dns sys/compat/linux X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2012 23:15:39 -0000 Author: simon Date: Thu Nov 22 23:15:38 2012 New Revision: 243418 URL: http://svnweb.freebsd.org/changeset/base/243418 Log: Fix multiple Denial of Service vulnerabilities with named(8). Fix insufficient message length validation for EAP-TLS messages. Fix Linux compatibility layer input validation error. This commit includes stable/7 which was missed in r243417. Security: FreeBSD-SA-12:06.bind Security: FreeBSD-SA-12:07.hostapd Security: FreeBSD-SA-12:08.linux Security: CVE-2012-4244, CVE-2012-5166, CVE-2012-4445, CVE-2012-4576 Approved by: re Approved by: security-officer Modified: stable/7/contrib/bind9/bin/named/query.c stable/7/contrib/bind9/lib/dns/include/dns/rdata.h stable/7/contrib/bind9/lib/dns/master.c stable/7/contrib/bind9/lib/dns/rdata.c stable/7/sys/compat/linux/linux_ioctl.c Modified: stable/7/contrib/bind9/bin/named/query.c ============================================================================== --- stable/7/contrib/bind9/bin/named/query.c Thu Nov 22 22:52:15 2012 (r243417) +++ stable/7/contrib/bind9/bin/named/query.c Thu Nov 22 23:15:38 2012 (r243418) @@ -999,13 +999,6 @@ query_isduplicate(ns_client_t *client, d mname = NULL; } - /* - * If the dns_name_t we're looking up is already in the message, - * we don't want to trigger the caller's name replacement logic. - */ - if (name == mname) - mname = NULL; - *mnamep = mname; CTRACE("query_isduplicate: false: done"); @@ -1199,6 +1192,7 @@ query_addadditional(void *arg, dns_name_ if (dns_rdataset_isassociated(rdataset) && !query_isduplicate(client, fname, type, &mname)) { if (mname != NULL) { + INSIST(mname != fname); query_releasename(client, &fname); fname = mname; } else @@ -1259,11 +1253,13 @@ query_addadditional(void *arg, dns_name_ mname = NULL; if (!query_isduplicate(client, fname, dns_rdatatype_a, &mname)) { + if (mname != fname) { if (mname != NULL) { query_releasename(client, &fname); fname = mname; } else need_addname = ISC_TRUE; + } ISC_LIST_APPEND(fname->list, rdataset, link); added_something = ISC_TRUE; if (sigrdataset != NULL && @@ -1302,11 +1298,13 @@ query_addadditional(void *arg, dns_name_ mname = NULL; if (!query_isduplicate(client, fname, dns_rdatatype_aaaa, &mname)) { + if (mname != fname) { if (mname != NULL) { query_releasename(client, &fname); fname = mname; } else need_addname = ISC_TRUE; + } ISC_LIST_APPEND(fname->list, rdataset, link); added_something = ISC_TRUE; if (sigrdataset != NULL && @@ -1817,6 +1815,7 @@ query_addadditional2(void *arg, dns_name crdataset->type == dns_rdatatype_aaaa) { if (!query_isduplicate(client, fname, crdataset->type, &mname)) { + if (mname != fname) { if (mname != NULL) { /* * A different type of this name is @@ -1833,6 +1832,7 @@ query_addadditional2(void *arg, dns_name mname0 = mname; } else need_addname = ISC_TRUE; + } ISC_LIST_UNLINK(cfname.list, crdataset, link); ISC_LIST_APPEND(fname->list, crdataset, link); added_something = ISC_TRUE; Modified: stable/7/contrib/bind9/lib/dns/include/dns/rdata.h ============================================================================== --- stable/7/contrib/bind9/lib/dns/include/dns/rdata.h Thu Nov 22 22:52:15 2012 (r243417) +++ stable/7/contrib/bind9/lib/dns/include/dns/rdata.h Thu Nov 22 23:15:38 2012 (r243418) @@ -127,6 +127,17 @@ struct dns_rdata { #define DNS_RDATA_UPDATE 0x0001 /*%< update pseudo record */ /* + * The maximum length of a RDATA that can be sent on the wire. + * Max packet size (65535) less header (12), less name (1), type (2), + * class (2), ttl(4), length (2). + * + * None of the defined types that support name compression can exceed + * this and all new types are to be sent uncompressed. + */ + +#define DNS_RDATA_MAXLENGTH 65512U + +/* * Flags affecting rdata formatting style. Flags 0xFFFF0000 * are used by masterfile-level formatting and defined elsewhere. * See additional comments at dns_rdata_tofmttext(). Modified: stable/7/contrib/bind9/lib/dns/master.c ============================================================================== --- stable/7/contrib/bind9/lib/dns/master.c Thu Nov 22 22:52:15 2012 (r243417) +++ stable/7/contrib/bind9/lib/dns/master.c Thu Nov 22 23:15:38 2012 (r243418) @@ -75,7 +75,7 @@ /*% * max message size - header - root - type - class - ttl - rdlen */ -#define MINTSIZ (65535 - 12 - 1 - 2 - 2 - 4 - 2) +#define MINTSIZ DNS_RDATA_MAXLENGTH /*% * Size for tokens in the presentation format, * The largest tokens are the base64 blocks in KEY and CERT records, Modified: stable/7/contrib/bind9/lib/dns/rdata.c ============================================================================== --- stable/7/contrib/bind9/lib/dns/rdata.c Thu Nov 22 22:52:15 2012 (r243417) +++ stable/7/contrib/bind9/lib/dns/rdata.c Thu Nov 22 23:15:38 2012 (r243418) @@ -403,6 +403,7 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d isc_buffer_t st; isc_boolean_t use_default = ISC_FALSE; isc_uint32_t activelength; + size_t length; REQUIRE(dctx != NULL); if (rdata != NULL) { @@ -433,6 +434,14 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d } /* + * Reject any rdata that expands out to more than DNS_RDATA_MAXLENGTH + * as we cannot transmit it. + */ + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = DNS_R_FORMERR; + + /* * We should have consumed all of our buffer. */ if (result == ISC_R_SUCCESS && !buffer_empty(source)) @@ -440,8 +449,7 @@ dns_rdata_fromwire(dns_rdata_t *rdata, d if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } @@ -576,6 +584,7 @@ dns_rdata_fromtext(dns_rdata_t *rdata, d unsigned long line; void (*callback)(dns_rdatacallbacks_t *, const char *, ...); isc_result_t tresult; + size_t length; REQUIRE(origin == NULL || dns_name_isabsolute(origin) == ISC_TRUE); if (rdata != NULL) { @@ -648,10 +657,13 @@ dns_rdata_fromtext(dns_rdata_t *rdata, d } } while (1); + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = ISC_R_NOSPACE; + if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } if (result != ISC_R_SUCCESS) { @@ -758,6 +770,7 @@ dns_rdata_fromstruct(dns_rdata_t *rdata, isc_buffer_t st; isc_region_t region; isc_boolean_t use_default = ISC_FALSE; + size_t length; REQUIRE(source != NULL); if (rdata != NULL) { @@ -772,10 +785,13 @@ dns_rdata_fromstruct(dns_rdata_t *rdata, if (use_default) (void)NULL; + length = isc_buffer_usedlength(target) - isc_buffer_usedlength(&st); + if (result == ISC_R_SUCCESS && length > DNS_RDATA_MAXLENGTH) + result = ISC_R_NOSPACE; + if (rdata != NULL && result == ISC_R_SUCCESS) { region.base = isc_buffer_used(&st); - region.length = isc_buffer_usedlength(target) - - isc_buffer_usedlength(&st); + region.length = length; dns_rdata_fromregion(rdata, rdclass, type, ®ion); } if (result != ISC_R_SUCCESS) Modified: stable/7/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/7/sys/compat/linux/linux_ioctl.c Thu Nov 22 22:52:15 2012 (r243417) +++ stable/7/sys/compat/linux/linux_ioctl.c Thu Nov 22 23:15:38 2012 (r243418) @@ -2207,8 +2207,9 @@ again: ifc.ifc_len = valid_len; sbuf_finish(sb); - memcpy(PTRIN(ifc.ifc_buf), sbuf_data(sb), ifc.ifc_len); - error = copyout(&ifc, uifc, sizeof(ifc)); + error = copyout(sbuf_data(sb), PTRIN(ifc.ifc_buf), ifc.ifc_len); + if (error == 0) + error = copyout(&ifc, uifc, sizeof(ifc)); sbuf_delete(sb); return (error); From owner-svn-src-stable@FreeBSD.ORG Fri Nov 23 08:23:53 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B4BEE7F6; Fri, 23 Nov 2012 08:23:53 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8E98D8FC08; Fri, 23 Nov 2012 08:23:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAN8NrKs071523; Fri, 23 Nov 2012 08:23:53 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAN8Nra0071521; Fri, 23 Nov 2012 08:23:53 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201211230823.qAN8Nra0071521@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 23 Nov 2012 08:23:53 +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: r243436 - stable/9/sys/net X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2012 08:23:53 -0000 Author: glebius Date: Fri Nov 23 08:23:53 2012 New Revision: 243436 URL: http://svnweb.freebsd.org/changeset/base/243436 Log: Sync lagg(4) with head, merging r240742, r241619: r240742 | glebius | 2012-09-20 14:05:10 +0400 (чт, 20 сен 2012) | 4 lines Convert lagg(4) to use if_transmit instead of if_start. In collaboration with: thompsa, sbruno, fabient r241619 | emax | 2012-10-17 02:43:14 +0400 (ср, 17 окт 2012) | 5 lines report total number of ports for each lagg(4) interface via net.link.lagg.X.count sysctl Modified: stable/9/sys/net/if_lagg.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/net/if_lagg.c ============================================================================== --- stable/9/sys/net/if_lagg.c Fri Nov 23 08:22:06 2012 (r243435) +++ stable/9/sys/net/if_lagg.c Fri Nov 23 08:23:53 2012 (r243436) @@ -110,7 +110,8 @@ static int lagg_ether_cmdmulti(struct la static int lagg_setflag(struct lagg_port *, int, int, int (*func)(struct ifnet *, int)); static int lagg_setflags(struct lagg_port *, int status); -static void lagg_start(struct ifnet *); +static int lagg_transmit(struct ifnet *, struct mbuf *); +static void lagg_qflush(struct ifnet *); static int lagg_media_change(struct ifnet *); static void lagg_media_status(struct ifnet *, struct ifmediareq *); static struct lagg_port *lagg_link_active(struct lagg_softc *, @@ -284,6 +285,9 @@ lagg_clone_create(struct if_clone *ifc, SYSCTL_ADD_INT(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, "use_flowid", CTLTYPE_INT|CTLFLAG_RW, &sc->use_flowid, sc->use_flowid, "Use flow id for load sharing"); + SYSCTL_ADD_INT(&sc->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, + "count", CTLTYPE_INT|CTLFLAG_RD, &sc->sc_count, sc->sc_count, + "Total number of ports"); /* Hash all layers by default */ sc->sc_flags = LAGG_F_HASHL2|LAGG_F_HASHL3|LAGG_F_HASHL4; @@ -312,15 +316,12 @@ lagg_clone_create(struct if_clone *ifc, if_initname(ifp, ifc->ifc_name, unit); ifp->if_type = IFT_ETHER; ifp->if_softc = sc; - ifp->if_start = lagg_start; + ifp->if_transmit = lagg_transmit; + ifp->if_qflush = lagg_qflush; ifp->if_init = lagg_init; ifp->if_ioctl = lagg_ioctl; ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST; - IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); - ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; - IFQ_SET_READY(&ifp->if_snd); - /* * Attach as an ordinary ethernet device, childs will be attached * as special device IFT_IEEE8023ADLAG. @@ -1222,35 +1223,45 @@ lagg_setflags(struct lagg_port *lp, int return (0); } -static void -lagg_start(struct ifnet *ifp) +static int +lagg_transmit(struct ifnet *ifp, struct mbuf *m) { struct lagg_softc *sc = (struct lagg_softc *)ifp->if_softc; - struct mbuf *m; - int error = 0; + int error, len, mcast; + + len = m->m_pkthdr.len; + mcast = (m->m_flags & (M_MCAST | M_BCAST)) ? 1 : 0; LAGG_RLOCK(sc); /* We need a Tx algorithm and at least one port */ if (sc->sc_proto == LAGG_PROTO_NONE || sc->sc_count == 0) { - IF_DRAIN(&ifp->if_snd); LAGG_RUNLOCK(sc); - return; + m_freem(m); + ifp->if_oerrors++; + return (ENXIO); } - for (;; error = 0) { - IFQ_DEQUEUE(&ifp->if_snd, m); - if (m == NULL) - break; - - ETHER_BPF_MTAP(ifp, m); + ETHER_BPF_MTAP(ifp, m); - error = (*sc->sc_start)(sc, m); - if (error == 0) - ifp->if_opackets++; - else - ifp->if_oerrors++; - } + error = (*sc->sc_start)(sc, m); LAGG_RUNLOCK(sc); + + if (error == 0) { + ifp->if_opackets++; + ifp->if_omcasts += mcast; + ifp->if_obytes += len; + } else + ifp->if_oerrors++; + + return (error); +} + +/* + * The ifp->if_qflush entry point for lagg(4) is no-op. + */ +static void +lagg_qflush(struct ifnet *ifp __unused) +{ } static struct mbuf * From owner-svn-src-stable@FreeBSD.ORG Fri Nov 23 11:19:44 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A7C93B22; Fri, 23 Nov 2012 11:19:44 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 874458FC13; Fri, 23 Nov 2012 11:19:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qANBJigH001779; Fri, 23 Nov 2012 11:19:44 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qANBJi3O001767; Fri, 23 Nov 2012 11:19:44 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201211231119.qANBJi3O001767@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 23 Nov 2012 11:19:44 +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: r243440 - in stable/9/sys: dev/bxe dev/e1000 dev/ixgbe dev/mxge dev/oce dev/vxge net ofed/drivers/net/mlx4 sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2012 11:19:44 -0000 Author: glebius Date: Fri Nov 23 11:19:43 2012 New Revision: 243440 URL: http://svnweb.freebsd.org/changeset/base/243440 Log: Merge r241037 from head: The drbr(9) API appeared to be so unclear, that most drivers in tree used it incorrectly, which lead to inaccurate overrated if_obytes accounting. The drbr(9) used to update ifnet stats on drbr_enqueue(), which is not accurate since enqueuing doesn't imply successful processing by driver. Dequeuing neither mean that. Most drivers also called drbr_stats_update() which did accounting again, leading to doubled if_obytes statistics. And in case of severe transmitting, when a packet could be several times enqueued and dequeued it could have been accounted several times. o Thus, make drbr(9) API thinner. Now drbr(9) merely chooses between ALTQ queueing or buf_ring(9) queueing. - It doesn't touch the buf_ring stats any more. - It doesn't touch ifnet stats anymore. - drbr_stats_update() no longer exists. o buf_ring(9) handles its stats itself: - It handles br_drops itself. - br_prod_bytes stats are dropped. Rationale: no one ever reads them but update of a common counter on every packet negatively affects performance due to excessive cache invalidation. - buf_ring_enqueue_bytes() reduced to buf_ring_enqueue(), since we no longer account bytes. o Drivers handle their stats theirselves: if_obytes, if_omcasts. o mlx4(4), igb(4), em(4), vxge(4), oce(4) and ixv(4) no longer use drbr_stats_update(), and update ifnet stats theirselves. o bxe(4) was the most correct driver, it didn't call drbr_stats_update(), thus it was the only driver accurate under moderate load. Now it also maintains stats itself. o ixgbe(4) had already taken stats from hardware, so just - drop software stats updating. - take multicast packet count from hardware as well. o mxge(4) just no longer needs NO_SLOW_STATS define. o cxgb(4), cxgbe(4) need no change, since they obtain stats from hardware. Reviewed by: jfv, gnn Modified: stable/9/sys/dev/bxe/if_bxe.c stable/9/sys/dev/e1000/if_em.c stable/9/sys/dev/e1000/if_igb.c stable/9/sys/dev/ixgbe/ixgbe.c stable/9/sys/dev/ixgbe/ixv.c stable/9/sys/dev/mxge/if_mxge.c stable/9/sys/dev/oce/oce_if.c stable/9/sys/dev/vxge/vxge.c stable/9/sys/net/if_var.h stable/9/sys/ofed/drivers/net/mlx4/en_tx.c stable/9/sys/sys/buf_ring.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) Modified: stable/9/sys/dev/bxe/if_bxe.c ============================================================================== --- stable/9/sys/dev/bxe/if_bxe.c Fri Nov 23 10:14:54 2012 (r243439) +++ stable/9/sys/dev/bxe/if_bxe.c Fri Nov 23 11:19:43 2012 (r243440) @@ -9552,6 +9552,11 @@ bxe_tx_mq_start_locked(struct ifnet *ifp /* The transmit frame was enqueued successfully. */ tx_count++; + /* Update stats */ + ifp->if_obytes += next->m_pkthdr.len; + if (next->m_flags & M_MCAST) + ifp->if_omcasts++; + /* Send a copy of the frame to any BPF listeners. */ BPF_MTAP(ifp, next); Modified: stable/9/sys/dev/e1000/if_em.c ============================================================================== --- stable/9/sys/dev/e1000/if_em.c Fri Nov 23 10:14:54 2012 (r243439) +++ stable/9/sys/dev/e1000/if_em.c Fri Nov 23 11:19:43 2012 (r243440) @@ -922,7 +922,9 @@ em_mq_start_locked(struct ifnet *ifp, st break; } enq++; - drbr_stats_update(ifp, next->m_pkthdr.len, next->m_flags); + ifp->if_obytes += next->m_pkthdr.len; + if (next->m_flags & M_MCAST) + ifp->if_omcasts++; ETHER_BPF_MTAP(ifp, next); if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) break; Modified: stable/9/sys/dev/e1000/if_igb.c ============================================================================== --- stable/9/sys/dev/e1000/if_igb.c Fri Nov 23 10:14:54 2012 (r243439) +++ stable/9/sys/dev/e1000/if_igb.c Fri Nov 23 11:19:43 2012 (r243440) @@ -1006,7 +1006,9 @@ igb_mq_start_locked(struct ifnet *ifp, s break; } enq++; - drbr_stats_update(ifp, next->m_pkthdr.len, next->m_flags); + ifp->if_obytes += next->m_pkthdr.len; + if (next->m_flags & M_MCAST) + ifp->if_omcasts++; ETHER_BPF_MTAP(ifp, next); if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) break; Modified: stable/9/sys/dev/ixgbe/ixgbe.c ============================================================================== --- stable/9/sys/dev/ixgbe/ixgbe.c Fri Nov 23 10:14:54 2012 (r243439) +++ stable/9/sys/dev/ixgbe/ixgbe.c Fri Nov 23 11:19:43 2012 (r243440) @@ -841,7 +841,6 @@ ixgbe_mq_start_locked(struct ifnet *ifp, break; } enqueued++; - drbr_stats_update(ifp, next->m_pkthdr.len, next->m_flags); /* Send a copy of the frame to the BPF listener */ ETHER_BPF_MTAP(ifp, next); if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) @@ -5258,6 +5257,7 @@ ixgbe_update_stats_counters(struct adapt ifp->if_ibytes = adapter->stats.gorc; ifp->if_obytes = adapter->stats.gotc; ifp->if_imcasts = adapter->stats.mprc; + ifp->if_omcasts = adapter->stats.mptc; ifp->if_collisions = 0; /* Rx Errors */ Modified: stable/9/sys/dev/ixgbe/ixv.c ============================================================================== --- stable/9/sys/dev/ixgbe/ixv.c Fri Nov 23 10:14:54 2012 (r243439) +++ stable/9/sys/dev/ixgbe/ixv.c Fri Nov 23 11:19:43 2012 (r243440) @@ -636,7 +636,9 @@ ixv_mq_start_locked(struct ifnet *ifp, s break; } enqueued++; - drbr_stats_update(ifp, next->m_pkthdr.len, next->m_flags); + ifp->if_obytes += next->m_pkthdr.len; + if (next->m_flags & M_MCAST) + ifp->if_omcasts++; /* Send a copy of the frame to the BPF listener */ ETHER_BPF_MTAP(ifp, next); if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) Modified: stable/9/sys/dev/mxge/if_mxge.c ============================================================================== --- stable/9/sys/dev/mxge/if_mxge.c Fri Nov 23 10:14:54 2012 (r243439) +++ stable/9/sys/dev/mxge/if_mxge.c Fri Nov 23 11:19:43 2012 (r243440) @@ -47,8 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include -/* count xmits ourselves, rather than via drbr */ -#define NO_SLOW_STATS #include #include #include Modified: stable/9/sys/dev/oce/oce_if.c ============================================================================== --- stable/9/sys/dev/oce/oce_if.c Fri Nov 23 10:14:54 2012 (r243439) +++ stable/9/sys/dev/oce/oce_if.c Fri Nov 23 11:19:43 2012 (r243440) @@ -1222,7 +1222,9 @@ oce_multiq_transmit(struct ifnet *ifp, s } break; } - drbr_stats_update(ifp, next->m_pkthdr.len, next->m_flags); + ifp->if_obytes += next->m_pkthdr.len; + if (next->m_flags & M_MCAST) + ifp->if_omcasts++; ETHER_BPF_MTAP(ifp, next); next = drbr_dequeue(ifp, br); } Modified: stable/9/sys/dev/vxge/vxge.c ============================================================================== --- stable/9/sys/dev/vxge/vxge.c Fri Nov 23 10:14:54 2012 (r243439) +++ stable/9/sys/dev/vxge/vxge.c Fri Nov 23 11:19:43 2012 (r243440) @@ -709,7 +709,9 @@ vxge_mq_send_locked(ifnet_t ifp, vxge_vp VXGE_DRV_STATS(vpath, tx_again); break; } - drbr_stats_update(ifp, next->m_pkthdr.len, next->m_flags); + ifp->if_obytes += next->m_pkthdr.len; + if (next->m_flags & M_MCAST) + ifp->if_omcasts++; /* Send a copy of the frame to the BPF listener */ ETHER_BPF_MTAP(ifp, next); Modified: stable/9/sys/net/if_var.h ============================================================================== --- stable/9/sys/net/if_var.h Fri Nov 23 10:14:54 2012 (r243439) +++ stable/9/sys/net/if_var.h Fri Nov 23 11:19:43 2012 (r243440) @@ -589,22 +589,10 @@ do { \ } while (0) #ifdef _KERNEL -static __inline void -drbr_stats_update(struct ifnet *ifp, int len, int mflags) -{ -#ifndef NO_SLOW_STATS - ifp->if_obytes += len; - if (mflags & M_MCAST) - ifp->if_omcasts++; -#endif -} - static __inline int drbr_enqueue(struct ifnet *ifp, struct buf_ring *br, struct mbuf *m) { int error = 0; - int len = m->m_pkthdr.len; - int mflags = m->m_flags; #ifdef ALTQ if (ALTQ_IS_ENABLED(&ifp->if_snd)) { @@ -612,12 +600,10 @@ drbr_enqueue(struct ifnet *ifp, struct b return (error); } #endif - if ((error = buf_ring_enqueue_bytes(br, m, len)) == ENOBUFS) { - br->br_drops++; + error = buf_ring_enqueue(br, m); + if (error) m_freem(m); - } else - drbr_stats_update(ifp, len, mflags); - + return (error); } Modified: stable/9/sys/ofed/drivers/net/mlx4/en_tx.c ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/en_tx.c Fri Nov 23 10:14:54 2012 (r243439) +++ stable/9/sys/ofed/drivers/net/mlx4/en_tx.c Fri Nov 23 11:19:43 2012 (r243440) @@ -948,7 +948,9 @@ mlx4_en_transmit_locked(struct ifnet *de break; } enqueued++; - drbr_stats_update(dev, next->m_pkthdr.len, next->m_flags); + dev->if_obytes += next->m_pkthdr.len; + if (next->m_flags & M_MCAST) + dev->if_omcasts++; /* Send a copy of the frame to the BPF listener */ ETHER_BPF_MTAP(dev, next); if ((dev->if_drv_flags & IFF_DRV_RUNNING) == 0) Modified: stable/9/sys/sys/buf_ring.h ============================================================================== --- stable/9/sys/sys/buf_ring.h Fri Nov 23 10:14:54 2012 (r243439) +++ stable/9/sys/sys/buf_ring.h Fri Nov 23 11:19:43 2012 (r243440) @@ -48,7 +48,6 @@ struct buf_ring { int br_prod_mask; uint64_t br_drops; uint64_t br_prod_bufs; - uint64_t br_prod_bytes; /* * Pad out to next L2 cache line */ @@ -74,7 +73,7 @@ struct buf_ring { * */ static __inline int -buf_ring_enqueue_bytes(struct buf_ring *br, void *buf, int nbytes) +buf_ring_enqueue(struct buf_ring *br, void *buf) { uint32_t prod_head, prod_next; uint32_t cons_tail; @@ -95,6 +94,7 @@ buf_ring_enqueue_bytes(struct buf_ring * prod_next = (prod_head + 1) & br->br_prod_mask; if (prod_next == cons_tail) { + br->br_drops++; critical_exit(); return (ENOBUFS); } @@ -117,19 +117,11 @@ buf_ring_enqueue_bytes(struct buf_ring * while (br->br_prod_tail != prod_head) cpu_spinwait(); br->br_prod_bufs++; - br->br_prod_bytes += nbytes; br->br_prod_tail = prod_next; critical_exit(); return (0); } -static __inline int -buf_ring_enqueue(struct buf_ring *br, void *buf) -{ - - return (buf_ring_enqueue_bytes(br, buf, 0)); -} - /* * multi-consumer safe dequeue * From owner-svn-src-stable@FreeBSD.ORG Fri Nov 23 11:23:16 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ED14CE23; Fri, 23 Nov 2012 11:23:15 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D09418FC0C; Fri, 23 Nov 2012 11:23:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qANBNFq9002505; Fri, 23 Nov 2012 11:23:15 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qANBNFZJ002504; Fri, 23 Nov 2012 11:23:15 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201211231123.qANBNFZJ002504@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 23 Nov 2012 11:23:15 +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: r243442 - stable/9/sys/dev/drm2 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2012 11:23:16 -0000 Author: glebius Date: Fri Nov 23 11:23:15 2012 New Revision: 243442 URL: http://svnweb.freebsd.org/changeset/base/243442 Log: Merge r242467 from head: - If DRM_DEBUG_DEFAULT_ON is defined, then initialize drm_debug_flagi to all supported debugging bits. - If DRM_DEBUG_DEFAULT_ON isn't defined, then initialize drm_debug_flag to zero. DRM_DEBUG_DEFAULT_ON is defined when module is build with -DDEBUG_DRM or if kernel config has 'options DEBUG_DRM'. Reviewed by: kib Modified: stable/9/sys/dev/drm2/drm_drv.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/drm2/drm_drv.c ============================================================================== --- stable/9/sys/dev/drm2/drm_drv.c Fri Nov 23 11:21:58 2012 (r243441) +++ stable/9/sys/dev/drm2/drm_drv.c Fri Nov 23 11:23:15 2012 (r243442) @@ -44,9 +44,10 @@ __FBSDID("$FreeBSD$"); #include #ifdef DRM_DEBUG_DEFAULT_ON -int drm_debug_flag = 1; +int drm_debug_flag = (DRM_DEBUGBITS_DEBUG | DRM_DEBUGBITS_KMS | + DRM_DEBUGBITS_FAILED_IOCTL); #else -int drm_debug_flag = 2; +int drm_debug_flag = 0; #endif int drm_notyet_flag = 0; From owner-svn-src-stable@FreeBSD.ORG Fri Nov 23 13:04:39 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 09812DCB; Fri, 23 Nov 2012 13:04:39 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E355C8FC0C; Fri, 23 Nov 2012 13:04:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAND4cCs017761; Fri, 23 Nov 2012 13:04:38 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAND4c5X017760; Fri, 23 Nov 2012 13:04:38 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201211231304.qAND4c5X017760@svn.freebsd.org> From: Takahashi Yoshihiro Date: Fri, 23 Nov 2012 13:04: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: r243444 - stable/9/sys/boot/pc98/libpc98 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2012 13:04:39 -0000 Author: nyan Date: Fri Nov 23 13:04:38 2012 New Revision: 243444 URL: http://svnweb.freebsd.org/changeset/base/243444 Log: MFC: r242864 i386 comconsole: don't loop forever if hardware doesn't respond. Modified: stable/9/sys/boot/pc98/libpc98/comconsole.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/pc98/libpc98/comconsole.c ============================================================================== --- stable/9/sys/boot/pc98/libpc98/comconsole.c Fri Nov 23 12:12:06 2012 (r243443) +++ stable/9/sys/boot/pc98/libpc98/comconsole.c Fri Nov 23 13:04:38 2012 (r243444) @@ -63,7 +63,6 @@ static void comc_setup(int speed, int po static int comc_speed_set(struct env_var *ev, int flags, const void *value); -static int comc_started; static int comc_curspeed; static int comc_port = COMPORT; static uint32_t comc_locator; @@ -87,9 +86,6 @@ comc_probe(struct console *cp) int speed, port; uint32_t locator; - /* XXX check the BIOS equipment list? */ - cp->c_flags |= (C_PRESENTIN | C_PRESENTOUT); - if (comc_curspeed == 0) { comc_curspeed = COMSPEED; /* @@ -137,18 +133,19 @@ comc_probe(struct console *cp) env_setenv("comconsole_pcidev", EV_VOLATILE, env, comc_pcidev_set, env_nounset); } + comc_setup(comc_curspeed, comc_port); } static int comc_init(int arg) { - if (comc_started && arg == 0) - return 0; - comc_started = 1; comc_setup(comc_curspeed, comc_port); - return(0); + if ((comconsole.c_flags & (C_PRESENTIN | C_PRESENTOUT)) == + (C_PRESENTIN | C_PRESENTOUT)) + return (CMD_OK); + return (CMD_ERROR); } static void @@ -166,13 +163,13 @@ comc_putchar(int c) static int comc_getchar(void) { - return(comc_ischar() ? inb(comc_port + com_data) : -1); + return (comc_ischar() ? inb(comc_port + com_data) : -1); } static int comc_ischar(void) { - return(inb(comc_port + com_lsr) & LSR_RXRDY); + return (inb(comc_port + com_lsr) & LSR_RXRDY); } static int @@ -185,7 +182,8 @@ comc_speed_set(struct env_var *ev, int f return (CMD_ERROR); } - if (comc_started && comc_curspeed != speed) + if ((comconsole.c_flags & (C_ACTIVEIN | C_ACTIVEOUT)) != 0 && + comc_curspeed != speed) comc_setup(speed, comc_port); env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); @@ -203,7 +201,8 @@ comc_port_set(struct env_var *ev, int fl return (CMD_ERROR); } - if (comc_started && comc_port != port) { + if ((comconsole.c_flags & (C_ACTIVEIN | C_ACTIVEOUT)) != 0 && + comc_port != port) { comc_setup(comc_curspeed, port); set_hw_console_hint(); } @@ -305,7 +304,8 @@ comc_pcidev_set(struct env_var *ev, int printf("Invalid pcidev\n"); return (CMD_ERROR); } - if (comc_started && comc_locator != locator) { + if ((comconsole.c_flags & (C_ACTIVEIN | C_ACTIVEOUT)) != 0 && + comc_locator != locator) { error = comc_pcidev_handle(locator); if (error != CMD_OK) return (error); @@ -317,6 +317,8 @@ comc_pcidev_set(struct env_var *ev, int static void comc_setup(int speed, int port) { + static int TRY_COUNT = 1000000; + int tries; comc_curspeed = speed; comc_port = port; @@ -327,9 +329,15 @@ comc_setup(int speed, int port) outb(comc_port + com_cfcr, COMC_FMT); outb(comc_port + com_mcr, MCR_RTS | MCR_DTR); + tries = 0; do inb(comc_port + com_data); - while (inb(comc_port + com_lsr) & LSR_RXRDY); + while (inb(comc_port + com_lsr) & LSR_RXRDY && ++tries < TRY_COUNT); + + if (tries < TRY_COUNT) + comconsole.c_flags |= (C_PRESENTIN | C_PRESENTOUT); + else + comconsole.c_flags &= ~(C_PRESENTIN | C_PRESENTOUT); } static int From owner-svn-src-stable@FreeBSD.ORG Fri Nov 23 13:09:20 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D6CB6FFB; Fri, 23 Nov 2012 13:09:20 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A176D8FC12; Fri, 23 Nov 2012 13:09:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAND9KDA018636; Fri, 23 Nov 2012 13:09:20 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAND9K9t018633; Fri, 23 Nov 2012 13:09:20 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201211231309.qAND9K9t018633@svn.freebsd.org> From: Takahashi Yoshihiro Date: Fri, 23 Nov 2012 13:09:20 +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: r243445 - in stable/9/sys/boot/pc98: boot2 btx/btx X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2012 13:09:21 -0000 Author: nyan Date: Fri Nov 23 13:09:20 2012 New Revision: 243445 URL: http://svnweb.freebsd.org/changeset/base/243445 Log: MFC: r242863 add detection of serial console presence to btx and boot2-like blocks. Modified: stable/9/sys/boot/pc98/boot2/boot2.c stable/9/sys/boot/pc98/btx/btx/btx.S Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/9/sys/boot/pc98/boot2/boot2.c Fri Nov 23 13:04:38 2012 (r243444) +++ stable/9/sys/boot/pc98/boot2/boot2.c Fri Nov 23 13:09:20 2012 (r243445) @@ -555,8 +555,10 @@ parse() } ioctrl = OPT_CHECK(RBX_DUAL) ? (IO_SERIAL|IO_KEYBOARD) : OPT_CHECK(RBX_SERIAL) ? IO_SERIAL : IO_KEYBOARD; - if (ioctrl & IO_SERIAL) - sio_init(115200 / comspeed); + if (ioctrl & IO_SERIAL) { + if (sio_init(115200 / comspeed) != 0) + ioctrl &= ~IO_SERIAL; + } } else { for (q = arg--; *q && *q != '('; q++); if (*q) { Modified: stable/9/sys/boot/pc98/btx/btx/btx.S ============================================================================== --- stable/9/sys/boot/pc98/btx/btx/btx.S Fri Nov 23 13:04:38 2012 (r243444) +++ stable/9/sys/boot/pc98/btx/btx/btx.S Fri Nov 23 13:09:20 2012 (r243445) @@ -840,7 +840,7 @@ putstr: lodsb # Load char .set SIO_DIV,(115200/SIOSPD) # 115200 / SPD /* - * void sio_init(void) + * int sio_init(void) */ sio_init: movw $SIO_PRT+0x3,%dx # Data format reg movb $SIO_FMT|0x80,%al # Set format @@ -856,14 +856,19 @@ sio_init: movw $SIO_PRT+0x3,%dx # Data movb $0x3,%al # Set RTS, outb %al,(%dx) # DTR incl %edx # Line status reg + call sio_getc.1 # Get character /* - * void sio_flush(void) + * int sio_flush(void) */ -sio_flush.0: call sio_getc.1 # Get character -sio_flush: call sio_ischar # Check for character - jnz sio_flush.0 # Till none - ret # To caller +sio_flush: xorl %eax,%eax # Return value + xorl %ecx,%ecx # Timeout + movb $0x80,%ch # counter +sio_flush.1: call sio_ischar # Check for character + jz sio_flush.2 # Till none + loop sio_flush.1 # or counter is zero + movb $1, %al # Exhausted all tries +sio_flush.2: ret # To caller /* * void sio_putc(int c) From owner-svn-src-stable@FreeBSD.ORG Fri Nov 23 13:17:18 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9740D30A; Fri, 23 Nov 2012 13:17:18 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7C06A8FC12; Fri, 23 Nov 2012 13:17:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qANDHIIC020061; Fri, 23 Nov 2012 13:17:18 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qANDHIH1020060; Fri, 23 Nov 2012 13:17:18 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201211231317.qANDHIH1020060@svn.freebsd.org> From: Takahashi Yoshihiro Date: Fri, 23 Nov 2012 13:17:18 +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: r243446 - stable/9/sys/boot/pc98 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2012 13:17:18 -0000 Author: nyan Date: Fri Nov 23 13:17:18 2012 New Revision: 243446 URL: http://svnweb.freebsd.org/changeset/base/243446 Log: MFC: r242855, r242865 - use -march=i386 for both i386 and amd64 builds. - cosmetic changes to reduce diffs against i386. Modified: stable/9/sys/boot/pc98/Makefile.inc Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/pc98/Makefile.inc ============================================================================== --- stable/9/sys/boot/pc98/Makefile.inc Fri Nov 23 13:09:20 2012 (r243445) +++ stable/9/sys/boot/pc98/Makefile.inc Fri Nov 23 13:17:18 2012 (r243446) @@ -5,9 +5,9 @@ BINDIR?= /boot LOADER_ADDRESS?=0x200000 -CFLAGS+= -ffreestanding -mpreferred-stack-boundary=2 \ - -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float \ - -Os -DPC98 +CFLAGS+= -march=i386 -ffreestanding -mpreferred-stack-boundary=2 \ + -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float +CFLAGS+= -Os -DPC98 LDFLAGS+= -nostdlib # BTX components From owner-svn-src-stable@FreeBSD.ORG Fri Nov 23 13:18:26 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CA340587; Fri, 23 Nov 2012 13:18:26 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AF4C88FC14; Fri, 23 Nov 2012 13:18:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qANDIQFU020244; Fri, 23 Nov 2012 13:18:26 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qANDIQw6020243; Fri, 23 Nov 2012 13:18:26 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201211231318.qANDIQw6020243@svn.freebsd.org> From: Takahashi Yoshihiro Date: Fri, 23 Nov 2012 13:18: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: r243447 - stable/8/sys/boot/pc98 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2012 13:18:26 -0000 Author: nyan Date: Fri Nov 23 13:18:26 2012 New Revision: 243447 URL: http://svnweb.freebsd.org/changeset/base/243447 Log: MFC: r242855, r242865 - use -march=i386 for both i386 and amd64 builds. - cosmetic changes to reduce diffs against i386. Modified: stable/8/sys/boot/pc98/Makefile.inc Directory Properties: stable/8/sys/ (props changed) stable/8/sys/boot/ (props changed) Modified: stable/8/sys/boot/pc98/Makefile.inc ============================================================================== --- stable/8/sys/boot/pc98/Makefile.inc Fri Nov 23 13:17:18 2012 (r243446) +++ stable/8/sys/boot/pc98/Makefile.inc Fri Nov 23 13:18:26 2012 (r243447) @@ -5,9 +5,9 @@ BINDIR?= /boot LOADER_ADDRESS?=0x200000 -CFLAGS+= -ffreestanding -mpreferred-stack-boundary=2 \ - -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \ - -Os -DPC98 +CFLAGS+= -march=i386 -ffreestanding -mpreferred-stack-boundary=2 \ + -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 +CFLAGS+= -Os -DPC98 LDFLAGS+= -nostdlib # BTX components From owner-svn-src-stable@FreeBSD.ORG Fri Nov 23 13:35:18 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EBFB08C1; Fri, 23 Nov 2012 13:35:18 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CC50E8FC12; Fri, 23 Nov 2012 13:35:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qANDZId9022951; Fri, 23 Nov 2012 13:35:18 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qANDZIL1022945; Fri, 23 Nov 2012 13:35:18 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201211231335.qANDZIL1022945@svn.freebsd.org> From: Takahashi Yoshihiro Date: Fri, 23 Nov 2012 13:35:18 +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: r243448 - in stable/9/sys/boot/pc98: boot2 btx/btxldr btx/lib cdboot libpc98 loader X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2012 13:35:19 -0000 Author: nyan Date: Fri Nov 23 13:35:17 2012 New Revision: 243448 URL: http://svnweb.freebsd.org/changeset/base/243448 Log: MFC: r239063, r239064, r239069, r240852, r240854 - boot2: bunch of variables are turned into uint8_t. - boot2: Remove unnecessary initializations. - loader: replace ugly inb/outb re-implementations with cpufunc.h. - Reduce diffs against i386. Modified: stable/9/sys/boot/pc98/boot2/boot2.c stable/9/sys/boot/pc98/btx/btxldr/btxldr.S stable/9/sys/boot/pc98/btx/lib/btxcsu.S stable/9/sys/boot/pc98/cdboot/cdboot.S stable/9/sys/boot/pc98/libpc98/Makefile stable/9/sys/boot/pc98/loader/main.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/9/sys/boot/pc98/boot2/boot2.c Fri Nov 23 13:18:26 2012 (r243447) +++ stable/9/sys/boot/pc98/boot2/boot2.c Fri Nov 23 13:35:17 2012 (r243448) @@ -126,13 +126,13 @@ static struct dsk { unsigned unit; unsigned head; unsigned sec; - unsigned slice; - unsigned part; + uint8_t slice; + uint8_t part; unsigned start; } dsk; static char cmd[512], cmddup[512], knamebuf[1024]; -static const char *kname = NULL; -static uint32_t opts = 0; +static const char *kname; +static uint32_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; static uint8_t ioctrl = IO_KEYBOARD; @@ -618,7 +618,8 @@ dskread(void *buf, unsigned lba, unsigne struct pc98_partition *dp; struct disklabel *d; char *sec; - unsigned sl, i; + unsigned i; + uint8_t sl; u_char *p; if (!dsk_meta) { Modified: stable/9/sys/boot/pc98/btx/btxldr/btxldr.S ============================================================================== --- stable/9/sys/boot/pc98/btx/btxldr/btxldr.S Fri Nov 23 13:18:26 2012 (r243447) +++ stable/9/sys/boot/pc98/btx/btxldr/btxldr.S Fri Nov 23 13:35:17 2012 (r243448) @@ -15,13 +15,13 @@ * $FreeBSD$ */ +#include + /* * Prototype BTX loader program, written in a couple of hours. The * real thing should probably be more flexible, and in C. */ -#include - /* * Memory locations. */ Modified: stable/9/sys/boot/pc98/btx/lib/btxcsu.S ============================================================================== --- stable/9/sys/boot/pc98/btx/lib/btxcsu.S Fri Nov 23 13:18:26 2012 (r243447) +++ stable/9/sys/boot/pc98/btx/lib/btxcsu.S Fri Nov 23 13:35:17 2012 (r243448) @@ -15,12 +15,12 @@ # $FreeBSD$ +#include + # # BTX C startup code (ELF). # -#include - # # Globals. # Modified: stable/9/sys/boot/pc98/cdboot/cdboot.S ============================================================================== --- stable/9/sys/boot/pc98/cdboot/cdboot.S Fri Nov 23 13:18:26 2012 (r243447) +++ stable/9/sys/boot/pc98/cdboot/cdboot.S Fri Nov 23 13:35:17 2012 (r243448) @@ -30,14 +30,14 @@ # $FreeBSD$ -#include - # # Basically, we first create a set of boot arguments to pass to the loaded # binary. Then we attempt to load /boot/loader from the CD we were booted # off of. # +#include + # # Memory locations. # Modified: stable/9/sys/boot/pc98/libpc98/Makefile ============================================================================== --- stable/9/sys/boot/pc98/libpc98/Makefile Fri Nov 23 13:18:26 2012 (r243447) +++ stable/9/sys/boot/pc98/libpc98/Makefile Fri Nov 23 13:35:17 2012 (r243448) @@ -37,7 +37,8 @@ CFLAGS+= -DTERM_EMU # XXX: make alloca() useable CFLAGS+= -Dalloca=__builtin_alloca -CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../btx/lib \ +CFLAGS+= -I${.CURDIR}/../../common \ + -I${.CURDIR}/../btx/lib \ -I${.CURDIR}/../../i386/libi386 \ -I${.CURDIR}/../../.. -I. # the location of libstand Modified: stable/9/sys/boot/pc98/loader/main.c ============================================================================== --- stable/9/sys/boot/pc98/loader/main.c Fri Nov 23 13:18:26 2012 (r243447) +++ stable/9/sys/boot/pc98/loader/main.c Fri Nov 23 13:35:17 2012 (r243448) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -207,9 +208,9 @@ main(void) static void extract_currdev(void) { - struct i386_devdesc new_currdev; - int major; - int biosdev = -1; + struct i386_devdesc new_currdev; + int major; + int biosdev = -1; /* Assume we are booting from a BIOS disk by default */ new_currdev.d_dev = &biosdisk; @@ -255,7 +256,7 @@ extract_currdev(void) } } new_currdev.d_type = new_currdev.d_dev->dv_type; - + /* * If we are booting off of a BIOS disk and we didn't succeed in determining * which one we booted off of, just use disk0: as a reasonable default. @@ -266,6 +267,7 @@ extract_currdev(void) "Guessed BIOS device 0x%x not found by probes, defaulting to disk0:\n", biosdev); new_currdev.d_unit = 0; } + env_setenv("currdev", EV_VOLATILE, i386_fmtdev(&new_currdev), i386_setcurrdev, env_nounset); env_setenv("loaddev", EV_VOLATILE, i386_fmtdev(&new_currdev), env_noset, @@ -306,33 +308,17 @@ command_heap(int argc, char *argv[]) return(CMD_OK); } -/* ISA bus access functions for PnP, derived from */ -static int +/* ISA bus access functions for PnP. */ +static int isa_inb(int port) { - u_char data; - - if (__builtin_constant_p(port) && - (((port) & 0xffff) < 0x100) && - ((port) < 0x10000)) { - __asm __volatile("inb %1,%0" : "=a" (data) : "id" ((u_short)(port))); - } else { - __asm __volatile("inb %%dx,%0" : "=a" (data) : "d" (port)); - } - return(data); + + return (inb(port)); } static void isa_outb(int port, int value) { - u_char al = value; - - if (__builtin_constant_p(port) && - (((port) & 0xffff) < 0x100) && - ((port) < 0x10000)) { - __asm __volatile("outb %0,%1" : : "a" (al), "id" ((u_short)(port))); - } else { - __asm __volatile("outb %0,%%dx" : : "a" (al), "d" (port)); - } -} + outb(port, value); +} From owner-svn-src-stable@FreeBSD.ORG Fri Nov 23 13:36:09 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D5823A44; Fri, 23 Nov 2012 13:36:09 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BA3B38FC13; Fri, 23 Nov 2012 13:36:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qANDa9r1023138; Fri, 23 Nov 2012 13:36:09 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qANDa9kI023132; Fri, 23 Nov 2012 13:36:09 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201211231336.qANDa9kI023132@svn.freebsd.org> From: Takahashi Yoshihiro Date: Fri, 23 Nov 2012 13:36:09 +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: r243449 - in stable/8/sys/boot/pc98: boot2 btx/btxldr btx/lib cdboot libpc98 loader X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2012 13:36:10 -0000 Author: nyan Date: Fri Nov 23 13:36:09 2012 New Revision: 243449 URL: http://svnweb.freebsd.org/changeset/base/243449 Log: MFC: r239063, r239064, r239069, r240852, r240854 - boot2: bunch of variables are turned into uint8_t. - boot2: Remove unnecessary initializations. - loader: replace ugly inb/outb re-implementations with cpufunc.h. - Reduce diffs against i386. Modified: stable/8/sys/boot/pc98/boot2/boot2.c stable/8/sys/boot/pc98/btx/btxldr/btxldr.S stable/8/sys/boot/pc98/btx/lib/btxcsu.S stable/8/sys/boot/pc98/cdboot/cdboot.S stable/8/sys/boot/pc98/libpc98/Makefile stable/8/sys/boot/pc98/loader/main.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/boot/ (props changed) Modified: stable/8/sys/boot/pc98/boot2/boot2.c ============================================================================== --- stable/8/sys/boot/pc98/boot2/boot2.c Fri Nov 23 13:35:17 2012 (r243448) +++ stable/8/sys/boot/pc98/boot2/boot2.c Fri Nov 23 13:36:09 2012 (r243449) @@ -126,13 +126,13 @@ static struct dsk { unsigned unit; unsigned head; unsigned sec; - unsigned slice; - unsigned part; + uint8_t slice; + uint8_t part; unsigned start; } dsk; static char cmd[512], cmddup[512], knamebuf[1024]; -static const char *kname = NULL; -static uint32_t opts = 0; +static const char *kname; +static uint32_t opts; static int comspeed = SIOSPD; static struct bootinfo bootinfo; static uint8_t ioctrl = IO_KEYBOARD; @@ -616,7 +616,8 @@ dskread(void *buf, unsigned lba, unsigne struct pc98_partition *dp; struct disklabel *d; char *sec; - unsigned sl, i; + unsigned i; + uint8_t sl; u_char *p; if (!dsk_meta) { Modified: stable/8/sys/boot/pc98/btx/btxldr/btxldr.S ============================================================================== --- stable/8/sys/boot/pc98/btx/btxldr/btxldr.S Fri Nov 23 13:35:17 2012 (r243448) +++ stable/8/sys/boot/pc98/btx/btxldr/btxldr.S Fri Nov 23 13:36:09 2012 (r243449) @@ -15,13 +15,13 @@ * $FreeBSD$ */ +#include + /* * Prototype BTX loader program, written in a couple of hours. The * real thing should probably be more flexible, and in C. */ -#include - /* * Memory locations. */ Modified: stable/8/sys/boot/pc98/btx/lib/btxcsu.S ============================================================================== --- stable/8/sys/boot/pc98/btx/lib/btxcsu.S Fri Nov 23 13:35:17 2012 (r243448) +++ stable/8/sys/boot/pc98/btx/lib/btxcsu.S Fri Nov 23 13:36:09 2012 (r243449) @@ -15,12 +15,12 @@ # $FreeBSD$ +#include + # # BTX C startup code (ELF). # -#include - # # Globals. # Modified: stable/8/sys/boot/pc98/cdboot/cdboot.S ============================================================================== --- stable/8/sys/boot/pc98/cdboot/cdboot.S Fri Nov 23 13:35:17 2012 (r243448) +++ stable/8/sys/boot/pc98/cdboot/cdboot.S Fri Nov 23 13:36:09 2012 (r243449) @@ -30,14 +30,14 @@ # $FreeBSD$ -#include - # # Basically, we first create a set of boot arguments to pass to the loaded # binary. Then we attempt to load /boot/loader from the CD we were booted # off of. # +#include + # # Memory locations. # Modified: stable/8/sys/boot/pc98/libpc98/Makefile ============================================================================== --- stable/8/sys/boot/pc98/libpc98/Makefile Fri Nov 23 13:35:17 2012 (r243448) +++ stable/8/sys/boot/pc98/libpc98/Makefile Fri Nov 23 13:36:09 2012 (r243449) @@ -37,7 +37,8 @@ CFLAGS+= -DTERM_EMU # XXX: make alloca() useable CFLAGS+= -Dalloca=__builtin_alloca -CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../btx/lib \ +CFLAGS+= -I${.CURDIR}/../../common \ + -I${.CURDIR}/../btx/lib \ -I${.CURDIR}/../../i386/libi386 \ -I${.CURDIR}/../../.. -I. # the location of libstand Modified: stable/8/sys/boot/pc98/loader/main.c ============================================================================== --- stable/8/sys/boot/pc98/loader/main.c Fri Nov 23 13:35:17 2012 (r243448) +++ stable/8/sys/boot/pc98/loader/main.c Fri Nov 23 13:36:09 2012 (r243449) @@ -36,6 +36,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include "bootstrap.h" @@ -190,9 +192,9 @@ main(void) static void extract_currdev(void) { - struct i386_devdesc new_currdev; - int major; - int biosdev = -1; + struct i386_devdesc new_currdev; + int major; + int biosdev = -1; /* Assume we are booting from a BIOS disk by default */ new_currdev.d_dev = &biosdisk; @@ -238,7 +240,7 @@ extract_currdev(void) } } new_currdev.d_type = new_currdev.d_dev->dv_type; - + /* * If we are booting off of a BIOS disk and we didn't succeed in determining * which one we booted off of, just use disk0: as a reasonable default. @@ -249,6 +251,7 @@ extract_currdev(void) "Guessed BIOS device 0x%x not found by probes, defaulting to disk0:\n", biosdev); new_currdev.d_unit = 0; } + env_setenv("currdev", EV_VOLATILE, i386_fmtdev(&new_currdev), i386_setcurrdev, env_nounset); env_setenv("loaddev", EV_VOLATILE, i386_fmtdev(&new_currdev), env_noset, @@ -289,33 +292,17 @@ command_heap(int argc, char *argv[]) return(CMD_OK); } -/* ISA bus access functions for PnP, derived from */ -static int +/* ISA bus access functions for PnP. */ +static int isa_inb(int port) { - u_char data; - - if (__builtin_constant_p(port) && - (((port) & 0xffff) < 0x100) && - ((port) < 0x10000)) { - __asm __volatile("inb %1,%0" : "=a" (data) : "id" ((u_short)(port))); - } else { - __asm __volatile("inb %%dx,%0" : "=a" (data) : "d" (port)); - } - return(data); + + return (inb(port)); } static void isa_outb(int port, int value) { - u_char al = value; - - if (__builtin_constant_p(port) && - (((port) & 0xffff) < 0x100) && - ((port) < 0x10000)) { - __asm __volatile("outb %0,%1" : : "a" (al), "id" ((u_short)(port))); - } else { - __asm __volatile("outb %0,%%dx" : : "a" (al), "d" (port)); - } -} + outb(port, value); +} From owner-svn-src-stable@FreeBSD.ORG Fri Nov 23 13:55:39 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 32B793D3; Fri, 23 Nov 2012 13:55:39 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 17E748FC08; Fri, 23 Nov 2012 13:55:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qANDtc7K026076; Fri, 23 Nov 2012 13:55:38 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qANDtc0o026075; Fri, 23 Nov 2012 13:55:38 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201211231355.qANDtc0o026075@svn.freebsd.org> From: Takahashi Yoshihiro Date: Fri, 23 Nov 2012 13:55: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: r243452 - stable/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-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2012 13:55:39 -0000 Author: nyan Date: Fri Nov 23 13:55:38 2012 New Revision: 243452 URL: http://svnweb.freebsd.org/changeset/base/243452 Log: MFC: r242870 Fix build mpboot.s with clang. Modified: stable/9/sys/conf/Makefile.pc98 Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/sys/conf/Makefile.pc98 ============================================================================== --- stable/9/sys/conf/Makefile.pc98 Fri Nov 23 13:47:41 2012 (r243451) +++ stable/9/sys/conf/Makefile.pc98 Fri Nov 23 13:55:38 2012 (r243452) @@ -34,6 +34,10 @@ MACHINE=pc98 MKMODULESENV+= MACHINE=${MACHINE} +# XXX: clang integrated-as doesn't grok .codeNN directives yet +ASM_CFLAGS.mpboot.s= ${CLANG_NO_IAS} +ASM_CFLAGS+= ${ASM_CFLAGS.${.IMPSRC:T}} + %BEFORE_DEPEND %OBJS From owner-svn-src-stable@FreeBSD.ORG Fri Nov 23 14:16:56 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 58D9EA71; Fri, 23 Nov 2012 14:16:56 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3D5188FC13; Fri, 23 Nov 2012 14:16:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qANEGuMQ029866; Fri, 23 Nov 2012 14:16:56 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qANEGu6j029859; Fri, 23 Nov 2012 14:16:56 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201211231416.qANEGu6j029859@svn.freebsd.org> From: Takahashi Yoshihiro Date: Fri, 23 Nov 2012 14:16:56 +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: r243455 - in stable/9/sys: dev/ct dev/snc pc98/include X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2012 14:16:56 -0000 Author: nyan Date: Fri Nov 23 14:16:55 2012 New Revision: 243455 URL: http://svnweb.freebsd.org/changeset/base/243455 Log: MFC: r242866, r242871 Use ANSI prototype to fix build with clang. Modified: stable/9/sys/dev/ct/bshw_machdep.c stable/9/sys/dev/ct/ct.c stable/9/sys/dev/ct/ct_isa.c stable/9/sys/dev/ct/ct_machdep.h stable/9/sys/dev/snc/dp83932.c stable/9/sys/dev/snc/dp83932subr.c stable/9/sys/dev/snc/if_snc.c stable/9/sys/dev/snc/if_snc_cbus.c stable/9/sys/pc98/include/bus.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/ct/bshw_machdep.c ============================================================================== --- stable/9/sys/dev/ct/bshw_machdep.c Fri Nov 23 14:16:24 2012 (r243454) +++ stable/9/sys/dev/ct/bshw_machdep.c Fri Nov 23 14:16:55 2012 (r243455) @@ -112,9 +112,7 @@ typedef unsigned long vaddr_t; * GENERIC MACHDEP FUNCTIONS *********************************************************/ void -bshw_synch_setup(ct, ti) - struct ct_softc *ct; - struct targ_info *ti; +bshw_synch_setup(struct ct_softc *ct, struct targ_info *ti) { struct ct_bus_access_handle *chp = &ct->sc_ch; struct ct_targ_info *cti = (void *) ti; @@ -133,8 +131,7 @@ bshw_synch_setup(ct, ti) } void -bshw_bus_reset(ct) - struct ct_softc *ct; +bshw_bus_reset(struct ct_softc *ct) { struct scsi_low_softc *slp = &ct->sc_sclow; struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -182,9 +179,7 @@ bshw_bus_reset(ct) /* probe */ int -bshw_read_settings(chp, bs) - struct ct_bus_access_handle *chp; - struct bshw_softc *bs; +bshw_read_settings(struct ct_bus_access_handle *chp, struct bshw_softc *bs) { static int irq_tbl[] = { 3, 5, 6, 9, 12, 13 }; @@ -216,8 +211,7 @@ static __inline void bshw_lc_smit_stop(s static int bshw_lc_smit_fstat(struct ct_softc *, int, int); static __inline void -bshw_lc_smit_stop(ct) - struct ct_softc *ct; +bshw_lc_smit_stop(struct ct_softc *ct) { struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -226,10 +220,7 @@ bshw_lc_smit_stop(ct) } static __inline void -bshw_lc_smit_start(ct, count, direction) - struct ct_softc *ct; - int count; - u_int direction; +bshw_lc_smit_start(struct ct_softc *ct, int count, u_int direction) { struct ct_bus_access_handle *chp = &ct->sc_ch; u_int8_t pval, val; @@ -245,9 +236,7 @@ bshw_lc_smit_start(ct, count, direction) } static int -bshw_lc_smit_fstat(ct, wc, read) - struct ct_softc *ct; - int wc, read; +bshw_lc_smit_fstat(struct ct_softc *ct, int wc, int read) { struct ct_bus_access_handle *chp = &ct->sc_ch; u_int8_t stat; @@ -277,8 +266,7 @@ bshw_lc_smit_fstat(ct, wc, read) } void -bshw_smit_xfer_stop(ct) - struct ct_softc *ct; +bshw_smit_xfer_stop(struct ct_softc *ct) { struct scsi_low_softc *slp = &ct->sc_sclow; struct bshw_softc *bs = ct->ct_hw; @@ -324,8 +312,7 @@ bad: } int -bshw_smit_xfer_start(ct) - struct ct_softc *ct; +bshw_smit_xfer_start(struct ct_softc *ct) { struct scsi_low_softc *slp = &ct->sc_sclow; struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -428,8 +415,7 @@ static void bshw_dmastart(struct ct_soft static void bshw_dmadone(struct ct_softc *); int -bshw_dma_xfer_start(ct) - struct ct_softc *ct; +bshw_dma_xfer_start(struct ct_softc *ct) { struct scsi_low_softc *slp = &ct->sc_sclow; struct sc_p *sp = &slp->sl_scp; @@ -490,8 +476,7 @@ bshw_dma_xfer_start(ct) } void -bshw_dma_xfer_stop(ct) - struct ct_softc *ct; +bshw_dma_xfer_stop(struct ct_softc *ct) { struct scsi_low_softc *slp = &ct->sc_sclow; struct sc_p *sp = &slp->sl_scp; @@ -554,10 +539,8 @@ bshw_dma_xfer_stop(ct) static bus_addr_t dmapageport[4] = { 0x27, 0x21, 0x23, 0x25 }; static __inline void -bshw_dma_write_1(chp, port, val) - struct ct_bus_access_handle *chp; - bus_addr_t port; - u_int8_t val; +bshw_dma_write_1(struct ct_bus_access_handle *chp, bus_addr_t port, + u_int8_t val) { CT_BUS_WEIGHT(chp); @@ -565,8 +548,7 @@ bshw_dma_write_1(chp, port, val) } static void -bshw_dmastart(ct) - struct ct_softc *ct; +bshw_dmastart(struct ct_softc *ct) { struct scsi_low_softc *slp = &ct->sc_sclow; struct bshw_softc *bs = ct->ct_hw; @@ -612,8 +594,7 @@ bshw_dmastart(ct) } static void -bshw_dmadone(ct) - struct ct_softc *ct; +bshw_dmadone(struct ct_softc *ct) { struct bshw_softc *bs = ct->ct_hw; struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -640,8 +621,7 @@ static void bshw_dma_start_elecom(struct static void bshw_dma_stop_elecom(struct ct_softc *); static int -bshw_dma_init_texa(ct) - struct ct_softc *ct; +bshw_dma_init_texa(struct ct_softc *ct) { struct ct_bus_access_handle *chp = &ct->sc_ch; u_int8_t regval; @@ -656,8 +636,7 @@ bshw_dma_init_texa(ct) } static int -bshw_dma_init_sc98(ct) - struct ct_softc *ct; +bshw_dma_init_sc98(struct ct_softc *ct) { struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -683,8 +662,7 @@ bshw_dma_init_sc98(ct) } static void -bshw_dma_start_sc98(ct) - struct ct_softc *ct; +bshw_dma_start_sc98(struct ct_softc *ct) { struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -693,8 +671,7 @@ bshw_dma_start_sc98(ct) } static void -bshw_dma_stop_sc98(ct) - struct ct_softc *ct; +bshw_dma_stop_sc98(struct ct_softc *ct) { struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -703,8 +680,7 @@ bshw_dma_stop_sc98(ct) } static void -bshw_dma_start_elecom(ct) - struct ct_softc *ct; +bshw_dma_start_elecom(struct ct_softc *ct) { struct ct_bus_access_handle *chp = &ct->sc_ch; u_int8_t tmp = ct_cr_read_1(chp, 0x4c); @@ -713,8 +689,7 @@ bshw_dma_start_elecom(ct) } static void -bshw_dma_stop_elecom(ct) - struct ct_softc *ct; +bshw_dma_stop_elecom(struct ct_softc *ct) { struct ct_bus_access_handle *chp = &ct->sc_ch; u_int8_t tmp = ct_cr_read_1(chp, 0x4c); Modified: stable/9/sys/dev/ct/ct.c ============================================================================== --- stable/9/sys/dev/ct/ct.c Fri Nov 23 14:16:24 2012 (r243454) +++ stable/9/sys/dev/ct/ct.c Fri Nov 23 14:16:55 2012 (r243455) @@ -192,9 +192,7 @@ struct scsi_low_funcs ct_funcs = { * HW functions **************************************************/ static __inline void -cthw_phase_bypass(ct, ph) - struct ct_softc *ct; - u_int8_t ph; +cthw_phase_bypass(struct ct_softc *ct, u_int8_t ph) { struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -203,8 +201,7 @@ cthw_phase_bypass(ct, ph) } static void -cthw_bus_reset(ct) - struct ct_softc *ct; +cthw_bus_reset(struct ct_softc *ct) { /* @@ -215,10 +212,8 @@ cthw_bus_reset(ct) } static int -cthw_chip_reset(chp, chiprevp, chipclk, hostid) - struct ct_bus_access_handle *chp; - int *chiprevp; - int chipclk, hostid; +cthw_chip_reset(struct ct_bus_access_handle *chp, int *chiprevp, int chipclk, + int hostid) { #define CT_SELTIMEOUT_20MHz_REGV (0x80) u_int8_t aux, regv; @@ -313,8 +308,7 @@ out: } static struct ct_synch_data * -ct_make_synch_table(ct) - struct ct_softc *ct; +ct_make_synch_table(struct ct_softc *ct) { struct ct_synch_data *sdtp, *sdp; u_int base, i, period; @@ -357,11 +351,8 @@ ct_make_synch_table(ct) * Attach & Probe **************************************************/ int -ctprobesubr(chp, dvcfg, hsid, chipclk, chiprevp) - struct ct_bus_access_handle *chp; - u_int dvcfg, chipclk; - int hsid; - int *chiprevp; +ctprobesubr(struct ct_bus_access_handle *chp, u_int dvcfg, int hsid, + u_int chipclk, int *chiprevp) { #if 0 @@ -385,8 +376,7 @@ ctprint(aux, name) } void -ctattachsubr(ct) - struct ct_softc *ct; +ctattachsubr(struct ct_softc *ct) { struct scsi_low_softc *slp = &ct->sc_sclow; @@ -401,8 +391,7 @@ ctattachsubr(ct) * SCSI LOW interface functions **************************************************/ static void -cthw_attention(ct) - struct ct_softc *ct; +cthw_attention(struct ct_softc *ct) { struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -419,8 +408,7 @@ cthw_attention(ct) } static void -ct_attention(ct) - struct ct_softc *ct; +ct_attention(struct ct_softc *ct) { struct scsi_low_softc *slp = &ct->sc_sclow; @@ -437,10 +425,7 @@ ct_attention(ct) } static int -ct_targ_init(ct, ti, action) - struct ct_softc *ct; - struct targ_info *ti; - int action; +ct_targ_init(struct ct_softc *ct, struct targ_info *ti, int action) { struct ct_targ_info *cti = (void *) ti; @@ -477,9 +462,7 @@ ct_targ_init(ct, ti, action) } static int -ct_world_start(ct, fdone) - struct ct_softc *ct; - int fdone; +ct_world_start(struct ct_softc *ct, int fdone) { struct scsi_low_softc *slp = &ct->sc_sclow; struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -510,9 +493,7 @@ ct_world_start(ct, fdone) } static int -ct_start_selection(ct, cb) - struct ct_softc *ct; - struct slccb *cb; +ct_start_selection(struct ct_softc *ct, struct slccb *cb) { struct scsi_low_softc *slp = &ct->sc_sclow; struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -584,10 +565,7 @@ ct_start_selection(ct, cb) } static int -ct_msg(ct, ti, msg) - struct ct_softc *ct; - struct targ_info *ti; - u_int msg; +ct_msg(struct ct_softc *ct, struct targ_info *ti, u_int msg) { struct ct_bus_access_handle *chp = &ct->sc_ch; struct ct_targ_info *cti = (void *) ti; @@ -639,11 +617,8 @@ ct_msg(ct, ti, msg) * *************************************************/ static int -ct_xfer(ct, data, len, direction, statp) - struct ct_softc *ct; - u_int8_t *data; - int len, direction; - u_int *statp; +ct_xfer(struct ct_softc *ct, u_int8_t *data, int len, int direction, + u_int *statp) { struct ct_bus_access_handle *chp = &ct->sc_ch; int wc; @@ -703,8 +678,7 @@ ct_xfer(ct, data, len, direction, statp) #define CT_PADDING_BUF_SIZE 32 static void -ct_io_xfer(ct) - struct ct_softc *ct; +ct_io_xfer(struct ct_softc *ct) { struct scsi_low_softc *slp = &ct->sc_sclow; struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -756,9 +730,7 @@ struct ct_err ct_cmderr[] = { }; static void -ct_phase_error(ct, scsi_status) - struct ct_softc *ct; - u_int8_t scsi_status; +ct_phase_error(struct ct_softc *ct, u_int8_t scsi_status) { struct scsi_low_softc *slp = &ct->sc_sclow; struct targ_info *ti = slp->sl_Tnexus; @@ -804,9 +776,7 @@ ct_phase_error(ct, scsi_status) * ### SCSI PHASE SEQUENCER ### **************************************************/ static int -ct_reselected(ct, scsi_status) - struct ct_softc *ct; - u_int8_t scsi_status; +ct_reselected(struct ct_softc *ct, u_int8_t scsi_status) { struct scsi_low_softc *slp = &ct->sc_sclow; struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -849,9 +819,7 @@ ct_reselected(ct, scsi_status) } static int -ct_target_nexus_establish(ct, lun, dir) - struct ct_softc *ct; - int lun, dir; +ct_target_nexus_establish(struct ct_softc *ct, int lun, int dir) { struct scsi_low_softc *slp = &ct->sc_sclow; struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -871,8 +839,7 @@ ct_target_nexus_establish(ct, lun, dir) } static int -ct_lun_nexus_establish(ct) - struct ct_softc *ct; +ct_lun_nexus_establish(struct ct_softc *ct) { struct scsi_low_softc *slp = &ct->sc_sclow; struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -883,8 +850,7 @@ ct_lun_nexus_establish(ct) } static int -ct_ccb_nexus_establish(ct) - struct ct_softc *ct; +ct_ccb_nexus_establish(struct ct_softc *ct) { struct scsi_low_softc *slp = &ct->sc_sclow; struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -910,8 +876,7 @@ ct_ccb_nexus_establish(ct) } static int -ct_unbusy(ct) - struct ct_softc *ct; +ct_unbusy(struct ct_softc *ct) { struct scsi_low_softc *slp = &ct->sc_sclow; struct ct_bus_access_handle *chp = &ct->sc_ch; @@ -934,8 +899,7 @@ ct_unbusy(ct) } static int -ct_catch_intr(ct) - struct ct_softc *ct; +ct_catch_intr(struct ct_softc *ct) { struct ct_bus_access_handle *chp = &ct->sc_ch; int wc; @@ -953,8 +917,7 @@ ct_catch_intr(ct) } int -ctintr(arg) - void *arg; +ctintr(void *arg) { struct ct_softc *ct = arg; struct scsi_low_softc *slp = &ct->sc_sclow; Modified: stable/9/sys/dev/ct/ct_isa.c ============================================================================== --- stable/9/sys/dev/ct/ct_isa.c Fri Nov 23 14:16:24 2012 (r243454) +++ stable/9/sys/dev/ct/ct_isa.c Fri Nov 23 14:16:55 2012 (r243455) @@ -394,16 +394,14 @@ ct_dmamap(void *arg, bus_dma_segment_t * } static void -ct_isa_bus_access_weight(chp) - struct ct_bus_access_handle *chp; +ct_isa_bus_access_weight(struct ct_bus_access_handle *chp) { outb(0x5f, 0); } static void -ct_isa_dmasync_before(ct) - struct ct_softc *ct; +ct_isa_dmasync_before(struct ct_softc *ct) { if (need_pre_dma_flush) @@ -411,8 +409,7 @@ ct_isa_dmasync_before(ct) } static void -ct_isa_dmasync_after(ct) - struct ct_softc *ct; +ct_isa_dmasync_after(struct ct_softc *ct) { if (need_post_dma_flush) Modified: stable/9/sys/dev/ct/ct_machdep.h ============================================================================== --- stable/9/sys/dev/ct/ct_machdep.h Fri Nov 23 14:16:24 2012 (r243454) +++ stable/9/sys/dev/ct/ct_machdep.h Fri Nov 23 14:16:55 2012 (r243455) @@ -90,8 +90,7 @@ static __inline void cthw_set_count (struct ct_bus_access_handle *, u_int); static __inline u_int8_t -ct_stat_read_1(chp) - struct ct_bus_access_handle *chp; +ct_stat_read_1(struct ct_bus_access_handle *chp) { u_int8_t regv; @@ -101,9 +100,7 @@ ct_stat_read_1(chp) } static __inline void -cthw_set_count(chp, count) - struct ct_bus_access_handle *chp; - u_int count; +cthw_set_count(struct ct_bus_access_handle *chp, u_int count) { bus_space_tag_t bst = chp->ch_iot; bus_space_handle_t bsh = chp->ch_ioh; @@ -119,8 +116,7 @@ cthw_set_count(chp, count) } static __inline u_int -cthw_get_count(chp) - struct ct_bus_access_handle *chp; +cthw_get_count(struct ct_bus_access_handle *chp) { bus_space_tag_t bst = chp->ch_iot; bus_space_handle_t bsh = chp->ch_ioh; @@ -138,10 +134,7 @@ cthw_get_count(chp) } static __inline void -ct_write_cmds(chp, cmd, len) - struct ct_bus_access_handle *chp; - u_int8_t *cmd; - int len; +ct_write_cmds(struct ct_bus_access_handle *chp, u_int8_t *cmd, int len) { bus_space_tag_t bst = chp->ch_iot; bus_space_handle_t bsh = chp->ch_ioh; @@ -157,9 +150,7 @@ ct_write_cmds(chp, cmd, len) } static __inline u_int8_t -ct_cr_read_1(chp, offs) - struct ct_bus_access_handle *chp; - bus_addr_t offs; +ct_cr_read_1(struct ct_bus_access_handle *chp, bus_addr_t offs) { bus_space_tag_t bst = chp->ch_iot; bus_space_handle_t bsh = chp->ch_ioh; @@ -173,10 +164,7 @@ ct_cr_read_1(chp, offs) } static __inline void -ct_cr_write_1(chp, offs, val) - struct ct_bus_access_handle *chp; - bus_addr_t offs; - u_int8_t val; +ct_cr_write_1(struct ct_bus_access_handle *chp, bus_addr_t offs, u_int8_t val) { bus_space_tag_t bst = chp->ch_iot; bus_space_handle_t bsh = chp->ch_ioh; @@ -188,8 +176,7 @@ ct_cr_write_1(chp, offs, val) } static __inline u_int8_t -ct_cmdp_read_1(chp) - struct ct_bus_access_handle *chp; +ct_cmdp_read_1(struct ct_bus_access_handle *chp) { u_int8_t regv; @@ -199,9 +186,7 @@ ct_cmdp_read_1(chp) } static __inline void -ct_cmdp_write_1(chp, val) - struct ct_bus_access_handle *chp; - u_int8_t val; +ct_cmdp_write_1(struct ct_bus_access_handle *chp, u_int8_t val) { bus_space_write_1(chp->ch_iot, chp->ch_ioh, cmd_port, val); Modified: stable/9/sys/dev/snc/dp83932.c ============================================================================== --- stable/9/sys/dev/snc/dp83932.c Fri Nov 23 14:16:24 2012 (r243454) +++ stable/9/sys/dev/snc/dp83932.c Fri Nov 23 14:16:55 2012 (r243455) @@ -142,10 +142,8 @@ int sncdebug = 0; int -sncconfig(sc, media, nmedia, defmedia, myea) - struct snc_softc *sc; - int *media, nmedia, defmedia; - u_int8_t *myea; +sncconfig(struct snc_softc *sc, int *media, int nmedia, int defmedia, + u_int8_t *myea) { struct ifnet *ifp; int i; @@ -196,8 +194,7 @@ sncconfig(sc, media, nmedia, defmedia, m } void -sncshutdown(arg) - void *arg; +sncshutdown(void *arg) { struct snc_softc *sc = arg; @@ -209,8 +206,7 @@ sncshutdown(arg) * Media change callback. */ int -snc_mediachange(ifp) - struct ifnet *ifp; +snc_mediachange(struct ifnet *ifp) { struct snc_softc *sc = ifp->if_softc; int error; @@ -228,9 +224,7 @@ snc_mediachange(ifp) * Media status callback. */ void -snc_mediastatus(ifp, ifmr) - struct ifnet *ifp; - struct ifmediareq *ifmr; +snc_mediastatus(struct ifnet *ifp, struct ifmediareq *ifmr) { struct snc_softc *sc = ifp->if_softc; @@ -249,10 +243,7 @@ snc_mediastatus(ifp, ifmr) static int -sncioctl(ifp, cmd, data) - struct ifnet *ifp; - u_long cmd; - caddr_t data; +sncioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { struct ifreq *ifr; struct snc_softc *sc = ifp->if_softc; @@ -318,8 +309,7 @@ sncioctl(ifp, cmd, data) * Encapsulate a packet of type family for the local net. */ static void -sncstart(ifp) - struct ifnet *ifp; +sncstart(struct ifnet *ifp) { struct snc_softc *sc = ifp->if_softc; @@ -329,8 +319,7 @@ sncstart(ifp) } static void -sncstart_locked(ifp) - struct ifnet *ifp; +sncstart_locked(struct ifnet *ifp) { struct snc_softc *sc = ifp->if_softc; struct mbuf *m; @@ -391,16 +380,14 @@ outloop: * hardware/software errors. */ static void -sncreset(sc) - struct snc_softc *sc; +sncreset(struct snc_softc *sc) { sncstop(sc); sncinit_locked(sc); } static void -sncinit(xsc) - void *xsc; +sncinit(void *xsc) { struct snc_softc *sc = xsc; @@ -477,8 +464,7 @@ sncinit_locked(struct snc_softc *sc) * part way through. */ static int -sncstop(sc) - struct snc_softc *sc; +sncstop(struct snc_softc *sc) { struct mtd *mtd; @@ -537,10 +523,7 @@ sncwatchdog(void *arg) * stuff packet into sonic */ static u_int -sonicput(sc, m0, mtd_next) - struct snc_softc *sc; - struct mbuf *m0; - int mtd_next; +sonicput(struct snc_softc *sc, struct mbuf *m0, int mtd_next) { struct mtd *mtdp; struct mbuf *m; @@ -630,8 +613,7 @@ sonicput(sc, m0, mtd_next) * CAM support */ static void -caminitialise(sc) - struct snc_softc *sc; +caminitialise(struct snc_softc *sc) { u_int32_t v_cda = sc->v_cda; int i; @@ -654,10 +636,7 @@ caminitialise(sc) } static void -camentry(sc, entry, ea) - int entry; - u_char *ea; - struct snc_softc *sc; +camentry(struct snc_softc *sc, int entry, u_char *ea) { u_int32_t v_cda = sc->v_cda; int camoffset = entry * CDA_CAMDESC; @@ -671,8 +650,7 @@ camentry(sc, entry, ea) } static void -camprogram(sc) - struct snc_softc *sc; +camprogram(struct snc_softc *sc) { struct ifmultiaddr *ifma; struct ifnet *ifp; @@ -733,8 +711,7 @@ camprogram(sc) #ifdef SNCDEBUG static void -camdump(sc) - struct snc_softc *sc; +camdump(struct snc_softc *sc) { int i; @@ -759,8 +736,7 @@ camdump(sc) #endif static void -initialise_tda(sc) - struct snc_softc *sc; +initialise_tda(struct snc_softc *sc) { struct mtd *mtd; int i; @@ -781,8 +757,7 @@ initialise_tda(sc) } static void -initialise_rda(sc) - struct snc_softc *sc; +initialise_rda(struct snc_softc *sc) { int i; u_int32_t vv_rda = 0; @@ -810,8 +785,7 @@ initialise_rda(sc) } static void -initialise_rra(sc) - struct snc_softc *sc; +initialise_rra(struct snc_softc *sc) { int i; u_int v; @@ -843,8 +817,7 @@ initialise_rra(sc) } void -sncintr(arg) - void *arg; +sncintr(void *arg) { struct snc_softc *sc = (struct snc_softc *)arg; int isr; @@ -913,8 +886,7 @@ sncintr(arg) * Transmit interrupt routine */ static void -sonictxint(sc) - struct snc_softc *sc; +sonictxint(struct snc_softc *sc) { struct mtd *mtd; u_int32_t txp; @@ -991,8 +963,7 @@ sonictxint(sc) * Receive interrupt routine */ static void -sonicrxint(sc) - struct snc_softc *sc; +sonicrxint(struct snc_softc *sc) { u_int32_t rda; int orra; @@ -1085,10 +1056,7 @@ sonicrxint(sc) * appropriate protocol handler */ static int -sonic_read(sc, pkt, len) - struct snc_softc *sc; - u_int32_t pkt; - int len; +sonic_read(struct snc_softc *sc, u_int32_t pkt, int len) { struct ifnet *ifp = sc->sc_ifp; struct ether_header *et; @@ -1132,10 +1100,7 @@ sonic_read(sc, pkt, len) * munge the received packet into an mbuf chain */ static struct mbuf * -sonic_get(sc, pkt, datalen) - struct snc_softc *sc; - u_int32_t pkt; - int datalen; +sonic_get(struct snc_softc *sc, u_int32_t pkt, int datalen) { struct mbuf *m, *top, **mp; int len; @@ -1195,8 +1160,7 @@ sonic_get(sc, pkt, datalen) * Enable power on the interface. */ int -snc_enable(sc) - struct snc_softc *sc; +snc_enable(struct snc_softc *sc) { #ifdef SNCDEBUG @@ -1218,8 +1182,7 @@ snc_enable(sc) * Disable power on the interface. */ void -snc_disable(sc) - struct snc_softc *sc; +snc_disable(struct snc_softc *sc) { #ifdef SNCDEBUG Modified: stable/9/sys/dev/snc/dp83932subr.c ============================================================================== --- stable/9/sys/dev/snc/dp83932subr.c Fri Nov 23 14:16:24 2012 (r243454) +++ stable/9/sys/dev/snc/dp83932subr.c Fri Nov 23 14:16:55 2012 (r243455) @@ -73,9 +73,7 @@ static __inline u_int16_t snc_nec16_sele * to accept packets. */ int -sncsetup(sc, lladdr) - struct snc_softc *sc; - u_int8_t *lladdr; +sncsetup(struct snc_softc *sc, u_int8_t *lladdr) { u_int32_t p, pp; int i; @@ -172,8 +170,7 @@ sncsetup(sc, lladdr) * check if a specified irq is acceptable. */ u_int8_t -snc_nec16_validate_irq(irq) - int irq; +snc_nec16_validate_irq(int irq) { const u_int8_t encoded_irq[16] = { -1, -1, -1, 0, -1, 1, 2, -1, -1, 3, 4, -1, 5, 6, -1, -1 @@ -186,9 +183,7 @@ snc_nec16_validate_irq(irq) * specify irq to board. */ int -snc_nec16_register_irq(sc, irq) - struct snc_softc *sc; - int irq; +snc_nec16_register_irq(struct snc_softc *sc, int irq) { bus_space_tag_t iot = sc->sc_iot; bus_space_handle_t ioh = sc->sc_ioh; @@ -212,8 +207,7 @@ snc_nec16_register_irq(sc, irq) * check if a specified memory base address is acceptable. */ int -snc_nec16_validate_mem(maddr) - int maddr; +snc_nec16_validate_mem(int maddr) { /* Check on Normal mode with max range, only */ @@ -230,9 +224,7 @@ snc_nec16_validate_mem(maddr) * specify memory base address to board and map to first bank. */ int -snc_nec16_register_mem(sc, maddr) - struct snc_softc *sc; - int maddr; +snc_nec16_register_mem(struct snc_softc *sc, int maddr) { bus_space_tag_t iot = sc->sc_iot; bus_space_handle_t ioh = sc->sc_ioh; @@ -260,11 +252,8 @@ snc_nec16_register_mem(sc, maddr) } int -snc_nec16_check_memory(iot, ioh, memt, memh) - bus_space_tag_t iot; - bus_space_handle_t ioh; - bus_space_tag_t memt; - bus_space_handle_t memh; +snc_nec16_check_memory(bus_space_tag_t iot, bus_space_handle_t ioh, + bus_space_tag_t memt, bus_space_handle_t memh) { u_int16_t val; int i, j; @@ -341,14 +330,9 @@ snc_nec16_check_memory(iot, ioh, memt, m } int -snc_nec16_detectsubr(iot, ioh, memt, memh, irq, maddr, type) - bus_space_tag_t iot; - bus_space_handle_t ioh; - bus_space_tag_t memt; - bus_space_handle_t memh; - int irq; - int maddr; - u_int8_t type; +snc_nec16_detectsubr(bus_space_tag_t iot, bus_space_handle_t ioh, + bus_space_tag_t memt, bus_space_handle_t memh, int irq, int maddr, + u_int8_t type) { u_int16_t cr; u_int8_t ident; @@ -413,8 +397,7 @@ snc_nec16_detectsubr(iot, ioh, memt, mem #define SNC_NEC_SERIES_PNP_CBUS2 0x3d u_int8_t * -snc_nec16_detect_type(myea) - u_int8_t *myea; +snc_nec16_detect_type(u_int8_t *myea) { u_int32_t vendor = (myea[0] << 16) | (myea[1] << 8) | myea[2]; u_int8_t series = myea[3]; @@ -459,10 +442,8 @@ snc_nec16_detect_type(myea) } int -snc_nec16_get_enaddr(iot, ioh, myea) - bus_space_tag_t iot; - bus_space_handle_t ioh; - u_int8_t *myea; +snc_nec16_get_enaddr(bus_space_tag_t iot, bus_space_handle_t ioh, + u_int8_t *myea) { u_int8_t eeprom[SNEC_EEPROM_SIZE]; u_int8_t rom_sum, sum = 0x00; @@ -493,9 +474,7 @@ snc_nec16_get_enaddr(iot, ioh, myea) * read from NEC/SONIC NIC register. */ u_int16_t -snc_nec16_nic_get(sc, reg) - struct snc_softc *sc; - u_int8_t reg; +snc_nec16_nic_get(struct snc_softc *sc, u_int8_t reg) { u_int16_t val; @@ -510,10 +489,7 @@ snc_nec16_nic_get(sc, reg) * write to NEC/SONIC NIC register. */ void -snc_nec16_nic_put(sc, reg, val) - struct snc_softc *sc; - u_int8_t reg; - u_int16_t val; +snc_nec16_nic_put(struct snc_softc *sc, u_int8_t reg, u_int16_t val) { /* select SONIC register */ @@ -527,10 +503,7 @@ snc_nec16_nic_put(sc, reg, val) * where exists specified (internal buffer memory) offset. */ static __inline u_int16_t -snc_nec16_select_bank(sc, base, offset) - struct snc_softc *sc; - u_int32_t base; - u_int32_t offset; +snc_nec16_select_bank(struct snc_softc *sc, u_int32_t base, u_int32_t offset) { bus_space_tag_t iot = sc->sc_iot; bus_space_handle_t ioh = sc->sc_ioh; @@ -565,11 +538,8 @@ snc_nec16_select_bank(sc, base, offset) * write to SONIC descriptors. */ void -snc_nec16_writetodesc(sc, base, offset, val) - struct snc_softc *sc; - u_int32_t base; - u_int32_t offset; - u_int16_t val; +snc_nec16_writetodesc(struct snc_softc *sc, u_int32_t base, u_int32_t offset, + u_int16_t val) { bus_space_tag_t memt = sc->sc_memt; bus_space_handle_t memh = sc->sc_memh; @@ -584,10 +554,7 @@ snc_nec16_writetodesc(sc, base, offset, * read from SONIC descriptors. */ u_int16_t -snc_nec16_readfromdesc(sc, base, offset) - struct snc_softc *sc; - u_int32_t base; - u_int32_t offset; +snc_nec16_readfromdesc(struct snc_softc *sc, u_int32_t base, u_int32_t offset) { bus_space_tag_t memt = sc->sc_memt; bus_space_handle_t memh = sc->sc_memh; @@ -602,11 +569,8 @@ snc_nec16_readfromdesc(sc, base, offset) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Fri Nov 23 15:42:25 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EF80EF10; Fri, 23 Nov 2012 15:42:25 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CB7FC8FC08; Fri, 23 Nov 2012 15:42:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qANFgP8i042873; Fri, 23 Nov 2012 15:42:25 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qANFgPvI042872; Fri, 23 Nov 2012 15:42:25 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201211231542.qANFgPvI042872@svn.freebsd.org> From: Takahashi Yoshihiro Date: Fri, 23 Nov 2012 15:42: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: r243460 - stable/9/sys/pc98/pc98 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2012 15:42:26 -0000 Author: nyan Date: Fri Nov 23 15:42:25 2012 New Revision: 243460 URL: http://svnweb.freebsd.org/changeset/base/243460 Log: MFC: r240855, r242867, r242868, r242869 MFi386: r237445 Commit changes missed from r237435. Properly calculate the signal trampoline addresses after the shared page is enabled. Handle FreeBSD ABIs without shared page support too. MFi386: r238792 Introduce curpcb magic variable. MFi386: r211924 Register an interrupt vector for DTrace return probes. Fix some KASSERTs. They are missing changes from r208833, r227394 and r227442. Reduce diffs against i386. Modified: stable/9/sys/pc98/pc98/machdep.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/pc98/pc98/machdep.c ============================================================================== --- stable/9/sys/pc98/pc98/machdep.c Fri Nov 23 15:31:00 2012 (r243459) +++ stable/9/sys/pc98/pc98/machdep.c Fri Nov 23 15:42:25 2012 (r243460) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include "opt_mp_watchdog.h" #include "opt_npx.h" #include "opt_perfmon.h" +#include "opt_kdtrace.h" #include #include @@ -407,7 +408,13 @@ osendsig(sig_t catcher, ksiginfo_t *ksi, } regs->tf_esp = (int)fp; - regs->tf_eip = PS_STRINGS - szosigcode; + if (p->p_sysent->sv_sigcode_base != 0) { + regs->tf_eip = p->p_sysent->sv_sigcode_base + szsigcode - + szosigcode; + } else { + /* a.out sysentvec does not use shared page */ + regs->tf_eip = p->p_sysent->sv_psstrings - szosigcode; + } regs->tf_eflags &= ~(PSL_T | PSL_D); regs->tf_cs = _ucodesel; regs->tf_ds = _udatasel; @@ -534,7 +541,8 @@ freebsd4_sendsig(sig_t catcher, ksiginfo } regs->tf_esp = (int)sfp; - regs->tf_eip = PS_STRINGS - szfreebsd4_sigcode; + regs->tf_eip = p->p_sysent->sv_sigcode_base + szsigcode - + szfreebsd4_sigcode; regs->tf_eflags &= ~(PSL_T | PSL_D); regs->tf_cs = _ucodesel; regs->tf_ds = _udatasel; @@ -685,7 +693,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, } regs->tf_esp = (int)sfp; - regs->tf_eip = PS_STRINGS - *(p->p_sysent->sv_szsigcode); + regs->tf_eip = p->p_sysent->sv_sigcode_base; regs->tf_eflags &= ~(PSL_T | PSL_D); regs->tf_cs = _ucodesel; regs->tf_ds = _udatasel; @@ -1207,7 +1215,7 @@ cpu_idle(int busy) CTR2(KTR_SPARE2, "cpu_idle(%d) at %d", busy, curcpu); -#ifdef MP_WATCHDOG +#if defined(MP_WATCHDOG) ap_watchdog(PCPU_GET(cpuid)); #endif /* If we are busy - try to use fast methods. */ @@ -1385,7 +1393,7 @@ exec_setregs(struct thread *td, struct i pcb->pcb_dr3 = 0; pcb->pcb_dr6 = 0; pcb->pcb_dr7 = 0; - if (pcb == PCPU_GET(curpcb)) { + if (pcb == curpcb) { /* * Clear the debug registers on the running * CPU, otherwise they will end up affecting @@ -1743,7 +1751,11 @@ extern inthand_t IDTVEC(bnd), IDTVEC(ill), IDTVEC(dna), IDTVEC(fpusegm), IDTVEC(tss), IDTVEC(missing), IDTVEC(stk), IDTVEC(prot), IDTVEC(page), IDTVEC(mchk), IDTVEC(rsvd), IDTVEC(fpu), IDTVEC(align), - IDTVEC(xmm), IDTVEC(lcall_syscall), IDTVEC(int0x80_syscall); + IDTVEC(xmm), +#ifdef KDTRACE_HOOKS + IDTVEC(dtrace_ret), +#endif + IDTVEC(lcall_syscall), IDTVEC(int0x80_syscall); #ifdef DDB /* @@ -2123,6 +2135,8 @@ do_next: for (off = 0; off < round_page(msgbufsize); off += PAGE_SIZE) pmap_kenter((vm_offset_t)msgbufp + off, phys_avail[pa_indx] + off); + + PT_UPDATES_FLUSH(); } void @@ -2262,6 +2276,10 @@ init386(first) GSEL(GCODE_SEL, SEL_KPL)); setidt(IDT_SYSCALL, &IDTVEC(int0x80_syscall), SDT_SYS386TGT, SEL_UPL, GSEL(GCODE_SEL, SEL_KPL)); +#ifdef KDTRACE_HOOKS + setidt(IDT_DTRACE_RET, &IDTVEC(dtrace_ret), SDT_SYS386TGT, SEL_UPL, + GSEL(GCODE_SEL, SEL_KPL)); +#endif r_idt.rd_limit = sizeof(idt0) - 1; r_idt.rd_base = (int) idt; @@ -2614,7 +2632,8 @@ int fill_fpregs(struct thread *td, struct fpreg *fpregs) { - KASSERT(td == curthread || TD_IS_SUSPENDED(td), + KASSERT(td == curthread || TD_IS_SUSPENDED(td) || + P_SHOULDSTOP(td->td_proc), ("not suspended thread %p", td)); #ifdef DEV_NPX npxgetregs(td); @@ -2783,6 +2802,7 @@ static void fpstate_drop(struct thread *td) { + KASSERT(PCB_USER_FPU(td->td_pcb), ("fpstate_drop: kernel-owned fpu")); critical_enter(); #ifdef DEV_NPX if (PCPU_GET(fpcurthread) == td) From owner-svn-src-stable@FreeBSD.ORG Fri Nov 23 15:44:05 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EF211123; Fri, 23 Nov 2012 15:44:04 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D48E78FC08; Fri, 23 Nov 2012 15:44:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qANFi4vc043206; Fri, 23 Nov 2012 15:44:04 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qANFi4cH043205; Fri, 23 Nov 2012 15:44:04 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201211231544.qANFi4cH043205@svn.freebsd.org> From: Takahashi Yoshihiro Date: Fri, 23 Nov 2012 15:44:04 +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: r243461 - stable/8/sys/pc98/pc98 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2012 15:44:05 -0000 Author: nyan Date: Fri Nov 23 15:44:04 2012 New Revision: 243461 URL: http://svnweb.freebsd.org/changeset/base/243461 Log: MFC: r225977, r242867, r242868, r242869 MFi386: r225936 Add some improvements in the idle table callbacks: - Replace instances of manual assembly instruction "hlt" call with halt() function calling. - In cpu_idle_mwait() avoid races in check to sched_runnable() using the same pattern used in cpu_idle_hlt() with the 'hlt' instruction. - Add comments explaining the logic behind the pattern used in cpu_idle_hlt() and other idle callbacks. MFi386: r211924 Register an interrupt vector for DTrace return probes. Fix some KASSERTs. They are missing changes from r208833, r227394 and r227442. Reduce diffs against i386. Modified: stable/8/sys/pc98/pc98/machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/pc98/ (props changed) Modified: stable/8/sys/pc98/pc98/machdep.c ============================================================================== --- stable/8/sys/pc98/pc98/machdep.c Fri Nov 23 15:42:25 2012 (r243460) +++ stable/8/sys/pc98/pc98/machdep.c Fri Nov 23 15:44:04 2012 (r243461) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include "opt_maxmem.h" #include "opt_npx.h" #include "opt_perfmon.h" +#include "opt_kdtrace.h" #include #include @@ -1122,7 +1123,7 @@ void cpu_halt(void) { for (;;) - __asm__ ("hlt"); + halt(); } static int idle_mwait = 1; /* Use MONITOR/MWAIT for short idle. */ @@ -1141,9 +1142,22 @@ cpu_idle_hlt(int busy) state = (int *)PCPU_PTR(monitorbuf); *state = STATE_SLEEPING; + /* - * We must absolutely guarentee that hlt is the next instruction - * after sti or we introduce a timing window. + * Since we may be in a critical section from cpu_idle(), if + * an interrupt fires during that critical section we may have + * a pending preemption. If the CPU halts, then that thread + * may not execute until a later interrupt awakens the CPU. + * To handle this race, check for a runnable thread after + * disabling interrupts and immediately return if one is + * found. Also, we must absolutely guarentee that hlt is + * the next instruction after sti. This ensures that any + * interrupt that fires after the call to disable_intr() will + * immediately awaken the CPU from hlt. Finally, please note + * that on x86 this works fine because of interrupts enabled only + * after the instruction following sti takes place, while IF is set + * to 1 immediately, allowing hlt instruction to acknowledge the + * interrupt. */ disable_intr(); if (sched_runnable()) @@ -1169,11 +1183,19 @@ cpu_idle_mwait(int busy) state = (int *)PCPU_PTR(monitorbuf); *state = STATE_MWAIT; - if (!sched_runnable()) { - cpu_monitor(state, 0, 0); - if (*state == STATE_MWAIT) - cpu_mwait(0, MWAIT_C1); + + /* See comments in cpu_idle_hlt(). */ + disable_intr(); + if (sched_runnable()) { + enable_intr(); + *state = STATE_RUNNING; + return; } + cpu_monitor(state, 0, 0); + if (*state == STATE_MWAIT) + __asm __volatile("sti; mwait" : : "a" (MWAIT_C1), "c" (0)); + else + enable_intr(); *state = STATE_RUNNING; } @@ -1185,6 +1207,12 @@ cpu_idle_spin(int busy) state = (int *)PCPU_PTR(monitorbuf); *state = STATE_RUNNING; + + /* + * The sched_runnable() call is racy but as long as there is + * a loop missing it one time will have just a little impact if any + * (and it is much better than missing the check at all). + */ for (i = 0; i < 1000; i++) { if (sched_runnable()) return; @@ -1198,7 +1226,7 @@ void cpu_idle(int busy) { -#ifdef SMP +#if defined(SMP) if (mp_grab_cpu_hlt()) return; #endif @@ -1708,7 +1736,11 @@ extern inthand_t IDTVEC(bnd), IDTVEC(ill), IDTVEC(dna), IDTVEC(fpusegm), IDTVEC(tss), IDTVEC(missing), IDTVEC(stk), IDTVEC(prot), IDTVEC(page), IDTVEC(mchk), IDTVEC(rsvd), IDTVEC(fpu), IDTVEC(align), - IDTVEC(xmm), IDTVEC(lcall_syscall), IDTVEC(int0x80_syscall); + IDTVEC(xmm), +#ifdef KDTRACE_HOOKS + IDTVEC(dtrace_ret), +#endif + IDTVEC(lcall_syscall), IDTVEC(int0x80_syscall); #ifdef DDB /* @@ -2088,6 +2120,8 @@ do_next: for (off = 0; off < round_page(msgbufsize); off += PAGE_SIZE) pmap_kenter((vm_offset_t)msgbufp + off, phys_avail[pa_indx] + off); + + PT_UPDATES_FLUSH(); } void @@ -2227,6 +2261,10 @@ init386(first) GSEL(GCODE_SEL, SEL_KPL)); setidt(IDT_SYSCALL, &IDTVEC(int0x80_syscall), SDT_SYS386TGT, SEL_UPL, GSEL(GCODE_SEL, SEL_KPL)); +#ifdef KDTRACE_HOOKS + setidt(IDT_DTRACE_RET, &IDTVEC(dtrace_ret), SDT_SYS386TGT, SEL_UPL, + GSEL(GCODE_SEL, SEL_KPL)); +#endif r_idt.rd_limit = sizeof(idt0) - 1; r_idt.rd_base = (int) idt; @@ -2563,7 +2601,8 @@ int fill_fpregs(struct thread *td, struct fpreg *fpregs) { - KASSERT(td == curthread || TD_IS_SUSPENDED(td), + KASSERT(td == curthread || TD_IS_SUSPENDED(td) || + P_SHOULDSTOP(td->td_proc), ("not suspended thread %p", td)); #ifdef DEV_NPX npxgetregs(td); @@ -2732,6 +2771,7 @@ static void fpstate_drop(struct thread *td) { + KASSERT(PCB_USER_FPU(td->td_pcb), ("fpstate_drop: kernel-owned fpu")); critical_enter(); #ifdef DEV_NPX if (PCPU_GET(fpcurthread) == td) From owner-svn-src-stable@FreeBSD.ORG Fri Nov 23 21:27:26 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BEF512DC; Fri, 23 Nov 2012 21:27:26 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A3FE98FC1C; Fri, 23 Nov 2012 21:27:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qANLRQnB098045; Fri, 23 Nov 2012 21:27:26 GMT (envelope-from remko@svn.freebsd.org) Received: (from remko@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qANLRQfC098042; Fri, 23 Nov 2012 21:27:26 GMT (envelope-from remko@svn.freebsd.org) Message-Id: <201211232127.qANLRQfC098042@svn.freebsd.org> From: Remko Lodder Date: Fri, 23 Nov 2012 21:27: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: r243466 - stable/8/sbin/ifconfig X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2012 21:27:26 -0000 Author: remko Date: Fri Nov 23 21:27:26 2012 New Revision: 243466 URL: http://svnweb.freebsd.org/changeset/base/243466 Log: MFC r232486 Add an ifconfig carp option that enables users to set the state of the carp cluster. This is a direct commit to stable/9 because -HEAD's code is very different. I discussed this with Gleb and the reason for this is that since we do not touch the kernel itself and are not adding very weird or confusing things, we can commit this to the stable branch directly. The options 'master' and 'backup' are now available, which enables the administrator to force a node into the backup or master state on the cluster. Ofcourse preempt has to be disabled otherwise the master node will become master again. One can do that with: sysctl net.inet.carp.preempt=0 After that one can schedule maintenance on the node normally running as the master and such. PR: 100956 Discussed with: glebius Modified: stable/8/sbin/ifconfig/ifcarp.c stable/8/sbin/ifconfig/ifconfig.8 Directory Properties: stable/8/sbin/ifconfig/ (props changed) Modified: stable/8/sbin/ifconfig/ifcarp.c ============================================================================== --- stable/8/sbin/ifconfig/ifcarp.c Fri Nov 23 20:04:39 2012 (r243465) +++ stable/8/sbin/ifconfig/ifcarp.c Fri Nov 23 21:27:26 2012 (r243466) @@ -57,6 +57,7 @@ void setcarp_advbase(const char *,int, i void setcarp_advskew(const char *, int, int, const struct afswtch *rafp); void setcarp_passwd(const char *, int, int, const struct afswtch *rafp); void setcarp_vhid(const char *, int, int, const struct afswtch *rafp); +void setcarp_state(const char *, int, int, const struct afswtch *rafp); void carp_status(int s) @@ -175,11 +176,34 @@ setcarp_advbase(const char *val, int d, return; } +void setcarp_state(const char *val, int d, int s, const struct afswtch *afp) +{ + struct carpreq carpr; + int i; + + bzero((char *)&carpr, sizeof(struct carpreq)); + ifr.ifr_data = (caddr_t)&carpr; + + if (ioctl(s, SIOCGVH, (caddr_t)&ifr) == -1) + err(1, "SIOCGVH"); + + for (i = 0; i <= CARP_MAXSTATE; i++) { + if (!strcasecmp(val, carp_states[i])) { + carpr.carpr_state = i; + break; + } + } + + if (ioctl(s, SIOCSVH, (caddr_t)&ifr) == -1) + err(1, "SIOCSVH"); +} + static struct cmd carp_cmds[] = { DEF_CMD_ARG("advbase", setcarp_advbase), DEF_CMD_ARG("advskew", setcarp_advskew), DEF_CMD_ARG("pass", setcarp_passwd), DEF_CMD_ARG("vhid", setcarp_vhid), + DEF_CMD_ARG("state", setcarp_state), }; static struct afswtch af_carp = { .af_name = "af_carp", Modified: stable/8/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/8/sbin/ifconfig/ifconfig.8 Fri Nov 23 20:04:39 2012 (r243465) +++ stable/8/sbin/ifconfig/ifconfig.8 Fri Nov 23 21:27:26 2012 (r243466) @@ -2408,6 +2408,13 @@ Set the authentication key to Set the virtual host ID. This is a required setting. Acceptable values are 1 to 255. +.It Cm state Ar state +Force the interface into state +.Ar state . +Valid states are INIT, BACKUP, and MASTER. Note that manually setting the state +to INIT is ignored by +.Xr carp 4 . +This state is set automatically when the underlying interface is down. .El .Pp The From owner-svn-src-stable@FreeBSD.ORG Fri Nov 23 21:29:09 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1AB71503; Fri, 23 Nov 2012 21:29:09 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F396F8FC0C; Fri, 23 Nov 2012 21:29:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qANLT8Yc098330; Fri, 23 Nov 2012 21:29:08 GMT (envelope-from remko@svn.freebsd.org) Received: (from remko@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qANLT8tX098328; Fri, 23 Nov 2012 21:29:08 GMT (envelope-from remko@svn.freebsd.org) Message-Id: <201211232129.qANLT8tX098328@svn.freebsd.org> From: Remko Lodder Date: Fri, 23 Nov 2012 21:29:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r243467 - stable/7/sbin/ifconfig X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Nov 2012 21:29:09 -0000 Author: remko Date: Fri Nov 23 21:29:08 2012 New Revision: 243467 URL: http://svnweb.freebsd.org/changeset/base/243467 Log: MFC r232486 Add an ifconfig carp option that enables users to set the state of the carp cluster. This is a direct commit to stable/9 because -HEAD's code is very different. I discussed this with Gleb and the reason for this is that since we do not touch the kernel itself and are not adding very weird or confusing things, we can commit this to the stable branch directly. The options 'master' and 'backup' are now available, which enables the administrator to force a node into the backup or master state on the cluster. Ofcourse preempt has to be disabled otherwise the master node will become master again. One can do that with: sysctl net.inet.carp.preempt=0 After that one can schedule maintenance on the node normally running as the master and such. PR: 100956 Discussed with: glebius Modified: stable/7/sbin/ifconfig/ifcarp.c stable/7/sbin/ifconfig/ifconfig.8 Directory Properties: stable/7/sbin/ifconfig/ (props changed) Modified: stable/7/sbin/ifconfig/ifcarp.c ============================================================================== --- stable/7/sbin/ifconfig/ifcarp.c Fri Nov 23 21:27:26 2012 (r243466) +++ stable/7/sbin/ifconfig/ifcarp.c Fri Nov 23 21:29:08 2012 (r243467) @@ -57,6 +57,7 @@ void setcarp_advbase(const char *,int, i void setcarp_advskew(const char *, int, int, const struct afswtch *rafp); void setcarp_passwd(const char *, int, int, const struct afswtch *rafp); void setcarp_vhid(const char *, int, int, const struct afswtch *rafp); +void setcarp_state(const char *, int, int, const struct afswtch *rafp); void carp_status(int s) @@ -175,11 +176,34 @@ setcarp_advbase(const char *val, int d, return; } +void setcarp_state(const char *val, int d, int s, const struct afswtch *afp) +{ + struct carpreq carpr; + int i; + + bzero((char *)&carpr, sizeof(struct carpreq)); + ifr.ifr_data = (caddr_t)&carpr; + + if (ioctl(s, SIOCGVH, (caddr_t)&ifr) == -1) + err(1, "SIOCGVH"); + + for (i = 0; i <= CARP_MAXSTATE; i++) { + if (!strcasecmp(val, carp_states[i])) { + carpr.carpr_state = i; + break; + } + } + + if (ioctl(s, SIOCSVH, (caddr_t)&ifr) == -1) + err(1, "SIOCSVH"); +} + static struct cmd carp_cmds[] = { DEF_CMD_ARG("advbase", setcarp_advbase), DEF_CMD_ARG("advskew", setcarp_advskew), DEF_CMD_ARG("pass", setcarp_passwd), DEF_CMD_ARG("vhid", setcarp_vhid), + DEF_CMD_ARG("state", setcarp_state), }; static struct afswtch af_carp = { .af_name = "af_carp", Modified: stable/7/sbin/ifconfig/ifconfig.8 ============================================================================== --- stable/7/sbin/ifconfig/ifconfig.8 Fri Nov 23 21:27:26 2012 (r243466) +++ stable/7/sbin/ifconfig/ifconfig.8 Fri Nov 23 21:29:08 2012 (r243467) @@ -1825,6 +1825,13 @@ Set the authentication key to Set the virtual host ID. This is a required setting. Acceptable values are 1 to 255. +.It Cm state Ar state +Force the interface into state +.Ar state . +Valid states are INIT, BACKUP, and MASTER. Note that manually setting the state +to INIT is ignored by +.Xr carp 4 . +This state is set automatically when the underlying interface is down. .El .Pp The From owner-svn-src-stable@FreeBSD.ORG Sat Nov 24 08:33:28 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 726ECCE4; Sat, 24 Nov 2012 08:33:28 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5410A8FC0C; Sat, 24 Nov 2012 08:33:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAO8XS3X006123; Sat, 24 Nov 2012 08:33:28 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAO8XSem006122; Sat, 24 Nov 2012 08:33:28 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201211240833.qAO8XSem006122@svn.freebsd.org> From: Jaakko Heinonen Date: Sat, 24 Nov 2012 08:33:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r243477 - stable/7/lib/libc/rpc X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2012 08:33:28 -0000 Author: jh Date: Sat Nov 24 08:33:27 2012 New Revision: 243477 URL: http://svnweb.freebsd.org/changeset/base/243477 Log: MFC r235143 by kib: Plug a leak. PR: 167068 Tested by: Oliver Pinter Modified: stable/7/lib/libc/rpc/auth_unix.c Directory Properties: stable/7/lib/libc/ (props changed) Modified: stable/7/lib/libc/rpc/auth_unix.c ============================================================================== --- stable/7/lib/libc/rpc/auth_unix.c Sat Nov 24 07:02:31 2012 (r243476) +++ stable/7/lib/libc/rpc/auth_unix.c Sat Nov 24 08:33:27 2012 (r243477) @@ -185,6 +185,7 @@ authunix_create(machname, uid, gid, len, AUTH * authunix_create_default() { + AUTH *auth; int ngids; long ngids_max; char machname[MAXHOSTNAMELEN + 1]; @@ -207,8 +208,10 @@ authunix_create_default() if (ngids > NGRPS) ngids = NGRPS; /* XXX: interface problem; those should all have been unsigned */ - return (authunix_create(machname, (int)uid, (int)gid, ngids, - (int *)gids)); + auth = authunix_create(machname, (int)uid, (int)gid, ngids, + (int *)gids); + free(gids); + return (auth); } /* From owner-svn-src-stable@FreeBSD.ORG Sat Nov 24 12:34:46 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 496A7D34; Sat, 24 Nov 2012 12:34:46 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2DE688FC0C; Sat, 24 Nov 2012 12:34:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOCYiNC050579; Sat, 24 Nov 2012 12:34:44 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOCYimO050578; Sat, 24 Nov 2012 12:34:44 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241234.qAOCYimO050578@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 12:34:44 +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: r243478 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2012 12:34:46 -0000 Author: avg Date: Sat Nov 24 12:34:44 2012 New Revision: 243478 URL: http://svnweb.freebsd.org/changeset/base/243478 Log: MFC r242862: zfs_ioc_destroy_snaps_nvl: remove disk device entries for zvol snapshots Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sat Nov 24 08:33:27 2012 (r243477) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sat Nov 24 12:34:44 2012 (r243478) @@ -3213,6 +3213,7 @@ zfs_ioc_destroy_snaps_nvl(zfs_cmd_t *zc) } (void) zfs_unmount_snap(name, NULL); + (void) zvol_remove_minor(name); } err = dmu_snapshots_destroy_nvl(nvl, zc->zc_defer_destroy, From owner-svn-src-stable@FreeBSD.ORG Sat Nov 24 12:35:05 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0E79CE94; Sat, 24 Nov 2012 12:35:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E6D6E8FC0C; Sat, 24 Nov 2012 12:35:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOCZ4vX050730; Sat, 24 Nov 2012 12:35:04 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOCZ4SR050729; Sat, 24 Nov 2012 12:35:04 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241235.qAOCZ4SR050729@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 12:35:04 +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: r243479 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2012 12:35:05 -0000 Author: avg Date: Sat Nov 24 12:35:04 2012 New Revision: 243479 URL: http://svnweb.freebsd.org/changeset/base/243479 Log: MFC r242862: zfs_ioc_destroy_snaps_nvl: remove disk device entries for zvol snapshots Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sat Nov 24 12:34:44 2012 (r243478) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Sat Nov 24 12:35:04 2012 (r243479) @@ -3213,6 +3213,7 @@ zfs_ioc_destroy_snaps_nvl(zfs_cmd_t *zc) } (void) zfs_unmount_snap(name, NULL); + (void) zvol_remove_minor(name); } err = dmu_snapshots_destroy_nvl(nvl, zc->zc_defer_destroy, From owner-svn-src-stable@FreeBSD.ORG Sat Nov 24 12:37:37 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AD06317B; Sat, 24 Nov 2012 12:37:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8A0B98FC18; Sat, 24 Nov 2012 12:37:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOCbbW5051194; Sat, 24 Nov 2012 12:37:37 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOCbbsQ051193; Sat, 24 Nov 2012 12:37:37 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241237.qAOCbbsQ051193@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 12:37:37 +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: r243480 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2012 12:37:37 -0000 Author: avg Date: Sat Nov 24 12:37:37 2012 New Revision: 243480 URL: http://svnweb.freebsd.org/changeset/base/243480 Log: MFC r243213: spa_import_rootpool: fall back to use configuration from zpool.cache Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Nov 24 12:35:04 2012 (r243479) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Nov 24 12:37:37 2012 (r243480) @@ -3380,12 +3380,23 @@ spa_generate_rootconf(const char *name) { nvlist_t *config; nvlist_t *nvtop, *nvroot; + uint64_t nchildren; uint64_t pgid; if (vdev_geom_read_pool_label(name, &config) != 0) return (NULL); /* + * Multi-vdev root pool configuration discovery is not supported yet. + */ + nchildren = 0; + nvlist_lookup_uint64(config, ZPOOL_CONFIG_VDEV_CHILDREN, &nchildren); + if (nchildren != 1) { + nvlist_free(config); + return (NULL); + } + + /* * Add this top-level vdev to the child array. */ VERIFY(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, @@ -3427,25 +3438,30 @@ spa_import_rootpool(const char *name) * Read the label from the boot device and generate a configuration. */ config = spa_generate_rootconf(name); - if (config == NULL) { + + mutex_enter(&spa_namespace_lock); + if (config != NULL) { + VERIFY(nvlist_lookup_string(config, ZPOOL_CONFIG_POOL_NAME, + &pname) == 0 && strcmp(name, pname) == 0); + VERIFY(nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_TXG, &txg) + == 0); + + if ((spa = spa_lookup(pname)) != NULL) { + /* + * Remove the existing root pool from the namespace so + * that we can replace it with the correct config + * we just read in. + */ + spa_remove(spa); + } + spa = spa_add(pname, config, NULL); + } else if ((spa = spa_lookup(name)) == NULL) { cmn_err(CE_NOTE, "Cannot find the pool label for '%s'", name); return (EIO); + } else { + VERIFY(nvlist_dup(spa->spa_config, &config, KM_SLEEP) == 0); } - - VERIFY(nvlist_lookup_string(config, ZPOOL_CONFIG_POOL_NAME, - &pname) == 0 && strcmp(name, pname) == 0); - VERIFY(nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_TXG, &txg) == 0); - - mutex_enter(&spa_namespace_lock); - if ((spa = spa_lookup(pname)) != NULL) { - /* - * Remove the existing root pool from the namespace so that we - * can replace it with the correct config we just read in. - */ - spa_remove(spa); - } - spa = spa_add(pname, config, NULL); spa->spa_is_root = B_TRUE; spa->spa_import_flags = ZFS_IMPORT_VERBATIM; @@ -3466,15 +3482,15 @@ spa_import_rootpool(const char *name) return (error); } - error = 0; spa_history_log_version(spa, LOG_POOL_IMPORT); -out: + spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER); vdev_free(rvd); spa_config_exit(spa, SCL_ALL, FTAG); mutex_exit(&spa_namespace_lock); - return (error); + nvlist_free(config); + return (0); } #endif /* sun */ From owner-svn-src-stable@FreeBSD.ORG Sat Nov 24 12:37:49 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7D4212AF; Sat, 24 Nov 2012 12:37:49 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 621588FC0C; Sat, 24 Nov 2012 12:37:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOCbnET051265; Sat, 24 Nov 2012 12:37:49 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOCbnlS051264; Sat, 24 Nov 2012 12:37:49 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241237.qAOCbnlS051264@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 12:37:49 +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: r243481 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2012 12:37:49 -0000 Author: avg Date: Sat Nov 24 12:37:48 2012 New Revision: 243481 URL: http://svnweb.freebsd.org/changeset/base/243481 Log: MFC r243213: spa_import_rootpool: fall back to use configuration from zpool.cache Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Nov 24 12:37:37 2012 (r243480) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Sat Nov 24 12:37:48 2012 (r243481) @@ -3380,12 +3380,23 @@ spa_generate_rootconf(const char *name) { nvlist_t *config; nvlist_t *nvtop, *nvroot; + uint64_t nchildren; uint64_t pgid; if (vdev_geom_read_pool_label(name, &config) != 0) return (NULL); /* + * Multi-vdev root pool configuration discovery is not supported yet. + */ + nchildren = 0; + nvlist_lookup_uint64(config, ZPOOL_CONFIG_VDEV_CHILDREN, &nchildren); + if (nchildren != 1) { + nvlist_free(config); + return (NULL); + } + + /* * Add this top-level vdev to the child array. */ VERIFY(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, @@ -3427,25 +3438,30 @@ spa_import_rootpool(const char *name) * Read the label from the boot device and generate a configuration. */ config = spa_generate_rootconf(name); - if (config == NULL) { + + mutex_enter(&spa_namespace_lock); + if (config != NULL) { + VERIFY(nvlist_lookup_string(config, ZPOOL_CONFIG_POOL_NAME, + &pname) == 0 && strcmp(name, pname) == 0); + VERIFY(nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_TXG, &txg) + == 0); + + if ((spa = spa_lookup(pname)) != NULL) { + /* + * Remove the existing root pool from the namespace so + * that we can replace it with the correct config + * we just read in. + */ + spa_remove(spa); + } + spa = spa_add(pname, config, NULL); + } else if ((spa = spa_lookup(name)) == NULL) { cmn_err(CE_NOTE, "Cannot find the pool label for '%s'", name); return (EIO); + } else { + VERIFY(nvlist_dup(spa->spa_config, &config, KM_SLEEP) == 0); } - - VERIFY(nvlist_lookup_string(config, ZPOOL_CONFIG_POOL_NAME, - &pname) == 0 && strcmp(name, pname) == 0); - VERIFY(nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_TXG, &txg) == 0); - - mutex_enter(&spa_namespace_lock); - if ((spa = spa_lookup(pname)) != NULL) { - /* - * Remove the existing root pool from the namespace so that we - * can replace it with the correct config we just read in. - */ - spa_remove(spa); - } - spa = spa_add(pname, config, NULL); spa->spa_is_root = B_TRUE; spa->spa_import_flags = ZFS_IMPORT_VERBATIM; @@ -3466,15 +3482,15 @@ spa_import_rootpool(const char *name) return (error); } - error = 0; spa_history_log_version(spa, LOG_POOL_IMPORT); -out: + spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER); vdev_free(rvd); spa_config_exit(spa, SCL_ALL, FTAG); mutex_exit(&spa_namespace_lock); - return (error); + nvlist_free(config); + return (0); } #endif /* sun */ From owner-svn-src-stable@FreeBSD.ORG Sat Nov 24 12:40:24 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 05DAE533; Sat, 24 Nov 2012 12:40:24 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DEB718FC08; Sat, 24 Nov 2012 12:40:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOCeNp9051842; Sat, 24 Nov 2012 12:40:23 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOCeNst051841; Sat, 24 Nov 2012 12:40:23 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241240.qAOCeNst051841@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 12:40:23 +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: r243482 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2012 12:40:24 -0000 Author: avg Date: Sat Nov 24 12:40:23 2012 New Revision: 243482 URL: http://svnweb.freebsd.org/changeset/base/243482 Log: MFC r242568: zfs_vnode_lock: no need to double-guess caller's intentions here Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Nov 24 12:37:48 2012 (r243481) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Nov 24 12:40:23 2012 (r243482) @@ -1740,15 +1740,7 @@ zfs_vnode_lock(vnode_t *vp, int flags) ASSERT(vp != NULL); - /* - * Check if the file system wasn't forcibly unmounted in the meantime. - */ error = vn_lock(vp, flags); - if (error == 0 && (vp->v_iflag & VI_DOOMED) != 0) { - VOP_UNLOCK(vp, 0); - error = ENOENT; - } - return (error); } From owner-svn-src-stable@FreeBSD.ORG Sat Nov 24 12:40:44 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 10DE4693; Sat, 24 Nov 2012 12:40:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E96D88FC13; Sat, 24 Nov 2012 12:40:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOCehwC051937; Sat, 24 Nov 2012 12:40:43 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOCehHX051936; Sat, 24 Nov 2012 12:40:43 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241240.qAOCehHX051936@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 12:40:43 +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: r243483 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2012 12:40:44 -0000 Author: avg Date: Sat Nov 24 12:40:43 2012 New Revision: 243483 URL: http://svnweb.freebsd.org/changeset/base/243483 Log: MFC r242568: zfs_vnode_lock: no need to double-guess caller's intentions here Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Nov 24 12:40:23 2012 (r243482) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Nov 24 12:40:43 2012 (r243483) @@ -1736,15 +1736,7 @@ zfs_vnode_lock(vnode_t *vp, int flags) ASSERT(vp != NULL); - /* - * Check if the file system wasn't forcibly unmounted in the meantime. - */ error = vn_lock(vp, flags); - if (error == 0 && (vp->v_iflag & VI_DOOMED) != 0) { - VOP_UNLOCK(vp, 0); - error = ENOENT; - } - return (error); } From owner-svn-src-stable@FreeBSD.ORG Sat Nov 24 12:42:29 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 84E9B905; Sat, 24 Nov 2012 12:42:29 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6A0858FC14; Sat, 24 Nov 2012 12:42:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOCgTWW052325; Sat, 24 Nov 2012 12:42:29 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOCgTps052324; Sat, 24 Nov 2012 12:42:29 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241242.qAOCgTps052324@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 12:42:29 +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: r243484 - stable/9/sys/cddl/compat/opensolaris/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-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2012 12:42:29 -0000 Author: avg Date: Sat Nov 24 12:42:29 2012 New Revision: 243484 URL: http://svnweb.freebsd.org/changeset/base/243484 Log: MFC r242569: opensolaris_lookup: use vfs_busy in traverse before calling VFS_ROOT Modified: stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c ============================================================================== --- stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c Sat Nov 24 12:40:43 2012 (r243483) +++ stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c Sat Nov 24 12:42:29 2012 (r243484) @@ -88,6 +88,7 @@ traverse(vnode_t **cvpp, int lktype) vfsp = vn_mountedvfs(cvp); if (vfsp == NULL) break; + error = vfs_busy(vfsp, 0); /* * tvp is NULL for *cvpp vnode, which we can't unlock. */ @@ -95,12 +96,15 @@ traverse(vnode_t **cvpp, int lktype) vput(cvp); else vrele(cvp); + if (error) + return (error); /* * The read lock must be held across the call to VFS_ROOT() to * prevent a concurrent unmount from destroying the vfs. */ error = VFS_ROOT(vfsp, lktype, &tvp); + vfs_unbusy(vfsp); if (error != 0) return (error); cvp = tvp; From owner-svn-src-stable@FreeBSD.ORG Sat Nov 24 12:42:42 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A45FEA33; Sat, 24 Nov 2012 12:42:42 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 899428FC0C; Sat, 24 Nov 2012 12:42:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOCgglV052381; Sat, 24 Nov 2012 12:42:42 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOCgg84052380; Sat, 24 Nov 2012 12:42:42 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241242.qAOCgg84052380@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 12:42:42 +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: r243485 - stable/8/sys/cddl/compat/opensolaris/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2012 12:42:42 -0000 Author: avg Date: Sat Nov 24 12:42:42 2012 New Revision: 243485 URL: http://svnweb.freebsd.org/changeset/base/243485 Log: MFC r242569: opensolaris_lookup: use vfs_busy in traverse before calling VFS_ROOT Modified: stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) Modified: stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c ============================================================================== --- stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c Sat Nov 24 12:42:29 2012 (r243484) +++ stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c Sat Nov 24 12:42:42 2012 (r243485) @@ -88,6 +88,7 @@ traverse(vnode_t **cvpp, int lktype) vfsp = vn_mountedvfs(cvp); if (vfsp == NULL) break; + error = vfs_busy(vfsp, 0); /* * tvp is NULL for *cvpp vnode, which we can't unlock. */ @@ -95,12 +96,15 @@ traverse(vnode_t **cvpp, int lktype) vput(cvp); else vrele(cvp); + if (error) + return (error); /* * The read lock must be held across the call to VFS_ROOT() to * prevent a concurrent unmount from destroying the vfs. */ error = VFS_ROOT(vfsp, lktype, &tvp); + vfs_unbusy(vfsp); if (error != 0) return (error); cvp = tvp; From owner-svn-src-stable@FreeBSD.ORG Sat Nov 24 12:44:13 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E6AA6BED; Sat, 24 Nov 2012 12:44:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C79BC8FC08; Sat, 24 Nov 2012 12:44:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOCiDX9052670; Sat, 24 Nov 2012 12:44:13 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOCiD7F052669; Sat, 24 Nov 2012 12:44:13 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241244.qAOCiD7F052669@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 12:44:13 +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: r243486 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2012 12:44:14 -0000 Author: avg Date: Sat Nov 24 12:44:13 2012 New Revision: 243486 URL: http://svnweb.freebsd.org/changeset/base/243486 Log: MFC r242570: zfs_umount: no need to set MNTK_UNMOUNTF here, dounmount handles that Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Nov 24 12:42:42 2012 (r243485) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Nov 24 12:44:13 2012 (r243486) @@ -1966,10 +1966,6 @@ zfs_umount(vfs_t *vfsp, int fflag) zfsvfs->z_ctldir->v_count > 1) return (EBUSY); } - } else { - MNT_ILOCK(vfsp); - vfsp->mnt_kern_flag |= MNTK_UNMOUNTF; - MNT_IUNLOCK(vfsp); } VERIFY(zfsvfs_teardown(zfsvfs, B_TRUE) == 0); From owner-svn-src-stable@FreeBSD.ORG Sat Nov 24 12:44:26 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 06E26D02; Sat, 24 Nov 2012 12:44:26 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DFAF98FC14; Sat, 24 Nov 2012 12:44:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOCiPgQ052734; Sat, 24 Nov 2012 12:44:25 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOCiPdg052733; Sat, 24 Nov 2012 12:44:25 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241244.qAOCiPdg052733@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 12:44:25 +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: r243487 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2012 12:44:26 -0000 Author: avg Date: Sat Nov 24 12:44:25 2012 New Revision: 243487 URL: http://svnweb.freebsd.org/changeset/base/243487 Log: MFC r242570: zfs_umount: no need to set MNTK_UNMOUNTF here, dounmount handles that Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Nov 24 12:44:13 2012 (r243486) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Nov 24 12:44:25 2012 (r243487) @@ -1962,10 +1962,6 @@ zfs_umount(vfs_t *vfsp, int fflag) zfsvfs->z_ctldir->v_count > 1) return (EBUSY); } - } else { - MNT_ILOCK(vfsp); - vfsp->mnt_kern_flag |= MNTK_UNMOUNTF; - MNT_IUNLOCK(vfsp); } VERIFY(zfsvfs_teardown(zfsvfs, B_TRUE) == 0); From owner-svn-src-stable@FreeBSD.ORG Sat Nov 24 12:46:08 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 77CEDEB4; Sat, 24 Nov 2012 12:46:08 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5BCF88FC13; Sat, 24 Nov 2012 12:46:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOCk8dN053076; Sat, 24 Nov 2012 12:46:08 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOCk8xE053075; Sat, 24 Nov 2012 12:46:08 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241246.qAOCk8xE053075@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 12:46:08 +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: r243488 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2012 12:46:08 -0000 Author: avg Date: Sat Nov 24 12:46:07 2012 New Revision: 243488 URL: http://svnweb.freebsd.org/changeset/base/243488 Log: MFC r242571: zfs_vnode_forget: dispose of larvae vnode using public vfs api (mostly) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sat Nov 24 12:44:25 2012 (r243487) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sat Nov 24 12:46:07 2012 (r243488) @@ -632,12 +632,11 @@ static void zfs_vnode_forget(vnode_t *vp) { - VOP_UNLOCK(vp, 0); - VI_LOCK(vp); - vp->v_usecount--; - vp->v_iflag |= VI_DOOMED; + /* copied from insmntque_stddtr */ vp->v_data = NULL; - vdropl(vp); + vp->v_op = &dead_vnodeops; + vgone(vp); + vput(vp); } /* From owner-svn-src-stable@FreeBSD.ORG Sat Nov 24 12:51:58 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 071291C1; Sat, 24 Nov 2012 12:51:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DF9EC8FC13; Sat, 24 Nov 2012 12:51:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOCpvEo053761; Sat, 24 Nov 2012 12:51:57 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOCpv2i053760; Sat, 24 Nov 2012 12:51:57 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241251.qAOCpv2i053760@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 12:51:57 +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: r243489 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2012 12:51:58 -0000 Author: avg Date: Sat Nov 24 12:51:57 2012 New Revision: 243489 URL: http://svnweb.freebsd.org/changeset/base/243489 Log: MFC r225153: We need to unlock and destroy vnode attached to znode which we are freeing. MFC slacker: pjd Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sat Nov 24 12:46:07 2012 (r243488) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sat Nov 24 12:51:57 2012 (r243489) @@ -628,6 +628,18 @@ zfs_znode_dmu_fini(znode_t *zp) zp->z_sa_hdl = NULL; } +static void +zfs_vnode_forget(vnode_t *vp) +{ + + VOP_UNLOCK(vp, 0); + VI_LOCK(vp); + vp->v_usecount--; + vp->v_iflag |= VI_DOOMED; + vp->v_data = NULL; + vdropl(vp); +} + /* * Construct a new znode/vnode and intialize. * @@ -689,6 +701,8 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_bu if (sa_bulk_lookup(zp->z_sa_hdl, bulk, count) != 0 || zp->z_gen == 0) { if (hdl == NULL) sa_handle_destroy(zp->z_sa_hdl); + zfs_vnode_forget(vp); + zp->z_vnode = NULL; kmem_cache_free(znode_cache, zp); return (NULL); } From owner-svn-src-stable@FreeBSD.ORG Sat Nov 24 12:53:39 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7BCFF523; Sat, 24 Nov 2012 12:53:39 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 609508FC08; Sat, 24 Nov 2012 12:53:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOCrdDG054097; Sat, 24 Nov 2012 12:53:39 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOCrdec054096; Sat, 24 Nov 2012 12:53:39 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241253.qAOCrdec054096@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 12:53:39 +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: r243490 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2012 12:53:39 -0000 Author: avg Date: Sat Nov 24 12:53:38 2012 New Revision: 243490 URL: http://svnweb.freebsd.org/changeset/base/243490 Log: MFC r242571: zfs_vnode_forget: dispose of larvae vnode using public vfs api (mostly) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sat Nov 24 12:51:57 2012 (r243489) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Sat Nov 24 12:53:38 2012 (r243490) @@ -632,12 +632,11 @@ static void zfs_vnode_forget(vnode_t *vp) { - VOP_UNLOCK(vp, 0); - VI_LOCK(vp); - vp->v_usecount--; - vp->v_iflag |= VI_DOOMED; + /* copied from insmntque_stddtr */ vp->v_data = NULL; - vdropl(vp); + vp->v_op = &dead_vnodeops; + vgone(vp); + vput(vp); } /* From owner-svn-src-stable@FreeBSD.ORG Sat Nov 24 12:56:08 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4F1E786E; Sat, 24 Nov 2012 12:56:08 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 33C808FC12; Sat, 24 Nov 2012 12:56:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOCu85r054593; Sat, 24 Nov 2012 12:56:08 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOCu8lN054592; Sat, 24 Nov 2012 12:56:08 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241256.qAOCu8lN054592@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 12:56:08 +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: r243491 - stable/9/sys/cddl/compat/opensolaris/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-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2012 12:56:08 -0000 Author: avg Date: Sat Nov 24 12:56:07 2012 New Revision: 243491 URL: http://svnweb.freebsd.org/changeset/base/243491 Log: MFC r242572: opensolaris compat: clear VI_MOUNT before returning if mount_snapshot fails Modified: stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c ============================================================================== --- stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Sat Nov 24 12:53:38 2012 (r243490) +++ stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Sat Nov 24 12:56:07 2012 (r243491) @@ -191,6 +191,9 @@ mount_snapshot(kthread_t *td, vnode_t ** td->td_ucred = cr; if (error != 0) { + VI_LOCK(vp); + vp->v_iflag &= ~VI_MOUNT; + VI_UNLOCK(vp); vrele(vp); vfs_unbusy(mp); vfs_mount_destroy(mp); From owner-svn-src-stable@FreeBSD.ORG Sat Nov 24 12:56:21 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9A0119DC; Sat, 24 Nov 2012 12:56:21 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7F94E8FC15; Sat, 24 Nov 2012 12:56:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOCuLS0054673; Sat, 24 Nov 2012 12:56:21 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOCuLt9054672; Sat, 24 Nov 2012 12:56:21 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241256.qAOCuLt9054672@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 12:56:21 +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: r243492 - stable/8/sys/cddl/compat/opensolaris/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2012 12:56:21 -0000 Author: avg Date: Sat Nov 24 12:56:21 2012 New Revision: 243492 URL: http://svnweb.freebsd.org/changeset/base/243492 Log: MFC r242572: opensolaris compat: clear VI_MOUNT before returning if mount_snapshot fails Modified: stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) Modified: stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c ============================================================================== --- stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Sat Nov 24 12:56:07 2012 (r243491) +++ stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Sat Nov 24 12:56:21 2012 (r243492) @@ -191,6 +191,9 @@ mount_snapshot(kthread_t *td, vnode_t ** td->td_ucred = cr; if (error != 0) { + VI_LOCK(vp); + vp->v_iflag &= ~VI_MOUNT; + VI_UNLOCK(vp); vrele(vp); vfs_unbusy(mp); vfs_mount_destroy(mp); From owner-svn-src-stable@FreeBSD.ORG Sat Nov 24 12:58:51 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8701AC50; Sat, 24 Nov 2012 12:58:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6ACC18FC12; Sat, 24 Nov 2012 12:58:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOCwpPJ055161; Sat, 24 Nov 2012 12:58:51 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOCwpES055160; Sat, 24 Nov 2012 12:58:51 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241258.qAOCwpES055160@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 12:58:51 +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: r243493 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2012 12:58:51 -0000 Author: avg Date: Sat Nov 24 12:58:51 2012 New Revision: 243493 URL: http://svnweb.freebsd.org/changeset/base/243493 Log: MFC r242573: zfs: set MNTK_EXTENDED_SHARED flag Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Nov 24 12:56:21 2012 (r243492) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Nov 24 12:58:51 2012 (r243493) @@ -1119,6 +1119,7 @@ zfs_domount(vfs_t *vfsp, char *osname) vfsp->mnt_kern_flag |= MNTK_MPSAFE; vfsp->mnt_kern_flag |= MNTK_LOOKUP_SHARED; vfsp->mnt_kern_flag |= MNTK_SHARED_WRITES; + vfsp->mnt_kern_flag |= MNTK_EXTENDED_SHARED; /* * The fsid is 64 bits, composed of an 8-bit fs type, which From owner-svn-src-stable@FreeBSD.ORG Sat Nov 24 12:59:03 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 072FBD5E; Sat, 24 Nov 2012 12:59:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E01498FC13; Sat, 24 Nov 2012 12:59:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOCx2Q5055251; Sat, 24 Nov 2012 12:59:02 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOCx2AA055250; Sat, 24 Nov 2012 12:59:02 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241259.qAOCx2AA055250@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 12:59:02 +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: r243494 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2012 12:59:03 -0000 Author: avg Date: Sat Nov 24 12:59:02 2012 New Revision: 243494 URL: http://svnweb.freebsd.org/changeset/base/243494 Log: MFC r242573: zfs: set MNTK_EXTENDED_SHARED flag Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Nov 24 12:58:51 2012 (r243493) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sat Nov 24 12:59:02 2012 (r243494) @@ -1118,6 +1118,7 @@ zfs_domount(vfs_t *vfsp, char *osname) vfsp->mnt_kern_flag |= MNTK_MPSAFE; vfsp->mnt_kern_flag |= MNTK_LOOKUP_SHARED; vfsp->mnt_kern_flag |= MNTK_SHARED_WRITES; + vfsp->mnt_kern_flag |= MNTK_EXTENDED_SHARED; /* * The fsid is 64 bits, composed of an 8-bit fs type, which From owner-svn-src-stable@FreeBSD.ORG Sat Nov 24 13:00:42 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 20DFAF2F; Sat, 24 Nov 2012 13:00:42 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 052058FC13; Sat, 24 Nov 2012 13:00:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOD0fK0055612; Sat, 24 Nov 2012 13:00:41 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOD0fUf055611; Sat, 24 Nov 2012 13:00:41 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241300.qAOD0fUf055611@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 13:00:41 +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: r243495 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2012 13:00:42 -0000 Author: avg Date: Sat Nov 24 13:00:41 2012 New Revision: 243495 URL: http://svnweb.freebsd.org/changeset/base/243495 Log: MFC r242574: zfsctl_snapdir_lookup: obtain a snapname in the remount case Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Sat Nov 24 12:59:02 2012 (r243494) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Sat Nov 24 13:00:41 2012 (r243495) @@ -1002,6 +1002,7 @@ zfsctl_snapdir_lookup(ap) * The snapshot was unmounted behind our backs, * try to remount it. */ + VERIFY(zfsctl_snapshot_zname(dvp, nm, MAXNAMELEN, snapname) == 0); goto domount; } else { /* From owner-svn-src-stable@FreeBSD.ORG Sat Nov 24 13:00:58 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2045DC4; Sat, 24 Nov 2012 13:00:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 03F4E8FC13; Sat, 24 Nov 2012 13:00:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qAOD0vrx055709; Sat, 24 Nov 2012 13:00:57 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qAOD0vCT055708; Sat, 24 Nov 2012 13:00:57 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201211241300.qAOD0vCT055708@svn.freebsd.org> From: Andriy Gapon Date: Sat, 24 Nov 2012 13:00:57 +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: r243496 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2012 13:00:58 -0000 Author: avg Date: Sat Nov 24 13:00:57 2012 New Revision: 243496 URL: http://svnweb.freebsd.org/changeset/base/243496 Log: MFC r242574: zfsctl_snapdir_lookup: obtain a snapname in the remount case Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Sat Nov 24 13:00:41 2012 (r243495) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Sat Nov 24 13:00:57 2012 (r243496) @@ -1002,6 +1002,7 @@ zfsctl_snapdir_lookup(ap) * The snapshot was unmounted behind our backs, * try to remount it. */ + VERIFY(zfsctl_snapshot_zname(dvp, nm, MAXNAMELEN, snapname) == 0); goto domount; } else { /* From owner-svn-src-stable@FreeBSD.ORG Sat Nov 24 14:02:46 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 78395983; Sat, 24 Nov 2012 14:02:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) by mx1.freebsd.org (Postfix) with ESMTP id 2832D8FC14; Sat, 24 Nov 2012 14:02:45 +0000 (UTC) Received: from [192.168.0.6] (spaceball.home.andric.com [192.168.0.6]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id E96415C37; Sat, 24 Nov 2012 15:02:43 +0100 (CET) Message-ID: <50B0D38B.3020605@FreeBSD.org> Date: Sat, 24 Nov 2012 15:02:51 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Ed Schouten Subject: Re: svn commit: r243405 - in stable/9: include lib/libc/stdlib References: <201211221519.qAMFJroe007462@svn.freebsd.org> In-Reply-To: <201211221519.qAMFJroe007462@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2012 14:02:46 -0000 On 2012-11-22 16:19, Ed Schouten wrote: > Author: ed > Date: Thu Nov 22 15:19:53 2012 > New Revision: 243405 > URL: http://svnweb.freebsd.org/changeset/base/243405 > > Log: > MFC r229848: > > Add aligned_alloc(3). > > The C11 folks reinvented the wheel by introducing an aligned version of > malloc(3) called aligned_alloc(3), instead of posix_memalign(3). Instead > of returning the allocation by reference, it returns the address, just > like malloc(3). > > I'm MFCing this now, as it seems aligned_alloc(3) is needed to make the > new version of libc++ work, which was merged back to FreeBSD 9 in r243376. > > Requested by: dim Thanks!