From owner-svn-src-head@FreeBSD.ORG Sun Jul 17 01:23:50 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C20C0106566B; Sun, 17 Jul 2011 01:23:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 98C178FC18; Sun, 17 Jul 2011 01:23:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6H1NoZi052065; Sun, 17 Jul 2011 01:23:50 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6H1Novg052062; Sun, 17 Jul 2011 01:23:50 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201107170123.p6H1Novg052062@svn.freebsd.org> From: John Baldwin Date: Sun, 17 Jul 2011 01:23:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224120 - in head/sys: conf i386/xen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2011 01:23:50 -0000 Author: jhb Date: Sun Jul 17 01:23:50 2011 New Revision: 224120 URL: http://svn.freebsd.org/changeset/base/224120 Log: Don't include mptable_pci.c in Xen kernels. It is only meant for systems that truly have an MPTable. The MPTable code in Xen is really a Xen specific CPU enumerator and probably shouldn't be using the mptable name at all. Modified: head/sys/conf/files.i386 head/sys/i386/xen/mptable.c Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Sat Jul 16 22:01:18 2011 (r224119) +++ head/sys/conf/files.i386 Sun Jul 17 01:23:50 2011 (r224120) @@ -412,7 +412,7 @@ x86/x86/io_apic.c optional apic x86/x86/local_apic.c optional apic x86/x86/mca.c standard x86/x86/mptable.c optional apic native -x86/x86/mptable_pci.c optional apic pci +x86/x86/mptable_pci.c optional apic native pci x86/x86/msi.c optional apic pci x86/x86/nexus.c standard x86/x86/tsc.c standard Modified: head/sys/i386/xen/mptable.c ============================================================================== --- head/sys/i386/xen/mptable.c Sat Jul 16 22:01:18 2011 (r224119) +++ head/sys/i386/xen/mptable.c Sun Jul 17 01:23:50 2011 (r224120) @@ -28,29 +28,16 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include -#include -#ifdef NEW_PCIB -#include -#endif #include #include #include -#ifdef NEW_PCIB -#include -#include -#endif -#include -#include #include #include #include -#include -#include #include #include @@ -118,20 +105,3 @@ mptable_register(void *dummy __unused) } SYSINIT(mptable_register, SI_SUB_TUNABLES - 1, SI_ORDER_FIRST, mptable_register, NULL); - - - -int -mptable_pci_probe_table(int bus) -{ - - return (0); -} - -int -mptable_pci_route_interrupt(device_t pcib, device_t dev, int pin) -{ - - return (0); -} - From owner-svn-src-head@FreeBSD.ORG Sun Jul 17 03:44:06 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 496DA106564A; Sun, 17 Jul 2011 03:44:06 +0000 (UTC) (envelope-from zack@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1FC318FC0C; Sun, 17 Jul 2011 03:44:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6H3i6HH056417; Sun, 17 Jul 2011 03:44:06 GMT (envelope-from zack@svn.freebsd.org) Received: (from zack@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6H3i5S5056414; Sun, 17 Jul 2011 03:44:05 GMT (envelope-from zack@svn.freebsd.org) Message-Id: <201107170344.p6H3i5S5056414@svn.freebsd.org> From: Zack Kirsch Date: Sun, 17 Jul 2011 03:44:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224121 - head/sys/fs/nfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2011 03:44:06 -0000 Author: zack Date: Sun Jul 17 03:44:05 2011 New Revision: 224121 URL: http://svn.freebsd.org/changeset/base/224121 Log: Revert revision 224079 as Rick pointed out that I would be calling VOP_PATHCONF without the vnode lock held. Implicitly approved by: zml (mentor) Modified: head/sys/fs/nfs/nfs_commonport.c head/sys/fs/nfs/nfs_commonsubs.c Modified: head/sys/fs/nfs/nfs_commonport.c ============================================================================== --- head/sys/fs/nfs/nfs_commonport.c Sun Jul 17 01:23:50 2011 (r224120) +++ head/sys/fs/nfs/nfs_commonport.c Sun Jul 17 03:44:05 2011 (r224121) @@ -554,7 +554,7 @@ nfs_supportsnfsv4acls(struct vnode *vp) if (nfsrv_useacl == 0) return (0); - error = nfsvno_pathconf(vp, _PC_ACL_NFS4, &retval, NULL, NULL); + error = VOP_PATHCONF(vp, _PC_ACL_NFS4, &retval); if (error == 0 && retval != 0) return (1); return (0); Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Sun Jul 17 01:23:50 2011 (r224120) +++ head/sys/fs/nfs/nfs_commonsubs.c Sun Jul 17 03:44:05 2011 (r224121) @@ -795,7 +795,6 @@ nfsv4_loadattr(struct nfsrv_descript *nd struct dqblk dqb; uid_t savuid; #endif - register_t chownres; if (compare) { retnotsup = 0; @@ -1038,7 +1037,8 @@ nfsv4_loadattr(struct nfsrv_descript *nd acl_free(naclp); goto nfsmout; } - if (aceerr || nfsrv_compareacl(aclp, naclp)) + if (aceerr || aclp == NULL || + nfsrv_compareacl(aclp, naclp)) *retcmpp = NFSERR_NOTSAME; acl_free(naclp); } else { @@ -1128,12 +1128,8 @@ nfsv4_loadattr(struct nfsrv_descript *nd NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); if (compare) { if (!(*retcmpp)) { - error = nfsvno_pathconf(vp, - _PC_CHOWN_RESTRICTED, &chownres, - nd->nd_cred, p); - if (*tl != (chownres != 0 ? - newnfs_true : newnfs_false)) - *retcmpp = NFSERR_NOTSAME; + if (*tl != newnfs_true) + *retcmpp = NFSERR_NOTSAME; } } else if (pc != NULL) { pc->pc_chownrestricted = @@ -1987,7 +1983,6 @@ nfsv4_fillattr(struct nfsrv_descript *nd struct dqblk dqb; uid_t savuid; #endif - register_t chownres; /* * First, set the bits that can be filled and get fsinfo. @@ -2167,9 +2162,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd break; case NFSATTRBIT_CHOWNRESTRICTED: NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); - error = nfsvno_pathconf(vp, _PC_CHOWN_RESTRICTED, - &chownres, nd->nd_cred, p); - *tl = (chownres ? newnfs_true : newnfs_false); + *tl = newnfs_true; retnum += NFSX_UNSIGNED; break; case NFSATTRBIT_FILEHANDLE: From owner-svn-src-head@FreeBSD.ORG Sun Jul 17 04:10:00 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8CB54106564A; Sun, 17 Jul 2011 04:10:00 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7308F8FC0A; Sun, 17 Jul 2011 04:10:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6H4A0Ns057356; Sun, 17 Jul 2011 04:10:00 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6H4A0W4057354; Sun, 17 Jul 2011 04:10:00 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201107170410.p6H4A0W4057354@svn.freebsd.org> From: Doug Barton Date: Sun, 17 Jul 2011 04:10:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224122 - head/usr.sbin/named X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2011 04:10:00 -0000 Author: dougb Date: Sun Jul 17 04:10:00 2011 New Revision: 224122 URL: http://svn.freebsd.org/changeset/base/224122 Log: Fix the location of the default pid file in named.8 Problem pointed out in the PR PR: conf/155006 Submitted by: Helmut Schneider Modified: head/usr.sbin/named/Makefile Modified: head/usr.sbin/named/Makefile ============================================================================== --- head/usr.sbin/named/Makefile Sun Jul 17 03:44:05 2011 (r224121) +++ head/usr.sbin/named/Makefile Sun Jul 17 04:10:00 2011 (r224122) @@ -57,7 +57,8 @@ LDADD+= ${BIND_LDADD} ${CRYPTO_LDADD} $ MAN= named.8 lwresd.8 named.conf.5 -MANFILTER= sed -e "s@/etc/named\.conf@/etc/namedb/named.conf@g" +MANFILTER= sed -e "s@/etc/named\.conf@/etc/namedb/named.conf@g" \ + -e "s@/var\/run\/named\/named.pid@/var/run/named/pid@" LINKS= ${BINDIR}/named ${BINDIR}/lwresd From owner-svn-src-head@FreeBSD.ORG Sun Jul 17 05:33:22 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6A18106564A; Sun, 17 Jul 2011 05:33:22 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A6E2F8FC08; Sun, 17 Jul 2011 05:33:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6H5XMfv059835; Sun, 17 Jul 2011 05:33:22 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6H5XMMB059833; Sun, 17 Jul 2011 05:33:22 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201107170533.p6H5XMMB059833@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 17 Jul 2011 05:33:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224123 - head/sys/compat/linux X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2011 05:33:22 -0000 Author: bz Date: Sun Jul 17 05:33:22 2011 New Revision: 224123 URL: http://svn.freebsd.org/changeset/base/224123 Log: Remove the 'either' from the comment as it'll be less obvious that we removed semmap in a bit of time from now. Re-wrap. Suggested by: jhb Modified: head/sys/compat/linux/linux_ipc.c Modified: head/sys/compat/linux/linux_ipc.c ============================================================================== --- head/sys/compat/linux/linux_ipc.c Sun Jul 17 04:10:00 2011 (r224122) +++ head/sys/compat/linux/linux_ipc.c Sun Jul 17 05:33:22 2011 (r224123) @@ -578,10 +578,10 @@ linux_semctl(struct thread *td, struct l bcopy(&seminfo, &linux_seminfo.semmni, sizeof(linux_seminfo) - sizeof(linux_seminfo.semmap) ); /* - * Linux does not use the semmap field either but populates it - * with the defined value from SEMMAP, which really is redefined - * to SEMMNS, which they define as SEMMNI * SEMMSL. - * Try to simulate this returning our dynamic semmns value. + * Linux does not use the semmap field but populates it with + * the defined value from SEMMAP, which really is redefined to + * SEMMNS, which they define as SEMMNI * SEMMSL. Try to + * simulate this returning our dynamic semmns value. */ linux_seminfo.semmap = linux_seminfo.semmns; /* XXX BSD equivalent? From owner-svn-src-head@FreeBSD.ORG Sun Jul 17 06:05:45 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2928E1065672; Sun, 17 Jul 2011 06:05:45 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19AAE8FC12; Sun, 17 Jul 2011 06:05:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6H65imO060795; Sun, 17 Jul 2011 06:05:44 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6H65iUg060793; Sun, 17 Jul 2011 06:05:44 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201107170605.p6H65iUg060793@svn.freebsd.org> From: Doug Barton Date: Sun, 17 Jul 2011 06:05:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224124 - head/etc/namedb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2011 06:05:45 -0000 Author: dougb Date: Sun Jul 17 06:05:44 2011 New Revision: 224124 URL: http://svn.freebsd.org/changeset/base/224124 Log: Pick up the 2011-06-08 update to this file, the addition of an IPv6 address for D. Modified: head/etc/namedb/named.root Modified: head/etc/namedb/named.root ============================================================================== --- head/etc/namedb/named.root Sun Jul 17 05:33:22 2011 (r224123) +++ head/etc/namedb/named.root Sun Jul 17 06:05:44 2011 (r224124) @@ -13,8 +13,8 @@ ; on server FTP.INTERNIC.NET ; -OR- RS.INTERNIC.NET ; -; last update: Jun 17, 2010 -; related version of root zone: 2010061700 +; last update: Jun 8, 2011 +; related version of root zone: 2011060800 ; ; formerly NS.INTERNIC.NET ; @@ -36,6 +36,7 @@ C.ROOT-SERVERS.NET. 3600000 A ; . 3600000 NS D.ROOT-SERVERS.NET. D.ROOT-SERVERS.NET. 3600000 A 128.8.10.90 +D.ROOT-SERVERS.NET. 3600000 AAAA 2001:500:2D::D ; ; FORMERLY NS.NASA.GOV ; From owner-svn-src-head@FreeBSD.ORG Sun Jul 17 06:20:48 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56E3E106566B; Sun, 17 Jul 2011 06:20:48 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3CD378FC08; Sun, 17 Jul 2011 06:20:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6H6KmMM061242; Sun, 17 Jul 2011 06:20:48 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6H6Kmnl061240; Sun, 17 Jul 2011 06:20:48 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201107170620.p6H6Kmnl061240@svn.freebsd.org> From: Doug Barton Date: Sun, 17 Jul 2011 06:20:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224125 - head/etc/namedb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2011 06:20:48 -0000 Author: dougb Date: Sun Jul 17 06:20:47 2011 New Revision: 224125 URL: http://svn.freebsd.org/changeset/base/224125 Log: Commemorate the release of RFC 6303 by updating the comments regarding our default empty zones. No functional changes. Modified: head/etc/namedb/named.conf Modified: head/etc/namedb/named.conf ============================================================================== --- head/etc/namedb/named.conf Sun Jul 17 06:05:44 2011 (r224124) +++ head/etc/namedb/named.conf Sun Jul 17 06:20:47 2011 (r224125) @@ -122,18 +122,18 @@ zone "arpa" { 1. Faster local resolution for your users 2. No spurious traffic will be sent from your network to the roots */ -// RFCs 1912 and 5735 (and BCP 32 for localhost) +// RFCs 1912, 5735 and 6303 (and BCP 32 for localhost) zone "localhost" { type master; file "/etc/namedb/master/localhost-forward.db"; }; zone "127.in-addr.arpa" { type master; file "/etc/namedb/master/localhost-reverse.db"; }; zone "255.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; -// RFC 1912-style zone for IPv6 localhost address +// RFC 1912-style zone for IPv6 localhost address (RFC 6303) zone "0.ip6.arpa" { type master; file "/etc/namedb/master/localhost-reverse.db"; }; -// "This" Network (RFCs 1912 and 5735) +// "This" Network (RFCs 1912, 5735 and 6303) zone "0.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; -// Private Use Networks (RFCs 1918 and 5735) +// Private Use Networks (RFCs 1918, 5735 and 6303) zone "10.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; zone "16.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; zone "17.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; @@ -153,18 +153,18 @@ zone "30.172.in-addr.arpa" { type master zone "31.172.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; zone "168.192.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; -// Link-local/APIPA (RFCs 3927 and 5735) +// Link-local/APIPA (RFCs 3927, 5735 and 6303) zone "254.169.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; // IETF protocol assignments (RFCs 5735 and 5736) zone "0.0.192.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; -// TEST-NET-[1-3] for Documentation (RFCs 5735 and 5737) +// TEST-NET-[1-3] for Documentation (RFCs 5735, 5737 and 6303) zone "2.0.192.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; zone "100.51.198.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; zone "113.0.203.in-addr.arpa" { type master; file "/etc/namedb/master/empty.db"; }; -// IPv6 Range for Documentation (RFC 3849) +// IPv6 Example Range for Documentation (RFCs 3849 and 6303) zone "8.b.d.0.1.0.0.2.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; // Domain Names for Documentation and Testing (BCP 32) @@ -231,17 +231,17 @@ zone "5.e.f.ip6.arpa" { type master; fil zone "6.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; zone "7.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; -// IPv6 ULA (RFC 4193) +// IPv6 ULA (RFCs 4193 and 6303) zone "c.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; zone "d.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; -// IPv6 Link Local (RFC 4291) +// IPv6 Link Local (RFCs 4291 and 6303) zone "8.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; zone "9.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; zone "a.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; zone "b.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; -// IPv6 Deprecated Site-Local Addresses (RFC 3879) +// IPv6 Deprecated Site-Local Addresses (RFCs 3879 and 6303) zone "c.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; zone "d.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; zone "e.e.f.ip6.arpa" { type master; file "/etc/namedb/master/empty.db"; }; From owner-svn-src-head@FreeBSD.ORG Sun Jul 17 08:19:20 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13424106564A; Sun, 17 Jul 2011 08:19:20 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 007588FC14; Sun, 17 Jul 2011 08:19:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6H8JJqb064867; Sun, 17 Jul 2011 08:19:19 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6H8JJYM064855; Sun, 17 Jul 2011 08:19:19 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201107170819.p6H8JJYM064855@svn.freebsd.org> From: Ed Schouten Date: Sun, 17 Jul 2011 08:19:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224126 - in head/sys: dev/adb dev/atkbdc dev/kbd dev/kbdmux dev/syscons dev/uart dev/usb/input dev/vkbd i386/ibcs2 pc98/cbus sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2011 08:19:20 -0000 Author: ed Date: Sun Jul 17 08:19:19 2011 New Revision: 224126 URL: http://svn.freebsd.org/changeset/base/224126 Log: Restore binary compatibility for GIO_KEYMAP and PIO_KEYMAP. Back in 2009 I changed the ABI of the GIO_KEYMAP and PIO_KEYMAP ioctls to support wide characters. I created a patch to add ABI compatibility for the old calls, but I didn't get any feedback to that. It seems now people are upgrading from 8 to 9 they experience this issue, so add it anyway. Modified: head/sys/dev/adb/adb_kbd.c head/sys/dev/atkbdc/atkbd.c head/sys/dev/kbd/kbd.c head/sys/dev/kbdmux/kbdmux.c head/sys/dev/syscons/syscons.c head/sys/dev/uart/uart_kbd_sun.c head/sys/dev/usb/input/ukbd.c head/sys/dev/vkbd/vkbd.c head/sys/i386/ibcs2/ibcs2_ioctl.c head/sys/pc98/cbus/pckbd.c head/sys/sys/kbio.h Modified: head/sys/dev/adb/adb_kbd.c ============================================================================== --- head/sys/dev/adb/adb_kbd.c Sun Jul 17 06:20:47 2011 (r224125) +++ head/sys/dev/adb/adb_kbd.c Sun Jul 17 08:19:19 2011 (r224126) @@ -747,6 +747,7 @@ static int akbd_ioctl(keyboard_t *kbd, u break; case PIO_KEYMAP: + case OPIO_KEYMAP: case PIO_KEYMAPENT: case PIO_DEADKEYMAP: default: Modified: head/sys/dev/atkbdc/atkbd.c ============================================================================== --- head/sys/dev/atkbdc/atkbd.c Sun Jul 17 06:20:47 2011 (r224125) +++ head/sys/dev/atkbdc/atkbd.c Sun Jul 17 08:19:19 2011 (r224126) @@ -982,6 +982,7 @@ atkbd_ioctl(keyboard_t *kbd, u_long cmd, return error; case PIO_KEYMAP: /* set keyboard translation table */ + case OPIO_KEYMAP: /* set keyboard translation table (compat) */ case PIO_KEYMAPENT: /* set keyboard translation table entry */ case PIO_DEADKEYMAP: /* set accent key translation table */ state->ks_accents = 0; Modified: head/sys/dev/kbd/kbd.c ============================================================================== --- head/sys/dev/kbd/kbd.c Sun Jul 17 06:20:47 2011 (r224125) +++ head/sys/dev/kbd/kbd.c Sun Jul 17 08:19:19 2011 (r224126) @@ -837,13 +837,12 @@ static int fkey_change_ok(fkeytab_t *, f int genkbd_commonioctl(keyboard_t *kbd, u_long cmd, caddr_t arg) { -#ifndef KBD_DISABLE_KEYMAP_LOAD keymap_t *mapp; -#endif + okeymap_t *omapp; keyarg_t *keyp; fkeyarg_t *fkeyp; int s; - int i; + int i, j; int error; s = spltty(); @@ -874,14 +873,39 @@ genkbd_commonioctl(keyboard_t *kbd, u_lo sizeof(keymap_t)); splx(s); return (error); + case OGIO_KEYMAP: /* get keyboard translation table (compat) */ + mapp = kbd->kb_keymap; + omapp = (okeymap_t *)arg; + omapp->n_keys = mapp->n_keys; + for (i = 0; i < NUM_KEYS; i++) { + for (j = 0; j < NUM_STATES; j++) + omapp->key[i].map[j] = + mapp->key[i].map[j]; + omapp->key[i].spcl = mapp->key[i].spcl; + omapp->key[i].flgs = mapp->key[i].flgs; + } + return (0); case PIO_KEYMAP: /* set keyboard translation table */ + case OPIO_KEYMAP: /* set keyboard translation table (compat) */ #ifndef KBD_DISABLE_KEYMAP_LOAD mapp = malloc(sizeof *mapp, M_TEMP, M_NOWAIT); - error = copyin(*(void **)arg, mapp, sizeof *mapp); - if (error != 0) { - splx(s); - free(mapp, M_TEMP); - return (error); + if (cmd == OPIO_KEYMAP) { + omapp = (okeymap_t *)arg; + mapp->n_keys = omapp->n_keys; + for (i = 0; i < NUM_KEYS; i++) { + for (j = 0; j < NUM_STATES; j++) + mapp->key[i].map[j] = + omapp->key[i].map[j]; + mapp->key[i].spcl = omapp->key[i].spcl; + mapp->key[i].flgs = omapp->key[i].flgs; + } + } else { + error = copyin(*(void **)arg, mapp, sizeof *mapp); + if (error != 0) { + splx(s); + free(mapp, M_TEMP); + return (error); + } } error = keymap_change_ok(kbd->kb_keymap, mapp, curthread); Modified: head/sys/dev/kbdmux/kbdmux.c ============================================================================== --- head/sys/dev/kbdmux/kbdmux.c Sun Jul 17 06:20:47 2011 (r224125) +++ head/sys/dev/kbdmux/kbdmux.c Sun Jul 17 08:19:19 2011 (r224126) @@ -1198,6 +1198,7 @@ kbdmux_ioctl(keyboard_t *kbd, u_long cmd break; case PIO_KEYMAP: /* set keyboard translation table */ + case OPIO_KEYMAP: /* set keyboard translation table (compat) */ case PIO_KEYMAPENT: /* set keyboard translation table entry */ case PIO_DEADKEYMAP: /* set accent key translation table */ KBDMUX_LOCK(state); Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Sun Jul 17 06:20:47 2011 (r224125) +++ head/sys/dev/syscons/syscons.c Sun Jul 17 08:19:19 2011 (r224126) @@ -1450,6 +1450,8 @@ sctty_ioctl(struct tty *tp, u_long cmd, case GIO_KEYMAP: /* get keyboard translation table */ case PIO_KEYMAP: /* set keyboard translation table */ + case OGIO_KEYMAP: /* get keyboard translation table (compat) */ + case OPIO_KEYMAP: /* set keyboard translation table (compat) */ case GIO_DEADKEYMAP: /* get accent key translation table */ case PIO_DEADKEYMAP: /* set accent key translation table */ case GETFKEY: /* get function key string */ Modified: head/sys/dev/uart/uart_kbd_sun.c ============================================================================== --- head/sys/dev/uart/uart_kbd_sun.c Sun Jul 17 06:20:47 2011 (r224125) +++ head/sys/dev/uart/uart_kbd_sun.c Sun Jul 17 08:19:19 2011 (r224126) @@ -739,6 +739,7 @@ sunkbd_ioctl(keyboard_t *kbd, u_long cmd case KDSETRAD: break; case PIO_KEYMAP: + case OPIO_KEYMAP: case PIO_KEYMAPENT: case PIO_DEADKEYMAP: default: Modified: head/sys/dev/usb/input/ukbd.c ============================================================================== --- head/sys/dev/usb/input/ukbd.c Sun Jul 17 06:20:47 2011 (r224125) +++ head/sys/dev/usb/input/ukbd.c Sun Jul 17 08:19:19 2011 (r224126) @@ -1929,6 +1929,8 @@ ukbd_ioctl(keyboard_t *kbd, u_long cmd, return (ukbd_set_typematic(kbd, *(int *)arg)); case PIO_KEYMAP: /* set keyboard translation table */ + case OPIO_KEYMAP: /* set keyboard translation table + * (compat) */ case PIO_KEYMAPENT: /* set keyboard translation table * entry */ case PIO_DEADKEYMAP: /* set accent key translation table */ Modified: head/sys/dev/vkbd/vkbd.c ============================================================================== --- head/sys/dev/vkbd/vkbd.c Sun Jul 17 06:20:47 2011 (r224125) +++ head/sys/dev/vkbd/vkbd.c Sun Jul 17 08:19:19 2011 (r224126) @@ -1208,6 +1208,7 @@ vkbd_ioctl(keyboard_t *kbd, u_long cmd, break; case PIO_KEYMAP: /* set keyboard translation table */ + case OPIO_KEYMAP: /* set keyboard translation table (compat) */ case PIO_KEYMAPENT: /* set keyboard translation table entry */ case PIO_DEADKEYMAP: /* set accent key translation table */ state->ks_accents = 0; Modified: head/sys/i386/ibcs2/ibcs2_ioctl.c ============================================================================== --- head/sys/i386/ibcs2/ibcs2_ioctl.c Sun Jul 17 06:20:47 2011 (r224125) +++ head/sys/i386/ibcs2/ibcs2_ioctl.c Sun Jul 17 08:19:19 2011 (r224126) @@ -654,12 +654,12 @@ ibcs2_ioctl(td, uap) break; case IBCS2_GIO_KEYMAP: /* Get keyboard map table */ - uap->cmd = GIO_KEYMAP; + uap->cmd = OGIO_KEYMAP; error = ioctl(td, (struct ioctl_args *)uap); break; case IBCS2_PIO_KEYMAP: /* Set keyboard map table */ - uap->cmd = PIO_KEYMAP; + uap->cmd = OPIO_KEYMAP; error = ioctl(td, (struct ioctl_args *)uap); break; Modified: head/sys/pc98/cbus/pckbd.c ============================================================================== --- head/sys/pc98/cbus/pckbd.c Sun Jul 17 06:20:47 2011 (r224125) +++ head/sys/pc98/cbus/pckbd.c Sun Jul 17 08:19:19 2011 (r224126) @@ -799,6 +799,7 @@ pckbd_ioctl(keyboard_t *kbd, u_long cmd, break; case PIO_KEYMAP: /* set keyboard translation table */ + case OPIO_KEYMAP: /* set keyboard translation table (compat) */ case PIO_KEYMAPENT: /* set keyboard translation table entry */ case PIO_DEADKEYMAP: /* set accent key translation table */ state->ks_accents = 0; Modified: head/sys/sys/kbio.h ============================================================================== --- head/sys/sys/kbio.h Sun Jul 17 06:20:47 2011 (r224125) +++ head/sys/sys/kbio.h Sun Jul 17 08:19:19 2011 (r224126) @@ -120,6 +120,20 @@ struct keymap { }; typedef struct keymap keymap_t; +#ifdef _KERNEL +struct okeyent_t { + u_char map[NUM_STATES]; + u_char spcl; + u_char flgs; +}; + +struct okeymap { + u_short n_keys; + struct okeyent_t key[NUM_KEYS]; +}; +typedef struct okeymap okeymap_t; +#endif /* _KERNEL */ + #endif /* !_KEYMAP_DECLARED */ /* defines for "special" keys (spcl bit set in keymap) */ @@ -223,6 +237,10 @@ typedef struct fkeyarg fkeyarg_t; /* XXX: Should have keymap_t as an argument, but that's too big for ioctl()! */ #define GIO_KEYMAP _IO('k', 6) #define PIO_KEYMAP _IO('k', 7) +#ifdef _KERNEL +#define OGIO_KEYMAP _IOR('k', 6, okeymap_t) +#define OPIO_KEYMAP _IOW('k', 7, okeymap_t) +#endif /* _KERNEL */ #define GIO_DEADKEYMAP _IOR('k', 8, accentmap_t) #define PIO_DEADKEYMAP _IOW('k', 9, accentmap_t) #define GIO_KEYMAPENT _IOWR('k', 10, keyarg_t) From owner-svn-src-head@FreeBSD.ORG Sun Jul 17 09:49:44 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A1DD1065672; Sun, 17 Jul 2011 09:49:44 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 8BF198FC08; Sun, 17 Jul 2011 09:49:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id p6H9nf93003558; Sun, 17 Jul 2011 13:49:41 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id p6H9nfKI003557; Sun, 17 Jul 2011 13:49:41 +0400 (MSK) (envelope-from ache) Date: Sun, 17 Jul 2011 13:49:40 +0400 From: Andrey Chernov To: Doug Barton Message-ID: <20110717094940.GA3503@vniz.net> Mail-Followup-To: Andrey Chernov , Doug Barton , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201107170410.p6H4A0W4057354@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201107170410.p6H4A0W4057354@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r224122 - head/usr.sbin/named X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2011 09:49:44 -0000 On Sun, Jul 17, 2011 at 04:10:00AM +0000, Doug Barton wrote: > Author: dougb > Date: Sun Jul 17 04:10:00 2011 > New Revision: 224122 > URL: http://svn.freebsd.org/changeset/base/224122 > > Log: > Fix the location of the default pid file in named.8 There something wrong now with another default or missing file. I got named[3322]: managed-keys-zone ./IN: loading from master file managed-keys.bind failed: file not found on every named start, unless I manually issue touch /var/named/etc/namedb/working/managed-keys.bind and I am not sure it is 100% correct solution. -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Sun Jul 17 10:42:58 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 554791065673; Sun, 17 Jul 2011 10:42:58 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 65-241-43-4.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 9B86914F76B; Sun, 17 Jul 2011 10:42:57 +0000 (UTC) Message-ID: <4E22BCB1.3050804@FreeBSD.org> Date: Sun, 17 Jul 2011 03:42:57 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:5.0) Gecko/20110706 Thunderbird/5.0 MIME-Version: 1.0 To: Andrey Chernov , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201107170410.p6H4A0W4057354@svn.freebsd.org> <20110717094940.GA3503@vniz.net> In-Reply-To: <20110717094940.GA3503@vniz.net> X-Enigmail-Version: 1.2pre OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Subject: Re: svn commit: r224122 - head/usr.sbin/named X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2011 10:42:58 -0000 On 07/17/2011 02:49, Andrey Chernov wrote: > There something wrong now with another default or missing file. > I got > named[3322]: managed-keys-zone ./IN: loading from master file managed-keys.bind failed: file not found > on every named start, unless I manually issue > touch /var/named/etc/namedb/working/managed-keys.bind > and I am not sure it is 100% correct solution. That'll silence the warning, and is harmless. I'm more interested in why you're getting the error, since I can't reproduce it. How are you starting named? Are you using the rc.d script? If so, what options do you have in rc.conf? Can the bind user write to /etc/namedb/working? Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Sun Jul 17 11:03:16 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EA89106566C; Sun, 17 Jul 2011 11:03:16 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id BE5168FC14; Sun, 17 Jul 2011 11:03:15 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id p6HB3EN2010987; Sun, 17 Jul 2011 15:03:14 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id p6HB3EnQ010986; Sun, 17 Jul 2011 15:03:14 +0400 (MSK) (envelope-from ache) Date: Sun, 17 Jul 2011 15:03:14 +0400 From: Andrey Chernov To: Doug Barton Message-ID: <20110717110314.GA10943@vniz.net> Mail-Followup-To: Andrey Chernov , Doug Barton , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201107170410.p6H4A0W4057354@svn.freebsd.org> <20110717094940.GA3503@vniz.net> <4E22BCB1.3050804@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4E22BCB1.3050804@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r224122 - head/usr.sbin/named X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2011 11:03:16 -0000 On Sun, Jul 17, 2011 at 03:42:57AM -0700, Doug Barton wrote: > On 07/17/2011 02:49, Andrey Chernov wrote: > > > There something wrong now with another default or missing file. > > I got > > named[3322]: managed-keys-zone ./IN: loading from master file managed-keys.bind failed: file not found > > on every named start, unless I manually issue > > touch /var/named/etc/namedb/working/managed-keys.bind > > and I am not sure it is 100% correct solution. > > That'll silence the warning, and is harmless. I'm more interested in why > you're getting the error, since I can't reproduce it. > > How are you starting named? Are you using the rc.d script? If so, what > options do you have in rc.conf? Can the bind user write to > /etc/namedb/working? It starts to happen only after recent update. Yes, I use rc.d script without any additional options, only named_enable="YES". Yes, bind is owner of 'working' and able to write there. No I don't use any DNSSEC (for which managed-keys-zone is, as I assume). -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Sun Jul 17 12:07:22 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FEFC106566C; Sun, 17 Jul 2011 12:07:22 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 902468FC13; Sun, 17 Jul 2011 12:07:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6HC7MjY072889; Sun, 17 Jul 2011 12:07:22 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6HC7M3F072887; Sun, 17 Jul 2011 12:07:22 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201107171207.p6HC7M3F072887@svn.freebsd.org> From: Doug Barton Date: Sun, 17 Jul 2011 12:07:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224129 - head/lib/bind X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2011 12:07:22 -0000 Author: dougb Date: Sun Jul 17 12:07:22 2011 New Revision: 224129 URL: http://svn.freebsd.org/changeset/base/224129 Log: Fixes to make the WITH_BIND_LIBS option functional with BIND 9.8.x Modified: head/lib/bind/config.mk Modified: head/lib/bind/config.mk ============================================================================== --- head/lib/bind/config.mk Sun Jul 17 11:24:34 2011 (r224128) +++ head/lib/bind/config.mk Sun Jul 17 12:07:22 2011 (r224129) @@ -107,6 +107,13 @@ BIND_DPADD= ${LIBBIND9} ${LIBDNS} ${LIBI ${LIBISC} ${LIBLWRES} .if ${MK_BIND_LIBS} != "no" BIND_LDADD= -lbind9 -ldns -lisccc -lisccfg -lisc -llwres +CFLAGS+= -I${BIND_DIR}/lib/isc/include +CFLAGS+= -I${BIND_DIR}/lib/isc/unix/include +CFLAGS+= -I${BIND_DIR}/lib/isc/pthreads/include +CFLAGS+= -I${.CURDIR}/../dns +CFLAGS+= -I${BIND_DIR}/lib/dns/include +CFLAGS+= -I${BIND_DIR}/lib/isccfg/include +CFLAGS+= -I${.CURDIR}/../isc .else BIND_LDADD= ${BIND_DPADD} .endif @@ -121,8 +128,7 @@ CRYPTO_LDADD= -lcrypto CFLAGS+= -DHAVE_LIBXML2 CFLAGS+= -I/usr/local/include -I/usr/local/include/libxml2 .if ${MK_BIND_LIBS} != "no" -CFLAGS+= -L/usr/local/lib -BIND_LDADD+= -lxml2 -lz -liconv -lm +BIND_LDADD+= -L/usr/local/lib -lxml2 -lz -liconv -lm .else BIND_DPADD+= /usr/local/lib/libxml2.a ${LIBZ} BIND_DPADD+= /usr/local/lib/libiconv.a ${LIBM} From owner-svn-src-head@FreeBSD.ORG Sun Jul 17 12:35:13 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E29B01065673; Sun, 17 Jul 2011 12:35:13 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id B874F8FC17; Sun, 17 Jul 2011 12:35:13 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 6BB6346B0A; Sun, 17 Jul 2011 08:35:13 -0400 (EDT) Received: from kavik.baldwin.cx (c-68-36-150-83.hsd1.nj.comcast.net [68.36.150.83]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 3C3A38A02C; Sun, 17 Jul 2011 08:35:11 -0400 (EDT) From: John Baldwin To: Ed Schouten Date: Sun, 17 Jul 2011 08:35:09 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-RELEASE-p2; KDE/4.5.5; i386; ; ) References: <201107170819.p6H8JJYM064855@svn.freebsd.org> In-Reply-To: <201107170819.p6H8JJYM064855@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201107170835.09767.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Sun, 17 Jul 2011 08:35:13 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r224126 - in head/sys: dev/adb dev/atkbdc dev/kbd dev/kbdmux dev/syscons dev/uart dev/usb/input dev/vkbd i386/ibcs2 pc98/cbus sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2011 12:35:14 -0000 On Sunday, July 17, 2011 04:19:19 am Ed Schouten wrote: > Author: ed > Date: Sun Jul 17 08:19:19 2011 > New Revision: 224126 > URL: http://svn.freebsd.org/changeset/base/224126 > > Log: > Restore binary compatibility for GIO_KEYMAP and PIO_KEYMAP. > > Back in 2009 I changed the ABI of the GIO_KEYMAP and PIO_KEYMAP ioctls > to support wide characters. I created a patch to add ABI compatibility > for the old calls, but I didn't get any feedback to that. > > It seems now people are upgrading from 8 to 9 they experience this > issue, so add it anyway. Would it be worth adding a COMPAT_FREEBSD8 and sticking this under that? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Sun Jul 17 12:42:51 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BBDE106566C; Sun, 17 Jul 2011 12:42:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C2E58FC14; Sun, 17 Jul 2011 12:42:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6HCgpsu073979; Sun, 17 Jul 2011 12:42:51 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6HCgpxf073977; Sun, 17 Jul 2011 12:42:51 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201107171242.p6HCgpxf073977@svn.freebsd.org> From: John Baldwin Date: Sun, 17 Jul 2011 12:42:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224130 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2011 12:42:51 -0000 Author: jhb Date: Sun Jul 17 12:42:51 2011 New Revision: 224130 URL: http://svn.freebsd.org/changeset/base/224130 Log: Don't ignore negatively decoded address ranges. Reported by: scottl Modified: head/sys/dev/acpica/acpi_pcib_acpi.c Modified: head/sys/dev/acpica/acpi_pcib_acpi.c ============================================================================== --- head/sys/dev/acpica/acpi_pcib_acpi.c Sun Jul 17 12:07:22 2011 (r224129) +++ head/sys/dev/acpica/acpi_pcib_acpi.c Sun Jul 17 12:42:51 2011 (r224130) @@ -238,13 +238,6 @@ acpi_pcib_producer_handler(ACPI_RESOURCE return (AE_OK); } - /* XXX: Not sure this is correct? */ - if (res->Data.Address.Decode != ACPI_POS_DECODE) { - device_printf(sc->ap_dev, - "Ignoring %d range (%#jx-%#jx) due to negative decode\n", - type, (uintmax_t)min, (uintmax_t)max); - break; - } if (min + length - 1 != max) device_printf(sc->ap_dev, "Length mismatch for %d range: %jx vs %jx\n", type, From owner-svn-src-head@FreeBSD.ORG Sun Jul 17 13:50:22 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BC2A106564A; Sun, 17 Jul 2011 13:50:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 02D318FC18; Sun, 17 Jul 2011 13:50:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6HDoLp1075963; Sun, 17 Jul 2011 13:50:21 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6HDoLsV075959; Sun, 17 Jul 2011 13:50:21 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201107171350.p6HDoLsV075959@svn.freebsd.org> From: Dimitry Andric Date: Sun, 17 Jul 2011 13:50:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224131 - in head/sys/boot/i386: . boot2 zfsboot X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2011 13:50:22 -0000 Author: dim Date: Sun Jul 17 13:50:21 2011 New Revision: 224131 URL: http://svn.freebsd.org/changeset/base/224131 Log: When building some of the boot loaders with clang, and DEBUG_FLAGS or CFLAGS having '-g' in it, clang outputs several assembly directives that are too new for our version of binutils. Therefore, assemble the resulting .s files with clang instead. A more general solution can be implemented when a GNU as-compatible driver for clang's integrated assembler appears. Reported by: dougb Modified: head/sys/boot/i386/Makefile.inc head/sys/boot/i386/boot2/Makefile head/sys/boot/i386/zfsboot/Makefile Modified: head/sys/boot/i386/Makefile.inc ============================================================================== --- head/sys/boot/i386/Makefile.inc Sun Jul 17 12:42:51 2011 (r224130) +++ head/sys/boot/i386/Makefile.inc Sun Jul 17 13:50:21 2011 (r224131) @@ -11,6 +11,7 @@ LDFLAGS+= -nostdlib .if ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -m32 -march=i386 +ACFLAGS+= -m32 LDFLAGS+= -m elf_i386_fbsd AFLAGS+= --32 .endif Modified: head/sys/boot/i386/boot2/Makefile ============================================================================== --- head/sys/boot/i386/boot2/Makefile Sun Jul 17 12:42:51 2011 (r224130) +++ head/sys/boot/i386/boot2/Makefile Sun Jul 17 13:50:21 2011 (r224131) @@ -89,6 +89,9 @@ boot2.out: ${BTXCRT} boot2.o sio.o ${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} boot2.o: boot2.s +.if ${CC:T:Mclang} == "clang" + ${CC} ${ACFLAGS} -c boot2.s +.endif SRCS= boot2.c boot2.h Modified: head/sys/boot/i386/zfsboot/Makefile ============================================================================== --- head/sys/boot/i386/zfsboot/Makefile Sun Jul 17 12:42:51 2011 (r224130) +++ head/sys/boot/i386/zfsboot/Makefile Sun Jul 17 13:50:21 2011 (r224131) @@ -86,6 +86,9 @@ zfsboot.out: ${BTXCRT} zfsboot.o sio.o d ${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND} zfsboot.o: zfsboot.s +.if ${CC:T:Mclang} == "clang" + ${CC} ${ACFLAGS} -c zfsboot.s +.endif SRCS= zfsboot.c From owner-svn-src-head@FreeBSD.ORG Sun Jul 17 14:52:56 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B5F2106566B; Sun, 17 Jul 2011 14:52:56 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4BF578FC12; Sun, 17 Jul 2011 14:52:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6HEqut4077854; Sun, 17 Jul 2011 14:52:56 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6HEquP7077852; Sun, 17 Jul 2011 14:52:56 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201107171452.p6HEquP7077852@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 17 Jul 2011 14:52:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224132 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2011 14:52:56 -0000 Author: jilles Date: Sun Jul 17 14:52:55 2011 New Revision: 224132 URL: http://svn.freebsd.org/changeset/base/224132 Log: rc.d/routing: Fix ugly output with additional routing options. Print a separate "Additional routing options" line for each address family which has additional options, so that it does not get mixed up with the output from adding routes. This also reverts r224048 which added newlines to two arbitrary routing options. Modified: head/etc/rc.d/routing Modified: head/etc/rc.d/routing ============================================================================== --- head/etc/rc.d/routing Sun Jul 17 13:50:21 2011 (r224131) +++ head/etc/rc.d/routing Sun Jul 17 14:52:55 2011 (r224132) @@ -48,7 +48,6 @@ routing_start() done ;; esac - [ -n "${_ropts_initdone}" ] && echo '.' } routing_stop() @@ -250,19 +249,19 @@ static_ipx() { } -_ropts_initdone= ropts_init() { if [ -z "${_ropts_initdone}" ]; then - echo -n 'Additional routing options:' + echo -n "Additional $1 routing options:" _ropts_initdone=yes fi } options_inet() { + _ropts_initdone= if checkyesno icmp_bmcastecho; then - ropts_init + ropts_init inet echo -n ' broadcast ping responses=YES' ${SYSCTL} net.inet.icmp.bmcastecho=1 > /dev/null else @@ -270,7 +269,7 @@ options_inet() fi if checkyesno icmp_drop_redirect; then - ropts_init + ropts_init inet echo -n ' ignore ICMP redirect=YES' ${SYSCTL} net.inet.icmp.drop_redirect=1 > /dev/null else @@ -278,7 +277,7 @@ options_inet() fi if checkyesno icmp_log_redirect; then - ropts_init + ropts_init inet echo -n ' log ICMP redirect=YES' ${SYSCTL} net.inet.icmp.log_redirect=1 > /dev/null else @@ -286,15 +285,15 @@ options_inet() fi if checkyesno gateway_enable; then - ropts_init - echo ' IPv4 gateway=YES' + ropts_init inet + echo -n ' gateway=YES' ${SYSCTL} net.inet.ip.forwarding=1 > /dev/null else ${SYSCTL} net.inet.ip.forwarding=0 > /dev/null fi if checkyesno forward_sourceroute; then - ropts_init + ropts_init inet echo -n ' do source routing=YES' ${SYSCTL} net.inet.ip.sourceroute=1 > /dev/null else @@ -302,7 +301,7 @@ options_inet() fi if checkyesno accept_sourceroute; then - ropts_init + ropts_init inet echo -n ' accept source routing=YES' ${SYSCTL} net.inet.ip.accept_sourceroute=1 > /dev/null else @@ -310,38 +309,51 @@ options_inet() fi if checkyesno arpproxy_all; then - ropts_init + ropts_init inet echo -n ' ARP proxyall=YES' ${SYSCTL} net.link.ether.inet.proxyall=1 > /dev/null else ${SYSCTL} net.link.ether.inet.proxyall=0 > /dev/null fi + + [ -n "${_ropts_initdone}" ] && echo '.' } options_inet6() { + _ropts_initdone= + if checkyesno ipv6_gateway_enable; then - ropts_init - echo ' IPv6 gateway=YES' + ropts_init inet6 + echo -n ' gateway=YES' ${SYSCTL} net.inet6.ip6.forwarding=1 > /dev/null else ${SYSCTL} net.inet6.ip6.forwarding=0 > /dev/null fi + + [ -n "${_ropts_initdone}" ] && echo '.' } options_atm() { + _ropts_initdone= + + [ -n "${_ropts_initdone}" ] && echo '.' } options_ipx() { + _ropts_initdone= + if checkyesno ipxgateway_enable; then - ropts_init - echo -n ' IPX gateway=YES' + ropts_init ipx + echo -n ' gateway=YES' ${SYSCTL} net.ipx.ipx.ipxforwarding=1 > /dev/null else ${SYSCTL} net.ipx.ipx.ipxforwarding=0 > /dev/null fi + + [ -n "${_ropts_initdone}" ] && echo '.' } load_rc_config $name From owner-svn-src-head@FreeBSD.ORG Sun Jul 17 16:50:13 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C395106564A; Sun, 17 Jul 2011 16:50:13 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1CC328FC08; Sun, 17 Jul 2011 16:50:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6HGoDe3081571; Sun, 17 Jul 2011 16:50:13 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6HGoCDa081569; Sun, 17 Jul 2011 16:50:12 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201107171650.p6HGoCDa081569@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 17 Jul 2011 16:50:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224139 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2011 16:50:13 -0000 Author: bz Date: Sun Jul 17 16:50:12 2011 New Revision: 224139 URL: http://svn.freebsd.org/changeset/base/224139 Log: Fix compilation of mips kernels adding apropriate #ifdefs after r224115. Pointed out by: Luiz Otavio O Souza (lists.br gmail.com) Modified: head/sys/mips/mips/cache.c Modified: head/sys/mips/mips/cache.c ============================================================================== --- head/sys/mips/mips/cache.c Sun Jul 17 16:30:57 2011 (r224138) +++ head/sys/mips/mips/cache.c Sun Jul 17 16:50:12 2011 (r224139) @@ -80,10 +80,12 @@ __FBSDID("$FreeBSD$"); struct mips_cache_ops mips_cache_ops; +#if defined(MIPS_DISABLE_L1_CACHE) || defined(CPU_RMI) || defined(CPU_NLM) static void cache_noop(vm_offset_t va, vm_size_t size) { } +#endif void mips_config_cache(struct mips_cpuinfo * cpuinfo) From owner-svn-src-head@FreeBSD.ORG Sun Jul 17 17:12:17 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7079C106566C; Sun, 17 Jul 2011 17:12:17 +0000 (UTC) (envelope-from marck@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 60E1A8FC15; Sun, 17 Jul 2011 17:12:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6HHCHDP082261; Sun, 17 Jul 2011 17:12:17 GMT (envelope-from marck@svn.freebsd.org) Received: (from marck@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6HHCHhA082259; Sun, 17 Jul 2011 17:12:17 GMT (envelope-from marck@svn.freebsd.org) Message-Id: <201107171712.p6HHCHhA082259@svn.freebsd.org> From: Dmitry Morozovsky Date: Sun, 17 Jul 2011 17:12:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224140 - head/sys/compat/freebsd32 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2011 17:12:17 -0000 Author: marck (doc committer) Date: Sun Jul 17 17:12:17 2011 New Revision: 224140 URL: http://svn.freebsd.org/changeset/base/224140 Log: Correct small typo in a do{}while(0) define Approved by: kib MFC after: 2 weeks Modified: head/sys/compat/freebsd32/freebsd32.h Modified: head/sys/compat/freebsd32/freebsd32.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32.h Sun Jul 17 16:50:12 2011 (r224139) +++ head/sys/compat/freebsd32/freebsd32.h Sun Jul 17 17:12:17 2011 (r224140) @@ -58,7 +58,7 @@ struct timespec32 { #define TS_CP(src,dst,fld) do { \ CP((src).fld,(dst).fld,tv_sec); \ CP((src).fld,(dst).fld,tv_nsec); \ -} while (0); +} while (0) struct rusage32 { struct timeval32 ru_utime; From owner-svn-src-head@FreeBSD.ORG Sun Jul 17 17:33:39 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8D9F1065670; Sun, 17 Jul 2011 17:33:39 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B91188FC15; Sun, 17 Jul 2011 17:33:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6HHXdLR082997; Sun, 17 Jul 2011 17:33:39 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6HHXdXe082995; Sun, 17 Jul 2011 17:33:39 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201107171733.p6HHXdXe082995@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 17 Jul 2011 17:33:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224141 - head/contrib/pf/man X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2011 17:33:39 -0000 Author: bz Date: Sun Jul 17 17:33:39 2011 New Revision: 224141 URL: http://svn.freebsd.org/changeset/base/224141 Log: Correct the description of struct pfioc_state_kill. PR: kern/158997 Submitted by: ohauer Modified: head/contrib/pf/man/pf.4 Modified: head/contrib/pf/man/pf.4 ============================================================================== --- head/contrib/pf/man/pf.4 Sun Jul 17 17:12:17 2011 (r224140) +++ head/contrib/pf/man/pf.4 Sun Jul 17 17:33:39 2011 (r224141) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 28 2011 +.Dd July 17 2011 .Dt PF 4 .Os .Sh NAME @@ -308,14 +308,17 @@ structure from the state table. .It Dv DIOCKILLSTATES Fa "struct pfioc_state_kill *psk" Remove matching entries from the state table. This ioctl returns the number of killed states in -.Va psk_af . +.Va psk_killed . .Bd -literal struct pfioc_state_kill { + struct pf_state_cmp psk_pfcmp; sa_family_t psk_af; int psk_proto; struct pf_rule_addr psk_src; struct pf_rule_addr psk_dst; char psk_ifname[IFNAMSIZ]; + char psk_label[PF_RULE_LABEL_SIZE]; + u_int psk_killed; }; .Ed .It Dv DIOCCLRSTATES Fa "struct pfioc_state_kill *psk" From owner-svn-src-head@FreeBSD.ORG Sun Jul 17 18:51:51 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA0CC106564A; Sun, 17 Jul 2011 18:51:51 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A93A98FC08; Sun, 17 Jul 2011 18:51:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6HIppGN085558; Sun, 17 Jul 2011 18:51:51 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6HIppPL085556; Sun, 17 Jul 2011 18:51:51 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201107171851.p6HIppPL085556@svn.freebsd.org> From: "Jayachandran C." Date: Sun, 17 Jul 2011 18:51:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224143 - head/sys/mips/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2011 18:51:51 -0000 Author: jchandra Date: Sun Jul 17 18:51:51 2011 New Revision: 224143 URL: http://svn.freebsd.org/changeset/base/224143 Log: Comment out KDB/DDB related options for N32 kernel. DDB files have warnings in this ABI which will break the kernel build unless Werror is ignored Reported by: bz Modified: head/sys/mips/conf/XLPN32 Modified: head/sys/mips/conf/XLPN32 ============================================================================== --- head/sys/mips/conf/XLPN32 Sun Jul 17 18:24:05 2011 (r224142) +++ head/sys/mips/conf/XLPN32 Sun Jul 17 18:51:51 2011 (r224143) @@ -63,11 +63,11 @@ options NO_SWAPPING #Debugging options options KTRACE # ktrace(1) support -options DDB -options KDB -options GDB -options BREAK_TO_DEBUGGER -options ALT_BREAK_TO_DEBUGGER +#options DDB +#options KDB +#options GDB +#options BREAK_TO_DEBUGGER +#options ALT_BREAK_TO_DEBUGGER #options DEADLKRES #Enable the deadlock resolver #options INVARIANTS #Enable calls of extra sanity checking #options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS From owner-svn-src-head@FreeBSD.ORG Sun Jul 17 19:24:54 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C8A41065670; Sun, 17 Jul 2011 19:24:54 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 599378FC0A; Sun, 17 Jul 2011 19:24:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6HJOsgg086748; Sun, 17 Jul 2011 19:24:54 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6HJOsxZ086740; Sun, 17 Jul 2011 19:24:54 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201107171924.p6HJOsxZ086740@svn.freebsd.org> From: Hiroki Sato Date: Sun, 17 Jul 2011 19:24:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224144 - in head/usr.sbin: . rtadvctl rtadvd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2011 19:24:54 -0000 Author: hrs Date: Sun Jul 17 19:24:54 2011 New Revision: 224144 URL: http://svn.freebsd.org/changeset/base/224144 Log: - Improve interface list handling. The rtadvd(8) now supports dynamically- added/removed interfaces in a more consistent manner and reloading the configuration file. - Implement burst unsolicited RA sending into the internal RA timer framework when AdvSendAdvertisements and/or configuration entries are changed as described in RFC 4861 6.2.4. This fixes issues that make termination of the rtadvd(8) daemon take very long time. An interface now has three internal states, UNCONFIGURED, TRANSITIVE, or CONFIGURED, and the burst unsolicited sending happens in TRANSITIVE. See rtadvd.h for the details. - rtadvd(8) now accepts non-existent interfaces as well in the command line. - Add control socket support and rtadvctl(8) utility to show the RA information in rtadvd(8). Dumping by SIGUSR1 has been removed in favor of it. Added: - copied from r224006, user/hrs/ipv6/usr.sbin/rtadvctl/ head/usr.sbin/rtadvd/control.c (contents, props changed) - copied, changed from r224006, user/hrs/ipv6/usr.sbin/rtadvd/control.c - copied unchanged from r224006, user/hrs/ipv6/usr.sbin/rtadvd/control.h - copied unchanged from r224006, user/hrs/ipv6/usr.sbin/rtadvd/control_client.c - copied unchanged from r224006, user/hrs/ipv6/usr.sbin/rtadvd/control_client.h head/usr.sbin/rtadvd/control_server.c (contents, props changed) - copied, changed from r224006, user/hrs/ipv6/usr.sbin/rtadvd/control_server.c head/usr.sbin/rtadvd/control_server.h (contents, props changed) - copied, changed from r224006, user/hrs/ipv6/usr.sbin/rtadvd/control_server.h head/usr.sbin/rtadvd/timer_subr.c (contents, props changed) - copied, changed from r224006, user/hrs/ipv6/usr.sbin/rtadvd/timer_subr.c head/usr.sbin/rtadvd/timer_subr.h (contents, props changed) - copied, changed from r224006, user/hrs/ipv6/usr.sbin/rtadvd/timer_subr.h Directory Properties: head/usr.sbin/rtadvctl/ (props changed) head/usr.sbin/rtadvd/control.h (props changed) head/usr.sbin/rtadvd/control_client.c (props changed) head/usr.sbin/rtadvd/control_client.h (props changed) Deleted: head/usr.sbin/rtadvd/dump.c head/usr.sbin/rtadvd/dump.h Modified: head/usr.sbin/Makefile head/usr.sbin/rtadvctl/Makefile (contents, props changed) head/usr.sbin/rtadvctl/rtadvctl.8 (contents, props changed) head/usr.sbin/rtadvctl/rtadvctl.c (contents, props changed) head/usr.sbin/rtadvd/Makefile head/usr.sbin/rtadvd/config.c head/usr.sbin/rtadvd/config.h head/usr.sbin/rtadvd/if.c head/usr.sbin/rtadvd/if.h head/usr.sbin/rtadvd/pathnames.h head/usr.sbin/rtadvd/rrenum.c head/usr.sbin/rtadvd/rtadvd.8 head/usr.sbin/rtadvd/rtadvd.c head/usr.sbin/rtadvd/rtadvd.h head/usr.sbin/rtadvd/timer.c head/usr.sbin/rtadvd/timer.h Directory Properties: head/usr.sbin/rtadvd/ (props changed) Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Sun Jul 17 18:51:51 2011 (r224143) +++ head/usr.sbin/Makefile Sun Jul 17 19:24:54 2011 (r224144) @@ -178,6 +178,7 @@ SUBDIR+= ndp SUBDIR+= rip6query SUBDIR+= route6d SUBDIR+= rrenumd +SUBDIR+= rtadvctl SUBDIR+= rtadvd SUBDIR+= rtsold SUBDIR+= traceroute6 Modified: head/usr.sbin/rtadvctl/Makefile ============================================================================== --- user/hrs/ipv6/usr.sbin/rtadvctl/Makefile Thu Jul 14 10:09:58 2011 (r224006) +++ head/usr.sbin/rtadvctl/Makefile Sun Jul 17 19:24:54 2011 (r224144) @@ -7,7 +7,7 @@ MAN= rtadvctl.8 SRCS= rtadvctl.c control.c control_client.c if.c timer_subr.c -CFLAGS+= -DROUTEINFO -I${.CURDIR} -I${.CURDIR}/../rtadvd -WARNS?= 3 +CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../rtadvd +WARNS?= 1 .include Modified: head/usr.sbin/rtadvctl/rtadvctl.8 ============================================================================== --- user/hrs/ipv6/usr.sbin/rtadvctl/rtadvctl.8 Thu Jul 14 10:09:58 2011 (r224006) +++ head/usr.sbin/rtadvctl/rtadvctl.8 Sun Jul 17 19:24:54 2011 (r224144) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 14, 2011 +.Dd July 16, 2011 .Dt RTADVCTL 8 .Os .Sh NAME @@ -39,54 +39,65 @@ .Op Ar interface ... .Sh DESCRIPTION .Nm -is a utility that communicates +is a utility that communicates with .Xr rtadvd 8 -daemon and displays information on Router Advertisement messages being -sent on each interfaces. +daemon and displays information about Router Advertisement messages being +sent on each interface. .Pp This utility provides several options and subcommands. The options are as follows: .Bl -tag -width indent .\" .It Fl v -Increase verbose level. When specified once, the +Increase verbosity level. +When specified once, the .Nm -utility shows additional information on prefixes, RDNSS, and DNSSL +utility shows additional information about prefixes, RDNSS, and DNSSL options. -When twice, it shows information on inactive interfaces and -some statistics. +When given twice, it additionally shows information about +inactive interfaces and some statistics. .El .Pp The subcommands are as follows: .Bl -tag -width indent .\" -.It reload -Specifies reloading the configuration file. +.It reload Op interfaces... +Specifies to reload the configuration file. If one or more +.Ar interface +is specified, configuration entries for the interfaces will be reloaded +selectively. +.It enable interfaces... +Specifies to mark the interface as enable and to try to reload the +configuration entry. +This subcommand is useful for dynamically-added interfaces. +.Pp +The +.Xr rtadvd 8 +daemon marks an interface as enable if the interface exists and the +configuration file has a valid entry for that when it is invoked. +.It disable interfaces... +Specifies to mark the interface as disable. .It shutdown -Makes +Makes the +.Xr rtadvd 8 +daemon shut down. +Note that the .Xr rtadvd 8 -daemon shut down immediately. +daemon will send several RAs with zero lifetime to invalidate the old +information on each interface. +It will take at most nine seconds. .It show Op interfaces... Displays information on Router Advertisement messages being sent -on each interfaces. +on each interface. .Sh SEE ALSO -.Xr rtadv 8 , +.Xr rtadvd 8 , .Xr rtadvd.conf 5 .Sh HISTORY The .Nm command first appeared in .Fx 9.0 . -.Sh BUGS -The -.Xr rtadvd 8 -daemon stops responding to -.Nm -for a while just after reloading the configuration file by the reload -subcommand. -This is because in the current implementation it cannot communicate -with +.Sh AUTHORS .Nm -during sending some additional RAs for graceful transition from one -configuration to another. -It will take at most nine seconds for each interface. +was written by +.An "Hiroki Sato" Aq hrs@FreeBSD.org . Modified: head/usr.sbin/rtadvctl/rtadvctl.c ============================================================================== --- user/hrs/ipv6/usr.sbin/rtadvctl/rtadvctl.c Thu Jul 14 10:09:58 2011 (r224006) +++ head/usr.sbin/rtadvctl/rtadvctl.c Sun Jul 17 19:24:54 2011 (r224144) @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -60,6 +61,7 @@ #include "rtadvd.h" #include "if.h" #include "timer_subr.h" +#include "timer.h" #include "control.h" #include "control_client.h" @@ -84,9 +86,7 @@ static int action_shutdown(int, char **) static int action_show(int, char **); static int action_show_prefix(struct prefix *); -#ifdef ROUTEINFO static int action_show_rtinfo(struct rtinfo *); -#endif static int action_show_rdnss(void *); static int action_show_dnssl(void *); @@ -108,14 +108,17 @@ static struct dispatch_table { { "show", action_show }, { "reload", action_reload }, { "shutdown", action_shutdown }, - { NULL, NULL }, { "enable", action_enable }, { "disable", action_disable }, + { NULL, NULL }, { "echo", action_echo }, { "version", action_version }, { NULL, NULL }, }; +static char errmsgbuf[1024]; +static char *errmsg = NULL; + static void mysyslog(int priority, const char * restrict fmt, ...) { @@ -177,13 +180,17 @@ main(int argc, char *argv[]) } } - if (action != NULL) { - error = (dtable[i].dt_act)(--argc, ++argv); - if (error) - fprintf(stderr, "%s failed.\n", dtable[i].dt_comm); - } else + if (action == NULL) usage(); + error = (dtable[i].dt_act)(--argc, ++argv); + if (error) { + fprintf(stderr, "%s failed", dtable[i].dt_comm); + if (errmsg != NULL) + fprintf(stderr, ": %s", errmsg); + fprintf(stderr, ".\n"); + } + return (error); } @@ -295,33 +302,69 @@ action_propset(char *argv) return (action_plgeneric(CM_TYPE_REQ_SET_PROP, argv, buf)); } -/* XXX */ static int -action_enable(int argc, char **argv) +action_disable(int argc, char **argv) { - argc = argc; - argv = argv; + char *action_argv; + char argv_disable[IFNAMSIZ + sizeof(":disable=")]; + int i; + int error; - return (0); + if (argc < 1) + return (1); + + error = 0; + for (i = 0; i < argc; i++) { + sprintf(argv_disable, "%s:disable=", argv[i]); + action_argv = argv_disable; + error += action_propset(action_argv); + } + + return (error); } -/* XXX */ static int -action_disable(int argc, char **argv) +action_enable(int argc, char **argv) { - argc = argc; - argv = argv; + char *action_argv; + char argv_enable[IFNAMSIZ + sizeof(":enable=")]; + int i; + int error; - return (0); + if (argc < 1) + return (1); + + error = 0; + for (i = 0; i < argc; i++) { + sprintf(argv_enable, "%s:enable=", argv[i]); + action_argv = argv_enable; + error += action_propset(action_argv); + } + + return (error); } static int -action_reload(int argc __unused, char **argv __unused) +action_reload(int argc, char **argv) { char *action_argv; + char argv_reload[IFNAMSIZ + sizeof(":reload=")]; + int i; + int error; - action_argv = strdup("reload"); - return(action_propset(action_argv)); + if (argc == 0) { + action_argv = strdup(":reload="); + return (action_propset(action_argv)); + } + + error = 0; + for (i = 0; i < argc; i++) { + sprintf(argv_reload, "%s:reload=", argv[i]); + action_argv = argv_reload; + error += action_propset(action_argv); + } + + return (error); } static int @@ -330,7 +373,7 @@ action_echo(int argc __unused, char **ar char *action_argv; action_argv = strdup("echo"); - return(action_propset(action_argv)); + return (action_propset(action_argv)); } static int @@ -339,7 +382,7 @@ action_shutdown(int argc __unused, char char *action_argv; action_argv = strdup("shutdown"); - return(action_propset(action_argv)); + return (action_propset(action_argv)); } /* XXX */ @@ -366,10 +409,9 @@ action_show(int argc, char **argv) char argv_ifilist[sizeof(":ifilist=")] = ":ifilist="; char argv_ifi[IFNAMSIZ + sizeof(":ifi=")]; char argv_rai[IFNAMSIZ + sizeof(":rai=")]; -#ifdef ROUTEINFO char argv_rti[IFNAMSIZ + sizeof(":rti=")]; -#endif char argv_pfx[IFNAMSIZ + sizeof(":pfx=")]; + char argv_ifi_ra_timer[IFNAMSIZ + sizeof(":ifi_ra_timer=")]; char argv_rdnss[IFNAMSIZ + sizeof(":rdnss=")]; char argv_dnssl[IFNAMSIZ + sizeof(":dnssl=")]; char ssbuf[SSBUFLEN]; @@ -394,7 +436,7 @@ action_show(int argc, char **argv) while (p < endp) { ifi = malloc(sizeof(*ifi)); if (ifi == NULL) - exit(1); + return (1); memset(ifi, 0, sizeof(*ifi)); strcpy(ifi->ifi_ifname, p); @@ -406,23 +448,27 @@ action_show(int argc, char **argv) for (i = 0; i < argc; i++) { ifi = malloc(sizeof(*ifi)); if (ifi == NULL) - exit(1); + return (1); memset(ifi, 0, sizeof(*ifi)); strcpy(ifi->ifi_ifname, argv[i]); ifi->ifi_ifindex = if_nametoindex(ifi->ifi_ifname); - if (ifi->ifi_ifindex == 0) - exit(1); + if (ifi->ifi_ifindex == 0) { + sprintf(errmsgbuf, "invalid interface %s", + ifi->ifi_ifname); + errmsg = errmsgbuf; + return (1); + } + TAILQ_INSERT_TAIL(&ifl, ifi, ifi_next); } } TAILQ_FOREACH(ifi, &ifl, ifi_next) { struct ifinfo *ifi_s; + struct rtadvd_timer *rat; struct rainfo *rai; -#ifdef ROUTEINFO struct rtinfo *rti; -#endif struct prefix *pfx; int c; int ra_ifstatus; @@ -439,33 +485,52 @@ action_show(int argc, char **argv) printf("%s: flags=<", ifi->ifi_ifname); - /* - * RA_RECV = UP + CONFIGURED + ACCEPT_RTADV - * RA_SEND = UP + CONFIGURED + IPV6FORWARDING - */ - c = 0; if (ifi_s->ifi_ifindex == 0) c += printf("NONEXISTENT"); else c += printf("%s", (ifi_s->ifi_flags & IFF_UP) ? "UP" : "DOWN"); - if (ifi_s->ifi_state == IFI_STATE_CONFIGURED) + switch (ifi_s->ifi_state) { + case IFI_STATE_CONFIGURED: c += printf("%s%s", (c) ? "," : "", "CONFIGURED"); - + break; + case IFI_STATE_TRANSITIVE: + c += printf("%s%s", (c) ? "," : "", "TRANSITIVE"); + break; + } if (ifi_s->ifi_persist) c += printf("%s%s", (c) ? "," : "", "PERSIST"); printf(">"); ra_ifstatus = RA_IFSTATUS_INACTIVE; if ((ifi_s->ifi_flags & IFF_UP) && - (ifi_s->ifi_state == IFI_STATE_CONFIGURED)) { + ((ifi_s->ifi_state == IFI_STATE_CONFIGURED) || + (ifi_s->ifi_state == IFI_STATE_TRANSITIVE))) { +#if (__FreeBSD_version < 900000) + /* + * RA_RECV: !ip6.forwarding && ip6.accept_rtadv + * RA_SEND: ip6.forwarding + */ + if (getinet6sysctl(IPV6CTL_FORWARDING) == 0) { + if (getinet6sysctl(IPV6CTL_ACCEPT_RTADV)) + ra_ifstatus = RA_IFSTATUS_RA_RECV; + else + ra_ifstatus = RA_IFSTATUS_INACTIVE; + } else + ra_ifstatus = RA_IFSTATUS_RA_SEND; +#else + /* + * RA_RECV: ND6_IFF_ACCEPT_RTADV + * RA_SEND: ip6.forwarding + */ if (ifi_s->ifi_nd_flags & ND6_IFF_ACCEPT_RTADV) ra_ifstatus = RA_IFSTATUS_RA_RECV; else if (getinet6sysctl(IPV6CTL_FORWARDING)) ra_ifstatus = RA_IFSTATUS_RA_SEND; else ra_ifstatus = RA_IFSTATUS_INACTIVE; +#endif } c = 0; @@ -478,7 +543,11 @@ action_show(int argc, char **argv) printf("%s%s", (c) ? "," : "", "RA_SEND"); printf("> "); - if (ifi_s->ifi_state != IFI_STATE_CONFIGURED) { + switch (ifi_s->ifi_state) { + case IFI_STATE_CONFIGURED: + case IFI_STATE_TRANSITIVE: + break; + default: printf("\n"); continue; } @@ -533,14 +602,33 @@ action_show(int argc, char **argv) rai->rai_hoplimit); printf("\tAdvIfPrefixes: %s\n", rai->rai_advifprefix ? "yes" : "no"); + + /* RA timer */ + rat = NULL; + if (ifi_s->ifi_ra_timer != NULL) { + sprintf(argv_ifi_ra_timer, "%s:ifi_ra_timer=", + ifi->ifi_ifname); + action_argv = argv_ifi_ra_timer; + + error = action_propget(action_argv, &cp); + if (error) + return (error); + + rat = (struct rtadvd_timer *)cp.cp_val; + } + printf("\tNext RA send: %s", + (rat == NULL) ? "never\n" : + ctime((time_t *)&rat->rat_tm.tv_sec)); + printf("\tLast RA sent: %s", + (ifi_s->ifi_ra_lastsent.tv_sec == 0) ? "never\n" : + ctime((time_t *)&ifi_s->ifi_ra_lastsent.tv_sec)); if (rai->rai_clockskew) - printf("\tClock skew: %ldsec\n", + printf("\tClock skew: %" PRIu16 "sec\n", rai->rai_clockskew); if (vflag < LOG_WARNING) continue; -#ifdef ROUTEINFO /* route information */ sprintf(argv_rti, "%s:rti=", ifi->ifi_ifname); action_argv = argv_rti; @@ -556,7 +644,7 @@ action_show(int argc, char **argv) for (i = 0; i < len; i++) action_show_rtinfo(&rti[i]); } -#endif + /* prefix information */ sprintf(argv_pfx, "%s:pfx=", ifi->ifi_ifname); action_argv = argv_pfx; @@ -583,7 +671,7 @@ action_show(int argc, char **argv) if (error) continue; - len = *((u_int16_t *)cp.cp_val); + len = *((uint16_t *)cp.cp_val); if (len > 0) { printf("\tRDNSS entries:\n"); @@ -598,7 +686,7 @@ action_show(int argc, char **argv) if (error) continue; - len = *((u_int16_t *)cp.cp_val); + len = *((uint16_t *)cp.cp_val); if (len > 0) { printf("\tDNSSL entries:\n"); @@ -610,28 +698,34 @@ action_show(int argc, char **argv) printf("\n"); - printf("\tLast RA sent: %s", - (rai->rai_lastsent.tv_sec == 0) ? "never\n" : - ctime((time_t *)&rai->rai_lastsent.tv_sec)); - printf("\tRA initcounts/waits: %d/%d\n", - rai->rai_initcounter, - rai->rai_waiting); - printf("\tRA out/in/inconsistent: %llu/%llu/%llu\n", - ifi_s->ifi_raoutput, + printf("\tCounters\n" + "\t RA burst counts: %" PRIu16 " (interval: %s)\n" + "\t RS wait counts: %" PRIu16 "\n", + ifi_s->ifi_burstcount, + sec2str(ifi_s->ifi_burstinterval, ssbuf), + ifi_s->ifi_rs_waitcount); + + printf("\tOutputs\n" + "\t RA: %" PRIu64 "\n", ifi_s->ifi_raoutput); + + printf("\tInputs\n" + "\t RA: %" PRIu64 " (normal)\n" + "\t RA: %" PRIu64 " (inconsistent)\n" + "\t RS: %" PRIu64 "\n", ifi_s->ifi_rainput, - ifi_s->ifi_rainconsistent); - printf("\tRS in: %llu\n", + ifi_s->ifi_rainconsistent, ifi_s->ifi_rsinput); printf("\n"); +#if 0 /* Not implemented yet */ printf("\tReceived RAs:\n"); +#endif } return (0); } -#ifdef ROUTEINFO static int action_show_rtinfo(struct rtinfo *rti) { @@ -648,7 +742,6 @@ action_show_rtinfo(struct rtinfo *rti) return (0); } -#endif static int action_show_prefix(struct prefix *pfx) @@ -726,17 +819,17 @@ action_show_rdnss(void *msg) { struct rdnss *rdn; struct rdnss_addr *rda; - u_int16_t *rdn_cnt; - u_int16_t *rda_cnt; + uint16_t *rdn_cnt; + uint16_t *rda_cnt; int i; int j; char *p; - u_int32_t ltime; + uint32_t ltime; char ntopbuf[INET6_ADDRSTRLEN]; char ssbuf[SSBUFLEN]; p = msg; - rdn_cnt = (u_int16_t *)p; + rdn_cnt = (uint16_t *)p; p += sizeof(*rdn_cnt); if (*rdn_cnt > 0) { @@ -745,7 +838,7 @@ action_show_rdnss(void *msg) ltime = rdn->rd_ltime; p += sizeof(*rdn); - rda_cnt = (u_int16_t *)p; + rda_cnt = (uint16_t *)p; p += sizeof(*rda_cnt); if (*rda_cnt > 0) for (j = 0; j < *rda_cnt; j++) { @@ -769,17 +862,17 @@ action_show_dnssl(void *msg) { struct dnssl *dns; struct dnssl_addr *dna; - u_int16_t *dns_cnt; - u_int16_t *dna_cnt; + uint16_t *dns_cnt; + uint16_t *dna_cnt; int i; int j; char *p; - u_int32_t ltime; + uint32_t ltime; char hbuf[NI_MAXHOST]; char ssbuf[SSBUFLEN]; p = msg; - dns_cnt = (u_int16_t *)p; + dns_cnt = (uint16_t *)p; p += sizeof(*dns_cnt); if (*dns_cnt > 0) { @@ -788,7 +881,7 @@ action_show_dnssl(void *msg) ltime = dns->dn_ltime; p += sizeof(*dns); - dna_cnt = (u_int16_t *)p; + dna_cnt = (uint16_t *)p; p += sizeof(*dna_cnt); if (*dna_cnt > 0) for (j = 0; j < *dna_cnt; j++) { Modified: head/usr.sbin/rtadvd/Makefile ============================================================================== --- head/usr.sbin/rtadvd/Makefile Sun Jul 17 18:51:51 2011 (r224143) +++ head/usr.sbin/rtadvd/Makefile Sun Jul 17 19:24:54 2011 (r224144) @@ -16,12 +16,13 @@ PROG= rtadvd MAN= rtadvd.conf.5 rtadvd.8 -SRCS= rtadvd.c rrenum.c advcap.c if.c config.c timer.c dump.c +SRCS= rtadvd.c rrenum.c advcap.c if.c config.c timer.c timer_subr.c \ + control.c control_server.c DPADD= ${LIBUTIL} LDADD= -lutil -CFLAGS+= -DHAVE_ARC4RANDOM -DHAVE_POLL_H -DROUTEINFO +CFLAGS+= -DHAVE_ARC4RANDOM WARNS?= 1 Modified: head/usr.sbin/rtadvd/config.c ============================================================================== --- head/usr.sbin/rtadvd/config.c Sun Jul 17 18:51:51 2011 (r224143) +++ head/usr.sbin/rtadvd/config.c Sun Jul 17 19:24:54 2011 (r224144) @@ -3,6 +3,7 @@ /* * Copyright (C) 1998 WIDE Project. + * Copyright (C) 2011 Hiroki Sato * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -52,6 +53,7 @@ #include #include #include +#include #include #include #include @@ -130,48 +132,153 @@ dname_labelenc(char *dst, const char *sr var = def; \ } while (0) -#define ELM_MALLOC(p,error_action) \ - do { \ - p = malloc(sizeof(*p)); \ - if (p == NULL) { \ - syslog(LOG_ERR, "<%s> malloc failed: %s", \ - __func__, strerror(errno)); \ - error_action; \ - } \ - memset(p, 0, sizeof(*p)); \ - } while(0) +int +loadconfig_index(int idx) +{ + char ifname[IFNAMSIZ]; + + syslog(LOG_DEBUG, "<%s> enter", __func__); + + if (if_indextoname(idx, ifname) != NULL) + return (loadconfig_ifname(ifname)); + else + return (1); +} int -loadconfig(char *ifl_names[], const int ifl_len) +loadconfig_ifname(char *ifname) { - int i; - int idx; - int error; + struct ifinfo *ifi; + + syslog(LOG_DEBUG, "<%s> enter", __func__); + + update_ifinfo(&ifilist, UPDATE_IFINFO_ALL); + TAILQ_FOREACH(ifi, &ifilist, ifi_next) { + /* NULL means all IFs will be processed. */ + if (ifname != NULL && + strcmp(ifi->ifi_ifname, ifname) != 0) + continue; + + if (!ifi->ifi_persist) { + syslog(LOG_INFO, + "<%s> %s is not a target interface. " + "Ignored at this moment.", __func__, + ifi->ifi_ifname); + continue; - for (i = 0; i < ifl_len; i++) { - idx = if_nametoindex(ifl_names[i]); - if (idx == 0) { + } + if (ifi->ifi_ifindex == 0) { syslog(LOG_ERR, - "<%s> interface %s not found. " - "Ignored at this moment.", __func__, ifl_names[i]); + "<%s> %s not found. " + "Ignored at this moment.", __func__, + ifi->ifi_ifname); continue; } - syslog(LOG_INFO, - "<%s> loading config for %s.", __func__, ifl_names[i]); - error = getconfig(idx); - if (error) + if (getconfig(ifi) == NULL) { syslog(LOG_ERR, "<%s> invalid configuration for %s. " - "Ignored at this moment.", __func__, ifl_names[i]); + "Ignored at this moment.", __func__, + ifi->ifi_ifname); + continue; + } } + return (0); +} + +int +rm_ifinfo_index(int idx) +{ + struct ifinfo *ifi; + ifi = if_indextoifinfo(idx); + if (ifi == NULL) { + syslog(LOG_ERR, "<%s>: ifinfo not found (idx=%d)", + __func__, idx); + return (-1); + } + + return (rm_ifinfo(ifi)); +} + +int +rm_ifinfo(struct ifinfo *ifi) +{ + int error; + + syslog(LOG_DEBUG, "<%s> enter (%s).", __func__, ifi->ifi_ifname); + switch (ifi->ifi_state) { + case IFI_STATE_UNCONFIGURED: + return (0); + break; + default: + ifi->ifi_state = IFI_STATE_UNCONFIGURED; + syslog(LOG_DEBUG, + "<%s> ifname=%s marked as UNCONFIGURED.", + __func__, ifi->ifi_ifname); + + /* XXX: No MC leaving here becasue index is disappeared */ + + /* Inactivate timer */ + rtadvd_remove_timer(ifi->ifi_ra_timer); + ifi->ifi_ra_timer = NULL; + break; + } + + /* clean up ifi */ + if (!ifi->ifi_persist) { + TAILQ_REMOVE(&ifilist, ifi, ifi_next); + syslog(LOG_DEBUG, "<%s>: ifinfo (idx=%d) removed.", + __func__, ifi->ifi_ifindex); + free(ifi); + } else { + /* recreate an empty entry */ + update_persist_ifinfo(&ifilist, ifi->ifi_ifname); + syslog(LOG_DEBUG, "<%s>: ifname=%s is persistent.", + __func__, ifi->ifi_ifname); + } + + /* clean up rai if any */ + switch (ifi->ifi_state) { + case IFI_STATE_CONFIGURED: + if (ifi->ifi_rainfo != NULL) { + error = rm_rainfo(ifi->ifi_rainfo); + if (error) + return (error); + ifi->ifi_rainfo = NULL; + } + break; + case IFI_STATE_TRANSITIVE: + if (ifi->ifi_rainfo == ifi->ifi_rainfo_trans) { + if (ifi->ifi_rainfo != NULL) { + error = rm_rainfo(ifi->ifi_rainfo); + if (error) + return (error); + ifi->ifi_rainfo = NULL; + ifi->ifi_rainfo_trans = NULL; + } + } else { + if (ifi->ifi_rainfo != NULL) { + error = rm_rainfo(ifi->ifi_rainfo); + if (error) + return (error); + ifi->ifi_rainfo = NULL; + } + if (ifi->ifi_rainfo_trans != NULL) { + error = rm_rainfo(ifi->ifi_rainfo_trans); + if (error) + return (error); + ifi->ifi_rainfo_trans = NULL; + } + } + } + + syslog(LOG_DEBUG, "<%s> leave (%s).", __func__, ifi->ifi_ifname); return (0); } int -rmconfig(int idx) +rm_rainfo(struct rainfo *rai) { - struct rainfo *rai; struct prefix *pfx; struct soliciter *sol; struct rdnss *rdn; @@ -179,26 +286,16 @@ rmconfig(int idx) struct dnssl *dns; struct rtinfo *rti; - rai = if_indextorainfo(idx); - if (rai == NULL) { - syslog(LOG_ERR, "<%s>: rainfo not found (idx=%d)", - __func__, idx); - return (-1); - } + syslog(LOG_DEBUG, "<%s>: enter", __func__); TAILQ_REMOVE(&railist, rai, rai_next); - syslog(LOG_DEBUG, "<%s>: rainfo (idx=%d) removed.", - __func__, idx); - - /* Free all of allocated memories for this entry. */ - rtadvd_remove_timer(rai->rai_timer); + if (rai->rai_ifinfo != NULL) + syslog(LOG_DEBUG, "<%s>: rainfo (idx=%d) removed.", + __func__, rai->rai_ifinfo->ifi_ifindex); if (rai->rai_ra_data != NULL) free(rai->rai_ra_data); - if (rai->rai_sdl != NULL) - free(rai->rai_sdl); - while ((pfx = TAILQ_FIRST(&rai->rai_prefix)) != NULL) { TAILQ_REMOVE(&rai->rai_prefix, pfx, pfx_next); free(pfx); @@ -224,51 +321,51 @@ rmconfig(int idx) free(rti); } free(rai); - + syslog(LOG_DEBUG, "<%s>: leave", __func__); + return (0); } -int -getconfig(int idx) +struct ifinfo * +getconfig(struct ifinfo *ifi) { int stat, i; + int error; char tbuf[BUFSIZ]; struct rainfo *rai; struct rainfo *rai_old; - long val; + int32_t val; int64_t val64; char buf[BUFSIZ]; char *bp = buf; char *addr, *flagstr; - char intface[IFNAMSIZ]; - if (if_indextoname(idx, intface) == NULL) { - syslog(LOG_ERR, "<%s> invalid index number (%d)", - __func__, idx); - return (-1); - } + if (ifi == NULL) /* if does not exist */ + return (NULL); - TAILQ_FOREACH(rai_old, &railist, rai_next) - if (idx == rai_old->rai_ifindex) - break; + if (ifi->ifi_state == IFI_STATE_TRANSITIVE && + ifi->ifi_rainfo == NULL) { + syslog(LOG_INFO, "<%s> %s is shutting down. Skipped.", + __func__, ifi->ifi_ifname); + return (NULL); + } - if ((stat = agetent(tbuf, intface)) <= 0) { + if ((stat = agetent(tbuf, ifi->ifi_ifname)) <= 0) { memset(tbuf, 0, sizeof(tbuf)); syslog(LOG_INFO, "<%s> %s isn't defined in the configuration file" " or the configuration file doesn't exist." " Treat it as default", - __func__, intface); + __func__, ifi->ifi_ifname); } ELM_MALLOC(rai, exit(1)); TAILQ_INIT(&rai->rai_prefix); -#ifdef ROUTEINFO TAILQ_INIT(&rai->rai_route); -#endif TAILQ_INIT(&rai->rai_rdnss); TAILQ_INIT(&rai->rai_dnssl); TAILQ_INIT(&rai->rai_soliciter); + rai->rai_ifinfo = ifi; /* gather on-link prefixes from the network interfaces. */ if (agetflag("noifprefix")) @@ -282,25 +379,12 @@ getconfig(int idx) else rai->rai_advlinkopt = 1; if (rai->rai_advlinkopt) { - if ((rai->rai_sdl = if_nametosdl(intface)) == NULL) { + if (ifi->ifi_sdl.sdl_type == 0) { syslog(LOG_ERR, "<%s> can't get information of %s", - __func__, intface); + __func__, ifi->ifi_ifname); goto getconfig_free_rai; } - rai->rai_ifindex = rai->rai_sdl->sdl_index; - } else - rai->rai_ifindex = if_nametoindex(intface); - strncpy(rai->rai_ifname, intface, sizeof(rai->rai_ifname)); - syslog(LOG_DEBUG, - "<%s> ifindex = %d on %s", __func__, rai->rai_ifindex, - rai->rai_ifname); - - if ((rai->rai_phymtu = if_getmtu(intface)) == 0) { - rai->rai_phymtu = IPV6_MMTU; - syslog(LOG_WARNING, - "<%s> can't get interface mtu of %s. Treat as %d", - __func__, intface, IPV6_MMTU); } /* @@ -309,24 +393,24 @@ getconfig(int idx) MAYHAVE(val, "maxinterval", DEF_MAXRTRADVINTERVAL); if (val < MIN_MAXINTERVAL || val > MAX_MAXINTERVAL) { syslog(LOG_ERR, - "<%s> maxinterval (%ld) on %s is invalid " + "<%s> maxinterval (%" PRIu32 ") on %s is invalid " "(must be between %u and %u)", __func__, val, - intface, MIN_MAXINTERVAL, MAX_MAXINTERVAL); + ifi->ifi_ifname, MIN_MAXINTERVAL, MAX_MAXINTERVAL); goto getconfig_free_rai; } - rai->rai_maxinterval = (u_int)val; + rai->rai_maxinterval = (uint16_t)val; MAYHAVE(val, "mininterval", rai->rai_maxinterval/3); - if ((u_int)val < MIN_MININTERVAL || - (u_int)val > (rai->rai_maxinterval * 3) / 4) { + if ((uint16_t)val < MIN_MININTERVAL || + (uint16_t)val > (rai->rai_maxinterval * 3) / 4) { syslog(LOG_ERR, - "<%s> mininterval (%ld) on %s is invalid " + "<%s> mininterval (%" PRIu32 ") on %s is invalid " "(must be between %d and %d)", - __func__, val, intface, MIN_MININTERVAL, + __func__, val, ifi->ifi_ifname, MIN_MININTERVAL, (rai->rai_maxinterval * 3) / 4); goto getconfig_free_rai; } - rai->rai_mininterval = (u_int)val; + rai->rai_mininterval = (uint16_t)val; MAYHAVE(val, "chlim", DEF_ADVCURHOPLIMIT); rai->rai_hoplimit = val & 0xff; @@ -359,17 +443,17 @@ getconfig(int idx) rai->rai_rtpref = val & ND_RA_FLAG_RTPREF_MASK; if (rai->rai_rtpref == ND_RA_FLAG_RTPREF_RSV) { syslog(LOG_ERR, "<%s> invalid router preference (%02x) on %s", - __func__, rai->rai_rtpref, intface); + __func__, rai->rai_rtpref, ifi->ifi_ifname); goto getconfig_free_rai; } MAYHAVE(val, "rltime", rai->rai_maxinterval * 3); - if ((u_int)val && ((u_int)val < rai->rai_maxinterval || - (u_int)val > MAXROUTERLIFETIME)) { + if ((uint16_t)val && ((uint16_t)val < rai->rai_maxinterval || + (uint16_t)val > MAXROUTERLIFETIME)) { syslog(LOG_ERR, - "<%s> router lifetime (%ld) on %s is invalid " + "<%s> router lifetime (%" PRIu32 ") on %s is invalid " "(must be 0 or between %d and %d)", - __func__, val, intface, rai->rai_maxinterval, + __func__, val, ifi->ifi_ifname, rai->rai_maxinterval, MAXROUTERLIFETIME); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Jul 17 19:51:41 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C29A8106564A; Sun, 17 Jul 2011 19:51:41 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ABE398FC0C; Sun, 17 Jul 2011 19:51:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6HJpfen087651; Sun, 17 Jul 2011 19:51:41 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6HJpfim087629; Sun, 17 Jul 2011 19:51:41 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201107171951.p6HJpfim087629@svn.freebsd.org> From: Dimitry Andric Date: Sun, 17 Jul 2011 19:51:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224145 - in head: contrib/llvm/include/llvm contrib/llvm/include/llvm-c contrib/llvm/include/llvm-c/Transforms contrib/llvm/include/llvm/ADT contrib/llvm/include/llvm/Analysis contrib/... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2011 19:51:41 -0000 Author: dim Date: Sun Jul 17 19:51:40 2011 New Revision: 224145 URL: http://svn.freebsd.org/changeset/base/224145 Log: Upgrade our copy of llvm/clang to r135360, from upstream's trunk. Added: head/contrib/llvm/include/llvm/Analysis/BlockFrequency.h - copied unchanged from r224136, vendor/llvm/dist/include/llvm/Analysis/BlockFrequency.h head/contrib/llvm/include/llvm/Analysis/BlockFrequencyImpl.h - copied unchanged from r224136, vendor/llvm/dist/include/llvm/Analysis/BlockFrequencyImpl.h head/contrib/llvm/include/llvm/CodeGen/MachineBlockFrequency.h - copied unchanged from r224136, vendor/llvm/dist/include/llvm/CodeGen/MachineBlockFrequency.h head/contrib/llvm/include/llvm/CodeGen/MachineBranchProbabilityInfo.h - copied unchanged from r224136, vendor/llvm/dist/include/llvm/CodeGen/MachineBranchProbabilityInfo.h head/contrib/llvm/include/llvm/MC/MCInstrDesc.h - copied unchanged from r224136, vendor/llvm/dist/include/llvm/MC/MCInstrDesc.h head/contrib/llvm/include/llvm/MC/MCInstrInfo.h - copied unchanged from r224136, vendor/llvm/dist/include/llvm/MC/MCInstrInfo.h head/contrib/llvm/include/llvm/MC/MCInstrItineraries.h - copied unchanged from r224136, vendor/llvm/dist/include/llvm/MC/MCInstrItineraries.h head/contrib/llvm/include/llvm/MC/MCRegisterInfo.h - copied unchanged from r224136, vendor/llvm/dist/include/llvm/MC/MCRegisterInfo.h head/contrib/llvm/include/llvm/MC/MCSubtargetInfo.h - copied unchanged from r224136, vendor/llvm/dist/include/llvm/MC/MCSubtargetInfo.h head/contrib/llvm/include/llvm/MC/SubtargetFeature.h - copied unchanged from r224136, vendor/llvm/dist/include/llvm/MC/SubtargetFeature.h head/contrib/llvm/include/llvm/Object/Binary.h - copied unchanged from r224136, vendor/llvm/dist/include/llvm/Object/Binary.h head/contrib/llvm/include/llvm/Object/COFF.h - copied unchanged from r224136, vendor/llvm/dist/include/llvm/Object/COFF.h head/contrib/llvm/include/llvm/Object/Error.h - copied unchanged from r224136, vendor/llvm/dist/include/llvm/Object/Error.h head/contrib/llvm/include/llvm/Target/TargetSubtargetInfo.h - copied unchanged from r224136, vendor/llvm/dist/include/llvm/Target/TargetSubtargetInfo.h head/contrib/llvm/lib/Analysis/BlockFrequency.cpp - copied unchanged from r224136, vendor/llvm/dist/lib/Analysis/BlockFrequency.cpp head/contrib/llvm/lib/CodeGen/MachineBlockFrequency.cpp - copied unchanged from r224136, vendor/llvm/dist/lib/CodeGen/MachineBlockFrequency.cpp head/contrib/llvm/lib/CodeGen/MachineBranchProbabilityInfo.cpp - copied unchanged from r224136, vendor/llvm/dist/lib/CodeGen/MachineBranchProbabilityInfo.cpp head/contrib/llvm/lib/CodeGen/RegisterCoalescer.h - copied unchanged from r224136, vendor/llvm/dist/lib/CodeGen/RegisterCoalescer.h head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h - copied unchanged from r224136, vendor/llvm/dist/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp - copied unchanged from r224136, vendor/llvm/dist/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp head/contrib/llvm/lib/MC/MCSubtargetInfo.cpp - copied unchanged from r224136, vendor/llvm/dist/lib/MC/MCSubtargetInfo.cpp head/contrib/llvm/lib/MC/SubtargetFeature.cpp - copied unchanged from r224136, vendor/llvm/dist/lib/MC/SubtargetFeature.cpp head/contrib/llvm/lib/Object/Binary.cpp - copied unchanged from r224136, vendor/llvm/dist/lib/Object/Binary.cpp head/contrib/llvm/lib/Object/Error.cpp - copied unchanged from r224136, vendor/llvm/dist/lib/Object/Error.cpp head/contrib/llvm/lib/Target/ARM/ARMMachObjectWriter.cpp - copied unchanged from r224136, vendor/llvm/dist/lib/Target/ARM/ARMMachObjectWriter.cpp head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ - copied from r224136, vendor/llvm/dist/lib/Target/ARM/MCTargetDesc/ head/contrib/llvm/lib/Target/Alpha/MCTargetDesc/ - copied from r224136, vendor/llvm/dist/lib/Target/Alpha/MCTargetDesc/ head/contrib/llvm/lib/Target/Blackfin/MCTargetDesc/ - copied from r224136, vendor/llvm/dist/lib/Target/Blackfin/MCTargetDesc/ head/contrib/llvm/lib/Target/CellSPU/MCTargetDesc/ - copied from r224136, vendor/llvm/dist/lib/Target/CellSPU/MCTargetDesc/ head/contrib/llvm/lib/Target/MBlaze/MCTargetDesc/ - copied from r224136, vendor/llvm/dist/lib/Target/MBlaze/MCTargetDesc/ head/contrib/llvm/lib/Target/MSP430/MCTargetDesc/ - copied from r224136, vendor/llvm/dist/lib/Target/MSP430/MCTargetDesc/ head/contrib/llvm/lib/Target/Mips/InstPrinter/ - copied from r224136, vendor/llvm/dist/lib/Target/Mips/InstPrinter/ head/contrib/llvm/lib/Target/Mips/MCTargetDesc/ - copied from r224136, vendor/llvm/dist/lib/Target/Mips/MCTargetDesc/ head/contrib/llvm/lib/Target/Mips/MipsAsmPrinter.h - copied unchanged from r224136, vendor/llvm/dist/lib/Target/Mips/MipsAsmPrinter.h head/contrib/llvm/lib/Target/Mips/MipsMCInstLower.cpp - copied unchanged from r224136, vendor/llvm/dist/lib/Target/Mips/MipsMCInstLower.cpp head/contrib/llvm/lib/Target/Mips/MipsMCInstLower.h - copied unchanged from r224136, vendor/llvm/dist/lib/Target/Mips/MipsMCInstLower.h head/contrib/llvm/lib/Target/Mips/MipsMCSymbolRefExpr.cpp - copied unchanged from r224136, vendor/llvm/dist/lib/Target/Mips/MipsMCSymbolRefExpr.cpp head/contrib/llvm/lib/Target/Mips/MipsMCSymbolRefExpr.h - copied unchanged from r224136, vendor/llvm/dist/lib/Target/Mips/MipsMCSymbolRefExpr.h head/contrib/llvm/lib/Target/PTX/MCTargetDesc/ - copied from r224136, vendor/llvm/dist/lib/Target/PTX/MCTargetDesc/ head/contrib/llvm/lib/Target/PTX/PTXCallingConv.td - copied unchanged from r224136, vendor/llvm/dist/lib/Target/PTX/PTXCallingConv.td head/contrib/llvm/lib/Target/PTX/generate-register-td.py - copied unchanged from r224136, vendor/llvm/dist/lib/Target/PTX/generate-register-td.py head/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/ - copied from r224136, vendor/llvm/dist/lib/Target/PowerPC/MCTargetDesc/ head/contrib/llvm/lib/Target/Sparc/MCTargetDesc/ - copied from r224136, vendor/llvm/dist/lib/Target/Sparc/MCTargetDesc/ head/contrib/llvm/lib/Target/SystemZ/MCTargetDesc/ - copied from r224136, vendor/llvm/dist/lib/Target/SystemZ/MCTargetDesc/ head/contrib/llvm/lib/Target/TargetSubtargetInfo.cpp - copied unchanged from r224136, vendor/llvm/dist/lib/Target/TargetSubtargetInfo.cpp head/contrib/llvm/lib/Target/X86/MCTargetDesc/ - copied from r224136, vendor/llvm/dist/lib/Target/X86/MCTargetDesc/ head/contrib/llvm/lib/Target/XCore/MCTargetDesc/ - copied from r224136, vendor/llvm/dist/lib/Target/XCore/MCTargetDesc/ head/contrib/llvm/lib/Transforms/Scalar/ObjCARC.cpp - copied unchanged from r224136, vendor/llvm/dist/lib/Transforms/Scalar/ObjCARC.cpp head/contrib/llvm/lib/Transforms/Utils/LowerExpectIntrinsic.cpp - copied unchanged from r224136, vendor/llvm/dist/lib/Transforms/Utils/LowerExpectIntrinsic.cpp head/contrib/llvm/tools/clang/include/clang/ARCMigrate/ - copied from r224136, vendor/clang/dist/include/clang/ARCMigrate/ head/contrib/llvm/tools/clang/include/clang/AST/GlobalDecl.h - copied unchanged from r224136, vendor/clang/dist/include/clang/AST/GlobalDecl.h head/contrib/llvm/tools/clang/include/clang/Basic/DelayedCleanupPool.h - copied unchanged from r224136, vendor/clang/dist/include/clang/Basic/DelayedCleanupPool.h head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticCategories.h - copied unchanged from r224136, vendor/clang/dist/include/clang/Basic/DiagnosticCategories.h head/contrib/llvm/tools/clang/include/clang/Driver/ObjCRuntime.h - copied unchanged from r224136, vendor/clang/dist/include/clang/Driver/ObjCRuntime.h head/contrib/llvm/tools/clang/include/clang/Sema/LocInfoType.h - copied unchanged from r224136, vendor/clang/dist/include/clang/Sema/LocInfoType.h head/contrib/llvm/tools/clang/include/clang/Sema/TypoCorrection.h - copied unchanged from r224136, vendor/clang/dist/include/clang/Sema/TypoCorrection.h head/contrib/llvm/tools/clang/lib/ARCMigrate/ - copied from r224136, vendor/clang/dist/lib/ARCMigrate/ head/contrib/llvm/tools/clang/lib/Sema/SemaExprMember.cpp - copied unchanged from r224136, vendor/clang/dist/lib/Sema/SemaExprMember.cpp head/contrib/llvm/utils/TableGen/Error.cpp - copied unchanged from r224136, vendor/llvm/dist/utils/TableGen/Error.cpp head/contrib/llvm/utils/TableGen/Error.h - copied unchanged from r224136, vendor/llvm/dist/utils/TableGen/Error.h head/contrib/llvm/utils/TableGen/PseudoLoweringEmitter.cpp - copied unchanged from r224136, vendor/llvm/dist/utils/TableGen/PseudoLoweringEmitter.cpp head/contrib/llvm/utils/TableGen/PseudoLoweringEmitter.h - copied unchanged from r224136, vendor/llvm/dist/utils/TableGen/PseudoLoweringEmitter.h head/lib/clang/include/ARMGenMCPseudoLowering.inc (contents, props changed) head/lib/clang/include/ARMGenSubtargetInfo.inc (contents, props changed) head/lib/clang/include/MipsGenSubtargetInfo.inc (contents, props changed) head/lib/clang/include/PPCGenSubtargetInfo.inc (contents, props changed) head/lib/clang/include/X86GenSubtargetInfo.inc (contents, props changed) head/lib/clang/libclangarcmigrate/ head/lib/clang/libclangarcmigrate/Makefile (contents, props changed) head/lib/clang/libllvmarmdesc/ head/lib/clang/libllvmarmdesc/Makefile (contents, props changed) head/lib/clang/libllvmmipsdesc/ head/lib/clang/libllvmmipsdesc/Makefile (contents, props changed) head/lib/clang/libllvmmipsinstprinter/ head/lib/clang/libllvmmipsinstprinter/Makefile (contents, props changed) head/lib/clang/libllvmpowerpcdesc/ head/lib/clang/libllvmpowerpcdesc/Makefile (contents, props changed) head/lib/clang/libllvmx86desc/ head/lib/clang/libllvmx86desc/Makefile (contents, props changed) Deleted: head/contrib/llvm/include/llvm/AbstractTypeUser.h head/contrib/llvm/include/llvm/CodeGen/RegisterCoalescer.h head/contrib/llvm/include/llvm/Target/SubtargetFeature.h head/contrib/llvm/include/llvm/Target/TargetInstrDesc.h head/contrib/llvm/include/llvm/Target/TargetInstrItineraries.h head/contrib/llvm/include/llvm/Target/TargetSubtarget.h head/contrib/llvm/include/llvm/TypeSymbolTable.h head/contrib/llvm/lib/CodeGen/PreAllocSplitting.cpp head/contrib/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp head/contrib/llvm/lib/CodeGen/SimpleRegisterCoalescing.h head/contrib/llvm/lib/Target/ARM/ARMMCAsmInfo.cpp head/contrib/llvm/lib/Target/ARM/ARMMCAsmInfo.h head/contrib/llvm/lib/Target/Alpha/AlphaMCAsmInfo.cpp head/contrib/llvm/lib/Target/Alpha/AlphaMCAsmInfo.h head/contrib/llvm/lib/Target/Blackfin/BlackfinMCAsmInfo.cpp head/contrib/llvm/lib/Target/Blackfin/BlackfinMCAsmInfo.h head/contrib/llvm/lib/Target/CellSPU/SPUMCAsmInfo.cpp head/contrib/llvm/lib/Target/CellSPU/SPUMCAsmInfo.h head/contrib/llvm/lib/Target/MBlaze/MBlazeMCAsmInfo.cpp head/contrib/llvm/lib/Target/MBlaze/MBlazeMCAsmInfo.h head/contrib/llvm/lib/Target/MSP430/MSP430MCAsmInfo.cpp head/contrib/llvm/lib/Target/MSP430/MSP430MCAsmInfo.h head/contrib/llvm/lib/Target/Mips/MipsMCAsmInfo.cpp head/contrib/llvm/lib/Target/Mips/MipsMCAsmInfo.h head/contrib/llvm/lib/Target/PTX/PTXMCAsmInfo.cpp head/contrib/llvm/lib/Target/PTX/PTXMCAsmInfo.h head/contrib/llvm/lib/Target/PowerPC/PPCMCAsmInfo.cpp head/contrib/llvm/lib/Target/PowerPC/PPCMCAsmInfo.h head/contrib/llvm/lib/Target/Sparc/SparcMCAsmInfo.cpp head/contrib/llvm/lib/Target/Sparc/SparcMCAsmInfo.h head/contrib/llvm/lib/Target/SubtargetFeature.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZMCAsmInfo.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZMCAsmInfo.h head/contrib/llvm/lib/Target/TargetSubtarget.cpp head/contrib/llvm/lib/Target/X86/X86MCAsmInfo.cpp head/contrib/llvm/lib/Target/X86/X86MCAsmInfo.h head/contrib/llvm/lib/Target/XCore/XCoreMCAsmInfo.cpp head/contrib/llvm/lib/Target/XCore/XCoreMCAsmInfo.h head/contrib/llvm/lib/Transforms/IPO/DeadTypeElimination.cpp head/contrib/llvm/lib/Transforms/Utils/CloneLoop.cpp head/contrib/llvm/lib/VMCore/TypeSymbolTable.cpp head/contrib/llvm/lib/VMCore/TypesContext.h head/contrib/llvm/tools/clang/include/clang/Tooling/ head/contrib/llvm/tools/clang/lib/CodeGen/GlobalDecl.h head/contrib/llvm/tools/clang/lib/Frontend/BoostConAction.cpp head/contrib/llvm/tools/clang/lib/Tooling/ head/lib/clang/include/ARMGenInstrNames.inc head/lib/clang/include/ARMGenRegisterInfo.h.inc head/lib/clang/include/ARMGenRegisterNames.inc head/lib/clang/include/ARMGenSubtarget.inc head/lib/clang/include/IA64GenInstrNames.inc head/lib/clang/include/IA64GenRegisterInfo.h.inc head/lib/clang/include/IA64GenRegisterNames.inc head/lib/clang/include/MipsGenInstrNames.inc head/lib/clang/include/MipsGenRegisterInfo.h.inc head/lib/clang/include/MipsGenRegisterNames.inc head/lib/clang/include/MipsGenSubtarget.inc head/lib/clang/include/PPCGenInstrNames.inc head/lib/clang/include/PPCGenRegisterInfo.h.inc head/lib/clang/include/PPCGenRegisterNames.inc head/lib/clang/include/PPCGenSubtarget.inc head/lib/clang/include/X86GenInstrNames.inc head/lib/clang/include/X86GenRegisterInfo.h.inc head/lib/clang/include/X86GenRegisterNames.inc head/lib/clang/include/X86GenSubtarget.inc Modified: head/contrib/llvm/include/llvm-c/Core.h head/contrib/llvm/include/llvm-c/Target.h head/contrib/llvm/include/llvm-c/Transforms/IPO.h head/contrib/llvm/include/llvm/ADT/APFloat.h head/contrib/llvm/include/llvm/ADT/APInt.h head/contrib/llvm/include/llvm/ADT/ArrayRef.h head/contrib/llvm/include/llvm/ADT/ImmutableList.h head/contrib/llvm/include/llvm/ADT/PackedVector.h head/contrib/llvm/include/llvm/ADT/SmallVector.h head/contrib/llvm/include/llvm/ADT/StringMap.h head/contrib/llvm/include/llvm/ADT/Triple.h head/contrib/llvm/include/llvm/Analysis/BranchProbabilityInfo.h head/contrib/llvm/include/llvm/Analysis/DIBuilder.h head/contrib/llvm/include/llvm/Analysis/IVUsers.h head/contrib/llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h head/contrib/llvm/include/llvm/Analysis/Passes.h head/contrib/llvm/include/llvm/Analysis/ScalarEvolutionExpander.h head/contrib/llvm/include/llvm/Analysis/ValueTracking.h head/contrib/llvm/include/llvm/Assembly/Writer.h head/contrib/llvm/include/llvm/Attributes.h head/contrib/llvm/include/llvm/BasicBlock.h head/contrib/llvm/include/llvm/Bitcode/BitstreamReader.h head/contrib/llvm/include/llvm/Bitcode/LLVMBitCodes.h head/contrib/llvm/include/llvm/CodeGen/Analysis.h head/contrib/llvm/include/llvm/CodeGen/AsmPrinter.h head/contrib/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h head/contrib/llvm/include/llvm/CodeGen/ISDOpcodes.h head/contrib/llvm/include/llvm/CodeGen/LinkAllCodegenComponents.h head/contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h head/contrib/llvm/include/llvm/CodeGen/MachineFunction.h head/contrib/llvm/include/llvm/CodeGen/MachineInstr.h head/contrib/llvm/include/llvm/CodeGen/MachineInstrBuilder.h head/contrib/llvm/include/llvm/CodeGen/MachineOperand.h head/contrib/llvm/include/llvm/CodeGen/MachineRegisterInfo.h head/contrib/llvm/include/llvm/CodeGen/Passes.h head/contrib/llvm/include/llvm/CodeGen/RegAllocPBQP.h head/contrib/llvm/include/llvm/CodeGen/RuntimeLibcalls.h head/contrib/llvm/include/llvm/CodeGen/ScheduleDAG.h head/contrib/llvm/include/llvm/CodeGen/ScoreboardHazardRecognizer.h head/contrib/llvm/include/llvm/CodeGen/SelectionDAG.h head/contrib/llvm/include/llvm/CodeGen/SelectionDAGNodes.h head/contrib/llvm/include/llvm/CodeGen/SlotIndexes.h head/contrib/llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h head/contrib/llvm/include/llvm/CodeGen/ValueTypes.h head/contrib/llvm/include/llvm/CodeGen/ValueTypes.td head/contrib/llvm/include/llvm/Constant.h head/contrib/llvm/include/llvm/Constants.h head/contrib/llvm/include/llvm/DefaultPasses.h head/contrib/llvm/include/llvm/DerivedTypes.h head/contrib/llvm/include/llvm/ExecutionEngine/RuntimeDyld.h head/contrib/llvm/include/llvm/Function.h head/contrib/llvm/include/llvm/GlobalAlias.h head/contrib/llvm/include/llvm/GlobalValue.h head/contrib/llvm/include/llvm/GlobalVariable.h head/contrib/llvm/include/llvm/InitializePasses.h head/contrib/llvm/include/llvm/InlineAsm.h head/contrib/llvm/include/llvm/Instructions.h head/contrib/llvm/include/llvm/Intrinsics.h head/contrib/llvm/include/llvm/Intrinsics.td head/contrib/llvm/include/llvm/LLVMContext.h head/contrib/llvm/include/llvm/LinkAllPasses.h head/contrib/llvm/include/llvm/MC/MCAsmInfo.h head/contrib/llvm/include/llvm/MC/MCContext.h head/contrib/llvm/include/llvm/MC/MCMachObjectWriter.h head/contrib/llvm/include/llvm/MC/MCObjectStreamer.h head/contrib/llvm/include/llvm/MC/MCParser/MCParsedAsmOperand.h head/contrib/llvm/include/llvm/MC/MCStreamer.h head/contrib/llvm/include/llvm/Module.h head/contrib/llvm/include/llvm/Object/ObjectFile.h head/contrib/llvm/include/llvm/Support/BranchProbability.h head/contrib/llvm/include/llvm/Support/CFG.h head/contrib/llvm/include/llvm/Support/ConstantFolder.h head/contrib/llvm/include/llvm/Support/DebugLoc.h head/contrib/llvm/include/llvm/Support/ELF.h head/contrib/llvm/include/llvm/Support/Endian.h head/contrib/llvm/include/llvm/Support/IRBuilder.h head/contrib/llvm/include/llvm/Support/NoFolder.h head/contrib/llvm/include/llvm/Support/PassManagerBuilder.h head/contrib/llvm/include/llvm/Support/TargetFolder.h head/contrib/llvm/include/llvm/Support/TypeBuilder.h head/contrib/llvm/include/llvm/Support/system_error.h head/contrib/llvm/include/llvm/Target/Target.td head/contrib/llvm/include/llvm/Target/TargetAsmInfo.h head/contrib/llvm/include/llvm/Target/TargetAsmParser.h head/contrib/llvm/include/llvm/Target/TargetData.h head/contrib/llvm/include/llvm/Target/TargetFrameLowering.h head/contrib/llvm/include/llvm/Target/TargetInstrInfo.h head/contrib/llvm/include/llvm/Target/TargetLowering.h head/contrib/llvm/include/llvm/Target/TargetLoweringObjectFile.h head/contrib/llvm/include/llvm/Target/TargetMachine.h head/contrib/llvm/include/llvm/Target/TargetOpcodes.h head/contrib/llvm/include/llvm/Target/TargetOptions.h head/contrib/llvm/include/llvm/Target/TargetRegisterInfo.h head/contrib/llvm/include/llvm/Target/TargetRegistry.h head/contrib/llvm/include/llvm/Target/TargetSelect.h head/contrib/llvm/include/llvm/Target/TargetSelectionDAG.td head/contrib/llvm/include/llvm/Transforms/IPO.h head/contrib/llvm/include/llvm/Transforms/Scalar.h head/contrib/llvm/include/llvm/Transforms/Utils/Cloning.h head/contrib/llvm/include/llvm/Transforms/Utils/SSAUpdater.h head/contrib/llvm/include/llvm/Transforms/Utils/ValueMapper.h head/contrib/llvm/include/llvm/Type.h head/contrib/llvm/include/llvm/Use.h head/contrib/llvm/include/llvm/Value.h head/contrib/llvm/lib/Analysis/Analysis.cpp head/contrib/llvm/lib/Analysis/BranchProbabilityInfo.cpp head/contrib/llvm/lib/Analysis/ConstantFolding.cpp head/contrib/llvm/lib/Analysis/DIBuilder.cpp head/contrib/llvm/lib/Analysis/DebugInfo.cpp head/contrib/llvm/lib/Analysis/IPA/FindUsedTypes.cpp head/contrib/llvm/lib/Analysis/IVUsers.cpp head/contrib/llvm/lib/Analysis/InstructionSimplify.cpp head/contrib/llvm/lib/Analysis/Lint.cpp head/contrib/llvm/lib/Analysis/MemDepPrinter.cpp head/contrib/llvm/lib/Analysis/MemoryBuiltins.cpp head/contrib/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp head/contrib/llvm/lib/Analysis/ScalarEvolutionExpander.cpp head/contrib/llvm/lib/Analysis/ValueTracking.cpp head/contrib/llvm/lib/AsmParser/LLLexer.cpp head/contrib/llvm/lib/AsmParser/LLLexer.h head/contrib/llvm/lib/AsmParser/LLParser.cpp head/contrib/llvm/lib/AsmParser/LLParser.h head/contrib/llvm/lib/AsmParser/LLToken.h head/contrib/llvm/lib/Bitcode/Reader/BitcodeReader.cpp head/contrib/llvm/lib/Bitcode/Reader/BitcodeReader.h head/contrib/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp head/contrib/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp head/contrib/llvm/lib/Bitcode/Writer/ValueEnumerator.h head/contrib/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp head/contrib/llvm/lib/CodeGen/AggressiveAntiDepBreaker.h head/contrib/llvm/lib/CodeGen/AllocationOrder.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h head/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp head/contrib/llvm/lib/CodeGen/BranchFolding.cpp head/contrib/llvm/lib/CodeGen/BranchFolding.h head/contrib/llvm/lib/CodeGen/CalcSpillWeights.cpp head/contrib/llvm/lib/CodeGen/CodeGen.cpp head/contrib/llvm/lib/CodeGen/CriticalAntiDepBreaker.cpp head/contrib/llvm/lib/CodeGen/CriticalAntiDepBreaker.h head/contrib/llvm/lib/CodeGen/DeadMachineInstructionElim.cpp head/contrib/llvm/lib/CodeGen/DwarfEHPrepare.cpp head/contrib/llvm/lib/CodeGen/ELFWriter.cpp head/contrib/llvm/lib/CodeGen/ELFWriter.h head/contrib/llvm/lib/CodeGen/EdgeBundles.cpp head/contrib/llvm/lib/CodeGen/ExpandISelPseudos.cpp head/contrib/llvm/lib/CodeGen/IfConversion.cpp head/contrib/llvm/lib/CodeGen/InlineSpiller.cpp head/contrib/llvm/lib/CodeGen/InterferenceCache.cpp head/contrib/llvm/lib/CodeGen/InterferenceCache.h head/contrib/llvm/lib/CodeGen/IntrinsicLowering.cpp head/contrib/llvm/lib/CodeGen/LLVMTargetMachine.cpp head/contrib/llvm/lib/CodeGen/LiveDebugVariables.cpp head/contrib/llvm/lib/CodeGen/LiveIntervalUnion.cpp head/contrib/llvm/lib/CodeGen/LiveIntervalUnion.h head/contrib/llvm/lib/CodeGen/LiveRangeEdit.cpp head/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp head/contrib/llvm/lib/CodeGen/MachineCSE.cpp head/contrib/llvm/lib/CodeGen/MachineFunction.cpp head/contrib/llvm/lib/CodeGen/MachineInstr.cpp head/contrib/llvm/lib/CodeGen/MachineLICM.cpp head/contrib/llvm/lib/CodeGen/MachineRegisterInfo.cpp head/contrib/llvm/lib/CodeGen/MachineVerifier.cpp head/contrib/llvm/lib/CodeGen/PeepholeOptimizer.cpp head/contrib/llvm/lib/CodeGen/PostRASchedulerList.cpp head/contrib/llvm/lib/CodeGen/PrologEpilogInserter.cpp head/contrib/llvm/lib/CodeGen/RegAllocBasic.cpp head/contrib/llvm/lib/CodeGen/RegAllocFast.cpp head/contrib/llvm/lib/CodeGen/RegAllocGreedy.cpp head/contrib/llvm/lib/CodeGen/RegAllocLinearScan.cpp head/contrib/llvm/lib/CodeGen/RegAllocPBQP.cpp head/contrib/llvm/lib/CodeGen/RegisterClassInfo.cpp head/contrib/llvm/lib/CodeGen/RegisterClassInfo.h head/contrib/llvm/lib/CodeGen/RegisterCoalescer.cpp head/contrib/llvm/lib/CodeGen/RenderMachineFunction.cpp head/contrib/llvm/lib/CodeGen/ScheduleDAG.cpp head/contrib/llvm/lib/CodeGen/ScheduleDAGEmit.cpp head/contrib/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp head/contrib/llvm/lib/CodeGen/ScoreboardHazardRecognizer.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.h head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.h head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h head/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp head/contrib/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp head/contrib/llvm/lib/CodeGen/ShadowStackGC.cpp head/contrib/llvm/lib/CodeGen/SjLjEHPrepare.cpp head/contrib/llvm/lib/CodeGen/SplitKit.cpp head/contrib/llvm/lib/CodeGen/SplitKit.h head/contrib/llvm/lib/CodeGen/Splitter.cpp head/contrib/llvm/lib/CodeGen/StackProtector.cpp head/contrib/llvm/lib/CodeGen/StackSlotColoring.cpp head/contrib/llvm/lib/CodeGen/TailDuplication.cpp head/contrib/llvm/lib/CodeGen/TargetInstrInfoImpl.cpp head/contrib/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp head/contrib/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp head/contrib/llvm/lib/CodeGen/VirtRegMap.h head/contrib/llvm/lib/CodeGen/VirtRegRewriter.cpp head/contrib/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp head/contrib/llvm/lib/ExecutionEngine/JIT/JIT.cpp head/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp head/contrib/llvm/lib/ExecutionEngine/TargetSelect.cpp head/contrib/llvm/lib/Linker/LinkModules.cpp head/contrib/llvm/lib/MC/MCAsmInfo.cpp head/contrib/llvm/lib/MC/MCAsmStreamer.cpp head/contrib/llvm/lib/MC/MCDisassembler/Disassembler.cpp head/contrib/llvm/lib/MC/MCDisassembler/EDDisassembler.cpp head/contrib/llvm/lib/MC/MCDisassembler/EDDisassembler.h head/contrib/llvm/lib/MC/MCDisassembler/EDInfo.h head/contrib/llvm/lib/MC/MCDisassembler/EDOperand.cpp head/contrib/llvm/lib/MC/MCDwarf.cpp head/contrib/llvm/lib/MC/MCELFStreamer.cpp head/contrib/llvm/lib/MC/MCELFStreamer.h head/contrib/llvm/lib/MC/MCLoggingStreamer.cpp head/contrib/llvm/lib/MC/MCMachOStreamer.cpp head/contrib/llvm/lib/MC/MCNullStreamer.cpp head/contrib/llvm/lib/MC/MCObjectStreamer.cpp head/contrib/llvm/lib/MC/MCParser/AsmParser.cpp head/contrib/llvm/lib/MC/MCParser/COFFAsmParser.cpp head/contrib/llvm/lib/MC/MCParser/MCAsmParser.cpp head/contrib/llvm/lib/MC/MCParser/TargetAsmParser.cpp head/contrib/llvm/lib/MC/MCStreamer.cpp head/contrib/llvm/lib/MC/MCWin64EH.cpp head/contrib/llvm/lib/MC/MachObjectWriter.cpp head/contrib/llvm/lib/Object/COFFObjectFile.cpp head/contrib/llvm/lib/Object/ELFObjectFile.cpp head/contrib/llvm/lib/Object/MachOObjectFile.cpp head/contrib/llvm/lib/Object/Object.cpp head/contrib/llvm/lib/Object/ObjectFile.cpp head/contrib/llvm/lib/Support/APFloat.cpp head/contrib/llvm/lib/Support/APInt.cpp head/contrib/llvm/lib/Support/Atomic.cpp head/contrib/llvm/lib/Support/CommandLine.cpp head/contrib/llvm/lib/Support/ConstantRange.cpp head/contrib/llvm/lib/Support/Host.cpp head/contrib/llvm/lib/Support/Threading.cpp head/contrib/llvm/lib/Support/Triple.cpp head/contrib/llvm/lib/Support/Twine.cpp head/contrib/llvm/lib/Support/Unix/Path.inc head/contrib/llvm/lib/Support/Windows/DynamicLibrary.inc head/contrib/llvm/lib/Support/Windows/explicit_symbols.inc head/contrib/llvm/lib/Target/ARM/ARM.h head/contrib/llvm/lib/Target/ARM/ARM.td head/contrib/llvm/lib/Target/ARM/ARMAsmBackend.cpp head/contrib/llvm/lib/Target/ARM/ARMAsmPrinter.cpp head/contrib/llvm/lib/Target/ARM/ARMAsmPrinter.h head/contrib/llvm/lib/Target/ARM/ARMBaseInfo.h head/contrib/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp head/contrib/llvm/lib/Target/ARM/ARMBaseInstrInfo.h head/contrib/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp head/contrib/llvm/lib/Target/ARM/ARMBaseRegisterInfo.h head/contrib/llvm/lib/Target/ARM/ARMCodeEmitter.cpp head/contrib/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp head/contrib/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp head/contrib/llvm/lib/Target/ARM/ARMFastISel.cpp head/contrib/llvm/lib/Target/ARM/ARMFrameLowering.cpp head/contrib/llvm/lib/Target/ARM/ARMGlobalMerge.cpp head/contrib/llvm/lib/Target/ARM/ARMHazardRecognizer.cpp head/contrib/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp head/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp head/contrib/llvm/lib/Target/ARM/ARMISelLowering.h head/contrib/llvm/lib/Target/ARM/ARMInstrFormats.td head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.cpp head/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td head/contrib/llvm/lib/Target/ARM/ARMInstrNEON.td head/contrib/llvm/lib/Target/ARM/ARMInstrThumb.td head/contrib/llvm/lib/Target/ARM/ARMInstrThumb2.td head/contrib/llvm/lib/Target/ARM/ARMInstrVFP.td head/contrib/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp head/contrib/llvm/lib/Target/ARM/ARMMCCodeEmitter.cpp head/contrib/llvm/lib/Target/ARM/ARMMCInstLower.cpp head/contrib/llvm/lib/Target/ARM/ARMRegisterInfo.td head/contrib/llvm/lib/Target/ARM/ARMSubtarget.cpp head/contrib/llvm/lib/Target/ARM/ARMSubtarget.h head/contrib/llvm/lib/Target/ARM/ARMTargetMachine.cpp head/contrib/llvm/lib/Target/ARM/ARMTargetMachine.h head/contrib/llvm/lib/Target/ARM/AsmParser/ARMAsmLexer.cpp head/contrib/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp head/contrib/llvm/lib/Target/ARM/Disassembler/ARMDisassemblerCore.cpp head/contrib/llvm/lib/Target/ARM/Disassembler/ThumbDisassemblerCore.h head/contrib/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp head/contrib/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.h head/contrib/llvm/lib/Target/ARM/MLxExpansionPass.cpp head/contrib/llvm/lib/Target/ARM/NEONMoveFix.cpp head/contrib/llvm/lib/Target/ARM/Thumb1FrameLowering.cpp head/contrib/llvm/lib/Target/ARM/Thumb1InstrInfo.cpp head/contrib/llvm/lib/Target/ARM/Thumb1RegisterInfo.cpp head/contrib/llvm/lib/Target/ARM/Thumb2ITBlockPass.cpp head/contrib/llvm/lib/Target/ARM/Thumb2InstrInfo.cpp head/contrib/llvm/lib/Target/ARM/Thumb2SizeReduction.cpp head/contrib/llvm/lib/Target/Alpha/Alpha.h head/contrib/llvm/lib/Target/Alpha/AlphaISelLowering.cpp head/contrib/llvm/lib/Target/Alpha/AlphaISelLowering.h head/contrib/llvm/lib/Target/Alpha/AlphaInstrInfo.cpp head/contrib/llvm/lib/Target/Alpha/AlphaInstrInfo.h head/contrib/llvm/lib/Target/Alpha/AlphaRegisterInfo.cpp head/contrib/llvm/lib/Target/Alpha/AlphaRegisterInfo.h head/contrib/llvm/lib/Target/Alpha/AlphaRegisterInfo.td head/contrib/llvm/lib/Target/Alpha/AlphaSubtarget.cpp head/contrib/llvm/lib/Target/Alpha/AlphaSubtarget.h head/contrib/llvm/lib/Target/Alpha/AlphaTargetMachine.cpp head/contrib/llvm/lib/Target/Alpha/AlphaTargetMachine.h head/contrib/llvm/lib/Target/Blackfin/Blackfin.h head/contrib/llvm/lib/Target/Blackfin/BlackfinISelDAGToDAG.cpp head/contrib/llvm/lib/Target/Blackfin/BlackfinISelLowering.cpp head/contrib/llvm/lib/Target/Blackfin/BlackfinISelLowering.h head/contrib/llvm/lib/Target/Blackfin/BlackfinInstrInfo.cpp head/contrib/llvm/lib/Target/Blackfin/BlackfinInstrInfo.h head/contrib/llvm/lib/Target/Blackfin/BlackfinIntrinsicInfo.cpp head/contrib/llvm/lib/Target/Blackfin/BlackfinRegisterInfo.cpp head/contrib/llvm/lib/Target/Blackfin/BlackfinRegisterInfo.h head/contrib/llvm/lib/Target/Blackfin/BlackfinRegisterInfo.td head/contrib/llvm/lib/Target/Blackfin/BlackfinSubtarget.cpp head/contrib/llvm/lib/Target/Blackfin/BlackfinSubtarget.h head/contrib/llvm/lib/Target/Blackfin/BlackfinTargetMachine.cpp head/contrib/llvm/lib/Target/Blackfin/BlackfinTargetMachine.h head/contrib/llvm/lib/Target/CBackend/CBackend.cpp head/contrib/llvm/lib/Target/CBackend/CTargetMachine.h head/contrib/llvm/lib/Target/CellSPU/SPU.h head/contrib/llvm/lib/Target/CellSPU/SPUFrameLowering.cpp head/contrib/llvm/lib/Target/CellSPU/SPUISelDAGToDAG.cpp head/contrib/llvm/lib/Target/CellSPU/SPUISelLowering.cpp head/contrib/llvm/lib/Target/CellSPU/SPUInstrInfo.cpp head/contrib/llvm/lib/Target/CellSPU/SPUInstrInfo.h head/contrib/llvm/lib/Target/CellSPU/SPURegisterInfo.cpp head/contrib/llvm/lib/Target/CellSPU/SPURegisterInfo.h head/contrib/llvm/lib/Target/CellSPU/SPURegisterInfo.td head/contrib/llvm/lib/Target/CellSPU/SPURegisterNames.h head/contrib/llvm/lib/Target/CellSPU/SPUSubtarget.cpp head/contrib/llvm/lib/Target/CellSPU/SPUSubtarget.h head/contrib/llvm/lib/Target/CellSPU/SPUTargetMachine.cpp head/contrib/llvm/lib/Target/CellSPU/SPUTargetMachine.h head/contrib/llvm/lib/Target/CppBackend/CPPBackend.cpp head/contrib/llvm/lib/Target/CppBackend/CPPTargetMachine.h head/contrib/llvm/lib/Target/MBlaze/AsmParser/MBlazeAsmLexer.cpp head/contrib/llvm/lib/Target/MBlaze/AsmParser/MBlazeAsmParser.cpp head/contrib/llvm/lib/Target/MBlaze/Disassembler/MBlazeDisassembler.cpp head/contrib/llvm/lib/Target/MBlaze/InstPrinter/MBlazeInstPrinter.h head/contrib/llvm/lib/Target/MBlaze/MBlaze.h head/contrib/llvm/lib/Target/MBlaze/MBlazeAsmPrinter.cpp head/contrib/llvm/lib/Target/MBlaze/MBlazeDelaySlotFiller.cpp head/contrib/llvm/lib/Target/MBlaze/MBlazeISelLowering.cpp head/contrib/llvm/lib/Target/MBlaze/MBlazeISelLowering.h head/contrib/llvm/lib/Target/MBlaze/MBlazeInstrInfo.cpp head/contrib/llvm/lib/Target/MBlaze/MBlazeInstrInfo.h head/contrib/llvm/lib/Target/MBlaze/MBlazeIntrinsicInfo.cpp head/contrib/llvm/lib/Target/MBlaze/MBlazeMCCodeEmitter.cpp head/contrib/llvm/lib/Target/MBlaze/MBlazeRegisterInfo.cpp head/contrib/llvm/lib/Target/MBlaze/MBlazeRegisterInfo.h head/contrib/llvm/lib/Target/MBlaze/MBlazeRegisterInfo.td head/contrib/llvm/lib/Target/MBlaze/MBlazeSubtarget.cpp head/contrib/llvm/lib/Target/MBlaze/MBlazeSubtarget.h head/contrib/llvm/lib/Target/MBlaze/MBlazeTargetMachine.cpp head/contrib/llvm/lib/Target/MBlaze/MBlazeTargetMachine.h head/contrib/llvm/lib/Target/MSP430/InstPrinter/MSP430InstPrinter.h head/contrib/llvm/lib/Target/MSP430/MSP430.h head/contrib/llvm/lib/Target/MSP430/MSP430AsmPrinter.cpp head/contrib/llvm/lib/Target/MSP430/MSP430InstrInfo.cpp head/contrib/llvm/lib/Target/MSP430/MSP430InstrInfo.h head/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.cpp head/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.h head/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.td head/contrib/llvm/lib/Target/MSP430/MSP430Subtarget.cpp head/contrib/llvm/lib/Target/MSP430/MSP430Subtarget.h head/contrib/llvm/lib/Target/MSP430/MSP430TargetMachine.cpp head/contrib/llvm/lib/Target/MSP430/MSP430TargetMachine.h head/contrib/llvm/lib/Target/Mips/Mips.h head/contrib/llvm/lib/Target/Mips/Mips.td head/contrib/llvm/lib/Target/Mips/MipsAsmPrinter.cpp head/contrib/llvm/lib/Target/Mips/MipsCallingConv.td head/contrib/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp head/contrib/llvm/lib/Target/Mips/MipsEmitGPRestore.cpp head/contrib/llvm/lib/Target/Mips/MipsExpandPseudo.cpp head/contrib/llvm/lib/Target/Mips/MipsISelDAGToDAG.cpp head/contrib/llvm/lib/Target/Mips/MipsISelLowering.cpp head/contrib/llvm/lib/Target/Mips/MipsISelLowering.h head/contrib/llvm/lib/Target/Mips/MipsInstrInfo.cpp head/contrib/llvm/lib/Target/Mips/MipsInstrInfo.h head/contrib/llvm/lib/Target/Mips/MipsInstrInfo.td head/contrib/llvm/lib/Target/Mips/MipsMachineFunction.h head/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.cpp head/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.h head/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.td head/contrib/llvm/lib/Target/Mips/MipsSubtarget.cpp head/contrib/llvm/lib/Target/Mips/MipsSubtarget.h head/contrib/llvm/lib/Target/Mips/MipsTargetMachine.cpp head/contrib/llvm/lib/Target/Mips/MipsTargetMachine.h head/contrib/llvm/lib/Target/PTX/PTX.h head/contrib/llvm/lib/Target/PTX/PTX.td head/contrib/llvm/lib/Target/PTX/PTXAsmPrinter.cpp head/contrib/llvm/lib/Target/PTX/PTXISelDAGToDAG.cpp head/contrib/llvm/lib/Target/PTX/PTXISelLowering.cpp head/contrib/llvm/lib/Target/PTX/PTXISelLowering.h head/contrib/llvm/lib/Target/PTX/PTXInstrFormats.td head/contrib/llvm/lib/Target/PTX/PTXInstrInfo.cpp head/contrib/llvm/lib/Target/PTX/PTXInstrInfo.h head/contrib/llvm/lib/Target/PTX/PTXInstrInfo.td head/contrib/llvm/lib/Target/PTX/PTXIntrinsicInstrInfo.td head/contrib/llvm/lib/Target/PTX/PTXMCAsmStreamer.cpp head/contrib/llvm/lib/Target/PTX/PTXMFInfoExtract.cpp head/contrib/llvm/lib/Target/PTX/PTXMachineFunctionInfo.h head/contrib/llvm/lib/Target/PTX/PTXRegisterInfo.cpp head/contrib/llvm/lib/Target/PTX/PTXRegisterInfo.h head/contrib/llvm/lib/Target/PTX/PTXRegisterInfo.td head/contrib/llvm/lib/Target/PTX/PTXSubtarget.cpp head/contrib/llvm/lib/Target/PTX/PTXSubtarget.h head/contrib/llvm/lib/Target/PTX/PTXTargetMachine.cpp head/contrib/llvm/lib/Target/PTX/PTXTargetMachine.h head/contrib/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.h head/contrib/llvm/lib/Target/PowerPC/PPC.h head/contrib/llvm/lib/Target/PowerPC/PPCAsmBackend.cpp head/contrib/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp head/contrib/llvm/lib/Target/PowerPC/PPCHazardRecognizers.cpp head/contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp head/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp head/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp head/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.h head/contrib/llvm/lib/Target/PowerPC/PPCJITInfo.cpp head/contrib/llvm/lib/Target/PowerPC/PPCMCCodeEmitter.cpp head/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp head/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.h head/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.td head/contrib/llvm/lib/Target/PowerPC/PPCSubtarget.cpp head/contrib/llvm/lib/Target/PowerPC/PPCSubtarget.h head/contrib/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp head/contrib/llvm/lib/Target/PowerPC/PPCTargetMachine.h head/contrib/llvm/lib/Target/Sparc/DelaySlotFiller.cpp head/contrib/llvm/lib/Target/Sparc/Sparc.h head/contrib/llvm/lib/Target/Sparc/SparcISelLowering.cpp head/contrib/llvm/lib/Target/Sparc/SparcISelLowering.h head/contrib/llvm/lib/Target/Sparc/SparcInstrInfo.cpp head/contrib/llvm/lib/Target/Sparc/SparcInstrInfo.h head/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.cpp head/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.h head/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.td head/contrib/llvm/lib/Target/Sparc/SparcSubtarget.cpp head/contrib/llvm/lib/Target/Sparc/SparcSubtarget.h head/contrib/llvm/lib/Target/Sparc/SparcTargetMachine.cpp head/contrib/llvm/lib/Target/Sparc/SparcTargetMachine.h head/contrib/llvm/lib/Target/SystemZ/SystemZ.h head/contrib/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZInstrBuilder.h head/contrib/llvm/lib/Target/SystemZ/SystemZInstrInfo.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZInstrInfo.h head/contrib/llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZRegisterInfo.h head/contrib/llvm/lib/Target/SystemZ/SystemZRegisterInfo.td head/contrib/llvm/lib/Target/SystemZ/SystemZSubtarget.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZSubtarget.h head/contrib/llvm/lib/Target/SystemZ/SystemZTargetMachine.cpp head/contrib/llvm/lib/Target/SystemZ/SystemZTargetMachine.h head/contrib/llvm/lib/Target/Target.cpp head/contrib/llvm/lib/Target/TargetAsmInfo.cpp head/contrib/llvm/lib/Target/TargetData.cpp head/contrib/llvm/lib/Target/TargetInstrInfo.cpp head/contrib/llvm/lib/Target/TargetLoweringObjectFile.cpp head/contrib/llvm/lib/Target/TargetMachine.cpp head/contrib/llvm/lib/Target/TargetRegisterInfo.cpp head/contrib/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp head/contrib/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp head/contrib/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp head/contrib/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.h head/contrib/llvm/lib/Target/X86/InstPrinter/X86InstComments.cpp head/contrib/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp head/contrib/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.h head/contrib/llvm/lib/Target/X86/X86.h head/contrib/llvm/lib/Target/X86/X86.td head/contrib/llvm/lib/Target/X86/X86AsmBackend.cpp head/contrib/llvm/lib/Target/X86/X86AsmPrinter.cpp head/contrib/llvm/lib/Target/X86/X86CallingConv.td head/contrib/llvm/lib/Target/X86/X86CodeEmitter.cpp head/contrib/llvm/lib/Target/X86/X86FastISel.cpp head/contrib/llvm/lib/Target/X86/X86FloatingPoint.cpp head/contrib/llvm/lib/Target/X86/X86FrameLowering.cpp head/contrib/llvm/lib/Target/X86/X86FrameLowering.h head/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp head/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp head/contrib/llvm/lib/Target/X86/X86ISelLowering.h head/contrib/llvm/lib/Target/X86/X86InstrBuilder.h head/contrib/llvm/lib/Target/X86/X86InstrCompiler.td head/contrib/llvm/lib/Target/X86/X86InstrFPStack.td head/contrib/llvm/lib/Target/X86/X86InstrFormats.td head/contrib/llvm/lib/Target/X86/X86InstrFragmentsSIMD.td head/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp head/contrib/llvm/lib/Target/X86/X86InstrInfo.h head/contrib/llvm/lib/Target/X86/X86InstrInfo.td head/contrib/llvm/lib/Target/X86/X86InstrSSE.td head/contrib/llvm/lib/Target/X86/X86InstrSystem.td head/contrib/llvm/lib/Target/X86/X86MCCodeEmitter.cpp head/contrib/llvm/lib/Target/X86/X86MCInstLower.cpp head/contrib/llvm/lib/Target/X86/X86MachObjectWriter.cpp head/contrib/llvm/lib/Target/X86/X86RegisterInfo.cpp head/contrib/llvm/lib/Target/X86/X86RegisterInfo.h head/contrib/llvm/lib/Target/X86/X86RegisterInfo.td head/contrib/llvm/lib/Target/X86/X86Subtarget.cpp head/contrib/llvm/lib/Target/X86/X86Subtarget.h head/contrib/llvm/lib/Target/X86/X86TargetMachine.cpp head/contrib/llvm/lib/Target/X86/X86TargetMachine.h head/contrib/llvm/lib/Target/XCore/XCore.h head/contrib/llvm/lib/Target/XCore/XCoreAsmPrinter.cpp head/contrib/llvm/lib/Target/XCore/XCoreISelLowering.cpp head/contrib/llvm/lib/Target/XCore/XCoreISelLowering.h head/contrib/llvm/lib/Target/XCore/XCoreInstrInfo.cpp head/contrib/llvm/lib/Target/XCore/XCoreInstrInfo.h head/contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.cpp head/contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.h head/contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.td head/contrib/llvm/lib/Target/XCore/XCoreSubtarget.cpp head/contrib/llvm/lib/Target/XCore/XCoreSubtarget.h head/contrib/llvm/lib/Target/XCore/XCoreTargetMachine.cpp head/contrib/llvm/lib/Target/XCore/XCoreTargetMachine.h head/contrib/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp head/contrib/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp head/contrib/llvm/lib/Transforms/IPO/GlobalOpt.cpp head/contrib/llvm/lib/Transforms/IPO/IPO.cpp head/contrib/llvm/lib/Transforms/IPO/LowerSetJmp.cpp head/contrib/llvm/lib/Transforms/IPO/MergeFunctions.cpp head/contrib/llvm/lib/Transforms/IPO/PruneEH.cpp head/contrib/llvm/lib/Transforms/IPO/StripSymbols.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp head/contrib/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp head/contrib/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp head/contrib/llvm/lib/Transforms/Instrumentation/PathProfiling.cpp head/contrib/llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp head/contrib/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp head/contrib/llvm/lib/Transforms/Scalar/GVN.cpp head/contrib/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp head/contrib/llvm/lib/Transforms/Scalar/JumpThreading.cpp head/contrib/llvm/lib/Transforms/Scalar/LICM.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopDeletion.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopRotation.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp head/contrib/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp head/contrib/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp head/contrib/llvm/lib/Transforms/Scalar/Reassociate.cpp head/contrib/llvm/lib/Transforms/Scalar/Scalar.cpp head/contrib/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp head/contrib/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp head/contrib/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp head/contrib/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp head/contrib/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp head/contrib/llvm/lib/Transforms/Utils/CloneFunction.cpp head/contrib/llvm/lib/Transforms/Utils/CloneModule.cpp head/contrib/llvm/lib/Transforms/Utils/CodeExtractor.cpp head/contrib/llvm/lib/Transforms/Utils/InlineFunction.cpp head/contrib/llvm/lib/Transforms/Utils/Local.cpp head/contrib/llvm/lib/Transforms/Utils/LoopSimplify.cpp head/contrib/llvm/lib/Transforms/Utils/LoopUnroll.cpp head/contrib/llvm/lib/Transforms/Utils/LowerInvoke.cpp head/contrib/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp head/contrib/llvm/lib/Transforms/Utils/SSAUpdater.cpp head/contrib/llvm/lib/Transforms/Utils/SimplifyCFG.cpp head/contrib/llvm/lib/Transforms/Utils/ValueMapper.cpp head/contrib/llvm/lib/VMCore/AsmWriter.cpp head/contrib/llvm/lib/VMCore/Attributes.cpp head/contrib/llvm/lib/VMCore/AutoUpgrade.cpp head/contrib/llvm/lib/VMCore/BasicBlock.cpp head/contrib/llvm/lib/VMCore/ConstantFold.cpp head/contrib/llvm/lib/VMCore/ConstantFold.h head/contrib/llvm/lib/VMCore/Constants.cpp head/contrib/llvm/lib/VMCore/ConstantsContext.h head/contrib/llvm/lib/VMCore/Core.cpp head/contrib/llvm/lib/VMCore/DebugLoc.cpp head/contrib/llvm/lib/VMCore/Function.cpp head/contrib/llvm/lib/VMCore/Globals.cpp head/contrib/llvm/lib/VMCore/IRBuilder.cpp head/contrib/llvm/lib/VMCore/InlineAsm.cpp head/contrib/llvm/lib/VMCore/Instruction.cpp head/contrib/llvm/lib/VMCore/Instructions.cpp head/contrib/llvm/lib/VMCore/LLVMContext.cpp head/contrib/llvm/lib/VMCore/LLVMContextImpl.cpp head/contrib/llvm/lib/VMCore/LLVMContextImpl.h head/contrib/llvm/lib/VMCore/Metadata.cpp head/contrib/llvm/lib/VMCore/Module.cpp head/contrib/llvm/lib/VMCore/Type.cpp head/contrib/llvm/lib/VMCore/Use.cpp head/contrib/llvm/lib/VMCore/User.cpp head/contrib/llvm/lib/VMCore/Value.cpp head/contrib/llvm/lib/VMCore/ValueSymbolTable.cpp head/contrib/llvm/lib/VMCore/ValueTypes.cpp head/contrib/llvm/lib/VMCore/Verifier.cpp head/contrib/llvm/tools/clang/include/clang-c/Index.h head/contrib/llvm/tools/clang/include/clang/AST/ASTContext.h head/contrib/llvm/tools/clang/include/clang/AST/ASTDiagnostic.h head/contrib/llvm/tools/clang/include/clang/AST/CanonicalType.h head/contrib/llvm/tools/clang/include/clang/AST/Decl.h head/contrib/llvm/tools/clang/include/clang/AST/DeclBase.h head/contrib/llvm/tools/clang/include/clang/AST/DeclCXX.h head/contrib/llvm/tools/clang/include/clang/AST/DeclObjC.h head/contrib/llvm/tools/clang/include/clang/AST/DeclTemplate.h head/contrib/llvm/tools/clang/include/clang/AST/DeclarationName.h head/contrib/llvm/tools/clang/include/clang/AST/Expr.h head/contrib/llvm/tools/clang/include/clang/AST/ExprCXX.h head/contrib/llvm/tools/clang/include/clang/AST/ExprObjC.h head/contrib/llvm/tools/clang/include/clang/AST/ExternalASTSource.h head/contrib/llvm/tools/clang/include/clang/AST/NestedNameSpecifier.h head/contrib/llvm/tools/clang/include/clang/AST/OperationKinds.h head/contrib/llvm/tools/clang/include/clang/AST/ParentMap.h head/contrib/llvm/tools/clang/include/clang/AST/PrettyPrinter.h head/contrib/llvm/tools/clang/include/clang/AST/RecursiveASTVisitor.h head/contrib/llvm/tools/clang/include/clang/AST/Stmt.h head/contrib/llvm/tools/clang/include/clang/AST/StmtObjC.h head/contrib/llvm/tools/clang/include/clang/AST/TemplateBase.h head/contrib/llvm/tools/clang/include/clang/AST/TemplateName.h head/contrib/llvm/tools/clang/include/clang/AST/Type.h head/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/UninitializedValues.h head/contrib/llvm/tools/clang/include/clang/Analysis/AnalysisContext.h head/contrib/llvm/tools/clang/include/clang/Analysis/DomainSpecific/CocoaConventions.h head/contrib/llvm/tools/clang/include/clang/Basic/Attr.td head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def head/contrib/llvm/tools/clang/include/clang/Basic/Builtins.h head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsX86.def head/contrib/llvm/tools/clang/include/clang/Basic/Diagnostic.h head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticCommonKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticDriverKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticFrontendKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticGroups.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticIDs.h head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticLexKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticParseKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td head/contrib/llvm/tools/clang/include/clang/Basic/FileManager.h head/contrib/llvm/tools/clang/include/clang/Basic/IdentifierTable.h head/contrib/llvm/tools/clang/include/clang/Basic/LangOptions.h head/contrib/llvm/tools/clang/include/clang/Basic/SourceManager.h head/contrib/llvm/tools/clang/include/clang/Basic/SourceManagerInternals.h head/contrib/llvm/tools/clang/include/clang/Basic/Specifiers.h head/contrib/llvm/tools/clang/include/clang/Basic/StmtNodes.td head/contrib/llvm/tools/clang/include/clang/Basic/TargetInfo.h head/contrib/llvm/tools/clang/include/clang/Basic/TokenKinds.def head/contrib/llvm/tools/clang/include/clang/Basic/arm_neon.td head/contrib/llvm/tools/clang/include/clang/CodeGen/BackendUtil.h head/contrib/llvm/tools/clang/include/clang/Driver/CC1Options.td head/contrib/llvm/tools/clang/include/clang/Driver/Compilation.h head/contrib/llvm/tools/clang/include/clang/Driver/Driver.h head/contrib/llvm/tools/clang/include/clang/Driver/Option.h head/contrib/llvm/tools/clang/include/clang/Driver/Options.td head/contrib/llvm/tools/clang/include/clang/Driver/ToolChain.h head/contrib/llvm/tools/clang/include/clang/Frontend/ASTUnit.h head/contrib/llvm/tools/clang/include/clang/Frontend/CodeGenOptions.h head/contrib/llvm/tools/clang/include/clang/Frontend/DependencyOutputOptions.h head/contrib/llvm/tools/clang/include/clang/Frontend/DiagnosticOptions.h head/contrib/llvm/tools/clang/include/clang/Frontend/FrontendAction.h head/contrib/llvm/tools/clang/include/clang/Frontend/FrontendActions.h head/contrib/llvm/tools/clang/include/clang/Frontend/FrontendOptions.h head/contrib/llvm/tools/clang/include/clang/Frontend/HeaderSearchOptions.h head/contrib/llvm/tools/clang/include/clang/Frontend/PreprocessorOptions.h head/contrib/llvm/tools/clang/include/clang/Frontend/TextDiagnosticPrinter.h head/contrib/llvm/tools/clang/include/clang/Frontend/Utils.h head/contrib/llvm/tools/clang/include/clang/Lex/Lexer.h head/contrib/llvm/tools/clang/include/clang/Lex/LiteralSupport.h head/contrib/llvm/tools/clang/include/clang/Lex/MacroInfo.h head/contrib/llvm/tools/clang/include/clang/Lex/PPCallbacks.h head/contrib/llvm/tools/clang/include/clang/Lex/PreprocessingRecord.h head/contrib/llvm/tools/clang/include/clang/Lex/Preprocessor.h head/contrib/llvm/tools/clang/include/clang/Lex/Token.h head/contrib/llvm/tools/clang/include/clang/Lex/TokenLexer.h head/contrib/llvm/tools/clang/include/clang/Parse/Parser.h head/contrib/llvm/tools/clang/include/clang/Rewrite/FixItRewriter.h head/contrib/llvm/tools/clang/include/clang/Rewrite/Rewriter.h head/contrib/llvm/tools/clang/include/clang/Sema/AnalysisBasedWarnings.h head/contrib/llvm/tools/clang/include/clang/Sema/AttributeList.h head/contrib/llvm/tools/clang/include/clang/Sema/CodeCompleteConsumer.h head/contrib/llvm/tools/clang/include/clang/Sema/DeclSpec.h head/contrib/llvm/tools/clang/include/clang/Sema/DelayedDiagnostic.h head/contrib/llvm/tools/clang/include/clang/Sema/ExternalSemaSource.h head/contrib/llvm/tools/clang/include/clang/Sema/Initialization.h head/contrib/llvm/tools/clang/include/clang/Sema/Overload.h head/contrib/llvm/tools/clang/include/clang/Sema/Scope.h head/contrib/llvm/tools/clang/include/clang/Sema/Sema.h head/contrib/llvm/tools/clang/include/clang/Serialization/ASTBitCodes.h head/contrib/llvm/tools/clang/include/clang/Serialization/ASTReader.h head/contrib/llvm/tools/clang/include/clang/Serialization/ASTWriter.h head/contrib/llvm/tools/clang/include/clang/Serialization/ChainedIncludesSource.h head/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/GRStateTrait.h head/contrib/llvm/tools/clang/lib/AST/ASTContext.cpp head/contrib/llvm/tools/clang/lib/AST/ASTDiagnostic.cpp head/contrib/llvm/tools/clang/lib/AST/ASTImporter.cpp head/contrib/llvm/tools/clang/lib/AST/Decl.cpp head/contrib/llvm/tools/clang/lib/AST/DeclBase.cpp head/contrib/llvm/tools/clang/lib/AST/DeclCXX.cpp head/contrib/llvm/tools/clang/lib/AST/DeclObjC.cpp head/contrib/llvm/tools/clang/lib/AST/DeclPrinter.cpp head/contrib/llvm/tools/clang/lib/AST/DeclarationName.cpp head/contrib/llvm/tools/clang/lib/AST/Expr.cpp head/contrib/llvm/tools/clang/lib/AST/ExprCXX.cpp head/contrib/llvm/tools/clang/lib/AST/ExprClassification.cpp head/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp head/contrib/llvm/tools/clang/lib/AST/ExternalASTSource.cpp head/contrib/llvm/tools/clang/lib/AST/ItaniumMangle.cpp head/contrib/llvm/tools/clang/lib/AST/NestedNameSpecifier.cpp head/contrib/llvm/tools/clang/lib/AST/ParentMap.cpp head/contrib/llvm/tools/clang/lib/AST/RecordLayoutBuilder.cpp head/contrib/llvm/tools/clang/lib/AST/Stmt.cpp head/contrib/llvm/tools/clang/lib/AST/StmtPrinter.cpp head/contrib/llvm/tools/clang/lib/AST/StmtProfile.cpp head/contrib/llvm/tools/clang/lib/AST/TemplateBase.cpp head/contrib/llvm/tools/clang/lib/AST/TemplateName.cpp head/contrib/llvm/tools/clang/lib/AST/Type.cpp head/contrib/llvm/tools/clang/lib/AST/TypePrinter.cpp head/contrib/llvm/tools/clang/lib/Analysis/CFG.cpp head/contrib/llvm/tools/clang/lib/Analysis/CocoaConventions.cpp head/contrib/llvm/tools/clang/lib/Analysis/FormatString.cpp head/contrib/llvm/tools/clang/lib/Analysis/ReachableCode.cpp head/contrib/llvm/tools/clang/lib/Analysis/UninitializedValues.cpp head/contrib/llvm/tools/clang/lib/Basic/Builtins.cpp head/contrib/llvm/tools/clang/lib/Basic/Diagnostic.cpp head/contrib/llvm/tools/clang/lib/Basic/DiagnosticIDs.cpp head/contrib/llvm/tools/clang/lib/Basic/IdentifierTable.cpp head/contrib/llvm/tools/clang/lib/Basic/SourceManager.cpp head/contrib/llvm/tools/clang/lib/Basic/TargetInfo.cpp head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp head/contrib/llvm/tools/clang/lib/CodeGen/ABIInfo.h head/contrib/llvm/tools/clang/lib/CodeGen/BackendUtil.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGBlocks.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGBlocks.h head/contrib/llvm/tools/clang/lib/CodeGen/CGBuiltin.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGCXXABI.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGCXXABI.h head/contrib/llvm/tools/clang/lib/CodeGen/CGCall.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGCall.h head/contrib/llvm/tools/clang/lib/CodeGen/CGClass.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGCleanup.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.h head/contrib/llvm/tools/clang/lib/CodeGen/CGDecl.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGDeclCXX.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGException.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExpr.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExprAgg.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExprCXX.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExprComplex.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExprConstant.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGExprScalar.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGObjC.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGObjCGNU.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGObjCMac.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGObjCRuntime.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGObjCRuntime.h head/contrib/llvm/tools/clang/lib/CodeGen/CGRTTI.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGRecordLayout.h head/contrib/llvm/tools/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGStmt.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGTemporaries.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGVTT.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.h head/contrib/llvm/tools/clang/lib/CodeGen/CGValue.h head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenFunction.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenFunction.h head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.h head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTypes.cpp head/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTypes.h head/contrib/llvm/tools/clang/lib/CodeGen/ItaniumCXXABI.cpp head/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp head/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.h head/contrib/llvm/tools/clang/lib/Driver/Arg.cpp head/contrib/llvm/tools/clang/lib/Driver/ArgList.cpp head/contrib/llvm/tools/clang/lib/Driver/Driver.cpp head/contrib/llvm/tools/clang/lib/Driver/Option.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChain.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp head/contrib/llvm/tools/clang/lib/Driver/ToolChains.h head/contrib/llvm/tools/clang/lib/Driver/Tools.cpp head/contrib/llvm/tools/clang/lib/Driver/Tools.h head/contrib/llvm/tools/clang/lib/Frontend/ASTUnit.cpp head/contrib/llvm/tools/clang/lib/Frontend/CacheTokens.cpp head/contrib/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp head/contrib/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp head/contrib/llvm/tools/clang/lib/Frontend/DependencyFile.cpp head/contrib/llvm/tools/clang/lib/Frontend/FrontendAction.cpp head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp head/contrib/llvm/tools/clang/lib/Frontend/InitPreprocessor.cpp head/contrib/llvm/tools/clang/lib/Frontend/PrintPreprocessedOutput.cpp head/contrib/llvm/tools/clang/lib/Frontend/TextDiagnosticPrinter.cpp head/contrib/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp head/contrib/llvm/tools/clang/lib/Headers/float.h head/contrib/llvm/tools/clang/lib/Headers/stdarg.h head/contrib/llvm/tools/clang/lib/Lex/HeaderSearch.cpp head/contrib/llvm/tools/clang/lib/Lex/Lexer.cpp head/contrib/llvm/tools/clang/lib/Lex/MacroArgs.cpp head/contrib/llvm/tools/clang/lib/Lex/MacroArgs.h head/contrib/llvm/tools/clang/lib/Lex/MacroInfo.cpp head/contrib/llvm/tools/clang/lib/Lex/PPDirectives.cpp head/contrib/llvm/tools/clang/lib/Lex/PPLexerChange.cpp head/contrib/llvm/tools/clang/lib/Lex/PPMacroExpansion.cpp head/contrib/llvm/tools/clang/lib/Lex/Pragma.cpp head/contrib/llvm/tools/clang/lib/Lex/PreprocessingRecord.cpp head/contrib/llvm/tools/clang/lib/Lex/Preprocessor.cpp head/contrib/llvm/tools/clang/lib/Lex/TokenLexer.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseAST.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseDecl.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseExpr.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseExprCXX.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseObjc.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseStmt.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseTemplate.cpp head/contrib/llvm/tools/clang/lib/Parse/ParseTentative.cpp head/contrib/llvm/tools/clang/lib/Parse/Parser.cpp head/contrib/llvm/tools/clang/lib/Rewrite/FixItRewriter.cpp head/contrib/llvm/tools/clang/lib/Rewrite/HTMLRewrite.cpp head/contrib/llvm/tools/clang/lib/Rewrite/RewriteObjC.cpp head/contrib/llvm/tools/clang/lib/Rewrite/Rewriter.cpp head/contrib/llvm/tools/clang/lib/Sema/AnalysisBasedWarnings.cpp head/contrib/llvm/tools/clang/lib/Sema/AttributeList.cpp head/contrib/llvm/tools/clang/lib/Sema/CodeCompleteConsumer.cpp head/contrib/llvm/tools/clang/lib/Sema/DeclSpec.cpp head/contrib/llvm/tools/clang/lib/Sema/DelayedDiagnostic.cpp head/contrib/llvm/tools/clang/lib/Sema/JumpDiagnostics.cpp head/contrib/llvm/tools/clang/lib/Sema/Sema.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaCXXCast.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaCXXScopeSpec.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaCodeComplete.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDeclAttr.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaDeclObjC.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaExprObjC.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaLookup.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaObjCProperty.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaOverload.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaStmt.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplate.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplateDeduction.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiate.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaTemplateVariadic.cpp head/contrib/llvm/tools/clang/lib/Sema/SemaType.cpp head/contrib/llvm/tools/clang/lib/Sema/TreeTransform.h head/contrib/llvm/tools/clang/lib/Sema/TypeLocBuilder.h head/contrib/llvm/tools/clang/lib/Serialization/ASTReader.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTReaderDecl.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTReaderStmt.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTWriter.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTWriterDecl.cpp head/contrib/llvm/tools/clang/lib/Serialization/ASTWriterStmt.cpp head/contrib/llvm/tools/clang/lib/Serialization/ChainedIncludesSource.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/Checkers.td head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/IteratorsChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CFRefCount.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/Environment.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/RegionStore.cpp head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp head/contrib/llvm/tools/clang/tools/driver/cc1_main.cpp head/contrib/llvm/tools/clang/tools/driver/cc1as_main.cpp head/contrib/llvm/tools/clang/tools/driver/driver.cpp head/contrib/llvm/utils/TableGen/ARMDecoderEmitter.cpp head/contrib/llvm/utils/TableGen/AsmMatcherEmitter.cpp head/contrib/llvm/utils/TableGen/AsmWriterEmitter.cpp head/contrib/llvm/utils/TableGen/ClangDiagnosticsEmitter.cpp head/contrib/llvm/utils/TableGen/CodeEmitterGen.cpp head/contrib/llvm/utils/TableGen/CodeGenDAGPatterns.cpp head/contrib/llvm/utils/TableGen/CodeGenDAGPatterns.h head/contrib/llvm/utils/TableGen/CodeGenInstruction.cpp head/contrib/llvm/utils/TableGen/CodeGenInstruction.h head/contrib/llvm/utils/TableGen/CodeGenRegisters.cpp head/contrib/llvm/utils/TableGen/CodeGenRegisters.h head/contrib/llvm/utils/TableGen/CodeGenTarget.cpp head/contrib/llvm/utils/TableGen/CodeGenTarget.h head/contrib/llvm/utils/TableGen/DAGISelMatcherGen.cpp head/contrib/llvm/utils/TableGen/DisassemblerEmitter.cpp head/contrib/llvm/utils/TableGen/EDEmitter.cpp head/contrib/llvm/utils/TableGen/FastISelEmitter.cpp head/contrib/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp head/contrib/llvm/utils/TableGen/InstrInfoEmitter.cpp head/contrib/llvm/utils/TableGen/InstrInfoEmitter.h head/contrib/llvm/utils/TableGen/IntrinsicEmitter.cpp head/contrib/llvm/utils/TableGen/LLVMCConfigurationEmitter.cpp head/contrib/llvm/utils/TableGen/NeonEmitter.cpp head/contrib/llvm/utils/TableGen/Record.cpp head/contrib/llvm/utils/TableGen/Record.h head/contrib/llvm/utils/TableGen/RegisterInfoEmitter.cpp head/contrib/llvm/utils/TableGen/RegisterInfoEmitter.h head/contrib/llvm/utils/TableGen/SetTheory.cpp head/contrib/llvm/utils/TableGen/SetTheory.h head/contrib/llvm/utils/TableGen/SubtargetEmitter.cpp head/contrib/llvm/utils/TableGen/SubtargetEmitter.h head/contrib/llvm/utils/TableGen/TGLexer.cpp head/contrib/llvm/utils/TableGen/TGLexer.h head/contrib/llvm/utils/TableGen/TGParser.h head/contrib/llvm/utils/TableGen/TableGen.cpp head/contrib/llvm/utils/TableGen/X86RecognizableInstr.cpp head/contrib/llvm/utils/TableGen/X86RecognizableInstr.h head/lib/clang/Makefile head/lib/clang/clang.build.mk head/lib/clang/include/clang/Basic/Version.inc head/lib/clang/include/llvm/Config/config.h head/lib/clang/include/llvm/Config/llvm-config.h head/lib/clang/libclangfrontend/Makefile head/lib/clang/libclangsema/Makefile head/lib/clang/libllvmanalysis/Makefile head/lib/clang/libllvmarmasmparser/Makefile head/lib/clang/libllvmarmcodegen/Makefile head/lib/clang/libllvmarmdisassembler/Makefile head/lib/clang/libllvmarminfo/Makefile head/lib/clang/libllvmarminstprinter/Makefile head/lib/clang/libllvmcodegen/Makefile head/lib/clang/libllvmcore/Makefile head/lib/clang/libllvmipo/Makefile head/lib/clang/libllvmmc/Makefile head/lib/clang/libllvmmipscodegen/Makefile head/lib/clang/libllvmmipsinfo/Makefile head/lib/clang/libllvmpowerpccodegen/Makefile head/lib/clang/libllvmpowerpcinfo/Makefile head/lib/clang/libllvmpowerpcinstprinter/Makefile head/lib/clang/libllvmscalaropts/Makefile head/lib/clang/libllvmsupport/Makefile head/lib/clang/libllvmtarget/Makefile head/lib/clang/libllvmtransformutils/Makefile head/lib/clang/libllvmx86asmparser/Makefile head/lib/clang/libllvmx86codegen/Makefile head/lib/clang/libllvmx86disassembler/Makefile head/lib/clang/libllvmx86info/Makefile head/lib/clang/libllvmx86instprinter/Makefile head/usr.bin/clang/clang/Makefile head/usr.bin/clang/tblgen/Makefile Directory Properties: head/contrib/llvm/ (props changed) head/contrib/llvm/tools/clang/ (props changed) Modified: head/contrib/llvm/include/llvm-c/Core.h ============================================================================== --- head/contrib/llvm/include/llvm-c/Core.h Sun Jul 17 19:24:54 2011 (r224144) +++ head/contrib/llvm/include/llvm-c/Core.h Sun Jul 17 19:51:40 2011 (r224145) @@ -68,13 +68,6 @@ typedef struct LLVMOpaqueModule *LLVMMod */ typedef struct LLVMOpaqueType *LLVMTypeRef; -/** - * When building recursive types using LLVMRefineType, LLVMTypeRef values may - * become invalid; use LLVMTypeHandleRef to resolve this problem. See the - * llvm::AbstractTypeHolder class. - */ -typedef struct LLVMOpaqueTypeHandle *LLVMTypeHandleRef; - typedef struct LLVMOpaqueValue *LLVMValueRef; typedef struct LLVMOpaqueBasicBlock *LLVMBasicBlockRef; typedef struct LLVMOpaqueBuilder *LLVMBuilderRef; @@ -206,7 +199,6 @@ typedef enum { LLVMStructTypeKind, /**< Structures */ LLVMArrayTypeKind, /**< Arrays */ LLVMPointerTypeKind, /**< Pointers */ - LLVMOpaqueTypeKind, /**< Opaque: type with unknown structure */ LLVMVectorTypeKind, /**< SIMD 'packed' format, or other vector type */ LLVMMetadataTypeKind, /**< Metadata */ LLVMX86_MMXTypeKind /**< X86 MMX */ @@ -320,12 +312,6 @@ void LLVMSetDataLayout(LLVMModuleRef M, const char *LLVMGetTarget(LLVMModuleRef M); void LLVMSetTarget(LLVMModuleRef M, const char *Triple); -/** See Module::addTypeName. */ -LLVMBool LLVMAddTypeName(LLVMModuleRef M, const char *Name, LLVMTypeRef Ty); -void LLVMDeleteTypeName(LLVMModuleRef M, const char *Name); -LLVMTypeRef LLVMGetTypeByName(LLVMModuleRef M, const char *Name); -const char *LLVMGetTypeName(LLVMModuleRef M, LLVMTypeRef Ty); - /** See Module::dump. */ void LLVMDumpModule(LLVMModuleRef M); @@ -401,9 +387,16 @@ LLVMTypeRef LLVMStructTypeInContext(LLVM unsigned ElementCount, LLVMBool Packed); LLVMTypeRef LLVMStructType(LLVMTypeRef *ElementTypes, unsigned ElementCount, LLVMBool Packed); +LLVMTypeRef LLVMStructCreateNamed(LLVMContextRef C, const char *Name); +void LLVMStructSetBody(LLVMTypeRef StructTy, LLVMTypeRef *ElementTypes, + unsigned ElementCount, LLVMBool Packed); + unsigned LLVMCountStructElementTypes(LLVMTypeRef StructTy); void LLVMGetStructElementTypes(LLVMTypeRef StructTy, LLVMTypeRef *Dest); LLVMBool LLVMIsPackedStruct(LLVMTypeRef StructTy); +LLVMBool LLVMIsOpaqueStruct(LLVMTypeRef StructTy); + +LLVMTypeRef LLVMGetTypeByName(LLVMModuleRef M, const char *Name); /* Operations on array, pointer, and vector types (sequence types) */ LLVMTypeRef LLVMArrayType(LLVMTypeRef ElementType, unsigned ElementCount); @@ -418,21 +411,12 @@ unsigned LLVMGetVectorSize(LLVMTypeRef V /* Operations on other types */ LLVMTypeRef LLVMVoidTypeInContext(LLVMContextRef C); LLVMTypeRef LLVMLabelTypeInContext(LLVMContextRef C); -LLVMTypeRef LLVMOpaqueTypeInContext(LLVMContextRef C); LLVMTypeRef LLVMX86MMXTypeInContext(LLVMContextRef C); LLVMTypeRef LLVMVoidType(void); LLVMTypeRef LLVMLabelType(void); -LLVMTypeRef LLVMOpaqueType(void); LLVMTypeRef LLVMX86MMXType(void); -/* Operations on type handles */ -LLVMTypeHandleRef LLVMCreateTypeHandle(LLVMTypeRef PotentiallyAbstractTy); -void LLVMRefineType(LLVMTypeRef AbstractTy, LLVMTypeRef ConcreteTy); -LLVMTypeRef LLVMResolveTypeHandle(LLVMTypeHandleRef TypeHandle); -void LLVMDisposeTypeHandle(LLVMTypeHandleRef TypeHandle); - - /*===-- Values ------------------------------------------------------------===*/ /* The bulk of LLVM's object model consists of values, which comprise a very @@ -581,6 +565,9 @@ LLVMValueRef LLVMConstArray(LLVMTypeRef LLVMValueRef *ConstantVals, unsigned Length); LLVMValueRef LLVMConstStruct(LLVMValueRef *ConstantVals, unsigned Count, LLVMBool Packed); +LLVMValueRef LLVMConstNamedStruct(LLVMTypeRef StructTy, + LLVMValueRef *ConstantVals, + unsigned Count); LLVMValueRef LLVMConstVector(LLVMValueRef *ScalarConstantVals, unsigned Size); /* Constant expressions */ @@ -1117,7 +1104,6 @@ namespace llvm { DEFINE_SIMPLE_CONVERSION_FUNCTIONS(Module, LLVMModuleRef ) DEFINE_SIMPLE_CONVERSION_FUNCTIONS(BasicBlock, LLVMBasicBlockRef ) DEFINE_SIMPLE_CONVERSION_FUNCTIONS(IRBuilder<>, LLVMBuilderRef ) - DEFINE_SIMPLE_CONVERSION_FUNCTIONS(PATypeHolder, LLVMTypeHandleRef ) DEFINE_SIMPLE_CONVERSION_FUNCTIONS(MemoryBuffer, LLVMMemoryBufferRef ) DEFINE_SIMPLE_CONVERSION_FUNCTIONS(LLVMContext, LLVMContextRef ) DEFINE_SIMPLE_CONVERSION_FUNCTIONS(Use, LLVMUseRef ) Modified: head/contrib/llvm/include/llvm-c/Target.h ============================================================================== --- head/contrib/llvm/include/llvm-c/Target.h Sun Jul 17 19:24:54 2011 (r224144) +++ head/contrib/llvm/include/llvm-c/Target.h Sun Jul 17 19:51:40 2011 (r224145) @@ -41,6 +41,11 @@ typedef struct LLVMStructLayout *LLVMStr #include "llvm/Config/Targets.def" #undef LLVM_TARGET /* Explicit undef to make SWIG happier */ +#define LLVM_TARGET(TargetName) \ + void LLVMInitialize##TargetName##MCAsmInfo(void); +#include "llvm/Config/Targets.def" +#undef LLVM_TARGET /* Explicit undef to make SWIG happier */ + /** LLVMInitializeAllTargetInfos - The main program should call this function if it wants access to all available targets that LLVM is configured to support. */ @@ -67,6 +72,7 @@ static inline LLVMBool LLVMInitializeNat #ifdef LLVM_NATIVE_TARGET LLVM_NATIVE_TARGETINFO(); LLVM_NATIVE_TARGET(); + LLVM_NATIVE_MCASMINFO(); return 0; #else return 1; @@ -141,12 +147,6 @@ unsigned LLVMElementAtOffset(LLVMTargetD unsigned long long LLVMOffsetOfElement(LLVMTargetDataRef, LLVMTypeRef StructTy, unsigned Element); -/** Struct layouts are speculatively cached. If a TargetDataRef is alive when - types are being refined and removed, this method must be called whenever a - struct type is removed to avoid a dangling pointer in this cache. - See the method llvm::TargetData::InvalidateStructLayoutInfo. */ -void LLVMInvalidateStructLayout(LLVMTargetDataRef, LLVMTypeRef StructTy); - /** Deallocates a TargetData. See the destructor llvm::TargetData::~TargetData. */ void LLVMDisposeTargetData(LLVMTargetDataRef); Modified: head/contrib/llvm/include/llvm-c/Transforms/IPO.h ============================================================================== --- head/contrib/llvm/include/llvm-c/Transforms/IPO.h Sun Jul 17 19:24:54 2011 (r224144) +++ head/contrib/llvm/include/llvm-c/Transforms/IPO.h Sun Jul 17 19:51:40 2011 (r224145) @@ -30,9 +30,6 @@ void LLVMAddConstantMergePass(LLVMPassMa /** See llvm::createDeadArgEliminationPass function. */ void LLVMAddDeadArgEliminationPass(LLVMPassManagerRef PM); -/** See llvm::createDeadTypeEliminationPass function. */ -void LLVMAddDeadTypeEliminationPass(LLVMPassManagerRef PM); - /** See llvm::createFunctionAttrsPass function. */ void LLVMAddFunctionAttrsPass(LLVMPassManagerRef PM); Modified: head/contrib/llvm/include/llvm/ADT/APFloat.h ============================================================================== --- head/contrib/llvm/include/llvm/ADT/APFloat.h Sun Jul 17 19:24:54 2011 (r224144) +++ head/contrib/llvm/include/llvm/ADT/APFloat.h Sun Jul 17 19:51:40 2011 (r224145) @@ -109,6 +109,7 @@ namespace llvm { typedef signed short exponent_t; struct fltSemantics; + class APSInt; class StringRef; /* When bits of a floating point number are truncated, this enum is @@ -283,6 +284,7 @@ namespace llvm { opStatus convert(const fltSemantics &, roundingMode, bool *); opStatus convertToInteger(integerPart *, unsigned int, bool, roundingMode, bool *) const; + opStatus convertToInteger(APSInt&, roundingMode, bool *) const; opStatus convertFromAPInt(const APInt &, bool, roundingMode); opStatus convertFromSignExtendedInteger(const integerPart *, unsigned int, Modified: head/contrib/llvm/include/llvm/ADT/APInt.h ============================================================================== --- head/contrib/llvm/include/llvm/ADT/APInt.h Sun Jul 17 19:24:54 2011 (r224144) +++ head/contrib/llvm/include/llvm/ADT/APInt.h Sun Jul 17 19:51:40 2011 (r224145) @@ -1241,18 +1241,19 @@ public: /// toString - Converts an APInt to a string and append it to Str. Str is /// commonly a SmallString. - void toString(SmallVectorImpl &Str, unsigned Radix, bool Signed) const; + void toString(SmallVectorImpl &Str, unsigned Radix, bool Signed, + bool formatAsCLiteral = false) const; /// Considers the APInt to be unsigned and converts it into a string in the /// radix given. The radix can be 2, 8, 10 or 16. void toStringUnsigned(SmallVectorImpl &Str, unsigned Radix = 10) const { - toString(Str, Radix, false); + toString(Str, Radix, false, false); } /// Considers the APInt to be signed and converts it into a string in the /// radix given. The radix can be 2, 8, 10 or 16. void toStringSigned(SmallVectorImpl &Str, unsigned Radix = 10) const { - toString(Str, Radix, true); + toString(Str, Radix, true, false); } /// toString - This returns the APInt as a std::string. Note that this is an Modified: head/contrib/llvm/include/llvm/ADT/ArrayRef.h ============================================================================== --- head/contrib/llvm/include/llvm/ADT/ArrayRef.h Sun Jul 17 19:24:54 2011 (r224144) +++ head/contrib/llvm/include/llvm/ADT/ArrayRef.h Sun Jul 17 19:51:40 2011 (r224145) @@ -39,7 +39,7 @@ namespace llvm { const T *Data; /// The number of elements. - size_t Length; + size_type Length; public: /// @name Constructors @@ -56,6 +56,10 @@ namespace llvm { /*implicit*/ ArrayRef(const T *data, size_t length) : Data(data), Length(length) {} + /// Construct an ArrayRef from a range. + ArrayRef(const T *begin, const T *end) + : Data(begin), Length(end - begin) {} + /// Construct an ArrayRef from a SmallVector. /*implicit*/ ArrayRef(const SmallVectorImpl &Vec) : Data(Vec.data()), Length(Vec.size()) {} @@ -96,6 +100,16 @@ namespace llvm { return Data[Length-1]; } + /// equals - Check for element-wise equality. + bool equals(ArrayRef RHS) const { + if (Length != RHS.Length) + return false; + for (size_type i = 0; i != Length; i++) + if (Data[i] != RHS.Data[i]) + return false; + return true; + } + /// slice(n) - Chop off the first N elements of the array. ArrayRef slice(unsigned N) { assert(N <= size() && "Invalid specifier"); @@ -125,8 +139,30 @@ namespace llvm { } /// @} + /// @name Conversion operators + /// @{ + operator std::vector() const { + return std::vector(Data, Data+Length); + } + + /// @} }; + /// @name ArrayRef Comparison Operators + /// @{ + + template + inline bool operator==(ArrayRef LHS, ArrayRef RHS) { + return LHS.equals(RHS); + } + + template + inline bool operator!=(ArrayRef LHS, ArrayRef RHS) { + return !(LHS == RHS); + } + + /// @} + // ArrayRefs can be treated like a POD type. template struct isPodLike; template struct isPodLike > { Modified: head/contrib/llvm/include/llvm/ADT/ImmutableList.h ============================================================================== --- head/contrib/llvm/include/llvm/ADT/ImmutableList.h Sun Jul 17 19:24:54 2011 (r224144) +++ head/contrib/llvm/include/llvm/ADT/ImmutableList.h Sun Jul 17 19:51:40 2011 (r224145) @@ -103,6 +103,14 @@ public: /// isEmpty - Returns true if the list is empty. bool isEmpty() const { return !X; } + bool contains(const T& V) const { + for (iterator I = begin(), E = end(); I != E; ++I) { + if (*I == V) + return true; + } + return false; + } + /// isEqual - Returns true if two lists are equal. Because all lists created /// from the same ImmutableListFactory are uniqued, this has O(1) complexity /// because it the contents of the list do not need to be compared. Note Modified: head/contrib/llvm/include/llvm/ADT/PackedVector.h ============================================================================== --- head/contrib/llvm/include/llvm/ADT/PackedVector.h Sun Jul 17 19:24:54 2011 (r224144) +++ head/contrib/llvm/include/llvm/ADT/PackedVector.h Sun Jul 17 19:51:40 2011 (r224145) @@ -90,7 +90,7 @@ public: Vec.setValue(Vec.Bits, Idx, val); return *this; } - operator T() { + operator T() const { return Vec.getValue(Vec.Bits, Idx); } }; Modified: head/contrib/llvm/include/llvm/ADT/SmallVector.h ============================================================================== --- head/contrib/llvm/include/llvm/ADT/SmallVector.h Sun Jul 17 19:24:54 2011 (r224144) +++ head/contrib/llvm/include/llvm/ADT/SmallVector.h Sun Jul 17 19:51:40 2011 (r224145) @@ -410,7 +410,14 @@ public: this->setEnd(this->end()+1); // Push everything else over. std::copy_backward(I, this->end()-1, this->end()); - *I = Elt; + + // If we just moved the element we're inserting, be sure to update + // the reference. + const T *EltPtr = &Elt; + if (I <= EltPtr && EltPtr < this->EndX) + ++EltPtr; + + *I = *EltPtr; return I; } size_t EltNo = I-this->begin(); Modified: head/contrib/llvm/include/llvm/ADT/StringMap.h ============================================================================== --- head/contrib/llvm/include/llvm/ADT/StringMap.h Sun Jul 17 19:24:54 2011 (r224144) +++ head/contrib/llvm/include/llvm/ADT/StringMap.h Sun Jul 17 19:51:40 2011 (r224145) @@ -140,7 +140,7 @@ public: /// StringMapEntry object. const char *getKeyData() const {return reinterpret_cast(this+1);} - const char *first() const { return getKeyData(); } + StringRef first() const { return StringRef(getKeyData(), getKeyLength()); } /// Create - Create a StringMapEntry for the specified key and default /// construct the value. @@ -307,7 +307,7 @@ public: return ValueTy(); } - ValueTy& operator[](StringRef Key) { + ValueTy &operator[](StringRef Key) { return GetOrCreateValue(Key).getValue(); } @@ -355,8 +355,7 @@ public: /// exists, return it. Otherwise, default construct a value, insert it, and /// return. template - StringMapEntry &GetOrCreateValue(StringRef Key, - InitTy Val) { + MapEntryTy &GetOrCreateValue(StringRef Key, InitTy Val) { unsigned BucketNo = LookupBucketFor(Key); ItemBucket &Bucket = TheTable[BucketNo]; if (Bucket.Item && Bucket.Item != getTombstoneVal()) @@ -378,22 +377,10 @@ public: return *NewItem; } - StringMapEntry &GetOrCreateValue(StringRef Key) { + MapEntryTy &GetOrCreateValue(StringRef Key) { return GetOrCreateValue(Key, ValueTy()); } - template - StringMapEntry &GetOrCreateValue(const char *KeyStart, - const char *KeyEnd, - InitTy Val) { - return GetOrCreateValue(StringRef(KeyStart, KeyEnd - KeyStart), Val); - } - - StringMapEntry &GetOrCreateValue(const char *KeyStart, - const char *KeyEnd) { - return GetOrCreateValue(StringRef(KeyStart, KeyEnd - KeyStart)); - } - /// remove - Remove the specified key/value pair from the map, but do not /// erase it. This aborts if the key is not in the map. void remove(MapEntryTy *KeyValue) { Modified: head/contrib/llvm/include/llvm/ADT/Triple.h ============================================================================== --- head/contrib/llvm/include/llvm/ADT/Triple.h Sun Jul 17 19:24:54 2011 (r224144) +++ head/contrib/llvm/include/llvm/ADT/Triple.h Sun Jul 17 19:51:40 2011 (r224145) @@ -95,7 +95,8 @@ public: Solaris, Win32, Haiku, - Minix + Minix, + RTEMS }; enum EnvironmentType { UnknownEnvironment, @@ -237,19 +238,10 @@ public: /// specialized because it is a common query. unsigned getOSMajorVersion() const { unsigned Maj, Min, Micro; - getDarwinNumber(Maj, Min, Micro); + getOSVersion(Maj, Min, Micro); return Maj; } - void getDarwinNumber(unsigned &Major, unsigned &Minor, - unsigned &Micro) const { - return getOSVersion(Major, Minor, Micro); - } - - unsigned getDarwinMajorNumber() const { - return getOSMajorVersion(); - } - /// isOSVersionLT - Helper function for doing comparisons against version /// numbers included in the target triple. bool isOSVersionLT(unsigned Major, unsigned Minor = 0, @@ -275,7 +267,7 @@ public: /// isOSDarwin - Is this a "Darwin" OS (OS X or iOS). bool isOSDarwin() const { - return isMacOSX() ||getOS() == Triple::IOS; + return isMacOSX() || getOS() == Triple::IOS; } /// isOSWindows - Is this a "Windows" OS. @@ -288,7 +280,7 @@ public: /// compatibility, which handles supporting skewed version numbering schemes /// used by the "darwin" triples. unsigned isMacOSXVersionLT(unsigned Major, unsigned Minor = 0, - unsigned Micro = 0) const { + unsigned Micro = 0) const { assert(isMacOSX() && "Not an OS X triple!"); // If this is OS X, expect a sane version number. @@ -299,7 +291,7 @@ public: assert(Major == 10 && "Unexpected major version"); return isOSVersionLT(Minor + 4, Micro, 0); } - + /// @} /// @name Mutators /// @{ Copied: head/contrib/llvm/include/llvm/Analysis/BlockFrequency.h (from r224136, vendor/llvm/dist/include/llvm/Analysis/BlockFrequency.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/include/llvm/Analysis/BlockFrequency.h Sun Jul 17 19:51:40 2011 (r224145, copy of r224136, vendor/llvm/dist/include/llvm/Analysis/BlockFrequency.h) @@ -0,0 +1,53 @@ +//========-------- BlockFrequency.h - Block Frequency Analysis -------========// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// Loops should be simplified before this analysis. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_ANALYSIS_BLOCKFREQUENCY_H +#define LLVM_ANALYSIS_BLOCKFREQUENCY_H + +#include "llvm/Pass.h" +#include + +namespace llvm { + +class BranchProbabilityInfo; +template +class BlockFrequencyImpl; + +/// BlockFrequency pass uses BlockFrequencyImpl implementation to estimate +/// IR basic block frequencies. +class BlockFrequency : public FunctionPass { + + BlockFrequencyImpl *BFI; + +public: + static char ID; + + BlockFrequency(); + + ~BlockFrequency(); + + void getAnalysisUsage(AnalysisUsage &AU) const; + + bool runOnFunction(Function &F); + + /// getblockFreq - Return block frequency. Never return 0, value must be + /// positive. Please note that initial frequency is equal to 1024. It means + /// that we should not rely on the value itself, but only on the comparison to + /// the other block frequencies. We do this to avoid using of the floating + /// points. + uint32_t getBlockFreq(BasicBlock *BB); +}; + +} + +#endif Copied: head/contrib/llvm/include/llvm/Analysis/BlockFrequencyImpl.h (from r224136, vendor/llvm/dist/include/llvm/Analysis/BlockFrequencyImpl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/llvm/include/llvm/Analysis/BlockFrequencyImpl.h Sun Jul 17 19:51:40 2011 (r224145, copy of r224136, vendor/llvm/dist/include/llvm/Analysis/BlockFrequencyImpl.h) @@ -0,0 +1,349 @@ +//===---- BlockFrequencyImpl.h - Machine Block Frequency Implementation ---===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// Shared implementation of BlockFrequency for IR and Machine Instructions. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_ANALYSIS_BLOCKFREQUENCYIMPL_H +#define LLVM_ANALYSIS_BLOCKFREQUENCYIMPL_H + +#include "llvm/BasicBlock.h" +#include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/PostOrderIterator.h" +#include "llvm/CodeGen/MachineBasicBlock.h" +#include "llvm/CodeGen/MachineFunction.h" +#include "llvm/Support/BranchProbability.h" +#include "llvm/Support/Debug.h" +#include "llvm/Support/raw_ostream.h" +#include +#include +#include + +namespace llvm { + + +class BlockFrequency; +class MachineBlockFrequency; + +/// BlockFrequencyImpl implements block frequency algorithm for IR and +/// Machine Instructions. Algorithm starts with value 1024 (START_FREQ) +/// for the entry block and then propagates frequencies using branch weights +/// from (Machine)BranchProbabilityInfo. LoopInfo is not required because +/// algorithm can find "backedges" by itself. +template +class BlockFrequencyImpl { + + DenseMap Freqs; + + BlockProbInfoT *BPI; + + FunctionT *Fn; + + typedef GraphTraits< Inverse > GT; + + static const uint32_t START_FREQ = 1024; + + std::string getBlockName(BasicBlock *BB) const { + return BB->getNameStr(); + } + + std::string getBlockName(MachineBasicBlock *MBB) const { + std::stringstream ss; + ss << "BB#" << MBB->getNumber(); + + if (const BasicBlock *BB = MBB->getBasicBlock()) + ss << " derived from LLVM BB " << BB->getNameStr(); + + return ss.str(); + } + + void setBlockFreq(BlockT *BB, uint32_t Freq) { + Freqs[BB] = Freq; + DEBUG(dbgs() << "Frequency(" << getBlockName(BB) << ") = " << Freq << "\n"); + } + + /// getEdgeFreq - Return edge frequency based on SRC frequency and Src -> Dst + /// edge probability. + uint32_t getEdgeFreq(BlockT *Src, BlockT *Dst) const { + BranchProbability Prob = BPI->getEdgeProbability(Src, Dst); + uint64_t N = Prob.getNumerator(); + uint64_t D = Prob.getDenominator(); + uint64_t Res = (N * getBlockFreq(Src)) / D; + + assert(Res <= UINT32_MAX); + return (uint32_t) Res; + } + + /// incBlockFreq - Increase BB block frequency by FREQ. + /// + void incBlockFreq(BlockT *BB, uint32_t Freq) { + Freqs[BB] += Freq; + DEBUG(dbgs() << "Frequency(" << getBlockName(BB) << ") += " << Freq + << " --> " << Freqs[BB] << "\n"); + } + + /// divBlockFreq - Divide BB block frequency by PROB. If Prob = 0 do nothing. + /// + void divBlockFreq(BlockT *BB, BranchProbability Prob) { + uint64_t N = Prob.getNumerator(); + assert(N && "Illegal division by zero!"); + uint64_t D = Prob.getDenominator(); + uint64_t Freq = (Freqs[BB] * D) / N; + + // Should we assert it? + if (Freq > UINT32_MAX) + Freq = UINT32_MAX; + + Freqs[BB] = (uint32_t) Freq; + DEBUG(dbgs() << "Frequency(" << getBlockName(BB) << ") /= (" << Prob + << ") --> " << Freqs[BB] << "\n"); + } + + // All blocks in postorder. + std::vector POT; + + // Map Block -> Position in reverse-postorder list. + DenseMap RPO; + + // Cycle Probability for each bloch. + DenseMap CycleProb; + + // (reverse-)postorder traversal iterators. + typedef typename std::vector::iterator pot_iterator; + typedef typename std::vector::reverse_iterator rpot_iterator; + + pot_iterator pot_begin() { return POT.begin(); } + pot_iterator pot_end() { return POT.end(); } + + rpot_iterator rpot_begin() { return POT.rbegin(); } + rpot_iterator rpot_end() { return POT.rend(); } + + rpot_iterator rpot_at(BlockT *BB) { + rpot_iterator I = rpot_begin(); + unsigned idx = RPO[BB]; + assert(idx); + std::advance(I, idx - 1); + + assert(*I == BB); + return I; + } + + + /// Return a probability of getting to the DST block through SRC->DST edge. + /// + BranchProbability getBackEdgeProbability(BlockT *Src, BlockT *Dst) const { + uint32_t N = getEdgeFreq(Src, Dst); + uint32_t D = getBlockFreq(Dst); + + return BranchProbability(N, D); + } + + /// isReachable - Returns if BB block is reachable from the entry. + /// + bool isReachable(BlockT *BB) { + return RPO.count(BB); + } + + /// isBackedge - Return if edge Src -> Dst is a backedge. + /// + bool isBackedge(BlockT *Src, BlockT *Dst) { + assert(isReachable(Src)); + assert(isReachable(Dst)); + + unsigned a = RPO[Src]; + unsigned b = RPO[Dst]; + + return a > b; + } + + /// getSingleBlockPred - return single BB block predecessor or NULL if + /// BB has none or more predecessors. + BlockT *getSingleBlockPred(BlockT *BB) { + typename GT::ChildIteratorType + PI = GraphTraits< Inverse >::child_begin(BB), + PE = GraphTraits< Inverse >::child_end(BB); + + if (PI == PE) + return 0; + + BlockT *Pred = *PI; + + ++PI; + if (PI != PE) + return 0; + + return Pred; + } + + void doBlock(BlockT *BB, BlockT *LoopHead, + SmallPtrSet &BlocksInLoop) { + + DEBUG(dbgs() << "doBlock(" << getBlockName(BB) << ")\n"); + setBlockFreq(BB, 0); + + if (BB == LoopHead) { + setBlockFreq(BB, START_FREQ); + return; + } + + if(BlockT *Pred = getSingleBlockPred(BB)) { + if (BlocksInLoop.count(Pred)) + setBlockFreq(BB, getEdgeFreq(Pred, BB)); + // TODO: else? irreducible, ignore it for now. + return; + } + + bool isInLoop = false; + bool isLoopHead = false; + + for (typename GT::ChildIteratorType + PI = GraphTraits< Inverse >::child_begin(BB), + PE = GraphTraits< Inverse >::child_end(BB); + PI != PE; ++PI) { + BlockT *Pred = *PI; + + if (isReachable(Pred) && isBackedge(Pred, BB)) { + isLoopHead = true; + } else if (BlocksInLoop.count(Pred)) { + incBlockFreq(BB, getEdgeFreq(Pred, BB)); + isInLoop = true; + } + // TODO: else? irreducible. + } + + if (!isInLoop) + return; + + if (!isLoopHead) + return; + + assert(START_FREQ >= CycleProb[BB]); + uint32_t CProb = CycleProb[BB]; + uint32_t Numerator = START_FREQ - CProb ? START_FREQ - CProb : 1; + divBlockFreq(BB, BranchProbability(Numerator, START_FREQ)); + } + + /// doLoop - Propagate block frequency down throught the loop. + void doLoop(BlockT *Head, BlockT *Tail) { + DEBUG(dbgs() << "doLoop(" << getBlockName(Head) << ", " + << getBlockName(Tail) << ")\n"); + + SmallPtrSet BlocksInLoop; + + for (rpot_iterator I = rpot_at(Head), E = rpot_end(); I != E; ++I) { + BlockT *BB = *I; + doBlock(BB, Head, BlocksInLoop); + + BlocksInLoop.insert(BB); + } + + // Compute loop's cyclic probability using backedges probabilities. + for (typename GT::ChildIteratorType + PI = GraphTraits< Inverse >::child_begin(Head), + PE = GraphTraits< Inverse >::child_end(Head); + PI != PE; ++PI) { + BlockT *Pred = *PI; + assert(Pred); + if (isReachable(Pred) && isBackedge(Pred, Head)) { + BranchProbability Prob = getBackEdgeProbability(Pred, Head); + uint64_t N = Prob.getNumerator(); + uint64_t D = Prob.getDenominator(); + uint64_t Res = (N * START_FREQ) / D; + + assert(Res <= UINT32_MAX); + CycleProb[Head] += (uint32_t) Res; + } + } + } + + friend class BlockFrequency; + friend class MachineBlockFrequency; + + void doFunction(FunctionT *fn, BlockProbInfoT *bpi) { + Fn = fn; + BPI = bpi; + + // Clear everything. + RPO.clear(); + POT.clear(); + CycleProb.clear(); + Freqs.clear(); + + BlockT *EntryBlock = fn->begin(); + + copy(po_begin(EntryBlock), po_end(EntryBlock), back_inserter(POT)); + + unsigned RPOidx = 0; + for (rpot_iterator I = rpot_begin(), E = rpot_end(); I != E; ++I) { + BlockT *BB = *I; + RPO[BB] = ++RPOidx; + DEBUG(dbgs() << "RPO[" << getBlockName(BB) << "] = " << RPO[BB] << "\n"); + } + + // Travel over all blocks in postorder. + for (pot_iterator I = pot_begin(), E = pot_end(); I != E; ++I) { + BlockT *BB = *I; + BlockT *LastTail = 0; + DEBUG(dbgs() << "POT: " << getBlockName(BB) << "\n"); + + for (typename GT::ChildIteratorType + PI = GraphTraits< Inverse >::child_begin(BB), + PE = GraphTraits< Inverse >::child_end(BB); + PI != PE; ++PI) { + + BlockT *Pred = *PI; + if (isReachable(Pred) && isBackedge(Pred, BB) + && (!LastTail || RPO[Pred] > RPO[LastTail])) + LastTail = Pred; + } + + if (LastTail) + doLoop(BB, LastTail); + } + + // At the end assume the whole function as a loop, and travel over it once + // again. + doLoop(*(rpot_begin()), *(pot_begin())); + } + +public: + /// getBlockFreq - Return block frequency. Never return 0, value must be + /// positive. + uint32_t getBlockFreq(BlockT *BB) const { + typename DenseMap::const_iterator I = Freqs.find(BB); + if (I != Freqs.end()) + return I->second ? I->second : 1; + return 1; + } + + void print(raw_ostream &OS) const { + OS << "\n\n---- Block Freqs ----\n"; + for (typename FunctionT::iterator I = Fn->begin(), E = Fn->end(); I != E;) { + BlockT *BB = I++; + OS << " " << getBlockName(BB) << " = " << getBlockFreq(BB) << "\n"; + + for (typename GraphTraits::ChildIteratorType + SI = GraphTraits::child_begin(BB), + SE = GraphTraits::child_end(BB); SI != SE; ++SI) { + BlockT *Succ = *SI; + OS << " " << getBlockName(BB) << " -> " << getBlockName(Succ) + << " = " << getEdgeFreq(BB, Succ) << "\n"; + } + } + } + + void dump() const { + print(dbgs()); + } +}; + +} + +#endif Modified: head/contrib/llvm/include/llvm/Analysis/BranchProbabilityInfo.h ============================================================================== --- head/contrib/llvm/include/llvm/Analysis/BranchProbabilityInfo.h Sun Jul 17 19:24:54 2011 (r224144) +++ head/contrib/llvm/include/llvm/Analysis/BranchProbabilityInfo.h Sun Jul 17 19:51:40 2011 (r224145) @@ -15,8 +15,9 @@ #define LLVM_ANALYSIS_BRANCHPROBABILITYINFO_H #include "llvm/InitializePasses.h" +#include "llvm/Pass.h" +#include "llvm/ADT/DenseMap.h" #include "llvm/Support/BranchProbability.h" -#include "llvm/Analysis/LoopInfo.h" namespace llvm { @@ -25,6 +26,11 @@ class raw_ostream; class BranchProbabilityInfo : public FunctionPass { // Default weight value. Used when we don't have information about the edge. + // TODO: DEFAULT_WEIGHT makes sense during static predication, when none of + // the successors have a weight yet. But it doesn't make sense when providing + // weight to an edge that may have siblings with non-zero weights. This can + // be handled various ways, but it's probably fine for an edge with unknown + // weight to just "inherit" the non-zero weight of an adjacent successor. static const uint32_t DEFAULT_WEIGHT = 16; typedef std::pair Edge; @@ -41,10 +47,7 @@ public: initializeBranchProbabilityInfoPass(*PassRegistry::getPassRegistry()); } - void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequired(); - AU.setPreservesAll(); - } + void getAnalysisUsage(AnalysisUsage &AU) const; bool runOnFunction(Function &F); Modified: head/contrib/llvm/include/llvm/Analysis/DIBuilder.h ============================================================================== --- head/contrib/llvm/include/llvm/Analysis/DIBuilder.h Sun Jul 17 19:24:54 2011 (r224144) +++ head/contrib/llvm/include/llvm/Analysis/DIBuilder.h Sun Jul 17 19:51:40 2011 (r224145) @@ -135,6 +135,7 @@ namespace llvm { unsigned Flags); /// createMemberType - Create debugging information entry for a member. + /// @param Scope Member scope. /// @param Name Member name. /// @param File File where this member is defined. /// @param LineNo Line number. @@ -143,7 +144,7 @@ namespace llvm { /// @param OffsetInBits Member offset. /// @param Flags Flags to encode member attribute, e.g. private /// @param Ty Parent type. - DIType createMemberType(StringRef Name, DIFile File, + DIType createMemberType(DIDescriptor Scope, StringRef Name, DIFile File, unsigned LineNo, uint64_t SizeInBits, uint64_t AlignInBits, uint64_t OffsetInBits, unsigned Flags, DIType Ty); Modified: head/contrib/llvm/include/llvm/Analysis/IVUsers.h ============================================================================== --- head/contrib/llvm/include/llvm/Analysis/IVUsers.h Sun Jul 17 19:24:54 2011 (r224144) +++ head/contrib/llvm/include/llvm/Analysis/IVUsers.h Sun Jul 17 19:51:40 2011 (r224145) @@ -37,8 +37,8 @@ class TargetData; class IVStrideUse : public CallbackVH, public ilist_node { friend class IVUsers; public: - IVStrideUse(IVUsers *P, Instruction* U, Value *O, Value *PN) - : CallbackVH(U), Parent(P), OperandValToReplace(O), Phi(PN) { + IVStrideUse(IVUsers *P, Instruction* U, Value *O) + : CallbackVH(U), Parent(P), OperandValToReplace(O) { } /// getUser - Return the user instruction for this use. @@ -51,11 +51,6 @@ public: setValPtr(NewUser); } - /// getPhi - Return the phi node that represents this IV. - PHINode *getPhi() const { - return cast(Phi); - } - /// getOperandValToReplace - Return the Value of the operand in the user /// instruction that this IVStrideUse is representing. Value *getOperandValToReplace() const { @@ -86,9 +81,6 @@ private: /// that this IVStrideUse is representing. WeakVH OperandValToReplace; - /// Phi - The loop header phi that represents this IV. - WeakVH Phi; - /// PostIncLoops - The set of loops for which Expr has been adjusted to /// use post-inc mode. This corresponds with SCEVExpander's post-inc concept. PostIncLoopSet PostIncLoops; @@ -151,9 +143,9 @@ public: /// AddUsersIfInteresting - Inspect the specified Instruction. If it is a /// reducible SCEV, recursively add its users to the IVUsesByStride set and /// return true. Otherwise, return false. - bool AddUsersIfInteresting(Instruction *I, PHINode *Phi); + bool AddUsersIfInteresting(Instruction *I); - IVStrideUse &AddUser(Instruction *User, Value *Operand, PHINode *Phi); + IVStrideUse &AddUser(Instruction *User, Value *Operand); /// getReplacementExpr - Return a SCEV expression which computes the /// value of the OperandValToReplace of the given IVStrideUse. Modified: head/contrib/llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h ============================================================================== --- head/contrib/llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h Sun Jul 17 19:24:54 2011 (r224144) +++ head/contrib/llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h Sun Jul 17 19:51:40 2011 (r224145) @@ -90,18 +90,27 @@ namespace llvm { /// get methods: These are static ctor methods for creating various /// MemDepResult kinds. static MemDepResult getDef(Instruction *Inst) { + assert(Inst && "Def requires inst"); return MemDepResult(PairTy(Inst, Def)); } static MemDepResult getClobber(Instruction *Inst) { + assert(Inst && "Clobber requires inst"); return MemDepResult(PairTy(Inst, Clobber)); } static MemDepResult getNonLocal() { return MemDepResult(PairTy(0, NonLocal)); } + static MemDepResult getUnknown() { + return MemDepResult(PairTy(0, Clobber)); + } /// isClobber - Return true if this MemDepResult represents a query that is /// a instruction clobber dependency. - bool isClobber() const { return Value.getInt() == Clobber; } + bool isClobber() const { return Value.getInt() == Clobber && getInst(); } + + /// isUnknown - Return true if this MemDepResult represents a query which + /// cannot and/or will not be computed. + bool isUnknown() const { return Value.getInt() == Clobber && !getInst(); } /// isDef - Return true if this MemDepResult represents a query that is /// a instruction definition dependency. Modified: head/contrib/llvm/include/llvm/Analysis/Passes.h ============================================================================== --- head/contrib/llvm/include/llvm/Analysis/Passes.h Sun Jul 17 19:24:54 2011 (r224144) +++ head/contrib/llvm/include/llvm/Analysis/Passes.h Sun Jul 17 19:51:40 2011 (r224145) @@ -88,6 +88,13 @@ namespace llvm { //===--------------------------------------------------------------------===// // + // createObjCARCAliasAnalysisPass - This pass implements ObjC-ARC-based + // alias analysis. + // + ImmutablePass *createObjCARCAliasAnalysisPass(); + + //===--------------------------------------------------------------------===// + // // createProfileLoaderPass - This pass loads information from a profile dump // file. // Modified: head/contrib/llvm/include/llvm/Analysis/ScalarEvolutionExpander.h ============================================================================== --- head/contrib/llvm/include/llvm/Analysis/ScalarEvolutionExpander.h Sun Jul 17 19:24:54 2011 (r224144) +++ head/contrib/llvm/include/llvm/Analysis/ScalarEvolutionExpander.h Sun Jul 17 19:51:40 2011 (r224145) @@ -30,6 +30,10 @@ namespace llvm { /// memory. class SCEVExpander : public SCEVVisitor { ScalarEvolution &SE; + + // New instructions receive a name to identifies them with the current pass. + const char* IVName; + std::map, AssertingVH > InsertedExpressions; std::set > InsertedValues; @@ -67,9 +71,9 @@ namespace llvm { public: /// SCEVExpander - Construct a SCEVExpander in "canonical" mode. - explicit SCEVExpander(ScalarEvolution &se) - : SE(se), IVIncInsertLoop(0), CanonicalMode(true), - Builder(se.getContext(), TargetFolder(se.TD)) {} + explicit SCEVExpander(ScalarEvolution &se, const char *name) + : SE(se), IVName(name), IVIncInsertLoop(0), IVIncInsertPos(0), + CanonicalMode(true), Builder(se.getContext(), TargetFolder(se.TD)) {} /// clear - Erase the contents of the InsertedExpressions map so that users /// trying to expand the same expression into multiple BasicBlocks or Modified: head/contrib/llvm/include/llvm/Analysis/ValueTracking.h ============================================================================== --- head/contrib/llvm/include/llvm/Analysis/ValueTracking.h Sun Jul 17 19:24:54 2011 (r224144) +++ head/contrib/llvm/include/llvm/Analysis/ValueTracking.h Sun Jul 17 19:51:40 2011 (r224145) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Jul 17 20:35:31 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21ACD1065670; Sun, 17 Jul 2011 20:35:31 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1056D8FC12; Sun, 17 Jul 2011 20:35:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6HKZUow089094; Sun, 17 Jul 2011 20:35:30 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6HKZUCM089092; Sun, 17 Jul 2011 20:35:30 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201107172035.p6HKZUCM089092@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 17 Jul 2011 20:35:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224147 - head/sys/geom X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2011 20:35:31 -0000 Author: pjd Date: Sun Jul 17 20:35:30 2011 New Revision: 224147 URL: http://svn.freebsd.org/changeset/base/224147 Log: Add some spare fields to the g_class and g_geom structures needed to implement direct I/O handling and provider's property changes handling. Modified: head/sys/geom/geom.h Modified: head/sys/geom/geom.h ============================================================================== --- head/sys/geom/geom.h Sun Jul 17 20:02:29 2011 (r224146) +++ head/sys/geom/geom.h Sun Jul 17 20:35:30 2011 (r224147) @@ -89,6 +89,7 @@ typedef void g_dumpconf_t (struct sbuf * struct g_class { const char *name; u_int version; + u_int spare0; g_taste_t *taste; g_config_t *config; g_ctl_req_t *ctlreq; @@ -105,6 +106,8 @@ struct g_class { g_access_t *access; g_orphan_t *orphan; g_ioctl_t *ioctl; + void *spare1; + void *spare2; /* * The remaining elements are private */ @@ -134,6 +137,8 @@ struct g_geom { g_access_t *access; g_orphan_t *orphan; g_ioctl_t *ioctl; + void *spare0; + void *spare1; void *softc; unsigned flags; #define G_GEOM_WITHER 1 From owner-svn-src-head@FreeBSD.ORG Sun Jul 17 20:47:35 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E863106566B; Sun, 17 Jul 2011 20:47:35 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2DB108FC28; Sun, 17 Jul 2011 20:47:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6HKlZ2Q089500; Sun, 17 Jul 2011 20:47:35 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6HKlZ3w089498; Sun, 17 Jul 2011 20:47:35 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201107172047.p6HKlZ3w089498@svn.freebsd.org> From: Glen Barber Date: Sun, 17 Jul 2011 20:47:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224148 - head/usr.sbin/rtadvctl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2011 20:47:35 -0000 Author: gjb (doc committer) Date: Sun Jul 17 20:47:34 2011 New Revision: 224148 URL: http://svn.freebsd.org/changeset/base/224148 Log: Add a closing '.El' tag. Found by: manlint Modified: head/usr.sbin/rtadvctl/rtadvctl.8 Modified: head/usr.sbin/rtadvctl/rtadvctl.8 ============================================================================== --- head/usr.sbin/rtadvctl/rtadvctl.8 Sun Jul 17 20:35:30 2011 (r224147) +++ head/usr.sbin/rtadvctl/rtadvctl.8 Sun Jul 17 20:47:34 2011 (r224148) @@ -89,6 +89,7 @@ It will take at most nine seconds. .It show Op interfaces... Displays information on Router Advertisement messages being sent on each interface. +.El .Sh SEE ALSO .Xr rtadvd 8 , .Xr rtadvd.conf 5 From owner-svn-src-head@FreeBSD.ORG Sun Jul 17 21:08:16 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE801106566B; Sun, 17 Jul 2011 21:08:16 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BBEE88FC13; Sun, 17 Jul 2011 21:08:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6HL8GwN090280; Sun, 17 Jul 2011 21:08:16 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6HL8Gkd090278; Sun, 17 Jul 2011 21:08:16 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201107172108.p6HL8Gkd090278@svn.freebsd.org> From: Ryan Stone Date: Sun, 17 Jul 2011 21:08:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224150 - head/sbin/fdisk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2011 21:08:16 -0000 Author: rstone Date: Sun Jul 17 21:08:16 2011 New Revision: 224150 URL: http://svn.freebsd.org/changeset/base/224150 Log: The MBR uses a 32-bit unsigned integer to store the size of a slice, but fdisk(1) internally uses a signed int. Should a user attempt to specify a slice containing more than 2^31 - 1 sectors, an error will be reported on systems with sizeof(long) == 4 and the slice size will be silently truncated on systems with sizeof(long) > 4. Instead use an unsigned long to store the slice size in fdisk(1). This allows the user to specify a slice size up to the maximum permitted by the MBR on-disk format and does not have any problems with silent truncation should the use specify an slice size larger than 2^32 on systems with sizeof(long) > 4. Submitted by: Mark Johnston (markjdb AT gmail DOT com) MFC after: 2 weeks Modified: head/sbin/fdisk/fdisk.c Modified: head/sbin/fdisk/fdisk.c ============================================================================== --- head/sbin/fdisk/fdisk.c Sun Jul 17 20:49:38 2011 (r224149) +++ head/sbin/fdisk/fdisk.c Sun Jul 17 21:08:16 2011 (r224150) @@ -108,9 +108,9 @@ typedef struct cmd { char cmd; int n_args; struct arg { - char argtype; - int arg_val; - char *arg_str; + char argtype; + unsigned long arg_val; + char * arg_str; } args[MAX_ARGS]; } CMD; @@ -990,7 +990,7 @@ parse_config_line(char *line, CMD *comma if (isalpha(*cp)) command->args[command->n_args].argtype = *cp++; end = NULL; - command->args[command->n_args].arg_val = strtol(cp, &end, 0); + command->args[command->n_args].arg_val = strtoul(cp, &end, 0); if (cp == end || (!isspace(*end) && *end != '\0')) { char ch; end = cp; From owner-svn-src-head@FreeBSD.ORG Sun Jul 17 21:15:21 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 541E7106564A; Sun, 17 Jul 2011 21:15:21 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 382DB8FC14; Sun, 17 Jul 2011 21:15:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6HLFLJh090540; Sun, 17 Jul 2011 21:15:21 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6HLFLxq090534; Sun, 17 Jul 2011 21:15:21 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201107172115.p6HLFLxq090534@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 17 Jul 2011 21:15:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224151 - in head/sys: net netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2011 21:15:21 -0000 Author: bz Date: Sun Jul 17 21:15:20 2011 New Revision: 224151 URL: http://svn.freebsd.org/changeset/base/224151 Log: Add spares to the network stack for FreeBSD-9: - TCP keep* timers - TCP UTO (adjust from what was there already) - netmap - route caching - user cookie (temporary to allow for the real fix) Slightly re-shuffle struct ifnet moving fields out of the middle of spares and to better align. Discussed with: rwatson (slightly earlier version) Modified: head/sys/net/if_var.h head/sys/net/radix.h head/sys/netinet/in_pcb.h head/sys/netinet/tcp_syncache.h head/sys/netinet/tcp_var.h Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Sun Jul 17 21:08:16 2011 (r224150) +++ head/sys/net/if_var.h Sun Jul 17 21:15:20 2011 (r224151) @@ -195,8 +195,9 @@ struct ifnet { /* protected by if_addr_mtx */ void *if_pf_kif; void *if_lagg; /* lagg glue */ - u_char if_alloctype; /* if_type at time of allocation */ + char *if_description; /* interface description */ u_int if_fib; /* interface FIB */ + u_char if_alloctype; /* if_type at time of allocation */ /* * Spare fields are added so that we can modify sensitive data @@ -204,9 +205,8 @@ struct ifnet { * be used with care where binary compatibility is required. */ char if_cspare[3]; - char *if_description; /* interface description */ - void *if_pspare[7]; int if_ispare[4]; + void *if_pspare[8]; /* 1 netmap, 7 TDB */ }; typedef void if_init_f_t(void *); Modified: head/sys/net/radix.h ============================================================================== --- head/sys/net/radix.h Sun Jul 17 21:08:16 2011 (r224150) +++ head/sys/net/radix.h Sun Jul 17 21:15:20 2011 (r224151) @@ -132,6 +132,7 @@ struct radix_node_head { (struct radix_node *rn, struct radix_node_head *head); struct radix_node rnh_nodes[3]; /* empty tree for common case */ int rnh_multipath; /* multipath capable ? */ + u_int rnh_spare; /* route caching */ #ifdef _KERNEL struct rwlock rnh_lock; /* locks entire radix tree */ #endif Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Sun Jul 17 21:08:16 2011 (r224150) +++ head/sys/netinet/in_pcb.h Sun Jul 17 21:15:20 2011 (r224151) @@ -179,8 +179,9 @@ struct inpcb { u_char inp_ip_minttl; /* (i) minimum TTL or drop */ uint32_t inp_flowid; /* (x) flow id / queue id */ u_int inp_refcount; /* (i) refcount */ - void *inp_pspare[4]; /* (x) rtentry / general use */ - u_int inp_ispare[4]; /* general use */ + void *inp_pspare[5]; /* (x) route caching / general use */ + u_int inp_ispare[6]; /* (x) route caching / user cookie / + * general use */ /* Local and foreign ports, local and foreign addr. */ struct in_conninfo inp_inc; /* (i/p) list for PCB's local port */ Modified: head/sys/netinet/tcp_syncache.h ============================================================================== --- head/sys/netinet/tcp_syncache.h Sun Jul 17 21:08:16 2011 (r224150) +++ head/sys/netinet/tcp_syncache.h Sun Jul 17 21:15:20 2011 (r224151) @@ -81,6 +81,8 @@ struct syncache { #endif struct label *sc_label; /* MAC label reference */ struct ucred *sc_cred; /* cred cache for jail checks */ + + u_int32_t sc_spare[2]; /* UTO */ }; /* Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Sun Jul 17 21:08:16 2011 (r224150) +++ head/sys/netinet/tcp_var.h Sun Jul 17 21:15:20 2011 (r224151) @@ -203,9 +203,9 @@ struct tcpcb { struct cc_var *ccv; /* congestion control specific vars */ struct osd *osd; /* storage for Khelp module data */ - int t_ispare; /* explicit pad for 64bit alignment */ + uint32_t t_ispare[12]; /* 4 keep timers, 5 UTO, 3 TBD */ void *t_pspare2[4]; /* 4 TBD */ - uint64_t _pad[12]; /* 7 UTO, 5 TBD (1-2 CC/RTT?) */ + uint64_t _pad[6]; /* 6 TBD (1-2 CC/RTT?) */ }; /* @@ -300,6 +300,7 @@ struct tcpopt { u_int16_t to_mss; /* maximum segment size */ u_int8_t to_wscale; /* window scaling */ u_int8_t to_nsacks; /* number of SACK blocks */ + u_int32_t to_spare; /* UTO */ }; /* From owner-svn-src-head@FreeBSD.ORG Sun Jul 17 21:27:38 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8E61106566B; Sun, 17 Jul 2011 21:27:38 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B5DC88FC0A; Sun, 17 Jul 2011 21:27:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6HLRcan090990; Sun, 17 Jul 2011 21:27:38 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6HLRcXK090974; Sun, 17 Jul 2011 21:27:38 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201107172127.p6HLRcXK090974@svn.freebsd.org> From: Martin Matuska Date: Sun, 17 Jul 2011 21:27:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224152 - in head/lib/libarchive: . libarchive_fe test X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2011 21:27:38 -0000 Author: mm Date: Sun Jul 17 21:27:38 2011 New Revision: 224152 URL: http://svn.freebsd.org/changeset/base/224152 Log: - Update libarchive to 2.8.4 - Add support for extracting xar and rpm archives - Add libarchive_fe subdir (common code for tar and cpio) Approved by: kientzle MFC after: 2 weeks Added: head/lib/libarchive/archive_read_support_compression_rpm.c (contents, props changed) head/lib/libarchive/archive_read_support_format_xar.c (contents, props changed) head/lib/libarchive/libarchive_fe/ head/lib/libarchive/libarchive_fe/err.c (contents, props changed) head/lib/libarchive/libarchive_fe/err.h (contents, props changed) head/lib/libarchive/libarchive_fe/lafe_platform.h (contents, props changed) head/lib/libarchive/libarchive_fe/line_reader.c (contents, props changed) head/lib/libarchive/libarchive_fe/line_reader.h (contents, props changed) head/lib/libarchive/libarchive_fe/matching.c (contents, props changed) head/lib/libarchive/libarchive_fe/matching.h (contents, props changed) head/lib/libarchive/libarchive_fe/pathmatch.c (contents, props changed) head/lib/libarchive/libarchive_fe/pathmatch.h (contents, props changed) head/lib/libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.c (contents, props changed) head/lib/libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.rpm.uu (contents, props changed) head/lib/libarchive/test/test_read_format_cpio_svr4_gzip_rpm.c (contents, props changed) head/lib/libarchive/test/test_read_format_cpio_svr4_gzip_rpm.rpm.uu (contents, props changed) head/lib/libarchive/test/test_read_format_xar.c (contents, props changed) Modified: head/lib/libarchive/Makefile head/lib/libarchive/README head/lib/libarchive/archive.h head/lib/libarchive/archive_hash.h head/lib/libarchive/archive_read.3 head/lib/libarchive/archive_read_disk_entry_from_file.c head/lib/libarchive/archive_read_disk_set_standard_lookup.c head/lib/libarchive/archive_read_support_compression_all.c head/lib/libarchive/archive_read_support_compression_bzip2.c head/lib/libarchive/archive_read_support_compression_uu.c head/lib/libarchive/archive_read_support_format_all.c head/lib/libarchive/archive_read_support_format_mtree.c head/lib/libarchive/archive_write_disk.c head/lib/libarchive/archive_write_disk_set_standard_lookup.c head/lib/libarchive/archive_write_set_compression_bzip2.c head/lib/libarchive/config_freebsd.h head/lib/libarchive/filter_fork.c head/lib/libarchive/test/Makefile head/lib/libarchive/test/main.c head/lib/libarchive/test/read_open_memory.c head/lib/libarchive/test/test.h head/lib/libarchive/test/test_entry.c head/lib/libarchive/test/test_fuzz.c head/lib/libarchive/test/test_pax_filename_encoding.c head/lib/libarchive/test/test_read_data_large.c head/lib/libarchive/test/test_read_large.c head/lib/libarchive/test/test_read_truncated.c head/lib/libarchive/test/test_ustar_filenames.c head/lib/libarchive/test/test_write_format_cpio.c Modified: head/lib/libarchive/Makefile ============================================================================== --- head/lib/libarchive/Makefile Sun Jul 17 21:15:20 2011 (r224151) +++ head/lib/libarchive/Makefile Sun Jul 17 21:27:38 2011 (r224152) @@ -13,6 +13,9 @@ DPADD+= ${LIBLZMA} LDADD+= -llzma CFLAGS+= -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1 +DPADD+= ${LIBBSDXML} +LDADD+= -lbsdxml + # FreeBSD SHLIB_MAJOR value is managed as part of the FreeBSD system. # It has no real relation to the libarchive version number. SHLIB_MAJOR= 5 @@ -56,6 +59,7 @@ SRCS= archive_check_magic.c \ archive_read_support_compression_gzip.c \ archive_read_support_compression_none.c \ archive_read_support_compression_program.c \ + archive_read_support_compression_rpm.c \ archive_read_support_compression_uu.c \ archive_read_support_compression_xz.c \ archive_read_support_format_all.c \ @@ -66,6 +70,7 @@ SRCS= archive_check_magic.c \ archive_read_support_format_mtree.c \ archive_read_support_format_raw.c \ archive_read_support_format_tar.c \ + archive_read_support_format_xar.c \ archive_read_support_format_zip.c \ archive_string.c \ archive_string_sprintf.c \ Modified: head/lib/libarchive/README ============================================================================== --- head/lib/libarchive/README Sun Jul 17 21:15:20 2011 (r224151) +++ head/lib/libarchive/README Sun Jul 17 21:27:38 2011 (r224152) @@ -21,6 +21,7 @@ Currently, the library automatically det * gzip compression * bzip2 compression * compress/LZW compression + * lzma and xz compression * GNU tar format (including GNU long filenames, long link names, and sparse files) * Solaris 9 extended tar format (including ACLs) @@ -30,18 +31,26 @@ Currently, the library automatically det * POSIX octet-oriented cpio * SVR4 ASCII cpio * Binary cpio (big-endian or little-endian) - * ISO9660 CD-ROM images (with optional Rockridge extensions) + * ISO9660 CD-ROM images (with optional Rockridge or Joliet extensions) * ZIP archives (with uncompressed or "deflate" compressed entries) + * GNU and BSD 'ar' archives + * 'mtree' format The library can write: * gzip compression * bzip2 compression + * compress/LZW compression + * lzma and xz compression * POSIX ustar * POSIX pax interchange format * "restricted" pax format, which will create ustar archives except for entries that require pax extensions (for long filenames, ACLs, etc). * POSIX octet-oriented cpio + * SVR4 "newc" cpio * shar archives + * ZIP archives (with uncompressed or "deflate" compressed entries) + * GNU and BSD 'ar' archives + * 'mtree' format Notes: * This is a heavily stream-oriented system. There is no direct Modified: head/lib/libarchive/archive.h ============================================================================== --- head/lib/libarchive/archive.h Sun Jul 17 21:15:20 2011 (r224151) +++ head/lib/libarchive/archive.h Sun Jul 17 21:27:38 2011 (r224152) @@ -52,7 +52,9 @@ /* These should match the types used in 'struct stat' */ #if defined(_WIN32) && !defined(__CYGWIN__) #define __LA_INT64_T __int64 -# if defined(_WIN64) +# if defined(_SSIZE_T_DEFINED) +# define __LA_SSIZE_T ssize_t +# elif defined(_WIN64) # define __LA_SSIZE_T __int64 # else # define __LA_SSIZE_T long @@ -127,13 +129,13 @@ extern "C" { * (ARCHIVE_API_VERSION * 1000000 + ARCHIVE_API_FEATURE * 1000) * #endif */ -#define ARCHIVE_VERSION_NUMBER 2007901 +#define ARCHIVE_VERSION_NUMBER 2008004 __LA_DECL int archive_version_number(void); /* * Textual name/version of the library, useful for version displays. */ -#define ARCHIVE_VERSION_STRING "libarchive 2.7.901a" +#define ARCHIVE_VERSION_STRING "libarchive 2.8.4" __LA_DECL const char * archive_version_string(void); #if ARCHIVE_VERSION_NUMBER < 3000000 @@ -319,6 +321,7 @@ __LA_DECL int archive_read_support_com (struct archive *, const char *, const void * /* match */, size_t); +__LA_DECL int archive_read_support_compression_rpm(struct archive *); __LA_DECL int archive_read_support_compression_uu(struct archive *); __LA_DECL int archive_read_support_compression_xz(struct archive *); @@ -331,6 +334,7 @@ __LA_DECL int archive_read_support_for __LA_DECL int archive_read_support_format_mtree(struct archive *); __LA_DECL int archive_read_support_format_raw(struct archive *); __LA_DECL int archive_read_support_format_tar(struct archive *); +__LA_DECL int archive_read_support_format_xar(struct archive *); __LA_DECL int archive_read_support_format_zip(struct archive *); Modified: head/lib/libarchive/archive_hash.h ============================================================================== --- head/lib/libarchive/archive_hash.h Sun Jul 17 21:15:20 2011 (r224151) +++ head/lib/libarchive/archive_hash.h Sun Jul 17 21:27:38 2011 (r224152) @@ -29,6 +29,10 @@ #error This header is only to be used internally to libarchive. #endif +#ifdef HAVE_SYS_TYPES_H +#include +#endif + /* * Hash function support in various Operating Systems: * @@ -41,43 +45,71 @@ * - OpenBSD 4.4 and earlier have SHA2 in libc with _ after algorithm name * * DragonFly and FreeBSD (XXX not used yet): - * - MD5 in libmd: without _ after algorithm name - * - SHA{1,256,512} in libmd: with _ after algorithm name (conflicts w/OpenSSL!) + * - MD5 and SHA1 in libmd: without _ after algorithm name + * - SHA256: with _ after algorithm name + * + * Mac OS X (10.4 and later): + * - MD5, SHA1 and SHA2 in libSystem: with CC_ prefix and _ after algorithm name * * OpenSSL: - * - MD5, SHA1, SHA2, SHA{256,384,512} in libcrypto: with _ after algorithm name + * - MD5, SHA1 and SHA2 in libcrypto: with _ after algorithm name + * + * Windows: + * - MD5, SHA1 and SHA2 in archive_windows.c: without algorithm name + * and with __la_ prefix. */ +#if defined(ARCHIVE_HASH_MD5_WIN) ||\ + defined(ARCHIVE_HASH_SHA1_WIN) || defined(ARCHIVE_HASH_SHA256_WIN) ||\ + defined(ARCHIVE_HASH_SHA384_WIN) || defined(ARCHIVE_HASH_SHA512_WIN) +#include +typedef struct { + int valid; + HCRYPTPROV cryptProv; + HCRYPTHASH hash; +} Digest_CTX; +extern void __la_hash_Init(Digest_CTX *, ALG_ID); +extern void __la_hash_Final(unsigned char *, size_t, Digest_CTX *); +extern void __la_hash_Update(Digest_CTX *, const unsigned char *, size_t); +#endif -#if defined(HAVE_MD5_H) && defined(HAVE_MD5INIT) +#if defined(ARCHIVE_HASH_MD5_LIBC) # include # define ARCHIVE_HAS_MD5 typedef MD5_CTX archive_md5_ctx; # define archive_md5_init(ctx) MD5Init(ctx) # define archive_md5_final(ctx, buf) MD5Final(buf, ctx) # define archive_md5_update(ctx, buf, n) MD5Update(ctx, buf, n) -#elif defined(HAVE_OPENSSL_MD5_H) +#elif defined(ARCHIVE_HASH_MD5_LIBSYSTEM) +# include +# define ARCHIVE_HAS_MD5 +typedef CC_MD5_CTX archive_md5_ctx; +# define archive_md5_init(ctx) CC_MD5_Init(ctx) +# define archive_md5_final(ctx, buf) CC_MD5_Final(buf, ctx) +# define archive_md5_update(ctx, buf, n) CC_MD5_Update(ctx, buf, n) +#elif defined(ARCHIVE_HASH_MD5_OPENSSL) # include # define ARCHIVE_HAS_MD5 typedef MD5_CTX archive_md5_ctx; # define archive_md5_init(ctx) MD5_Init(ctx) # define archive_md5_final(ctx, buf) MD5_Final(buf, ctx) # define archive_md5_update(ctx, buf, n) MD5_Update(ctx, buf, n) -#elif defined(_WIN32) && !defined(__CYGWIN__) && defined(CALG_MD5) +#elif defined(ARCHIVE_HASH_MD5_WIN) # define ARCHIVE_HAS_MD5 -typedef MD5_CTX archive_md5_ctx; -# define archive_md5_init(ctx) MD5_Init(ctx) -# define archive_md5_final(ctx, buf) MD5_Final(buf, ctx) -# define archive_md5_update(ctx, buf, n) MD5_Update(ctx, buf, n) +# define MD5_DIGEST_LENGTH 16 +typedef Digest_CTX archive_md5_ctx; +# define archive_md5_init(ctx) __la_hash_Init(ctx, CALG_MD5) +# define archive_md5_final(ctx, buf) __la_hash_Final(buf, MD5_DIGEST_LENGTH, ctx) +# define archive_md5_update(ctx, buf, n) __la_hash_Update(ctx, buf, n) #endif -#if defined(HAVE_RMD160_H) && defined(HAVE_RMD160INIT) +#if defined(ARCHIVE_HASH_RMD160_LIBC) # include # define ARCHIVE_HAS_RMD160 typedef RMD160_CTX archive_rmd160_ctx; # define archive_rmd160_init(ctx) RMD160Init(ctx) # define archive_rmd160_final(ctx, buf) RMD160Final(buf, ctx) # define archive_rmd160_update(ctx, buf, n) RMD160Update(ctx, buf, n) -#elif defined(HAVE_OPENSSL_RIPEMD_H) +#elif defined(ARCHIVE_HASH_RMD160_OPENSSL) # include # define ARCHIVE_HAS_RMD160 typedef RIPEMD160_CTX archive_rmd160_ctx; @@ -86,111 +118,164 @@ typedef RIPEMD160_CTX archive_rmd160_ctx # define archive_rmd160_update(ctx, buf, n) RIPEMD160_Update(ctx, buf, n) #endif -#if defined(HAVE_SHA1_H) && defined(HAVE_SHA1INIT) +#if defined(ARCHIVE_HASH_SHA1_LIBC) # include # define ARCHIVE_HAS_SHA1 typedef SHA1_CTX archive_sha1_ctx; # define archive_sha1_init(ctx) SHA1Init(ctx) # define archive_sha1_final(ctx, buf) SHA1Final(buf, ctx) # define archive_sha1_update(ctx, buf, n) SHA1Update(ctx, buf, n) -#elif defined(HAVE_OPENSSL_SHA_H) +#elif defined(ARCHIVE_HASH_SHA1_LIBSYSTEM) +# include +# define ARCHIVE_HAS_SHA1 +typedef CC_SHA1_CTX archive_sha1_ctx; +# define archive_sha1_init(ctx) CC_SHA1_Init(ctx) +# define archive_sha1_final(ctx, buf) CC_SHA1_Final(buf, ctx) +# define archive_sha1_update(ctx, buf, n) CC_SHA1_Update(ctx, buf, n) +#elif defined(ARCHIVE_HASH_SHA1_OPENSSL) # include # define ARCHIVE_HAS_SHA1 typedef SHA_CTX archive_sha1_ctx; # define archive_sha1_init(ctx) SHA1_Init(ctx) # define archive_sha1_final(ctx, buf) SHA1_Final(buf, ctx) # define archive_sha1_update(ctx, buf, n) SHA1_Update(ctx, buf, n) -#elif defined(_WIN32) && !defined(__CYGWIN__) && defined(CALG_SHA1) +#elif defined(ARCHIVE_HASH_SHA1_WIN) # define ARCHIVE_HAS_SHA1 -typedef SHA1_CTX archive_sha1_ctx; -# define archive_sha1_init(ctx) SHA1_Init(ctx) -# define archive_sha1_final(ctx, buf) SHA1_Final(buf, ctx) -# define archive_sha1_update(ctx, buf, n) SHA1_Update(ctx, buf, n) +# define SHA1_DIGEST_LENGTH 20 +typedef Digest_CTX archive_sha1_ctx; +# define archive_sha1_init(ctx) __la_hash_Init(ctx, CALG_SHA1) +# define archive_sha1_final(ctx, buf) __la_hash_Final(buf, SHA1_DIGEST_LENGTH, ctx) +# define archive_sha1_update(ctx, buf, n) __la_hash_Update(ctx, buf, n) #endif -#if defined(HAVE_SHA2_H) && defined(HAVE_SHA256_INIT) +#if defined(ARCHIVE_HASH_SHA256_LIBC) # include # define ARCHIVE_HAS_SHA256 typedef SHA256_CTX archive_sha256_ctx; # define archive_sha256_init(ctx) SHA256_Init(ctx) # define archive_sha256_final(ctx, buf) SHA256_Final(buf, ctx) # define archive_sha256_update(ctx, buf, n) SHA256_Update(ctx, buf, n) -#elif defined(HAVE_SHA2_H) && defined(HAVE_SHA256INIT) +#elif defined(ARCHIVE_HASH_SHA256_LIBC2) # include # define ARCHIVE_HAS_SHA256 typedef SHA256_CTX archive_sha256_ctx; # define archive_sha256_init(ctx) SHA256Init(ctx) # define archive_sha256_final(ctx, buf) SHA256Final(buf, ctx) # define archive_sha256_update(ctx, buf, n) SHA256Update(ctx, buf, n) -#elif defined(HAVE_OPENSSL_SHA_H) && defined(HAVE_OPENSSL_SHA256_INIT) +#elif defined(ARCHIVE_HASH_SHA256_LIBC3) +# include +# define ARCHIVE_HAS_SHA256 +typedef SHA2_CTX archive_sha256_ctx; +# define archive_sha256_init(ctx) SHA256Init(ctx) +# define archive_sha256_final(ctx, buf) SHA256Final(buf, ctx) +# define archive_sha256_update(ctx, buf, n) SHA256Update(ctx, buf, n) +#elif defined(ARCHIVE_HASH_SHA256_LIBSYSTEM) +# include +# define ARCHIVE_HAS_SHA256 +typedef CC_SHA256_CTX archive_shs256_ctx; +# define archive_shs256_init(ctx) CC_SHA256_Init(ctx) +# define archive_shs256_final(ctx, buf) CC_SHA256_Final(buf, ctx) +# define archive_shs256_update(ctx, buf, n) CC_SHA256_Update(ctx, buf, n) +#elif defined(ARCHIVE_HASH_SHA256_OPENSSL) # include # define ARCHIVE_HAS_SHA256 typedef SHA256_CTX archive_sha256_ctx; # define archive_sha256_init(ctx) SHA256_Init(ctx) # define archive_sha256_final(ctx, buf) SHA256_Final(buf, ctx) # define archive_sha256_update(ctx, buf, n) SHA256_Update(ctx, buf, n) -#elif defined(_WIN32) && !defined(__CYGWIN__) && defined(CALG_SHA_256) +#elif defined(ARCHIVE_HASH_SHA256_WIN) # define ARCHIVE_HAS_SHA256 -typedef SHA256_CTX archive_sha256_ctx; -# define archive_sha256_init(ctx) SHA256_Init(ctx) -# define archive_sha256_final(ctx, buf) SHA256_Final(buf, ctx) -# define archive_sha256_update(ctx, buf, n) SHA256_Update(ctx, buf, n) +# define SHA256_DIGEST_LENGTH 32 +typedef Digest_CTX archive_sha256_ctx; +# define archive_sha256_init(ctx) __la_hash_Init(ctx, CALG_SHA_256) +# define archive_sha256_final(ctx, buf) __la_hash_Final(buf, SHA256_DIGEST_LENGTH, ctx) +# define archive_sha256_update(ctx, buf, n) __la_hash_Update(ctx, buf, n) #endif -#if defined(HAVE_SHA2_H) && defined(HAVE_SHA384_INIT) +#if defined(ARCHIVE_HASH_SHA384_LIBC) # include # define ARCHIVE_HAS_SHA384 typedef SHA384_CTX archive_sha384_ctx; # define archive_sha384_init(ctx) SHA384_Init(ctx) # define archive_sha384_final(ctx, buf) SHA384_Final(buf, ctx) # define archive_sha384_update(ctx, buf, n) SHA384_Update(ctx, buf, n) -#elif defined(HAVE_SHA2_H) && defined(HAVE_SHA384INIT) +#elif defined(ARCHIVE_HASH_SHA384_LIBC2) # include # define ARCHIVE_HAS_SHA384 typedef SHA384_CTX archive_sha384_ctx; # define archive_sha384_init(ctx) SHA384Init(ctx) # define archive_sha384_final(ctx, buf) SHA384Final(buf, ctx) # define archive_sha384_update(ctx, buf, n) SHA384Update(ctx, buf, n) -#elif defined(HAVE_OPENSSL_SHA_H) && defined(HAVE_OPENSSL_SHA384_INIT) +#elif defined(ARCHIVE_HASH_SHA384_LIBC3) +# include +# define ARCHIVE_HAS_SHA384 +typedef SHA2_CTX archive_sha384_ctx; +# define archive_sha384_init(ctx) SHA384Init(ctx) +# define archive_sha384_final(ctx, buf) SHA384Final(buf, ctx) +# define archive_sha384_update(ctx, buf, n) SHA384Update(ctx, buf, n) +#elif defined(ARCHIVE_HASH_SHA384_LIBSYSTEM) +# include +# define ARCHIVE_HAS_SHA384 +typedef CC_SHA512_CTX archive_shs384_ctx; +# define archive_shs384_init(ctx) CC_SHA384_Init(ctx) +# define archive_shs384_final(ctx, buf) CC_SHA384_Final(buf, ctx) +# define archive_shs384_update(ctx, buf, n) CC_SHA384_Update(ctx, buf, n) +#elif defined(ARCHIVE_HASH_SHA384_OPENSSL) # include # define ARCHIVE_HAS_SHA384 typedef SHA512_CTX archive_sha384_ctx; # define archive_sha384_init(ctx) SHA384_Init(ctx) # define archive_sha384_final(ctx, buf) SHA384_Final(buf, ctx) # define archive_sha384_update(ctx, buf, n) SHA384_Update(ctx, buf, n) -#elif defined(_WIN32) && !defined(__CYGWIN__) && defined(CALG_SHA_384) +#elif defined(ARCHIVE_HASH_SHA384_WIN) # define ARCHIVE_HAS_SHA384 -typedef SHA512_CTX archive_sha384_ctx; -# define archive_sha384_init(ctx) SHA384_Init(ctx) -# define archive_sha384_final(ctx, buf) SHA384_Final(buf, ctx) -# define archive_sha384_update(ctx, buf, n) SHA384_Update(ctx, buf, n) +# define SHA384_DIGEST_LENGTH 48 +typedef Digest_CTX archive_sha384_ctx; +# define archive_sha384_init(ctx) __la_hash_Init(ctx, CALG_SHA_384) +# define archive_sha384_final(ctx, buf) __la_hash_Final(buf, SHA384_DIGEST_LENGTH, ctx) +# define archive_sha384_update(ctx, buf, n) __la_hash_Update(ctx, buf, n) #endif -#if defined(HAVE_SHA2_H) && defined(HAVE_SHA512_INIT) +#if defined(ARCHIVE_HASH_SHA512_LIBC) # include # define ARCHIVE_HAS_SHA512 typedef SHA512_CTX archive_sha512_ctx; # define archive_sha512_init(ctx) SHA512_Init(ctx) # define archive_sha512_final(ctx, buf) SHA512_Final(buf, ctx) # define archive_sha512_update(ctx, buf, n) SHA512_Update(ctx, buf, n) -#elif defined(HAVE_SHA2_H) && defined(HAVE_SHA512INIT) +#elif defined(ARCHIVE_HASH_SHA512_LIBC2) # include # define ARCHIVE_HAS_SHA512 typedef SHA512_CTX archive_sha512_ctx; # define archive_sha512_init(ctx) SHA512Init(ctx) # define archive_sha512_final(ctx, buf) SHA512Final(buf, ctx) # define archive_sha512_update(ctx, buf, n) SHA512Update(ctx, buf, n) -#elif defined(HAVE_OPENSSL_SHA_H) && defined(HAVE_OPENSSL_SHA512_INIT) +#elif defined(ARCHIVE_HASH_SHA512_LIBC3) +# include +# define ARCHIVE_HAS_SHA512 +typedef SHA2_CTX archive_sha512_ctx; +# define archive_sha512_init(ctx) SHA512Init(ctx) +# define archive_sha512_final(ctx, buf) SHA512Final(buf, ctx) +# define archive_sha512_update(ctx, buf, n) SHA512Update(ctx, buf, n) +#elif defined(ARCHIVE_HASH_SHA512_LIBSYSTEM) +# include +# define ARCHIVE_HAS_SHA512 +typedef CC_SHA512_CTX archive_shs512_ctx; +# define archive_shs512_init(ctx) CC_SHA512_Init(ctx) +# define archive_shs512_final(ctx, buf) CC_SHA512_Final(buf, ctx) +# define archive_shs512_update(ctx, buf, n) CC_SHA512_Update(ctx, buf, n) +#elif defined(ARCHIVE_HASH_SHA512_OPENSSL) # include # define ARCHIVE_HAS_SHA512 typedef SHA512_CTX archive_sha512_ctx; # define archive_sha512_init(ctx) SHA512_Init(ctx) # define archive_sha512_final(ctx, buf) SHA512_Final(buf, ctx) # define archive_sha512_update(ctx, buf, n) SHA512_Update(ctx, buf, n) -#elif defined(_WIN32) && !defined(__CYGWIN__) && defined(CALG_SHA_512) +#elif defined(ARCHIVE_HASH_SHA512_WIN) # define ARCHIVE_HAS_SHA512 -typedef SHA512_CTX archive_sha512_ctx; -# define archive_sha512_init(ctx) SHA512_Init(ctx) -# define archive_sha512_final(ctx, buf) SHA512_Final(buf, ctx) -# define archive_sha512_update(ctx, buf, n) SHA512_Update(ctx, buf, n) +# define SHA512_DIGEST_LENGTH 64 +typedef Digest_CTX archive_sha512_ctx; +# define archive_sha512_init(ctx) __la_hash_Init(ctx, CALG_SHA_512) +# define archive_sha512_final(ctx, buf) __la_hash_Final(buf, SHA512_DIGEST_LENGTH, ctx) +# define archive_sha512_update(ctx, buf, n) __la_hash_Update(ctx, buf, n) #endif Modified: head/lib/libarchive/archive_read.3 ============================================================================== --- head/lib/libarchive/archive_read.3 Sun Jul 17 21:15:20 2011 (r224151) +++ head/lib/libarchive/archive_read.3 Sun Jul 17 21:27:38 2011 (r224152) @@ -597,7 +597,7 @@ list_archive(const char *name) archive_read_support_format_all(a); archive_read_open(a, mydata, myopen, myread, myclose); while (archive_read_next_header(a, &entry) == ARCHIVE_OK) { - printf("%s\\n",archive_entry_pathname(entry)); + printf("%s\en",archive_entry_pathname(entry)); archive_read_data_skip(a); } archive_read_free(a); Modified: head/lib/libarchive/archive_read_disk_entry_from_file.c ============================================================================== --- head/lib/libarchive/archive_read_disk_entry_from_file.c Sun Jul 17 21:15:20 2011 (r224151) +++ head/lib/libarchive/archive_read_disk_entry_from_file.c Sun Jul 17 21:27:38 2011 (r224152) @@ -208,6 +208,12 @@ setup_acls_posix1e(struct archive_read_d #if HAVE_ACL_GET_LINK_NP else if (!a->follow_symlinks) acl = acl_get_link_np(accpath, ACL_TYPE_ACCESS); +#else + else if ((!a->follow_symlinks) + && (archive_entry_filetype(entry) == AE_IFLNK)) + /* We can't get the ACL of a symlink, so we assume it can't + have one. */ + acl = NULL; #endif else acl = acl_get_file(accpath, ACL_TYPE_ACCESS); @@ -419,7 +425,8 @@ setup_xattrs(struct archive_read_disk *a return (ARCHIVE_OK); } -#elif HAVE_EXTATTR_GET_FILE && HAVE_EXTATTR_LIST_FILE +#elif HAVE_EXTATTR_GET_FILE && HAVE_EXTATTR_LIST_FILE && \ + HAVE_DECL_EXTATTR_NAMESPACE_USER /* * FreeBSD extattr interface. @@ -430,11 +437,11 @@ setup_xattrs(struct archive_read_disk *a * to not include the system extattrs that hold ACLs; we handle * those separately. */ -int +static int setup_xattr(struct archive_read_disk *a, struct archive_entry *entry, int namespace, const char *name, const char *fullname, int fd); -int +static int setup_xattr(struct archive_read_disk *a, struct archive_entry *entry, int namespace, const char *name, const char *fullname, int fd) { Modified: head/lib/libarchive/archive_read_disk_set_standard_lookup.c ============================================================================== --- head/lib/libarchive/archive_read_disk_set_standard_lookup.c Sun Jul 17 21:15:20 2011 (r224151) +++ head/lib/libarchive/archive_read_disk_set_standard_lookup.c Sun Jul 17 21:27:38 2011 (r224152) @@ -182,6 +182,7 @@ lookup_uname(void *data, uid_t uid) &lookup_uname_helper, (id_t)uid)); } +#if HAVE_GETPWUID_R static const char * lookup_uname_helper(struct name_cache *cache, id_t id) { @@ -222,6 +223,20 @@ lookup_uname_helper(struct name_cache *c return strdup(result->pw_name); } +#else +static const char * +lookup_uname_helper(struct name_cache *cache, id_t id) +{ + struct passwd *result; + + result = getpwuid((uid_t)id); + + if (result == NULL) + return (NULL); + + return strdup(result->pw_name); +} +#endif static const char * lookup_gname(void *data, gid_t gid) @@ -231,6 +246,7 @@ lookup_gname(void *data, gid_t gid) &lookup_gname_helper, (id_t)gid)); } +#if HAVE_GETGRGID_R static const char * lookup_gname_helper(struct name_cache *cache, id_t id) { @@ -269,4 +285,19 @@ lookup_gname_helper(struct name_cache *c return strdup(result->gr_name); } +#else +static const char * +lookup_gname_helper(struct name_cache *cache, id_t id) +{ + struct group *result; + + result = getgrgid((gid_t)id); + + if (result == NULL) + return (NULL); + + return strdup(result->gr_name); +} +#endif + #endif /* ! (_WIN32 && !__CYGWIN__) */ Modified: head/lib/libarchive/archive_read_support_compression_all.c ============================================================================== --- head/lib/libarchive/archive_read_support_compression_all.c Sun Jul 17 21:15:20 2011 (r224151) +++ head/lib/libarchive/archive_read_support_compression_all.c Sun Jul 17 21:27:38 2011 (r224152) @@ -46,6 +46,8 @@ archive_read_support_compression_all(str archive_read_support_compression_xz(a); /* The decode code doesn't use an outside library. */ archive_read_support_compression_uu(a); + /* The decode code doesn't use an outside library. */ + archive_read_support_compression_rpm(a); /* Note: We always return ARCHIVE_OK here, even if some of the * above return ARCHIVE_WARN. The intent here is to enable Modified: head/lib/libarchive/archive_read_support_compression_bzip2.c ============================================================================== --- head/lib/libarchive/archive_read_support_compression_bzip2.c Sun Jul 17 21:15:20 2011 (r224151) +++ head/lib/libarchive/archive_read_support_compression_bzip2.c Sun Jul 17 21:27:38 2011 (r224152) @@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$"); #include "archive_private.h" #include "archive_read_private.h" -#if HAVE_BZLIB_H +#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR) struct private_data { bz_stream stream; char *out_block; @@ -86,7 +86,7 @@ archive_read_support_compression_bzip2(s reader->init = bzip2_reader_init; reader->options = NULL; reader->free = bzip2_reader_free; -#if HAVE_BZLIB_H +#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR) return (ARCHIVE_OK); #else archive_set_error(_a, ARCHIVE_ERRNO_MISC, @@ -146,7 +146,7 @@ bzip2_reader_bid(struct archive_read_fil return (bits_checked); } -#ifndef HAVE_BZLIB_H +#if !defined(HAVE_BZLIB_H) || !defined(BZ_CONFIG_ERROR) /* * If we don't have the library on this system, we can't actually do the Added: head/lib/libarchive/archive_read_support_compression_rpm.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libarchive/archive_read_support_compression_rpm.c Sun Jul 17 21:27:38 2011 (r224152) @@ -0,0 +1,288 @@ +/*- + * Copyright (c) 2009 Michihiro NAKAJIMA + * 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(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 AUTHOR(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. + */ + +#include "archive_platform.h" +__FBSDID("$FreeBSD$"); + +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif + +#include "archive.h" +#include "archive_endian.h" +#include "archive_private.h" +#include "archive_read_private.h" + +struct rpm { + int64_t total_in; + size_t hpos; + size_t hlen; + unsigned char header[16]; + enum { + ST_LEAD, /* Skipping 'Lead' section. */ + ST_HEADER, /* Reading 'Header' section; + * first 16 bytes. */ + ST_HEADER_DATA, /* Skipping 'Header' section. */ + ST_PADDING, /* Skipping padding data after the + * 'Header' section. */ + ST_ARCHIVE /* Reading 'Archive' section. */ + } state; + int first_header; +}; +#define RPM_LEAD_SIZE 96 /* Size of 'Lead' section. */ + +static int rpm_bidder_bid(struct archive_read_filter_bidder *, + struct archive_read_filter *); +static int rpm_bidder_init(struct archive_read_filter *); + +static ssize_t rpm_filter_read(struct archive_read_filter *, + const void **); +static int rpm_filter_close(struct archive_read_filter *); + +int +archive_read_support_compression_rpm(struct archive *_a) +{ + struct archive_read *a = (struct archive_read *)_a; + struct archive_read_filter_bidder *bidder; + + bidder = __archive_read_get_bidder(a); + archive_clear_error(_a); + if (bidder == NULL) + return (ARCHIVE_FATAL); + + bidder->data = NULL; + bidder->bid = rpm_bidder_bid; + bidder->init = rpm_bidder_init; + bidder->options = NULL; + bidder->free = NULL; + return (ARCHIVE_OK); +} + +static int +rpm_bidder_bid(struct archive_read_filter_bidder *self, + struct archive_read_filter *filter) +{ + const unsigned char *b; + ssize_t avail; + int bits_checked; + + (void)self; /* UNUSED */ + + b = __archive_read_filter_ahead(filter, 8, &avail); + if (b == NULL) + return (0); + + bits_checked = 0; + /* + * Verify Header Magic Bytes : 0xed 0xab 0xee 0xdb + */ + if (b[0] != 0xed) + return (0); + bits_checked += 8; + if (b[1] != 0xab) + return (0); + bits_checked += 8; + if (b[2] != 0xee) + return (0); + bits_checked += 8; + if (b[3] != 0xdb) + return (0); + bits_checked += 8; + /* + * Check major version. + */ + if (b[4] != 3 && b[4] != 4) + return (0); + bits_checked += 8; + /* + * Check package type; binary or source. + */ + if (b[6] != 0) + return (0); + bits_checked += 8; + if (b[7] != 0 && b[7] != 1) + return (0); + bits_checked += 8; + + return (bits_checked); +} + +static int +rpm_bidder_init(struct archive_read_filter *self) +{ + struct rpm *rpm; + + self->code = ARCHIVE_COMPRESSION_RPM; + self->name = "rpm"; + self->read = rpm_filter_read; + self->skip = NULL; /* not supported */ + self->close = rpm_filter_close; + + rpm = (struct rpm *)calloc(sizeof(*rpm), 1); + if (rpm == NULL) { + archive_set_error(&self->archive->archive, ENOMEM, + "Can't allocate data for rpm"); + return (ARCHIVE_FATAL); + } + + self->data = rpm; + rpm->state = ST_LEAD; + + return (ARCHIVE_OK); +} + +static ssize_t +rpm_filter_read(struct archive_read_filter *self, const void **buff) +{ + struct rpm *rpm; + const unsigned char *b; + ssize_t avail_in, total; + size_t used, n; + uint32_t section; + uint32_t bytes; + + rpm = (struct rpm *)self->data; + *buff = NULL; + total = avail_in = 0; + b = NULL; + used = 0; + do { + if (b == NULL) { + b = __archive_read_filter_ahead(self->upstream, 1, + &avail_in); + if (b == NULL) { + if (avail_in < 0) + return (ARCHIVE_FATAL); + else + break; + } + } + + switch (rpm->state) { + case ST_LEAD: + if (rpm->total_in + avail_in < RPM_LEAD_SIZE) + used += avail_in; + else { + n = RPM_LEAD_SIZE - rpm->total_in; + used += n; + b += n; + rpm->state = ST_HEADER; + rpm->hpos = 0; + rpm->hlen = 0; + rpm->first_header = 1; + } + break; + case ST_HEADER: + n = 16 - rpm->hpos; + if (n > avail_in - used) + n = avail_in - used; + memcpy(rpm->header+rpm->hpos, b, n); + b += n; + used += n; + rpm->hpos += n; + + if (rpm->hpos == 16) { + if (rpm->header[0] != 0x8e || + rpm->header[1] != 0xad || + rpm->header[2] != 0xe8 || + rpm->header[3] != 0x01) { + if (rpm->first_header) { + archive_set_error( + &self->archive->archive, + ARCHIVE_ERRNO_FILE_FORMAT, + "Unrecoginized rpm header"); + return (ARCHIVE_FATAL); + } + rpm->state = ST_ARCHIVE; + *buff = rpm->header; + total = rpm->hpos; + break; + } + /* Calculate 'Header' length. */ + section = archive_be32dec(rpm->header+8); + bytes = archive_be32dec(rpm->header+12); + rpm->hlen = 16 + section * 16 + bytes; + rpm->state = ST_HEADER_DATA; + rpm->first_header = 0; + } + break; + case ST_HEADER_DATA: + n = rpm->hlen - rpm->hpos; + if (n > avail_in - used) + n = avail_in - used; + b += n; + used += n; + rpm->hpos += n; + if (rpm->hpos == rpm->hlen) + rpm->state = ST_PADDING; + break; + case ST_PADDING: + while (used < (size_t)avail_in) { + if (*b != 0) { + /* Read next header. */ + rpm->state = ST_HEADER; + rpm->hpos = 0; + rpm->hlen = 0; + break; + } + b++; + used++; + } + break; + case ST_ARCHIVE: + *buff = b; + total = avail_in; + used = avail_in; + break; + } + if (used == (size_t)avail_in) { + rpm->total_in += used; + __archive_read_filter_consume(self->upstream, used); + b = NULL; + used = 0; + } + } while (total == 0 && avail_in > 0); + + if (used > 0 && b != NULL) { + rpm->total_in += used; + __archive_read_filter_consume(self->upstream, used); + } + return (total); +} + +static int +rpm_filter_close(struct archive_read_filter *self) +{ + struct rpm *rpm; + + rpm = (struct rpm *)self->data; + free(rpm); + + return (ARCHIVE_OK); +} + Modified: head/lib/libarchive/archive_read_support_compression_uu.c ============================================================================== --- head/lib/libarchive/archive_read_support_compression_uu.c Sun Jul 17 21:15:20 2011 (r224151) +++ head/lib/libarchive/archive_read_support_compression_uu.c Sun Jul 17 21:27:38 2011 (r224152) @@ -325,7 +325,7 @@ uudecode_bidder_bid(struct archive_read_ --len; } b += nl; - + if (avail >= 5 && memcmp(b, "====\n", 5) == 0) return (firstline+40); if (avail >= 6 && memcmp(b, "====\r\n", 6) == 0) Modified: head/lib/libarchive/archive_read_support_format_all.c ============================================================================== --- head/lib/libarchive/archive_read_support_format_all.c Sun Jul 17 21:15:20 2011 (r224151) +++ head/lib/libarchive/archive_read_support_format_all.c Sun Jul 17 21:27:38 2011 (r224152) @@ -37,6 +37,7 @@ archive_read_support_format_all(struct a archive_read_support_format_iso9660(a); archive_read_support_format_mtree(a); archive_read_support_format_tar(a); + archive_read_support_format_xar(a); archive_read_support_format_zip(a); return (ARCHIVE_OK); } Modified: head/lib/libarchive/archive_read_support_format_mtree.c ============================================================================== --- head/lib/libarchive/archive_read_support_format_mtree.c Sun Jul 17 21:15:20 2011 (r224151) +++ head/lib/libarchive/archive_read_support_format_mtree.c Sun Jul 17 21:27:38 2011 (r224152) @@ -370,7 +370,7 @@ process_add_entry(struct archive_read *a line = next; next = line + strcspn(line, " \t\r\n"); eq = strchr(line, '='); - if (eq > next) + if (eq == NULL || eq > next) len = next - line; else len = eq - line; Added: head/lib/libarchive/archive_read_support_format_xar.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libarchive/archive_read_support_format_xar.c Sun Jul 17 21:27:38 2011 (r224152) @@ -0,0 +1,3151 @@ +/*- + * Copyright (c) 2009 Michihiro NAKAJIMA + * 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(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 AUTHOR(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. + */ +#include "archive_platform.h" +__FBSDID("$FreeBSD$"); + +#ifdef HAVE_ERRNO_H +#include +#endif +#include +#ifdef HAVE_STDLIB_H +#include +#endif +#if HAVE_LIBXML_XMLREADER_H +#include +#elif HAVE_BSDXML_H +#include +#elif HAVE_EXPAT_H +#include +#endif +#ifdef HAVE_BZLIB_H +#include +#endif +#if HAVE_LZMA_H +#include +#elif HAVE_LZMADEC_H +#include +#endif +#ifdef HAVE_ZLIB_H +#include +#endif + +#include "archive.h" +#include "archive_endian.h" +#include "archive_entry.h" +#include "archive_hash.h" +#include "archive_private.h" +#include "archive_read_private.h" + +#if (!defined(HAVE_LIBXML_XMLREADER_H) && \ + !defined(HAVE_BSDXML_H) && !defined(HAVE_EXPAT_H)) ||\ + !defined(HAVE_ZLIB_H) || \ + !defined(ARCHIVE_HAS_MD5) || !defined(ARCHIVE_HAS_SHA1) +/* + * xar needs several external libraries. + * o libxml2 or expat --- XML parser + * o openssl or MD5/SHA1 hash function + * o zlib + * o bzlib2 (option) + * o liblzma (option) + */ +int +archive_read_support_format_xar(struct archive *_a) +{ + struct archive_read *a = (struct archive_read *)_a; + + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Xar not supported on this platform"); + return (ARCHIVE_WARN); +} + +#else /* Support xar format */ + +//#define DEBUG 1 +//#define DEBUG_PRINT_TOC 1 +#if DEBUG_PRINT_TOC +#define PRINT_TOC(d, outbytes) do { \ + unsigned char *x = (unsigned char *)(uintptr_t)d; \ + unsigned char c = x[outbytes-1]; \ + x[outbytes - 1] = 0; \ + fprintf(stderr, "%s", x); \ + fprintf(stderr, "%c", c); \ + x[outbytes - 1] = c; \ +} while (0) +#else +#define PRINT_TOC(d, outbytes) +#endif + +#define HEADER_MAGIC 0x78617221 +#define HEADER_SIZE 28 +#define HEADER_VERSION 1 +#define CKSUM_NONE 0 +#define CKSUM_SHA1 1 +#define CKSUM_MD5 2 + +#define MD5_SIZE 16 +#define SHA1_SIZE 20 +#define MAX_SUM_SIZE 20 + +enum enctype { + NONE, + GZIP, + BZIP2, + LZMA, + XZ, +}; + +struct chksumval { + int alg; + size_t len; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Jul 17 21:33:15 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB4A9106564A; Sun, 17 Jul 2011 21:33:15 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D87BA8FC08; Sun, 17 Jul 2011 21:33:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6HLXFQD091257; Sun, 17 Jul 2011 21:33:15 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6HLXFJ6091245; Sun, 17 Jul 2011 21:33:15 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201107172133.p6HLXFJ6091245@svn.freebsd.org> From: Martin Matuska Date: Sun, 17 Jul 2011 21:33:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224153 - in head/usr.bin/tar: . test X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2011 21:33:16 -0000 Author: mm Date: Sun Jul 17 21:33:15 2011 New Revision: 224153 URL: http://svn.freebsd.org/changeset/base/224153 Log: Update bsdtar to 2.8.4 Use common code from lib/libarchive/libarchive_fe Approved by: kientzle MFC after: 2 weeks Added: head/usr.bin/tar/test/test_empty_mtree.c (contents, props changed) head/usr.bin/tar/test/test_option_T_upper.c (contents, props changed) head/usr.bin/tar/test/test_option_r.c (contents, props changed) Deleted: head/usr.bin/tar/err.c head/usr.bin/tar/err.h head/usr.bin/tar/line_reader.c head/usr.bin/tar/line_reader.h head/usr.bin/tar/matching.c head/usr.bin/tar/matching.h head/usr.bin/tar/pathmatch.c head/usr.bin/tar/pathmatch.h head/usr.bin/tar/test/test_option_T.c Modified: head/usr.bin/tar/Makefile head/usr.bin/tar/bsdtar.1 head/usr.bin/tar/bsdtar.c head/usr.bin/tar/cmdline.c head/usr.bin/tar/config_freebsd.h head/usr.bin/tar/read.c head/usr.bin/tar/subst.c head/usr.bin/tar/test/Makefile head/usr.bin/tar/test/main.c head/usr.bin/tar/test/test.h head/usr.bin/tar/test/test_0.c head/usr.bin/tar/test/test_basic.c head/usr.bin/tar/test/test_copy.c head/usr.bin/tar/test/test_help.c head/usr.bin/tar/test/test_option_q.c head/usr.bin/tar/test/test_option_s.c head/usr.bin/tar/test/test_patterns.c head/usr.bin/tar/test/test_patterns_2.tar.uu head/usr.bin/tar/test/test_patterns_3.tar.uu head/usr.bin/tar/test/test_patterns_4.tar.uu head/usr.bin/tar/test/test_stdio.c head/usr.bin/tar/test/test_strip_components.c head/usr.bin/tar/test/test_symlink_dir.c head/usr.bin/tar/test/test_version.c head/usr.bin/tar/util.c head/usr.bin/tar/write.c Modified: head/usr.bin/tar/Makefile ============================================================================== --- head/usr.bin/tar/Makefile Sun Jul 17 21:27:38 2011 (r224152) +++ head/usr.bin/tar/Makefile Sun Jul 17 21:33:15 2011 (r224153) @@ -2,21 +2,24 @@ .include PROG= bsdtar -BSDTAR_VERSION_STRING=2.8.3 +BSDTAR_VERSION_STRING=2.8.4 SRCS= bsdtar.c \ cmdline.c \ - err.c \ getdate.c \ - line_reader.c \ - matching.c \ - pathmatch.c \ read.c \ subst.c \ tree.c \ util.c \ write.c -DPADD= ${LIBARCHIVE} ${LIBBZ2} ${LIBZ} ${LIBMD} ${LIBLZMA} -LDADD= -larchive -lbz2 -lz -lmd -llzma + +.PATH: ${.CURDIR}/../../lib/libarchive/libarchive_fe +SRCS+= err.c \ + line_reader.c \ + matching.c \ + pathmatch.c + +DPADD= ${LIBARCHIVE} ${LIBBZ2} ${LIBZ} ${LIBMD} ${LIBLZMA} ${LIBBSDXML} +LDADD= -larchive -lbz2 -lz -lmd -llzma -lbsdxml .if ${MK_OPENSSL} != "no" DPADD+= ${LIBCRYPTO} LDADD+= -lcrypto @@ -24,6 +27,7 @@ LDADD+= -lcrypto CFLAGS+= -DBSDTAR_VERSION_STRING=\"${BSDTAR_VERSION_STRING}\" CFLAGS+= -DPLATFORM_CONFIG_H=\"config_freebsd.h\" CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../../lib/libarchive +CFLAGS+= -I${.CURDIR}/../../lib/libarchive/libarchive_fe SYMLINKS= bsdtar ${BINDIR}/tar MLINKS= bsdtar.1 tar.1 DEBUG_FLAGS=-g Modified: head/usr.bin/tar/bsdtar.1 ============================================================================== --- head/usr.bin/tar/bsdtar.1 Sun Jul 17 21:27:38 2011 (r224152) +++ head/usr.bin/tar/bsdtar.1 Sun Jul 17 21:33:15 2011 (r224153) @@ -50,8 +50,8 @@ .Sh DESCRIPTION .Nm creates and manipulates streaming archive files. -This implementation can extract from tar, pax, cpio, zip, jar, ar, -xar, and ISO 9660 cdrom images and can create tar, pax, cpio, ar, zip, +This implementation can extract from tar, pax, cpio, zip, jar, ar, xar, +rpm and ISO 9660 cdrom images and can create tar, pax, cpio, ar, zip, and shar archives. .Pp The first synopsis form shows a Modified: head/usr.bin/tar/bsdtar.c ============================================================================== --- head/usr.bin/tar/bsdtar.c Sun Jul 17 21:27:38 2011 (r224152) +++ head/usr.bin/tar/bsdtar.c Sun Jul 17 21:33:15 2011 (r224153) @@ -63,6 +63,9 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_UNISTD_H #include #endif +#if HAVE_ZLIB_H +#include +#endif #include "bsdtar.h" #include "err.h" @@ -86,6 +89,8 @@ __FBSDID("$FreeBSD$"); int _CRT_glob = 0; /* Disable broken CRT globbing. */ #endif +static struct bsdtar *_bsdtar; + #if defined(HAVE_SIGACTION) && (defined(SIGINFO) || defined(SIGUSR1)) static volatile int siginfo_occurred; @@ -139,7 +144,7 @@ main(int argc, char **argv) * Use a pointer for consistency, but stack-allocated storage * for ease of cleanup. */ - bsdtar = &bsdtar_storage; + _bsdtar = bsdtar = &bsdtar_storage; memset(bsdtar, 0, sizeof(*bsdtar)); bsdtar->fd = -1; /* Mark as "unused" */ option_o = 0; @@ -152,36 +157,36 @@ main(int argc, char **argv) sa.sa_flags = 0; #ifdef SIGINFO if (sigaction(SIGINFO, &sa, NULL)) - bsdtar_errc(1, errno, "sigaction(SIGINFO) failed"); + lafe_errc(1, errno, "sigaction(SIGINFO) failed"); #endif #ifdef SIGUSR1 /* ... and treat SIGUSR1 the same way as SIGINFO. */ if (sigaction(SIGUSR1, &sa, NULL)) - bsdtar_errc(1, errno, "sigaction(SIGUSR1) failed"); + lafe_errc(1, errno, "sigaction(SIGUSR1) failed"); #endif } #endif - /* Need bsdtar_progname before calling bsdtar_warnc. */ + /* Need lafe_progname before calling lafe_warnc. */ if (*argv == NULL) - bsdtar_progname = "bsdtar"; + lafe_progname = "bsdtar"; else { #if defined(_WIN32) && !defined(__CYGWIN__) - bsdtar_progname = strrchr(*argv, '\\'); + lafe_progname = strrchr(*argv, '\\'); #else - bsdtar_progname = strrchr(*argv, '/'); + lafe_progname = strrchr(*argv, '/'); #endif - if (bsdtar_progname != NULL) - bsdtar_progname++; + if (lafe_progname != NULL) + lafe_progname++; else - bsdtar_progname = *argv; + lafe_progname = *argv; } time(&now); #if HAVE_SETLOCALE if (setlocale(LC_ALL, "") == NULL) - bsdtar_warnc(0, "Failed to set default locale"); + lafe_warnc(0, "Failed to set default locale"); #endif #if defined(HAVE_NL_LANGINFO) && defined(HAVE_D_MD_ORDER) bsdtar->day_first = (*nl_langinfo(D_MD_ORDER) == 'd'); @@ -233,7 +238,7 @@ main(int argc, char **argv) case 'b': /* SUSv2 */ t = atoi(bsdtar->optarg); if (t <= 0 || t > 8192) - bsdtar_errc(1, 0, + lafe_errc(1, 0, "Argument to -b is out of range (1..8192)"); bsdtar->bytes_per_block = 512 * t; break; @@ -251,7 +256,7 @@ main(int argc, char **argv) break; case OPTION_EXCLUDE: /* GNU tar */ if (lafe_exclude(&bsdtar->matching, bsdtar->optarg)) - bsdtar_errc(1, 0, + lafe_errc(1, 0, "Couldn't exclude %s\n", bsdtar->optarg); break; case OPTION_FORMAT: /* GNU tar, others */ @@ -297,20 +302,20 @@ main(int argc, char **argv) * when transforming archives. */ if (lafe_include(&bsdtar->matching, bsdtar->optarg)) - bsdtar_errc(1, 0, + lafe_errc(1, 0, "Failed to add %s to inclusion list", bsdtar->optarg); break; case 'j': /* GNU tar */ if (bsdtar->create_compression != '\0') - bsdtar_errc(1, 0, + lafe_errc(1, 0, "Can't specify both -%c and -%c", opt, bsdtar->create_compression); bsdtar->create_compression = opt; break; case 'J': /* GNU tar 1.21 and later */ if (bsdtar->create_compression != '\0') - bsdtar_errc(1, 0, + lafe_errc(1, 0, "Can't specify both -%c and -%c", opt, bsdtar->create_compression); bsdtar->create_compression = opt; @@ -330,7 +335,7 @@ main(int argc, char **argv) break; case OPTION_LZMA: if (bsdtar->create_compression != '\0') - bsdtar_errc(1, 0, + lafe_errc(1, 0, "Can't specify both -%c and -%c", opt, bsdtar->create_compression); bsdtar->create_compression = opt; @@ -355,7 +360,7 @@ main(int argc, char **argv) { struct stat st; if (stat(bsdtar->optarg, &st) != 0) - bsdtar_errc(1, 0, + lafe_errc(1, 0, "Can't open file %s", bsdtar->optarg); bsdtar->newer_ctime_sec = st.st_ctime; bsdtar->newer_ctime_nsec = @@ -369,7 +374,7 @@ main(int argc, char **argv) { struct stat st; if (stat(bsdtar->optarg, &st) != 0) - bsdtar_errc(1, 0, + lafe_errc(1, 0, "Can't open file %s", bsdtar->optarg); bsdtar->newer_mtime_sec = st.st_mtime; bsdtar->newer_mtime_nsec = @@ -440,7 +445,7 @@ main(int argc, char **argv) #if HAVE_REGEX_H add_substitution(bsdtar, bsdtar->optarg); #else - bsdtar_warnc(0, + lafe_warnc(0, "-s is not supported by this version of bsdtar"); usage(); #endif @@ -487,7 +492,7 @@ main(int argc, char **argv) break; case 'X': /* GNU tar */ if (lafe_exclude_from_file(&bsdtar->matching, bsdtar->optarg)) - bsdtar_errc(1, 0, + lafe_errc(1, 0, "failed to process exclusions from file %s", bsdtar->optarg); break; @@ -496,21 +501,21 @@ main(int argc, char **argv) break; case 'y': /* FreeBSD version of GNU tar */ if (bsdtar->create_compression != '\0') - bsdtar_errc(1, 0, + lafe_errc(1, 0, "Can't specify both -%c and -%c", opt, bsdtar->create_compression); bsdtar->create_compression = opt; break; case 'Z': /* GNU tar */ if (bsdtar->create_compression != '\0') - bsdtar_errc(1, 0, + lafe_errc(1, 0, "Can't specify both -%c and -%c", opt, bsdtar->create_compression); bsdtar->create_compression = opt; break; case 'z': /* GNU tar, star, many others */ if (bsdtar->create_compression != '\0') - bsdtar_errc(1, 0, + lafe_errc(1, 0, "Can't specify both -%c and -%c", opt, bsdtar->create_compression); bsdtar->create_compression = opt; @@ -535,7 +540,7 @@ main(int argc, char **argv) /* Otherwise, a mode is required. */ if (bsdtar->mode == '\0') - bsdtar_errc(1, 0, + lafe_errc(1, 0, "Must specify one of -c, -r, -t, -u, -x"); /* Check boolean options only permitted in certain modes. */ @@ -615,7 +620,7 @@ main(int argc, char **argv) #endif if (bsdtar->return_value != 0) - bsdtar_warnc(0, + lafe_warnc(0, "Error exit delayed from previous errors."); return (bsdtar->return_value); } @@ -624,7 +629,7 @@ static void set_mode(struct bsdtar *bsdtar, char opt) { if (bsdtar->mode != '\0' && bsdtar->mode != opt) - bsdtar_errc(1, 0, + lafe_errc(1, 0, "Can't specify both -%c and -%c", opt, bsdtar->mode); bsdtar->mode = opt; } @@ -636,7 +641,7 @@ static void only_mode(struct bsdtar *bsdtar, const char *opt, const char *valid_modes) { if (strchr(valid_modes, bsdtar->mode) == NULL) - bsdtar_errc(1, 0, + lafe_errc(1, 0, "Option %s is not permitted in mode -%c", opt, bsdtar->mode); } @@ -647,7 +652,7 @@ usage(void) { const char *p; - p = bsdtar_progname; + p = lafe_progname; fprintf(stderr, "Usage:\n"); fprintf(stderr, " List: %s -tf \n", p); @@ -707,7 +712,7 @@ long_help(void) const char *prog; const char *p; - prog = bsdtar_progname; + prog = lafe_progname; fflush(stderr); Modified: head/usr.bin/tar/cmdline.c ============================================================================== --- head/usr.bin/tar/cmdline.c Sun Jul 17 21:27:38 2011 (r224152) +++ head/usr.bin/tar/cmdline.c Sun Jul 17 21:33:15 2011 (r224153) @@ -221,7 +221,7 @@ bsdtar_getopt(struct bsdtar *bsdtar) if (p[1] == ':') { bsdtar->optarg = *bsdtar->argv; if (bsdtar->optarg == NULL) { - bsdtar_warnc(0, + lafe_warnc(0, "Option %c requires an argument", opt); return ('?'); @@ -288,7 +288,7 @@ bsdtar_getopt(struct bsdtar *bsdtar) /* Otherwise, pick up the next word. */ opt_word = *bsdtar->argv; if (opt_word == NULL) { - bsdtar_warnc(0, + lafe_warnc(0, "Option -%c requires an argument", opt); return ('?'); @@ -339,13 +339,13 @@ bsdtar_getopt(struct bsdtar *bsdtar) /* Fail if there wasn't a unique match. */ if (match == NULL) { - bsdtar_warnc(0, + lafe_warnc(0, "Option %s%s is not supported", long_prefix, opt_word); return ('?'); } if (match2 != NULL) { - bsdtar_warnc(0, + lafe_warnc(0, "Ambiguous option %s%s (matches --%s and --%s)", long_prefix, opt_word, match->name, match2->name); return ('?'); @@ -357,7 +357,7 @@ bsdtar_getopt(struct bsdtar *bsdtar) if (bsdtar->optarg == NULL) { bsdtar->optarg = *bsdtar->argv; if (bsdtar->optarg == NULL) { - bsdtar_warnc(0, + lafe_warnc(0, "Option %s%s requires an argument", long_prefix, match->name); return ('?'); @@ -368,7 +368,7 @@ bsdtar_getopt(struct bsdtar *bsdtar) } else { /* Argument forbidden: fail if there is one. */ if (bsdtar->optarg != NULL) { - bsdtar_warnc(0, + lafe_warnc(0, "Option %s%s does not allow an argument", long_prefix, match->name); return ('?'); Modified: head/usr.bin/tar/config_freebsd.h ============================================================================== --- head/usr.bin/tar/config_freebsd.h Sun Jul 17 21:27:38 2011 (r224152) +++ head/usr.bin/tar/config_freebsd.h Sun Jul 17 21:33:15 2011 (r224153) @@ -44,6 +44,7 @@ #undef HAVE_LIBACL #define HAVE_LIBARCHIVE 1 #define HAVE_LIMITS_H 1 +#define HAVE_LINK 1 #undef HAVE_LINUX_EXT2_FS_H #undef HAVE_LINUX_FS_H #define HAVE_LOCALE_H 1 @@ -77,5 +78,5 @@ #define HAVE_TIME_H 1 #define HAVE_UNISTD_H 1 #define HAVE_WCTYPE_H 1 +#define HAVE_WCSCMP 1 #undef HAVE_WINDOWS_H - Modified: head/usr.bin/tar/read.c ============================================================================== --- head/usr.bin/tar/read.c Sun Jul 17 21:27:38 2011 (r224152) +++ head/usr.bin/tar/read.c Sun Jul 17 21:33:15 2011 (r224153) @@ -23,7 +23,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "bsdtar_platform.h" +#include "lafe_platform.h" __FBSDID("$FreeBSD$"); #ifdef HAVE_SYS_TYPES_H @@ -160,11 +160,11 @@ read_archive(struct bsdtar *bsdtar, char archive_read_support_compression_all(a); archive_read_support_format_all(a); if (ARCHIVE_OK != archive_read_set_options(a, bsdtar->option_options)) - bsdtar_errc(1, 0, "%s", archive_error_string(a)); + lafe_errc(1, 0, "%s", archive_error_string(a)); if (archive_read_open_file(a, bsdtar->filename, bsdtar->bytes_per_block != 0 ? bsdtar->bytes_per_block : DEFAULT_BYTES_PER_BLOCK)) - bsdtar_errc(1, 0, "Error opening archive: %s", + lafe_errc(1, 0, "Error opening archive: %s", archive_error_string(a)); do_chdir(bsdtar); @@ -180,9 +180,9 @@ read_archive(struct bsdtar *bsdtar, char if (mode == 'x' && bsdtar->option_chroot) { #if HAVE_CHROOT if (chroot(".") != 0) - bsdtar_errc(1, errno, "Can't chroot to \".\""); + lafe_errc(1, errno, "Can't chroot to \".\""); #else - bsdtar_errc(1, 0, + lafe_errc(1, 0, "chroot isn't supported on this platform"); #endif } @@ -198,12 +198,12 @@ read_archive(struct bsdtar *bsdtar, char if (r == ARCHIVE_EOF) break; if (r < ARCHIVE_OK) - bsdtar_warnc(0, "%s", archive_error_string(a)); + lafe_warnc(0, "%s", archive_error_string(a)); if (r <= ARCHIVE_WARN) bsdtar->return_value = 1; if (r == ARCHIVE_RETRY) { /* Retryable error: try again */ - bsdtar_warnc(0, "Retrying..."); + lafe_warnc(0, "Retrying..."); continue; } if (r == ARCHIVE_FATAL) @@ -267,17 +267,17 @@ read_archive(struct bsdtar *bsdtar, char r = archive_read_data_skip(a); if (r == ARCHIVE_WARN) { fprintf(out, "\n"); - bsdtar_warnc(0, "%s", + lafe_warnc(0, "%s", archive_error_string(a)); } if (r == ARCHIVE_RETRY) { fprintf(out, "\n"); - bsdtar_warnc(0, "%s", + lafe_warnc(0, "%s", archive_error_string(a)); } if (r == ARCHIVE_FATAL) { fprintf(out, "\n"); - bsdtar_warnc(0, "%s", + lafe_warnc(0, "%s", archive_error_string(a)); bsdtar->return_value = 1; break; @@ -329,7 +329,7 @@ read_archive(struct bsdtar *bsdtar, char r = archive_read_close(a); if (r != ARCHIVE_OK) - bsdtar_warnc(0, "%s", archive_error_string(a)); + lafe_warnc(0, "%s", archive_error_string(a)); if (r <= ARCHIVE_WARN) bsdtar->return_value = 1; Modified: head/usr.bin/tar/subst.c ============================================================================== --- head/usr.bin/tar/subst.c Sun Jul 17 21:27:38 2011 (r224152) +++ head/usr.bin/tar/subst.c Sun Jul 17 21:33:15 2011 (r224153) @@ -58,7 +58,7 @@ init_substitution(struct bsdtar *bsdtar) bsdtar->substitution = subst = malloc(sizeof(*subst)); if (subst == NULL) - bsdtar_errc(1, errno, "Out of memory"); + lafe_errc(1, errno, "Out of memory"); subst->first_rule = subst->last_rule = NULL; } @@ -78,7 +78,7 @@ add_substitution(struct bsdtar *bsdtar, rule = malloc(sizeof(*rule)); if (rule == NULL) - bsdtar_errc(1, errno, "Out of memory"); + lafe_errc(1, errno, "Out of memory"); rule->next = NULL; if (subst->last_rule == NULL) @@ -88,32 +88,32 @@ add_substitution(struct bsdtar *bsdtar, subst->last_rule = rule; if (*rule_text == '\0') - bsdtar_errc(1, 0, "Empty replacement string"); + lafe_errc(1, 0, "Empty replacement string"); end_pattern = strchr(rule_text + 1, *rule_text); if (end_pattern == NULL) - bsdtar_errc(1, 0, "Invalid replacement string"); + lafe_errc(1, 0, "Invalid replacement string"); pattern = malloc(end_pattern - rule_text); if (pattern == NULL) - bsdtar_errc(1, errno, "Out of memory"); + lafe_errc(1, errno, "Out of memory"); memcpy(pattern, rule_text + 1, end_pattern - rule_text - 1); pattern[end_pattern - rule_text - 1] = '\0'; if ((r = regcomp(&rule->re, pattern, REG_BASIC)) != 0) { char buf[80]; regerror(r, &rule->re, buf, sizeof(buf)); - bsdtar_errc(1, 0, "Invalid regular expression: %s", buf); + lafe_errc(1, 0, "Invalid regular expression: %s", buf); } free(pattern); start_subst = end_pattern + 1; end_pattern = strchr(start_subst, *rule_text); if (end_pattern == NULL) - bsdtar_errc(1, 0, "Invalid replacement string"); + lafe_errc(1, 0, "Invalid replacement string"); rule->result = malloc(end_pattern - start_subst + 1); if (rule->result == NULL) - bsdtar_errc(1, errno, "Out of memory"); + lafe_errc(1, errno, "Out of memory"); memcpy(rule->result, start_subst, end_pattern - start_subst); rule->result[end_pattern - start_subst] = '\0'; @@ -136,7 +136,7 @@ add_substitution(struct bsdtar *bsdtar, rule->symlink = 1; break; default: - bsdtar_errc(1, 0, "Invalid replacement flag %c", *end_pattern); + lafe_errc(1, 0, "Invalid replacement flag %c", *end_pattern); } } } @@ -154,7 +154,7 @@ realloc_strncat(char **str, const char * new_str = malloc(old_len + len + 1); if (new_str == NULL) - bsdtar_errc(1, errno, "Out of memory"); + lafe_errc(1, errno, "Out of memory"); memcpy(new_str, *str, old_len); memcpy(new_str + old_len, append, len); new_str[old_len + len] = '\0'; @@ -175,7 +175,7 @@ realloc_strcat(char **str, const char *a new_str = malloc(old_len + strlen(append) + 1); if (new_str == NULL) - bsdtar_errc(1, errno, "Out of memory"); + lafe_errc(1, errno, "Out of memory"); memcpy(new_str, *str, old_len); strcpy(new_str + old_len, append); free(*str); Modified: head/usr.bin/tar/test/Makefile ============================================================================== --- head/usr.bin/tar/test/Makefile Sun Jul 17 21:27:38 2011 (r224152) +++ head/usr.bin/tar/test/Makefile Sun Jul 17 21:33:15 2011 (r224153) @@ -6,16 +6,18 @@ TAR_SRCDIR=${.CURDIR}/.. # Some tar sources are pulled in for white-box tests TAR_SRCS= \ - ../getdate.c + getdate.c TESTS= \ test_0.c \ test_basic.c \ test_copy.c \ + test_empty_mtree.c \ test_getdate.c \ test_help.c \ - test_option_T.c \ + test_option_T_upper.c \ test_option_q.c \ + test_option_r.c \ test_option_s.c \ test_patterns.c \ test_stdio.c \ Modified: head/usr.bin/tar/test/main.c ============================================================================== --- head/usr.bin/tar/test/main.c Sun Jul 17 21:27:38 2011 (r224152) +++ head/usr.bin/tar/test/main.c Sun Jul 17 21:33:15 2011 (r224153) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2007 Tim Kientzle + * Copyright (c) 2003-2009 Tim Kientzle * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -23,12 +23,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* - * Various utility routines useful for test programs. - * Each test program is linked against this file. - */ #include "test.h" - #include #include #include @@ -38,148 +33,319 @@ * This same file is used pretty much verbatim for all test harnesses. * * The next few lines are the only differences. + * TODO: Move this into a separate configuration header, have all test + * suites share one copy of this file. */ -#define PROGRAM "bsdtar" /* Name of program being tested. */ -#define ENVBASE "BSDTAR" /* Prefix for environment variables. */ +__FBSDID("$FreeBSD$"); +#define KNOWNREF "test_patterns_2.tar.uu" +#define ENVBASE "BSDTAR" /* Prefix for environment variables. */ +#define PROGRAM "bsdtar" /* Name of program being tested. */ +#undef LIBRARY /* Not testing a library. */ #undef EXTRA_DUMP /* How to dump extra data */ /* How to generate extra version info. */ #define EXTRA_VERSION (systemf("%s --version", testprog) ? "" : "") -__FBSDID("$FreeBSD$"); /* - * "list.h" is simply created by "grep DEFINE_TEST"; it has - * a line like - * DEFINE_TEST(test_function) - * for each test. - * Include it here with a suitable DEFINE_TEST to declare all of the - * test functions. + * + * Windows support routines + * + * Note: Configuration is a tricky issue. Using HAVE_* feature macros + * in the test harness is dangerous because they cover up + * configuration errors. The classic example of this is omitting a + * configure check. If libarchive and libarchive_test both look for + * the same feature macro, such errors are hard to detect. Platform + * macros (e.g., _WIN32 or __GNUC__) are a little better, but can + * easily lead to very messy code. It's best to limit yourself + * to only the most generic programming techniques in the test harness + * and thus avoid conditionals altogether. Where that's not possible, + * try to minimize conditionals by grouping platform-specific tests in + * one place (e.g., test_acl_freebsd) or by adding new assert() + * functions (e.g., assertMakeHardlink()) to cover up platform + * differences. Platform-specific coding in libarchive_test is often + * a symptom that some capability is missing from libarchive itself. */ -#undef DEFINE_TEST -#define DEFINE_TEST(name) void name(void); -#include "list.h" +#if defined(_WIN32) && !defined(__CYGWIN__) +#include +#include +#ifndef F_OK +#define F_OK (0) +#endif +#ifndef S_ISDIR +#define S_ISDIR(m) ((m) & _S_IFDIR) +#endif +#ifndef S_ISREG +#define S_ISREG(m) ((m) & _S_IFREG) +#endif +#if !defined(__BORLANDC__) +#define access _access +#undef chdir +#define chdir _chdir +#endif +#ifndef fileno +#define fileno _fileno +#endif +/*#define fstat _fstat64*/ +#if !defined(__BORLANDC__) +#define getcwd _getcwd +#endif +#define lstat stat +/*#define lstat _stat64*/ +/*#define stat _stat64*/ +#define rmdir _rmdir +#if !defined(__BORLANDC__) +#define strdup _strdup +#define umask _umask +#endif +#define int64_t __int64 +#endif + +#if defined(HAVE__CrtSetReportMode) +# include +#endif + +#if defined(_WIN32) && !defined(__CYGWIN__) +void *GetFunctionKernel32(const char *name) +{ + static HINSTANCE lib; + static int set; + if (!set) { + set = 1; + lib = LoadLibrary("kernel32.dll"); + } + if (lib == NULL) { + fprintf(stderr, "Can't load kernel32.dll?!\n"); + exit(1); + } + return (void *)GetProcAddress(lib, name); +} + +static int +my_CreateSymbolicLinkA(const char *linkname, const char *target, int flags) +{ + static BOOLEAN (WINAPI *f)(LPCSTR, LPCSTR, DWORD); + static int set; + if (!set) { + set = 1; + f = GetFunctionKernel32("CreateSymbolicLinkA"); + } + return f == NULL ? 0 : (*f)(linkname, target, flags); +} + +static int +my_CreateHardLinkA(const char *linkname, const char *target) +{ + static BOOLEAN (WINAPI *f)(LPCSTR, LPCSTR, LPSECURITY_ATTRIBUTES); + static int set; + if (!set) { + set = 1; + f = GetFunctionKernel32("CreateHardLinkA"); + } + return f == NULL ? 0 : (*f)(linkname, target, NULL); +} + +int +my_GetFileInformationByName(const char *path, BY_HANDLE_FILE_INFORMATION *bhfi) +{ + HANDLE h; + int r; + + memset(bhfi, 0, sizeof(*bhfi)); + h = CreateFile(path, FILE_READ_ATTRIBUTES, 0, NULL, + OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if (h == INVALID_HANDLE_VALUE) + return (0); + r = GetFileInformationByHandle(h, bhfi); + CloseHandle(h); + return (r); +} +#endif -/* Interix doesn't define these in a standard header. */ -#if __INTERIX__ -extern char *optarg; -extern int optind; +#if defined(HAVE__CrtSetReportMode) +static void +invalid_parameter_handler(const wchar_t * expression, + const wchar_t * function, const wchar_t * file, + unsigned int line, uintptr_t pReserved) +{ + /* nop */ +} #endif +/* + * + * OPTIONS FLAGS + * + */ + /* Enable core dump on failure. */ static int dump_on_failure = 0; -/* Default is to remove temp dirs for successful tests. */ +/* Default is to remove temp dirs and log data for successful tests. */ static int keep_temp_files = 0; -/* Default is to print some basic information about each test. */ -static int quiet_flag = 0; -/* Default is to summarize repeated failures. */ -static int verbose = 0; -/* Cumulative count of component failures. */ +/* Default is to just report pass/fail for each test. */ +static int verbosity = 0; +#define VERBOSITY_SUMMARY_ONLY -1 /* -q */ +#define VERBOSITY_PASSFAIL 0 /* Default */ +#define VERBOSITY_LIGHT_REPORT 1 /* -v */ +#define VERBOSITY_FULL 2 /* -vv */ +/* A few places generate even more output for verbosity > VERBOSITY_FULL, + * mostly for debugging the test harness itself. */ +/* Cumulative count of assertion failures. */ static int failures = 0; -/* Cumulative count of skipped component tests. */ +/* Cumulative count of reported skips. */ static int skips = 0; -/* Cumulative count of assertions. */ +/* Cumulative count of assertions checked. */ static int assertions = 0; /* Directory where uuencoded reference files can be found. */ static const char *refdir; /* - * My own implementation of the standard assert() macro emits the - * message in the same format as GCC (file:line: message). - * It also includes some additional useful information. - * This makes it a lot easier to skim through test failures in - * Emacs. ;-) - * - * It also supports a few special features specifically to simplify - * test harnesses: - * failure(fmt, args) -- Stores a text string that gets - * printed if the following assertion fails, good for - * explaining subtle tests. - */ -static char msg[4096]; - -/* - * For each test source file, we remember how many times each - * failure was reported. - */ -static const char *failed_filename = NULL; -static struct line { - int line; - int count; -} failed_lines[1000]; - -/* - * Count this failure; return the number of previous failures. + * Report log information selectively to console and/or disk log. */ -static int -previous_failures(const char *filename, int line) +static int log_console = 0; +static FILE *logfile; +static void +vlogprintf(const char *fmt, va_list ap) { - unsigned int i; - int count; +#ifdef va_copy + va_list lfap; + va_copy(lfap, ap); +#endif + if (log_console) + vfprintf(stdout, fmt, ap); + if (logfile != NULL) +#ifdef va_copy + vfprintf(logfile, fmt, lfap); + va_end(lfap); +#else + vfprintf(logfile, fmt, ap); +#endif +} - if (failed_filename == NULL || strcmp(failed_filename, filename) != 0) - memset(failed_lines, 0, sizeof(failed_lines)); - failed_filename = filename; +static void +logprintf(const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + vlogprintf(fmt, ap); + va_end(ap); +} - for (i = 0; i < sizeof(failed_lines)/sizeof(failed_lines[0]); i++) { - if (failed_lines[i].line == line) { - count = failed_lines[i].count; - failed_lines[i].count++; - return (count); - } - if (failed_lines[i].line == 0) { - failed_lines[i].line = line; - failed_lines[i].count = 1; - return (0); - } - } - return (0); +/* Set up a message to display only if next assertion fails. */ +static char msgbuff[4096]; +static const char *msg, *nextmsg; +void +failure(const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + vsprintf(msgbuff, fmt, ap); + va_end(ap); + nextmsg = msgbuff; } /* * Copy arguments into file-local variables. + * This was added to permit vararg assert() functions without needing + * variadic wrapper macros. Turns out that the vararg capability is almost + * never used, so almost all of the vararg assertions can be simplified + * by removing the vararg capability and reworking the wrapper macro to + * pass __FILE__, __LINE__ directly into the function instead of using + * this hook. I suspect this machinery is used so rarely that we + * would be better off just removing it entirely. That would simplify + * the code here noticably. */ static const char *test_filename; static int test_line; static void *test_extra; -void test_setup(const char *filename, int line) +void assertion_setup(const char *filename, int line) { test_filename = filename; test_line = line; } +/* Called at the beginning of each assert() function. */ +static void +assertion_count(const char *file, int line) +{ + (void)file; /* UNUSED */ + (void)line; /* UNUSED */ + ++assertions; + /* Proper handling of "failure()" message. */ + msg = nextmsg; + nextmsg = NULL; + /* Uncomment to print file:line after every assertion. + * Verbose, but occasionally useful in tracking down crashes. */ + /* printf("Checked %s:%d\n", file, line); */ +} + /* - * Inform user that we're skipping a test. + * For each test source file, we remember how many times each + * assertion was reported. Cleared before each new test, + * used by test_summarize(). */ -void -test_skipping(const char *fmt, ...) +static struct line { + int count; + int skip; +} failed_lines[10000]; + +/* Count this failure, setup up log destination and handle initial report. */ +static void +failure_start(const char *filename, int line, const char *fmt, ...) { va_list ap; - if (previous_failures(test_filename, test_line)) - return; + /* Record another failure for this line. */ + ++failures; + /* test_filename = filename; */ + failed_lines[line].count++; + + /* Determine whether to log header to console. */ + switch (verbosity) { + case VERBOSITY_FULL: + log_console = 1; + break; + case VERBOSITY_LIGHT_REPORT: + log_console = (failed_lines[line].count < 2); + break; + default: + log_console = 0; + } + /* Log file:line header for this failure */ va_start(ap, fmt); - fprintf(stderr, " *** SKIPPING: "); - vfprintf(stderr, fmt, ap); - fprintf(stderr, "\n"); +#if _MSC_VER + logprintf("%s(%d): ", filename, line); +#else + logprintf("%s:%d: ", filename, line); +#endif + vlogprintf(fmt, ap); va_end(ap); - ++skips; + logprintf("\n"); + + if (msg != NULL && msg[0] != '\0') { + logprintf(" Description: %s\n", msg); + msg = NULL; + } + + /* Determine whether to log details to console. */ + if (verbosity == VERBOSITY_LIGHT_REPORT) + log_console = 0; } -/* Common handling of failed tests. */ +/* Complete reporting of failed tests. */ +/* + * The 'extra' hook here is used by libarchive to include libarchive + * error messages with assertion failures. It could also be used + * to add strerror() output, for example. Just define the EXTRA_DUMP() + * macro appropriately. + */ static void -report_failure(void *extra) +failure_finish(void *extra) { - if (msg[0] != '\0') { - fprintf(stderr, " Description: %s\n", msg); - msg[0] = '\0'; - } - + (void)extra; /* UNUSED (maybe) */ #ifdef EXTRA_DUMP if (extra != NULL) - fprintf(stderr, " detail: %s\n", EXTRA_DUMP(extra)); -#else - (void)extra; /* UNUSED */ + logprintf(" detail: %s\n", EXTRA_DUMP(extra)); #endif if (dump_on_failure) { @@ -190,203 +356,170 @@ report_failure(void *extra) } } -/* - * Summarize repeated failures in the just-completed test file. - * The reports above suppress multiple failures from the same source - * line; this reports on any tests that did fail multiple times. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Jul 17 21:41:13 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 2A2391065674; Sun, 17 Jul 2011 21:41:13 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 65-241-43-4.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 688FC14DDE0; Sun, 17 Jul 2011 21:41:04 +0000 (UTC) Message-ID: <4E2356EF.9000301@FreeBSD.org> Date: Sun, 17 Jul 2011 14:41:03 -0700 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:5.0) Gecko/20110706 Thunderbird/5.0 MIME-Version: 1.0 To: Dimitry Andric References: <201107171951.p6HJpfim087629@svn.freebsd.org> In-Reply-To: <201107171951.p6HJpfim087629@svn.freebsd.org> X-Enigmail-Version: 1.2pre OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r224145 - in head: contrib/llvm/include/llvm contrib/llvm/include/llvm-c contrib/llvm/include/llvm-c/Transforms contrib/llvm/include/llvm/ADT contrib/llvm/include/llvm/Analysis contrib/... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2011 21:41:13 -0000 On 07/17/2011 12:51, Dimitry Andric wrote: > Author: dim > Date: Sun Jul 17 19:51:40 2011 > New Revision: 224145 > URL: http://svn.freebsd.org/changeset/base/224145 > > Log: > Upgrade our copy of llvm/clang to r135360, from upstream's trunk. I'm getting this with -DNO_CLEAN. I'll try again with a clean /usr/obj but I wanted to report it JIC. ===> lib/clang/libclangbasic (depend) tblgen -I /home/svn/head/lib/clang/libclangbasic/../../../contrib/llvm/tools/clang/include/clang/Basic -I /home/svn/head/lib/clang/libclangbasic/../../../contrib/llvm/include -I /home/svn/head/lib/clang/libclangbasic/../../../contrib/llvm/lib/Target -gen-arm-neon-sema -o arm_neon.inc.h /home/svn/head/lib/clang/libclangbasic/../../../contrib/llvm/tools/clang/include/clang/Basic/arm_neon.td rm -f .depend CC='clang' mkdep -f .depend -a -I/home/svn/head/lib/clang/libclangbasic/../../../contrib/llvm/include -I/home/svn/head/lib/clang/libclangbasic/../../../contrib/llvm/tools/clang/include -I/home/svn/head/lib/clang/libclangbasic/../../../contrib/llvm/tools/clang/lib/Basic -I. -I/home/svn/head/lib/clang/libclangbasic/../../../contrib/llvm/../../lib/clang/include -DLLVM_ON_UNIX -DLLVM_ON_FREEBSD -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DLLVM_HOSTTRIPLE=\"x86_64-unknown-freebsd9.0\" -DCLANG_PREFIX=\"/usr/obj/home/svn/head/tmp\" -I/usr/obj/home/svn/head/tmp/legacy/usr/include /home/svn/head/lib/clang/libclangbasic/../../../contrib/llvm/tools/clang/lib/Basic/ConvertUTF.c CC='clang' mkdep -f .depend -a -I/home/svn/head/lib/clang/libclangbasic/../../../contrib/llvm/include -I/home/svn/head/lib/clang/libclangbasic/../../../contrib/llvm/tools/clang/include -I/home/svn/head/lib/clang/libclangbasic/../../../contrib/llvm/tools/clang/lib/Basic -I. -I/home/svn/head/lib/clang/libclangbasic/../../../contrib/llvm/../../lib/clang/include -DLLVM_ON_UNIX -DLLVM_ON_FREEBSD -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DLLVM_HOSTTRIPLE=\"x86_64-unknown-freebsd9.0\" -DCLANG_PREFIX=\"/usr/obj/home/svn/head/tmp\" -I/usr/obj/home/svn/head/tmp/legacy/usr/include /home/svn/head/lib/clang/libclangbasic/../../../contrib/llvm/tools/clang/lib/Basic/Builtins.cpp /home/svn/head/lib/clang/libclangbasic/../../../contrib/llvm/tools/clang/lib/Basic/Diagnostic.cpp /home/svn/head/lib/clang/libclangbasic/../../../contrib/llvm/tools/clang/lib/Basic/DiagnosticIDs.cpp /home/svn/head/lib/clang/libclangbasic/../../../contrib/llvm/tools/clang/lib/Basic/FileManager.cpp /home/svn/head/lib/clang/libclangbasic/../../../contrib/llvm/tools/clang/lib/Basic/FileSystemStatCache.cpp /home/svn/head/lib/clang/libclangbasic/../../../contrib/llvm/tools/clang/lib/Basic/IdentifierTable.cpp /home/svn/head/lib/clang/libclangbasic/../../../contrib/llvm/tools/clang/lib/Basic/SourceLocation.cpp /home/svn/head/lib/clang/libclangbasic/../../../contrib/llvm/tools/clang/lib/Basic/SourceManager.cpp /home/svn/head/lib/clang/libclangbasic/../../../contrib/llvm/tools/clang/lib/Basic/TargetInfo.cpp /home/svn/head/lib/clang/libclangbasic/../../../contrib/llvm/tools/clang/lib/Basic/Targets.cpp /home/svn/head/lib/clang/libclangbasic/../../../contrib/llvm/tools/clang/lib/Basic/TokenKinds.cpp /home/svn/head/lib/clang/libclangbasic/../../../contrib/llvm/tools/clang/lib/Basic/VersionTuple.cpp /home/svn/head/lib/clang/libclangbasic/../../../contrib/llvm/tools/clang/lib/Basic/Version.cpp In file included from /home/svn/head/lib/clang/libclangbasic/../../../contrib/llvm/tools/clang/lib/Basic/DiagnosticIDs.cpp:17: In file included from /home/svn/head/lib/clang/libclangbasic/../../../contrib/llvm/tools/clang/include/clang/Basic/DiagnosticCategories.h:18: In file included from /home/svn/head/lib/clang/libclangbasic/../../../contrib/llvm/../../lib/clang/include/clang/Basic/DiagnosticGroups.inc:2: ./DiagnosticGroups.inc.h:359:12: error: too few arguments provided to function-like macro invocation CATEGORY("") ^ ./DiagnosticGroups.inc.h:360:23: error: too few arguments provided to function-like macro invocation CATEGORY("Parse Issue") ^ ./DiagnosticGroups.inc.h:361:41: error: too few arguments provided to function-like macro invocation CATEGORY("Lexical or Preprocessor Issue") ^ ./DiagnosticGroups.inc.h:362:26: error: too few arguments provided to function-like macro invocation CATEGORY("Semantic Issue") ^ ./DiagnosticGroups.inc.h:363:33: error: too few arguments provided to function-like macro invocation CATEGORY("Inline Assembly Issue") ^ ./DiagnosticGroups.inc.h:364:37: error: too few arguments provided to function-like macro invocation CATEGORY("Related Result Type Issue") ^ ./DiagnosticGroups.inc.h:365:30: error: too few arguments provided to function-like macro invocation CATEGORY("#warning Directive") ^ ./DiagnosticGroups.inc.h:366:24: error: too few arguments provided to function-like macro invocation CATEGORY("Deprecations") ^ ./DiagnosticGroups.inc.h:367:31: error: too few arguments provided to function-like macro invocation CATEGORY("Format String Issue") ^ ./DiagnosticGroups.inc.h:368:34: error: too few arguments provided to function-like macro invocation CATEGORY("Value Conversion Issue") ^ ./DiagnosticGroups.inc.h:369:37: error: too few arguments provided to function-like macro invocation CATEGORY("#pragma message Directive") ^ ./DiagnosticGroups.inc.h:370:31: error: too few arguments provided to function-like macro invocation CATEGORY("Unused Entity Issue") ^ In file included from /home/svn/head/lib/clang/libclangbasic/../../../contrib/llvm/tools/clang/lib/Basic/DiagnosticIDs.cpp:218: In file included from /home/svn/head/lib/clang/libclangbasic/../../../contrib/llvm/../../lib/clang/include/clang/Basic/DiagnosticGroups.inc:2: ./DiagnosticGroups.inc.h:359:12: error: too few arguments provided to function-like macro invocation CATEGORY("") ^ ./DiagnosticGroups.inc.h:360:23: error: too few arguments provided to function-like macro invocation CATEGORY("Parse Issue") ^ ./DiagnosticGroups.inc.h:361:41: error: too few arguments provided to function-like macro invocation CATEGORY("Lexical or Preprocessor Issue") ^ ./DiagnosticGroups.inc.h:362:26: error: too few arguments provided to function-like macro invocation CATEGORY("Semantic Issue") ^ ./DiagnosticGroups.inc.h:363:33: error: too few arguments provided to function-like macro invocation CATEGORY("Inline Assembly Issue") ^ ./DiagnosticGroups.inc.h:364:37: error: too few arguments provided to function-like macro invocation CATEGORY("Related Result Type Issue") ^ ./DiagnosticGroups.inc.h:365:30: error: too few arguments provided to function-like macro invocation CATEGORY("#warning Directive") ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated. mkdep: compile failed *** Error code 1 Stop in /home/svn/head/lib/clang/libclangbasic. *** Error code 1 Stop in /home/svn/head/lib/clang. *** Error code 1 Stop in /home/svn/head. *** Error code 1 Stop in /home/svn/head. *** Error code 1 -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Sun Jul 17 21:42:22 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B09961065670; Sun, 17 Jul 2011 21:42:22 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9DB898FC0A; Sun, 17 Jul 2011 21:42:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6HLgMs0091567; Sun, 17 Jul 2011 21:42:22 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6HLgMX6091558; Sun, 17 Jul 2011 21:42:22 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201107172142.p6HLgMX6091558@svn.freebsd.org> From: Martin Matuska Date: Sun, 17 Jul 2011 21:42:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224154 - in head/usr.bin/cpio: . test X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2011 21:42:22 -0000 Author: mm Date: Sun Jul 17 21:42:22 2011 New Revision: 224154 URL: http://svn.freebsd.org/changeset/base/224154 Log: Update bsdcpio to 2.8.4 Use common code from lib/libarchive/libarchive_fe Approved by: kientzle MFC after: 2 weeks Added: head/usr.bin/cpio/test/test_cmdline.c (contents, props changed) head/usr.bin/cpio/test/test_gcpio_compat_ref_nosym.bin.uu (contents, props changed) head/usr.bin/cpio/test/test_gcpio_compat_ref_nosym.crc.uu (contents, props changed) head/usr.bin/cpio/test/test_gcpio_compat_ref_nosym.newc.uu (contents, props changed) head/usr.bin/cpio/test/test_gcpio_compat_ref_nosym.ustar.uu (contents, props changed) head/usr.bin/cpio/test/test_option_B_upper.c (contents, props changed) head/usr.bin/cpio/test/test_option_C_upper.c (contents, props changed) head/usr.bin/cpio/test/test_option_J_upper.c (contents, props changed) head/usr.bin/cpio/test/test_option_L_upper.c (contents, props changed) head/usr.bin/cpio/test/test_option_Z_upper.c (contents, props changed) head/usr.bin/cpio/test/test_option_l.c (contents, props changed) head/usr.bin/cpio/test/test_option_lzma.c (contents, props changed) Deleted: head/usr.bin/cpio/err.c head/usr.bin/cpio/err.h head/usr.bin/cpio/line_reader.c head/usr.bin/cpio/line_reader.h head/usr.bin/cpio/matching.c head/usr.bin/cpio/matching.h head/usr.bin/cpio/pathmatch.c head/usr.bin/cpio/pathmatch.h head/usr.bin/cpio/test/test_option_B.c head/usr.bin/cpio/test/test_option_L.c head/usr.bin/cpio/test/test_option_ell.c Modified: head/usr.bin/cpio/Makefile head/usr.bin/cpio/cmdline.c head/usr.bin/cpio/config_freebsd.h head/usr.bin/cpio/cpio.c head/usr.bin/cpio/cpio.h head/usr.bin/cpio/test/Makefile head/usr.bin/cpio/test/main.c head/usr.bin/cpio/test/test.h head/usr.bin/cpio/test/test_0.c head/usr.bin/cpio/test/test_basic.c head/usr.bin/cpio/test/test_format_newc.c head/usr.bin/cpio/test/test_gcpio_compat.c head/usr.bin/cpio/test/test_option_a.c head/usr.bin/cpio/test/test_option_c.c head/usr.bin/cpio/test/test_option_d.c head/usr.bin/cpio/test/test_option_f.c head/usr.bin/cpio/test/test_option_help.c head/usr.bin/cpio/test/test_option_m.c head/usr.bin/cpio/test/test_option_t.c head/usr.bin/cpio/test/test_option_u.c head/usr.bin/cpio/test/test_option_version.c head/usr.bin/cpio/test/test_option_y.c head/usr.bin/cpio/test/test_option_z.c head/usr.bin/cpio/test/test_owner_parse.c head/usr.bin/cpio/test/test_passthrough_dotdot.c head/usr.bin/cpio/test/test_passthrough_reverse.c head/usr.bin/cpio/test/test_pathmatch.c Modified: head/usr.bin/cpio/Makefile ============================================================================== --- head/usr.bin/cpio/Makefile Sun Jul 17 21:33:15 2011 (r224153) +++ head/usr.bin/cpio/Makefile Sun Jul 17 21:42:22 2011 (r224154) @@ -3,17 +3,24 @@ .include PROG= bsdcpio -BSDCPIO_VERSION_STRING=2.8.3 -SRCS= cpio.c cmdline.c err.c line_reader.c matching.c pathmatch.c +BSDCPIO_VERSION_STRING=2.8.4 + +SRCS= cpio.c cmdline.c + +.PATH: ${.CURDIR}/../../lib/libarchive/libarchive_fe +SRCS+= err.c line_reader.c matching.c pathmatch.c + CFLAGS+= -DBSDCPIO_VERSION_STRING=\"${BSDCPIO_VERSION_STRING}\" CFLAGS+= -DPLATFORM_CONFIG_H=\"config_freebsd.h\" +CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../../lib/libarchive/libarchive_fe + .ifdef RELEASE_CRUNCH # FreeBSD's installer uses cpio in crunched binaries that are # statically linked, cannot use -lcrypto, and are size sensitive. CFLAGS+= -DSMALLER .endif -DPADD= ${LIBARCHIVE} ${LIBZ} ${LIBBZ2} ${LIBMD} ${LIBLZMA} -LDADD= -larchive -lz -lbz2 -lmd -llzma +DPADD= ${LIBARCHIVE} ${LIBZ} ${LIBBZ2} ${LIBMD} ${LIBLZMA} ${LIBBSDXML} +LDADD= -larchive -lz -lbz2 -lmd -llzma -lbsdxml .if ${MK_OPENSSL} != "no" DPADD+= ${LIBCRYPTO} LDADD+= -lcrypto Modified: head/usr.bin/cpio/cmdline.c ============================================================================== --- head/usr.bin/cpio/cmdline.c Sun Jul 17 21:33:15 2011 (r224153) +++ head/usr.bin/cpio/cmdline.c Sun Jul 17 21:42:22 2011 (r224154) @@ -175,7 +175,7 @@ cpio_getopt(struct cpio *cpio) /* Otherwise, pick up the next word. */ opt_word = *cpio->argv; if (opt_word == NULL) { - warnc(0, + lafe_warnc(0, "Option -%c requires an argument", opt); return ('?'); @@ -226,13 +226,13 @@ cpio_getopt(struct cpio *cpio) /* Fail if there wasn't a unique match. */ if (match == NULL) { - warnc(0, + lafe_warnc(0, "Option %s%s is not supported", long_prefix, opt_word); return ('?'); } if (match2 != NULL) { - warnc(0, + lafe_warnc(0, "Ambiguous option %s%s (matches --%s and --%s)", long_prefix, opt_word, match->name, match2->name); return ('?'); @@ -244,7 +244,7 @@ cpio_getopt(struct cpio *cpio) if (cpio->optarg == NULL) { cpio->optarg = *cpio->argv; if (cpio->optarg == NULL) { - warnc(0, + lafe_warnc(0, "Option %s%s requires an argument", long_prefix, match->name); return ('?'); @@ -255,7 +255,7 @@ cpio_getopt(struct cpio *cpio) } else { /* Argument forbidden: fail if there is one. */ if (cpio->optarg != NULL) { - warnc(0, + lafe_warnc(0, "Option %s%s does not allow an argument", long_prefix, match->name); return ('?'); Modified: head/usr.bin/cpio/config_freebsd.h ============================================================================== --- head/usr.bin/cpio/config_freebsd.h Sun Jul 17 21:33:15 2011 (r224153) +++ head/usr.bin/cpio/config_freebsd.h Sun Jul 17 21:42:22 2011 (r224154) @@ -53,4 +53,5 @@ #define HAVE_UNSIGNED_LONG_LONG 1 #define HAVE_UTIME_H 1 #define HAVE_UTIMES 1 +#define HAVE_WCSCMP 1 Modified: head/usr.bin/cpio/cpio.c ============================================================================== --- head/usr.bin/cpio/cpio.c Sun Jul 17 21:33:15 2011 (r224153) +++ head/usr.bin/cpio/cpio.c Sun Jul 17 21:42:22 2011 (r224154) @@ -136,19 +136,19 @@ main(int argc, char *argv[]) cpio->buff = buff; cpio->buff_size = sizeof(buff); - /* Need progname before calling warnc. */ + /* Need lafe_progname before calling lafe_warnc. */ if (*argv == NULL) - progname = "bsdcpio"; + lafe_progname = "bsdcpio"; else { #if defined(_WIN32) && !defined(__CYGWIN__) - progname = strrchr(*argv, '\\'); + lafe_progname = strrchr(*argv, '\\'); #else - progname = strrchr(*argv, '/'); + lafe_progname = strrchr(*argv, '/'); #endif - if (progname != NULL) - progname++; + if (lafe_progname != NULL) + lafe_progname++; else - progname = *argv; + lafe_progname = *argv; } cpio->uid_override = -1; @@ -189,7 +189,7 @@ main(int argc, char *argv[]) case 'C': /* NetBSD/OpenBSD */ cpio->bytes_per_block = atoi(cpio->optarg); if (cpio->bytes_per_block <= 0) - errc(1, 0, "Invalid blocksize %s", cpio->optarg); + lafe_errc(1, 0, "Invalid blocksize %s", cpio->optarg); break; case 'c': /* POSIX 1997 */ cpio->format = "odc"; @@ -198,14 +198,14 @@ main(int argc, char *argv[]) cpio->extract_flags &= ~ARCHIVE_EXTRACT_NO_AUTODIR; break; case 'E': /* NetBSD/OpenBSD */ - include_from_file(&cpio->matching, + lafe_include_from_file(&cpio->matching, cpio->optarg, cpio->option_null); break; case 'F': /* NetBSD/OpenBSD/GNU cpio */ cpio->filename = cpio->optarg; break; case 'f': /* POSIX 1997 */ - exclude(&cpio->matching, cpio->optarg); + lafe_exclude(&cpio->matching, cpio->optarg); break; case 'H': /* GNU cpio (also --format) */ cpio->format = cpio->optarg; @@ -218,7 +218,7 @@ main(int argc, char *argv[]) break; case 'i': /* POSIX 1997 */ if (cpio->mode != '\0') - errc(1, 0, + lafe_errc(1, 0, "Cannot use both -i and -%c", cpio->mode); cpio->mode = opt; break; @@ -255,13 +255,13 @@ main(int argc, char *argv[]) break; case 'o': /* POSIX 1997 */ if (cpio->mode != '\0') - errc(1, 0, + lafe_errc(1, 0, "Cannot use both -o and -%c", cpio->mode); cpio->mode = opt; break; case 'p': /* POSIX 1997 */ if (cpio->mode != '\0') - errc(1, 0, + lafe_errc(1, 0, "Cannot use both -p and -%c", cpio->mode); cpio->mode = opt; cpio->extract_flags &= ~ARCHIVE_EXTRACT_SECURE_NODOTDOT; @@ -277,7 +277,7 @@ main(int argc, char *argv[]) * also; use that to set [ug]name_override. */ errmsg = owner_parse(cpio->optarg, &uid, &gid); if (errmsg) { - warnc(-1, "%s", errmsg); + lafe_warnc(-1, "%s", errmsg); usage(); } if (uid != -1) { @@ -335,16 +335,16 @@ main(int argc, char *argv[]) cpio->mode = 'i'; /* -t requires -i */ if (cpio->option_list && cpio->mode != 'i') - errc(1, 0, "Option -t requires -i"); + lafe_errc(1, 0, "Option -t requires -i"); /* -n requires -it */ if (cpio->option_numeric_uid_gid && !cpio->option_list) - errc(1, 0, "Option -n requires -it"); + lafe_errc(1, 0, "Option -n requires -it"); /* Can only specify format when writing */ if (cpio->format != NULL && cpio->mode != 'o') - errc(1, 0, "Option --format requires -o"); + lafe_errc(1, 0, "Option --format requires -o"); /* -l requires -p */ if (cpio->option_link && cpio->mode != 'p') - errc(1, 0, "Option -l requires -p"); + lafe_errc(1, 0, "Option -l requires -p"); /* TODO: Flag other nonsensical combinations. */ switch (cpio->mode) { @@ -358,7 +358,7 @@ main(int argc, char *argv[]) break; case 'i': while (*cpio->argv != NULL) { - include(&cpio->matching, *cpio->argv); + lafe_include(&cpio->matching, *cpio->argv); --cpio->argc; ++cpio->argv; } @@ -369,12 +369,12 @@ main(int argc, char *argv[]) break; case 'p': if (*cpio->argv == NULL || **cpio->argv == '\0') - errc(1, 0, + lafe_errc(1, 0, "-p mode requires a target directory"); mode_pass(cpio, *cpio->argv); break; default: - errc(1, 0, + lafe_errc(1, 0, "Must specify at least one of -i, -o, or -p"); } @@ -388,7 +388,7 @@ usage(void) { const char *p; - p = progname; + p = lafe_progname; fprintf(stderr, "Brief Usage:\n"); fprintf(stderr, " List: %s -it < archive\n", p); @@ -426,7 +426,7 @@ long_help(void) const char *prog; const char *p; - prog = progname; + prog = lafe_progname; fflush(stderr); @@ -459,16 +459,16 @@ static void mode_out(struct cpio *cpio) { struct archive_entry *entry, *spare; - struct line_reader *lr; + struct lafe_line_reader *lr; const char *p; int r; if (cpio->option_append) - errc(1, 0, "Append mode not yet supported."); + lafe_errc(1, 0, "Append mode not yet supported."); cpio->archive_read_disk = archive_read_disk_new(); if (cpio->archive_read_disk == NULL) - errc(1, 0, "Failed to allocate archive object"); + lafe_errc(1, 0, "Failed to allocate archive object"); if (cpio->option_follow_links) archive_read_disk_set_symlink_logical(cpio->archive_read_disk); else @@ -477,7 +477,7 @@ mode_out(struct cpio *cpio) cpio->archive = archive_write_new(); if (cpio->archive == NULL) - errc(1, 0, "Failed to allocate archive object"); + lafe_errc(1, 0, "Failed to allocate archive object"); switch (cpio->compress) { case 'J': r = archive_write_set_compression_xz(cpio->archive); @@ -499,10 +499,10 @@ mode_out(struct cpio *cpio) break; } if (r < ARCHIVE_WARN) - errc(1, 0, "Requested compression not available"); + lafe_errc(1, 0, "Requested compression not available"); r = archive_write_set_format_by_name(cpio->archive, cpio->format); if (r != ARCHIVE_OK) - errc(1, 0, "%s", archive_error_string(cpio->archive)); + lafe_errc(1, 0, "%s", archive_error_string(cpio->archive)); archive_write_set_bytes_per_block(cpio->archive, cpio->bytes_per_block); cpio->linkresolver = archive_entry_linkresolver_new(); archive_entry_linkresolver_set_strategy(cpio->linkresolver, @@ -513,11 +513,11 @@ mode_out(struct cpio *cpio) */ r = archive_write_open_file(cpio->archive, cpio->filename); if (r != ARCHIVE_OK) - errc(1, 0, "%s", archive_error_string(cpio->archive)); - lr = line_reader("-", cpio->option_null); - while ((p = line_reader_next(lr)) != NULL) + lafe_errc(1, 0, "%s", archive_error_string(cpio->archive)); + lr = lafe_line_reader("-", cpio->option_null); + while ((p = lafe_line_reader_next(lr)) != NULL) file_to_archive(cpio, p); - line_reader_free(lr); + lafe_line_reader_free(lr); /* * The hardlink detection may have queued up a couple of entries @@ -534,7 +534,7 @@ mode_out(struct cpio *cpio) r = archive_write_close(cpio->archive); if (r != ARCHIVE_OK) - errc(1, 0, "%s", archive_error_string(cpio->archive)); + lafe_errc(1, 0, "%s", archive_error_string(cpio->archive)); if (!cpio->quiet) { int64_t blocks = @@ -566,15 +566,15 @@ file_to_archive(struct cpio *cpio, const */ entry = archive_entry_new(); if (entry == NULL) - errc(1, 0, "Couldn't allocate entry"); + lafe_errc(1, 0, "Couldn't allocate entry"); archive_entry_copy_sourcepath(entry, srcpath); r = archive_read_disk_entry_from_file(cpio->archive_read_disk, entry, -1, NULL); if (r < ARCHIVE_FAILED) - errc(1, 0, "%s", + lafe_errc(1, 0, "%s", archive_error_string(cpio->archive_read_disk)); if (r < ARCHIVE_OK) - warnc(0, "%s", + lafe_warnc(0, "%s", archive_error_string(cpio->archive_read_disk)); if (r <= ARCHIVE_FAILED) { cpio->return_value = 1; @@ -607,7 +607,7 @@ file_to_archive(struct cpio *cpio, const free(cpio->pass_destpath); cpio->pass_destpath = malloc(cpio->pass_destpath_alloc); if (cpio->pass_destpath == NULL) - errc(1, ENOMEM, + lafe_errc(1, ENOMEM, "Can't allocate path buffer"); } strcpy(cpio->pass_destpath, cpio->destdir); @@ -673,7 +673,7 @@ entry_to_archive(struct cpio *cpio, stru /* Save the original entry in case we need it later. */ t = archive_entry_clone(entry); if (t == NULL) - errc(1, ENOMEM, "Can't create link"); + lafe_errc(1, ENOMEM, "Can't create link"); /* Note: link(2) doesn't create parent directories, * so we use archive_write_header() instead as a * convenience. */ @@ -683,7 +683,7 @@ entry_to_archive(struct cpio *cpio, stru r = archive_write_header(cpio->archive, t); archive_entry_free(t); if (r != ARCHIVE_OK) - warnc(archive_errno(cpio->archive), + lafe_warnc(archive_errno(cpio->archive), "%s", archive_error_string(cpio->archive)); if (r == ARCHIVE_FATAL) exit(1); @@ -691,7 +691,7 @@ entry_to_archive(struct cpio *cpio, stru if (r != ARCHIVE_OK && archive_errno(cpio->archive) == EXDEV) { /* Cross-device link: Just fall through and use * the original entry to copy the file over. */ - warnc(0, "Copying file instead"); + lafe_warnc(0, "Copying file instead"); } else #endif return (0); @@ -705,7 +705,7 @@ entry_to_archive(struct cpio *cpio, stru if (archive_entry_size(entry) > 0) { fd = open(srcpath, O_RDONLY | O_BINARY); if (fd < 0) { - warnc(errno, + lafe_warnc(errno, "%s: could not open file", srcpath); goto cleanup; } @@ -717,7 +717,7 @@ entry_to_archive(struct cpio *cpio, stru r = archive_write_header(cpio->archive, entry); if (r != ARCHIVE_OK) - warnc(archive_errno(cpio->archive), + lafe_warnc(archive_errno(cpio->archive), "%s: %s", srcpath, archive_error_string(cpio->archive)); @@ -731,10 +731,10 @@ entry_to_archive(struct cpio *cpio, stru r = archive_write_data(cpio->archive, cpio->buff, bytes_read); if (r < 0) - errc(1, archive_errno(cpio->archive), + lafe_errc(1, archive_errno(cpio->archive), "%s", archive_error_string(cpio->archive)); if (r < bytes_read) { - warnc(0, + lafe_warnc(0, "Truncated write; file may have grown while being archived."); } bytes_read = read(fd, cpio->buff, cpio->buff_size); @@ -763,7 +763,7 @@ restore_time(struct cpio *cpio, struct a (void)name; /* UNUSED */ if (!warned) - warnc(0, "Can't restore access times on this platform"); + lafe_warnc(0, "Can't restore access times on this platform"); warned = 1; return (fd); #else @@ -801,7 +801,7 @@ restore_time(struct cpio *cpio, struct a if ((AE_IFLNK != archive_entry_filetype(entry)) && utimes(name, times) != 0) #endif - warnc(errno, "Can't update time for %s", name); + lafe_warnc(errno, "Can't update time for %s", name); #endif return (fd); } @@ -818,28 +818,28 @@ mode_in(struct cpio *cpio) ext = archive_write_disk_new(); if (ext == NULL) - errc(1, 0, "Couldn't allocate restore object"); + lafe_errc(1, 0, "Couldn't allocate restore object"); r = archive_write_disk_set_options(ext, cpio->extract_flags); if (r != ARCHIVE_OK) - errc(1, 0, "%s", archive_error_string(ext)); + lafe_errc(1, 0, "%s", archive_error_string(ext)); a = archive_read_new(); if (a == NULL) - errc(1, 0, "Couldn't allocate archive object"); + lafe_errc(1, 0, "Couldn't allocate archive object"); archive_read_support_compression_all(a); archive_read_support_format_all(a); if (archive_read_open_file(a, cpio->filename, cpio->bytes_per_block)) - errc(1, archive_errno(a), + lafe_errc(1, archive_errno(a), "%s", archive_error_string(a)); for (;;) { r = archive_read_next_header(a, &entry); if (r == ARCHIVE_EOF) break; if (r != ARCHIVE_OK) { - errc(1, archive_errno(a), + lafe_errc(1, archive_errno(a), "%s", archive_error_string(a)); } - if (excluded(cpio->matching, archive_entry_pathname(entry))) + if (lafe_excluded(cpio->matching, archive_entry_pathname(entry))) continue; if (cpio->option_rename) { destpath = cpio_rename(archive_entry_pathname(entry)); @@ -867,10 +867,10 @@ mode_in(struct cpio *cpio) } r = archive_read_close(a); if (r != ARCHIVE_OK) - errc(1, 0, "%s", archive_error_string(a)); + lafe_errc(1, 0, "%s", archive_error_string(a)); r = archive_write_close(ext); if (r != ARCHIVE_OK) - errc(1, 0, "%s", archive_error_string(ext)); + lafe_errc(1, 0, "%s", archive_error_string(ext)); if (!cpio->quiet) { int64_t blocks = (archive_position_uncompressed(a) + 511) / 512; @@ -899,13 +899,13 @@ extract_data(struct archive *ar, struct if (r == ARCHIVE_EOF) return (ARCHIVE_OK); if (r != ARCHIVE_OK) { - warnc(archive_errno(ar), + lafe_warnc(archive_errno(ar), "%s", archive_error_string(ar)); exit(1); } r = archive_write_data_block(aw, block, size, offset); if (r != ARCHIVE_OK) { - warnc(archive_errno(aw), + lafe_warnc(archive_errno(aw), "%s", archive_error_string(aw)); return (r); } @@ -921,22 +921,22 @@ mode_list(struct cpio *cpio) a = archive_read_new(); if (a == NULL) - errc(1, 0, "Couldn't allocate archive object"); + lafe_errc(1, 0, "Couldn't allocate archive object"); archive_read_support_compression_all(a); archive_read_support_format_all(a); if (archive_read_open_file(a, cpio->filename, cpio->bytes_per_block)) - errc(1, archive_errno(a), + lafe_errc(1, archive_errno(a), "%s", archive_error_string(a)); for (;;) { r = archive_read_next_header(a, &entry); if (r == ARCHIVE_EOF) break; if (r != ARCHIVE_OK) { - errc(1, archive_errno(a), + lafe_errc(1, archive_errno(a), "%s", archive_error_string(a)); } - if (excluded(cpio->matching, archive_entry_pathname(entry))) + if (lafe_excluded(cpio->matching, archive_entry_pathname(entry))) continue; if (cpio->verbose) list_item_verbose(cpio, entry); @@ -945,7 +945,7 @@ mode_list(struct cpio *cpio) } r = archive_read_close(a); if (r != ARCHIVE_OK) - errc(1, 0, "%s", archive_error_string(a)); + lafe_errc(1, 0, "%s", archive_error_string(a)); if (!cpio->quiet) { int64_t blocks = (archive_position_uncompressed(a) + 511) / 512; @@ -1040,7 +1040,7 @@ list_item_verbose(struct cpio *cpio, str static void mode_pass(struct cpio *cpio, const char *destdir) { - struct line_reader *lr; + struct lafe_line_reader *lr; const char *p; int r; @@ -1052,31 +1052,31 @@ mode_pass(struct cpio *cpio, const char cpio->archive = archive_write_disk_new(); if (cpio->archive == NULL) - errc(1, 0, "Failed to allocate archive object"); + lafe_errc(1, 0, "Failed to allocate archive object"); r = archive_write_disk_set_options(cpio->archive, cpio->extract_flags); if (r != ARCHIVE_OK) - errc(1, 0, "%s", archive_error_string(cpio->archive)); + lafe_errc(1, 0, "%s", archive_error_string(cpio->archive)); cpio->linkresolver = archive_entry_linkresolver_new(); archive_write_disk_set_standard_lookup(cpio->archive); cpio->archive_read_disk = archive_read_disk_new(); if (cpio->archive_read_disk == NULL) - errc(1, 0, "Failed to allocate archive object"); + lafe_errc(1, 0, "Failed to allocate archive object"); if (cpio->option_follow_links) archive_read_disk_set_symlink_logical(cpio->archive_read_disk); else archive_read_disk_set_symlink_physical(cpio->archive_read_disk); archive_read_disk_set_standard_lookup(cpio->archive_read_disk); - lr = line_reader("-", cpio->option_null); - while ((p = line_reader_next(lr)) != NULL) + lr = lafe_line_reader("-", cpio->option_null); + while ((p = lafe_line_reader_next(lr)) != NULL) file_to_archive(cpio, p); - line_reader_free(lr); + lafe_line_reader_free(lr); archive_entry_linkresolver_free(cpio->linkresolver); r = archive_write_close(cpio->archive); if (r != ARCHIVE_OK) - errc(1, 0, "%s", archive_error_string(cpio->archive)); + lafe_errc(1, 0, "%s", archive_error_string(cpio->archive)); if (!cpio->quiet) { int64_t blocks = @@ -1160,7 +1160,7 @@ lookup_name(struct cpio *cpio, struct na if (*name_cache_variable == NULL) { *name_cache_variable = malloc(sizeof(struct name_cache)); if (*name_cache_variable == NULL) - errc(1, ENOMEM, "No more memory"); + lafe_errc(1, ENOMEM, "No more memory"); memset(*name_cache_variable, 0, sizeof(struct name_cache)); (*name_cache_variable)->size = name_cache_size; } @@ -1217,7 +1217,7 @@ lookup_uname_helper(struct cpio *cpio, c if (pwent == NULL) { *name = NULL; if (errno != 0 && errno != ENOENT) - warnc(errno, "getpwuid(%d) failed", id); + lafe_warnc(errno, "getpwuid(%d) failed", id); return (errno); } @@ -1244,7 +1244,7 @@ lookup_gname_helper(struct cpio *cpio, c if (grent == NULL) { *name = NULL; if (errno != 0) - warnc(errno, "getgrgid(%d) failed", id); + lafe_warnc(errno, "getgrgid(%d) failed", id); return (errno); } Modified: head/usr.bin/cpio/cpio.h ============================================================================== --- head/usr.bin/cpio/cpio.h Sun Jul 17 21:33:15 2011 (r224153) +++ head/usr.bin/cpio/cpio.h Sun Jul 17 21:42:22 2011 (r224154) @@ -88,7 +88,7 @@ struct cpio { struct name_cache *gname_cache; /* Work data. */ - struct matching *matching; + struct lafe_matching *matching; char *buff; size_t buff_size; }; Modified: head/usr.bin/cpio/test/Makefile ============================================================================== --- head/usr.bin/cpio/test/Makefile Sun Jul 17 21:33:15 2011 (r224153) +++ head/usr.bin/cpio/test/Makefile Sun Jul 17 21:42:22 2011 (r224154) @@ -2,24 +2,30 @@ # Where to find the cpio sources (for the internal unit tests) CPIO_SRCDIR=${.CURDIR}/.. -.PATH: ${CPIO_SRCDIR} -# Some cpio sources are pulled in for white-box tests -CPIO_SRCS= cmdline.c err.c pathmatch.c +.PATH: ${CPIO_SRCDIR} +CPIO_SRCS= cmdline.c + +.PATH: ${.CURDIR}/../../../lib/libarchive/libarchive_fe +TAR_SRCS= err.c pathmatch.c TESTS= \ test_0.c \ test_basic.c \ test_format_newc.c \ test_gcpio_compat.c \ + test_option_B_upper.c \ + test_option_C_upper.c \ + test_option_J_upper.c \ + test_option_L_upper.c \ + test_option_Z_upper.c \ test_option_a.c \ - test_option_B.c \ test_option_c.c \ test_option_d.c \ test_option_f.c \ test_option_help.c \ - test_option_L.c \ - test_option_ell.c \ + test_option_l.c \ + test_option_lzma.c \ test_option_m.c \ test_option_t.c \ test_option_u.c \ @@ -34,6 +40,7 @@ TESTS= \ # Build the test program SRCS= list.h \ ${CPIO_SRCS} \ + ${TAR_SRCS} \ ${TESTS} \ main.c @@ -46,9 +53,11 @@ DPADD=${LIBARCHIVE} ${LIBBZ2} ${LIBZ} ${ CFLAGS+= -DPLATFORM_CONFIG_H=\"config_freebsd.h\" CFLAGS+= -I.. LDADD= -larchive -lz -lbz2 -llzma -CFLAGS+= -static -g -O2 -Wall +#CFLAGS+= -static -g -O2 -Wall +CFLAGS+= -g -O2 -Wall CFLAGS+= -I${.OBJDIR} CFLAGS+= -I${CPIO_SRCDIR} +CFLAGS+= -I${.CURDIR}/../../../lib/libarchive/libarchive_fe # Uncomment to link against dmalloc #LDADD+= -L/usr/local/lib -ldmalloc Modified: head/usr.bin/cpio/test/main.c ============================================================================== --- head/usr.bin/cpio/test/main.c Sun Jul 17 21:33:15 2011 (r224153) +++ head/usr.bin/cpio/test/main.c Sun Jul 17 21:42:22 2011 (r224154) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003-2007 Tim Kientzle + * Copyright (c) 2003-2009 Tim Kientzle * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -23,12 +23,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* - * Various utility routines useful for test programs. - * Each test program is linked against this file. - */ #include "test.h" - #include #include #include @@ -38,149 +33,318 @@ * This same file is used pretty much verbatim for all test harnesses. * * The next few lines are the only differences. + * TODO: Move this into a separate configuration header, have all test + * suites share one copy of this file. */ -#define PROGRAM "bsdcpio" /* Name of program being tested. */ +__FBSDID("$FreeBSD$"); +#define KNOWNREF "test_option_f.cpio.uu" #define ENVBASE "BSDCPIO" /* Prefix for environment variables. */ +#define PROGRAM "bsdcpio" /* Name of program being tested. */ +#undef LIBRARY /* Not testing a library. */ #undef EXTRA_DUMP /* How to dump extra data */ /* How to generate extra version info. */ #define EXTRA_VERSION (systemf("%s --version", testprog) ? "" : "") -#define KNOWNREF "test_option_f.cpio.uu" -__FBSDID("$FreeBSD$"); /* - * "list.h" is simply created by "grep DEFINE_TEST"; it has - * a line like - * DEFINE_TEST(test_function) - * for each test. - * Include it here with a suitable DEFINE_TEST to declare all of the - * test functions. + * + * Windows support routines + * + * Note: Configuration is a tricky issue. Using HAVE_* feature macros + * in the test harness is dangerous because they cover up + * configuration errors. The classic example of this is omitting a + * configure check. If libarchive and libarchive_test both look for + * the same feature macro, such errors are hard to detect. Platform + * macros (e.g., _WIN32 or __GNUC__) are a little better, but can + * easily lead to very messy code. It's best to limit yourself + * to only the most generic programming techniques in the test harness + * and thus avoid conditionals altogether. Where that's not possible, + * try to minimize conditionals by grouping platform-specific tests in + * one place (e.g., test_acl_freebsd) or by adding new assert() + * functions (e.g., assertMakeHardlink()) to cover up platform + * differences. Platform-specific coding in libarchive_test is often + * a symptom that some capability is missing from libarchive itself. */ -#undef DEFINE_TEST -#define DEFINE_TEST(name) void name(void); -#include "list.h" +#if defined(_WIN32) && !defined(__CYGWIN__) +#include +#include +#ifndef F_OK +#define F_OK (0) +#endif +#ifndef S_ISDIR +#define S_ISDIR(m) ((m) & _S_IFDIR) +#endif +#ifndef S_ISREG +#define S_ISREG(m) ((m) & _S_IFREG) +#endif +#if !defined(__BORLANDC__) +#define access _access +#define chdir _chdir +#endif +#ifndef fileno +#define fileno _fileno +#endif +/*#define fstat _fstat64*/ +#if !defined(__BORLANDC__) +#define getcwd _getcwd +#endif +#define lstat stat +/*#define lstat _stat64*/ +/*#define stat _stat64*/ +#define rmdir _rmdir +#if !defined(__BORLANDC__) +#define strdup _strdup +#define umask _umask +#endif +#define int64_t __int64 +#endif + +#if defined(HAVE__CrtSetReportMode) +# include +#endif + +#if defined(_WIN32) && !defined(__CYGWIN__) +void *GetFunctionKernel32(const char *name) +{ + static HINSTANCE lib; + static int set; + if (!set) { + set = 1; + lib = LoadLibrary("kernel32.dll"); + } + if (lib == NULL) { + fprintf(stderr, "Can't load kernel32.dll?!\n"); + exit(1); + } + return (void *)GetProcAddress(lib, name); +} + +static int +my_CreateSymbolicLinkA(const char *linkname, const char *target, int flags) +{ + static BOOLEAN (WINAPI *f)(LPCSTR, LPCSTR, DWORD); + static int set; + if (!set) { + set = 1; + f = GetFunctionKernel32("CreateSymbolicLinkA"); + } + return f == NULL ? 0 : (*f)(linkname, target, flags); +} + +static int +my_CreateHardLinkA(const char *linkname, const char *target) +{ + static BOOLEAN (WINAPI *f)(LPCSTR, LPCSTR, LPSECURITY_ATTRIBUTES); + static int set; + if (!set) { + set = 1; + f = GetFunctionKernel32("CreateHardLinkA"); + } + return f == NULL ? 0 : (*f)(linkname, target, NULL); +} + +int +my_GetFileInformationByName(const char *path, BY_HANDLE_FILE_INFORMATION *bhfi) +{ + HANDLE h; + int r; -/* Interix doesn't define these in a standard header. */ -#if __INTERIX__ -extern char *optarg; -extern int optind; + memset(bhfi, 0, sizeof(*bhfi)); + h = CreateFile(path, FILE_READ_ATTRIBUTES, 0, NULL, + OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if (h == INVALID_HANDLE_VALUE) + return (0); + r = GetFileInformationByHandle(h, bhfi); + CloseHandle(h); + return (r); +} #endif +#if defined(HAVE__CrtSetReportMode) +static void +invalid_parameter_handler(const wchar_t * expression, + const wchar_t * function, const wchar_t * file, + unsigned int line, uintptr_t pReserved) +{ + /* nop */ +} +#endif + +/* + * + * OPTIONS FLAGS + * + */ + /* Enable core dump on failure. */ static int dump_on_failure = 0; -/* Default is to remove temp dirs for successful tests. */ +/* Default is to remove temp dirs and log data for successful tests. */ static int keep_temp_files = 0; -/* Default is to print some basic information about each test. */ -static int quiet_flag = 0; -/* Default is to summarize repeated failures. */ -static int verbose = 0; -/* Cumulative count of component failures. */ +/* Default is to just report pass/fail for each test. */ +static int verbosity = 0; +#define VERBOSITY_SUMMARY_ONLY -1 /* -q */ +#define VERBOSITY_PASSFAIL 0 /* Default */ +#define VERBOSITY_LIGHT_REPORT 1 /* -v */ +#define VERBOSITY_FULL 2 /* -vv */ +/* A few places generate even more output for verbosity > VERBOSITY_FULL, + * mostly for debugging the test harness itself. */ +/* Cumulative count of assertion failures. */ static int failures = 0; -/* Cumulative count of skipped component tests. */ +/* Cumulative count of reported skips. */ static int skips = 0; -/* Cumulative count of assertions. */ +/* Cumulative count of assertions checked. */ static int assertions = 0; /* Directory where uuencoded reference files can be found. */ static const char *refdir; /* - * My own implementation of the standard assert() macro emits the - * message in the same format as GCC (file:line: message). - * It also includes some additional useful information. - * This makes it a lot easier to skim through test failures in - * Emacs. ;-) - * - * It also supports a few special features specifically to simplify - * test harnesses: - * failure(fmt, args) -- Stores a text string that gets - * printed if the following assertion fails, good for - * explaining subtle tests. - */ -static char msg[4096]; - -/* - * For each test source file, we remember how many times each - * failure was reported. + * Report log information selectively to console and/or disk log. */ -static const char *failed_filename = NULL; -static struct line { - int line; - int count; -} failed_lines[1000]; - -/* - * Count this failure; return the number of previous failures. - */ -static int -previous_failures(const char *filename, int line) +static int log_console = 0; +static FILE *logfile; +static void +vlogprintf(const char *fmt, va_list ap) { - unsigned int i; - int count; +#ifdef va_copy + va_list lfap; + va_copy(lfap, ap); +#endif + if (log_console) + vfprintf(stdout, fmt, ap); + if (logfile != NULL) +#ifdef va_copy + vfprintf(logfile, fmt, lfap); + va_end(lfap); +#else + vfprintf(logfile, fmt, ap); +#endif +} - if (failed_filename == NULL || strcmp(failed_filename, filename) != 0) - memset(failed_lines, 0, sizeof(failed_lines)); - failed_filename = filename; +static void +logprintf(const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + vlogprintf(fmt, ap); + va_end(ap); +} - for (i = 0; i < sizeof(failed_lines)/sizeof(failed_lines[0]); i++) { - if (failed_lines[i].line == line) { - count = failed_lines[i].count; - failed_lines[i].count++; - return (count); - } - if (failed_lines[i].line == 0) { - failed_lines[i].line = line; - failed_lines[i].count = 1; - return (0); - } - } - return (0); +/* Set up a message to display only if next assertion fails. */ +static char msgbuff[4096]; +static const char *msg, *nextmsg; +void +failure(const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + vsprintf(msgbuff, fmt, ap); + va_end(ap); + nextmsg = msgbuff; } /* * Copy arguments into file-local variables. + * This was added to permit vararg assert() functions without needing + * variadic wrapper macros. Turns out that the vararg capability is almost + * never used, so almost all of the vararg assertions can be simplified + * by removing the vararg capability and reworking the wrapper macro to + * pass __FILE__, __LINE__ directly into the function instead of using + * this hook. I suspect this machinery is used so rarely that we + * would be better off just removing it entirely. That would simplify + * the code here noticably. */ static const char *test_filename; static int test_line; static void *test_extra; -void test_setup(const char *filename, int line) +void assertion_setup(const char *filename, int line) { test_filename = filename; test_line = line; } +/* Called at the beginning of each assert() function. */ +static void +assertion_count(const char *file, int line) +{ + (void)file; /* UNUSED */ + (void)line; /* UNUSED */ + ++assertions; + /* Proper handling of "failure()" message. */ + msg = nextmsg; + nextmsg = NULL; + /* Uncomment to print file:line after every assertion. + * Verbose, but occasionally useful in tracking down crashes. */ + /* printf("Checked %s:%d\n", file, line); */ +} + /* - * Inform user that we're skipping a test. + * For each test source file, we remember how many times each + * assertion was reported. Cleared before each new test, + * used by test_summarize(). */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Jul 17 21:52:56 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09956106564A; Sun, 17 Jul 2011 21:52:56 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC8E38FC15; Sun, 17 Jul 2011 21:52:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6HLqtj3091920; Sun, 17 Jul 2011 21:52:55 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6HLqtUK091918; Sun, 17 Jul 2011 21:52:55 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201107172152.p6HLqtUK091918@svn.freebsd.org> From: Martin Matuska Date: Sun, 17 Jul 2011 21:52:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224155 - head/usr.bin/cpio/test X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2011 21:52:56 -0000 Author: mm Date: Sun Jul 17 21:52:55 2011 New Revision: 224155 URL: http://svn.freebsd.org/changeset/base/224155 Log: Append to CPIO_SRCS instead of using TAR_SRCS, the variable name is misleading MFC after: 2 weeks Modified: head/usr.bin/cpio/test/Makefile Modified: head/usr.bin/cpio/test/Makefile ============================================================================== --- head/usr.bin/cpio/test/Makefile Sun Jul 17 21:42:22 2011 (r224154) +++ head/usr.bin/cpio/test/Makefile Sun Jul 17 21:52:55 2011 (r224155) @@ -7,7 +7,7 @@ CPIO_SRCDIR=${.CURDIR}/.. CPIO_SRCS= cmdline.c .PATH: ${.CURDIR}/../../../lib/libarchive/libarchive_fe -TAR_SRCS= err.c pathmatch.c +CPIO_SRCS+= err.c pathmatch.c TESTS= \ test_0.c \ @@ -40,7 +40,6 @@ TESTS= \ # Build the test program SRCS= list.h \ ${CPIO_SRCS} \ - ${TAR_SRCS} \ ${TESTS} \ main.c From owner-svn-src-head@FreeBSD.ORG Sun Jul 17 21:53:43 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26364106566B; Sun, 17 Jul 2011 21:53:43 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0B2548FC08; Sun, 17 Jul 2011 21:53:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6HLrg4g091980; Sun, 17 Jul 2011 21:53:42 GMT (envelope-from rstone@svn.freebsd.org) Received: (from rstone@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6HLrgOM091978; Sun, 17 Jul 2011 21:53:42 GMT (envelope-from rstone@svn.freebsd.org) Message-Id: <201107172153.p6HLrgOM091978@svn.freebsd.org> From: Ryan Stone Date: Sun, 17 Jul 2011 21:53:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224156 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2011 21:53:43 -0000 Author: rstone Date: Sun Jul 17 21:53:42 2011 New Revision: 224156 URL: http://svn.freebsd.org/changeset/base/224156 Log: Fix a LOR between hwpmc and the kernel linker. When a system-wide sampling mode PMC is allocated, hwpmc calls linker_hwpmc_list_objects() while already holding an exclusive lock on pmc-sx lock. list_objects() tries to acquire an exclusive lock on the kld_sx lock. When a KLD module is loaded or unloaded successfully, kern_kld(un)load calls into the pmc hook while already holding an exclusive lock on the kld_sx lock. Calling the pmc hook requires acquiring a shared lock on the pmc-sx lock. Fix this by only acquiring a shared lock on the kld_sx lock in linker_hwpmc_list_objects(), and also downgrading to a shared lock on the kld_sx lock in kern_kld(un)load before calling into the pmc hook. In kern_kldload this required moving some modifications of the linker_file_t to happen before calling into the pmc hook. This fixes the deadlock by ensuring that the hwpmc -> list_objects() case is always able to proceed. Without this patch, I was able to deadlock a multicore system within minutes by constantly loading and unloading an KLD module while I simultaneously started a sampling mode PMC in a loop. MFC after: 1 month Modified: head/sys/kern/kern_linker.c Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Sun Jul 17 21:52:55 2011 (r224155) +++ head/sys/kern/kern_linker.c Sun Jul 17 21:53:42 2011 (r224156) @@ -70,6 +70,9 @@ SYSCTL_INT(_debug, OID_AUTO, kld_debug, #define KLD_LOCK() sx_xlock(&kld_sx) #define KLD_UNLOCK() sx_xunlock(&kld_sx) +#define KLD_DOWNGRADE() sx_downgrade(&kld_sx) +#define KLD_LOCK_READ() sx_slock(&kld_sx) +#define KLD_UNLOCK_READ() sx_sunlock(&kld_sx) #define KLD_LOCKED() sx_xlocked(&kld_sx) #define KLD_LOCK_ASSERT() do { \ if (!cold) \ @@ -1019,18 +1022,24 @@ kern_kldload(struct thread *td, const ch KLD_LOCK(); error = linker_load_module(kldname, modname, NULL, NULL, &lf); - if (error) - goto unlock; + if (error) { + KLD_UNLOCK(); + goto done; + } + lf->userrefs++; + if (fileid != NULL) + *fileid = lf->id; #ifdef HWPMC_HOOKS + KLD_DOWNGRADE(); pkm.pm_file = lf->filename; pkm.pm_address = (uintptr_t) lf->address; PMC_CALL_HOOK(td, PMC_FN_KLD_LOAD, (void *) &pkm); -#endif - lf->userrefs++; - if (fileid != NULL) - *fileid = lf->id; -unlock: + KLD_UNLOCK_READ(); +#else KLD_UNLOCK(); +#endif + +done: CURVNET_RESTORE(); return (error); } @@ -1102,10 +1111,14 @@ kern_kldunload(struct thread *td, int fi error = ENOENT; #ifdef HWPMC_HOOKS - if (error == 0) + if (error == 0) { + KLD_DOWNGRADE(); PMC_CALL_HOOK(td, PMC_FN_KLD_UNLOAD, (void *) &pkm); + KLD_UNLOCK_READ(); + } else +#else + KLD_UNLOCK(); #endif - KLD_UNLOCK(); CURVNET_RESTORE(); return (error); } @@ -1932,7 +1945,7 @@ linker_hwpmc_list_objects(void) int i, nmappings; nmappings = 0; - KLD_LOCK(); + KLD_LOCK_READ(); TAILQ_FOREACH(lf, &linker_files, link) nmappings++; @@ -1947,7 +1960,7 @@ linker_hwpmc_list_objects(void) kobase[i].pm_address = (uintptr_t)lf->address; i++; } - KLD_UNLOCK(); + KLD_UNLOCK_READ(); KASSERT(i > 0, ("linker_hpwmc_list_objects: no kernel objects?")); From owner-svn-src-head@FreeBSD.ORG Sun Jul 17 21:54:51 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65237106564A; Sun, 17 Jul 2011 21:54:51 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5410F8FC14; Sun, 17 Jul 2011 21:54:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6HLsper092049; Sun, 17 Jul 2011 21:54:51 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6HLsp2L092047; Sun, 17 Jul 2011 21:54:51 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201107172154.p6HLsp2L092047@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 17 Jul 2011 21:54:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224157 - head/sys/dev/gem X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2011 21:54:51 -0000 Author: yongari Date: Sun Jul 17 21:54:51 2011 New Revision: 224157 URL: http://svn.freebsd.org/changeset/base/224157 Log: Revert r222135 by allowing controller reinitialization. Due to unknown reason Apple UniNorth2 gem(4) device required manual interface down/up operation after r222135. Even though this is not correct thing and I don't like to revert it but it would be better than breaking gem(4) on PPC. This should be revisited. PR: kern/157405 Modified: head/sys/dev/gem/if_gem.c Modified: head/sys/dev/gem/if_gem.c ============================================================================== --- head/sys/dev/gem/if_gem.c Sun Jul 17 21:53:42 2011 (r224156) +++ head/sys/dev/gem/if_gem.c Sun Jul 17 21:54:51 2011 (r224157) @@ -947,8 +947,10 @@ gem_init_locked(struct gem_softc *sc) GEM_LOCK_ASSERT(sc, MA_OWNED); +#ifdef notyet if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) return; +#endif #ifdef GEM_DEBUG CTR2(KTR_GEM, "%s: %s: calling stop", device_get_name(sc->sc_dev), From owner-svn-src-head@FreeBSD.ORG Sun Jul 17 21:57:10 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7926106564A; Sun, 17 Jul 2011 21:57:10 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D672E8FC0C; Sun, 17 Jul 2011 21:57:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6HLvAcs092162; Sun, 17 Jul 2011 21:57:10 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6HLvAGp092160; Sun, 17 Jul 2011 21:57:10 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201107172157.p6HLvAGp092160@svn.freebsd.org> From: Martin Matuska Date: Sun, 17 Jul 2011 21:57:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224158 - head/usr.bin/tar X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2011 21:57:11 -0000 Author: mm Date: Sun Jul 17 21:57:10 2011 New Revision: 224158 URL: http://svn.freebsd.org/changeset/base/224158 Log: Fix accidential commit part: Include "bsdtar_platform.h" instead of "lafe_platform.h" MFC after: 2 weeks Modified: head/usr.bin/tar/read.c Modified: head/usr.bin/tar/read.c ============================================================================== --- head/usr.bin/tar/read.c Sun Jul 17 21:54:51 2011 (r224157) +++ head/usr.bin/tar/read.c Sun Jul 17 21:57:10 2011 (r224158) @@ -23,7 +23,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "lafe_platform.h" +#include "bsdtar_platform.h" __FBSDID("$FreeBSD$"); #ifdef HAVE_SYS_TYPES_H From owner-svn-src-head@FreeBSD.ORG Sun Jul 17 23:05:25 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09657106576F; Sun, 17 Jul 2011 23:05:25 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA1698FC18; Sun, 17 Jul 2011 23:05:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6HN5OX2094855; Sun, 17 Jul 2011 23:05:24 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6HN5OP2094848; Sun, 17 Jul 2011 23:05:24 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201107172305.p6HN5OP2094848@svn.freebsd.org> From: Robert Watson Date: Sun, 17 Jul 2011 23:05:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224159 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2011 23:05:25 -0000 Author: rwatson Date: Sun Jul 17 23:05:24 2011 New Revision: 224159 URL: http://svn.freebsd.org/changeset/base/224159 Log: Define two new sysctl node flags: CTLFLAG_CAPRD and CTLFLAG_CAPRW, which may be jointly referenced via the mask CTLFLAG_CAPRW. Sysctls with these flags are available in Capsicum's capability mode; other sysctl nodes are not. Flag several useful sysctls as available in capability mode, such as memory layout sysctls required by the run-time linker and malloc(3). Also expose access to randomness and available kernel features. A few sysctls are enabled to support name->MIB conversion; these may leak information to capability mode by virtue of providing resolution on names not flagged for access in capability mode. This is, generally, not a huge problem, but might be something to resolve in the future. Flag these cases with XXX comments. Submitted by: jonathan Sponsored by: Google, Inc. Modified: head/sys/kern/kern_exec.c head/sys/kern/kern_mib.c head/sys/kern/kern_sysctl.c head/sys/kern/posix4_mib.c head/sys/kern/subr_smp.c head/sys/sys/sysctl.h Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Sun Jul 17 21:57:10 2011 (r224158) +++ head/sys/kern/kern_exec.c Sun Jul 17 23:05:24 2011 (r224159) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -113,8 +114,8 @@ SYSCTL_PROC(_kern, KERN_PS_STRINGS, ps_s NULL, 0, sysctl_kern_ps_strings, "LU", ""); /* XXX This should be vm_size_t. */ -SYSCTL_PROC(_kern, KERN_USRSTACK, usrstack, CTLTYPE_ULONG|CTLFLAG_RD, - NULL, 0, sysctl_kern_usrstack, "LU", ""); +SYSCTL_PROC(_kern, KERN_USRSTACK, usrstack, CTLTYPE_ULONG|CTLFLAG_RD| + CTLFLAG_CAPRD, NULL, 0, sysctl_kern_usrstack, "LU", ""); SYSCTL_PROC(_kern, OID_AUTO, stackprot, CTLTYPE_INT|CTLFLAG_RD, NULL, 0, sysctl_kern_stackprot, "I", ""); Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Sun Jul 17 21:57:10 2011 (r224158) +++ head/sys/kern/kern_mib.c Sun Jul 17 23:05:24 2011 (r224159) @@ -57,7 +57,7 @@ __FBSDID("$FreeBSD$"); SYSCTL_NODE(, 0, sysctl, CTLFLAG_RW, 0, "Sysctl internal magic"); -SYSCTL_NODE(, CTL_KERN, kern, CTLFLAG_RW, 0, +SYSCTL_NODE(, CTL_KERN, kern, CTLFLAG_RW|CTLFLAG_CAPRD, 0, "High kernel, proc, limits &c"); SYSCTL_NODE(, CTL_VM, vm, CTLFLAG_RW, 0, "Virtual memory"); @@ -90,23 +90,23 @@ SYSCTL_NODE(, OID_AUTO, regression, CTLF SYSCTL_STRING(_kern, OID_AUTO, ident, CTLFLAG_RD|CTLFLAG_MPSAFE, kern_ident, 0, "Kernel identifier"); -SYSCTL_STRING(_kern, KERN_OSRELEASE, osrelease, CTLFLAG_RD|CTLFLAG_MPSAFE, - osrelease, 0, "Operating system release"); +SYSCTL_STRING(_kern, KERN_OSRELEASE, osrelease, CTLFLAG_RD|CTLFLAG_MPSAFE| + CTLFLAG_CAPRD, osrelease, 0, "Operating system release"); -SYSCTL_INT(_kern, KERN_OSREV, osrevision, CTLFLAG_RD, +SYSCTL_INT(_kern, KERN_OSREV, osrevision, CTLFLAG_RD|CTLFLAG_CAPRD, 0, BSD, "Operating system revision"); SYSCTL_STRING(_kern, KERN_VERSION, version, CTLFLAG_RD|CTLFLAG_MPSAFE, version, 0, "Kernel version"); -SYSCTL_STRING(_kern, KERN_OSTYPE, ostype, CTLFLAG_RD|CTLFLAG_MPSAFE, - ostype, 0, "Operating system type"); +SYSCTL_STRING(_kern, KERN_OSTYPE, ostype, CTLFLAG_RD|CTLFLAG_MPSAFE| + CTLFLAG_CAPRD, ostype, 0, "Operating system type"); /* * NOTICE: The *userland* release date is available in * /usr/include/osreldate.h */ -SYSCTL_INT(_kern, KERN_OSRELDATE, osreldate, CTLFLAG_RD, +SYSCTL_INT(_kern, KERN_OSRELDATE, osreldate, CTLFLAG_RD|CTLFLAG_CAPRD, &osreldate, 0, "Kernel release date"); SYSCTL_INT(_kern, KERN_MAXPROC, maxproc, CTLFLAG_RDTUN, @@ -118,24 +118,24 @@ SYSCTL_INT(_kern, KERN_MAXPROCPERUID, ma SYSCTL_INT(_kern, OID_AUTO, maxusers, CTLFLAG_RDTUN, &maxusers, 0, "Hint for kernel tuning"); -SYSCTL_INT(_kern, KERN_ARGMAX, argmax, CTLFLAG_RD, +SYSCTL_INT(_kern, KERN_ARGMAX, argmax, CTLFLAG_RD|CTLFLAG_CAPRD, 0, ARG_MAX, "Maximum bytes of argument to execve(2)"); -SYSCTL_INT(_kern, KERN_POSIX1, posix1version, CTLFLAG_RD, +SYSCTL_INT(_kern, KERN_POSIX1, posix1version, CTLFLAG_RD|CTLFLAG_CAPRD, 0, _POSIX_VERSION, "Version of POSIX attempting to comply to"); -SYSCTL_INT(_kern, KERN_NGROUPS, ngroups, CTLFLAG_RDTUN, +SYSCTL_INT(_kern, KERN_NGROUPS, ngroups, CTLFLAG_RDTUN|CTLFLAG_CAPRD, &ngroups_max, 0, "Maximum number of supplemental groups a user can belong to"); -SYSCTL_INT(_kern, KERN_JOB_CONTROL, job_control, CTLFLAG_RD, +SYSCTL_INT(_kern, KERN_JOB_CONTROL, job_control, CTLFLAG_RD|CTLFLAG_CAPRD, 0, 1, "Whether job control is available"); #ifdef _POSIX_SAVED_IDS -SYSCTL_INT(_kern, KERN_SAVED_IDS, saved_ids, CTLFLAG_RD, +SYSCTL_INT(_kern, KERN_SAVED_IDS, saved_ids, CTLFLAG_RD|CTLFLAG_CAPRD, 0, 1, "Whether saved set-group/user ID is available"); #else -SYSCTL_INT(_kern, KERN_SAVED_IDS, saved_ids, CTLFLAG_RD, +SYSCTL_INT(_kern, KERN_SAVED_IDS, saved_ids, CTLFLAG_RD|CTLFLAG_CAPRD, 0, 0, "Whether saved set-group/user ID is available"); #endif @@ -144,13 +144,13 @@ char kernelname[MAXPATHLEN] = "/kernel"; SYSCTL_STRING(_kern, KERN_BOOTFILE, bootfile, CTLFLAG_RW, kernelname, sizeof kernelname, "Name of kernel file booted"); -SYSCTL_INT(_hw, HW_NCPU, ncpu, CTLFLAG_RD, +SYSCTL_INT(_hw, HW_NCPU, ncpu, CTLFLAG_RD|CTLFLAG_CAPRD, &mp_ncpus, 0, "Number of active CPUs"); -SYSCTL_INT(_hw, HW_BYTEORDER, byteorder, CTLFLAG_RD, +SYSCTL_INT(_hw, HW_BYTEORDER, byteorder, CTLFLAG_RD|CTLFLAG_CAPRD, 0, BYTE_ORDER, "System byte order"); -SYSCTL_INT(_hw, HW_PAGESIZE, pagesize, CTLFLAG_RD, +SYSCTL_INT(_hw, HW_PAGESIZE, pagesize, CTLFLAG_RD|CTLFLAG_CAPRD, 0, PAGE_SIZE, "System memory page size"); static int @@ -167,7 +167,7 @@ sysctl_kern_arnd(SYSCTL_HANDLER_ARGS) } SYSCTL_PROC(_kern, KERN_ARND, arandom, - CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, + CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE | CTLFLAG_CAPRD, NULL, 0, sysctl_kern_arnd, "", "arc4rand"); static int @@ -448,6 +448,8 @@ FEATURE(compat_freebsd7, "Compatible wit * This is really cheating. These actually live in the libc, something * which I'm not quite sure is a good idea anyway, but in order for * getnext and friends to actually work, we define dummies here. + * + * XXXRW: These probably should be CTLFLAG_CAPRD. */ SYSCTL_STRING(_user, USER_CS_PATH, cs_path, CTLFLAG_RD, "", 0, "PATH that finds all the standard utilities"); Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Sun Jul 17 21:57:10 2011 (r224158) +++ head/sys/kern/kern_sysctl.c Sun Jul 17 23:05:24 2011 (r224159) @@ -38,12 +38,14 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_capsicum.h" #include "opt_compat.h" #include "opt_ktrace.h" #include #include #include +#include #include #include #include @@ -725,7 +727,12 @@ sysctl_sysctl_name(SYSCTL_HANDLER_ARGS) return (error); } -static SYSCTL_NODE(_sysctl, 1, name, CTLFLAG_RD, sysctl_sysctl_name, ""); +/* + * XXXRW/JA: Shouldn't return name data for nodes that we don't permit in + * capability mode. + */ +static SYSCTL_NODE(_sysctl, 1, name, CTLFLAG_RD | CTLFLAG_CAPRD, + sysctl_sysctl_name, ""); static int sysctl_sysctl_next_ls(struct sysctl_oid_list *lsp, int *name, u_int namelen, @@ -806,7 +813,12 @@ sysctl_sysctl_next(SYSCTL_HANDLER_ARGS) return (error); } -static SYSCTL_NODE(_sysctl, 2, next, CTLFLAG_RD, sysctl_sysctl_next, ""); +/* + * XXXRW/JA: Shouldn't return next data for nodes that we don't permit in + * capability mode. + */ +static SYSCTL_NODE(_sysctl, 2, next, CTLFLAG_RD | CTLFLAG_CAPRD, + sysctl_sysctl_next, ""); static int name2oid(char *name, int *oid, int *len, struct sysctl_oid **oidpp) @@ -902,9 +914,13 @@ sysctl_sysctl_name2oid(SYSCTL_HANDLER_AR return (error); } +/* + * XXXRW/JA: Shouldn't return name2oid data for nodes that we don't permit in + * capability mode. + */ SYSCTL_PROC(_sysctl, 3, name2oid, - CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_MPSAFE, - 0, 0, sysctl_sysctl_name2oid, "I", ""); + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_MPSAFE + | CTLFLAG_CAPRW, 0, 0, sysctl_sysctl_name2oid, "I", ""); static int sysctl_sysctl_oidfmt(SYSCTL_HANDLER_ARGS) @@ -931,7 +947,7 @@ sysctl_sysctl_oidfmt(SYSCTL_HANDLER_ARGS } -static SYSCTL_NODE(_sysctl, 4, oidfmt, CTLFLAG_RD|CTLFLAG_MPSAFE, +static SYSCTL_NODE(_sysctl, 4, oidfmt, CTLFLAG_RD|CTLFLAG_MPSAFE|CTLFLAG_CAPRD, sysctl_sysctl_oidfmt, ""); static int @@ -955,7 +971,8 @@ sysctl_sysctl_oiddescr(SYSCTL_HANDLER_AR return (error); } -static SYSCTL_NODE(_sysctl, 5, oiddescr, CTLFLAG_RD, sysctl_sysctl_oiddescr, ""); +static SYSCTL_NODE(_sysctl, 5, oiddescr, CTLFLAG_RD|CTLFLAG_CAPRD, + sysctl_sysctl_oiddescr, ""); /* * Default "handler" functions. @@ -1429,6 +1446,19 @@ sysctl_root(SYSCTL_HANDLER_ARGS) KASSERT(req->td != NULL, ("sysctl_root(): req->td == NULL")); +#ifdef CAPABILITY_MODE + /* + * If the process is in capability mode, then don't permit reading or + * writing unless specifically granted for the node. + */ + if (IN_CAPABILITY_MODE(req->td)) { + if (req->oldptr && !(oid->oid_kind & CTLFLAG_CAPRD)) + return (EPERM); + if (req->newptr && !(oid->oid_kind & CTLFLAG_CAPWR)) + return (EPERM); + } +#endif + /* Is this sysctl sensitive to securelevels? */ if (req->newptr && (oid->oid_kind & CTLFLAG_SECURE)) { lvl = (oid->oid_kind & CTLMASK_SECURE) >> CTLSHIFT_SECURE; Modified: head/sys/kern/posix4_mib.c ============================================================================== --- head/sys/kern/posix4_mib.c Sun Jul 17 21:57:10 2011 (r224158) +++ head/sys/kern/posix4_mib.c Sun Jul 17 23:05:24 2011 (r224159) @@ -57,7 +57,8 @@ static int p31b_sysctl_proc(SYSCTL_HANDL SYSCTL_DECL(_p1003_1b); #define P1B_SYSCTL(num, name) \ - SYSCTL_INT(_p1003_1b, num, name, CTLFLAG_RD, facility + num - 1, 0, ""); + SYSCTL_INT(_p1003_1b, num, name, CTLFLAG_RD | CTLFLAG_CAPRD, \ + facility + num - 1, 0, ""); #define P1B_SYSCTL_RW(num, name) \ SYSCTL_PROC(_p1003_1b, num, name, CTLTYPE_INT | CTLFLAG_RW, NULL, num, \ p31b_sysctl_proc, "I", ""); @@ -67,7 +68,7 @@ SYSCTL_DECL(_p1003_1b); SYSCTL_DECL(_kern_p1003_1b); #define P1B_SYSCTL(num, name) \ - SYSCTL_INT(_kern_p1003_1b, OID_AUTO, name, CTLFLAG_RD, \ + SYSCTL_INT(_kern_p1003_1b, OID_AUTO, name, CTLFLAG_RD | CTLFLAG_CAPRD, \ facility + num - 1, 0, ""); #define P1B_SYSCTL_RW(num, name) \ SYSCTL_PROC(_p1003_1b, OID_AUTO, name, CTLTYPE_INT | CTLFLAG_RW, NULL, \ Modified: head/sys/kern/subr_smp.c ============================================================================== --- head/sys/kern/subr_smp.c Sun Jul 17 21:57:10 2011 (r224158) +++ head/sys/kern/subr_smp.c Sun Jul 17 23:05:24 2011 (r224159) @@ -70,25 +70,25 @@ int mp_maxcpus = MAXCPU; volatile int smp_started; u_int mp_maxid; -SYSCTL_NODE(_kern, OID_AUTO, smp, CTLFLAG_RD, NULL, "Kernel SMP"); +SYSCTL_NODE(_kern, OID_AUTO, smp, CTLFLAG_RD|CTLFLAG_CAPRD, NULL, "Kernel SMP"); -SYSCTL_UINT(_kern_smp, OID_AUTO, maxid, CTLFLAG_RD, &mp_maxid, 0, +SYSCTL_INT(_kern_smp, OID_AUTO, maxid, CTLFLAG_RD|CTLFLAG_CAPRD, &mp_maxid, 0, "Max CPU ID."); -SYSCTL_INT(_kern_smp, OID_AUTO, maxcpus, CTLFLAG_RD, &mp_maxcpus, 0, - "Max number of CPUs that the system was compiled for."); +SYSCTL_INT(_kern_smp, OID_AUTO, maxcpus, CTLFLAG_RD|CTLFLAG_CAPRD, &mp_maxcpus, + 0, "Max number of CPUs that the system was compiled for."); int smp_active = 0; /* are the APs allowed to run? */ SYSCTL_INT(_kern_smp, OID_AUTO, active, CTLFLAG_RW, &smp_active, 0, "Number of Auxillary Processors (APs) that were successfully started"); int smp_disabled = 0; /* has smp been disabled? */ -SYSCTL_INT(_kern_smp, OID_AUTO, disabled, CTLFLAG_RDTUN, &smp_disabled, 0, - "SMP has been disabled from the loader"); +SYSCTL_INT(_kern_smp, OID_AUTO, disabled, CTLFLAG_RDTUN|CTLFLAG_CAPRD, + &smp_disabled, 0, "SMP has been disabled from the loader"); TUNABLE_INT("kern.smp.disabled", &smp_disabled); int smp_cpus = 1; /* how many cpu's running */ -SYSCTL_INT(_kern_smp, OID_AUTO, cpus, CTLFLAG_RD, &smp_cpus, 0, +SYSCTL_INT(_kern_smp, OID_AUTO, cpus, CTLFLAG_RD|CTLFLAG_CAPRD, &smp_cpus, 0, "Number of CPUs online"); int smp_topology = 0; /* Which topology we're using. */ Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Sun Jul 17 21:57:10 2011 (r224158) +++ head/sys/sys/sysctl.h Sun Jul 17 23:05:24 2011 (r224159) @@ -88,6 +88,9 @@ struct ctlname { #define CTLFLAG_VNET 0x00020000 /* Prisons with vnet can fiddle */ #define CTLFLAG_RDTUN (CTLFLAG_RD|CTLFLAG_TUN) #define CTLFLAG_DYING 0x00010000 /* oid is being removed */ +#define CTLFLAG_CAPRD 0x00008000 /* Can be read in capability mode */ +#define CTLFLAG_CAPWR 0x00004000 /* Can be written in capability mode */ +#define CTLFLAG_CAPRW (CTLFLAG_CAPRD|CTLFLAG_CAPWR) /* * Secure level. Note that CTLFLAG_SECURE == CTLFLAG_SECURE1. @@ -407,7 +410,8 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a * kernel features. */ #define FEATURE(name, desc) \ - SYSCTL_INT(_kern_features, OID_AUTO, name, CTLFLAG_RD, 0, 1, desc) + SYSCTL_INT(_kern_features, OID_AUTO, name, CTLFLAG_RD | CTLFLAG_CAPRD, \ + 0, 1, desc) #endif /* _KERNEL */ From owner-svn-src-head@FreeBSD.ORG Sun Jul 17 23:09:09 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F33A1065670; Sun, 17 Jul 2011 23:09:09 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id C142B8FC1A; Sun, 17 Jul 2011 23:09:08 +0000 (UTC) Received: from c122-106-165-191.carlnfd1.nsw.optusnet.com.au (c122-106-165-191.carlnfd1.nsw.optusnet.com.au [122.106.165.191]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p6HN94QO030466 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 18 Jul 2011 09:09:05 +1000 Date: Mon, 18 Jul 2011 09:09:04 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ryan Stone In-Reply-To: <201107172108.p6HL8Gkd090278@svn.freebsd.org> Message-ID: <20110718080428.N3939@besplex.bde.org> References: <201107172108.p6HL8Gkd090278@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r224150 - head/sbin/fdisk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jul 2011 23:09:09 -0000 On Sun, 17 Jul 2011, Ryan Stone wrote: > Log: > The MBR uses a 32-bit unsigned integer to store the size of a slice, but > fdisk(1) internally uses a signed int. Should a user attempt to specify > a slice containing more than 2^31 - 1 sectors, an error will be reported > on systems with sizeof(long) == 4 and the slice size will be silently > truncated on systems with sizeof(long) > 4. > > Instead use an unsigned long to store the slice size in fdisk(1). This > allows the user to specify a slice size up to the maximum permitted by > the MBR on-disk format and does not have any problems with silent > truncation should the use specify an slice size larger than 2^32 on systems > with sizeof(long) > 4. > > Submitted by: Mark Johnston (markjdb AT gmail DOT com) > MFC after: 2 weeks > > Modified: > head/sbin/fdisk/fdisk.c > > Modified: head/sbin/fdisk/fdisk.c > ============================================================================== > --- head/sbin/fdisk/fdisk.c Sun Jul 17 20:49:38 2011 (r224149) > +++ head/sbin/fdisk/fdisk.c Sun Jul 17 21:08:16 2011 (r224150) > @@ -108,9 +108,9 @@ typedef struct cmd { > char cmd; > int n_args; > struct arg { > - char argtype; > - int arg_val; > - char *arg_str; > + char argtype; > + unsigned long arg_val; > + char * arg_str; > } args[MAX_ARGS]; > } CMD; There was no need to further break the style. "unsigned long" is spelled u_long in KNF, partly to avoid excessive indentation like the above, and this spelling was used in some but not all parts of this file. But no one knows what the correct indentation for the above is -- it shouldn't be just 1 or more tabs, since the file is highly non-KNF, starting with it using a 4-space primary indentation. The "*" before arg_str in the above used to be correctly placed. > > @@ -990,7 +990,7 @@ parse_config_line(char *line, CMD *comma > if (isalpha(*cp)) > command->args[command->n_args].argtype = *cp++; > end = NULL; > - command->args[command->n_args].arg_val = strtol(cp, &end, 0); > + command->args[command->n_args].arg_val = strtoul(cp, &end, 0); > if (cp == end || (!isspace(*end) && *end != '\0')) { > char ch; > end = cp; > Also, arg_val is never used as a u_long. We risk truncation when it is blindly assigned to variables whose type is never u_long. It is mostly assigned to variables of type uint ("uint" is an archaic SysV spelling of the BSD u_int which is a spelling of unsigned int. This style bug was imported from Mach and never fixed). Since uint is unsigned and ints have 32 bits, things now work up to UINT32_MAX but no further. arg_val is also blindly assigned to a variable of type int, the partition number, and to a variable of type u_char (the partition type), but since these values nonsense unless they are small, there is no problem with overflow near INT32_MAX or UINT32_MAX. The above still has the usual amount of error checking for the range after strto*() returns: none. We don't really care since values larger than UINT32_MAX don't work for other reasons. On 32-bit systems, a value of UINT32_MAX will be returned in overflow cases. Then we use that value when we should abort. On 64-bit systems, values larger than UINT32_MAX may be returned. Then assignment to arg_val now doesn't overflow, but assignment to the uints overflows, giving fail-unsafe behaviour where i386 has relatively fail-safe behaviour. Elsewhere, fdisk uses a horrible mixture of int, uint, u_int, u_int32_t, uint32_t, unsigned long, u_long, long long and u_int64_t. Sometimes the type is imposed by a system data structure, but mostly these choices of types are nonsense or anachronisms. They might as well almost all be u_int, since only 32-bit partition offsets and sizes work. More careful old code uses u_long, since that was the largest possible and ints might be 16 bits. Newer code should us uint32_t. u_int64_t is used just once, to avoid overflow in conversion from sectors to MB. This use is reasonable, but then to print the value it must be cast to uintmax_t. It would be better to use uintmax_t for the value throughout. The long long abomination is only just once, as an accumulator in a home made version of strtoul() named decimal(). decimal() actually has some range checking, but is otherwise much worse than strtoul(). It allows values up to UINT32_MAX, but returns values in an int *. Callers often want the value in a uint or a u_char. If they passed a pointer to their variable, then the type error would be detected, but such errors are "fixed" by subverting decimal() using the Decimal() macro (Decimal() calls decimal() with a pointer to a temporary variable with the matching wrong type 'int', and then blindly assigns the temporary variable to the actual variable). The subversion was in rev.1.1 in 1993, so it apparently came from Mach. Anyway, decimal() works up to UINT32_MAX although it gives undefined behaviour above INT_MAX, since the overflow on assignment to the temporary variable combined with the implementation-defined conversion of the temporary variable to uint happens to be benign on all supported arches (it gives back the original uint32_t value). The type of the accumulator has to be larger than the type of the maximum value supported so that the range checking works after the limit of the range has been exceeded. Otherwise, the type of the accumulator only needs to be uint32_t. strtoul() uses a similar accumulator of type u_long and makes this work by checking the range before a modified limit is exceeded. decimal() is used for most interactive input, including for partition offsets and sizes. The bug fixed in this commit must have been rarely noticed since it only affects command-line input. The corresponding bugs for interactive input are merely all the benign overflows above INT_MAX and the horrible choices of types which mark it hard to see that all the overflows are benign. See the r217714 commit thread for more details about bogusness in decimal(). Bruce From owner-svn-src-head@FreeBSD.ORG Mon Jul 18 01:22:40 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 699C8106566B; Mon, 18 Jul 2011 01:22:40 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-ey0-f176.google.com (mail-ey0-f176.google.com [209.85.215.176]) by mx1.freebsd.org (Postfix) with ESMTP id A3D388FC0C; Mon, 18 Jul 2011 01:22:39 +0000 (UTC) Received: by eya28 with SMTP id 28so2136346eya.21 for ; Sun, 17 Jul 2011 18:22:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=15ExDFnKGWFUbQkpHhKLSVFw+eYS4IqrBGzScYcv/hs=; b=C9ye9RT7E7gxwl/Qyo33smf3pxByytqTtr7WLdxVl8uDQhg+wV7lkKkSez4nn3hGEM pX4gOKrOuL3DkUL0uvyHpda29kKd0AQ7hA9CE7Re6FP7EggXjY+sPG6iuP6l+9+X5noP h7dpU3iAo9cn7mYeI1UnIdGt1QloKpqAXupbc= MIME-Version: 1.0 Received: by 10.213.29.196 with SMTP id r4mr931ebc.52.1310952158380; Sun, 17 Jul 2011 18:22:38 -0700 (PDT) Received: by 10.213.15.70 with HTTP; Sun, 17 Jul 2011 18:22:38 -0700 (PDT) In-Reply-To: <20110718080428.N3939@besplex.bde.org> References: <201107172108.p6HL8Gkd090278@svn.freebsd.org> <20110718080428.N3939@besplex.bde.org> Date: Sun, 17 Jul 2011 21:22:38 -0400 Message-ID: From: Ryan Stone To: Bruce Evans Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, markjdb@gmail.com Subject: Re: svn commit: r224150 - head/sbin/fdisk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jul 2011 01:22:40 -0000 On Sun, Jul 17, 2011 at 7:09 PM, Bruce Evans wrote: > There was no need to further break the style. Ack. Should have caught that. Will fix. >> >> @@ -990,7 +990,7 @@ parse_config_line(char *line, CMD *comma >> =A0 =A0 =A0 =A0 =A0 =A0if (isalpha(*cp)) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0command->args[command->n_args].argtype = =3D *cp++; >> =A0 =A0 =A0 =A0 =A0 =A0end =3D NULL; >> - =A0 =A0 =A0 =A0 =A0 command->args[command->n_args].arg_val =3D strtol(= cp, &end, 0); >> + =A0 =A0 =A0 =A0 =A0 command->args[command->n_args].arg_val =3D strtoul= (cp, &end, 0); >> =A0 =A0 =A0 =A0 =A0 =A0if (cp =3D=3D end || (!isspace(*end) && *end !=3D= '\0')) { >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0char ch; >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0end =3D cp; >> > > Also, arg_val is never used as a u_long. =A0We risk truncation when it is > blindly assigned to variables whose type is never u_long. =A0It is mostly > assigned to variables of type uint ("uint" is an archaic SysV spelling > of the BSD u_int which is a spelling of unsigned int. =A0This style bug > was imported from Mach and never fixed). =A0Since uint is unsigned and in= ts > have 32 bits, things now work up to UINT32_MAX but no further. =A0arg_val > is also blindly assigned to a variable of type int, the partition number, > and to a variable of type u_char (the partition type), but since these > values nonsense unless they are small, there is no problem with overflow > near INT32_MAX or UINT32_MAX. Hm, I was under the impression that fdisk was checking whether the size parameter fit within in 32-bits before putting it in the MBR, but I seem to have been mistaken. In that case, I think that the right fix is to make arg_val a u_int for now, which will still allow slices with more than 2^31 sectors to be specified. Truncation is still an issue but that's not a new bug. From owner-svn-src-head@FreeBSD.ORG Mon Jul 18 02:13:22 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3004D106564A; Mon, 18 Jul 2011 02:13:22 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1540B8FC15; Mon, 18 Jul 2011 02:13:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6I2DLbr000853; Mon, 18 Jul 2011 02:13:21 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6I2DL2J000849; Mon, 18 Jul 2011 02:13:21 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201107180213.p6I2DL2J000849@svn.freebsd.org> From: "Justin T. Gibbs" Date: Mon, 18 Jul 2011 02:13:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224169 - in head/cddl/contrib/opensolaris: cmd/zpool lib/libzfs/common X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jul 2011 02:13:22 -0000 Author: gibbs Date: Mon Jul 18 02:13:21 2011 New Revision: 224169 URL: http://svn.freebsd.org/changeset/base/224169 Log: cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h: cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c: o Add zpool_pool_state_to_name() API to libzfs which converts a pool_state_t into a user consumable string. o While here, correct constness of make zpool_state_to_name() and zpool_label_disk(). MFD after: 1 week Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Mon Jul 18 01:09:43 2011 (r224168) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Mon Jul 18 02:13:21 2011 (r224169) @@ -1052,7 +1052,7 @@ print_status_config(zpool_handle_t *zhp, char *vname; uint64_t notpresent; spare_cbdata_t cb; - char *state; + const char *state; if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN, &child, &children) != 0) Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Mon Jul 18 01:09:43 2011 (r224168) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Mon Jul 18 02:13:21 2011 (r224169) @@ -200,7 +200,8 @@ extern zpool_handle_t *zpool_open_canfai extern void zpool_close(zpool_handle_t *); extern const char *zpool_get_name(zpool_handle_t *); extern int zpool_get_state(zpool_handle_t *); -extern char *zpool_state_to_name(vdev_state_t, vdev_aux_t); +extern const char *zpool_state_to_name(vdev_state_t, vdev_aux_t); +extern const char *zpool_pool_state_to_name(pool_state_t); extern void zpool_free_handles(libzfs_handle_t *); /* @@ -249,7 +250,7 @@ extern nvlist_t *zpool_find_vdev(zpool_h boolean_t *, boolean_t *); extern nvlist_t *zpool_find_vdev_by_physpath(zpool_handle_t *, const char *, boolean_t *, boolean_t *, boolean_t *); -extern int zpool_label_disk(libzfs_handle_t *, zpool_handle_t *, char *); +extern int zpool_label_disk(libzfs_handle_t *, zpool_handle_t *, const char *); /* * Functions to manage pool properties Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Mon Jul 18 01:09:43 2011 (r224168) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Mon Jul 18 02:13:21 2011 (r224169) @@ -174,7 +174,7 @@ zpool_get_prop_int(zpool_handle_t *zhp, /* * Map VDEV STATE to printed strings. */ -char * +const char * zpool_state_to_name(vdev_state_t state, vdev_aux_t aux) { switch (state) { @@ -202,6 +202,34 @@ zpool_state_to_name(vdev_state_t state, } /* + * Map POOL STATE to printed strings. + */ +const char * +zpool_pool_state_to_name(pool_state_t state) +{ + switch (state) { + case POOL_STATE_ACTIVE: + return (gettext("ACTIVE")); + case POOL_STATE_EXPORTED: + return (gettext("EXPORTED")); + case POOL_STATE_DESTROYED: + return (gettext("DESTROYED")); + case POOL_STATE_SPARE: + return (gettext("SPARE")); + case POOL_STATE_L2CACHE: + return (gettext("L2CACHE")); + case POOL_STATE_UNINITIALIZED: + return (gettext("UNINITIALIZED")); + case POOL_STATE_UNAVAIL: + return (gettext("UNAVAIL")); + case POOL_STATE_POTENTIALLY_ACTIVE: + return (gettext("POTENTIALLY_ACTIVE")); + } + + return (gettext("UNKNOWN")); +} + +/* * Get a zpool property value for 'prop' and return the value in * a pre-allocated buffer. */ @@ -3605,7 +3633,7 @@ find_start_block(nvlist_t *config) * stripped of any leading /dev path. */ int -zpool_label_disk(libzfs_handle_t *hdl, zpool_handle_t *zhp, char *name) +zpool_label_disk(libzfs_handle_t *hdl, zpool_handle_t *zhp, const char *name) { #ifdef sun char path[MAXPATHLEN]; From owner-svn-src-head@FreeBSD.ORG Mon Jul 18 03:00:59 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DF1D106566C; Mon, 18 Jul 2011 03:00:59 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C0898FC08; Mon, 18 Jul 2011 03:00:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6I30xM3002406; Mon, 18 Jul 2011 03:00:59 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6I30xPV002403; Mon, 18 Jul 2011 03:00:59 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201107180300.p6I30xPV002403@svn.freebsd.org> From: "Justin T. Gibbs" Date: Mon, 18 Jul 2011 03:00:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224170 - in head/cddl/contrib/opensolaris: cmd/zpool lib/libzfs/common X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jul 2011 03:00:59 -0000 Author: gibbs Date: Mon Jul 18 03:00:59 2011 New Revision: 224170 URL: http://svn.freebsd.org/changeset/base/224170 Log: Correct reporting of missing leaf vdevs so that the GUID required to perform pool actions is always displayed. cddl/contrib/opensolaris/cmd/zpool/zpool_main.c: The "zpool status" command reports the "last seen at" device node path when the vdev name is being reported by GUID. Augment this code to assume a GUID is reported when a device goes missing after initial boot in addition to the previous behavior of doing this for devices that aren't seen at boot. cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c: In zpool_vdev_name(), report recently missing devices by GUID. There is no guarantee they will return at their previous location. Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Mon Jul 18 02:13:21 2011 (r224169) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Mon Jul 18 03:00:59 2011 (r224170) @@ -1084,10 +1084,11 @@ print_status_config(zpool_handle_t *zhp, } if (nvlist_lookup_uint64(nv, ZPOOL_CONFIG_NOT_PRESENT, - ¬present) == 0) { + ¬present) == 0 || + vs->vs_state <= VDEV_STATE_CANT_OPEN) { char *path; - verify(nvlist_lookup_string(nv, ZPOOL_CONFIG_PATH, &path) == 0); - (void) printf(" was %s", path); + if (nvlist_lookup_string(nv, ZPOOL_CONFIG_PATH, &path) == 0) + (void) printf(" was %s", path); } else if (vs->vs_aux != 0) { (void) printf(" "); Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Mon Jul 18 02:13:21 2011 (r224169) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Mon Jul 18 03:00:59 2011 (r224170) @@ -3110,15 +3110,25 @@ zpool_vdev_name(libzfs_handle_t *hdl, zp char buf[64]; vdev_stat_t *vs; uint_t vsc; + int have_stats; + int have_path; - if (nvlist_lookup_uint64(nv, ZPOOL_CONFIG_NOT_PRESENT, - &value) == 0) { + have_stats = nvlist_lookup_uint64_array(nv, ZPOOL_CONFIG_VDEV_STATS, + (uint64_t **)&vs, &vsc) == 0; + have_path = nvlist_lookup_string(nv, ZPOOL_CONFIG_PATH, &path) == 0; + + /* + * If the device is not currently present, assume it will not + * come back at the same device path. Display the device by GUID. + */ + if (nvlist_lookup_uint64(nv, ZPOOL_CONFIG_NOT_PRESENT, &value) == 0 || + have_path && have_stats && vs->vs_state <= VDEV_STATE_CANT_OPEN) { verify(nvlist_lookup_uint64(nv, ZPOOL_CONFIG_GUID, &value) == 0); (void) snprintf(buf, sizeof (buf), "%llu", (u_longlong_t)value); path = buf; - } else if (nvlist_lookup_string(nv, ZPOOL_CONFIG_PATH, &path) == 0) { + } else if (have_path) { /* * If the device is dead (faulted, offline, etc) then don't @@ -3126,8 +3136,7 @@ zpool_vdev_name(libzfs_handle_t *hdl, zp * open a misbehaving device, which can have undesirable * effects. */ - if ((nvlist_lookup_uint64_array(nv, ZPOOL_CONFIG_VDEV_STATS, - (uint64_t **)&vs, &vsc) != 0 || + if ((have_stats == 0 || vs->vs_state >= VDEV_STATE_DEGRADED) && zhp != NULL && nvlist_lookup_string(nv, ZPOOL_CONFIG_DEVID, &devid) == 0) { From owner-svn-src-head@FreeBSD.ORG Mon Jul 18 03:18:07 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E577106566B; Mon, 18 Jul 2011 03:18:07 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 42FF28FC17; Mon, 18 Jul 2011 03:18:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6I3I7OJ003232; Mon, 18 Jul 2011 03:18:07 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6I3I7av003228; Mon, 18 Jul 2011 03:18:07 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201107180318.p6I3I7av003228@svn.freebsd.org> From: "Justin T. Gibbs" Date: Mon, 18 Jul 2011 03:18:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224171 - in head/cddl/contrib/opensolaris: cmd/zpool lib/libzfs/common X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jul 2011 03:18:07 -0000 Author: gibbs Date: Mon Jul 18 03:18:06 2011 New Revision: 224171 URL: http://svn.freebsd.org/changeset/base/224171 Log: cddl/contrib/opensolaris/cmd/zpool/zpool_main.c: cddl/contrib/opensolaris/cmd/zpool/zpool.8: cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c: Add the "zpool labelclear" command. This command can be used to wipe the label data from a drive that is not active in a pool. The optional "-f" argument can be used to treat an exported or foreign vdev as "inactive" thus allowing its label information to be cleared. Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Mon Jul 18 03:00:59 2011 (r224170) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool.8 Mon Jul 18 03:18:06 2011 (r224171) @@ -82,6 +82,11 @@ zpool \- configures ZFS storage pools .LP .nf +\fBzpool labelclear\fR [\fB-f\fR] \fIdevice\fR +.fi + +.LP +.nf \fBzpool list\fR [\fB-H\fR] [\fB-o\fR \fIproperty\fR[,...]] [\fIpool\fR] ... .fi @@ -1205,6 +1210,28 @@ Verbose statistics. Reports usage statis .ne 2 .mk .na +\fB\fBzpool labelclear\fR [\fB-f\fR] \fIdevice\fR +.ad +.sp .6 +.RS 4n +Removes ZFS label information from the specified device. The device must not be part of an active pool configuration. +.sp +.ne 2 +.mk +.na +\fB\fB-f\fR\fR +.ad +.RS 12n +.rt +Treat exported or foreign devices as inactive. +.RE + +.RE + +.sp +.ne 2 +.mk +.na \fB\fBzpool list\fR [\fB-H\fR] [\fB-o\fR \fIprops\fR[,...]] [\fIpool\fR] ...\fR .ad .sp .6 Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Mon Jul 18 03:00:59 2011 (r224170) +++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Mon Jul 18 03:18:06 2011 (r224171) @@ -57,6 +57,7 @@ static int zpool_do_destroy(int, char ** static int zpool_do_add(int, char **); static int zpool_do_remove(int, char **); +static int zpool_do_labelclear(int, char **); static int zpool_do_list(int, char **); static int zpool_do_iostat(int, char **); @@ -113,6 +114,7 @@ typedef enum { HELP_HISTORY, HELP_IMPORT, HELP_IOSTAT, + HELP_LABELCLEAR, HELP_LIST, HELP_OFFLINE, HELP_ONLINE, @@ -149,6 +151,8 @@ static zpool_command_t command_table[] = { "add", zpool_do_add, HELP_ADD }, { "remove", zpool_do_remove, HELP_REMOVE }, { NULL }, + { "labelclear", zpool_do_labelclear, HELP_LABELCLEAR }, + { NULL }, { "list", zpool_do_list, HELP_LIST }, { "iostat", zpool_do_iostat, HELP_IOSTAT }, { "status", zpool_do_status, HELP_STATUS }, @@ -215,6 +219,8 @@ get_usage(zpool_help_t idx) { case HELP_IOSTAT: return (gettext("\tiostat [-v] [-T d|u] [pool] ... [interval " "[count]]\n")); + case HELP_LABELCLEAR: + return (gettext("\tlabelclear [-f] \n")); case HELP_LIST: return (gettext("\tlist [-H] [-o property[,...]] " "[-T d|u] [pool] ... [interval [count]]\n")); @@ -561,6 +567,125 @@ zpool_do_remove(int argc, char **argv) } /* + * zpool labelclear + * + * Verifies that the vdev is not active and zeros out the label information + * on the device. + */ +int +zpool_do_labelclear(int argc, char **argv) +{ + char *vdev, *name; + int c, fd = -1, ret = 0; + pool_state_t state; + boolean_t inuse = B_FALSE; + boolean_t force = B_FALSE; + + /* check options */ + while ((c = getopt(argc, argv, "f")) != -1) { + switch (c) { + case 'f': + force = B_TRUE; + break; + default: + (void) fprintf(stderr, gettext("invalid option '%c'\n"), + optopt); + usage(B_FALSE); + } + } + + argc -= optind; + argv += optind; + + /* get vdev name */ + if (argc < 1) { + (void) fprintf(stderr, gettext("missing vdev device name\n")); + usage(B_FALSE); + } + + vdev = argv[0]; + if ((fd = open(vdev, O_RDWR)) < 0) { + (void) fprintf(stderr, gettext("Unable to open %s\n"), vdev); + return (B_FALSE); + } + + name = NULL; + if (zpool_in_use(g_zfs, fd, &state, &name, &inuse) != 0) { + if (force) + goto wipe_label; + + (void) fprintf(stderr, + gettext("Unable to determine pool state for %s\n" + "Use -f to force the clearing any label data\n"), vdev); + + return (1); + } + + if (inuse) { + switch (state) { + default: + case POOL_STATE_ACTIVE: + case POOL_STATE_SPARE: + case POOL_STATE_L2CACHE: + (void) fprintf(stderr, +gettext("labelclear operation failed.\n" + "\tVdev %s is a member (%s), of pool \"%s\".\n" + "\tTo remove label information from this device, export or destroy\n" + "\tthe pool, or remove %s from the configuration of this pool\n" + "\tand retry the labelclear operation\n"), + vdev, zpool_pool_state_to_name(state), name, vdev); + ret = 1; + goto errout; + + case POOL_STATE_EXPORTED: + if (force) + break; + + (void) fprintf(stderr, +gettext("labelclear operation failed.\n" + "\tVdev %s is a member of the exported pool \"%s\".\n" + "\tUse \"zpool labelclear -f %s\" to force the removal of label\n" + "\tinformation.\n"), + vdev, name, vdev); + ret = 1; + goto errout; + + case POOL_STATE_POTENTIALLY_ACTIVE: + if (force) + break; + + (void) fprintf(stderr, +gettext("labelclear operation failed.\n" + "\tVdev %s is a member of the pool \"%s\".\n" + "\tThis pool is unknown to this system, but may be active on\n" + "\tanother system. Use \'zpool labelclear -f %s\' to force the\n" + "\tremoval of label information.\n"), + vdev, name, vdev); + ret = 1; + goto errout; + + case POOL_STATE_DESTROYED: + /* inuse should never be set for a destoryed pool... */ + break; + } + } + +wipe_label: + if (zpool_clear_label(fd) != 0) { + (void) fprintf(stderr, + gettext("Label clear failed on vdev %s\n"), vdev); + ret = 1; + } + +errout: + close(fd); + if (name != NULL) + free(name); + + return (ret); +} + +/* * zpool create [-fn] [-o property=value] ... * [-O file-system-property=value] ... * [-R root] [-m mountpoint] ... Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Mon Jul 18 03:00:59 2011 (r224170) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Mon Jul 18 03:18:06 2011 (r224171) @@ -1084,8 +1084,8 @@ zpool_open_func(void *arg) /* * Given a file descriptor, clear (zero) the label information. This function - * is currently only used in the appliance stack as part of the ZFS sysevent - * module. + * is used in the appliance stack as part of the ZFS sysevent module and + * to implement the "zpool labelclear" command. */ int zpool_clear_label(int fd) From owner-svn-src-head@FreeBSD.ORG Mon Jul 18 07:16:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9468106566C; Mon, 18 Jul 2011 07:16:44 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A44858FC18; Mon, 18 Jul 2011 07:16:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6I7Gi59010726; Mon, 18 Jul 2011 07:16:44 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6I7GiWR010715; Mon, 18 Jul 2011 07:16:44 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201107180716.p6I7GiWR010715@svn.freebsd.org> From: Martin Matuska Date: Mon, 18 Jul 2011 07:16:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224174 - in head: cddl/contrib/opensolaris/cmd/zfs sys/cddl/contrib/opensolaris/common/acl sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cd... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jul 2011 07:16:44 -0000 Author: mm Date: Mon Jul 18 07:16:44 2011 New Revision: 224174 URL: http://svn.freebsd.org/changeset/base/224174 Log: Resurrect the ZFS "aclmode" property Change default of "aclmode" to "discard". Illumos-gate changeset: 13370:8c04143bd318 Obtained from: Illumos (Feature #742) MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 head/sys/cddl/contrib/opensolaris/common/acl/acl_common.c head/sys/cddl/contrib/opensolaris/common/acl/acl_common.h head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Jul 18 04:54:12 2011 (r224173) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Jul 18 07:16:44 2011 (r224174) @@ -6,6 +6,7 @@ .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. .\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with .\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] +.\" Copyright 2011 Nexenta Systems, Inc. All rights reserved. .\" Copyright 2011 by Delphix. All rights reserved. .TH zfs 1M "24 Sep 2009" "SunOS 5.11" "System Administration Commands" .SH NAME @@ -642,7 +643,7 @@ When the property value is set to \fBpas .ad .sp .6 .RS 4n -Controls how an \fBACL\fR is modified during \fBchmod\fR(2). A file system with an \fBaclmode\fR property of \fBdiscard\fR deletes all \fBACL\fR entries that do not represent the mode of the file. An \fBaclmode\fR property of \fBgroupmask\fR (the default) reduces user or group permissions. The permissions are reduced, such that they are no greater than the group permission bits, unless it is a user entry that has the same \fBUID\fR as the owner of the file or directory. In this case, the \fBACL\fR permissions are reduced so that they are no greater than owner permission bits. A file system with an \fBaclmode\fR property of \fBpassthrough\fR indicates that no changes are made to the \fBACL\fR other than generating the necessary \fBACL\fR entries to represent the new mode of the file or directory. +Controls how an \fBACL\fR is modified during \fBchmod\fR(2). A file system with an \fBaclmode\fR property of \fBdiscard\fR (the default) deletes all \fBACL\fR entries that do not represent the mode of the file. An \fBaclmode\fR property of \fBgroupmask\fR reduces permissions granted in all \fBALLOW\fR entries found in the \fBACL\fR such that they are no greater than the group permissions specified by \fBchmod\fR. A file system with an \fBaclmode\fR property of \fBpassthrough\fR indicates that no changes are made to the \fBACL\fR other than creating or updating the necessary \fBACL\fR entries to represent the new mode of the file or directory. .RE .sp @@ -2697,7 +2698,7 @@ pool/home/bob setuid on pool/home/bob readonly off default pool/home/bob zoned off default pool/home/bob snapdir hidden default -pool/home/bob aclmode groupmask default +pool/home/bob aclmode discard default pool/home/bob aclinherit restricted default pool/home/bob canmount on default pool/home/bob shareiscsi off default Modified: head/sys/cddl/contrib/opensolaris/common/acl/acl_common.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/acl/acl_common.c Mon Jul 18 04:54:12 2011 (r224173) +++ head/sys/cddl/contrib/opensolaris/common/acl/acl_common.c Mon Jul 18 07:16:44 2011 (r224174) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2011 Nexenta Systems, Inc. All rights reserved. */ #include @@ -376,7 +377,7 @@ access_mask_set(int haswriteperm, int ha * by nfsace, assuming aclent_t -> nfsace semantics. */ static uint32_t -mode_to_ace_access(mode_t mode, int isdir, int isowner, int isallow) +mode_to_ace_access(mode_t mode, boolean_t isdir, int isowner, int isallow) { uint32_t access = 0; int haswriteperm = 0; @@ -419,7 +420,7 @@ mode_to_ace_access(mode_t mode, int isdi access |= ACE_DELETE_CHILD; } /* exec */ - if (mode & 01) { + if (mode & S_IXOTH) { access |= ACE_EXECUTE; } @@ -670,7 +671,7 @@ out: } static int -convert_aent_to_ace(aclent_t *aclentp, int aclcnt, int isdir, +convert_aent_to_ace(aclent_t *aclentp, int aclcnt, boolean_t isdir, ace_t **retacep, int *retacecnt) { ace_t *acep; @@ -696,7 +697,7 @@ convert_aent_to_ace(aclent_t *aclentp, i dfaclcnt = aclcnt - i; } - if (dfaclcnt && isdir == 0) { + if (dfaclcnt && !isdir) { return (EINVAL); } @@ -734,7 +735,7 @@ convert_aent_to_ace(aclent_t *aclentp, i } static int -ace_mask_to_mode(uint32_t mask, o_mode_t *modep, int isdir) +ace_mask_to_mode(uint32_t mask, o_mode_t *modep, boolean_t isdir) { int error = 0; o_mode_t mode = 0; @@ -1031,7 +1032,7 @@ out: } static int -ace_allow_to_mode(uint32_t mask, o_mode_t *modep, int isdir) +ace_allow_to_mode(uint32_t mask, o_mode_t *modep, boolean_t isdir) { /* ACE_READ_ACL and ACE_READ_ATTRIBUTES must both be set */ if ((mask & (ACE_READ_ACL | ACE_READ_ATTRIBUTES)) != @@ -1044,7 +1045,7 @@ ace_allow_to_mode(uint32_t mask, o_mode_ static int acevals_to_aent(acevals_t *vals, aclent_t *dest, ace_list_t *list, - uid_t owner, gid_t group, int isdir) + uid_t owner, gid_t group, boolean_t isdir) { int error; uint32_t flips = ACE_POSIX_SUPPORTED_BITS; @@ -1084,7 +1085,7 @@ out: static int ace_list_to_aent(ace_list_t *list, aclent_t **aclentp, int *aclcnt, - uid_t owner, gid_t group, int isdir) + uid_t owner, gid_t group, boolean_t isdir) { int error = 0; aclent_t *aent, *result = NULL; @@ -1264,7 +1265,7 @@ acevals_compare(const void *va, const vo static int ln_ace_to_aent(ace_t *ace, int n, uid_t owner, gid_t group, aclent_t **aclentp, int *aclcnt, aclent_t **dfaclentp, int *dfaclcnt, - int isdir) + boolean_t isdir) { int error = 0; ace_t *acep; @@ -1459,7 +1460,7 @@ out: } static int -convert_ace_to_aent(ace_t *acebufp, int acecnt, int isdir, +convert_ace_to_aent(ace_t *acebufp, int acecnt, boolean_t isdir, uid_t owner, gid_t group, aclent_t **retaclentp, int *retaclcnt) { int error = 0; @@ -1501,7 +1502,7 @@ convert_ace_to_aent(ace_t *acebufp, int int -acl_translate(acl_t *aclp, int target_flavor, int isdir, uid_t owner, +acl_translate(acl_t *aclp, int target_flavor, boolean_t isdir, uid_t owner, gid_t group) { int aclcnt; @@ -1573,101 +1574,105 @@ out: } void -acl_trivial_access_masks(mode_t mode, uint32_t *allow0, uint32_t *deny1, - uint32_t *deny2, uint32_t *owner, uint32_t *group, uint32_t *everyone) +acl_trivial_access_masks(mode_t mode, boolean_t isdir, trivial_acl_t *masks) { - *deny1 = *deny2 = *allow0 = *group = 0; + uint32_t read_mask = ACE_READ_DATA; + uint32_t write_mask = ACE_WRITE_DATA|ACE_APPEND_DATA; + uint32_t execute_mask = ACE_EXECUTE; + (void) isdir; /* will need this later */ + + masks->deny1 = 0; if (!(mode & S_IRUSR) && (mode & (S_IRGRP|S_IROTH))) - *deny1 |= ACE_READ_DATA; + masks->deny1 |= read_mask; if (!(mode & S_IWUSR) && (mode & (S_IWGRP|S_IWOTH))) - *deny1 |= ACE_WRITE_DATA|ACE_APPEND_DATA; + masks->deny1 |= write_mask; if (!(mode & S_IXUSR) && (mode & (S_IXGRP|S_IXOTH))) - *deny1 |= ACE_EXECUTE; + masks->deny1 |= execute_mask; + masks->deny2 = 0; if (!(mode & S_IRGRP) && (mode & S_IROTH)) - *deny2 = ACE_READ_DATA; + masks->deny2 |= read_mask; if (!(mode & S_IWGRP) && (mode & S_IWOTH)) - *deny2 |= ACE_WRITE_DATA|ACE_APPEND_DATA; + masks->deny2 |= write_mask; if (!(mode & S_IXGRP) && (mode & S_IXOTH)) - *deny2 |= ACE_EXECUTE; + masks->deny2 |= execute_mask; + masks->allow0 = 0; if ((mode & S_IRUSR) && (!(mode & S_IRGRP) && (mode & S_IROTH))) - *allow0 |= ACE_READ_DATA; + masks->allow0 |= read_mask; if ((mode & S_IWUSR) && (!(mode & S_IWGRP) && (mode & S_IWOTH))) - *allow0 |= ACE_WRITE_DATA|ACE_APPEND_DATA; + masks->allow0 |= write_mask; if ((mode & S_IXUSR) && (!(mode & S_IXGRP) && (mode & S_IXOTH))) - *allow0 |= ACE_EXECUTE; + masks->allow0 |= execute_mask; - *owner = ACE_WRITE_ATTRIBUTES|ACE_WRITE_OWNER|ACE_WRITE_ACL| + masks->owner = ACE_WRITE_ATTRIBUTES|ACE_WRITE_OWNER|ACE_WRITE_ACL| ACE_WRITE_NAMED_ATTRS|ACE_READ_ACL|ACE_READ_ATTRIBUTES| ACE_READ_NAMED_ATTRS|ACE_SYNCHRONIZE; if (mode & S_IRUSR) - *owner |= ACE_READ_DATA; + masks->owner |= read_mask; if (mode & S_IWUSR) - *owner |= ACE_WRITE_DATA|ACE_APPEND_DATA; + masks->owner |= write_mask; if (mode & S_IXUSR) - *owner |= ACE_EXECUTE; + masks->owner |= execute_mask; - *group = ACE_READ_ACL|ACE_READ_ATTRIBUTES| ACE_READ_NAMED_ATTRS| + masks->group = ACE_READ_ACL|ACE_READ_ATTRIBUTES|ACE_READ_NAMED_ATTRS| ACE_SYNCHRONIZE; if (mode & S_IRGRP) - *group |= ACE_READ_DATA; + masks->group |= read_mask; if (mode & S_IWGRP) - *group |= ACE_WRITE_DATA|ACE_APPEND_DATA; + masks->group |= write_mask; if (mode & S_IXGRP) - *group |= ACE_EXECUTE; + masks->group |= execute_mask; - *everyone = ACE_READ_ACL|ACE_READ_ATTRIBUTES| ACE_READ_NAMED_ATTRS| + masks->everyone = ACE_READ_ACL|ACE_READ_ATTRIBUTES|ACE_READ_NAMED_ATTRS| ACE_SYNCHRONIZE; if (mode & S_IROTH) - *everyone |= ACE_READ_DATA; + masks->everyone |= read_mask; if (mode & S_IWOTH) - *everyone |= ACE_WRITE_DATA|ACE_APPEND_DATA; + masks->everyone |= write_mask; if (mode & S_IXOTH) - *everyone |= ACE_EXECUTE; + masks->everyone |= execute_mask; } int -acl_trivial_create(mode_t mode, ace_t **acl, int *count) +acl_trivial_create(mode_t mode, boolean_t isdir, ace_t **acl, int *count) { - uint32_t deny1, deny2; - uint32_t allow0; - uint32_t owner, group, everyone; - int index = 0; + int index = 0; int error; + trivial_acl_t masks; *count = 3; - acl_trivial_access_masks(mode, &allow0, &deny1, &deny2, &owner, &group, - &everyone); + acl_trivial_access_masks(mode, isdir, &masks); - if (allow0) + if (masks.allow0) (*count)++; - if (deny1) + if (masks.deny1) (*count)++; - if (deny2) + if (masks.deny2) (*count)++; if ((error = cacl_malloc((void **)acl, *count * sizeof (ace_t))) != 0) return (error); - if (allow0) { - SET_ACE(acl, index, -1, allow0, ACE_ACCESS_ALLOWED_ACE_TYPE, - ACE_OWNER); - } - if (deny1) { - SET_ACE(acl, index, -1, deny1, ACE_ACCESS_DENIED_ACE_TYPE, - ACE_OWNER); - } - if (deny2) { - SET_ACE(acl, index, -1, deny2, ACE_ACCESS_DENIED_ACE_TYPE, - ACE_GROUP|ACE_IDENTIFIER_GROUP); - } - - SET_ACE(acl, index, -1, owner, ACE_ACCESS_ALLOWED_ACE_TYPE, ACE_OWNER); - SET_ACE(acl, index, -1, group, ACE_ACCESS_ALLOWED_ACE_TYPE, + if (masks.allow0) { + SET_ACE(acl, index, -1, masks.allow0, + ACE_ACCESS_ALLOWED_ACE_TYPE, ACE_OWNER); + } + if (masks.deny1) { + SET_ACE(acl, index, -1, masks.deny1, + ACE_ACCESS_DENIED_ACE_TYPE, ACE_OWNER); + } + if (masks.deny2) { + SET_ACE(acl, index, -1, masks.deny2, + ACE_ACCESS_DENIED_ACE_TYPE, ACE_GROUP|ACE_IDENTIFIER_GROUP); + } + + SET_ACE(acl, index, -1, masks.owner, ACE_ACCESS_ALLOWED_ACE_TYPE, + ACE_OWNER); + SET_ACE(acl, index, -1, masks.group, ACE_ACCESS_ALLOWED_ACE_TYPE, ACE_IDENTIFIER_GROUP|ACE_GROUP); - SET_ACE(acl, index, -1, everyone, ACE_ACCESS_ALLOWED_ACE_TYPE, + SET_ACE(acl, index, -1, masks.everyone, ACE_ACCESS_ALLOWED_ACE_TYPE, ACE_EVERYONE); return (0); Modified: head/sys/cddl/contrib/opensolaris/common/acl/acl_common.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/acl/acl_common.h Mon Jul 18 04:54:12 2011 (r224173) +++ head/sys/cddl/contrib/opensolaris/common/acl/acl_common.h Mon Jul 18 07:16:44 2011 (r224174) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2011 Nexenta Systems, Inc. All rights reserved. */ #ifndef _ACL_COMMON_H @@ -33,7 +34,14 @@ extern "C" { #endif -extern ace_t trivial_acl[6]; +typedef struct trivial_acl { + uint32_t allow0; /* allow mask for bits only in owner */ + uint32_t deny1; /* deny mask for bits not in owner */ + uint32_t deny2; /* deny mask for bits not in group */ + uint32_t owner; /* allow mask matching mode */ + uint32_t group; /* allow mask matching mode */ + uint32_t everyone; /* allow mask matching mode */ +} trivial_acl_t; extern int acltrivial(const char *); extern void adjust_ace_pair(ace_t *pair, mode_t mode); @@ -45,14 +53,14 @@ extern int ace_trivial_common(void *, in #if !defined(_KERNEL) extern acl_t *acl_alloc(acl_type_t); extern void acl_free(acl_t *aclp); -extern int acl_translate(acl_t *aclp, int target_flavor, - int isdir, uid_t owner, gid_t group); +extern int acl_translate(acl_t *aclp, int target_flavor, boolean_t isdir, + uid_t owner, gid_t group); #endif /* !_KERNEL */ void ksort(caddr_t v, int n, int s, int (*f)()); int cmp2acls(void *a, void *b); -int acl_trivial_create(mode_t mode, ace_t **acl, int *count); -void acl_trivial_access_masks(mode_t mode, uint32_t *allow0, uint32_t *deny1, - uint32_t *deny2, uint32_t *owner, uint32_t *group, uint32_t *everyone); +int acl_trivial_create(mode_t mode, boolean_t isdir, ace_t **acl, int *count); +void acl_trivial_access_masks(mode_t mode, boolean_t isdir, + trivial_acl_t *masks); #ifdef __cplusplus } Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Mon Jul 18 04:54:12 2011 (r224173) +++ head/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Mon Jul 18 07:16:44 2011 (r224174) @@ -105,6 +105,13 @@ zfs_prop_init(void) { NULL } }; + static zprop_index_t acl_mode_table[] = { + { "discard", ZFS_ACL_DISCARD }, + { "groupmask", ZFS_ACL_GROUPMASK }, + { "passthrough", ZFS_ACL_PASSTHROUGH }, + { NULL } + }; + static zprop_index_t acl_inherit_table[] = { { "discard", ZFS_ACL_DISCARD }, { "noallow", ZFS_ACL_NOALLOW }, @@ -208,6 +215,9 @@ zfs_prop_init(void) zprop_register_index(ZFS_PROP_SNAPDIR, "snapdir", ZFS_SNAPDIR_HIDDEN, PROP_INHERIT, ZFS_TYPE_FILESYSTEM, "hidden | visible", "SNAPDIR", snapdir_table); + zprop_register_index(ZFS_PROP_ACLMODE, "aclmode", ZFS_ACL_DISCARD, + PROP_INHERIT, ZFS_TYPE_FILESYSTEM, + "discard | groupmask | passthrough", "ACLMODE", acl_mode_table); zprop_register_index(ZFS_PROP_ACLINHERIT, "aclinherit", ZFS_ACL_RESTRICTED, PROP_INHERIT, ZFS_TYPE_FILESYSTEM, "discard | noallow | restricted | passthrough | passthrough-x", @@ -374,13 +384,6 @@ zfs_prop_init(void) zprop_register_hidden(ZFS_PROP_OBJSETID, "objsetid", PROP_TYPE_NUMBER, PROP_READONLY, ZFS_TYPE_DATASET, "OBJSETID"); - /* - * Property to be removed once libbe is integrated - */ - zprop_register_hidden(ZFS_PROP_PRIVATE, "priv_prop", - PROP_TYPE_NUMBER, PROP_READONLY, ZFS_TYPE_FILESYSTEM, - "PRIV_PROP"); - /* oddball properties */ zprop_register_impl(ZFS_PROP_CREATION, "creation", PROP_TYPE_NUMBER, 0, NULL, PROP_READONLY, ZFS_TYPE_DATASET, Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h Mon Jul 18 04:54:12 2011 (r224173) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h Mon Jul 18 07:16:44 2011 (r224174) @@ -217,7 +217,7 @@ int zfs_fastaccesschk_execute(struct zno extern int zfs_zaccess_rwx(struct znode *, mode_t, int, cred_t *); extern int zfs_zaccess_unix(struct znode *, mode_t, cred_t *); extern int zfs_acl_access(struct znode *, int, cred_t *); -void zfs_acl_chmod_setattr(struct znode *, zfs_acl_t **, uint64_t); +int zfs_acl_chmod_setattr(struct znode *, zfs_acl_t **, uint64_t); int zfs_zaccess_delete(struct znode *, struct znode *, cred_t *); int zfs_zaccess_rename(struct znode *, struct znode *, struct znode *, struct znode *, cred_t *cr); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h Mon Jul 18 04:54:12 2011 (r224173) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h Mon Jul 18 07:16:44 2011 (r224174) @@ -55,6 +55,7 @@ struct zfsvfs { boolean_t z_fuid_dirty; /* need to sync fuid table ? */ struct zfs_fuid_info *z_fuid_replay; /* fuid info for replay */ zilog_t *z_log; /* intent log pointer */ + uint_t z_acl_mode; /* acl chmod/mode behavior */ uint_t z_acl_inherit; /* acl inheritance behavior */ zfs_case_t z_case; /* case-sense */ boolean_t z_utf8; /* utf8-only */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Mon Jul 18 04:54:12 2011 (r224173) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Mon Jul 18 07:16:44 2011 (r224174) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2011 Nexenta Systems, Inc. All rights reserved. */ #include @@ -1327,75 +1328,8 @@ zfs_aclset_common(znode_t *zp, zfs_acl_t return (sa_bulk_update(zp->z_sa_hdl, bulk, count, tx)); } -/* - * Update access mask for prepended ACE - * - * This applies the "groupmask" value for aclmode property. - */ static void -zfs_acl_prepend_fixup(zfs_acl_t *aclp, void *acep, void *origacep, - mode_t mode, uint64_t owner) -{ - int rmask, wmask, xmask; - int user_ace; - uint16_t aceflags; - uint32_t origmask, acepmask; - uint64_t fuid; - - aceflags = aclp->z_ops.ace_flags_get(acep); - fuid = aclp->z_ops.ace_who_get(acep); - origmask = aclp->z_ops.ace_mask_get(origacep); - acepmask = aclp->z_ops.ace_mask_get(acep); - - user_ace = (!(aceflags & - (ACE_OWNER|ACE_GROUP|ACE_IDENTIFIER_GROUP))); - - if (user_ace && (fuid == owner)) { - rmask = S_IRUSR; - wmask = S_IWUSR; - xmask = S_IXUSR; - } else { - rmask = S_IRGRP; - wmask = S_IWGRP; - xmask = S_IXGRP; - } - - if (origmask & ACE_READ_DATA) { - if (mode & rmask) { - acepmask &= ~ACE_READ_DATA; - } else { - acepmask |= ACE_READ_DATA; - } - } - - if (origmask & ACE_WRITE_DATA) { - if (mode & wmask) { - acepmask &= ~ACE_WRITE_DATA; - } else { - acepmask |= ACE_WRITE_DATA; - } - } - - if (origmask & ACE_APPEND_DATA) { - if (mode & wmask) { - acepmask &= ~ACE_APPEND_DATA; - } else { - acepmask |= ACE_APPEND_DATA; - } - } - - if (origmask & ACE_EXECUTE) { - if (mode & xmask) { - acepmask &= ~ACE_EXECUTE; - } else { - acepmask |= ACE_EXECUTE; - } - } - aclp->z_ops.ace_mask_set(acep, acepmask); -} - -static void -zfs_acl_chmod(zfsvfs_t *zfsvfs, uint64_t mode, zfs_acl_t *aclp) +zfs_acl_chmod(vtype_t vtype, uint64_t mode, boolean_t trim, zfs_acl_t *aclp) { void *acep = NULL; uint64_t who; @@ -1407,30 +1341,31 @@ zfs_acl_chmod(zfsvfs_t *zfsvfs, uint64_t zfs_acl_node_t *newnode; size_t abstract_size = aclp->z_ops.ace_abstract_size(); void *zacep; - uint32_t owner, group, everyone; - uint32_t deny1, deny2, allow0; + boolean_t isdir; + trivial_acl_t masks; new_count = new_bytes = 0; - acl_trivial_access_masks((mode_t)mode, &allow0, &deny1, &deny2, - &owner, &group, &everyone); + isdir = (vtype == VDIR); + + acl_trivial_access_masks((mode_t)mode, isdir, &masks); newnode = zfs_acl_node_alloc((abstract_size * 6) + aclp->z_acl_bytes); zacep = newnode->z_acldata; - if (allow0) { - zfs_set_ace(aclp, zacep, allow0, ALLOW, -1, ACE_OWNER); + if (masks.allow0) { + zfs_set_ace(aclp, zacep, masks.allow0, ALLOW, -1, ACE_OWNER); zacep = (void *)((uintptr_t)zacep + abstract_size); new_count++; new_bytes += abstract_size; - } if (deny1) { - zfs_set_ace(aclp, zacep, deny1, DENY, -1, ACE_OWNER); + } if (masks.deny1) { + zfs_set_ace(aclp, zacep, masks.deny1, DENY, -1, ACE_OWNER); zacep = (void *)((uintptr_t)zacep + abstract_size); new_count++; new_bytes += abstract_size; } - if (deny2) { - zfs_set_ace(aclp, zacep, deny2, DENY, -1, OWNING_GROUP); + if (masks.deny2) { + zfs_set_ace(aclp, zacep, masks.deny2, DENY, -1, OWNING_GROUP); zacep = (void *)((uintptr_t)zacep + abstract_size); new_count++; new_bytes += abstract_size; @@ -1449,10 +1384,17 @@ zfs_acl_chmod(zfsvfs_t *zfsvfs, uint64_t continue; } + /* + * If this ACL has any inheritable ACEs, mark that in + * the hints (which are later masked into the pflags) + * so create knows to do inheritance. + */ + if (isdir && (inherit_flags & + (ACE_FILE_INHERIT_ACE|ACE_DIRECTORY_INHERIT_ACE))) + aclp->z_hints |= ZFS_INHERIT_ACE; + if ((type != ALLOW && type != DENY) || (inherit_flags & ACE_INHERIT_ONLY_ACE)) { - if (inherit_flags) - aclp->z_hints |= ZFS_INHERIT_ACE; switch (type) { case ACE_ACCESS_ALLOWED_OBJECT_ACE_TYPE: case ACE_ACCESS_DENIED_OBJECT_ACE_TYPE: @@ -1465,20 +1407,13 @@ zfs_acl_chmod(zfsvfs_t *zfsvfs, uint64_t /* * Limit permissions to be no greater than - * group permissions + * group permissions. + * The "aclinherit" and "aclmode" properties + * affect policy for create and chmod(2), + * respectively. */ - if (type == ALLOW && zfsvfs->z_acl_inherit == ZFS_ACL_RESTRICTED) { - if (!(mode & S_IRGRP)) - access_mask &= ~ACE_READ_DATA; - if (!(mode & S_IWGRP)) - access_mask &= - ~(ACE_WRITE_DATA|ACE_APPEND_DATA); - if (!(mode & S_IXGRP)) - access_mask &= ~ACE_EXECUTE; - access_mask &= - ~(ACE_WRITE_OWNER|ACE_WRITE_ACL| - ACE_WRITE_ATTRIBUTES|ACE_WRITE_NAMED_ATTRS); - } + if ((type == ALLOW) && trim) + access_mask &= masks.group; } zfs_set_ace(aclp, zacep, access_mask, type, who, iflags); ace_size = aclp->z_ops.ace_size(acep); @@ -1486,11 +1421,11 @@ zfs_acl_chmod(zfsvfs_t *zfsvfs, uint64_t new_count++; new_bytes += ace_size; } - zfs_set_ace(aclp, zacep, owner, 0, -1, ACE_OWNER); + zfs_set_ace(aclp, zacep, masks.owner, 0, -1, ACE_OWNER); zacep = (void *)((uintptr_t)zacep + abstract_size); - zfs_set_ace(aclp, zacep, group, 0, -1, OWNING_GROUP); + zfs_set_ace(aclp, zacep, masks.group, 0, -1, OWNING_GROUP); zacep = (void *)((uintptr_t)zacep + abstract_size); - zfs_set_ace(aclp, zacep, everyone, 0, -1, ACE_EVERYONE); + zfs_set_ace(aclp, zacep, masks.everyone, 0, -1, ACE_EVERYONE); new_count += 3; new_bytes += abstract_size * 3; @@ -1502,17 +1437,27 @@ zfs_acl_chmod(zfsvfs_t *zfsvfs, uint64_t list_insert_tail(&aclp->z_acl, newnode); } -void +int zfs_acl_chmod_setattr(znode_t *zp, zfs_acl_t **aclp, uint64_t mode) { + int error = 0; + mutex_enter(&zp->z_acl_lock); mutex_enter(&zp->z_lock); - *aclp = zfs_acl_alloc(zfs_acl_version_zp(zp)); - (*aclp)->z_hints = zp->z_pflags & V4_ACL_WIDE_FLAGS; - zfs_acl_chmod(zp->z_zfsvfs, mode, *aclp); + if (zp->z_zfsvfs->z_acl_mode == ZFS_ACL_DISCARD) + *aclp = zfs_acl_alloc(zfs_acl_version_zp(zp)); + else + error = zfs_acl_node_read(zp, B_TRUE, aclp, B_TRUE); + + if (error == 0) { + (*aclp)->z_hints = zp->z_pflags & V4_ACL_WIDE_FLAGS; + zfs_acl_chmod(ZTOV(zp)->v_type, mode, + (zp->z_zfsvfs->z_acl_mode == ZFS_ACL_GROUPMASK), *aclp); + } mutex_exit(&zp->z_lock); mutex_exit(&zp->z_acl_lock); - ASSERT(*aclp); + + return (error); } /* @@ -1764,8 +1709,8 @@ zfs_acl_ids_create(znode_t *dzp, int fla if (acl_ids->z_aclp == NULL) { mutex_enter(&dzp->z_acl_lock); mutex_enter(&dzp->z_lock); - if (!(flag & IS_ROOT_NODE) && (ZTOV(dzp)->v_type == VDIR && - (dzp->z_pflags & ZFS_INHERIT_ACE)) && + if (!(flag & IS_ROOT_NODE) && + (dzp->z_pflags & ZFS_INHERIT_ACE) && !(dzp->z_pflags & ZFS_XATTR)) { VERIFY(0 == zfs_acl_node_read(dzp, B_TRUE, &paclp, B_FALSE)); @@ -1782,7 +1727,9 @@ zfs_acl_ids_create(znode_t *dzp, int fla if (need_chmod) { acl_ids->z_aclp->z_hints |= (vap->va_type == VDIR) ? ZFS_ACL_AUTO_INHERIT : 0; - zfs_acl_chmod(zfsvfs, acl_ids->z_mode, acl_ids->z_aclp); + zfs_acl_chmod(vap->va_type, acl_ids->z_mode, + (zfsvfs->z_acl_inherit == ZFS_ACL_RESTRICTED), + acl_ids->z_aclp); } } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Mon Jul 18 04:54:12 2011 (r224173) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Mon Jul 18 07:16:44 2011 (r224174) @@ -364,6 +364,14 @@ vscan_changed_cb(void *arg, uint64_t new } static void +acl_mode_changed_cb(void *arg, uint64_t newval) +{ + zfsvfs_t *zfsvfs = arg; + + zfsvfs->z_acl_mode = newval; +} + +static void acl_inherit_changed_cb(void *arg, uint64_t newval) { zfsvfs_t *zfsvfs = arg; @@ -488,6 +496,8 @@ zfs_register_callbacks(vfs_t *vfsp) error = error ? error : dsl_prop_register(ds, "snapdir", snapdir_changed_cb, zfsvfs); error = error ? error : dsl_prop_register(ds, + "aclmode", acl_mode_changed_cb, zfsvfs); + error = error ? error : dsl_prop_register(ds, "aclinherit", acl_inherit_changed_cb, zfsvfs); error = error ? error : dsl_prop_register(ds, "vscan", vscan_changed_cb, zfsvfs); @@ -525,6 +535,7 @@ unregister: (void) dsl_prop_unregister(ds, "setuid", setuid_changed_cb, zfsvfs); (void) dsl_prop_unregister(ds, "exec", exec_changed_cb, zfsvfs); (void) dsl_prop_unregister(ds, "snapdir", snapdir_changed_cb, zfsvfs); + (void) dsl_prop_unregister(ds, "aclmode", acl_mode_changed_cb, zfsvfs); (void) dsl_prop_unregister(ds, "aclinherit", acl_inherit_changed_cb, zfsvfs); (void) dsl_prop_unregister(ds, "vscan", vscan_changed_cb, zfsvfs); @@ -1202,6 +1213,9 @@ zfs_unregister_callbacks(zfsvfs_t *zfsvf VERIFY(dsl_prop_unregister(ds, "snapdir", snapdir_changed_cb, zfsvfs) == 0); + VERIFY(dsl_prop_unregister(ds, "aclmode", acl_mode_changed_cb, + zfsvfs) == 0); + VERIFY(dsl_prop_unregister(ds, "aclinherit", acl_inherit_changed_cb, zfsvfs) == 0); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Jul 18 04:54:12 2011 (r224173) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Jul 18 07:16:44 2011 (r224174) @@ -3223,7 +3223,8 @@ top: uint64_t acl_obj; new_mode = (pmode & S_IFMT) | (vap->va_mode & ~S_IFMT); - zfs_acl_chmod_setattr(zp, &aclp, new_mode); + if (err = zfs_acl_chmod_setattr(zp, &aclp, new_mode)) + goto out; mutex_enter(&zp->z_lock); if (!zp->z_is_sa && ((acl_obj = zfs_external_acl(zp)) != 0)) { Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Mon Jul 18 04:54:12 2011 (r224173) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Mon Jul 18 07:16:44 2011 (r224174) @@ -90,7 +90,7 @@ typedef enum { ZFS_PROP_READONLY, ZFS_PROP_ZONED, ZFS_PROP_SNAPDIR, - ZFS_PROP_PRIVATE, /* not exposed to user, temporary */ + ZFS_PROP_ACLMODE, ZFS_PROP_ACLINHERIT, ZFS_PROP_CREATETXG, /* not exposed to the user */ ZFS_PROP_NAME, /* not exposed to the user */ From owner-svn-src-head@FreeBSD.ORG Mon Jul 18 07:25:19 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2CE7106564A; Mon, 18 Jul 2011 07:25:18 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 9487B8FC0C; Mon, 18 Jul 2011 07:25:17 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id KAA18144; Mon, 18 Jul 2011 10:25:15 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1QiiCY-000JmO-W4; Mon, 18 Jul 2011 10:25:15 +0300 Message-ID: <4E23DFD9.5070401@FreeBSD.org> Date: Mon, 18 Jul 2011 10:25:13 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:5.0) Gecko/20110706 Thunderbird/5.0 MIME-Version: 1.0 To: "Justin T. Gibbs" References: <201107180213.p6I2DL2J000849@svn.freebsd.org> In-Reply-To: <201107180213.p6I2DL2J000849@svn.freebsd.org> X-Enigmail-Version: 1.2pre Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r224169 - in head/cddl/contrib/opensolaris: cmd/zpool lib/libzfs/common X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jul 2011 07:25:19 -0000 on 18/07/2011 05:13 Justin T. Gibbs said the following: > MFD after: 1 week Assuming this is not a typo, just out of curiosity, what's 'D'? -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Mon Jul 18 08:10:50 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D5EF10656A9; Mon, 18 Jul 2011 08:10:50 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F004F8FC15; Mon, 18 Jul 2011 08:10:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6I8AnUU012338; Mon, 18 Jul 2011 08:10:49 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6I8AnCC012336; Mon, 18 Jul 2011 08:10:49 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201107180810.p6I8AnCC012336@svn.freebsd.org> From: Doug Barton Date: Mon, 18 Jul 2011 08:10:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224175 - in head/usr.sbin: . named.reload X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jul 2011 08:10:50 -0000 Author: dougb Date: Mon Jul 18 08:10:49 2011 New Revision: 224175 URL: http://svn.freebsd.org/changeset/base/224175 Log: The named.reload script is no longer useful in the age of rc.d Deleted: head/usr.sbin/named.reload/ Modified: head/usr.sbin/Makefile Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Mon Jul 18 07:16:44 2011 (r224174) +++ head/usr.sbin/Makefile Mon Jul 18 08:10:49 2011 (r224175) @@ -133,7 +133,6 @@ SUBDIR+= named SUBDIR+= named-checkconf SUBDIR+= named-checkzone SUBDIR+= named-journalprint -SUBDIR+= named.reload SUBDIR+= nsec3hash SUBDIR+= rndc SUBDIR+= rndc-confgen From owner-svn-src-head@FreeBSD.ORG Mon Jul 18 08:29:49 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B5A4106564A; Mon, 18 Jul 2011 08:29:49 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 875CF8FC12; Mon, 18 Jul 2011 08:29:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6I8Tn7Z013042; Mon, 18 Jul 2011 08:29:49 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6I8TnxC013033; Mon, 18 Jul 2011 08:29:49 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201107180829.p6I8TnxC013033@svn.freebsd.org> From: Martin Matuska Date: Mon, 18 Jul 2011 08:29:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224177 - in head: cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jul 2011 08:29:49 -0000 Author: mm Date: Mon Jul 18 08:29:49 2011 New Revision: 224177 URL: http://svn.freebsd.org/changeset/base/224177 Log: ZFS tries to allocate blocks evenly across all devices. This means when devices are imbalanced zfs will lots of CPU searching for space on devices which tend to be pretty full. It should instead fail quickly on the full devices and move onto devices which have more availability. New loader tunable: vfs.zfs.mg_alloc_failures (min = 8) Illumos-gate changeset: 13379:4df42cc92254 Obtained from: Illumos (Bug #1051) MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Jul 18 08:27:40 2011 (r224176) +++ head/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Jul 18 08:29:49 2011 (r224177) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011 by Delphix. All rights reserved. */ /* @@ -5137,6 +5138,7 @@ ztest_run(ztest_shared_t *zs) */ kernel_init(FREAD | FWRITE); VERIFY(spa_open(zs->zs_pool, &spa, FTAG) == 0); + spa->spa_debug = B_TRUE; zs->zs_spa = spa; spa->spa_dedup_ditto = 2 * ZIO_DEDUPDITTO_MIN; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Mon Jul 18 08:27:40 2011 (r224176) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Mon Jul 18 08:29:49 2011 (r224177) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011 by Delphix. All rights reserved. */ #include @@ -30,10 +31,35 @@ #include #include +/* + * Allow allocations to switch to gang blocks quickly. We do this to + * avoid having to load lots of space_maps in a given txg. There are, + * however, some cases where we want to avoid "fast" ganging and instead + * we want to do an exhaustive search of all metaslabs on this device. + * Currently we don't allow any gang or dump device related allocations + * to "fast" gang. + */ +#define CAN_FASTGANG(flags) \ + (!((flags) & (METASLAB_GANG_CHILD | METASLAB_GANG_HEADER | \ + METASLAB_GANG_AVOID))) + uint64_t metaslab_aliquot = 512ULL << 10; uint64_t metaslab_gang_bang = SPA_MAXBLOCKSIZE + 1; /* force gang blocks */ /* + * This value defines the number of allowed allocation failures per vdev. + * If a device reaches this threshold in a given txg then we consider skipping + * allocations on that device. + */ +int zfs_mg_alloc_failures = 0; + +SYSCTL_DECL(_vfs_zfs); +SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_alloc_failures, CTLFLAG_RDTUN, + &zfs_mg_alloc_failures, 0, + "Number of allowed allocation failures per vdev"); +TUNABLE_INT("vfs.zfs.mg_alloc_failures", &zfs_mg_alloc_failures); + +/* * Metaslab debugging: when set, keeps all space maps in core to verify frees. */ static int metaslab_debug = 0; @@ -671,7 +697,7 @@ static space_map_ops_t metaslab_ndf_ops metaslab_ndf_fragmented }; -space_map_ops_t *zfs_metaslab_ops = &metaslab_ndf_ops; +space_map_ops_t *zfs_metaslab_ops = &metaslab_df_ops; /* * ========================================================================== @@ -844,7 +870,7 @@ metaslab_prefetch(metaslab_group_t *mg) } static int -metaslab_activate(metaslab_t *msp, uint64_t activation_weight, uint64_t size) +metaslab_activate(metaslab_t *msp, uint64_t activation_weight) { metaslab_group_t *mg = msp->ms_group; space_map_t *sm = &msp->ms_map; @@ -877,13 +903,6 @@ metaslab_activate(metaslab_t *msp, uint6 mutex_exit(&mg->mg_lock); } - /* - * If we were able to load the map then make sure - * that this map is still able to satisfy our request. - */ - if (msp->ms_weight < size) - return (ENOSPC); - metaslab_group_sort(msp->ms_group, msp, msp->ms_weight | activation_weight); } @@ -1099,6 +1118,7 @@ void metaslab_sync_reassess(metaslab_group_t *mg) { vdev_t *vd = mg->mg_vd; + int64_t failures = mg->mg_alloc_failures; /* * Re-evaluate all metaslabs which have lower offsets than the @@ -1115,6 +1135,8 @@ metaslab_sync_reassess(metaslab_group_t mutex_exit(&msp->ms_lock); } + atomic_add_64(&mg->mg_alloc_failures, -failures); + /* * Prefetch the next potential metaslabs */ @@ -1139,9 +1161,10 @@ metaslab_distance(metaslab_t *msp, dva_t } static uint64_t -metaslab_group_alloc(metaslab_group_t *mg, uint64_t size, uint64_t txg, - uint64_t min_distance, dva_t *dva, int d) +metaslab_group_alloc(metaslab_group_t *mg, uint64_t psize, uint64_t asize, + uint64_t txg, uint64_t min_distance, dva_t *dva, int d, int flags) { + spa_t *spa = mg->mg_vd->vdev_spa; metaslab_t *msp = NULL; uint64_t offset = -1ULL; avl_tree_t *t = &mg->mg_metaslab_tree; @@ -1162,11 +1185,17 @@ metaslab_group_alloc(metaslab_group_t *m mutex_enter(&mg->mg_lock); for (msp = avl_first(t); msp; msp = AVL_NEXT(t, msp)) { - if (msp->ms_weight < size) { + if (msp->ms_weight < asize) { + spa_dbgmsg(spa, "%s: failed to meet weight " + "requirement: vdev %llu, txg %llu, mg %p, " + "msp %p, psize %llu, asize %llu, " + "failures %llu, weight %llu", + spa_name(spa), mg->mg_vd->vdev_id, txg, + mg, msp, psize, asize, + mg->mg_alloc_failures, msp->ms_weight); mutex_exit(&mg->mg_lock); return (-1ULL); } - was_active = msp->ms_weight & METASLAB_ACTIVE_MASK; if (activation_weight == METASLAB_WEIGHT_PRIMARY) break; @@ -1185,6 +1214,25 @@ metaslab_group_alloc(metaslab_group_t *m if (msp == NULL) return (-1ULL); + /* + * If we've already reached the allowable number of failed + * allocation attempts on this metaslab group then we + * consider skipping it. We skip it only if we're allowed + * to "fast" gang, the physical size is larger than + * a gang block, and we're attempting to allocate from + * the primary metaslab. + */ + if (mg->mg_alloc_failures > zfs_mg_alloc_failures && + CAN_FASTGANG(flags) && psize > SPA_GANGBLOCKSIZE && + activation_weight == METASLAB_WEIGHT_PRIMARY) { + spa_dbgmsg(spa, "%s: skipping metaslab group: " + "vdev %llu, txg %llu, mg %p, psize %llu, " + "asize %llu, failures %llu", spa_name(spa), + mg->mg_vd->vdev_id, txg, mg, psize, asize, + mg->mg_alloc_failures); + return (-1ULL); + } + mutex_enter(&msp->ms_lock); /* @@ -1193,7 +1241,7 @@ metaslab_group_alloc(metaslab_group_t *m * another thread may have changed the weight while we * were blocked on the metaslab lock. */ - if (msp->ms_weight < size || (was_active && + if (msp->ms_weight < asize || (was_active && !(msp->ms_weight & METASLAB_ACTIVE_MASK) && activation_weight == METASLAB_WEIGHT_PRIMARY)) { mutex_exit(&msp->ms_lock); @@ -1208,14 +1256,16 @@ metaslab_group_alloc(metaslab_group_t *m continue; } - if (metaslab_activate(msp, activation_weight, size) != 0) { + if (metaslab_activate(msp, activation_weight) != 0) { mutex_exit(&msp->ms_lock); continue; } - if ((offset = space_map_alloc(&msp->ms_map, size)) != -1ULL) + if ((offset = space_map_alloc(&msp->ms_map, asize)) != -1ULL) break; + atomic_inc_64(&mg->mg_alloc_failures); + metaslab_passivate(msp, space_map_maxsize(&msp->ms_map)); mutex_exit(&msp->ms_lock); @@ -1224,7 +1274,7 @@ metaslab_group_alloc(metaslab_group_t *m if (msp->ms_allocmap[txg & TXG_MASK].sm_space == 0) vdev_dirty(mg->mg_vd, VDD_METASLAB, msp, txg); - space_map_add(&msp->ms_allocmap[txg & TXG_MASK], offset, size); + space_map_add(&msp->ms_allocmap[txg & TXG_MASK], offset, asize); mutex_exit(&msp->ms_lock); @@ -1351,7 +1401,8 @@ top: asize = vdev_psize_to_asize(vd, psize); ASSERT(P2PHASE(asize, 1ULL << vd->vdev_ashift) == 0); - offset = metaslab_group_alloc(mg, asize, txg, distance, dva, d); + offset = metaslab_group_alloc(mg, psize, asize, txg, distance, + dva, d, flags); if (offset != -1ULL) { /* * If we've just selected this metaslab group, @@ -1363,18 +1414,24 @@ top: vdev_stat_t *vs = &vd->vdev_stat; int64_t vu, cu; - /* - * Determine percent used in units of 0..1024. - * (This is just to avoid floating point.) - */ - vu = (vs->vs_alloc << 10) / (vs->vs_space + 1); - cu = (mc->mc_alloc << 10) / (mc->mc_space + 1); + vu = (vs->vs_alloc * 100) / (vs->vs_space + 1); + cu = (mc->mc_alloc * 100) / (mc->mc_space + 1); /* - * Bias by at most +/- 25% of the aliquot. + * Calculate how much more or less we should + * try to allocate from this device during + * this iteration around the rotor. + * For example, if a device is 80% full + * and the pool is 20% full then we should + * reduce allocations by 60% on this device. + * + * mg_bias = (20 - 80) * 512K / 100 = -307K + * + * This reduces allocations by 307K for this + * iteration. */ mg->mg_bias = ((cu - vu) * - (int64_t)mg->mg_aliquot) / (1024 * 4); + (int64_t)mg->mg_aliquot) / 100; } if (atomic_add_64_nv(&mc->mc_aliquot, asize) >= @@ -1488,7 +1545,7 @@ metaslab_claim_dva(spa_t *spa, const dva mutex_enter(&msp->ms_lock); if ((txg != 0 && spa_writeable(spa)) || !msp->ms_map.sm_loaded) - error = metaslab_activate(msp, METASLAB_WEIGHT_SECONDARY, 0); + error = metaslab_activate(msp, METASLAB_WEIGHT_SECONDARY); if (error == 0 && !space_map_contains(&msp->ms_map, offset, size)) error = ENOENT; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Mon Jul 18 08:27:40 2011 (r224176) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Mon Jul 18 08:29:49 2011 (r224177) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011 by Delphix. All rights reserved. */ #include @@ -1674,3 +1675,9 @@ spa_scan_get_stats(spa_t *spa, pool_scan return (0); } + +boolean_t +spa_debug_enabled(spa_t *spa) +{ + return (spa->spa_debug); +} Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h Mon Jul 18 08:27:40 2011 (r224176) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h Mon Jul 18 08:29:49 2011 (r224177) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011 by Delphix. All rights reserved. */ #ifndef _SYS_METASLAB_H @@ -47,6 +48,8 @@ extern void metaslab_sync_reassess(metas #define METASLAB_HINTBP_FAVOR 0x0 #define METASLAB_HINTBP_AVOID 0x1 #define METASLAB_GANG_HEADER 0x2 +#define METASLAB_GANG_CHILD 0x4 +#define METASLAB_GANG_AVOID 0x8 extern int metaslab_alloc(spa_t *spa, metaslab_class_t *mc, uint64_t psize, blkptr_t *bp, int ncopies, uint64_t txg, blkptr_t *hintbp, int flags); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h Mon Jul 18 08:27:40 2011 (r224176) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h Mon Jul 18 08:29:49 2011 (r224177) @@ -21,6 +21,7 @@ /* * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright (c) 2011 by Delphix. All rights reserved. */ #ifndef _SYS_METASLAB_IMPL_H @@ -52,6 +53,7 @@ struct metaslab_group { avl_tree_t mg_metaslab_tree; uint64_t mg_aliquot; uint64_t mg_bonus_area; + uint64_t mg_alloc_failures; int64_t mg_bias; int64_t mg_activation_count; metaslab_class_t *mg_class; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Mon Jul 18 08:27:40 2011 (r224176) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Mon Jul 18 08:29:49 2011 (r224177) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011 by Delphix. All rights reserved. */ #ifndef _SYS_SPA_H @@ -698,6 +699,13 @@ _NOTE(CONSTCOND) } while (0) #define dprintf_bp(bp, fmt, ...) #endif +extern boolean_t spa_debug_enabled(spa_t *spa); +#define spa_dbgmsg(spa, ...) \ +{ \ + if (spa_debug_enabled(spa)) \ + zfs_dbgmsg(__VA_ARGS__); \ +} + extern int spa_mode_global; /* mode, e.g. FREAD | FWRITE */ #ifdef __cplusplus Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Mon Jul 18 08:27:40 2011 (r224176) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Mon Jul 18 08:29:49 2011 (r224177) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011 by Delphix. All rights reserved. */ #ifndef _SYS_SPA_IMPL_H @@ -196,6 +197,7 @@ struct spa { kcondvar_t spa_suspend_cv; /* notification of resume */ uint8_t spa_suspended; /* pool is suspended */ uint8_t spa_claiming; /* pool is doing zil_claim() */ + boolean_t spa_debug; /* debug enabled? */ boolean_t spa_is_root; /* pool is root */ int spa_minref; /* num refs when first opened */ int spa_mode; /* FREAD | FWRITE */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Jul 18 08:27:40 2011 (r224176) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Jul 18 08:29:49 2011 (r224177) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011 by Delphix. All rights reserved. */ #include @@ -85,6 +86,7 @@ kmem_cache_t *zio_data_buf_cache[SPA_MAX #ifdef _KERNEL extern vmem_t *zio_alloc_arena; #endif +extern int zfs_mg_alloc_failures; /* * An allocating zio is one that either currently has the DVA allocate @@ -160,6 +162,15 @@ zio_init(void) zio_data_buf_cache[c - 1] = zio_data_buf_cache[c]; } + /* + * The zio write taskqs have 1 thread per cpu, allow 1/2 of the taskqs + * to fail 3 times per txg or 8 failures, whichever is greater. + */ + if (zfs_mg_alloc_failures == 0) + zfs_mg_alloc_failures = MAX((3 * max_ncpus / 2), 8); + else if (zfs_mg_alloc_failures < 8) + zfs_mg_alloc_failures = 8; + zio_inject_init(); } @@ -2135,6 +2146,7 @@ zio_dva_allocate(zio_t *zio) metaslab_class_t *mc = spa_normal_class(spa); blkptr_t *bp = zio->io_bp; int error; + int flags = 0; if (zio->io_gang_leader == NULL) { ASSERT(zio->io_child_type > ZIO_CHILD_GANG); @@ -2147,10 +2159,21 @@ zio_dva_allocate(zio_t *zio) ASSERT3U(zio->io_prop.zp_copies, <=, spa_max_replication(spa)); ASSERT3U(zio->io_size, ==, BP_GET_PSIZE(bp)); + /* + * The dump device does not support gang blocks so allocation on + * behalf of the dump device (i.e. ZIO_FLAG_NODATA) must avoid + * the "fast" gang feature. + */ + flags |= (zio->io_flags & ZIO_FLAG_NODATA) ? METASLAB_GANG_AVOID : 0; + flags |= (zio->io_flags & ZIO_FLAG_GANG_CHILD) ? + METASLAB_GANG_CHILD : 0; error = metaslab_alloc(spa, mc, zio->io_size, bp, - zio->io_prop.zp_copies, zio->io_txg, NULL, 0); + zio->io_prop.zp_copies, zio->io_txg, NULL, flags); if (error) { + spa_dbgmsg(spa, "%s: metaslab allocation failure: zio %p, " + "size %llu, error %d", spa_name(spa), zio, zio->io_size, + error); if (error == ENOSPC && zio->io_size > SPA_MINBLOCKSIZE) return (zio_write_gang_block(zio)); zio->io_error = error; From owner-svn-src-head@FreeBSD.ORG Mon Jul 18 09:11:58 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0E59106564A; Mon, 18 Jul 2011 09:11:58 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id 345228FC12; Mon, 18 Jul 2011 09:11:57 +0000 (UTC) Received: from c122-106-165-191.carlnfd1.nsw.optusnet.com.au (c122-106-165-191.carlnfd1.nsw.optusnet.com.au [122.106.165.191]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p6I9Br2q018110 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 18 Jul 2011 19:11:54 +1000 Date: Mon, 18 Jul 2011 19:11:53 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ryan Stone In-Reply-To: Message-ID: <20110718180637.O1038@besplex.bde.org> References: <201107172108.p6HL8Gkd090278@svn.freebsd.org> <20110718080428.N3939@besplex.bde.org> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1224280693-1310980313=:1038" Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans , markjdb@gmail.com Subject: Re: svn commit: r224150 - head/sbin/fdisk X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jul 2011 09:11:58 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-1224280693-1310980313=:1038 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Sun, 17 Jul 2011, Ryan Stone wrote: > On Sun, Jul 17, 2011 at 7:09 PM, Bruce Evans wrote= : >> There was no need to further break the style. > > Ack. Should have caught that. Will fix. Thanks. >>> @@ -990,7 +990,7 @@ parse_config_line(char *line, CMD *comma >>> =A0 =A0 =A0 =A0 =A0 =A0if (isalpha(*cp)) >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0command->args[command->n_args].argtype = =3D *cp++; >>> =A0 =A0 =A0 =A0 =A0 =A0end =3D NULL; >>> - =A0 =A0 =A0 =A0 =A0 command->args[command->n_args].arg_val =3D strtol= (cp, &end, 0); >>> + =A0 =A0 =A0 =A0 =A0 command->args[command->n_args].arg_val =3D strtou= l(cp, &end, 0); >>> =A0 =A0 =A0 =A0 =A0 =A0if (cp =3D=3D end || (!isspace(*end) && *end != =3D '\0')) { >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0char ch; >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0end =3D cp; Arrgh, hard \xa0 what should be very plain text for a diff unreadable. >> Also, arg_val is never used as a u_long. =A0We risk truncation when it i= s >> blindly assigned to variables whose type is never u_long. =A0It is mostl= y >> assigned to variables of type uint ("uint" is an archaic SysV spelling >> of the BSD u_int which is a spelling of unsigned int. =A0This style bug >> was imported from Mach and never fixed). =A0Since uint is unsigned and i= nts >> have 32 bits, things now work up to UINT32_MAX but no further. =A0arg_va= l >> is also blindly assigned to a variable of type int, the partition number= , >> and to a variable of type u_char (the partition type), but since these >> values nonsense unless they are small, there is no problem with overflow >> near INT32_MAX or UINT32_MAX. > > Hm, I was under the impression that fdisk was checking whether the > size parameter fit within in 32-bits before putting it in the MBR, but > I seem to have been mistaken. In that case, I think that the right > fix is to make arg_val a u_int for now, which will still allow slices > with more than 2^31 sectors to be specified. Truncation is still an > issue but that's not a new bug. That would be good. The only other gross overflow bugs in fdisk that I know of are that when it gets parameters from the kernel, it blindly multiplies them and can overflow. get_params() also returns a nonsense status which is especially broken at 4G-1 and above. % ... % static int cyls, sectors, heads, cylsecs, disksecs; disksecs can overflow in practice. % ... % static uint dos_cyls; % static uint dos_heads; % static uint dos_sectors; % static uint dos_cylsecs; Better, and correct modulo checks that the assumptions that ints are 32 bits and that assignments to these variables check that the value is <=3D UINT32_MAX. % ... % static int % get_params() % { % =09int error; % =09u_int u; % =09off_t o; %=20 % =09error =3D ioctl(fd, DIOCGFWSECTORS, &u); % =09if (error =3D=3D 0) % =09=09sectors =3D dos_sectors =3D u; % =09else % =09=09sectors =3D dos_sectors =3D 63; %=20 % =09error =3D ioctl(fd, DIOCGFWHEADS, &u); % =09if (error =3D=3D 0) % =09=09heads =3D dos_heads =3D u; % =09else % =09=09heads =3D dos_heads =3D 255; Small values, so no problems in practice. Bad variable names, including using u as a temporary copy for variables with different semantics. Perfectly backwards sorting of the declarations. %=20 % =09dos_cylsecs =3D cylsecs =3D heads * sectors; Another small value in practice. % =09disksecs =3D cyls * heads * sectors; Can easily overflow. The last multiplication overflows at 4G sectors in practice. The assigment overflows at 2G sectors in practice. %=20 % =09u =3D g_sectorsize(fd); % =09if (u <=3D 0) % =09=09return (-1); %=20 % =09o =3D g_mediasize(fd); % =09if (o < 0) % =09=09return (-1); % =09disksecs =3D o / u; Can easily overflow at 2G sectors on assignment. % =09cyls =3D dos_cyls =3D o / (u * dos_heads * dos_sectors); No problems in practice. %=20 % =09return (disksecs); Nonsense return value. This function returns -1 on error, else it should return 0. It is only called once, and its caller actually checks the return value, and exits (after printing reasonable warning messages in open_disk(), then a bogus warning message and a bogus errno using err()) iff this function returns -1. So disksecs is a garbage value to return here. When the number of sectors is > INT_MAX, the garbage has already overflowed on assignment to disksecs. This is mostly benign up to UINT32_MAX (and even later -- see below), but here it is fatal at precisely UINT32_MAX, since that has overflowed to the supposed-to-be-out-of-band value -1 on assignment to disksecs (if it didn't overflow there, it would overflow on return). And this value is the most likely one for a large disk -- you can probably usefully use a large disk by using only the first UINT32_MAX sectors on it. Then either you or the kernel or the BIOS or error handling in strtoul() may have faked or otherwise produced the magic value of UINT32_MAX for the number of sectors. Or you can certainly usefully use this fdisk on a disk with more than UINT32_MAX sectors, provided you only want to change partitions lying entirely within the first UINT32_MAX sectors. % } Another bug in get_params() is that you have no direct control over the number of sectors. In the usual case, this number is the result of g_mediasize(). We depend on the broken error handling, and on this number not being -1 when truncated, to get past initialization to the point where we can specify the number of sectors interactively (or in the config file (?). Failing when the total number of sectors is unrepresentable in variables with wrong types would be especially silly, since fdisk only uses this value to initialize defaults (note that it is not part of CHS, and interactive mode doesn't support entering it. Interactive mode doesn't even fake it by multiplying out CHS -- it just multiplies HS -- see get_params_to_use(). Thus interactive mode doesn't have any of the overflow bugs in the above, and the overflow bugs in the above are more benign than first appears, since disksecs is rarely used and later uses of it, if any, are bugs since interactive mode doesn't maintain it). This also shows that we shouldn't be very strict in checking that values don't exceed UINT32_MAX. The values should only be checked if they are actually used. This is mainly partition offsets that will be written to disks. Partition sizes must not exceed UINT32_MAX, so checking that up front is harmless, but it is insufficient since the (offset + size) should not exceed UINT32_MAX. Hmm, I think the (offset, size) structure can support up to 8G-2 sectors if programmed carefully -- it has nothing to prevent starting a partition of size 4G-1 at offset 4G-1. So i386 MBRs should break at ~4TB, not at ~2TB with 512 byte sectors :-) (8 times that with 4K-sectors). Uncareful code like fdisk and probably BIOSes that at best just adds offset+size in uint32_t will of course break at 4G-1 sectors. Bruce --0-1224280693-1310980313=:1038-- From owner-svn-src-head@FreeBSD.ORG Mon Jul 18 10:29:16 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 991BB106566B; Mon, 18 Jul 2011 10:29:16 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F57A8FC08; Mon, 18 Jul 2011 10:29:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6IATGDA019460; Mon, 18 Jul 2011 10:29:16 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6IATG0k019456; Mon, 18 Jul 2011 10:29:16 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201107181029.p6IATG0k019456@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 18 Jul 2011 10:29:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224179 - head/sbin/ifconfig X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jul 2011 10:29:16 -0000 Author: bz Date: Mon Jul 18 10:29:16 2011 New Revision: 224179 URL: http://svn.freebsd.org/changeset/base/224179 Log: If compiling RESCUE always ignore feature_present(3) calls so that a /rescue/ifconfig more modern than the kernel could still configure IPv4 or IPv6 addresses. Reported by: Andrzej Tobola (ato iem.pw.edu.pl) Reported by: gcooper MFC after: 1 day X-MFC: will not MFC any time soon, just reminder for r222527 Modified: head/sbin/ifconfig/af_inet.c head/sbin/ifconfig/af_inet6.c head/sbin/ifconfig/ifconfig.c Modified: head/sbin/ifconfig/af_inet.c ============================================================================== --- head/sbin/ifconfig/af_inet.c Mon Jul 18 08:38:08 2011 (r224178) +++ head/sbin/ifconfig/af_inet.c Mon Jul 18 10:29:16 2011 (r224179) @@ -200,7 +200,10 @@ static struct afswtch af_inet = { static __constructor void inet_ctor(void) { + +#ifndef RESCUE if (!feature_present("inet")) return; +#endif af_register(&af_inet); } Modified: head/sbin/ifconfig/af_inet6.c ============================================================================== --- head/sbin/ifconfig/af_inet6.c Mon Jul 18 08:38:08 2011 (r224178) +++ head/sbin/ifconfig/af_inet6.c Mon Jul 18 10:29:16 2011 (r224179) @@ -545,8 +545,10 @@ inet6_ctor(void) #define N(a) (sizeof(a) / sizeof(a[0])) size_t i; +#ifndef RESCUE if (!feature_present("inet6")) return; +#endif for (i = 0; i < N(inet6_cmds); i++) cmd_register(&inet6_cmds[i]); Modified: head/sbin/ifconfig/ifconfig.c ============================================================================== --- head/sbin/ifconfig/ifconfig.c Mon Jul 18 08:38:08 2011 (r224178) +++ head/sbin/ifconfig/ifconfig.c Mon Jul 18 10:29:16 2011 (r224179) @@ -498,10 +498,12 @@ ifconfig(int argc, char *const *argv, in * ifconfig IF up/down etc. to work without INET support as people * never used ifconfig IF link up/down, etc. either. */ +#ifndef RESCUE #ifdef INET if (afp == NULL && feature_present("inet")) afp = af_getbyname("inet"); #endif +#endif if (afp == NULL) afp = af_getbyname("link"); if (afp == NULL) { From owner-svn-src-head@FreeBSD.ORG Mon Jul 18 12:03:59 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E082F106566C; Mon, 18 Jul 2011 12:03:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C661C8FC0C; Mon, 18 Jul 2011 12:03:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6IC3w66022323; Mon, 18 Jul 2011 12:03:58 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6IC3wW9022317; Mon, 18 Jul 2011 12:03:58 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201107181203.p6IC3wW9022317@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 18 Jul 2011 12:03:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224180 - head/sys/dev/usb/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jul 2011 12:03:59 -0000 Author: hselasky Date: Mon Jul 18 12:03:58 2011 New Revision: 224180 URL: http://svn.freebsd.org/changeset/base/224180 Log: Only the USB root HUB thread is allowed to attach and detach drivers to and from USB devices. Remove related DEVMETHOD() lines from USB drivers. Reported by: YongHyeon PYUN MFC after: 3 days Modified: head/sys/dev/usb/net/if_aue.c head/sys/dev/usb/net/if_axe.c head/sys/dev/usb/net/if_mos.c head/sys/dev/usb/net/if_rue.c head/sys/dev/usb/net/if_udav.c Modified: head/sys/dev/usb/net/if_aue.c ============================================================================== --- head/sys/dev/usb/net/if_aue.c Mon Jul 18 10:29:16 2011 (r224179) +++ head/sys/dev/usb/net/if_aue.c Mon Jul 18 12:03:58 2011 (r224180) @@ -256,7 +256,6 @@ static device_method_t aue_methods[] = { /* bus interface */ DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), /* MII interface */ DEVMETHOD(miibus_readreg, aue_miibus_readreg), Modified: head/sys/dev/usb/net/if_axe.c ============================================================================== --- head/sys/dev/usb/net/if_axe.c Mon Jul 18 10:29:16 2011 (r224179) +++ head/sys/dev/usb/net/if_axe.c Mon Jul 18 12:03:58 2011 (r224180) @@ -239,7 +239,6 @@ static device_method_t axe_methods[] = { /* bus interface */ DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), /* MII interface */ DEVMETHOD(miibus_readreg, axe_miibus_readreg), Modified: head/sys/dev/usb/net/if_mos.c ============================================================================== --- head/sys/dev/usb/net/if_mos.c Mon Jul 18 10:29:16 2011 (r224179) +++ head/sys/dev/usb/net/if_mos.c Mon Jul 18 12:03:58 2011 (r224180) @@ -222,7 +222,6 @@ static device_method_t mos_methods[] = { /* bus interface */ DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), /* MII interface */ DEVMETHOD(miibus_readreg, mos_miibus_readreg), Modified: head/sys/dev/usb/net/if_rue.c ============================================================================== --- head/sys/dev/usb/net/if_rue.c Mon Jul 18 10:29:16 2011 (r224179) +++ head/sys/dev/usb/net/if_rue.c Mon Jul 18 12:03:58 2011 (r224180) @@ -188,7 +188,6 @@ static device_method_t rue_methods[] = { /* Bus interface */ DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), /* MII interface */ DEVMETHOD(miibus_readreg, rue_miibus_readreg), Modified: head/sys/dev/usb/net/if_udav.c ============================================================================== --- head/sys/dev/usb/net/if_udav.c Mon Jul 18 10:29:16 2011 (r224179) +++ head/sys/dev/usb/net/if_udav.c Mon Jul 18 12:03:58 2011 (r224180) @@ -147,7 +147,6 @@ static device_method_t udav_methods[] = /* bus interface */ DEVMETHOD(bus_print_child, bus_generic_print_child), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), /* MII interface */ DEVMETHOD(miibus_readreg, udav_miibus_readreg), From owner-svn-src-head@FreeBSD.ORG Mon Jul 18 12:52:49 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A89E1065675; Mon, 18 Jul 2011 12:52:49 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id E2F928FC14; Mon, 18 Jul 2011 12:52:47 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id PAA22624; Mon, 18 Jul 2011 15:52:46 +0300 (EEST) (envelope-from avg@FreeBSD.org) Message-ID: <4E242C9E.6010604@FreeBSD.org> Date: Mon, 18 Jul 2011 15:52:46 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:5.0) Gecko/20110705 Thunderbird/5.0 MIME-Version: 1.0 To: Hans Petter Selasky References: <201107132107.p6DL7ojq099900@svn.freebsd.org> In-Reply-To: <201107132107.p6DL7ojq099900@svn.freebsd.org> X-Enigmail-Version: 1.2pre Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r223989 - head/sys/dev/usb/input X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jul 2011 12:52:49 -0000 on 14/07/2011 00:07 Hans Petter Selasky said the following: > Author: hselasky > Date: Wed Jul 13 21:07:50 2011 > New Revision: 223989 > URL: http://svn.freebsd.org/changeset/base/223989 > > Log: > Fix for dump after shutdown with USB keyboard plugged in. It appears that the > system timer is stopped during shutdown and that the pause() statement in ukbd > causes infinite hang in this regard. The fix is to use mi_switch() instead of > pause() to do the required task switch to ensure that the required USB processes > get executed. I have a question partially about this particular change, partially about USB/ukbd polling mode in general. See below: > Reported by: Mike_Karels@mcafee.com > MFC after: 1 week > > Modified: > head/sys/dev/usb/input/ukbd.c > > Modified: head/sys/dev/usb/input/ukbd.c > ============================================================================== > --- head/sys/dev/usb/input/ukbd.c Wed Jul 13 21:07:41 2011 (r223988) > +++ head/sys/dev/usb/input/ukbd.c Wed Jul 13 21:07:50 2011 (r223989) > @@ -59,6 +59,8 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > +#include > #include > > #include > @@ -386,6 +388,33 @@ ukbd_put_key(struct ukbd_softc *sc, uint > } > > static void > +ukbd_yield(void) > +{ > + struct thread *td = curthread; > + uint32_t old_prio; > + > + DROP_GIANT(); > + > + thread_lock(td); > + > + /* get current priority */ > + old_prio = td->td_base_pri; > + > + /* set new priority */ > + sched_prio(td, td->td_user_pri); > + > + /* cause a task switch */ > + mi_switch(SW_INVOL | SWT_RELINQUISH, NULL); > + > + /* restore priority */ > + sched_prio(td, old_prio); > + > + thread_unlock(td); > + > + PICKUP_GIANT(); > +} > + > +static void > ukbd_do_poll(struct ukbd_softc *sc, uint8_t wait) > { > DPRINTFN(2, "polling\n"); > @@ -396,8 +425,9 @@ ukbd_do_poll(struct ukbd_softc *sc, uint > > if (kdb_active == 0) { The question is: why this special subcase is needed at all. If I understand correctly, the polling mode is used only in some special situations/contexts. So why not always use the generic code (after this if-block) that does "proper" polling? What do we win when using this special case that seems to depend on the scheduler? Unfortunately I couldn't fully understand commit log of r203896. One of the reasons I am asking about this is that soon-ish we may have changes that disable scheduler in a context where panicstr != NULL. > while (sc->sc_inputs == 0) { > - /* make sure the USB code gets a chance to run */ > - pause("UKBD", 1); > + > + /* give USB threads a chance to run */ > + ukbd_yield(); > > /* check if we should wait */ > if (!wait) -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Mon Jul 18 12:58:18 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C01C7106566C; Mon, 18 Jul 2011 12:58:18 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A5F0B8FC1B; Mon, 18 Jul 2011 12:58:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6ICwITM023923; Mon, 18 Jul 2011 12:58:18 GMT (envelope-from jonathan@svn.freebsd.org) Received: (from jonathan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6ICwISu023918; Mon, 18 Jul 2011 12:58:18 GMT (envelope-from jonathan@svn.freebsd.org) Message-Id: <201107181258.p6ICwISu023918@svn.freebsd.org> From: Jonathan Anderson Date: Mon, 18 Jul 2011 12:58:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224181 - head/sys/security/audit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jul 2011 12:58:18 -0000 Author: jonathan Date: Mon Jul 18 12:58:18 2011 New Revision: 224181 URL: http://svn.freebsd.org/changeset/base/224181 Log: Provide ability to audit cap_rights_t arguments. We wish to be able to audit capability rights arguments; this code provides the necessary infrastructure. This commit does not, of itself, turn on such auditing for any system call; that should follow shortly. Approved by: mentor (rwatson), re (Capsicum blanket) Sponsored by: Google Inc Modified: head/sys/security/audit/audit.h head/sys/security/audit/audit_arg.c head/sys/security/audit/audit_bsm.c head/sys/security/audit/audit_private.h Modified: head/sys/security/audit/audit.h ============================================================================== --- head/sys/security/audit/audit.h Mon Jul 18 12:03:58 2011 (r224180) +++ head/sys/security/audit/audit.h Mon Jul 18 12:58:18 2011 (r224181) @@ -114,6 +114,7 @@ void audit_arg_auditon(union auditon_ud void audit_arg_file(struct proc *p, struct file *fp); void audit_arg_argv(char *argv, int argc, int length); void audit_arg_envv(char *envv, int envc, int length); +void audit_arg_rights(cap_rights_t rights); void audit_sysclose(struct thread *td, int fd); void audit_cred_copy(struct ucred *src, struct ucred *dest); void audit_cred_destroy(struct ucred *cred); @@ -235,6 +236,11 @@ void audit_thread_free(struct thread *t audit_arg_rgid((rgid)); \ } while (0) +#define AUDIT_ARG_RIGHTS(rights) do { \ + if (AUDITING_TD(curthread)) \ + audit_arg_rights((rights)); \ +} while (0) + #define AUDIT_ARG_RUID(ruid) do { \ if (AUDITING_TD(curthread)) \ audit_arg_ruid((ruid)); \ @@ -342,6 +348,7 @@ void audit_thread_free(struct thread *t #define AUDIT_ARG_PID(pid) #define AUDIT_ARG_PROCESS(p) #define AUDIT_ARG_RGID(rgid) +#define AUDIT_ARG_RIGHTS(rights) #define AUDIT_ARG_RUID(ruid) #define AUDIT_ARG_SIGNUM(signum) #define AUDIT_ARG_SGID(sgid) Modified: head/sys/security/audit/audit_arg.c ============================================================================== --- head/sys/security/audit/audit_arg.c Mon Jul 18 12:03:58 2011 (r224180) +++ head/sys/security/audit/audit_arg.c Mon Jul 18 12:58:18 2011 (r224181) @@ -865,6 +865,19 @@ audit_arg_envv(char *envv, int envc, int ARG_SET_VALID(ar, ARG_ENVV); } +void +audit_arg_rights(cap_rights_t rights) +{ + struct kaudit_record *ar; + + ar = currecord(); + if (ar == NULL) + return; + + ar->k_ar.ar_arg_rights = rights; + ARG_SET_VALID(ar, ARG_RIGHTS); +} + /* * The close() system call uses it's own audit call to capture the path/vnode * information because those pieces are not easily obtained within the system Modified: head/sys/security/audit/audit_bsm.c ============================================================================== --- head/sys/security/audit/audit_bsm.c Mon Jul 18 12:03:58 2011 (r224180) +++ head/sys/security/audit/audit_bsm.c Mon Jul 18 12:58:18 2011 (r224181) @@ -1589,6 +1589,28 @@ kaudit_to_bsm(struct kaudit_record *kar, } break; + case AUE_CAP_NEW: + /* + * XXXRW/XXXJA: Would be nice to audit socket/etc information. + */ + FD_VNODE1_TOKENS; + if (ARG_IS_VALID(kar, ARG_RIGHTS)) { + tok = au_to_arg64(2, "rights", ar->ar_arg_rights); + kau_write(rec, tok); + } + break; + + case AUE_CAP_GETRIGHTS: + if (ARG_IS_VALID(kar, ARG_FD)) { + tok = au_to_arg32(1, "fd", ar->ar_arg_fd); + kau_write(rec, tok); + } + break; + + case AUE_CAP_ENTER: + case AUE_CAP_GETMODE: + break; + case AUE_NULL: default: printf("BSM conversion requested for unknown event %d\n", Modified: head/sys/security/audit/audit_private.h ============================================================================== --- head/sys/security/audit/audit_private.h Mon Jul 18 12:03:58 2011 (r224180) +++ head/sys/security/audit/audit_private.h Mon Jul 18 12:58:18 2011 (r224181) @@ -229,6 +229,7 @@ struct audit_record { int ar_arg_exitstatus; int ar_arg_exitretval; struct sockaddr_storage ar_arg_sockaddr; + cap_rights_t ar_arg_rights; }; /* @@ -288,6 +289,7 @@ struct audit_record { #define ARG_ENVV 0x0002000000000000ULL #define ARG_ATFD1 0x0004000000000000ULL #define ARG_ATFD2 0x0008000000000000ULL +#define ARG_RIGHTS 0x0010000000000000ULL #define ARG_NONE 0x0000000000000000ULL #define ARG_ALL 0xFFFFFFFFFFFFFFFFULL From owner-svn-src-head@FreeBSD.ORG Mon Jul 18 14:04:38 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 086661065676; Mon, 18 Jul 2011 14:04:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D27938FC18; Mon, 18 Jul 2011 14:04:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6IE4bY4025966; Mon, 18 Jul 2011 14:04:37 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6IE4bXH025964; Mon, 18 Jul 2011 14:04:37 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201107181404.p6IE4bXH025964@svn.freebsd.org> From: John Baldwin Date: Mon, 18 Jul 2011 14:04:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224184 - head/sys/ia64/ia64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jul 2011 14:04:38 -0000 Author: jhb Date: Mon Jul 18 14:04:37 2011 New Revision: 224184 URL: http://svn.freebsd.org/changeset/base/224184 Log: Implement bus_adjust_resource() for the ia64 nexus driver. Reviewed by: marcel Approved by: re (kib) Modified: head/sys/ia64/ia64/nexus.c Modified: head/sys/ia64/ia64/nexus.c ============================================================================== --- head/sys/ia64/ia64/nexus.c Mon Jul 18 13:49:59 2011 (r224183) +++ head/sys/ia64/ia64/nexus.c Mon Jul 18 14:04:37 2011 (r224184) @@ -86,6 +86,8 @@ static device_t nexus_add_child(device_t int unit); static struct resource *nexus_alloc_resource(device_t, device_t, int, int *, u_long, u_long, u_long, u_int); +static int nexus_adjust_resource(device_t, device_t, int, struct resource *, + u_long, u_long); static int nexus_activate_resource(device_t, device_t, int, int, struct resource *); static int nexus_deactivate_resource(device_t, device_t, int, int, @@ -122,6 +124,7 @@ static device_method_t nexus_methods[] = DEVMETHOD(bus_print_child, nexus_print_child), DEVMETHOD(bus_add_child, nexus_add_child), DEVMETHOD(bus_alloc_resource, nexus_alloc_resource), + DEVMETHOD(bus_adjust_resource, nexus_adjust_resource), DEVMETHOD(bus_release_resource, nexus_release_resource), DEVMETHOD(bus_activate_resource, nexus_activate_resource), DEVMETHOD(bus_deactivate_resource, nexus_deactivate_resource), @@ -238,6 +241,20 @@ nexus_add_child(device_t bus, u_int orde return(child); } +static struct rman * +nexus_rman(int type) +{ + switch (type) { + case SYS_RES_IRQ: + return (&irq_rman); + case SYS_RES_IOPORT: + return (&port_rman); + case SYS_RES_MEMORY: + return (&mem_rman); + default: + return (NULL); + } +} /* * Allocate a resource on behalf of child. NB: child is usually going to be a @@ -271,23 +288,9 @@ nexus_alloc_resource(device_t bus, devic } flags &= ~RF_ACTIVE; - - switch (type) { - case SYS_RES_IRQ: - rm = &irq_rman; - break; - - case SYS_RES_IOPORT: - rm = &port_rman; - break; - - case SYS_RES_MEMORY: - rm = &mem_rman; - break; - - default: - return 0; - } + rm = nexus_rman(type); + if (rm == NULL) + return (NULL); rv = rman_reserve_resource(rm, start, end, count, flags, child); if (rv == 0) @@ -305,6 +308,20 @@ nexus_alloc_resource(device_t bus, devic } static int +nexus_adjust_resource(device_t bus, device_t child, int type, + struct resource *r, u_long start, u_long end) +{ + struct rman *rm; + + rm = nexus_rman(type); + if (rm == NULL) + return (ENXIO); + if (!rman_is_region_manager(r, rm)) + return (EINVAL); + return (rman_adjust_resource(r, start, end)); +} + +static int nexus_activate_resource(device_t bus, device_t child, int type, int rid, struct resource *r) { From owner-svn-src-head@FreeBSD.ORG Mon Jul 18 14:05:15 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6BA361065673; Mon, 18 Jul 2011 14:05:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 425938FC18; Mon, 18 Jul 2011 14:05:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6IE5FXu026027; Mon, 18 Jul 2011 14:05:15 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6IE5F6t026025; Mon, 18 Jul 2011 14:05:15 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201107181405.p6IE5F6t026025@svn.freebsd.org> From: John Baldwin Date: Mon, 18 Jul 2011 14:05:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224185 - head/sys/ia64/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jul 2011 14:05:15 -0000 Author: jhb Date: Mon Jul 18 14:05:14 2011 New Revision: 224185 URL: http://svn.freebsd.org/changeset/base/224185 Log: Enable NEW_PCIB by default on ia64. Approved by: re (kib), marcel Modified: head/sys/ia64/conf/DEFAULTS Modified: head/sys/ia64/conf/DEFAULTS ============================================================================== --- head/sys/ia64/conf/DEFAULTS Mon Jul 18 14:04:37 2011 (r224184) +++ head/sys/ia64/conf/DEFAULTS Mon Jul 18 14:05:14 2011 (r224185) @@ -18,3 +18,5 @@ device uart_ns8250 options GEOM_PART_BSD options GEOM_PART_GPT options GEOM_PART_MBR + +options NEW_PCIB From owner-svn-src-head@FreeBSD.ORG Mon Jul 18 14:12:58 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6ED5D1065673; Mon, 18 Jul 2011 14:12:58 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe01.c2i.net [212.247.154.2]) by mx1.freebsd.org (Postfix) with ESMTP id 645288FC14; Mon, 18 Jul 2011 14:12:56 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=yfIOS+81wnQIz0UwZPDdWOvE/jQxEvyI9Z1xC25I9wc= c=1 sm=1 a=SvYTsOw2Z4kA:10 a=Bjjt3Ia5OwMA:10 a=WQU8e4WWZSUA:10 a=N659UExz7-8A:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=N_3_nA3f67XQbwRQ6I0A:9 a=4m0-JB1XX1Jc-uzmjx8A:7 a=pILNOxqGKmIA:10 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe01.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 154950188; Mon, 18 Jul 2011 16:12:54 +0200 From: Hans Petter Selasky To: Andriy Gapon Date: Mon, 18 Jul 2011 16:10:49 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <201107132107.p6DL7ojq099900@svn.freebsd.org> <4E242C9E.6010604@FreeBSD.org> In-Reply-To: <4E242C9E.6010604@FreeBSD.org> X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq,NwSZ4V" =?windows-1252?q?=7CLR=2E+tj=7Dg5=0A=09=25V?=,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( =?windows-1252?q?=0A=09=3AAuzV9=3A=2EhESm-x4h240C=609=3Dw?= MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Message-Id: <201107181610.49443.hselasky@c2i.net> Cc: "svn-src-head@FreeBSD.org" , "svn-src-all@FreeBSD.org" , "src-committers@FreeBSD.org" Subject: Re: svn commit: r223989 - head/sys/dev/usb/input X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jul 2011 14:12:58 -0000 Hi, > The question is: why this special subcase is needed at all. Yes, according to the current keyboard implementation in the kernel. > If I understand correctly, the polling mode is used only in some special > situations/contexts. > So why not always use the generic code (after this if-block) that does > "proper" polling? What do we win when using this special case that seems > to depend on the scheduler? This special code is a workaround. The problem is that when not polling the key presses will be fed into syscons I think, and not returned via the polling function. That's why there is a timer there to distinguish when polling starts and polling stops. It is not enough just to enable/disable polling around each key-press like currently done. Please test any patches that it works in the filesystem mount prompt after boot: Edit /etc/fstab and put some non-existing device there for root partition. Reboot. Make sure USB keyboard works in the prompt which appears. > > Unfortunately I couldn't fully understand commit log of r203896. > > One of the reasons I am asking about this is that soon-ish we may have > changes that disable scheduler in a context where panicstr != NULL. Ok. Please make sure that USB keyboard works reliably in boot prompt when asking for file-system and in KDB and after dump during shutdown. An of course after logged in like a normal user :-) --HPS From owner-svn-src-head@FreeBSD.ORG Mon Jul 18 15:19:41 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AB9E1065672; Mon, 18 Jul 2011 15:19:41 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7624D8FC24; Mon, 18 Jul 2011 15:19:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6IFJfqw028300; Mon, 18 Jul 2011 15:19:41 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6IFJfOK028280; Mon, 18 Jul 2011 15:19:41 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201107181519.p6IFJfOK028280@svn.freebsd.org> From: Attilio Rao Date: Mon, 18 Jul 2011 15:19:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224187 - in head: sys/amd64/amd64 sys/arm/arm sys/arm/sa11x0 sys/i386/i386 sys/ia64/ia64 sys/kern sys/mips/mips sys/powerpc/aim sys/powerpc/booke sys/sparc64/sparc64 sys/sys usr.bin/vm... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jul 2011 15:19:41 -0000 Author: attilio Date: Mon Jul 18 15:19:40 2011 New Revision: 224187 URL: http://svn.freebsd.org/changeset/base/224187 Log: - Remove the eintrcnt/eintrnames usage and introduce the concept of sintrcnt/sintrnames which are symbols containing the size of the 2 tables. - For amd64/i386 remove the storage of intr* stuff from assembly files. This area can be widely improved by applying the same to other architectures and likely finding an unified approach among them and move the whole code to be MI. More work in this area is expected to happen fairly soon. No MFC is previewed for this patch. Tested by: pluknet Reviewed by: jhb Approved by: re (kib) Modified: head/sys/amd64/amd64/genassym.c head/sys/amd64/amd64/intr_machdep.c head/sys/amd64/amd64/support.S head/sys/arm/arm/irq_dispatch.S head/sys/arm/sa11x0/sa11x0_irq.S head/sys/i386/i386/genassym.c head/sys/i386/i386/intr_machdep.c head/sys/i386/i386/support.s head/sys/ia64/ia64/locore.S head/sys/kern/kern_clock.c head/sys/kern/kern_intr.c head/sys/mips/mips/exception.S head/sys/powerpc/aim/locore32.S head/sys/powerpc/aim/locore64.S head/sys/powerpc/booke/locore.S head/sys/sparc64/sparc64/exception.S head/sys/sparc64/sparc64/intr_machdep.c head/sys/sys/interrupt.h head/usr.bin/vmstat/vmstat.c Modified: head/sys/amd64/amd64/genassym.c ============================================================================== --- head/sys/amd64/amd64/genassym.c Mon Jul 18 14:41:08 2011 (r224186) +++ head/sys/amd64/amd64/genassym.c Mon Jul 18 15:19:40 2011 (r224187) @@ -201,7 +201,6 @@ ASSYM(UC_EFLAGS, offsetof(ucontext_t, uc ASSYM(ENOENT, ENOENT); ASSYM(EFAULT, EFAULT); ASSYM(ENAMETOOLONG, ENAMETOOLONG); -ASSYM(MAXCPU, MAXCPU); ASSYM(MAXCOMLEN, MAXCOMLEN); ASSYM(MAXPATHLEN, MAXPATHLEN); ASSYM(PC_SIZEOF, sizeof(struct pcpu)); Modified: head/sys/amd64/amd64/intr_machdep.c ============================================================================== --- head/sys/amd64/amd64/intr_machdep.c Mon Jul 18 14:41:08 2011 (r224186) +++ head/sys/amd64/amd64/intr_machdep.c Mon Jul 18 15:19:40 2011 (r224187) @@ -80,6 +80,11 @@ static STAILQ_HEAD(, pic) pics; static int assign_cpu; #endif +u_long intrcnt[INTRCNT_COUNT]; +char intrnames[INTRCNT_COUNT * (MAXCOMLEN + 1)]; +size_t sintrcnt = sizeof(intrcnt); +size_t sintrnames = sizeof(intrnames); + static int intr_assign_cpu(void *arg, u_char cpu); static void intr_disable_src(void *arg); static void intr_init(void *__dummy); Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Mon Jul 18 14:41:08 2011 (r224186) +++ head/sys/amd64/amd64/support.S Mon Jul 18 15:19:40 2011 (r224187) @@ -38,18 +38,6 @@ #include "assym.s" - .data - ALIGN_DATA - .globl intrcnt, eintrcnt -intrcnt: - .space INTRCNT_COUNT * 8 -eintrcnt: - - .globl intrnames, eintrnames -intrnames: - .space INTRCNT_COUNT * (MAXCOMLEN + 1) -eintrnames: - .text /* Modified: head/sys/arm/arm/irq_dispatch.S ============================================================================== --- head/sys/arm/arm/irq_dispatch.S Mon Jul 18 14:41:08 2011 (r224186) +++ head/sys/arm/arm/irq_dispatch.S Mon Jul 18 15:19:40 2011 (r224187) @@ -102,14 +102,16 @@ ASENTRY_NP(irq_entry) .align 0 - .global _C_LABEL(intrnames), _C_LABEL(eintrnames) - .global _C_LABEL(intrcnt), _C_LABEL(eintrcnt) + .global _C_LABEL(intrnames), _C_LABEL(sintrnames) + .global _C_LABEL(intrcnt), _C_LABEL(sintrcnt) _C_LABEL(intrnames): .space NIRQ * (MAXCOMLEN + 1) -_C_LABEL(eintrnames): _C_LABEL(intrcnt): .space NIRQ * 4 -_C_LABEL(eintrcnt): +_C_LABEL(sintrnames): + .word NIRQ * (MAXCOMLEN + 1) +_C_LABEL(sintrcnt): + .word NIRQ * 4 .global _C_LABEL(current_intr_depth) _C_LABEL(current_intr_depth): Modified: head/sys/arm/sa11x0/sa11x0_irq.S ============================================================================== --- head/sys/arm/sa11x0/sa11x0_irq.S Mon Jul 18 14:41:08 2011 (r224186) +++ head/sys/arm/sa11x0/sa11x0_irq.S Mon Jul 18 15:19:40 2011 (r224187) @@ -118,16 +118,11 @@ ENTRY(sa11x0_activateirqs) mov r1, #0xffffffff str r1, [r0, #(SAIPIC_MR)] mov pc, lr -#ifdef IRQSTATS -Lintrcnt: - .word _C_LABEL(intrcnt) -#endif - .global _C_LABEL(intrnames), _C_LABEL(eintrnames) - .global _C_LABEL(eintrcnt) + .global _C_LABEL(intrnames), _C_LABEL(sintrnames) _C_LABEL(intrnames): -_C_LABEL(eintrnames): -_C_LABEL(eintrcnt): +_C_LABEL(sintrnames): + .word 0 .globl _C_LABEL(intrcnt), _C_LABEL(sintrcnt) @@ -135,4 +130,4 @@ _C_LABEL(intrcnt): .space ICU_LEN*4 /* XXX Should be linked to number of interrupts */ _C_LABEL(sintrcnt): - .space 32*4 + .word ICU_LEN*4 Modified: head/sys/i386/i386/genassym.c ============================================================================== --- head/sys/i386/i386/genassym.c Mon Jul 18 14:41:08 2011 (r224186) +++ head/sys/i386/i386/genassym.c Mon Jul 18 15:19:40 2011 (r224187) @@ -180,7 +180,6 @@ ASSYM(UC_GS, offsetof(ucontext_t, uc_mco ASSYM(ENOENT, ENOENT); ASSYM(EFAULT, EFAULT); ASSYM(ENAMETOOLONG, ENAMETOOLONG); -ASSYM(MAXCPU, MAXCPU); ASSYM(MAXCOMLEN, MAXCOMLEN); ASSYM(MAXPATHLEN, MAXPATHLEN); ASSYM(BOOTINFO_SIZE, sizeof(struct bootinfo)); Modified: head/sys/i386/i386/intr_machdep.c ============================================================================== --- head/sys/i386/i386/intr_machdep.c Mon Jul 18 14:41:08 2011 (r224186) +++ head/sys/i386/i386/intr_machdep.c Mon Jul 18 15:19:40 2011 (r224187) @@ -71,6 +71,11 @@ static STAILQ_HEAD(, pic) pics; static int assign_cpu; #endif +u_long intrcnt[INTRCNT_COUNT]; +char intrnames[INTRCNT_COUNT * (MAXCOMLEN + 1)]; +size_t sintrcnt = sizeof(intrcnt); +size_t sintrnames = sizeof(intrnames); + static int intr_assign_cpu(void *arg, u_char cpu); static void intr_disable_src(void *arg); static void intr_init(void *__dummy); Modified: head/sys/i386/i386/support.s ============================================================================== --- head/sys/i386/i386/support.s Mon Jul 18 14:41:08 2011 (r224186) +++ head/sys/i386/i386/support.s Mon Jul 18 15:19:40 2011 (r224187) @@ -41,18 +41,6 @@ #define IDXSHIFT 10 - .data - ALIGN_DATA - .globl intrcnt, eintrcnt -intrcnt: - .space INTRCNT_COUNT * 4 -eintrcnt: - - .globl intrnames, eintrnames -intrnames: - .space INTRCNT_COUNT * (MAXCOMLEN + 1) -eintrnames: - .text /* Modified: head/sys/ia64/ia64/locore.S ============================================================================== --- head/sys/ia64/ia64/locore.S Mon Jul 18 14:41:08 2011 (r224186) +++ head/sys/ia64/ia64/locore.S Mon Jul 18 15:19:40 2011 (r224187) @@ -206,11 +206,14 @@ intr_n = 1 .byte 0 intr_n = intr_n + 1 .endr -EXPORT(eintrnames) +EXPORT(sintrnames) + .word INTRCNT_COUNT * INTRNAME_LEN + .align 8 EXPORT(intrcnt) .fill INTRCNT_COUNT, 8, 0 -EXPORT(eintrcnt) +EXPORT(sintrcnt) + .word INTRCNT_COUNT .text // in0: image base Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Mon Jul 18 14:41:08 2011 (r224186) +++ head/sys/kern/kern_clock.c Mon Jul 18 15:19:40 2011 (r224187) @@ -842,7 +842,7 @@ watchdog_fire(void) curintr = intrcnt; curname = intrnames; inttotal = 0; - nintr = eintrcnt - intrcnt; + nintr = sintrcnt; printf("interrupt total\n"); while (--nintr >= 0) { Modified: head/sys/kern/kern_intr.c ============================================================================== --- head/sys/kern/kern_intr.c Mon Jul 18 14:41:08 2011 (r224186) +++ head/sys/kern/kern_intr.c Mon Jul 18 15:19:40 2011 (r224187) @@ -1869,8 +1869,7 @@ SYSINIT(start_softintr, SI_SUB_SOFTINTR, static int sysctl_intrnames(SYSCTL_HANDLER_ARGS) { - return (sysctl_handle_opaque(oidp, intrnames, eintrnames - intrnames, - req)); + return (sysctl_handle_opaque(oidp, intrnames, sintrnames, req)); } SYSCTL_PROC(_hw, OID_AUTO, intrnames, CTLTYPE_OPAQUE | CTLFLAG_RD, @@ -1879,8 +1878,7 @@ SYSCTL_PROC(_hw, OID_AUTO, intrnames, CT static int sysctl_intrcnt(SYSCTL_HANDLER_ARGS) { - return (sysctl_handle_opaque(oidp, intrcnt, - (char *)eintrcnt - (char *)intrcnt, req)); + return (sysctl_handle_opaque(oidp, intrcnt, sintrcnt, req)); } SYSCTL_PROC(_hw, OID_AUTO, intrcnt, CTLTYPE_OPAQUE | CTLFLAG_RD, @@ -1894,9 +1892,12 @@ DB_SHOW_COMMAND(intrcnt, db_show_intrcnt { u_long *i; char *cp; + u_int j; cp = intrnames; - for (i = intrcnt; i != eintrcnt && !db_pager_quit; i++) { + j = 0; + for (i = intrcnt; j < (sintrcnt / sizeof(u_long)) && !db_pager_quit; + i++, j++) { if (*cp == '\0') break; if (*i != 0) Modified: head/sys/mips/mips/exception.S ============================================================================== --- head/sys/mips/mips/exception.S Mon Jul 18 14:41:08 2011 (r224186) +++ head/sys/mips/mips/exception.S Mon Jul 18 15:19:40 2011 (r224187) @@ -1134,16 +1134,19 @@ END(MipsFPTrap) */ .data .globl intrcnt - .globl eintrcnt + .globl sintrcnt .globl intrnames - .globl eintrnames + .globl sintrnames intrnames: .space INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 -eintrnames: +sintrnames: + .word INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 + .align 4 intrcnt: .space INTRCNT_COUNT * 4 * 2 -eintrcnt: +sintrcnt: + .word INTRCNT_COUNT * 4 * 2 /* Modified: head/sys/powerpc/aim/locore32.S ============================================================================== --- head/sys/powerpc/aim/locore32.S Mon Jul 18 14:41:08 2011 (r224186) +++ head/sys/powerpc/aim/locore32.S Mon Jul 18 15:19:40 2011 (r224187) @@ -90,11 +90,14 @@ GLOBAL(esym) #define INTRCNT_COUNT 256 /* max(HROWPIC_IRQMAX,OPENPIC_IRQMAX) */ GLOBAL(intrnames) .space INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 -GLOBAL(eintrnames) +GLOBAL(sintrnames) + .word INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 + .align 4 GLOBAL(intrcnt) .space INTRCNT_COUNT * 4 * 2 -GLOBAL(eintrcnt) +GLOBAL(sintrcnt) + .word INTRCNT_COUNT * 4 * 2 .text .globl btext Modified: head/sys/powerpc/aim/locore64.S ============================================================================== --- head/sys/powerpc/aim/locore64.S Mon Jul 18 14:41:08 2011 (r224186) +++ head/sys/powerpc/aim/locore64.S Mon Jul 18 15:19:40 2011 (r224187) @@ -90,11 +90,14 @@ GLOBAL(esym) #define INTRCNT_COUNT 256 /* max(HROWPIC_IRQMAX,OPENPIC_IRQMAX) */ GLOBAL(intrnames) .space INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 -GLOBAL(eintrnames) +GLOBAL(sintrnames) + .word INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 + .align 4 GLOBAL(intrcnt) .space INTRCNT_COUNT * 4 * 2 -GLOBAL(eintrcnt) +GLOBAL(sintrcnt) + .word INTRCNT_COUNT * 4 * 2 .text .globl btext Modified: head/sys/powerpc/booke/locore.S ============================================================================== --- head/sys/powerpc/booke/locore.S Mon Jul 18 14:41:08 2011 (r224186) +++ head/sys/powerpc/booke/locore.S Mon Jul 18 15:19:40 2011 (r224187) @@ -789,10 +789,13 @@ GLOBAL(kernload) .long 0 GLOBAL(intrnames) .space INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 -GLOBAL(eintrnames) +GLOBAL(sintrnames) + .word INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 + .align 4 GLOBAL(intrcnt) .space INTRCNT_COUNT * 4 * 2 -GLOBAL(eintrcnt) +GLOBAL(sintrcnt) + .word INTRCNT_COUNT * 4 * 2 #include Modified: head/sys/sparc64/sparc64/exception.S ============================================================================== --- head/sys/sparc64/sparc64/exception.S Mon Jul 18 14:41:08 2011 (r224186) +++ head/sys/sparc64/sparc64/exception.S Mon Jul 18 15:19:40 2011 (r224187) @@ -371,14 +371,17 @@ END(rsf_fatal) .data _ALIGN_DATA - .globl intrnames, eintrnames + .globl intrnames, sintrnames intrnames: .space IV_MAX * (MAXCOMLEN + 1) -eintrnames: - .globl intrcnt, eintrcnt +sintrnames: + .word IV_MAX * (MAXCOMLEN + 1) + + .globl intrcnt, sintrcnt intrcnt: .space IV_MAX * 8 -eintrcnt: +sintrcnt: + .word IV_MAX * 8 .text Modified: head/sys/sparc64/sparc64/intr_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/intr_machdep.c Mon Jul 18 14:41:08 2011 (r224186) +++ head/sys/sparc64/sparc64/intr_machdep.c Mon Jul 18 15:19:40 2011 (r224187) @@ -171,7 +171,7 @@ static int intrcnt_setname(const char *name, int index) { - if (intrnames + (MAXCOMLEN + 1) * index >= eintrnames) + if ((MAXCOMLEN + 1) * index >= sintrnames) return (E2BIG); snprintf(intrnames + (MAXCOMLEN + 1) * index, MAXCOMLEN + 1, "%-*s", MAXCOMLEN, name); Modified: head/sys/sys/interrupt.h ============================================================================== --- head/sys/sys/interrupt.h Mon Jul 18 14:41:08 2011 (r224186) +++ head/sys/sys/interrupt.h Mon Jul 18 15:19:40 2011 (r224187) @@ -149,10 +149,10 @@ extern struct intr_event *clk_intr_event extern void *vm_ih; /* Counts and names for statistics (defined in MD code). */ -extern u_long eintrcnt[]; /* end of intrcnt[] */ -extern char eintrnames[]; /* end of intrnames[] */ extern u_long intrcnt[]; /* counts for for each device and stray */ extern char intrnames[]; /* string table containing device names */ +extern size_t sintrcnt; /* size of intrcnt table */ +extern size_t sintrnames; /* size of intrnames table */ #ifdef DDB void db_dump_intr_event(struct intr_event *ie, int handlers); Modified: head/usr.bin/vmstat/vmstat.c ============================================================================== --- head/usr.bin/vmstat/vmstat.c Mon Jul 18 14:41:08 2011 (r224186) +++ head/usr.bin/vmstat/vmstat.c Mon Jul 18 15:19:40 2011 (r224187) @@ -90,12 +90,12 @@ static struct nlist namelist[] = { { "_nchstats" }, #define X_INTRNAMES 5 { "_intrnames" }, -#define X_EINTRNAMES 6 - { "_eintrnames" }, +#define X_SINTRNAMES 6 + { "_sintrnames" }, #define X_INTRCNT 7 { "_intrcnt" }, -#define X_EINTRCNT 8 - { "_eintrcnt" }, +#define X_SINTRCNT 8 + { "_sintrcnt" }, #define X_KMEMSTATS 9 { "_kmemstatistics" }, #define X_KMEMZONES 10 @@ -1153,10 +1153,8 @@ dointr(void) uptime = getuptime(); if (kd != NULL) { - intrcntlen = namelist[X_EINTRCNT].n_value - - namelist[X_INTRCNT].n_value; - inamlen = namelist[X_EINTRNAMES].n_value - - namelist[X_INTRNAMES].n_value; + intrcntlen = namelist[X_SINTRCNT].n_value; + inamlen = namelist[X_SINTRNAMES].n_value; if ((intrcnt = malloc(intrcntlen)) == NULL || (intrname = malloc(inamlen)) == NULL) err(1, "malloc()"); From owner-svn-src-head@FreeBSD.ORG Mon Jul 18 17:33:09 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 356331065678; Mon, 18 Jul 2011 17:33:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 237638FC0C; Mon, 18 Jul 2011 17:33:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6IHX9kG032278; Mon, 18 Jul 2011 17:33:09 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6IHX8kx032272; Mon, 18 Jul 2011 17:33:08 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201107181733.p6IHX8kx032272@svn.freebsd.org> From: John Baldwin Date: Mon, 18 Jul 2011 17:33:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224188 - in head: sys/kern sys/sys usr.bin/top X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jul 2011 17:33:09 -0000 Author: jhb Date: Mon Jul 18 17:33:08 2011 New Revision: 224188 URL: http://svn.freebsd.org/changeset/base/224188 Log: - Export each thread's individual resource usage in in struct kinfo_proc's ki_rusage member when KERN_PROC_INC_THREAD is passed to one of the process sysctls. - Correctly account for the current thread's cputime in the thread when doing the runtime fixup in calcru(). - Use TIDs as the key to lookup the previous thread to compute IO stat deltas in IO mode in top when thread display is enabled. Reviewed by: kib Approved by: re (kib) Modified: head/sys/kern/kern_proc.c head/sys/kern/kern_resource.c head/sys/sys/resourcevar.h head/usr.bin/top/machine.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Mon Jul 18 15:19:40 2011 (r224187) +++ head/sys/kern/kern_proc.c Mon Jul 18 17:33:08 2011 (r224188) @@ -848,6 +848,8 @@ fill_kinfo_thread(struct thread *td, str kp->ki_tdaddr = td; PROC_LOCK_ASSERT(p, MA_OWNED); + if (preferthread) + PROC_SLOCK(p); thread_lock(td); if (td->td_wmesg != NULL) strlcpy(kp->ki_wmesg, td->td_wmesg, sizeof(kp->ki_wmesg)); @@ -899,6 +901,7 @@ fill_kinfo_thread(struct thread *td, str kp->ki_pri.pri_user = td->td_user_pri; if (preferthread) { + rufetchtd(td, &kp->ki_rusage); kp->ki_runtime = cputick2usec(td->td_rux.rux_runtime); kp->ki_pctcpu = sched_pctcpu(td); kp->ki_estcpu = td->td_estcpu; @@ -911,6 +914,8 @@ fill_kinfo_thread(struct thread *td, str kp->ki_siglist = td->td_siglist; kp->ki_sigmask = td->td_sigmask; thread_unlock(td); + if (preferthread) + PROC_SUNLOCK(p); } /* Modified: head/sys/kern/kern_resource.c ============================================================================== --- head/sys/kern/kern_resource.c Mon Jul 18 15:19:40 2011 (r224187) +++ head/sys/kern/kern_resource.c Mon Jul 18 17:33:08 2011 (r224188) @@ -813,7 +813,7 @@ void calcru(struct proc *p, struct timeval *up, struct timeval *sp) { struct thread *td; - uint64_t u; + uint64_t runtime, u; PROC_LOCK_ASSERT(p, MA_OWNED); PROC_SLOCK_ASSERT(p, MA_OWNED); @@ -826,7 +826,9 @@ calcru(struct proc *p, struct timeval *u td = curthread; if (td->td_proc == p) { u = cpu_ticks(); - p->p_rux.rux_runtime += u - PCPU_GET(switchtime); + runtime = u - PCPU_GET(switchtime); + td->td_runtime += runtime; + td->td_incruntime += runtime; PCPU_SET(switchtime, u); } /* Make sure the per-thread stats are current. */ @@ -838,6 +840,34 @@ calcru(struct proc *p, struct timeval *u calcru1(p, &p->p_rux, up, sp); } +/* Collect resource usage for a single thread. */ +void +rufetchtd(struct thread *td, struct rusage *ru) +{ + struct proc *p; + uint64_t runtime, u; + + p = td->td_proc; + PROC_SLOCK_ASSERT(p, MA_OWNED); + THREAD_LOCK_ASSERT(td, MA_OWNED); + /* + * If we are getting stats for the current thread, then add in the + * stats that this thread has accumulated in its current time slice. + * We reset the thread and CPU state as if we had performed a context + * switch right here. + */ + if (td == curthread) { + u = cpu_ticks(); + runtime = u - PCPU_GET(switchtime); + td->td_runtime += runtime; + td->td_incruntime += runtime; + PCPU_SET(switchtime, u); + } + ruxagg(p, td); + *ru = td->td_ru; + calcru1(p, &td->td_rux, &ru->ru_utime, &ru->ru_stime); +} + static void calcru1(struct proc *p, struct rusage_ext *ruxp, struct timeval *up, struct timeval *sp) @@ -955,12 +985,10 @@ kern_getrusage(struct thread *td, int wh case RUSAGE_THREAD: PROC_SLOCK(p); - ruxagg(p, td); - PROC_SUNLOCK(p); thread_lock(td); - *rup = td->td_ru; - calcru1(p, &td->td_rux, &rup->ru_utime, &rup->ru_stime); + rufetchtd(td, rup); thread_unlock(td); + PROC_SUNLOCK(p); break; default: Modified: head/sys/sys/resourcevar.h ============================================================================== --- head/sys/sys/resourcevar.h Mon Jul 18 15:19:40 2011 (r224187) +++ head/sys/sys/resourcevar.h Mon Jul 18 17:33:08 2011 (r224188) @@ -136,6 +136,7 @@ void rucollect(struct rusage *ru, struc void rufetch(struct proc *p, struct rusage *ru); void rufetchcalc(struct proc *p, struct rusage *ru, struct timeval *up, struct timeval *sp); +void rufetchtd(struct thread *td, struct rusage *ru); void ruxagg(struct proc *p, struct thread *td); int suswintr(void *base, int word); struct uidinfo Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Mon Jul 18 15:19:40 2011 (r224187) +++ head/usr.bin/top/machine.c Mon Jul 18 17:33:08 2011 (r224188) @@ -235,6 +235,7 @@ static int *pcpu_cpu_states; static int compare_jid(const void *a, const void *b); static int compare_pid(const void *a, const void *b); +static int compare_tid(const void *a, const void *b); static const char *format_nice(const struct kinfo_proc *pp); static void getsysctl(const char *name, void *ptr, size_t len); static int swapmode(int *retavail, int *retfree); @@ -557,7 +558,7 @@ get_old_proc(struct kinfo_proc *pp) * cache it. */ oldpp = bsearch(&pp, previous_pref, previous_proc_count, - sizeof(*previous_pref), compare_pid); + sizeof(*previous_pref), ps.thread ? compare_tid : compare_pid); if (oldpp == NULL) { pp->ki_udata = NOPROC; return (NULL); @@ -652,7 +653,7 @@ get_process_info(struct system_info *si, previous_pref[i] = &previous_procs[i]; bcopy(pbase, previous_procs, nproc * sizeof(*previous_procs)); qsort(previous_pref, nproc, sizeof(*previous_pref), - compare_pid); + ps.thread ? compare_tid : compare_pid); } previous_proc_count = nproc; @@ -1059,6 +1060,18 @@ compare_pid(const void *p1, const void * return ((*pp1)->ki_pid - (*pp2)->ki_pid); } +static int +compare_tid(const void *p1, const void *p2) +{ + const struct kinfo_proc * const *pp1 = p1; + const struct kinfo_proc * const *pp2 = p2; + + if ((*pp2)->ki_tid < 0 || (*pp1)->ki_tid < 0) + abort(); + + return ((*pp1)->ki_tid - (*pp2)->ki_tid); +} + /* * proc_compare - comparison function for "qsort" * Compares the resource consumption of two processes using five From owner-svn-src-head@FreeBSD.ORG Mon Jul 18 19:23:50 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69F7C106564A; Mon, 18 Jul 2011 19:23:50 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 596728FC17; Mon, 18 Jul 2011 19:23:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6IJNo9E036045; Mon, 18 Jul 2011 19:23:50 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6IJNoNS036043; Mon, 18 Jul 2011 19:23:50 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201107181923.p6IJNoNS036043@svn.freebsd.org> From: Xin LI Date: Mon, 18 Jul 2011 19:23:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224196 - head/lib/libz X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jul 2011 19:23:50 -0000 Author: delphij Date: Mon Jul 18 19:23:50 2011 New Revision: 224196 URL: http://svn.freebsd.org/changeset/base/224196 Log: Disable gvmat64.S, the assembler version of longest_match for now. PR: kern/154073 MFC after: 3 days Approved by: re (kib) Modified: head/lib/libz/Makefile Modified: head/lib/libz/Makefile ============================================================================== --- head/lib/libz/Makefile Mon Jul 18 18:56:50 2011 (r224195) +++ head/lib/libz/Makefile Mon Jul 18 19:23:50 2011 (r224196) @@ -42,16 +42,16 @@ CFLAGS+= -DASMV -DNO_UNDERLINE ACFLAGS+= -Wa,--noexecstack .endif -.if ${MACHINE_ARCH} == "amd64" -.PATH: ${.CURDIR}/contrib/gcc_gvmat64 -SRCS+= gvmat64.S -CFLAGS+= -DASMV -DNO_UNDERLINE -ACFLAGS+= -Wa,--noexecstack -.if ${CC:T:Mclang} == "clang" -# XXX: clang integrated-as doesn't grok .intel_syntax directives yet -ACFLAGS+= ${.IMPSRC:T:Mgvmat64.S:C/^.+$/-no-integrated-as/} -.endif -.endif +#.if ${MACHINE_ARCH} == "amd64" +#.PATH: ${.CURDIR}/contrib/gcc_gvmat64 +#SRCS+= gvmat64.S +#CFLAGS+= -DASMV -DNO_UNDERLINE +#ACFLAGS+= -Wa,--noexecstack +#.if ${CC:T:Mclang} == "clang" +## XXX: clang integrated-as doesn't grok .intel_syntax directives yet +#ACFLAGS+= ${.IMPSRC:T:Mgvmat64.S:C/^.+$/-no-integrated-as/} +#.endif +#.endif VERSION_DEF= ${.CURDIR}/Versions.def SYMBOL_MAPS= ${.CURDIR}/Symbol.map From owner-svn-src-head@FreeBSD.ORG Mon Jul 18 19:42:18 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A60A8106566C; Mon, 18 Jul 2011 19:42:18 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 95BEC8FC14; Mon, 18 Jul 2011 19:42:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6IJgIha036675; Mon, 18 Jul 2011 19:42:18 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6IJgIqe036673; Mon, 18 Jul 2011 19:42:18 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201107181942.p6IJgIqe036673@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 18 Jul 2011 19:42:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224198 - head/usr.bin/vmstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jul 2011 19:42:18 -0000 Author: pluknet Date: Mon Jul 18 19:42:18 2011 New Revision: 224198 URL: http://svn.freebsd.org/changeset/base/224198 Log: sintrcnt/sintrnames is the address of the size, not the actual size. Use them appropriately to fetch the actual size. That fixes vmstat -i with kvm backend. Submitted by: peter Approved by: re (kib) Modified: head/usr.bin/vmstat/vmstat.c Modified: head/usr.bin/vmstat/vmstat.c ============================================================================== --- head/usr.bin/vmstat/vmstat.c Mon Jul 18 19:26:16 2011 (r224197) +++ head/usr.bin/vmstat/vmstat.c Mon Jul 18 19:42:18 2011 (r224198) @@ -1153,8 +1153,8 @@ dointr(void) uptime = getuptime(); if (kd != NULL) { - intrcntlen = namelist[X_SINTRCNT].n_value; - inamlen = namelist[X_SINTRNAMES].n_value; + kread(X_SINTRCNT, &intrcntlen, sizeof(intrcntlen)); + kread(X_SINTRNAMES, &inamlen, sizeof(inamlen)); if ((intrcnt = malloc(intrcntlen)) == NULL || (intrname = malloc(inamlen)) == NULL) err(1, "malloc()"); From owner-svn-src-head@FreeBSD.ORG Mon Jul 18 20:04:57 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD6CE106566B; Mon, 18 Jul 2011 20:04:57 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 6570E8FC14; Mon, 18 Jul 2011 20:04:57 +0000 (UTC) Received: from sa-nc-spg-102.static.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id p6IK4n5a086435 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 18 Jul 2011 13:04:56 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <201107181405.p6IE5F6t026025@svn.freebsd.org> Date: Mon, 18 Jul 2011 13:04:44 -0700 Content-Transfer-Encoding: 7bit Message-Id: <0F23C64B-26BA-4E29-83DE-D54EE330A3F3@xcllnt.net> References: <201107181405.p6IE5F6t026025@svn.freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r224185 - head/sys/ia64/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jul 2011 20:04:57 -0000 On Jul 18, 2011, at 7:05 AM, John Baldwin wrote: > Author: jhb > Date: Mon Jul 18 14:05:14 2011 > New Revision: 224185 > URL: http://svn.freebsd.org/changeset/base/224185 > > Log: > Enable NEW_PCIB by default on ia64. Thanks John! -- Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@FreeBSD.ORG Mon Jul 18 20:06:15 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAD881065677; Mon, 18 Jul 2011 20:06:15 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C86768FC12; Mon, 18 Jul 2011 20:06:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6IK6Ff1037413; Mon, 18 Jul 2011 20:06:15 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6IK6FCJ037403; Mon, 18 Jul 2011 20:06:15 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201107182006.p6IK6FCJ037403@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 18 Jul 2011 20:06:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224199 - in head: bin/ps lib/libkvm sys/compat/freebsd32 sys/kern sys/sys usr.bin/procstat usr.bin/top X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jul 2011 20:06:16 -0000 Author: bz Date: Mon Jul 18 20:06:15 2011 New Revision: 224199 URL: http://svn.freebsd.org/changeset/base/224199 Log: Rename ki_ocomm to ki_tdname and OCOMMLEN to TDNAMLEN. Provide backward compatibility defines under BURN_BRIDGES. Suggested by: jhb Reviewed by: emaste Sponsored by: Sandvine Incorporated Approved by: re (kib) Modified: head/bin/ps/keyword.c head/bin/ps/print.c head/lib/libkvm/kvm_proc.c head/sys/compat/freebsd32/freebsd32.h head/sys/kern/kern_proc.c head/sys/sys/user.h head/usr.bin/procstat/procstat_kstack.c head/usr.bin/procstat/procstat_threads.c head/usr.bin/top/machine.c Modified: head/bin/ps/keyword.c ============================================================================== --- head/bin/ps/keyword.c Mon Jul 18 19:42:18 2011 (r224198) +++ head/bin/ps/keyword.c Mon Jul 18 20:06:15 2011 (r224199) @@ -82,7 +82,7 @@ static VAR var[] = { {"class", "CLASS", NULL, LJUST, loginclass, s_loginclass, MAXLOGNAME-1, 0, CHAR, NULL, 0}, {"comm", "COMMAND", NULL, LJUST, ucomm, s_comm, - COMMLEN + OCOMMLEN + 1, 0, CHAR, NULL, 0}, + COMMLEN + TDNAMLEN + 1, 0, CHAR, NULL, 0}, {"command", "COMMAND", NULL, COMM|LJUST|USER, command, NULL, 16, 0, CHAR, NULL, 0}, {"cpu", "CPU", NULL, 0, kvar, NULL, 3, KOFF(ki_estcpu), UINT, "d", @@ -212,7 +212,7 @@ static VAR var[] = { {"tt", "TT ", NULL, 0, tname, NULL, 4, 0, CHAR, NULL, 0}, {"tty", "TTY", NULL, LJUST, longtname, NULL, 8, 0, CHAR, NULL, 0}, {"ucomm", "UCOMM", NULL, LJUST, ucomm, s_comm, - COMMLEN + OCOMMLEN + 1, 0, CHAR, NULL, 0}, + COMMLEN + TDNAMLEN + 1, 0, CHAR, NULL, 0}, {"uid", "UID", NULL, 0, kvar, NULL, UIDLEN, KOFF(ki_uid), UINT, UIDFMT, 0}, {"upr", "UPR", NULL, 0, upr, NULL, 3, 0, CHAR, NULL, 0}, Modified: head/bin/ps/print.c ============================================================================== --- head/bin/ps/print.c Mon Jul 18 19:42:18 2011 (r224198) +++ head/bin/ps/print.c Mon Jul 18 20:06:15 2011 (r224199) @@ -136,7 +136,7 @@ command(KINFO *k, VARENT *ve) (void)printf("%s", k->ki_d.prefix); (void)printf("%s", k->ki_p->ki_comm); if (showthreads && k->ki_p->ki_numthreads > 1) - (void)printf("/%s", k->ki_p->ki_ocomm); + (void)printf("/%s", k->ki_p->ki_tdname); } else (void)printf("%-*s", v->width, k->ki_p->ki_comm); return; @@ -190,7 +190,7 @@ command(KINFO *k, VARENT *ve) void ucomm(KINFO *k, VARENT *ve) { - char tmpbuff[COMMLEN + OCOMMLEN + 2]; + char tmpbuff[COMMLEN + TDNAMLEN + 2]; VAR *v; v = ve->var; @@ -199,12 +199,12 @@ ucomm(KINFO *k, VARENT *ve) (void)printf("%s", k->ki_d.prefix); (void)printf("%s", k->ki_p->ki_comm); if (showthreads && k->ki_p->ki_numthreads > 1) - printf("/%s", k->ki_p->ki_ocomm); + printf("/%s", k->ki_p->ki_tdname); } else { bzero(tmpbuff, sizeof(tmpbuff)); if (showthreads && k->ki_p->ki_numthreads > 1) sprintf(tmpbuff, "%s/%s", k->ki_p->ki_comm, - k->ki_p->ki_ocomm); + k->ki_p->ki_tdname); else sprintf(tmpbuff, "%s", k->ki_p->ki_comm); (void)printf("%-*s", v->width, tmpbuff); @@ -218,7 +218,7 @@ tdnam(KINFO *k, VARENT *ve) v = ve->var; if (showthreads && k->ki_p->ki_numthreads > 1) - (void)printf("%-*s", v->width, k->ki_p->ki_ocomm); + (void)printf("%-*s", v->width, k->ki_p->ki_tdname); else (void)printf("%-*s", v->width, " "); } @@ -943,12 +943,12 @@ loginclass(KINFO *k, VARENT *ve) int s_comm(KINFO *k) { - char tmpbuff[COMMLEN + OCOMMLEN + 2]; + char tmpbuff[COMMLEN + TDNAMLEN + 2]; bzero(tmpbuff, sizeof(tmpbuff)); if (showthreads && k->ki_p->ki_numthreads > 1) sprintf(tmpbuff, "%s/%s", k->ki_p->ki_comm, - k->ki_p->ki_ocomm); + k->ki_p->ki_tdname); else sprintf(tmpbuff, "%s", k->ki_p->ki_comm); return (strlen(tmpbuff)); Modified: head/lib/libkvm/kvm_proc.c ============================================================================== --- head/lib/libkvm/kvm_proc.c Mon Jul 18 19:42:18 2011 (r224198) +++ head/lib/libkvm/kvm_proc.c Mon Jul 18 20:06:15 2011 (r224199) @@ -426,10 +426,10 @@ nopgrp: kp->ki_lastcpu = mtd.td_lastcpu; kp->ki_wchan = mtd.td_wchan; if (mtd.td_name[0] != 0) - strlcpy(kp->ki_ocomm, mtd.td_name, MAXCOMLEN); + strlcpy(kp->ki_tdname, mtd.td_name, MAXCOMLEN); kp->ki_oncpu = mtd.td_oncpu; if (mtd.td_name[0] != '\0') - strlcpy(kp->ki_ocomm, mtd.td_name, sizeof(kp->ki_ocomm)); + strlcpy(kp->ki_tdname, mtd.td_name, sizeof(kp->ki_tdname)); kp->ki_pctcpu = 0; kp->ki_rqindex = 0; } else { Modified: head/sys/compat/freebsd32/freebsd32.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32.h Mon Jul 18 19:42:18 2011 (r224198) +++ head/sys/compat/freebsd32/freebsd32.h Mon Jul 18 20:06:15 2011 (r224199) @@ -310,7 +310,7 @@ struct kinfo_proc32 { char ki_rqindex; u_char ki_oncpu; u_char ki_lastcpu; - char ki_ocomm[OCOMMLEN+1]; + char ki_tdname[TDNAMLEN+1]; char ki_wmesg[WMESGLEN+1]; char ki_login[LOGNAMELEN+1]; char ki_lockname[LOCKNAMELEN+1]; Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Mon Jul 18 19:42:18 2011 (r224198) +++ head/sys/kern/kern_proc.c Mon Jul 18 20:06:15 2011 (r224199) @@ -855,7 +855,7 @@ fill_kinfo_thread(struct thread *td, str strlcpy(kp->ki_wmesg, td->td_wmesg, sizeof(kp->ki_wmesg)); else bzero(kp->ki_wmesg, sizeof(kp->ki_wmesg)); - strlcpy(kp->ki_ocomm, td->td_name, sizeof(kp->ki_ocomm)); + strlcpy(kp->ki_tdname, td->td_name, sizeof(kp->ki_tdname)); if (TD_ON_LOCK(td)) { kp->ki_kiflag |= KI_LOCKBLOCK; strlcpy(kp->ki_lockname, td->td_lockname, @@ -1059,7 +1059,7 @@ freebsd32_kinfo_proc_out(const struct ki CP(*ki, *ki32, ki_rqindex); CP(*ki, *ki32, ki_oncpu); CP(*ki, *ki32, ki_lastcpu); - bcopy(ki->ki_ocomm, ki32->ki_ocomm, OCOMMLEN + 1); + bcopy(ki->ki_tdname, ki32->ki_tdname, TDNAMLEN + 1); bcopy(ki->ki_wmesg, ki32->ki_wmesg, WMESGLEN + 1); bcopy(ki->ki_login, ki32->ki_login, LOGNAMELEN + 1); bcopy(ki->ki_lockname, ki32->ki_lockname, LOCKNAMELEN + 1); Modified: head/sys/sys/user.h ============================================================================== --- head/sys/sys/user.h Mon Jul 18 19:42:18 2011 (r224198) +++ head/sys/sys/user.h Mon Jul 18 20:06:15 2011 (r224199) @@ -95,13 +95,18 @@ #define WMESGLEN 8 /* size of returned wchan message */ #define LOCKNAMELEN 8 /* size of returned lock name */ -#define OCOMMLEN 16 /* size of returned thread name */ +#define TDNAMLEN 16 /* size of returned thread name */ #define COMMLEN 19 /* size of returned ki_comm name */ #define KI_EMULNAMELEN 16 /* size of returned ki_emul */ #define KI_NGROUPS 16 /* number of groups in ki_groups */ #define LOGNAMELEN 17 /* size of returned ki_login */ #define LOGINCLASSLEN 17 /* size of returned ki_loginclass */ +#ifndef BURN_BRIDGES +#define OCOMMLEN TDNAMLEN +#define ki_ocomm ki_tdname +#endif + /* Flags for the process credential. */ #define KI_CRF_CAPABILITY_MODE 0x00000001 /* @@ -167,7 +172,7 @@ struct kinfo_proc { char ki_rqindex; /* Run queue index */ u_char ki_oncpu; /* Which cpu we are on */ u_char ki_lastcpu; /* Last cpu we were on */ - char ki_ocomm[OCOMMLEN+1]; /* thread name */ + char ki_tdname[TDNAMLEN+1]; /* thread name */ char ki_wmesg[WMESGLEN+1]; /* wchan message */ char ki_login[LOGNAMELEN+1]; /* setlogin name */ char ki_lockname[LOCKNAMELEN+1]; /* lock name */ Modified: head/usr.bin/procstat/procstat_kstack.c ============================================================================== --- head/usr.bin/procstat/procstat_kstack.c Mon Jul 18 19:42:18 2011 (r224198) +++ head/usr.bin/procstat/procstat_kstack.c Mon Jul 18 20:06:15 2011 (r224199) @@ -213,9 +213,9 @@ procstat_kstack(struct kinfo_proc *kipp, printf("%5d ", kipp->ki_pid); printf("%6d ", kkstp->kkst_tid); printf("%-16s ", kipp->ki_comm); - printf("%-16s ", (strlen(kipp->ki_ocomm) && - (strcmp(kipp->ki_comm, kipp->ki_ocomm) != 0)) ? - kipp->ki_ocomm : "-"); + printf("%-16s ", (strlen(kipp->ki_tdname) && + (strcmp(kipp->ki_comm, kipp->ki_tdname) != 0)) ? + kipp->ki_tdname : "-"); switch (kkstp->kkst_state) { case KKST_STATE_RUNNING: Modified: head/usr.bin/procstat/procstat_threads.c ============================================================================== --- head/usr.bin/procstat/procstat_threads.c Mon Jul 18 19:42:18 2011 (r224198) +++ head/usr.bin/procstat/procstat_threads.c Mon Jul 18 20:06:15 2011 (r224199) @@ -86,9 +86,9 @@ procstat_threads(struct kinfo_proc *kipp printf("%6d ", kipp->ki_tid); printf("%-16s ", strlen(kipp->ki_comm) ? kipp->ki_comm : "-"); - printf("%-16s ", (strlen(kipp->ki_ocomm) && - (strcmp(kipp->ki_comm, kipp->ki_ocomm) != 0)) ? - kipp->ki_ocomm : "-"); + printf("%-16s ", (strlen(kipp->ki_tdname) && + (strcmp(kipp->ki_comm, kipp->ki_tdname) != 0)) ? + kipp->ki_tdname : "-"); if (kipp->ki_oncpu != 255) printf("%3d ", kipp->ki_oncpu); else if (kipp->ki_lastcpu != 255) Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Mon Jul 18 19:42:18 2011 (r224198) +++ head/usr.bin/top/machine.c Mon Jul 18 20:06:15 2011 (r224199) @@ -833,8 +833,8 @@ format_next_process(caddr_t handle, char if (!(flags & FMT_SHOWARGS)) { if (ps.thread && pp->ki_flag & P_HADTHREADS && - pp->ki_ocomm[0]) { - snprintf(cmdbuf, cmdlengthdelta, "{%s}", pp->ki_ocomm); + pp->ki_tdname[0]) { + snprintf(cmdbuf, cmdlengthdelta, "{%s}", pp->ki_tdname); } else { snprintf(cmdbuf, cmdlengthdelta, "%s", pp->ki_comm); } @@ -844,9 +844,9 @@ format_next_process(caddr_t handle, char (args = kvm_getargv(kd, pp, cmdlengthdelta)) == NULL || !(*args)) { if (ps.thread && pp->ki_flag & P_HADTHREADS && - pp->ki_ocomm[0]) { + pp->ki_tdname[0]) { snprintf(cmdbuf, cmdlengthdelta, - "{%s}", pp->ki_ocomm); + "{%s}", pp->ki_tdname); } else { snprintf(cmdbuf, cmdlengthdelta, "[%s]", pp->ki_comm); From owner-svn-src-head@FreeBSD.ORG Mon Jul 18 20:07:29 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84351106567C; Mon, 18 Jul 2011 20:07:29 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 747F88FC14; Mon, 18 Jul 2011 20:07:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6IK7T7t037524; Mon, 18 Jul 2011 20:07:29 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6IK7Thi037522; Mon, 18 Jul 2011 20:07:29 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201107182007.p6IK7Thi037522@svn.freebsd.org> From: Dimitry Andric Date: Mon, 18 Jul 2011 20:07:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224201 - head/lib/libc/stdlib X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jul 2011 20:07:29 -0000 Author: dim Date: Mon Jul 18 20:07:29 2011 New Revision: 224201 URL: http://svn.freebsd.org/changeset/base/224201 Log: Fix building of 32-bit compat libraries on amd64 with clang, and using -g, by reverting r219139. The LLVM PR referenced in that revision was fixed in the mean time, and we imported a clang snapshot soon afterwards, so the temporary workaround of disabling clang's integrated assembler is no longer needed. In this particular case, using e.g. DEBUG_FLAGS=-g causes clang to output certain directives into assembly that our version of GNU as chokes on. Reported by: dougb Approved by: re (kib) Modified: head/lib/libc/stdlib/Makefile.inc Modified: head/lib/libc/stdlib/Makefile.inc ============================================================================== --- head/lib/libc/stdlib/Makefile.inc Mon Jul 18 20:06:49 2011 (r224200) +++ head/lib/libc/stdlib/Makefile.inc Mon Jul 18 20:07:29 2011 (r224201) @@ -51,7 +51,3 @@ MLINKS+=tsearch.3 tdelete.3 tsearch.3 tf CFLAGS+= -DMALLOC_PRODUCTION .endif -.if ${CC:T:Mclang} == "clang" -# XXX: Temporary workaround for LLVM PR 9352 -CFLAGS+= ${.IMPSRC:T:Mmalloc.c:C/^.+$/-no-integrated-as/} -.endif From owner-svn-src-head@FreeBSD.ORG Mon Jul 18 20:57:43 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9F38106564A; Mon, 18 Jul 2011 20:57:43 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 80E518FC18; Mon, 18 Jul 2011 20:57:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6IKvhhJ039027; Mon, 18 Jul 2011 20:57:43 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6IKvhWi039025; Mon, 18 Jul 2011 20:57:43 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201107182057.p6IKvhWi039025@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Mon, 18 Jul 2011 20:57:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224202 - head/usr.bin/top X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jul 2011 20:57:43 -0000 Author: bz Date: Mon Jul 18 20:57:43 2011 New Revision: 224202 URL: http://svn.freebsd.org/changeset/base/224202 Log: Constantly print the command name and if set include the thread name in per-thread mode. Discussed with: jhb Obtained from: Ed Maste at Sandvine Incorporated Sponsored by: Sandvine Incorporated MFC after: 1 week Approved by: re (kib) Modified: head/usr.bin/top/machine.c Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Mon Jul 18 20:07:29 2011 (r224201) +++ head/usr.bin/top/machine.c Mon Jul 18 20:57:43 2011 (r224202) @@ -834,7 +834,8 @@ format_next_process(caddr_t handle, char if (!(flags & FMT_SHOWARGS)) { if (ps.thread && pp->ki_flag & P_HADTHREADS && pp->ki_tdname[0]) { - snprintf(cmdbuf, cmdlengthdelta, "{%s}", pp->ki_tdname); + snprintf(cmdbuf, cmdlengthdelta, "%s{%s}", pp->ki_comm, + pp->ki_tdname); } else { snprintf(cmdbuf, cmdlengthdelta, "%s", pp->ki_comm); } @@ -846,7 +847,7 @@ format_next_process(caddr_t handle, char if (ps.thread && pp->ki_flag & P_HADTHREADS && pp->ki_tdname[0]) { snprintf(cmdbuf, cmdlengthdelta, - "{%s}", pp->ki_tdname); + "[%s{%s}]", pp->ki_comm, pp->ki_tdname); } else { snprintf(cmdbuf, cmdlengthdelta, "[%s]", pp->ki_comm); @@ -890,12 +891,23 @@ format_next_process(caddr_t handle, char dst--; *dst = '\0'; - if (strcmp(cmd, pp->ki_comm) != 0 ) - snprintf(cmdbuf, cmdlengthdelta, - "%s (%s)",argbuf, pp->ki_comm); - else - strlcpy(cmdbuf, argbuf, cmdlengthdelta); - + if (strcmp(cmd, pp->ki_comm) != 0 ) { + if (ps.thread && pp->ki_flag & P_HADTHREADS && + pp->ki_tdname[0]) + snprintf(cmdbuf, cmdlengthdelta, + "%s (%s){%s}", argbuf, pp->ki_comm, + pp->ki_tdname); + else + snprintf(cmdbuf, cmdlengthdelta, + "%s (%s)", argbuf, pp->ki_comm); + } else { + if (ps.thread && pp->ki_flag & P_HADTHREADS && + pp->ki_tdname[0]) + snprintf(cmdbuf, cmdlengthdelta, + "%s{%s}", argbuf, pp->ki_tdname); + else + strlcpy(cmdbuf, argbuf, cmdlengthdelta); + } free(argbuf); } } From owner-svn-src-head@FreeBSD.ORG Mon Jul 18 21:08:15 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 219E21065670; Mon, 18 Jul 2011 21:08:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 123AC8FC15; Mon, 18 Jul 2011 21:08:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6IL8Ewu039423; Mon, 18 Jul 2011 21:08:14 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6IL8EBl039421; Mon, 18 Jul 2011 21:08:14 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201107182108.p6IL8EBl039421@svn.freebsd.org> From: John Baldwin Date: Mon, 18 Jul 2011 21:08:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224204 - head/contrib/top X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jul 2011 21:08:15 -0000 Author: jhb Date: Mon Jul 18 21:08:14 2011 New Revision: 224204 URL: http://svn.freebsd.org/changeset/base/224204 Log: Tweak the interactive description of CPU vs WCPU. PR: bin/158819 Submitted by: arundel Approved by: re (kib) Modified: head/contrib/top/top.c Modified: head/contrib/top/top.c ============================================================================== --- head/contrib/top/top.c Mon Jul 18 21:04:35 2011 (r224203) +++ head/contrib/top/top.c Mon Jul 18 21:08:14 2011 (r224204) @@ -1029,8 +1029,8 @@ restart: case CMD_wcputog: ps.wcpu = !ps.wcpu; new_message(MT_standout | MT_delayed, - " Displaying %sCPU", - ps.wcpu ? "W" : ""); + " Displaying %s CPU", + ps.wcpu ? "weighted" : "raw"); header_text = format_header(uname_field); reset_display(); putchar('\r'); From owner-svn-src-head@FreeBSD.ORG Mon Jul 18 21:15:48 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E45E106566C; Mon, 18 Jul 2011 21:15:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 140A38FC15; Mon, 18 Jul 2011 21:15:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6ILFlxf039708; Mon, 18 Jul 2011 21:15:47 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6ILFlGL039704; Mon, 18 Jul 2011 21:15:47 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201107182115.p6ILFlGL039704@svn.freebsd.org> From: John Baldwin Date: Mon, 18 Jul 2011 21:15:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224205 - in head: contrib/top usr.bin/top X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jul 2011 21:15:48 -0000 Author: jhb Date: Mon Jul 18 21:15:47 2011 New Revision: 224205 URL: http://svn.freebsd.org/changeset/base/224205 Log: Rework the dynamic per-CPU stats code a bit. Always set 'statics->ncpus' to the maximum number of CPUs to ensure that lcpustates[] array is always allocated to the maximum size. Previously, if top was started without per-CPU stats it would allocate a smaller lcpustates[] array. When per-CPU stats were then enabled, it would overflow the array and trash the cpustates_columns[] array causing the CPU stats to be printed in the wrong locations. Approved by: re (kib) MFC after: 1 week Modified: head/contrib/top/display.c head/contrib/top/top.c head/usr.bin/top/machine.c Modified: head/contrib/top/display.c ============================================================================== --- head/contrib/top/display.c Mon Jul 18 21:08:14 2011 (r224204) +++ head/contrib/top/display.c Mon Jul 18 21:15:47 2011 (r224205) @@ -156,18 +156,30 @@ int display_updatecpus(statics) struct statics *statics; { + register int *lp; register int lines; register int i; /* call resize to do the dirty work */ lines = display_resize(); - num_cpus = statics->ncpus; + if (pcpu_stats) + num_cpus = statics->ncpus; + else + num_cpus = 1; cpustates_column = 5; /* CPU: */ if (num_cpus != 1) cpustates_column += 2; /* CPU 0: */ for (i = num_cpus; i > 9; i /= 10) cpustates_column++; + /* fill the "last" array with all -1s, to insure correct updating */ + lp = lcpustates; + i = num_cpustates * num_cpus; + while (--i >= 0) + { + *lp++ = -1; + } + return(lines); } @@ -197,7 +209,7 @@ struct statics *statics; num_swap = string_count(swap_names); lswap = (int *)malloc(num_swap * sizeof(int)); num_cpustates = string_count(cpustate_names); - lcpustates = (int *)malloc(num_cpustates * sizeof(int) * num_cpus); + lcpustates = (int *)malloc(num_cpustates * sizeof(int) * statics->ncpus); cpustate_columns = (int *)malloc(num_cpustates * sizeof(int)); memory_names = statics->memory_names; Modified: head/contrib/top/top.c ============================================================================== --- head/contrib/top/top.c Mon Jul 18 21:08:14 2011 (r224204) +++ head/contrib/top/top.c Mon Jul 18 21:15:47 2011 (r224205) @@ -1094,7 +1094,7 @@ restart: new_message(MT_standout | MT_delayed, " Displaying %sCPU statistics.", pcpu_stats ? "per-" : "global "); - toggle_pcpustats(&statics); + toggle_pcpustats(); max_topn = display_updatecpus(&statics); reset_display(); putchar('\r'); Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Mon Jul 18 21:08:14 2011 (r224204) +++ head/usr.bin/top/machine.c Mon Jul 18 21:15:47 2011 (r224205) @@ -241,7 +241,7 @@ static void getsysctl(const char *name, static int swapmode(int *retavail, int *retfree); void -toggle_pcpustats(struct statics *statics) +toggle_pcpustats(void) { if (ncpus == 1) @@ -256,7 +256,6 @@ toggle_pcpustats(struct statics *statics y_header += ncpus - 1; /* 6 */ y_procs += ncpus - 1; /* 7 */ Header_lines += ncpus - 1; /* 7 */ - statics->ncpus = ncpus; } else { y_mem = 3; y_swap = 4; @@ -265,7 +264,6 @@ toggle_pcpustats(struct statics *statics y_header = 6; y_procs = 7; Header_lines = 7; - statics->ncpus = 1; } } @@ -356,10 +354,10 @@ machine_init(struct statics *statics, ch pcpu_cp_old = calloc(1, size); pcpu_cp_diff = calloc(1, size); pcpu_cpu_states = calloc(1, size); - statics->ncpus = 1; + statics->ncpus = ncpus; if (pcpu_stats) - toggle_pcpustats(statics); + toggle_pcpustats(); /* all done! */ return (0); From owner-svn-src-head@FreeBSD.ORG Tue Jul 19 00:20:42 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B81751065675; Tue, 19 Jul 2011 00:20:42 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 8204A8FC20; Tue, 19 Jul 2011 00:20:42 +0000 (UTC) Received: from sa-nc-spg-102.static.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id p6J0KZ6X087521 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 18 Jul 2011 17:20:41 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <201107181519.p6IFJfOK028280@svn.freebsd.org> Date: Mon, 18 Jul 2011 17:20:29 -0700 Content-Transfer-Encoding: 7bit Message-Id: <208D139E-CDC3-428D-8D5F-F772BFAF164C@xcllnt.net> References: <201107181519.p6IFJfOK028280@svn.freebsd.org> To: Attilio Rao X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r224187 - in head: sys/amd64/amd64 sys/arm/arm sys/arm/sa11x0 sys/i386/i386 sys/ia64/ia64 sys/kern sys/mips/mips sys/powerpc/aim sys/powerpc/booke sys/sparc64/sparc64 sys/sys usr.bin/vm... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jul 2011 00:20:42 -0000 On Jul 18, 2011, at 8:19 AM, Attilio Rao wrote: > Author: attilio > Date: Mon Jul 18 15:19:40 2011 > New Revision: 224187 > URL: http://svn.freebsd.org/changeset/base/224187 > > Log: > - Remove the eintrcnt/eintrnames usage and introduce the concept of > sintrcnt/sintrnames which are symbols containing the size of the 2 > tables. > - For amd64/i386 remove the storage of intr* stuff from assembly files. > This area can be widely improved by applying the same to other > architectures and likely finding an unified approach among them and > move the whole code to be MI. More work in this area is expected to > happen fairly soon. > > No MFC is previewed for this patch. You just broke ia64 and possibly other 64-bit architectures: ".word" declares a 16-bit integral on ia64 and the size symbols are of type size_t (=64 bit). We'll be having misaligned loads (= kernel panics) and/or reading garbage... Use "data8" on ia64, as per the assembly language reference. eris% cat x.s .data foo: .word 0x11223344 foo1: .byte 0x99 eris% as x.s -o x.o x.s: Assembler messages: x.s:3: Warning: value 0x11223344 truncated to 0x3344 eris% nm x.o 0000000000000000 d foo 0000000000000002 d foo1 FYI, -- Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@FreeBSD.ORG Tue Jul 19 00:37:24 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDB7F1065673; Tue, 19 Jul 2011 00:37:24 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB9838FC14; Tue, 19 Jul 2011 00:37:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6J0bOqN046041; Tue, 19 Jul 2011 00:37:24 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6J0bO6K046031; Tue, 19 Jul 2011 00:37:24 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201107190037.p6J0bO6K046031@svn.freebsd.org> From: Attilio Rao Date: Tue, 19 Jul 2011 00:37:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224207 - in head/sys: amd64/include arm/include conf i386/include ia64/include mips/include powerpc/include sparc64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jul 2011 00:37:25 -0000 Author: attilio Date: Tue Jul 19 00:37:24 2011 New Revision: 224207 URL: http://svn.freebsd.org/changeset/base/224207 Log: Add the possibility to specify from kernel configs MAXCPU value. This patch is going to help in cases like mips flavours where you want a more granular support on MAXCPU. No MFC is previewed for this patch. Tested by: pluknet Approved by: re (kib) Modified: head/sys/amd64/include/param.h head/sys/arm/include/param.h head/sys/conf/NOTES head/sys/conf/options head/sys/i386/include/param.h head/sys/ia64/include/param.h head/sys/mips/include/param.h head/sys/powerpc/include/param.h head/sys/sparc64/include/param.h Modified: head/sys/amd64/include/param.h ============================================================================== --- head/sys/amd64/include/param.h Mon Jul 18 22:00:21 2011 (r224206) +++ head/sys/amd64/include/param.h Tue Jul 19 00:37:24 2011 (r224207) @@ -64,7 +64,9 @@ #endif #if defined(SMP) || defined(KLD_MODULE) +#ifndef MAXCPU #define MAXCPU 32 +#endif #else #define MAXCPU 1 #endif Modified: head/sys/arm/include/param.h ============================================================================== --- head/sys/arm/include/param.h Mon Jul 18 22:00:21 2011 (r224206) +++ head/sys/arm/include/param.h Tue Jul 19 00:37:24 2011 (r224207) @@ -61,7 +61,9 @@ #define MID_MACHINE MID_ARM6 #if defined(SMP) || defined(KLD_MODULE) +#ifndef MAXCPU #define MAXCPU 2 +#endif #else #define MAXCPU 1 #endif /* SMP || KLD_MODULE */ Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Jul 18 22:00:21 2011 (r224206) +++ head/sys/conf/NOTES Tue Jul 19 00:37:24 2011 (r224207) @@ -213,6 +213,10 @@ options SCHED_STATS # Mandatory: options SMP # Symmetric MultiProcessor Kernel +# MAXCPU defines the maximum number of CPUs that can boot in the system. +# A default value should be already present, for every architecture. +options MAXCPU=32 + # ADAPTIVE_MUTEXES changes the behavior of blocking mutexes to spin # if the thread that currently owns the mutex is executing on another # CPU. This behaviour is enabled by default, so this option can be used Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon Jul 18 22:00:21 2011 (r224206) +++ head/sys/conf/options Tue Jul 19 00:37:24 2011 (r224207) @@ -570,6 +570,7 @@ DFLTPHYS opt_global.h DIAGNOSTIC opt_global.h INVARIANT_SUPPORT opt_global.h INVARIANTS opt_global.h +MAXCPU opt_global.h MAXPHYS opt_global.h MCLSHIFT opt_global.h MUTEX_DEBUG opt_global.h Modified: head/sys/i386/include/param.h ============================================================================== --- head/sys/i386/include/param.h Mon Jul 18 22:00:21 2011 (r224206) +++ head/sys/i386/include/param.h Tue Jul 19 00:37:24 2011 (r224207) @@ -68,7 +68,9 @@ #define MID_MACHINE MID_I386 #if defined(SMP) || defined(KLD_MODULE) +#ifndef MAXCPU #define MAXCPU 32 +#endif #else #define MAXCPU 1 #endif /* SMP || KLD_MODULE */ Modified: head/sys/ia64/include/param.h ============================================================================== --- head/sys/ia64/include/param.h Mon Jul 18 22:00:21 2011 (r224206) +++ head/sys/ia64/include/param.h Tue Jul 19 00:37:24 2011 (r224207) @@ -62,7 +62,9 @@ #endif #if defined(SMP) || defined(KLD_MODULE) +#ifndef MAXCPU #define MAXCPU 32 +#endif #else #define MAXCPU 1 #endif Modified: head/sys/mips/include/param.h ============================================================================== --- head/sys/mips/include/param.h Mon Jul 18 22:00:21 2011 (r224206) +++ head/sys/mips/include/param.h Tue Jul 19 00:37:24 2011 (r224207) @@ -87,7 +87,9 @@ #ifdef SMP #define MAXSMPCPU 32 +#ifndef MAXCPU #define MAXCPU MAXSMPCPU +#endif #else #define MAXSMPCPU 1 #define MAXCPU 1 Modified: head/sys/powerpc/include/param.h ============================================================================== --- head/sys/powerpc/include/param.h Mon Jul 18 22:00:21 2011 (r224206) +++ head/sys/powerpc/include/param.h Tue Jul 19 00:37:24 2011 (r224207) @@ -68,7 +68,9 @@ #endif #if defined(SMP) || defined(KLD_MODULE) +#ifndef MAXCPU #define MAXCPU 8 +#endif #else #define MAXCPU 1 #endif /* SMP || KLD_MODULE */ Modified: head/sys/sparc64/include/param.h ============================================================================== --- head/sys/sparc64/include/param.h Mon Jul 18 22:00:21 2011 (r224206) +++ head/sys/sparc64/include/param.h Tue Jul 19 00:37:24 2011 (r224207) @@ -50,7 +50,9 @@ #define MID_MACHINE MID_SPARC64 #if defined(SMP) || defined(KLD_MODULE) +#ifndef MAXCPU #define MAXCPU 16 +#endif #else #define MAXCPU 1 #endif /* SMP || KLD_MODULE */ From owner-svn-src-head@FreeBSD.ORG Tue Jul 19 00:59:36 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD93B1065670; Tue, 19 Jul 2011 00:59:36 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-yi0-f54.google.com (mail-yi0-f54.google.com [209.85.218.54]) by mx1.freebsd.org (Postfix) with ESMTP id 7296E8FC1B; Tue, 19 Jul 2011 00:59:36 +0000 (UTC) Received: by yic13 with SMTP id 13so1927750yic.13 for ; Mon, 18 Jul 2011 17:59:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=dddK0h8zB7+rURb1vFVZxNkizeTGMbLruxFm1m1rI7Y=; b=Lmiib2j4XhXnsJ0NptiRSTd1CupjFNF6UEPnuQJ4kbTiRru9FadlKv/XYRFyPs2bZq cr+P3dfC+1Ovl51UFtRmBFgBdVsOndtHKaws2QIOie3wg3K0S3YAix9AUU4qqIKXrfmg B/bHjb+w1FcOoq0EV4jccHpFKCXcgd75gsons= MIME-Version: 1.0 Received: by 10.236.147.111 with SMTP id s75mr69324yhj.272.1311037174751; Mon, 18 Jul 2011 17:59:34 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.236.105.169 with HTTP; Mon, 18 Jul 2011 17:59:34 -0700 (PDT) In-Reply-To: <208D139E-CDC3-428D-8D5F-F772BFAF164C@xcllnt.net> References: <201107181519.p6IFJfOK028280@svn.freebsd.org> <208D139E-CDC3-428D-8D5F-F772BFAF164C@xcllnt.net> Date: Tue, 19 Jul 2011 02:59:34 +0200 X-Google-Sender-Auth: jC3gBHHMpGslCRxhMF-mt_3X3f8 Message-ID: From: Attilio Rao To: Marcel Moolenaar Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r224187 - in head: sys/amd64/amd64 sys/arm/arm sys/arm/sa11x0 sys/i386/i386 sys/ia64/ia64 sys/kern sys/mips/mips sys/powerpc/aim sys/powerpc/booke sys/sparc64/sparc64 sys/sys usr.bin/vm... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jul 2011 00:59:37 -0000 2011/7/19 Marcel Moolenaar : > > On Jul 18, 2011, at 8:19 AM, Attilio Rao wrote: > >> Author: attilio >> Date: Mon Jul 18 15:19:40 2011 >> New Revision: 224187 >> URL: http://svn.freebsd.org/changeset/base/224187 >> >> Log: >> =C2=A0- Remove the eintrcnt/eintrnames usage and introduce the concept o= f >> =C2=A0 =C2=A0sintrcnt/sintrnames which are symbols containing the size o= f the 2 >> =C2=A0 =C2=A0tables. >> =C2=A0- For amd64/i386 remove the storage of intr* stuff from assembly f= iles. >> =C2=A0 =C2=A0This area can be widely improved by applying the same to ot= her >> =C2=A0 =C2=A0architectures and likely finding an unified approach among = them and >> =C2=A0 =C2=A0move the whole code to be MI. More work in this area is exp= ected to >> =C2=A0 =C2=A0happen fairly soon. >> >> =C2=A0No MFC is previewed for this patch. > > You just broke ia64 and possibly other 64-bit architectures: > > ".word" declares a 16-bit integral on ia64 and the size symbols > are of type size_t (=3D64 bit). We'll be having misaligned loads > (=3D kernel panics) and/or reading garbage... I'm a bit surprised of this though. .hword was supposed to be the 16-bit integral, while .word was supposed to be the 32-bits one, if I read my "info as" on amd64. Anyway, what do you think about this patch? (I still need to test it): http://www.freebsd.org/~attilio/64bits-fixup.diff Thanks, Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Tue Jul 19 01:54:56 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07EFC106564A; Tue, 19 Jul 2011 01:54:56 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id A82FE8FC14; Tue, 19 Jul 2011 01:54:55 +0000 (UTC) Received: from sa-nc-spg-102.static.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id p6J1snN5087811 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 18 Jul 2011 18:54:54 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: Date: Mon, 18 Jul 2011 18:54:44 -0700 Content-Transfer-Encoding: 7bit Message-Id: References: <201107181519.p6IFJfOK028280@svn.freebsd.org> <208D139E-CDC3-428D-8D5F-F772BFAF164C@xcllnt.net> To: Attilio Rao X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r224187 - in head: sys/amd64/amd64 sys/arm/arm sys/arm/sa11x0 sys/i386/i386 sys/ia64/ia64 sys/kern sys/mips/mips sys/powerpc/aim sys/powerpc/booke sys/sparc64/sparc64 sys/sys usr.bin/vm... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jul 2011 01:54:56 -0000 On Jul 18, 2011, at 5:59 PM, Attilio Rao wrote: > 2011/7/19 Marcel Moolenaar : >> >> On Jul 18, 2011, at 8:19 AM, Attilio Rao wrote: >> >>> Author: attilio >>> Date: Mon Jul 18 15:19:40 2011 >>> New Revision: 224187 >>> URL: http://svn.freebsd.org/changeset/base/224187 >>> >>> Log: >>> - Remove the eintrcnt/eintrnames usage and introduce the concept of >>> sintrcnt/sintrnames which are symbols containing the size of the 2 >>> tables. >>> - For amd64/i386 remove the storage of intr* stuff from assembly files. >>> This area can be widely improved by applying the same to other >>> architectures and likely finding an unified approach among them and >>> move the whole code to be MI. More work in this area is expected to >>> happen fairly soon. >>> >>> No MFC is previewed for this patch. >> >> You just broke ia64 and possibly other 64-bit architectures: >> >> ".word" declares a 16-bit integral on ia64 and the size symbols >> are of type size_t (=64 bit). We'll be having misaligned loads >> (= kernel panics) and/or reading garbage... > > I'm a bit surprised of this though. > .hword was supposed to be the 16-bit integral, while .word was > supposed to be the 32-bits one, if I read my "info as" on amd64. Well... all I can say is that assembly is the least transposable language, besides of course machine code itself :-) > Anyway, what do you think about this patch? (I still need to test it): > http://www.freebsd.org/~attilio/64bits-fixup.diff Looks good to me, though I don't know enough about mips to comment on that. I'm not going to be anal about the use of ".quad" instead of "data8" for ia64 -- let's get it fixed first (I think we have ".byte" in locore.S anyway :-) -- Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@FreeBSD.ORG Tue Jul 19 02:31:10 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42FFD106566C; Tue, 19 Jul 2011 02:31:10 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id CCA048FC15; Tue, 19 Jul 2011 02:31:09 +0000 (UTC) Received: by gyf3 with SMTP id 3so1950964gyf.13 for ; Mon, 18 Jul 2011 19:31:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=sDDCNl+GW5DsNkQqWaxjTWyz5Q1m/kDu2HNK+BdQook=; b=ilyH8DKqQ26Gf2baF17rUPQn6qZwkHpTxrESkn/gzs8fR5OaUpNNO2AH5Bz4D+ZALR D6TZ8GzD4nQtWnk/t5zs0ozibdybHKdNNe/74zZVAVkZI1HFDZd5LCXRAfGjNwu/RmQn c0AwE1aFtfFxTrNwh/0bmohiFvKOiSH91oNhE= MIME-Version: 1.0 Received: by 10.236.147.111 with SMTP id s75mr139497yhj.272.1311042669108; Mon, 18 Jul 2011 19:31:09 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.236.105.169 with HTTP; Mon, 18 Jul 2011 19:31:09 -0700 (PDT) In-Reply-To: References: <201107181519.p6IFJfOK028280@svn.freebsd.org> <208D139E-CDC3-428D-8D5F-F772BFAF164C@xcllnt.net> Date: Tue, 19 Jul 2011 04:31:09 +0200 X-Google-Sender-Auth: s3OYTxTmICxTmIu32grTqSV21zQ Message-ID: From: Attilio Rao To: Marcel Moolenaar Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r224187 - in head: sys/amd64/amd64 sys/arm/arm sys/arm/sa11x0 sys/i386/i386 sys/ia64/ia64 sys/kern sys/mips/mips sys/powerpc/aim sys/powerpc/booke sys/sparc64/sparc64 sys/sys usr.bin/vm... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jul 2011 02:31:10 -0000 2011/7/19 Marcel Moolenaar : > > On Jul 18, 2011, at 5:59 PM, Attilio Rao wrote: > >> 2011/7/19 Marcel Moolenaar : >>> >>> On Jul 18, 2011, at 8:19 AM, Attilio Rao wrote: >>> >>>> Author: attilio >>>> Date: Mon Jul 18 15:19:40 2011 >>>> New Revision: 224187 >>>> URL: http://svn.freebsd.org/changeset/base/224187 >>>> >>>> Log: >>>> =C2=A0- Remove the eintrcnt/eintrnames usage and introduce the concept= of >>>> =C2=A0 =C2=A0sintrcnt/sintrnames which are symbols containing the size= of the 2 >>>> =C2=A0 =C2=A0tables. >>>> =C2=A0- For amd64/i386 remove the storage of intr* stuff from assembly= files. >>>> =C2=A0 =C2=A0This area can be widely improved by applying the same to = other >>>> =C2=A0 =C2=A0architectures and likely finding an unified approach amon= g them and >>>> =C2=A0 =C2=A0move the whole code to be MI. More work in this area is e= xpected to >>>> =C2=A0 =C2=A0happen fairly soon. >>>> >>>> =C2=A0No MFC is previewed for this patch. >>> >>> You just broke ia64 and possibly other 64-bit architectures: >>> >>> ".word" declares a 16-bit integral on ia64 and the size symbols >>> are of type size_t (=3D64 bit). We'll be having misaligned loads >>> (=3D kernel panics) and/or reading garbage... >> >> I'm a bit surprised of this though. >> .hword was supposed to be the 16-bit integral, while .word was >> supposed to be the 32-bits one, if I read my "info as" on amd64. > > Well... all I can say is that assembly is the least transposable > language, besides of course machine code itself :-) > >> Anyway, what do you think about this patch? (I still need to test it): >> http://www.freebsd.org/~attilio/64bits-fixup.diff > > Looks good to me, though I don't know enough about mips to comment > on that. I'm not going to be anal about the use of ".quad" instead > of "data8" for ia64 -- let's get it fixed first (I think we have > ".byte" in locore.S anyway :-) We do. Anyway, I've updated the patch in order to use data8 in ia64 case (you are the maintainer, so you have the last word) even if I'm not sure there is a real need to discourage .quad. Thanks for pointing at this breakage, please review and approve in case. Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Tue Jul 19 03:22:51 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B48A01065670; Tue, 19 Jul 2011 03:22:51 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 7E0278FC0C; Tue, 19 Jul 2011 03:22:51 +0000 (UTC) Received: from sa-nc-spg-102.static.jnpr.net (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id p6J3Mgu5001510 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 18 Jul 2011 20:22:49 -0700 (PDT) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: Date: Mon, 18 Jul 2011 20:22:37 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <451BAE6D-C142-4E24-AE43-3BEC325F43F6@xcllnt.net> References: <201107181519.p6IFJfOK028280@svn.freebsd.org> <208D139E-CDC3-428D-8D5F-F772BFAF164C@xcllnt.net> To: Attilio Rao X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r224187 - in head: sys/amd64/amd64 sys/arm/arm sys/arm/sa11x0 sys/i386/i386 sys/ia64/ia64 sys/kern sys/mips/mips sys/powerpc/aim sys/powerpc/booke sys/sparc64/sparc64 sys/sys usr.bin/vm... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jul 2011 03:22:51 -0000 On Jul 18, 2011, at 7:31 PM, Attilio Rao wrote: > 2011/7/19 Marcel Moolenaar : >>=20 >> On Jul 18, 2011, at 5:59 PM, Attilio Rao wrote: >>=20 >>> 2011/7/19 Marcel Moolenaar : >>>>=20 >>>> On Jul 18, 2011, at 8:19 AM, Attilio Rao wrote: >>>>=20 >>>>> Author: attilio >>>>> Date: Mon Jul 18 15:19:40 2011 >>>>> New Revision: 224187 >>>>> URL: http://svn.freebsd.org/changeset/base/224187 >>>>>=20 >>>>> Log: >>>>> - Remove the eintrcnt/eintrnames usage and introduce the concept = of >>>>> sintrcnt/sintrnames which are symbols containing the size of = the 2 >>>>> tables. >>>>> - For amd64/i386 remove the storage of intr* stuff from assembly = files. >>>>> This area can be widely improved by applying the same to other >>>>> architectures and likely finding an unified approach among them = and >>>>> move the whole code to be MI. More work in this area is = expected to >>>>> happen fairly soon. >>>>>=20 >>>>> No MFC is previewed for this patch. >>>>=20 >>>> You just broke ia64 and possibly other 64-bit architectures: >>>>=20 >>>> ".word" declares a 16-bit integral on ia64 and the size symbols >>>> are of type size_t (=3D64 bit). We'll be having misaligned loads >>>> (=3D kernel panics) and/or reading garbage... >>>=20 >>> I'm a bit surprised of this though. >>> .hword was supposed to be the 16-bit integral, while .word was >>> supposed to be the 32-bits one, if I read my "info as" on amd64. >>=20 >> Well... all I can say is that assembly is the least transposable >> language, besides of course machine code itself :-) >>=20 >>> Anyway, what do you think about this patch? (I still need to test = it): >>> http://www.freebsd.org/~attilio/64bits-fixup.diff >>=20 >> Looks good to me, though I don't know enough about mips to comment >> on that. I'm not going to be anal about the use of ".quad" instead >> of "data8" for ia64 -- let's get it fixed first (I think we have >> ".byte" in locore.S anyway :-) >=20 > We do. > Anyway, I've updated the patch in order to use data8 in ia64 case (you > are the maintainer, so you have the last word) even if I'm not sure > there is a real need to discourage .quad. >=20 > Thanks for pointing at this breakage, please review and approve in = case. The change for ia64 is not quite right. This is what you have in the latest patch: Index: sys/ia64/ia64/locore.S =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/ia64/ia64/locore.S (revision 224207) +++ sys/ia64/ia64/locore.S (working copy) @@ -207,13 +207,13 @@ intr_n =3D intr_n + 1 .endr EXPORT(sintrnames) - .word INTRCNT_COUNT * INTRNAME_LEN + data8 INTRCNT_COUNT * INTRNAME_LEN =20 .align 8 EXPORT(intrcnt) .fill INTRCNT_COUNT, 8, 0 EXPORT(sintrcnt) - .word INTRCNT_COUNT + data8 INTRCNT_COUNT =20 .text // in0: image base It defines sintrcnt as a 64-bit integral with value INTRCNT_COUNT, which is merely the number of counters, not the storage size of intrcnt itself. Multiply by 8 (=3D sizeof(size_t)) and you're good: Index: /sys/ia64/ia64/locore.S =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- /sys/ia64/ia64/locore.S (revision 224207) +++ /sys/ia64/ia64/locore.S (working copy) @@ -207,13 +207,13 @@ intr_n =3D intr_n + 1 .endr EXPORT(sintrnames) - .word INTRCNT_COUNT * INTRNAME_LEN + data8 INTRCNT_COUNT * INTRNAME_LEN =20 .align 8 EXPORT(intrcnt) .fill INTRCNT_COUNT, 8, 0 EXPORT(sintrcnt) - .word INTRCNT_COUNT + data8 INTRCNT_COUNT * 8 =20 .text // in0: image base Sorry for pointing this out in the rebound. I just tested the patch for ia64 and noticed interrupt counters we're getting fetched right. You did all the other architectures in the patch right, so with this last tweak it's reviewed and approved from my end. FYI, --=20 Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@FreeBSD.ORG Tue Jul 19 11:48:33 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2974106564A; Tue, 19 Jul 2011 11:48:33 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 7051B8FC08; Tue, 19 Jul 2011 11:48:33 +0000 (UTC) Received: by gwb15 with SMTP id 15so2095761gwb.13 for ; Tue, 19 Jul 2011 04:48:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=iSb6SwybnZGnZ0T3tnbBG7viCQQKyJ2FUPP/2lIo3/o=; b=GZRE8C/1d7+EH3iqkTC4rNIiaKRUnbIOH9vZvNqFMi8MHJTJj8Y2Gj/NdIL1q+cGCo cusjb49Og4lqO/PFR6Y+3hJ/hjPjAuUPMRnRhOb6qLknbLqi9GcHR7TrJvHwtjdT6BrA CIQqf6jwmQjyiCFidD0+O1ihs+gbPh9JQHWuc= MIME-Version: 1.0 Received: by 10.236.79.170 with SMTP id i30mr8750640yhe.4.1311076112827; Tue, 19 Jul 2011 04:48:32 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.236.105.169 with HTTP; Tue, 19 Jul 2011 04:48:32 -0700 (PDT) In-Reply-To: <451BAE6D-C142-4E24-AE43-3BEC325F43F6@xcllnt.net> References: <201107181519.p6IFJfOK028280@svn.freebsd.org> <208D139E-CDC3-428D-8D5F-F772BFAF164C@xcllnt.net> <451BAE6D-C142-4E24-AE43-3BEC325F43F6@xcllnt.net> Date: Tue, 19 Jul 2011 13:48:32 +0200 X-Google-Sender-Auth: xzf2TRke_44-qATIkKPz4Ke04T0 Message-ID: From: Attilio Rao To: Marcel Moolenaar Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r224187 - in head: sys/amd64/amd64 sys/arm/arm sys/arm/sa11x0 sys/i386/i386 sys/ia64/ia64 sys/kern sys/mips/mips sys/powerpc/aim sys/powerpc/booke sys/sparc64/sparc64 sys/sys usr.bin/vm... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jul 2011 11:48:34 -0000 2011/7/19 Marcel Moolenaar : > > On Jul 18, 2011, at 7:31 PM, Attilio Rao wrote: > >> 2011/7/19 Marcel Moolenaar : >>> >>> On Jul 18, 2011, at 5:59 PM, Attilio Rao wrote: >>> >>>> 2011/7/19 Marcel Moolenaar : >>>>> >>>>> On Jul 18, 2011, at 8:19 AM, Attilio Rao wrote: >>>>> >>>>>> Author: attilio >>>>>> Date: Mon Jul 18 15:19:40 2011 >>>>>> New Revision: 224187 >>>>>> URL: http://svn.freebsd.org/changeset/base/224187 >>>>>> >>>>>> Log: >>>>>> =C2=A0- Remove the eintrcnt/eintrnames usage and introduce the conce= pt of >>>>>> =C2=A0 =C2=A0sintrcnt/sintrnames which are symbols containing the si= ze of the 2 >>>>>> =C2=A0 =C2=A0tables. >>>>>> =C2=A0- For amd64/i386 remove the storage of intr* stuff from assemb= ly files. >>>>>> =C2=A0 =C2=A0This area can be widely improved by applying the same t= o other >>>>>> =C2=A0 =C2=A0architectures and likely finding an unified approach am= ong them and >>>>>> =C2=A0 =C2=A0move the whole code to be MI. More work in this area is= expected to >>>>>> =C2=A0 =C2=A0happen fairly soon. >>>>>> >>>>>> =C2=A0No MFC is previewed for this patch. >>>>> >>>>> You just broke ia64 and possibly other 64-bit architectures: >>>>> >>>>> ".word" declares a 16-bit integral on ia64 and the size symbols >>>>> are of type size_t (=3D64 bit). We'll be having misaligned loads >>>>> (=3D kernel panics) and/or reading garbage... >>>> >>>> I'm a bit surprised of this though. >>>> .hword was supposed to be the 16-bit integral, while .word was >>>> supposed to be the 32-bits one, if I read my "info as" on amd64. >>> >>> Well... all I can say is that assembly is the least transposable >>> language, besides of course machine code itself :-) >>> >>>> Anyway, what do you think about this patch? (I still need to test it): >>>> http://www.freebsd.org/~attilio/64bits-fixup.diff >>> >>> Looks good to me, though I don't know enough about mips to comment >>> on that. I'm not going to be anal about the use of ".quad" instead >>> of "data8" for ia64 -- let's get it fixed first (I think we have >>> ".byte" in locore.S anyway :-) >> >> We do. >> Anyway, I've updated the patch in order to use data8 in ia64 case (you >> are the maintainer, so you have the last word) even if I'm not sure >> there is a real need to discourage .quad. >> >> Thanks for pointing at this breakage, please review and approve in case. > > The change for ia64 is not quite right. This is what you have > in the latest patch: > > Index: sys/ia64/ia64/locore.S > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- sys/ia64/ia64/locore.S =C2=A0 =C2=A0 =C2=A0(revision 224207) > +++ sys/ia64/ia64/locore.S =C2=A0 =C2=A0 =C2=A0(working copy) > @@ -207,13 +207,13 @@ > =C2=A0 =C2=A0 =C2=A0 =C2=A0intr_n =3D intr_n + 1 > =C2=A0.endr > =C2=A0EXPORT(sintrnames) > - =C2=A0 =C2=A0 =C2=A0 .word INTRCNT_COUNT * INTRNAME_LEN > + =C2=A0 =C2=A0 =C2=A0 data8 INTRCNT_COUNT * INTRNAME_LEN > > =C2=A0 =C2=A0 =C2=A0 =C2=A0.align 8 > =C2=A0EXPORT(intrcnt) > =C2=A0 =C2=A0 =C2=A0 =C2=A0.fill INTRCNT_COUNT, 8, 0 > =C2=A0EXPORT(sintrcnt) > - =C2=A0 =C2=A0 =C2=A0 .word INTRCNT_COUNT > + =C2=A0 =C2=A0 =C2=A0 data8 INTRCNT_COUNT > > =C2=A0 =C2=A0 =C2=A0 =C2=A0.text > =C2=A0 =C2=A0 =C2=A0 =C2=A0// in0: image base > > It defines sintrcnt as a 64-bit integral with value INTRCNT_COUNT, > which is merely the number of counters, not the storage size of > intrcnt itself. Multiply by 8 (=3D sizeof(size_t)) and you're good: > > Index: /sys/ia64/ia64/locore.S > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- /sys/ia64/ia64/locore.S =C2=A0 =C2=A0 (revision 224207) > +++ /sys/ia64/ia64/locore.S =C2=A0 =C2=A0 (working copy) > @@ -207,13 +207,13 @@ > =C2=A0 =C2=A0 =C2=A0 =C2=A0intr_n =3D intr_n + 1 > =C2=A0.endr > =C2=A0EXPORT(sintrnames) > - =C2=A0 =C2=A0 =C2=A0 .word INTRCNT_COUNT * INTRNAME_LEN > + =C2=A0 =C2=A0 =C2=A0 data8 INTRCNT_COUNT * INTRNAME_LEN > > =C2=A0 =C2=A0 =C2=A0 =C2=A0.align 8 > =C2=A0EXPORT(intrcnt) > =C2=A0 =C2=A0 =C2=A0 =C2=A0.fill INTRCNT_COUNT, 8, 0 > =C2=A0EXPORT(sintrcnt) > - =C2=A0 =C2=A0 =C2=A0 .word INTRCNT_COUNT > + =C2=A0 =C2=A0 =C2=A0 data8 INTRCNT_COUNT * 8 > > =C2=A0 =C2=A0 =C2=A0 =C2=A0.text > =C2=A0 =C2=A0 =C2=A0 =C2=A0// in0: image base > > > Sorry for pointing this out in the rebound. I just tested the patch > for ia64 and noticed interrupt counters we're getting fetched right. > > You did all the other architectures in the patch right, so with this > last tweak it's reviewed and approved from my end. Thanks Marcel for the time you spent on this. Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Tue Jul 19 12:41:58 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0CB661065675; Tue, 19 Jul 2011 12:41:58 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D68B88FC13; Tue, 19 Jul 2011 12:41:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6JCfvIm072821; Tue, 19 Jul 2011 12:41:57 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6JCfvqw072816; Tue, 19 Jul 2011 12:41:57 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201107191241.p6JCfvqw072816@svn.freebsd.org> From: Attilio Rao Date: Tue, 19 Jul 2011 12:41:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224216 - in head/sys: ia64/ia64 mips/mips powerpc/aim sparc64/sparc64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jul 2011 12:41:58 -0000 Author: attilio Date: Tue Jul 19 12:41:57 2011 New Revision: 224216 URL: http://svn.freebsd.org/changeset/base/224216 Log: On 64 bit architectures size_t is 8 bytes, thus it should use an 8 bytes storage. Fix the sintrcnt/sintrnames specification. No MFC is previewed for this patch. Reported, reviewed and tested by: marcel Approved by: re (kib) Modified: head/sys/ia64/ia64/locore.S head/sys/mips/mips/exception.S head/sys/powerpc/aim/locore64.S head/sys/sparc64/sparc64/exception.S Modified: head/sys/ia64/ia64/locore.S ============================================================================== --- head/sys/ia64/ia64/locore.S Tue Jul 19 11:04:58 2011 (r224215) +++ head/sys/ia64/ia64/locore.S Tue Jul 19 12:41:57 2011 (r224216) @@ -207,13 +207,13 @@ intr_n = 1 intr_n = intr_n + 1 .endr EXPORT(sintrnames) - .word INTRCNT_COUNT * INTRNAME_LEN + data8 INTRCNT_COUNT * INTRNAME_LEN .align 8 EXPORT(intrcnt) .fill INTRCNT_COUNT, 8, 0 EXPORT(sintrcnt) - .word INTRCNT_COUNT + data8 INTRCNT_COUNT * 8 .text // in0: image base Modified: head/sys/mips/mips/exception.S ============================================================================== --- head/sys/mips/mips/exception.S Tue Jul 19 11:04:58 2011 (r224215) +++ head/sys/mips/mips/exception.S Tue Jul 19 12:41:57 2011 (r224216) @@ -1140,13 +1140,21 @@ END(MipsFPTrap) intrnames: .space INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 sintrnames: +#ifdef __mips_n64 + .quad INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 +#else .word INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 +#endif .align 4 intrcnt: .space INTRCNT_COUNT * 4 * 2 sintrcnt: +#ifdef __mips_n64 + .quad INTRCNT_COUNT * 4 * 2 +#else .word INTRCNT_COUNT * 4 * 2 +#endif /* Modified: head/sys/powerpc/aim/locore64.S ============================================================================== --- head/sys/powerpc/aim/locore64.S Tue Jul 19 11:04:58 2011 (r224215) +++ head/sys/powerpc/aim/locore64.S Tue Jul 19 12:41:57 2011 (r224216) @@ -91,13 +91,13 @@ GLOBAL(esym) GLOBAL(intrnames) .space INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 GLOBAL(sintrnames) - .word INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 + .quad INTRCNT_COUNT * (MAXCOMLEN + 1) * 2 .align 4 GLOBAL(intrcnt) .space INTRCNT_COUNT * 4 * 2 GLOBAL(sintrcnt) - .word INTRCNT_COUNT * 4 * 2 + .quad INTRCNT_COUNT * 4 * 2 .text .globl btext Modified: head/sys/sparc64/sparc64/exception.S ============================================================================== --- head/sys/sparc64/sparc64/exception.S Tue Jul 19 11:04:58 2011 (r224215) +++ head/sys/sparc64/sparc64/exception.S Tue Jul 19 12:41:57 2011 (r224216) @@ -375,13 +375,13 @@ END(rsf_fatal) intrnames: .space IV_MAX * (MAXCOMLEN + 1) sintrnames: - .word IV_MAX * (MAXCOMLEN + 1) + .quad IV_MAX * (MAXCOMLEN + 1) .globl intrcnt, sintrcnt intrcnt: .space IV_MAX * 8 sintrcnt: - .word IV_MAX * 8 + .quad IV_MAX * 8 .text From owner-svn-src-head@FreeBSD.ORG Tue Jul 19 13:00:30 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE9901065674; Tue, 19 Jul 2011 13:00:30 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9491E8FC17; Tue, 19 Jul 2011 13:00:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6JD0UnV073454; Tue, 19 Jul 2011 13:00:30 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6JD0UU7073447; Tue, 19 Jul 2011 13:00:30 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201107191300.p6JD0UU7073447@svn.freebsd.org> From: Attilio Rao Date: Tue, 19 Jul 2011 13:00:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224217 - in head/sys: amd64/include ia64/include mips/conf sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jul 2011 13:00:30 -0000 Author: attilio Date: Tue Jul 19 13:00:30 2011 New Revision: 224217 URL: http://svn.freebsd.org/changeset/base/224217 Log: Bump MAXCPU for amd64, ia64 and XLP mips appropriately. From now on, default values for FreeBSD will be 64 maxiumum supported CPUs on amd64 and ia64 and 128 for XLP. All the other architectures seem already capped appropriately (with the exception of sparc64 which needs further support on jalapeno flavour). Bump __FreeBSD_version in order to reflect KBI/KPI brekage introduced during the infrastructure cleanup for supporting MAXCPU > 32. This covers cpumask_t retiral too. The switch is considered completed at the present time, so for whatever bug you may experience that is reconducible to that area, please report immediately. Requested by: marcel, jchandra Tested by: pluknet, sbruno Approved by: re (kib) Modified: head/sys/amd64/include/param.h head/sys/ia64/include/param.h head/sys/mips/conf/XLP head/sys/mips/conf/XLP64 head/sys/mips/conf/XLPN32 head/sys/sys/param.h Modified: head/sys/amd64/include/param.h ============================================================================== --- head/sys/amd64/include/param.h Tue Jul 19 12:41:57 2011 (r224216) +++ head/sys/amd64/include/param.h Tue Jul 19 13:00:30 2011 (r224217) @@ -65,7 +65,7 @@ #if defined(SMP) || defined(KLD_MODULE) #ifndef MAXCPU -#define MAXCPU 32 +#define MAXCPU 64 #endif #else #define MAXCPU 1 Modified: head/sys/ia64/include/param.h ============================================================================== --- head/sys/ia64/include/param.h Tue Jul 19 12:41:57 2011 (r224216) +++ head/sys/ia64/include/param.h Tue Jul 19 13:00:30 2011 (r224217) @@ -63,7 +63,7 @@ #if defined(SMP) || defined(KLD_MODULE) #ifndef MAXCPU -#define MAXCPU 32 +#define MAXCPU 64 #endif #else #define MAXCPU 1 Modified: head/sys/mips/conf/XLP ============================================================================== --- head/sys/mips/conf/XLP Tue Jul 19 12:41:57 2011 (r224216) +++ head/sys/mips/conf/XLP Tue Jul 19 13:00:30 2011 (r224217) @@ -36,6 +36,7 @@ options SCHED_ULE # ULE scheduler options SMP options PREEMPTION # Enable kernel thread preemption #options FULL_PREEMPTION # Enable kernel thread preemption +options MAXCPU=128 # XLP can probe 128 CPUs options INET # InterNETworking options INET6 # IPv6 communications protocols options FFS # Berkeley Fast Filesystem Modified: head/sys/mips/conf/XLP64 ============================================================================== --- head/sys/mips/conf/XLP64 Tue Jul 19 12:41:57 2011 (r224216) +++ head/sys/mips/conf/XLP64 Tue Jul 19 13:00:30 2011 (r224217) @@ -38,6 +38,7 @@ options SCHED_ULE # ULE scheduler options SMP options PREEMPTION # Enable kernel thread preemption #options FULL_PREEMPTION # Enable kernel thread preemption +options MAXCPU=128 # XLP can probe 128 CPUs options INET # InterNETworking options INET6 # IPv6 communications protocols options FFS # Berkeley Fast Filesystem Modified: head/sys/mips/conf/XLPN32 ============================================================================== --- head/sys/mips/conf/XLPN32 Tue Jul 19 12:41:57 2011 (r224216) +++ head/sys/mips/conf/XLPN32 Tue Jul 19 13:00:30 2011 (r224217) @@ -37,6 +37,7 @@ options SCHED_ULE # ULE scheduler options SMP options PREEMPTION # Enable kernel thread preemption #options FULL_PREEMPTION # Enable kernel thread preemption +options MAXCPU=128 # XLP can probe 128 CPUs options INET # InterNETworking options INET6 # IPv6 communications protocols options FFS # Berkeley Fast Filesystem Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Tue Jul 19 12:41:57 2011 (r224216) +++ head/sys/sys/param.h Tue Jul 19 13:00:30 2011 (r224217) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 900039 /* Master, propagated to newvers */ +#define __FreeBSD_version 900040 /* Master, propagated to newvers */ #ifdef _KERNEL #define P_OSREL_SIGSEGV 700004 From owner-svn-src-head@FreeBSD.ORG Tue Jul 19 14:58:00 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43D19106564A; Tue, 19 Jul 2011 14:58:00 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 337498FC0A; Tue, 19 Jul 2011 14:58:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6JEw0Al076931; Tue, 19 Jul 2011 14:58:00 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6JEw0uS076928; Tue, 19 Jul 2011 14:58:00 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201107191458.p6JEw0uS076928@svn.freebsd.org> From: Attilio Rao Date: Tue, 19 Jul 2011 14:58:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224218 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jul 2011 14:58:00 -0000 Author: attilio Date: Tue Jul 19 14:57:59 2011 New Revision: 224218 URL: http://svn.freebsd.org/changeset/base/224218 Log: Remove pc_name member of struct pcpu. pc_name is only included when KTR option is and it does introduce a subdle KBI breakage that totally breaks vmstat when world and kernel are not in sync. Besides, it is not used somewhere. In collabouration with: pluknet Reviewed by: jhb Approved by: re (kib) Modified: head/sys/kern/subr_pcpu.c head/sys/sys/pcpu.h Modified: head/sys/kern/subr_pcpu.c ============================================================================== --- head/sys/kern/subr_pcpu.c Tue Jul 19 13:00:30 2011 (r224217) +++ head/sys/kern/subr_pcpu.c Tue Jul 19 14:57:59 2011 (r224218) @@ -92,9 +92,6 @@ pcpu_init(struct pcpu *pcpu, int cpuid, cpu_pcpu_init(pcpu, cpuid, size); pcpu->pc_rm_queue.rmq_next = &pcpu->pc_rm_queue; pcpu->pc_rm_queue.rmq_prev = &pcpu->pc_rm_queue; -#ifdef KTR - snprintf(pcpu->pc_name, sizeof(pcpu->pc_name), "CPU %d", cpuid); -#endif } void Modified: head/sys/sys/pcpu.h ============================================================================== --- head/sys/sys/pcpu.h Tue Jul 19 13:00:30 2011 (r224217) +++ head/sys/sys/pcpu.h Tue Jul 19 14:57:59 2011 (r224218) @@ -165,9 +165,6 @@ struct pcpu { u_int pc_cpuid; /* This cpu number */ STAILQ_ENTRY(pcpu) pc_allcpu; struct lock_list_entry *pc_spinlocks; -#ifdef KTR - char pc_name[PCPU_NAME_LEN]; /* String name for KTR */ -#endif struct vmmeter pc_cnt; /* VM stats counters */ long pc_cp_time[CPUSTATES]; /* statclock ticks */ struct device *pc_device; From owner-svn-src-head@FreeBSD.ORG Tue Jul 19 15:22:36 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 515C21065670; Tue, 19 Jul 2011 15:22:36 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4123F8FC19; Tue, 19 Jul 2011 15:22:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6JFMawK077687; Tue, 19 Jul 2011 15:22:36 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6JFMaeU077685; Tue, 19 Jul 2011 15:22:36 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201107191522.p6JFMaeU077685@svn.freebsd.org> From: Adrian Chadd Date: Tue, 19 Jul 2011 15:22:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224219 - head/sbin/ifconfig X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jul 2011 15:22:36 -0000 Author: adrian Date: Tue Jul 19 15:22:35 2011 New Revision: 224219 URL: http://svn.freebsd.org/changeset/base/224219 Log: This patch enables listing DFS related flags when 'ifconfig -v wlanX list channel' is run. The following new options are introduced: * D: channel requires DFS * R: channel has a radar event * I: channel has detected inteference * C: the CAC period has completed on a channel that requires it (ie, DFS + PASSIVE.) It's relevant for developing, debugging and using the DFS and interference options. Approved by: re (bz) Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Tue Jul 19 14:57:59 2011 (r224218) +++ head/sbin/ifconfig/ifieee80211.c Tue Jul 19 15:22:35 2011 (r224219) @@ -3451,10 +3451,21 @@ print_chaninfo(const struct ieee80211_ch { char buf[14]; + if (verb) + printf("Channel %3u : %u%c%c%c%c%c MHz%-14.14s", + ieee80211_mhz2ieee(c->ic_freq, c->ic_flags), c->ic_freq, + IEEE80211_IS_CHAN_PASSIVE(c) ? '*' : ' ', + IEEE80211_IS_CHAN_DFS(c) ? 'D' : ' ', + IEEE80211_IS_CHAN_RADAR(c) ? 'R' : ' ', + IEEE80211_IS_CHAN_CWINT(c) ? 'I' : ' ', + IEEE80211_IS_CHAN_CACDONE(c) ? 'C' : ' ', + get_chaninfo(c, verb, buf, sizeof(buf))); + else printf("Channel %3u : %u%c MHz%-14.14s", - ieee80211_mhz2ieee(c->ic_freq, c->ic_flags), c->ic_freq, - IEEE80211_IS_CHAN_PASSIVE(c) ? '*' : ' ', - get_chaninfo(c, verb, buf, sizeof(buf))); + ieee80211_mhz2ieee(c->ic_freq, c->ic_flags), c->ic_freq, + IEEE80211_IS_CHAN_PASSIVE(c) ? '*' : ' ', + get_chaninfo(c, verb, buf, sizeof(buf))); + } static int From owner-svn-src-head@FreeBSD.ORG Tue Jul 19 15:24:44 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD94E1065674; Tue, 19 Jul 2011 15:24:44 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A45A28FC1A; Tue, 19 Jul 2011 15:24:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6JFOiT3077799; Tue, 19 Jul 2011 15:24:44 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6JFOict077797; Tue, 19 Jul 2011 15:24:44 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201107191524.p6JFOict077797@svn.freebsd.org> From: Adrian Chadd Date: Tue, 19 Jul 2011 15:24:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224220 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jul 2011 15:24:44 -0000 Author: adrian Date: Tue Jul 19 15:24:44 2011 New Revision: 224220 URL: http://svn.freebsd.org/changeset/base/224220 Log: This sets the BSS channel for each VAP for the given interface. It's only relevant in STA mode. The CSA forces a channel switch for the interface, but doesn't update the VAP channel. Approved by: re (bz) Modified: head/sys/net80211/ieee80211_proto.c Modified: head/sys/net80211/ieee80211_proto.c ============================================================================== --- head/sys/net80211/ieee80211_proto.c Tue Jul 19 15:22:35 2011 (r224219) +++ head/sys/net80211/ieee80211_proto.c Tue Jul 19 15:24:44 2011 (r224220) @@ -1501,6 +1501,11 @@ ieee80211_csa_startswitch(struct ieee802 ieee80211_notify_csa(ic, c, mode, count); } +/* + * Complete the channel switch by transitioning all CSA VAPs to RUN. + * This is called by both the completion and cancellation functions + * so each VAP is placed back in the RUN state and can thus transmit. + */ static void csa_completeswitch(struct ieee80211com *ic) { @@ -1518,6 +1523,12 @@ csa_completeswitch(struct ieee80211com * * Complete an 802.11h channel switch started by ieee80211_csa_startswitch. * We clear state and move all vap's in CSA state to RUN state * so they can again transmit. + * + * Although this may not be completely correct, update the BSS channel + * for each VAP to the newly configured channel. The setcurchan sets + * the current operating channel for the interface (so the radio does + * switch over) but the VAP BSS isn't updated, leading to incorrectly + * reported information via ioctl. */ void ieee80211_csa_completeswitch(struct ieee80211com *ic) @@ -1527,6 +1538,10 @@ ieee80211_csa_completeswitch(struct ieee KASSERT(ic->ic_flags & IEEE80211_F_CSAPENDING, ("csa not pending")); ieee80211_setcurchan(ic, ic->ic_csa_newchan); + TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) + if (vap->iv_state == IEEE80211_S_CSA) + vap->iv_bss->ni_chan = ic->ic_curchan; + csa_completeswitch(ic); } From owner-svn-src-head@FreeBSD.ORG Tue Jul 19 16:50:56 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A75F1065670; Tue, 19 Jul 2011 16:50:56 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A6F38FC16; Tue, 19 Jul 2011 16:50:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6JGoulW080327; Tue, 19 Jul 2011 16:50:56 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6JGouiu080324; Tue, 19 Jul 2011 16:50:56 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201107191650.p6JGouiu080324@svn.freebsd.org> From: Attilio Rao Date: Tue, 19 Jul 2011 16:50:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224221 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jul 2011 16:50:56 -0000 Author: attilio Date: Tue Jul 19 16:50:55 2011 New Revision: 224221 URL: http://svn.freebsd.org/changeset/base/224221 Log: Remove explicit MAXCPU usage from sys/pcpu.h avoiding a namespace pollution. That is a step further in the direction of building correct policies for userland and modules on how to deal with the number of maxcpus at runtime. Reported by: jhb Reviewed and tested by: pluknet Approved by: re (kib) Modified: head/sys/kern/sched_ule.c head/sys/sys/pcpu.h Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Tue Jul 19 15:24:44 2011 (r224220) +++ head/sys/kern/sched_ule.c Tue Jul 19 16:50:55 2011 (r224221) @@ -84,7 +84,7 @@ dtrace_vtime_switch_func_t dtrace_vtime_ #define TS_NAME_LEN (MAXCOMLEN + sizeof(" td ") + sizeof(__XSTRING(UINT_MAX))) #define TDQ_NAME_LEN (sizeof("sched lock ") + sizeof(__XSTRING(MAXCPU))) -#define TDQ_LOADNAME_LEN (PCPU_NAME_LEN + sizeof(" load")) +#define TDQ_LOADNAME_LEN (sizeof("CPU ") + sizeof(__XSTRING(MAXCPU)) - 1 + sizeof(" load")) /* * Thread scheduler specific section. All fields are protected Modified: head/sys/sys/pcpu.h ============================================================================== --- head/sys/sys/pcpu.h Tue Jul 19 15:24:44 2011 (r224220) +++ head/sys/sys/pcpu.h Tue Jul 19 16:50:55 2011 (r224221) @@ -146,8 +146,6 @@ struct rm_queue { struct rm_queue* volatile rmq_prev; }; -#define PCPU_NAME_LEN (sizeof("CPU ") + sizeof(__XSTRING(MAXCPU)) - 1) - /* * This structure maps out the global data that needs to be kept on a * per-cpu basis. The members are accessed via the PCPU_GET/SET/PTR @@ -200,7 +198,7 @@ struct pcpu { STAILQ_HEAD(cpuhead, pcpu); extern struct cpuhead cpuhead; -extern struct pcpu *cpuid_to_pcpu[MAXCPU]; +extern struct pcpu *cpuid_to_pcpu[]; #define curcpu PCPU_GET(cpuid) #define curproc (curthread->td_proc) From owner-svn-src-head@FreeBSD.ORG Tue Jul 19 19:20:13 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F9D8106566C; Tue, 19 Jul 2011 19:20:13 +0000 (UTC) (envelope-from wxs@atarininja.org) Received: from syn.atarininja.org (syn.csh.rit.edu [129.21.49.45]) by mx1.freebsd.org (Postfix) with ESMTP id 587858FC1A; Tue, 19 Jul 2011 19:20:13 +0000 (UTC) Received: by syn.atarininja.org (Postfix, from userid 1001) id 53DB15C45; Tue, 19 Jul 2011 15:03:46 -0400 (EDT) Date: Tue, 19 Jul 2011 15:03:46 -0400 From: Wesley Shields To: Adrian Chadd Message-ID: <20110719190346.GA44599@atarininja.org> References: <201107191524.p6JFOict077797@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201107191524.p6JFOict077797@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r224220 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jul 2011 19:20:13 -0000 On Tue, Jul 19, 2011 at 03:24:44PM +0000, Adrian Chadd wrote: > Author: adrian > Date: Tue Jul 19 15:24:44 2011 > New Revision: 224220 > URL: http://svn.freebsd.org/changeset/base/224220 > > Log: > This sets the BSS channel for each VAP for the given interface. > It's only relevant in STA mode. > > The CSA forces a channel switch for the interface, but doesn't update > the VAP channel. > > Approved by: re (bz) > > Modified: > head/sys/net80211/ieee80211_proto.c I just tried to update the kernel on one of my machines and found it broken. The patch at http://people.freebsd.org/~wxs/vap.diff fixes it. -- WXS From owner-svn-src-head@FreeBSD.ORG Wed Jul 20 00:36:47 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0FE6106564A; Wed, 20 Jul 2011 00:36:47 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D16288FC2C; Wed, 20 Jul 2011 00:36:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6K0alP0093724; Wed, 20 Jul 2011 00:36:47 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6K0algC093722; Wed, 20 Jul 2011 00:36:47 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201107200036.p6K0algC093722@svn.freebsd.org> From: Adrian Chadd Date: Wed, 20 Jul 2011 00:36:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224222 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jul 2011 00:36:48 -0000 Author: adrian Date: Wed Jul 20 00:36:47 2011 New Revision: 224222 URL: http://svn.freebsd.org/changeset/base/224222 Log: Fix brokenness introduced by my last commit. Approved by: re (implicit) Modified: head/sys/net80211/ieee80211_proto.c Modified: head/sys/net80211/ieee80211_proto.c ============================================================================== --- head/sys/net80211/ieee80211_proto.c Tue Jul 19 16:50:55 2011 (r224221) +++ head/sys/net80211/ieee80211_proto.c Wed Jul 20 00:36:47 2011 (r224222) @@ -1533,6 +1533,8 @@ csa_completeswitch(struct ieee80211com * void ieee80211_csa_completeswitch(struct ieee80211com *ic) { + struct ieee80211vap *vap; + IEEE80211_LOCK_ASSERT(ic); KASSERT(ic->ic_flags & IEEE80211_F_CSAPENDING, ("csa not pending")); From owner-svn-src-head@FreeBSD.ORG Wed Jul 20 05:59:28 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2EE91065676; Wed, 20 Jul 2011 05:59:28 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E361F8FC15; Wed, 20 Jul 2011 05:59:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6K5xSK3003483; Wed, 20 Jul 2011 05:59:28 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6K5xSSx003481; Wed, 20 Jul 2011 05:59:28 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201107200559.p6K5xSSx003481@svn.freebsd.org> From: Adrian Chadd Date: Wed, 20 Jul 2011 05:59:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224224 - head/sbin/ifconfig X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jul 2011 05:59:29 -0000 Author: adrian Date: Wed Jul 20 05:59:28 2011 New Revision: 224224 URL: http://svn.freebsd.org/changeset/base/224224 Log: This patch removes a check in ifconfig which disables HT/40 channels on frequency bands with DFS. All Atheros chipsets >= AR9001 support radar event detection on HT40 extension channels. This should be a chipset specific item rather than enforced in the regulatory domain database. In addition, it's irrelevant for STA mode, as the radar detection is done by the access point, not the STA. Approved by: re (kib) Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Wed Jul 20 04:57:40 2011 (r224223) +++ head/sbin/ifconfig/ifieee80211.c Wed Jul 20 05:59:28 2011 (r224224) @@ -2027,18 +2027,6 @@ regdomain_addchans(struct ieee80211req_c "HT40 channel\n", freq); continue; } - /* - * DFS and HT40 don't mix. This should be - * expressed in the regdomain database but - * just in case enforce it here. - */ - if ((chanFlags & IEEE80211_CHAN_HT40) && - (flags & IEEE80211_CHAN_DFS)) { - if (verbose) - printf("%u: skip, HT40+DFS " - "not permitted\n", freq); - continue; - } /* NB: HT attribute comes from caller */ flags &= ~IEEE80211_CHAN_HT; flags |= chanFlags & IEEE80211_CHAN_HT; From owner-svn-src-head@FreeBSD.ORG Wed Jul 20 09:53:35 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B185C1065670; Wed, 20 Jul 2011 09:53:35 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 96E618FC14; Wed, 20 Jul 2011 09:53:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6K9rZNd010698; Wed, 20 Jul 2011 09:53:35 GMT (envelope-from jonathan@svn.freebsd.org) Received: (from jonathan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6K9rZjh010695; Wed, 20 Jul 2011 09:53:35 GMT (envelope-from jonathan@svn.freebsd.org) Message-Id: <201107200953.p6K9rZjh010695@svn.freebsd.org> From: Jonathan Anderson Date: Wed, 20 Jul 2011 09:53:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224225 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jul 2011 09:53:35 -0000 Author: jonathan Date: Wed Jul 20 09:53:35 2011 New Revision: 224225 URL: http://svn.freebsd.org/changeset/base/224225 Log: Export capability information via sysctls. When reporting on a capability, flag the fact that it is a capability, but also unwrap to report all of the usual information about the underlying file. Approved by: re (kib), mentor (rwatson) Sponsored by: Google Inc Modified: head/sys/kern/kern_descrip.c head/sys/sys/user.h Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Wed Jul 20 05:59:28 2011 (r224224) +++ head/sys/kern/kern_descrip.c Wed Jul 20 09:53:35 2011 (r224225) @@ -2946,6 +2946,22 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLE so = NULL; tp = NULL; kif->kf_fd = i; + +#ifdef CAPABILITIES + /* + * When reporting a capability, most fields will be from the + * underlying object, but do mark as a capability. With + * ofiledesc, we don't have a field to export the cap_rights_t, + * but we do with the new filedesc. + */ + if (fp->f_type == DTYPE_CAPABILITY) { + kif->kf_flags |= KF_FLAG_CAPABILITY; + (void)cap_funwrap(fp, 0, &fp); + } +#else + KASSERT(fp->f_type != DTYPE_CAPABILITY, + ("sysctl_kern_proc_ofiledesc: saw capability")); +#endif switch (fp->f_type) { case DTYPE_VNODE: kif->kf_type = KF_TYPE_VNODE; @@ -3262,6 +3278,22 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER if ((fp = fdp->fd_ofiles[i]) == NULL) continue; data = NULL; + +#ifdef CAPABILITIES + /* + * When reporting a capability, most fields will be from the + * underlying object, but do mark as a capability and export + * the capability rights mask. + */ + if (fp->f_type == DTYPE_CAPABILITY) { + kif->kf_flags |= KF_FLAG_CAPABILITY; + kif->kf_cap_rights = cap_rights(fp); + (void)cap_funwrap(fp, 0, &fp); + } +#else /* !CAPABILITIES */ + KASSERT(fp->f_type != DTYPE_CAPABILITY, + ("sysctl_kern_proc_filedesc: saw capability")); +#endif switch (fp->f_type) { case DTYPE_VNODE: type = KF_TYPE_VNODE; Modified: head/sys/sys/user.h ============================================================================== --- head/sys/sys/user.h Wed Jul 20 05:59:28 2011 (r224224) +++ head/sys/sys/user.h Wed Jul 20 09:53:35 2011 (r224225) @@ -251,6 +251,7 @@ struct user { #define KF_TYPE_SHM 8 #define KF_TYPE_SEM 9 #define KF_TYPE_PTS 10 +/* no KF_TYPE_CAPABILITY (11), since capabilities wrap other file objects */ #define KF_TYPE_UNKNOWN 255 #define KF_VTYPE_VNON 0 @@ -286,6 +287,7 @@ struct user { #define KF_FLAG_TRUNC 0x00001000 #define KF_FLAG_EXCL 0x00002000 #define KF_FLAG_EXEC 0x00004000 +#define KF_FLAG_CAPABILITY 0x00008000 /* * Old format. Has variable hidden padding due to alignment. @@ -378,7 +380,9 @@ struct kinfo_file { } kf_un; uint16_t kf_status; /* Status flags. */ uint16_t kf_pad1; /* Round to 32 bit alignment. */ - int _kf_ispare[7]; /* Space for more stuff. */ + int _kf_ispare0; /* Space for more stuff. */ + cap_rights_t kf_cap_rights; /* Capability rights. */ + int _kf_ispare[4]; /* Space for more stuff. */ /* Truncated before copyout in sysctl */ char kf_path[PATH_MAX]; /* Path to file, if any. */ }; From owner-svn-src-head@FreeBSD.ORG Wed Jul 20 10:37:51 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66C2A1065672; Wed, 20 Jul 2011 10:37:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 4BAAE8FC0C; Wed, 20 Jul 2011 10:37:49 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id NAA28500; Wed, 20 Jul 2011 13:37:45 +0300 (EEST) (envelope-from avg@FreeBSD.org) Message-ID: <4E26AFF8.8080107@FreeBSD.org> Date: Wed, 20 Jul 2011 13:37:44 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:5.0) Gecko/20110705 Thunderbird/5.0 MIME-Version: 1.0 To: Hans Petter Selasky References: <201107132107.p6DL7ojq099900@svn.freebsd.org> <4E242C9E.6010604@FreeBSD.org> <201107181610.49443.hselasky@c2i.net> In-Reply-To: <201107181610.49443.hselasky@c2i.net> X-Enigmail-Version: 1.2pre Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: "svn-src-head@FreeBSD.org" , "svn-src-all@FreeBSD.org" , "src-committers@FreeBSD.org" Subject: Re: svn commit: r223989 - head/sys/dev/usb/input X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jul 2011 10:37:51 -0000 on 18/07/2011 17:10 Hans Petter Selasky said the following: > Hi, > >> The question is: why this special subcase is needed at all. > > Yes, according to the current keyboard implementation in the kernel. > >> If I understand correctly, the polling mode is used only in some special >> situations/contexts. >> So why not always use the generic code (after this if-block) that does >> "proper" polling? What do we win when using this special case that seems >> to depend on the scheduler? > > This special code is a workaround. The problem is that when not polling the > key presses will be fed into syscons I think, and not returned via the polling > function. That's why there is a timer there to distinguish when polling starts > and polling stops. It is not enough just to enable/disable polling around each > key-press like currently done. I must admit that I failed to understand this paragraph, so I think that I should shut up until I know the relevant code better. > Please test any patches that it works in the filesystem mount prompt after > boot: Edit /etc/fstab and put some non-existing device there for root > partition. Reboot. Make sure USB keyboard works in the prompt which appears. I do not plan to make any changes to USB/ukbd code at the moment. >> >> Unfortunately I couldn't fully understand commit log of r203896. >> >> One of the reasons I am asking about this is that soon-ish we may have >> changes that disable scheduler in a context where panicstr != NULL. > > Ok. Please make sure that USB keyboard works reliably in boot prompt when > asking for file-system and in KDB and after dump during shutdown. An of course > after logged in like a normal user :-) Sure, but I do not think that my changes may affect any of the environments that you've mentioned. I am mostly concerned about "press any key to reboot" prompt after (unattended) panic, but that would be a pretty minor issue IMO. -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Wed Jul 20 10:51:52 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC4581065672; Wed, 20 Jul 2011 10:51:52 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe01.c2i.net [212.247.154.2]) by mx1.freebsd.org (Postfix) with ESMTP id DB8EA8FC18; Wed, 20 Jul 2011 10:51:50 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=yfIOS+81wnQIz0UwZPDdWOvE/jQxEvyI9Z1xC25I9wc= c=1 sm=1 a=SvYTsOw2Z4kA:10 a=Bjjt3Ia5OwMA:10 a=WQU8e4WWZSUA:10 a=N659UExz7-8A:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=doO9VkV0O5B3E9BATT0A:9 a=Kgdwo8sobGYHKmN4RZYA:7 a=pILNOxqGKmIA:10 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe01.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 155694378; Wed, 20 Jul 2011 12:51:49 +0200 From: Hans Petter Selasky To: Andriy Gapon Date: Wed, 20 Jul 2011 12:49:39 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.2-STABLE; KDE/4.4.5; amd64; ; ) References: <201107181610.49443.hselasky@c2i.net> <4E26AFF8.8080107@FreeBSD.org> In-Reply-To: <4E26AFF8.8080107@FreeBSD.org> X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq,NwSZ4V" =?iso-8859-1?q?=7CLR=2E+tj=7Dg5=0A=09=25V?=,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( =?iso-8859-1?q?=0A=09=3AAuzV9=3A=2EhESm-x4h240C=609=3Dw?= MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Message-Id: <201107201249.39550.hselasky@c2i.net> Cc: "svn-src-head@FreeBSD.org" , "svn-src-all@FreeBSD.org" , "src-committers@FreeBSD.org" Subject: Re: svn commit: r223989 - head/sys/dev/usb/input X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jul 2011 10:51:53 -0000 On Wednesday 20 July 2011 12:37:44 Andriy Gapon wrote: > > This special code is a workaround. The problem is that when not polling > > the key presses will be fed into syscons I think, and not returned via > > the polling function. That's why there is a timer there to distinguish > > when polling starts and polling stops. It is not enough just to > > enable/disable polling around each key-press like currently done. > > I must admit that I failed to understand this paragraph, so I think that I > should shut up until I know the relevant code better. Try and see for yourself, maybe you will understand it then? Remove the kbd_active == 0 branch in the ukbd.c. Then get into the mount-root prompt. Then start pressing keys. You will see that some keys are captured and some are not. This is because two clients are listening for keys. --HPS From owner-svn-src-head@FreeBSD.ORG Wed Jul 20 12:46:59 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11BA11065670; Wed, 20 Jul 2011 12:46:59 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F3C7E8FC08; Wed, 20 Jul 2011 12:46:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6KCkwDp017393; Wed, 20 Jul 2011 12:46:58 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6KCkwfX017390; Wed, 20 Jul 2011 12:46:58 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201107201246.p6KCkwfX017390@svn.freebsd.org> From: Adrian Chadd Date: Wed, 20 Jul 2011 12:46:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224226 - head/sys/dev/ath/ath_hal/ah_regdomain X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jul 2011 12:46:59 -0000 Author: adrian Date: Wed Jul 20 12:46:58 2011 New Revision: 224226 URL: http://svn.freebsd.org/changeset/base/224226 Log: These two are ath_hal regulatory domain updates from the Atheros reference driver. * Australia should use FCC3_WORLD * Add some new SKUs; these are just the EEPROM values and haven't been fully defined yet. As such they won't affect anything. Obtained from: Atheros Approved by: re (kib) Modified: head/sys/dev/ath/ath_hal/ah_regdomain/ah_rd_ctry.h head/sys/dev/ath/ath_hal/ah_regdomain/ah_rd_regenum.h Modified: head/sys/dev/ath/ath_hal/ah_regdomain/ah_rd_ctry.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_regdomain/ah_rd_ctry.h Wed Jul 20 09:53:35 2011 (r224225) +++ head/sys/dev/ath/ath_hal/ah_regdomain/ah_rd_ctry.h Wed Jul 20 12:46:58 2011 (r224226) @@ -1,6 +1,6 @@ /* * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting - * Copyright (c) 2005-2006 Atheros Communications, Inc. + * Copyright (c) 2005-2011 Atheros Communications, Inc. * All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any @@ -34,7 +34,7 @@ static COUNTRY_CODE_TO_ENUM_RD allCountr { CTRY_ALGERIA, NULL1_WORLD }, { CTRY_ARGENTINA, APL3_WORLD }, { CTRY_ARMENIA, ETSI4_WORLD }, - { CTRY_AUSTRALIA, FCC2_WORLD }, + { CTRY_AUSTRALIA, FCC3_WORLD }, { CTRY_AUSTRIA, ETSI1_WORLD }, { CTRY_AZERBAIJAN, ETSI4_WORLD }, { CTRY_BAHRAIN, APL6_WORLD }, Modified: head/sys/dev/ath/ath_hal/ah_regdomain/ah_rd_regenum.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_regdomain/ah_rd_regenum.h Wed Jul 20 09:53:35 2011 (r224225) +++ head/sys/dev/ath/ath_hal/ah_regdomain/ah_rd_regenum.h Wed Jul 20 12:46:58 2011 (r224226) @@ -1,6 +1,6 @@ /* * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting - * Copyright (c) 2005-2006 Atheros Communications, Inc. + * Copyright (c) 2005-2011 Atheros Communications, Inc. * All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any @@ -46,6 +46,7 @@ enum { FCC1_WORLD = 0x11, /* Hong Kong */ FCC4_FCCA = 0x12, /* USA - Public Safety */ FCC5_FCCB = 0x13, /* USA w/ 1/2 and 1/4 width channels */ + FCC6_FCCA = 0x14, /* Canada for AP only */ FCC2_FCCA = 0x20, /* Canada */ FCC2_WORLD = 0x21, /* Australia & HK */ @@ -62,6 +63,8 @@ enum { ETSI4_ETSIC = 0x38, ETSI5_WORLD = 0x39, ETSI6_WORLD = 0x34, /* Bulgaria */ + ETSI8_WORLD = 0x3D, /* Russia */ + ETSI9_WORLD = 0x3E, /* Ukraine */ ETSI_RESERVED = 0x33, /* Reserved (Do not used) */ MKK1_MKKA = 0x40, /* Japan (JP1) */ @@ -77,8 +80,9 @@ enum { MKK1_MKKA1 = 0x4A, /* Japan (JE1) */ MKK1_MKKA2 = 0x4B, /* Japan (JE2) */ MKK1_MKKC = 0x4C, /* Japan (MKK1_MKKA,except Ch14) */ + APL2_FCCA = 0x4D, /* Mobile customer */ - APL3_FCCA = 0x50, + APL3_FCCA = 0x50, APL1_WORLD = 0x52, /* Latin America */ APL1_FCCA = 0x53, APL1_APLA = 0x54, @@ -86,9 +90,10 @@ enum { APL2_ETSIC = 0x56, /* Venezuela */ APL5_WORLD = 0x58, /* Chile */ APL6_WORLD = 0x5B, /* Singapore */ - APL7_FCCA = 0x5C, /* Taiwan 5.47 Band */ - APL8_WORLD = 0x5D, /* Malaysia 5GHz */ - APL9_WORLD = 0x5E, /* Korea 5GHz */ + APL7_FCCA = 0x5C, /* Taiwan 5.47 Band */ + APL8_WORLD = 0x5D, /* Malaysia 5GHz */ + APL9_WORLD = 0x5E, /* Korea 5GHz; before 11/2007; now APs only */ + APL10_WORLD = 0x5F, /* Korea 5GHz; After 11/2007; STAs only */ /* * World mode SKUs @@ -97,16 +102,17 @@ enum { WOR1_WORLD = 0x61, /* World1 (WO1 SKU) */ WOR2_WORLD = 0x62, /* World2 (WO2 SKU) */ WOR3_WORLD = 0x63, /* World3 (WO3 SKU) */ - WOR4_WORLD = 0x64, /* World4 (WO4 SKU) */ - WOR5_ETSIC = 0x65, /* World5 (WO5 SKU) */ + WOR4_WORLD = 0x64, /* World4 (WO4 SKU) */ + WOR5_ETSIC = 0x65, /* World5 (WO5 SKU) */ WOR01_WORLD = 0x66, /* World0-1 (WW0-1 SKU) */ WOR02_WORLD = 0x67, /* World0-2 (WW0-2 SKU) */ EU1_WORLD = 0x68, /* Same as World0-2 (WW0-2 SKU), except active scan ch1-13. No ch14 */ - WOR9_WORLD = 0x69, /* World9 (WO9 SKU) */ - WORA_WORLD = 0x6A, /* WorldA (WOA SKU) */ + WOR9_WORLD = 0x69, /* World9 (WO9 SKU) */ + WORA_WORLD = 0x6A, /* WorldA (WOA SKU) */ WORB_WORLD = 0x6B, /* WorldB (WOB SKU) */ + WORC_WORLD = 0x6C, /* WorldC (WOC SKU) */ MKK3_MKKB = 0x80, /* Japan UNI-1 even + MKKB */ MKK3_MKKA2 = 0x81, /* Japan UNI-1 even + MKKA2 */ @@ -132,17 +138,48 @@ enum { MKK8_MKKA2 = 0x90, /* Japan UNI-1 even + UNI-1 odd + UNI-2 + mid-band + MKKA2 */ MKK8_MKKC = 0x91, /* Japan UNI-1 even + UNI-1 odd + UNI-2 + mid-band + MKKC */ - /* Following definitions are used only by s/w to map old - * Japan SKUs. + MKK14_MKKA1 = 0x92, /* Japan UNI-1 even + UNI-1 odd + 4.9GHz + MKKA1 */ + MKK15_MKKA1 = 0x93, /* Japan UNI-1 even + UNI-1 odd + UNI-2 + 4.9GHz + MKKA1 */ + + MKK10_FCCA = 0xD0, /* Japan UNI-1 even + UNI-2 + 4.9GHz + FCCA */ + MKK10_MKKA1 = 0xD1, /* Japan UNI-1 even + UNI-2 + 4.9GHz + MKKA1 */ + MKK10_MKKC = 0xD2, /* Japan UNI-1 even + UNI-2 + 4.9GHz + MKKC */ + MKK10_MKKA2 = 0xD3, /* Japan UNI-1 even + UNI-2 + 4.9GHz + MKKA2 */ + + MKK11_MKKA = 0xD4, /* Japan UNI-1 even + UNI-2 + mid-band + 4.9GHz + MKKA */ + MKK11_FCCA = 0xD5, /* Japan UNI-1 even + UNI-2 + mid-band + 4.9GHz + FCCA */ + MKK11_MKKA1 = 0xD6, /* Japan UNI-1 even + UNI-2 + mid-band + 4.9GHz + MKKA1 */ + MKK11_MKKC = 0xD7, /* Japan UNI-1 even + UNI-2 + mid-band + 4.9GHz + MKKC */ + MKK11_MKKA2 = 0xD8, /* Japan UNI-1 even + UNI-2 + mid-band + 4.9GHz + MKKA2 */ + + MKK12_MKKA = 0xD9, /* Japan UNI-1 even + UNI-1 odd + UNI-2 + mid-band + 4.9GHz + MKKA */ + MKK12_FCCA = 0xDA, /* Japan UNI-1 even + UNI-1 odd + UNI-2 + mid-band + 4.9GHz + FCCA */ + MKK12_MKKA1 = 0xDB, /* Japan UNI-1 even + UNI-1 odd + UNI-2 + mid-band + 4.9GHz + MKKA1 */ + MKK12_MKKC = 0xDC, /* Japan UNI-1 even + UNI-1 odd + UNI-2 + mid-band + 4.9GHz + MKKC */ + MKK12_MKKA2 = 0xDD, /* Japan UNI-1 even + UNI-1 odd + UNI-2 + mid-band + 4.9GHz + MKKA2 */ + + MKK13_MKKB = 0xDE, /* Japan UNI-1 even + UNI-1 odd + UNI-2 + mid-band + MKKB + All passive + no adhoc */ + + /* + * Following definitions are used only by s/w to map old + * Japan SKUs. */ - MKK3_MKKA = 0xF0, /* Japan UNI-1 even + MKKA */ - MKK3_MKKA1 = 0xF1, /* Japan UNI-1 even + MKKA1 */ - MKK3_FCCA = 0xF2, /* Japan UNI-1 even + FCCA */ - MKK4_MKKA = 0xF3, /* Japan UNI-1 even + UNI-2 + MKKA */ - MKK4_MKKA1 = 0xF4, /* Japan UNI-1 even + UNI-2 + MKKA1 */ - MKK4_FCCA = 0xF5, /* Japan UNI-1 even + UNI-2 + FCCA */ - MKK9_MKKA = 0xF6, /* Japan UNI-1 even + 4.9GHz */ - MKK10_MKKA = 0xF7, /* Japan UNI-1 even + UNI-2 + 4.9GHz */ + MKK3_MKKA = 0xF0, /* Japan UNI-1 even + MKKA */ + MKK3_MKKA1 = 0xF1, /* Japan UNI-1 even + MKKA1 */ + MKK3_FCCA = 0xF2, /* Japan UNI-1 even + FCCA */ + MKK4_MKKA = 0xF3, /* Japan UNI-1 even + UNI-2 + MKKA */ + MKK4_MKKA1 = 0xF4, /* Japan UNI-1 even + UNI-2 + MKKA1 */ + MKK4_FCCA = 0xF5, /* Japan UNI-1 even + UNI-2 + FCCA */ + MKK9_MKKA = 0xF6, /* Japan UNI-1 even + 4.9GHz */ + MKK10_MKKA = 0xF7, /* Japan UNI-1 even + UNI-2 + 4.9GHz */ + MKK6_MKKA1 = 0xF8, /* Japan UNI-1 even + UNI-1 odd + UNI-2 + MKKA1 */ + MKK6_FCCA = 0xF9, /* Japan UNI-1 even + UNI-1 odd + UNI-2 + FCCA */ + MKK7_MKKA1 = 0xFA, /* Japan UNI-1 even + UNI-1 odd + UNI-2 + MKKA1 */ + MKK7_FCCA = 0xFB, /* Japan UNI-1 even + UNI-1 odd + UNI-2 + FCCA */ + MKK9_FCCA = 0xFC, /* Japan UNI-1 even + 4.9GHz + FCCA */ + MKK9_MKKA1 = 0xFD, /* Japan UNI-1 even + 4.9GHz + MKKA1 */ + MKK9_MKKC = 0xFE, /* Japan UNI-1 even + 4.9GHz + MKKC */ + MKK9_MKKA2 = 0xFF, /* Japan UNI-1 even + 4.9GHz + MKKA2 */ /* * Regulator domains ending in a number (e.g. APL1, @@ -157,8 +194,10 @@ enum { APL4 = 0x0450, /* Jordan */ APL5 = 0x0550, /* Chile */ APL6 = 0x0650, /* Singapore */ + APL7 = 0x0750, /* Taiwan, disable ch52 */ APL8 = 0x0850, /* Malaysia */ - APL9 = 0x0950, /* Korea (South) ROC 3 */ + APL9 = 0x0950, /* Korea. Before 11/2007. Now used only by APs */ + APL10 = 0x1050, /* Korea. After 11/2007. For STAs only */ ETSI1 = 0x0130, /* Europe & others */ ETSI2 = 0x0230, /* Europe & others */ @@ -166,16 +205,19 @@ enum { ETSI4 = 0x0430, /* Europe & others */ ETSI5 = 0x0530, /* Europe & others */ ETSI6 = 0x0630, /* Europe & others */ + ETSI8 = 0x0830, /* Russia */ + ETSI9 = 0x0930, /* Ukraine */ ETSIA = 0x0A30, /* France */ ETSIB = 0x0B30, /* Israel */ ETSIC = 0x0C30, /* Latin America */ FCC1 = 0x0110, /* US & others */ FCC2 = 0x0120, /* Canada, Australia & New Zealand */ - FCC3 = 0x0160, /* US w/new middle band & DFS */ - FCC4 = 0x0165, /* US Public Safety */ - FCC5 = 0x0166, /* US w/ 1/2 and 1/4 width channels */ - FCCA = 0x0A10, + FCC3 = 0x0160, /* US w/new middle band & DFS */ + FCC4 = 0x0165, /* US Public Safety */ + FCC5 = 0x0166, /* US w/ 1/2 and 1/4 width channels */ + FCC6 = 0x0610, /* Canada and Australia */ + FCCA = 0x0A10, FCCB = 0x0A11, /* US w/ 1/2 and 1/4 width channels */ APLD = 0x0D50, /* South Korea */ @@ -188,8 +230,14 @@ enum { MKK6 = 0x0640, /* Japan (UNI-1 odd + UNI-1 even) */ MKK7 = 0x0740, /* Japan (UNI-1 odd + UNI-1 even + UNI-2 */ MKK8 = 0x0840, /* Japan (UNI-1 odd + UNI-1 even + UNI-2 + mid-band) */ - MKK9 = 0x0940, /* Japan (UNI-1 even + 4.9 GHZ) */ - MKK10 = 0x0B40, /* Japan (UNI-1 even + UNI-2 + 4.9 GHZ) */ + MKK9 = 0x0940, /* Japan (UNI-1 even + 4.9 GHZ) */ + MKK10 = 0x0B40, /* Japan (UNI-1 even + UNI-2 + 4.9 GHZ) */ + MKK11 = 0x1140, /* Japan (UNI-1 even + UNI-2 + 4.9 GHZ) */ + MKK12 = 0x1240, /* Japan (UNI-1 even + UNI-2 + 4.9 GHZ) */ + MKK13 = 0x0C40, /* Same as MKK8 but all passive and no adhoc 11a */ + MKK14 = 0x1440, /* Japan UNI-1 even + UNI-1 odd + 4.9GHz */ + MKK15 = 0x1540, /* Japan UNI-1 even + UNI-1 odd + UNI-2 + 4.9GHz */ + MKKA = 0x0A40, /* Japan */ MKKC = 0x0A50, From owner-svn-src-head@FreeBSD.ORG Wed Jul 20 13:03:08 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2257F1065678; Wed, 20 Jul 2011 13:03:08 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id EC2338FC14; Wed, 20 Jul 2011 13:03:07 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 6EB8146B24; Wed, 20 Jul 2011 09:03:07 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 0473B8A02C; Wed, 20 Jul 2011 09:03:07 -0400 (EDT) From: John Baldwin To: Robert Watson Date: Wed, 20 Jul 2011 09:03:06 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110617; KDE/4.5.5; amd64; ; ) References: <201106061255.p56Ct3qN031795@svn.freebsd.org> In-Reply-To: <201106061255.p56Ct3qN031795@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201107200903.06449.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Wed, 20 Jul 2011 09:03:07 -0400 (EDT) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r222748 - in head/sys: conf netinet netinet/ipfw netinet6 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jul 2011 13:03:08 -0000 On Monday, June 06, 2011 8:55:03 am Robert Watson wrote: > Author: rwatson > Date: Mon Jun 6 12:55:02 2011 > New Revision: 222748 > URL: http://svn.freebsd.org/changeset/base/222748 > > Log: > Implement a CPU-affine TCP and UDP connection lookup data structure, > struct inpcbgroup. pcbgroups, or "connection groups", supplement the > existing inpcbinfo connection hash table, which when pcbgroups are > enabled, might now be thought of more usefully as a per-protocol > 4-tuple reservation table. > > Connections are assigned to connection groups base on a hash of their > 4-tuple; wildcard sockets require special handling, and are members > of all connection groups. During a connection lookup, a > per-connection group lock is employed rather than the global pcbinfo > lock. By aligning connection groups with input path processing, > connection groups take on an effective CPU affinity, especially when > aligned with RSS work placement (see a forthcoming commit for > details). This eliminates cache line migration associated with > global, protocol-layer data structures in steady state TCP and UDP > processing (with the exception of protocol-layer statistics; further > commit to follow). > > Elements of this approach were inspired by Willman, Rixner, and Cox's > 2006 USENIX paper, "An Evaluation of Network Stack Parallelization > Strategies in Modern Operating Systems". However, there are also > significant differences: we maintain the inpcb lock, rather than using > the connection group lock for per-connection state. > > Likewise, the focus of this implementation is alignment with NIC > packet distribution strategies such as RSS, rather than pure software > strategies. Despite that focus, software distribution is supported > through the parallel netisr implementation, and works well in > configurations where the number of hardware threads is greater than > the number of NIC input queues, such as in the RMI XLR threaded MIPS > architecture. > > Another important difference is the continued maintenance of existing > hash tables as "reservation tables" -- these are useful both to > distinguish the resource allocation aspect of protocol name management > and the more common-case lookup aspect. In configurations where > connection tables are aligned with hardware hashes, it is desirable to > use the traditional lookup tables for loopback or encapsulated traffic > rather than take the expense of hardware hashes that are hard to > implement efficiently in software (such as RSS Toeplitz). > > Connection group support is enabled by compiling "options PCBGROUP" > into your kernel configuration; for the time being, this is an > experimental feature, and hence is not enabled by default. > > Subject to the limited MFCability of change dependencies in inpcb, > and its change to the inpcbinfo init function signature, this change > in principle could be merged to FreeBSD 8.x. > > Reviewed by: bz > Sponsored by: Juniper Networks, Inc. FYI, this commit broke the net-snmp build in ports. The issue is that the alignment on 'struct inpcbgroup' added a new dependency of to (previously sufficed) which breaks the conftest.c that net-snmp uses to see if is valid. Perhaps we should only tag inpcbgroup with an alignment requirement in the kernel and not in userland? It seems we should also be careful in exposing things that depend on CACHE_LINE_SIZE to userland. configure:31545: checking for netinet/in_pcb.h configure:31591: cc -c -DNETSNMP_ENABLE_IPV6 -O2 -pipe -march=pentium4 -fno-stri ct-aliasing -Ufreebsd9 -Dfreebsd9=freebsd9 -DAPPLLIB_EXP="/usr/local/lib/perl5/ 5.12.4/BSDPAN" -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/usr/local/lib/perl5/5.12.4/mach/CORE -I/usr/include conftest.c >&5 In file included from conftest.c:217: /usr/include/netinet/in_pcb.h:390: error: requested alignment is not a constant configure:31598: $? = 1 configure: failed program was: | /* confdefs.h. */ .... | /* end confdefs.h. */ | | #if HAVE_SYS_TYPES_H | #include | #endif ... | | #include -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Jul 20 13:29:39 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2489106564A; Wed, 20 Jul 2011 13:29:39 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8717A8FC12; Wed, 20 Jul 2011 13:29:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6KDTdqo018641; Wed, 20 Jul 2011 13:29:39 GMT (envelope-from jonathan@svn.freebsd.org) Received: (from jonathan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6KDTdPg018637; Wed, 20 Jul 2011 13:29:39 GMT (envelope-from jonathan@svn.freebsd.org) Message-Id: <201107201329.p6KDTdPg018637@svn.freebsd.org> From: Jonathan Anderson Date: Wed, 20 Jul 2011 13:29:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224227 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jul 2011 13:29:39 -0000 Author: jonathan Date: Wed Jul 20 13:29:39 2011 New Revision: 224227 URL: http://svn.freebsd.org/changeset/base/224227 Log: Add cap_new(2) and cap_getrights(2) symbols to libc. These system calls have already been implemented in the kernel; now we hook up libc symbols so userspace can drive them. Approved by: re (kib), mentor (rwatson) Sponsored by: Google Inc Added: head/lib/libc/sys/cap_new.2 (contents, props changed) Modified: head/lib/libc/sys/Makefile.inc head/lib/libc/sys/Symbol.map Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Wed Jul 20 12:46:58 2011 (r224226) +++ head/lib/libc/sys/Makefile.inc Wed Jul 20 13:29:39 2011 (r224227) @@ -77,7 +77,7 @@ ${SPSEUDO}: MAN+= abort2.2 accept.2 access.2 acct.2 adjtime.2 \ aio_cancel.2 aio_error.2 aio_read.2 aio_return.2 \ aio_suspend.2 aio_waitcomplete.2 aio_write.2 \ - bind.2 brk.2 cap_enter.2 chdir.2 chflags.2 \ + bind.2 brk.2 cap_enter.2 cap_new.2 chdir.2 chflags.2 \ chmod.2 chown.2 chroot.2 clock_gettime.2 close.2 closefrom.2 \ connect.2 cpuset.2 cpuset_getaffinity.2 dup.2 execve.2 _exit.2 \ extattr_get_file.2 fcntl.2 fhopen.2 flock.2 fork.2 fsync.2 \ @@ -119,6 +119,7 @@ MAN+= sctp_generic_recvmsg.2 sctp_generi MLINKS+=access.2 eaccess.2 access.2 faccessat.2 MLINKS+=brk.2 sbrk.2 MLINKS+=cap_enter.2 cap_getmode.2 +MLINKS+=cap_new.2 cap_getrights.2 MLINKS+=chdir.2 fchdir.2 MLINKS+=chflags.2 fchflags.2 chflags.2 lchflags.2 MLINKS+=chmod.2 fchmod.2 chmod.2 fchmodat.2 chmod.2 lchmod.2 Modified: head/lib/libc/sys/Symbol.map ============================================================================== --- head/lib/libc/sys/Symbol.map Wed Jul 20 12:46:58 2011 (r224226) +++ head/lib/libc/sys/Symbol.map Wed Jul 20 13:29:39 2011 (r224227) @@ -363,6 +363,8 @@ FBSD_1.1 { FBSD_1.2 { cap_enter; cap_getmode; + cap_new; + cap_getrights; getloginclass; posix_fallocate; rctl_get_racct; Added: head/lib/libc/sys/cap_new.2 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/sys/cap_new.2 Wed Jul 20 13:29:39 2011 (r224227) @@ -0,0 +1,474 @@ +.\" +.\" Copyright (c) 2008-2010 Robert N. M. Watson +.\" All rights reserved. +.\" +.\" This software was developed at the University of Cambridge Computer +.\" Laboratory with support from a grant from Google, Inc. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd July 20, 2011 +.Dt CAP_NEW 2 +.Os +.Sh NAME +.Nm cap_new , +.Nm cap_getrights +.Nd System calls to manipulate capabilities +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/capability.h +.Ft int +.Fn cap_new "int fd" "cap_rights_t rights" +.Ft int +.Fn cap_getrights "int fd" "cap_rights_t *rightsp" +.Sh DESCRIPTION +Capabilities are special file descriptors derived from an existing file +descriptor, such as one returned by +.Xr fhopen 2 , +.Xr kqueue 2 , +.Xr mq_open 2 , +.Xr open 2 , +.Xr pipe 2 , +.Xr shm_open 2 , +.Xr socket 2 , +or +.Xr socketpair 2 , +but with a restricted set of permitted operations determined by a rights +mask set when the capability is created. +These restricted rights cannot be changed after the capability is created, +although further capabilities with yet more restricted rights may be created +from an existing capability. +In every other sense, a capability behaves in the same way as the file +descriptor it was created from. +.Pp +.Fn cap_new +creates a new capability for the existing file descriptor +.Fa fd , +and returns a file descriptor for it. +Operations on the capability will be limited to those permitted by +.Fa rights , +which is static for the lifetime of the capability. +If +.Fa fd +refers to an existing capability, then +.Fa rights +must be equal to or a subset of the rights on that capability. +As with +.Xr dup 2 +and +.Xr dup2 2 , +many properties are shared between the new capability and the existing file +descriptor, including open file flags, blocking disposition, and file offset. +Many applications will prefer to use the +.Xr cap_limitfd 3 +library call, part of +.Xr libcapsicum 3 , +as it offers a more convenient interface. +.Pp +.Fn cap_getrights +queries the rights associated with the capability referred to by file +descriptor +.Fa fd . +.Pp +These system calls, when combined with +.Xr cap_enter 2 , +may be used to construct process sandboxes with highly granular rights +assignment. +.Sh RIGHTS +The following rights may be specified in a new capability rights mask: +.Bl -tag -width CAP_EXTATTR_DELETE +.It Dv CAP_ACCEPT +Permit +.Xr accept 2 . +.It Dv CAP_ACL_CHECK +Permit checking of an ACL on a file descriptor; there is no cross-reference +for this system call. +.It Dv CAP_ACL_DELETE +Permit +.Xr acl_delete_fd_np 2 . +.It Dv CAP_ACL_GET +Permit +.Xr acl_get_fd 2 +and +.Xr acl_get_fd_np 2 . +.It Dv CAP_ACL_SET +Permit +.Xr acl_set_fd 2 +and +.Xr acl_set_fd_np 2 . +.It Dv CAP_BIND +Permit +.Xr bind 2 . +Note that sockets can also become bound implicitly as a result of +.Xr connect 2 +or +.Xr send 2 , +and that socket options set with +.Xr setsockopt 2 +may also affect binding behavior. +.It Dv CAP_CONNECT +Permit +.Xr connect 2 ; +also required for +.Xr sendto 2 +with a non-NULL destination address. +.It Dv CAP_EVENT +Permit +.Xr select 2 , +.Xr poll 2 , +and +.Xr kevent 2 +to be used in monitoring the file descriptor for events. +.It Dv CAP_FEXECVE +Permit +.Xr fexecve 2 ; +.Dv CAP_READ +will also be required. +.It Dv CAP_EXTATTR_DELETE +Permit +.Xr extattr_delete_fd 2 . +.It Dv CAP_EXTATTR_GET +Permit +.Xr extattr_get_fd 2 . +.It Dv CAP_EXTATTR_LIST +Permit +.Xr extattr_list_fd 2 . +.It Dv CAP_EXTATTR_SET +Permit +.Xr extattr_set_fd 2 . +.It Dv CAP_FCHDIR +Permit +.Xr fchdir 2 . +.It Dv CAP_FCHFLAGS +Permit +.Xr fchflags 2 . +.It Dv CAP_FCHMOD +Permit +.Xr fchmod 2 . +.It Dv CAP_FCHOWN +Permit +.Xr fchown 2 . +.It Dv CAP_FCNTL +Permit +.Xr fcntl 2 ; +be aware that this call provides indirect access to other operations, such as +.Xr flock 2 . +.It Dv CAP_FLOCK +Permit +.Xr flock 2 +and related calls. +.It Dv CAP_FPATHCONF +Permit +.Xr fpathconf 2 . +.It Dv CAP_FSCK +Permit UFS background-fsck operations on the descriptor. +.It Dv CAP_FSTAT +Permit +.Xr fstat 2 . +.It Dv CAP_FSTATFS +Permit +.Xr fstatfs 2 . +.It Dv CAP_FSYNC +Permit +.Xr aio_fsync 2 +and +.Xr fsync 2 . +.Pp +.It Dv CAP_FTRUNCATE +Permit +.Xr ftruncate 2 . +.It Dv CAP_FUTIMES +Permit +.Xr futimes 2 . +.It Dv CAP_GETPEERNAME +Permit +.Xr getpeername 2 . +.It Dv CAP_GETSOCKNAME +Permit +.Xr getsockname 2 . +.It Dv CAP_GETSOCKOPT +Permit +.Xr getsockopt 2 . +.It Dv CAP_IOCTL +Permit +.Xr ioctl 2 . +Be aware that this system call has enormous scope, including potentially +global scope for some objects. +.It Dv CAP_KEVENT +Permit +.Xr kevent 2 ; +.Dv CAP_EVENT +is also required on file descriptors that will be monitored using +.Xr kevent 2 . +.It Dv CAP_LISTEN +Permit +.Xr listen 2 ; +not much use (generally) without +.Dv CAP_BIND . +.It Dv CAP_LOOKUP +Permit the file descriptor to be used as a starting directory for calls such +as +.Xr linkat 2 , +.Xr openat 2 , +and +.Xr unlinkat 2 . +Note that these calls are not available in capability mode as they manipulate +a global name space; see +.Xr cap_enter 2 +for details. +.It Dv CAP_MAC_GET +Permit +.Xr mac_get_fd 2 . +.It Dv CAP_MAC_SET +Permit +.Xr mac_set_fd 2 . +.It Dv CAP_MMAP +Permit +.Xr mmap 2 ; +specific invocations may also require +.Dv CAP_READ +or +.Dv CAP_WRITE . +.Pp +.It Dv CAP_PDGETPID +Permit +.Xr pdgetpid 2 . +.It Dv CAP_PDKILL +Permit +.Xr pdkill 2 . +.It Dv CAP_PDWAIT +Permit +.Xr pdwait 2 . +.It Dv CAP_PEELOFF +Permit +.Xr sctp_peeloff 2 . +.It Dv CAP_READ +Allow +.Xr aio_read 2 , +.Xr pread 2 , +.Xr read 2 , +.Xr recv 2 , +.Xr recvfrom 2 , +.Xr recvmsg 2 , +and related system calls. +.Pp +For files and other seekable objects, +.Dv CAP_SEEK +may also be required. +.It Dv CAP_REVOKE +Permit +.Xr frevoke 2 +in certain ABI compatibility modes that support this system call. +.It Dv CAP_SEEK +Permit operations that seek on the file descriptor, such as +.Xr lseek 2 , +but also required for I/O system calls that modify the file offset, such as +.Xr read 2 +and +.Xr write 2 . +.It Dv CAP_SEM_GETVALUE +Permit +.Xr sem_getvalue 3 . +.It Dv CAP_SEM_POST +Permit +.Xr sem_post 3 . +.It Dv CAP_SEM_WAIT +Permit +.Xr sem_wait 3 +and +.Xr sem_trywait 3 . +.It Dv CAP_SETSOCKOPT +Permit +.Xr setsockopt 2 ; +this controls various aspects of socket behavior and may affect binding, +connecting, and other behaviors with global scope. +.It Dv CAP_SHUTDOWN +Permit explicit +.Xr shutdown 2 ; +closing the socket will also generally shut down any connections on it. +.It Dv CAP_TTYHOOK +Allow configuration of TTY hooks, such as +.Xr snp 4 , +on the file descriptor. +.It Dv CAP_WRITE +Allow +.Xr aio_write 2 , +.Xr pwrite 2 , +.Xr send 2 , +.Xr sendmsg 2 , +.Xr sendto 2 , +.Xr write 2 , +and related system calls. +.Pp +For files and other seekable objects, +.Dv CAP_SEEK +may also be required. +.Pp +For +.Xr sendto 2 +with a non-NULL connection address, +.Dv CAP_CONNECT +is also required. +.El +.Sh CAVEAT +The +.Fn cap_new +system call and the capabilities it creates may be used to assign +fine-grained rights to sandboxed processes running in capability mode. +However, the semantics of objects accessed via file descriptors are complex, +so caution should be exercised in passing object capabilities into sandboxes. +.Sh RETURN VALUES +If successful, +.Fn cap_new +returns a non-negative integer, termed a file descriptor. +It returns -1 on failure, and sets +.Va errno +to indicate the error. +.Pp +.Rv -std cap_getrights +.Sh ERRORS +.Fn cap_new +may return the following errors: +.Bl -tag -width Er +.It Bq Er EBADF +The +.Fa fd +argument is not a valid active descriptor. +.It Bq Er EINVAL +An invalid right has been requested in +.Fa rights . +.It Bq Er EMFILE +The process has already reached its limit for open file descriptors. +.It Bq Er ENFILE +The system file table is full. +.It Bq Er EPERM +.Fa rights +contains requested rights not present in the current rights mask associated +with the capability referenced by +.Fa fd , +if any. +.El +.Pp +.Fn cap_getrights +may return the following errors: +.Bl -tag -width Er +.It Bq Er EBADF +The +.Fa fd +argument is not a valid active descriptor. +.It Bq Er EINVAL +The +.Fa fd +argument is not a capability. +.El +.Sh SEE ALSO +.Xr accept 2 , +.Xr acl_delete_fd_np 2 , +.Xr acl_get_fd 2 , +.Xr acl_get_fd_np 2 , +.Xr acl_set_fd_np 2 , +.Xr aio_read 2 , +.Xr aio_fsync 2 , +.Xr aio_write 2 , +.Xr bind 2 , +.Xr cap_enter 2 , +.Xr connect 2 , +.Xr dup 2 , +.Xr dup2 2 , +.Xr extattr_delete_fd 2 , +.Xr extattr_get_fd 2 , +.Xr extattr_list_fd 2 , +.Xr extattr_set_fd 2 , +.Xr fchflags 2 , +.Xr fchown 2 , +.Xr fcntl 2 , +.Xr fexecve 2 , +.Xr fhopen 2 , +.Xr flock 2 , +.Xr fpathconf 2 , +.Xr fstat 2 , +.Xr fstatfs 2 , +.Xr fsync 2 , +.Xr ftruncate 2 , +.Xr futimes 2 , +.Xr getpeername 2 , +.Xr getsockname 2 , +.Xr getsockopt 2 , +.Xr ioctl 2 , +.Xr kevent 2 , +.Xr kqueue 2 , +.Xr linkat 2 , +.Xr listen 2 , +.Xr mac_get_fd 2 , +.Xr mac_set_fd 2 , +.Xr mmap 2 , +.Xr mq_open 2 , +.Xr open 2 , +.Xr openat 2 , +.Xr pdgetpid 2 , +.Xr pdkill 2 , +.Xr pdwait 2 , +.Xr pipe 2 , +.Xr poll 2 , +.Xr pread 2 , +.Xr pwrite 2 , +.Xr read 2 , +.Xr recv 2 , +.Xr recvfrom 2 , +.Xr recvmsg 2 , +.Xr sctp_peeloff 2 , +.Xr select 2 , +.Xr send 2 , +.Xr sendmsg 2 , +.Xr sendto 2 , +.Xr setsockopt 2 , +.Xr shm_open 2 , +.Xr shutdown 2 , +.Xr socket 2 , +.Xr socketpair 2 , +.Xr unlinkat 2 , +.Xr write 2 , +.Xr cap_limitfd 3 , +.Xr libcapsicum 3 , +.Xr sem_getvalue 3 , +.Xr sem_post 3 , +.Xr sem_trywait 3 , +.Xr sem_wait 3 , +.Xr snp 4 +.Sh HISTORY +Support for capabilities and capabilities mode was developed as part of the +.Tn TrustedBSD +Project. +.Sh BUGS +This man page should list the set of permitted system calls more specifically +for each capability right. +.Pp +Capability rights sometimes have unclear indirect impacts, which should be +documented, or at least hinted at. +.Sh AUTHORS +These functions and the capability facility were created by +.An "Robert N. M. Watson" +at the University of Cambridge Computer Laboratory with support from a grant +from Google, Inc. From owner-svn-src-head@FreeBSD.ORG Wed Jul 20 15:18:25 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1152B1065675; Wed, 20 Jul 2011 15:18:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 014718FC28; Wed, 20 Jul 2011 15:18:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6KFIOsc021827; Wed, 20 Jul 2011 15:18:24 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6KFIOBS021825; Wed, 20 Jul 2011 15:18:24 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201107201518.p6KFIOBS021825@svn.freebsd.org> From: John Baldwin Date: Wed, 20 Jul 2011 15:18:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224228 - head/sys/boot/forth X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jul 2011 15:18:25 -0000 Author: jhb Date: Wed Jul 20 15:18:24 2011 New Revision: 224228 URL: http://svn.freebsd.org/changeset/base/224228 Log: Note that the "kernel" variable in loader.conf is the name of a directory containing a kernel under /boot and that it's default value is "kernel" not "/boot/kernel/kernel". PR: docs/158992 Reported by: Wayne Mitchell wayne.mitchell.iz at gmail Approved by: re (kib) MFC after: 1 week Modified: head/sys/boot/forth/loader.conf.5 Modified: head/sys/boot/forth/loader.conf.5 ============================================================================== --- head/sys/boot/forth/loader.conf.5 Wed Jul 20 13:29:39 2011 (r224227) +++ head/sys/boot/forth/loader.conf.5 Wed Jul 20 15:18:24 2011 (r224228) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd January 16, 2008 +.Dd July 20, 2011 .Dt LOADER.CONF 5 .Os .Sh NAME @@ -107,6 +107,9 @@ present file. Name of the kernel to be loaded. If no kernel name is set, no additional modules will be loaded. +The name must be a subdirectory of +.Pa /boot +that contains a kernel. .It Ar kernel_options Flags to be passed to the kernel. .It Ar password @@ -190,7 +193,7 @@ replacing it with .Dq spinning character (useful for embedded products and such). .It Va kernel -.Pq Dq Pa /boot/kernel/kernel +.Pq Dq kernel .It Va loader_conf_files .Pq Dq Pa /boot/loader.conf /boot/loader.conf.local .It Va splash_bmp_load From owner-svn-src-head@FreeBSD.ORG Wed Jul 20 15:32:33 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55FDD1065670; Wed, 20 Jul 2011 15:32:33 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id 7E1C28FC14; Wed, 20 Jul 2011 15:32:32 +0000 (UTC) Received: from c122-106-165-191.carlnfd1.nsw.optusnet.com.au (c122-106-165-191.carlnfd1.nsw.optusnet.com.au [122.106.165.191]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p6KFWKAL030693 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 21 Jul 2011 01:32:21 +1000 Date: Thu, 21 Jul 2011 01:32:20 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Hans Petter Selasky In-Reply-To: <201107201249.39550.hselasky@c2i.net> Message-ID: <20110720221325.E1436@besplex.bde.org> References: <201107181610.49443.hselasky@c2i.net> <4E26AFF8.8080107@FreeBSD.org> <201107201249.39550.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: "svn-src-head@FreeBSD.org" , "svn-src-all@FreeBSD.org" , "src-committers@FreeBSD.org" , Andriy Gapon Subject: Re: svn commit: r223989 - head/sys/dev/usb/input X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jul 2011 15:32:33 -0000 On Wed, 20 Jul 2011, Hans Petter Selasky wrote: > On Wednesday 20 July 2011 12:37:44 Andriy Gapon wrote: >>> This special code is a workaround. The problem is that when not polling >>> the key presses will be fed into syscons I think, and not returned via >>> the polling function. That's why there is a timer there to distinguish >>> when polling starts and polling stops. It is not enough just to >>> enable/disable polling around each key-press like currently done. >> >> I must admit that I failed to understand this paragraph, so I think that I >> should shut up until I know the relevant code better. > > Try and see for yourself, maybe you will understand it then? Remove the > kbd_active == 0 branch in the ukbd.c. Then get into the mount-root prompt. > Then start pressing keys. You will see that some keys are captured and some > are not. This is because two clients are listening for keys. The low-level console driver was fundamentally broken by the multiple-console changes in 2001 (and was a little broken before then), except that these changes didn't affect releases until much later (RELENG_4 doesn't have the breakage). Loss of keystrokes at the mountroot prompt is exactly as expected, since there is often an interrupt handler listening for them, and it is exactly as expected that the interrupt handler wins the race to read them some of the time. The proportion of wins depends on the driver, and for some reason the syscons AT keyboard interrupt handler rarely wins so the bug is not so noticeable with it. It is especially noticeable for the sio driver for a technical reason not related to the interrupt handler reason (see below). The low-level console driver should switch to polling mode to read the keystrokes. However, its API is broken as designed, so it can only [tell the driver level to] do this around each poll for a character. Polling involves polling each possible console in turn, so polling mode must be left after unsuccessfully polling for a short time so as to get to the next console. This is now done even if there is only 1 console. Before the multiple-console changes, polling mode was only left after _successfully_ polling for as long as necessary to read a character, so things mostly worked -- the race was only lost if a character arrives in between polls, and you can't type fast enough for the time between polls to be significant compared with the time in polls. The multiple-console changes left the driver interface function cn_getc() unused. cn_getc() switches into polling mode and then polls for as long as necessary to read a character, and of course it doesn't switch out of polling mode after each poll. This doesn't work for multiple consoles, at least if more than 1 console is active, since it doesn't return until one instance of it succeeds. So the polling loop was moved out of the driver layer, even when only 1 console is active. The existing interface cn_checkc() was used to poll each console in turn. This interface was always broken as designed, but it was used only during panic() to check for a key to abort the dump and the timeout, so the brokenness was little noticed (and if panic() weren't broken too, it would stop all interrupt handlers and other listeners). cn_getc() should have been used to keep the case of 1 active console working until the API is fixed. Next, starting in 2006 the API was changed to be even more broken than as designed, by removing the working cn_getc() interface from it but keeping the non-working cn_checkc() interface, and obfuscating this change by renaming cn_checkc to cn_getc. Driver functions were also renamed, so now the only instances of the *checkc in drivers are in dcons. The higher-level functions cngetc() and cncheckc() still have their old names, so they no longer match the lower-level function names. A non-broken API needs cn_open() and cn_close() functions which would normally switch the driver in an out of polling mode. Given these interfaces easy to fix the per-character poll to work as well as before the multiple console changes, including for multiple active consoles. Just call cn_open() and cn_close() on every active console around the whole polling loop. A little more is required to prevent races between characters, and to avoid the races inherent in the cn_checkc() API. For multi-char input like that at the mountroot prompt, calling cn_open() and cn_close() around the loop in gets(9) is adequate. The functions should be almost no-ops when called nested for things like this. BTW, gets(9) is bogusly named. It is not harmful like gets(3), since it takes a buffer size arg. It is used approximately once, for mountroot input, so renaming it would be easy. Perhaps it should be named cn_gets() and be implemented closer to the console driver, or be implemented closer to printf() (it is now in libkern). For debugger entry and panics, the whole operation should be wrapped by cn_open()/cn_close(). This covers most cases. Some console drivers now sort of work in debugger mode by abusing the kdb_active variable, or because debugger entry stops interrupts and other CPUs. I started fixing this in FreeBSD in 2000 (I got yokota to do most of the work, especially in syscons). There was a cn_dbctl() interface which was intended to be used like ioctl() (it allows any number of sub-functions) but was only used for operations like open() and close(). This was called on debugger entry and exit to inform console drivers that the should switch to polling mode for things like keyboards and do anything else necessary to run in debugger mode. syscons, but no other driver, used this, mainly to avoid hacking on the kdb_active flag. There should be significant differences, but were only small ones in practice, between being in debugger mode and being in polling mode. For example, entering console i/o mode for syscons should involve switching the video mode and perhaps the frame buffer to a special one, in case the current one is unusable for some reason (it might be controlled by X, or in the middle of an initialization, or you might just want to avoid scribbling on its frame buffer). Thus, entering console i/o mode might be an extemely heavyweight operation. You don't want to do it on every entry to debugger mode. Even if the switch is very fast, it would make the screen flicker to switch the frame buffer on every entry to the debugger for things like tracing (but not displaying) every instruction when single stepping using 'n' in ddb. I missed the need for the cn_open() and cn_close() functions when I added cn_dbctl(). cn_dbctl() sounds debugger-specific and was intended to be so. I had forgotten that it was based on the console driver in my x86 debugger which was written and used mainly between just before FreeBSD existed. The debugger has functions for open(), close(), input(), output() and ioctl(). It supports multiple devices. The input() function is like cn_checkc() was and depends on the device being open to avoid interference. I/o on every device can be turned on and off independently for each device and direction once the devices are open. Debugger entry opens all available devices and debugger exit closes all open devices, but only if the entry is deep enough to need to do i/o (that's if there is something to display or input needs to be waited for). Supported devices are PC VGA screens in simple modes, PC AT keyboards, various UARTs and a memory output device. Open/close of a VGA device involved switching its frame buffer. Open/close of UARTs involved switching their complete h/w state (possible since this is small and registers are almost read/write). This seemed more than needed for FreeBSD, so the only thing I copied from it into FreeBSD was the state switch for UARTs. This turned into a switch on every i/o call instead of a switch in open/close. It is difficult to do device state switches reentrantly, especially on every i/o call, but they do work almost reentrantly for UARTs in sio (much more so than debugger entry, using the stack for the state, etc.). For more heavyweight switches like those for frame buffers, it is obvious that switching on every i/o call is no good, since at best the screen will flicker on every poll, and you can't stack many frame buffers in an 8K kernel stack... The cn_dbctl() API was only used by syscons, and was removed in 2006, leaving the parts of syscons that used it more broken than before it existed :-(. (Some of these parts hacked on [k]db_active, but checks of that weren't restored. The checks of the corresponding `debugger' variable weren't even removed, but since `debugger' was only changed from 0 to 1 in in removed code, the checks have no effect.) sio used to work better at the mountroot prompt for another reason: unlike for keyboards, it is common to have a dedicated serial console. Then interrupts don't need to be used, so the interrupt handler is not almost guaranteed to eat the input. Originally, interrupts were only enabled on sio serial consoles when the console was also used as an open tty. However, for serial consoles to detect changes that map to debugger entries, it is necessary to always enable interrupts on serial console devices. It is then impossible for the interrupt handler to not see input unrelated to debugger entry, and difficult for it to buffer the input where the console driver can see it. This change was made in 2001 (only if a debugger and entries to it from sio are enabled). The state switch on every in sio i/o causes additional problems with the excessive polling for multiple consoles. Although the state switch is fairly reentrant and attempts to avoid null changes to the hardware, some devices don't like it being done at a high rate. Sometimes (especially when it is actually needed and drivers that don't do it would just hang; e.g., if the current state is 9600 bps but the console state is 115200 bps); the state switch can't be null (and in the speed change example, is certain to clobber any i/o in progress). Then the polling can't work, and excessive polling makes the problem worse. My version of sio uses the following hack so that input at mountroot is possible even with very destructive state switches: % Index: sio.c % =================================================================== % RCS file: /home/ncvs/src/sys/dev/sio/sio.c,v % retrieving revision 1.442 % diff -u -2 -r1.442 sio.c % --- sio.c 25 Jun 2004 10:51:33 -0000 1.442 % +++ sio.c 18 Oct 2010 09:58:33 -0000 % @@ -2881,6 +3370,12 @@ % * them by clearing the MCR_IENABLE bit, since that might cause % * an interrupt by floating the IRQ line. % + * We don't want loopback. % + * XXX we clobber MCR_PRESCALE and MCR_DRS and 2 reserved bits. % */ % outb(iobase + com_mcr, (sp->mcr & MCR_IENABLE) | MCR_DTR | MCR_RTS); % + if (sp->cfcr != CFCR_8BITS || sp->dlbl != dlbl || sp->dlbh != dlbh % + || (sp->mcr & ~(MCR_IENABLE | MCR_DRS | MCR_DTR | MCR_RTS))) % + for (i = 0; i < 100; i++) % + (void)inb(0x84); % } % This adds about 100 uS of delay to the state switch, but only if the state switch is non-null. This results in the device being in the state that is good for debugger i/o much longer that it is in the (different and thus bad) state at the time the call than it otherwise would be, so there is a much larger chance of the i/o's getting through. A delay in each poll can be added unconditionally even if the driver doesn't dream of state switches, to reduce contention with the interrupt handler. sio's mode switch gives smaller but perhaps significant delays in each poll accidentally by doing lots of i/o's to read the current state to see if it needs to be switched, etc. This might reduce the races significantly. The delay of 100 uS is a compromise, bised towards the lowest value that mostly works. I tried silly delays like 1 second. It's painful to type if the rate is limited by a several 1-second delays to a fraction of 1 cps. But if the delay is much shorter than 100 uS, then it's painful to type because most of the input doesn't get through or garbage or extras get through. Bruce From owner-svn-src-head@FreeBSD.ORG Wed Jul 20 16:53:32 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E952C1065670; Wed, 20 Jul 2011 16:53:32 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF0B08FC08; Wed, 20 Jul 2011 16:53:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6KGrW2w024696; Wed, 20 Jul 2011 16:53:32 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6KGrWN0024692; Wed, 20 Jul 2011 16:53:32 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201107201653.p6KGrWN0024692@svn.freebsd.org> From: Xin LI Date: Wed, 20 Jul 2011 16:53:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224231 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jul 2011 16:53:33 -0000 Author: delphij Date: Wed Jul 20 16:53:32 2011 New Revision: 224231 URL: http://svn.freebsd.org/changeset/base/224231 Log: Add a new field to in-core znode, z_rdev, to represent device nodes. PR: kern/159010 Reviewed by: mm@ Approved by: re (kib) MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Wed Jul 20 16:52:51 2011 (r224230) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Wed Jul 20 16:53:32 2011 (r224231) @@ -209,6 +209,7 @@ typedef struct znode { boolean_t z_is_sa; /* are we native sa? */ /* FreeBSD-specific field. */ struct task z_task; + dev_t z_rdev; } znode_t; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Jul 20 16:52:51 2011 (r224230) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Jul 20 16:53:32 2011 (r224231) @@ -2694,7 +2694,7 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, i vap->va_nlink = MIN(links, UINT32_MAX); /* nlink_t limit! */ vap->va_size = zp->z_size; vap->va_fsid = vp->v_mount->mnt_stat.f_fsid.val[0]; -// vap->va_rdev = zfs_cmpldev(pzp->zp_rdev); + vap->va_rdev = zp->z_rdev; vap->va_seq = zp->z_seq; vap->va_flags = 0; /* FreeBSD: Reset chflags(2) flags. */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Wed Jul 20 16:52:51 2011 (r224230) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Wed Jul 20 16:53:32 2011 (r224231) @@ -700,6 +700,16 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_bu case VDIR: zp->z_zn_prefetch = B_TRUE; /* z_prefetch default is enabled */ break; + case VBLK: + case VCHR: + { + uint64_t rdev; + VERIFY(sa_lookup(zp->z_sa_hdl, SA_ZPL_RDEV(zfsvfs), + &rdev, sizeof (rdev)) == 0); + + zp->z_rdev = zfs_cmpldev(rdev); + } + break; case VFIFO: vp->v_op = &zfs_fifoops; break; From owner-svn-src-head@FreeBSD.ORG Wed Jul 20 18:51:18 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED665106566C; Wed, 20 Jul 2011 18:51:18 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD5DC8FC08; Wed, 20 Jul 2011 18:51:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6KIpIp3028157; Wed, 20 Jul 2011 18:51:18 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6KIpIqR028155; Wed, 20 Jul 2011 18:51:18 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201107201851.p6KIpIqR028155@svn.freebsd.org> From: Marius Strobl Date: Wed, 20 Jul 2011 18:51:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224232 - head/sys/sparc64/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jul 2011 18:51:19 -0000 Author: marius Date: Wed Jul 20 18:51:18 2011 New Revision: 224232 URL: http://svn.freebsd.org/changeset/base/224232 Log: Merge from r224217: Bump MAXCPU to 64. Approved by: re (kib) Modified: head/sys/sparc64/include/param.h Modified: head/sys/sparc64/include/param.h ============================================================================== --- head/sys/sparc64/include/param.h Wed Jul 20 16:53:32 2011 (r224231) +++ head/sys/sparc64/include/param.h Wed Jul 20 18:51:18 2011 (r224232) @@ -51,7 +51,7 @@ #if defined(SMP) || defined(KLD_MODULE) #ifndef MAXCPU -#define MAXCPU 16 +#define MAXCPU 64 #endif #else #define MAXCPU 1 From owner-svn-src-head@FreeBSD.ORG Wed Jul 20 21:48:53 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16D06106564A; Wed, 20 Jul 2011 21:48:53 +0000 (UTC) (envelope-from inyaoo@gmail.com) Received: from mail-fx0-f44.google.com (mail-fx0-f44.google.com [209.85.161.44]) by mx1.freebsd.org (Postfix) with ESMTP id 4E1348FC0C; Wed, 20 Jul 2011 21:48:51 +0000 (UTC) Received: by fxe6 with SMTP id 6so1832056fxe.17 for ; Wed, 20 Jul 2011 14:48:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type; bh=1X0rExJEHAXP+Fw3ZzuBAPn7yclJoFfgI43RcXUQ8vE=; b=S3cVZIyh04GJBUkK+kZo1ycGWjKfDUkl8UJnAqcWK0apWOF3W3x7/mcBQ0m/Oxcm4/ EY6+HaXG+m5dd6kkoj64rprMwBUcYUbBchibhZ6cSntjJdw/9ZPQT6PEdKxPjaVBUCrd k6HSuqZShcqBDnaIVw4pGCFe0G4BFD3U9Qckc= Received: by 10.223.21.220 with SMTP id k28mr6996512fab.63.1311198531210; Wed, 20 Jul 2011 14:48:51 -0700 (PDT) Received: from localhost (tor3.anonymizer.ccc.de [80.237.226.73]) by mx.google.com with ESMTPS id a24sm960217fak.12.2011.07.20.14.48.47 (version=SSLv3 cipher=OTHER); Wed, 20 Jul 2011 14:48:48 -0700 (PDT) From: Pan Tsu To: Attilio Rao In-Reply-To: <201107191300.p6JD0UU7073447@svn.freebsd.org> (Attilio Rao's message of "Tue, 19 Jul 2011 13:00:30 +0000 (UTC)") References: <201107191300.p6JD0UU7073447@svn.freebsd.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (berkeley-unix) Date: Thu, 21 Jul 2011 01:48:44 +0400 Message-ID: <86zkk8pqrn.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r224217 - in head/sys: amd64/include ia64/include mips/conf sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jul 2011 21:48:53 -0000 Attilio Rao writes: > Author: attilio > Date: Tue Jul 19 13:00:30 2011 > New Revision: 224217 > URL: http://svn.freebsd.org/changeset/base/224217 > > Log: > Bump MAXCPU for amd64, ia64 and XLP mips appropriately. > From now on, default values for FreeBSD will be 64 maxiumum supported > CPUs on amd64 and ia64 and 128 for XLP. All the other architectures > seem already capped appropriately (with the exception of sparc64 which > needs further support on jalapeno flavour). > > Bump __FreeBSD_version in order to reflect KBI/KPI brekage introduced > during the infrastructure cleanup for supporting MAXCPU > 32. This > covers cpumask_t retiral too. > > The switch is considered completed at the present time, so for whatever > bug you may experience that is reconducible to that area, please report > immediately. > > Requested by: marcel, jchandra > Tested by: pluknet, sbruno > Approved by: re (kib) > > Modified: > head/sys/amd64/include/param.h > head/sys/ia64/include/param.h > head/sys/mips/conf/XLP > head/sys/mips/conf/XLP64 > head/sys/mips/conf/XLPN32 > head/sys/sys/param.h > > Modified: head/sys/amd64/include/param.h > ============================================================================== > --- head/sys/amd64/include/param.h Tue Jul 19 12:41:57 2011 (r224216) > +++ head/sys/amd64/include/param.h Tue Jul 19 13:00:30 2011 (r224217) > @@ -65,7 +65,7 @@ > > #if defined(SMP) || defined(KLD_MODULE) > #ifndef MAXCPU > -#define MAXCPU 32 > +#define MAXCPU 64 > #endif > #else > #define MAXCPU 1 Do you plan to bump MEMSTAT_MAXCPU, too? $ vmstat -z vmstat: memstat_sysctl_uma: Too many CPUs $ vmstat -m vmstat: memstat_sysctl_malloc: Too many CPUs $ sysctl kern. | grep smp.\*cpus kern.smp.maxcpus: 64 kern.smp.cpus: 2 From owner-svn-src-head@FreeBSD.ORG Thu Jul 21 05:36:09 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33F571065670; Thu, 21 Jul 2011 05:36:09 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id ACBAC8FC12; Thu, 21 Jul 2011 05:36:08 +0000 (UTC) Received: by gxk28 with SMTP id 28so558717gxk.13 for ; Wed, 20 Jul 2011 22:36:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=VMd3O00Chmg9v52/k9M+IEzd4yNZNTbTYhuda34M/DY=; b=IehrKKR5pEBjt3/hqKHldj61+LdEuGaxqZbteoQQgFhFFRnokmcAYIhFiXeaakgIZV tfwW97FP49kmXcOdegVtzVxkJnKhziMSwcF1onJ/EOTbWk4lrTx16jDtHywm48Z1z2LI 1asrv1aydjlhEVuuusdz7y+GlGMfEPhMMF/rA= MIME-Version: 1.0 Received: by 10.150.175.15 with SMTP id x15mr150887ybe.442.1311226567922; Wed, 20 Jul 2011 22:36:07 -0700 (PDT) Received: by 10.151.155.15 with HTTP; Wed, 20 Jul 2011 22:36:07 -0700 (PDT) In-Reply-To: <86zkk8pqrn.fsf@gmail.com> References: <201107191300.p6JD0UU7073447@svn.freebsd.org> <86zkk8pqrn.fsf@gmail.com> Date: Thu, 21 Jul 2011 09:36:07 +0400 Message-ID: From: Sergey Kandaurov To: Pan Tsu Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Attilio Rao , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r224217 - in head/sys: amd64/include ia64/include mips/conf sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jul 2011 05:36:09 -0000 On 21 July 2011 01:48, Pan Tsu wrote: > Attilio Rao writes: > >> Author: attilio >> Date: Tue Jul 19 13:00:30 2011 >> New Revision: 224217 >> URL: http://svn.freebsd.org/changeset/base/224217 >> >> Log: >> =A0 Bump MAXCPU for amd64, ia64 and XLP mips appropriately. >> =A0 From now on, default values for FreeBSD will be 64 maxiumum supporte= d >> =A0 CPUs on amd64 and ia64 and 128 for XLP. All the other architectures >> =A0 seem already capped appropriately (with the exception of sparc64 whi= ch >> =A0 needs further support on jalapeno flavour). >> >> =A0 Bump __FreeBSD_version in order to reflect KBI/KPI brekage introduce= d >> =A0 during the infrastructure cleanup for supporting MAXCPU > 32. This >> =A0 covers cpumask_t retiral too. >> >> =A0 The switch is considered completed at the present time, so for whate= ver >> =A0 bug you may experience that is reconducible to that area, please rep= ort >> =A0 immediately. >> >> =A0 Requested by: =A0 =A0 =A0 marcel, jchandra >> =A0 Tested by: =A0pluknet, sbruno >> =A0 Approved by: =A0 =A0 =A0 =A0re (kib) >> >> Modified: >> =A0 head/sys/amd64/include/param.h >> =A0 head/sys/ia64/include/param.h >> =A0 head/sys/mips/conf/XLP >> =A0 head/sys/mips/conf/XLP64 >> =A0 head/sys/mips/conf/XLPN32 >> =A0 head/sys/sys/param.h >> >> Modified: head/sys/amd64/include/param.h >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/amd64/include/param.h =A0 =A0Tue Jul 19 12:41:57 2011 =A0 = =A0 =A0 =A0(r224216) >> +++ head/sys/amd64/include/param.h =A0 =A0Tue Jul 19 13:00:30 2011 =A0 = =A0 =A0 =A0(r224217) >> @@ -65,7 +65,7 @@ >> >> =A0#if defined(SMP) || defined(KLD_MODULE) >> =A0#ifndef MAXCPU >> -#define MAXCPU =A0 =A0 =A0 =A0 =A0 =A0 =A0 32 >> +#define MAXCPU =A0 =A0 =A0 =A0 =A0 =A0 =A0 64 >> =A0#endif >> =A0#else >> =A0#define MAXCPU =A0 =A0 =A0 =A0 =A0 =A0 =A0 1 > > Do you plan to bump MEMSTAT_MAXCPU, too? > > =A0$ vmstat -z > =A0vmstat: memstat_sysctl_uma: Too many CPUs > =A0$ vmstat -m > =A0vmstat: memstat_sysctl_malloc: Too many CPUs > This is a known pending issue. MAXCPU is used in libmemstat for internal needs only. We must get rid of this. libmemstat should get the cpu available information at runtime and use it to prepare the structures. libmemstat should not depend on MAXCPU at all. --=20 wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Thu Jul 21 06:55:43 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFAEA106566C; Thu, 21 Jul 2011 06:55:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F0518FC0C; Thu, 21 Jul 2011 06:55:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6L6thxU049579; Thu, 21 Jul 2011 06:55:43 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6L6thmk049576; Thu, 21 Jul 2011 06:55:43 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201107210655.p6L6thmk049576@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 21 Jul 2011 06:55:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224239 - in head/sys/dev/usb: . serial X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jul 2011 06:55:43 -0000 Author: hselasky Date: Thu Jul 21 06:55:43 2011 New Revision: 224239 URL: http://svn.freebsd.org/changeset/base/224239 Log: Add new USB ID to u3g driver. Approved by: re (kib) Submitted by: Nick Hibma MFC after: 3 days Modified: head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/usbdevs Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Thu Jul 21 00:37:32 2011 (r224238) +++ head/sys/dev/usb/serial/u3g.c Thu Jul 21 06:55:43 2011 (r224239) @@ -293,6 +293,7 @@ static const STRUCT_USB_HOST_ID u3g_devs U3G_DEV(LONGCHEER, WM66, U3GINIT_HUAWEI), U3G_DEV(LONGCHEER, DISK, U3GINIT_TCT), U3G_DEV(LONGCHEER, W14, 0), + U3G_DEV(LONGCHEER, XSSTICK, 0), U3G_DEV(MERLIN, V620, 0), U3G_DEV(NEOTEL, PRIME, 0), U3G_DEV(NOVATEL, E725, 0), Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Thu Jul 21 00:37:32 2011 (r224238) +++ head/sys/dev/usb/usbdevs Thu Jul 21 06:55:43 2011 (r224239) @@ -2110,6 +2110,7 @@ product LOGITEC RT2870_3 0x0164 RT2870 product LONGCHEER WM66 0x6061 Longcheer WM66 HSDPA product LONGCHEER W14 0x9603 Mobilcom W14 product LONGCHEER DISK 0xf000 Driver disk +product LONGCHEER XSSTICK 0x9605 4G Systems XSStick P14 /* Lucent products */ From owner-svn-src-head@FreeBSD.ORG Thu Jul 21 08:31:55 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A402F106566C; Thu, 21 Jul 2011 08:31:55 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 93E4F8FC22; Thu, 21 Jul 2011 08:31:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6L8VtII052587; Thu, 21 Jul 2011 08:31:55 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6L8VtHw052585; Thu, 21 Jul 2011 08:31:55 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201107210831.p6L8VtHw052585@svn.freebsd.org> From: Adrian Chadd Date: Thu, 21 Jul 2011 08:31:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224242 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jul 2011 08:31:55 -0000 Author: adrian Date: Thu Jul 21 08:31:55 2011 New Revision: 224242 URL: http://svn.freebsd.org/changeset/base/224242 Log: This re-enables HT40 channels for use when DFS is enabled. These should be disabled for the AR5416 in hostap/mesh/ibss mode, as the AR5416 doesn't have support for radar detection on the ext channel of a HT40 setup. Later chips do. Approved by: re (kib) Modified: head/sys/dev/ath/ath_hal/ah_regdomain.c Modified: head/sys/dev/ath/ath_hal/ah_regdomain.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah_regdomain.c Thu Jul 21 07:08:39 2011 (r224241) +++ head/sys/dev/ath/ath_hal/ah_regdomain.c Thu Jul 21 08:31:55 2011 (r224242) @@ -526,6 +526,7 @@ getchannels(struct ath_hal *ah, "skip ecm channel\n"); continue; } +#if 0 if ((fband->useDfs & dfsMask) && (cm->flags & IEEE80211_CHAN_HT40)) { /* NB: DFS and HT40 don't mix */ @@ -533,6 +534,7 @@ getchannels(struct ath_hal *ah, "skip HT40 chan, DFS required\n"); continue; } +#endif /* * Make sure that channel separation * meets the requirement. From owner-svn-src-head@FreeBSD.ORG Thu Jul 21 08:35:10 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9723106566B; Thu, 21 Jul 2011 08:35:10 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 97DD48FC16; Thu, 21 Jul 2011 08:35:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6L8ZAC2052743; Thu, 21 Jul 2011 08:35:10 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6L8ZAha052736; Thu, 21 Jul 2011 08:35:10 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201107210835.p6L8ZAha052736@svn.freebsd.org> From: Adrian Chadd Date: Thu, 21 Jul 2011 08:35:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224243 - in head/sys/dev/ath/ath_hal: ar5416 ar9001 ar9002 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jul 2011 08:35:10 -0000 Author: adrian Date: Thu Jul 21 08:35:10 2011 New Revision: 224243 URL: http://svn.freebsd.org/changeset/base/224243 Log: Break out the PLL setup into (mostly) per-chip methods, rather than polluting the AR5416 code with later chipset support. Note: ar9280InitPLL() supports Merlin (AR9280) and later (AR9285, AR9287.) Submitted by: ssgriffonuser@gmail.com Approved by: re (kib) Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9280.h head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Thu Jul 21 08:31:55 2011 (r224242) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Thu Jul 21 08:35:10 2011 (r224243) @@ -1423,60 +1423,20 @@ ar5416UpdateChainMasks(struct ath_hal *a void ar5416InitPLL(struct ath_hal *ah, const struct ieee80211_channel *chan) { - uint32_t pll; - - if (AR_SREV_MERLIN_20(ah) && - chan != AH_NULL && IEEE80211_IS_CHAN_5GHZ(chan)) { - /* - * PLL WAR for Merlin 2.0/2.1 - * When doing fast clock, set PLL to 0x142c - * Else, set PLL to 0x2850 to prevent reset-to-reset variation - */ - pll = IS_5GHZ_FAST_CLOCK_EN(ah, chan) ? 0x142c : 0x2850; - } else if (AR_SREV_MERLIN_10_OR_LATER(ah)) { - pll = SM(0x5, AR_RTC_SOWL_PLL_REFDIV); - if (chan != AH_NULL) { - if (IEEE80211_IS_CHAN_HALF(chan)) - pll |= SM(0x1, AR_RTC_SOWL_PLL_CLKSEL); - else if (IEEE80211_IS_CHAN_QUARTER(chan)) - pll |= SM(0x2, AR_RTC_SOWL_PLL_CLKSEL); - - if (IEEE80211_IS_CHAN_5GHZ(chan)) - pll |= SM(0x28, AR_RTC_SOWL_PLL_DIV); - else - pll |= SM(0x2c, AR_RTC_SOWL_PLL_DIV); - - } else - pll |= SM(0x2c, AR_RTC_SOWL_PLL_DIV); - } else if (AR_SREV_SOWL_10_OR_LATER(ah)) { - pll = SM(0x5, AR_RTC_SOWL_PLL_REFDIV); - if (chan != AH_NULL) { - if (IEEE80211_IS_CHAN_HALF(chan)) - pll |= SM(0x1, AR_RTC_SOWL_PLL_CLKSEL); - else if (IEEE80211_IS_CHAN_QUARTER(chan)) - pll |= SM(0x2, AR_RTC_SOWL_PLL_CLKSEL); - - if (IEEE80211_IS_CHAN_5GHZ(chan)) - pll |= SM(0x50, AR_RTC_SOWL_PLL_DIV); - else - pll |= SM(0x58, AR_RTC_SOWL_PLL_DIV); - } else - pll |= SM(0x58, AR_RTC_SOWL_PLL_DIV); - } else { - pll = AR_RTC_PLL_REFDIV_5 | AR_RTC_PLL_DIV2; - if (chan != AH_NULL) { - if (IEEE80211_IS_CHAN_HALF(chan)) - pll |= SM(0x1, AR_RTC_PLL_CLKSEL); - else if (IEEE80211_IS_CHAN_QUARTER(chan)) - pll |= SM(0x2, AR_RTC_PLL_CLKSEL); - - if (IEEE80211_IS_CHAN_5GHZ(chan)) - pll |= SM(0xa, AR_RTC_PLL_DIV); - else - pll |= SM(0xb, AR_RTC_PLL_DIV); - } else + uint32_t pll = AR_RTC_PLL_REFDIV_5 | AR_RTC_PLL_DIV2; + if (chan != AH_NULL) { + if (IEEE80211_IS_CHAN_HALF(chan)) + pll |= SM(0x1, AR_RTC_PLL_CLKSEL); + else if (IEEE80211_IS_CHAN_QUARTER(chan)) + pll |= SM(0x2, AR_RTC_PLL_CLKSEL); + + if (IEEE80211_IS_CHAN_5GHZ(chan)) + pll |= SM(0xa, AR_RTC_PLL_DIV); + else pll |= SM(0xb, AR_RTC_PLL_DIV); - } + } else + pll |= SM(0xb, AR_RTC_PLL_DIV); + OS_REG_WRITE(ah, AR_RTC_PLL_CONTROL, pll); /* TODO: Modified: head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c Thu Jul 21 08:31:55 2011 (r224242) +++ head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c Thu Jul 21 08:35:10 2011 (r224243) @@ -86,6 +86,28 @@ ar9160AniSetup(struct ath_hal *ah) ar5416AniAttach(ah, &aniparams, &aniparams, AH_TRUE); } +static void +ar9160InitPLL(struct ath_hal *ah, const struct ieee80211_channel *chan) +{ + uint32_t pll = SM(0x5, AR_RTC_SOWL_PLL_REFDIV); + if (chan != AH_NULL) { + if (IEEE80211_IS_CHAN_HALF(chan)) + pll |= SM(0x1, AR_RTC_SOWL_PLL_CLKSEL); + else if (IEEE80211_IS_CHAN_QUARTER(chan)) + pll |= SM(0x2, AR_RTC_SOWL_PLL_CLKSEL); + + if (IEEE80211_IS_CHAN_5GHZ(chan)) + pll |= SM(0x50, AR_RTC_SOWL_PLL_DIV); + else + pll |= SM(0x58, AR_RTC_SOWL_PLL_DIV); + } else + pll |= SM(0x58, AR_RTC_SOWL_PLL_DIV); + + OS_REG_WRITE(ah, AR_RTC_PLL_CONTROL, pll); + OS_DELAY(RTC_PLL_SETTLE_DELAY); + OS_REG_WRITE(ah, AR_RTC_SLEEP_CLK, AR_RTC_SLEEP_DERIVED_CLK); +} + /* * Attach for an AR9160 part. */ @@ -118,6 +140,7 @@ ar9160Attach(uint16_t devid, HAL_SOFTC s /* XXX override with 9160 specific state */ /* override 5416 methods for our needs */ + AH5416(ah)->ah_initPLL = ar9160InitPLL; AH5416(ah)->ah_cal.iqCalData.calData = &ar9160_iq_cal; AH5416(ah)->ah_cal.adcGainCalData.calData = &ar9160_adc_gain_cal; Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280.h Thu Jul 21 08:31:55 2011 (r224242) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280.h Thu Jul 21 08:35:10 2011 (r224243) @@ -59,5 +59,6 @@ struct ath_hal; HAL_BOOL ar9280SetAntennaSwitch(struct ath_hal *, HAL_ANT_SETTING); void ar9280SpurMitigate(struct ath_hal *, const struct ieee80211_channel *); - +void ar9280InitPLL(struct ath_hal *ah, + const struct ieee80211_channel *chan); #endif /* _ATH_AR9280_H_ */ Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Thu Jul 21 08:31:55 2011 (r224242) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Thu Jul 21 08:35:10 2011 (r224243) @@ -99,6 +99,39 @@ ar9280AniSetup(struct ath_hal *ah) ar5416AniAttach(ah, &aniparams, &aniparams, AH_TRUE); } +void +ar9280InitPLL(struct ath_hal *ah, const struct ieee80211_channel *chan) +{ + uint32_t pll = SM(0x5, AR_RTC_SOWL_PLL_REFDIV); + + if (AR_SREV_MERLIN_20(ah) && + chan != AH_NULL && IEEE80211_IS_CHAN_5GHZ(chan)) { + /* + * PLL WAR for Merlin 2.0/2.1 + * When doing fast clock, set PLL to 0x142c + * Else, set PLL to 0x2850 to prevent reset-to-reset variation + */ + pll = IS_5GHZ_FAST_CLOCK_EN(ah, chan) ? 0x142c : 0x2850; + } else if (AR_SREV_MERLIN_10_OR_LATER(ah)) { + pll = SM(0x5, AR_RTC_SOWL_PLL_REFDIV); + if (chan != AH_NULL) { + if (IEEE80211_IS_CHAN_HALF(chan)) + pll |= SM(0x1, AR_RTC_SOWL_PLL_CLKSEL); + else if (IEEE80211_IS_CHAN_QUARTER(chan)) + pll |= SM(0x2, AR_RTC_SOWL_PLL_CLKSEL); + if (IEEE80211_IS_CHAN_5GHZ(chan)) + pll |= SM(0x28, AR_RTC_SOWL_PLL_DIV); + else + pll |= SM(0x2c, AR_RTC_SOWL_PLL_DIV); + } else + pll |= SM(0x2c, AR_RTC_SOWL_PLL_DIV); + } + + OS_REG_WRITE(ah, AR_RTC_PLL_CONTROL, pll); + OS_DELAY(RTC_PLL_SETTLE_DELAY); + OS_REG_WRITE(ah, AR_RTC_SLEEP_CLK, AR_RTC_SLEEP_DERIVED_CLK); +} + /* XXX shouldn't be here! */ #define EEP_MINOR(_ah) \ (AH_PRIVATE(_ah)->ah_eeversion & AR5416_EEP_VER_MINOR_MASK) @@ -138,6 +171,8 @@ ar9280Attach(uint16_t devid, HAL_SOFTC s /* XXX override with 9280 specific state */ /* override 5416 methods for our needs */ + AH5416(ah)->ah_initPLL = ar9280InitPLL; + ah->ah_setAntennaSwitch = ar9280SetAntennaSwitch; ah->ah_configPCIE = ar9280ConfigPCIE; Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Thu Jul 21 08:31:55 2011 (r224242) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Thu Jul 21 08:35:10 2011 (r224243) @@ -136,6 +136,8 @@ ar9285Attach(uint16_t devid, HAL_SOFTC s /* XXX override with 9285 specific state */ /* override 5416 methods for our needs */ + AH5416(ah)->ah_initPLL = ar9280InitPLL; + ah->ah_setAntennaSwitch = ar9285SetAntennaSwitch; ah->ah_configPCIE = ar9285ConfigPCIE; ah->ah_setTxPower = ar9285SetTransmitPower; Modified: head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Thu Jul 21 08:31:55 2011 (r224242) +++ head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Thu Jul 21 08:35:10 2011 (r224243) @@ -137,6 +137,8 @@ ar9287Attach(uint16_t devid, HAL_SOFTC s /* XXX override with 9280 specific state */ /* override 5416 methods for our needs */ + AH5416(ah)->ah_initPLL = ar9280InitPLL; + ah->ah_setAntennaSwitch = ar9287SetAntennaSwitch; ah->ah_configPCIE = ar9287ConfigPCIE; From owner-svn-src-head@FreeBSD.ORG Thu Jul 21 10:14:27 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8AD71065672; Thu, 21 Jul 2011 10:14:27 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4088B8FC08; Thu, 21 Jul 2011 10:14:27 +0000 (UTC) Received: by gxk28 with SMTP id 28so675729gxk.13 for ; Thu, 21 Jul 2011 03:14:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=V1Bl3MGHVNi+lk77JEMgmkXy4BQ1PpCWE6UAaRnxAbQ=; b=KRhFXm79Q1D9mOlsMhfXqW5M/2yWtXZ3ivm7Whq45AN/0dFIpFZ+1/Sryh+Q1D/8yr +42KHIuxfqa+CVkx/pFwEyd9o/bf0yHsVZXSm/Nj30U1yxS3NK2cbZngC7RZHmI/OzxG iUs20CpXjYaTlggbAjXJoUOTGsqiYvvACKXe8= MIME-Version: 1.0 Received: by 10.236.136.106 with SMTP id v70mr68923yhi.406.1311243266663; Thu, 21 Jul 2011 03:14:26 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.236.105.169 with HTTP; Thu, 21 Jul 2011 03:14:26 -0700 (PDT) In-Reply-To: <86zkk8pqrn.fsf@gmail.com> References: <201107191300.p6JD0UU7073447@svn.freebsd.org> <86zkk8pqrn.fsf@gmail.com> Date: Thu, 21 Jul 2011 12:14:26 +0200 X-Google-Sender-Auth: CSODT7iM6Ppcy0p6FjON33lB48M Message-ID: From: Attilio Rao To: Pan Tsu , Sean Bruno Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r224217 - in head/sys: amd64/include ia64/include mips/conf sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jul 2011 10:14:27 -0000 2011/7/20 Pan Tsu : > Attilio Rao writes: > >> Author: attilio >> Date: Tue Jul 19 13:00:30 2011 >> New Revision: 224217 >> URL: http://svn.freebsd.org/changeset/base/224217 >> >> Log: >> =C2=A0 Bump MAXCPU for amd64, ia64 and XLP mips appropriately. >> =C2=A0 From now on, default values for FreeBSD will be 64 maxiumum suppo= rted >> =C2=A0 CPUs on amd64 and ia64 and 128 for XLP. All the other architectur= es >> =C2=A0 seem already capped appropriately (with the exception of sparc64 = which >> =C2=A0 needs further support on jalapeno flavour). >> >> =C2=A0 Bump __FreeBSD_version in order to reflect KBI/KPI brekage introd= uced >> =C2=A0 during the infrastructure cleanup for supporting MAXCPU > 32. Thi= s >> =C2=A0 covers cpumask_t retiral too. >> >> =C2=A0 The switch is considered completed at the present time, so for wh= atever >> =C2=A0 bug you may experience that is reconducible to that area, please = report >> =C2=A0 immediately. >> >> =C2=A0 Requested by: =C2=A0 =C2=A0 =C2=A0 marcel, jchandra >> =C2=A0 Tested by: =C2=A0pluknet, sbruno >> =C2=A0 Approved by: =C2=A0 =C2=A0 =C2=A0 =C2=A0re (kib) >> >> Modified: >> =C2=A0 head/sys/amd64/include/param.h >> =C2=A0 head/sys/ia64/include/param.h >> =C2=A0 head/sys/mips/conf/XLP >> =C2=A0 head/sys/mips/conf/XLP64 >> =C2=A0 head/sys/mips/conf/XLPN32 >> =C2=A0 head/sys/sys/param.h >> >> Modified: head/sys/amd64/include/param.h >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/amd64/include/param.h =C2=A0 =C2=A0Tue Jul 19 12:41:57 2011= =C2=A0 =C2=A0 =C2=A0 =C2=A0(r224216) >> +++ head/sys/amd64/include/param.h =C2=A0 =C2=A0Tue Jul 19 13:00:30 2011= =C2=A0 =C2=A0 =C2=A0 =C2=A0(r224217) >> @@ -65,7 +65,7 @@ >> >> =C2=A0#if defined(SMP) || defined(KLD_MODULE) >> =C2=A0#ifndef MAXCPU >> -#define MAXCPU =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 32 >> +#define MAXCPU =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 64 >> =C2=A0#endif >> =C2=A0#else >> =C2=A0#define MAXCPU =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 1 > > Do you plan to bump MEMSTAT_MAXCPU, too? > > =C2=A0$ vmstat -z > =C2=A0vmstat: memstat_sysctl_uma: Too many CPUs > =C2=A0$ vmstat -m > =C2=A0vmstat: memstat_sysctl_malloc: Too many CPUs > > =C2=A0$ sysctl kern. | grep smp.\*cpus > =C2=A0kern.smp.maxcpus: 64 > =C2=A0kern.smp.cpus: 2 > Jeeeez, we seriously need to fix this getting rid of the static values. Anyway, can you try the following patch?: http://www.freebsd.org/~attilio/memstat_maxcpu.diff It is going to add some memory overhead for i386 case. Thanks, Attilio --=20 Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Thu Jul 21 10:19:10 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE6F5106566B; Thu, 21 Jul 2011 10:19:10 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 4069C8FC19; Thu, 21 Jul 2011 10:19:10 +0000 (UTC) Received: by gwb15 with SMTP id 15so1113696gwb.13 for ; Thu, 21 Jul 2011 03:19:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=GghhhROcn3FBn+2DXEWmsljadTwpyE6p3a33kCuaPW4=; b=MGrKi+//Xs8Au0SbXfzmGMocf+czNvCyHATwGmxV++96iyb4yhKdngfLR4MkItoN+y 6FLOmKX5AwS8MQYGJiOyFl202MmMPdLay1Dt4To3kuAcOis1+15brcaS7dKebPWFzR8m ET9krIjaMbWNMBpwbkpEp0ECo3SxXaVFaf2Go= MIME-Version: 1.0 Received: by 10.150.175.15 with SMTP id x15mr436687ybe.442.1311243549575; Thu, 21 Jul 2011 03:19:09 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.151.155.15 with HTTP; Thu, 21 Jul 2011 03:19:09 -0700 (PDT) In-Reply-To: References: <201107191300.p6JD0UU7073447@svn.freebsd.org> <86zkk8pqrn.fsf@gmail.com> Date: Thu, 21 Jul 2011 14:19:09 +0400 X-Google-Sender-Auth: _E5s_e9LD-Lc8aKAYNt9aA5WEbE Message-ID: From: Sergey Kandaurov To: Attilio Rao Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Sean Bruno , Pan Tsu Subject: Re: svn commit: r224217 - in head/sys: amd64/include ia64/include mips/conf sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jul 2011 10:19:10 -0000 On 21 July 2011 14:14, Attilio Rao wrote: > 2011/7/20 Pan Tsu : >> Attilio Rao writes: >> >>> Author: attilio >>> Date: Tue Jul 19 13:00:30 2011 >>> New Revision: 224217 >>> URL: http://svn.freebsd.org/changeset/base/224217 >>> >>> Log: >>> =A0 Bump MAXCPU for amd64, ia64 and XLP mips appropriately. >>> =A0 From now on, default values for FreeBSD will be 64 maxiumum support= ed >>> =A0 CPUs on amd64 and ia64 and 128 for XLP. All the other architectures >>> =A0 seem already capped appropriately (with the exception of sparc64 wh= ich >>> =A0 needs further support on jalapeno flavour). >>> >>> =A0 Bump __FreeBSD_version in order to reflect KBI/KPI brekage introduc= ed >>> =A0 during the infrastructure cleanup for supporting MAXCPU > 32. This >>> =A0 covers cpumask_t retiral too. >>> >>> =A0 The switch is considered completed at the present time, so for what= ever >>> =A0 bug you may experience that is reconducible to that area, please re= port >>> =A0 immediately. >>> >>> =A0 Requested by: =A0 =A0 =A0 marcel, jchandra >>> =A0 Tested by: =A0pluknet, sbruno >>> =A0 Approved by: =A0 =A0 =A0 =A0re (kib) >>> >>> Modified: >>> =A0 head/sys/amd64/include/param.h >>> =A0 head/sys/ia64/include/param.h >>> =A0 head/sys/mips/conf/XLP >>> =A0 head/sys/mips/conf/XLP64 >>> =A0 head/sys/mips/conf/XLPN32 >>> =A0 head/sys/sys/param.h >>> >>> Modified: head/sys/amd64/include/param.h >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/sys/amd64/include/param.h =A0 =A0Tue Jul 19 12:41:57 2011 =A0 = =A0 =A0 =A0(r224216) >>> +++ head/sys/amd64/include/param.h =A0 =A0Tue Jul 19 13:00:30 2011 =A0 = =A0 =A0 =A0(r224217) >>> @@ -65,7 +65,7 @@ >>> >>> =A0#if defined(SMP) || defined(KLD_MODULE) >>> =A0#ifndef MAXCPU >>> -#define MAXCPU =A0 =A0 =A0 =A0 =A0 =A0 =A0 32 >>> +#define MAXCPU =A0 =A0 =A0 =A0 =A0 =A0 =A0 64 >>> =A0#endif >>> =A0#else >>> =A0#define MAXCPU =A0 =A0 =A0 =A0 =A0 =A0 =A0 1 >> >> Do you plan to bump MEMSTAT_MAXCPU, too? >> >> =A0$ vmstat -z >> =A0vmstat: memstat_sysctl_uma: Too many CPUs >> =A0$ vmstat -m >> =A0vmstat: memstat_sysctl_malloc: Too many CPUs >> >> =A0$ sysctl kern. | grep smp.\*cpus >> =A0kern.smp.maxcpus: 64 >> =A0kern.smp.cpus: 2 >> > > Jeeeez, we seriously need to fix this getting rid of the static values. > > Anyway, can you try the following patch?: > http://www.freebsd.org/~attilio/memstat_maxcpu.diff > > It is going to add some memory overhead for i386 case. > It looks good as a temporal fix. I'm running with this patch for several days (I bumped MEMSTAT_MAXCPU to 128 though). --=20 wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Thu Jul 21 12:37:29 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3730B106566B; Thu, 21 Jul 2011 12:37:29 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-yi0-f54.google.com (mail-yi0-f54.google.com [209.85.218.54]) by mx1.freebsd.org (Postfix) with ESMTP id ACBD78FC13; Thu, 21 Jul 2011 12:37:28 +0000 (UTC) Received: by yic13 with SMTP id 13so727516yic.13 for ; Thu, 21 Jul 2011 05:37:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=snBy+bPpajT9ZEmUJcIUGvj6BLLHor+IyPB/qhZ2zTI=; b=rN/Chg2SEb/1Ro+WMhBEjTJ3i8y0/SScluiACoxkGmWYGUmgXi4EHIpEAuuDhkKs19 Y3VHhsEzTq0UyKE2cnR2JM7IFLcorJAvBzeRtlhVJ4Ih5M6B3uDhTjL5zb8/1+p77ZqB i0V7ud927Hd78vcSf8yCRrwq59aK5XvTpI8YQ= MIME-Version: 1.0 Received: by 10.150.12.9 with SMTP id 9mr611261ybl.328.1311251846707; Thu, 21 Jul 2011 05:37:26 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.151.155.15 with HTTP; Thu, 21 Jul 2011 05:37:26 -0700 (PDT) In-Reply-To: References: <201107191300.p6JD0UU7073447@svn.freebsd.org> <86zkk8pqrn.fsf@gmail.com> Date: Thu, 21 Jul 2011 16:37:26 +0400 X-Google-Sender-Auth: D7lO022Gbk-hUftsMGl-m1g5VEo Message-ID: From: Sergey Kandaurov To: Attilio Rao Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Sean Bruno , Pan Tsu Subject: Re: svn commit: r224217 - in head/sys: amd64/include ia64/include mips/conf sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jul 2011 12:37:29 -0000 On 21 July 2011 14:14, Attilio Rao wrote: > 2011/7/20 Pan Tsu : >> Attilio Rao writes: >> >>> Author: attilio >>> Date: Tue Jul 19 13:00:30 2011 >>> New Revision: 224217 >>> URL: http://svn.freebsd.org/changeset/base/224217 >>> >>> Log: >>> =A0 Bump MAXCPU for amd64, ia64 and XLP mips appropriately. >>> =A0 From now on, default values for FreeBSD will be 64 maxiumum support= ed >>> =A0 CPUs on amd64 and ia64 and 128 for XLP. All the other architectures >>> =A0 seem already capped appropriately (with the exception of sparc64 wh= ich >>> =A0 needs further support on jalapeno flavour). >>> >>> =A0 Bump __FreeBSD_version in order to reflect KBI/KPI brekage introduc= ed >>> =A0 during the infrastructure cleanup for supporting MAXCPU > 32. This >>> =A0 covers cpumask_t retiral too. >>> >>> =A0 The switch is considered completed at the present time, so for what= ever >>> =A0 bug you may experience that is reconducible to that area, please re= port >>> =A0 immediately. >>> >>> =A0 Requested by: =A0 =A0 =A0 marcel, jchandra >>> =A0 Tested by: =A0pluknet, sbruno >>> =A0 Approved by: =A0 =A0 =A0 =A0re (kib) >>> >>> Modified: >>> =A0 head/sys/amd64/include/param.h >>> =A0 head/sys/ia64/include/param.h >>> =A0 head/sys/mips/conf/XLP >>> =A0 head/sys/mips/conf/XLP64 >>> =A0 head/sys/mips/conf/XLPN32 >>> =A0 head/sys/sys/param.h >>> >>> Modified: head/sys/amd64/include/param.h >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/sys/amd64/include/param.h =A0 =A0Tue Jul 19 12:41:57 2011 =A0 = =A0 =A0 =A0(r224216) >>> +++ head/sys/amd64/include/param.h =A0 =A0Tue Jul 19 13:00:30 2011 =A0 = =A0 =A0 =A0(r224217) >>> @@ -65,7 +65,7 @@ >>> >>> =A0#if defined(SMP) || defined(KLD_MODULE) >>> =A0#ifndef MAXCPU >>> -#define MAXCPU =A0 =A0 =A0 =A0 =A0 =A0 =A0 32 >>> +#define MAXCPU =A0 =A0 =A0 =A0 =A0 =A0 =A0 64 >>> =A0#endif >>> =A0#else >>> =A0#define MAXCPU =A0 =A0 =A0 =A0 =A0 =A0 =A0 1 >> >> Do you plan to bump MEMSTAT_MAXCPU, too? >> >> =A0$ vmstat -z >> =A0vmstat: memstat_sysctl_uma: Too many CPUs >> =A0$ vmstat -m >> =A0vmstat: memstat_sysctl_malloc: Too many CPUs >> >> =A0$ sysctl kern. | grep smp.\*cpus >> =A0kern.smp.maxcpus: 64 >> =A0kern.smp.cpus: 2 >> > > Jeeeez, we seriously need to fix this getting rid of the static values. > > Anyway, can you try the following patch?: > http://www.freebsd.org/~attilio/memstat_maxcpu.diff > > It is going to add some memory overhead for i386 case. > Something like this should work (vmstat -z, vmstat -m both work). It gets rid of MEMSTAT_MAXCPU at the expense of malloc() at runtime. http://plukky.net/~pluknet/patches/libmemstat_nomaxcpu.diff Probably it should work with maxid, instead of maxcpu to save some memory. Though, using maxcpu is more safe. --=20 wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Thu Jul 21 14:16:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A05961065680; Thu, 21 Jul 2011 14:16:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8DFD28FC12; Thu, 21 Jul 2011 14:16:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6LEGg2V072636; Thu, 21 Jul 2011 14:16:42 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6LEGgcQ072633; Thu, 21 Jul 2011 14:16:42 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201107211416.p6LEGgcQ072633@svn.freebsd.org> From: Adrian Chadd Date: Thu, 21 Jul 2011 14:16:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224244 - in head/sys/dev/ath/ath_hal: . ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jul 2011 14:16:44 -0000 Author: adrian Date: Thu Jul 21 14:16:42 2011 New Revision: 224244 URL: http://svn.freebsd.org/changeset/base/224244 Log: Modify the radar API a little to be easier to "change" via run-time tools. * introduce pe_enabled, which (will) indicate whether the radar detection stuff is enabled or not. Right now it's incorrectly set, based on something previously written. I'll sort it out later. * Don't set HAL_PHYERR_PARAM_ENABLE in pe_relstep to say whether radar detection is on. * Return whether blockradar, fir128 and enmaxrssi is enabled. * Change some of the phyerr params to be integers rather than HAL_BOOL so they can be set to the NOPARAM value when the setup function is called. This is in line with other radar parameters. * Add new configuration parameters for fir128, blockradar and enmaxrssi, rather than defaulting to off, on and on respectively. Approved by: re (kib) Modified: head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Thu Jul 21 08:35:10 2011 (r224243) +++ head/sys/dev/ath/ath_hal/ah.h Thu Jul 21 14:16:42 2011 (r224244) @@ -718,17 +718,18 @@ typedef struct { u_int32_t pe_relpwr; /* Relative power threshold in 0.5dB steps */ u_int32_t pe_relstep; /* Pulse Relative step threshold in 0.5dB steps */ u_int32_t pe_maxlen; /* Max length of radar sign in 0.8us units */ - HAL_BOOL pe_usefir128; /* Use the average in-band power measured over 128 cycles */ - HAL_BOOL pe_blockradar; /* + int32_t pe_usefir128; /* Use the average in-band power measured over 128 cycles */ + int32_t pe_blockradar; /* * Enable to block radar check if pkt detect is done via OFDM * weak signal detect or pkt is detected immediately after tx * to rx transition */ - HAL_BOOL pe_enmaxrssi; /* + int32_t pe_enmaxrssi; /* * Enable to use the max rssi instead of the last rssi during * fine gain changes for radar detection */ - HAL_BOOL pe_extchannel; /* Enable DFS on ext channel */ + int32_t pe_extchannel; /* Enable DFS on ext channel */ + int32_t pe_enabled; /* Whether radar detection is enabled */ } HAL_PHYERR_PARAM; #define HAL_PHYERR_PARAM_NOVAL 65535 Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Thu Jul 21 08:35:10 2011 (r224243) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Thu Jul 21 14:16:42 2011 (r224244) @@ -617,10 +617,20 @@ ar5416GetDfsThresh(struct ath_hal *ah, H temp = val & AR_PHY_RADAR_1_RELSTEP_CHECK; pe->pe_relstep = MS(val, AR_PHY_RADAR_1_RELSTEP_THRESH); if (temp) - pe->pe_relstep |= HAL_PHYERR_PARAM_ENABLE; + pe->pe_enabled = 1; + else + pe->pe_enabled = 0; + pe->pe_maxlen = MS(val, AR_PHY_RADAR_1_MAXLEN); pe->pe_extchannel = !! (OS_REG_READ(ah, AR_PHY_RADAR_EXT) & AR_PHY_RADAR_EXT_ENA); + + pe->pe_usefir128 = !! (OS_REG_READ(ah, AR_PHY_RADAR_1) & + AR_PHY_RADAR_1_USE_FIR128); + pe->pe_blockradar = !! (OS_REG_READ(ah, AR_PHY_RADAR_1) & + AR_PHY_RADAR_1_BLOCK_CHECK); + pe->pe_enmaxrssi = !! (OS_REG_READ(ah, AR_PHY_RADAR_1) & + AR_PHY_RADAR_1_MAX_RRSSI); } /* @@ -660,8 +670,20 @@ ar5416EnableDfs(struct ath_hal *ah, HAL_ OS_REG_WRITE(ah, AR_PHY_RADAR_0, val | AR_PHY_RADAR_0_ENA); - val = OS_REG_READ(ah, AR_PHY_RADAR_1); - val |= (AR_PHY_RADAR_1_MAX_RRSSI | AR_PHY_RADAR_1_BLOCK_CHECK); + if (pe->pe_usefir128 == 0) + OS_REG_SET_BIT(ah, AR_PHY_RADAR_1, AR_PHY_RADAR_1_USE_FIR128); + else if (pe->pe_usefir128 == 1) + OS_REG_CLR_BIT(ah, AR_PHY_RADAR_1, AR_PHY_RADAR_1_USE_FIR128); + + if (pe->pe_enmaxrssi == 0) + OS_REG_SET_BIT(ah, AR_PHY_RADAR_1, AR_PHY_RADAR_1_MAX_RRSSI); + else if (pe->pe_enmaxrssi == 1) + OS_REG_CLR_BIT(ah, AR_PHY_RADAR_1, AR_PHY_RADAR_1_MAX_RRSSI); + + if (pe->pe_blockradar == 0) + OS_REG_SET_BIT(ah, AR_PHY_RADAR_1, AR_PHY_RADAR_1_BLOCK_CHECK); + else if (pe->pe_blockradar == 1) + OS_REG_CLR_BIT(ah, AR_PHY_RADAR_1, AR_PHY_RADAR_1_BLOCK_CHECK); if (pe->pe_maxlen != HAL_PHYERR_PARAM_NOVAL) { val &= ~AR_PHY_RADAR_1_MAXLEN; @@ -674,9 +696,9 @@ ar5416EnableDfs(struct ath_hal *ah, HAL_ * it should check the channel is HT/40 and HAL_CAP_EXT_CHAN_DFS * is available. */ - if (pe->pe_extchannel) + if (pe->pe_extchannel == 1) OS_REG_SET_BIT(ah, AR_PHY_RADAR_EXT, AR_PHY_RADAR_EXT_ENA); - else + else if (pe->pe_extchannel == 0) OS_REG_CLR_BIT(ah, AR_PHY_RADAR_EXT, AR_PHY_RADAR_EXT_ENA); if (pe->pe_relstep != HAL_PHYERR_PARAM_NOVAL) { From owner-svn-src-head@FreeBSD.ORG Thu Jul 21 14:25:13 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D23A106566B; Thu, 21 Jul 2011 14:25:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2409D8FC26; Thu, 21 Jul 2011 14:25:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6LEPDQv073089; Thu, 21 Jul 2011 14:25:13 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6LEPCDb073086; Thu, 21 Jul 2011 14:25:12 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201107211425.p6LEPCDb073086@svn.freebsd.org> From: Adrian Chadd Date: Thu, 21 Jul 2011 14:25:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224245 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jul 2011 14:25:13 -0000 Author: adrian Date: Thu Jul 21 14:25:12 2011 New Revision: 224245 URL: http://svn.freebsd.org/changeset/base/224245 Log: This links in the ath dfs ioctl into the driver and defines the ioctl interface for DFS modules to use. Since there's no open source dfs code yet, this doesn't introduce any operational changes. Approved by: re (kib) Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_athioctl.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Thu Jul 21 14:16:42 2011 (r224244) +++ head/sys/dev/ath/if_ath.c Thu Jul 21 14:25:12 2011 (r224245) @@ -5344,6 +5344,9 @@ ath_ioctl(struct ifnet *ifp, u_long cmd, case SIOCGATHDIAG: error = ath_ioctl_diag(sc, (struct ath_diag *) ifr); break; + case SIOCGATHPHYERR: + error = ath_ioctl_phyerr(sc,(struct ath_diag*) ifr); + break; #endif case SIOCGIFADDR: error = ether_ioctl(ifp, cmd, data); Modified: head/sys/dev/ath/if_athioctl.h ============================================================================== --- head/sys/dev/ath/if_athioctl.h Thu Jul 21 14:16:42 2011 (r224244) +++ head/sys/dev/ath/if_athioctl.h Thu Jul 21 14:25:12 2011 (r224245) @@ -154,6 +154,7 @@ struct ath_diag { }; #define SIOCGATHDIAG _IOWR('i', 138, struct ath_diag) +#define SIOCGATHPHYERR _IOWR('i', 140, struct ath_diag) /* * Radio capture format. @@ -205,4 +206,34 @@ struct ath_tx_radiotap_header { int8_t wt_chan_maxpow; } __packed; +/* + * DFS ioctl commands + */ + +#define DFS_SET_THRESH 2 +#define DFS_GET_THRESH 3 +#define DFS_RADARDETECTS 6 + +/* + * DFS ioctl parameter types + */ +#define DFS_PARAM_FIRPWR 1 +#define DFS_PARAM_RRSSI 2 +#define DFS_PARAM_HEIGHT 3 +#define DFS_PARAM_PRSSI 4 +#define DFS_PARAM_INBAND 5 +#define DFS_PARAM_NOL 6 /* XXX not used in FreeBSD */ +#define DFS_PARAM_RELSTEP_EN 7 +#define DFS_PARAM_RELSTEP 8 +#define DFS_PARAM_RELPWR_EN 9 +#define DFS_PARAM_RELPWR 10 +#define DFS_PARAM_MAXLEN 11 +#define DFS_PARAM_USEFIR128 12 +#define DFS_PARAM_BLOCKRADAR 13 +#define DFS_PARAM_MAXRSSI_EN 14 + +/* FreeBSD-specific start at 32 */ +#define DFS_PARAM_ENABLE 32 +#define DFS_PARAM_EN_EXTCH 33 + #endif /* _DEV_ATH_ATHIOCTL_H */ From owner-svn-src-head@FreeBSD.ORG Thu Jul 21 15:53:41 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A3B31065674; Thu, 21 Jul 2011 15:53:41 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 374448FC1F; Thu, 21 Jul 2011 15:53:41 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 6069046B2D; Thu, 21 Jul 2011 11:53:40 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id E55718A03C; Thu, 21 Jul 2011 11:53:39 -0400 (EDT) From: John Baldwin To: Sergey Kandaurov Date: Thu, 21 Jul 2011 09:20:09 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110617; KDE/4.5.5; amd64; ; ) References: <201107191300.p6JD0UU7073447@svn.freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201107210920.09604.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Thu, 21 Jul 2011 11:53:40 -0400 (EDT) Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, Attilio Rao , Pan Tsu , svn-src-head@freebsd.org, Sean Bruno Subject: Re: svn commit: r224217 - in head/sys: amd64/include ia64/include mips/conf sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jul 2011 15:53:41 -0000 On Thursday, July 21, 2011 8:37:26 am Sergey Kandaurov wrote: > On 21 July 2011 14:14, Attilio Rao wrote: > > 2011/7/20 Pan Tsu : > >> Attilio Rao writes: > >> > >>> Author: attilio > >>> Date: Tue Jul 19 13:00:30 2011 > >>> New Revision: 224217 > >>> URL: http://svn.freebsd.org/changeset/base/224217 > >>> > >>> Log: > >>> Bump MAXCPU for amd64, ia64 and XLP mips appropriately. > >>> From now on, default values for FreeBSD will be 64 maxiumum supported > >>> CPUs on amd64 and ia64 and 128 for XLP. All the other architectures > >>> seem already capped appropriately (with the exception of sparc64 which > >>> needs further support on jalapeno flavour). > >>> > >>> Bump __FreeBSD_version in order to reflect KBI/KPI brekage introduced > >>> during the infrastructure cleanup for supporting MAXCPU > 32. This > >>> covers cpumask_t retiral too. > >>> > >>> The switch is considered completed at the present time, so for whatever > >>> bug you may experience that is reconducible to that area, please report > >>> immediately. > >>> > >>> Requested by: marcel, jchandra > >>> Tested by: pluknet, sbruno > >>> Approved by: re (kib) > >>> > >>> Modified: > >>> head/sys/amd64/include/param.h > >>> head/sys/ia64/include/param.h > >>> head/sys/mips/conf/XLP > >>> head/sys/mips/conf/XLP64 > >>> head/sys/mips/conf/XLPN32 > >>> head/sys/sys/param.h > >>> > >>> Modified: head/sys/amd64/include/param.h > >>> ============================================================================== > >>> --- head/sys/amd64/include/param.h Tue Jul 19 12:41:57 2011 (r224216) > >>> +++ head/sys/amd64/include/param.h Tue Jul 19 13:00:30 2011 (r224217) > >>> @@ -65,7 +65,7 @@ > >>> > >>> #if defined(SMP) || defined(KLD_MODULE) > >>> #ifndef MAXCPU > >>> -#define MAXCPU 32 > >>> +#define MAXCPU 64 > >>> #endif > >>> #else > >>> #define MAXCPU 1 > >> > >> Do you plan to bump MEMSTAT_MAXCPU, too? > >> > >> $ vmstat -z > >> vmstat: memstat_sysctl_uma: Too many CPUs > >> $ vmstat -m > >> vmstat: memstat_sysctl_malloc: Too many CPUs > >> > >> $ sysctl kern. | grep smp.\*cpus > >> kern.smp.maxcpus: 64 > >> kern.smp.cpus: 2 > >> > > > > Jeeeez, we seriously need to fix this getting rid of the static values. > > > > Anyway, can you try the following patch?: > > http://www.freebsd.org/~attilio/memstat_maxcpu.diff > > > > It is going to add some memory overhead for i386 case. > > > > Something like this should work (vmstat -z, vmstat -m both work). > It gets rid of MEMSTAT_MAXCPU at the expense of malloc() at runtime. > http://plukky.net/~pluknet/patches/libmemstat_nomaxcpu.diff > > Probably it should work with maxid, instead of maxcpu to save some memory. > Though, using maxcpu is more safe. Actually, I would prefer that it use mp_maxid as that is the general variable things should use. mp_maxcpus is a concession for the few places that may need to know the MAXCPUS value (e.g. if using libkvm to access a structure in a crashdump or live kernel that has a member array with MAXCPU elements). Code that just wants to allocate memory to hold per-CPU data should use mp_maxid whenever possible. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Thu Jul 21 16:32:14 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35D8F106566C; Thu, 21 Jul 2011 16:32:14 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 247FA8FC0A; Thu, 21 Jul 2011 16:32:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6LGWE2G077362; Thu, 21 Jul 2011 16:32:14 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6LGWEld077358; Thu, 21 Jul 2011 16:32:14 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201107211632.p6LGWEld077358@svn.freebsd.org> From: "George V. Neville-Neil" Date: Thu, 21 Jul 2011 16:32:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224246 - head/lib/libc/amd64/string X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jul 2011 16:32:14 -0000 Author: gnn Date: Thu Jul 21 16:32:13 2011 New Revision: 224246 URL: http://svn.freebsd.org/changeset/base/224246 Log: Make both stpcpy and strcpy be assembly language implementations on amd64. Submitted by: Guillaume Morin (guillaume at morinfr.org) Reviewed by: kib, jhb Approved by: re (bz) MFC after: 1 month Added: head/lib/libc/amd64/string/stpcpy.S - copied, changed from r223967, head/lib/libc/amd64/string/strcpy.S head/lib/libc/amd64/string/strcpy.c (contents, props changed) Deleted: head/lib/libc/amd64/string/strcpy.S Modified: head/lib/libc/amd64/string/Makefile.inc Modified: head/lib/libc/amd64/string/Makefile.inc ============================================================================== --- head/lib/libc/amd64/string/Makefile.inc Thu Jul 21 14:25:12 2011 (r224245) +++ head/lib/libc/amd64/string/Makefile.inc Thu Jul 21 16:32:13 2011 (r224246) @@ -1,4 +1,4 @@ # $FreeBSD$ MDSRCS+= bcmp.S bcopy.S bzero.S memcmp.S memcpy.S memmove.S memset.S \ - strcat.S strcmp.S strcpy.S + strcat.S strcmp.S stpcpy.S strcpy.c Copied and modified: head/lib/libc/amd64/string/stpcpy.S (from r223967, head/lib/libc/amd64/string/strcpy.S) ============================================================================== --- head/lib/libc/amd64/string/strcpy.S Tue Jul 12 20:38:42 2011 (r223967, copy source) +++ head/lib/libc/amd64/string/stpcpy.S Thu Jul 21 16:32:13 2011 (r224246) @@ -1,17 +1,14 @@ /* - * Written by J.T. Conklin + * Adapted by Guillaume Morin from strcpy.S + * written by J.T. Conklin * Public domain. */ #include __FBSDID("$FreeBSD$"); -#if 0 - RCSID("$NetBSD: strcpy.S,v 1.3 2004/07/19 20:04:41 drochner Exp $") -#endif - /* - * This strcpy implementation copies a byte at a time until the + * This stpcpy implementation copies a byte at a time until the * source pointer is aligned to a word boundary, it then copies by * words until it finds a word containing a zero byte, and finally * copies by bytes until the end of the string is reached. @@ -23,10 +20,11 @@ __FBSDID("$FreeBSD$"); * requirements. */ -ENTRY(strcpy) - movq %rdi,%rax - movabsq $0x0101010101010101,%r8 - movabsq $0x8080808080808080,%r9 + .globl stpcpy,__stpcpy +ENTRY(stpcpy) +__stpcpy: + movabsq $0x0101010101010101,%r8 + movabsq $0x8080808080808080,%r9 /* * Align source to a word boundary. @@ -41,6 +39,8 @@ ENTRY(strcpy) incq %rdi testb %dl,%dl jne .Lalign + movq %rdi,%rax + dec %rax ret .p2align 4 @@ -61,54 +61,56 @@ ENTRY(strcpy) */ movb %dl,(%rdi) - incq %rdi testb %dl,%dl /* 1st byte == 0? */ je .Ldone + incq %rdi shrq $8,%rdx movb %dl,(%rdi) - incq %rdi testb %dl,%dl /* 2nd byte == 0? */ je .Ldone + incq %rdi shrq $8,%rdx movb %dl,(%rdi) - incq %rdi testb %dl,%dl /* 3rd byte == 0? */ je .Ldone + incq %rdi shrq $8,%rdx movb %dl,(%rdi) - incq %rdi testb %dl,%dl /* 4th byte == 0? */ je .Ldone + incq %rdi shrq $8,%rdx movb %dl,(%rdi) - incq %rdi testb %dl,%dl /* 5th byte == 0? */ je .Ldone + incq %rdi shrq $8,%rdx movb %dl,(%rdi) - incq %rdi testb %dl,%dl /* 6th byte == 0? */ je .Ldone + incq %rdi shrq $8,%rdx movb %dl,(%rdi) - incq %rdi testb %dl,%dl /* 7th byte == 0? */ je .Ldone + incq %rdi shrq $8,%rdx movb %dl,(%rdi) incq %rdi testb %dl,%dl /* 8th byte == 0? */ jne .Lword_aligned + decq %rdi .Ldone: + movq %rdi,%rax ret -END(strcpy) - +END(stpcpy) + .section .note.GNU-stack,"",%progbits Added: head/lib/libc/amd64/string/strcpy.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/amd64/string/strcpy.c Thu Jul 21 16:32:13 2011 (r224246) @@ -0,0 +1,38 @@ +/* + * Copyright 2011 George V. Neville-Neil. All rights reserved. + * + * The compilation of software known as FreeBSD is distributed under the + * following terms: + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +char *__stpcpy(char * __restrict, const char * __restrict); + +char * +strcpy(char * __restrict to, const char * __restrict from) +{ + __stpcpy(to, from); + return(to); +} From owner-svn-src-head@FreeBSD.ORG Thu Jul 21 19:39:40 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D68DE106564A; Thu, 21 Jul 2011 19:39:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB6A78FC18; Thu, 21 Jul 2011 19:39:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6LJdeEf082971; Thu, 21 Jul 2011 19:39:40 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6LJdesR082969; Thu, 21 Jul 2011 19:39:40 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201107211939.p6LJdesR082969@svn.freebsd.org> From: Alexander Motin Date: Thu, 21 Jul 2011 19:39:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224250 - head/usr.sbin/diskinfo X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jul 2011 19:39:41 -0000 Author: mav Date: Thu Jul 21 19:39:40 2011 New Revision: 224250 URL: http://svn.freebsd.org/changeset/base/224250 Log: Fix `diskinfo -t` operation for disks smaller then 8GB or bigger then 2TB. Tested to work with 1.44MB floppy, 4GB USB stick and 4TB disk array. Approved by: re (kib) Modified: head/usr.sbin/diskinfo/diskinfo.c Modified: head/usr.sbin/diskinfo/diskinfo.c ============================================================================== --- head/usr.sbin/diskinfo/diskinfo.c Thu Jul 21 19:07:38 2011 (r224249) +++ head/usr.sbin/diskinfo/diskinfo.c Thu Jul 21 19:39:40 2011 (r224250) @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -171,7 +172,7 @@ static char sector[65536]; static char mega[1024 * 1024]; static void -rdsect(int fd, u_int blockno, u_int sectorsize) +rdsect(int fd, off_t blockno, u_int sectorsize) { int error; @@ -232,21 +233,27 @@ TR(double count) static void speeddisk(int fd, off_t mediasize, u_int sectorsize) { - int i; - uint b0, b1, sectorcount; + int bulk, i; + off_t b0, b1, sectorcount, step; sectorcount = mediasize / sectorsize; + step = 1ULL << (flsll(sectorcount / (4 * 200)) - 1); + if (step > 16384) + step = 16384; + bulk = mediasize / (1024 * 1024); + if (bulk > 100) + bulk = 100; printf("Seek times:\n"); printf("\tFull stroke:\t"); b0 = 0; - b1 = sectorcount - 1 - 16384; + b1 = sectorcount - step; T0(); for (i = 0; i < 125; i++) { rdsect(fd, b0, sectorsize); - b0 += 16384; + b0 += step; rdsect(fd, b1, sectorsize); - b1 -= 16384; + b1 -= step; } TN(250); @@ -256,9 +263,9 @@ speeddisk(int fd, off_t mediasize, u_int T0(); for (i = 0; i < 125; i++) { rdsect(fd, b0, sectorsize); - b0 += 16384; + b0 += step; rdsect(fd, b1, sectorsize); - b1 += 16384; + b1 += step; } TN(250); printf("\tQuarter stroke:\t"); @@ -267,9 +274,9 @@ speeddisk(int fd, off_t mediasize, u_int T0(); for (i = 0; i < 250; i++) { rdsect(fd, b0, sectorsize); - b0 += 16384; + b0 += step; rdsect(fd, b1, sectorsize); - b1 += 16384; + b1 += step; } TN(500); @@ -278,7 +285,7 @@ speeddisk(int fd, off_t mediasize, u_int T0(); for (i = 0; i < 400; i++) { rdsect(fd, b0, sectorsize); - b0 += 16384; + b0 += step; } TN(400); @@ -287,7 +294,7 @@ speeddisk(int fd, off_t mediasize, u_int T0(); for (i = 0; i < 400; i++) { rdsect(fd, b0, sectorsize); - b0 -= 16384; + b0 -= step; } TN(400); @@ -301,7 +308,7 @@ speeddisk(int fd, off_t mediasize, u_int TN(2048); printf("\tSeq inner:\t"); - b0 = sectorcount - 2048 - 1; + b0 = sectorcount - 2048; T0(); for (i = 0; i < 2048; i++) { rdsect(fd, b0, sectorsize); @@ -313,28 +320,28 @@ speeddisk(int fd, off_t mediasize, u_int printf("\toutside: "); rdsect(fd, 0, sectorsize); T0(); - for (i = 0; i < 100; i++) { + for (i = 0; i < bulk; i++) { rdmega(fd); } - TR(100 * 1024); + TR(bulk * 1024); printf("\tmiddle: "); - b0 = sectorcount / 2; + b0 = sectorcount / 2 - bulk * (1024*1024 / sectorsize) / 2 - 1; rdsect(fd, b0, sectorsize); T0(); - for (i = 0; i < 100; i++) { + for (i = 0; i < bulk; i++) { rdmega(fd); } - TR(100 * 1024); + TR(bulk * 1024); printf("\tinside: "); - b0 = sectorcount - 100 * (1024*1024 / sectorsize) - 1;; + b0 = sectorcount - bulk * (1024*1024 / sectorsize) - 1;; rdsect(fd, b0, sectorsize); T0(); - for (i = 0; i < 100; i++) { + for (i = 0; i < bulk; i++) { rdmega(fd); } - TR(100 * 1024); + TR(bulk * 1024); printf("\n"); return; From owner-svn-src-head@FreeBSD.ORG Thu Jul 21 20:01:52 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF21A106564A; Thu, 21 Jul 2011 20:01:51 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D43E28FC18; Thu, 21 Jul 2011 20:01:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6LK1pNS083686; Thu, 21 Jul 2011 20:01:51 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6LK1pdt083682; Thu, 21 Jul 2011 20:01:51 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201107212001.p6LK1pdt083682@svn.freebsd.org> From: Xin LI Date: Thu, 21 Jul 2011 20:01:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224251 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jul 2011 20:01:52 -0000 Author: delphij Date: Thu Jul 21 20:01:51 2011 New Revision: 224251 URL: http://svn.freebsd.org/changeset/base/224251 Log: A different implementation of r224231 proposed by pjd@, which does not require change in the znode structure. Specifically, it queries rdev from the znode in the same sa_bulk_lookup already done in zfs_getattr(). Submitted by: pjd (with some revisions) Reviewed by: pjd, mm Approved by: re (kib) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Thu Jul 21 19:39:40 2011 (r224250) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Thu Jul 21 20:01:51 2011 (r224251) @@ -209,7 +209,6 @@ typedef struct znode { boolean_t z_is_sa; /* are we native sa? */ /* FreeBSD-specific field. */ struct task z_task; - dev_t z_rdev; } znode_t; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Jul 21 19:39:40 2011 (r224250) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Jul 21 20:01:51 2011 (r224251) @@ -2642,11 +2642,11 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, i uint32_t blksize; u_longlong_t nblocks; uint64_t links; - uint64_t mtime[2], ctime[2], crtime[2]; + uint64_t mtime[2], ctime[2], crtime[2], rdev; xvattr_t *xvap = (xvattr_t *)vap; /* vap may be an xvattr_t * */ xoptattr_t *xoap = NULL; boolean_t skipaclchk = (flags & ATTR_NOACLCHECK) ? B_TRUE : B_FALSE; - sa_bulk_attr_t bulk[3]; + sa_bulk_attr_t bulk[4]; int count = 0; ZFS_ENTER(zfsvfs); @@ -2657,6 +2657,9 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, i SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_MTIME(zfsvfs), NULL, &mtime, 16); SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_CTIME(zfsvfs), NULL, &ctime, 16); SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_CTIME(zfsvfs), NULL, &crtime, 16); + if (vp->v_type == VBLK || vp->v_type == VCHR) + SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_RDEV(zfsvfs), NULL, + &rdev, 8); if ((error = sa_bulk_lookup(zp->z_sa_hdl, bulk, count)) != 0) { ZFS_EXIT(zfsvfs); @@ -2694,7 +2697,8 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, i vap->va_nlink = MIN(links, UINT32_MAX); /* nlink_t limit! */ vap->va_size = zp->z_size; vap->va_fsid = vp->v_mount->mnt_stat.f_fsid.val[0]; - vap->va_rdev = zp->z_rdev; + if (vp->v_type == VBLK || vp->v_type == VCHR) + vap->va_rdev = zfs_cmpldev(rdev); vap->va_seq = zp->z_seq; vap->va_flags = 0; /* FreeBSD: Reset chflags(2) flags. */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Thu Jul 21 19:39:40 2011 (r224250) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Thu Jul 21 20:01:51 2011 (r224251) @@ -700,6 +700,7 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_bu case VDIR: zp->z_zn_prefetch = B_TRUE; /* z_prefetch default is enabled */ break; +#ifdef sun case VBLK: case VCHR: { @@ -707,9 +708,10 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_bu VERIFY(sa_lookup(zp->z_sa_hdl, SA_ZPL_RDEV(zfsvfs), &rdev, sizeof (rdev)) == 0); - zp->z_rdev = zfs_cmpldev(rdev); + vp->v_rdev = zfs_cmpldev(rdev); } break; +#endif /* sun */ case VFIFO: vp->v_op = &zfs_fifoops; break; From owner-svn-src-head@FreeBSD.ORG Thu Jul 21 20:02:23 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 799B0106567F; Thu, 21 Jul 2011 20:02:23 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F4268FC15; Thu, 21 Jul 2011 20:02:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6LK2NeI083741; Thu, 21 Jul 2011 20:02:23 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6LK2Nxp083738; Thu, 21 Jul 2011 20:02:23 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201107212002.p6LK2Nxp083738@svn.freebsd.org> From: Xin LI Date: Thu, 21 Jul 2011 20:02:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224252 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jul 2011 20:02:23 -0000 Author: delphij Date: Thu Jul 21 20:02:22 2011 New Revision: 224252 URL: http://svn.freebsd.org/changeset/base/224252 Log: Bring the code more in-line with OpenSolaris source to ease future port. Reviewed by: pjd, mm Approved by: re (kib) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Jul 21 20:01:51 2011 (r224251) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Jul 21 20:02:22 2011 (r224252) @@ -2688,7 +2688,11 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, i mutex_enter(&zp->z_lock); vap->va_type = IFTOVT(zp->z_mode); vap->va_mode = zp->z_mode & ~S_IFMT; -// vap->va_fsid = zp->z_zfsvfs->z_vfs->vfs_dev; +#ifdef sun + vap->va_fsid = zp->z_zfsvfs->z_vfs->vfs_dev; +#else + vap->va_fsid = vp->v_mount->mnt_stat.f_fsid.val[0]; +#endif vap->va_nodeid = zp->z_id; if ((vp->v_flag & VROOT) && zfs_show_ctldir(zp)) links = zp->z_links + 1; @@ -2696,9 +2700,12 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, i links = zp->z_links; vap->va_nlink = MIN(links, UINT32_MAX); /* nlink_t limit! */ vap->va_size = zp->z_size; - vap->va_fsid = vp->v_mount->mnt_stat.f_fsid.val[0]; +#ifdef sun + vap->va_rdev = vp->v_rdev; +#else if (vp->v_type == VBLK || vp->v_type == VCHR) vap->va_rdev = zfs_cmpldev(rdev); +#endif vap->va_seq = zp->z_seq; vap->va_flags = 0; /* FreeBSD: Reset chflags(2) flags. */ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Thu Jul 21 20:01:51 2011 (r224251) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Thu Jul 21 20:02:22 2011 (r224252) @@ -713,6 +713,10 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_bu break; #endif /* sun */ case VFIFO: +#ifdef sun + case VSOCK: + case VDOOR: +#endif /* sun */ vp->v_op = &zfs_fifoops; break; case VREG: @@ -721,6 +725,14 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_bu vp->v_op = &zfs_shareops; } break; +#ifdef sun + case VLNK: + vn_setops(vp, zfs_symvnodeops); + break; + default: + vn_setops(vp, zfs_evnodeops); + break; +#endif /* sun */ } if (vp->v_type != VFIFO) VN_LOCK_ASHARE(vp); From owner-svn-src-head@FreeBSD.ORG Thu Jul 21 20:06:14 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F717106566C; Thu, 21 Jul 2011 20:06:14 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7EBAD8FC15; Thu, 21 Jul 2011 20:06:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6LK6E5k083884; Thu, 21 Jul 2011 20:06:14 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6LK6Ekq083882; Thu, 21 Jul 2011 20:06:14 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201107212006.p6LK6Ekq083882@svn.freebsd.org> From: "George V. Neville-Neil" Date: Thu, 21 Jul 2011 20:06:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224253 - head/lib/libc/amd64/string X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jul 2011 20:06:14 -0000 Author: gnn Date: Thu Jul 21 20:06:14 2011 New Revision: 224253 URL: http://svn.freebsd.org/changeset/base/224253 Log: Remove incorrect attribution. Approved by: re (kib) Pointed out by: brueffer Pointy hat to: gnn Modified: head/lib/libc/amd64/string/stpcpy.S Modified: head/lib/libc/amd64/string/stpcpy.S ============================================================================== --- head/lib/libc/amd64/string/stpcpy.S Thu Jul 21 20:02:22 2011 (r224252) +++ head/lib/libc/amd64/string/stpcpy.S Thu Jul 21 20:06:14 2011 (r224253) @@ -1,5 +1,5 @@ /* - * Adapted by Guillaume Morin from strcpy.S + * Adapted by Guillaume Morin from strcpy.S * written by J.T. Conklin * Public domain. */ From owner-svn-src-head@FreeBSD.ORG Thu Jul 21 20:43:43 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 716E21065670; Thu, 21 Jul 2011 20:43:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 611018FC16; Thu, 21 Jul 2011 20:43:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6LKhhNB085009; Thu, 21 Jul 2011 20:43:43 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6LKhh14085007; Thu, 21 Jul 2011 20:43:43 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201107212043.p6LKhh14085007@svn.freebsd.org> From: John Baldwin Date: Thu, 21 Jul 2011 20:43:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224254 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jul 2011 20:43:43 -0000 Author: jhb Date: Thu Jul 21 20:43:43 2011 New Revision: 224254 URL: http://svn.freebsd.org/changeset/base/224254 Log: Allow non-fixed endpoints for a producer address range if the length of the resource covers the entire range. Some BIOSes appear to mark endpoints as non-fixed incorrectly (non-fixed endpoints are supposed to be used in _PRS when OSPM is allowed to allocate a certain chunk of address space within a larger range, I don't believe it is supposed to be used for _CRS). Approved by: re (kib) Modified: head/sys/dev/acpica/acpi_pcib_acpi.c Modified: head/sys/dev/acpica/acpi_pcib_acpi.c ============================================================================== --- head/sys/dev/acpica/acpi_pcib_acpi.c Thu Jul 21 20:06:14 2011 (r224253) +++ head/sys/dev/acpica/acpi_pcib_acpi.c Thu Jul 21 20:43:43 2011 (r224254) @@ -207,9 +207,11 @@ acpi_pcib_producer_handler(ACPI_RESOURCE length = res->Data.ExtAddress64.AddressLength; break; } - if (length == 0 || - res->Data.Address.MinAddressFixed != ACPI_ADDRESS_FIXED || - res->Data.Address.MaxAddressFixed != ACPI_ADDRESS_FIXED) + if (length == 0) + break; + if (min + length - 1 != max && + (res->Data.Address.MinAddressFixed != ACPI_ADDRESS_FIXED || + res->Data.Address.MaxAddressFixed != ACPI_ADDRESS_FIXED)) break; flags = 0; switch (res->Data.Address.ResourceType) { From owner-svn-src-head@FreeBSD.ORG Thu Jul 21 21:08:34 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 269B41065670; Thu, 21 Jul 2011 21:08:34 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 165A38FC17; Thu, 21 Jul 2011 21:08:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6LL8XJ1085763; Thu, 21 Jul 2011 21:08:33 GMT (envelope-from jonathan@svn.freebsd.org) Received: (from jonathan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6LL8XLl085761; Thu, 21 Jul 2011 21:08:33 GMT (envelope-from jonathan@svn.freebsd.org) Message-Id: <201107212108.p6LL8XLl085761@svn.freebsd.org> From: Jonathan Anderson Date: Thu, 21 Jul 2011 21:08:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224255 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jul 2011 21:08:34 -0000 Author: jonathan Date: Thu Jul 21 21:08:33 2011 New Revision: 224255 URL: http://svn.freebsd.org/changeset/base/224255 Log: Declare more capability method rights. This is a complete set of rights that can be held in a capability's rights mask. Approved by: re (kib), mentor (rwatson) Sponsored by: Google Inc Modified: head/sys/sys/capability.h Modified: head/sys/sys/capability.h ============================================================================== --- head/sys/sys/capability.h Thu Jul 21 20:43:43 2011 (r224254) +++ head/sys/sys/capability.h Thu Jul 21 21:08:33 2011 (r224255) @@ -53,11 +53,78 @@ * mmap() and aio*() system calls will need special attention as they may * involve reads or writes depending a great deal on context. */ + +/* General file I/O. */ #define CAP_READ 0x0000000000000001ULL /* read/recv */ #define CAP_WRITE 0x0000000000000002ULL /* write/send */ #define CAP_MMAP 0x0000000000000004ULL /* mmap */ #define CAP_MAPEXEC 0x0000000000000008ULL /* mmap(2) as exec */ -#define CAP_MASK_VALID 0x000000000000000fULL +#define CAP_FEXECVE 0x0000000000000010ULL +#define CAP_FSYNC 0x0000000000000020ULL +#define CAP_FTRUNCATE 0x0000000000000040ULL +#define CAP_SEEK 0x0000000000000080ULL + +/* VFS methods. */ +#define CAP_FCHFLAGS 0x0000000000000100ULL +#define CAP_FCHDIR 0x0000000000000200ULL +#define CAP_FCHMOD 0x0000000000000400ULL +#define CAP_FCHOWN 0x0000000000000800ULL +#define CAP_FCNTL 0x0000000000001000ULL +#define CAP_FPATHCONF 0x0000000000002000ULL +#define CAP_FLOCK 0x0000000000004000ULL +#define CAP_FSCK 0x0000000000008000ULL +#define CAP_FSTAT 0x0000000000010000ULL +#define CAP_FSTATFS 0x0000000000020000ULL +#define CAP_FUTIMES 0x0000000000040000ULL + +/* Extended attributes. */ +#define CAP_EXTATTR_DELETE 0x0000000000080000ULL +#define CAP_EXTATTR_GET 0x0000000000100000ULL +#define CAP_EXTATTR_LIST 0x0000000000200000ULL +#define CAP_EXTATTR_SET 0x0000000000400000ULL + +/* Access Control Lists. */ +#define CAP_ACL_CHECK 0x0000000000800000ULL +#define CAP_ACL_DELETE 0x0000000001000000ULL +#define CAP_ACL_GET 0x0000000002000000ULL +#define CAP_ACL_SET 0x0000000004000000ULL + +/* Socket operations. */ +#define CAP_ACCEPT 0x0000000008000000ULL +#define CAP_BIND 0x0000000010000000ULL +#define CAP_CONNECT 0x0000000020000000ULL +#define CAP_GETPEERNAME 0x0000000040000000ULL +#define CAP_GETSOCKNAME 0x0000000080000000ULL +#define CAP_GETSOCKOPT 0x0000000100000000ULL +#define CAP_LISTEN 0x0000000200000000ULL +#define CAP_PEELOFF 0x0000000400000000ULL +#define CAP_SETSOCKOPT 0x0000000800000000ULL +#define CAP_SHUTDOWN 0x0000001000000000ULL + +#define CAP_SOCK_ALL \ + (CAP_ACCEPT | CAP_BIND | CAP_CONNECT \ + | CAP_GETPEERNAME | CAP_GETSOCKNAME | CAP_GETSOCKOPT \ + | CAP_LISTEN | CAP_PEELOFF | CAP_SETSOCKOPT | CAP_SHUTDOWN) + +/* Mandatory Access Control. */ +#define CAP_MAC_GET 0x0000002000000000ULL +#define CAP_MAC_SET 0x0000004000000000ULL + +/* Methods on semaphores. */ +#define CAP_SEM_GETVALUE 0x0000008000000000ULL +#define CAP_SEM_POST 0x0000010000000000ULL +#define CAP_SEM_WAIT 0x0000020000000000ULL + +/* Events - maybe we need a post/get distinction? */ +#define CAP_EVENT 0x0000040000000000ULL +#define CAP_KEVENT 0x0000080000000000ULL + +/* Strange and powerful rights that should not be given lightly. */ +#define CAP_IOCTL 0x0000100000000000ULL +#define CAP_TTYHOOK 0x0000200000000000ULL + +/* The mask of all valid method rights. */ +#define CAP_MASK_VALID 0x00003fffffffffffULL #ifdef _KERNEL From owner-svn-src-head@FreeBSD.ORG Fri Jul 22 09:34:31 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A217F106564A; Fri, 22 Jul 2011 09:34:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 901DE8FC08; Fri, 22 Jul 2011 09:34:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6M9YV9A008336; Fri, 22 Jul 2011 09:34:31 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6M9YVhl008332; Fri, 22 Jul 2011 09:34:31 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201107220934.p6M9YVhl008332@svn.freebsd.org> From: Adrian Chadd Date: Fri, 22 Jul 2011 09:34:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224266 - in head/tools/tools/ath: . athradar X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jul 2011 09:34:31 -0000 Author: adrian Date: Fri Jul 22 09:34:31 2011 New Revision: 224266 URL: http://svn.freebsd.org/changeset/base/224266 Log: Add athradar, an implementation of the radar parameter diagnostic API. This is a reimplementation from scratch. Approved by: re (kib) Added: head/tools/tools/ath/athradar/ head/tools/tools/ath/athradar/Makefile (contents, props changed) head/tools/tools/ath/athradar/athradar.c (contents, props changed) Modified: head/tools/tools/ath/Makefile Modified: head/tools/tools/ath/Makefile ============================================================================== --- head/tools/tools/ath/Makefile Fri Jul 22 06:47:09 2011 (r224265) +++ head/tools/tools/ath/Makefile Fri Jul 22 09:34:31 2011 (r224266) @@ -2,5 +2,6 @@ SUBDIR= arcode athdebug athdecode athkey athpoke athprom athrd athregs SUBDIR+= athstats ath_ee_v14_print ath_prom_read ath_ee_v4k_print +SUBDIR+= athradar .include Added: head/tools/tools/ath/athradar/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/ath/athradar/Makefile Fri Jul 22 09:34:31 2011 (r224266) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +PROG= athradar + +.include <../Makefile.inc> + +SRCS= athradar.c +SRCS+= opt_ah.h +CLEANFILES+= opt_ah.h + +opt_ah.h: + echo "#define AH_DEBUG 1" > opt_ah.h + echo "#define AH_DEBUG_COUNTRY 1" >> opt_ah.h + echo "#define AH_SUPPORT_AR5416 1" >> opt_ah.h + +.include Added: head/tools/tools/ath/athradar/athradar.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/ath/athradar/athradar.c Fri Jul 22 09:34:31 2011 (r224266) @@ -0,0 +1,287 @@ +/* + * Copyright (c) 2011 Adrian Chadd, Xenion Pty Ltd. + * + * 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$ + */ + +#include "diag.h" + +#include "ah.h" +#include "ah_internal.h" + +#ifndef ATH_DEFAULT +#define ATH_DEFAULT "ath0" +#endif + +#include +#include +#include +#include +#include +#include +#include + +struct radarhandler { + struct ath_diag atd; + int s; + struct ifreq ifr; + int ah_devid; +}; + +int +radar_opendev(struct radarhandler *radar, const char *devid) +{ + HAL_REVS revs; + + radar->s = socket(AF_INET, SOCK_DGRAM, 0); + if (radar->s < 0) { + warn("socket"); + return 0; + } + + strncpy(radar->atd.ad_name, devid, sizeof (radar->atd.ad_name)); + + /* Get the hardware revision, just to verify things are working */ + radar->atd.ad_id = HAL_DIAG_REVS; + radar->atd.ad_out_data = (caddr_t) &revs; + radar->atd.ad_out_size = sizeof(revs); + if (ioctl(radar->s, SIOCGATHDIAG, &radar->atd) < 0) { + warn(radar->atd.ad_name); + return 0; + } + radar->ah_devid = revs.ah_devid; + return 1; +} + +void +radar_closedev(struct radarhandler *radar) +{ + close(radar->s); + radar->s = -1; +} + +void +radarset(struct radarhandler *radar, int op, u_int32_t param) +{ + HAL_PHYERR_PARAM pe; + + pe.pe_firpwr = HAL_PHYERR_PARAM_NOVAL; + pe.pe_rrssi = HAL_PHYERR_PARAM_NOVAL; + pe.pe_height = HAL_PHYERR_PARAM_NOVAL; + pe.pe_prssi = HAL_PHYERR_PARAM_NOVAL; + pe.pe_inband = HAL_PHYERR_PARAM_NOVAL; + pe.pe_enabled = HAL_PHYERR_PARAM_NOVAL; + + pe.pe_relpwr = HAL_PHYERR_PARAM_NOVAL; + pe.pe_relstep = HAL_PHYERR_PARAM_NOVAL; + pe.pe_maxlen = HAL_PHYERR_PARAM_NOVAL; + pe.pe_usefir128 = HAL_PHYERR_PARAM_NOVAL; + pe.pe_blockradar = HAL_PHYERR_PARAM_NOVAL; + pe.pe_enmaxrssi = HAL_PHYERR_PARAM_NOVAL; + + pe.pe_extchannel = HAL_PHYERR_PARAM_NOVAL; + + switch (op) { + case DFS_PARAM_ENABLE: + pe.pe_enabled = param; + break; + case DFS_PARAM_FIRPWR: + pe.pe_firpwr = param; + break; + case DFS_PARAM_RRSSI: + pe.pe_rrssi = param; + break; + case DFS_PARAM_HEIGHT: + pe.pe_height = param; + break; + case DFS_PARAM_PRSSI: + pe.pe_prssi = param; + break; + case DFS_PARAM_INBAND: + pe.pe_inband = param; + break; + case DFS_PARAM_RELPWR: + pe.pe_relpwr = param; + break; + case DFS_PARAM_RELSTEP: + pe.pe_relstep = param; + break; + case DFS_PARAM_MAXLEN: + pe.pe_maxlen = param; + break; + case DFS_PARAM_USEFIR128: + pe.pe_usefir128 = param; + break; + case DFS_PARAM_BLOCKRADAR: + pe.pe_blockradar = param; + break; + case DFS_PARAM_MAXRSSI_EN: + pe.pe_enmaxrssi = param; + break; + case DFS_PARAM_EN_EXTCH: + pe.pe_extchannel = param; + break; + } + radar->atd.ad_id = DFS_SET_THRESH | ATH_DIAG_IN; + radar->atd.ad_out_data = NULL; + radar->atd.ad_out_size = 0; + radar->atd.ad_in_data = (caddr_t) &pe; + radar->atd.ad_in_size = sizeof(HAL_PHYERR_PARAM); + if (ioctl(radar->s, SIOCGATHPHYERR, &radar->atd) < 0) + err(1, radar->atd.ad_name); +} + +static void +radar_get(struct radarhandler *radar) +{ + HAL_PHYERR_PARAM pe; + + radar->atd.ad_id = DFS_GET_THRESH | ATH_DIAG_DYN; + memset(&pe, 0, sizeof(pe)); + + radar->atd.ad_in_data = NULL; + radar->atd.ad_in_size = 0; + radar->atd.ad_out_data = (caddr_t) &pe; + radar->atd.ad_out_size = sizeof(pe); + + if (ioctl(radar->s, SIOCGATHPHYERR, &radar->atd) < 0) + err(1, radar->atd.ad_name); + + printf("Radar parameters (raw):\n"); + printf(" pe_enabled: %d\n", pe.pe_enabled); + printf(" pe_firpwr: %d\n", pe.pe_firpwr); + printf(" pe_rrssi: %d\n", pe.pe_rrssi); + printf(" pe_height: %d\n", pe.pe_height); + printf(" pe_prssi: %d\n", pe.pe_prssi); + printf(" pe_inband: %d\n", pe.pe_inband); + printf(" pe_relpwr: %d\n", pe.pe_relpwr); + printf(" pe_relstep: %d\n", pe.pe_relstep); + printf(" pe_maxlen: %d\n", pe.pe_maxlen); + printf(" pe_usefir128: %d\n", pe.pe_usefir128); + printf(" pe_blockradar: %d\n", pe.pe_blockradar); + printf(" pe_enmaxrssi: %d\n", pe.pe_enmaxrssi); + printf(" pe_extchannel: %d\n", pe.pe_extchannel); +} + +static int +radar_set_param(struct radarhandler *radar, const char *param, const char *val) +{ + int v; + + v = atoi(val); + + if (strcmp(param, "firpwr") == 0) { + radarset(radar, DFS_PARAM_FIRPWR, v); + } else if (strcmp(param, "rrssi") == 0) { + radarset(radar, DFS_PARAM_RRSSI, v); + } else if (strcmp(param, "height") == 0) { + radarset(radar, DFS_PARAM_HEIGHT, v); + } else if (strcmp(param, "prssi") == 0) { + radarset(radar, DFS_PARAM_PRSSI, v); + } else if (strcmp(param, "inband") == 0) { + radarset(radar, DFS_PARAM_INBAND, v); + } else if (strcmp(param, "relpwr") == 0) { + radarset(radar, DFS_PARAM_RELPWR, v); + } else if (strcmp(param, "relstep") == 0) { + radarset(radar, DFS_PARAM_RELSTEP, v); + } else if (strcmp(param, "maxlen") == 0) { + radarset(radar, DFS_PARAM_MAXLEN, v); + } else if (strcmp(param, "extchannel") == 0) { + radarset(radar, DFS_PARAM_EN_EXTCH, v); + } else { + return 0; + } + + return 1; +} + +void +usage(const char *progname) +{ + printf("Usage:\n"); + printf("\t%s: [-i ] ()\n", progname); + printf("\t%s: [-h]\n", progname); + printf("\n"); + printf("Valid commands:\n"); + printf("\tget:\t\tGet current radar parameters\n"); + printf("\tset :\t\tSet radar parameter\n"); +} + +int +main(int argc, char *argv[]) +{ + struct radarhandler radar; + const char *devname = ATH_DEFAULT; + const char *progname = argv[0]; + + memset(&radar, 0, sizeof(radar)); + + /* Parse command line options */ + if (argc >= 2 && strcmp(argv[1], "-h") == 0) { + usage(progname); + exit(0); + } + if (argc >= 2 && strcmp(argv[1], "-?") == 0) { + usage(progname); + exit(0); + } + + if (argc >= 2 && strcmp(argv[1], "-i") == 0) { + if (argc == 2) { + usage(progname); + exit(127); + } + devname = argv[2]; + argc -= 2; argv += 2; + } + + /* At this point we require at least one command */ + if (argc == 1) { + usage(progname); + exit(127); + } + + if (radar_opendev(&radar, devname) == 0) + exit(127); + + if (strcasecmp(argv[1], "get") == 0) { + radar_get(&radar); + } else if (strcasecmp(argv[1], "set") == 0) { + if (argc < 4) { + usage(progname); + exit(127); + } + if (radar_set_param(&radar, argv[2], argv[3]) == 0) { + usage(progname); + exit(127); + } + } else { + usage(progname); + exit(127); + } + + /* wrap up */ + radar_closedev(&radar); + exit(0); +} From owner-svn-src-head@FreeBSD.ORG Fri Jul 22 09:39:50 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28BF41065675; Fri, 22 Jul 2011 09:39:50 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E1AA8FC16; Fri, 22 Jul 2011 09:39:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6M9dnrY008519; Fri, 22 Jul 2011 09:39:49 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6M9dnsR008517; Fri, 22 Jul 2011 09:39:49 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201107220939.p6M9dnsR008517@svn.freebsd.org> From: Adrian Chadd Date: Fri, 22 Jul 2011 09:39:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224267 - head/sys/dev/ath/ath_dfs/null X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jul 2011 09:39:50 -0000 Author: adrian Date: Fri Jul 22 09:39:49 2011 New Revision: 224267 URL: http://svn.freebsd.org/changeset/base/224267 Log: Implement a basic radar parameter API in the dfs_null module. Since no actual radar data is ever handled, this won't do anything. It's mostly here as a reference for those who wish to experiment with radar detection. Approved by: re (kib) Modified: head/sys/dev/ath/ath_dfs/null/dfs_null.c Modified: head/sys/dev/ath/ath_dfs/null/dfs_null.c ============================================================================== --- head/sys/dev/ath/ath_dfs/null/dfs_null.c Fri Jul 22 09:34:31 2011 (r224266) +++ head/sys/dev/ath/ath_dfs/null/dfs_null.c Fri Jul 22 09:39:49 2011 (r224267) @@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$"); #include #ifdef INET -#include +#include #include #endif @@ -141,12 +141,80 @@ ath_dfs_tasklet_needed(struct ath_softc } /* - * Handle ioctl requests from the diagnostic interface + * Handle ioctl requests from the diagnostic interface. + * + * The initial part of this code resembles ath_ioctl_diag(); + * it's likely a good idea to reduce duplication between + * these two routines. */ int ath_ioctl_phyerr(struct ath_softc *sc, struct ath_diag *ad) { - return 1; + unsigned int id = ad->ad_id & ATH_DIAG_ID; + void *indata = NULL; + void *outdata = NULL; + u_int32_t insize = ad->ad_in_size; + u_int32_t outsize = ad->ad_out_size; + int error = 0; + HAL_PHYERR_PARAM peout; + HAL_PHYERR_PARAM *pe; + + if (ad->ad_id & ATH_DIAG_IN) { + /* + * Copy in data. + */ + indata = malloc(insize, M_TEMP, M_NOWAIT); + if (indata == NULL) { + error = ENOMEM; + goto bad; + } + error = copyin(ad->ad_in_data, indata, insize); + if (error) + goto bad; + } + if (ad->ad_id & ATH_DIAG_DYN) { + /* + * Allocate a buffer for the results (otherwise the HAL + * returns a pointer to a buffer where we can read the + * results). Note that we depend on the HAL leaving this + * pointer for us to use below in reclaiming the buffer; + * may want to be more defensive. + */ + outdata = malloc(outsize, M_TEMP, M_NOWAIT); + if (outdata == NULL) { + error = ENOMEM; + goto bad; + } + } + switch (id) { + case DFS_SET_THRESH: + if (insize < sizeof(HAL_PHYERR_PARAM)) { + error = -EINVAL; + break; + } + pe = (HAL_PHYERR_PARAM *) indata; + ath_hal_enabledfs(sc->sc_ah, pe); + break; + case DFS_GET_THRESH: + memset(&peout, 0, sizeof(peout)); + outsize = sizeof(HAL_PHYERR_PARAM); + ath_hal_getdfsthresh(sc->sc_ah, &peout); + pe = (HAL_PHYERR_PARAM *) outdata; + memcpy(pe, &peout, sizeof(*pe)); + break; + default: + error = -EINVAL; + } + if (outsize < ad->ad_out_size) + ad->ad_out_size = outsize; + if (outdata && copyout(outdata, ad->ad_out_data, ad->ad_out_size)) + error = -EFAULT; +bad: + if ((ad->ad_id & ATH_DIAG_IN) && indata != NULL) + free(indata, M_TEMP); + if ((ad->ad_id & ATH_DIAG_DYN) && outdata != NULL) + free(outdata, M_TEMP); + return error; } /* From owner-svn-src-head@FreeBSD.ORG Fri Jul 22 10:47:51 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0DA1106564A; Fri, 22 Jul 2011 10:47:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id BCDBD8FC0C; Fri, 22 Jul 2011 10:47:50 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id NAA03862; Fri, 22 Jul 2011 13:46:29 +0300 (EEST) (envelope-from avg@FreeBSD.org) Message-ID: <4E295504.2060004@FreeBSD.org> Date: Fri, 22 Jul 2011 13:46:28 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:5.0) Gecko/20110705 Thunderbird/5.0 MIME-Version: 1.0 To: Bruce Evans References: <201107181610.49443.hselasky@c2i.net> <4E26AFF8.8080107@FreeBSD.org> <201107201249.39550.hselasky@c2i.net> <20110720221325.E1436@besplex.bde.org> In-Reply-To: <20110720221325.E1436@besplex.bde.org> X-Enigmail-Version: 1.2pre Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: "svn-src-head@FreeBSD.org" , "svn-src-all@FreeBSD.org" , "src-committers@FreeBSD.org" , Hans Petter Selasky Subject: Re: svn commit: r223989 - head/sys/dev/usb/input X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jul 2011 10:47:51 -0000 on 20/07/2011 18:32 Bruce Evans said the following: [snip] > The low-level console driver should switch to polling mode to read the > keystrokes. However, its API is broken as designed, so it can only > [tell the driver level to] do this around each poll for a character. > Polling involves polling each possible console in turn, so polling mode > must be left after unsuccessfully polling for a short time so as to > get to the next console. This is now done even if there is only 1 > console. Before the multiple-console changes, polling mode was only > left after _successfully_ polling for as long as necessary to read > a character, so things mostly worked -- the race was only lost if > a character arrives in between polls, and you can't type fast enough > for the time between polls to be significant compared with the time > in polls. [snip] > A non-broken API needs cn_open() and cn_close() functions which would > normally switch the driver in an out of polling mode. Given these > interfaces easy to fix the per-character poll to work as well as before > the multiple console changes, including for multiple active consoles. > Just call cn_open() and cn_close() on every active console around the > whole polling loop. A little more is required to prevent races between > characters, and to avoid the races inherent in the cn_checkc() API. > For multi-char input like that at the mountroot prompt, calling > cn_open() and cn_close() around the loop in gets(9) is adequate. The > functions should be almost no-ops when called nested for things like > this. [snip] Thank you for the great explanation of the issue! I think that your suggestion makes a lot of sense and is the proper approach to fixing this issue. Now we need some sole to actually do the work :-) -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Fri Jul 22 12:50:22 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10A931065672; Fri, 22 Jul 2011 12:50:22 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 00C9F8FC16; Fri, 22 Jul 2011 12:50:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6MCoLD7017775; Fri, 22 Jul 2011 12:50:21 GMT (envelope-from jonathan@svn.freebsd.org) Received: (from jonathan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6MCoL4d017773; Fri, 22 Jul 2011 12:50:21 GMT (envelope-from jonathan@svn.freebsd.org) Message-Id: <201107221250.p6MCoL4d017773@svn.freebsd.org> From: Jonathan Anderson Date: Fri, 22 Jul 2011 12:50:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224268 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jul 2011 12:50:22 -0000 Author: jonathan Date: Fri Jul 22 12:50:21 2011 New Revision: 224268 URL: http://svn.freebsd.org/changeset/base/224268 Log: Turn on AUDIT_ARG_RIGHTS() for cap_new(2). Now that the code is in place to audit capability method rights, start using it to audit the 'rights' argument to cap_new(2). Approved by: re (kib), mentor (rwatson) Sponsored by: Google Inc Modified: head/sys/kern/sys_capability.c Modified: head/sys/kern/sys_capability.c ============================================================================== --- head/sys/kern/sys_capability.c Fri Jul 22 09:39:49 2011 (r224267) +++ head/sys/kern/sys_capability.c Fri Jul 22 12:50:21 2011 (r224268) @@ -224,9 +224,7 @@ cap_new(struct thread *td, struct cap_ne cap_rights_t rights = uap->rights; AUDIT_ARG_FD(fd); -#ifdef notyet /* capability auditing will follow in a few commits */ AUDIT_ARG_RIGHTS(rights); -#endif error = fget(td, fd, &fp); if (error) return (error); From owner-svn-src-head@FreeBSD.ORG Fri Jul 22 15:37:23 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B6F8106564A; Fri, 22 Jul 2011 15:37:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 701B28FC14; Fri, 22 Jul 2011 15:37:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6MFbNvi022688; Fri, 22 Jul 2011 15:37:23 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6MFbNlh022686; Fri, 22 Jul 2011 15:37:23 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201107221537.p6MFbNlh022686@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 22 Jul 2011 15:37:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224269 - head/sys/dev/pci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jul 2011 15:37:23 -0000 Author: hselasky Date: Fri Jul 22 15:37:23 2011 New Revision: 224269 URL: http://svn.freebsd.org/changeset/base/224269 Log: Add missing XHCI early takeover code. The XHCI takeover code is supposed to disable the BIOS from using the XHCI controller after bootup. Approved by: re (kib) Reported by: Mike Tancsa MFC after: 1 week Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Fri Jul 22 12:50:21 2011 (r224268) +++ head/sys/dev/pci/pci.c Fri Jul 22 15:37:23 2011 (r224269) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -2956,6 +2957,68 @@ ehci_early_takeover(device_t self) bus_release_resource(self, SYS_RES_MEMORY, rid, res); } +/* Perform early XHCI takeover from SMM. */ +static void +xhci_early_takeover(device_t self) +{ + struct resource *res; + uint32_t cparams; + uint32_t eec; + uint8_t eecp; + uint8_t bios_sem; + uint8_t offs; + int rid; + int i; + + rid = PCIR_BAR(0); + res = bus_alloc_resource_any(self, SYS_RES_MEMORY, &rid, RF_ACTIVE); + if (res == NULL) + return; + + cparams = bus_read_4(res, XHCI_HCSPARAMS0); + + eec = -1; + + /* Synchronise with the BIOS if it owns the controller. */ + for (eecp = XHCI_HCS0_XECP(cparams) << 2; eecp != 0 && XHCI_XECP_NEXT(eec); + eecp += XHCI_XECP_NEXT(eec) << 2) { + eec = bus_read_4(res, eecp); + + if (XHCI_XECP_ID(eec) != XHCI_ID_USB_LEGACY) + continue; + + bios_sem = bus_read_1(res, eecp + XHCI_XECP_BIOS_SEM); + if (bios_sem == 0) + continue; + + if (bootverbose) + printf("xhci early: " + "SMM active, request owner change\n"); + + bus_write_1(res, eecp + XHCI_XECP_OS_SEM, 1); + + /* wait a maximum of 5 second */ + + for (i = 0; (i < 5000) && (bios_sem != 0); i++) { + DELAY(1000); + bios_sem = bus_read_1(res, eecp + + XHCI_XECP_BIOS_SEM); + } + + if (bios_sem != 0) { + if (bootverbose) + printf("xhci early: " + "SMM does not respond\n"); + } + + /* Disable interrupts */ + offs = bus_read_1(res, XHCI_CAPLENGTH); + bus_write_4(res, offs + XHCI_USBCMD, 0); + bus_read_4(res, offs + XHCI_USBSTS); + } + bus_release_resource(self, SYS_RES_MEMORY, rid, res); +} + void pci_add_resources(device_t bus, device_t dev, int force, uint32_t prefetchmask) { @@ -3002,7 +3065,9 @@ pci_add_resources(device_t bus, device_t if (pci_usb_takeover && pci_get_class(dev) == PCIC_SERIALBUS && pci_get_subclass(dev) == PCIS_SERIALBUS_USB) { - if (pci_get_progif(dev) == PCIP_SERIALBUS_USB_EHCI) + if (pci_get_progif(dev) == PCIP_SERIALBUS_USB_XHCI) + xhci_early_takeover(dev); + else if (pci_get_progif(dev) == PCIP_SERIALBUS_USB_EHCI) ehci_early_takeover(dev); else if (pci_get_progif(dev) == PCIP_SERIALBUS_USB_OHCI) ohci_early_takeover(dev); From owner-svn-src-head@FreeBSD.ORG Fri Jul 22 16:37:04 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E6C5106564A; Fri, 22 Jul 2011 16:37:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C63F8FC19; Fri, 22 Jul 2011 16:37:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6MGb4GF024429; Fri, 22 Jul 2011 16:37:04 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6MGb4GQ024422; Fri, 22 Jul 2011 16:37:04 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201107221637.p6MGb4GQ024422@svn.freebsd.org> From: Alexander Motin Date: Fri, 22 Jul 2011 16:37:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224270 - in head/sys/dev/ata: . chipsets X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jul 2011 16:37:04 -0000 Author: mav Date: Fri Jul 22 16:37:04 2011 New Revision: 224270 URL: http://svn.freebsd.org/changeset/base/224270 Log: - Use mutex to serialize index/data register pair usage, when accessing SATA registers. Unserialized access under heavy load caused wrong speed reporting and potentially could cause device loss. - To free memory and other resources (including above), allocated during chipinit() method call on attach, add new chipdeinit() method, called during driver detach. Submitted by: Andrew Boyer (initial version) Approved by: re (kib) MFC after: 1 week Modified: head/sys/dev/ata/ata-pci.c head/sys/dev/ata/ata-pci.h head/sys/dev/ata/chipsets/ata-acard.c head/sys/dev/ata/chipsets/ata-acerlabs.c head/sys/dev/ata/chipsets/ata-intel.c head/sys/dev/ata/chipsets/ata-promise.c Modified: head/sys/dev/ata/ata-pci.c ============================================================================== --- head/sys/dev/ata/ata-pci.c Fri Jul 22 15:37:23 2011 (r224269) +++ head/sys/dev/ata/ata-pci.c Fri Jul 22 16:37:04 2011 (r224270) @@ -49,8 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include -/* local vars */ -static MALLOC_DEFINE(M_ATAPCI, "ata_pci", "ATA driver PCI"); +MALLOC_DEFINE(M_ATAPCI, "ata_pci", "ATA driver PCI"); /* misc defines */ #define IOMASK 0xfffffffc @@ -146,13 +145,14 @@ ata_pci_detach(device_t dev) device_delete_child(dev, children[i]); free(children, M_TEMP); } - if (ctlr->r_irq) { bus_teardown_intr(dev, ctlr->r_irq, ctlr->handle); bus_release_resource(dev, SYS_RES_IRQ, ctlr->r_irq_rid, ctlr->r_irq); if (ctlr->r_irq_rid != ATA_IRQ_RID) pci_release_msi(dev); } + if (ctlr->chipdeinit != NULL) + ctlr->chipdeinit(dev); if (ctlr->r_res2) bus_release_resource(dev, ctlr->r_type2, ctlr->r_rid2, ctlr->r_res2); if (ctlr->r_res1) Modified: head/sys/dev/ata/ata-pci.h ============================================================================== --- head/sys/dev/ata/ata-pci.h Fri Jul 22 15:37:23 2011 (r224269) +++ head/sys/dev/ata/ata-pci.h Fri Jul 22 16:37:04 2011 (r224270) @@ -55,6 +55,7 @@ struct ata_pci_controller { int channels; int ichannels; int (*chipinit)(device_t); + int (*chipdeinit)(device_t); int (*suspend)(device_t); int (*resume)(device_t); int (*ch_attach)(device_t); @@ -579,6 +580,8 @@ int ata_sii_chipinit(device_t); /* externs */ extern devclass_t ata_pci_devclass; +MALLOC_DECLARE(M_ATAPCI); + /* macro for easy definition of all driver module stuff */ #define ATA_DECLARE_DRIVER(dname) \ static device_method_t __CONCAT(dname,_methods)[] = { \ Modified: head/sys/dev/ata/chipsets/ata-acard.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-acard.c Fri Jul 22 15:37:23 2011 (r224269) +++ head/sys/dev/ata/chipsets/ata-acard.c Fri Jul 22 16:37:04 2011 (r224270) @@ -59,6 +59,7 @@ struct ata_serialize { /* local prototypes */ static int ata_acard_chipinit(device_t dev); +static int ata_acard_chipdeinit(device_t dev); static int ata_acard_ch_attach(device_t dev); static int ata_acard_status(device_t dev); static int ata_acard_850_setmode(device_t dev, int target, int mode); @@ -93,6 +94,7 @@ ata_acard_probe(device_t dev) ata_set_desc(dev); ctlr->chipinit = ata_acard_chipinit; + ctlr->chipdeinit = ata_acard_chipdeinit; return (BUS_PROBE_DEFAULT); } @@ -111,7 +113,7 @@ ata_acard_chipinit(device_t dev) ctlr->setmode = ata_acard_850_setmode; ctlr->locking = ata_serialize; serial = malloc(sizeof(struct ata_serialize), - M_TEMP, M_WAITOK | M_ZERO); + M_ATAPCI, M_WAITOK | M_ZERO); ata_serialize_init(serial); ctlr->chipset_data = serial; } @@ -121,6 +123,21 @@ ata_acard_chipinit(device_t dev) } static int +ata_acard_chipdeinit(device_t dev) +{ + struct ata_pci_controller *ctlr = device_get_softc(dev); + struct ata_serialize *serial; + + if (ctlr->chip->cfg1 == ATP_OLD) { + serial = ctlr->chipset_data; + mtx_destroy(&serial->locked_mtx); + free(serial, M_ATAPCI); + ctlr->chipset_data = NULL; + } + return (0); +} + +static int ata_acard_ch_attach(device_t dev) { struct ata_channel *ch = device_get_softc(dev); Modified: head/sys/dev/ata/chipsets/ata-acerlabs.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-acerlabs.c Fri Jul 22 15:37:23 2011 (r224269) +++ head/sys/dev/ata/chipsets/ata-acerlabs.c Fri Jul 22 16:37:04 2011 (r224270) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); /* local prototypes */ static int ata_ali_chipinit(device_t dev); +static int ata_ali_chipdeinit(device_t dev); static int ata_ali_ch_attach(device_t dev); static int ata_ali_sata_ch_attach(device_t dev); static void ata_ali_reset(device_t dev); @@ -95,6 +96,7 @@ ata_ali_probe(device_t dev) ata_set_desc(dev); ctlr->chipinit = ata_ali_chipinit; + ctlr->chipdeinit = ata_ali_chipdeinit; return (BUS_PROBE_DEFAULT); } @@ -122,7 +124,7 @@ ata_ali_chipinit(device_t dev) return 0; /* Allocate resources for later use by channel attach routines. */ - res = malloc(sizeof(struct ali_sata_resources), M_TEMP, M_WAITOK); + res = malloc(sizeof(struct ali_sata_resources), M_ATAPCI, M_WAITOK); for (i = 0; i < 4; i++) { rid = PCIR_BAR(i); res->bars[i] = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, @@ -173,6 +175,27 @@ ata_ali_chipinit(device_t dev) } static int +ata_ali_chipdeinit(device_t dev) +{ + struct ata_pci_controller *ctlr = device_get_softc(dev); + struct ali_sata_resources *res; + int i; + + if (ctlr->chip->cfg2 == ALI_SATA) { + res = ctlr->chipset_data; + for (i = 0; i < 4; i++) { + if (res->bars[i] != NULL) { + bus_release_resource(dev, SYS_RES_IOPORT, + PCIR_BAR(i), res->bars[i]); + } + } + free(res, M_ATAPCI); + ctlr->chipset_data = NULL; + } + return (0); +} + +static int ata_ali_ch_attach(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); Modified: head/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-intel.c Fri Jul 22 15:37:23 2011 (r224269) +++ head/sys/dev/ata/chipsets/ata-intel.c Fri Jul 22 16:37:04 2011 (r224270) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); /* local prototypes */ static int ata_intel_chipinit(device_t dev); +static int ata_intel_chipdeinit(device_t dev); static int ata_intel_ch_attach(device_t dev); static void ata_intel_reset(device_t dev); static int ata_intel_old_setmode(device_t dev, int target, int mode); @@ -85,6 +86,18 @@ static void ata_intel_31244_reset(device #define INTEL_6CH2 8 #define INTEL_ICH7 16 +struct ata_intel_data { + struct mtx lock; + u_char smap[4]; +}; + +#define ATA_INTEL_SMAP(ctlr, ch) \ + &((struct ata_intel_data *)((ctlr)->chipset_data))->smap[(ch)->unit * 2] +#define ATA_INTEL_LOCK(ctlr) \ + mtx_lock(&((struct ata_intel_data *)((ctlr)->chipset_data))->lock) +#define ATA_INTEL_UNLOCK(ctlr) \ + mtx_unlock(&((struct ata_intel_data *)((ctlr)->chipset_data))->lock) + /* * Intel chipset support functions */ @@ -206,6 +219,7 @@ ata_intel_probe(device_t dev) ata_set_desc(dev); ctlr->chipinit = ata_intel_chipinit; + ctlr->chipdeinit = ata_intel_chipdeinit; return (BUS_PROBE_DEFAULT); } @@ -213,11 +227,14 @@ static int ata_intel_chipinit(device_t dev) { struct ata_pci_controller *ctlr = device_get_softc(dev); + struct ata_intel_data *data; if (ata_setup_interrupt(dev, ata_generic_intr)) return ENXIO; - ctlr->chipset_data = NULL; + data = malloc(sizeof(struct ata_intel_data), M_ATAPCI, M_WAITOK | M_ZERO); + mtx_init(&data->lock, "Intel SATA lock", NULL, MTX_DEF); + ctlr->chipset_data = (void *)data; /* good old PIIX needs special treatment (not implemented) */ if (ctlr->chip->chipid == ATA_I82371FB) { @@ -305,6 +322,19 @@ ata_intel_chipinit(device_t dev) } static int +ata_intel_chipdeinit(device_t dev) +{ + struct ata_pci_controller *ctlr = device_get_softc(dev); + struct ata_intel_data *data; + + data = ctlr->chipset_data; + mtx_destroy(&data->lock); + free(data, M_ATAPCI); + ctlr->chipset_data = NULL; + return (0); +} + +static int ata_intel_ch_attach(device_t dev) { struct ata_pci_controller *ctlr; @@ -329,7 +359,7 @@ ata_intel_ch_attach(device_t dev) ch->flags |= ATA_ALWAYS_DMASTAT; if (ctlr->chip->max_dma >= ATA_SA150) { - smap = (u_char *)&ctlr->chipset_data + ch->unit * 2; + smap = ATA_INTEL_SMAP(ctlr, ch); map = pci_read_config(device_get_parent(dev), 0x90, 1); if (ctlr->chip->cfg1 & INTEL_ICH5) { map &= 0x07; @@ -415,7 +445,7 @@ ata_intel_reset(device_t dev) return (ata_generic_reset(dev)); /* Do hard-reset on respective SATA ports. */ - smap = (u_char *)&ctlr->chipset_data + ch->unit * 2; + smap = ATA_INTEL_SMAP(ctlr, ch); mask = 1 << smap[0]; if ((ch->flags & ATA_NO_SLAVE) == 0) mask |= (1 << smap[1]); @@ -605,7 +635,7 @@ ata_intel_sata_ahci_read(device_t dev, i ctlr = device_get_softc(parent); ch = device_get_softc(dev); port = (port == 1) ? 1 : 0; - smap = (u_char *)&ctlr->chipset_data + ch->unit * 2; + smap = ATA_INTEL_SMAP(ctlr, ch); offset = 0x100 + smap[port] * 0x80; switch (reg) { case ATA_SSTATUS: @@ -635,7 +665,7 @@ ata_intel_sata_cscr_read(device_t dev, i parent = device_get_parent(dev); ctlr = device_get_softc(parent); ch = device_get_softc(dev); - smap = (u_char *)&ctlr->chipset_data + ch->unit * 2; + smap = ATA_INTEL_SMAP(ctlr, ch); port = (port == 1) ? 1 : 0; switch (reg) { case ATA_SSTATUS: @@ -650,9 +680,11 @@ ata_intel_sata_cscr_read(device_t dev, i default: return (EINVAL); } + ATA_INTEL_LOCK(ctlr); pci_write_config(parent, 0xa0, 0x50 + smap[port] * 0x10 + reg * 4, 4); *result = pci_read_config(parent, 0xa4, 4); + ATA_INTEL_UNLOCK(ctlr); return (0); } @@ -680,8 +712,10 @@ ata_intel_sata_sidpr_read(device_t dev, default: return (EINVAL); } + ATA_INTEL_LOCK(ctlr); ATA_IDX_OUTL(ch, ATA_IDX_ADDR, ((ch->unit * 2 + port) << 8) + reg); *result = ATA_IDX_INL(ch, ATA_IDX_DATA); + ATA_INTEL_UNLOCK(ctlr); return (0); } @@ -698,7 +732,7 @@ ata_intel_sata_ahci_write(device_t dev, ctlr = device_get_softc(parent); ch = device_get_softc(dev); port = (port == 1) ? 1 : 0; - smap = (u_char *)&ctlr->chipset_data + ch->unit * 2; + smap = ATA_INTEL_SMAP(ctlr, ch); offset = 0x100 + smap[port] * 0x80; switch (reg) { case ATA_SSTATUS: @@ -728,7 +762,7 @@ ata_intel_sata_cscr_write(device_t dev, parent = device_get_parent(dev); ctlr = device_get_softc(parent); ch = device_get_softc(dev); - smap = (u_char *)&ctlr->chipset_data + ch->unit * 2; + smap = ATA_INTEL_SMAP(ctlr, ch); port = (port == 1) ? 1 : 0; switch (reg) { case ATA_SSTATUS: @@ -743,9 +777,11 @@ ata_intel_sata_cscr_write(device_t dev, default: return (EINVAL); } + ATA_INTEL_LOCK(ctlr); pci_write_config(parent, 0xa0, 0x50 + smap[port] * 0x10 + reg * 4, 4); pci_write_config(parent, 0xa4, value, 4); + ATA_INTEL_UNLOCK(ctlr); return (0); } @@ -773,8 +809,10 @@ ata_intel_sata_sidpr_write(device_t dev, default: return (EINVAL); } + ATA_INTEL_LOCK(ctlr); ATA_IDX_OUTL(ch, ATA_IDX_ADDR, ((ch->unit * 2 + port) << 8) + reg); ATA_IDX_OUTL(ch, ATA_IDX_DATA, value); + ATA_INTEL_UNLOCK(ctlr); return (0); } Modified: head/sys/dev/ata/chipsets/ata-promise.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-promise.c Fri Jul 22 15:37:23 2011 (r224269) +++ head/sys/dev/ata/chipsets/ata-promise.c Fri Jul 22 16:37:04 2011 (r224270) @@ -280,7 +280,7 @@ ata_promise_chipinit(device_t dev) /* setup host packet controls */ hpkt = malloc(sizeof(struct ata_promise_sx4), - M_TEMP, M_NOWAIT | M_ZERO); + M_ATAPCI, M_NOWAIT | M_ZERO); mtx_init(&hpkt->mtx, "ATA promise HPKT lock", NULL, MTX_DEF); TAILQ_INIT(&hpkt->queue); hpkt->busy = 0; From owner-svn-src-head@FreeBSD.ORG Fri Jul 22 16:42:12 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC3EE106566C; Fri, 22 Jul 2011 16:42:12 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 99F8D8FC18; Fri, 22 Jul 2011 16:42:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6MGgCRq024600; Fri, 22 Jul 2011 16:42:12 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6MGgCDM024598; Fri, 22 Jul 2011 16:42:12 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201107221642.p6MGgCDM024598@svn.freebsd.org> From: Michael Tuexen Date: Fri, 22 Jul 2011 16:42:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224271 - head/usr.bin/netstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jul 2011 16:42:12 -0000 Author: tuexen Date: Fri Jul 22 16:42:12 2011 New Revision: 224271 URL: http://svn.freebsd.org/changeset/base/224271 Log: Fix the following bugs related to the SCTP support of netstat: * Correctly handle -a. * -A isn't supported. * Show all closed 1-to-1 and 1-to-many style sockets. * Show all listening 1-to-many style sockets. * Use consistent formatting for -W. PR: 150642 Approved by: re@ MFC after: 4 weeks. Modified: head/usr.bin/netstat/sctp.c Modified: head/usr.bin/netstat/sctp.c ============================================================================== --- head/usr.bin/netstat/sctp.c Fri Jul 22 16:37:04 2011 (r224270) +++ head/usr.bin/netstat/sctp.c Fri Jul 22 16:42:12 2011 (r224271) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2001-2007, by Weongyo Jeong. All rights reserved. + * Copyright (c) 2011, by Michael Tuexen. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -63,7 +64,6 @@ __FBSDID("$FreeBSD$"); #ifdef SCTP -void inetprint(struct in_addr *, int, const char *, int); static void sctp_statesprint(uint32_t state); #define NETSTAT_SCTP_STATES_CLOSED 0x0 @@ -102,6 +102,124 @@ struct xraddr_entry { LIST_ENTRY(xraddr_entry) xraddr_entries; }; +/* + * Construct an Internet address representation. + * If numeric_addr has been supplied, give + * numeric value, otherwise try for symbolic name. + */ +static char * +inetname(struct in_addr *inp) +{ + char *cp; + static char line[MAXHOSTNAMELEN]; + struct hostent *hp; + struct netent *np; + + cp = 0; + if (!numeric_addr && inp->s_addr != INADDR_ANY) { + int net = inet_netof(*inp); + int lna = inet_lnaof(*inp); + + if (lna == INADDR_ANY) { + np = getnetbyaddr(net, AF_INET); + if (np) + cp = np->n_name; + } + if (cp == 0) { + hp = gethostbyaddr((char *)inp, sizeof (*inp), AF_INET); + if (hp) { + cp = hp->h_name; + trimdomain(cp, strlen(cp)); + } + } + } + if (inp->s_addr == INADDR_ANY) + strcpy(line, "*"); + else if (cp) { + strlcpy(line, cp, sizeof(line)); + } else { + inp->s_addr = ntohl(inp->s_addr); +#define C(x) ((u_int)((x) & 0xff)) + sprintf(line, "%u.%u.%u.%u", C(inp->s_addr >> 24), + C(inp->s_addr >> 16), C(inp->s_addr >> 8), C(inp->s_addr)); + inp->s_addr = htonl(inp->s_addr); + } + return (line); +} + +#ifdef INET6 +static char ntop_buf[INET6_ADDRSTRLEN]; + +static char * +inet6name(struct in6_addr *in6p) +{ + char *cp; + static char line[50]; + struct hostent *hp; + static char domain[MAXHOSTNAMELEN]; + static int first = 1; + + if (first && !numeric_addr) { + first = 0; + if (gethostname(domain, MAXHOSTNAMELEN) == 0 && + (cp = index(domain, '.'))) + (void) strcpy(domain, cp + 1); + else + domain[0] = 0; + } + cp = 0; + if (!numeric_addr && !IN6_IS_ADDR_UNSPECIFIED(in6p)) { + hp = gethostbyaddr((char *)in6p, sizeof(*in6p), AF_INET6); + if (hp) { + if ((cp = index(hp->h_name, '.')) && + !strcmp(cp + 1, domain)) + *cp = 0; + cp = hp->h_name; + } + } + if (IN6_IS_ADDR_UNSPECIFIED(in6p)) + strcpy(line, "*"); + else if (cp) + strcpy(line, cp); + else + sprintf(line, "%s", + inet_ntop(AF_INET6, (void *)in6p, ntop_buf, + sizeof(ntop_buf))); + return (line); +} +#endif + +static void +sctp_print_address(union sctp_sockstore *address, int port, int num_port) +{ + struct servent *sp = 0; + char line[80], *cp; + int width; + + switch (address->sa.sa_family) { + case AF_INET: + sprintf(line, "%.*s.", Wflag ? 39 : 16, inetname(&address->sin.sin_addr)); + break; +#ifdef INET6 + case AF_INET6: + sprintf(line, "%.*s.", Wflag ? 39 : 16, inet6name(&address->sin6.sin6_addr)); + break; +#endif + default: + sprintf(line, "%.*s.", Wflag ? 39 : 16, ""); + break; + } + cp = index(line, '\0'); + if (!num_port && port) + sp = getservbyport((int)port, "sctp"); + if (sp || port == 0) + sprintf(cp, "%.15s ", sp ? sp->s_name : "*"); + else + sprintf(cp, "%d ", ntohs((u_short)port)); + width = Wflag ? 45 : 22; + printf("%-*.*s ", width, width, line); +} + static int sctp_skip_xinpcb_ifneed(char *buf, const size_t buflen, size_t *offset) { @@ -150,18 +268,14 @@ sctp_skip_xinpcb_ifneed(char *buf, const } static void -sctp_process_tcb(struct xsctp_tcb *xstcb, const char *name, +sctp_process_tcb(struct xsctp_tcb *xstcb, char *buf, const size_t buflen, size_t *offset, int *indent) { int i, xl_total = 0, xr_total = 0, x_max; - struct sockaddr *sa; struct xsctp_raddr *xraddr; struct xsctp_laddr *xladdr; struct xladdr_entry *prev_xl = NULL, *xl = NULL, *xl_tmp; struct xraddr_entry *prev_xr = NULL, *xr = NULL, *xr_tmp; -#ifdef INET6 - struct sockaddr_in6 *in6; -#endif LIST_INIT(&xladdr_head); LIST_INIT(&xraddr_head); @@ -220,38 +334,22 @@ sctp_process_tcb(struct xsctp_tcb *xstcb x_max = (xl_total > xr_total) ? xl_total : xr_total; for (i = 0; i < x_max; i++) { if (((*indent == 0) && i > 0) || *indent > 0) - printf("%-11s ", " "); + printf("%-12s ", " "); if (xl != NULL) { - sa = &(xl->xladdr->address.sa); - if ((sa->sa_family) == AF_INET) - inetprint(&((struct sockaddr_in *)sa)->sin_addr, - htons(xstcb->local_port), - name, numeric_port); -#ifdef INET6 - else { - in6 = (struct sockaddr_in6 *)sa; - inet6print(&in6->sin6_addr, - htons(xstcb->local_port), - name, numeric_port); + sctp_print_address(&(xl->xladdr->address), + htons(xstcb->local_port), numeric_port); + } else { + if (Wflag) { + printf("%-45s ", " "); + } else { + printf("%-22s ", " "); } -#endif } if (xr != NULL && !Lflag) { - sa = &(xr->xraddr->address.sa); - if ((sa->sa_family) == AF_INET) - inetprint(&((struct sockaddr_in *)sa)->sin_addr, - htons(xstcb->remote_port), - name, numeric_port); -#ifdef INET6 - else { - in6 = (struct sockaddr_in6 *)sa; - inet6print(&in6->sin6_addr, - htons(xstcb->remote_port), - name, numeric_port); - } -#endif + sctp_print_address(&(xr->xraddr->address), + htons(xstcb->remote_port), numeric_port); } if (xl != NULL) @@ -285,53 +383,21 @@ out: } } -#ifdef SCTP_DEBUG -uint32_t sctp_pdup[64]; -int sctp_pcnt = 0; -#endif - static void -sctp_process_inpcb(struct xsctp_inpcb *xinpcb, const char *name, +sctp_process_inpcb(struct xsctp_inpcb *xinpcb, char *buf, const size_t buflen, size_t *offset) { - int offset_backup, indent = 0, xladdr_total = 0, is_listening = 0; + int indent = 0, xladdr_total = 0, is_listening = 0; static int first = 1; - char *tname; + char *tname, *pname; struct xsctp_tcb *xstcb; struct xsctp_laddr *xladdr; - struct sockaddr *sa; -#ifdef INET6 - struct sockaddr_in6 *in6; -#endif + size_t offset_laddr; + int process_closed; - if ((xinpcb->flags & SCTP_PCB_FLAGS_TCPTYPE) == - SCTP_PCB_FLAGS_TCPTYPE && xinpcb->maxqlen > 0) + if (xinpcb->maxqlen > 0) is_listening = 1; - if (!Lflag && !is_listening && - !(xinpcb->flags & SCTP_PCB_FLAGS_CONNECTED)) { -#ifdef SCTP_DEBUG - int i, found = 0; - - for (i = 0; i < sctp_pcnt; i++) { - if (sctp_pdup[i] == xinpcb->flags) { - found = 1; - break; - } - } - if (!found) { - sctp_pdup[sctp_pcnt++] = xinpcb->flags; - if (sctp_pcnt >= 64) - sctp_pcnt = 0; - printf("[0x%08x]", xinpcb->flags); - } -#endif - offset_backup = *offset; - if (!sctp_skip_xinpcb_ifneed(buf, buflen, offset)) - return; - *offset = offset_backup; - } - if (first) { if (!Lflag) { printf("Active SCTP associations"); @@ -340,90 +406,115 @@ sctp_process_inpcb(struct xsctp_inpcb *x } else printf("Current listen queue sizes (qlen/maxqlen)"); putchar('\n'); - if (Aflag) - printf("%-8.8s ", "Socket"); if (Lflag) - printf("%-5.5s %-5.5s %-8.8s %-22.22s\n", + printf("%-6.6s %-5.5s %-8.8s %-22.22s\n", "Proto", "Type", "Listen", "Local Address"); else - printf((Aflag && !Wflag) ? - "%-5.5s %-5.5s %-18.18s %-18.18s %s\n" : - "%-5.5s %-5.5s %-22.22s %-22.22s %s\n", - "Proto", "Type", - "Local Address", "Foreign Address", - "(state)"); + if (Wflag) + printf("%-6.6s %-5.5s %-45.45s %-45.45s %s\n", + "Proto", "Type", + "Local Address", "Foreign Address", + "(state)"); + else + printf("%-6.6s %-5.5s %-22.22s %-22.22s %s\n", + "Proto", "Type", + "Local Address", "Foreign Address", + "(state)"); first = 0; } - if (Lflag && xinpcb->maxqlen == 0) { + xladdr = (struct xsctp_laddr *)(buf + *offset); + if (Lflag && !is_listening) { sctp_skip_xinpcb_ifneed(buf, buflen, offset); return; } - if (Aflag) - printf("%8lx ", (u_long)xinpcb); - printf("%-5.5s ", name); + if (xinpcb->flags & SCTP_PCB_FLAGS_BOUND_V6) { + /* Can't distinguish between sctp46 and sctp6 */ + pname = "sctp46"; + } else { + pname = "sctp4"; + } if (xinpcb->flags & SCTP_PCB_FLAGS_TCPTYPE) tname = "1to1"; else if (xinpcb->flags & SCTP_PCB_FLAGS_UDPTYPE) tname = "1toN"; else - return; - - printf("%-5.5s ", tname); + tname = "????"; if (Lflag) { char buf1[9]; snprintf(buf1, 9, "%hu/%hu", xinpcb->qlen, xinpcb->maxqlen); + printf("%-6.6s %-5.5s ", pname, tname); printf("%-8.8s ", buf1); } - /* - * process the local address. This routine are used for Lflag. - */ + + offset_laddr = *offset; + process_closed = 0; +retry: while (*offset < buflen) { xladdr = (struct xsctp_laddr *)(buf + *offset); *offset += sizeof(struct xsctp_laddr); - if (xladdr->last == 1) + if (xladdr->last) { + if (aflag && !Lflag && (xladdr_total == 0) && process_closed) { + printf("%-6.6s %-5.5s ", pname, tname); + if (Wflag) { + printf("%-91.91s CLOSED", " "); + } else { + printf("%-45.45s CLOSED", " "); + } + } + if (process_closed || is_listening) { + putchar('\n'); + } break; + } - if (!Lflag && !is_listening) + if (!Lflag && !is_listening && !process_closed) continue; - if (xladdr_total != 0) + if (xladdr_total == 0) { + printf("%-6.6s %-5.5s ", pname, tname); + } else { putchar('\n'); - if (xladdr_total > 0) printf((Lflag) ? - "%-20.20s " : "%-11.11s ", " "); - - sa = &(xladdr->address.sa); - if ((sa->sa_family) == AF_INET) - inetprint(&((struct sockaddr_in *)sa)->sin_addr, - htons(xinpcb->local_port), name, numeric_port); -#ifdef INET6 - else { - in6 = (struct sockaddr_in6 *)sa; - inet6print(&in6->sin6_addr, - htons(xinpcb->local_port), name, numeric_port); + "%-21.21s " : "%-12.12s ", " "); + } + sctp_print_address(&(xladdr->address), + htons(xinpcb->local_port), numeric_port); + if (aflag && !Lflag && xladdr_total == 0) { + if (Wflag) { + if (process_closed) { + printf("%-45.45s CLOSED", " "); + } else { + printf("%-45.45s LISTEN", " "); + } + } else { + if (process_closed) { + printf("%-22.22s CLOSED", " "); + } else { + printf("%-22.22s LISTEN", " "); + } + } } -#endif - - if (!Lflag && xladdr_total == 0 && is_listening == 1) - printf("%-22.22s LISTEN", " "); - xladdr_total++; } xstcb = (struct xsctp_tcb *)(buf + *offset); *offset += sizeof(struct xsctp_tcb); + if (aflag && (xladdr_total == 0) && xstcb->last && !process_closed) { + process_closed = 1; + *offset = offset_laddr; + goto retry; + } while (xstcb->last == 0 && *offset < buflen) { - sctp_process_tcb(xstcb, name, buf, buflen, offset, &indent); + printf("%-6.6s %-5.5s ", pname, tname); + sctp_process_tcb(xstcb, buf, buflen, offset, &indent); indent++; xstcb = (struct xsctp_tcb *)(buf + *offset); *offset += sizeof(struct xsctp_tcb); } - - putchar('\n'); } /* @@ -461,7 +552,7 @@ sctp_protopr(u_long off __unused, xinpcb = (struct xsctp_inpcb *)(buf + offset); offset += sizeof(struct xsctp_inpcb); while (xinpcb->last == 0 && offset < len) { - sctp_process_inpcb(xinpcb, name, buf, (const size_t)len, + sctp_process_inpcb(xinpcb, buf, (const size_t)len, &offset); xinpcb = (struct xsctp_inpcb *)(buf + offset); From owner-svn-src-head@FreeBSD.ORG Fri Jul 22 18:03:33 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7234F106566C; Fri, 22 Jul 2011 18:03:33 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 618F78FC16; Fri, 22 Jul 2011 18:03:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6MI3X0F027037; Fri, 22 Jul 2011 18:03:33 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6MI3X1j027035; Fri, 22 Jul 2011 18:03:33 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201107221803.p6MI3X1j027035@svn.freebsd.org> From: Kirk McKusick Date: Fri, 22 Jul 2011 18:03:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224272 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jul 2011 18:03:33 -0000 Author: mckusick Date: Fri Jul 22 18:03:33 2011 New Revision: 224272 URL: http://svn.freebsd.org/changeset/base/224272 Log: Default debugging error messages to off for journaled soft updates sysctls. Delete limiting on output of these sysctls. Approved by: re (kib) Modified: head/sys/ufs/ffs/ffs_alloc.c Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Fri Jul 22 16:42:12 2011 (r224271) +++ head/sys/ufs/ffs/ffs_alloc.c Fri Jul 22 18:03:33 2011 (r224272) @@ -2447,7 +2447,7 @@ static SYSCTL_NODE(_vfs_ffs, FFS_SET_BUF #define DEBUG 1 #ifdef DEBUG -static int fsckcmds = 1; +static int fsckcmds = 0; SYSCTL_INT(_debug, OID_AUTO, fsckcmds, CTLFLAG_RW, &fsckcmds, 0, ""); #endif /* DEBUG */ @@ -2470,7 +2470,6 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) struct file *fp, *vfp; int vfslocked, filetype, error; static struct fileops *origops, bufferedops; - static int outcnt = 0; if (req->newlen > sizeof cmd) return (EBADRPC); @@ -2755,7 +2754,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) break; } #ifdef DEBUG - if (fsckcmds && outcnt++ < 100) { + if (fsckcmds) { printf("%s: update inode %jd\n", mp->mnt_stat.f_mntonname, (intmax_t)cmd.value); } @@ -2857,7 +2856,6 @@ buffered_write(fp, uio, active_cred, fla struct fs *fs; int error, vfslocked; daddr_t lbn; - static int outcnt = 0; /* * The devvp is associated with the /dev filesystem. To discover @@ -2875,7 +2873,7 @@ buffered_write(fp, uio, active_cred, fla if ((flags & FOF_OFFSET) == 0) uio->uio_offset = fp->f_offset; #ifdef DEBUG - if (fsckcmds && outcnt++ < 100) { + if (fsckcmds) { printf("%s: buffered write for block %jd\n", fs->fs_fsmnt, (intmax_t)btodb(uio->uio_offset)); } From owner-svn-src-head@FreeBSD.ORG Fri Jul 22 20:43:17 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F7C6106566B; Fri, 22 Jul 2011 20:43:17 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de [217.11.53.44]) by mx1.freebsd.org (Postfix) with ESMTP id 2673B8FC12; Fri, 22 Jul 2011 20:43:16 +0000 (UTC) Received: from outgoing.leidinger.net (p4FC418BA.dip.t-dialin.net [79.196.24.186]) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id 4CCF784400D; Fri, 22 Jul 2011 22:26:53 +0200 (CEST) Received: from unknown (IO.Leidinger.net [192.168.1.12]) by outgoing.leidinger.net (Postfix) with ESMTP id 87F222A97; Fri, 22 Jul 2011 22:26:50 +0200 (CEST) Date: Fri, 22 Jul 2011 22:26:49 +0200 From: Alexander Leidinger To: Andriy Gapon Message-ID: <20110722222649.0000534f@unknown> In-Reply-To: <4E295504.2060004@FreeBSD.org> References: <201107181610.49443.hselasky@c2i.net> <4E26AFF8.8080107@FreeBSD.org> <201107201249.39550.hselasky@c2i.net> <20110720221325.E1436@besplex.bde.org> <4E295504.2060004@FreeBSD.org> X-Mailer: Claws Mail 3.7.8cvs47 (GTK+ 2.16.6; i586-pc-mingw32msvc) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: 4CCF784400D.A0623 X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=-0.923, required 6, autolearn=disabled, ALL_TRUSTED -1.00, TW_SV 0.08) X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1311971213.6309@WoQfhDqwxp1vrmFrf7/pqw X-EBL-Spam-Status: No Cc: "svn-src-head@FreeBSD.org" , "svn-src-all@FreeBSD.org" , "src-committers@FreeBSD.org" , Bruce Evans , Hans Petter Selasky Subject: Re: svn commit: r223989 - head/sys/dev/usb/input X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jul 2011 20:43:17 -0000 On Fri, 22 Jul 2011 13:46:28 +0300 Andriy Gapon wrote: > I think that your suggestion makes a lot of sense and is the proper > approach to fixing this issue. Now we need some sole to actually do > the work :-) Or at least someone who documents the need to do it (and either the explanation or a link to it) in the wiki in the ideas list... ENOTIME ATM from my side. Bye, Alexander. -- http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 From owner-svn-src-head@FreeBSD.ORG Fri Jul 22 20:58:09 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7791106564A; Fri, 22 Jul 2011 20:58:09 +0000 (UTC) (envelope-from crodr001@gmail.com) Received: from mail-ew0-f54.google.com (mail-ew0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 69E228FC13; Fri, 22 Jul 2011 20:58:08 +0000 (UTC) Received: by ewy1 with SMTP id 1so2619306ewy.13 for ; Fri, 22 Jul 2011 13:58:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=aEY/NqU54dwN9lpVXnIg+8Lks94Ukw4BUuT2WNw1EYQ=; b=G42Qe120evfS9N2tx0yosAYubvmKM6dlVFK20l1OsyH0gVtFIBMHQgPpKKqHrDvQWf AJEixyqGTsgYWF+vArPqniNzcLhXV1SA36aVBWKhyEXjXBmrxh/4JoiAz9IvZ6rVTRyG xpB+fbIi/Xcg8AGXwrtRsi7dRQ0h9+sTbYNUA= MIME-Version: 1.0 Received: by 10.213.15.76 with SMTP id j12mr835842eba.60.1311368286158; Fri, 22 Jul 2011 13:58:06 -0700 (PDT) Sender: crodr001@gmail.com Received: by 10.213.32.8 with HTTP; Fri, 22 Jul 2011 13:58:06 -0700 (PDT) In-Reply-To: <201107151620.p6FGKX98086893@svn.freebsd.org> References: <201107151620.p6FGKX98086893@svn.freebsd.org> Date: Fri, 22 Jul 2011 13:58:06 -0700 X-Google-Sender-Auth: h-t-_iICOJfJekX5J72AiBlmZi0 Message-ID: From: Craig Rodrigues To: Kirk McKusick Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r224061 - in head/sys/ufs: ffs ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jul 2011 20:58:09 -0000 On Fri, Jul 15, 2011 at 9:20 AM, Kirk McKusick wrote: > Author: mckusick > Date: Fri Jul 15 16:20:33 2011 > New Revision: 224061 > URL: http://svn.freebsd.org/changeset/base/224061 > > Log: > Add an FFS specific mount option to allow a filesystem checker > (typically fsck_ffs) to register that it wishes to use FFS specific > sysctl's to update the filesystem. This ensures that two checkers > cannot run on a given filesystem at the same time and that no other > process accidentally or maliciously uses the filesystem updating > sysctls inappropriately. This functionality is needed by the > journaling soft-updates recovery code. > > Modified: > head/sys/ufs/ffs/ffs_alloc.c > head/sys/ufs/ffs/ffs_inode.c > head/sys/ufs/ffs/ffs_vfsops.c > head/sys/ufs/ffs/fs.h > head/sys/ufs/ufs/ufsmount.h > > Modified: head/sys/ufs/ffs/ffs_alloc.c > > ============================================================================== > --- head/sys/ufs/ffs/ffs_alloc.c Fri Jul 15 15:56:23 2011 > (r224060) > +++ head/sys/ufs/ffs/ffs_alloc.c Fri Jul 15 16:20:33 2011 > (r224061) > @@ -2381,6 +2381,18 @@ ffs_fserr(fs, inum, cp) > * in the current directory is oldvalue then change it to newvalue. > * unlink(nameptr, oldvalue) - Verify that the inode number associated > * with nameptr in the current directory is oldvalue then unlink it. > + * > + * The following functions may only be used on a quiescent filesystem > + * by the soft updates journal. They are not safe to be run on an active > + * filesystem. > + * > + * setinode(inode, dip) - the specified disk inode is replaced with the > + * contents pointed to by dip. > + * setbufoutput(fd, flags) - output associated with the specified file > + * descriptor (which must reference the character device supporting > + * the filesystem) switches from using physio to running through the > + * buffer cache when flags is set to 1. The descriptor reverts to > + * physio for output when flags is set to zero. > */ > > static int sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS); > @@ -2427,11 +2439,21 @@ static SYSCTL_NODE(_vfs_ffs, FFS_SET_DOT > static SYSCTL_NODE(_vfs_ffs, FFS_UNLINK, unlink, CTLFLAG_WR, > sysctl_ffs_fsck, "Unlink a Duplicate Name"); > > +static SYSCTL_NODE(_vfs_ffs, FFS_SET_INODE, setinode, CTLFLAG_WR, > + sysctl_ffs_fsck, "Update an On-Disk Inode"); > + > +static SYSCTL_NODE(_vfs_ffs, FFS_SET_BUFOUTPUT, setbufoutput, CTLFLAG_WR, > + sysctl_ffs_fsck, "Set Buffered Writing for Descriptor"); > + > +#define DEBUG 1 > #ifdef DEBUG > -static int fsckcmds = 0; > +static int fsckcmds = 1; > SYSCTL_INT(_debug, OID_AUTO, fsckcmds, CTLFLAG_RW, &fsckcmds, 0, ""); > #endif /* DEBUG */ > > +static int buffered_write(struct file *, struct uio *, struct ucred *, > + int, struct thread *); > + > static int > sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) > { > @@ -2445,8 +2467,10 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) > ufs2_daddr_t blkno; > long blkcnt, blksize; > struct filedesc *fdp; > - struct file *fp; > + struct file *fp, *vfp; > int vfslocked, filetype, error; > + static struct fileops *origops, bufferedops; > + static int outcnt = 0; > > if (req->newlen > sizeof cmd) > return (EBADRPC); > @@ -2454,7 +2478,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) > return (error); > if (cmd.version != FFS_CMD_VERSION) > return (ERPCMISMATCH); > - if ((error = getvnode(curproc->p_fd, cmd.handle, &fp)) != 0) > + if ((error = getvnode(td->td_proc->p_fd, cmd.handle, &fp)) != 0) > return (error); > vp = fp->f_data; > if (vp->v_type != VREG && vp->v_type != VDIR) { > @@ -2467,12 +2491,13 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) > fdrop(fp, td); > return (EINVAL); > } > - if (mp->mnt_flag & MNT_RDONLY) { > + ump = VFSTOUFS(mp); > + if ((mp->mnt_flag & MNT_RDONLY) && > + ump->um_fsckpid != td->td_proc->p_pid) { > vn_finished_write(mp); > fdrop(fp, td); > return (EROFS); > } > - ump = VFSTOUFS(mp); > fs = ump->um_fs; > filetype = IFREG; > > @@ -2493,7 +2518,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) > case FFS_ADJ_REFCNT: > #ifdef DEBUG > if (fsckcmds) { > - printf("%s: adjust inode %jd count by %jd\n", > + printf("%s: adjust inode %jd link count by %jd\n", > mp->mnt_stat.f_mntonname, (intmax_t)cmd.value, > (intmax_t)cmd.size); > } > @@ -2504,7 +2529,8 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) > ip->i_nlink += cmd.size; > DIP_SET(ip, i_nlink, ip->i_nlink); > ip->i_effnlink += cmd.size; > - ip->i_flag |= IN_CHANGE; > + ip->i_flag |= IN_CHANGE | IN_MODIFIED; > + error = ffs_update(vp, 1); > if (DOINGSOFTDEP(vp)) > softdep_change_linkcnt(ip); > vput(vp); > @@ -2522,7 +2548,8 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) > break; > ip = VTOI(vp); > DIP_SET(ip, i_blocks, DIP(ip, i_blocks) + cmd.size); > - ip->i_flag |= IN_CHANGE; > + ip->i_flag |= IN_CHANGE | IN_MODIFIED; > + error = ffs_update(vp, 1); > vput(vp); > break; > > @@ -2722,6 +2749,78 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) > UIO_USERSPACE, (ino_t)cmd.size); > break; > > + case FFS_SET_INODE: > + if (ump->um_fsckpid != td->td_proc->p_pid) { > + error = EPERM; > + break; > + } > +#ifdef DEBUG > + if (fsckcmds && outcnt++ < 100) { > + printf("%s: update inode %jd\n", > + mp->mnt_stat.f_mntonname, (intmax_t)cmd.value); > + } > +#endif /* DEBUG */ > + if ((error = ffs_vget(mp, (ino_t)cmd.value, LK_EXCLUSIVE, > &vp))) > + break; > + vfslocked = VFS_LOCK_GIANT(vp->v_mount); > + AUDIT_ARG_VNODE1(vp); > + ip = VTOI(vp); > + if (ip->i_ump->um_fstype == UFS1) > + error = copyin((void *)(intptr_t)cmd.size, > ip->i_din1, > + sizeof(struct ufs1_dinode)); > + else > + error = copyin((void *)(intptr_t)cmd.size, > ip->i_din2, > + sizeof(struct ufs2_dinode)); > + if (error) { > + vput(vp); > + VFS_UNLOCK_GIANT(vfslocked); > + break; > + } > + ip->i_flag |= IN_CHANGE | IN_MODIFIED; > + error = ffs_update(vp, 1); > + vput(vp); > + VFS_UNLOCK_GIANT(vfslocked); > + break; > + > + case FFS_SET_BUFOUTPUT: > + if (ump->um_fsckpid != td->td_proc->p_pid) { > + error = EPERM; > + break; > + } > + if (VTOI(vp)->i_ump != ump) { > + error = EINVAL; > + break; > + } > +#ifdef DEBUG > + if (fsckcmds) { > + printf("%s: %s buffered output for descriptor > %jd\n", > + mp->mnt_stat.f_mntonname, > + cmd.size == 1 ? "enable" : "disable", > + (intmax_t)cmd.value); > + } > +#endif /* DEBUG */ > + if ((error = getvnode(td->td_proc->p_fd, cmd.value, &vfp)) > != 0) > + break; > + if (vfp->f_vnode->v_type != VCHR) { > + fdrop(vfp, td); > + error = EINVAL; > + break; > + } > + if (origops == NULL) { > + origops = vfp->f_ops; > + bcopy((void *)origops, (void *)&bufferedops, > + sizeof(bufferedops)); > + bufferedops.fo_write = buffered_write; > + } > + if (cmd.size == 1) > + atomic_store_rel_ptr((volatile uintptr_t > *)&vfp->f_ops, > + (uintptr_t)&bufferedops); > + else > + atomic_store_rel_ptr((volatile uintptr_t > *)&vfp->f_ops, > + (uintptr_t)origops); > + fdrop(vfp, td); > + break; > + > default: > #ifdef DEBUG > if (fsckcmds) { > @@ -2737,3 +2836,73 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) > vn_finished_write(mp); > return (error); > } > + > +/* > + * Function to switch a descriptor to use the buffer cache to stage > + * its I/O. This is needed so that writes to the filesystem device > + * will give snapshots a chance to copy modified blocks for which it > + * needs to retain copies. > + */ > +static int > +buffered_write(fp, uio, active_cred, flags, td) > + struct file *fp; > + struct uio *uio; > + struct ucred *active_cred; > + int flags; > + struct thread *td; > +{ > Please use ANSI style prototypes for new functions. > > Modified: head/sys/ufs/ffs/ffs_vfsops.c > > ============================================================================== > --- head/sys/ufs/ffs/ffs_vfsops.c Fri Jul 15 15:56:23 2011 > (r224060) > +++ head/sys/ufs/ffs/ffs_vfsops.c Fri Jul 15 16:20:33 2011 > (r224061) > @@ -132,8 +132,8 @@ static struct buf_ops ffs_ops = { > */ > static const char *ffs_opts[] = { "acls", "async", "noatime", > "noclusterr", > "noclusterw", "noexec", "export", "force", "from", "groupquota", > - "multilabel", "nfsv4acls", "snapshot", "nosuid", "suiddir", > "nosymfollow", > - "sync", "union", "userquota", NULL }; > + "multilabel", "nfsv4acls", "fsckpid", "snapshot", "nosuid", "suiddir", > + "nosymfollow", "sync", "union", "userquota", NULL }; > > static int > ffs_mount(struct mount *mp) > @@ -142,6 +142,7 @@ ffs_mount(struct mount *mp) > struct thread *td; > struct ufsmount *ump = 0; > struct fs *fs; > + pid_t fsckpid = 0; > int error, flags; > u_int mntorflags; > accmode_t accmode; > @@ -184,6 +185,29 @@ ffs_mount(struct mount *mp) > vfs_deleteopt(mp->mnt_opt, "snapshot"); > } > > + if (vfs_getopt(mp->mnt_optnew, "fsckpid", NULL, NULL) == 0 && > + vfs_scanopt(mp->mnt_optnew, "fsckpid", "%d", &fsckpid) == 1) { > + /* > + * Once we have set the restricted PID, do not > + * persist "fsckpid" in the options list. > + */ > + vfs_deleteopt(mp->mnt_optnew, "fsckpid"); > + vfs_deleteopt(mp->mnt_opt, "fsckpid"); > + if (mp->mnt_flag & MNT_UPDATE) { > + if (VFSTOUFS(mp)->um_fs->fs_ronly == 0 && > + vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0) == > 0) { > + printf("Checker enable: Must be > read-only\n"); > + return (EINVAL); > + } > + } else if (vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0) == 0) > { > + printf("Checker enable: Must be read-only\n"); > + return (EINVAL); > + } > If you have error messages in an nmount() call, please consider using the vfs_mount_error() function which is in sys/kern/vfs_mount.c. In src/sbin/mount/mount_fs.c, there is an example of how the "errmsg" string can be passed into nmount() from userspace into the kernel in order to retrieve the value of this string. -- Craig Rodrigues rodrigc@crodrigues.org From owner-svn-src-head@FreeBSD.ORG Fri Jul 22 21:08:20 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28598106566B; Fri, 22 Jul 2011 21:08:20 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 18B098FC14; Fri, 22 Jul 2011 21:08:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6ML8JhC032427; Fri, 22 Jul 2011 21:08:19 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6ML8JUL032425; Fri, 22 Jul 2011 21:08:19 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201107222108.p6ML8JUL032425@svn.freebsd.org> From: Doug Barton Date: Fri, 22 Jul 2011 21:08:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224273 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jul 2011 21:08:20 -0000 Author: dougb Date: Fri Jul 22 21:08:19 2011 New Revision: 224273 URL: http://svn.freebsd.org/changeset/base/224273 Log: Revert the apparently-unecessary module_path twiddling from r223917 Approved by: re (kib) Modified: head/etc/rc.d/kld Modified: head/etc/rc.d/kld ============================================================================== --- head/etc/rc.d/kld Fri Jul 22 18:03:33 2011 (r224272) +++ head/etc/rc.d/kld Fri Jul 22 21:08:19 2011 (r224273) @@ -41,24 +41,11 @@ kld_start() { [ -n "$kld_list" ] || return - local _kernel_path _module_path _kld _path - - _kernel_path=`$SYSCTL_N kern.bootfile` - _kernel_path="${_kernel_path%/*}" - - _module_path=`$SYSCTL_N kern.module_path` - _module_path="${_module_path#*\;}" - _module_path="$_kernel_path `ltr $_module_path \; ' '`" + local _kld echo 'Loading kernel modules:' for _kld in $kld_list ; do - for _path in $_module_path ; do - if [ -x "${_path}/${_kld}.ko" ]; then - load_kld -e ${_kld}.ko ${_path}/${_kld}.ko - continue 2 - fi - done - warn "${_kld}.ko not found in $_module_path" + load_kld -e ${_kld}.ko $_kld done } From owner-svn-src-head@FreeBSD.ORG Sat Jul 23 22:11:41 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 311B2106564A; Sat, 23 Jul 2011 22:11:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 210958FC16; Sat, 23 Jul 2011 22:11:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6NMBftT078947; Sat, 23 Jul 2011 22:11:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6NMBfYR078945; Sat, 23 Jul 2011 22:11:41 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201107232211.p6NMBfYR078945@svn.freebsd.org> From: Alexander Motin Date: Sat, 23 Jul 2011 22:11:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224283 - head/sys/cam/ata X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jul 2011 22:11:41 -0000 Author: mav Date: Sat Jul 23 22:11:40 2011 New Revision: 224283 URL: http://svn.freebsd.org/changeset/base/224283 Log: Do not try to execute FLUSHCACHE on close and print extra messages for invalidated (considered lost) ada device. Exactly same already done for the da devices. Approved by: re (kib) MFC after: 1 week Modified: head/sys/cam/ata/ata_da.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Sat Jul 23 18:03:08 2011 (r224282) +++ head/sys/cam/ata/ata_da.c Sat Jul 23 22:11:40 2011 (r224283) @@ -425,7 +425,8 @@ adaclose(struct disk *dp) softc = (struct ada_softc *)periph->softc; /* We only sync the cache if the drive is capable of it. */ - if (softc->flags & ADA_FLAG_CAN_FLUSHCACHE) { + if ((softc->flags & ADA_FLAG_CAN_FLUSHCACHE) != 0 && + (softc->flags & ADA_FLAG_PACK_INVALID) == 0) { ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); cam_fill_ataio(&ccb->ataio, @@ -1361,7 +1362,8 @@ adadone(struct cam_periph *periph, union return; } if (error != 0) { - if (error == ENXIO) { + if (error == ENXIO && + (softc->flags & ADA_FLAG_PACK_INVALID) == 0) { /* * Catastrophic error. Mark our pack as * invalid. From owner-svn-src-head@FreeBSD.ORG Sat Jul 23 22:55:33 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 501F21065670; Sat, 23 Jul 2011 22:55:33 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3DDF78FC08; Sat, 23 Jul 2011 22:55:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p6NMtXPZ080306; Sat, 23 Jul 2011 22:55:33 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p6NMtWNp080295; Sat, 23 Jul 2011 22:55:33 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201107232255.p6NMtWNp080295@svn.freebsd.org> From: Glen Barber Date: Sat, 23 Jul 2011 22:55:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224284 - in head: share/man/man4 share/man/man5 share/man/man8 usr.sbin/faithd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jul 2011 22:55:33 -0000 Author: gjb (doc committer) Date: Sat Jul 23 22:55:32 2011 New Revision: 224284 URL: http://svn.freebsd.org/changeset/base/224284 Log: Fix various broken links in manual pages. Submitted by: Michiel Overtoom (motoom % xs4all nl) PR: 159130 159131 159132 159133 159134 159135 159136 159137 158138 159144 Approved by: re (kib) MFC after: 3 days Modified: head/share/man/man4/dc.4 head/share/man/man4/gif.4 head/share/man/man4/lmc.4 head/share/man/man4/mpt.4 head/share/man/man4/rue.4 head/share/man/man4/stf.4 head/share/man/man4/wi.4 head/share/man/man5/reiserfs.5 head/share/man/man8/crash.8 head/usr.sbin/faithd/faithd.8 Modified: head/share/man/man4/dc.4 ============================================================================== --- head/share/man/man4/dc.4 Sat Jul 23 22:11:40 2011 (r224283) +++ head/share/man/man4/dc.4 Sat Jul 23 22:55:32 2011 (r224284) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2005 +.Dd July 23, 2011 .Dt DC 4 .Os .Sh NAME @@ -357,7 +357,7 @@ the card should be configured correctly. .Re .Rs .%T Davicom DM9102 data sheet -.%U http://www.davicom8.com +.%U http://www.davicom.com.tw/userfile/24247/DM9102H-DS-F01-021508.pdf .Re .Rs .%T Intel 21143 Hardware Reference Manual Modified: head/share/man/man4/gif.4 ============================================================================== --- head/share/man/man4/gif.4 Sat Jul 23 22:11:40 2011 (r224283) +++ head/share/man/man4/gif.4 Sat Jul 23 22:55:32 2011 (r224284) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 8, 2009 +.Dd July 23, 2011 .Dt GIF 4 .Os .Sh NAME @@ -198,7 +198,7 @@ to 1. .%B RFC2893 .%T Transition Mechanisms for IPv6 Hosts and Routers .%D August 2000 -.%U ftp://ftp.isi.edu/in-notes/rfc2893.txt +.%U http://www.ietf.org/rfc/rfc2893.txt .Re .Rs .%A Sally Floyd Modified: head/share/man/man4/lmc.4 ============================================================================== --- head/share/man/man4/lmc.4 Sat Jul 23 22:11:40 2011 (r224283) +++ head/share/man/man4/lmc.4 Sat Jul 23 22:55:32 2011 (r224284) @@ -43,7 +43,7 @@ .\" this program; if not, write to the Free Software Foundation, Inc., 59 .\" Temple Place - Suite 330, Boston, MA 02111-1307, USA. .\" -.Dd May 20, 2006 +.Dd July 23, 2011 .Dt LMC 4 .Os .\" @@ -723,8 +723,6 @@ Thus, cable length does not affect data/ .Xr ngctl 8 , .Xr ping 8 , .Xr ifnet 9 -.Pp -.Pa http://www.sbei.com/ .\" .Sh HISTORY .\" Modified: head/share/man/man4/mpt.4 ============================================================================== --- head/share/man/man4/mpt.4 Sat Jul 23 22:11:40 2011 (r224283) +++ head/share/man/man4/mpt.4 Sat Jul 23 22:55:32 2011 (r224284) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 13, 2010 +.Dd July 23, 2011 .Dt MPT 4 .Os .Sh NAME @@ -161,7 +161,7 @@ can take on - no separate compilation is .Xr gmultipath 8 .Rs .%T "LSI Logic Website" -.%U http://www.lsilogic.com/ +.%U http://www.lsi.com/ .Re .Sh HISTORY The Modified: head/share/man/man4/rue.4 ============================================================================== --- head/share/man/man4/rue.4 Sat Jul 23 22:11:40 2011 (r224283) +++ head/share/man/man4/rue.4 Sat Jul 23 22:55:32 2011 (r224284) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 16, 2005 +.Dd July 23, 2011 .Dt RUE 4 .Os .Sh NAME @@ -139,8 +139,8 @@ The driver failed to allocate an mbuf fo .Xr ng_ether 4 , .Xr ifconfig 8 .Rs -.%T "ReakTek RTL8150 data sheet" -.%U ftp://ftp.realtek.com.tw/lancard/data_sheet/8150/ +.%T "RealTek RTL8150 data sheet" +.%U http://pdf.seekdatasheet.com/2008714/200807142333305235.pdf .Re .Sh HISTORY The Modified: head/share/man/man4/stf.4 ============================================================================== --- head/share/man/man4/stf.4 Sat Jul 23 22:11:40 2011 (r224283) +++ head/share/man/man4/stf.4 Sat Jul 23 22:55:32 2011 (r224284) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 27, 2001 +.Dd July 23, 2011 .Dt STF 4 .Os .Sh NAME @@ -230,7 +230,7 @@ and not to use your 6to4 prefix as a sou .Xr inet 4 , .Xr inet6 4 .Pp -.Pa http://www.6bone.net/6bone_6to4.html +.Pa http://www.ipv6day.org/action.php?n=En.IPv6day .Rs .%A Brian Carpenter .%A Keith Moore Modified: head/share/man/man4/wi.4 ============================================================================== --- head/share/man/man4/wi.4 Sat Jul 23 22:11:40 2011 (r224283) +++ head/share/man/man4/wi.4 Sat Jul 23 22:55:32 2011 (r224284) @@ -31,7 +31,7 @@ .\" $FreeBSD$ .\" $OpenBSD: wi.4tbl,v 1.14 2002/04/29 19:53:50 jsyn Exp $ .\" -.Dd January 4, 2010 +.Dd July 23, 2011 .Dt WI 4 .Os .Sh NAME @@ -319,7 +319,7 @@ command. .Xr wpa_supplicant 8 . .Rs .%T HCF Light programming specification -.%U http://www.wavelan.com +.%U http://web.archive.org/web/20040130141721/http://wavelan.com/ .Re .Sh HISTORY The Modified: head/share/man/man5/reiserfs.5 ============================================================================== --- head/share/man/man5/reiserfs.5 Sat Jul 23 22:11:40 2011 (r224283) +++ head/share/man/man5/reiserfs.5 Sat Jul 23 22:55:32 2011 (r224284) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 16, 2006 +.Dd July 23, 2011 .Dt REISERFS 5 .Os .Sh NAME @@ -71,7 +71,6 @@ first appeared in .An -nosplit The ReiserFS kernel implementation was written by .An Hans Reiser -.Pq Pa http://www.namesys.com/ , and ported to .Fx by Modified: head/share/man/man8/crash.8 ============================================================================== --- head/share/man/man8/crash.8 Sat Jul 23 22:11:40 2011 (r224283) +++ head/share/man/man8/crash.8 Sat Jul 23 22:55:32 2011 (r224284) @@ -36,7 +36,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 2, 1996 +.Dd July 23, 2011 .Dt CRASH 8 .Os .Sh NAME @@ -207,7 +207,7 @@ the panic message is printed. For more details consult the chapter on kernel debugging in the .%B "FreeBSD Developers' Handbook" -.Pq Pa http://www.FreeBSD.org/ . +.Pq Pa http://www.freebsd.org/doc/en/books/developers-handbook/ . .Sh SEE ALSO .Xr kgdb 1 , .Xr dumpon 8 , Modified: head/usr.sbin/faithd/faithd.8 ============================================================================== --- head/usr.sbin/faithd/faithd.8 Sat Jul 23 22:11:40 2011 (r224283) +++ head/usr.sbin/faithd/faithd.8 Sat Jul 23 22:55:32 2011 (r224284) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 9, 2010 +.Dd July 23, 2011 .Dt FAITHD 8 .Os .Sh NAME @@ -368,7 +368,7 @@ setting. .%A Kazu Yamamoto .%T "An IPv6-to-IPv4 transport relay translator" .%B RFC3142 -.%U ftp://ftp.isi.edu/in-notes/rfc3142.txt +.%U http://www.ietf.org/rfc/rfc3142.txt .%D June 2001 .Re .\"