From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 00:14:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8C5C106566B; Sun, 8 Jan 2012 00:14:45 +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 CC0198FC13; Sun, 8 Jan 2012 00:14: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 q080EjpH062394; Sun, 8 Jan 2012 00:14:45 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q080EjHG062392; Sun, 8 Jan 2012 00:14:45 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201201080014.q080EjHG062392@svn.freebsd.org> From: Hiroki Sato Date: Sun, 8 Jan 2012 00:14:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229797 - stable/9/release/doc/en_US.ISO8859-1/relnotes X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 00:14:46 -0000 Author: hrs Date: Sun Jan 8 00:14:45 2012 New Revision: 229797 URL: http://svn.freebsd.org/changeset/base/229797 Log: - Add relnotes items: nfe(4) reinit issue fixed, re(4) RX int moderation changed from int taskq to one-shot timer, re(4) TSO disabled by default, re(4) RTL8105E support, and rlphy(4) RTL8201E support. Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Sat Jan 7 23:47:09 2012 (r229796) +++ stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Sun Jan 8 00:14:45 2012 (r229797) @@ -225,6 +225,10 @@ fixed. It could prevent the RX checksum offloading from working. + A bug in &man.nfe.4; driver which + could prevent reinitialization after changing the MTU has + been fixed. + A bug in &man.ral.4; and &man.run.4; drivers which could prevent hostap mode from working has been fixed. @@ -235,11 +239,31 @@ The &man.re.4; driver now supports RTL8168E/8111E-VL PCIe Gigabit Ethernet controllers. - The &man.re.4; driver now supports - TSO (TCP Segmentation Offload) on RealTek RTL8168/8111 C - or later controllers. Note that this is disabled by - default on some old devices because broken frames can be - sent under certain conditions. + The &man.re.4; driver now supports + TX interrupt moderation on RTL810xE PCIe Fast Ethernet + controllers. + + The &man.re.4; driver now supports + another mechanism for RX interrupt moderation because of + performance problem. A &man.sysctl.8; variable + dev.re.N.int_rx_mod + has been added to control amount of time to delay RX + interrupt processing in units of microsecond. Setting it + to 0 completely disables RX interrupt + moderation. A &man.loader.8; tunable + hw.re.intr_filter controls whether the + old mechanism utilizing MSI/MSI-X capability on the + supported controllers is used or not. When setting it to + a non-zero value, the &man.re.4; driver uses the old + mechanism. The default value is 0 and + this tunable has no effect on controllers without MSI/MSI-X + capability. + + The &man.re.4; driver now + supports TSO (TCP Segmentation Offload) on RealTek + RTL8168/8111 C or later controllers. Note that this is + disabled by default because broken frames can be sent + under certain conditions. The &man.re.4; driver now supports enabling TX and/or RX checksum offloading independently @@ -250,11 +274,18 @@ frame on an RTL8169C, 8169D, or 8169E controller-based network interface. + The &man.re.4; driver now support + RTL8105E PCIe Fast Ethernet controller. + + The rlphy(4) driver now support + Realtek RTL8201E 10/100 PHY found in RTL8105E + controller. + A bug in the &man.sis.4; driver has been changed. It could prevent a proper reinitialization on DP83815, DP83816, and SiS 900/7016 controllers when configuration of multicast packet handling and/or - promiscus mode is changed. + promiscuous mode is changed. A bug in &man.vlan.4; pseudo interface han been fixed. It could have a random interface @@ -387,10 +418,10 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile A bug in the &man.sh.1; program has been fixed. When a foreground job exits on a signal, a message is - printed to stdout about this. The buffer was not flushed after - this which could result in the message being written to the - wrong file if the next command was a builtin and had stdout - redirected. + printed to stdout about this. The buffer + was not flushed after this which could result in the message + being written to the wrong file if the next command was a + builtin and had stdout redirected. The &man.sh.1; program now supports a flag in trap command to From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 00:34:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F09B1065672; Sun, 8 Jan 2012 00:34:40 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3DBF28FC0A; Sun, 8 Jan 2012 00:34: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 q080YePk063047; Sun, 8 Jan 2012 00:34:40 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q080YeQn063045; Sun, 8 Jan 2012 00:34:40 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201201080034.q080YeQn063045@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sun, 8 Jan 2012 00:34: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: r229798 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 00:34:40 -0000 Author: gonzo Date: Sun Jan 8 00:34:39 2012 New Revision: 229798 URL: http://svn.freebsd.org/changeset/base/229798 Log: Fix DDB x/i addr[,count] command for count > 1 case Modified: head/sys/mips/mips/db_disasm.c Modified: head/sys/mips/mips/db_disasm.c ============================================================================== --- head/sys/mips/mips/db_disasm.c Sun Jan 8 00:14:45 2012 (r229797) +++ head/sys/mips/mips/db_disasm.c Sun Jan 8 00:34:39 2012 (r229798) @@ -388,5 +388,6 @@ md_printins(int ins, int mdbdot) reg_name[i.IType.rt], reg_name[i.IType.rs], (short)i.IType.imm); } + db_printf("\n"); return (delay); } From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 00:42:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D67A106566B; Sun, 8 Jan 2012 00:42:08 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 00B7E8FC0A; Sun, 8 Jan 2012 00:42:08 +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 q080g7sT063297; Sun, 8 Jan 2012 00:42:07 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q080g7nD063295; Sun, 8 Jan 2012 00:42:07 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201201080042.q080g7nD063295@svn.freebsd.org> From: Rick Macklem Date: Sun, 8 Jan 2012 00:42:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229799 - stable/9/sys/fs/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 00:42:08 -0000 Author: rmacklem Date: Sun Jan 8 00:42:07 2012 New Revision: 229799 URL: http://svn.freebsd.org/changeset/base/229799 Log: MFC: r228260 This patch adds a sysctl to the NFSv4 server which optionally disables the check for a UTF-8 compliant file name. Enabling this sysctl results in an NFSv4 server that is non-RFC3530 compliant, therefore it is not enabled by default. However, enabling this sysctl results in NFSv3 compatible behaviour and fixes the problem reported by "dan at sunsaturn.com" to freebsd-current@ on Nov. 14, 2011 under the subject "NFSV4 readlink_stat". Modified: stable/9/sys/fs/nfsserver/nfs_nfsdsubs.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/fs/nfsserver/nfs_nfsdsubs.c ============================================================================== --- stable/9/sys/fs/nfsserver/nfs_nfsdsubs.c Sun Jan 8 00:34:39 2012 (r229798) +++ stable/9/sys/fs/nfsserver/nfs_nfsdsubs.c Sun Jan 8 00:42:07 2012 (r229799) @@ -56,6 +56,13 @@ static nfstype newnfsv2_type[9] = { NFNO extern nfstype nfsv34_type[9]; #endif /* !APPLEKEXT */ +SYSCTL_DECL(_vfs_nfsd); + +static int disable_checkutf8 = 0; +SYSCTL_INT(_vfs_nfsd, OID_AUTO, disable_checkutf8, CTLFLAG_RW, + &disable_checkutf8, 0, + "Disable the NFSv4 check for a UTF8 compliant name"); + static char nfsrv_hexdigit(char, int *); /* @@ -1963,7 +1970,8 @@ nfsrv_parsename(struct nfsrv_descript *n error = 0; goto nfsmout; } - if (nfsrv_checkutf8((u_int8_t *)bufp, outlen)) { + if (disable_checkutf8 == 0 && + nfsrv_checkutf8((u_int8_t *)bufp, outlen)) { nd->nd_repstat = NFSERR_INVAL; error = 0; goto nfsmout; From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 00:55:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC4C7106566B; Sun, 8 Jan 2012 00:55:22 +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 DB30D8FC08; Sun, 8 Jan 2012 00:55: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 q080tM3p063810; Sun, 8 Jan 2012 00:55:22 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q080tMlJ063808; Sun, 8 Jan 2012 00:55:22 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201080055.q080tMlJ063808@svn.freebsd.org> From: Adrian Chadd Date: Sun, 8 Jan 2012 00:55: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: r229800 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 00:55:23 -0000 Author: adrian Date: Sun Jan 8 00:55:22 2012 New Revision: 229800 URL: http://svn.freebsd.org/changeset/base/229800 Log: Make these two files conditionally build on UFS_ACL, as it doesn't seem to be used elsewhere. Since UFS_ACL is enabled by default for GENERIC kernels, this shouldn't break anything - but please beat me to fix things if it does. This reduces the footprint of the kernel on small embedded systems (think <1MB flash for the compressed kernel image) just enough to actually fit. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Jan 8 00:42:07 2012 (r229799) +++ head/sys/conf/files Sun Jan 8 00:55:22 2012 (r229800) @@ -2409,8 +2409,9 @@ kern/sched_ule.c optional sched_ule kern/serdev_if.m standard kern/stack_protector.c standard \ compile-with "${NORMAL_C:N-fstack-protector*}" -kern/subr_acl_nfs4.c standard -kern/subr_acl_posix1e.c standard +# XXX subr_acl_nfs4.c is also used by ZFS +kern/subr_acl_nfs4.c optional ufs_acl +kern/subr_acl_posix1e.c optional ufs_acl kern/subr_autoconf.c standard kern/subr_blist.c standard kern/subr_bus.c standard From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 01:09:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84A15106566B; Sun, 8 Jan 2012 01:09:00 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7268A8FC14; Sun, 8 Jan 2012 01:09: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 q08190Ol064266; Sun, 8 Jan 2012 01:09:00 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q08190J0064264; Sun, 8 Jan 2012 01:09:00 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201201080109.q08190J0064264@svn.freebsd.org> From: Rick Macklem Date: Sun, 8 Jan 2012 01:09:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229801 - stable/8/sys/fs/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 01:09:00 -0000 Author: rmacklem Date: Sun Jan 8 01:09:00 2012 New Revision: 229801 URL: http://svn.freebsd.org/changeset/base/229801 Log: MFC: r228260 This patch adds a sysctl to the NFSv4 server which optionally disables the check for a UTF-8 compliant file name. Enabling this sysctl results in an NFSv4 server that is non-RFC3530 compliant, therefore it is not enabled by default. However, enabling this sysctl results in NFSv3 compatible behaviour and fixes the problem reported by "dan at sunsaturn.com" to freebsd-current@ on Nov. 14, 2011 under the subject "NFSV4 readlink_stat". Modified: stable/8/sys/fs/nfsserver/nfs_nfsdsubs.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdsubs.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdsubs.c Sun Jan 8 00:55:22 2012 (r229800) +++ stable/8/sys/fs/nfsserver/nfs_nfsdsubs.c Sun Jan 8 01:09:00 2012 (r229801) @@ -56,6 +56,13 @@ static nfstype newnfsv2_type[9] = { NFNO extern nfstype nfsv34_type[9]; #endif /* !APPLEKEXT */ +SYSCTL_DECL(_vfs_nfsd); + +static int disable_checkutf8 = 0; +SYSCTL_INT(_vfs_nfsd, OID_AUTO, disable_checkutf8, CTLFLAG_RW, + &disable_checkutf8, 0, + "Disable the NFSv4 check for a UTF8 compliant name"); + static char nfsrv_hexdigit(char, int *); /* @@ -1963,7 +1970,8 @@ nfsrv_parsename(struct nfsrv_descript *n error = 0; goto nfsmout; } - if (nfsrv_checkutf8((u_int8_t *)bufp, outlen)) { + if (disable_checkutf8 == 0 && + nfsrv_checkutf8((u_int8_t *)bufp, outlen)) { nd->nd_repstat = NFSERR_INVAL; error = 0; goto nfsmout; From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 01:54:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BC1E106566B; Sun, 8 Jan 2012 01:54:47 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E41FB8FC08; Sun, 8 Jan 2012 01:54:46 +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 q081sk2c065630; Sun, 8 Jan 2012 01:54:46 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q081sk8V065624; Sun, 8 Jan 2012 01:54:46 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201201080154.q081sk8V065624@svn.freebsd.org> From: Rick Macklem Date: Sun, 8 Jan 2012 01:54:46 +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: r229802 - in head/sys/fs: nfs nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 01:54:47 -0000 Author: rmacklem Date: Sun Jan 8 01:54:46 2012 New Revision: 229802 URL: http://svn.freebsd.org/changeset/base/229802 Log: opt_inet6.h was missing from some files in the new NFS subsystem. The effect of this was, for clients mounted via inet6 addresses, that the DRC cache would never have a hit in the server. It also broke NFSv4 callbacks when an inet6 address was the only one available in the client. This patch fixes the above, plus deletes opt_inet6.h from a couple of files it is not needed for. MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs_commonkrpc.c head/sys/fs/nfs/nfs_commonsubs.c head/sys/fs/nfsclient/nfs_clkrpc.c head/sys/fs/nfsclient/nfs_clport.c head/sys/fs/nfsclient/nfs_clrpcops.c Modified: head/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- head/sys/fs/nfs/nfs_commonkrpc.c Sun Jan 8 01:09:00 2012 (r229801) +++ head/sys/fs/nfs/nfs_commonkrpc.c Sun Jan 8 01:54:46 2012 (r229802) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); * Socket operations for use by nfs */ -#include "opt_inet6.h" #include "opt_kdtrace.h" #include "opt_kgssapi.h" #include "opt_nfs.h" Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Sun Jan 8 01:09:00 2012 (r229801) +++ head/sys/fs/nfs/nfs_commonsubs.c Sun Jan 8 01:54:46 2012 (r229802) @@ -40,6 +40,8 @@ __FBSDID("$FreeBSD$"); * copy data between mbuf chains and uio lists. */ #ifndef APPLEKEXT +#include "opt_inet6.h" + #include /* Modified: head/sys/fs/nfsclient/nfs_clkrpc.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clkrpc.c Sun Jan 8 01:09:00 2012 (r229801) +++ head/sys/fs/nfsclient/nfs_clkrpc.c Sun Jan 8 01:54:46 2012 (r229802) @@ -34,7 +34,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_inet6.h" #include "opt_kgssapi.h" #include Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Sun Jan 8 01:09:00 2012 (r229801) +++ head/sys/fs/nfsclient/nfs_clport.c Sun Jan 8 01:54:46 2012 (r229802) @@ -34,6 +34,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_inet6.h" #include "opt_kdtrace.h" #include Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Sun Jan 8 01:09:00 2012 (r229801) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Sun Jan 8 01:54:46 2012 (r229802) @@ -43,6 +43,8 @@ __FBSDID("$FreeBSD$"); */ #ifndef APPLEKEXT +#include "opt_inet6.h" + #include /* From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 05:44:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22F95106566B; Sun, 8 Jan 2012 05:44:20 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 11F538FC0A; Sun, 8 Jan 2012 05:44: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 q085iJBU072874; Sun, 8 Jan 2012 05:44:19 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q085iJUZ072872; Sun, 8 Jan 2012 05:44:19 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201201080544.q085iJUZ072872@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sun, 8 Jan 2012 05:44: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: r229803 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 05:44:20 -0000 Author: gonzo Date: Sun Jan 8 05:44:19 2012 New Revision: 229803 URL: http://svn.freebsd.org/changeset/base/229803 Log: Fix relocations for MIPS64: - Use Elf32_Addr as default, the only field that is 64 bitw wide is R_MIPS_64 - Add R_MIPS_HIGHER and R_MIPS_HGHEST handlers - Handle R_MIPS_HI16 and R_MIPS_LO16 for both .rel and .rela sections Modified: head/sys/mips/mips/elf_machdep.c Modified: head/sys/mips/mips/elf_machdep.c ============================================================================== --- head/sys/mips/mips/elf_machdep.c Sun Jan 8 01:54:46 2012 (r229802) +++ head/sys/mips/mips/elf_machdep.c Sun Jan 8 05:44:19 2012 (r229803) @@ -168,25 +168,41 @@ static int elf_reloc_internal(linker_file_t lf, Elf_Addr relocbase, const void *data, int type, int local, elf_lookup_fn lookup) { - Elf_Addr *where = (Elf_Addr *)NULL; + Elf32_Addr *where = (Elf32_Addr *)NULL; Elf_Addr addr; Elf_Addr addend = (Elf_Addr)0; Elf_Word rtype = (Elf_Word)0, symidx; - const Elf_Rel *rel; + const Elf_Rel *rel = NULL; + const Elf_Rela *rela = NULL; /* * Stash R_MIPS_HI16 info so we can use it when processing R_MIPS_LO16 */ static Elf_Addr ahl; - static Elf_Addr *where_hi16; + static Elf32_Addr *where_hi16; switch (type) { case ELF_RELOC_REL: rel = (const Elf_Rel *)data; - where = (Elf_Addr *) (relocbase + rel->r_offset); - addend = *where; + where = (Elf32_Addr *) (relocbase + rel->r_offset); rtype = ELF_R_TYPE(rel->r_info); symidx = ELF_R_SYM(rel->r_info); + switch (rtype) { + case R_MIPS_64: + addend = *(Elf64_Addr *)where; + break; + default: + addend = *where; + break; + } + + break; + case ELF_RELOC_RELA: + rela = (const Elf_Rela *)data; + where = (Elf32_Addr *) (relocbase + rela->r_offset); + addend = rela->r_addend; + rtype = ELF_R_TYPE(rela->r_info); + symidx = ELF_R_SYM(rela->r_info); break; default: panic("unknown reloc type %d\n", type); @@ -202,7 +218,7 @@ elf_reloc_internal(linker_file_t lf, Elf return (-1); addr += addend; if (*where != addr) - *where = addr; + *where = (Elf32_Addr)addr; break; case R_MIPS_26: /* ((A << 2) | (P & 0xf0000000) + S) >> 2 */ @@ -220,25 +236,73 @@ elf_reloc_internal(linker_file_t lf, Elf *where |= addr & 0x03ffffff; break; + case R_MIPS_64: /* S + A */ + addr = lookup(lf, symidx, 1); + if (addr == 0) + return (-1); + addr += addend; + if (*(Elf64_Addr*)where != addr) + *(Elf64_Addr*)where = addr; + break; + case R_MIPS_HI16: /* ((AHL + S) - ((short)(AHL + S)) >> 16 */ - ahl = addend << 16; - where_hi16 = where; + if (rela != NULL) { + addr = lookup(lf, symidx, 1); + if (addr == 0) + return (-1); + addr += addend; + *where &= 0xffff0000; + *where |= ((((long long) addr + 0x8000LL) >> 16) & 0xffff); + } + else { + ahl = addend << 16; + where_hi16 = where; + } break; case R_MIPS_LO16: /* AHL + S */ - ahl += (int16_t)addend; + if (rela != NULL) { + addr = lookup(lf, symidx, 1); + if (addr == 0) + return (-1); + addr += addend; + *where &= 0xffff0000; + *where |= addr & 0xffff; + } + else { + ahl += (int16_t)addend; + addr = lookup(lf, symidx, 1); + if (addr == 0) + return (-1); + + addend &= 0xffff0000; + addend |= (uint16_t)(ahl + addr); + *where = addend; + + addend = *where_hi16; + addend &= 0xffff0000; + addend |= ((ahl + addr) - (int16_t)(ahl + addr)) >> 16; + *where_hi16 = addend; + } + + break; + + case R_MIPS_HIGHER: /* %higher(A+S) */ addr = lookup(lf, symidx, 1); if (addr == 0) return (-1); + addr += addend; + *where &= 0xffff0000; + *where |= (((long long)addr + 0x80008000LL) >> 32) & 0xffff; + break; - addend &= 0xffff0000; - addend |= (uint16_t)(ahl + addr); - *where = addend; - - addend = *where_hi16; - addend &= 0xffff0000; - addend |= ((ahl + addr) - (int16_t)(ahl + addr)) >> 16; - *where_hi16 = addend; + case R_MIPS_HIGHEST: /* %highest(A+S) */ + addr = lookup(lf, symidx, 1); + if (addr == 0) + return (-1); + addr += addend; + *where &= 0xffff0000; + *where |= (((long long)addr + 0x800080008000LL) >> 48) & 0xffff; break; default: @@ -246,6 +310,7 @@ elf_reloc_internal(linker_file_t lf, Elf rtype); return (-1); } + return(0); } From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 07:51:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFEE3106566C; Sun, 8 Jan 2012 07:51:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 509978FC0A; Sun, 8 Jan 2012 07: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 q087pfHl076753; Sun, 8 Jan 2012 07:51:41 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q087pfXn076751; Sun, 8 Jan 2012 07:51:41 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201080751.q087pfXn076751@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 8 Jan 2012 07:51:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229804 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 07:51:43 -0000 Author: kib Date: Sun Jan 8 07:51:40 2012 New Revision: 229804 URL: http://svn.freebsd.org/changeset/base/229804 Log: MFC r229185: Avoid double-unlock or double unreference for ndp->ni_dvp when the vnode dp lock upgrade right after the 'success' label fails. Modified: stable/9/sys/kern/vfs_lookup.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_lookup.c ============================================================================== --- stable/9/sys/kern/vfs_lookup.c Sun Jan 8 05:44:19 2012 (r229803) +++ stable/9/sys/kern/vfs_lookup.c Sun Jan 8 07:51:40 2012 (r229804) @@ -498,12 +498,14 @@ lookup(struct nameidata *ndp) int dvfslocked; /* VFS Giant state for parent */ int tvfslocked; int lkflags_save; + int ni_dvp_unlocked; /* * Setup: break out flag bits into variables. */ dvfslocked = (ndp->ni_cnd.cn_flags & GIANTHELD) != 0; vfslocked = 0; + ni_dvp_unlocked = 0; ndp->ni_cnd.cn_flags &= ~GIANTHELD; wantparent = cnp->cn_flags & (LOCKPARENT | WANTPARENT); KASSERT(cnp->cn_nameiop == LOOKUP || wantparent, @@ -847,8 +849,10 @@ unionlookup: /* * Symlink code always expects an unlocked dvp. */ - if (ndp->ni_dvp != ndp->ni_vp) + if (ndp->ni_dvp != ndp->ni_vp) { VOP_UNLOCK(ndp->ni_dvp, 0); + ni_dvp_unlocked = 1; + } goto success; } @@ -895,14 +899,17 @@ nextname: VREF(ndp->ni_startdir); } if (!wantparent) { + ni_dvp_unlocked = 2; if (ndp->ni_dvp != dp) vput(ndp->ni_dvp); else vrele(ndp->ni_dvp); VFS_UNLOCK_GIANT(dvfslocked); dvfslocked = 0; - } else if ((cnp->cn_flags & LOCKPARENT) == 0 && ndp->ni_dvp != dp) + } else if ((cnp->cn_flags & LOCKPARENT) == 0 && ndp->ni_dvp != dp) { VOP_UNLOCK(ndp->ni_dvp, 0); + ni_dvp_unlocked = 1; + } if (cnp->cn_flags & AUDITVNODE1) AUDIT_ARG_VNODE1(dp); @@ -931,10 +938,12 @@ success: return (0); bad2: - if (dp != ndp->ni_dvp) - vput(ndp->ni_dvp); - else - vrele(ndp->ni_dvp); + if (ni_dvp_unlocked != 2) { + if (dp != ndp->ni_dvp && !ni_dvp_unlocked) + vput(ndp->ni_dvp); + else + vrele(ndp->ni_dvp); + } bad: if (!dpunlocked) vput(dp); From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 08:04:40 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1EC7E106564A; Sun, 8 Jan 2012 08:04:40 +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 C6B428FC12; Sun, 8 Jan 2012 08:04:38 +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 KAA14950; Sun, 08 Jan 2012 10:04:36 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Rjnk4-0001Fm-4e; Sun, 08 Jan 2012 10:04:36 +0200 Message-ID: <4F094E11.4010007@FreeBSD.org> Date: Sun, 08 Jan 2012 10:04:33 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: Xin LI References: <201201032017.q03KHZ0Z040723@svn.freebsd.org> In-Reply-To: <201201032017.q03KHZ0Z040723@svn.freebsd.org> X-Enigmail-Version: undefined 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: r229416 - head/sys/dev/tws X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 08:04:40 -0000 on 03/01/2012 22:17 Xin LI said the following: > Author: delphij > Date: Tue Jan 3 20:17:35 2012 > New Revision: 229416 > URL: http://svn.freebsd.org/changeset/base/229416 > > Log: > Don't forget to release queue lock when allocation of memory failed. > > Submitted by: Sascha Wildner > Obtained from: DragonFly > MFC after: 2 weeks > > Modified: > head/sys/dev/tws/tws.c > > Modified: head/sys/dev/tws/tws.c > ============================================================================== > --- head/sys/dev/tws/tws.c Tue Jan 3 19:47:32 2012 (r229415) > +++ head/sys/dev/tws/tws.c Tue Jan 3 20:17:35 2012 (r229416) > @@ -685,6 +685,7 @@ tws_init_reqs(struct tws_softc *sc, u_in > { > if (bus_dmamap_create(sc->data_tag, 0, &sc->reqs[i].dma_map)) { > /* log a ENOMEM failure msg here */ > + mtx_unlock(&sc->q_lock); At least here it looks like the new line has inconsistent whitespace indentation. > return(FAILURE); > } > sc->reqs[i].cmd_pkt = &cmd_buf[i]; -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 09:56:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 904F91065670; Sun, 8 Jan 2012 09:56:25 +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 7E17A8FC12; Sun, 8 Jan 2012 09:56: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 q089uP62080610; Sun, 8 Jan 2012 09:56:25 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q089uP5u080604; Sun, 8 Jan 2012 09:56:25 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201201080956.q089uP5u080604@svn.freebsd.org> From: Michael Tuexen Date: Sun, 8 Jan 2012 09:56:25 +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: r229805 - in head/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 09:56:25 -0000 Author: tuexen Date: Sun Jan 8 09:56:24 2012 New Revision: 229805 URL: http://svn.freebsd.org/changeset/base/229805 Log: Add an SCTP sysctl "blackhole", similar to the one for TCP. If set to 1, no ABORT is sent back in response to an incoming INIT. If set to 2, no ABORT is sent back in response to an out of the blue packet. If set to 0 (the default), ABORTs are sent. Discussed with rrs@. MFC after: 1 month. Modified: head/sys/netinet/sctp_input.c head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_sysctl.h head/sys/netinet/sctputil.c head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sun Jan 8 07:51:40 2012 (r229804) +++ head/sys/netinet/sctp_input.c Sun Jan 8 09:56:24 2012 (r229805) @@ -170,8 +170,9 @@ sctp_handle_init(struct mbuf *m, int iph * accepts(). The App just looses and should NOT be in this * state :-) */ - sctp_abort_association(inp, stcb, m, iphlen, sh, NULL, - vrf_id, port); + if (SCTP_BASE_SYSCTL(sctp_blackhole) == 0) { + sctp_send_abort(m, iphlen, sh, 0, NULL, vrf_id, port); + } goto outnow; } if ((stcb != NULL) && @@ -5927,8 +5928,13 @@ sctp_skip_csum_4: if (ch->chunk_type == SCTP_SHUTDOWN_COMPLETE) { goto bad; } - if (ch->chunk_type != SCTP_ABORT_ASSOCIATION) - sctp_send_abort(m, iphlen, sh, 0, NULL, vrf_id, port); + if (ch->chunk_type != SCTP_ABORT_ASSOCIATION) { + if ((SCTP_BASE_SYSCTL(sctp_blackhole) == 0) || + ((SCTP_BASE_SYSCTL(sctp_blackhole) == 1) && + (ch->chunk_type != SCTP_INIT))) { + sctp_send_abort(m, iphlen, sh, 0, NULL, vrf_id, port); + } + } goto bad; } else if (stcb == NULL) { refcount_up = 1; Modified: head/sys/netinet/sctp_sysctl.c ============================================================================== --- head/sys/netinet/sctp_sysctl.c Sun Jan 8 07:51:40 2012 (r229804) +++ head/sys/netinet/sctp_sysctl.c Sun Jan 8 09:56:24 2012 (r229805) @@ -117,6 +117,7 @@ sctp_init_sysctls() SCTP_BASE_SYSCTL(sctp_rttvar_eqret) = SCTPCTL_RTTVAR_EQRET_DEFAULT; SCTP_BASE_SYSCTL(sctp_steady_step) = SCTPCTL_RTTVAR_STEADYS_DEFAULT; SCTP_BASE_SYSCTL(sctp_use_dccc_ecn) = SCTPCTL_RTTVAR_DCCCECN_DEFAULT; + SCTP_BASE_SYSCTL(sctp_blackhole) = SCTPCTL_BLACKHOLE_DEFAULT; #if defined(SCTP_LOCAL_TRACE_BUF) memset(&SCTP_BASE_SYSCTL(sctp_log), 0, sizeof(struct sctp_log)); @@ -665,6 +666,7 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) RANGECHK(SCTP_BASE_SYSCTL(sctp_mobility_fasthandoff), SCTPCTL_MOBILITY_FASTHANDOFF_MIN, SCTPCTL_MOBILITY_FASTHANDOFF_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_enable_sack_immediately), SCTPCTL_SACK_IMMEDIATELY_ENABLE_MIN, SCTPCTL_SACK_IMMEDIATELY_ENABLE_MAX); RANGECHK(SCTP_BASE_SYSCTL(sctp_inits_include_nat_friendly), SCTPCTL_NAT_FRIENDLY_INITS_MIN, SCTPCTL_NAT_FRIENDLY_INITS_MAX); + RANGECHK(SCTP_BASE_SYSCTL(sctp_blackhole), SCTPCTL_BLACKHOLE_MIN, SCTPCTL_BLACKHOLE_MAX); #ifdef SCTP_DEBUG RANGECHK(SCTP_BASE_SYSCTL(sctp_debug_on), SCTPCTL_DEBUG_MIN, SCTPCTL_DEBUG_MAX); @@ -1123,6 +1125,10 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUT &SCTP_BASE_SYSCTL(sctp_use_dccc_ecn), 0, sysctl_sctp_check, "IU", SCTPCTL_RTTVAR_DCCCECN_DESC); +SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, blackhole, CTLTYPE_UINT | CTLFLAG_RW, + &SCTP_BASE_SYSCTL(sctp_blackhole), 0, sysctl_sctp_check, "IU", + SCTPCTL_BLACKHOLE_DESC); + #ifdef SCTP_DEBUG SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, debug, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_debug_on), 0, sysctl_sctp_check, "IU", Modified: head/sys/netinet/sctp_sysctl.h ============================================================================== --- head/sys/netinet/sctp_sysctl.h Sun Jan 8 07:51:40 2012 (r229804) +++ head/sys/netinet/sctp_sysctl.h Sun Jan 8 09:56:24 2012 (r229805) @@ -114,6 +114,7 @@ struct sctp_sysctl { uint32_t sctp_vtag_time_wait; uint32_t sctp_buffer_splitting; uint32_t sctp_initial_cwnd; + uint32_t sctp_blackhole; #if defined(SCTP_DEBUG) uint32_t sctp_debug_on; #endif @@ -519,6 +520,11 @@ struct sctp_sysctl { #define SCTPCTL_RTTVAR_DCCCECN_MAX 1 #define SCTPCTL_RTTVAR_DCCCECN_DEFAULT 1 /* 0 means disable feature */ +#define SCTPCTL_BLACKHOLE_DESC "Enable SCTP blackholing" +#define SCTPCTL_BLACKHOLE_MIN 0 +#define SCTPCTL_BLACKHOLE_MAX 2 +#define SCTPCTL_BLACKHOLE_DEFAULT SCTPCTL_BLACKHOLE_MIN + #if defined(SCTP_DEBUG) /* debug: Configure debug output */ #define SCTPCTL_DEBUG_DESC "Configure debug output" Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sun Jan 8 07:51:40 2012 (r229804) +++ head/sys/netinet/sctputil.c Sun Jan 8 09:56:24 2012 (r229805) @@ -3801,6 +3801,7 @@ sctp_handle_ootb(struct mbuf *m, int iph { struct sctp_chunkhdr *ch, chunk_buf; unsigned int chk_length; + int contains_init_chunk; SCTP_STAT_INCR_COUNTER32(sctps_outoftheblue); /* Generate a TO address for future reference */ @@ -3810,6 +3811,7 @@ sctp_handle_ootb(struct mbuf *m, int iph SCTP_CALLED_DIRECTLY_NOCMPSET); } } + contains_init_chunk = 0; ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, offset, sizeof(*ch), (uint8_t *) & chunk_buf); while (ch != NULL) { @@ -3819,6 +3821,9 @@ sctp_handle_ootb(struct mbuf *m, int iph break; } switch (ch->chunk_type) { + case SCTP_INIT: + contains_init_chunk = 1; + break; case SCTP_COOKIE_ECHO: /* We hit here only if the assoc is being freed */ return; @@ -3844,7 +3849,11 @@ sctp_handle_ootb(struct mbuf *m, int iph ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, offset, sizeof(*ch), (uint8_t *) & chunk_buf); } - sctp_send_abort(m, iphlen, sh, 0, op_err, vrf_id, port); + if ((SCTP_BASE_SYSCTL(sctp_blackhole) == 0) || + ((SCTP_BASE_SYSCTL(sctp_blackhole) == 1) && + (contains_init_chunk == 0))) { + sctp_send_abort(m, iphlen, sh, 0, op_err, vrf_id, port); + } } /* Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Sun Jan 8 07:51:40 2012 (r229804) +++ head/sys/netinet6/sctp6_usrreq.c Sun Jan 8 09:56:24 2012 (r229805) @@ -236,8 +236,13 @@ sctp_skip_csum: if (ch->chunk_type == SCTP_SHUTDOWN_COMPLETE) { goto bad; } - if (ch->chunk_type != SCTP_ABORT_ASSOCIATION) - sctp_send_abort(m, iphlen, sh, 0, NULL, vrf_id, port); + if (ch->chunk_type != SCTP_ABORT_ASSOCIATION) { + if ((SCTP_BASE_SYSCTL(sctp_blackhole) == 0) || + ((SCTP_BASE_SYSCTL(sctp_blackhole) == 1) && + (ch->chunk_type != SCTP_INIT))) { + sctp_send_abort(m, iphlen, sh, 0, NULL, vrf_id, port); + } + } goto bad; } else if (stcb == NULL) { refcount_up = 1; From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 10:07:25 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF88F1065673; Sun, 8 Jan 2012 10:07:24 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id 62FDD8FC12; Sun, 8 Jan 2012 10:07:23 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q08A6wCq015758 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 8 Jan 2012 21:07:21 +1100 Date: Sun, 8 Jan 2012 21:06:58 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Eitan Adler In-Reply-To: <201201072315.q07NFM3v060477@svn.freebsd.org> Message-ID: <20120108203419.S14348@besplex.bde.org> References: <201201072315.q07NFM3v060477@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: r229794 - head/usr.bin/hexdump X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 10:07:25 -0000 > Log: > - Fix how hexdump parses escape strings > From the NetBSD bug: > The way how hexdump(1) parses escape sequences has some bugs. > It shows up when an escape sequence is used as the non-last character > of a format string. > > PR: bin/144722 > Submitted by: gcooper > Approved by: rpaulo > Obtained from: NetBSD > MFC after: 1 week This has lots of style bugs. > Modified: head/usr.bin/hexdump/parse.c > ============================================================================== > --- head/usr.bin/hexdump/parse.c Sat Jan 7 22:29:46 2012 (r229793) > +++ head/usr.bin/hexdump/parse.c Sat Jan 7 23:15:21 2012 (r229794) > @@ -255,7 +255,9 @@ rewrite(FS *fs) > sokay = NOTOKAY; > } > > - p2 = p1 + 1; /* Set end pointer. */ > + p2 = *p1 ? p1 + 1 : p1; /* Set end pointer -- make sure > + * that it's non-NUL/-NULL first > + * though. */ > cs[0] = *p1; /* Set conversion string. */ > cs[1] = '\0'; > Comments to the right of code should be used less than was already done here. Large comments should never be to the right of code. They cause formatting problems, as the above shows. The "it" in the comment doesn't match its subject. Its subject is the end pointer, but "it" is meant to refer to the first byte of the string. Perhaps contractions like "it's" should be avoided in comments for the same reason as in man pages (they are harder to parse for non-native speakers). And parsing this one shows that the "it" is wrong. The comment doesn't match the code. The code doesn't have any NULL pointer check. And a null pointer check makes no sense, since the old code derefences p1 without checking for that, and the new code adds another dereference. The test of *p1 is a boolean test in non-boolean context. But nearby code has the same style bug, in the much more non-idiomatic form `!*p'. Fixing these style bugs gives something like: %%% /* * Set end pointer. First make sure that p1 is not * the empty string.. */ p2 = *p1 == '\0' ? p1 + p1 + 1; /* Set conversion string. */ cs[0] = *p1; cs[1] = '\0'; %%% Possible furthe improvements: - some programmers can't would add unnecessary parentheses for the ?: operator. Even I might add them. - it might be clearer to set the conversion string first and then use cs[0] instead of *p1 twice. > @@ -449,13 +451,21 @@ escape(char *p1) > char *p2; > > /* alphabetic escape sequences have to be done in place */ > - for (p2 = p1;; ++p1, ++p2) { > - if (!*p1) { > - *p2 = *p1; > - break; > - } > - if (*p1 == '\\') > - switch(*++p1) { > + for (p2 = p1; *p1; p1++, p2++) { > + /* > + * Let's take a peak at the next item and see whether or not > + * we need to escape the value... > + */ This comment is very verbose, starting with the noise words "Let's". This comment mispells "peek". "Peek" is another chatty word. The keyboard has excessive repeat on its "." key. There is no reason to use an ellipsis here. > + if (*p1 == '\\') { > + > + p1++; > + The keyboard also dribbles newlines. 2 instances here. > + switch(*p1) { > + /* A standalone `\' */ > + case '\0': Previous comment is misplaced and misindented. It should be here. It should be terminated by a ".". Perhaps the backslash in it should be quoted. > + *p2 = '\\'; > + *++p2 = '\0'; It's not clear why this doesn't give a buffer overrun. It writes past the end of a string. This is only safe if the caller allocated space beyond the end of the string. cs[] is allocated locally, and it is clear that it has space for just 1 byte of expansion. > + break; > case 'a': > /* *p2 = '\a'; */ > *p2 = '\007'; > @@ -482,7 +492,12 @@ escape(char *p1) > *p2 = *p1; > break; > } > + > + } else > + *p2 = *p1; > + 2 more extra newline. > } > + 1 more extra newline. > } > > void > Bruce From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 10:15:21 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E774B106564A; Sun, 8 Jan 2012 10:15:21 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id 034BE8FC0C; Sun, 8 Jan 2012 10:15:20 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q08AFGRp030552 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 8 Jan 2012 21:15:17 +1100 Date: Sun, 8 Jan 2012 21:15:16 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans In-Reply-To: <20120108203419.S14348@besplex.bde.org> Message-ID: <20120108210842.U14348@besplex.bde.org> References: <201201072315.q07NFM3v060477@svn.freebsd.org> <20120108203419.S14348@besplex.bde.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, Eitan Adler Subject: Re: svn commit: r229794 - head/usr.bin/hexdump X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 10:15:22 -0000 On Sun, 8 Jan 2012, Bruce Evans wrote: > ... > Fixing these style bugs gives something like: > > %%% > /* > * Set end pointer. First make sure that p1 is not > * the empty string.. > */ > p2 = *p1 == '\0' ? p1 + p1 + 1; Grr, typo. One of the `+'s should be `:'. I hope I inverted the logic of this expression correctly. > > /* Set conversion string. */ > cs[0] = *p1; > cs[1] = '\0'; > > %%% > Possible furthe improvements: > - some programmers can't would add unnecessary parentheses for the ?: > operator. Even I might add them. Since I changed `*p1' to `*p1 == `\0'' and inverted the logic, it has an extra operator so it needs the parentheses more than before: p2 = (*p1 == '\0' ? p1 : p1 + 1); Not: p2 = (*p1 == '\0') ? p1 : p1 + 1; (since this adds parentheses where they are least needed), or p2 = ((*p1 == '\0') ? p1 : p1 + 1); (since this adds layers of parentheses which must be parsed to see where they actually are). Bruce From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 10:44:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FFCD106564A; Sun, 8 Jan 2012 10:44:51 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 11A118FC08; Sun, 8 Jan 2012 10:44:50 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id C089C45B; Sun, 8 Jan 2012 11:44:46 +0100 (CET) Date: Sun, 8 Jan 2012 11:43:30 +0100 From: Pawel Jakub Dawidek To: Adrian Chadd Message-ID: <20120108104330.GC1674@garage.freebsd.pl> References: <201201080055.q080tMlJ063808@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Bu8it7iiRSEf40bY" Content-Disposition: inline In-Reply-To: <201201080055.q080tMlJ063808@svn.freebsd.org> X-OS: FreeBSD 9.0-CURRENT amd64 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: r229800 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 10:44:51 -0000 --Bu8it7iiRSEf40bY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jan 08, 2012 at 12:55:22AM +0000, Adrian Chadd wrote: > Author: adrian > Date: Sun Jan 8 00:55:22 2012 > New Revision: 229800 > URL: http://svn.freebsd.org/changeset/base/229800 >=20 > Log: > Make these two files conditionally build on UFS_ACL, as it doesn't > seem to be used elsewhere. > =20 > Since UFS_ACL is enabled by default for GENERIC kernels, this shouldn't > break anything - but please beat me to fix things if it does. If someone is actually using GENERIC kernel. This change will break all my system next time I upgrade. Adding UFS_ACL option to the kernel config to make ZFS kernel module to work doesn't sound very intuitive. I understand what you are trying to accomplish, but we really need to find better way to do this. Until then, could you back it out? > This reduces the footprint of the kernel on small embedded systems > (think <1MB flash for the compressed kernel image) just enough to > actually fit. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --Bu8it7iiRSEf40bY Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk8Jc1IACgkQForvXbEpPzTuPACfXr7wGC97cXng26Wt90xC86wd +54An25uHD8dIvD0Vx36bLwIviyCFfWG =uZSj -----END PGP SIGNATURE----- --Bu8it7iiRSEf40bY-- From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 11:57:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FDEC1065670; Sun, 8 Jan 2012 11:57:39 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E5528FC14; Sun, 8 Jan 2012 11:57: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 q08Bvd4u089260; Sun, 8 Jan 2012 11:57:39 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q08Bvd6j089257; Sun, 8 Jan 2012 11:57:39 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201201081157.q08Bvd6j089257@svn.freebsd.org> From: Andreas Tobler Date: Sun, 8 Jan 2012 11:57: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: r229806 - in head/lib/libc: powerpc/gen powerpc64/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 11:57:39 -0000 Author: andreast Date: Sun Jan 8 11:57:38 2012 New Revision: 229806 URL: http://svn.freebsd.org/changeset/base/229806 Log: Two other places where we can use WEAK_ALIAS. Modified: head/lib/libc/powerpc/gen/setjmp.S head/lib/libc/powerpc64/gen/setjmp.S Modified: head/lib/libc/powerpc/gen/setjmp.S ============================================================================== --- head/lib/libc/powerpc/gen/setjmp.S Sun Jan 8 09:56:24 2012 (r229805) +++ head/lib/libc/powerpc/gen/setjmp.S Sun Jan 8 11:57:38 2012 (r229806) @@ -69,8 +69,7 @@ ENTRY(setjmp) li %r3,0 /* return (0) */ blr - .weak CNAME(longjmp) - .set CNAME(longjmp),CNAME(__longjmp) + WEAK_ALIAS(longjmp, __longjmp) ENTRY(__longjmp) lmw %r9,20(%r3) /* restore regs */ mr %r6,%r4 /* save val param */ Modified: head/lib/libc/powerpc64/gen/setjmp.S ============================================================================== --- head/lib/libc/powerpc64/gen/setjmp.S Sun Jan 8 09:56:24 2012 (r229805) +++ head/lib/libc/powerpc64/gen/setjmp.S Sun Jan 8 11:57:38 2012 (r229806) @@ -93,10 +93,7 @@ ENTRY(setjmp) li %r3,0 /* return (0) */ blr - .weak CNAME(longjmp) - .set CNAME(longjmp),CNAME(__longjmp) - .weak CNAME(.longjmp) - .set CNAME(.longjmp),CNAME(.__longjmp) + WEAK_ALIAS(longjmp, __longjmp) ENTRY(__longjmp) ld %r9,40 + 0*8(%r3) ld %r10,40 + 1*8(%r3) From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 12:03:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D44E9106566B; Sun, 8 Jan 2012 12:03:46 +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 C3ABA8FC0C; Sun, 8 Jan 2012 12:03:46 +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 q08C3kwD089512; Sun, 8 Jan 2012 12:03:46 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q08C3kk6089510; Sun, 8 Jan 2012 12:03:46 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201081203.q08C3kk6089510@svn.freebsd.org> From: Ed Schouten Date: Sun, 8 Jan 2012 12:03:46 +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: r229807 - head/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 12:03:46 -0000 Author: ed Date: Sun Jan 8 12:03:46 2012 New Revision: 229807 URL: http://svn.freebsd.org/changeset/base/229807 Log: Fix spelling of C11 and sort functions by name. Modified: head/include/stdlib.h Modified: head/include/stdlib.h ============================================================================== --- head/include/stdlib.h Sun Jan 8 11:57:38 2012 (r229806) +++ head/include/stdlib.h Sun Jan 8 12:03:46 2012 (r229807) @@ -149,12 +149,12 @@ _Noreturn void _Exit(int); #endif /* __ISO_C_VISIBLE >= 1999 */ /* - * If we're in a mode greater than C99, expose C1x functions. + * If we're in a mode greater than C99, expose C11 functions. */ #if __ISO_C_VISIBLE >= 2011 +int at_quick_exit(void (*)(void)); _Noreturn void quick_exit(int); -int at_quick_exit(void (*)(void)); #endif /* __ISO_C_VISIBLE >= 2011 */ /* * Extensions made by POSIX relative to C. We don't know yet which edition From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 12:04:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5D59106566B; Sun, 8 Jan 2012 12:04:22 +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 953578FC17; Sun, 8 Jan 2012 12:04: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 q08C4Mbd089569; Sun, 8 Jan 2012 12:04:22 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q08C4Meg089567; Sun, 8 Jan 2012 12:04:22 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201081204.q08C4Meg089567@svn.freebsd.org> From: Ed Schouten Date: Sun, 8 Jan 2012 12:04: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: r229808 - head/lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 12:04:22 -0000 Author: ed Date: Sun Jan 8 12:04:22 2012 New Revision: 229808 URL: http://svn.freebsd.org/changeset/base/229808 Log: Properly sort functions by name. Modified: head/lib/libc/stdlib/Symbol.map Modified: head/lib/libc/stdlib/Symbol.map ============================================================================== --- head/lib/libc/stdlib/Symbol.map Sun Jan 8 12:03:46 2012 (r229807) +++ head/lib/libc/stdlib/Symbol.map Sun Jan 8 12:04:22 2012 (r229808) @@ -93,18 +93,18 @@ FBSD_1.0 { }; FBSD_1.3 { + at_quick_exit; atof_l; atoi_l; atol_l; atoll_l; - at_quick_exit; quick_exit; strtod_l; - strtol_l; - strtoll_l; strtof_l; strtoimax_l; + strtol_l; strtold_l; + strtoll_l; strtoq_l; strtoul_l; strtoull_l; From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 12:38:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DA3B106564A; Sun, 8 Jan 2012 12:38:42 +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 5C9AB8FC0C; Sun, 8 Jan 2012 12:38: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 q08CcgjI090737; Sun, 8 Jan 2012 12:38:42 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q08CcgdU090735; Sun, 8 Jan 2012 12:38:42 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201081238.q08CcgdU090735@svn.freebsd.org> From: Ed Schouten Date: Sun, 8 Jan 2012 12:38: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: r229809 - head/gnu/usr.bin/cvs/lib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 12:38:42 -0000 Author: ed Date: Sun Jan 8 12:38:41 2012 New Revision: 229809 URL: http://svn.freebsd.org/changeset/base/229809 Log: Don't include . Including this header file causes a compilation warning. The code builds perfectly fine without this header file. Modified: head/gnu/usr.bin/cvs/lib/config.h.proto Modified: head/gnu/usr.bin/cvs/lib/config.h.proto ============================================================================== --- head/gnu/usr.bin/cvs/lib/config.h.proto Sun Jan 8 12:04:22 2012 (r229808) +++ head/gnu/usr.bin/cvs/lib/config.h.proto Sun Jan 8 12:38:41 2012 (r229809) @@ -324,7 +324,7 @@ #define HAVE_SYS_STAT_H 1 /* Define to 1 if you have the header file. */ -#define HAVE_SYS_TIMEB_H 1 +/* #undef HAVE_SYS_TIMEB_H */ /* Define to 1 if you have the header file. */ #define HAVE_SYS_TIME_H 1 From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 13:34:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96331106566B; Sun, 8 Jan 2012 13:34:01 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6AE7D8FC0A; Sun, 8 Jan 2012 13:34:01 +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 q08DY1SL092435; Sun, 8 Jan 2012 13:34:01 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q08DY1fC092430; Sun, 8 Jan 2012 13:34:01 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201081334.q08DY1fC092430@svn.freebsd.org> From: Gleb Smirnoff Date: Sun, 8 Jan 2012 13:34:01 +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: r229810 - in head/sys: net netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 13:34:01 -0000 Author: glebius Date: Sun Jan 8 13:34:00 2012 New Revision: 229810 URL: http://svn.freebsd.org/changeset/base/229810 Log: Move arprequest() declaration to if_ether.h. Modified: head/sys/net/if_llatbl.c head/sys/netinet/if_ether.c head/sys/netinet/if_ether.h Modified: head/sys/net/if_llatbl.c ============================================================================== --- head/sys/net/if_llatbl.c Sun Jan 8 12:38:41 2012 (r229809) +++ head/sys/net/if_llatbl.c Sun Jan 8 13:34:00 2012 (r229810) @@ -65,9 +65,6 @@ MALLOC_DEFINE(M_LLTABLE, "lltable", "lin static VNET_DEFINE(SLIST_HEAD(, lltable), lltables); #define V_lltables VNET(lltables) -extern void arprequest(struct ifnet *, struct in_addr *, struct in_addr *, - u_char *); - static void vnet_lltable_init(void); struct rwlock lltable_rwlock; Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Sun Jan 8 12:38:41 2012 (r229809) +++ head/sys/netinet/if_ether.c Sun Jan 8 13:34:00 2012 (r229810) @@ -123,8 +123,6 @@ SYSCTL_VNET_INT(_net_link_ether_inet, OI "Number of packets to hold per ARP entry"); static void arp_init(void); -void arprequest(struct ifnet *, - struct in_addr *, struct in_addr *, u_char *); static void arpintr(struct mbuf *); static void arptimer(void *); #ifdef INET Modified: head/sys/netinet/if_ether.h ============================================================================== --- head/sys/netinet/if_ether.h Sun Jan 8 12:38:41 2012 (r229809) +++ head/sys/netinet/if_ether.h Sun Jan 8 13:34:00 2012 (r229810) @@ -115,6 +115,8 @@ struct ifaddr; int arpresolve(struct ifnet *ifp, struct rtentry *rt, struct mbuf *m, struct sockaddr *dst, u_char *desten, struct llentry **lle); +void arprequest(struct ifnet *, struct in_addr *, struct in_addr *, + u_char *); void arp_ifinit(struct ifnet *, struct ifaddr *); void arp_ifinit2(struct ifnet *, struct ifaddr *, u_char *); void arp_ifscrub(struct ifnet *, uint32_t); From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 13:51:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 212C01065672; Sun, 8 Jan 2012 13:51:10 +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 E5E508FC0A; Sun, 8 Jan 2012 13:51: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 q08Dp98N092981; Sun, 8 Jan 2012 13:51:09 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q08Dp94Z092978; Sun, 8 Jan 2012 13:51:09 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201201081351.q08Dp94Z092978@svn.freebsd.org> From: Dimitry Andric Date: Sun, 8 Jan 2012 13:51:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229811 - stable/9/contrib/less X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 13:51:10 -0000 Author: dim Date: Sun Jan 8 13:51:09 2012 New Revision: 229811 URL: http://svn.freebsd.org/changeset/base/229811 Log: MFC r229196: Redo r228645, but instead of casting away const conversion warnings in contrib/less, add a few const qualifiers in the right places. Suggested by: das Modified: stable/9/contrib/less/command.c stable/9/contrib/less/prompt.c Directory Properties: stable/9/contrib/less/ (props changed) Modified: stable/9/contrib/less/command.c ============================================================================== --- stable/9/contrib/less/command.c Sun Jan 8 13:34:00 2012 (r229810) +++ stable/9/contrib/less/command.c Sun Jan 8 13:51:09 2012 (r229811) @@ -105,7 +105,7 @@ cmd_exec() start_mca(action, prompt, mlist, cmdflags) int action; char *prompt; - void *mlist; + void constant *mlist; int cmdflags; { mca = action; @@ -686,7 +686,7 @@ make_display() static void prompt() { - register char *p; + register char constant *p; if (ungot != NULL) { Modified: stable/9/contrib/less/prompt.c ============================================================================== --- stable/9/contrib/less/prompt.c Sun Jan 8 13:34:00 2012 (r229810) +++ stable/9/contrib/less/prompt.c Sun Jan 8 13:51:09 2012 (r229811) @@ -394,9 +394,9 @@ protochar(c, where, iseditproto) * where to resume parsing the string. * We must keep track of nested IFs and skip them properly. */ - static char * + static char constant * skipcond(p) - register char *p; + register char constant *p; { register int iflevel; @@ -452,9 +452,9 @@ skipcond(p) /* * Decode a char that represents a position on the screen. */ - static char * + static char constant * wherechar(p, wp) - char *p; + char constant *p; int *wp; { switch (*p) @@ -478,10 +478,10 @@ wherechar(p, wp) */ public char * pr_expand(proto, maxwidth) - char *proto; + char constant *proto; int maxwidth; { - register char *p; + register char constant *p; register int c; int where; From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 13:54:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7351D106566B; Sun, 8 Jan 2012 13:54:09 +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 608E78FC08; Sun, 8 Jan 2012 13:54: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 q08Ds9vE093107; Sun, 8 Jan 2012 13:54:09 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q08Ds9GQ093105; Sun, 8 Jan 2012 13:54:09 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201201081354.q08Ds9GQ093105@svn.freebsd.org> From: Hiroki Sato Date: Sun, 8 Jan 2012 13:54:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229812 - stable/9/release/doc/en_US.ISO8859-1/relnotes X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 13:54:09 -0000 Author: hrs Date: Sun Jan 8 13:54:08 2012 New Revision: 229812 URL: http://svn.freebsd.org/changeset/base/229812 Log: Add relnotes items: igb(4) Intel I350 GbE support, re(4) TX IP checksum disabled on RTL8168C-based cards, cc(9) TCP congestion control algorithm framework added, gpart(8) various aliases and bios-boot GUID added, FFS SU+J added, more kern.features.* for UFS-related features, hastd(8) drops root privilege in worker processes, newsyslog(8) xz compression support added, ppp(8) iface name and iface description commands added, sh(1) arithmetic expression handling updated, ISC BIND to 9.8.1-P1, and tzdata2011a. Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Sun Jan 8 13:51:09 2012 (r229811) +++ stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Sun Jan 8 13:54:08 2012 (r229812) @@ -218,6 +218,9 @@ could make AR8152-based network interfaces stop working has been fixed. + The &man.igb.4; driver now supports + Intel I350 PCIe Gigabit Ethernet controller. + The &man.ixgbe.4; driver has been updated to version 2.3.8. @@ -265,9 +268,12 @@ disabled by default because broken frames can be sent under certain conditions. - The &man.re.4; driver now supports - enabling TX and/or RX checksum offloading independently - from each other. + The &man.re.4; driver now + supports enabling TX and/or RX checksum offloading + independently from each other. Note that TX IP checksum + is disabled on some RTL8168C-based network interfaces + because it can generate an wrong IP checksum when the + packet contains IP options. A bug in the &man.re.4; driver has been fixed. It could cause a panic when receiving a jumbo @@ -315,11 +321,39 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile been fixed. The source address selection could not being performed when multicast options were present but without an interface being specified. + + + &os; TCP/IP network stack now supports &man.cc.9; pluggable + congestion control framework. This allows TCP congestion + control algorithms to be implemented as dynamically loadable + kernel modules. The following kernel modules are available + as of &release.current;: &man.cc.chd.4; for + CAIA-Hamilton-Delay algorithm, &man.cc.cubic.4; for CUBIC + algorithm, &man.cc.hd.4; for Hamilton-Delay algorithm, + &man.cc.htcp.4; for H-TCP algorithm, &man.cc.newreno.4; for + NewReno algorithm, and &man.cc.vegas.4; for Vegas algorithm. + The default algorithm can be set by a new &man.sysctl.8; + variable net.inet.tcp.cc.algorithm. The + value must be set to one of the names listed by the + net.inet.tcp.cc.available, and + newreno is set at boot time. For more + detail, see &man.cc.9; manual page. Disks and Storage + The &man.gpart.8; GEOM class now + supports the following aliases for the MBR and EBR schemes: + fat32, ebr, + linux-data, + linux-raid, and + linux-swap. + + The &man.gpart.8; GEOM class now + supports bios-boot GUID for the GPT + scheme which is used in GRUB 2 loader. + The &man.md.4; memory-backed pseudo disk device driver now supports a &man.sysctl.8; variable vm.md_malloc_wait to specify whether a @@ -338,6 +372,17 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile File Systems + The &os; Fast File System now supports + softupdates journaling. It introduces a intent log into a + softupdates-enabled file system which eliminates the need + for background &man.fsck.8; even on unclean shutdown. This + can be enabled in a per-filesystem basis by using a + flag in the &man.newfs.8; utility or a + option in the &man.tunefs.8; + utility. Note that the &release.current; installer + automatically enables the softupdates journaling for + newly-created UFS file systems. + The &os; Fast File System now supports TRIM command when freeing data blocks. A new flag in the &man.newfs.8; and @@ -347,8 +392,22 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile block. The TRIM command is specified as Data Set Management Command in ATA8-ACS2 standard to carry the information related to deleted data blocks to device, - especially for SSD (Solid-State Drive) for optimization. - + especially for SSD (Solid-State Drive) for optimization. + + The following &man.sysctl.8; variables + for showing availability of UFS-related feature on the + system have been added: + kern.features.ufs_acl for ACL (Access + Control List) support in UFS, + kern.features.ufs_gjournal for journaling + support through &man.gjournal.8; for UFS, + kern.features.ufs_quota for UFS disk + quotas support, kern.features.ufs_quota64 + for 64-bit UFS disk quotas support, + kern.features.softupdates for FFS + soft-updates support, and + kern.features.ffs_snapshot for FFS + snapshot support. @@ -366,6 +425,10 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile could prevent STAT FTP command from working properly has been fixed. + The &man.hastd.8; utility now drops + root privileges of the worker processes to + hast user. + The &man.ifconfig.8; utility now supports fdx, flow, hdx, and loop keywords @@ -380,11 +443,24 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile of netstat -ani and netstat -nr. + The &man.newsyslog.8; utility now + supports &man.xz.1; compression. An X flag + in the optional field has been added to specify the + compression. + A &man.poweroff.8; utility has been added. This is equivalent to: &prompt.root; shutdown -p now + The &man.ppp.8; utility now supports + iface name name + and iface description + description commands. + These have the same functionalities as name + and description subcommands in the + &man.ifconfig.8; utility. + The &man.rtld.1; runtime linker now supports shared objects as filters in ELF shared libraries. Both standard and auxiliary filtering have been supported. The @@ -421,7 +497,7 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile printed to stdout about this. The buffer was not flushed after this which could result in the message being written to the wrong file if the next command was a - builtin and had stdout redirected. + built-in and had stdout redirected. The &man.sh.1; program now supports a flag in trap command to @@ -433,6 +509,13 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile found before looking up directories in $PATH. + Arithmetic expression handling code in + the &man.sh.1; program has been updated by importing code from + dash. It now supports conditional + operator (?:) and a bug in evaluation of + && and || around an arithmetic expression has been + fixed. + <filename>/etc/rc.d</filename> Scripts @@ -446,9 +529,16 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile ACPI CA has been updated to version 20110527. + ISC BIND has + been updated to version 9.8.1-P1. + dialog has been updated to version 1.1-20110707. + The timezone + database has been updated to the + tzdata2011a release. + &man.unifdef.1; utility has been updated to version 2.5.6. From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 16:47:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA635106564A; Sun, 8 Jan 2012 16:47:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8AE478FC0C; Sun, 8 Jan 2012 16:47: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 q08GlcHZ098526; Sun, 8 Jan 2012 16:47:38 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q08GlcYb098524; Sun, 8 Jan 2012 16:47:38 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201081647.q08GlcYb098524@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 8 Jan 2012 16:47:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229813 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 16:47:38 -0000 Author: kib Date: Sun Jan 8 16:47:37 2012 New Revision: 229813 URL: http://svn.freebsd.org/changeset/base/229813 Log: MFC r229185: Avoid double-unlock or double unreference for ndp->ni_dvp when the vnode dp lock upgrade right after the 'success' label fails. Modified: stable/8/sys/kern/vfs_lookup.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/kern/vfs_lookup.c ============================================================================== --- stable/8/sys/kern/vfs_lookup.c Sun Jan 8 13:54:08 2012 (r229812) +++ stable/8/sys/kern/vfs_lookup.c Sun Jan 8 16:47:37 2012 (r229813) @@ -470,12 +470,14 @@ lookup(struct nameidata *ndp) int dvfslocked; /* VFS Giant state for parent */ int tvfslocked; int lkflags_save; + int ni_dvp_unlocked; /* * Setup: break out flag bits into variables. */ dvfslocked = (ndp->ni_cnd.cn_flags & GIANTHELD) != 0; vfslocked = 0; + ni_dvp_unlocked = 0; ndp->ni_cnd.cn_flags &= ~GIANTHELD; wantparent = cnp->cn_flags & (LOCKPARENT | WANTPARENT); KASSERT(cnp->cn_nameiop == LOOKUP || wantparent, @@ -812,8 +814,10 @@ unionlookup: /* * Symlink code always expects an unlocked dvp. */ - if (ndp->ni_dvp != ndp->ni_vp) + if (ndp->ni_dvp != ndp->ni_vp) { VOP_UNLOCK(ndp->ni_dvp, 0); + ni_dvp_unlocked = 1; + } goto success; } @@ -860,14 +864,17 @@ nextname: VREF(ndp->ni_startdir); } if (!wantparent) { + ni_dvp_unlocked = 2; if (ndp->ni_dvp != dp) vput(ndp->ni_dvp); else vrele(ndp->ni_dvp); VFS_UNLOCK_GIANT(dvfslocked); dvfslocked = 0; - } else if ((cnp->cn_flags & LOCKPARENT) == 0 && ndp->ni_dvp != dp) + } else if ((cnp->cn_flags & LOCKPARENT) == 0 && ndp->ni_dvp != dp) { VOP_UNLOCK(ndp->ni_dvp, 0); + ni_dvp_unlocked = 1; + } if (cnp->cn_flags & AUDITVNODE1) AUDIT_ARG_VNODE1(dp); @@ -896,10 +903,12 @@ success: return (0); bad2: - if (dp != ndp->ni_dvp) - vput(ndp->ni_dvp); - else - vrele(ndp->ni_dvp); + if (ni_dvp_unlocked != 2) { + if (dp != ndp->ni_dvp && !ni_dvp_unlocked) + vput(ndp->ni_dvp); + else + vrele(ndp->ni_dvp); + } bad: if (!dpunlocked) vput(dp); From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 17:11:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42FC1106566B; Sun, 8 Jan 2012 17:11:54 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D9378FC08; Sun, 8 Jan 2012 17:11: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 q08HBsYQ099299; Sun, 8 Jan 2012 17:11:54 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q08HBrsB099297; Sun, 8 Jan 2012 17:11:53 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201081711.q08HBrsB099297@svn.freebsd.org> From: Gleb Smirnoff Date: Sun, 8 Jan 2012 17:11:53 +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: r229814 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 17:11:54 -0000 Author: glebius Date: Sun Jan 8 17:11:53 2012 New Revision: 229814 URL: http://svn.freebsd.org/changeset/base/229814 Log: Copy ifa->if_data to ifam->ifam_data. This was forgotten in r228571. Submitted by: bz Modified: head/sys/net/rtsock.c Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Sun Jan 8 16:47:37 2012 (r229813) +++ head/sys/net/rtsock.c Sun Jan 8 17:11:53 2012 (r229814) @@ -1606,6 +1606,7 @@ sysctl_iflist(int af, struct walkarg *w) ifam->ifam_flags = ifa->ifa_flags; ifam->ifam_metric = ifa->ifa_metric; ifam->ifam_addrs = info.rti_addrs; + ifam->ifam_data = ifa->if_data; if (carp_get_vhid_p != NULL) ifam->ifam_data.ifi_vhid = (*carp_get_vhid_p)(ifa); From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 17:20:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 776C7106566C; Sun, 8 Jan 2012 17:20:30 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6343C8FC1A; Sun, 8 Jan 2012 17:20: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 q08HKULA099581; Sun, 8 Jan 2012 17:20:30 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q08HKU4l099579; Sun, 8 Jan 2012 17:20:30 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201081720.q08HKU4l099579@svn.freebsd.org> From: Gleb Smirnoff Date: Sun, 8 Jan 2012 17:20: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: r229815 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 17:20:30 -0000 Author: glebius Date: Sun Jan 8 17:20:29 2012 New Revision: 229815 URL: http://svn.freebsd.org/changeset/base/229815 Log: Provide IA_MASKSIN() macro similar to IA_SIN() and IA_DSTSIN(). Modified: head/sys/netinet/in_var.h Modified: head/sys/netinet/in_var.h ============================================================================== --- head/sys/netinet/in_var.h Sun Jan 8 17:11:53 2012 (r229814) +++ head/sys/netinet/in_var.h Sun Jan 8 17:20:29 2012 (r229815) @@ -85,6 +85,7 @@ struct in_aliasreq { */ #define IA_SIN(ia) (&(((struct in_ifaddr *)(ia))->ia_addr)) #define IA_DSTSIN(ia) (&(((struct in_ifaddr *)(ia))->ia_dstaddr)) +#define IA_MASKSIN(ia) (&(((struct in_ifaddr *)(ia))->ia_sockmask)) #define IN_LNAOF(in, ifa) \ ((ntohl((in).s_addr) & ~((struct in_ifaddr *)(ifa)->ia_subnetmask)) From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 17:25:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67C681065676; Sun, 8 Jan 2012 17:25:16 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 388E08FC0C; Sun, 8 Jan 2012 17:25: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 q08HPGgA099767; Sun, 8 Jan 2012 17:25:16 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q08HPG3m099765; Sun, 8 Jan 2012 17:25:16 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201081725.q08HPG3m099765@svn.freebsd.org> From: Gleb Smirnoff Date: Sun, 8 Jan 2012 17:25: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: r229816 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 17:25:16 -0000 Author: glebius Date: Sun Jan 8 17:25:15 2012 New Revision: 229816 URL: http://svn.freebsd.org/changeset/base/229816 Log: Make it possible to use alternative source hardware address in the ARP datagram generated by arprequest(). If caller doesn't supply the address, then it is either picked from CARP or hardware address of the interface is taken. While here, make several minor fixes: - Hold IF_ADDR_RLOCK(ifp) while traversing address list. - Remove not true comment. - Access internet address and mask via in_ifaddr fields, rather than ifaddr. Modified: head/sys/netinet/if_ether.c Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Sun Jan 8 17:20:29 2012 (r229815) +++ head/sys/netinet/if_ether.c Sun Jan 8 17:25:15 2012 (r229816) @@ -211,29 +211,41 @@ arprequest(struct ifnet *ifp, struct in_ struct mbuf *m; struct arphdr *ah; struct sockaddr sa; + u_char *carpaddr = NULL; if (sip == NULL) { - /* XXX don't believe this can happen (or explain why) */ /* * The caller did not supply a source address, try to find * a compatible one among those assigned to this interface. */ struct ifaddr *ifa; + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { - if (!ifa->ifa_addr || - ifa->ifa_addr->sa_family != AF_INET) + if (ifa->ifa_addr->sa_family != AF_INET) continue; - sip = &SIN(ifa->ifa_addr)->sin_addr; + + if (ifa->ifa_carp) { + if ((*carp_iamatch_p)(ifa, &carpaddr) == 0) + continue; + sip = &IA_SIN(ifa)->sin_addr; + } else { + carpaddr = NULL; + sip = &IA_SIN(ifa)->sin_addr; + } + if (0 == ((sip->s_addr ^ tip->s_addr) & - SIN(ifa->ifa_netmask)->sin_addr.s_addr) ) + IA_MASKSIN(ifa)->sin_addr.s_addr)) break; /* found it. */ } + IF_ADDR_RUNLOCK(ifp); if (sip == NULL) { printf("%s: cannot find matching address\n", __func__); return; } } + if (enaddr == NULL) + enaddr = carpaddr ? carpaddr : (u_char *)IF_LLADDR(ifp); if ((m = m_gethdr(M_DONTWAIT, MT_DATA)) == NULL) return; @@ -328,9 +340,7 @@ retry: */ if (!(la->la_flags & LLE_STATIC) && time_uptime + la->la_preempt > la->la_expire) { - arprequest(ifp, NULL, - &SIN(dst)->sin_addr, IF_LLADDR(ifp)); - + arprequest(ifp, NULL, &SIN(dst)->sin_addr, NULL); la->la_preempt--; } @@ -406,8 +416,7 @@ retry: LLE_REMREF(la); la->la_asked++; LLE_WUNLOCK(la); - arprequest(ifp, NULL, &SIN(dst)->sin_addr, - IF_LLADDR(ifp)); + arprequest(ifp, NULL, &SIN(dst)->sin_addr, NULL); return (error); } done: From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 17:40:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30398106564A; Sun, 8 Jan 2012 17:40:11 +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 196DC8FC1C; Sun, 8 Jan 2012 17:40:11 +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 q08HeAFC000336; Sun, 8 Jan 2012 17:40:10 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q08HeA5p000334; Sun, 8 Jan 2012 17:40:10 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201201081740.q08HeA5p000334@svn.freebsd.org> From: Hiroki Sato Date: Sun, 8 Jan 2012 17:40:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229817 - stable/9/release/doc/en_US.ISO8859-1/relnotes X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 17:40:11 -0000 Author: hrs Date: Sun Jan 8 17:40:10 2012 New Revision: 229817 URL: http://svn.freebsd.org/changeset/base/229817 Log: Add relnotes items: cxgbe(4) for Chelsio T4 added, dc(4) PAE support on FreeBSD/i386, re(4) RTL8401E support added, IPsec HMAC-SHA-256/384/512 authenticator hash size fix, cc(4) TCP_CONGESTION socket option, Citrus iconv imported (but disabled by default), utxrm(8) utility added, GNU binutils to 2.17.50, LLVM/Clang 3.0 imported, xz to 5.0.1, bsdinstall(8) added as the default installer. Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Sun Jan 8 17:25:15 2012 (r229816) +++ stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Sun Jan 8 17:40:10 2012 (r229817) @@ -218,6 +218,14 @@ could make AR8152-based network interfaces stop working has been fixed. + A &man.cxgbe.4; driver for Chelsio + T4 (Terminator 4) based 10Gb/1Gb adapters has been + added. + + The &man.dc.4; driver + now works correctly in the kernel with + option. + The &man.igb.4; driver now supports Intel I350 PCIe Gigabit Ethernet controller. @@ -239,8 +247,9 @@ A rdcphy(4) driver for RDC Semiconductor R6040 10/100 PHY has been added. - The &man.re.4; driver now supports - RTL8168E/8111E-VL PCIe Gigabit Ethernet controllers. + The &man.re.4; driver now supports + RTL8168E/8111E-VL PCIe Gigabit Ethernet controllers and + RTL8401E PCIe Fast Ethernet controller. The &man.re.4; driver now supports TX interrupt moderation on RTL810xE PCIe Fast Ethernet @@ -317,6 +326,16 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile Network Protocols + &os; &man.ipsec.4; support now uses a + half of the hash size as the authenticator hash size in + Hashed Message Authentication Mode (HMAC-SHA-256, + HMAC-SHA-384, and HMAC-SHA-512) as described in RFC 4868. + This was 96-bit fixed length in prior releases because the + implementation was based on an old Internet draft + draft-ietf-ipsec-ciph-sha-256-00. Note that this means + &release.current; and later are no longer interoperable with + the older &os; releases. + A bug in &os; TCP/IP network stack has been fixed. The source address selection could not being performed when multicast options were present but without an @@ -336,8 +355,15 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile variable net.inet.tcp.cc.algorithm. The value must be set to one of the names listed by the net.inet.tcp.cc.available, and - newreno is set at boot time. For more - detail, see &man.cc.9; manual page. + newreno is set at boot time. + For more + detail, see &man.cc.4; and &man.cc.9; manual pages. + + A new &man.tcp.4; socket option + TCP_CONGESTION has been added. This + allows to select or query a congestion control algorithm + that the TCP/IP network stack will use for connections on + the socket. @@ -372,7 +398,7 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile File Systems - The &os; Fast File System now supports + The &os; Fast File System now supports softupdates journaling. It introduces a intent log into a softupdates-enabled file system which eliminates the need for background &man.fsck.8; even on unclean shutdown. This @@ -429,6 +455,17 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile root privileges of the worker processes to hast user. + An implementation of + iconv() API libraries and utilities which + are standardized in Single UNIX Specification have been + imported. These are based on NetBSD's Citrus implementation. + Note that these are not built nor installed by default. To + build and install them, specify + WITH_ICONV=yes in + /etc/src.conf and rebuild the base system + as described in &os Handbook (). + The &man.ifconfig.8; utility now supports fdx, flow, hdx, and loop keywords @@ -516,6 +553,12 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile && and || around an arithmetic expression has been fixed. + A &man.utxrm.8; utility has been added. + This allows one to remove an entry from the + utmpx database by hand. This is useful + when a login daemon crashes or fails to remove the entry + during shutdown. + <filename>/etc/rc.d</filename> Scripts @@ -532,16 +575,34 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile ISC BIND has been updated to version 9.8.1-P1. + GNU binutils + has been updated to 2.17.50 (as of 3 July 2007), which is the + last available version under GPLv2. + dialog has been updated to version 1.1-20110707. + The LLVM + compiler infrastructure and the + clang, a C language family + front-end, version 3.0 have been imported. Note that it is not + used for building the &os; base system. In &os; build + infrastructure, the &man.clang.1;, &man.clang...1;, and + &man.clang-cpp.1; utilities can be used in + CC, CXX, and + CPP &man.make.1; variables, + respectively. + The timezone database has been updated to the tzdata2011a release. &man.unifdef.1; utility has been updated to version 2.5.6. - + + The xz program has been updated + from 5.0.0 to 5.0.1 release. + Ports/Packages Collection Infrastructure @@ -552,6 +613,11 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile Release Engineering and Integration + A new installer &man.bsdinstall.8; has + been added and integrated into installation ISO images. The + &man.sysinstall.8; utility is also available for settings + after the installation. + The supported version of the KDE desktop environment (x11/kde4) has been From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 18:48:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98E46106564A; Sun, 8 Jan 2012 18:48:36 +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 847FC8FC08; Sun, 8 Jan 2012 18:48: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 q08ImaFc002541; Sun, 8 Jan 2012 18:48:36 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q08ImakZ002539; Sun, 8 Jan 2012 18:48:36 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201201081848.q08ImakZ002539@svn.freebsd.org> From: Hiroki Sato Date: Sun, 8 Jan 2012 18:48: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: r229818 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 18:48:36 -0000 Author: hrs Date: Sun Jan 8 18:48:36 2012 New Revision: 229818 URL: http://svn.freebsd.org/changeset/base/229818 Log: Fix a typo. (s/nessesary/necessary/) Modified: head/sys/kern/kern_prot.c Modified: head/sys/kern/kern_prot.c ============================================================================== --- head/sys/kern/kern_prot.c Sun Jan 8 17:40:10 2012 (r229817) +++ head/sys/kern/kern_prot.c Sun Jan 8 18:48:36 2012 (r229818) @@ -73,7 +73,7 @@ __FBSDID("$FreeBSD$"); #ifdef REGRESSION FEATURE(regression, - "Kernel support for interfaces nessesary for regression testing (SECURITY RISK!)"); + "Kernel support for interfaces necessary for regression testing (SECURITY RISK!)"); #endif #if defined(INET) || defined(INET6) From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 19:24:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 154C9106564A; Sun, 8 Jan 2012 19:24:09 +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 F14028FC0A; Sun, 8 Jan 2012 19:24:08 +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 q08JO85Z003716; Sun, 8 Jan 2012 19:24:08 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q08JO8an003714; Sun, 8 Jan 2012 19:24:08 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201201081924.q08JO8an003714@svn.freebsd.org> From: Hiroki Sato Date: Sun, 8 Jan 2012 19:24:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229819 - stable/9/release/doc/en_US.ISO8859-1/relnotes X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 19:24:09 -0000 Author: hrs Date: Sun Jan 8 19:24:08 2012 New Revision: 229819 URL: http://svn.freebsd.org/changeset/base/229819 Log: Add relnotes items: add descriptions about kern.features.*, new NFS implementation (newnfs) is now compiled in by default, add some descriptions about NFSv4 configuration, and document a workaround for the kern.geom.part.check_integrity issue. Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Sun Jan 8 18:48:36 2012 (r229818) +++ stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Sun Jan 8 19:24:08 2012 (r229819) @@ -192,6 +192,315 @@ PT_GNU_STACK for the specified ABIs (e.g. elf32 for 32-bit ABI). + The following &man.sysctl.8; variables + for showing availability of various kernel features: + + + + + + + + &man.sysctl.8; variable name + Description + + + + + + kern.features.ufs_acl + ACL (Access Control List) support in UFS + + + + kern.features.ufs_gjournal + journaling support through &man.gjournal.8; for + UFS + + + + kern.features.ufs_quota + UFS disk quotas support + + + + kern.features.ufs_quota64 + 64-bit UFS disk quotas support + + + + kern.features.softupdates + FFS soft-updates support + + + + kern.features.ffs_snapshot + FFS snapshot support + + + + kern.features.nfsclient + NFS client (old implementation) + + + + kern.features.nfscl + NFS client (new implementation) + + + + kern.features.nfsserver + NFS server (old implementation) + + + + kern.features.nfsd + NFS server (new implementation) + + + + kern.features.kdtrace_hooks + Kernel DTrace hooks which are required to load + DTrace kernel modules + + + + kern.features.ktr + Kernel support for KTR kernel tracing facility + + + + kern.features.ktrace + Kernel support for system call tracing + + + + kern.features.hwpmc_hooks + Kernel support for HW PMC + + + + kern.features.sysv_msg + System V message queues support + + + + kern.features.sysv_sem + System V semaphores support + + + + kern.features.p1003_1b_mqueue + POSIX P1003.1B message queues support + + + + kern.features.p1003_1b_semaphores + POSIX P1003.1B semaphores support + + + + kern.features.kposix_priority_scheduling + POSIX P1003.1B real-time extensions + + + + kern.features.stack + Support for capturing kernel stack + + + + kern.features.sysv_shm + System V shared memory segments support + + + + kern.features.pps_sync + Support usage of external PPS signal by kernel PLL + + + + kern.features.regression + Kernel support for interfaces necessary for + regression testing + + + + kern.features.invariant_support + Support for modules compiled with INVARIANTS option + + + + kern.features.zero_copy_sockets + Zero copy sockets support + + + + kern.features.libmchain + mchain library + + + + kern.features.scbus + SCSI devices support + + + + kern.features.mac + Mandatory Access Control Framework support + + + + kern.features.audit + BSM audit support + + + + kern.features.geom_gate + GEOM Gate module + + + + kern.features.geom_uzip + GEOM uzip read-only compressed disks support + + + + kern.features.geom_cache + GEOM cache module + + + + kern.features.geom_mirror + GEOM mirroring support + + + + kern.features.geom_stripe + GEOM striping support + + + + kern.features.geom_concat + GEOM concatenation support + + + + kern.features.geom_raid3 + GEOM RAID-3 functionality + + + + kern.features.geom_fox + GEOM FOX redundant path mitigation support + + + + kern.features.geom_multipath + GEOM multipath support + + + + kern.features.g_virstor + GEOM virtual storage support + + + + kern.features.geom_bde + GEOM-based Disk Encryption + + + + kern.features.geom_eli + GEOM crypto module + + + + kern.features.geom_journal + GEOM journaling support + + + + kern.features.geom_shsec + GEOM shared secret device support + + + + kern.features.geom_vol + GEOM support for volume names from UFS superblock + + + + kern.features.geom_label + GEOM labeling support + + + + kern.features.geom_sunlabel + GEOM Sun/Solaris partitioning support + + + + kern.features.geom_bsd + GEOM BSD disklabels support + + + + kern.features.geom_pc98 + GEOM NEC PC9800 partitioning support + + + + kern.features.geom_linux_lvm + GEOM Linux LVM partitioning support + + + + kern.features.geom_part_pc98 + GEOM partitioning class for PC-9800 disk partitions + + + + kern.features.geom_part_vtoc8 + GEOM partitioning class for SMI VTOC8 disk labels + + + + kern.features.geom_part_bsd + GEOM partitioning class for BSD disklabels + + + + kern.features.geom_part_ebr + GEOM partitioning class for extended boot records support + + + + kern.features.geom_part_ebr_compat + GEOM EBR partitioning class: + backward-compatible partition names + + + + kern.features.geom_part_gpt + GEOM partitioning class for GPT partitions + support + + + + kern.features.geom_part_apm + GEOM partitioning class for Apple-style + partitions + + + + kern.features.geom_part_mbr + GEOM partitioning class for MBR support + + + + + Boot Loader Changes @@ -420,20 +729,35 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile the information related to deleted data blocks to device, especially for SSD (Solid-State Drive) for optimization. - The following &man.sysctl.8; variables - for showing availability of UFS-related feature on the - system have been added: - kern.features.ufs_acl for ACL (Access - Control List) support in UFS, - kern.features.ufs_gjournal for journaling - support through &man.gjournal.8; for UFS, - kern.features.ufs_quota for UFS disk - quotas support, kern.features.ufs_quota64 - for 64-bit UFS disk quotas support, - kern.features.softupdates for FFS - soft-updates support, and - kern.features.ffs_snapshot for FFS - snapshot support. + The &os NFS subsystem has been + updated. The new implementation supports NFS version 4 in + addition to 2 and 3. The kernel options for the NFS server + and client are changed from NFSSERVER and + NFSCLIENT to NFSD and + NFSCL. &man.sysctl.8; variables which + start with vfs.nfssrv. have been renamed + with vfs.nfsd.. The NFS server now + supports vfs.nfsd.server_max_nfsvers and + vfs.nfsd.server_min_nfsvers + &man.sysctl.8; variables to specify the maximum and the + minimum version number which the server accepts. The + default value is set to 3 and + 2, respectively. + + To enable NFSv4, the following variables are needed on + the server side in &man.rc.conf.5;: + + nfsv_server_enable="YES" +nfsv4_server_enable="YES" +nfsuserd_enable="YES" + + and the following line is needed in + /etc/exports: + + V4: / + + For more information about NFSv4 and its configuration, + see &man.nfsv4.4; and &man.exports.5; manual pages. @@ -680,6 +1004,57 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile consistently supports space bar for selecting an item and enter key for OK/Cancel selection. + + + Partition Metadata Integrity Check + + &os; now checks the integrity of partition metadata when + a partition table is found on a disk though GEOM + PART subsystem. This detection + is automatically performed when a disk device is ready. + GEOM PART class in the kernel + verifies all generic partition parameters obtained from the + disk metadata, and if some inconsistency is detected, the + partition table will be rejected with the following + diagnostic message: + + GEOM_PART: Integrity check failed + + This integrity check is enabled by default. On a system + prior to &release.current;, the inconsistencies were + silently ignored. Therefore, there is possibility that this + prevents a system from booting after upgrading it to + &release.current;. More specifically, the kernel cannot + mount the system partition at boot time in some + cases. + + If this happens, a &man.loader.8; tunable + kern.geom.part.check_integrity can be + used as a workaround. Enter the following lines in the + &man.loader.8; prompt at boot time: + + set kern.geom.part.check_integrity="0" +boot + + These commands temporarily disable the integrity check. + If it was the cause, the &os; kernel should detect the + partitions after entering the commands as prior releases + did. This configuration can be added into + /boot/loader.conf like the + following: + + kern.geom.part.check_integrity="0" + + To check inconsistent metadata after booting on the + system, use the &man.gpart.8; utility on the system. A + corrupted entry will be displayed like the following: + + &prompt.user; gpart show +=> 63 1953525104 mirror/gm0 MBR (931G) [CORRUPT] + 63 1953525105 1 freebsd [active] (931G) + + For more information, see &man.gpart.8; manual page. + From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 19:52:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE7831065676; Sun, 8 Jan 2012 19:52:56 +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 ADE4C8FC0A; Sun, 8 Jan 2012 19: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 q08JquQg004605; Sun, 8 Jan 2012 19:52:56 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q08JqutG004603; Sun, 8 Jan 2012 19:52:56 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201201081952.q08JqutG004603@svn.freebsd.org> From: Hiroki Sato Date: Sun, 8 Jan 2012 19:52:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229820 - stable/9/release/doc/en_US.ISO8859-1/relnotes X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 19:52:57 -0000 Author: hrs Date: Sun Jan 8 19:52:56 2012 New Revision: 229820 URL: http://svn.freebsd.org/changeset/base/229820 Log: Add relnotes items: Capsicum Capability Mode, ng_one2many(4) XMIT_FAILOVER support added, kern.geom.confxml sysctl now support and , and ZFS SPA version 28. Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Sun Jan 8 19:24:08 2012 (r229819) +++ stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Sun Jan 8 19:52:56 2012 (r229820) @@ -184,6 +184,16 @@ Kernel Changes + &os; kernel now supports Capsicum + Capability Mode. Capsicum is a set of features for sandboxing + support, using a capability model in which the capabilities + are file descriptors. Two new kernel options + CAPABILITIES and + CAPABILITY_MODE have been added to + GENERIC kernel. For more information + about Capsicum, see . + &os; ELF image activator now supports PT_GNU_STACK program header. This is disabled by default. New &man.sysctl.8; @@ -673,6 +683,12 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile allows to select or query a congestion control algorithm that the TCP/IP network stack will use for connections on the socket. + + The &man.ng.one2many.4; + &man.netgraph.4; node now supports + XMIT_FAILOVER transmit algorithm. This + makes packets deliver out the first active + many hook. @@ -689,6 +705,12 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile supports bios-boot GUID for the GPT scheme which is used in GRUB 2 loader. + The &man.sysctl.8; variable + kern.geom.confxml now contains + information about disk identification in an + ident tag and disk model string in a + descr tag. + The &man.md.4; memory-backed pseudo disk device driver now supports a &man.sysctl.8; variable vm.md_malloc_wait to specify whether a @@ -702,7 +724,14 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile A bug in the &man.mmc.4; driver that could fail in device detection has been fixed. - + + ZFS subsystem has been updated to the + SPA (Storage Pool Allocator, also known as zpool) version + 28. It now supports data deduplication, triple parity RAIDZ + (raidz3), snapshot holds, log device removal, zfs diff, + zpool split, zpool import , and read-only + zpool import. + File Systems From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 20:09:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D263106564A; Sun, 8 Jan 2012 20:09:27 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 478408FC08; Sun, 8 Jan 2012 20:09:27 +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 q08K9R2c005286; Sun, 8 Jan 2012 20:09:27 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q08K9RoC005283; Sun, 8 Jan 2012 20:09:27 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201201082009.q08K9RoC005283@svn.freebsd.org> From: Alan Cox Date: Sun, 8 Jan 2012 20:09:27 +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: r229821 - in head/sys: fs/tmpfs kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 20:09:27 -0000 Author: alc Date: Sun Jan 8 20:09:26 2012 New Revision: 229821 URL: http://svn.freebsd.org/changeset/base/229821 Log: Correct an error of omission in the implementation of the truncation operation on POSIX shared memory objects and tmpfs. Previously, neither of these modules correctly handled the case in which the new size of the object or file was not a multiple of the page size. Specifically, they did not handle partial page truncation of data stored on swap. As a result, stale data might later be returned to an application. Interestingly, a data inconsistency was less likely to occur under tmpfs than POSIX shared memory objects. The reason being that a different mistake by the tmpfs truncation operation helped avoid a data inconsistency. If the data was still resident in memory in a PG_CACHED page, then the tmpfs truncation operation would reactivate that page, zero the truncated portion, and leave the page pinned in memory. More precisely, the benevolent error was that the truncation operation didn't add the reactivated page to any of the paging queues, effectively pinning the page. This page would remain pinned until the file was destroyed or the page was read or written. With this change, the page is now added to the inactive queue. Discussed with: jhb Reviewed by: kib (an earlier version) MFC after: 3 weeks Modified: head/sys/fs/tmpfs/tmpfs_subr.c head/sys/kern/uipc_shm.c Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Sun Jan 8 19:52:56 2012 (r229820) +++ head/sys/fs/tmpfs/tmpfs_subr.c Sun Jan 8 20:09:26 2012 (r229821) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -886,10 +887,10 @@ tmpfs_reg_resize(struct vnode *vp, off_t struct tmpfs_mount *tmp; struct tmpfs_node *node; vm_object_t uobj; - vm_page_t m; - vm_pindex_t newpages, oldpages; + vm_page_t m, ma[1]; + vm_pindex_t idx, newpages, oldpages; off_t oldsize; - size_t zerolen; + int base, rv; MPASS(vp->v_type == VREG); MPASS(newsize >= 0); @@ -912,15 +913,57 @@ tmpfs_reg_resize(struct vnode *vp, off_t newpages - oldpages > TMPFS_PAGES_AVAIL(tmp)) return (ENOSPC); - TMPFS_LOCK(tmp); - tmp->tm_pages_used += (newpages - oldpages); - TMPFS_UNLOCK(tmp); - - node->tn_size = newsize; - vnode_pager_setsize(vp, newsize); VM_OBJECT_LOCK(uobj); if (newsize < oldsize) { /* + * Zero the truncated part of the last page. + */ + base = newsize & PAGE_MASK; + if (base != 0) { + idx = OFF_TO_IDX(newsize); +retry: + m = vm_page_lookup(uobj, idx); + if (m != NULL) { + if ((m->oflags & VPO_BUSY) != 0 || + m->busy != 0) { + vm_page_sleep(m, "tmfssz"); + goto retry; + } + } else if (vm_pager_has_page(uobj, idx, NULL, NULL)) { + m = vm_page_alloc(uobj, idx, VM_ALLOC_NORMAL); + if (m == NULL) { + VM_OBJECT_UNLOCK(uobj); + VM_WAIT; + VM_OBJECT_LOCK(uobj); + goto retry; + } else if (m->valid != VM_PAGE_BITS_ALL) { + ma[0] = m; + rv = vm_pager_get_pages(uobj, ma, 1, 0); + m = vm_page_lookup(uobj, idx); + } else + /* A cached page was reactivated. */ + rv = VM_PAGER_OK; + vm_page_lock(m); + if (rv == VM_PAGER_OK) { + vm_page_deactivate(m); + vm_page_unlock(m); + vm_page_wakeup(m); + } else { + vm_page_free(m); + vm_page_unlock(m); + VM_OBJECT_UNLOCK(uobj); + return (EIO); + } + } + if (m != NULL) { + pmap_zero_page_area(m, base, PAGE_SIZE - base); + MPASS(m->valid == VM_PAGE_BITS_ALL); + vm_page_dirty(m); + vm_pager_page_unswapped(m); + } + } + + /* * Release any swap space and free any whole pages. */ if (newpages < oldpages) { @@ -928,19 +971,16 @@ tmpfs_reg_resize(struct vnode *vp, off_t newpages); vm_object_page_remove(uobj, newpages, 0, 0); } - - /* - * Zero the truncated part of the last page. - */ - zerolen = round_page(newsize) - newsize; - if (zerolen > 0) { - m = vm_page_grab(uobj, OFF_TO_IDX(newsize), - VM_ALLOC_NOBUSY | VM_ALLOC_NORMAL | VM_ALLOC_RETRY); - pmap_zero_page_area(m, PAGE_SIZE - zerolen, zerolen); - } } uobj->size = newpages; VM_OBJECT_UNLOCK(uobj); + + TMPFS_LOCK(tmp); + tmp->tm_pages_used += (newpages - oldpages); + TMPFS_UNLOCK(tmp); + + node->tn_size = newsize; + vnode_pager_setsize(vp, newsize); return (0); } Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Sun Jan 8 19:52:56 2012 (r229820) +++ head/sys/kern/uipc_shm.c Sun Jan 8 20:09:26 2012 (r229821) @@ -39,13 +39,6 @@ * * (3) Resource limits? Does this need its own resource limits or are the * existing limits in mmap(2) sufficient? - * - * (4) Partial page truncation. vnode_pager_setsize() will zero any parts - * of a partially mapped page as a result of ftruncate(2)/truncate(2). - * We can do the same (with the same pmap evil), but do we need to - * worry about the bits on disk if the page is swapped out or will the - * swapper zero the parts of a page that are invalid if the page is - * swapped back in for us? */ #include @@ -86,6 +79,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -253,9 +247,10 @@ static int shm_dotruncate(struct shmfd *shmfd, off_t length) { vm_object_t object; - vm_page_t m; - vm_pindex_t nobjsize; + vm_page_t m, ma[1]; + vm_pindex_t idx, nobjsize; vm_ooffset_t delta; + int base, rv; object = shmfd->shm_object; VM_OBJECT_LOCK(object); @@ -275,6 +270,56 @@ shm_dotruncate(struct shmfd *shmfd, off_ VM_OBJECT_UNLOCK(object); return (EBUSY); } + + /* + * Zero the truncated part of the last page. + */ + base = length & PAGE_MASK; + if (base != 0) { + idx = OFF_TO_IDX(length); +retry: + m = vm_page_lookup(object, idx); + if (m != NULL) { + if ((m->oflags & VPO_BUSY) != 0 || + m->busy != 0) { + vm_page_sleep(m, "shmtrc"); + goto retry; + } + } else if (vm_pager_has_page(object, idx, NULL, NULL)) { + m = vm_page_alloc(object, idx, VM_ALLOC_NORMAL); + if (m == NULL) { + VM_OBJECT_UNLOCK(object); + VM_WAIT; + VM_OBJECT_LOCK(object); + goto retry; + } else if (m->valid != VM_PAGE_BITS_ALL) { + ma[0] = m; + rv = vm_pager_get_pages(object, ma, 1, + 0); + m = vm_page_lookup(object, idx); + } else + /* A cached page was reactivated. */ + rv = VM_PAGER_OK; + vm_page_lock(m); + if (rv == VM_PAGER_OK) { + vm_page_deactivate(m); + vm_page_unlock(m); + vm_page_wakeup(m); + } else { + vm_page_free(m); + vm_page_unlock(m); + VM_OBJECT_UNLOCK(object); + return (EIO); + } + } + if (m != NULL) { + pmap_zero_page_area(m, base, PAGE_SIZE - base); + KASSERT(m->valid == VM_PAGE_BITS_ALL, + ("shm_dotruncate: page %p is invalid", m)); + vm_page_dirty(m); + vm_pager_page_unswapped(m); + } + } delta = ptoa(object->size - nobjsize); /* Toss in memory pages. */ @@ -289,45 +334,7 @@ shm_dotruncate(struct shmfd *shmfd, off_ /* Free the swap accounted for shm */ swap_release_by_cred(delta, object->cred); object->charge -= delta; - - /* - * If the last page is partially mapped, then zero out - * the garbage at the end of the page. See comments - * in vnode_pager_setsize() for more details. - * - * XXXJHB: This handles in memory pages, but what about - * a page swapped out to disk? - */ - if ((length & PAGE_MASK) && - (m = vm_page_lookup(object, OFF_TO_IDX(length))) != NULL && - m->valid != 0) { - int base = (int)length & PAGE_MASK; - int size = PAGE_SIZE - base; - - pmap_zero_page_area(m, base, size); - - /* - * Update the valid bits to reflect the blocks that - * have been zeroed. Some of these valid bits may - * have already been set. - */ - vm_page_set_valid_range(m, base, size); - - /* - * Round "base" to the next block boundary so that the - * dirty bit for a partially zeroed block is not - * cleared. - */ - base = roundup2(base, DEV_BSIZE); - - vm_page_clear_dirty(m, base, PAGE_SIZE - base); - } else if ((length & PAGE_MASK) && - __predict_false(object->cache != NULL)) { - vm_page_cache_free(object, OFF_TO_IDX(length), - nobjsize); - } } else { - /* Attempt to reserve the swap */ delta = ptoa(nobjsize - object->size); if (!swap_reserve_by_cred(delta, object->cred)) { From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 20:25:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B40521065670; Sun, 8 Jan 2012 20:25:29 +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 9F1138FC13; Sun, 8 Jan 2012 20:25: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 q08KPT7l005969; Sun, 8 Jan 2012 20:25:29 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q08KPTd1005965; Sun, 8 Jan 2012 20:25:29 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201201082025.q08KPTd1005965@svn.freebsd.org> From: Doug Barton Date: Sun, 8 Jan 2012 20:25: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: r229822 - in head/etc: . rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 20:25:29 -0000 Author: dougb Date: Sun Jan 8 20:25:29 2012 New Revision: 229822 URL: http://svn.freebsd.org/changeset/base/229822 Log: There is no longer a need to abstract ${rcvar_manpage} as we are not attempting to maintain compatibility with NetBSD for some years now. Modified: head/etc/rc.d/hostname head/etc/rc.subr Modified: head/etc/rc.d/hostname ============================================================================== --- head/etc/rc.d/hostname Sun Jan 8 20:09:26 2012 (r229821) +++ head/etc/rc.d/hostname Sun Jan 8 20:25:29 2012 (r229822) @@ -65,7 +65,7 @@ hostname_start() # Null hostname is probably OK if DHCP is in use. # if [ -z "`list_net_interfaces dhcp`" ]; then - warn "\$hostname is not set -- see ${rcvar_manpage}." + warn "\$hostname is not set -- see rc.conf(5)." fi return fi Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Sun Jan 8 20:09:26 2012 (r229821) +++ head/etc/rc.subr Sun Jan 8 20:25:29 2012 (r229822) @@ -32,7 +32,6 @@ # functions used by various rc scripts # -: ${rcvar_manpage:='rc.conf(5)'} : ${RC_PID:=$$}; export RC_PID # @@ -152,7 +151,7 @@ checkyesno() return 1 ;; *) - warn "\$${1} is not set properly - see ${rcvar_manpage}." + warn "\$${1} is not set properly - see rc.conf(5)." return 1 ;; esac From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 20:35:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30CA21065670; Sun, 8 Jan 2012 20:35:54 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-tul01m020-f182.google.com (mail-tul01m020-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id CBBB98FC0C; Sun, 8 Jan 2012 20:35:53 +0000 (UTC) Received: by obbwd18 with SMTP id wd18so4777601obb.13 for ; Sun, 08 Jan 2012 12:35:53 -0800 (PST) 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=UgH8tlPkSeU2MXA1zAzRsFQ6+euBUu1QKBmFGf1Wi+Y=; b=WtT7NEcQIafvG3k+LFBWylY1wXTQ0rzTjtOreB2kBAkI9nG2xRlYxBhLk/5aVLSA9m A1mEjWpHJRM2fz+cff3OryCwialqVC+aJEJiOOutNrDL6zXSllozpvj3w7CNrFUN28Xp WAnN9KYTfDAXQ7PGX+NUTVRcN4PE13O2ztL9A= MIME-Version: 1.0 Received: by 10.182.117.97 with SMTP id kd1mr12128675obb.50.1326054953162; Sun, 08 Jan 2012 12:35:53 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.182.171.67 with HTTP; Sun, 8 Jan 2012 12:35:53 -0800 (PST) In-Reply-To: <4F08A518.8090207@FreeBSD.org> References: <201112300624.pBU6OxO9098906@svn.freebsd.org> <4F08A518.8090207@FreeBSD.org> Date: Sun, 8 Jan 2012 23:35:53 +0300 X-Google-Sender-Auth: DmKntepnk0xmNnWaWNM6jcEEsX4 Message-ID: From: Sergey Kandaurov To: Dimitry Andric 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, Devin Teske Subject: Re: svn commit: r228985 - head/sys/boot/forth X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 20:35:54 -0000 On 8 January 2012 00:03, Dimitry Andric wrote: > On 2011-12-30 07:24, Sergey Kandaurov wrote: >> >> Author: pluknet >> Date: Fri Dec 30 06:24:59 2011 >> New Revision: 228985 >> URL: http://svn.freebsd.org/changeset/base/228985 >> >> Log: >> =A0 Unset the environment variables associated with individual menu item= s >> =A0 before invoking the kernel. > > > When I did a single-user mode boot to install a new world, I saw the > following warning on the (serial) console during boot: > > =A0/boot.config: -D -S115200 > =A0Consoles: internal video/keyboard =A0serial port > =A0BIOS drive A: is disk0 > =A0BIOS drive C: is disk1 > =A0BIOS 638kB/3143616kB available memory > > =A0FreeBSD/x86 bootstrap loader, Revision 1.1 > =A0(dim@vm-freebsd10-amd64.home.andric.com, Sat Jan =A07 01:05:07 CET 201= 2) > =A0Loading /boot/defaults/loader.conf > =A0/boot/kernel/kernel data=3D0xb73530 data=3D0x11dbe0+0x2b4db8 > syms=3D[0x8+0xfd620+0x8+0xec6b6] > =A0- > =A0Hit [Enter] to boot immediately, or any other key for command prompt. > > > =A0Type '?' for a list of commands, 'help' for more detailed help. > =A0OK boot -s > =A0menu-unset not found =A0 =A0 =A0 =A0 =A0 <<-- what's this? > =A0GDB: no debug ports present > =A0KDB: debugger backends: ddb > =A0KDB: current backend: ddb > =A0[...kernel boots...] > > E.g, it always gives a 'menu-unset not found' warning (or maybe it's an > error, it's not clear). =A0This was not the case before r228985. > > I have almost no knowledge about forth, but it looks like this might be > caused by the new try-menu-unset subroutine. > > My loader.conf is just this: > > =A0beastie_disable=3D"YES" > =A0comconsole_speed=3D"115200" > =A0console=3D"comconsole vidconsole" > =A0kern.hz=3D"100" So, the problem arise when beastie_disable is set. In this case menu.rc is not evaluated and consequently menu-unset does not have a body yet. This results in the ficl warning "not found" when try-menu-unset calls menu-unset. The warning cannot be handled with catch as seen with the code in head. Otherwise, when beastie is enabled, all works as it should. To "fix" the problem I replaced 'catch' with 'sfind', so that we can conditionally call menu-unset only when the definition is present. Please try the following patch. I tested it with enabled/disabled beastie and loader_color over serial console. I would also like to get a review from Devin Teske to see if this change is acceptable. %%% Index: sys/boot/forth/loader.4th =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/boot/forth/loader.4th (revision 229670) +++ sys/boot/forth/loader.4th (working copy) @@ -45,8 +45,10 @@ : try-menu-unset s" menu-unset" - ['] evaluate catch if - 2drop + sfind if + execute + else + drop then ; %%% [ It could be simplified with one-liner: s" menu-unset" sfind drop execute but ficl doesn't like this in a freestanding environment.] --=20 wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 21:00:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 482411065670; Sun, 8 Jan 2012 21:00:38 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 179608FC0A; Sun, 8 Jan 2012 21:00: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 q08L0bgW007337; Sun, 8 Jan 2012 21:00:37 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q08L0bXs007333; Sun, 8 Jan 2012 21:00:37 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201082100.q08L0bXs007333@svn.freebsd.org> From: Eitan Adler Date: Sun, 8 Jan 2012 21:00:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229823 - in stable/9: include lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 21:00:38 -0000 Author: eadler (ports committer) Date: Sun Jan 8 21:00:37 2012 New Revision: 229823 URL: http://svn.freebsd.org/changeset/base/229823 Log: MFC r228754: - Add restrict keyword to glob(3) PR: kern/161958 Approved by: jilles Modified: stable/9/include/glob.h stable/9/lib/libc/gen/glob.3 stable/9/lib/libc/gen/glob.c Directory Properties: stable/9/include/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/include/glob.h ============================================================================== --- stable/9/include/glob.h Sun Jan 8 20:25:29 2012 (r229822) +++ stable/9/include/glob.h Sun Jan 8 21:00:37 2012 (r229823) @@ -98,7 +98,8 @@ typedef struct { #endif /* __BSD_VISIBLE */ __BEGIN_DECLS -int glob(const char *, int, int (*)(const char *, int), glob_t *); +int glob(const char * __restrict, int, + int (*)(const char *, int), glob_t * __restrict); void globfree(glob_t *); __END_DECLS Modified: stable/9/lib/libc/gen/glob.3 ============================================================================== --- stable/9/lib/libc/gen/glob.3 Sun Jan 8 20:25:29 2012 (r229822) +++ stable/9/lib/libc/gen/glob.3 Sun Jan 8 21:00:37 2012 (r229823) @@ -30,7 +30,7 @@ .\" @(#)glob.3 8.3 (Berkeley) 4/16/94 .\" $FreeBSD$ .\" -.Dd February 15, 2011 +.Dd December 20, 2011 .Dt GLOB 3 .Os .Sh NAME @@ -42,7 +42,7 @@ .Sh SYNOPSIS .In glob.h .Ft int -.Fn glob "const char *pattern" "int flags" "int (*errfunc)(const char *, int)" "glob_t *pglob" +.Fn glob "const char * restrict pattern" "int flags" "int (*errfunc)(const char *, int)" "glob_t * restrict pglob" .Ft void .Fn globfree "glob_t *pglob" .Sh DESCRIPTION Modified: stable/9/lib/libc/gen/glob.c ============================================================================== --- stable/9/lib/libc/gen/glob.c Sun Jan 8 20:25:29 2012 (r229822) +++ stable/9/lib/libc/gen/glob.c Sun Jan 8 21:00:37 2012 (r229823) @@ -163,7 +163,8 @@ static void qprintf(const char *, Char #endif int -glob(const char *pattern, int flags, int (*errfunc)(const char *, int), glob_t *pglob) +glob(const char * __restrict pattern, int flags, + int (*errfunc)(const char *, int), glob_t * __restrict pglob) { const char *patnext; size_t limit; From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 21:01:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34F0E106567A; Sun, 8 Jan 2012 21:01:22 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1FB148FC0A; Sun, 8 Jan 2012 21:01: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 q08L1M1N007400; Sun, 8 Jan 2012 21:01:22 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q08L1Lv0007397; Sun, 8 Jan 2012 21:01:21 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201082101.q08L1Lv0007397@svn.freebsd.org> From: Eitan Adler Date: Sun, 8 Jan 2012 21:01:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229824 - in stable/8: include lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 21:01:22 -0000 Author: eadler (ports committer) Date: Sun Jan 8 21:01:21 2012 New Revision: 229824 URL: http://svn.freebsd.org/changeset/base/229824 Log: MFC r228754: - Add restrict keyword to glob(3) PR: kern/161958 Approved by: jilles Modified: stable/8/include/glob.h stable/8/lib/libc/gen/glob.c Directory Properties: stable/8/include/ (props changed) stable/8/lib/libc/ (props changed) Modified: stable/8/include/glob.h ============================================================================== --- stable/8/include/glob.h Sun Jan 8 21:00:37 2012 (r229823) +++ stable/8/include/glob.h Sun Jan 8 21:01:21 2012 (r229824) @@ -102,7 +102,8 @@ typedef struct { #endif /* __BSD_VISIBLE */ __BEGIN_DECLS -int glob(const char *, int, int (*)(const char *, int), glob_t *); +int glob(const char * __restrict, int, + int (*)(const char *, int), glob_t * __restrict); void globfree(glob_t *); __END_DECLS Modified: stable/8/lib/libc/gen/glob.c ============================================================================== --- stable/8/lib/libc/gen/glob.c Sun Jan 8 21:00:37 2012 (r229823) +++ stable/8/lib/libc/gen/glob.c Sun Jan 8 21:01:21 2012 (r229824) @@ -163,7 +163,8 @@ static void qprintf(const char *, Char #endif int -glob(const char *pattern, int flags, int (*errfunc)(const char *, int), glob_t *pglob) +glob(const char * __restrict pattern, int flags, + int (*errfunc)(const char *, int), glob_t * __restrict pglob) { const char *patnext; size_t limit; From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 21:01:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 519151065670; Sun, 8 Jan 2012 21:01:52 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B4BE8FC1C; Sun, 8 Jan 2012 21:01:52 +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 q08L1qx4007458; Sun, 8 Jan 2012 21:01:52 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q08L1qB2007454; Sun, 8 Jan 2012 21:01:52 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201082101.q08L1qB2007454@svn.freebsd.org> From: Eitan Adler Date: Sun, 8 Jan 2012 21:01:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229825 - in stable/7: include lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 21:01:52 -0000 Author: eadler (ports committer) Date: Sun Jan 8 21:01:51 2012 New Revision: 229825 URL: http://svn.freebsd.org/changeset/base/229825 Log: MFC r228754: - Add restrict keyword to glob(3) PR: kern/161958 Approved by: jilles Modified: stable/7/include/glob.h stable/7/lib/libc/gen/glob.c Directory Properties: stable/7/include/ (props changed) stable/7/lib/libc/ (props changed) Modified: stable/7/include/glob.h ============================================================================== --- stable/7/include/glob.h Sun Jan 8 21:01:21 2012 (r229824) +++ stable/7/include/glob.h Sun Jan 8 21:01:51 2012 (r229825) @@ -102,7 +102,8 @@ typedef struct { #endif /* __BSD_VISIBLE */ __BEGIN_DECLS -int glob(const char *, int, int (*)(const char *, int), glob_t *); +int glob(const char * __restrict, int, + int (*)(const char *, int), glob_t * __restrict); void globfree(glob_t *); __END_DECLS Modified: stable/7/lib/libc/gen/glob.c ============================================================================== --- stable/7/lib/libc/gen/glob.c Sun Jan 8 21:01:21 2012 (r229824) +++ stable/7/lib/libc/gen/glob.c Sun Jan 8 21:01:51 2012 (r229825) @@ -163,7 +163,8 @@ static void qprintf(const char *, Char #endif int -glob(const char *pattern, int flags, int (*errfunc)(const char *, int), glob_t *pglob) +glob(const char * __restrict pattern, int flags, + int (*errfunc)(const char *, int), glob_t * __restrict pglob) { const char *patnext; size_t limit; From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 22:23:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD3D5106564A; Sun, 8 Jan 2012 22:23:19 +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 9674E8FC14; Sun, 8 Jan 2012 22:23:19 +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 q08MNJ8J010177; Sun, 8 Jan 2012 22:23:19 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q08MNJBI010175; Sun, 8 Jan 2012 22:23:19 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201201082223.q08MNJBI010175@svn.freebsd.org> From: Hiroki Sato Date: Sun, 8 Jan 2012 22:23:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229826 - stable/9/release/doc/en_US.ISO8859-1/relnotes X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 22:23:19 -0000 Author: hrs Date: Sun Jan 8 22:23:19 2012 New Revision: 229826 URL: http://svn.freebsd.org/changeset/base/229826 Log: Add relnotes items: {get,set}loginclass(2) added, machdep.disable_tsc tunable added, ng_netflow(4) now supports NetFlow v9, cexp(3) and cexpf(3) added, gpart(8) show -p flag added, hashd(8) checksum algo selection in a resource section, hashd(8) compression algo selection in a resource section, ps(1) -o class added, gdtoa to 20110304, tzdata2011c. Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Sun Jan 8 21:01:51 2012 (r229825) +++ stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Sun Jan 8 22:23:19 2012 (r229826) @@ -202,6 +202,13 @@ PT_GNU_STACK for the specified ABIs (e.g. elf32 for 32-bit ABI). + Two new system calls + setloginclass(2) and + getloginclass(2) have been added. This + makes it possible for the kernel to track login class the + process is assigned to, which is required for RCTL + framework. + The following &man.sysctl.8; variables for showing availability of various kernel features: @@ -524,6 +531,13 @@ supports Sony Playstation 3 using the OtherOS feature available on firmwares 3.15 and earlier. + A new &man.loader.8; tunable + machdep.disable_tsc has been added. + Setting this to a non-zero value disables use of TSC (Time + Stamp Counter) by turning off boot-time CPU frequency + calibration, DELAY(9) with TSC, and using TSC as a CPU + ticker. + Multimedia Support @@ -689,6 +703,12 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile XMIT_FAILOVER transmit algorithm. This makes packets deliver out the first active many hook. + + The &man.ng.netflow.4; + &man.netgraph.4; node now supports NetFlow version 9. A new + export9 hook has been added for NetFlow + v9 data. Note that the data export can be done + simultaneously in both version 5 and version 9. @@ -793,6 +813,10 @@ nfsuserd_enable="YES" Userland Changes + Complex exponential functions + &man.cexp.3; and &man.cexpf.3; have been added to + libm. + The &man.cpuset.1; utility now supports a flag to create a new cpuset and assign an existing process into that set, and an @@ -804,10 +828,29 @@ nfsuserd_enable="YES" could prevent STAT FTP command from working properly has been fixed. + The &man.gpart.8; utility now supports a + flag to show + subcommand. This allows to show provider's names of + partitions instead of partition's indexes. + The &man.hastd.8; utility now drops root privileges of the worker processes to hast user. + The &man.hastd.8; utility now supports + checksum keyword to specify checksum + algorithm in a resource section. As of + &release.current;, none, + sha256, and crc32 are + supported. + + The &man.hastd.8; utility now supports + compression keyword to specify compression + algorithm in a resource section. As of + &release.current;, none, + hole and lzf are + supported. + An implementation of iconv() API libraries and utilities which are standardized in Single UNIX Specification have been @@ -851,6 +894,10 @@ nfsuserd_enable="YES" and description subcommands in the &man.ifconfig.8; utility. + The &man.ps.1; utility now supports an + option to display login class + information of each process. + The &man.rtld.1; runtime linker now supports shared objects as filters in ELF shared libraries. Both standard and auxiliary filtering have been supported. The @@ -935,6 +982,11 @@ nfsuserd_enable="YES" dialog has been updated to version 1.1-20110707. + gdtoa, a set + of binary from/to decimal number conversion routines used in + &os; libc library has been updated + to a snapshot as of 4 March, 2011. + The LLVM compiler infrastructure and the clang, a C language family @@ -946,9 +998,9 @@ nfsuserd_enable="YES" CPP &man.make.1; variables, respectively. - The timezone + The timezone database has been updated to the - tzdata2011a release. + tzdata2011c release. &man.unifdef.1; utility has been updated to version 2.5.6. From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 22:34:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D629B106564A; Sun, 8 Jan 2012 22:34:39 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id 6DBC98FC12; Sun, 8 Jan 2012 22:34:39 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 79F032A28DFB; Sun, 8 Jan 2012 23:34:38 +0100 (CET) Date: Sun, 8 Jan 2012 23:34:38 +0100 From: Ed Schouten To: Hiroki Sato Message-ID: <20120108223438.GO5300@hoeg.nl> References: <201201081740.q08HeA5p000334@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/7+LvQqw8N5lf/3J" Content-Disposition: inline In-Reply-To: <201201081740.q08HeA5p000334@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org Subject: Re: svn commit: r229817 - stable/9/release/doc/en_US.ISO8859-1/relnotes X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 22:34:40 -0000 --/7+LvQqw8N5lf/3J Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello Hiroki, * Hiroki Sato , 20120108 18:40: > + A &man.utxrm.8; utility has been added. > + This allows one to remove an entry from the > + utmpx database by hand. This is useful > + when a login daemon crashes or fails to remove the entry > + during shutdown. We shouldn't forget to document the addition of utmpx as well. Any comments on the following? Index: article.sgml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- article.sgml (revision 229826) +++ article.sgml (working copy) @@ -953,6 +953,13 @@ && and || around an arithmetic expression has been fixed. =20 + The &man.utmp.5; user accounting database + has been replaced by &man.utmpx.3;. User accounting utilities + will now use utmpx database files + exclusively. The &man.wtmpcvt.1; utility can be used to convert + wtmp files to the new format, making it + possible to read them using the updated utilities. + A &man.utxrm.8; utility has been added. This allows one to remove an entry from the utmpx database by hand. This is useful --=20 Ed Schouten WWW: http://80386.nl/ --/7+LvQqw8N5lf/3J Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iQIcBAEBAgAGBQJPChn+AAoJEG5e2P40kaK7iAgQAKUc5e8WEylmtzpeUXGhbMLk MCg2uPFT7ye5zbF9Z8ffXCHLCyatFM5DDsDfUictlIEclY/MkbF2Y4FDGqYXqw6C amrBYlaEObWQJGMCyLJ79YbrOYv8ileqzEd29Xfk/sSTEaPdwtigiaRPTNSjumw4 7I3KSZho17DanIayEcZZJ7gYBF4AaRjqkxwsHqTzYmClr41f6xWcJbzXyxJzM55J sjFpjc/lEe35VS9emY9sK/LB7/Qbl5abpNdf75a8R8xb3I687S2F0dhm2f37Syaz LZNyPTS8SsoYCqVK8nZSsMWqZSdgYgKriLoIGjQDyuf1qGGvowYR0q5/HHPc7/6+ UORM1gn2R3O9B8BfopoeMXQEMRCBwFKk/DfIdWLCvpc5l8S8mT7iMohNh6g/VCPX z+OsuwNqkbuIW75Ua5O4U2v8JL+AMoPPMb1nsGwXE1orZ65+oJW1uj2lbvYHpCci R0p8GDtqkrzK89b9U73Agt2Jx0MQZqdKP7f5uzh3O5PKad1e5qjB+RGYha9mUacs cC/znO9BKXKJ+gN+EiXukFT5hQqSkN8xQmUDdJsmnxShOLTExXs2pbWZ5Vn4g6va fJ5rubPg9UMRCwTDwXf2ME0VyVWtR0Q0Q1yxla61i6+iG75Hcs1tJiq0jJG8KWuz 0twhTWNZ/Btt2zCNFRIi =DwKj -----END PGP SIGNATURE----- --/7+LvQqw8N5lf/3J-- From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 22:55:48 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFC81106564A; Sun, 8 Jan 2012 22:55:48 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 6CBA48FC13; Sun, 8 Jan 2012 22:55:48 +0000 (UTC) Received: from lstewart1.loshell.room52.net (ppp59-167-184-191.static.internode.on.net [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id E097A7E824; Mon, 9 Jan 2012 09:55:45 +1100 (EST) Message-ID: <4F0A1EF1.8090003@freebsd.org> Date: Mon, 09 Jan 2012 09:55:45 +1100 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:7.0.1) Gecko/20111016 Thunderbird/7.0.1 MIME-Version: 1.0 To: Hiroki Sato References: <201201081354.q08Ds9GQ093105@svn.freebsd.org> In-Reply-To: <201201081354.q08Ds9GQ093105@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lauren.room52.net Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-9@FreeBSD.org Subject: Re: svn commit: r229812 - stable/9/release/doc/en_US.ISO8859-1/relnotes X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 22:55:48 -0000 Hi Hiroki-san, On 01/09/12 00:54, Hiroki Sato wrote: > Author: hrs > Date: Sun Jan 8 13:54:08 2012 > New Revision: 229812 > URL: http://svn.freebsd.org/changeset/base/229812 > > Log: > Add relnotes items: > igb(4) Intel I350 GbE support, > re(4) TX IP checksum disabled on RTL8168C-based cards, > cc(9) TCP congestion control algorithm framework added, > gpart(8) various aliases and bios-boot GUID added, > FFS SU+J added, > more kern.features.* for UFS-related features, > hastd(8) drops root privilege in worker processes, > newsyslog(8) xz compression support added, > ppp(8) iface name and iface description commands added, > sh(1) arithmetic expression handling updated, > ISC BIND to 9.8.1-P1, and > tzdata2011a. > > Modified: > stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml > > Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml > ============================================================================== [snip] cc(4) and cc(9) were renamed to mod_cc(4) and mod_cc(9) in r225583 to avoid overlap with the cc(1) GCC man page. Would you mind correcting the references in the entry below? > @@ -315,11 +321,39 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile > been fixed. The source address selection could not being > performed when multicast options were present but without an > interface being specified. > + > + > + &os; TCP/IP network stack now supports&man.cc.9; pluggable > + congestion control framework. This allows TCP congestion > + control algorithms to be implemented as dynamically loadable > + kernel modules. The following kernel modules are available > + as of&release.current;:&man.cc.chd.4; for > + CAIA-Hamilton-Delay algorithm,&man.cc.cubic.4; for CUBIC > + algorithm,&man.cc.hd.4; for Hamilton-Delay algorithm, > + &man.cc.htcp.4; for H-TCP algorithm,&man.cc.newreno.4; for > + NewReno algorithm, and&man.cc.vegas.4; for Vegas algorithm. > + The default algorithm can be set by a new&man.sysctl.8; > + variablenet.inet.tcp.cc.algorithm. The > + value must be set to one of the names listed by the > + net.inet.tcp.cc.available, and > + newreno is set at boot time. For more > + detail, see&man.cc.9; manual page. > Thanks for once again doing the release notes. Cheers, Lawrence From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 22:58:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4264A106566C; Sun, 8 Jan 2012 22:58:57 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id C1E438FC0C; Sun, 8 Jan 2012 22:58:56 +0000 (UTC) Received: by iadj38 with SMTP id j38so8122654iad.13 for ; Sun, 08 Jan 2012 14:58:56 -0800 (PST) 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=mtfRRB6QcW9ZHExqisZqZGBLTyJAdyG3HY4I6xndYl8=; b=f8JCaaNBmZW6I7WKZvFqZcZU/kk/2R8QhCQPuc4hO9TbfY90gFfcNe3LxdwdDZeKsa 2ItTAGfYcvEKop4y5vJUVYgH1vsOgUgsXC3FbwQIHDVHaAu29EAs0RgT6Gl5mScrpS2R 5I0K6lJyI91MhJRks+6DDfxy7Xu7d8RXUHsE8= MIME-Version: 1.0 Received: by 10.50.190.196 with SMTP id gs4mr16712731igc.14.1326063536504; Sun, 08 Jan 2012 14:58:56 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.42.243.65 with HTTP; Sun, 8 Jan 2012 14:58:56 -0800 (PST) In-Reply-To: <20120108104330.GC1674@garage.freebsd.pl> References: <201201080055.q080tMlJ063808@svn.freebsd.org> <20120108104330.GC1674@garage.freebsd.pl> Date: Sun, 8 Jan 2012 14:58:56 -0800 X-Google-Sender-Auth: wqJVW4mIpusncQ7KDB5RuY8vzRg Message-ID: From: Adrian Chadd To: Pawel Jakub Dawidek Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r229800 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 22:58:57 -0000 On 8 January 2012 02:43, Pawel Jakub Dawidek wrote: > If someone is actually using GENERIC kernel. This change will break all > my system next time I upgrade. Adding UFS_ACL option to the kernel > config to make ZFS kernel module to work doesn't sound very intuitive. > > I understand what you are trying to accomplish, but we really need to > find better way to do this. Until then, could you back it out? I'd rather find a cleaner solution - it's pulling in code which just isn't being used if you aren't using UFS_ACL or ZFS. How about wrapping those two up in a module which zfs can register a dependency on? Adrian From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 23:05:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC8B01065673; Sun, 8 Jan 2012 23:05:36 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 963AF8FC0A; Sun, 8 Jan 2012 23:05: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 q08N5atq011697; Sun, 8 Jan 2012 23:05:36 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q08N5amw011695; Sun, 8 Jan 2012 23:05:36 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201201082305.q08N5amw011695@svn.freebsd.org> From: Rick Macklem Date: Sun, 8 Jan 2012 23:05:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229827 - stable/9/sys/fs/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 23:05:36 -0000 Author: rmacklem Date: Sun Jan 8 23:05:36 2012 New Revision: 229827 URL: http://svn.freebsd.org/changeset/base/229827 Log: MFC: r228560 Patch the new NFS server in a manner analagous to r228520 for the old NFS server, so that it correctly handles a count == 0 argument for Commit. Modified: stable/9/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/9/sys/fs/nfsserver/nfs_nfsdport.c Sun Jan 8 22:23:19 2012 (r229826) +++ stable/9/sys/fs/nfsserver/nfs_nfsdport.c Sun Jan 8 23:05:36 2012 (r229827) @@ -1254,7 +1254,13 @@ nfsvno_fsync(struct vnode *vp, u_int64_t { int error = 0; - if (cnt > MAX_COMMIT_COUNT) { + /* + * RFC 1813 3.3.21: if count is 0, a flush from offset to the end of + * file is done. At this time VOP_FSYNC does not accept offset and + * byte count parameters so call VOP_FSYNC the whole file for now. + * The same is true for NFSv4: RFC 3530 Sec. 14.2.3. + */ + if (cnt == 0 || cnt > MAX_COMMIT_COUNT) { /* * Give up and do the whole thing */ From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 23:06:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E934106566B; Sun, 8 Jan 2012 23:06:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 696228FC13; Sun, 8 Jan 2012 23:06:53 +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 q08N6r2u011771; Sun, 8 Jan 2012 23:06:53 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q08N6rDQ011768; Sun, 8 Jan 2012 23:06:53 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201082306.q08N6rDQ011768@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 8 Jan 2012 23:06:53 +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: r229828 - in head/sys: kern ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 23:06:53 -0000 Author: kib Date: Sun Jan 8 23:06:53 2012 New Revision: 229828 URL: http://svn.freebsd.org/changeset/base/229828 Log: Avoid LOR between vfs_busy() lock and covered vnode lock on quotaon(). The vfs_busy() is after covered vnode lock in the global lock order, but since quotaon() does recursive VFS call to open quota file, we usually end up locking covered vnode after mp is busied in sys_quotactl(). Change the interface of VFS_QUOTACTL(), requiring that mp was unbusied by fs code, and do not try to pick up vfs_busy() reference in ufs quotaon, esp. if vfs_busy cannot succeed due to unmount being performed. Reported and tested by: pho MFC after: 1 week Modified: head/sys/kern/vfs_syscalls.c head/sys/ufs/ufs/ufs_quota.c Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Sun Jan 8 23:05:36 2012 (r229827) +++ head/sys/kern/vfs_syscalls.c Sun Jan 8 23:06:53 2012 (r229828) @@ -86,6 +86,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + static MALLOC_DEFINE(M_FADVISE, "fadvise", "posix_fadvise(2) information"); SDT_PROVIDER_DEFINE(vfs); @@ -212,7 +214,20 @@ sys_quotactl(td, uap) return (error); } error = VFS_QUOTACTL(mp, uap->cmd, uap->uid, uap->arg); - vfs_unbusy(mp); + + /* + * Since quota on operation typically needs to open quota + * file, the Q_QUOTAON handler needs to unbusy the mount point + * before calling into namei. Otherwise, unmount might be + * started between two vfs_busy() invocations (first is our, + * second is from mount point cross-walk code in lookup()), + * causing deadlock. + * + * Require that Q_QUOTAON handles the vfs_busy() reference on + * its own, always returning with ubusied mount point. + */ + if ((uap->cmd >> SUBCMDSHIFT) != Q_QUOTAON) + vfs_unbusy(mp); VFS_UNLOCK_GIANT(vfslocked); return (error); } Modified: head/sys/ufs/ufs/ufs_quota.c ============================================================================== --- head/sys/ufs/ufs/ufs_quota.c Sun Jan 8 23:05:36 2012 (r229827) +++ head/sys/ufs/ufs/ufs_quota.c Sun Jan 8 23:06:53 2012 (r229828) @@ -512,17 +512,29 @@ quotaon(struct thread *td, struct mount NDINIT(&nd, LOOKUP, FOLLOW | MPSAFE, UIO_USERSPACE, fname, td); flags = FREAD | FWRITE; + vfs_ref(mp); + vfs_unbusy(mp); error = vn_open(&nd, &flags, 0, NULL); - if (error) + if (error != 0) { + vfs_rel(mp); return (error); + } vfslocked = NDHASGIANT(&nd); NDFREE(&nd, NDF_ONLY_PNBUF); vp = nd.ni_vp; - if (vp->v_type != VREG) { + error = vfs_busy(mp, MBF_NOWAIT); + vfs_rel(mp); + if (error == 0) { + if (vp->v_type != VREG) { + error = EACCES; + vfs_unbusy(mp); + } + } + if (error != 0) { VOP_UNLOCK(vp, 0); (void) vn_close(vp, FREAD|FWRITE, td->td_ucred, td); VFS_UNLOCK_GIANT(vfslocked); - return (EACCES); + return (error); } UFS_LOCK(ump); @@ -531,6 +543,7 @@ quotaon(struct thread *td, struct mount VOP_UNLOCK(vp, 0); (void) vn_close(vp, FREAD|FWRITE, td->td_ucred, td); VFS_UNLOCK_GIANT(vfslocked); + vfs_unbusy(mp); return (EALREADY); } ump->um_qflags[type] |= QTF_OPENING|QTF_CLOSING; @@ -542,6 +555,7 @@ quotaon(struct thread *td, struct mount UFS_UNLOCK(ump); (void) vn_close(vp, FREAD|FWRITE, td->td_ucred, td); VFS_UNLOCK_GIANT(vfslocked); + vfs_unbusy(mp); return (error); } VOP_UNLOCK(vp, 0); @@ -619,6 +633,7 @@ again: ("quotaon: leaking flags")); UFS_UNLOCK(ump); + vfs_unbusy(mp); return (error); } From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 23:11:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A7821065672; Sun, 8 Jan 2012 23:11:04 +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 0B3658FC08; Sun, 8 Jan 2012 23:11: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 q08NB3Iw011944; Sun, 8 Jan 2012 23:11:03 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q08NB3oI011942; Sun, 8 Jan 2012 23:11:03 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201201082311.q08NB3oI011942@svn.freebsd.org> From: Hiroki Sato Date: Sun, 8 Jan 2012 23:11:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229829 - stable/9/release/doc/en_US.ISO8859-1/relnotes X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 23:11:04 -0000 Author: hrs Date: Sun Jan 8 23:11:03 2012 New Revision: 229829 URL: http://svn.freebsd.org/changeset/base/229829 Log: Add relnotes items: DTrace systrace support for freebsd32 and linux32 on am64, loader(8) pre-boot virtual memory support on ia64, bxe(4) for BCM57710, BCM57711, BCM57711E added, cbrtl(3) (cube root) added, pam_group(8) ruser and luser options, tzdata2011d. Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Sun Jan 8 23:06:53 2012 (r229828) +++ stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Sun Jan 8 23:11:03 2012 (r229829) @@ -194,6 +194,17 @@ about Capsicum, see . + The &os; + &man.dtrace.1; framework now supports + systrace for system calls of + linux32 and freebsd32 on + &os;/&arch.amd64;. Two new + systrace_linux32 and + systrace_freebsd32 kernel modules provide + support for tracing compat system calls in addition to native + system call tracing provided by the + systrace module. + &os; ELF image activator now supports PT_GNU_STACK program header. This is disabled by default. New &man.sysctl.8; @@ -521,8 +532,13 @@ Boot Loader Changes - - + The &man.loader.8; loader + now supports PBVM (Pre-Boot Virtual Memory). This allows to + link the kernel at a fixed virtual address without having to + make any assumptions about the physical memory layout. The + PBVM also allows fine control of the address where the + kernel and its modules to be loaded. + Hardware Support @@ -551,6 +567,10 @@ could make AR8152-based network interfaces stop working has been fixed. + bxe(4) driver for Broadcom NetXtreme + II 10GbE controller (BCM57710, BCM57711, BCM57711E) has + been added. + A &man.cxgbe.4; driver for Chelsio T4 (Terminator 4) based 10Gb/1Gb adapters has been added. @@ -813,8 +833,9 @@ nfsuserd_enable="YES" Userland Changes - Complex exponential functions - &man.cexp.3; and &man.cexpf.3; have been added to + Complex exponential functions + &man.cexp.3; and &man.cexpf.3;, and cube root function + &man.cbrtl.3; have been added to libm. The &man.cpuset.1; utility now supports @@ -881,6 +902,15 @@ nfsuserd_enable="YES" in the optional field has been added to specify the compression. + The &man.pam.group.8; module now + supports and + options. The make it accept or reject + based on the supplicant's group membership and this is the + default behavior. The checks the + target user's group membership instead of the supplicant's + one. If neither option was specified, &man.pam.group.8; + assumes and issues a warning. + A &man.poweroff.8; utility has been added. This is equivalent to: @@ -998,9 +1028,9 @@ nfsuserd_enable="YES" CPP &man.make.1; variables, respectively. - The timezone + The timezone database has been updated to the - tzdata2011c release. + tzdata2011d release. &man.unifdef.1; utility has been updated to version 2.5.6. From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 23:20:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9ED6106564A; Sun, 8 Jan 2012 23:20:02 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 566698FC08; Sun, 8 Jan 2012 23:20:02 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id 73783635; Mon, 9 Jan 2012 00:20:00 +0100 (CET) Date: Mon, 9 Jan 2012 00:18:53 +0100 From: Pawel Jakub Dawidek To: Adrian Chadd Message-ID: <20120108231852.GB1654@garage.freebsd.pl> References: <201201080055.q080tMlJ063808@svn.freebsd.org> <20120108104330.GC1674@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wq9mPyueHGvFACwf" Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 9.0-CURRENT amd64 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: r229800 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 23:20:02 -0000 --wq9mPyueHGvFACwf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jan 08, 2012 at 02:58:56PM -0800, Adrian Chadd wrote: > On 8 January 2012 02:43, Pawel Jakub Dawidek wrote: > > If someone is actually using GENERIC kernel. This change will break all > > my system next time I upgrade. Adding UFS_ACL option to the kernel > > config to make ZFS kernel module to work doesn't sound very intuitive. > > > > I understand what you are trying to accomplish, but we really need to > > find better way to do this. Until then, could you back it out? >=20 > I'd rather find a cleaner solution - it's pulling in code which just > isn't being used if you aren't using UFS_ACL or ZFS. >=20 > How about wrapping those two up in a module which zfs can register a > dependency on? This would be one weird module, but let's see:) --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --wq9mPyueHGvFACwf Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk8KJFwACgkQForvXbEpPzTGRQCfWyUjj9PpumAdjSrTGYOUyrmr 2kkAoOJYDqB4/bSArLOBfweUbxGW94VA =OSLa -----END PGP SIGNATURE----- --wq9mPyueHGvFACwf-- From owner-svn-src-all@FreeBSD.ORG Sun Jan 8 23:30:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB0E11065672; Sun, 8 Jan 2012 23:30:23 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 94FC28FC1B; Sun, 8 Jan 2012 23:30: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 q08NUNiN012592; Sun, 8 Jan 2012 23:30:23 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q08NUNrb012590; Sun, 8 Jan 2012 23:30:23 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201201082330.q08NUNrb012590@svn.freebsd.org> From: Rick Macklem Date: Sun, 8 Jan 2012 23:30:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229830 - stable/8/sys/fs/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jan 2012 23:30:23 -0000 Author: rmacklem Date: Sun Jan 8 23:30:23 2012 New Revision: 229830 URL: http://svn.freebsd.org/changeset/base/229830 Log: MFC: r228560 Patch the new NFS server in a manner analagous to r228520 for the old NFS server, so that it correctly handles a count == 0 argument for Commit. Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Sun Jan 8 23:11:03 2012 (r229829) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Sun Jan 8 23:30:23 2012 (r229830) @@ -1249,7 +1249,13 @@ nfsvno_fsync(struct vnode *vp, u_int64_t { int error = 0; - if (cnt > MAX_COMMIT_COUNT) { + /* + * RFC 1813 3.3.21: if count is 0, a flush from offset to the end of + * file is done. At this time VOP_FSYNC does not accept offset and + * byte count parameters so call VOP_FSYNC the whole file for now. + * The same is true for NFSv4: RFC 3530 Sec. 14.2.3. + */ + if (cnt == 0 || cnt > MAX_COMMIT_COUNT) { /* * Give up and do the whole thing */ From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 00:48:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69126106564A; Mon, 9 Jan 2012 00:48:20 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50C358FC08; Mon, 9 Jan 2012 00:48: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 q090mKiH015081; Mon, 9 Jan 2012 00:48:20 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q090mKB6015074; Mon, 9 Jan 2012 00:48:20 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201090048.q090mKB6015074@svn.freebsd.org> From: Eitan Adler Date: Mon, 9 Jan 2012 00:48:20 +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: r229831 - in head: lib/libopie share/examples/diskless share/examples/ppp share/examples/printing tools/tools/nanobsd/pcengines/Files/root usr.sbin/pkg_install/add X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 00:48:20 -0000 Author: eadler (ports committer) Date: Mon Jan 9 00:48:19 2012 New Revision: 229831 URL: http://svn.freebsd.org/changeset/base/229831 Log: X11BASE has been deprecated for a long time and will die soon Approved by: x11 (eadler) Approved by: brucec MFC after: 1 week Modified: head/lib/libopie/config.h head/share/examples/diskless/README.TEMPLATING head/share/examples/ppp/ppp.linkdown.sample head/share/examples/printing/hpvf head/tools/tools/nanobsd/pcengines/Files/root/.cshrc head/usr.sbin/pkg_install/add/main.c Modified: head/lib/libopie/config.h ============================================================================== --- head/lib/libopie/config.h Sun Jan 8 23:30:23 2012 (r229830) +++ head/lib/libopie/config.h Mon Jan 9 00:48:19 2012 (r229831) @@ -54,7 +54,7 @@ /* #undef DOANONYMOUS */ /* The default value of the PATH environment variable */ -#define DEFAULT_PATH "/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin" +#define DEFAULT_PATH "/usr/bin:/bin:/usr/sbin:/sbin" /* Defined if the file /etc/default/login exists (and, presumably, should be looked at by login) */ Modified: head/share/examples/diskless/README.TEMPLATING ============================================================================== --- head/share/examples/diskless/README.TEMPLATING Sun Jan 8 23:30:23 2012 (r229830) +++ head/share/examples/diskless/README.TEMPLATING Mon Jan 9 00:48:19 2012 (r229831) @@ -94,8 +94,8 @@ be useful to set up clients and server f /usr/ports ( note 5 ) /usr/src ( note 5 ) /usr/local/crack ( note 5 ) - /usr/X11R6/lib/X11/xdm/xdm-errors ( note 6 ) - /usr/X11R6/lib/X11/xdm/xdm-pid ( note 6 ) + /usr/local/lib/X11/xdm/xdm-errors ( note 6 ) + /usr/local/lib/X11/xdm/xdm-pid ( note 6 ) /usr/local/etc/ssh_host_key ( note 6 ) /usr/local/etc/ssh_host_key.pub ( note 6 ) /usr/local/etc/ssh_random_seed ( note 6 ) @@ -120,7 +120,7 @@ be useful to set up clients and server f do not want to template such directories. note 6: Note that you can solve the problem of xdm and sshd creating - files in /usr. With xdm, edit /usr/X11R6/lib/xdm/xdm-config + files in /usr. With xdm, edit /usr/local/lib/xdm/xdm-config and change the errorLogFile and pidFile config lines. With sshd, add 'HostKey' and 'RandomSeed' directives to specify Modified: head/share/examples/ppp/ppp.linkdown.sample ============================================================================== --- head/share/examples/ppp/ppp.linkdown.sample Sun Jan 8 23:30:23 2012 (r229830) +++ head/share/examples/ppp/ppp.linkdown.sample Mon Jan 9 00:48:19 2012 (r229831) @@ -23,7 +23,7 @@ # ``auplay'' (assuming NAS is installed and configured). # MYADDR: - !bg /usr/X11R6/bin/auplay /etc/ppp/linkdown.au + !bg /usr/local/bin/auplay /etc/ppp/linkdown.au # If you're running ``ppp -auto -nat dynamic-nat-auto'', and are # assigned a dynamic IP number by the peer, this may be worth while Modified: head/share/examples/printing/hpvf ============================================================================== --- head/share/examples/printing/hpvf Sun Jan 8 23:30:23 2012 (r229830) +++ head/share/examples/printing/hpvf Mon Jan 9 00:48:19 2012 (r229831) @@ -1,10 +1,10 @@ #!/bin/sh # +# $FreeBSD$ +# # hpvf - Convert GIF files into HP/PCL, then print # Installed in /usr/local/libexec/hpvf -PATH=/usr/X11R6/bin:$PATH; export PATH - giftopnm | ppmtopgm | pgmtopbm | pbmtolj -resolution 300 \ && exit 0 \ || exit 2 Modified: head/tools/tools/nanobsd/pcengines/Files/root/.cshrc ============================================================================== --- head/tools/tools/nanobsd/pcengines/Files/root/.cshrc Sun Jan 8 23:30:23 2012 (r229830) +++ head/tools/tools/nanobsd/pcengines/Files/root/.cshrc Mon Jan 9 00:48:19 2012 (r229831) @@ -14,7 +14,7 @@ alias ll ls -lA # A righteous umask umask 22 -set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin /usr/X11R6/bin $HOME/bin) +set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin) setenv EDITOR vi setenv PAGER more Modified: head/usr.sbin/pkg_install/add/main.c ============================================================================== --- head/usr.sbin/pkg_install/add/main.c Sun Jan 8 23:30:23 2012 (r229830) +++ head/usr.sbin/pkg_install/add/main.c Mon Jan 9 00:48:19 2012 (r229831) @@ -285,7 +285,7 @@ main(int argc, char **argv) } /* Make sure the sub-execs we invoke get found */ setenv("PATH", - "/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin", + "/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin", 1); /* Set a reasonable umask */ From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 01:02:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6C77106564A; Mon, 9 Jan 2012 01:02:37 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A80A88FC0C; Mon, 9 Jan 2012 01:02: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 q0912bZw015577; Mon, 9 Jan 2012 01:02:37 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0912bxn015575; Mon, 9 Jan 2012 01:02:37 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201090102.q0912bxn015575@svn.freebsd.org> From: Eitan Adler Date: Mon, 9 Jan 2012 01:02:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229832 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 01:02:38 -0000 Author: eadler (ports committer) Date: Mon Jan 9 01:02:37 2012 New Revision: 229832 URL: http://svn.freebsd.org/changeset/base/229832 Log: MFC r228233: - Fix typos s/(more|less) then|\1 than/ Approved by: brucec Modified: stable/9/sys/kern/subr_blist.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/subr_blist.c ============================================================================== --- stable/9/sys/kern/subr_blist.c Mon Jan 9 00:48:19 2012 (r229831) +++ stable/9/sys/kern/subr_blist.c Mon Jan 9 01:02:37 2012 (r229832) @@ -29,7 +29,7 @@ * * This module implements a general bitmap allocator/deallocator. The * allocator eats around 2 bits per 'block'. The module does not - * try to interpret the meaning of a 'block' other then to return + * try to interpret the meaning of a 'block' other than to return * SWAPBLK_NONE on an allocation failure. * * A radix tree is used to maintain the bitmap. Two radix constants are @@ -57,7 +57,7 @@ * the memory subsystem. In contrast, the rlist code may allocate memory * on an rlist_free() call. The non-blocking features of the blist code * are used to great advantage in the swap code (vm/nswap_pager.c). The - * rlist code uses a little less overall memory then the blist code (but + * rlist code uses a little less overall memory than the blist code (but * due to swap interleaving not all that much less), but the blist code * scales much, much better. * @@ -72,7 +72,7 @@ * to cover the number of blocks requested at creation time even if it * must be encompassed in larger root-node radix. * - * NOTE: the allocator cannot currently allocate more then + * NOTE: the allocator cannot currently allocate more than * BLIST_BMAP_RADIX blocks per call. It will panic with 'allocation too * large' if you try. This is an area that could use improvement. The * radix is large enough that this restriction does not effect the swap @@ -152,7 +152,7 @@ static MALLOC_DEFINE(M_SWAP, "SWAP", "Sw * blist_create() - create a blist capable of handling up to the specified * number of blocks * - * blocks - must be greater then 0 + * blocks - must be greater than 0 * flags - malloc flags * * The smallest blist consists of a single leaf node capable of @@ -841,7 +841,7 @@ blst_meta_fill( * * Initialize our meta structures and bitmaps and calculate the exact * amount of space required to manage 'count' blocks - this space may - * be considerably less then the calculated radix due to the large + * be considerably less than the calculated radix due to the large * RADIX values we use. */ From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 01:59:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91820106566B; Mon, 9 Jan 2012 01:59:17 +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 7BF5C8FC08; Mon, 9 Jan 2012 01:59: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 q091xHfj017261; Mon, 9 Jan 2012 01:59:17 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q091xHsX017259; Mon, 9 Jan 2012 01:59:17 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201201090159.q091xHsX017259@svn.freebsd.org> From: Glen Barber Date: Mon, 9 Jan 2012 01:59:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229833 - stable/9/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 01:59:17 -0000 Author: gjb (doc committer) Date: Mon Jan 9 01:59:17 2012 New Revision: 229833 URL: http://svn.freebsd.org/changeset/base/229833 Log: MFC r229353: - Trivial standardization to a few comments in kern.pre.mk. Modified: stable/9/sys/conf/kern.pre.mk Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/sys/conf/kern.pre.mk ============================================================================== --- stable/9/sys/conf/kern.pre.mk Mon Jan 9 01:02:37 2012 (r229832) +++ stable/9/sys/conf/kern.pre.mk Mon Jan 9 01:59:17 2012 (r229833) @@ -71,10 +71,10 @@ INCLUDES+= -I$S/dev/ath -I$S/dev/ath/ath # ... and the same for the NgATM stuff INCLUDES+= -I$S/contrib/ngatm -# .. and the same for twa +# ... and the same for twa INCLUDES+= -I$S/dev/twa -# ... and XFS +# ... and the same for XFS INCLUDES+= -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs # ... and the same for cxgb and cxgbe From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 01:59:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68048106566C; Mon, 9 Jan 2012 01:59:50 +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 528E58FC1A; Mon, 9 Jan 2012 01:59: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 q091xo24017317; Mon, 9 Jan 2012 01:59:50 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q091xoLq017315; Mon, 9 Jan 2012 01:59:50 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201201090159.q091xoLq017315@svn.freebsd.org> From: Glen Barber Date: Mon, 9 Jan 2012 01:59:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229834 - stable/8/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 01:59:50 -0000 Author: gjb (doc committer) Date: Mon Jan 9 01:59:50 2012 New Revision: 229834 URL: http://svn.freebsd.org/changeset/base/229834 Log: MFC r229353: - Trivial standardization to a few comments in kern.pre.mk. Modified: stable/8/sys/conf/kern.pre.mk Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/conf/kern.pre.mk ============================================================================== --- stable/8/sys/conf/kern.pre.mk Mon Jan 9 01:59:17 2012 (r229833) +++ stable/8/sys/conf/kern.pre.mk Mon Jan 9 01:59:50 2012 (r229834) @@ -73,10 +73,10 @@ INCLUDES+= -I$S/dev/ath -I$S/dev/ath/ath # ... and the same for the NgATM stuff INCLUDES+= -I$S/contrib/ngatm -# .. and the same for twa +# ... and the same for twa INCLUDES+= -I$S/dev/twa -# ... and XFS +# ... and the same for XFS INCLUDES+= -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs # ... and the same for cxgb and cxgbe From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 02:00:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B1B310656A6; Mon, 9 Jan 2012 02:00: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 CCD278FC2B; Mon, 9 Jan 2012 02:00: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 q0920VRq017408; Mon, 9 Jan 2012 02:00:31 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0920VH1017406; Mon, 9 Jan 2012 02:00:31 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201201090200.q0920VH1017406@svn.freebsd.org> From: Glen Barber Date: Mon, 9 Jan 2012 02:00:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229835 - stable/7/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 02:00:33 -0000 Author: gjb (doc committer) Date: Mon Jan 9 02:00:31 2012 New Revision: 229835 URL: http://svn.freebsd.org/changeset/base/229835 Log: MFC r229353: - Trivial standardization to a few comments in kern.pre.mk. Modified: stable/7/sys/conf/kern.pre.mk Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/conf/kern.pre.mk ============================================================================== --- stable/7/sys/conf/kern.pre.mk Mon Jan 9 01:59:50 2012 (r229834) +++ stable/7/sys/conf/kern.pre.mk Mon Jan 9 02:00:31 2012 (r229835) @@ -71,10 +71,10 @@ INCLUDES+= -I$S/dev/ath -I$S/dev/ath/ath # ... and the same for the NgATM stuff INCLUDES+= -I$S/contrib/ngatm -# .. and the same for twa +# ... and the same for twa INCLUDES+= -I$S/dev/twa -# ... and XFS +# ... and the same for XFS INCLUDES+= -I$S/gnu/fs/xfs/FreeBSD -I$S/gnu/fs/xfs/FreeBSD/support -I$S/gnu/fs/xfs # ... and the same for cxgb From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 02:22:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E53F106566B; Mon, 9 Jan 2012 02:22:27 +0000 (UTC) (envelope-from Devin.Teske@fisglobal.com) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) by mx1.freebsd.org (Postfix) with ESMTP id 1DEAB8FC12; Mon, 9 Jan 2012 02:22:26 +0000 (UTC) Received: from pps.filterd (ltcfislmsgpa05 [127.0.0.1]) by ltcfislmsgpa05.fnfis.com (8.14.4/8.14.4) with SMTP id q091QqDY028283; Sun, 8 Jan 2012 19:46:31 -0600 Received: from smtp.fisglobal.com ([10.132.206.17]) by ltcfislmsgpa05.fnfis.com with ESMTP id 127erq19hx-1 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Sun, 08 Jan 2012 19:46:31 -0600 Received: from [10.0.0.104] (10.14.152.28) by smtp.fisglobal.com (10.132.206.17) with Microsoft SMTP Server (TLS) id 14.1.323.3; Sun, 8 Jan 2012 19:46:29 -0600 MIME-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset="us-ascii" From: Devin Teske In-Reply-To: Date: Sun, 8 Jan 2012 17:46:27 -0800 Content-Transfer-Encoding: quoted-printable Message-ID: <2C0D66FB-4056-45FB-998C-4234C3E13B6F@fisglobal.com> References: <201112300624.pBU6OxO9098906@svn.freebsd.org> <4F08A518.8090207@FreeBSD.org> To: Sergey Kandaurov X-Mailer: Apple Mail (2.1084) X-Originating-IP: [10.14.152.28] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.5.7110, 1.0.211, 0.0.0000 definitions=2012-01-09_01:2012-01-06, 2012-01-09, 1970-01-01 signatures=0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dimitry Andric Subject: Re: svn commit: r228985 - head/sys/boot/forth X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 02:22:27 -0000 On Jan 8, 2012, at 12:35 PM, Sergey Kandaurov wrote: > On 8 January 2012 00:03, Dimitry Andric wrote: >> On 2011-12-30 07:24, Sergey Kandaurov wrote: >>>=20 >>> Author: pluknet >>> Date: Fri Dec 30 06:24:59 2011 >>> New Revision: 228985 >>> URL: http://svn.freebsd.org/changeset/base/228985 >>>=20 >>> Log: >>> Unset the environment variables associated with individual menu items >>> before invoking the kernel. >>=20 >>=20 >> When I did a single-user mode boot to install a new world, I saw the >> following warning on the (serial) console during boot: >>=20 >> /boot.config: -D -S115200 >> Consoles: internal video/keyboard serial port >> BIOS drive A: is disk0 >> BIOS drive C: is disk1 >> BIOS 638kB/3143616kB available memory >>=20 >> FreeBSD/x86 bootstrap loader, Revision 1.1 >> (dim@vm-freebsd10-amd64.home.andric.com, Sat Jan 7 01:05:07 CET 2012) >> Loading /boot/defaults/loader.conf >> /boot/kernel/kernel data=3D0xb73530 data=3D0x11dbe0+0x2b4db8 >> syms=3D[0x8+0xfd620+0x8+0xec6b6] >> - >> Hit [Enter] to boot immediately, or any other key for command prompt. >>=20 >>=20 >> Type '?' for a list of commands, 'help' for more detailed help. >> OK boot -s >> menu-unset not found <<-- what's this? >> GDB: no debug ports present >> KDB: debugger backends: ddb >> KDB: current backend: ddb >> [...kernel boots...] >>=20 >> E.g, it always gives a 'menu-unset not found' warning (or maybe it's an >> error, it's not clear). This was not the case before r228985. >>=20 >> I have almost no knowledge about forth, but it looks like this might be >> caused by the new try-menu-unset subroutine. >>=20 >> My loader.conf is just this: >>=20 >> beastie_disable=3D"YES" >> comconsole_speed=3D"115200" >> console=3D"comconsole vidconsole" >> kern.hz=3D"100" >=20 > So, the problem arise when beastie_disable is set. >=20 > In this case menu.rc is not evaluated and consequently menu-unset does > not have a body yet. This results in the ficl warning "not found" when > try-menu-unset calls menu-unset. The warning cannot be handled with catch > as seen with the code in head. > Otherwise, when beastie is enabled, all works as it should. >=20 > To "fix" the problem I replaced 'catch' with 'sfind', so that we can > conditionally call menu-unset only when the definition is present. >=20 > Please try the following patch. I tested it with enabled/disabled beastie > and loader_color over serial console. I would also like to get a review > from Devin Teske to see if this change is acceptable. >=20 > %%% > Index: sys/boot/forth/loader.4th > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/boot/forth/loader.4th (revision 229670) > +++ sys/boot/forth/loader.4th (working copy) > @@ -45,8 +45,10 @@ >=20 > : try-menu-unset > s" menu-unset" > - ['] evaluate catch if > - 2drop > + sfind if > + execute > + else > + drop > then > ; >=20 > %%% >=20 I've reviewed the patch, but also submitted my solution as PR amd64/163938. However, I love your use of sfind -- it's perfect. Nice job! I'm incorporating your patch into my patch for PR amd64/163938 for posterit= y measures and historical archiving. Please review in a few moments after submission of my followup. > [ It could be simplified with one-liner: > s" menu-unset" sfind drop execute > but ficl doesn't like this in a freestanding environment.] >=20 Nah, multi-line is perfectly fine. --=20 Devin _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 03:03:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA3FF106566B; Mon, 9 Jan 2012 03:03:43 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A9C6F8FC08; Mon, 9 Jan 2012 03:03: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 q0933hQb019615; Mon, 9 Jan 2012 03:03:43 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0933hR8019613; Mon, 9 Jan 2012 03:03:43 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201090303.q0933hR8019613@svn.freebsd.org> From: Eitan Adler Date: Mon, 9 Jan 2012 03:03:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229836 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 03:03:44 -0000 Author: eadler (ports committer) Date: Mon Jan 9 03:03:43 2012 New Revision: 229836 URL: http://svn.freebsd.org/changeset/base/229836 Log: MFC r228233: - Fix typos s/(more|less) then|\1 than/ Approved by: brucec Modified: stable/8/sys/kern/subr_blist.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/kern/subr_blist.c ============================================================================== --- stable/8/sys/kern/subr_blist.c Mon Jan 9 02:00:31 2012 (r229835) +++ stable/8/sys/kern/subr_blist.c Mon Jan 9 03:03:43 2012 (r229836) @@ -29,7 +29,7 @@ * * This module implements a general bitmap allocator/deallocator. The * allocator eats around 2 bits per 'block'. The module does not - * try to interpret the meaning of a 'block' other then to return + * try to interpret the meaning of a 'block' other than to return * SWAPBLK_NONE on an allocation failure. * * A radix tree is used to maintain the bitmap. Two radix constants are @@ -57,7 +57,7 @@ * the memory subsystem. In contrast, the rlist code may allocate memory * on an rlist_free() call. The non-blocking features of the blist code * are used to great advantage in the swap code (vm/nswap_pager.c). The - * rlist code uses a little less overall memory then the blist code (but + * rlist code uses a little less overall memory than the blist code (but * due to swap interleaving not all that much less), but the blist code * scales much, much better. * @@ -72,7 +72,7 @@ * to cover the number of blocks requested at creation time even if it * must be encompassed in larger root-node radix. * - * NOTE: the allocator cannot currently allocate more then + * NOTE: the allocator cannot currently allocate more than * BLIST_BMAP_RADIX blocks per call. It will panic with 'allocation too * large' if you try. This is an area that could use improvement. The * radix is large enough that this restriction does not effect the swap @@ -152,7 +152,7 @@ static MALLOC_DEFINE(M_SWAP, "SWAP", "Sw * blist_create() - create a blist capable of handling up to the specified * number of blocks * - * blocks - must be greater then 0 + * blocks - must be greater than 0 * flags - malloc flags * * The smallest blist consists of a single leaf node capable of @@ -841,7 +841,7 @@ blst_meta_fill( * * Initialize our meta structures and bitmaps and calculate the exact * amount of space required to manage 'count' blocks - this space may - * be considerably less then the calculated radix due to the large + * be considerably less than the calculated radix due to the large * RADIX values we use. */ From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 03:03:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1943D106566C; Mon, 9 Jan 2012 03:03:44 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE0678FC0A; Mon, 9 Jan 2012 03:03: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 q0933hqr019629; Mon, 9 Jan 2012 03:03:43 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0933h7i019627; Mon, 9 Jan 2012 03:03:43 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201090303.q0933h7i019627@svn.freebsd.org> From: Eitan Adler Date: Mon, 9 Jan 2012 03:03:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229837 - stable/7/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 03:03:44 -0000 Author: eadler (ports committer) Date: Mon Jan 9 03:03:43 2012 New Revision: 229837 URL: http://svn.freebsd.org/changeset/base/229837 Log: MFC r228233: - Fix typos s/(more|less) then|\1 than/ Approved by: brucec Modified: stable/7/sys/kern/subr_blist.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/kern/subr_blist.c ============================================================================== --- stable/7/sys/kern/subr_blist.c Mon Jan 9 03:03:43 2012 (r229836) +++ stable/7/sys/kern/subr_blist.c Mon Jan 9 03:03:43 2012 (r229837) @@ -29,7 +29,7 @@ * * This module implements a general bitmap allocator/deallocator. The * allocator eats around 2 bits per 'block'. The module does not - * try to interpret the meaning of a 'block' other then to return + * try to interpret the meaning of a 'block' other than to return * SWAPBLK_NONE on an allocation failure. * * A radix tree is used to maintain the bitmap. Two radix constants are @@ -57,7 +57,7 @@ * the memory subsystem. In contrast, the rlist code may allocate memory * on an rlist_free() call. The non-blocking features of the blist code * are used to great advantage in the swap code (vm/nswap_pager.c). The - * rlist code uses a little less overall memory then the blist code (but + * rlist code uses a little less overall memory than the blist code (but * due to swap interleaving not all that much less), but the blist code * scales much, much better. * @@ -72,7 +72,7 @@ * to cover the number of blocks requested at creation time even if it * must be encompassed in larger root-node radix. * - * NOTE: the allocator cannot currently allocate more then + * NOTE: the allocator cannot currently allocate more than * BLIST_BMAP_RADIX blocks per call. It will panic with 'allocation too * large' if you try. This is an area that could use improvement. The * radix is large enough that this restriction does not effect the swap @@ -152,7 +152,7 @@ static MALLOC_DEFINE(M_SWAP, "SWAP", "Sw * blist_create() - create a blist capable of handling up to the specified * number of blocks * - * blocks - must be greater then 0 + * blocks - must be greater than 0 * flags - malloc flags * * The smallest blist consists of a single leaf node capable of @@ -841,7 +841,7 @@ blst_meta_fill( * * Initialize our meta structures and bitmaps and calculate the exact * amount of space required to manage 'count' blocks - this space may - * be considerably less then the calculated radix due to the large + * be considerably less than the calculated radix due to the large * RADIX values we use. */ From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 04:27:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1AA49106566B; Mon, 9 Jan 2012 04:27:33 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0961A8FC0C; Mon, 9 Jan 2012 04:27: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 q094RWcB022315; Mon, 9 Jan 2012 04:27:32 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q094RWBc022313; Mon, 9 Jan 2012 04:27:32 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201201090427.q094RWBc022313@svn.freebsd.org> From: Warren Block Date: Mon, 9 Jan 2012 04:27: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: r229838 - head/sbin/geom/class/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 04:27:33 -0000 Author: wblock (doc committer) Date: Mon Jan 9 04:27:32 2012 New Revision: 229838 URL: http://svn.freebsd.org/changeset/base/229838 Log: Clarity improvements. Approved by: gjb (mentor) MFC after: 3 days Modified: head/sbin/geom/class/part/gpart.8 Modified: head/sbin/geom/class/part/gpart.8 ============================================================================== --- head/sbin/geom/class/part/gpart.8 Mon Jan 9 03:03:43 2012 (r229837) +++ head/sbin/geom/class/part/gpart.8 Mon Jan 9 04:27:32 2012 (r229838) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 21, 2011 +.Dd January 8, 2012 .Dt GPART 8 .Os .Sh NAME @@ -33,7 +33,7 @@ .Sh SYNOPSIS To add support for the disk partitioning GEOM class, place one or more of the following -lines in your kernel configuration file: +lines in the kernel configuration file: .Bd -ragged -offset indent .Cd "options GEOM_PART_APM" .Cd "options GEOM_PART_BSD" @@ -410,13 +410,13 @@ about its use. .El .\" ==== RESTORE ==== .It Cm restore -Restore the partition table from backup previously created by +Restore the partition table from a backup previously created by the .Cm backup -action and given from standard input. -Only partition table may be restored. -This action does not affect content of partitions. -This mean that you should copy your data from backup after restoring -partition table and write bootcode again if it is needed. +action and read from standard input. +Only the partition table is restored. +This action does not affect the content of partitions. +After restoring the partition table and writing bootcode if needed, +user data must be restored from backup. .Pp Additional options include: .Bl -tag -width 10n From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 04:55:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AD18106564A; Mon, 9 Jan 2012 04:55:53 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 577A78FC15; Mon, 9 Jan 2012 04:55:53 +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 q094treI023351; Mon, 9 Jan 2012 04:55:53 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q094trfY023346; Mon, 9 Jan 2012 04:55:53 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201201090455.q094trfY023346@svn.freebsd.org> From: David Schultz Date: Mon, 9 Jan 2012 04:55:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229839 - stable/9/lib/msun/src X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 04:55:53 -0000 Author: das Date: Mon Jan 9 04:55:52 2012 New Revision: 229839 URL: http://svn.freebsd.org/changeset/base/229839 Log: MFC various fma{,f,l} improvements: r226245 - refactoring r226371 - fix double-rounding bug r226373 - new math_private.h macros r226601 - fix nit in r226371 Modified: stable/9/lib/msun/src/math_private.h stable/9/lib/msun/src/s_fma.c stable/9/lib/msun/src/s_fmaf.c stable/9/lib/msun/src/s_fmal.c Directory Properties: stable/9/lib/msun/ (props changed) Modified: stable/9/lib/msun/src/math_private.h ============================================================================== --- stable/9/lib/msun/src/math_private.h Mon Jan 9 04:27:32 2012 (r229838) +++ stable/9/lib/msun/src/math_private.h Mon Jan 9 04:55:52 2012 (r229839) @@ -58,6 +58,10 @@ typedef union u_int32_t msw; u_int32_t lsw; } parts; + struct + { + u_int64_t w; + } xparts; } ieee_double_shape_type; #endif @@ -72,6 +76,10 @@ typedef union u_int32_t lsw; u_int32_t msw; } parts; + struct + { + u_int64_t w; + } xparts; } ieee_double_shape_type; #endif @@ -86,6 +94,14 @@ do { \ (ix1) = ew_u.parts.lsw; \ } while (0) +/* Get a 64-bit int from a double. */ +#define EXTRACT_WORD64(ix,d) \ +do { \ + ieee_double_shape_type ew_u; \ + ew_u.value = (d); \ + (ix) = ew_u.xparts.w; \ +} while (0) + /* Get the more significant 32 bit int from a double. */ #define GET_HIGH_WORD(i,d) \ @@ -114,6 +130,14 @@ do { \ (d) = iw_u.value; \ } while (0) +/* Set a double from a 64-bit int. */ +#define INSERT_WORD64(d,ix) \ +do { \ + ieee_double_shape_type iw_u; \ + iw_u.xparts.w = (ix); \ + (d) = iw_u.value; \ +} while (0) + /* Set the more significant 32 bits of a double from an int. */ #define SET_HIGH_WORD(d,v) \ Modified: stable/9/lib/msun/src/s_fma.c ============================================================================== --- stable/9/lib/msun/src/s_fma.c Mon Jan 9 04:27:32 2012 (r229838) +++ stable/9/lib/msun/src/s_fma.c Mon Jan 9 04:55:52 2012 (r229839) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005 David Schultz + * Copyright (c) 2005-2011 David Schultz * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -31,6 +31,132 @@ __FBSDID("$FreeBSD$"); #include #include +#include "math_private.h" + +/* + * A struct dd represents a floating-point number with twice the precision + * of a double. We maintain the invariant that "hi" stores the 53 high-order + * bits of the result. + */ +struct dd { + double hi; + double lo; +}; + +/* + * Compute a+b exactly, returning the exact result in a struct dd. We assume + * that both a and b are finite, but make no assumptions about their relative + * magnitudes. + */ +static inline struct dd +dd_add(double a, double b) +{ + struct dd ret; + double s; + + ret.hi = a + b; + s = ret.hi - a; + ret.lo = (a - (ret.hi - s)) + (b - s); + return (ret); +} + +/* + * Compute a+b, with a small tweak: The least significant bit of the + * result is adjusted into a sticky bit summarizing all the bits that + * were lost to rounding. This adjustment negates the effects of double + * rounding when the result is added to another number with a higher + * exponent. For an explanation of round and sticky bits, see any reference + * on FPU design, e.g., + * + * J. Coonen. An Implementation Guide to a Proposed Standard for + * Floating-Point Arithmetic. Computer, vol. 13, no. 1, Jan 1980. + */ +static inline double +add_adjusted(double a, double b) +{ + struct dd sum; + uint64_t hibits, lobits; + + sum = dd_add(a, b); + if (sum.lo != 0) { + EXTRACT_WORD64(hibits, sum.hi); + if ((hibits & 1) == 0) { + /* hibits += (int)copysign(1.0, sum.hi * sum.lo) */ + EXTRACT_WORD64(lobits, sum.lo); + hibits += 1 - ((hibits ^ lobits) >> 62); + INSERT_WORD64(sum.hi, hibits); + } + } + return (sum.hi); +} + +/* + * Compute ldexp(a+b, scale) with a single rounding error. It is assumed + * that the result will be subnormal, and care is taken to ensure that + * double rounding does not occur. + */ +static inline double +add_and_denormalize(double a, double b, int scale) +{ + struct dd sum; + uint64_t hibits, lobits; + int bits_lost; + + sum = dd_add(a, b); + + /* + * If we are losing at least two bits of accuracy to denormalization, + * then the first lost bit becomes a round bit, and we adjust the + * lowest bit of sum.hi to make it a sticky bit summarizing all the + * bits in sum.lo. With the sticky bit adjusted, the hardware will + * break any ties in the correct direction. + * + * If we are losing only one bit to denormalization, however, we must + * break the ties manually. + */ + if (sum.lo != 0) { + EXTRACT_WORD64(hibits, sum.hi); + bits_lost = -((int)(hibits >> 52) & 0x7ff) - scale + 1; + if (bits_lost != 1 ^ (int)(hibits & 1)) { + /* hibits += (int)copysign(1.0, sum.hi * sum.lo) */ + EXTRACT_WORD64(lobits, sum.lo); + hibits += 1 - (((hibits ^ lobits) >> 62) & 2); + INSERT_WORD64(sum.hi, hibits); + } + } + return (ldexp(sum.hi, scale)); +} + +/* + * Compute a*b exactly, returning the exact result in a struct dd. We assume + * that both a and b are normalized, so no underflow or overflow will occur. + * The current rounding mode must be round-to-nearest. + */ +static inline struct dd +dd_mul(double a, double b) +{ + static const double split = 0x1p27 + 1.0; + struct dd ret; + double ha, hb, la, lb, p, q; + + p = a * split; + ha = a - p; + ha += p; + la = a - ha; + + p = b * split; + hb = b - p; + hb += p; + lb = b - hb; + + p = ha * hb; + q = ha * lb + la * hb; + + ret.hi = p + q; + ret.lo = p - ret.hi + q + la * lb; + return (ret); +} + /* * Fused multiply-add: Compute x * y + z with a single rounding error. * @@ -48,14 +174,11 @@ __FBSDID("$FreeBSD$"); * Hardware instructions should be used on architectures that support it, * since this implementation will likely be several times slower. */ -#if LDBL_MANT_DIG != 113 double fma(double x, double y, double z) { - static const double split = 0x1p27 + 1.0; - double xs, ys, zs; - double c, cc, hx, hy, p, q, tx, ty; - double r, rr, s; + double xs, ys, zs, adj; + struct dd xy, r; int oround; int ex, ey, ez; int spread; @@ -85,41 +208,6 @@ fma(double x, double y, double z) * will overflow, so we handle these cases specially. Rounding * modes other than FE_TONEAREST are painful. */ - if (spread > DBL_MANT_DIG * 2) { - fenv_t env; - feraiseexcept(FE_INEXACT); - switch(oround) { - case FE_TONEAREST: - return (x * y); - case FE_TOWARDZERO: - if (x > 0.0 ^ y < 0.0 ^ z < 0.0) - return (x * y); - feholdexcept(&env); - r = x * y; - if (!fetestexcept(FE_INEXACT)) - r = nextafter(r, 0); - feupdateenv(&env); - return (r); - case FE_DOWNWARD: - if (z > 0.0) - return (x * y); - feholdexcept(&env); - r = x * y; - if (!fetestexcept(FE_INEXACT)) - r = nextafter(r, -INFINITY); - feupdateenv(&env); - return (r); - default: /* FE_UPWARD */ - if (z < 0.0) - return (x * y); - feholdexcept(&env); - r = x * y; - if (!fetestexcept(FE_INEXACT)) - r = nextafter(r, INFINITY); - feupdateenv(&env); - return (r); - } - } if (spread < -DBL_MANT_DIG) { feraiseexcept(FE_INEXACT); if (!isnormal(z)) @@ -144,63 +232,52 @@ fma(double x, double y, double z) return (z); } } + if (spread <= DBL_MANT_DIG * 2) + zs = ldexp(zs, -spread); + else + zs = copysign(DBL_MIN, zs); - /* - * Use Dekker's algorithm to perform the multiplication and - * subsequent addition in twice the machine precision. - * Arrange so that x * y = c + cc, and x * y + z = r + rr. - */ fesetround(FE_TONEAREST); - p = xs * split; - hx = xs - p; - hx += p; - tx = xs - hx; - - p = ys * split; - hy = ys - p; - hy += p; - ty = ys - hy; - - p = hx * hy; - q = hx * ty + tx * hy; - c = p + q; - cc = p - c + q + tx * ty; - - zs = ldexp(zs, -spread); - r = c + zs; - s = r - c; - rr = (c - (r - s)) + (zs - s) + cc; + /* + * Basic approach for round-to-nearest: + * + * (xy.hi, xy.lo) = x * y (exact) + * (r.hi, r.lo) = xy.hi + z (exact) + * adj = xy.lo + r.lo (inexact; low bit is sticky) + * result = r.hi + adj (correctly rounded) + */ + xy = dd_mul(xs, ys); + r = dd_add(xy.hi, zs); spread = ex + ey; - if (spread + ilogb(r) > -1023) { + + if (r.hi == 0.0) { + /* + * When the addends cancel to 0, ensure that the result has + * the correct sign. + */ fesetround(oround); - r = r + rr; - } else { + volatile double vzs = zs; /* XXX gcc CSE bug workaround */ + return (xy.hi + vzs + ldexp(xy.lo, spread)); + } + + if (oround != FE_TONEAREST) { /* - * The result is subnormal, so we round before scaling to - * avoid double rounding. + * There is no need to worry about double rounding in directed + * rounding modes. */ - p = ldexp(copysign(0x1p-1022, r), -spread); - c = r + p; - s = c - r; - cc = (r - (c - s)) + (p - s) + rr; fesetround(oround); - r = (c + cc) - p; + adj = r.lo + xy.lo; + return (ldexp(r.hi + adj, spread)); } - return (ldexp(r, spread)); -} -#else /* LDBL_MANT_DIG == 113 */ -/* - * 113 bits of precision is more than twice the precision of a double, - * so it is enough to represent the intermediate product exactly. - */ -double -fma(double x, double y, double z) -{ - return ((long double)x * y + z); + + adj = add_adjusted(r.lo, xy.lo); + if (spread + ilogb(r.hi) > -1023) + return (ldexp(r.hi + adj, spread)); + else + return (add_and_denormalize(r.hi, adj, spread)); } -#endif /* LDBL_MANT_DIG != 113 */ #if (LDBL_MANT_DIG == 53) __weak_reference(fma, fmal); Modified: stable/9/lib/msun/src/s_fmaf.c ============================================================================== --- stable/9/lib/msun/src/s_fmaf.c Mon Jan 9 04:27:32 2012 (r229838) +++ stable/9/lib/msun/src/s_fmaf.c Mon Jan 9 04:55:52 2012 (r229839) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005 David Schultz + * Copyright (c) 2005-2011 David Schultz * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -27,23 +27,43 @@ #include __FBSDID("$FreeBSD$"); +#include + #include "math.h" +#include "math_private.h" /* * Fused multiply-add: Compute x * y + z with a single rounding error. * * A double has more than twice as much precision than a float, so - * direct double-precision arithmetic suffices. - * - * XXX We are relying on the compiler to convert from double to float - * using the current rounding mode and with the appropriate - * side-effects. But on at least one platform (gcc 3.4.2/sparc64), - * this appears to be too much to ask for. The precision - * reduction should be done manually. + * direct double-precision arithmetic suffices, except where double + * rounding occurs. */ float fmaf(float x, float y, float z) { + double xy, result; + uint32_t hr, lr; + + xy = (double)x * y; + result = xy + z; + EXTRACT_WORDS(hr, lr, result); + /* Common case: The double precision result is fine. */ + if ((lr & 0x1fffffff) != 0x10000000 || /* not a halfway case */ + (hr & 0x7ff00000) == 0x7ff00000 || /* NaN */ + result - xy == z || /* exact */ + fegetround() != FE_TONEAREST) /* not round-to-nearest */ + return (result); - return ((double)x * y + z); + /* + * If result is inexact, and exactly halfway between two float values, + * we need to adjust the low-order bit in the direction of the error. + */ + fesetround(FE_TOWARDZERO); + volatile double vxy = xy; /* XXX work around gcc CSE bug */ + double adjusted_result = vxy + z; + fesetround(FE_TONEAREST); + if (result == adjusted_result) + SET_LOW_WORD(adjusted_result, lr + 1); + return (adjusted_result); } Modified: stable/9/lib/msun/src/s_fmal.c ============================================================================== --- stable/9/lib/msun/src/s_fmal.c Mon Jan 9 04:27:32 2012 (r229838) +++ stable/9/lib/msun/src/s_fmal.c Mon Jan 9 04:55:52 2012 (r229839) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005 David Schultz + * Copyright (c) 2005-2011 David Schultz * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -31,6 +31,128 @@ __FBSDID("$FreeBSD$"); #include #include +#include "fpmath.h" + +/* + * A struct dd represents a floating-point number with twice the precision + * of a long double. We maintain the invariant that "hi" stores the high-order + * bits of the result. + */ +struct dd { + long double hi; + long double lo; +}; + +/* + * Compute a+b exactly, returning the exact result in a struct dd. We assume + * that both a and b are finite, but make no assumptions about their relative + * magnitudes. + */ +static inline struct dd +dd_add(long double a, long double b) +{ + struct dd ret; + long double s; + + ret.hi = a + b; + s = ret.hi - a; + ret.lo = (a - (ret.hi - s)) + (b - s); + return (ret); +} + +/* + * Compute a+b, with a small tweak: The least significant bit of the + * result is adjusted into a sticky bit summarizing all the bits that + * were lost to rounding. This adjustment negates the effects of double + * rounding when the result is added to another number with a higher + * exponent. For an explanation of round and sticky bits, see any reference + * on FPU design, e.g., + * + * J. Coonen. An Implementation Guide to a Proposed Standard for + * Floating-Point Arithmetic. Computer, vol. 13, no. 1, Jan 1980. + */ +static inline long double +add_adjusted(long double a, long double b) +{ + struct dd sum; + union IEEEl2bits u; + + sum = dd_add(a, b); + if (sum.lo != 0) { + u.e = sum.hi; + if ((u.bits.manl & 1) == 0) + sum.hi = nextafterl(sum.hi, INFINITY * sum.lo); + } + return (sum.hi); +} + +/* + * Compute ldexp(a+b, scale) with a single rounding error. It is assumed + * that the result will be subnormal, and care is taken to ensure that + * double rounding does not occur. + */ +static inline long double +add_and_denormalize(long double a, long double b, int scale) +{ + struct dd sum; + int bits_lost; + union IEEEl2bits u; + + sum = dd_add(a, b); + + /* + * If we are losing at least two bits of accuracy to denormalization, + * then the first lost bit becomes a round bit, and we adjust the + * lowest bit of sum.hi to make it a sticky bit summarizing all the + * bits in sum.lo. With the sticky bit adjusted, the hardware will + * break any ties in the correct direction. + * + * If we are losing only one bit to denormalization, however, we must + * break the ties manually. + */ + if (sum.lo != 0) { + u.e = sum.hi; + bits_lost = -u.bits.exp - scale + 1; + if (bits_lost != 1 ^ (int)(u.bits.manl & 1)) + sum.hi = nextafterl(sum.hi, INFINITY * sum.lo); + } + return (ldexp(sum.hi, scale)); +} + +/* + * Compute a*b exactly, returning the exact result in a struct dd. We assume + * that both a and b are normalized, so no underflow or overflow will occur. + * The current rounding mode must be round-to-nearest. + */ +static inline struct dd +dd_mul(long double a, long double b) +{ +#if LDBL_MANT_DIG == 64 + static const long double split = 0x1p32L + 1.0; +#elif LDBL_MANT_DIG == 113 + static const long double split = 0x1p57L + 1.0; +#endif + struct dd ret; + long double ha, hb, la, lb, p, q; + + p = a * split; + ha = a - p; + ha += p; + la = a - ha; + + p = b * split; + hb = b - p; + hb += p; + lb = b - hb; + + p = ha * hb; + q = ha * lb + la * hb; + + ret.hi = p + q; + ret.lo = p - ret.hi + q + la * lb; + return (ret); +} + /* * Fused multiply-add: Compute x * y + z with a single rounding error. * @@ -43,14 +165,8 @@ __FBSDID("$FreeBSD$"); long double fmal(long double x, long double y, long double z) { -#if LDBL_MANT_DIG == 64 - static const long double split = 0x1p32L + 1.0; -#elif LDBL_MANT_DIG == 113 - static const long double split = 0x1p57L + 1.0; -#endif - long double xs, ys, zs; - long double c, cc, hx, hy, p, q, tx, ty; - long double r, rr, s; + long double xs, ys, zs, adj; + struct dd xy, r; int oround; int ex, ey, ez; int spread; @@ -80,41 +196,6 @@ fmal(long double x, long double y, long * will overflow, so we handle these cases specially. Rounding * modes other than FE_TONEAREST are painful. */ - if (spread > LDBL_MANT_DIG * 2) { - fenv_t env; - feraiseexcept(FE_INEXACT); - switch(oround) { - case FE_TONEAREST: - return (x * y); - case FE_TOWARDZERO: - if (x > 0.0 ^ y < 0.0 ^ z < 0.0) - return (x * y); - feholdexcept(&env); - r = x * y; - if (!fetestexcept(FE_INEXACT)) - r = nextafterl(r, 0); - feupdateenv(&env); - return (r); - case FE_DOWNWARD: - if (z > 0.0) - return (x * y); - feholdexcept(&env); - r = x * y; - if (!fetestexcept(FE_INEXACT)) - r = nextafterl(r, -INFINITY); - feupdateenv(&env); - return (r); - default: /* FE_UPWARD */ - if (z < 0.0) - return (x * y); - feholdexcept(&env); - r = x * y; - if (!fetestexcept(FE_INEXACT)) - r = nextafterl(r, INFINITY); - feupdateenv(&env); - return (r); - } - } if (spread < -LDBL_MANT_DIG) { feraiseexcept(FE_INEXACT); if (!isnormal(z)) @@ -139,49 +220,49 @@ fmal(long double x, long double y, long return (z); } } + if (spread <= LDBL_MANT_DIG * 2) + zs = ldexpl(zs, -spread); + else + zs = copysignl(LDBL_MIN, zs); - /* - * Use Dekker's algorithm to perform the multiplication and - * subsequent addition in twice the machine precision. - * Arrange so that x * y = c + cc, and x * y + z = r + rr. - */ fesetround(FE_TONEAREST); - p = xs * split; - hx = xs - p; - hx += p; - tx = xs - hx; - - p = ys * split; - hy = ys - p; - hy += p; - ty = ys - hy; - - p = hx * hy; - q = hx * ty + tx * hy; - c = p + q; - cc = p - c + q + tx * ty; - - zs = ldexpl(zs, -spread); - r = c + zs; - s = r - c; - rr = (c - (r - s)) + (zs - s) + cc; + /* + * Basic approach for round-to-nearest: + * + * (xy.hi, xy.lo) = x * y (exact) + * (r.hi, r.lo) = xy.hi + z (exact) + * adj = xy.lo + r.lo (inexact; low bit is sticky) + * result = r.hi + adj (correctly rounded) + */ + xy = dd_mul(xs, ys); + r = dd_add(xy.hi, zs); spread = ex + ey; - if (spread + ilogbl(r) > -16383) { + + if (r.hi == 0.0) { + /* + * When the addends cancel to 0, ensure that the result has + * the correct sign. + */ fesetround(oround); - r = r + rr; - } else { + volatile long double vzs = zs; /* XXX gcc CSE bug workaround */ + return (xy.hi + vzs + ldexpl(xy.lo, spread)); + } + + if (oround != FE_TONEAREST) { /* - * The result is subnormal, so we round before scaling to - * avoid double rounding. + * There is no need to worry about double rounding in directed + * rounding modes. */ - p = ldexpl(copysignl(0x1p-16382L, r), -spread); - c = r + p; - s = c - r; - cc = (r - (c - s)) + (p - s) + rr; fesetround(oround); - r = (c + cc) - p; + adj = r.lo + xy.lo; + return (ldexpl(r.hi + adj, spread)); } - return (ldexpl(r, spread)); + + adj = add_adjusted(r.lo, xy.lo); + if (spread + ilogbl(r.hi) > -16383) + return (ldexpl(r.hi + adj, spread)); + else + return (add_and_denormalize(r.hi, adj, spread)); } From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 04:55:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3A1B106566B; Mon, 9 Jan 2012 04:55:55 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 904B88FC08; Mon, 9 Jan 2012 04:55: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 q094ttwV023391; Mon, 9 Jan 2012 04:55:55 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q094ttdo023386; Mon, 9 Jan 2012 04:55:55 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201201090455.q094ttdo023386@svn.freebsd.org> From: David Schultz Date: Mon, 9 Jan 2012 04:55:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229840 - stable/8/lib/msun/src X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 04:55:55 -0000 Author: das Date: Mon Jan 9 04:55:55 2012 New Revision: 229840 URL: http://svn.freebsd.org/changeset/base/229840 Log: MFC various fma{,f,l} improvements: r226245 - refactoring r226371 - fix double-rounding bug r226373 - new math_private.h macros r226601 - fix nit in r226371 Modified: stable/8/lib/msun/src/math_private.h stable/8/lib/msun/src/s_fma.c stable/8/lib/msun/src/s_fmaf.c stable/8/lib/msun/src/s_fmal.c Directory Properties: stable/8/lib/msun/ (props changed) Modified: stable/8/lib/msun/src/math_private.h ============================================================================== --- stable/8/lib/msun/src/math_private.h Mon Jan 9 04:55:52 2012 (r229839) +++ stable/8/lib/msun/src/math_private.h Mon Jan 9 04:55:55 2012 (r229840) @@ -58,6 +58,10 @@ typedef union u_int32_t msw; u_int32_t lsw; } parts; + struct + { + u_int64_t w; + } xparts; } ieee_double_shape_type; #endif @@ -72,6 +76,10 @@ typedef union u_int32_t lsw; u_int32_t msw; } parts; + struct + { + u_int64_t w; + } xparts; } ieee_double_shape_type; #endif @@ -86,6 +94,14 @@ do { \ (ix1) = ew_u.parts.lsw; \ } while (0) +/* Get a 64-bit int from a double. */ +#define EXTRACT_WORD64(ix,d) \ +do { \ + ieee_double_shape_type ew_u; \ + ew_u.value = (d); \ + (ix) = ew_u.xparts.w; \ +} while (0) + /* Get the more significant 32 bit int from a double. */ #define GET_HIGH_WORD(i,d) \ @@ -114,6 +130,14 @@ do { \ (d) = iw_u.value; \ } while (0) +/* Set a double from a 64-bit int. */ +#define INSERT_WORD64(d,ix) \ +do { \ + ieee_double_shape_type iw_u; \ + iw_u.xparts.w = (ix); \ + (d) = iw_u.value; \ +} while (0) + /* Set the more significant 32 bits of a double from an int. */ #define SET_HIGH_WORD(d,v) \ Modified: stable/8/lib/msun/src/s_fma.c ============================================================================== --- stable/8/lib/msun/src/s_fma.c Mon Jan 9 04:55:52 2012 (r229839) +++ stable/8/lib/msun/src/s_fma.c Mon Jan 9 04:55:55 2012 (r229840) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005 David Schultz + * Copyright (c) 2005-2011 David Schultz * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -31,6 +31,132 @@ __FBSDID("$FreeBSD$"); #include #include +#include "math_private.h" + +/* + * A struct dd represents a floating-point number with twice the precision + * of a double. We maintain the invariant that "hi" stores the 53 high-order + * bits of the result. + */ +struct dd { + double hi; + double lo; +}; + +/* + * Compute a+b exactly, returning the exact result in a struct dd. We assume + * that both a and b are finite, but make no assumptions about their relative + * magnitudes. + */ +static inline struct dd +dd_add(double a, double b) +{ + struct dd ret; + double s; + + ret.hi = a + b; + s = ret.hi - a; + ret.lo = (a - (ret.hi - s)) + (b - s); + return (ret); +} + +/* + * Compute a+b, with a small tweak: The least significant bit of the + * result is adjusted into a sticky bit summarizing all the bits that + * were lost to rounding. This adjustment negates the effects of double + * rounding when the result is added to another number with a higher + * exponent. For an explanation of round and sticky bits, see any reference + * on FPU design, e.g., + * + * J. Coonen. An Implementation Guide to a Proposed Standard for + * Floating-Point Arithmetic. Computer, vol. 13, no. 1, Jan 1980. + */ +static inline double +add_adjusted(double a, double b) +{ + struct dd sum; + uint64_t hibits, lobits; + + sum = dd_add(a, b); + if (sum.lo != 0) { + EXTRACT_WORD64(hibits, sum.hi); + if ((hibits & 1) == 0) { + /* hibits += (int)copysign(1.0, sum.hi * sum.lo) */ + EXTRACT_WORD64(lobits, sum.lo); + hibits += 1 - ((hibits ^ lobits) >> 62); + INSERT_WORD64(sum.hi, hibits); + } + } + return (sum.hi); +} + +/* + * Compute ldexp(a+b, scale) with a single rounding error. It is assumed + * that the result will be subnormal, and care is taken to ensure that + * double rounding does not occur. + */ +static inline double +add_and_denormalize(double a, double b, int scale) +{ + struct dd sum; + uint64_t hibits, lobits; + int bits_lost; + + sum = dd_add(a, b); + + /* + * If we are losing at least two bits of accuracy to denormalization, + * then the first lost bit becomes a round bit, and we adjust the + * lowest bit of sum.hi to make it a sticky bit summarizing all the + * bits in sum.lo. With the sticky bit adjusted, the hardware will + * break any ties in the correct direction. + * + * If we are losing only one bit to denormalization, however, we must + * break the ties manually. + */ + if (sum.lo != 0) { + EXTRACT_WORD64(hibits, sum.hi); + bits_lost = -((int)(hibits >> 52) & 0x7ff) - scale + 1; + if (bits_lost != 1 ^ (int)(hibits & 1)) { + /* hibits += (int)copysign(1.0, sum.hi * sum.lo) */ + EXTRACT_WORD64(lobits, sum.lo); + hibits += 1 - (((hibits ^ lobits) >> 62) & 2); + INSERT_WORD64(sum.hi, hibits); + } + } + return (ldexp(sum.hi, scale)); +} + +/* + * Compute a*b exactly, returning the exact result in a struct dd. We assume + * that both a and b are normalized, so no underflow or overflow will occur. + * The current rounding mode must be round-to-nearest. + */ +static inline struct dd +dd_mul(double a, double b) +{ + static const double split = 0x1p27 + 1.0; + struct dd ret; + double ha, hb, la, lb, p, q; + + p = a * split; + ha = a - p; + ha += p; + la = a - ha; + + p = b * split; + hb = b - p; + hb += p; + lb = b - hb; + + p = ha * hb; + q = ha * lb + la * hb; + + ret.hi = p + q; + ret.lo = p - ret.hi + q + la * lb; + return (ret); +} + /* * Fused multiply-add: Compute x * y + z with a single rounding error. * @@ -48,14 +174,11 @@ __FBSDID("$FreeBSD$"); * Hardware instructions should be used on architectures that support it, * since this implementation will likely be several times slower. */ -#if LDBL_MANT_DIG != 113 double fma(double x, double y, double z) { - static const double split = 0x1p27 + 1.0; - double xs, ys, zs; - double c, cc, hx, hy, p, q, tx, ty; - double r, rr, s; + double xs, ys, zs, adj; + struct dd xy, r; int oround; int ex, ey, ez; int spread; @@ -85,41 +208,6 @@ fma(double x, double y, double z) * will overflow, so we handle these cases specially. Rounding * modes other than FE_TONEAREST are painful. */ - if (spread > DBL_MANT_DIG * 2) { - fenv_t env; - feraiseexcept(FE_INEXACT); - switch(oround) { - case FE_TONEAREST: - return (x * y); - case FE_TOWARDZERO: - if (x > 0.0 ^ y < 0.0 ^ z < 0.0) - return (x * y); - feholdexcept(&env); - r = x * y; - if (!fetestexcept(FE_INEXACT)) - r = nextafter(r, 0); - feupdateenv(&env); - return (r); - case FE_DOWNWARD: - if (z > 0.0) - return (x * y); - feholdexcept(&env); - r = x * y; - if (!fetestexcept(FE_INEXACT)) - r = nextafter(r, -INFINITY); - feupdateenv(&env); - return (r); - default: /* FE_UPWARD */ - if (z < 0.0) - return (x * y); - feholdexcept(&env); - r = x * y; - if (!fetestexcept(FE_INEXACT)) - r = nextafter(r, INFINITY); - feupdateenv(&env); - return (r); - } - } if (spread < -DBL_MANT_DIG) { feraiseexcept(FE_INEXACT); if (!isnormal(z)) @@ -144,63 +232,52 @@ fma(double x, double y, double z) return (z); } } + if (spread <= DBL_MANT_DIG * 2) + zs = ldexp(zs, -spread); + else + zs = copysign(DBL_MIN, zs); - /* - * Use Dekker's algorithm to perform the multiplication and - * subsequent addition in twice the machine precision. - * Arrange so that x * y = c + cc, and x * y + z = r + rr. - */ fesetround(FE_TONEAREST); - p = xs * split; - hx = xs - p; - hx += p; - tx = xs - hx; - - p = ys * split; - hy = ys - p; - hy += p; - ty = ys - hy; - - p = hx * hy; - q = hx * ty + tx * hy; - c = p + q; - cc = p - c + q + tx * ty; - - zs = ldexp(zs, -spread); - r = c + zs; - s = r - c; - rr = (c - (r - s)) + (zs - s) + cc; + /* + * Basic approach for round-to-nearest: + * + * (xy.hi, xy.lo) = x * y (exact) + * (r.hi, r.lo) = xy.hi + z (exact) + * adj = xy.lo + r.lo (inexact; low bit is sticky) + * result = r.hi + adj (correctly rounded) + */ + xy = dd_mul(xs, ys); + r = dd_add(xy.hi, zs); spread = ex + ey; - if (spread + ilogb(r) > -1023) { + + if (r.hi == 0.0) { + /* + * When the addends cancel to 0, ensure that the result has + * the correct sign. + */ fesetround(oround); - r = r + rr; - } else { + volatile double vzs = zs; /* XXX gcc CSE bug workaround */ + return (xy.hi + vzs + ldexp(xy.lo, spread)); + } + + if (oround != FE_TONEAREST) { /* - * The result is subnormal, so we round before scaling to - * avoid double rounding. + * There is no need to worry about double rounding in directed + * rounding modes. */ - p = ldexp(copysign(0x1p-1022, r), -spread); - c = r + p; - s = c - r; - cc = (r - (c - s)) + (p - s) + rr; fesetround(oround); - r = (c + cc) - p; + adj = r.lo + xy.lo; + return (ldexp(r.hi + adj, spread)); } - return (ldexp(r, spread)); -} -#else /* LDBL_MANT_DIG == 113 */ -/* - * 113 bits of precision is more than twice the precision of a double, - * so it is enough to represent the intermediate product exactly. - */ -double -fma(double x, double y, double z) -{ - return ((long double)x * y + z); + + adj = add_adjusted(r.lo, xy.lo); + if (spread + ilogb(r.hi) > -1023) + return (ldexp(r.hi + adj, spread)); + else + return (add_and_denormalize(r.hi, adj, spread)); } -#endif /* LDBL_MANT_DIG != 113 */ #if (LDBL_MANT_DIG == 53) __weak_reference(fma, fmal); Modified: stable/8/lib/msun/src/s_fmaf.c ============================================================================== --- stable/8/lib/msun/src/s_fmaf.c Mon Jan 9 04:55:52 2012 (r229839) +++ stable/8/lib/msun/src/s_fmaf.c Mon Jan 9 04:55:55 2012 (r229840) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005 David Schultz + * Copyright (c) 2005-2011 David Schultz * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -27,23 +27,43 @@ #include __FBSDID("$FreeBSD$"); +#include + #include "math.h" +#include "math_private.h" /* * Fused multiply-add: Compute x * y + z with a single rounding error. * * A double has more than twice as much precision than a float, so - * direct double-precision arithmetic suffices. - * - * XXX We are relying on the compiler to convert from double to float - * using the current rounding mode and with the appropriate - * side-effects. But on at least one platform (gcc 3.4.2/sparc64), - * this appears to be too much to ask for. The precision - * reduction should be done manually. + * direct double-precision arithmetic suffices, except where double + * rounding occurs. */ float fmaf(float x, float y, float z) { + double xy, result; + uint32_t hr, lr; + + xy = (double)x * y; + result = xy + z; + EXTRACT_WORDS(hr, lr, result); + /* Common case: The double precision result is fine. */ + if ((lr & 0x1fffffff) != 0x10000000 || /* not a halfway case */ + (hr & 0x7ff00000) == 0x7ff00000 || /* NaN */ + result - xy == z || /* exact */ + fegetround() != FE_TONEAREST) /* not round-to-nearest */ + return (result); - return ((double)x * y + z); + /* + * If result is inexact, and exactly halfway between two float values, + * we need to adjust the low-order bit in the direction of the error. + */ + fesetround(FE_TOWARDZERO); + volatile double vxy = xy; /* XXX work around gcc CSE bug */ + double adjusted_result = vxy + z; + fesetround(FE_TONEAREST); + if (result == adjusted_result) + SET_LOW_WORD(adjusted_result, lr + 1); + return (adjusted_result); } Modified: stable/8/lib/msun/src/s_fmal.c ============================================================================== --- stable/8/lib/msun/src/s_fmal.c Mon Jan 9 04:55:52 2012 (r229839) +++ stable/8/lib/msun/src/s_fmal.c Mon Jan 9 04:55:55 2012 (r229840) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2005 David Schultz + * Copyright (c) 2005-2011 David Schultz * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -31,6 +31,128 @@ __FBSDID("$FreeBSD$"); #include #include +#include "fpmath.h" + +/* + * A struct dd represents a floating-point number with twice the precision + * of a long double. We maintain the invariant that "hi" stores the high-order + * bits of the result. + */ +struct dd { + long double hi; + long double lo; +}; + +/* + * Compute a+b exactly, returning the exact result in a struct dd. We assume + * that both a and b are finite, but make no assumptions about their relative + * magnitudes. + */ +static inline struct dd +dd_add(long double a, long double b) +{ + struct dd ret; + long double s; + + ret.hi = a + b; + s = ret.hi - a; + ret.lo = (a - (ret.hi - s)) + (b - s); + return (ret); +} + +/* + * Compute a+b, with a small tweak: The least significant bit of the + * result is adjusted into a sticky bit summarizing all the bits that + * were lost to rounding. This adjustment negates the effects of double + * rounding when the result is added to another number with a higher + * exponent. For an explanation of round and sticky bits, see any reference + * on FPU design, e.g., + * + * J. Coonen. An Implementation Guide to a Proposed Standard for + * Floating-Point Arithmetic. Computer, vol. 13, no. 1, Jan 1980. + */ +static inline long double +add_adjusted(long double a, long double b) +{ + struct dd sum; + union IEEEl2bits u; + + sum = dd_add(a, b); + if (sum.lo != 0) { + u.e = sum.hi; + if ((u.bits.manl & 1) == 0) + sum.hi = nextafterl(sum.hi, INFINITY * sum.lo); + } + return (sum.hi); +} + +/* + * Compute ldexp(a+b, scale) with a single rounding error. It is assumed + * that the result will be subnormal, and care is taken to ensure that + * double rounding does not occur. + */ +static inline long double +add_and_denormalize(long double a, long double b, int scale) +{ + struct dd sum; + int bits_lost; + union IEEEl2bits u; + + sum = dd_add(a, b); + + /* + * If we are losing at least two bits of accuracy to denormalization, + * then the first lost bit becomes a round bit, and we adjust the + * lowest bit of sum.hi to make it a sticky bit summarizing all the + * bits in sum.lo. With the sticky bit adjusted, the hardware will + * break any ties in the correct direction. + * + * If we are losing only one bit to denormalization, however, we must + * break the ties manually. + */ + if (sum.lo != 0) { + u.e = sum.hi; + bits_lost = -u.bits.exp - scale + 1; + if (bits_lost != 1 ^ (int)(u.bits.manl & 1)) + sum.hi = nextafterl(sum.hi, INFINITY * sum.lo); + } + return (ldexp(sum.hi, scale)); +} + +/* + * Compute a*b exactly, returning the exact result in a struct dd. We assume + * that both a and b are normalized, so no underflow or overflow will occur. + * The current rounding mode must be round-to-nearest. + */ +static inline struct dd +dd_mul(long double a, long double b) +{ +#if LDBL_MANT_DIG == 64 + static const long double split = 0x1p32L + 1.0; +#elif LDBL_MANT_DIG == 113 + static const long double split = 0x1p57L + 1.0; +#endif + struct dd ret; + long double ha, hb, la, lb, p, q; + + p = a * split; + ha = a - p; + ha += p; + la = a - ha; + + p = b * split; + hb = b - p; + hb += p; + lb = b - hb; + + p = ha * hb; + q = ha * lb + la * hb; + + ret.hi = p + q; + ret.lo = p - ret.hi + q + la * lb; + return (ret); +} + /* * Fused multiply-add: Compute x * y + z with a single rounding error. * @@ -43,14 +165,8 @@ __FBSDID("$FreeBSD$"); long double fmal(long double x, long double y, long double z) { -#if LDBL_MANT_DIG == 64 - static const long double split = 0x1p32L + 1.0; -#elif LDBL_MANT_DIG == 113 - static const long double split = 0x1p57L + 1.0; -#endif - long double xs, ys, zs; - long double c, cc, hx, hy, p, q, tx, ty; - long double r, rr, s; + long double xs, ys, zs, adj; + struct dd xy, r; int oround; int ex, ey, ez; int spread; @@ -80,41 +196,6 @@ fmal(long double x, long double y, long * will overflow, so we handle these cases specially. Rounding * modes other than FE_TONEAREST are painful. */ - if (spread > LDBL_MANT_DIG * 2) { - fenv_t env; - feraiseexcept(FE_INEXACT); - switch(oround) { - case FE_TONEAREST: - return (x * y); - case FE_TOWARDZERO: - if (x > 0.0 ^ y < 0.0 ^ z < 0.0) - return (x * y); - feholdexcept(&env); - r = x * y; - if (!fetestexcept(FE_INEXACT)) - r = nextafterl(r, 0); - feupdateenv(&env); - return (r); - case FE_DOWNWARD: - if (z > 0.0) - return (x * y); - feholdexcept(&env); - r = x * y; - if (!fetestexcept(FE_INEXACT)) - r = nextafterl(r, -INFINITY); - feupdateenv(&env); - return (r); - default: /* FE_UPWARD */ - if (z < 0.0) - return (x * y); - feholdexcept(&env); - r = x * y; - if (!fetestexcept(FE_INEXACT)) - r = nextafterl(r, INFINITY); - feupdateenv(&env); - return (r); - } - } if (spread < -LDBL_MANT_DIG) { feraiseexcept(FE_INEXACT); if (!isnormal(z)) @@ -139,49 +220,49 @@ fmal(long double x, long double y, long return (z); } } + if (spread <= LDBL_MANT_DIG * 2) + zs = ldexpl(zs, -spread); + else + zs = copysignl(LDBL_MIN, zs); - /* - * Use Dekker's algorithm to perform the multiplication and - * subsequent addition in twice the machine precision. - * Arrange so that x * y = c + cc, and x * y + z = r + rr. - */ fesetround(FE_TONEAREST); - p = xs * split; - hx = xs - p; - hx += p; - tx = xs - hx; - - p = ys * split; - hy = ys - p; - hy += p; - ty = ys - hy; - - p = hx * hy; - q = hx * ty + tx * hy; - c = p + q; - cc = p - c + q + tx * ty; - - zs = ldexpl(zs, -spread); - r = c + zs; - s = r - c; - rr = (c - (r - s)) + (zs - s) + cc; + /* + * Basic approach for round-to-nearest: + * + * (xy.hi, xy.lo) = x * y (exact) + * (r.hi, r.lo) = xy.hi + z (exact) + * adj = xy.lo + r.lo (inexact; low bit is sticky) + * result = r.hi + adj (correctly rounded) + */ + xy = dd_mul(xs, ys); + r = dd_add(xy.hi, zs); spread = ex + ey; - if (spread + ilogbl(r) > -16383) { + + if (r.hi == 0.0) { + /* + * When the addends cancel to 0, ensure that the result has + * the correct sign. + */ fesetround(oround); - r = r + rr; - } else { + volatile long double vzs = zs; /* XXX gcc CSE bug workaround */ + return (xy.hi + vzs + ldexpl(xy.lo, spread)); + } + + if (oround != FE_TONEAREST) { /* - * The result is subnormal, so we round before scaling to - * avoid double rounding. + * There is no need to worry about double rounding in directed + * rounding modes. */ - p = ldexpl(copysignl(0x1p-16382L, r), -spread); - c = r + p; - s = c - r; - cc = (r - (c - s)) + (p - s) + rr; fesetround(oround); - r = (c + cc) - p; + adj = r.lo + xy.lo; + return (ldexpl(r.hi + adj, spread)); } - return (ldexpl(r, spread)); + + adj = add_adjusted(r.lo, xy.lo); + if (spread + ilogbl(r.hi) > -16383) + return (ldexpl(r.hi + adj, spread)); + else + return (add_and_denormalize(r.hi, adj, spread)); } From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 04:57:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FD4E1065670; Mon, 9 Jan 2012 04:57:07 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 13F908FC1B; Mon, 9 Jan 2012 04:57: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 q094v6ZQ023490; Mon, 9 Jan 2012 04:57:06 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q094v69T023487; Mon, 9 Jan 2012 04:57:06 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201201090457.q094v69T023487@svn.freebsd.org> From: David Schultz Date: Mon, 9 Jan 2012 04:57:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229841 - in stable/9/lib/msun: amd64 i387 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 04:57:07 -0000 Author: das Date: Mon Jan 9 04:57:06 2012 New Revision: 229841 URL: http://svn.freebsd.org/changeset/base/229841 Log: MFC r226594: Bugfix: feenableexcept() and fedisableexcept() should just return the old exception mask, not mask | ~FE_ALL_EXCEPT. Modified: stable/9/lib/msun/amd64/fenv.c stable/9/lib/msun/i387/fenv.c Directory Properties: stable/9/lib/msun/ (props changed) Modified: stable/9/lib/msun/amd64/fenv.c ============================================================================== --- stable/9/lib/msun/amd64/fenv.c Mon Jan 9 04:55:55 2012 (r229840) +++ stable/9/lib/msun/amd64/fenv.c Mon Jan 9 04:57:06 2012 (r229841) @@ -120,12 +120,12 @@ __feenableexcept(int mask) mask &= FE_ALL_EXCEPT; __fnstcw(&control); __stmxcsr(&mxcsr); - omask = (control | mxcsr >> _SSE_EMASK_SHIFT) & FE_ALL_EXCEPT; + omask = ~(control | mxcsr >> _SSE_EMASK_SHIFT) & FE_ALL_EXCEPT; control &= ~mask; __fldcw(control); mxcsr &= ~(mask << _SSE_EMASK_SHIFT); __ldmxcsr(mxcsr); - return (~omask); + return (omask); } int @@ -137,12 +137,12 @@ __fedisableexcept(int mask) mask &= FE_ALL_EXCEPT; __fnstcw(&control); __stmxcsr(&mxcsr); - omask = (control | mxcsr >> _SSE_EMASK_SHIFT) & FE_ALL_EXCEPT; + omask = ~(control | mxcsr >> _SSE_EMASK_SHIFT) & FE_ALL_EXCEPT; control |= mask; __fldcw(control); mxcsr |= mask << _SSE_EMASK_SHIFT; __ldmxcsr(mxcsr); - return (~omask); + return (omask); } __weak_reference(__feenableexcept, feenableexcept); Modified: stable/9/lib/msun/i387/fenv.c ============================================================================== --- stable/9/lib/msun/i387/fenv.c Mon Jan 9 04:55:55 2012 (r229840) +++ stable/9/lib/msun/i387/fenv.c Mon Jan 9 04:57:06 2012 (r229841) @@ -177,14 +177,14 @@ __feenableexcept(int mask) __stmxcsr(&mxcsr); else mxcsr = 0; - omask = (control | mxcsr >> _SSE_EMASK_SHIFT) & FE_ALL_EXCEPT; + omask = ~(control | mxcsr >> _SSE_EMASK_SHIFT) & FE_ALL_EXCEPT; control &= ~mask; __fldcw(control); if (__HAS_SSE()) { mxcsr &= ~(mask << _SSE_EMASK_SHIFT); __ldmxcsr(mxcsr); } - return (~omask); + return (omask); } int @@ -199,14 +199,14 @@ __fedisableexcept(int mask) __stmxcsr(&mxcsr); else mxcsr = 0; - omask = (control | mxcsr >> _SSE_EMASK_SHIFT) & FE_ALL_EXCEPT; + omask = ~(control | mxcsr >> _SSE_EMASK_SHIFT) & FE_ALL_EXCEPT; control |= mask; __fldcw(control); if (__HAS_SSE()) { mxcsr |= mask << _SSE_EMASK_SHIFT; __ldmxcsr(mxcsr); } - return (~omask); + return (omask); } __weak_reference(__feenableexcept, feenableexcept); From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 04:57:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C8C41065673; Mon, 9 Jan 2012 04:57:10 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 20A968FC19; Mon, 9 Jan 2012 04: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 q094v9vr023530; Mon, 9 Jan 2012 04:57:09 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q094v9ue023527; Mon, 9 Jan 2012 04:57:09 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201201090457.q094v9ue023527@svn.freebsd.org> From: David Schultz Date: Mon, 9 Jan 2012 04:57:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229842 - in stable/8/lib/msun: amd64 i387 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 04:57:10 -0000 Author: das Date: Mon Jan 9 04:57:09 2012 New Revision: 229842 URL: http://svn.freebsd.org/changeset/base/229842 Log: MFC r226594: Bugfix: feenableexcept() and fedisableexcept() should just return the old exception mask, not mask | ~FE_ALL_EXCEPT. Modified: stable/8/lib/msun/amd64/fenv.c stable/8/lib/msun/i387/fenv.c Directory Properties: stable/8/lib/msun/ (props changed) Modified: stable/8/lib/msun/amd64/fenv.c ============================================================================== --- stable/8/lib/msun/amd64/fenv.c Mon Jan 9 04:57:06 2012 (r229841) +++ stable/8/lib/msun/amd64/fenv.c Mon Jan 9 04:57:09 2012 (r229842) @@ -120,12 +120,12 @@ __feenableexcept(int mask) mask &= FE_ALL_EXCEPT; __fnstcw(&control); __stmxcsr(&mxcsr); - omask = (control | mxcsr >> _SSE_EMASK_SHIFT) & FE_ALL_EXCEPT; + omask = ~(control | mxcsr >> _SSE_EMASK_SHIFT) & FE_ALL_EXCEPT; control &= ~mask; __fldcw(control); mxcsr &= ~(mask << _SSE_EMASK_SHIFT); __ldmxcsr(mxcsr); - return (~omask); + return (omask); } int @@ -137,12 +137,12 @@ __fedisableexcept(int mask) mask &= FE_ALL_EXCEPT; __fnstcw(&control); __stmxcsr(&mxcsr); - omask = (control | mxcsr >> _SSE_EMASK_SHIFT) & FE_ALL_EXCEPT; + omask = ~(control | mxcsr >> _SSE_EMASK_SHIFT) & FE_ALL_EXCEPT; control |= mask; __fldcw(control); mxcsr |= mask << _SSE_EMASK_SHIFT; __ldmxcsr(mxcsr); - return (~omask); + return (omask); } __weak_reference(__feenableexcept, feenableexcept); Modified: stable/8/lib/msun/i387/fenv.c ============================================================================== --- stable/8/lib/msun/i387/fenv.c Mon Jan 9 04:57:06 2012 (r229841) +++ stable/8/lib/msun/i387/fenv.c Mon Jan 9 04:57:09 2012 (r229842) @@ -177,14 +177,14 @@ __feenableexcept(int mask) __stmxcsr(&mxcsr); else mxcsr = 0; - omask = (control | mxcsr >> _SSE_EMASK_SHIFT) & FE_ALL_EXCEPT; + omask = ~(control | mxcsr >> _SSE_EMASK_SHIFT) & FE_ALL_EXCEPT; control &= ~mask; __fldcw(control); if (__HAS_SSE()) { mxcsr &= ~(mask << _SSE_EMASK_SHIFT); __ldmxcsr(mxcsr); } - return (~omask); + return (omask); } int @@ -199,14 +199,14 @@ __fedisableexcept(int mask) __stmxcsr(&mxcsr); else mxcsr = 0; - omask = (control | mxcsr >> _SSE_EMASK_SHIFT) & FE_ALL_EXCEPT; + omask = ~(control | mxcsr >> _SSE_EMASK_SHIFT) & FE_ALL_EXCEPT; control |= mask; __fldcw(control); if (__HAS_SSE()) { mxcsr |= mask << _SSE_EMASK_SHIFT; __ldmxcsr(mxcsr); } - return (~omask); + return (omask); } __weak_reference(__feenableexcept, feenableexcept); From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 04:58:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15E4410656D5; Mon, 9 Jan 2012 04:58:00 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DE3368FC21; Mon, 9 Jan 2012 04:57: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 q094vxWv023613; Mon, 9 Jan 2012 04:57:59 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q094vxYP023610; Mon, 9 Jan 2012 04:57:59 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201201090457.q094vxYP023610@svn.freebsd.org> From: David Schultz Date: Mon, 9 Jan 2012 04:57:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229843 - stable/9/lib/msun/src X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 04:58:00 -0000 Author: das Date: Mon Jan 9 04:57:59 2012 New Revision: 229843 URL: http://svn.freebsd.org/changeset/base/229843 Log: MFC r226595: Per IEEE754r, pow(1, y) is 1 even if y is NaN, and pow(-1, +-Inf) is 1. Modified: stable/9/lib/msun/src/e_pow.c stable/9/lib/msun/src/e_powf.c Directory Properties: stable/9/lib/msun/ (props changed) Modified: stable/9/lib/msun/src/e_pow.c ============================================================================== --- stable/9/lib/msun/src/e_pow.c Mon Jan 9 04:57:09 2012 (r229842) +++ stable/9/lib/msun/src/e_pow.c Mon Jan 9 04:57:59 2012 (r229843) @@ -109,6 +109,9 @@ __ieee754_pow(double x, double y) /* y==zero: x**0 = 1 */ if((iy|ly)==0) return one; + /* x==1: 1**y = 1, even if y is NaN */ + if (hx==0x3ff00000 && lx == 0) return one; + /* y!=zero: result is NaN if either arg is NaN */ if(ix > 0x7ff00000 || ((ix==0x7ff00000)&&(lx!=0)) || iy > 0x7ff00000 || ((iy==0x7ff00000)&&(ly!=0))) @@ -138,7 +141,7 @@ __ieee754_pow(double x, double y) if(ly==0) { if (iy==0x7ff00000) { /* y is +-inf */ if(((ix-0x3ff00000)|lx)==0) - return y - y; /* inf**+-1 is NaN */ + return one; /* (-1)**+-inf is NaN */ else if (ix >= 0x3ff00000)/* (|x|>1)**+-inf = inf,0 */ return (hy>=0)? y: zero; else /* (|x|<1)**-,+inf = inf,0 */ Modified: stable/9/lib/msun/src/e_powf.c ============================================================================== --- stable/9/lib/msun/src/e_powf.c Mon Jan 9 04:57:09 2012 (r229842) +++ stable/9/lib/msun/src/e_powf.c Mon Jan 9 04:57:59 2012 (r229843) @@ -67,6 +67,9 @@ __ieee754_powf(float x, float y) /* y==zero: x**0 = 1 */ if(iy==0) return one; + /* x==1: 1**y = 1, even if y is NaN */ + if (hx==0x3f800000) return one; + /* y!=zero: result is NaN if either arg is NaN */ if(ix > 0x7f800000 || iy > 0x7f800000) @@ -90,7 +93,7 @@ __ieee754_powf(float x, float y) /* special value of y */ if (iy==0x7f800000) { /* y is +-inf */ if (ix==0x3f800000) - return y - y; /* inf**+-1 is NaN */ + return one; /* (-1)**+-inf is NaN */ else if (ix > 0x3f800000)/* (|x|>1)**+-inf = inf,0 */ return (hy>=0)? y: zero; else /* (|x|<1)**-,+inf = inf,0 */ From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 04:58:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7E9610656D1; Mon, 9 Jan 2012 04:58:02 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9CD3E8FC0A; Mon, 9 Jan 2012 04:58:02 +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 q094w2gS023655; Mon, 9 Jan 2012 04:58:02 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q094w2fK023652; Mon, 9 Jan 2012 04:58:02 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201201090458.q094w2fK023652@svn.freebsd.org> From: David Schultz Date: Mon, 9 Jan 2012 04:58:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229844 - stable/8/lib/msun/src X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 04:58:02 -0000 Author: das Date: Mon Jan 9 04:58:02 2012 New Revision: 229844 URL: http://svn.freebsd.org/changeset/base/229844 Log: MFC r226595: Per IEEE754r, pow(1, y) is 1 even if y is NaN, and pow(-1, +-Inf) is 1. Modified: stable/8/lib/msun/src/e_pow.c stable/8/lib/msun/src/e_powf.c Directory Properties: stable/8/lib/msun/ (props changed) Modified: stable/8/lib/msun/src/e_pow.c ============================================================================== --- stable/8/lib/msun/src/e_pow.c Mon Jan 9 04:57:59 2012 (r229843) +++ stable/8/lib/msun/src/e_pow.c Mon Jan 9 04:58:02 2012 (r229844) @@ -109,6 +109,9 @@ __ieee754_pow(double x, double y) /* y==zero: x**0 = 1 */ if((iy|ly)==0) return one; + /* x==1: 1**y = 1, even if y is NaN */ + if (hx==0x3ff00000 && lx == 0) return one; + /* y!=zero: result is NaN if either arg is NaN */ if(ix > 0x7ff00000 || ((ix==0x7ff00000)&&(lx!=0)) || iy > 0x7ff00000 || ((iy==0x7ff00000)&&(ly!=0))) @@ -138,7 +141,7 @@ __ieee754_pow(double x, double y) if(ly==0) { if (iy==0x7ff00000) { /* y is +-inf */ if(((ix-0x3ff00000)|lx)==0) - return y - y; /* inf**+-1 is NaN */ + return one; /* (-1)**+-inf is NaN */ else if (ix >= 0x3ff00000)/* (|x|>1)**+-inf = inf,0 */ return (hy>=0)? y: zero; else /* (|x|<1)**-,+inf = inf,0 */ Modified: stable/8/lib/msun/src/e_powf.c ============================================================================== --- stable/8/lib/msun/src/e_powf.c Mon Jan 9 04:57:59 2012 (r229843) +++ stable/8/lib/msun/src/e_powf.c Mon Jan 9 04:58:02 2012 (r229844) @@ -67,6 +67,9 @@ __ieee754_powf(float x, float y) /* y==zero: x**0 = 1 */ if(iy==0) return one; + /* x==1: 1**y = 1, even if y is NaN */ + if (hx==0x3f800000) return one; + /* y!=zero: result is NaN if either arg is NaN */ if(ix > 0x7f800000 || iy > 0x7f800000) @@ -90,7 +93,7 @@ __ieee754_powf(float x, float y) /* special value of y */ if (iy==0x7f800000) { /* y is +-inf */ if (ix==0x3f800000) - return y - y; /* inf**+-1 is NaN */ + return one; /* (-1)**+-inf is NaN */ else if (ix > 0x3f800000)/* (|x|>1)**+-inf = inf,0 */ return (hy>=0)? y: zero; else /* (|x|<1)**-,+inf = inf,0 */ From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 04:59:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 461C71065677; Mon, 9 Jan 2012 04:59:45 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 340F18FC1F; Mon, 9 Jan 2012 04:59: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 q094xjPu023769; Mon, 9 Jan 2012 04:59:45 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q094xiA0023766; Mon, 9 Jan 2012 04:59:44 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201201090459.q094xiA0023766@svn.freebsd.org> From: David Schultz Date: Mon, 9 Jan 2012 04:59:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229845 - stable/9/lib/libc/stdio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 04:59:45 -0000 Author: das Date: Mon Jan 9 04:59:44 2012 New Revision: 229845 URL: http://svn.freebsd.org/changeset/base/229845 Log: MFC r226604: Add support for the 'x' mode option in fopen() as specified in the C1X draft standard. The option is equivalent to O_EXCL. Modified: stable/9/lib/libc/stdio/flags.c stable/9/lib/libc/stdio/fopen.3 Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/stdio/flags.c ============================================================================== --- stable/9/lib/libc/stdio/flags.c Mon Jan 9 04:58:02 2012 (r229844) +++ stable/9/lib/libc/stdio/flags.c Mon Jan 9 04:59:44 2012 (r229845) @@ -80,11 +80,30 @@ __sflags(mode, optr) return (0); } - /* [rwa]\+ or [rwa]b\+ means read and write */ - if (*mode == '+' || (*mode == 'b' && mode[1] == '+')) { + /* 'b' (binary) is ignored */ + if (*mode == 'b') + mode++; + + /* [rwa][b]\+ means read and write */ + if (*mode == '+') { + mode++; ret = __SRW; m = O_RDWR; } + + /* 'b' (binary) can appear here, too -- and is ignored again */ + if (*mode == 'b') + mode++; + + /* 'x' means exclusive (fail if the file exists) */ + if (*mode == 'x') { + if (m == O_RDONLY) { + errno = EINVAL; + return (0); + } + o |= O_EXCL; + } + *optr = m | o; return (ret); } Modified: stable/9/lib/libc/stdio/fopen.3 ============================================================================== --- stable/9/lib/libc/stdio/fopen.3 Mon Jan 9 04:58:02 2012 (r229844) +++ stable/9/lib/libc/stdio/fopen.3 Mon Jan 9 04:59:44 2012 (r229845) @@ -32,7 +32,7 @@ .\" @(#)fopen.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd January 26, 2003 +.Dd October 17, 2011 .Dt FOPEN 3 .Os .Sh NAME @@ -60,45 +60,51 @@ and associates a stream with it. .Pp The argument .Fa mode -points to a string beginning with one of the following -sequences (Additional characters may follow these sequences.): +points to a string beginning with one of the following letters: .Bl -tag -width indent .It Dq Li r -Open text file for reading. -The stream is positioned at the beginning of the file. -.It Dq Li r+ -Open for reading and writing. +Open for reading. The stream is positioned at the beginning of the file. +Fail if the file does not exist. .It Dq Li w -Truncate to zero length or create text file for writing. -The stream is positioned at the beginning of the file. -.It Dq Li w+ -Open for reading and writing. -The file is created if it does not exist, otherwise it is truncated. +Open for writing. The stream is positioned at the beginning of the file. +Create the file if it does not exist. .It Dq Li a Open for writing. -The file is created if it does not exist. -The stream is positioned at the end of the file. -Subsequent writes to the file will always end up at the then current -end of file, irrespective of any intervening -.Xr fseek 3 -or similar. -.It Dq Li a+ -Open for reading and writing. -The file is created if it does not exist. The stream is positioned at the end of the file. Subsequent writes to the file will always end up at the then current end of file, irrespective of any intervening .Xr fseek 3 or similar. +Create the file if it does not exist. .El .Pp +An optional +.Dq Li + +following +.Dq Li r , +.Dq Li w , +or +.Dq Li a +opens the file for both reading and writing. +An optional +.Dq Li x +following +.Dq Li w +or +.Dq Li w+ +causes the +.Fn fopen +call to fail if the file already exists. +.Pp The .Fa mode -string can also include the letter ``b'' either as last character or -as a character between the characters in any of the two-character strings -described above. +string can also include the letter +.Dq Li b +after either the +.Dq Li + +or the first letter. This is strictly for compatibility with .St -isoC and has no effect; the ``b'' is ignored. @@ -135,6 +141,9 @@ function associates a stream with the ex .Fa fildes . The mode of the stream must be compatible with the mode of the file descriptor. +The +.Dq Li x +mode option is ignored. When the stream is closed via .Xr fclose 3 , .Fa fildes @@ -165,29 +174,12 @@ attempts to re-open the file associated with a new mode. The new mode must be compatible with the mode that the stream was originally opened with: -.Bl -bullet -offset indent -.It -Streams originally opened with mode -.Dq Li r -can only be reopened with that same mode. -.It -Streams originally opened with mode -.Dq Li a -can be reopened with the same mode, or mode -.Dq Li w . -.It -Streams originally opened with mode -.Dq Li w -can be reopened with the same mode, or mode -.Dq Li a . -.It -Streams originally opened with mode -.Dq Li r+ , -.Dq Li w+ , -or -.Dq Li a+ -can be reopened with any mode. -.El +Streams open for reading can only be re-opened for reading, +streams open for writing can only be re-opened for writing, +and streams open for reading and writing can be re-opened in any mode. +The +.Dq Li x +mode option is not meaningful in this context. .Pp The primary use of the .Fn freopen From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 04:59:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15992106566C; Mon, 9 Jan 2012 04:59:48 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 038AE8FC0A; Mon, 9 Jan 2012 04:59: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 q094xlm9023807; Mon, 9 Jan 2012 04:59:47 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q094xlMY023804; Mon, 9 Jan 2012 04:59:47 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201201090459.q094xlMY023804@svn.freebsd.org> From: David Schultz Date: Mon, 9 Jan 2012 04:59:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229846 - stable/8/lib/libc/stdio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 04:59:48 -0000 Author: das Date: Mon Jan 9 04:59:47 2012 New Revision: 229846 URL: http://svn.freebsd.org/changeset/base/229846 Log: MFC r226604: Add support for the 'x' mode option in fopen() as specified in the C1X draft standard. The option is equivalent to O_EXCL. Also merge doc improvements r197045 and r207942. Modified: stable/8/lib/libc/stdio/flags.c stable/8/lib/libc/stdio/fopen.3 Directory Properties: stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/stdio/flags.c ============================================================================== --- stable/8/lib/libc/stdio/flags.c Mon Jan 9 04:59:44 2012 (r229845) +++ stable/8/lib/libc/stdio/flags.c Mon Jan 9 04:59:47 2012 (r229846) @@ -80,11 +80,30 @@ __sflags(mode, optr) return (0); } - /* [rwa]\+ or [rwa]b\+ means read and write */ - if (*mode == '+' || (*mode == 'b' && mode[1] == '+')) { + /* 'b' (binary) is ignored */ + if (*mode == 'b') + mode++; + + /* [rwa][b]\+ means read and write */ + if (*mode == '+') { + mode++; ret = __SRW; m = O_RDWR; } + + /* 'b' (binary) can appear here, too -- and is ignored again */ + if (*mode == 'b') + mode++; + + /* 'x' means exclusive (fail if the file exists) */ + if (*mode == 'x') { + if (m == O_RDONLY) { + errno = EINVAL; + return (0); + } + o |= O_EXCL; + } + *optr = m | o; return (ret); } Modified: stable/8/lib/libc/stdio/fopen.3 ============================================================================== --- stable/8/lib/libc/stdio/fopen.3 Mon Jan 9 04:59:44 2012 (r229845) +++ stable/8/lib/libc/stdio/fopen.3 Mon Jan 9 04:59:47 2012 (r229846) @@ -32,7 +32,7 @@ .\" @(#)fopen.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd January 26, 2003 +.Dd October 17, 2011 .Dt FOPEN 3 .Os .Sh NAME @@ -60,51 +60,57 @@ and associates a stream with it. .Pp The argument .Fa mode -points to a string beginning with one of the following -sequences (Additional characters may follow these sequences.): +points to a string beginning with one of the following letters: .Bl -tag -width indent .It Dq Li r -Open text file for reading. -The stream is positioned at the beginning of the file. -.It Dq Li r+ -Open for reading and writing. +Open for reading. The stream is positioned at the beginning of the file. +Fail if the file does not exist. .It Dq Li w -Truncate to zero length or create text file for writing. -The stream is positioned at the beginning of the file. -.It Dq Li w+ -Open for reading and writing. -The file is created if it does not exist, otherwise it is truncated. +Open for writing. The stream is positioned at the beginning of the file. +Create the file if it does not exist. .It Dq Li a Open for writing. -The file is created if it does not exist. -The stream is positioned at the end of the file. -Subsequent writes to the file will always end up at the then current -end of file, irrespective of any intervening -.Xr fseek 3 -or similar. -.It Dq Li a+ -Open for reading and writing. -The file is created if it does not exist. The stream is positioned at the end of the file. Subsequent writes to the file will always end up at the then current end of file, irrespective of any intervening .Xr fseek 3 or similar. +Create the file if it does not exist. .El .Pp +An optional +.Dq Li + +following +.Dq Li r , +.Dq Li w , +or +.Dq Li a +opens the file for both reading and writing. +An optional +.Dq Li x +following +.Dq Li w +or +.Dq Li w+ +causes the +.Fn fopen +call to fail if the file already exists. +.Pp The .Fa mode -string can also include the letter ``b'' either as a third character or -as a character between the characters in any of the two-character strings -described above. +string can also include the letter +.Dq Li b +after either the +.Dq Li + +or the first letter. This is strictly for compatibility with .St -isoC and has no effect; the ``b'' is ignored. .Pp Any created files will have mode -.Pf \\*q Dv S_IRUSR +.Do Dv S_IRUSR \&| .Dv S_IWUSR \&| @@ -114,7 +120,7 @@ Any created files will have mode \&| .Dv S_IROTH \&| -.Dv S_IWOTH Ns \\*q +.Dv S_IWOTH Dc .Pq Li 0666 , as modified by the process' umask value (see @@ -135,6 +141,9 @@ function associates a stream with the ex .Fa fildes . The mode of the stream must be compatible with the mode of the file descriptor. +The +.Dq Li x +mode option is ignored. When the stream is closed via .Xr fclose 3 , .Fa fildes @@ -165,29 +174,12 @@ attempts to re-open the file associated with a new mode. The new mode must be compatible with the mode that the stream was originally opened with: -.Bl -bullet -offset indent -.It -Streams originally opened with mode -.Dq Li r -can only be reopened with that same mode. -.It -Streams originally opened with mode -.Dq Li a -can be reopened with the same mode, or mode -.Dq Li w . -.It -Streams originally opened with mode -.Dq Li w -can be reopened with the same mode, or mode -.Dq Li a . -.It -Streams originally opened with mode -.Dq Li r+ , -.Dq Li w+ , -or -.Dq Li a+ -can be reopened with any mode. -.El +Streams open for reading can only be re-opened for reading, +streams open for writing can only be re-opened for writing, +and streams open for reading and writing can be re-opened in any mode. +The +.Dq Li x +mode option is not meaningful in this context. .Pp The primary use of the .Fn freopen From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 05:51:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 818C4106564A; Mon, 9 Jan 2012 05:51:34 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7053E8FC14; Mon, 9 Jan 2012 05:51: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 q095pYw6025350; Mon, 9 Jan 2012 05:51:34 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q095pYbN025348; Mon, 9 Jan 2012 05:51:34 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201201090551.q095pYbN025348@svn.freebsd.org> From: Warren Block Date: Mon, 9 Jan 2012 05:51:34 +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: r229847 - head/sbin/geom/class/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 05:51:34 -0000 Author: wblock (doc committer) Date: Mon Jan 9 05:51:33 2012 New Revision: 229847 URL: http://svn.freebsd.org/changeset/base/229847 Log: Whitespace-only fix. Translators, please feel free to ignore. Approved by: gjb (mentor) MFC after: 3 days X-MFC-with: r227774, r227777, r227800 Modified: head/sbin/geom/class/part/gpart.8 Modified: head/sbin/geom/class/part/gpart.8 ============================================================================== --- head/sbin/geom/class/part/gpart.8 Mon Jan 9 04:59:47 2012 (r229846) +++ head/sbin/geom/class/part/gpart.8 Mon Jan 9 05:51:33 2012 (r229847) @@ -48,7 +48,8 @@ lines in the kernel configuration file: These options provide support for the various types of partitioning schemes supported by the .Ns Nm -utility. See +utility. +See .Sx "PARTITIONING SCHEMES" below for more details. .Pp @@ -502,8 +503,8 @@ Traditional BSD disklabel, usually used .Po This scheme can also be used as the sole partitioning method, without an MBR. -Partition editing tools from other operating systems often do not -understand the bare disklabel partition layout, so this is sometimes +Partition editing tools from other operating systems often do not +understand the bare disklabel partition layout, so this is sometimes called .Dq dangerously dedicated . .Pc From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 06:36:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FC01106566C; Mon, 9 Jan 2012 06:36:29 +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 0DF628FC15; Mon, 9 Jan 2012 06:36: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 q096aSHN026737; Mon, 9 Jan 2012 06:36:28 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q096aSiu026731; Mon, 9 Jan 2012 06:36:28 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201090636.q096aSiu026731@svn.freebsd.org> From: Ed Schouten Date: Mon, 9 Jan 2012 06:36: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: r229848 - in head: include lib/libc/stdlib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 06:36:29 -0000 Author: ed Date: Mon Jan 9 06:36:28 2012 New Revision: 229848 URL: http://svn.freebsd.org/changeset/base/229848 Log: Add aligned_alloc(3). The C11 folks reinvented the wheel by introducing an aligned version of malloc(3) called aligned_alloc(3), instead of posix_memalign(3). Instead of returning the allocation by reference, it returns the address, just like malloc(3). Reviewed by: jasone@ Added: head/lib/libc/stdlib/aligned_alloc.3 - copied, changed from r229786, head/lib/libc/stdlib/posix_memalign.3 Deleted: head/lib/libc/stdlib/posix_memalign.3 Modified: head/include/stdlib.h head/lib/libc/stdlib/Makefile.inc head/lib/libc/stdlib/Symbol.map head/lib/libc/stdlib/malloc.c Modified: head/include/stdlib.h ============================================================================== --- head/include/stdlib.h Mon Jan 9 05:51:33 2012 (r229847) +++ head/include/stdlib.h Mon Jan 9 06:36:28 2012 (r229848) @@ -152,6 +152,7 @@ _Noreturn void _Exit(int); * If we're in a mode greater than C99, expose C11 functions. */ #if __ISO_C_VISIBLE >= 2011 +void * aligned_alloc(size_t, size_t); int at_quick_exit(void (*)(void)); _Noreturn void quick_exit(int); Modified: head/lib/libc/stdlib/Makefile.inc ============================================================================== --- head/lib/libc/stdlib/Makefile.inc Mon Jan 9 05:51:33 2012 (r229847) +++ head/lib/libc/stdlib/Makefile.inc Mon Jan 9 06:36:28 2012 (r229848) @@ -18,17 +18,18 @@ SYM_MAPS+= ${.CURDIR}/stdlib/Symbol.map # machine-dependent stdlib sources .sinclude "${.CURDIR}/${LIBC_ARCH}/stdlib/Makefile.inc" -MAN+= a64l.3 abort.3 abs.3 alloca.3 atexit.3 atof.3 atoi.3 atol.3 \ - at_quick_exit.3 bsearch.3 \ +MAN+= a64l.3 abort.3 abs.3 aligned_alloc.3 alloca.3 atexit.3 atof.3 \ + atoi.3 atol.3 at_quick_exit.3 bsearch.3 \ div.3 exit.3 getenv.3 getopt.3 getopt_long.3 getsubopt.3 \ hcreate.3 imaxabs.3 imaxdiv.3 insque.3 labs.3 ldiv.3 llabs.3 lldiv.3 \ - lsearch.3 malloc.3 memory.3 posix_memalign.3 ptsname.3 qsort.3 \ + lsearch.3 malloc.3 memory.3 ptsname.3 qsort.3 \ quick_exit.3 \ radixsort.3 rand.3 random.3 \ realpath.3 strfmon.3 strtod.3 strtol.3 strtonum.3 strtoul.3 system.3 \ tsearch.3 MLINKS+=a64l.3 l64a.3 a64l.3 l64a_r.3 +MLINKS+=aligned_alloc.3 posix_memalign.3 MLINKS+=atol.3 atoll.3 MLINKS+=exit.3 _Exit.3 MLINKS+=getenv.3 putenv.3 getenv.3 setenv.3 getenv.3 unsetenv.3 Modified: head/lib/libc/stdlib/Symbol.map ============================================================================== --- head/lib/libc/stdlib/Symbol.map Mon Jan 9 05:51:33 2012 (r229847) +++ head/lib/libc/stdlib/Symbol.map Mon Jan 9 06:36:28 2012 (r229848) @@ -93,6 +93,7 @@ FBSD_1.0 { }; FBSD_1.3 { + aligned_alloc; at_quick_exit; atof_l; atoi_l; Copied and modified: head/lib/libc/stdlib/aligned_alloc.3 (from r229786, head/lib/libc/stdlib/posix_memalign.3) ============================================================================== --- head/lib/libc/stdlib/posix_memalign.3 Sat Jan 7 16:16:13 2012 (r229786, copy source) +++ head/lib/libc/stdlib/aligned_alloc.3 Mon Jan 9 06:36:28 2012 (r229848) @@ -27,26 +27,35 @@ .\" .\" $FreeBSD$ .\" -.Dd January 11, 2006 -.Dt POSIX_MEMALIGN 3 +.Dd January 7, 2011 +.Dt ALIGNED_ALLOC 3 .Os .Sh NAME +.Nm aligned_alloc , .Nm posix_memalign .Nd aligned memory allocation .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In stdlib.h +.Ft void * +.Fn aligned_alloc "size_t alignment" "size_t size" .Ft int .Fn posix_memalign "void **ptr" "size_t alignment" "size_t size" .Sh DESCRIPTION The +.Fn aligned_alloc +and .Fn posix_memalign -function allocates +functions allocate .Fa size bytes of memory such that the allocation's base address is an even multiple of -.Fa alignment , -and returns the allocation in the value pointed to by +.Fa alignment . +The +.Fn aligned_alloc +function returns the allocation, while the +.Fn posix_memalign +function stores the allocation in the value pointed to by .Fa ptr . .Pp The requested @@ -55,6 +64,8 @@ must be a power of 2 at least as large a .Fn sizeof "void *" . .Pp Memory that is allocated via +.Fn aligned_alloc +and .Fn posix_memalign can be used as an argument in subsequent calls to .Xr realloc 3 , @@ -63,12 +74,21 @@ and .Xr free 3 . .Sh RETURN VALUES The +.Fn aligned_alloc +function returns a pointer to the allocation if successful; otherwise a +NULL pointer is returned and +.Va errno +is set to an error value. +.Pp +The .Fn posix_memalign function returns the value 0 if successful; otherwise it returns an error value. .Sh ERRORS The +.Fn aligned_alloc +and .Fn posix_memalign -function will fail if: +functions will fail if: .Bl -tag -width Er .It Bq Er EINVAL The @@ -86,6 +106,11 @@ Memory allocation error. .Xr valloc 3 .Sh STANDARDS The +.Fn aligned_alloc +function conforms to +.St -isoC-2011 . +.Pp +The .Fn posix_memalign function conforms to .St -p1003.1-2001 . @@ -94,3 +119,8 @@ The .Fn posix_memalign function first appeared in .Fx 7.0 . +.Pp +The +.Fn aligned_alloc +function first appeared in +.Fx 10.0 . Modified: head/lib/libc/stdlib/malloc.c ============================================================================== --- head/lib/libc/stdlib/malloc.c Mon Jan 9 05:51:33 2012 (r229847) +++ head/lib/libc/stdlib/malloc.c Mon Jan 9 06:36:28 2012 (r229848) @@ -6043,6 +6043,20 @@ RETURN: } void * +aligned_alloc(size_t alignment, size_t size) +{ + void *memptr; + int ret; + + ret = posix_memalign(&memptr, alignment, size); + if (ret != 0) { + errno = ret; + return (NULL); + } + return (memptr); +} + +void * calloc(size_t num, size_t size) { void *ret; From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 08:36:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7AC5106564A; Mon, 9 Jan 2012 08:36:12 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A63EE8FC08; Mon, 9 Jan 2012 08:36: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 q098aC0h030610; Mon, 9 Jan 2012 08:36:12 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q098aCTI030608; Mon, 9 Jan 2012 08:36:12 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201090836.q098aCTI030608@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 9 Jan 2012 08:36: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: r229849 - head/sys/contrib/pf/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 08:36:12 -0000 Author: glebius Date: Mon Jan 9 08:36:12 2012 New Revision: 229849 URL: http://svn.freebsd.org/changeset/base/229849 Log: o Fix panic on module unload, that happened due to mutex being destroyed prior to pfsync_uninit(). To do this, move all the initialization to the module_t method, instead of SYSINIT(9). o Fix another panic after module unload, due to not clearing the m_addr_chg_pf_p pointer. o Refuse to unload module, unless being unloaded forcibly. o Revert the sub argument to MODULE_DECLARE, to the stable/8 value. This change probably isn't correct from viewpoint of VIMAGE, but the module wasn't VIMAGE-correct before the change, as well. Glanced at by: bz Modified: head/sys/contrib/pf/net/pf_ioctl.c Modified: head/sys/contrib/pf/net/pf_ioctl.c ============================================================================== --- head/sys/contrib/pf/net/pf_ioctl.c Mon Jan 9 06:36:28 2012 (r229848) +++ head/sys/contrib/pf/net/pf_ioctl.c Mon Jan 9 08:36:12 2012 (r229849) @@ -4328,57 +4328,25 @@ dehook_pf(void) return (0); } -/* Vnet accessors */ -static int -vnet_pf_init(const void *unused) -{ - - V_pf_pfil_hooked = 0; - V_pf_end_threads = 0; - - V_debug_pfugidhack = 0; - - TAILQ_INIT(&V_pf_tags); - TAILQ_INIT(&V_pf_qids); - - pf_load(); - - return (0); -} - -static int -vnet_pf_uninit(const void *unused) -{ - - pf_unload(); - - return (0); -} - -/* Define startup order. */ -#define PF_SYSINIT_ORDER SI_SUB_PROTO_BEGIN -#define PF_MODEVENT_ORDER (SI_ORDER_FIRST) /* On boot slot in here. */ -#define PF_VNET_ORDER (PF_MODEVENT_ORDER + 2) /* Later still. */ - -/* - * Starting up. - * VNET_SYSINIT is called for each existing vnet and each new vnet. - */ -VNET_SYSINIT(vnet_pf_init, PF_SYSINIT_ORDER, PF_VNET_ORDER, - vnet_pf_init, NULL); - -/* - * Closing up shop. These are done in REVERSE ORDER, - * Not called on reboot. - * VNET_SYSUNINIT is called for each exiting vnet as it exits. - */ -VNET_SYSUNINIT(vnet_pf_uninit, PF_SYSINIT_ORDER, PF_VNET_ORDER, - vnet_pf_uninit, NULL); - static int pf_load(void) { + VNET_ITERATOR_DECL(vnet_iter); + VNET_LIST_RLOCK(); + VNET_FOREACH(vnet_iter) { + CURVNET_SET(vnet_iter); + V_pf_pfil_hooked = 0; + V_pf_end_threads = 0; + V_debug_pfugidhack = 0; + TAILQ_INIT(&V_pf_tags); + TAILQ_INIT(&V_pf_qids); + CURVNET_RESTORE(); + } + VNET_LIST_RUNLOCK(); + + init_pf_mutex(); + pf_dev = make_dev(&pf_cdevsw, 0, 0, 0, 0600, PF_NAME); init_zone_var(); sx_init(&V_pf_consistency_lock, "pf_statetbl_lock"); if (pfattach() < 0) @@ -4395,6 +4363,7 @@ pf_unload(void) PF_LOCK(); V_pf_status.running = 0; PF_UNLOCK(); + m_addr_chg_pf_p = NULL; error = dehook_pf(); if (error) { /* @@ -4417,6 +4386,8 @@ pf_unload(void) pf_osfp_cleanup(); cleanup_pf_zone(); PF_UNLOCK(); + destroy_dev(pf_dev); + destroy_pf_mutex(); sx_destroy(&V_pf_consistency_lock); return error; } @@ -4428,12 +4399,16 @@ pf_modevent(module_t mod, int type, void switch(type) { case MOD_LOAD: - init_pf_mutex(); - pf_dev = make_dev(&pf_cdevsw, 0, 0, 0, 0600, PF_NAME); + error = pf_load(); + break; + case MOD_QUIESCE: + /* + * Module should not be unloaded due to race conditions. + */ + error = EPERM; break; case MOD_UNLOAD: - destroy_dev(pf_dev); - destroy_pf_mutex(); + error = pf_unload(); break; default: error = EINVAL; @@ -4448,6 +4423,6 @@ static moduledata_t pf_mod = { 0 }; -DECLARE_MODULE(pf, pf_mod, SI_SUB_PSEUDO, SI_ORDER_FIRST); +DECLARE_MODULE(pf, pf_mod, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_FIRST); MODULE_VERSION(pf, PF_MODVER); #endif /* __FreeBSD__ */ From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 08:50:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 582EA106567A; Mon, 9 Jan 2012 08:50:23 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 459238FC1A; Mon, 9 Jan 2012 08:50: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 q098oNka031483; Mon, 9 Jan 2012 08:50:23 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q098oNme031479; Mon, 9 Jan 2012 08:50:23 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201090850.q098oNme031479@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 9 Jan 2012 08:50: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: r229850 - in head: etc/rc.d sys/contrib/pf/net sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 08:50:23 -0000 Author: glebius Date: Mon Jan 9 08:50:22 2012 New Revision: 229850 URL: http://svn.freebsd.org/changeset/base/229850 Log: Bunch of fixes to pfsync(4) module load/unload: o Make the pfsync.ko actually usable. Before this change loading it didn't register protosw, so was a nop. However, a module /boot/kernel did confused users. o Rewrite the way we are joining multicast group: - Move multicast initialization/destruction to separate functions. - Don't allocate memory if we aren't going to join a multicast group. - Use modern API for joining/leaving multicast group. - Now the utterly wrong pfsync_ifdetach() isn't needed. o Move module initialization from SYSINIT(9) to moduledata_t method. o Refuse to unload module, unless asked forcibly. o Improve a bit some FreeBSD porting code: - Use separate malloc type. - Simplify swi sheduling. This change is probably wrong from VIMAGE viewpoint, however pfsync wasn't VIMAGE-correct before this change, too. Glanced at by: bz Modified: head/etc/rc.d/pfsync head/sys/contrib/pf/net/if_pfsync.c head/sys/netinet/in_proto.c Modified: head/etc/rc.d/pfsync ============================================================================== --- head/etc/rc.d/pfsync Mon Jan 9 08:36:12 2012 (r229849) +++ head/etc/rc.d/pfsync Mon Jan 9 08:50:22 2012 (r229850) @@ -18,13 +18,6 @@ required_modules="pf" pfsync_prestart() { - # XXX Currently pfsync cannot be a module as it must register - # a network protocol in a static kernel table. - if ! kldstat -q -m pfsync; then - warn "pfsync(4) must be statically compiled in the kernel." - return 1 - fi - case "$pfsync_syncdev" in '') warn "pfsync_syncdev is not set." Modified: head/sys/contrib/pf/net/if_pfsync.c ============================================================================== --- head/sys/contrib/pf/net/if_pfsync.c Mon Jan 9 08:36:12 2012 (r229849) +++ head/sys/contrib/pf/net/if_pfsync.c Mon Jan 9 08:50:22 2012 (r229850) @@ -87,6 +87,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #else #include #include @@ -295,21 +296,25 @@ struct pfsync_softc { #else struct timeout sc_tmo; #endif -#ifdef __FreeBSD__ - eventhandler_tag sc_detachtag; -#endif - }; #ifdef __FreeBSD__ +static MALLOC_DEFINE(M_PFSYNC, "pfsync", "pfsync data"); static VNET_DEFINE(struct pfsync_softc *, pfsyncif) = NULL; #define V_pfsyncif VNET(pfsyncif) - +static VNET_DEFINE(void *, pfsync_swi_cookie) = NULL; +#define V_pfsync_swi_cookie VNET(pfsync_swi_cookie) static VNET_DEFINE(struct pfsyncstats, pfsyncstats); #define V_pfsyncstats VNET(pfsyncstats) static VNET_DEFINE(int, pfsync_carp_adj) = CARP_MAXSKEW; #define V_pfsync_carp_adj VNET(pfsync_carp_adj) +static void pfsyncintr(void *); +static int pfsync_multicast_setup(struct pfsync_softc *); +static void pfsync_multicast_cleanup(struct pfsync_softc *); +static int pfsync_init(void); +static void pfsync_uninit(void); + SYSCTL_NODE(_net, OID_AUTO, pfsync, CTLFLAG_RW, 0, "PFSYNC"); SYSCTL_VNET_STRUCT(_net_pfsync, OID_AUTO, stats, CTLFLAG_RW, &VNET_NAME(pfsyncstats), pfsyncstats, @@ -322,16 +327,6 @@ struct pfsyncstats pfsyncstats; #define V_pfsyncstats pfsyncstats #endif -#ifdef __FreeBSD__ -static void pfsyncintr(void *); -struct pfsync_swi { - void * pfsync_swi_cookie; -}; -static struct pfsync_swi pfsync_swi; -#define schednetisr(p) swi_sched(pfsync_swi.pfsync_swi_cookie, 0) -#define NETISR_PFSYNC -#endif - void pfsyncattach(int); #ifdef __FreeBSD__ int pfsync_clone_create(struct if_clone *, int, caddr_t); @@ -377,8 +372,6 @@ void pfsync_bulk_update(void *); void pfsync_bulk_fail(void *); #ifdef __FreeBSD__ -void pfsync_ifdetach(void *, struct ifnet *); - /* XXX: ugly */ #define betoh64 (unsigned long long)be64toh #define timeout_del callout_stop @@ -390,6 +383,10 @@ int pfsync_sync_ok; #endif #ifdef __FreeBSD__ +VNET_DEFINE(struct ifc_simple_data, pfsync_cloner_data); +VNET_DEFINE(struct if_clone, pfsync_cloner); +#define V_pfsync_cloner_data VNET(pfsync_cloner_data) +#define V_pfsync_cloner VNET(pfsync_cloner) IFC_SIMPLE_DECLARE(pfsync, 1); #else struct if_clone pfsync_cloner = @@ -415,25 +412,20 @@ pfsync_clone_create(struct if_clone *ifc if (unit != 0) return (EINVAL); -#ifndef __FreeBSD__ +#ifdef __FreeBSD__ + sc = malloc(sizeof(struct pfsync_softc), M_PFSYNC, M_WAITOK | M_ZERO); + sc->pfsync_sync_ok = 1; +#else pfsync_sync_ok = 1; + sc = malloc(sizeof(*pfsyncif), M_DEVBUF, M_NOWAIT | M_ZERO); #endif - sc = malloc(sizeof(struct pfsync_softc), M_DEVBUF, M_NOWAIT | M_ZERO); - if (sc == NULL) - return (ENOMEM); - for (q = 0; q < PFSYNC_S_COUNT; q++) TAILQ_INIT(&sc->sc_qs[q]); #ifdef __FreeBSD__ - sc->pfsync_sync_ok = 1; - sc->sc_pool = uma_zcreate("pfsync", PFSYNC_PLSIZE, - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - if (sc->sc_pool == NULL) { - free(sc, M_DEVBUF); - return (ENOMEM); - } + sc->sc_pool = uma_zcreate("pfsync", PFSYNC_PLSIZE, NULL, NULL, NULL, + NULL, UMA_ALIGN_PTR, 0); #else pool_init(&sc->sc_pool, PFSYNC_PLSIZE, 0, 0, 0, "pfsync", NULL); #endif @@ -446,13 +438,7 @@ pfsync_clone_create(struct if_clone *ifc sc->sc_len = PFSYNC_MINPKT; sc->sc_maxupdates = 128; -#ifdef __FreeBSD__ - sc->sc_imo.imo_membership = (struct in_multi **)malloc( - (sizeof(struct in_multi *) * IP_MIN_MEMBERSHIPS), M_DEVBUF, - M_NOWAIT | M_ZERO); - sc->sc_imo.imo_max_memberships = IP_MIN_MEMBERSHIPS; - sc->sc_imo.imo_multicast_vif = -1; -#else +#ifndef __FreeBSD__ sc->sc_imo.imo_membership = (struct in_multi **)malloc( (sizeof(struct in_multi *) * IP_MIN_MEMBERSHIPS), M_IPMOPTS, M_WAITOK | M_ZERO); @@ -462,26 +448,11 @@ pfsync_clone_create(struct if_clone *ifc #ifdef __FreeBSD__ ifp = sc->sc_ifp = if_alloc(IFT_PFSYNC); if (ifp == NULL) { - free(sc->sc_imo.imo_membership, M_DEVBUF); uma_zdestroy(sc->sc_pool); - free(sc, M_DEVBUF); + free(sc, M_PFSYNC); return (ENOSPC); } if_initname(ifp, ifc->ifc_name, unit); - - sc->sc_detachtag = EVENTHANDLER_REGISTER(ifnet_departure_event, -#ifdef __FreeBSD__ - pfsync_ifdetach, V_pfsyncif, EVENTHANDLER_PRI_ANY); -#else - pfsync_ifdetach, pfsyncif, EVENTHANDLER_PRI_ANY); -#endif - if (sc->sc_detachtag == NULL) { - if_free(ifp); - free(sc->sc_imo.imo_membership, M_DEVBUF); - uma_zdestroy(sc->sc_pool); - free(sc, M_DEVBUF); - return (ENOSPC); - } #else ifp = &sc->sc_if; snprintf(ifp->if_xname, sizeof ifp->if_xname, "pfsync%d", unit); @@ -540,7 +511,6 @@ pfsync_clone_destroy(struct ifnet *ifp) struct pfsync_softc *sc = ifp->if_softc; #ifdef __FreeBSD__ - EVENTHANDLER_DEREGISTER(ifnet_departure_event, sc->sc_detachtag); PF_LOCK(); #endif timeout_del(&sc->sc_bulkfail_tmo); @@ -573,11 +543,13 @@ pfsync_clone_destroy(struct ifnet *ifp) #endif #ifdef __FreeBSD__ if_free(ifp); - free(sc->sc_imo.imo_membership, M_DEVBUF); + if (sc->sc_imo.imo_membership) + pfsync_multicast_cleanup(sc); + free(sc, M_PFSYNC); #else free(sc->sc_imo.imo_membership, M_IPMOPTS); -#endif free(sc, M_DEVBUF); +#endif #ifdef __FreeBSD__ V_pfsyncif = NULL; @@ -1886,12 +1858,15 @@ pfsyncioctl(struct ifnet *ifp, u_long cm sc->sc_sync_if = NULL; #ifdef __FreeBSD__ PF_UNLOCK(); -#endif + if (imo->imo_membership) + pfsync_multicast_cleanup(sc); +#else if (imo->imo_num_memberships > 0) { in_delmulti(imo->imo_membership[ --imo->imo_num_memberships]); imo->imo_multicast_ifp = NULL; } +#endif break; } @@ -1916,57 +1891,53 @@ pfsyncioctl(struct ifnet *ifp, u_long cm pfsync_sendout(); sc->sc_sync_if = sifp; - if (imo->imo_num_memberships > 0) { #ifdef __FreeBSD__ + if (imo->imo_membership) { PF_UNLOCK(); -#endif - in_delmulti(imo->imo_membership[--imo->imo_num_memberships]); -#ifdef __FreeBSD__ + pfsync_multicast_cleanup(sc); PF_LOCK(); -#endif + } +#else + if (imo->imo_num_memberships > 0) { + in_delmulti(imo->imo_membership[--imo->imo_num_memberships]); imo->imo_multicast_ifp = NULL; } +#endif - if (sc->sc_sync_if && #ifdef __FreeBSD__ + if (sc->sc_sync_if && sc->sc_sync_peer.s_addr == htonl(INADDR_PFSYNC_GROUP)) { + PF_UNLOCK(); + error = pfsync_multicast_setup(sc); + if (error) + return (error); + PF_LOCK(); + } #else + if (sc->sc_sync_if && sc->sc_sync_peer.s_addr == INADDR_PFSYNC_GROUP) { -#endif struct in_addr addr; if (!(sc->sc_sync_if->if_flags & IFF_MULTICAST)) { sc->sc_sync_if = NULL; -#ifdef __FreeBSD__ - PF_UNLOCK(); -#endif splx(s); return (EADDRNOTAVAIL); } -#ifdef __FreeBSD__ - addr.s_addr = htonl(INADDR_PFSYNC_GROUP); -#else addr.s_addr = INADDR_PFSYNC_GROUP; -#endif -#ifdef __FreeBSD__ - PF_UNLOCK(); -#endif if ((imo->imo_membership[0] = in_addmulti(&addr, sc->sc_sync_if)) == NULL) { sc->sc_sync_if = NULL; splx(s); return (ENOBUFS); } -#ifdef __FreeBSD__ - PF_LOCK(); -#endif imo->imo_num_memberships++; imo->imo_multicast_ifp = sc->sc_sync_if; imo->imo_multicast_ttl = PFSYNC_DFLTTL; imo->imo_multicast_loop = 0; } +#endif /* !__FreeBSD__ */ ip = &sc->sc_template; bzero(ip, sizeof(*ip)); @@ -2365,7 +2336,7 @@ pfsync_sendout(void) sc->sc_len = PFSYNC_MINPKT; IFQ_ENQUEUE(&sc->sc_ifp->if_snd, m, dummy_error); - schednetisr(NETISR_PFSYNC); + swi_sched(V_pfsync_swi_cookie, 0); #else sc->sc_if.if_opackets++; sc->sc_if.if_obytes += m->m_pkthdr.len; @@ -3342,54 +3313,91 @@ pfsync_sysctl(int *name, u_int namelen, } #ifdef __FreeBSD__ -void -pfsync_ifdetach(void *arg, struct ifnet *ifp) +static int +pfsync_multicast_setup(struct pfsync_softc *sc) { - struct pfsync_softc *sc = (struct pfsync_softc *)arg; - struct ip_moptions *imo; - - if (sc == NULL || sc->sc_sync_if != ifp) - return; /* not for us; unlocked read */ + struct ip_moptions *imo = &sc->sc_imo; + int error; - CURVNET_SET(sc->sc_ifp->if_vnet); + if (!(sc->sc_sync_if->if_flags & IFF_MULTICAST)) { + sc->sc_sync_if = NULL; + return (EADDRNOTAVAIL); + } - PF_LOCK(); + imo->imo_membership = (struct in_multi **)malloc( + (sizeof(struct in_multi *) * IP_MIN_MEMBERSHIPS), M_PFSYNC, + M_WAITOK | M_ZERO); + imo->imo_max_memberships = IP_MIN_MEMBERSHIPS; + imo->imo_multicast_vif = -1; - /* Deal with a member interface going away from under us. */ - sc->sc_sync_if = NULL; - imo = &sc->sc_imo; - if (imo->imo_num_memberships > 0) { - KASSERT(imo->imo_num_memberships == 1, - ("%s: imo_num_memberships != 1", __func__)); - /* - * Our event handler is always called after protocol - * domains have been detached from the underlying ifnet. - * Do not call in_delmulti(); we held a single reference - * which the protocol domain has purged in in_purgemaddrs(). - */ - PF_UNLOCK(); - imo->imo_membership[--imo->imo_num_memberships] = NULL; - PF_LOCK(); - imo->imo_multicast_ifp = NULL; - } + if ((error = in_joingroup(sc->sc_sync_if, &sc->sc_sync_peer, NULL, + &imo->imo_membership[0])) != 0) { + free(imo->imo_membership, M_PFSYNC); + return (error); + } + imo->imo_num_memberships++; + imo->imo_multicast_ifp = sc->sc_sync_if; + imo->imo_multicast_ttl = PFSYNC_DFLTTL; + imo->imo_multicast_loop = 0; - PF_UNLOCK(); - - CURVNET_RESTORE(); + return (0); } +static void +pfsync_multicast_cleanup(struct pfsync_softc *sc) +{ + struct ip_moptions *imo = &sc->sc_imo; + + in_leavegroup(imo->imo_membership[0], NULL); + free(imo->imo_membership, M_PFSYNC); + imo->imo_membership = NULL; + imo->imo_multicast_ifp = NULL; +} + +#ifdef INET +extern struct domain inetdomain; +static struct protosw in_pfsync_protosw = { + .pr_type = SOCK_RAW, + .pr_domain = &inetdomain, + .pr_protocol = IPPROTO_PFSYNC, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = pfsync_input, + .pr_output = (pr_output_t *)rip_output, + .pr_ctloutput = rip_ctloutput, + .pr_usrreqs = &rip_usrreqs +}; +#endif + static int -vnet_pfsync_init(const void *unused) +pfsync_init() { + VNET_ITERATOR_DECL(vnet_iter); int error = 0; - pfsyncattach(0); - - error = swi_add(NULL, "pfsync", pfsyncintr, V_pfsyncif, - SWI_NET, INTR_MPSAFE, &pfsync_swi.pfsync_swi_cookie); + VNET_LIST_RLOCK(); + VNET_FOREACH(vnet_iter) { + CURVNET_SET(vnet_iter); + V_pfsync_cloner = pfsync_cloner; + V_pfsync_cloner_data = pfsync_cloner_data; + V_pfsync_cloner.ifc_data = &V_pfsync_cloner_data; + if_clone_attach(&V_pfsync_cloner); + error = swi_add(NULL, "pfsync", pfsyncintr, V_pfsyncif, + SWI_NET, INTR_MPSAFE, &V_pfsync_swi_cookie); + CURVNET_RESTORE(); + if (error) + goto fail_locked; + } + VNET_LIST_RUNLOCK(); +#ifdef INET + error = pf_proto_register(PF_INET, &in_pfsync_protosw); if (error) - panic("%s: swi_add %d", __func__, error); - + goto fail; + error = ipproto_register(IPPROTO_PFSYNC); + if (error) { + pf_proto_unregister(PF_INET, IPPROTO_PFSYNC, SOCK_RAW); + goto fail; + } +#endif PF_LOCK(); pfsync_state_import_ptr = pfsync_state_import; pfsync_up_ptr = pfsync_up; @@ -3402,13 +3410,27 @@ vnet_pfsync_init(const void *unused) PF_UNLOCK(); return (0); + +fail: + VNET_LIST_RLOCK(); +fail_locked: + VNET_FOREACH(vnet_iter) { + CURVNET_SET(vnet_iter); + if (V_pfsync_swi_cookie) { + swi_remove(V_pfsync_swi_cookie); + if_clone_detach(&V_pfsync_cloner); + } + CURVNET_RESTORE(); + } + VNET_LIST_RUNLOCK(); + + return (error); } -static int -vnet_pfsync_uninit(const void *unused) +static void +pfsync_uninit() { - - swi_remove(pfsync_swi.pfsync_swi_cookie); + VNET_ITERATOR_DECL(vnet_iter); PF_LOCK(); pfsync_state_import_ptr = NULL; @@ -3421,30 +3443,18 @@ vnet_pfsync_uninit(const void *unused) pfsync_defer_ptr = NULL; PF_UNLOCK(); - if_clone_detach(&pfsync_cloner); - - return (0); + ipproto_unregister(IPPROTO_PFSYNC); + pf_proto_unregister(PF_INET, IPPROTO_PFSYNC, SOCK_RAW); + VNET_LIST_RLOCK(); + VNET_FOREACH(vnet_iter) { + CURVNET_SET(vnet_iter); + swi_remove(V_pfsync_swi_cookie); + if_clone_detach(&V_pfsync_cloner); + CURVNET_RESTORE(); + } + VNET_LIST_RUNLOCK(); } -/* Define startup order. */ -#define PFSYNC_SYSINIT_ORDER SI_SUB_PROTO_IF -#define PFSYNC_MODEVENT_ORDER (SI_ORDER_FIRST) /* On boot slot in here. */ -#define PFSYNC_VNET_ORDER (PFSYNC_MODEVENT_ORDER + 2) /* Later still. */ - -/* - * Starting up. - * VNET_SYSINIT is called for each existing vnet and each new vnet. - */ -VNET_SYSINIT(vnet_pfsync_init, PFSYNC_SYSINIT_ORDER, PFSYNC_VNET_ORDER, - vnet_pfsync_init, NULL); - -/* - * Closing up shop. These are done in REVERSE ORDER, - * Not called on reboot. - * VNET_SYSUNINIT is called for each exiting vnet as it exits. - */ -VNET_SYSUNINIT(vnet_pfsync_uninit, PFSYNC_SYSINIT_ORDER, PFSYNC_VNET_ORDER, - vnet_pfsync_uninit, NULL); static int pfsync_modevent(module_t mod, int type, void *data) { @@ -3452,21 +3462,23 @@ pfsync_modevent(module_t mod, int type, switch (type) { case MOD_LOAD: -#ifndef __FreeBSD__ - pfsyncattach(0); -#endif + error = pfsync_init(); + break; + case MOD_QUIESCE: + /* + * Module should not be unloaded due to race conditions. + */ + error = EPERM; break; case MOD_UNLOAD: -#ifndef __FreeBSD__ - if_clone_detach(&pfsync_cloner); -#endif + pfsync_uninit(); break; default: error = EINVAL; break; } - return error; + return (error); } static moduledata_t pfsync_mod = { @@ -3477,7 +3489,7 @@ static moduledata_t pfsync_mod = { #define PFSYNC_MODVER 1 -DECLARE_MODULE(pfsync, pfsync_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); +DECLARE_MODULE(pfsync, pfsync_mod, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY); MODULE_VERSION(pfsync, PFSYNC_MODVER); MODULE_DEPEND(pfsync, pf, PF_MODVER, PF_MODVER, PF_MODVER); #endif /* __FreeBSD__ */ Modified: head/sys/netinet/in_proto.c ============================================================================== --- head/sys/netinet/in_proto.c Mon Jan 9 08:36:12 2012 (r229849) +++ head/sys/netinet/in_proto.c Mon Jan 9 08:50:22 2012 (r229850) @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include "opt_ipsec.h" #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_pf.h" #include "opt_sctp.h" #include "opt_mpath.h" @@ -101,11 +100,6 @@ static struct pr_usrreqs nousrreqs; #include #endif /* SCTP */ -#ifdef DEV_PFSYNC -#include -#include -#endif - FEATURE(inet, "Internet Protocol version 4"); extern struct domain inetdomain; @@ -317,17 +311,6 @@ struct protosw inetsw[] = { .pr_ctloutput = rip_ctloutput, .pr_usrreqs = &rip_usrreqs }, -#ifdef DEV_PFSYNC -{ - .pr_type = SOCK_RAW, - .pr_domain = &inetdomain, - .pr_protocol = IPPROTO_PFSYNC, - .pr_flags = PR_ATOMIC|PR_ADDR, - .pr_input = pfsync_input, - .pr_ctloutput = rip_ctloutput, - .pr_usrreqs = &rip_usrreqs -}, -#endif /* DEV_PFSYNC */ /* Spacer n-times for loadable protocols. */ IPPROTOSPACER, IPPROTOSPACER, @@ -397,6 +380,3 @@ SYSCTL_NODE(_net_inet, IPPROTO_IPCOMP, i SYSCTL_NODE(_net_inet, IPPROTO_IPIP, ipip, CTLFLAG_RW, 0, "IPIP"); #endif /* IPSEC */ SYSCTL_NODE(_net_inet, IPPROTO_RAW, raw, CTLFLAG_RW, 0, "RAW"); -#ifdef DEV_PFSYNC -SYSCTL_NODE(_net_inet, IPPROTO_PFSYNC, pfsync, CTLFLAG_RW, 0, "PFSYNC"); -#endif From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 08:55:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 6C1E01065670; Mon, 9 Jan 2012 08:55:08 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 67AB614ED6F; Mon, 9 Jan 2012 08:55:07 +0000 (UTC) Message-ID: <4F0AAB6A.7090606@FreeBSD.org> Date: Mon, 09 Jan 2012 00:55:06 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: Konstantin Belousov References: <201201082306.q08N6rDQ011768@svn.freebsd.org> In-Reply-To: <201201082306.q08N6rDQ011768@svn.freebsd.org> X-Enigmail-Version: undefined 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: r229828 - in head/sys: kern ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 08:55:08 -0000 On 01/08/2012 15:06, Konstantin Belousov wrote: > Author: kib > Date: Sun Jan 8 23:06:53 2012 > New Revision: 229828 > URL: http://svn.freebsd.org/changeset/base/229828 > > Log: > Avoid LOR between vfs_busy() lock and covered vnode lock on quotaon(). Does this mean that if we turn witness back on the ever-present VFS LORs will no longer be there, or does this only affect calls to quotaon()? Doug -- You can observe a lot just by watching. -- Yogi Berra Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 08:55:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A2C11065678; Mon, 9 Jan 2012 08:55:24 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F39F8FC1E; Mon, 9 Jan 2012 08:55: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 q098tNPB031685; Mon, 9 Jan 2012 08:55:23 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q098tNhk031681; Mon, 9 Jan 2012 08:55:23 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201090855.q098tNhk031681@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 9 Jan 2012 08:55: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: r229851 - head/sys/contrib/pf/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 08:55:24 -0000 Author: glebius Date: Mon Jan 9 08:55:23 2012 New Revision: 229851 URL: http://svn.freebsd.org/changeset/base/229851 Log: In FreeBSD we determine presence of pfsync(4) at run-time, not at compile time, so define NPFSYNC to 1 always. While here, remove unused defines. Modified: head/sys/contrib/pf/net/if_pfsync.c head/sys/contrib/pf/net/pf.c head/sys/contrib/pf/net/pf_ioctl.c Modified: head/sys/contrib/pf/net/if_pfsync.c ============================================================================== --- head/sys/contrib/pf/net/if_pfsync.c Mon Jan 9 08:50:22 2012 (r229850) +++ head/sys/contrib/pf/net/if_pfsync.c Mon Jan 9 08:55:23 2012 (r229851) @@ -59,12 +59,6 @@ __FBSDID("$FreeBSD$"); #define NBPFILTER 1 - -#ifdef DEV_PFSYNC -#define NPFSYNC DEV_PFSYNC -#else -#define NPFSYNC 0 -#endif #endif /* __FreeBSD__ */ #include Modified: head/sys/contrib/pf/net/pf.c ============================================================================== --- head/sys/contrib/pf/net/pf.c Mon Jan 9 08:50:22 2012 (r229850) +++ head/sys/contrib/pf/net/pf.c Mon Jan 9 08:55:23 2012 (r229851) @@ -47,23 +47,7 @@ __FBSDID("$FreeBSD$"); #include "opt_bpf.h" #include "opt_pf.h" -#ifdef DEV_BPF -#define NBPFILTER DEV_BPF -#else -#define NBPFILTER 0 -#endif - -#ifdef DEV_PFLOG -#define NPFLOG DEV_PFLOG -#else -#define NPFLOG 0 -#endif - -#ifdef DEV_PFSYNC -#define NPFSYNC DEV_PFSYNC -#else -#define NPFSYNC 0 -#endif +#define NPFSYNC 1 #ifdef DEV_PFLOW #define NPFLOW DEV_PFLOW Modified: head/sys/contrib/pf/net/pf_ioctl.c ============================================================================== --- head/sys/contrib/pf/net/pf_ioctl.c Mon Jan 9 08:50:22 2012 (r229850) +++ head/sys/contrib/pf/net/pf_ioctl.c Mon Jan 9 08:55:23 2012 (r229851) @@ -44,11 +44,7 @@ __FBSDID("$FreeBSD$"); #include "opt_bpf.h" #include "opt_pf.h" -#ifdef DEV_BPF -#define NBPFILTER DEV_BPF -#else -#define NBPFILTER 0 -#endif +#define NPFSYNC 1 #ifdef DEV_PFLOG #define NPFLOG DEV_PFLOG @@ -56,16 +52,10 @@ __FBSDID("$FreeBSD$"); #define NPFLOG 0 #endif -#ifdef DEV_PFSYNC -#define NPFSYNC DEV_PFSYNC -#else -#define NPFSYNC 0 -#endif - -#else +#else /* !__FreeBSD__ */ #include "pfsync.h" #include "pflog.h" -#endif +#endif /* __FreeBSD__ */ #include #include From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 09:19:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C7C1106564A; Mon, 9 Jan 2012 09:19:01 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B68D8FC17; Mon, 9 Jan 2012 09:19:01 +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 q099J1hG032432; Mon, 9 Jan 2012 09:19:01 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q099J119032429; Mon, 9 Jan 2012 09:19:01 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201090919.q099J119032429@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 9 Jan 2012 09:19: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: r229852 - head/sys/contrib/pf/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 09:19:01 -0000 Author: glebius Date: Mon Jan 9 09:19:00 2012 New Revision: 229852 URL: http://svn.freebsd.org/changeset/base/229852 Log: Revert sub argument of MODULE_DECLARE back to r226532. Noticed by: bz Modified: head/sys/contrib/pf/net/if_pfsync.c head/sys/contrib/pf/net/pf_ioctl.c Modified: head/sys/contrib/pf/net/if_pfsync.c ============================================================================== --- head/sys/contrib/pf/net/if_pfsync.c Mon Jan 9 08:55:23 2012 (r229851) +++ head/sys/contrib/pf/net/if_pfsync.c Mon Jan 9 09:19:00 2012 (r229852) @@ -3483,7 +3483,7 @@ static moduledata_t pfsync_mod = { #define PFSYNC_MODVER 1 -DECLARE_MODULE(pfsync, pfsync_mod, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY); +DECLARE_MODULE(pfsync, pfsync_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); MODULE_VERSION(pfsync, PFSYNC_MODVER); MODULE_DEPEND(pfsync, pf, PF_MODVER, PF_MODVER, PF_MODVER); #endif /* __FreeBSD__ */ Modified: head/sys/contrib/pf/net/pf_ioctl.c ============================================================================== --- head/sys/contrib/pf/net/pf_ioctl.c Mon Jan 9 08:55:23 2012 (r229851) +++ head/sys/contrib/pf/net/pf_ioctl.c Mon Jan 9 09:19:00 2012 (r229852) @@ -4413,6 +4413,6 @@ static moduledata_t pf_mod = { 0 }; -DECLARE_MODULE(pf, pf_mod, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_FIRST); +DECLARE_MODULE(pf, pf_mod, SI_SUB_PSEUDO, SI_ORDER_FIRST); MODULE_VERSION(pf, PF_MODVER); #endif /* __FreeBSD__ */ From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 12:06:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2189C106566C; Mon, 9 Jan 2012 12:06:03 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 104C08FC22; Mon, 9 Jan 2012 12:06:03 +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 q09C62OF040201; Mon, 9 Jan 2012 12:06:02 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q09C626P040199; Mon, 9 Jan 2012 12:06:02 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201091206.q09C626P040199@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 9 Jan 2012 12:06:02 +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: r229853 - head/sys/contrib/pf/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 12:06:03 -0000 Author: glebius Date: Mon Jan 9 12:06:02 2012 New Revision: 229853 URL: http://svn.freebsd.org/changeset/base/229853 Log: Backout of backout: we need SI_SUB_PROTO_DOMAIN for pfsync, since it needs existing inetdomain on startup. Modified: head/sys/contrib/pf/net/if_pfsync.c Modified: head/sys/contrib/pf/net/if_pfsync.c ============================================================================== --- head/sys/contrib/pf/net/if_pfsync.c Mon Jan 9 09:19:00 2012 (r229852) +++ head/sys/contrib/pf/net/if_pfsync.c Mon Jan 9 12:06:02 2012 (r229853) @@ -3483,7 +3483,7 @@ static moduledata_t pfsync_mod = { #define PFSYNC_MODVER 1 -DECLARE_MODULE(pfsync, pfsync_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); +DECLARE_MODULE(pfsync, pfsync_mod, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY); MODULE_VERSION(pfsync, PFSYNC_MODVER); MODULE_DEPEND(pfsync, pf, PF_MODVER, PF_MODVER, PF_MODVER); #endif /* __FreeBSD__ */ From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 12:06:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2543E1065672; Mon, 9 Jan 2012 12:06:10 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 11F548FC19; Mon, 9 Jan 2012 12:06: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 q09C69bR040242; Mon, 9 Jan 2012 12:06:09 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q09C694n040239; Mon, 9 Jan 2012 12:06:09 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201201091206.q09C694n040239@svn.freebsd.org> From: Andriy Gapon Date: Mon, 9 Jan 2012 12:06:09 +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: r229854 - in head: . sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 12:06:11 -0000 Author: avg Date: Mon Jan 9 12:06:09 2012 New Revision: 229854 URL: http://svn.freebsd.org/changeset/base/229854 Log: enable stop_scheduler_on_panic by default My plan is to make this behavior unconditional before 10.0 release. X-MFC after: r228424 (if ever) Modified: head/UPDATING head/sys/kern/kern_shutdown.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Jan 9 12:06:02 2012 (r229853) +++ head/UPDATING Mon Jan 9 12:06:09 2012 (r229854) @@ -22,6 +22,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 machines to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20120109: + panic(9) now stops other CPUs in the SMP systems, disables interrupts + on the current CPU and prevents other threads from running. + This behavior can be reverted using the kern.stop_scheduler_on_panic + tunable/sysctl. + The new behavior can be incompatible with kern.sync_on_panic. + 20111215: The carp(4) facility has been changed significantly. Configuration of the CARP protocol via ifconfig(8) has changed, as well as format Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Mon Jan 9 12:06:02 2012 (r229853) +++ head/sys/kern/kern_shutdown.c Mon Jan 9 12:06:09 2012 (r229854) @@ -123,7 +123,7 @@ SYSCTL_INT(_kern, OID_AUTO, sync_on_pani &sync_on_panic, 0, "Do a sync before rebooting from a panic"); TUNABLE_INT("kern.sync_on_panic", &sync_on_panic); -static int stop_scheduler_on_panic = 0; +static int stop_scheduler_on_panic = 1; SYSCTL_INT(_kern, OID_AUTO, stop_scheduler_on_panic, CTLFLAG_RW | CTLFLAG_TUN, &stop_scheduler_on_panic, 0, "stop scheduler upon entering panic"); TUNABLE_INT("kern.stop_scheduler_on_panic", &stop_scheduler_on_panic); From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 12:38:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 704BB106564A; Mon, 9 Jan 2012 12:38:50 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id DCF638FC0C; Mon, 9 Jan 2012 12:38:49 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q09Cckxu099987 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 9 Jan 2012 14:38:46 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q09CckrS052422; Mon, 9 Jan 2012 14:38:46 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q09Ccksp052421; Mon, 9 Jan 2012 14:38:46 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 9 Jan 2012 14:38:46 +0200 From: Kostik Belousov To: Doug Barton Message-ID: <20120109123846.GT31224@deviant.kiev.zoral.com.ua> References: <201201082306.q08N6rDQ011768@svn.freebsd.org> <4F0AAB6A.7090606@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gSsRJZU0nGhQbl8n" Content-Disposition: inline In-Reply-To: <4F0AAB6A.7090606@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r229828 - in head/sys: kern ufs/ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 12:38:50 -0000 --gSsRJZU0nGhQbl8n Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 09, 2012 at 12:55:06AM -0800, Doug Barton wrote: > On 01/08/2012 15:06, Konstantin Belousov wrote: > > Author: kib > > Date: Sun Jan 8 23:06:53 2012 > > New Revision: 229828 > > URL: http://svn.freebsd.org/changeset/base/229828 > >=20 > > Log: > > Avoid LOR between vfs_busy() lock and covered vnode lock on quotaon(). >=20 > Does this mean that if we turn witness back on the ever-present VFS LORs > will no longer be there, or does this only affect calls to quotaon()? vfs_busy() lock is not accounted for by witness, so there shall be no changes in the witness reports. The scenario affected only fired when somebody did quotaon and unmount proceeded in parallel. --gSsRJZU0nGhQbl8n Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk8K39UACgkQC3+MBN1Mb4ij5QCgiG3wzONl8f8nHSJx2LSqxNY5 J/UAnjbomgJFbyIjepMso9xOzo1qpm1h =4q9E -----END PGP SIGNATURE----- --gSsRJZU0nGhQbl8n-- From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 12:49:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 763E8106566C; Mon, 9 Jan 2012 12:49:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 339B28FC0C; Mon, 9 Jan 2012 12:49:58 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:d01c:cec7:e367:727] (unknown [IPv6:2001:7b8:3a7:0:d01c:cec7:e367:727]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 1756A5C37; Mon, 9 Jan 2012 13:49:57 +0100 (CET) Message-ID: <4F0AE274.8010907@FreeBSD.org> Date: Mon, 09 Jan 2012 13:49:56 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0) Gecko/20120106 Thunderbird/10.0 MIME-Version: 1.0 To: Sergey Kandaurov References: <201112300624.pBU6OxO9098906@svn.freebsd.org> <4F08A518.8090207@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Devin Teske Subject: Re: svn commit: r228985 - head/sys/boot/forth X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 12:49:58 -0000 On 2012-01-08 21:35, Sergey Kandaurov wrote: ... > So, the problem arise when beastie_disable is set. > > In this case menu.rc is not evaluated and consequently menu-unset does > not have a body yet. This results in the ficl warning "not found" when > try-menu-unset calls menu-unset. The warning cannot be handled with catch > as seen with the code in head. > Otherwise, when beastie is enabled, all works as it should. > > To "fix" the problem I replaced 'catch' with 'sfind', so that we can > conditionally call menu-unset only when the definition is present. > > Please try the following patch. I tested it with enabled/disabled beastie > and loader_color over serial console. I would also like to get a review > from Devin Teske to see if this change is acceptable. Yes, this patch makes the warning disappear. Thanks! From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 13:35:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E15671065675; Mon, 9 Jan 2012 13:35:10 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF63C8FC1D; Mon, 9 Jan 2012 13: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 q09DZATh043013; Mon, 9 Jan 2012 13:35:10 GMT (envelope-from ivoras@svn.freebsd.org) Received: (from ivoras@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q09DZAuZ043011; Mon, 9 Jan 2012 13:35:10 GMT (envelope-from ivoras@svn.freebsd.org) Message-Id: <201201091335.q09DZAuZ043011@svn.freebsd.org> From: Ivan Voras Date: Mon, 9 Jan 2012 13:35:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229855 - stable/9/sys/fs/tmpfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 13:35:11 -0000 Author: ivoras Date: Mon Jan 9 13:35:10 2012 New Revision: 229855 URL: http://svn.freebsd.org/changeset/base/229855 Log: MFC r227822: Avoid panics from recursive rename operations. PR: kern/159418 Modified: stable/9/sys/fs/tmpfs/tmpfs_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- stable/9/sys/fs/tmpfs/tmpfs_vnops.c Mon Jan 9 12:06:09 2012 (r229854) +++ stable/9/sys/fs/tmpfs/tmpfs_vnops.c Mon Jan 9 13:35:10 2012 (r229855) @@ -965,11 +965,8 @@ tmpfs_rename(struct vop_rename_args *v) /* If we need to move the directory between entries, lock the * source so that we can safely operate on it. */ - if (tdvp != fdvp) { - error = vn_lock(fdvp, LK_EXCLUSIVE | LK_RETRY); - if (error != 0) - goto out; - } + if (fdvp != tdvp && fdvp != tvp) + vn_lock(fdvp, LK_EXCLUSIVE | LK_RETRY); fdnode = VP_TO_TMPFS_DIR(fdvp); fnode = VP_TO_TMPFS_NODE(fvp); de = tmpfs_dir_lookup(fdnode, fnode, fcnp); @@ -1143,7 +1140,7 @@ tmpfs_rename(struct vop_rename_args *v) error = 0; out_locked: - if (fdnode != tdnode) + if (fdvp != tdvp && fdvp != tvp) VOP_UNLOCK(fdvp, 0); out: From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 13:48:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DEED106564A; Mon, 9 Jan 2012 13:48:28 +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 234CE8FC17; Mon, 9 Jan 2012 13:48:28 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id D05B646B09; Mon, 9 Jan 2012 08:48:27 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 3D61EB993; Mon, 9 Jan 2012 08:48:27 -0500 (EST) From: John Baldwin To: Hans Petter Selasky Date: Mon, 9 Jan 2012 08:10:48 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201201062254.q06Ms3jf012102@svn.freebsd.org> In-Reply-To: <201201062254.q06Ms3jf012102@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201201090810.48587.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 09 Jan 2012 08:48:27 -0500 (EST) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r229741 - stable/8/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 13:48:28 -0000 On Friday, January 06, 2012 5:54:03 pm Hans Petter Selasky wrote: > Author: hselasky > Date: Fri Jan 6 22:54:03 2012 > New Revision: 229741 > URL: http://svn.freebsd.org/changeset/base/229741 > > Log: > Fix build of ehci_mbus.c by applying patches similar > to ones in r228483. This file was missed by a recent > MFC because the file is named differently in 10-current. > > Pointy hat: hselasky @ > Reported by: jhb Thanks for fixing this! It would be nice if the tinderbox would build the same set of things as 'make universe' so that this sort of thing could be caught earlier. Specifically, on embededded targets there isn't really a LINT. Instead, one has to build the various kernel configs for different systems. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 13:48:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCE061065672; Mon, 9 Jan 2012 13:48:28 +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 A25378FC18; Mon, 9 Jan 2012 13:48:28 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 5B42846B5C; Mon, 9 Jan 2012 08:48:28 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id C526FB99B; Mon, 9 Jan 2012 08:48:27 -0500 (EST) From: John Baldwin To: Pawel Jakub Dawidek Date: Mon, 9 Jan 2012 08:15:44 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201201080055.q080tMlJ063808@svn.freebsd.org> <20120108104330.GC1674@garage.freebsd.pl> In-Reply-To: <20120108104330.GC1674@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201201090815.44495.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 09 Jan 2012 08:48:27 -0500 (EST) Cc: svn-src-head@freebsd.org, Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r229800 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 13:48:28 -0000 On Sunday, January 08, 2012 5:43:30 am Pawel Jakub Dawidek wrote: > On Sun, Jan 08, 2012 at 12:55:22AM +0000, Adrian Chadd wrote: > > Author: adrian > > Date: Sun Jan 8 00:55:22 2012 > > New Revision: 229800 > > URL: http://svn.freebsd.org/changeset/base/229800 > > > > Log: > > Make these two files conditionally build on UFS_ACL, as it doesn't > > seem to be used elsewhere. > > > > Since UFS_ACL is enabled by default for GENERIC kernels, this shouldn't > > break anything - but please beat me to fix things if it does. > > If someone is actually using GENERIC kernel. This change will break all > my system next time I upgrade. Adding UFS_ACL option to the kernel > config to make ZFS kernel module to work doesn't sound very intuitive. > > I understand what you are trying to accomplish, but we really need to > find better way to do this. Until then, could you back it out? Why not make 'options ZFS' work? Then you can have subr_acl_nfs.c depend on ZFS as well. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 13:58:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17A8C106566B; Mon, 9 Jan 2012 13:58:17 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id A49A98FC08; Mon, 9 Jan 2012 13:58:16 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id 1D54586D; Mon, 9 Jan 2012 14:58:15 +0100 (CET) Date: Mon, 9 Jan 2012 14:57:06 +0100 From: Pawel Jakub Dawidek To: John Baldwin Message-ID: <20120109135706.GE4117@garage.freebsd.pl> References: <201201080055.q080tMlJ063808@svn.freebsd.org> <20120108104330.GC1674@garage.freebsd.pl> <201201090815.44495.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="DqhR8hV3EnoxUkKN" Content-Disposition: inline In-Reply-To: <201201090815.44495.jhb@freebsd.org> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Adrian Chadd , src-committers@freebsd.org, kmacy@FreeBSD.org Subject: Re: svn commit: r229800 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 13:58:17 -0000 --DqhR8hV3EnoxUkKN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 09, 2012 at 08:15:44AM -0500, John Baldwin wrote: > On Sunday, January 08, 2012 5:43:30 am Pawel Jakub Dawidek wrote: > > On Sun, Jan 08, 2012 at 12:55:22AM +0000, Adrian Chadd wrote: > > > Author: adrian > > > Date: Sun Jan 8 00:55:22 2012 > > > New Revision: 229800 > > > URL: http://svn.freebsd.org/changeset/base/229800 > > >=20 > > > Log: > > > Make these two files conditionally build on UFS_ACL, as it doesn't > > > seem to be used elsewhere. > > > =20 > > > Since UFS_ACL is enabled by default for GENERIC kernels, this shoul= dn't > > > break anything - but please beat me to fix things if it does. > >=20 > > If someone is actually using GENERIC kernel. This change will break all > > my system next time I upgrade. Adding UFS_ACL option to the kernel > > config to make ZFS kernel module to work doesn't sound very intuitive. > >=20 > > I understand what you are trying to accomplish, but we really need to > > find better way to do this. Until then, could you back it out? >=20 > Why not make 'options ZFS' work? Then you can have subr_acl_nfs.c depend= on > ZFS as well. At the time I looked at it, it was very hard (at least for me) to make it work. Note that initial import of ZFS was delayed, because of this very reason. Then des@ convinced me to go ahead with module-only solution. The problem with having ZFS compiled into the kernel is that OpenSolaris compatiblity layer needs its headers to be included before system headers, which is/was impossible or hard to express for kernel compilation. AFAIR Kip Macy was working on it and my understanding was that he finished it or almost finished it (CCed). I'm all for making ZFS be compilable as part of the kernel itself, but it is really very low on my list, because ZFS simply works now and also because as I said, it was far from trivial for me to do it. If someone who is more familiar with the bits responsible for kernel compilation wants to work on including ZFS there, I'll gladly provide help from the ZFS side. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --DqhR8hV3EnoxUkKN Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk8K8jIACgkQForvXbEpPzS+xQCdHONluQeEW7xhqhyUC3oE4+C9 pgcAoKmoV5lYXLTdjk51BApPCp8GkldE =e9Y2 -----END PGP SIGNATURE----- --DqhR8hV3EnoxUkKN-- From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 14:23:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F020106568A; Mon, 9 Jan 2012 14:23:19 +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 2CA338FC12; Mon, 9 Jan 2012 14:23:19 +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 q09ENJRB044506; Mon, 9 Jan 2012 14:23:19 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q09ENIst044504; Mon, 9 Jan 2012 14:23:18 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201201091423.q09ENIst044504@svn.freebsd.org> From: Hiroki Sato Date: Mon, 9 Jan 2012 14:23:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229856 - stable/9/release/doc/en_US.ISO8859-1/relnotes X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 14:23:19 -0000 Author: hrs Date: Mon Jan 9 14:23:18 2012 New Revision: 229856 URL: http://svn.freebsd.org/changeset/base/229856 Log: cc(4) and cc(9) were renamed to mod_cc(4) and mod_cc(9). Spotted by: lstewart Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Mon Jan 9 13:35:10 2012 (r229855) +++ stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Mon Jan 9 14:23:18 2012 (r229856) @@ -695,7 +695,7 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile interface being specified. - &os; TCP/IP network stack now supports &man.cc.9; pluggable + &os; TCP/IP network stack now supports &man.mod.cc.9; pluggable congestion control framework. This allows TCP congestion control algorithms to be implemented as dynamically loadable kernel modules. The following kernel modules are available @@ -710,7 +710,7 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile net.inet.tcp.cc.available, and newreno is set at boot time. For more - detail, see &man.cc.4; and &man.cc.9; manual pages. + detail, see &man.mod.cc.4; and &man.mod.cc.9; manual pages. A new &man.tcp.4; socket option TCP_CONGESTION has been added. This From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 14:24:16 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6CD6A106564A; Mon, 9 Jan 2012 14:24:16 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper-int.allbsd.org [IPv6:2001:2f0:104:e002::2]) by mx1.freebsd.org (Postfix) with ESMTP id 6F2908FC13; Mon, 9 Jan 2012 14:24:15 +0000 (UTC) Received: from alph.allbsd.org ([IPv6:2001:2f0:104:e010:862b:2bff:febc:8956]) (authenticated bits=128) by mail.allbsd.org (8.14.4/8.14.4) with ESMTP id q09EO2s7067296; Mon, 9 Jan 2012 23:24:13 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.allbsd.org (8.14.4/8.14.4) with ESMTP id q09EO1Rf096395; Mon, 9 Jan 2012 23:24:02 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Mon, 09 Jan 2012 23:23:57 +0900 (JST) Message-Id: <20120109.232357.1794504973706882769.hrs@allbsd.org> To: lstewart@FreeBSD.org From: Hiroki Sato In-Reply-To: <4F0A1EF1.8090003@freebsd.org> References: <201201081354.q08Ds9GQ093105@svn.freebsd.org> <4F0A1EF1.8090003@freebsd.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.3.51 on Emacs 23.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Mon_Jan__9_23_23_57_2012_708)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (mail.allbsd.org [IPv6:2001:2f0:104:e001::32]); Mon, 09 Jan 2012 23:24:14 +0900 (JST) X-Spam-Status: No, score=-104.6 required=13.0 tests=BAYES_00, CONTENT_TYPE_PRESENT, RDNS_NONE, SPF_SOFTFAIL, USER_IN_WHITELIST autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on gatekeeper.allbsd.org Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-9@FreeBSD.org Subject: Re: svn commit: r229812 - stable/9/release/doc/en_US.ISO8859-1/relnotes X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 14:24:16 -0000 ----Security_Multipart(Mon_Jan__9_23_23_57_2012_708)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lawrence Stewart wrote in <4F0A1EF1.8090003@freebsd.org>: ls> Hi Hiroki-san, ls> ls> On 01/09/12 00:54, Hiroki Sato wrote: ls> > Author: hrs ls> > Date: Sun Jan 8 13:54:08 2012 ls> > New Revision: 229812 ls> > URL: http://svn.freebsd.org/changeset/base/229812 ls> > ls> > Log: ls> > Add relnotes items: ls> > igb(4) Intel I350 GbE support, ls> > re(4) TX IP checksum disabled on RTL8168C-based cards, ls> > cc(9) TCP congestion control algorithm framework added, ls> > gpart(8) various aliases and bios-boot GUID added, ls> > FFS SU+J added, ls> > more kern.features.* for UFS-related features, ls> > hastd(8) drops root privilege in worker processes, ls> > newsyslog(8) xz compression support added, ls> > ppp(8) iface name and iface description commands added, ls> > sh(1) arithmetic expression handling updated, ls> > ISC BIND to 9.8.1-P1, and ls> > tzdata2011a. ls> > ls> > Modified: ls> > stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml ls> > ls> > Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml ls> > ============================================================================== ls> ls> [snip] ls> ls> cc(4) and cc(9) were renamed to mod_cc(4) and mod_cc(9) in r225583 to ls> avoid overlap with the cc(1) GCC man page. Would you mind correcting ls> the references in the entry below? Fixed, thanks! -- Hiroki ----Security_Multipart(Mon_Jan__9_23_23_57_2012_708)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAk8K+H0ACgkQTyzT2CeTzy2YQQCg0RINgJzAITItpJuZTj6gtimh ETwAn1hShhPUGTFk0kbj64tr/u3GT4e3 =7iNt -----END PGP SIGNATURE----- ----Security_Multipart(Mon_Jan__9_23_23_57_2012_708)---- From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 14:35:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FE6D1065673; Mon, 9 Jan 2012 14:35:06 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 089198FC14; Mon, 9 Jan 2012 14:35: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 q09EZ5uP044898; Mon, 9 Jan 2012 14:35:05 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q09EZ54v044897; Mon, 9 Jan 2012 14:35:05 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201091435.q09EZ54v044897@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 9 Jan 2012 14:35: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: r229857 - head/sys/contrib/pf/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 14:35:06 -0000 Author: glebius Date: Mon Jan 9 14:35:05 2012 New Revision: 229857 URL: http://svn.freebsd.org/changeset/base/229857 Log: Can't pass MSIZE to m_cljget(), an mbuf can't be attached as external storage to another mbuf. Modified: head/sys/contrib/pf/net/if_pfsync.c Modified: head/sys/contrib/pf/net/if_pfsync.c ============================================================================== --- head/sys/contrib/pf/net/if_pfsync.c Mon Jan 9 14:23:18 2012 (r229856) +++ head/sys/contrib/pf/net/if_pfsync.c Mon Jan 9 14:35:05 2012 (r229857) @@ -2163,8 +2163,7 @@ pfsync_sendout(void) if (pktlen > MHLEN) { /* Find the right pool to allocate from. */ /* XXX: This is ugly. */ - m_cljget(m, M_DONTWAIT, pktlen <= MSIZE ? MSIZE : - pktlen <= MCLBYTES ? MCLBYTES : + m_cljget(m, M_DONTWAIT, pktlen <= MCLBYTES ? MCLBYTES : #if MJUMPAGESIZE != MCLBYTES pktlen <= MJUMPAGESIZE ? MJUMPAGESIZE : #endif From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 14:43:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CB02106566B; Mon, 9 Jan 2012 14:43:45 +0000 (UTC) (envelope-from kmacybsd@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 57ACA8FC0A; Mon, 9 Jan 2012 14:43:44 +0000 (UTC) Received: by pbcc3 with SMTP id c3so2993322pbc.13 for ; Mon, 09 Jan 2012 06:43:44 -0800 (PST) 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=kTAEh6/G1nKvv5U2XfKkR57zwaILevHH5ifksM+6Aqs=; b=hQdfiLErp3VIsfa5QbxbrY5h3/0RX0VCPXkf6zdKTh0o/RSmc6BI1IfxFt6Lbp82xE gF73Mn+5Ntf+W8+gkQst1Hzu28OO9mDghl7uVgT/NbedYAKE7fUmhSRHzYlGd3UB5KnG 6WDrT7adkuqgxWVa+RKj12YuaLXzyBfroTvpM= MIME-Version: 1.0 Received: by 10.68.73.69 with SMTP id j5mr42822354pbv.11.1326118561140; Mon, 09 Jan 2012 06:16:01 -0800 (PST) Sender: kmacybsd@gmail.com Received: by 10.68.42.73 with HTTP; Mon, 9 Jan 2012 06:16:01 -0800 (PST) In-Reply-To: <20120109135706.GE4117@garage.freebsd.pl> References: <201201080055.q080tMlJ063808@svn.freebsd.org> <20120108104330.GC1674@garage.freebsd.pl> <201201090815.44495.jhb@freebsd.org> <20120109135706.GE4117@garage.freebsd.pl> Date: Mon, 9 Jan 2012 15:16:01 +0100 X-Google-Sender-Auth: 0-uvFW236a5k5smlN5PLLd21_RA Message-ID: From: "K. Macy" To: Pawel Jakub Dawidek Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org, John Baldwin Subject: Re: svn commit: r229800 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 14:43:45 -0000 > > The problem with having ZFS compiled into the kernel is that OpenSolaris > compatiblity layer needs its headers to be included before system > headers, which is/was impossible or hard to express for kernel > compilation. AFAIR Kip Macy was working on it and my understanding was > that he finished it or almost finished it (CCed). I did indeed make it work. The (only) reason I didn't check it in was because there were some collisions between freebsd's older zlib which ppp depends on and the one in the solaris layer. Both bz and I were kind of busy at the time. > I'm all for making ZFS be compilable as part of the kernel itself, but > it is really very low on my list, because ZFS simply works now and also > because as I said, it was far from trivial for me to do it. > If someone who is more familiar with the bits responsible for kernel > compilation wants to work on including ZFS there, I'll gladly provide > help from the ZFS side. I think this can be done without much work, (re)work out the dependencies. Cheers From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 15:38:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 132B1106566B; Mon, 9 Jan 2012 15:38:55 +0000 (UTC) (envelope-from Devin.Teske@fisglobal.com) Received: from mx1.fisglobal.com (mx1.fisglobal.com [199.200.24.190]) by mx1.freebsd.org (Postfix) with ESMTP id C7A0E8FC14; Mon, 9 Jan 2012 15:38:54 +0000 (UTC) Received: from pps.filterd (ltcfislmsgpa03 [127.0.0.1]) by ltcfislmsgpa03.fnfis.com (8.14.4/8.14.4) with SMTP id q09FQerV027481; Mon, 9 Jan 2012 09:38:53 -0600 Received: from smtp.fisglobal.com ([10.132.206.16]) by ltcfislmsgpa03.fnfis.com with ESMTP id 1282hgr562-1 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Mon, 09 Jan 2012 09:38:53 -0600 Received: from [10.0.0.105] (10.14.152.28) by smtp.fisglobal.com (10.132.206.16) with Microsoft SMTP Server (TLS) id 14.1.323.3; Mon, 9 Jan 2012 09:38:50 -0600 References: <201112300624.pBU6OxO9098906@svn.freebsd.org> <4F08A518.8090207@FreeBSD.org> <4F0AE274.8010907@FreeBSD.org> In-Reply-To: <4F0AE274.8010907@FreeBSD.org> MIME-Version: 1.0 (iPhone Mail 8C148) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" Message-ID: X-Mailer: iPhone Mail (8C148) From: Devin Teske Date: Mon, 9 Jan 2012 07:38:39 -0800 To: Dimitry Andric X-Originating-IP: [10.14.152.28] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.5.7110, 1.0.211, 0.0.0000 definitions=2012-01-09_03:2012-01-09, 2012-01-09, 1970-01-01 signatures=0 Cc: "" , "" , Sergey Kandaurov , "" Subject: * Re: svn commit: r228985 - head/sys/boot/forth X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 15:38:55 -0000 On Jan 9, 2012, at 4:49 AM, Dimitry Andric wrote: > On 2012-01-08 21:35, Sergey Kandaurov wrote: > ... >> So, the problem arise when beastie_disable is set. >>=20 >> In this case menu.rc is not evaluated and consequently menu-unset does >> not have a body yet. This results in the ficl warning "not found" when >> try-menu-unset calls menu-unset. The warning cannot be handled with catch >> as seen with the code in head. >> Otherwise, when beastie is enabled, all works as it should. >>=20 >> To "fix" the problem I replaced 'catch' with 'sfind', so that we can >> conditionally call menu-unset only when the definition is present. >>=20 >> Please try the following patch. I tested it with enabled/disabled beastie >> and loader_color over serial console. I would also like to get a review >> from Devin Teske to see if this change is acceptable. >=20 > Yes, this patch makes the warning disappear. Thanks! Please also see additional notes in PR kern/163938 (additional patching to = same file for same problem). --=20 Devin _____________ The information contained in this message is proprietary and/or confidentia= l. If you are not the intended recipient, please: (i) delete the message an= d all copies; (ii) do not disclose, distribute or use the message in any ma= nner; and (iii) notify the sender immediately. In addition, please be aware= that any message addressed to our domain is subject to archiving and revie= w by persons other than the intended recipient. Thank you. From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 15:56:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62D67106566B; Mon, 9 Jan 2012 15:56:34 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 506138FC17; Mon, 9 Jan 2012 15:56: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 q09FuYxw047444; Mon, 9 Jan 2012 15:56:34 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q09FuYND047440; Mon, 9 Jan 2012 15:56:34 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201201091556.q09FuYND047440@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 9 Jan 2012 15:56:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229858 - in stable/9: . share/man/man4 sys/dev/acpi_support X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 15:56:34 -0000 Author: jh Date: Mon Jan 9 15:56:33 2012 New Revision: 229858 URL: http://svn.freebsd.org/changeset/base/229858 Log: MFC r227823, r228163: Append unit number to the WMI status device name to allow attaching multiple acpi_wmi(4) instances. PR: kern/162491 Modified: stable/9/UPDATING (contents, props changed) stable/9/share/man/man4/acpi_wmi.4 stable/9/sys/dev/acpi_support/acpi_wmi.c Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/UPDATING ============================================================================== --- stable/9/UPDATING Mon Jan 9 14:35:05 2012 (r229857) +++ stable/9/UPDATING Mon Jan 9 15:56:33 2012 (r229858) @@ -9,6 +9,10 @@ handbook. Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20120109: + The acpi_wmi(4) status device /dev/wmistat has been renamed to + /dev/wmistat0. + 20120106: A new VOP_ADVISE() was added to support posix_fadvise(2). All filesystem modules must be recompiled. Modified: stable/9/share/man/man4/acpi_wmi.4 ============================================================================== --- stable/9/share/man/man4/acpi_wmi.4 Mon Jan 9 14:35:05 2012 (r229857) +++ stable/9/share/man/man4/acpi_wmi.4 Mon Jan 9 15:56:33 2012 (r229858) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 8, 2010 +.Dd November 22, 2011 .Dt ACPI_WMI 4 .Os .Sh NAME @@ -49,16 +49,16 @@ The .Nm driver provides an interface for vendor specific WMI implementations (e.g. HP and Acer laptops). -It creates /dev/wmistat, which can be read to get +It creates /dev/wmistat%d, which can be read to get information about GUIDs found in the system. .Sh FILES -.Bl -tag -width /dev/wmistat -compact -.It Pa /dev/wmistat +.Bl -tag -width /dev/wmistat%d -compact +.It Pa /dev/wmistat%d WMI status device. .El .Sh EXAMPLES .Bd -literal -# cat /dev/wmistat +# cat /dev/wmistat0 GUID INST EXPE METH STR EVENT OID {5FB7F034-2C63-45E9-BE91-3D44E2C707E4} 1 NO WMAA NO NO AA {95F24279-4D7B-4334-9387-ACCDC67EF61C} 1 NO NO NO 0x80+ - Modified: stable/9/sys/dev/acpi_support/acpi_wmi.c ============================================================================== --- stable/9/sys/dev/acpi_support/acpi_wmi.c Mon Jan 9 14:35:05 2012 (r229857) +++ stable/9/sys/dev/acpi_support/acpi_wmi.c Mon Jan 9 15:56:33 2012 (r229858) @@ -264,7 +264,7 @@ acpi_wmi_attach(device_t dev) acpi_wmi_ec_handler); } else { sc->wmistat_dev_t = make_dev(&wmistat_cdevsw, 0, UID_ROOT, - GID_WHEEL, 0644, "wmistat"); + GID_WHEEL, 0644, "wmistat%d", device_get_unit(dev)); sc->wmistat_dev_t->si_drv1 = sc; sc->wmistat_open_pid = 0; sc->wmistat_bufptr = -1; From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 18:32:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9305E106566B; Mon, 9 Jan 2012 18:32:45 +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 7FFD78FC14; Mon, 9 Jan 2012 18:32: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 q09IWjvL052588; Mon, 9 Jan 2012 18:32:45 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q09IWjc1052584; Mon, 9 Jan 2012 18:32:45 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201201091832.q09IWjc1052584@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 9 Jan 2012 18:32:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229859 - in stable/8/sys: conf dev/bce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 18:32:45 -0000 Author: yongari Date: Mon Jan 9 18:32:45 2012 New Revision: 229859 URL: http://svn.freebsd.org/changeset/base/229859 Log: MFC r210522,213489,218423,218527: r210522: Fix an apparent typo. r213489: Add the capability to read the complete contents of the NVRAM via sysctl dev.bce..nvram_dump Add the capability to write the complete contents of the NVRAM via sysctl dev.bce..nvram_write These are only available if the kernel option BCE_DEBUG is enabled. The nvram_write sysctl also requires the kernel option BCE_NVRAM_WRITE_SUPPORT to be enabled. These are to be used at your own caution. Since the MAC addresses are stored in the NVRAM, if you dump one NIC and restore it on another NIC the destination NIC's MAC addresses will not be preserved. A tool can be made using these sysctl's to manage the on-chip firmware. r218423: - Added systcls for header splitting, RX/TX buffer count, interrupt coalescing, strict RX MTU, verbose output, and shared memory debug. - Added additional debug counters (VLAN tags and split header frames). - Updated debug counters to 64 bit definitions. - Updated l2fhdr bit definitions. - Combined RX buffer sizing into a single function. - Added buffer size and interrupt coalescing settings to adapter info printout. r218527: - Added error checking to nvram read functions. - Minor style updates. Modified: stable/8/sys/conf/options stable/8/sys/dev/bce/if_bce.c stable/8/sys/dev/bce/if_bcereg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/conf/options ============================================================================== --- stable/8/sys/conf/options Mon Jan 9 15:56:33 2012 (r229858) +++ stable/8/sys/conf/options Mon Jan 9 18:32:45 2012 (r229859) @@ -695,6 +695,7 @@ ED_SIC opt_ed.h # bce driver BCE_DEBUG opt_bce.h +BCE_NVRAM_WRITE_SUPPORT opt_bce.h SOCKBUF_DEBUG opt_global.h Modified: stable/8/sys/dev/bce/if_bce.c ============================================================================== --- stable/8/sys/dev/bce/if_bce.c Mon Jan 9 15:56:33 2012 (r229858) +++ stable/8/sys/dev/bce/if_bce.c Mon Jan 9 18:32:45 2012 (r229859) @@ -89,12 +89,6 @@ __FBSDID("$FreeBSD$"); #endif /****************************************************************************/ -/* BCE Build Time Options */ -/****************************************************************************/ -/* #define BCE_NVRAM_WRITE_SUPPORT 1 */ - - -/****************************************************************************/ /* PCI Device ID Table */ /* */ /* Used by bce_probe() to identify the devices supported by this driver. */ @@ -287,48 +281,43 @@ static int bce_shutdown (device_t); /* BCE Debug Data Structure Dump Routines */ /****************************************************************************/ #ifdef BCE_DEBUG -static u32 bce_reg_rd (struct bce_softc *, u32); -static void bce_reg_wr (struct bce_softc *, u32, u32); -static void bce_reg_wr16 (struct bce_softc *, u32, u16); -static u32 bce_ctx_rd (struct bce_softc *, u32, u32); -static void bce_dump_enet (struct bce_softc *, struct mbuf *); -static void bce_dump_mbuf (struct bce_softc *, struct mbuf *); +static u32 bce_reg_rd (struct bce_softc *, u32); +static void bce_reg_wr (struct bce_softc *, u32, u32); +static void bce_reg_wr16 (struct bce_softc *, u32, u16); +static u32 bce_ctx_rd (struct bce_softc *, u32, u32); +static void bce_dump_enet (struct bce_softc *, struct mbuf *); +static void bce_dump_mbuf (struct bce_softc *, struct mbuf *); static void bce_dump_tx_mbuf_chain (struct bce_softc *, u16, int); static void bce_dump_rx_mbuf_chain (struct bce_softc *, u16, int); -#ifdef BCE_JUMBO_HDRSPLIT static void bce_dump_pg_mbuf_chain (struct bce_softc *, u16, int); -#endif -static void bce_dump_txbd (struct bce_softc *, +static void bce_dump_txbd (struct bce_softc *, int, struct tx_bd *); -static void bce_dump_rxbd (struct bce_softc *, +static void bce_dump_rxbd (struct bce_softc *, int, struct rx_bd *); -#ifdef BCE_JUMBO_HDRSPLIT -static void bce_dump_pgbd (struct bce_softc *, +static void bce_dump_pgbd (struct bce_softc *, int, struct rx_bd *); -#endif static void bce_dump_l2fhdr (struct bce_softc *, int, struct l2_fhdr *); -static void bce_dump_ctx (struct bce_softc *, u16); -static void bce_dump_ftqs (struct bce_softc *); +static void bce_dump_ctx (struct bce_softc *, u16); +static void bce_dump_ftqs (struct bce_softc *); static void bce_dump_tx_chain (struct bce_softc *, u16, int); static void bce_dump_rx_bd_chain (struct bce_softc *, u16, int); -#ifdef BCE_JUMBO_HDRSPLIT static void bce_dump_pg_chain (struct bce_softc *, u16, int); -#endif static void bce_dump_status_block (struct bce_softc *); static void bce_dump_stats_block (struct bce_softc *); static void bce_dump_driver_state (struct bce_softc *); static void bce_dump_hw_state (struct bce_softc *); +static void bce_dump_shmem_state (struct bce_softc *); static void bce_dump_mq_regs (struct bce_softc *); static void bce_dump_bc_state (struct bce_softc *); static void bce_dump_txp_state (struct bce_softc *, int); static void bce_dump_rxp_state (struct bce_softc *, int); -static void bce_dump_tpat_state (struct bce_softc *, int); +static void bce_dump_tpat_state (struct bce_softc *, int); static void bce_dump_cp_state (struct bce_softc *, int); static void bce_dump_com_state (struct bce_softc *, int); -static void bce_dump_rv2p_state (struct bce_softc *); -static void bce_breakpoint (struct bce_softc *); -#endif +static void bce_dump_rv2p_state (struct bce_softc *); +static void bce_breakpoint (struct bce_softc *); +#endif /*BCE_DEBUG */ /****************************************************************************/ @@ -343,21 +332,27 @@ static int bce_miibus_read_reg (device static int bce_miibus_write_reg (device_t, int, int, int); static void bce_miibus_statchg (device_t); +#ifdef BCE_DEBUG +static int bce_sysctl_nvram_dump(SYSCTL_HANDLER_ARGS); +#ifdef BCE_NVRAM_WRITE_SUPPORT +static int bce_sysctl_nvram_write(SYSCTL_HANDLER_ARGS); +#endif +#endif /****************************************************************************/ /* BCE NVRAM Access Routines */ /****************************************************************************/ static int bce_acquire_nvram_lock (struct bce_softc *); static int bce_release_nvram_lock (struct bce_softc *); -static void bce_enable_nvram_access (struct bce_softc *); -static void bce_disable_nvram_access (struct bce_softc *); +static void bce_enable_nvram_access(struct bce_softc *); +static void bce_disable_nvram_access(struct bce_softc *); static int bce_nvram_read_dword (struct bce_softc *, u32, u8 *, u32); -static int bce_init_nvram (struct bce_softc *); -static int bce_nvram_read (struct bce_softc *, u32, u8 *, int); -static int bce_nvram_test (struct bce_softc *); +static int bce_init_nvram (struct bce_softc *); +static int bce_nvram_read (struct bce_softc *, u32, u8 *, int); +static int bce_nvram_test (struct bce_softc *); #ifdef BCE_NVRAM_WRITE_SUPPORT static int bce_enable_nvram_write (struct bce_softc *); -static void bce_disable_nvram_write (struct bce_softc *); +static void bce_disable_nvram_write(struct bce_softc *); static int bce_nvram_erase_page (struct bce_softc *, u32); static int bce_nvram_write_dword (struct bce_softc *, u32, u8 *, u32); static int bce_nvram_write (struct bce_softc *, u32, u8 *, int); @@ -366,12 +361,12 @@ static int bce_nvram_write (struct bce /****************************************************************************/ /* */ /****************************************************************************/ -static void bce_get_media (struct bce_softc *); -static void bce_init_media (struct bce_softc *); -static void bce_dma_map_addr (void *, - bus_dma_segment_t *, int, int); -static int bce_dma_alloc (device_t); -static void bce_dma_free (struct bce_softc *); +static void bce_get_rx_buffer_sizes(struct bce_softc *, int); +static void bce_get_media (struct bce_softc *); +static void bce_init_media (struct bce_softc *); +static void bce_dma_map_addr (void *, bus_dma_segment_t *, int, int); +static int bce_dma_alloc (device_t); +static void bce_dma_free (struct bce_softc *); static void bce_release_resources (struct bce_softc *); /****************************************************************************/ @@ -381,69 +376,67 @@ static int bce_fw_sync (struct bce_so static void bce_load_rv2p_fw (struct bce_softc *, u32 *, u32, u32); static void bce_load_cpu_fw (struct bce_softc *, struct cpu_reg *, struct fw_info *); -static void bce_start_cpu (struct bce_softc *, struct cpu_reg *); -static void bce_halt_cpu (struct bce_softc *, struct cpu_reg *); +static void bce_start_cpu (struct bce_softc *, struct cpu_reg *); +static void bce_halt_cpu (struct bce_softc *, struct cpu_reg *); static void bce_start_rxp_cpu (struct bce_softc *); static void bce_init_rxp_cpu (struct bce_softc *); static void bce_init_txp_cpu (struct bce_softc *); static void bce_init_tpat_cpu (struct bce_softc *); static void bce_init_cp_cpu (struct bce_softc *); static void bce_init_com_cpu (struct bce_softc *); -static void bce_init_cpus (struct bce_softc *); +static void bce_init_cpus (struct bce_softc *); -static void bce_print_adapter_info (struct bce_softc *); +static void bce_print_adapter_info (struct bce_softc *); static void bce_probe_pci_caps (device_t, struct bce_softc *); -static void bce_stop (struct bce_softc *); -static int bce_reset (struct bce_softc *, u32); -static int bce_chipinit (struct bce_softc *); -static int bce_blockinit (struct bce_softc *); +static void bce_stop (struct bce_softc *); +static int bce_reset (struct bce_softc *, u32); +static int bce_chipinit (struct bce_softc *); +static int bce_blockinit (struct bce_softc *); static int bce_init_tx_chain (struct bce_softc *); static void bce_free_tx_chain (struct bce_softc *); -static int bce_get_rx_buf (struct bce_softc *, +static int bce_get_rx_buf (struct bce_softc *, struct mbuf *, u16 *, u16 *, u32 *); static int bce_init_rx_chain (struct bce_softc *); static void bce_fill_rx_chain (struct bce_softc *); static void bce_free_rx_chain (struct bce_softc *); -#ifdef BCE_JUMBO_HDRSPLIT -static int bce_get_pg_buf (struct bce_softc *, +static int bce_get_pg_buf (struct bce_softc *, struct mbuf *, u16 *, u16 *); static int bce_init_pg_chain (struct bce_softc *); static void bce_fill_pg_chain (struct bce_softc *); static void bce_free_pg_chain (struct bce_softc *); -#endif static struct mbuf *bce_tso_setup (struct bce_softc *, struct mbuf **, u16 *); -static int bce_tx_encap (struct bce_softc *, struct mbuf **); +static int bce_tx_encap (struct bce_softc *, struct mbuf **); static void bce_start_locked (struct ifnet *); -static void bce_start (struct ifnet *); -static int bce_ioctl (struct ifnet *, u_long, caddr_t); -static void bce_watchdog (struct bce_softc *); +static void bce_start (struct ifnet *); +static int bce_ioctl (struct ifnet *, u_long, caddr_t); +static void bce_watchdog (struct bce_softc *); static int bce_ifmedia_upd (struct ifnet *); static int bce_ifmedia_upd_locked (struct ifnet *); static void bce_ifmedia_sts (struct ifnet *, struct ifmediareq *); static void bce_init_locked (struct bce_softc *); -static void bce_init (void *); +static void bce_init (void *); static void bce_mgmt_init_locked (struct bce_softc *sc); -static int bce_init_ctx (struct bce_softc *); +static int bce_init_ctx (struct bce_softc *); static void bce_get_mac_addr (struct bce_softc *); static void bce_set_mac_addr (struct bce_softc *); -static void bce_phy_intr (struct bce_softc *); +static void bce_phy_intr (struct bce_softc *); static inline u16 bce_get_hw_rx_cons (struct bce_softc *); static void bce_rx_intr (struct bce_softc *); static void bce_tx_intr (struct bce_softc *); static void bce_disable_intr (struct bce_softc *); static void bce_enable_intr (struct bce_softc *, int); -static void bce_intr (void *); +static void bce_intr (void *); static void bce_set_rx_mode (struct bce_softc *); static void bce_stats_update (struct bce_softc *); -static void bce_tick (void *); -static void bce_pulse (void *); +static void bce_tick (void *); +static void bce_pulse (void *); static void bce_add_sysctls (struct bce_softc *); @@ -499,23 +492,148 @@ DRIVER_MODULE(miibus, bce, miibus_driver SYSCTL_NODE(_hw, OID_AUTO, bce, CTLFLAG_RD, 0, "bce driver parameters"); /* Allowable values are TRUE or FALSE */ +static int bce_verbose = TRUE; +TUNABLE_INT("hw.bce.verbose", &bce_verbose); +SYSCTL_INT(_hw_bce, OID_AUTO, verbose, CTLFLAG_RDTUN, &bce_verbose, 0, + "Verbose output enable/disable"); + +/* Allowable values are TRUE or FALSE */ static int bce_tso_enable = TRUE; TUNABLE_INT("hw.bce.tso_enable", &bce_tso_enable); SYSCTL_UINT(_hw_bce, OID_AUTO, tso_enable, CTLFLAG_RDTUN, &bce_tso_enable, 0, -"TSO Enable/Disable"); + "TSO Enable/Disable"); /* Allowable values are 0 (IRQ), 1 (MSI/IRQ), and 2 (MSI-X/MSI/IRQ) */ /* ToDo: Add MSI-X support. */ static int bce_msi_enable = 1; TUNABLE_INT("hw.bce.msi_enable", &bce_msi_enable); SYSCTL_UINT(_hw_bce, OID_AUTO, msi_enable, CTLFLAG_RDTUN, &bce_msi_enable, 0, -"MSI-X|MSI|INTx selector"); + "MSI-X|MSI|INTx selector"); + +/* Allowable values are 1, 2, 4, 8. */ +static int bce_rx_pages = DEFAULT_RX_PAGES; +TUNABLE_INT("hw.bce.rx_pages", &bce_rx_pages); +SYSCTL_UINT(_hw_bce, OID_AUTO, rx_pages, CTLFLAG_RDTUN, &bce_rx_pages, 0, + "Receive buffer descriptor pages (1 page = 255 buffer descriptors)"); + +/* Allowable values are 1, 2, 4, 8. */ +static int bce_tx_pages = DEFAULT_TX_PAGES; +TUNABLE_INT("hw.bce.tx_pages", &bce_tx_pages); +SYSCTL_UINT(_hw_bce, OID_AUTO, tx_pages, CTLFLAG_RDTUN, &bce_tx_pages, 0, + "Transmit buffer descriptor pages (1 page = 255 buffer descriptors)"); + +/* Allowable values are TRUE or FALSE. */ +static int bce_hdr_split = TRUE; +TUNABLE_INT("hw.bce.hdr_split", &bce_hdr_split); +SYSCTL_UINT(_hw_bce, OID_AUTO, hdr_split, CTLFLAG_RDTUN, &bce_hdr_split, 0, + "Frame header/payload splitting Enable/Disable"); + +/* Allowable values are TRUE or FALSE. */ +static int bce_strict_rx_mtu = FALSE; +TUNABLE_INT("hw.bce.strict_rx_mtu", &bce_strict_rx_mtu); +SYSCTL_UINT(_hw_bce, OID_AUTO, loose_rx_mtu, CTLFLAG_RDTUN, + &bce_strict_rx_mtu, 0, + "Enable/Disable strict RX frame size checking"); -/* ToDo: Add tunable to enable/disable strict MTU handling. */ -/* Currently allows "loose" RX MTU checking (i.e. sets the */ -/* H/W RX MTU to the size of the largest receive buffer, or */ -/* 2048 bytes). This will cause a UNH failure but is more */ -/* desireable from a functional perspective. */ +/* Allowable values are 0 ... 100 */ +#ifdef BCE_DEBUG +/* Generate 1 interrupt for every transmit completion. */ +static int bce_tx_quick_cons_trip_int = 1; +#else +/* Generate 1 interrupt for every 20 transmit completions. */ +static int bce_tx_quick_cons_trip_int = DEFAULT_TX_QUICK_CONS_TRIP_INT; +#endif +TUNABLE_INT("hw.bce.tx_quick_cons_trip_int", &bce_tx_quick_cons_trip_int); +SYSCTL_UINT(_hw_bce, OID_AUTO, tx_quick_cons_trip_int, CTLFLAG_RDTUN, + &bce_tx_quick_cons_trip_int, 0, + "Transmit BD trip point during interrupts"); + +/* Allowable values are 0 ... 100 */ +/* Generate 1 interrupt for every transmit completion. */ +#ifdef BCE_DEBUG +static int bce_tx_quick_cons_trip = 1; +#else +/* Generate 1 interrupt for every 20 transmit completions. */ +static int bce_tx_quick_cons_trip = DEFAULT_TX_QUICK_CONS_TRIP; +#endif +TUNABLE_INT("hw.bce.tx_quick_cons_trip", &bce_tx_quick_cons_trip); +SYSCTL_UINT(_hw_bce, OID_AUTO, tx_quick_cons_trip, CTLFLAG_RDTUN, + &bce_tx_quick_cons_trip, 0, + "Transmit BD trip point"); + +/* Allowable values are 0 ... 100 */ +#ifdef BCE_DEBUG +/* Generate an interrupt if 0us have elapsed since the last TX completion. */ +static int bce_tx_ticks_int = 0; +#else +/* Generate an interrupt if 80us have elapsed since the last TX completion. */ +static int bce_tx_ticks_int = DEFAULT_TX_TICKS_INT; +#endif +TUNABLE_INT("hw.bce.tx_ticks_int", &bce_tx_ticks_int); +SYSCTL_UINT(_hw_bce, OID_AUTO, tx_ticks_int, CTLFLAG_RDTUN, + &bce_tx_ticks_int, 0, "Transmit ticks count during interrupt"); + +/* Allowable values are 0 ... 100 */ +#ifdef BCE_DEBUG +/* Generate an interrupt if 0us have elapsed since the last TX completion. */ +static int bce_tx_ticks = 0; +#else +/* Generate an interrupt if 80us have elapsed since the last TX completion. */ +static int bce_tx_ticks = DEFAULT_TX_TICKS; +#endif +TUNABLE_INT("hw.bce.tx_ticks", &bce_tx_ticks); +SYSCTL_UINT(_hw_bce, OID_AUTO, tx_ticks, CTLFLAG_RDTUN, + &bce_tx_ticks, 0, "Transmit ticks count"); + +/* Allowable values are 1 ... 100 */ +#ifdef BCE_DEBUG +/* Generate 1 interrupt for every received frame. */ +static int bce_rx_quick_cons_trip_int = 1; +#else +/* Generate 1 interrupt for every 6 received frames. */ +static int bce_rx_quick_cons_trip_int = DEFAULT_RX_QUICK_CONS_TRIP_INT; +#endif +TUNABLE_INT("hw.bce.rx_quick_cons_trip_int", &bce_rx_quick_cons_trip_int); +SYSCTL_UINT(_hw_bce, OID_AUTO, rx_quick_cons_trip_int, CTLFLAG_RDTUN, + &bce_rx_quick_cons_trip_int, 0, + "Receive BD trip point duirng interrupts"); + +/* Allowable values are 1 ... 100 */ +#ifdef BCE_DEBUG +/* Generate 1 interrupt for every received frame. */ +static int bce_rx_quick_cons_trip = 1; +#else +/* Generate 1 interrupt for every 6 received frames. */ +static int bce_rx_quick_cons_trip = DEFAULT_RX_QUICK_CONS_TRIP; +#endif +TUNABLE_INT("hw.bce.rx_quick_cons_trip", &bce_rx_quick_cons_trip); +SYSCTL_UINT(_hw_bce, OID_AUTO, rx_quick_cons_trip, CTLFLAG_RDTUN, + &bce_rx_quick_cons_trip, 0, + "Receive BD trip point"); + +/* Allowable values are 0 ... 100 */ +#ifdef BCE_DEBUG +/* Generate an int. if 0us have elapsed since the last received frame. */ +static int bce_rx_ticks_int = 0; +#else +/* Generate an int. if 18us have elapsed since the last received frame. */ +static int bce_rx_ticks_int = DEFAULT_RX_TICKS_INT; +#endif +TUNABLE_INT("hw.bce.rx_ticks_int", &bce_rx_ticks_int); +SYSCTL_UINT(_hw_bce, OID_AUTO, rx_ticks_int, CTLFLAG_RDTUN, + &bce_rx_ticks_int, 0, "Receive ticks count during interrupt"); + +/* Allowable values are 0 ... 100 */ +#ifdef BCE_DEBUG +/* Generate an int. if 0us have elapsed since the last received frame. */ +static int bce_rx_ticks = 0; +#else +/* Generate an int. if 18us have elapsed since the last received frame. */ +static int bce_rx_ticks = DEFAULT_RX_TICKS; +#endif +TUNABLE_INT("hw.bce.rx_ticks", &bce_rx_ticks); +SYSCTL_UINT(_hw_bce, OID_AUTO, rx_ticks, CTLFLAG_RDTUN, + &bce_rx_ticks, 0, "Receive ticks count"); /****************************************************************************/ @@ -597,7 +715,7 @@ bce_print_adapter_info(struct bce_softc DBENTER(BCE_VERBOSE_LOAD); - if (bootverbose) { + if (bce_verbose || bootverbose) { BCE_PRINTF("ASIC (0x%08X); ", sc->bce_chipid); printf("Rev (%c%d); ", ((BCE_CHIP_ID(sc) & 0xf000) >> 12) + 'A', ((BCE_CHIP_ID(sc) & 0x0ff0) >> 4)); @@ -619,12 +737,14 @@ bce_print_adapter_info(struct bce_softc } /* Firmware version and device features. */ - printf("B/C (%s); Flags (", sc->bce_bc_ver); + printf("B/C (%s); Bufs (RX:%d;TX:%d;PG:%d); Flags (", + sc->bce_bc_ver, sc->rx_pages, sc->tx_pages, + (bce_hdr_split == TRUE ? sc->pg_pages: 0)); - #ifdef BCE_JUMBO_HDRSPLIT - printf("SPLT"); - i++; - #endif + if (bce_hdr_split == TRUE) { + printf("SPLT"); + i++; + } if (sc->bce_flags & BCE_USING_MSI_FLAG) { if (i > 0) printf("|"); @@ -647,6 +767,17 @@ bce_print_adapter_info(struct bce_softc } else { printf(")\n"); } + + printf("Coal (RX:%d,%d,%d,%d; TX:%d,%d,%d,%d)\n", + sc->bce_rx_quick_cons_trip_int, + sc->bce_rx_quick_cons_trip, + sc->bce_rx_ticks_int, + sc->bce_rx_ticks, + sc->bce_tx_quick_cons_trip_int, + sc->bce_tx_quick_cons_trip, + sc->bce_tx_ticks_int, + sc->bce_tx_ticks); + } DBEXIT(BCE_VERBOSE_LOAD); @@ -705,6 +836,189 @@ bce_probe_pci_caps(device_t dev, struct /****************************************************************************/ +/* Load and validate user tunable settings. */ +/* */ +/* Returns: */ +/* Nothing. */ +/****************************************************************************/ +static void +bce_set_tunables(struct bce_softc *sc) +{ + /* Set sysctl values for RX page count. */ + switch (bce_rx_pages) { + case 1: + /* fall-through */ + case 2: + /* fall-through */ + case 4: + /* fall-through */ + case 8: + sc->rx_pages = bce_rx_pages; + break; + default: + sc->rx_pages = DEFAULT_RX_PAGES; + BCE_PRINTF("%s(%d): Illegal value (%d) specified for " + "hw.bce.rx_pages! Setting default of %d.\n", + __FILE__, __LINE__, bce_rx_pages, DEFAULT_RX_PAGES); + } + + /* ToDo: Consider allowing user setting for pg_pages. */ + sc->pg_pages = min((sc->rx_pages * 4), MAX_PG_PAGES); + + /* Set sysctl values for TX page count. */ + switch (bce_tx_pages) { + case 1: + /* fall-through */ + case 2: + /* fall-through */ + case 4: + /* fall-through */ + case 8: + sc->tx_pages = bce_tx_pages; + break; + default: + sc->tx_pages = DEFAULT_TX_PAGES; + BCE_PRINTF("%s(%d): Illegal value (%d) specified for " + "hw.bce.tx_pages! Setting default of %d.\n", + __FILE__, __LINE__, bce_tx_pages, DEFAULT_TX_PAGES); + } + + /* + * Validate the TX trip point (i.e. the number of + * TX completions before a status block update is + * generated and an interrupt is asserted. + */ + if (bce_tx_quick_cons_trip_int <= 100) { + sc->bce_tx_quick_cons_trip_int = + bce_tx_quick_cons_trip_int; + } else { + BCE_PRINTF("%s(%d): Illegal value (%d) specified for " + "hw.bce.tx_quick_cons_trip_int! Setting default of %d.\n", + __FILE__, __LINE__, bce_tx_quick_cons_trip_int, + DEFAULT_TX_QUICK_CONS_TRIP_INT); + sc->bce_tx_quick_cons_trip_int = + DEFAULT_TX_QUICK_CONS_TRIP_INT; + } + + if (bce_tx_quick_cons_trip <= 100) { + sc->bce_tx_quick_cons_trip = + bce_tx_quick_cons_trip; + } else { + BCE_PRINTF("%s(%d): Illegal value (%d) specified for " + "hw.bce.tx_quick_cons_trip! Setting default of %d.\n", + __FILE__, __LINE__, bce_tx_quick_cons_trip, + DEFAULT_TX_QUICK_CONS_TRIP); + sc->bce_tx_quick_cons_trip = + DEFAULT_TX_QUICK_CONS_TRIP; + } + + /* + * Validate the TX ticks count (i.e. the maximum amount + * of time to wait after the last TX completion has + * occurred before a status block update is generated + * and an interrupt is asserted. + */ + if (bce_tx_ticks_int <= 100) { + sc->bce_tx_ticks_int = + bce_tx_ticks_int; + } else { + BCE_PRINTF("%s(%d): Illegal value (%d) specified for " + "hw.bce.tx_ticks_int! Setting default of %d.\n", + __FILE__, __LINE__, bce_tx_ticks_int, + DEFAULT_TX_TICKS_INT); + sc->bce_tx_ticks_int = + DEFAULT_TX_TICKS_INT; + } + + if (bce_tx_ticks <= 100) { + sc->bce_tx_ticks = + bce_tx_ticks; + } else { + BCE_PRINTF("%s(%d): Illegal value (%d) specified for " + "hw.bce.tx_ticks! Setting default of %d.\n", + __FILE__, __LINE__, bce_tx_ticks, + DEFAULT_TX_TICKS); + sc->bce_tx_ticks = + DEFAULT_TX_TICKS; + } + + /* + * Validate the RX trip point (i.e. the number of + * RX frames received before a status block update is + * generated and an interrupt is asserted. + */ + if (bce_rx_quick_cons_trip_int <= 100) { + sc->bce_rx_quick_cons_trip_int = + bce_rx_quick_cons_trip_int; + } else { + BCE_PRINTF("%s(%d): Illegal value (%d) specified for " + "hw.bce.rx_quick_cons_trip_int! Setting default of %d.\n", + __FILE__, __LINE__, bce_rx_quick_cons_trip_int, + DEFAULT_RX_QUICK_CONS_TRIP_INT); + sc->bce_rx_quick_cons_trip_int = + DEFAULT_RX_QUICK_CONS_TRIP_INT; + } + + if (bce_rx_quick_cons_trip <= 100) { + sc->bce_rx_quick_cons_trip = + bce_rx_quick_cons_trip; + } else { + BCE_PRINTF("%s(%d): Illegal value (%d) specified for " + "hw.bce.rx_quick_cons_trip! Setting default of %d.\n", + __FILE__, __LINE__, bce_rx_quick_cons_trip, + DEFAULT_RX_QUICK_CONS_TRIP); + sc->bce_rx_quick_cons_trip = + DEFAULT_RX_QUICK_CONS_TRIP; + } + + /* + * Validate the RX ticks count (i.e. the maximum amount + * of time to wait after the last RX frame has been + * received before a status block update is generated + * and an interrupt is asserted. + */ + if (bce_rx_ticks_int <= 100) { + sc->bce_rx_ticks_int = bce_rx_ticks_int; + } else { + BCE_PRINTF("%s(%d): Illegal value (%d) specified for " + "hw.bce.rx_ticks_int! Setting default of %d.\n", + __FILE__, __LINE__, bce_rx_ticks_int, + DEFAULT_RX_TICKS_INT); + sc->bce_rx_ticks_int = DEFAULT_RX_TICKS_INT; + } + + if (bce_rx_ticks <= 100) { + sc->bce_rx_ticks = bce_rx_ticks; + } else { + BCE_PRINTF("%s(%d): Illegal value (%d) specified for " + "hw.bce.rx_ticks! Setting default of %d.\n", + __FILE__, __LINE__, bce_rx_ticks, + DEFAULT_RX_TICKS); + sc->bce_rx_ticks = DEFAULT_RX_TICKS; + } + + /* Disabling both RX ticks and RX trips will prevent interrupts. */ + if ((bce_rx_quick_cons_trip == 0) && (bce_rx_ticks == 0)) { + BCE_PRINTF("%s(%d): Cannot set both hw.bce.rx_ticks and " + "hw.bce.rx_quick_cons_trip to 0. Setting default values.\n", + __FILE__, __LINE__); + sc->bce_rx_ticks = DEFAULT_RX_TICKS; + sc->bce_rx_quick_cons_trip = DEFAULT_RX_QUICK_CONS_TRIP; + } + + /* Disabling both TX ticks and TX trips will prevent interrupts. */ + if ((bce_tx_quick_cons_trip == 0) && (bce_tx_ticks == 0)) { + BCE_PRINTF("%s(%d): Cannot set both hw.bce.tx_ticks and " + "hw.bce.tx_quick_cons_trip to 0. Setting default values.\n", + __FILE__, __LINE__); + sc->bce_tx_ticks = DEFAULT_TX_TICKS; + sc->bce_tx_quick_cons_trip = DEFAULT_TX_QUICK_CONS_TRIP; + } + +} + + +/****************************************************************************/ /* Device attach function. */ /* */ /* Allocates device resources, performs secondary chip identification, */ @@ -733,6 +1047,8 @@ bce_attach(device_t dev) sc->bce_flags = 0; sc->bce_phy_flags = 0; + bce_set_tunables(sc); + pci_enable_busmaster(dev); /* Allocate PCI memory resources. */ @@ -1021,37 +1337,13 @@ bce_attach(device_t dev) * values for the RX and TX chains. */ -#ifdef BCE_DEBUG - /* Force more frequent interrupts. */ - sc->bce_tx_quick_cons_trip_int = 1; - sc->bce_tx_quick_cons_trip = 1; - sc->bce_tx_ticks_int = 0; - sc->bce_tx_ticks = 0; - - sc->bce_rx_quick_cons_trip_int = 1; - sc->bce_rx_quick_cons_trip = 1; - sc->bce_rx_ticks_int = 0; - sc->bce_rx_ticks = 0; -#else - /* Improve throughput at the expense of increased latency. */ - sc->bce_tx_quick_cons_trip_int = 20; - sc->bce_tx_quick_cons_trip = 20; - sc->bce_tx_ticks_int = 80; - sc->bce_tx_ticks = 80; - - sc->bce_rx_quick_cons_trip_int = 6; - sc->bce_rx_quick_cons_trip = 6; - sc->bce_rx_ticks_int = 18; - sc->bce_rx_ticks = 18; -#endif - /* Not used for L2. */ - sc->bce_comp_prod_trip_int = 0; - sc->bce_comp_prod_trip = 0; - sc->bce_com_ticks_int = 0; - sc->bce_com_ticks = 0; - sc->bce_cmd_ticks_int = 0; - sc->bce_cmd_ticks = 0; + sc->bce_comp_prod_trip_int = 0; + sc->bce_comp_prod_trip = 0; + sc->bce_com_ticks_int = 0; + sc->bce_com_ticks = 0; + sc->bce_cmd_ticks_int = 0; + sc->bce_cmd_ticks = 0; /* Update statistics once every second. */ sc->bce_stats_ticks = 1000000 & 0xffff00; @@ -1105,23 +1397,11 @@ bce_attach(device_t dev) * This may change later if the MTU size is set to * something other than 1500. */ -#ifdef BCE_JUMBO_HDRSPLIT - sc->rx_bd_mbuf_alloc_size = MHLEN; - /* Make sure offset is 16 byte aligned for hardware. */ - sc->rx_bd_mbuf_align_pad = - roundup2((MSIZE - MHLEN), 16) - (MSIZE - MHLEN); - sc->rx_bd_mbuf_data_len = sc->rx_bd_mbuf_alloc_size - - sc->rx_bd_mbuf_align_pad; - sc->pg_bd_mbuf_alloc_size = MCLBYTES; -#else - sc->rx_bd_mbuf_alloc_size = MCLBYTES; - sc->rx_bd_mbuf_align_pad = - roundup2(MCLBYTES, 16) - MCLBYTES; - sc->rx_bd_mbuf_data_len = sc->rx_bd_mbuf_alloc_size - - sc->rx_bd_mbuf_align_pad; -#endif + bce_get_rx_buffer_sizes(sc, + (ETHER_MAX_LEN - ETHER_HDR_LEN - ETHER_CRC_LEN)); - ifp->if_snd.ifq_drv_maxlen = USABLE_TX_BD; + /* Recalculate our buffer allocation sizes. */ + ifp->if_snd.ifq_drv_maxlen = USABLE_TX_BD_ALLOC; IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); IFQ_SET_READY(&ifp->if_snd); @@ -2594,9 +2874,9 @@ bce_nvram_write(struct bce_softc *sc, u3 goto bce_nvram_write_exit; bce_nvram_write_locked_exit: - bce_disable_nvram_write(sc); - bce_disable_nvram_access(sc); - bce_release_nvram_lock(sc); + bce_disable_nvram_write(sc); + bce_disable_nvram_access(sc); + bce_release_nvram_lock(sc); bce_nvram_write_exit: if (align_start || align_end) @@ -2641,7 +2921,7 @@ bce_nvram_test(struct bce_softc *sc) * Verify that offset 0 of the NVRAM contains * a valid magic number. */ - magic = bce_be32toh(buf[0]); + magic = bce_be32toh(buf[0]); if (magic != BCE_NVRAM_MAGIC) { rc = ENODEV; BCE_PRINTF("%s(%d): Invalid NVRAM magic value! " @@ -2685,6 +2965,58 @@ bce_nvram_test_exit: /****************************************************************************/ +/* Calculates the size of the buffers to allocate based on the MTU. */ +/* */ +/* Returns: */ +/* Nothing. */ +/****************************************************************************/ +static void +bce_get_rx_buffer_sizes(struct bce_softc *sc, int mtu) +{ + DBENTER(BCE_VERBOSE_LOAD); + + /* Use a single allocation type when header splitting enabled. */ + if (bce_hdr_split == TRUE) { + sc->rx_bd_mbuf_alloc_size = MHLEN; + /* Make sure offset is 16 byte aligned for hardware. */ + sc->rx_bd_mbuf_align_pad = + roundup2((MSIZE - MHLEN), 16) - (MSIZE - MHLEN); + sc->rx_bd_mbuf_data_len = sc->rx_bd_mbuf_alloc_size - + sc->rx_bd_mbuf_align_pad; + sc->pg_bd_mbuf_alloc_size = MCLBYTES; + } else { + if ((mtu + ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN + + ETHER_CRC_LEN) > MCLBYTES) { + /* Setup for jumbo RX buffer allocations. */ + sc->rx_bd_mbuf_alloc_size = MJUM9BYTES; + sc->rx_bd_mbuf_align_pad = + roundup2(MJUM9BYTES, 16) - MJUM9BYTES; + sc->rx_bd_mbuf_data_len = + sc->rx_bd_mbuf_alloc_size - + sc->rx_bd_mbuf_align_pad; + } else { + /* Setup for standard RX buffer allocations. */ + sc->rx_bd_mbuf_alloc_size = MCLBYTES; + sc->rx_bd_mbuf_align_pad = + roundup2(MCLBYTES, 16) - MCLBYTES; + sc->rx_bd_mbuf_data_len = + sc->rx_bd_mbuf_alloc_size - + sc->rx_bd_mbuf_align_pad; + } + } + +// DBPRINT(sc, BCE_INFO_LOAD, + DBPRINT(sc, BCE_WARN, + "%s(): rx_bd_mbuf_alloc_size = %d, rx_bd_mbuf_data_len = %d, " + "rx_bd_mbuf_align_pad = %d\n", __FUNCTION__, + sc->rx_bd_mbuf_alloc_size, sc->rx_bd_mbuf_data_len, + sc->rx_bd_mbuf_align_pad); + + DBEXIT(BCE_VERBOSE_LOAD); + +} + +/****************************************************************************/ /* Identifies the current media type of the controller and sets the PHY */ /* address. */ /* */ @@ -2918,7 +3250,7 @@ bce_dma_free(struct bce_softc *sc) /* Free, unmap and destroy all TX buffer descriptor chain pages. */ - for (i = 0; i < TX_PAGES; i++ ) { + for (i = 0; i < sc->tx_pages; i++ ) { if (sc->tx_bd_chain[i] != NULL) { bus_dmamem_free( sc->tx_bd_chain_tag, @@ -2946,7 +3278,7 @@ bce_dma_free(struct bce_softc *sc) /* Free, unmap and destroy all RX buffer descriptor chain pages. */ - for (i = 0; i < RX_PAGES; i++ ) { + for (i = 0; i < sc->rx_pages; i++ ) { if (sc->rx_bd_chain[i] != NULL) { bus_dmamem_free( sc->rx_bd_chain_tag, @@ -2973,38 +3305,38 @@ bce_dma_free(struct bce_softc *sc) } -#ifdef BCE_JUMBO_HDRSPLIT /* Free, unmap and destroy all page buffer descriptor chain pages. */ - for (i = 0; i < PG_PAGES; i++ ) { - if (sc->pg_bd_chain[i] != NULL) { - bus_dmamem_free( - sc->pg_bd_chain_tag, - sc->pg_bd_chain[i], - sc->pg_bd_chain_map[i]); - sc->pg_bd_chain[i] = NULL; - } + if (bce_hdr_split == TRUE) { + for (i = 0; i < sc->pg_pages; i++ ) { + if (sc->pg_bd_chain[i] != NULL) { + bus_dmamem_free( + sc->pg_bd_chain_tag, + sc->pg_bd_chain[i], + sc->pg_bd_chain_map[i]); + sc->pg_bd_chain[i] = NULL; + } - if (sc->pg_bd_chain_map[i] != NULL) { - bus_dmamap_unload( - sc->pg_bd_chain_tag, - sc->pg_bd_chain_map[i]); - bus_dmamap_destroy( - sc->pg_bd_chain_tag, - sc->pg_bd_chain_map[i]); - sc->pg_bd_chain_map[i] = NULL; + if (sc->pg_bd_chain_map[i] != NULL) { + bus_dmamap_unload( + sc->pg_bd_chain_tag, + sc->pg_bd_chain_map[i]); + bus_dmamap_destroy( + sc->pg_bd_chain_tag, + sc->pg_bd_chain_map[i]); + sc->pg_bd_chain_map[i] = NULL; + } } - } - /* Destroy the page buffer descriptor tag. */ - if (sc->pg_bd_chain_tag != NULL) { - bus_dma_tag_destroy(sc->pg_bd_chain_tag); - sc->pg_bd_chain_tag = NULL; + /* Destroy the page buffer descriptor tag. */ + if (sc->pg_bd_chain_tag != NULL) { + bus_dma_tag_destroy(sc->pg_bd_chain_tag); + sc->pg_bd_chain_tag = NULL; + } } -#endif /* Unload and destroy the TX mbuf maps. */ - for (i = 0; i < TOTAL_TX_BD; i++) { + for (i = 0; i < MAX_TX_BD_AVAIL; i++) { if (sc->tx_mbuf_map[i] != NULL) { bus_dmamap_unload(sc->tx_mbuf_tag, sc->tx_mbuf_map[i]); @@ -3021,7 +3353,7 @@ bce_dma_free(struct bce_softc *sc) } /* Unload and destroy the RX mbuf maps. */ - for (i = 0; i < TOTAL_RX_BD; i++) { + for (i = 0; i < MAX_RX_BD_AVAIL; i++) { if (sc->rx_mbuf_map[i] != NULL) { bus_dmamap_unload(sc->rx_mbuf_tag, sc->rx_mbuf_map[i]); @@ -3037,24 +3369,24 @@ bce_dma_free(struct bce_softc *sc) sc->rx_mbuf_tag = NULL; } -#ifdef BCE_JUMBO_HDRSPLIT /* Unload and destroy the page mbuf maps. */ - for (i = 0; i < TOTAL_PG_BD; i++) { - if (sc->pg_mbuf_map[i] != NULL) { - bus_dmamap_unload(sc->pg_mbuf_tag, - sc->pg_mbuf_map[i]); - bus_dmamap_destroy(sc->pg_mbuf_tag, - sc->pg_mbuf_map[i]); - sc->pg_mbuf_map[i] = NULL; + if (bce_hdr_split == TRUE) { + for (i = 0; i < MAX_PG_BD_AVAIL; i++) { + if (sc->pg_mbuf_map[i] != NULL) { + bus_dmamap_unload(sc->pg_mbuf_tag, + sc->pg_mbuf_map[i]); + bus_dmamap_destroy(sc->pg_mbuf_tag, + sc->pg_mbuf_map[i]); + sc->pg_mbuf_map[i] = NULL; + } } - } - /* Destroy the page mbuf tag. */ - if (sc->pg_mbuf_tag != NULL) { - bus_dma_tag_destroy(sc->pg_mbuf_tag); - sc->pg_mbuf_tag = NULL; + /* Destroy the page mbuf tag. */ + if (sc->pg_mbuf_tag != NULL) { + bus_dma_tag_destroy(sc->pg_mbuf_tag); + sc->pg_mbuf_tag = NULL; + } } -#endif /* Destroy the parent tag */ if (sc->parent_tag != NULL) { @@ -3296,7 +3628,7 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - for (i = 0; i < TX_PAGES; i++) { + for (i = 0; i < sc->tx_pages; i++) { if(bus_dmamem_alloc(sc->tx_bd_chain_tag, (void **)&sc->tx_bd_chain[i], @@ -3347,7 +3679,7 @@ bce_dma_alloc(device_t dev) } /* Create DMA maps for the TX mbufs clusters. */ - for (i = 0; i < TOTAL_TX_BD; i++) { + for (i = 0; i < TOTAL_TX_BD_ALLOC; i++) { if (bus_dmamap_create(sc->tx_mbuf_tag, BUS_DMA_NOWAIT, &sc->tx_mbuf_map[i])) { BCE_PRINTF("%s(%d): Unable to create TX mbuf DMA " @@ -3373,7 +3705,7 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - for (i = 0; i < RX_PAGES; i++) { + for (i = 0; i < sc->rx_pages; i++) { if (bus_dmamem_alloc(sc->rx_bd_chain_tag, (void **)&sc->rx_bd_chain[i], @@ -3405,12 +3737,11 @@ bce_dma_alloc(device_t dev) /* * Create a DMA tag for RX mbufs. */ -#ifdef BCE_JUMBO_HDRSPLIT - max_size = max_seg_size = ((sc->rx_bd_mbuf_alloc_size < MCLBYTES) ? - MCLBYTES : sc->rx_bd_mbuf_alloc_size); -#else - max_size = max_seg_size = MJUM9BYTES; -#endif + if (bce_hdr_split == TRUE) + max_size = max_seg_size = ((sc->rx_bd_mbuf_alloc_size < MCLBYTES) ? + MCLBYTES : sc->rx_bd_mbuf_alloc_size); + else + max_size = max_seg_size = MJUM9BYTES; max_segments = 1; DBPRINT(sc, BCE_INFO_LOAD, "%s(): Creating rx_mbuf_tag " @@ -3429,7 +3760,7 @@ bce_dma_alloc(device_t dev) } /* Create DMA maps for the RX mbuf clusters. */ - for (i = 0; i < TOTAL_RX_BD; i++) { + for (i = 0; i < TOTAL_RX_BD_ALLOC; i++) { if (bus_dmamap_create(sc->rx_mbuf_tag, BUS_DMA_NOWAIT, &sc->rx_mbuf_map[i])) { BCE_PRINTF("%s(%d): Unable to create RX mbuf " @@ -3439,78 +3770,77 @@ bce_dma_alloc(device_t dev) } } -#ifdef BCE_JUMBO_HDRSPLIT - /* - * Create a DMA tag for the page buffer descriptor chain, - * allocate and clear the memory, and fetch the physical - * address of the blocks. - */ - if (bus_dma_tag_create(sc->parent_tag, BCM_PAGE_SIZE, - BCE_DMA_BOUNDARY, BUS_SPACE_MAXADDR, sc->max_bus_addr, - NULL, NULL, BCE_PG_CHAIN_PAGE_SZ, 1, BCE_PG_CHAIN_PAGE_SZ, - 0, NULL, NULL, &sc->pg_bd_chain_tag)) { - BCE_PRINTF("%s(%d): Could not allocate page descriptor " - "chain DMA tag!\n", __FILE__, __LINE__); - rc = ENOMEM; - goto bce_dma_alloc_exit; - } - - for (i = 0; i < PG_PAGES; i++) { - - if (bus_dmamem_alloc(sc->pg_bd_chain_tag, - (void **)&sc->pg_bd_chain[i], - BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_COHERENT, - &sc->pg_bd_chain_map[i])) { - BCE_PRINTF("%s(%d): Could not allocate page " - "descriptor chain DMA memory!\n", - __FILE__, __LINE__); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 18:33:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 921B6106564A; Mon, 9 Jan 2012 18:33:54 +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 7EFF48FC12; Mon, 9 Jan 2012 18:33: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 q09IXsIF052673; Mon, 9 Jan 2012 18:33:54 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q09IXsLS052669; Mon, 9 Jan 2012 18:33:54 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201201091833.q09IXsLS052669@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 9 Jan 2012 18:33:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229860 - in stable/7/sys: conf dev/bce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 18:33:54 -0000 Author: yongari Date: Mon Jan 9 18:33:54 2012 New Revision: 229860 URL: http://svn.freebsd.org/changeset/base/229860 Log: MFC r210522,213489,218423,218527: r210522: Fix an apparent typo. r213489: Add the capability to read the complete contents of the NVRAM via sysctl dev.bce..nvram_dump Add the capability to write the complete contents of the NVRAM via sysctl dev.bce..nvram_write These are only available if the kernel option BCE_DEBUG is enabled. The nvram_write sysctl also requires the kernel option BCE_NVRAM_WRITE_SUPPORT to be enabled. These are to be used at your own caution. Since the MAC addresses are stored in the NVRAM, if you dump one NIC and restore it on another NIC the destination NIC's MAC addresses will not be preserved. A tool can be made using these sysctl's to manage the on-chip firmware. r218423: - Added systcls for header splitting, RX/TX buffer count, interrupt coalescing, strict RX MTU, verbose output, and shared memory debug. - Added additional debug counters (VLAN tags and split header frames). - Updated debug counters to 64 bit definitions. - Updated l2fhdr bit definitions. - Combined RX buffer sizing into a single function. - Added buffer size and interrupt coalescing settings to adapter info printout. r218527: - Added error checking to nvram read functions. - Minor style updates. Modified: stable/7/sys/conf/options stable/7/sys/dev/bce/if_bce.c stable/7/sys/dev/bce/if_bcereg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/conf/options ============================================================================== --- stable/7/sys/conf/options Mon Jan 9 18:32:45 2012 (r229859) +++ stable/7/sys/conf/options Mon Jan 9 18:33:54 2012 (r229860) @@ -670,6 +670,7 @@ ED_SIC opt_ed.h # bce driver BCE_DEBUG opt_bce.h +BCE_NVRAM_WRITE_SUPPORT opt_bce.h # wi driver WI_SYMBOL_FIRMWARE opt_wi.h Modified: stable/7/sys/dev/bce/if_bce.c ============================================================================== --- stable/7/sys/dev/bce/if_bce.c Mon Jan 9 18:32:45 2012 (r229859) +++ stable/7/sys/dev/bce/if_bce.c Mon Jan 9 18:33:54 2012 (r229860) @@ -89,12 +89,6 @@ __FBSDID("$FreeBSD$"); #endif /****************************************************************************/ -/* BCE Build Time Options */ -/****************************************************************************/ -/* #define BCE_NVRAM_WRITE_SUPPORT 1 */ - - -/****************************************************************************/ /* PCI Device ID Table */ /* */ /* Used by bce_probe() to identify the devices supported by this driver. */ @@ -287,48 +281,43 @@ static int bce_shutdown (device_t); /* BCE Debug Data Structure Dump Routines */ /****************************************************************************/ #ifdef BCE_DEBUG -static u32 bce_reg_rd (struct bce_softc *, u32); -static void bce_reg_wr (struct bce_softc *, u32, u32); -static void bce_reg_wr16 (struct bce_softc *, u32, u16); -static u32 bce_ctx_rd (struct bce_softc *, u32, u32); -static void bce_dump_enet (struct bce_softc *, struct mbuf *); -static void bce_dump_mbuf (struct bce_softc *, struct mbuf *); +static u32 bce_reg_rd (struct bce_softc *, u32); +static void bce_reg_wr (struct bce_softc *, u32, u32); +static void bce_reg_wr16 (struct bce_softc *, u32, u16); +static u32 bce_ctx_rd (struct bce_softc *, u32, u32); +static void bce_dump_enet (struct bce_softc *, struct mbuf *); +static void bce_dump_mbuf (struct bce_softc *, struct mbuf *); static void bce_dump_tx_mbuf_chain (struct bce_softc *, u16, int); static void bce_dump_rx_mbuf_chain (struct bce_softc *, u16, int); -#ifdef BCE_JUMBO_HDRSPLIT static void bce_dump_pg_mbuf_chain (struct bce_softc *, u16, int); -#endif -static void bce_dump_txbd (struct bce_softc *, +static void bce_dump_txbd (struct bce_softc *, int, struct tx_bd *); -static void bce_dump_rxbd (struct bce_softc *, +static void bce_dump_rxbd (struct bce_softc *, int, struct rx_bd *); -#ifdef BCE_JUMBO_HDRSPLIT -static void bce_dump_pgbd (struct bce_softc *, +static void bce_dump_pgbd (struct bce_softc *, int, struct rx_bd *); -#endif static void bce_dump_l2fhdr (struct bce_softc *, int, struct l2_fhdr *); -static void bce_dump_ctx (struct bce_softc *, u16); -static void bce_dump_ftqs (struct bce_softc *); +static void bce_dump_ctx (struct bce_softc *, u16); +static void bce_dump_ftqs (struct bce_softc *); static void bce_dump_tx_chain (struct bce_softc *, u16, int); static void bce_dump_rx_bd_chain (struct bce_softc *, u16, int); -#ifdef BCE_JUMBO_HDRSPLIT static void bce_dump_pg_chain (struct bce_softc *, u16, int); -#endif static void bce_dump_status_block (struct bce_softc *); static void bce_dump_stats_block (struct bce_softc *); static void bce_dump_driver_state (struct bce_softc *); static void bce_dump_hw_state (struct bce_softc *); +static void bce_dump_shmem_state (struct bce_softc *); static void bce_dump_mq_regs (struct bce_softc *); static void bce_dump_bc_state (struct bce_softc *); static void bce_dump_txp_state (struct bce_softc *, int); static void bce_dump_rxp_state (struct bce_softc *, int); -static void bce_dump_tpat_state (struct bce_softc *, int); +static void bce_dump_tpat_state (struct bce_softc *, int); static void bce_dump_cp_state (struct bce_softc *, int); static void bce_dump_com_state (struct bce_softc *, int); -static void bce_dump_rv2p_state (struct bce_softc *); -static void bce_breakpoint (struct bce_softc *); -#endif +static void bce_dump_rv2p_state (struct bce_softc *); +static void bce_breakpoint (struct bce_softc *); +#endif /*BCE_DEBUG */ /****************************************************************************/ @@ -343,21 +332,27 @@ static int bce_miibus_read_reg (device static int bce_miibus_write_reg (device_t, int, int, int); static void bce_miibus_statchg (device_t); +#ifdef BCE_DEBUG +static int bce_sysctl_nvram_dump(SYSCTL_HANDLER_ARGS); +#ifdef BCE_NVRAM_WRITE_SUPPORT +static int bce_sysctl_nvram_write(SYSCTL_HANDLER_ARGS); +#endif +#endif /****************************************************************************/ /* BCE NVRAM Access Routines */ /****************************************************************************/ static int bce_acquire_nvram_lock (struct bce_softc *); static int bce_release_nvram_lock (struct bce_softc *); -static void bce_enable_nvram_access (struct bce_softc *); -static void bce_disable_nvram_access (struct bce_softc *); +static void bce_enable_nvram_access(struct bce_softc *); +static void bce_disable_nvram_access(struct bce_softc *); static int bce_nvram_read_dword (struct bce_softc *, u32, u8 *, u32); -static int bce_init_nvram (struct bce_softc *); -static int bce_nvram_read (struct bce_softc *, u32, u8 *, int); -static int bce_nvram_test (struct bce_softc *); +static int bce_init_nvram (struct bce_softc *); +static int bce_nvram_read (struct bce_softc *, u32, u8 *, int); +static int bce_nvram_test (struct bce_softc *); #ifdef BCE_NVRAM_WRITE_SUPPORT static int bce_enable_nvram_write (struct bce_softc *); -static void bce_disable_nvram_write (struct bce_softc *); +static void bce_disable_nvram_write(struct bce_softc *); static int bce_nvram_erase_page (struct bce_softc *, u32); static int bce_nvram_write_dword (struct bce_softc *, u32, u8 *, u32); static int bce_nvram_write (struct bce_softc *, u32, u8 *, int); @@ -366,12 +361,12 @@ static int bce_nvram_write (struct bce /****************************************************************************/ /* */ /****************************************************************************/ -static void bce_get_media (struct bce_softc *); -static void bce_init_media (struct bce_softc *); -static void bce_dma_map_addr (void *, - bus_dma_segment_t *, int, int); -static int bce_dma_alloc (device_t); -static void bce_dma_free (struct bce_softc *); +static void bce_get_rx_buffer_sizes(struct bce_softc *, int); +static void bce_get_media (struct bce_softc *); +static void bce_init_media (struct bce_softc *); +static void bce_dma_map_addr (void *, bus_dma_segment_t *, int, int); +static int bce_dma_alloc (device_t); +static void bce_dma_free (struct bce_softc *); static void bce_release_resources (struct bce_softc *); /****************************************************************************/ @@ -381,69 +376,67 @@ static int bce_fw_sync (struct bce_so static void bce_load_rv2p_fw (struct bce_softc *, u32 *, u32, u32); static void bce_load_cpu_fw (struct bce_softc *, struct cpu_reg *, struct fw_info *); -static void bce_start_cpu (struct bce_softc *, struct cpu_reg *); -static void bce_halt_cpu (struct bce_softc *, struct cpu_reg *); +static void bce_start_cpu (struct bce_softc *, struct cpu_reg *); +static void bce_halt_cpu (struct bce_softc *, struct cpu_reg *); static void bce_start_rxp_cpu (struct bce_softc *); static void bce_init_rxp_cpu (struct bce_softc *); static void bce_init_txp_cpu (struct bce_softc *); static void bce_init_tpat_cpu (struct bce_softc *); static void bce_init_cp_cpu (struct bce_softc *); static void bce_init_com_cpu (struct bce_softc *); -static void bce_init_cpus (struct bce_softc *); +static void bce_init_cpus (struct bce_softc *); -static void bce_print_adapter_info (struct bce_softc *); +static void bce_print_adapter_info (struct bce_softc *); static void bce_probe_pci_caps (device_t, struct bce_softc *); -static void bce_stop (struct bce_softc *); -static int bce_reset (struct bce_softc *, u32); -static int bce_chipinit (struct bce_softc *); -static int bce_blockinit (struct bce_softc *); +static void bce_stop (struct bce_softc *); +static int bce_reset (struct bce_softc *, u32); +static int bce_chipinit (struct bce_softc *); +static int bce_blockinit (struct bce_softc *); static int bce_init_tx_chain (struct bce_softc *); static void bce_free_tx_chain (struct bce_softc *); -static int bce_get_rx_buf (struct bce_softc *, +static int bce_get_rx_buf (struct bce_softc *, struct mbuf *, u16 *, u16 *, u32 *); static int bce_init_rx_chain (struct bce_softc *); static void bce_fill_rx_chain (struct bce_softc *); static void bce_free_rx_chain (struct bce_softc *); -#ifdef BCE_JUMBO_HDRSPLIT -static int bce_get_pg_buf (struct bce_softc *, +static int bce_get_pg_buf (struct bce_softc *, struct mbuf *, u16 *, u16 *); static int bce_init_pg_chain (struct bce_softc *); static void bce_fill_pg_chain (struct bce_softc *); static void bce_free_pg_chain (struct bce_softc *); -#endif static struct mbuf *bce_tso_setup (struct bce_softc *, struct mbuf **, u16 *); -static int bce_tx_encap (struct bce_softc *, struct mbuf **); +static int bce_tx_encap (struct bce_softc *, struct mbuf **); static void bce_start_locked (struct ifnet *); -static void bce_start (struct ifnet *); -static int bce_ioctl (struct ifnet *, u_long, caddr_t); -static void bce_watchdog (struct bce_softc *); +static void bce_start (struct ifnet *); +static int bce_ioctl (struct ifnet *, u_long, caddr_t); +static void bce_watchdog (struct bce_softc *); static int bce_ifmedia_upd (struct ifnet *); static int bce_ifmedia_upd_locked (struct ifnet *); static void bce_ifmedia_sts (struct ifnet *, struct ifmediareq *); static void bce_init_locked (struct bce_softc *); -static void bce_init (void *); +static void bce_init (void *); static void bce_mgmt_init_locked (struct bce_softc *sc); -static int bce_init_ctx (struct bce_softc *); +static int bce_init_ctx (struct bce_softc *); static void bce_get_mac_addr (struct bce_softc *); static void bce_set_mac_addr (struct bce_softc *); -static void bce_phy_intr (struct bce_softc *); +static void bce_phy_intr (struct bce_softc *); static inline u16 bce_get_hw_rx_cons (struct bce_softc *); static void bce_rx_intr (struct bce_softc *); static void bce_tx_intr (struct bce_softc *); static void bce_disable_intr (struct bce_softc *); static void bce_enable_intr (struct bce_softc *, int); -static void bce_intr (void *); +static void bce_intr (void *); static void bce_set_rx_mode (struct bce_softc *); static void bce_stats_update (struct bce_softc *); -static void bce_tick (void *); -static void bce_pulse (void *); +static void bce_tick (void *); +static void bce_pulse (void *); static void bce_add_sysctls (struct bce_softc *); @@ -499,23 +492,148 @@ DRIVER_MODULE(miibus, bce, miibus_driver SYSCTL_NODE(_hw, OID_AUTO, bce, CTLFLAG_RD, 0, "bce driver parameters"); /* Allowable values are TRUE or FALSE */ +static int bce_verbose = TRUE; +TUNABLE_INT("hw.bce.verbose", &bce_verbose); +SYSCTL_INT(_hw_bce, OID_AUTO, verbose, CTLFLAG_RDTUN, &bce_verbose, 0, + "Verbose output enable/disable"); + +/* Allowable values are TRUE or FALSE */ static int bce_tso_enable = TRUE; TUNABLE_INT("hw.bce.tso_enable", &bce_tso_enable); SYSCTL_UINT(_hw_bce, OID_AUTO, tso_enable, CTLFLAG_RDTUN, &bce_tso_enable, 0, -"TSO Enable/Disable"); + "TSO Enable/Disable"); /* Allowable values are 0 (IRQ), 1 (MSI/IRQ), and 2 (MSI-X/MSI/IRQ) */ /* ToDo: Add MSI-X support. */ static int bce_msi_enable = 1; TUNABLE_INT("hw.bce.msi_enable", &bce_msi_enable); SYSCTL_UINT(_hw_bce, OID_AUTO, msi_enable, CTLFLAG_RDTUN, &bce_msi_enable, 0, -"MSI-X|MSI|INTx selector"); + "MSI-X|MSI|INTx selector"); + +/* Allowable values are 1, 2, 4, 8. */ +static int bce_rx_pages = DEFAULT_RX_PAGES; +TUNABLE_INT("hw.bce.rx_pages", &bce_rx_pages); +SYSCTL_UINT(_hw_bce, OID_AUTO, rx_pages, CTLFLAG_RDTUN, &bce_rx_pages, 0, + "Receive buffer descriptor pages (1 page = 255 buffer descriptors)"); + +/* Allowable values are 1, 2, 4, 8. */ +static int bce_tx_pages = DEFAULT_TX_PAGES; +TUNABLE_INT("hw.bce.tx_pages", &bce_tx_pages); +SYSCTL_UINT(_hw_bce, OID_AUTO, tx_pages, CTLFLAG_RDTUN, &bce_tx_pages, 0, + "Transmit buffer descriptor pages (1 page = 255 buffer descriptors)"); + +/* Allowable values are TRUE or FALSE. */ +static int bce_hdr_split = TRUE; +TUNABLE_INT("hw.bce.hdr_split", &bce_hdr_split); +SYSCTL_UINT(_hw_bce, OID_AUTO, hdr_split, CTLFLAG_RDTUN, &bce_hdr_split, 0, + "Frame header/payload splitting Enable/Disable"); + +/* Allowable values are TRUE or FALSE. */ +static int bce_strict_rx_mtu = FALSE; +TUNABLE_INT("hw.bce.strict_rx_mtu", &bce_strict_rx_mtu); +SYSCTL_UINT(_hw_bce, OID_AUTO, loose_rx_mtu, CTLFLAG_RDTUN, + &bce_strict_rx_mtu, 0, + "Enable/Disable strict RX frame size checking"); -/* ToDo: Add tunable to enable/disable strict MTU handling. */ -/* Currently allows "loose" RX MTU checking (i.e. sets the */ -/* H/W RX MTU to the size of the largest receive buffer, or */ -/* 2048 bytes). This will cause a UNH failure but is more */ -/* desireable from a functional perspective. */ +/* Allowable values are 0 ... 100 */ +#ifdef BCE_DEBUG +/* Generate 1 interrupt for every transmit completion. */ +static int bce_tx_quick_cons_trip_int = 1; +#else +/* Generate 1 interrupt for every 20 transmit completions. */ +static int bce_tx_quick_cons_trip_int = DEFAULT_TX_QUICK_CONS_TRIP_INT; +#endif +TUNABLE_INT("hw.bce.tx_quick_cons_trip_int", &bce_tx_quick_cons_trip_int); +SYSCTL_UINT(_hw_bce, OID_AUTO, tx_quick_cons_trip_int, CTLFLAG_RDTUN, + &bce_tx_quick_cons_trip_int, 0, + "Transmit BD trip point during interrupts"); + +/* Allowable values are 0 ... 100 */ +/* Generate 1 interrupt for every transmit completion. */ +#ifdef BCE_DEBUG +static int bce_tx_quick_cons_trip = 1; +#else +/* Generate 1 interrupt for every 20 transmit completions. */ +static int bce_tx_quick_cons_trip = DEFAULT_TX_QUICK_CONS_TRIP; +#endif +TUNABLE_INT("hw.bce.tx_quick_cons_trip", &bce_tx_quick_cons_trip); +SYSCTL_UINT(_hw_bce, OID_AUTO, tx_quick_cons_trip, CTLFLAG_RDTUN, + &bce_tx_quick_cons_trip, 0, + "Transmit BD trip point"); + +/* Allowable values are 0 ... 100 */ +#ifdef BCE_DEBUG +/* Generate an interrupt if 0us have elapsed since the last TX completion. */ +static int bce_tx_ticks_int = 0; +#else +/* Generate an interrupt if 80us have elapsed since the last TX completion. */ +static int bce_tx_ticks_int = DEFAULT_TX_TICKS_INT; +#endif +TUNABLE_INT("hw.bce.tx_ticks_int", &bce_tx_ticks_int); +SYSCTL_UINT(_hw_bce, OID_AUTO, tx_ticks_int, CTLFLAG_RDTUN, + &bce_tx_ticks_int, 0, "Transmit ticks count during interrupt"); + +/* Allowable values are 0 ... 100 */ +#ifdef BCE_DEBUG +/* Generate an interrupt if 0us have elapsed since the last TX completion. */ +static int bce_tx_ticks = 0; +#else +/* Generate an interrupt if 80us have elapsed since the last TX completion. */ +static int bce_tx_ticks = DEFAULT_TX_TICKS; +#endif +TUNABLE_INT("hw.bce.tx_ticks", &bce_tx_ticks); +SYSCTL_UINT(_hw_bce, OID_AUTO, tx_ticks, CTLFLAG_RDTUN, + &bce_tx_ticks, 0, "Transmit ticks count"); + +/* Allowable values are 1 ... 100 */ +#ifdef BCE_DEBUG +/* Generate 1 interrupt for every received frame. */ +static int bce_rx_quick_cons_trip_int = 1; +#else +/* Generate 1 interrupt for every 6 received frames. */ +static int bce_rx_quick_cons_trip_int = DEFAULT_RX_QUICK_CONS_TRIP_INT; +#endif +TUNABLE_INT("hw.bce.rx_quick_cons_trip_int", &bce_rx_quick_cons_trip_int); +SYSCTL_UINT(_hw_bce, OID_AUTO, rx_quick_cons_trip_int, CTLFLAG_RDTUN, + &bce_rx_quick_cons_trip_int, 0, + "Receive BD trip point duirng interrupts"); + +/* Allowable values are 1 ... 100 */ +#ifdef BCE_DEBUG +/* Generate 1 interrupt for every received frame. */ +static int bce_rx_quick_cons_trip = 1; +#else +/* Generate 1 interrupt for every 6 received frames. */ +static int bce_rx_quick_cons_trip = DEFAULT_RX_QUICK_CONS_TRIP; +#endif +TUNABLE_INT("hw.bce.rx_quick_cons_trip", &bce_rx_quick_cons_trip); +SYSCTL_UINT(_hw_bce, OID_AUTO, rx_quick_cons_trip, CTLFLAG_RDTUN, + &bce_rx_quick_cons_trip, 0, + "Receive BD trip point"); + +/* Allowable values are 0 ... 100 */ +#ifdef BCE_DEBUG +/* Generate an int. if 0us have elapsed since the last received frame. */ +static int bce_rx_ticks_int = 0; +#else +/* Generate an int. if 18us have elapsed since the last received frame. */ +static int bce_rx_ticks_int = DEFAULT_RX_TICKS_INT; +#endif +TUNABLE_INT("hw.bce.rx_ticks_int", &bce_rx_ticks_int); +SYSCTL_UINT(_hw_bce, OID_AUTO, rx_ticks_int, CTLFLAG_RDTUN, + &bce_rx_ticks_int, 0, "Receive ticks count during interrupt"); + +/* Allowable values are 0 ... 100 */ +#ifdef BCE_DEBUG +/* Generate an int. if 0us have elapsed since the last received frame. */ +static int bce_rx_ticks = 0; +#else +/* Generate an int. if 18us have elapsed since the last received frame. */ +static int bce_rx_ticks = DEFAULT_RX_TICKS; +#endif +TUNABLE_INT("hw.bce.rx_ticks", &bce_rx_ticks); +SYSCTL_UINT(_hw_bce, OID_AUTO, rx_ticks, CTLFLAG_RDTUN, + &bce_rx_ticks, 0, "Receive ticks count"); /****************************************************************************/ @@ -597,7 +715,7 @@ bce_print_adapter_info(struct bce_softc DBENTER(BCE_VERBOSE_LOAD); - if (bootverbose) { + if (bce_verbose || bootverbose) { BCE_PRINTF("ASIC (0x%08X); ", sc->bce_chipid); printf("Rev (%c%d); ", ((BCE_CHIP_ID(sc) & 0xf000) >> 12) + 'A', ((BCE_CHIP_ID(sc) & 0x0ff0) >> 4)); @@ -619,12 +737,14 @@ bce_print_adapter_info(struct bce_softc } /* Firmware version and device features. */ - printf("B/C (%s); Flags (", sc->bce_bc_ver); + printf("B/C (%s); Bufs (RX:%d;TX:%d;PG:%d); Flags (", + sc->bce_bc_ver, sc->rx_pages, sc->tx_pages, + (bce_hdr_split == TRUE ? sc->pg_pages: 0)); - #ifdef BCE_JUMBO_HDRSPLIT - printf("SPLT"); - i++; - #endif + if (bce_hdr_split == TRUE) { + printf("SPLT"); + i++; + } if (sc->bce_flags & BCE_USING_MSI_FLAG) { if (i > 0) printf("|"); @@ -647,6 +767,17 @@ bce_print_adapter_info(struct bce_softc } else { printf(")\n"); } + + printf("Coal (RX:%d,%d,%d,%d; TX:%d,%d,%d,%d)\n", + sc->bce_rx_quick_cons_trip_int, + sc->bce_rx_quick_cons_trip, + sc->bce_rx_ticks_int, + sc->bce_rx_ticks, + sc->bce_tx_quick_cons_trip_int, + sc->bce_tx_quick_cons_trip, + sc->bce_tx_ticks_int, + sc->bce_tx_ticks); + } DBEXIT(BCE_VERBOSE_LOAD); @@ -705,6 +836,189 @@ bce_probe_pci_caps(device_t dev, struct /****************************************************************************/ +/* Load and validate user tunable settings. */ +/* */ +/* Returns: */ +/* Nothing. */ +/****************************************************************************/ +static void +bce_set_tunables(struct bce_softc *sc) +{ + /* Set sysctl values for RX page count. */ + switch (bce_rx_pages) { + case 1: + /* fall-through */ + case 2: + /* fall-through */ + case 4: + /* fall-through */ + case 8: + sc->rx_pages = bce_rx_pages; + break; + default: + sc->rx_pages = DEFAULT_RX_PAGES; + BCE_PRINTF("%s(%d): Illegal value (%d) specified for " + "hw.bce.rx_pages! Setting default of %d.\n", + __FILE__, __LINE__, bce_rx_pages, DEFAULT_RX_PAGES); + } + + /* ToDo: Consider allowing user setting for pg_pages. */ + sc->pg_pages = min((sc->rx_pages * 4), MAX_PG_PAGES); + + /* Set sysctl values for TX page count. */ + switch (bce_tx_pages) { + case 1: + /* fall-through */ + case 2: + /* fall-through */ + case 4: + /* fall-through */ + case 8: + sc->tx_pages = bce_tx_pages; + break; + default: + sc->tx_pages = DEFAULT_TX_PAGES; + BCE_PRINTF("%s(%d): Illegal value (%d) specified for " + "hw.bce.tx_pages! Setting default of %d.\n", + __FILE__, __LINE__, bce_tx_pages, DEFAULT_TX_PAGES); + } + + /* + * Validate the TX trip point (i.e. the number of + * TX completions before a status block update is + * generated and an interrupt is asserted. + */ + if (bce_tx_quick_cons_trip_int <= 100) { + sc->bce_tx_quick_cons_trip_int = + bce_tx_quick_cons_trip_int; + } else { + BCE_PRINTF("%s(%d): Illegal value (%d) specified for " + "hw.bce.tx_quick_cons_trip_int! Setting default of %d.\n", + __FILE__, __LINE__, bce_tx_quick_cons_trip_int, + DEFAULT_TX_QUICK_CONS_TRIP_INT); + sc->bce_tx_quick_cons_trip_int = + DEFAULT_TX_QUICK_CONS_TRIP_INT; + } + + if (bce_tx_quick_cons_trip <= 100) { + sc->bce_tx_quick_cons_trip = + bce_tx_quick_cons_trip; + } else { + BCE_PRINTF("%s(%d): Illegal value (%d) specified for " + "hw.bce.tx_quick_cons_trip! Setting default of %d.\n", + __FILE__, __LINE__, bce_tx_quick_cons_trip, + DEFAULT_TX_QUICK_CONS_TRIP); + sc->bce_tx_quick_cons_trip = + DEFAULT_TX_QUICK_CONS_TRIP; + } + + /* + * Validate the TX ticks count (i.e. the maximum amount + * of time to wait after the last TX completion has + * occurred before a status block update is generated + * and an interrupt is asserted. + */ + if (bce_tx_ticks_int <= 100) { + sc->bce_tx_ticks_int = + bce_tx_ticks_int; + } else { + BCE_PRINTF("%s(%d): Illegal value (%d) specified for " + "hw.bce.tx_ticks_int! Setting default of %d.\n", + __FILE__, __LINE__, bce_tx_ticks_int, + DEFAULT_TX_TICKS_INT); + sc->bce_tx_ticks_int = + DEFAULT_TX_TICKS_INT; + } + + if (bce_tx_ticks <= 100) { + sc->bce_tx_ticks = + bce_tx_ticks; + } else { + BCE_PRINTF("%s(%d): Illegal value (%d) specified for " + "hw.bce.tx_ticks! Setting default of %d.\n", + __FILE__, __LINE__, bce_tx_ticks, + DEFAULT_TX_TICKS); + sc->bce_tx_ticks = + DEFAULT_TX_TICKS; + } + + /* + * Validate the RX trip point (i.e. the number of + * RX frames received before a status block update is + * generated and an interrupt is asserted. + */ + if (bce_rx_quick_cons_trip_int <= 100) { + sc->bce_rx_quick_cons_trip_int = + bce_rx_quick_cons_trip_int; + } else { + BCE_PRINTF("%s(%d): Illegal value (%d) specified for " + "hw.bce.rx_quick_cons_trip_int! Setting default of %d.\n", + __FILE__, __LINE__, bce_rx_quick_cons_trip_int, + DEFAULT_RX_QUICK_CONS_TRIP_INT); + sc->bce_rx_quick_cons_trip_int = + DEFAULT_RX_QUICK_CONS_TRIP_INT; + } + + if (bce_rx_quick_cons_trip <= 100) { + sc->bce_rx_quick_cons_trip = + bce_rx_quick_cons_trip; + } else { + BCE_PRINTF("%s(%d): Illegal value (%d) specified for " + "hw.bce.rx_quick_cons_trip! Setting default of %d.\n", + __FILE__, __LINE__, bce_rx_quick_cons_trip, + DEFAULT_RX_QUICK_CONS_TRIP); + sc->bce_rx_quick_cons_trip = + DEFAULT_RX_QUICK_CONS_TRIP; + } + + /* + * Validate the RX ticks count (i.e. the maximum amount + * of time to wait after the last RX frame has been + * received before a status block update is generated + * and an interrupt is asserted. + */ + if (bce_rx_ticks_int <= 100) { + sc->bce_rx_ticks_int = bce_rx_ticks_int; + } else { + BCE_PRINTF("%s(%d): Illegal value (%d) specified for " + "hw.bce.rx_ticks_int! Setting default of %d.\n", + __FILE__, __LINE__, bce_rx_ticks_int, + DEFAULT_RX_TICKS_INT); + sc->bce_rx_ticks_int = DEFAULT_RX_TICKS_INT; + } + + if (bce_rx_ticks <= 100) { + sc->bce_rx_ticks = bce_rx_ticks; + } else { + BCE_PRINTF("%s(%d): Illegal value (%d) specified for " + "hw.bce.rx_ticks! Setting default of %d.\n", + __FILE__, __LINE__, bce_rx_ticks, + DEFAULT_RX_TICKS); + sc->bce_rx_ticks = DEFAULT_RX_TICKS; + } + + /* Disabling both RX ticks and RX trips will prevent interrupts. */ + if ((bce_rx_quick_cons_trip == 0) && (bce_rx_ticks == 0)) { + BCE_PRINTF("%s(%d): Cannot set both hw.bce.rx_ticks and " + "hw.bce.rx_quick_cons_trip to 0. Setting default values.\n", + __FILE__, __LINE__); + sc->bce_rx_ticks = DEFAULT_RX_TICKS; + sc->bce_rx_quick_cons_trip = DEFAULT_RX_QUICK_CONS_TRIP; + } + + /* Disabling both TX ticks and TX trips will prevent interrupts. */ + if ((bce_tx_quick_cons_trip == 0) && (bce_tx_ticks == 0)) { + BCE_PRINTF("%s(%d): Cannot set both hw.bce.tx_ticks and " + "hw.bce.tx_quick_cons_trip to 0. Setting default values.\n", + __FILE__, __LINE__); + sc->bce_tx_ticks = DEFAULT_TX_TICKS; + sc->bce_tx_quick_cons_trip = DEFAULT_TX_QUICK_CONS_TRIP; + } + +} + + +/****************************************************************************/ /* Device attach function. */ /* */ /* Allocates device resources, performs secondary chip identification, */ @@ -733,6 +1047,8 @@ bce_attach(device_t dev) sc->bce_flags = 0; sc->bce_phy_flags = 0; + bce_set_tunables(sc); + pci_enable_busmaster(dev); /* Allocate PCI memory resources. */ @@ -1021,37 +1337,13 @@ bce_attach(device_t dev) * values for the RX and TX chains. */ -#ifdef BCE_DEBUG - /* Force more frequent interrupts. */ - sc->bce_tx_quick_cons_trip_int = 1; - sc->bce_tx_quick_cons_trip = 1; - sc->bce_tx_ticks_int = 0; - sc->bce_tx_ticks = 0; - - sc->bce_rx_quick_cons_trip_int = 1; - sc->bce_rx_quick_cons_trip = 1; - sc->bce_rx_ticks_int = 0; - sc->bce_rx_ticks = 0; -#else - /* Improve throughput at the expense of increased latency. */ - sc->bce_tx_quick_cons_trip_int = 20; - sc->bce_tx_quick_cons_trip = 20; - sc->bce_tx_ticks_int = 80; - sc->bce_tx_ticks = 80; - - sc->bce_rx_quick_cons_trip_int = 6; - sc->bce_rx_quick_cons_trip = 6; - sc->bce_rx_ticks_int = 18; - sc->bce_rx_ticks = 18; -#endif - /* Not used for L2. */ - sc->bce_comp_prod_trip_int = 0; - sc->bce_comp_prod_trip = 0; - sc->bce_com_ticks_int = 0; - sc->bce_com_ticks = 0; - sc->bce_cmd_ticks_int = 0; - sc->bce_cmd_ticks = 0; + sc->bce_comp_prod_trip_int = 0; + sc->bce_comp_prod_trip = 0; + sc->bce_com_ticks_int = 0; + sc->bce_com_ticks = 0; + sc->bce_cmd_ticks_int = 0; + sc->bce_cmd_ticks = 0; /* Update statistics once every second. */ sc->bce_stats_ticks = 1000000 & 0xffff00; @@ -1105,23 +1397,11 @@ bce_attach(device_t dev) * This may change later if the MTU size is set to * something other than 1500. */ -#ifdef BCE_JUMBO_HDRSPLIT - sc->rx_bd_mbuf_alloc_size = MHLEN; - /* Make sure offset is 16 byte aligned for hardware. */ - sc->rx_bd_mbuf_align_pad = - roundup2((MSIZE - MHLEN), 16) - (MSIZE - MHLEN); - sc->rx_bd_mbuf_data_len = sc->rx_bd_mbuf_alloc_size - - sc->rx_bd_mbuf_align_pad; - sc->pg_bd_mbuf_alloc_size = MCLBYTES; -#else - sc->rx_bd_mbuf_alloc_size = MCLBYTES; - sc->rx_bd_mbuf_align_pad = - roundup2(MCLBYTES, 16) - MCLBYTES; - sc->rx_bd_mbuf_data_len = sc->rx_bd_mbuf_alloc_size - - sc->rx_bd_mbuf_align_pad; -#endif + bce_get_rx_buffer_sizes(sc, + (ETHER_MAX_LEN - ETHER_HDR_LEN - ETHER_CRC_LEN)); - ifp->if_snd.ifq_drv_maxlen = USABLE_TX_BD; + /* Recalculate our buffer allocation sizes. */ + ifp->if_snd.ifq_drv_maxlen = USABLE_TX_BD_ALLOC; IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); IFQ_SET_READY(&ifp->if_snd); @@ -2594,9 +2874,9 @@ bce_nvram_write(struct bce_softc *sc, u3 goto bce_nvram_write_exit; bce_nvram_write_locked_exit: - bce_disable_nvram_write(sc); - bce_disable_nvram_access(sc); - bce_release_nvram_lock(sc); + bce_disable_nvram_write(sc); + bce_disable_nvram_access(sc); + bce_release_nvram_lock(sc); bce_nvram_write_exit: if (align_start || align_end) @@ -2641,7 +2921,7 @@ bce_nvram_test(struct bce_softc *sc) * Verify that offset 0 of the NVRAM contains * a valid magic number. */ - magic = bce_be32toh(buf[0]); + magic = bce_be32toh(buf[0]); if (magic != BCE_NVRAM_MAGIC) { rc = ENODEV; BCE_PRINTF("%s(%d): Invalid NVRAM magic value! " @@ -2685,6 +2965,58 @@ bce_nvram_test_exit: /****************************************************************************/ +/* Calculates the size of the buffers to allocate based on the MTU. */ +/* */ +/* Returns: */ +/* Nothing. */ +/****************************************************************************/ +static void +bce_get_rx_buffer_sizes(struct bce_softc *sc, int mtu) +{ + DBENTER(BCE_VERBOSE_LOAD); + + /* Use a single allocation type when header splitting enabled. */ + if (bce_hdr_split == TRUE) { + sc->rx_bd_mbuf_alloc_size = MHLEN; + /* Make sure offset is 16 byte aligned for hardware. */ + sc->rx_bd_mbuf_align_pad = + roundup2((MSIZE - MHLEN), 16) - (MSIZE - MHLEN); + sc->rx_bd_mbuf_data_len = sc->rx_bd_mbuf_alloc_size - + sc->rx_bd_mbuf_align_pad; + sc->pg_bd_mbuf_alloc_size = MCLBYTES; + } else { + if ((mtu + ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN + + ETHER_CRC_LEN) > MCLBYTES) { + /* Setup for jumbo RX buffer allocations. */ + sc->rx_bd_mbuf_alloc_size = MJUM9BYTES; + sc->rx_bd_mbuf_align_pad = + roundup2(MJUM9BYTES, 16) - MJUM9BYTES; + sc->rx_bd_mbuf_data_len = + sc->rx_bd_mbuf_alloc_size - + sc->rx_bd_mbuf_align_pad; + } else { + /* Setup for standard RX buffer allocations. */ + sc->rx_bd_mbuf_alloc_size = MCLBYTES; + sc->rx_bd_mbuf_align_pad = + roundup2(MCLBYTES, 16) - MCLBYTES; + sc->rx_bd_mbuf_data_len = + sc->rx_bd_mbuf_alloc_size - + sc->rx_bd_mbuf_align_pad; + } + } + +// DBPRINT(sc, BCE_INFO_LOAD, + DBPRINT(sc, BCE_WARN, + "%s(): rx_bd_mbuf_alloc_size = %d, rx_bd_mbuf_data_len = %d, " + "rx_bd_mbuf_align_pad = %d\n", __FUNCTION__, + sc->rx_bd_mbuf_alloc_size, sc->rx_bd_mbuf_data_len, + sc->rx_bd_mbuf_align_pad); + + DBEXIT(BCE_VERBOSE_LOAD); + +} + +/****************************************************************************/ /* Identifies the current media type of the controller and sets the PHY */ /* address. */ /* */ @@ -2918,7 +3250,7 @@ bce_dma_free(struct bce_softc *sc) /* Free, unmap and destroy all TX buffer descriptor chain pages. */ - for (i = 0; i < TX_PAGES; i++ ) { + for (i = 0; i < sc->tx_pages; i++ ) { if (sc->tx_bd_chain[i] != NULL) { bus_dmamem_free( sc->tx_bd_chain_tag, @@ -2946,7 +3278,7 @@ bce_dma_free(struct bce_softc *sc) /* Free, unmap and destroy all RX buffer descriptor chain pages. */ - for (i = 0; i < RX_PAGES; i++ ) { + for (i = 0; i < sc->rx_pages; i++ ) { if (sc->rx_bd_chain[i] != NULL) { bus_dmamem_free( sc->rx_bd_chain_tag, @@ -2973,38 +3305,38 @@ bce_dma_free(struct bce_softc *sc) } -#ifdef BCE_JUMBO_HDRSPLIT /* Free, unmap and destroy all page buffer descriptor chain pages. */ - for (i = 0; i < PG_PAGES; i++ ) { - if (sc->pg_bd_chain[i] != NULL) { - bus_dmamem_free( - sc->pg_bd_chain_tag, - sc->pg_bd_chain[i], - sc->pg_bd_chain_map[i]); - sc->pg_bd_chain[i] = NULL; - } + if (bce_hdr_split == TRUE) { + for (i = 0; i < sc->pg_pages; i++ ) { + if (sc->pg_bd_chain[i] != NULL) { + bus_dmamem_free( + sc->pg_bd_chain_tag, + sc->pg_bd_chain[i], + sc->pg_bd_chain_map[i]); + sc->pg_bd_chain[i] = NULL; + } - if (sc->pg_bd_chain_map[i] != NULL) { - bus_dmamap_unload( - sc->pg_bd_chain_tag, - sc->pg_bd_chain_map[i]); - bus_dmamap_destroy( - sc->pg_bd_chain_tag, - sc->pg_bd_chain_map[i]); - sc->pg_bd_chain_map[i] = NULL; + if (sc->pg_bd_chain_map[i] != NULL) { + bus_dmamap_unload( + sc->pg_bd_chain_tag, + sc->pg_bd_chain_map[i]); + bus_dmamap_destroy( + sc->pg_bd_chain_tag, + sc->pg_bd_chain_map[i]); + sc->pg_bd_chain_map[i] = NULL; + } } - } - /* Destroy the page buffer descriptor tag. */ - if (sc->pg_bd_chain_tag != NULL) { - bus_dma_tag_destroy(sc->pg_bd_chain_tag); - sc->pg_bd_chain_tag = NULL; + /* Destroy the page buffer descriptor tag. */ + if (sc->pg_bd_chain_tag != NULL) { + bus_dma_tag_destroy(sc->pg_bd_chain_tag); + sc->pg_bd_chain_tag = NULL; + } } -#endif /* Unload and destroy the TX mbuf maps. */ - for (i = 0; i < TOTAL_TX_BD; i++) { + for (i = 0; i < MAX_TX_BD_AVAIL; i++) { if (sc->tx_mbuf_map[i] != NULL) { bus_dmamap_unload(sc->tx_mbuf_tag, sc->tx_mbuf_map[i]); @@ -3021,7 +3353,7 @@ bce_dma_free(struct bce_softc *sc) } /* Unload and destroy the RX mbuf maps. */ - for (i = 0; i < TOTAL_RX_BD; i++) { + for (i = 0; i < MAX_RX_BD_AVAIL; i++) { if (sc->rx_mbuf_map[i] != NULL) { bus_dmamap_unload(sc->rx_mbuf_tag, sc->rx_mbuf_map[i]); @@ -3037,24 +3369,24 @@ bce_dma_free(struct bce_softc *sc) sc->rx_mbuf_tag = NULL; } -#ifdef BCE_JUMBO_HDRSPLIT /* Unload and destroy the page mbuf maps. */ - for (i = 0; i < TOTAL_PG_BD; i++) { - if (sc->pg_mbuf_map[i] != NULL) { - bus_dmamap_unload(sc->pg_mbuf_tag, - sc->pg_mbuf_map[i]); - bus_dmamap_destroy(sc->pg_mbuf_tag, - sc->pg_mbuf_map[i]); - sc->pg_mbuf_map[i] = NULL; + if (bce_hdr_split == TRUE) { + for (i = 0; i < MAX_PG_BD_AVAIL; i++) { + if (sc->pg_mbuf_map[i] != NULL) { + bus_dmamap_unload(sc->pg_mbuf_tag, + sc->pg_mbuf_map[i]); + bus_dmamap_destroy(sc->pg_mbuf_tag, + sc->pg_mbuf_map[i]); + sc->pg_mbuf_map[i] = NULL; + } } - } - /* Destroy the page mbuf tag. */ - if (sc->pg_mbuf_tag != NULL) { - bus_dma_tag_destroy(sc->pg_mbuf_tag); - sc->pg_mbuf_tag = NULL; + /* Destroy the page mbuf tag. */ + if (sc->pg_mbuf_tag != NULL) { + bus_dma_tag_destroy(sc->pg_mbuf_tag); + sc->pg_mbuf_tag = NULL; + } } -#endif /* Destroy the parent tag */ if (sc->parent_tag != NULL) { @@ -3296,7 +3628,7 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - for (i = 0; i < TX_PAGES; i++) { + for (i = 0; i < sc->tx_pages; i++) { if(bus_dmamem_alloc(sc->tx_bd_chain_tag, (void **)&sc->tx_bd_chain[i], @@ -3347,7 +3679,7 @@ bce_dma_alloc(device_t dev) } /* Create DMA maps for the TX mbufs clusters. */ - for (i = 0; i < TOTAL_TX_BD; i++) { + for (i = 0; i < TOTAL_TX_BD_ALLOC; i++) { if (bus_dmamap_create(sc->tx_mbuf_tag, BUS_DMA_NOWAIT, &sc->tx_mbuf_map[i])) { BCE_PRINTF("%s(%d): Unable to create TX mbuf DMA " @@ -3373,7 +3705,7 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - for (i = 0; i < RX_PAGES; i++) { + for (i = 0; i < sc->rx_pages; i++) { if (bus_dmamem_alloc(sc->rx_bd_chain_tag, (void **)&sc->rx_bd_chain[i], @@ -3405,12 +3737,11 @@ bce_dma_alloc(device_t dev) /* * Create a DMA tag for RX mbufs. */ -#ifdef BCE_JUMBO_HDRSPLIT - max_size = max_seg_size = ((sc->rx_bd_mbuf_alloc_size < MCLBYTES) ? - MCLBYTES : sc->rx_bd_mbuf_alloc_size); -#else - max_size = max_seg_size = MJUM9BYTES; -#endif + if (bce_hdr_split == TRUE) + max_size = max_seg_size = ((sc->rx_bd_mbuf_alloc_size < MCLBYTES) ? + MCLBYTES : sc->rx_bd_mbuf_alloc_size); + else + max_size = max_seg_size = MJUM9BYTES; max_segments = 1; DBPRINT(sc, BCE_INFO_LOAD, "%s(): Creating rx_mbuf_tag " @@ -3429,7 +3760,7 @@ bce_dma_alloc(device_t dev) } /* Create DMA maps for the RX mbuf clusters. */ - for (i = 0; i < TOTAL_RX_BD; i++) { + for (i = 0; i < TOTAL_RX_BD_ALLOC; i++) { if (bus_dmamap_create(sc->rx_mbuf_tag, BUS_DMA_NOWAIT, &sc->rx_mbuf_map[i])) { BCE_PRINTF("%s(%d): Unable to create RX mbuf " @@ -3439,78 +3770,77 @@ bce_dma_alloc(device_t dev) } } -#ifdef BCE_JUMBO_HDRSPLIT - /* - * Create a DMA tag for the page buffer descriptor chain, - * allocate and clear the memory, and fetch the physical - * address of the blocks. - */ - if (bus_dma_tag_create(sc->parent_tag, BCM_PAGE_SIZE, - BCE_DMA_BOUNDARY, BUS_SPACE_MAXADDR, sc->max_bus_addr, - NULL, NULL, BCE_PG_CHAIN_PAGE_SZ, 1, BCE_PG_CHAIN_PAGE_SZ, - 0, NULL, NULL, &sc->pg_bd_chain_tag)) { - BCE_PRINTF("%s(%d): Could not allocate page descriptor " - "chain DMA tag!\n", __FILE__, __LINE__); - rc = ENOMEM; - goto bce_dma_alloc_exit; - } - - for (i = 0; i < PG_PAGES; i++) { - - if (bus_dmamem_alloc(sc->pg_bd_chain_tag, - (void **)&sc->pg_bd_chain[i], - BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_COHERENT, - &sc->pg_bd_chain_map[i])) { - BCE_PRINTF("%s(%d): Could not allocate page " - "descriptor chain DMA memory!\n", - __FILE__, __LINE__); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 18:46:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B7CE106564A; Mon, 9 Jan 2012 18:46:03 +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 59FF08FC22; Mon, 9 Jan 2012 18:46:03 +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 q09Ik3fh053100; Mon, 9 Jan 2012 18:46:03 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q09Ik3eo053098; Mon, 9 Jan 2012 18:46:03 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201091846.q09Ik3eo053098@svn.freebsd.org> From: John Baldwin Date: Mon, 9 Jan 2012 18:46:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229861 - stable/8/sys/fs/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 18:46:03 -0000 Author: jhb Date: Mon Jan 9 18:46:03 2012 New Revision: 229861 URL: http://svn.freebsd.org/changeset/base/229861 Log: The sysctls for the new NFS server on stable/8 live under vfs.newnfs rather than vfs.nfsd. Modified: stable/8/sys/fs/nfsserver/nfs_nfsdsubs.c Modified: stable/8/sys/fs/nfsserver/nfs_nfsdsubs.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdsubs.c Mon Jan 9 18:33:54 2012 (r229860) +++ stable/8/sys/fs/nfsserver/nfs_nfsdsubs.c Mon Jan 9 18:46:03 2012 (r229861) @@ -56,10 +56,10 @@ static nfstype newnfsv2_type[9] = { NFNO extern nfstype nfsv34_type[9]; #endif /* !APPLEKEXT */ -SYSCTL_DECL(_vfs_nfsd); +SYSCTL_DECL(_vfs_newnfs); static int disable_checkutf8 = 0; -SYSCTL_INT(_vfs_nfsd, OID_AUTO, disable_checkutf8, CTLFLAG_RW, +SYSCTL_INT(_vfs_newnfs, OID_AUTO, disable_checkutf8, CTLFLAG_RW, &disable_checkutf8, 0, "Disable the NFSv4 check for a UTF8 compliant name"); From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 18:52:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E74D71065670; Mon, 9 Jan 2012 18:52:47 +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 D31918FC12; Mon, 9 Jan 2012 18:52: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 q09IqlxP053337; Mon, 9 Jan 2012 18:52:47 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q09Iqlgv053335; Mon, 9 Jan 2012 18:52:47 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201201091852.q09Iqlgv053335@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 9 Jan 2012 18:52:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229862 - stable/8/sys/dev/bce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 18:52:48 -0000 Author: yongari Date: Mon Jan 9 18:52:47 2012 New Revision: 229862 URL: http://svn.freebsd.org/changeset/base/229862 Log: MFC r218529: - Updated firmware which improves small packet performance. Modified: stable/8/sys/dev/bce/if_bcefw.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/bce/if_bcefw.h ============================================================================== --- stable/8/sys/dev/bce/if_bcefw.h Mon Jan 9 18:46:03 2012 (r229861) +++ stable/8/sys/dev/bce/if_bcefw.h Mon Jan 9 18:52:47 2012 (r229862) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2006-2010 Broadcom Corporation + * Copyright (c) 2006-2011 Broadcom Corporation * David Christensen . All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -31,1310 +31,1254 @@ /* * This file contains firmware data derived from proprietary unpublished - * source code, Copyright (c) 2004, 2005, 2007, 2008 Broadcom Corporation. + * source code, Copyright (c) 2004-2011 Broadcom Corporation. * * Permission is hereby granted for the distribution of this firmware data - * in hexadecimal or equivalent format, provided this copyright notice is - * accompanying it. + * in hexadecimal or equivalent format, provided this copyright notice also + * accompanies it. */ -/* Firmware release 4.6.17 for BCM5706 and BCM5708 (b06). */ -/* Firmware release 4.6.16 for BCM5709 and BCM5716 (b09). */ -int bce_COM_b06FwReleaseMajor = 0x1; -int bce_COM_b06FwReleaseMinor = 0x0; -int bce_COM_b06FwReleaseFix = 0x0; -u32 bce_COM_b06FwStartAddr = 0x080000f8; -u32 bce_COM_b06FwTextAddr = 0x08000000; -int bce_COM_b06FwTextLen = 0x4df0; -u32 bce_COM_b06FwDataAddr = 0x00000000; -int bce_COM_b06FwDataLen = 0x0; -u32 bce_COM_b06FwRodataAddr = 0x08004df0; -int bce_COM_b06FwRodataLen = 0x14; -u32 bce_COM_b06FwBssAddr = 0x08004e58; -int bce_COM_b06FwBssLen = 0xbc; -u32 bce_COM_b06FwSbssAddr = 0x08004e20; -int bce_COM_b06FwSbssLen = 0x38; -u32 bce_COM_b06FwSDataAddr = 0x00000000; -int bce_COM_b06FwSDataLen = 0x0; -u32 bce_COM_b06FwText[(0x4df0/4) + 1] = { -0xa00003e, 0x0, 0x0, -0xd, 0x636f6d34, 0x2e362e31, 0x37000000, -0x4061102, 0x0, 0x3, 0x14, -0x32, 0x3, 0x0, 0x0, -0x0, 0x0, 0x0, 0x10, -0x136, 0xea60, 0x1, 0x0, -0x0, 0x0, 0x8, 0x0, -0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x2, -0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, -0x0, 0x10, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, -0x10000003, 0x0, 0xd, 0xd, -0x3c020800, 0x24424e20, 0x3c030800, 0x24634f14, -0xac400000, 0x43202b, 0x1480fffd, 0x24420004, -0x3c1d0800, 0x37bd7ffc, 0x3a0f021, 0x3c100800, -0x261000f8, 0x3c1c0800, 0x279c4e20, 0xe0002bd, -0x0, 0xd, 0x3c036010, 0x8c645000, -0x2402ff7f, 0x3c1a8000, 0x822024, 0x3484380c, -0x24020037, 0xac645000, 0xaf420008, 0x24020c80, -0xaf420024, 0x3c1b8008, 0x3c060800, 0x24c607e8, -0x3c020800, 0x24424e58, 0x2404001b, 0x2484ffff, -0xac460000, 0x481fffd, 0x24420004, 0x3c020800, -0x24420380, 0x3c010800, 0xac224e60, 0x3c020800, -0x24420680, 0x3c010800, 0xac224e64, 0x3c020800, -0x24420dcc, 0x3c010800, 0xac224ea0, 0x3c020800, -0x24420a5c, 0x3c030800, 0x24630954, 0x3c040800, -0x24840990, 0x3c050800, 0x24a53c70, 0x3c010800, -0xac224ea8, 0x3c020800, 0x24420570, 0x3c010800, -0xac264ea4, 0x3c010800, 0xac254eb4, 0x3c010800, -0xac234ebc, 0x3c010800, 0xac224ec0, 0x3c010800, -0xac244ec4, 0x3c010800, 0xac234e5c, 0x3c010800, -0xac204e68, 0x3c010800, 0xac204e6c, 0x3c010800, -0xac204e70, 0x3c010800, 0xac204e74, 0x3c010800, -0xac204e78, 0x3c010800, 0xac204e7c, 0x3c010800, -0xac204e80, 0x3c010800, 0xac244e84, 0x3c010800, -0xac204e88, 0x3c010800, 0xac204e8c, 0x3c010800, -0xac204e90, 0x3c010800, 0xac204e94, 0x3c010800, -0xac204e98, 0x3c010800, 0xac264e9c, 0x3c010800, -0xac204eac, 0x3c010800, 0xac254eb0, 0x3c010800, -0xac234eb8, 0xa000707, 0x0, 0x3c030800, -0x8c630020, 0x8f820008, 0x10430003, 0x0, -0xa00053f, 0xaf830008, 0x3e00008, 0x0, -0x27bdffe8, 0xafb00010, 0xafbf0014, 0x27500100, -0x92020009, 0x1040001a, 0x24030001, 0x3c020800, -0x8c420020, 0x10400016, 0x1821, 0xe000577, -0x0, 0x96030008, 0x3c060800, 0x94c64ed6, -0x8e040018, 0x8f820020, 0x9605000c, 0x31c00, -0x661825, 0xac440000, 0xac450004, 0x24040001, -0xac400008, 0xac40000c, 0xac400010, 0xac400014, -0xac400018, 0xe00059c, 0xac43001c, 0x1821, -0x8fbf0014, 0x8fb00010, 0x601021, 0x3e00008, -0x27bd0018, 0x27bdffe8, 0xafbf0010, 0x97420108, -0x30437000, 0x24022000, 0x1062000a, 0x28642001, -0x54800012, 0x8fbf0010, 0x24024000, 0x10620008, -0x24026000, 0x1062000a, 0x8fbf0010, 0xa0000fb, -0x1021, 0x8fbf0010, 0xa0000bb, 0x27bd0018, -0xe000409, 0x0, 0xa0000fa, 0x8fbf0010, -0xe000fc9, 0x0, 0x8fbf0010, 0x1021, -0x3e00008, 0x27bd0018, 0x3c020800, 0x8c420020, -0x27bdffe8, 0x10400027, 0xafbf0010, 0xe000577, -0x0, 0x97420108, 0x9743010c, 0x8f850020, -0x3042003e, 0x3063ffff, 0x21400, 0x431025, -0xaca20000, 0x8f420100, 0x3c060800, 0x94c64ed6, -0x8fbf0010, 0xaca20004, 0x97430116, 0x9744010e, -0x3c022000, 0x31c00, 0x3084ffff, 0x641825, -0xaca30008, 0xc23025, 0x97420110, 0x97430112, -0x24040001, 0x21400, 0x3063ffff, 0x431025, -0xaca2000c, 0x97420114, 0x27bd0018, 0x3042ffff, -0xaca20010, 0xaca00014, 0xaca00018, 0xa00059c, -0xaca6001c, 0x8fbf0010, 0x3e00008, 0x27bd0018, -0x3c020800, 0x8c420020, 0x27bdffe8, 0x1040002a, -0xafbf0010, 0xe000577, 0x0, 0x97420108, -0x9743010c, 0x8f850020, 0x3042003e, 0x3063ffff, -0x21400, 0x431025, 0xaca20000, 0x8f420100, -0x3c060800, 0x94c64ed6, 0x8fbf0010, 0xaca20004, -0x97430116, 0x9744010e, 0x3c022000, 0x31c00, -0x3084ffff, 0x641825, 0xaca30008, 0xc23025, -0x97420110, 0x97430112, 0x24040001, 0x21400, -0x3063ffff, 0x431025, 0xaca2000c, 0x97420114, -0x27bd0018, 0x3042ffff, 0xaca20010, 0x8f420118, -0xaca20014, 0x9342010b, 0x304200ff, 0xaca20018, -0xa00059c, 0xaca6001c, 0x8fbf0010, 0x3e00008, -0x27bd0018, 0x27bdffe0, 0xafb00010, 0xafbf0018, -0xafb10014, 0x27500100, 0x9203000b, 0x2402001a, -0x96110008, 0x14620035, 0x2021, 0x32220001, -0x10400009, 0x0, 0x8e020000, 0x96030014, -0x211c2, 0x21040, 0x5a1021, 0xa4430080, -0xa000179, 0x32220002, 0xe00012b, 0x0, -0x3c020800, 0x8c420040, 0x24420001, 0x3c010800, -0xac220040, 0x32220002, 0x2202b, 0x3c020800, -0x8c420044, 0x32230004, 0x24420001, 0x3c010800, -0xac220044, 0x1060001a, 0x8fbf0018, 0x8f4202b8, -0x4410008, 0x24040001, 0x3c020800, 0x8c420060, -0x24420001, 0x3c010800, 0xac220060, 0xa00019c, -0x8fb10014, 0x8e020020, 0x96030016, 0x2021, -0xaf420280, 0x8e020004, 0xa7430284, 0xaf420288, -0x3c021000, 0xaf4202b8, 0x3c020800, 0x8c42005c, -0x24420001, 0x3c010800, 0xac22005c, 0x8fbf0018, -0x8fb10014, 0x8fb00010, 0x801021, 0x3e00008, -0x27bd0020, 0x27bdffe0, 0xafb00010, 0xafbf0018, -0xafb10014, 0x27500100, 0x9203000b, 0x24020003, -0x96110008, 0x14620048, 0x2021, 0x32220001, -0x10400008, 0x0, 0x8e020000, 0x96030014, -0x211c2, 0x21040, 0x5a1021, 0xa0001bb, -0xa4430080, 0xe0000fd, 0x0, 0x3c020800, -0x8c420040, 0x24420001, 0x3c010800, 0xac220040, -0x3c020800, 0x8c420044, 0x32230004, 0x24420001, -0x3c010800, 0xac220044, 0x1060001a, 0x32220002, -0x8f4202b8, 0x4430008, 0x8e020020, 0x3c020800, -0x8c420060, 0x24420001, 0x3c010800, 0xac220060, -0xa0001f1, 0x24040001, 0x96030016, 0x2021, -0xaf420280, 0x8e020004, 0xa7430284, 0xaf420288, -0x3c021000, 0xaf4202b8, 0x3c020800, 0x8c42005c, -0x24420001, 0x3c010800, 0xac22005c, 0xa0001f2, -0x8fbf0018, 0x10400014, 0x2021, 0x8f430104, -0x3c026020, 0xac430014, 0x8c420004, 0x240301fe, -0x304203ff, 0x1443000c, 0x2021, 0x8f420100, -0x219c2, 0x2462fffc, 0x2c420008, 0x10400003, -0x24040002, 0x2462fffd, 0x442004, 0x3c026000, -0xac446914, 0x2021, 0x8fbf0018, 0x8fb10014, -0x8fb00010, 0x801021, 0x3e00008, 0x27bd0020, -0x93620000, 0x3e00008, 0xaf800004, 0x3e00008, -0x1021, 0x27bdffe8, 0xafbf0014, 0xafb00010, -0x8f420100, 0xaf420020, 0x8f420104, 0xaf4200a8, -0x9350010b, 0xe0001f7, 0x321000ff, 0x3c020800, -0x24424e58, 0x101880, 0x2e10001c, 0x16000004, -0x621021, 0xe0001fa, 0xa000212, 0x0, -0x8c420000, 0x40f809, 0x0, 0x10400005, -0x3c024000, 0x8f430104, 0x3c026020, 0xac430014, -0x3c024000, 0xaf420138, 0x3c020800, 0x8c420034, -0x8fbf0014, 0x8fb00010, 0x24420001, 0x3c010800, -0xac220034, 0x3e00008, 0x27bd0018, 0x27bdffe8, -0xafbf0010, 0x8f420140, 0xe0001f7, 0xaf420020, -0xe000393, 0x0, 0x3c024000, 0xaf420178, -0x3c030800, 0x24630038, 0x8c620000, 0x8fbf0010, -0x27bd0018, 0x24420001, 0x3e00008, 0xac620000, -0x27bdffe8, 0xafbf0010, 0x8f420180, 0xe0001f7, -0xaf420020, 0x8f430180, 0x24020f00, 0x14620005, -0x0, 0x8f420188, 0xa742009c, 0xa00024c, -0x3c024000, 0x93620000, 0x24030050, 0x304200ff, -0x14430008, 0x3c024000, 0xe000377, 0x0, -0x14400004, 0x3c024000, 0xe000e55, 0x0, -0x3c024000, 0xaf4201b8, 0x3c020800, 0x8c42003c, -0x8fbf0010, 0x24420001, 0x3c010800, 0xac22003c, -0x3e00008, 0x27bd0018, 0x3e00008, 0x1021, -0x8f430104, 0x8f820010, 0x10430008, 0x0, -0x3c020800, 0x8c420084, 0x24420001, 0x3c010800, -0xac220084, 0x8f420104, 0xaf820010, 0x3e00008, -0x0, 0x27bdffe8, 0xafbf0010, 0x27440100, -0x94820008, 0x30430002, 0x30420004, 0x1040001b, -0x0, 0x8f4202b8, 0x4410008, 0x24050001, -0x3c020800, 0x8c420060, 0x24420001, 0x3c010800, -0xac220060, 0xa000294, 0x8fbf0010, 0x8c820020, -0x94830016, 0x2821, 0xaf420280, 0x8c820004, -0xa7430284, 0xaf420288, 0x3c021000, 0xaf4202b8, -0x3c020800, 0x8c42005c, 0x24420001, 0x3c010800, -0xac22005c, 0xa000294, 0x8fbf0010, 0x10600008, -0x24050001, 0x3c020800, 0x8c420084, 0x24420001, -0x3c010800, 0xac220084, 0xa000294, 0x8fbf0010, -0x8f440100, 0xe000257, 0x0, 0x2821, -0x8fbf0010, 0xa01021, 0x3e00008, 0x27bd0018, -0x3c020800, 0x8c420088, 0x27430100, 0x9465000c, -0x24420001, 0x3c010800, 0xac220088, 0x8c640018, -0x3451021, 0x90454000, 0xaf440038, 0x8c62001c, -0x2403fff8, 0x52e00, 0x431024, 0x34420004, -0xaf42003c, 0x3c020005, 0xaf420030, 0x0, -0x0, 0x0, 0xaf450404, 0x0, -0x0, 0x0, 0x3c020006, 0x34420001, -0xaf420030, 0x0, 0x0, 0x0, -0x8f420000, 0x30420010, 0x1040fffd, 0x1021, -0x3e00008, 0x0, 0x27bdffe0, 0xafbf0018, -0xafb10014, 0xe000055, 0xafb00010, 0x3c028000, -0x34420070, 0x8c420000, 0xaf820014, 0xe0000b2, -0x0, 0x3c028000, 0x34460070, 0x3c030800, -0x8c6300a0, 0x3c020800, 0x8c4200a4, 0x10430004, -0x8f840014, 0x3c010800, 0xac2300a4, 0xa743009e, -0x8cca0000, 0x3c030800, 0x8c6300bc, 0x3c020800, -0x8c4200b8, 0x1442023, 0x641821, 0x4021, -0x64202b, 0x481021, 0x441021, 0x3c010800, -0xac2300bc, 0x3c010800, 0xac2200b8, 0x8f510000, -0x32220007, 0x1040ffe1, 0xaf8a0014, 0x8cc60000, -0x3c050800, 0x8ca500bc, 0x3c040800, 0x8c8400b8, -0xca3023, 0xa62821, 0x1021, 0xa6302b, -0x822021, 0x862021, 0x32270001, 0x3c010800, -0xac2500bc, 0x3c010800, 0xac2400b8, 0x10e00021, -0x32220002, 0x8f420100, 0xaf420020, 0x8f420104, -0xaf4200a8, 0x9342010b, 0xe0001f7, 0x305000ff, -0x2e02001c, 0x54400004, 0x101080, 0xe0001fa, -0xa00030b, 0x0, 0x3c030800, 0x24634e58, -0x431021, 0x8c420000, 0x40f809, 0x0, -0x10400005, 0x3c024000, 0x8f430104, 0x3c026020, -0xac430014, 0x3c024000, 0xaf420138, 0x3c020800, -0x8c420034, 0x24420001, 0x3c010800, 0xac220034, -0x32220002, 0x1040000e, 0x32220004, 0x8f420140, -0xe0001f7, 0xaf420020, 0xe000393, 0x0, -0x3c024000, 0xaf420178, 0x3c020800, 0x8c420038, -0x24420001, 0x3c010800, 0xac220038, 0x32220004, -0x1040ff9b, 0x3c028000, 0x8f420180, 0xe0001f7, -0xaf420020, 0x8f430180, 0x24020f00, 0x14620005, -0x0, 0x8f420188, 0xa742009c, 0xa000340, -0x3c024000, 0x93620000, 0x24030050, 0x304200ff, -0x14430008, 0x3c024000, 0xe000377, 0x0, -0x54400004, 0x3c024000, 0xe000e55, 0x0, -0x3c024000, 0xaf4201b8, 0x3c020800, 0x8c42003c, -0x24420001, 0x3c010800, 0xac22003c, 0xa0002c3, -0x3c028000, 0x3c029000, 0x34420001, 0x822025, -0xaf440020, 0x8f420020, 0x440fffe, 0x0, -0x3e00008, 0x0, 0x3c028000, 0x34420001, -0x822025, 0x3e00008, 0xaf440020, 0x27bdffe0, -0xafb10014, 0xafb00010, 0x808821, 0xafbf0018, -0xe000348, 0x30b000ff, 0x9362007d, 0x2202021, -0x2028025, 0xa370007d, 0x8f700074, 0x3c028000, -0xe000351, 0x2028024, 0x16000009, 0x8fbf0018, -0x8f4201f8, 0x440fffe, 0x24020002, 0xaf5101c0, -0xa34201c4, 0x3c021000, 0xaf4201f8, 0x8fbf0018, -0x8fb10014, 0x8fb00010, 0x3e00008, 0x27bd0020, -0x27bdffd0, 0x1021, 0x3e00008, 0x27bd0030, -0x27bdffe8, 0xafbf0010, 0x97420184, 0x30420200, -0x10400005, 0x2021, 0xe00108c, 0x0, -0xa00038b, 0x24040001, 0x8f420188, 0x4400009, -0x8fbf0010, 0x8f420188, 0x3c03ff00, 0x431024, -0x3c030400, 0x14430003, 0x24040001, 0x9362003e, -0x8fbf0010, 0x801021, 0x3e00008, 0x27bd0018, -0xa3600022, 0x8f440140, 0xa000356, 0x24050001, -0x27bdffe8, 0xafbf0014, 0xafb00010, 0x93620000, -0x24030020, 0x304200ff, 0x1043000b, 0x0, -0x93620000, 0x24030030, 0x304200ff, 0x10430006, -0x0, 0x93620000, 0x24030050, 0x304200ff, -0x14430062, 0x8fbf0014, 0x93420148, 0x304200ff, -0x2443ffff, 0x2c620005, 0x1040005c, 0x8fbf0014, -0x31080, 0x3c030800, 0x24634df0, 0x431021, -0x8c420000, 0x400008, 0x0, 0xe000348, -0x8f440140, 0x8f70000c, 0x8f420144, 0x16020002, -0x24020001, 0xaf62000c, 0xe000351, 0x8f440140, -0x8f420144, 0x14500004, 0x8fbf0014, 0x8fb00010, -0xa001000, 0x27bd0018, 0x8f62000c, 0xa0003ff, -0x0, 0x97620010, 0x8f430144, 0x3042ffff, -0x14620009, 0x0, 0x24020001, 0xa7620010, -0x8f420140, 0xaf420200, 0x3c021000, 0xaf420238, -0xa000406, 0x8fbf0014, 0x97620010, 0xa0003ff, -0x0, 0xe000348, 0x8f440140, 0x97620012, -0x8f430144, 0x3050ffff, 0x16030002, 0x24020001, -0xa7620012, 0xe000351, 0x8f440140, 0x8f420144, -0x16020004, 0x8fbf0014, 0x8fb00010, 0xa00038f, -0x27bd0018, 0x97620012, 0xa0003ff, 0x0, -0x97620014, 0x8f430144, 0x3042ffff, 0x14620006, -0x8fbf0014, 0x24020001, 0x8fb00010, 0xa7620014, -0xa00132c, 0x27bd0018, 0x97620014, 0xa0003ff, -0x0, 0x97620016, 0x8f430144, 0x3042ffff, -0x14620006, 0x24020001, 0x8fbf0014, 0x8fb00010, -0xa7620016, 0xa000bf3, 0x27bd0018, 0x97620016, -0x14400006, 0x8fbf0014, 0x3c020800, 0x8c420070, -0x24420001, 0x3c010800, 0xac220070, 0x8fb00010, -0x3e00008, 0x27bd0018, 0x27bdffe8, 0xafbf0014, -0xafb00010, 0x93430109, 0x2402001f, 0x8f500100, -0x106200a5, 0x28620020, 0x10400018, 0x24020038, -0x2862000a, 0x1040000c, 0x2402000b, 0x28620008, -0x1040002c, 0x0, 0x46000e7, 0x28620002, -0x14400028, 0x24020006, 0x10620026, 0x8fbf0014, -0xa000503, 0x8fb00010, 0x1062005e, 0x2862000b, -0x144000de, 0x8fbf0014, 0x2402000e, 0x10620073, -0x8fb00010, 0xa000503, 0x0, 0x106200c2, -0x28620039, 0x1040000a, 0x24020080, 0x24020036, -0x106200cc, 0x28620037, 0x104000b6, 0x24020035, -0x106200c3, 0x8fbf0014, 0xa000503, 0x8fb00010, -0x1062002b, 0x28620081, 0x10400006, 0x240200c8, -0x24020039, 0x106200b6, 0x8fbf0014, 0xa000503, -0x8fb00010, 0x10620099, 0x8fbf0014, 0xa000503, -0x8fb00010, 0x3c020800, 0x8c420020, 0x104000bb, -0x8fbf0014, 0xe000577, 0x0, 0x8f420100, -0x8f830020, 0x9745010c, 0x97460108, 0xac620000, -0x8f420104, 0x3c040800, 0x94844ed6, 0x52c00, -0xac620004, 0x8f420118, 0x63400, 0xc43025, -0xac620008, 0x8f42011c, 0x24040001, 0xac62000c, -0x9342010a, 0xa22825, 0xac650010, 0xac600014, -0xac600018, 0xac66001c, 0xa0004d7, 0x8fbf0014, -0x3c020800, 0x8c420020, 0x1040009c, 0x8fbf0014, -0xe000577, 0x0, 0x97440108, 0x3c030800, -0x94634ed6, 0x9745010c, 0x42202, 0x9746010e, -0x8f820020, 0x42600, 0x832025, 0x52c00, -0x3c030080, 0xa62825, 0x832025, 0xac400000, -0xac400004, 0xac400008, 0xac40000c, 0xac450010, -0xac400014, 0xac400018, 0xac44001c, 0xa0004d6, -0x24040001, 0x9742010c, 0x14400015, 0x0, -0x93620005, 0x30420010, 0x14400011, 0x0, -0xe000348, 0x2002021, 0x93620005, 0x2002021, -0x34420010, 0xe000351, 0xa3620005, 0x93620000, -0x24030020, 0x304200ff, 0x1043006f, 0x2002021, -0x8fbf0014, 0x8fb00010, 0xa0010a2, 0x27bd0018, -0xd, 0xa000502, 0x8fbf0014, 0x3c020800, -0x8c420020, 0x10400065, 0x8fbf0014, 0xe000577, -0x0, 0x8f420104, 0x8f830020, 0x9744010c, -0x3c050800, 0x94a54ed6, 0xac620000, 0x9762002c, -0x42400, 0x3042ffff, 0x822025, 0x3c02400e, -0xa22825, 0xac640004, 0xac600008, 0xac60000c, -0xac600010, 0xac600014, 0xac600018, 0xac65001c, -0xa0004d6, 0x24040001, 0xe000348, 0x2002021, -0xa7600008, 0xe000351, 0x2002021, 0x2002021, -0xe000356, 0x24050001, 0x3c020800, 0x8c420020, -0x10400042, 0x8fbf0014, 0xe000577, 0x0, -0x9742010c, 0x8f830020, 0x3c050800, 0x94a54ed6, -0x21400, 0xac700000, 0xac620004, 0xac600008, -0x8f64004c, 0x3c02401f, 0xa22825, 0xac64000c, -0x8f620050, 0x24040001, 0xac620010, 0x8f620054, -0xac620014, 0xac600018, 0xac65001c, 0x8fbf0014, -0x8fb00010, 0xa00059c, 0x27bd0018, 0x93620000, -0x24030020, 0x304200ff, 0x10430024, 0x8fbf0014, -0xe000fea, 0x2002021, 0x10400020, 0x8fbf0014, -0x2002021, 0x8fb00010, 0x2821, 0xa000356, -0x27bd0018, 0x2002021, 0x8fbf0014, 0x8fb00010, -0xa000664, 0x27bd0018, 0x9745010c, 0x2002021, -0x8fbf0014, 0x8fb00010, 0xa000684, 0x27bd0018, -0x2002021, 0x8fb00010, 0xa0006a9, 0x27bd0018, -0x9345010d, 0x2002021, 0x8fb00010, 0xa0006f3, -0x27bd0018, 0x2002021, 0x8fbf0014, 0x8fb00010, -0xa0006cf, 0x27bd0018, 0x8fbf0014, 0x8fb00010, -0x3e00008, 0x27bd0018, 0x8f420278, 0x440fffe, -0x34820080, 0xaf420240, 0x24020002, 0xa3420244, -0x3c021000, 0x3e00008, 0xaf420278, 0x3c040800, -0x94844ee2, 0x3c020800, 0x8c424eec, 0x3083ffff, -0x318c0, 0x431021, 0xaf42003c, 0x3c020800, -0x8c424ee8, 0xaf420038, 0x3c020050, 0x34420008, -0xaf420030, 0x0, 0x0, 0x0, -0x8f420000, 0x30420020, 0x1040fffd, 0x0, -0x8f420400, 0x3c010800, 0xac224ed8, 0x8f420404, -0x3c010800, 0xac224edc, 0x3c020020, 0xaf420030, -0x0, 0x3c020800, 0x94424ee0, 0x3c030800, -0x94634ee4, 0x3c050800, 0x94a54ee6, 0x24840001, -0x431021, 0x3083ffff, 0x3c010800, 0xa4224ee0, -0x3c010800, 0xa4244ee2, 0x14650003, 0x0, -0x3c010800, 0xa4204ee2, 0x3e00008, 0x0, -0x3c05000a, 0x27bdffe8, 0x3452821, 0x3c040800, -0x24844ec8, 0xafbf0010, 0xe000601, 0x2406000a, -0x3c020800, 0x94424eca, 0x3c030800, 0x94634ee6, -0x3042000f, 0x24420003, 0x431804, 0x24027fff, -0x43102b, 0x10400002, 0xaf83001c, 0xd, -0xe00050e, 0x0, 0x3c020800, 0x94424ed2, -0x8fbf0010, 0x27bd0018, 0x3e00008, 0xa74200a2, -0x3c02000a, 0x3421021, 0x94430006, 0x3c020800, -0x94424ed2, 0x3c010800, 0xa4234ece, 0x431023, -0x8f83001c, 0x21400, 0x21403, 0x43102b, -0x3e00008, 0x38420001, 0x27bdffe8, 0xafbf0010, -0x3c02000a, 0x3421021, 0x94420006, 0x3c010800, -0xa4224ece, 0xe00055b, 0x0, 0x5440fff9, -0x3c02000a, 0x8fbf0010, 0x3e00008, 0x27bd0018, -0x27bdffe8, 0xafbf0010, 0xe00055b, 0x0, -0x10400003, 0x0, 0xe000569, 0x0, -0x3c020800, 0x8c424ed8, 0x8fbf0010, 0x27430400, -0xaf420038, 0x3c020800, 0x8c424edc, 0x27bd0018, -0xaf830020, 0xaf42003c, 0x3c020005, 0xaf420030, -0x3e00008, 0xaf800018, 0x8f820018, 0x3c030006, -0x21140, 0x431025, 0xaf420030, 0x0, -0x0, 0x0, 0x8f420000, 0x30420010, -0x1040fffd, 0x27420400, 0xaf820020, 0x3e00008, -0xaf800018, 0x3c060800, 0x8cc64edc, 0x8f850018, -0x8f830020, 0x3c020800, 0x94424ed2, 0x27bdffe0, -0x24a50001, 0x24630020, 0x24420001, 0x24c70020, -0xafb10014, 0xafb00010, 0xafbf0018, 0xaf850018, -0xaf830020, 0x3c010800, 0xa4224ed2, 0x309000ff, -0x3c010800, 0xac274edc, 0x4c10008, 0x8821, -0x4e00006, 0x0, 0x3c020800, 0x8c424ed8, -0x24420001, 0x3c010800, 0xac224ed8, 0x3c020800, -0x94424ed2, 0x3c030800, 0x94634ee0, 0x10202b, -0x431026, 0x2c420001, 0x441025, 0x14400004, -0x8f830018, 0x24020010, 0x1462000f, 0x0, -0xe00058d, 0x24110001, 0x3c030800, 0x94634ed2, -0x3c020800, 0x94424ee0, 0x14620003, 0x0, -0xe00050e, 0x0, 0x16000003, 0x0, -0xe000577, 0x0, 0x3c030800, 0x94634ed6, -0x3c020800, 0x94424ed4, 0x24630001, 0x3064ffff, -0x3c010800, 0xa4234ed6, 0x14820003, 0x0, -0x3c010800, 0xa4204ed6, 0x12000006, 0x0, -0x3c020800, 0x94424ed2, 0xa74200a2, 0xa0005ef, -0x2201021, 0xe00055b, 0x0, 0x10400004, -0x2201021, 0xe000569, 0x0, 0x2201021, -0x8fbf0018, 0x8fb10014, 0x8fb00010, 0x3e00008, -0x27bd0020, 0x3084ffff, 0x30a5ffff, 0x1821, -0x10800007, 0x0, 0x30820001, 0x10400002, -0x42042, 0x651821, 0xa0005f7, 0x52840, -0x3e00008, 0x601021, 0x10c00006, 0x24c6ffff, -0x8ca20000, 0x24a50004, 0xac820000, 0xa000601, -0x24840004, 0x3e00008, 0x0, 0x10a00008, -0x24a3ffff, 0xac860000, 0x0, 0x0, -0x2402ffff, 0x2463ffff, 0x1462fffa, 0x24840004, -0x3e00008, 0x0, 0x24020001, 0xaf62000c, -0xa7620010, 0xa7620012, 0xa7620014, 0x3e00008, -0xa7620016, 0x3082007f, 0x3421021, 0x3c08000e, -0x481821, 0x3c020800, 0x8c420020, 0x27bdffd8, -0x2407ff80, 0xafb3001c, 0xafb20018, 0xafb10014, -0xafb00010, 0xafbf0020, 0x808021, 0x30b100ff, -0x872024, 0x30d200ff, 0x1040002f, 0x9821, -0xaf44002c, 0x90620000, 0x24030050, 0x304200ff, -0x1443000e, 0x0, 0x3c020800, 0x8c4200e0, -0x2021021, 0x471024, 0xaf42002c, 0x3c020800, -0x8c4200e0, 0x2021021, 0x3042007f, 0x3421021, -0x481021, 0x944200d4, 0x3053ffff, 0xe000577, -0x0, 0x3c020800, 0x94424ed6, 0x8f830020, -0x113400, 0xc23025, 0x122c00, 0x3c024000, -0xc23025, 0x34a50001, 0xac700000, 0x8fbf0020, -0xac600004, 0x8fb20018, 0xac730008, 0x8fb10014, -0xac60000c, 0x8fb3001c, 0xac650010, 0x8fb00010, -0xac600014, 0x24040001, 0xac600018, 0x27bd0028, -0xa00059c, 0xac66001c, 0x8fbf0020, 0x8fb3001c, -0x8fb20018, 0x8fb10014, 0x8fb00010, 0x3e00008, -0x27bd0028, 0x9343010f, 0x24020010, 0x1062000e, -0x28650011, 0x10a00007, 0x24020012, 0x24020008, -0x2405003a, 0x10620006, 0x3021, 0x3e00008, -0x0, 0x24050035, 0x1462fffc, 0x3021, -0xa00061c, 0x0, 0x8f420074, 0x24420fa0, -0x3e00008, 0xaf62000c, 0x27bdffe8, 0xafbf0010, -0xe000356, 0x24050001, 0x8fbf0010, 0x24020001, -0xa7620012, 0x27bd0018, 0x24020001, 0x3e00008, -0xa3600022, 0x27bdffe0, 0xafb10014, 0xafb00010, -0xafbf0018, 0x30b1ffff, 0xe000348, 0x808021, -0x9362003f, 0x24030004, 0x304200ff, 0x1443000c, -0x2002021, 0x12200008, 0x2402000a, 0xe000615, -0x0, 0x93620005, 0x2403fffe, 0x431024, -0xa3620005, 0x24020012, 0xa362003f, 0x2002021, -0xe000351, 0xa3600081, 0x16200003, 0x2002021, -0xe000679, 0x0, 0x2002021, 0x322600ff, -0x8fbf0018, 0x8fb10014, 0x8fb00010, 0x24050038, -0xa00061c, 0x27bd0020, 0x27bdffe0, 0xafbf001c, -0xafb20018, 0xafb10014, 0xafb00010, 0xe000348, -0x808021, 0xe000615, 0x0, 0x9362003f, -0x24120018, 0x305100ff, 0x12320003, 0x2002021, -0x24020012, 0xa362003f, 0x93620005, 0x2403fffe, -0x431024, 0xe000351, 0xa3620005, 0x2002021, -0x24050020, 0x16320007, 0x3021, 0x8fbf001c, -0x8fb20018, 0x8fb10014, 0x8fb00010, 0xa000356, -0x27bd0020, 0x8fbf001c, 0x8fb20018, 0x8fb10014, -0x8fb00010, 0x24050039, 0xa00061c, 0x27bd0020, -0x27bdffe8, 0xafb00010, 0xafbf0014, 0x9742010c, -0x24050036, 0x808021, 0x14400010, 0x304600ff, -0xe000348, 0x0, 0x24020012, 0xa362003f, -0x93620005, 0x34420010, 0xe000615, 0xa3620005, -0xe000351, 0x2002021, 0x2002021, 0xe000356, -0x24050020, 0xa0006e8, 0x0, 0xe00061c, -0x0, 0xe000348, 0x2002021, 0x93620023, -0x2403ff9f, 0x2002021, 0x431024, 0x8fbf0014, -0x8fb00010, 0xa3620023, 0xa000351, 0x27bd0018, -0x27bdffe0, 0xafbf0018, 0xafb10014, 0xafb00010, -0x30b100ff, 0xe000348, 0x808021, 0x24020012, -0xe000615, 0xa362003f, 0xe000351, 0x2002021, -0x2002021, 0x2203021, 0x8fbf0018, 0x8fb10014, -0x8fb00010, 0x24050035, 0xa00061c, 0x27bd0020, -0xa380002c, 0x3e00008, 0xa380002d, 0x8f420278, -0x440fffe, 0x8f820034, 0xaf420240, 0x24020002, -0xa3420244, 0x3c021000, 0x3e00008, 0xaf420278, -0x3c036000, 0x8c625400, 0x30420008, 0x1440fffd, -0x0, 0x8c625408, 0xaf820000, 0x24020052, -0xac605408, 0xac645430, 0xac625434, 0x24020008, -0x3e00008, 0xac625400, 0x3c026000, 0x8c425400, -0x30420008, 0x10400005, 0x3c036000, 0x8c625400, -0x30420008, 0x1440fffd, 0x0, 0x8f830000, -0x3c026000, 0x3e00008, 0xac435408, 0x90a30000, -0x24020005, 0x804021, 0x3063003f, 0x4821, -0x14620005, 0x5021, 0x90a2001c, 0x94a3001e, -0x304900ff, 0x306affff, 0xad00000c, 0xad000010, -0xad000024, 0x95020014, 0x8d05001c, 0x8d040018, -0x3042ffff, 0x491023, 0x21100, 0x237c3, -0x403821, 0x862023, 0xa2102b, 0x822023, -0xa72823, 0xad05001c, 0xad040018, 0xa5090014, -0xa5090020, 0xa50a0016, 0x3e00008, 0xa50a0022, -0x8f4201f8, 0x440fffe, 0x24020002, 0xaf4401c0, -0xa34201c4, 0x3c021000, 0x3e00008, 0xaf4201f8, -0x3c020800, 0x8c4200b4, 0x27bdffe8, 0xafbf0014, -0x24420001, 0xafb00010, 0x3c010800, 0xac2200b4, -0x8f430024, 0x3c02001f, 0x30aa00ff, 0x3442ff80, -0x30d800ff, 0x628024, 0x80f821, 0x30ef00ff, -0x1158003b, 0x1405821, 0x240cff80, 0x3c19000a, -0x3163007f, 0x310c0, 0x31940, 0x621821, -0x3c020800, 0x8c4200dc, 0x25680001, 0x310d007f, -0x3e21021, 0x431021, 0x3043007f, 0x3431821, -0x4c1024, 0x794821, 0xaf420024, 0x8d220024, -0x16c1824, 0x6c7026, 0xad22000c, 0x8d220024, -0x310800ff, 0xad220010, 0x95220014, 0x95230020, -0x8d27001c, 0x3042ffff, 0x3063ffff, 0x8d260018, -0x431023, 0x21100, 0x227c3, 0x402821, -0xc43023, 0xe2102b, 0xc23023, 0xe53823, -0xad27001c, 0xad260018, 0x95220020, 0xa5220014, -0x95220022, 0x154b000a, 0xa5220016, 0x8d230024, -0x8d220008, 0x25460001, 0x31450080, 0x14620004, -0x30c4007f, 0x108f0002, 0x38aa0080, 0xc05021, -0x51af0001, 0x31c800ff, 0x1518ffc9, 0x1005821, -0x8f840034, 0x3082007f, 0x3421821, 0x3c02000a, -0x621821, 0x2402ff80, 0x822024, 0xaf440024, -0xa06a0079, 0xa06a0083, 0x8c620050, 0x8f840034, -0xac620070, 0x8c650074, 0x3c027fff, 0x3442ffff, -0xa22824, 0xe00074f, 0xac650074, 0xaf500024, -0x8fbf0014, 0x8fb00010, 0x3e00008, 0x27bd0018, -0x27bdffc0, 0xafbe0038, 0xafb70034, 0xafb5002c, -0xafb20020, 0xafb1001c, 0xafb00018, 0xafbf003c, -0xafb60030, 0xafb40028, 0xafb30024, 0x8f450024, -0x8f460028, 0x8f43002c, 0x3c02001f, 0x3442ff80, -0x621824, 0xc23024, 0x80a821, 0xafa30014, -0xa2f024, 0xe000713, 0xafa60010, 0x3c020800, -0x8c4200e0, 0x2410ff80, 0x3608821, 0x2a21021, -0x501024, 0xaf420024, 0x3c020800, 0x8c4200e0, -0x2a21021, 0x3042007f, 0x3421821, 0x3c02000a, -0x629021, 0x924200d2, 0x93630084, 0x305700ff, -0x306300ff, 0x24020001, 0x10620034, 0x3602021, -0x24020002, 0x14620036, 0x0, 0xe0012f8, -0x2402821, 0x92230083, 0x92220083, 0x3063007f, -0x3042007f, 0x210c0, 0x31940, 0x621821, -0x3c020800, 0x8c4200dc, 0x2a21021, 0x433821, -0xf01024, 0xaf420028, 0x92250078, 0x92240083, -0x30e2007f, 0x3421821, 0x3c02000c, 0x14850007, -0x628021, 0x2402ffff, 0xa24200f1, 0x2402ffff, -0xa64200f2, 0xa00080b, 0x2402ffff, 0x96020020, -0xa24200f1, 0x96020022, 0xa64200f2, 0x8e020024, -0xae4200f4, 0x92220083, 0xa24200f0, 0x8e4200c8, -0xae4200fc, 0x8e4200c4, 0xae4200f8, 0x8e220050, -0xae420100, 0x8e4200cc, 0xae420104, 0x92220085, -0x3042003f, 0xa000866, 0x34420040, 0xe00131b, -0x2402821, 0x92220085, 0xa000866, 0x3042003f, -0x93620085, 0x2403ffdf, 0x3042003f, 0xa3620085, -0x93620085, 0x431024, 0xa3620085, 0x93630083, -0x93620078, 0x307400ff, 0x304200ff, 0x10540036, -0x240aff80, 0x3c0c000c, 0x3283007f, 0x310c0, -0x31940, 0x621821, 0x3c020800, 0x8c4200dc, -0x26880001, 0x3109007f, 0x2a21021, 0x433821, -0x30e2007f, 0x3421821, 0xea1024, 0xaf420028, -0x6c8021, 0x8e020024, 0x28a1824, 0x6a5826, -0xae02000c, 0x8e020024, 0x310800ff, 0xae020010, -0x96020014, 0x96030020, 0x8e07001c, 0x3042ffff, -0x3063ffff, 0x8e060018, 0x431023, 0x21100, -0x227c3, 0x402821, 0xc43023, 0xe2102b, -0xc23023, 0xe53823, 0xae07001c, 0xae060018, -0x96020020, 0xa6020014, 0x96020022, 0xa6020016, -0x92220079, 0x304200ff, 0x10540007, 0x0, -0x51370001, 0x316800ff, 0x92220078, 0x304200ff, -0x1448ffcd, 0x100a021, 0x92220083, 0xa2220079, -0x8e220050, 0xa0008c6, 0xae220070, 0xa2220085, -0x8e22004c, 0x2405ff80, 0xae42010c, 0x92220085, -0x34420020, 0xa2220085, 0x924200d1, 0x3c030800, -0x8c6300dc, 0x305400ff, 0x3c020800, 0x8c4200e4, -0x143140, 0x1420c0, 0x2a31821, 0xc42021, -0x2a21021, 0x643821, 0x461021, 0x451824, -0xe52824, 0xaf450028, 0xaf43002c, 0x3042007f, -0x924400d0, 0x30e3007f, 0x3422821, 0x3431821, -0x3c02000c, 0x628021, 0x3c02000e, 0x309600ff, -0xa29821, 0x1296002a, 0x0, 0x8e02000c, -0x2002021, 0x2602821, 0x10400025, 0x26100028, -0xe00072e, 0x0, 0x9262000d, 0x26830001, -0x307400ff, 0x3042007f, 0xa262000d, 0x2404ff80, -0x1697fff0, 0x26730020, 0x3c020800, 0x8c4200dc, -0xa021, 0x2a21021, 0x441024, 0xaf420028, -0x3c020800, 0x8c4200e4, 0x3c030800, 0x8c6300dc, -0x2a21021, 0x441024, 0xaf42002c, 0x3c020800, -0x8c4200e4, 0x2a31821, 0x3063007f, 0x2a21021, -0x3042007f, 0x3422021, 0x3431821, 0x3c02000c, -0x628021, 0x3c02000e, 0xa000888, 0x829821, -0x8e4200d8, 0xae220050, 0x8e4200d8, 0xae220070, -0x92250083, 0x924600d1, 0x92230083, 0x924400d1, -0x2402ff80, 0xa22824, 0x3063007f, 0x308400ff, -0xa62825, 0x64182a, 0x10600002, 0x30a500ff, -0x38a50080, 0xa2250083, 0xa2250079, 0xe000721, -0x0, 0x9222007e, 0x2a02021, 0xa222007a, -0x8e230074, 0x3c027fff, 0x3442ffff, 0x621824, -0xe00074f, 0xae230074, 0x8fa20010, 0xaf5e0024, -0x8fbf003c, 0xaf420028, 0x8fbe0038, 0x8fa20014, -0x8fb70034, 0x8fb60030, 0x8fb5002c, 0x8fb40028, -0x8fb30024, 0x8fb20020, 0x8fb1001c, 0x8fb00018, -0x27bd0040, 0x3e00008, 0xaf42002c, 0x90a20000, -0x24420001, 0xa0a20000, 0x3c030800, 0x8c6300f4, -0x304200ff, 0x1443000f, 0x803021, 0xa0a00000, -0x3c020800, 0x8c4200e4, 0x8f840034, 0x822021, -0x3082007f, 0x3421821, 0x3c02000c, 0x621821, -0x2402ff80, 0x822024, 0xacc30000, 0x3e00008, -0xaf440028, 0x8c820000, 0x24420020, 0x3e00008, -0xac820000, 0x94c20000, 0x3c080800, 0x950800ca, -0x30e7ffff, 0x804821, 0x1021021, 0xa4c20000, -0x94c20000, 0x3042ffff, 0xe2102b, 0x54400001, -0xa4c70000, 0x94a20000, 0x3c030800, 0x8c6300cc, -0x24420001, 0xa4a20000, 0x94a20000, 0x3042ffff, -0x54430007, 0x8f860028, 0x107102b, 0xa4a00000, -0x54400001, 0x1003821, 0xa4c70000, 0x8f860028, -0x8cc4001c, 0xaf44003c, 0x94a20000, 0x8f43003c, -0x3042ffff, 0x210c0, 0x621821, 0xaf43003c, -0x8f42003c, 0x822023, 0x18800004, 0x0, -0x8cc20018, 0xa000927, 0x24420001, 0x8cc20018, -0xaf420038, 0x3c020050, 0x34420010, 0xaf420030, -0x0, 0x0, 0x0, 0x8f420000, -0x30420020, 0x1040fffd, 0x0, 0x8f420404, -0xad220004, 0x8f420400, 0xad220000, 0x3c020020, -0xaf420030, 0x3e00008, 0x0, 0x27bdffe0, -0xafb20018, 0xafb10014, 0xafb00010, 0xafbf001c, -0x94c20000, 0xc08021, 0x3c120800, 0x965200c6, -0x24420001, 0xa6020000, 0x96030000, 0x94e20000, -0xe03021, 0x14430005, 0x8fb10030, 0xe0008fc, -0x2403821, 0xa000959, 0x0, 0x8c830004, -0x8c820004, 0x24420040, 0x4610007, 0xac820004, -0x8c820004, 0x4400004, 0x0, 0x8c820000, -0x24420001, 0xac820000, 0x96020000, 0x3042ffff, -0x50520001, 0xa6000000, 0x96220000, 0x24420001, -0xa6220000, 0x8f820028, 0x96230000, 0x94420016, -0x14430004, 0x8fbf001c, 0x24020001, 0xa6220000, -0x8fbf001c, 0x8fb20018, 0x8fb10014, 0x8fb00010, -0x3e00008, 0x27bd0020, 0x8f890028, 0x27bdffe0, -0xafbf0018, 0x8d220028, 0x27480400, 0x30e700ff, -0xaf420038, 0x8d22002c, 0xaf880030, 0xaf42003c, -0x3c020005, 0xaf420030, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, -0x8c82000c, 0x8c82000c, 0xad020000, 0x8c820010, -0xad020004, 0x8c820018, 0xad020008, 0x8c82001c, -0xad02000c, 0x8ca20014, 0xad020010, 0x8c820020, -0xad020014, 0x90820005, 0x304200ff, 0x21200, -0xad020018, 0x8ca20018, 0xad02001c, 0x8ca2000c, -0xad020020, 0x8ca20010, 0xad020024, 0x8ca2001c, -0xad020028, 0x8ca20020, 0xad02002c, 0xad060030, -0xad000034, 0x97830026, 0x3402ffff, 0x14620002, -0x602021, 0x3404ffff, 0x10e00011, 0xad040038, -0x95230036, 0x95240036, 0x24020001, 0x3063ffff, -0x318c2, 0x691821, 0x90650040, 0x30840007, -0x821004, 0x451025, 0xa0620040, 0x8f820028, -0x94420056, 0x3042ffff, 0xa0009c0, 0xad02003c, -0x95230036, 0x95240036, 0x24020001, 0x3063ffff, -0x318c2, 0x691821, 0x90650040, 0x30840007, -0x821004, 0x21027, 0x451024, 0xa0620040, -0xad00003c, 0x0, 0x0, 0x0, -0x3c020006, 0x34420040, 0xaf420030, 0x0, -0x0, 0x0, 0x8f420000, 0x30420010, -0x1040fffd, 0x8f860028, 0xaf880030, 0x24c20056, -0x24c7003c, 0x24c40028, 0x24c50032, 0x24c60036, -0xe00093a, 0xafa20010, 0x8fbf0018, 0x3e00008, -0x27bd0020, 0x8f830024, 0x3c050800, 0x8ca500e8, -0x8f820034, 0x30633fff, 0x31980, 0x451021, -0x431021, 0x2403ff80, 0x3045007f, 0x431024, -0xaf420028, 0x3451821, 0x3c02000c, 0x623021, -0x90c2000d, 0x3821, 0x34420010, 0xa0c2000d, -0x8f890028, 0x8f8a0024, 0x95230036, 0xa1382, -0x30480003, 0x24020001, 0xa4c3000e, 0x1102000b, -0x29020002, 0x10400005, 0x24020002, 0x1100000c, -0x24030001, 0xa000a03, 0x1821, 0x11020006, -0x0, 0xa000a03, 0x1821, 0x8cc2002c, -0xa000a03, 0x24430001, 0x8cc20014, 0x24430001, -0x8cc20018, 0x43102b, 0x14400003, 0x0, -0xa000a0c, 0x24070001, 0x9522003e, 0x24420001, -0xa522003e, 0xa1382, 0x30430003, 0x2c620002, -0x10400009, 0x802821, 0x14600004, 0x0, -0x94c20036, 0xa000a1c, 0x3046ffff, 0x8cc60038, -0xa000a1c, 0x802821, 0x3021, 0x3c040800, -0x24844ef0, 0xa00096d, 0x0, 0x27490100, -0x8d22000c, 0x95230006, 0x1202021, 0x21602, -0x3045003f, 0x3063ffff, 0x24020027, 0x28a60028, -0x10a2000e, 0xaf830024, 0x10c00008, 0x24020031, -0x24020021, 0x10a20009, 0x24020025, 0x10a20007, -0x9382002d, 0xa000a3a, 0x0, 0x10a20005, -0x9382002d, 0xa000a3a, 0x0, 0xa0009d8, -0x0, 0xa00070a, 0x0, 0x95230006, -0x91240005, 0x8d25000c, 0x8d260010, 0x8d270018, -0x8d28001c, 0x8d290020, 0x24420001, 0x3c010800, -0xa4234ef6, 0x3c010800, 0xa0244ef5, 0x3c010800, -0xac254efc, 0x3c010800, 0xac264f00, 0x3c010800, -0xac274f08, 0x3c010800, 0xac284f0c, 0x3c010800, -0xac294f10, 0x3e00008, 0xa382002d, 0x8f870028, -0x27bdffc0, 0xafb30034, 0xafb20030, 0xafb1002c, -0xafb00028, 0xafbf0038, 0x3c020800, 0x8c4200d0, -0x94e30030, 0x30b0ffff, 0x501007, 0x3045ffff, -0x3063ffff, 0xc09821, 0xa7a20010, 0x3c110800, -0x963100c6, 0x14a30006, 0x3092ffff, 0x8ce20024, -0x24420030, 0xaf42003c, 0xa000a73, 0x8ce20020, -0x94e20032, 0x3042ffff, 0x54a20008, 0x27a40018, -0x8ce2002c, 0x24420030, 0xaf42003c, 0x8ce20028, -0xaf420038, 0xa000a81, 0x8f840028, 0x27a50010, -0x27a60020, 0x2203821, 0xe0008fc, 0xa7a00020, -0x8fa20018, 0x24420030, 0xaf420038, 0x8fa2001c, -0xaf42003c, 0x8f840028, 0x3c020005, 0xaf420030, -0x94820034, 0x27430400, 0x3042ffff, 0x202102b, -0x14400007, 0xaf830030, 0x94820054, 0x94830034, -0x2021021, 0x431023, 0xa000a95, 0x3043ffff, -0x94830054, 0x94820034, 0x2231821, 0x501023, -0x621823, 0x3063ffff, 0x94820016, 0x3042ffff, -0x14430003, 0x0, 0xa000aa3, 0x24030001, -0x94820016, 0x3042ffff, 0x43102b, 0x10400005, -0x8f820030, 0x94820016, 0x621023, 0x3043ffff, -0x8f820030, 0xac530000, 0xac400004, 0xac520008, -0xac43000c, 0x3c020006, 0x34420010, 0xaf420030, -0x0, 0x0, 0x0, 0x8f420000, -0x30420010, 0x1040fffd, 0x1018c2, 0x641821, -0x90650040, 0x32040007, 0x24020001, 0x8fbf0038, -0x8fb30034, 0x8fb20030, 0x8fb1002c, 0x8fb00028, -0x821004, 0x451025, 0x27bd0040, 0x3e00008, -0xa0620040, 0x27bdffa8, 0xafb60050, 0xafb5004c, -0xafb40048, 0xafb30044, 0xafb1003c, 0xafbf0054, -0xafb20040, 0xafb00038, 0x8c900000, 0x3c020800, -0x8c4200e8, 0x8f860034, 0x96030002, 0x2413ff80, -0xc23021, 0x30633fff, 0x31980, 0xc33821, -0xf31024, 0x90b20000, 0xaf42002c, 0x92030002, -0x30e2007f, 0x3423021, 0x3c02000e, 0xc28821, -0x306300c0, 0x24020040, 0x80a821, 0xa0b021, -0x14620026, 0xa021, 0x8e340038, 0x8e220018, -0x14400002, 0x24020001, 0xae220018, 0x9202000d, -0x30420020, 0x14400015, 0x8f820034, 0x3c030800, -0x8c6300dc, 0x1238c0, 0x123140, 0x431021, -0xc73021, 0x463821, 0x30e30007, 0x3c020080, -0x30e60078, 0xc23025, 0x3431821, 0xf31024, -0xaf420800, 0x24630900, 0xaf460810, 0x8e220018, -0x8c630008, 0x431021, 0xae220018, 0x8e22002c, -0x8e230018, 0x24420001, 0x62182b, 0x1060003d, -0x0, 0xa000b57, 0x0, 0x92030002, -0x2402ffc0, 0x431024, 0x304200ff, 0x14400005, -0x24020001, 0xae220018, 0x96220036, 0xa000b40, -0x3054ffff, 0x8e220014, 0x24420001, 0xae220018, -0x92020000, 0x21600, 0x21603, 0x4410029, -0x0, 0x96020002, 0x27a40010, 0x802821, -0xa7a20016, 0x96020002, 0x24070001, 0x3021, -0x3042ffff, 0xaf820024, 0xe00096d, 0xafa0001c, -0x96030002, 0x3c040800, 0x8c8400e8, 0x8f820034, -0x30633fff, 0x31980, 0x441021, 0x431021, -0x3043007f, 0x3c05000c, 0x531024, 0x3431821, -0xaf420028, 0x651821, 0x9062000d, 0x122140, -0x3042007f, 0xa062000d, 0x3c030800, 0x8c6300e4, -0x8f820034, 0x431021, 0x443821, 0x30e2007f, -0x3421021, 0x451021, 0xf31824, 0xaf430028, -0xaea20000, 0x9222000d, 0x30420010, 0x10400013, -0x2a02021, 0x8f830028, 0x8ea40000, 0x2803021, -0x9462003e, 0x2442ffff, 0xa462003e, 0x94840002, -0x9625000e, 0x3084ffff, 0xe000a52, 0x30a5ffff, -0x8f820028, 0x94430034, 0x9622000e, 0x14430003, -0x2a02021, 0x24020001, 0xa382002c, 0x2c02821, -0xe0008e2, 0x0, 0x8fbf0054, 0x8fb60050, -0x8fb5004c, 0x8fb40048, 0x8fb30044, 0x8fb20040, -0x8fb1003c, 0x8fb00038, 0x3e00008, 0x27bd0058, -0x8f850028, 0x27bdffd0, 0xafb40028, 0xafb20020, -0xafbf002c, 0xafb30024, 0xafb1001c, 0xafb00018, -0x90a800d0, 0x90a600d1, 0x3c020800, 0x8c4200e4, -0x8f830034, 0x30c700ff, 0xa3a60010, 0x621821, -0x71140, 0x621821, 0x3062007f, 0x3422021, -0x3c02000c, 0x822021, 0x2402ff80, 0x621824, -0x311200ff, 0x8cb100d8, 0xafa40014, 0x8cb300dc, -0xa021, 0xaf430028, 0x10f2001f, 0x24020001, -0x8fa60014, 0x27a40014, 0x27a50010, 0x8cc20004, -0x2228021, 0x2701023, 0x4400017, 0x24020001, -0x90c3000d, 0x2402ff80, 0x431024, 0x304200ff, -0x14400007, 0x2008821, 0x90c2000d, 0x34420040, -0xe0008e2, 0xa0c2000d, 0xa000b9e, 0x93a20010, -0xe000ac0, 0x24140001, 0x8f830028, 0xac7000d8, -0x93a20010, 0xa06200d1, 0x93a20010, 0x1452ffe5, -0x8fa60014, 0x24020001, 0x16820004, 0x8fbf002c, -0xe00070a, 0x0, 0x8fbf002c, 0x8fb40028, -0x8fb30024, 0x8fb20020, 0x8fb1001c, 0x8fb00018, -0x3e00008, 0x27bd0030, 0x27bdffd8, 0xafb3001c, -0xafb20018, 0xafb10014, 0xafb00010, 0xafbf0020, -0x809821, 0xe08021, 0x30b1ffff, 0xe000577, -0x30d200ff, 0x0, 0x0, 0x0, -0x8f820020, 0xac510000, 0xac520004, 0xac530008, -0xac40000c, 0xac400010, 0xac400014, 0xac400018, -0x3c030800, 0x94634ed6, 0x2038025, 0xac50001c, -0x0, 0x0, 0x0, 0x24040001, -0x8fbf0020, 0x8fb3001c, 0x8fb20018, 0x8fb10014, -0x8fb00010, 0xa00059c, 0x27bd0028, 0x27bdffe8, -0xafb00010, 0xafbf0014, 0x30a5ffff, 0x30c600ff, -0x808021, 0x24020c80, 0xaf420024, 0x0, -0x0, 0x0, 0x0, 0x0, -0xe000bad, 0x0, 0x3c040800, 0x248400e0, -0x8c820000, 0x2403ff80, 0x8fbf0014, 0x2021021, -0x431024, 0xaf420024, 0x8c820000, 0x3c03000a, -0x2028021, 0x3210007f, 0x3501021, 0x8fb00010, -0x431021, 0x27bd0018, 0x3e00008, 0xaf820028, -0x27bdffe8, 0xafbf0010, 0x8f440140, 0x3c030800, -0x8c6300e0, 0x2402ff80, 0xaf840034, 0x831821, -0x621024, 0xaf420024, 0x3c020008, 0x3424021, -0x95050002, 0x3063007f, 0x3c02000a, 0x3431821, -0x621821, 0x30a5ffff, 0x3402ffff, 0x3021, -0x3c076020, 0x10a20006, 0xaf830028, 0x2402ffff, -0xa5020002, 0x946500d4, 0xe000bd2, 0x30a5ffff, -0x8fbf0010, 0x24020c80, 0x27bd0018, 0x3e00008, -0xaf420024, 0x3c020008, 0x3424021, 0x95020002, -0x3c0a0800, 0x954a00c6, 0x3046ffff, 0x14c00007, -0x3402ffff, 0x8f820028, 0x8f840034, 0x3c076020, -0x944500d4, 0xa000c3b, 0x30a5ffff, 0x10c20024, -0x8f870028, 0x94e20054, 0x94e40016, 0x3045ffff, -0xa61023, 0xa6182b, 0x3089ffff, 0x10600004, -0x3044ffff, 0xc51023, 0x1221023, 0x3044ffff, -0x8a102b, 0x1040000c, 0x12a1023, 0x24020001, -0xa5020016, 0x2402ffff, 0xa5020002, 0x94e500d4, -0x8f840034, 0x3021, 0x30a5ffff, 0x3c076020, -0xa000bd2, 0x0, 0x44102a, 0x10400008, -0x0, 0x95020016, 0x30420001, 0x10400004, -0x0, 0x9742007e, 0x24420014, 0xa5020016, -0x3e00008, 0x0, 0x8f840028, 0x27bdffe0, -0xafbf0018, 0x94820034, 0x9483003e, 0x1060001a, -0x3048ffff, 0x9383002c, 0x24020001, 0x14620027, -0x8fbf0018, 0x8f820028, 0x818c2, 0x31080007, -0x621821, 0x2447003a, 0x24490054, 0x24440020, -0x24450030, 0x24460034, 0x90620040, 0x304200ff, -0x1021007, 0x30420001, 0x10400016, 0x8fbf0018, -0xe00093a, 0xafa90010, 0x8f820028, 0x94420034, -0xa000c54, 0x3048ffff, 0x94830036, 0x94820034, -0x1043000e, 0x8fbf0018, 0x94820036, 0xa4820034, -0x94820056, 0xa4820054, 0x8c82002c, 0xac820024, -0x94820032, 0xa4820030, 0x9482003c, 0xa482003a, -0x8fbf0018, 0xa000c14, 0x27bd0020, 0x3e00008, -0x27bd0020, 0x27bdffe8, 0xafbf0010, 0x8f4a0100, -0x3c050800, 0x8ca500e0, 0x3c020800, 0x90424efc, -0x3c0c0800, 0x958c4ef6, 0x1452821, 0x304b003f, -0x30a2007f, 0x3424021, 0x39690032, 0x3c02000a, -0x3963003f, 0x2c630001, 0x1024021, 0x2d290001, -0x2402ff80, 0xa22824, 0x1234825, 0xaf8a0034, -0x801821, 0xaf450024, 0x3021, 0x802821, -0x24070001, 0xaf880028, 0x3c040800, 0x24844ef0, -0xaf8c0024, 0x15200006, 0xa380002d, 0x24020020, -0x1562000e, 0x3402ffff, 0x1582000c, 0x0, -0x24020020, 0x15620005, 0x0, 0x8c630014, -0x2402ffff, 0x10620007, 0x0, 0xe00096d, -0x0, 0xa000cb0, 0x0, 0xe0009d8, -0x602021, 0xe000c49, 0x0, 0x8fbf0010, -0x24020c80, 0x27bd0018, 0x3e00008, 0xaf420024, -0x3c020800, 0x8c4200e0, 0x27bdffa0, 0xafb1003c, -0x821021, 0x2411ff80, 0xafbe0058, 0xafb70054, -0xafb20040, 0xafb00038, 0xafbf005c, 0xafb60050, -0xafb5004c, 0xafb40048, 0xafb30044, 0x511024, -0x8f480024, 0x8f490028, 0x8f470028, 0xaf420024, -0x3c020800, 0x8c4200e0, 0x809021, 0x24060006, -0x821021, 0x3042007f, 0x3421821, 0x3c02000a, -0x628021, 0x3c02001f, 0x3442ff80, 0xe23824, -0x27a40010, 0x260500f0, 0x122f024, 0x102b824, -0xe000601, 0xafa70030, 0x8fa20018, 0xae0200c4, -0x8fa2001c, 0xae0200c8, 0x8fa20024, 0xae0200cc, -0x93a40010, 0x920300d1, 0x2402ff80, 0x821024, -0x431025, 0x304900ff, 0x3083007f, 0x3122007f, -0x62102a, 0x10400004, 0x310c0, 0x1311026, -0x304900ff, 0x310c0, 0x31940, 0x621821, -0x3c020800, 0x8c4200dc, 0x920400d2, 0x2421021, -0x431021, 0x511024, 0xaf420028, 0x93a30010, -0x3063007f, 0x310c0, 0x31940, 0x621821, -0x3c020800, 0x8c4200dc, 0x2421021, 0x431021, -0x3042007f, 0x3421821, 0x3c02000c, 0x624021, -0x8fa30014, 0x2402ffff, 0x10620030, 0x309500ff, -0x93a20011, 0x95030014, 0x304400ff, 0x3063ffff, -0x64182b, 0x1060000d, 0x0, 0x95040014, -0x8d07001c, 0x8d060018, 0x3084ffff, 0x442023, -0x42100, 0x1021, 0xe43821, 0xe4202b, -0xc23021, 0xa000d2a, 0xc43021, 0x95040014, -0x8d07001c, 0x8d060018, 0x3084ffff, 0x822023, -0x42100, 0x1021, 0x801821, 0xc23023, -0xe4202b, 0xc43023, 0xe33823, 0xad07001c, -0xad060018, 0x93a20011, 0xa5020014, 0x97a20012, -0xa5020016, 0x8fa20014, 0xad020010, 0x8fa20014, -0xad02000c, 0x93a20011, 0xa5020020, 0x97a20012, -0xa5020022, 0x8fa20014, 0xad020024, 0x2406ff80, -0x2461024, 0x3256007f, 0xaf420024, 0x3561821, -0x3c02000a, 0x628021, 0x8e02004c, 0x8fa20020, -0x3124007f, 0x428c0, 0xae020050, 0x8fa20020, -0x42140, 0x852821, 0xae020070, 0x93a20010, -0x1208821, 0xa2020083, 0x93a20010, 0xa2020079, -0x92020085, 0x3042003f, 0xa2020085, 0x3c020800, -0x8c4200dc, 0x2421021, 0x451021, 0x461024, -0xaf42002c, 0x3c020800, 0x8c4200e4, 0x3c030800, -0x8c6300dc, 0x2421021, 0x441021, 0x461024, -0xaf420028, 0x3c020800, 0x8c4200e4, 0x2431821, -0x651821, 0x2421021, 0x441021, 0x3042007f, -0x3063007f, 0x93a50010, 0x3422021, 0x3431821, -0x3c02000e, 0x624021, 0x3c02000c, 0x10b1008c, -0x824821, 0x3233007f, 0x16600019, 0x2404ff80, -0x3c020800, 0x8c4200dc, 0x2421021, 0x441024, -0xaf42002c, 0x3c020800, 0x8c4200e4, 0x3c030800, -0x8c6300dc, 0x2421021, 0x441024, 0xaf420028, -0x3c020800, 0x8c4200e4, 0x2431821, 0x3063007f, -0x2421021, 0x3042007f, 0x3422021, 0x3431821, -0x3c02000e, 0x624021, 0x3c02000c, 0x824821, -0x9124000d, 0x2414ff80, 0x1021, 0x942025, -0xa124000d, 0x95040002, 0x95050014, 0x8d07001c, -0x3084ffff, 0x30a5ffff, 0x8d060018, 0x852023, -0x42100, 0xe43821, 0xc23021, 0xe4202b, -0xc43021, 0xad07001c, 0xad060018, 0x95020002, -0xa5020014, 0xa5000016, 0x8d020008, 0xad020010, -0x8d020008, 0xad02000c, 0x95020002, 0xa5020020, -0xa5000022, 0x8d020008, 0xad020024, 0x9122000d, -0x30420040, 0x10400042, 0x26220001, 0x3c020800, -0x8c4200e0, 0xa3b30028, 0x3c10000a, 0x2421021, -0x541024, 0xaf420024, 0x3c020800, 0x8c4200e0, -0xa380002c, 0x27a4002c, 0x2421021, 0x3042007f, -0x3421821, 0x701821, 0x8c6200d8, 0x8d260004, -0x27a50028, 0xafa9002c, 0x461021, 0xac6200d8, -0xe000ac0, 0xaf830028, 0x93a30028, 0x8f820028, -0xe00070a, 0xa04300d1, 0xe000c49, 0x0, -0x2541024, 0xaf420024, 0x3c020800, 0x8c4200dc, -0x132940, 0x1320c0, 0xa42021, 0x2421021, -0x441021, 0x541024, 0xaf42002c, 0x3c020800, -0x8c4200e4, 0x3c030800, 0x8c6300dc, 0x3563021, -0x2421021, 0x451021, 0x541024, 0xaf420028, -0x3c020800, 0x8c4200e4, 0x2431821, 0x641821, -0x2421021, 0x451021, 0x3042007f, 0x3063007f, -0x3422021, 0x3431821, 0x3c02000e, 0x624021, -0x3c02000c, 0xd08021, 0x824821, 0x26220001, -0x3043007f, 0x14750005, 0x304400ff, 0x2403ff80, -0x2231024, 0x431026, 0x304400ff, 0x93a20010, -0x808821, 0x25080028, 0x1444ff76, 0x25290020, -0x93a40010, 0x8fa30014, 0x2402ffff, 0x1062000a, -0x308900ff, 0x24820001, 0x24830001, 0x3042007f, -0x14550005, 0x306900ff, 0x2403ff80, 0x831024, -0x431026, 0x304900ff, 0x92020078, 0x305300ff, -0x11330032, 0x1208821, 0x3c020800, 0x8c4200dc, -0x3225007f, 0x520c0, 0x52940, 0xa42021, -0x2421021, 0x2406ff80, 0x441021, 0x461024, -0xaf42002c, 0x3c030800, 0x8c6300dc, 0x3c020800, -0x8c4200e4, 0x2431821, 0x2421021, 0x451021, -0x641821, 0x461024, 0x3063007f, 0xaf420028, -0x3431821, 0x3c02000e, 0x624021, 0x3c020800, -0x8c4200e4, 0x8d06000c, 0x1002021, 0x2421021, -0x451021, 0x3042007f, 0x3421821, 0x3c02000c, -0x624821, 0x10c0000d, 0x1202821, 0xe00072e, -0x0, 0x2402ff80, 0x2221824, 0x26240001, -0x622826, 0x3082007f, 0x14550002, 0x308300ff, -0x30a300ff, 0x1473ffd0, 0x608821, 0x8e030074, -0x3c027fff, 0x3442ffff, 0x621824, 0xae030074, -0xe00074f, 0x2402021, 0xaf570024, 0x8fa20030, -0xaf5e0028, 0x8fbf005c, 0x8fbe0058, 0x8fb70054, -0x8fb60050, 0x8fb5004c, 0x8fb40048, 0x8fb30044, -0x8fb20040, 0x8fb1003c, 0x8fb00038, 0x27bd0060, -0x3e00008, 0xaf42002c, 0x27bdffd8, 0xafb1001c, -0xafbf0020, 0xafb00018, 0x27510188, 0x92220003, -0x2408ff80, 0x3c03000a, 0x3047007f, 0xa3a70010, -0x8f460180, 0x3c020800, 0x8c4200e0, 0xaf860034, -0xc22821, 0xa81024, 0xaf420024, 0x92240000, -0x30a2007f, 0x3421021, 0x431021, 0xaf820028, -0x3084007f, 0x24020002, 0x14820025, 0x71940, -0x3c020800, 0x8c4200e4, 0xc21021, 0x432821, -0x30a2007f, 0x3421821, 0xa81024, 0xaf420028, -0x3c02000c, 0x621821, 0x9062000d, 0xafa30014, -0x481025, 0xa062000d, 0x8fa30014, 0x9062000d, -0x30420040, 0x5040006a, 0x8fbf0020, 0x8f860028, -0xa380002c, 0x27a40014, 0x8cc200d8, 0x8c630004, -0x27a50010, 0x431021, 0xe000ac0, 0xacc200d8, -0x93a30010, 0x8f820028, 0xe00070a, 0xa04300d1, -0xe000c49, 0x0, 0xa000eeb, 0x8fbf0020, -0xe000713, 0xc02021, 0xe000721, 0x0, -0x3c020008, 0x3428021, 0x92230001, 0x9202007b, -0x1443004f, 0x8fbf0020, 0x92220000, 0x3044007f, -0x24020004, 0x10820017, 0x28820005, 0x10400006, -0x24020005, 0x24020003, 0x10820007, 0x8fb1001c, -0xa000eec, 0x0, 0x10820012, 0x8fbf0020, -0xa000eec, 0x8fb1001c, 0x92050083, 0x92060078, -0x8e070074, 0x8f840034, 0x30a500ff, 0x73e02, -0x30c600ff, 0xe000757, 0x30e7007f, 0xa000eeb, -0x8fbf0020, 0xe000cb7, 0x8f840034, 0xa000eeb, -0x8fbf0020, 0x24020c80, 0xaf420024, 0x9202003e, -0x30420040, 0x10400020, 0x0, 0x9202003e, -0x21600, 0x21603, 0x4410006, 0x0, -0x8f840034, 0xe000684, 0x24050093, 0xa000eeb, -0x8fbf0020, 0x9202003f, 0x24030018, 0x304200ff, -0x1443000c, 0x8f840034, 0x24050039, 0xe00061c, -0x3021, 0xe000348, 0x8f840034, 0x24020012, -0xa202003f, 0xe000351, 0x8f840034, 0xa000eeb, -0x8fbf0020, 0x24050036, 0xe00061c, 0x3021, -0xa000eeb, 0x8fbf0020, 0xe000348, 0x8f840034, -0x92020005, 0x34420020, 0xa2020005, 0xe000351, -0x8f840034, 0xe0010a2, 0x8f840034, 0x8fbf0020, -0x8fb1001c, 0x8fb00018, 0x24020c80, 0x27bd0028, -0x3e00008, 0xaf420024, 0x27bdffe8, 0xafb00010, -0xafbf0014, 0x27430100, 0x94620008, 0x21400, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 18:55:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A756106564A; Mon, 9 Jan 2012 18:55:29 +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 466588FC15; Mon, 9 Jan 2012 18:55: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 q09ItTVx053524; Mon, 9 Jan 2012 18:55:29 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q09ItSFm053522; Mon, 9 Jan 2012 18:55:28 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201201091855.q09ItSFm053522@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 9 Jan 2012 18:55:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229863 - stable/7/sys/dev/bce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 18:55:29 -0000 Author: yongari Date: Mon Jan 9 18:55:28 2012 New Revision: 229863 URL: http://svn.freebsd.org/changeset/base/229863 Log: MFC r218529: - Updated firmware which improves small packet performance. Modified: stable/7/sys/dev/bce/if_bcefw.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/bce/if_bcefw.h ============================================================================== --- stable/7/sys/dev/bce/if_bcefw.h Mon Jan 9 18:52:47 2012 (r229862) +++ stable/7/sys/dev/bce/if_bcefw.h Mon Jan 9 18:55:28 2012 (r229863) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2006-2010 Broadcom Corporation + * Copyright (c) 2006-2011 Broadcom Corporation * David Christensen . All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -31,1310 +31,1254 @@ /* * This file contains firmware data derived from proprietary unpublished - * source code, Copyright (c) 2004, 2005, 2007, 2008 Broadcom Corporation. + * source code, Copyright (c) 2004-2011 Broadcom Corporation. * * Permission is hereby granted for the distribution of this firmware data - * in hexadecimal or equivalent format, provided this copyright notice is - * accompanying it. + * in hexadecimal or equivalent format, provided this copyright notice also + * accompanies it. */ -/* Firmware release 4.6.17 for BCM5706 and BCM5708 (b06). */ -/* Firmware release 4.6.16 for BCM5709 and BCM5716 (b09). */ -int bce_COM_b06FwReleaseMajor = 0x1; -int bce_COM_b06FwReleaseMinor = 0x0; -int bce_COM_b06FwReleaseFix = 0x0; -u32 bce_COM_b06FwStartAddr = 0x080000f8; -u32 bce_COM_b06FwTextAddr = 0x08000000; -int bce_COM_b06FwTextLen = 0x4df0; -u32 bce_COM_b06FwDataAddr = 0x00000000; -int bce_COM_b06FwDataLen = 0x0; -u32 bce_COM_b06FwRodataAddr = 0x08004df0; -int bce_COM_b06FwRodataLen = 0x14; -u32 bce_COM_b06FwBssAddr = 0x08004e58; -int bce_COM_b06FwBssLen = 0xbc; -u32 bce_COM_b06FwSbssAddr = 0x08004e20; -int bce_COM_b06FwSbssLen = 0x38; -u32 bce_COM_b06FwSDataAddr = 0x00000000; -int bce_COM_b06FwSDataLen = 0x0; -u32 bce_COM_b06FwText[(0x4df0/4) + 1] = { -0xa00003e, 0x0, 0x0, -0xd, 0x636f6d34, 0x2e362e31, 0x37000000, -0x4061102, 0x0, 0x3, 0x14, -0x32, 0x3, 0x0, 0x0, -0x0, 0x0, 0x0, 0x10, -0x136, 0xea60, 0x1, 0x0, -0x0, 0x0, 0x8, 0x0, -0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x2, -0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, -0x0, 0x10, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, -0x10000003, 0x0, 0xd, 0xd, -0x3c020800, 0x24424e20, 0x3c030800, 0x24634f14, -0xac400000, 0x43202b, 0x1480fffd, 0x24420004, -0x3c1d0800, 0x37bd7ffc, 0x3a0f021, 0x3c100800, -0x261000f8, 0x3c1c0800, 0x279c4e20, 0xe0002bd, -0x0, 0xd, 0x3c036010, 0x8c645000, -0x2402ff7f, 0x3c1a8000, 0x822024, 0x3484380c, -0x24020037, 0xac645000, 0xaf420008, 0x24020c80, -0xaf420024, 0x3c1b8008, 0x3c060800, 0x24c607e8, -0x3c020800, 0x24424e58, 0x2404001b, 0x2484ffff, -0xac460000, 0x481fffd, 0x24420004, 0x3c020800, -0x24420380, 0x3c010800, 0xac224e60, 0x3c020800, -0x24420680, 0x3c010800, 0xac224e64, 0x3c020800, -0x24420dcc, 0x3c010800, 0xac224ea0, 0x3c020800, -0x24420a5c, 0x3c030800, 0x24630954, 0x3c040800, -0x24840990, 0x3c050800, 0x24a53c70, 0x3c010800, -0xac224ea8, 0x3c020800, 0x24420570, 0x3c010800, -0xac264ea4, 0x3c010800, 0xac254eb4, 0x3c010800, -0xac234ebc, 0x3c010800, 0xac224ec0, 0x3c010800, -0xac244ec4, 0x3c010800, 0xac234e5c, 0x3c010800, -0xac204e68, 0x3c010800, 0xac204e6c, 0x3c010800, -0xac204e70, 0x3c010800, 0xac204e74, 0x3c010800, -0xac204e78, 0x3c010800, 0xac204e7c, 0x3c010800, -0xac204e80, 0x3c010800, 0xac244e84, 0x3c010800, -0xac204e88, 0x3c010800, 0xac204e8c, 0x3c010800, -0xac204e90, 0x3c010800, 0xac204e94, 0x3c010800, -0xac204e98, 0x3c010800, 0xac264e9c, 0x3c010800, -0xac204eac, 0x3c010800, 0xac254eb0, 0x3c010800, -0xac234eb8, 0xa000707, 0x0, 0x3c030800, -0x8c630020, 0x8f820008, 0x10430003, 0x0, -0xa00053f, 0xaf830008, 0x3e00008, 0x0, -0x27bdffe8, 0xafb00010, 0xafbf0014, 0x27500100, -0x92020009, 0x1040001a, 0x24030001, 0x3c020800, -0x8c420020, 0x10400016, 0x1821, 0xe000577, -0x0, 0x96030008, 0x3c060800, 0x94c64ed6, -0x8e040018, 0x8f820020, 0x9605000c, 0x31c00, -0x661825, 0xac440000, 0xac450004, 0x24040001, -0xac400008, 0xac40000c, 0xac400010, 0xac400014, -0xac400018, 0xe00059c, 0xac43001c, 0x1821, -0x8fbf0014, 0x8fb00010, 0x601021, 0x3e00008, -0x27bd0018, 0x27bdffe8, 0xafbf0010, 0x97420108, -0x30437000, 0x24022000, 0x1062000a, 0x28642001, -0x54800012, 0x8fbf0010, 0x24024000, 0x10620008, -0x24026000, 0x1062000a, 0x8fbf0010, 0xa0000fb, -0x1021, 0x8fbf0010, 0xa0000bb, 0x27bd0018, -0xe000409, 0x0, 0xa0000fa, 0x8fbf0010, -0xe000fc9, 0x0, 0x8fbf0010, 0x1021, -0x3e00008, 0x27bd0018, 0x3c020800, 0x8c420020, -0x27bdffe8, 0x10400027, 0xafbf0010, 0xe000577, -0x0, 0x97420108, 0x9743010c, 0x8f850020, -0x3042003e, 0x3063ffff, 0x21400, 0x431025, -0xaca20000, 0x8f420100, 0x3c060800, 0x94c64ed6, -0x8fbf0010, 0xaca20004, 0x97430116, 0x9744010e, -0x3c022000, 0x31c00, 0x3084ffff, 0x641825, -0xaca30008, 0xc23025, 0x97420110, 0x97430112, -0x24040001, 0x21400, 0x3063ffff, 0x431025, -0xaca2000c, 0x97420114, 0x27bd0018, 0x3042ffff, -0xaca20010, 0xaca00014, 0xaca00018, 0xa00059c, -0xaca6001c, 0x8fbf0010, 0x3e00008, 0x27bd0018, -0x3c020800, 0x8c420020, 0x27bdffe8, 0x1040002a, -0xafbf0010, 0xe000577, 0x0, 0x97420108, -0x9743010c, 0x8f850020, 0x3042003e, 0x3063ffff, -0x21400, 0x431025, 0xaca20000, 0x8f420100, -0x3c060800, 0x94c64ed6, 0x8fbf0010, 0xaca20004, -0x97430116, 0x9744010e, 0x3c022000, 0x31c00, -0x3084ffff, 0x641825, 0xaca30008, 0xc23025, -0x97420110, 0x97430112, 0x24040001, 0x21400, -0x3063ffff, 0x431025, 0xaca2000c, 0x97420114, -0x27bd0018, 0x3042ffff, 0xaca20010, 0x8f420118, -0xaca20014, 0x9342010b, 0x304200ff, 0xaca20018, -0xa00059c, 0xaca6001c, 0x8fbf0010, 0x3e00008, -0x27bd0018, 0x27bdffe0, 0xafb00010, 0xafbf0018, -0xafb10014, 0x27500100, 0x9203000b, 0x2402001a, -0x96110008, 0x14620035, 0x2021, 0x32220001, -0x10400009, 0x0, 0x8e020000, 0x96030014, -0x211c2, 0x21040, 0x5a1021, 0xa4430080, -0xa000179, 0x32220002, 0xe00012b, 0x0, -0x3c020800, 0x8c420040, 0x24420001, 0x3c010800, -0xac220040, 0x32220002, 0x2202b, 0x3c020800, -0x8c420044, 0x32230004, 0x24420001, 0x3c010800, -0xac220044, 0x1060001a, 0x8fbf0018, 0x8f4202b8, -0x4410008, 0x24040001, 0x3c020800, 0x8c420060, -0x24420001, 0x3c010800, 0xac220060, 0xa00019c, -0x8fb10014, 0x8e020020, 0x96030016, 0x2021, -0xaf420280, 0x8e020004, 0xa7430284, 0xaf420288, -0x3c021000, 0xaf4202b8, 0x3c020800, 0x8c42005c, -0x24420001, 0x3c010800, 0xac22005c, 0x8fbf0018, -0x8fb10014, 0x8fb00010, 0x801021, 0x3e00008, -0x27bd0020, 0x27bdffe0, 0xafb00010, 0xafbf0018, -0xafb10014, 0x27500100, 0x9203000b, 0x24020003, -0x96110008, 0x14620048, 0x2021, 0x32220001, -0x10400008, 0x0, 0x8e020000, 0x96030014, -0x211c2, 0x21040, 0x5a1021, 0xa0001bb, -0xa4430080, 0xe0000fd, 0x0, 0x3c020800, -0x8c420040, 0x24420001, 0x3c010800, 0xac220040, -0x3c020800, 0x8c420044, 0x32230004, 0x24420001, -0x3c010800, 0xac220044, 0x1060001a, 0x32220002, -0x8f4202b8, 0x4430008, 0x8e020020, 0x3c020800, -0x8c420060, 0x24420001, 0x3c010800, 0xac220060, -0xa0001f1, 0x24040001, 0x96030016, 0x2021, -0xaf420280, 0x8e020004, 0xa7430284, 0xaf420288, -0x3c021000, 0xaf4202b8, 0x3c020800, 0x8c42005c, -0x24420001, 0x3c010800, 0xac22005c, 0xa0001f2, -0x8fbf0018, 0x10400014, 0x2021, 0x8f430104, -0x3c026020, 0xac430014, 0x8c420004, 0x240301fe, -0x304203ff, 0x1443000c, 0x2021, 0x8f420100, -0x219c2, 0x2462fffc, 0x2c420008, 0x10400003, -0x24040002, 0x2462fffd, 0x442004, 0x3c026000, -0xac446914, 0x2021, 0x8fbf0018, 0x8fb10014, -0x8fb00010, 0x801021, 0x3e00008, 0x27bd0020, -0x93620000, 0x3e00008, 0xaf800004, 0x3e00008, -0x1021, 0x27bdffe8, 0xafbf0014, 0xafb00010, -0x8f420100, 0xaf420020, 0x8f420104, 0xaf4200a8, -0x9350010b, 0xe0001f7, 0x321000ff, 0x3c020800, -0x24424e58, 0x101880, 0x2e10001c, 0x16000004, -0x621021, 0xe0001fa, 0xa000212, 0x0, -0x8c420000, 0x40f809, 0x0, 0x10400005, -0x3c024000, 0x8f430104, 0x3c026020, 0xac430014, -0x3c024000, 0xaf420138, 0x3c020800, 0x8c420034, -0x8fbf0014, 0x8fb00010, 0x24420001, 0x3c010800, -0xac220034, 0x3e00008, 0x27bd0018, 0x27bdffe8, -0xafbf0010, 0x8f420140, 0xe0001f7, 0xaf420020, -0xe000393, 0x0, 0x3c024000, 0xaf420178, -0x3c030800, 0x24630038, 0x8c620000, 0x8fbf0010, -0x27bd0018, 0x24420001, 0x3e00008, 0xac620000, -0x27bdffe8, 0xafbf0010, 0x8f420180, 0xe0001f7, -0xaf420020, 0x8f430180, 0x24020f00, 0x14620005, -0x0, 0x8f420188, 0xa742009c, 0xa00024c, -0x3c024000, 0x93620000, 0x24030050, 0x304200ff, -0x14430008, 0x3c024000, 0xe000377, 0x0, -0x14400004, 0x3c024000, 0xe000e55, 0x0, -0x3c024000, 0xaf4201b8, 0x3c020800, 0x8c42003c, -0x8fbf0010, 0x24420001, 0x3c010800, 0xac22003c, -0x3e00008, 0x27bd0018, 0x3e00008, 0x1021, -0x8f430104, 0x8f820010, 0x10430008, 0x0, -0x3c020800, 0x8c420084, 0x24420001, 0x3c010800, -0xac220084, 0x8f420104, 0xaf820010, 0x3e00008, -0x0, 0x27bdffe8, 0xafbf0010, 0x27440100, -0x94820008, 0x30430002, 0x30420004, 0x1040001b, -0x0, 0x8f4202b8, 0x4410008, 0x24050001, -0x3c020800, 0x8c420060, 0x24420001, 0x3c010800, -0xac220060, 0xa000294, 0x8fbf0010, 0x8c820020, -0x94830016, 0x2821, 0xaf420280, 0x8c820004, -0xa7430284, 0xaf420288, 0x3c021000, 0xaf4202b8, -0x3c020800, 0x8c42005c, 0x24420001, 0x3c010800, -0xac22005c, 0xa000294, 0x8fbf0010, 0x10600008, -0x24050001, 0x3c020800, 0x8c420084, 0x24420001, -0x3c010800, 0xac220084, 0xa000294, 0x8fbf0010, -0x8f440100, 0xe000257, 0x0, 0x2821, -0x8fbf0010, 0xa01021, 0x3e00008, 0x27bd0018, -0x3c020800, 0x8c420088, 0x27430100, 0x9465000c, -0x24420001, 0x3c010800, 0xac220088, 0x8c640018, -0x3451021, 0x90454000, 0xaf440038, 0x8c62001c, -0x2403fff8, 0x52e00, 0x431024, 0x34420004, -0xaf42003c, 0x3c020005, 0xaf420030, 0x0, -0x0, 0x0, 0xaf450404, 0x0, -0x0, 0x0, 0x3c020006, 0x34420001, -0xaf420030, 0x0, 0x0, 0x0, -0x8f420000, 0x30420010, 0x1040fffd, 0x1021, -0x3e00008, 0x0, 0x27bdffe0, 0xafbf0018, -0xafb10014, 0xe000055, 0xafb00010, 0x3c028000, -0x34420070, 0x8c420000, 0xaf820014, 0xe0000b2, -0x0, 0x3c028000, 0x34460070, 0x3c030800, -0x8c6300a0, 0x3c020800, 0x8c4200a4, 0x10430004, -0x8f840014, 0x3c010800, 0xac2300a4, 0xa743009e, -0x8cca0000, 0x3c030800, 0x8c6300bc, 0x3c020800, -0x8c4200b8, 0x1442023, 0x641821, 0x4021, -0x64202b, 0x481021, 0x441021, 0x3c010800, -0xac2300bc, 0x3c010800, 0xac2200b8, 0x8f510000, -0x32220007, 0x1040ffe1, 0xaf8a0014, 0x8cc60000, -0x3c050800, 0x8ca500bc, 0x3c040800, 0x8c8400b8, -0xca3023, 0xa62821, 0x1021, 0xa6302b, -0x822021, 0x862021, 0x32270001, 0x3c010800, -0xac2500bc, 0x3c010800, 0xac2400b8, 0x10e00021, -0x32220002, 0x8f420100, 0xaf420020, 0x8f420104, -0xaf4200a8, 0x9342010b, 0xe0001f7, 0x305000ff, -0x2e02001c, 0x54400004, 0x101080, 0xe0001fa, -0xa00030b, 0x0, 0x3c030800, 0x24634e58, -0x431021, 0x8c420000, 0x40f809, 0x0, -0x10400005, 0x3c024000, 0x8f430104, 0x3c026020, -0xac430014, 0x3c024000, 0xaf420138, 0x3c020800, -0x8c420034, 0x24420001, 0x3c010800, 0xac220034, -0x32220002, 0x1040000e, 0x32220004, 0x8f420140, -0xe0001f7, 0xaf420020, 0xe000393, 0x0, -0x3c024000, 0xaf420178, 0x3c020800, 0x8c420038, -0x24420001, 0x3c010800, 0xac220038, 0x32220004, -0x1040ff9b, 0x3c028000, 0x8f420180, 0xe0001f7, -0xaf420020, 0x8f430180, 0x24020f00, 0x14620005, -0x0, 0x8f420188, 0xa742009c, 0xa000340, -0x3c024000, 0x93620000, 0x24030050, 0x304200ff, -0x14430008, 0x3c024000, 0xe000377, 0x0, -0x54400004, 0x3c024000, 0xe000e55, 0x0, -0x3c024000, 0xaf4201b8, 0x3c020800, 0x8c42003c, -0x24420001, 0x3c010800, 0xac22003c, 0xa0002c3, -0x3c028000, 0x3c029000, 0x34420001, 0x822025, -0xaf440020, 0x8f420020, 0x440fffe, 0x0, -0x3e00008, 0x0, 0x3c028000, 0x34420001, -0x822025, 0x3e00008, 0xaf440020, 0x27bdffe0, -0xafb10014, 0xafb00010, 0x808821, 0xafbf0018, -0xe000348, 0x30b000ff, 0x9362007d, 0x2202021, -0x2028025, 0xa370007d, 0x8f700074, 0x3c028000, -0xe000351, 0x2028024, 0x16000009, 0x8fbf0018, -0x8f4201f8, 0x440fffe, 0x24020002, 0xaf5101c0, -0xa34201c4, 0x3c021000, 0xaf4201f8, 0x8fbf0018, -0x8fb10014, 0x8fb00010, 0x3e00008, 0x27bd0020, -0x27bdffd0, 0x1021, 0x3e00008, 0x27bd0030, -0x27bdffe8, 0xafbf0010, 0x97420184, 0x30420200, -0x10400005, 0x2021, 0xe00108c, 0x0, -0xa00038b, 0x24040001, 0x8f420188, 0x4400009, -0x8fbf0010, 0x8f420188, 0x3c03ff00, 0x431024, -0x3c030400, 0x14430003, 0x24040001, 0x9362003e, -0x8fbf0010, 0x801021, 0x3e00008, 0x27bd0018, -0xa3600022, 0x8f440140, 0xa000356, 0x24050001, -0x27bdffe8, 0xafbf0014, 0xafb00010, 0x93620000, -0x24030020, 0x304200ff, 0x1043000b, 0x0, -0x93620000, 0x24030030, 0x304200ff, 0x10430006, -0x0, 0x93620000, 0x24030050, 0x304200ff, -0x14430062, 0x8fbf0014, 0x93420148, 0x304200ff, -0x2443ffff, 0x2c620005, 0x1040005c, 0x8fbf0014, -0x31080, 0x3c030800, 0x24634df0, 0x431021, -0x8c420000, 0x400008, 0x0, 0xe000348, -0x8f440140, 0x8f70000c, 0x8f420144, 0x16020002, -0x24020001, 0xaf62000c, 0xe000351, 0x8f440140, -0x8f420144, 0x14500004, 0x8fbf0014, 0x8fb00010, -0xa001000, 0x27bd0018, 0x8f62000c, 0xa0003ff, -0x0, 0x97620010, 0x8f430144, 0x3042ffff, -0x14620009, 0x0, 0x24020001, 0xa7620010, -0x8f420140, 0xaf420200, 0x3c021000, 0xaf420238, -0xa000406, 0x8fbf0014, 0x97620010, 0xa0003ff, -0x0, 0xe000348, 0x8f440140, 0x97620012, -0x8f430144, 0x3050ffff, 0x16030002, 0x24020001, -0xa7620012, 0xe000351, 0x8f440140, 0x8f420144, -0x16020004, 0x8fbf0014, 0x8fb00010, 0xa00038f, -0x27bd0018, 0x97620012, 0xa0003ff, 0x0, -0x97620014, 0x8f430144, 0x3042ffff, 0x14620006, -0x8fbf0014, 0x24020001, 0x8fb00010, 0xa7620014, -0xa00132c, 0x27bd0018, 0x97620014, 0xa0003ff, -0x0, 0x97620016, 0x8f430144, 0x3042ffff, -0x14620006, 0x24020001, 0x8fbf0014, 0x8fb00010, -0xa7620016, 0xa000bf3, 0x27bd0018, 0x97620016, -0x14400006, 0x8fbf0014, 0x3c020800, 0x8c420070, -0x24420001, 0x3c010800, 0xac220070, 0x8fb00010, -0x3e00008, 0x27bd0018, 0x27bdffe8, 0xafbf0014, -0xafb00010, 0x93430109, 0x2402001f, 0x8f500100, -0x106200a5, 0x28620020, 0x10400018, 0x24020038, -0x2862000a, 0x1040000c, 0x2402000b, 0x28620008, -0x1040002c, 0x0, 0x46000e7, 0x28620002, -0x14400028, 0x24020006, 0x10620026, 0x8fbf0014, -0xa000503, 0x8fb00010, 0x1062005e, 0x2862000b, -0x144000de, 0x8fbf0014, 0x2402000e, 0x10620073, -0x8fb00010, 0xa000503, 0x0, 0x106200c2, -0x28620039, 0x1040000a, 0x24020080, 0x24020036, -0x106200cc, 0x28620037, 0x104000b6, 0x24020035, -0x106200c3, 0x8fbf0014, 0xa000503, 0x8fb00010, -0x1062002b, 0x28620081, 0x10400006, 0x240200c8, -0x24020039, 0x106200b6, 0x8fbf0014, 0xa000503, -0x8fb00010, 0x10620099, 0x8fbf0014, 0xa000503, -0x8fb00010, 0x3c020800, 0x8c420020, 0x104000bb, -0x8fbf0014, 0xe000577, 0x0, 0x8f420100, -0x8f830020, 0x9745010c, 0x97460108, 0xac620000, -0x8f420104, 0x3c040800, 0x94844ed6, 0x52c00, -0xac620004, 0x8f420118, 0x63400, 0xc43025, -0xac620008, 0x8f42011c, 0x24040001, 0xac62000c, -0x9342010a, 0xa22825, 0xac650010, 0xac600014, -0xac600018, 0xac66001c, 0xa0004d7, 0x8fbf0014, -0x3c020800, 0x8c420020, 0x1040009c, 0x8fbf0014, -0xe000577, 0x0, 0x97440108, 0x3c030800, -0x94634ed6, 0x9745010c, 0x42202, 0x9746010e, -0x8f820020, 0x42600, 0x832025, 0x52c00, -0x3c030080, 0xa62825, 0x832025, 0xac400000, -0xac400004, 0xac400008, 0xac40000c, 0xac450010, -0xac400014, 0xac400018, 0xac44001c, 0xa0004d6, -0x24040001, 0x9742010c, 0x14400015, 0x0, -0x93620005, 0x30420010, 0x14400011, 0x0, -0xe000348, 0x2002021, 0x93620005, 0x2002021, -0x34420010, 0xe000351, 0xa3620005, 0x93620000, -0x24030020, 0x304200ff, 0x1043006f, 0x2002021, -0x8fbf0014, 0x8fb00010, 0xa0010a2, 0x27bd0018, -0xd, 0xa000502, 0x8fbf0014, 0x3c020800, -0x8c420020, 0x10400065, 0x8fbf0014, 0xe000577, -0x0, 0x8f420104, 0x8f830020, 0x9744010c, -0x3c050800, 0x94a54ed6, 0xac620000, 0x9762002c, -0x42400, 0x3042ffff, 0x822025, 0x3c02400e, -0xa22825, 0xac640004, 0xac600008, 0xac60000c, -0xac600010, 0xac600014, 0xac600018, 0xac65001c, -0xa0004d6, 0x24040001, 0xe000348, 0x2002021, -0xa7600008, 0xe000351, 0x2002021, 0x2002021, -0xe000356, 0x24050001, 0x3c020800, 0x8c420020, -0x10400042, 0x8fbf0014, 0xe000577, 0x0, -0x9742010c, 0x8f830020, 0x3c050800, 0x94a54ed6, -0x21400, 0xac700000, 0xac620004, 0xac600008, -0x8f64004c, 0x3c02401f, 0xa22825, 0xac64000c, -0x8f620050, 0x24040001, 0xac620010, 0x8f620054, -0xac620014, 0xac600018, 0xac65001c, 0x8fbf0014, -0x8fb00010, 0xa00059c, 0x27bd0018, 0x93620000, -0x24030020, 0x304200ff, 0x10430024, 0x8fbf0014, -0xe000fea, 0x2002021, 0x10400020, 0x8fbf0014, -0x2002021, 0x8fb00010, 0x2821, 0xa000356, -0x27bd0018, 0x2002021, 0x8fbf0014, 0x8fb00010, -0xa000664, 0x27bd0018, 0x9745010c, 0x2002021, -0x8fbf0014, 0x8fb00010, 0xa000684, 0x27bd0018, -0x2002021, 0x8fb00010, 0xa0006a9, 0x27bd0018, -0x9345010d, 0x2002021, 0x8fb00010, 0xa0006f3, -0x27bd0018, 0x2002021, 0x8fbf0014, 0x8fb00010, -0xa0006cf, 0x27bd0018, 0x8fbf0014, 0x8fb00010, -0x3e00008, 0x27bd0018, 0x8f420278, 0x440fffe, -0x34820080, 0xaf420240, 0x24020002, 0xa3420244, -0x3c021000, 0x3e00008, 0xaf420278, 0x3c040800, -0x94844ee2, 0x3c020800, 0x8c424eec, 0x3083ffff, -0x318c0, 0x431021, 0xaf42003c, 0x3c020800, -0x8c424ee8, 0xaf420038, 0x3c020050, 0x34420008, -0xaf420030, 0x0, 0x0, 0x0, -0x8f420000, 0x30420020, 0x1040fffd, 0x0, -0x8f420400, 0x3c010800, 0xac224ed8, 0x8f420404, -0x3c010800, 0xac224edc, 0x3c020020, 0xaf420030, -0x0, 0x3c020800, 0x94424ee0, 0x3c030800, -0x94634ee4, 0x3c050800, 0x94a54ee6, 0x24840001, -0x431021, 0x3083ffff, 0x3c010800, 0xa4224ee0, -0x3c010800, 0xa4244ee2, 0x14650003, 0x0, -0x3c010800, 0xa4204ee2, 0x3e00008, 0x0, -0x3c05000a, 0x27bdffe8, 0x3452821, 0x3c040800, -0x24844ec8, 0xafbf0010, 0xe000601, 0x2406000a, -0x3c020800, 0x94424eca, 0x3c030800, 0x94634ee6, -0x3042000f, 0x24420003, 0x431804, 0x24027fff, -0x43102b, 0x10400002, 0xaf83001c, 0xd, -0xe00050e, 0x0, 0x3c020800, 0x94424ed2, -0x8fbf0010, 0x27bd0018, 0x3e00008, 0xa74200a2, -0x3c02000a, 0x3421021, 0x94430006, 0x3c020800, -0x94424ed2, 0x3c010800, 0xa4234ece, 0x431023, -0x8f83001c, 0x21400, 0x21403, 0x43102b, -0x3e00008, 0x38420001, 0x27bdffe8, 0xafbf0010, -0x3c02000a, 0x3421021, 0x94420006, 0x3c010800, -0xa4224ece, 0xe00055b, 0x0, 0x5440fff9, -0x3c02000a, 0x8fbf0010, 0x3e00008, 0x27bd0018, -0x27bdffe8, 0xafbf0010, 0xe00055b, 0x0, -0x10400003, 0x0, 0xe000569, 0x0, -0x3c020800, 0x8c424ed8, 0x8fbf0010, 0x27430400, -0xaf420038, 0x3c020800, 0x8c424edc, 0x27bd0018, -0xaf830020, 0xaf42003c, 0x3c020005, 0xaf420030, -0x3e00008, 0xaf800018, 0x8f820018, 0x3c030006, -0x21140, 0x431025, 0xaf420030, 0x0, -0x0, 0x0, 0x8f420000, 0x30420010, -0x1040fffd, 0x27420400, 0xaf820020, 0x3e00008, -0xaf800018, 0x3c060800, 0x8cc64edc, 0x8f850018, -0x8f830020, 0x3c020800, 0x94424ed2, 0x27bdffe0, -0x24a50001, 0x24630020, 0x24420001, 0x24c70020, -0xafb10014, 0xafb00010, 0xafbf0018, 0xaf850018, -0xaf830020, 0x3c010800, 0xa4224ed2, 0x309000ff, -0x3c010800, 0xac274edc, 0x4c10008, 0x8821, -0x4e00006, 0x0, 0x3c020800, 0x8c424ed8, -0x24420001, 0x3c010800, 0xac224ed8, 0x3c020800, -0x94424ed2, 0x3c030800, 0x94634ee0, 0x10202b, -0x431026, 0x2c420001, 0x441025, 0x14400004, -0x8f830018, 0x24020010, 0x1462000f, 0x0, -0xe00058d, 0x24110001, 0x3c030800, 0x94634ed2, -0x3c020800, 0x94424ee0, 0x14620003, 0x0, -0xe00050e, 0x0, 0x16000003, 0x0, -0xe000577, 0x0, 0x3c030800, 0x94634ed6, -0x3c020800, 0x94424ed4, 0x24630001, 0x3064ffff, -0x3c010800, 0xa4234ed6, 0x14820003, 0x0, -0x3c010800, 0xa4204ed6, 0x12000006, 0x0, -0x3c020800, 0x94424ed2, 0xa74200a2, 0xa0005ef, -0x2201021, 0xe00055b, 0x0, 0x10400004, -0x2201021, 0xe000569, 0x0, 0x2201021, -0x8fbf0018, 0x8fb10014, 0x8fb00010, 0x3e00008, -0x27bd0020, 0x3084ffff, 0x30a5ffff, 0x1821, -0x10800007, 0x0, 0x30820001, 0x10400002, -0x42042, 0x651821, 0xa0005f7, 0x52840, -0x3e00008, 0x601021, 0x10c00006, 0x24c6ffff, -0x8ca20000, 0x24a50004, 0xac820000, 0xa000601, -0x24840004, 0x3e00008, 0x0, 0x10a00008, -0x24a3ffff, 0xac860000, 0x0, 0x0, -0x2402ffff, 0x2463ffff, 0x1462fffa, 0x24840004, -0x3e00008, 0x0, 0x24020001, 0xaf62000c, -0xa7620010, 0xa7620012, 0xa7620014, 0x3e00008, -0xa7620016, 0x3082007f, 0x3421021, 0x3c08000e, -0x481821, 0x3c020800, 0x8c420020, 0x27bdffd8, -0x2407ff80, 0xafb3001c, 0xafb20018, 0xafb10014, -0xafb00010, 0xafbf0020, 0x808021, 0x30b100ff, -0x872024, 0x30d200ff, 0x1040002f, 0x9821, -0xaf44002c, 0x90620000, 0x24030050, 0x304200ff, -0x1443000e, 0x0, 0x3c020800, 0x8c4200e0, -0x2021021, 0x471024, 0xaf42002c, 0x3c020800, -0x8c4200e0, 0x2021021, 0x3042007f, 0x3421021, -0x481021, 0x944200d4, 0x3053ffff, 0xe000577, -0x0, 0x3c020800, 0x94424ed6, 0x8f830020, -0x113400, 0xc23025, 0x122c00, 0x3c024000, -0xc23025, 0x34a50001, 0xac700000, 0x8fbf0020, -0xac600004, 0x8fb20018, 0xac730008, 0x8fb10014, -0xac60000c, 0x8fb3001c, 0xac650010, 0x8fb00010, -0xac600014, 0x24040001, 0xac600018, 0x27bd0028, -0xa00059c, 0xac66001c, 0x8fbf0020, 0x8fb3001c, -0x8fb20018, 0x8fb10014, 0x8fb00010, 0x3e00008, -0x27bd0028, 0x9343010f, 0x24020010, 0x1062000e, -0x28650011, 0x10a00007, 0x24020012, 0x24020008, -0x2405003a, 0x10620006, 0x3021, 0x3e00008, -0x0, 0x24050035, 0x1462fffc, 0x3021, -0xa00061c, 0x0, 0x8f420074, 0x24420fa0, -0x3e00008, 0xaf62000c, 0x27bdffe8, 0xafbf0010, -0xe000356, 0x24050001, 0x8fbf0010, 0x24020001, -0xa7620012, 0x27bd0018, 0x24020001, 0x3e00008, -0xa3600022, 0x27bdffe0, 0xafb10014, 0xafb00010, -0xafbf0018, 0x30b1ffff, 0xe000348, 0x808021, -0x9362003f, 0x24030004, 0x304200ff, 0x1443000c, -0x2002021, 0x12200008, 0x2402000a, 0xe000615, -0x0, 0x93620005, 0x2403fffe, 0x431024, -0xa3620005, 0x24020012, 0xa362003f, 0x2002021, -0xe000351, 0xa3600081, 0x16200003, 0x2002021, -0xe000679, 0x0, 0x2002021, 0x322600ff, -0x8fbf0018, 0x8fb10014, 0x8fb00010, 0x24050038, -0xa00061c, 0x27bd0020, 0x27bdffe0, 0xafbf001c, -0xafb20018, 0xafb10014, 0xafb00010, 0xe000348, -0x808021, 0xe000615, 0x0, 0x9362003f, -0x24120018, 0x305100ff, 0x12320003, 0x2002021, -0x24020012, 0xa362003f, 0x93620005, 0x2403fffe, -0x431024, 0xe000351, 0xa3620005, 0x2002021, -0x24050020, 0x16320007, 0x3021, 0x8fbf001c, -0x8fb20018, 0x8fb10014, 0x8fb00010, 0xa000356, -0x27bd0020, 0x8fbf001c, 0x8fb20018, 0x8fb10014, -0x8fb00010, 0x24050039, 0xa00061c, 0x27bd0020, -0x27bdffe8, 0xafb00010, 0xafbf0014, 0x9742010c, -0x24050036, 0x808021, 0x14400010, 0x304600ff, -0xe000348, 0x0, 0x24020012, 0xa362003f, -0x93620005, 0x34420010, 0xe000615, 0xa3620005, -0xe000351, 0x2002021, 0x2002021, 0xe000356, -0x24050020, 0xa0006e8, 0x0, 0xe00061c, -0x0, 0xe000348, 0x2002021, 0x93620023, -0x2403ff9f, 0x2002021, 0x431024, 0x8fbf0014, -0x8fb00010, 0xa3620023, 0xa000351, 0x27bd0018, -0x27bdffe0, 0xafbf0018, 0xafb10014, 0xafb00010, -0x30b100ff, 0xe000348, 0x808021, 0x24020012, -0xe000615, 0xa362003f, 0xe000351, 0x2002021, -0x2002021, 0x2203021, 0x8fbf0018, 0x8fb10014, -0x8fb00010, 0x24050035, 0xa00061c, 0x27bd0020, -0xa380002c, 0x3e00008, 0xa380002d, 0x8f420278, -0x440fffe, 0x8f820034, 0xaf420240, 0x24020002, -0xa3420244, 0x3c021000, 0x3e00008, 0xaf420278, -0x3c036000, 0x8c625400, 0x30420008, 0x1440fffd, -0x0, 0x8c625408, 0xaf820000, 0x24020052, -0xac605408, 0xac645430, 0xac625434, 0x24020008, -0x3e00008, 0xac625400, 0x3c026000, 0x8c425400, -0x30420008, 0x10400005, 0x3c036000, 0x8c625400, -0x30420008, 0x1440fffd, 0x0, 0x8f830000, -0x3c026000, 0x3e00008, 0xac435408, 0x90a30000, -0x24020005, 0x804021, 0x3063003f, 0x4821, -0x14620005, 0x5021, 0x90a2001c, 0x94a3001e, -0x304900ff, 0x306affff, 0xad00000c, 0xad000010, -0xad000024, 0x95020014, 0x8d05001c, 0x8d040018, -0x3042ffff, 0x491023, 0x21100, 0x237c3, -0x403821, 0x862023, 0xa2102b, 0x822023, -0xa72823, 0xad05001c, 0xad040018, 0xa5090014, -0xa5090020, 0xa50a0016, 0x3e00008, 0xa50a0022, -0x8f4201f8, 0x440fffe, 0x24020002, 0xaf4401c0, -0xa34201c4, 0x3c021000, 0x3e00008, 0xaf4201f8, -0x3c020800, 0x8c4200b4, 0x27bdffe8, 0xafbf0014, -0x24420001, 0xafb00010, 0x3c010800, 0xac2200b4, -0x8f430024, 0x3c02001f, 0x30aa00ff, 0x3442ff80, -0x30d800ff, 0x628024, 0x80f821, 0x30ef00ff, -0x1158003b, 0x1405821, 0x240cff80, 0x3c19000a, -0x3163007f, 0x310c0, 0x31940, 0x621821, -0x3c020800, 0x8c4200dc, 0x25680001, 0x310d007f, -0x3e21021, 0x431021, 0x3043007f, 0x3431821, -0x4c1024, 0x794821, 0xaf420024, 0x8d220024, -0x16c1824, 0x6c7026, 0xad22000c, 0x8d220024, -0x310800ff, 0xad220010, 0x95220014, 0x95230020, -0x8d27001c, 0x3042ffff, 0x3063ffff, 0x8d260018, -0x431023, 0x21100, 0x227c3, 0x402821, -0xc43023, 0xe2102b, 0xc23023, 0xe53823, -0xad27001c, 0xad260018, 0x95220020, 0xa5220014, -0x95220022, 0x154b000a, 0xa5220016, 0x8d230024, -0x8d220008, 0x25460001, 0x31450080, 0x14620004, -0x30c4007f, 0x108f0002, 0x38aa0080, 0xc05021, -0x51af0001, 0x31c800ff, 0x1518ffc9, 0x1005821, -0x8f840034, 0x3082007f, 0x3421821, 0x3c02000a, -0x621821, 0x2402ff80, 0x822024, 0xaf440024, -0xa06a0079, 0xa06a0083, 0x8c620050, 0x8f840034, -0xac620070, 0x8c650074, 0x3c027fff, 0x3442ffff, -0xa22824, 0xe00074f, 0xac650074, 0xaf500024, -0x8fbf0014, 0x8fb00010, 0x3e00008, 0x27bd0018, -0x27bdffc0, 0xafbe0038, 0xafb70034, 0xafb5002c, -0xafb20020, 0xafb1001c, 0xafb00018, 0xafbf003c, -0xafb60030, 0xafb40028, 0xafb30024, 0x8f450024, -0x8f460028, 0x8f43002c, 0x3c02001f, 0x3442ff80, -0x621824, 0xc23024, 0x80a821, 0xafa30014, -0xa2f024, 0xe000713, 0xafa60010, 0x3c020800, -0x8c4200e0, 0x2410ff80, 0x3608821, 0x2a21021, -0x501024, 0xaf420024, 0x3c020800, 0x8c4200e0, -0x2a21021, 0x3042007f, 0x3421821, 0x3c02000a, -0x629021, 0x924200d2, 0x93630084, 0x305700ff, -0x306300ff, 0x24020001, 0x10620034, 0x3602021, -0x24020002, 0x14620036, 0x0, 0xe0012f8, -0x2402821, 0x92230083, 0x92220083, 0x3063007f, -0x3042007f, 0x210c0, 0x31940, 0x621821, -0x3c020800, 0x8c4200dc, 0x2a21021, 0x433821, -0xf01024, 0xaf420028, 0x92250078, 0x92240083, -0x30e2007f, 0x3421821, 0x3c02000c, 0x14850007, -0x628021, 0x2402ffff, 0xa24200f1, 0x2402ffff, -0xa64200f2, 0xa00080b, 0x2402ffff, 0x96020020, -0xa24200f1, 0x96020022, 0xa64200f2, 0x8e020024, -0xae4200f4, 0x92220083, 0xa24200f0, 0x8e4200c8, -0xae4200fc, 0x8e4200c4, 0xae4200f8, 0x8e220050, -0xae420100, 0x8e4200cc, 0xae420104, 0x92220085, -0x3042003f, 0xa000866, 0x34420040, 0xe00131b, -0x2402821, 0x92220085, 0xa000866, 0x3042003f, -0x93620085, 0x2403ffdf, 0x3042003f, 0xa3620085, -0x93620085, 0x431024, 0xa3620085, 0x93630083, -0x93620078, 0x307400ff, 0x304200ff, 0x10540036, -0x240aff80, 0x3c0c000c, 0x3283007f, 0x310c0, -0x31940, 0x621821, 0x3c020800, 0x8c4200dc, -0x26880001, 0x3109007f, 0x2a21021, 0x433821, -0x30e2007f, 0x3421821, 0xea1024, 0xaf420028, -0x6c8021, 0x8e020024, 0x28a1824, 0x6a5826, -0xae02000c, 0x8e020024, 0x310800ff, 0xae020010, -0x96020014, 0x96030020, 0x8e07001c, 0x3042ffff, -0x3063ffff, 0x8e060018, 0x431023, 0x21100, -0x227c3, 0x402821, 0xc43023, 0xe2102b, -0xc23023, 0xe53823, 0xae07001c, 0xae060018, -0x96020020, 0xa6020014, 0x96020022, 0xa6020016, -0x92220079, 0x304200ff, 0x10540007, 0x0, -0x51370001, 0x316800ff, 0x92220078, 0x304200ff, -0x1448ffcd, 0x100a021, 0x92220083, 0xa2220079, -0x8e220050, 0xa0008c6, 0xae220070, 0xa2220085, -0x8e22004c, 0x2405ff80, 0xae42010c, 0x92220085, -0x34420020, 0xa2220085, 0x924200d1, 0x3c030800, -0x8c6300dc, 0x305400ff, 0x3c020800, 0x8c4200e4, -0x143140, 0x1420c0, 0x2a31821, 0xc42021, -0x2a21021, 0x643821, 0x461021, 0x451824, -0xe52824, 0xaf450028, 0xaf43002c, 0x3042007f, -0x924400d0, 0x30e3007f, 0x3422821, 0x3431821, -0x3c02000c, 0x628021, 0x3c02000e, 0x309600ff, -0xa29821, 0x1296002a, 0x0, 0x8e02000c, -0x2002021, 0x2602821, 0x10400025, 0x26100028, -0xe00072e, 0x0, 0x9262000d, 0x26830001, -0x307400ff, 0x3042007f, 0xa262000d, 0x2404ff80, -0x1697fff0, 0x26730020, 0x3c020800, 0x8c4200dc, -0xa021, 0x2a21021, 0x441024, 0xaf420028, -0x3c020800, 0x8c4200e4, 0x3c030800, 0x8c6300dc, -0x2a21021, 0x441024, 0xaf42002c, 0x3c020800, -0x8c4200e4, 0x2a31821, 0x3063007f, 0x2a21021, -0x3042007f, 0x3422021, 0x3431821, 0x3c02000c, -0x628021, 0x3c02000e, 0xa000888, 0x829821, -0x8e4200d8, 0xae220050, 0x8e4200d8, 0xae220070, -0x92250083, 0x924600d1, 0x92230083, 0x924400d1, -0x2402ff80, 0xa22824, 0x3063007f, 0x308400ff, -0xa62825, 0x64182a, 0x10600002, 0x30a500ff, -0x38a50080, 0xa2250083, 0xa2250079, 0xe000721, -0x0, 0x9222007e, 0x2a02021, 0xa222007a, -0x8e230074, 0x3c027fff, 0x3442ffff, 0x621824, -0xe00074f, 0xae230074, 0x8fa20010, 0xaf5e0024, -0x8fbf003c, 0xaf420028, 0x8fbe0038, 0x8fa20014, -0x8fb70034, 0x8fb60030, 0x8fb5002c, 0x8fb40028, -0x8fb30024, 0x8fb20020, 0x8fb1001c, 0x8fb00018, -0x27bd0040, 0x3e00008, 0xaf42002c, 0x90a20000, -0x24420001, 0xa0a20000, 0x3c030800, 0x8c6300f4, -0x304200ff, 0x1443000f, 0x803021, 0xa0a00000, -0x3c020800, 0x8c4200e4, 0x8f840034, 0x822021, -0x3082007f, 0x3421821, 0x3c02000c, 0x621821, -0x2402ff80, 0x822024, 0xacc30000, 0x3e00008, -0xaf440028, 0x8c820000, 0x24420020, 0x3e00008, -0xac820000, 0x94c20000, 0x3c080800, 0x950800ca, -0x30e7ffff, 0x804821, 0x1021021, 0xa4c20000, -0x94c20000, 0x3042ffff, 0xe2102b, 0x54400001, -0xa4c70000, 0x94a20000, 0x3c030800, 0x8c6300cc, -0x24420001, 0xa4a20000, 0x94a20000, 0x3042ffff, -0x54430007, 0x8f860028, 0x107102b, 0xa4a00000, -0x54400001, 0x1003821, 0xa4c70000, 0x8f860028, -0x8cc4001c, 0xaf44003c, 0x94a20000, 0x8f43003c, -0x3042ffff, 0x210c0, 0x621821, 0xaf43003c, -0x8f42003c, 0x822023, 0x18800004, 0x0, -0x8cc20018, 0xa000927, 0x24420001, 0x8cc20018, -0xaf420038, 0x3c020050, 0x34420010, 0xaf420030, -0x0, 0x0, 0x0, 0x8f420000, -0x30420020, 0x1040fffd, 0x0, 0x8f420404, -0xad220004, 0x8f420400, 0xad220000, 0x3c020020, -0xaf420030, 0x3e00008, 0x0, 0x27bdffe0, -0xafb20018, 0xafb10014, 0xafb00010, 0xafbf001c, -0x94c20000, 0xc08021, 0x3c120800, 0x965200c6, -0x24420001, 0xa6020000, 0x96030000, 0x94e20000, -0xe03021, 0x14430005, 0x8fb10030, 0xe0008fc, -0x2403821, 0xa000959, 0x0, 0x8c830004, -0x8c820004, 0x24420040, 0x4610007, 0xac820004, -0x8c820004, 0x4400004, 0x0, 0x8c820000, -0x24420001, 0xac820000, 0x96020000, 0x3042ffff, -0x50520001, 0xa6000000, 0x96220000, 0x24420001, -0xa6220000, 0x8f820028, 0x96230000, 0x94420016, -0x14430004, 0x8fbf001c, 0x24020001, 0xa6220000, -0x8fbf001c, 0x8fb20018, 0x8fb10014, 0x8fb00010, -0x3e00008, 0x27bd0020, 0x8f890028, 0x27bdffe0, -0xafbf0018, 0x8d220028, 0x27480400, 0x30e700ff, -0xaf420038, 0x8d22002c, 0xaf880030, 0xaf42003c, -0x3c020005, 0xaf420030, 0x0, 0x0, -0x0, 0x0, 0x0, 0x0, -0x8c82000c, 0x8c82000c, 0xad020000, 0x8c820010, -0xad020004, 0x8c820018, 0xad020008, 0x8c82001c, -0xad02000c, 0x8ca20014, 0xad020010, 0x8c820020, -0xad020014, 0x90820005, 0x304200ff, 0x21200, -0xad020018, 0x8ca20018, 0xad02001c, 0x8ca2000c, -0xad020020, 0x8ca20010, 0xad020024, 0x8ca2001c, -0xad020028, 0x8ca20020, 0xad02002c, 0xad060030, -0xad000034, 0x97830026, 0x3402ffff, 0x14620002, -0x602021, 0x3404ffff, 0x10e00011, 0xad040038, -0x95230036, 0x95240036, 0x24020001, 0x3063ffff, -0x318c2, 0x691821, 0x90650040, 0x30840007, -0x821004, 0x451025, 0xa0620040, 0x8f820028, -0x94420056, 0x3042ffff, 0xa0009c0, 0xad02003c, -0x95230036, 0x95240036, 0x24020001, 0x3063ffff, -0x318c2, 0x691821, 0x90650040, 0x30840007, -0x821004, 0x21027, 0x451024, 0xa0620040, -0xad00003c, 0x0, 0x0, 0x0, -0x3c020006, 0x34420040, 0xaf420030, 0x0, -0x0, 0x0, 0x8f420000, 0x30420010, -0x1040fffd, 0x8f860028, 0xaf880030, 0x24c20056, -0x24c7003c, 0x24c40028, 0x24c50032, 0x24c60036, -0xe00093a, 0xafa20010, 0x8fbf0018, 0x3e00008, -0x27bd0020, 0x8f830024, 0x3c050800, 0x8ca500e8, -0x8f820034, 0x30633fff, 0x31980, 0x451021, -0x431021, 0x2403ff80, 0x3045007f, 0x431024, -0xaf420028, 0x3451821, 0x3c02000c, 0x623021, -0x90c2000d, 0x3821, 0x34420010, 0xa0c2000d, -0x8f890028, 0x8f8a0024, 0x95230036, 0xa1382, -0x30480003, 0x24020001, 0xa4c3000e, 0x1102000b, -0x29020002, 0x10400005, 0x24020002, 0x1100000c, -0x24030001, 0xa000a03, 0x1821, 0x11020006, -0x0, 0xa000a03, 0x1821, 0x8cc2002c, -0xa000a03, 0x24430001, 0x8cc20014, 0x24430001, -0x8cc20018, 0x43102b, 0x14400003, 0x0, -0xa000a0c, 0x24070001, 0x9522003e, 0x24420001, -0xa522003e, 0xa1382, 0x30430003, 0x2c620002, -0x10400009, 0x802821, 0x14600004, 0x0, -0x94c20036, 0xa000a1c, 0x3046ffff, 0x8cc60038, -0xa000a1c, 0x802821, 0x3021, 0x3c040800, -0x24844ef0, 0xa00096d, 0x0, 0x27490100, -0x8d22000c, 0x95230006, 0x1202021, 0x21602, -0x3045003f, 0x3063ffff, 0x24020027, 0x28a60028, -0x10a2000e, 0xaf830024, 0x10c00008, 0x24020031, -0x24020021, 0x10a20009, 0x24020025, 0x10a20007, -0x9382002d, 0xa000a3a, 0x0, 0x10a20005, -0x9382002d, 0xa000a3a, 0x0, 0xa0009d8, -0x0, 0xa00070a, 0x0, 0x95230006, -0x91240005, 0x8d25000c, 0x8d260010, 0x8d270018, -0x8d28001c, 0x8d290020, 0x24420001, 0x3c010800, -0xa4234ef6, 0x3c010800, 0xa0244ef5, 0x3c010800, -0xac254efc, 0x3c010800, 0xac264f00, 0x3c010800, -0xac274f08, 0x3c010800, 0xac284f0c, 0x3c010800, -0xac294f10, 0x3e00008, 0xa382002d, 0x8f870028, -0x27bdffc0, 0xafb30034, 0xafb20030, 0xafb1002c, -0xafb00028, 0xafbf0038, 0x3c020800, 0x8c4200d0, -0x94e30030, 0x30b0ffff, 0x501007, 0x3045ffff, -0x3063ffff, 0xc09821, 0xa7a20010, 0x3c110800, -0x963100c6, 0x14a30006, 0x3092ffff, 0x8ce20024, -0x24420030, 0xaf42003c, 0xa000a73, 0x8ce20020, -0x94e20032, 0x3042ffff, 0x54a20008, 0x27a40018, -0x8ce2002c, 0x24420030, 0xaf42003c, 0x8ce20028, -0xaf420038, 0xa000a81, 0x8f840028, 0x27a50010, -0x27a60020, 0x2203821, 0xe0008fc, 0xa7a00020, -0x8fa20018, 0x24420030, 0xaf420038, 0x8fa2001c, -0xaf42003c, 0x8f840028, 0x3c020005, 0xaf420030, -0x94820034, 0x27430400, 0x3042ffff, 0x202102b, -0x14400007, 0xaf830030, 0x94820054, 0x94830034, -0x2021021, 0x431023, 0xa000a95, 0x3043ffff, -0x94830054, 0x94820034, 0x2231821, 0x501023, -0x621823, 0x3063ffff, 0x94820016, 0x3042ffff, -0x14430003, 0x0, 0xa000aa3, 0x24030001, -0x94820016, 0x3042ffff, 0x43102b, 0x10400005, -0x8f820030, 0x94820016, 0x621023, 0x3043ffff, -0x8f820030, 0xac530000, 0xac400004, 0xac520008, -0xac43000c, 0x3c020006, 0x34420010, 0xaf420030, -0x0, 0x0, 0x0, 0x8f420000, -0x30420010, 0x1040fffd, 0x1018c2, 0x641821, -0x90650040, 0x32040007, 0x24020001, 0x8fbf0038, -0x8fb30034, 0x8fb20030, 0x8fb1002c, 0x8fb00028, -0x821004, 0x451025, 0x27bd0040, 0x3e00008, -0xa0620040, 0x27bdffa8, 0xafb60050, 0xafb5004c, -0xafb40048, 0xafb30044, 0xafb1003c, 0xafbf0054, -0xafb20040, 0xafb00038, 0x8c900000, 0x3c020800, -0x8c4200e8, 0x8f860034, 0x96030002, 0x2413ff80, -0xc23021, 0x30633fff, 0x31980, 0xc33821, -0xf31024, 0x90b20000, 0xaf42002c, 0x92030002, -0x30e2007f, 0x3423021, 0x3c02000e, 0xc28821, -0x306300c0, 0x24020040, 0x80a821, 0xa0b021, -0x14620026, 0xa021, 0x8e340038, 0x8e220018, -0x14400002, 0x24020001, 0xae220018, 0x9202000d, -0x30420020, 0x14400015, 0x8f820034, 0x3c030800, -0x8c6300dc, 0x1238c0, 0x123140, 0x431021, -0xc73021, 0x463821, 0x30e30007, 0x3c020080, -0x30e60078, 0xc23025, 0x3431821, 0xf31024, -0xaf420800, 0x24630900, 0xaf460810, 0x8e220018, -0x8c630008, 0x431021, 0xae220018, 0x8e22002c, -0x8e230018, 0x24420001, 0x62182b, 0x1060003d, -0x0, 0xa000b57, 0x0, 0x92030002, -0x2402ffc0, 0x431024, 0x304200ff, 0x14400005, -0x24020001, 0xae220018, 0x96220036, 0xa000b40, -0x3054ffff, 0x8e220014, 0x24420001, 0xae220018, -0x92020000, 0x21600, 0x21603, 0x4410029, -0x0, 0x96020002, 0x27a40010, 0x802821, -0xa7a20016, 0x96020002, 0x24070001, 0x3021, -0x3042ffff, 0xaf820024, 0xe00096d, 0xafa0001c, -0x96030002, 0x3c040800, 0x8c8400e8, 0x8f820034, -0x30633fff, 0x31980, 0x441021, 0x431021, -0x3043007f, 0x3c05000c, 0x531024, 0x3431821, -0xaf420028, 0x651821, 0x9062000d, 0x122140, -0x3042007f, 0xa062000d, 0x3c030800, 0x8c6300e4, -0x8f820034, 0x431021, 0x443821, 0x30e2007f, -0x3421021, 0x451021, 0xf31824, 0xaf430028, -0xaea20000, 0x9222000d, 0x30420010, 0x10400013, -0x2a02021, 0x8f830028, 0x8ea40000, 0x2803021, -0x9462003e, 0x2442ffff, 0xa462003e, 0x94840002, -0x9625000e, 0x3084ffff, 0xe000a52, 0x30a5ffff, -0x8f820028, 0x94430034, 0x9622000e, 0x14430003, -0x2a02021, 0x24020001, 0xa382002c, 0x2c02821, -0xe0008e2, 0x0, 0x8fbf0054, 0x8fb60050, -0x8fb5004c, 0x8fb40048, 0x8fb30044, 0x8fb20040, -0x8fb1003c, 0x8fb00038, 0x3e00008, 0x27bd0058, -0x8f850028, 0x27bdffd0, 0xafb40028, 0xafb20020, -0xafbf002c, 0xafb30024, 0xafb1001c, 0xafb00018, -0x90a800d0, 0x90a600d1, 0x3c020800, 0x8c4200e4, -0x8f830034, 0x30c700ff, 0xa3a60010, 0x621821, -0x71140, 0x621821, 0x3062007f, 0x3422021, -0x3c02000c, 0x822021, 0x2402ff80, 0x621824, -0x311200ff, 0x8cb100d8, 0xafa40014, 0x8cb300dc, -0xa021, 0xaf430028, 0x10f2001f, 0x24020001, -0x8fa60014, 0x27a40014, 0x27a50010, 0x8cc20004, -0x2228021, 0x2701023, 0x4400017, 0x24020001, -0x90c3000d, 0x2402ff80, 0x431024, 0x304200ff, -0x14400007, 0x2008821, 0x90c2000d, 0x34420040, -0xe0008e2, 0xa0c2000d, 0xa000b9e, 0x93a20010, -0xe000ac0, 0x24140001, 0x8f830028, 0xac7000d8, -0x93a20010, 0xa06200d1, 0x93a20010, 0x1452ffe5, -0x8fa60014, 0x24020001, 0x16820004, 0x8fbf002c, -0xe00070a, 0x0, 0x8fbf002c, 0x8fb40028, -0x8fb30024, 0x8fb20020, 0x8fb1001c, 0x8fb00018, -0x3e00008, 0x27bd0030, 0x27bdffd8, 0xafb3001c, -0xafb20018, 0xafb10014, 0xafb00010, 0xafbf0020, -0x809821, 0xe08021, 0x30b1ffff, 0xe000577, -0x30d200ff, 0x0, 0x0, 0x0, -0x8f820020, 0xac510000, 0xac520004, 0xac530008, -0xac40000c, 0xac400010, 0xac400014, 0xac400018, -0x3c030800, 0x94634ed6, 0x2038025, 0xac50001c, -0x0, 0x0, 0x0, 0x24040001, -0x8fbf0020, 0x8fb3001c, 0x8fb20018, 0x8fb10014, -0x8fb00010, 0xa00059c, 0x27bd0028, 0x27bdffe8, -0xafb00010, 0xafbf0014, 0x30a5ffff, 0x30c600ff, -0x808021, 0x24020c80, 0xaf420024, 0x0, -0x0, 0x0, 0x0, 0x0, -0xe000bad, 0x0, 0x3c040800, 0x248400e0, -0x8c820000, 0x2403ff80, 0x8fbf0014, 0x2021021, -0x431024, 0xaf420024, 0x8c820000, 0x3c03000a, -0x2028021, 0x3210007f, 0x3501021, 0x8fb00010, -0x431021, 0x27bd0018, 0x3e00008, 0xaf820028, -0x27bdffe8, 0xafbf0010, 0x8f440140, 0x3c030800, -0x8c6300e0, 0x2402ff80, 0xaf840034, 0x831821, -0x621024, 0xaf420024, 0x3c020008, 0x3424021, -0x95050002, 0x3063007f, 0x3c02000a, 0x3431821, -0x621821, 0x30a5ffff, 0x3402ffff, 0x3021, -0x3c076020, 0x10a20006, 0xaf830028, 0x2402ffff, -0xa5020002, 0x946500d4, 0xe000bd2, 0x30a5ffff, -0x8fbf0010, 0x24020c80, 0x27bd0018, 0x3e00008, -0xaf420024, 0x3c020008, 0x3424021, 0x95020002, -0x3c0a0800, 0x954a00c6, 0x3046ffff, 0x14c00007, -0x3402ffff, 0x8f820028, 0x8f840034, 0x3c076020, -0x944500d4, 0xa000c3b, 0x30a5ffff, 0x10c20024, -0x8f870028, 0x94e20054, 0x94e40016, 0x3045ffff, -0xa61023, 0xa6182b, 0x3089ffff, 0x10600004, -0x3044ffff, 0xc51023, 0x1221023, 0x3044ffff, -0x8a102b, 0x1040000c, 0x12a1023, 0x24020001, -0xa5020016, 0x2402ffff, 0xa5020002, 0x94e500d4, -0x8f840034, 0x3021, 0x30a5ffff, 0x3c076020, -0xa000bd2, 0x0, 0x44102a, 0x10400008, -0x0, 0x95020016, 0x30420001, 0x10400004, -0x0, 0x9742007e, 0x24420014, 0xa5020016, -0x3e00008, 0x0, 0x8f840028, 0x27bdffe0, -0xafbf0018, 0x94820034, 0x9483003e, 0x1060001a, -0x3048ffff, 0x9383002c, 0x24020001, 0x14620027, -0x8fbf0018, 0x8f820028, 0x818c2, 0x31080007, -0x621821, 0x2447003a, 0x24490054, 0x24440020, -0x24450030, 0x24460034, 0x90620040, 0x304200ff, -0x1021007, 0x30420001, 0x10400016, 0x8fbf0018, -0xe00093a, 0xafa90010, 0x8f820028, 0x94420034, -0xa000c54, 0x3048ffff, 0x94830036, 0x94820034, -0x1043000e, 0x8fbf0018, 0x94820036, 0xa4820034, -0x94820056, 0xa4820054, 0x8c82002c, 0xac820024, -0x94820032, 0xa4820030, 0x9482003c, 0xa482003a, -0x8fbf0018, 0xa000c14, 0x27bd0020, 0x3e00008, -0x27bd0020, 0x27bdffe8, 0xafbf0010, 0x8f4a0100, -0x3c050800, 0x8ca500e0, 0x3c020800, 0x90424efc, -0x3c0c0800, 0x958c4ef6, 0x1452821, 0x304b003f, -0x30a2007f, 0x3424021, 0x39690032, 0x3c02000a, -0x3963003f, 0x2c630001, 0x1024021, 0x2d290001, -0x2402ff80, 0xa22824, 0x1234825, 0xaf8a0034, -0x801821, 0xaf450024, 0x3021, 0x802821, -0x24070001, 0xaf880028, 0x3c040800, 0x24844ef0, -0xaf8c0024, 0x15200006, 0xa380002d, 0x24020020, -0x1562000e, 0x3402ffff, 0x1582000c, 0x0, -0x24020020, 0x15620005, 0x0, 0x8c630014, -0x2402ffff, 0x10620007, 0x0, 0xe00096d, -0x0, 0xa000cb0, 0x0, 0xe0009d8, -0x602021, 0xe000c49, 0x0, 0x8fbf0010, -0x24020c80, 0x27bd0018, 0x3e00008, 0xaf420024, -0x3c020800, 0x8c4200e0, 0x27bdffa0, 0xafb1003c, -0x821021, 0x2411ff80, 0xafbe0058, 0xafb70054, -0xafb20040, 0xafb00038, 0xafbf005c, 0xafb60050, -0xafb5004c, 0xafb40048, 0xafb30044, 0x511024, -0x8f480024, 0x8f490028, 0x8f470028, 0xaf420024, -0x3c020800, 0x8c4200e0, 0x809021, 0x24060006, -0x821021, 0x3042007f, 0x3421821, 0x3c02000a, -0x628021, 0x3c02001f, 0x3442ff80, 0xe23824, -0x27a40010, 0x260500f0, 0x122f024, 0x102b824, -0xe000601, 0xafa70030, 0x8fa20018, 0xae0200c4, -0x8fa2001c, 0xae0200c8, 0x8fa20024, 0xae0200cc, -0x93a40010, 0x920300d1, 0x2402ff80, 0x821024, -0x431025, 0x304900ff, 0x3083007f, 0x3122007f, -0x62102a, 0x10400004, 0x310c0, 0x1311026, -0x304900ff, 0x310c0, 0x31940, 0x621821, -0x3c020800, 0x8c4200dc, 0x920400d2, 0x2421021, -0x431021, 0x511024, 0xaf420028, 0x93a30010, -0x3063007f, 0x310c0, 0x31940, 0x621821, -0x3c020800, 0x8c4200dc, 0x2421021, 0x431021, -0x3042007f, 0x3421821, 0x3c02000c, 0x624021, -0x8fa30014, 0x2402ffff, 0x10620030, 0x309500ff, -0x93a20011, 0x95030014, 0x304400ff, 0x3063ffff, -0x64182b, 0x1060000d, 0x0, 0x95040014, -0x8d07001c, 0x8d060018, 0x3084ffff, 0x442023, -0x42100, 0x1021, 0xe43821, 0xe4202b, -0xc23021, 0xa000d2a, 0xc43021, 0x95040014, -0x8d07001c, 0x8d060018, 0x3084ffff, 0x822023, -0x42100, 0x1021, 0x801821, 0xc23023, -0xe4202b, 0xc43023, 0xe33823, 0xad07001c, -0xad060018, 0x93a20011, 0xa5020014, 0x97a20012, -0xa5020016, 0x8fa20014, 0xad020010, 0x8fa20014, -0xad02000c, 0x93a20011, 0xa5020020, 0x97a20012, -0xa5020022, 0x8fa20014, 0xad020024, 0x2406ff80, -0x2461024, 0x3256007f, 0xaf420024, 0x3561821, -0x3c02000a, 0x628021, 0x8e02004c, 0x8fa20020, -0x3124007f, 0x428c0, 0xae020050, 0x8fa20020, -0x42140, 0x852821, 0xae020070, 0x93a20010, -0x1208821, 0xa2020083, 0x93a20010, 0xa2020079, -0x92020085, 0x3042003f, 0xa2020085, 0x3c020800, -0x8c4200dc, 0x2421021, 0x451021, 0x461024, -0xaf42002c, 0x3c020800, 0x8c4200e4, 0x3c030800, -0x8c6300dc, 0x2421021, 0x441021, 0x461024, -0xaf420028, 0x3c020800, 0x8c4200e4, 0x2431821, -0x651821, 0x2421021, 0x441021, 0x3042007f, -0x3063007f, 0x93a50010, 0x3422021, 0x3431821, -0x3c02000e, 0x624021, 0x3c02000c, 0x10b1008c, -0x824821, 0x3233007f, 0x16600019, 0x2404ff80, -0x3c020800, 0x8c4200dc, 0x2421021, 0x441024, -0xaf42002c, 0x3c020800, 0x8c4200e4, 0x3c030800, -0x8c6300dc, 0x2421021, 0x441024, 0xaf420028, -0x3c020800, 0x8c4200e4, 0x2431821, 0x3063007f, -0x2421021, 0x3042007f, 0x3422021, 0x3431821, -0x3c02000e, 0x624021, 0x3c02000c, 0x824821, -0x9124000d, 0x2414ff80, 0x1021, 0x942025, -0xa124000d, 0x95040002, 0x95050014, 0x8d07001c, -0x3084ffff, 0x30a5ffff, 0x8d060018, 0x852023, -0x42100, 0xe43821, 0xc23021, 0xe4202b, -0xc43021, 0xad07001c, 0xad060018, 0x95020002, -0xa5020014, 0xa5000016, 0x8d020008, 0xad020010, -0x8d020008, 0xad02000c, 0x95020002, 0xa5020020, -0xa5000022, 0x8d020008, 0xad020024, 0x9122000d, -0x30420040, 0x10400042, 0x26220001, 0x3c020800, -0x8c4200e0, 0xa3b30028, 0x3c10000a, 0x2421021, -0x541024, 0xaf420024, 0x3c020800, 0x8c4200e0, -0xa380002c, 0x27a4002c, 0x2421021, 0x3042007f, -0x3421821, 0x701821, 0x8c6200d8, 0x8d260004, -0x27a50028, 0xafa9002c, 0x461021, 0xac6200d8, -0xe000ac0, 0xaf830028, 0x93a30028, 0x8f820028, -0xe00070a, 0xa04300d1, 0xe000c49, 0x0, -0x2541024, 0xaf420024, 0x3c020800, 0x8c4200dc, -0x132940, 0x1320c0, 0xa42021, 0x2421021, -0x441021, 0x541024, 0xaf42002c, 0x3c020800, -0x8c4200e4, 0x3c030800, 0x8c6300dc, 0x3563021, -0x2421021, 0x451021, 0x541024, 0xaf420028, -0x3c020800, 0x8c4200e4, 0x2431821, 0x641821, -0x2421021, 0x451021, 0x3042007f, 0x3063007f, -0x3422021, 0x3431821, 0x3c02000e, 0x624021, -0x3c02000c, 0xd08021, 0x824821, 0x26220001, -0x3043007f, 0x14750005, 0x304400ff, 0x2403ff80, -0x2231024, 0x431026, 0x304400ff, 0x93a20010, -0x808821, 0x25080028, 0x1444ff76, 0x25290020, -0x93a40010, 0x8fa30014, 0x2402ffff, 0x1062000a, -0x308900ff, 0x24820001, 0x24830001, 0x3042007f, -0x14550005, 0x306900ff, 0x2403ff80, 0x831024, -0x431026, 0x304900ff, 0x92020078, 0x305300ff, -0x11330032, 0x1208821, 0x3c020800, 0x8c4200dc, -0x3225007f, 0x520c0, 0x52940, 0xa42021, -0x2421021, 0x2406ff80, 0x441021, 0x461024, -0xaf42002c, 0x3c030800, 0x8c6300dc, 0x3c020800, -0x8c4200e4, 0x2431821, 0x2421021, 0x451021, -0x641821, 0x461024, 0x3063007f, 0xaf420028, -0x3431821, 0x3c02000e, 0x624021, 0x3c020800, -0x8c4200e4, 0x8d06000c, 0x1002021, 0x2421021, -0x451021, 0x3042007f, 0x3421821, 0x3c02000c, -0x624821, 0x10c0000d, 0x1202821, 0xe00072e, -0x0, 0x2402ff80, 0x2221824, 0x26240001, -0x622826, 0x3082007f, 0x14550002, 0x308300ff, -0x30a300ff, 0x1473ffd0, 0x608821, 0x8e030074, -0x3c027fff, 0x3442ffff, 0x621824, 0xae030074, -0xe00074f, 0x2402021, 0xaf570024, 0x8fa20030, -0xaf5e0028, 0x8fbf005c, 0x8fbe0058, 0x8fb70054, -0x8fb60050, 0x8fb5004c, 0x8fb40048, 0x8fb30044, -0x8fb20040, 0x8fb1003c, 0x8fb00038, 0x27bd0060, -0x3e00008, 0xaf42002c, 0x27bdffd8, 0xafb1001c, -0xafbf0020, 0xafb00018, 0x27510188, 0x92220003, -0x2408ff80, 0x3c03000a, 0x3047007f, 0xa3a70010, -0x8f460180, 0x3c020800, 0x8c4200e0, 0xaf860034, -0xc22821, 0xa81024, 0xaf420024, 0x92240000, -0x30a2007f, 0x3421021, 0x431021, 0xaf820028, -0x3084007f, 0x24020002, 0x14820025, 0x71940, -0x3c020800, 0x8c4200e4, 0xc21021, 0x432821, -0x30a2007f, 0x3421821, 0xa81024, 0xaf420028, -0x3c02000c, 0x621821, 0x9062000d, 0xafa30014, -0x481025, 0xa062000d, 0x8fa30014, 0x9062000d, -0x30420040, 0x5040006a, 0x8fbf0020, 0x8f860028, -0xa380002c, 0x27a40014, 0x8cc200d8, 0x8c630004, -0x27a50010, 0x431021, 0xe000ac0, 0xacc200d8, -0x93a30010, 0x8f820028, 0xe00070a, 0xa04300d1, -0xe000c49, 0x0, 0xa000eeb, 0x8fbf0020, -0xe000713, 0xc02021, 0xe000721, 0x0, -0x3c020008, 0x3428021, 0x92230001, 0x9202007b, -0x1443004f, 0x8fbf0020, 0x92220000, 0x3044007f, -0x24020004, 0x10820017, 0x28820005, 0x10400006, -0x24020005, 0x24020003, 0x10820007, 0x8fb1001c, -0xa000eec, 0x0, 0x10820012, 0x8fbf0020, -0xa000eec, 0x8fb1001c, 0x92050083, 0x92060078, -0x8e070074, 0x8f840034, 0x30a500ff, 0x73e02, -0x30c600ff, 0xe000757, 0x30e7007f, 0xa000eeb, -0x8fbf0020, 0xe000cb7, 0x8f840034, 0xa000eeb, -0x8fbf0020, 0x24020c80, 0xaf420024, 0x9202003e, -0x30420040, 0x10400020, 0x0, 0x9202003e, -0x21600, 0x21603, 0x4410006, 0x0, -0x8f840034, 0xe000684, 0x24050093, 0xa000eeb, -0x8fbf0020, 0x9202003f, 0x24030018, 0x304200ff, -0x1443000c, 0x8f840034, 0x24050039, 0xe00061c, -0x3021, 0xe000348, 0x8f840034, 0x24020012, -0xa202003f, 0xe000351, 0x8f840034, 0xa000eeb, -0x8fbf0020, 0x24050036, 0xe00061c, 0x3021, -0xa000eeb, 0x8fbf0020, 0xe000348, 0x8f840034, -0x92020005, 0x34420020, 0xa2020005, 0xe000351, -0x8f840034, 0xe0010a2, 0x8f840034, 0x8fbf0020, -0x8fb1001c, 0x8fb00018, 0x24020c80, 0x27bd0028, -0x3e00008, 0xaf420024, 0x27bdffe8, 0xafb00010, -0xafbf0014, 0x27430100, 0x94620008, 0x21400, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 18:58:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E82B106566C; Mon, 9 Jan 2012 18:58:13 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 86D5B8FC0C; Mon, 9 Jan 2012 18:58:12 +0000 (UTC) Received: by wgbdr11 with SMTP id dr11so2046270wgb.31 for ; Mon, 09 Jan 2012 10:58:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=A92afF1esTtOusS7PfbGvi4J2wSHFtKgdsiRL0w1RGA=; b=arDdSeGztB68SJVIbCjBpzld6hyJhP6XpMqvjtBCEp9Gj8sruKqua2I5PdBMgHsED+ 9WMdUDe4gvqKRl92boR76edWemrWZ2IyPIlVySprPWGiwxxol0H3PDDoi4OTiNnOTzS4 DCJzhH2csWCuA+VLcovO14wrnH8vyaAqQ/PkQ= Received: by 10.180.79.10 with SMTP id f10mr6783300wix.0.1326135491532; Mon, 09 Jan 2012 10:58:11 -0800 (PST) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua. [212.86.226.226]) by mx.google.com with ESMTPS id o41sm41154022wba.19.2012.01.09.10.58.09 (version=SSLv3 cipher=OTHER); Mon, 09 Jan 2012 10:58:10 -0800 (PST) Sender: Alexander Motin Message-ID: <4F0B38B9.1020302@FreeBSD.org> Date: Mon, 09 Jan 2012 20:58:01 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111112 Thunderbird/8.0 MIME-Version: 1.0 To: Maksim Yevmenkin References: <201112282249.pBSMnTZu028304@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r228939 - head/sys/dev/mps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 18:58:13 -0000 On 09.01.2012 20:54, Maksim Yevmenkin wrote: > On Wed, Dec 28, 2011 at 2:49 PM, Alexander Motin wrote: >> Author: mav >> Date: Wed Dec 28 22:49:28 2011 >> New Revision: 228939 >> URL: http://svn.freebsd.org/changeset/base/228939 >> >> Log: >> Set maximum I/O size for mps(4) to MAXPHYS. Looking into the code, I see >> no reason why it should be limited to 64K of DFLTPHYS. DMA data tag is any >> way set to allow MAXPHYS, S/G lists (chain elements) are sufficient and >> overflows are also handled. On my tests even 1MB I/Os are working fine. >> >> Reviewed by: ken@ >> >> Modified: >> head/sys/dev/mps/mps_sas.c >> >> Modified: head/sys/dev/mps/mps_sas.c >> ============================================================================== >> --- head/sys/dev/mps/mps_sas.c Wed Dec 28 22:18:53 2011 (r228938) >> +++ head/sys/dev/mps/mps_sas.c Wed Dec 28 22:49:28 2011 (r228939) >> @@ -937,6 +937,7 @@ mpssas_action(struct cam_sim *sim, union >> cpi->transport_version = 0; >> cpi->protocol = PROTO_SCSI; >> cpi->protocol_version = SCSI_REV_SPC; >> + cpi->maxio = MAXPHYS; >> cpi->ccb_h.status = CAM_REQ_CMP; >> break; >> } > > sorry for the late reply, but can we make in into tunable please? i > have in local tree > > --- mps_sas.c.orig 2011-11-17 02:05:04.000000000 -0800 > +++ mps_sas.c 2011-12-28 16:05:10.000000000 -0800 > @@ -121,6 +121,11 @@ > > MALLOC_DEFINE(M_MPSSAS, "MPSSAS", "MPS SAS memory"); > > +int mps_maxio = MAXPHYS; > +TUNABLE_INT("hw.mps.maxio",&mps_maxio); > +SYSCTL_INT(_hw_mps, OID_AUTO, maxio, CTLFLAG_RD,&mps_maxio, 0, > + "CAM maxio override\n"); > + > static __inline int mpssas_set_lun(uint8_t *lun, u_int ccblun); > static struct mpssas_target * mpssas_alloc_target(struct mpssas_softc *, > struct mpssas_target *); > @@ -938,6 +943,7 @@ > cpi->protocol = PROTO_SCSI; > cpi->protocol_version = SCSI_REV_SPC; > cpi->ccb_h.status = CAM_REQ_CMP; > + cpi->maxio = mps_maxio; > break; > } > case XPT_GET_TRAN_SETTINGS: We can. but could you explain why? Have you found any problems this change? -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 19:04:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DF29106564A; Mon, 9 Jan 2012 19:04:25 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-tul01m020-f182.google.com (mail-tul01m020-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id C0E3C8FC16; Mon, 9 Jan 2012 19:04:24 +0000 (UTC) Received: by obbwd18 with SMTP id wd18so6152729obb.13 for ; Mon, 09 Jan 2012 11:04:24 -0800 (PST) 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=rhuG35GXg8ZoF8llZeBuxjLpqlaIT8yqLdRCV1qODUY=; b=QqP2mAIsw8PnSO/HmvPKi6EHSUUnNrnfuT3gaeAtUCelEkqKrPyg026M7yShrzprxR H9EXJ2/s2BQGSDrTY2laah7c1cyMsmEgPqCcFOltQt8fGg2lxEY6vL2blNQAxpPC31SR JjhVE1rZsLoNs7uKbcBxGybApV/0qVCaDJBu4= MIME-Version: 1.0 Received: by 10.182.39.70 with SMTP id n6mr8871850obk.41.1326135863972; Mon, 09 Jan 2012 11:04:23 -0800 (PST) Received: by 10.182.152.6 with HTTP; Mon, 9 Jan 2012 11:04:23 -0800 (PST) In-Reply-To: <4F0B38B9.1020302@FreeBSD.org> References: <201112282249.pBSMnTZu028304@svn.freebsd.org> <4F0B38B9.1020302@FreeBSD.org> Date: Mon, 9 Jan 2012 11:04:23 -0800 Message-ID: From: Garrett Cooper To: Alexander Motin 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, Maksim Yevmenkin Subject: Re: svn commit: r228939 - head/sys/dev/mps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 19:04:25 -0000 2012/1/9 Alexander Motin : > On 09.01.2012 20:54, Maksim Yevmenkin wrote: >> >> On Wed, Dec 28, 2011 at 2:49 PM, Alexander Motin =A0wro= te: >> >>> Author: mav >>> Date: Wed Dec 28 22:49:28 2011 >>> New Revision: 228939 >>> URL: http://svn.freebsd.org/changeset/base/228939 >>> >>> Log: >>> =A0Set maximum I/O size for mps(4) to MAXPHYS. Looking into the code, I= see >>> =A0no reason why it should be limited to 64K of DFLTPHYS. DMA data tag = is >>> any >>> =A0way set to allow MAXPHYS, S/G lists (chain elements) are sufficient = and >>> =A0overflows are also handled. On my tests even 1MB I/Os are working fi= ne. >>> >>> =A0Reviewed by: =A0ken@ >>> >>> Modified: >>> =A0head/sys/dev/mps/mps_sas.c >>> >>> Modified: head/sys/dev/mps/mps_sas.c >>> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/sys/dev/mps/mps_sas.c =A0Wed Dec 28 22:18:53 2011 =A0 =A0 =A0 = =A0(r228938) >>> +++ head/sys/dev/mps/mps_sas.c =A0Wed Dec 28 22:49:28 2011 =A0 =A0 =A0 = =A0(r228939) >>> @@ -937,6 +937,7 @@ mpssas_action(struct cam_sim *sim, union >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cpi->transport_version =3D 0; >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cpi->protocol =3D PROTO_SCSI; >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cpi->protocol_version =3D SCSI_REV_SPC; >>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 cpi->maxio =3D MAXPHYS; >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cpi->ccb_h.status =3D CAM_REQ_CMP; >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; >>> =A0 =A0 =A0 =A0} >> >> >> sorry for the late reply, but can we make in into tunable please? i >> have in local tree >> >> --- mps_sas.c.orig =A0 =A0 =A02011-11-17 02:05:04.000000000 -0800 >> +++ mps_sas.c =A0 2011-12-28 16:05:10.000000000 -0800 >> @@ -121,6 +121,11 @@ >> >> =A0MALLOC_DEFINE(M_MPSSAS, "MPSSAS", "MPS SAS memory"); >> >> +int mps_maxio =3D MAXPHYS; >> +TUNABLE_INT("hw.mps.maxio",&mps_maxio); >> +SYSCTL_INT(_hw_mps, OID_AUTO, maxio, CTLFLAG_RD,&mps_maxio, 0, >> + =A0 =A0 =A0 "CAM maxio override\n"); >> + >> =A0static __inline int mpssas_set_lun(uint8_t *lun, u_int ccblun); >> =A0static struct mpssas_target * mpssas_alloc_target(struct mpssas_softc= *, >> =A0 =A0 =A0struct mpssas_target *); >> @@ -938,6 +943,7 @@ >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cpi->protocol =3D PROTO_SCSI; >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cpi->protocol_version =3D SCSI_REV_SPC; >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cpi->ccb_h.status =3D CAM_REQ_CMP; >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 cpi->maxio =3D mps_maxio; >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; >> =A0 =A0 =A0 =A0} >> =A0 =A0 =A0 =A0case XPT_GET_TRAN_SETTINGS: > > > We can. but could you explain why? Have you found any problems this chang= e? It would make it nice when dealing with different controllers -- a similar example is that mfi(4) has a tunable called hw.mfi.max_cmds which controls the I/O command queue size as not all MegaRAID cards have the same I/O queue size capabilities. Thanks, -Garrett From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 19:07:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B1AF1065673; Mon, 9 Jan 2012 19:07:15 +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 3870D8FC13; Mon, 9 Jan 2012 19:07: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 q09J7F8K053926; Mon, 9 Jan 2012 19:07:15 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q09J7Fv4053923; Mon, 9 Jan 2012 19:07:15 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201201091907.q09J7Fv4053923@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 9 Jan 2012 19:07:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229864 - stable/9/sys/dev/bce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 19:07:15 -0000 Author: yongari Date: Mon Jan 9 19:07:14 2012 New Revision: 229864 URL: http://svn.freebsd.org/changeset/base/229864 Log: MFC r228476: Rework link state tracking and remove superfluous link UP/DOWN messages. o Add check for actually resolved speed in miibus_statchg callback instead of blindly reprogramming BCE_EMAC_MODE register. The callback may be called multiple times(e.g. link UP, link transition, auto-negotiate complete etc) while auto-negotiation is in progress. All unresolved link state changes are ignored now and setting BCE_EMAC_MODE after link establishment is done once. o bce(4) is careful enough not to drive MII_TICK if driver got a valid link. To detect lost link, bce(4) relied on link state change interrupt and if driver see the interrupt, it forced to drive MII_TICK by calling bce_tick() in interrupt handler. Because bce(4) generates multiple link state change interrupts while auto-negotiation is in progress, bce_tick() would be called multiple times and this resulted in generating multiple link UP/DOWN messages. With this change, bce_tick() is not called in interrupt handler anymore such that miibus_statchg callback handles link state changes with consistent manner. Modified: stable/9/sys/dev/bce/if_bce.c stable/9/sys/dev/bce/if_bcereg.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/dev/bce/if_bce.c ============================================================================== --- stable/9/sys/dev/bce/if_bce.c Mon Jan 9 18:55:28 2012 (r229863) +++ stable/9/sys/dev/bce/if_bce.c Mon Jan 9 19:07:14 2012 (r229864) @@ -1982,6 +1982,7 @@ static void bce_miibus_statchg(device_t dev) { struct bce_softc *sc; + struct ifnet *ifp; struct mii_data *mii; int val; @@ -1989,42 +1990,57 @@ bce_miibus_statchg(device_t dev) DBENTER(BCE_VERBOSE_PHY); + ifp = sc->bce_ifp; mii = device_get_softc(sc->bce_miibus); + if (mii == NULL || ifp == NULL || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + return; + sc->bce_link_up = FALSE; val = REG_RD(sc, BCE_EMAC_MODE); val &= ~(BCE_EMAC_MODE_PORT | BCE_EMAC_MODE_HALF_DUPLEX | BCE_EMAC_MODE_MAC_LOOP | BCE_EMAC_MODE_FORCE_LINK | BCE_EMAC_MODE_25G); /* Set MII or GMII interface based on the PHY speed. */ - switch (IFM_SUBTYPE(mii->mii_media_active)) { - case IFM_10_T: - if (BCE_CHIP_NUM(sc) != BCE_CHIP_NUM_5706) { - DBPRINT(sc, BCE_INFO_PHY, - "Enabling 10Mb interface.\n"); - val |= BCE_EMAC_MODE_PORT_MII_10; + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == + (IFM_ACTIVE | IFM_AVALID)) { + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_10_T: + if (BCE_CHIP_NUM(sc) != BCE_CHIP_NUM_5706) { + DBPRINT(sc, BCE_INFO_PHY, + "Enabling 10Mb interface.\n"); + val |= BCE_EMAC_MODE_PORT_MII_10; + sc->bce_link_up = TRUE; + break; + } + /* FALLTHROUGH */ + case IFM_100_TX: + DBPRINT(sc, BCE_INFO_PHY, "Enabling MII interface.\n"); + val |= BCE_EMAC_MODE_PORT_MII; + sc->bce_link_up = TRUE; + break; + case IFM_2500_SX: + DBPRINT(sc, BCE_INFO_PHY, "Enabling 2.5G MAC mode.\n"); + val |= BCE_EMAC_MODE_25G; + /* FALLTHROUGH */ + case IFM_1000_T: + case IFM_1000_SX: + DBPRINT(sc, BCE_INFO_PHY, "Enabling GMII interface.\n"); + val |= BCE_EMAC_MODE_PORT_GMII; + sc->bce_link_up = TRUE; + if (bce_verbose || bootverbose) + BCE_PRINTF("Gigabit link up!\n"); + break; + default: + DBPRINT(sc, BCE_INFO_PHY, "Unknown link speed.\n"); break; } - /* fall-through */ - case IFM_100_TX: - DBPRINT(sc, BCE_INFO_PHY, "Enabling MII interface.\n"); - val |= BCE_EMAC_MODE_PORT_MII; - break; - case IFM_2500_SX: - DBPRINT(sc, BCE_INFO_PHY, "Enabling 2.5G MAC mode.\n"); - val |= BCE_EMAC_MODE_25G; - /* fall-through */ - case IFM_1000_T: - case IFM_1000_SX: - DBPRINT(sc, BCE_INFO_PHY, "Enabling GMII interface.\n"); - val |= BCE_EMAC_MODE_PORT_GMII; - break; - default: - DBPRINT(sc, BCE_INFO_PHY, "Unknown link speed, enabling " - "default GMII interface.\n"); - val |= BCE_EMAC_MODE_PORT_GMII; } + if (sc->bce_link_up == FALSE) + return; + /* Set half or full duplex based on PHY settings. */ if ((mii->mii_media_active & IFM_GMASK) == IFM_HDX) { DBPRINT(sc, BCE_INFO_PHY, @@ -2036,7 +2052,7 @@ bce_miibus_statchg(device_t dev) REG_WR(sc, BCE_EMAC_MODE, val); - if ((mii->mii_media_active & IFM_ETH_RXPAUSE) != 0) { + if ((mii->mii_media_active & IFM_ETH_RXPAUSE) != 0) { DBPRINT(sc, BCE_INFO_PHY, "%s(): Enabling RX flow control.\n", __FUNCTION__); BCE_SETBIT(sc, BCE_EMAC_RX_MODE, BCE_EMAC_RX_MODE_FLOW_EN); @@ -2046,7 +2062,7 @@ bce_miibus_statchg(device_t dev) BCE_CLRBIT(sc, BCE_EMAC_RX_MODE, BCE_EMAC_RX_MODE_FLOW_EN); } - if ((mii->mii_media_active & IFM_ETH_TXPAUSE) != 0) { + if ((mii->mii_media_active & IFM_ETH_TXPAUSE) != 0) { DBPRINT(sc, BCE_INFO_PHY, "%s(): Enabling TX flow control.\n", __FUNCTION__); BCE_SETBIT(sc, BCE_EMAC_TX_MODE, BCE_EMAC_TX_MODE_FLOW_EN); @@ -6206,15 +6222,11 @@ bce_phy_intr(struct bce_softc *sc) DBPRINT(sc, BCE_INFO_PHY, "%s(): Link is now DOWN.\n", __FUNCTION__); } - /* - * Assume link is down and allow - * tick routine to update the state - * based on the actual media state. + * Link state changed, allow tick routine to update + * the state baased on actual media state. */ - sc->bce_link_up = FALSE; - callout_stop(&sc->bce_tick_callout); - bce_tick(sc); + sc->bce_link_tick = TRUE; } /* Acknowledge the link change interrupt. */ @@ -6898,12 +6910,13 @@ bce_init_locked(struct bce_softc *sc) /* Enable host interrupts. */ bce_enable_intr(sc, 1); - bce_ifmedia_upd_locked(ifp); - /* Let the OS know the driver is up and running. */ ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + sc->bce_link_tick = TRUE; + bce_ifmedia_upd_locked(ifp); + callout_reset(&sc->bce_tick_callout, hz, bce_tick, sc); bce_init_locked_exit: @@ -8199,31 +8212,19 @@ bce_tick(void *xsc) bce_watchdog(sc); /* If link is up already up then we're done. */ - if (sc->bce_link_up == TRUE) + if (sc->bce_link_tick == FALSE && sc->bce_link_up == TRUE) goto bce_tick_exit; /* Link is down. Check what the PHY's doing. */ mii = device_get_softc(sc->bce_miibus); mii_tick(mii); - /* Check if the link has come up. */ - if ((mii->mii_media_status & IFM_ACTIVE) && - (IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE)) { + sc->bce_link_tick = FALSE; + /* Now that link is up, handle any outstanding TX traffic. */ + if (sc->bce_link_up == TRUE && !IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { DBPRINT(sc, BCE_VERBOSE_MISC, - "%s(): Link up!\n", __FUNCTION__); - sc->bce_link_up = TRUE; - if ((IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T || - IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_SX || - IFM_SUBTYPE(mii->mii_media_active) == IFM_2500_SX) && - (bce_verbose || bootverbose)) - BCE_PRINTF("Gigabit link up!\n"); - - /* Now that link is up, handle any outstanding TX traffic. */ - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { - DBPRINT(sc, BCE_VERBOSE_MISC, "%s(): Found " - "pending TX traffic.\n", __FUNCTION__); - bce_start_locked(ifp); - } + "%s(): Found pending TX traffic.\n", __FUNCTION__); + bce_start_locked(ifp); } bce_tick_exit: Modified: stable/9/sys/dev/bce/if_bcereg.h ============================================================================== --- stable/9/sys/dev/bce/if_bcereg.h Mon Jan 9 18:55:28 2012 (r229863) +++ stable/9/sys/dev/bce/if_bcereg.h Mon Jan 9 19:07:14 2012 (r229864) @@ -6560,6 +6560,7 @@ struct bce_softc u16 pg_prod; u16 pg_cons; + int bce_link_tick; int bce_link_up; struct callout bce_tick_callout; struct callout bce_pulse_callout; From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 19:07:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CB421065672; Mon, 9 Jan 2012 19:07:46 +0000 (UTC) (envelope-from maksim.yevmenkin@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 E654C8FC13; Mon, 9 Jan 2012 19:07:45 +0000 (UTC) Received: by ggnp1 with SMTP id p1so2042768ggn.13 for ; Mon, 09 Jan 2012 11:07:45 -0800 (PST) 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=u2828H5TTO2gQUXQaiLaq1wHr5c2XvNHaw0jovyIZSg=; b=RJIz22v0Y/9P4tNsPalvkvWS3+BPmG+Mv0aFfNDomfzVYGE7KShkM08nLbE44Ul9Jw JfRngUfbLf28595yDUu1xJ9ZMSUF5qRqdwO4WE/gKaNQExYSmE5x4s3F8q53wH9iZ2Sl aGwFGrcuVvNFhrms1DH+heKi1gxfMdJlgaBFU= MIME-Version: 1.0 Received: by 10.101.82.2 with SMTP id j2mr7167111anl.77.1326135714181; Mon, 09 Jan 2012 11:01:54 -0800 (PST) Sender: maksim.yevmenkin@gmail.com Received: by 10.101.41.18 with HTTP; Mon, 9 Jan 2012 11:01:54 -0800 (PST) In-Reply-To: <4F0B38B9.1020302@FreeBSD.org> References: <201112282249.pBSMnTZu028304@svn.freebsd.org> <4F0B38B9.1020302@FreeBSD.org> Date: Mon, 9 Jan 2012 11:01:54 -0800 X-Google-Sender-Auth: f97CuNOxthJQbKHOWSIzhd6_hfY Message-ID: From: Maksim Yevmenkin To: Alexander Motin 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 Subject: Re: svn commit: r228939 - head/sys/dev/mps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 19:07:46 -0000 2012/1/9 Alexander Motin : > On 09.01.2012 20:54, Maksim Yevmenkin wrote: >> >> On Wed, Dec 28, 2011 at 2:49 PM, Alexander Motin =A0wro= te: >>> >>> Author: mav >>> Date: Wed Dec 28 22:49:28 2011 >>> New Revision: 228939 >>> URL: http://svn.freebsd.org/changeset/base/228939 >>> >>> Log: >>> =A0Set maximum I/O size for mps(4) to MAXPHYS. Looking into the code, I= see >>> =A0no reason why it should be limited to 64K of DFLTPHYS. DMA data tag = is >>> any >>> =A0way set to allow MAXPHYS, S/G lists (chain elements) are sufficient = and >>> =A0overflows are also handled. On my tests even 1MB I/Os are working fi= ne. >>> >>> =A0Reviewed by: =A0ken@ >>> >>> Modified: >>> =A0head/sys/dev/mps/mps_sas.c >>> >>> Modified: head/sys/dev/mps/mps_sas.c >>> >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>> --- head/sys/dev/mps/mps_sas.c =A0Wed Dec 28 22:18:53 2011 =A0 =A0 =A0 = =A0(r228938) >>> +++ head/sys/dev/mps/mps_sas.c =A0Wed Dec 28 22:49:28 2011 =A0 =A0 =A0 = =A0(r228939) >>> @@ -937,6 +937,7 @@ mpssas_action(struct cam_sim *sim, union >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cpi->transport_version =3D 0; >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cpi->protocol =3D PROTO_SCSI; >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cpi->protocol_version =3D SCSI_REV_SPC; >>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 cpi->maxio =3D MAXPHYS; >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cpi->ccb_h.status =3D CAM_REQ_CMP; >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; >>> =A0 =A0 =A0 =A0} >> >> >> sorry for the late reply, but can we make in into tunable please? i >> have in local tree >> >> --- mps_sas.c.orig =A0 =A0 =A02011-11-17 02:05:04.000000000 -0800 >> +++ mps_sas.c =A0 2011-12-28 16:05:10.000000000 -0800 >> @@ -121,6 +121,11 @@ >> >> =A0MALLOC_DEFINE(M_MPSSAS, "MPSSAS", "MPS SAS memory"); >> >> +int mps_maxio =3D MAXPHYS; >> +TUNABLE_INT("hw.mps.maxio",&mps_maxio); >> +SYSCTL_INT(_hw_mps, OID_AUTO, maxio, CTLFLAG_RD,&mps_maxio, 0, >> >> + =A0 =A0 =A0 "CAM maxio override\n"); >> + >> =A0static __inline int mpssas_set_lun(uint8_t *lun, u_int ccblun); >> =A0static struct mpssas_target * mpssas_alloc_target(struct mpssas_softc= *, >> =A0 =A0 =A0struct mpssas_target *); >> @@ -938,6 +943,7 @@ >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cpi->protocol =3D PROTO_SCSI; >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cpi->protocol_version =3D SCSI_REV_SPC; >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cpi->ccb_h.status =3D CAM_REQ_CMP; >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 cpi->maxio =3D mps_maxio; >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; >> =A0 =A0 =A0 =A0} >> =A0 =A0 =A0 =A0case XPT_GET_TRAN_SETTINGS: > > > We can. but could you explain why? Have you found any problems this chang= e? not really. i've had this patch in the local tree for a while now. we are experimenting with various MAXPHYS/maxio settings and having this tunable is very handy. basically, we can set MAXPHYS to some larger value and tweak maxio (for testing purposes) without recompiling/installing new kernel. thanks, max From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 19:08:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF294106566B; Mon, 9 Jan 2012 19:08:52 +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 CCB0B8FC0C; Mon, 9 Jan 2012 19:08:52 +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 q09J8qqI054011; Mon, 9 Jan 2012 19:08:52 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q09J8qe7054007; Mon, 9 Jan 2012 19:08:52 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201201091908.q09J8qe7054007@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 9 Jan 2012 19:08:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229865 - stable/8/sys/dev/bce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 19:08:53 -0000 Author: yongari Date: Mon Jan 9 19:08:52 2012 New Revision: 229865 URL: http://svn.freebsd.org/changeset/base/229865 Log: MFC r228476: Rework link state tracking and remove superfluous link UP/DOWN messages. o Add check for actually resolved speed in miibus_statchg callback instead of blindly reprogramming BCE_EMAC_MODE register. The callback may be called multiple times(e.g. link UP, link transition, auto-negotiate complete etc) while auto-negotiation is in progress. All unresolved link state changes are ignored now and setting BCE_EMAC_MODE after link establishment is done once. o bce(4) is careful enough not to drive MII_TICK if driver got a valid link. To detect lost link, bce(4) relied on link state change interrupt and if driver see the interrupt, it forced to drive MII_TICK by calling bce_tick() in interrupt handler. Because bce(4) generates multiple link state change interrupts while auto-negotiation is in progress, bce_tick() would be called multiple times and this resulted in generating multiple link UP/DOWN messages. With this change, bce_tick() is not called in interrupt handler anymore such that miibus_statchg callback handles link state changes with consistent manner. Modified: stable/8/sys/dev/bce/if_bce.c stable/8/sys/dev/bce/if_bcereg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/bce/if_bce.c ============================================================================== --- stable/8/sys/dev/bce/if_bce.c Mon Jan 9 19:07:14 2012 (r229864) +++ stable/8/sys/dev/bce/if_bce.c Mon Jan 9 19:08:52 2012 (r229865) @@ -1986,6 +1986,7 @@ static void bce_miibus_statchg(device_t dev) { struct bce_softc *sc; + struct ifnet *ifp; struct mii_data *mii; int val; @@ -1993,42 +1994,57 @@ bce_miibus_statchg(device_t dev) DBENTER(BCE_VERBOSE_PHY); + ifp = sc->bce_ifp; mii = device_get_softc(sc->bce_miibus); + if (mii == NULL || ifp == NULL || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + return; + sc->bce_link_up = FALSE; val = REG_RD(sc, BCE_EMAC_MODE); val &= ~(BCE_EMAC_MODE_PORT | BCE_EMAC_MODE_HALF_DUPLEX | BCE_EMAC_MODE_MAC_LOOP | BCE_EMAC_MODE_FORCE_LINK | BCE_EMAC_MODE_25G); /* Set MII or GMII interface based on the PHY speed. */ - switch (IFM_SUBTYPE(mii->mii_media_active)) { - case IFM_10_T: - if (BCE_CHIP_NUM(sc) != BCE_CHIP_NUM_5706) { - DBPRINT(sc, BCE_INFO_PHY, - "Enabling 10Mb interface.\n"); - val |= BCE_EMAC_MODE_PORT_MII_10; + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == + (IFM_ACTIVE | IFM_AVALID)) { + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_10_T: + if (BCE_CHIP_NUM(sc) != BCE_CHIP_NUM_5706) { + DBPRINT(sc, BCE_INFO_PHY, + "Enabling 10Mb interface.\n"); + val |= BCE_EMAC_MODE_PORT_MII_10; + sc->bce_link_up = TRUE; + break; + } + /* FALLTHROUGH */ + case IFM_100_TX: + DBPRINT(sc, BCE_INFO_PHY, "Enabling MII interface.\n"); + val |= BCE_EMAC_MODE_PORT_MII; + sc->bce_link_up = TRUE; + break; + case IFM_2500_SX: + DBPRINT(sc, BCE_INFO_PHY, "Enabling 2.5G MAC mode.\n"); + val |= BCE_EMAC_MODE_25G; + /* FALLTHROUGH */ + case IFM_1000_T: + case IFM_1000_SX: + DBPRINT(sc, BCE_INFO_PHY, "Enabling GMII interface.\n"); + val |= BCE_EMAC_MODE_PORT_GMII; + sc->bce_link_up = TRUE; + if (bce_verbose || bootverbose) + BCE_PRINTF("Gigabit link up!\n"); + break; + default: + DBPRINT(sc, BCE_INFO_PHY, "Unknown link speed.\n"); break; } - /* fall-through */ - case IFM_100_TX: - DBPRINT(sc, BCE_INFO_PHY, "Enabling MII interface.\n"); - val |= BCE_EMAC_MODE_PORT_MII; - break; - case IFM_2500_SX: - DBPRINT(sc, BCE_INFO_PHY, "Enabling 2.5G MAC mode.\n"); - val |= BCE_EMAC_MODE_25G; - /* fall-through */ - case IFM_1000_T: - case IFM_1000_SX: - DBPRINT(sc, BCE_INFO_PHY, "Enabling GMII interface.\n"); - val |= BCE_EMAC_MODE_PORT_GMII; - break; - default: - DBPRINT(sc, BCE_INFO_PHY, "Unknown link speed, enabling " - "default GMII interface.\n"); - val |= BCE_EMAC_MODE_PORT_GMII; } + if (sc->bce_link_up == FALSE) + return; + /* Set half or full duplex based on PHY settings. */ if ((mii->mii_media_active & IFM_GMASK) == IFM_HDX) { DBPRINT(sc, BCE_INFO_PHY, @@ -2040,7 +2056,7 @@ bce_miibus_statchg(device_t dev) REG_WR(sc, BCE_EMAC_MODE, val); - if ((mii->mii_media_active & IFM_ETH_RXPAUSE) != 0) { + if ((mii->mii_media_active & IFM_ETH_RXPAUSE) != 0) { DBPRINT(sc, BCE_INFO_PHY, "%s(): Enabling RX flow control.\n", __FUNCTION__); BCE_SETBIT(sc, BCE_EMAC_RX_MODE, BCE_EMAC_RX_MODE_FLOW_EN); @@ -2050,7 +2066,7 @@ bce_miibus_statchg(device_t dev) BCE_CLRBIT(sc, BCE_EMAC_RX_MODE, BCE_EMAC_RX_MODE_FLOW_EN); } - if ((mii->mii_media_active & IFM_ETH_TXPAUSE) != 0) { + if ((mii->mii_media_active & IFM_ETH_TXPAUSE) != 0) { DBPRINT(sc, BCE_INFO_PHY, "%s(): Enabling TX flow control.\n", __FUNCTION__); BCE_SETBIT(sc, BCE_EMAC_TX_MODE, BCE_EMAC_TX_MODE_FLOW_EN); @@ -6210,15 +6226,11 @@ bce_phy_intr(struct bce_softc *sc) DBPRINT(sc, BCE_INFO_PHY, "%s(): Link is now DOWN.\n", __FUNCTION__); } - /* - * Assume link is down and allow - * tick routine to update the state - * based on the actual media state. + * Link state changed, allow tick routine to update + * the state baased on actual media state. */ - sc->bce_link_up = FALSE; - callout_stop(&sc->bce_tick_callout); - bce_tick(sc); + sc->bce_link_tick = TRUE; } /* Acknowledge the link change interrupt. */ @@ -6902,12 +6914,13 @@ bce_init_locked(struct bce_softc *sc) /* Enable host interrupts. */ bce_enable_intr(sc, 1); - bce_ifmedia_upd_locked(ifp); - /* Let the OS know the driver is up and running. */ ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + sc->bce_link_tick = TRUE; + bce_ifmedia_upd_locked(ifp); + callout_reset(&sc->bce_tick_callout, hz, bce_tick, sc); bce_init_locked_exit: @@ -8203,31 +8216,19 @@ bce_tick(void *xsc) bce_watchdog(sc); /* If link is up already up then we're done. */ - if (sc->bce_link_up == TRUE) + if (sc->bce_link_tick == FALSE && sc->bce_link_up == TRUE) goto bce_tick_exit; /* Link is down. Check what the PHY's doing. */ mii = device_get_softc(sc->bce_miibus); mii_tick(mii); - /* Check if the link has come up. */ - if ((mii->mii_media_status & IFM_ACTIVE) && - (IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE)) { + sc->bce_link_tick = FALSE; + /* Now that link is up, handle any outstanding TX traffic. */ + if (sc->bce_link_up == TRUE && !IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { DBPRINT(sc, BCE_VERBOSE_MISC, - "%s(): Link up!\n", __FUNCTION__); - sc->bce_link_up = TRUE; - if ((IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T || - IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_SX || - IFM_SUBTYPE(mii->mii_media_active) == IFM_2500_SX) && - (bce_verbose || bootverbose)) - BCE_PRINTF("Gigabit link up!\n"); - - /* Now that link is up, handle any outstanding TX traffic. */ - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { - DBPRINT(sc, BCE_VERBOSE_MISC, "%s(): Found " - "pending TX traffic.\n", __FUNCTION__); - bce_start_locked(ifp); - } + "%s(): Found pending TX traffic.\n", __FUNCTION__); + bce_start_locked(ifp); } bce_tick_exit: Modified: stable/8/sys/dev/bce/if_bcereg.h ============================================================================== --- stable/8/sys/dev/bce/if_bcereg.h Mon Jan 9 19:07:14 2012 (r229864) +++ stable/8/sys/dev/bce/if_bcereg.h Mon Jan 9 19:08:52 2012 (r229865) @@ -6560,6 +6560,7 @@ struct bce_softc u16 pg_prod; u16 pg_cons; + int bce_link_tick; int bce_link_up; struct callout bce_tick_callout; struct callout bce_pulse_callout; From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 19:10:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 007C8106564A; Mon, 9 Jan 2012 19:10:12 +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 E22728FC0A; Mon, 9 Jan 2012 19:10:11 +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 q09JABw5054089; Mon, 9 Jan 2012 19:10:11 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q09JABV8054086; Mon, 9 Jan 2012 19:10:11 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201201091910.q09JABV8054086@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 9 Jan 2012 19:10:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229866 - stable/7/sys/dev/bce X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 19:10:12 -0000 Author: yongari Date: Mon Jan 9 19:10:11 2012 New Revision: 229866 URL: http://svn.freebsd.org/changeset/base/229866 Log: MFC r228476: Rework link state tracking and remove superfluous link UP/DOWN messages. o Add check for actually resolved speed in miibus_statchg callback instead of blindly reprogramming BCE_EMAC_MODE register. The callback may be called multiple times(e.g. link UP, link transition, auto-negotiate complete etc) while auto-negotiation is in progress. All unresolved link state changes are ignored now and setting BCE_EMAC_MODE after link establishment is done once. o bce(4) is careful enough not to drive MII_TICK if driver got a valid link. To detect lost link, bce(4) relied on link state change interrupt and if driver see the interrupt, it forced to drive MII_TICK by calling bce_tick() in interrupt handler. Because bce(4) generates multiple link state change interrupts while auto-negotiation is in progress, bce_tick() would be called multiple times and this resulted in generating multiple link UP/DOWN messages. With this change, bce_tick() is not called in interrupt handler anymore such that miibus_statchg callback handles link state changes with consistent manner. Modified: stable/7/sys/dev/bce/if_bce.c stable/7/sys/dev/bce/if_bcereg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/bce/if_bce.c ============================================================================== --- stable/7/sys/dev/bce/if_bce.c Mon Jan 9 19:08:52 2012 (r229865) +++ stable/7/sys/dev/bce/if_bce.c Mon Jan 9 19:10:11 2012 (r229866) @@ -1986,6 +1986,7 @@ static void bce_miibus_statchg(device_t dev) { struct bce_softc *sc; + struct ifnet *ifp; struct mii_data *mii; int val; @@ -1993,42 +1994,57 @@ bce_miibus_statchg(device_t dev) DBENTER(BCE_VERBOSE_PHY); + ifp = sc->bce_ifp; mii = device_get_softc(sc->bce_miibus); + if (mii == NULL || ifp == NULL || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + return; + sc->bce_link_up = FALSE; val = REG_RD(sc, BCE_EMAC_MODE); val &= ~(BCE_EMAC_MODE_PORT | BCE_EMAC_MODE_HALF_DUPLEX | BCE_EMAC_MODE_MAC_LOOP | BCE_EMAC_MODE_FORCE_LINK | BCE_EMAC_MODE_25G); /* Set MII or GMII interface based on the PHY speed. */ - switch (IFM_SUBTYPE(mii->mii_media_active)) { - case IFM_10_T: - if (BCE_CHIP_NUM(sc) != BCE_CHIP_NUM_5706) { - DBPRINT(sc, BCE_INFO_PHY, - "Enabling 10Mb interface.\n"); - val |= BCE_EMAC_MODE_PORT_MII_10; + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == + (IFM_ACTIVE | IFM_AVALID)) { + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_10_T: + if (BCE_CHIP_NUM(sc) != BCE_CHIP_NUM_5706) { + DBPRINT(sc, BCE_INFO_PHY, + "Enabling 10Mb interface.\n"); + val |= BCE_EMAC_MODE_PORT_MII_10; + sc->bce_link_up = TRUE; + break; + } + /* FALLTHROUGH */ + case IFM_100_TX: + DBPRINT(sc, BCE_INFO_PHY, "Enabling MII interface.\n"); + val |= BCE_EMAC_MODE_PORT_MII; + sc->bce_link_up = TRUE; + break; + case IFM_2500_SX: + DBPRINT(sc, BCE_INFO_PHY, "Enabling 2.5G MAC mode.\n"); + val |= BCE_EMAC_MODE_25G; + /* FALLTHROUGH */ + case IFM_1000_T: + case IFM_1000_SX: + DBPRINT(sc, BCE_INFO_PHY, "Enabling GMII interface.\n"); + val |= BCE_EMAC_MODE_PORT_GMII; + sc->bce_link_up = TRUE; + if (bce_verbose || bootverbose) + BCE_PRINTF("Gigabit link up!\n"); + break; + default: + DBPRINT(sc, BCE_INFO_PHY, "Unknown link speed.\n"); break; } - /* fall-through */ - case IFM_100_TX: - DBPRINT(sc, BCE_INFO_PHY, "Enabling MII interface.\n"); - val |= BCE_EMAC_MODE_PORT_MII; - break; - case IFM_2500_SX: - DBPRINT(sc, BCE_INFO_PHY, "Enabling 2.5G MAC mode.\n"); - val |= BCE_EMAC_MODE_25G; - /* fall-through */ - case IFM_1000_T: - case IFM_1000_SX: - DBPRINT(sc, BCE_INFO_PHY, "Enabling GMII interface.\n"); - val |= BCE_EMAC_MODE_PORT_GMII; - break; - default: - DBPRINT(sc, BCE_INFO_PHY, "Unknown link speed, enabling " - "default GMII interface.\n"); - val |= BCE_EMAC_MODE_PORT_GMII; } + if (sc->bce_link_up == FALSE) + return; + /* Set half or full duplex based on PHY settings. */ if ((mii->mii_media_active & IFM_GMASK) == IFM_HDX) { DBPRINT(sc, BCE_INFO_PHY, @@ -2040,7 +2056,7 @@ bce_miibus_statchg(device_t dev) REG_WR(sc, BCE_EMAC_MODE, val); - if ((mii->mii_media_active & IFM_ETH_RXPAUSE) != 0) { + if ((mii->mii_media_active & IFM_ETH_RXPAUSE) != 0) { DBPRINT(sc, BCE_INFO_PHY, "%s(): Enabling RX flow control.\n", __FUNCTION__); BCE_SETBIT(sc, BCE_EMAC_RX_MODE, BCE_EMAC_RX_MODE_FLOW_EN); @@ -2050,7 +2066,7 @@ bce_miibus_statchg(device_t dev) BCE_CLRBIT(sc, BCE_EMAC_RX_MODE, BCE_EMAC_RX_MODE_FLOW_EN); } - if ((mii->mii_media_active & IFM_ETH_TXPAUSE) != 0) { + if ((mii->mii_media_active & IFM_ETH_TXPAUSE) != 0) { DBPRINT(sc, BCE_INFO_PHY, "%s(): Enabling TX flow control.\n", __FUNCTION__); BCE_SETBIT(sc, BCE_EMAC_TX_MODE, BCE_EMAC_TX_MODE_FLOW_EN); @@ -6210,15 +6226,11 @@ bce_phy_intr(struct bce_softc *sc) DBPRINT(sc, BCE_INFO_PHY, "%s(): Link is now DOWN.\n", __FUNCTION__); } - /* - * Assume link is down and allow - * tick routine to update the state - * based on the actual media state. + * Link state changed, allow tick routine to update + * the state baased on actual media state. */ - sc->bce_link_up = FALSE; - callout_stop(&sc->bce_tick_callout); - bce_tick(sc); + sc->bce_link_tick = TRUE; } /* Acknowledge the link change interrupt. */ @@ -6902,12 +6914,13 @@ bce_init_locked(struct bce_softc *sc) /* Enable host interrupts. */ bce_enable_intr(sc, 1); - bce_ifmedia_upd_locked(ifp); - /* Let the OS know the driver is up and running. */ ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + sc->bce_link_tick = TRUE; + bce_ifmedia_upd_locked(ifp); + callout_reset(&sc->bce_tick_callout, hz, bce_tick, sc); bce_init_locked_exit: @@ -8203,31 +8216,19 @@ bce_tick(void *xsc) bce_watchdog(sc); /* If link is up already up then we're done. */ - if (sc->bce_link_up == TRUE) + if (sc->bce_link_tick == FALSE && sc->bce_link_up == TRUE) goto bce_tick_exit; /* Link is down. Check what the PHY's doing. */ mii = device_get_softc(sc->bce_miibus); mii_tick(mii); - /* Check if the link has come up. */ - if ((mii->mii_media_status & IFM_ACTIVE) && - (IFM_SUBTYPE(mii->mii_media_active) != IFM_NONE)) { + sc->bce_link_tick = FALSE; + /* Now that link is up, handle any outstanding TX traffic. */ + if (sc->bce_link_up == TRUE && !IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { DBPRINT(sc, BCE_VERBOSE_MISC, - "%s(): Link up!\n", __FUNCTION__); - sc->bce_link_up = TRUE; - if ((IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T || - IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_SX || - IFM_SUBTYPE(mii->mii_media_active) == IFM_2500_SX) && - (bce_verbose || bootverbose)) - BCE_PRINTF("Gigabit link up!\n"); - - /* Now that link is up, handle any outstanding TX traffic. */ - if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { - DBPRINT(sc, BCE_VERBOSE_MISC, "%s(): Found " - "pending TX traffic.\n", __FUNCTION__); - bce_start_locked(ifp); - } + "%s(): Found pending TX traffic.\n", __FUNCTION__); + bce_start_locked(ifp); } bce_tick_exit: Modified: stable/7/sys/dev/bce/if_bcereg.h ============================================================================== --- stable/7/sys/dev/bce/if_bcereg.h Mon Jan 9 19:08:52 2012 (r229865) +++ stable/7/sys/dev/bce/if_bcereg.h Mon Jan 9 19:10:11 2012 (r229866) @@ -6557,6 +6557,7 @@ struct bce_softc u16 pg_prod; u16 pg_cons; + int bce_link_tick; int bce_link_up; struct callout bce_tick_callout; struct callout bce_pulse_callout; From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 19:13:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0658E1065677; Mon, 9 Jan 2012 19:13:54 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by mx1.freebsd.org (Postfix) with ESMTP id 144D78FC13; Mon, 9 Jan 2012 19:13:52 +0000 (UTC) Received: by wibhr1 with SMTP id hr1so4420306wib.13 for ; Mon, 09 Jan 2012 11:13:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=Vh+6PAA88msTN5306MLyq91AVq3T61rqDVFdGE1lk5s=; b=dmSgwI1u3kLqhK2B1CMZXZ+3pW9QwR/8e9z+KGRZU6GuxI7Hjk8CaudkBl1Aa29TGq krIAghZeAzg2X0H4zbTshROGHAdR3h6YFCg/tH5hUVPRwdjfpiNoYvtnpDqCS65QbNUY 8VGEIHfScsMaEvsLZMJNLxlCDXq/ur+Ya5xCI= Received: by 10.180.83.69 with SMTP id o5mr30579362wiy.1.1326136432113; Mon, 09 Jan 2012 11:13:52 -0800 (PST) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua. [212.86.226.226]) by mx.google.com with ESMTPS id 28sm80358017wby.3.2012.01.09.11.13.50 (version=SSLv3 cipher=OTHER); Mon, 09 Jan 2012 11:13:51 -0800 (PST) Sender: Alexander Motin Message-ID: <4F0B3C66.6020701@FreeBSD.org> Date: Mon, 09 Jan 2012 21:13:42 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111112 Thunderbird/8.0 MIME-Version: 1.0 To: Maksim Yevmenkin References: <201112282249.pBSMnTZu028304@svn.freebsd.org> <4F0B38B9.1020302@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r228939 - head/sys/dev/mps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 19:13:54 -0000 On 09.01.2012 21:01, Maksim Yevmenkin wrote: > 2012/1/9 Alexander Motin: >> On 09.01.2012 20:54, Maksim Yevmenkin wrote: >>> >>> On Wed, Dec 28, 2011 at 2:49 PM, Alexander Motin wrote: >>>> >>>> Author: mav >>>> Date: Wed Dec 28 22:49:28 2011 >>>> New Revision: 228939 >>>> URL: http://svn.freebsd.org/changeset/base/228939 >>>> >>>> Log: >>>> Set maximum I/O size for mps(4) to MAXPHYS. Looking into the code, I see >>>> no reason why it should be limited to 64K of DFLTPHYS. DMA data tag is >>>> any >>>> way set to allow MAXPHYS, S/G lists (chain elements) are sufficient and >>>> overflows are also handled. On my tests even 1MB I/Os are working fine. >>>> >>>> Reviewed by: ken@ >>>> >>>> Modified: >>>> head/sys/dev/mps/mps_sas.c >>>> >>>> Modified: head/sys/dev/mps/mps_sas.c >>>> >>>> ============================================================================== >>>> --- head/sys/dev/mps/mps_sas.c Wed Dec 28 22:18:53 2011 (r228938) >>>> +++ head/sys/dev/mps/mps_sas.c Wed Dec 28 22:49:28 2011 (r228939) >>>> @@ -937,6 +937,7 @@ mpssas_action(struct cam_sim *sim, union >>>> cpi->transport_version = 0; >>>> cpi->protocol = PROTO_SCSI; >>>> cpi->protocol_version = SCSI_REV_SPC; >>>> + cpi->maxio = MAXPHYS; >>>> cpi->ccb_h.status = CAM_REQ_CMP; >>>> break; >>>> } >>> >>> >>> sorry for the late reply, but can we make in into tunable please? i >>> have in local tree >>> >>> --- mps_sas.c.orig 2011-11-17 02:05:04.000000000 -0800 >>> +++ mps_sas.c 2011-12-28 16:05:10.000000000 -0800 >>> @@ -121,6 +121,11 @@ >>> >>> MALLOC_DEFINE(M_MPSSAS, "MPSSAS", "MPS SAS memory"); >>> >>> +int mps_maxio = MAXPHYS; >>> +TUNABLE_INT("hw.mps.maxio",&mps_maxio); >>> +SYSCTL_INT(_hw_mps, OID_AUTO, maxio, CTLFLAG_RD,&mps_maxio, 0, >>> >>> + "CAM maxio override\n"); >>> + >>> static __inline int mpssas_set_lun(uint8_t *lun, u_int ccblun); >>> static struct mpssas_target * mpssas_alloc_target(struct mpssas_softc *, >>> struct mpssas_target *); >>> @@ -938,6 +943,7 @@ >>> cpi->protocol = PROTO_SCSI; >>> cpi->protocol_version = SCSI_REV_SPC; >>> cpi->ccb_h.status = CAM_REQ_CMP; >>> + cpi->maxio = mps_maxio; >>> break; >>> } >>> case XPT_GET_TRAN_SETTINGS: >> >> >> We can. but could you explain why? Have you found any problems this change? > > not really. i've had this patch in the local tree for a while now. we > are experimenting with various MAXPHYS/maxio settings and having this > tunable is very handy. basically, we can set MAXPHYS to some larger > value and tweak maxio (for testing purposes) without > recompiling/installing new kernel. I don't really think that it is perfect place for such tunable. It is a bit strange IMHO to have different maxio for different types of HBAs except physical limitations. I would prefer it to be configurable on above layers, for example, file systems, if needed. But if you need it here for something, I won't object against adding it. Have you found any benefits of having maxio below MAXPHYS while experimenting? May be those results could be used to improve FS behavior somehow to make tuning not needed? -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 19:18:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F5B11065673; Mon, 9 Jan 2012 19:18:54 +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 12F4A8FC08; Mon, 9 Jan 2012 19:18: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 q09JIrwS054460; Mon, 9 Jan 2012 19:18:53 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q09JIrpk054457; Mon, 9 Jan 2012 19:18:53 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201201091918.q09JIrpk054457@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 9 Jan 2012 19:18:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229867 - stable/9/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 19:18:54 -0000 Author: yongari Date: Mon Jan 9 19:18:53 2012 New Revision: 229867 URL: http://svn.freebsd.org/changeset/base/229867 Log: MFC r228479-228480: r228479: BCM5720 performance tweak from Broadcom. o Allow multiple outstanding read requests from non-LSO read DMA engine. o Allow 4KB burst length reads for non-LSO frames. o Enable 512B burst length reads for buffer descriptors. r228480: Destroy DMA tag for jumbo RX buffer in device detach. Modified: stable/9/sys/dev/bge/if_bge.c stable/9/sys/dev/bge/if_bgereg.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/dev/bge/if_bge.c ============================================================================== --- stable/9/sys/dev/bge/if_bge.c Mon Jan 9 19:10:11 2012 (r229866) +++ stable/9/sys/dev/bge/if_bge.c Mon Jan 9 19:18:53 2012 (r229867) @@ -2080,9 +2080,15 @@ bge_blockinit(struct bge_softc *sc) val |= BGE_RDMAMODE_TSO6_ENABLE; } - if (sc->bge_asicrev == BGE_ASICREV_BCM5720) + if (sc->bge_asicrev == BGE_ASICREV_BCM5720) { val |= CSR_READ_4(sc, BGE_RDMA_MODE) & BGE_RDMAMODE_H2BNC_VLAN_DET; + /* + * Allow multiple outstanding read requests from + * non-LSO read DMA engine. + */ + val &= ~BGE_RDMAMODE_MULT_DMA_RD_DIS; + } if (sc->bge_asicrev == BGE_ASICREV_BCM5761 || sc->bge_asicrev == BGE_ASICREV_BCM5784 || @@ -2112,12 +2118,20 @@ bge_blockinit(struct bge_softc *sc) BGE_RDMA_RSRVCTRL_FIFO_OFLW_FIX); } - if (sc->bge_asicrev == BGE_ASICREV_BCM5719 || - sc->bge_asicrev == BGE_ASICREV_BCM5720) { + if (sc->bge_asicrev == BGE_ASICREV_BCM5719) { CSR_WRITE_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL, CSR_READ_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL) | BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_BD_4K | BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_LSO_4K); + } else if (sc->bge_asicrev == BGE_ASICREV_BCM5720) { + /* + * Allow 4KB burst length reads for non-LSO frames. + * Enable 512B burst length reads for buffer descriptors. + */ + CSR_WRITE_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL, + CSR_READ_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL) | + BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_BD_512 | + BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_LSO_4K); } CSR_WRITE_4(sc, BGE_RDMA_MODE, val); @@ -2344,6 +2358,8 @@ bge_dma_free(struct bge_softc *sc) if (sc->bge_cdata.bge_rx_mtag) bus_dma_tag_destroy(sc->bge_cdata.bge_rx_mtag); + if (sc->bge_cdata.bge_mtag_jumbo) + bus_dma_tag_destroy(sc->bge_cdata.bge_mtag_jumbo); if (sc->bge_cdata.bge_tx_mtag) bus_dma_tag_destroy(sc->bge_cdata.bge_tx_mtag); Modified: stable/9/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/9/sys/dev/bge/if_bgereg.h Mon Jan 9 19:10:11 2012 (r229866) +++ stable/9/sys/dev/bge/if_bgereg.h Mon Jan 9 19:18:53 2012 (r229867) @@ -1573,6 +1573,7 @@ #define BGE_RDMA_RSRVCTRL_FIFO_HWM_MASK 0x000FF000 #define BGE_RDMA_RSRVCTRL_TXMRGN_MASK 0xFFE00000 +#define BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_BD_512 0x00020000 #define BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_BD_4K 0x00030000 #define BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_LSO_4K 0x000C0000 From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 19:20:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B881B106564A; Mon, 9 Jan 2012 19:20:31 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id 50A198FC15; Mon, 9 Jan 2012 19:20:31 +0000 (UTC) Received: by yenl9 with SMTP id l9so1923856yen.13 for ; Mon, 09 Jan 2012 11:20:30 -0800 (PST) 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=efZe7/+Q+dFtKXTlYkIbWLLJtF2RkhC1Rh9/cigduVo=; b=x4DI1a54Xy9C4yWjti4+KIlsWyEGktJbUIDpzHyuUEczzHCBRIGYh95VpPcUxSul1V V4Db2+Dgd/rRnWsb1IEXGOfwUNl9vf6iKtoHnI8bY7+Qjvy0JrsbKqnG2BZUI1Y6AgEP r+ILA82OlRkQCWgBmThNXumcmmSVD8jpD5eXs= MIME-Version: 1.0 Received: by 10.236.122.237 with SMTP id t73mr10734310yhh.124.1326135243889; Mon, 09 Jan 2012 10:54:03 -0800 (PST) Sender: maksim.yevmenkin@gmail.com Received: by 10.101.41.18 with HTTP; Mon, 9 Jan 2012 10:54:03 -0800 (PST) In-Reply-To: <201112282249.pBSMnTZu028304@svn.freebsd.org> References: <201112282249.pBSMnTZu028304@svn.freebsd.org> Date: Mon, 9 Jan 2012 10:54:03 -0800 X-Google-Sender-Auth: j4CMW2yzOjwGjnFZTJxqLL9zM9g Message-ID: From: Maksim Yevmenkin To: Alexander Motin 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 Subject: Re: svn commit: r228939 - head/sys/dev/mps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 19:20:31 -0000 On Wed, Dec 28, 2011 at 2:49 PM, Alexander Motin wrote: > Author: mav > Date: Wed Dec 28 22:49:28 2011 > New Revision: 228939 > URL: http://svn.freebsd.org/changeset/base/228939 > > Log: > =A0Set maximum I/O size for mps(4) to MAXPHYS. Looking into the code, I s= ee > =A0no reason why it should be limited to 64K of DFLTPHYS. DMA data tag is= any > =A0way set to allow MAXPHYS, S/G lists (chain elements) are sufficient an= d > =A0overflows are also handled. On my tests even 1MB I/Os are working fine= . > > =A0Reviewed by: =A0ken@ > > Modified: > =A0head/sys/dev/mps/mps_sas.c > > Modified: head/sys/dev/mps/mps_sas.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/mps/mps_sas.c =A0Wed Dec 28 22:18:53 2011 =A0 =A0 =A0 = =A0(r228938) > +++ head/sys/dev/mps/mps_sas.c =A0Wed Dec 28 22:49:28 2011 =A0 =A0 =A0 = =A0(r228939) > @@ -937,6 +937,7 @@ mpssas_action(struct cam_sim *sim, union > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cpi->transport_version =3D 0; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cpi->protocol =3D PROTO_SCSI; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cpi->protocol_version =3D SCSI_REV_SPC; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 cpi->maxio =3D MAXPHYS; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cpi->ccb_h.status =3D CAM_REQ_CMP; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > =A0 =A0 =A0 =A0} sorry for the late reply, but can we make in into tunable please? i have in local tree --- mps_sas.c.orig 2011-11-17 02:05:04.000000000 -0800 +++ mps_sas.c 2011-12-28 16:05:10.000000000 -0800 @@ -121,6 +121,11 @@ MALLOC_DEFINE(M_MPSSAS, "MPSSAS", "MPS SAS memory"); +int mps_maxio =3D MAXPHYS; +TUNABLE_INT("hw.mps.maxio", &mps_maxio); +SYSCTL_INT(_hw_mps, OID_AUTO, maxio, CTLFLAG_RD, &mps_maxio, 0, + "CAM maxio override\n"); + static __inline int mpssas_set_lun(uint8_t *lun, u_int ccblun); static struct mpssas_target * mpssas_alloc_target(struct mpssas_softc *, struct mpssas_target *); @@ -938,6 +943,7 @@ cpi->protocol =3D PROTO_SCSI; cpi->protocol_version =3D SCSI_REV_SPC; cpi->ccb_h.status =3D CAM_REQ_CMP; + cpi->maxio =3D mps_maxio; break; } case XPT_GET_TRAN_SETTINGS: thanks, max From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 19:20:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8289A1065782; Mon, 9 Jan 2012 19:20:46 +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 67C658FC12; Mon, 9 Jan 2012 19:20:46 +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 q09JKkUU054556; Mon, 9 Jan 2012 19:20:46 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q09JKkXS054553; Mon, 9 Jan 2012 19:20:46 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201201091920.q09JKkXS054553@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 9 Jan 2012 19:20:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229868 - stable/8/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 19:20:46 -0000 Author: yongari Date: Mon Jan 9 19:20:46 2012 New Revision: 229868 URL: http://svn.freebsd.org/changeset/base/229868 Log: MFC r228479-228480: r228479: BCM5720 performance tweak from Broadcom. o Allow multiple outstanding read requests from non-LSO read DMA engine. o Allow 4KB burst length reads for non-LSO frames. o Enable 512B burst length reads for buffer descriptors. r228480: Destroy DMA tag for jumbo RX buffer in device detach. Modified: stable/8/sys/dev/bge/if_bge.c stable/8/sys/dev/bge/if_bgereg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Mon Jan 9 19:18:53 2012 (r229867) +++ stable/8/sys/dev/bge/if_bge.c Mon Jan 9 19:20:46 2012 (r229868) @@ -2084,9 +2084,15 @@ bge_blockinit(struct bge_softc *sc) val |= BGE_RDMAMODE_TSO6_ENABLE; } - if (sc->bge_asicrev == BGE_ASICREV_BCM5720) + if (sc->bge_asicrev == BGE_ASICREV_BCM5720) { val |= CSR_READ_4(sc, BGE_RDMA_MODE) & BGE_RDMAMODE_H2BNC_VLAN_DET; + /* + * Allow multiple outstanding read requests from + * non-LSO read DMA engine. + */ + val &= ~BGE_RDMAMODE_MULT_DMA_RD_DIS; + } if (sc->bge_asicrev == BGE_ASICREV_BCM5761 || sc->bge_asicrev == BGE_ASICREV_BCM5784 || @@ -2116,12 +2122,20 @@ bge_blockinit(struct bge_softc *sc) BGE_RDMA_RSRVCTRL_FIFO_OFLW_FIX); } - if (sc->bge_asicrev == BGE_ASICREV_BCM5719 || - sc->bge_asicrev == BGE_ASICREV_BCM5720) { + if (sc->bge_asicrev == BGE_ASICREV_BCM5719) { CSR_WRITE_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL, CSR_READ_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL) | BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_BD_4K | BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_LSO_4K); + } else if (sc->bge_asicrev == BGE_ASICREV_BCM5720) { + /* + * Allow 4KB burst length reads for non-LSO frames. + * Enable 512B burst length reads for buffer descriptors. + */ + CSR_WRITE_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL, + CSR_READ_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL) | + BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_BD_512 | + BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_LSO_4K); } CSR_WRITE_4(sc, BGE_RDMA_MODE, val); @@ -2348,6 +2362,8 @@ bge_dma_free(struct bge_softc *sc) if (sc->bge_cdata.bge_rx_mtag) bus_dma_tag_destroy(sc->bge_cdata.bge_rx_mtag); + if (sc->bge_cdata.bge_mtag_jumbo) + bus_dma_tag_destroy(sc->bge_cdata.bge_mtag_jumbo); if (sc->bge_cdata.bge_tx_mtag) bus_dma_tag_destroy(sc->bge_cdata.bge_tx_mtag); Modified: stable/8/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/8/sys/dev/bge/if_bgereg.h Mon Jan 9 19:18:53 2012 (r229867) +++ stable/8/sys/dev/bge/if_bgereg.h Mon Jan 9 19:20:46 2012 (r229868) @@ -1573,6 +1573,7 @@ #define BGE_RDMA_RSRVCTRL_FIFO_HWM_MASK 0x000FF000 #define BGE_RDMA_RSRVCTRL_TXMRGN_MASK 0xFFE00000 +#define BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_BD_512 0x00020000 #define BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_BD_4K 0x00030000 #define BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_LSO_4K 0x000C0000 From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 19:21:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5061E1065677; Mon, 9 Jan 2012 19:21:32 +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 104678FC1E; Mon, 9 Jan 2012 19:21:32 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id A159846B09; Mon, 9 Jan 2012 14:21:31 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 33593B922; Mon, 9 Jan 2012 14:21:31 -0500 (EST) From: John Baldwin To: Garrett Cooper Date: Mon, 9 Jan 2012 14:21:30 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201112282249.pBSMnTZu028304@svn.freebsd.org> <4F0B38B9.1020302@FreeBSD.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201201091421.30596.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 09 Jan 2012 14:21:31 -0500 (EST) Cc: svn-src-head@freebsd.org, Alexander Motin , src-committers@freebsd.org, Maksim Yevmenkin , svn-src-all@freebsd.org Subject: Re: svn commit: r228939 - head/sys/dev/mps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 19:21:32 -0000 On Monday, January 09, 2012 2:04:23 pm Garrett Cooper wrote: > 2012/1/9 Alexander Motin : > > On 09.01.2012 20:54, Maksim Yevmenkin wrote: > >> > >> On Wed, Dec 28, 2011 at 2:49 PM, Alexander Motin wrote: > >> > >>> Author: mav > >>> Date: Wed Dec 28 22:49:28 2011 > >>> New Revision: 228939 > >>> URL: http://svn.freebsd.org/changeset/base/228939 > >>> > >>> Log: > >>> Set maximum I/O size for mps(4) to MAXPHYS. Looking into the code, I see > >>> no reason why it should be limited to 64K of DFLTPHYS. DMA data tag is > >>> any > >>> way set to allow MAXPHYS, S/G lists (chain elements) are sufficient and > >>> overflows are also handled. On my tests even 1MB I/Os are working fine. > >>> > >>> Reviewed by: ken@ > >>> > >>> Modified: > >>> head/sys/dev/mps/mps_sas.c > >>> > >>> Modified: head/sys/dev/mps/mps_sas.c > >>> > >>> ============================================================================== > >>> --- head/sys/dev/mps/mps_sas.c Wed Dec 28 22:18:53 2011 (r228938) > >>> +++ head/sys/dev/mps/mps_sas.c Wed Dec 28 22:49:28 2011 (r228939) > >>> @@ -937,6 +937,7 @@ mpssas_action(struct cam_sim *sim, union > >>> cpi->transport_version = 0; > >>> cpi->protocol = PROTO_SCSI; > >>> cpi->protocol_version = SCSI_REV_SPC; > >>> + cpi->maxio = MAXPHYS; > >>> cpi->ccb_h.status = CAM_REQ_CMP; > >>> break; > >>> } > >> > >> > >> sorry for the late reply, but can we make in into tunable please? i > >> have in local tree > >> > >> --- mps_sas.c.orig 2011-11-17 02:05:04.000000000 -0800 > >> +++ mps_sas.c 2011-12-28 16:05:10.000000000 -0800 > >> @@ -121,6 +121,11 @@ > >> > >> MALLOC_DEFINE(M_MPSSAS, "MPSSAS", "MPS SAS memory"); > >> > >> +int mps_maxio = MAXPHYS; > >> +TUNABLE_INT("hw.mps.maxio",&mps_maxio); > >> +SYSCTL_INT(_hw_mps, OID_AUTO, maxio, CTLFLAG_RD,&mps_maxio, 0, > >> + "CAM maxio override\n"); > >> + > >> static __inline int mpssas_set_lun(uint8_t *lun, u_int ccblun); > >> static struct mpssas_target * mpssas_alloc_target(struct mpssas_softc *, > >> struct mpssas_target *); > >> @@ -938,6 +943,7 @@ > >> > >> cpi->protocol = PROTO_SCSI; > >> cpi->protocol_version = SCSI_REV_SPC; > >> cpi->ccb_h.status = CAM_REQ_CMP; > >> + cpi->maxio = mps_maxio; > >> break; > >> } > >> case XPT_GET_TRAN_SETTINGS: > > > > > > We can. but could you explain why? Have you found any problems this change? > > It would make it nice when dealing with different controllers -- a > similar example is that mfi(4) has a tunable called hw.mfi.max_cmds > which controls the I/O command queue size as not all MegaRAID cards > have the same I/O queue size capabilities. Yeah, but that's more a debugging aid. mfi(4) has a firmware interface that tells you how many command slots it supports dynamically. mfi also uses a better way to compute maxio: sc->ld_disk->d_maxsize = min(sc->ld_controller->mfi_max_io * secsize, (sc->ld_controller->mfi_max_sge - 1) * PAGE_SIZE); It would be nice if mps could use a similar formula that was actually limited by the device's capabilities. The upper layers will cap transfers to MAXPHYS elsewhere. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 19:22:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 274021065670; Mon, 9 Jan 2012 19:22:03 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-ee0-f54.google.com (mail-ee0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 2A3BE8FC1D; Mon, 9 Jan 2012 19:22:01 +0000 (UTC) Received: by eekc50 with SMTP id c50so2859204eek.13 for ; Mon, 09 Jan 2012 11:22:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=SNqAaCgqvh7igVrf3wav1Ovl11lSe7SOLdn8OxplDf8=; b=Sldlfe4MDAKc4gmu99vwAfFRDb5ZGvBEZt1KGySBVPPbF0+pEDABKMGxVMUPDQhV8T gBfVcYgBi+GnTilLoyQQYKowxnK7uFNWG+JoaUcaEbteUkrvuXMmKS1OmhoCAjrqtQbA gfjeD4kFkrN3EtQtiibERNE6YYVxNEeBzoEgY= Received: by 10.14.99.197 with SMTP id x45mr6640262eef.114.1326136920424; Mon, 09 Jan 2012 11:22:00 -0800 (PST) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua. [212.86.226.226]) by mx.google.com with ESMTPS id 76sm294295005eeh.0.2012.01.09.11.21.58 (version=SSLv3 cipher=OTHER); Mon, 09 Jan 2012 11:21:59 -0800 (PST) Sender: Alexander Motin Message-ID: <4F0B3E4E.20807@FreeBSD.org> Date: Mon, 09 Jan 2012 21:21:50 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111112 Thunderbird/8.0 MIME-Version: 1.0 To: Garrett Cooper References: <201112282249.pBSMnTZu028304@svn.freebsd.org> <4F0B38B9.1020302@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Maksim Yevmenkin Subject: Re: svn commit: r228939 - head/sys/dev/mps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 19:22:03 -0000 On 09.01.2012 21:04, Garrett Cooper wrote: > 2012/1/9 Alexander Motin: >> On 09.01.2012 20:54, Maksim Yevmenkin wrote: >>> >>> On Wed, Dec 28, 2011 at 2:49 PM, Alexander Motin wrote: >>> >>>> Author: mav >>>> Date: Wed Dec 28 22:49:28 2011 >>>> New Revision: 228939 >>>> URL: http://svn.freebsd.org/changeset/base/228939 >>>> >>>> Log: >>>> Set maximum I/O size for mps(4) to MAXPHYS. Looking into the code, I see >>>> no reason why it should be limited to 64K of DFLTPHYS. DMA data tag is >>>> any >>>> way set to allow MAXPHYS, S/G lists (chain elements) are sufficient and >>>> overflows are also handled. On my tests even 1MB I/Os are working fine. >>>> >>>> Reviewed by: ken@ >>>> >>>> Modified: >>>> head/sys/dev/mps/mps_sas.c >>>> >>>> Modified: head/sys/dev/mps/mps_sas.c >>>> >>>> ============================================================================== >>>> --- head/sys/dev/mps/mps_sas.c Wed Dec 28 22:18:53 2011 (r228938) >>>> +++ head/sys/dev/mps/mps_sas.c Wed Dec 28 22:49:28 2011 (r228939) >>>> @@ -937,6 +937,7 @@ mpssas_action(struct cam_sim *sim, union >>>> cpi->transport_version = 0; >>>> cpi->protocol = PROTO_SCSI; >>>> cpi->protocol_version = SCSI_REV_SPC; >>>> + cpi->maxio = MAXPHYS; >>>> cpi->ccb_h.status = CAM_REQ_CMP; >>>> break; >>>> } >>> >>> >>> sorry for the late reply, but can we make in into tunable please? i >>> have in local tree >>> >>> --- mps_sas.c.orig 2011-11-17 02:05:04.000000000 -0800 >>> +++ mps_sas.c 2011-12-28 16:05:10.000000000 -0800 >>> @@ -121,6 +121,11 @@ >>> >>> MALLOC_DEFINE(M_MPSSAS, "MPSSAS", "MPS SAS memory"); >>> >>> +int mps_maxio = MAXPHYS; >>> +TUNABLE_INT("hw.mps.maxio",&mps_maxio); >>> +SYSCTL_INT(_hw_mps, OID_AUTO, maxio, CTLFLAG_RD,&mps_maxio, 0, >>> + "CAM maxio override\n"); >>> + >>> static __inline int mpssas_set_lun(uint8_t *lun, u_int ccblun); >>> static struct mpssas_target * mpssas_alloc_target(struct mpssas_softc *, >>> struct mpssas_target *); >>> @@ -938,6 +943,7 @@ >>> >>> cpi->protocol = PROTO_SCSI; >>> cpi->protocol_version = SCSI_REV_SPC; >>> cpi->ccb_h.status = CAM_REQ_CMP; >>> + cpi->maxio = mps_maxio; >>> break; >>> } >>> case XPT_GET_TRAN_SETTINGS: >> >> >> We can. but could you explain why? Have you found any problems this change? > > It would make it nice when dealing with different controllers -- a > similar example is that mfi(4) has a tunable called hw.mfi.max_cmds > which controls the I/O command queue size as not all MegaRAID cards > have the same I/O queue size capabilities. Not many people care able to configure such low-level things. It means that if such configuration is needed, then either most of others will be in trouble or at least get suboptimal performance. If there are any way to avoid such tunables, I believe we should avoid them. -- Alexander Motin From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 19:23:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79D90106566B; Mon, 9 Jan 2012 19:23:29 +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 5ED458FC08; Mon, 9 Jan 2012 19:23: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 q09JNTOF054688; Mon, 9 Jan 2012 19:23:29 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q09JNThS054685; Mon, 9 Jan 2012 19:23:29 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201201091923.q09JNThS054685@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 9 Jan 2012 19:23:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229869 - stable/7/sys/dev/bge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 19:23:29 -0000 Author: yongari Date: Mon Jan 9 19:23:29 2012 New Revision: 229869 URL: http://svn.freebsd.org/changeset/base/229869 Log: MFC r228479-228480: r228479: BCM5720 performance tweak from Broadcom. o Allow multiple outstanding read requests from non-LSO read DMA engine. o Allow 4KB burst length reads for non-LSO frames. o Enable 512B burst length reads for buffer descriptors. r228480: Destroy DMA tag for jumbo RX buffer in device detach. Modified: stable/7/sys/dev/bge/if_bge.c stable/7/sys/dev/bge/if_bgereg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Mon Jan 9 19:20:46 2012 (r229868) +++ stable/7/sys/dev/bge/if_bge.c Mon Jan 9 19:23:29 2012 (r229869) @@ -2084,9 +2084,15 @@ bge_blockinit(struct bge_softc *sc) val |= BGE_RDMAMODE_TSO6_ENABLE; } - if (sc->bge_asicrev == BGE_ASICREV_BCM5720) + if (sc->bge_asicrev == BGE_ASICREV_BCM5720) { val |= CSR_READ_4(sc, BGE_RDMA_MODE) & BGE_RDMAMODE_H2BNC_VLAN_DET; + /* + * Allow multiple outstanding read requests from + * non-LSO read DMA engine. + */ + val &= ~BGE_RDMAMODE_MULT_DMA_RD_DIS; + } if (sc->bge_asicrev == BGE_ASICREV_BCM5761 || sc->bge_asicrev == BGE_ASICREV_BCM5784 || @@ -2116,12 +2122,20 @@ bge_blockinit(struct bge_softc *sc) BGE_RDMA_RSRVCTRL_FIFO_OFLW_FIX); } - if (sc->bge_asicrev == BGE_ASICREV_BCM5719 || - sc->bge_asicrev == BGE_ASICREV_BCM5720) { + if (sc->bge_asicrev == BGE_ASICREV_BCM5719) { CSR_WRITE_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL, CSR_READ_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL) | BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_BD_4K | BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_LSO_4K); + } else if (sc->bge_asicrev == BGE_ASICREV_BCM5720) { + /* + * Allow 4KB burst length reads for non-LSO frames. + * Enable 512B burst length reads for buffer descriptors. + */ + CSR_WRITE_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL, + CSR_READ_4(sc, BGE_RDMA_LSO_CRPTEN_CTRL) | + BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_BD_512 | + BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_LSO_4K); } CSR_WRITE_4(sc, BGE_RDMA_MODE, val); @@ -2348,6 +2362,8 @@ bge_dma_free(struct bge_softc *sc) if (sc->bge_cdata.bge_rx_mtag) bus_dma_tag_destroy(sc->bge_cdata.bge_rx_mtag); + if (sc->bge_cdata.bge_mtag_jumbo) + bus_dma_tag_destroy(sc->bge_cdata.bge_mtag_jumbo); if (sc->bge_cdata.bge_tx_mtag) bus_dma_tag_destroy(sc->bge_cdata.bge_tx_mtag); Modified: stable/7/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/7/sys/dev/bge/if_bgereg.h Mon Jan 9 19:20:46 2012 (r229868) +++ stable/7/sys/dev/bge/if_bgereg.h Mon Jan 9 19:23:29 2012 (r229869) @@ -1573,6 +1573,7 @@ #define BGE_RDMA_RSRVCTRL_FIFO_HWM_MASK 0x000FF000 #define BGE_RDMA_RSRVCTRL_TXMRGN_MASK 0xFFE00000 +#define BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_BD_512 0x00020000 #define BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_BD_4K 0x00030000 #define BGE_RDMA_LSO_CRPTEN_CTRL_BLEN_LSO_4K 0x000C0000 From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 19:28:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B54F1065672; Mon, 9 Jan 2012 19:28:52 +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 0F5208FC1A; Mon, 9 Jan 2012 19:28:52 +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 q09JSpux054907; Mon, 9 Jan 2012 19:28:51 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q09JSpnG054905; Mon, 9 Jan 2012 19:28:51 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201201091928.q09JSpnG054905@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 9 Jan 2012 19:28:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229870 - stable/9/sys/dev/fxp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 19:28:52 -0000 Author: yongari Date: Mon Jan 9 19:28:51 2012 New Revision: 229870 URL: http://svn.freebsd.org/changeset/base/229870 Log: MFC r228716: TCP header size is represented by number of 32bits words. Fix the TCP header size calculation such that makes TSO engine cache all header(ethernet/IP/TCP) bytes to its internal buffer. While here, remove extra pull up for TCP payload. Unlike some em(4) controllers, fxp(4) does not require such work around for TSO. The two limitations are ethernet/IP/TCP header size should be less than or equal to the size of controller's internal buffer(80 bytes) and these header information should be found in the first fragment of a TSO frame. Modified: stable/9/sys/dev/fxp/if_fxp.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/dev/fxp/if_fxp.c ============================================================================== --- stable/9/sys/dev/fxp/if_fxp.c Mon Jan 9 19:23:29 2012 (r229869) +++ stable/9/sys/dev/fxp/if_fxp.c Mon Jan 9 19:28:51 2012 (r229870) @@ -1454,7 +1454,7 @@ fxp_encap(struct fxp_softc *sc, struct m return (ENOBUFS); } tcp = (struct tcphdr *)(mtod(m, char *) + poff); - m = m_pullup(m, poff + sizeof(struct tcphdr) + tcp->th_off); + m = m_pullup(m, poff + (tcp->th_off << 2)); if (m == NULL) { *m_head = NULL; return (ENOBUFS); From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 19:30:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDF0E1065670; Mon, 9 Jan 2012 19:30:23 +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 AC62A8FC13; Mon, 9 Jan 2012 19:30: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 q09JUNpm054995; Mon, 9 Jan 2012 19:30:23 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q09JUNUF054993; Mon, 9 Jan 2012 19:30:23 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201201091930.q09JUNUF054993@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 9 Jan 2012 19:30:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229871 - stable/8/sys/dev/fxp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 19:30:23 -0000 Author: yongari Date: Mon Jan 9 19:30:23 2012 New Revision: 229871 URL: http://svn.freebsd.org/changeset/base/229871 Log: MFC r228716: TCP header size is represented by number of 32bits words. Fix the TCP header size calculation such that makes TSO engine cache all header(ethernet/IP/TCP) bytes to its internal buffer. While here, remove extra pull up for TCP payload. Unlike some em(4) controllers, fxp(4) does not require such work around for TSO. The two limitations are ethernet/IP/TCP header size should be less than or equal to the size of controller's internal buffer(80 bytes) and these header information should be found in the first fragment of a TSO frame. Modified: stable/8/sys/dev/fxp/if_fxp.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/fxp/if_fxp.c ============================================================================== --- stable/8/sys/dev/fxp/if_fxp.c Mon Jan 9 19:28:51 2012 (r229870) +++ stable/8/sys/dev/fxp/if_fxp.c Mon Jan 9 19:30:23 2012 (r229871) @@ -1454,7 +1454,7 @@ fxp_encap(struct fxp_softc *sc, struct m return (ENOBUFS); } tcp = (struct tcphdr *)(mtod(m, char *) + poff); - m = m_pullup(m, poff + sizeof(struct tcphdr) + tcp->th_off); + m = m_pullup(m, poff + (tcp->th_off << 2)); if (m == NULL) { *m_head = NULL; return (ENOBUFS); From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 19:31:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47738106566B; Mon, 9 Jan 2012 19:31:36 +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 35FD68FC1C; Mon, 9 Jan 2012 19:31: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 q09JVa81055067; Mon, 9 Jan 2012 19:31:36 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q09JVaBs055065; Mon, 9 Jan 2012 19:31:36 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201201091931.q09JVaBs055065@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 9 Jan 2012 19:31:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229872 - stable/7/sys/dev/fxp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 19:31:36 -0000 Author: yongari Date: Mon Jan 9 19:31:35 2012 New Revision: 229872 URL: http://svn.freebsd.org/changeset/base/229872 Log: MFC r228716: TCP header size is represented by number of 32bits words. Fix the TCP header size calculation such that makes TSO engine cache all header(ethernet/IP/TCP) bytes to its internal buffer. While here, remove extra pull up for TCP payload. Unlike some em(4) controllers, fxp(4) does not require such work around for TSO. The two limitations are ethernet/IP/TCP header size should be less than or equal to the size of controller's internal buffer(80 bytes) and these header information should be found in the first fragment of a TSO frame. Modified: stable/7/sys/dev/fxp/if_fxp.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/fxp/if_fxp.c ============================================================================== --- stable/7/sys/dev/fxp/if_fxp.c Mon Jan 9 19:30:23 2012 (r229871) +++ stable/7/sys/dev/fxp/if_fxp.c Mon Jan 9 19:31:35 2012 (r229872) @@ -1455,7 +1455,7 @@ fxp_encap(struct fxp_softc *sc, struct m return (ENOBUFS); } tcp = (struct tcphdr *)(mtod(m, char *) + poff); - m = m_pullup(m, poff + sizeof(struct tcphdr) + tcp->th_off); + m = m_pullup(m, poff + (tcp->th_off << 2)); if (m == NULL) { *m_head = NULL; return (ENOBUFS); From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 19:34:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B5711065675; Mon, 9 Jan 2012 19:34:12 +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 7F1488FC1B; Mon, 9 Jan 2012 19:34: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 q09JYCTu055193; Mon, 9 Jan 2012 19:34:12 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q09JYCjI055190; Mon, 9 Jan 2012 19:34:12 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201091934.q09JYCjI055190@svn.freebsd.org> From: John Baldwin Date: Mon, 9 Jan 2012 19:34: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: r229873 - in head/sys: kern net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 19:34:12 -0000 Author: jhb Date: Mon Jan 9 19:34:12 2012 New Revision: 229873 URL: http://svn.freebsd.org/changeset/base/229873 Log: Convert the per-interface address list lock from a mutex to a reader/writer lock. Reviewed by: bz Modified: head/sys/kern/subr_witness.c head/sys/net/if_var.h Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Mon Jan 9 19:31:35 2012 (r229872) +++ head/sys/kern/subr_witness.c Mon Jan 9 19:34:12 2012 (r229873) @@ -520,7 +520,7 @@ static struct witness_order_list_entry o { "udpinp", &lock_class_rw }, { "in_multi_mtx", &lock_class_mtx_sleep }, { "igmp_mtx", &lock_class_mtx_sleep }, - { "if_addr_mtx", &lock_class_mtx_sleep }, + { "if_addr_lock", &lock_class_rw }, { NULL, NULL }, /* * IPv6 multicast: @@ -529,7 +529,7 @@ static struct witness_order_list_entry o { "udpinp", &lock_class_rw }, { "in6_multi_mtx", &lock_class_mtx_sleep }, { "mld_mtx", &lock_class_mtx_sleep }, - { "if_addr_mtx", &lock_class_mtx_sleep }, + { "if_addr_lock", &lock_class_rw }, { NULL, NULL }, /* * UNIX Domain Sockets Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Mon Jan 9 19:31:35 2012 (r229872) +++ head/sys/net/if_var.h Mon Jan 9 19:34:12 2012 (r229873) @@ -189,11 +189,11 @@ struct ifnet { int if_afdata_initialized; struct rwlock if_afdata_lock; struct task if_linktask; /* task for link change events */ - struct mtx if_addr_mtx; /* mutex to protect address lists */ + struct rwlock if_addr_lock; /* lock to protect address lists */ LIST_ENTRY(ifnet) if_clones; /* interfaces of a cloner */ TAILQ_HEAD(, ifg_list) if_groups; /* linked list of groups per if */ - /* protected by if_addr_mtx */ + /* protected by if_addr_lock */ void *if_pf_kif; void *if_lagg; /* lagg glue */ char *if_description; /* interface description */ @@ -246,15 +246,14 @@ typedef void if_init_f_t(void *); /* * Locks for address lists on the network interface. */ -#define IF_ADDR_LOCK_INIT(if) mtx_init(&(if)->if_addr_mtx, \ - "if_addr_mtx", NULL, MTX_DEF) -#define IF_ADDR_LOCK_DESTROY(if) mtx_destroy(&(if)->if_addr_mtx) -#define IF_ADDR_WLOCK(if) mtx_lock(&(if)->if_addr_mtx) -#define IF_ADDR_WUNLOCK(if) mtx_unlock(&(if)->if_addr_mtx) -#define IF_ADDR_RLOCK(if) mtx_lock(&(if)->if_addr_mtx) -#define IF_ADDR_RUNLOCK(if) mtx_unlock(&(if)->if_addr_mtx) -#define IF_ADDR_LOCK_ASSERT(if) mtx_assert(&(if)->if_addr_mtx, MA_OWNED) -#define IF_ADDR_WLOCK_ASSERT(if) mtx_assert(&(if)->if_addr_mtx, MA_OWNED) +#define IF_ADDR_LOCK_INIT(if) rw_init(&(if)->if_addr_lock, "if_addr_lock") +#define IF_ADDR_LOCK_DESTROY(if) rw_destroy(&(if)->if_addr_lock) +#define IF_ADDR_WLOCK(if) rw_wlock(&(if)->if_addr_lock) +#define IF_ADDR_WUNLOCK(if) rw_wunlock(&(if)->if_addr_lock) +#define IF_ADDR_RLOCK(if) rw_rlock(&(if)->if_addr_lock) +#define IF_ADDR_RUNLOCK(if) rw_runlock(&(if)->if_addr_lock) +#define IF_ADDR_LOCK_ASSERT(if) rw_assert(&(if)->if_addr_lock, RA_LOCKED) +#define IF_ADDR_WLOCK_ASSERT(if) rw_assert(&(if)->if_addr_lock, RA_WLOCKED) /* XXX: Compat. */ #define IF_ADDR_LOCK(if) IF_ADDR_WLOCK(if) #define IF_ADDR_UNLOCK(if) IF_ADDR_WUNLOCK(if) From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 19:57:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFF5C106564A; Mon, 9 Jan 2012 19:57:07 +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 CE4AB8FC0A; Mon, 9 Jan 2012 19:57: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 q09Jv7YG055936; Mon, 9 Jan 2012 19:57:07 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q09Jv7ES055934; Mon, 9 Jan 2012 19:57:07 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201201091957.q09Jv7ES055934@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 9 Jan 2012 19:57:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229874 - stable/9/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 19:57:08 -0000 Author: yongari Date: Mon Jan 9 19:57:07 2012 New Revision: 229874 URL: http://svn.freebsd.org/changeset/base/229874 Log: MFC r228717: Increase wait time for OP_TCPSTART command processing. It seems 100us is not enough to ensure prefetch unit work. Modified: stable/9/sys/dev/msk/if_msk.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/dev/msk/if_msk.c ============================================================================== --- stable/9/sys/dev/msk/if_msk.c Mon Jan 9 19:34:12 2012 (r229873) +++ stable/9/sys/dev/msk/if_msk.c Mon Jan 9 19:57:07 2012 (r229874) @@ -648,8 +648,8 @@ msk_rx_fill(struct msk_if_softc *sc_if, if ((sc_if->msk_flags & MSK_FLAG_DESCV2) == 0 && (sc_if->msk_ifp->if_capenable & IFCAP_RXCSUM) != 0) { /* Wait until controller executes OP_TCPSTART command. */ - for (i = 10; i > 0; i--) { - DELAY(10); + for (i = 100; i > 0; i--) { + DELAY(100); idx = CSR_READ_2(sc_if->msk_softc, Y2_PREF_Q_ADDR(sc_if->msk_rxq, PREF_UNIT_GET_IDX_REG)); From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 19:58:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01116106566C; Mon, 9 Jan 2012 19:58:42 +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 E3A278FC0C; Mon, 9 Jan 2012 19:58: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 q09JwfJn056027; Mon, 9 Jan 2012 19:58:41 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q09JwfGb056025; Mon, 9 Jan 2012 19:58:41 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201201091958.q09JwfGb056025@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 9 Jan 2012 19:58:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229875 - stable/8/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 19:58:42 -0000 Author: yongari Date: Mon Jan 9 19:58:41 2012 New Revision: 229875 URL: http://svn.freebsd.org/changeset/base/229875 Log: MFC r228717: Increase wait time for OP_TCPSTART command processing. It seems 100us is not enough to ensure prefetch unit work. Modified: stable/8/sys/dev/msk/if_msk.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/msk/if_msk.c ============================================================================== --- stable/8/sys/dev/msk/if_msk.c Mon Jan 9 19:57:07 2012 (r229874) +++ stable/8/sys/dev/msk/if_msk.c Mon Jan 9 19:58:41 2012 (r229875) @@ -656,8 +656,8 @@ msk_rx_fill(struct msk_if_softc *sc_if, if ((sc_if->msk_flags & MSK_FLAG_DESCV2) == 0 && (sc_if->msk_ifp->if_capenable & IFCAP_RXCSUM) != 0) { /* Wait until controller executes OP_TCPSTART command. */ - for (i = 10; i > 0; i--) { - DELAY(10); + for (i = 100; i > 0; i--) { + DELAY(100); idx = CSR_READ_2(sc_if->msk_softc, Y2_PREF_Q_ADDR(sc_if->msk_rxq, PREF_UNIT_GET_IDX_REG)); From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 19:59:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9585C106567D; Mon, 9 Jan 2012 19:59:53 +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 8414D8FC22; Mon, 9 Jan 2012 19:59:53 +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 q09Jxr3v056111; Mon, 9 Jan 2012 19:59:53 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q09Jxr8O056109; Mon, 9 Jan 2012 19:59:53 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201201091959.q09Jxr8O056109@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 9 Jan 2012 19:59:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229876 - stable/7/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 19:59:53 -0000 Author: yongari Date: Mon Jan 9 19:59:53 2012 New Revision: 229876 URL: http://svn.freebsd.org/changeset/base/229876 Log: MFC r228717: Increase wait time for OP_TCPSTART command processing. It seems 100us is not enough to ensure prefetch unit work. Modified: stable/7/sys/dev/msk/if_msk.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/msk/if_msk.c ============================================================================== --- stable/7/sys/dev/msk/if_msk.c Mon Jan 9 19:58:41 2012 (r229875) +++ stable/7/sys/dev/msk/if_msk.c Mon Jan 9 19:59:53 2012 (r229876) @@ -656,8 +656,8 @@ msk_rx_fill(struct msk_if_softc *sc_if, if ((sc_if->msk_flags & MSK_FLAG_DESCV2) == 0 && (sc_if->msk_ifp->if_capenable & IFCAP_RXCSUM) != 0) { /* Wait until controller executes OP_TCPSTART command. */ - for (i = 10; i > 0; i--) { - DELAY(10); + for (i = 100; i > 0; i--) { + DELAY(100); idx = CSR_READ_2(sc_if->msk_softc, Y2_PREF_Q_ADDR(sc_if->msk_rxq, PREF_UNIT_GET_IDX_REG)); From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 20:07:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B879E106564A; Mon, 9 Jan 2012 20:07:38 +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 8C4058FC18; Mon, 9 Jan 2012 20:07: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 q09K7cIE056499; Mon, 9 Jan 2012 20:07:38 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q09K7cHf056496; Mon, 9 Jan 2012 20:07:38 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201201092007.q09K7cHf056496@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 9 Jan 2012 20:07:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229877 - in stable/8/sys: dev/msk sparc64/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 20:07:38 -0000 Author: yongari Date: Mon Jan 9 20:07:38 2012 New Revision: 229877 URL: http://svn.freebsd.org/changeset/base/229877 Log: MFC r212378: Catch up to rename of the constant for the Master Data Parity Error bit in the PCI status register. Modified: stable/8/sys/dev/msk/if_msk.c stable/8/sys/sparc64/pci/schizo.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/msk/if_msk.c ============================================================================== --- stable/8/sys/dev/msk/if_msk.c Mon Jan 9 19:59:53 2012 (r229876) +++ stable/8/sys/dev/msk/if_msk.c Mon Jan 9 20:07:38 2012 (r229877) @@ -1392,7 +1392,7 @@ mskc_reset(struct msk_softc *sc) pci_write_config(sc->msk_dev, PCIR_STATUS, status | PCIM_STATUS_PERR | PCIM_STATUS_SERR | PCIM_STATUS_RMABORT | - PCIM_STATUS_RTABORT | PCIM_STATUS_PERRREPORT, 2); + PCIM_STATUS_RTABORT | PCIM_STATUS_MDPERR, 2); CSR_WRITE_2(sc, B0_CTST, CS_MRST_CLR); switch (sc->msk_bustype) { @@ -3518,7 +3518,7 @@ msk_intr_hwerr(struct msk_softc *sc) CSR_WRITE_1(sc, B2_TST_CTRL1, TST_CFG_WRITE_ON); pci_write_config(sc->msk_dev, PCIR_STATUS, v16 | PCIM_STATUS_PERR | PCIM_STATUS_SERR | PCIM_STATUS_RMABORT | - PCIM_STATUS_RTABORT | PCIM_STATUS_PERRREPORT, 2); + PCIM_STATUS_RTABORT | PCIM_STATUS_MDPERR, 2); CSR_WRITE_1(sc, B2_TST_CTRL1, TST_CFG_WRITE_OFF); } Modified: stable/8/sys/sparc64/pci/schizo.c ============================================================================== --- stable/8/sys/sparc64/pci/schizo.c Mon Jan 9 19:59:53 2012 (r229876) +++ stable/8/sys/sparc64/pci/schizo.c Mon Jan 9 20:07:38 2012 (r229877) @@ -882,7 +882,7 @@ schizo_pci_bus(void *arg) fatal = 1; if ((status & (PCIM_STATUS_PERR | PCIM_STATUS_SERR | PCIM_STATUS_RMABORT | PCIM_STATUS_RTABORT | - PCIM_STATUS_PERRREPORT)) != 0 || + PCIM_STATUS_MDPERR)) != 0 || (csr & (SCZ_PCI_CTRL_BUS_UNUS | TOM_PCI_CTRL_DTO_ERR | STX_PCI_CTRL_TTO_ERR | STX_PCI_CTRL_RTRY_ERR | SCZ_PCI_CTRL_SBH_ERR | STX_PCI_CTRL_SERR)) != 0 || From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 20:08:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E09B1106566C; Mon, 9 Jan 2012 20:08:57 +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 B48988FC0C; Mon, 9 Jan 2012 20:08: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 q09K8vbC056587; Mon, 9 Jan 2012 20:08:57 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q09K8vE3056584; Mon, 9 Jan 2012 20:08:57 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201201092008.q09K8vE3056584@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 9 Jan 2012 20:08:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229878 - in stable/7/sys: dev/msk sparc64/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 20:08:58 -0000 Author: yongari Date: Mon Jan 9 20:08:57 2012 New Revision: 229878 URL: http://svn.freebsd.org/changeset/base/229878 Log: MFC r212378: Catch up to rename of the constant for the Master Data Parity Error bit in the PCI status register. Modified: stable/7/sys/dev/msk/if_msk.c stable/7/sys/sparc64/pci/schizo.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/msk/if_msk.c ============================================================================== --- stable/7/sys/dev/msk/if_msk.c Mon Jan 9 20:07:38 2012 (r229877) +++ stable/7/sys/dev/msk/if_msk.c Mon Jan 9 20:08:57 2012 (r229878) @@ -1392,7 +1392,7 @@ mskc_reset(struct msk_softc *sc) pci_write_config(sc->msk_dev, PCIR_STATUS, status | PCIM_STATUS_PERR | PCIM_STATUS_SERR | PCIM_STATUS_RMABORT | - PCIM_STATUS_RTABORT | PCIM_STATUS_PERRREPORT, 2); + PCIM_STATUS_RTABORT | PCIM_STATUS_MDPERR, 2); CSR_WRITE_2(sc, B0_CTST, CS_MRST_CLR); switch (sc->msk_bustype) { @@ -3518,7 +3518,7 @@ msk_intr_hwerr(struct msk_softc *sc) CSR_WRITE_1(sc, B2_TST_CTRL1, TST_CFG_WRITE_ON); pci_write_config(sc->msk_dev, PCIR_STATUS, v16 | PCIM_STATUS_PERR | PCIM_STATUS_SERR | PCIM_STATUS_RMABORT | - PCIM_STATUS_RTABORT | PCIM_STATUS_PERRREPORT, 2); + PCIM_STATUS_RTABORT | PCIM_STATUS_MDPERR, 2); CSR_WRITE_1(sc, B2_TST_CTRL1, TST_CFG_WRITE_OFF); } Modified: stable/7/sys/sparc64/pci/schizo.c ============================================================================== --- stable/7/sys/sparc64/pci/schizo.c Mon Jan 9 20:07:38 2012 (r229877) +++ stable/7/sys/sparc64/pci/schizo.c Mon Jan 9 20:08:57 2012 (r229878) @@ -882,7 +882,7 @@ schizo_pci_bus(void *arg) fatal = 1; if ((status & (PCIM_STATUS_PERR | PCIM_STATUS_SERR | PCIM_STATUS_RMABORT | PCIM_STATUS_RTABORT | - PCIM_STATUS_PERRREPORT)) != 0 || + PCIM_STATUS_MDPERR)) != 0 || (csr & (SCZ_PCI_CTRL_BUS_UNUS | TOM_PCI_CTRL_DTO_ERR | STX_PCI_CTRL_TTO_ERR | STX_PCI_CTRL_RTRY_ERR | SCZ_PCI_CTRL_SBH_ERR | STX_PCI_CTRL_SERR)) != 0 || From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 20:14:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 410DB1065670; Mon, 9 Jan 2012 20:14:53 +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 2F8098FC12; Mon, 9 Jan 2012 20:14:53 +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 q09KEroX056885; Mon, 9 Jan 2012 20:14:53 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q09KErjK056883; Mon, 9 Jan 2012 20:14:53 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201201092014.q09KErjK056883@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 9 Jan 2012 20:14:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229879 - stable/8/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 20:14:53 -0000 Author: yongari Date: Mon Jan 9 20:14:52 2012 New Revision: 229879 URL: http://svn.freebsd.org/changeset/base/229879 Log: MFC r198999: Take a step towards removing if_watchdog/if_timer. Don't explicitly set if_watchdog/if_timer to NULL/0 when initializing an ifnet. if_alloc() sets those members to NULL/0 already. Modified: stable/8/sys/dev/msk/if_msk.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/msk/if_msk.c ============================================================================== --- stable/8/sys/dev/msk/if_msk.c Mon Jan 9 20:08:57 2012 (r229878) +++ stable/8/sys/dev/msk/if_msk.c Mon Jan 9 20:14:52 2012 (r229879) @@ -1661,8 +1661,6 @@ msk_attach(device_t dev) ifp->if_capenable = ifp->if_capabilities; ifp->if_ioctl = msk_ioctl; ifp->if_start = msk_start; - ifp->if_timer = 0; - ifp->if_watchdog = NULL; ifp->if_init = msk_init; IFQ_SET_MAXLEN(&ifp->if_snd, MSK_TX_RING_CNT - 1); ifp->if_snd.ifq_drv_maxlen = MSK_TX_RING_CNT - 1; From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 20:16:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC1381065678; Mon, 9 Jan 2012 20:16:06 +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 9A8EB8FC17; Mon, 9 Jan 2012 20:16: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 q09KG64o056976; Mon, 9 Jan 2012 20:16:06 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q09KG6fL056974; Mon, 9 Jan 2012 20:16:06 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201201092016.q09KG6fL056974@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 9 Jan 2012 20:16:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229880 - stable/7/sys/dev/msk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 20:16:06 -0000 Author: yongari Date: Mon Jan 9 20:16:06 2012 New Revision: 229880 URL: http://svn.freebsd.org/changeset/base/229880 Log: MFC r198999: Take a step towards removing if_watchdog/if_timer. Don't explicitly set if_watchdog/if_timer to NULL/0 when initializing an ifnet. if_alloc() sets those members to NULL/0 already. Modified: stable/7/sys/dev/msk/if_msk.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/msk/if_msk.c ============================================================================== --- stable/7/sys/dev/msk/if_msk.c Mon Jan 9 20:14:52 2012 (r229879) +++ stable/7/sys/dev/msk/if_msk.c Mon Jan 9 20:16:06 2012 (r229880) @@ -1661,8 +1661,6 @@ msk_attach(device_t dev) ifp->if_capenable = ifp->if_capabilities; ifp->if_ioctl = msk_ioctl; ifp->if_start = msk_start; - ifp->if_timer = 0; - ifp->if_watchdog = NULL; ifp->if_init = msk_init; IFQ_SET_MAXLEN(&ifp->if_snd, MSK_TX_RING_CNT - 1); ifp->if_snd.ifq_drv_maxlen = MSK_TX_RING_CNT - 1; From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 20:25:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4F10106566B; Mon, 9 Jan 2012 20:25:14 +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 B41028FC0C; Mon, 9 Jan 2012 20:25: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 q09KPE2N057380; Mon, 9 Jan 2012 20:25:14 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q09KPEG6057378; Mon, 9 Jan 2012 20:25:14 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201201092025.q09KPEG6057378@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 9 Jan 2012 20:25: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: r229881 - head/sys/boot/forth X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 20:25:14 -0000 Author: pluknet Date: Mon Jan 9 20:25:14 2012 New Revision: 229881 URL: http://svn.freebsd.org/changeset/base/229881 Log: Get rid of a spurious warning on the console when booting the kernel from the interactive loader(8) prompt and beastie_disable="YES" is set in loader.conf(5). In this case menu.rc is not evaluated and consequently menu-unset does not have a body yet. This results in the ficl warning "menu-unset not found" when try-menu-unset invokes menu-unset. Check for beastie_disable="YES" explicitly, so that the try-menu-unset word will not attempt to invoke menu-unset because the menu will have never been configured. [1] Use the sfind primitive as a last resort as an additional safer approach conjuring a foreign word safely. [2] PR: kern/163938 Submitted by: Devin Teske [1] Reviewed by: Devin Teske [2] Reported and tested by: dim MFC after: 1 week X-MFC with: r228985 Modified: head/sys/boot/forth/loader.4th Modified: head/sys/boot/forth/loader.4th ============================================================================== --- head/sys/boot/forth/loader.4th Mon Jan 9 20:16:06 2012 (r229880) +++ head/sys/boot/forth/loader.4th Mon Jan 9 20:25:14 2012 (r229881) @@ -44,9 +44,20 @@ include /boot/support.4th only forth also support-functions also builtins definitions : try-menu-unset + \ menu-unset may not be present + s" beastie_disable" getenv + dup -1 <> if + s" YES" compare-insensitive 0= if + exit + then + else + drop + then s" menu-unset" - ['] evaluate catch if - 2drop + sfind if + execute + else + drop then ; From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 20:31:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA202106568D; Mon, 9 Jan 2012 20:31:12 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-tul01m020-f182.google.com (mail-tul01m020-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 65CD38FC12; Mon, 9 Jan 2012 20:31:12 +0000 (UTC) Received: by obbwd18 with SMTP id wd18so6274649obb.13 for ; Mon, 09 Jan 2012 12:31:11 -0800 (PST) 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=uST1lWGfC0pq1DlLmN0bcBd9dgCHjIwF+c93A3SyQiw=; b=DArQ1C842jV1YERbW9TQwvUvHgo5HU9hCW0yvCYBUDHsf23cNwRL0OmqUX9653mnTR A4n3eARiBtn6xU75Ro23IDX9yr1f52KFU8ZfkGkz8JACBjekf7R0l8Q4o2eVXiSj80Qf //9P5VSn3Rx7X8JbVSYvQoIqFd6Wd6ixKImes= MIME-Version: 1.0 Received: by 10.182.226.6 with SMTP id ro6mr15812838obc.3.1326141071761; Mon, 09 Jan 2012 12:31:11 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.182.171.67 with HTTP; Mon, 9 Jan 2012 12:31:11 -0800 (PST) In-Reply-To: <4F0AE274.8010907@FreeBSD.org> References: <201112300624.pBU6OxO9098906@svn.freebsd.org> <4F08A518.8090207@FreeBSD.org> <4F0AE274.8010907@FreeBSD.org> Date: Mon, 9 Jan 2012 23:31:11 +0300 X-Google-Sender-Auth: snnJsg6LcoVZ1QvtlO9hn-agXeI Message-ID: From: Sergey Kandaurov To: Dimitry Andric 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, Devin Teske Subject: Re: svn commit: r228985 - head/sys/boot/forth X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 20:31:12 -0000 On 9 January 2012 16:49, Dimitry Andric wrote: > On 2012-01-08 21:35, Sergey Kandaurov wrote: > ... > >> So, the problem arise when beastie_disable is set. >> >> In this case menu.rc is not evaluated and consequently menu-unset does >> not have a body yet. This results in the ficl warning "not found" when >> try-menu-unset calls menu-unset. The warning cannot be handled with catc= h >> as seen with the code in head. >> Otherwise, when beastie is enabled, all works as it should. >> >> To "fix" the problem I replaced 'catch' with 'sfind', so that we can >> conditionally call menu-unset only when the definition is present. >> >> Please try the following patch. I tested it with enabled/disabled beasti= e >> and loader_color over serial console. I would also like to get a review >> from Devin Teske to see if this change is acceptable. > > > Yes, this patch makes the warning disappear. =A0Thanks! FYI, committed in r229881. Thanks for the help. --=20 wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 21:49:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A6AF106564A; Mon, 9 Jan 2012 21:49:04 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 153278FC0A; Mon, 9 Jan 2012 21:49: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 q09Ln3Jf060683; Mon, 9 Jan 2012 21:49:03 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q09Ln3PN060681; Mon, 9 Jan 2012 21:49:03 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201201092149.q09Ln3PN060681@svn.freebsd.org> From: Andrew Thompson Date: Mon, 9 Jan 2012 21:49:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229882 - stable/9/sys/boot/arm/ixp425/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 21:49:04 -0000 Author: thompsa Date: Mon Jan 9 21:49:03 2012 New Revision: 229882 URL: http://svn.freebsd.org/changeset/base/229882 Log: MFC r225955 Allow ixp425 boot2 to compile after r219452 Modified: stable/9/sys/boot/arm/ixp425/boot2/boot2.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/boot/arm/ixp425/boot2/boot2.c ============================================================================== --- stable/9/sys/boot/arm/ixp425/boot2/boot2.c Mon Jan 9 20:25:14 2012 (r229881) +++ stable/9/sys/boot/arm/ixp425/boot2/boot2.c Mon Jan 9 21:49:03 2012 (r229882) @@ -86,7 +86,7 @@ static unsigned dsk_start; static char cmd[512]; static char kname[1024]; static uint32_t opts; -static int dsk_meta; +static uint8_t dsk_meta; static int bootslice; static int bootpart; static int disk_layout; From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 21:49:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CC191065677; Mon, 9 Jan 2012 21:49:48 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 265AB8FC1D; Mon, 9 Jan 2012 21:49: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 q09Lnmcf060746; Mon, 9 Jan 2012 21:49:48 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q09Lnmgv060744; Mon, 9 Jan 2012 21:49:48 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201201092149.q09Lnmgv060744@svn.freebsd.org> From: Andrew Thompson Date: Mon, 9 Jan 2012 21:49:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229883 - stable/9/sys/arm/xscale/ixp425 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 21:49:48 -0000 Author: thompsa Date: Mon Jan 9 21:49:47 2012 New Revision: 229883 URL: http://svn.freebsd.org/changeset/base/229883 Log: MFC r226034 Add missing newbus glue, this has never attached properly to gpiobus. Modified: stable/9/sys/arm/xscale/ixp425/avila_gpio.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/arm/xscale/ixp425/avila_gpio.c ============================================================================== --- stable/9/sys/arm/xscale/ixp425/avila_gpio.c Mon Jan 9 21:49:03 2012 (r229882) +++ stable/9/sys/arm/xscale/ixp425/avila_gpio.c Mon Jan 9 21:49:47 2012 (r229883) @@ -356,5 +356,10 @@ static driver_t gpio_avila_driver = { sizeof(struct avila_gpio_softc), }; static devclass_t gpio_avila_devclass; +extern devclass_t gpiobus_devclass, gpioc_devclass; +extern driver_t gpiobus_driver, gpioc_driver; DRIVER_MODULE(gpio_avila, ixp, gpio_avila_driver, gpio_avila_devclass, 0, 0); +DRIVER_MODULE(gpiobus, gpio_avila, gpiobus_driver, gpiobus_devclass, 0, 0); +DRIVER_MODULE(gpioc, gpio_avila, gpioc_driver, gpioc_devclass, 0, 0); +MODULE_VERSION(gpio_avila, 1); From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 21:51:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 982F41065670; Mon, 9 Jan 2012 21:51:50 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82B408FC0A; Mon, 9 Jan 2012 21:51: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 q09LpoCV060868; Mon, 9 Jan 2012 21:51:50 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q09Lpo9t060866; Mon, 9 Jan 2012 21:51:50 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201201092151.q09Lpo9t060866@svn.freebsd.org> From: Andrew Thompson Date: Mon, 9 Jan 2012 21:51:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229884 - stable/9/tools/tools/nanobsd/gateworks X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 21:51:50 -0000 Author: thompsa Date: Mon Jan 9 21:51:50 2012 New Revision: 229884 URL: http://svn.freebsd.org/changeset/base/229884 Log: MFC r226242 Fix build after TARGET_BIG_ENDIAN was nuked from orbit. Modified: stable/9/tools/tools/nanobsd/gateworks/common Directory Properties: stable/9/tools/tools/nanobsd/ (props changed) Modified: stable/9/tools/tools/nanobsd/gateworks/common ============================================================================== --- stable/9/tools/tools/nanobsd/gateworks/common Mon Jan 9 21:49:47 2012 (r229883) +++ stable/9/tools/tools/nanobsd/gateworks/common Mon Jan 9 21:51:50 2012 (r229884) @@ -4,9 +4,8 @@ NANO_CFGDIR=${NANO_CFGDIR:-${NANO_SRC}/$ test -d ${NANO_CFGDIR} || NANO_CFGDIR=/var/empty NANO_PMAKE="make" # NB: disable -j 3 -NANO_ARCH=arm +NANO_ARCH=armeb TARGET_CPUTYPE=xscale; export TARGET_CPUTYPE # XXX -TARGET_BIG_ENDIAN=true; export TARGET_BIG_ENDIAN # XXX NANO_CUSTOMIZE="cust_allow_ssh_root" From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 21:52:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC3A11065673; Mon, 9 Jan 2012 21:52:55 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D68A48FC12; Mon, 9 Jan 2012 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 q09Lqth0060949; Mon, 9 Jan 2012 21:52:55 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q09LqtXH060947; Mon, 9 Jan 2012 21:52:55 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201201092152.q09LqtXH060947@svn.freebsd.org> From: Andrew Thompson Date: Mon, 9 Jan 2012 21:52:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229885 - stable/9/sys/arm/xscale/ixp425 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 21:52:56 -0000 Author: thompsa Date: Mon Jan 9 21:52:55 2012 New Revision: 229885 URL: http://svn.freebsd.org/changeset/base/229885 Log: MFC r226324 Dont just set the pin high when turning on output, use the current value. Also let this value be set when in input mode. Modified: stable/9/sys/arm/xscale/ixp425/cambria_gpio.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/arm/xscale/ixp425/cambria_gpio.c ============================================================================== --- stable/9/sys/arm/xscale/ixp425/cambria_gpio.c Mon Jan 9 21:51:50 2012 (r229884) +++ stable/9/sys/arm/xscale/ixp425/cambria_gpio.c Mon Jan 9 21:52:55 2012 (r229885) @@ -84,6 +84,7 @@ struct cambria_gpio_softc { struct mtx sc_mtx; struct gpio_pin sc_pins[GPIO_PINS]; uint8_t sc_latch; + uint8_t sc_val; }; struct cambria_gpio_pin { @@ -309,6 +310,9 @@ cambria_gpio_pin_setflags(device_t dev, { struct cambria_gpio_softc *sc = device_get_softc(dev); int error; + uint8_t mask; + + mask = 1 << pin; if (pin >= GPIO_PINS) return (EINVAL); @@ -325,7 +329,16 @@ cambria_gpio_pin_setflags(device_t dev, GPIO_LOCK(sc); sc->sc_pins[pin].gp_flags = flags; - sc->sc_latch |= (1 << pin); + /* + * Writing a logical one sets the signal high and writing a logical + * zero sets the signal low. To configure a digital I/O signal as an + * input, a logical one must first be written to the data bit to + * three-state the associated output. + */ + if (flags & GPIO_PIN_INPUT || sc->sc_val & mask) + sc->sc_latch |= mask; /* input or output & high */ + else + sc->sc_latch &= ~mask; error = cambria_gpio_write(sc); GPIO_UNLOCK(sc); @@ -337,15 +350,28 @@ cambria_gpio_pin_set(device_t dev, uint3 { struct cambria_gpio_softc *sc = device_get_softc(dev); int error; + uint8_t mask; - if (pin >= GPIO_PINS || sc->sc_pins[pin].gp_flags != GPIO_PIN_OUTPUT) - return (EINVAL); + mask = 1 << pin; + if (pin >= GPIO_PINS) + return (EINVAL); GPIO_LOCK(sc); if (value) - sc->sc_latch |= (1 << pin); + sc->sc_val |= mask; else - sc->sc_latch &= ~(1 << pin); + sc->sc_val &= ~mask; + + if (sc->sc_pins[pin].gp_flags != GPIO_PIN_OUTPUT) { + /* just save, altering the latch will disable input */ + GPIO_UNLOCK(sc); + return (0); + } + + if (value) + sc->sc_latch |= mask; + else + sc->sc_latch &= ~mask; error = cambria_gpio_write(sc); GPIO_UNLOCK(sc); @@ -375,14 +401,17 @@ static int cambria_gpio_pin_toggle(device_t dev, uint32_t pin) { struct cambria_gpio_softc *sc = device_get_softc(dev); - int error; + int error = 0; - if (pin >= GPIO_PINS || sc->sc_pins[pin].gp_flags != GPIO_PIN_OUTPUT) + if (pin >= GPIO_PINS) return (EINVAL); GPIO_LOCK(sc); - sc->sc_latch ^= (1 << pin); - error = cambria_gpio_write(sc); + sc->sc_val ^= (1 << pin); + if (sc->sc_pins[pin].gp_flags == GPIO_PIN_OUTPUT) { + sc->sc_latch ^= (1 << pin); + error = cambria_gpio_write(sc); + } GPIO_UNLOCK(sc); return (error); From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 22:15:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07DB61065679; Mon, 9 Jan 2012 22:15:59 +0000 (UTC) (envelope-from maksim.yevmenkin@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 78C3D8FC14; Mon, 9 Jan 2012 22:15:58 +0000 (UTC) Received: by ghrr16 with SMTP id r16so2060674ghr.13 for ; Mon, 09 Jan 2012 14:15:57 -0800 (PST) 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=ZT7FUe3IDs6U2DHnjd6jrcSrnttm42g5DesP9hVcmeM=; b=qQ09OkpbdX02XA7Vl8SBy7uMeUtlew5gjLXvSBceFOUYW1jmgsyyf++Ne3itToa8p/ QrqQVn+Vrb8HmOwFsD4HuPnZzrdA7cfcZzFbPV2M4J83PQUTn6Ynop1MuW/3OmOswMWC 7Tn4S5xq3frafdAGIGgdDqtCHYxcTBmnludFk= MIME-Version: 1.0 Received: by 10.236.91.84 with SMTP id g60mr23607849yhf.90.1326147357696; Mon, 09 Jan 2012 14:15:57 -0800 (PST) Sender: maksim.yevmenkin@gmail.com Received: by 10.101.41.18 with HTTP; Mon, 9 Jan 2012 14:15:57 -0800 (PST) In-Reply-To: <4F0B3C66.6020701@FreeBSD.org> References: <201112282249.pBSMnTZu028304@svn.freebsd.org> <4F0B38B9.1020302@FreeBSD.org> <4F0B3C66.6020701@FreeBSD.org> Date: Mon, 9 Jan 2012 14:15:57 -0800 X-Google-Sender-Auth: -ngbzUl8qu04FNji6cnQyp5Qs-w Message-ID: From: Maksim Yevmenkin To: Alexander Motin 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 Subject: Re: svn commit: r228939 - head/sys/dev/mps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 22:15:59 -0000 2012/1/9 Alexander Motin : > On 09.01.2012 21:01, Maksim Yevmenkin wrote: >> >> 2012/1/9 Alexander Motin: >>> >>> On 09.01.2012 20:54, Maksim Yevmenkin wrote: >>>> >>>> >>>> On Wed, Dec 28, 2011 at 2:49 PM, Alexander Motin >>>> =A0wrote: >>>>> >>>>> >>>>> Author: mav >>>>> Date: Wed Dec 28 22:49:28 2011 >>>>> New Revision: 228939 >>>>> URL: http://svn.freebsd.org/changeset/base/228939 >>>>> >>>>> Log: >>>>> =A0Set maximum I/O size for mps(4) to MAXPHYS. Looking into the code,= I >>>>> see >>>>> =A0no reason why it should be limited to 64K of DFLTPHYS. DMA data ta= g is >>>>> any >>>>> =A0way set to allow MAXPHYS, S/G lists (chain elements) are sufficien= t >>>>> and >>>>> =A0overflows are also handled. On my tests even 1MB I/Os are working >>>>> fine. >>>>> >>>>> =A0Reviewed by: =A0ken@ >>>>> >>>>> Modified: >>>>> =A0head/sys/dev/mps/mps_sas.c >>>>> >>>>> Modified: head/sys/dev/mps/mps_sas.c >>>>> >>>>> >>>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D >>>>> --- head/sys/dev/mps/mps_sas.c =A0Wed Dec 28 22:18:53 2011 >>>>> =A0(r228938) >>>>> +++ head/sys/dev/mps/mps_sas.c =A0Wed Dec 28 22:49:28 2011 >>>>> =A0(r228939) >>>>> @@ -937,6 +937,7 @@ mpssas_action(struct cam_sim *sim, union >>>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cpi->transport_version =3D 0; >>>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cpi->protocol =3D PROTO_SCSI; >>>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cpi->protocol_version =3D SCSI_REV_SPC= ; >>>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 cpi->maxio =3D MAXPHYS; >>>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cpi->ccb_h.status =3D CAM_REQ_CMP; >>>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; >>>>> =A0 =A0 =A0 =A0} >>>> >>>> >>>> >>>> sorry for the late reply, but can we make in into tunable please? i >>>> have in local tree >>>> >>>> --- mps_sas.c.orig =A0 =A0 =A02011-11-17 02:05:04.000000000 -0800 >>>> +++ mps_sas.c =A0 2011-12-28 16:05:10.000000000 -0800 >>>> @@ -121,6 +121,11 @@ >>>> >>>> =A0MALLOC_DEFINE(M_MPSSAS, "MPSSAS", "MPS SAS memory"); >>>> >>>> +int mps_maxio =3D MAXPHYS; >>>> +TUNABLE_INT("hw.mps.maxio",&mps_maxio); >>>> +SYSCTL_INT(_hw_mps, OID_AUTO, maxio, CTLFLAG_RD,&mps_maxio, 0, >>>> >>>> + =A0 =A0 =A0 "CAM maxio override\n"); >>>> + >>>> =A0static __inline int mpssas_set_lun(uint8_t *lun, u_int ccblun); >>>> =A0static struct mpssas_target * mpssas_alloc_target(struct mpssas_sof= tc >>>> *, >>>> =A0 =A0 =A0struct mpssas_target *); >>>> @@ -938,6 +943,7 @@ >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cpi->protocol =3D PROTO_SCSI; >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cpi->protocol_version =3D SCSI_REV_SPC; >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cpi->ccb_h.status =3D CAM_REQ_CMP; >>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 cpi->maxio =3D mps_maxio; >>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; >>>> =A0 =A0 =A0 =A0} >>>> =A0 =A0 =A0 =A0case XPT_GET_TRAN_SETTINGS: >>> >>> >>> >>> We can. but could you explain why? Have you found any problems this >>> change? >> >> >> not really. i've had this patch in the local tree for a while now. we >> are experimenting with various MAXPHYS/maxio settings and having this >> tunable is very handy. basically, we can set MAXPHYS to some larger >> value and tweak maxio (for testing purposes) without >> recompiling/installing new kernel. > > > I don't really think that it is perfect place for such tunable. It is a b= it > strange IMHO to have different maxio for different types of HBAs except > physical limitations. I would prefer it to be configurable on above layer= s, > for example, file systems, if needed. But if you need it here for somethi= ng, > I won't object against adding it. i'm not sure i understand your point. there certainly drivers that set maxio to value smaller then MAXPHYS. sometimes comments in the code clearly state that this is because of hardware limitation. in case of mps(4) it was not clear at all which values are acceptable for maxio. hence the tunable. > Have you found any benefits of having maxio below MAXPHYS while > experimenting? May be those results could be used to improve FS behavior > somehow to make tuning not needed? we believe so. fs tuning is under investigation as well. thanks max From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 23:01:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B34EA106566C; Mon, 9 Jan 2012 23:01:42 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9CAF38FC15; Mon, 9 Jan 2012 23:01: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 q09N1gsG064210; Mon, 9 Jan 2012 23:01:42 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q09N1gKe064207; Mon, 9 Jan 2012 23:01:42 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201201092301.q09N1gKe064207@svn.freebsd.org> From: Jim Harris Date: Mon, 9 Jan 2012 23:01: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: r229886 - in head: sbin/geom/class/raid sys/geom/raid X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 23:01:42 -0000 Author: jimharris Date: Mon Jan 9 23:01:42 2012 New Revision: 229886 URL: http://svn.freebsd.org/changeset/base/229886 Log: Add support for >2TB disks in GEOM RAID for Intel metadata format. Reviewed by: mav Approved by: scottl MFC after: 1 week Modified: head/sbin/geom/class/raid/graid.8 head/sys/geom/raid/md_intel.c Modified: head/sbin/geom/class/raid/graid.8 ============================================================================== --- head/sbin/geom/class/raid/graid.8 Mon Jan 9 21:52:55 2012 (r229885) +++ head/sbin/geom/class/raid/graid.8 Mon Jan 9 23:01:42 2012 (r229886) @@ -251,7 +251,7 @@ complete it there. Do not run GEOM RAID class on migrating volumes under pain of possible data corruption! .Sh 2TiB BARRIERS -Intel and Promise metadata formats do not support disks above 2TiB. +Promise metadata format does not support disks above 2TiB. NVIDIA metadata format does not support volumes above 2TiB. .Sh EXIT STATUS Exit status is 0 on success, and non-zero if the command fails. Modified: head/sys/geom/raid/md_intel.c ============================================================================== --- head/sys/geom/raid/md_intel.c Mon Jan 9 21:52:55 2012 (r229885) +++ head/sys/geom/raid/md_intel.c Mon Jan 9 23:01:42 2012 (r229886) @@ -64,7 +64,10 @@ struct intel_raid_map { uint8_t total_domains; uint8_t failed_disk_num; uint8_t ddf; - uint32_t filler_2[7]; + uint32_t offset_hi; + uint32_t disk_sectors_hi; + uint32_t stripe_count_hi; + uint32_t filler_2[4]; uint32_t disk_idx[1]; /* total_disks entries. */ #define INTEL_DI_IDX 0x00ffffff #define INTEL_DI_RBLD 0x01000000 @@ -111,7 +114,8 @@ struct intel_raid_vol { uint8_t fs_state; uint16_t verify_errors; uint16_t bad_blocks; - uint32_t filler_1[4]; + uint32_t curr_migr_unit_hi; + uint32_t filler_1[3]; struct intel_raid_map map[1]; /* 2 entries if migr_state != 0. */ } __packed; @@ -125,8 +129,9 @@ struct intel_raid_disk { #define INTEL_F_ASSIGNED 0x02 #define INTEL_F_FAILED 0x04 #define INTEL_F_ONLINE 0x08 - - uint32_t filler[5]; + uint32_t owner_cfg_num; + uint32_t sectors_hi; + uint32_t filler[3]; } __packed; struct intel_raid_conf { @@ -254,6 +259,82 @@ intel_get_volume(struct intel_raid_conf return (mvol); } +static off_t +intel_get_map_offset(struct intel_raid_map *mmap) +{ + off_t offset = (off_t)mmap->offset_hi << 32; + + offset += mmap->offset; + return (offset); +} + +static void +intel_set_map_offset(struct intel_raid_map *mmap, off_t offset) +{ + + mmap->offset = offset & 0xffffffff; + mmap->offset_hi = offset >> 32; +} + +static off_t +intel_get_map_disk_sectors(struct intel_raid_map *mmap) +{ + off_t disk_sectors = (off_t)mmap->disk_sectors_hi << 32; + + disk_sectors += mmap->disk_sectors; + return (disk_sectors); +} + +static void +intel_set_map_disk_sectors(struct intel_raid_map *mmap, off_t disk_sectors) +{ + + mmap->disk_sectors = disk_sectors & 0xffffffff; + mmap->disk_sectors_hi = disk_sectors >> 32; +} + +static void +intel_set_map_stripe_count(struct intel_raid_map *mmap, off_t stripe_count) +{ + + mmap->stripe_count = stripe_count & 0xffffffff; + mmap->stripe_count_hi = stripe_count >> 32; +} + +static off_t +intel_get_disk_sectors(struct intel_raid_disk *disk) +{ + off_t sectors = (off_t)disk->sectors_hi << 32; + + sectors += disk->sectors; + return (sectors); +} + +static void +intel_set_disk_sectors(struct intel_raid_disk *disk, off_t sectors) +{ + + disk->sectors = sectors & 0xffffffff; + disk->sectors_hi = sectors >> 32; +} + +static off_t +intel_get_vol_curr_migr_unit(struct intel_raid_vol *vol) +{ + off_t curr_migr_unit = (off_t)vol->curr_migr_unit_hi << 32; + + curr_migr_unit += vol->curr_migr_unit; + return (curr_migr_unit); +} + +static void +intel_set_vol_curr_migr_unit(struct intel_raid_vol *vol, off_t curr_migr_unit) +{ + + vol->curr_migr_unit = curr_migr_unit & 0xffffffff; + vol->curr_migr_unit_hi = curr_migr_unit >> 32; +} + static void g_raid_md_intel_print(struct intel_raid_conf *meta) { @@ -274,10 +355,11 @@ g_raid_md_intel_print(struct intel_raid_ printf("attributes 0x%08x\n", meta->attributes); printf("total_disks %u\n", meta->total_disks); printf("total_volumes %u\n", meta->total_volumes); - printf("DISK# serial disk_sectors disk_id flags\n"); + printf("DISK# serial disk_sectors disk_sectors_hi disk_id flags\n"); for (i = 0; i < meta->total_disks; i++ ) { - printf(" %d <%.16s> %u 0x%08x 0x%08x\n", i, + printf(" %d <%.16s> %u %u 0x%08x 0x%08x\n", i, meta->disk[i].serial, meta->disk[i].sectors, + meta->disk[i].sectors_hi, meta->disk[i].id, meta->disk[i].flags); } for (i = 0; i < meta->total_volumes; i++) { @@ -288,6 +370,7 @@ g_raid_md_intel_print(struct intel_raid_ printf(" state %u\n", mvol->state); printf(" reserved %u\n", mvol->reserved); printf(" curr_migr_unit %u\n", mvol->curr_migr_unit); + printf(" curr_migr_unit_hi %u\n", mvol->curr_migr_unit_hi); printf(" checkpoint_id %u\n", mvol->checkpoint_id); printf(" migr_state %u\n", mvol->migr_state); printf(" migr_type %u\n", mvol->migr_type); @@ -297,8 +380,11 @@ g_raid_md_intel_print(struct intel_raid_ printf(" *** Map %d ***\n", j); mmap = intel_get_map(mvol, j); printf(" offset %u\n", mmap->offset); + printf(" offset_hi %u\n", mmap->offset_hi); printf(" disk_sectors %u\n", mmap->disk_sectors); + printf(" disk_sectors_hi %u\n", mmap->disk_sectors_hi); printf(" stripe_count %u\n", mmap->stripe_count); + printf(" stripe_count_hi %u\n", mmap->stripe_count_hi); printf(" strip_sectors %u\n", mmap->strip_sectors); printf(" status %u\n", mmap->status); printf(" type %u\n", mmap->type); @@ -660,12 +746,15 @@ g_raid_md_intel_start_disk(struct g_raid continue; /* Make sure this disk is big enough. */ TAILQ_FOREACH(sd, &tmpdisk->d_subdisks, sd_next) { + off_t disk_sectors = + intel_get_disk_sectors(&pd->pd_disk_meta); + if (sd->sd_offset + sd->sd_size + 4096 > - (off_t)pd->pd_disk_meta.sectors * 512) { + disk_sectors * 512) { G_RAID_DEBUG1(1, sc, "Disk too small (%llu < %llu)", - ((unsigned long long) - pd->pd_disk_meta.sectors) * 512, + (unsigned long long) + disk_sectors * 512, (unsigned long long) sd->sd_offset + sd->sd_size + 4096); break; @@ -788,7 +877,7 @@ nofit: sd->sd_rebuild_pos = 0; } else { sd->sd_rebuild_pos = - (off_t)mvol->curr_migr_unit * + intel_get_vol_curr_migr_unit(mvol) * sd->sd_volume->v_strip_size * mmap0->total_domains; } @@ -815,7 +904,7 @@ nofit: sd->sd_rebuild_pos = 0; } else { sd->sd_rebuild_pos = - (off_t)mvol->curr_migr_unit * + intel_get_vol_curr_migr_unit(mvol) * sd->sd_volume->v_strip_size * mmap0->total_domains; } @@ -967,8 +1056,8 @@ g_raid_md_intel_start(struct g_raid_soft vol->v_sectorsize = 512; //ZZZ for (j = 0; j < vol->v_disks_count; j++) { sd = &vol->v_subdisks[j]; - sd->sd_offset = (off_t)mmap->offset * 512; //ZZZ - sd->sd_size = (off_t)mmap->disk_sectors * 512; //ZZZ + sd->sd_offset = intel_get_map_offset(mmap) * 512; //ZZZ + sd->sd_size = intel_get_map_disk_sectors(mmap) * 512; //ZZZ } g_raid_start_volume(vol); } @@ -1176,9 +1265,6 @@ g_raid_md_taste_intel(struct g_raid_md_o G_RAID_DEBUG(1, "Intel vendor mismatch 0x%04x != 0x8086", vendor); - } else if (pp->mediasize / pp->sectorsize > UINT32_MAX) { - G_RAID_DEBUG(1, - "Intel disk '%s' is too big.", pp->name); } else { G_RAID_DEBUG(1, "No Intel metadata, forcing spare."); @@ -1195,10 +1281,10 @@ g_raid_md_taste_intel(struct g_raid_md_o G_RAID_DEBUG(1, "Intel serial '%s' not found", serial); goto fail1; } - if (meta->disk[disk_pos].sectors != + if (intel_get_disk_sectors(&meta->disk[disk_pos]) != (pp->mediasize / pp->sectorsize)) { G_RAID_DEBUG(1, "Intel size mismatch %ju != %ju", - (off_t)meta->disk[disk_pos].sectors, + intel_get_disk_sectors(&meta->disk[disk_pos]), (off_t)(pp->mediasize / pp->sectorsize)); goto fail1; } @@ -1266,7 +1352,8 @@ search: pd->pd_disk_pos = -1; if (spare == 2) { memcpy(&pd->pd_disk_meta.serial[0], serial, INTEL_SERIAL_LEN); - pd->pd_disk_meta.sectors = pp->mediasize / pp->sectorsize; + intel_set_disk_sectors(&pd->pd_disk_meta, + pp->mediasize / pp->sectorsize); pd->pd_disk_meta.id = 0; pd->pd_disk_meta.flags = INTEL_F_SPARE; } else { @@ -1372,7 +1459,7 @@ g_raid_md_ctl_intel(struct g_raid_md_obj const char *verb, *volname, *levelname, *diskname; char *tmp; int *nargs, *force; - off_t off, size, sectorsize, strip; + off_t off, size, sectorsize, strip, disk_sectors; intmax_t *sizearg, *striparg; int numdisks, i, len, level, qual, update; int error; @@ -1452,13 +1539,6 @@ g_raid_md_ctl_intel(struct g_raid_md_obj cp->private = disk; g_topology_unlock(); - if (pp->mediasize / pp->sectorsize > UINT32_MAX) { - gctl_error(req, - "Disk '%s' is too big.", diskname); - error = -8; - break; - } - error = g_raid_md_get_label(cp, &pd->pd_disk_meta.serial[0], INTEL_SERIAL_LEN); if (error != 0) { @@ -1479,7 +1559,8 @@ g_raid_md_ctl_intel(struct g_raid_md_obj "Dumping not supported by %s.", cp->provider->name); - pd->pd_disk_meta.sectors = pp->mediasize / pp->sectorsize; + intel_set_disk_sectors(&pd->pd_disk_meta, + pp->mediasize / pp->sectorsize); if (size > pp->mediasize) size = pp->mediasize; if (sectorsize < pp->sectorsize) @@ -1544,10 +1625,6 @@ g_raid_md_ctl_intel(struct g_raid_md_obj gctl_error(req, "Size too small."); return (-13); } - if (size > 0xffffffffllu * sectorsize) { - gctl_error(req, "Size too big."); - return (-14); - } /* We have all we need, create things: volume, ... */ mdi->mdio_started = 1; @@ -1655,8 +1732,11 @@ g_raid_md_ctl_intel(struct g_raid_md_obj disk = vol1->v_subdisks[i].sd_disk; pd = (struct g_raid_md_intel_perdisk *) disk->d_md_data; - if ((off_t)pd->pd_disk_meta.sectors * 512 < size) - size = (off_t)pd->pd_disk_meta.sectors * 512; + disk_sectors = + intel_get_disk_sectors(&pd->pd_disk_meta); + + if (disk_sectors * 512 < size) + size = disk_sectors * 512; if (disk->d_consumer != NULL && disk->d_consumer->provider != NULL && disk->d_consumer->provider->sectorsize > @@ -1950,14 +2030,6 @@ g_raid_md_ctl_intel(struct g_raid_md_obj pp = cp->provider; g_topology_unlock(); - if (pp->mediasize / pp->sectorsize > UINT32_MAX) { - gctl_error(req, - "Disk '%s' is too big.", diskname); - g_raid_kill_consumer(sc, cp); - error = -8; - break; - } - /* Read disk serial. */ error = g_raid_md_get_label(cp, &serial[0], INTEL_SERIAL_LEN); @@ -1990,7 +2062,8 @@ g_raid_md_ctl_intel(struct g_raid_md_obj memcpy(&pd->pd_disk_meta.serial[0], &serial[0], INTEL_SERIAL_LEN); - pd->pd_disk_meta.sectors = pp->mediasize / pp->sectorsize; + intel_set_disk_sectors(&pd->pd_disk_meta, + pp->mediasize / pp->sectorsize); pd->pd_disk_meta.id = 0; pd->pd_disk_meta.flags = INTEL_F_SPARE; @@ -2165,8 +2238,8 @@ g_raid_md_write_intel(struct g_raid_md_o mmap0 = intel_get_map(mvol, 0); /* Write map / common part of two maps. */ - mmap0->offset = sd->sd_offset / sectorsize; - mmap0->disk_sectors = sd->sd_size / sectorsize; + intel_set_map_offset(mmap0, sd->sd_offset / sectorsize); + intel_set_map_disk_sectors(mmap0, sd->sd_size / sectorsize); mmap0->strip_sectors = vol->v_strip_size / sectorsize; if (vol->v_state == G_RAID_VOLUME_S_BROKEN) mmap0->status = INTEL_S_FAILURE; @@ -2188,15 +2261,15 @@ g_raid_md_write_intel(struct g_raid_md_o mmap0->total_domains = 2; else mmap0->total_domains = 1; - mmap0->stripe_count = sd->sd_size / vol->v_strip_size / - mmap0->total_domains; + intel_set_map_stripe_count(mmap0, + sd->sd_size / vol->v_strip_size / mmap0->total_domains); mmap0->failed_disk_num = 0xff; mmap0->ddf = 1; /* If there are two maps - copy common and update. */ if (mvol->migr_state) { - mvol->curr_migr_unit = pos / - vol->v_strip_size / mmap0->total_domains; + intel_set_vol_curr_migr_unit(mvol, + pos / vol->v_strip_size / mmap0->total_domains); mmap1 = intel_get_map(mvol, 1); memcpy(mmap1, mmap0, sizeof(struct intel_raid_map)); mmap0->status = INTEL_S_READY; From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 23:20:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD96F106566C; Mon, 9 Jan 2012 23:20:30 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DB158FC22; Mon, 9 Jan 2012 23:20: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 q09NKUPY065385; Mon, 9 Jan 2012 23:20:30 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q09NKUhv065381; Mon, 9 Jan 2012 23:20:30 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201201092320.q09NKUhv065381@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 9 Jan 2012 23:20: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: r229887 - in head/sys: conf dev/random modules/random X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 23:20:30 -0000 Author: jkim Date: Mon Jan 9 23:20:30 2012 New Revision: 229887 URL: http://svn.freebsd.org/changeset/base/229887 Log: Enable hardware RNG for VIA Nano processors. PR: kern/163974 Modified: head/sys/conf/files.amd64 head/sys/dev/random/probe.c head/sys/modules/random/Makefile Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Mon Jan 9 23:01:42 2012 (r229886) +++ head/sys/conf/files.amd64 Mon Jan 9 23:20:30 2012 (r229887) @@ -215,6 +215,7 @@ dev/lindev/lindev.c optional lindev dev/nfe/if_nfe.c optional nfe pci dev/nve/if_nve.c optional nve pci dev/nvram/nvram.c optional nvram isa +dev/random/nehemiah.c optional random dev/qlxgb/qla_dbg.c optional qlxgb pci dev/qlxgb/qla_hw.c optional qlxgb pci dev/qlxgb/qla_ioctl.c optional qlxgb pci Modified: head/sys/dev/random/probe.c ============================================================================== --- head/sys/dev/random/probe.c Mon Jan 9 23:01:42 2012 (r229886) +++ head/sys/dev/random/probe.c Mon Jan 9 23:20:30 2012 (r229887) @@ -36,7 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__i386__) && !defined(PC98) +#if defined(__amd64__) || (defined(__i386__) && !defined(PC98)) #include #include #include @@ -55,7 +55,7 @@ random_ident_hardware(struct random_syst *systat = random_yarrow; /* Then go looking for hardware */ -#if defined(__i386__) && !defined(PC98) +#if defined(__amd64__) || (defined(__i386__) && !defined(PC98)) if (via_feature_rng & VIA_HAS_RNG) { *systat = random_nehemiah; } Modified: head/sys/modules/random/Makefile ============================================================================== --- head/sys/modules/random/Makefile Mon Jan 9 23:01:42 2012 (r229886) +++ head/sys/modules/random/Makefile Mon Jan 9 23:20:30 2012 (r229887) @@ -6,7 +6,7 @@ KMOD= random SRCS= randomdev.c probe.c -.if ${MACHINE} == "i386" +.if ${MACHINE} == "amd64" || ${MACHINE} == "i386" SRCS+= nehemiah.c .endif SRCS+= randomdev_soft.c yarrow.c hash.c From owner-svn-src-all@FreeBSD.ORG Mon Jan 9 23:43:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E62B01065675; Mon, 9 Jan 2012 23:43:43 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 5D12E8FC16; Mon, 9 Jan 2012 23:43:42 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q09Nhdbq086388 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 10 Jan 2012 01:43:39 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q09Nhdoh055683; Tue, 10 Jan 2012 01:43:39 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q09NhdFV055682; Tue, 10 Jan 2012 01:43:39 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 10 Jan 2012 01:43:39 +0200 From: Kostik Belousov To: Jung-uk Kim Message-ID: <20120109234339.GD31224@deviant.kiev.zoral.com.ua> References: <201201092320.q09NKUhv065381@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="sR4wgT97u2q5hWcW" Content-Disposition: inline In-Reply-To: <201201092320.q09NKUhv065381@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r229887 - in head/sys: conf dev/random modules/random X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2012 23:43:44 -0000 --sR4wgT97u2q5hWcW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 09, 2012 at 11:20:30PM +0000, Jung-uk Kim wrote: > Author: jkim > Date: Mon Jan 9 23:20:30 2012 > New Revision: 229887 > URL: http://svn.freebsd.org/changeset/base/229887 >=20 > Log: > Enable hardware RNG for VIA Nano processors. > =20 > PR: kern/163974 Can we, please, have VIA RNG enabled under some option ? It is currently eating 512 bytes on 99.9% of machines for FPU save area. Shortly it will take even more on AVX-capable machines. --sR4wgT97u2q5hWcW Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk8Le6sACgkQC3+MBN1Mb4jdWQCePjezcIEJbumtsekAo28v/W7F gOwAoJ5trw99Mgaule5+SV1TKk1oTBtf =NtT7 -----END PGP SIGNATURE----- --sR4wgT97u2q5hWcW-- From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 00:01:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F4073106566B; Tue, 10 Jan 2012 00:01:17 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D46E38FC0A; Tue, 10 Jan 2012 00:01: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 q0A01HdP067764; Tue, 10 Jan 2012 00:01:17 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A01HfR067755; Tue, 10 Jan 2012 00:01:17 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201100001.q0A01HfR067755@svn.freebsd.org> From: Eitan Adler Date: Tue, 10 Jan 2012 00:01:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229888 - in stable/9: sbin/ipfw sys/cam/scsi sys/fs/devfs sys/netinet usr.sbin/mtree usr.sbin/pmcstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 00:01:18 -0000 Author: eadler (ports committer) Date: Tue Jan 10 00:01:17 2012 New Revision: 229888 URL: http://svn.freebsd.org/changeset/base/229888 Log: MFC 227489: - fix duplicate "a a" in some comments Approved by: simon Modified: stable/9/sbin/ipfw/main.c stable/9/sys/cam/scsi/scsi_ch.h stable/9/sys/cam/scsi/scsi_ses.c stable/9/sys/fs/devfs/devfs_rule.c stable/9/sys/netinet/sctp_structs.h stable/9/usr.sbin/mtree/mtree.5 stable/9/usr.sbin/pmcstat/pmcstat.c Directory Properties: stable/9/sbin/ipfw/ (props changed) stable/9/sys/ (props changed) stable/9/usr.sbin/mtree/ (props changed) stable/9/usr.sbin/pmcstat/ (props changed) Modified: stable/9/sbin/ipfw/main.c ============================================================================== --- stable/9/sbin/ipfw/main.c Mon Jan 9 23:20:30 2012 (r229887) +++ stable/9/sbin/ipfw/main.c Tue Jan 10 00:01:17 2012 (r229888) @@ -87,7 +87,7 @@ help(void) * which includes the program name and a NULL entry at the end. * If we are called with a single string, we split it on whitespace. * Also, arguments with a trailing ',' are joined to the next one. - * The pointers (av[]) and data are in a a single chunk of memory. + * The pointers (av[]) and data are in a single chunk of memory. * av[0] points to the original program name, all other entries * point into the allocated chunk. */ Modified: stable/9/sys/cam/scsi/scsi_ch.h ============================================================================== --- stable/9/sys/cam/scsi/scsi_ch.h Mon Jan 9 23:20:30 2012 (r229887) +++ stable/9/sys/cam/scsi/scsi_ch.h Tue Jan 10 00:01:17 2012 (r229888) @@ -359,7 +359,7 @@ struct page_device_capabilities { * Some of these fields can be a little confusing, so an explanation * is in order. * - * Each component within a a medium changer apparatus is called an + * Each component within a medium changer apparatus is called an * "element". * * The "medium transport element address" is the address of the first Modified: stable/9/sys/cam/scsi/scsi_ses.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_ses.c Mon Jan 9 23:20:30 2012 (r229887) +++ stable/9/sys/cam/scsi/scsi_ses.c Tue Jan 10 00:01:17 2012 (r229888) @@ -714,7 +714,7 @@ ses_log(struct ses_softc *ssc, const cha /* * Is this a device that supports enclosure services? * - * It's a a pretty simple ruleset- if it is device type 0x0D (13), it's + * It's a pretty simple ruleset- if it is device type 0x0D (13), it's * an SES device. If it happens to be an old UNISYS SEN device, we can * handle that too. */ Modified: stable/9/sys/fs/devfs/devfs_rule.c ============================================================================== --- stable/9/sys/fs/devfs/devfs_rule.c Mon Jan 9 23:20:30 2012 (r229887) +++ stable/9/sys/fs/devfs/devfs_rule.c Tue Jan 10 00:01:17 2012 (r229888) @@ -617,7 +617,7 @@ devfs_rule_run(struct devfs_krule *dk, s * XXX: not work as this is called when devices are created * XXX: long time after the rules were instantiated. * XXX: a printf() would probably give too much noise, or - * XXX: DoS the machine. I guess a a rate-limited message + * XXX: DoS the machine. I guess a rate-limited message * XXX: might work. */ if (depth > 0) { Modified: stable/9/sys/netinet/sctp_structs.h ============================================================================== --- stable/9/sys/netinet/sctp_structs.h Mon Jan 9 23:20:30 2012 (r229887) +++ stable/9/sys/netinet/sctp_structs.h Tue Jan 10 00:01:17 2012 (r229888) @@ -416,7 +416,7 @@ TAILQ_HEAD(sctpchunk_listhead, sctp_tmit #define CHUNK_FLAGS_PR_SCTP_BUF SCTP_PR_SCTP_BUF #define CHUNK_FLAGS_PR_SCTP_RTX SCTP_PR_SCTP_RTX -/* The upper byte is used a a bit mask */ +/* The upper byte is used as a bit mask */ #define CHUNK_FLAGS_FRAGMENT_OK 0x0100 struct chk_id { Modified: stable/9/usr.sbin/mtree/mtree.5 ============================================================================== --- stable/9/usr.sbin/mtree/mtree.5 Mon Jan 9 23:20:30 2012 (r229887) +++ stable/9/usr.sbin/mtree/mtree.5 Tue Jan 10 00:01:17 2012 (r229888) @@ -48,7 +48,7 @@ Leading whitespace is always ignored. .Pp When encoding file or pathnames, any backslash character or character outside of the 95 printable ASCII characters must be -encoded as a a backslash followed by three +encoded as a backslash followed by three octal digits. When reading mtree files, any appearance of a backslash followed by three octal digits should be converted into the Modified: stable/9/usr.sbin/pmcstat/pmcstat.c ============================================================================== --- stable/9/usr.sbin/pmcstat/pmcstat.c Mon Jan 9 23:20:30 2012 (r229887) +++ stable/9/usr.sbin/pmcstat/pmcstat.c Tue Jan 10 00:01:17 2012 (r229888) @@ -1020,7 +1020,7 @@ main(int argc, char **argv) /* * Check if "-k kerneldir" was specified, and if whether - * 'kerneldir' actually refers to a a file. If so, use + * 'kerneldir' actually refers to a file. If so, use * `dirname path` to determine the kernel directory. */ if (args.pa_flags & FLAG_HAS_KERNELPATH) { From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 00:03:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4385C1065679; Tue, 10 Jan 2012 00:03:31 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2BCC18FC1D; Tue, 10 Jan 2012 00:03: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 q0A03Ve7067954; Tue, 10 Jan 2012 00:03:31 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A03U4m067946; Tue, 10 Jan 2012 00:03:30 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201100003.q0A03U4m067946@svn.freebsd.org> From: Eitan Adler Date: Tue, 10 Jan 2012 00:03:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229889 - in stable/8: sbin/ipfw sys/cam/scsi sys/fs/devfs sys/netinet usr.sbin/mtree usr.sbin/pmcstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 00:03:31 -0000 Author: eadler (ports committer) Date: Tue Jan 10 00:03:30 2012 New Revision: 229889 URL: http://svn.freebsd.org/changeset/base/229889 Log: MFC 227489: - fix duplicate "a a" in some comments Approved by: simon Modified: stable/8/sbin/ipfw/main.c stable/8/sys/cam/scsi/scsi_ch.h stable/8/sys/cam/scsi/scsi_ses.c stable/8/sys/fs/devfs/devfs_rule.c stable/8/sys/netinet/sctp_structs.h stable/8/usr.sbin/mtree/mtree.5 stable/8/usr.sbin/pmcstat/pmcstat.c Directory Properties: stable/8/sbin/ipfw/ (props changed) stable/8/sys/ (props changed) stable/8/usr.sbin/mtree/ (props changed) stable/8/usr.sbin/pmcstat/ (props changed) Modified: stable/8/sbin/ipfw/main.c ============================================================================== --- stable/8/sbin/ipfw/main.c Tue Jan 10 00:01:17 2012 (r229888) +++ stable/8/sbin/ipfw/main.c Tue Jan 10 00:03:30 2012 (r229889) @@ -87,7 +87,7 @@ help(void) * which includes the program name and a NULL entry at the end. * If we are called with a single string, we split it on whitespace. * Also, arguments with a trailing ',' are joined to the next one. - * The pointers (av[]) and data are in a a single chunk of memory. + * The pointers (av[]) and data are in a single chunk of memory. * av[0] points to the original program name, all other entries * point into the allocated chunk. */ Modified: stable/8/sys/cam/scsi/scsi_ch.h ============================================================================== --- stable/8/sys/cam/scsi/scsi_ch.h Tue Jan 10 00:01:17 2012 (r229888) +++ stable/8/sys/cam/scsi/scsi_ch.h Tue Jan 10 00:03:30 2012 (r229889) @@ -359,7 +359,7 @@ struct page_device_capabilities { * Some of these fields can be a little confusing, so an explanation * is in order. * - * Each component within a a medium changer apparatus is called an + * Each component within a medium changer apparatus is called an * "element". * * The "medium transport element address" is the address of the first Modified: stable/8/sys/cam/scsi/scsi_ses.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_ses.c Tue Jan 10 00:01:17 2012 (r229888) +++ stable/8/sys/cam/scsi/scsi_ses.c Tue Jan 10 00:03:30 2012 (r229889) @@ -714,7 +714,7 @@ ses_log(struct ses_softc *ssc, const cha /* * Is this a device that supports enclosure services? * - * It's a a pretty simple ruleset- if it is device type 0x0D (13), it's + * It's a pretty simple ruleset- if it is device type 0x0D (13), it's * an SES device. If it happens to be an old UNISYS SEN device, we can * handle that too. */ Modified: stable/8/sys/fs/devfs/devfs_rule.c ============================================================================== --- stable/8/sys/fs/devfs/devfs_rule.c Tue Jan 10 00:01:17 2012 (r229888) +++ stable/8/sys/fs/devfs/devfs_rule.c Tue Jan 10 00:03:30 2012 (r229889) @@ -617,7 +617,7 @@ devfs_rule_run(struct devfs_krule *dk, s * XXX: not work as this is called when devices are created * XXX: long time after the rules were instantiated. * XXX: a printf() would probably give too much noise, or - * XXX: DoS the machine. I guess a a rate-limited message + * XXX: DoS the machine. I guess a rate-limited message * XXX: might work. */ if (depth > 0) { Modified: stable/8/sys/netinet/sctp_structs.h ============================================================================== --- stable/8/sys/netinet/sctp_structs.h Tue Jan 10 00:01:17 2012 (r229888) +++ stable/8/sys/netinet/sctp_structs.h Tue Jan 10 00:03:30 2012 (r229889) @@ -350,7 +350,7 @@ TAILQ_HEAD(sctpchunk_listhead, sctp_tmit #define CHUNK_FLAGS_PR_SCTP_BUF SCTP_PR_SCTP_BUF #define CHUNK_FLAGS_PR_SCTP_RTX SCTP_PR_SCTP_RTX -/* The upper byte is used a a bit mask */ +/* The upper byte is used as a bit mask */ #define CHUNK_FLAGS_FRAGMENT_OK 0x0100 struct chk_id { Modified: stable/8/usr.sbin/mtree/mtree.5 ============================================================================== --- stable/8/usr.sbin/mtree/mtree.5 Tue Jan 10 00:01:17 2012 (r229888) +++ stable/8/usr.sbin/mtree/mtree.5 Tue Jan 10 00:03:30 2012 (r229889) @@ -48,7 +48,7 @@ Leading whitespace is always ignored. .Pp When encoding file or pathnames, any backslash character or character outside of the 95 printable ASCII characters must be -encoded as a a backslash followed by three +encoded as a backslash followed by three octal digits. When reading mtree files, any appearance of a backslash followed by three octal digits should be converted into the Modified: stable/8/usr.sbin/pmcstat/pmcstat.c ============================================================================== --- stable/8/usr.sbin/pmcstat/pmcstat.c Tue Jan 10 00:01:17 2012 (r229888) +++ stable/8/usr.sbin/pmcstat/pmcstat.c Tue Jan 10 00:03:30 2012 (r229889) @@ -1023,7 +1023,7 @@ main(int argc, char **argv) /* * Check if "-k kerneldir" was specified, and if whether - * 'kerneldir' actually refers to a a file. If so, use + * 'kerneldir' actually refers to a file. If so, use * `dirname path` to determine the kernel directory. */ if (args.pa_flags & FLAG_HAS_KERNELPATH) { From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 00:19:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BC4D1065675; Tue, 10 Jan 2012 00:19:18 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 724BE8FC08; Tue, 10 Jan 2012 00:19: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 q0A0JIMt069195; Tue, 10 Jan 2012 00:19:18 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A0JILb069193; Tue, 10 Jan 2012 00:19:18 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201100019.q0A0JILb069193@svn.freebsd.org> From: Eitan Adler Date: Tue, 10 Jan 2012 00:19:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229890 - stable/8/sys/dev/puc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 00:19:18 -0000 Author: eadler (ports committer) Date: Tue Jan 10 00:19:18 2012 New Revision: 229890 URL: http://svn.freebsd.org/changeset/base/229890 Log: MFC 226404: - add support for I-O DATA RSA-PCI2/R PR: kern/142999 Approved by: jhb Modified: stable/8/sys/dev/puc/pucdata.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/puc/pucdata.c ============================================================================== --- stable/8/sys/dev/puc/pucdata.c Tue Jan 10 00:03:30 2012 (r229889) +++ stable/8/sys/dev/puc/pucdata.c Tue Jan 10 00:19:18 2012 (r229890) @@ -645,6 +645,12 @@ const struct puc_cfg puc_pci_devices[] = * As sold by Kouwell . * I/O Flex PCI I/O Card Model-223 with 4 serial and 1 parallel ports. */ + { + 0x1415, 0x9501, 0x10fc ,0xc070, + "I-O DATA RSA-PCI2/R", + DEFAULT_RCLK * 8, + PUC_PORT_2S, 0x10, 0, 8, + }, { 0x1415, 0x9501, 0x131f, 0x2050, "SIIG Cyber 4 PCI 16550", From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 00:20:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4014C1065675; Tue, 10 Jan 2012 00:20:29 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A7AF8FC1A; Tue, 10 Jan 2012 00:20: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 q0A0KThX069323; Tue, 10 Jan 2012 00:20:29 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A0KTA8069321; Tue, 10 Jan 2012 00:20:29 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201100020.q0A0KTA8069321@svn.freebsd.org> From: Eitan Adler Date: Tue, 10 Jan 2012 00:20:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229891 - stable/7/sys/dev/puc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 00:20:29 -0000 Author: eadler (ports committer) Date: Tue Jan 10 00:20:28 2012 New Revision: 229891 URL: http://svn.freebsd.org/changeset/base/229891 Log: MFC 226404: - add support for I-O DATA RSA-PCI2/R PR: kern/142999 Approved by: jhb Modified: stable/7/sys/dev/puc/pucdata.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/dev/puc/pucdata.c ============================================================================== --- stable/7/sys/dev/puc/pucdata.c Tue Jan 10 00:19:18 2012 (r229890) +++ stable/7/sys/dev/puc/pucdata.c Tue Jan 10 00:20:28 2012 (r229891) @@ -601,6 +601,12 @@ const struct puc_cfg puc_pci_devices[] = * As sold by Kouwell . * I/O Flex PCI I/O Card Model-223 with 4 serial and 1 parallel ports. */ + { + 0x1415, 0x9501, 0x10fc ,0xc070, + "I-O DATA RSA-PCI2/R", + DEFAULT_RCLK * 8, + PUC_PORT_2S, 0x10, 0, 8, + }, { 0x1415, 0x9501, 0x131f, 0x2050, "SIIG Cyber 4 PCI 16550", From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 00:26:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2334A106564A; Tue, 10 Jan 2012 00:26:55 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D6278FC08; Tue, 10 Jan 2012 00:26: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 q0A0QsLo069863; Tue, 10 Jan 2012 00:26:54 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A0QsZq069861; Tue, 10 Jan 2012 00:26:54 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201100026.q0A0QsZq069861@svn.freebsd.org> From: Eitan Adler Date: Tue, 10 Jan 2012 00:26:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229892 - stable/9/sys/dev/sio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 00:26:55 -0000 Author: eadler (ports committer) Date: Tue Jan 10 00:26:54 2012 New Revision: 229892 URL: http://svn.freebsd.org/changeset/base/229892 Log: MFC r227532: - add support for Broadcom 802.11bg/EDGE/GPRS CardBus (Serial) - correct mislabeling of 0x432214e4 device PR: kern/119606 Approved by: jhb Modified: stable/9/sys/dev/sio/sio_pci.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/sio/sio_pci.c ============================================================================== --- stable/9/sys/dev/sio/sio_pci.c Tue Jan 10 00:20:28 2012 (r229891) +++ stable/9/sys/dev/sio/sio_pci.c Tue Jan 10 00:26:54 2012 (r229892) @@ -76,7 +76,8 @@ static struct pci_ids pci_ids[] = { { 0x7101135e, "SeaLevel Ultra 530.PCI Single Port Serial", 0x18 }, { 0x0000151f, "SmartLink 5634PCV SurfRider", 0x10 }, { 0x0103115d, "Xircom Cardbus modem", 0x10 }, - { 0x432214e4, "Broadcom 802.11g/GPRS CardBus (Serial)", 0x10 }, + { 0x432214e4, "Broadcom 802.11b/GPRS CardBus (Serial)", 0x10 }, + { 0x434414e4, "Broadcom 802.11bg/EDGE/GPRS CardBus (Serial)", 0x10 }, { 0x01c0135c, "Quatech SSCLP-200/300", 0x18 /* * NB: You must mount the "SPAD" jumper to correctly detect From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 00:27:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77302106566B; Tue, 10 Jan 2012 00:27:16 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 61B1E8FC13; Tue, 10 Jan 2012 00:27: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 q0A0RG8D069927; Tue, 10 Jan 2012 00:27:16 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A0RGGw069925; Tue, 10 Jan 2012 00:27:16 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201100027.q0A0RGGw069925@svn.freebsd.org> From: Eitan Adler Date: Tue, 10 Jan 2012 00:27:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229893 - stable/8/sys/dev/sio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 00:27:16 -0000 Author: eadler (ports committer) Date: Tue Jan 10 00:27:16 2012 New Revision: 229893 URL: http://svn.freebsd.org/changeset/base/229893 Log: MFC r227532: - add support for Broadcom 802.11bg/EDGE/GPRS CardBus (Serial) - correct mislabeling of 0x432214e4 device PR: kern/119606 Approved by: jhb Modified: stable/8/sys/dev/sio/sio_pci.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/sio/sio_pci.c ============================================================================== --- stable/8/sys/dev/sio/sio_pci.c Tue Jan 10 00:26:54 2012 (r229892) +++ stable/8/sys/dev/sio/sio_pci.c Tue Jan 10 00:27:16 2012 (r229893) @@ -76,7 +76,8 @@ static struct pci_ids pci_ids[] = { { 0x7101135e, "SeaLevel Ultra 530.PCI Single Port Serial", 0x18 }, { 0x0000151f, "SmartLink 5634PCV SurfRider", 0x10 }, { 0x0103115d, "Xircom Cardbus modem", 0x10 }, - { 0x432214e4, "Broadcom 802.11g/GPRS CardBus (Serial)", 0x10 }, + { 0x432214e4, "Broadcom 802.11b/GPRS CardBus (Serial)", 0x10 }, + { 0x434414e4, "Broadcom 802.11bg/EDGE/GPRS CardBus (Serial)", 0x10 }, { 0x01c0135c, "Quatech SSCLP-200/300", 0x18 /* * NB: You must mount the "SPAD" jumper to correctly detect From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 00:27:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E518D106567C; Tue, 10 Jan 2012 00:27:37 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CFD8A8FC19; Tue, 10 Jan 2012 00:27: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 q0A0RbFW069987; Tue, 10 Jan 2012 00:27:37 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A0RbeN069985; Tue, 10 Jan 2012 00:27:37 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201100027.q0A0RbeN069985@svn.freebsd.org> From: Eitan Adler Date: Tue, 10 Jan 2012 00:27:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229894 - stable/7/sys/dev/sio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 00:27:38 -0000 Author: eadler (ports committer) Date: Tue Jan 10 00:27:37 2012 New Revision: 229894 URL: http://svn.freebsd.org/changeset/base/229894 Log: MFC r227532: - add support for Broadcom 802.11bg/EDGE/GPRS CardBus (Serial) - correct mislabeling of 0x432214e4 device PR: kern/119606 Approved by: jhb Modified: stable/7/sys/dev/sio/sio_pci.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/dev/sio/sio_pci.c ============================================================================== --- stable/7/sys/dev/sio/sio_pci.c Tue Jan 10 00:27:16 2012 (r229893) +++ stable/7/sys/dev/sio/sio_pci.c Tue Jan 10 00:27:37 2012 (r229894) @@ -77,7 +77,8 @@ static struct pci_ids pci_ids[] = { { 0x7101135e, "SeaLevel Ultra 530.PCI Single Port Serial", 0x18 }, { 0x0000151f, "SmartLink 5634PCV SurfRider", 0x10 }, { 0x0103115d, "Xircom Cardbus modem", 0x10 }, - { 0x432214e4, "Broadcom 802.11g/GPRS CardBus (Serial)", 0x10 }, + { 0x432214e4, "Broadcom 802.11b/GPRS CardBus (Serial)", 0x10 }, + { 0x434414e4, "Broadcom 802.11bg/EDGE/GPRS CardBus (Serial)", 0x10 }, { 0x01c0135c, "Quatech SSCLP-200/300", 0x18 /* * NB: You must mount the "SPAD" jumper to correctly detect From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 00:34:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09CC91065676; Tue, 10 Jan 2012 00:34:41 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E7BF58FC12; Tue, 10 Jan 2012 00:34: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 q0A0YeUB070584; Tue, 10 Jan 2012 00:34:40 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A0YeYQ070582; Tue, 10 Jan 2012 00:34:40 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201100034.q0A0YeYQ070582@svn.freebsd.org> From: Eitan Adler Date: Tue, 10 Jan 2012 00:34:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229895 - stable/9/sys/dev/puc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 00:34:41 -0000 Author: eadler (ports committer) Date: Tue Jan 10 00:34:40 2012 New Revision: 229895 URL: http://svn.freebsd.org/changeset/base/229895 Log: MFC r227535: - add support for Titan VScom PCIex-800H PR: kern/124128 Approved by: jhb Modified: stable/9/sys/dev/puc/pucdata.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/puc/pucdata.c ============================================================================== --- stable/9/sys/dev/puc/pucdata.c Tue Jan 10 00:27:37 2012 (r229894) +++ stable/9/sys/dev/puc/pucdata.c Tue Jan 10 00:34:40 2012 (r229895) @@ -864,6 +864,18 @@ const struct puc_cfg puc_pci_devices[] = PUC_PORT_2S, 0x10, 4, 0, }, + { 0x14d2, 0xa007, 0xffff, 0, + "Titan VScom PCIex-800H", + DEFAULT_RCLK * 8, + PUC_PORT_4S, 0x10, 0, 8, + }, + + { 0x14d2, 0xa008, 0xffff, 0, + "Titan VScom PCIex-800H", + DEFAULT_RCLK * 8, + PUC_PORT_4S, 0x10, 0, 8, + }, + { 0x14db, 0x2130, 0xffff, 0, "Avlab Technology, PCI IO 2S", DEFAULT_RCLK, From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 00:35:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A60E1065701; Tue, 10 Jan 2012 00:35:02 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2456C8FC08; Tue, 10 Jan 2012 00:35:02 +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 q0A0Z20V070642; Tue, 10 Jan 2012 00:35:02 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A0Z2F6070640; Tue, 10 Jan 2012 00:35:02 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201100035.q0A0Z2F6070640@svn.freebsd.org> From: Eitan Adler Date: Tue, 10 Jan 2012 00:35:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229896 - stable/8/sys/dev/puc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 00:35:02 -0000 Author: eadler (ports committer) Date: Tue Jan 10 00:35:01 2012 New Revision: 229896 URL: http://svn.freebsd.org/changeset/base/229896 Log: MFC r227535: - add support for Titan VScom PCIex-800H PR: kern/124128 Approved by: jhb Modified: stable/8/sys/dev/puc/pucdata.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/puc/pucdata.c ============================================================================== --- stable/8/sys/dev/puc/pucdata.c Tue Jan 10 00:34:40 2012 (r229895) +++ stable/8/sys/dev/puc/pucdata.c Tue Jan 10 00:35:01 2012 (r229896) @@ -850,6 +850,18 @@ const struct puc_cfg puc_pci_devices[] = PUC_PORT_2S, 0x10, 4, 0, }, + { 0x14d2, 0xa007, 0xffff, 0, + "Titan VScom PCIex-800H", + DEFAULT_RCLK * 8, + PUC_PORT_4S, 0x10, 0, 8, + }, + + { 0x14d2, 0xa008, 0xffff, 0, + "Titan VScom PCIex-800H", + DEFAULT_RCLK * 8, + PUC_PORT_4S, 0x10, 0, 8, + }, + { 0x14db, 0x2130, 0xffff, 0, "Avlab Technology, PCI IO 2S", DEFAULT_RCLK, From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 00:35:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A34881065675; Tue, 10 Jan 2012 00:35:25 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E6FC8FC20; Tue, 10 Jan 2012 00:35: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 q0A0ZPxT070699; Tue, 10 Jan 2012 00:35:25 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A0ZPmd070697; Tue, 10 Jan 2012 00:35:25 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201100035.q0A0ZPmd070697@svn.freebsd.org> From: Eitan Adler Date: Tue, 10 Jan 2012 00:35:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229897 - stable/7/sys/dev/puc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 00:35:25 -0000 Author: eadler (ports committer) Date: Tue Jan 10 00:35:25 2012 New Revision: 229897 URL: http://svn.freebsd.org/changeset/base/229897 Log: MFC r227535: - add support for Titan VScom PCIex-800H PR: kern/124128 Approved by: jhb Modified: stable/7/sys/dev/puc/pucdata.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/dev/puc/pucdata.c ============================================================================== --- stable/7/sys/dev/puc/pucdata.c Tue Jan 10 00:35:01 2012 (r229896) +++ stable/7/sys/dev/puc/pucdata.c Tue Jan 10 00:35:25 2012 (r229897) @@ -724,6 +724,18 @@ const struct puc_cfg puc_pci_devices[] = PUC_PORT_2S, 0x10, 4, 0, }, + { 0x14d2, 0xa007, 0xffff, 0, + "Titan VScom PCIex-800H", + DEFAULT_RCLK * 8, + PUC_PORT_4S, 0x10, 0, 8, + }, + + { 0x14d2, 0xa008, 0xffff, 0, + "Titan VScom PCIex-800H", + DEFAULT_RCLK * 8, + PUC_PORT_4S, 0x10, 0, 8, + }, + { 0x14db, 0x2130, 0xffff, 0, "Avlab Technology, PCI IO 2S", DEFAULT_RCLK, From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 00:48:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54BA31065677; Tue, 10 Jan 2012 00:48:30 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2563D8FC13; Tue, 10 Jan 2012 00:48: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 q0A0mUEV071591; Tue, 10 Jan 2012 00:48:30 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A0mUmu071589; Tue, 10 Jan 2012 00:48:30 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201201100048.q0A0mUmu071589@svn.freebsd.org> From: Lawrence Stewart Date: Tue, 10 Jan 2012 00:48: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: r229898 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 00:48:30 -0000 Author: lstewart Date: Tue Jan 10 00:48:29 2012 New Revision: 229898 URL: http://svn.freebsd.org/changeset/base/229898 Log: Consumers of bpfdetach() expect it to remove all bpf_if structs from the bpf_iflist list which reference the specified ifnet. The existing implementation only removes the first matching bpf_if found in the list, effectively leaking list entries if an ifnet has been bpfattach()ed multiple times with different DLTs. Fix the leak by performing the detach logic in a loop, stopping when all bpf_if structs referencing the specified ifnet have been detached and removed from the bpf_iflist list. Whilst here, also: - Remove the unnecessary "bp->bif_ifp == NULL" check, as a bpf_if should never exist in the list with a NULL ifnet pointer. - Except when INVARIANTS is in the kernel config, silently ignore the case where no bpf_if referencing the specified ifnet is found, as it is harmless and does not require user attention. Reviewed by: csjp MFC after: 1 week Modified: head/sys/net/bpf.c Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Tue Jan 10 00:35:25 2012 (r229897) +++ head/sys/net/bpf.c Tue Jan 10 00:48:29 2012 (r229898) @@ -2253,33 +2253,42 @@ bpfdetach(struct ifnet *ifp) { struct bpf_if *bp; struct bpf_d *d; +#ifdef INVARIANTS + int ndetached; - /* Locate BPF interface information */ - mtx_lock(&bpf_mtx); - LIST_FOREACH(bp, &bpf_iflist, bif_next) { - if (ifp == bp->bif_ifp) - break; - } + ndetached = 0; +#endif - /* Interface wasn't attached */ - if ((bp == NULL) || (bp->bif_ifp == NULL)) { + /* Find all bpf_if struct's which reference ifp and detach them. */ + do { + mtx_lock(&bpf_mtx); + LIST_FOREACH(bp, &bpf_iflist, bif_next) { + if (ifp == bp->bif_ifp) + break; + } + if (bp != NULL) + LIST_REMOVE(bp, bif_next); mtx_unlock(&bpf_mtx); - printf("bpfdetach: %s was not attached\n", ifp->if_xname); - return; - } - - LIST_REMOVE(bp, bif_next); - mtx_unlock(&bpf_mtx); - while ((d = LIST_FIRST(&bp->bif_dlist)) != NULL) { - bpf_detachd(d); - BPFD_LOCK(d); - bpf_wakeup(d); - BPFD_UNLOCK(d); - } + if (bp != NULL) { +#ifdef INVARIANTS + ndetached++; +#endif + while ((d = LIST_FIRST(&bp->bif_dlist)) != NULL) { + bpf_detachd(d); + BPFD_LOCK(d); + bpf_wakeup(d); + BPFD_UNLOCK(d); + } + mtx_destroy(&bp->bif_mtx); + free(bp, M_BPF); + } + } while (bp != NULL); - mtx_destroy(&bp->bif_mtx); - free(bp, M_BPF); +#ifdef INVARIANTS + if (ndetached == 0) + printf("bpfdetach: %s was not attached\n", ifp->if_xname); +#endif } /* From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 01:01:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FE6F1065675; Tue, 10 Jan 2012 01:01:58 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 015AE8FC13; Tue, 10 Jan 2012 01:01: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 q0A11vGr072665; Tue, 10 Jan 2012 01:01:57 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A11vTl072661; Tue, 10 Jan 2012 01:01:57 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201100101.q0A11vTl072661@svn.freebsd.org> From: Eitan Adler Date: Tue, 10 Jan 2012 01:01:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229899 - in stable/9/usr.sbin: fwcontrol newsyslog ypserv X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 01:01:58 -0000 Author: eadler (ports committer) Date: Tue Jan 10 01:01:57 2012 New Revision: 229899 URL: http://svn.freebsd.org/changeset/base/229899 Log: - Remove extraneous null ptr deref checks - Fix memory leak Approved by: jhb Modified: stable/9/usr.sbin/fwcontrol/fwcontrol.c stable/9/usr.sbin/newsyslog/newsyslog.c stable/9/usr.sbin/ypserv/yp_main.c Directory Properties: stable/9/usr.sbin/fwcontrol/ (props changed) stable/9/usr.sbin/newsyslog/ (props changed) stable/9/usr.sbin/ypserv/ (props changed) Modified: stable/9/usr.sbin/fwcontrol/fwcontrol.c ============================================================================== --- stable/9/usr.sbin/fwcontrol/fwcontrol.c Tue Jan 10 00:48:29 2012 (r229898) +++ stable/9/usr.sbin/fwcontrol/fwcontrol.c Tue Jan 10 01:01:57 2012 (r229899) @@ -152,8 +152,7 @@ str2node(int fd, const char *nodestr) fweui2eui64(&data->dev[i].eui, &tmpeui); if (memcmp(&eui, &tmpeui, sizeof(struct eui64)) == 0) { node = data->dev[i].dst; - if (data != NULL) - free(data); + free(data); goto gotnode; } } Modified: stable/9/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/9/usr.sbin/newsyslog/newsyslog.c Tue Jan 10 00:48:29 2012 (r229898) +++ stable/9/usr.sbin/newsyslog/newsyslog.c Tue Jan 10 01:01:57 2012 (r229899) @@ -1946,9 +1946,10 @@ do_zipwork(struct zipwork_entry *zwork) char zresult[MAXPATHLEN]; int c; + assert(zwork != NULL); pgm_path = NULL; strlcpy(zresult, zwork->zw_fname, sizeof(zresult)); - if (zwork != NULL && zwork->zw_conf != NULL && + if (zwork->zw_conf != NULL && zwork->zw_conf->compress > COMPRESS_NONE) for (c = 1; c < COMPRESS_TYPES; c++) { if (zwork->zw_conf->compress == c) { Modified: stable/9/usr.sbin/ypserv/yp_main.c ============================================================================== --- stable/9/usr.sbin/ypserv/yp_main.c Tue Jan 10 00:48:29 2012 (r229898) +++ stable/9/usr.sbin/ypserv/yp_main.c Tue Jan 10 01:01:57 2012 (r229899) @@ -255,6 +255,7 @@ create_service(const int sock, const str const struct __rpc_sockinfo *si) { int error; + char *sname; SVCXPRT *transp; struct addrinfo hints, *res, *res0; @@ -262,6 +263,7 @@ create_service(const int sock, const str struct bindaddrlistent *blep; struct netbuf svcaddr; + sname = NULL; SLIST_INIT(&sle_head); memset(&hints, 0, sizeof(hints)); memset(&svcaddr, 0, sizeof(svcaddr)); @@ -341,7 +343,6 @@ create_service(const int sock, const str if (strncmp("0", servname, 1) == 0) { struct sockaddr *sap; socklen_t slen; - char *sname; sname = malloc(NI_MAXSERV); if (sname == NULL) { @@ -361,6 +362,7 @@ create_service(const int sock, const str strerror(errno)); freeaddrinfo(res0); close(s); + free(sname); return -1; } error = getnameinfo(sap, slen, @@ -372,6 +374,7 @@ create_service(const int sock, const str strerror(errno)); freeaddrinfo(res0); close(s); + free(sname); return -1; } servname = sname; @@ -440,7 +443,7 @@ create_service(const int sock, const str } /* XXX: ignore error intentionally */ rpcb_set(YPPROG, YPVERS, nconf, &svcaddr); - + free(sname); freeaddrinfo(res0); return 0; } From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 01:02:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAB2A106566B; Tue, 10 Jan 2012 01:02:19 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C47E48FC08; Tue, 10 Jan 2012 01:02:19 +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 q0A12JNj072730; Tue, 10 Jan 2012 01:02:19 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A12JML072727; Tue, 10 Jan 2012 01:02:19 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201100102.q0A12JML072727@svn.freebsd.org> From: Eitan Adler Date: Tue, 10 Jan 2012 01:02:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229900 - in stable/8/usr.sbin: fwcontrol newsyslog X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 01:02:20 -0000 Author: eadler (ports committer) Date: Tue Jan 10 01:02:19 2012 New Revision: 229900 URL: http://svn.freebsd.org/changeset/base/229900 Log: - Remove extraneous null ptr deref checks - Fix memory leak Approved by: jhb Modified: stable/8/usr.sbin/fwcontrol/fwcontrol.c stable/8/usr.sbin/newsyslog/newsyslog.c Directory Properties: stable/8/usr.sbin/fwcontrol/ (props changed) stable/8/usr.sbin/newsyslog/ (props changed) Modified: stable/8/usr.sbin/fwcontrol/fwcontrol.c ============================================================================== --- stable/8/usr.sbin/fwcontrol/fwcontrol.c Tue Jan 10 01:01:57 2012 (r229899) +++ stable/8/usr.sbin/fwcontrol/fwcontrol.c Tue Jan 10 01:02:19 2012 (r229900) @@ -152,8 +152,7 @@ str2node(int fd, const char *nodestr) fweui2eui64(&data->dev[i].eui, &tmpeui); if (memcmp(&eui, &tmpeui, sizeof(struct eui64)) == 0) { node = data->dev[i].dst; - if (data != NULL) - free(data); + free(data); goto gotnode; } } Modified: stable/8/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/8/usr.sbin/newsyslog/newsyslog.c Tue Jan 10 01:01:57 2012 (r229899) +++ stable/8/usr.sbin/newsyslog/newsyslog.c Tue Jan 10 01:02:19 2012 (r229900) @@ -1914,9 +1914,10 @@ do_zipwork(struct zipwork_entry *zwork) pid_t pidzip, wpid; char zresult[MAXPATHLEN]; + assert(zwork != NULL); pgm_path = NULL; strlcpy(zresult, zwork->zw_fname, sizeof(zresult)); - if (zwork != NULL && zwork->zw_conf != NULL && + if (zwork->zw_conf != NULL && zwork->zw_conf->compress > COMPRESS_NONE) for (int c = 1; c < COMPRESS_TYPES; c++) { if (zwork->zw_conf->compress == c) { From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 01:02:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 213261065782; Tue, 10 Jan 2012 01:02:41 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0BDC68FC21; Tue, 10 Jan 2012 01:02: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 q0A12eBV072791; Tue, 10 Jan 2012 01:02:40 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A12eXp072788; Tue, 10 Jan 2012 01:02:40 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201100102.q0A12eXp072788@svn.freebsd.org> From: Eitan Adler Date: Tue, 10 Jan 2012 01:02:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229901 - stable/7/usr.sbin/fwcontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 01:02:41 -0000 Author: eadler (ports committer) Date: Tue Jan 10 01:02:40 2012 New Revision: 229901 URL: http://svn.freebsd.org/changeset/base/229901 Log: - Remove extraneous null ptr deref checks - Fix memory leak Approved by: jhb Modified: stable/7/usr.sbin/fwcontrol/fwcontrol.c Directory Properties: stable/7/usr.sbin/fwcontrol/ (props changed) Modified: stable/7/usr.sbin/fwcontrol/fwcontrol.c ============================================================================== --- stable/7/usr.sbin/fwcontrol/fwcontrol.c Tue Jan 10 01:02:19 2012 (r229900) +++ stable/7/usr.sbin/fwcontrol/fwcontrol.c Tue Jan 10 01:02:40 2012 (r229901) @@ -152,8 +152,7 @@ str2node(int fd, const char *nodestr) fweui2eui64(&data->dev[i].eui, &tmpeui); if (memcmp(&eui, &tmpeui, sizeof(struct eui64)) == 0) { node = data->dev[i].dst; - if (data != NULL) - free(data); + free(data); goto gotnode; } } From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 02:04:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11EE4106566B; Tue, 10 Jan 2012 02:04:14 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.mail.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id 7F2B28FC08; Tue, 10 Jan 2012 02:04:13 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap4EACGVC0+DaFvO/2dsb2JhbABDhQ+oTYFyAQEFI1YMDw4GBgINGQJZBogVpF6RfIEvgk6GfoEWBIg5jE+SVw X-IronPort-AV: E=Sophos;i="4.71,484,1320642000"; d="scan'208";a="151360295" Received: from erie.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.206]) by esa-annu-pri.mail.uoguelph.ca with ESMTP; 09 Jan 2012 20:34:46 -0500 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id 1C05FB3EB1; Mon, 9 Jan 2012 20:34:46 -0500 (EST) Date: Mon, 9 Jan 2012 20:34:46 -0500 (EST) From: Rick Macklem To: John Baldwin Message-ID: <2015325900.1122521.1326159286096.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <201201091846.q09Ik3eo053098@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.91.201] X-Mailer: Zimbra 6.0.10_GA_2692 (ZimbraWebClient - FF3.0 (Win)/6.0.10_GA_2692) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r229861 - stable/8/sys/fs/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 02:04:14 -0000 Thanks John. Sorry about that. Pointy hat goes on me. rick ps: I probably shouldn't have merged in into stable/8, but since you've fixed it, it might as well stay there. ----- Original Message ----- > Author: jhb > Date: Mon Jan 9 18:46:03 2012 > New Revision: 229861 > URL: http://svn.freebsd.org/changeset/base/229861 > > Log: > The sysctls for the new NFS server on stable/8 live under vfs.newnfs > rather than vfs.nfsd. > > Modified: > stable/8/sys/fs/nfsserver/nfs_nfsdsubs.c > > Modified: stable/8/sys/fs/nfsserver/nfs_nfsdsubs.c > ============================================================================== > --- stable/8/sys/fs/nfsserver/nfs_nfsdsubs.c Mon Jan 9 18:33:54 2012 > (r229860) > +++ stable/8/sys/fs/nfsserver/nfs_nfsdsubs.c Mon Jan 9 18:46:03 2012 > (r229861) > @@ -56,10 +56,10 @@ static nfstype newnfsv2_type[9] = { NFNO > extern nfstype nfsv34_type[9]; > #endif /* !APPLEKEXT */ > > -SYSCTL_DECL(_vfs_nfsd); > +SYSCTL_DECL(_vfs_newnfs); > > static int disable_checkutf8 = 0; > -SYSCTL_INT(_vfs_nfsd, OID_AUTO, disable_checkutf8, CTLFLAG_RW, > +SYSCTL_INT(_vfs_newnfs, OID_AUTO, disable_checkutf8, CTLFLAG_RW, > &disable_checkutf8, 0, > "Disable the NFSv4 check for a UTF8 compliant name"); From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 02:16:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C5D2106564A; Tue, 10 Jan 2012 02:16:38 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7BB9F8FC12; Tue, 10 Jan 2012 02:16: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 q0A2GcsX077014; Tue, 10 Jan 2012 02:16:38 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A2GcAJ077011; Tue, 10 Jan 2012 02:16:38 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201201100216.q0A2GcAJ077011@svn.freebsd.org> From: Rick Macklem Date: Tue, 10 Jan 2012 02:16:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229902 - in stable/9/sys: fs/nfs nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 02:16:38 -0000 Author: rmacklem Date: Tue Jan 10 02:16:38 2012 New Revision: 229902 URL: http://svn.freebsd.org/changeset/base/229902 Log: MFC: r228757 jwd@ reported a problem via email where the old NFS client would get a reply of EEXIST from an NFS server when a Mkdir RPC was retried, for an NFS over UDP mount. Upon investigation, it was found that the client was retransmitting the Mkdir RPC request over UDP, but with a different xid. As such, the retransmitted message would miss the Duplicate Request Cache in the server, causing it to reply EEXIST. The kernel client side UDP rpc code has two timers. The first one causes a retransmit using the same xid and socket and was set to a fixed value of 3seconds. (The default can be overridden via CLSET_RETRY_TIMEOUT.) The second one creates a new socket and xid and should be larger than the first. However, both NFS clients were setting the second timer to nm_timeo ("timeout=" mount argument), which defaulted to 1second, so the first timer would never time out. This patch fixes both NFS clients so that they set the first timer using nm_timeo and makes the second timer larger than the first one. Modified: stable/9/sys/fs/nfs/nfs_commonkrpc.c stable/9/sys/nfsclient/nfs_krpc.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- stable/9/sys/fs/nfs/nfs_commonkrpc.c Tue Jan 10 01:02:40 2012 (r229901) +++ stable/9/sys/fs/nfs/nfs_commonkrpc.c Tue Jan 10 02:16:38 2012 (r229902) @@ -168,6 +168,7 @@ newnfs_connect(struct nfsmount *nmp, str struct socket *so; int one = 1, retries, error = 0; struct thread *td = curthread; + struct timeval timo; /* * We need to establish the socket using the credentials of @@ -264,9 +265,18 @@ newnfs_connect(struct nfsmount *nmp, str CLNT_CONTROL(client, CLSET_INTERRUPTIBLE, &one); if ((nmp->nm_flag & NFSMNT_RESVPORT)) CLNT_CONTROL(client, CLSET_PRIVPORT, &one); - if (NFSHASSOFT(nmp)) - retries = nmp->nm_retry; - else + if (NFSHASSOFT(nmp)) { + if (nmp->nm_sotype == SOCK_DGRAM) + /* + * For UDP, the large timeout for a reconnect + * will be set to "nm_retry * nm_timeo / 2", so + * we only want to do 2 reconnect timeout + * retries. + */ + retries = 2; + else + retries = nmp->nm_retry; + } else retries = INT_MAX; } else { /* @@ -284,6 +294,27 @@ newnfs_connect(struct nfsmount *nmp, str } CLNT_CONTROL(client, CLSET_RETRIES, &retries); + if (nmp != NULL) { + /* + * For UDP, there are 2 timeouts: + * - CLSET_RETRY_TIMEOUT sets the initial timeout for the timer + * that does a retransmit of an RPC request using the same + * socket and xid. This is what you normally want to do, + * since NFS servers depend on "same xid" for their + * Duplicate Request Cache. + * - timeout specified in CLNT_CALL_MBUF(), which specifies when + * retransmits on the same socket should fail and a fresh + * socket created. Each of these timeouts counts as one + * CLSET_RETRIES as set above. + * Set the initial retransmit timeout for UDP. This timeout + * doesn't exist for TCP and the following call just fails, + * which is ok. + */ + timo.tv_sec = nmp->nm_timeo / NFS_HZ; + timo.tv_usec = (nmp->nm_timeo % NFS_HZ) * 1000000 / NFS_HZ; + CLNT_CONTROL(client, CLSET_RETRY_TIMEOUT, &timo); + } + mtx_lock(&nrp->nr_mtx); if (nrp->nr_client != NULL) { /* @@ -442,7 +473,7 @@ newnfs_request(struct nfsrv_descript *nd { u_int32_t *tl; time_t waituntil; - int i, j, set_uid = 0, set_sigset = 0; + int i, j, set_uid = 0, set_sigset = 0, timeo; int trycnt, error = 0, usegssname = 0, secflavour = AUTH_SYS; u_int16_t procnum; u_int trylater_delay = 1; @@ -628,6 +659,12 @@ newnfs_request(struct nfsrv_descript *nd } trycnt = 0; tryagain: + /* + * This timeout specifies when a new socket should be created, + * along with new xid values. For UDP, this should be done + * infrequently, since retransmits of RPC requests should normally + * use the same xid. + */ if (nmp == NULL) { timo.tv_usec = 0; if (clp == NULL) @@ -642,8 +679,22 @@ tryagain: else timo.tv_sec = NFS_TCPTIMEO; } else { - timo.tv_sec = nmp->nm_timeo / NFS_HZ; - timo.tv_usec = (nmp->nm_timeo * 1000000) / NFS_HZ; + if (NFSHASSOFT(nmp)) { + /* + * CLSET_RETRIES is set to 2, so this should be + * half of the total timeout required. + */ + timeo = nmp->nm_retry * nmp->nm_timeo / 2; + if (timeo < 1) + timeo = 1; + timo.tv_sec = timeo / NFS_HZ; + timo.tv_usec = (timeo % NFS_HZ) * 1000000 / + NFS_HZ; + } else { + /* For UDP hard mounts, use a large value. */ + timo.tv_sec = NFS_MAXTIMEO / NFS_HZ; + timo.tv_usec = 0; + } } if (rep != NULL) { Modified: stable/9/sys/nfsclient/nfs_krpc.c ============================================================================== --- stable/9/sys/nfsclient/nfs_krpc.c Tue Jan 10 01:02:40 2012 (r229901) +++ stable/9/sys/nfsclient/nfs_krpc.c Tue Jan 10 02:16:38 2012 (r229902) @@ -191,6 +191,7 @@ nfs_connect(struct nfsmount *nmp) struct netconfig *nconf; rpcvers_t vers; int one = 1, retries; + struct timeval timo; /* * We need to establish the socket using the credentials of @@ -258,12 +259,37 @@ nfs_connect(struct nfsmount *nmp) CLNT_CONTROL(client, CLSET_INTERRUPTIBLE, &one); if (nmp->nm_flag & NFSMNT_RESVPORT) CLNT_CONTROL(client, CLSET_PRIVPORT, &one); - if (nmp->nm_flag & NFSMNT_SOFT) - retries = nmp->nm_retry; - else + if ((nmp->nm_flag & NFSMNT_SOFT) != 0) { + if (nmp->nm_sotype == SOCK_DGRAM) + /* + * For UDP, the large timeout for a reconnect will + * be set to "nm_retry * nm_timeo / 2", so we only + * want to do 2 reconnect timeout retries. + */ + retries = 2; + else + retries = nmp->nm_retry; + } else retries = INT_MAX; CLNT_CONTROL(client, CLSET_RETRIES, &retries); + /* + * For UDP, there are 2 timeouts: + * - CLSET_RETRY_TIMEOUT sets the initial timeout for the timer + * that does a retransmit of an RPC request using the same socket + * and xid. This is what you normally want to do, since NFS + * servers depend on "same xid" for their Duplicate Request Cache. + * - timeout specified in CLNT_CALL_MBUF(), which specifies when + * retransmits on the same socket should fail and a fresh socket + * created. Each of these timeouts counts as one CLSET_RETRIES, + * as set above. + * Set the initial retransmit timeout for UDP. This timeout doesn't + * exist for TCP and the following call just fails, which is ok. + */ + timo.tv_sec = nmp->nm_timeo / NFS_HZ; + timo.tv_usec = (nmp->nm_timeo % NFS_HZ) * 1000000 / NFS_HZ; + CLNT_CONTROL(client, CLSET_RETRY_TIMEOUT, &timo); + mtx_lock(&nmp->nm_mtx); if (nmp->nm_client) { /* @@ -411,7 +437,7 @@ nfs_request(struct vnode *vp, struct mbu struct mbuf *md; time_t waituntil; caddr_t dpos; - int error = 0; + int error = 0, timeo; struct timeval now; AUTH *auth = NULL; enum nfs_rto_timer_t timer; @@ -486,8 +512,32 @@ nfs_request(struct vnode *vp, struct mbu nfsstats.rpcrequests++; tryagain: - timo.tv_sec = nmp->nm_timeo / NFS_HZ; - timo.tv_usec = (nmp->nm_timeo * 1000000) / NFS_HZ; + /* + * This timeout specifies when a new socket should be created, + * along with new xid values. For UDP, this should be done + * infrequently, since retransmits of RPC requests should normally + * use the same xid. + */ + if (nmp->nm_sotype == SOCK_DGRAM) { + if ((nmp->nm_flag & NFSMNT_SOFT) != 0) { + /* + * CLSET_RETRIES is set to 2, so this should be half + * of the total timeout required. + */ + timeo = nmp->nm_retry * nmp->nm_timeo / 2; + if (timeo < 1) + timeo = 1; + timo.tv_sec = timeo / NFS_HZ; + timo.tv_usec = (timeo % NFS_HZ) * 1000000 / NFS_HZ; + } else { + /* For UDP hard mounts, use a large value. */ + timo.tv_sec = NFS_MAXTIMEO / NFS_HZ; + timo.tv_usec = 0; + } + } else { + timo.tv_sec = nmp->nm_timeo / NFS_HZ; + timo.tv_usec = (nmp->nm_timeo % NFS_HZ) * 1000000 / NFS_HZ; + } mrep = NULL; stat = CLNT_CALL_MBUF(nmp->nm_client, &ext, (nmp->nm_flag & NFSMNT_NFSV3) ? procnum : nfsv2_procid[procnum], From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 02:55:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2E47106566B; Tue, 10 Jan 2012 02:55:35 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A62A8FC18; Tue, 10 Jan 2012 02:55: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 q0A2tZRJ079422; Tue, 10 Jan 2012 02:55:35 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A2tZRY079419; Tue, 10 Jan 2012 02:55:35 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201100255.q0A2tZRY079419@svn.freebsd.org> From: Eitan Adler Date: Tue, 10 Jan 2012 02:55: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: r229904 - head/libexec/tftpd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 02:55:35 -0000 Author: eadler (ports committer) Date: Tue Jan 10 02:55:35 2012 New Revision: 229904 URL: http://svn.freebsd.org/changeset/base/229904 Log: Fix warning when compiling with gcc46: error: variable 'bp' set but not use Approved by: dim MFC After: 3 days Modified: head/libexec/tftpd/tftp-io.c Modified: head/libexec/tftpd/tftp-io.c ============================================================================== --- head/libexec/tftpd/tftp-io.c Tue Jan 10 02:21:48 2012 (r229903) +++ head/libexec/tftpd/tftp-io.c Tue Jan 10 02:55:35 2012 (r229904) @@ -323,7 +323,6 @@ send_ack(int fp, uint16_t block) { struct tftphdr *tp; int size; - char *bp; char buf[MAXPKTSIZE]; if (debug&DEBUG_PACKETS) @@ -332,7 +331,6 @@ send_ack(int fp, uint16_t block) DROPPACKETn("send_ack", 0); tp = (struct tftphdr *)buf; - bp = buf + 2; size = sizeof(buf) - 2; tp->th_opcode = htons((u_short)ACK); tp->th_block = htons((u_short)block); From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 02:55:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 783A3106567F; Tue, 10 Jan 2012 02:55:43 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 635E58FC0A; Tue, 10 Jan 2012 02: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 q0A2thSn079483; Tue, 10 Jan 2012 02:55:43 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A2thmp079480; Tue, 10 Jan 2012 02:55:43 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201100255.q0A2thmp079480@svn.freebsd.org> From: Eitan Adler Date: Tue, 10 Jan 2012 02: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: r229905 - head/usr.bin/split X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 02:55:43 -0000 Author: eadler (ports committer) Date: Tue Jan 10 02:55:43 2012 New Revision: 229905 URL: http://svn.freebsd.org/changeset/base/229905 Log: Fix warning when compiling with gcc46: error: variable 'defname' set but not use Approved by: dim MFC after: 3 day Modified: head/usr.bin/split/split.c Modified: head/usr.bin/split/split.c ============================================================================== --- head/usr.bin/split/split.c Tue Jan 10 02:55:35 2012 (r229904) +++ head/usr.bin/split/split.c Tue Jan 10 02:55:43 2012 (r229905) @@ -347,17 +347,14 @@ newfile(void) { long i, maxfiles, tfnum; static long fnum; - static int defname; static char *fpnt; if (ofd == -1) { if (fname[0] == '\0') { fname[0] = 'x'; fpnt = fname + 1; - defname = 1; } else { fpnt = fname + strlen(fname); - defname = 0; } ofd = fileno(stdout); } From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 02:55:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2640010657C9; Tue, 10 Jan 2012 02:55:44 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F1D28FC1C; Tue, 10 Jan 2012 02:55: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 q0A2thbR079505; Tue, 10 Jan 2012 02:55:43 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A2thfD079502; Tue, 10 Jan 2012 02:55:43 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201201100255.q0A2thfD079502@svn.freebsd.org> From: Rick Macklem Date: Tue, 10 Jan 2012 02:55:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229906 - in stable/8/sys: fs/nfs nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 02:55:44 -0000 Author: rmacklem Date: Tue Jan 10 02:55:43 2012 New Revision: 229906 URL: http://svn.freebsd.org/changeset/base/229906 Log: MFC: r228757 jwd@ reported a problem via email where the old NFS client would get a reply of EEXIST from an NFS server when a Mkdir RPC was retried, for an NFS over UDP mount. Upon investigation, it was found that the client was retransmitting the Mkdir RPC request over UDP, but with a different xid. As such, the retransmitted message would miss the Duplicate Request Cache in the server, causing it to reply EEXIST. The kernel client side UDP rpc code has two timers. The first one causes a retransmit using the same xid and socket and was set to a fixed value of 3seconds. (The default can be overridden via CLSET_RETRY_TIMEOUT.) The second one creates a new socket and xid and should be larger than the first. However, both NFS clients were setting the second timer to nm_timeo ("timeout=" mount argument), which defaulted to 1second, so the first timer would never time out. This patch fixes both NFS clients so that they set the first timer using nm_timeo and makes the second timer larger than the first one. Modified: stable/8/sys/fs/nfs/nfs_commonkrpc.c stable/8/sys/nfsclient/nfs_krpc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- stable/8/sys/fs/nfs/nfs_commonkrpc.c Tue Jan 10 02:55:43 2012 (r229905) +++ stable/8/sys/fs/nfs/nfs_commonkrpc.c Tue Jan 10 02:55:43 2012 (r229906) @@ -145,6 +145,7 @@ newnfs_connect(struct nfsmount *nmp, str struct socket *so; int one = 1, retries, error = 0; struct thread *td = curthread; + struct timeval timo; /* * We need to establish the socket using the credentials of @@ -241,9 +242,18 @@ newnfs_connect(struct nfsmount *nmp, str CLNT_CONTROL(client, CLSET_INTERRUPTIBLE, &one); if ((nmp->nm_flag & NFSMNT_RESVPORT)) CLNT_CONTROL(client, CLSET_PRIVPORT, &one); - if (NFSHASSOFT(nmp)) - retries = nmp->nm_retry; - else + if (NFSHASSOFT(nmp)) { + if (nmp->nm_sotype == SOCK_DGRAM) + /* + * For UDP, the large timeout for a reconnect + * will be set to "nm_retry * nm_timeo / 2", so + * we only want to do 2 reconnect timeout + * retries. + */ + retries = 2; + else + retries = nmp->nm_retry; + } else retries = INT_MAX; } else { /* @@ -261,6 +271,27 @@ newnfs_connect(struct nfsmount *nmp, str } CLNT_CONTROL(client, CLSET_RETRIES, &retries); + if (nmp != NULL) { + /* + * For UDP, there are 2 timeouts: + * - CLSET_RETRY_TIMEOUT sets the initial timeout for the timer + * that does a retransmit of an RPC request using the same + * socket and xid. This is what you normally want to do, + * since NFS servers depend on "same xid" for their + * Duplicate Request Cache. + * - timeout specified in CLNT_CALL_MBUF(), which specifies when + * retransmits on the same socket should fail and a fresh + * socket created. Each of these timeouts counts as one + * CLSET_RETRIES as set above. + * Set the initial retransmit timeout for UDP. This timeout + * doesn't exist for TCP and the following call just fails, + * which is ok. + */ + timo.tv_sec = nmp->nm_timeo / NFS_HZ; + timo.tv_usec = (nmp->nm_timeo % NFS_HZ) * 1000000 / NFS_HZ; + CLNT_CONTROL(client, CLSET_RETRY_TIMEOUT, &timo); + } + mtx_lock(&nrp->nr_mtx); if (nrp->nr_client != NULL) { /* @@ -419,7 +450,7 @@ newnfs_request(struct nfsrv_descript *nd { u_int32_t *tl; time_t waituntil; - int i, j, set_uid = 0, set_sigset = 0; + int i, j, set_uid = 0, set_sigset = 0, timeo; int trycnt, error = 0, usegssname = 0, secflavour = AUTH_SYS; u_int16_t procnum; u_int trylater_delay = 1; @@ -582,6 +613,12 @@ newnfs_request(struct nfsrv_descript *nd } trycnt = 0; tryagain: + /* + * This timeout specifies when a new socket should be created, + * along with new xid values. For UDP, this should be done + * infrequently, since retransmits of RPC requests should normally + * use the same xid. + */ if (nmp == NULL) { timo.tv_usec = 0; if (clp == NULL) @@ -596,8 +633,22 @@ tryagain: else timo.tv_sec = NFS_TCPTIMEO; } else { - timo.tv_sec = nmp->nm_timeo / NFS_HZ; - timo.tv_usec = (nmp->nm_timeo * 1000000) / NFS_HZ; + if (NFSHASSOFT(nmp)) { + /* + * CLSET_RETRIES is set to 2, so this should be + * half of the total timeout required. + */ + timeo = nmp->nm_retry * nmp->nm_timeo / 2; + if (timeo < 1) + timeo = 1; + timo.tv_sec = timeo / NFS_HZ; + timo.tv_usec = (timeo % NFS_HZ) * 1000000 / + NFS_HZ; + } else { + /* For UDP hard mounts, use a large value. */ + timo.tv_sec = NFS_MAXTIMEO / NFS_HZ; + timo.tv_usec = 0; + } } if (rep != NULL) { Modified: stable/8/sys/nfsclient/nfs_krpc.c ============================================================================== --- stable/8/sys/nfsclient/nfs_krpc.c Tue Jan 10 02:55:43 2012 (r229905) +++ stable/8/sys/nfsclient/nfs_krpc.c Tue Jan 10 02:55:43 2012 (r229906) @@ -191,6 +191,7 @@ nfs_connect(struct nfsmount *nmp) struct netconfig *nconf; rpcvers_t vers; int one = 1, retries; + struct timeval timo; /* * We need to establish the socket using the credentials of @@ -258,12 +259,37 @@ nfs_connect(struct nfsmount *nmp) CLNT_CONTROL(client, CLSET_INTERRUPTIBLE, &one); if (nmp->nm_flag & NFSMNT_RESVPORT) CLNT_CONTROL(client, CLSET_PRIVPORT, &one); - if (nmp->nm_flag & NFSMNT_SOFT) - retries = nmp->nm_retry; - else + if ((nmp->nm_flag & NFSMNT_SOFT) != 0) { + if (nmp->nm_sotype == SOCK_DGRAM) + /* + * For UDP, the large timeout for a reconnect will + * be set to "nm_retry * nm_timeo / 2", so we only + * want to do 2 reconnect timeout retries. + */ + retries = 2; + else + retries = nmp->nm_retry; + } else retries = INT_MAX; CLNT_CONTROL(client, CLSET_RETRIES, &retries); + /* + * For UDP, there are 2 timeouts: + * - CLSET_RETRY_TIMEOUT sets the initial timeout for the timer + * that does a retransmit of an RPC request using the same socket + * and xid. This is what you normally want to do, since NFS + * servers depend on "same xid" for their Duplicate Request Cache. + * - timeout specified in CLNT_CALL_MBUF(), which specifies when + * retransmits on the same socket should fail and a fresh socket + * created. Each of these timeouts counts as one CLSET_RETRIES, + * as set above. + * Set the initial retransmit timeout for UDP. This timeout doesn't + * exist for TCP and the following call just fails, which is ok. + */ + timo.tv_sec = nmp->nm_timeo / NFS_HZ; + timo.tv_usec = (nmp->nm_timeo % NFS_HZ) * 1000000 / NFS_HZ; + CLNT_CONTROL(client, CLSET_RETRY_TIMEOUT, &timo); + mtx_lock(&nmp->nm_mtx); if (nmp->nm_client) { /* @@ -411,7 +437,7 @@ nfs_request(struct vnode *vp, struct mbu struct mbuf *md; time_t waituntil; caddr_t dpos; - int error = 0; + int error = 0, timeo; struct timeval now; AUTH *auth = NULL; enum nfs_rto_timer_t timer; @@ -486,8 +512,32 @@ nfs_request(struct vnode *vp, struct mbu nfsstats.rpcrequests++; tryagain: - timo.tv_sec = nmp->nm_timeo / NFS_HZ; - timo.tv_usec = (nmp->nm_timeo * 1000000) / NFS_HZ; + /* + * This timeout specifies when a new socket should be created, + * along with new xid values. For UDP, this should be done + * infrequently, since retransmits of RPC requests should normally + * use the same xid. + */ + if (nmp->nm_sotype == SOCK_DGRAM) { + if ((nmp->nm_flag & NFSMNT_SOFT) != 0) { + /* + * CLSET_RETRIES is set to 2, so this should be half + * of the total timeout required. + */ + timeo = nmp->nm_retry * nmp->nm_timeo / 2; + if (timeo < 1) + timeo = 1; + timo.tv_sec = timeo / NFS_HZ; + timo.tv_usec = (timeo % NFS_HZ) * 1000000 / NFS_HZ; + } else { + /* For UDP hard mounts, use a large value. */ + timo.tv_sec = NFS_MAXTIMEO / NFS_HZ; + timo.tv_usec = 0; + } + } else { + timo.tv_sec = nmp->nm_timeo / NFS_HZ; + timo.tv_usec = (nmp->nm_timeo % NFS_HZ) * 1000000 / NFS_HZ; + } mrep = NULL; stat = CLNT_CALL_MBUF(nmp->nm_client, &ext, (nmp->nm_flag & NFSMNT_NFSV3) ? procnum : nfsv2_procid[procnum], From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 02:58:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 484621065673; Tue, 10 Jan 2012 02:58:21 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3336E8FC1F; Tue, 10 Jan 2012 02:58: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 q0A2wLH9079703; Tue, 10 Jan 2012 02:58:21 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A2wLkH079701; Tue, 10 Jan 2012 02:58:21 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201100258.q0A2wLkH079701@svn.freebsd.org> From: Eitan Adler Date: Tue, 10 Jan 2012 02:58: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: r229907 - head/usr.bin/ncplist X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 02:58:21 -0000 Author: eadler (ports committer) Date: Tue Jan 10 02:58:20 2012 New Revision: 229907 URL: http://svn.freebsd.org/changeset/base/229907 Log: Fix warning when compiling with gcc46: error: variable 'wdone' set but not use Approved by: dim MFC after: 3 days Modified: head/usr.bin/ncplist/ncplist.c Modified: head/usr.bin/ncplist/ncplist.c ============================================================================== --- head/usr.bin/ncplist/ncplist.c Tue Jan 10 02:55:43 2012 (r229906) +++ head/usr.bin/ncplist/ncplist.c Tue Jan 10 02:58:20 2012 (r229907) @@ -375,7 +375,7 @@ enum listop { int main(int argc, char *argv[]) { - int opt, wdone = 0, nargs = 0, i; + int opt, nargs = 0, i; enum listop what; char *args[MAX_ARGS]; @@ -438,23 +438,18 @@ main(int argc, char *argv[]) switch(what) { case LO_SERVERS: show_serverlist(args[0]); - wdone = 1; break; case LO_USERS: show_userlist(args[0]); - wdone = 1; break; case LO_QUEUES: show_queuelist(args[0], args[1]); - wdone = 1; break; case LO_VOLUMES: list_volumes(args[0]); - wdone = 1; break; case LO_BINDERY: list_bindery(args[0], args[1], args[2]); - wdone = 1; break; default: help(); From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 02:58:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64F6B1065672; Tue, 10 Jan 2012 02:58:29 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 502DD8FC1D; Tue, 10 Jan 2012 02:58: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 q0A2wTWt079755; Tue, 10 Jan 2012 02:58:29 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A2wT7E079753; Tue, 10 Jan 2012 02:58:29 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201100258.q0A2wT7E079753@svn.freebsd.org> From: Eitan Adler Date: Tue, 10 Jan 2012 02:58: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: r229908 - head/usr.bin/brandelf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 02:58:29 -0000 Author: eadler (ports committer) Date: Tue Jan 10 02:58:29 2012 New Revision: 229908 URL: http://svn.freebsd.org/changeset/base/229908 Log: Fix warning when compiling with gcc46: error: variable 'verbose' set but not use Approved by: dim MFC after: 3 days Modified: head/usr.bin/brandelf/brandelf.c Modified: head/usr.bin/brandelf/brandelf.c ============================================================================== --- head/usr.bin/brandelf/brandelf.c Tue Jan 10 02:58:20 2012 (r229907) +++ head/usr.bin/brandelf/brandelf.c Tue Jan 10 02:58:29 2012 (r229908) @@ -64,7 +64,7 @@ main(int argc, char **argv) const char *strtype = "FreeBSD"; int type = ELFOSABI_FREEBSD; int retval = 0; - int ch, change = 0, verbose = 0, force = 0, listed = 0; + int ch, change = 0, force = 0, listed = 0; while ((ch = getopt(argc, argv, "f:lt:v")) != -1) switch (ch) { @@ -84,7 +84,7 @@ main(int argc, char **argv) listed = 1; break; case 'v': - verbose = 1; + /* does nothing */ break; case 't': if (force) From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 02:58:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A203E106585C; Tue, 10 Jan 2012 02:58:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D1958FC15; Tue, 10 Jan 2012 02:58: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 q0A2waEd079799; Tue, 10 Jan 2012 02:58:36 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A2waaY079797; Tue, 10 Jan 2012 02:58:36 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201100258.q0A2waaY079797@svn.freebsd.org> From: Eitan Adler Date: Tue, 10 Jan 2012 02:58: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: r229909 - head/usr.bin/netstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 02:58:36 -0000 Author: eadler (ports committer) Date: Tue Jan 10 02:58:36 2012 New Revision: 229909 URL: http://svn.freebsd.org/changeset/base/229909 Log: Fix warning when compiling with gcc46: error: variable 'ifnetfound' set but not used Approved by: dim MFC after: 3 days Modified: head/usr.bin/netstat/if.c Modified: head/usr.bin/netstat/if.c ============================================================================== --- head/usr.bin/netstat/if.c Tue Jan 10 02:58:29 2012 (r229908) +++ head/usr.bin/netstat/if.c Tue Jan 10 02:58:36 2012 (r229909) @@ -188,7 +188,6 @@ intpr(int interval1, u_long ifnetaddr, v } ifaddr; u_long ifaddraddr; u_long ifaddrfound; - u_long ifnetfound; u_long opackets; u_long ipackets; u_long obytes; @@ -249,7 +248,6 @@ intpr(int interval1, u_long ifnetaddr, v link_layer = 0; if (ifaddraddr == 0) { - ifnetfound = ifnetaddr; if (kread(ifnetaddr, (char *)&ifnet, sizeof ifnet) != 0) return; strlcpy(name, ifnet.if_xname, sizeof(name)); From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 02:58:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C72871065670; Tue, 10 Jan 2012 02:58:44 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B22368FC13; Tue, 10 Jan 2012 02:58: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 q0A2wi7g079845; Tue, 10 Jan 2012 02:58:44 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A2wiNu079843; Tue, 10 Jan 2012 02:58:44 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201100258.q0A2wiNu079843@svn.freebsd.org> From: Eitan Adler Date: Tue, 10 Jan 2012 02:58: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: r229910 - head/usr.bin/bsdiff/bsdiff X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 02:58:44 -0000 Author: eadler (ports committer) Date: Tue Jan 10 02:58:44 2012 New Revision: 229910 URL: http://svn.freebsd.org/changeset/base/229910 Log: Silence bogus warning when compiling with gcc46: error: 'pos' may be used uninitialized in this function Reviewed by: cperciva Approved by: dim MFC after: 3 days Modified: head/usr.bin/bsdiff/bsdiff/bsdiff.c Modified: head/usr.bin/bsdiff/bsdiff/bsdiff.c ============================================================================== --- head/usr.bin/bsdiff/bsdiff/bsdiff.c Tue Jan 10 02:58:36 2012 (r229909) +++ head/usr.bin/bsdiff/bsdiff/bsdiff.c Tue Jan 10 02:58:44 2012 (r229910) @@ -272,7 +272,7 @@ int main(int argc,char *argv[]) /* Compute the differences, writing ctrl as we go */ if ((pfbz2 = BZ2_bzWriteOpen(&bz2err, pf, 9, 0, 0)) == NULL) errx(1, "BZ2_bzWriteOpen, bz2err = %d", bz2err); - scan=0;len=0; + scan=0;len=0;pos=0; lastscan=0;lastpos=0;lastoffset=0; while(scan Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 535BE106567F; Tue, 10 Jan 2012 02:58:53 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E9708FC13; Tue, 10 Jan 2012 02:58:53 +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 q0A2wrNb079890; Tue, 10 Jan 2012 02:58:53 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A2wrDQ079888; Tue, 10 Jan 2012 02:58:53 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201100258.q0A2wrDQ079888@svn.freebsd.org> From: Eitan Adler Date: Tue, 10 Jan 2012 02:58:53 +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: r229911 - head/sbin/tunefs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 02:58:53 -0000 Author: eadler (ports committer) Date: Tue Jan 10 02:58:52 2012 New Revision: 229911 URL: http://svn.freebsd.org/changeset/base/229911 Log: Fix warning when compiling with gcc46: error: variable 'Sflag' set but not used Approved by: dim MFC after: 3 days Modified: head/sbin/tunefs/tunefs.c Modified: head/sbin/tunefs/tunefs.c ============================================================================== --- head/sbin/tunefs/tunefs.c Tue Jan 10 02:58:44 2012 (r229910) +++ head/sbin/tunefs/tunefs.c Tue Jan 10 02:58:52 2012 (r229911) @@ -90,7 +90,7 @@ main(int argc, char *argv[]) int Aflag, aflag, eflag, evalue, fflag, fvalue, jflag, Jflag, Lflag; int lflag, mflag, mvalue, Nflag, nflag, oflag, ovalue, pflag, sflag; int tflag; - int svalue, Sflag, Svalue; + int svalue, Svalue; int ch, found_arg, i; const char *chg[2]; struct ufs_args args; @@ -269,7 +269,6 @@ main(int argc, char *argv[]) if (Svalue < SUJ_MIN) errx(10, "%s must be >= %d (was %s)", name, SUJ_MIN, optarg); - Sflag = 1; break; case 't': From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 02:59:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CF051065A43; Tue, 10 Jan 2012 02:59:02 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 18D1D8FC18; Tue, 10 Jan 2012 02:59:02 +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 q0A2x12t079941; Tue, 10 Jan 2012 02:59:01 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A2x1Q9079938; Tue, 10 Jan 2012 02:59:01 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201100259.q0A2x1Q9079938@svn.freebsd.org> From: Eitan Adler Date: Tue, 10 Jan 2012 02:59:01 +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: r229912 - head/sbin/ping6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 02:59:02 -0000 Author: eadler (ports committer) Date: Tue Jan 10 02:59:01 2012 New Revision: 229912 URL: http://svn.freebsd.org/changeset/base/229912 Log: Fix warning when compiling with gcc46: error: variable 'origextlen' set but not used Approved by: dim MFC after: 3 days Modified: head/sbin/ping6/ping6.c Modified: head/sbin/ping6/ping6.c ============================================================================== --- head/sbin/ping6/ping6.c Tue Jan 10 02:58:52 2012 (r229911) +++ head/sbin/ping6/ping6.c Tue Jan 10 02:59:01 2012 (r229912) @@ -1812,7 +1812,7 @@ pr_ip6opt(void *extbuf, size_t bufsize) struct ip6_hbh *ext; int currentlen; u_int8_t type; - socklen_t extlen, len, origextlen; + socklen_t extlen, len; void *databuf; size_t offset; u_int16_t value2; @@ -1828,7 +1828,6 @@ pr_ip6opt(void *extbuf, size_t bufsize) * subtract the size of a cmsg structure from the buffer size. */ if (bufsize < (extlen + CMSG_SPACE(0))) { - origextlen = extlen; extlen = bufsize - CMSG_SPACE(0); warnx("options truncated, showing only %u (total=%u)", (unsigned int)(extlen / 8 - 1), From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 02:59:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3C4010656D7; Tue, 10 Jan 2012 02:59:09 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C014B8FC25; Tue, 10 Jan 2012 02:59: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 q0A2x9DF079985; Tue, 10 Jan 2012 02:59:09 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A2x9nq079983; Tue, 10 Jan 2012 02:59:09 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201100259.q0A2x9nq079983@svn.freebsd.org> From: Eitan Adler Date: Tue, 10 Jan 2012 02:59:09 +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: r229913 - head/sbin/newfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 02:59:09 -0000 Author: eadler (ports committer) Date: Tue Jan 10 02:59:09 2012 New Revision: 229913 URL: http://svn.freebsd.org/changeset/base/229913 Log: Fix warning when compiling with gcc46: error: variable 'c' set but not used Approved by: dim MFC after: 3 days Modified: head/sbin/newfs/mkfs.c Modified: head/sbin/newfs/mkfs.c ============================================================================== --- head/sbin/newfs/mkfs.c Tue Jan 10 02:59:01 2012 (r229912) +++ head/sbin/newfs/mkfs.c Tue Jan 10 02:59:09 2012 (r229913) @@ -989,9 +989,7 @@ void iput(union dinode *ip, ino_t ino) { ufs2_daddr_t d; - int c; - c = ino_to_cg(&sblock, ino); bread(&disk, part_ofs + fsbtodb(&sblock, cgtod(&sblock, 0)), (char *)&acg, sblock.fs_cgsize); if (acg.cg_magic != CG_MAGIC) { From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 02:59:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6621010656D7; Tue, 10 Jan 2012 02:59:18 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50E458FC12; Tue, 10 Jan 2012 02:59: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 q0A2xImA080031; Tue, 10 Jan 2012 02:59:18 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A2xI8Q080029; Tue, 10 Jan 2012 02:59:18 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201100259.q0A2xI8Q080029@svn.freebsd.org> From: Eitan Adler Date: Tue, 10 Jan 2012 02:59: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: r229914 - head/sbin/ifconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 02:59:18 -0000 Author: eadler (ports committer) Date: Tue Jan 10 02:59:18 2012 New Revision: 229914 URL: http://svn.freebsd.org/changeset/base/229914 Log: Fix warning when compiling with gcc46: error: variable 'firstkey' set but not used Approved by: dim MFC after: 3 days Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Tue Jan 10 02:59:09 2012 (r229913) +++ head/sbin/ifconfig/ifieee80211.c Tue Jan 10 02:59:18 2012 (r229914) @@ -4383,7 +4383,6 @@ ieee80211_status(int s) if (get80211val(s, IEEE80211_IOC_WEP, &wepmode) != -1 && wepmode != IEEE80211_WEP_NOSUP) { - int firstkey; switch (wepmode) { case IEEE80211_WEP_OFF: @@ -4419,7 +4418,6 @@ ieee80211_status(int s) goto end; } - firstkey = 1; for (i = 0; i < num; i++) { struct ieee80211req_key ik; @@ -4433,7 +4431,6 @@ ieee80211_status(int s) if (verbose) LINE_BREAK(); printkey(&ik); - firstkey = 0; } } end: From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 02:59:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96DCC1065965; Tue, 10 Jan 2012 02:59:26 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 81E998FC0C; Tue, 10 Jan 2012 02:59:26 +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 q0A2xQFQ080075; Tue, 10 Jan 2012 02:59:26 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A2xQwg080073; Tue, 10 Jan 2012 02:59:26 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201100259.q0A2xQwg080073@svn.freebsd.org> From: Eitan Adler Date: Tue, 10 Jan 2012 02:59:26 +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: r229915 - head/sbin/gvinum X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 02:59:26 -0000 Author: eadler (ports committer) Date: Tue Jan 10 02:59:26 2012 New Revision: 229915 URL: http://svn.freebsd.org/changeset/base/229915 Log: Fix warning when compiling with gcc46: error: variable 'op' set but not used error: variable 'cmd' set but not used Approved by: dim MFC after: 3 days Modified: head/sbin/gvinum/gvinum.c Modified: head/sbin/gvinum/gvinum.c ============================================================================== --- head/sbin/gvinum/gvinum.c Tue Jan 10 02:59:18 2012 (r229914) +++ head/sbin/gvinum/gvinum.c Tue Jan 10 02:59:26 2012 (r229915) @@ -937,14 +937,12 @@ gvinum_parityop(int argc, char **argv, i struct gctl_req *req; int flags, i; const char *errstr; - char *op, *msg; + char *op; if (rebuild) { op = "rebuildparity"; - msg = "Rebuilding"; } else { op = "checkparity"; - msg = "Checking"; } optreset = 1; @@ -1057,9 +1055,8 @@ gvinum_rm(int argc, char **argv) struct gctl_req *req; int flags, i, j; const char *errstr; - char buf[20], *cmd; + char buf[20]; - cmd = argv[0]; flags = 0; optreset = 1; optind = 1; From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 02:59:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF25E1065CC1; Tue, 10 Jan 2012 02:59:35 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9AC1D8FC13; Tue, 10 Jan 2012 02:59: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 q0A2xZuF080123; Tue, 10 Jan 2012 02:59:35 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A2xZju080121; Tue, 10 Jan 2012 02:59:35 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201100259.q0A2xZju080121@svn.freebsd.org> From: Eitan Adler Date: Tue, 10 Jan 2012 02:59: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: r229916 - head/sbin/geom/class/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 02:59:35 -0000 Author: eadler (ports committer) Date: Tue Jan 10 02:59:35 2012 New Revision: 229916 URL: http://svn.freebsd.org/changeset/base/229916 Log: Fix warning when compiling with gcc46: error: variable 'secsz' set but not used Reviewed by: ae Approved by: dim MFC after: 3 days Modified: head/sbin/geom/class/part/geom_part.c Modified: head/sbin/geom/class/part/geom_part.c ============================================================================== --- head/sbin/geom/class/part/geom_part.c Tue Jan 10 02:59:26 2012 (r229915) +++ head/sbin/geom/class/part/geom_part.c Tue Jan 10 02:59:35 2012 (r229916) @@ -718,7 +718,7 @@ gpart_backup(struct gctl_req *req, unsig struct ggeom *gp; const char *s, *scheme; off_t sector, end; - off_t length, secsz; + off_t length; int error, i, windex, wblocks, wtype; if (gctl_get_int(req, "nargs") != 1) @@ -744,7 +744,6 @@ gpart_backup(struct gctl_req *req, unsig if (scheme == NULL) abort(); pp = LIST_FIRST(&gp->lg_consumer)->lg_provider; - secsz = pp->lg_sectorsize; s = find_geomcfg(gp, "last"); wblocks = strlen(s); wtype = 0; From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 02:59:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17CA410656AD; Tue, 10 Jan 2012 02:59:44 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 03B508FC1E; Tue, 10 Jan 2012 02:59: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 q0A2xhSJ080172; Tue, 10 Jan 2012 02:59:43 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A2xhpE080170; Tue, 10 Jan 2012 02:59:43 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201100259.q0A2xhpE080170@svn.freebsd.org> From: Eitan Adler Date: Tue, 10 Jan 2012 02:59: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: r229917 - head/sbin/fsirand X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 02:59:44 -0000 Author: eadler (ports committer) Date: Tue Jan 10 02:59:43 2012 New Revision: 229917 URL: http://svn.freebsd.org/changeset/base/229917 Log: Fix warning when compiling with gcc46: error: variable 'inumber' set but not used Approved by: dim MFC after: 3 days Modified: head/sbin/fsirand/fsirand.c Modified: head/sbin/fsirand/fsirand.c ============================================================================== --- head/sbin/fsirand/fsirand.c Tue Jan 10 02:59:35 2012 (r229916) +++ head/sbin/fsirand/fsirand.c Tue Jan 10 02:59:43 2012 (r229917) @@ -115,7 +115,7 @@ fsirand(char *device) caddr_t inodebuf; ssize_t ibufsize; struct fs *sblock; - ino_t inumber, maxino; + ino_t inumber; ufs2_daddr_t sblockloc, dblk; char sbuf[SBLOCKSIZE], sbuftmp[SBLOCKSIZE]; int i, devfd, n, cg; @@ -165,7 +165,6 @@ fsirand(char *device) fprintf(stderr, "Cannot find file system superblock\n"); return (1); } - maxino = sblock->fs_ncg * sblock->fs_ipg; if (sblock->fs_magic == FS_UFS1_MAGIC && sblock->fs_old_inodefmt < FS_44INODEFMT) { From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 02:59:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15C681065DCE; Tue, 10 Jan 2012 02:59:51 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 018818FC15; Tue, 10 Jan 2012 02:59: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 q0A2xof0080217; Tue, 10 Jan 2012 02:59:50 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A2xoF4080215; Tue, 10 Jan 2012 02:59:50 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201100259.q0A2xoF4080215@svn.freebsd.org> From: Eitan Adler Date: Tue, 10 Jan 2012 02:59: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: r229918 - head/sbin/fsck_ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 02:59:51 -0000 Author: eadler (ports committer) Date: Tue Jan 10 02:59:50 2012 New Revision: 229918 URL: http://svn.freebsd.org/changeset/base/229918 Log: Fix warning when compiling with gcc46: error: variable 'blksfree' set but not used Reviewed by: pjd Approved by: dim MFC after: 3 days Modified: head/sbin/fsck_ffs/gjournal.c Modified: head/sbin/fsck_ffs/gjournal.c ============================================================================== --- head/sbin/fsck_ffs/gjournal.c Tue Jan 10 02:59:43 2012 (r229917) +++ head/sbin/fsck_ffs/gjournal.c Tue Jan 10 02:59:50 2012 (r229918) @@ -399,7 +399,7 @@ gjournal_check(const char *filesys) void *p; struct cgchain *cgc; struct cg *cgp; - uint8_t *inosused, *blksfree; + uint8_t *inosused; ino_t cino, ino; int cg, mode; @@ -438,7 +438,6 @@ gjournal_check(const char *filesys) /* We don't want it to be freed in the meantime. */ busycg(cgc); inosused = cg_inosused(cgp); - blksfree = cg_blksfree(cgp); /* * Now go through the list of all inodes in this cylinder group * to find unreferenced ones. From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 02:59:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C4771065EE8; Tue, 10 Jan 2012 02:59:59 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D4788FC17; Tue, 10 Jan 2012 02:59: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 q0A2xxLW080265; Tue, 10 Jan 2012 02:59:59 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A2xxat080261; Tue, 10 Jan 2012 02:59:59 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201100259.q0A2xxat080261@svn.freebsd.org> From: Eitan Adler Date: Tue, 10 Jan 2012 02:59: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: r229919 - head/sbin/camcontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 02:59:59 -0000 Author: eadler (ports committer) Date: Tue Jan 10 02:59:58 2012 New Revision: 229919 URL: http://svn.freebsd.org/changeset/base/229919 Log: Fix warning when compiling with gcc46: error: variable 'freq' set but not used error: variable 'mode_pars' set but not used Reviewed by: mav Approved by: dim MFC after: 3 days Modified: head/sbin/camcontrol/camcontrol.c head/sbin/camcontrol/modeedit.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Tue Jan 10 02:59:50 2012 (r229918) +++ head/sbin/camcontrol/camcontrol.c Tue Jan 10 02:59:58 2012 (r229919) @@ -3412,7 +3412,6 @@ ratecontrol(struct cam_device *device, i } if (spi && syncrate != -1) { int prelim_sync_period; - u_int freq; if ((cpi.hba_inquiry & PI_SDTR_ABLE) == 0) { warnx("HBA is not capable of changing " @@ -3437,7 +3436,6 @@ ratecontrol(struct cam_device *device, i prelim_sync_period = 10000000 / syncrate; spi->sync_period = scsi_calc_syncparam(prelim_sync_period); - freq = scsi_calc_syncsrate(spi->sync_period); didsettings++; } if (sata && syncrate != -1) { @@ -4030,13 +4028,12 @@ retry: RPL_LUNDATA_LUN_LUN_MASK); break; case RPL_LUNDATA_ATYP_EXTLUN: { - int field_len, field_len_code, eam_code; + int field_len_code, eam_code; eam_code = lundata->luns[i].lundata[j] & RPL_LUNDATA_EXT_EAM_MASK; field_len_code = (lundata->luns[i].lundata[j] & RPL_LUNDATA_EXT_LEN_MASK) >> 4; - field_len = field_len_code * 2; if ((eam_code == RPL_LUNDATA_EXT_EAM_WK) && (field_len_code == 0x00)) { Modified: head/sbin/camcontrol/modeedit.c ============================================================================== --- head/sbin/camcontrol/modeedit.c Tue Jan 10 02:59:50 2012 (r229918) +++ head/sbin/camcontrol/modeedit.c Tue Jan 10 02:59:58 2012 (r229919) @@ -869,7 +869,6 @@ mode_list(struct cam_device *device, int int retry_count, int timeout) { u_int8_t data[MAX_COMMAND_SIZE];/* Buffer to hold sense data. */ - u_int8_t *mode_pars; /* Pointer to modepage params. */ struct scsi_mode_header_6 *mh; /* Location of mode header. */ struct scsi_mode_page_header *mph; struct pagename *nameentry; @@ -895,7 +894,6 @@ mode_list(struct cam_device *device, int /* Locate the next mode page header. */ mph = (struct scsi_mode_page_header *) ((intptr_t)mh + sizeof(*mh) + len); - mode_pars = MODE_PAGE_DATA(mph); mph->page_code &= SMS_PAGE_CODE; nameentry = nameentry_lookup(mph->page_code); From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 04:33:43 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B050106564A; Tue, 10 Jan 2012 04:33:43 +0000 (UTC) (envelope-from jmg@h2.funkthat.com) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) by mx1.freebsd.org (Postfix) with ESMTP id 426FB8FC12; Tue, 10 Jan 2012 04:33:43 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id q0A42J8F020270 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 9 Jan 2012 20:02:19 -0800 (PST) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id q0A42Jbo020269; Mon, 9 Jan 2012 20:02:19 -0800 (PST) (envelope-from jmg) Date: Mon, 9 Jan 2012 20:02:19 -0800 From: John-Mark Gurney To: "Pedro F. Giffuni" Message-ID: <20120110040219.GE52468@funkthat.com> References: <201201031947.q03JlXnx039684@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201201031947.q03JlXnx039684@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Mon, 09 Jan 2012 20:02:19 -0800 (PST) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r229415 - head/lib/libvgl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 04:33:43 -0000 Pedro F. Giffuni wrote this message on Tue, Jan 03, 2012 at 19:47 +0000: > +#define SL_SWAP(a,b) {a^=b; b^=a; a^=b;} Can we replace this w/ a normal swap function? Last time I did benchmarking on this ~10 years ago, it was slower to use xor instead of using assignments... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 04:46:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D595F106566B for ; Tue, 10 Jan 2012 04:46:34 +0000 (UTC) (envelope-from pfg@freebsd.org) Received: from nm10-vm0.bullet.mail.sp2.yahoo.com (nm10-vm0.bullet.mail.sp2.yahoo.com [98.139.91.198]) by mx1.freebsd.org (Postfix) with SMTP id A6C708FC19 for ; Tue, 10 Jan 2012 04:46:34 +0000 (UTC) Received: from [98.139.91.64] by nm10.bullet.mail.sp2.yahoo.com with NNFMP; 10 Jan 2012 04:46:34 -0000 Received: from [98.139.91.57] by tm4.bullet.mail.sp2.yahoo.com with NNFMP; 10 Jan 2012 04:46:34 -0000 Received: from [127.0.0.1] by omp1057.mail.sp2.yahoo.com with NNFMP; 10 Jan 2012 04:46:34 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 552828.321.bm@omp1057.mail.sp2.yahoo.com Received: (qmail 60510 invoked by uid 60001); 10 Jan 2012 04:46:34 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1326170794; bh=gnLrH9jTQA5HPWme6K0y622AaZ9YWXxhCys6ojEYUTQ=; h=X-YMail-OSG:Received:X-RocketYMMF:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=ONKQftWlLg4qB4Pd2vixGOrOxv725ne1Vu6eM/upl58tZtzdkWlWsKGPme5FpcsJHgaHuc7j/M7hHlLDyS/DDKIdnKLbw9nulFiB2dd3y4siphGPOJXuishYpN1/fkeelJTfwYtKxxQv6CAqSvAps2Y68BXINomLLhx1OlYcjo0= X-YMail-OSG: pknzSoIVM1lDSq4ATNRIVOlAnpAOUJbdQ9nrEReQWwxynzr 7gWNbKUTMcewkoC7Gde9eb_hyCcffgl0GLNkNWMU1lRKVhFaEtOoUinuOmNk g91YhS_s.Frv15KkYOlNhZxYZD4XcEkqTuJr4IS0Mi8TMz6Es8CKvJyoj4NI 08BCeR_oHU7tJ3gdfiXJMv_Xf5Mtxt2VY8xvx7YzMI3t9oa6GvhQzAgCw8NQ o29Y.5P7ZI82qWG4uE8l3.JXp7KpgtJXo1uv5.BrjF4h1GU2gRSjKrMwzVCJ Rvllq83TtWXDn8ro0bT6J3WEE0rKOVVtrUXQR_DEBXCbqYtrhl4GAAWW3Fcp wFN.Vn.qWAU1A.pNqyGehlRwNJtfHurmL1rG9TUFFEdn0Dm7CGHPbMKCF9_1 _BZii1XKhB1.MVP_Vj1FcQizoHW2yPG_V_NOYIHmuT4v26PmyQtx1wzpwrHe ROeSQn4AD6Dpr5PX8fsMBqEHDXQ-- Received: from [200.118.157.7] by web113503.mail.gq1.yahoo.com via HTTP; Mon, 09 Jan 2012 20:46:33 PST X-RocketYMMF: giffunip X-Mailer: YahooMailClassic/15.0.4 YahooMailWebService/0.8.115.331698 Message-ID: <1326170793.59968.YahooMailClassic@web113503.mail.gq1.yahoo.com> Date: Mon, 9 Jan 2012 20:46:33 -0800 (PST) From: Pedro Giffuni To: John-Mark Gurney In-Reply-To: <20120110040219.GE52468@funkthat.com> MIME-Version: 1.0 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 Subject: Re: svn commit: r229415 - head/lib/libvgl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pfg@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 04:46:34 -0000 Hi John;=0A=0A--- Lun 9/1/12, John-Mark Gurney ha scritt= o:=0A...=0A> Pedro F. Giffuni wrote this message=0A> on Tue, Jan 03, 2012 a= t 19:47 +0000:=0A> > +#define SL_SWAP(a,b)=A0 =A0 =A0 =A0=0A> =A0=A0=A0{a^= =3Db; b^=3Da; a^=3Db;}=0A> =0A> Can we replace this w/ a normal swap functi= on?=0A> =0A=0A> Last time I did benchmarking on this ~10 years ago, it was= =0A> slower to use xor instead of using assignments...=0A> =0A=0AI doubt it= 's worth it, the swapping is not critical here and=0Adoing a swap saves a t= emporary variable (not that they are=0Aexpensive either).=0A=0Acheers,=0A= =0APedro.=0A=0A=0A> -- =0A> =A0 John-Mark Gurney=A0=A0=A0=0A> =A0=A0=A0 =A0= =A0=A0 =A0=A0=A0=0A> Voice: +1 415 225 5579=0A> =0A> =A0 =A0=A0=A0"All that= I will do, has been=0A> done, All that I have, has not."=0A> From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 04:49:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3972106566B; Tue, 10 Jan 2012 04:49:22 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id C4A1A8FC13; Tue, 10 Jan 2012 04:49:21 +0000 (UTC) Received: by lahl5 with SMTP id l5so2405005lah.13 for ; Mon, 09 Jan 2012 20:49:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=Y7I7I9hXBV6JMDow/ewgJMYSLGbeMX2WaXSqr7ez+0k=; b=plMSGzHIunAI1g7qeFaLsPL7VnSBdvrSU6Oq/QLldPgCaytTsL6y3WYWmHhbdHh3H/ vIZTotMloe3XhZQMPPrU/VyodL2H/MASBPJYgEkEZXYbwkqfhhSoPjwJ3YRWFK29bWwH kuxwsKo4FhCJbe8PRg2YA5fPsAvSgK6hN49hE= Received: by 10.112.25.35 with SMTP id z3mr4090463lbf.52.1326170960439; Mon, 09 Jan 2012 20:49:20 -0800 (PST) MIME-Version: 1.0 Received: by 10.152.129.8 with HTTP; Mon, 9 Jan 2012 20:48:49 -0800 (PST) In-Reply-To: <20120110040219.GE52468@funkthat.com> References: <201201031947.q03JlXnx039684@svn.freebsd.org> <20120110040219.GE52468@funkthat.com> From: Eitan Adler Date: Mon, 9 Jan 2012 23:48:49 -0500 Message-ID: To: John-Mark Gurney Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, "Pedro F. Giffuni" , src-committers@freebsd.org Subject: Re: svn commit: r229415 - head/lib/libvgl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 04:49:23 -0000 On Mon, Jan 9, 2012 at 11:02 PM, John-Mark Gurney wrote: > Last time I did benchmarking on this ~10 years ago, it was slower to > use xor instead of using assignments... I'd be shocked if the compiler didn't optimize this away to an XCHG. -- Eitan Adler From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 07:21:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F6FA106566C; Tue, 10 Jan 2012 07:21:12 +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 37E698FC08; Tue, 10 Jan 2012 07:21: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 q0A7LCUG095394; Tue, 10 Jan 2012 07:21:12 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A7LC5T095392; Tue, 10 Jan 2012 07:21:12 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201201100721.q0A7LC5T095392@svn.freebsd.org> From: Hiroki Sato Date: Tue, 10 Jan 2012 07:21:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229921 - stable/9/release/doc/en_US.ISO8859-1/relnotes X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 07:21:12 -0000 Author: hrs Date: Tue Jan 10 07:21:11 2012 New Revision: 229921 URL: http://svn.freebsd.org/changeset/base/229921 Log: Add relnotes items: RACCT resource accounting API, RCTL resource limiting API and rctl(8), sendmsg(2)/recvmsg(2) improvement in Linux compat layer, open(2)/fhopen(2) O_CLOEXEC, COMPAT_43 supports a.out binary on amd64, usb_pf and usbdump(8), cxgb(4) 7.11.0, em(4) 7.3.2, igb(4) 2.2.5, OFED 1.5.3 imported to support Infiniband, graid(8), resolvconf(8) 3.4.4 imported, hastd(8) source keyword, ps(1) -o usertime, systime, utmp(5) replaced by utmpx(3) [*], GNU GCC updated to the last GPLv2-licensed version, tzdata2011e, add description about incompatibilities due to ATA_CAM. Submitted by: ed[*] Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Tue Jan 10 04:19:36 2012 (r229920) +++ stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Tue Jan 10 07:21:11 2012 (r229921) @@ -213,12 +213,52 @@ PT_GNU_STACK for the specified ABIs (e.g. elf32 for 32-bit ABI). + A new resource accounting API has been + implemented. It can keep per-process, per-jail, + per-loginclass, and per-loginclass resource accounting + information. Note that this is not built nor installed by + default. To build and install them, specify options + RACCT in the kernel configuration file and rebuild + the base system as described in &os Handbook (). + + A new resource limiting API has been + implemented. It works in conjunction with + RACCT resource accounting implementation + and takes user-configurable actions based on the set of rules + it maintains and the current resource usage. The &man.rctl.8; + utility has been added to manage the rules in userland. Note + that this is not built nor installed by default. To build and + install them, specify options RCTL in the + kernel configuration file and rebuild the base system as + described in &os Handbook (). + + The &man.sendmsg.2; and &man.recvmsg.2; + system calls in &os; Linux ABI compatibility have been + improved. + + The &man.open.2; and &man.fhopen.2; + system calls now support O_CLOEXEC flag, + which allows to set FD_CLOEXEC flag for the + newly created file descriptor. This is standardized in IEEE + Std 1003.1-2008 (POSIX, Single UNIX Specification Version + 4). + Two new system calls setloginclass(2) and getloginclass(2) have been added. This makes it possible for the kernel to track login class the - process is assigned to, which is required for RCTL - framework. + process is assigned to, which is required for + RCTL resource limiting framework. + + &os; now supports executing + &os; 1/&arch.i386; a.out binaries on &os;&arch.amd64;. Note + that this is not built nor installed by default. To build and + install them, specify options COMPAT_43 in + the kernel configuration file and rebuild the base system as + described in &os; Handbook (). The following &man.sysctl.8; variables for showing availability of various kernel features: @@ -554,6 +594,12 @@ calibration, DELAY(9) with TSC, and using TSC as a CPU ticker. + The &os; &man.usb.4; subsystem now + supports USB packet filter. This allows to capture packets + which go through each USB host controllers. The + implementation is almost based on &man.bpf.4; code. + The userland program &man.usbdump.8; has been added. + Multimedia Support @@ -571,6 +617,9 @@ II 10GbE controller (BCM57710, BCM57711, BCM57711E) has been added. + A &man.cxgb.4; driver has been + updated to version 7.11.0. + A &man.cxgbe.4; driver for Chelsio T4 (Terminator 4) based 10Gb/1Gb adapters has been added. @@ -579,6 +628,12 @@ now works correctly in the kernel with option. + The &man.em.4; driver has been + updated to version 7.3.2. + + The &man.igb.4; driver has bee + updated to version 2.2.5. + The &man.igb.4; driver now supports Intel I350 PCIe Gigabit Ethernet controller. @@ -689,6 +744,15 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile &release.current; and later are no longer interoperable with the older &os; releases. + For Infiniband support, OFED + (OpenFabrics Enterprise Distribution) version 1.5.3 has been + imported into the base system. Note that this is not built + nor installed by default. To build and install them, + specify WITH_OFED=yes in + /etc/src.conf and rebuild the base + system as described in &os Handbook (). + A bug in &os; TCP/IP network stack has been fixed. The source address selection could not being performed when multicast options were present but without an @@ -745,6 +809,10 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile supports bios-boot GUID for the GPT scheme which is used in GRUB 2 loader. + &man.graid.8; GEOM class has been + added. This is a replacement of &man.ataraid.4; driver + supporting various BIOS-based software RAID. + The &man.sysctl.8; variable kern.geom.confxml now contains information about disk identification in an @@ -845,6 +913,12 @@ nfsuserd_enable="YES" cpu-list option to specify all CPUs in the system. + The &man.dhclient.8; utility now uses + &man.resolvconf.8; to manage the &man.resolv.conf.5; file by + default. A resolvconf_enable variable in + /etc/dhclient-enter-hooks controls the + behavior. + A bug in the &man.fetch.1; utility which could prevent STAT FTP command from working properly has been fixed. @@ -872,6 +946,11 @@ nfsuserd_enable="YES" hole and lzf are supported. + The &man.hastd.8; utility now supports + source keyword to specify the local address + to bind to before connecting the remote &man.hastd.8 + daemon. + An implementation of iconv() API libraries and utilities which are standardized in Single UNIX Specification have been @@ -924,9 +1003,11 @@ nfsuserd_enable="YES" and description subcommands in the &man.ifconfig.8; utility. - The &man.ps.1; utility now supports an - option to display login class - information of each process. + The &man.ps.1; utility now + supports an option to display login + class information of each process, and and options for + accumulated system and user CPU time, respectively. The &man.rtld.1; runtime linker now supports shared objects as filters in ELF shared libraries. Both @@ -983,6 +1064,14 @@ nfsuserd_enable="YES" && and || around an arithmetic expression has been fixed. + The &man.utmp.5; user accounting + database has been replaced by &man.utmpx.3;. User accounting + utilities will now use utmpx database + files exclusively. The &man.wtmpcvt.1; utility can be used to + convert wtmp files to the new format, + making it possible to read them using the updated + utilities. + A &man.utxrm.8; utility has been added. This allows one to remove an entry from the utmpx database by hand. This is useful @@ -1012,6 +1101,11 @@ nfsuserd_enable="YES" dialog has been updated to version 1.1-20110707. + GNU GCC and + libstdc++ have been updated to rev + 127959 of gcc-4_2-branch (the last + GPLv2-licensed version). + gdtoa, a set of binary from/to decimal number conversion routines used in &os; libc library has been updated @@ -1028,9 +1122,14 @@ nfsuserd_enable="YES" CPP &man.make.1; variables, respectively. - The timezone + The + openresolv version 3.4.4 has been + imported. The &man.resolvconf.8; utility now handles + &man.resolv.conf.5; file. + + The timezone database has been updated to the - tzdata2011d release. + tzdata2011e release. &man.unifdef.1; utility has been updated to version 2.5.6. @@ -1166,6 +1265,93 @@ nfsuserd_enable="YES" For more information, see &man.gpart.8; manual page. + + + ATA/SATA subsystem now &man.cam.4;-based + + In &release.current;, &os; ATA/SATA disk subsystem has + been replaced with a new &man.cam.4;-based implementation. + The &man.cam.4; stands for Common Access Method, which is an + implementation of API set originally for SCSI-2 and + standardized as "SCSI-2 Common Access Method Transport and + SCSI Interface Module". &os; has used &man.cam.4; subsystem + to handle SCSI devices since 3.X. + + Although the new &man.cam.4;-based ATA/SATA subsystem + provides various functionality which the old &man.ata.4; did + not have, it also has some incompatibility: + + + + An ATA/SATA disk is now recognized as a device node + with a name + ada0 + instead of + ad0. + Currently, a symbolic link /dev/ad0 + is automatically generated for + /dev/ada0 to keep backward + compatibility. This symbolic link generation can be + controlled by a + kern.cam.ada.legacy_aliases (enabled + by default). You might want to update + /etc/fstab and/or consider to use + volume label (see &man.glabel.8; for more detail) for + specifying each file system to be mounted. + + + + The &man.atacontrol.8; utility cannot be used for + &man.cam.4;-based devices. The &man.camcontrol.8 + utility is a replacement. + + + + The &man.ataraid.4; software RAID is supported by + &man.graid.8; GEOM class. It generates a device node + with a name + /dev/raid/r0 + if you had + /dev/ar0. + Note that this is not enabled by default. To enable it, + enter the following line in the &man.loader.8; prompt: + + set geom_raid_load="YES" +boot + + or add the following line to + /boot/loader.conf: + + geom_raid_load="YES" + + and reboot the system. A symbolic link like + /dev/ar0 + will be generated for + /dev/raid/r0. + Therefore, if your system used + /dev/ar0 as the root partition, + mounting local file systems will fail because it is + renamed to /dev/raid/r0. You need + to update /etc/fstab + manually in that case. + + + + The &man.burncd.8; utility does not work with + &man.cam.4;-based devices. Use the cdrecord(1) utility + in sysutils/cdrtools + instead. + + + + + + From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 07:27:15 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B6AD106564A; Tue, 10 Jan 2012 07:27:15 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper-int.allbsd.org [IPv6:2001:2f0:104:e002::2]) by mx1.freebsd.org (Postfix) with ESMTP id C951B8FC13; Tue, 10 Jan 2012 07:27:14 +0000 (UTC) Received: from alph.allbsd.org ([IPv6:2001:2f0:104:e010:862b:2bff:febc:8956]) (authenticated bits=128) by mail.allbsd.org (8.14.4/8.14.4) with ESMTP id q0A7Qkre015630; Tue, 10 Jan 2012 16:26:56 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.allbsd.org (8.14.4/8.14.4) with ESMTP id q0A7QfEx073541; Tue, 10 Jan 2012 16:26:43 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Tue, 10 Jan 2012 16:26:16 +0900 (JST) Message-Id: <20120110.162616.905059384481880812.hrs@allbsd.org> To: ed@80386.nl From: Hiroki Sato In-Reply-To: <20120108223438.GO5300@hoeg.nl> References: <201201081740.q08HeA5p000334@svn.freebsd.org> <20120108223438.GO5300@hoeg.nl> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.3.51 on Emacs 23.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Tue_Jan_10_16_26_16_2012_072)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (mail.allbsd.org [IPv6:2001:2f0:104:e001::32]); Tue, 10 Jan 2012 16:26:58 +0900 (JST) X-Spam-Status: No, score=-104.6 required=13.0 tests=BAYES_00, CONTENT_TYPE_PRESENT, RDNS_NONE, SPF_SOFTFAIL, USER_IN_WHITELIST autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on gatekeeper.allbsd.org Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-9@FreeBSD.org Subject: Re: svn commit: r17 - stable/9/release/doc/en_US.ISO8859-1/relnotes X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 07:27:15 -0000 ----Security_Multipart(Tue_Jan_10_16_26_16_2012_072)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Ed Schouten wrote in <20120108223438.GO5300@hoeg.nl>: ed> Hello Hiroki, ed> ed> * Hiroki Sato , 20120108 18:40: ed> > + A &man.utxrm.8; utility has been added. ed> > + This allows one to remove an entry from the ed> > + utmpx database by hand. This is useful ed> > + when a login daemon crashes or fails to remove the entry ed> > + during shutdown. ed> ed> We shouldn't forget to document the addition of utmpx as well. ed> ed> Any comments on the following? Thanks! I committed the patch just now. If you notice something wrong in the release notes please let me know. -- Hiroki ----Security_Multipart(Tue_Jan_10_16_26_16_2012_072)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAk8L6BgACgkQTyzT2CeTzy24QQCfVI75hINNFyb9WdAfzL1SLp2J 2gkAoITfmQDW2wdlXs3szUSJQoPP8CuJ =2mU0 -----END PGP SIGNATURE----- ----Security_Multipart(Tue_Jan_10_16_26_16_2012_072)---- From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 07:38:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EAC6E1065670; Tue, 10 Jan 2012 07:38:46 +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 D4A2E8FC0A; Tue, 10 Jan 2012 07:38:46 +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 q0A7ckC9095964; Tue, 10 Jan 2012 07:38:46 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A7ck1R095962; Tue, 10 Jan 2012 07:38:46 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201201100738.q0A7ck1R095962@svn.freebsd.org> From: Dimitry Andric Date: Tue, 10 Jan 2012 07:38:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229922 - stable/9/sys/dev/if_ndis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 07:38:47 -0000 Author: dim Date: Tue Jan 10 07:38:46 2012 New Revision: 229922 URL: http://svn.freebsd.org/changeset/base/229922 Log: MFC r229401: In sys/dev/if_ndis/if_ndis_pccard.c, fix a bug where a garbage rid was passed to resource_list_add(). The rid that was just returned by bus_alloc_resource_any() should have been used instead. Reviewed by: jhb Modified: stable/9/sys/dev/if_ndis/if_ndis_pccard.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/if_ndis/if_ndis_pccard.c ============================================================================== --- stable/9/sys/dev/if_ndis/if_ndis_pccard.c Tue Jan 10 07:21:11 2012 (r229921) +++ stable/9/sys/dev/if_ndis/if_ndis_pccard.c Tue Jan 10 07:38:46 2012 (r229922) @@ -207,7 +207,7 @@ ndis_attach_pccard(dev) goto fail; } sc->ndis_rescnt++; - resource_list_add(&sc->ndis_rl, SYS_RES_IOPORT, rid, + resource_list_add(&sc->ndis_rl, SYS_RES_IOPORT, sc->ndis_io_rid, rman_get_start(sc->ndis_res_io), rman_get_end(sc->ndis_res_io), rman_get_size(sc->ndis_res_io)); From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 07:42:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EB4E1065676; Tue, 10 Jan 2012 07:42:01 +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 787878FC16; Tue, 10 Jan 2012 07:42:01 +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 q0A7g1Kc096109; Tue, 10 Jan 2012 07:42:01 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A7g1Fg096107; Tue, 10 Jan 2012 07:42:01 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201201100742.q0A7g1Fg096107@svn.freebsd.org> From: Dimitry Andric Date: Tue, 10 Jan 2012 07:42:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229923 - stable/9/sys/compat/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 07:42:01 -0000 Author: dim Date: Tue Jan 10 07:42:01 2012 New Revision: 229923 URL: http://svn.freebsd.org/changeset/base/229923 Log: MFC r229402: In sys/compat/linux/linux_ioctl.c, work around a warning when a pointer is compared to an integer, by casting the pointer to l_uintptr_t. No functional difference on both i386 and amd64. Reviewed by: ed, jhb Modified: stable/9/sys/compat/linux/linux_ioctl.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/9/sys/compat/linux/linux_ioctl.c Tue Jan 10 07:38:46 2012 (r229922) +++ stable/9/sys/compat/linux/linux_ioctl.c Tue Jan 10 07:42:01 2012 (r229923) @@ -2182,7 +2182,7 @@ linux_ifconf(struct thread *td, struct i CURVNET_SET(TD_TO_VNET(td)); /* handle the 'request buffer size' case */ - if (ifc.ifc_buf == PTROUT(NULL)) { + if ((l_uintptr_t)ifc.ifc_buf == PTROUT(NULL)) { ifc.ifc_len = 0; IFNET_RLOCK(); TAILQ_FOREACH(ifp, &V_ifnet, if_link) { From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 07:45:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A20D21065670; Tue, 10 Jan 2012 07:45:00 +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 8CF1C8FC14; Tue, 10 Jan 2012 07:45: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 q0A7j0kJ096255; Tue, 10 Jan 2012 07:45:00 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A7j0m2096252; Tue, 10 Jan 2012 07:45:00 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201201100745.q0A7j0m2096252@svn.freebsd.org> From: Dimitry Andric Date: Tue, 10 Jan 2012 07:45:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229924 - stable/9/sys/dev/qlxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 07:45:00 -0000 Author: dim Date: Tue Jan 10 07:45:00 2012 New Revision: 229924 URL: http://svn.freebsd.org/changeset/base/229924 Log: MFC r229423: In sys/dev/qlxgb/qla_misc.c, fix a copy/paste issue. Clang complained the variable 'val' was uninitialized when used. Instead, 'sig' should have been printed. Reviewed by: davidcs Modified: stable/9/sys/dev/qlxgb/qla_misc.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/qlxgb/qla_misc.c ============================================================================== --- stable/9/sys/dev/qlxgb/qla_misc.c Tue Jan 10 07:42:01 2012 (r229923) +++ stable/9/sys/dev/qlxgb/qla_misc.c Tue Jan 10 07:45:00 2012 (r229924) @@ -407,7 +407,7 @@ qla_crb_init(qla_host_t *ha) addr_val_t *addr_val_map, *avmap; qla_rd_flash32(ha, 0, &sig); - QL_DPRINT2((ha->pci_dev, "%s: val[0] = 0x%08x\n", __func__, val)); + QL_DPRINT2((ha->pci_dev, "%s: val[0] = 0x%08x\n", __func__, sig)); qla_rd_flash32(ha, 4, &val); QL_DPRINT2((ha->pci_dev, "%s: val[4] = 0x%08x\n", __func__, val)); From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 07:46:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DFBA1065673; Tue, 10 Jan 2012 07:46:36 +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 188CE8FC13; Tue, 10 Jan 2012 07:46: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 q0A7kZwW096353; Tue, 10 Jan 2012 07:46:35 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A7kZg2096351; Tue, 10 Jan 2012 07:46:35 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201201100746.q0A7kZg2096351@svn.freebsd.org> From: Dimitry Andric Date: Tue, 10 Jan 2012 07:46:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229925 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 07:46:36 -0000 Author: dim Date: Tue Jan 10 07:46:35 2012 New Revision: 229925 URL: http://svn.freebsd.org/changeset/base/229925 Log: MFC r229425: In sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c, check the the number of links against LINK_MAX (which is INT16_MAX), not against UINT32_MAX. Otherwise, the constant would implicitly be converted to -1. Reviewed by: pjd Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Jan 10 07:45:00 2012 (r229924) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Jan 10 07:46:35 2012 (r229925) @@ -2698,7 +2698,7 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, i links = zp->z_links + 1; else links = zp->z_links; - vap->va_nlink = MIN(links, UINT32_MAX); /* nlink_t limit! */ + vap->va_nlink = MIN(links, LINK_MAX); /* nlink_t limit! */ vap->va_size = zp->z_size; #ifdef sun vap->va_rdev = vp->v_rdev; From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 08:01:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 333EE106566B; Tue, 10 Jan 2012 08:01:25 +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 1C6928FC14; Tue, 10 Jan 2012 08:01: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 q0A81OK7096843; Tue, 10 Jan 2012 08:01:24 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A81O9c096840; Tue, 10 Jan 2012 08:01:24 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201201100801.q0A81O9c096840@svn.freebsd.org> From: Hiroki Sato Date: Tue, 10 Jan 2012 08:01:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229926 - stable/9/release/doc/en_US.ISO8859-1/relnotes X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 08:01:25 -0000 Author: hrs Date: Tue Jan 10 08:01:24 2012 New Revision: 229926 URL: http://svn.freebsd.org/changeset/base/229926 Log: Add relnotes items: machdep.disable_tsc_calibration tunable, ada(4) kern.cam.ada.write_cache sysctl, geom_map(4) added, readline(3) functions imported into libedit, and lib{md,crypt} SHA-256/-512 support added. Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Tue Jan 10 07:46:35 2012 (r229925) +++ stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Tue Jan 10 08:01:24 2012 (r229926) @@ -587,12 +587,16 @@ supports Sony Playstation 3 using the OtherOS feature available on firmwares 3.15 and earlier. - A new &man.loader.8; tunable + A new &man.loader.8; tunable machdep.disable_tsc has been added. Setting this to a non-zero value disables use of TSC (Time Stamp Counter) by turning off boot-time CPU frequency calibration, DELAY(9) with TSC, and using TSC as a CPU - ticker. + ticker. Another new &man.loader.8; tunable + machdep.disable_tsc_calibration allows to + skip TSC frequency calibration only. This is useful when + one wants to use the nominal frequency of the chip in Intel + processors, for example. The &os; &man.usb.4; subsystem now supports USB packet filter. This allows to capture packets @@ -798,6 +802,26 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile Disks and Storage + The &man.ada.4; driver now supports + write cache control. A new &man.sysctl.8 variable + kern.cam.ada.write_cache determines + whether write cache of the &man.ada.4; devices is enabled or + not. Setting to 1 enables and + 0 disables, and -1 + leaves it the device default. &man.sysctl.8 variables + kern.cam.ada.N.write_cache + can override the configuration in a per-device basis (the + default value is -1, which means to use + the global setting). Note that the value can be changed at + runtime, but it takes effect only after a device + reset. + + The &man.geom.map.4; GEOM class has + been added. This allows to generate multiple geom providers + based on a hard-coded layout of a device with no explicit + partition table such as embedded flash storage. For more + information, see &man.geom.map.4; manual page. + The &man.gpart.8; GEOM class now supports the following aliases for the MBR and EBR schemes: fat32, ebr, @@ -970,6 +994,16 @@ nfsuserd_enable="YES" half-duplex, and loopback, respectively. + &man.readline.3; API set has been + imported into libedit. This is + based on NetBSD's implementation and BSD licensed utilities + now use it instead of GNU + libreadline. + + libmd + and libcrypt now support SHA-256 + and SHA-512 algorithm. + The &man.netstat.1; utility now does not expose internal scope address representation used in the &os; kernel, which is derived from KAME IPv6 stack, in the results From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 08:02:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0780B1065675; Tue, 10 Jan 2012 08:02:14 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id B4B9A8FC20; Tue, 10 Jan 2012 08:02:13 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:c412:ce36:3c98:43b8] (unknown [IPv6:2001:7b8:3a7:0:c412:ce36:3c98:43b8]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id CDFCC5C37; Tue, 10 Jan 2012 09:02:12 +0100 (CET) Message-ID: <4F0BF083.90003@FreeBSD.org> Date: Tue, 10 Jan 2012 09:02:11 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0) Gecko/20120106 Thunderbird/10.0 MIME-Version: 1.0 To: Eitan Adler References: <201201031947.q03JlXnx039684@svn.freebsd.org> <20120110040219.GE52468@funkthat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, John-Mark Gurney , "Pedro F. Giffuni" , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r229415 - head/lib/libvgl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 08:02:14 -0000 On 2012-01-10 05:48, Eitan Adler wrote: > On Mon, Jan 9, 2012 at 11:02 PM, John-Mark Gurney wrote: >> Last time I did benchmarking on this ~10 years ago, it was slower to >> use xor instead of using assignments... > > I'd be shocked if the compiler didn't optimize this away to an XCHG. Even with our ancient gcc 4.2 (on i386): VGLLine: [...] movl 12(%ebp), %edx movl 16(%ebp), %eax movl $1, -56(%ebp) xchgl %eax, %edx movl %edx, 12(%ebp) movl 24(%ebp), %edx movl %eax, 16(%ebp) movl %ecx, %eax xchgl %edx, %esi movl %edx, 24(%ebp) movl -84(%ebp), %edx xchgl %eax, %edx movl %eax, -80(%ebp) movl %edx, -84(%ebp) With clang, the corresponding local variables seem to have been optimized away entirely (or rather, moved around). From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 08:07:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBD60106564A; Tue, 10 Jan 2012 08:07:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 98D258FC13; Tue, 10 Jan 2012 08:07:46 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:c412:ce36:3c98:43b8] (unknown [IPv6:2001:7b8:3a7:0:c412:ce36:3c98:43b8]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id DF7855C44; Tue, 10 Jan 2012 09:07:45 +0100 (CET) Message-ID: <4F0BF1D3.7090902@FreeBSD.org> Date: Tue, 10 Jan 2012 09:07:47 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0) Gecko/20120106 Thunderbird/10.0 MIME-Version: 1.0 To: "Pedro F. Giffuni" References: <201201031947.q03JlXnx039684@svn.freebsd.org> In-Reply-To: <201201031947.q03JlXnx039684@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r229415 - head/lib/libvgl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 08:07:47 -0000 On 2012-01-03 20:47, Pedro F. Giffuni wrote: > Author: pfg > Date: Tue Jan 3 19:47:32 2012 > New Revision: 229415 > URL: http://svn.freebsd.org/changeset/base/229415 > > Log: > Integrate the line drawing algorithm from the book "Graphic Gems 1". > > http://www.graphicsgems.org/ > > At the time it claimed to be 3-4 times faster than the traditional > algorithm. Btw, why is this library in the base system at all? It seems totally unused, except for one picobsd Makefile? From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 08:16:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD09B1065677; Tue, 10 Jan 2012 08:16:29 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92F288FC12; Tue, 10 Jan 2012 08:16: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 q0A8GT0p097334; Tue, 10 Jan 2012 08:16:29 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A8GTS2097324; Tue, 10 Jan 2012 08:16:29 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201201100816.q0A8GTS2097324@svn.freebsd.org> From: Fabien Thomas Date: Tue, 10 Jan 2012 08:16:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229927 - in stable/9: share/man/man4 sys/amd64/conf sys/conf sys/dev/viawd sys/i386/conf sys/modules sys/modules/viawd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 08:16:29 -0000 Author: fabient Date: Tue Jan 10 08:16:28 2012 New Revision: 229927 URL: http://svn.freebsd.org/changeset/base/229927 Log: MFC r228431, r228502, r228802: Add watchdog support for VIA south bridge chipset. Tested on VT8251, VX900 but CX700, VX800, VX855 should works. Added: stable/9/share/man/man4/viawd.4 - copied unchanged from r228431, head/share/man/man4/viawd.4 stable/9/sys/dev/viawd/ - copied from r228431, head/sys/dev/viawd/ stable/9/sys/modules/viawd/ - copied from r228431, head/sys/modules/viawd/ Modified: stable/9/share/man/man4/Makefile stable/9/sys/amd64/conf/NOTES stable/9/sys/conf/files.amd64 stable/9/sys/conf/files.i386 stable/9/sys/dev/viawd/viawd.c stable/9/sys/dev/viawd/viawd.h stable/9/sys/i386/conf/NOTES stable/9/sys/modules/Makefile Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/share/man/man4/Makefile ============================================================================== --- stable/9/share/man/man4/Makefile Tue Jan 10 08:01:24 2012 (r229926) +++ stable/9/share/man/man4/Makefile Tue Jan 10 08:16:28 2012 (r229927) @@ -501,6 +501,7 @@ MAN= aac.4 \ vga.4 \ vge.4 \ viapm.4 \ + ${_viawd.4} \ vinum.4 \ vkbd.4 \ vlan.4 \ @@ -714,6 +715,7 @@ _speaker.4= speaker.4 _spkr.4= spkr.4 _tpm.4= tpm.4 _urtw.4= urtw.4 +_viawd.4= viawd.4 _wpi.4= wpi.4 _xen.4= xen.4 Copied: stable/9/share/man/man4/viawd.4 (from r228431, head/share/man/man4/viawd.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/share/man/man4/viawd.4 Tue Jan 10 08:16:28 2012 (r229927, copy of r228431, head/share/man/man4/viawd.4) @@ -0,0 +1,79 @@ +.\"- +.\" Copyright (c) 2011 Fabien Thomas +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS `AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd December 7, 2011 +.Dt VIAWD 4 +.Os +.Sh NAME +.Nm viawd +.Nd device driver for VIA south bridge watchdog timer +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device viawd" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +viawd_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides +.Xr watchdog 4 +support for the watchdog interrupt timer present on +VIA south bridge chipset (VT8251, CX700, VX800, VX855, VX900). +.Pp +The VIA south bridge have a built-in watchdog timer, +which can be enabled and disabled by user's program and set between +1 to 1023 seconds. +.Pp +The +.Nm +driver when unloaded with running watchdog will reschedule the watchdog +to 5 minutes. +.Sh SEE ALSO +.Xr watchdog 4 , +.Xr watchdog 8 , +.Xr watchdogd 8 , +.Xr watchdog 9 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 10.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver and this manual page were written by +.An Fabien Thomas Aq fabient@FreeBSD.org . Modified: stable/9/sys/amd64/conf/NOTES ============================================================================== --- stable/9/sys/amd64/conf/NOTES Tue Jan 10 08:01:24 2012 (r229926) +++ stable/9/sys/amd64/conf/NOTES Tue Jan 10 08:16:28 2012 (r229927) @@ -458,6 +458,7 @@ device tpm # device ichwd device amdsbwd +device viawd # # Temperature sensors: Modified: stable/9/sys/conf/files.amd64 ============================================================================== --- stable/9/sys/conf/files.amd64 Tue Jan 10 08:01:24 2012 (r229926) +++ stable/9/sys/conf/files.amd64 Tue Jan 10 08:16:28 2012 (r229927) @@ -260,6 +260,7 @@ dev/tpm/tpm.c optional tpm dev/tpm/tpm_acpi.c optional tpm acpi dev/tpm/tpm_isa.c optional tpm isa dev/uart/uart_cpu_amd64.c optional uart +dev/viawd/viawd.c optional viawd dev/wpi/if_wpi.c optional wpi isa/syscons_isa.c optional sc isa/vga_isa.c optional vga Modified: stable/9/sys/conf/files.i386 ============================================================================== --- stable/9/sys/conf/files.i386 Tue Jan 10 08:01:24 2012 (r229926) +++ stable/9/sys/conf/files.i386 Tue Jan 10 08:16:28 2012 (r229927) @@ -237,6 +237,7 @@ dev/tpm/tpm.c optional tpm dev/tpm/tpm_acpi.c optional tpm acpi dev/tpm/tpm_isa.c optional tpm isa dev/uart/uart_cpu_i386.c optional uart +dev/viawd/viawd.c optional viawd dev/acpica/acpi_if.m standard dev/acpi_support/acpi_wmi_if.m standard dev/wpi/if_wpi.c optional wpi Modified: stable/9/sys/dev/viawd/viawd.c ============================================================================== --- head/sys/dev/viawd/viawd.c Mon Dec 12 09:50:33 2011 (r228431) +++ stable/9/sys/dev/viawd/viawd.c Tue Jan 10 08:16:28 2012 (r229927) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011 Fabien Thomas + * Copyright (c) 2011 Fabien Thomas * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,10 +42,9 @@ __FBSDID("$FreeBSD$"); #include "viawd.h" -#define viawd_read_wd_4(sc, off) \ - bus_space_read_4((sc)->wd_bst, (sc)->wd_bsh, (off)) -#define viawd_write_wd_4(sc, off, val) \ - bus_space_write_4((sc)->wd_bst, (sc)->wd_bsh, (off), (val)) +#define viawd_read_4(sc, off) bus_read_4((sc)->wd_res, (off)) +#define viawd_write_4(sc, off, val) \ + bus_write_4((sc)->wd_res, (off), (val)) static struct viawd_device viawd_devices[] = { { DEVICEID_VT8251, "VIA VT8251 watchdog timer" }, @@ -58,37 +57,17 @@ static struct viawd_device viawd_devices static devclass_t viawd_devclass; -static device_t -viawd_find(struct viawd_device **id_p) -{ - struct viawd_device *id; - device_t sb_dev = NULL; - - /* Look for a supported VIA south bridge. */ - for (id = viawd_devices; id->desc != NULL; ++id) - if ((sb_dev = pci_find_device(VENDORID_VIA, id->device)) != NULL) - break; - - if (sb_dev == NULL) - return (NULL); - - if (id_p != NULL) - *id_p = id; - - return (sb_dev); -} - static void viawd_tmr_state(struct viawd_softc *sc, int enable) { uint32_t reg; - reg = viawd_read_wd_4(sc, VIAWD_MEM_CTRL); + reg = viawd_read_4(sc, VIAWD_MEM_CTRL); if (enable) reg |= VIAWD_MEM_CTRL_TRIGGER | VIAWD_MEM_CTRL_ENABLE; else reg &= ~VIAWD_MEM_CTRL_ENABLE; - viawd_write_wd_4(sc, VIAWD_MEM_CTRL, reg); + viawd_write_4(sc, VIAWD_MEM_CTRL, reg); } static void @@ -101,7 +80,7 @@ viawd_tmr_set(struct viawd_softc *sc, un else if (timeout > VIAWD_MEM_COUNT_MAX) timeout = VIAWD_MEM_COUNT_MAX; - viawd_write_wd_4(sc, VIAWD_MEM_COUNT, timeout); + viawd_write_4(sc, VIAWD_MEM_COUNT, timeout); sc->timeout = timeout; } @@ -127,35 +106,40 @@ viawd_event(void *arg, unsigned int cmd, viawd_tmr_state(sc, 0); } -static void -viawd_identify(driver_t *driver, device_t parent) +/* Look for a supported VIA south bridge. */ +static struct viawd_device * +viawd_find(device_t dev) { - device_t dev; - device_t sb_dev; - struct viawd_device *id_p; + struct viawd_device *id; - sb_dev = viawd_find(&id_p); - if (sb_dev == NULL) - return; + if (pci_get_vendor(dev) != VENDORID_VIA) + return (NULL); + for (id = viawd_devices; id->desc != NULL; id++) + if (pci_get_device(dev) == id->device) + return (id); + return (NULL); +} - /* Good, add child to bus. */ - if ((dev = device_find_child(parent, driver->name, 0)) == NULL) - dev = BUS_ADD_CHILD(parent, 0, driver->name, 0); +static void +viawd_identify(driver_t *driver, device_t parent) +{ - if (dev == NULL) + if (viawd_find(parent) == NULL) return; - device_set_desc_copy(dev, id_p->desc); + if (device_find_child(parent, driver->name, -1) == NULL) + BUS_ADD_CHILD(parent, 0, driver->name, 0); } static int viawd_probe(device_t dev) { + struct viawd_device *id; - /* Do not claim some ISA PnP device by accident. */ - if (isa_get_logicalid(dev) != 0) - return (ENXIO); - return (0); + id = viawd_find(device_get_parent(dev)); + KASSERT(id != NULL, ("parent should be a valid VIA SB")); + device_set_desc(dev, id->desc); + return (BUS_PROBE_GENERIC); } static int @@ -163,13 +147,12 @@ viawd_attach(device_t dev) { device_t sb_dev; struct viawd_softc *sc; - struct viawd_device *id_p; uint32_t pmbase, reg; sc = device_get_softc(dev); sc->dev = dev; - sb_dev = viawd_find(&id_p); + sb_dev = device_get_parent(dev); if (sb_dev == NULL) { device_printf(dev, "Can not find watchdog device.\n"); goto fail; @@ -193,16 +176,14 @@ viawd_attach(device_t dev) device_printf(dev, "Unable to map watchdog memory\n"); goto fail; } - sc->wd_bst = rman_get_bustag(sc->wd_res); - sc->wd_bsh = rman_get_bushandle(sc->wd_res); /* Check if watchdog fired last boot. */ - reg = viawd_read_wd_4(sc, VIAWD_MEM_CTRL); + reg = viawd_read_4(sc, VIAWD_MEM_CTRL); if (reg & VIAWD_MEM_CTRL_FIRED) { device_printf(dev, "ERROR: watchdog rebooted the system\n"); /* Reset bit state. */ - viawd_write_wd_4(sc, VIAWD_MEM_CTRL, reg); + viawd_write_4(sc, VIAWD_MEM_CTRL, reg); } /* Register the watchdog event handler. */ @@ -233,7 +214,7 @@ viawd_detach(device_t dev) * Do not stop the watchdog on shutdown if active but bump the * timer to avoid spurious reset. */ - reg = viawd_read_wd_4(sc, VIAWD_MEM_CTRL); + reg = viawd_read_4(sc, VIAWD_MEM_CTRL); if (reg & VIAWD_MEM_CTRL_ENABLE) { viawd_tmr_set(sc, VIAWD_TIMEOUT_SHUTDOWN); viawd_tmr_state(sc, 1); @@ -264,23 +245,4 @@ static driver_t viawd_driver = { sizeof(struct viawd_softc), }; -static int -viawd_modevent(module_t mode, int type, void *data) -{ - int error = 0; - - switch (type) { - case MOD_LOAD: - printf("viawd module loaded\n"); - break; - case MOD_UNLOAD: - printf("viawd module unloaded\n"); - break; - case MOD_SHUTDOWN: - printf("viawd module shutting down\n"); - break; - } - return (error); -} - -DRIVER_MODULE(viawd, isa, viawd_driver, viawd_devclass, viawd_modevent, NULL); +DRIVER_MODULE(viawd, isab, viawd_driver, viawd_devclass, NULL, NULL); Modified: stable/9/sys/dev/viawd/viawd.h ============================================================================== --- head/sys/dev/viawd/viawd.h Mon Dec 12 09:50:33 2011 (r228431) +++ stable/9/sys/dev/viawd/viawd.h Tue Jan 10 08:16:28 2012 (r229927) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011 Fabien Thomas + * Copyright (c) 2011 Fabien Thomas * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -40,8 +40,6 @@ struct viawd_softc { int wd_rid; struct resource *wd_res; - bus_space_tag_t wd_bst; - bus_space_handle_t wd_bsh; eventhandler_tag ev_tag; unsigned int timeout; Modified: stable/9/sys/i386/conf/NOTES ============================================================================== --- stable/9/sys/i386/conf/NOTES Tue Jan 10 08:01:24 2012 (r229926) +++ stable/9/sys/i386/conf/NOTES Tue Jan 10 08:16:28 2012 (r229927) @@ -831,6 +831,7 @@ hint.pcf.0.irq="5" # device ichwd device amdsbwd +device viawd # # Temperature sensors: Modified: stable/9/sys/modules/Makefile ============================================================================== --- stable/9/sys/modules/Makefile Tue Jan 10 08:01:24 2012 (r229926) +++ stable/9/sys/modules/Makefile Tue Jan 10 08:16:28 2012 (r229927) @@ -318,6 +318,7 @@ SUBDIR= ${_3dfx} \ utopia \ ${_vesa} \ vge \ + ${_viawd} \ vkbd \ ${_vpo} \ vr \ @@ -529,6 +530,7 @@ _nve= nve _nvram= nvram _nxge= nxge _tpm= tpm +_viawd= viawd _wpi= wpi _wpifw= wpifw .if ${MK_CRYPT} != "no" || defined(ALL_MODULES) @@ -637,6 +639,7 @@ _sppp= sppp _tpm= tpm _twa= twa _vesa= vesa +_viawd= viawd _vxge= vxge _x86bios= x86bios _wi= wi From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 08:22:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7F7D106566C; Tue, 10 Jan 2012 08:22:17 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 5B14C8FC0A; Tue, 10 Jan 2012 08:22:17 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 59C4AB51; Tue, 10 Jan 2012 09:22:15 +0100 (CET) Date: Tue, 10 Jan 2012 09:21:06 +0100 From: Pawel Jakub Dawidek To: Eitan Adler Message-ID: <20120110082106.GD1801@garage.freebsd.pl> References: <201201100258.q0A2wT7E079753@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="fOHHtNG4YXGJ0yqR" Content-Disposition: inline In-Reply-To: <201201100258.q0A2wT7E079753@svn.freebsd.org> X-OS: FreeBSD 9.0-CURRENT amd64 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: r229908 - head/usr.bin/brandelf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 08:22:18 -0000 --fOHHtNG4YXGJ0yqR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 10, 2012 at 02:58:29AM +0000, Eitan Adler wrote: > Author: eadler (ports committer) > Date: Tue Jan 10 02:58:29 2012 > New Revision: 229908 > URL: http://svn.freebsd.org/changeset/base/229908 >=20 > Log: > Fix warning when compiling with gcc46: > error: variable 'verbose' set but not use Maybe we should remove -v from the manual page as well or document as no-op? I'd still leave it in the code though, so there is no POLA violation. > Approved by: dim > MFC after: 3 days >=20 > Modified: > head/usr.bin/brandelf/brandelf.c >=20 > Modified: head/usr.bin/brandelf/brandelf.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.bin/brandelf/brandelf.c Tue Jan 10 02:58:20 2012 (r229907) > +++ head/usr.bin/brandelf/brandelf.c Tue Jan 10 02:58:29 2012 (r229908) > @@ -64,7 +64,7 @@ main(int argc, char **argv) > const char *strtype =3D "FreeBSD"; > int type =3D ELFOSABI_FREEBSD; > int retval =3D 0; > - int ch, change =3D 0, verbose =3D 0, force =3D 0, listed =3D 0; > + int ch, change =3D 0, force =3D 0, listed =3D 0; > =20 > while ((ch =3D getopt(argc, argv, "f:lt:v")) !=3D -1) > switch (ch) { > @@ -84,7 +84,7 @@ main(int argc, char **argv) > listed =3D 1; > break; > case 'v': > - verbose =3D 1; > + /* does nothing */ > break; > case 't': > if (force) --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --fOHHtNG4YXGJ0yqR Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk8L9PIACgkQForvXbEpPzQgrACg1chuGWsO0m6S443+3KqUrcDH GLsAoIxyTpkzISzRCATEaXrjfB7Fo6Zd =XXqs -----END PGP SIGNATURE----- --fOHHtNG4YXGJ0yqR-- From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 08:41:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B1A2106566B; Tue, 10 Jan 2012 08:41:11 +0000 (UTC) (envelope-from fabient@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA20D8FC08; Tue, 10 Jan 2012 08:41: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 q0A8fA1I098217; Tue, 10 Jan 2012 08:41:10 GMT (envelope-from fabient@svn.freebsd.org) Received: (from fabient@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0A8fAH9098207; Tue, 10 Jan 2012 08:41:10 GMT (envelope-from fabient@svn.freebsd.org) Message-Id: <201201100841.q0A8fAH9098207@svn.freebsd.org> From: Fabien Thomas Date: Tue, 10 Jan 2012 08:41:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229928 - in stable/8: share/man/man4 sys/amd64/conf sys/conf sys/dev/viawd sys/i386/conf sys/modules sys/modules/viawd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 08:41:11 -0000 Author: fabient Date: Tue Jan 10 08:41:10 2012 New Revision: 229928 URL: http://svn.freebsd.org/changeset/base/229928 Log: MFC r228431, r228502, r228802: Add watchdog support for VIA south bridge chipset. Tested on VT8251, VX900 but CX700, VX800, VX855 should works. Added: stable/8/share/man/man4/viawd.4 - copied unchanged from r228431, head/share/man/man4/viawd.4 stable/8/sys/dev/viawd/ - copied from r228431, head/sys/dev/viawd/ stable/8/sys/modules/viawd/ - copied from r228431, head/sys/modules/viawd/ Modified: stable/8/share/man/man4/Makefile stable/8/sys/amd64/conf/NOTES stable/8/sys/conf/files.amd64 stable/8/sys/conf/files.i386 stable/8/sys/dev/viawd/viawd.c stable/8/sys/dev/viawd/viawd.h stable/8/sys/i386/conf/NOTES stable/8/sys/modules/Makefile Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) Modified: stable/8/share/man/man4/Makefile ============================================================================== --- stable/8/share/man/man4/Makefile Tue Jan 10 08:16:28 2012 (r229927) +++ stable/8/share/man/man4/Makefile Tue Jan 10 08:41:10 2012 (r229928) @@ -482,6 +482,7 @@ MAN= aac.4 \ vga.4 \ vge.4 \ viapm.4 \ + ${_viawd.4} \ vinum.4 \ vkbd.4 \ vlan.4 \ @@ -688,6 +689,7 @@ _speaker.4= speaker.4 _spkr.4= spkr.4 _tpm.4= tpm.4 _urtw.4= urtw.4 +_viawd.4= viawd.4 _wpi.4= wpi.4 _xen.4= xen.4 Copied: stable/8/share/man/man4/viawd.4 (from r228431, head/share/man/man4/viawd.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man4/viawd.4 Tue Jan 10 08:41:10 2012 (r229928, copy of r228431, head/share/man/man4/viawd.4) @@ -0,0 +1,79 @@ +.\"- +.\" Copyright (c) 2011 Fabien Thomas +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS `AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd December 7, 2011 +.Dt VIAWD 4 +.Os +.Sh NAME +.Nm viawd +.Nd device driver for VIA south bridge watchdog timer +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device viawd" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +viawd_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides +.Xr watchdog 4 +support for the watchdog interrupt timer present on +VIA south bridge chipset (VT8251, CX700, VX800, VX855, VX900). +.Pp +The VIA south bridge have a built-in watchdog timer, +which can be enabled and disabled by user's program and set between +1 to 1023 seconds. +.Pp +The +.Nm +driver when unloaded with running watchdog will reschedule the watchdog +to 5 minutes. +.Sh SEE ALSO +.Xr watchdog 4 , +.Xr watchdog 8 , +.Xr watchdogd 8 , +.Xr watchdog 9 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 10.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver and this manual page were written by +.An Fabien Thomas Aq fabient@FreeBSD.org . Modified: stable/8/sys/amd64/conf/NOTES ============================================================================== --- stable/8/sys/amd64/conf/NOTES Tue Jan 10 08:16:28 2012 (r229927) +++ stable/8/sys/amd64/conf/NOTES Tue Jan 10 08:41:10 2012 (r229928) @@ -459,6 +459,7 @@ device tpm # device ichwd device amdsbwd +device viawd # # Temperature sensors: Modified: stable/8/sys/conf/files.amd64 ============================================================================== --- stable/8/sys/conf/files.amd64 Tue Jan 10 08:16:28 2012 (r229927) +++ stable/8/sys/conf/files.amd64 Tue Jan 10 08:41:10 2012 (r229928) @@ -231,6 +231,7 @@ dev/tpm/tpm.c optional tpm dev/tpm/tpm_acpi.c optional tpm acpi dev/tpm/tpm_isa.c optional tpm isa dev/uart/uart_cpu_amd64.c optional uart +dev/viawd/viawd.c optional viawd dev/wpi/if_wpi.c optional wpi isa/syscons_isa.c optional sc isa/vga_isa.c optional vga Modified: stable/8/sys/conf/files.i386 ============================================================================== --- stable/8/sys/conf/files.i386 Tue Jan 10 08:16:28 2012 (r229927) +++ stable/8/sys/conf/files.i386 Tue Jan 10 08:41:10 2012 (r229928) @@ -236,6 +236,7 @@ dev/tpm/tpm.c optional tpm dev/tpm/tpm_acpi.c optional tpm acpi dev/tpm/tpm_isa.c optional tpm isa dev/uart/uart_cpu_i386.c optional uart +dev/viawd/viawd.c optional viawd dev/acpica/acpi_if.m standard dev/acpi_support/acpi_wmi_if.m standard dev/wpi/if_wpi.c optional wpi Modified: stable/8/sys/dev/viawd/viawd.c ============================================================================== --- head/sys/dev/viawd/viawd.c Mon Dec 12 09:50:33 2011 (r228431) +++ stable/8/sys/dev/viawd/viawd.c Tue Jan 10 08:41:10 2012 (r229928) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011 Fabien Thomas + * Copyright (c) 2011 Fabien Thomas * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -42,10 +42,9 @@ __FBSDID("$FreeBSD$"); #include "viawd.h" -#define viawd_read_wd_4(sc, off) \ - bus_space_read_4((sc)->wd_bst, (sc)->wd_bsh, (off)) -#define viawd_write_wd_4(sc, off, val) \ - bus_space_write_4((sc)->wd_bst, (sc)->wd_bsh, (off), (val)) +#define viawd_read_4(sc, off) bus_read_4((sc)->wd_res, (off)) +#define viawd_write_4(sc, off, val) \ + bus_write_4((sc)->wd_res, (off), (val)) static struct viawd_device viawd_devices[] = { { DEVICEID_VT8251, "VIA VT8251 watchdog timer" }, @@ -58,37 +57,17 @@ static struct viawd_device viawd_devices static devclass_t viawd_devclass; -static device_t -viawd_find(struct viawd_device **id_p) -{ - struct viawd_device *id; - device_t sb_dev = NULL; - - /* Look for a supported VIA south bridge. */ - for (id = viawd_devices; id->desc != NULL; ++id) - if ((sb_dev = pci_find_device(VENDORID_VIA, id->device)) != NULL) - break; - - if (sb_dev == NULL) - return (NULL); - - if (id_p != NULL) - *id_p = id; - - return (sb_dev); -} - static void viawd_tmr_state(struct viawd_softc *sc, int enable) { uint32_t reg; - reg = viawd_read_wd_4(sc, VIAWD_MEM_CTRL); + reg = viawd_read_4(sc, VIAWD_MEM_CTRL); if (enable) reg |= VIAWD_MEM_CTRL_TRIGGER | VIAWD_MEM_CTRL_ENABLE; else reg &= ~VIAWD_MEM_CTRL_ENABLE; - viawd_write_wd_4(sc, VIAWD_MEM_CTRL, reg); + viawd_write_4(sc, VIAWD_MEM_CTRL, reg); } static void @@ -101,7 +80,7 @@ viawd_tmr_set(struct viawd_softc *sc, un else if (timeout > VIAWD_MEM_COUNT_MAX) timeout = VIAWD_MEM_COUNT_MAX; - viawd_write_wd_4(sc, VIAWD_MEM_COUNT, timeout); + viawd_write_4(sc, VIAWD_MEM_COUNT, timeout); sc->timeout = timeout; } @@ -127,35 +106,40 @@ viawd_event(void *arg, unsigned int cmd, viawd_tmr_state(sc, 0); } -static void -viawd_identify(driver_t *driver, device_t parent) +/* Look for a supported VIA south bridge. */ +static struct viawd_device * +viawd_find(device_t dev) { - device_t dev; - device_t sb_dev; - struct viawd_device *id_p; + struct viawd_device *id; - sb_dev = viawd_find(&id_p); - if (sb_dev == NULL) - return; + if (pci_get_vendor(dev) != VENDORID_VIA) + return (NULL); + for (id = viawd_devices; id->desc != NULL; id++) + if (pci_get_device(dev) == id->device) + return (id); + return (NULL); +} - /* Good, add child to bus. */ - if ((dev = device_find_child(parent, driver->name, 0)) == NULL) - dev = BUS_ADD_CHILD(parent, 0, driver->name, 0); +static void +viawd_identify(driver_t *driver, device_t parent) +{ - if (dev == NULL) + if (viawd_find(parent) == NULL) return; - device_set_desc_copy(dev, id_p->desc); + if (device_find_child(parent, driver->name, -1) == NULL) + BUS_ADD_CHILD(parent, 0, driver->name, 0); } static int viawd_probe(device_t dev) { + struct viawd_device *id; - /* Do not claim some ISA PnP device by accident. */ - if (isa_get_logicalid(dev) != 0) - return (ENXIO); - return (0); + id = viawd_find(device_get_parent(dev)); + KASSERT(id != NULL, ("parent should be a valid VIA SB")); + device_set_desc(dev, id->desc); + return (BUS_PROBE_GENERIC); } static int @@ -163,13 +147,12 @@ viawd_attach(device_t dev) { device_t sb_dev; struct viawd_softc *sc; - struct viawd_device *id_p; uint32_t pmbase, reg; sc = device_get_softc(dev); sc->dev = dev; - sb_dev = viawd_find(&id_p); + sb_dev = device_get_parent(dev); if (sb_dev == NULL) { device_printf(dev, "Can not find watchdog device.\n"); goto fail; @@ -193,16 +176,14 @@ viawd_attach(device_t dev) device_printf(dev, "Unable to map watchdog memory\n"); goto fail; } - sc->wd_bst = rman_get_bustag(sc->wd_res); - sc->wd_bsh = rman_get_bushandle(sc->wd_res); /* Check if watchdog fired last boot. */ - reg = viawd_read_wd_4(sc, VIAWD_MEM_CTRL); + reg = viawd_read_4(sc, VIAWD_MEM_CTRL); if (reg & VIAWD_MEM_CTRL_FIRED) { device_printf(dev, "ERROR: watchdog rebooted the system\n"); /* Reset bit state. */ - viawd_write_wd_4(sc, VIAWD_MEM_CTRL, reg); + viawd_write_4(sc, VIAWD_MEM_CTRL, reg); } /* Register the watchdog event handler. */ @@ -233,7 +214,7 @@ viawd_detach(device_t dev) * Do not stop the watchdog on shutdown if active but bump the * timer to avoid spurious reset. */ - reg = viawd_read_wd_4(sc, VIAWD_MEM_CTRL); + reg = viawd_read_4(sc, VIAWD_MEM_CTRL); if (reg & VIAWD_MEM_CTRL_ENABLE) { viawd_tmr_set(sc, VIAWD_TIMEOUT_SHUTDOWN); viawd_tmr_state(sc, 1); @@ -264,23 +245,4 @@ static driver_t viawd_driver = { sizeof(struct viawd_softc), }; -static int -viawd_modevent(module_t mode, int type, void *data) -{ - int error = 0; - - switch (type) { - case MOD_LOAD: - printf("viawd module loaded\n"); - break; - case MOD_UNLOAD: - printf("viawd module unloaded\n"); - break; - case MOD_SHUTDOWN: - printf("viawd module shutting down\n"); - break; - } - return (error); -} - -DRIVER_MODULE(viawd, isa, viawd_driver, viawd_devclass, viawd_modevent, NULL); +DRIVER_MODULE(viawd, isab, viawd_driver, viawd_devclass, NULL, NULL); Modified: stable/8/sys/dev/viawd/viawd.h ============================================================================== --- head/sys/dev/viawd/viawd.h Mon Dec 12 09:50:33 2011 (r228431) +++ stable/8/sys/dev/viawd/viawd.h Tue Jan 10 08:41:10 2012 (r229928) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011 Fabien Thomas + * Copyright (c) 2011 Fabien Thomas * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -40,8 +40,6 @@ struct viawd_softc { int wd_rid; struct resource *wd_res; - bus_space_tag_t wd_bst; - bus_space_handle_t wd_bsh; eventhandler_tag ev_tag; unsigned int timeout; Modified: stable/8/sys/i386/conf/NOTES ============================================================================== --- stable/8/sys/i386/conf/NOTES Tue Jan 10 08:16:28 2012 (r229927) +++ stable/8/sys/i386/conf/NOTES Tue Jan 10 08:41:10 2012 (r229928) @@ -844,6 +844,7 @@ hint.pcf.0.irq="5" # device ichwd device amdsbwd +device viawd # # Temperature sensors: Modified: stable/8/sys/modules/Makefile ============================================================================== --- stable/8/sys/modules/Makefile Tue Jan 10 08:16:28 2012 (r229927) +++ stable/8/sys/modules/Makefile Tue Jan 10 08:41:10 2012 (r229928) @@ -306,6 +306,7 @@ SUBDIR= ${_3dfx} \ utopia \ ${_vesa} \ vge \ + ${_viawd} \ vkbd \ ${_vpo} \ vr \ @@ -503,6 +504,7 @@ _nve= nve _nvram= nvram _nxge= nxge _tpm= tpm +_viawd= viawd _wpi= wpi _wpifw= wpifw .if ${MK_CRYPT} != "no" || defined(ALL_MODULES) @@ -602,6 +604,7 @@ _tmpfs= tmpfs _tpm= tpm _twa= twa _vesa= vesa +_viawd= viawd _x86bios= x86bios _wi= wi _wpi= wpi From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 09:38:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65E141065673; Tue, 10 Jan 2012 09:38:31 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 240AE8FC16; Tue, 10 Jan 2012 09:38:31 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:c412:ce36:3c98:43b8] (unknown [IPv6:2001:7b8:3a7:0:c412:ce36:3c98:43b8]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 58FD05C37; Tue, 10 Jan 2012 10:38:30 +0100 (CET) Message-ID: <4F0C0714.6060501@FreeBSD.org> Date: Tue, 10 Jan 2012 10:38:28 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0) Gecko/20120106 Thunderbird/10.0 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <201201100258.q0A2wT7E079753@svn.freebsd.org> <20120110082106.GD1801@garage.freebsd.pl> In-Reply-To: <20120110082106.GD1801@garage.freebsd.pl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Eitan Adler Subject: Re: svn commit: r229908 - head/usr.bin/brandelf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 09:38:31 -0000 On 2012-01-10 09:21, Pawel Jakub Dawidek wrote: > On Tue, Jan 10, 2012 at 02:58:29AM +0000, Eitan Adler wrote: >> Author: eadler (ports committer) >> Date: Tue Jan 10 02:58:29 2012 >> New Revision: 229908 >> URL: http://svn.freebsd.org/changeset/base/229908 >> >> Log: >> Fix warning when compiling with gcc46: >> error: variable 'verbose' set but not use > > Maybe we should remove -v from the manual page as well or document as no-op? > I'd still leave it in the code though, so there is no POLA violation. It has been a no-op since the beginning of brandelf, and I have really no idea what the original author intended the verbose output to be. :) It is probably best to document it as a no-op now, to reduce possible confusion. From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 11:41:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15A20106566B; Tue, 10 Jan 2012 11:41:03 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0352A8FC1A; Tue, 10 Jan 2012 11:41:03 +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 q0ABf2CM008930; Tue, 10 Jan 2012 11:41:02 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0ABf2WX008928; Tue, 10 Jan 2012 11:41:02 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201201101141.q0ABf2WX008928@svn.freebsd.org> From: Peter Holm Date: Tue, 10 Jan 2012 11:41:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229929 - stable/9/sys/fs/pseudofs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 11:41:03 -0000 Author: pho Date: Tue Jan 10 11:41:02 2012 New Revision: 229929 URL: http://svn.freebsd.org/changeset/base/229929 Log: MFC: r227550, r227576 Handle invalid large values for getdirentries(2) data buffer size. Fix build, use %d for int value formatting. Modified: stable/9/sys/fs/pseudofs/pseudofs_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- stable/9/sys/fs/pseudofs/pseudofs_vnops.c Tue Jan 10 08:41:10 2012 (r229928) +++ stable/9/sys/fs/pseudofs/pseudofs_vnops.c Tue Jan 10 11:41:02 2012 (r229929) @@ -710,6 +710,13 @@ pfs_iterate(struct thread *td, struct pr return (0); } +/* Directory entry list */ +struct pfsentry { + STAILQ_ENTRY(pfsentry) link; + struct dirent entry; +}; +STAILQ_HEAD(pfsdirentlist, pfsentry); + /* * Return directory entries. */ @@ -722,12 +729,14 @@ pfs_readdir(struct vop_readdir_args *va) pid_t pid = pvd->pvd_pid; struct proc *p, *proc; struct pfs_node *pn; - struct dirent *entry; struct uio *uio; + struct pfsentry *pfsent, *pfsent2; + struct pfsdirentlist lst; off_t offset; int error, i, resid; - char *buf, *ent; + STAILQ_INIT(&lst); + error = 0; KASSERT(pd->pn_info == vn->v_mount->mnt_data, ("%s(): pn_info does not match mountpoint", __func__)); PFS_TRACE(("%s pid %lu", pd->pn_name, (unsigned long)pid)); @@ -747,8 +756,6 @@ pfs_readdir(struct vop_readdir_args *va) if (resid == 0) PFS_RETURN (0); - /* can't do this while holding the proc lock... */ - buf = malloc(resid, M_IOV, M_WAITOK | M_ZERO); sx_slock(&allproc_lock); pfs_lock(pd); @@ -756,7 +763,6 @@ pfs_readdir(struct vop_readdir_args *va) if (!pfs_visible(curthread, pd, pid, &proc)) { sx_sunlock(&allproc_lock); pfs_unlock(pd); - free(buf, M_IOV); PFS_RETURN (ENOENT); } KASSERT(pid == NO_PID || proc != NULL, @@ -770,57 +776,64 @@ pfs_readdir(struct vop_readdir_args *va) PROC_UNLOCK(proc); pfs_unlock(pd); sx_sunlock(&allproc_lock); - free(buf, M_IOV); PFS_RETURN (0); } } /* fill in entries */ - ent = buf; while (pfs_iterate(curthread, proc, pd, &pn, &p) != -1 && resid >= PFS_DELEN) { - entry = (struct dirent *)ent; - entry->d_reclen = PFS_DELEN; - entry->d_fileno = pn_fileno(pn, pid); + if ((pfsent = malloc(sizeof(struct pfsentry), M_IOV, + M_NOWAIT | M_ZERO)) == NULL) { + error = ENOMEM; + break; + } + pfsent->entry.d_reclen = PFS_DELEN; + pfsent->entry.d_fileno = pn_fileno(pn, pid); /* PFS_DELEN was picked to fit PFS_NAMLEN */ for (i = 0; i < PFS_NAMELEN - 1 && pn->pn_name[i] != '\0'; ++i) - entry->d_name[i] = pn->pn_name[i]; - entry->d_name[i] = 0; - entry->d_namlen = i; + pfsent->entry.d_name[i] = pn->pn_name[i]; + pfsent->entry.d_name[i] = 0; + pfsent->entry.d_namlen = i; switch (pn->pn_type) { case pfstype_procdir: KASSERT(p != NULL, ("reached procdir node with p == NULL")); - entry->d_namlen = snprintf(entry->d_name, + pfsent->entry.d_namlen = snprintf(pfsent->entry.d_name, PFS_NAMELEN, "%d", p->p_pid); /* fall through */ case pfstype_root: case pfstype_dir: case pfstype_this: case pfstype_parent: - entry->d_type = DT_DIR; + pfsent->entry.d_type = DT_DIR; break; case pfstype_file: - entry->d_type = DT_REG; + pfsent->entry.d_type = DT_REG; break; case pfstype_symlink: - entry->d_type = DT_LNK; + pfsent->entry.d_type = DT_LNK; break; default: panic("%s has unexpected node type: %d", pn->pn_name, pn->pn_type); } - PFS_TRACE(("%s", entry->d_name)); + PFS_TRACE(("%s", pfsent->entry.d_name)); + STAILQ_INSERT_TAIL(&lst, pfsent, link); offset += PFS_DELEN; resid -= PFS_DELEN; - ent += PFS_DELEN; } if (proc != NULL) PROC_UNLOCK(proc); pfs_unlock(pd); sx_sunlock(&allproc_lock); - PFS_TRACE(("%zd bytes", ent - buf)); - error = uiomove(buf, ent - buf, uio); - free(buf, M_IOV); + i = 0; + STAILQ_FOREACH_SAFE(pfsent, &lst, link, pfsent2) { + if (error == 0) + error = uiomove(&pfsent->entry, PFS_DELEN, uio); + free(pfsent, M_IOV); + i++; + } + PFS_TRACE(("%d bytes", i * PFS_DELEN)); PFS_RETURN (error); } From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 12:45:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 197451065672; Tue, 10 Jan 2012 12:45:25 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07C9F8FC13; Tue, 10 Jan 2012 12:45: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 q0ACjOtp010983; Tue, 10 Jan 2012 12:45:24 GMT (envelope-from melifaro@svn.freebsd.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0ACjO6h010981; Tue, 10 Jan 2012 12:45:24 GMT (envelope-from melifaro@svn.freebsd.org) Message-Id: <201201101245.q0ACjO6h010981@svn.freebsd.org> From: "Alexander V. Chernikov" Date: Tue, 10 Jan 2012 12:45: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: r229930 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 12:45:25 -0000 Author: melifaro Date: Tue Jan 10 12:45:24 2012 New Revision: 229930 URL: http://svn.freebsd.org/changeset/base/229930 Log: Add setsockopt(2) example to ng_ksocket(4). While here, fix formatting a bit Approved by: kib(mentor) MFC after: 2 weeks Modified: head/share/man/man4/ng_ksocket.4 Modified: head/share/man/man4/ng_ksocket.4 ============================================================================== --- head/share/man/man4/ng_ksocket.4 Tue Jan 10 11:41:02 2012 (r229929) +++ head/share/man/man4/ng_ksocket.4 Tue Jan 10 12:45:24 2012 (r229930) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 28, 2005 +.Dd January 09, 2012 .Dt NG_KSOCKET 4 .Os .Sh NAME @@ -199,7 +199,7 @@ For the address is the pathname as a doubly quoted string. .Pp Examples: -.Bl -tag -width XXXXXXXXXX +.Bl -tag -width "PF_LOCAL" .It Dv PF_LOCAL local/"/tmp/foo.socket" .It Dv PF_INET @@ -215,6 +215,12 @@ the normal form for that structure is used. In the future, more convenient encoding of the more common socket options may be supported. +.Pp +Setting socket options example: +.Bl -tag -width "PF_LOCAL" +.It Set FIB 2 for a socket (SOL_SOCKET, SO_SETFIB): +.Dv "setopt \&{ level=0xffff name=0x1014 data=[ 2 ] \&}" +.El .Sh SHUTDOWN This node shuts down upon receipt of a .Dv NGM_SHUTDOWN From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 13:34:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CE59106564A; Tue, 10 Jan 2012 13:34:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6B0CA8FC0A; Tue, 10 Jan 2012 13:34: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 q0ADYelM012507; Tue, 10 Jan 2012 13:34:40 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0ADYeYT012505; Tue, 10 Jan 2012 13:34:40 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201101334.q0ADYeYT012505@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 10 Jan 2012 13:34:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229931 - stable/9/sys/fs/nullfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 13:34:40 -0000 Author: kib Date: Tue Jan 10 13:34:39 2012 New Revision: 229931 URL: http://svn.freebsd.org/changeset/base/229931 Log: MFC r229428: Document the state of the lowervp vnode for null_nodeget(). MFC r229600 (by dim): Output the correct vnode pointer. Modified: stable/9/sys/fs/nullfs/null_subr.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/fs/nullfs/null_subr.c ============================================================================== --- stable/9/sys/fs/nullfs/null_subr.c Tue Jan 10 12:45:24 2012 (r229930) +++ stable/9/sys/fs/nullfs/null_subr.c Tue Jan 10 13:34:39 2012 (r229931) @@ -198,6 +198,9 @@ null_nodeget(mp, lowervp, vpp) struct vnode *vp; int error; + ASSERT_VOP_LOCKED(lowervp, "lowervp"); + KASSERT(lowervp->v_usecount >= 1, ("Unreferenced vnode %p\n", lowervp)); + /* Lookup the hash firstly */ *vpp = null_hashget(mp, lowervp); if (*vpp != NULL) { From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 13:41:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5883F106566C; Tue, 10 Jan 2012 13:41:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C1A38FC16; Tue, 10 Jan 2012 13:41: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 q0ADfFPX012749; Tue, 10 Jan 2012 13:41:15 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0ADfEf7012745; Tue, 10 Jan 2012 13:41:14 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201101341.q0ADfEf7012745@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 10 Jan 2012 13:41:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229932 - stable/9/sys/fs/nullfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 13:41:15 -0000 Author: kib Date: Tue Jan 10 13:41:14 2012 New Revision: 229932 URL: http://svn.freebsd.org/changeset/base/229932 Log: MFC r229431: Do the vput() for the lowervp in the null_nodeget() for error case too. Several callers of null_nodeget() did the cleanup itself, but several missed it, most prominent being null_bypass(). Remove the cleanup from the callers, now null_nodeget() handles lowervp free itself. Modified: stable/9/sys/fs/nullfs/null_subr.c stable/9/sys/fs/nullfs/null_vfsops.c stable/9/sys/fs/nullfs/null_vnops.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/fs/nullfs/null_subr.c ============================================================================== --- stable/9/sys/fs/nullfs/null_subr.c Tue Jan 10 13:34:39 2012 (r229931) +++ stable/9/sys/fs/nullfs/null_subr.c Tue Jan 10 13:41:14 2012 (r229932) @@ -171,6 +171,8 @@ null_hashins(mp, xp) static void null_insmntque_dtr(struct vnode *vp, void *xp) { + + vput(((struct null_node *)xp)->null_lowervp); vp->v_data = NULL; vp->v_vnlock = &vp->v_lock; free(xp, M_NULLFSNODE); @@ -226,6 +228,7 @@ null_nodeget(mp, lowervp, vpp) error = getnewvnode("null", mp, &null_vnodeops, &vp); if (error) { + vput(lowervp); free(xp, M_NULLFSNODE); return (error); } Modified: stable/9/sys/fs/nullfs/null_vfsops.c ============================================================================== --- stable/9/sys/fs/nullfs/null_vfsops.c Tue Jan 10 13:34:39 2012 (r229931) +++ stable/9/sys/fs/nullfs/null_vfsops.c Tue Jan 10 13:41:14 2012 (r229932) @@ -157,8 +157,7 @@ nullfs_mount(struct mount *mp) * Make sure the node alias worked */ if (error) { - vrele(lowerrootvp); - free(xmp, M_NULLFSMNT); /* XXX */ + free(xmp, M_NULLFSMNT); return (error); } Modified: stable/9/sys/fs/nullfs/null_vnops.c ============================================================================== --- stable/9/sys/fs/nullfs/null_vnops.c Tue Jan 10 13:34:39 2012 (r229931) +++ stable/9/sys/fs/nullfs/null_vnops.c Tue Jan 10 13:41:14 2012 (r229932) @@ -365,9 +365,7 @@ null_lookup(struct vop_lookup_args *ap) vrele(lvp); } else { error = null_nodeget(dvp->v_mount, lvp, &vp); - if (error) - vput(lvp); - else + if (error == 0) *ap->a_vpp = vp; } } @@ -809,9 +807,7 @@ null_vptocnp(struct vop_vptocnp_args *ap NULLVPTOLOWERVP(*dvp); #endif VOP_UNLOCK(*dvp, 0); /* keep reference on *dvp */ - } else - vput(ldvp); - + } vn_lock(vp, locked | LK_RETRY); return (error); } From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 15:29:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89BFD106564A; Tue, 10 Jan 2012 15:29:04 +0000 (UTC) (envelope-from syrinx@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 76DC48FC15; Tue, 10 Jan 2012 15:29: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 q0AFT4AX016512; Tue, 10 Jan 2012 15:29:04 GMT (envelope-from syrinx@svn.freebsd.org) Received: (from syrinx@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0AFT4JL016507; Tue, 10 Jan 2012 15:29:04 GMT (envelope-from syrinx@svn.freebsd.org) Message-Id: <201201101529.q0AFT4JL016507@svn.freebsd.org> From: Shteryana Shopova Date: Tue, 10 Jan 2012 15:29: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: r229933 - in head/usr.sbin/bsnmpd/tools: bsnmptools libbsnmptools X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 15:29:04 -0000 Author: syrinx Date: Tue Jan 10 15:29:03 2012 New Revision: 229933 URL: http://svn.freebsd.org/changeset/base/229933 Log: Implement an option to execute SNMP walks using GETBULK requests in bsnmpwalk(1) retrieving multiple values with a Single PDU. Reviewed by: philip@ Tested by: tsanand129 (at) gmail (dot) com Modified: head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1 head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.h Modified: head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1 ============================================================================== --- head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1 Tue Jan 10 13:41:14 2012 (r229932) +++ head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.1 Tue Jan 10 15:29:03 2012 (r229933) @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 17, 2007 +.Dd January 10, 2012 .Dt BSNMPGET 1 .Os .Sh NAME @@ -112,7 +112,7 @@ objects whose values will be retrived, w received successfully. .Pp .Nm Bsnmpwalk -queries an agent with SMNP GetNextRequest packets, +queries an agent with ether SMNP GetNextRequest or GetBulkRequest packets, asking for values of OID instances that are a part of the object subtree rooted at the provided OIDs. .Pp @@ -220,7 +220,7 @@ The path of the posix local (unix domain transport is used. .It Fl M Ar max-repetitions The value for the max-repetitions field in a GetBulk PDU. -Default is 1. +Default is 10. .It Fl N Ar non-repeaters The value for the non-repeaters field in a GetBulk PDU. Default is 0. @@ -251,8 +251,17 @@ A binary localized privacy key to use wh By default plain text SNMPv3 PDUs are sent. .It Fl p Ar [get|getnext|getbulk] The PDU type to send by -.Nm bsmpget . -Default is get. +.Nm bsmpget +and +.Nm bsnmpwalk . +Default is get +for +.Nm bsmpget +and getnext for +.Nm bsnmpwalk . +Getbulk allows executing the so called SNMP "bulkwalks" allowing the values of +multiple columns to be retrived in a single PDU by +.Nm bsnmpwalk . .It Fl r Ar retries Number of resends of request packets before giving up if the agent does not respond after the first try. Modified: head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c Tue Jan 10 13:41:14 2012 (r229932) +++ head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c Tue Jan 10 15:29:03 2012 (r229933) @@ -76,8 +76,9 @@ usage(void) (program == BSNMPWALK) ? "[-dhnK]" : (program == BSNMPSET) ? "[-adehnK]" : "", - (program == BSNMPGET) ? " [-M max-repetitions] [-N non-repeaters]" : "", - (program == BSNMPGET) ? "[-p pdu] " : "", + (program == BSNMPGET || program == BSNMPWALK) ? + " [-M max-repetitions] [-N non-repeaters]" : "", + (program == BSNMPGET || program == BSNMPWALK) ? "[-p pdu] " : "", (program == BSNMPGET) ? " OID [OID ...]" : (program == BSNMPWALK || program == BSNMPSET) ? " [OID ...]" : "" @@ -150,7 +151,7 @@ snmptool_parse_options(struct snmp_tooli switch (program) { case BSNMPWALK: - opts = "dhnKA:b:C:I:i:l:o:P:r:s:t:U:v:"; + opts = "dhnKA:b:C:I:i:l:M:N:o:P:p:r:s:t:U:v:"; break; case BSNMPGET: opts = "aDdehnKA:b:C:I:i:l:M:N:o:P:p:r:s:t:U:v:"; @@ -398,7 +399,7 @@ snmptool_get(struct snmp_toolinfo *snmpt } if (snmp_parse_resp(&resp, &req) >= 0) { - snmp_output_resp(snmptoolctx, &resp); + snmp_output_resp(snmptoolctx, &resp, NULL); break; } @@ -460,8 +461,14 @@ snmptool_walk(struct snmp_toolinfo *snmp struct snmp_pdu req, resp; struct asn_oid root; /* Keep the initial oid. */ int32_t outputs, rc; + uint32_t op; - snmp_pdu_create(&req, SNMP_PDU_GETNEXT); + if (GET_PDUTYPE(snmptoolctx) == SNMP_PDU_GETBULK) + op = SNMP_PDU_GETBULK; + else + op = SNMP_PDU_GETNEXT; + + snmp_pdu_create(&req, op); while ((rc = snmp_pdu_add_bindings(snmptoolctx, NULL, snmptool_add_vbind, &req, 1)) > 0) { @@ -470,6 +477,10 @@ snmptool_walk(struct snmp_toolinfo *snmp memset(&root, 0, sizeof(struct asn_oid)); asn_append_oid(&root, &(req.bindings[0].var)); + if (op == SNMP_PDU_GETBULK) + snmpget_fix_getbulk(&req, GET_MAXREP(snmptoolctx), + GET_NONREP(snmptoolctx)); + outputs = 0; while (snmp_dialog(&req, &resp) >= 0) { if ((snmp_parse_resp(&resp, &req)) < 0) { @@ -479,21 +490,24 @@ snmptool_walk(struct snmp_toolinfo *snmp break; } - if (!(asn_is_suboid(&root, &(resp.bindings[0].var)))) { - snmp_pdu_free(&resp); - break; - } - - if (snmp_output_resp(snmptoolctx, &resp)!= 0) { + rc = snmp_output_resp(snmptoolctx, &resp, &root); + if (rc < 0) { snmp_pdu_free(&resp); outputs = -1; break; } - outputs++; + + outputs += rc; snmp_pdu_free(&resp); - snmpwalk_nextpdu_create(SNMP_PDU_GETNEXT, - &(resp.bindings[0].var), &req); + if (rc < resp.nbindings) + break; + + snmpwalk_nextpdu_create(op, + &(resp.bindings[resp.nbindings - 1].var), &req); + if (op == SNMP_PDU_GETBULK) + snmpget_fix_getbulk(&req, GET_MAXREP(snmptoolctx), + GET_NONREP(snmptoolctx)); } /* Just in case our root was a leaf. */ @@ -503,7 +517,7 @@ snmptool_walk(struct snmp_toolinfo *snmp if (snmp_parse_resp(&resp,&req) < 0) snmp_output_err_resp(snmptoolctx, &resp); else - snmp_output_resp(snmptoolctx, &(resp)); + snmp_output_resp(snmptoolctx, &(resp), NULL); snmp_pdu_free(&resp); } else @@ -515,7 +529,7 @@ snmptool_walk(struct snmp_toolinfo *snmp break; } - snmp_pdu_create(&req, SNMP_PDU_GETNEXT); + snmp_pdu_create(&req, op); } if (rc == 0) @@ -1076,7 +1090,7 @@ snmptool_set(struct snmp_toolinfo *snmpt if (snmp_pdu_check(&req, &resp) > 0) { if (GET_OUTPUT(snmptoolctx) != OUTPUT_QUIET) - snmp_output_resp(snmptoolctx, &resp); + snmp_output_resp(snmptoolctx, &resp, NULL); break; } Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Tue Jan 10 13:41:14 2012 (r229932) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c Tue Jan 10 15:29:03 2012 (r229933) @@ -132,6 +132,7 @@ snmptool_init(struct snmp_toolinfo *snmp snmptoolctx->flags = SNMP_PDU_GET; /* XXX */ SLIST_INIT(&snmptoolctx->filelist); snmp_client_init(&snmp_client); + SET_MAXREP(snmptoolctx, SNMP_MAX_REPETITIONS); if (add_filename(snmptoolctx, bsnmpd_defs, &IsoOrgDod_OID, 0) < 0) warnx("Error adding file %s to list", bsnmpd_defs); @@ -2039,14 +2040,20 @@ snmp_output_err_resp(struct snmp_toolinf } int32_t -snmp_output_resp(struct snmp_toolinfo *snmptoolctx, struct snmp_pdu *pdu) +snmp_output_resp(struct snmp_toolinfo *snmptoolctx, struct snmp_pdu *pdu, + struct asn_oid *root) { int32_t error; char p[ASN_OIDSTRLEN]; uint32_t i; struct snmp_object object; - for (i = 0, error = 0; i < pdu->nbindings; i++) { + i = error = 0; + while (i < pdu->nbindings) { + if (root != NULL && !(asn_is_suboid(root, + &(pdu->bindings[i].var)))) + break; + if (GET_OUTPUT(snmptoolctx) != OUTPUT_QUIET) { if (!ISSET_NUMERIC(snmptoolctx) && (snmp_fill_object(snmptoolctx, &object, @@ -2058,9 +2065,13 @@ snmp_output_resp(struct snmp_toolinfo *s } } error |= snmp_output_numval(snmptoolctx, &(pdu->bindings[i]), object.info); + i++; } - return (error); + if (error) + return (-1); + + return (i); } void Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.h ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.h Tue Jan 10 13:41:14 2012 (r229932) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.h Tue Jan 10 15:29:03 2012 (r229933) @@ -47,6 +47,8 @@ #define SNMP_DEFS_DIR "/usr/share/snmp/defs/" #define SNMP_DEFAULT_LOCAL "/var/run/snmpd.sock" +#define SNMP_MAX_REPETITIONS 10 + enum snmp_access { SNMP_ACCESS_NONE = 0, SNMP_ACCESS_GET, @@ -323,7 +325,7 @@ int32_t snmp_parse_resp(struct snmp_pdu int32_t snmp_output_numval(struct snmp_toolinfo *, struct snmp_value *, struct snmp_oid2str *); void snmp_output_val(struct snmp_value *); -int32_t snmp_output_resp(struct snmp_toolinfo *, struct snmp_pdu *); +int32_t snmp_output_resp(struct snmp_toolinfo *, struct snmp_pdu *, struct asn_oid *); void snmp_output_err_resp(struct snmp_toolinfo *, struct snmp_pdu *); void snmp_output_engine(void); void snmp_output_keys(void); From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 15:58:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AD57106564A for ; Tue, 10 Jan 2012 15:58:38 +0000 (UTC) (envelope-from pfg@freebsd.org) Received: from nm24.bullet.mail.sp2.yahoo.com (nm24.bullet.mail.sp2.yahoo.com [98.139.91.94]) by mx1.freebsd.org (Postfix) with SMTP id 420FC8FC0C for ; Tue, 10 Jan 2012 15:58:38 +0000 (UTC) Received: from [98.139.91.64] by nm24.bullet.mail.sp2.yahoo.com with NNFMP; 10 Jan 2012 15:58:38 -0000 Received: from [98.139.91.11] by tm4.bullet.mail.sp2.yahoo.com with NNFMP; 10 Jan 2012 15:57:37 -0000 Received: from [127.0.0.1] by omp1011.mail.sp2.yahoo.com with NNFMP; 10 Jan 2012 15:57:37 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 959074.94792.bm@omp1011.mail.sp2.yahoo.com Received: (qmail 79374 invoked by uid 60001); 10 Jan 2012 15:57:37 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1326211057; bh=wvc17yvGAjl7JEtsA1CI7bzS4hpgvz1mZMuk7jQVKWI=; h=X-YMail-OSG:Received:X-RocketYMMF:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=hitaDtBsB54EDYdZhKSP6bCys9Y9Z9aTfE1Ca1cAYdCheqQOqDuzF5yJS/COcpiD4RNVW3dFrjE2DUCDevNXwz8rp7rwyaBEqSLCzzttE7w8ZUzmuVY4r7s542huVJ+WWq5H+zbvhqPqZmeGWjew6DxpbHrpc7z/44R+A5nYweI= X-YMail-OSG: FeF29KYVM1m5Zan7Opq52MU2P29M1mCPX9JyVGnmijme9kZ LhenMa_lEG1_j4Yd5AHfiZ1h9AiMlAem0vT67hUzc8WXe_41O2gUPELJW1PQ H8SZyT6R4ne.ILgyFWFr3XVO4vV3zT9HCZqHjErG41hXbm3wxcfADj.IhHEa MCM0GzNe6RUdMWRPet_mQG_o6lePPVtAG4OakjfDeXwKt0wlBjOEiQRtGzzu ruQzXoizOvUzP.kghcehPG_IeMFwYfJ._DKj5zONsnXSKDAxkok3Bi6DnyGG 7sOanQhidyjuUnbaifZmBlct6yhq13DF7JJnyneEi.vF7rAKgITXlKd.1vR_ YRpiW4fYbgz1mvCS2p5W6G_QJ8ph27QAQezIatM48ozDmBBOhS9GG66xCQi2 5dAoMplRLmqyaF.e_aAZ6S1mhbainSxTbG97R68Vwf_LFGuUiNRF0P7IC0Lz MZppkh1fvYrelG2s_EQ6NbVbFYG5t61MRCgx5__J1XkZvsXLTrt0txY5FVft Tu2J1rzqL90uWwCGSbg6VVWMVhSgB.mDM_CPo5ffL Received: from [200.118.157.7] by web113501.mail.gq1.yahoo.com via HTTP; Tue, 10 Jan 2012 07:57:37 PST X-RocketYMMF: giffunip X-Mailer: YahooMailClassic/15.0.4 YahooMailWebService/0.8.115.331698 Message-ID: <1326211057.75222.YahooMailClassic@web113501.mail.gq1.yahoo.com> Date: Tue, 10 Jan 2012 07:57:37 -0800 (PST) From: Pedro Giffuni To: Dimitry Andric In-Reply-To: <4F0BF1D3.7090902@FreeBSD.org> MIME-Version: 1.0 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 Subject: Re: svn commit: r229415 - head/lib/libvgl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pfg@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 15:58:38 -0000 =0AHello;=0A=0A--- Mar 10/1/12, Dimitry Andric ha scritto= :=0A=0A> Data: Marted=EC 10 gennaio 2012, 03:07=0A> On 2012-01-03 20:47, Pe= dro F. Giffuni=0A> wrote:=0A> > Author: pfg=0A> > Date: Tue Jan=A0 3 19:47:= 32 2012=0A> > New Revision: 229415=0A> > URL: http://svn.freebsd.org/change= set/base/229415=0A> >=0A> > Log:=0A> >=A0 =A0 Integrate the line drawing al= gorithm from=0A> the book "Graphic Gems 1".=0A> >=0A> >=A0 =A0 http://www.g= raphicsgems.org/=0A> >=0A> >=A0 =A0 At the time it claimed to be 3-4 times= =0A> faster than the traditional=0A> >=A0 =A0 algorithm.=0A> =0A> Btw, why = is this library in the base system at all?=A0=0A> It seems totally unused, = except for one picobsd=0A> Makefile?=0A> =0A=0AIt's a very FreeBSD-specific= library and it's the best=0Aexample on how to do low level screen manipula= tion.=0A=0AI think it was not meant to live for so long in the base=0Asyste= m but it's pretty small and specific so no one has=0Ataken the time to turn= it into a port. I think it is=0Astill used in some ports like libggi.=0A= =0Acheers,=0A=0APedro.=0A=0A From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 18:05:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 743ED106566B; Tue, 10 Jan 2012 18:05:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 638DB8FC1C; Tue, 10 Jan 2012 18:05: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 q0AI5iOn021663; Tue, 10 Jan 2012 18:05:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0AI5i24021661; Tue, 10 Jan 2012 18:05:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201101805.q0AI5i24021661@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 10 Jan 2012 18: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: r229934 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 18:05:44 -0000 Author: kib Date: Tue Jan 10 18:05:44 2012 New Revision: 229934 URL: http://svn.freebsd.org/changeset/base/229934 Log: Change the type of the paging_in_progress refcounter from u_short to u_int. With the auto-sized buffer cache on the modern machines, UFS metadata can generate more the 65535 pages belonging to the buffers undergoing i/o, overflowing the counter. Reported and tested by: jimharris Reviewed by: alc MFC after: 1 week Modified: head/sys/vm/vm_object.h Modified: head/sys/vm/vm_object.h ============================================================================== --- head/sys/vm/vm_object.h Tue Jan 10 15:29:03 2012 (r229933) +++ head/sys/vm/vm_object.h Tue Jan 10 18:05:44 2012 (r229934) @@ -96,7 +96,7 @@ struct vm_object { objtype_t type; /* type of pager */ u_short flags; /* see below */ u_short pg_color; /* (c) color of first page in obj */ - u_short paging_in_progress; /* Paging (in or out) so don't collapse or destroy */ + u_int paging_in_progress; /* Paging (in or out) so don't collapse or destroy */ int resident_page_count; /* number of resident pages */ struct vm_object *backing_object; /* object that I'm a shadow of */ vm_ooffset_t backing_object_offset;/* Offset in backing object */ From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 18:07:06 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02270106566C; Tue, 10 Jan 2012 18:07:06 +0000 (UTC) (envelope-from jmg@h2.funkthat.com) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) by mx1.freebsd.org (Postfix) with ESMTP id CA7DC8FC0A; Tue, 10 Jan 2012 18:07:05 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id q0AI73X8082213 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 10 Jan 2012 10:07:03 -0800 (PST) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id q0AI73D7082207; Tue, 10 Jan 2012 10:07:03 -0800 (PST) (envelope-from jmg) Date: Tue, 10 Jan 2012 10:07:03 -0800 From: John-Mark Gurney To: Eitan Adler Message-ID: <20120110180703.GF52468@funkthat.com> References: <201201031947.q03JlXnx039684@svn.freebsd.org> <20120110040219.GE52468@funkthat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Tue, 10 Jan 2012 10:07:03 -0800 (PST) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, "Pedro F. Giffuni" , src-committers@FreeBSD.org Subject: Re: svn commit: r229415 - head/lib/libvgl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 18:07:06 -0000 Eitan Adler wrote this message on Mon, Jan 09, 2012 at 23:48 -0500: > On Mon, Jan 9, 2012 at 11:02 PM, John-Mark Gurney wrote: > > Last time I did benchmarking on this ~10 years ago, it was slower to > > use xor instead of using assignments... > > I'd be shocked if the compiler didn't optimize this away to an XCHG. As someone else mentioned, it did... But it's still an obfuscation of the code... Not everyone knows this "trick" to swap two vars... If it isn't timing critical, it's better to be maintainable... Thanks. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 18:20:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 714BE106566C; Tue, 10 Jan 2012 18:20:19 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5FF758FC18; Tue, 10 Jan 2012 18:20:19 +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 q0AIKJgg022209; Tue, 10 Jan 2012 18:20:19 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0AIKJ8K022207; Tue, 10 Jan 2012 18:20:19 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201201101820.q0AIKJ8K022207@svn.freebsd.org> From: Jaakko Heinonen Date: Tue, 10 Jan 2012 18:20:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229935 - stable/9/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 18:20:19 -0000 Author: jh Date: Tue Jan 10 18:20:19 2012 New Revision: 229935 URL: http://svn.freebsd.org/changeset/base/229935 Log: MFC r228021: Add LINT-NOINET LINT-NOINET6 and LINT-NOIP to the make clean target. This was missed in r221353. Modified: stable/9/sys/conf/makeLINT.mk Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/conf/makeLINT.mk ============================================================================== --- stable/9/sys/conf/makeLINT.mk Tue Jan 10 18:05:44 2012 (r229934) +++ stable/9/sys/conf/makeLINT.mk Tue Jan 10 18:20:19 2012 (r229935) @@ -6,7 +6,7 @@ all: clean: rm -f LINT .if ${TARGET} == "amd64" || ${TARGET} == "i386" - rm -f LINT-VIMAGE + rm -f LINT-VIMAGE LINT-NOINET LINT-NOINET6 LINT-NOIP .endif NOTES= ../../conf/NOTES NOTES From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 18:43:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D0D81065670; Tue, 10 Jan 2012 18:43:27 +0000 (UTC) (envelope-from ghelmer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C5698FC0A; Tue, 10 Jan 2012 18:43:27 +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 q0AIhRTK022951; Tue, 10 Jan 2012 18:43:27 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0AIhRuM022949; Tue, 10 Jan 2012 18:43:27 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201201101843.q0AIhRuM022949@svn.freebsd.org> From: Guy Helmer Date: Tue, 10 Jan 2012 18:43:27 +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: r229936 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 18:43:27 -0000 Author: ghelmer Date: Tue Jan 10 18:43:27 2012 New Revision: 229936 URL: http://svn.freebsd.org/changeset/base/229936 Log: Set the FD_CLOEXEC flag on the open pidfile file descriptor. Discussed with: pjd, des Modified: head/lib/libutil/pidfile.c Modified: head/lib/libutil/pidfile.c ============================================================================== --- head/lib/libutil/pidfile.c Tue Jan 10 18:20:19 2012 (r229935) +++ head/lib/libutil/pidfile.c Tue Jan 10 18:43:27 2012 (r229936) @@ -137,6 +137,20 @@ pidfile_open(const char *path, mode_t mo free(pfh); return (NULL); } + + /* + * Prevent the file descriptor from escaping to other + * programs via exec(3). + */ + if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) { + error = errno; + unlink(pfh->pf_path); + close(fd); + free(pfh); + errno = error; + return (NULL); + } + /* * Remember file information, so in pidfile_write() we are sure we write * to the proper descriptor. From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 19:17:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3A3A106566C for ; Tue, 10 Jan 2012 19:17:38 +0000 (UTC) (envelope-from pfg@freebsd.org) Received: from nm11.bullet.mail.sp2.yahoo.com (nm11.bullet.mail.sp2.yahoo.com [98.139.91.81]) by mx1.freebsd.org (Postfix) with SMTP id CBE3C8FC12 for ; Tue, 10 Jan 2012 19:17:38 +0000 (UTC) Received: from [98.139.91.63] by nm11.bullet.mail.sp2.yahoo.com with NNFMP; 10 Jan 2012 19:17:28 -0000 Received: from [98.139.91.46] by tm3.bullet.mail.sp2.yahoo.com with NNFMP; 10 Jan 2012 19:16:28 -0000 Received: from [127.0.0.1] by omp1046.mail.sp2.yahoo.com with NNFMP; 10 Jan 2012 19:16:28 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 248735.37923.bm@omp1046.mail.sp2.yahoo.com Received: (qmail 9514 invoked by uid 60001); 10 Jan 2012 19:16:27 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1326222987; bh=OlDuVB4DVqxxYHVxFww5fQ922pS/zwF5N+jdEOYNW/E=; h=X-YMail-OSG:Received:X-RocketYMMF:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=MC+tfDEuVRDCsSauUo4jVBfuaOCLA0JigfllRleMVmsMFOGEEXFUcFotl0CPbbTSOxcglGB29LUjjW+MDHQZ6fDFC15nI0JykawCENPwEE3jSWynQpRmhr7LO/37GWLs7dadozOt8TEpAYEsux/ayGIdHKyp089MxH7c0Dchsqw= X-YMail-OSG: tvKQl7kVM1n3eoAFMcfUszNy8yim9lVUuLGUBCB287cuP6x t7tZuNJJOTpOxizSJcOX1o1YkaidcPv80WN4iHPtfQcGSbxPf8yIYhph9ZKr njb0w17HR2ilgIhfX40sU2mMw8_t8PPK4zug280xY_NiNmPyMMVg8AVeo72o bDeExCXCc0PIpIC3GM_f1T_toQ1dx9ViEFgR8AmJDSS5z5k_p1d1Q8q4D7yo bj7_z8D7_u9.FhvUfpyWzp5X2hDgZLF8feKl1ft.c3vMEJHuESbOl0RctU0T ak4dnMRrwpnb9c_1JEvVCjwtEOZvDbg1__zV4JTE001QDbK9Bua.9Njn2yls wAlg9.zWGSakq7L.emyOIYd7V_qqgjwLndVUZeEiFIrv3AnYeY7UOFISyKzA zO6pc0vSNCadvD8Ig52UrbblWHwZDp4kqR5w0C_8YFN_dp4MbbDqZP3FqMfT ox4db0bJgfYTmWFHOgopF9xI7Qw-- Received: from [200.118.157.7] by web113516.mail.gq1.yahoo.com via HTTP; Tue, 10 Jan 2012 11:16:27 PST X-RocketYMMF: giffunip X-Mailer: YahooMailClassic/15.0.4 YahooMailWebService/0.8.115.331698 Message-ID: <1326222987.8062.YahooMailClassic@web113516.mail.gq1.yahoo.com> Date: Tue, 10 Jan 2012 11:16:27 -0800 (PST) From: Pedro Giffuni To: Eitan Adler , John-Mark Gurney In-Reply-To: <20120110180703.GF52468@funkthat.com> MIME-Version: 1.0 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 Subject: Re: svn commit: r229415 - head/lib/libvgl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pfg@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 19:17:39 -0000 =0A=0A--- Mar 10/1/12, John-Mark Gurney ha scritto:=0A= =0A> Eitan Adler wrote this message on=0A> Mon, Jan 09, 2012 at 23:48 -0500= :=0A> > On Mon, Jan 9, 2012 at 11:02 PM, John-Mark Gurney=0A> =0A> wrote:=0A> > > Last time I did benchmarking on this ~10 years=0A>= > > ago, it was slower to use xor instead of=0A> > > using assignments...= =0A> > =0A> > I'd be shocked if the compiler didn't optimize this=0A> > awa= y to an XCHG.=0A> =0A> As someone else mentioned, it did...=A0 But it's sti= ll=0A> an obfuscation of the code...=A0 =0A> Not everyone knows this "trick= " to swap two vars...=0A> If it isn't timing critical, it's better to be=0A= > maintainable...=0A>=0A=0AThe code was taken from a book and it's pretty m= uch=0Aubiquitous as-is. If not everyone knows this "trick",=0Athen I guess = it simply proves that there is a lot of=0Avalue in reading books after all = ;-).=0A=0Acheers,=0A=0APedro.=0A From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 19:53:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 290A2106567C; Tue, 10 Jan 2012 19:53:26 +0000 (UTC) (envelope-from ghelmer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE0BD8FC1C; Tue, 10 Jan 2012 19:53: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 q0AJrPdT025102; Tue, 10 Jan 2012 19:53:25 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0AJrPao025097; Tue, 10 Jan 2012 19:53:25 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201201101953.q0AJrPao025097@svn.freebsd.org> From: Guy Helmer Date: Tue, 10 Jan 2012 19:53:25 +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: r229937 - in head/lib: libc/gen libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 19:53:26 -0000 Author: ghelmer Date: Tue Jan 10 19:53:25 2012 New Revision: 229937 URL: http://svn.freebsd.org/changeset/base/229937 Log: Add pidfile_fileno() to obtain the file descriptor for an open pidfile. Modified: head/lib/libc/gen/getnetgrent.c head/lib/libutil/libutil.h head/lib/libutil/pidfile.3 head/lib/libutil/pidfile.c Modified: head/lib/libc/gen/getnetgrent.c ============================================================================== --- head/lib/libc/gen/getnetgrent.c Tue Jan 10 18:43:27 2012 (r229936) +++ head/lib/libc/gen/getnetgrent.c Tue Jan 10 19:53:25 2012 (r229937) @@ -203,9 +203,7 @@ setnetgrent(const char *group) if (parse_netgrp(group)) endnetgrent(); else { - grouphead.grname = (char *) - malloc(strlen(group) + 1); - strcpy(grouphead.grname, group); + grouphead.grname = strdup(group); } if (netf) fclose(netf); @@ -417,7 +415,7 @@ static int parse_netgrp(const char *group) { char *spos, *epos; - int len, strpos; + int len, strpos, freepos; #ifdef DEBUG int fields; #endif @@ -454,9 +452,9 @@ parse_netgrp(const char *group) while (pos != NULL && *pos != '\0') { if (*pos == '(') { grp = (struct netgrp *)malloc(sizeof (struct netgrp)); + if (grp == NULL) + return(1); bzero((char *)grp, sizeof (struct netgrp)); - grp->ng_next = grouphead.gr; - grouphead.gr = grp; pos++; gpos = strsep(&pos, ")"); #ifdef DEBUG @@ -477,6 +475,13 @@ parse_netgrp(const char *group) if (len > 0) { grp->ng_str[strpos] = (char *) malloc(len + 1); + if (grp->ng_str[strpos] == NULL) { + for (freepos = 0; freepos < strpos; freepos++) + if (grp->ng_str[freepos] != NULL) + free(grp->ng_str[freepos]); + free(grp); + return(1); + } bcopy(spos, grp->ng_str[strpos], len + 1); } @@ -490,6 +495,8 @@ parse_netgrp(const char *group) grp->ng_str[strpos] = NULL; } } + grp->ng_next = grouphead.gr; + grouphead.gr = grp; #ifdef DEBUG /* * Note: on other platforms, malformed netgroup @@ -526,7 +533,7 @@ parse_netgrp(const char *group) static struct linelist * read_for_group(const char *group) { - char *pos, *spos, *linep, *olinep; + char *pos, *spos, *linep; int len, olen; int cont; struct linelist *lp; @@ -534,6 +541,7 @@ read_for_group(const char *group) #ifdef YP char *result; int resultlen; + linep = NULL; while (_netgr_yp_enabled || fgets(line, LINSIZ, netf) != NULL) { if (_netgr_yp_enabled) { @@ -554,6 +562,7 @@ read_for_group(const char *group) free(result); } #else + linep = NULL; while (fgets(line, LINSIZ, netf) != NULL) { #endif pos = (char *)&line; @@ -576,8 +585,14 @@ read_for_group(const char *group) pos++; if (*pos != '\n' && *pos != '\0') { lp = (struct linelist *)malloc(sizeof (*lp)); + if (lp == NULL) + return(NULL); lp->l_parsed = 0; lp->l_groupname = (char *)malloc(len + 1); + if (lp->l_groupname == NULL) { + free(lp); + return(NULL); + } bcopy(spos, lp->l_groupname, len); *(lp->l_groupname + len) = '\0'; len = strlen(pos); @@ -595,15 +610,15 @@ read_for_group(const char *group) } else cont = 0; if (len > 0) { - linep = (char *)malloc(olen + len + 1); - if (olen > 0) { - bcopy(olinep, linep, olen); - free(olinep); + linep = (char *)reallocf(linep, olen + len + 1); + if (linep == NULL) { + free(lp->l_groupname); + free(lp); + return(NULL); } bcopy(pos, linep + olen, len); olen += len; *(linep + olen) = '\0'; - olinep = linep; } if (cont) { if (fgets(line, LINSIZ, netf)) { @@ -634,5 +649,5 @@ read_for_group(const char *group) */ rewind(netf); #endif - return ((struct linelist *)0); + return (NULL); } Modified: head/lib/libutil/libutil.h ============================================================================== --- head/lib/libutil/libutil.h Tue Jan 10 18:43:27 2012 (r229936) +++ head/lib/libutil/libutil.h Tue Jan 10 19:53:25 2012 (r229937) @@ -170,6 +170,7 @@ struct pidfh *pidfile_open(const char *p int pidfile_write(struct pidfh *pfh); int pidfile_close(struct pidfh *pfh); int pidfile_remove(struct pidfh *pfh); +int pidfile_fileno(struct pidfh *pfh); #endif #ifdef _UFS_UFS_QUOTA_H_ Modified: head/lib/libutil/pidfile.3 ============================================================================== --- head/lib/libutil/pidfile.3 Tue Jan 10 18:43:27 2012 (r229936) +++ head/lib/libutil/pidfile.3 Tue Jan 10 19:53:25 2012 (r229937) @@ -46,6 +46,8 @@ .Fn pidfile_close "struct pidfh *pfh" .Ft int .Fn pidfile_remove "struct pidfh *pfh" +.Ft int +.Fn pidfile_fileno "struct pidfh *pfh" .Sh DESCRIPTION The .Nm pidfile @@ -92,6 +94,10 @@ to start a child process. The .Fn pidfile_remove function closes and removes a pidfile. +.Pp +The +.Fn pidfile_fileno +function returns the file descriptor for the open pid file. .Sh RETURN VALUES The .Fn pidfile_open @@ -105,15 +111,25 @@ If an error occurs, will be set. .Pp .Rv -std pidfile_write pidfile_close pidfile_remove +.Pp +The +.Fn pidfile_fileno +function returns the low-level file descriptor. +It returns -1 and sets +.Va errno +if a NULL +.Vt pidfh +is specified, or if the pidfile is no longer open. .Sh EXAMPLES The following example shows in which order these functions should be used. Note that it is safe to pass .Dv NULL to .Fn pidfile_write , -.Fn pidfile_remove -and +.Fn pidfile_remove , .Fn pidfile_close +and +.Fn pidfile_fileno functions. .Bd -literal struct pidfh *pfh; @@ -244,6 +260,16 @@ and system calls and the .Xr flopen 3 library function. +.Pp +The +.Fn pidfile_fileno +function will fail if: +.Bl -tag -width Er +.It Bq Er EDOOFUS +Improper function use. +Probably called not from the process which used +.Fn pidfile_open . +.El .Sh SEE ALSO .Xr open 2 , .Xr daemon 3 , Modified: head/lib/libutil/pidfile.c ============================================================================== --- head/lib/libutil/pidfile.c Tue Jan 10 18:43:27 2012 (r229936) +++ head/lib/libutil/pidfile.c Tue Jan 10 19:53:25 2012 (r229937) @@ -266,3 +266,13 @@ pidfile_remove(struct pidfh *pfh) return (_pidfile_remove(pfh, 1)); } + +int +pidfile_fileno(struct pidfh *pfh) +{ + if (pfh == NULL || pfh->pf_fd == -1) { + errno = EDOOFUS; + return (-1); + } + return (pfh->pf_fd); +} From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 19:54:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3702D1065670; Tue, 10 Jan 2012 19:54:54 +0000 (UTC) (envelope-from ghelmer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B2F58FC14; Tue, 10 Jan 2012 19:54: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 q0AJssaG025196; Tue, 10 Jan 2012 19:54:54 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0AJsrUY025194; Tue, 10 Jan 2012 19:54:53 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201201101954.q0AJsrUY025194@svn.freebsd.org> From: Guy Helmer Date: Tue, 10 Jan 2012 19:54:53 +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: r229938 - head/lib/libc/gen X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 19:54:54 -0000 Author: ghelmer Date: Tue Jan 10 19:54:53 2012 New Revision: 229938 URL: http://svn.freebsd.org/changeset/base/229938 Log: Revert unintentional commit of changes to getnetgrent.c. Modified: head/lib/libc/gen/getnetgrent.c Modified: head/lib/libc/gen/getnetgrent.c ============================================================================== --- head/lib/libc/gen/getnetgrent.c Tue Jan 10 19:53:25 2012 (r229937) +++ head/lib/libc/gen/getnetgrent.c Tue Jan 10 19:54:53 2012 (r229938) @@ -203,7 +203,9 @@ setnetgrent(const char *group) if (parse_netgrp(group)) endnetgrent(); else { - grouphead.grname = strdup(group); + grouphead.grname = (char *) + malloc(strlen(group) + 1); + strcpy(grouphead.grname, group); } if (netf) fclose(netf); @@ -415,7 +417,7 @@ static int parse_netgrp(const char *group) { char *spos, *epos; - int len, strpos, freepos; + int len, strpos; #ifdef DEBUG int fields; #endif @@ -452,9 +454,9 @@ parse_netgrp(const char *group) while (pos != NULL && *pos != '\0') { if (*pos == '(') { grp = (struct netgrp *)malloc(sizeof (struct netgrp)); - if (grp == NULL) - return(1); bzero((char *)grp, sizeof (struct netgrp)); + grp->ng_next = grouphead.gr; + grouphead.gr = grp; pos++; gpos = strsep(&pos, ")"); #ifdef DEBUG @@ -475,13 +477,6 @@ parse_netgrp(const char *group) if (len > 0) { grp->ng_str[strpos] = (char *) malloc(len + 1); - if (grp->ng_str[strpos] == NULL) { - for (freepos = 0; freepos < strpos; freepos++) - if (grp->ng_str[freepos] != NULL) - free(grp->ng_str[freepos]); - free(grp); - return(1); - } bcopy(spos, grp->ng_str[strpos], len + 1); } @@ -495,8 +490,6 @@ parse_netgrp(const char *group) grp->ng_str[strpos] = NULL; } } - grp->ng_next = grouphead.gr; - grouphead.gr = grp; #ifdef DEBUG /* * Note: on other platforms, malformed netgroup @@ -533,7 +526,7 @@ parse_netgrp(const char *group) static struct linelist * read_for_group(const char *group) { - char *pos, *spos, *linep; + char *pos, *spos, *linep, *olinep; int len, olen; int cont; struct linelist *lp; @@ -541,7 +534,6 @@ read_for_group(const char *group) #ifdef YP char *result; int resultlen; - linep = NULL; while (_netgr_yp_enabled || fgets(line, LINSIZ, netf) != NULL) { if (_netgr_yp_enabled) { @@ -562,7 +554,6 @@ read_for_group(const char *group) free(result); } #else - linep = NULL; while (fgets(line, LINSIZ, netf) != NULL) { #endif pos = (char *)&line; @@ -585,14 +576,8 @@ read_for_group(const char *group) pos++; if (*pos != '\n' && *pos != '\0') { lp = (struct linelist *)malloc(sizeof (*lp)); - if (lp == NULL) - return(NULL); lp->l_parsed = 0; lp->l_groupname = (char *)malloc(len + 1); - if (lp->l_groupname == NULL) { - free(lp); - return(NULL); - } bcopy(spos, lp->l_groupname, len); *(lp->l_groupname + len) = '\0'; len = strlen(pos); @@ -610,15 +595,15 @@ read_for_group(const char *group) } else cont = 0; if (len > 0) { - linep = (char *)reallocf(linep, olen + len + 1); - if (linep == NULL) { - free(lp->l_groupname); - free(lp); - return(NULL); + linep = (char *)malloc(olen + len + 1); + if (olen > 0) { + bcopy(olinep, linep, olen); + free(olinep); } bcopy(pos, linep + olen, len); olen += len; *(linep + olen) = '\0'; + olinep = linep; } if (cont) { if (fgets(line, LINSIZ, netf)) { @@ -649,5 +634,5 @@ read_for_group(const char *group) */ rewind(netf); #endif - return (NULL); + return ((struct linelist *)0); } From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 19:57:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5139F106566B; Tue, 10 Jan 2012 19:57:24 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3ED8B8FC0C; Tue, 10 Jan 2012 19:57: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 q0AJvOqw025344; Tue, 10 Jan 2012 19:57:24 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0AJvOZ5025332; Tue, 10 Jan 2012 19:57:24 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201201101957.q0AJvOZ5025332@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 10 Jan 2012 19:57: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: r229939 - in head/sys/dev: e1000 ixgbe netmap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 19:57:24 -0000 Author: luigi Date: Tue Jan 10 19:57:23 2012 New Revision: 229939 URL: http://svn.freebsd.org/changeset/base/229939 Log: small code cleanup in preparation for future modifications in the memory allocator used by netmap. No functional change, two small bug fixes: - in if_re.c add a missing bus_dmamap_sync() - in netmap.c comment out a spurious free() in an error handling block Modified: head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_igb.c head/sys/dev/e1000/if_lem.c head/sys/dev/ixgbe/ixgbe.c head/sys/dev/netmap/if_em_netmap.h head/sys/dev/netmap/if_igb_netmap.h head/sys/dev/netmap/if_lem_netmap.h head/sys/dev/netmap/if_re_netmap.h head/sys/dev/netmap/ixgbe_netmap.h head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_kern.h Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Tue Jan 10 19:54:53 2012 (r229938) +++ head/sys/dev/e1000/if_em.c Tue Jan 10 19:57:23 2012 (r229939) @@ -3297,16 +3297,15 @@ em_setup_transmit_ring(struct tx_ring *t #ifdef DEV_NETMAP if (slot) { int si = i + na->tx_rings[txr->me].nkr_hwofs; + uint64_t paddr; void *addr; if (si >= na->num_tx_desc) si -= na->num_tx_desc; - addr = NMB(slot + si); - txr->tx_base[i].buffer_addr = - htole64(vtophys(addr)); + addr = PNMB(slot + si, &paddr); + txr->tx_base[i].buffer_addr = htole64(paddr); /* reload the map for netmap mode */ - netmap_load_map(txr->txtag, - txbuf->map, addr, na->buff_size); + netmap_load_map(txr->txtag, txbuf->map, addr); } #endif /* DEV_NETMAP */ @@ -4104,9 +4103,6 @@ em_setup_receive_ring(struct rx_ring *rx sj += adapter->num_rx_desc; for (int j = 0; j != adapter->num_rx_desc; j++, sj++) { - void *addr; - int sz; - rxbuf = &rxr->rx_buffers[j]; /* no mbuf and regular mode -> skip this entry */ if (rxbuf->m_head == NULL && !slot) @@ -4115,12 +4111,20 @@ em_setup_receive_ring(struct rx_ring *rx if (sj >= adapter->num_rx_desc) sj -= adapter->num_rx_desc; /* see comment, set slot addr and map */ - addr = slot ? NMB(slot + sj) : rxbuf->m_head->m_data; - sz = slot ? na->buff_size : adapter->rx_mbuf_sz; - // XXX load or reload ? - netmap_load_map(rxr->rxtag, rxbuf->map, addr, sz); - /* Update descriptor */ - rxr->rx_base[j].buffer_addr = htole64(vtophys(addr)); + if (slot) { + uint64_t paddr; + void *addr = PNMB(slot + sj, &paddr); + netmap_load_map(rxr->rxtag, rxbuf->map, addr); + /* Update descriptor */ + rxr->rx_base[j].buffer_addr = htole64(paddr); + } else { + /* Get the memory mapping */ + bus_dmamap_load_mbuf_sg(rxr->rxtag, + rxbuf->map, rxbuf->m_head, seg, + &nsegs, BUS_DMA_NOWAIT); + /* Update descriptor */ + rxr->rx_base[j].buffer_addr = htole64(seg[0].ds_addr); + } bus_dmamap_sync(rxr->rxtag, rxbuf->map, BUS_DMASYNC_PREREAD); } } Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Tue Jan 10 19:54:53 2012 (r229938) +++ head/sys/dev/e1000/if_igb.c Tue Jan 10 19:57:23 2012 (r229939) @@ -3320,8 +3320,7 @@ igb_setup_transmit_ring(struct tx_ring * if (si < 0) si += na->num_tx_desc; - netmap_load_map(txr->txtag, txbuf->map, - NMB(slot + si), na->buff_size); + netmap_load_map(txr->txtag, txbuf->map, NMB(slot + si)); } #endif /* DEV_NETMAP */ /* clear the watch index */ @@ -4062,15 +4061,15 @@ igb_setup_receive_ring(struct rx_ring *r if (slot) { /* slot sj is mapped to the i-th NIC-ring entry */ int sj = j + na->rx_rings[rxr->me].nkr_hwofs; + uint64_t paddr; void *addr; if (sj < 0) sj += na->num_rx_desc; - addr = NMB(slot + sj); - netmap_load_map(rxr->ptag, - rxbuf->pmap, addr, na->buff_size); + addr = PNMB(slot + sj, &paddr); + netmap_load_map(rxr->ptag, rxbuf->pmap, addr); /* Update descriptor */ - rxr->rx_base[j].read.pkt_addr = htole64(vtophys(addr)); + rxr->rx_base[j].read.pkt_addr = htole64(paddr); continue; } #endif /* DEV_NETMAP */ Modified: head/sys/dev/e1000/if_lem.c ============================================================================== --- head/sys/dev/e1000/if_lem.c Tue Jan 10 19:54:53 2012 (r229938) +++ head/sys/dev/e1000/if_lem.c Tue Jan 10 19:57:23 2012 (r229939) @@ -2670,16 +2670,15 @@ lem_setup_transmit_structures(struct ada if (slot) { /* slot si is mapped to the i-th NIC-ring entry */ int si = i + na->tx_rings[0].nkr_hwofs; + uint64_t paddr; void *addr; if (si > na->num_tx_desc) si -= na->num_tx_desc; - addr = NMB(slot + si); - adapter->tx_desc_base[si].buffer_addr = - htole64(vtophys(addr)); + addr = PNMB(slot + si, &paddr); + adapter->tx_desc_base[si].buffer_addr = htole64(paddr); /* reload the map for netmap mode */ - netmap_load_map(adapter->txtag, - tx_buffer->map, addr, na->buff_size); + netmap_load_map(adapter->txtag, tx_buffer->map, addr); } #endif /* DEV_NETMAP */ tx_buffer->next_eop = -1; @@ -3247,16 +3246,15 @@ lem_setup_receive_structures(struct adap if (slot) { /* slot si is mapped to the i-th NIC-ring entry */ int si = i + na->rx_rings[0].nkr_hwofs; + uint64_t paddr; void *addr; if (si > na->num_rx_desc) si -= na->num_rx_desc; - addr = NMB(slot + si); - netmap_load_map(adapter->rxtag, - rx_buffer->map, addr, na->buff_size); + addr = PNMB(slot + si, &paddr); + netmap_load_map(adapter->rxtag, rx_buffer->map, addr); /* Update descriptor */ - adapter->rx_desc_base[i].buffer_addr = - htole64(vtophys(addr)); + adapter->rx_desc_base[i].buffer_addr = htole64(paddr); continue; } #endif /* DEV_NETMAP */ Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Tue Jan 10 19:54:53 2012 (r229938) +++ head/sys/dev/ixgbe/ixgbe.c Tue Jan 10 19:57:23 2012 (r229939) @@ -2876,8 +2876,7 @@ ixgbe_setup_transmit_ring(struct tx_ring if (si >= na->num_tx_desc) si -= na->num_tx_desc; - netmap_load_map(txr->txtag, txbuf->map, - NMB(slot + si), na->buff_size); + netmap_load_map(txr->txtag, txbuf->map, NMB(slot + si)); } #endif /* DEV_NETMAP */ /* Clear the EOP index */ @@ -3810,16 +3809,15 @@ ixgbe_setup_receive_ring(struct rx_ring */ if (slot) { int sj = j + na->rx_rings[rxr->me].nkr_hwofs; + uint64_t paddr; void *addr; if (sj >= na->num_rx_desc) sj -= na->num_rx_desc; - addr = NMB(slot + sj); - netmap_load_map(rxr->ptag, - rxbuf->pmap, addr, na->buff_size); + addr = PNMB(slot + sj, &paddr); + netmap_load_map(rxr->ptag, rxbuf->pmap, addr); /* Update descriptor */ - rxr->rx_base[j].read.pkt_addr = - htole64(vtophys(addr)); + rxr->rx_base[j].read.pkt_addr = htole64(paddr); continue; } #endif /* DEV_NETMAP */ Modified: head/sys/dev/netmap/if_em_netmap.h ============================================================================== --- head/sys/dev/netmap/if_em_netmap.h Tue Jan 10 19:54:53 2012 (r229938) +++ head/sys/dev/netmap/if_em_netmap.h Tue Jan 10 19:57:23 2012 (r229939) @@ -222,7 +222,8 @@ em_netmap_txsync(void *a, u_int ring_nr, int flags = ((slot->flags & NS_REPORT) || j == 0 || j == report_frequency) ? E1000_TXD_CMD_RS : 0; - void *addr = NMB(slot); + uint64_t paddr; + void *addr = PNMB(slot, &paddr); int len = slot->len; if (addr == netmap_buffer_base || len > NETMAP_BUF_SIZE) { if (do_lock) @@ -236,10 +237,9 @@ em_netmap_txsync(void *a, u_int ring_nr, htole32(adapter->txd_cmd | len | (E1000_TXD_CMD_EOP | flags) ); if (slot->flags & NS_BUF_CHANGED) { - curr->buffer_addr = htole64(vtophys(addr)); + curr->buffer_addr = htole64(paddr); /* buffer has changed, reload map */ - netmap_reload_map(txr->txtag, txbuf->map, - addr, na->buff_size); + netmap_reload_map(txr->txtag, txbuf->map, addr); slot->flags &= ~NS_BUF_CHANGED; } @@ -355,7 +355,8 @@ em_netmap_rxsync(void *a, u_int ring_nr, struct netmap_slot *slot = &ring->slot[j]; struct e1000_rx_desc *curr = &rxr->rx_base[l]; struct em_buffer *rxbuf = &rxr->rx_buffers[l]; - void *addr = NMB(slot); + uint64_t paddr; + void *addr = PNMB(slot, &paddr); if (addr == netmap_buffer_base) { /* bad buf */ if (do_lock) @@ -365,10 +366,9 @@ em_netmap_rxsync(void *a, u_int ring_nr, curr->status = 0; if (slot->flags & NS_BUF_CHANGED) { - curr->buffer_addr = htole64(vtophys(addr)); + curr->buffer_addr = htole64(paddr); /* buffer has changed, reload map */ - netmap_reload_map(rxr->rxtag, rxbuf->map, - addr, na->buff_size); + netmap_reload_map(rxr->rxtag, rxbuf->map, addr); slot->flags &= ~NS_BUF_CHANGED; } Modified: head/sys/dev/netmap/if_igb_netmap.h ============================================================================== --- head/sys/dev/netmap/if_igb_netmap.h Tue Jan 10 19:54:53 2012 (r229938) +++ head/sys/dev/netmap/if_igb_netmap.h Tue Jan 10 19:57:23 2012 (r229939) @@ -181,7 +181,8 @@ igb_netmap_txsync(void *a, u_int ring_nr struct igb_tx_buffer *txbuf = &txr->tx_buffers[l]; union e1000_adv_tx_desc *curr = (union e1000_adv_tx_desc *)&txr->tx_base[l]; - void *addr = NMB(slot); + uint64_t paddr; + void *addr = PNMB(slot, &paddr); int flags = ((slot->flags & NS_REPORT) || j == 0 || j == report_frequency) ? E1000_ADVTXD_DCMD_RS : 0; @@ -195,7 +196,7 @@ igb_netmap_txsync(void *a, u_int ring_nr slot->flags &= ~NS_REPORT; // XXX do we need to set the address ? - curr->read.buffer_addr = htole64(vtophys(addr)); + curr->read.buffer_addr = htole64(paddr); curr->read.olinfo_status = htole32(olinfo_status | (len<< E1000_ADVTXD_PAYLEN_SHIFT)); @@ -206,8 +207,7 @@ igb_netmap_txsync(void *a, u_int ring_nr E1000_ADVTXD_DCMD_EOP | flags); if (slot->flags & NS_BUF_CHANGED) { /* buffer has changed, reload map */ - netmap_reload_map(txr->txtag, txbuf->map, - addr, na->buff_size); + netmap_reload_map(txr->txtag, txbuf->map, addr); slot->flags &= ~NS_BUF_CHANGED; } @@ -317,7 +317,8 @@ igb_netmap_rxsync(void *a, u_int ring_nr struct netmap_slot *slot = ring->slot + j; union e1000_adv_rx_desc *curr = &rxr->rx_base[l]; struct igb_rx_buf *rxbuf = rxr->rx_buffers + l; - void *addr = NMB(slot); + uint64_t paddr; + void *addr = PNMB(slot, &paddr); if (addr == netmap_buffer_base) { /* bad buf */ if (do_lock) @@ -326,10 +327,9 @@ igb_netmap_rxsync(void *a, u_int ring_nr } curr->wb.upper.status_error = 0; - curr->read.pkt_addr = htole64(vtophys(addr)); + curr->read.pkt_addr = htole64(paddr); if (slot->flags & NS_BUF_CHANGED) { - netmap_reload_map(rxr->ptag, rxbuf->pmap, - addr, na->buff_size); + netmap_reload_map(rxr->ptag, rxbuf->pmap, addr); slot->flags &= ~NS_BUF_CHANGED; } Modified: head/sys/dev/netmap/if_lem_netmap.h ============================================================================== --- head/sys/dev/netmap/if_lem_netmap.h Tue Jan 10 19:54:53 2012 (r229938) +++ head/sys/dev/netmap/if_lem_netmap.h Tue Jan 10 19:57:23 2012 (r229939) @@ -186,7 +186,8 @@ lem_netmap_txsync(void *a, u_int ring_nr struct netmap_slot *slot = &ring->slot[j]; struct e1000_tx_desc *curr = &adapter->tx_desc_base[l]; struct em_buffer *txbuf = &adapter->tx_buffer_area[l]; - void *addr = NMB(slot); + uint64_t paddr; + void *addr = PNMB(slot, &paddr); int flags = ((slot->flags & NS_REPORT) || j == 0 || j == report_frequency) ? E1000_TXD_CMD_RS : 0; @@ -204,10 +205,9 @@ lem_netmap_txsync(void *a, u_int ring_nr htole32( adapter->txd_cmd | len | (E1000_TXD_CMD_EOP | flags) ); if (slot->flags & NS_BUF_CHANGED) { - curr->buffer_addr = htole64(vtophys(addr)); + curr->buffer_addr = htole64(paddr); /* buffer has changed, reload map */ - netmap_reload_map(adapter->txtag, txbuf->map, - addr, na->buff_size); + netmap_reload_map(adapter->txtag, txbuf->map, addr); slot->flags &= ~NS_BUF_CHANGED; } @@ -314,7 +314,8 @@ lem_netmap_rxsync(void *a, u_int ring_nr struct netmap_slot *slot = &ring->slot[j]; struct e1000_rx_desc *curr = &adapter->rx_desc_base[l]; struct em_buffer *rxbuf = &adapter->rx_buffer_area[l]; - void *addr = NMB(slot); + uint64_t paddr; + void *addr = PNMB(slot, &paddr); if (addr == netmap_buffer_base) { /* bad buf */ if (do_lock) @@ -323,10 +324,9 @@ lem_netmap_rxsync(void *a, u_int ring_nr } curr->status = 0; if (slot->flags & NS_BUF_CHANGED) { - curr->buffer_addr = htole64(vtophys(addr)); + curr->buffer_addr = htole64(paddr); /* buffer has changed, and reload map */ - netmap_reload_map(adapter->rxtag, rxbuf->map, - addr, na->buff_size); + netmap_reload_map(adapter->rxtag, rxbuf->map, addr); slot->flags &= ~NS_BUF_CHANGED; } Modified: head/sys/dev/netmap/if_re_netmap.h ============================================================================== --- head/sys/dev/netmap/if_re_netmap.h Tue Jan 10 19:54:53 2012 (r229938) +++ head/sys/dev/netmap/if_re_netmap.h Tue Jan 10 19:57:23 2012 (r229939) @@ -183,7 +183,8 @@ re_netmap_txsync(void *a, u_int ring_nr, struct rl_desc *desc = &sc->rl_ldata.rl_tx_list[l]; int cmd = slot->len | RL_TDESC_CMD_EOF | RL_TDESC_CMD_OWN | RL_TDESC_CMD_SOF ; - void *addr = NMB(slot); + uint64_t paddr; + void *addr = PNMB(slot, &paddr); int len = slot->len; if (addr == netmap_buffer_base || len > NETMAP_BUF_SIZE) { @@ -197,12 +198,11 @@ re_netmap_txsync(void *a, u_int ring_nr, cmd |= RL_TDESC_CMD_EOR; if (slot->flags & NS_BUF_CHANGED) { - uint64_t paddr = vtophys(addr); desc->rl_bufaddr_lo = htole32(RL_ADDR_LO(paddr)); desc->rl_bufaddr_hi = htole32(RL_ADDR_HI(paddr)); /* buffer has changed, unload and reload map */ netmap_reload_map(sc->rl_ldata.rl_tx_mtag, - txd[l].tx_dmamap, addr, na->buff_size); + txd[l].tx_dmamap, addr); slot->flags &= ~NS_BUF_CHANGED; } slot->flags &= ~NS_REPORT; @@ -304,7 +304,8 @@ re_netmap_rxsync(void *a, u_int ring_nr, struct netmap_slot *slot = ring->slot + j; struct rl_desc *desc = &sc->rl_ldata.rl_rx_list[l]; int cmd = na->buff_size | RL_RDESC_CMD_OWN; - void *addr = NMB(slot); + uint64_t paddr; + void *addr = PNMB(slot, &paddr); if (addr == netmap_buffer_base) { /* bad buf */ if (do_lock) @@ -318,11 +319,10 @@ re_netmap_rxsync(void *a, u_int ring_nr, desc->rl_cmdstat = htole32(cmd); slot->flags &= ~NS_REPORT; if (slot->flags & NS_BUF_CHANGED) { - uint64_t paddr = vtophys(addr); desc->rl_bufaddr_lo = htole32(RL_ADDR_LO(paddr)); desc->rl_bufaddr_hi = htole32(RL_ADDR_HI(paddr)); netmap_reload_map(sc->rl_ldata.rl_rx_mtag, - rxd[l].rx_dmamap, addr, na->buff_size); + rxd[l].rx_dmamap, addr); slot->flags &= ~NS_BUF_CHANGED; } bus_dmamap_sync(sc->rl_ldata.rl_rx_mtag, @@ -377,12 +377,11 @@ re_netmap_tx_init(struct rl_softc *sc) if (l >= n) l -= n; - addr = NMB(slot + l); - paddr = vtophys(addr); + addr = PNMB(slot + l, &paddr); desc[i].rl_bufaddr_lo = htole32(RL_ADDR_LO(paddr)); desc[i].rl_bufaddr_hi = htole32(RL_ADDR_HI(paddr)); netmap_load_map(sc->rl_ldata.rl_tx_mtag, - txd[i].tx_dmamap, addr, na->buff_size); + txd[i].tx_dmamap, addr); } } @@ -407,8 +406,12 @@ re_netmap_rx_init(struct rl_softc *sc) if (l >= n) l -= n; - addr = NMB(slot + l); - paddr = vtophys(addr); + addr = PNMB(slot + l, &paddr); + + netmap_reload_map(sc->rl_ldata.rl_rx_mtag, + sc->rl_ldata.rl_rx_desc[i].rx_dmamap, addr); + bus_dmamap_sync(sc->rl_ldata.rl_rx_mtag, + sc->rl_ldata.rl_rx_desc[i].rx_dmamap, BUS_DMASYNC_PREREAD); desc[i].rl_bufaddr_lo = htole32(RL_ADDR_LO(paddr)); desc[i].rl_bufaddr_hi = htole32(RL_ADDR_HI(paddr)); cmdstat = na->buff_size; @@ -422,9 +425,5 @@ re_netmap_rx_init(struct rl_softc *sc) if (i < n - 1 - kring->nr_hwavail) // XXX + 1 ? cmdstat |= RL_RDESC_CMD_OWN; desc[i].rl_cmdstat = htole32(cmdstat); - - netmap_reload_map(sc->rl_ldata.rl_rx_mtag, - sc->rl_ldata.rl_rx_desc[i].rx_dmamap, - addr, na->buff_size); } } Modified: head/sys/dev/netmap/ixgbe_netmap.h ============================================================================== --- head/sys/dev/netmap/ixgbe_netmap.h Tue Jan 10 19:54:53 2012 (r229938) +++ head/sys/dev/netmap/ixgbe_netmap.h Tue Jan 10 19:57:23 2012 (r229939) @@ -253,7 +253,7 @@ ixgbe_netmap_txsync(void *a, u_int ring_ * Note that txbuf and curr are indexed by l. * * In this driver we collect the buffer address - * (using the NMB() macro) because we always + * (using the PNMB() macro) because we always * need to rewrite it into the NIC ring. * Many other drivers preserve the address, so * we only need to access it if NS_BUF_CHANGED @@ -262,7 +262,8 @@ ixgbe_netmap_txsync(void *a, u_int ring_ struct netmap_slot *slot = &ring->slot[j]; struct ixgbe_tx_buf *txbuf = &txr->tx_buffers[l]; union ixgbe_adv_tx_desc *curr = &txr->tx_base[l]; - void *addr = NMB(slot); + uint64_t paddr; + void *addr = PNMB(slot, &paddr); // XXX type for flags and len ? int flags = ((slot->flags & NS_REPORT) || j == 0 || j == report_frequency) ? @@ -290,7 +291,7 @@ ring_reset: * address in the NIC ring. Other drivers do not * need this. */ - curr->read.buffer_addr = htole64(vtophys(addr)); + curr->read.buffer_addr = htole64(paddr); curr->read.olinfo_status = 0; curr->read.cmd_type_len = htole32(txr->txd_cmd | len | @@ -303,8 +304,7 @@ ring_reset: */ if (slot->flags & NS_BUF_CHANGED) { /* buffer has changed, unload and reload map */ - netmap_reload_map(txr->txtag, txbuf->map, - addr, na->buff_size); + netmap_reload_map(txr->txtag, txbuf->map, addr); slot->flags &= ~NS_BUF_CHANGED; } @@ -479,16 +479,16 @@ ixgbe_netmap_rxsync(void *a, u_int ring_ struct netmap_slot *slot = &ring->slot[j]; union ixgbe_adv_rx_desc *curr = &rxr->rx_base[l]; struct ixgbe_rx_buf *rxbuf = &rxr->rx_buffers[l]; - void *addr = NMB(slot); + uint64_t paddr; + void *addr = PNMB(slot, &paddr); if (addr == netmap_buffer_base) /* bad buf */ goto ring_reset; curr->wb.upper.status_error = 0; - curr->read.pkt_addr = htole64(vtophys(addr)); + curr->read.pkt_addr = htole64(paddr); if (slot->flags & NS_BUF_CHANGED) { - netmap_reload_map(rxr->ptag, rxbuf->pmap, - addr, na->buff_size); + netmap_reload_map(rxr->ptag, rxbuf->pmap, addr); slot->flags &= ~NS_BUF_CHANGED; } Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Tue Jan 10 19:54:53 2012 (r229938) +++ head/sys/dev/netmap/netmap.c Tue Jan 10 19:57:23 2012 (r229939) @@ -104,6 +104,13 @@ MALLOC_DEFINE(M_NETMAP, "netmap", "Netwo static void * netmap_malloc(size_t size, const char *msg); static void netmap_free(void *addr, const char *msg); +#define netmap_if_malloc(len) netmap_malloc(len, "nifp") +#define netmap_if_free(v) netmap_free((v), "nifp") + +#define netmap_ring_malloc(len) netmap_malloc(len, "ring") +#define netmap_free_rings(na) \ + netmap_free((na)->tx_rings[0].ring, "shadow rings"); + /* * Allocator for a pool of packet buffers. For each buffer we have * one entry in the bitmap to signal the state. Allocation scans @@ -123,7 +130,7 @@ struct netmap_buf_pool { struct netmap_buf_pool nm_buf_pool; /* XXX move these two vars back into netmap_buf_pool */ u_int netmap_total_buffers; -char *netmap_buffer_base; +char *netmap_buffer_base; /* address of an invalid buffer */ /* user-controlled variables */ int netmap_verbose; @@ -233,6 +240,12 @@ struct netmap_priv_d { uint16_t np_txpoll; }; +/* Shorthand to compute a netmap interface offset. */ +#define netmap_if_offset(v) \ + ((char *) (v) - (char *) netmap_mem_d->nm_buffer) +/* .. and get a physical address given a memory offset */ +#define netmap_ofstophys(o) \ + (vtophys(netmap_mem_d->nm_buffer) + (o)) static struct cdev *netmap_dev; /* /dev/netmap character device. */ static struct netmap_mem_d *netmap_mem_d; /* Our memory allocator. */ @@ -397,10 +410,10 @@ netmap_dtor(void *data) ring->slot[j].buf_idx); } NMA_UNLOCK(); - netmap_free(na->tx_rings[0].ring, "shadow rings"); + netmap_free_rings(na); wakeup(na); } - netmap_free(nifp, "nifp"); + netmap_if_free(nifp); na->nm_lock(ifp->if_softc, NETMAP_CORE_UNLOCK, 0); @@ -432,7 +445,7 @@ netmap_if_new(const char *ifname, struct * to the tx and rx rings in the shared memory region. */ len = sizeof(struct netmap_if) + 2 * n * sizeof(ssize_t); - nifp = netmap_malloc(len, "nifp"); + nifp = netmap_if_malloc(len); if (nifp == NULL) return (NULL); @@ -455,13 +468,13 @@ netmap_if_new(const char *ifname, struct len = n * (2 * sizeof(struct netmap_ring) + (na->num_tx_desc + na->num_rx_desc) * sizeof(struct netmap_slot) ); - buff = netmap_malloc(len, "shadow rings"); + buff = netmap_ring_malloc(len); if (buff == NULL) { D("failed to allocate %d bytes for %s shadow ring", len, ifname); error: (na->refcount)--; - netmap_free(nifp, "nifp, rings failed"); + netmap_if_free(nifp); return (NULL); } /* do we have the bufers ? we are in need of num_tx_desc buffers for @@ -907,11 +920,12 @@ netmap_ioctl(__unused struct cdev *dev, /* * do something similar to netmap_dtor(). */ - netmap_free(na->tx_rings[0].ring, "rings, reg.failed"); - free(na->tx_rings, M_DEVBUF); + netmap_free_rings(na); + // XXX tx_rings is inline, must not be freed. + // free(na->tx_rings, M_DEVBUF); // XXX wrong ? na->tx_rings = na->rx_rings = NULL; na->refcount--; - netmap_free(nifp, "nifp, rings failed"); + netmap_if_free(nifp); nifp = NULL; } } @@ -1388,22 +1402,18 @@ ns_dmamap_cb(__unused void *arg, __unuse * XXX buflen is probably not needed, buffers have constant size. */ void -netmap_reload_map(bus_dma_tag_t tag, bus_dmamap_t map, - void *buf, bus_size_t buflen) +netmap_reload_map(bus_dma_tag_t tag, bus_dmamap_t map, void *buf) { - bus_addr_t paddr; bus_dmamap_unload(tag, map); - bus_dmamap_load(tag, map, buf, buflen, ns_dmamap_cb, &paddr, - BUS_DMA_NOWAIT); + bus_dmamap_load(tag, map, buf, NETMAP_BUF_SIZE, ns_dmamap_cb, + NULL, BUS_DMA_NOWAIT); } void -netmap_load_map(bus_dma_tag_t tag, bus_dmamap_t map, - void *buf, bus_size_t buflen) +netmap_load_map(bus_dma_tag_t tag, bus_dmamap_t map, void *buf) { - bus_addr_t paddr; - bus_dmamap_load(tag, map, buf, buflen, ns_dmamap_cb, &paddr, - BUS_DMA_NOWAIT); + bus_dmamap_load(tag, map, buf, NETMAP_BUF_SIZE, ns_dmamap_cb, + NULL, BUS_DMA_NOWAIT); } /*------ netmap memory allocator -------*/ Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Tue Jan 10 19:54:53 2012 (r229938) +++ head/sys/dev/netmap/netmap_kern.h Tue Jan 10 19:57:23 2012 (r229939) @@ -169,10 +169,8 @@ int netmap_start(struct ifnet *, struct enum txrx { NR_RX = 0, NR_TX = 1 }; struct netmap_slot *netmap_reset(struct netmap_adapter *na, enum txrx tx, int n, u_int new_cur); -void netmap_load_map(bus_dma_tag_t tag, bus_dmamap_t map, - void *buf, bus_size_t buflen); -void netmap_reload_map(bus_dma_tag_t tag, bus_dmamap_t map, - void *buf, bus_size_t buflen); +void netmap_load_map(bus_dma_tag_t tag, bus_dmamap_t map, void *buf); +void netmap_reload_map(bus_dma_tag_t tag, bus_dmamap_t map, void *buf); int netmap_ring_reinit(struct netmap_kring *); /* @@ -206,11 +204,11 @@ enum { /* - * return the address of a buffer. + * NMB return the virtual address of a buffer (buffer 0 on bad index) + * PNMB also fills the physical address * XXX this is a special version with hardwired 2k bufs - * On error return netmap_buffer_base which is detected as a bad pointer. */ -static inline char * +static inline void * NMB(struct netmap_slot *slot) { uint32_t i = slot->buf_idx; @@ -222,4 +220,18 @@ NMB(struct netmap_slot *slot) #endif } +static inline void * +PNMB(struct netmap_slot *slot, uint64_t *pp) +{ + uint32_t i = slot->buf_idx; + void *ret = (i >= netmap_total_buffers) ? netmap_buffer_base : +#if NETMAP_BUF_SIZE == 2048 + netmap_buffer_base + (i << 11); +#else + netmap_buffer_base + (i *NETMAP_BUF_SIZE); +#endif + *pp = vtophys(ret); + return ret; +} + #endif /* _NET_NETMAP_KERN_H_ */ From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 20:52:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 416021065672; Tue, 10 Jan 2012 20:52:03 +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 2FBAA8FC13; Tue, 10 Jan 2012 20:52:03 +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 q0AKq3gO027118; Tue, 10 Jan 2012 20:52:03 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0AKq3Ic027116; Tue, 10 Jan 2012 20:52:03 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201201102052.q0AKq3Ic027116@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 10 Jan 2012 20:52:03 +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: r229940 - head/sys/dev/et X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 20:52:03 -0000 Author: yongari Date: Tue Jan 10 20:52:02 2012 New Revision: 229940 URL: http://svn.freebsd.org/changeset/base/229940 Log: style. No functional changes. Modified: head/sys/dev/et/if_et.c Modified: head/sys/dev/et/if_et.c ============================================================================== --- head/sys/dev/et/if_et.c Tue Jan 10 19:57:23 2012 (r229939) +++ head/sys/dev/et/if_et.c Tue Jan 10 20:52:02 2012 (r229940) @@ -363,8 +363,9 @@ fail: static int et_detach(device_t dev) { - struct et_softc *sc = device_get_softc(dev); + struct et_softc *sc; + sc = device_get_softc(dev); if (device_is_attached(dev)) { ether_ifdetach(sc->ifp); ET_LOCK(sc); @@ -401,8 +402,9 @@ et_detach(device_t dev) static int et_shutdown(device_t dev) { - struct et_softc *sc = device_get_softc(dev); + struct et_softc *sc; + sc = device_get_softc(dev); ET_LOCK(sc); et_stop(sc); ET_UNLOCK(sc); @@ -412,10 +414,11 @@ et_shutdown(device_t dev) static int et_miibus_readreg(device_t dev, int phy, int reg) { - struct et_softc *sc = device_get_softc(dev); + struct et_softc *sc; uint32_t val; int i, ret; + sc = device_get_softc(dev); /* Stop any pending operations */ CSR_WRITE_4(sc, ET_MII_CMD, 0); @@ -455,10 +458,11 @@ back: static int et_miibus_writereg(device_t dev, int phy, int reg, int val0) { - struct et_softc *sc = device_get_softc(dev); + struct et_softc *sc; uint32_t val; int i; + sc = device_get_softc(dev); /* Stop any pending operations */ CSR_WRITE_4(sc, ET_MII_CMD, 0); @@ -593,10 +597,12 @@ et_miibus_statchg(device_t dev) static int et_ifmedia_upd_locked(struct ifnet *ifp) { - struct et_softc *sc = ifp->if_softc; - struct mii_data *mii = device_get_softc(sc->sc_miibus); + struct et_softc *sc; + struct mii_data *mii; struct mii_softc *miisc; + sc = ifp->if_softc; + mii = device_get_softc(sc->sc_miibus); LIST_FOREACH(miisc, &mii->mii_phys, mii_list) PHY_RESET(miisc); return (mii_mediachg(mii)); @@ -605,9 +611,10 @@ et_ifmedia_upd_locked(struct ifnet *ifp) static int et_ifmedia_upd(struct ifnet *ifp) { - struct et_softc *sc = ifp->if_softc; + struct et_softc *sc; int res; + sc = ifp->if_softc; ET_LOCK(sc); res = et_ifmedia_upd_locked(ifp); ET_UNLOCK(sc); @@ -638,10 +645,11 @@ et_ifmedia_sts(struct ifnet *ifp, struct static void et_stop(struct et_softc *sc) { - struct ifnet *ifp = sc->ifp; + struct ifnet *ifp; ET_LOCK_ASSERT(sc); + ifp = sc->ifp; callout_stop(&sc->sc_tick); /* Disable interrupts. */ CSR_WRITE_4(sc, ET_INTR_MASK, 0xffffffff); @@ -757,6 +765,7 @@ et_get_eaddr(device_t dev, uint8_t eaddr static void et_reset(struct et_softc *sc) { + CSR_WRITE_4(sc, ET_MAC_CFG1, ET_MAC_CFG1_RST_TXFUNC | ET_MAC_CFG1_RST_RXFUNC | ET_MAC_CFG1_RST_TXMC | ET_MAC_CFG1_RST_RXMC | @@ -1163,10 +1172,11 @@ et_chip_attach(struct et_softc *sc) static void et_intr(void *xsc) { - struct et_softc *sc = xsc; + struct et_softc *sc; struct ifnet *ifp; uint32_t status; + sc = xsc; ET_LOCK(sc); ifp = sc->ifp; if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) @@ -1268,10 +1278,14 @@ et_init(void *xsc) static int et_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) { - struct et_softc *sc = ifp->if_softc; - struct mii_data *mii = device_get_softc(sc->sc_miibus); - struct ifreq *ifr = (struct ifreq *)data; - int error = 0, mask, max_framelen; + struct et_softc *sc; + struct mii_data *mii; + struct ifreq *ifr; + int error, mask, max_framelen; + + sc = ifp->if_softc; + ifr = (struct ifreq *)data; + error = 0; /* XXX LOCKSUSED */ switch (cmd) { @@ -1295,6 +1309,7 @@ et_ioctl(struct ifnet *ifp, u_long cmd, case SIOCSIFMEDIA: case SIOCGIFMEDIA: + mii = device_get_softc(sc->sc_miibus); error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, cmd); break; @@ -1424,8 +1439,9 @@ et_start_locked(struct ifnet *ifp) static void et_start(struct ifnet *ifp) { - struct et_softc *sc = ifp->if_softc; + struct et_softc *sc; + sc = ifp->if_softc; ET_LOCK(sc); et_start_locked(ifp); ET_UNLOCK(sc); @@ -1456,6 +1472,7 @@ et_watchdog(struct et_softc *sc) static int et_stop_rxdma(struct et_softc *sc) { + CSR_WRITE_4(sc, ET_RXDMA_CTRL, ET_RXDMA_CTRL_HALT | ET_RXDMA_CTRL_RING1_ENABLE); @@ -1470,6 +1487,7 @@ et_stop_rxdma(struct et_softc *sc) static int et_stop_txdma(struct et_softc *sc) { + CSR_WRITE_4(sc, ET_TXDMA_CTRL, ET_TXDMA_CTRL_HALT | ET_TXDMA_CTRL_SINGLE_EPKT); return (0); @@ -1598,10 +1616,11 @@ back: static int et_chip_init(struct et_softc *sc) { - struct ifnet *ifp = sc->ifp; + struct ifnet *ifp; uint32_t rxq_end; int error, frame_len, rxmem_size; + ifp = sc->ifp; /* * Split 16Kbytes internal memory between TX and RX * according to frame length. @@ -1716,8 +1735,8 @@ et_init_rx_ring(struct et_softc *sc) static int et_init_rxdma(struct et_softc *sc) { - struct et_rxstatus_data *rxsd = &sc->sc_rx_status; - struct et_rxstat_ring *rxst_ring = &sc->sc_rxstat_ring; + struct et_rxstatus_data *rxsd; + struct et_rxstat_ring *rxst_ring; struct et_rxdesc_ring *rx_ring; int error; @@ -1730,12 +1749,14 @@ et_init_rxdma(struct et_softc *sc) /* * Install RX status */ + rxsd = &sc->sc_rx_status; CSR_WRITE_4(sc, ET_RX_STATUS_HI, ET_ADDR_HI(rxsd->rxsd_paddr)); CSR_WRITE_4(sc, ET_RX_STATUS_LO, ET_ADDR_LO(rxsd->rxsd_paddr)); /* * Install RX stat ring */ + rxst_ring = &sc->sc_rxstat_ring; CSR_WRITE_4(sc, ET_RXSTAT_HI, ET_ADDR_HI(rxst_ring->rsr_paddr)); CSR_WRITE_4(sc, ET_RXSTAT_LO, ET_ADDR_LO(rxst_ring->rsr_paddr)); CSR_WRITE_4(sc, ET_RXSTAT_CNT, ET_RX_NSTAT - 1); @@ -1786,8 +1807,8 @@ et_init_rxdma(struct et_softc *sc) static int et_init_txdma(struct et_softc *sc) { - struct et_txdesc_ring *tx_ring = &sc->sc_tx_ring; - struct et_txstatus_data *txsd = &sc->sc_tx_status; + struct et_txdesc_ring *tx_ring; + struct et_txstatus_data *txsd; int error; error = et_stop_txdma(sc); @@ -1799,6 +1820,7 @@ et_init_txdma(struct et_softc *sc) /* * Install TX descriptor ring */ + tx_ring = &sc->sc_tx_ring; CSR_WRITE_4(sc, ET_TX_RING_HI, ET_ADDR_HI(tx_ring->tr_paddr)); CSR_WRITE_4(sc, ET_TX_RING_LO, ET_ADDR_LO(tx_ring->tr_paddr)); CSR_WRITE_4(sc, ET_TX_RING_CNT, ET_TX_NDESC - 1); @@ -1806,6 +1828,7 @@ et_init_txdma(struct et_softc *sc) /* * Install TX status */ + txsd = &sc->sc_tx_status; CSR_WRITE_4(sc, ET_TX_STATUS_HI, ET_ADDR_HI(txsd->txsd_paddr)); CSR_WRITE_4(sc, ET_TX_STATUS_LO, ET_ADDR_LO(txsd->txsd_paddr)); @@ -1821,8 +1844,8 @@ et_init_txdma(struct et_softc *sc) static void et_init_mac(struct et_softc *sc) { - struct ifnet *ifp = sc->ifp; - const uint8_t *eaddr = IF_LLADDR(ifp); + struct ifnet *ifp; + const uint8_t *eaddr; uint32_t val; /* Reset MAC */ @@ -1858,6 +1881,8 @@ et_init_mac(struct et_softc *sc) /* * Set MAC address */ + ifp = sc->ifp; + eaddr = IF_LLADDR(ifp); val = eaddr[2] | (eaddr[3] << 8) | (eaddr[4] << 16) | (eaddr[5] << 24); CSR_WRITE_4(sc, ET_MAC_ADDR1, val); val = (eaddr[0] << 16) | (eaddr[1] << 24); @@ -1873,8 +1898,8 @@ et_init_mac(struct et_softc *sc) static void et_init_rxmac(struct et_softc *sc) { - struct ifnet *ifp = sc->ifp; - const uint8_t *eaddr = IF_LLADDR(ifp); + struct ifnet *ifp; + const uint8_t *eaddr; uint32_t val; int i; @@ -1892,6 +1917,8 @@ et_init_rxmac(struct et_softc *sc) /* * Set WOL source address. XXX is this necessary? */ + ifp = sc->ifp; + eaddr = IF_LLADDR(ifp); val = (eaddr[2] << 24) | (eaddr[3] << 16) | (eaddr[4] << 8) | eaddr[5]; CSR_WRITE_4(sc, ET_WOL_SA_LO, val); val = (eaddr[0] << 8) | eaddr[1]; @@ -1958,6 +1985,7 @@ et_init_rxmac(struct et_softc *sc) static void et_init_txmac(struct et_softc *sc) { + /* Disable TX MAC and FC(?) */ CSR_WRITE_4(sc, ET_TXMAC_CTRL, ET_TXMAC_CTRL_FC_DISABLE); @@ -1976,12 +2004,12 @@ et_init_txmac(struct et_softc *sc) static int et_start_rxdma(struct et_softc *sc) { - uint32_t val = 0; + uint32_t val; - val |= (sc->sc_rx_data[0].rbd_bufsize & ET_RXDMA_CTRL_RING0_SIZE_MASK) | - ET_RXDMA_CTRL_RING0_ENABLE; + val = (sc->sc_rx_data[0].rbd_bufsize & ET_RXDMA_CTRL_RING0_SIZE_MASK) | + ET_RXDMA_CTRL_RING0_ENABLE; val |= (sc->sc_rx_data[1].rbd_bufsize & ET_RXDMA_CTRL_RING1_SIZE_MASK) | - ET_RXDMA_CTRL_RING1_ENABLE; + ET_RXDMA_CTRL_RING1_ENABLE; CSR_WRITE_4(sc, ET_RXDMA_CTRL, val); @@ -1997,6 +2025,7 @@ et_start_rxdma(struct et_softc *sc) static int et_start_txdma(struct et_softc *sc) { + CSR_WRITE_4(sc, ET_TXDMA_CTRL, ET_TXDMA_CTRL_SINGLE_EPKT); return (0); } @@ -2274,10 +2303,11 @@ et_txeof(struct et_softc *sc) static void et_tick(void *xsc) { - struct et_softc *sc = xsc; + struct et_softc *sc; struct ifnet *ifp; struct mii_data *mii; + sc = xsc; ET_LOCK_ASSERT(sc); ifp = sc->ifp; mii = device_get_softc(sc->sc_miibus); @@ -2539,10 +2569,12 @@ et_add_sysctls(struct et_softc * sc) static int et_sysctl_rx_intr_npkts(SYSCTL_HANDLER_ARGS) { - struct et_softc *sc = arg1; - struct ifnet *ifp = sc->ifp; - int error = 0, v; + struct et_softc *sc; + struct ifnet *ifp; + int error, v; + sc = arg1; + ifp = sc->ifp; v = sc->sc_rx_intr_npkts; error = sysctl_handle_int(oidp, &v, 0, req); if (error || req->newptr == NULL) @@ -2564,10 +2596,12 @@ back: static int et_sysctl_rx_intr_delay(SYSCTL_HANDLER_ARGS) { - struct et_softc *sc = arg1; - struct ifnet *ifp = sc->ifp; - int error = 0, v; + struct et_softc *sc; + struct ifnet *ifp; + int error, v; + sc = arg1; + ifp = sc->ifp; v = sc->sc_rx_intr_delay; error = sysctl_handle_int(oidp, &v, 0, req); if (error || req->newptr == NULL) From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 21:02:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 856F8106566C; Tue, 10 Jan 2012 21:02:10 +0000 (UTC) (envelope-from guy.helmer@palisadesystems.com) Received: from ps-1-a.compliancesafe.com (ps-1-a.compliancesafe.com [216.81.161.161]) by mx1.freebsd.org (Postfix) with ESMTP id 412BA8FC15; Tue, 10 Jan 2012 21:02:09 +0000 (UTC) Received: from mail.palisadesystems.com (localhost [127.0.0.1]) by ps-1-a.compliancesafe.com (8.14.4/8.14.3) with ESMTP id q0AL1p8k033851; Tue, 10 Jan 2012 15:01:51 -0600 (CST) (envelope-from guy.helmer@palisadesystems.com) Received: from guysmbp.dyn.palisadesys.com (GuysMBP.dyn.palisadesys.com [172.16.2.90]) (authenticated bits=0) by mail.palisadesystems.com (8.14.3/8.14.3) with ESMTP id q0AL1loY022008 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 10 Jan 2012 15:01:48 -0600 (CST) (envelope-from guy.helmer@palisadesystems.com) X-DKIM: Sendmail DKIM Filter v2.8.3 mail.palisadesystems.com q0AL1loY022008 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=palisadesystems.com; s=mail; t=1326229308; bh=ajo4+kp4np+e+ApwHz3GAzCSOst26ZNcXFEVSUiY/f8=; l=128; h=Subject:Mime-Version:Content-Type:From:In-Reply-To:Date:Cc: Content-Transfer-Encoding:Message-Id:References:To; b=nSx1VK/4V13AvyfDNEFOG4hZD9vAPbvlo5EM1kWd7E9uONg2Ppmb0zflake/y/Dvr bgvgSMTSaYGBQM/VFZIdpzSAAMNvApWYGY4HjaBKN6L6IhE4SpOQfaaqxLCnxlmXa+ 8vgMlvfqsR2zRCECvkfu8u3ahdu6YpjzeF/tb4e8= Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=windows-1252 From: Guy Helmer In-Reply-To: Date: Tue, 10 Jan 2012 15:01:47 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201201052248.q05MmaZk059871@svn.freebsd.org> <4F066340.9010507@FreeBSD.org> To: Garrett Cooper X-Mailer: Apple Mail (2.1251.1) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.5 (mail.palisadesystems.com [172.16.1.5]); Tue, 10 Jan 2012 15:01:48 -0600 (CST) X-Palisade-MailScanner-Information: Please contact the ISP for more information X-Palisade-MailScanner-ID: q0AL1loY022008 X-Palisade-MailScanner: Found to be clean X-Palisade-MailScanner-SpamCheck: not spam (whitelisted), SpamAssassin (score=-1.628, required 5, ALL_TRUSTED -1.00, BAYES_00 -1.90, RP_8BIT 1.27) X-Palisade-MailScanner-From: guy.helmer@palisadesystems.com X-Spam-Status: No X-PacketSure-Scanned: Yes Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Doug Barton , src-committers@freebsd.org Subject: Re: svn commit: r229667 - head/usr.sbin/daemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 21:02:10 -0000 On Jan 6, 2012, at 12:00 AM, Garrett Cooper wrote: > On Thu, Jan 5, 2012 at 6:58 PM, Doug Barton wrote: >> On 01/05/2012 14:48, Guy Helmer wrote: >>> Allow daemon(8) to run pidfile_open() before relenquishing = privileges >>> so pid files can be written in /var/run when started as root. >>=20 >> I'm not sure how useful this is since when daemon is exiting it won't = be >> able to remove the pid file (unless I'm missing something). >>=20 >> Isn't it better to pre-create the pid file with the proper = permissions >> for the unprivileged user? >=20 > As another aside, the file descriptor never has fcntl(, > FD_CLOEXEC) run on it, so it leaks the file descriptors across execs.. > that's not good... I just added an fcntl(=85, FD_CLOEXEC) call to pidfile_open() so this = particular problem should be resolved. Guy= -------- This message has been scanned by ComplianceSafe, powered by Palisade's PacketSure. From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 21:26:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EC11106564A; Tue, 10 Jan 2012 21:26:36 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id E5C928FC08; Tue, 10 Jan 2012 21:26:35 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id C643FD98; Tue, 10 Jan 2012 22:26:33 +0100 (CET) Date: Tue, 10 Jan 2012 22:25:26 +0100 From: Pawel Jakub Dawidek To: Guy Helmer Message-ID: <20120110212525.GA1694@garage.freebsd.pl> References: <201201101843.q0AIhRuM022949@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="opJtzjQTFsWo+cga" Content-Disposition: inline In-Reply-To: <201201101843.q0AIhRuM022949@svn.freebsd.org> X-OS: FreeBSD 9.0-CURRENT amd64 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: r229936 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 21:26:36 -0000 --opJtzjQTFsWo+cga Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 10, 2012 at 06:43:27PM +0000, Guy Helmer wrote: > Author: ghelmer > Date: Tue Jan 10 18:43:27 2012 > New Revision: 229936 > URL: http://svn.freebsd.org/changeset/base/229936 >=20 > Log: > Set the FD_CLOEXEC flag on the open pidfile file descriptor. > =20 > Discussed with: pjd, des Could you also update manual page to note that pidfile_open(3) can now also set errno via fcntl(2)? > Modified: > head/lib/libutil/pidfile.c >=20 > Modified: head/lib/libutil/pidfile.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/lib/libutil/pidfile.c Tue Jan 10 18:20:19 2012 (r229935) > +++ head/lib/libutil/pidfile.c Tue Jan 10 18:43:27 2012 (r229936) > @@ -137,6 +137,20 @@ pidfile_open(const char *path, mode_t mo > free(pfh); > return (NULL); > } > + > + /* > + * Prevent the file descriptor from escaping to other > + * programs via exec(3). > + */ > + if (fcntl(fd, F_SETFD, FD_CLOEXEC) =3D=3D -1) { > + error =3D errno; > + unlink(pfh->pf_path); > + close(fd); > + free(pfh); > + errno =3D error; > + return (NULL); > + } > + > /* > * Remember file information, so in pidfile_write() we are sure we write > * to the proper descriptor. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --opJtzjQTFsWo+cga Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk8MrMUACgkQForvXbEpPzREVQCgud/IWcYtGthH+KWcv70yASfg s/UAn14wIVzxl42Gn62dZ4VgTynEe4Wo =PeFr -----END PGP SIGNATURE----- --opJtzjQTFsWo+cga-- From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 21:28:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0478E1065677; Tue, 10 Jan 2012 21:28:21 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id A18738FC17; Tue, 10 Jan 2012 21:28:20 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id A96A7D9C; Tue, 10 Jan 2012 22:28:18 +0100 (CET) Date: Tue, 10 Jan 2012 22:27:11 +0100 From: Pawel Jakub Dawidek To: Guy Helmer Message-ID: <20120110212710.GB1694@garage.freebsd.pl> References: <201201101843.q0AIhRuM022949@svn.freebsd.org> <20120110212525.GA1694@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="eJnRUKwClWJh1Khz" Content-Disposition: inline In-Reply-To: <20120110212525.GA1694@garage.freebsd.pl> X-OS: FreeBSD 9.0-CURRENT amd64 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: r229936 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 21:28:21 -0000 --eJnRUKwClWJh1Khz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 10, 2012 at 10:25:26PM +0100, Pawel Jakub Dawidek wrote: > On Tue, Jan 10, 2012 at 06:43:27PM +0000, Guy Helmer wrote: > > Author: ghelmer > > Date: Tue Jan 10 18:43:27 2012 > > New Revision: 229936 > > URL: http://svn.freebsd.org/changeset/base/229936 > >=20 > > Log: > > Set the FD_CLOEXEC flag on the open pidfile file descriptor. > > =20 > > Discussed with: pjd, des >=20 > Could you also update manual page to note that pidfile_open(3) can now > also set errno via fcntl(2)? Actually, it would also be useful to document the fact that we now set FD_CLOEXEC flag, so one doesn't have to look at the code to find it. > > Modified: > > head/lib/libutil/pidfile.c > >=20 > > Modified: head/lib/libutil/pidfile.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/lib/libutil/pidfile.c Tue Jan 10 18:20:19 2012 (r229935) > > +++ head/lib/libutil/pidfile.c Tue Jan 10 18:43:27 2012 (r229936) > > @@ -137,6 +137,20 @@ pidfile_open(const char *path, mode_t mo > > free(pfh); > > return (NULL); > > } > > + > > + /* > > + * Prevent the file descriptor from escaping to other > > + * programs via exec(3). > > + */ > > + if (fcntl(fd, F_SETFD, FD_CLOEXEC) =3D=3D -1) { > > + error =3D errno; > > + unlink(pfh->pf_path); > > + close(fd); > > + free(pfh); > > + errno =3D error; > > + return (NULL); > > + } > > + > > /* > > * Remember file information, so in pidfile_write() we are sure we wr= ite > > * to the proper descriptor. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --eJnRUKwClWJh1Khz Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk8MrS0ACgkQForvXbEpPzQxogCfa/9gbXsgdYUPnmaUlYiAnA92 B58An3t1bIujsh51y1Xber8lyCy7NikY =9emm -----END PGP SIGNATURE----- --eJnRUKwClWJh1Khz-- From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 21:39:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA3FD1065672; Tue, 10 Jan 2012 21:39:43 +0000 (UTC) (envelope-from ghelmer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A9A478FC15; Tue, 10 Jan 2012 21:39: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 q0ALdhnV028573; Tue, 10 Jan 2012 21:39:43 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0ALdhpm028571; Tue, 10 Jan 2012 21:39:43 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201201102139.q0ALdhpm028571@svn.freebsd.org> From: Guy Helmer Date: Tue, 10 Jan 2012 21:39: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: r229941 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 21:39:43 -0000 Author: ghelmer Date: Tue Jan 10 21:39:43 2012 New Revision: 229941 URL: http://svn.freebsd.org/changeset/base/229941 Log: Document that pidfile_open() now sets the FD_CLOEXEC flag on the open file descriptor, and that errors can be returned as a result of the fcntl(2) system call. Modified: head/lib/libutil/pidfile.3 Modified: head/lib/libutil/pidfile.3 ============================================================================== --- head/lib/libutil/pidfile.3 Tue Jan 10 20:52:02 2012 (r229940) +++ head/lib/libutil/pidfile.3 Tue Jan 10 21:39:43 2012 (r229941) @@ -79,6 +79,9 @@ argument is .Dv NULL , .Pa /var/run/ Ns Ao Va progname Ac Ns Pa .pid file will be used. +The +.Fn pidfile_open +function sets the FD_CLOEXEC close-on-exec flag on the open file descriptor. .Pp The .Fn pidfile_write @@ -200,6 +203,7 @@ The function may also fail and set .Va errno for any errors specified for the +.Xr fcntl 2 , .Xr fstat 2 , .Xr open 2 , and From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 21:40:20 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 193E91065741; Tue, 10 Jan 2012 21:40:20 +0000 (UTC) (envelope-from guy.helmer@palisadesystems.com) Received: from ps-1-a.compliancesafe.com (ps-1-a.compliancesafe.com [216.81.161.161]) by mx1.freebsd.org (Postfix) with ESMTP id 914898FC1C; Tue, 10 Jan 2012 21:40:19 +0000 (UTC) Received: from mail.palisadesystems.com (localhost [127.0.0.1]) by ps-1-a.compliancesafe.com (8.14.4/8.14.3) with ESMTP id q0ALeI8K035557; Tue, 10 Jan 2012 15:40:18 -0600 (CST) (envelope-from guy.helmer@palisadesystems.com) Received: from guysmbp.dyn.palisadesys.com (GuysMBP.dyn.palisadesys.com [172.16.2.90]) (authenticated bits=0) by mail.palisadesystems.com (8.14.3/8.14.3) with ESMTP id q0ALeC55022958 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 10 Jan 2012 15:40:14 -0600 (CST) (envelope-from guy.helmer@palisadesystems.com) X-DKIM: Sendmail DKIM Filter v2.8.3 mail.palisadesystems.com q0ALeC55022958 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=palisadesystems.com; s=mail; t=1326231615; bh=NCISRWPevMHqBphtFpnkE5B/ryqCvBmRVCL+LxBotyU=; l=128; h=Subject:Mime-Version:Content-Type:From:In-Reply-To:Date:Cc: Content-Transfer-Encoding:Message-Id:References:To; b=HtYQmRz/1QG84clyoYmvXNum7NYZkqipmZuR4fQo8E5w/URIrs6xkx4DxMDwvcGdP p3zWROblFmRXk7PfF1/VCpv+HWDl6yarq1V8KbaYYj9m7j3umCGLGcE/WDcdIw//5H 9eooJxg4kebKNn4Xpm9x/ULr+ezMOiKppu2Dq8EU= Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=us-ascii From: Guy Helmer In-Reply-To: <20120110212710.GB1694@garage.freebsd.pl> Date: Tue, 10 Jan 2012 15:39:54 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <2C686047-0D47-4B29-A78A-3D1240953F41@palisadesystems.com> References: <201201101843.q0AIhRuM022949@svn.freebsd.org> <20120110212525.GA1694@garage.freebsd.pl> <20120110212710.GB1694@garage.freebsd.pl> To: Pawel Jakub Dawidek X-Mailer: Apple Mail (2.1251.1) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.5 (mail.palisadesystems.com [172.16.1.5]); Tue, 10 Jan 2012 15:40:15 -0600 (CST) X-Palisade-MailScanner-Information: Please contact the ISP for more information X-Palisade-MailScanner-ID: q0ALeC55022958 X-Palisade-MailScanner: Found to be clean X-Palisade-MailScanner-SpamCheck: not spam (whitelisted), SpamAssassin (score=-1.628, required 5, ALL_TRUSTED -1.00, BAYES_00 -1.90, RP_8BIT 1.27) X-Palisade-MailScanner-From: guy.helmer@palisadesystems.com X-Spam-Status: No X-PacketSure-Scanned: Yes Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r229936 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 21:40:20 -0000 On Jan 10, 2012, at 3:27 PM, Pawel Jakub Dawidek wrote: > On Tue, Jan 10, 2012 at 10:25:26PM +0100, Pawel Jakub Dawidek wrote: >> On Tue, Jan 10, 2012 at 06:43:27PM +0000, Guy Helmer wrote: >>> Author: ghelmer >>> Date: Tue Jan 10 18:43:27 2012 >>> New Revision: 229936 >>> URL: http://svn.freebsd.org/changeset/base/229936 >>>=20 >>> Log: >>> Set the FD_CLOEXEC flag on the open pidfile file descriptor. >>>=20 >>> Discussed with: pjd, des >>=20 >> Could you also update manual page to note that pidfile_open(3) can = now >> also set errno via fcntl(2)? >=20 > Actually, it would also be useful to document the fact that we now set > FD_CLOEXEC flag, so one doesn't have to look at the code to find it. Thanks for reminding me, I mean to do that earlier. Guy >=20 >>> Modified: >>> head/lib/libutil/pidfile.c >>>=20 >>> Modified: head/lib/libutil/pidfile.c >>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>> --- head/lib/libutil/pidfile.c Tue Jan 10 18:20:19 2012 = (r229935) >>> +++ head/lib/libutil/pidfile.c Tue Jan 10 18:43:27 2012 = (r229936) >>> @@ -137,6 +137,20 @@ pidfile_open(const char *path, mode_t mo >>> free(pfh); >>> return (NULL); >>> } >>> + >>> + /* >>> + * Prevent the file descriptor from escaping to other >>> + * programs via exec(3). >>> + */ >>> + if (fcntl(fd, F_SETFD, FD_CLOEXEC) =3D=3D -1) { >>> + error =3D errno; >>> + unlink(pfh->pf_path); >>> + close(fd); >>> + free(pfh); >>> + errno =3D error; >>> + return (NULL); >>> + } >>> + >>> /* >>> * Remember file information, so in pidfile_write() we are sure = we write >>> * to the proper descriptor. >=20 > --=20 > Pawel Jakub Dawidek http://www.wheelsystems.com > FreeBSD committer http://www.FreeBSD.org > Am I Evil? Yes, I Am! http://yomoli.com -------- This message has been scanned by ComplianceSafe, powered by Palisade's PacketSure. From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 21:43:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 411F91065673; Tue, 10 Jan 2012 21:43:53 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id AC5AE8FC08; Tue, 10 Jan 2012 21:43:52 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 049F7DAC; Tue, 10 Jan 2012 22:43:50 +0100 (CET) Date: Tue, 10 Jan 2012 22:42:43 +0100 From: Pawel Jakub Dawidek To: Guy Helmer Message-ID: <20120110214243.GC1694@garage.freebsd.pl> References: <201201101953.q0AJrPao025097@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2JFBq9zoW8cOFH7v" Content-Disposition: inline In-Reply-To: <201201101953.q0AJrPao025097@svn.freebsd.org> X-OS: FreeBSD 9.0-CURRENT amd64 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: r229937 - in head/lib: libc/gen libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 21:43:53 -0000 --2JFBq9zoW8cOFH7v Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 10, 2012 at 07:53:25PM +0000, Guy Helmer wrote: > Author: ghelmer > Date: Tue Jan 10 19:53:25 2012 > New Revision: 229937 > URL: http://svn.freebsd.org/changeset/base/229937 >=20 > Log: > Add pidfile_fileno() to obtain the file descriptor for an open > pidfile. >=20 > Modified: > head/lib/libc/gen/getnetgrent.c > head/lib/libutil/libutil.h > head/lib/libutil/pidfile.3 > head/lib/libutil/pidfile.c [...] > @@ -92,6 +94,10 @@ to start a child process. > The > .Fn pidfile_remove > function closes and removes a pidfile. > +.Pp > +The > +.Fn pidfile_fileno > +function returns the file descriptor for the open pid file. In other places in this manual page we use 'pidfile' as a single word. > .Sh RETURN VALUES > The > .Fn pidfile_open > @@ -105,15 +111,25 @@ If an error occurs, > will be set. > .Pp > .Rv -std pidfile_write pidfile_close pidfile_remove > +.Pp > +The > +.Fn pidfile_fileno > +function returns the low-level file descriptor. > +It returns -1 and sets I think you should also use .Va or .Li macro for -1. > +.Va errno > +if a NULL > +.Vt pidfh > +is specified, or if the pidfile is no longer open. > .Sh EXAMPLES > The following example shows in which order these functions should be use= d. > Note that it is safe to pass > .Dv NULL > to > .Fn pidfile_write , > -.Fn pidfile_remove > -and > +.Fn pidfile_remove , > .Fn pidfile_close > +and > +.Fn pidfile_fileno > functions. > .Bd -literal > struct pidfh *pfh; > @@ -244,6 +260,16 @@ and > system calls and the > .Xr flopen 3 > library function. > +.Pp > +The > +.Fn pidfile_fileno > +function will fail if: > +.Bl -tag -width Er > +.It Bq Er EDOOFUS > +Improper function use. > +Probably called not from the process which used > +.Fn pidfile_open . > +.El > .Sh SEE ALSO > .Xr open 2 , > .Xr daemon 3 , >=20 > Modified: head/lib/libutil/pidfile.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/lib/libutil/pidfile.c Tue Jan 10 18:43:27 2012 (r229936) > +++ head/lib/libutil/pidfile.c Tue Jan 10 19:53:25 2012 (r229937) > @@ -266,3 +266,13 @@ pidfile_remove(struct pidfh *pfh) > =20 > return (_pidfile_remove(pfh, 1)); > } > + > +int > +pidfile_fileno(struct pidfh *pfh) > +{ Missing empty line here for function without local variables. > + if (pfh =3D=3D NULL || pfh->pf_fd =3D=3D -1) { > + errno =3D EDOOFUS; > + return (-1); > + } > + return (pfh->pf_fd); > +} BTW. If you are working on pidfile, it would be nice to move pidfile structure declaration into pidfile.c. There is no need to expose it. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --2JFBq9zoW8cOFH7v Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk8MsNMACgkQForvXbEpPzTQ0ACg6Xs4CrH44dt3dVbL99D0M5YI luYAn0jfLA+gwrKwkuKV+R6FqyAhOZz1 =Le5F -----END PGP SIGNATURE----- --2JFBq9zoW8cOFH7v-- From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 21:47:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 080DE1065670; Tue, 10 Jan 2012 21:47:59 +0000 (UTC) (envelope-from ghelmer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EBA608FC0C; Tue, 10 Jan 2012 21:47: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 q0ALlwf8028847; Tue, 10 Jan 2012 21:47:58 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0ALlwIt028844; Tue, 10 Jan 2012 21:47:58 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201201102147.q0ALlwIt028844@svn.freebsd.org> From: Guy Helmer Date: Tue, 10 Jan 2012 21:47: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: r229942 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 21:47:59 -0000 Author: ghelmer Date: Tue Jan 10 21:47:58 2012 New Revision: 229942 URL: http://svn.freebsd.org/changeset/base/229942 Log: Style fixes courtesy of pjd. Modified: head/lib/libutil/pidfile.3 head/lib/libutil/pidfile.c Modified: head/lib/libutil/pidfile.3 ============================================================================== --- head/lib/libutil/pidfile.3 Tue Jan 10 21:39:43 2012 (r229941) +++ head/lib/libutil/pidfile.3 Tue Jan 10 21:47:58 2012 (r229942) @@ -100,7 +100,7 @@ function closes and removes a pidfile. .Pp The .Fn pidfile_fileno -function returns the file descriptor for the open pid file. +function returns the file descriptor for the open pidfile. .Sh RETURN VALUES The .Fn pidfile_open @@ -118,7 +118,9 @@ will be set. The .Fn pidfile_fileno function returns the low-level file descriptor. -It returns -1 and sets +It returns +.Li -1 +and sets .Va errno if a NULL .Vt pidfh Modified: head/lib/libutil/pidfile.c ============================================================================== --- head/lib/libutil/pidfile.c Tue Jan 10 21:39:43 2012 (r229941) +++ head/lib/libutil/pidfile.c Tue Jan 10 21:47:58 2012 (r229942) @@ -270,6 +270,7 @@ pidfile_remove(struct pidfh *pfh) int pidfile_fileno(struct pidfh *pfh) { + if (pfh == NULL || pfh->pf_fd == -1) { errno = EDOOFUS; return (-1); From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 21:52:44 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87986106566B; Tue, 10 Jan 2012 21:52:44 +0000 (UTC) (envelope-from guy.helmer@palisadesystems.com) Received: from ps-1-a.compliancesafe.com (ps-1-a.compliancesafe.com [216.81.161.161]) by mx1.freebsd.org (Postfix) with ESMTP id 00BE88FC16; Tue, 10 Jan 2012 21:52:43 +0000 (UTC) Received: from mail.palisadesystems.com (localhost [127.0.0.1]) by ps-1-a.compliancesafe.com (8.14.4/8.14.3) with ESMTP id q0ALqgO9036063; Tue, 10 Jan 2012 15:52:43 -0600 (CST) (envelope-from guy.helmer@palisadesystems.com) Received: from guysmbp.dyn.palisadesys.com (GuysMBP.dyn.palisadesys.com [172.16.2.90]) (authenticated bits=0) by mail.palisadesystems.com (8.14.3/8.14.3) with ESMTP id q0ALqZNK023300 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 10 Jan 2012 15:52:37 -0600 (CST) (envelope-from guy.helmer@palisadesystems.com) X-DKIM: Sendmail DKIM Filter v2.8.3 mail.palisadesystems.com q0ALqZNK023300 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=palisadesystems.com; s=mail; t=1326232358; bh=W45c4R5Xw0Sn4OaUDGOMubwQrxB9McKe+i/NqtaNos0=; l=128; h=Subject:Mime-Version:Content-Type:From:In-Reply-To:Date:Cc: Message-Id:References:To; b=Db2L/zQpi7R0s4/44q4wC+Y++QdLsKhHls/55ym455qSblcHqBAFa1W46/4sNxrrs Ouebh6mFXYJqUHgvYs59FahBuERaTacn3GTG8ocktIFqlp4+IBfvSU+ElMycMkmfuW EcwM+eVSGNtHp7GkVDWPBFJjrX4xofTmnV9eTgbE= Mime-Version: 1.0 (Apple Message framework v1251.1) From: Guy Helmer In-Reply-To: <20120110214243.GC1694@garage.freebsd.pl> Date: Tue, 10 Jan 2012 15:52:35 -0600 Message-Id: References: <201201101953.q0AJrPao025097@svn.freebsd.org> <20120110214243.GC1694@garage.freebsd.pl> To: Pawel Jakub Dawidek X-Mailer: Apple Mail (2.1251.1) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.5 (mail.palisadesystems.com [172.16.1.5]); Tue, 10 Jan 2012 15:52:38 -0600 (CST) X-Palisade-MailScanner-Information: Please contact the ISP for more information X-Palisade-MailScanner-ID: q0ALqZNK023300 X-Palisade-MailScanner: Found to be clean X-Palisade-MailScanner-SpamCheck: not spam (whitelisted), SpamAssassin (score=-1.627, required 5, ALL_TRUSTED -1.00, BAYES_00 -1.90, HTML_MESSAGE 0.00, RP_8BIT 1.27) X-Palisade-MailScanner-From: guy.helmer@palisadesystems.com X-Spam-Status: No X-PacketSure-Scanned: Yes Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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: r229937 - in head/lib: libc/gen libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 21:52:44 -0000 On Jan 10, 2012, at 3:42 PM, Pawel Jakub Dawidek wrote: > On Tue, Jan 10, 2012 at 07:53:25PM +0000, Guy Helmer wrote: >> Author: ghelmer >> Date: Tue Jan 10 19:53:25 2012 >> New Revision: 229937 >> URL: http://svn.freebsd.org/changeset/base/229937 >> >> Log: >> Add pidfile_fileno() to obtain the file descriptor for an open >> pidfile. > > BTW. If you are working on pidfile, it would be nice to move pidfile > structure declaration into pidfile.c. There is no need to expose it. Is that change likely to require a "make universe" to validate? Guy -------- This message has been scanned by ComplianceSafe, powered by Palisade's PacketSure. From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 22:02:29 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22B31106564A; Tue, 10 Jan 2012 22:02:29 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id C80778FC12; Tue, 10 Jan 2012 22:02:28 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 650E8DBE; Tue, 10 Jan 2012 23:02:27 +0100 (CET) Date: Tue, 10 Jan 2012 23:01:19 +0100 From: Pawel Jakub Dawidek To: Guy Helmer Message-ID: <20120110220119.GD1694@garage.freebsd.pl> References: <201201101953.q0AJrPao025097@svn.freebsd.org> <20120110214243.GC1694@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1sNVjLsmu1MXqwQ/" Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 9.0-CURRENT amd64 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: r229937 - in head/lib: libc/gen libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 22:02:29 -0000 --1sNVjLsmu1MXqwQ/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 10, 2012 at 03:52:35PM -0600, Guy Helmer wrote: >=20 > On Jan 10, 2012, at 3:42 PM, Pawel Jakub Dawidek wrote: >=20 > > On Tue, Jan 10, 2012 at 07:53:25PM +0000, Guy Helmer wrote: > >> Author: ghelmer > >> Date: Tue Jan 10 19:53:25 2012 > >> New Revision: 229937 > >> URL: http://svn.freebsd.org/changeset/base/229937 > >>=20 > >> Log: > >> Add pidfile_fileno() to obtain the file descriptor for an open > >> pidfile. > >=20 > > BTW. If you are working on pidfile, it would be nice to move pidfile > > structure declaration into pidfile.c. There is no need to expose it. >=20 >=20 > Is that change likely to require a "make universe" to validate? Nice try:) No, I won't take the responsibility:) Ok, seriously. Nothing should use this structure directly. You will still need forward declaration in pidfile.h. It is not something that is arch-depended, so simple buildworld should be sufficient. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --1sNVjLsmu1MXqwQ/ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk8MtS8ACgkQForvXbEpPzQEnACghiFdyOr9cR6saokirJh3LqeF pI4Anivt31CKTeHKDVTCZEgKn/4ZE9sg =oa00 -----END PGP SIGNATURE----- --1sNVjLsmu1MXqwQ/-- From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 22:14:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 074501065670; Tue, 10 Jan 2012 22:14:34 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id AD1508FC08; Tue, 10 Jan 2012 22:14:33 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id E132CDC8; Tue, 10 Jan 2012 23:14:31 +0100 (CET) Date: Tue, 10 Jan 2012 23:13:24 +0100 From: Pawel Jakub Dawidek To: Guy Helmer Message-ID: <20120110221323.GE1694@garage.freebsd.pl> References: <201201101953.q0AJrPao025097@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="EXKGNeO8l0xGFBjy" Content-Disposition: inline In-Reply-To: <201201101953.q0AJrPao025097@svn.freebsd.org> X-OS: FreeBSD 9.0-CURRENT amd64 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: r229937 - in head/lib: libc/gen libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 22:14:34 -0000 --EXKGNeO8l0xGFBjy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 10, 2012 at 07:53:25PM +0000, Guy Helmer wrote: > Author: ghelmer > Date: Tue Jan 10 19:53:25 2012 > New Revision: 229937 > URL: http://svn.freebsd.org/changeset/base/229937 >=20 > Log: > Add pidfile_fileno() to obtain the file descriptor for an open > pidfile. >=20 > Modified: > head/lib/libc/gen/getnetgrent.c > head/lib/libutil/libutil.h > head/lib/libutil/pidfile.3 > head/lib/libutil/pidfile.c [...] > Modified: head/lib/libutil/libutil.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/lib/libutil/libutil.h Tue Jan 10 18:43:27 2012 (r229936) > +++ head/lib/libutil/libutil.h Tue Jan 10 19:53:25 2012 (r229937) > @@ -170,6 +170,7 @@ struct pidfh *pidfile_open(const char *p > int pidfile_write(struct pidfh *pfh); > int pidfile_close(struct pidfh *pfh); > int pidfile_remove(struct pidfh *pfh); > +int pidfile_fileno(struct pidfh *pfh); > #endif > =20 > #ifdef _UFS_UFS_QUOTA_H_ One more thing. You also need to add link in Makefile, so that 'man pidfile_fileno' will work. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --EXKGNeO8l0xGFBjy Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk8MuAMACgkQForvXbEpPzRkhQCgmX/QK0C9wNbQBr3Iem+0Igjl SMsAoNHS2p0GztBLdirMr7GOExffM3uk =ibq4 -----END PGP SIGNATURE----- --EXKGNeO8l0xGFBjy-- From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 22:22:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54018106566B; Tue, 10 Jan 2012 22:22:36 +0000 (UTC) (envelope-from ghelmer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C51C8FC18; Tue, 10 Jan 2012 22: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 q0AMMahg030025; Tue, 10 Jan 2012 22:22:36 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0AMMa9X030023; Tue, 10 Jan 2012 22:22:36 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201201102222.q0AMMa9X030023@svn.freebsd.org> From: Guy Helmer Date: Tue, 10 Jan 2012 22: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: r229943 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 22:22:36 -0000 Author: ghelmer Date: Tue Jan 10 22:22:35 2012 New Revision: 229943 URL: http://svn.freebsd.org/changeset/base/229943 Log: Add link for pidfile_fileno.3 to pidfile.3 - thanks again pjd! Modified: head/lib/libutil/Makefile Modified: head/lib/libutil/Makefile ============================================================================== --- head/lib/libutil/Makefile Tue Jan 10 21:47:58 2012 (r229942) +++ head/lib/libutil/Makefile Tue Jan 10 22:22:35 2012 (r229943) @@ -58,7 +58,8 @@ MLINKS+=uucplock.3 uu_lock.3 uucplock.3 MLINKS+=pidfile.3 pidfile_open.3 \ pidfile.3 pidfile_write.3 \ pidfile.3 pidfile_close.3 \ - pidfile.3 pidfile_remove.3 + pidfile.3 pidfile_remove.3 \ + pidfile.3 pidfile_fileno.3 MLINKS+=quotafile.3 quota_open.3 \ quotafile.3 quota_fsname.3 \ quotafile.3 quota_qfname.3 \ From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 22:24:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FD02106566B; Tue, 10 Jan 2012 22:24:58 +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 14F738FC14; Tue, 10 Jan 2012 22:24: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 q0AMOvVc030161; Tue, 10 Jan 2012 22:24:57 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0AMOvxH030159; Tue, 10 Jan 2012 22:24:57 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201201102224.q0AMOvxH030159@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 10 Jan 2012 22:24: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: r229944 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 22:24:58 -0000 Author: pjd Date: Tue Jan 10 22:24:57 2012 New Revision: 229944 URL: http://svn.freebsd.org/changeset/base/229944 Log: Don't touch pidfiles when running in foreground. Before that change we would create an empty pidfile on start and check if it changed on SIGHUP. MFC after: 3 days Modified: head/sbin/hastd/hastd.c Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Tue Jan 10 22:22:35 2012 (r229943) +++ head/sbin/hastd/hastd.c Tue Jan 10 22:24:57 2012 (r229944) @@ -68,6 +68,8 @@ static struct hastd_config *cfg; bool sigexit_received = false; /* PID file handle. */ struct pidfh *pfh; +/* Do we run in foreground? */ +static bool foreground; /* How often check for hooks running for too long. */ #define REPORT_INTERVAL 5 @@ -531,7 +533,7 @@ hastd_reload(void) /* * Check if pidfile's path has changed. */ - if (strcmp(cfg->hc_pidfile, newcfg->hc_pidfile) != 0) { + if (!foreground && strcmp(cfg->hc_pidfile, newcfg->hc_pidfile) != 0) { newpfh = pidfile_open(newcfg->hc_pidfile, 0600, &otherpid); if (newpfh == NULL) { if (errno == EEXIST) { @@ -1155,7 +1157,6 @@ main(int argc, char *argv[]) struct hastd_listen *lst; const char *pidfile; pid_t otherpid; - bool foreground; int debuglevel; sigset_t mask; @@ -1220,16 +1221,23 @@ main(int argc, char *argv[]) pjdlog_exitx(EX_CONFIG, "Pidfile path is too long."); } } - pfh = pidfile_open(cfg->hc_pidfile, 0600, &otherpid); - if (pfh == NULL) { - if (errno == EEXIST) { - pjdlog_exitx(EX_TEMPFAIL, - "Another hastd is already running, pidfile: %s, pid: %jd.", - cfg->hc_pidfile, (intmax_t)otherpid); - } - /* If we cannot create pidfile for other reasons, only warn. */ - pjdlog_errno(LOG_WARNING, "Unable to open or create pidfile %s", - cfg->hc_pidfile); + + if (!foreground) { + pfh = pidfile_open(cfg->hc_pidfile, 0600, &otherpid); + if (pfh == NULL) { + if (errno == EEXIST) { + pjdlog_exitx(EX_TEMPFAIL, + "Another hastd is already running, pidfile: %s, pid: %jd.", + cfg->hc_pidfile, (intmax_t)otherpid); + } + /* + * If we cannot create pidfile for other reasons, + * only warn. + */ + pjdlog_errno(LOG_WARNING, + "Unable to open or create pidfile %s", + cfg->hc_pidfile); + } } /* From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 22:39:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40F16106566C; Tue, 10 Jan 2012 22:39:08 +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 2E3108FC13; Tue, 10 Jan 2012 22:39:08 +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 q0AMd8tJ030652; Tue, 10 Jan 2012 22:39:08 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0AMd8i6030635; Tue, 10 Jan 2012 22:39:08 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201201102239.q0AMd8i6030635@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 10 Jan 2012 22:39: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: r229945 - in head/sbin: hastctl hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 22:39:08 -0000 Author: pjd Date: Tue Jan 10 22:39:07 2012 New Revision: 229945 URL: http://svn.freebsd.org/changeset/base/229945 Log: For functions that return -1 on failure check exactly for -1 and not for any negative number. MFC after: 3 days Modified: head/sbin/hastctl/hastctl.c head/sbin/hastd/control.c head/sbin/hastd/ebuf.c head/sbin/hastd/event.c head/sbin/hastd/hast_proto.c head/sbin/hastd/hastd.c head/sbin/hastd/hooks.c head/sbin/hastd/metadata.c head/sbin/hastd/nv.c head/sbin/hastd/primary.c head/sbin/hastd/proto.c head/sbin/hastd/proto_common.c head/sbin/hastd/proto_socketpair.c head/sbin/hastd/proto_tcp.c head/sbin/hastd/proto_uds.c head/sbin/hastd/secondary.c head/sbin/hastd/subr.c Modified: head/sbin/hastctl/hastctl.c ============================================================================== --- head/sbin/hastctl/hastctl.c Tue Jan 10 22:24:57 2012 (r229944) +++ head/sbin/hastctl/hastctl.c Tue Jan 10 22:39:07 2012 (r229945) @@ -104,7 +104,7 @@ create_one(struct hast_resource *res, in ec = 0; pjdlog_prefix_set("[%s] ", res->hr_name); - if (provinfo(res, true) < 0) { + if (provinfo(res, true) == -1) { ec = EX_NOINPUT; goto end; } @@ -146,7 +146,7 @@ create_one(struct hast_resource *res, in res->hr_localoff = METADATA_SIZE + mapsize; - if (metadata_write(res) < 0) { + if (metadata_write(res) == -1) { ec = EX_IOERR; goto end; } @@ -401,15 +401,15 @@ main(int argc, char *argv[]) debug++; break; case 'e': - if (expand_number(optarg, &extentsize) < 0) + if (expand_number(optarg, &extentsize) == -1) errx(EX_USAGE, "Invalid extentsize"); break; case 'k': - if (expand_number(optarg, &keepdirty) < 0) + if (expand_number(optarg, &keepdirty) == -1) errx(EX_USAGE, "Invalid keepdirty"); break; case 'm': - if (expand_number(optarg, &mediasize) < 0) + if (expand_number(optarg, &mediasize) == -1) errx(EX_USAGE, "Invalid mediasize"); break; case 'h': @@ -479,13 +479,13 @@ main(int argc, char *argv[]) } /* Setup control connection... */ - if (proto_client(NULL, cfg->hc_controladdr, &controlconn) < 0) { + if (proto_client(NULL, cfg->hc_controladdr, &controlconn) == -1) { pjdlog_exit(EX_OSERR, "Unable to setup control connection to %s", cfg->hc_controladdr); } /* ...and connect to hastd. */ - if (proto_connect(controlconn, HAST_TIMEOUT) < 0) { + if (proto_connect(controlconn, HAST_TIMEOUT) == -1) { pjdlog_exit(EX_OSERR, "Unable to connect to hastd via %s", cfg->hc_controladdr); } @@ -494,14 +494,14 @@ main(int argc, char *argv[]) exit(EX_CONFIG); /* Send the command to the server... */ - if (hast_proto_send(NULL, controlconn, nv, NULL, 0) < 0) { + if (hast_proto_send(NULL, controlconn, nv, NULL, 0) == -1) { pjdlog_exit(EX_UNAVAILABLE, "Unable to send command to hastd via %s", cfg->hc_controladdr); } nv_free(nv); /* ...and receive reply. */ - if (hast_proto_recv_hdr(controlconn, &nv) < 0) { + if (hast_proto_recv_hdr(controlconn, &nv) == -1) { pjdlog_exit(EX_UNAVAILABLE, "cannot receive reply from hastd via %s", cfg->hc_controladdr); Modified: head/sbin/hastd/control.c ============================================================================== --- head/sbin/hastd/control.c Tue Jan 10 22:24:57 2012 (r229944) +++ head/sbin/hastd/control.c Tue Jan 10 22:39:07 2012 (r229945) @@ -115,7 +115,7 @@ control_set_role_common(struct hastd_con * doing that work. */ if (res->hr_workerpid != 0) { - if (kill(res->hr_workerpid, SIGTERM) < 0) { + if (kill(res->hr_workerpid, SIGTERM) == -1) { pjdlog_errno(LOG_WARNING, "Unable to kill worker process %u", (unsigned int)res->hr_workerpid); @@ -167,7 +167,7 @@ control_status_worker(struct hast_resour "Unable to prepare control header"); goto end; } - if (hast_proto_send(res, res->hr_ctrl, cnvout, NULL, 0) < 0) { + if (hast_proto_send(res, res->hr_ctrl, cnvout, NULL, 0) == -1) { error = errno; pjdlog_errno(LOG_ERR, "Unable to send control header"); goto end; @@ -176,7 +176,7 @@ control_status_worker(struct hast_resour /* * Receive response. */ - if (hast_proto_recv_hdr(res->hr_ctrl, &cnvin) < 0) { + if (hast_proto_recv_hdr(res->hr_ctrl, &cnvin) == -1) { error = errno; pjdlog_errno(LOG_ERR, "Unable to receive control header"); goto end; @@ -293,7 +293,7 @@ control_handle(struct hastd_config *cfg) uint8_t cmd, role; int error; - if (proto_accept(cfg->hc_controlconn, &conn) < 0) { + if (proto_accept(cfg->hc_controlconn, &conn) == -1) { pjdlog_errno(LOG_ERR, "Unable to accept control connection"); return; } @@ -302,7 +302,7 @@ control_handle(struct hastd_config *cfg) nvin = nvout = NULL; role = HAST_ROLE_UNDEF; - if (hast_proto_recv_hdr(conn, &nvin) < 0) { + if (hast_proto_recv_hdr(conn, &nvin) == -1) { pjdlog_errno(LOG_ERR, "Unable to receive control header"); nvin = NULL; goto close; @@ -395,7 +395,7 @@ fail: if (error != 0) nv_add_int16(nvout, error, "error"); - if (hast_proto_send(NULL, conn, nvout, NULL, 0) < 0) + if (hast_proto_send(NULL, conn, nvout, NULL, 0) == -1) pjdlog_errno(LOG_ERR, "Unable to send control response"); close: if (nvin != NULL) @@ -417,7 +417,7 @@ ctrl_thread(void *arg) uint8_t cmd; for (;;) { - if (hast_proto_recv_hdr(res->hr_ctrl, &nvin) < 0) { + if (hast_proto_recv_hdr(res->hr_ctrl, &nvin) == -1) { if (sigexit_received) pthread_exit(NULL); pjdlog_errno(LOG_ERR, @@ -481,7 +481,7 @@ ctrl_thread(void *arg) nv_free(nvout); continue; } - if (hast_proto_send(NULL, res->hr_ctrl, nvout, NULL, 0) < 0) { + if (hast_proto_send(NULL, res->hr_ctrl, nvout, NULL, 0) == -1) { pjdlog_errno(LOG_ERR, "Unable to send reply to control message"); } Modified: head/sbin/hastd/ebuf.c ============================================================================== --- head/sbin/hastd/ebuf.c Tue Jan 10 22:24:57 2012 (r229944) +++ head/sbin/hastd/ebuf.c Tue Jan 10 22:39:07 2012 (r229945) @@ -116,7 +116,7 @@ ebuf_add_head(struct ebuf *eb, const voi * We can't add more entries at the front, so we have to extend * our buffer. */ - if (ebuf_head_extend(eb, size) < 0) + if (ebuf_head_extend(eb, size) == -1) return (-1); } PJDLOG_ASSERT(size <= (size_t)(eb->eb_used - eb->eb_start)); @@ -143,7 +143,7 @@ ebuf_add_tail(struct ebuf *eb, const voi * We can't add more entries at the back, so we have to extend * our buffer. */ - if (ebuf_tail_extend(eb, size) < 0) + if (ebuf_tail_extend(eb, size) == -1) return (-1); } PJDLOG_ASSERT(size <= Modified: head/sbin/hastd/event.c ============================================================================== --- head/sbin/hastd/event.c Tue Jan 10 22:24:57 2012 (r229944) +++ head/sbin/hastd/event.c Tue Jan 10 22:39:07 2012 (r229945) @@ -61,11 +61,11 @@ event_send(const struct hast_resource *r "Unable to prepare event header"); goto done; } - if (hast_proto_send(res, res->hr_event, nvout, NULL, 0) < 0) { + if (hast_proto_send(res, res->hr_event, nvout, NULL, 0) == -1) { pjdlog_errno(LOG_ERR, "Unable to send event header"); goto done; } - if (hast_proto_recv_hdr(res->hr_event, &nvin) < 0) { + if (hast_proto_recv_hdr(res->hr_event, &nvin) == -1) { pjdlog_errno(LOG_ERR, "Unable to receive event header"); goto done; } @@ -92,7 +92,7 @@ event_recv(const struct hast_resource *r nvin = nvout = NULL; - if (hast_proto_recv_hdr(res->hr_event, &nvin) < 0) { + if (hast_proto_recv_hdr(res->hr_event, &nvin) == -1) { /* * First error log as debug. This is because worker process * most likely exited. @@ -145,7 +145,7 @@ event_recv(const struct hast_resource *r "Unable to prepare event header"); goto fail; } - if (hast_proto_send(res, res->hr_event, nvout, NULL, 0) < 0) { + if (hast_proto_send(res, res->hr_event, nvout, NULL, 0) == -1) { pjdlog_errno(LOG_ERR, "Unable to send event header"); goto fail; } Modified: head/sbin/hastd/hast_proto.c ============================================================================== --- head/sbin/hastd/hast_proto.c Tue Jan 10 22:24:57 2012 (r229944) +++ head/sbin/hastd/hast_proto.c Tue Jan 10 22:39:07 2012 (r229945) @@ -114,13 +114,13 @@ hast_proto_send(const struct hast_resour hdr.version = HAST_PROTO_VERSION; hdr.size = htole32((uint32_t)ebuf_size(eb)); - if (ebuf_add_head(eb, &hdr, sizeof(hdr)) < 0) + if (ebuf_add_head(eb, &hdr, sizeof(hdr)) == -1) goto end; hptr = ebuf_data(eb, &hsize); - if (proto_send(conn, hptr, hsize) < 0) + if (proto_send(conn, hptr, hsize) == -1) goto end; - if (data != NULL && proto_send(conn, dptr, size) < 0) + if (data != NULL && proto_send(conn, dptr, size) == -1) goto end; ret = 0; @@ -141,7 +141,7 @@ hast_proto_recv_hdr(const struct proto_c eb = NULL; nv = NULL; - if (proto_recv(conn, &hdr, sizeof(hdr)) < 0) + if (proto_recv(conn, &hdr, sizeof(hdr)) == -1) goto fail; if (hdr.version != HAST_PROTO_VERSION) { @@ -154,11 +154,11 @@ hast_proto_recv_hdr(const struct proto_c eb = ebuf_alloc(hdr.size); if (eb == NULL) goto fail; - if (ebuf_add_tail(eb, NULL, hdr.size) < 0) + if (ebuf_add_tail(eb, NULL, hdr.size) == -1) goto fail; hptr = ebuf_data(eb, NULL); PJDLOG_ASSERT(hptr != NULL); - if (proto_recv(conn, hptr, hdr.size) < 0) + if (proto_recv(conn, hptr, hdr.size) == -1) goto fail; nv = nv_ntoh(eb); if (nv == NULL) @@ -196,7 +196,7 @@ hast_proto_recv_data(const struct hast_r } else if (dsize == 0) { (void)nv_set_error(nv, 0); } else { - if (proto_recv(conn, data, dsize) < 0) + if (proto_recv(conn, data, dsize) == -1) goto end; for (ii = sizeof(pipeline) / sizeof(pipeline[0]); ii > 0; ii--) { Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Tue Jan 10 22:24:57 2012 (r229944) +++ head/sbin/hastd/hastd.c Tue Jan 10 22:39:07 2012 (r229945) @@ -174,7 +174,7 @@ descriptors_assert(const struct hast_res msg[0] = '\0'; maxfd = sysconf(_SC_OPEN_MAX); - if (maxfd < 0) { + if (maxfd == -1) { pjdlog_init(pjdlogmode); pjdlog_prefix_set("[%s] (%s) ", res->hr_name, role2str(res->hr_role)); @@ -452,7 +452,7 @@ resource_reload(const struct hast_resour pjdlog_error("Unable to allocate header for reload message."); return; } - if (hast_proto_send(res, res->hr_ctrl, nvout, NULL, 0) < 0) { + if (hast_proto_send(res, res->hr_ctrl, nvout, NULL, 0) == -1) { pjdlog_errno(LOG_ERR, "Unable to send reload message"); nv_free(nvout); return; @@ -460,7 +460,7 @@ resource_reload(const struct hast_resour nv_free(nvout); /* Receive response. */ - if (hast_proto_recv_hdr(res->hr_ctrl, &nvin) < 0) { + if (hast_proto_recv_hdr(res->hr_ctrl, &nvin) == -1) { pjdlog_errno(LOG_ERR, "Unable to receive reload reply"); return; } @@ -496,7 +496,7 @@ hastd_reload(void) */ if (strcmp(cfg->hc_controladdr, newcfg->hc_controladdr) != 0) { if (proto_server(newcfg->hc_controladdr, - &newcfg->hc_controlconn) < 0) { + &newcfg->hc_controlconn) == -1) { pjdlog_errno(LOG_ERR, "Unable to listen on control address %s", newcfg->hc_controladdr); @@ -545,7 +545,7 @@ hastd_reload(void) "Unable to open or create pidfile %s", newcfg->hc_pidfile); } - } else if (pidfile_write(newpfh) < 0) { + } else if (pidfile_write(newpfh) == -1) { /* Write PID to a file. */ pjdlog_errno(LOG_WARNING, "Unable to write PID to file %s", @@ -744,7 +744,7 @@ listen_accept(struct hastd_listen *lst) proto_local_address(lst->hl_conn, laddr, sizeof(laddr)); pjdlog_debug(1, "Accepting connection to %s.", laddr); - if (proto_accept(lst->hl_conn, &conn) < 0) { + if (proto_accept(lst->hl_conn, &conn) == -1) { pjdlog_errno(LOG_ERR, "Unable to accept connection %s", laddr); return; } @@ -754,7 +754,7 @@ listen_accept(struct hastd_listen *lst) pjdlog_info("Connection from %s to %s.", raddr, laddr); /* Error in setting timeout is not critical, but why should it fail? */ - if (proto_timeout(conn, HAST_TIMEOUT) < 0) + if (proto_timeout(conn, HAST_TIMEOUT) == -1) pjdlog_errno(LOG_WARNING, "Unable to set connection timeout"); nvin = nvout = nverr = NULL; @@ -773,7 +773,7 @@ listen_accept(struct hastd_listen *lst) } /* Ok, remote host can access at least one resource. */ - if (hast_proto_recv_hdr(conn, &nvin) < 0) { + if (hast_proto_recv_hdr(conn, &nvin) == -1) { pjdlog_errno(LOG_ERR, "Unable to receive header from %s", raddr); goto close; @@ -861,7 +861,7 @@ listen_accept(struct hastd_listen *lst) "Worker process exists (pid=%u), stopping it.", (unsigned int)res->hr_workerpid); /* Stop child process. */ - if (kill(res->hr_workerpid, SIGINT) < 0) { + if (kill(res->hr_workerpid, SIGINT) == -1) { pjdlog_errno(LOG_ERR, "Unable to stop worker process (pid=%u)", (unsigned int)res->hr_workerpid); @@ -911,7 +911,7 @@ listen_accept(struct hastd_listen *lst) strerror(nv_error(nvout))); goto fail; } - if (hast_proto_send(NULL, conn, nvout, NULL, 0) < 0) { + if (hast_proto_send(NULL, conn, nvout, NULL, 0) == -1) { int error = errno; pjdlog_errno(LOG_ERR, "Unable to send response to %s", @@ -940,7 +940,7 @@ fail: "Unable to prepare error header for %s", raddr); goto close; } - if (hast_proto_send(NULL, conn, nverr, NULL, 0) < 0) { + if (hast_proto_send(NULL, conn, nverr, NULL, 0) == -1) { pjdlog_errno(LOG_ERR, "Unable to send error to %s", raddr); goto close; } @@ -965,20 +965,20 @@ connection_migrate(struct hast_resource PJDLOG_ASSERT(res->hr_role == HAST_ROLE_PRIMARY); - if (proto_recv(res->hr_conn, &val, sizeof(val)) < 0) { + if (proto_recv(res->hr_conn, &val, sizeof(val)) == -1) { pjdlog_errno(LOG_WARNING, "Unable to receive connection command"); return; } if (proto_client(res->hr_sourceaddr[0] != '\0' ? res->hr_sourceaddr : NULL, - res->hr_remoteaddr, &conn) < 0) { + res->hr_remoteaddr, &conn) == -1) { val = errno; pjdlog_errno(LOG_WARNING, "Unable to create outgoing connection to %s", res->hr_remoteaddr); goto out; } - if (proto_connect(conn, -1) < 0) { + if (proto_connect(conn, -1) == -1) { val = errno; pjdlog_errno(LOG_WARNING, "Unable to connect to %s", res->hr_remoteaddr); @@ -987,11 +987,11 @@ connection_migrate(struct hast_resource } val = 0; out: - if (proto_send(res->hr_conn, &val, sizeof(val)) < 0) { + if (proto_send(res->hr_conn, &val, sizeof(val)) == -1) { pjdlog_errno(LOG_WARNING, "Unable to send reply to connection request"); } - if (val == 0 && proto_connection_send(res->hr_conn, conn) < 0) + if (val == 0 && proto_connection_send(res->hr_conn, conn) == -1) pjdlog_errno(LOG_WARNING, "Unable to send connection"); pjdlog_prefix_set("%s", ""); @@ -1261,14 +1261,14 @@ main(int argc, char *argv[]) PJDLOG_VERIFY(sigprocmask(SIG_SETMASK, &mask, NULL) == 0); /* Listen on control address. */ - if (proto_server(cfg->hc_controladdr, &cfg->hc_controlconn) < 0) { + if (proto_server(cfg->hc_controladdr, &cfg->hc_controlconn) == -1) { KEEP_ERRNO((void)pidfile_remove(pfh)); pjdlog_exit(EX_OSERR, "Unable to listen on control address %s", cfg->hc_controladdr); } /* Listen for remote connections. */ TAILQ_FOREACH(lst, &cfg->hc_listen, hl_next) { - if (proto_server(lst->hl_addr, &lst->hl_conn) < 0) { + if (proto_server(lst->hl_addr, &lst->hl_conn) == -1) { KEEP_ERRNO((void)pidfile_remove(pfh)); pjdlog_exit(EX_OSERR, "Unable to listen on address %s", lst->hl_addr); @@ -1276,7 +1276,7 @@ main(int argc, char *argv[]) } if (!foreground) { - if (daemon(0, 0) < 0) { + if (daemon(0, 0) == -1) { KEEP_ERRNO((void)pidfile_remove(pfh)); pjdlog_exit(EX_OSERR, "Unable to daemonize"); } @@ -1285,7 +1285,7 @@ main(int argc, char *argv[]) pjdlog_mode_set(PJDLOG_MODE_SYSLOG); /* Write PID to a file. */ - if (pidfile_write(pfh) < 0) { + if (pidfile_write(pfh) == -1) { pjdlog_errno(LOG_WARNING, "Unable to write PID to a file %s", cfg->hc_pidfile); Modified: head/sbin/hastd/hooks.c ============================================================================== --- head/sbin/hastd/hooks.c Tue Jan 10 22:24:57 2012 (r229944) +++ head/sbin/hastd/hooks.c Tue Jan 10 22:39:07 2012 (r229945) @@ -105,26 +105,26 @@ descriptors(void) * Redirect stdin, stdout and stderr to /dev/null. */ fd = open(_PATH_DEVNULL, O_RDONLY); - if (fd < 0) { + if (fd == -1) { pjdlog_errno(LOG_WARNING, "Unable to open %s for reading", _PATH_DEVNULL); } else if (fd != STDIN_FILENO) { - if (dup2(fd, STDIN_FILENO) < 0) { + if (dup2(fd, STDIN_FILENO) == -1) { pjdlog_errno(LOG_WARNING, "Unable to duplicate descriptor for stdin"); } close(fd); } fd = open(_PATH_DEVNULL, O_WRONLY); - if (fd < 0) { + if (fd == -1) { pjdlog_errno(LOG_WARNING, "Unable to open %s for writing", _PATH_DEVNULL); } else { - if (fd != STDOUT_FILENO && dup2(fd, STDOUT_FILENO) < 0) { + if (fd != STDOUT_FILENO && dup2(fd, STDOUT_FILENO) == -1) { pjdlog_errno(LOG_WARNING, "Unable to duplicate descriptor for stdout"); } - if (fd != STDERR_FILENO && dup2(fd, STDERR_FILENO) < 0) { + if (fd != STDERR_FILENO && dup2(fd, STDERR_FILENO) == -1) { pjdlog_errno(LOG_WARNING, "Unable to duplicate descriptor for stderr"); } Modified: head/sbin/hastd/metadata.c ============================================================================== --- head/sbin/hastd/metadata.c Tue Jan 10 22:24:57 2012 (r229944) +++ head/sbin/hastd/metadata.c Tue Jan 10 22:39:07 2012 (r229945) @@ -61,14 +61,14 @@ metadata_read(struct hast_resource *res, * Is this first metadata_read() call for this resource? */ if (res->hr_localfd == -1) { - if (provinfo(res, openrw) < 0) { + if (provinfo(res, openrw) == -1) { rerrno = errno; goto fail; } opened_here = true; pjdlog_debug(1, "Obtained info about %s.", res->hr_localpath); if (openrw) { - if (flock(res->hr_localfd, LOCK_EX | LOCK_NB) < 0) { + if (flock(res->hr_localfd, LOCK_EX | LOCK_NB) == -1) { rerrno = errno; if (errno == EOPNOTSUPP) { pjdlog_warning("Unable to lock %s (operation not supported), but continuing.", @@ -91,7 +91,7 @@ metadata_read(struct hast_resource *res, "Unable to allocate memory to read metadata"); goto fail; } - if (ebuf_add_tail(eb, NULL, METADATA_SIZE) < 0) { + if (ebuf_add_tail(eb, NULL, METADATA_SIZE) == -1) { rerrno = errno; pjdlog_errno(LOG_ERR, "Unable to allocate memory to read metadata"); @@ -101,7 +101,7 @@ metadata_read(struct hast_resource *res, buf = ebuf_data(eb, NULL); PJDLOG_ASSERT(buf != NULL); done = pread(res->hr_localfd, buf, METADATA_SIZE, 0); - if (done < 0 || done != METADATA_SIZE) { + if (done == -1 || done != METADATA_SIZE) { rerrno = errno; pjdlog_errno(LOG_ERR, "Unable to read metadata"); ebuf_free(eb); @@ -213,7 +213,7 @@ metadata_write(struct hast_resource *res PJDLOG_ASSERT(size < METADATA_SIZE); bcopy(ptr, buf, size); done = pwrite(res->hr_localfd, buf, METADATA_SIZE, 0); - if (done < 0 || done != METADATA_SIZE) { + if (done == -1 || done != METADATA_SIZE) { pjdlog_errno(LOG_ERR, "Unable to write metadata"); goto end; } Modified: head/sbin/hastd/nv.c ============================================================================== --- head/sbin/hastd/nv.c Tue Jan 10 22:24:57 2012 (r229944) +++ head/sbin/hastd/nv.c Tue Jan 10 22:39:07 2012 (r229945) @@ -385,7 +385,7 @@ nv_ntoh(struct ebuf *eb) nv->nv_ebuf = eb; nv->nv_magic = NV_MAGIC; - if (nv_validate(nv, &extra) < 0) { + if (nv_validate(nv, &extra) == -1) { rerrno = errno; nv->nv_magic = 0; free(nv); @@ -480,7 +480,7 @@ nv_add_stringv(struct nv *nv, const char ssize_t size; size = vasprintf(&value, valuefmt, valueap); - if (size < 0) { + if (size == -1) { if (nv->nv_error == 0) nv->nv_error = ENOMEM; return; @@ -627,7 +627,7 @@ nv_dump(struct nv *nv) unsigned int ii; bool swap; - if (nv_validate(nv, NULL) < 0) { + if (nv_validate(nv, NULL) == -1) { printf("error: %d\n", errno); return; } @@ -784,7 +784,7 @@ nv_add(struct nv *nv, const unsigned cha bcopy(name, nvh->nvh_name, namesize); /* Add header first. */ - if (ebuf_add_tail(nv->nv_ebuf, nvh, NVH_HSIZE(nvh)) < 0) { + if (ebuf_add_tail(nv->nv_ebuf, nvh, NVH_HSIZE(nvh)) == -1) { PJDLOG_ASSERT(errno != 0); if (nv->nv_error == 0) nv->nv_error = errno; @@ -793,7 +793,7 @@ nv_add(struct nv *nv, const unsigned cha } free(nvh); /* Add the actual data. */ - if (ebuf_add_tail(nv->nv_ebuf, value, vsize) < 0) { + if (ebuf_add_tail(nv->nv_ebuf, value, vsize) == -1) { PJDLOG_ASSERT(errno != 0); if (nv->nv_error == 0) nv->nv_error = errno; @@ -804,7 +804,7 @@ nv_add(struct nv *nv, const unsigned cha if (vsize == 0) return; PJDLOG_ASSERT(vsize > 0 && vsize <= sizeof(align)); - if (ebuf_add_tail(nv->nv_ebuf, align, vsize) < 0) { + if (ebuf_add_tail(nv->nv_ebuf, align, vsize) == -1) { PJDLOG_ASSERT(errno != 0); if (nv->nv_error == 0) nv->nv_error = errno; Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Tue Jan 10 22:24:57 2012 (r229944) +++ head/sbin/hastd/primary.c Tue Jan 10 22:39:07 2012 (r229945) @@ -254,7 +254,7 @@ cleanup(struct hast_resource *res) ggiod.gctl_version = G_GATE_VERSION; ggiod.gctl_unit = res->hr_ggateunit; ggiod.gctl_force = 1; - if (ioctl(res->hr_ggatefd, G_GATE_CMD_DESTROY, &ggiod) < 0) { + if (ioctl(res->hr_ggatefd, G_GATE_CMD_DESTROY, &ggiod) == -1) { pjdlog_errno(LOG_WARNING, "Unable to destroy hast/%s device", res->hr_provname); @@ -451,7 +451,7 @@ init_resuid(struct hast_resource *res) /* Initialize unique resource identifier. */ arc4random_buf(&res->hr_resuid, sizeof(res->hr_resuid)); mtx_unlock(&metadata_lock); - if (metadata_write(res) < 0) + if (metadata_write(res) == -1) exit(EX_NOINPUT); return (true); } @@ -463,19 +463,19 @@ init_local(struct hast_resource *res) unsigned char *buf; size_t mapsize; - if (metadata_read(res, true) < 0) + if (metadata_read(res, true) == -1) exit(EX_NOINPUT); mtx_init(&res->hr_amp_lock); if (activemap_init(&res->hr_amp, res->hr_datasize, res->hr_extentsize, - res->hr_local_sectorsize, res->hr_keepdirty) < 0) { + res->hr_local_sectorsize, res->hr_keepdirty) == -1) { primary_exit(EX_TEMPFAIL, "Unable to create activemap"); } mtx_init(&range_lock); cv_init(&range_regular_cond); - if (rangelock_init(&range_regular) < 0) + if (rangelock_init(&range_regular) == -1) primary_exit(EX_TEMPFAIL, "Unable to create regular range lock"); cv_init(&range_sync_cond); - if (rangelock_init(&range_sync) < 0) + if (rangelock_init(&range_sync) == -1) primary_exit(EX_TEMPFAIL, "Unable to create sync range lock"); mapsize = activemap_ondisk_size(res->hr_amp); buf = calloc(1, mapsize); @@ -500,7 +500,7 @@ init_local(struct hast_resource *res) */ res->hr_primary_localcnt = 0; res->hr_primary_remotecnt = 0; - if (metadata_write(res) < 0) + if (metadata_write(res) == -1) exit(EX_NOINPUT); } @@ -511,11 +511,11 @@ primary_connect(struct hast_resource *re int16_t val; val = 1; - if (proto_send(res->hr_conn, &val, sizeof(val)) < 0) { + if (proto_send(res->hr_conn, &val, sizeof(val)) == -1) { primary_exit(EX_TEMPFAIL, "Unable to send connection request to parent"); } - if (proto_recv(res->hr_conn, &val, sizeof(val)) < 0) { + if (proto_recv(res->hr_conn, &val, sizeof(val)) == -1) { primary_exit(EX_TEMPFAIL, "Unable to receive reply to connection request from parent"); } @@ -525,18 +525,18 @@ primary_connect(struct hast_resource *re res->hr_remoteaddr); return (-1); } - if (proto_connection_recv(res->hr_conn, true, &conn) < 0) { + if (proto_connection_recv(res->hr_conn, true, &conn) == -1) { primary_exit(EX_TEMPFAIL, "Unable to receive connection from parent"); } - if (proto_connect_wait(conn, res->hr_timeout) < 0) { + if (proto_connect_wait(conn, res->hr_timeout) == -1) { pjdlog_errno(LOG_WARNING, "Unable to connect to %s", res->hr_remoteaddr); proto_close(conn); return (-1); } /* Error in setting timeout is not critical, but why should it fail? */ - if (proto_timeout(conn, res->hr_timeout) < 0) + if (proto_timeout(conn, res->hr_timeout) == -1) pjdlog_errno(LOG_WARNING, "Unable to set connection timeout"); *connp = conn; @@ -583,7 +583,7 @@ init_remote(struct hast_resource *res, s nv_free(nvout); goto close; } - if (hast_proto_send(res, out, nvout, NULL, 0) < 0) { + if (hast_proto_send(res, out, nvout, NULL, 0) == -1) { pjdlog_errno(LOG_WARNING, "Unable to send handshake header to %s", res->hr_remoteaddr); @@ -591,7 +591,7 @@ init_remote(struct hast_resource *res, s goto close; } nv_free(nvout); - if (hast_proto_recv_hdr(out, &nvin) < 0) { + if (hast_proto_recv_hdr(out, &nvin) == -1) { pjdlog_errno(LOG_WARNING, "Unable to receive handshake header from %s", res->hr_remoteaddr); @@ -655,7 +655,7 @@ init_remote(struct hast_resource *res, s nv_free(nvout); goto close; } - if (hast_proto_send(res, in, nvout, NULL, 0) < 0) { + if (hast_proto_send(res, in, nvout, NULL, 0) == -1) { pjdlog_errno(LOG_WARNING, "Unable to send handshake header to %s", res->hr_remoteaddr); @@ -663,7 +663,7 @@ init_remote(struct hast_resource *res, s goto close; } nv_free(nvout); - if (hast_proto_recv_hdr(out, &nvin) < 0) { + if (hast_proto_recv_hdr(out, &nvin) == -1) { pjdlog_errno(LOG_WARNING, "Unable to receive handshake header from %s", res->hr_remoteaddr); @@ -726,7 +726,7 @@ init_remote(struct hast_resource *res, s * download its activemap. */ if (hast_proto_recv_data(res, out, nvin, map, - mapsize) < 0) { + mapsize) == -1) { pjdlog_errno(LOG_ERR, "Unable to receive remote activemap"); nv_free(nvin); @@ -801,7 +801,7 @@ init_ggate(struct hast_resource *res) * We communicate with ggate via /dev/ggctl. Open it. */ res->hr_ggatefd = open("/dev/" G_GATE_CTL_NAME, O_RDWR); - if (res->hr_ggatefd < 0) + if (res->hr_ggatefd == -1) primary_exit(EX_OSFILE, "Unable to open /dev/" G_GATE_CTL_NAME); /* * Create provider before trying to connect, as connection failure @@ -859,7 +859,7 @@ hastd_primary(struct hast_resource *res) * Create communication channel for sending control commands from * parent to child. */ - if (proto_client(NULL, "socketpair://", &res->hr_ctrl) < 0) { + if (proto_client(NULL, "socketpair://", &res->hr_ctrl) == -1) { /* TODO: There's no need for this to be fatal error. */ KEEP_ERRNO((void)pidfile_remove(pfh)); pjdlog_exit(EX_OSERR, @@ -868,7 +868,7 @@ hastd_primary(struct hast_resource *res) /* * Create communication channel for sending events from child to parent. */ - if (proto_client(NULL, "socketpair://", &res->hr_event) < 0) { + if (proto_client(NULL, "socketpair://", &res->hr_event) == -1) { /* TODO: There's no need for this to be fatal error. */ KEEP_ERRNO((void)pidfile_remove(pfh)); pjdlog_exit(EX_OSERR, @@ -878,7 +878,7 @@ hastd_primary(struct hast_resource *res) * Create communication channel for sending connection requests from * child to parent. */ - if (proto_client(NULL, "socketpair://", &res->hr_conn) < 0) { + if (proto_client(NULL, "socketpair://", &res->hr_conn) == -1) { /* TODO: There's no need for this to be fatal error. */ KEEP_ERRNO((void)pidfile_remove(pfh)); pjdlog_exit(EX_OSERR, @@ -1095,7 +1095,7 @@ write_complete(struct hast_resource *res mtx_unlock(&metadata_lock); } rw_unlock(&hio_remote_lock[ncomp]); - if (ioctl(res->hr_ggatefd, G_GATE_CMD_DONE, ggio) < 0) + if (ioctl(res->hr_ggatefd, G_GATE_CMD_DONE, ggio) == -1) primary_exit(EX_OSERR, "G_GATE_CMD_DONE failed"); hio->hio_done = true; } @@ -1133,7 +1133,7 @@ ggate_recv_thread(void *arg) pjdlog_debug(2, "ggate_recv: (%p) Waiting for request from the kernel.", hio); - if (ioctl(res->hr_ggatefd, G_GATE_CMD_START, ggio) < 0) { + if (ioctl(res->hr_ggatefd, G_GATE_CMD_START, ggio) == -1) { if (sigexit_received) pthread_exit(NULL); primary_exit(EX_OSERR, "G_GATE_CMD_START failed"); @@ -1225,7 +1225,7 @@ ggate_recv_thread(void *arg) continue; } if (rangelock_add(range_regular, - ggio->gctl_offset, ggio->gctl_length) < 0) { + ggio->gctl_offset, ggio->gctl_length) == -1) { mtx_unlock(&range_lock); pjdlog_debug(2, "regular: Range offset=%jd length=%zu is already locked, waiting.", @@ -1296,7 +1296,7 @@ local_send_thread(void *arg) /* * If READ failed, try to read from remote node. */ - if (ret < 0) { + if (ret == -1) { reqlog(LOG_WARNING, 0, ggio, "Local request failed (%s), trying remote node. ", strerror(errno)); @@ -1313,7 +1313,7 @@ local_send_thread(void *arg) ret = pwrite(res->hr_localfd, ggio->gctl_data, ggio->gctl_length, ggio->gctl_offset + res->hr_localoff); - if (ret < 0) { + if (ret == -1) { hio->hio_errors[ncomp] = errno; reqlog(LOG_WARNING, 0, ggio, "Local request failed (%s): ", @@ -1336,7 +1336,7 @@ local_send_thread(void *arg) ret = g_delete(res->hr_localfd, ggio->gctl_offset + res->hr_localoff, ggio->gctl_length); - if (ret < 0) { + if (ret == -1) { hio->hio_errors[ncomp] = errno; reqlog(LOG_WARNING, 0, ggio, "Local request failed (%s): ", @@ -1352,7 +1352,7 @@ local_send_thread(void *arg) break; } ret = g_flush(res->hr_localfd); - if (ret < 0) { + if (ret == -1) { if (errno == EOPNOTSUPP) res->hr_localflush = false; hio->hio_errors[ncomp] = errno; @@ -1406,7 +1406,7 @@ keepalive_send(struct hast_resource *res "keepalive_send: Unable to prepare header to send."); return; } - if (hast_proto_send(res, res->hr_remoteout, nv, NULL, 0) < 0) { + if (hast_proto_send(res, res->hr_remoteout, nv, NULL, 0) == -1) { rw_unlock(&hio_remote_lock[ncomp]); pjdlog_common(LOG_DEBUG, 1, errno, "keepalive_send: Unable to send request"); @@ -1520,7 +1520,7 @@ remote_send_thread(void *arg) TAILQ_INSERT_TAIL(&hio_recv_list[ncomp], hio, hio_next[ncomp]); mtx_unlock(&hio_recv_list_lock[ncomp]); if (hast_proto_send(res, res->hr_remoteout, nv, data, - data != NULL ? length : 0) < 0) { + data != NULL ? length : 0) == -1) { hio->hio_errors[ncomp] = errno; rw_unlock(&hio_remote_lock[ncomp]); pjdlog_debug(2, @@ -1617,7 +1617,7 @@ remote_recv_thread(void *arg) mtx_unlock(&hio_recv_list_lock[ncomp]); goto done_queue; } - if (hast_proto_recv_hdr(res->hr_remotein, &nv) < 0) { + if (hast_proto_recv_hdr(res->hr_remotein, &nv) == -1) { pjdlog_errno(LOG_ERR, "Unable to receive reply header"); rw_unlock(&hio_remote_lock[ncomp]); @@ -1665,7 +1665,7 @@ remote_recv_thread(void *arg) goto done_queue; } if (hast_proto_recv_data(res, res->hr_remotein, nv, - ggio->gctl_data, ggio->gctl_length) < 0) { + ggio->gctl_data, ggio->gctl_length) == -1) { hio->hio_errors[ncomp] = errno; pjdlog_errno(LOG_ERR, "Unable to receive reply data"); @@ -1766,7 +1766,7 @@ ggate_send_thread(void *arg) if (!hio->hio_done) write_complete(res, hio); } else { - if (ioctl(res->hr_ggatefd, G_GATE_CMD_DONE, ggio) < 0) { + if (ioctl(res->hr_ggatefd, G_GATE_CMD_DONE, ggio) == -1) { primary_exit(EX_OSERR, "G_GATE_CMD_DONE failed"); } @@ -1834,7 +1834,7 @@ sync_thread(void *arg __unused) mtx_unlock(&res->hr_amp_lock); if (dorewind) { dorewind = false; - if (offset < 0) + if (offset == -1) pjdlog_info("Nodes are in sync."); else { pjdlog_info("Synchronization started. %NB to go.", @@ -1844,7 +1844,7 @@ sync_thread(void *arg __unused) gettimeofday(&tstart, NULL); } } - if (offset < 0) { + if (offset == -1) { sync_stop(); pjdlog_debug(1, "Nothing to synchronize."); /* @@ -1903,7 +1903,7 @@ sync_thread(void *arg __unused) mtx_unlock(&range_lock); continue; } - if (rangelock_add(range_sync, offset, length) < 0) { + if (rangelock_add(range_sync, offset, length) == -1) { mtx_unlock(&range_lock); pjdlog_debug(2, "sync: Range offset=%jd length=%jd is already locked, waiting.", @@ -2124,12 +2124,12 @@ primary_config_reload(struct hast_resour } rw_unlock(&hio_remote_lock[ii]); if (proto_timeout(gres->hr_remotein, - gres->hr_timeout) < 0) { + gres->hr_timeout) == -1) { pjdlog_errno(LOG_WARNING, "Unable to set connection timeout"); } if (proto_timeout(gres->hr_remoteout, - gres->hr_timeout) < 0) { + gres->hr_timeout) == -1) { pjdlog_errno(LOG_WARNING, "Unable to set connection timeout"); } Modified: head/sbin/hastd/proto.c ============================================================================== --- head/sbin/hastd/proto.c Tue Jan 10 22:24:57 2012 (r229944) +++ head/sbin/hastd/proto.c Tue Jan 10 22:39:07 2012 (r229945) @@ -419,14 +419,14 @@ proto_timeout(const struct proto_conn *c PJDLOG_ASSERT(conn->pc_proto != NULL); fd = proto_descriptor(conn); - if (fd < 0) + if (fd == -1) return (-1); tv.tv_sec = timeout; tv.tv_usec = 0; - if (setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv)) < 0) + if (setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv)) == -1) return (-1); - if (setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv)) < 0) + if (setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv)) == -1) return (-1); return (0); Modified: head/sbin/hastd/proto_common.c ============================================================================== --- head/sbin/hastd/proto_common.c Tue Jan 10 22:24:57 2012 (r229944) +++ head/sbin/hastd/proto_common.c Tue Jan 10 22:39:07 2012 (r229945) @@ -116,7 +116,7 @@ proto_common_send(int sock, const unsign done = send(sock, data, sendsize, MSG_NOSIGNAL); if (done == 0) { return (ENOTCONN); - } else if (done < 0) { + } else if (done == -1) { if (errno == EINTR) continue; if (errno == ENOBUFS) { @@ -215,7 +215,7 @@ proto_common_recv(int sock, unsigned cha } while (done == -1 && errno == EINTR); if (done == 0) { return (ENOTCONN); - } else if (done < 0) { + } else if (done == -1) { /* * If this is blocking socket and we got EAGAIN, this * means the request timed out. Translate errno to Modified: head/sbin/hastd/proto_socketpair.c ============================================================================== --- head/sbin/hastd/proto_socketpair.c Tue Jan 10 22:24:57 2012 (r229944) +++ head/sbin/hastd/proto_socketpair.c Tue Jan 10 22:39:07 2012 (r229945) @@ -70,7 +70,7 @@ sp_client(const char *srcaddr, const cha if (spctx == NULL) return (errno); - if (socketpair(PF_UNIX, SOCK_STREAM, 0, spctx->sp_fd) < 0) { + if (socketpair(PF_UNIX, SOCK_STREAM, 0, spctx->sp_fd) == -1) { ret = errno; free(spctx); return (ret); Modified: head/sbin/hastd/proto_tcp.c ============================================================================== --- head/sbin/hastd/proto_tcp.c Tue Jan 10 22:24:57 2012 (r229944) +++ head/sbin/hastd/proto_tcp.c Tue Jan 10 22:39:07 2012 (r229945) @@ -151,7 +151,7 @@ tcp_addr(const char *addr, int defport, /* Port not given, use the default. */ port = defport; } else { - if (numfromstr(pp + 1, 1, 65535, &port) < 0) + if (numfromstr(pp + 1, 1, 65535, &port) == -1) return (errno); } (void)snprintf(portstr, sizeof(portstr), "%jd", (intmax_t)port); @@ -275,7 +275,7 @@ tcp_client(const char *srcaddr, const ch tcp_close(tctx); return (ret); } - if (bind(tctx->tc_fd, (struct sockaddr *)&sa, sa.ss_len) < 0) { + if (bind(tctx->tc_fd, (struct sockaddr *)&sa, sa.ss_len) == -1) { ret = errno; tcp_close(tctx); return (ret); @@ -423,12 +423,12 @@ tcp_server(const char *addr, void **ctxp PJDLOG_ASSERT(tctx->tc_sa.ss_family != AF_UNSPEC); if (bind(tctx->tc_fd, (struct sockaddr *)&tctx->tc_sa, - tctx->tc_sa.ss_len) < 0) { + tctx->tc_sa.ss_len) == -1) { ret = errno; tcp_close(tctx); return (ret); } - if (listen(tctx->tc_fd, 8) < 0) { + if (listen(tctx->tc_fd, 8) == -1) { ret = errno; tcp_close(tctx); return (ret); @@ -458,7 +458,7 @@ tcp_accept(void *ctx, void **newctxp) fromlen = tctx->tc_sa.ss_len; newtctx->tc_fd = accept(tctx->tc_fd, (struct sockaddr *)&tctx->tc_sa, &fromlen); - if (newtctx->tc_fd < 0) { + if (newtctx->tc_fd == -1) { ret = errno; free(newtctx); return (ret); @@ -530,7 +530,7 @@ tcp_address_match(const void *ctx, const return (false); salen = sizeof(sa2); - if (getpeername(tctx->tc_fd, (struct sockaddr *)&sa2, &salen) < 0) + if (getpeername(tctx->tc_fd, (struct sockaddr *)&sa2, &salen) == -1) return (false); if (sa1.ss_family != sa2.ss_family || sa1.ss_len != sa2.ss_len) @@ -573,7 +573,7 @@ tcp_local_address(const void *ctx, char PJDLOG_ASSERT(tctx->tc_magic == TCP_CTX_MAGIC); salen = sizeof(sa); - if (getsockname(tctx->tc_fd, (struct sockaddr *)&sa, &salen) < 0) { + if (getsockname(tctx->tc_fd, (struct sockaddr *)&sa, &salen) == -1) { PJDLOG_VERIFY(strlcpy(addr, "N/A", size) < size); return; } @@ -591,7 +591,7 @@ tcp_remote_address(const void *ctx, char PJDLOG_ASSERT(tctx->tc_magic == TCP_CTX_MAGIC); salen = sizeof(sa); - if (getpeername(tctx->tc_fd, (struct sockaddr *)&sa, &salen) < 0) { + if (getpeername(tctx->tc_fd, (struct sockaddr *)&sa, &salen) == -1) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 22:41:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20E741065672; Tue, 10 Jan 2012 22:41:10 +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 101FF8FC13; Tue, 10 Jan 2012 22:41: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 q0AMf9Og030755; Tue, 10 Jan 2012 22:41:09 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0AMf9YA030753; Tue, 10 Jan 2012 22:41:09 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201201102241.q0AMf9YA030753@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 10 Jan 2012 22:41:09 +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: r229946 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 22:41:10 -0000 Author: pjd Date: Tue Jan 10 22:41:09 2012 New Revision: 229946 URL: http://svn.freebsd.org/changeset/base/229946 Log: - Fix a bug where pidfile was removed in SIGHUP when it hasn't changed in configuration file. - Log the fact that pidfile has changed. MFC after: 3 days Modified: head/sbin/hastd/hastd.c Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Tue Jan 10 22:39:07 2012 (r229945) +++ head/sbin/hastd/hastd.c Tue Jan 10 22:41:09 2012 (r229946) @@ -573,10 +573,14 @@ hastd_reload(void) /* * Switch to new pidfile. */ - (void)pidfile_remove(pfh); - pfh = newpfh; - (void)strlcpy(cfg->hc_pidfile, newcfg->hc_pidfile, - sizeof(cfg->hc_pidfile)); + if (newpfh != NULL) { + pjdlog_info("Pidfile changed from %s to %s.", cfg->hc_pidfile, + newcfg->hc_pidfile); + (void)pidfile_remove(pfh); + pfh = newpfh; + (void)strlcpy(cfg->hc_pidfile, newcfg->hc_pidfile, + sizeof(cfg->hc_pidfile)); + } /* * Switch to new listen addresses. Close all that were removed. */ From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 22:43:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 899BD1065673; Tue, 10 Jan 2012 22:43:44 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id B006F15053F; Tue, 10 Jan 2012 22:43:37 +0000 (UTC) Message-ID: <4F0CBF11.6080608@FreeBSD.org> Date: Tue, 10 Jan 2012 14:43:29 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <201201102239.q0AMd8i6030635@svn.freebsd.org> In-Reply-To: <201201102239.q0AMd8i6030635@svn.freebsd.org> X-Enigmail-Version: undefined 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: r229945 - in head/sbin: hastctl hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 22:43:44 -0000 On 01/10/2012 14:39, Pawel Jakub Dawidek wrote: > For functions that return -1 on failure check exactly for -1 and not for > any negative number. what is the likelihood that at some point in the future the semantics for those functions will change, such that more than one negative value may be returned? -- You can observe a lot just by watching. -- Yogi Berra Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 22:51:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AD5D106564A; Tue, 10 Jan 2012 22:51:39 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id E17178FC18; Tue, 10 Jan 2012 22:51:38 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id CB365DE2; Tue, 10 Jan 2012 23:51:36 +0100 (CET) Date: Tue, 10 Jan 2012 23:50:29 +0100 From: Pawel Jakub Dawidek To: Doug Barton Message-ID: <20120110225028.GF1694@garage.freebsd.pl> References: <201201102239.q0AMd8i6030635@svn.freebsd.org> <4F0CBF11.6080608@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="oPmsXEqKQNHCSXW7" Content-Disposition: inline In-Reply-To: <4F0CBF11.6080608@FreeBSD.org> X-OS: FreeBSD 9.0-CURRENT amd64 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: r229945 - in head/sbin: hastctl hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 22:51:39 -0000 --oPmsXEqKQNHCSXW7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 10, 2012 at 02:43:29PM -0800, Doug Barton wrote: > On 01/10/2012 14:39, Pawel Jakub Dawidek wrote: > > For functions that return -1 on failure check exactly for -1 and not = for > > any negative number. >=20 > what is the likelihood that at some point in the future the semantics > for those functions will change, such that more than one negative value > may be returned? This is of course just being extra careful, but what if the function will start returning negative values different than -1 on success? This works in both direction, but is really only theory. All in all, the manual pages now clearly state that those functions return -1 on failure. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --oPmsXEqKQNHCSXW7 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk8MwLQACgkQForvXbEpPzRVOQCg20IjxPQuumoBdNEqk8UuoPoZ MUUAn3NWShHYJdqaFxg71KAb4Bn7CCdW =oenf -----END PGP SIGNATURE----- --oPmsXEqKQNHCSXW7-- From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 23:02:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59F0E1065675; Tue, 10 Jan 2012 23:02:02 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E37A8FC14; Tue, 10 Jan 2012 23:02:02 +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 q0AN22rB031454; Tue, 10 Jan 2012 23:02:02 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0AN22FK031452; Tue, 10 Jan 2012 23:02:02 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201201102302.q0AN22FK031452@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 10 Jan 2012 23:02:02 +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: r229947 - head/sys/dev/netmap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 23:02:02 -0000 Author: luigi Date: Tue Jan 10 23:02:01 2012 New Revision: 229947 URL: http://svn.freebsd.org/changeset/base/229947 Log: other simplifications in the internal interfaces to the memory allocator. Modified: head/sys/dev/netmap/netmap.c Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Tue Jan 10 22:41:09 2012 (r229946) +++ head/sys/dev/netmap/netmap.c Tue Jan 10 23:02:01 2012 (r229947) @@ -152,8 +152,10 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, free_b * Buffer 0 is the 'junk' buffer. */ static void -netmap_new_bufs(struct netmap_buf_pool *p, struct netmap_slot *slot, u_int n) +netmap_new_bufs(struct netmap_if *nifp __unused, + struct netmap_slot *slot, u_int n) { + struct netmap_buf_pool *p = &nm_buf_pool; uint32_t bi = 0; /* index in the bitmap */ uint32_t mask, j, i = 0; /* slot counter */ @@ -182,8 +184,10 @@ netmap_new_bufs(struct netmap_buf_pool * static void -netmap_free_buf(struct netmap_buf_pool *p, uint32_t i) +netmap_free_buf(struct netmap_if *nifp __unused, uint32_t i) { + struct netmap_buf_pool *p = &nm_buf_pool; + uint32_t pos, mask; if (i >= p->total_buffers) { D("invalid free index %d", i); @@ -399,15 +403,13 @@ netmap_dtor(void *data) ring = na->tx_rings[i].ring; lim = na->tx_rings[i].nkr_num_slots; for (j = 0; j < lim; j++) - netmap_free_buf(&nm_buf_pool, - ring->slot[j].buf_idx); + netmap_free_buf(nifp, ring->slot[j].buf_idx); ND("rx queue %d", i); ring = na->rx_rings[i].ring; lim = na->rx_rings[i].nkr_num_slots; for (j = 0; j < lim; j++) - netmap_free_buf(&nm_buf_pool, - ring->slot[j].buf_idx); + netmap_free_buf(nifp, ring->slot[j].buf_idx); } NMA_UNLOCK(); netmap_free_rings(na); @@ -516,7 +518,7 @@ error: */ ring->avail = kring->nr_hwavail = numdesc - 1; ring->cur = kring->nr_hwcur = 0; - netmap_new_bufs(&nm_buf_pool, ring->slot, numdesc); + netmap_new_bufs(nifp, ring->slot, numdesc); ofs += sizeof(struct netmap_ring) + numdesc * sizeof(struct netmap_slot); @@ -535,7 +537,7 @@ error: kring->nkr_num_slots = numdesc; ring->cur = kring->nr_hwcur = 0; ring->avail = kring->nr_hwavail = 0; /* empty */ - netmap_new_bufs(&nm_buf_pool, ring->slot, numdesc); + netmap_new_bufs(nifp, ring->slot, numdesc); ofs += sizeof(struct netmap_ring) + numdesc * sizeof(struct netmap_slot); } @@ -580,8 +582,9 @@ netmap_mmap(__unused struct cdev *dev, v { if (nprot & PROT_EXEC) return (-1); // XXX -1 or EINVAL ? + ND("request for offset 0x%x", (uint32_t)offset); - *paddr = vtophys(netmap_mem_d->nm_buffer) + offset; + *paddr = netmap_ofstophys(offset); return (0); } @@ -953,8 +956,7 @@ error: nmr->nr_numrings = na->num_queues; nmr->nr_numslots = na->num_tx_desc; nmr->nr_memsize = netmap_mem_d->nm_totalsize; - nmr->nr_offset = - ((char *) nifp - (char *) netmap_mem_d->nm_buffer); + nmr->nr_offset = netmap_if_offset(nifp); break; case NIOCUNREGIF: From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 23:06:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F2961065670; Tue, 10 Jan 2012 23:06:10 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id E95BE8FC12; Tue, 10 Jan 2012 23:06:09 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id CD1CD1DD607; Wed, 11 Jan 2012 00:06:07 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id AF65E28468; Wed, 11 Jan 2012 00:06:07 +0100 (CET) Date: Wed, 11 Jan 2012 00:06:07 +0100 From: Jilles Tjoelker To: Guy Helmer Message-ID: <20120110230607.GA15897@stack.nl> References: <201201101843.q0AIhRuM022949@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201201101843.q0AIhRuM022949@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: r229936 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 23:06:10 -0000 On Tue, Jan 10, 2012 at 06:43:27PM +0000, Guy Helmer wrote: > Author: ghelmer > Date: Tue Jan 10 18:43:27 2012 > New Revision: 229936 > URL: http://svn.freebsd.org/changeset/base/229936 > Log: > Set the FD_CLOEXEC flag on the open pidfile file descriptor. > Discussed with: pjd, des > Modified: > head/lib/libutil/pidfile.c > + /* > + * Prevent the file descriptor from escaping to other > + * programs via exec(3). > + */ > + if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) { Consider adding O_CLOEXEC to the flopen() flags instead. That saves a system call and removes a possible race condition with fork/exec from threads or signal handlers. -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Tue Jan 10 23:37:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCB741065672; Tue, 10 Jan 2012 23:37:32 +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 CBE698FC0A; Tue, 10 Jan 2012 23:37: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 q0ANbW3j032590; Tue, 10 Jan 2012 23:37:32 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0ANbWQF032588; Tue, 10 Jan 2012 23:37:32 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201102337.q0ANbWQF032588@svn.freebsd.org> From: Adrian Chadd Date: Tue, 10 Jan 2012 23:37: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: r229948 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jan 2012 23:37:33 -0000 Author: adrian Date: Tue Jan 10 23:37:32 2012 New Revision: 229948 URL: http://svn.freebsd.org/changeset/base/229948 Log: Add in the vendor extension bit in the radiotap header. Modified: head/sys/net80211/ieee80211_radiotap.h Modified: head/sys/net80211/ieee80211_radiotap.h ============================================================================== --- head/sys/net80211/ieee80211_radiotap.h Tue Jan 10 23:02:01 2012 (r229947) +++ head/sys/net80211/ieee80211_radiotap.h Tue Jan 10 23:37:32 2012 (r229948) @@ -190,6 +190,7 @@ enum ieee80211_radiotap_type { IEEE80211_RADIOTAP_DB_ANTNOISE = 13, /* NB: gap for netbsd definitions */ IEEE80211_RADIOTAP_XCHANNEL = 18, + IEEE80211_RADIOTAP_VENDOREXT = 30, IEEE80211_RADIOTAP_EXT = 31, }; From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 00:16:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5DD2106566B; Wed, 11 Jan 2012 00:16: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 D37808FC12; Wed, 11 Jan 2012 00: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 q0B0GiEU033841; Wed, 11 Jan 2012 00:16:44 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0B0GigL033839; Wed, 11 Jan 2012 00:16:44 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201110016.q0B0GigL033839@svn.freebsd.org> From: Adrian Chadd Date: Wed, 11 Jan 2012 00: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: r229949 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 00:16:45 -0000 Author: adrian Date: Wed Jan 11 00:16:44 2012 New Revision: 229949 URL: http://svn.freebsd.org/changeset/base/229949 Log: style(9) changes. This shouldn't change functionality. Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Tue Jan 10 23:37:32 2012 (r229948) +++ head/sys/dev/ath/if_ath_tx.c Wed Jan 11 00:16:44 2012 (r229949) @@ -435,7 +435,8 @@ ath_tx_setds_11n(struct ath_softc *sc, s * Setup the last descriptor in the list. * bf_prev points to the last; bf is NULL here. */ - ath_hal_setuplasttxdesc(sc->sc_ah, bf_prev->bf_desc, bf_first->bf_desc); + ath_hal_setuplasttxdesc(sc->sc_ah, bf_prev->bf_desc, + bf_first->bf_desc); /* * Set the first descriptor bf_lastds field to point to @@ -481,7 +482,8 @@ ath_tx_handoff_mcast(struct ath_softc *s * Hand-off packet to a hardware queue. */ static void -ath_tx_handoff_hw(struct ath_softc *sc, struct ath_txq *txq, struct ath_buf *bf) +ath_tx_handoff_hw(struct ath_softc *sc, struct ath_txq *txq, + struct ath_buf *bf) { struct ath_hal *ah = sc->sc_ah; @@ -548,7 +550,8 @@ ath_tx_handoff_hw(struct ath_softc *sc, * frame at SWBA. */ if (!qbusy) { - ath_hal_puttxbuf(ah, txq->axq_qnum, bf->bf_daddr); + ath_hal_puttxbuf(ah, txq->axq_qnum, + bf->bf_daddr); txq->axq_flags &= ~ATH_TXQ_PUTPENDING; DPRINTF(sc, ATH_DEBUG_XMIT, "%s: TXDP[%u] = %p (%p) depth %d\n", @@ -566,7 +569,8 @@ ath_tx_handoff_hw(struct ath_softc *sc, DPRINTF(sc, ATH_DEBUG_XMIT, "%s: link[%u](%p)=%p (%p) depth %d\n", __func__, txq->axq_qnum, txq->axq_link, - (caddr_t)bf->bf_daddr, bf->bf_desc, txq->axq_depth); + (caddr_t)bf->bf_daddr, bf->bf_desc, + txq->axq_depth); if ((txq->axq_flags & ATH_TXQ_PUTPENDING) && !qbusy) { /* * The q was busy when we previously tried @@ -599,7 +603,8 @@ ath_tx_handoff_hw(struct ath_softc *sc, DPRINTF(sc, ATH_DEBUG_XMIT, "%s: link[%u](%p)=%p (%p) depth %d\n", __func__, txq->axq_qnum, txq->axq_link, - (caddr_t)bf->bf_daddr, bf->bf_desc, txq->axq_depth); + (caddr_t)bf->bf_daddr, bf->bf_desc, + txq->axq_depth); } #endif /* IEEE80211_SUPPORT_TDMA */ if (bf->bf_state.bfs_aggr) @@ -652,7 +657,8 @@ ath_tx_handoff(struct ath_softc *sc, str static int ath_tx_tag_crypto(struct ath_softc *sc, struct ieee80211_node *ni, - struct mbuf *m0, int iswep, int isfrag, int *hdrlen, int *pktlen, int *keyix) + struct mbuf *m0, int iswep, int isfrag, int *hdrlen, int *pktlen, + int *keyix) { if (iswep) { const struct ieee80211_cipher *cip; @@ -671,7 +677,7 @@ ath_tx_tag_crypto(struct ath_softc *sc, * 802.11 layer counts failures and provides * debugging/diagnostics. */ - return 0; + return (0); } /* * Adjust the packet + header lengths for the crypto @@ -698,7 +704,7 @@ ath_tx_tag_crypto(struct ath_softc *sc, } else (*keyix) = HAL_TXKEYIX_INVALID; - return 1; + return (1); } static uint8_t @@ -720,7 +726,7 @@ ath_tx_get_rtscts_rate(struct ath_hal *a if (shortPreamble) ctsrate |= rt->info[cix].shortPreamble; - return ctsrate; + return (ctsrate); } /* @@ -737,7 +743,7 @@ ath_tx_calc_ctsduration(struct ath_hal * if (rt->info[cix].phy == IEEE80211_T_HT) { printf("%s: HT rate where it shouldn't be (0x%x)\n", __func__, rt->info[cix].rateCode); - return -1; + return (-1); } /* @@ -765,7 +771,7 @@ ath_tx_calc_ctsduration(struct ath_hal * ctsduration += rt->info[rix].lpAckDuration; } - return ctsduration; + return (ctsduration); } /* @@ -1906,9 +1912,11 @@ ath_tx_addto_baw(struct ath_softc *sc, s if (bf->bf_state.bfs_addedbaw) device_printf(sc->sc_dev, - "%s: re-added? tid=%d, seqno %d; window %d:%d; baw head=%d tail=%d\n", + "%s: re-added? tid=%d, seqno %d; window %d:%d; " + "baw head=%d tail=%d\n", __func__, tid->tid, SEQNO(bf->bf_state.bfs_seqno), - tap->txa_start, tap->txa_wnd, tid->baw_head, tid->baw_tail); + tap->txa_start, tap->txa_wnd, tid->baw_head, + tid->baw_tail); /* * ni->ni_txseqs[] is the currently allocated seqno. @@ -1917,9 +1925,11 @@ ath_tx_addto_baw(struct ath_softc *sc, s index = ATH_BA_INDEX(tap->txa_start, SEQNO(bf->bf_state.bfs_seqno)); cindex = (tid->baw_head + index) & (ATH_TID_MAX_BUFS - 1); DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, - "%s: tid=%d, seqno %d; window %d:%d; index=%d cindex=%d baw head=%d tail=%d\n", + "%s: tid=%d, seqno %d; window %d:%d; index=%d cindex=%d " + "baw head=%d tail=%d\n", __func__, tid->tid, SEQNO(bf->bf_state.bfs_seqno), - tap->txa_start, tap->txa_wnd, index, cindex, tid->baw_head, tid->baw_tail); + tap->txa_start, tap->txa_wnd, index, cindex, tid->baw_head, + tid->baw_tail); #if 0 @@ -1941,7 +1951,8 @@ ath_tx_addto_baw(struct ath_softc *sc, s } tid->tx_buf[cindex] = bf; - if (index >= ((tid->baw_tail - tid->baw_head) & (ATH_TID_MAX_BUFS - 1))) { + if (index >= ((tid->baw_tail - tid->baw_head) & + (ATH_TID_MAX_BUFS - 1))) { tid->baw_tail = cindex; INCR(tid->baw_tail, ATH_TID_MAX_BUFS); } @@ -2019,7 +2030,8 @@ ath_tx_update_baw(struct ath_softc *sc, cindex = (tid->baw_head + index) & (ATH_TID_MAX_BUFS - 1); DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, - "%s: tid=%d, baw=%d:%d, seqno=%d, index=%d, cindex=%d, baw head=%d, tail=%d\n", + "%s: tid=%d, baw=%d:%d, seqno=%d, index=%d, cindex=%d, " + "baw head=%d, tail=%d\n", __func__, tid->tid, tap->txa_start, tap->txa_wnd, seqno, index, cindex, tid->baw_head, tid->baw_tail); @@ -2044,11 +2056,13 @@ ath_tx_update_baw(struct ath_softc *sc, tid->tx_buf[cindex] = NULL; - while (tid->baw_head != tid->baw_tail && !tid->tx_buf[tid->baw_head]) { + while (tid->baw_head != tid->baw_tail && + !tid->tx_buf[tid->baw_head]) { INCR(tap->txa_start, IEEE80211_SEQ_RANGE); INCR(tid->baw_head, ATH_TID_MAX_BUFS); } - DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, "%s: baw is now %d:%d, baw head=%d\n", + DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, + "%s: baw is now %d:%d, baw head=%d\n", __func__, tap->txa_start, tap->txa_wnd, tid->baw_head); } @@ -2248,24 +2262,34 @@ ath_tx_swq(struct ath_softc *sc, struct ATH_TXQ_LOCK(txq); if (atid->paused) { /* TID is paused, queue */ + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: paused\n", __func__); ATH_TXQ_INSERT_TAIL(atid, bf, bf_list); } else if (ath_tx_ampdu_pending(sc, an, tid)) { /* AMPDU pending; queue */ + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: pending\n", __func__); ATH_TXQ_INSERT_TAIL(atid, bf, bf_list); /* XXX sched? */ } else if (ath_tx_ampdu_running(sc, an, tid)) { /* AMPDU running, attempt direct dispatch if possible */ - if (txq->axq_depth < sc->sc_hwq_limit) + if (txq->axq_depth < sc->sc_hwq_limit) { ath_tx_xmit_aggr(sc, an, bf); - else { + DPRINTF(sc, ATH_DEBUG_SW_TX, + "%s: xmit_aggr\n", + __func__); + } else { + DPRINTF(sc, ATH_DEBUG_SW_TX, + "%s: ampdu; swq'ing\n", + __func__); ATH_TXQ_INSERT_TAIL(atid, bf, bf_list); ath_tx_tid_sched(sc, atid); } } else if (txq->axq_depth < sc->sc_hwq_limit) { /* AMPDU not running, attempt direct dispatch */ + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: xmit_normal\n", __func__); ath_tx_xmit_normal(sc, txq, bf); } else { /* Busy; queue */ + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: swq'ing\n", __func__); ATH_TXQ_INSERT_TAIL(atid, bf, bf_list); ath_tx_tid_sched(sc, atid); } @@ -2374,8 +2398,8 @@ ath_tx_tid_resume(struct ath_softc *sc, * forward. */ static void -ath_tx_tid_drain(struct ath_softc *sc, struct ath_node *an, struct ath_tid *tid, - ath_bufhead *bf_cq) +ath_tx_tid_drain(struct ath_softc *sc, struct ath_node *an, + struct ath_tid *tid, ath_bufhead *bf_cq) { struct ath_buf *bf; struct ieee80211_tx_ampdu *tap; @@ -2398,8 +2422,8 @@ ath_tx_tid_drain(struct ath_softc *sc, s device_printf(sc->sc_dev, "%s: node %p: tid %d: txq_depth=%d, " "txq_aggr_depth=%d, sched=%d, paused=%d, " - "hwq_depth=%d, incomp=%d, baw_head=%d, baw_tail=%d " - "txa_start=%d, ni_txseqs=%d\n", + "hwq_depth=%d, incomp=%d, baw_head=%d, " + "baw_tail=%d txa_start=%d, ni_txseqs=%d\n", __func__, ni, tid->tid, txq->axq_depth, txq->axq_aggr_depth, tid->sched, tid->paused, tid->hwq_depth, tid->incomp, tid->baw_head, @@ -2644,7 +2668,8 @@ ath_tx_cleanup(struct ath_softc *sc, str if (! bf->bf_state.bfs_addedbaw) device_printf(sc->sc_dev, "%s: wasn't added: seqno %d\n", - __func__, SEQNO(bf->bf_state.bfs_seqno)); + __func__, + SEQNO(bf->bf_state.bfs_seqno)); } bf->bf_state.bfs_dobaw = 0; /* @@ -3061,7 +3086,8 @@ ath_tx_comp_cleanup_aggr(struct ath_soft * not the last descriptor in the first frame. */ static void -ath_tx_aggr_comp_aggr(struct ath_softc *sc, struct ath_buf *bf_first, int fail) +ath_tx_aggr_comp_aggr(struct ath_softc *sc, struct ath_buf *bf_first, + int fail) { //struct ath_desc *ds = bf->bf_lastds; struct ieee80211_node *ni = bf_first->bf_node; @@ -3148,7 +3174,8 @@ ath_tx_aggr_comp_aggr(struct ath_softc * memcpy(rc, bf_first->bf_state.bfs_rc, sizeof(rc)); DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, - "%s: txa_start=%d, tx_ok=%d, status=%.8x, flags=%.8x, isaggr=%d, seq_st=%d, hasba=%d, ba=%.8x, %.8x\n", + "%s: txa_start=%d, tx_ok=%d, status=%.8x, flags=%.8x, " + "isaggr=%d, seq_st=%d, hasba=%d, ba=%.8x, %.8x\n", __func__, tap->txa_start, tx_ok, ts.ts_status, ts.ts_flags, isaggr, seq_st, hasba, ba[0], ba[1]); @@ -3162,7 +3189,8 @@ ath_tx_aggr_comp_aggr(struct ath_softc * /* AR5416 BA bug; this requires an interface reset */ if (isaggr && tx_ok && (! hasba)) { device_printf(sc->sc_dev, - "%s: AR5416 bug: hasba=%d; txok=%d, isaggr=%d, seq_st=%d\n", + "%s: AR5416 bug: hasba=%d; txok=%d, isaggr=%d, " + "seq_st=%d\n", __func__, hasba, tx_ok, isaggr, seq_st); /* XXX TODO: schedule an interface reset */ } @@ -3193,7 +3221,8 @@ ath_tx_aggr_comp_aggr(struct ath_softc * */ while (bf) { nframes++; - ba_index = ATH_BA_INDEX(seq_st, SEQNO(bf->bf_state.bfs_seqno)); + ba_index = ATH_BA_INDEX(seq_st, + SEQNO(bf->bf_state.bfs_seqno)); bf_next = bf->bf_next; bf->bf_next = NULL; /* Remove it from the aggr list */ @@ -3245,7 +3274,8 @@ ath_tx_aggr_comp_aggr(struct ath_softc * * control code. */ if (fail == 0) - ath_tx_update_ratectrl(sc, ni, rc, &ts, pktlen, nframes, nbad); + ath_tx_update_ratectrl(sc, ni, rc, &ts, pktlen, nframes, + nbad); /* * send bar if we dropped any frames @@ -3313,8 +3343,10 @@ ath_tx_aggr_comp_unaggr(struct ath_softc if (tid == IEEE80211_NONQOS_TID) device_printf(sc->sc_dev, "%s: TID=16!\n", __func__); - DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: bf=%p: tid=%d, hwq_depth=%d\n", - __func__, bf, bf->bf_state.bfs_tid, atid->hwq_depth); + DPRINTF(sc, ATH_DEBUG_SW_TX, + "%s: bf=%p: tid=%d, hwq_depth=%d, seqno=%d\n", + __func__, bf, bf->bf_state.bfs_tid, atid->hwq_depth, + SEQNO(bf->bf_state.bfs_seqno)); atid->hwq_depth--; if (atid->hwq_depth < 0) @@ -3329,6 +3361,8 @@ ath_tx_aggr_comp_unaggr(struct ath_softc */ if (atid->cleanup_inprogress) { ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: cleanup_unaggr\n", + __func__); ath_tx_comp_cleanup_unaggr(sc, bf); return; } @@ -3339,6 +3373,8 @@ ath_tx_aggr_comp_unaggr(struct ath_softc */ if (fail == 0 && ts->ts_status & HAL_TXERR_XRETRY) { ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); + DPRINTF(sc, ATH_DEBUG_SW_TX, "%s: retry_unaggr\n", + __func__); ath_tx_aggr_retry_unaggr(sc, bf); return; } @@ -3419,7 +3455,8 @@ ath_tx_tid_hw_queue_aggr(struct ath_soft * data frame), schedule it directly; continue. */ if (! bf->bf_state.bfs_dobaw) { - DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: non-baw packet\n", + DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, + "%s: non-baw packet\n", __func__); ATH_TXQ_REMOVE(tid, bf, bf_list); bf->bf_state.bfs_aggr = 0; @@ -3489,7 +3526,8 @@ ath_tx_tid_hw_queue_aggr(struct ath_soft sc->sc_aggr_stats.aggr_single_pkt++; } else { DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, - "%s: multi-frame aggregate: %d frames, length %d\n", + "%s: multi-frame aggregate: %d frames, " + "length %d\n", __func__, bf->bf_state.bfs_nframes, bf->bf_state.bfs_al); bf->bf_state.bfs_aggr = 1; From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 00:18:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC39A1065670; Wed, 11 Jan 2012 00:18:33 +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 BB9438FC12; Wed, 11 Jan 2012 00:18: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 q0B0IXwG033932; Wed, 11 Jan 2012 00:18:33 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0B0IXGD033930; Wed, 11 Jan 2012 00:18:33 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201110018.q0B0IXGD033930@svn.freebsd.org> From: Adrian Chadd Date: Wed, 11 Jan 2012 00:18: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: r229950 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 00:18:33 -0000 Author: adrian Date: Wed Jan 11 00:18:33 2012 New Revision: 229950 URL: http://svn.freebsd.org/changeset/base/229950 Log: Re-enable the PHY radar error frames if sc_dodfs is set. This was messing up a local port of the atheros reference radar detection code; I'll fix the port instead. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Wed Jan 11 00:16:44 2012 (r229949) +++ head/sys/dev/ath/if_ath.c Wed Jan 11 00:18:33 2012 (r229950) @@ -2486,6 +2486,13 @@ ath_calcrxfilter(struct ath_softc *sc) if (IEEE80211_IS_CHAN_HT(ic->ic_curchan)) rfilt |= HAL_RX_FILTER_COMPBAR; + /* + * Enable radar PHY errors if requested by the + * DFS module. + */ + if (sc->sc_dodfs) + rfilt |= HAL_RX_FILTER_PHYRADAR; + DPRINTF(sc, ATH_DEBUG_MODE, "%s: RX filter 0x%x, %s if_flags 0x%x\n", __func__, rfilt, ieee80211_opmode_name[ic->ic_opmode], ifp->if_flags); return rfilt; From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 00:31:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C19961065672; Wed, 11 Jan 2012 00:31:04 +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 B084F8FC08; Wed, 11 Jan 2012 00:31: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 q0B0V4Y2034375; Wed, 11 Jan 2012 00:31:04 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0B0V4tW034372; Wed, 11 Jan 2012 00:31:04 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201201110031.q0B0V4tW034372@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 11 Jan 2012 00:31: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: r229951 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 00:31:04 -0000 Author: pjd Date: Wed Jan 11 00:31:04 2012 New Revision: 229951 URL: http://svn.freebsd.org/changeset/base/229951 Log: Constify arguments. Modified: head/lib/libutil/libutil.h head/lib/libutil/pidfile.c Modified: head/lib/libutil/libutil.h ============================================================================== --- head/lib/libutil/libutil.h Wed Jan 11 00:18:33 2012 (r229950) +++ head/lib/libutil/libutil.h Wed Jan 11 00:31:04 2012 (r229951) @@ -170,7 +170,7 @@ struct pidfh *pidfile_open(const char *p int pidfile_write(struct pidfh *pfh); int pidfile_close(struct pidfh *pfh); int pidfile_remove(struct pidfh *pfh); -int pidfile_fileno(struct pidfh *pfh); +int pidfile_fileno(const struct pidfh *pfh); #endif #ifdef _UFS_UFS_QUOTA_H_ Modified: head/lib/libutil/pidfile.c ============================================================================== --- head/lib/libutil/pidfile.c Wed Jan 11 00:18:33 2012 (r229950) +++ head/lib/libutil/pidfile.c Wed Jan 11 00:31:04 2012 (r229951) @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); static int _pidfile_remove(struct pidfh *pfh, int freeit); static int -pidfile_verify(struct pidfh *pfh) +pidfile_verify(const struct pidfh *pfh) { struct stat sb; @@ -268,7 +268,7 @@ pidfile_remove(struct pidfh *pfh) } int -pidfile_fileno(struct pidfh *pfh) +pidfile_fileno(const struct pidfh *pfh) { if (pfh == NULL || pfh->pf_fd == -1) { From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 00:47:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 81B63106566C; Wed, 11 Jan 2012 00:47:07 +0000 (UTC) Date: Wed, 11 Jan 2012 00:47:07 +0000 From: Alexander Best To: Dimitry Andric Message-ID: <20120111004707.GA76892@freebsd.org> References: <201201100258.q0A2wT7E079753@svn.freebsd.org> <20120110082106.GD1801@garage.freebsd.pl> <4F0C0714.6060501@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F0C0714.6060501@FreeBSD.org> Cc: svn-src-head@freebsd.org, Eitan Adler , svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek Subject: Re: svn commit: r229908 - head/usr.bin/brandelf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 00:47:07 -0000 On Tue Jan 10 12, Dimitry Andric wrote: > On 2012-01-10 09:21, Pawel Jakub Dawidek wrote: > >On Tue, Jan 10, 2012 at 02:58:29AM +0000, Eitan Adler wrote: > >>Author: eadler (ports committer) > >>Date: Tue Jan 10 02:58:29 2012 > >>New Revision: 229908 > >>URL: http://svn.freebsd.org/changeset/base/229908 > >> > >>Log: > >> Fix warning when compiling with gcc46: > >> error: variable 'verbose' set but not use > > > >Maybe we should remove -v from the manual page as well or document as > >no-op? > >I'd still leave it in the code though, so there is no POLA violation. > > It has been a no-op since the beginning of brandelf, and I have really > no idea what the original author intended the verbose output to be. :) > > It is probably best to document it as a no-op now, to reduce possible > confusion. shouldn't brandelf be replaced with the version from the elftoolchain project? any news when the first import is going to happen? cheers. alex From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 00:51:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 81F151065670; Wed, 11 Jan 2012 00:51:35 +0000 (UTC) Date: Wed, 11 Jan 2012 00:51:35 +0000 From: Alexander Best To: Dimitry Andric Message-ID: <20120111005135.GA77727@freebsd.org> References: <201201100258.q0A2wT7E079753@svn.freebsd.org> <20120110082106.GD1801@garage.freebsd.pl> <4F0C0714.6060501@FreeBSD.org> <20120111004707.GA76892@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120111004707.GA76892@freebsd.org> Cc: svn-src-head@freebsd.org, Eitan Adler , svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek Subject: Re: svn commit: r229908 - head/usr.bin/brandelf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 00:51:35 -0000 On Wed Jan 11 12, Alexander Best wrote: > On Tue Jan 10 12, Dimitry Andric wrote: > > On 2012-01-10 09:21, Pawel Jakub Dawidek wrote: > > >On Tue, Jan 10, 2012 at 02:58:29AM +0000, Eitan Adler wrote: > > >>Author: eadler (ports committer) > > >>Date: Tue Jan 10 02:58:29 2012 > > >>New Revision: 229908 > > >>URL: http://svn.freebsd.org/changeset/base/229908 > > >> > > >>Log: > > >> Fix warning when compiling with gcc46: > > >> error: variable 'verbose' set but not use > > > > > >Maybe we should remove -v from the manual page as well or document as > > >no-op? > > >I'd still leave it in the code though, so there is no POLA violation. > > > > It has been a no-op since the beginning of brandelf, and I have really > > no idea what the original author intended the verbose output to be. :) > > > > It is probably best to document it as a no-op now, to reduce possible > > confusion. > > shouldn't brandelf be replaced with the version from the elftoolchain project? > any news when the first import is going to happen? also you might want to report your changes to the elftoolchain project, because otherwise your commit will be reverted when the import happens. cheers. alex > > cheers. > alex From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 01:09:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13DCB106564A; Wed, 11 Jan 2012 01:09:09 +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 F1B328FC12; Wed, 11 Jan 2012 01:09:08 +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 q0B198CV035681; Wed, 11 Jan 2012 01:09:08 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0B198Ie035678; Wed, 11 Jan 2012 01:09:08 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201110109.q0B198Ie035678@svn.freebsd.org> From: Adrian Chadd Date: Wed, 11 Jan 2012 01:09: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: r229952 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 01:09:09 -0000 Author: adrian Date: Wed Jan 11 01:09:08 2012 New Revision: 229952 URL: http://svn.freebsd.org/changeset/base/229952 Log: Add the MCS radiotype entry. Modified: head/sys/net80211/ieee80211_radiotap.c head/sys/net80211/ieee80211_radiotap.h Modified: head/sys/net80211/ieee80211_radiotap.c ============================================================================== --- head/sys/net80211/ieee80211_radiotap.c Wed Jan 11 00:31:04 2012 (r229951) +++ head/sys/net80211/ieee80211_radiotap.c Wed Jan 11 01:09:08 2012 (r229952) @@ -325,6 +325,10 @@ radiotap_offset(struct ieee80211_radiota .align = sizeof(uint32_t), .width = 2*sizeof(uint32_t), }, + [IEEE80211_RADIOTAP_MCS] = { + .align = sizeof(uint8_t), + .width = 3*sizeof(uint8_t), + }, }; uint32_t present = le32toh(rh->it_present); int off, i; Modified: head/sys/net80211/ieee80211_radiotap.h ============================================================================== --- head/sys/net80211/ieee80211_radiotap.h Wed Jan 11 00:31:04 2012 (r229951) +++ head/sys/net80211/ieee80211_radiotap.h Wed Jan 11 01:09:08 2012 (r229952) @@ -190,6 +190,7 @@ enum ieee80211_radiotap_type { IEEE80211_RADIOTAP_DB_ANTNOISE = 13, /* NB: gap for netbsd definitions */ IEEE80211_RADIOTAP_XCHANNEL = 18, + IEEE80211_RADIOTAP_MCS = 19, IEEE80211_RADIOTAP_VENDOREXT = 30, IEEE80211_RADIOTAP_EXT = 31, }; From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 01:24:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0AE541065675; Wed, 11 Jan 2012 01:24:36 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CEE208FC17; Wed, 11 Jan 2012 01:24: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 q0B1OZ4k036194; Wed, 11 Jan 2012 01:24:35 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0B1OZFC036192; Wed, 11 Jan 2012 01:24:35 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201201110124.q0B1OZFC036192@svn.freebsd.org> From: Rick Macklem Date: Wed, 11 Jan 2012 01:24:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229953 - stable/9/sys/fs/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 01:24:36 -0000 Author: rmacklem Date: Wed Jan 11 01:24:35 2012 New Revision: 229953 URL: http://svn.freebsd.org/changeset/base/229953 Log: MFC: r228827 During investigation of an NFSv4 client crash reported by glebius@, jhb@ spotted that nfscl_getstateid() might modify credentials when called from nfsrpc_read() for the case where p != NULL, whereas nfsrpc_read() only did a crdup() to get new credentials for p == NULL. This bug was introduced by r195510, since pre-r195510 nfscl_getstateid() only modified credentials for the p == NULL case. This patch modifies nfsrpc_read()/nfsrpc_write() so that they do crdup() for the p != NULL case. It is conceivable that this bug caused the crash reported by glebius@, but that will not be determined for some time, since the crash occurred after about 1month of operation. Modified: stable/9/sys/fs/nfsclient/nfs_clrpcops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clrpcops.c Wed Jan 11 01:09:08 2012 (r229952) +++ stable/9/sys/fs/nfsclient/nfs_clrpcops.c Wed Jan 11 01:24:35 2012 (r229953) @@ -1232,8 +1232,7 @@ nfsrpc_read(vnode_t vp, struct uio *uiop newcred = cred; if (NFSHASNFSV4(nmp)) { nfhp = np->n_fhp; - if (p == NULL) - newcred = NFSNEWCRED(cred); + newcred = NFSNEWCRED(cred); } retrycnt = 0; do { @@ -1263,7 +1262,7 @@ nfsrpc_read(vnode_t vp, struct uio *uiop expireret == 0 && clidrev != 0 && retrycnt < 4)); if (error && retrycnt >= 4) error = EIO; - if (NFSHASNFSV4(nmp) && p == NULL) + if (NFSHASNFSV4(nmp)) NFSFREECRED(newcred); return (error); } @@ -1384,8 +1383,7 @@ nfsrpc_write(vnode_t vp, struct uio *uio clidrev = nmp->nm_clp->nfsc_clientidrev; newcred = cred; if (NFSHASNFSV4(nmp)) { - if (p == NULL) - newcred = NFSNEWCRED(cred); + newcred = NFSNEWCRED(cred); nfhp = np->n_fhp; } retrycnt = 0; @@ -1435,7 +1433,7 @@ nfsrpc_write(vnode_t vp, struct uio *uio ((error == NFSERR_STALESTATEID || error == NFSERR_STALEDONTRECOVER) && called_from_strategy != 0))) error = EIO; - if (NFSHASNFSV4(nmp) && p == NULL) + if (NFSHASNFSV4(nmp)) NFSFREECRED(newcred); return (error); } From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 01:58:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 907391065670; Wed, 11 Jan 2012 01:58:49 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5EBD48FC0C; Wed, 11 Jan 2012 01:58: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 q0B1wnuu037283; Wed, 11 Jan 2012 01:58:49 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0B1wnnC037281; Wed, 11 Jan 2012 01:58:49 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201201110158.q0B1wnnC037281@svn.freebsd.org> From: Rick Macklem Date: Wed, 11 Jan 2012 01:58:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229955 - stable/8/sys/fs/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 01:58:49 -0000 Author: rmacklem Date: Wed Jan 11 01:58:49 2012 New Revision: 229955 URL: http://svn.freebsd.org/changeset/base/229955 Log: MFC: r228827 During investigation of an NFSv4 client crash reported by glebius@, jhb@ spotted that nfscl_getstateid() might modify credentials when called from nfsrpc_read() for the case where p != NULL, whereas nfsrpc_read() only did a crdup() to get new credentials for p == NULL. This bug was introduced by r195510, since pre-r195510 nfscl_getstateid() only modified credentials for the p == NULL case. This patch modifies nfsrpc_read()/nfsrpc_write() so that they do crdup() for the p != NULL case. It is conceivable that this bug caused the crash reported by glebius@, but that will not be determined for some time, since the crash occurred after about 1month of operation. Modified: stable/8/sys/fs/nfsclient/nfs_clrpcops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clrpcops.c Wed Jan 11 01:42:16 2012 (r229954) +++ stable/8/sys/fs/nfsclient/nfs_clrpcops.c Wed Jan 11 01:58:49 2012 (r229955) @@ -1232,8 +1232,7 @@ nfsrpc_read(vnode_t vp, struct uio *uiop newcred = cred; if (NFSHASNFSV4(nmp)) { nfhp = np->n_fhp; - if (p == NULL) - newcred = NFSNEWCRED(cred); + newcred = NFSNEWCRED(cred); } retrycnt = 0; do { @@ -1263,7 +1262,7 @@ nfsrpc_read(vnode_t vp, struct uio *uiop expireret == 0 && clidrev != 0 && retrycnt < 4)); if (error && retrycnt >= 4) error = EIO; - if (NFSHASNFSV4(nmp) && p == NULL) + if (NFSHASNFSV4(nmp)) NFSFREECRED(newcred); return (error); } @@ -1384,8 +1383,7 @@ nfsrpc_write(vnode_t vp, struct uio *uio clidrev = nmp->nm_clp->nfsc_clientidrev; newcred = cred; if (NFSHASNFSV4(nmp)) { - if (p == NULL) - newcred = NFSNEWCRED(cred); + newcred = NFSNEWCRED(cred); nfhp = np->n_fhp; } retrycnt = 0; @@ -1435,7 +1433,7 @@ nfsrpc_write(vnode_t vp, struct uio *uio ((error == NFSERR_STALESTATEID || error == NFSERR_STALEDONTRECOVER) && called_from_strategy != 0))) error = EIO; - if (NFSHASNFSV4(nmp) && p == NULL) + if (NFSHASNFSV4(nmp)) NFSFREECRED(newcred); return (error); } From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 02:43:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D0481065672; Wed, 11 Jan 2012 02:43:52 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-tul01m020-f182.google.com (mail-tul01m020-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 04FC28FC1A; Wed, 11 Jan 2012 02:43:51 +0000 (UTC) Received: by obbwd18 with SMTP id wd18so477125obb.13 for ; Tue, 10 Jan 2012 18:43:51 -0800 (PST) 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=edS6qsfiso8QYHh65J9zyRJoFt6jvnV4CXLUzlhCA6g=; b=vWLnrPBj+OuTELu1OD5eQfJ7kCJ6ZiUVXXwNvobSKUh1cIndrtS6JMFln8Q2JBbufi P4QRavjXN31bpe9MN6di/siYXtsyhrbE8Gf8+yjf91CbxWjojogBcU1zUSThOb9P9PIS c1sEZ8WiNBx0jZ0C7BsllEFyqiSOnqDUphJ7Q= MIME-Version: 1.0 Received: by 10.182.2.169 with SMTP id 9mr20710775obv.79.1326249831526; Tue, 10 Jan 2012 18:43:51 -0800 (PST) Received: by 10.182.152.6 with HTTP; Tue, 10 Jan 2012 18:43:51 -0800 (PST) In-Reply-To: References: <201201052248.q05MmaZk059871@svn.freebsd.org> <4F066340.9010507@FreeBSD.org> Date: Tue, 10 Jan 2012 18:43:51 -0800 Message-ID: From: Garrett Cooper To: Guy Helmer Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Doug Barton , src-committers@freebsd.org Subject: Re: svn commit: r229667 - head/usr.sbin/daemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 02:43:52 -0000 On Tue, Jan 10, 2012 at 1:01 PM, Guy Helmer wrote: > On Jan 6, 2012, at 12:00 AM, Garrett Cooper wrote: > >> On Thu, Jan 5, 2012 at 6:58 PM, Doug Barton wrote: >>> On 01/05/2012 14:48, Guy Helmer wrote: >>>> =A0 Allow daemon(8) to run pidfile_open() before relenquishing privile= ges >>>> =A0 so pid files can be written in /var/run when started as root. >>> >>> I'm not sure how useful this is since when daemon is exiting it won't b= e >>> able to remove the pid file (unless I'm missing something). >>> >>> Isn't it better to pre-create the pid file with the proper permissions >>> for the unprivileged user? >> >> =A0 =A0As another aside, the file descriptor never has fcntl(, >> FD_CLOEXEC) run on it, so it leaks the file descriptors across execs.. >> that's not good... > > I just added an fcntl(=85, FD_CLOEXEC) call to pidfile_open() so this par= ticular problem should be resolved. I saw -- thanks! -Garrett From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 02:46:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E83761065670; Wed, 11 Jan 2012 02:46:42 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D20758FC08; Wed, 11 Jan 2012 02:46: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 q0B2kgAk038818; Wed, 11 Jan 2012 02:46:42 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0B2kgcv038816; Wed, 11 Jan 2012 02:46:42 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201201110246.q0B2kgcv038816@svn.freebsd.org> From: Rick Macklem Date: Wed, 11 Jan 2012 02:46: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: r229956 - head/sys/fs/nfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 02:46:43 -0000 Author: rmacklem Date: Wed Jan 11 02:46:42 2012 New Revision: 229956 URL: http://svn.freebsd.org/changeset/base/229956 Log: jwd@ reported via email that the "CacheSize" field reported by "nfsstat -e -s" would go negative after using the "-z" option to zero out the stats. This patch fixes that by not zeroing out the srvcache_size field for "-z", since it is the size of the cache and not a counter. MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs_commonport.c Modified: head/sys/fs/nfs/nfs_commonport.c ============================================================================== --- head/sys/fs/nfs/nfs_commonport.c Wed Jan 11 01:58:49 2012 (r229955) +++ head/sys/fs/nfs/nfs_commonport.c Wed Jan 11 02:46:42 2012 (r229956) @@ -483,7 +483,6 @@ nfssvc_call(struct thread *p, struct nfs newnfsstats.srvcache_nonidemdonehits = 0; newnfsstats.srvcache_misses = 0; newnfsstats.srvcache_tcppeak = 0; - newnfsstats.srvcache_size = 0; newnfsstats.srvclients = 0; newnfsstats.srvopenowners = 0; newnfsstats.srvopens = 0; From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 12:26:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B283106566C; Wed, 11 Jan 2012 12:26:02 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id A622E8FC16; Wed, 11 Jan 2012 12:26:01 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0BCPv2J013153 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 11 Jan 2012 23:25:58 +1100 Date: Wed, 11 Jan 2012 23:25:57 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Pawel Jakub Dawidek In-Reply-To: <20120110221323.GE1694@garage.freebsd.pl> Message-ID: <20120111214848.K1813@besplex.bde.org> References: <201201101953.q0AJrPao025097@svn.freebsd.org> <20120110221323.GE1694@garage.freebsd.pl> 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, Guy Helmer Subject: Re: svn commit: r229937 - in head/lib: libc/gen libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 12:26:02 -0000 On Tue, 10 Jan 2012, Pawel Jakub Dawidek wrote: > On Tue, Jan 10, 2012 at 07:53:25PM +0000, Guy Helmer wrote: > [...] >> Modified: head/lib/libutil/libutil.h >> ============================================================================== >> --- head/lib/libutil/libutil.h Tue Jan 10 18:43:27 2012 (r229936) >> +++ head/lib/libutil/libutil.h Tue Jan 10 19:53:25 2012 (r229937) >> @@ -170,6 +170,7 @@ struct pidfh *pidfile_open(const char *p >> int pidfile_write(struct pidfh *pfh); >> int pidfile_close(struct pidfh *pfh); >> int pidfile_remove(struct pidfh *pfh); >> +int pidfile_fileno(struct pidfh *pfh); >> #endif >> >> #ifdef _UFS_UFS_QUOTA_H_ > > One more thing. You also need to add link in Makefile, so that > 'man pidfile_fileno' will work. Is there any chance of keeping sorted lists sorted? This file used to be mostly sorted and mostly in KNF (tab before function names) and mostly without namespace pollution in parameter names). Newer code in it violates all of these style and header implementation rules. The pidfile code was already especially bad, and adding to the end of the unsorted list in it doesn't help. The pidfile man page is also unsorted. It was in "operations" order "open/write/close/remove". That is hard to maintain and hard to search for long lists. Adding pidfile_fileno() to the end of the list in the same disorder as above makes the list not even in "operations" order (since pidfile_fileno() is only valid betwen pidfile_open() and pidfile_close()). Old disorder and nearby bugs in libutil.h (old := before 2005): - the forward declarations of structs are totally disordered - the following prototypes are disordered (mostly by adding them to the end of a orginally-almost-sorted list: trimdomain(), forkpty(), humanize_number(), uu_lockerr(), uu_unlock(), _secure_path(), properties_read(), properties_free(), properties_find(), auth_getval(), realhostname(), - the forward declaration of struct sockaddr is disorderd (not unsorted at the beginning with the others) - surprisingly, realhostname_sa() is not unsorted relative to realhostname() - the following prototypes have namespace pollution in parameter names (their parameter names are in the implementation namespace, unlike for all of the older prototypes in the file): properties read(), properties free(), properties free(), auth_getval(), realhostname(), realhostname_sa(). The properties code used to be the only really ugly code in this file. - formatting errors for openpty() (premature line splitting and wrong continuation indent). The very first prototype in this file gives an example of normal splitting and continuation indent - formatting errors for forkpty() (same as for openpty()) - line too long for realhostname_sa(), pw_copy() - consider fparseln() as being in a new section so it isn't unsorted. The start of this section should be delimited by a blank line (this is done in -current). The new section isn't really justified. It is just 1 function ifdefed to avoid a namespace problem. - no namespace pollution for fparseln()'s parameters, but that it because it is in a style different from all older prototypes in the file -- it doesn't name its parameters. Newer disorder and nearby bugs: - further unsorting of the forward declarations by adding kinfo* to the end of the unsorted list. At least the new declarations are sorted internally. - the following protypes in the early sections are disordered: expand_number(), kld*(), kinfo* (no need for a new section for the last 2. At least they are each sorted internally), gr_scan() - the following prototypes have namespace pollution in parameter names: hexdump(), kld*(), gr_dup(), gr_equal(), gr_make(), gr_scan(). Only about half of the gr*() prototypes have this bug - better indentation for kinfo*() than for older or newer entries! - line too long for gr_entry() - pidfile*() have all of the above bugs, plus they are the only prototypes up to this point in the file that don't put a tab before the function name when the return type is int - quota*() are slightly worse than pidfile*(). They add the additional style bug of not using parameter names at all, except for 1 of 2 parameters in 1 of 12 prototypes. That parameter is namespace pollution. Bruce From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 13:52:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04FFC106566C; Wed, 11 Jan 2012 13:52:35 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E69928FC13; Wed, 11 Jan 2012 13:52: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 q0BDqYJQ061938; Wed, 11 Jan 2012 13:52:34 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0BDqY0w061936; Wed, 11 Jan 2012 13:52:34 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201201111352.q0BDqY0w061936@svn.freebsd.org> From: Takahashi Yoshihiro Date: Wed, 11 Jan 2012 13:52:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229957 - stable/9/sys/boot/pc98/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 13:52:35 -0000 Author: nyan Date: Wed Jan 11 13:52:34 2012 New Revision: 229957 URL: http://svn.freebsd.org/changeset/base/229957 Log: MFC: revision 229462 Fix 230MB MO support. Submitted by: Kaho Toshikazu Modified: stable/9/sys/boot/pc98/boot2/boot1.S Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/pc98/boot2/boot1.S ============================================================================== --- stable/9/sys/boot/pc98/boot2/boot1.S Wed Jan 11 02:46:42 2012 (r229956) +++ stable/9/sys/boot/pc98/boot2/boot1.S Wed Jan 11 13:52:34 2012 (r229957) @@ -219,7 +219,7 @@ read: xor %ax,%ax jc read_load and $0xff7f,%si /* SCSI MO */ mov %di,%cx - shr $16,%di + shr $16,%edi mov %di,%dx jmp read_load read_fd: or $0xd000,%si From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 13:56:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36DB4106566B; Wed, 11 Jan 2012 13:56:32 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 248E18FC0C; Wed, 11 Jan 2012 13:56: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 q0BDuVdv062126; Wed, 11 Jan 2012 13:56:32 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0BDuVfc062124; Wed, 11 Jan 2012 13:56:31 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201201111356.q0BDuVfc062124@svn.freebsd.org> From: Takahashi Yoshihiro Date: Wed, 11 Jan 2012 13:56:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229958 - stable/8/sys/boot/pc98/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 13:56:32 -0000 Author: nyan Date: Wed Jan 11 13:56:31 2012 New Revision: 229958 URL: http://svn.freebsd.org/changeset/base/229958 Log: MFC: revision 229462 Fix 230MB MO support. Submitted by: Kaho Toshikazu Modified: stable/8/sys/boot/pc98/boot2/boot1.S Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/boot/pc98/boot2/boot1.S ============================================================================== --- stable/8/sys/boot/pc98/boot2/boot1.S Wed Jan 11 13:52:34 2012 (r229957) +++ stable/8/sys/boot/pc98/boot2/boot1.S Wed Jan 11 13:56:31 2012 (r229958) @@ -219,7 +219,7 @@ read: xor %ax,%ax jc read_load and $0xff7f,%si /* SCSI MO */ mov %di,%cx - shr $16,%di + shr $16,%edi mov %di,%dx jmp read_load read_fd: or $0xd000,%si From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 13:57:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADC001065670; Wed, 11 Jan 2012 13:57:48 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9BEAC8FC0A; Wed, 11 Jan 2012 13:57: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 q0BDvmRr062201; Wed, 11 Jan 2012 13:57:48 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0BDvm36062199; Wed, 11 Jan 2012 13:57:48 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201111357.q0BDvm36062199@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 11 Jan 2012 13:57: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: r229959 - head/sys/contrib/pf/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 13:57:48 -0000 Author: glebius Date: Wed Jan 11 13:57:48 2012 New Revision: 229959 URL: http://svn.freebsd.org/changeset/base/229959 Log: When running with INVARIANTS the mutex(9) code does all necessary asserts for non-recursive mutexes. Modified: head/sys/contrib/pf/net/pfvar.h Modified: head/sys/contrib/pf/net/pfvar.h ============================================================================== --- head/sys/contrib/pf/net/pfvar.h Wed Jan 11 13:56:31 2012 (r229958) +++ head/sys/contrib/pf/net/pfvar.h Wed Jan 11 13:57:48 2012 (r229959) @@ -241,15 +241,8 @@ extern struct mtx pf_task_mtx; #define PF_LOCK_ASSERT() mtx_assert(&pf_task_mtx, MA_OWNED) #define PF_UNLOCK_ASSERT() mtx_assert(&pf_task_mtx, MA_NOTOWNED) - -#define PF_LOCK() do { \ - PF_UNLOCK_ASSERT(); \ - mtx_lock(&pf_task_mtx); \ -} while(0) -#define PF_UNLOCK() do { \ - PF_LOCK_ASSERT(); \ - mtx_unlock(&pf_task_mtx); \ -} while(0) +#define PF_LOCK() mtx_lock(&pf_task_mtx) +#define PF_UNLOCK() mtx_unlock(&pf_task_mtx) #else #define PF_LOCK_ASSERT() #define PF_UNLOCK_ASSERT() From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 13:59:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B85561065670; Wed, 11 Jan 2012 13:59:49 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A605F8FC14; Wed, 11 Jan 2012 13:59: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 q0BDxnUq062305; Wed, 11 Jan 2012 13:59:49 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0BDxnJD062303; Wed, 11 Jan 2012 13:59:49 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201201111359.q0BDxnJD062303@svn.freebsd.org> From: Takahashi Yoshihiro Date: Wed, 11 Jan 2012 13:59:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229960 - stable/7/sys/boot/pc98/boot2 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 13:59:49 -0000 Author: nyan Date: Wed Jan 11 13:59:49 2012 New Revision: 229960 URL: http://svn.freebsd.org/changeset/base/229960 Log: MFC: revision 229462 Fix 230MB MO support. Submitted by: Kaho Toshikazu Modified: stable/7/sys/boot/pc98/boot2/boot1.S Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/boot/pc98/boot2/boot1.S ============================================================================== --- stable/7/sys/boot/pc98/boot2/boot1.S Wed Jan 11 13:57:48 2012 (r229959) +++ stable/7/sys/boot/pc98/boot2/boot1.S Wed Jan 11 13:59:49 2012 (r229960) @@ -219,7 +219,7 @@ read: xor %ax,%ax jc read_load and $0xff7f,%si /* SCSI MO */ mov %di,%cx - shr $16,%di + shr $16,%edi mov %di,%dx jmp read_load read_fd: or $0xd000,%si From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 14:11:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6746106566B; Wed, 11 Jan 2012 14:11:10 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D48538FC14; Wed, 11 Jan 2012 14:11: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 q0BEBAaM062745; Wed, 11 Jan 2012 14:11:10 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0BEBA9x062743; Wed, 11 Jan 2012 14:11:10 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201111411.q0BEBA9x062743@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 11 Jan 2012 14:11: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: r229961 - head/sys/contrib/pf/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 14:11:11 -0000 Author: glebius Date: Wed Jan 11 14:11:10 2012 New Revision: 229961 URL: http://svn.freebsd.org/changeset/base/229961 Log: Merge from OpenBSD: revision 1.128 date: 2009/08/16 13:01:57; author: jsg; state: Exp; lines: +1 -5 remove prototypes of a bunch of functions that had their implementations removed in pfsync v5. Modified: head/sys/contrib/pf/net/if_pfsync.c Modified: head/sys/contrib/pf/net/if_pfsync.c ============================================================================== --- head/sys/contrib/pf/net/if_pfsync.c Wed Jan 11 13:59:49 2012 (r229960) +++ head/sys/contrib/pf/net/if_pfsync.c Wed Jan 11 14:11:10 2012 (r229961) @@ -47,6 +47,7 @@ * 1.118, 1.124, 1.148, 1.149, 1.151, 1.171 - fixes to bulk updates * 1.120, 1.175 - use monotonic time_uptime * 1.122 - reduce number of updates for non-TCP sessions + * 1.128 - cleanups * 1.170 - SIOCSIFMTU checks */ @@ -342,7 +343,6 @@ int pfsyncioctl(struct ifnet *, u_long, void pfsyncstart(struct ifnet *); struct mbuf *pfsync_if_dequeue(struct ifnet *); -struct mbuf *pfsync_get_mbuf(struct pfsync_softc *); void pfsync_deferred(struct pf_state *, int); void pfsync_undefer(struct pfsync_deferral *, int); @@ -354,11 +354,8 @@ void pfsync_update_state_req(struct pf_s void pfsync_drop(struct pfsync_softc *); void pfsync_sendout(void); void pfsync_send_plus(void *, size_t); -int pfsync_tdb_sendout(struct pfsync_softc *); -int pfsync_sendout_mbuf(struct pfsync_softc *, struct mbuf *); void pfsync_timeout(void *); void pfsync_tdb_timeout(void *); -void pfsync_send_bus(struct pfsync_softc *, u_int8_t); void pfsync_bulk_start(void); void pfsync_bulk_status(u_int8_t); From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 14:13:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1116C106566B; Wed, 11 Jan 2012 14:13:43 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F38248FC16; Wed, 11 Jan 2012 14:13: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 q0BEDgcY062861; Wed, 11 Jan 2012 14:13:42 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0BEDgDP062859; Wed, 11 Jan 2012 14:13:42 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201111413.q0BEDgDP062859@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 11 Jan 2012 14:13: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: r229962 - head/sys/contrib/pf/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 14:13:43 -0000 Author: glebius Date: Wed Jan 11 14:13:42 2012 New Revision: 229962 URL: http://svn.freebsd.org/changeset/base/229962 Log: Move PF_LOCK_ASSERT() under __FreeBSD__. Modified: head/sys/contrib/pf/net/if_pfsync.c Modified: head/sys/contrib/pf/net/if_pfsync.c ============================================================================== --- head/sys/contrib/pf/net/if_pfsync.c Wed Jan 11 14:11:10 2012 (r229961) +++ head/sys/contrib/pf/net/if_pfsync.c Wed Jan 11 14:13:42 2012 (r229962) @@ -681,9 +681,9 @@ pfsync_state_import(struct pfsync_state int pool_flags; int error; +#ifdef __FreeBSD__ PF_LOCK_ASSERT(); -#ifdef __FreeBSD__ if (sp->creatorid == 0 && V_pf_status.debug >= PF_DEBUG_MISC) { #else if (sp->creatorid == 0 && pf_status.debug >= PF_DEBUG_MISC) { From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 14:19:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE558106566C; Wed, 11 Jan 2012 14:19:04 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ACADA8FC0A; Wed, 11 Jan 2012 14:19: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 q0BEJ4DY063064; Wed, 11 Jan 2012 14:19:04 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0BEJ4bg063062; Wed, 11 Jan 2012 14:19:04 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201111419.q0BEJ4bg063062@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 11 Jan 2012 14:19: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: r229963 - head/sys/contrib/pf/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 14:19:04 -0000 Author: glebius Date: Wed Jan 11 14:19:04 2012 New Revision: 229963 URL: http://svn.freebsd.org/changeset/base/229963 Log: Add necessary locking in pfsync_in_ureq(). Modified: head/sys/contrib/pf/net/if_pfsync.c Modified: head/sys/contrib/pf/net/if_pfsync.c ============================================================================== --- head/sys/contrib/pf/net/if_pfsync.c Wed Jan 11 14:13:42 2012 (r229962) +++ head/sys/contrib/pf/net/if_pfsync.c Wed Jan 11 14:19:04 2012 (r229963) @@ -1433,6 +1433,9 @@ pfsync_in_ureq(struct pfsync_pkt *pkt, s } ura = (struct pfsync_upd_req *)(mp->m_data + offp); +#ifdef __FreeBSD__ + PF_LOCK(); +#endif for (i = 0; i < count; i++) { ur = &ura[i]; @@ -1450,11 +1453,12 @@ pfsync_in_ureq(struct pfsync_pkt *pkt, s if (ISSET(st->state_flags, PFSTATE_NOSYNC)) continue; - PF_LOCK(); pfsync_update_state_req(st); - PF_UNLOCK(); } } +#ifdef __FreeBSD__ + PF_UNLOCK(); +#endif return (len); } @@ -2975,7 +2979,7 @@ pfsync_bulk_start(void) printf("pfsync: received bulk update request\n"); #ifdef __FreeBSD__ - PF_LOCK(); + PF_LOCK_ASSERT(); if (TAILQ_EMPTY(&V_state_list)) #else if (TAILQ_EMPTY(&state_list)) @@ -2994,9 +2998,6 @@ pfsync_bulk_start(void) pfsync_bulk_status(PFSYNC_BUS_START); callout_reset(&sc->sc_bulk_tmo, 1, pfsync_bulk_update, sc); } -#ifdef __FreeBSD__ - PF_UNLOCK(); -#endif } void From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 14:24:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B66BF106564A; Wed, 11 Jan 2012 14:24:03 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A487E8FC17; Wed, 11 Jan 2012 14:24:03 +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 q0BEO35h063268; Wed, 11 Jan 2012 14:24:03 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0BEO3CI063266; Wed, 11 Jan 2012 14:24:03 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201111424.q0BEO3CI063266@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 11 Jan 2012 14:24:03 +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: r229964 - head/sys/contrib/pf/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 14:24:03 -0000 Author: glebius Date: Wed Jan 11 14:24:03 2012 New Revision: 229964 URL: http://svn.freebsd.org/changeset/base/229964 Log: Fix some spacing in code under __FreeBSD__. Modified: head/sys/contrib/pf/net/if_pfsync.c Modified: head/sys/contrib/pf/net/if_pfsync.c ============================================================================== --- head/sys/contrib/pf/net/if_pfsync.c Wed Jan 11 14:19:04 2012 (r229963) +++ head/sys/contrib/pf/net/if_pfsync.c Wed Jan 11 14:24:03 2012 (r229964) @@ -2068,7 +2068,7 @@ pfsync_drop(struct pfsync_softc *sc) #ifdef PFSYNC_DEBUG #ifdef __FreeBSD__ KASSERT(st->sync_state == q, - ("%s: st->sync_state == q", + ("%s: st->sync_state == q", __FUNCTION__)); #else KASSERT(st->sync_state == q); @@ -2848,7 +2848,7 @@ pfsync_q_del(struct pf_state *st) int q = st->sync_state; #ifdef __FreeBSD__ - KASSERT(st->sync_state != PFSYNC_S_NONE, + KASSERT(st->sync_state != PFSYNC_S_NONE, ("%s: st->sync_state != PFSYNC_S_NONE", __FUNCTION__)); #else KASSERT(st->sync_state != PFSYNC_S_NONE); @@ -3348,14 +3348,14 @@ pfsync_multicast_cleanup(struct pfsync_s #ifdef INET extern struct domain inetdomain; static struct protosw in_pfsync_protosw = { - .pr_type = SOCK_RAW, - .pr_domain = &inetdomain, - .pr_protocol = IPPROTO_PFSYNC, - .pr_flags = PR_ATOMIC|PR_ADDR, - .pr_input = pfsync_input, - .pr_output = (pr_output_t *)rip_output, - .pr_ctloutput = rip_ctloutput, - .pr_usrreqs = &rip_usrreqs + .pr_type = SOCK_RAW, + .pr_domain = &inetdomain, + .pr_protocol = IPPROTO_PFSYNC, + .pr_flags = PR_ATOMIC|PR_ADDR, + .pr_input = pfsync_input, + .pr_output = (pr_output_t *)rip_output, + .pr_ctloutput = rip_ctloutput, + .pr_usrreqs = &rip_usrreqs }; #endif From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 15:00:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FACD106564A; Wed, 11 Jan 2012 15:00:17 +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 EDAE48FC0A; Wed, 11 Jan 2012 15:00: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 q0BF0GI3064530; Wed, 11 Jan 2012 15:00:16 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0BF0Gda064528; Wed, 11 Jan 2012 15:00:16 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201201111500.q0BF0Gda064528@svn.freebsd.org> From: "George V. Neville-Neil" Date: Wed, 11 Jan 2012 15:00: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: r229965 - head/sys/dev/null X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 15:00:17 -0000 Author: gnn Date: Wed Jan 11 15:00:16 2012 New Revision: 229965 URL: http://svn.freebsd.org/changeset/base/229965 Log: Fix for PR 138526. Add the ability for /dev/null and /dev/zero to accept being set into non blocking mode via fcntl(). This brings the code into compliance with IEEE Std 1003.1-2001 as referenced in another PR, 94729. Reviewed by: jhb MFC after: 1 week Modified: head/sys/dev/null/null.c Modified: head/sys/dev/null/null.c ============================================================================== --- head/sys/dev/null/null.c Wed Jan 11 14:24:03 2012 (r229964) +++ head/sys/dev/null/null.c Wed Jan 11 15:00:16 2012 (r229965) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -49,6 +50,7 @@ static struct cdev *zero_dev; static d_write_t null_write; static d_ioctl_t null_ioctl; +static d_ioctl_t zero_ioctl; static d_read_t zero_read; static struct cdevsw null_cdevsw = { @@ -63,6 +65,7 @@ static struct cdevsw zero_cdevsw = { .d_version = D_VERSION, .d_read = zero_read, .d_write = null_write, + .d_ioctl = zero_ioctl, .d_name = "zero", .d_flags = D_MMAP_ANON, }; @@ -82,17 +85,50 @@ null_ioctl(struct cdev *dev __unused, u_ int flags __unused, struct thread *td) { int error; + error = 0; - if (cmd != DIOCSKERNELDUMP) - return (ENOIOCTL); - error = priv_check(td, PRIV_SETDUMPER); - if (error) - return (error); - return (set_dumper(NULL)); + switch (cmd) { + case DIOCSKERNELDUMP: + error = priv_check(td, PRIV_SETDUMPER); + if (error == 0) + error = set_dumper(NULL); + break; + case FIONBIO: + break; + case FIOASYNC: + if (*(int *)data != 0) + error = EINVAL; + break; + default: + error = ENOIOCTL; + } + return (error); } /* ARGSUSED */ static int +zero_ioctl(struct cdev *dev __unused, u_long cmd, caddr_t data __unused, + int flags __unused, struct thread *td) +{ + int error; + error = 0; + + switch (cmd) { + case FIONBIO: + break; + case FIOASYNC: + if (*(int *)data != 0) + error = EINVAL; + break; + default: + error = ENOIOCTL; + } + return (error); +} + + +/* ARGSUSED */ +static int zero_read(struct cdev *dev __unused, struct uio *uio, int flags __unused) { void *zbuf; From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 15:10:19 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DAA0106566C; Wed, 11 Jan 2012 15:10:19 +0000 (UTC) (envelope-from guy.helmer@palisadesystems.com) Received: from ps-1-a.compliancesafe.com (ps-1-a.compliancesafe.com [216.81.161.161]) by mx1.freebsd.org (Postfix) with ESMTP id EFB918FC0C; Wed, 11 Jan 2012 15:10:16 +0000 (UTC) Received: from mail.palisadesystems.com (localhost [127.0.0.1]) by ps-1-a.compliancesafe.com (8.14.4/8.14.3) with ESMTP id q0BF9x73078862; Wed, 11 Jan 2012 09:10:00 -0600 (CST) (envelope-from guy.helmer@palisadesystems.com) Received: from guysmbp.dyn.palisadesys.com (GuysMBP.dyn.palisadesys.com [172.16.2.90]) (authenticated bits=0) by mail.palisadesystems.com (8.14.3/8.14.3) with ESMTP id q0BF9mcM039415 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Wed, 11 Jan 2012 09:09:48 -0600 (CST) (envelope-from guy.helmer@palisadesystems.com) X-DKIM: Sendmail DKIM Filter v2.8.3 mail.palisadesystems.com q0BF9mcM039415 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=palisadesystems.com; s=mail; t=1326294589; bh=Zp6FbHlcomOFzQin4pDrMb9pCYqrJ5k8vB0b+5+mCvM=; l=128; h=Subject:Mime-Version:Content-Type:From:In-Reply-To:Date:Cc: Content-Transfer-Encoding:Message-Id:References:To; b=Wzog3aS+3y7KlFO6cU+EDWEZbDXpbB6CcwifE1hkNA6DekFrRyUUYRExx5z5SrH+D glARaA7mJMQAqbwoTuHoAAN8ti+THOST8nXpFRCrQ/0YF2qCGGvo1JxBKKNKf62LkW NgSUpCN4bADaZVzz0xWI9n5qsdbZKee1iPNetIYY= Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=us-ascii From: Guy Helmer In-Reply-To: <20120111214848.K1813@besplex.bde.org> Date: Wed, 11 Jan 2012 09:09:47 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <26EF49B4-1B8E-43BC-AC7B-FD24BB94C961@palisadesystems.com> References: <201201101953.q0AJrPao025097@svn.freebsd.org> <20120110221323.GE1694@garage.freebsd.pl> <20120111214848.K1813@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.1251.1) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.5 (mail.palisadesystems.com [172.16.1.5]); Wed, 11 Jan 2012 09:09:49 -0600 (CST) X-Palisade-MailScanner-Information: Please contact the ISP for more information X-Palisade-MailScanner-ID: q0BF9mcM039415 X-Palisade-MailScanner: Found to be clean X-Palisade-MailScanner-SpamCheck: not spam (whitelisted), SpamAssassin (score=0.172, required 5, ALL_TRUSTED -1.00, BAYES_00 -1.90, J_CHICKENPOX_65 0.60, J_CHICKENPOX_73 0.60, J_CHICKENPOX_75 0.60, RP_8BIT 1.27) X-Palisade-MailScanner-From: guy.helmer@palisadesystems.com X-Spam-Status: No X-PacketSure-Scanned: Yes Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Pawel Jakub Dawidek Subject: Re: svn commit: r229937 - in head/lib: libc/gen libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 15:10:19 -0000 On Jan 11, 2012, at 6:25 AM, Bruce Evans wrote: > On Tue, 10 Jan 2012, Pawel Jakub Dawidek wrote: >=20 >> On Tue, Jan 10, 2012 at 07:53:25PM +0000, Guy Helmer wrote: >> [...] >>> Modified: head/lib/libutil/libutil.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/lib/libutil/libutil.h Tue Jan 10 18:43:27 2012 = (r229936) >>> +++ head/lib/libutil/libutil.h Tue Jan 10 19:53:25 2012 = (r229937) >>> @@ -170,6 +170,7 @@ struct pidfh *pidfile_open(const char *p >>> int pidfile_write(struct pidfh *pfh); >>> int pidfile_close(struct pidfh *pfh); >>> int pidfile_remove(struct pidfh *pfh); >>> +int pidfile_fileno(struct pidfh *pfh); >>> #endif >>>=20 >>> #ifdef _UFS_UFS_QUOTA_H_ >>=20 >> One more thing. You also need to add link in Makefile, so that >> 'man pidfile_fileno' will work. >=20 > Is there any chance of keeping sorted lists sorted? >=20 > This file used to be mostly sorted and mostly in KNF (tab before > function names) and mostly without namespace pollution in parameter > names). Newer code in it violates all of these style and header > implementation rules. The pidfile code was already especially bad, > and adding to the end of the unsorted list in it doesn't help. >=20 > The pidfile man page is also unsorted. It was in "operations" order > "open/write/close/remove". That is hard to maintain and hard to = search > for long lists. Adding pidfile_fileno() to the end of the list in the > same disorder as above makes the list not even in "operations" order > (since pidfile_fileno() is only valid betwen pidfile_open() and > pidfile_close()). >=20 > Old disorder and nearby bugs in libutil.h (old :=3D before 2005): > - the forward declarations of structs are totally disordered > - the following prototypes are disordered (mostly by adding them to > the end of a orginally-almost-sorted list: > trimdomain(), forkpty(), humanize_number(), uu_lockerr(), = uu_unlock(), > _secure_path(), properties_read(), properties_free(), = properties_find(), > auth_getval(), realhostname(), > - the forward declaration of struct sockaddr is disorderd (not = unsorted > at the beginning with the others) > - surprisingly, realhostname_sa() is not unsorted relative to = realhostname() > - the following prototypes have namespace pollution in parameter names > (their parameter names are in the implementation namespace, unlike = for > all of the older prototypes in the file): > properties read(), properties free(), properties free(), = auth_getval(), > realhostname(), realhostname_sa(). The properties code used to be = the > only really ugly code in this file. > - formatting errors for openpty() (premature line splitting and wrong > continuation indent). The very first prototype in this file gives > an example of normal splitting and continuation indent > - formatting errors for forkpty() (same as for openpty()) > - line too long for realhostname_sa(), pw_copy() > - consider fparseln() as being in a new section so it isn't unsorted. > The start of this section should be delimited by a blank line (this = is > done in -current). The new section isn't really justified. It is > just 1 function ifdefed to avoid a namespace problem. > - no namespace pollution for fparseln()'s parameters, but that it = because > it is in a style different from all older prototypes in the file -- = it > doesn't name its parameters. >=20 > Newer disorder and nearby bugs: > - further unsorting of the forward declarations by adding kinfo* to = the > end of the unsorted list. At least the new declarations are sorted > internally. > - the following protypes in the early sections are disordered: > expand_number(), kld*(), kinfo* (no need for a new section for the > last 2. At least they are each sorted internally), gr_scan() > - the following prototypes have namespace pollution in parameter = names: > hexdump(), kld*(), gr_dup(), gr_equal(), gr_make(), gr_scan(). = Only > about half of the gr*() prototypes have this bug > - better indentation for kinfo*() than for older or newer entries! > - line too long for gr_entry() > - pidfile*() have all of the above bugs, plus they are the only = prototypes > up to this point in the file that don't put a tab before the function > name when the return type is int > - quota*() are slightly worse than pidfile*(). They add the = additional > style bug of not using parameter names at all, except for 1 of 2 > parameters in 1 of 12 prototypes. That parameter is namespace = pollution. >=20 > Bruce Does this patch improve the situation? I have not found guidance for line lengths in style(9) -- am I looking = in the wrong place? Guy Index: libutil.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 --- libutil.h (revision 229961) +++ libutil.h (working copy) @@ -84,110 +84,117 @@ #endif =20 /* Avoid pulling in all the include files for no need */ -struct termios; -struct winsize; struct in_addr; struct kinfo_file; struct kinfo_proc; struct kinfo_vmentry; +struct sockaddr; +struct termios; +struct winsize; =20 __BEGIN_DECLS -void clean_environment(const char * const *_white, +char *auth_getval(const char *_name); +void clean_environment(const char * const *_white, const char * const *_more_white); -int extattr_namespace_to_string(int _attrnamespace, char **_string); -int extattr_string_to_namespace(const char *_string, int = *_attrnamespace); -int flopen(const char *_path, int _flags, ...); -void hexdump(const void *ptr, int length, const char *hdr, int = flags); -int login_tty(int _fd); -void trimdomain(char *_fullhost, int _hostsize); -int openpty(int *_amaster, int *_aslave, char *_name, - struct termios *_termp, struct winsize *_winp); -int forkpty(int *_amaster, char *_name, - struct termios *_termp, struct winsize *_winp); -int humanize_number(char *_buf, size_t _len, int64_t _number, +int expand_number(const char *_buf, uint64_t *_num); +int extattr_namespace_to_string(int _attrnamespace, char = **_string); +int extattr_string_to_namespace(const char *_string, int = *_attrnamespace); +int flopen(const char *_path, int _flags, ...); +int forkpty(int *_amaster, char *_name, + struct termios *_termp, struct winsize *_winp); +void hexdump(const void *_ptr, int _length, const char *_hdr, int = _flags); +int humanize_number(char *_buf, size_t _len, int64_t _number, const char *_suffix, int _scale, int _flags); -int expand_number(const char *_buf, uint64_t *_num); -const char *uu_lockerr(int _uu_lockresult); -int uu_lock(const char *_ttyname); -int uu_unlock(const char *_ttyname); -int uu_lock_txfr(const char *_ttyname, pid_t _pid); -int _secure_path(const char *_path, uid_t _uid, gid_t _gid); -properties properties_read(int fd); -void properties_free(properties list); -char *property_find(properties list, const char *name); -char *auth_getval(const char *name); -int realhostname(char *host, size_t hsize, const struct in_addr = *ip); -struct sockaddr; -int realhostname_sa(char *host, size_t hsize, struct sockaddr *addr, - int addrlen); - -int kld_isloaded(const char *name); -int kld_load(const char *name); struct kinfo_file * - kinfo_getfile(pid_t _pid, int *_cntp); + kinfo_getfile(pid_t _pid, int *_cntp); struct kinfo_vmentry * - kinfo_getvmmap(pid_t _pid, int *_cntp); + kinfo_getvmmap(pid_t _pid, int *_cntp); struct kinfo_proc * - kinfo_getallproc(int *_cntp); + kinfo_getallproc(int *_cntp); struct kinfo_proc * - kinfo_getproc(pid_t _pid); + kinfo_getproc(pid_t _pid); +int kld_isloaded(const char *_name); +int kld_load(const char *_name); +int login_tty(int _fd); +int openpty(int *_amaster, int *_aslave, char *_name, + struct termios *_termp, struct winsize *_winp); +void properties_free(properties _list); +properties + properties_read(int fd); +char *property_find(properties _list, const char *_name); +int realhostname(char *_host, size_t _hsize, const struct in_addr = *_ip); +int realhostname_sa(char *_host, size_t _hsize, struct sockaddr = *_addr, + int _addrlen); +void trimdomain(char *_fullhost, int _hostsize); +const char * + uu_lockerr(int _uu_lockresult); +int uu_lock(const char *_ttyname); +int uu_unlock(const char *_ttyname); +int uu_lock_txfr(const char *_ttyname, pid_t _pid); +int _secure_path(const char *_path, uid_t _uid, gid_t _gid); =20 + #ifdef _STDIO_H_ /* avoid adding new includes */ -char *fparseln(FILE *, size_t *, size_t *, const char[3], int); +char *fparseln(FILE *_fp, size_t *_len, size_t *_lineno, + const char _delim[3], int _flags); #endif =20 #ifdef _PWD_H_ -int pw_copy(int _ffd, int _tfd, const struct passwd *_pw, struct = passwd *_old_pw); +int pw_copy(int _ffd, int _tfd, const struct passwd *_pw, struct = passwd *_old_pw); struct passwd *pw_dup(const struct passwd *_pw); -int pw_edit(int _notsetuid); -int pw_equal(const struct passwd *_pw1, const struct passwd *_pw2); -void pw_fini(void); -int pw_init(const char *_dir, const char *_master); +int pw_edit(int _notsetuid); +int pw_equal(const struct passwd *_pw1, const struct passwd *_pw2); +void pw_fini(void); +int pw_init(const char *_dir, const char *_master); char *pw_make(const struct passwd *_pw); char *pw_make_v7(const struct passwd *_pw); -int pw_mkdb(const char *_user); -int pw_lock(void); +int pw_mkdb(const char *_user); +int pw_lock(void); struct passwd *pw_scan(const char *_line, int _flags); const char *pw_tempname(void); -int pw_tmp(int _mfd); +int pw_tmp(int _mfd); #endif =20 #ifdef _GRP_H_ -int gr_copy(int __ffd, int _tfd, const struct group *_gr, struct = group *_old_gr); -struct group *gr_dup(const struct group *gr); -int gr_equal(const struct group *gr1, const struct group *gr2); -void gr_fini(void); -int gr_init(const char *_dir, const char *_master); -int gr_lock(void); -char *gr_make(const struct group *gr); -int gr_mkdb(void); -int gr_tmp(int _mdf); -struct group *gr_scan(const char *line); +int gr_copy(int __ffd, int _tfd, const struct group *_gr, struct = group *_old_gr); +struct group *gr_dup(const struct group *_gr); +int gr_equal(const struct group *_gr1, const struct group *_gr2); +void gr_fini(void); +int gr_init(const char *_dir, const char *_master); +int gr_lock(void); +char *gr_make(const struct group *_gr); +int gr_mkdb(void); +struct group *gr_scan(const char *_line); +int gr_tmp(int _mdf); #endif =20 #ifdef _SYS_PARAM_H_ -struct pidfh *pidfile_open(const char *path, mode_t mode, pid_t = *pidptr); -int pidfile_write(struct pidfh *pfh); -int pidfile_close(struct pidfh *pfh); -int pidfile_remove(struct pidfh *pfh); -int pidfile_fileno(const struct pidfh *pfh); +int pidfile_close(struct pidfh *_pfh); +int pidfile_fileno(const struct pidfh *_pfh); +struct pidfh * + pidfile_open(const char *_path, mode_t _mode, pid_t *_pidptr); +int pidfile_remove(struct pidfh *_pfh); +int pidfile_write(struct pidfh *_pfh); #endif =20 #ifdef _UFS_UFS_QUOTA_H_ struct quotafile; struct fstab; -struct quotafile *quota_open(struct fstab *, int, int); -void quota_close(struct quotafile *); -int quota_on(struct quotafile *); -int quota_off(struct quotafile *); -const char *quota_fsname(const struct quotafile *); -const char *quota_qfname(const struct quotafile *); -int quota_maxid(struct quotafile *); -int quota_check_path(const struct quotafile *, const char *path); -int quota_read(struct quotafile *, struct dqblk *, int); -int quota_write_limits(struct quotafile *, struct dqblk *, int); -int quota_write_usage(struct quotafile *, struct dqblk *, int); -int quota_convert(struct quotafile *, int); +int quota_check_path(const struct quotafile *_qf, const char = *_path); +void quota_close(struct quotafile *_qf); +int quota_convert(struct quotafile *_qf, int _wordsize); +const char * + quota_fsname(const struct quotafile *_qf); +int quota_maxid(struct quotafile *_qf); +int quota_off(struct quotafile *_qf); +int quota_on(struct quotafile *_qf); +struct quotafile * + quota_open(struct fstab *_fs, int _quotatype, int _openflags); +const char * + quota_qfname(const struct quotafile *_qf); +int quota_read(struct quotafile *_qf, struct dqblk *_dqb, int _id); +int quota_write_limits(struct quotafile *_qf, struct dqblk *_dqb, = int _id); +int quota_write_usage(struct quotafile *_qf, struct dqblk *_dqb, = int _id); #endif =20 __END_DECLS -------- This message has been scanned by ComplianceSafe, powered by Palisade's PacketSure. From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 16:35:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA787106566C; Wed, 11 Jan 2012 16:35:26 +0000 (UTC) (envelope-from ghelmer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B8C4C8FC0A; Wed, 11 Jan 2012 16:35:26 +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 q0BGZQZh067530; Wed, 11 Jan 2012 16:35:26 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0BGZQmQ067528; Wed, 11 Jan 2012 16:35:26 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201201111635.q0BGZQmQ067528@svn.freebsd.org> From: Guy Helmer Date: Wed, 11 Jan 2012 16:35:26 +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: r229966 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 16:35:26 -0000 Author: ghelmer Date: Wed Jan 11 16:35:26 2012 New Revision: 229966 URL: http://svn.freebsd.org/changeset/base/229966 Log: jilles pointed out that O_CLOEXEC could be used in the open(2) flags rather than using fcntl(2) later, and in addition to saving a system call, removes a possible race with fork/exec from threads or signal handlers. Modified: head/lib/libutil/pidfile.c Modified: head/lib/libutil/pidfile.c ============================================================================== --- head/lib/libutil/pidfile.c Wed Jan 11 15:00:16 2012 (r229965) +++ head/lib/libutil/pidfile.c Wed Jan 11 16:35:26 2012 (r229966) @@ -117,7 +117,7 @@ pidfile_open(const char *path, mode_t mo * pidfile_write() can be called multiple times. */ fd = flopen(pfh->pf_path, - O_WRONLY | O_CREAT | O_TRUNC | O_NONBLOCK, mode); + O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC | O_NONBLOCK, mode); if (fd == -1) { if (errno == EWOULDBLOCK && pidptr != NULL) { count = 20; @@ -139,19 +139,6 @@ pidfile_open(const char *path, mode_t mo } /* - * Prevent the file descriptor from escaping to other - * programs via exec(3). - */ - if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) { - error = errno; - unlink(pfh->pf_path); - close(fd); - free(pfh); - errno = error; - return (NULL); - } - - /* * Remember file information, so in pidfile_write() we are sure we write * to the proper descriptor. */ From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 16:36:44 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 535851065675; Wed, 11 Jan 2012 16:36:44 +0000 (UTC) (envelope-from guy.helmer@palisadesystems.com) Received: from ps-1-a.compliancesafe.com (ps-1-a.compliancesafe.com [216.81.161.161]) by mx1.freebsd.org (Postfix) with ESMTP id 169D58FC13; Wed, 11 Jan 2012 16:36:43 +0000 (UTC) Received: from mail.palisadesystems.com (localhost [127.0.0.1]) by ps-1-a.compliancesafe.com (8.14.4/8.14.3) with ESMTP id q0BGaPuX082734; Wed, 11 Jan 2012 10:36:25 -0600 (CST) (envelope-from guy.helmer@palisadesystems.com) Received: from guysmbp.dyn.palisadesys.com (GuysMBP.dyn.palisadesys.com [172.16.2.90]) (authenticated bits=0) by mail.palisadesystems.com (8.14.3/8.14.3) with ESMTP id q0BGaAqe041728 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Wed, 11 Jan 2012 10:36:19 -0600 (CST) (envelope-from guy.helmer@palisadesystems.com) X-DKIM: Sendmail DKIM Filter v2.8.3 mail.palisadesystems.com q0BGaAqe041728 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=palisadesystems.com; s=mail; t=1326299779; bh=AOsWNRkvZ4VEI675YH7H1A6JJM+QLY4D8htAVExs8YM=; l=128; h=Subject:Mime-Version:Content-Type:From:In-Reply-To:Date:Cc: Content-Transfer-Encoding:Message-Id:References:To; b=RsWbeGa/wU9S6mWjcPQh5mQwdPkUTl1ixQ7unmPn88rTEDXG4k9EaRVvC6hZfFvQl z1sGhmq9ls/4o/sjm6CFlhCmsY64ZCLU3G7d1dlZqL0Df42ZDMwn0iBoQL3GSMTpNx 3XZmIys3gOc8KCzMwzoXYEzh7+RGPoJ92k1wYpfM= Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=us-ascii From: Guy Helmer In-Reply-To: <20120110230607.GA15897@stack.nl> Date: Wed, 11 Jan 2012 10:36:09 -0600 Content-Transfer-Encoding: 7bit Message-Id: <38F874EE-9573-4370-A3BD-DA08594023CD@palisadesystems.com> References: <201201101843.q0AIhRuM022949@svn.freebsd.org> <20120110230607.GA15897@stack.nl> To: Jilles Tjoelker X-Mailer: Apple Mail (2.1251.1) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.5 (mail.palisadesystems.com [172.16.1.5]); Wed, 11 Jan 2012 10:36:19 -0600 (CST) X-Palisade-MailScanner-Information: Please contact the ISP for more information X-Palisade-MailScanner-ID: q0BGaAqe041728 X-Palisade-MailScanner: Found to be clean X-Palisade-MailScanner-SpamCheck: not spam (whitelisted), SpamAssassin (score=-1.628, required 5, ALL_TRUSTED -1.00, BAYES_00 -1.90, RP_8BIT 1.27) X-Palisade-MailScanner-From: guy.helmer@palisadesystems.com X-Spam-Status: No X-PacketSure-Scanned: Yes Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r229936 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 16:36:44 -0000 On Jan 10, 2012, at 5:06 PM, Jilles Tjoelker wrote: > On Tue, Jan 10, 2012 at 06:43:27PM +0000, Guy Helmer wrote: >> Author: ghelmer >> Date: Tue Jan 10 18:43:27 2012 >> New Revision: 229936 >> URL: http://svn.freebsd.org/changeset/base/229936 > >> Log: >> Set the FD_CLOEXEC flag on the open pidfile file descriptor. > >> Discussed with: pjd, des > >> Modified: >> head/lib/libutil/pidfile.c > >> + /* >> + * Prevent the file descriptor from escaping to other >> + * programs via exec(3). >> + */ >> + if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) { > > Consider adding O_CLOEXEC to the flopen() flags instead. That saves a > system call and removes a possible race condition with fork/exec from > threads or signal handlers. > > -- > Jilles Tjoelker Good idea, thanks! Guy -------- This message has been scanned by ComplianceSafe, powered by Palisade's PacketSure. From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 16:40:08 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44CC0106564A; Wed, 11 Jan 2012 16:40:08 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id CAAFA8FC18; Wed, 11 Jan 2012 16:40:07 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0BGe3Vg010012 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 12 Jan 2012 03:40:05 +1100 Date: Thu, 12 Jan 2012 03:40:03 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Guy Helmer In-Reply-To: <26EF49B4-1B8E-43BC-AC7B-FD24BB94C961@palisadesystems.com> Message-ID: <20120112025133.H2744@besplex.bde.org> References: <201201101953.q0AJrPao025097@svn.freebsd.org> <20120110221323.GE1694@garage.freebsd.pl> <20120111214848.K1813@besplex.bde.org> <26EF49B4-1B8E-43BC-AC7B-FD24BB94C961@palisadesystems.com> 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, Pawel Jakub Dawidek , Bruce Evans Subject: Re: svn commit: r229937 - in head/lib: libc/gen libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 16:40:08 -0000 On Wed, 11 Jan 2012, Guy Helmer wrote: > On Jan 11, 2012, at 6:25 AM, Bruce Evans wrote: >> Is there any chance of keeping sorted lists sorted? >> >> This file used to be mostly sorted and mostly in KNF (tab before >> function names) and mostly without namespace pollution in parameter >> names). Newer code in it violates all of these style and header >> implementation rules. The pidfile code was already especially bad, >> and adding to the end of the unsorted list in it doesn't help. >> >> The pidfile man page is also unsorted. It was in "operations" order >> ... The Makefile for libutil is also unsorted: - SRCS is sorted or nearly so - disorder in MAN begins with pty.3. The rest of MAN is unsorted in much the same disorder as the prototypes - MLINKS is considerably more disordered, but is much larger so it needs ordering even more. SRCS and MAN are simple lists (except for the internal structure of MAN -- sections). MLINKS has more internal structure (pairs of link source and target, which should be sorted on the source first, then the target. See Makefile.inc's in libc for rasonably correct examples. > Does this patch improve the situation? Sure. > I have not found guidance for line lengths in style(9) -- am I looking in the wrong place? Not really. style(9) is supposed to consist mainly of examples. It contains no examples of lines longer than 80 (preferably 79). Therefore, lines longer than 80 are bad style. You have to know that it has been mangled into man page form and cancel the lossages from this. One lossage is that man adds a left margin of 5 spaces. So it is lines of length longer than 85 in the man output that would be too long. man should format man pages for the terminal or page width. This might exceed 80, or it might be less than 85 so it might be man and not the examples that are giving the line length limit. However, most of the examples are in literal text which man should not reformat. Thus the output has some lines slightly longer than 80 if that is the terminal width, but hopefully none more than 85. The 5 character margin also destroys the tab structure in the output. The man page is careful to preserve the 8-column primary indentation and the 4-column continuation-line indentation, but these cannot be done with tabs. Some user like wide terminals, but small screens are more common now, so even 80 columns may be too wide for a default. It's just too hard to have enough indentation in 64 columns. > Index: libutil.h > =================================================================== > --- libutil.h (revision 229961) > +++ libutil.h (working copy) > @@ -84,110 +84,117 @@ > ... > __BEGIN_DECLS > -void clean_environment(const char * const *_white, > +char *auth_getval(const char *_name); > +void clean_environment(const char * const *_white, > const char * const *_more_white); > -int extattr_namespace_to_string(int _attrnamespace, char **_string); > -int extattr_string_to_namespace(const char *_string, int *_attrnamespace); > -int flopen(const char *_path, int _flags, ...); I'd prefer to see the changes separately: sort, reformat, fix namespaces; not necessarily in that order. Sorting gives especially unreadable diffs. Here you changed to the style that leaves an extra space before the function name to line up with function names that have a `*' before them. That is too much for me. It also gives unreadable diffs by changing almost every line, since it was not used in this file before. This can be seen in the declaration of `clean_environment' above. > ... > +int uu_unlock(const char *_ttyname); > +int uu_lock_txfr(const char *_ttyname, pid_t _pid); > +int _secure_path(const char *_path, uid_t _uid, gid_t _gid); The best order for sorting `_foo' is unclear. In ASCII it is between A-Z and a-z. Lists in makefiles mostly use pure ASCII order since that is easiest to generate and check by doing the sorting using ls. In source code we might prefer to ignore underscores in sorting. The leading underscore in this name seems to be bogus. The function is documented. Use of it in other library functions might require an underscore to avoid namespace pollution, but this library is not generally careful about that. > > + Extra blank line. > +int quota_check_path(const struct quotafile *_qf, const char *_path); > +void quota_close(struct quotafile *_qf); > +int quota_convert(struct quotafile *_qf, int _wordsize); > ... I checked that a few of these names match the man page. Seems fairly complete and correct. Bruce From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 16:53:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE8FB1065686; Wed, 11 Jan 2012 16:53:51 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DCCA58FC16; Wed, 11 Jan 2012 16:53: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 q0BGrpiX068126; Wed, 11 Jan 2012 16:53:51 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0BGrpuq068124; Wed, 11 Jan 2012 16:53:51 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201201111653.q0BGrpuq068124@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 11 Jan 2012 16:53: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: r229967 - head/sys/powerpc/powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 16:53:52 -0000 Author: nwhitehorn Date: Wed Jan 11 16:53:51 2012 New Revision: 229967 URL: http://svn.freebsd.org/changeset/base/229967 Log: Add a memory barrier to bus_dmamap_sync(), as should have always been present. We need a sync instead of eieio, as eieio does not enforce storage ordering between main and device memory. Modified: head/sys/powerpc/powerpc/busdma_machdep.c Modified: head/sys/powerpc/powerpc/busdma_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/busdma_machdep.c Wed Jan 11 16:35:26 2012 (r229966) +++ head/sys/powerpc/powerpc/busdma_machdep.c Wed Jan 11 16:53:51 2012 (r229967) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "iommu_if.h" @@ -979,6 +980,8 @@ _bus_dmamap_sync(bus_dma_tag_t dmat, bus dmat->bounce_zone->total_bounced++; } } + + powerpc_sync(); } static void From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 17:10:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C86E106566B; Wed, 11 Jan 2012 17:10:27 +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 5B3CB8FC0A; Wed, 11 Jan 2012 17:10:27 +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 q0BHARkJ068684; Wed, 11 Jan 2012 17:10:27 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0BHARJO068682; Wed, 11 Jan 2012 17:10:27 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201111710.q0BHARJO068682@svn.freebsd.org> From: Adrian Chadd Date: Wed, 11 Jan 2012 17:10:27 +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: r229968 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 17:10:27 -0000 Author: adrian Date: Wed Jan 11 17:10:27 2012 New Revision: 229968 URL: http://svn.freebsd.org/changeset/base/229968 Log: Add the ability to kick an existing mesh node without waiting for it to time out. Submitted by: Monthadar Al Jaberi Modified: head/sys/net80211/ieee80211_ioctl.c Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Wed Jan 11 16:53:51 2012 (r229967) +++ head/sys/net80211/ieee80211_ioctl.c Wed Jan 11 17:10:27 2012 (r229968) @@ -1397,6 +1397,17 @@ setmlme_common(struct ieee80211vap *vap, IEEE80211_FC0_SUBTYPE_DEAUTH, reason); ieee80211_free_node(ni); break; + case IEEE80211_M_MBSS: + IEEE80211_NODE_LOCK(nt); + ni = ieee80211_find_node_locked(nt, mac); + if (ni != NULL) { + ieee80211_node_leave(ni); + ieee80211_free_node(ni); + } else { + error = ENOENT; + } + IEEE80211_NODE_UNLOCK(nt); + break; default: error = EINVAL; break; From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 17:21:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1ED741065676; Wed, 11 Jan 2012 17:21:23 +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 0CBB88FC1B; Wed, 11 Jan 2012 17:21: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 q0BHLMB6069067; Wed, 11 Jan 2012 17:21:22 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0BHLMXT069065; Wed, 11 Jan 2012 17:21:22 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201201111721.q0BHLMXT069065@svn.freebsd.org> From: Sergey Kandaurov Date: Wed, 11 Jan 2012 17:21:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229969 - stable/7/etc/defaults X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 17:21:23 -0000 Author: pluknet Date: Wed Jan 11 17:21:22 2012 New Revision: 229969 URL: http://svn.freebsd.org/changeset/base/229969 Log: MFC r211801: fix typo. Spotted by: Ildar Hizbulin (stable/7) Modified: stable/7/etc/defaults/rc.conf Directory Properties: stable/7/etc/ (props changed) Modified: stable/7/etc/defaults/rc.conf ============================================================================== --- stable/7/etc/defaults/rc.conf Wed Jan 11 17:10:27 2012 (r229968) +++ stable/7/etc/defaults/rc.conf Wed Jan 11 17:21:22 2012 (r229969) @@ -196,7 +196,7 @@ ifconfig_lo0="inet 127.0.0.1" # default #ifconfig_ed0_ipx="ipx 0x00010010" # Sample IPX address family entry. #ifconfig_fxp0_name="net0" # Change interface name from fxp0 to net0. #vlans_fxp0="101 vlan0" # vlan(4) interfaces for fxp0 device -#create_arg_vlan0="vlan 102" # vlan tag for vlan0 device +#create_args_vlan0="vlan 102" # vlan tag for vlan0 device #ipv4_addrs_fxp0="192.168.0.1/24 192.168.1.1-5/28" # example IPv4 address entry. # #autobridge_interfaces="bridge0" # List of bridges to check From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 17:41:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1C42106567C; Wed, 11 Jan 2012 17:41:14 +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 8DDBB8FC14; Wed, 11 Jan 2012 17:41: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 q0BHfEBX069721; Wed, 11 Jan 2012 17:41:14 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0BHfEEl069717; Wed, 11 Jan 2012 17:41:14 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201111741.q0BHfEEl069717@svn.freebsd.org> From: Adrian Chadd Date: Wed, 11 Jan 2012 17:41: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: r229970 - in head/sys: dev/wtap dev/wtap/plugins dev/wtap/wtap_hal modules/wtap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 17:41:14 -0000 Author: adrian Date: Wed Jan 11 17:41:14 2012 New Revision: 229970 URL: http://svn.freebsd.org/changeset/base/229970 Log: Introduce wtap, the beginnings of a net80211 wlan simulator. This introduces: * a basic wtap interface * a HAL, which implements an abstraction layer for implementing different device behavious; * A visibility plugin, which allows for control over which nodes see other nodes (useful for mesh work.) It doesn't yet implement sta/adhoc/hostap modes but these are quite feasible to implement. Monthadar uses it to do 802.11s mesh verification. The userland tools will be committed in a follow-up commit. Submitted by: Monthadar Al Jaberi Added: head/sys/dev/wtap/ head/sys/dev/wtap/if_medium.c (contents, props changed) head/sys/dev/wtap/if_medium.h (contents, props changed) head/sys/dev/wtap/if_wtap.c (contents, props changed) head/sys/dev/wtap/if_wtap_module.c (contents, props changed) head/sys/dev/wtap/if_wtapioctl.h (contents, props changed) head/sys/dev/wtap/if_wtapvar.h (contents, props changed) head/sys/dev/wtap/plugins/ head/sys/dev/wtap/plugins/visibility.c (contents, props changed) head/sys/dev/wtap/plugins/visibility.h (contents, props changed) head/sys/dev/wtap/plugins/visibility_ioctl.h (contents, props changed) head/sys/dev/wtap/plugins/wtap_plugin.h (contents, props changed) head/sys/dev/wtap/wtap_hal/ head/sys/dev/wtap/wtap_hal/hal.c (contents, props changed) head/sys/dev/wtap/wtap_hal/hal.h (contents, props changed) head/sys/dev/wtap/wtap_hal/handler.h (contents, props changed) head/sys/modules/wtap/ head/sys/modules/wtap/Makefile (contents, props changed) Added: head/sys/dev/wtap/if_medium.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/wtap/if_medium.c Wed Jan 11 17:41:14 2012 (r229970) @@ -0,0 +1,120 @@ +/*- + * Copyright (c) 2010-2011 Monthadar Al Jaberi, TerraNet AB + * 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, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + * + * $FreeBSD$ + */ +#include "if_wtapvar.h" +#include "if_medium.h" + +void +init_medium(struct wtap_medium *md) +{ + + DWTAP_PRINTF("%s\n", __func__); + STAILQ_INIT(&md->md_pktbuf); + mtx_init(&md->md_mtx, "wtap_medium mtx", NULL, MTX_DEF | MTX_RECURSE); + + /* Event handler for sending packets between wtaps */ + struct eventhandler *eh = (struct eventhandler *) + malloc(sizeof(struct eventhandler), M_WTAP, M_NOWAIT | M_ZERO); + eh->tq = taskqueue_create("wtap_tx_taskq", M_NOWAIT | M_ZERO, + taskqueue_thread_enqueue, &eh->tq); + taskqueue_start_threads(&eh->tq, 1, PI_NET, "%s taskq", "wtap_medium"); + md->tx_handler = eh; + /* Mark medium closed by default */ + md->open = 0; +} + +void +deinit_medium(struct wtap_medium *md) +{ + + DWTAP_PRINTF("%s\n", __func__); + taskqueue_free(md->tx_handler->tq); + free(md->tx_handler, M_WTAP); +} + +int +medium_transmit(struct wtap_medium *md, int id, struct mbuf*m) +{ + + mtx_lock(&md->md_mtx); + if (md->open == 0){ + DWTAP_PRINTF("[%d] dropping m=%p\n", id, m); + m_free(m); + mtx_unlock(&md->md_mtx); + return 0; + } + + DWTAP_PRINTF("[%d] transmiting m=%p\n", id, m); + struct packet *p = (struct packet *)malloc(sizeof(struct packet), + M_WTAP_PACKET, M_ZERO | M_NOWAIT); + p->id = id; + p->m = m; + + STAILQ_INSERT_TAIL(&md->md_pktbuf, p, pf_list); + taskqueue_enqueue(md->tx_handler->tq, &md->tx_handler->proc); + mtx_unlock(&md->md_mtx); + + return 0; +} + +struct packet * +medium_get_next_packet(struct wtap_medium *md) +{ + struct packet *p; + + mtx_lock(&md->md_mtx); + p = STAILQ_FIRST(&md->md_pktbuf); + if (p == NULL){ + mtx_unlock(&md->md_mtx); + return NULL; + } + + STAILQ_REMOVE_HEAD(&md->md_pktbuf, pf_list); + mtx_unlock(&md->md_mtx); + return p; +} + +void +medium_open(struct wtap_medium *md) +{ + + mtx_lock(&md->md_mtx); + md->open = 1; + mtx_unlock(&md->md_mtx); +} + +void +medium_close(struct wtap_medium *md) +{ + + mtx_lock(&md->md_mtx); + md->open = 0; + mtx_unlock(&md->md_mtx); +} Added: head/sys/dev/wtap/if_medium.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/wtap/if_medium.h Wed Jan 11 17:41:14 2012 (r229970) @@ -0,0 +1,72 @@ +/*- + * Copyright (c) 2010-2011 Monthadar Al Jaberi, TerraNet AB + * All rights reserved. + * + * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting + * 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, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + * + * $FreeBSD$ + */ + +#ifndef __DEV_WTAP_MEDIUM_H__ +#define __DEV_WTAP_MEDIUM_H__ + +#include "if_wtapvar.h" +#include "wtap_hal/handler.h" + +struct packet { + STAILQ_ENTRY(packet) pf_list; + struct mbuf * m; + int id; +}; +typedef STAILQ_HEAD(, packet) md_pkthead; + +struct wtap_medium { + struct mtx md_mtx; +#if 0 + int visibility[MAX_NBR_WTAP]; + struct stailhead *headp; + packet_head pktbuf; + STAILQ_HEAD(stailhead, packet) pktbuf; + STAILQ_HEAD(stailhead, packet) pktbuf; + /* = STAILQ_HEAD_INITIALIZER(head); */ +#endif + /* 0 means we drop packets, 1 we queue them */ + int open; + md_pkthead md_pktbuf; /* master queue */ + struct eventhandler *tx_handler; + struct timehandler *bc_handler; +}; + +extern void init_medium(struct wtap_medium *); +extern void deinit_medium(struct wtap_medium *); +extern void medium_open(struct wtap_medium *); +extern void medium_close(struct wtap_medium *); +extern int medium_transmit(struct wtap_medium *, int id, struct mbuf*); +extern struct packet *medium_get_next_packet(struct wtap_medium *); + +#endif /* __DEV_WTAP_MEDIUM_H__ */ Added: head/sys/dev/wtap/if_wtap.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/wtap/if_wtap.c Wed Jan 11 17:41:14 2012 (r229970) @@ -0,0 +1,904 @@ +/*- + * Copyright (c) 2010-2011 Monthadar Al Jaberi, TerraNet AB + * All rights reserved. + * + * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting + * 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, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + * + * $FreeBSD$ + */ +#include "if_wtapvar.h" +#include /* uio struct */ +#include +#include +#include + +#include +#include "if_medium.h" + +/* device for IOCTL and read/write for debuggin purposes */ +/* Function prototypes */ +static d_open_t wtap_node_open; +static d_close_t wtap_node_close; +static d_write_t wtap_node_write; +static d_ioctl_t wtap_node_ioctl; + +static struct cdevsw wtap_cdevsw = { + .d_version = D_VERSION, + .d_flags = 0, + .d_open = wtap_node_open, + .d_close = wtap_node_close, + .d_write = wtap_node_write, + .d_ioctl = wtap_node_ioctl, + .d_name = "wtapnode", +}; + +static int +wtap_node_open(struct cdev *dev, int oflags, int devtype, struct thread *p) +{ + + int err = 0; + uprintf("Opened device \"echo\" successfully.\n"); + return(err); +} + +static int +wtap_node_close(struct cdev *dev, int fflag, int devtype, struct thread *p) +{ + + uprintf("Closing device \"echo.\"\n"); + return(0); +} + +static int +wtap_node_write(struct cdev *dev, struct uio *uio, int ioflag) +{ + int err = 0; + struct mbuf *m; + struct ifnet *ifp; + struct wtap_softc *sc; + uint8_t buf[1024]; + int buf_len; + + uprintf("write device %s \"echo.\"\n", dev->si_name); + buf_len = MIN(uio->uio_iov->iov_len, 1024); + err = copyin(uio->uio_iov->iov_base, buf, buf_len); + + if (err != 0) { + uprintf("Write failed: bad address!\n"); + return (err); + } + + MGETHDR(m, M_DONTWAIT, MT_DATA); + m_copyback(m, 0, buf_len, buf); + + CURVNET_SET(TD_TO_VNET(curthread)); + IFNET_RLOCK_NOSLEEP(); + + TAILQ_FOREACH(ifp, &V_ifnet, if_link) { + printf("ifp->if_xname = %s\n", ifp->if_xname); + if(strcmp(dev->si_name, ifp->if_xname) == 0){ + printf("found match, correspoding wtap = %s\n", + ifp->if_xname); + sc = (struct wtap_softc *)ifp->if_softc; + printf("wtap id = %d\n", sc->id); + wtap_inject(sc, m); + } + } + + IFNET_RUNLOCK_NOSLEEP(); + CURVNET_RESTORE(); + + return(err); +} + +int +wtap_node_ioctl(struct cdev *dev, u_long cmd, caddr_t data, + int fflag, struct thread *td) +{ + int error = 0; + + switch(cmd) { + default: + DWTAP_PRINTF("Unkown WTAP IOCTL\n"); + error = EINVAL; + } + return error; +} + +static int wtap_raw_xmit(struct ieee80211_node *ni, struct mbuf *m, + const struct ieee80211_bpf_params *params); + +static int +wtap_medium_enqueue(struct wtap_vap *avp, struct mbuf *m) +{ + + return medium_transmit(avp->av_md, avp->id, m); +} + +static int +wtap_media_change(struct ifnet *ifp) +{ + + DWTAP_PRINTF("%s\n", __func__); + int error = ieee80211_media_change(ifp); + /* NB: only the fixed rate can change and that doesn't need a reset */ + return (error == ENETRESET ? 0 : error); +} + +/* + * Intercept management frames to collect beacon rssi data + * and to do ibss merges. + */ +static void +wtap_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m, + int subtype, int rssi, int nf) +{ + struct ieee80211vap *vap = ni->ni_vap; +#if 0 + DWTAP_PRINTF("[%d] %s\n", myath_id(ni), __func__); +#endif + WTAP_VAP(vap)->av_recv_mgmt(ni, m, subtype, rssi, nf); +} + +static int +wtap_reset_vap(struct ieee80211vap *vap, u_long cmd) +{ + + DWTAP_PRINTF("%s\n", __func__); + return 0; +} + +static void +wtap_beacon_update(struct ieee80211vap *vap, int item) +{ + struct ieee80211_beacon_offsets *bo = &WTAP_VAP(vap)->av_boff; + + DWTAP_PRINTF("%s\n", __func__); + setbit(bo->bo_flags, item); +} + +/* + * Allocate and setup an initial beacon frame. + */ +static int +wtap_beacon_alloc(struct wtap_softc *sc, struct ieee80211_node *ni) +{ + struct ieee80211vap *vap = ni->ni_vap; + struct wtap_vap *avp = WTAP_VAP(vap); + + DWTAP_PRINTF("[%s] %s\n", ether_sprintf(ni->ni_macaddr), __func__); + + /* + * NB: the beacon data buffer must be 32-bit aligned; + * we assume the mbuf routines will return us something + * with this alignment (perhaps should assert). + */ + avp->beacon = ieee80211_beacon_alloc(ni, &avp->av_boff); + if (avp->beacon == NULL) { + printf("%s: cannot get mbuf\n", __func__); + return ENOMEM; + } + callout_init(&avp->av_swba, 0); + avp->bf_node = ieee80211_ref_node(ni); + + return 0; +} + +static void +wtap_beacon_config(struct wtap_softc *sc, struct ieee80211vap *vap) +{ + + DWTAP_PRINTF("%s\n", __func__); +} + +static void +wtap_beacon_intrp(void *arg) +{ + struct wtap_vap *avp = arg; + struct ieee80211vap *vap = arg; + struct mbuf *m; + + KASSERT(vap->iv_state >= IEEE80211_S_RUN, + ("not running, state %d", vap->iv_state)); + DWTAP_PRINTF("[%d] beacon intrp\n", avp->id); //burst mode + /* + * Update dynamic beacon contents. If this returns + * non-zero then we need to remap the memory because + * the beacon frame changed size (probably because + * of the TIM bitmap). + */ + m = m_dup(avp->beacon, M_DONTWAIT); + if (ieee80211_beacon_update(avp->bf_node, &avp->av_boff, m, 0)) { + printf("%s, need to remap the memory because the beacon frame" + " changed size.\n",__func__); + } + + if (ieee80211_radiotap_active_vap(vap)) + ieee80211_radiotap_tx(vap, m); + +#if 0 + medium_transmit(avp->av_md, avp->id, m); +#endif + wtap_medium_enqueue(avp, m); + callout_schedule(&avp->av_swba, avp->av_bcinterval); +} + +static int +wtap_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) +{ + struct ieee80211com *ic = vap->iv_ic; + struct wtap_softc *sc = ic->ic_ifp->if_softc; + struct wtap_vap *avp = WTAP_VAP(vap); + struct ieee80211_node *ni = NULL; + int error; + + DWTAP_PRINTF("%s\n", __func__); + + ni = vap->iv_bss; + /* + * Invoke the parent method to do net80211 work. + */ + error = avp->av_newstate(vap, nstate, arg); + if (error != 0) + goto bad; + + if (nstate == IEEE80211_S_RUN) { + /* NB: collect bss node again, it may have changed */ + ni = vap->iv_bss; + switch (vap->iv_opmode) { + case IEEE80211_M_MBSS: + error = wtap_beacon_alloc(sc, ni); + if (error != 0) + goto bad; + wtap_beacon_config(sc, vap); + callout_reset(&avp->av_swba, avp->av_bcinterval, + wtap_beacon_intrp, vap); + break; + default: + goto bad; + } + } + return 0; +bad: + printf("%s: bad\n", __func__); + return error; +} + +static void +wtap_bmiss(struct ieee80211vap *vap) +{ + struct wtap_vap *avp = (struct wtap_vap *)vap; + + DWTAP_PRINTF("%s\n", __func__); + avp->av_bmiss(vap); +} + +static struct ieee80211vap * +wtap_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], + int unit, enum ieee80211_opmode opmode, int flags, + const uint8_t bssid[IEEE80211_ADDR_LEN], + const uint8_t mac[IEEE80211_ADDR_LEN]) +{ + struct wtap_softc *sc = ic->ic_ifp->if_softc; + struct ieee80211vap *vap; + struct wtap_vap *avp; + int error; + + DWTAP_PRINTF("%s\n", __func__); + + avp = (struct wtap_vap *) malloc(sizeof(struct wtap_vap), + M_80211_VAP, M_NOWAIT | M_ZERO); + avp->id = sc->id; + avp->av_md = sc->sc_md; + avp->av_bcinterval = BEACON_INTRERVAL + 100*sc->id; + vap = (struct ieee80211vap *) avp; + error = ieee80211_vap_setup(ic, vap, name, unit, IEEE80211_M_MBSS, + flags | IEEE80211_CLONE_NOBEACONS, bssid, mac); + + /* override various methods */ + avp->av_recv_mgmt = vap->iv_recv_mgmt; + vap->iv_recv_mgmt = wtap_recv_mgmt; + vap->iv_reset = wtap_reset_vap; + vap->iv_update_beacon = wtap_beacon_update; + avp->av_newstate = vap->iv_newstate; + vap->iv_newstate = wtap_newstate; + avp->av_bmiss = vap->iv_bmiss; + vap->iv_bmiss = wtap_bmiss; + + /* complete setup */ + ieee80211_vap_attach(vap, wtap_media_change, ieee80211_media_status); + avp->av_dev = make_dev(&wtap_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, + (const char *)ic->ic_ifp->if_xname); + + /* TODO this is a hack to force it to choose the rate we want */ + vap->iv_bss->ni_txrate = 130; + return vap; +} + +static void +wtap_vap_delete(struct ieee80211vap *vap) +{ + struct wtap_vap *avp = WTAP_VAP(vap); + + DWTAP_PRINTF("%s\n", __func__); + destroy_dev(avp->av_dev); + callout_stop(&avp->av_swba); + ieee80211_vap_detach(vap); + free((struct wtap_vap*) vap, M_80211_VAP); +} + +/* NB: This function is not used. + * I had the problem of the queue + * being empty all the time. + * Maybe I am setting the queue wrong? + */ +static void +wtap_start(struct ifnet *ifp) +{ + struct ieee80211com *ic = ifp->if_l2com; + struct ifnet *icifp = ic->ic_ifp; + struct wtap_softc *sc = icifp->if_softc; + struct ieee80211_node *ni; + struct mbuf *m; + + DWTAP_PRINTF("my_start, with id=%u\n", sc->id); + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || sc->up == 0) + return; + for (;;) { + if(IFQ_IS_EMPTY(&ifp->if_snd)){ + printf("queue empty, just trying to see " + "if the other queue is empty\n"); +#if 0 + printf("queue for id=1, %u\n", + IFQ_IS_EMPTY(&global_mscs[1]->ifp->if_snd)); + printf("queue for id=0, %u\n", + IFQ_IS_EMPTY(&global_mscs[0]->ifp->if_snd)); +#endif + break; + } + IFQ_DEQUEUE(&ifp->if_snd, m); + if (m == NULL) { + printf("error dequeueing from ifp->snd\n"); + break; + } + ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; + /* + * Check for fragmentation. If this frame + * has been broken up verify we have enough + * buffers to send all the fragments so all + * go out or none... + */ +#if 0 + STAILQ_INIT(&frags); +#endif + if ((m->m_flags & M_FRAG)){ + printf("dont support frags\n"); + ifp->if_oerrors++; + return; + } + ifp->if_opackets++; + if(wtap_raw_xmit(ni, m, NULL) < 0){ + printf("error raw_xmiting\n"); + ifp->if_oerrors++; + return; + } + } +} + +static int +wtap_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) +{ +#if 0 + DWTAP_PRINTF("%s\n", __func__); + uprintf("%s, command %lu\n", __func__, cmd); +#endif +#define IS_RUNNING(ifp) \ + ((ifp->if_flags & IFF_UP) && (ifp->if_drv_flags & IFF_DRV_RUNNING)) + struct ieee80211com *ic = ifp->if_l2com; + struct wtap_softc *sc = ifp->if_softc; + struct ifreq *ifr = (struct ifreq *)data; + int error = 0; + + switch (cmd) { + case SIOCSIFFLAGS: + //printf("%s: %s\n", __func__, "SIOCSIFFLAGS"); + if (IS_RUNNING(ifp)) { + DWTAP_PRINTF("running\n"); +#if 0 + /* + * To avoid rescanning another access point, + * do not call ath_init() here. Instead, + * only reflect promisc mode settings. + */ + //ath_mode_init(sc); +#endif + } else if (ifp->if_flags & IFF_UP) { + DWTAP_PRINTF("up\n"); + sc->up = 1; +#if 0 + /* + * Beware of being called during attach/detach + * to reset promiscuous mode. In that case we + * will still be marked UP but not RUNNING. + * However trying to re-init the interface + * is the wrong thing to do as we've already + * torn down much of our state. There's + * probably a better way to deal with this. + */ + //if (!sc->sc_invalid) + // ath_init(sc); /* XXX lose error */ +#endif + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ieee80211_start_all(ic); + } else { + DWTAP_PRINTF("stoping\n"); +#if 0 + ath_stop_locked(ifp); +#ifdef notyet + /* XXX must wakeup in places like ath_vap_delete */ + if (!sc->sc_invalid) + ath_hal_setpower(sc->sc_ah, HAL_PM_FULL_SLEEP); +#endif +#endif + } + break; + case SIOCGIFMEDIA: + case SIOCSIFMEDIA: +#if 0 + DWTAP_PRINTF("%s: %s\n", __func__, "SIOCGIFMEDIA|SIOCSIFMEDIA"); +#endif + error = ifmedia_ioctl(ifp, ifr, &ic->ic_media, cmd); + break; + case SIOCGIFADDR: +#if 0 + DWTAP_PRINTF("%s: %s\n", __func__, "SIOCGIFADDR"); +#endif + error = ether_ioctl(ifp, cmd, data); + break; + default: + DWTAP_PRINTF("%s: %s [%lu]\n", __func__, "EINVAL", cmd); + error = EINVAL; + break; + } + return error; +#undef IS_RUNNING +} + +static void +wtap_init(void *arg){ + + DWTAP_PRINTF("%s\n", __func__); +} + +static void +wtap_scan_start(struct ieee80211com *ic) +{ + +#if 0 + DWTAP_PRINTF("%s\n", __func__); +#endif +} + +static void +wtap_scan_end(struct ieee80211com *ic) +{ + +#if 0 + DWTAP_PRINTF("%s\n", __func__); +#endif +} + +static void +wtap_set_channel(struct ieee80211com *ic) +{ + +#if 0 + DWTAP_PRINTF("%s\n", __func__); +#endif +} + +static int +wtap_raw_xmit(struct ieee80211_node *ni, struct mbuf *m, + const struct ieee80211_bpf_params *params) +{ +#if 0 + DWTAP_PRINTF("%s, %p\n", __func__, m); +#endif + struct ieee80211vap *vap = ni->ni_vap; + struct wtap_vap *avp = WTAP_VAP(vap); + + if (ieee80211_radiotap_active_vap(vap)) { + ieee80211_radiotap_tx(vap, m); + } + if (m->m_flags & M_TXCB) + ieee80211_process_callback(ni, m, 0); + ieee80211_free_node(ni); + return wtap_medium_enqueue(avp, m); +} + +void +wtap_inject(struct wtap_softc *sc, struct mbuf *m) +{ + struct wtap_buf *bf = (struct wtap_buf *)malloc(sizeof(struct wtap_buf), + M_WTAP_RXBUF, M_NOWAIT | M_ZERO); + KASSERT(bf != NULL, ("could not allocated a new wtap_buf\n")); + bf->m = m; + + mtx_lock(&sc->sc_mtx); + STAILQ_INSERT_TAIL(&sc->sc_rxbuf, bf, bf_list); + taskqueue_enqueue(sc->sc_tq, &sc->sc_rxtask); + mtx_unlock(&sc->sc_mtx); +} + +void +wtap_rx_deliver(struct wtap_softc *sc, struct mbuf *m) +{ + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211_node *ni; + int type; +#if 0 + DWTAP_PRINTF("%s\n", __func__); +#endif + + DWTAP_PRINTF("[%d] receiving m=%p\n", sc->id, m); + if (m == NULL) { /* NB: shouldn't happen */ + if_printf(ifp, "%s: no mbuf!\n", __func__); + } + + ifp->if_ipackets++; + + ieee80211_dump_pkt(ic, mtod(m, caddr_t), 0,0,0); + + /* + * Locate the node for sender, track state, and then + * pass the (referenced) node up to the 802.11 layer + * for its use. + */ + ni = ieee80211_find_rxnode_withkey(ic, + mtod(m, const struct ieee80211_frame_min *),IEEE80211_KEYIX_NONE); + if (ni != NULL) { + /* + * Sending station is known, dispatch directly. + */ + type = ieee80211_input(ni, m, 1<<7, 10); + ieee80211_free_node(ni); + } else { + type = ieee80211_input_all(ic, m, 1<<7, 10); + } +} + +static void +wtap_rx_proc(void *arg, int npending) +{ + struct wtap_softc *sc = (struct wtap_softc *)arg; + struct ifnet *ifp = sc->sc_ifp; + struct ieee80211com *ic = ifp->if_l2com; + struct mbuf *m; + struct ieee80211_node *ni; + int type; + struct wtap_buf *bf; + +#if 0 + DWTAP_PRINTF("%s\n", __func__); +#endif + + for(;;) { + mtx_lock(&sc->sc_mtx); + bf = STAILQ_FIRST(&sc->sc_rxbuf); + if (bf == NULL) { + mtx_unlock(&sc->sc_mtx); + return; + } + STAILQ_REMOVE_HEAD(&sc->sc_rxbuf, bf_list); + mtx_unlock(&sc->sc_mtx); + KASSERT(bf != NULL, ("wtap_buf is NULL\n")); + m = bf->m; + DWTAP_PRINTF("[%d] receiving m=%p\n", sc->id, bf->m); + if (m == NULL) { /* NB: shouldn't happen */ + if_printf(ifp, "%s: no mbuf!\n", __func__); + free(bf, M_WTAP_RXBUF); + return; + } + + ifp->if_ipackets++; +#if 0 + ieee80211_dump_pkt(ic, mtod(m, caddr_t), 0,0,0); +#endif + + /* + * Locate the node for sender, track state, and then + * pass the (referenced) node up to the 802.11 layer + * for its use. + */ + ni = ieee80211_find_rxnode_withkey(ic, + mtod(m, const struct ieee80211_frame_min *), + IEEE80211_KEYIX_NONE); + if (ni != NULL) { + /* + * Sending station is known, dispatch directly. + */ +#if 0 + ieee80211_radiotap_rx(ni->ni_vap, m); +#endif + type = ieee80211_input(ni, m, 1<<7, 10); + ieee80211_free_node(ni); + } else { +#if 0 + ieee80211_radiotap_rx_all(ic, m); +#endif + type = ieee80211_input_all(ic, m, 1<<7, 10); + } + + /* The mbufs are freed by the Net80211 stack */ + free(bf, M_WTAP_RXBUF); + } +} + +static void +wtap_newassoc(struct ieee80211_node *ni, int isnew) +{ + + DWTAP_PRINTF("%s\n", __func__); +} + +/* + * Callback from the 802.11 layer to update WME parameters. + */ +static int +wtap_wme_update(struct ieee80211com *ic) +{ + + DWTAP_PRINTF("%s\n", __func__); + return 0; +} + +static void +wtap_update_mcast(struct ifnet *ifp) +{ + + DWTAP_PRINTF("%s\n", __func__); +} + +static void +wtap_update_promisc(struct ifnet *ifp) +{ + + DWTAP_PRINTF("%s\n", __func__); +} + +static int +wtap_if_transmit(struct ifnet *ifp, struct mbuf *m) +{ + struct ieee80211_node *ni = + (struct ieee80211_node *) m->m_pkthdr.rcvif; + struct ieee80211vap *vap = ni->ni_vap; + struct wtap_vap *avp = WTAP_VAP(vap); + + if(ni == NULL){ + printf("m->m_pkthdr.rcvif is NULL we cant radiotap_tx\n"); + }else{ + if (ieee80211_radiotap_active_vap(vap)) + ieee80211_radiotap_tx(vap, m); + } + if (m->m_flags & M_TXCB) + ieee80211_process_callback(ni, m, 0); + ieee80211_free_node(ni); + return wtap_medium_enqueue(avp, m); +} + +static struct ieee80211_node * +wtap_node_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN]) +{ + struct ieee80211_node *ni; + + DWTAP_PRINTF("%s\n", __func__); + + ni = malloc(sizeof(struct ieee80211_node), M_80211_NODE, + M_NOWAIT|M_ZERO); + + ni->ni_txrate = 130; + return ni; +} + +static void +wtap_node_free(struct ieee80211_node *ni) +{ + struct ieee80211com *ic = ni->ni_ic; + struct wtap_softc *sc = ic->ic_ifp->if_softc; + + DWTAP_PRINTF("%s\n", __func__); + sc->sc_node_free(ni); +} + +int32_t +wtap_attach(struct wtap_softc *sc, const uint8_t *macaddr) +{ + struct ifnet *ifp; + struct ieee80211com *ic; + char wtap_name[] = {'w','T','a','p',sc->id, + '_','t','a','s','k','q','\0'}; + + DWTAP_PRINTF("%s\n", __func__); + + ifp = if_alloc(IFT_IEEE80211); + if (ifp == NULL) { + printf("can not if_alloc()\n"); + return -1; + } + ic = ifp->if_l2com; + if_initname(ifp, "wtap", sc->id); + + sc->sc_ifp = ifp; + sc->up = 0; + + STAILQ_INIT(&sc->sc_rxbuf); + sc->sc_tq = taskqueue_create(wtap_name, M_NOWAIT | M_ZERO, + taskqueue_thread_enqueue, &sc->sc_tq); + taskqueue_start_threads(&sc->sc_tq, 1, PI_SOFT, "%s taskQ", + ifp->if_xname); + TASK_INIT(&sc->sc_rxtask, 0, wtap_rx_proc, sc); + + ifp->if_softc = sc; + ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST; + ifp->if_start = wtap_start; + ifp->if_ioctl = wtap_ioctl; + ifp->if_init = wtap_init; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; + IFQ_SET_READY(&ifp->if_snd); + + ic->ic_ifp = ifp; + ic->ic_phytype = IEEE80211_T_DS; + ic->ic_opmode = IEEE80211_M_MBSS; + ic->ic_caps = IEEE80211_C_MBSS; + + ic->ic_max_keyix = 128; /* A value read from Atheros ATH_KEYMAX */ + + ic->ic_regdomain.regdomain = SKU_ETSI; + ic->ic_regdomain.country = CTRY_SWEDEN; + ic->ic_regdomain.location = 1; /* Indoors */ + ic->ic_regdomain.isocc[0] = 'S'; + ic->ic_regdomain.isocc[1] = 'E'; + /* + * Indicate we need the 802.11 header padded to a + * 32-bit boundary for 4-address and QoS frames. + */ + ic->ic_flags |= IEEE80211_F_DATAPAD; + ic->ic_nchans = 1; + ic->ic_channels[0].ic_flags = IEEE80211_CHAN_B; + ic->ic_channels[0].ic_freq = 2412; + + ieee80211_ifattach(ic, macaddr); + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 17:46:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 016BD1065676; Wed, 11 Jan 2012 17:46:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E44FB8FC18; Wed, 11 Jan 2012 17:46:08 +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 q0BHk8Fr069934; Wed, 11 Jan 2012 17:46:08 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0BHk8Of069932; Wed, 11 Jan 2012 17:46:08 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201111746.q0BHk8Of069932@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 11 Jan 2012 17:46: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: r229971 - head/sys/dev/uart X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 17:46:09 -0000 Author: kib Date: Wed Jan 11 17:46:08 2012 New Revision: 229971 URL: http://svn.freebsd.org/changeset/base/229971 Log: Add PCI Id for the AMT SOL UART on 5 series Intel chipsets. MFC after: 1 week Modified: head/sys/dev/uart/uart_bus_pci.c Modified: head/sys/dev/uart/uart_bus_pci.c ============================================================================== --- head/sys/dev/uart/uart_bus_pci.c Wed Jan 11 17:41:14 2012 (r229970) +++ head/sys/dev/uart/uart_bus_pci.c Wed Jan 11 17:46:08 2012 (r229971) @@ -112,6 +112,8 @@ static struct pci_id pci_ns8250_ids[] = 0x10, 16384000 }, { 0x151f, 0x0000, 0xffff, 0, "TOPIC Semiconductor TP560 56k modem", 0x10 }, { 0x8086, 0x1c3d, 0xffff, 0, "Intel AMT - KT Controller", 0x10 }, +{ 0x8086, 0x3b67, 0xffff, 0, "5 Series/3400 Series Chipset KT Controller", + 0x10 }, { 0x8086, 0x8811, 0xffff, 0, "Intel EG20T Serial Port 0", 0x10 }, { 0x8086, 0x8812, 0xffff, 0, "Intel EG20T Serial Port 1", 0x10 }, { 0x8086, 0x8813, 0xffff, 0, "Intel EG20T Serial Port 2", 0x10 }, From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 17:51:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29231106564A; Wed, 11 Jan 2012 17:51:57 +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 0C8808FC17; Wed, 11 Jan 2012 17:51: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 q0BHpugj070159; Wed, 11 Jan 2012 17:51:56 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0BHpuNF070157; Wed, 11 Jan 2012 17:51:56 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201111751.q0BHpuNF070157@svn.freebsd.org> From: Adrian Chadd Date: Wed, 11 Jan 2012 17:51: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: r229972 - in head/tools/tools/wtap: . wtap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 17:51:57 -0000 Author: adrian Date: Wed Jan 11 17:51:56 2012 New Revision: 229972 URL: http://svn.freebsd.org/changeset/base/229972 Log: Bring over a tool to create and destroy wtap instances. Submitted by: Monthadar Al Jaberi Added: head/tools/tools/wtap/ head/tools/tools/wtap/wtap/ head/tools/tools/wtap/wtap/Makefile (contents, props changed) head/tools/tools/wtap/wtap/wtap.c (contents, props changed) Added: head/tools/tools/wtap/wtap/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/wtap/wtap/Makefile Wed Jan 11 17:51:56 2012 (r229972) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +PROG= wtap +SRC= wtap.c +NO_MAN= 1 + +CFLAGS+= -I${.CURDIR}/../../../../sys/dev/wtap/ + +.include Added: head/tools/tools/wtap/wtap/wtap.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/wtap/wtap/wtap.c Wed Jan 11 17:51:56 2012 (r229972) @@ -0,0 +1,82 @@ +/*- + * Copyright (c) 2010-2011 Monthadar Al Jaberi, TerraNet AB + * 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, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + * + * $FreeBSD$ + */ +#include +#include +#include +#include + +#include "if_wtapioctl.h" + +static int dev = -1; + +static void create(int id) +{ + if(ioctl(dev, WTAPIOCTLCRT, &id) < 0){ + printf("error creating wtap with id=%d\n", id); + } +} + +static void delete(int id) +{ + if(ioctl(dev, WTAPIOCTLDEL, &id) < 0){ + printf("error deleting wtap with id=%d\n", id); + } +} + +int main( int argc, const char* argv[]) +{ + if(argc != 3){ + printf("usage: %s [c | d] wtap_id\n", argv[0]); + return -1; + } + int id = atoi(argv[2]); + if(!(id >= 0 && id < 64)){ + printf("wtap_id must be between 0 and 7\n"); + return -1; + } + dev = open("/dev/wtapctl", O_RDONLY); + if(dev < 0){ + printf("error opening wtapctl cdev\n"); + return -1; + } + switch((char)*argv[1]){ + case 'c': + create(id); + break; + case 'd': + delete(id); + break; + default: + printf("wtap ioctl: unkown command '%c'\n", *argv[1]); + return -1; + } + return 0; +} From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 18:09:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29ECC106566C; Wed, 11 Jan 2012 18:09:53 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-tul01m020-f182.google.com (mail-tul01m020-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id BAF648FC0C; Wed, 11 Jan 2012 18:09:52 +0000 (UTC) Received: by obbwd18 with SMTP id wd18so1874945obb.13 for ; Wed, 11 Jan 2012 10:09:52 -0800 (PST) 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=kuGHaH5ghvJ8gzoZ45/oHgcyIsra2v3dQXhTZsdYFzU=; b=dq3RzodE2llZ/teRI9RNJjXG2t63rn7dRFagv88cYPxYzHSUoWPQxEUT30FK5r4ASQ /ZhbqdfsODKeCe3ZXgtPDBoM+Iwubw2ocRBQR5LplVsHH2iL0Wpub9KphFELnOBUeUHz z+wLSgcSZV1vtZySdFiOVAgy+OqFcwI6sQXvA= MIME-Version: 1.0 Received: by 10.182.43.10 with SMTP id s10mr193580obl.43.1326305392046; Wed, 11 Jan 2012 10:09:52 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.182.171.67 with HTTP; Wed, 11 Jan 2012 10:09:52 -0800 (PST) In-Reply-To: <201201111751.q0BHpuNF070157@svn.freebsd.org> References: <201201111751.q0BHpuNF070157@svn.freebsd.org> Date: Wed, 11 Jan 2012 21:09:52 +0300 X-Google-Sender-Auth: 3FaMfc5aXYQLRMLXCmnCADN6ANw Message-ID: From: Sergey Kandaurov To: Adrian Chadd 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 Subject: Re: svn commit: r229972 - in head/tools/tools/wtap: . wtap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 18:09:53 -0000 On 11 January 2012 21:51, Adrian Chadd wrote: > Author: adrian > Date: Wed Jan 11 17:51:56 2012 > New Revision: 229972 > URL: http://svn.freebsd.org/changeset/base/229972 > > Log: > =A0Bring over a tool to create and destroy wtap instances. > > =A0Submitted by: Monthadar Al Jaberi > > Added: > =A0head/tools/tools/wtap/ > =A0head/tools/tools/wtap/wtap/ > =A0head/tools/tools/wtap/wtap/Makefile =A0 (contents, props changed) > =A0head/tools/tools/wtap/wtap/wtap.c =A0 (contents, props changed) > > Added: head/tools/tools/wtap/wtap/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- /dev/null =A0 00:00:00 1970 =A0 (empty, because file is newly added) > +++ head/tools/tools/wtap/wtap/Makefile Wed Jan 11 17:51:56 2012 =A0 =A0 = =A0 =A0(r229972) > @@ -0,0 +1,9 @@ > +# $FreeBSD$ > + > +PROG=3D =A0wtap > +SRC=3D =A0 wtap.c > +NO_MAN=3D =A0 =A0 =A0 =A01 > + > +CFLAGS+=3D =A0 =A0 =A0 -I${.CURDIR}/../../../../sys/dev/wtap/ [nitpicking] I assume this is to properly build with if_wtapioctl.h. Maybe better install this header to /usr/include/sys then? > + > +.include > > Added: head/tools/tools/wtap/wtap/wtap.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- /dev/null =A0 00:00:00 1970 =A0 (empty, because file is newly added) > +++ head/tools/tools/wtap/wtap/wtap.c =A0 Wed Jan 11 17:51:56 2012 =A0 = =A0 =A0 =A0(r229972) > @@ -0,0 +1,82 @@ > +/*- > + * Copyright (c) 2010-2011 Monthadar Al Jaberi, TerraNet AB > + * 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 > + * =A0 =A0notice, this list of conditions and the following disclaimer, > + * =A0 =A0without modification. > + * 2. Redistributions in binary form must reproduce at minimum a disclai= mer > + * =A0 =A0similar to the "NO WARRANTY" disclaimer below ("Disclaimer") a= nd any > + * =A0 =A0redistribution must be conditioned upon including a substantia= lly > + * =A0 =A0similar Disclaimer requirement for further binary redistributi= on. > + * > + * NO WARRANTY > + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS > + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT > + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILIT= Y > + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHAL= L > + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLAR= Y, > + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT = OF > + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSIN= ESS > + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER > + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHER= WISE) > + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED O= F > + * THE POSSIBILITY OF SUCH DAMAGES. > + * > + * $FreeBSD$ > + */ > +#include > +#include > +#include > +#include > + > +#include "if_wtapioctl.h" .. to use rather > + > +static int dev =3D -1; > + > +static void create(int id) > +{ > + =A0 =A0if(ioctl(dev, WTAPIOCTLCRT, &id) < 0){ > + =A0 =A0 =A0 printf("error creating wtap with id=3D%d\n", id); > + =A0 =A0} > +} > + > +static void delete(int id) > +{ > + =A0 =A0if(ioctl(dev, WTAPIOCTLDEL, &id) < 0){ > + =A0 =A0 =A0 printf("error deleting wtap with id=3D%d\n", id); > + =A0 =A0} > +} > + > +int main( int argc, const char* argv[]) > +{ > + =A0 =A0if(argc !=3D 3){ > + =A0 =A0 =A0printf("usage: %s [c | d] wtap_id\n", argv[0]); > + =A0 =A0 =A0return -1; > + =A0 =A0} > + =A0 =A0int id =3D atoi(argv[2]); > + =A0 =A0if(!(id >=3D 0 && id < 64)){ > + =A0 =A0 =A0 printf("wtap_id must be between 0 and 7\n"); > + =A0 =A0 =A0 return -1; > + =A0 =A0} This checks to be not larger than 64, but prints a warning to be not larger than 7. > + =A0 =A0dev =3D open("/dev/wtapctl", O_RDONLY); > + =A0 =A0if(dev < 0){ > + =A0 =A0 =A0printf("error opening wtapctl cdev\n"); > + =A0 =A0 =A0return -1; > + =A0 =A0} Perhaps, it makes sense to print errno. > + =A0 =A0switch((char)*argv[1]){ > + =A0 =A0 =A0case 'c': > + =A0 =A0 =A0 create(id); > + =A0 =A0 =A0 break; > + =A0 =A0 =A0case 'd': > + =A0 =A0 =A0 delete(id); > + =A0 =A0 =A0 break; > + =A0 =A0 =A0default: > + =A0 =A0 =A0 printf("wtap ioctl: unkown command '%c'\n", *argv[1]); a typo there > + =A0 =A0 =A0 return -1; > + =A0 =A0} > + =A0 =A0return 0; > +} The code could be better styled. Thanks for your work! --=20 wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 18:12:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D91AF106566B; Wed, 11 Jan 2012 18:12:53 +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 BD6788FC13; Wed, 11 Jan 2012 18:12:53 +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 q0BICr6r070906; Wed, 11 Jan 2012 18:12:53 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0BICrWZ070904; Wed, 11 Jan 2012 18:12:53 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201201111812.q0BICrWZ070904@svn.freebsd.org> From: Alexander Motin Date: Wed, 11 Jan 2012 18:12:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229973 - stable/9/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 18:12:54 -0000 Author: mav Date: Wed Jan 11 18:12:53 2012 New Revision: 229973 URL: http://svn.freebsd.org/changeset/base/229973 Log: MFC r228726, r228727: Cast some vendor-specific spell on VIA VT1708S codecs to: - make analog input loopback work; - get access to the mics boost controls. Sponsored by: iXsystems, Inc. Modified: stable/9/sys/dev/sound/pci/hda/hdac.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/9/sys/dev/sound/pci/hda/hdac.c Wed Jan 11 17:51:56 2012 (r229972) +++ stable/9/sys/dev/sound/pci/hda/hdac.c Wed Jan 11 18:12:53 2012 (r229973) @@ -4971,6 +4971,30 @@ hdac_vendor_patch_parse(struct hdac_devi if (w != NULL) w->connsenable[0] = 0; break; + case HDA_CODEC_VT1708S_0: + case HDA_CODEC_VT1708S_1: + case HDA_CODEC_VT1708S_2: + case HDA_CODEC_VT1708S_3: + case HDA_CODEC_VT1708S_4: + case HDA_CODEC_VT1708S_5: + case HDA_CODEC_VT1708S_6: + case HDA_CODEC_VT1708S_7: + /* + * These codecs have hidden mic boost controls. + */ + w = hdac_widget_get(devinfo, 26); + if (w != NULL) + w->param.inamp_cap = + (40 << HDA_PARAM_OUTPUT_AMP_CAP_STEPSIZE_SHIFT) | + (3 << HDA_PARAM_OUTPUT_AMP_CAP_NUMSTEPS_SHIFT) | + (0 << HDA_PARAM_OUTPUT_AMP_CAP_OFFSET_SHIFT); + w = hdac_widget_get(devinfo, 30); + if (w != NULL) + w->param.inamp_cap = + (40 << HDA_PARAM_OUTPUT_AMP_CAP_STEPSIZE_SHIFT) | + (3 << HDA_PARAM_OUTPUT_AMP_CAP_NUMSTEPS_SHIFT) | + (0 << HDA_PARAM_OUTPUT_AMP_CAP_OFFSET_SHIFT); + break; } } @@ -6458,7 +6482,7 @@ hdac_audio_commit(struct hdac_devinfo *d struct hdac_softc *sc = devinfo->codec->sc; struct hdac_widget *w; nid_t cad; - uint32_t gdata, gmask, gdir; + uint32_t id, gdata, gmask, gdir; int commitgpio, numgpio; int i; @@ -6467,6 +6491,24 @@ hdac_audio_commit(struct hdac_devinfo *d if (sc->pci_subvendor == APPLE_INTEL_MAC) hdac_command(sc, HDA_CMD_12BIT(cad, devinfo->nid, 0x7e7, 0), cad); + id = hdac_codec_id(devinfo->codec); + switch (id) { + case HDA_CODEC_VT1708S_0: + case HDA_CODEC_VT1708S_1: + case HDA_CODEC_VT1708S_2: + case HDA_CODEC_VT1708S_3: + case HDA_CODEC_VT1708S_4: + case HDA_CODEC_VT1708S_5: + case HDA_CODEC_VT1708S_6: + case HDA_CODEC_VT1708S_7: + /* Enable Mic Boost Volume controls. */ + hdac_command(sc, HDA_CMD_12BIT(cad, devinfo->nid, + 0xf98, 0x01), cad); + /* Don't bypass mixer. */ + hdac_command(sc, HDA_CMD_12BIT(cad, devinfo->nid, + 0xf88, 0xc0), cad); + break; + } /* Commit controls. */ hdac_audio_ctl_commit(devinfo); @@ -7768,10 +7810,6 @@ hdac_attach2(void *arg) ); hdac_audio_parse(devinfo); HDA_BOOTHVERBOSE( - device_printf(sc->dev, "Parsing Ctls...\n"); - ); - hdac_audio_ctl_parse(devinfo); - HDA_BOOTHVERBOSE( device_printf(sc->dev, "Parsing vendor patch...\n"); ); hdac_vendor_patch_parse(devinfo); @@ -7779,6 +7817,10 @@ hdac_attach2(void *arg) devinfo->function.audio.quirks &= ~quirks_off; HDA_BOOTHVERBOSE( + device_printf(sc->dev, "Parsing Ctls...\n"); + ); + hdac_audio_ctl_parse(devinfo); + HDA_BOOTHVERBOSE( device_printf(sc->dev, "Disabling nonaudio...\n"); ); hdac_audio_disable_nonaudio(devinfo); From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 18:14:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25493106564A; Wed, 11 Jan 2012 18:14:23 +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 12E738FC12; Wed, 11 Jan 2012 18:14: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 q0BIEMQS071070; Wed, 11 Jan 2012 18:14:22 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0BIEMC6071068; Wed, 11 Jan 2012 18:14:22 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201201111814.q0BIEMC6071068@svn.freebsd.org> From: Alexander Motin Date: Wed, 11 Jan 2012 18:14:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229974 - stable/8/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 18:14:23 -0000 Author: mav Date: Wed Jan 11 18:14:22 2012 New Revision: 229974 URL: http://svn.freebsd.org/changeset/base/229974 Log: MFC r228726, r228727: Cast some vendor-specific spell on VIA VT1708S codecs to: - make analog input loopback work; - get access to the mics boost controls. Sponsored by: iXsystems, Inc. Modified: stable/8/sys/dev/sound/pci/hda/hdac.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hdac.c Wed Jan 11 18:12:53 2012 (r229973) +++ stable/8/sys/dev/sound/pci/hda/hdac.c Wed Jan 11 18:14:22 2012 (r229974) @@ -4921,6 +4921,30 @@ hdac_vendor_patch_parse(struct hdac_devi if (w != NULL) w->connsenable[0] = 0; break; + case HDA_CODEC_VT1708S_0: + case HDA_CODEC_VT1708S_1: + case HDA_CODEC_VT1708S_2: + case HDA_CODEC_VT1708S_3: + case HDA_CODEC_VT1708S_4: + case HDA_CODEC_VT1708S_5: + case HDA_CODEC_VT1708S_6: + case HDA_CODEC_VT1708S_7: + /* + * These codecs have hidden mic boost controls. + */ + w = hdac_widget_get(devinfo, 26); + if (w != NULL) + w->param.inamp_cap = + (40 << HDA_PARAM_OUTPUT_AMP_CAP_STEPSIZE_SHIFT) | + (3 << HDA_PARAM_OUTPUT_AMP_CAP_NUMSTEPS_SHIFT) | + (0 << HDA_PARAM_OUTPUT_AMP_CAP_OFFSET_SHIFT); + w = hdac_widget_get(devinfo, 30); + if (w != NULL) + w->param.inamp_cap = + (40 << HDA_PARAM_OUTPUT_AMP_CAP_STEPSIZE_SHIFT) | + (3 << HDA_PARAM_OUTPUT_AMP_CAP_NUMSTEPS_SHIFT) | + (0 << HDA_PARAM_OUTPUT_AMP_CAP_OFFSET_SHIFT); + break; } } @@ -6408,7 +6432,7 @@ hdac_audio_commit(struct hdac_devinfo *d struct hdac_softc *sc = devinfo->codec->sc; struct hdac_widget *w; nid_t cad; - uint32_t gdata, gmask, gdir; + uint32_t id, gdata, gmask, gdir; int commitgpio, numgpio; int i; @@ -6417,6 +6441,24 @@ hdac_audio_commit(struct hdac_devinfo *d if (sc->pci_subvendor == APPLE_INTEL_MAC) hdac_command(sc, HDA_CMD_12BIT(cad, devinfo->nid, 0x7e7, 0), cad); + id = hdac_codec_id(devinfo->codec); + switch (id) { + case HDA_CODEC_VT1708S_0: + case HDA_CODEC_VT1708S_1: + case HDA_CODEC_VT1708S_2: + case HDA_CODEC_VT1708S_3: + case HDA_CODEC_VT1708S_4: + case HDA_CODEC_VT1708S_5: + case HDA_CODEC_VT1708S_6: + case HDA_CODEC_VT1708S_7: + /* Enable Mic Boost Volume controls. */ + hdac_command(sc, HDA_CMD_12BIT(cad, devinfo->nid, + 0xf98, 0x01), cad); + /* Don't bypass mixer. */ + hdac_command(sc, HDA_CMD_12BIT(cad, devinfo->nid, + 0xf88, 0xc0), cad); + break; + } /* Commit controls. */ hdac_audio_ctl_commit(devinfo); @@ -7718,10 +7760,6 @@ hdac_attach2(void *arg) ); hdac_audio_parse(devinfo); HDA_BOOTHVERBOSE( - device_printf(sc->dev, "Parsing Ctls...\n"); - ); - hdac_audio_ctl_parse(devinfo); - HDA_BOOTHVERBOSE( device_printf(sc->dev, "Parsing vendor patch...\n"); ); hdac_vendor_patch_parse(devinfo); @@ -7729,6 +7767,10 @@ hdac_attach2(void *arg) devinfo->function.audio.quirks &= ~quirks_off; HDA_BOOTHVERBOSE( + device_printf(sc->dev, "Parsing Ctls...\n"); + ); + hdac_audio_ctl_parse(devinfo); + HDA_BOOTHVERBOSE( device_printf(sc->dev, "Disabling nonaudio...\n"); ); hdac_audio_disable_nonaudio(devinfo); From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 18:18:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 679BB106566B; Wed, 11 Jan 2012 18:18:38 +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 51BB68FC1B; Wed, 11 Jan 2012 18:18: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 q0BIIcLm071250; Wed, 11 Jan 2012 18:18:38 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0BIIc29071241; Wed, 11 Jan 2012 18:18:38 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201201111818.q0BIIc29071241@svn.freebsd.org> From: Xin LI Date: Wed, 11 Jan 2012 18:18:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229975 - in stable: 8/share/man/man4 8/sys/amd64/conf 8/sys/conf 8/sys/dev/hpt27xx 8/sys/i386/conf 8/sys/modules 8/sys/modules/hpt27xx 9/share/man/man4 9/sys/amd64/conf 9/sys/conf 9/sy... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 18:18:38 -0000 Author: delphij Date: Wed Jan 11 18:18:37 2012 New Revision: 229975 URL: http://svn.freebsd.org/changeset/base/229975 Log: MFC r228940: Import the first release of HighPoint RocketRAID 27xx SAS 6Gb/s HBA card driver. This driver works for FreeBSD/i386 and FreeBSD/amd64 platforms. Many thanks to HighPoint for providing this driver. Added: stable/9/share/man/man4/hpt27xx.4 - copied unchanged from r228940, head/share/man/man4/hpt27xx.4 stable/9/sys/dev/hpt27xx/ - copied from r228940, head/sys/dev/hpt27xx/ stable/9/sys/modules/hpt27xx/ - copied from r228940, head/sys/modules/hpt27xx/ Modified: stable/9/share/man/man4/Makefile stable/9/sys/amd64/conf/NOTES stable/9/sys/conf/files.amd64 stable/9/sys/conf/files.i386 stable/9/sys/i386/conf/NOTES stable/9/sys/modules/Makefile Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Changes in other areas also in this revision: Added: stable/8/share/man/man4/hpt27xx.4 - copied unchanged from r228940, head/share/man/man4/hpt27xx.4 stable/8/sys/dev/hpt27xx/ - copied from r228940, head/sys/dev/hpt27xx/ stable/8/sys/modules/hpt27xx/ - copied from r228940, head/sys/modules/hpt27xx/ Modified: stable/8/share/man/man4/Makefile stable/8/sys/amd64/conf/NOTES stable/8/sys/conf/files.amd64 stable/8/sys/conf/files.i386 stable/8/sys/i386/conf/NOTES stable/8/sys/modules/Makefile Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) Modified: stable/9/share/man/man4/Makefile ============================================================================== --- stable/9/share/man/man4/Makefile Wed Jan 11 18:14:22 2012 (r229974) +++ stable/9/share/man/man4/Makefile Wed Jan 11 18:18:37 2012 (r229975) @@ -150,6 +150,7 @@ MAN= aac.4 \ hifn.4 \ hme.4 \ hpet.4 \ + ${_hpt27xx.4} \ ${_hptiop.4} \ ${_hptmv.4} \ ${_hptrr.4} \ @@ -686,6 +687,7 @@ _atp.4= atp.4 _coretemp.4= coretemp.4 _cpuctl.4= cpuctl.4 _dpms.4= dpms.4 +_hpt27xx.4= hpt27xx.4 _hptiop.4= hptiop.4 _hptmv.4= hptmv.4 _hptrr.4= hptrr.4 Copied: stable/9/share/man/man4/hpt27xx.4 (from r228940, head/share/man/man4/hpt27xx.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/share/man/man4/hpt27xx.4 Wed Jan 11 18:18:37 2012 (r229975, copy of r228940, head/share/man/man4/hpt27xx.4) @@ -0,0 +1,101 @@ +.\" +.\" Copyright (c) 2011 iXsystems, Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``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 DEVELOPERS 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 December 28, 2011 +.Dt HPT27XX 4 +.Os +.Sh NAME +.Nm hpt27xx +.Nd "HighPoint RocketRAID 27xx SAS 6Gb/s HBA card driver" +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device hpt27xx" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +hpt27xx_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for HighPoint's RocketRAID 27xx based RAID controller. +.Pp +These devices support SAS disk drives +and provide RAID0 (striping), RAID1 (mirroring), and RAID5 functionality. +.Sh HARDWARE +The +.Nm +driver supports the following SAS +controllers: +.Pp +.Bl -bullet -compact +.It +HighPoint's RocketRAID 271x series +.It +HighPoint's RocketRAID 272x series +.It +HighPoint's RocketRAID 274x series +.It +HighPoint's RocketRAID 276x series +.It +HighPoint's RocketRAID 278x series +.El +.Sh NOTES +The +.Nm +driver only works on the i386 and amd64 platforms as it requires a binary +blob object from the manufacturer which they only supply for these platforms. +The +.Nm +driver does +.Em not +work on i386 with +.Xr pae 4 +enabled. +.Sh SEE ALSO +.Xr kld 4 , +.Xr kldload 8 , +.Xr loader 8 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 10.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +device driver was written by +.An HighPoint Technologies, Inc. . +This manual page was written by +.An Xin LI Aq delphij@FreeBSD.org +for iXsystems, Inc. Modified: stable/9/sys/amd64/conf/NOTES ============================================================================== --- stable/9/sys/amd64/conf/NOTES Wed Jan 11 18:14:22 2012 (r229974) +++ stable/9/sys/amd64/conf/NOTES Wed Jan 11 18:18:37 2012 (r229975) @@ -388,6 +388,10 @@ device aac device aacp # SCSI Passthrough interface (optional, CAM required) # +# Highpoint RocketRAID 27xx. +device hpt27xx + +# # Highpoint RocketRAID 182x. device hptmv Modified: stable/9/sys/conf/files.amd64 ============================================================================== --- stable/9/sys/conf/files.amd64 Wed Jan 11 18:14:22 2012 (r229974) +++ stable/9/sys/conf/files.amd64 Wed Jan 11 18:18:37 2012 (r229975) @@ -58,6 +58,10 @@ os+%DIKED-nve.h optional nve pci \ no-implicit-rule no-obj before-depend \ clean "os+%DIKED-nve.h" # +hpt27xx_lib.o optional hpt27xx \ + dependency "$S/dev/hpt27xx/amd64-elf.hpt27xx_lib.o.uu" \ + compile-with "uudecode < $S/dev/hpt27xx/amd64-elf.hpt27xx_lib.o.uu" \ + no-implicit-rule hptmvraid.o optional hptmv \ dependency "$S/dev/hptmv/amd64-elf.raid.o.uu" \ compile-with "uudecode < $S/dev/hptmv/amd64-elf.raid.o.uu" \ @@ -187,6 +191,9 @@ dev/fdc/fdc.c optional fdc dev/fdc/fdc_acpi.c optional fdc dev/fdc/fdc_isa.c optional fdc isa dev/fdc/fdc_pccard.c optional fdc pccard +dev/hpt27xx/os_bsd.c optional hpt27xx +dev/hpt27xx/osm_bsd.c optional hpt27xx +dev/hpt27xx/hpt27xx_config.c optional hpt27xx dev/hptmv/entry.c optional hptmv dev/hptmv/mv.c optional hptmv dev/hptmv/gui_lib.c optional hptmv Modified: stable/9/sys/conf/files.i386 ============================================================================== --- stable/9/sys/conf/files.i386 Wed Jan 11 18:14:22 2012 (r229974) +++ stable/9/sys/conf/files.i386 Wed Jan 11 18:18:37 2012 (r229975) @@ -57,6 +57,10 @@ os+%DIKED-nve.h optional nve pci \ no-implicit-rule no-obj before-depend \ clean "os+%DIKED-nve.h" # +hpt27xx_lib.o optional hpt27xx \ + dependency "$S/dev/hpt27xx/i386-elf.hpt27xx_lib.o.uu" \ + compile-with "uudecode < $S/dev/hpt27xx/i386-elf.hpt27xx_lib.o.uu" \ + no-implicit-rule hptmvraid.o optional hptmv \ dependency "$S/dev/hptmv/i386-elf.raid.o.uu" \ compile-with "uudecode < $S/dev/hptmv/i386-elf.raid.o.uu" \ @@ -175,6 +179,9 @@ dev/fe/if_fe_isa.c optional fe isa dev/glxiic/glxiic.c optional glxiic dev/glxsb/glxsb.c optional glxsb dev/glxsb/glxsb_hash.c optional glxsb +dev/hpt27xx/os_bsd.c optional hpt27xx +dev/hpt27xx/osm_bsd.c optional hpt27xx +dev/hpt27xx/hpt27xx_config.c optional hpt27xx dev/hptmv/entry.c optional hptmv dev/hptmv/mv.c optional hptmv dev/hptmv/gui_lib.c optional hptmv Modified: stable/9/sys/i386/conf/NOTES ============================================================================== --- stable/9/sys/i386/conf/NOTES Wed Jan 11 18:14:22 2012 (r229974) +++ stable/9/sys/i386/conf/NOTES Wed Jan 11 18:18:37 2012 (r229975) @@ -706,6 +706,10 @@ device aacp # SCSI Passthrough interfac device asr # +# Highpoint RocketRAID 27xx. +device hpt27xx + +# # Highpoint RocketRAID 182x. device hptmv Modified: stable/9/sys/modules/Makefile ============================================================================== --- stable/9/sys/modules/Makefile Wed Jan 11 18:14:22 2012 (r229974) +++ stable/9/sys/modules/Makefile Wed Jan 11 18:18:37 2012 (r229975) @@ -108,6 +108,7 @@ SUBDIR= ${_3dfx} \ hatm \ hifn \ hme \ + ${_hpt27xx} \ ${_hptiop} \ ${_hptmv} \ ${_hptrr} \ @@ -508,6 +509,7 @@ _coretemp= coretemp _ctau= ctau _dpt= dpt _ex= ex +_hpt27xx= hpt27xx _hptiop= hptiop _hptmv= hptmv _hptrr= hptrr @@ -582,6 +584,7 @@ _et= et _em= em _exca= exca _ext2fs= ext2fs +_hpt27xx= hpt27xx _hptiop= hptiop _hptmv= hptmv _hptrr= hptrr From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 18:18:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99BD7106566C; Wed, 11 Jan 2012 18:18:38 +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 83C7F8FC16; Wed, 11 Jan 2012 18:18: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 q0BIIcAc071262; Wed, 11 Jan 2012 18:18:38 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0BIIcoL071254; Wed, 11 Jan 2012 18:18:38 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201201111818.q0BIIcoL071254@svn.freebsd.org> From: Xin LI Date: Wed, 11 Jan 2012 18:18:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229975 - in stable: 8/share/man/man4 8/sys/amd64/conf 8/sys/conf 8/sys/dev/hpt27xx 8/sys/i386/conf 8/sys/modules 8/sys/modules/hpt27xx 9/share/man/man4 9/sys/amd64/conf 9/sys/conf 9/sy... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 18:18:38 -0000 Author: delphij Date: Wed Jan 11 18:18:37 2012 New Revision: 229975 URL: http://svn.freebsd.org/changeset/base/229975 Log: MFC r228940: Import the first release of HighPoint RocketRAID 27xx SAS 6Gb/s HBA card driver. This driver works for FreeBSD/i386 and FreeBSD/amd64 platforms. Many thanks to HighPoint for providing this driver. Added: stable/8/share/man/man4/hpt27xx.4 - copied unchanged from r228940, head/share/man/man4/hpt27xx.4 stable/8/sys/dev/hpt27xx/ - copied from r228940, head/sys/dev/hpt27xx/ stable/8/sys/modules/hpt27xx/ - copied from r228940, head/sys/modules/hpt27xx/ Modified: stable/8/share/man/man4/Makefile stable/8/sys/amd64/conf/NOTES stable/8/sys/conf/files.amd64 stable/8/sys/conf/files.i386 stable/8/sys/i386/conf/NOTES stable/8/sys/modules/Makefile Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) Changes in other areas also in this revision: Added: stable/9/share/man/man4/hpt27xx.4 - copied unchanged from r228940, head/share/man/man4/hpt27xx.4 stable/9/sys/dev/hpt27xx/ - copied from r228940, head/sys/dev/hpt27xx/ stable/9/sys/modules/hpt27xx/ - copied from r228940, head/sys/modules/hpt27xx/ Modified: stable/9/share/man/man4/Makefile stable/9/sys/amd64/conf/NOTES stable/9/sys/conf/files.amd64 stable/9/sys/conf/files.i386 stable/9/sys/i386/conf/NOTES stable/9/sys/modules/Makefile Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/8/share/man/man4/Makefile ============================================================================== --- stable/8/share/man/man4/Makefile Wed Jan 11 18:14:22 2012 (r229974) +++ stable/8/share/man/man4/Makefile Wed Jan 11 18:18:37 2012 (r229975) @@ -139,6 +139,7 @@ MAN= aac.4 \ hfa.4 \ hifn.4 \ hme.4 \ + ${_hpt27xx.4} \ ${_hptiop.4} \ ${_hptmv.4} \ ${_hptrr.4} \ @@ -663,6 +664,7 @@ _asmc.4= asmc.4 _coretemp.4= coretemp.4 _cpuctl.4= cpuctl.4 _dpms.4= dpms.4 +_hpt27xx.4= hpt27xx.4 _hptiop.4= hptiop.4 _hptmv.4= hptmv.4 _hptrr.4= hptrr.4 Copied: stable/8/share/man/man4/hpt27xx.4 (from r228940, head/share/man/man4/hpt27xx.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man4/hpt27xx.4 Wed Jan 11 18:18:37 2012 (r229975, copy of r228940, head/share/man/man4/hpt27xx.4) @@ -0,0 +1,101 @@ +.\" +.\" Copyright (c) 2011 iXsystems, Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``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 DEVELOPERS 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 December 28, 2011 +.Dt HPT27XX 4 +.Os +.Sh NAME +.Nm hpt27xx +.Nd "HighPoint RocketRAID 27xx SAS 6Gb/s HBA card driver" +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device hpt27xx" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +hpt27xx_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for HighPoint's RocketRAID 27xx based RAID controller. +.Pp +These devices support SAS disk drives +and provide RAID0 (striping), RAID1 (mirroring), and RAID5 functionality. +.Sh HARDWARE +The +.Nm +driver supports the following SAS +controllers: +.Pp +.Bl -bullet -compact +.It +HighPoint's RocketRAID 271x series +.It +HighPoint's RocketRAID 272x series +.It +HighPoint's RocketRAID 274x series +.It +HighPoint's RocketRAID 276x series +.It +HighPoint's RocketRAID 278x series +.El +.Sh NOTES +The +.Nm +driver only works on the i386 and amd64 platforms as it requires a binary +blob object from the manufacturer which they only supply for these platforms. +The +.Nm +driver does +.Em not +work on i386 with +.Xr pae 4 +enabled. +.Sh SEE ALSO +.Xr kld 4 , +.Xr kldload 8 , +.Xr loader 8 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 10.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +device driver was written by +.An HighPoint Technologies, Inc. . +This manual page was written by +.An Xin LI Aq delphij@FreeBSD.org +for iXsystems, Inc. Modified: stable/8/sys/amd64/conf/NOTES ============================================================================== --- stable/8/sys/amd64/conf/NOTES Wed Jan 11 18:14:22 2012 (r229974) +++ stable/8/sys/amd64/conf/NOTES Wed Jan 11 18:18:37 2012 (r229975) @@ -389,6 +389,10 @@ device aac device aacp # SCSI Passthrough interface (optional, CAM required) # +# Highpoint RocketRAID 27xx. +device hpt27xx + +# # Highpoint RocketRAID 182x. device hptmv Modified: stable/8/sys/conf/files.amd64 ============================================================================== --- stable/8/sys/conf/files.amd64 Wed Jan 11 18:14:22 2012 (r229974) +++ stable/8/sys/conf/files.amd64 Wed Jan 11 18:18:37 2012 (r229975) @@ -58,6 +58,10 @@ os+%DIKED-nve.h optional nve pci \ no-implicit-rule no-obj before-depend \ clean "os+%DIKED-nve.h" # +hpt27xx_lib.o optional hpt27xx \ + dependency "$S/dev/hpt27xx/amd64-elf.hpt27xx_lib.o.uu" \ + compile-with "uudecode < $S/dev/hpt27xx/amd64-elf.hpt27xx_lib.o.uu" \ + no-implicit-rule hptmvraid.o optional hptmv \ dependency "$S/dev/hptmv/amd64-elf.raid.o.uu" \ compile-with "uudecode < $S/dev/hptmv/amd64-elf.raid.o.uu" \ @@ -194,6 +198,9 @@ dev/fdc/fdc.c optional fdc dev/fdc/fdc_acpi.c optional fdc dev/fdc/fdc_isa.c optional fdc isa dev/fdc/fdc_pccard.c optional fdc pccard +dev/hpt27xx/os_bsd.c optional hpt27xx +dev/hpt27xx/osm_bsd.c optional hpt27xx +dev/hpt27xx/hpt27xx_config.c optional hpt27xx dev/hptmv/entry.c optional hptmv dev/hptmv/mv.c optional hptmv dev/hptmv/gui_lib.c optional hptmv Modified: stable/8/sys/conf/files.i386 ============================================================================== --- stable/8/sys/conf/files.i386 Wed Jan 11 18:14:22 2012 (r229974) +++ stable/8/sys/conf/files.i386 Wed Jan 11 18:18:37 2012 (r229975) @@ -57,6 +57,10 @@ os+%DIKED-nve.h optional nve pci \ no-implicit-rule no-obj before-depend \ clean "os+%DIKED-nve.h" # +hpt27xx_lib.o optional hpt27xx \ + dependency "$S/dev/hpt27xx/i386-elf.hpt27xx_lib.o.uu" \ + compile-with "uudecode < $S/dev/hpt27xx/i386-elf.hpt27xx_lib.o.uu" \ + no-implicit-rule hptmvraid.o optional hptmv \ dependency "$S/dev/hptmv/i386-elf.raid.o.uu" \ compile-with "uudecode < $S/dev/hptmv/i386-elf.raid.o.uu" \ @@ -173,6 +177,9 @@ dev/fdc/fdc_pccard.c optional fdc pccar dev/fe/if_fe_isa.c optional fe isa dev/glxsb/glxsb.c optional glxsb dev/glxsb/glxsb_hash.c optional glxsb +dev/hpt27xx/os_bsd.c optional hpt27xx +dev/hpt27xx/osm_bsd.c optional hpt27xx +dev/hpt27xx/hpt27xx_config.c optional hpt27xx dev/hptmv/entry.c optional hptmv dev/hptmv/mv.c optional hptmv dev/hptmv/gui_lib.c optional hptmv Modified: stable/8/sys/i386/conf/NOTES ============================================================================== --- stable/8/sys/i386/conf/NOTES Wed Jan 11 18:14:22 2012 (r229974) +++ stable/8/sys/i386/conf/NOTES Wed Jan 11 18:18:37 2012 (r229975) @@ -725,6 +725,10 @@ device aacp # SCSI Passthrough interfac device asr # +# Highpoint RocketRAID 27xx. +device hpt27xx + +# # Highpoint RocketRAID 182x. device hptmv Modified: stable/8/sys/modules/Makefile ============================================================================== --- stable/8/sys/modules/Makefile Wed Jan 11 18:14:22 2012 (r229974) +++ stable/8/sys/modules/Makefile Wed Jan 11 18:18:37 2012 (r229975) @@ -105,6 +105,7 @@ SUBDIR= ${_3dfx} \ hatm \ hifn \ hme \ + ${_hpt27xx} \ ${_hptiop} \ ${_hptmv} \ ${_hptrr} \ @@ -482,6 +483,7 @@ _coretemp= coretemp _ctau= ctau _dpt= dpt _ex= ex +_hpt27xx= hpt27xx _hptiop= hptiop _hptmv= hptmv _hptrr= hptrr @@ -554,6 +556,7 @@ _et= et _em= em _exca= exca _ext2fs= ext2fs +_hpt27xx= hpt27xx _hptiop= hptiop _hptmv= hptmv _hptrr= hptrr From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 18:34:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE9F6106566B; Wed, 11 Jan 2012 18:34:57 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C32738FC0A; Wed, 11 Jan 2012 18:34: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 q0BIYvew071838; Wed, 11 Jan 2012 18:34:57 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0BIYvkL071836; Wed, 11 Jan 2012 18:34:57 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201111834.q0BIYvkL071836@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 11 Jan 2012 18:34: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: r229976 - head/sys/contrib/pf/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 18:34:58 -0000 Author: glebius Date: Wed Jan 11 18:34:57 2012 New Revision: 229976 URL: http://svn.freebsd.org/changeset/base/229976 Log: Redo r226660: - Define schednetisr() to swi_sched. - In the swi handler check if there is some data prepared, and if true, then call pfsync_sendout(), however tell it not to schedule swi again. - Since now we don't obtain the pfsync lock in the swi handler, don't use ifqueue mutex to synchronize queue access. Modified: head/sys/contrib/pf/net/if_pfsync.c Modified: head/sys/contrib/pf/net/if_pfsync.c ============================================================================== --- head/sys/contrib/pf/net/if_pfsync.c Wed Jan 11 18:18:37 2012 (r229975) +++ head/sys/contrib/pf/net/if_pfsync.c Wed Jan 11 18:34:57 2012 (r229976) @@ -309,6 +309,9 @@ static int pfsync_multicast_setup(struct static void pfsync_multicast_cleanup(struct pfsync_softc *); static int pfsync_init(void); static void pfsync_uninit(void); +static void pfsync_sendout1(int); + +#define schednetisr(NETISR_PFSYNC) swi_sched(V_pfsync_swi_cookie, 0) SYSCTL_NODE(_net, OID_AUTO, pfsync, CTLFLAG_RW, 0, "PFSYNC"); SYSCTL_VNET_STRUCT(_net_pfsync, OID_AUTO, stats, CTLFLAG_RW, @@ -823,11 +826,7 @@ pfsync_state_import(struct pfsync_state CLR(st->state_flags, PFSTATE_NOSYNC); if (ISSET(st->state_flags, PFSTATE_ACK)) { pfsync_q_ins(st, PFSYNC_S_IACK); -#ifdef __FreeBSD__ - pfsync_sendout(); -#else schednetisr(NETISR_PFSYNC); -#endif } } CLR(st->state_flags, PFSTATE_ACK); @@ -1283,11 +1282,7 @@ pfsync_in_upd(struct pfsync_pkt *pkt, st V_pfsyncstats.pfsyncs_stale++; pfsync_update_state(st); -#ifdef __FreeBSD__ - pfsync_sendout(); -#else schednetisr(NETISR_PFSYNC); -#endif continue; } pfsync_alloc_scrub_memory(&sp->dst, &st->dst); @@ -1393,11 +1388,7 @@ pfsync_in_upd_c(struct pfsync_pkt *pkt, V_pfsyncstats.pfsyncs_stale++; pfsync_update_state(st); -#ifdef __FreeBSD__ - pfsync_sendout(); -#else schednetisr(NETISR_PFSYNC); -#endif continue; } pfsync_alloc_scrub_memory(&up->dst, &st->dst); @@ -2098,12 +2089,20 @@ pfsync_drop(struct pfsync_softc *sc) sc->sc_len = PFSYNC_MINPKT; } -void -pfsync_sendout(void) -{ #ifdef __FreeBSD__ +void pfsync_sendout() +{ + pfsync_sendout1(1); +} + +static void +pfsync_sendout1(int schedswi) +{ struct pfsync_softc *sc = V_pfsyncif; #else +void +pfsync_sendout(void) +{ struct pfsync_softc *sc = pfsyncif; #endif #if NBPFILTER > 0 @@ -2124,7 +2123,6 @@ pfsync_sendout(void) #endif #ifdef __FreeBSD__ size_t pktlen; - int dummy_error; #endif int offset; int q, count = 0; @@ -2329,8 +2327,14 @@ pfsync_sendout(void) sc->sc_ifp->if_obytes += m->m_pkthdr.len; sc->sc_len = PFSYNC_MINPKT; - IFQ_ENQUEUE(&sc->sc_ifp->if_snd, m, dummy_error); - swi_sched(V_pfsync_swi_cookie, 0); + if (!_IF_QFULL(&sc->sc_ifp->if_snd)) + _IF_ENQUEUE(&sc->sc_ifp->if_snd, m); + else { + m_freem(m); + sc->sc_ifp->if_snd.ifq_drops++; + } + if (schedswi) + swi_sched(V_pfsync_swi_cookie, 0); #else sc->sc_if.if_opackets++; sc->sc_if.if_obytes += m->m_pkthdr.len; @@ -2389,11 +2393,7 @@ pfsync_insert_state(struct pf_state *st) pfsync_q_ins(st, PFSYNC_S_INS); if (ISSET(st->state_flags, PFSTATE_ACK)) -#ifdef __FreeBSD__ - pfsync_sendout(); -#else schednetisr(NETISR_PFSYNC); -#endif else st->sync_updates = 0; } @@ -2592,11 +2592,7 @@ pfsync_update_state(struct pf_state *st) if (sync || (time_uptime - st->pfsync_time) < 2) { pfsync_upds++; -#ifdef __FreeBSD__ - pfsync_sendout(); -#else schednetisr(NETISR_PFSYNC); -#endif } } @@ -2647,11 +2643,7 @@ pfsync_request_update(u_int32_t creatori TAILQ_INSERT_TAIL(&sc->sc_upd_req_list, item, ur_entry); sc->sc_len += nlen; -#ifdef __FreeBSD__ - pfsync_sendout(); -#else schednetisr(NETISR_PFSYNC); -#endif } void @@ -2680,11 +2672,7 @@ pfsync_update_state_req(struct pf_state pfsync_q_del(st); case PFSYNC_S_NONE: pfsync_q_ins(st, PFSYNC_S_UPD); -#ifdef __FreeBSD__ - pfsync_sendout(); -#else schednetisr(NETISR_PFSYNC); -#endif return; case PFSYNC_S_INS: @@ -3255,7 +3243,11 @@ pfsyncintr(void *arg) CURVNET_SET(sc->sc_ifp->if_vnet); pfsync_ints++; - IF_DEQUEUE_ALL(&sc->sc_ifp->if_snd, m); + PF_LOCK(); + if (sc->sc_len > PFSYNC_MINPKT) + pfsync_sendout1(0); + _IF_DEQUEUE_ALL(&sc->sc_ifp->if_snd, m); + PF_UNLOCK(); for (; m != NULL; m = n) { From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 18:38:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB31B106564A; Wed, 11 Jan 2012 18:38:52 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A90918FC15; Wed, 11 Jan 2012 18:38:52 +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 q0BIcq5u071988; Wed, 11 Jan 2012 18:38:52 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0BIcqmq071985; Wed, 11 Jan 2012 18:38:52 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201201111838.q0BIcqmq071985@svn.freebsd.org> From: Christian Brueffer Date: Wed, 11 Jan 2012 18:38:52 +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: r229977 - in head/release/doc: en_US.ISO8859-1/hardware share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 18:38:52 -0000 Author: brueffer Date: Wed Jan 11 18:38:52 2012 New Revision: 229977 URL: http://svn.freebsd.org/changeset/base/229977 Log: Add hpt27xx to the hardware notes, While here, add the 2012 copyright. MFC after: 1 week Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml head/release/doc/share/misc/dev.archlist.txt Modified: head/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.sgml Wed Jan 11 18:34:57 2012 (r229976) +++ head/release/doc/en_US.ISO8859-1/hardware/article.sgml Wed Jan 11 18:38:52 2012 (r229977) @@ -32,6 +32,7 @@ 2009 2010 2011 + 2012 The &os; Documentation Project @@ -773,6 +774,8 @@ &hwlist.esp; + &hwlist.hpt27xx; + &hwlist.hptiop; &hwlist.hptmv; Modified: head/release/doc/share/misc/dev.archlist.txt ============================================================================== --- head/release/doc/share/misc/dev.archlist.txt Wed Jan 11 18:34:57 2012 (r229976) +++ head/release/doc/share/misc/dev.archlist.txt Wed Jan 11 18:38:52 2012 (r229977) @@ -72,6 +72,7 @@ ex i386,amd64 fe i386,pc98,amd64 fwohci i386,sparc64,ia64,amd64,powerpc hifn i386,pc98,amd64 +hpt27xx i386,amd64 hptiop i386,amd64 hptmv i386,amd64 hptrr i386,amd64 From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 18:45:45 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8028F1065672; Wed, 11 Jan 2012 18:45:45 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id F3EB48FC19; Wed, 11 Jan 2012 18:45:44 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q0BIjhEm097076; Wed, 11 Jan 2012 22:45:43 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q0BIjhOh097075; Wed, 11 Jan 2012 22:45:43 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 11 Jan 2012 22:45:43 +0400 From: Gleb Smirnoff To: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Message-ID: <20120111184543.GJ74141@FreeBSD.org> References: <201201111834.q0BIYvkL071836@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201201111834.q0BIYvkL071836@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: Re: svn commit: r229976 - head/sys/contrib/pf/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 18:45:45 -0000 On Wed, Jan 11, 2012 at 06:34:57PM +0000, Gleb Smirnoff wrote: T> Author: glebius T> Date: Wed Jan 11 18:34:57 2012 T> New Revision: 229976 T> URL: http://svn.freebsd.org/changeset/base/229976 T> T> Log: T> Redo r226660: T> - Define schednetisr() to swi_sched. T> - In the swi handler check if there is some data prepared, T> and if true, then call pfsync_sendout(), however tell it T> not to schedule swi again. T> - Since now we don't obtain the pfsync lock in the swi handler, ^^^ T> don't use ifqueue mutex to synchronize queue access. Sorry, that should have been "now we do obtain" :( -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 19:12:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 120B0106566C; Wed, 11 Jan 2012 19:12:30 +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 F407A8FC16; Wed, 11 Jan 2012 19:12: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 q0BJCTie073065; Wed, 11 Jan 2012 19:12:29 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0BJCTgr073063; Wed, 11 Jan 2012 19:12:29 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201201111912.q0BJCTgr073063@svn.freebsd.org> From: Kirk McKusick Date: Wed, 11 Jan 2012 19:12:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229978 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 19:12:30 -0000 Author: mckusick Date: Wed Jan 11 19:12:29 2012 New Revision: 229978 URL: http://svn.freebsd.org/changeset/base/229978 Log: MFC: 226265 When unmounting a filesystem always wait for the vfs_busy lock to clear so that if no vnodes in the filesystem are actively in use the unmount will succeed rather than failing with EBUSY. Reported by: Garrett Cooper Reviewed by: Attilio Rao and Kostik Belousov Tested by: Garrett Cooper PR: kern/161016 Modified: stable/8/sys/kern/vfs_mount.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/vfs_mount.c ============================================================================== --- stable/8/sys/kern/vfs_mount.c Wed Jan 11 18:38:52 2012 (r229977) +++ stable/8/sys/kern/vfs_mount.c Wed Jan 11 19:12:29 2012 (r229978) @@ -1260,18 +1260,6 @@ dounmount(mp, flags, td) mp->mnt_kern_flag |= MNTK_UNMOUNTF; error = 0; if (mp->mnt_lockref) { - if ((flags & MNT_FORCE) == 0) { - mp->mnt_kern_flag &= ~(MNTK_UNMOUNT | MNTK_NOINSMNTQ | - MNTK_UNMOUNTF); - if (mp->mnt_kern_flag & MNTK_MWAIT) { - mp->mnt_kern_flag &= ~MNTK_MWAIT; - wakeup(mp); - } - MNT_IUNLOCK(mp); - if (coveredvp) - VOP_UNLOCK(coveredvp, 0); - return (EBUSY); - } mp->mnt_kern_flag |= MNTK_DRAINING; error = msleep(&mp->mnt_lockref, MNT_MTX(mp), PVFS, "mount drain", 0); From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 20:04:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0A2A106566C; Wed, 11 Jan 2012 20:04:52 +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 8D2E98FC13; Wed, 11 Jan 2012 20:04:52 +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 q0BK4qdM074691; Wed, 11 Jan 2012 20:04:52 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0BK4qb7074687; Wed, 11 Jan 2012 20:04:52 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201201112004.q0BK4qb7074687@svn.freebsd.org> From: Hiroki Sato Date: Wed, 11 Jan 2012 20:04:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229979 - in stable/9/release/doc/en_US.ISO8859-1: . installation X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 20:04:52 -0000 Author: hrs Date: Wed Jan 11 20:04:52 2012 New Revision: 229979 URL: http://svn.freebsd.org/changeset/base/229979 Log: Add a document for brief installation instructions. Submitted by: kensmith Added: stable/9/release/doc/en_US.ISO8859-1/installation/ stable/9/release/doc/en_US.ISO8859-1/installation/Makefile (contents, props changed) stable/9/release/doc/en_US.ISO8859-1/installation/article.sgml (contents, props changed) Modified: stable/9/release/doc/en_US.ISO8859-1/Makefile Modified: stable/9/release/doc/en_US.ISO8859-1/Makefile ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/Makefile Wed Jan 11 19:12:29 2012 (r229978) +++ stable/9/release/doc/en_US.ISO8859-1/Makefile Wed Jan 11 20:04:52 2012 (r229979) @@ -6,6 +6,7 @@ SUBDIR = relnotes SUBDIR+= hardware SUBDIR+= readme SUBDIR+= errata +SUBDIR+= installation COMPAT_SYMLINK = en Added: stable/9/release/doc/en_US.ISO8859-1/installation/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/release/doc/en_US.ISO8859-1/installation/Makefile Wed Jan 11 20:04:52 2012 (r229979) @@ -0,0 +1,19 @@ +# $FreeBSD$ + +RELN_ROOT?= ${.CURDIR}/../.. +.ifdef NO_LANGCODE_IN_DESTDIR +DESTDIR?= ${DOCDIR}/installation +.else +DESTDIR?= ${DOCDIR}/en_US.ISO8859-1/installation +.endif + +DOC?= article +FORMATS?= html +INSTALL_COMPRESSED?= gz +INSTALL_ONLY_COMPRESSED?= + +# SGML content +SRCS+= article.sgml + +.include "${RELN_ROOT}/share/mk/doc.relnotes.mk" +.include "${DOC_PREFIX}/share/mk/doc.project.mk" Added: stable/9/release/doc/en_US.ISO8859-1/installation/article.sgml ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/release/doc/en_US.ISO8859-1/installation/article.sgml Wed Jan 11 20:04:52 2012 (r229979) @@ -0,0 +1,162 @@ + +%articles.ent; + + +%release; +]> + +
+ + &os; &release.current; Installation Instructions + + The &os; Project + + $FreeBSD$ + + + 2012 + + The &os; Documentation Project + + + + &tm-attrib.freebsd; + &tm-attrib.intel; + &tm-attrib.sparc; + &tm-attrib.general; + + + + + This article gives some brief instructions on installing + &os; &release.current; and upgrading the systems running earlier + releases. + + + + Installing &os; + + The Installing + &os; + chapter of the &os; + Handbook provides more in-depth information about the + installation program itself, including a guided walk-through with + screenshots. + + + + Upgrading &os; + + If you are upgrading from a previous release of &os;, please + read upgrading + section in the Release Notes for notable + incompatibilities carefully. + + + Upgrading from Source + + The procedure for doing a source code based update is + described in + and + . + + For SVN use the releng/9.0 branch + which will be where any upcoming Security Advisories or Errata + Notices will be applied. The branch tag to use for updating + the source is RELENG_9_0 for CVS. + + + + Upgrading Using <quote>&os; Update</quote> + + The &man.freebsd-update.8; utility supports binary + upgrades of &arch.i386; and &arch.amd64; systems running + earlier FreeBSD releases. Systems running + 7.[34]-RELEASE, + 8.[12]-RELEASE, + 9.0-BETA[123], or + 9.0-RC[123] can upgrade as follows: + + First, ensure that your current system is up to date; a + change was recently made to &man.freebsd-update.8; (Errata + Notice FreeBSD-EN-12:01.freebsd-update) + which is needed in order to upgrade to &os; + &release.current;. + + &prompt.root; freebsd-update fetch +&prompt.root; freebsd-update install + + Now the &man.freebsd-update.8; utility can fetch bits + belonging to &release.current;. During this process + &man.freebsd-update.8; will ask for help in merging + configuration files. + + &prompt.root; freebsd-update upgrade -r 9.0-RELEASE + + Due to changes in the way that &os; is packaged on the + release media, two complications may arise in this process if + upgrading from FreeBSD 7.x or 8.x: + + + + The &os;, which previously could appear in either + /boot/kernel or + /boot/GENERIC, now only appears as + /boot/kernel. As a result, any + kernel appearing in /boot/GENERIC + will be deleted. Please carefully read the output printed + by &man.freebsd-update.8; and confirm that an updated + kernel will be placed into + /boot/kernel before proceeding beyond + this point. + + + + The &os; source tree in /usr/src + (if present) will be deleted. (Normally the + &man.freebsd-update.8; utility will update a source tree, + but in this case the changes in release packaging result + in the &man.freebsd-update.8; utility not recognizing that + the source tree from the old release and the source tree + from the new release correspond to the same part of + &os;.) + + + + &prompt.root; freebsd-update install + + The system must now be rebooted with the newly installed + kernel before the non-kernel components are updated. + + &prompt.root; shutdown -r now + + After rebooting, &man.freebsd-update.8; needs to be run + again to install the new userland components: + + &prompt.root; freebsd-update install + + At this point, users of systems being upgraded from &os; + 8.2-RELEASE or earlier will be prompted by + &man.freebsd-update.8; to rebuild all third-party applications + (e.g., ports installed from the ports tree) due to updates in + system libraries. + + After updating installed third-party applications (and + again, only if &man.freebsd-update.8; printed a message + indicating that this was necessary), run + &man.freebsd-update.8; again so that it can delete the old (no + longer used) system libraries: + + &prompt.root; freebsd-update install + + Finally, reboot into &release.current; + + &prompt.root; shutdown -r now + + +
From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 21:03:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A591106564A; Wed, 11 Jan 2012 21:03:54 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6973F8FC17; Wed, 11 Jan 2012 21:03: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 q0BL3sAh076591; Wed, 11 Jan 2012 21:03:54 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0BL3svp076589; Wed, 11 Jan 2012 21:03:54 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201201112103.q0BL3svp076589@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 11 Jan 2012 21:03: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: r229980 - head/sys/dev/sound/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 21:03:54 -0000 Author: pfg Date: Wed Jan 11 21:03:54 2012 New Revision: 229980 URL: http://svn.freebsd.org/changeset/base/229980 Log: Fix an inconsistency that crept in while replacing constants from the new header. Approved by: jhb (mentor) MFC after: 3 days Modified: head/sys/dev/sound/pci/emu10k1.c Modified: head/sys/dev/sound/pci/emu10k1.c ============================================================================== --- head/sys/dev/sound/pci/emu10k1.c Wed Jan 11 20:04:52 2012 (r229979) +++ head/sys/dev/sound/pci/emu10k1.c Wed Jan 11 21:03:54 2012 (r229980) @@ -1079,9 +1079,9 @@ emurchan_trigger(kobj_t obj, void *data, emu_wrptr(sc, 0, ch->sizereg, sz); if (ch->num == 0) { if (sc->audigy) { - val = EMU_ADCCR_LCHANENABLE; + val = EMU_A_ADCCR_LCHANENABLE; if (AFMT_CHANNEL(ch->fmt) > 1) - val |= EMU_ADCCR_RCHANENABLE; + val |= EMU_A_ADCCR_RCHANENABLE; val |= audigy_recval(ch->spd); } else { val = EMU_ADCCR_LCHANENABLE; From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 21:17:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8058106566B; Wed, 11 Jan 2012 21:17:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B4E3D8FC1E; Wed, 11 Jan 2012 21:17: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 q0BLHEos077028; Wed, 11 Jan 2012 21:17:14 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0BLHEck077022; Wed, 11 Jan 2012 21:17:14 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201201112117.q0BLHEck077022@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 11 Jan 2012 21:17: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: r229981 - in head/sys: conf dev/sound/pci gnu/dev/sound/pci modules/sound/driver/emu10kx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 21:17:14 -0000 Author: pfg Date: Wed Jan 11 21:17:14 2012 New Revision: 229981 URL: http://svn.freebsd.org/changeset/base/229981 Log: Replace GPL'd headers in the emu10kx snd driver code. This uses the emuxkireg.h already used in the emu10k1 snd driver. Special thanks go to Alexander Motin as he was able to find some errors and reverse engineer some wrong values in the emuxkireg header. The emu10kx driver is now free from the GPL. PR: 153901 Tested by: mav, joel Approved by: jhb (mentor) MFC after: 2 weeks Deleted: head/sys/gnu/dev/sound/pci/emu10k1-alsa.h head/sys/gnu/dev/sound/pci/p16v-alsa.h head/sys/gnu/dev/sound/pci/p17v-alsa.h Modified: head/sys/conf/files head/sys/dev/sound/pci/emu10kx-midi.c head/sys/dev/sound/pci/emu10kx-pcm.c head/sys/dev/sound/pci/emu10kx.c head/sys/dev/sound/pci/emu10kx.h head/sys/dev/sound/pci/emuxkireg.h head/sys/modules/sound/driver/emu10kx/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Jan 11 21:03:54 2012 (r229980) +++ head/sys/conf/files Wed Jan 11 21:17:14 2012 (r229981) @@ -50,11 +50,6 @@ aic79xx_reg_print.c optional ahd pci aic79xx_reg_print.o optional ahd pci ahd_reg_pretty_print \ compile-with "${NORMAL_C}" \ no-implicit-rule local -emu10k1-alsa%diked.h optional snd_emu10kx \ - dependency "$S/tools/sound/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/emu10k1-alsa.h" \ - compile-with "CC='${CC}' AWK=${AWK} sh $S/tools/sound/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/emu10k1-alsa.h emu10k1-alsa%diked.h" \ - no-obj no-implicit-rule before-depend \ - clean "emu10k1-alsa%diked.h" # # The 'fdt_dtb_file' target covers an actual DTB file name, which is derived # from the specified source (DTS) file: .dts -> .dtb @@ -67,16 +62,6 @@ fdt_static_dtb.h optional fdt fdt_dtb_s compile-with "sh $S/tools/fdt/make_dtbh.sh ${FDT_DTS_FILE} ." \ no-obj no-implicit-rule before-depend \ clean "fdt_static_dtb.h" -p16v-alsa%diked.h optional snd_emu10kx pci \ - dependency "$S/tools/sound/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/p16v-alsa.h" \ - compile-with "CC='${CC}' AWK=${AWK} sh $S/tools/sound/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/p16v-alsa.h p16v-alsa%diked.h" \ - no-obj no-implicit-rule before-depend \ - clean "p16v-alsa%diked.h" -p17v-alsa%diked.h optional snd_emu10kx pci \ - dependency "$S/tools/sound/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/p17v-alsa.h" \ - compile-with "CC='${CC}' AWK=${AWK} sh $S/tools/sound/emu10k1-mkalsa.sh $S/gnu/dev/sound/pci/p17v-alsa.h p17v-alsa%diked.h" \ - no-obj no-implicit-rule before-depend \ - clean "p17v-alsa%diked.h" feeder_eq_gen.h optional sound \ dependency "$S/tools/sound/feeder_eq_mkfilter.awk" \ compile-with "${AWK} -f $S/tools/sound/feeder_eq_mkfilter.awk -- ${FEEDER_EQ_PRESETS} > feeder_eq_gen.h" \ @@ -1733,19 +1718,9 @@ dev/sound/pci/csa.c optional snd_csa pc dev/sound/pci/csapcm.c optional snd_csa pci dev/sound/pci/ds1.c optional snd_ds1 pci dev/sound/pci/emu10k1.c optional snd_emu10k1 pci -dev/sound/pci/emu10kx.c optional snd_emu10kx pci \ - dependency "emu10k1-alsa%diked.h" \ - dependency "p16v-alsa%diked.h" \ - dependency "p17v-alsa%diked.h" \ - warning "kernel contains GPL contaminated emu10kx headers" -dev/sound/pci/emu10kx-pcm.c optional snd_emu10kx pci \ - dependency "emu10k1-alsa%diked.h" \ - dependency "p16v-alsa%diked.h" \ - dependency "p17v-alsa%diked.h" \ - warning "kernel contains GPL contaminated emu10kx headers" -dev/sound/pci/emu10kx-midi.c optional snd_emu10kx pci \ - dependency "emu10k1-alsa%diked.h" \ - warning "kernel contains GPL contaminated emu10kx headers" +dev/sound/pci/emu10kx.c optional snd_emu10kx pci +dev/sound/pci/emu10kx-pcm.c optional snd_emu10kx pci +dev/sound/pci/emu10kx-midi.c optional snd_emu10kx pci dev/sound/pci/envy24.c optional snd_envy24 pci dev/sound/pci/envy24ht.c optional snd_envy24ht pci dev/sound/pci/es137x.c optional snd_es137x pci Modified: head/sys/dev/sound/pci/emu10kx-midi.c ============================================================================== --- head/sys/dev/sound/pci/emu10kx-midi.c Wed Jan 11 21:03:54 2012 (r229980) +++ head/sys/dev/sound/pci/emu10kx-midi.c Wed Jan 11 21:17:14 2012 (r229981) @@ -50,8 +50,8 @@ #include #include "mpufoi_if.h" +#include #include -#include "emu10k1-alsa%diked.h" struct emu_midi_softc { struct mtx mtx; @@ -176,25 +176,25 @@ emu_midi_attach(device_t dev) if (scp->is_emu10k1) { /* SB Live! - only one MIDI device here */ inte_val = 0; - /* inte_val |= INTE_MIDITXENABLE;*/ - inte_val |= INTE_MIDIRXENABLE; - ipr_val = IPR_MIDITRANSBUFEMPTY; - ipr_val |= IPR_MIDIRECVBUFEMPTY; + /* inte_val |= EMU_INTE_MIDITXENABLE;*/ + inte_val |= EMU_INTE_MIDIRXENABLE; + ipr_val = EMU_IPR_MIDITRANSBUFE; + ipr_val |= EMU_IPR_MIDIRECVBUFE; } else { - if (scp->port == A_MUDATA1) { + if (scp->port == EMU_A_MUDATA1) { /* EXTERNAL MIDI (AudigyDrive) */ inte_val = 0; - /* inte_val |= A_INTE_MIDITXENABLE1;*/ - inte_val |= INTE_MIDIRXENABLE; - ipr_val = IPR_MIDITRANSBUFEMPTY; - ipr_val |= IPR_MIDIRECVBUFEMPTY; + /* inte_val |= A_EMU_INTE_MIDITXENABLE1;*/ + inte_val |= EMU_INTE_MIDIRXENABLE; + ipr_val = EMU_IPR_MIDITRANSBUFE; + ipr_val |= EMU_IPR_MIDIRECVBUFE; } else { /* MIDI hw config port 2 */ inte_val = 0; - /* inte_val |= A_INTE_MIDITXENABLE2;*/ - inte_val |= INTE_A_MIDIRXENABLE2; - ipr_val = IPR_A_MIDITRANSBUFEMPTY2; - ipr_val |= IPR_A_MIDIRECVBUFEMPTY2; + /* inte_val |= A_EMU_INTE_MIDITXENABLE2;*/ + inte_val |= EMU_INTE_A_MIDIRXENABLE2; + ipr_val = EMU_IPR_A_MIDITRANSBUFE2; + ipr_val |= EMU_IPR_A_MIDIRECBUFE2; } } @@ -214,7 +214,7 @@ emu_midi_attach(device_t dev) if (scp->is_emu10k1) emu_enable_ir(scp->card); else { - if (scp->port == A_MUDATA1) + if (scp->port == EMU_A_MUDATA1) emu_enable_ir(scp->card); } Modified: head/sys/dev/sound/pci/emu10kx-pcm.c ============================================================================== --- head/sys/dev/sound/pci/emu10kx-pcm.c Wed Jan 11 21:03:54 2012 (r229980) +++ head/sys/dev/sound/pci/emu10kx-pcm.c Wed Jan 11 21:17:14 2012 (r229981) @@ -49,8 +49,8 @@ #include "mixer_if.h" +#include #include -#include "emu10k1-alsa%diked.h" struct emu_pcm_pchinfo { int spd; @@ -555,8 +555,8 @@ emu_ac97_read_emulation(struct emu_pcm_i break; } - emu_wr(sc->card, AC97ADDRESS, regno, 1); - tmp = emu_rd(sc->card, AC97DATA, 2); + emu_wr(sc->card, EMU_AC97ADDR, regno, 1); + tmp = emu_rd(sc->card, EMU_AC97DATA, 2); if (use_ac97) emulated = tmp; @@ -621,8 +621,8 @@ emu_ac97_write_emulation(struct emu_pcm_ break; } if (write_ac97) { - emu_wr(sc->card, AC97ADDRESS, regno, 1); - emu_wr(sc->card, AC97DATA, data, 2); + emu_wr(sc->card, EMU_AC97ADDR, regno, 1); + emu_wr(sc->card, EMU_AC97DATA, data, 2); } } @@ -658,8 +658,8 @@ emu_rdcd(kobj_t obj __unused, void *devi struct emu_pcm_info *sc = (struct emu_pcm_info *)devinfo; KASSERT(sc->card != NULL, ("emu_rdcd: no soundcard")); - emu_wr(sc->card, AC97ADDRESS, regno, 1); - rd = emu_rd(sc->card, AC97DATA, 2); + emu_wr(sc->card, EMU_AC97ADDR, regno, 1); + rd = emu_rd(sc->card, EMU_AC97DATA, 2); return (rd); } @@ -669,8 +669,8 @@ emu_wrcd(kobj_t obj __unused, void *devi struct emu_pcm_info *sc = (struct emu_pcm_info *)devinfo; KASSERT(sc->card != NULL, ("emu_wrcd: no soundcard")); - emu_wr(sc->card, AC97ADDRESS, regno, 1); - emu_wr(sc->card, AC97DATA, data, 2); + emu_wr(sc->card, EMU_AC97ADDR, regno, 1); + emu_wr(sc->card, EMU_AC97DATA, data, 2); return (0); } @@ -870,12 +870,12 @@ emurchan_init(kobj_t obj __unused, void ch->blksz = sc->bufsz / 2; /* We rise interrupt for half-full buffer */ ch->fmt = SND_FORMAT(AFMT_U8, 1, 0); ch->spd = 8000; - ch->idxreg = sc->is_emu10k1 ? ADCIDX : A_ADCIDX; - ch->basereg = ADCBA; - ch->sizereg = ADCBS; - ch->setupreg = ADCCR; - ch->irqmask = INTE_ADCBUFENABLE; - ch->iprmask = IPR_ADCBUFFULL | IPR_ADCBUFHALFFULL; + ch->idxreg = sc->is_emu10k1 ? EMU_ADCIDX : EMU_A_ADCIDX; + ch->basereg = EMU_ADCBA; + ch->sizereg = EMU_ADCBS; + ch->setupreg = EMU_ADCCR; + ch->irqmask = EMU_INTE_ADCBUFENABLE; + ch->iprmask = EMU_IPR_ADCBUFFULL | EMU_IPR_ADCBUFHALFFULL; if (sndbuf_alloc(ch->buffer, emu_gettag(sc->card), 0, sc->bufsz) != 0) return (NULL); @@ -953,22 +953,22 @@ emurchan_trigger(kobj_t obj __unused, vo switch (sc->bufsz) { case 4096: - sz = ADCBS_BUFSIZE_4096; + sz = EMU_RECBS_BUFSIZE_4096; break; case 8192: - sz = ADCBS_BUFSIZE_8192; + sz = EMU_RECBS_BUFSIZE_8192; break; case 16384: - sz = ADCBS_BUFSIZE_16384; + sz = EMU_RECBS_BUFSIZE_16384; break; case 32768: - sz = ADCBS_BUFSIZE_32768; + sz = EMU_RECBS_BUFSIZE_32768; break; case 65536: - sz = ADCBS_BUFSIZE_65536; + sz = EMU_RECBS_BUFSIZE_65536; break; default: - sz = ADCBS_BUFSIZE_4096; + sz = EMU_RECBS_BUFSIZE_4096; } snd_mtxlock(sc->lock); @@ -976,9 +976,9 @@ emurchan_trigger(kobj_t obj __unused, vo case PCMTRIG_START: ch->run = 1; emu_wrptr(sc->card, 0, ch->sizereg, sz); - val = sc->is_emu10k1 ? ADCCR_LCHANENABLE : A_ADCCR_LCHANENABLE; + val = sc->is_emu10k1 ? EMU_ADCCR_LCHANENABLE : EMU_A_ADCCR_LCHANENABLE; if (AFMT_CHANNEL(ch->fmt) > 1) - val |= sc->is_emu10k1 ? ADCCR_RCHANENABLE : A_ADCCR_RCHANENABLE; + val |= sc->is_emu10k1 ? EMU_ADCCR_RCHANENABLE : EMU_A_ADCCR_RCHANENABLE; val |= sc->is_emu10k1 ? emu_k1_recval(ch->spd) : emu_k2_recval(ch->spd); emu_wrptr(sc->card, 0, ch->setupreg, 0); emu_wrptr(sc->card, 0, ch->setupreg, val); @@ -1049,11 +1049,11 @@ emufxrchan_init(kobj_t obj __unused, voi ch = &(sc->rch_efx); ch->fmt = SND_FORMAT(AFMT_S16_LE, 1, 0); ch->spd = sc->is_emu10k1 ? 48000*32 : 48000 * 64; - ch->idxreg = FXIDX; - ch->basereg = FXBA; - ch->sizereg = FXBS; - ch->irqmask = INTE_EFXBUFENABLE; - ch->iprmask = IPR_EFXBUFFULL | IPR_EFXBUFHALFFULL; + ch->idxreg = EMU_FXIDX; + ch->basereg = EMU_FXBA; + ch->sizereg = EMU_FXBS; + ch->irqmask = EMU_INTE_EFXBUFENABLE; + ch->iprmask = EMU_IPR_EFXBUFFULL | EMU_IPR_EFXBUFHALFFULL; ch->buffer = b; ch->pcm = sc; ch->channel = c; @@ -1113,22 +1113,22 @@ emufxrchan_trigger(kobj_t obj __unused, switch (sc->bufsz) { case 4096: - sz = ADCBS_BUFSIZE_4096; + sz = EMU_RECBS_BUFSIZE_4096; break; case 8192: - sz = ADCBS_BUFSIZE_8192; + sz = EMU_RECBS_BUFSIZE_8192; break; case 16384: - sz = ADCBS_BUFSIZE_16384; + sz = EMU_RECBS_BUFSIZE_16384; break; case 32768: - sz = ADCBS_BUFSIZE_32768; + sz = EMU_RECBS_BUFSIZE_32768; break; case 65536: - sz = ADCBS_BUFSIZE_65536; + sz = EMU_RECBS_BUFSIZE_65536; break; default: - sz = ADCBS_BUFSIZE_4096; + sz = EMU_RECBS_BUFSIZE_4096; } snd_mtxlock(sc->lock); @@ -1140,14 +1140,14 @@ emufxrchan_trigger(kobj_t obj __unused, /* * SB Live! is limited to 32 mono channels. Audigy * has 64 mono channels. Channels are enabled - * by setting a bit in A_FXWC[1|2] registers. + * by setting a bit in EMU_A_FXWC[1|2] registers. */ /* XXX there is no way to demultiplex this streams for now */ if (sc->is_emu10k1) { - emu_wrptr(sc->card, 0, FXWC, 0xffffffff); + emu_wrptr(sc->card, 0, EMU_FXWC, 0xffffffff); } else { - emu_wrptr(sc->card, 0, A_FXWC1, 0xffffffff); - emu_wrptr(sc->card, 0, A_FXWC2, 0xffffffff); + emu_wrptr(sc->card, 0, EMU_A_FXWC1, 0xffffffff); + emu_wrptr(sc->card, 0, EMU_A_FXWC2, 0xffffffff); } break; case PCMTRIG_STOP: @@ -1155,10 +1155,10 @@ emufxrchan_trigger(kobj_t obj __unused, case PCMTRIG_ABORT: ch->run = 0; if (sc->is_emu10k1) { - emu_wrptr(sc->card, 0, FXWC, 0x0); + emu_wrptr(sc->card, 0, EMU_FXWC, 0x0); } else { - emu_wrptr(sc->card, 0, A_FXWC1, 0x0); - emu_wrptr(sc->card, 0, A_FXWC2, 0x0); + emu_wrptr(sc->card, 0, EMU_A_FXWC1, 0x0); + emu_wrptr(sc->card, 0, EMU_A_FXWC2, 0x0); } emu_wrptr(sc->card, 0, ch->sizereg, 0); (void)emu_intr_unregister(sc->card, ch->ihandle); @@ -1238,8 +1238,8 @@ emu_pcm_intr(void *pcm, uint32_t stat) snd_mtxlock(sc->lock); - if (stat & IPR_INTERVALTIMER) { - ack |= IPR_INTERVALTIMER; + if (stat & EMU_IPR_INTERVALTIMER) { + ack |= EMU_IPR_INTERVALTIMER; for (i = 0; i < MAX_CHANNELS; i++) if (sc->pch[i].channel) { if (sc->pch[i].run == 1) { @@ -1262,8 +1262,8 @@ emu_pcm_intr(void *pcm, uint32_t stat) } - if (stat & (IPR_ADCBUFFULL | IPR_ADCBUFHALFFULL)) { - ack |= stat & (IPR_ADCBUFFULL | IPR_ADCBUFHALFFULL); + if (stat & (EMU_IPR_ADCBUFFULL | EMU_IPR_ADCBUFHALFFULL)) { + ack |= stat & (EMU_IPR_ADCBUFFULL | EMU_IPR_ADCBUFHALFFULL); if (sc->rch_adc.channel) { snd_mtxunlock(sc->lock); chn_intr(sc->rch_adc.channel); @@ -1271,8 +1271,8 @@ emu_pcm_intr(void *pcm, uint32_t stat) } } - if (stat & (IPR_EFXBUFFULL | IPR_EFXBUFHALFFULL)) { - ack |= stat & (IPR_EFXBUFFULL | IPR_EFXBUFHALFFULL); + if (stat & (EMU_IPR_EFXBUFFULL | EMU_IPR_EFXBUFHALFFULL)) { + ack |= stat & (EMU_IPR_EFXBUFFULL | EMU_IPR_EFXBUFHALFFULL); if (sc->rch_efx.channel) { snd_mtxunlock(sc->lock); chn_intr(sc->rch_efx.channel); @@ -1450,8 +1450,8 @@ emu_pcm_attach(device_t dev) goto bad; } - inte = INTE_INTERVALTIMERENB; - ipr = IPR_INTERVALTIMER; /* Used by playback & ADC */ + inte = EMU_INTE_INTERTIMERENB; + ipr = EMU_IPR_INTERVALTIMER; /* Used by playback & ADC */ sc->ihandle = emu_intr_register(sc->card, inte, ipr, &emu_pcm_intr, sc); if (emu_pcm_init(sc) == -1) { Modified: head/sys/dev/sound/pci/emu10kx.c ============================================================================== --- head/sys/dev/sound/pci/emu10kx.c Wed Jan 11 21:03:54 2012 (r229980) +++ head/sys/dev/sound/pci/emu10kx.c Wed Jan 11 21:17:14 2012 (r229981) @@ -53,6 +53,7 @@ #include #include +#include #include /* hw flags */ @@ -181,7 +182,7 @@ #define A_IN_AUX2_R 0x0d #define A_IN_AUX2 A_IN_AUX2_L -/* Audigiy Outputs */ +/* Audigy Outputs */ #define A_OUT_D_FRONT_L 0x00 #define A_OUT_D_FRONT_R 0x01 #define A_OUT_D_FRONT A_OUT_D_FRONT_L @@ -217,9 +218,19 @@ #define A_OUT_ADC_REC_R 0x17 #define A_OUT_ADC_REC A_OUT_ADC_REC_L -#include "emu10k1-alsa%diked.h" -#include "p16v-alsa%diked.h" -#include "p17v-alsa%diked.h" +#define EMU_DATA2 0x24 +#define EMU_IPR2 0x28 +#define EMU_INTE2 0x2c +#define EMU_IPR3 0x38 +#define EMU_INTE3 0x3c + +#define EMU_A2_SRCSel 0x60 +#define EMU_A2_SRCMULTI_ENABLE 0x6e + +#define EMU_A_I2S_CAPTURE_96000 0x00000400 + +#define EMU_A2_MIXER_I2S_ENABLE 0x7B +#define EMU_A2_MIXER_SPDIF_ENABLE 0x7A #define C_FRONT_L 0 #define C_FRONT_R 1 @@ -630,7 +641,7 @@ emu_wr_nolock(struct emu_sc_info *sc, un } } /* - * PTR / DATA interface. Access to EMU10Kx is made + * EMU_PTR / EMU_DATA interface. Access to EMU10Kx is made * via (channel, register) pair. Some registers are channel-specific, * some not. */ @@ -639,11 +650,11 @@ emu_rdptr(struct emu_sc_info *sc, unsign { uint32_t ptr, val, mask, size, offset; - ptr = ((reg << 16) & sc->address_mask) | (chn & PTR_CHANNELNUM_MASK); + ptr = ((reg << 16) & sc->address_mask) | (chn & EMU_PTR_CHNO_MASK); EMU_RWLOCK(); - emu_wr_nolock(sc, PTR, ptr, 4); - val = emu_rd_nolock(sc, DATA, 4); + emu_wr_nolock(sc, EMU_PTR, ptr, 4); + val = emu_rd_nolock(sc, EMU_DATA, 4); EMU_RWUNLOCK(); /* @@ -666,10 +677,10 @@ emu_wrptr(struct emu_sc_info *sc, unsign { uint32_t ptr, mask, size, offset; - ptr = ((reg << 16) & sc->address_mask) | (chn & PTR_CHANNELNUM_MASK); + ptr = ((reg << 16) & sc->address_mask) | (chn & EMU_PTR_CHNO_MASK); EMU_RWLOCK(); - emu_wr_nolock(sc, PTR, ptr, 4); + emu_wr_nolock(sc, EMU_PTR, ptr, 4); /* * XXX Another kind of magic encoding in register number. This can * give you side effect - it will read previous data from register @@ -681,13 +692,13 @@ emu_wrptr(struct emu_sc_info *sc, unsign mask = ((1 << size) - 1) << offset; data <<= offset; data &= mask; - data |= emu_rd_nolock(sc, DATA, 4) & ~mask; + data |= emu_rd_nolock(sc, EMU_DATA, 4) & ~mask; } - emu_wr_nolock(sc, DATA, data, 4); + emu_wr_nolock(sc, EMU_DATA, data, 4); EMU_RWUNLOCK(); } /* - * PTR2 / DATA2 interface. Access to P16v is made + * EMU_A2_PTR / EMU_DATA2 interface. Access to P16v is made * via (channel, register) pair. Some registers are channel-specific, * some not. This interface is supported by CA0102 and CA0108 chips only. */ @@ -698,8 +709,8 @@ emu_rd_p16vptr(struct emu_sc_info *sc, u /* XXX separate lock? */ EMU_RWLOCK(); - emu_wr_nolock(sc, PTR2, (reg << 16) | chn, 4); - val = emu_rd_nolock(sc, DATA2, 4); + emu_wr_nolock(sc, EMU_A2_PTR, (reg << 16) | chn, 4); + val = emu_rd_nolock(sc, EMU_DATA2, 4); EMU_RWUNLOCK(); @@ -711,8 +722,8 @@ emu_wr_p16vptr(struct emu_sc_info *sc, u { EMU_RWLOCK(); - emu_wr_nolock(sc, PTR2, (reg << 16) | chn, 4); - emu_wr_nolock(sc, DATA2, data, 4); + emu_wr_nolock(sc, EMU_A2_PTR, (reg << 16) | chn, 4); + emu_wr_nolock(sc, EMU_DATA2, data, 4); EMU_RWUNLOCK(); } /* @@ -737,13 +748,13 @@ emu_wr_cbptr(struct emu_sc_info *sc, uin /* * Direct hardware register access - * Assume that it is never used to access PTR-based registers and can run unlocked. + * Assume that it is never used to access EMU_PTR-based registers and can run unlocked. */ void emu_wr(struct emu_sc_info *sc, unsigned int regno, uint32_t data, unsigned int size) { - KASSERT(regno != PTR, ("emu_wr: attempt to write to PTR")); - KASSERT(regno != PTR2, ("emu_wr: attempt to write to PTR2")); + KASSERT(regno != EMU_PTR, ("emu_wr: attempt to write to EMU_PTR")); + KASSERT(regno != EMU_A2_PTR, ("emu_wr: attempt to write to EMU_A2_PTR")); emu_wr_nolock(sc, regno, data, size); } @@ -753,8 +764,8 @@ emu_rd(struct emu_sc_info *sc, unsigned { uint32_t rd; - KASSERT(regno != DATA, ("emu_rd: attempt to read DATA")); - KASSERT(regno != DATA2, ("emu_rd: attempt to read DATA2")); + KASSERT(regno != EMU_DATA, ("emu_rd: attempt to read DATA")); + KASSERT(regno != EMU_DATA2, ("emu_rd: attempt to read DATA2")); rd = emu_rd_nolock(sc, regno, size); return (rd); @@ -770,24 +781,24 @@ emu_enable_ir(struct emu_sc_info *sc) uint32_t iocfg; if (sc->is_emu10k2 || sc->is_ca0102) { - iocfg = emu_rd_nolock(sc, A_IOCFG, 2); - emu_wr_nolock(sc, A_IOCFG, iocfg | A_IOCFG_GPOUT2, 2); + iocfg = emu_rd_nolock(sc, EMU_A_IOCFG, 2); + emu_wr_nolock(sc, EMU_A_IOCFG, iocfg | EMU_A_IOCFG_GPOUT2, 2); DELAY(500); - emu_wr_nolock(sc, A_IOCFG, iocfg | A_IOCFG_GPOUT1 | A_IOCFG_GPOUT2, 2); + emu_wr_nolock(sc, EMU_A_IOCFG, iocfg | EMU_A_IOCFG_GPOUT1 | EMU_A_IOCFG_GPOUT2, 2); DELAY(500); - emu_wr_nolock(sc, A_IOCFG, iocfg | A_IOCFG_GPOUT1, 2); + emu_wr_nolock(sc, EMU_A_IOCFG, iocfg | EMU_A_IOCFG_GPOUT1, 2); DELAY(100); - emu_wr_nolock(sc, A_IOCFG, iocfg, 2); + emu_wr_nolock(sc, EMU_A_IOCFG, iocfg, 2); device_printf(sc->dev, "Audigy IR MIDI events enabled.\n"); sc->enable_ir = 1; } if (sc->is_emu10k1) { - iocfg = emu_rd_nolock(sc, HCFG, 4); - emu_wr_nolock(sc, HCFG, iocfg | HCFG_GPOUT2, 4); + iocfg = emu_rd_nolock(sc, EMU_HCFG, 4); + emu_wr_nolock(sc, EMU_HCFG, iocfg | EMU_HCFG_GPOUT2, 4); DELAY(500); - emu_wr_nolock(sc, HCFG, iocfg | HCFG_GPOUT1 | HCFG_GPOUT2, 4); + emu_wr_nolock(sc, EMU_HCFG, iocfg | EMU_HCFG_GPOUT1 | EMU_HCFG_GPOUT2, 4); DELAY(100); - emu_wr_nolock(sc, HCFG, iocfg, 4); + emu_wr_nolock(sc, EMU_HCFG, iocfg, 4); device_printf(sc->dev, "SB Live! IR MIDI events enabled.\n"); sc->enable_ir = 1; } @@ -835,7 +846,7 @@ emu_timer_set(struct emu_sc_info *sc, in sc->timerinterval = sc->timer[i]; /* XXX */ - emu_wr(sc, TIMER, sc->timerinterval & 0x03ff, 2); + emu_wr(sc, EMU_TIMER, sc->timerinterval & 0x03ff, 2); mtx_unlock(&sc->lock); return (timer); @@ -868,16 +879,16 @@ emu_timer_enable(struct emu_sc_info *sc, ena_int = 1; } - emu_wr(sc, TIMER, sc->timerinterval & 0x03ff, 2); + emu_wr(sc, EMU_TIMER, sc->timerinterval & 0x03ff, 2); if (ena_int == 1) { - x = emu_rd(sc, INTE, 4); - x |= INTE_INTERVALTIMERENB; - emu_wr(sc, INTE, x, 4); + x = emu_rd(sc, EMU_INTE, 4); + x |= EMU_INTE_INTERTIMERENB; + emu_wr(sc, EMU_INTE, x, 4); } else { - x = emu_rd(sc, INTE, 4); - x &= ~INTE_INTERVALTIMERENB; - emu_wr(sc, INTE, x, 4); + x = emu_rd(sc, EMU_INTE, 4); + x &= ~EMU_INTE_INTERTIMERENB; + emu_wr(sc, EMU_INTE, x, 4); } mtx_unlock(&sc->lock); return (0); @@ -917,9 +928,9 @@ emu_intr_register(struct emu_sc_info *sc sc->ihandler[i].intr_mask = intr_mask; sc->ihandler[i].softc = isc; sc->ihandler[i].irq_func = func; - x = emu_rd(sc, INTE, 4); + x = emu_rd(sc, EMU_INTE, 4); x |= inte_mask; - emu_wr(sc, INTE, x, 4); + emu_wr(sc, EMU_INTE, x, 4); mtx_unlock(&sc->lock); if (sc->dbg_level > 1) device_printf(sc->dev, "ihandle %d registered\n", i); @@ -946,7 +957,7 @@ emu_intr_unregister(struct emu_sc_info * return (-1); } - x = emu_rd(sc, INTE, 4); + x = emu_rd(sc, EMU_INTE, 4); x &= ~sc->ihandler[hnumber].inte_mask; sc->ihandler[hnumber].inte_mask = 0; @@ -954,12 +965,12 @@ emu_intr_unregister(struct emu_sc_info * sc->ihandler[hnumber].softc = NULL; sc->ihandler[hnumber].irq_func = NULL; - /* other interrupt handlers may use this INTE value */ + /* other interrupt handlers may use this EMU_INTE value */ for (i = 0; i < EMU_MAX_IRQ_CONSUMERS; i++) if (sc->ihandler[i].inte_mask != 0) x |= sc->ihandler[i].inte_mask; - emu_wr(sc, INTE, x, 4); + emu_wr(sc, EMU_INTE, x, 4); mtx_unlock(&sc->lock); return (hnumber); @@ -973,11 +984,11 @@ emu_intr(void *p) int i; for (;;) { - stat = emu_rd(sc, IPR, 4); + stat = emu_rd(sc, EMU_IPR, 4); ack = 0; if (stat == 0) break; - emu_wr(sc, IPR, stat, 4); + emu_wr(sc, EMU_IPR, stat, 4); for (i = 0; i < EMU_MAX_IRQ_CONSUMERS; i++) { if ((((sc->ihandler[i].intr_mask) & stat) != 0) && (((void *)sc->ihandler[i].irq_func) != NULL)) { @@ -993,13 +1004,13 @@ emu_intr(void *p) if ((sc->is_ca0102) || (sc->is_ca0108)) for (;;) { - stat = emu_rd(sc, IPR2, 4); + stat = emu_rd(sc, EMU_IPR2, 4); ack = 0; if (stat == 0) break; - emu_wr(sc, IPR2, stat, 4); + emu_wr(sc, EMU_IPR2, stat, 4); if (sc->dbg_level > 1) - device_printf(sc->dev, "IPR2: %08x\n", stat); + device_printf(sc->dev, "EMU_IPR2: %08x\n", stat); break; /* to avoid infinite loop. shoud be removed * after completion of P16V interface. */ @@ -1007,13 +1018,13 @@ emu_intr(void *p) if (sc->is_ca0102) for (;;) { - stat = emu_rd(sc, IPR3, 4); + stat = emu_rd(sc, EMU_IPR3, 4); ack = 0; if (stat == 0) break; - emu_wr(sc, IPR3, stat, 4); + emu_wr(sc, EMU_IPR3, stat, 4); if (sc->dbg_level > 1) - device_printf(sc->dev, "IPR3: %08x\n", stat); + device_printf(sc->dev, "EMU_IPR3: %08x\n", stat); break; /* to avoid infinite loop. should be removed * after completion of S/PDIF interface */ @@ -1374,61 +1385,61 @@ emu_vwrite(struct emu_sc_info *sc, struc if (v->stereo) { - emu_wrptr(sc, v->vnum, CPF, CPF_STEREO_MASK); + emu_wrptr(sc, v->vnum, EMU_CHAN_CPF, EMU_CHAN_CPF_STEREO_MASK); } else { - emu_wrptr(sc, v->vnum, CPF, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_CPF, 0); } val = v->stereo ? 28 : 30; val *= v->b16 ? 1 : 2; start = v->sa + val; if (sc->is_emu10k1) { - emu_wrptr(sc, v->vnum, FXRT, ((v->routing[3] << 12) | + emu_wrptr(sc, v->vnum, EMU_CHAN_FXRT, ((v->routing[3] << 12) | (v->routing[2] << 8) | (v->routing[1] << 4) | (v->routing[0] << 0)) << 16); } else { - emu_wrptr(sc, v->vnum, A_FXRT1, (v->routing[3] << 24) | + emu_wrptr(sc, v->vnum, EMU_A_CHAN_FXRT1, (v->routing[3] << 24) | (v->routing[2] << 16) | (v->routing[1] << 8) | (v->routing[0] << 0)); - emu_wrptr(sc, v->vnum, A_FXRT2, (v->routing[7] << 24) | + emu_wrptr(sc, v->vnum, EMU_A_CHAN_FXRT2, (v->routing[7] << 24) | (v->routing[6] << 16) | (v->routing[5] << 8) | (v->routing[4] << 0)); - emu_wrptr(sc, v->vnum, A_SENDAMOUNTS, (v->amounts[7] << 24) | + emu_wrptr(sc, v->vnum, EMU_A_CHAN_SENDAMOUNTS, (v->amounts[7] << 24) | (v->amounts[6] << 26) | (v->amounts[5] << 8) | (v->amounts[4] << 0)); } - emu_wrptr(sc, v->vnum, PTRX, (v->amounts[0] << 8) | (v->amounts[1] << 0)); - emu_wrptr(sc, v->vnum, DSL, v->ea | (v->amounts[3] << 24)); - emu_wrptr(sc, v->vnum, PSST, v->sa | (v->amounts[2] << 24)); - - emu_wrptr(sc, v->vnum, CCCA, start | (v->b16 ? 0 : CCCA_8BITSELECT)); - emu_wrptr(sc, v->vnum, Z1, 0); - emu_wrptr(sc, v->vnum, Z2, 0); - - silent_page = ((uint32_t) (sc->mem.silent_page_addr) << 1) | MAP_PTI_MASK; - emu_wrptr(sc, v->vnum, MAPA, silent_page); - emu_wrptr(sc, v->vnum, MAPB, silent_page); - - emu_wrptr(sc, v->vnum, CVCF, CVCF_CURRENTFILTER_MASK); - emu_wrptr(sc, v->vnum, VTFT, VTFT_FILTERTARGET_MASK); - emu_wrptr(sc, v->vnum, ATKHLDM, 0); - emu_wrptr(sc, v->vnum, DCYSUSM, DCYSUSM_DECAYTIME_MASK); - emu_wrptr(sc, v->vnum, LFOVAL1, 0x8000); - emu_wrptr(sc, v->vnum, LFOVAL2, 0x8000); - emu_wrptr(sc, v->vnum, FMMOD, 0); - emu_wrptr(sc, v->vnum, TREMFRQ, 0); - emu_wrptr(sc, v->vnum, FM2FRQ2, 0); - emu_wrptr(sc, v->vnum, ENVVAL, 0x8000); + emu_wrptr(sc, v->vnum, EMU_CHAN_PTRX, (v->amounts[0] << 8) | (v->amounts[1] << 0)); + emu_wrptr(sc, v->vnum, EMU_CHAN_DSL, v->ea | (v->amounts[3] << 24)); + emu_wrptr(sc, v->vnum, EMU_CHAN_PSST, v->sa | (v->amounts[2] << 24)); + + emu_wrptr(sc, v->vnum, EMU_CHAN_CCCA, start | (v->b16 ? 0 : EMU_CHAN_CCCA_8BITSELECT)); + emu_wrptr(sc, v->vnum, EMU_CHAN_Z1, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_Z2, 0); + + silent_page = ((uint32_t) (sc->mem.silent_page_addr) << 1) | EMU_CHAN_MAP_PTI_MASK; + emu_wrptr(sc, v->vnum, EMU_CHAN_MAPA, silent_page); + emu_wrptr(sc, v->vnum, EMU_CHAN_MAPB, silent_page); + + emu_wrptr(sc, v->vnum, EMU_CHAN_CVCF, EMU_CHAN_CVCF_CURRFILTER_MASK); + emu_wrptr(sc, v->vnum, EMU_CHAN_VTFT, EMU_CHAN_VTFT_FILTERTARGET_MASK); + emu_wrptr(sc, v->vnum, EMU_CHAN_ATKHLDM, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_DCYSUSM, EMU_CHAN_DCYSUSM_DECAYTIME_MASK); + emu_wrptr(sc, v->vnum, EMU_CHAN_LFOVAL1, 0x8000); + emu_wrptr(sc, v->vnum, EMU_CHAN_LFOVAL2, 0x8000); + emu_wrptr(sc, v->vnum, EMU_CHAN_FMMOD, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_TREMFRQ, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_FM2FRQ2, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_ENVVAL, 0x8000); - emu_wrptr(sc, v->vnum, ATKHLDV, ATKHLDV_HOLDTIME_MASK | ATKHLDV_ATTACKTIME_MASK); - emu_wrptr(sc, v->vnum, ENVVOL, 0x8000); + emu_wrptr(sc, v->vnum, EMU_CHAN_ATKHLDV, EMU_CHAN_ATKHLDV_HOLDTIME_MASK | EMU_CHAN_ATKHLDV_ATTACKTIME_MASK); + emu_wrptr(sc, v->vnum, EMU_CHAN_ENVVOL, 0x8000); - emu_wrptr(sc, v->vnum, PEFE_FILTERAMOUNT, 0x7f); - emu_wrptr(sc, v->vnum, PEFE_PITCHAMOUNT, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_PEFE_FILTERAMOUNT, 0x7f); + emu_wrptr(sc, v->vnum, EMU_CHAN_PEFE_PITCHAMOUNT, 0); if ((v->stereo) && (v->slave != NULL)) emu_vwrite(sc, v->slave); } @@ -1438,7 +1449,7 @@ emu_vstop(struct emu_sc_info *sc, char c { int reg; - reg = (channel & 0x20) ? SOLEH : SOLEL; + reg = (channel & 0x20) ? EMU_SOLEH : EMU_SOLEL; channel &= 0x1f; reg |= 1 << 24; reg |= channel << 16; @@ -1459,29 +1470,29 @@ emu_vtrigger(struct emu_sc_info *sc, str ccis *= v->b16 ? 1 : 2; sample = v->b16 ? 0x00000000 : 0x80808080; for (i = 0; i < cs; i++) - emu_wrptr(sc, v->vnum, CD0 + i, sample); - emu_wrptr(sc, v->vnum, CCR_CACHEINVALIDSIZE, 0); - emu_wrptr(sc, v->vnum, CCR_READADDRESS, cra); - emu_wrptr(sc, v->vnum, CCR_CACHEINVALIDSIZE, ccis); - - emu_wrptr(sc, v->vnum, IFATN, 0xff00); - emu_wrptr(sc, v->vnum, VTFT, 0xffffffff); - emu_wrptr(sc, v->vnum, CVCF, 0xffffffff); - emu_wrptr(sc, v->vnum, DCYSUSV, 0x00007f7f); + emu_wrptr(sc, v->vnum, EMU_CHAN_CD0 + i, sample); + emu_wrptr(sc, v->vnum, EMU_CHAN_CCR_CACHEINVALIDSIZE, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_CCR_READADDRESS, cra); + emu_wrptr(sc, v->vnum, EMU_CHAN_CCR_CACHEINVALIDSIZE, ccis); + + emu_wrptr(sc, v->vnum, EMU_CHAN_IFATN, 0xff00); + emu_wrptr(sc, v->vnum, EMU_CHAN_VTFT, 0xffffffff); + emu_wrptr(sc, v->vnum, EMU_CHAN_CVCF, 0xffffffff); + emu_wrptr(sc, v->vnum, EMU_CHAN_DCYSUSV, 0x00007f7f); emu_vstop(sc, v->vnum, 0); pitch_target = emu_rate_to_linearpitch(v->speed); initial_pitch = emu_rate_to_pitch(v->speed) >> 8; - emu_wrptr(sc, v->vnum, PTRX_PITCHTARGET, pitch_target); - emu_wrptr(sc, v->vnum, CPF_CURRENTPITCH, pitch_target); - emu_wrptr(sc, v->vnum, IP, initial_pitch); + emu_wrptr(sc, v->vnum, EMU_CHAN_PTRX_PITCHTARGET, pitch_target); + emu_wrptr(sc, v->vnum, EMU_CHAN_CPF_PITCH, pitch_target); + emu_wrptr(sc, v->vnum, EMU_CHAN_IP, initial_pitch); } else { - emu_wrptr(sc, v->vnum, PTRX_PITCHTARGET, 0); - emu_wrptr(sc, v->vnum, CPF_CURRENTPITCH, 0); - emu_wrptr(sc, v->vnum, IFATN, 0xffff); - emu_wrptr(sc, v->vnum, VTFT, 0x0000ffff); - emu_wrptr(sc, v->vnum, CVCF, 0x0000ffff); - emu_wrptr(sc, v->vnum, IP, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_PTRX_PITCHTARGET, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_CPF_PITCH, 0); + emu_wrptr(sc, v->vnum, EMU_CHAN_IFATN, 0xffff); + emu_wrptr(sc, v->vnum, EMU_CHAN_VTFT, 0x0000ffff); + emu_wrptr(sc, v->vnum, EMU_CHAN_CVCF, 0x0000ffff); + emu_wrptr(sc, v->vnum, EMU_CHAN_IP, 0); emu_vstop(sc, v->vnum, 1); } if ((v->stereo) && (v->slave != NULL)) @@ -1494,7 +1505,7 @@ emu_vpos(struct emu_sc_info *sc, struct int s, ptr; s = (v->b16 ? 1 : 0) + (v->stereo ? 1 : 0); - ptr = (emu_rdptr(sc, v->vnum, CCCA_CURRADDR) - (v->start >> s)) << s; + ptr = (emu_rdptr(sc, v->vnum, EMU_CHAN_CCCA_CURRADDR) - (v->start >> s)) << s; return (ptr & ~0x0000001f); } @@ -1694,9 +1705,9 @@ emu_initefx(struct emu_sc_info *sc) /* stop DSP */ if (sc->is_emu10k1) { - emu_wrptr(sc, 0, DBG, EMU10K1_DBG_SINGLE_STEP); + emu_wrptr(sc, 0, EMU_DBG, EMU_DBG_SINGLE_STEP); } else { - emu_wrptr(sc, 0, A_DBG, A_DBG_SINGLE_STEP); + emu_wrptr(sc, 0, EMU_A_DBG, EMU_A_DBG_SINGLE_STEP); } /* code size is in instructions */ @@ -2162,9 +2173,9 @@ emu_initefx(struct emu_sc_info *sc) /* start DSP */ if (sc->is_emu10k1) { - emu_wrptr(sc, 0, DBG, 0); + emu_wrptr(sc, 0, EMU_DBG, 0); } else { - emu_wrptr(sc, 0, A_DBG, 0); + emu_wrptr(sc, 0, EMU_A_DBG, 0); } } @@ -2450,24 +2461,24 @@ emumix_set_mode(struct emu_sc_info *sc, return; } - hcfg = HCFG_AUDIOENABLE | HCFG_AUTOMUTE; + hcfg = EMU_HCFG_AUDIOENABLE | EMU_HCFG_AUTOMUTE; a_iocfg = 0; if (sc->rev >= 6) - hcfg |= HCFG_JOYENABLE; + hcfg |= EMU_HCFG_JOYENABLE; if (sc->is_emu10k1) - hcfg |= HCFG_LOCKTANKCACHE_MASK; + hcfg |= EMU_HCFG_LOCKTANKCACHE_MASK; else - hcfg |= HCFG_CODECFORMAT_I2S | HCFG_JOYENABLE; + hcfg |= EMU_HCFG_CODECFMT_I2S | EMU_HCFG_JOYENABLE; if (mode == MODE_DIGITAL) { if (sc->broken_digital) { device_printf(sc->dev, "Digital mode is reported as broken on this card.\n"); } - a_iocfg |= A_IOCFG_ENABLE_DIGITAL; - hcfg |= HCFG_GPOUT0; + a_iocfg |= EMU_A_IOCFG_GPOUT1; + hcfg |= EMU_HCFG_GPOUT0; } if (mode == MODE_ANALOG) @@ -2478,12 +2489,12 @@ emumix_set_mode(struct emu_sc_info *sc, if ((sc->is_ca0102) || (sc->is_ca0108)) /* - * Setting A_IOCFG_DISABLE_ANALOG will do opposite things + * Setting EMU_A_IOCFG_DISABLE_ANALOG will do opposite things * on diffrerent cards. * "don't disable analog outs" on Audigy 2 (ca0102/ca0108) * "disable analog outs" on Audigy (emu10k2) */ - a_iocfg |= A_IOCFG_DISABLE_ANALOG; + a_iocfg |= EMU_A_IOCFG_DISABLE_ANALOG; if (sc->is_ca0108) a_iocfg |= 0x20; /* XXX */ @@ -2492,12 +2503,12 @@ emumix_set_mode(struct emu_sc_info *sc, if (mode == MODE_DIGITAL) emumix_set_gpr(sc, sc->mute_gpr[ANALOGMUTE], 1); - emu_wr(sc, HCFG, hcfg, 4); + emu_wr(sc, EMU_HCFG, hcfg, 4); if ((sc->is_emu10k2) || (sc->is_ca0102) || (sc->is_ca0108)) { - tmp = emu_rd(sc, A_IOCFG, 2); + tmp = emu_rd(sc, EMU_A_IOCFG, 2); tmp = a_iocfg; - emu_wr(sc, A_IOCFG, tmp, 2); + emu_wr(sc, EMU_A_IOCFG, tmp, 2); } /* Unmute if we have changed mode to analog. */ @@ -2523,16 +2534,16 @@ emumix_set_spdif_mode(struct emu_sc_info return; } - spcs = SPCS_CLKACCY_1000PPM | SPCS_SAMPLERATE_48 | - SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC | - SPCS_GENERATIONSTATUS | 0x00001200 | 0x00000000 | - SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT; + spcs = EMU_SPCS_CLKACCY_1000PPM | EMU_SPCS_SAMPLERATE_48 | + EMU_SPCS_CHANNELNUM_LEFT | EMU_SPCS_SOURCENUM_UNSPEC | + EMU_SPCS_GENERATIONSTATUS | 0x00001200 | 0x00000000 | + EMU_SPCS_EMPHASIS_NONE | EMU_SPCS_COPYRIGHT; mode = SPDIF_MODE_PCM; - emu_wrptr(sc, 0, SPCS0, spcs); - emu_wrptr(sc, 0, SPCS1, spcs); - emu_wrptr(sc, 0, SPCS2, spcs); + emu_wrptr(sc, 0, EMU_SPCS0, spcs); + emu_wrptr(sc, 0, EMU_SPCS1, spcs); + emu_wrptr(sc, 0, EMU_SPCS2, spcs); } #define L2L_POINTS 10 @@ -2635,8 +2646,8 @@ emu_cardbus_init(struct emu_sc_info *sc) { /* - * XXX May not need this if we have IPR3 handler. - * Is it a real init calls, or IPR3 interrupt acknowledgments? + * XXX May not need this if we have EMU_IPR3 handler. + * Is it a real init calls, or EMU_IPR3 interrupt acknowledgments? * Looks much like "(data << 16) | register". */ emu_wr_cbptr(sc, (0x00d0 << 16) | 0x0000); @@ -2660,42 +2671,42 @@ emu_init(struct emu_sc_info *sc) int i; /* disable audio and lock cache */ - emu_wr(sc, HCFG, HCFG_LOCKSOUNDCACHE | HCFG_LOCKTANKCACHE_MASK | HCFG_MUTEBUTTONENABLE, 4); + emu_wr(sc, EMU_HCFG, EMU_HCFG_LOCKSOUNDCACHE | EMU_HCFG_LOCKTANKCACHE_MASK | EMU_HCFG_MUTEBUTTONENABLE, 4); /* reset recording buffers */ - emu_wrptr(sc, 0, MICBS, ADCBS_BUFSIZE_NONE); - emu_wrptr(sc, 0, MICBA, 0); - emu_wrptr(sc, 0, FXBS, ADCBS_BUFSIZE_NONE); - emu_wrptr(sc, 0, FXBA, 0); - emu_wrptr(sc, 0, ADCBS, ADCBS_BUFSIZE_NONE); - emu_wrptr(sc, 0, ADCBA, 0); + emu_wrptr(sc, 0, EMU_MICBS, EMU_RECBS_BUFSIZE_NONE); + emu_wrptr(sc, 0, EMU_MICBA, 0); + emu_wrptr(sc, 0, EMU_FXBS, EMU_RECBS_BUFSIZE_NONE); + emu_wrptr(sc, 0, EMU_FXBA, 0); + emu_wrptr(sc, 0, EMU_ADCBS, EMU_RECBS_BUFSIZE_NONE); + emu_wrptr(sc, 0, EMU_ADCBA, 0); /* disable channel interrupt */ - emu_wr(sc, INTE, INTE_INTERVALTIMERENB | INTE_SAMPLERATETRACKER | INTE_PCIERRORENABLE, 4); - emu_wrptr(sc, 0, CLIEL, 0); - emu_wrptr(sc, 0, CLIEH, 0); - emu_wrptr(sc, 0, SOLEL, 0); - emu_wrptr(sc, 0, SOLEH, 0); + emu_wr(sc, EMU_INTE, EMU_INTE_INTERTIMERENB | EMU_INTE_SAMPLERATER | EMU_INTE_PCIERRENABLE, 4); + emu_wrptr(sc, 0, EMU_CLIEL, 0); + emu_wrptr(sc, 0, EMU_CLIEH, 0); + emu_wrptr(sc, 0, EMU_SOLEL, 0); + emu_wrptr(sc, 0, EMU_SOLEH, 0); /* disable P16V and S/PDIF interrupts */ if ((sc->is_ca0102) || (sc->is_ca0108)) - emu_wr(sc, INTE2, 0, 4); + emu_wr(sc, EMU_INTE2, 0, 4); if (sc->is_ca0102) - emu_wr(sc, INTE3, 0, 4); + emu_wr(sc, EMU_INTE3, 0, 4); /* init phys inputs and outputs */ ac97slot = 0; if (sc->has_51) - ac97slot = AC97SLOT_CNTR | AC97SLOT_LFE; + ac97slot = EMU_AC97SLOT_CENTER | EMU_AC97SLOT_LFE; if (sc->has_71) - ac97slot = AC97SLOT_CNTR | AC97SLOT_LFE | AC97SLOT_REAR_LEFT | AC97SLOT_REAR_RIGHT; + ac97slot = EMU_AC97SLOT_CENTER | EMU_AC97SLOT_LFE | EMU_AC97SLOT_REAR_LEFT | EMU_AC97SLOT_REAR_RIGHT; if (sc->is_emu10k2) ac97slot |= 0x40; - emu_wrptr(sc, 0, AC97SLOT, ac97slot); + emu_wrptr(sc, 0, EMU_AC97SLOT, ac97slot); if (sc->is_emu10k2) /* XXX for later cards? */ - emu_wrptr(sc, 0, SPBYPASS, 0xf00); /* What will happen if + emu_wrptr(sc, 0, EMU_SPBYPASS, 0xf00); /* What will happen if * we write 1 here? */ if (bus_dma_tag_create( /* parent */ bus_get_dma_tag(sc->dev), @@ -2729,61 +2740,61 @@ emu_init(struct emu_sc_info *sc) sc->mem.ptb_pages[i] = tmp | i; for (ch = 0; ch < NUM_G; ch++) { - emu_wrptr(sc, ch, MAPA, tmp | MAP_PTI_MASK); - emu_wrptr(sc, ch, MAPB, tmp | MAP_PTI_MASK); + emu_wrptr(sc, ch, EMU_CHAN_MAPA, tmp | EMU_CHAN_MAP_PTI_MASK); + emu_wrptr(sc, ch, EMU_CHAN_MAPB, tmp | EMU_CHAN_MAP_PTI_MASK); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 21:25:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3559D106566C; Wed, 11 Jan 2012 21:25:43 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1FC658FC0C; Wed, 11 Jan 2012 21:25: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 q0BLPhaI077377; Wed, 11 Jan 2012 21:25:43 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0BLPg52077324; Wed, 11 Jan 2012 21:25:42 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201201112125.q0BLPg52077324@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 11 Jan 2012 21:25:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229982 - in vendor-sys/acpica/dist: . common compiler debugger disassembler dispatcher events executer generate/unix generate/unix/acpiexec generate/unix/acpinames generate/unix/iasl h... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 21:25:43 -0000 Author: jkim Date: Wed Jan 11 21:25:42 2012 New Revision: 229982 URL: http://svn.freebsd.org/changeset/base/229982 Log: Import ACPICA 20120111. Added: vendor-sys/acpica/dist/utilities/utaddress.c (contents, props changed) Modified: vendor-sys/acpica/dist/changes.txt vendor-sys/acpica/dist/common/adfile.c vendor-sys/acpica/dist/common/adisasm.c vendor-sys/acpica/dist/common/adwalk.c vendor-sys/acpica/dist/common/dmextern.c vendor-sys/acpica/dist/common/dmrestag.c vendor-sys/acpica/dist/common/dmtable.c vendor-sys/acpica/dist/common/dmtbdump.c vendor-sys/acpica/dist/common/dmtbinfo.c vendor-sys/acpica/dist/common/getopt.c vendor-sys/acpica/dist/compiler/Makefile vendor-sys/acpica/dist/compiler/aslanalyze.c vendor-sys/acpica/dist/compiler/aslbtypes.c vendor-sys/acpica/dist/compiler/aslcodegen.c vendor-sys/acpica/dist/compiler/aslcompile.c vendor-sys/acpica/dist/compiler/aslcompiler.h vendor-sys/acpica/dist/compiler/aslcompiler.l vendor-sys/acpica/dist/compiler/aslcompiler.y vendor-sys/acpica/dist/compiler/asldefine.h vendor-sys/acpica/dist/compiler/aslerror.c vendor-sys/acpica/dist/compiler/aslfiles.c vendor-sys/acpica/dist/compiler/aslfold.c vendor-sys/acpica/dist/compiler/aslglobal.h vendor-sys/acpica/dist/compiler/asllength.c vendor-sys/acpica/dist/compiler/asllisting.c vendor-sys/acpica/dist/compiler/aslload.c vendor-sys/acpica/dist/compiler/asllookup.c vendor-sys/acpica/dist/compiler/aslmain.c vendor-sys/acpica/dist/compiler/aslmap.c vendor-sys/acpica/dist/compiler/aslmessages.h vendor-sys/acpica/dist/compiler/aslopcodes.c vendor-sys/acpica/dist/compiler/asloperands.c vendor-sys/acpica/dist/compiler/aslopt.c vendor-sys/acpica/dist/compiler/aslpredef.c vendor-sys/acpica/dist/compiler/aslresource.c vendor-sys/acpica/dist/compiler/aslrestype1.c vendor-sys/acpica/dist/compiler/aslrestype1i.c vendor-sys/acpica/dist/compiler/aslrestype2.c vendor-sys/acpica/dist/compiler/aslrestype2d.c vendor-sys/acpica/dist/compiler/aslrestype2e.c vendor-sys/acpica/dist/compiler/aslrestype2q.c vendor-sys/acpica/dist/compiler/aslrestype2s.c vendor-sys/acpica/dist/compiler/aslrestype2w.c vendor-sys/acpica/dist/compiler/aslstartup.c vendor-sys/acpica/dist/compiler/aslstubs.c vendor-sys/acpica/dist/compiler/asltransform.c vendor-sys/acpica/dist/compiler/asltree.c vendor-sys/acpica/dist/compiler/asltypes.h vendor-sys/acpica/dist/compiler/aslutils.c vendor-sys/acpica/dist/compiler/asluuid.c vendor-sys/acpica/dist/compiler/aslwalks.c vendor-sys/acpica/dist/compiler/dtcompile.c vendor-sys/acpica/dist/compiler/dtcompiler.h vendor-sys/acpica/dist/compiler/dtexpress.c vendor-sys/acpica/dist/compiler/dtfield.c vendor-sys/acpica/dist/compiler/dtio.c vendor-sys/acpica/dist/compiler/dtparser.l vendor-sys/acpica/dist/compiler/dtparser.y vendor-sys/acpica/dist/compiler/dtsubtable.c vendor-sys/acpica/dist/compiler/dttable.c vendor-sys/acpica/dist/compiler/dttemplate.c vendor-sys/acpica/dist/compiler/dttemplate.h vendor-sys/acpica/dist/compiler/dtutils.c vendor-sys/acpica/dist/debugger/dbcmds.c vendor-sys/acpica/dist/debugger/dbdisply.c vendor-sys/acpica/dist/debugger/dbexec.c vendor-sys/acpica/dist/debugger/dbfileio.c vendor-sys/acpica/dist/debugger/dbhistry.c vendor-sys/acpica/dist/debugger/dbinput.c vendor-sys/acpica/dist/debugger/dbmethod.c vendor-sys/acpica/dist/debugger/dbnames.c vendor-sys/acpica/dist/debugger/dbstats.c vendor-sys/acpica/dist/debugger/dbutils.c vendor-sys/acpica/dist/debugger/dbxface.c vendor-sys/acpica/dist/disassembler/dmbuffer.c vendor-sys/acpica/dist/disassembler/dmnames.c vendor-sys/acpica/dist/disassembler/dmobject.c vendor-sys/acpica/dist/disassembler/dmopcode.c vendor-sys/acpica/dist/disassembler/dmresrc.c vendor-sys/acpica/dist/disassembler/dmresrcl.c vendor-sys/acpica/dist/disassembler/dmresrcl2.c vendor-sys/acpica/dist/disassembler/dmresrcs.c vendor-sys/acpica/dist/disassembler/dmutils.c vendor-sys/acpica/dist/disassembler/dmwalk.c vendor-sys/acpica/dist/dispatcher/dsargs.c vendor-sys/acpica/dist/dispatcher/dscontrol.c vendor-sys/acpica/dist/dispatcher/dsfield.c vendor-sys/acpica/dist/dispatcher/dsinit.c vendor-sys/acpica/dist/dispatcher/dsmethod.c vendor-sys/acpica/dist/dispatcher/dsmthdat.c vendor-sys/acpica/dist/dispatcher/dsobject.c vendor-sys/acpica/dist/dispatcher/dsopcode.c vendor-sys/acpica/dist/dispatcher/dsutils.c vendor-sys/acpica/dist/dispatcher/dswexec.c vendor-sys/acpica/dist/dispatcher/dswload.c vendor-sys/acpica/dist/dispatcher/dswload2.c vendor-sys/acpica/dist/dispatcher/dswscope.c vendor-sys/acpica/dist/dispatcher/dswstate.c vendor-sys/acpica/dist/events/evevent.c vendor-sys/acpica/dist/events/evglock.c vendor-sys/acpica/dist/events/evgpe.c vendor-sys/acpica/dist/events/evgpeblk.c vendor-sys/acpica/dist/events/evgpeinit.c vendor-sys/acpica/dist/events/evgpeutil.c vendor-sys/acpica/dist/events/evmisc.c vendor-sys/acpica/dist/events/evregion.c vendor-sys/acpica/dist/events/evrgnini.c vendor-sys/acpica/dist/events/evsci.c vendor-sys/acpica/dist/events/evxface.c vendor-sys/acpica/dist/events/evxfevnt.c vendor-sys/acpica/dist/events/evxfgpe.c vendor-sys/acpica/dist/events/evxfregn.c vendor-sys/acpica/dist/executer/exconfig.c vendor-sys/acpica/dist/executer/exconvrt.c vendor-sys/acpica/dist/executer/excreate.c vendor-sys/acpica/dist/executer/exdebug.c vendor-sys/acpica/dist/executer/exdump.c vendor-sys/acpica/dist/executer/exfield.c vendor-sys/acpica/dist/executer/exfldio.c vendor-sys/acpica/dist/executer/exmisc.c vendor-sys/acpica/dist/executer/exmutex.c vendor-sys/acpica/dist/executer/exnames.c vendor-sys/acpica/dist/executer/exoparg1.c vendor-sys/acpica/dist/executer/exoparg2.c vendor-sys/acpica/dist/executer/exoparg3.c vendor-sys/acpica/dist/executer/exoparg6.c vendor-sys/acpica/dist/executer/exprep.c vendor-sys/acpica/dist/executer/exregion.c vendor-sys/acpica/dist/executer/exresnte.c vendor-sys/acpica/dist/executer/exresolv.c vendor-sys/acpica/dist/executer/exresop.c vendor-sys/acpica/dist/executer/exstore.c vendor-sys/acpica/dist/executer/exstoren.c vendor-sys/acpica/dist/executer/exstorob.c vendor-sys/acpica/dist/executer/exsystem.c vendor-sys/acpica/dist/executer/exutils.c vendor-sys/acpica/dist/generate/unix/Makefile vendor-sys/acpica/dist/generate/unix/acpiexec/Makefile vendor-sys/acpica/dist/generate/unix/acpinames/Makefile vendor-sys/acpica/dist/generate/unix/iasl/Makefile vendor-sys/acpica/dist/hardware/hwacpi.c vendor-sys/acpica/dist/hardware/hwgpe.c vendor-sys/acpica/dist/hardware/hwpci.c vendor-sys/acpica/dist/hardware/hwregs.c vendor-sys/acpica/dist/hardware/hwsleep.c vendor-sys/acpica/dist/hardware/hwtimer.c vendor-sys/acpica/dist/hardware/hwvalid.c vendor-sys/acpica/dist/hardware/hwxface.c vendor-sys/acpica/dist/include/acapps.h vendor-sys/acpica/dist/include/accommon.h vendor-sys/acpica/dist/include/acconfig.h vendor-sys/acpica/dist/include/acdebug.h vendor-sys/acpica/dist/include/acdisasm.h vendor-sys/acpica/dist/include/acdispat.h vendor-sys/acpica/dist/include/acevents.h vendor-sys/acpica/dist/include/acexcep.h vendor-sys/acpica/dist/include/acglobal.h vendor-sys/acpica/dist/include/achware.h vendor-sys/acpica/dist/include/acinterp.h vendor-sys/acpica/dist/include/aclocal.h vendor-sys/acpica/dist/include/acmacros.h vendor-sys/acpica/dist/include/acnames.h vendor-sys/acpica/dist/include/acnamesp.h vendor-sys/acpica/dist/include/acobject.h vendor-sys/acpica/dist/include/acopcode.h vendor-sys/acpica/dist/include/acoutput.h vendor-sys/acpica/dist/include/acparser.h vendor-sys/acpica/dist/include/acpi.h vendor-sys/acpica/dist/include/acpiosxf.h vendor-sys/acpica/dist/include/acpixf.h vendor-sys/acpica/dist/include/acpredef.h vendor-sys/acpica/dist/include/acresrc.h vendor-sys/acpica/dist/include/acrestyp.h vendor-sys/acpica/dist/include/acstruct.h vendor-sys/acpica/dist/include/actables.h vendor-sys/acpica/dist/include/actbl.h vendor-sys/acpica/dist/include/actbl1.h vendor-sys/acpica/dist/include/actbl2.h vendor-sys/acpica/dist/include/actbl3.h vendor-sys/acpica/dist/include/actypes.h vendor-sys/acpica/dist/include/acutils.h vendor-sys/acpica/dist/include/amlcode.h vendor-sys/acpica/dist/include/amlresrc.h vendor-sys/acpica/dist/include/platform/accygwin.h vendor-sys/acpica/dist/include/platform/acefi.h vendor-sys/acpica/dist/include/platform/acenv.h vendor-sys/acpica/dist/include/platform/acfreebsd.h vendor-sys/acpica/dist/include/platform/acgcc.h vendor-sys/acpica/dist/include/platform/acintel.h vendor-sys/acpica/dist/include/platform/aclinux.h vendor-sys/acpica/dist/include/platform/acmsvc.h vendor-sys/acpica/dist/include/platform/acnetbsd.h vendor-sys/acpica/dist/include/platform/acos2.h vendor-sys/acpica/dist/include/platform/acwin.h vendor-sys/acpica/dist/include/platform/acwin64.h vendor-sys/acpica/dist/namespace/nsaccess.c vendor-sys/acpica/dist/namespace/nsalloc.c vendor-sys/acpica/dist/namespace/nsdump.c vendor-sys/acpica/dist/namespace/nsdumpdv.c vendor-sys/acpica/dist/namespace/nseval.c vendor-sys/acpica/dist/namespace/nsinit.c vendor-sys/acpica/dist/namespace/nsload.c vendor-sys/acpica/dist/namespace/nsnames.c vendor-sys/acpica/dist/namespace/nsobject.c vendor-sys/acpica/dist/namespace/nsparse.c vendor-sys/acpica/dist/namespace/nspredef.c vendor-sys/acpica/dist/namespace/nsrepair.c vendor-sys/acpica/dist/namespace/nsrepair2.c vendor-sys/acpica/dist/namespace/nssearch.c vendor-sys/acpica/dist/namespace/nsutils.c vendor-sys/acpica/dist/namespace/nswalk.c vendor-sys/acpica/dist/namespace/nsxfeval.c vendor-sys/acpica/dist/namespace/nsxfname.c vendor-sys/acpica/dist/namespace/nsxfobj.c vendor-sys/acpica/dist/os_specific/service_layers/osunixdir.c vendor-sys/acpica/dist/os_specific/service_layers/osunixxf.c vendor-sys/acpica/dist/os_specific/service_layers/oswindir.c vendor-sys/acpica/dist/os_specific/service_layers/oswintbl.c vendor-sys/acpica/dist/os_specific/service_layers/oswinxf.c vendor-sys/acpica/dist/parser/psargs.c vendor-sys/acpica/dist/parser/psloop.c vendor-sys/acpica/dist/parser/psopcode.c vendor-sys/acpica/dist/parser/psparse.c vendor-sys/acpica/dist/parser/psscope.c vendor-sys/acpica/dist/parser/pstree.c vendor-sys/acpica/dist/parser/psutils.c vendor-sys/acpica/dist/parser/pswalk.c vendor-sys/acpica/dist/parser/psxface.c vendor-sys/acpica/dist/resources/rsaddr.c vendor-sys/acpica/dist/resources/rscalc.c vendor-sys/acpica/dist/resources/rscreate.c vendor-sys/acpica/dist/resources/rsdump.c vendor-sys/acpica/dist/resources/rsinfo.c vendor-sys/acpica/dist/resources/rsio.c vendor-sys/acpica/dist/resources/rsirq.c vendor-sys/acpica/dist/resources/rslist.c vendor-sys/acpica/dist/resources/rsmemory.c vendor-sys/acpica/dist/resources/rsmisc.c vendor-sys/acpica/dist/resources/rsserial.c vendor-sys/acpica/dist/resources/rsutils.c vendor-sys/acpica/dist/resources/rsxface.c vendor-sys/acpica/dist/tables/tbfadt.c vendor-sys/acpica/dist/tables/tbfind.c vendor-sys/acpica/dist/tables/tbinstal.c vendor-sys/acpica/dist/tables/tbutils.c vendor-sys/acpica/dist/tables/tbxface.c vendor-sys/acpica/dist/tables/tbxfroot.c vendor-sys/acpica/dist/tests/misc/grammar.asl vendor-sys/acpica/dist/tools/acpibin/abcompare.c vendor-sys/acpica/dist/tools/acpibin/abmain.c vendor-sys/acpica/dist/tools/acpibin/acpibin.h vendor-sys/acpica/dist/tools/acpiexec/Makefile vendor-sys/acpica/dist/tools/acpiexec/aecommon.h vendor-sys/acpica/dist/tools/acpiexec/aeexec.c vendor-sys/acpica/dist/tools/acpiexec/aehandlers.c vendor-sys/acpica/dist/tools/acpiexec/aemain.c vendor-sys/acpica/dist/tools/acpiexec/aetables.c vendor-sys/acpica/dist/tools/acpiexec/aetables.h vendor-sys/acpica/dist/tools/acpihelp/acpihelp.h vendor-sys/acpica/dist/tools/acpihelp/ahamlops.c vendor-sys/acpica/dist/tools/acpihelp/ahaslkey.c vendor-sys/acpica/dist/tools/acpihelp/ahaslops.c vendor-sys/acpica/dist/tools/acpihelp/ahdecode.c vendor-sys/acpica/dist/tools/acpihelp/ahmain.c vendor-sys/acpica/dist/tools/acpihelp/ahpredef.c vendor-sys/acpica/dist/tools/acpinames/Makefile vendor-sys/acpica/dist/tools/acpinames/acpinames.h vendor-sys/acpica/dist/tools/acpinames/anmain.c vendor-sys/acpica/dist/tools/acpinames/anstubs.c vendor-sys/acpica/dist/tools/acpinames/antables.c vendor-sys/acpica/dist/tools/acpisrc/acpisrc.h vendor-sys/acpica/dist/tools/acpisrc/ascase.c vendor-sys/acpica/dist/tools/acpisrc/asconvrt.c vendor-sys/acpica/dist/tools/acpisrc/asfile.c vendor-sys/acpica/dist/tools/acpisrc/asmain.c vendor-sys/acpica/dist/tools/acpisrc/asremove.c vendor-sys/acpica/dist/tools/acpisrc/astable.c vendor-sys/acpica/dist/tools/acpisrc/asutils.c vendor-sys/acpica/dist/tools/acpixtract/acpixtract.c vendor-sys/acpica/dist/tools/acpixtract/axmain.c vendor-sys/acpica/dist/tools/examples/examples.c vendor-sys/acpica/dist/utilities/utalloc.c vendor-sys/acpica/dist/utilities/utcache.c vendor-sys/acpica/dist/utilities/utclib.c vendor-sys/acpica/dist/utilities/utcopy.c vendor-sys/acpica/dist/utilities/utdebug.c vendor-sys/acpica/dist/utilities/utdecode.c vendor-sys/acpica/dist/utilities/utdelete.c vendor-sys/acpica/dist/utilities/uteval.c vendor-sys/acpica/dist/utilities/utglobal.c vendor-sys/acpica/dist/utilities/utids.c vendor-sys/acpica/dist/utilities/utinit.c vendor-sys/acpica/dist/utilities/utlock.c vendor-sys/acpica/dist/utilities/utmath.c vendor-sys/acpica/dist/utilities/utmisc.c vendor-sys/acpica/dist/utilities/utmutex.c vendor-sys/acpica/dist/utilities/utobject.c vendor-sys/acpica/dist/utilities/utosi.c vendor-sys/acpica/dist/utilities/utresrc.c vendor-sys/acpica/dist/utilities/utstate.c vendor-sys/acpica/dist/utilities/uttrack.c vendor-sys/acpica/dist/utilities/utxface.c vendor-sys/acpica/dist/utilities/utxferror.c vendor-sys/acpica/dist/utilities/utxfmutex.c Modified: vendor-sys/acpica/dist/changes.txt ============================================================================== --- vendor-sys/acpica/dist/changes.txt Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/changes.txt Wed Jan 11 21:25:42 2012 (r229982) @@ -1,8 +1,56 @@ ---------------------------------------- -23 November 2011. Summary of changes for version 20111123: +11 January 2012. Summary of changes for version 20120111: + +This release is available at www.acpica.org/downloads. +The ACPI 5.0 specification is available at www.acpi.info. + +1) ACPICA Core Subsystem: + +Implemented a new mechanism to allow host device drivers to check for address +range conflicts with ACPI Operation Regions. Both SystemMemory and SystemIO +address spaces are supported. A new external interface, AcpiCheckAddressRange, +allows drivers to check an address range against the ACPI namespace. See the +ACPICA reference for additional details. Adds one new file, +utilities/utaddress.c. Lin Ming, Bob Moore. + +Fixed several issues with the ACPI 5.0 FADT support: Add the sleep Control and +Status registers, update the ACPI 5.0 flags, and update internal data +structures to handle an FADT larger than 256 bytes. The size of the ACPI 5.0 +FADT is 268 bytes. + +Updated all ACPICA copyrights and signons to 2012. Added the 2012 copyright to +all module headers and signons, including the standard Linux header. This +affects virtually every file in the ACPICA core subsystem, iASL compiler, and +all ACPICA utilities. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The debug +version of the code includes the debug output trace mechanism and has a much +larger code and data size. + + Previous Release: + Non-Debug Version: 92.3K Code, 24.9K Data, 117.2K Total + Debug Version: 170.8K Code, 72.6K Data, 243.4K Total + Current Release: + Non-Debug Version: 92.8K Code, 24.9K Data, 117.7K Total + Debug Version: 171.7K Code, 72.9K Data, 244.5K Total + -This release is available at www.acpica.org/downloads -The ACPI 5.0 specification is available at www.acpi.info +2) iASL Compiler/Disassembler and Tools: + +Disassembler: fixed a problem with the automatic resource tag generation +support. Fixes a problem where the resource tags are inadvertently not +constructed if the table being disassembled contains external references to +control methods. Moved the actual construction of the tags to after the final +namespace is constructed (after 2nd parse is invoked due to external control +method references.) ACPICA BZ 941. + +Table Compiler: Make all "generic" operators caseless. These are the operators +like UINT8, String, etc. Making these caseless improves ease-of-use. ACPICA BZ +934. + +---------------------------------------- +23 November 2011. Summary of changes for version 20111123: 0) ACPI 5.0 Support: Modified: vendor-sys/acpica/dist/common/adfile.c ============================================================================== --- vendor-sys/acpica/dist/common/adfile.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/common/adfile.c Wed Jan 11 21:25:42 2012 (r229982) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/common/adisasm.c ============================================================================== --- vendor-sys/acpica/dist/common/adisasm.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/common/adisasm.c Wed Jan 11 21:25:42 2012 (r229982) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -376,7 +376,8 @@ AdAmlDisassemble ( AdDisassemblerHeader (Filename); AcpiOsPrintf (" * ACPI Data Table [%4.4s]\n *\n", Table->Signature); - AcpiOsPrintf (" * Format: [HexOffset DecimalOffset ByteLength] FieldName : FieldValue\n */\n\n"); + AcpiOsPrintf (" * Format: [HexOffset DecimalOffset ByteLength] " + "FieldName : FieldValue\n */\n\n"); AcpiDmDumpDataTable (Table); fprintf (stderr, "Acpi Data Table [%4.4s] decoded, written to \"%s\"\n", @@ -403,15 +404,17 @@ AdAmlDisassemble ( AcpiOsPrintf ("*****/\n"); } - /* - * Load namespace from names created within control methods - */ - AcpiDmFinishNamespaceLoad (AcpiGbl_ParseOpRoot, AcpiGbl_RootNode, OwnerId); + /* Load namespace from names created within control methods */ + + AcpiDmFinishNamespaceLoad (AcpiGbl_ParseOpRoot, + AcpiGbl_RootNode, OwnerId); /* - * Cross reference the namespace here, in order to generate External() statements + * Cross reference the namespace here, in order to + * generate External() statements */ - AcpiDmCrossReferenceNamespace (AcpiGbl_ParseOpRoot, AcpiGbl_RootNode, OwnerId); + AcpiDmCrossReferenceNamespace (AcpiGbl_ParseOpRoot, + AcpiGbl_RootNode, OwnerId); if (AslCompilerdebug) { @@ -422,24 +425,20 @@ AdAmlDisassemble ( AcpiDmFindOrphanMethods (AcpiGbl_ParseOpRoot); - /* Convert fixed-offset references to resource descriptors to symbolic references */ - - AcpiDmConvertResourceIndexes (AcpiGbl_ParseOpRoot, AcpiGbl_RootNode); - /* - * If we found any external control methods, we must reparse the entire - * tree with the new information (namely, the number of arguments per - * method) + * If we found any external control methods, we must reparse + * the entire tree with the new information (namely, the + * number of arguments per method) */ if (AcpiDmGetExternalMethodCount ()) { fprintf (stderr, - "\nFound %u external control methods, reparsing with new information\n", + "\nFound %u external control methods, " + "reparsing with new information\n", AcpiDmGetExternalMethodCount ()); - /* - * Reparse, rebuild namespace. no need to xref namespace - */ + /* Reparse, rebuild namespace. no need to xref namespace */ + AcpiPsDeleteParseTree (AcpiGbl_ParseOpRoot); AcpiNsDeleteNamespaceSubtree (AcpiGbl_RootNode); @@ -456,7 +455,7 @@ AdAmlDisassemble ( Status = AcpiNsRootInitialize (); AcpiDmAddExternalsToNamespace (); - /* Parse table. No need to reload it, however (FALSE) */ + /* Parse the table again. No need to reload it, however */ Status = AdParseTable (Table, NULL, FALSE, FALSE); if (ACPI_FAILURE (Status)) @@ -477,6 +476,15 @@ AdAmlDisassemble ( } } + /* + * Now that the namespace is finalized, we can perform namespace + * transforms. + * + * 1) Convert fixed-offset references to resource descriptors + * to symbolic references (Note: modifies namespace) + */ + AcpiDmConvertResourceIndexes (AcpiGbl_ParseOpRoot, AcpiGbl_RootNode); + /* Optional displays */ if (AcpiGbl_DbOpt_disasm) @@ -502,11 +510,12 @@ Cleanup: if (OutToFile && File) { + if (AslCompilerdebug) /* Display final namespace, with transforms */ + { + LsSetupNsList (File); + LsDisplayNamespace (); + } -#ifdef ASL_DISASM_DEBUG - LsSetupNsList (File); - LsDisplayNamespace (); -#endif fclose (File); AcpiOsRedirectOutput (stdout); } Modified: vendor-sys/acpica/dist/common/adwalk.c ============================================================================== --- vendor-sys/acpica/dist/common/adwalk.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/common/adwalk.c Wed Jan 11 21:25:42 2012 (r229982) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/common/dmextern.c ============================================================================== --- vendor-sys/acpica/dist/common/dmextern.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/common/dmextern.c Wed Jan 11 21:25:42 2012 (r229982) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/common/dmrestag.c ============================================================================== --- vendor-sys/acpica/dist/common/dmrestag.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/common/dmrestag.c Wed Jan 11 21:25:42 2012 (r229982) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/common/dmtable.c ============================================================================== --- vendor-sys/acpica/dist/common/dmtable.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/common/dmtable.c Wed Jan 11 21:25:42 2012 (r229982) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -232,7 +232,7 @@ static const char *AcpiDmIvrsS }; -#define ACPI_FADT_PM_RESERVED 8 +#define ACPI_FADT_PM_RESERVED 9 static const char *AcpiDmFadtProfiles[] = { @@ -244,6 +244,7 @@ static const char *AcpiDmFadtP "SOHO Server", "Appliance PC", "Performance Server", + "Tablet", "Unknown Profile Type" }; Modified: vendor-sys/acpica/dist/common/dmtbdump.c ============================================================================== --- vendor-sys/acpica/dist/common/dmtbdump.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/common/dmtbdump.c Wed Jan 11 21:25:42 2012 (r229982) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/common/dmtbinfo.c ============================================================================== --- vendor-sys/acpica/dist/common/dmtbinfo.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/common/dmtbinfo.c Wed Jan 11 21:25:42 2012 (r229982) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -78,123 +78,123 @@ /* * Macros used to generate offsets to specific table fields */ -#define ACPI_FACS_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_FACS,f) -#define ACPI_GAS_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_GENERIC_ADDRESS,f) -#define ACPI_HDR_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_HEADER,f) -#define ACPI_RSDP_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_RSDP,f) -#define ACPI_BERT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_BERT,f) -#define ACPI_BGRT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_BGRT,f) -#define ACPI_BOOT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_BOOT,f) -#define ACPI_CPEP_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_CPEP,f) -#define ACPI_DBGP_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_DBGP,f) -#define ACPI_DMAR_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_DMAR,f) -#define ACPI_DRTM_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_DRTM,f) -#define ACPI_ECDT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_ECDT,f) -#define ACPI_EINJ_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_EINJ,f) -#define ACPI_ERST_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_ERST,f) -#define ACPI_GTDT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_GTDT,f) -#define ACPI_HEST_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_HEST,f) -#define ACPI_HPET_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_HPET,f) -#define ACPI_IVRS_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_IVRS,f) -#define ACPI_MADT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_MADT,f) -#define ACPI_MCFG_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_MCFG,f) -#define ACPI_MCHI_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_MCHI,f) -#define ACPI_MPST_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_MPST,f) -#define ACPI_MSCT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_MSCT,f) -#define ACPI_PCCT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_PCCT,f) -#define ACPI_PMTT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_PMTT,f) -#define ACPI_S3PT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_S3PT,f) -#define ACPI_SBST_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_SBST,f) -#define ACPI_SLIT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_SLIT,f) -#define ACPI_SPCR_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_SPCR,f) -#define ACPI_SPMI_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_SPMI,f) -#define ACPI_SRAT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_SRAT,f) -#define ACPI_TCPA_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_TCPA,f) -#define ACPI_UEFI_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_UEFI,f) -#define ACPI_WAET_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_WAET,f) -#define ACPI_WDAT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_WDAT,f) -#define ACPI_WDDT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_WDDT,f) -#define ACPI_WDRT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_WDRT,f) +#define ACPI_FACS_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_FACS,f) +#define ACPI_GAS_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_GENERIC_ADDRESS,f) +#define ACPI_HDR_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_HEADER,f) +#define ACPI_RSDP_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_RSDP,f) +#define ACPI_BERT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_BERT,f) +#define ACPI_BGRT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_BGRT,f) +#define ACPI_BOOT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_BOOT,f) +#define ACPI_CPEP_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_CPEP,f) +#define ACPI_DBGP_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_DBGP,f) +#define ACPI_DMAR_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_DMAR,f) +#define ACPI_DRTM_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_DRTM,f) +#define ACPI_ECDT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_ECDT,f) +#define ACPI_EINJ_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_EINJ,f) +#define ACPI_ERST_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_ERST,f) +#define ACPI_GTDT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_GTDT,f) +#define ACPI_HEST_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_HEST,f) +#define ACPI_HPET_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_HPET,f) +#define ACPI_IVRS_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_IVRS,f) +#define ACPI_MADT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_MADT,f) +#define ACPI_MCFG_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_MCFG,f) +#define ACPI_MCHI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_MCHI,f) +#define ACPI_MPST_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_MPST,f) +#define ACPI_MSCT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_MSCT,f) +#define ACPI_PCCT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_PCCT,f) +#define ACPI_PMTT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_PMTT,f) +#define ACPI_S3PT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_S3PT,f) +#define ACPI_SBST_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SBST,f) +#define ACPI_SLIT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SLIT,f) +#define ACPI_SPCR_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SPCR,f) +#define ACPI_SPMI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SPMI,f) +#define ACPI_SRAT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SRAT,f) +#define ACPI_TCPA_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA,f) +#define ACPI_UEFI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_UEFI,f) +#define ACPI_WAET_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WAET,f) +#define ACPI_WDAT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WDAT,f) +#define ACPI_WDDT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WDDT,f) +#define ACPI_WDRT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WDRT,f) /* Subtables */ -#define ACPI_ASF0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_ASF_INFO,f) -#define ACPI_ASF1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_ASF_ALERT,f) -#define ACPI_ASF1a_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_ASF_ALERT_DATA,f) -#define ACPI_ASF2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_ASF_REMOTE,f) -#define ACPI_ASF2a_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_ASF_CONTROL_DATA,f) -#define ACPI_ASF3_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_ASF_RMCP,f) -#define ACPI_ASF4_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_ASF_ADDRESS,f) -#define ACPI_CPEP0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_CPEP_POLLING,f) -#define ACPI_DMARS_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_DEVICE_SCOPE,f) -#define ACPI_DMAR0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_HARDWARE_UNIT,f) -#define ACPI_DMAR1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_RESERVED_MEMORY,f) -#define ACPI_DMAR2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_ATSR,f) -#define ACPI_DMAR3_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_RHSA,f) -#define ACPI_EINJ0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_WHEA_HEADER,f) -#define ACPI_ERST0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_WHEA_HEADER,f) -#define ACPI_FPDTH_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_FPDT_HEADER,f) -#define ACPI_FPDT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_FPDT_BOOT,f) -#define ACPI_FPDT1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_FPDT_S3PT_PTR,f) -#define ACPI_HEST0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IA_MACHINE_CHECK,f) -#define ACPI_HEST1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IA_CORRECTED,f) -#define ACPI_HEST2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IA_NMI,f) -#define ACPI_HEST6_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_AER_ROOT,f) -#define ACPI_HEST7_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_AER,f) -#define ACPI_HEST8_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_AER_BRIDGE,f) -#define ACPI_HEST9_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_GENERIC,f) -#define ACPI_HESTN_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_NOTIFY,f) -#define ACPI_HESTB_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IA_ERROR_BANK,f) -#define ACPI_IVRSH_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_HEADER,f) -#define ACPI_IVRS0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_HARDWARE,f) -#define ACPI_IVRS1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_MEMORY,f) -#define ACPI_IVRSD_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_DE_HEADER,f) -#define ACPI_IVRS8A_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_DEVICE8A,f) -#define ACPI_IVRS8B_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_DEVICE8B,f) -#define ACPI_IVRS8C_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_DEVICE8C,f) -#define ACPI_MADT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_LOCAL_APIC,f) -#define ACPI_MADT1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_IO_APIC,f) -#define ACPI_MADT2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_INTERRUPT_OVERRIDE,f) -#define ACPI_MADT3_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_NMI_SOURCE,f) -#define ACPI_MADT4_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_LOCAL_APIC_NMI,f) -#define ACPI_MADT5_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_LOCAL_APIC_OVERRIDE,f) -#define ACPI_MADT6_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_IO_SAPIC,f) -#define ACPI_MADT7_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_LOCAL_SAPIC,f) -#define ACPI_MADT8_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_INTERRUPT_SOURCE,f) -#define ACPI_MADT9_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_LOCAL_X2APIC,f) -#define ACPI_MADT10_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_LOCAL_X2APIC_NMI,f) -#define ACPI_MADT11_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_GENERIC_INTERRUPT,f) -#define ACPI_MADT12_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_GENERIC_DISTRIBUTOR,f) -#define ACPI_MADTH_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f) -#define ACPI_MCFG0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MCFG_ALLOCATION,f) -#define ACPI_MPST0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MPST_POWER_NODE,f) -#define ACPI_MPST0A_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MPST_POWER_STATE,f) -#define ACPI_MPST0B_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MPST_COMPONENT,f) -#define ACPI_MPST1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MPST_DATA_HDR,f) -#define ACPI_MPST2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MPST_POWER_DATA,f) -#define ACPI_MSCT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MSCT_PROXIMITY,f) -#define ACPI_PCCT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_PCCT_SUBSPACE,f) -#define ACPI_PMTT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_PMTT_SOCKET,f) -#define ACPI_PMTT1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_PMTT_CONTROLLER,f) -#define ACPI_PMTT1A_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_PMTT_DOMAIN,f) -#define ACPI_PMTT2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_PMTT_PHYSICAL_COMPONENT,f) -#define ACPI_PMTTH_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_PMTT_HEADER,f) -#define ACPI_S3PTH_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_S3PT_HEADER,f) -#define ACPI_S3PT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_S3PT_RESUME,f) -#define ACPI_S3PT1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_S3PT_SUSPEND,f) -#define ACPI_SLICH_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SLIC_HEADER,f) -#define ACPI_SLIC0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SLIC_KEY,f) -#define ACPI_SLIC1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SLIC_MARKER,f) -#define ACPI_SRATH_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f) -#define ACPI_SRAT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SRAT_CPU_AFFINITY,f) -#define ACPI_SRAT1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SRAT_MEM_AFFINITY,f) -#define ACPI_SRAT2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SRAT_X2APIC_CPU_AFFINITY,f) -#define ACPI_WDAT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_WDAT_ENTRY,f) +#define ACPI_ASF0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_INFO,f) +#define ACPI_ASF1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_ALERT,f) +#define ACPI_ASF1a_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_ALERT_DATA,f) +#define ACPI_ASF2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_REMOTE,f) +#define ACPI_ASF2a_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_CONTROL_DATA,f) +#define ACPI_ASF3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_RMCP,f) +#define ACPI_ASF4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_ADDRESS,f) +#define ACPI_CPEP0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CPEP_POLLING,f) +#define ACPI_DMARS_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_DEVICE_SCOPE,f) +#define ACPI_DMAR0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_HARDWARE_UNIT,f) +#define ACPI_DMAR1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_RESERVED_MEMORY,f) +#define ACPI_DMAR2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_ATSR,f) +#define ACPI_DMAR3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_RHSA,f) +#define ACPI_EINJ0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_WHEA_HEADER,f) +#define ACPI_ERST0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_WHEA_HEADER,f) +#define ACPI_FPDTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_FPDT_HEADER,f) +#define ACPI_FPDT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_FPDT_BOOT,f) +#define ACPI_FPDT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_FPDT_S3PT_PTR,f) +#define ACPI_HEST0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_MACHINE_CHECK,f) +#define ACPI_HEST1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_CORRECTED,f) +#define ACPI_HEST2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_NMI,f) +#define ACPI_HEST6_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_AER_ROOT,f) +#define ACPI_HEST7_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_AER,f) +#define ACPI_HEST8_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_AER_BRIDGE,f) +#define ACPI_HEST9_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_GENERIC,f) +#define ACPI_HESTN_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_NOTIFY,f) +#define ACPI_HESTB_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_ERROR_BANK,f) +#define ACPI_IVRSH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_HEADER,f) +#define ACPI_IVRS0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_HARDWARE,f) +#define ACPI_IVRS1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_MEMORY,f) +#define ACPI_IVRSD_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_DE_HEADER,f) +#define ACPI_IVRS8A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_DEVICE8A,f) +#define ACPI_IVRS8B_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_DEVICE8B,f) +#define ACPI_IVRS8C_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_DEVICE8C,f) +#define ACPI_MADT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LOCAL_APIC,f) +#define ACPI_MADT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_IO_APIC,f) +#define ACPI_MADT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_INTERRUPT_OVERRIDE,f) +#define ACPI_MADT3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_NMI_SOURCE,f) +#define ACPI_MADT4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LOCAL_APIC_NMI,f) +#define ACPI_MADT5_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LOCAL_APIC_OVERRIDE,f) +#define ACPI_MADT6_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_IO_SAPIC,f) +#define ACPI_MADT7_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LOCAL_SAPIC,f) +#define ACPI_MADT8_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_INTERRUPT_SOURCE,f) +#define ACPI_MADT9_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LOCAL_X2APIC,f) +#define ACPI_MADT10_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LOCAL_X2APIC_NMI,f) +#define ACPI_MADT11_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_INTERRUPT,f) +#define ACPI_MADT12_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_DISTRIBUTOR,f) +#define ACPI_MADTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f) +#define ACPI_MCFG0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MCFG_ALLOCATION,f) +#define ACPI_MPST0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MPST_POWER_NODE,f) +#define ACPI_MPST0A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MPST_POWER_STATE,f) +#define ACPI_MPST0B_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MPST_COMPONENT,f) +#define ACPI_MPST1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MPST_DATA_HDR,f) +#define ACPI_MPST2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MPST_POWER_DATA,f) +#define ACPI_MSCT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MSCT_PROXIMITY,f) +#define ACPI_PCCT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_SUBSPACE,f) +#define ACPI_PMTT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_SOCKET,f) +#define ACPI_PMTT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_CONTROLLER,f) +#define ACPI_PMTT1A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_DOMAIN,f) +#define ACPI_PMTT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_PHYSICAL_COMPONENT,f) +#define ACPI_PMTTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_HEADER,f) +#define ACPI_S3PTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_S3PT_HEADER,f) +#define ACPI_S3PT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_S3PT_RESUME,f) +#define ACPI_S3PT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_S3PT_SUSPEND,f) +#define ACPI_SLICH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SLIC_HEADER,f) +#define ACPI_SLIC0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SLIC_KEY,f) +#define ACPI_SLIC1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SLIC_MARKER,f) +#define ACPI_SRATH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f) +#define ACPI_SRAT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_CPU_AFFINITY,f) +#define ACPI_SRAT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_MEM_AFFINITY,f) +#define ACPI_SRAT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_X2APIC_CPU_AFFINITY,f) +#define ACPI_WDAT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_WDAT_ENTRY,f) /* * Simplify access to flag fields by breaking them up into bytes */ -#define ACPI_FLAG_OFFSET(d,f,o) (UINT8) (ACPI_OFFSET (d,f) + o) +#define ACPI_FLAG_OFFSET(d,f,o) (UINT16) (ACPI_OFFSET (d,f) + o) /* Flags */ @@ -384,6 +384,7 @@ ACPI_DMTABLE_INFO AcpiDmTableI {ACPI_DMT_FLAG2, ACPI_FADT_FLAG_OFFSET (BootFlags,0), "VGA Not Present (V4)", 0}, {ACPI_DMT_FLAG3, ACPI_FADT_FLAG_OFFSET (BootFlags,0), "MSI Not Supported (V4)", 0}, {ACPI_DMT_FLAG4, ACPI_FADT_FLAG_OFFSET (BootFlags,0), "PCIe ASPM Not Supported (V4)", 0}, + {ACPI_DMT_FLAG5, ACPI_FADT_FLAG_OFFSET (BootFlags,0), "CMOS RTC Not Present (V5)", 0}, {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_FADT_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, @@ -417,8 +418,7 @@ ACPI_DMTABLE_INFO AcpiDmTableI {ACPI_DMT_FLAG2, ACPI_FADT_FLAG_OFFSET (Flags,2), "Use APIC Cluster Model (V4)", 0}, {ACPI_DMT_FLAG3, ACPI_FADT_FLAG_OFFSET (Flags,2), "Use APIC Physical Destination Mode (V4)", 0}, {ACPI_DMT_FLAG4, ACPI_FADT_FLAG_OFFSET (Flags,2), "Hardware Reduced (V5)", 0}, - {ACPI_DMT_FLAG5, ACPI_FADT_FLAG_OFFSET (Flags,2), "Prefer S0 Idle (V5)", 0}, - {ACPI_DMT_FLAG6, ACPI_FADT_FLAG_OFFSET (Flags,2), "Use Sleep Register (V5)", 0}, + {ACPI_DMT_FLAG5, ACPI_FADT_FLAG_OFFSET (Flags,2), "Low Power S0 Idle (V5)", 0}, ACPI_DMT_TERMINATOR }; @@ -456,7 +456,8 @@ ACPI_DMTABLE_INFO AcpiDmTableI ACPI_DMTABLE_INFO AcpiDmTableInfoFadt5[] = { - {ACPI_DMT_GAS, ACPI_FADT_OFFSET (SleepRegister), "Sleep Register", 0}, + {ACPI_DMT_GAS, ACPI_FADT_OFFSET (SleepControl), "Sleep Control Register", 0}, + {ACPI_DMT_GAS, ACPI_FADT_OFFSET (SleepStatus), "Sleep Status Register", 0}, ACPI_DMT_TERMINATOR }; Modified: vendor-sys/acpica/dist/common/getopt.c ============================================================================== --- vendor-sys/acpica/dist/common/getopt.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/common/getopt.c Wed Jan 11 21:25:42 2012 (r229982) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/Makefile ============================================================================== --- vendor-sys/acpica/dist/compiler/Makefile Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/Makefile Wed Jan 11 21:25:42 2012 (r229982) @@ -185,6 +185,7 @@ OBJECTS = \ tbinstal.o \ tbutils.o \ tbxface.o \ + utaddress.o \ utalloc.o \ utcache.o \ utcopy.o \ Modified: vendor-sys/acpica/dist/compiler/aslanalyze.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslanalyze.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/aslanalyze.c Wed Jan 11 21:25:42 2012 (r229982) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/aslbtypes.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslbtypes.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/aslbtypes.c Wed Jan 11 21:25:42 2012 (r229982) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/aslcodegen.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslcodegen.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/aslcodegen.c Wed Jan 11 21:25:42 2012 (r229982) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/aslcompile.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslcompile.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/aslcompile.c Wed Jan 11 21:25:42 2012 (r229982) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/aslcompiler.h ============================================================================== --- vendor-sys/acpica/dist/compiler/aslcompiler.h Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/aslcompiler.h Wed Jan 11 21:25:42 2012 (r229982) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/aslcompiler.l ============================================================================== --- vendor-sys/acpica/dist/compiler/aslcompiler.l Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/aslcompiler.l Wed Jan 11 21:25:42 2012 (r229982) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/aslcompiler.y ============================================================================== --- vendor-sys/acpica/dist/compiler/aslcompiler.y Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/aslcompiler.y Wed Jan 11 21:25:42 2012 (r229982) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/asldefine.h ============================================================================== --- vendor-sys/acpica/dist/compiler/asldefine.h Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/asldefine.h Wed Jan 11 21:25:42 2012 (r229982) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/aslerror.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslerror.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/aslerror.c Wed Jan 11 21:25:42 2012 (r229982) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/aslfiles.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslfiles.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/aslfiles.c Wed Jan 11 21:25:42 2012 (r229982) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/aslfold.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslfold.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/aslfold.c Wed Jan 11 21:25:42 2012 (r229982) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/aslglobal.h ============================================================================== --- vendor-sys/acpica/dist/compiler/aslglobal.h Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/aslglobal.h Wed Jan 11 21:25:42 2012 (r229982) @@ -7,7 +7,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/asllength.c ============================================================================== --- vendor-sys/acpica/dist/compiler/asllength.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/asllength.c Wed Jan 11 21:25:42 2012 (r229982) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/asllisting.c ============================================================================== --- vendor-sys/acpica/dist/compiler/asllisting.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/asllisting.c Wed Jan 11 21:25:42 2012 (r229982) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/aslload.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslload.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/aslload.c Wed Jan 11 21:25:42 2012 (r229982) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/asllookup.c ============================================================================== --- vendor-sys/acpica/dist/compiler/asllookup.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/asllookup.c Wed Jan 11 21:25:42 2012 (r229982) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/aslmain.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslmain.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/aslmain.c Wed Jan 11 21:25:42 2012 (r229982) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -879,6 +879,10 @@ AslCommandLine ( if (Gbl_DoSignon) { printf (ACPI_COMMON_SIGNON (ASL_COMPILER_NAME)); + if (Gbl_IgnoreErrors) + { + printf ("Ignoring all errors, forcing AML file generation\n\n"); + } } /* Abort if anything went wrong on the command line */ Modified: vendor-sys/acpica/dist/compiler/aslmap.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslmap.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/aslmap.c Wed Jan 11 21:25:42 2012 (r229982) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/aslmessages.h ============================================================================== --- vendor-sys/acpica/dist/compiler/aslmessages.h Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/aslmessages.h Wed Jan 11 21:25:42 2012 (r229982) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/aslopcodes.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslopcodes.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/aslopcodes.c Wed Jan 11 21:25:42 2012 (r229982) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/asloperands.c ============================================================================== --- vendor-sys/acpica/dist/compiler/asloperands.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/asloperands.c Wed Jan 11 21:25:42 2012 (r229982) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/aslopt.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslopt.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/aslopt.c Wed Jan 11 21:25:42 2012 (r229982) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/aslpredef.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslpredef.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/aslpredef.c Wed Jan 11 21:25:42 2012 (r229982) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/aslresource.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslresource.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/aslresource.c Wed Jan 11 21:25:42 2012 (r229982) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/aslrestype1.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslrestype1.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/aslrestype1.c Wed Jan 11 21:25:42 2012 (r229982) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/aslrestype1i.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslrestype1i.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/aslrestype1i.c Wed Jan 11 21:25:42 2012 (r229982) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/aslrestype2.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslrestype2.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/aslrestype2.c Wed Jan 11 21:25:42 2012 (r229982) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/aslrestype2d.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslrestype2d.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/aslrestype2d.c Wed Jan 11 21:25:42 2012 (r229982) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/aslrestype2e.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslrestype2e.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/aslrestype2e.c Wed Jan 11 21:25:42 2012 (r229982) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/aslrestype2q.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslrestype2q.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/aslrestype2q.c Wed Jan 11 21:25:42 2012 (r229982) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/aslrestype2s.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslrestype2s.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/aslrestype2s.c Wed Jan 11 21:25:42 2012 (r229982) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/aslrestype2w.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslrestype2w.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/aslrestype2w.c Wed Jan 11 21:25:42 2012 (r229982) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/aslstartup.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslstartup.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/aslstartup.c Wed Jan 11 21:25:42 2012 (r229982) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/aslstubs.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslstubs.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/aslstubs.c Wed Jan 11 21:25:42 2012 (r229982) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/asltransform.c ============================================================================== --- vendor-sys/acpica/dist/compiler/asltransform.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/asltransform.c Wed Jan 11 21:25:42 2012 (r229982) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/asltree.c ============================================================================== --- vendor-sys/acpica/dist/compiler/asltree.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/asltree.c Wed Jan 11 21:25:42 2012 (r229982) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/asltypes.h ============================================================================== --- vendor-sys/acpica/dist/compiler/asltypes.h Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/asltypes.h Wed Jan 11 21:25:42 2012 (r229982) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/aslutils.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslutils.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/aslutils.c Wed Jan 11 21:25:42 2012 (r229982) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/asluuid.c ============================================================================== --- vendor-sys/acpica/dist/compiler/asluuid.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/asluuid.c Wed Jan 11 21:25:42 2012 (r229982) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: vendor-sys/acpica/dist/compiler/aslwalks.c ============================================================================== --- vendor-sys/acpica/dist/compiler/aslwalks.c Wed Jan 11 21:17:14 2012 (r229981) +++ vendor-sys/acpica/dist/compiler/aslwalks.c Wed Jan 11 21:25:42 2012 (r229982) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 21:26:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0868E106564A; Wed, 11 Jan 2012 21:26:47 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D19238FC0A; Wed, 11 Jan 2012 21:26:46 +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 q0BLQkLT077441; Wed, 11 Jan 2012 21:26:46 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0BLQkZf077440; Wed, 11 Jan 2012 21:26:46 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201201112126.q0BLQkZf077440@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 11 Jan 2012 21:26:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229983 - vendor-sys/acpica/20120111 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 21:26:47 -0000 Author: jkim Date: Wed Jan 11 21:26:46 2012 New Revision: 229983 URL: http://svn.freebsd.org/changeset/base/229983 Log: Tag ACPICA 20120111. Added: vendor-sys/acpica/20120111/ - copied from r229982, vendor-sys/acpica/dist/ From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 21:38:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57BA7106566C; Wed, 11 Jan 2012 21:38:06 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 46C8D8FC0A; Wed, 11 Jan 2012 21:38: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 q0BLc6vw077814; Wed, 11 Jan 2012 21:38:06 GMT (envelope-from truckman@svn.freebsd.org) Received: (from truckman@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0BLc64Y077812; Wed, 11 Jan 2012 21:38:06 GMT (envelope-from truckman@svn.freebsd.org) Message-Id: <201201112138.q0BLc64Y077812@svn.freebsd.org> From: Don Lewis Date: Wed, 11 Jan 2012 21:38:06 +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: r229984 - head/sys/dev/pst X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 21:38:06 -0000 Author: truckman Date: Wed Jan 11 21:38:05 2012 New Revision: 229984 URL: http://svn.freebsd.org/changeset/base/229984 Log: Pass the arguments to mtx_init() in the correct order. There should be no change to the binary because the value of MTX_DEF is zero and there is a visible function prototype. MFC after: 1 week Modified: head/sys/dev/pst/pst-pci.c Modified: head/sys/dev/pst/pst-pci.c ============================================================================== --- head/sys/dev/pst/pst-pci.c Wed Jan 11 21:26:46 2012 (r229983) +++ head/sys/dev/pst/pst-pci.c Wed Jan 11 21:38:05 2012 (r229984) @@ -95,7 +95,7 @@ iop_pci_attach(device_t dev) sc->ibase = rman_get_virtual(sc->r_mem); sc->reg = (struct i2o_registers *)sc->ibase; sc->dev = dev; - mtx_init(&sc->mtx, "pst lock", MTX_DEF, 0); + mtx_init(&sc->mtx, "pst lock", NULL, MTX_DEF); if (!iop_init(sc)) return 0; From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 22:12:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B48C106564A; Wed, 11 Jan 2012 22:12:46 +0000 (UTC) (envelope-from ghelmer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 49B558FC13; Wed, 11 Jan 2012 22:12:46 +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 q0BMCkKO078917; Wed, 11 Jan 2012 22:12:46 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0BMCkvo078915; Wed, 11 Jan 2012 22:12:46 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201201112212.q0BMCkvo078915@svn.freebsd.org> From: Guy Helmer Date: Wed, 11 Jan 2012 22:12:46 +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: r229985 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 22:12:46 -0000 Author: ghelmer Date: Wed Jan 11 22:12:45 2012 New Revision: 229985 URL: http://svn.freebsd.org/changeset/base/229985 Log: Fix forward structure declaration and prototype disorder. Requested by bde. Modified: head/lib/libutil/libutil.h Modified: head/lib/libutil/libutil.h ============================================================================== --- head/lib/libutil/libutil.h Wed Jan 11 21:38:05 2012 (r229984) +++ head/lib/libutil/libutil.h Wed Jan 11 22:12:45 2012 (r229985) @@ -84,45 +84,27 @@ struct pidfh { #endif /* Avoid pulling in all the include files for no need */ -struct termios; -struct winsize; struct in_addr; struct kinfo_file; struct kinfo_proc; struct kinfo_vmentry; +struct sockaddr; +struct termios; +struct winsize; __BEGIN_DECLS +char *auth_getval(const char *name); void clean_environment(const char * const *_white, const char * const *_more_white); +int expand_number(const char *_buf, uint64_t *_num); int extattr_namespace_to_string(int _attrnamespace, char **_string); int extattr_string_to_namespace(const char *_string, int *_attrnamespace); int flopen(const char *_path, int _flags, ...); -void hexdump(const void *ptr, int length, const char *hdr, int flags); -int login_tty(int _fd); -void trimdomain(char *_fullhost, int _hostsize); -int openpty(int *_amaster, int *_aslave, char *_name, - struct termios *_termp, struct winsize *_winp); int forkpty(int *_amaster, char *_name, struct termios *_termp, struct winsize *_winp); +void hexdump(const void *ptr, int length, const char *hdr, int flags); int humanize_number(char *_buf, size_t _len, int64_t _number, const char *_suffix, int _scale, int _flags); -int expand_number(const char *_buf, uint64_t *_num); -const char *uu_lockerr(int _uu_lockresult); -int uu_lock(const char *_ttyname); -int uu_unlock(const char *_ttyname); -int uu_lock_txfr(const char *_ttyname, pid_t _pid); -int _secure_path(const char *_path, uid_t _uid, gid_t _gid); -properties properties_read(int fd); -void properties_free(properties list); -char *property_find(properties list, const char *name); -char *auth_getval(const char *name); -int realhostname(char *host, size_t hsize, const struct in_addr *ip); -struct sockaddr; -int realhostname_sa(char *host, size_t hsize, struct sockaddr *addr, - int addrlen); - -int kld_isloaded(const char *name); -int kld_load(const char *name); struct kinfo_file * kinfo_getfile(pid_t _pid, int *_cntp); struct kinfo_vmentry * @@ -131,6 +113,23 @@ struct kinfo_proc * kinfo_getallproc(int *_cntp); struct kinfo_proc * kinfo_getproc(pid_t _pid); +int kld_isloaded(const char *name); +int kld_load(const char *name); +int login_tty(int _fd); +int openpty(int *_amaster, int *_aslave, char *_name, + struct termios *_termp, struct winsize *_winp); +void properties_free(properties list); +char *property_find(properties list, const char *name); +properties properties_read(int fd); +int realhostname(char *host, size_t hsize, const struct in_addr *ip); +int realhostname_sa(char *host, size_t hsize, struct sockaddr *addr, + int addrlen); +int _secure_path(const char *_path, uid_t _uid, gid_t _gid); +void trimdomain(char *_fullhost, int _hostsize); +const char *uu_lockerr(int _uu_lockresult); +int uu_lock(const char *_ttyname); +int uu_unlock(const char *_ttyname); +int uu_lock_txfr(const char *_ttyname, pid_t _pid); #ifdef _STDIO_H_ /* avoid adding new includes */ char *fparseln(FILE *, size_t *, size_t *, const char[3], int); @@ -166,28 +165,28 @@ struct group *gr_scan(const char *line); #endif #ifdef _SYS_PARAM_H_ -struct pidfh *pidfile_open(const char *path, mode_t mode, pid_t *pidptr); -int pidfile_write(struct pidfh *pfh); int pidfile_close(struct pidfh *pfh); -int pidfile_remove(struct pidfh *pfh); int pidfile_fileno(const struct pidfh *pfh); +struct pidfh *pidfile_open(const char *path, mode_t mode, pid_t *pidptr); +int pidfile_remove(struct pidfh *pfh); +int pidfile_write(struct pidfh *pfh); #endif #ifdef _UFS_UFS_QUOTA_H_ -struct quotafile; struct fstab; -struct quotafile *quota_open(struct fstab *, int, int); +struct quotafile; +int quota_check_path(const struct quotafile *, const char *path); void quota_close(struct quotafile *); -int quota_on(struct quotafile *); -int quota_off(struct quotafile *); +int quota_convert(struct quotafile *, int); const char *quota_fsname(const struct quotafile *); -const char *quota_qfname(const struct quotafile *); int quota_maxid(struct quotafile *); -int quota_check_path(const struct quotafile *, const char *path); +int quota_off(struct quotafile *); +int quota_on(struct quotafile *); +struct quotafile *quota_open(struct fstab *, int, int); +const char *quota_qfname(const struct quotafile *); int quota_read(struct quotafile *, struct dqblk *, int); int quota_write_limits(struct quotafile *, struct dqblk *, int); int quota_write_usage(struct quotafile *, struct dqblk *, int); -int quota_convert(struct quotafile *, int); #endif __END_DECLS From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 22:33:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9ACC21065670; Wed, 11 Jan 2012 22:33:41 +0000 (UTC) (envelope-from ghelmer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 894D88FC24; Wed, 11 Jan 2012 22:33: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 q0BMXf1x079584; Wed, 11 Jan 2012 22:33:41 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0BMXfgD079582; Wed, 11 Jan 2012 22:33:41 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201201112233.q0BMXfgD079582@svn.freebsd.org> From: Guy Helmer Date: Wed, 11 Jan 2012 22:33: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: r229986 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 22:33:41 -0000 Author: ghelmer Date: Wed Jan 11 22:33:41 2012 New Revision: 229986 URL: http://svn.freebsd.org/changeset/base/229986 Log: Fix namespace issues with prototype parameter names. Add missing prototype parameter names. Requested by bde. Modified: head/lib/libutil/libutil.h Modified: head/lib/libutil/libutil.h ============================================================================== --- head/lib/libutil/libutil.h Wed Jan 11 22:12:45 2012 (r229985) +++ head/lib/libutil/libutil.h Wed Jan 11 22:33:41 2012 (r229986) @@ -93,7 +93,7 @@ struct termios; struct winsize; __BEGIN_DECLS -char *auth_getval(const char *name); +char *auth_getval(const char *_name); void clean_environment(const char * const *_white, const char * const *_more_white); int expand_number(const char *_buf, uint64_t *_num); @@ -102,7 +102,7 @@ int extattr_string_to_namespace(const ch int flopen(const char *_path, int _flags, ...); int forkpty(int *_amaster, char *_name, struct termios *_termp, struct winsize *_winp); -void hexdump(const void *ptr, int length, const char *hdr, int flags); +void hexdump(const void *_ptr, int _length, const char *_hdr, int _flags); int humanize_number(char *_buf, size_t _len, int64_t _number, const char *_suffix, int _scale, int _flags); struct kinfo_file * @@ -113,17 +113,17 @@ struct kinfo_proc * kinfo_getallproc(int *_cntp); struct kinfo_proc * kinfo_getproc(pid_t _pid); -int kld_isloaded(const char *name); -int kld_load(const char *name); +int kld_isloaded(const char *_name); +int kld_load(const char *_name); int login_tty(int _fd); int openpty(int *_amaster, int *_aslave, char *_name, struct termios *_termp, struct winsize *_winp); -void properties_free(properties list); -char *property_find(properties list, const char *name); -properties properties_read(int fd); -int realhostname(char *host, size_t hsize, const struct in_addr *ip); -int realhostname_sa(char *host, size_t hsize, struct sockaddr *addr, - int addrlen); +void properties_free(properties _list); +char *property_find(properties _list, const char *_name); +properties properties_read(int _fd); +int realhostname(char *_host, size_t _hsize, const struct in_addr *_ip); +int realhostname_sa(char *_host, size_t _hsize, struct sockaddr *_addr, + int _addrlen); int _secure_path(const char *_path, uid_t _uid, gid_t _gid); void trimdomain(char *_fullhost, int _hostsize); const char *uu_lockerr(int _uu_lockresult); @@ -132,7 +132,7 @@ int uu_unlock(const char *_ttyname); int uu_lock_txfr(const char *_ttyname, pid_t _pid); #ifdef _STDIO_H_ /* avoid adding new includes */ -char *fparseln(FILE *, size_t *, size_t *, const char[3], int); +char *fparseln(FILE *_fp, size_t *_len, size_t *_lineno, const char _delim[3], int _flags); #endif #ifdef _PWD_H_ @@ -153,40 +153,40 @@ int pw_tmp(int _mfd); #ifdef _GRP_H_ int gr_copy(int __ffd, int _tfd, const struct group *_gr, struct group *_old_gr); -struct group *gr_dup(const struct group *gr); -int gr_equal(const struct group *gr1, const struct group *gr2); +struct group *gr_dup(const struct group *_gr); +int gr_equal(const struct group *_gr1, const struct group *_gr2); void gr_fini(void); int gr_init(const char *_dir, const char *_master); int gr_lock(void); -char *gr_make(const struct group *gr); +char *gr_make(const struct group *_gr); int gr_mkdb(void); +struct group *gr_scan(const char *_line); int gr_tmp(int _mdf); -struct group *gr_scan(const char *line); #endif #ifdef _SYS_PARAM_H_ -int pidfile_close(struct pidfh *pfh); -int pidfile_fileno(const struct pidfh *pfh); -struct pidfh *pidfile_open(const char *path, mode_t mode, pid_t *pidptr); -int pidfile_remove(struct pidfh *pfh); -int pidfile_write(struct pidfh *pfh); +int pidfile_close(struct pidfh *_pfh); +int pidfile_fileno(const struct pidfh *_pfh); +struct pidfh *pidfile_open(const char *_path, mode_t _mode, pid_t *_pidptr); +int pidfile_remove(struct pidfh *_pfh); +int pidfile_write(struct pidfh *_pfh); #endif #ifdef _UFS_UFS_QUOTA_H_ struct fstab; struct quotafile; -int quota_check_path(const struct quotafile *, const char *path); -void quota_close(struct quotafile *); -int quota_convert(struct quotafile *, int); -const char *quota_fsname(const struct quotafile *); -int quota_maxid(struct quotafile *); -int quota_off(struct quotafile *); -int quota_on(struct quotafile *); -struct quotafile *quota_open(struct fstab *, int, int); -const char *quota_qfname(const struct quotafile *); -int quota_read(struct quotafile *, struct dqblk *, int); -int quota_write_limits(struct quotafile *, struct dqblk *, int); -int quota_write_usage(struct quotafile *, struct dqblk *, int); +int quota_check_path(const struct quotafile *_qf, const char *_path); +void quota_close(struct quotafile *_qf); +int quota_convert(struct quotafile *_qf, int _wordsize); +const char *quota_fsname(const struct quotafile *_qf); +int quota_maxid(struct quotafile *_qf); +int quota_off(struct quotafile *_qf); +int quota_on(struct quotafile *_qf); +struct quotafile *quota_open(struct fstab *_fs, int _quotatype, int _openflags); +const char *quota_qfname(const struct quotafile *_qf); +int quota_read(struct quotafile *_qf, struct dqblk *_dqb, int _id); +int quota_write_limits(struct quotafile *_qf, struct dqblk *_dqb, int _id); +int quota_write_usage(struct quotafile *_qf, struct dqblk *_dqb, int _id); #endif __END_DECLS From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 22:37:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC2FC1065670; Wed, 11 Jan 2012 22:37:45 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA4458FC13; Wed, 11 Jan 2012 22:37: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 q0BMbj3H079747; Wed, 11 Jan 2012 22:37:45 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0BMbjW3079745; Wed, 11 Jan 2012 22:37:45 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201201112237.q0BMbjW3079745@svn.freebsd.org> From: Warren Block Date: Wed, 11 Jan 2012 22:37:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229987 - stable/9/usr.sbin/cron/crontab X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 22:37:46 -0000 Author: wblock (doc committer) Date: Wed Jan 11 22:37:45 2012 New Revision: 229987 URL: http://svn.freebsd.org/changeset/base/229987 Log: MFC r227981: Point out that @reboot runs at every cron startup, not just system startup. Approved by: gjb (mentor) Modified: stable/9/usr.sbin/cron/crontab/crontab.5 Directory Properties: stable/9/usr.sbin/cron/ (props changed) Modified: stable/9/usr.sbin/cron/crontab/crontab.5 ============================================================================== --- stable/9/usr.sbin/cron/crontab/crontab.5 Wed Jan 11 22:33:41 2012 (r229986) +++ stable/9/usr.sbin/cron/crontab/crontab.5 Wed Jan 11 22:37:45 2012 (r229987) @@ -224,7 +224,7 @@ one of eight special strings may appear: .Bd -literal -offset indent string meaning ------ ------- -@reboot Run once, at startup. +@reboot Run once, at startup of cron. @yearly Run once a year, "0 0 1 1 *". @annually (same as @yearly) @monthly Run once a month, "0 0 1 * *". From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 22:45:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1532E106566C; Wed, 11 Jan 2012 22:45:16 +0000 (UTC) (envelope-from ghelmer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE02B8FC12; Wed, 11 Jan 2012 22:45: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 q0BMjFkD080051; Wed, 11 Jan 2012 22:45:15 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0BMjFYr080049; Wed, 11 Jan 2012 22:45:15 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201201112245.q0BMjFYr080049@svn.freebsd.org> From: Guy Helmer Date: Wed, 11 Jan 2012 22:45: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: r229988 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 22:45:16 -0000 Author: ghelmer Date: Wed Jan 11 22:45:15 2012 New Revision: 229988 URL: http://svn.freebsd.org/changeset/base/229988 Log: Fix prototype formatting (indentation, long lines, and continued lines). Requested by bde. Modified: head/lib/libutil/libutil.h Modified: head/lib/libutil/libutil.h ============================================================================== --- head/lib/libutil/libutil.h Wed Jan 11 22:37:45 2012 (r229987) +++ head/lib/libutil/libutil.h Wed Jan 11 22:45:15 2012 (r229988) @@ -101,7 +101,7 @@ int extattr_namespace_to_string(int _att int extattr_string_to_namespace(const char *_string, int *_attrnamespace); int flopen(const char *_path, int _flags, ...); int forkpty(int *_amaster, char *_name, - struct termios *_termp, struct winsize *_winp); + struct termios *_termp, struct winsize *_winp); void hexdump(const void *_ptr, int _length, const char *_hdr, int _flags); int humanize_number(char *_buf, size_t _len, int64_t _number, const char *_suffix, int _scale, int _flags); @@ -117,22 +117,25 @@ int kld_isloaded(const char *_name); int kld_load(const char *_name); int login_tty(int _fd); int openpty(int *_amaster, int *_aslave, char *_name, - struct termios *_termp, struct winsize *_winp); + struct termios *_termp, struct winsize *_winp); void properties_free(properties _list); char *property_find(properties _list, const char *_name); -properties properties_read(int _fd); +properties + properties_read(int fd); int realhostname(char *_host, size_t _hsize, const struct in_addr *_ip); int realhostname_sa(char *_host, size_t _hsize, struct sockaddr *_addr, - int _addrlen); + int _addrlen); int _secure_path(const char *_path, uid_t _uid, gid_t _gid); void trimdomain(char *_fullhost, int _hostsize); -const char *uu_lockerr(int _uu_lockresult); +const char * + uu_lockerr(int _uu_lockresult); int uu_lock(const char *_ttyname); int uu_unlock(const char *_ttyname); int uu_lock_txfr(const char *_ttyname, pid_t _pid); #ifdef _STDIO_H_ /* avoid adding new includes */ -char *fparseln(FILE *_fp, size_t *_len, size_t *_lineno, const char _delim[3], int _flags); +char *fparseln(FILE *_fp, size_t *_len, size_t *_lineno, + const char _delim[3], int _flags); #endif #ifdef _PWD_H_ @@ -165,28 +168,32 @@ int gr_tmp(int _mdf); #endif #ifdef _SYS_PARAM_H_ -int pidfile_close(struct pidfh *_pfh); -int pidfile_fileno(const struct pidfh *_pfh); -struct pidfh *pidfile_open(const char *_path, mode_t _mode, pid_t *_pidptr); -int pidfile_remove(struct pidfh *_pfh); -int pidfile_write(struct pidfh *_pfh); +int pidfile_close(struct pidfh *_pfh); +int pidfile_fileno(const struct pidfh *_pfh); +struct pidfh * + pidfile_open(const char *_path, mode_t _mode, pid_t *_pidptr); +int pidfile_remove(struct pidfh *_pfh); +int pidfile_write(struct pidfh *_pfh); #endif #ifdef _UFS_UFS_QUOTA_H_ struct fstab; struct quotafile; -int quota_check_path(const struct quotafile *_qf, const char *_path); -void quota_close(struct quotafile *_qf); -int quota_convert(struct quotafile *_qf, int _wordsize); -const char *quota_fsname(const struct quotafile *_qf); -int quota_maxid(struct quotafile *_qf); -int quota_off(struct quotafile *_qf); -int quota_on(struct quotafile *_qf); -struct quotafile *quota_open(struct fstab *_fs, int _quotatype, int _openflags); -const char *quota_qfname(const struct quotafile *_qf); -int quota_read(struct quotafile *_qf, struct dqblk *_dqb, int _id); -int quota_write_limits(struct quotafile *_qf, struct dqblk *_dqb, int _id); -int quota_write_usage(struct quotafile *_qf, struct dqblk *_dqb, int _id); +int quota_check_path(const struct quotafile *_qf, const char *_path); +void quota_close(struct quotafile *_qf); +int quota_convert(struct quotafile *_qf, int _wordsize); +const char * + quota_fsname(const struct quotafile *_qf); +int quota_maxid(struct quotafile *_qf); +int quota_off(struct quotafile *_qf); +int quota_on(struct quotafile *_qf); +struct quotafile * + quota_open(struct fstab *_fs, int _quotatype, int _openflags); +const char * + quota_qfname(const struct quotafile *_qf); +int quota_read(struct quotafile *_qf, struct dqblk *_dqb, int _id); +int quota_write_limits(struct quotafile *_qf, struct dqblk *_dqb, int _id); +int quota_write_usage(struct quotafile *_qf, struct dqblk *_dqb, int _id); #endif __END_DECLS From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 23:06:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35C41106566B; Wed, 11 Jan 2012 23:06:38 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1FA588FC1D; Wed, 11 Jan 2012 23:06: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 q0BN6cFi080858; Wed, 11 Jan 2012 23:06:38 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0BN6bx2080805; Wed, 11 Jan 2012 23:06:37 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201201112306.q0BN6bx2080805@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 11 Jan 2012 23:06: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: r229989 - in head: sys/conf sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/debugger sys/contrib/dev/acpica/disassembler sys/... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 23:06:38 -0000 Author: jkim Date: Wed Jan 11 23:06:37 2012 New Revision: 229989 URL: http://svn.freebsd.org/changeset/base/229989 Log: Merge ACPICA 20120111. Added: head/sys/contrib/dev/acpica/utilities/utaddress.c - copied, changed from r229983, vendor-sys/acpica/dist/utilities/utaddress.c Modified: head/sys/conf/files head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/common/adfile.c head/sys/contrib/dev/acpica/common/adisasm.c head/sys/contrib/dev/acpica/common/adwalk.c head/sys/contrib/dev/acpica/common/dmextern.c head/sys/contrib/dev/acpica/common/dmrestag.c head/sys/contrib/dev/acpica/common/dmtable.c head/sys/contrib/dev/acpica/common/dmtbdump.c head/sys/contrib/dev/acpica/common/dmtbinfo.c head/sys/contrib/dev/acpica/common/getopt.c head/sys/contrib/dev/acpica/compiler/aslanalyze.c head/sys/contrib/dev/acpica/compiler/aslbtypes.c head/sys/contrib/dev/acpica/compiler/aslcodegen.c head/sys/contrib/dev/acpica/compiler/aslcompile.c head/sys/contrib/dev/acpica/compiler/aslcompiler.h head/sys/contrib/dev/acpica/compiler/aslcompiler.l head/sys/contrib/dev/acpica/compiler/aslcompiler.y head/sys/contrib/dev/acpica/compiler/asldefine.h head/sys/contrib/dev/acpica/compiler/aslerror.c head/sys/contrib/dev/acpica/compiler/aslfiles.c head/sys/contrib/dev/acpica/compiler/aslfold.c head/sys/contrib/dev/acpica/compiler/aslglobal.h head/sys/contrib/dev/acpica/compiler/asllength.c head/sys/contrib/dev/acpica/compiler/asllisting.c head/sys/contrib/dev/acpica/compiler/aslload.c head/sys/contrib/dev/acpica/compiler/asllookup.c head/sys/contrib/dev/acpica/compiler/aslmain.c head/sys/contrib/dev/acpica/compiler/aslmap.c head/sys/contrib/dev/acpica/compiler/aslmessages.h head/sys/contrib/dev/acpica/compiler/aslopcodes.c head/sys/contrib/dev/acpica/compiler/asloperands.c head/sys/contrib/dev/acpica/compiler/aslopt.c head/sys/contrib/dev/acpica/compiler/aslpredef.c head/sys/contrib/dev/acpica/compiler/aslresource.c head/sys/contrib/dev/acpica/compiler/aslrestype1.c head/sys/contrib/dev/acpica/compiler/aslrestype1i.c head/sys/contrib/dev/acpica/compiler/aslrestype2.c head/sys/contrib/dev/acpica/compiler/aslrestype2d.c head/sys/contrib/dev/acpica/compiler/aslrestype2e.c head/sys/contrib/dev/acpica/compiler/aslrestype2q.c head/sys/contrib/dev/acpica/compiler/aslrestype2s.c head/sys/contrib/dev/acpica/compiler/aslrestype2w.c head/sys/contrib/dev/acpica/compiler/aslstartup.c head/sys/contrib/dev/acpica/compiler/aslstubs.c head/sys/contrib/dev/acpica/compiler/asltransform.c head/sys/contrib/dev/acpica/compiler/asltree.c head/sys/contrib/dev/acpica/compiler/asltypes.h head/sys/contrib/dev/acpica/compiler/aslutils.c head/sys/contrib/dev/acpica/compiler/asluuid.c head/sys/contrib/dev/acpica/compiler/aslwalks.c head/sys/contrib/dev/acpica/compiler/dtcompile.c head/sys/contrib/dev/acpica/compiler/dtcompiler.h head/sys/contrib/dev/acpica/compiler/dtexpress.c head/sys/contrib/dev/acpica/compiler/dtfield.c head/sys/contrib/dev/acpica/compiler/dtio.c head/sys/contrib/dev/acpica/compiler/dtparser.l head/sys/contrib/dev/acpica/compiler/dtparser.y head/sys/contrib/dev/acpica/compiler/dtsubtable.c head/sys/contrib/dev/acpica/compiler/dttable.c head/sys/contrib/dev/acpica/compiler/dttemplate.c head/sys/contrib/dev/acpica/compiler/dttemplate.h head/sys/contrib/dev/acpica/compiler/dtutils.c head/sys/contrib/dev/acpica/debugger/dbcmds.c head/sys/contrib/dev/acpica/debugger/dbdisply.c head/sys/contrib/dev/acpica/debugger/dbexec.c head/sys/contrib/dev/acpica/debugger/dbfileio.c head/sys/contrib/dev/acpica/debugger/dbhistry.c head/sys/contrib/dev/acpica/debugger/dbinput.c head/sys/contrib/dev/acpica/debugger/dbmethod.c head/sys/contrib/dev/acpica/debugger/dbnames.c head/sys/contrib/dev/acpica/debugger/dbstats.c head/sys/contrib/dev/acpica/debugger/dbutils.c head/sys/contrib/dev/acpica/debugger/dbxface.c head/sys/contrib/dev/acpica/disassembler/dmbuffer.c head/sys/contrib/dev/acpica/disassembler/dmnames.c head/sys/contrib/dev/acpica/disassembler/dmobject.c head/sys/contrib/dev/acpica/disassembler/dmopcode.c head/sys/contrib/dev/acpica/disassembler/dmresrc.c head/sys/contrib/dev/acpica/disassembler/dmresrcl.c head/sys/contrib/dev/acpica/disassembler/dmresrcl2.c head/sys/contrib/dev/acpica/disassembler/dmresrcs.c head/sys/contrib/dev/acpica/disassembler/dmutils.c head/sys/contrib/dev/acpica/disassembler/dmwalk.c head/sys/contrib/dev/acpica/dispatcher/dsargs.c head/sys/contrib/dev/acpica/dispatcher/dscontrol.c head/sys/contrib/dev/acpica/dispatcher/dsfield.c head/sys/contrib/dev/acpica/dispatcher/dsinit.c head/sys/contrib/dev/acpica/dispatcher/dsmethod.c head/sys/contrib/dev/acpica/dispatcher/dsmthdat.c head/sys/contrib/dev/acpica/dispatcher/dsobject.c head/sys/contrib/dev/acpica/dispatcher/dsopcode.c head/sys/contrib/dev/acpica/dispatcher/dsutils.c head/sys/contrib/dev/acpica/dispatcher/dswexec.c head/sys/contrib/dev/acpica/dispatcher/dswload.c head/sys/contrib/dev/acpica/dispatcher/dswload2.c head/sys/contrib/dev/acpica/dispatcher/dswscope.c head/sys/contrib/dev/acpica/dispatcher/dswstate.c head/sys/contrib/dev/acpica/events/evevent.c head/sys/contrib/dev/acpica/events/evglock.c head/sys/contrib/dev/acpica/events/evgpe.c head/sys/contrib/dev/acpica/events/evgpeblk.c head/sys/contrib/dev/acpica/events/evgpeinit.c head/sys/contrib/dev/acpica/events/evgpeutil.c head/sys/contrib/dev/acpica/events/evmisc.c head/sys/contrib/dev/acpica/events/evregion.c head/sys/contrib/dev/acpica/events/evrgnini.c head/sys/contrib/dev/acpica/events/evsci.c head/sys/contrib/dev/acpica/events/evxface.c head/sys/contrib/dev/acpica/events/evxfevnt.c head/sys/contrib/dev/acpica/events/evxfgpe.c head/sys/contrib/dev/acpica/events/evxfregn.c head/sys/contrib/dev/acpica/executer/exconfig.c head/sys/contrib/dev/acpica/executer/exconvrt.c head/sys/contrib/dev/acpica/executer/excreate.c head/sys/contrib/dev/acpica/executer/exdebug.c head/sys/contrib/dev/acpica/executer/exdump.c head/sys/contrib/dev/acpica/executer/exfield.c head/sys/contrib/dev/acpica/executer/exfldio.c head/sys/contrib/dev/acpica/executer/exmisc.c head/sys/contrib/dev/acpica/executer/exmutex.c head/sys/contrib/dev/acpica/executer/exnames.c head/sys/contrib/dev/acpica/executer/exoparg1.c head/sys/contrib/dev/acpica/executer/exoparg2.c head/sys/contrib/dev/acpica/executer/exoparg3.c head/sys/contrib/dev/acpica/executer/exoparg6.c head/sys/contrib/dev/acpica/executer/exprep.c head/sys/contrib/dev/acpica/executer/exregion.c head/sys/contrib/dev/acpica/executer/exresnte.c head/sys/contrib/dev/acpica/executer/exresolv.c head/sys/contrib/dev/acpica/executer/exresop.c head/sys/contrib/dev/acpica/executer/exstore.c head/sys/contrib/dev/acpica/executer/exstoren.c head/sys/contrib/dev/acpica/executer/exstorob.c head/sys/contrib/dev/acpica/executer/exsystem.c head/sys/contrib/dev/acpica/executer/exutils.c head/sys/contrib/dev/acpica/hardware/hwacpi.c head/sys/contrib/dev/acpica/hardware/hwgpe.c head/sys/contrib/dev/acpica/hardware/hwpci.c head/sys/contrib/dev/acpica/hardware/hwregs.c head/sys/contrib/dev/acpica/hardware/hwsleep.c head/sys/contrib/dev/acpica/hardware/hwtimer.c head/sys/contrib/dev/acpica/hardware/hwvalid.c head/sys/contrib/dev/acpica/hardware/hwxface.c head/sys/contrib/dev/acpica/include/acapps.h head/sys/contrib/dev/acpica/include/accommon.h head/sys/contrib/dev/acpica/include/acconfig.h head/sys/contrib/dev/acpica/include/acdebug.h head/sys/contrib/dev/acpica/include/acdisasm.h head/sys/contrib/dev/acpica/include/acdispat.h head/sys/contrib/dev/acpica/include/acevents.h head/sys/contrib/dev/acpica/include/acexcep.h head/sys/contrib/dev/acpica/include/acglobal.h head/sys/contrib/dev/acpica/include/achware.h head/sys/contrib/dev/acpica/include/acinterp.h head/sys/contrib/dev/acpica/include/aclocal.h head/sys/contrib/dev/acpica/include/acmacros.h head/sys/contrib/dev/acpica/include/acnames.h head/sys/contrib/dev/acpica/include/acnamesp.h head/sys/contrib/dev/acpica/include/acobject.h head/sys/contrib/dev/acpica/include/acopcode.h head/sys/contrib/dev/acpica/include/acoutput.h head/sys/contrib/dev/acpica/include/acparser.h head/sys/contrib/dev/acpica/include/acpi.h head/sys/contrib/dev/acpica/include/acpiosxf.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/acpredef.h head/sys/contrib/dev/acpica/include/acresrc.h head/sys/contrib/dev/acpica/include/acrestyp.h head/sys/contrib/dev/acpica/include/acstruct.h head/sys/contrib/dev/acpica/include/actables.h head/sys/contrib/dev/acpica/include/actbl.h head/sys/contrib/dev/acpica/include/actbl1.h head/sys/contrib/dev/acpica/include/actbl2.h head/sys/contrib/dev/acpica/include/actbl3.h head/sys/contrib/dev/acpica/include/actypes.h head/sys/contrib/dev/acpica/include/acutils.h head/sys/contrib/dev/acpica/include/amlcode.h head/sys/contrib/dev/acpica/include/amlresrc.h head/sys/contrib/dev/acpica/include/platform/acenv.h head/sys/contrib/dev/acpica/include/platform/acfreebsd.h head/sys/contrib/dev/acpica/include/platform/acgcc.h head/sys/contrib/dev/acpica/namespace/nsaccess.c head/sys/contrib/dev/acpica/namespace/nsalloc.c head/sys/contrib/dev/acpica/namespace/nsdump.c head/sys/contrib/dev/acpica/namespace/nsdumpdv.c head/sys/contrib/dev/acpica/namespace/nseval.c head/sys/contrib/dev/acpica/namespace/nsinit.c head/sys/contrib/dev/acpica/namespace/nsload.c head/sys/contrib/dev/acpica/namespace/nsnames.c head/sys/contrib/dev/acpica/namespace/nsobject.c head/sys/contrib/dev/acpica/namespace/nsparse.c head/sys/contrib/dev/acpica/namespace/nspredef.c head/sys/contrib/dev/acpica/namespace/nsrepair.c head/sys/contrib/dev/acpica/namespace/nsrepair2.c head/sys/contrib/dev/acpica/namespace/nssearch.c head/sys/contrib/dev/acpica/namespace/nsutils.c head/sys/contrib/dev/acpica/namespace/nswalk.c head/sys/contrib/dev/acpica/namespace/nsxfeval.c head/sys/contrib/dev/acpica/namespace/nsxfname.c head/sys/contrib/dev/acpica/namespace/nsxfobj.c head/sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c head/sys/contrib/dev/acpica/parser/psargs.c head/sys/contrib/dev/acpica/parser/psloop.c head/sys/contrib/dev/acpica/parser/psopcode.c head/sys/contrib/dev/acpica/parser/psparse.c head/sys/contrib/dev/acpica/parser/psscope.c head/sys/contrib/dev/acpica/parser/pstree.c head/sys/contrib/dev/acpica/parser/psutils.c head/sys/contrib/dev/acpica/parser/pswalk.c head/sys/contrib/dev/acpica/parser/psxface.c head/sys/contrib/dev/acpica/resources/rsaddr.c head/sys/contrib/dev/acpica/resources/rscalc.c head/sys/contrib/dev/acpica/resources/rscreate.c head/sys/contrib/dev/acpica/resources/rsdump.c head/sys/contrib/dev/acpica/resources/rsinfo.c head/sys/contrib/dev/acpica/resources/rsio.c head/sys/contrib/dev/acpica/resources/rsirq.c head/sys/contrib/dev/acpica/resources/rslist.c head/sys/contrib/dev/acpica/resources/rsmemory.c head/sys/contrib/dev/acpica/resources/rsmisc.c head/sys/contrib/dev/acpica/resources/rsserial.c head/sys/contrib/dev/acpica/resources/rsutils.c head/sys/contrib/dev/acpica/resources/rsxface.c head/sys/contrib/dev/acpica/tables/tbfadt.c head/sys/contrib/dev/acpica/tables/tbfind.c head/sys/contrib/dev/acpica/tables/tbinstal.c head/sys/contrib/dev/acpica/tables/tbutils.c head/sys/contrib/dev/acpica/tables/tbxface.c head/sys/contrib/dev/acpica/tables/tbxfroot.c head/sys/contrib/dev/acpica/utilities/utalloc.c head/sys/contrib/dev/acpica/utilities/utcache.c head/sys/contrib/dev/acpica/utilities/utcopy.c head/sys/contrib/dev/acpica/utilities/utdebug.c head/sys/contrib/dev/acpica/utilities/utdecode.c head/sys/contrib/dev/acpica/utilities/utdelete.c head/sys/contrib/dev/acpica/utilities/uteval.c head/sys/contrib/dev/acpica/utilities/utglobal.c head/sys/contrib/dev/acpica/utilities/utids.c head/sys/contrib/dev/acpica/utilities/utinit.c head/sys/contrib/dev/acpica/utilities/utlock.c head/sys/contrib/dev/acpica/utilities/utmath.c head/sys/contrib/dev/acpica/utilities/utmisc.c head/sys/contrib/dev/acpica/utilities/utmutex.c head/sys/contrib/dev/acpica/utilities/utobject.c head/sys/contrib/dev/acpica/utilities/utosi.c head/sys/contrib/dev/acpica/utilities/utresrc.c head/sys/contrib/dev/acpica/utilities/utstate.c head/sys/contrib/dev/acpica/utilities/uttrack.c head/sys/contrib/dev/acpica/utilities/utxface.c head/sys/contrib/dev/acpica/utilities/utxferror.c head/sys/contrib/dev/acpica/utilities/utxfmutex.c head/sys/modules/acpi/acpi/Makefile head/usr.sbin/acpi/acpidb/Makefile head/usr.sbin/acpi/iasl/Makefile Directory Properties: head/sys/contrib/dev/acpica/ (props changed) Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/conf/files Wed Jan 11 23:06:37 2012 (r229989) @@ -267,6 +267,7 @@ contrib/dev/acpica/tables/tbinstal.c op contrib/dev/acpica/tables/tbutils.c optional acpi contrib/dev/acpica/tables/tbxface.c optional acpi contrib/dev/acpica/tables/tbxfroot.c optional acpi +contrib/dev/acpica/utilities/utaddress.c optional acpi contrib/dev/acpica/utilities/utalloc.c optional acpi contrib/dev/acpica/utilities/utcache.c optional acpi contrib/dev/acpica/utilities/utcopy.c optional acpi Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/changes.txt Wed Jan 11 23:06:37 2012 (r229989) @@ -1,8 +1,56 @@ ---------------------------------------- -23 November 2011. Summary of changes for version 20111123: +11 January 2012. Summary of changes for version 20120111: + +This release is available at www.acpica.org/downloads. +The ACPI 5.0 specification is available at www.acpi.info. + +1) ACPICA Core Subsystem: + +Implemented a new mechanism to allow host device drivers to check for address +range conflicts with ACPI Operation Regions. Both SystemMemory and SystemIO +address spaces are supported. A new external interface, AcpiCheckAddressRange, +allows drivers to check an address range against the ACPI namespace. See the +ACPICA reference for additional details. Adds one new file, +utilities/utaddress.c. Lin Ming, Bob Moore. + +Fixed several issues with the ACPI 5.0 FADT support: Add the sleep Control and +Status registers, update the ACPI 5.0 flags, and update internal data +structures to handle an FADT larger than 256 bytes. The size of the ACPI 5.0 +FADT is 268 bytes. + +Updated all ACPICA copyrights and signons to 2012. Added the 2012 copyright to +all module headers and signons, including the standard Linux header. This +affects virtually every file in the ACPICA core subsystem, iASL compiler, and +all ACPICA utilities. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The debug +version of the code includes the debug output trace mechanism and has a much +larger code and data size. + + Previous Release: + Non-Debug Version: 92.3K Code, 24.9K Data, 117.2K Total + Debug Version: 170.8K Code, 72.6K Data, 243.4K Total + Current Release: + Non-Debug Version: 92.8K Code, 24.9K Data, 117.7K Total + Debug Version: 171.7K Code, 72.9K Data, 244.5K Total + -This release is available at www.acpica.org/downloads -The ACPI 5.0 specification is available at www.acpi.info +2) iASL Compiler/Disassembler and Tools: + +Disassembler: fixed a problem with the automatic resource tag generation +support. Fixes a problem where the resource tags are inadvertently not +constructed if the table being disassembled contains external references to +control methods. Moved the actual construction of the tags to after the final +namespace is constructed (after 2nd parse is invoked due to external control +method references.) ACPICA BZ 941. + +Table Compiler: Make all "generic" operators caseless. These are the operators +like UINT8, String, etc. Making these caseless improves ease-of-use. ACPICA BZ +934. + +---------------------------------------- +23 November 2011. Summary of changes for version 20111123: 0) ACPI 5.0 Support: Modified: head/sys/contrib/dev/acpica/common/adfile.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adfile.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/common/adfile.c Wed Jan 11 23:06:37 2012 (r229989) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/common/adisasm.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adisasm.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/common/adisasm.c Wed Jan 11 23:06:37 2012 (r229989) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -376,7 +376,8 @@ AdAmlDisassemble ( AdDisassemblerHeader (Filename); AcpiOsPrintf (" * ACPI Data Table [%4.4s]\n *\n", Table->Signature); - AcpiOsPrintf (" * Format: [HexOffset DecimalOffset ByteLength] FieldName : FieldValue\n */\n\n"); + AcpiOsPrintf (" * Format: [HexOffset DecimalOffset ByteLength] " + "FieldName : FieldValue\n */\n\n"); AcpiDmDumpDataTable (Table); fprintf (stderr, "Acpi Data Table [%4.4s] decoded, written to \"%s\"\n", @@ -403,15 +404,17 @@ AdAmlDisassemble ( AcpiOsPrintf ("*****/\n"); } - /* - * Load namespace from names created within control methods - */ - AcpiDmFinishNamespaceLoad (AcpiGbl_ParseOpRoot, AcpiGbl_RootNode, OwnerId); + /* Load namespace from names created within control methods */ + + AcpiDmFinishNamespaceLoad (AcpiGbl_ParseOpRoot, + AcpiGbl_RootNode, OwnerId); /* - * Cross reference the namespace here, in order to generate External() statements + * Cross reference the namespace here, in order to + * generate External() statements */ - AcpiDmCrossReferenceNamespace (AcpiGbl_ParseOpRoot, AcpiGbl_RootNode, OwnerId); + AcpiDmCrossReferenceNamespace (AcpiGbl_ParseOpRoot, + AcpiGbl_RootNode, OwnerId); if (AslCompilerdebug) { @@ -422,24 +425,20 @@ AdAmlDisassemble ( AcpiDmFindOrphanMethods (AcpiGbl_ParseOpRoot); - /* Convert fixed-offset references to resource descriptors to symbolic references */ - - AcpiDmConvertResourceIndexes (AcpiGbl_ParseOpRoot, AcpiGbl_RootNode); - /* - * If we found any external control methods, we must reparse the entire - * tree with the new information (namely, the number of arguments per - * method) + * If we found any external control methods, we must reparse + * the entire tree with the new information (namely, the + * number of arguments per method) */ if (AcpiDmGetExternalMethodCount ()) { fprintf (stderr, - "\nFound %u external control methods, reparsing with new information\n", + "\nFound %u external control methods, " + "reparsing with new information\n", AcpiDmGetExternalMethodCount ()); - /* - * Reparse, rebuild namespace. no need to xref namespace - */ + /* Reparse, rebuild namespace. no need to xref namespace */ + AcpiPsDeleteParseTree (AcpiGbl_ParseOpRoot); AcpiNsDeleteNamespaceSubtree (AcpiGbl_RootNode); @@ -456,7 +455,7 @@ AdAmlDisassemble ( Status = AcpiNsRootInitialize (); AcpiDmAddExternalsToNamespace (); - /* Parse table. No need to reload it, however (FALSE) */ + /* Parse the table again. No need to reload it, however */ Status = AdParseTable (Table, NULL, FALSE, FALSE); if (ACPI_FAILURE (Status)) @@ -477,6 +476,15 @@ AdAmlDisassemble ( } } + /* + * Now that the namespace is finalized, we can perform namespace + * transforms. + * + * 1) Convert fixed-offset references to resource descriptors + * to symbolic references (Note: modifies namespace) + */ + AcpiDmConvertResourceIndexes (AcpiGbl_ParseOpRoot, AcpiGbl_RootNode); + /* Optional displays */ if (AcpiGbl_DbOpt_disasm) @@ -502,11 +510,12 @@ Cleanup: if (OutToFile && File) { + if (AslCompilerdebug) /* Display final namespace, with transforms */ + { + LsSetupNsList (File); + LsDisplayNamespace (); + } -#ifdef ASL_DISASM_DEBUG - LsSetupNsList (File); - LsDisplayNamespace (); -#endif fclose (File); AcpiOsRedirectOutput (stdout); } Modified: head/sys/contrib/dev/acpica/common/adwalk.c ============================================================================== --- head/sys/contrib/dev/acpica/common/adwalk.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/common/adwalk.c Wed Jan 11 23:06:37 2012 (r229989) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/common/dmextern.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmextern.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/common/dmextern.c Wed Jan 11 23:06:37 2012 (r229989) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/common/dmrestag.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmrestag.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/common/dmrestag.c Wed Jan 11 23:06:37 2012 (r229989) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/common/dmtable.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtable.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/common/dmtable.c Wed Jan 11 23:06:37 2012 (r229989) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -232,7 +232,7 @@ static const char *AcpiDmIvrsS }; -#define ACPI_FADT_PM_RESERVED 8 +#define ACPI_FADT_PM_RESERVED 9 static const char *AcpiDmFadtProfiles[] = { @@ -244,6 +244,7 @@ static const char *AcpiDmFadtP "SOHO Server", "Appliance PC", "Performance Server", + "Tablet", "Unknown Profile Type" }; Modified: head/sys/contrib/dev/acpica/common/dmtbdump.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbdump.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/common/dmtbdump.c Wed Jan 11 23:06:37 2012 (r229989) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/common/dmtbinfo.c ============================================================================== --- head/sys/contrib/dev/acpica/common/dmtbinfo.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/common/dmtbinfo.c Wed Jan 11 23:06:37 2012 (r229989) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -78,123 +78,123 @@ /* * Macros used to generate offsets to specific table fields */ -#define ACPI_FACS_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_FACS,f) -#define ACPI_GAS_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_GENERIC_ADDRESS,f) -#define ACPI_HDR_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_HEADER,f) -#define ACPI_RSDP_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_RSDP,f) -#define ACPI_BERT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_BERT,f) -#define ACPI_BGRT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_BGRT,f) -#define ACPI_BOOT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_BOOT,f) -#define ACPI_CPEP_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_CPEP,f) -#define ACPI_DBGP_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_DBGP,f) -#define ACPI_DMAR_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_DMAR,f) -#define ACPI_DRTM_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_DRTM,f) -#define ACPI_ECDT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_ECDT,f) -#define ACPI_EINJ_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_EINJ,f) -#define ACPI_ERST_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_ERST,f) -#define ACPI_GTDT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_GTDT,f) -#define ACPI_HEST_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_HEST,f) -#define ACPI_HPET_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_HPET,f) -#define ACPI_IVRS_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_IVRS,f) -#define ACPI_MADT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_MADT,f) -#define ACPI_MCFG_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_MCFG,f) -#define ACPI_MCHI_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_MCHI,f) -#define ACPI_MPST_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_MPST,f) -#define ACPI_MSCT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_MSCT,f) -#define ACPI_PCCT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_PCCT,f) -#define ACPI_PMTT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_PMTT,f) -#define ACPI_S3PT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_S3PT,f) -#define ACPI_SBST_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_SBST,f) -#define ACPI_SLIT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_SLIT,f) -#define ACPI_SPCR_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_SPCR,f) -#define ACPI_SPMI_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_SPMI,f) -#define ACPI_SRAT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_SRAT,f) -#define ACPI_TCPA_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_TCPA,f) -#define ACPI_UEFI_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_UEFI,f) -#define ACPI_WAET_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_WAET,f) -#define ACPI_WDAT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_WDAT,f) -#define ACPI_WDDT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_WDDT,f) -#define ACPI_WDRT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_WDRT,f) +#define ACPI_FACS_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_FACS,f) +#define ACPI_GAS_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_GENERIC_ADDRESS,f) +#define ACPI_HDR_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_HEADER,f) +#define ACPI_RSDP_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_RSDP,f) +#define ACPI_BERT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_BERT,f) +#define ACPI_BGRT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_BGRT,f) +#define ACPI_BOOT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_BOOT,f) +#define ACPI_CPEP_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_CPEP,f) +#define ACPI_DBGP_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_DBGP,f) +#define ACPI_DMAR_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_DMAR,f) +#define ACPI_DRTM_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_DRTM,f) +#define ACPI_ECDT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_ECDT,f) +#define ACPI_EINJ_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_EINJ,f) +#define ACPI_ERST_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_ERST,f) +#define ACPI_GTDT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_GTDT,f) +#define ACPI_HEST_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_HEST,f) +#define ACPI_HPET_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_HPET,f) +#define ACPI_IVRS_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_IVRS,f) +#define ACPI_MADT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_MADT,f) +#define ACPI_MCFG_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_MCFG,f) +#define ACPI_MCHI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_MCHI,f) +#define ACPI_MPST_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_MPST,f) +#define ACPI_MSCT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_MSCT,f) +#define ACPI_PCCT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_PCCT,f) +#define ACPI_PMTT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_PMTT,f) +#define ACPI_S3PT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_S3PT,f) +#define ACPI_SBST_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SBST,f) +#define ACPI_SLIT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SLIT,f) +#define ACPI_SPCR_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SPCR,f) +#define ACPI_SPMI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SPMI,f) +#define ACPI_SRAT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SRAT,f) +#define ACPI_TCPA_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA,f) +#define ACPI_UEFI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_UEFI,f) +#define ACPI_WAET_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WAET,f) +#define ACPI_WDAT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WDAT,f) +#define ACPI_WDDT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WDDT,f) +#define ACPI_WDRT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WDRT,f) /* Subtables */ -#define ACPI_ASF0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_ASF_INFO,f) -#define ACPI_ASF1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_ASF_ALERT,f) -#define ACPI_ASF1a_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_ASF_ALERT_DATA,f) -#define ACPI_ASF2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_ASF_REMOTE,f) -#define ACPI_ASF2a_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_ASF_CONTROL_DATA,f) -#define ACPI_ASF3_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_ASF_RMCP,f) -#define ACPI_ASF4_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_ASF_ADDRESS,f) -#define ACPI_CPEP0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_CPEP_POLLING,f) -#define ACPI_DMARS_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_DEVICE_SCOPE,f) -#define ACPI_DMAR0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_HARDWARE_UNIT,f) -#define ACPI_DMAR1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_RESERVED_MEMORY,f) -#define ACPI_DMAR2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_ATSR,f) -#define ACPI_DMAR3_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_DMAR_RHSA,f) -#define ACPI_EINJ0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_WHEA_HEADER,f) -#define ACPI_ERST0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_WHEA_HEADER,f) -#define ACPI_FPDTH_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_FPDT_HEADER,f) -#define ACPI_FPDT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_FPDT_BOOT,f) -#define ACPI_FPDT1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_FPDT_S3PT_PTR,f) -#define ACPI_HEST0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IA_MACHINE_CHECK,f) -#define ACPI_HEST1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IA_CORRECTED,f) -#define ACPI_HEST2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IA_NMI,f) -#define ACPI_HEST6_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_AER_ROOT,f) -#define ACPI_HEST7_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_AER,f) -#define ACPI_HEST8_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_AER_BRIDGE,f) -#define ACPI_HEST9_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_GENERIC,f) -#define ACPI_HESTN_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_NOTIFY,f) -#define ACPI_HESTB_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_HEST_IA_ERROR_BANK,f) -#define ACPI_IVRSH_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_HEADER,f) -#define ACPI_IVRS0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_HARDWARE,f) -#define ACPI_IVRS1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_MEMORY,f) -#define ACPI_IVRSD_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_DE_HEADER,f) -#define ACPI_IVRS8A_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_DEVICE8A,f) -#define ACPI_IVRS8B_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_DEVICE8B,f) -#define ACPI_IVRS8C_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_IVRS_DEVICE8C,f) -#define ACPI_MADT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_LOCAL_APIC,f) -#define ACPI_MADT1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_IO_APIC,f) -#define ACPI_MADT2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_INTERRUPT_OVERRIDE,f) -#define ACPI_MADT3_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_NMI_SOURCE,f) -#define ACPI_MADT4_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_LOCAL_APIC_NMI,f) -#define ACPI_MADT5_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_LOCAL_APIC_OVERRIDE,f) -#define ACPI_MADT6_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_IO_SAPIC,f) -#define ACPI_MADT7_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_LOCAL_SAPIC,f) -#define ACPI_MADT8_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_INTERRUPT_SOURCE,f) -#define ACPI_MADT9_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_LOCAL_X2APIC,f) -#define ACPI_MADT10_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_LOCAL_X2APIC_NMI,f) -#define ACPI_MADT11_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_GENERIC_INTERRUPT,f) -#define ACPI_MADT12_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MADT_GENERIC_DISTRIBUTOR,f) -#define ACPI_MADTH_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f) -#define ACPI_MCFG0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MCFG_ALLOCATION,f) -#define ACPI_MPST0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MPST_POWER_NODE,f) -#define ACPI_MPST0A_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MPST_POWER_STATE,f) -#define ACPI_MPST0B_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MPST_COMPONENT,f) -#define ACPI_MPST1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MPST_DATA_HDR,f) -#define ACPI_MPST2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MPST_POWER_DATA,f) -#define ACPI_MSCT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_MSCT_PROXIMITY,f) -#define ACPI_PCCT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_PCCT_SUBSPACE,f) -#define ACPI_PMTT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_PMTT_SOCKET,f) -#define ACPI_PMTT1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_PMTT_CONTROLLER,f) -#define ACPI_PMTT1A_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_PMTT_DOMAIN,f) -#define ACPI_PMTT2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_PMTT_PHYSICAL_COMPONENT,f) -#define ACPI_PMTTH_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_PMTT_HEADER,f) -#define ACPI_S3PTH_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_S3PT_HEADER,f) -#define ACPI_S3PT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_S3PT_RESUME,f) -#define ACPI_S3PT1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_S3PT_SUSPEND,f) -#define ACPI_SLICH_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SLIC_HEADER,f) -#define ACPI_SLIC0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SLIC_KEY,f) -#define ACPI_SLIC1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SLIC_MARKER,f) -#define ACPI_SRATH_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f) -#define ACPI_SRAT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SRAT_CPU_AFFINITY,f) -#define ACPI_SRAT1_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SRAT_MEM_AFFINITY,f) -#define ACPI_SRAT2_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_SRAT_X2APIC_CPU_AFFINITY,f) -#define ACPI_WDAT0_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_WDAT_ENTRY,f) +#define ACPI_ASF0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_INFO,f) +#define ACPI_ASF1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_ALERT,f) +#define ACPI_ASF1a_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_ALERT_DATA,f) +#define ACPI_ASF2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_REMOTE,f) +#define ACPI_ASF2a_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_CONTROL_DATA,f) +#define ACPI_ASF3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_RMCP,f) +#define ACPI_ASF4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_ADDRESS,f) +#define ACPI_CPEP0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CPEP_POLLING,f) +#define ACPI_DMARS_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_DEVICE_SCOPE,f) +#define ACPI_DMAR0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_HARDWARE_UNIT,f) +#define ACPI_DMAR1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_RESERVED_MEMORY,f) +#define ACPI_DMAR2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_ATSR,f) +#define ACPI_DMAR3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_RHSA,f) +#define ACPI_EINJ0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_WHEA_HEADER,f) +#define ACPI_ERST0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_WHEA_HEADER,f) +#define ACPI_FPDTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_FPDT_HEADER,f) +#define ACPI_FPDT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_FPDT_BOOT,f) +#define ACPI_FPDT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_FPDT_S3PT_PTR,f) +#define ACPI_HEST0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_MACHINE_CHECK,f) +#define ACPI_HEST1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_CORRECTED,f) +#define ACPI_HEST2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_NMI,f) +#define ACPI_HEST6_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_AER_ROOT,f) +#define ACPI_HEST7_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_AER,f) +#define ACPI_HEST8_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_AER_BRIDGE,f) +#define ACPI_HEST9_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_GENERIC,f) +#define ACPI_HESTN_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_NOTIFY,f) +#define ACPI_HESTB_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_ERROR_BANK,f) +#define ACPI_IVRSH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_HEADER,f) +#define ACPI_IVRS0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_HARDWARE,f) +#define ACPI_IVRS1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_MEMORY,f) +#define ACPI_IVRSD_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_DE_HEADER,f) +#define ACPI_IVRS8A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_DEVICE8A,f) +#define ACPI_IVRS8B_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_DEVICE8B,f) +#define ACPI_IVRS8C_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_DEVICE8C,f) +#define ACPI_MADT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LOCAL_APIC,f) +#define ACPI_MADT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_IO_APIC,f) +#define ACPI_MADT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_INTERRUPT_OVERRIDE,f) +#define ACPI_MADT3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_NMI_SOURCE,f) +#define ACPI_MADT4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LOCAL_APIC_NMI,f) +#define ACPI_MADT5_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LOCAL_APIC_OVERRIDE,f) +#define ACPI_MADT6_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_IO_SAPIC,f) +#define ACPI_MADT7_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LOCAL_SAPIC,f) +#define ACPI_MADT8_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_INTERRUPT_SOURCE,f) +#define ACPI_MADT9_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LOCAL_X2APIC,f) +#define ACPI_MADT10_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LOCAL_X2APIC_NMI,f) +#define ACPI_MADT11_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_INTERRUPT,f) +#define ACPI_MADT12_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_DISTRIBUTOR,f) +#define ACPI_MADTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f) +#define ACPI_MCFG0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MCFG_ALLOCATION,f) +#define ACPI_MPST0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MPST_POWER_NODE,f) +#define ACPI_MPST0A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MPST_POWER_STATE,f) +#define ACPI_MPST0B_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MPST_COMPONENT,f) +#define ACPI_MPST1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MPST_DATA_HDR,f) +#define ACPI_MPST2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MPST_POWER_DATA,f) +#define ACPI_MSCT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MSCT_PROXIMITY,f) +#define ACPI_PCCT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_SUBSPACE,f) +#define ACPI_PMTT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_SOCKET,f) +#define ACPI_PMTT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_CONTROLLER,f) +#define ACPI_PMTT1A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_DOMAIN,f) +#define ACPI_PMTT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_PHYSICAL_COMPONENT,f) +#define ACPI_PMTTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_HEADER,f) +#define ACPI_S3PTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_S3PT_HEADER,f) +#define ACPI_S3PT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_S3PT_RESUME,f) +#define ACPI_S3PT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_S3PT_SUSPEND,f) +#define ACPI_SLICH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SLIC_HEADER,f) +#define ACPI_SLIC0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SLIC_KEY,f) +#define ACPI_SLIC1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SLIC_MARKER,f) +#define ACPI_SRATH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f) +#define ACPI_SRAT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_CPU_AFFINITY,f) +#define ACPI_SRAT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_MEM_AFFINITY,f) +#define ACPI_SRAT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_X2APIC_CPU_AFFINITY,f) +#define ACPI_WDAT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_WDAT_ENTRY,f) /* * Simplify access to flag fields by breaking them up into bytes */ -#define ACPI_FLAG_OFFSET(d,f,o) (UINT8) (ACPI_OFFSET (d,f) + o) +#define ACPI_FLAG_OFFSET(d,f,o) (UINT16) (ACPI_OFFSET (d,f) + o) /* Flags */ @@ -384,6 +384,7 @@ ACPI_DMTABLE_INFO AcpiDmTableI {ACPI_DMT_FLAG2, ACPI_FADT_FLAG_OFFSET (BootFlags,0), "VGA Not Present (V4)", 0}, {ACPI_DMT_FLAG3, ACPI_FADT_FLAG_OFFSET (BootFlags,0), "MSI Not Supported (V4)", 0}, {ACPI_DMT_FLAG4, ACPI_FADT_FLAG_OFFSET (BootFlags,0), "PCIe ASPM Not Supported (V4)", 0}, + {ACPI_DMT_FLAG5, ACPI_FADT_FLAG_OFFSET (BootFlags,0), "CMOS RTC Not Present (V5)", 0}, {ACPI_DMT_UINT8, ACPI_FADT_OFFSET (Reserved), "Reserved", 0}, {ACPI_DMT_UINT32, ACPI_FADT_OFFSET (Flags), "Flags (decoded below)", DT_FLAG}, @@ -417,8 +418,7 @@ ACPI_DMTABLE_INFO AcpiDmTableI {ACPI_DMT_FLAG2, ACPI_FADT_FLAG_OFFSET (Flags,2), "Use APIC Cluster Model (V4)", 0}, {ACPI_DMT_FLAG3, ACPI_FADT_FLAG_OFFSET (Flags,2), "Use APIC Physical Destination Mode (V4)", 0}, {ACPI_DMT_FLAG4, ACPI_FADT_FLAG_OFFSET (Flags,2), "Hardware Reduced (V5)", 0}, - {ACPI_DMT_FLAG5, ACPI_FADT_FLAG_OFFSET (Flags,2), "Prefer S0 Idle (V5)", 0}, - {ACPI_DMT_FLAG6, ACPI_FADT_FLAG_OFFSET (Flags,2), "Use Sleep Register (V5)", 0}, + {ACPI_DMT_FLAG5, ACPI_FADT_FLAG_OFFSET (Flags,2), "Low Power S0 Idle (V5)", 0}, ACPI_DMT_TERMINATOR }; @@ -456,7 +456,8 @@ ACPI_DMTABLE_INFO AcpiDmTableI ACPI_DMTABLE_INFO AcpiDmTableInfoFadt5[] = { - {ACPI_DMT_GAS, ACPI_FADT_OFFSET (SleepRegister), "Sleep Register", 0}, + {ACPI_DMT_GAS, ACPI_FADT_OFFSET (SleepControl), "Sleep Control Register", 0}, + {ACPI_DMT_GAS, ACPI_FADT_OFFSET (SleepStatus), "Sleep Status Register", 0}, ACPI_DMT_TERMINATOR }; Modified: head/sys/contrib/dev/acpica/common/getopt.c ============================================================================== --- head/sys/contrib/dev/acpica/common/getopt.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/common/getopt.c Wed Jan 11 23:06:37 2012 (r229989) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslanalyze.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslanalyze.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/aslanalyze.c Wed Jan 11 23:06:37 2012 (r229989) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslbtypes.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslbtypes.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/aslbtypes.c Wed Jan 11 23:06:37 2012 (r229989) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslcodegen.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcodegen.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/aslcodegen.c Wed Jan 11 23:06:37 2012 (r229989) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslcompile.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompile.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/aslcompile.c Wed Jan 11 23:06:37 2012 (r229989) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompiler.h Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/aslcompiler.h Wed Jan 11 23:06:37 2012 (r229989) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.l ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompiler.l Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/aslcompiler.l Wed Jan 11 23:06:37 2012 (r229989) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslcompiler.y ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslcompiler.y Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/aslcompiler.y Wed Jan 11 23:06:37 2012 (r229989) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/asldefine.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asldefine.h Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/asldefine.h Wed Jan 11 23:06:37 2012 (r229989) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslerror.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslerror.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/aslerror.c Wed Jan 11 23:06:37 2012 (r229989) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslfiles.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslfiles.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/aslfiles.c Wed Jan 11 23:06:37 2012 (r229989) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslfold.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslfold.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/aslfold.c Wed Jan 11 23:06:37 2012 (r229989) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslglobal.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslglobal.h Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/aslglobal.h Wed Jan 11 23:06:37 2012 (r229989) @@ -7,7 +7,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/asllength.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asllength.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/asllength.c Wed Jan 11 23:06:37 2012 (r229989) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/asllisting.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asllisting.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/asllisting.c Wed Jan 11 23:06:37 2012 (r229989) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslload.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslload.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/aslload.c Wed Jan 11 23:06:37 2012 (r229989) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/asllookup.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asllookup.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/asllookup.c Wed Jan 11 23:06:37 2012 (r229989) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslmain.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmain.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/aslmain.c Wed Jan 11 23:06:37 2012 (r229989) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -879,6 +879,10 @@ AslCommandLine ( if (Gbl_DoSignon) { printf (ACPI_COMMON_SIGNON (ASL_COMPILER_NAME)); + if (Gbl_IgnoreErrors) + { + printf ("Ignoring all errors, forcing AML file generation\n\n"); + } } /* Abort if anything went wrong on the command line */ Modified: head/sys/contrib/dev/acpica/compiler/aslmap.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmap.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/aslmap.c Wed Jan 11 23:06:37 2012 (r229989) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslmessages.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslmessages.h Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/aslmessages.h Wed Jan 11 23:06:37 2012 (r229989) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslopcodes.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslopcodes.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/aslopcodes.c Wed Jan 11 23:06:37 2012 (r229989) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/asloperands.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asloperands.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/asloperands.c Wed Jan 11 23:06:37 2012 (r229989) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslopt.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslopt.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/aslopt.c Wed Jan 11 23:06:37 2012 (r229989) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslpredef.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslpredef.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/aslpredef.c Wed Jan 11 23:06:37 2012 (r229989) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslresource.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslresource.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/aslresource.c Wed Jan 11 23:06:37 2012 (r229989) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslrestype1.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslrestype1.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/aslrestype1.c Wed Jan 11 23:06:37 2012 (r229989) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslrestype1i.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslrestype1i.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/aslrestype1i.c Wed Jan 11 23:06:37 2012 (r229989) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslrestype2.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslrestype2.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/aslrestype2.c Wed Jan 11 23:06:37 2012 (r229989) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslrestype2d.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslrestype2d.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/aslrestype2d.c Wed Jan 11 23:06:37 2012 (r229989) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslrestype2e.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslrestype2e.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/aslrestype2e.c Wed Jan 11 23:06:37 2012 (r229989) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslrestype2q.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslrestype2q.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/aslrestype2q.c Wed Jan 11 23:06:37 2012 (r229989) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslrestype2s.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslrestype2s.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/aslrestype2s.c Wed Jan 11 23:06:37 2012 (r229989) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslrestype2w.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslrestype2w.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/aslrestype2w.c Wed Jan 11 23:06:37 2012 (r229989) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslstartup.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslstartup.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/aslstartup.c Wed Jan 11 23:06:37 2012 (r229989) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslstubs.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslstubs.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/aslstubs.c Wed Jan 11 23:06:37 2012 (r229989) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/asltransform.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asltransform.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/asltransform.c Wed Jan 11 23:06:37 2012 (r229989) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/asltree.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asltree.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/asltree.c Wed Jan 11 23:06:37 2012 (r229989) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/asltypes.h ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asltypes.h Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/asltypes.h Wed Jan 11 23:06:37 2012 (r229989) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslutils.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslutils.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/aslutils.c Wed Jan 11 23:06:37 2012 (r229989) @@ -6,7 +6,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/asluuid.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/asluuid.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/asluuid.c Wed Jan 11 23:06:37 2012 (r229989) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2011, Intel Corp. + * Copyright (C) 2000 - 2012, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/contrib/dev/acpica/compiler/aslwalks.c ============================================================================== --- head/sys/contrib/dev/acpica/compiler/aslwalks.c Wed Jan 11 22:45:15 2012 (r229988) +++ head/sys/contrib/dev/acpica/compiler/aslwalks.c Wed Jan 11 23:06:37 2012 (r229989) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 23:11:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3326B1065670; Wed, 11 Jan 2012 23:11:28 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 20D438FC15; Wed, 11 Jan 2012 23:11: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 q0BNBSY9081041; Wed, 11 Jan 2012 23:11:28 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0BNBSWw081039; Wed, 11 Jan 2012 23:11:28 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201201112311.q0BNBSWw081039@svn.freebsd.org> From: Warren Block Date: Wed, 11 Jan 2012 23:11:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229990 - stable/8/usr.sbin/cron/crontab X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 23:11:28 -0000 Author: wblock (doc committer) Date: Wed Jan 11 23:11:27 2012 New Revision: 229990 URL: http://svn.freebsd.org/changeset/base/229990 Log: MFC r227981: Point out that @reboot runs at every cron startup, not just system startup. Approved by: gjb (mentor) Modified: stable/8/usr.sbin/cron/crontab/crontab.5 Directory Properties: stable/8/usr.sbin/cron/ (props changed) Modified: stable/8/usr.sbin/cron/crontab/crontab.5 ============================================================================== --- stable/8/usr.sbin/cron/crontab/crontab.5 Wed Jan 11 23:06:37 2012 (r229989) +++ stable/8/usr.sbin/cron/crontab/crontab.5 Wed Jan 11 23:11:27 2012 (r229990) @@ -224,7 +224,7 @@ one of eight special strings may appear: .Bd -literal -offset indent string meaning ------ ------- -@reboot Run once, at startup. +@reboot Run once, at startup of cron. @yearly Run once a year, "0 0 1 1 *". @annually (same as @yearly) @monthly Run once a month, "0 0 1 * *". From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 23:11:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61D2D106566B; Wed, 11 Jan 2012 23:11:48 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4FB7F8FC08; Wed, 11 Jan 2012 23:11: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 q0BNBmMa081086; Wed, 11 Jan 2012 23:11:48 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0BNBm5u081084; Wed, 11 Jan 2012 23:11:48 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201201112311.q0BNBm5u081084@svn.freebsd.org> From: Warren Block Date: Wed, 11 Jan 2012 23:11:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229991 - stable/7/usr.sbin/cron/crontab X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 23:11:48 -0000 Author: wblock (doc committer) Date: Wed Jan 11 23:11:48 2012 New Revision: 229991 URL: http://svn.freebsd.org/changeset/base/229991 Log: MFC r227981: Point out that @reboot runs at every cron startup, not just system startup. Approved by: gjb (mentor) Modified: stable/7/usr.sbin/cron/crontab/crontab.5 Directory Properties: stable/7/usr.sbin/cron/ (props changed) Modified: stable/7/usr.sbin/cron/crontab/crontab.5 ============================================================================== --- stable/7/usr.sbin/cron/crontab/crontab.5 Wed Jan 11 23:11:27 2012 (r229990) +++ stable/7/usr.sbin/cron/crontab/crontab.5 Wed Jan 11 23:11:48 2012 (r229991) @@ -224,7 +224,7 @@ one of eight special strings may appear: .Bd -literal -offset indent string meaning ------ ------- -@reboot Run once, at startup. +@reboot Run once, at startup of cron. @yearly Run once a year, "0 0 1 1 *". @annually (same as @yearly) @monthly Run once a month, "0 0 1 * *". From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 23:30:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 673D9106566C; Wed, 11 Jan 2012 23:30:19 +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 3A9698FC13; Wed, 11 Jan 2012 23:30:19 +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 q0BNUJsJ081755; Wed, 11 Jan 2012 23:30:19 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0BNUJVO081752; Wed, 11 Jan 2012 23:30:19 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201201112330.q0BNUJVO081752@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 11 Jan 2012 23:30:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229992 - stable/9/usr.bin/du X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 23:30:19 -0000 Author: jilles Date: Wed Jan 11 23:30:18 2012 New Revision: 229992 URL: http://svn.freebsd.org/changeset/base/229992 Log: MFC r228669: du: Allow multiple -HLP options, the last one wins. This matches 4.4BSD tradition and other utilities with these options and is required by POSIX (POSIX does not specify -P, only -HL). Modified: stable/9/usr.bin/du/du.1 stable/9/usr.bin/du/du.c Directory Properties: stable/9/usr.bin/du/ (props changed) Modified: stable/9/usr.bin/du/du.1 ============================================================================== --- stable/9/usr.bin/du/du.1 Wed Jan 11 23:11:48 2012 (r229991) +++ stable/9/usr.bin/du/du.1 Wed Jan 11 23:30:18 2012 (r229992) @@ -28,7 +28,7 @@ .\" @(#)du.1 8.2 (Berkeley) 4/1/94 .\" $FreeBSD$ .\" -.Dd December 8, 2011 +.Dd December 17, 2011 .Dt DU 1 .Os .Sh NAME @@ -155,6 +155,13 @@ or .Fl L option is specified, storage used by any symbolic links which are followed is not counted (or displayed). +The +.Fl H , +.Fl L +and +.Fl P +options override each other and the command's actions are determined +by the last one specified. .Pp The .Fl h, k Modified: stable/9/usr.bin/du/du.c ============================================================================== --- stable/9/usr.bin/du/du.c Wed Jan 11 23:11:48 2012 (r229991) +++ stable/9/usr.bin/du/du.c Wed Jan 11 23:30:18 2012 (r229992) @@ -90,18 +90,18 @@ main(int argc, char *argv[]) int ftsoptions; int listall; int depth; - int Hflag, Lflag, Pflag, aflag, sflag, dflag, cflag; + int Hflag, Lflag, aflag, sflag, dflag, cflag; int hflag, lflag, ch, notused, rval; char **save; static char dot[] = "."; setlocale(LC_ALL, ""); - Hflag = Lflag = Pflag = aflag = sflag = dflag = cflag = hflag = + Hflag = Lflag = aflag = sflag = dflag = cflag = hflag = lflag = Aflag = 0; save = argv; - ftsoptions = 0; + ftsoptions = FTS_PHYSICAL; savednumber = 0; threshold = 0; threshold_sign = 1; @@ -126,19 +126,17 @@ main(int argc, char *argv[]) break; case 'H': Hflag = 1; + Lflag = 0; break; case 'I': ignoreadd(optarg); break; case 'L': - if (Pflag) - usage(); Lflag = 1; + Hflag = 0; break; case 'P': - if (Lflag) - usage(); - Pflag = 1; + Hflag = Lflag = 0; break; case 'a': aflag = 1; @@ -211,20 +209,12 @@ main(int argc, char *argv[]) * the man page, so it's a feature. */ - if (Hflag + Lflag + Pflag > 1) - usage(); - - if (Hflag + Lflag + Pflag == 0) - Pflag = 1; /* -P (physical) is default */ - if (Hflag) ftsoptions |= FTS_COMFOLLOW; - - if (Lflag) + if (Lflag) { + ftsoptions &= ~FTS_PHYSICAL; ftsoptions |= FTS_LOGICAL; - - if (Pflag) - ftsoptions |= FTS_PHYSICAL; + } if (!Aflag && (cblocksize % DEV_BSIZE) != 0) cblocksize = howmany(cblocksize, DEV_BSIZE) * DEV_BSIZE; From owner-svn-src-all@FreeBSD.ORG Wed Jan 11 23:52:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 201C51065677; Wed, 11 Jan 2012 23:52:16 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id C352F8FC16; Wed, 11 Jan 2012 23:52:15 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id B506931B; Thu, 12 Jan 2012 00:52:13 +0100 (CET) Date: Thu, 12 Jan 2012 00:51:06 +0100 From: Pawel Jakub Dawidek To: Guy Helmer Message-ID: <20120111235105.GG1695@garage.freebsd.pl> References: <201201111635.q0BGZQmQ067528@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="c7hkjup166d4FzgN" Content-Disposition: inline In-Reply-To: <201201111635.q0BGZQmQ067528@svn.freebsd.org> X-OS: FreeBSD 9.0-CURRENT amd64 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: r229966 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 23:52:16 -0000 --c7hkjup166d4FzgN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 11, 2012 at 04:35:26PM +0000, Guy Helmer wrote: > Author: ghelmer > Date: Wed Jan 11 16:35:26 2012 > New Revision: 229966 > URL: http://svn.freebsd.org/changeset/base/229966 >=20 > Log: > jilles pointed out that O_CLOEXEC could be used in the open(2) flags > rather than using fcntl(2) later, and in addition to saving a system > call, removes a possible race with fork/exec from threads or signal > handlers. So now we can remove fcntl() as the source of possible pidfile_open() errnos from the manual page.:) > Modified: > head/lib/libutil/pidfile.c >=20 > Modified: head/lib/libutil/pidfile.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/lib/libutil/pidfile.c Wed Jan 11 15:00:16 2012 (r229965) > +++ head/lib/libutil/pidfile.c Wed Jan 11 16:35:26 2012 (r229966) > @@ -117,7 +117,7 @@ pidfile_open(const char *path, mode_t mo > * pidfile_write() can be called multiple times. > */ > fd =3D flopen(pfh->pf_path, > - O_WRONLY | O_CREAT | O_TRUNC | O_NONBLOCK, mode); > + O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC | O_NONBLOCK, mode); > if (fd =3D=3D -1) { > if (errno =3D=3D EWOULDBLOCK && pidptr !=3D NULL) { > count =3D 20; > @@ -139,19 +139,6 @@ pidfile_open(const char *path, mode_t mo > } > =20 > /* > - * Prevent the file descriptor from escaping to other > - * programs via exec(3). > - */ > - if (fcntl(fd, F_SETFD, FD_CLOEXEC) =3D=3D -1) { > - error =3D errno; > - unlink(pfh->pf_path); > - close(fd); > - free(pfh); > - errno =3D error; > - return (NULL); > - } > - > - /* > * Remember file information, so in pidfile_write() we are sure we write > * to the proper descriptor. > */ --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://yomoli.com --c7hkjup166d4FzgN Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk8OIGgACgkQForvXbEpPzRXQwCg5FNVDhxiSmijXULpq0L2J58R GGgAoNxBvH2gmTYnJeMQCoursyuLSUfK =RZlq -----END PGP SIGNATURE----- --c7hkjup166d4FzgN-- From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 00:01:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5852B1065678; Thu, 12 Jan 2012 00:01:12 +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 2D9638FC08; Thu, 12 Jan 2012 00:01: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 q0C01CXZ082828; Thu, 12 Jan 2012 00:01:12 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0C01CWC082825; Thu, 12 Jan 2012 00:01:12 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201201120001.q0C01CWC082825@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 12 Jan 2012 00:01:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229993 - stable/8/usr.bin/du X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 00:01:12 -0000 Author: jilles Date: Thu Jan 12 00:01:11 2012 New Revision: 229993 URL: http://svn.freebsd.org/changeset/base/229993 Log: MFC r228669: du: Allow multiple -HLP options, the last one wins. This matches 4.4BSD tradition and other utilities with these options and is required by POSIX (POSIX does not specify -P, only -HL). Modified: stable/8/usr.bin/du/du.1 stable/8/usr.bin/du/du.c Directory Properties: stable/8/usr.bin/du/ (props changed) Modified: stable/8/usr.bin/du/du.1 ============================================================================== --- stable/8/usr.bin/du/du.1 Wed Jan 11 23:30:18 2012 (r229992) +++ stable/8/usr.bin/du/du.1 Thu Jan 12 00:01:11 2012 (r229993) @@ -32,7 +32,7 @@ .\" @(#)du.1 8.2 (Berkeley) 4/1/94 .\" $FreeBSD$ .\" -.Dd December 8, 2011 +.Dd December 17, 2011 .Dt DU 1 .Os .Sh NAME @@ -159,6 +159,13 @@ or .Fl L option is specified, storage used by any symbolic links which are followed is not counted (or displayed). +The +.Fl H , +.Fl L +and +.Fl P +options override each other and the command's actions are determined +by the last one specified. .Pp The .Fl h, k Modified: stable/8/usr.bin/du/du.c ============================================================================== --- stable/8/usr.bin/du/du.c Wed Jan 11 23:30:18 2012 (r229992) +++ stable/8/usr.bin/du/du.c Thu Jan 12 00:01:11 2012 (r229993) @@ -94,18 +94,18 @@ main(int argc, char *argv[]) int ftsoptions; int listall; int depth; - int Hflag, Lflag, Pflag, aflag, sflag, dflag, cflag; + int Hflag, Lflag, aflag, sflag, dflag, cflag; int hflag, lflag, ch, notused, rval; char **save; static char dot[] = "."; setlocale(LC_ALL, ""); - Hflag = Lflag = Pflag = aflag = sflag = dflag = cflag = hflag = + Hflag = Lflag = aflag = sflag = dflag = cflag = hflag = lflag = Aflag = 0; save = argv; - ftsoptions = 0; + ftsoptions = FTS_PHYSICAL; savednumber = 0; threshold = 0; threshold_sign = 1; @@ -130,19 +130,17 @@ main(int argc, char *argv[]) break; case 'H': Hflag = 1; + Lflag = 0; break; case 'I': ignoreadd(optarg); break; case 'L': - if (Pflag) - usage(); Lflag = 1; + Hflag = 0; break; case 'P': - if (Lflag) - usage(); - Pflag = 1; + Hflag = Lflag = 0; break; case 'a': aflag = 1; @@ -215,20 +213,12 @@ main(int argc, char *argv[]) * the man page, so it's a feature. */ - if (Hflag + Lflag + Pflag > 1) - usage(); - - if (Hflag + Lflag + Pflag == 0) - Pflag = 1; /* -P (physical) is default */ - if (Hflag) ftsoptions |= FTS_COMFOLLOW; - - if (Lflag) + if (Lflag) { + ftsoptions &= ~FTS_PHYSICAL; ftsoptions |= FTS_LOGICAL; - - if (Pflag) - ftsoptions |= FTS_PHYSICAL; + } if (!Aflag && (cblocksize % DEV_BSIZE) != 0) cblocksize = howmany(cblocksize, DEV_BSIZE) * DEV_BSIZE; From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 00:02:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1EDEE1065670; Thu, 12 Jan 2012 00:02:15 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0AAEE8FC1C; Thu, 12 Jan 2012 00:02: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 q0C02EEB082897; Thu, 12 Jan 2012 00:02:14 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0C02E5X082893; Thu, 12 Jan 2012 00:02:14 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201120002.q0C02E5X082893@svn.freebsd.org> From: Eitan Adler Date: Thu, 12 Jan 2012 00:02:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229994 - in stable/9: share/man/man4 sys/dev/fb sys/modules/splash sys/modules/splash/txt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 00:02:15 -0000 Author: eadler (ports committer) Date: Thu Jan 12 00:02:14 2012 New Revision: 229994 URL: http://svn.freebsd.org/changeset/base/229994 Log: MFC r228445: - Add support for ASCII art splash screens in TheDraw format PR: kern/143370 Approved by: ed Added: stable/9/sys/dev/fb/splash_txt.c - copied unchanged from r228445, head/sys/dev/fb/splash_txt.c stable/9/sys/modules/splash/txt/ - copied from r228445, head/sys/modules/splash/txt/ Modified: stable/9/share/man/man4/splash.4 stable/9/sys/modules/splash/Makefile Directory Properties: stable/9/share/man/ (props changed) stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/share/man/man4/splash.4 ============================================================================== --- stable/9/share/man/man4/splash.4 Thu Jan 12 00:01:11 2012 (r229993) +++ stable/9/share/man/man4/splash.4 Thu Jan 12 00:02:14 2012 (r229994) @@ -74,6 +74,14 @@ Bitmaps of other color depths will not b ZSoft PCX decoder. This decoder currently only supports version 5 8-bpp single-plane images. +.It Pa splash_txt.ko +TheDraw binary ASCII drawing file decoder. +Displays a text-mode 80x25 ASCII drawing, such as that produced by +the Binary save format in TheDraw. +This format consists of a sequence +of two byte pairs representing the 80x25 display, where the first byte +is the ASCII character to draw and the second byte indicates the +colors/attributes to use when drawing the character. .El .Pp The @@ -223,6 +231,16 @@ If the VESA support is statically linked necessary to load the VESA module. Just load the bitmap file and the splash decoder module as in the first example above. +.Pp +To load a binary ASCII drawing and display this while booting, include the +following into your +.Pa /boot/loader.conf +: +.Bd -literal -offset indent +splash_txt_load="YES" +bitmap_load="YES" +bitmap_name="/boot/splash.bin" +.Ed .\".Sh DIAGNOSTICS .Sh SEE ALSO .Xr vidcontrol 1 , @@ -256,6 +274,15 @@ module was written by based on the .Pa splash_bmp code. +The +.Pa splash_txt +module was written by +.An Antony Mawer Aq antony@mawer.org +based on the +.Pa splash_bmp +code, with some additional inspiration from the +.Pa daemon_saver +code. .Sh CAVEATS Both the splash screen and the screen saver work with .Xr syscons 4 Copied: stable/9/sys/dev/fb/splash_txt.c (from r228445, head/sys/dev/fb/splash_txt.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/dev/fb/splash_txt.c Thu Jan 12 00:02:14 2012 (r229994, copy of r228445, head/sys/dev/fb/splash_txt.c) @@ -0,0 +1,135 @@ +/*- + * Copyright (c) 1999 Michael Smith + * Copyright (c) 1999 Kazutaka YOKOTA + * Copyright (c) 2005 Antony Mawer + * 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 AUTHORS 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 AUTHORS 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 +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +static int splash_on = FALSE; + +static int txt_init(video_adapter_t *adp); +static int txt_end(video_adapter_t *adp); +static int txt_splash(video_adapter_t * adp, const int on); + +/* These are rows by columns of the text-mode display device. */ +#define BIN_IMAGE_WIDTH 80 +#define BIN_IMAGE_HEIGHT 25 + +static splash_decoder_t txt_decoder = { + .name = "splash_txt", + .init = txt_init, + .term = txt_end, + .splash = txt_splash, + .data_type = SPLASH_IMAGE, +}; + +SPLASH_DECODER(splash_txt, txt_decoder); + +static void +draw_text_splash(sc_softc_t *sc) +{ + u_int x, y; + u_char ch, attr; + u_char *pdata = txt_decoder.data; + + /* Init failed. */ + if (txt_decoder.data == NULL) + return; + for (y = 0; y < BIN_IMAGE_HEIGHT; y++) { + for (x = 0; x < BIN_IMAGE_WIDTH; x++) { + ch = *pdata++; + attr = *pdata++; + sc_vtb_putc(&sc->cur_scp->scr, + (y * sc->cur_scp->xsize) + x, + sc->scr_map[ch], (int)attr << 8); + } + } +} + +static int +txt_init(video_adapter_t *adp) +{ + + /* Ensure that the image data exists. */ + if (txt_decoder.data == NULL || txt_decoder.data_size <= 0) { + printf("splash_txt: No ASCII bitmap file found\n"); + return (ENODEV); + } + return (0); +} + +static int +txt_end(video_adapter_t *adp) +{ + + return (0); +} + +static int +txt_splash(video_adapter_t *adp, const int on) +{ + sc_softc_t *sc; + scr_stat *scp; + + sc = sc_find_softc(adp, NULL); + if (sc == NULL) + return (EAGAIN); + scp = sc->cur_scp; + if (on) { + if (!splash_on) { + if (adp->va_info.vi_flags & V_INFO_GRAPHICS) + return EAGAIN; + /* Clear screen and set border colour. */ + sc_vtb_clear(&scp->scr, sc->scr_map[0x20], + (FG_LIGHTGREY | BG_BLACK) << 8); + (*vidsw[adp->va_index]->set_hw_cursor)(adp, -1, -1); + sc_set_border(scp, 0); + splash_on = TRUE; + /* Display the splash screen. */ + draw_text_splash(sc); + } + return (0); + } else { + /* The video mode will be restored by the caller. */ + splash_on = FALSE; + return (0); + } +} + + Modified: stable/9/sys/modules/splash/Makefile ============================================================================== --- stable/9/sys/modules/splash/Makefile Thu Jan 12 00:01:11 2012 (r229993) +++ stable/9/sys/modules/splash/Makefile Thu Jan 12 00:02:14 2012 (r229994) @@ -1,5 +1,5 @@ # $FreeBSD$ -SUBDIR= bmp pcx +SUBDIR= bmp pcx txt .include From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 00:03:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3274B106564A; Thu, 12 Jan 2012 00:03:51 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F3528FC14; Thu, 12 Jan 2012 00:03: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 q0C03pwE082979; Thu, 12 Jan 2012 00:03:51 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0C03owC082977; Thu, 12 Jan 2012 00:03:51 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201120003.q0C03owC082977@svn.freebsd.org> From: Eitan Adler Date: Thu, 12 Jan 2012 00:03:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229995 - in stable/8/sys: dev/fb modules/splash modules/splash/txt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 00:03:51 -0000 Author: eadler (ports committer) Date: Thu Jan 12 00:03:50 2012 New Revision: 229995 URL: http://svn.freebsd.org/changeset/base/229995 Log: MFC r228445: - Add support for ASCII art splash screens in TheDraw format PR: kern/143370 Approved by: ed Added: stable/8/sys/dev/fb/splash_txt.c - copied unchanged from r228445, head/sys/dev/fb/splash_txt.c stable/8/sys/modules/splash/txt/ - copied from r228445, head/sys/modules/splash/txt/ Modified: stable/8/sys/modules/splash/Makefile Directory Properties: stable/8/share/man/ (props changed) stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) Copied: stable/8/sys/dev/fb/splash_txt.c (from r228445, head/sys/dev/fb/splash_txt.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/dev/fb/splash_txt.c Thu Jan 12 00:03:50 2012 (r229995, copy of r228445, head/sys/dev/fb/splash_txt.c) @@ -0,0 +1,135 @@ +/*- + * Copyright (c) 1999 Michael Smith + * Copyright (c) 1999 Kazutaka YOKOTA + * Copyright (c) 2005 Antony Mawer + * 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 AUTHORS 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 AUTHORS 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 +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +static int splash_on = FALSE; + +static int txt_init(video_adapter_t *adp); +static int txt_end(video_adapter_t *adp); +static int txt_splash(video_adapter_t * adp, const int on); + +/* These are rows by columns of the text-mode display device. */ +#define BIN_IMAGE_WIDTH 80 +#define BIN_IMAGE_HEIGHT 25 + +static splash_decoder_t txt_decoder = { + .name = "splash_txt", + .init = txt_init, + .term = txt_end, + .splash = txt_splash, + .data_type = SPLASH_IMAGE, +}; + +SPLASH_DECODER(splash_txt, txt_decoder); + +static void +draw_text_splash(sc_softc_t *sc) +{ + u_int x, y; + u_char ch, attr; + u_char *pdata = txt_decoder.data; + + /* Init failed. */ + if (txt_decoder.data == NULL) + return; + for (y = 0; y < BIN_IMAGE_HEIGHT; y++) { + for (x = 0; x < BIN_IMAGE_WIDTH; x++) { + ch = *pdata++; + attr = *pdata++; + sc_vtb_putc(&sc->cur_scp->scr, + (y * sc->cur_scp->xsize) + x, + sc->scr_map[ch], (int)attr << 8); + } + } +} + +static int +txt_init(video_adapter_t *adp) +{ + + /* Ensure that the image data exists. */ + if (txt_decoder.data == NULL || txt_decoder.data_size <= 0) { + printf("splash_txt: No ASCII bitmap file found\n"); + return (ENODEV); + } + return (0); +} + +static int +txt_end(video_adapter_t *adp) +{ + + return (0); +} + +static int +txt_splash(video_adapter_t *adp, const int on) +{ + sc_softc_t *sc; + scr_stat *scp; + + sc = sc_find_softc(adp, NULL); + if (sc == NULL) + return (EAGAIN); + scp = sc->cur_scp; + if (on) { + if (!splash_on) { + if (adp->va_info.vi_flags & V_INFO_GRAPHICS) + return EAGAIN; + /* Clear screen and set border colour. */ + sc_vtb_clear(&scp->scr, sc->scr_map[0x20], + (FG_LIGHTGREY | BG_BLACK) << 8); + (*vidsw[adp->va_index]->set_hw_cursor)(adp, -1, -1); + sc_set_border(scp, 0); + splash_on = TRUE; + /* Display the splash screen. */ + draw_text_splash(sc); + } + return (0); + } else { + /* The video mode will be restored by the caller. */ + splash_on = FALSE; + return (0); + } +} + + Modified: stable/8/sys/modules/splash/Makefile ============================================================================== --- stable/8/sys/modules/splash/Makefile Thu Jan 12 00:02:14 2012 (r229994) +++ stable/8/sys/modules/splash/Makefile Thu Jan 12 00:03:50 2012 (r229995) @@ -1,5 +1,5 @@ # $FreeBSD$ -SUBDIR= bmp pcx +SUBDIR= bmp pcx txt .include From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 00:05:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50CF41065670; Thu, 12 Jan 2012 00:05:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D6FF8FC0C; Thu, 12 Jan 2012 00:05: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 q0C05a9I083076; Thu, 12 Jan 2012 00:05:36 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0C05ae2083074; Thu, 12 Jan 2012 00:05:36 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201120005.q0C05ae2083074@svn.freebsd.org> From: Eitan Adler Date: Thu, 12 Jan 2012 00:05:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229996 - in stable/7/sys: dev/fb modules/splash modules/splash/txt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 00:05:36 -0000 Author: eadler (ports committer) Date: Thu Jan 12 00:05:35 2012 New Revision: 229996 URL: http://svn.freebsd.org/changeset/base/229996 Log: MFC r228445: - Add support for ASCII art splash screens in TheDraw format PR: kern/143370 Approved by: ed Added: stable/7/sys/dev/fb/splash_txt.c - copied unchanged from r228445, head/sys/dev/fb/splash_txt.c stable/7/sys/modules/splash/txt/ - copied from r228445, head/sys/modules/splash/txt/ Modified: stable/7/sys/modules/splash/Makefile Directory Properties: stable/7/share/man/ (props changed) stable/7/share/man/man4/ (props changed) stable/7/sys/ (props changed) Copied: stable/7/sys/dev/fb/splash_txt.c (from r228445, head/sys/dev/fb/splash_txt.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/7/sys/dev/fb/splash_txt.c Thu Jan 12 00:05:35 2012 (r229996, copy of r228445, head/sys/dev/fb/splash_txt.c) @@ -0,0 +1,135 @@ +/*- + * Copyright (c) 1999 Michael Smith + * Copyright (c) 1999 Kazutaka YOKOTA + * Copyright (c) 2005 Antony Mawer + * 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 AUTHORS 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 AUTHORS 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 +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +static int splash_on = FALSE; + +static int txt_init(video_adapter_t *adp); +static int txt_end(video_adapter_t *adp); +static int txt_splash(video_adapter_t * adp, const int on); + +/* These are rows by columns of the text-mode display device. */ +#define BIN_IMAGE_WIDTH 80 +#define BIN_IMAGE_HEIGHT 25 + +static splash_decoder_t txt_decoder = { + .name = "splash_txt", + .init = txt_init, + .term = txt_end, + .splash = txt_splash, + .data_type = SPLASH_IMAGE, +}; + +SPLASH_DECODER(splash_txt, txt_decoder); + +static void +draw_text_splash(sc_softc_t *sc) +{ + u_int x, y; + u_char ch, attr; + u_char *pdata = txt_decoder.data; + + /* Init failed. */ + if (txt_decoder.data == NULL) + return; + for (y = 0; y < BIN_IMAGE_HEIGHT; y++) { + for (x = 0; x < BIN_IMAGE_WIDTH; x++) { + ch = *pdata++; + attr = *pdata++; + sc_vtb_putc(&sc->cur_scp->scr, + (y * sc->cur_scp->xsize) + x, + sc->scr_map[ch], (int)attr << 8); + } + } +} + +static int +txt_init(video_adapter_t *adp) +{ + + /* Ensure that the image data exists. */ + if (txt_decoder.data == NULL || txt_decoder.data_size <= 0) { + printf("splash_txt: No ASCII bitmap file found\n"); + return (ENODEV); + } + return (0); +} + +static int +txt_end(video_adapter_t *adp) +{ + + return (0); +} + +static int +txt_splash(video_adapter_t *adp, const int on) +{ + sc_softc_t *sc; + scr_stat *scp; + + sc = sc_find_softc(adp, NULL); + if (sc == NULL) + return (EAGAIN); + scp = sc->cur_scp; + if (on) { + if (!splash_on) { + if (adp->va_info.vi_flags & V_INFO_GRAPHICS) + return EAGAIN; + /* Clear screen and set border colour. */ + sc_vtb_clear(&scp->scr, sc->scr_map[0x20], + (FG_LIGHTGREY | BG_BLACK) << 8); + (*vidsw[adp->va_index]->set_hw_cursor)(adp, -1, -1); + sc_set_border(scp, 0); + splash_on = TRUE; + /* Display the splash screen. */ + draw_text_splash(sc); + } + return (0); + } else { + /* The video mode will be restored by the caller. */ + splash_on = FALSE; + return (0); + } +} + + Modified: stable/7/sys/modules/splash/Makefile ============================================================================== --- stable/7/sys/modules/splash/Makefile Thu Jan 12 00:03:50 2012 (r229995) +++ stable/7/sys/modules/splash/Makefile Thu Jan 12 00:05:35 2012 (r229996) @@ -1,5 +1,5 @@ # $FreeBSD$ -SUBDIR= bmp pcx +SUBDIR= bmp pcx txt .include From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 00:16:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CAD01065672; Thu, 12 Jan 2012 00:16:35 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 166848FC1D; Thu, 12 Jan 2012 00:16:34 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q0C0GVml028453 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 12 Jan 2012 02:16:31 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q0C0GUAF070212; Thu, 12 Jan 2012 02:16:30 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q0C0GUIs070211; Thu, 12 Jan 2012 02:16:30 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 12 Jan 2012 02:16:30 +0200 From: Kostik Belousov To: Guy Helmer Message-ID: <20120112001630.GS31224@deviant.kiev.zoral.com.ua> References: <201201112233.q0BMXfgD079582@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="EqTSqAcQCSqN2BXp" Content-Disposition: inline In-Reply-To: <201201112233.q0BMXfgD079582@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r229986 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 00:16:35 -0000 --EqTSqAcQCSqN2BXp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 11, 2012 at 10:33:41PM +0000, Guy Helmer wrote: > Author: ghelmer > Date: Wed Jan 11 22:33:41 2012 > New Revision: 229986 > URL: http://svn.freebsd.org/changeset/base/229986 >=20 > Log: > Fix namespace issues with prototype parameter names. > Add missing prototype parameter names. > =20 > Requested by bde. >=20 > Modified: > head/lib/libutil/libutil.h >=20 > Modified: head/lib/libutil/libutil.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/lib/libutil/libutil.h Wed Jan 11 22:12:45 2012 (r229985) > +++ head/lib/libutil/libutil.h Wed Jan 11 22:33:41 2012 (r229986) > @@ -93,7 +93,7 @@ struct termios; > struct winsize; > =20 > __BEGIN_DECLS > -char *auth_getval(const char *name); > +char *auth_getval(const char *_name); The _[a-z].* names are still in the app namespace. Only _[A-Z].* and __[a-z].* are reserved for the implementation. --EqTSqAcQCSqN2BXp Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk8OJl0ACgkQC3+MBN1Mb4hDYACfc1cU0SIE4mvEWTzVHvG5ei8r +nkAnA0WVQwewJbUxuL3frjWqu//3h0J =76CG -----END PGP SIGNATURE----- --EqTSqAcQCSqN2BXp-- From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 00:34:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CBD9106566C; Thu, 12 Jan 2012 00:34:33 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 86C6A8FC0C; Thu, 12 Jan 2012 00:34: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 q0C0YXwi084188; Thu, 12 Jan 2012 00:34:33 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0C0YXrq084182; Thu, 12 Jan 2012 00:34:33 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201201120034.q0C0YXrq084182@svn.freebsd.org> From: "Kenneth D. Merry" Date: Thu, 12 Jan 2012 00:34: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: r229997 - in head: share/examples/scsi_target sys/amd64/conf sys/cam/ctl sys/cam/scsi sys/conf sys/dev/ata sys/dev/ciss sys/i386/conf sys/ia64/conf sys/sparc64/conf usr.bin usr.bin/ctls... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 00:34:33 -0000 Author: ken Date: Thu Jan 12 00:34:33 2012 New Revision: 229997 URL: http://svn.freebsd.org/changeset/base/229997 Log: Add the CAM Target Layer (CTL). CTL is a disk and processor device emulation subsystem originally written for Copan Systems under Linux starting in 2003. It has been shipping in Copan (now SGI) products since 2005. It was ported to FreeBSD in 2008, and thanks to an agreement between SGI (who acquired Copan's assets in 2010) and Spectra Logic in 2010, CTL is available under a BSD-style license. The intent behind the agreement was that Spectra would work to get CTL into the FreeBSD tree. Some CTL features: - Disk and processor device emulation. - Tagged queueing - SCSI task attribute support (ordered, head of queue, simple tags) - SCSI implicit command ordering support. (e.g. if a read follows a mode select, the read will be blocked until the mode select completes.) - Full task management support (abort, LUN reset, target reset, etc.) - Support for multiple ports - Support for multiple simultaneous initiators - Support for multiple simultaneous backing stores - Persistent reservation support - Mode sense/select support - Error injection support - High Availability support (1) - All I/O handled in-kernel, no userland context switch overhead. (1) HA Support is just an API stub, and needs much more to be fully functional. ctl.c: The core of CTL. Command handlers and processing, character driver, and HA support are here. ctl.h: Basic function declarations and data structures. ctl_backend.c, ctl_backend.h: The basic CTL backend API. ctl_backend_block.c, ctl_backend_block.h: The block and file backend. This allows for using a disk or a file as the backing store for a LUN. Multiple threads are started to do I/O to the backing device, primarily because the VFS API requires that to get any concurrency. ctl_backend_ramdisk.c: A "fake" ramdisk backend. It only allocates a small amount of memory to act as a source and sink for reads and writes from an initiator. Therefore it cannot be used for any real data, but it can be used to test for throughput. It can also be used to test initiators' support for extremely large LUNs. ctl_cmd_table.c: This is a table with all 256 possible SCSI opcodes, and command handler functions defined for supported opcodes. ctl_debug.h: Debugging support. ctl_error.c, ctl_error.h: CTL-specific wrappers around the CAM sense building functions. ctl_frontend.c, ctl_frontend.h: These files define the basic CTL frontend port API. ctl_frontend_cam_sim.c: This is a CTL frontend port that is also a CAM SIM. This frontend allows for using CTL without any target-capable hardware. So any LUNs you create in CTL are visible in CAM via this port. ctl_frontend_internal.c, ctl_frontend_internal.h: This is a frontend port written for Copan to do some system-specific tasks that required sending commands into CTL from inside the kernel. This isn't entirely relevant to FreeBSD in general, but can perhaps be repurposed. ctl_ha.h: This is a stubbed-out High Availability API. Much more is needed for full HA support. See the comments in the header and the description of what is needed in the README.ctl.txt file for more details. ctl_io.h: This defines most of the core CTL I/O structures. union ctl_io is conceptually very similar to CAM's union ccb. ctl_ioctl.h: This defines all ioctls available through the CTL character device, and the data structures needed for those ioctls. ctl_mem_pool.c, ctl_mem_pool.h: Generic memory pool implementation used by the internal frontend. ctl_private.h: Private data structres (e.g. CTL softc) and function prototypes. This also includes the SCSI vendor and product names used by CTL. ctl_scsi_all.c, ctl_scsi_all.h: CTL wrappers around CAM sense printing functions. ctl_ser_table.c: Command serialization table. This defines what happens when one type of command is followed by another type of command. ctl_util.c, ctl_util.h: CTL utility functions, primarily designed to be used from userland. See ctladm for the primary consumer of these functions. These include CDB building functions. scsi_ctl.c: CAM target peripheral driver and CTL frontend port. This is the path into CTL for commands from target-capable hardware/SIMs. README.ctl.txt: CTL code features, roadmap, to-do list. usr.sbin/Makefile: Add ctladm. ctladm/Makefile, ctladm/ctladm.8, ctladm/ctladm.c, ctladm/ctladm.h, ctladm/util.c: ctladm(8) is the CTL management utility. It fills a role similar to camcontrol(8). It allow configuring LUNs, issuing commands, injecting errors and various other control functions. usr.bin/Makefile: Add ctlstat. ctlstat/Makefile ctlstat/ctlstat.8, ctlstat/ctlstat.c: ctlstat(8) fills a role similar to iostat(8). It reports I/O statistics for CTL. sys/conf/files: Add CTL files. sys/conf/NOTES: Add device ctl. sys/cam/scsi_all.h: To conform to more recent specs, the inquiry CDB length field is now 2 bytes long. Add several mode page definitions for CTL. sys/cam/scsi_all.c: Handle the new 2 byte inquiry length. sys/dev/ciss/ciss.c, sys/dev/ata/atapi-cam.c, sys/cam/scsi/scsi_targ_bh.c, scsi_target/scsi_cmds.c, mlxcontrol/interface.c: Update for 2 byte inquiry length field. scsi_da.h: Add versions of the format and rigid disk pages that are in a more reasonable format for CTL. amd64/conf/GENERIC, i386/conf/GENERIC, ia64/conf/GENERIC, sparc64/conf/GENERIC: Add device ctl. i386/conf/PAE: The CTL frontend SIM at least does not compile cleanly on PAE. Sponsored by: Copan Systems, SGI and Spectra Logic MFC after: 1 month Added: head/sys/cam/ctl/ head/sys/cam/ctl/README.ctl.txt (contents, props changed) head/sys/cam/ctl/ctl.c (contents, props changed) head/sys/cam/ctl/ctl.h (contents, props changed) head/sys/cam/ctl/ctl_backend.c (contents, props changed) head/sys/cam/ctl/ctl_backend.h (contents, props changed) head/sys/cam/ctl/ctl_backend_block.c (contents, props changed) head/sys/cam/ctl/ctl_backend_block.h (contents, props changed) head/sys/cam/ctl/ctl_backend_ramdisk.c (contents, props changed) head/sys/cam/ctl/ctl_cmd_table.c (contents, props changed) head/sys/cam/ctl/ctl_debug.h (contents, props changed) head/sys/cam/ctl/ctl_error.c (contents, props changed) head/sys/cam/ctl/ctl_error.h (contents, props changed) head/sys/cam/ctl/ctl_frontend.c (contents, props changed) head/sys/cam/ctl/ctl_frontend.h (contents, props changed) head/sys/cam/ctl/ctl_frontend_cam_sim.c (contents, props changed) head/sys/cam/ctl/ctl_frontend_internal.c (contents, props changed) head/sys/cam/ctl/ctl_frontend_internal.h (contents, props changed) head/sys/cam/ctl/ctl_ha.h (contents, props changed) head/sys/cam/ctl/ctl_io.h (contents, props changed) head/sys/cam/ctl/ctl_ioctl.h (contents, props changed) head/sys/cam/ctl/ctl_mem_pool.c (contents, props changed) head/sys/cam/ctl/ctl_mem_pool.h (contents, props changed) head/sys/cam/ctl/ctl_private.h (contents, props changed) head/sys/cam/ctl/ctl_scsi_all.c (contents, props changed) head/sys/cam/ctl/ctl_scsi_all.h (contents, props changed) head/sys/cam/ctl/ctl_ser_table.c (contents, props changed) head/sys/cam/ctl/ctl_util.c (contents, props changed) head/sys/cam/ctl/ctl_util.h (contents, props changed) head/sys/cam/ctl/scsi_ctl.c (contents, props changed) head/usr.bin/ctlstat/ head/usr.bin/ctlstat/Makefile (contents, props changed) head/usr.bin/ctlstat/ctlstat.8 (contents, props changed) head/usr.bin/ctlstat/ctlstat.c (contents, props changed) head/usr.sbin/ctladm/ head/usr.sbin/ctladm/Makefile (contents, props changed) head/usr.sbin/ctladm/ctladm.8 (contents, props changed) head/usr.sbin/ctladm/ctladm.c (contents, props changed) head/usr.sbin/ctladm/ctladm.h (contents, props changed) head/usr.sbin/ctladm/util.c (contents, props changed) Modified: head/share/examples/scsi_target/scsi_cmds.c head/sys/amd64/conf/GENERIC head/sys/cam/scsi/scsi_all.c head/sys/cam/scsi/scsi_all.h head/sys/cam/scsi/scsi_da.h head/sys/cam/scsi/scsi_targ_bh.c head/sys/conf/NOTES head/sys/conf/files head/sys/dev/ata/atapi-cam.c head/sys/dev/ciss/ciss.c head/sys/i386/conf/GENERIC head/sys/i386/conf/PAE head/sys/ia64/conf/GENERIC head/sys/sparc64/conf/GENERIC head/usr.bin/Makefile head/usr.sbin/Makefile head/usr.sbin/mlxcontrol/interface.c Modified: head/share/examples/scsi_target/scsi_cmds.c ============================================================================== --- head/share/examples/scsi_target/scsi_cmds.c Thu Jan 12 00:05:35 2012 (r229996) +++ head/share/examples/scsi_target/scsi_cmds.c Thu Jan 12 00:34:33 2012 (r229997) @@ -328,7 +328,7 @@ tcmd_inquiry(struct ccb_accept_tio *atio bcopy(&inq_data, ctio->data_ptr, sizeof(inq_data)); ctio->dxfer_len = inq_data.additional_length + 4; ctio->dxfer_len = min(ctio->dxfer_len, - SCSI_CDB6_LEN(inq->length)); + scsi_2btoul(inq->length)); ctio->ccb_h.flags |= CAM_DIR_IN | CAM_SEND_STATUS; ctio->scsi_status = SCSI_STATUS_OK; } Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Thu Jan 12 00:05:35 2012 (r229996) +++ head/sys/amd64/conf/GENERIC Thu Jan 12 00:34:33 2012 (r229997) @@ -131,7 +131,8 @@ device da # Direct Access (disks) device sa # Sequential Access (tape etc) device cd # CD device pass # Passthrough device (direct ATA/SCSI access) -device ses # SCSI Environmental Services (and SAF-TE) +device ses # Enclosure Services (SES and SAF-TE) +device ctl # CAM Target Layer # RAID controllers interfaced to the SCSI subsystem device amr # AMI MegaRAID Added: head/sys/cam/ctl/README.ctl.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cam/ctl/README.ctl.txt Thu Jan 12 00:34:33 2012 (r229997) @@ -0,0 +1,449 @@ +/* $FreeBSD$ */ + +CTL - CAM Target Layer Description + +Revision 1.4 (December 29th, 2011) +Ken Merry + +Table of Contents: +================= + +Introduction +Features +Configuring and Running CTL +Revision 1.N Changes +To Do List +Code Roadmap +Userland Commands + +Introduction: +============ + +CTL is a disk and processor device emulation subsystem originally written +for Copan Systems under Linux starting in 2003. It has been shipping in +Copan (now SGI) products since 2005. + +It was ported to FreeBSD in 2008, and thanks to an agreement between SGI +(who acquired Copan's assets in 2010) and Spectra Logic in 2010, CTL is +available under a BSD-style license. The intent behind the agreement was +that Spectra would work to get CTL into the FreeBSD tree. + +Features: +======== + + - Disk and processor device emulation. + - Tagged queueing + - SCSI task attribute support (ordered, head of queue, simple tags) + - SCSI implicit command ordering support. (e.g. if a read follows a mode + select, the read will be blocked until the mode select completes.) + - Full task management support (abort, LUN reset, target reset, etc.) + - Support for multiple ports + - Support for multiple simultaneous initiators + - Support for multiple simultaneous backing stores + - Persistent reservation support + - Mode sense/select support + - Error injection support + - High Availability support (1) + - All I/O handled in-kernel, no userland context switch overhead. + +(1) HA Support is just an API stub, and needs much more to be fully + functional. See the to-do list below. + +Configuring and Running CTL: +=========================== + + - After applying the CTL patchset to your tree, build world and install it + on your target system. + + - Add 'device ctl' to your kernel configuration file. + + - If you're running with a 8Gb or 4Gb Qlogic FC board, add + 'options ISP_TARGET_MODE' to your kernel config file. Keep in mind that + the isp(4) driver can run in target or initiator mode, but not both on + the same machine. 'device ispfw' or loading the ispfw module is also + recommended. + + - Rebuild and install a new kernel. + + - Reboot with the new kernel. + + - To add a LUN with the RAM disk backend: + + ctladm create -b ramdisk -s 10485760000000000000 + ctladm port -o on + + - You should now see the CTL disk LUN through camcontrol devlist: + +scbus6 on ctl2cam0 bus 0: + at scbus6 target 1 lun 0 (da24,pass32) +<> at scbus6 target -1 lun -1 () + + This is visible through the CTL CAM SIM. This allows using CTL without + any physical hardware. You should be able to issue any normal SCSI + commands to the device via the pass(4)/da(4) devices. + + If any target-capable HBAs are in the system (e.g. isp(4)), and have + target mode enabled, you should now also be able to see the CTL LUNs via + that target interface. + + Note that all CTL LUNs are presented to all frontends. There is no + LUN masking, or separate, per-port configuration. + + - Note that the ramdisk backend is a "fake" ramdisk. That is, it is + backed by a small amount of RAM that is used for all I/O requests. This + is useful for performance testing, but not for any data integrity tests. + + - To add a LUN with the block/file backend: + + truncate -s +1T myfile + ctladm create -b block -o file=myfile + ctladm port -o on + + - You can also see a list of LUNs and their backends like this: + +# ctladm devlist +LUN Backend Size (Blocks) BS Serial Number Device ID + 0 block 2147483648 512 MYSERIAL 0 MYDEVID 0 + 1 block 2147483648 512 MYSERIAL 1 MYDEVID 1 + 2 block 2147483648 512 MYSERIAL 2 MYDEVID 2 + 3 block 2147483648 512 MYSERIAL 3 MYDEVID 3 + 4 block 2147483648 512 MYSERIAL 4 MYDEVID 4 + 5 block 2147483648 512 MYSERIAL 5 MYDEVID 5 + 6 block 2147483648 512 MYSERIAL 6 MYDEVID 6 + 7 block 2147483648 512 MYSERIAL 7 MYDEVID 7 + 8 block 2147483648 512 MYSERIAL 8 MYDEVID 8 + 9 block 2147483648 512 MYSERIAL 9 MYDEVID 9 + 10 block 2147483648 512 MYSERIAL 10 MYDEVID 10 + 11 block 2147483648 512 MYSERIAL 11 MYDEVID 11 + + - You can see the LUN type and backing store for block/file backend LUNs + like this: + +# ctladm devlist -v +LUN Backend Size (Blocks) BS Serial Number Device ID + 0 block 2147483648 512 MYSERIAL 0 MYDEVID 0 + lun_type=0 + num_threads=14 + file=testdisk0 + 1 block 2147483648 512 MYSERIAL 1 MYDEVID 1 + lun_type=0 + num_threads=14 + file=testdisk1 + 2 block 2147483648 512 MYSERIAL 2 MYDEVID 2 + lun_type=0 + num_threads=14 + file=testdisk2 + 3 block 2147483648 512 MYSERIAL 3 MYDEVID 3 + lun_type=0 + num_threads=14 + file=testdisk3 + 4 block 2147483648 512 MYSERIAL 4 MYDEVID 4 + lun_type=0 + num_threads=14 + file=testdisk4 + 5 block 2147483648 512 MYSERIAL 5 MYDEVID 5 + lun_type=0 + num_threads=14 + file=testdisk5 + 6 block 2147483648 512 MYSERIAL 6 MYDEVID 6 + lun_type=0 + num_threads=14 + file=testdisk6 + 7 block 2147483648 512 MYSERIAL 7 MYDEVID 7 + lun_type=0 + num_threads=14 + file=testdisk7 + 8 block 2147483648 512 MYSERIAL 8 MYDEVID 8 + lun_type=0 + num_threads=14 + file=testdisk8 + 9 block 2147483648 512 MYSERIAL 9 MYDEVID 9 + lun_type=0 + num_threads=14 + file=testdisk9 + 10 ramdisk 0 0 MYSERIAL 0 MYDEVID 0 + lun_type=3 + 11 ramdisk 204800000000000 512 MYSERIAL 1 MYDEVID 1 + lun_type=0 + + +Revision 1.4 Changes +==================== + - Added in the second HA mode (where CTL does the data transfers instead + of having data transfers done below CTL), and abstracted out the Copan + HA API. + + - Fixed the phantom device problem in the CTL CAM SIM and improved the + CAM SIM to automatically trigger a rescan when the port is enabled and + disabled. + + - Made the number of threads in the block backend configurable via sysctl, + loader tunable and the ctladm command line. (You can now specify + -o num_threads=4 when creating a LUN with ctladm create.) + + - Fixed some LUN selection issues in ctlstat(8) and allowed for selection + of LUN numbers up to 1023. + + - General cleanup. + + - This version intended for public release. + +Revision 1.3 Changes +==================== + - Added descriptor sense support to CTL. It can be enabled through the + control mode page (10), but is disabled by default. + + - Improved error injection support. The number of errors that can be + injected with 'ctladm inject' has been increased, and any arbitrary + sense data may now be injected as well. + + - The port infrastructure has been revamped. Individual ports and types + of ports may now be enabled and disabled from the command line. ctladm + now has the ability to set the WWNN and WWPN for each port. + + - The block backend can now send multiple I/Os to backing files. Multiple + writes are only allowed for ZFS, but multiple readers are allowed for + any filesystem. + + - The block and ramdisk backends now support setting the LUN blocksize. + There are some restrictions when the backing device is a block device, + but otherwise the blocksize may be set to anything. + +Revision 1.2 Changes +==================== + + - CTL initialization process has been revamped. Instead of using an + ad-hoc method, it is now sequenced through SYSINIT() calls. + + - A block/file backend has been added. This allows using arbitrary files + or block devices as a backing store. + + - The userland LUN configuration interface has been completely rewritten. + Configuration is now done out of band. + + - The ctladm(8) command line interface has been revamped, and is now + similar to camcontrol(8). + +To Do List: +========== + + - Make CTL buildable as a module. Work needs to be done on initialization, + and on freeing resources and LUNs when it is built as a module. + + - Use devstat(9) for CTL's statistics collection. CTL uses a home-grown + statistics collection system that is similar to devstat(9). ctlstat + should be retired in favor of iostat, etc., once aggregation modes are + available in iostat to match the behavior of ctlstat -t and dump modes + are available to match the behavior of ctlstat -d/ctlstat -J. + + - ZFS ARC backend for CTL. Since ZFS copies all I/O into the ARC + (Adaptive Replacement Cache), running the block/file backend on top of a + ZFS-backed zdev or file will involve an extra set of copies. The + optimal solution for backing targets served by CTL with ZFS would be to + allocate buffers out of the ARC directly, and DMA to/from them directly. + That would eliminate an extra data buffer allocation and copy. + + - Switch CTL over to using CAM CCBs instead of its own union ctl_io. This + will likely require a significant amount of work, but will eliminate + another data structure in the stack, more memory allocations, etc. This + will also require changes to the CAM CCB structure to support CTL. + + - Full-featured High Availability support. The HA API that is in ctl_ha.h + is essentially a renamed version of Copan's HA API. There is no + substance to it, but it remains in CTL to show what needs to be done to + implement active/active HA from a CTL standpoint. The things that would + need to be done include: + - A kernel level software API for message passing as well as DMA + between at least two nodes. + - Hardware support and drivers for inter-node communication. This + could be as simples as ethernet hardware and drivers. + - A "supervisor", or startup framework to control and coordinate + HA startup, failover (going from active/active to single mode), + and failback (going from single mode to active/active). + - HA support in other components of the stack. The goal behind HA + is that one node can fail and another node can seamlessly take + over handling I/O requests. This requires support from pretty + much every component in the storage stack, from top to bottom. + CTL is one piece of it, but you also need support in the RAID + stack/filesystem/backing store. You also need full configuration + mirroring, and all peer nodes need to be able to talk to the + underlying storage hardware. + +Code Roadmap: +============ + +CTL has the concept of pluggable frontend ports and backends. All +frontends and backends can be active at the same time. You can have a +ramdisk-backed LUN present along side a file backed LUN. + +ctl.c: +----- + +This is the core of CTL, where all of the command handlers and a lot of +other things live. Yes, it is large. It started off small and grew to its +current size over time. Perhaps it can be split into more files at some +point. + +Here is a roadmap of some of the primary functions in ctl.c. Starting here +and following the various leaf functions will show the command flow. + +ctl_queue() This is where commands from the frontend ports come + in. + +ctl_queue_sense() This is only used for non-packetized SCSI. i.e. + parallel SCSI prior to U320 and perhaps U160. + +ctl_work_thread() This is the primary work thread, and everything gets + executed from there. + +ctl_scsiio_precheck() This where all of the initial checks are done, and I/O + is either queued for execution or blocked. + +ctl_scsiio() This is where the command handler is actually + executed. (See ctl_cmd_table.c for the mapping of + SCSI opcode to command handler function.) + +ctl_done() This is the routine called (or ctl_done_lock()) to + initiate the command completion process. + +ctl_process_done() This is where command completion actually happens. + +ctl.h: +----- + +Basic function declarations and data structures. + +ctl_backend.c, +ctl_backend.h: +------------- + +These files define the basic CTL backend API. The comments in the header +explain the API. + +ctl_backend_block.c +ctl_backend_block.h: +------------------- + +The block and file backend. This allows for using a disk or a file as the +backing store for a LUN. Multiple threads are started to do I/O to the +backing device, primarily because the VFS API requires that to get any +concurrency. + +ctl_backend_ramdisk.c: +--------------------- + +A "fake" ramdisk backend. It only allocates a small amount of memory to +act as a source and sink for reads and writes from an initiator. Therefore +it cannot be used for any real data, but it can be used to test for +throughput. It can also be used to test initiators' support for extremely +large LUNs. + +ctl_cmd_table.c: +--------------- + +This is a table with all 256 possible SCSI opcodes, and command handler +functions defined for supported opcodes. It is included in ctl.c. + +ctl_debug.h: +----------- + +Simplistic debugging support. + +ctl_error.c, +ctl_error.h: +----------- + +CTL-specific wrappers around the CAM sense building functions. + +ctl_frontend.c, +ctl_frontend.h: +-------------- + +These files define the basic CTL frontend port API. The comments in the +header explain the API. + +ctl_frontend_cam_sim.c: +---------------------- + +This is a CTL frontend port that is also a CAM SIM. The idea is that this +frontend allows for using CTL without any target-capable hardware. So any +LUNs you create in CTL are visible via this port. + + +ctl_frontend_internal.c +ctl_frontend_internal.h: +----------------------- + +This is a frontend port written for Copan to do some system-specific tasks +that required sending commands into CTL from inside the kernel. This isn't +entirely relevant to FreeBSD in general, but can perhaps be repurposed or +removed later. + +ctl_ha.h: +-------- + +This is a stubbed-out High Availability API. See the comments in the +header and the description of what is needed as far as HA support above. + +ctl_io.h: +-------- + +This defines most of the core CTL I/O structures. union ctl_io is +conceptually very similar to CAM's union ccb. + +ctl_ioctl.h: +----------- + +This defines all ioctls available through the CTL character device, and +the data structures needed for those ioctls. + +ctl_mem_pool.c +ctl_mem_pool.h: +-------------- + +Generic memory pool implementation. This is currently only used by the +internal frontend. The internal frontend can probably be rewritten to use +UMA zones and this can be removed. + +ctl_private.h: +------------- + +Private data structres (e.g. CTL softc) and function prototypes. This also +includes the SCSI vendor and product names used by CTL. + +ctl_scsi_all.c +ctl_scsi_all.h: +-------------- + +CTL wrappers around CAM sense printing functions. + +ctl_ser_table.c: +--------------- + +Command serialization table. This defines what happens when one type of +command is followed by another type of command. e.g., what do you do when +you have a mode select followed by a write? You block the write until the +mode select is complete. That is defined in this table. + +ctl_util.c +ctl_util.h: +---------- + +CTL utility functions, primarily designed to be used from userland. See +ctladm for the primary consumer of these functions. These include CDB +building functions. + +scsi_ctl.c: +---------- + +CAM target peripheral driver and CTL frontend port. This is the path into +CTL for commands from target-capable hardware/SIMs. + +Userland Commands: +================= + +ctladm(8) fills a role similar to camcontrol(8). It allow configuring LUNs, +issuing commands, injecting errors and various other control functions. + +ctlstat(8) fills a role similar to iostat(8). It reports I/O statistics +for CTL. Added: head/sys/cam/ctl/ctl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cam/ctl/ctl.c Thu Jan 12 00:34:33 2012 (r229997) @@ -0,0 +1,13082 @@ +/*- + * Copyright (c) 2003-2009 Silicon Graphics International Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + * + * $Id: //depot/users/kenm/FreeBSD-test2/sys/cam/ctl/ctl.c#8 $ + */ +/* + * CAM Target Layer, a SCSI device emulation subsystem. + * + * Author: Ken Merry + */ + +#define _CTL_C + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct ctl_softc *control_softc = NULL; + +/* + * The default is to run with CTL_DONE_THREAD turned on. Completed + * transactions are queued for processing by the CTL work thread. When + * CTL_DONE_THREAD is not defined, completed transactions are processed in + * the caller's context. + */ +#define CTL_DONE_THREAD + +/* + * * Use the serial number and device ID provided by the backend, rather than + * * making up our own. + * */ +#define CTL_USE_BACKEND_SN + +/* + * Size and alignment macros needed for Copan-specific HA hardware. These + * can go away when the HA code is re-written, and uses busdma for any + * hardware. + */ +#define CTL_ALIGN_8B(target, source, type) \ + if (((uint32_t)source & 0x7) != 0) \ + target = (type)(source + (0x8 - ((uint32_t)source & 0x7)));\ + else \ + target = (type)source; + +#define CTL_SIZE_8B(target, size) \ + if ((size & 0x7) != 0) \ + target = size + (0x8 - (size & 0x7)); \ + else \ + target = size; + +#define CTL_ALIGN_8B_MARGIN 16 + +/* + * Template mode pages. + */ + +/* + * Note that these are default values only. The actual values will be + * filled in when the user does a mode sense. + */ +static struct copan_power_subpage power_page_default = { + /*page_code*/ PWR_PAGE_CODE | SMPH_SPF, + /*subpage*/ PWR_SUBPAGE_CODE, + /*page_length*/ {(sizeof(struct copan_power_subpage) - 4) & 0xff00, + (sizeof(struct copan_power_subpage) - 4) & 0x00ff}, + /*page_version*/ PWR_VERSION, + /* total_luns */ 26, + /* max_active_luns*/ PWR_DFLT_MAX_LUNS, + /*reserved*/ {0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0} +}; + +static struct copan_power_subpage power_page_changeable = { + /*page_code*/ PWR_PAGE_CODE | SMPH_SPF, + /*subpage*/ PWR_SUBPAGE_CODE, + /*page_length*/ {(sizeof(struct copan_power_subpage) - 4) & 0xff00, + (sizeof(struct copan_power_subpage) - 4) & 0x00ff}, + /*page_version*/ 0, + /* total_luns */ 0, + /* max_active_luns*/ 0, + /*reserved*/ {0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0} +}; + +static struct copan_aps_subpage aps_page_default = { + APS_PAGE_CODE | SMPH_SPF, //page_code + APS_SUBPAGE_CODE, //subpage + {(sizeof(struct copan_aps_subpage) - 4) & 0xff00, + (sizeof(struct copan_aps_subpage) - 4) & 0x00ff}, //page_length + APS_VERSION, //page_version + 0, //lock_active + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0} //reserved +}; + +static struct copan_aps_subpage aps_page_changeable = { + APS_PAGE_CODE | SMPH_SPF, //page_code + APS_SUBPAGE_CODE, //subpage + {(sizeof(struct copan_aps_subpage) - 4) & 0xff00, + (sizeof(struct copan_aps_subpage) - 4) & 0x00ff}, //page_length + 0, //page_version + 0, //lock_active + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0} //reserved +}; + +static struct copan_debugconf_subpage debugconf_page_default = { + DBGCNF_PAGE_CODE | SMPH_SPF, /* page_code */ + DBGCNF_SUBPAGE_CODE, /* subpage */ + {(sizeof(struct copan_debugconf_subpage) - 4) >> 8, + (sizeof(struct copan_debugconf_subpage) - 4) >> 0}, /* page_length */ + DBGCNF_VERSION, /* page_version */ + {CTL_TIME_IO_DEFAULT_SECS>>8, + CTL_TIME_IO_DEFAULT_SECS>>0}, /* ctl_time_io_secs */ +}; + +static struct copan_debugconf_subpage debugconf_page_changeable = { + DBGCNF_PAGE_CODE | SMPH_SPF, /* page_code */ + DBGCNF_SUBPAGE_CODE, /* subpage */ + {(sizeof(struct copan_debugconf_subpage) - 4) >> 8, + (sizeof(struct copan_debugconf_subpage) - 4) >> 0}, /* page_length */ + 0, /* page_version */ + {0xff,0xff}, /* ctl_time_io_secs */ +}; + +static struct scsi_format_page format_page_default = { + /*page_code*/SMS_FORMAT_DEVICE_PAGE, + /*page_length*/sizeof(struct scsi_format_page) - 2, + /*tracks_per_zone*/ {0, 0}, + /*alt_sectors_per_zone*/ {0, 0}, + /*alt_tracks_per_zone*/ {0, 0}, + /*alt_tracks_per_lun*/ {0, 0}, + /*sectors_per_track*/ {(CTL_DEFAULT_SECTORS_PER_TRACK >> 8) & 0xff, + CTL_DEFAULT_SECTORS_PER_TRACK & 0xff}, + /*bytes_per_sector*/ {0, 0}, + /*interleave*/ {0, 0}, + /*track_skew*/ {0, 0}, + /*cylinder_skew*/ {0, 0}, + /*flags*/ SFP_HSEC, + /*reserved*/ {0, 0, 0} +}; + +static struct scsi_format_page format_page_changeable = { + /*page_code*/SMS_FORMAT_DEVICE_PAGE, + /*page_length*/sizeof(struct scsi_format_page) - 2, + /*tracks_per_zone*/ {0, 0}, + /*alt_sectors_per_zone*/ {0, 0}, + /*alt_tracks_per_zone*/ {0, 0}, + /*alt_tracks_per_lun*/ {0, 0}, + /*sectors_per_track*/ {0, 0}, + /*bytes_per_sector*/ {0, 0}, + /*interleave*/ {0, 0}, + /*track_skew*/ {0, 0}, + /*cylinder_skew*/ {0, 0}, + /*flags*/ 0, + /*reserved*/ {0, 0, 0} +}; + +static struct scsi_rigid_disk_page rigid_disk_page_default = { + /*page_code*/SMS_RIGID_DISK_PAGE, + /*page_length*/sizeof(struct scsi_rigid_disk_page) - 2, + /*cylinders*/ {0, 0, 0}, + /*heads*/ CTL_DEFAULT_HEADS, + /*start_write_precomp*/ {0, 0, 0}, + /*start_reduced_current*/ {0, 0, 0}, + /*step_rate*/ {0, 0}, + /*landing_zone_cylinder*/ {0, 0, 0}, + /*rpl*/ SRDP_RPL_DISABLED, + /*rotational_offset*/ 0, + /*reserved1*/ 0, + /*rotation_rate*/ {(CTL_DEFAULT_ROTATION_RATE >> 8) & 0xff, + CTL_DEFAULT_ROTATION_RATE & 0xff}, + /*reserved2*/ {0, 0} +}; + +static struct scsi_rigid_disk_page rigid_disk_page_changeable = { + /*page_code*/SMS_RIGID_DISK_PAGE, + /*page_length*/sizeof(struct scsi_rigid_disk_page) - 2, + /*cylinders*/ {0, 0, 0}, + /*heads*/ 0, + /*start_write_precomp*/ {0, 0, 0}, + /*start_reduced_current*/ {0, 0, 0}, + /*step_rate*/ {0, 0}, + /*landing_zone_cylinder*/ {0, 0, 0}, + /*rpl*/ 0, + /*rotational_offset*/ 0, + /*reserved1*/ 0, + /*rotation_rate*/ {0, 0}, + /*reserved2*/ {0, 0} +}; + +static struct scsi_caching_page caching_page_default = { + /*page_code*/SMS_CACHING_PAGE, + /*page_length*/sizeof(struct scsi_caching_page) - 2, + /*flags1*/ SCP_DISC | SCP_WCE, + /*ret_priority*/ 0, + /*disable_pf_transfer_len*/ {0xff, 0xff}, + /*min_prefetch*/ {0, 0}, + /*max_prefetch*/ {0xff, 0xff}, + /*max_pf_ceiling*/ {0xff, 0xff}, + /*flags2*/ 0, + /*cache_segments*/ 0, + /*cache_seg_size*/ {0, 0}, + /*reserved*/ 0, + /*non_cache_seg_size*/ {0, 0, 0} +}; + +static struct scsi_caching_page caching_page_changeable = { + /*page_code*/SMS_CACHING_PAGE, + /*page_length*/sizeof(struct scsi_caching_page) - 2, + /*flags1*/ 0, + /*ret_priority*/ 0, + /*disable_pf_transfer_len*/ {0, 0}, + /*min_prefetch*/ {0, 0}, + /*max_prefetch*/ {0, 0}, + /*max_pf_ceiling*/ {0, 0}, + /*flags2*/ 0, + /*cache_segments*/ 0, + /*cache_seg_size*/ {0, 0}, + /*reserved*/ 0, + /*non_cache_seg_size*/ {0, 0, 0} +}; + +static struct scsi_control_page control_page_default = { + /*page_code*/SMS_CONTROL_MODE_PAGE, + /*page_length*/sizeof(struct scsi_control_page) - 2, + /*rlec*/0, + /*queue_flags*/0, + /*eca_and_aen*/0, + /*reserved*/0, + /*aen_holdoff_period*/{0, 0} +}; + +static struct scsi_control_page control_page_changeable = { + /*page_code*/SMS_CONTROL_MODE_PAGE, + /*page_length*/sizeof(struct scsi_control_page) - 2, + /*rlec*/SCP_DSENSE, + /*queue_flags*/0, + /*eca_and_aen*/0, + /*reserved*/0, + /*aen_holdoff_period*/{0, 0} +}; + +SYSCTL_NODE(_kern_cam, OID_AUTO, ctl, CTLFLAG_RD, 0, "CAM Target Layer"); + +/* + * XXX KDM move these into the softc. + */ +static int rcv_sync_msg; +static int persis_offset; +static uint8_t ctl_pause_rtr; +static int ctl_is_single; +static int index_to_aps_page; + + +/* + * Serial number (0x80), device id (0x83), and supported pages (0x00) + */ +#define SCSI_EVPD_NUM_SUPPORTED_PAGES 3 + +static void ctl_isc_event_handler(ctl_ha_channel chanel, ctl_ha_event event, + int param); +static void ctl_copy_sense_data(union ctl_ha_msg *src, union ctl_io *dest); +static void ctl_init(void); +void ctl_shutdown(void); +static int ctl_open(struct cdev *dev, int flags, int fmt, struct thread *td); +static int ctl_close(struct cdev *dev, int flags, int fmt, struct thread *td); +static void ctl_ioctl_online(void *arg); +static void ctl_ioctl_offline(void *arg); +static int ctl_ioctl_targ_enable(void *arg, struct ctl_id targ_id); +static int ctl_ioctl_targ_disable(void *arg, struct ctl_id targ_id); +static int ctl_ioctl_lun_enable(void *arg, struct ctl_id targ_id, int lun_id); +static int ctl_ioctl_lun_disable(void *arg, struct ctl_id targ_id, int lun_id); +static int ctl_ioctl_do_datamove(struct ctl_scsiio *ctsio); +static int ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio, int have_lock); +static int ctl_ioctl_submit_wait(union ctl_io *io); +static void ctl_ioctl_datamove(union ctl_io *io); +static void ctl_ioctl_done(union ctl_io *io); +static void ctl_ioctl_hard_startstop_callback(void *arg, + struct cfi_metatask *metatask); +static void ctl_ioctl_bbrread_callback(void *arg,struct cfi_metatask *metatask); +static int ctl_ioctl_fill_ooa(struct ctl_lun *lun, uint32_t *cur_fill_num, + struct ctl_ooa *ooa_hdr); +static int ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, + struct thread *td); +uint32_t ctl_get_resindex(struct ctl_nexus *nexus); +uint32_t ctl_port_idx(int port_num); +#ifdef unused +static union ctl_io *ctl_malloc_io(ctl_io_type io_type, uint32_t targ_port, + uint32_t targ_target, uint32_t targ_lun, + int can_wait); +static void ctl_kfree_io(union ctl_io *io); +#endif /* unused */ +static void ctl_free_io_internal(union ctl_io *io, int have_lock); +static int ctl_alloc_lun(struct ctl_softc *ctl_softc, struct ctl_lun *lun, + struct ctl_be_lun *be_lun, struct ctl_id target_id); +static int ctl_free_lun(struct ctl_lun *lun); +static void ctl_create_lun(struct ctl_be_lun *be_lun); +/** +static void ctl_failover_change_pages(struct ctl_softc *softc, + struct ctl_scsiio *ctsio, int master); +**/ + +static int ctl_do_mode_select(union ctl_io *io); +static int ctl_pro_preempt(struct ctl_softc *softc, struct ctl_lun *lun, + uint64_t res_key, uint64_t sa_res_key, + uint8_t type, uint32_t residx, + struct ctl_scsiio *ctsio, + struct scsi_per_res_out *cdb, + struct scsi_per_res_out_parms* param); +static void ctl_pro_preempt_other(struct ctl_lun *lun, + union ctl_ha_msg *msg); +static void ctl_hndl_per_res_out_on_other_sc(union ctl_ha_msg *msg); +static int ctl_inquiry_evpd_supported(struct ctl_scsiio *ctsio, int alloc_len); +static int ctl_inquiry_evpd_serial(struct ctl_scsiio *ctsio, int alloc_len); +static int ctl_inquiry_evpd_devid(struct ctl_scsiio *ctsio, int alloc_len); +static int ctl_inquiry_evpd(struct ctl_scsiio *ctsio); +static int ctl_inquiry_std(struct ctl_scsiio *ctsio); +static int ctl_get_lba_len(union ctl_io *io, uint64_t *lba, uint32_t *len); +static ctl_action ctl_extent_check(union ctl_io *io1, union ctl_io *io2); +static ctl_action ctl_check_for_blockage(union ctl_io *pending_io, + union ctl_io *ooa_io); +static ctl_action ctl_check_ooa(struct ctl_lun *lun, union ctl_io *pending_io, + union ctl_io *starting_io); +static int ctl_check_blocked(struct ctl_lun *lun); +static int ctl_scsiio_lun_check(struct ctl_softc *ctl_softc, + struct ctl_lun *lun, + struct ctl_cmd_entry *entry, + struct ctl_scsiio *ctsio); +//static int ctl_check_rtr(union ctl_io *pending_io, struct ctl_softc *softc); +static void ctl_failover(void); +static int ctl_scsiio_precheck(struct ctl_softc *ctl_softc, + struct ctl_scsiio *ctsio); +static int ctl_scsiio(struct ctl_scsiio *ctsio); + +static int ctl_bus_reset(struct ctl_softc *ctl_softc, union ctl_io *io); +static int ctl_target_reset(struct ctl_softc *ctl_softc, union ctl_io *io, + ctl_ua_type ua_type); +static int ctl_lun_reset(struct ctl_lun *lun, union ctl_io *io, + ctl_ua_type ua_type); +static int ctl_abort_task(union ctl_io *io); +static void ctl_run_task_queue(struct ctl_softc *ctl_softc); +#ifdef CTL_IO_DELAY +static void ctl_datamove_timer_wakeup(void *arg); +static void ctl_done_timer_wakeup(void *arg); +#endif /* CTL_IO_DELAY */ + +static void ctl_send_datamove_done(union ctl_io *io, int have_lock); +static void ctl_datamove_remote_write_cb(struct ctl_ha_dt_req *rq); +static int ctl_datamove_remote_dm_write_cb(union ctl_io *io); +static void ctl_datamove_remote_write(union ctl_io *io); +static int ctl_datamove_remote_dm_read_cb(union ctl_io *io); +static void ctl_datamove_remote_read_cb(struct ctl_ha_dt_req *rq); +static int ctl_datamove_remote_sgl_setup(union ctl_io *io); +static int ctl_datamove_remote_xfer(union ctl_io *io, unsigned command, + ctl_ha_dt_cb callback); +static void ctl_datamove_remote_read(union ctl_io *io); +static void ctl_datamove_remote(union ctl_io *io); +static int ctl_process_done(union ctl_io *io, int have_lock); +static void ctl_work_thread(void *arg); + +/* + * Load the serialization table. This isn't very pretty, but is probably + * the easiest way to do it. + */ +#include "ctl_ser_table.c" + +/* + * We only need to define open, close and ioctl routines for this driver. + */ +static struct cdevsw ctl_cdevsw = { + .d_version = D_VERSION, + .d_flags = 0, + .d_open = ctl_open, + .d_close = ctl_close, + .d_ioctl = ctl_ioctl, + .d_name = "ctl", +}; + + +MALLOC_DEFINE(M_CTL, "ctlmem", "Memory used for CTL"); + +/* + * If we have the CAM SIM, we may or may not have another SIM that will + * cause CTL to get initialized. If not, we need to initialize it. + */ +SYSINIT(ctl_init, SI_SUB_CONFIGURE, SI_ORDER_THIRD, ctl_init, NULL); + +static void +ctl_isc_handler_finish_xfer(struct ctl_softc *ctl_softc, + union ctl_ha_msg *msg_info) +{ + struct ctl_scsiio *ctsio; + + if (msg_info->hdr.original_sc == NULL) { + printf("%s: original_sc == NULL!\n", __func__); + /* XXX KDM now what? */ + return; + } + + ctsio = &msg_info->hdr.original_sc->scsiio; + ctsio->io_hdr.flags |= CTL_FLAG_IO_ACTIVE; + ctsio->io_hdr.msg_type = CTL_MSG_FINISH_IO; + ctsio->io_hdr.status = msg_info->hdr.status; + ctsio->scsi_status = msg_info->scsi.scsi_status; + ctsio->sense_len = msg_info->scsi.sense_len; + ctsio->sense_residual = msg_info->scsi.sense_residual; + ctsio->residual = msg_info->scsi.residual; + memcpy(&ctsio->sense_data, &msg_info->scsi.sense_data, + sizeof(ctsio->sense_data)); + memcpy(&ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, + &msg_info->scsi.lbalen, sizeof(msg_info->scsi.lbalen));; + STAILQ_INSERT_TAIL(&ctl_softc->isc_queue, &ctsio->io_hdr, links); + ctl_wakeup_thread(); +} + +static void +ctl_isc_handler_finish_ser_only(struct ctl_softc *ctl_softc, + union ctl_ha_msg *msg_info) +{ + struct ctl_scsiio *ctsio; + + if (msg_info->hdr.serializing_sc == NULL) { + printf("%s: serializing_sc == NULL!\n", __func__); + /* XXX KDM now what? */ + return; + } + + ctsio = &msg_info->hdr.serializing_sc->scsiio; +#if 0 + /* + * Attempt to catch the situation where an I/O has + * been freed, and we're using it again. + */ + if (ctsio->io_hdr.io_type == 0xff) { + union ctl_io *tmp_io; + tmp_io = (union ctl_io *)ctsio; + printf("%s: %p use after free!\n", __func__, + ctsio); + printf("%s: type %d msg %d cdb %x iptl: " + "%d:%d:%d:%d tag 0x%04x " + "flag %#x status %x\n", + __func__, + tmp_io->io_hdr.io_type, + tmp_io->io_hdr.msg_type, + tmp_io->scsiio.cdb[0], + tmp_io->io_hdr.nexus.initid.id, + tmp_io->io_hdr.nexus.targ_port, + tmp_io->io_hdr.nexus.targ_target.id, + tmp_io->io_hdr.nexus.targ_lun, + (tmp_io->io_hdr.io_type == + CTL_IO_TASK) ? + tmp_io->taskio.tag_num : + tmp_io->scsiio.tag_num, + tmp_io->io_hdr.flags, + tmp_io->io_hdr.status); + } +#endif + ctsio->io_hdr.msg_type = CTL_MSG_FINISH_IO; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 00:34:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60721106564A; Thu, 12 Jan 2012 00:34: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 4C2498FC18; Thu, 12 Jan 2012 00:34: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 q0C0YsUQ084251; Thu, 12 Jan 2012 00:34:54 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0C0Ysw9084249; Thu, 12 Jan 2012 00:34:54 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201201120034.q0C0Ysw9084249@svn.freebsd.org> From: Hiroki Sato Date: Thu, 12 Jan 2012 00:34:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229998 - stable/9/release/doc/en_US.ISO8859-1/relnotes X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 00:34:54 -0000 Author: hrs Date: Thu Jan 12 00:34:54 2012 New Revision: 229998 URL: http://svn.freebsd.org/changeset/base/229998 Log: Add relnotes items: hhook(9) and khelp(9), hw.memtest.tests loader tunable, posix_fallocate(2), boot loader menu updated, iwn(4) firmware update, vxge(4) for Neterion X3100 10GbE Server/Storage adapter added, ipfw(8) fwd IPv6 support, ipfw(8) call/retrun action added, IPv4 /31 network support as in RFC 3021, IPV6_PKTINFO bug fixed, h_ertt(4) (Enhanced Round Trip Time) khelp module added, ng_ipfw(4) IPv6 support, arcmsr(4) 1.20.00.22, cam(4) descriptor format sense data in SPC-3 support added, mxge(4) updated, tws(4) for 3ware 9750 SATA+SAS 6Gb/s RAID controller added, newfs(8), fsck_ffs(8) -E option added, NFS nocto mount option added, vfs.typenumhash loader tunable, libarchive, tar(1), cpio(1) 2.8.4, makefs(8) ISO 9660 support, rtadvd(8), rtsold(8) RDNSS/DNSSL RA option support, rtadvd(8) noifprefix keyword, tftpd(8) interop issue fixed, zpool(8) labelclear command added, awk 20110807, compiler-rt imported, netcat 4.9, tnftp 20100118, less v444, OpenSSH 5.8p2 + hpn patch, pf 4.5, sendmail 8.14.5, tzdata2011m, xz 20110711. - Add descriptions about network configuration changes, openresolv import, and disk partition management utilities. Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Thu Jan 12 00:34:33 2012 (r229997) +++ stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Thu Jan 12 00:34:54 2012 (r229998) @@ -213,14 +213,34 @@ PT_GNU_STACK for the specified ABIs (e.g. elf32 for 32-bit ABI).
+ The &man.hhook.9; (Helper Hook) + and &man.khelp.9; (Kernel Helpers) KPI have been implemented. + These are a kind of superset of &man.pfil.9; framework for + more general use in the kernel. The &man.hhook.9; KPI + provides a way for kernel subsystems to export hook points + that &man.khelp.9; modules can hook to provide enhanced or new + functionality to the kernel. The &man.khelp.9; KPI provides a + framework for managing &man.khelp.9; modules, which indirectly + use the &man.hhook.9; KPI to register their hook functions + with hook points of interest within the kernel. These allow a + structured way to dynamically extend the kernel at runtime in + an ABI preserving manner. + + A &man.loader.8; + tunable hw.memtest.tests has been added. + This controls whether performing a memory testing at boot time + or not. The default value is 1 (performs a + memory test). + A new resource accounting API has been - implemented. It can keep per-process, per-jail, - per-loginclass, and per-loginclass resource accounting - information. Note that this is not built nor installed by - default. To build and install them, specify options - RACCT in the kernel configuration file and rebuild - the base system as described in &os Handbook (). + implemented. It can keep per-process, per-jail, and + per-loginclass resource accounting information. Note that + this is not built nor installed by default. To build and + install them, specify options RACCT in the + kernel configuration file and rebuild the base system as + described in &os; + Handbook.
A new resource limiting API has been implemented. It works in conjunction with @@ -231,8 +251,9 @@ that this is not built nor installed by default. To build and install them, specify options RCTL in the kernel configuration file and rebuild the base system as - described in &os Handbook (). + described in &os; + Handbook. The &man.sendmsg.2; and &man.recvmsg.2; system calls in &os; Linux ABI compatibility have been @@ -245,6 +266,11 @@ Std 1003.1-2008 (POSIX, Single UNIX Specification Version 4). + &man.posix.fallocate.2; system call has + been implemented. This is a function in POSIX to ensure that + a part of storage for regular file data is allocated on the + file system storage media. + Two new system calls setloginclass(2) and getloginclass(2) have been added. This @@ -257,11 +283,13 @@ that this is not built nor installed by default. To build and install them, specify options COMPAT_43 in the kernel configuration file and rebuild the base system as - described in &os; Handbook (). - - The following &man.sysctl.8; variables - for showing availability of various kernel features: + described in &os; + Handbook. + + The following + &man.sysctl.8; variables have been added to show availability + of various kernel features: @@ -572,6 +600,9 @@ Boot Loader Changes + The default boot loader menu has been + updated. + The &man.loader.8; loader now supports PBVM (Pre-Boot Virtual Memory). This allows to link the kernel at a fixed virtual address without having to @@ -598,18 +629,15 @@ one wants to use the nominal frequency of the chip in Intel processors, for example. + The &os; &man.usb.4; + subsystem now supports USB 3.0 by default. + The &os; &man.usb.4; subsystem now supports USB packet filter. This allows to capture packets which go through each USB host controllers. The implementation is almost based on &man.bpf.4; code. The userland program &man.usbdump.8; has been added. - - Multimedia Support - - - - Network Interface Support @@ -617,9 +645,9 @@ could make AR8152-based network interfaces stop working has been fixed. - bxe(4) driver for Broadcom NetXtreme - II 10GbE controller (BCM57710, BCM57711, BCM57711E) has - been added. + A bxe(4) driver for Broadcom + NetXtreme II 10GbE controller (BCM57710, BCM57711, + BCM57711E) has been added. A &man.cxgb.4; driver has been updated to version 7.11.0. @@ -644,6 +672,10 @@ The &man.ixgbe.4; driver has been updated to version 2.3.8. + Firmware images in the &man.iwn.4; + driver for 1000, 5000, 6000, and 6500 series have been + updated. + A bug in &man.msk.4; driver has been fixed. It could prevent the RX checksum offloading from working. @@ -725,6 +757,9 @@ Ethernet controller, which is commonly found on Vortex86 System On a Chip, has been added. + A &man.vxge.4; driver for Neterion + X3100 10GbE Server/Storage adapter has been added. + A bug in &man.wpi.4; driver has been fixed. It could display the following error messages and result in the device unusable: @@ -738,6 +773,20 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile Network Protocols + The &man.ipfw.8; now supports IPv6 in + the fwd action. + + The &man.ipfw.8; now supports + call and return + action. Upon the call action, The + current rule number is saved in the internal stack and + ruleset processing continues with the first rule numbered + number or higher. The return action + takes rule number saved to internal stack by the last + call action and returns ruleset + processing to the first rule with number greater than number + of corresponding call rule. + &os; &man.ipsec.4; support now uses a half of the hash size as the authenticator hash size in Hashed Message Authentication Mode (HMAC-SHA-256, @@ -754,14 +803,26 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile nor installed by default. To build and install them, specify WITH_OFED=yes in /etc/src.conf and rebuild the base - system as described in &os Handbook (). + system as described in &os; + Handbook. + + &os; TCP/IP network stack now supports + IPv4 prefixes with /31 as described in RFC 3021, + Using 31-Bit Prefixes on IPv4 Point-to-Point + Links. A bug in &os; TCP/IP network stack has been fixed. The source address selection could not being performed when multicast options were present but without an interface being specified. + A bug in + IPV6_PKTINFO option used in + &man.sendmsg.2; has been fixed. The caused + IPV6_USE_MIN_MTU state set by + &man.setsockopt.2; was ignored. + &os; TCP/IP network stack now supports &man.mod.cc.9; pluggable congestion control framework. This allows TCP congestion @@ -780,12 +841,23 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile For more detail, see &man.mod.cc.4; and &man.mod.cc.9; manual pages. + An &man.h.ertt.4; (Enhanced Round Trip + Time) &man.khelp.9; module has been added. This module + allows per-connection, low noise estimate of the + instantaneous RTT in the TCP/IP network stack with a robust + implementation even in the face of delayed acknowledgments + and/or TSO (TCP Segmentation Offload) being in use for a + connection. + A new &man.tcp.4; socket option TCP_CONGESTION has been added. This allows to select or query a congestion control algorithm that the TCP/IP network stack will use for connections on the socket. + The &man.ng.ipfw.4; &man.netgraph.4; + node now supports IPv6. + The &man.ng.one2many.4; &man.netgraph.4; node now supports XMIT_FAILOVER transmit algorithm. This @@ -816,6 +888,13 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile runtime, but it takes effect only after a device reset. + The &man.arcmsr.4; driver has been + updated to version 1.20.00.22. + + The &man.cam.4; subsystem now supports + descriptor format sense data in SPC-3 (SCSI Primary Commands + 3) specification. + The &man.geom.map.4; GEOM class has been added. This allows to generate multiple geom providers based on a hard-coded layout of a device with no explicit @@ -857,12 +936,11 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile A bug in the &man.mmc.4; driver that could fail in device detection has been fixed. - ZFS subsystem has been updated to the - SPA (Storage Pool Allocator, also known as zpool) version - 28. It now supports data deduplication, triple parity RAIDZ - (raidz3), snapshot holds, log device removal, zfs diff, - zpool split, zpool import , and read-only - zpool import. + The &man.mxge.4; driver has been + updated. + + A &man.tws.4; driver for 3ware 9750 + SATA+SAS 6Gb/s RAID controller has been added. @@ -879,16 +957,28 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile automatically enables the softupdates journaling for newly-created UFS file systems. - The &os; Fast File System now supports - TRIM command when freeing data blocks. A - new flag in the &man.newfs.8; and - &man.tunefs.8; utilities sets the TRIM-enable flag in a file - system. The TRIM-enable flag makes the file system send a - delete request to the underlying device for each freed - block. The TRIM command is specified as - Data Set Management Command in ATA8-ACS2 standard to carry - the information related to deleted data blocks to device, - especially for SSD (Solid-State Drive) for optimization. + The &os; Fast File System now + supports TRIM command when freeing data + blocks. A new flag in the &man.newfs.8; + and &man.tunefs.8; utilities sets the TRIM-enable flag in a + file system. The TRIM-enable flag makes the file system + send a delete request to the underlying device for each + freed block. The TRIM command is + specified as Data Set Management Command in ATA8-ACS2 + standard to carry the information related to deleted data + blocks to device, especially for SSD (Solid-State Drive) for + optimization. + + A new flag has + been added to &man.newfs.8; and &man.fsck.ffs.8; utilities. + This clears unallocated blocks, notifying the underlying + device that they are not used and that their contents may be + discarded. This is useful in &man.fsck.ffs.8; for file + systems which have been mounted on systems without + TRIM support, or with + TRIM support disabled, as well as + filesystems which have been copied from one device to + another. The &os NFS subsystem has been updated. The new implementation supports NFS version 4 in @@ -919,6 +1009,30 @@ nfsuserd_enable="YES" For more information about NFSv4 and its configuration, see &man.nfsv4.4; and &man.exports.5; manual pages. + + The &os; NFS subsystem now supports a + mount option. This disables + close-to-open cache coherency check at open time. This + option may improve performance for read-only mounts, but + should only be used if the data on the server changes + rarely. The &man.mount.nfs.8; utility now also supports + this flag keyword. + + A &man.loader.8; tunable + vfs.typenumhash has been added and set to + 1 by default. This enables to use a hash + calculation on file system identification number internally + used in the kernel. This fixes Stale NFS file + handle error on NFS clients when upgrading or + rebuilding the kernel on the NFS server due to unexpected + change of the values. + + The &os; ZFS subsystem has been + updated to the SPA (Storage Pool Allocator, also known as + zpool) version 28. It now supports data deduplication, + triple parity RAIDZ (raidz3), snapshot holds, log device + removal, zfs diff, zpool split, zpool import + , and read-only zpool import.
@@ -930,6 +1044,10 @@ nfsuserd_enable="YES" &man.cbrtl.3; have been added to libm. + The &man.bsdtar.1; and + &man.cpio.1; utility are now based on + libarchive version 2.8.4. + The &man.cpuset.1; utility now supports a flag to create a new cpuset and assign an existing process into that set, and an @@ -983,8 +1101,9 @@ nfsuserd_enable="YES" build and install them, specify WITH_ICONV=yes in /etc/src.conf and rebuild the base system - as described in &os Handbook (). + described in &os; + Handbook. The &man.ifconfig.8; utility now supports fdx, flow, @@ -1000,6 +1119,9 @@ nfsuserd_enable="YES" now use it instead of GNU libreadline. + The &man.makefs.8; utility now supports + ISO 9660 format. + libmd and libcrypt now support SHA-256 and SHA-512 algorithm. @@ -1043,6 +1165,22 @@ nfsuserd_enable="YES" usertime and options for accumulated system and user CPU time, respectively. + The &man.rtadvd.8; daemon now supports + noifprefix keyword to disable gathering + on-link prefixes from interfaces when no + addr keyword is specified. An entry in + rtadvd.conf with + noifprefix and no addr + generates an RA message with no prefix information + option. + + The &man.rtsold.8; and + &man.rtadvd.8; daemon now support RDNSS and DNSSL option + described in RFC 6106, IPv6 Router Advertisement + Options for DNS Configuration. A &man.rtadvctl.8; + utility to control the &man.rtadvd.8; daemon has been + added. + The &man.rtld.1; runtime linker now supports shared objects as filters in ELF shared libraries. Both standard and auxiliary filtering have been supported. The @@ -1098,6 +1236,10 @@ nfsuserd_enable="YES" && and || around an arithmetic expression has been fixed. + A bug in the &man.tftpd.8; daemon has + been fixed. It had an interoperability issue when + transferring a large file. + The &man.utmp.5; user accounting database has been replaced by &man.utmpx.3;. User accounting utilities will now use utmpx database @@ -1112,11 +1254,10 @@ nfsuserd_enable="YES" when a login daemon crashes or fails to remove the entry during shutdown. - - <filename>/etc/rc.d</filename> Scripts - - - + The &man.zpool.8: utility now supports + zpool labelclear command. This allows to + wipe the label data from a drive that is not active in a + pool. @@ -1125,6 +1266,9 @@ nfsuserd_enable="YES" ACPI CA has been updated to version 20110527. + The awk has + been updated to the 7 August 2011 release. + ISC BIND has been updated to version 9.8.1-P1. @@ -1132,9 +1276,21 @@ nfsuserd_enable="YES" has been updated to 2.17.50 (as of 3 July 2007), which is the last available version under GPLv2. + The + compiler-rt library, which provides + low-level target-specific interfaces such as functions in + libgcc, has been imported. + dialog has been updated to version 1.1-20110707. + The netcat utility + has been updated to version 4.9. + + The tnftp (formerly + known as lukemftp) has been updated + to tnftp-20100108. + GNU GCC and libstdc++ have been updated to rev 127959 of gcc-4_2-branch (the last @@ -1145,6 +1301,9 @@ nfsuserd_enable="YES" &os; libc library has been updated to a snapshot as of 4 March, 2011. + The LESS + program has been updated to version v444. + The LLVM compiler infrastructure and the clang, a C language family @@ -1161,23 +1320,30 @@ nfsuserd_enable="YES" imported. The &man.resolvconf.8; utility now handles &man.resolv.conf.5; file. - The timezone + The + OpenSSH utility has been updated to + 5.8p2, and optimization for large bandwidth-delay product + connection and none cipher support have + been merged + + The pf packet + filter has been updated to version 4.5. + + The sendmail + has been updated to version 8.14.5. + + The timezone database has been updated to the - tzdata2011e release. + tzdata2011m release. &man.unifdef.1; utility has been updated to version 2.5.6. - The xz program has been updated - from 5.0.0 to 5.0.1 release. + The xz + program has been updated from 5.0.0 to a snapshot as of 11 + July, 2011. - - Ports/Packages Collection Infrastructure - - - - Release Engineering and Integration @@ -1191,13 +1357,6 @@ nfsuserd_enable="YES" (x11/kde4) has been updated from 4.5.5 to 4.7.3. - - - Documentation - - - - @@ -1221,6 +1380,10 @@ nfsuserd_enable="YES" supported, according to the instructions in /usr/src/UPDATING. + For more specific information about upgrading + instructions, see . + Upgrading &os; should, of course, only be attempted after backing up all data and configuration @@ -1232,7 +1395,12 @@ nfsuserd_enable="YES" User-visible incompatibilities This section describes notable incompatibilities which you - might want to know before upgrading your system. + might want to know before upgrading your system. + Please read this section and Errata + document carefully before submitting a problem report + and/or posting a question to the FreeBSD mailing + lists. Update of <literal>dialog</literal> @@ -1282,7 +1450,7 @@ nfsuserd_enable="YES" These commands temporarily disable the integrity check. If it was the cause, the &os; kernel should detect the - partitions after entering the commands as prior releases + partitions after entering the commands as the prior release did. This configuration can be added into /boot/loader.conf like the following: @@ -1360,7 +1528,7 @@ boot and reboot the system. A symbolic link like /dev/ar0 - will be generated for + will NOT be generated for /dev/raid/r0. Therefore, if your system used /dev/ar0 as the root partition, @@ -1378,14 +1546,355 @@ boot - - + + Network Configuration Changes in + <filename>/etc/rc.conf</filename> + + Although variables in &man.rc.conf.5; are basically + compatible with earlier releases, ones related to network + configuration are changed because of reorganization of the + &man.rc.8; scripts. - + + + An address configuration now always needs an address + family keyword. For example, the following line + + ifconfig_em0="192.168.2.1 netmask 255.255.255.0" + + should be + + ifconfig_em0="inet 192.168.2.1 netmask 255.255.255.0" + + Although the old convention is still supported in + the existing variables for backward compatibility, some + new variables do not support it. + + + + The + ifconfig_IF_alias0 + variable now requires an address family keyword to + support non-IPv4 address families. For instance, + + ifconfig_em0_alias0="192.168.2.10 netmask 255.255.255.255" + + should be + + ifconfig_em0_alias0="inet 192.168.2.10 netmask 255.255.255.255" + + Different address families can coexist like the + following: + + ifconfig_em0_alias0="inet 192.168.2.10 netmask 255.255.255.255" +ifconfig_em0_alias1="inet6 2001:db8:1::1 prefixlen 64" + + Note that IPv6 alias configurations in + ifconfig_IF_aliasN + will be ignored when no + ifconfig_IF_ipv6 + variable is defined because it determines whether IPv6 + functionality is enabled on that interface or not (this + variable will be explained later). + + + + All of alias and static routing configurations + through &man.rc.conf.5; variables will be deinstalled by + invoking &man.rc.8; scripts or the &man.service.8; command + with stop keyword. + + &prompt.root; service netif stop em0 + + stops the interface em0. + + &prompt.root; service routing stop + + deinstalls all of static route configurations. + + The releases prior to &release.current; did not + support this functionality properly for non-IPv4 + protocols. + + + + IPv6 configuration handling has been changed in the + following way. Before in-depth explanations, here is a + before-and-after example: + + ifconfig_em0="192.168.2.1 netmask 255.255.255.0" +ifconfig_em0_alias0="192.168.2.2 netmask 255.255.255.255" + +ipv6_enable="YES" +ipv6_ifconfig_em0="2001:db8:1::1 prefixlen 64" +ipv6_ifconfig_em0_alias0="2001:db8:2::1 prefixlen 64" +# em1 uses SLAAC for IPv6 address configuration + + should be in &release.current;: + + ifconfig_em0="inet 192.168.2.1 netmask 255.255.255.0" +ifconfig_em0_ipv6="inet6 2001:db8:1::1 prefixlen 64 accept_rtadv" +ifconfig_em0_alias0="inet 192.168.2.2 netmask 255.255.255.255" +ifconfig_em0_alias1="inet6 2001:db8:2::1 prefixlen 64" + +ifconfig_em1_ipv6="inet6 accept_rtadv" + + More specific explanations of the changes are as + follow: + + + + The ipv6_enable variable is + deprecated. IPv6 functionality on the system is + enabled by default. No IPv6 communication will + happen if you configure no IPv6 address. + + &release.current; now supports intermediate + configurations between a host and a router IPv6 + node. The ipv6_enable variable + assumed that the system was a host node when + ipv6_gateway_enable was set to + NO (default), and a router node + if not. A host node always accepted ICMPv6 Router + Advertise message, and a router did not. + + In &release.current;, this model is still + applied but in a per-interface basis, not a + system-wide basis. Specifically, an interface has + an ACCEPT_RTADV flag, RA messages + will be accepted on that interface for SLAAC + (StateLess Address AutoConfiguration) regardless of + whether the packet forwarding is enabled or + not. + + In addition to them, a per-interface flag + NO_RADR and a &man.sysctl.8; + variable net.inet6.ip6.rfc6204w3 + have been added. This controls whether default + router list information via RA messages on an + RA-accepting interface should be ignore or not. In + an IPv6 router model, it is not supposed accepting + RA messages as information source of the default + router list. Because of that &os; &release.current; + ignores the default router list part when IPv6 + packet forwarding is enabled even if the interface + has an ACCEPT_RTADV flag. However, + this can make a difficult situation when the system + has to work as a CPE (Customer Premises Equipment), + which needs RA messages from the upstream network + for network configuration and acts as a router for + the LAN simultaneously. For more information about + this kind of configurations, see RFC 6204. + + To support this kind of configurations, the + ipv6_cpe_wanif variable in + &man.rc.conf.5; can be used. + + ipv6_gateway_enable="YES" +ipv6_cpe_wanif="em0" + + means the em0 interface + accepts RA messages and the default router + information in them, and the other interfaces ignore + the default router information part even when + setting ACCEPT_RTADV flag to + them. + + The ipv6_cpe_wanif internally + sets the net.inet6.ip6.rfc6204w3 + and the net.inet6.ip6.no_radr + &man.sysctl.8; variable to 1. + Note that both are set to 0 by + default. When the former is set to + 1, &os; accepts the default + router list even when IPv6 packet forwarding is + enabled. Note that a system administrator needs to + set a NO_RADR flag on the other + RA-accepting interfaces, if any, to prevent it from + accepting unexpected default router information. + The latter variable means the flag is automatically + set to them. + + If ipv6_enable="YES" is + defined in &release.current;, it means + ipv6_activate_all_interfaces="YES" + in /etc/rc.conf and + inet6 accept_rtadv + &man.ifconfig.8; option in all network interfaces. + Note that this is only for backward compatibility. + The ipv6_enable should not be + used in &release.current;. + + + + The + ipv6_ifconfig_IF + variable is renamed to + ifconfig_IF_ipv6. + This variable means whether IPv6 functionality + should be enabled on that interface or not. If + there is no + ifconfig_IF_ipv6, + no IPv6 functionality on the interface + IF. + + Note that the + ifconfig_IF_ipv6 + always needs the address family keyword + inet6. If you need an automatic + link-local address only, the following line is enough: + + ifconfig_em0_ipv6="inet6 auto_linklocal" + + If you need full-blown IPv6 functionality on all + interfaces like prior releases with + ipv6_enable="YES", including ones + with no + ifconfig_IF_ipv6 + line, you might want to use + ipv6_activate_all_interfaces + variable as explained later. + + If ipv6_ifconfig_IF="..." is + defined in &release.current;, it means + ifconfig_IF_ipv6="inet6 ...". + Note that this is only for backward compatibility. + The inet6 address family keyword + is required for ifconfig_IF_ipv6, + but was NOT required for + ipv6_ifconfig_IF. The + ipv6_ifconfig_IF should not be + used in &release.current;. + + + + An interface with no corresponding + ifconfig_IF_ipv6 variable is + marked with an IFDISABLED flag by + &man.devd.8; daemon. This flag means IPv6 + communication is disabled on that interface. This + can also be found in output of + &man.ifconfig.8;: + + &prompt.user; ifconfig em0 +em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500 + options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM> + ether xx:xx:xx:xx:xx:xx + inet 192.168.2.1 netmask 0xffffff00 broadcast 192.168.2.255 + nd6 options=3<PERFORMNUD,IFDISABLED,ACCEPT_RTADV> + media: Ethernet autoselect (1000baseT <full-duplex>) + status: active + + + To enable IPv6 functionality, this flag should + be removed first. There are several ways to do so. + Adding an IPv6 address automatically removes this + flag. It is possible to remove this flag explicitly + by using the following command: + + &prompt.root; ifconfig em0 inet6 -ifdisabled + + Note that defining an + ifconfig_IF_ipv6 is the most + reasonable way to activate IPv6 functionality on + that interface. This IFDISABLED + flag is to prevent unintended IPv6 communications + in an IPv4-only environment even when the interface + has an IPv6 link-local address. If you need + full-blown IPv6 functionality on all interfaces, you + might want to use + ipv6_activate_all_interfaces + variable as explained later. + + + + The &man.sysctl.8; variable + net.inet6.ip6.accept_rtadv has + been changed. It was a system-wide configuration + knob which means whether the system accepts ICMPv6 + Router Advertisement messages or not. In + &release.current;, this knob is converted into a + per-interface inet6 accept_rtadv + &man.ifconfig.8; option. Although the + &man.sysctl.8; variable is available still in + &release.current;, it now means whether the + per-interface option is set by default or not. The + default value is 0 (not accept + the RA messages). + + + + The &man.sysctl.8; variable + net.inet6.ip6.auto_linklocal has + been changed. It was a system-wide configuration + knob which means whether an IPv6 link-local address + is generated on an network interface when it becomes + up. In &release.current;, this knob is converted + into a per-interface inet6 + auto_linklocal &man.ifconfig.8; option. + Although the &man.sysctl.8; variable is available + still in &release.current;, it now means whether the + per-interface option is set by default or not. The + default value is 1 (generate a + link-local automatically). + + + + The functionality of + ipv6_ifconfig_IF_alias0 + variable is integrated into + ifconfig_IF_alias0. + Note that address family keywords are always required: + + ifconfig_em0_alias0="inet 192.168.2.0 netmask 255.255.255.255" +ifconfig_em0_alias1="inet6 2011:db8:1::1 prefixlen 64 + + Although + ipv6_ifconfig_IF_aliasN + is still usable in &release.current;, it is only for + backward compatibility. + + + + A new + ipv6_activate_all_interfaces variable + has been added. If this variable is set to + YES, IFDISABLED + option will not be added even if + ifconfig_IF_ipv6 variables are not + defined. This can prevent IFDISABLED + on dynamically-added interfaces such as &man.ppp.4;, + &man.tap.4;, and &man.ng.iface.4; where defining + ifconfig_IF_ipv6 in advance is + difficult. + + + + + + + + Openresolv and <filename>/etc/resolv.conf</filename> + + The &man.resolvconf.8; utility has been added and it now + handles updating &man.resolv.conf.5; file. Direct + modifications to /etc/resolv.conf can + be overwritten by network configuration utilities such as + &man.dhclient.8; and &man.rtsold.8;. + + + + Disk Partition Management Utilities + + In earlier releases various utilities were available to + manage disk partition information. They are deprecated in + favor of the &man.gpart.8; utility. Specifically, + &man.fdisk.8;, &man.disklabel.8; &man.bsdlabel.8;, and + &man.sunlabel.8; utilities are no longer supported actively + though these are still available for backward + compatibility. + + + From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 00:38:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1BAA106566B; Thu, 12 Jan 2012 00:38:57 +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 DFFD88FC18; Thu, 12 Jan 2012 00:38: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 q0C0cvKP084605; Thu, 12 Jan 2012 00:38:57 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0C0cv64084603; Thu, 12 Jan 2012 00:38:57 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201201120038.q0C0cv64084603@svn.freebsd.org> From: Hiroki Sato Date: Thu, 12 Jan 2012 00:38:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229999 - stable/9/release/doc/share/sgml X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 00:38:58 -0000 Author: hrs Date: Thu Jan 12 00:38:57 2012 New Revision: 229999 URL: http://svn.freebsd.org/changeset/base/229999 Log: Bump &release.next;. Modified: stable/9/release/doc/share/sgml/release.ent Modified: stable/9/release/doc/share/sgml/release.ent ============================================================================== --- stable/9/release/doc/share/sgml/release.ent Thu Jan 12 00:34:54 2012 (r229998) +++ stable/9/release/doc/share/sgml/release.ent Thu Jan 12 00:38:57 2012 (r229999) @@ -19,7 +19,7 @@ - + From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 00:41:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E4F11065670; Thu, 12 Jan 2012 00:41:48 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C0858FC16; Thu, 12 Jan 2012 00:41: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 q0C0fmu9084889; Thu, 12 Jan 2012 00:41:48 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0C0fmiF084883; Thu, 12 Jan 2012 00:41:48 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201201120041.q0C0fmiF084883@svn.freebsd.org> From: "Kenneth D. Merry" Date: Thu, 12 Jan 2012 00:41: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: r230000 - in head/sys/cam: . scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 00:41:48 -0000 Author: ken Date: Thu Jan 12 00:41:48 2012 New Revision: 230000 URL: http://svn.freebsd.org/changeset/base/230000 Log: Fix a race condition in CAM peripheral free handling, locking in the CAM XPT bus traversal code, and a number of other periph level issues. cam_periph.h, cam_periph.c: Modify cam_periph_acquire() to test the CAM_PERIPH_INVALID flag prior to allowing a reference count to be gained on a peripheral. Callers of this function will receive CAM_REQ_CMP_ERR status in the situation of attempting to reference an invalidated periph. This guarantees that a peripheral scheduled for a deferred free will not be accessed during its wait for destruction. Panic during attempts to drop a reference count on a peripheral that already has a zero reference count. In cam_periph_list(), use a local sbuf with SBUF_FIXEDLEN set so that mallocs do not occur while the xpt topology lock is held, regardless of the allocation policy of the passed in sbuf. Add a new routine, cam_periph_release_locked_buses(), that can be called when the caller already holds the CAM topology lock. Add some extra debugging for duplicate peripheral allocations in cam_periph_alloc(). Treat CAM_DEV_NOT_THERE much the same as a selection timeout (AC_LOST_DEVICE is emitted), but forgo retries. cam_xpt.c: Revamp the way the EDT traversal code does locking and reference counting. This was broken, since it assumed that the EDT would not change during traversal, but that assumption is no longer valid. So, to prevent devices from going away while we traverse the EDT, make sure we properly lock everything and hold references on devices that we are using. The two peripheral driver traversal routines should be examined. xptpdperiphtraverse() holds the topology lock for the entire time it runs. xptperiphtraverse() is now locked properly, but only holds the topology lock while it is traversing the list, and not while the traversal function is running. The bus locking code in xptbustraverse() should also be revisited at a later time, since it is complex and should probably be simplified. scsi_da.c: Pay attention to the return value from cam_periph_acquire(). Return 0 always from daclose() even if the disk is now gone. Add some rudimentary error injection support. scsi_sg.c: Fix reference counting in the sg(4) driver. The sg driver was calling cam_periph_release() on close, but never called cam_periph_acquire() (which increments the reference count) on open. The periph code correctly complained that the sg(4) driver was trying to decrement the refcount when it was already 0. Sponsored by: Spectra Logic MFC after: 2 weeks Modified: head/sys/cam/cam_periph.c head/sys/cam/cam_periph.h head/sys/cam/cam_xpt.c head/sys/cam/scsi/scsi_da.c head/sys/cam/scsi/scsi_sg.c Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Thu Jan 12 00:38:57 2012 (r229999) +++ head/sys/cam/cam_periph.c Thu Jan 12 00:41:48 2012 (r230000) @@ -171,14 +171,16 @@ cam_periph_alloc(periph_ctor_t *periph_c return (CAM_REQ_INPROG); } else { printf("cam_periph_alloc: attempt to re-allocate " - "valid device %s%d rejected\n", - periph->periph_name, periph->unit_number); + "valid device %s%d rejected flags %#x " + "refcount %d\n", periph->periph_name, + periph->unit_number, periph->flags, + periph->refcount); } return (CAM_REQ_INVALID); } periph = (struct cam_periph *)malloc(sizeof(*periph), M_CAMPERIPH, - M_NOWAIT); + M_NOWAIT|M_ZERO); if (periph == NULL) return (CAM_RESRC_UNAVAIL); @@ -190,7 +192,6 @@ cam_periph_alloc(periph_ctor_t *periph_c path_id = xpt_path_path_id(path); target_id = xpt_path_target_id(path); lun_id = xpt_path_lun_id(path); - bzero(periph, sizeof(*periph)); cam_init_pinfo(&periph->pinfo); periph->periph_start = periph_start; periph->periph_dtor = periph_dtor; @@ -305,17 +306,20 @@ cam_periph_find(struct cam_path *path, c } /* - * Find a peripheral structure with the specified path, target, lun, - * and (optionally) type. If the name is NULL, this function will return - * the first peripheral driver that matches the specified path. + * Find peripheral driver instances attached to the specified path. */ int cam_periph_list(struct cam_path *path, struct sbuf *sb) { + struct sbuf local_sb; struct periph_driver **p_drv; struct cam_periph *periph; int count; + int sbuf_alloc_len; + sbuf_alloc_len = 16; +retry: + sbuf_new(&local_sb, NULL, sbuf_alloc_len, SBUF_FIXEDLEN); count = 0; xpt_lock_buses(); for (p_drv = periph_drivers; *p_drv != NULL; p_drv++) { @@ -324,49 +328,71 @@ cam_periph_list(struct cam_path *path, s if (xpt_path_comp(periph->path, path) != 0) continue; - if (sbuf_len(sb) != 0) - sbuf_cat(sb, ","); + if (sbuf_len(&local_sb) != 0) + sbuf_cat(&local_sb, ","); - sbuf_printf(sb, "%s%d", periph->periph_name, + sbuf_printf(&local_sb, "%s%d", periph->periph_name, periph->unit_number); + + if (sbuf_error(&local_sb) == ENOMEM) { + sbuf_alloc_len *= 2; + xpt_unlock_buses(); + sbuf_delete(&local_sb); + goto retry; + } count++; } } xpt_unlock_buses(); + sbuf_finish(&local_sb); + sbuf_cpy(sb, sbuf_data(&local_sb)); + sbuf_delete(&local_sb); return (count); } cam_status cam_periph_acquire(struct cam_periph *periph) { + cam_status status; + status = CAM_REQ_CMP_ERR; if (periph == NULL) - return(CAM_REQ_CMP_ERR); + return (status); xpt_lock_buses(); - periph->refcount++; + if ((periph->flags & CAM_PERIPH_INVALID) == 0) { + periph->refcount++; + status = CAM_REQ_CMP; + } xpt_unlock_buses(); - return(CAM_REQ_CMP); + return (status); } void -cam_periph_release_locked(struct cam_periph *periph) +cam_periph_release_locked_buses(struct cam_periph *periph) { - - if (periph == NULL) - return; - - xpt_lock_buses(); if (periph->refcount != 0) { periph->refcount--; } else { - xpt_print(periph->path, "%s: release %p when refcount is zero\n ", __func__, periph); + panic("%s: release of %p when refcount is zero\n ", __func__, + periph); } if (periph->refcount == 0 && (periph->flags & CAM_PERIPH_INVALID)) { camperiphfree(periph); } +} + +void +cam_periph_release_locked(struct cam_periph *periph) +{ + + if (periph == NULL) + return; + + xpt_lock_buses(); + cam_periph_release_locked_buses(periph); xpt_unlock_buses(); } @@ -1812,9 +1838,6 @@ cam_periph_error(union ccb *ccb, cam_fla error = EIO; break; case CAM_SEL_TIMEOUT: - { - struct cam_path *newpath; - if ((camflags & CAM_RETRY_SELTO) != 0) { if (ccb->ccb_h.retry_count > 0 && (periph->flags & CAM_PERIPH_INVALID) == 0) { @@ -1837,6 +1860,11 @@ cam_periph_error(union ccb *ccb, cam_fla } action_string = "Retries exhausted"; } + /* FALLTHROUGH */ + case CAM_DEV_NOT_THERE: + { + struct cam_path *newpath; + error = ENXIO; /* Should we do more if we can't create the path?? */ if (xpt_create_path(&newpath, periph, @@ -1855,7 +1883,6 @@ cam_periph_error(union ccb *ccb, cam_fla } case CAM_REQ_INVALID: case CAM_PATH_INVALID: - case CAM_DEV_NOT_THERE: case CAM_NO_HBA: case CAM_PROVIDE_FAIL: case CAM_REQ_TOO_BIG: Modified: head/sys/cam/cam_periph.h ============================================================================== --- head/sys/cam/cam_periph.h Thu Jan 12 00:38:57 2012 (r229999) +++ head/sys/cam/cam_periph.h Thu Jan 12 00:41:48 2012 (r230000) @@ -119,6 +119,7 @@ struct cam_periph { #define CAM_PERIPH_NEW_DEV_FOUND 0x10 #define CAM_PERIPH_RECOVERY_INPROG 0x20 #define CAM_PERIPH_SENSE_INPROG 0x40 +#define CAM_PERIPH_FREE 0x80 u_int32_t immediate_priority; u_int32_t refcount; SLIST_HEAD(, ccb_hdr) ccb_list; /* For "immediate" requests */ @@ -146,6 +147,7 @@ int cam_periph_list(struct cam_path *, cam_status cam_periph_acquire(struct cam_periph *periph); void cam_periph_release(struct cam_periph *periph); void cam_periph_release_locked(struct cam_periph *periph); +void cam_periph_release_locked_buses(struct cam_periph *periph); int cam_periph_hold(struct cam_periph *periph, int priority); void cam_periph_unhold(struct cam_periph *periph); void cam_periph_invalidate(struct cam_periph *periph); Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Thu Jan 12 00:38:57 2012 (r229999) +++ head/sys/cam/cam_xpt.c Thu Jan 12 00:41:48 2012 (r230000) @@ -2026,12 +2026,24 @@ xptbustraverse(struct cam_eb *start_bus, for (bus = (start_bus ? start_bus : TAILQ_FIRST(&xsoftc.xpt_busses)); bus != NULL; bus = next_bus) { - next_bus = TAILQ_NEXT(bus, links); + bus->refcount++; + + /* + * XXX The locking here is obviously very complex. We + * should work to simplify it. + */ mtx_unlock(&xsoftc.xpt_topo_lock); CAM_SIM_LOCK(bus->sim); retval = tr_func(bus, arg); CAM_SIM_UNLOCK(bus->sim); + + mtx_lock(&xsoftc.xpt_topo_lock); + next_bus = TAILQ_NEXT(bus, links); + mtx_unlock(&xsoftc.xpt_topo_lock); + + xpt_release_bus(bus); + if (retval == 0) return(retval); mtx_lock(&xsoftc.xpt_topo_lock); @@ -2086,10 +2098,14 @@ xpttargettraverse(struct cam_eb *bus, st TAILQ_FIRST(&bus->et_entries)); target != NULL; target = next_target) { - next_target = TAILQ_NEXT(target, links); + target->refcount++; retval = tr_func(target, arg); + next_target = TAILQ_NEXT(target, links); + + xpt_release_target(target); + if (retval == 0) return(retval); } @@ -2110,10 +2126,22 @@ xptdevicetraverse(struct cam_et *target, device != NULL; device = next_device) { - next_device = TAILQ_NEXT(device, links); + /* + * Hold a reference so the current device does not go away + * on us. + */ + device->refcount++; retval = tr_func(device, arg); + /* + * Grab our next pointer before we release the current + * device. + */ + next_device = TAILQ_NEXT(device, links); + + xpt_release_device(device); + if (retval == 0) return(retval); } @@ -2130,18 +2158,57 @@ xptperiphtraverse(struct cam_ed *device, retval = 1; + xpt_lock_buses(); for (periph = (start_periph ? start_periph : SLIST_FIRST(&device->periphs)); periph != NULL; periph = next_periph) { - next_periph = SLIST_NEXT(periph, periph_links); + + /* + * In this case, we want to show peripherals that have been + * invalidated, but not peripherals that are scheduled to + * be freed. So instead of calling cam_periph_acquire(), + * which will fail if the periph has been invalidated, we + * just check for the free flag here. If it is free, we + * skip to the next periph. + */ + if (periph->flags & CAM_PERIPH_FREE) { + next_periph = SLIST_NEXT(periph, periph_links); + continue; + } + + /* + * Acquire a reference to this periph while we call the + * traversal function, so it can't go away. + */ + periph->refcount++; + + xpt_unlock_buses(); retval = tr_func(periph, arg); + + /* + * We need the lock for list traversal. + */ + xpt_lock_buses(); + + /* + * Grab the next peripheral before we release this one, so + * our next pointer is still valid. + */ + next_periph = SLIST_NEXT(periph, periph_links); + + cam_periph_release_locked_buses(periph); + if (retval == 0) - return(retval); + goto bailout_done; } +bailout_done: + + xpt_unlock_buses(); + return(retval); } @@ -2188,15 +2255,48 @@ xptpdperiphtraverse(struct periph_driver TAILQ_FIRST(&(*pdrv)->units)); periph != NULL; periph = next_periph) { - next_periph = TAILQ_NEXT(periph, unit_links); - retval = tr_func(periph, arg); - if (retval == 0) { - xpt_unlock_buses(); - return(retval); + /* + * In this case, we want to show peripherals that have been + * invalidated, but not peripherals that are scheduled to + * be freed. So instead of calling cam_periph_acquire(), + * which will fail if the periph has been invalidated, we + * just check for the free flag here. If it is free, we + * skip to the next periph. + */ + if (periph->flags & CAM_PERIPH_FREE) { + next_periph = TAILQ_NEXT(periph, unit_links); + continue; } + + /* + * Acquire a reference to this periph while we call the + * traversal function, so it can't go away. + */ + periph->refcount++; + + /* + * XXX KDM we have the toplogy lock here, but in + * xptperiphtraverse(), we drop it before calling the + * traversal function. Which is correct? + */ + retval = tr_func(periph, arg); + + /* + * Grab the next peripheral before we release this one, so + * our next pointer is still valid. + */ + next_periph = TAILQ_NEXT(periph, unit_links); + + cam_periph_release_locked_buses(periph); + + if (retval == 0) + goto bailout_done; } +bailout_done: + xpt_unlock_buses(); + return(retval); } Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Thu Jan 12 00:38:57 2012 (r229999) +++ head/sys/cam/scsi/scsi_da.c Thu Jan 12 00:41:48 2012 (r230000) @@ -127,6 +127,7 @@ struct da_softc { da_flags flags; da_quirks quirks; int minimum_cmd_size; + int error_inject; int ordered_tag_count; int outstanding_cmds; struct disk_params params; @@ -879,7 +880,7 @@ daopen(struct disk *dp) } if (cam_periph_acquire(periph) != CAM_REQ_CMP) { - return(ENXIO); + return (ENXIO); } cam_periph_lock(periph); @@ -940,13 +941,13 @@ daclose(struct disk *dp) periph = (struct cam_periph *)dp->d_drv1; if (periph == NULL) - return (ENXIO); + return (0); cam_periph_lock(periph); if ((error = cam_periph_hold(periph, PRIBIO)) != 0) { cam_periph_unlock(periph); cam_periph_release(periph); - return (error); + return (0); } softc = (struct da_softc *)periph->softc; @@ -1214,8 +1215,8 @@ daoninvalidate(struct cam_periph *periph bioq_flush(&softc->bio_queue, NULL, ENXIO); disk_gone(softc->disk); - xpt_print(periph->path, "lost device - %d outstanding\n", - softc->outstanding_cmds); + xpt_print(periph->path, "lost device - %d outstanding, %d refs\n", + softc->outstanding_cmds, periph->refcount); } static void @@ -1361,6 +1362,16 @@ dasysctlinit(void *context, int pending) &softc->minimum_cmd_size, 0, dacmdsizesysctl, "I", "Minimum CDB size"); + SYSCTL_ADD_INT(&softc->sysctl_ctx, + SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, + "error_inject", + CTLFLAG_RW, + &softc->error_inject, + 0, + "error_inject leaf"); + + /* * Add some addressing info. */ @@ -1887,6 +1898,13 @@ dadone(struct cam_periph *periph, union bp->bio_resid = csio->resid; if (csio->resid > 0) bp->bio_flags |= BIO_ERROR; + if (softc->error_inject != 0) { + bp->bio_error = softc->error_inject; + bp->bio_resid = bp->bio_bcount; + bp->bio_flags |= BIO_ERROR; + softc->error_inject = 0; + } + } /* @@ -2103,13 +2121,20 @@ dadone(struct cam_periph *periph, union } free(csio->data_ptr, M_SCSIDA); if (announce_buf[0] != '\0') { - xpt_announce_periph(periph, announce_buf); /* * Create our sysctl variables, now that we know * we have successfully attached. */ - (void) cam_periph_acquire(periph); /* increase the refcount */ - taskqueue_enqueue(taskqueue_thread,&softc->sysctl_task); + /* increase the refcount */ + if (cam_periph_acquire(periph) == CAM_REQ_CMP) { + taskqueue_enqueue(taskqueue_thread, + &softc->sysctl_task); + xpt_announce_periph(periph, announce_buf); + } else { + xpt_print(periph->path, "fatal error, " + "could not acquire reference count\n"); + } + } softc->state = DA_STATE_NORMAL; /* Modified: head/sys/cam/scsi/scsi_sg.c ============================================================================== --- head/sys/cam/scsi/scsi_sg.c Thu Jan 12 00:38:57 2012 (r229999) +++ head/sys/cam/scsi/scsi_sg.c Thu Jan 12 00:41:48 2012 (r230000) @@ -399,18 +399,24 @@ sgopen(struct cdev *dev, int flags, int if (periph == NULL) return (ENXIO); + if (cam_periph_acquire(periph) != CAM_REQ_CMP) + return (ENXIO); + /* * Don't allow access when we're running at a high securelevel. */ error = securelevel_gt(td->td_ucred, 1); - if (error) + if (error) { + cam_periph_release(periph); return (error); + } cam_periph_lock(periph); softc = (struct sg_softc *)periph->softc; if (softc->flags & SG_FLAG_INVALID) { cam_periph_unlock(periph); + cam_periph_release(periph); return (ENXIO); } From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 03:52:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AE99106566C; Thu, 12 Jan 2012 03:52: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 18C168FC1E; Thu, 12 Jan 2012 03:52: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 q0C3qr32090944; Thu, 12 Jan 2012 03:52:53 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0C3qr64090942; Thu, 12 Jan 2012 03:52:53 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201201120352.q0C3qr64090942@svn.freebsd.org> From: Hiroki Sato Date: Thu, 12 Jan 2012 03:52:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230001 - stable/9/release/doc/en_US.ISO8859-1/installation X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 03:52:54 -0000 Author: hrs Date: Thu Jan 12 03:52:53 2012 New Revision: 230001 URL: http://svn.freebsd.org/changeset/base/230001 Log: Use upper case in an anchor id. Modified: stable/9/release/doc/en_US.ISO8859-1/installation/article.sgml Modified: stable/9/release/doc/en_US.ISO8859-1/installation/article.sgml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/installation/article.sgml Thu Jan 12 00:41:48 2012 (r230000) +++ stable/9/release/doc/en_US.ISO8859-1/installation/article.sgml Thu Jan 12 03:52:53 2012 (r230001) @@ -52,7 +52,7 @@ If you are upgrading from a previous release of &os;, please read upgrading + url="http://www.FreeBSD.org/releases/9.0R/relnotes-detailed.html#UPGRADE">upgrading section in the Release Notes for notable incompatibilities carefully. From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 04:37:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50775106564A; Thu, 12 Jan 2012 04:37:20 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D1B58FC15; Thu, 12 Jan 2012 04:37: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 q0C4bKCl092312; Thu, 12 Jan 2012 04:37:20 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0C4bK5Y092310; Thu, 12 Jan 2012 04:37:20 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201201120437.q0C4bK5Y092310@svn.freebsd.org> From: Warren Block Date: Thu, 12 Jan 2012 04:37:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230002 - stable/9/sbin/geom/class/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 04:37:20 -0000 Author: wblock (doc committer) Date: Thu Jan 12 04:37:19 2012 New Revision: 230002 URL: http://svn.freebsd.org/changeset/base/230002 Log: MFC r227774, r227777, r227800, r229838, r229847: MFC r227774: Add a section that explicitly describes partitioning schemes. Modify existing sections to refer to the new one. Rearrange partitioning scheme list so MBR and EBR types are together. Also add several corrections for grammar, clarity, and consistency. MFC r227777: Fix date. MFC r227800: Correct and expand BSD partitioning scheme description. Correct GUID to GPT in RECOVERING section. MFC r229838: Clarity improvements. MFC r229847: Whitespace-only fix. Approved by: gjb (mentor) Modified: stable/9/sbin/geom/class/part/gpart.8 Directory Properties: stable/9/sbin/geom/ (props changed) Modified: stable/9/sbin/geom/class/part/gpart.8 ============================================================================== --- stable/9/sbin/geom/class/part/gpart.8 Thu Jan 12 03:52:53 2012 (r230001) +++ stable/9/sbin/geom/class/part/gpart.8 Thu Jan 12 04:37:19 2012 (r230002) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 19, 2011 +.Dd January 8, 2012 .Dt GPART 8 .Os .Sh NAME @@ -33,56 +33,25 @@ .Sh SYNOPSIS To add support for the disk partitioning GEOM class, place one or more of the following -lines in your kernel configuration file: +lines in the kernel configuration file: .Bd -ragged -offset indent .Cd "options GEOM_PART_APM" .Cd "options GEOM_PART_BSD" -.Cd "options GEOM_PART_EBR" -.Cd "options GEOM_PART_EBR_COMPAT" .Cd "options GEOM_PART_GPT" .Cd "options GEOM_PART_MBR" +.Cd "options GEOM_PART_EBR" +.Cd "options GEOM_PART_EBR_COMPAT" .Cd "options GEOM_PART_PC98" .Cd "options GEOM_PART_VTOC8" .Ed .Pp -The -.Dv GEOM_PART_APM -option adds support for the Apple Partition Map (APM) -found on Apple Macintosh computers. -The -.Dv GEOM_PART_BSD -option adds support for the traditional -.Bx -disklabel. -The -.Dv GEOM_PART_EBR -option adds support for the Extended Boot Record (EBR), -which is used to define a logical partition. -The -.Dv GEOM_PART_EBR_COMPAT -option enables backward compatibility for partition names -in the EBR scheme. -Also it makes impossible any types of actions -with such partitions. -The -.Dv GEOM_PART_GPT -option adds support for the GUID Partition Table (GPT) -found on Intel Itanium computers and Intel-based Macintosh computers. -The -.Dv GEOM_PART_MBR -option adds support for the Master Boot Record (MBR) -found on PCs and used on many removable media. -The -.Dv GEOM_PART_PC98 -option adds support for the MBR variant as used on -NEC PC-98 computers. -The -.Dv GEOM_PART_VTOC8 -option adds support for Sun's SMI VTOC8 label as -found on computers based on -.Tn SPARC64 -and -.Tn UltraSPARC. +These options provide support for the various types of partitioning +schemes supported by the +.Ns Nm +utility. +See +.Sx "PARTITIONING SCHEMES" +below for more details. .Pp Usage of the .Ns Nm @@ -190,7 +159,7 @@ utility: The .Nm utility is used to partition GEOM providers, normally disks. -The first argument of which is the action to be taken: +The first argument is the action to be taken: .Bl -tag -width ".Cm bootcode" .\" ==== ADD ==== .It Cm add @@ -245,7 +214,7 @@ about its use. .El .\" ==== BACKUP ==== .It Cm backup -Dump a partition table to standard output in special format used by +Dump a partition table to standard output in a special format used by the .Cm restore action. .\" ==== BOOTCODE ==== @@ -290,18 +259,17 @@ about its use. .It Cm commit Commit any pending changes for geom .Ar geom . -All actions are being committed by default and will not result in +All actions are committed by default and will not result in pending changes. Actions can be modified with the .Fl f Ar flags -option so that they are not being committed by default. -As such, they become pending. +option so that they are not committed, but become pending. Pending changes are reflected by the geom and the .Nm utility, but they are not actually written to disk. The .Cm commit -action will write any and all pending changes to disk. +action will write all pending changes to disk. .\" ==== CREATE ==== .It Cm create Create a new partitioning scheme on a provider given by @@ -309,16 +277,16 @@ Create a new partitioning scheme on a pr The .Fl s Ar scheme option determines the scheme to use. -The kernel needs to have support for a particular scheme before +The kernel must have support for a particular scheme before that scheme can be used to partition a disk. .Pp Additional options include: .Bl -tag -width 10n .It Fl n Ar entries The number of entries in the partition table. -Every partitioning scheme has a minimum and a maximum number of entries -and this option allows tables to be created with the number of entries -that lies anywhere between the minimum and the maximum. +Every partitioning scheme has a minimum and maximum number of entries. +This option allows tables to be created with a number of entries +that is within the limits. Some schemes have a maximum equal to the minimum and some schemes have a maximum large enough to be considered unlimited. By default, partition tables are created with the minimum number of @@ -392,7 +360,7 @@ about its use. .El .\" ==== RECOVER ==== .It Cm recover -Recover corrupt partition's scheme metadata on the geom +Recover a corrupt partition's scheme metadata on the geom .Ar geom . See the section entitled .Sx RECOVERING @@ -443,13 +411,13 @@ about its use. .El .\" ==== RESTORE ==== .It Cm restore -Restore the partition table from backup previously created by +Restore the partition table from a backup previously created by the .Cm backup -action and given from standard input. -Only partition table may be restored. -This action does not affect content of partitions. -This mean that you should copy your data from backup after restoring -partition table and write bootcode again if it is needed. +action and read from standard input. +Only the partition table is restored. +This action does not affect the content of partitions. +After restoring the partition table and writing bootcode if needed, +user data must be restored from backup. .Pp Additional options include: .Bl -tag -width 10n @@ -489,7 +457,7 @@ or all geoms if none are specified. Additional options include: .Bl -tag -width 10n .It Fl l -For partition schemes that support partition labels print them +For partitioning schemes that support partition labels, print them instead of partition type. .It Fl p Show provider names instead of partition indexes. @@ -520,39 +488,95 @@ below for a discussion about its use. .El .El -.\" +.Sh PARTITIONING SCHEMES +Several partitioning schemes are supported by the +.Nm +utility: +.Bl -tag -width ".Cm VTOC8" +.It Cm APM +Apple Partition Map, used by PowerPC(R) Macintosh(R) computers. +Requires the +.Cd GEOM_PART_APM +kernel option. +.It Cm BSD +Traditional BSD disklabel, usually used to subdivide MBR partitions. +.Po +This scheme can also be used as the sole partitioning method, without +an MBR. +Partition editing tools from other operating systems often do not +understand the bare disklabel partition layout, so this is sometimes +called +.Dq dangerously dedicated . +.Pc +Requires the +.Cm GEOM_PART_BSD +kernel option. +.It Cm GPT +GUID Partition Table is used on Intel-based Macintosh computers and +gradually replacing MBR on most PCs and other systems. +Requires the +.Cm GEOM_PART_GPT +kernel option. +.It Cm MBR +Master Boot Record is used on PCs and removable media. +Requires the +.Cm GEOM_PART_MBR +kernel option. +The +.Cm GEOM_PART_EBR +option adds support for the Extended Boot Record (EBR), +which is used to define a logical partition. +The +.Cm GEOM_PART_EBR_COMPAT +option enables backward compatibility for partition names +in the EBR scheme. +It also prevents any type of actions on such partitions. +.It Cm PC98 +An MBR variant for NEC PC-98 and compatible computers. +Requires the +.Cm GEOM_PART_PC98 +kernel option. +.It Cm VTOC8 +Sun's SMI Volume Table Of Contents, used by +.Tn SPARC64 +and +.Tn UltraSPARC +computers. +Requires the +.Cm GEOM_PART_VTOC8 +kernel option. +.El .Sh PARTITION TYPES Partition types are identified on disk by particular strings or magic values. The .Nm -utility uses symbolic names for common partition types to avoid the -user needing to know these values or other details of the partitioning +utility uses symbolic names for common partition types so the user +does not need to know these values or other details of the partitioning scheme in question. The .Nm utility also allows the user to specify scheme-specific partition types for partition types that do not have symbolic names. -The symbolic names currently understood are: +Symbolic names currently understood are: .Bl -tag -width ".Cm freebsd-vinum" .It Cm bios-boot The system partition dedicated to second stage of the boot loader program. -Usually it used by GRUB 2 loader when the partition table is GPT. +Usually it is used by the GRUB 2 loader for GPT partitioning schemes. The scheme-specific type is .Qq Li "!21686148-6449-6E6F-744E-656564454649" . .It Cm efi The system partition for computers that use the Extensible Firmware Interface (EFI). -In such cases, the GPT partitioning scheme is being used and the +In such cases, the GPT partitioning scheme is used and the actual partition type for the system partition can also be specified as .Qq Li "!c12a7328-f81f-11d2-ba4b-00a0c93ec93ab" . .It Cm freebsd A .Fx -partition that uses the +partition subdivided into filesystems with a .Bx -disklabel to sub-divide the -partition into file systems. +disklabel. This is a legacy partition type and should not be used for the APM or GPT schemes. The scheme-specific types are @@ -581,7 +605,7 @@ for GPT, and tag 0x0901 for VTOC8. .It Cm freebsd-ufs A .Fx -partition that contains a UFS or UFS2 file system. +partition that contains a UFS or UFS2 filesystem. The scheme-specific types are .Qq Li "!FreeBSD-UFS" for APM, @@ -606,7 +630,7 @@ for APM, .Qq Li "!516e7cba-6ecf-11d6-8ff8-00022d09712b" for GPT, and 0x0904 for VTOC8. .It Cm mbr -A partition that is sub-partitioned by a master boot record (MBR). +A partition that is sub-partitioned by a Master Boot Record (MBR). This type is known as .Qq Li "!024dee41-33e7-11d3-9d69-0008c781f39f" by GPT. @@ -712,27 +736,28 @@ The scheme-specific attributes for PC98: .Fx supports several partitioning schemes and each scheme uses different bootstrap code. -The bootstrap code is located in the specific disk area for each partitioning -scheme and also it might have different size. +The bootstrap code is located in a specific disk area for each partitioning +scheme, and may vary in size for different schemes. .Pp -The bootstrap code could be separated into two types. -The first one is embedded in the partitioning scheme's metadata, the second -type is located on the specific partition. -The embedding bootstrap code should be done only with the +Bootstrap code can be separated into two types. +The first type is embedded in the partitioning scheme's metadata, while the +second type is located on a specific partition. +Embedding bootstrap code should only be done with the .Cm gpart bootcode -command with +command with the .Fl b Ar bootcode option. -The GEOM PART class has knowlege on how to embed bootstrap code into specific -partitioning scheme metadata without damage. +The GEOM PART class knows how to safely embed bootstrap code into +specific partitioning scheme metadata without causing any damage. .Pp -The Master Boot Record (MBR) uses 512-bytes bootstrap code image, embedded into -partition table's metadata area. +The Master Boot Record (MBR) uses a 512-byte bootstrap code image, embedded +into the partition table's metadata area. There are two variants of this bootstrap code: .Pa /boot/mbr and .Pa /boot/boot0 . -The first one searches partition with +.Pa /boot/mbr +searches for a partition with the .Cm active attribute (see the .Sx ATTRIBUTES @@ -740,9 +765,10 @@ section) in the partition table. Then it runs next bootstrap stage. The .Pa /boot/boot0 -image contains a boot manager with some additional interactive functions. +image contains a boot manager with some additional interactive functions +for multi-booting from a user-selected partition. .Pp -The BSD disklabel is usually created on top of the MBR partition (slice) +A BSD disklabel is usually created inside an MBR partition (slice) with type .Cm freebsd (see the @@ -750,17 +776,17 @@ with type section). It uses 8 KB size bootstrap code image .Pa /boot/boot , -embedded into partition table's metadata area. +embedded into the partition table's metadata area. .Pp Both types of bootstrap code are used to boot from the GUID Partition Table. -First of all, a protective MBR is embedded into first disk sector from the +First, a protective MBR is embedded into the first disk sector from the .Pa /boot/pmbr image. -It searches the +It searches the GPT .Cm freebsd-boot partition (see the .Sx "PARTITION TYPES" -section) in the GPT and runs next bootstrap stage from it. +section) in the GPT and runs the next bootstrap stage from it. The .Cm freebsd-boot partition should be smaller than 545 KB. @@ -768,37 +794,39 @@ There are two variants of bootstrap code .Pa /boot/gptboot and .Pa /boot/gptzfsboot . -The first one is used to boot from UFS. -It searches in the GPT partition with type -.Cm freebsd-ufs , -and it runs the third bootstrap stage ( -.Pa /boot/loader ) -if it is found. +.Pa /boot/gptboot +is used to boot from UFS. +It searches +.Cm freebsd-ufs +GPT partitions and starts +.Pa /boot/loader +.Pq the third bootstrap stage +if found. The .Pa /boot/gptzfsboot is used to boot from ZFS. -It searches partition with type +It searches .Cm freebsd-zfs -and starts +GPT partitions and starts .Pa /boot/zfsloader -from it. +if found. .Pp The VTOC8 scheme does not support embedding bootstrap code. Instead, the 8 KBytes bootstrap code image .Pa /boot/boot1 -should be written with +should be written with the .Cm gpart bootcode -command with +command with the .Fl p Ar bootcode option to all sufficiently large VTOC8 partitions. To do this the .Fl i Ar index -option could be ommited. +option could be omitted. .Pp The APM scheme also does not support embedding bootstrap code. Instead, the 800 KBytes bootstrap code image .Pa /boot/boot1.hfs -should be written with +should be written with the .Cm gpart bootcode command to a partition of type .Cm freebsd-boot , @@ -829,21 +857,22 @@ action or reverted with the action. .Sh RECOVERING The GEOM PART class supports recovering of partition tables only for GPT. -The GUID partition table has a primary and secondary (backup) copy of -metadata for redundance, these are stored at the begining and the end -of the device respectively. -As a result of having two copies, it is acceptable to have some corruption -within the metadata that is not fatal to the working of GPT. -When the kernel detects corrupt metadata it marks this table as corrupt and -reports the corruption. -Any operations on corrupt tables are prohibited except for +The GPT primary metadata is stored at the beginning of the device. +For redundancy, a secondary +.Pq backup +copy of the metadata is stored at the end of the device. +As a result of having two copies, some corruption of metadata is not +fatal to the working of GPT. +When the kernel detects corrupt metadata, it marks this table as corrupt +and reports the problem. .Cm destroy and -.Cm recover . +.Cm recover +are the only operations allowed on corrupt tables. .Pp If the first sector of a provider is corrupt, the kernel can not detect GPT -even if partition table itself is not corrupt. -You can rewrite the protective MBR using the +even if the partition table itself is not corrupt. +The protective MBR can be rewritten using the .Xr dd 1 command, to restore the ability to detect the GPT. The copy of the protective MBR is usually located in the @@ -874,7 +903,7 @@ will report about corrupt tables. If the size of the device has changed (e.g.\& volume expansion) the secondary GPT header will no longer be located in the last sector. This is not a metadata corruption, but it is dangerous because any -corruption of the primary GPT will lead to loss of partition table. +corruption of the primary GPT will lead to loss of the partition table. This problem is reported by the kernel with the message: .Bd -literal -offset indent GEOM: provider: the secondary GPT header is not in the last LBA. @@ -913,13 +942,13 @@ rejected with a diagnostic message: .Sh EXIT STATUS Exit status is 0 on success, and 1 if the command fails. .Sh EXAMPLES -Create GPT scheme on +Create a GPT scheme on .Pa ad0 : .Bd -literal -offset indent /sbin/gpart create -s GPT ad0 .Ed .Pp -Embed GPT bootstrap code into protective MBR: +Embed GPT bootstrap code into a protective MBR: .Bd -literal -offset indent /sbin/gpart bootcode -b /boot/pmbr ad0 .Ed @@ -935,9 +964,11 @@ This partition must be larger than .Pa /boot/gptboot , or the GPT boot you are planning to write, but smaller than 545 KB. A size of 15 blocks (7680 bytes) would be sufficient for -booting from UFS but let's use 128 blocks (64 KB) here in -this example, in order to reserve some space for potential -future need (e.g.\& from a ZFS partition). +booting from UFS but 128 blocks (64 KB) is used in +this example to reserve some space for potential +future need (e.g.\& a larger +.Pa /boot/gptzfsboot +for booting from a ZFS partition). .Bd -literal -offset indent /sbin/gpart add -b 34 -s 128 -t freebsd-boot ad0 /sbin/gpart bootcode -p /boot/gptboot -i 1 ad0 @@ -945,17 +976,17 @@ future need (e.g.\& from a ZFS partition .Pp Create a 512MB-sized .Cm freebsd-ufs -partition that would contain UFS where the system boots from: +partition to contain a UFS filesystem from which the system can boot. .Bd -literal -offset indent /sbin/gpart add -b 162 -s 1048576 -t freebsd-ufs ad0 .Ed .Pp -Create MBR scheme on +Create an MBR scheme on .Pa ada0 , -then create 30GB-sized +then create a 30GB-sized .Fx slice, mark it active and -install +install the .Nm boot0 boot manager: .Bd -literal -offset indent @@ -965,16 +996,16 @@ boot manager: /sbin/gpart bootcode -b /boot/boot0 ada0 .Ed .Pp -Now create +Now create a .Bx scheme .Pf ( Bx -label) with ability to have up to 20 partitions: +label) with space for up to 20 partitions: .Bd -literal -offset indent /sbin/gpart create -s BSD -n 20 ada0s1 .Ed .Pp -Create 1GB-sized UFS partition and 4GB-sized swap partition: +Create a 1GB-sized UFS partition and a 4GB-sized swap partition: .Bd -literal -offset indent /sbin/gpart add -t freebsd-ufs -s 1G ada0s1 /sbin/gpart add -t freebsd-swap -s 4G ada0s1 @@ -987,7 +1018,7 @@ label: /sbin/gpart bootcode -b /boot/boot ada0s1 .Ed .Pp -Create VTOC8 scheme on +Create a VTOC8 scheme on .Pa da0 : .Bd -literal -offset indent /sbin/gpart create -s VTOC8 da0 @@ -995,36 +1026,36 @@ Create VTOC8 scheme on .Pp Create a 512MB-sized .Cm freebsd-ufs -partition that would contain UFS where the system boots from: +partition to contain a UFS filesystem from which the system can boot. .Bd -literal -offset indent /sbin/gpart add -s 512M -t freebsd-ufs da0 .Ed .Pp Create a 15GB-sized .Cm freebsd-ufs -partition that would contain UFS and aligned on 4KB boundaries: +partition to contain a UFS filesystem and aligned on 4KB boundaries: .Bd -literal -offset indent /sbin/gpart add -s 15G -t freebsd-ufs -a 4k da0 .Ed .Pp -After having created all required partitions, embed bootstrap code into them: +After creating all required partitions, embed bootstrap code into them: .Bd -literal -offset indent /sbin/gpart bootcode -p /boot/boot1 da0 .Ed .Pp -Create backup of partition table from +Create a backup of the partition table from .Pa da0 : .Bd -literal -offset indent /sbin/gpart backup da0 > da0.backup .Ed .Pp -Restore partition table from backup to +Restore the partition table from the backup to .Pa da0 : .Bd -literal -offset indent /sbin/gpart restore -l da0 < /mnt/da0.backup .Ed .Pp -Clone partition table from +Clone the partition table from .Pa ada0 to .Pa ada1 From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 04:48:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2977F1065676; Thu, 12 Jan 2012 04:48:45 +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 15BD48FC0A; Thu, 12 Jan 2012 04:48: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 q0C4miAo092681; Thu, 12 Jan 2012 04:48:44 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0C4mi1B092679; Thu, 12 Jan 2012 04:48:44 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201201120448.q0C4mi1B092679@svn.freebsd.org> From: Hiroki Sato Date: Thu, 12 Jan 2012 04:48:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230003 - stable/9/release/doc/en_US.ISO8859-1/relnotes X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 04:48:45 -0000 Author: hrs Date: Thu Jan 12 04:48:44 2012 New Revision: 230003 URL: http://svn.freebsd.org/changeset/base/230003 Log: Various grammar/wording fixes. Submitted by: Benjamin Kaduk Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Thu Jan 12 04:37:19 2012 (r230002) +++ stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Thu Jan 12 04:48:44 2012 (r230003) @@ -184,12 +184,12 @@ Kernel Changes - &os; kernel now supports Capsicum + The &os; kernel now supports Capsicum Capability Mode. Capsicum is a set of features for sandboxing support, using a capability model in which the capabilities are file descriptors. Two new kernel options CAPABILITIES and - CAPABILITY_MODE have been added to + CAPABILITY_MODE have been added to the GENERIC kernel. For more information about Capsicum, see . @@ -201,20 +201,21 @@ &os;/&arch.amd64;. Two new systrace_linux32 and systrace_freebsd32 kernel modules provide - support for tracing compat system calls in addition to native + support for tracing compat system calls in addition to the native system call tracing provided by the systrace module. - &os; ELF image - activator now supports PT_GNU_STACK program - header. This is disabled by default. New &man.sysctl.8; - variables kern.elf32.nxstack and - kern.elf64.nxstack allow to enable + The + &os; ELF image activator now supports the + PT_GNU_STACK program header. This is + disabled by default. New &man.sysctl.8; variables + kern.elf32.nxstack and + kern.elf64.nxstack allow enabling PT_GNU_STACK for the specified ABIs (e.g. elf32 for 32-bit ABI). The &man.hhook.9; (Helper Hook) - and &man.khelp.9; (Kernel Helpers) KPI have been implemented. + and &man.khelp.9; (Kernel Helpers) KPIs have been implemented. These are a kind of superset of &man.pfil.9; framework for more general use in the kernel. The &man.hhook.9; KPI provides a way for kernel subsystems to export hook points @@ -228,8 +229,8 @@ A &man.loader.8; tunable hw.memtest.tests has been added. - This controls whether performing a memory testing at boot time - or not. The default value is 1 (performs a + This controls whether to perform memory testing at boot time + or not. The default value is 1 (perform a memory test). A new resource accounting API has been @@ -238,12 +239,12 @@ this is not built nor installed by default. To build and install them, specify options RACCT in the kernel configuration file and rebuild the base system as - described in &os; Handbook. - A new resource limiting API has been - implemented. It works in conjunction with + A new resource-limiting API has been + implemented. It works in conjunction with the RACCT resource accounting implementation and takes user-configurable actions based on the set of rules it maintains and the current resource usage. The &man.rctl.8; @@ -251,31 +252,31 @@ that this is not built nor installed by default. To build and install them, specify options RCTL in the kernel configuration file and rebuild the base system as - described in &os; Handbook. The &man.sendmsg.2; and &man.recvmsg.2; - system calls in &os; Linux ABI compatibility have been + system calls in the &os; Linux ABI compatibility have been improved. The &man.open.2; and &man.fhopen.2; - system calls now support O_CLOEXEC flag, - which allows to set FD_CLOEXEC flag for the + system calls now support the O_CLOEXEC flag, + which allows setting the FD_CLOEXEC flag for the newly created file descriptor. This is standardized in IEEE Std 1003.1-2008 (POSIX, Single UNIX Specification Version 4). - &man.posix.fallocate.2; system call has + The &man.posix.fallocate.2; system call has been implemented. This is a function in POSIX to ensure that - a part of storage for regular file data is allocated on the + a part of the storage for regular file data is allocated on the file system storage media. Two new system calls setloginclass(2) and getloginclass(2) have been added. This - makes it possible for the kernel to track login class the - process is assigned to, which is required for + makes it possible for the kernel to track the login class a + process is assigned to, which is required for the RCTL resource limiting framework. &os; now supports executing @@ -283,12 +284,12 @@ that this is not built nor installed by default. To build and install them, specify options COMPAT_43 in the kernel configuration file and rebuild the base system as - described in &os; Handbook. The following - &man.sysctl.8; variables have been added to show availability + &man.sysctl.8; variables have been added to show the availability of various kernel features: @@ -402,7 +403,7 @@ kern.features.stack - Support for capturing kernel stack + Support for capturing the kernel stack @@ -423,7 +424,7 @@ kern.features.invariant_support - Support for modules compiled with INVARIANTS option + Support for modules compiled with the INVARIANTS option @@ -523,7 +524,7 @@ kern.features.geom_vol - GEOM support for volume names from UFS superblock + GEOM support for volume names from UFS superblocks @@ -604,11 +605,11 @@ updated. The &man.loader.8; loader - now supports PBVM (Pre-Boot Virtual Memory). This allows to - link the kernel at a fixed virtual address without having to + now supports PBVM (Pre-Boot Virtual Memory). This allows + linking the kernel at a fixed virtual address without having to make any assumptions about the physical memory layout. The PBVM also allows fine control of the address where the - kernel and its modules to be loaded. + kernel and its modules are to be loaded. @@ -625,7 +626,7 @@ calibration, DELAY(9) with TSC, and using TSC as a CPU ticker. Another new &man.loader.8; tunable machdep.disable_tsc_calibration allows to - skip TSC frequency calibration only. This is useful when + skip the TSC frequency calibration only. This is useful when one wants to use the nominal frequency of the chip in Intel processors, for example. @@ -634,22 +635,22 @@ The &os; &man.usb.4; subsystem now supports USB packet filter. This allows to capture packets - which go through each USB host controllers. The + which go through each USB host controller. The implementation is almost based on &man.bpf.4; code. The userland program &man.usbdump.8; has been added. Network Interface Support - A bug in &man.alc.4; driver which + A bug in the &man.alc.4; driver which could make AR8152-based network interfaces stop working has been fixed. A bxe(4) driver for Broadcom - NetXtreme II 10GbE controller (BCM57710, BCM57711, + NetXtreme II 10GbE controllers (BCM57710, BCM57711, BCM57711E) has been added. - A &man.cxgb.4; driver has been + The &man.cxgb.4; driver has been updated to version 7.11.0. A &man.cxgbe.4; driver for Chelsio @@ -657,34 +658,34 @@ added. The &man.dc.4; driver - now works correctly in the kernel with + now works correctly in kernels with the option. The &man.em.4; driver has been updated to version 7.3.2. - The &man.igb.4; driver has bee + The &man.igb.4; driver has been updated to version 2.2.5. The &man.igb.4; driver now supports - Intel I350 PCIe Gigabit Ethernet controller. + Intel I350 PCIe Gigabit Ethernet controllers. The &man.ixgbe.4; driver has been updated to version 2.3.8. Firmware images in the &man.iwn.4; - driver for 1000, 5000, 6000, and 6500 series have been + driver for 1000, 5000, 6000, and 6500 series cards have been updated. - A bug in &man.msk.4; driver has been - fixed. It could prevent the RX checksum offloading from + A bug in the &man.msk.4; driver has been + fixed. It could prevent RX checksum offloading from working. - A bug in &man.nfe.4; driver which + A bug in the &man.nfe.4; driver which could prevent reinitialization after changing the MTU has been fixed. - A bug in &man.ral.4; and &man.run.4; + A bug in the &man.ral.4; and &man.run.4; drivers which could prevent hostap mode from working has been fixed. @@ -693,7 +694,7 @@ The &man.re.4; driver now supports RTL8168E/8111E-VL PCIe Gigabit Ethernet controllers and - RTL8401E PCIe Fast Ethernet controller. + RTL8401E PCIe Fast Ethernet controllers. The &man.re.4; driver now supports TX interrupt moderation on RTL810xE PCIe Fast Ethernet @@ -701,15 +702,15 @@ The &man.re.4; driver now supports another mechanism for RX interrupt moderation because of - performance problem. A &man.sysctl.8; variable + performance problems. A &man.sysctl.8; variable dev.re.N.int_rx_mod has been added to control amount of time to delay RX - interrupt processing in units of microsecond. Setting it + interrupt processing, in units of microsecond. Setting it to 0 completely disables RX interrupt moderation. A &man.loader.8; tunable hw.re.intr_filter controls whether the - old mechanism utilizing MSI/MSI-X capability on the - supported controllers is used or not. When setting it to + old mechanism utilizing MSI/MSI-X capability on + supported controllers is used or not. When set to a non-zero value, the &man.re.4; driver uses the old mechanism. The default value is 0 and this tunable has no effect on controllers without MSI/MSI-X @@ -725,7 +726,7 @@ supports enabling TX and/or RX checksum offloading independently from each other. Note that TX IP checksum is disabled on some RTL8168C-based network interfaces - because it can generate an wrong IP checksum when the + because it can generate an incorrect IP checksum when the packet contains IP options. A bug in the &man.re.4; driver has @@ -733,20 +734,20 @@ frame on an RTL8169C, 8169D, or 8169E controller-based network interface. - The &man.re.4; driver now support - RTL8105E PCIe Fast Ethernet controller. + The &man.re.4; driver now supports + RTL8105E PCIe Fast Ethernet controllers. - The rlphy(4) driver now support + The rlphy(4) driver now supports the Realtek RTL8201E 10/100 PHY found in RTL8105E - controller. + controllers. A bug in the &man.sis.4; driver has - been changed. It could prevent a proper reinitialization - on DP83815, DP83816, and SiS 900/7016 controllers when + been fixed. It could prevent a proper reinitialization + on DP83815, DP83816, and SiS 900/7016 controllers when the configuration of multicast packet handling and/or promiscuous mode is changed. - A bug in &man.vlan.4; pseudo interface + A bug in the &man.vlan.4; pseudo interface han been fixed. It could have a random interface identifier in an automatically configured IPv6 link-local address, instead of one generated with the parent @@ -754,15 +755,15 @@ described in RFC 4291. A &man.vte.4; driver for RDC R6040 Fast - Ethernet controller, which is commonly found on Vortex86 + Ethernet controllers, which are commonly found on the Vortex86 System On a Chip, has been added. - A &man.vxge.4; driver for Neterion + A &man.vxge.4; driver for the Neterion X3100 10GbE Server/Storage adapter has been added. - A bug in &man.wpi.4; driver has been + A bug in the &man.wpi.4; driver has been fixed. It could display the following error messages and - result in the device unusable: + result in the device being unusable: wpi0: could not map mbuf (error 12) wpi0: wpi_rx_intr: bus_dmamap_load failed, error 12 @@ -773,25 +774,26 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile Network Protocols - The &man.ipfw.8; now supports IPv6 in + &man.ipfw.8; now supports IPv6 in the fwd action. - The &man.ipfw.8; now supports + &man.ipfw.8; now supports the call and return - action. Upon the call action, The + actions. Upon the call + number action, the current rule number is saved in the internal stack and ruleset processing continues with the first rule numbered - number or higher. The return action - takes rule number saved to internal stack by the last - call action and returns ruleset - processing to the first rule with number greater than number - of corresponding call rule. + number or higher. The + return action takes the rule number saved + to internal stack by the latest call + action and returns ruleset processing to the first rule with + number greater than that saved number. - &os; &man.ipsec.4; support now uses a + &os;'s &man.ipsec.4; support now uses half of the hash size as the authenticator hash size in Hashed Message Authentication Mode (HMAC-SHA-256, HMAC-SHA-384, and HMAC-SHA-512) as described in RFC 4868. - This was 96-bit fixed length in prior releases because the + This was a fixed 96-bit length in prior releases because the implementation was based on an old Internet draft draft-ietf-ipsec-ciph-sha-256-00. Note that this means &release.current; and later are no longer interoperable with @@ -803,47 +805,47 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile nor installed by default. To build and install them, specify WITH_OFED=yes in /etc/src.conf and rebuild the base - system as described in &os; Handbook. - &os; TCP/IP network stack now supports + The &os; TCP/IP network stack now supports IPv4 prefixes with /31 as described in RFC 3021, Using 31-Bit Prefixes on IPv4 Point-to-Point Links. - A bug in &os; TCP/IP network stack has - been fixed. The source address selection could not being + A bug in the &os; TCP/IP network stack has + been fixed. Source address selection could not be performed when multicast options were present but without an interface being specified. - A bug in + A bug in the IPV6_PKTINFO option used in - &man.sendmsg.2; has been fixed. The caused + &man.sendmsg.2; has been fixed. The IPV6_USE_MIN_MTU state set by &man.setsockopt.2; was ignored. - &os; TCP/IP network stack now supports &man.mod.cc.9; pluggable + The &os; TCP/IP network stack now supports the &man.mod.cc.9; pluggable congestion control framework. This allows TCP congestion control algorithms to be implemented as dynamically loadable kernel modules. The following kernel modules are available - as of &release.current;: &man.cc.chd.4; for - CAIA-Hamilton-Delay algorithm, &man.cc.cubic.4; for CUBIC - algorithm, &man.cc.hd.4; for Hamilton-Delay algorithm, - &man.cc.htcp.4; for H-TCP algorithm, &man.cc.newreno.4; for - NewReno algorithm, and &man.cc.vegas.4; for Vegas algorithm. + as of &release.current;: &man.cc.chd.4; for the + CAIA-Hamilton-Delay algorithm, &man.cc.cubic.4; for the CUBIC + algorithm, &man.cc.hd.4; for the Hamilton-Delay algorithm, + &man.cc.htcp.4; for the H-TCP algorithm, &man.cc.newreno.4; for + the NewReno algorithm, and &man.cc.vegas.4; for the Vegas algorithm. The default algorithm can be set by a new &man.sysctl.8; variable net.inet.tcp.cc.algorithm. The - value must be set to one of the names listed by the + value must be set to one of the names listed by net.inet.tcp.cc.available, and - newreno is set at boot time. + newreno is the default set at boot time. For more - detail, see &man.mod.cc.4; and &man.mod.cc.9; manual pages. + detail, see the &man.mod.cc.4; and &man.mod.cc.9; manual pages. An &man.h.ertt.4; (Enhanced Round Trip Time) &man.khelp.9; module has been added. This module - allows per-connection, low noise estimate of the + allows per-connection, low noise estimates of the instantaneous RTT in the TCP/IP network stack with a robust implementation even in the face of delayed acknowledgments and/or TSO (TCP Segmentation Offload) being in use for a @@ -851,7 +853,7 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile A new &man.tcp.4; socket option TCP_CONGESTION has been added. This - allows to select or query a congestion control algorithm + allows to select or query the congestion control algorithm that the TCP/IP network stack will use for connections on the socket. @@ -859,15 +861,15 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile node now supports IPv6. The &man.ng.one2many.4; - &man.netgraph.4; node now supports + &man.netgraph.4; node now supports the XMIT_FAILOVER transmit algorithm. This - makes packets deliver out the first active + makes packets deliver out of the first active many hook. The &man.ng.netflow.4; &man.netgraph.4; node now supports NetFlow version 9. A new export9 hook has been added for NetFlow - v9 data. Note that the data export can be done + v9 data. Note that data export can be done simultaneously in both version 5 and version 9. @@ -877,10 +879,10 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile The &man.ada.4; driver now supports write cache control. A new &man.sysctl.8 variable kern.cam.ada.write_cache determines - whether write cache of the &man.ada.4; devices is enabled or + whether the write cache of &man.ada.4; devices is enabled or not. Setting to 1 enables and - 0 disables, and -1 - leaves it the device default. &man.sysctl.8 variables + 0 disables the write cache, and -1 + leaves the device default behavior. &man.sysctl.8 variables kern.cam.ada.N.write_cache can override the configuration in a per-device basis (the default value is -1, which means to use @@ -891,15 +893,15 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile The &man.arcmsr.4; driver has been updated to version 1.20.00.22. - The &man.cam.4; subsystem now supports - descriptor format sense data in SPC-3 (SCSI Primary Commands + The &man.cam.4; subsystem now supports the + descriptor format sense data of the SPC-3 (SCSI Primary Commands 3) specification. The &man.geom.map.4; GEOM class has been added. This allows to generate multiple geom providers based on a hard-coded layout of a device with no explicit partition table such as embedded flash storage. For more - information, see &man.geom.map.4; manual page. + information, see the &man.geom.map.4; manual page. The &man.gpart.8; GEOM class now supports the following aliases for the MBR and EBR schemes: @@ -912,35 +914,35 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile supports bios-boot GUID for the GPT scheme which is used in GRUB 2 loader. - &man.graid.8; GEOM class has been - added. This is a replacement of &man.ataraid.4; driver + The &man.graid.8; GEOM class has been + added. This is a replacement of the &man.ataraid.4; driver supporting various BIOS-based software RAID. The &man.sysctl.8; variable kern.geom.confxml now contains information about disk identification in an - ident tag and disk model string in a + ident tag and disk model strings in a descr tag. The &man.md.4; memory-backed pseudo disk device driver now supports a &man.sysctl.8; variable vm.md_malloc_wait to specify whether a - malloc-backed disk to using M_WAITOK or + malloc-backed disk will use M_WAITOK or M_NOWAIT for &man.malloc.9; calls. The - M_WAITOK can prevent memory allocation + M_WAITOK setting can prevent memory allocation failure under high load. If it is set to 0, a malloc-backed disk uses M_NOWAIT for memory allocation. The default value is 0. A bug in the &man.mmc.4; driver - that could fail in device detection has been fixed. + that could cause device detection to fail has been fixed. The &man.mxge.4; driver has been updated. A &man.tws.4; driver for 3ware 9750 - SATA+SAS 6Gb/s RAID controller has been added. + SATA+SAS 6Gb/s RAID controllers has been added. @@ -950,27 +952,27 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile softupdates journaling. It introduces a intent log into a softupdates-enabled file system which eliminates the need for background &man.fsck.8; even on unclean shutdown. This - can be enabled in a per-filesystem basis by using a - flag in the &man.newfs.8; utility or a - option in the &man.tunefs.8; + can be enabled in a per-filesystem basis by using the + flag of the &man.newfs.8; utility or the + option of the &man.tunefs.8; utility. Note that the &release.current; installer - automatically enables the softupdates journaling for + automatically enables softupdates journaling for newly-created UFS file systems. The &os; Fast File System now - supports TRIM command when freeing data + supports the TRIM command when freeing data blocks. A new flag in the &man.newfs.8; - and &man.tunefs.8; utilities sets the TRIM-enable flag in a + and &man.tunefs.8; utilities sets the TRIM-enable flag for a file system. The TRIM-enable flag makes the file system send a delete request to the underlying device for each freed block. The TRIM command is - specified as Data Set Management Command in ATA8-ACS2 + specified as a Data Set Management Command in the ATA8-ACS2 standard to carry the information related to deleted data - blocks to device, especially for SSD (Solid-State Drive) for + blocks to a device, especially for a SSD (Solid-State Drive) for optimization. A new flag has - been added to &man.newfs.8; and &man.fsck.ffs.8; utilities. + been added to the &man.newfs.8; and &man.fsck.ffs.8; utilities. This clears unallocated blocks, notifying the underlying device that they are not used and that their contents may be discarded. This is useful in &man.fsck.ffs.8; for file @@ -980,18 +982,18 @@ wpi0: wpi_rx_intr: bus_dmamap_load faile filesystems which have been copied from one device to another. - The &os NFS subsystem has been + The &os; NFS subsystem has been updated. The new implementation supports NFS version 4 in addition to 2 and 3. The kernel options for the NFS server and client are changed from NFSSERVER and NFSCLIENT to NFSD and NFSCL. &man.sysctl.8; variables which start with vfs.nfssrv. have been renamed - with vfs.nfsd.. The NFS server now + to vfs.nfsd.. The NFS server now supports vfs.nfsd.server_max_nfsvers and vfs.nfsd.server_min_nfsvers &man.sysctl.8; variables to specify the maximum and the - minimum version number which the server accepts. The + minimum NFS version number which the server accepts. The default value is set to 3 and 2, respectively. @@ -1008,24 +1010,24 @@ nfsuserd_enable="YES" V4: / For more information about NFSv4 and its configuration, - see &man.nfsv4.4; and &man.exports.5; manual pages. + see the &man.nfsv4.4; and &man.exports.5; manual pages. The &os; NFS subsystem now supports a - mount option. This disables + mount option. This disables the close-to-open cache coherency check at open time. This option may improve performance for read-only mounts, but - should only be used if the data on the server changes + should only be used only if the data on the server changes rarely. The &man.mount.nfs.8; utility now also supports this flag keyword. A &man.loader.8; tunable vfs.typenumhash has been added and set to 1 by default. This enables to use a hash - calculation on file system identification number internally - used in the kernel. This fixes Stale NFS file + calculation on the file system identification number internally + used in the kernel. This fixes the Stale NFS file handle error on NFS clients when upgrading or rebuilding the kernel on the NFS server due to unexpected - change of the values. + change of these identification number values. The &os; ZFS subsystem has been updated to the SPA (Storage Pool Allocator, also known as @@ -1045,13 +1047,13 @@ nfsuserd_enable="YES" libm. The &man.bsdtar.1; and - &man.cpio.1; utility are now based on + &man.cpio.1; utilities are now based on libarchive version 2.8.4. The &man.cpuset.1; utility now supports a flag to create a new cpuset and assign an existing process into that set, and an - all keyword in option to specify all CPUs in the system. @@ -1062,46 +1064,46 @@ nfsuserd_enable="YES" behavior. A bug in the &man.fetch.1; utility which - could prevent STAT FTP command from working + could prevent the STAT FTP command from working properly has been fixed. The &man.gpart.8; utility now supports a - flag to show - subcommand. This allows to show provider's names of - partitions instead of partition's indexes. + flag to the show + subcommand. This allows showing providers' names of + partitions instead of the partitions' indexes. The &man.hastd.8; utility now drops - root privileges of the worker processes to + root privileges of the worker processes to the hast user. - The &man.hastd.8; utility now supports - checksum keyword to specify checksum + The &man.hastd.8; utility now supports a + checksum keyword to specify the checksum algorithm in a resource section. As of &release.current;, none, sha256, and crc32 are supported. - The &man.hastd.8; utility now supports - compression keyword to specify compression + The &man.hastd.8; utility now supports a + compression keyword to specify the compression algorithm in a resource section. As of &release.current;, none, hole and lzf are supported. - The &man.hastd.8; utility now supports + The &man.hastd.8; utility now supports a source keyword to specify the local address to bind to before connecting the remote &man.hastd.8 daemon. An implementation of iconv() API libraries and utilities which - are standardized in Single UNIX Specification have been + are standardized in Single UNIX Specification has been imported. These are based on NetBSD's Citrus implementation. Note that these are not built nor installed by default. To build and install them, specify WITH_ICONV=yes in /etc/src.conf and rebuild the base system - described in &os; Handbook. @@ -1113,21 +1115,21 @@ nfsuserd_enable="YES" half-duplex, and loopback, respectively. - &man.readline.3; API set has been + A &man.readline.3; API set has been imported into libedit. This is based on NetBSD's implementation and BSD licensed utilities now use it instead of GNU libreadline. - The &man.makefs.8; utility now supports + The &man.makefs.8; utility now supports the ISO 9660 format. libmd - and libcrypt now support SHA-256 - and SHA-512 algorithm. + and libcrypt now support the SHA-256 + and SHA-512 algorithms. The &man.netstat.1; utility now does not - expose internal scope address representation used in the &os; + expose the internal scope address representation used in the &os; kernel, which is derived from KAME IPv6 stack, in the results of netstat -ani and netstat -nr. @@ -1155,27 +1157,27 @@ nfsuserd_enable="YES" iface name name and iface description description commands. - These have the same functionalities as name - and description subcommands in the + These have the same functionalities as the name + and description subcommands of the &man.ifconfig.8; utility. The &man.ps.1; utility now - supports an option to display login + supports an option to display the login class information of each process, and and options for accumulated system and user CPU time, respectively. - The &man.rtadvd.8; daemon now supports + The &man.rtadvd.8; daemon now supports a noifprefix keyword to disable gathering on-link prefixes from interfaces when no addr keyword is specified. An entry in - rtadvd.conf with + /etc/rtadvd.conf with noifprefix and no addr generates an RA message with no prefix information option. The &man.rtsold.8; and - &man.rtadvd.8; daemon now support RDNSS and DNSSL option + &man.rtadvd.8; daemons now support the RDNSS and DNSSL options described in RFC 6106, IPv6 Router Advertisement Options for DNS Configuration. A &man.rtadvctl.8; utility to control the &man.rtadvd.8; daemon has been @@ -1185,14 +1187,14 @@ nfsuserd_enable="YES" shared objects as filters in ELF shared libraries. Both standard and auxiliary filtering have been supported. The &man.rtld.1; linker's processing of a filter defers loading a - filtee until a filter symbol is referenced unless + filtee until a filter symbol is referenced unless the LD_LOADFLTR environment variable is defined or a -z loadfltr option was specified when the filter was created. A race condition in the &man.sed.1; utility has been fixed. When an option is - specified, it could cause a short time window with no file + specified, there could be a short time window with no file with the original file name. The &man.sh.1; program now supports @@ -1200,22 +1202,22 @@ nfsuserd_enable="YES" specifying %job which is equivalent to the corresponding process group. Note that this built-in command returns the exit status - 2 instead of 1 if an + 2 instead of 1 if a fatal error occurs as other built-in commands do. A bug in the &man.sh.1; program has been - fixed for POSIX conformance. It could return an wrong exit + fixed for POSIX conformance. It could return an incorrect exit status when an exit command with no parameter is specified in the EXIT trap handler, which is triggered when the shell terminates. - In trap actions for other signals, exit + In trap actions for other signals, an exit command with no parameter returns an exit status corresponding to the received signal. A bug in the &man.sh.1; program has been fixed. When a foreground job exits on a signal, a message is printed to stdout about this. The buffer - was not flushed after this which could result in the message + was not flushed after printing which could result in the message being written to the wrong file if the next command was a built-in and had stdout redirected. @@ -1223,15 +1225,15 @@ nfsuserd_enable="YES" flag in trap command to stop the option processing. - %builtin keyword - support in $PATH variable has been removed - in the &man.sh.1; program. All built-in commands are always + The %builtin keyword + support in the $PATH variable has been removed + from the &man.sh.1; program. All built-in commands are always found before looking up directories in $PATH. Arithmetic expression handling code in the &man.sh.1; program has been updated by importing code from - dash. It now supports conditional + dash. It now supports the conditional operator (?:) and a bug in evaluation of && and || around an arithmetic expression has been fixed. @@ -1254,7 +1256,7 @@ nfsuserd_enable="YES" when a login daemon crashes or fails to remove the entry during shutdown. - The &man.zpool.8: utility now supports + The &man.zpool.8: utility now supports a zpool labelclear command. This allows to wipe the label data from a drive that is not active in a pool. @@ -1298,27 +1300,26 @@ nfsuserd_enable="YES" gdtoa, a set of binary from/to decimal number conversion routines used in - &os; libc library has been updated + &os;'s libc library has been updated to a snapshot as of 4 March, 2011. The LESS program has been updated to version v444. The LLVM - compiler infrastructure and the + compiler infrastructure and clang, a C language family front-end, version 3.0 have been imported. Note that it is not - used for building the &os; base system. In &os; build + used for building the &os; base system by default. In the &os; build infrastructure, the &man.clang.1;, &man.clang...1;, and &man.clang-cpp.1; utilities can be used in CC, CXX, and CPP &man.make.1; variables, respectively. - The - openresolv version 3.4.4 has been - imported. The &man.resolvconf.8; utility now handles - &man.resolv.conf.5; file. + Openresolv + version 3.4.4 has been imported. The &man.resolvconf.8; + utility now manages the &man.resolv.conf.5; file. The OpenSSH utility has been updated to @@ -1329,14 +1330,14 @@ nfsuserd_enable="YES" The pf packet filter has been updated to version 4.5. - The sendmail + sendmail has been updated to version 8.14.5. The timezone database has been updated to the tzdata2011m release. - &man.unifdef.1; utility has been updated + The &man.unifdef.1; utility has been updated to version 2.5.6. The xz @@ -1349,7 +1350,7 @@ nfsuserd_enable="YES" A new installer &man.bsdinstall.8; has been added and integrated into installation ISO images. The - &man.sysinstall.8; utility is also available for settings + &man.sysinstall.8; utility is also available for configuration after the installation. The supported version of @@ -1363,7 +1364,7 @@ nfsuserd_enable="YES" Upgrading from previous releases of &os; - Upgrading using freebsd-update(8) or source-based + <title>Upgrading using freebsd-update(8) or a source-based procedure Beginning with &os; 6.2-RELEASE, @@ -1396,7 +1397,7 @@ nfsuserd_enable="YES" This section describes notable incompatibilities which you might want to know before upgrading your system. - Please read this section and Please read this section and the Errata document carefully before submitting a problem report and/or posting a question to the FreeBSD mailing @@ -1405,15 +1406,15 @@ nfsuserd_enable="YES" Update of <literal>dialog</literal> - The dialog library is used in &os; - new installer and &os; Ports Collection to display a dialog + The dialog library is used in &os;'s + new installer and the &os; Ports Collection to display a dialog window and allow users to select various options. Note that - it is updated in &release.current; and there is several - differences in the key operation which might confuse users + it is updated in &release.current; and there are several + differences in key operations which might confuse users who are familiar with releases prior to &release.current;. - For example, pushing enter key in a check list window is no - longer able to be used to check an item. The new version - consistently supports space bar for selecting an item and + For example, pushing the enter key in a checklist window will + no longer check an item. The new version + consistently uses space bar for selecting an item and the enter key for OK/Cancel selection. @@ -1421,10 +1422,10 @@ nfsuserd_enable="YES" Partition Metadata Integrity Check &os; now checks the integrity of partition metadata when - a partition table is found on a disk though GEOM + a partition table is found on a disk though the GEOM PART subsystem. This detection is automatically performed when a disk device is ready. - GEOM PART class in the kernel + The GEOM PART class in the kernel verifies all generic partition parameters obtained from the disk metadata, and if some inconsistency is detected, the partition table will be rejected with the following @@ -1434,7 +1435,7 @@ nfsuserd_enable="YES" This integrity check is enabled by default. On a system prior to &release.current;, the inconsistencies were - silently ignored. Therefore, there is possibility that this + silently ignored. Therefore, there is a possibility that this prevents a system from booting after upgrading it to &release.current;. More specifically, the kernel cannot mount the system partition at boot time in some @@ -1449,11 +1450,10 @@ nfsuserd_enable="YES" boot These commands temporarily disable the integrity check. - If it was the cause, the &os; kernel should detect the - partitions after entering the commands as the prior release - did. This configuration can be added into - /boot/loader.conf like the - following: + If it was the cause of the boot failure, the &os; kernel should detect the + partitions as the prior release + did, after entering the commands. This configuration can be added into + /boot/loader.conf as follows: kern.geom.part.check_integrity="0" @@ -1465,23 +1465,23 @@ nfsuserd_enable="YES" => 63 1953525104 mirror/gm0 MBR (931G) [CORRUPT] 63 1953525105 1 freebsd [active] (931G) - For more information, see &man.gpart.8; manual page. + For more information, see the &man.gpart.8; manual page. ATA/SATA subsystem now &man.cam.4;-based - In &release.current;, &os; ATA/SATA disk subsystem has + In &release.current;, the &os; ATA/SATA disk subsystem has been replaced with a new &man.cam.4;-based implementation. - The &man.cam.4; stands for Common Access Method, which is an - implementation of API set originally for SCSI-2 and + &man.cam.4; stands for Common Access Method, which is an + implementation of an API set originally for SCSI-2 and standardized as "SCSI-2 Common Access Method Transport and - SCSI Interface Module". &os; has used &man.cam.4; subsystem + SCSI Interface Module". &os; has used the &man.cam.4; subsystem to handle SCSI devices since 3.X. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 05:47:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 661EA106566C; Thu, 12 Jan 2012 05:47:29 +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 4C94B8FC18; Thu, 12 Jan 2012 05:47: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 q0C5lTDf094581; Thu, 12 Jan 2012 05:47:29 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0C5lT5o094579; Thu, 12 Jan 2012 05:47:29 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201201120547.q0C5lT5o094579@svn.freebsd.org> From: Hiroki Sato Date: Thu, 12 Jan 2012 05:47:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230004 - stable/9/release/doc/en_US.ISO8859-1/relnotes X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 05:47:29 -0000 Author: hrs Date: Thu Jan 12 05:47:28 2012 New Revision: 230004 URL: http://svn.freebsd.org/changeset/base/230004 Log: Fix a typo. (s,&os;&arch.amd64,&os;/&arch.amd64,) Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Thu Jan 12 04:48:44 2012 (r230003) +++ stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Thu Jan 12 05:47:28 2012 (r230004) @@ -280,7 +280,7 @@ RCTL resource limiting framework. &os; now supports executing - &os; 1/&arch.i386; a.out binaries on &os;&arch.amd64;. Note + &os; 1/&arch.i386; a.out binaries on &os;/&arch.amd64;. Note that this is not built nor installed by default. To build and install them, specify options COMPAT_43 in the kernel configuration file and rebuild the base system as From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 05:50:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F3BD1065672; Thu, 12 Jan 2012 05:50:33 +0000 (UTC) (envelope-from wollman@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F7348FC0A; Thu, 12 Jan 2012 05:50: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 q0C5oXdc094720; Thu, 12 Jan 2012 05:50:33 GMT (envelope-from wollman@svn.freebsd.org) Received: (from wollman@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0C5oXEQ094718; Thu, 12 Jan 2012 05:50:33 GMT (envelope-from wollman@svn.freebsd.org) Message-Id: <201201120550.q0C5oXEQ094718@svn.freebsd.org> From: Garrett Wollman Date: Thu, 12 Jan 2012 05:50: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: r230005 - head/usr.sbin/tzsetup X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 05:50:33 -0000 Author: wollman Date: Thu Jan 12 05:50:32 2012 New Revision: 230005 URL: http://svn.freebsd.org/changeset/base/230005 Log: Use a reasonable-sized buffer when formatting error messages about installing zoneinfo. While we're in the vicinity, add some missing error checking to eliminate an unhelpful error message when unlink() fails. /me is embarrassed by the quality of his 16-year-old code. The whole thing is awful and could stand a complete rewrite. PR: 164038 Submitted by: Devin Teske (but implemented differently) Modified: head/usr.sbin/tzsetup/tzsetup.c Modified: head/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- head/usr.sbin/tzsetup/tzsetup.c Thu Jan 12 05:47:28 2012 (r230004) +++ head/usr.sbin/tzsetup/tzsetup.c Thu Jan 12 05:50:32 2012 (r230005) @@ -57,6 +57,13 @@ __FBSDID("$FreeBSD$"); #define _PATH_DB "/var/db/zoneinfo" #define _PATH_WALL_CMOS_CLOCK "/etc/wall_cmos_clock" +#ifdef PATH_MAX +#define SILLY_BUFFER_SIZE 2*PATH_MAX +#else +#warning "Somebody needs to fix this to dynamically size this buffer." +#define SILLY_BUFFER_SIZE 2048 +#endif + /* special return codes for `fire' actions */ #define DITEM_FAILURE 1 @@ -638,7 +645,7 @@ static int install_zoneinfo_file(const char *zoneinfo_file) { char buf[1024]; - char title[64], prompt[64]; + char title[64], prompt[SILLY_BUFFER_SIZE]; struct stat sb; ssize_t len; int fd1, fd2, copymode; @@ -709,7 +716,18 @@ install_zoneinfo_file(const char *zonein return (DITEM_FAILURE | DITEM_RECREATE); } - unlink(path_localtime); + if (unlink(path_localtime) < 0) { + snprintf(prompt, sizeof(prompt), + "Could not unlink %s: %s", + path_localtime, strerror(errno)); + if (usedialog) { + snprintf(title, sizeof(title), "Error"); + dialog_msgbox(title, prompt, 8, 72, 1); + } else + fprintf(stderr, "%s\n", prompt); + return (DITEM_FAILURE | DITEM_RECREATE); + } + fd2 = open(path_localtime, O_CREAT | O_EXCL | O_WRONLY, S_IRUSR | S_IRGRP | S_IROTH); if (fd2 < 0) { @@ -755,7 +773,17 @@ install_zoneinfo_file(const char *zonein fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); } - unlink(path_localtime); + if (unlink(path_localtime) < 0) { + snprintf(prompt, sizeof(prompt), + "Could not unlink %s: %s", + path_localtime, strerror(errno)); + if (usedialog) { + snprintf(title, sizeof(title), "Error"); + dialog_msgbox(title, prompt, 8, 72, 1); + } else + fprintf(stderr, "%s\n", prompt); + return (DITEM_FAILURE | DITEM_RECREATE); + } if (symlink(zoneinfo_file, path_localtime) < 0) { snprintf(title, sizeof(title), "Error"); snprintf(prompt, sizeof(prompt), From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 05:51:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E64AB1065672; Thu, 12 Jan 2012 05:51:11 +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 D118C8FC19; Thu, 12 Jan 2012 05:51:11 +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 q0C5pBGk094775; Thu, 12 Jan 2012 05:51:11 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0C5pB21094773; Thu, 12 Jan 2012 05:51:11 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201201120551.q0C5pB21094773@svn.freebsd.org> From: Hiroki Sato Date: Thu, 12 Jan 2012 05:51:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230006 - stable/9/release/doc/en_US.ISO8859-1/relnotes X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 05:51:12 -0000 Author: hrs Date: Thu Jan 12 05:51:11 2012 New Revision: 230006 URL: http://svn.freebsd.org/changeset/base/230006 Log: Fix example addresses. Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Thu Jan 12 05:50:32 2012 (r230005) +++ stable/9/release/doc/en_US.ISO8859-1/relnotes/article.sgml Thu Jan 12 05:51:11 2012 (r230006) @@ -1848,8 +1848,8 @@ em0: flags=8843<UP,BROADCAST,RUNNING, ifconfig_IF_alias0. Note that address family keywords are always required: - ifconfig_em0_alias0="inet 192.168.2.0 netmask 255.255.255.255" -ifconfig_em0_alias1="inet6 2011:db8:1::1 prefixlen 64 + ifconfig_em0_alias0="inet 192.168.2.10 netmask 255.255.255.255" +ifconfig_em0_alias1="inet6 2001:db8:1::1 prefixlen 64 Although ipv6_ifconfig_IF_aliasN From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 06:48:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 386DB106566B; Thu, 12 Jan 2012 06:48:12 +0000 (UTC) (envelope-from rea@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 17F3D8FC08; Thu, 12 Jan 2012 06:48: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 q0C6mBiD096666; Thu, 12 Jan 2012 06:48:11 GMT (envelope-from rea@svn.freebsd.org) Received: (from rea@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0C6mBio096662; Thu, 12 Jan 2012 06:48:11 GMT (envelope-from rea@svn.freebsd.org) Message-Id: <201201120648.q0C6mBio096662@svn.freebsd.org> From: Eygene Ryabinkin Date: Thu, 12 Jan 2012 06:48:11 +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: r230007 - in head: etc etc/rc.d share/man/man8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 06:48:12 -0000 Author: rea (ports committer) Date: Thu Jan 12 06:48:11 2012 New Revision: 230007 URL: http://svn.freebsd.org/changeset/base/230007 Log: rc.d: document 'quiet' prefix and fix dhclient/devd interaction Document the current semantics of the 'quiet' command prefix in the rc.subr(8). Fix dhclient rc.d script: it should not call err() for non-DHCP-enabled interface when it is called from devd, because the latter just blindly calls 'service dhclient quietstart' on each "link up" event. Since the 'quietstart' will silence the message "Cannot 'start' . Set _enable to YES in /etc/rc.conf or use 'onestart' instead of 'start'." and running dhclient on the non-DHCP-enabled interface is the same thing as running the service without _enable set, such modification is in sync with the current semantics of the 'quiet' prefix. Approved by: glebius Reviewed by: freebsd-rc list MFC after: 2 weeks Modified: head/etc/rc.d/dhclient head/etc/rc.subr head/share/man/man8/rc.subr.8 Modified: head/etc/rc.d/dhclient ============================================================================== --- head/etc/rc.d/dhclient Thu Jan 12 05:51:11 2012 (r230006) +++ head/etc/rc.d/dhclient Thu Jan 12 06:48:11 2012 (r230007) @@ -22,7 +22,14 @@ stop_precmd="dhclient_pre_check" dhclient_pre_check() { if [ -z "${rc_force}" ] && ! dhcpif $ifn; then - err 1 "'$ifn' is not a DHCP-enabled interface" + local msg + msg="'$ifn' is not a DHCP-enabled interface" + if [ -z "${rc_quiet}" ]; then + err 1 "$msg" + else + debug "$msg" + exit 1 + fi fi } Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Thu Jan 12 05:51:11 2012 (r230006) +++ head/etc/rc.subr Thu Jan 12 06:48:11 2012 (r230007) @@ -1116,7 +1116,7 @@ load_rc_config_var() # rc_usage() { - echo -n 1>&2 "Usage: $0 [fast|force|one](" + echo -n 1>&2 "Usage: $0 [fast|force|one|quiet](" _sep= for _elem; do Modified: head/share/man/man8/rc.subr.8 ============================================================================== --- head/share/man/man8/rc.subr.8 Thu Jan 12 05:51:11 2012 (r230006) +++ head/share/man/man8/rc.subr.8 Thu Jan 12 06:48:11 2012 (r230007) @@ -339,7 +339,7 @@ with being the list of valid arguments prefixed by .Sm off -.Dq Bq Li fast | force | one . +.Dq Bq Li fast | force | one | quiet . .Sm on .It Ic reverse_list Ar item ... Print the list of @@ -427,6 +427,22 @@ Skip the checks for being set to .Dq Li YES , but performs all the other prerequisite tests. +.It Li quiet +Inhibits some verbose diagnostics. +Currently, this includes messages +.Qq Starting ${name} +(as checked by +.Ic check_startmsgs +inside +.Nm ) +and errors about usage of services that are not enabled in +.Xr rc.conf 5 . +This prefix also sets +.Va rc_quiet Ns = Ns Li YES . +.Em Please, note: +.Va rc_quiet +is not intended to completely mask all debug and warning messages, +but only certain small classes of them. .El .Pp .Ic run_rc_command From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 07:44:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A8DB1065675; Thu, 12 Jan 2012 07:44:46 +0000 (UTC) (envelope-from joel@vnode.se) Received: from mail.vnode.se (mail.vnode.se [62.119.52.80]) by mx1.freebsd.org (Postfix) with ESMTP id AB32D8FC16; Thu, 12 Jan 2012 07:44:45 +0000 (UTC) Received: from mail.vnode.se (localhost [127.0.0.1]) by mail.vnode.se (Postfix) with ESMTP id DE0E3E3F07A; Thu, 12 Jan 2012 08:25:43 +0100 (CET) X-Virus-Scanned: amavisd-new at vnode.se Received: from mail.vnode.se ([127.0.0.1]) by mail.vnode.se (mail.vnode.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oObozPX91KkU; Thu, 12 Jan 2012 08:25:38 +0100 (CET) Received: from goofy01.vnodelab.local (unknown [212.247.52.12]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.vnode.se (Postfix) with ESMTPSA id 04B99E3F079; Thu, 12 Jan 2012 08:25:37 +0100 (CET) Date: Thu, 12 Jan 2012 08:25:36 +0100 From: Joel Dahl To: "Pedro F. Giffuni" Message-ID: <20120112072536.GC2227@goofy01.vnodelab.local> References: <201201112117.q0BLHEck077022@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201201112117.q0BLHEck077022@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: r229981 - in head/sys: conf dev/sound/pci gnu/dev/sound/pci modules/sound/driver/emu10kx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 07:44:46 -0000 On 11-01-2012 21:17, Pedro F. Giffuni wrote: > Author: pfg > Date: Wed Jan 11 21:17:14 2012 > New Revision: 229981 > URL: http://svn.freebsd.org/changeset/base/229981 > > Log: > Replace GPL'd headers in the emu10kx snd driver code. > > This uses the emuxkireg.h already used in the emu10k1 > snd driver. Special thanks go to Alexander Motin as > he was able to find some errors and reverse engineer > some wrong values in the emuxkireg header. > > The emu10kx driver is now free from the GPL. Thank you for taking care of this. -- Joel From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 08:03:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFF1C1065673; Thu, 12 Jan 2012 08:03:26 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DABD78FC16; Thu, 12 Jan 2012 08:03:26 +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 q0C83QDL099168; Thu, 12 Jan 2012 08:03:26 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0C83QmQ099166; Thu, 12 Jan 2012 08:03:26 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201201120803.q0C83QmQ099166@svn.freebsd.org> From: Peter Holm Date: Thu, 12 Jan 2012 08:03:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230008 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 08:03:27 -0000 Author: pho Date: Thu Jan 12 08:03:26 2012 New Revision: 230008 URL: http://svn.freebsd.org/changeset/base/230008 Log: MFC: r227674 Added check for negative seconds value. Found by syscall() fuzzing. Modified: stable/9/sys/kern/kern_thr.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_thr.c ============================================================================== --- stable/9/sys/kern/kern_thr.c Thu Jan 12 06:48:11 2012 (r230007) +++ stable/9/sys/kern/kern_thr.c Thu Jan 12 08:03:26 2012 (r230008) @@ -473,7 +473,8 @@ kern_thr_suspend(struct thread *td, stru } if (tsp != NULL) { - if (tsp->tv_nsec < 0 || tsp->tv_nsec > 1000000000) + if (tsp->tv_sec < 0 || tsp->tv_nsec < 0 || + tsp->tv_nsec > 1000000000) return (EINVAL); if (tsp->tv_sec == 0 && tsp->tv_nsec == 0) error = EWOULDBLOCK; From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 08:58:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D765106567B; Thu, 12 Jan 2012 08:58:47 +0000 (UTC) (envelope-from hans.petter.selasky@bitfrost.no) Received: from smtp02-out.isp.tdc.no (smtp02-out.isp.tdc.no [213.236.144.173]) by mx1.freebsd.org (Postfix) with ESMTP id A58758FC14; Thu, 12 Jan 2012 08:58:45 +0000 (UTC) Received: from mail.bitfrost.no (mail.bitfrost.no [85.19.79.136]) by smtp02-out.isp.tdc.no (Postfix) with ESMTP id AAA052304; Thu, 12 Jan 2012 09:58:43 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at bitfrost.no From: =?windows-1252?Q?Hans_Petter_Selasky?= To: =?windows-1252?Q?svn-src-head=40freebsd.org?= , =?windows-1252?Q?svn-src-all=40freebsd.org?= , =?windows-1252?Q?src-committers=40freebsd.org?= , =?windows-1252?Q?Kenneth_D._Merry?= Date: Thu, 12 Jan 2012 09:58:36 +0100 Mime-Version: 1.0 In-Reply-To: <201201120034.q0C0YXrq084182@svn.freebsd.org> References: <201201120034.q0C0YXrq084182@svn.freebsd.org> X-Priority: 3 (Normal) Message-Id: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: RE: svn commit: r229997 - in head: share/examples/scsi_target sys/amd64/conf sys/cam/ctl sys/cam/scsi sys/conf sys/dev/ata sys/dev/ciss sys/i386/conf sys/ia64/conf sys/sparc64/conf usr.bin usr.bin/ctls... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 08:58:47 -0000 Hi,=0D=0A=0D=0A=A0=0D=0A=0D=0ADoes the cam target layer support attach/de= tach of logical units=3F=0D=0A=0D=0A=A0=0D=0A=0D=0ACan it be used with US= B target mode=3F=0D=0A=0D=0A=A0=0D=0A=0D=0A--HPS=0D=0A=A0=0D=0A-----Origi= nal message-----=0D=0ATo:src-committers@freebsd.org; svn-src-all@freebsd.= org; svn-src-head@freebsd.org;=20=0D=0AFrom:Kenneth D. Merry =0D=0ASent:Thu 12-01-2012 01:35=0D=0ASubject:svn commit: r229997 -= in head: share/examples/scsi_target sys/amd64/conf sys/cam/ctl sys/cam/s= csi sys/conf sys/dev/ata sys/dev/ciss sys/i386/conf sys/ia64/conf sys/spa= rc64/conf usr.bin usr.bin/ctls...=0D=0AAuthor: ken=0D=0ADate: Thu Jan 12 = 00:34:33 2012=0D=0ANew Revision: 229997=0D=0AURL: http://svn.freebsd.org/= changeset/base/229997=0D=0A=0D=0ALog:=0D=0A=A0Add the CAM Target Layer (C= TL).=0D=0A=A0=0D=0A=A0CTL is a disk and processor device emulation subsys= tem originally written=0D=0A=A0for Copan Systems under Linux starting in = 2003. =A0It has been shipping in=0D=0A=A0Copan (now SGI) products since 2= 005.=0D=0A=A0=0D=0A=A0It was ported to FreeBSD in 2008, and thanks to an = agreement between SGI=0D=0A=A0(who acquired Copan's assets in 2010) and S= pectra Logic in 2010, CTL is=0D=0A=A0available under a BSD-style license.= =A0The intent behind the agreement was=0D=0A=A0that Spectra would work t= o get CTL into the FreeBSD tree.=0D=0A=A0=0D=0A=A0Some CTL features:=0D=0A= =A0=0D=0A=A0 - Disk and processor device emulation.=0D=0A=A0 - Tagged que= ueing=0D=0A=A0 - SCSI task attribute support (ordered, head of queue, sim= ple tags)=0D=0A=A0 - SCSI implicit command ordering support. =A0(e.g. if = a read follows a mode=0D=0A=A0 =A0 select, the read will be blocked until= the mode select completes.)=0D=0A=A0 - Full task management support (abo= rt, LUN reset, target reset, etc.)=0D=0A=A0 - Support for multiple ports=0D= =0A=A0 - Support for multiple simultaneous initiators=0D=0A=A0 - Support = for multiple simultaneous backing stores=0D=0A=A0 - Persistent reservatio= n support=0D=0A=A0 - Mode sense/select support=0D=0A=A0 - Error injection= support=0D=0A=A0 - High Availability support (1)=0D=0A=A0 - All I/O hand= led in-kernel, no userland context switch overhead.=0D=0A=A0=0D=0A=A0(1) = HA Support is just an API stub, and needs much more to be fully=0D=0A=A0 = =A0 =A0functional.=0D=0A=A0=0D=0A=A0ctl.c:The core of CTL. =A0Command han= dlers and processing,=0D=0A=A0character driver, and HA support are here.=0D= =0A=A0=0D=0A=A0ctl.h:Basic function declarations and data structures.=0D=0A= =A0=0D=0A=A0ctl_backend.c,=0D=0A=A0ctl_backend.h:The basic CTL backend AP= I.=0D=0A=A0=0D=0A=A0ctl_backend_block.c,=0D=0A=A0ctl_backend_block.h:The = block and file backend. =A0This allows for using=0D=0A=A0a disk or a file= as the backing store for a LUN.=0D=0A=A0Multiple threads are started to = do I/O to the=0D=0A=A0backing device, primarily because the VFS API=0D=0A= =A0requires that to get any concurrency.=0D=0A=A0=0D=0A=A0ctl_backend_ram= disk.c:A "fake" ramdisk backend. =A0It only allocates a=0D=0A=A0small amo= unt of memory to act as a source and sink=0D=0A=A0for reads and writes fr= om an initiator. =A0Therefore=0D=0A=A0it cannot be used for any real data= , but it can be=0D=0A=A0used to test for throughput. =A0It can also be us= ed=0D=0A=A0to test initiators' support for extremely large LUNs.=0D=0A=A0= =0D=0A=A0ctl_cmd_table.c:This is a table with all 256 possible SCSI opcod= es,=0D=0A=A0and command handler functions defined for supported=0D=0A=A0o= pcodes.=0D=0A=A0=0D=0A=A0ctl_debug.h:Debugging support.=0D=0A=A0=0D=0A=A0= ctl_error.c,=0D=0A=A0ctl_error.h:CTL-specific wrappers around the CAM sen= se building=0D=0A=A0functions.=0D=0A=A0=0D=0A=A0ctl_frontend.c,=0D=0A=A0c= tl_frontend.h:These files define the basic CTL frontend port API.=0D=0A=A0= =0D=0A=A0ctl_frontend_cam_sim.c:This is a CTL frontend port that is also = a CAM SIM.=0D=0A=A0This frontend allows for using CTL without any=0D=0A=A0= target-capable hardware. =A0So any LUNs you create in=0D=0A=A0CTL are vis= ible in CAM via this port.=0D=0A=A0=0D=0A=A0ctl_frontend_internal.c,=0D=0A= =A0ctl_frontend_internal.h:=0D=0A=A0This is a frontend port written for C= opan to do=0D=0A=A0some system-specific tasks that required sending=0D=0A= =A0commands into CTL from inside the kernel. =A0This=0D=0A=A0isn't entire= ly relevant to FreeBSD in general,=0D=0A=A0but can perhaps be repurposed.= =0D=0A=A0=0D=0A=A0ctl_ha.h:This is a stubbed-out High Availability API. =A0= Much=0D=0A=A0more is needed for full HA support. =A0See the=0D=0A=A0comme= nts in the header and the description of what=0D=0A=A0is needed in the RE= ADME.ctl.txt file for more=0D=0A=A0details.=0D=0A=A0=0D=0A=A0ctl_io.h:Thi= s defines most of the core CTL I/O structures.=0D=0A=A0union ctl_io is co= nceptually very similar to CAM's=0D=0A=A0union ccb.=0D=0A=A0=0D=0A=A0ctl_= ioctl.h:This defines all ioctls available through the CTL=0D=0A=A0charact= er device, and the data structures needed=0D=0A=A0for those ioctls.=0D=0A= =A0=0D=0A=A0ctl_mem_pool.c,=0D=0A=A0ctl_mem_pool.h:Generic memory pool im= plementation used by the=0D=0A=A0internal frontend.=0D=0A=A0=0D=0A=A0ctl_= private.h:Private data structres (e.g. CTL softc) and=0D=0A=A0function pr= ototypes. =A0This also includes the SCSI=0D=0A=A0vendor and product names= used by CTL.=0D=0A=A0=0D=0A=A0ctl_scsi_all.c,=0D=0A=A0ctl_scsi_all.h:CTL= wrappers around CAM sense printing functions.=0D=0A=A0=0D=0A=A0ctl_ser_t= able.c:Command serialization table. =A0This defines what=0D=0A=A0happens = when one type of command is followed by=0D=0A=A0another type of command.=0D= =0A=A0=0D=0A=A0ctl_util.c,=0D=0A=A0ctl_util.h:CTL utility functions, prim= arily designed to be=0D=0A=A0used from userland. =A0See ctladm for the pr= imary=0D=0A=A0consumer of these functions. =A0These include CDB=0D=0A=A0b= uilding functions.=0D=0A=A0=0D=0A=A0scsi_ctl.c:CAM target peripheral driv= er and CTL frontend port.=0D=0A=A0This is the path into CTL for commands = from=0D=0A=A0target-capable hardware/SIMs.=0D=0A=A0=0D=0A=A0README.ctl.tx= t:CTL code features, roadmap, to-do list.=0D=0A=A0=0D=0A=A0usr.sbin/Makef= ile:Add ctladm.=0D=0A=A0=0D=0A=A0ctladm/Makefile,=0D=0A=A0ctladm/ctladm.8= ,=0D=0A=A0ctladm/ctladm.c,=0D=0A=A0ctladm/ctladm.h,=0D=0A=A0ctladm/util.c= :ctladm(8) is the CTL management utility.=0D=0A=A0It fills a role similar= to camcontrol(8).=0D=0A=A0It allow configuring LUNs, issuing commands,=0D= =0A=A0injecting errors and various other control=0D=0A=A0functions.=0D=0A= =A0=0D=0A=A0usr.bin/Makefile:Add ctlstat.=0D=0A=A0=0D=0A=A0ctlstat/Makefi= le=0D=0A=A0ctlstat/ctlstat.8,=0D=0A=A0ctlstat/ctlstat.c:ctlstat(8) fills = a role similar to iostat(8).=0D=0A=A0It reports I/O statistics for CTL.=0D= =0A=A0=0D=0A=A0sys/conf/files:Add CTL files.=0D=0A=A0=0D=0A=A0sys/conf/NO= TES:Add device ctl.=0D=0A=A0=0D=0A=A0sys/cam/scsi_all.h:To conform to mor= e recent specs, the inquiry CDB=0D=0A=A0length field is now 2 bytes long.= =0D=0A=A0=0D=0A=A0Add several mode page definitions for CTL.=0D=0A=A0=0D=0A= =A0sys/cam/scsi_all.c:Handle the new 2 byte inquiry length.=0D=0A=A0=0D=0A= =A0sys/dev/ciss/ciss.c,=0D=0A=A0sys/dev/ata/atapi-cam.c,=0D=0A=A0sys/cam/= scsi/scsi_targ_bh.c,=0D=0A=A0scsi_target/scsi_cmds.c,=0D=0A=A0mlxcontrol/= interface.c:Update for 2 byte inquiry length field.=0D=0A=A0=0D=0A=A0scsi= _da.h:Add versions of the format and rigid disk pages=0D=0A=A0that are in= a more reasonable format for CTL.=0D=0A=A0=0D=0A=A0amd64/conf/GENERIC,=0D= =0A=A0i386/conf/GENERIC,=0D=0A=A0ia64/conf/GENERIC,=0D=0A=A0sparc64/conf/= GENERIC:Add device ctl.=0D=0A=A0=0D=0A=A0i386/conf/PAE:The CTL frontend S= IM at least does not compile=0D=0A=A0cleanly on PAE.=0D=0A=A0=0D=0A=A0Spo= nsored by:Copan Systems, SGI and Spectra Logic=0D=0A=A0MFC after:1 month=0D= =0A=0D=0AAdded:=0D=0A=A0head/sys/cam/ctl/=0D=0A=A0head/sys/cam/ctl/README= =2Ectl.txt =A0 (contents, props changed)=0D=0A=A0head/sys/cam/ctl/ctl.c =A0= (contents, props changed)=0D=0A=A0head/sys/cam/ctl/ctl.h =A0 (contents, = props changed)=0D=0A=A0head/sys/cam/ctl/ctl_backend.c =A0 (contents, prop= s changed)=0D=0A=A0head/sys/cam/ctl/ctl_backend.h =A0 (contents, props ch= anged)=0D=0A=A0head/sys/cam/ctl/ctl_backend_block.c =A0 (contents, props = changed)=0D=0A=A0head/sys/cam/ctl/ctl_backend_block.h =A0 (contents, prop= s changed)=0D=0A=A0head/sys/cam/ctl/ctl_backend_ramdisk.c =A0 (contents, = props changed)=0D=0A=A0head/sys/cam/ctl/ctl_cmd_table.c =A0 (contents, pr= ops changed)=0D=0A=A0head/sys/cam/ctl/ctl_debug.h =A0 (contents, props ch= anged)=0D=0A=A0head/sys/cam/ctl/ctl_error.c =A0 (contents, props changed)= =0D=0A=A0head/sys/cam/ctl/ctl_error.h =A0 (contents, props changed)=0D=0A= =A0head/sys/cam/ctl/ctl_frontend.c =A0 (contents, props changed)=0D=0A=A0= head/sys/cam/ctl/ctl_frontend.h =A0 (contents, props changed)=0D=0A=A0hea= d/sys/cam/ctl/ctl_frontend_cam_sim.c =A0 (contents, props changed)=0D=0A=A0= head/sys/cam/ctl/ctl_frontend_internal.c =A0 (contents, props changed)=0D= =0A=A0head/sys/cam/ctl/ctl_frontend_internal.h =A0 (contents, props chang= ed)=0D=0A=A0head/sys/cam/ctl/ctl_ha.h =A0 (contents, props changed)=0D=0A= =A0head/sys/cam/ctl/ctl_io.h =A0 (contents, props changed)=0D=0A=A0head/s= ys/cam/ctl/ctl_ioctl.h =A0 (contents, props changed)=0D=0A=A0head/sys/cam= /ctl/ctl_mem_pool.c =A0 (contents, props changed)=0D=0A=A0head/sys/cam/ct= l/ctl_mem_pool.h =A0 (contents, props changed)=0D=0A=A0head/sys/cam/ctl/c= tl_private.h =A0 (contents, props changed)=0D=0A=A0head/sys/cam/ctl/ctl_s= csi_all.c =A0 (contents, props changed)=0D=0A=A0head/sys/cam/ctl/ctl_scsi= _all.h =A0 (contents, props changed)=0D=0A=A0head/sys/cam/ctl/ctl_ser_tab= le.c =A0 (contents, props changed)=0D=0A=A0head/sys/cam/ctl/ctl_util.c =A0= (contents, props changed)=0D=0A=A0head/sys/cam/ctl/ctl_util.h =A0 (conte= nts, props changed)=0D=0A=A0head/sys/cam/ctl/scsi_ctl.c =A0 (contents, pr= ops changed)=0D=0A=A0head/usr.bin/ctlstat/=0D=0A=A0head/usr.bin/ctlstat/M= akefile =A0 (contents, props changed)=0D=0A=A0head/usr.bin/ctlstat/ctlsta= t.8 =A0 (contents, props changed)=0D=0A=A0head/usr.bin/ctlstat/ctlstat.c = =A0 (contents, props changed)=0D=0A=A0head/usr.sbin/ctladm/=0D=0A=A0head/= usr.sbin/ctladm/Makefile =A0 (contents, props changed)=0D=0A=A0head/usr.s= bin/ctladm/ctladm.8 =A0 (contents, props changed)=0D=0A=A0head/usr.sbin/c= tladm/ctladm.c =A0 (contents, props changed)=0D=0A=A0head/usr.sbin/ctladm= /ctladm.h =A0 (contents, props changed)=0D=0A=A0head/usr.sbin/ctladm/util= =2Ec =A0 (contents, props changed)=0D=0AModified:=0D=0A=A0head/share/exam= ples/scsi_target/scsi_cmds.c=0D=0A=A0head/sys/amd64/conf/GENERIC=0D=0A=A0= head/sys/cam/scsi/scsi_all.c=0D=0A=A0head/sys/cam/scsi/scsi_all.h=0D=0A=A0= head/sys/cam/scsi/scsi_da.h=0D=0A=A0head/sys/cam/scsi/scsi_targ_bh.c=0D=0A= =A0head/sys/conf/NOTES=0D=0A=A0head/sys/conf/files=0D=0A=A0head/sys/dev/a= ta/atapi-cam.c=0D=0A=A0head/sys/dev/ciss/ciss.c=0D=0A=A0head/sys/i386/con= f/GENERIC=0D=0A=A0head/sys/i386/conf/PAE=0D=0A=A0head/sys/ia64/conf/GENER= IC=0D=0A=A0head/sys/sparc64/conf/GENERIC=0D=0A=A0head/usr.bin/Makefile=0D= =0A=A0head/usr.sbin/Makefile=0D=0A=A0head/usr.sbin/mlxcontrol/interface.c= =0D=0A=0D=0AModified: head/share/examples/scsi_target/scsi_cmds.c=0D=0A=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=0D=0A--- head/share/examples/scsi_target/scsi_cmds.cThu Jan 12 00:= 05:35 2012(r229996)=0D=0A+++ head/share/examples/scsi_target/scsi_cmds.cT= hu Jan 12 00:34:33 2012(r229997)=0D=0A@@ -328,7 +328,7 @@ tcmd_inquiry(st= ruct ccb_accept_tio *atio=0D=0Abcopy(&inq_data, ctio->data_ptr, sizeof(in= q_data));=0D=0Actio->dxfer_len =3D inq_data.additional_length + 4;=0D=0Ac= tio->dxfer_len =3D min(ctio->dxfer_len,=0D=0A- =A0 =A0 =A0SCSI_CDB6_LEN(i= nq->length));=0D=0A+ =A0 =A0 =A0scsi_2btoul(inq->length));=0D=0Actio->ccb= _h.flags |=3D CAM_DIR_IN | CAM_SEND_STATUS;=0D=0Actio->scsi_status =3D SC= SI_STATUS_OK;=0D=0A}=0D=0A=0D=0AModified: head/sys/amd64/conf/GENERIC=0D=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=0D=0A--- head/sys/amd64/conf/GENERICThu Jan 12 00:05:35 2012(r2= 29996)=0D=0A+++ head/sys/amd64/conf/GENERICThu Jan 12 00:34:33 2012(r2299= 97)=0D=0A@@ -131,7 +131,8 @@ deviceda# Direct Access (disks)=0D=0Adevices= a# Sequential Access (tape etc)=0D=0Adevicecd# CD=0D=0Adevicepass# Passth= rough device (direct ATA/SCSI access)=0D=0A-deviceses# SCSI Environmental= Services (and SAF-TE)=0D=0A+deviceses# Enclosure Services (SES and SAF-T= E)=0D=0A+devicectl# CAM Target Layer=0D=0A=0D=0A# RAID controllers interf= aced to the SCSI subsystem=0D=0Adeviceamr# AMI MegaRAID=0D=0A=0D=0AAdded:= head/sys/cam/ctl/README.ctl.txt=0D=0A=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D=0A--- /dev/null00:00:= 00 1970(empty, because file is newly added)=0D=0A+++ head/sys/cam/ctl/REA= DME.ctl.txtThu Jan 12 00:34:33 2012(r229997)=0D=0A@@ -0,0 +1,449 @@=0D=0A= +/* $FreeBSD$ */=0D=0A+=0D=0A+CTL - CAM Target Layer Description=0D=0A+=0D= =0A+Revision 1.4 (December 29th, 2011)=0D=0A+Ken Merry =0D= =0A+=0D=0A+Table of Contents:=0D=0A+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=0D=0A+=0D=0A+Introduction=0D=0A+Features=0D=0A+Configuring a= nd Running CTL=0D=0A+Revision 1.N Changes=0D=0A+To Do List=0D=0A+Code Roa= dmap=0D=0A+Userland Commands=0D=0A+=0D=0A+Introduction:=0D=0A+=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=0D=0A+=0D=0A+CTL is a disk and processor device = emulation subsystem originally written=0D=0A+for Copan Systems under Linu= x starting in 2003. =A0It has been shipping in=0D=0A+Copan (now SGI) prod= ucts since 2005.=0D=0A+=0D=0A+It was ported to FreeBSD in 2008, and thank= s to an agreement between SGI=0D=0A+(who acquired Copan's assets in 2010)= and Spectra Logic in 2010, CTL is=0D=0A+available under a BSD-style lice= nse. =A0The intent behind the agreement was=0D=0A+that Spectra would work= to get CTL into the FreeBSD tree.=0D=0A+=0D=0A+Features:=0D=0A+=3D=3D=3D= =3D=3D=3D=3D=3D=0D=0A+=0D=0A+ - Disk and processor device emulation.=0D=0A= + - Tagged queueing=0D=0A+ - SCSI task attribute support (ordered, head o= f queue, simple tags)=0D=0A+ - SCSI implicit command ordering support. =A0= (e.g. if a read follows a mode=0D=0A+ =A0 select, the read will be blocke= d until the mode select completes.)=0D=0A+ - Full task management support= (abort, LUN reset, target reset, etc.)=0D=0A+ - Support for multiple por= ts=0D=0A+ - Support for multiple simultaneous initiators=0D=0A+ - Support= for multiple simultaneous backing stores=0D=0A+ - Persistent reservation= support=0D=0A+ - Mode sense/select support=0D=0A+ - Error injection supp= ort=0D=0A+ - High Availability support (1)=0D=0A+ - All I/O handled in-ke= rnel, no userland context switch overhead.=0D=0A+=0D=0A+(1) HA Support is= just an API stub, and needs much more to be fully=0D=0A+ =A0 =A0function= al. =A0See the to-do list below.=0D=0A+=0D=0A+Configuring and Running CTL= :=0D=0A+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=0D=0A+=0D=0A+ - After applying the CTL patchset to your t= ree, build world and install it=0D=0A+ =A0 on your target system.=0D=0A+=0D= =0A+ - Add 'device ctl' to your kernel configuration file.=0D=0A+=0D=0A+ = - If you're running with a 8Gb or 4Gb Qlogic FC board, add=0D=0A+ =A0 'op= tions ISP_TARGET_MODE' to your kernel config file. =A0Keep in mind that=0D= =0A+ =A0 the isp(4) driver can run in target or initiator mode, but not b= oth on=0D=0A+ =A0 the same machine. =A0'device ispfw' or loading the ispf= w module is also=0D=0A+ =A0 recommended.=0D=0A+=0D=0A+ - Rebuild and inst= all a new kernel.=0D=0A+=0D=0A+ - Reboot with the new kernel.=0D=0A+=0D=0A= + - To add a LUN with the RAM disk backend:=0D=0A+=0D=0A+ctladm create -b= ramdisk -s 10485760000000000000=0D=0A+ctladm port -o on=0D=0A+=0D=0A+ - = You should now see the CTL disk LUN through camcontrol devlist:=0D=0A+=0D= =0A+scbus6 on ctl2cam0 bus 0:=0D=0A+ =A0 =A0 =A0 =A0= =A0 =A0 at scbus6 target 1 lun 0 (da24,pass32)=0D=0A+<> =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 at scbus6 target -1 lun -= 1 ()=0D=0A+=0D=0A+ =A0 This is visible through the CTL CAM SIM. =A0This a= llows using CTL without=0D=0A+ =A0 any physical hardware. =A0You should b= e able to issue any normal SCSI=0D=0A+ =A0 commands to the device via the= pass(4)/da(4) devices.=0D=0A+=0D=0A+ =A0 If any target-capable HBAs are = in the system (e.g. isp(4)), and have=0D=0A+ =A0 target mode enabled, you= should now also be able to see the CTL LUNs via=0D=0A+ =A0 that target i= nterface.=0D=0A+=0D=0A+ =A0 Note that all CTL LUNs are presented to all f= rontends. =A0There is no=0D=0A+ =A0 LUN masking, or separate, per-port co= nfiguration.=0D=0A+=0D=0A+ - Note that the ramdisk backend is a "fake" ra= mdisk. =A0That is, it is=0D=0A+ =A0 backed by a small amount of RAM that = is used for all I/O requests. =A0This=0D=0A+ =A0 is useful for performanc= e testing, but not for any data integrity tests.=0D=0A+=0D=0A+ - To add a= LUN with the block/file backend:=0D=0A+=0D=0A+truncate -s +1T myfile=0D=0A= +ctladm create -b block -o file=3Dmyfile=0D=0A+ctladm port -o on=0D=0A+=0D= =0A+ - You can also see a list of LUNs and their backends like this:=0D=0A= +=0D=0A+# ctladm devlist=0D=0A+LUN Backend =A0 =A0 =A0 Size (Blocks) =A0 = BS Serial Number =A0 =A0Device ID =A0 =A0 =A0=20=0D=0A+ =A00 block =A0 =A0= =A0 =A0 =A0 =A02147483648 =A0512 MYSERIAL =A0 0 =A0 =A0 MYDEVID =A0 0 =A0= =A0=20=0D=0A+ =A01 block =A0 =A0 =A0 =A0 =A0 =A02147483648 =A0512 MYSERI= AL =A0 1 =A0 =A0 MYDEVID =A0 1 =A0 =A0=20=0D=0A+ =A02 block =A0 =A0 =A0 =A0= =A0 =A02147483648 =A0512 MYSERIAL =A0 2 =A0 =A0 MYDEVID =A0 2 =A0 =A0=20= =0D=0A+ =A03 block =A0 =A0 =A0 =A0 =A0 =A02147483648 =A0512 MYSERIAL =A0 = 3 =A0 =A0 MYDEVID =A0 3 =A0 =A0=20=0D=0A+ =A04 block =A0 =A0 =A0 =A0 =A0 = =A02147483648 =A0512 MYSERIAL =A0 4 =A0 =A0 MYDEVID =A0 4 =A0 =A0=20=0D=0A= + =A05 block =A0 =A0 =A0 =A0 =A0 =A02147483648 =A0512 MYSERIAL =A0 5 =A0 = =A0 MYDEVID =A0 5 =A0 =A0=20=0D=0A+ =A06 block =A0 =A0 =A0 =A0 =A0 =A0214= 7483648 =A0512 MYSERIAL =A0 6 =A0 =A0 MYDEVID =A0 6 =A0 =A0=20=0D=0A+ =A0= 7 block =A0 =A0 =A0 =A0 =A0 =A02147483648 =A0512 MYSERIAL =A0 7 =A0 =A0 M= YDEVID =A0 7 =A0 =A0=20=0D=0A+ =A08 block =A0 =A0 =A0 =A0 =A0 =A021474836= 48 =A0512 MYSERIAL =A0 8 =A0 =A0 MYDEVID =A0 8 =A0 =A0=20=0D=0A+ =A09 blo= ck =A0 =A0 =A0 =A0 =A0 =A02147483648 =A0512 MYSERIAL =A0 9 =A0 =A0 MYDEVI= D =A0 9 =A0 =A0=20=0D=0A+ 10 block =A0 =A0 =A0 =A0 =A0 =A02147483648 =A05= 12 MYSERIAL =A010 =A0 =A0 MYDEVID =A010 =A0 =A0=20=0D=0A+ 11 block =A0 =A0= =A0 =A0 =A0 =A02147483648 =A0512 MYSERIAL =A011 =A0 =A0 MYDEVID =A011 =A0= =A0=0D=0A+=0D=0A+ - You can see the LUN type and backing store for block= /file backend LUNs=0D=0A+ =A0 like this:=0D=0A+=0D=0A+# ctladm devlist -v= =0D=0A+LUN Backend =A0 =A0 =A0 Size (Blocks) =A0 BS Serial Number =A0 =A0= Device ID =A0 =A0 =A0=20=0D=0A+ =A00 block =A0 =A0 =A0 =A0 =A0 =A02147483= 648 =A0512 MYSERIAL =A0 0 =A0 =A0 MYDEVID =A0 0 =A0 =A0=20=0D=0A+ =A0 =A0= =A0lun_type=3D0=0D=0A+ =A0 =A0 =A0num_threads=3D14=0D=0A+ =A0 =A0 =A0fil= e=3Dtestdisk0=0D=0A+ =A01 block =A0 =A0 =A0 =A0 =A0 =A02147483648 =A0512 = MYSERIAL =A0 1 =A0 =A0 MYDEVID =A0 1 =A0 =A0=20=0D=0A+ =A0 =A0 =A0lun_typ= e=3D0=0D=0A+ =A0 =A0 =A0num_threads=3D14=0D=0A+ =A0 =A0 =A0file=3Dtestdis= k1=0D=0A+ =A02 block =A0 =A0 =A0 =A0 =A0 =A02147483648 =A0512 MYSERIAL =A0= 2 =A0 =A0 MYDEVID =A0 2 =A0 =A0=20=0D=0A+ =A0 =A0 =A0lun_type=3D0=0D=0A+= =A0 =A0 =A0num_threads=3D14=0D=0A+ =A0 =A0 =A0file=3Dtestdisk2=0D=0A+ =A0= 3 block =A0 =A0 =A0 =A0 =A0 =A02147483648 =A0512 MYSERIAL =A0 3 =A0 =A0 M= YDEVID =A0 3 =A0 =A0=20=0D=0A+ =A0 =A0 =A0lun_type=3D0=0D=0A+ =A0 =A0 =A0= num_threads=3D14=0D=0A+ =A0 =A0 =A0file=3Dtestdisk3=0D=0A+ =A04 block =A0= =A0 =A0 =A0 =A0 =A02147483648 =A0512 MYSERIAL =A0 4 =A0 =A0 MYDEVID =A0 = 4 =A0 =A0=20=0D=0A+ =A0 =A0 =A0lun_type=3D0=0D=0A+ =A0 =A0 =A0num_threads= =3D14=0D=0A+ =A0 =A0 =A0file=3Dtestdisk4=0D=0A+ =A05 block =A0 =A0 =A0 =A0= =A0 =A02147483648 =A0512 MYSERIAL =A0 5 =A0 =A0 MYDEVID =A0 5 =A0 =A0=20= =0D=0A+ =A0 =A0 =A0lun_type=3D0=0D=0A+ =A0 =A0 =A0num_threads=3D14=0D=0A+= =A0 =A0 =A0file=3Dtestdisk5=0D=0A+ =A06 block =A0 =A0 =A0 =A0 =A0 =A0214= 7483648 =A0512 MYSERIAL =A0 6 =A0 =A0 MYDEVID =A0 6 =A0 =A0=20=0D=0A+ =A0= =A0 =A0lun_type=3D0=0D=0A+ =A0 =A0 =A0num_threads=3D14=0D=0A+ =A0 =A0 =A0= file=3Dtestdisk6=0D=0A+ =A07 block =A0 =A0 =A0 =A0 =A0 =A02147483648 =A05= 12 MYSERIAL =A0 7 =A0 =A0 MYDEVID =A0 7 =A0 =A0=20=0D=0A+ =A0 =A0 =A0lun_= type=3D0=0D=0A+ =A0 =A0 =A0num_threads=3D14=0D=0A+ =A0 =A0 =A0file=3Dtest= disk7=0D=0A+ =A08 block =A0 =A0 =A0 =A0 =A0 =A02147483648 =A0512 MYSERIAL= =A0 8 =A0 =A0 MYDEVID =A0 8 =A0 =A0=20=0D=0A+ =A0 =A0 =A0lun_type=3D0=0D= =0A+ =A0 =A0 =A0num_threads=3D14=0D=0A+ =A0 =A0 =A0file=3Dtestdisk8=0D=0A= + =A09 block =A0 =A0 =A0 =A0 =A0 =A02147483648 =A0512 MYSERIAL =A0 9 =A0 = =A0 MYDEVID =A0 9 =A0 =A0=20=0D=0A+ =A0 =A0 =A0lun_type=3D0=0D=0A+ =A0 =A0= =A0num_threads=3D14=0D=0A+ =A0 =A0 =A0file=3Dtestdisk9=0D=0A+ 10 ramdisk= =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 0 =A0 =A00 MYSERIAL =A0 0 =A0 =A0 MY= DEVID =A0 0 =A0 =A0=20=0D=0A+ =A0 =A0 =A0lun_type=3D3=0D=0A+ 11 ramdisk =A0= =A0 204800000000000 =A0512 MYSERIAL =A0 1 =A0 =A0 MYDEVID =A0 1 =A0 =A0=20= =0D=0A+ =A0 =A0 =A0lun_type=3D0=0D=0A+=0D=0A+=0D=0A+Revision 1.4 Changes=0D= =0A+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D=0A+ -= Added in the second HA mode (where CTL does the data transfers instead=0D= =0A+ =A0 of having data transfers done below CTL), and abstracted out the= Copan=0D=0A+ =A0 HA API.=0D=0A+=0D=0A+ - Fixed the phantom device proble= m in the CTL CAM SIM and improved the=0D=0A+ =A0 CAM SIM to automatically= trigger a rescan when the port is enabled and=0D=0A+ =A0 disabled.=0D=0A= +=20=0D=0A+ - Made the number of threads in the block backend configurabl= e via sysctl,=0D=0A+ =A0 loader tunable and the ctladm command line. =A0(= You can now specify=0D=0A+ =A0 -o num_threads=3D4 when creating a LUN wit= h ctladm create.)=0D=0A+=0D=0A+ - Fixed some LUN selection issues in ctls= tat(8) and allowed for selection=0D=0A+ =A0 of LUN numbers up to 1023.=0D= =0A+=0D=0A+ - General cleanup.=0D=0A+=0D=0A+ - This version intended for = public release.=0D=0A+=0D=0A+Revision 1.3 Changes=0D=0A+=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D=0A+ - Added descriptor sens= e support to CTL. =A0It can be enabled through the=0D=0A+ =A0 control mod= e page (10), but is disabled by default.=0D=0A+=0D=0A+ - Improved error i= njection support. =A0The number of errors that can be=0D=0A+ =A0 injected= with 'ctladm inject' has been increased, and any arbitrary=0D=0A+ =A0 se= nse data may now be injected as well.=0D=0A+=0D=0A+ - The port infrastruc= ture has been revamped. =A0Individual ports and types=0D=0A+ =A0 of ports= may now be enabled and disabled from the command line. =A0ctladm=0D=0A+ = =A0 now has the ability to set the WWNN and WWPN for each port.=0D=0A+=0D= =0A+ - The block backend can now send multiple I/Os to backing files. =A0= Multiple=0D=0A+ =A0 writes are only allowed for ZFS, but multiple readers= are allowed for=0D=0A+ =A0 any filesystem.=0D=0A+=0D=0A+ - The block and= ramdisk backends now support setting the LUN blocksize.=0D=0A+ =A0 There= are some restrictions when the backing device is a block device,=0D=0A+ = =A0 but otherwise the blocksize may be set to anything.=0D=0A+=0D=0A+Revi= sion 1.2 Changes=0D=0A+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=0D=0A+=0D=0A+ - CTL initialization process has been revamped. =A0= Instead of using an=0D=0A+ =A0 ad-hoc method, it is now sequenced through= SYSINIT() calls.=0D=0A+=0D=0A+ - A block/file backend has been added. =A0= This allows using arbitrary files=0D=0A+ =A0 or block devices as a backin= g store.=0D=0A+=0D=0A+ - The userland LUN configuration interface has bee= n completely rewritten.=0D=0A+ =A0 Configuration is now done out of band.= =0D=0A+=0D=0A+ - The ctladm(8) command line interface has been revamped, = and is now=0D=0A+ =A0 similar to camcontrol(8).=0D=0A+=0D=0A+To Do List:=0D= =0A+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D=0A+=0D=0A+ - Make CTL buildable as = a module. =A0Work needs to be done on initialization,=0D=0A+ =A0 and on f= reeing resources and LUNs when it is built as a module.=0D=0A+=0D=0A+ - U= se devstat(9) for CTL's statistics collection. =A0CTL uses a home-grown=0D= =0A+ =A0 statistics collection system that is similar to devstat(9). =A0c= tlstat=0D=0A+ =A0 should be retired in favor of iostat, etc., once aggreg= ation modes are=0D=0A+ =A0 available in iostat to match the behavior of c= tlstat -t and dump modes=0D=0A+ =A0 are available to match the behavior o= f ctlstat -d/ctlstat -J.=0D=0A+=0D=0A+ - ZFS ARC backend for CTL. =A0Sinc= e ZFS copies all I/O into the ARC=0D=0A+ =A0 (Adaptive Replacement Cache)= , running the block/file backend on top of a=0D=0A+ =A0 ZFS-backed zdev o= r file will involve an extra set of copies. =A0The=0D=0A+ =A0 optimal sol= ution for backing targets served by CTL with ZFS would be to=0D=0A+ =A0 a= llocate buffers out of the ARC directly, and DMA to/from them directly.=0D= =0A+ =A0 That would eliminate an extra data buffer allocation and copy.=0D= =0A+=0D=0A+ - Switch CTL over to using CAM CCBs instead of its own union = ctl_io. =A0This=0D=0A+ =A0 will likely require a significant amount of wo= rk, but will eliminate=0D=0A+ =A0 another data structure in the stack, mo= re memory allocations, etc. =A0This=0D=0A+ =A0 will also require changes = to the CAM CCB structure to support CTL.=0D=0A+=0D=0A+ - Full-featured Hi= gh Availability support. =A0The HA API that is in ctl_ha.h=0D=0A+ =A0 is = essentially a renamed version of Copan's HA API. =A0There is no=0D=0A+ =A0= substance to it, but it remains in CTL to show what needs to be done to=0D= =0A+ =A0 implement active/active HA from a CTL standpoint. =A0The things = that would=0D=0A+ =A0 need to be done include:=0D=0A+- A kernel level sof= tware API for message passing as well as DMA=0D=0A+ =A0between at least t= wo nodes.=0D=0A+- Hardware support and drivers for inter-node communicati= on. =A0This=0D=0A+ =A0could be as simples as ethernet hardware and driver= s.=0D=0A+- A "supervisor", or startup framework to control and coordinate= =0D=0A+ =A0HA startup, failover (going from active/active to single mode)= ,=0D=0A+ =A0and failback (going from single mode to active/active).=0D=0A= +- HA support in other components of the stack. =A0The goal behind HA=0D=0A= + =A0is that one node can fail and another node can seamlessly take=0D=0A= + =A0over handling I/O requests. =A0This requires support from pretty=0D=0A= + =A0much every component in the storage stack, from top to bottom.=0D=0A= + =A0CTL is one piece of it, but you also need support in the RAID=0D=0A+= =A0stack/filesystem/backing store. =A0You also need full configuration=0D= =0A+ =A0mirroring, and all peer nodes need to be able to talk to the=0D=0A= + =A0underlying storage hardware.=0D=0A+=0D=0A+Code Roadmap:=0D=0A+=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D=0A+=0D=0A+CTL has the concept of plugga= ble frontend ports and backends. =A0All=0D=0A+frontends and backends can = be active at the same time. =A0You can have a=0D=0A+ramdisk-backed LUN pr= esent along side a file backed LUN.=0D=0A+=0D=0A+ctl.c:=0D=0A+-----=0D=0A= +=0D=0A+This is the core of CTL, where all of the command handlers and a = lot of=0D=0A+other things live. =A0Yes, it is large. =A0It started off sm= all and grew to its=0D=0A+current size over time. =A0Perhaps it can be sp= lit into more files at some=0D=0A+point.=0D=0A+=0D=0A+Here is a roadmap o= f some of the primary functions in ctl.c. =A0Starting here=0D=0A+and foll= owing the various leaf functions will show the command flow.=0D=0A+=0D=0A= +ctl_queue() This is where commands from the frontend ports come=0D=0A+in= =2E=0D=0A+=0D=0A+ctl_queue_sense()This is only used for non-packetized SC= SI. =A0i.e.=0D=0A+parallel SCSI prior to U320 and perhaps U160.=0D=0A+=0D= =0A+ctl_work_thread() This is the primary work thread, and everything get= s=0D=0A+executed from there.=0D=0A+=0D=0A+ctl_scsiio_precheck() This wher= e all of the initial checks are done, and I/O=0D=0A+is either queued for = execution or blocked.=0D=0A+=0D=0A+ctl_scsiio() This is where the command= handler is actually=0D=0A+executed. =A0(See ctl_cmd_table.c for the mapp= ing of=0D=0A+SCSI opcode to command handler function.)=0D=0A+=0D=0A+ctl_d= one()This is the routine called (or ctl_done_lock()) to=0D=0A+initiate th= e command completion process.=0D=0A+=0D=0A+ctl_process_done()This is wher= e command completion actually happens.=0D=0A+=0D=0A+ctl.h:=0D=0A+-----=0D= =0A+=0D=0A+Basic function declarations and data structures.=0D=0A+=0D=0A+= ctl_backend.c,=0D=0A+ctl_backend.h:=0D=0A+-------------=0D=0A+=0D=0A+Thes= e files define the basic CTL backend API. =A0The comments in the header=0D= =0A+explain the API.=0D=0A+=0D=0A+ctl_backend_block.c=0D=0A+ctl_backend_b= lock.h:=0D=0A+-------------------=0D=0A+=0D=0A+The block and file backend= =2E =A0This allows for using a disk or a file as the=0D=0A+backing store = for a LUN. =A0Multiple threads are started to do I/O to the=0D=0A+backing= device, primarily because the VFS API requires that to get any=0D=0A+con= currency.=0D=0A+=0D=0A+ctl_backend_ramdisk.c:=0D=0A+---------------------= =0D=0A+=0D=0A+A "fake" ramdisk backend. =A0It only allocates a small amou= nt of memory to=0D=0A+act as a source and sink for reads and writes from = an initiator. =A0Therefore=0D=0A+it cannot be used for any real data, but= it can be used to test for=0D=0A+throughput. =A0It can also be used to t= est initiators' support for extremely=0D=0A+large LUNs.=0D=0A+=0D=0A+ctl_= cmd_table.c:=0D=0A+---------------=0D=0A+=0D=0A+This is a table with all = 256 possible SCSI opcodes, and command handler=0D=0A+functions defined fo= r supported opcodes. =A0It is included in ctl.c.=0D=0A+=0D=0A+ctl_debug.h= :=0D=0A+-----------=0D=0A+=0D=0A+Simplistic debugging support.=0D=0A+=0D=0A= +ctl_error.c,=0D=0A+ctl_error.h:=0D=0A+-----------=0D=0A+=0D=0A+CTL-speci= fic wrappers around the CAM sense building functions.=0D=0A+=0D=0A+ctl_fr= ontend.c,=0D=0A+ctl_frontend.h:=0D=0A+--------------=0D=0A+=0D=0A+These f= iles define the basic CTL frontend port API. =A0The comments in the=0D=0A= +header explain the API.=0D=0A+=0D=0A+ctl_frontend_cam_sim.c:=0D=0A+-----= -----------------=0D=0A+=0D=0A+This is a CTL frontend port that is also a= CAM SIM. =A0The idea is that this=0D=0A+frontend allows for using CTL wi= thout any target-capable hardware. =A0So any=0D=0A+LUNs you create in CTL= are visible via this port.=0D=0A+=0D=0A+=0D=0A+ctl_frontend_internal.c=0D= =0A+ctl_frontend_internal.h:=0D=0A+-----------------------=0D=0A+=0D=0A+T= his is a frontend port written for Copan to do some system-specific tasks= =0D=0A+that required sending commands into CTL from inside the kernel. =A0= This isn't=0D=0A+entirely relevant to FreeBSD in general, but can perhaps= be repurposed or=0D=0A+removed later.=0D=0A+=0D=0A+ctl_ha.h:=0D=0A+-----= ---=0D=0A+=0D=0A+This is a stubbed-out High Availability API. =A0See the = comments in the=0D=0A+header and the description of what is needed as far= as HA support above.=0D=0A+=0D=0A+ctl_io.h:=0D=0A+--------=0D=0A+=0D=0A+= This defines most of the core CTL I/O structures. =A0union ctl_io is=0D=0A= +conceptually very similar to CAM's union ccb. =A0=0D=0A+=0D=0A+ctl_ioctl= =2Eh:=0D=0A+-----------=0D=0A+=0D=0A+This defines all ioctls available th= rough the CTL character device, and=0D=0A+the data structures needed for = those ioctls.=0D=0A+=0D=0A+ctl_mem_pool.c=0D=0A+ctl_mem_pool.h:=0D=0A+---= -----------=0D=0A+=0D=0A+Generic memory pool implementation. =A0This is c= urrently only used by the=0D=0A+internal frontend. =A0The internal fronte= nd can probably be rewritten to use=0D=0A+UMA zones and this can be remov= ed.=0D=0A+=0D=0A+ctl_private.h:=0D=0A+-------------=0D=0A+=0D=0A+Private = data structres (e.g. CTL softc) and function prototypes. =A0This also=0D=0A= +includes the SCSI vendor and product names used by CTL.=0D=0A+=0D=0A+ctl= _scsi_all.c=0D=0A+ctl_scsi_all.h:=0D=0A+--------------=0D=0A+=0D=0A+CTL w= rappers around CAM sense printing functions.=0D=0A+=0D=0A+ctl_ser_table.c= :=0D=0A+---------------=0D=0A+=0D=0A+Command serialization table. =A0This= defines what happens when one type of=0D=0A+command is followed by anoth= er type of command. =A0e.g., what do you do when=0D=0A+you have a mode se= lect followed by a write=3F =A0You block the write until the=0D=0A+mode s= elect is complete. =A0That is defined in this table.=0D=0A+=0D=0A+ctl_uti= l.c=0D=0A+ctl_util.h:=0D=0A+----------=0D=0A+=0D=0A+CTL utility functions= , primarily designed to be used from userland. =A0See=0D=0A+ctladm for th= e primary consumer of these functions. =A0These include CDB=0D=0A+buildin= g functions.=0D=0A+=0D=0A+scsi_ctl.c:=0D=0A+----------=0D=0A+=0D=0A+CAM t= arget peripheral driver and CTL frontend port. =A0This is the path into=0D= =0A+CTL for commands from target-capable hardware/SIMs.=0D=0A+=0D=0A+User= land Commands:=0D=0A+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D= =0A+=0D=0A+ctladm(8) fills a role similar to camcontrol(8). =A0It allow c= onfiguring LUNs,=0D=0A+issuing commands, injecting errors and various oth= er control functions.=0D=0A+=0D=0A+ctlstat(8) fills a role similar to ios= tat(8). =A0It reports I/O statistics=0D=0A+for CTL.=0D=0A=0D=0AAdded: hea= d/sys/cam/ctl/ctl.c=0D=0A=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0D=0A--- /dev/null00:00:00 1970(empt= y, because file is newly added)=0D=0A+++ head/sys/cam/ctl/ctl.cThu Jan 12= 00:34:33 2012(r229997)=0D=0A@@ -0,0 +1,13082 @@=0D=0A+/*-=0D=0A+ * Copyr= ight (c) 2003-2009 Silicon Graphics International Corp.=0D=0A+ * All righ= ts reserved.=0D=0A+ *=0D=0A+ * Redistribution and use in source and binar= y forms, with or without=0D=0A+ * modification, are permitted provided th= at the following conditions=0D=0A+ * are met:=0D=0A+ * 1. Redistributions= of source code must retain the above copyright=0D=0A+ * =A0 =A0notice, t= his list of conditions, and the following disclaimer,=0D=0A+ * =A0 =A0wit= hout modification.=0D=0A+ * 2. Redistributions in binary form must reprod= uce at minimum a disclaimer=0D=0A+ * =A0 =A0substantially similar to the = "NO WARRANTY" disclaimer below=0D=0A+ * =A0 =A0("Disclaimer") and any red= istribution must be conditioned upon=0D=0A+ * =A0 =A0including a substant= ially similar Disclaimer requirement for further=0D=0A+ * =A0 =A0binary r= edistribution.=0D=0A+ *=0D=0A+ * NO WARRANTY=0D=0A+ * THIS SOFTWARE IS PR= OVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS=0D=0A+ * "AS IS" AND ANY= EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT=0D=0A+ * LIMITED TO, T= HE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR=0D=0A+ * A PARTI= CULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT=0D=0A+ * HO= LDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL=0D= =0A+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE = GOODS=0D=0A+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS IN= TERRUPTION)=0D=0A+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETH= ER IN CONTRACT,=0D=0A+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE = OR OTHERWISE) ARISING=0D=0A+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE= , EVEN IF ADVISED OF THE=0D=0A+ * POSSIBILITY OF SUCH DAMAGES.=0D=0A+ *=0D= =0A+ * $Id: //depot/users/kenm/FreeBSD-test2/sys/cam/ctl/ctl.c#8 $=0D=0A+= */=0D=0A+/*=0D=0A+ * CAM Target Layer, a SCSI device emulation subsystem= =2E=0D=0A+ *=0D=0A+ * Author: Ken Merry =0D=0A+ */=0D=0A= +=0D=0A+#define _CTL_C=0D=0A+=0D=0A+#include =0D=0A+__FBSDID= ("$FreeBSD$");=0D=0A+=0D=0A+#include =0D=0A+#include =0D=0A+#include =0D=0A+#include =0D=0A+#= include =0D=0A+#include =0D=0A+#include =0D=0A+#include =0D=0A+#include =0D=0A+#in= clude =0D=0A+#include =0D=0A+#include =0D=0A+#include =0D=0A+#include =0D=0A+#= include =0D=0A+#include =0D=0A+#include =0D=0A+=0D=0A+#include =0D=0A+#include =0D=0A+#include =0D=0A+#include =0D=0A+#include =0D=0A+#include = =0D=0A+#include =0D=0A+#include =0D=0A+#include =0D=0A+#include =0D=0A+#include =0D=0A+#include =0D=0A+#include =0D=0A+#include =0D=0A+#include =0D=0A+=0D=0A+str= uct ctl_softc *control_softc =3D NULL;=0D=0A+=0D=0A+/*=0D=0A+ * The defau= lt is to run with CTL_DONE_THREAD turned on. =A0Completed=0D=0A+ * transa= ctions are queued for processing by the CTL work thread. =A0When=0D=0A+ *= CTL_DONE_THREAD is not defined, completed transactions are processed in=0D= =0A+ * the caller's context.=0D=0A+ */=0D=0A+#define CTL_DONE_THREAD=0D=0A= +=0D=0A+/*=0D=0A+ * =A0* Use the serial number and device ID provided by = the backend, rather than=0D=0A+ * =A0 * making up our own.=0D=0A+ * =A0 =A0= */=0D=0A+#define CTL_USE_BACKEND_SN=0D=0A+=0D=0A+/*=0D=0A+ * Size and ali= gnment macros needed for Copan-specific HA hardware. =A0These=0D=0A+ * ca= n go away when the HA code is re-written, and uses busdma for any=0D=0A+ = * hardware.=0D=0A+ */=0D=0A+#defineCTL_ALIGN_8B(target, source, type)\=0D= =0A+if (((uint32_t)source & 0x7) !=3D 0)\=0D=0A+target =3D (type)(source = + (0x8 - ((uint32_t)source & 0x7)));\=0D=0A+else\=0D=0A+target =3D (type)= source;=0D=0A+=0D=0A+#defineCTL_SIZE_8B(target, size)\=0D=0A+if ((size & = 0x7) !=3D 0)\=0D=0A+target =3D size + (0x8 - (size & 0x7));\=0D=0A+else\=0D= =0A+target =3D size;=0D=0A+=0D=0A+#define CTL_ALIGN_8B_MARGIN16=0D=0A+=0D= =0A+/*=0D=0A+ * Template mode pages.=0D=0A+ */=0D=0A+=0D=0A+/*=0D=0A+ * N= ote that these are default values only. =A0The actual values will be=0D=0A= + * filled in when the user does a mode sense.=0D=0A+ */=0D=0A+static str= uct copan_power_subpage power_page_default =3D {=0D=0A+/*page_code*/ PWR_= PAGE_CODE | SMPH_SPF,=0D=0A+/*subpage*/ PWR_SUBPAGE_CODE,=0D=0A+/*page_le= ngth*/ {(sizeof(struct copan_power_subpage) - 4) & 0xff00,=0D=0A+ (sizeof= (struct copan_power_subpage) - 4) & 0x00ff},=0D=0A+/*page_version*/ PWR_V= ERSION,=0D=0A+/* total_luns */ 26,=0D=0A+/* max_active_luns*/ PWR_DFLT_MA= X_LUNS,=0D=0A+/*reserved*/ {0, 0, 0, 0, 0, 0, 0, 0, 0,=0D=0A+ =A0 =A0 =A0= 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,=0D=0A+ =A0 =A0 =A00, 0, 0, 0, 0, 0}=0D=0A+}= ;=0D=0A+=0D=0A+static struct copan_power_subpage power_page_changeable =3D= {=0D=0A+/*page_code*/ PWR_PAGE_CODE | SMPH_SPF,=0D=0A+/*subpage*/ PWR_SU= BPAGE_CODE,=0D=0A+/*page_length*/ {(sizeof(struct copan_power_subpage) - = 4) & 0xff00,=0D=0A+ (sizeof(struct copan_power_subpage) - 4) & 0x00ff},=0D= =0A+/*page_version*/ 0,=0D=0A+/* total_luns */ 0,=0D=0A+/* max_active_lun= s*/ 0,=0D=0A+/*reserved*/ {0, 0, 0, 0, 0, 0, 0, 0, 0,=0D=0A+ =A0 =A0 =A00= , 0, 0, 0, 0, 0, 0, 0, 0, 0,=0D=0A+ =A0 =A0 =A00, 0, 0, 0, 0, 0}=0D=0A+};= =0D=0A+=0D=0A+static struct copan_aps_subpage aps_page_default =3D {=0D=0A= +APS_PAGE_CODE | SMPH_SPF, //page_code=0D=0A+APS_SUBPAGE_CODE, //subpage=0D= =0A+{(sizeof(struct copan_aps_subpage) - 4) & 0xff00,=0D=0A+ (sizeof(stru= ct copan_aps_subpage) - 4) & 0x00ff}, //page_length=0D=0A+APS_VERSION, //= page_version=0D=0A+0, //lock_active=0D=0A+{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, = 0,=0D=0A+0, 0, 0, 0, 0, 0, 0, 0, 0, 0,=0D=0A+0, 0, 0, 0, 0} //reserved=0D= =0A+};=0D=0A+=0D=0A+static struct copan_aps_subpage aps_page_changeable =3D= {=0D=0A+APS_PAGE_CODE | SMPH_SPF, //page_code=0D=0A+APS_SUBPAGE_CODE, //= subpage=0D=0A+{(sizeof(struct copan_aps_subpage) - 4) & 0xff00,=0D=0A+ (s= izeof(struct copan_aps_subpage) - 4) & 0x00ff}, //page_length=0D=0A+0, //= page_version=0D=0A+0, //lock_active=0D=0A+{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, = 0,=0D=0A+0, 0, 0, 0, 0, 0, 0, 0, 0, 0,=0D=0A+0, 0, 0, 0, 0} //reserved=0D= =0A+};=0D=0A+=0D=0A+static struct copan_debugconf_subpage debugconf_page_= default =3D {=0D=0A+DBGCNF_PAGE_CODE | SMPH_SPF,/* page_code */=0D=0A+DBG= CNF_SUBPAGE_CODE,/* subpage */=0D=0A+{(sizeof(struct copan_debugconf_subp= age) - 4) >> 8,=0D=0A+ (sizeof(struct copan_debugconf_subpage) - 4) >> 0}= , /* page_length */=0D=0A+DBGCNF_VERSION,/* page_version */=0D=0A+{CTL_TI= ME_IO_DEFAULT_SECS>>8,=0D=0A+ CTL_TIME_IO_DEFAULT_SECS>>0},/* ctl_time_io= _secs */=0D=0A+};=0D=0A+=0D=0A+static struct copan_debugconf_subpage debu= gconf_page_changeable =3D {=0D=0A+DBGCNF_PAGE_CODE | SMPH_SPF,/* page_cod= e */=0D=0A+DBGCNF_SUBPAGE_CODE,/* subpage */=0D=0A+{(sizeof(struct copan_= debugconf_subpage) - 4) >> 8,=0D=0A+ (sizeof(struct copan_debugconf_subpa= ge) - 4) >> 0}, /* page_length */=0D=0A+0,/* page_version */=0D=0A+{0xff,= 0xff},/* ctl_time_io_secs */=0D=0A+};=0D=0A+=0D=0A+static struct scsi_for= mat_page format_page_default =3D {=0D=0A+/*page_code*/SMS_FORMAT_DEVICE_P= AGE,=0D=0A+/*page_length*/sizeof(struct scsi_format_page) - 2,=0D=0A+/*tr= acks_per_zone*/ {0, 0},=0D=0A+/*alt_sectors_per_zone*/ {0, 0},=0D=0A+/*al= t_tracks_per_zone*/ {0, 0},=0D=0A+/*alt_tracks_per_lun*/ {0, 0},=0D=0A+/*= sectors_per_track*/ {(CTL_DEFAULT_SECTORS_PER_TRACK >> 8) & 0xff,=0D=0A+ = =A0 =A0 =A0 =A0CTL_DEFAULT_SECTORS_PER_TRACK & 0xff},=0D=0A+/*bytes_per_s= ector*/ {0, 0},=0D=0A+/*interleave*/ {0, 0},=0D=0A+/*track_skew*/ {0, 0},= =0D=0A+/*cylinder_skew*/ {0, 0},=0D=0A+/*flags*/ SFP_HSEC,=0D=0A+/*reserv= ed*/ {0, 0, 0}=0D=0A+};=0D=0A+=0D=0A+static struct scsi_format_page forma= t_page_changeable =3D {=0D=0A+/*page_code*/SMS_FORMAT_DEVICE_PAGE,=0D=0A+= /*page_length*/sizeof(struct scsi_format_page) - 2,=0D=0A+/*tracks_per_zo= ne*/ {0, 0},=0D=0A+/*alt_sectors_per_zone*/ {0, 0},=0D=0A+/*alt_tracks_pe= r_zone*/ {0, 0},=0D=0A+/*alt_tracks_per_lun*/ {0, 0},=0D=0A+/*sectors_per= _track*/ {0, 0},=0D=0A+/*bytes_per_sector*/ {0, 0},=0D=0A+/*interleave*/ = {0, 0},=0D=0A+/*track_skew*/ {0, 0},=0D=0A+/*cylinder_skew*/ {0, 0},=0D=0A= +/*flags*/ 0,=0D=0A+/*reserved*/ {0, 0, 0}=0D=0A+};=0D=0A+=0D=0A+static s= truct scsi_rigid_disk_page rigid_disk_page_default =3D {=0D=0A+/*page_cod= e*/SMS_RIGID_DISK_PAGE,=0D=0A+/*page_length*/sizeof(struct scsi_rigid_dis= k_page) - 2,=0D=0A+/*cylinders*/ {0, 0, 0},=0D=0A+/*heads*/ CTL_DEFAULT_H= EADS,=0D=0A+/*start_write_precomp*/ {0, 0, 0},=0D=0A+/*start_reduced_curr= ent*/ {0, 0, 0},=0D=0A+/*step_rate*/ {0, 0},=0D=0A+/*landing_zone_cylinde= r*/ {0, 0, 0},=0D=0A+/*rpl*/ SRDP_RPL_DISABLED,=0D=0A+/*rotational_offset= */ 0,=0D=0A+/*reserved1*/ 0,=0D=0A+/*rotation_rate*/ {(CTL_DEFAULT_ROTATI= ON_RATE >> 8) & 0xff,=0D=0A+ =A0 CTL_DEFAULT_ROTATION_RATE & 0xff},=0D=0A= +/*reserved2*/ {0, 0}=0D=0A+};=0D=0A+=0D=0A+static struct scsi_rigid_disk= _page rigid_disk_page_changeable =3D {=0D=0A+/*page_code*/SMS_RIGID_DISK_= PAGE,=0D=0A+/*page_length*/sizeof(struct scsi_rigid_disk_page) - 2,=0D=0A= +/*cylinders*/ {0, 0, 0},=0D=0A+/*heads*/ 0,=0D=0A+/*start_write_precomp*= / {0, 0, 0},=0D=0A+/*start_reduced_current*/ {0, 0, 0},=0D=0A+/*step_rate= */ {0, 0},=0D=0A+/*landing_zone_cylinder*/ {0, 0, 0},=0D=0A+/*rpl*/ 0,=0D= =0A+/*rotational_offset*/ 0,=0D=0A+/*reserved1*/ 0,=0D=0A+/*rotation_rate= */ {0, 0},=0D=0A+/*reserved2*/ {0, 0}=0D=0A+};=0D=0A+=0D=0A+static struct= scsi_caching_page caching_page_default =3D {=0D=0A+/*page_code*/SMS_CACH= ING_PAGE,=0D=0A+/*page_length*/sizeof(struct scsi_caching_page) - 2,=0D=0A= +/*flags1*/ SCP_DISC | SCP_WCE,=0D=0A+/*ret_priority*/ 0,=0D=0A+/*disable= _pf_transfer_len*/ {0xff, 0xff},=0D=0A+/*min_prefetch*/ {0, 0},=0D=0A+/*m= ax_prefetch*/ {0xff, 0xff},=0D=0A+/*max_pf_ceiling*/ {0xff, 0xff},=0D=0A+= /*flags2*/ 0,=0D=0A+/*cache_segments*/ 0,=0D=0A+/*cache_seg_size*/ {0, 0}= ,=0D=0A+/*reserved*/ 0,=0D=0A+/*non_cache_seg_size*/ {0, 0, 0}=0D=0A+};=0D= =0A+=0D=0A+static struct scsi_caching_page caching_page_changeable =3D {=0D= =0A+/*page_code*/SMS_CACHING_PAGE,=0D=0A+/*page_length*/sizeof(struct scs= i_caching_page) - 2,=0D=0A+/*flags1*/ 0,=0D=0A+/*ret_priority*/ 0,=0D=0A+= /*disable_pf_transfer_len*/ {0, 0},=0D=0A+/*min_prefetch*/ {0, 0},=0D=0A+= /*max_prefetch*/ {0, 0},=0D=0A+/*max_pf_ceiling*/ {0, 0},=0D=0A+/*flags2*= / 0,=0D=0A+/*cache_segments*/ 0,=0D=0A+/*cache_seg_size*/ {0, 0},=0D=0A+/= *reserved*/ 0,=0D=0A+/*non_cache_seg_size*/ {0, 0, 0}=0D=0A+};=0D=0A+=0D=0A= +static struct scsi_control_page control_page_default =3D {=0D=0A+/*page_= code*/SMS_CONTROL_MODE_PAGE,=0D=0A+/*page_length*/sizeof(struct scsi_cont= rol_page) - 2,=0D=0A+/*rlec*/0,=0D=0A+/*queue_flags*/0,=0D=0A+/*eca_and_a= en*/0,=0D=0A+/*reserved*/0,=0D=0A+/*aen_holdoff_period*/{0, 0}=0D=0A+};=0D= =0A+=0D=0A+static struct scsi_control_page control_page_changeable =3D {=0D= =0A+/*page_code*/SMS_CONTROL_MODE_PAGE,=0D=0A+/*page_length*/sizeof(struc= t scsi_control_page) - 2,=0D=0A+/*rlec*/SCP_DSENSE,=0D=0A+/*queue_flags*/= 0,=0D=0A+/*eca_and_aen*/0,=0D=0A+/*reserved*/0,=0D=0A+/*aen_holdoff_perio= d*/{0, 0}=0D=0A+};=0D=0A+=0D=0A+SYSCTL_NODE(_kern_cam, OID_AUTO, ctl, CTL= FLAG_RD, 0, "CAM Target Layer");=0D=0A+=0D=0A+/*=0D=0A+ * XXX KDM move th= ese into the softc.=0D=0A+ */=0D=0A+static int rcv_sync_msg;=0D=0A+static= int persis_offset;=0D=0A+static uint8_t ctl_pause_rtr;=0D=0A+static int = =A0 =A0 ctl_is_single;=0D=0A+static int =A0 =A0 index_to_aps_page;=0D=0A+= =0D=0A+=0D=0A+/*=0D=0A+ * Serial number (0x80), device id (0x83), and sup= ported pages (0x00)=0D=0A+ */=0D=0A+#define SCSI_EVPD_NUM_SUPPORTED_PAGES= 3=0D=0A+=0D=0A+static void ctl_isc_event_handler(ctl_ha_channel chanel, c= tl_ha_event event,=0D=0A+ =A0int param);=0D=0A+static void ctl_copy_sense= _data(union ctl_ha_msg *src, union ctl_io *dest);=0D=0A+static void ctl_i= nit(void);=0D=0A+void ctl_shutdown(void);=0D=0A+static int ctl_open(struc= t cdev *dev, int flags, int fmt, struct thread *td);=0D=0A+static int ctl= _close(struct cdev *dev, int flags, int fmt, struct thread *td);=0D=0A+st= atic void ctl_ioctl_online(void *arg);=0D=0A+static void ctl_ioctl_offlin= e(void *arg);=0D=0A+static int ctl_ioctl_targ_enable(void *arg, struct ct= l_id targ_id);=0D=0A+static int ctl_ioctl_targ_disable(void *arg, struct = ctl_id targ_id);=0D=0A+static int ctl_ioctl_lun_enable(void *arg, struct = ctl_id targ_id, int lun_id);=0D=0A+static int ctl_ioctl_lun_disable(void = *arg, struct ctl_id targ_id, int lun_id);=0D=0A+static int ctl_ioctl_do_d= atamove(struct ctl_scsiio *ctsio);=0D=0A+static int ctl_serialize_other_s= c_cmd(struct ctl_scsiio *ctsio, int have_lock);=0D=0A+static int ctl_ioct= l_submit_wait(union ctl_io *io);=0D=0A+static void ctl_ioctl_datamove(uni= on ctl_io *io);=0D=0A+static void ctl_ioctl_done(union ctl_io *io);=0D=0A= +static void ctl_ioctl_hard_startstop_callback(void *arg,=0D=0A+ =A0 =A0 = =A0struct cfi_metatask *metatask);=0D=0A+static void ctl_ioctl_bbrread_ca= llback(void *arg,struct cfi_metatask *metatask);=0D=0A+static int ctl_ioc= tl_fill_ooa(struct ctl_lun *lun, uint32_t *cur_fill_num,=0D=0A+ =A0 =A0 =A0= struct ctl_ooa *ooa_hdr);=0D=0A+static int ctl_ioctl(struct cdev *dev, u_= long cmd, caddr_t addr, int flag,=0D=0A+ =A0 =A0 struct thread *td);=0D=0A= +uint32_t ctl_get_resindex(struct ctl_nexus *nexus);=0D=0A+uint32_t ctl_p= ort_idx(int port_num);=0D=0A+#ifdef unused=0D=0A+static union ctl_io *ctl= _malloc_io(ctl_io_type io_type, uint32_t targ_port,=0D=0A+ =A0 uint32_t t= arg_target, uint32_t targ_lun,=0D=0A+ =A0 int can_wait);=0D=0A+static voi= d ctl_kfree_io(union ctl_io *io);=0D=0A+#endif /* unused */=0D=0A+static = void ctl_free_io_internal(union ctl_io *io, int have_lock);=0D=0A+static = int ctl_alloc_lun(struct ctl_softc *ctl_softc, struct ctl_lun *lun,=0D=0A= + struct ctl_be_lun *be_lun, struct ctl_id target_id);=0D=0A+static int c= tl_free_lun(struct ctl_lun *lun);=0D=0A+static void ctl_create_lun(struct= ctl_be_lun *be_lun);=0D=0A+/**=0D=0A+static void ctl_failover_change_pag= es(struct ctl_softc *softc,=0D=0A+ =A0 =A0 =A0struct ctl_scsiio *ctsio, i= nt master);=0D=0A+**/=0D=0A+=0D=0A+static int ctl_do_mode_select(union ct= l_io *io);=0D=0A+static int ctl_pro_preempt(struct ctl_softc *softc, stru= ct ctl_lun *lun,=0D=0A+ =A0 uint64_t res_key, uint64_t sa_res_key,=0D=0A+= =A0 uint8_t type, uint32_t residx,=0D=0A+ =A0 struct ctl_scsiio *ctsio,=0D= =0A+ =A0 struct scsi_per_res_out *cdb,=0D=0A+ =A0 struct scsi_per_res_out= _parms* param);=0D=0A+static void ctl_pro_preempt_other(struct ctl_lun *l= un,=0D=0A+ =A0union ctl_ha_msg *msg);=0D=0A+static void ctl_hndl_per_res_= out_on_other_sc(union ctl_ha_msg *msg);=0D=0A+static int ctl_inquiry_evpd= _supported(struct ctl_scsiio *ctsio, int alloc_len);=0D=0A+static int ctl= _inquiry_evpd_serial(struct ctl_scsiio *ctsio, int alloc_len);=0D=0A+stat= ic int ctl_inquiry_evpd_devid(struct ctl_scsiio *ctsio, int alloc_len);=0D= =0A+static int ctl_inquiry_evpd(struct ctl_scsiio *ctsio);=0D=0A+static i= nt ctl_inquiry_std(struct ctl_scsiio *ctsio);=0D=0A+static int ctl_get_lb= a_len(union ctl_io *io, uint64_t *lba, uint32_t *len);=0D=0A+static ctl_a= ction ctl_extent_check(union ctl_io *io1, union ctl_io *io2);=0D=0A+stati= c ctl_action ctl_check_for_blockage(union ctl_io *pending_io,=0D=0A+ unio= n ctl_io *ooa_io);=0D=0A+static ctl_action ctl_check_ooa(struct ctl_lun *= lun, union ctl_io *pending_io,=0D=0A+union ctl_io *starting_io);=0D=0A+st= atic int ctl_check_blocked(struct ctl_lun *lun);=0D=0A+static int ctl_scs= iio_lun_check(struct ctl_softc *ctl_softc,=0D=0A+struct ctl_lun *lun,=0D=0A= +struct ctl_cmd_entry *entry,=0D=0A+struct ctl_scsiio *ctsio);=0D=0A+//st= atic int ctl_check_rtr(union ctl_io *pending_io, struct ctl_softc *softc)= ;=0D=0A+static void ctl_failover(void);=0D=0A+static int ctl_scsiio_prech= eck(struct ctl_softc *ctl_softc,=0D=0A+ =A0 =A0 =A0 struct ctl_scsiio *ct= sio);=0D=0A+static int ctl_scsiio(struct ctl_scsiio *ctsio);=0D=0A+=0D=0A= +static int ctl_bus_reset(struct ctl_softc *ctl_softc, union ctl_io *io);= =0D=0A+static int ctl_target_reset(struct ctl_softc *ctl_softc, union ctl= _io *io,=0D=0A+ =A0 =A0ctl_ua_type ua_type);=0D=0A+static int ctl_lun_res= et(struct ctl_lun *lun, union ctl_io *io,=0D=0A+ ctl_ua_type ua_type);=0D= =0A+static int ctl_abort_task(union ctl_io *io);=0D=0A+static void ctl_ru= n_task_queue(struct ctl_softc *ctl_softc);=0D=0A+#ifdef CTL_IO_DELAY=0D=0A= +static void ctl_datamove_timer_wakeup(void *arg);=0D=0A+static void ctl_= done_timer_wakeup(void *arg);=0D=0A+#endif /* CTL_IO_DELAY */=0D=0A+=0D=0A= +static void ctl_send_datamove_done(union ctl_io *io, int have_lock);=0D=0A= +static void ctl_datamove_remote_write_cb(struct ctl_ha_dt_req *rq);=0D=0A= +static int ctl_datamove_remote_dm_write_cb(union ctl_io *io);=0D=0A+stat= ic void ctl_datamove_remote_write(union ctl_io *io);=0D=0A+static int ctl= _datamove_remote_dm_read_cb(union ctl_io *io);=0D=0A+static void ctl_data= move_remote_read_cb(struct ctl_ha_dt_req *rq);=0D=0A+static int ctl_datam= ove_remote_sgl_setup(union ctl_io *io);=0D=0A+static int ctl_datamove_rem= ote_xfer(union ctl_io *io, unsigned command,=0D=0A+ =A0 =A0ctl_ha_dt_cb c= allback);=0D=0A+static void ctl_datamove_remote_read(union ctl_io *io);=0D= =0A+static void ctl_datamove_remote(union ctl_io *io);=0D=0A+static int c= tl_process_done(union ctl_io *io, int have_lock);=0D=0A+static void ctl_w= ork_thread(void *arg);=0D=0A+=0D=0A+/*=0D=0A+ * Load the serialization ta= ble. =A0This isn't very pretty, but is probably=0D=0A+ * the easiest way = to do it.=0D=0A+ */=0D=0A+#include "ctl_ser_table.c"=0D=0A+=0D=0A+/*=0D=0A= + * We only need to define open, close and ioctl routines for this driver= =2E=0D=0A+ */=0D=0A+static struct cdevsw ctl_cdevsw =3D {=0D=0A+.d_versio= n =3DD_VERSION,=0D=0A+.d_flags =3D0,=0D=0A+.d_open =3Dctl_open,=0D=0A+.d_= close =3Dctl_close,=0D=0A+.d_ioctl =3Dctl_ioctl,=0D=0A+.d_name =3D"ctl",=0D= =0A+};=0D=0A+=0D=0A+=0D=0A+MALLOC_DEFINE(M_CTL, "ctlmem", "Memory used fo= r CTL");=0D=0A+=0D=0A+/*=0D=0A+ * If we have the CAM SIM, we may or may n= ot have another SIM that will=0D=0A+ * cause CTL to get initialized. =A0I= f not, we need to initialize it.=0D=0A+ */=0D=0A+SYSINIT(ctl_init, SI_SUB= _CONFIGURE, SI_ORDER_THIRD, ctl_init, NULL);=0D=0A+=0D=0A+static void=0D=0A= +ctl_isc_handler_finish_xfer(struct ctl_softc *ctl_softc,=0D=0A+ =A0 =A0u= nion ctl_ha_msg *msg_info)=0D=0A+{=0D=0A+struct ctl_scsiio *ctsio;=0D=0A+= =0D=0A+if (msg_info->hdr.original_sc =3D=3D NULL) {=0D=0A+printf("%s: ori= ginal_sc =3D=3D NULL!\n", __func__);=0D=0A+/* XXX KDM now what=3F */=0D=0A= +return;=0D=0A+}=0D=0A+=0D=0A+ctsio =3D &msg_info->hdr.original_sc->scsii= o;=0D=0A+ctsio->io_hdr.flags |=3D CTL_FLAG_IO_ACTIVE;=0D=0A+ctsio->io_hdr= =2Emsg_type =3D CTL_MSG_FINISH_IO;=0D=0A+ctsio->io_hdr.status =3D msg_inf= o->hdr.status;=0D=0A+ctsio->scsi_status =3D msg_info->scsi.scsi_status;=0D= =0A+ctsio->sense_len =3D msg_info->scsi.sense_len;=0D=0A+ctsio->sense_res= idual =3D msg_info->scsi.sense_residual;=0D=0A+ctsio->residual =3D msg_in= fo->scsi.residual;=0D=0A+memcpy(&ctsio->sense_data, &msg_info->scsi.sense= _data,=0D=0A+ =A0 =A0 =A0 sizeof(ctsio->sense_data));=0D=0A+memcpy(&ctsio= ->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes,=0D=0A+ =A0 =A0 =A0 &msg_inf= o->scsi.lbalen, sizeof(msg_info->scsi.lbalen));;=0D=0A+STAILQ_INSERT_TAIL= (&ctl_softc->isc_queue, &ctsio->io_hdr, links);=0D=0A+ctl_wakeup_thread()= ;=0D=0A+}=0D=0A+=0D=0A+static void=0D=0A+ctl_isc_handler_finish_ser_only(= struct ctl_softc *ctl_softc,=0D=0A+union ctl_ha_msg *msg_info)=0D=0A+{=0D= =0A+struct ctl_scsiio *ctsio;=0D=0A+=0D=0A+if (msg_info->hdr.serializing_= sc =3D=3D NULL) {=0D=0A+printf("%s: serializing_sc =3D=3D NULL!\n", __fun= c__);=0D=0A+/* XXX KDM now what=3F */=0D=0A+return;=0D=0A+}=0D=0A+=0D=0A+= ctsio =3D &msg_info->hdr.serializing_sc->scsiio;=0D=0A+#if 0=0D=0A+/*=0D=0A= + * Attempt to catch the situation where an I/O has=0D=0A+ * been freed, = and we're using it again.=0D=0A+ */=0D=0A+if (ctsio->io_hdr.io_type =3D=3D= 0xff) {=0D=0A+union ctl_io *tmp_io;=0D=0A+tmp_io =3D (union ctl_io *)cts= io;=0D=0A+printf("%s: %p use after free!\n", __func__,=0D=0A+ =A0 =A0 =A0= ctsio);=0D=0A+printf("%s: type %d msg %d cdb %x iptl: "=0D=0A+ =A0 =A0 =A0= "%d:%d:%d:%d tag 0x%04x "=0D=0A+ =A0 =A0 =A0 "flag %#x status %x\n",=0D=0A= +__func__,=0D=0A+tmp_io->io_hdr.io_type,=0D=0A+tmp_io->io_hdr.msg_type,=0D= =0A+tmp_io->scsiio.cdb[0],=0D=0A+tmp_io->io_hdr.nexus.initid.id,=0D=0A+tm= p_io->io_hdr.nexus.targ_port,=0D=0A+tmp_io->io_hdr.nexus.targ_target.id,=0D= =0A+tmp_io->io_hdr.nexus.targ_lun,=0D=0A+(tmp_io->io_hdr.io_type =3D=3D=0D= =0A+CTL_IO_TASK) =3F=0D=0A+tmp_io->taskio.tag_num :=0D=0A+tmp_io->scsiio.= tag_num,=0D=0A+ =A0 =A0 =A0 =A0tmp_io->io_hdr.flags,=0D=0A+tmp_io->io_hdr= =2Estatus);=0D=0A+}=0D=0A+#endif=0D=0A+ctsio->io_hdr.msg_type =3D CTL_MSG= _FINISH_IO;=0D=0A=0D=0A*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***=0D=0A From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 10:04:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 365F11065670; Thu, 12 Jan 2012 10:04:51 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au [211.29.132.183]) by mx1.freebsd.org (Postfix) with ESMTP id B26E38FC1B; Thu, 12 Jan 2012 10:04:50 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0C9rUAq009034 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 12 Jan 2012 20:54:02 +1100 Date: Thu, 12 Jan 2012 20:53:30 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Guy Helmer In-Reply-To: <201201112245.q0BMjFYr080049@svn.freebsd.org> Message-ID: <20120112205016.X1000@besplex.bde.org> References: <201201112245.q0BMjFYr080049@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: r229988 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 10:04:51 -0000 On Wed, 11 Jan 2012, Guy Helmer wrote: > Log: > Fix prototype formatting (indentation, long lines, and continued lines). > > Requested by bde. Thanks. This looks good. Here are a few more fixes (mostly prototype :ormatting, 2 lines struct member formatting and 1 and 1 missing underscore). % Index: libutil.h % =================================================================== % RCS file: /home/ncvs/src/lib/libutil/libutil.h,v % retrieving revision 1.64 % diff -u -r1.64 libutil.h % --- libutil.h 11 Jan 2012 22:45:15 -0000 1.64 % +++ libutil.h 12 Jan 2012 09:49:29 -0000 % @@ -69,8 +69,8 @@ % /* for properties.c */ % typedef struct _property { % struct _property *next; % - char *name; % - char *value; % + char *name; % + char *value; % } *properties; % % #ifdef _SYS_PARAM_H_ % @@ -121,7 +121,7 @@ % void properties_free(properties _list); % char *property_find(properties _list, const char *_name); % properties % - properties_read(int fd); % + properties_read(int _fd); % int realhostname(char *_host, size_t _hsize, const struct in_addr *_ip); % int realhostname_sa(char *_host, size_t _hsize, struct sockaddr *_addr, % int _addrlen); % @@ -139,8 +139,10 @@ % #endif % % #ifdef _PWD_H_ % -int pw_copy(int _ffd, int _tfd, const struct passwd *_pw, struct passwd *_old_pw); % -struct passwd *pw_dup(const struct passwd *_pw); % +int pw_copy(int _ffd, int _tfd, const struct passwd *_pw, % + struct passwd *_old_pw); % +struct passwd % + *pw_dup(const struct passwd *_pw); % int pw_edit(int _notsetuid); % int pw_equal(const struct passwd *_pw1, const struct passwd *_pw2); % void pw_fini(void); % @@ -149,21 +151,26 @@ % char *pw_make_v7(const struct passwd *_pw); % int pw_mkdb(const char *_user); % int pw_lock(void); % -struct passwd *pw_scan(const char *_line, int _flags); % -const char *pw_tempname(void); % +struct passwd % + *pw_scan(const char *_line, int _flags); % +const char % + *pw_tempname(void); % int pw_tmp(int _mfd); % #endif % % #ifdef _GRP_H_ % -int gr_copy(int __ffd, int _tfd, const struct group *_gr, struct group *_old_gr); % -struct group *gr_dup(const struct group *_gr); % +int gr_copy(int __ffd, int _tfd, const struct group *_gr, % + struct group *_old_gr); % +struct group % + *gr_dup(const struct group *_gr); % int gr_equal(const struct group *_gr1, const struct group *_gr2); % void gr_fini(void); % int gr_init(const char *_dir, const char *_master); % int gr_lock(void); % char *gr_make(const struct group *_gr); % int gr_mkdb(void); % -struct group *gr_scan(const char *_line); % +struct group % + *gr_scan(const char *_line); % int gr_tmp(int _mdf); % #endif % Bruce From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 11:08:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DFCC1065691; Thu, 12 Jan 2012 11:08:22 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD4528FC1E; Thu, 12 Jan 2012 11:08: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 q0CB8LR2007038; Thu, 12 Jan 2012 11:08:21 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0CB8LLn007035; Thu, 12 Jan 2012 11:08:21 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201201121108.q0CB8LLn007035@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 12 Jan 2012 11:08:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230009 - stable/9/release/picobsd/build X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 11:08:22 -0000 Author: luigi Date: Thu Jan 12 11:08:21 2012 New Revision: 230009 URL: http://svn.freebsd.org/changeset/base/230009 Log: merge from head: support for building cross-arch versions of picobsd Modified: stable/9/release/picobsd/build/Makefile.conf stable/9/release/picobsd/build/picobsd Modified: stable/9/release/picobsd/build/Makefile.conf ============================================================================== --- stable/9/release/picobsd/build/Makefile.conf Thu Jan 12 08:03:26 2012 (r230008) +++ stable/9/release/picobsd/build/Makefile.conf Thu Jan 12 11:08:21 2012 (r230009) @@ -19,9 +19,9 @@ MODULES?=-DNO_MODULES # do not build the # These 3 variables determine where the kernel is built. # If config were smart enough, we could place the config -# file in some other place than ${SRC}/sys/i386/conf, but +# file in some other place than ${SRC}/sys/${TARGET_ARCH}/conf, but # at the moment (Oct.2001) this is not possible yet. -CONF=${SRC}/sys/i386/conf +CONF=${SRC}/sys/${TARGET_ARCH}/conf #CONF=${BUILDDIR}/conf # XXX does not work yet CONFFILE=PICOBSD-${name} @@ -45,10 +45,10 @@ ${COMPILE}: ${CONF}/${CONFFILE} (cd ${CONF}; ${CONFIG} -d ${COMPILE} ${CONFFILE}; \ cd ${COMPILE}; ${BINMAKE} KERNEL=kernel ${MODULES} depend ) -${CONF}/${CONFFILE}: PICOBSD +${CONF}/${CONFFILE}: ${KERNCONF} # -mkdir -p ${CONF} # XXX not needed yet. cp ${.OODATE} ${.TARGET} - if [ -f PICOBSD.hints ] ; then cp PICOBSD.hints ${CONF}/PICOBSD.hints ; fi + [ -f PICOBSD.hints ] && cp PICOBSD.hints ${CONF}/ # This part creates crunch1.conf and crunch.mk from crunch.conf ${BUILDDIR}/crunch.mk: ${BUILDDIR}/crunch1.conf Modified: stable/9/release/picobsd/build/picobsd ============================================================================== --- stable/9/release/picobsd/build/picobsd Thu Jan 12 08:03:26 2012 (r230008) +++ stable/9/release/picobsd/build/picobsd Thu Jan 12 11:08:21 2012 (r230009) @@ -67,7 +67,7 @@ # SRC points to your FreeBSD source tree. # l_usrtree points to the /usr subdir for the source tree. # Normally /usr or ${SRC}/../usr -# l_objtree points to the obj tree. Normally ${l_usrtree}/obj-pico +# l_objtree points to the obj tree. Normally ${l_usrtree}/obj-pico-${o_arch} # c_label is either bsdlabel or disklabel # PICO_TREE is where standard picobsd stuff resides. # Normally ${SRC}/release/picobsd @@ -105,11 +105,6 @@ set_defaults() { # no arguments EDITOR=${EDITOR:-vi} fd_size=${fd_size:-1440} - o_use_loader="yes" # use /boot/loader - # You should not change it unless you are really short - # of space, and your kernel is small enough that the - # bootblocks manage to load it. - o_all_in_mfs="yes" # put all files in mfs so you can boot # and run the image via diskless boot. o_clean="" # set if you want to clean prev.builds. @@ -121,6 +116,7 @@ set_defaults() { # no arguments o_no_devfs= # default is use devfs. # You should only set it when building 4.x images o_do_modules="" # do not build modules + o_arch=`uname -m` # default to amd64 or i386 ... SRC="/usr/src" # default location for sources c_startdir=`pwd` # directory where we start @@ -165,20 +161,30 @@ set_defaults() { # no arguments # and also to build a specific target create_includes_and_libraries2() { # opt_dir opt_target local no - log "create_includes_and_libraries2() for ${SRC}" + log "create_includes_and_libraries2() for ${SRC} $1" if [ ${OSVERSION} -ge 600000 ] ; then no="-DNO_CLEAN -DNO_PROFILE -DNO_GAMES -DNO_LIBC_R" # WITHOUT_CDDL=1" else no="-DNOCLEAN -DNOPROFILE -DNOGAMES -DNOLIBC_R" fi - MAKEOBJDIRPREFIX=${l_objtree} - export MAKEOBJDIRPREFIX ( cd ${SRC}; # make -DNOCLEAN -DNOPROFILE -DNOGAMES -DNOLIBC_R -DPICOBSD buildworld if [ -d "$1" ] ; then cd $1 ; ${BINMAKE} ${o_par} $2 # specific target, e.g. ld-elf.so else - ${BINMAKE} ${o_par} _+_= $no toolchain _includes _libraries + MAKEOBJDIRPREFIX=${l_objtree} + export MAKEOBJDIRPREFIX + # export WITH_RESCUE=yes # build crunchide + # ${BINMAKE} ${o_par} _+_= $no toolchain _includes _libraries + ( + # eval export `cd ${SRC}; ${BINMAKE} -f Makefile.inc1 -V BMAKEENV` + eval "export XMAKE=\"`cd ${SRC}; make -f Makefile -V XMAKE`\"" + ${BINMAKE} ${o_par} _+_= $no toolchain + ) + eval export `cd ${SRC}; ${BINMAKE} -f Makefile.inc1 -V WMAKEENV` + ${BINMAKE} ${o_par} _+_= $no _includes _libraries + [ ${o_arch} != `uname -m` ] && \ + (cd ${l_objtree}; ln -s . ${o_arch}.${o_arch} || true ) fi ) } @@ -241,16 +247,19 @@ set_type() { # the_type the_site name="" # clear in case of errors for i in ${c_startdir}/${a} ${PICO_TREE}/${a} ; do log "set_type: checking $i" - [ -d $i -a -f $i/PICOBSD -a -f $i/crunch.conf ] || continue - set -- `cat $i/PICOBSD | \ + [ -d $i -a -f $i/crunch.conf ] || continue + # look for a kernel config file, privilege arch-specific + l_kernconf=$i/PICOBSD.${o_arch} + [ -f $l_kernconf ] || l_kernconf=$i/PICOBSD + [ -f $l_kernconf ] || continue + set -- `cat $l_kernconf | \ awk '/^#PicoBSD/ {print $2, $3, $4, $5, $6}'` [ x"$1" != "x" ] || continue - MFS_SIZE=$1 ; init_name=$2 - mfs_inodes=$3 ; fd_inodes=$4 + MFS_SIZE=$1 name=`(cd $i ; pwd) ` name=`basename $name` MY_TREE=$i - BUILDDIR=${c_startdir}/build_dir-${name} + BUILDDIR=${c_startdir}/build_dir-${name}-${o_arch} log "Matching file $name in $i" return ; done @@ -327,10 +336,7 @@ main_dialog() { K "edit Kernel config file" \ E "Edit crunch.conf file" \ S "MFS Size: ${MFS_SIZE}kB" \ - I "Init type: ${init_name}" \ F "Floppy size: ${fd_size}kB" \ - M "MFS bytes per inode: ${mfs_inodes}" \ - U "UFS bytes per inode: ${fd_inodes}" \ $ "Site-info: ${SITE}" \ Q "Quit" \ 2> ${c_reply} @@ -348,12 +354,6 @@ main_dialog() { { dialog --menu "Setup the type of configuration" 12 70 5 $l \ 2> ${c_reply} && set_type "`cat ${c_reply}`" ${SITE} ; } || true ;; - I) - { dialog --menu "Choose your init(8) program" \ - 10 70 2 init "Standard init (requires getty)" \ - oinit "small init from TinyWare" 2> ${c_reply} \ - && init_name=`cat ${c_reply}` ; } || true - ;; K) ${EDITOR} ${MY_TREE}/PICOBSD ;; @@ -385,20 +385,6 @@ this as small as possible. " 10 70 2> ${ 2> ${c_reply} && fd_size=`cat ${c_reply}` ; } || true ;; - M) - { dialog --title "MFS bytes per inode:" --inputbox \ - "Enter MFS bytes per inode (typically 4096..65536). \ - A larger value means fewer inodes but more space on MFS" \ - 10 70 2> ${c_reply} && mfs_inodes=`cat ${c_reply}` ; } || true - ;; - - U) - { dialog --title "Floppy bytes per inode:" --inputbox \ - "Enter floppy bytes per inode (typically 3072..65536). \ - A larger value means fewer inodes but more space on the floppy." \ - 10 70 2> ${c_reply} && fd_inodes=`cat ${c_reply}` ; } || true - ;; - N) break 2 ;; @@ -451,8 +437,10 @@ do_kernel() { # OK log "do_kernel() Preparing kernel \"$name\" in $MY_TREE" (cd $MY_TREE; export name SRC BUILDDIR # used in this makefile ; # export CONFIG + export WARNS CWARNFLAGS [ "${o_do_modules}" = "yes" ] && export MODULES="" - ${BINMAKE} ${o_par} -v -f ${PICO_TREE}/build/Makefile.conf ) || \ + ${BINMAKE} ${o_par} KERNCONF=${l_kernconf} \ + -v -f ${PICO_TREE}/build/Makefile.conf ) || \ fail $? missing_kernel } @@ -563,7 +551,7 @@ do_links() { # rootdir varname # find_progs is a helper function to locate the named programs # or libraries in ${o_objdir} or ${_SHLIBDIRPREFIX}, # and return the full pathnames. -# Called as "find_progs [-L libpath] [-P binpath] prog1 prog2 ... " +# Called as "find_progs [[-L libpath] [-P binpath]] prog1 prog2 ... " # On return it sets ${u_progs} to the list of programs, and ${u_libs} # to the list of shared libraries used. # @@ -586,23 +574,32 @@ do_links() { # rootdir varname # } find_progs() { # programs - local i - local oo=${o_objdir:-${_SHLIBDIRPREFIX}} # default objdir - local lp=$oo/lib # default lib.prefix - local o="" # additional objdir + local pass i old_libs="" tmp o="" if [ x"$1" = "x-L" -a -d "$2" ] ; then # set lib search path - o=$2; shift; shift - lp="$lp:$o/lib:$o/usr/lib:$o/usr/local/lib" - o="-P $o" + o="-P $2"; shift; shift fi - u_libs="" - u_progs="`find_progs_helper $*`" - log "looking for libs for <$u_progs> in $lp" + # Result returned in global variables + u_libs="" ; u_progs="`find_progs_helper $*`" [ -z "${u_progs}" ] && return 1 # not found, error - i="`( LD_LIBRARY_PATH=$lp ldd ${u_progs} ) | \ - grep -v '^/' | awk '{print $1}' | sort | uniq`" - u_libs="`find_progs_helper $o $i`" + # use objdump to find libraries. Iterate to fetch recursive + # dependencies. + tmp="${u_progs}" ; pass=1 + while [ $pass -lt 10 ] ; do + pass=$(($pass + 1)) + i="`objdump -x ${tmp} | \ + awk '$1 == "NEEDED" { print $2 }' | sort | uniq`" + if [ "$old_libs" = "$i" ] ; then + log "libraries for: $my_progs ($u_progs) are ($i) $u_libs" + log "--- done find_progs ---" return 0 + else + # logverbose "old--- $old_libs --- new +++ $i +++" + fi + u_libs="`find_progs_helper $o $i`" + old_libs="$i" + tmp="$tmp $u_libs" + done + log "WARNING: Too many passes, giving up" } find_progs_helper() { # programs @@ -635,8 +632,12 @@ find_progs_helper() { # programs [ -d "${ldir}/${i}" ] && places="${places} ${ldir}/${i}" done fi + for i in $progs ; do + # full pathnames are just listed + [ -f "$i" ] && echo $i && continue + find ${places} -maxdepth 3 -type f -name ${i} | head -1 + done # use maxdepth 3 because some libs are way down - find ${places} -maxdepth 3 -type f \( ${names} \) } # Populate the memory filesystem with binaries and non-variable @@ -786,7 +787,6 @@ populate_mfs_tree() { final_cleanup() { log "final_cleanup()" rm -rf ${c_mnt} ${c_reply} 2> /dev/null || true - rm -f ${c_reply} } # fail errno errcode @@ -855,17 +855,6 @@ fill_floppy_image() { fi log "Labeling floppy image" - b2=${BUILDDIR}/boot2 # modified boot2 - cp -f ${c_boot2} ${b2} - chmod 0644 ${b2} - - if [ ${o_use_loader} = "no" ] ; then - log "patch ${c_boot2} to boot /kernel right away" - set `strings -at d ${b2} | grep "/boot/loader"` - echo -e "/kernel\0\0\0\0\0" | \ - dd of=${b2} obs=$1 oseek=1 conv=notrunc 2>/dev/null - fi - chmod 0444 ${b2} dst=${BUILDDIR}/image.tree rm -rf ${dst} @@ -891,17 +880,13 @@ fill_floppy_image() { log "not loading mfs, size ${mfs_size} img ${imgsize}" fi log "Compress with kgzip and copy to floppy image" - if [ ${o_use_loader} = "no" ] ; then - kgzip -o kernel.gz kernel - cp -p kernel.gz ${dst}/kernel || fail $? no_space "copying kernel" - else - gzip kernel + mkdir -p ${dst}/boot/kernel + # XXX update loader.conf echo "hint.acpi.0.disabled=\"1\"" > ${dst}/boot/loader.conf echo "console=\"comconsole\"" >> ${dst}/boot/loader.conf cp -p /boot/loader ${dst}/boot/loader || fail $? no_space "copying bootloader" - cp -p kernel.gz ${dst}/boot/kernel/kernel.gz || fail $? no_space "copying kernel" - fi + gzip -c kernel > ${dst}/boot/kernel/kernel.gz || fail $? no_space "copying kernel" # now transfer the floppy tree. If it is already in mfs, dont bother. if [ "${o_all_in_mfs}" != "yes" ] ; then @@ -951,10 +936,13 @@ fill_floppy_image() { # so we skip 276 from the source, and 276+512=788 from dst # the old style blocks used 512 and 1024 respectively - dd if=${b2} iseek=1 ibs=276 2> /dev/null | \ + dd if=${c_boot2} iseek=1 ibs=276 2> /dev/null | \ dd of=${BUILDDIR}/${c_img} oseek=1 obs=788 conv=notrunc 2>/dev/null log "done disk image" # XXX (log "Fixing permissions"; cd ${dst}; chown -R root *) + # leave build stuff if verbose + [ ${o_verbose} -gt 0 ] && return + rm -rf ${BUILDDIR}/floppy.tree || true # cleanup # df -ik ${dst} | colrm 70 > .build.reply rm -rf ${dst} @@ -973,7 +961,7 @@ set_build_parameters() { else l_usrtree=${USR:-${SRC}/../usr} fi - l_objtree=${l_usrtree}/obj-pico + l_objtree=${l_usrtree}/obj-pico-${o_arch} PICO_TREE=${PICO_TREE:-${SRC}/release/picobsd} set `grep "#define[\t ]__FreeBSD_version" ${SRC}/sys/sys/param.h` @@ -981,9 +969,11 @@ set_build_parameters() { log "OSVERSION is ${OSVERSION}" if [ ${OSVERSION} -ge 500035 ] ; then export MAKEOBJDIRPREFIX=${l_objtree} - export TARGET_ARCH=i386 TARGET=i386 + export TARGET_ARCH=${o_arch} TARGET=${o_arch} + # XXX why change machine_arch ? + #-- export MACHINE_ARCH=`uname -m` MACHINE=`uname -m` + # export CWARNFLAGS="-Wextra -Wno-sign-compare -Wno-missing-field-initializers" eval "export BINMAKE=\"`cd ${SRC}; make -f Makefile -V BINMAKE`\"" - eval export `cd ${SRC}; ${BINMAKE} -f Makefile.inc1 -V WMAKEENV` fi if [ "${o_init_src}" != "" ] ; then @@ -992,6 +982,8 @@ set_build_parameters() { else create_includes_and_libraries2 fi + else + eval export `cd ${SRC}; ${BINMAKE} -f Makefile.inc1 -V WMAKEENV` fi if [ ${OSVERSION} -lt 500035 ] ; then # Create the right LIBS and CFLAGS for further builds. @@ -1027,22 +1019,27 @@ set_defaults while [ true ]; do log "Parsing $1" case $1 in + --par) + o_par="-j 8" + ;; + --src) # set the source path instead of /usr/src SRC=`realpath $2` shift ;; - --init) + + --init) # run a partial buildworld on the source tree o_init_src="YES" ;; - --floppy_size) - fd_size=$2 + --arch) # override the target architecture + o_arch=$2 shift ;; - --no_loader) # omit /boot/loader, just rely on boot2 - # (it may have problems with kernels > 4MB) - o_use_loader="no" + --floppy_size) # image size + fd_size=$2 + shift ;; --all_in_mfs) @@ -1056,6 +1053,7 @@ while [ true ]; do --modules) # also build kernel modules o_do_modules="yes" ;; + -n) o_interactive="NO" ;; From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 12:43:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20594106564A; Thu, 12 Jan 2012 12:43:44 +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 E642D8FC0A; Thu, 12 Jan 2012 12:43:43 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 9ECC746B09; Thu, 12 Jan 2012 07:43:43 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 0C99DB941; Thu, 12 Jan 2012 07:43:43 -0500 (EST) From: John Baldwin To: "Pedro F. Giffuni" Date: Thu, 12 Jan 2012 07:43:41 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201201112117.q0BLHEck077022@svn.freebsd.org> In-Reply-To: <201201112117.q0BLHEck077022@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201201120743.41757.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 12 Jan 2012 07:43:43 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, joel@freebsd.org Subject: Re: svn commit: r229981 - in head/sys: conf dev/sound/pci gnu/dev/sound/pci modules/sound/driver/emu10kx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 12:43:44 -0000 On Wednesday, January 11, 2012 4:17:14 pm Pedro F. Giffuni wrote: > Author: pfg > Date: Wed Jan 11 21:17:14 2012 > New Revision: 229981 > URL: http://svn.freebsd.org/changeset/base/229981 > > Log: > Replace GPL'd headers in the emu10kx snd driver code. > > This uses the emuxkireg.h already used in the emu10k1 > snd driver. Special thanks go to Alexander Motin as > he was able to find some errors and reverse engineer > some wrong values in the emuxkireg header. > > The emu10kx driver is now free from the GPL. > > PR: 153901 > Tested by: mav, joel > Approved by: jhb (mentor) > MFC after: 2 weeks Is the emu10kx driver a superset of em10k1 now (meaning does it support all the em10k1 devices and should em10k1 be retired)? Also, it seems we should definitely add 'snd_emu10kx' to GENERIC on x86 and possible 'snd_emu10k1'. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 13:09:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BECCD1065670; Thu, 12 Jan 2012 13:09:23 +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 90C308FC0C; Thu, 12 Jan 2012 13:09:23 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 47A5B46B09; Thu, 12 Jan 2012 08:09:23 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B7F10B91C; Thu, 12 Jan 2012 08:09:22 -0500 (EST) From: John Baldwin To: Eygene Ryabinkin Date: Thu, 12 Jan 2012 07:48:28 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201201120648.q0C6mBio096662@svn.freebsd.org> In-Reply-To: <201201120648.q0C6mBio096662@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201201120748.28564.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 12 Jan 2012 08:09:22 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230007 - in head: etc etc/rc.d share/man/man8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 13:09:23 -0000 On Thursday, January 12, 2012 1:48:11 am Eygene Ryabinkin wrote: > Author: rea (ports committer) > Date: Thu Jan 12 06:48:11 2012 > New Revision: 230007 > URL: http://svn.freebsd.org/changeset/base/230007 > > Log: > rc.d: document 'quiet' prefix and fix dhclient/devd interaction > > Document the current semantics of the 'quiet' command prefix > in the rc.subr(8). > > Fix dhclient rc.d script: it should not call err() for > non-DHCP-enabled interface when it is called from devd, because the > latter just blindly calls 'service dhclient quietstart' on each "link > up" event. > > Since the 'quietstart' will silence the message "Cannot 'start' . > Set _enable to YES in /etc/rc.conf or use 'onestart' instead of > 'start'." and running dhclient on the non-DHCP-enabled interface is > the same thing as running the service without _enable set, > such modification is in sync with the current semantics of the 'quiet' > prefix. Alternatively, devd could have invoked a wrapper script that only ran /etc/rc.d/dhclient if dhcpif was true for the interface. All other uses of /etc/rc.d/dhclient in our system scripts are conditional on that check. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 13:47:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18ABD106566C; Thu, 12 Jan 2012 13:47:51 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id 9EA2D8FC0A; Thu, 12 Jan 2012 13:47:49 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0CDlgGR022689 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 13 Jan 2012 00:47:47 +1100 Date: Fri, 13 Jan 2012 00:47:37 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Kostik Belousov In-Reply-To: <20120112001630.GS31224@deviant.kiev.zoral.com.ua> Message-ID: <20120112235635.Y1663@besplex.bde.org> References: <201201112233.q0BMXfgD079582@svn.freebsd.org> <20120112001630.GS31224@deviant.kiev.zoral.com.ua> 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, Guy Helmer Subject: Re: svn commit: r229986 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 13:47:51 -0000 On Thu, 12 Jan 2012, Kostik Belousov wrote: > On Wed, Jan 11, 2012 at 10:33:41PM +0000, Guy Helmer wrote: >> Log: >> Fix namespace issues with prototype parameter names. >> Add missing prototype parameter names. >> >> Requested by bde. >> ... >> Modified: head/lib/libutil/libutil.h >> ============================================================================== >> --- head/lib/libutil/libutil.h Wed Jan 11 22:12:45 2012 (r229985) >> +++ head/lib/libutil/libutil.h Wed Jan 11 22:33:41 2012 (r229986) >> @@ -93,7 +93,7 @@ struct termios; >> struct winsize; >> >> __BEGIN_DECLS >> -char *auth_getval(const char *name); >> +char *auth_getval(const char *_name); > The _[a-z].* names are still in the app namespace. > > Only _[A-Z].* and __[a-z].* are reserved for the implementation. No, _[a-z].* is reserved for the implementation in file scope mainly for extern declarations). For example, _exit is reserved for the implementation, and _name is reserved for the implementation in exactly the same contexts as _exit is. This prevents the application #defining _name as '_this is not a C identifier', which would break the above. OTOH, _name is not reserved for the implementation in most other scopes, so applications can do almost anything with it except #define it or use it for a global or file-scope-static variable or function. style(9) even gives the exact rule (it says "an underscore" instead of "a single underscore", but uses only 1 in its example) to inhibit excessive underscoring in prototypes. Other details: - prototypes start a new scope so names in them are not subject to the file scope rules - similarly for struct scope. - the scopes naturally prevent -Wshadow warnings. E.g., names inside file-scope prototypes in implementation headers can't shadow application names, since the application names would have to be in file scope so they cannot have a single leading underscore. I haven't thought about all cases for this. Details from C99 (n869.txt): % 7.1.3 Reserved identifiers % % -- All identifiers that begin with an underscore are % always reserved for use as identifiers with file scope % in both the ordinary and tag name spaces. % ... % [#2] No other identifiers are reserved. If the program % declares or defines an identifier in a context in which it % is reserved (other than as allowed by 7.1.4), or defines a % reserved identifier as a macro name, the behavior is % undefined. I think we only need the reservation of _[a-z]* (actually _[a-z0-9]*) and the anti-definition rule for these to prove that the implementation's use of _[a-z0-9]* in non-file scope cannot conflict with any application use of _[a-z0-9]* any scope (can only be non-file scope). See for old examples of using the precise rules for avoiding excessive underscoring, and complications in macros which require 2 underscores: - struct __sbuf has 2 underscores since it's in file scope - members in this struct and others have only 1 underscore since they are not in file scope - __sgetc() has 2 underscores, since it is used in getc(). getc() is used in function scope where _sgetc is in the application namespace. Thus, the implementation cannot use _sgetc here. - __sgetc() is implemented as an inline function. The names of parameters and local variables in this must have at least 1 underscore so that the application cannot #define them, and 1 is enough and only 1 is used for the same reasons as for parameter names in prototypes. - older implementations had an alternative definition of __sgetc() as a macro. Here no underscores are needed (and none are used) for the parameter names, since macro parameters have their own namespace and so cannot be corrupted by application #define's of their names which are now possible. These use the same single-undescored names for struct members. When I started writing this, I misremembered a complication here. I thought that some struct member names might need 2 underscores for such use. But there is no problem -- (p)->_w is protected enough by the single underscore in _w, in the same way as for inline functioms. Bruce From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 14:13:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA2401065672; Thu, 12 Jan 2012 14:13:50 +0000 (UTC) (envelope-from ghelmer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9506D8FC08; Thu, 12 Jan 2012 14:13: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 q0CEDoYo012746; Thu, 12 Jan 2012 14:13:50 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0CEDo5A012744; Thu, 12 Jan 2012 14:13:50 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201201121413.q0CEDo5A012744@svn.freebsd.org> From: Guy Helmer Date: Thu, 12 Jan 2012 14:13: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: r230010 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 14:13:50 -0000 Author: ghelmer Date: Thu Jan 12 14:13:49 2012 New Revision: 230010 URL: http://svn.freebsd.org/changeset/base/230010 Log: pidfile_open() no longer uses fcntl() to set the close-on-exec flag. Modified: head/lib/libutil/pidfile.3 Modified: head/lib/libutil/pidfile.3 ============================================================================== --- head/lib/libutil/pidfile.3 Thu Jan 12 11:08:21 2012 (r230009) +++ head/lib/libutil/pidfile.3 Thu Jan 12 14:13:49 2012 (r230010) @@ -81,7 +81,7 @@ argument is file will be used. The .Fn pidfile_open -function sets the FD_CLOEXEC close-on-exec flag on the open file descriptor. +function sets the O_CLOEXEC close-on-exec flag when opening the pidfile. .Pp The .Fn pidfile_write @@ -205,7 +205,6 @@ The function may also fail and set .Va errno for any errors specified for the -.Xr fcntl 2 , .Xr fstat 2 , .Xr open 2 , and From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 14:40:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05FFD106566B; Thu, 12 Jan 2012 14:40:26 +0000 (UTC) (envelope-from ghelmer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB9E08FC12; Thu, 12 Jan 2012 14:40: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 q0CEePIw013614; Thu, 12 Jan 2012 14:40:25 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0CEePAo013612; Thu, 12 Jan 2012 14:40:25 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201201121440.q0CEePAo013612@svn.freebsd.org> From: Guy Helmer Date: Thu, 12 Jan 2012 14:40:25 +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: r230011 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 14:40:26 -0000 Author: ghelmer Date: Thu Jan 12 14:40:25 2012 New Revision: 230011 URL: http://svn.freebsd.org/changeset/base/230011 Log: More prototype formatting fixes, struct member formatting fixes, and namespace fix for property_find() prototype. Provided by bde. Modified: head/lib/libutil/libutil.h Modified: head/lib/libutil/libutil.h ============================================================================== --- head/lib/libutil/libutil.h Thu Jan 12 14:13:49 2012 (r230010) +++ head/lib/libutil/libutil.h Thu Jan 12 14:40:25 2012 (r230011) @@ -69,8 +69,8 @@ typedef __uid_t uid_t; /* for properties.c */ typedef struct _property { struct _property *next; - char *name; - char *value; + char *name; + char *value; } *properties; #ifdef _SYS_PARAM_H_ @@ -121,7 +121,7 @@ int openpty(int *_amaster, int *_aslave, void properties_free(properties _list); char *property_find(properties _list, const char *_name); properties - properties_read(int fd); + properties_read(int _fd); int realhostname(char *_host, size_t _hsize, const struct in_addr *_ip); int realhostname_sa(char *_host, size_t _hsize, struct sockaddr *_addr, int _addrlen); @@ -139,8 +139,10 @@ char *fparseln(FILE *_fp, size_t *_len, #endif #ifdef _PWD_H_ -int pw_copy(int _ffd, int _tfd, const struct passwd *_pw, struct passwd *_old_pw); -struct passwd *pw_dup(const struct passwd *_pw); +int pw_copy(int _ffd, int _tfd, const struct passwd *_pw, + struct passwd *_old_pw); +struct passwd + *pw_dup(const struct passwd *_pw); int pw_edit(int _notsetuid); int pw_equal(const struct passwd *_pw1, const struct passwd *_pw2); void pw_fini(void); @@ -149,21 +151,26 @@ char *pw_make(const struct passwd *_pw); char *pw_make_v7(const struct passwd *_pw); int pw_mkdb(const char *_user); int pw_lock(void); -struct passwd *pw_scan(const char *_line, int _flags); -const char *pw_tempname(void); +struct passwd + *pw_scan(const char *_line, int _flags); +const char + *pw_tempname(void); int pw_tmp(int _mfd); #endif #ifdef _GRP_H_ -int gr_copy(int __ffd, int _tfd, const struct group *_gr, struct group *_old_gr); -struct group *gr_dup(const struct group *_gr); +int gr_copy(int __ffd, int _tfd, const struct group *_gr, + struct group *_old_gr); +struct group + *gr_dup(const struct group *_gr); int gr_equal(const struct group *_gr1, const struct group *_gr2); void gr_fini(void); int gr_init(const char *_dir, const char *_master); int gr_lock(void); char *gr_make(const struct group *_gr); int gr_mkdb(void); -struct group *gr_scan(const char *_line); +struct group + *gr_scan(const char *_line); int gr_tmp(int _mdf); #endif From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 14:43:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E1A7106564A; Thu, 12 Jan 2012 14:43:53 +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 573F28FC15; Thu, 12 Jan 2012 14:43:53 +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 q0CEhrlQ013796; Thu, 12 Jan 2012 14:43:53 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0CEhrUi013792; Thu, 12 Jan 2012 14:43:53 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201121443.q0CEhrUi013792@svn.freebsd.org> From: John Baldwin Date: Thu, 12 Jan 2012 14:43:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230012 - in stable/9: share/man/man9 sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 14:43:53 -0000 Author: jhb Date: Thu Jan 12 14:43:52 2012 New Revision: 230012 URL: http://svn.freebsd.org/changeset/base/230012 Log: MFC 228715: Add a TASK_INITIALIZER() macro that can be used to statically initialize a task structure. Modified: stable/9/share/man/man9/Makefile stable/9/share/man/man9/taskqueue.9 stable/9/sys/sys/taskqueue.h Directory Properties: stable/9/share/man/man9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/share/man/man9/Makefile ============================================================================== --- stable/9/share/man/man9/Makefile Thu Jan 12 14:40:25 2012 (r230011) +++ stable/9/share/man/man9/Makefile Thu Jan 12 14:43:52 2012 (r230012) @@ -1254,6 +1254,7 @@ MLINKS+=sysctl_ctx_init.9 sysctl_ctx_ent sysctl_ctx_init.9 sysctl_ctx_free.9 MLINKS+=SYSINIT.9 SYSUNINIT.9 MLINKS+=taskqueue.9 TASK_INIT.9 \ + taskqueue.9 TASK_INITIALIZER.9 \ taskqueue.9 taskqueue_cancel.9 \ taskqueue.9 taskqueue_create.9 \ taskqueue.9 taskqueue_create_fast.9 \ Modified: stable/9/share/man/man9/taskqueue.9 ============================================================================== --- stable/9/share/man/man9/taskqueue.9 Thu Jan 12 14:40:25 2012 (r230011) +++ stable/9/share/man/man9/taskqueue.9 Thu Jan 12 14:43:52 2012 (r230012) @@ -80,6 +80,7 @@ struct timeout_task; .Ft void .Fn taskqueue_run "struct taskqueue *queue" .Fn TASK_INIT "struct task *task" "int priority" "task_fn_t func" "void *context" +.Fn TASK_INITIALIZER "int priority" "task_fn_t func" "void *context" .Fn TASKQUEUE_DECLARE "name" .Fn TASKQUEUE_DEFINE "name" "taskqueue_enqueue_fn enqueue" "void *context" "init" .Fn TASKQUEUE_FAST_DEFINE "name" "taskqueue_enqueue_fn enqueue" "void *context" "init" @@ -243,9 +244,14 @@ A convenience macro, is provided to initialise a .Va task structure. +The +.Fn TASK_INITIALIZER +macro generates an initializer for a task structure. A macro .Fn TIMEOUT_TASK_INIT "queue" "timeout_task" "priority" "func" "context" -initializes the timeout_task structure. +initializes the +.Va timeout_task +structure. The values of .Va priority , .Va func , Modified: stable/9/sys/sys/taskqueue.h ============================================================================== --- stable/9/sys/sys/taskqueue.h Thu Jan 12 14:40:25 2012 (r230011) +++ stable/9/sys/sys/taskqueue.h Thu Jan 12 14:43:52 2012 (r230012) @@ -77,6 +77,12 @@ void taskqueue_block(struct taskqueue *q void taskqueue_unblock(struct taskqueue *queue); int taskqueue_member(struct taskqueue *queue, struct thread *td); +#define TASK_INITIALIZER(priority, func, context) \ + { .ta_pending = 0, \ + .ta_priority = (priority), \ + .ta_func = (func), \ + .ta_context = (context) } + /* * Functions for dedicated thread taskqueues */ From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 14:44:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 343761065672; Thu, 12 Jan 2012 14:44: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 044A18FC12; Thu, 12 Jan 2012 14:44: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 q0CEiEMg013860; Thu, 12 Jan 2012 14:44:14 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0CEiE6a013856; Thu, 12 Jan 2012 14:44:14 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201121444.q0CEiE6a013856@svn.freebsd.org> From: John Baldwin Date: Thu, 12 Jan 2012 14:44:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230013 - in stable/8: share/man/man9 sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 14:44:15 -0000 Author: jhb Date: Thu Jan 12 14:44:14 2012 New Revision: 230013 URL: http://svn.freebsd.org/changeset/base/230013 Log: MFC 228715: Add a TASK_INITIALIZER() macro that can be used to statically initialize a task structure. Modified: stable/8/share/man/man9/Makefile stable/8/share/man/man9/taskqueue.9 stable/8/sys/sys/taskqueue.h Directory Properties: stable/8/share/man/man9/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/share/man/man9/Makefile ============================================================================== --- stable/8/share/man/man9/Makefile Thu Jan 12 14:43:52 2012 (r230012) +++ stable/8/share/man/man9/Makefile Thu Jan 12 14:44:14 2012 (r230013) @@ -1218,6 +1218,7 @@ MLINKS+=sysctl_ctx_init.9 sysctl_ctx_ent sysctl_ctx_init.9 sysctl_ctx_entry_find.9 \ sysctl_ctx_init.9 sysctl_ctx_free.9 MLINKS+=taskqueue.9 TASK_INIT.9 \ + taskqueue.9 TASK_INITIALIZER.9 \ taskqueue.9 taskqueue_create.9 \ taskqueue.9 TASKQUEUE_DECLARE.9 \ taskqueue.9 TASKQUEUE_DEFINE.9 \ Modified: stable/8/share/man/man9/taskqueue.9 ============================================================================== --- stable/8/share/man/man9/taskqueue.9 Thu Jan 12 14:43:52 2012 (r230012) +++ stable/8/share/man/man9/taskqueue.9 Thu Jan 12 14:44:14 2012 (r230013) @@ -72,6 +72,7 @@ struct task { .Ft int .Fn taskqueue_member "struct taskqueue *queue" "struct thread *td" .Fn TASK_INIT "struct task *task" "int priority" "task_fn_t *func" "void *context" +.Fn TASK_INITIALIZER "int priority" "task_fn_t func" "void *context" .Fn TASKQUEUE_DECLARE "name" .Fn TASKQUEUE_DEFINE "name" "taskqueue_enqueue_fn enqueue" "void *context" "init" .Fn TASKQUEUE_FAST_DEFINE "name" "taskqueue_enqueue_fn enqueue" "void *context" "init" @@ -193,6 +194,9 @@ A convenience macro, is provided to initialise a .Va task structure. +The +.Fn TASK_INITIALIZER +macro generates an initializer for a task structure. The values of .Va priority , .Va func , Modified: stable/8/sys/sys/taskqueue.h ============================================================================== --- stable/8/sys/sys/taskqueue.h Thu Jan 12 14:43:52 2012 (r230012) +++ stable/8/sys/sys/taskqueue.h Thu Jan 12 14:44:14 2012 (r230013) @@ -61,6 +61,12 @@ void taskqueue_block(struct taskqueue *q void taskqueue_unblock(struct taskqueue *queue); int taskqueue_member(struct taskqueue *queue, struct thread *td); +#define TASK_INITIALIZER(priority, func, context) \ + { .ta_pending = 0, \ + .ta_priority = (priority), \ + .ta_func = (func), \ + .ta_context = (context) } + /* * Functions for dedicated thread taskqueues */ From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 14:46:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19DFA1065672; Thu, 12 Jan 2012 14:46:23 +0000 (UTC) (envelope-from ken@kdm.org) Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81]) by mx1.freebsd.org (Postfix) with ESMTP id 350AC8FC0A; Thu, 12 Jan 2012 14:46:22 +0000 (UTC) Received: from nargothrond.kdm.org (localhost [127.0.0.1]) by nargothrond.kdm.org (8.14.2/8.14.2) with ESMTP id q0CEMpfp069449; Thu, 12 Jan 2012 07:22:51 -0700 (MST) (envelope-from ken@nargothrond.kdm.org) Received: (from ken@localhost) by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id q0CEMpS7069448; Thu, 12 Jan 2012 07:22:51 -0700 (MST) (envelope-from ken) Date: Thu, 12 Jan 2012 07:22:51 -0700 From: "Kenneth D. Merry" To: Hans Petter Selasky Message-ID: <20120112142251.GA68691@nargothrond.kdm.org> References: <201201120034.q0C0YXrq084182@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2i Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r229997 - in head: share/examples/scsi_target sys/amd64/conf sys/cam/ctl sys/cam/scsi sys/conf sys/dev/ata sys/dev/ciss sys/i386/conf sys/ia64/conf sys/sparc64/conf usr.bin usr.bin/ctls... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 14:46:23 -0000 On Thu, Jan 12, 2012 at 09:58:36 +0100, Hans Petter Selasky wrote: > Hi, > > ? > > Does the cam target layer support attach/detach of logical units? Yes, you can add and remove LUNs using ctladm. > Can it be used with USB target mode? If the USB driver supports the various CAM target mode CCBs, then it should work. CTL only talks SCSI, so it would be SCSI over USB. The only driver I've tested it with is the isp(4) driver. Ken > -----Original message----- > To:src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src-head@freebsd.org; > From:Kenneth D. Merry > Sent:Thu 12-01-2012 01:35 > Subject:svn commit: r229997 - in head: share/examples/scsi_target sys/amd64/conf sys/cam/ctl sys/cam/scsi sys/conf sys/dev/ata sys/dev/ciss sys/i386/conf sys/ia64/conf sys/sparc64/conf usr.bin usr.bin/ctls... > Author: ken > Date: Thu Jan 12 00:34:33 2012 > New Revision: 229997 > URL: http://svn.freebsd.org/changeset/base/229997 > > Log: > ?Add the CAM Target Layer (CTL). > ? > ?CTL is a disk and processor device emulation subsystem originally written > ?for Copan Systems under Linux starting in 2003. ?It has been shipping in > ?Copan (now SGI) products since 2005. > ? > ?It was ported to FreeBSD in 2008, and thanks to an agreement between SGI > ?(who acquired Copan's assets in 2010) and Spectra Logic in 2010, CTL is > ?available under a BSD-style license. ?The intent behind the agreement was > ?that Spectra would work to get CTL into the FreeBSD tree. > ? > ?Some CTL features: > ? > ? - Disk and processor device emulation. > ? - Tagged queueing > ? - SCSI task attribute support (ordered, head of queue, simple tags) > ? - SCSI implicit command ordering support. ?(e.g. if a read follows a mode > ? ? select, the read will be blocked until the mode select completes.) > ? - Full task management support (abort, LUN reset, target reset, etc.) > ? - Support for multiple ports > ? - Support for multiple simultaneous initiators > ? - Support for multiple simultaneous backing stores > ? - Persistent reservation support > ? - Mode sense/select support > ? - Error injection support > ? - High Availability support (1) > ? - All I/O handled in-kernel, no userland context switch overhead. > ? > ?(1) HA Support is just an API stub, and needs much more to be fully > ? ? ?functional. > ? > ?ctl.c:The core of CTL. ?Command handlers and processing, > ?character driver, and HA support are here. > ? > ?ctl.h:Basic function declarations and data structures. > ? > ?ctl_backend.c, > ?ctl_backend.h:The basic CTL backend API. > ? > ?ctl_backend_block.c, > ?ctl_backend_block.h:The block and file backend. ?This allows for using > ?a disk or a file as the backing store for a LUN. > ?Multiple threads are started to do I/O to the > ?backing device, primarily because the VFS API > ?requires that to get any concurrency. > ? > ?ctl_backend_ramdisk.c:A "fake" ramdisk backend. ?It only allocates a > ?small amount of memory to act as a source and sink > ?for reads and writes from an initiator. ?Therefore > ?it cannot be used for any real data, but it can be > ?used to test for throughput. ?It can also be used > ?to test initiators' support for extremely large LUNs. > ? > ?ctl_cmd_table.c:This is a table with all 256 possible SCSI opcodes, > ?and command handler functions defined for supported > ?opcodes. > ? > ?ctl_debug.h:Debugging support. > ? > ?ctl_error.c, > ?ctl_error.h:CTL-specific wrappers around the CAM sense building > ?functions. > ? > ?ctl_frontend.c, > ?ctl_frontend.h:These files define the basic CTL frontend port API. > ? > ?ctl_frontend_cam_sim.c:This is a CTL frontend port that is also a CAM SIM. > ?This frontend allows for using CTL without any > ?target-capable hardware. ?So any LUNs you create in > ?CTL are visible in CAM via this port. > ? > ?ctl_frontend_internal.c, > ?ctl_frontend_internal.h: > ?This is a frontend port written for Copan to do > ?some system-specific tasks that required sending > ?commands into CTL from inside the kernel. ?This > ?isn't entirely relevant to FreeBSD in general, > ?but can perhaps be repurposed. > ? > ?ctl_ha.h:This is a stubbed-out High Availability API. ?Much > ?more is needed for full HA support. ?See the > ?comments in the header and the description of what > ?is needed in the README.ctl.txt file for more > ?details. > ? > ?ctl_io.h:This defines most of the core CTL I/O structures. > ?union ctl_io is conceptually very similar to CAM's > ?union ccb. > ? > ?ctl_ioctl.h:This defines all ioctls available through the CTL > ?character device, and the data structures needed > ?for those ioctls. > ? > ?ctl_mem_pool.c, > ?ctl_mem_pool.h:Generic memory pool implementation used by the > ?internal frontend. > ? > ?ctl_private.h:Private data structres (e.g. CTL softc) and > ?function prototypes. ?This also includes the SCSI > ?vendor and product names used by CTL. > ? > ?ctl_scsi_all.c, > ?ctl_scsi_all.h:CTL wrappers around CAM sense printing functions. > ? > ?ctl_ser_table.c:Command serialization table. ?This defines what > ?happens when one type of command is followed by > ?another type of command. > ? > ?ctl_util.c, > ?ctl_util.h:CTL utility functions, primarily designed to be > ?used from userland. ?See ctladm for the primary > ?consumer of these functions. ?These include CDB > ?building functions. > ? > ?scsi_ctl.c:CAM target peripheral driver and CTL frontend port. > ?This is the path into CTL for commands from > ?target-capable hardware/SIMs. > ? > ?README.ctl.txt:CTL code features, roadmap, to-do list. > ? > ?usr.sbin/Makefile:Add ctladm. > ? > ?ctladm/Makefile, > ?ctladm/ctladm.8, > ?ctladm/ctladm.c, > ?ctladm/ctladm.h, > ?ctladm/util.c:ctladm(8) is the CTL management utility. > ?It fills a role similar to camcontrol(8). > ?It allow configuring LUNs, issuing commands, > ?injecting errors and various other control > ?functions. > ? > ?usr.bin/Makefile:Add ctlstat. > ? > ?ctlstat/Makefile > ?ctlstat/ctlstat.8, > ?ctlstat/ctlstat.c:ctlstat(8) fills a role similar to iostat(8). > ?It reports I/O statistics for CTL. > ? > ?sys/conf/files:Add CTL files. > ? > ?sys/conf/NOTES:Add device ctl. > ? > ?sys/cam/scsi_all.h:To conform to more recent specs, the inquiry CDB > ?length field is now 2 bytes long. > ? > ?Add several mode page definitions for CTL. > ? > ?sys/cam/scsi_all.c:Handle the new 2 byte inquiry length. > ? > ?sys/dev/ciss/ciss.c, > ?sys/dev/ata/atapi-cam.c, > ?sys/cam/scsi/scsi_targ_bh.c, > ?scsi_target/scsi_cmds.c, > ?mlxcontrol/interface.c:Update for 2 byte inquiry length field. > ? > ?scsi_da.h:Add versions of the format and rigid disk pages > ?that are in a more reasonable format for CTL. > ? > ?amd64/conf/GENERIC, > ?i386/conf/GENERIC, > ?ia64/conf/GENERIC, > ?sparc64/conf/GENERIC:Add device ctl. > ? > ?i386/conf/PAE:The CTL frontend SIM at least does not compile > ?cleanly on PAE. > ? > ?Sponsored by:Copan Systems, SGI and Spectra Logic > ?MFC after:1 month > > Added: > ?head/sys/cam/ctl/ > ?head/sys/cam/ctl/README.ctl.txt ? (contents, props changed) > ?head/sys/cam/ctl/ctl.c ? (contents, props changed) > ?head/sys/cam/ctl/ctl.h ? (contents, props changed) > ?head/sys/cam/ctl/ctl_backend.c ? (contents, props changed) > ?head/sys/cam/ctl/ctl_backend.h ? (contents, props changed) > ?head/sys/cam/ctl/ctl_backend_block.c ? (contents, props changed) > ?head/sys/cam/ctl/ctl_backend_block.h ? (contents, props changed) > ?head/sys/cam/ctl/ctl_backend_ramdisk.c ? (contents, props changed) > ?head/sys/cam/ctl/ctl_cmd_table.c ? (contents, props changed) > ?head/sys/cam/ctl/ctl_debug.h ? (contents, props changed) > ?head/sys/cam/ctl/ctl_error.c ? (contents, props changed) > ?head/sys/cam/ctl/ctl_error.h ? (contents, props changed) > ?head/sys/cam/ctl/ctl_frontend.c ? (contents, props changed) > ?head/sys/cam/ctl/ctl_frontend.h ? (contents, props changed) > ?head/sys/cam/ctl/ctl_frontend_cam_sim.c ? (contents, props changed) > ?head/sys/cam/ctl/ctl_frontend_internal.c ? (contents, props changed) > ?head/sys/cam/ctl/ctl_frontend_internal.h ? (contents, props changed) > ?head/sys/cam/ctl/ctl_ha.h ? (contents, props changed) > ?head/sys/cam/ctl/ctl_io.h ? (contents, props changed) > ?head/sys/cam/ctl/ctl_ioctl.h ? (contents, props changed) > ?head/sys/cam/ctl/ctl_mem_pool.c ? (contents, props changed) > ?head/sys/cam/ctl/ctl_mem_pool.h ? (contents, props changed) > ?head/sys/cam/ctl/ctl_private.h ? (contents, props changed) > ?head/sys/cam/ctl/ctl_scsi_all.c ? (contents, props changed) > ?head/sys/cam/ctl/ctl_scsi_all.h ? (contents, props changed) > ?head/sys/cam/ctl/ctl_ser_table.c ? (contents, props changed) > ?head/sys/cam/ctl/ctl_util.c ? (contents, props changed) > ?head/sys/cam/ctl/ctl_util.h ? (contents, props changed) > ?head/sys/cam/ctl/scsi_ctl.c ? (contents, props changed) > ?head/usr.bin/ctlstat/ > ?head/usr.bin/ctlstat/Makefile ? (contents, props changed) > ?head/usr.bin/ctlstat/ctlstat.8 ? (contents, props changed) > ?head/usr.bin/ctlstat/ctlstat.c ? (contents, props changed) > ?head/usr.sbin/ctladm/ > ?head/usr.sbin/ctladm/Makefile ? (contents, props changed) > ?head/usr.sbin/ctladm/ctladm.8 ? (contents, props changed) > ?head/usr.sbin/ctladm/ctladm.c ? (contents, props changed) > ?head/usr.sbin/ctladm/ctladm.h ? (contents, props changed) > ?head/usr.sbin/ctladm/util.c ? (contents, props changed) > Modified: > ?head/share/examples/scsi_target/scsi_cmds.c > ?head/sys/amd64/conf/GENERIC > ?head/sys/cam/scsi/scsi_all.c > ?head/sys/cam/scsi/scsi_all.h > ?head/sys/cam/scsi/scsi_da.h > ?head/sys/cam/scsi/scsi_targ_bh.c > ?head/sys/conf/NOTES > ?head/sys/conf/files > ?head/sys/dev/ata/atapi-cam.c > ?head/sys/dev/ciss/ciss.c > ?head/sys/i386/conf/GENERIC > ?head/sys/i386/conf/PAE > ?head/sys/ia64/conf/GENERIC > ?head/sys/sparc64/conf/GENERIC > ?head/usr.bin/Makefile > ?head/usr.sbin/Makefile > ?head/usr.sbin/mlxcontrol/interface.c > > Modified: head/share/examples/scsi_target/scsi_cmds.c > ============================================================================== > --- head/share/examples/scsi_target/scsi_cmds.cThu Jan 12 00:05:35 2012(r229996) > +++ head/share/examples/scsi_target/scsi_cmds.cThu Jan 12 00:34:33 2012(r229997) > @@ -328,7 +328,7 @@ tcmd_inquiry(struct ccb_accept_tio *atio > bcopy(&inq_data, ctio->data_ptr, sizeof(inq_data)); > ctio->dxfer_len = inq_data.additional_length + 4; > ctio->dxfer_len = min(ctio->dxfer_len, > - ? ? ?SCSI_CDB6_LEN(inq->length)); > + ? ? ?scsi_2btoul(inq->length)); > ctio->ccb_h.flags |= CAM_DIR_IN | CAM_SEND_STATUS; > ctio->scsi_status = SCSI_STATUS_OK; > } > > Modified: head/sys/amd64/conf/GENERIC > ============================================================================== > --- head/sys/amd64/conf/GENERICThu Jan 12 00:05:35 2012(r229996) > +++ head/sys/amd64/conf/GENERICThu Jan 12 00:34:33 2012(r229997) > @@ -131,7 +131,8 @@ deviceda# Direct Access (disks) > devicesa# Sequential Access (tape etc) > devicecd# CD > devicepass# Passthrough device (direct ATA/SCSI access) > -deviceses# SCSI Environmental Services (and SAF-TE) > +deviceses# Enclosure Services (SES and SAF-TE) > +devicectl# CAM Target Layer > > # RAID controllers interfaced to the SCSI subsystem > deviceamr# AMI MegaRAID > > Added: head/sys/cam/ctl/README.ctl.txt > ============================================================================== > --- /dev/null00:00:00 1970(empty, because file is newly added) > +++ head/sys/cam/ctl/README.ctl.txtThu Jan 12 00:34:33 2012(r229997) > @@ -0,0 +1,449 @@ > +/* $FreeBSD$ */ > + > +CTL - CAM Target Layer Description > + > +Revision 1.4 (December 29th, 2011) > +Ken Merry > + > +Table of Contents: > +================= > + > +Introduction > +Features > +Configuring and Running CTL > +Revision 1.N Changes > +To Do List > +Code Roadmap > +Userland Commands > + > +Introduction: > +============ > + > +CTL is a disk and processor device emulation subsystem originally written > +for Copan Systems under Linux starting in 2003. ?It has been shipping in > +Copan (now SGI) products since 2005. > + > +It was ported to FreeBSD in 2008, and thanks to an agreement between SGI > +(who acquired Copan's assets in 2010) and Spectra Logic in 2010, CTL is > +available under a BSD-style license. ?The intent behind the agreement was > +that Spectra would work to get CTL into the FreeBSD tree. > + > +Features: > +======== > + > + - Disk and processor device emulation. > + - Tagged queueing > + - SCSI task attribute support (ordered, head of queue, simple tags) > + - SCSI implicit command ordering support. ?(e.g. if a read follows a mode > + ? select, the read will be blocked until the mode select completes.) > + - Full task management support (abort, LUN reset, target reset, etc.) > + - Support for multiple ports > + - Support for multiple simultaneous initiators > + - Support for multiple simultaneous backing stores > + - Persistent reservation support > + - Mode sense/select support > + - Error injection support > + - High Availability support (1) > + - All I/O handled in-kernel, no userland context switch overhead. > + > +(1) HA Support is just an API stub, and needs much more to be fully > + ? ?functional. ?See the to-do list below. > + > +Configuring and Running CTL: > +=========================== > + > + - After applying the CTL patchset to your tree, build world and install it > + ? on your target system. > + > + - Add 'device ctl' to your kernel configuration file. > + > + - If you're running with a 8Gb or 4Gb Qlogic FC board, add > + ? 'options ISP_TARGET_MODE' to your kernel config file. ?Keep in mind that > + ? the isp(4) driver can run in target or initiator mode, but not both on > + ? the same machine. ?'device ispfw' or loading the ispfw module is also > + ? recommended. > + > + - Rebuild and install a new kernel. > + > + - Reboot with the new kernel. > + > + - To add a LUN with the RAM disk backend: > + > +ctladm create -b ramdisk -s 10485760000000000000 > +ctladm port -o on > + > + - You should now see the CTL disk LUN through camcontrol devlist: > + > +scbus6 on ctl2cam0 bus 0: > + ? ? ? ? ? ? at scbus6 target 1 lun 0 (da24,pass32) > +<> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? at scbus6 target -1 lun -1 () > + > + ? This is visible through the CTL CAM SIM. ?This allows using CTL without > + ? any physical hardware. ?You should be able to issue any normal SCSI > + ? commands to the device via the pass(4)/da(4) devices. > + > + ? If any target-capable HBAs are in the system (e.g. isp(4)), and have > + ? target mode enabled, you should now also be able to see the CTL LUNs via > + ? that target interface. > + > + ? Note that all CTL LUNs are presented to all frontends. ?There is no > + ? LUN masking, or separate, per-port configuration. > + > + - Note that the ramdisk backend is a "fake" ramdisk. ?That is, it is > + ? backed by a small amount of RAM that is used for all I/O requests. ?This > + ? is useful for performance testing, but not for any data integrity tests. > + > + - To add a LUN with the block/file backend: > + > +truncate -s +1T myfile > +ctladm create -b block -o file=myfile > +ctladm port -o on > + > + - You can also see a list of LUNs and their backends like this: > + > +# ctladm devlist > +LUN Backend ? ? ? Size (Blocks) ? BS Serial Number ? ?Device ID ? ? ? > + ?0 block ? ? ? ? ? ?2147483648 ?512 MYSERIAL ? 0 ? ? MYDEVID ? 0 ? ? > + ?1 block ? ? ? ? ? ?2147483648 ?512 MYSERIAL ? 1 ? ? MYDEVID ? 1 ? ? > + ?2 block ? ? ? ? ? ?2147483648 ?512 MYSERIAL ? 2 ? ? MYDEVID ? 2 ? ? > + ?3 block ? ? ? ? ? ?2147483648 ?512 MYSERIAL ? 3 ? ? MYDEVID ? 3 ? ? > + ?4 block ? ? ? ? ? ?2147483648 ?512 MYSERIAL ? 4 ? ? MYDEVID ? 4 ? ? > + ?5 block ? ? ? ? ? ?2147483648 ?512 MYSERIAL ? 5 ? ? MYDEVID ? 5 ? ? > + ?6 block ? ? ? ? ? ?2147483648 ?512 MYSERIAL ? 6 ? ? MYDEVID ? 6 ? ? > + ?7 block ? ? ? ? ? ?2147483648 ?512 MYSERIAL ? 7 ? ? MYDEVID ? 7 ? ? > + ?8 block ? ? ? ? ? ?2147483648 ?512 MYSERIAL ? 8 ? ? MYDEVID ? 8 ? ? > + ?9 block ? ? ? ? ? ?2147483648 ?512 MYSERIAL ? 9 ? ? MYDEVID ? 9 ? ? > + 10 block ? ? ? ? ? ?2147483648 ?512 MYSERIAL ?10 ? ? MYDEVID ?10 ? ? > + 11 block ? ? ? ? ? ?2147483648 ?512 MYSERIAL ?11 ? ? MYDEVID ?11 ? ? > + > + - You can see the LUN type and backing store for block/file backend LUNs > + ? like this: > + > +# ctladm devlist -v > +LUN Backend ? ? ? Size (Blocks) ? BS Serial Number ? ?Device ID ? ? ? > + ?0 block ? ? ? ? ? ?2147483648 ?512 MYSERIAL ? 0 ? ? MYDEVID ? 0 ? ? > + ? ? ?lun_type=0 > + ? ? ?num_threads=14 > + ? ? ?file=testdisk0 > + ?1 block ? ? ? ? ? ?2147483648 ?512 MYSERIAL ? 1 ? ? MYDEVID ? 1 ? ? > + ? ? ?lun_type=0 > + ? ? ?num_threads=14 > + ? ? ?file=testdisk1 > + ?2 block ? ? ? ? ? ?2147483648 ?512 MYSERIAL ? 2 ? ? MYDEVID ? 2 ? ? > + ? ? ?lun_type=0 > + ? ? ?num_threads=14 > + ? ? ?file=testdisk2 > + ?3 block ? ? ? ? ? ?2147483648 ?512 MYSERIAL ? 3 ? ? MYDEVID ? 3 ? ? > + ? ? ?lun_type=0 > + ? ? ?num_threads=14 > + ? ? ?file=testdisk3 > + ?4 block ? ? ? ? ? ?2147483648 ?512 MYSERIAL ? 4 ? ? MYDEVID ? 4 ? ? > + ? ? ?lun_type=0 > + ? ? ?num_threads=14 > + ? ? ?file=testdisk4 > + ?5 block ? ? ? ? ? ?2147483648 ?512 MYSERIAL ? 5 ? ? MYDEVID ? 5 ? ? > + ? ? ?lun_type=0 > + ? ? ?num_threads=14 > + ? ? ?file=testdisk5 > + ?6 block ? ? ? ? ? ?2147483648 ?512 MYSERIAL ? 6 ? ? MYDEVID ? 6 ? ? > + ? ? ?lun_type=0 > + ? ? ?num_threads=14 > + ? ? ?file=testdisk6 > + ?7 block ? ? ? ? ? ?2147483648 ?512 MYSERIAL ? 7 ? ? MYDEVID ? 7 ? ? > + ? ? ?lun_type=0 > + ? ? ?num_threads=14 > + ? ? ?file=testdisk7 > + ?8 block ? ? ? ? ? ?2147483648 ?512 MYSERIAL ? 8 ? ? MYDEVID ? 8 ? ? > + ? ? ?lun_type=0 > + ? ? ?num_threads=14 > + ? ? ?file=testdisk8 > + ?9 block ? ? ? ? ? ?2147483648 ?512 MYSERIAL ? 9 ? ? MYDEVID ? 9 ? ? > + ? ? ?lun_type=0 > + ? ? ?num_threads=14 > + ? ? ?file=testdisk9 > + 10 ramdisk ? ? ? ? ? ? ? ? ? 0 ? ?0 MYSERIAL ? 0 ? ? MYDEVID ? 0 ? ? > + ? ? ?lun_type=3 > + 11 ramdisk ? ? 204800000000000 ?512 MYSERIAL ? 1 ? ? MYDEVID ? 1 ? ? > + ? ? ?lun_type=0 > + > + > +Revision 1.4 Changes > +==================== > + - Added in the second HA mode (where CTL does the data transfers instead > + ? of having data transfers done below CTL), and abstracted out the Copan > + ? HA API. > + > + - Fixed the phantom device problem in the CTL CAM SIM and improved the > + ? CAM SIM to automatically trigger a rescan when the port is enabled and > + ? disabled. > + > + - Made the number of threads in the block backend configurable via sysctl, > + ? loader tunable and the ctladm command line. ?(You can now specify > + ? -o num_threads=4 when creating a LUN with ctladm create.) > + > + - Fixed some LUN selection issues in ctlstat(8) and allowed for selection > + ? of LUN numbers up to 1023. > + > + - General cleanup. > + > + - This version intended for public release. > + > +Revision 1.3 Changes > +==================== > + - Added descriptor sense support to CTL. ?It can be enabled through the > + ? control mode page (10), but is disabled by default. > + > + - Improved error injection support. ?The number of errors that can be > + ? injected with 'ctladm inject' has been increased, and any arbitrary > + ? sense data may now be injected as well. > + > + - The port infrastructure has been revamped. ?Individual ports and types > + ? of ports may now be enabled and disabled from the command line. ?ctladm > + ? now has the ability to set the WWNN and WWPN for each port. > + > + - The block backend can now send multiple I/Os to backing files. ?Multiple > + ? writes are only allowed for ZFS, but multiple readers are allowed for > + ? any filesystem. > + > + - The block and ramdisk backends now support setting the LUN blocksize. > + ? There are some restrictions when the backing device is a block device, > + ? but otherwise the blocksize may be set to anything. > + > +Revision 1.2 Changes > +==================== > + > + - CTL initialization process has been revamped. ?Instead of using an > + ? ad-hoc method, it is now sequenced through SYSINIT() calls. > + > + - A block/file backend has been added. ?This allows using arbitrary files > + ? or block devices as a backing store. > + > + - The userland LUN configuration interface has been completely rewritten. > + ? Configuration is now done out of band. > + > + - The ctladm(8) command line interface has been revamped, and is now > + ? similar to camcontrol(8). > + > +To Do List: > +========== > + > + - Make CTL buildable as a module. ?Work needs to be done on initialization, > + ? and on freeing resources and LUNs when it is built as a module. > + > + - Use devstat(9) for CTL's statistics collection. ?CTL uses a home-grown > + ? statistics collection system that is similar to devstat(9). ?ctlstat > + ? should be retired in favor of iostat, etc., once aggregation modes are > + ? available in iostat to match the behavior of ctlstat -t and dump modes > + ? are available to match the behavior of ctlstat -d/ctlstat -J. > + > + - ZFS ARC backend for CTL. ?Since ZFS copies all I/O into the ARC > + ? (Adaptive Replacement Cache), running the block/file backend on top of a > + ? ZFS-backed zdev or file will involve an extra set of copies. ?The > + ? optimal solution for backing targets served by CTL with ZFS would be to > + ? allocate buffers out of the ARC directly, and DMA to/from them directly. > + ? That would eliminate an extra data buffer allocation and copy. > + > + - Switch CTL over to using CAM CCBs instead of its own union ctl_io. ?This > + ? will likely require a significant amount of work, but will eliminate > + ? another data structure in the stack, more memory allocations, etc. ?This > + ? will also require changes to the CAM CCB structure to support CTL. > + > + - Full-featured High Availability support. ?The HA API that is in ctl_ha.h > + ? is essentially a renamed version of Copan's HA API. ?There is no > + ? substance to it, but it remains in CTL to show what needs to be done to > + ? implement active/active HA from a CTL standpoint. ?The things that would > + ? need to be done include: > +- A kernel level software API for message passing as well as DMA > + ?between at least two nodes. > +- Hardware support and drivers for inter-node communication. ?This > + ?could be as simples as ethernet hardware and drivers. > +- A "supervisor", or startup framework to control and coordinate > + ?HA startup, failover (going from active/active to single mode), > + ?and failback (going from single mode to active/active). > +- HA support in other components of the stack. ?The goal behind HA > + ?is that one node can fail and another node can seamlessly take > + ?over handling I/O requests. ?This requires support from pretty > + ?much every component in the storage stack, from top to bottom. > + ?CTL is one piece of it, but you also need support in the RAID > + ?stack/filesystem/backing store. ?You also need full configuration > + ?mirroring, and all peer nodes need to be able to talk to the > + ?underlying storage hardware. > + > +Code Roadmap: > +============ > + > +CTL has the concept of pluggable frontend ports and backends. ?All > +frontends and backends can be active at the same time. ?You can have a > +ramdisk-backed LUN present along side a file backed LUN. > + > +ctl.c: > +----- > + > +This is the core of CTL, where all of the command handlers and a lot of > +other things live. ?Yes, it is large. ?It started off small and grew to its > +current size over time. ?Perhaps it can be split into more files at some > +point. > + > +Here is a roadmap of some of the primary functions in ctl.c. ?Starting here > +and following the various leaf functions will show the command flow. > + > +ctl_queue() This is where commands from the frontend ports come > +in. > + > +ctl_queue_sense()This is only used for non-packetized SCSI. ?i.e. > +parallel SCSI prior to U320 and perhaps U160. > + > +ctl_work_thread() This is the primary work thread, and everything gets > +executed from there. > + > +ctl_scsiio_precheck() This where all of the initial checks are done, and I/O > +is either queued for execution or blocked. > + > +ctl_scsiio() This is where the command handler is actually > +executed. ?(See ctl_cmd_table.c for the mapping of > +SCSI opcode to command handler function.) > + > +ctl_done()This is the routine called (or ctl_done_lock()) to > +initiate the command completion process. > + > +ctl_process_done()This is where command completion actually happens. > + > +ctl.h: > +----- > + > +Basic function declarations and data structures. > + > +ctl_backend.c, > +ctl_backend.h: > +------------- > + > +These files define the basic CTL backend API. ?The comments in the header > +explain the API. > + > +ctl_backend_block.c > +ctl_backend_block.h: > +------------------- > + > +The block and file backend. ?This allows for using a disk or a file as the > +backing store for a LUN. ?Multiple threads are started to do I/O to the > +backing device, primarily because the VFS API requires that to get any > +concurrency. > + > +ctl_backend_ramdisk.c: > +--------------------- > + > +A "fake" ramdisk backend. ?It only allocates a small amount of memory to > +act as a source and sink for reads and writes from an initiator. ?Therefore > +it cannot be used for any real data, but it can be used to test for > +throughput. ?It can also be used to test initiators' support for extremely > +large LUNs. > + > +ctl_cmd_table.c: > +--------------- > + > +This is a table with all 256 possible SCSI opcodes, and command handler > +functions defined for supported opcodes. ?It is included in ctl.c. > + > +ctl_debug.h: > +----------- > + > +Simplistic debugging support. > + > +ctl_error.c, > +ctl_error.h: > +----------- > + > +CTL-specific wrappers around the CAM sense building functions. > + > +ctl_frontend.c, > +ctl_frontend.h: > +-------------- > + > +These files define the basic CTL frontend port API. ?The comments in the > +header explain the API. > + > +ctl_frontend_cam_sim.c: > +---------------------- > + > +This is a CTL frontend port that is also a CAM SIM. ?The idea is that this > +frontend allows for using CTL without any target-capable hardware. ?So any > +LUNs you create in CTL are visible via this port. > + > + > +ctl_frontend_internal.c > +ctl_frontend_internal.h: > +----------------------- > + > +This is a frontend port written for Copan to do some system-specific tasks > +that required sending commands into CTL from inside the kernel. ?This isn't > +entirely relevant to FreeBSD in general, but can perhaps be repurposed or > +removed later. > + > +ctl_ha.h: > +-------- > + > +This is a stubbed-out High Availability API. ?See the comments in the > +header and the description of what is needed as far as HA support above. > + > +ctl_io.h: > +-------- > + > +This defines most of the core CTL I/O structures. ?union ctl_io is > +conceptually very similar to CAM's union ccb. ? > + > +ctl_ioctl.h: > +----------- > + > +This defines all ioctls available through the CTL character device, and > +the data structures needed for those ioctls. > + > +ctl_mem_pool.c > +ctl_mem_pool.h: > +-------------- > + > +Generic memory pool implementation. ?This is currently only used by the > +internal frontend. ?The internal frontend can probably be rewritten to use > +UMA zones and this can be removed. > + > +ctl_private.h: > +------------- > + > +Private data structres (e.g. CTL softc) and function prototypes. ?This also > +includes the SCSI vendor and product names used by CTL. > + > +ctl_scsi_all.c > +ctl_scsi_all.h: > +-------------- > + > +CTL wrappers around CAM sense printing functions. > + > +ctl_ser_table.c: > +--------------- > + > +Command serialization table. ?This defines what happens when one type of > +command is followed by another type of command. ?e.g., what do you do when > +you have a mode select followed by a write? ?You block the write until the > +mode select is complete. ?That is defined in this table. > + > +ctl_util.c > +ctl_util.h: > +---------- > + > +CTL utility functions, primarily designed to be used from userland. ?See > +ctladm for the primary consumer of these functions. ?These include CDB > +building functions. > + > +scsi_ctl.c: > +---------- > + > +CAM target peripheral driver and CTL frontend port. ?This is the path into > +CTL for commands from target-capable hardware/SIMs. > + > +Userland Commands: > +================= > + > +ctladm(8) fills a role similar to camcontrol(8). ?It allow configuring LUNs, > +issuing commands, injecting errors and various other control functions. > + > +ctlstat(8) fills a role similar to iostat(8). ?It reports I/O statistics > +for CTL. > > Added: head/sys/cam/ctl/ctl.c > ============================================================================== > --- /dev/null00:00:00 1970(empty, because file is newly added) > +++ head/sys/cam/ctl/ctl.cThu Jan 12 00:34:33 2012(r229997) > @@ -0,0 +1,13082 @@ > +/*- > + * Copyright (c) 2003-2009 Silicon Graphics International Corp. > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * ? ?notice, this list of conditions, and the following disclaimer, > + * ? ?without modification. > + * 2. Redistributions in binary form must reproduce at minimum a disclaimer > + * ? ?substantially similar to the "NO WARRANTY" disclaimer below > + * ? ?("Disclaimer") and any redistribution must be conditioned upon > + * ? ?including a substantially similar Disclaimer requirement for further > + * ? ?binary redistribution. > + * > + * NO WARRANTY > + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS > + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT > + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR > + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT > + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. > + * > + * $Id: //depot/users/kenm/FreeBSD-test2/sys/cam/ctl/ctl.c#8 $ > + */ > +/* > + * CAM Target Layer, a SCSI device emulation subsystem. > + * > + * Author: Ken Merry > + */ > + > +#define _CTL_C > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +struct ctl_softc *control_softc = NULL; > + > +/* > + * The default is to run with CTL_DONE_THREAD turned on. ?Completed > + * transactions are queued for processing by the CTL work thread. ?When > + * CTL_DONE_THREAD is not defined, completed transactions are processed in > + * the caller's context. > + */ > +#define CTL_DONE_THREAD > + > +/* > + * ?* Use the serial number and device ID provided by the backend, rather than > + * ? * making up our own. > + * ? ?*/ > +#define CTL_USE_BACKEND_SN > + > +/* > + * Size and alignment macros needed for Copan-specific HA hardware. ?These > + * can go away when the HA code is re-written, and uses busdma for any > + * hardware. > + */ > +#defineCTL_ALIGN_8B(target, source, type)\ > +if (((uint32_t)source & 0x7) != 0)\ > +target = (type)(source + (0x8 - ((uint32_t)source & 0x7)));\ > +else\ > +target = (type)source; > + > +#defineCTL_SIZE_8B(target, size)\ > +if ((size & 0x7) != 0)\ > +target = size + (0x8 - (size & 0x7));\ > +else\ > +target = size; > + > +#define CTL_ALIGN_8B_MARGIN16 > + > +/* > + * Template mode pages. > + */ > + > +/* > + * Note that these are default values only. ?The actual values will be > + * filled in when the user does a mode sense. > + */ > +static struct copan_power_subpage power_page_default = { > +/*page_code*/ PWR_PAGE_CODE | SMPH_SPF, > +/*subpage*/ PWR_SUBPAGE_CODE, > +/*page_length*/ {(sizeof(struct copan_power_subpage) - 4) & 0xff00, > + (sizeof(struct copan_power_subpage) - 4) & 0x00ff}, > +/*page_version*/ PWR_VERSION, > +/* total_luns */ 26, > +/* max_active_luns*/ PWR_DFLT_MAX_LUNS, > +/*reserved*/ {0, 0, 0, 0, 0, 0, 0, 0, 0, > + ? ? ?0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > + ? ? ?0, 0, 0, 0, 0, 0} > +}; > + > +static struct copan_power_subpage power_page_changeable = { > +/*page_code*/ PWR_PAGE_CODE | SMPH_SPF, > +/*subpage*/ PWR_SUBPAGE_CODE, > +/*page_length*/ {(sizeof(struct copan_power_subpage) - 4) & 0xff00, > + (sizeof(struct copan_power_subpage) - 4) & 0x00ff}, > +/*page_version*/ 0, > +/* total_luns */ 0, > +/* max_active_luns*/ 0, > +/*reserved*/ {0, 0, 0, 0, 0, 0, 0, 0, 0, > + ? ? ?0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > + ? ? ?0, 0, 0, 0, 0, 0} > +}; > + > +static struct copan_aps_subpage aps_page_default = { > +APS_PAGE_CODE | SMPH_SPF, //page_code > +APS_SUBPAGE_CODE, //subpage > +{(sizeof(struct copan_aps_subpage) - 4) & 0xff00, > + (sizeof(struct copan_aps_subpage) - 4) & 0x00ff}, //page_length > +APS_VERSION, //page_version > +0, //lock_active > +{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > +0, 0, 0, 0, 0} //reserved > +}; > + > +static struct copan_aps_subpage aps_page_changeable = { > +APS_PAGE_CODE | SMPH_SPF, //page_code > +APS_SUBPAGE_CODE, //subpage > +{(sizeof(struct copan_aps_subpage) - 4) & 0xff00, > + (sizeof(struct copan_aps_subpage) - 4) & 0x00ff}, //page_length > +0, //page_version > +0, //lock_active > +{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > +0, 0, 0, 0, 0} //reserved > +}; > + > +static struct copan_debugconf_subpage debugconf_page_default = { > +DBGCNF_PAGE_CODE | SMPH_SPF,/* page_code */ > +DBGCNF_SUBPAGE_CODE,/* subpage */ > +{(sizeof(struct copan_debugconf_subpage) - 4) >> 8, > + (sizeof(struct copan_debugconf_subpage) - 4) >> 0}, /* page_length */ > +DBGCNF_VERSION,/* page_version */ > +{CTL_TIME_IO_DEFAULT_SECS>>8, > + CTL_TIME_IO_DEFAULT_SECS>>0},/* ctl_time_io_secs */ > +}; > + > +static struct copan_debugconf_subpage debugconf_page_changeable = { > +DBGCNF_PAGE_CODE | SMPH_SPF,/* page_code */ > +DBGCNF_SUBPAGE_CODE,/* subpage */ > +{(sizeof(struct copan_debugconf_subpage) - 4) >> 8, > + (sizeof(struct copan_debugconf_subpage) - 4) >> 0}, /* page_length */ > +0,/* page_version */ > +{0xff,0xff},/* ctl_time_io_secs */ > +}; > + > +static struct scsi_format_page format_page_default = { > +/*page_code*/SMS_FORMAT_DEVICE_PAGE, > +/*page_length*/sizeof(struct scsi_format_page) - 2, > +/*tracks_per_zone*/ {0, 0}, > +/*alt_sectors_per_zone*/ {0, 0}, > +/*alt_tracks_per_zone*/ {0, 0}, > +/*alt_tracks_per_lun*/ {0, 0}, > +/*sectors_per_track*/ {(CTL_DEFAULT_SECTORS_PER_TRACK >> 8) & 0xff, > + ? ? ? ?CTL_DEFAULT_SECTORS_PER_TRACK & 0xff}, > +/*bytes_per_sector*/ {0, 0}, > +/*interleave*/ {0, 0}, > +/*track_skew*/ {0, 0}, > +/*cylinder_skew*/ {0, 0}, > +/*flags*/ SFP_HSEC, > +/*reserved*/ {0, 0, 0} > +}; > + > +static struct scsi_format_page format_page_changeable = { > +/*page_code*/SMS_FORMAT_DEVICE_PAGE, > +/*page_length*/sizeof(struct scsi_format_page) - 2, > +/*tracks_per_zone*/ {0, 0}, > +/*alt_sectors_per_zone*/ {0, 0}, > +/*alt_tracks_per_zone*/ {0, 0}, > +/*alt_tracks_per_lun*/ {0, 0}, > +/*sectors_per_track*/ {0, 0}, > +/*bytes_per_sector*/ {0, 0}, > +/*interleave*/ {0, 0}, > +/*track_skew*/ {0, 0}, > +/*cylinder_skew*/ {0, 0}, > +/*flags*/ 0, > +/*reserved*/ {0, 0, 0} > +}; > + > +static struct scsi_rigid_disk_page rigid_disk_page_default = { > +/*page_code*/SMS_RIGID_DISK_PAGE, > +/*page_length*/sizeof(struct scsi_rigid_disk_page) - 2, > +/*cylinders*/ {0, 0, 0}, > +/*heads*/ CTL_DEFAULT_HEADS, > +/*start_write_precomp*/ {0, 0, 0}, > +/*start_reduced_current*/ {0, 0, 0}, > +/*step_rate*/ {0, 0}, > +/*landing_zone_cylinder*/ {0, 0, 0}, > +/*rpl*/ SRDP_RPL_DISABLED, > +/*rotational_offset*/ 0, > +/*reserved1*/ 0, > +/*rotation_rate*/ {(CTL_DEFAULT_ROTATION_RATE >> 8) & 0xff, > + ? CTL_DEFAULT_ROTATION_RATE & 0xff}, > +/*reserved2*/ {0, 0} > +}; > + > +static struct scsi_rigid_disk_page rigid_disk_page_changeable = { > +/*page_code*/SMS_RIGID_DISK_PAGE, > +/*page_length*/sizeof(struct scsi_rigid_disk_page) - 2, > +/*cylinders*/ {0, 0, 0}, > +/*heads*/ 0, > +/*start_write_precomp*/ {0, 0, 0}, > +/*start_reduced_current*/ {0, 0, 0}, > +/*step_rate*/ {0, 0}, > +/*landing_zone_cylinder*/ {0, 0, 0}, > +/*rpl*/ 0, > +/*rotational_offset*/ 0, > +/*reserved1*/ 0, > +/*rotation_rate*/ {0, 0}, > +/*reserved2*/ {0, 0} > +}; > + > +static struct scsi_caching_page caching_page_default = { > +/*page_code*/SMS_CACHING_PAGE, > +/*page_length*/sizeof(struct scsi_caching_page) - 2, > +/*flags1*/ SCP_DISC | SCP_WCE, > +/*ret_priority*/ 0, > +/*disable_pf_transfer_len*/ {0xff, 0xff}, > +/*min_prefetch*/ {0, 0}, > +/*max_prefetch*/ {0xff, 0xff}, > +/*max_pf_ceiling*/ {0xff, 0xff}, > +/*flags2*/ 0, > +/*cache_segments*/ 0, > +/*cache_seg_size*/ {0, 0}, > +/*reserved*/ 0, > +/*non_cache_seg_size*/ {0, 0, 0} > +}; > + > +static struct scsi_caching_page caching_page_changeable = { > +/*page_code*/SMS_CACHING_PAGE, > +/*page_length*/sizeof(struct scsi_caching_page) - 2, > +/*flags1*/ 0, > +/*ret_priority*/ 0, > +/*disable_pf_transfer_len*/ {0, 0}, > +/*min_prefetch*/ {0, 0}, > +/*max_prefetch*/ {0, 0}, > +/*max_pf_ceiling*/ {0, 0}, > +/*flags2*/ 0, > +/*cache_segments*/ 0, > +/*cache_seg_size*/ {0, 0}, > +/*reserved*/ 0, > +/*non_cache_seg_size*/ {0, 0, 0} > +}; > + > +static struct scsi_control_page control_page_default = { > +/*page_code*/SMS_CONTROL_MODE_PAGE, > +/*page_length*/sizeof(struct scsi_control_page) - 2, > +/*rlec*/0, > +/*queue_flags*/0, > +/*eca_and_aen*/0, > +/*reserved*/0, > +/*aen_holdoff_period*/{0, 0} > +}; > + > +static struct scsi_control_page control_page_changeable = { > +/*page_code*/SMS_CONTROL_MODE_PAGE, > +/*page_length*/sizeof(struct scsi_control_page) - 2, > +/*rlec*/SCP_DSENSE, > +/*queue_flags*/0, > +/*eca_and_aen*/0, > +/*reserved*/0, > +/*aen_holdoff_period*/{0, 0} > +}; > + > +SYSCTL_NODE(_kern_cam, OID_AUTO, ctl, CTLFLAG_RD, 0, "CAM Target Layer"); > + > +/* > + * XXX KDM move these into the softc. > + */ > +static int rcv_sync_msg; > +static int persis_offset; > +static uint8_t ctl_pause_rtr; > +static int ? ? ctl_is_single; > +static int ? ? index_to_aps_page; > + > + > +/* > + * Serial number (0x80), device id (0x83), and supported pages (0x00) > + */ > +#define SCSI_EVPD_NUM_SUPPORTED_PAGES3 > + > +static void ctl_isc_event_handler(ctl_ha_channel chanel, ctl_ha_event event, > + ?int param); > +static void ctl_copy_sense_data(union ctl_ha_msg *src, union ctl_io *dest); > +static void ctl_init(void); > +void ctl_shutdown(void); > +static int ctl_open(struct cdev *dev, int flags, int fmt, struct thread *td); > +static int ctl_close(struct cdev *dev, int flags, int fmt, struct thread *td); > +static void ctl_ioctl_online(void *arg); > +static void ctl_ioctl_offline(void *arg); > +static int ctl_ioctl_targ_enable(void *arg, struct ctl_id targ_id); > +static int ctl_ioctl_targ_disable(void *arg, struct ctl_id targ_id); > +static int ctl_ioctl_lun_enable(void *arg, struct ctl_id targ_id, int lun_id); > +static int ctl_ioctl_lun_disable(void *arg, struct ctl_id targ_id, int lun_id); > +static int ctl_ioctl_do_datamove(struct ctl_scsiio *ctsio); > +static int ctl_serialize_other_sc_cmd(struct ctl_scsiio *ctsio, int have_lock); > +static int ctl_ioctl_submit_wait(union ctl_io *io); > +static void ctl_ioctl_datamove(union ctl_io *io); > +static void ctl_ioctl_done(union ctl_io *io); > +static void ctl_ioctl_hard_startstop_callback(void *arg, > + ? ? ?struct cfi_metatask *metatask); > +static void ctl_ioctl_bbrread_callback(void *arg,struct cfi_metatask *metatask); > +static int ctl_ioctl_fill_ooa(struct ctl_lun *lun, uint32_t *cur_fill_num, > + ? ? ?struct ctl_ooa *ooa_hdr); > +static int ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, > + ? ? struct thread *td); > +uint32_t ctl_get_resindex(struct ctl_nexus *nexus); > +uint32_t ctl_port_idx(int port_num); > +#ifdef unused > +static union ctl_io *ctl_malloc_io(ctl_io_type io_type, uint32_t targ_port, > + ? uint32_t targ_target, uint32_t targ_lun, > + ? int can_wait); > +static void ctl_kfree_io(union ctl_io *io); > +#endif /* unused */ > +static void ctl_free_io_internal(union ctl_io *io, int have_lock); > +static int ctl_alloc_lun(struct ctl_softc *ctl_softc, struct ctl_lun *lun, > + struct ctl_be_lun *be_lun, struct ctl_id target_id); > +static int ctl_free_lun(struct ctl_lun *lun); > +static void ctl_create_lun(struct ctl_be_lun *be_lun); > +/** > +static void ctl_failover_change_pages(struct ctl_softc *softc, > + ? ? ?struct ctl_scsiio *ctsio, int master); > +**/ > + > +static int ctl_do_mode_select(union ctl_io *io); > +static int ctl_pro_preempt(struct ctl_softc *softc, struct ctl_lun *lun, > + ? uint64_t res_key, uint64_t sa_res_key, > + ? uint8_t type, uint32_t residx, > + ? struct ctl_scsiio *ctsio, > + ? struct scsi_per_res_out *cdb, > + ? struct scsi_per_res_out_parms* param); > +static void ctl_pro_preempt_other(struct ctl_lun *lun, > + ?union ctl_ha_msg *msg); > +static void ctl_hndl_per_res_out_on_other_sc(union ctl_ha_msg *msg); > +static int ctl_inquiry_evpd_supported(struct ctl_scsiio *ctsio, int alloc_len); > +static int ctl_inquiry_evpd_serial(struct ctl_scsiio *ctsio, int alloc_len); > +static int ctl_inquiry_evpd_devid(struct ctl_scsiio *ctsio, int alloc_len); > +static int ctl_inquiry_evpd(struct ctl_scsiio *ctsio); > +static int ctl_inquiry_std(struct ctl_scsiio *ctsio); > +static int ctl_get_lba_len(union ctl_io *io, uint64_t *lba, uint32_t *len); > +static ctl_action ctl_extent_check(union ctl_io *io1, union ctl_io *io2); > +static ctl_action ctl_check_for_blockage(union ctl_io *pending_io, > + union ctl_io *ooa_io); > +static ctl_action ctl_check_ooa(struct ctl_lun *lun, union ctl_io *pending_io, > +union ctl_io *starting_io); > +static int ctl_check_blocked(struct ctl_lun *lun); > +static int ctl_scsiio_lun_check(struct ctl_softc *ctl_softc, > +struct ctl_lun *lun, > +struct ctl_cmd_entry *entry, > +struct ctl_scsiio *ctsio); > +//static int ctl_check_rtr(union ctl_io *pending_io, struct ctl_softc *softc); > +static void ctl_failover(void); > +static int ctl_scsiio_precheck(struct ctl_softc *ctl_softc, > + ? ? ? struct ctl_scsiio *ctsio); > +static int ctl_scsiio(struct ctl_scsiio *ctsio); > + > +static int ctl_bus_reset(struct ctl_softc *ctl_softc, union ctl_io *io); > +static int ctl_target_reset(struct ctl_softc *ctl_softc, union ctl_io *io, > + ? ?ctl_ua_type ua_type); > +static int ctl_lun_reset(struct ctl_lun *lun, union ctl_io *io, > + ctl_ua_type ua_type); > +static int ctl_abort_task(union ctl_io *io); > +static void ctl_run_task_queue(struct ctl_softc *ctl_softc); > +#ifdef CTL_IO_DELAY > +static void ctl_datamove_timer_wakeup(void *arg); > +static void ctl_done_timer_wakeup(void *arg); > +#endif /* CTL_IO_DELAY */ > + > +static void ctl_send_datamove_done(union ctl_io *io, int have_lock); > +static void ctl_datamove_remote_write_cb(struct ctl_ha_dt_req *rq); > +static int ctl_datamove_remote_dm_write_cb(union ctl_io *io); > +static void ctl_datamove_remote_write(union ctl_io *io); > +static int ctl_datamove_remote_dm_read_cb(union ctl_io *io); > +static void ctl_datamove_remote_read_cb(struct ctl_ha_dt_req *rq); > +static int ctl_datamove_remote_sgl_setup(union ctl_io *io); > +static int ctl_datamove_remote_xfer(union ctl_io *io, unsigned command, > + ? ?ctl_ha_dt_cb callback); > +static void ctl_datamove_remote_read(union ctl_io *io); > +static void ctl_datamove_remote(union ctl_io *io); > +static int ctl_process_done(union ctl_io *io, int have_lock); > +static void ctl_work_thread(void *arg); > + > +/* > + * Load the serialization table. ?This isn't very pretty, but is probably > + * the easiest way to do it. > + */ > +#include "ctl_ser_table.c" > + > +/* > + * We only need to define open, close and ioctl routines for this driver. > + */ > +static struct cdevsw ctl_cdevsw = { > +.d_version =D_VERSION, > +.d_flags =0, > +.d_open =ctl_open, > +.d_close =ctl_close, > +.d_ioctl =ctl_ioctl, > +.d_name ="ctl", > +}; > + > + > +MALLOC_DEFINE(M_CTL, "ctlmem", "Memory used for CTL"); > + > +/* > + * If we have the CAM SIM, we may or may not have another SIM that will > + * cause CTL to get initialized. ?If not, we need to initialize it. > + */ > +SYSINIT(ctl_init, SI_SUB_CONFIGURE, SI_ORDER_THIRD, ctl_init, NULL); > + > +static void > +ctl_isc_handler_finish_xfer(struct ctl_softc *ctl_softc, > + ? ?union ctl_ha_msg *msg_info) > +{ > +struct ctl_scsiio *ctsio; > + > +if (msg_info->hdr.original_sc == NULL) { > +printf("%s: original_sc == NULL!\n", __func__); > +/* XXX KDM now what? */ > +return; > +} > + > +ctsio = &msg_info->hdr.original_sc->scsiio; > +ctsio->io_hdr.flags |= CTL_FLAG_IO_ACTIVE; > +ctsio->io_hdr.msg_type = CTL_MSG_FINISH_IO; > +ctsio->io_hdr.status = msg_info->hdr.status; > +ctsio->scsi_status = msg_info->scsi.scsi_status; > +ctsio->sense_len = msg_info->scsi.sense_len; > +ctsio->sense_residual = msg_info->scsi.sense_residual; > +ctsio->residual = msg_info->scsi.residual; > +memcpy(&ctsio->sense_data, &msg_info->scsi.sense_data, > + ? ? ? sizeof(ctsio->sense_data)); > +memcpy(&ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN].bytes, > + ? ? ? &msg_info->scsi.lbalen, sizeof(msg_info->scsi.lbalen));; > +STAILQ_INSERT_TAIL(&ctl_softc->isc_queue, &ctsio->io_hdr, links); > +ctl_wakeup_thread(); > +} > + > +static void > +ctl_isc_handler_finish_ser_only(struct ctl_softc *ctl_softc, > +union ctl_ha_msg *msg_info) > +{ > +struct ctl_scsiio *ctsio; > + > +if (msg_info->hdr.serializing_sc == NULL) { > +printf("%s: serializing_sc == NULL!\n", __func__); > +/* XXX KDM now what? */ > +return; > +} > + > +ctsio = &msg_info->hdr.serializing_sc->scsiio; > +#if 0 > +/* > + * Attempt to catch the situation where an I/O has > + * been freed, and we're using it again. > + */ > +if (ctsio->io_hdr.io_type == 0xff) { > +union ctl_io *tmp_io; > +tmp_io = (union ctl_io *)ctsio; > +printf("%s: %p use after free!\n", __func__, > + ? ? ? ctsio); > +printf("%s: type %d msg %d cdb %x iptl: " > + ? ? ? "%d:%d:%d:%d tag 0x%04x " > + ? ? ? "flag %#x status %x\n", > +__func__, > +tmp_io->io_hdr.io_type, > +tmp_io->io_hdr.msg_type, > +tmp_io->scsiio.cdb[0], > +tmp_io->io_hdr.nexus.initid.id, > +tmp_io->io_hdr.nexus.targ_port, > +tmp_io->io_hdr.nexus.targ_target.id, > +tmp_io->io_hdr.nexus.targ_lun, > +(tmp_io->io_hdr.io_type == > +CTL_IO_TASK) ? > +tmp_io->taskio.tag_num : > +tmp_io->scsiio.tag_num, > + ? ? ? ?tmp_io->io_hdr.flags, > +tmp_io->io_hdr.status); > +} > +#endif > +ctsio->io_hdr.msg_type = CTL_MSG_FINISH_IO; > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** -- Kenneth Merry ken@FreeBSD.ORG From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 14:53:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7AE5106566C; Thu, 12 Jan 2012 14:53:08 +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 C1C1D8FC08; Thu, 12 Jan 2012 14:53:08 +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 q0CEr887014251; Thu, 12 Jan 2012 14:53:08 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0CEr8Jh014248; Thu, 12 Jan 2012 14:53:08 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201201121453.q0CEr8Jh014248@svn.freebsd.org> From: Alexander Motin Date: Thu, 12 Jan 2012 14:53:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230014 - stable/9/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 14:53:08 -0000 Author: mav Date: Thu Jan 12 14:53:08 2012 New Revision: 230014 URL: http://svn.freebsd.org/changeset/base/230014 Log: MFC r228808, r228847, 229395: r228808, r228847: Make cd driver to handle Audio CDs, reporting their 2352 bytes sectors to GEOM and using READ CD command for reading data, same as acd driver does. Audio CDs identified by checking respective bit of the control field of the first track in TOC. 229395: Add support for CDRIOCGETBLOCKSIZE and CDRIOCSETBLOCKSIZE IOCTLs to control sector size same as acd driver does. Together with r228808 and r228847 this allows existing multimedia/vlc to play Audio CDs via CAM cd driver. PR: ports/162190 Sponsored by: iXsystems, Inc. Modified: stable/9/sys/cam/scsi/scsi_all.h stable/9/sys/cam/scsi/scsi_cd.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/9/sys/cam/scsi/scsi_all.h Thu Jan 12 14:44:14 2012 (r230013) +++ stable/9/sys/cam/scsi/scsi_all.h Thu Jan 12 14:53:08 2012 (r230014) @@ -932,6 +932,7 @@ struct ata_pass_16 { #define WRITE_12 0xAA #define WRITE_VERIFY_12 0xAE #define READ_ELEMENT_STATUS 0xB8 +#define READ_CD 0xBE /* Maintenance In Service Action Codes */ #define REPORT_IDENTIFYING_INFRMATION 0x05 Modified: stable/9/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_cd.c Thu Jan 12 14:44:14 2012 (r230013) +++ stable/9/sys/cam/scsi/scsi_cd.c Thu Jan 12 14:53:08 2012 (r230014) @@ -1482,6 +1482,14 @@ cdstart(struct cam_periph *periph, union /* dxfer_len */ bp->bio_bcount, /* sense_len */ SSD_FULL_SIZE, /* timeout */ 30000); + /* Use READ CD command for audio tracks. */ + if (softc->params.blksize == 2352) { + start_ccb->csio.cdb_io.cdb_bytes[0] = READ_CD; + start_ccb->csio.cdb_io.cdb_bytes[9] = 0xf8; + start_ccb->csio.cdb_io.cdb_bytes[10] = 0; + start_ccb->csio.cdb_io.cdb_bytes[11] = 0; + start_ccb->csio.cdb_len = 12; + } start_ccb->ccb_h.ccb_state = CD_CCB_BUFFER_IO; @@ -2676,6 +2684,16 @@ cdioctl(struct disk *dp, u_long cmd, voi error = cdsetspeed(periph, CDR_MAX_SPEED, *(u_int32_t *)addr); cam_periph_unlock(periph); break; + case CDRIOCGETBLOCKSIZE: + *(int *)addr = softc->params.blksize; + break; + case CDRIOCSETBLOCKSIZE: + if (*(int *)addr <= 0) { + error = EINVAL; + break; + } + softc->disk->d_sectorsize = softc->params.blksize = *(int *)addr; + break; case DVDIOCSENDKEY: case DVDIOCREPORTKEY: { struct dvd_authinfo *authinfo; @@ -2879,6 +2897,13 @@ cdcheckmedia(struct cam_periph *periph) softc->flags |= CD_FLAG_VALID_TOC; + /* If the first track is audio, correct sector size. */ + if ((softc->toc.entries[0].control & 4) == 0) { + softc->disk->d_sectorsize = softc->params.blksize = 2352; + softc->disk->d_mediasize = + (off_t)softc->params.blksize * softc->params.disksize; + } + bailout: /* From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 14:54:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 288D11065670; Thu, 12 Jan 2012 14:54:34 +0000 (UTC) (envelope-from rea@codelabs.ru) Received: from 0.mx.codelabs.ru (0.mx.codelabs.ru [144.206.177.45]) by mx1.freebsd.org (Postfix) with ESMTP id BE08F8FC0C; Thu, 12 Jan 2012 14:54:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=codelabs.ru; s=two; h=Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=5V7M0v6mliVOqD1FteA6ERCN/GPDrihFxJ3nMrNpI98=; b=cdA07invHR8i795NGlzahscJAu3xfhILv+mA+CmCzgsnRLJatzlnA2yGkgdkq2fakUN1E7UFRvwvzeTgVpvd6wle0MWIxuznCtm8NXHf/7J2RoeT9QEqMP3oUXFr1+VjoBcY21U5kR6RJgFcS9HbDfDE58g6tFWBYLKH71rLR/QLupDf4h6UotBzq7v4V+F2fhIHEb+QIizWMbD/OV9WvsyF5QWN9pg2zgoD3t9llprhkmGA8IJDPKKAF535izhBRgiR4TObQy37YjcM7s1zVDQhqYoXtjV7XwUrLFOZ/DOYktJ0rZUHrBbQy7Vr/+UOBEEapQ0u1RzCtKtJsxoYSQ==; Received: from void.codelabs.ru (void.codelabs.ru [144.206.177.25]) by 0.mx.codelabs.ru with esmtpsa (TLSv1:AES256-SHA:256) id 1RlLkC-0004CP-5H; Thu, 12 Jan 2012 17:35:08 +0300 Date: Thu, 12 Jan 2012 18:35:05 +0400 From: Eygene Ryabinkin To: John Baldwin Message-ID: References: <201201120648.q0C6mBio096662@svn.freebsd.org> <201201120748.28564.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="NDin8bjvE/0mNLFQ" Content-Disposition: inline In-Reply-To: <201201120748.28564.jhb@freebsd.org> Sender: rea@codelabs.ru Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230007 - in head: etc etc/rc.d share/man/man8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 14:54:34 -0000 --NDin8bjvE/0mNLFQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Thu, Jan 12, 2012 at 07:48:28AM -0500, John Baldwin wrote: > Alternatively, devd could have invoked a wrapper script that only > ran /etc/rc.d/dhclient if dhcpif was true for the interface. All > other uses of /etc/rc.d/dhclient in our system scripts are > conditional on that check. True, and it was suggested by Doug Barton. But why bother when the 'quiet' keyword is reserved for such cases? --=20 Eygene Ryabinkin ,,,^..^,,, [ Life's unfair - but root password helps! | codelabs.ru ] [ 82FE 06BC D497 C0DE 49EC 4FF0 16AF 9EAE 8152 ECFB | freebsd.org ] --NDin8bjvE/0mNLFQ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iF4EABEIAAYFAk8O75kACgkQFq+eroFS7PsQJgD/VtUhKGjf0PiXeK3/kC8+KvJs 8eNko+Qk99JO4VEPSgcA/1Y2llUCSeOVJJEMv8JmIjRnrSqeqU+DT9XCIb74JgS3 =M6pu -----END PGP SIGNATURE----- --NDin8bjvE/0mNLFQ-- From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 15:02:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CC921065678; Thu, 12 Jan 2012 15:02:52 +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 F00838FC19; Thu, 12 Jan 2012 15:02: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 q0CF2pJV014637; Thu, 12 Jan 2012 15:02:51 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0CF2pwg014634; Thu, 12 Jan 2012 15:02:51 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201201121502.q0CF2pwg014634@svn.freebsd.org> From: Alexander Motin Date: Thu, 12 Jan 2012 15:02:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230015 - stable/8/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 15:02:52 -0000 Author: mav Date: Thu Jan 12 15:02:51 2012 New Revision: 230015 URL: http://svn.freebsd.org/changeset/base/230015 Log: MFC r228808, r228847, 229395: r228808, r228847: Make cd driver to handle Audio CDs, reporting their 2352 bytes sectors to GEOM and using READ CD command for reading data, same as acd driver does. Audio CDs identified by checking respective bit of the control field of the first track in TOC. 229395: Add support for CDRIOCGETBLOCKSIZE and CDRIOCSETBLOCKSIZE IOCTLs to control sector size same as acd driver does. Together with r228808 and r228847 this allows existing multimedia/vlc to play Audio CDs via CAM cd driver. PR: ports/162190 Sponsored by: iXsystems, Inc. Modified: stable/8/sys/cam/scsi/scsi_all.h stable/8/sys/cam/scsi/scsi_cd.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_all.h ============================================================================== --- stable/8/sys/cam/scsi/scsi_all.h Thu Jan 12 14:53:08 2012 (r230014) +++ stable/8/sys/cam/scsi/scsi_all.h Thu Jan 12 15:02:51 2012 (r230015) @@ -611,6 +611,7 @@ struct ata_pass_16 { #define READ_12 0xA8 #define WRITE_12 0xAA #define READ_ELEMENT_STATUS 0xB8 +#define READ_CD 0xBE /* Maintenance In Service Action Codes */ #define REPORT_IDENTIFYING_INFRMATION 0x05 Modified: stable/8/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_cd.c Thu Jan 12 14:53:08 2012 (r230014) +++ stable/8/sys/cam/scsi/scsi_cd.c Thu Jan 12 15:02:51 2012 (r230015) @@ -1475,6 +1475,14 @@ cdstart(struct cam_periph *periph, union /* dxfer_len */ bp->bio_bcount, /* sense_len */ SSD_FULL_SIZE, /* timeout */ 30000); + /* Use READ CD command for audio tracks. */ + if (softc->params.blksize == 2352) { + start_ccb->csio.cdb_io.cdb_bytes[0] = READ_CD; + start_ccb->csio.cdb_io.cdb_bytes[9] = 0xf8; + start_ccb->csio.cdb_io.cdb_bytes[10] = 0; + start_ccb->csio.cdb_io.cdb_bytes[11] = 0; + start_ccb->csio.cdb_len = 12; + } start_ccb->ccb_h.ccb_state = CD_CCB_BUFFER_IO; @@ -2668,6 +2676,16 @@ cdioctl(struct disk *dp, u_long cmd, voi error = cdsetspeed(periph, CDR_MAX_SPEED, *(u_int32_t *)addr); cam_periph_unlock(periph); break; + case CDRIOCGETBLOCKSIZE: + *(int *)addr = softc->params.blksize; + break; + case CDRIOCSETBLOCKSIZE: + if (*(int *)addr <= 0) { + error = EINVAL; + break; + } + softc->disk->d_sectorsize = softc->params.blksize = *(int *)addr; + break; case DVDIOCSENDKEY: case DVDIOCREPORTKEY: { struct dvd_authinfo *authinfo; @@ -2871,6 +2889,13 @@ cdcheckmedia(struct cam_periph *periph) softc->flags |= CD_FLAG_VALID_TOC; + /* If the first track is audio, correct sector size. */ + if ((softc->toc.entries[0].control & 4) == 0) { + softc->disk->d_sectorsize = softc->params.blksize = 2352; + softc->disk->d_mediasize = + (off_t)softc->params.blksize * softc->params.disksize; + } + bailout: /* From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 15:03:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9CC21065670 for ; Thu, 12 Jan 2012 15:03:38 +0000 (UTC) (envelope-from pfg@freebsd.org) Received: from nm16.bullet.mail.sp2.yahoo.com (nm16.bullet.mail.sp2.yahoo.com [98.139.91.86]) by mx1.freebsd.org (Postfix) with SMTP id ACAF68FC24 for ; Thu, 12 Jan 2012 15:03:38 +0000 (UTC) Received: from [98.139.91.62] by nm16.bullet.mail.sp2.yahoo.com with NNFMP; 12 Jan 2012 15:03:38 -0000 Received: from [98.139.91.55] by tm2.bullet.mail.sp2.yahoo.com with NNFMP; 12 Jan 2012 15:03:38 -0000 Received: from [127.0.0.1] by omp1055.mail.sp2.yahoo.com with NNFMP; 12 Jan 2012 15:03:38 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 249495.3945.bm@omp1055.mail.sp2.yahoo.com Received: (qmail 2149 invoked by uid 60001); 12 Jan 2012 15:03:37 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1326380617; bh=L6oypaRGMO36Sz0kdih+wE1FNO35vbPcsnRz1QInTuw=; h=X-YMail-OSG:Received:X-RocketYMMF:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=TMNUZPkuWdhi356Tno4GxIkPEGB4Nq0/I30KuV465Gt/BP/QoBZIhjeWCHgZWs8RkTMcF5FlbvoOxuvV8jp+zS3Ij+nYJiV3gCXWq7iolW4nckuzE45Er5pmLNDS8rEyYdzQUONZw4nCtk9HwEVSq5ZAgL+QIv5iifkBfoF45DM= X-YMail-OSG: a5Hp83IVM1kA8szzSONljVUCBNZaDxgNOpiW2YkgoCGNE5U JkRQrB_G8tZpwGVXEmk9RhASLcYgVtNLINphA92IYevi.qgXkMI6tEQTH2xH Lb1gdKf2CZRknBhn8kcSfT_7Z.tx0jJBw6NCpb0OTjL3fvQ9UN8EgJPjU9jh j9S4B6hOjE3Sh6e1bBZOGGwRHWTpdnr_WqGdY28NaxWpdx._2QC2vHUj_gdD _me5oZa3n0a6xohnWHWjgv5G_mpen0Oku6ATIAPT6fljITeG6mLRMdKykykY cmC1GmHyEuEhiAHa0sI9S65CbEeWdM5BcIHwrd9_ymKJtw4QMx4dfIzDFB71 Y8DUK2_axKrprKlFq7ifG4_Mz5IMZMIoh4BYJfAbiTBLh_YKlB.yH..H9Iuq NQuUPYt4oR7Cx37ZiIByZJkyVxPS0wKjj7LRLYyMJjilwRjZn8Jbt21S1_km Et5TU.D8Kj8uX_FgcAWN4.Ga.1BRuEVwqhr51pdEYyK7hz5Og5FsvVqtYq1y lLq8PWZhoEYBpa4Nb__r5jI.aCINRKIdPAEYevn4jjhjd9qC4X4qJkUpTnbg IsRRXeSeA2g-- Received: from [200.118.157.7] by web113516.mail.gq1.yahoo.com via HTTP; Thu, 12 Jan 2012 07:03:37 PST X-RocketYMMF: giffunip X-Mailer: YahooMailClassic/15.0.4 YahooMailWebService/0.8.115.331698 Message-ID: <1326380617.2028.YahooMailClassic@web113516.mail.gq1.yahoo.com> Date: Thu, 12 Jan 2012 07:03:37 -0800 (PST) From: Pedro Giffuni To: Joel Dahl In-Reply-To: <20120112072536.GC2227@goofy01.vnodelab.local> MIME-Version: 1.0 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 Subject: Re: svn commit: r229981 - in head/sys: conf dev/sound/pci gnu/dev/sound/pci modules/sound/driver/emu10kx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pfg@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 15:03:38 -0000 --- Gio 12/1/12, Joel Dahl ha scritto:=0A...=0A> On 11-01-2= 012 21:17, Pedro F. Giffuni=0A> wrote:=0A> > Author: pfg=0A> > Date: Wed Ja= n 11 21:17:14 2012=0A> > New Revision: 229981=0A> > URL: http://svn.freebsd= .org/changeset/base/229981=0A> > =0A> > Log:=0A> >=A0=A0=A0Replace GPL'd he= aders in the emu10kx snd driver code.=0A> >=A0=A0=A0=0A> >=A0=A0=A0This use= s the emuxkireg.h already used in the emu10k1=0A> >=A0=A0=A0snd driver. Spe= cial thanks go to Alexander Motin as=0A> >=A0=A0=A0he was able to find some= errors and reverse engineer=0A> >=A0=A0=A0some wrong values in the emuxkir= eg header.=0A> >=A0=A0=A0=0A> >=A0=A0=A0The emu10kx driver is now free from= the GPL.=0A> =0A> Thank you for taking care of this.=0A> =0A=0AWelcome ...= two more cards to go!=0A=0AI could use some help with the CS46XX and the h= eader from=0AOSS is nearly identical, in case someone is interested. ;)=0A= =0Acheers,=0A=0APedro.=0A From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 15:45:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B3491065670; Thu, 12 Jan 2012 15:45:09 +0000 (UTC) (envelope-from ghelmer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 30CAB8FC1D; Thu, 12 Jan 2012 15:45: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 q0CFj9OI015961; Thu, 12 Jan 2012 15:45:09 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0CFj8fu015959; Thu, 12 Jan 2012 15:45:08 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201201121545.q0CFj8fu015959@svn.freebsd.org> From: Guy Helmer Date: Thu, 12 Jan 2012 15:45: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: r230016 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 15:45:09 -0000 Author: ghelmer Date: Thu Jan 12 15:45:08 2012 New Revision: 230016 URL: http://svn.freebsd.org/changeset/base/230016 Log: Fix disorder in MAN and MLINKS lists. Requested by bde. Modified: head/lib/libutil/Makefile Modified: head/lib/libutil/Makefile ============================================================================== --- head/lib/libutil/Makefile Thu Jan 12 15:02:51 2012 (r230015) +++ head/lib/libutil/Makefile Thu Jan 12 15:45:08 2012 (r230016) @@ -25,48 +25,48 @@ CFLAGS+= -DINET6 CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../libc/gen/ -MAN+= kld.3 login_auth.3 login_tty.3 pty.3 \ - login_cap.3 login_class.3 login_times.3 login_ok.3 \ - _secure_path.3 uucplock.3 property.3 auth.3 realhostname.3 \ - realhostname_sa.3 trimdomain.3 fparseln.3 humanize_number.3 \ - pidfile.3 flopen.3 expand_number.3 hexdump.3 \ - kinfo_getfile.3 kinfo_getallproc.3 kinfo_getproc.3 \ - kinfo_getvmmap.3 quotafile.3 -MAN+= login.conf.5 auth.conf.5 -MLINKS+= kld.3 kld_isloaded.3 kld.3 kld_load.3 -MLINKS+= property.3 properties_read.3 property.3 properties_free.3 -MLINKS+= property.3 property_find.3 +MAN+= auth.3 expand_number.3 flopen.3 fparseln.3 hexdump.3 \ + humanize_number.3 kinfo_getallproc.3 kinfo_getfile.3 \ + kinfo_getproc.3 kinfo_getvmmap.3 kld.3 login_auth.3 login_cap.3 \ + login_class.3 login_ok.3 login_times.3 login_tty.3 pidfile.3 \ + property.3 pty.3 quotafile.3 realhostname.3 realhostname_sa.3 \ + _secure_path.3 trimdomain.3 uucplock.3 +MAN+= auth.conf.5 login.conf.5 MLINKS+= auth.3 auth_getval.3 -MLINKS+= pty.3 openpty.3 pty.3 forkpty.3 -MLINKS+=login_cap.3 login_getclassbyname.3 login_cap.3 login_close.3 \ - login_cap.3 login_getclass.3 login_cap.3 login_getuserclass.3 \ - login_cap.3 login_getcapstr.3 login_cap.3 login_getcaplist.3 \ - login_cap.3 login_getstyle.3 login_cap.3 login_getcaptime.3 \ - login_cap.3 login_getcapnum.3 login_cap.3 login_getcapsize.3 \ - login_cap.3 login_getcapbool.3 login_cap.3 login_getpath.3 \ - login_cap.3 login_getpwclass.3 login_cap.3 login_setcryptfmt.3 -MLINKS+=login_class.3 setusercontext.3 login_class.3 setclasscontext.3 \ - login_class.3 setclassenvironment.3 login_class.3 setclassresources.3 -MLINKS+=login_times.3 parse_lt.3 login_times.3 in_ltm.3 \ - login_times.3 in_lt.3 login_times.3 in_ltms.3 \ - login_times.3 in_lts.3 -MLINKS+=login_ok.3 auth_ttyok.3 login_ok.3 auth_hostok.3 \ - login_ok.3 auth_timeok.3 -MLINKS+=login_auth.3 auth_checknologin.3 login_auth.3 auth_cat.3 -MLINKS+=uucplock.3 uu_lock.3 uucplock.3 uu_lock_txfr.3 \ - uucplock.3 uu_unlock.3 uucplock.3 uu_lockerr.3 -MLINKS+=pidfile.3 pidfile_open.3 \ - pidfile.3 pidfile_write.3 \ - pidfile.3 pidfile_close.3 \ +MLINKS+= kld.3 kld_isloaded.3 kld.3 kld_load.3 +MLINKS+=login_auth.3 auth_cat.3 login_auth.3 auth_checknologin.3 +MLINKS+=login_cap.3 login_close.3 login_cap.3 login_getcapbool.3 \ + login_cap.3 login_getcaplist.3 login_cap.3 login_getcapnum.3 \ + login_cap.3 login_getcapsize.3 login_cap.3 login_getcapstr.3 \ + login_cap.3 login_getcaptime.3 login_cap.3 login_getclass.3 \ + login_cap.3 login_getclassbyname.3 login_cap.3 login_getpath.3 \ + login_cap.3 login_getpwclass.3 login_cap.3 login_getstyle.3 \ + login_cap.3 login_getuserclass.3 login_cap.3 login_setcryptfmt.3 +MLINKS+=login_class.3 setclasscontext.3 login_class.3 setclassenvironment.3 \ + login_class.3 setclassresources.3 login_class.3 setusercontext.3 +MLINKS+=login_ok.3 auth_hostok.3 login_ok.3 auth_timeok.3 \ + login_ok.3 auth_ttyok.3 +MLINKS+=login_times.3 in_lt.3 login_times.3 in_ltm.3 \ + login_times.3 in_ltms.3 \ + login_times.3 in_lts.3 \ + login_times.3 parse_lt.3 +MLINKS+=pidfile.3 pidfile_close.3 \ + pidfile.3 pidfile_fileno.3 \ + pidfile.3 pidfile_open.3 \ pidfile.3 pidfile_remove.3 \ - pidfile.3 pidfile_fileno.3 -MLINKS+=quotafile.3 quota_open.3 \ + pidfile.3 pidfile_write.3 +MLINKS+= property.3 property_find.3 property.3 properties_free.3 +MLINKS+= property.3 properties_read.3 +MLINKS+= pty.3 forkpty.3 pty.3 openpty.3 +MLINKS+=quotafile.3 quota_close.3 \ quotafile.3 quota_fsname.3 \ + quotafile.3 quota_open.3 \ quotafile.3 quota_qfname.3 \ - quotafile.3 quota_statfs.3 \ quotafile.3 quota_read.3 \ + quotafile.3 quota_statfs.3 \ quotafile.3 quota_write_limits.3 \ - quotafile.3 quota_write_usage.3 \ - quotafile.3 quota_close.3 + quotafile.3 quota_write_usage.3 +MLINKS+=uucplock.3 uu_lock.3 uucplock.3 uu_lock_txfr.3 \ + uucplock.3 uu_lockerr.3 uucplock.3 uu_unlock.3 .include From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 15:49:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78331106566B; Thu, 12 Jan 2012 15:49:07 +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 48BF48FC0C; Thu, 12 Jan 2012 15:49: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 q0CFn7S8016122; Thu, 12 Jan 2012 15:49:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0CFn7TR016120; Thu, 12 Jan 2012 15:49:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201201121549.q0CFn7TR016120@svn.freebsd.org> From: Alexander Motin Date: Thu, 12 Jan 2012 15:49:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230017 - stable/9/share/examples/scsi_target X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 15:49:07 -0000 Author: mav Date: Thu Jan 12 15:49:06 2012 New Revision: 230017 URL: http://svn.freebsd.org/changeset/base/230017 Log: MFC r228462: - Fix different variable types use in different files after r121184, causing problems on amd64. - s/%lud/%lu/. Sponsored by: iXsystems, Inc. Modified: stable/9/share/examples/scsi_target/scsi_cmds.c Directory Properties: stable/9/share/examples/ (props changed) Modified: stable/9/share/examples/scsi_target/scsi_cmds.c ============================================================================== --- stable/9/share/examples/scsi_target/scsi_cmds.c Thu Jan 12 15:45:08 2012 (r230016) +++ stable/9/share/examples/scsi_target/scsi_cmds.c Thu Jan 12 15:49:06 2012 (r230017) @@ -103,8 +103,8 @@ static struct targ_cdb_handlers cdb_hand static struct scsi_inquiry_data inq_data; static struct initiator_state istates[MAX_INITIATORS]; extern int debug; -extern uint64_t volume_size; -extern size_t sector_size; +extern off_t volume_size; +extern u_int sector_size; extern size_t buf_size; cam_status @@ -609,7 +609,7 @@ start_io(struct ccb_accept_tio *atio, st if (dir == CAM_DIR_IN) { if (notaio) { if (debug) - warnx("read sync %lud @ block " OFF_FMT, + warnx("read sync %lu @ block " OFF_FMT, (unsigned long) (ctio->dxfer_len / sector_size), c_descr->offset / sector_size); @@ -625,7 +625,7 @@ start_io(struct ccb_accept_tio *atio, st } } else { if (debug) - warnx("read async %lud @ block " OFF_FMT, + warnx("read async %lu @ block " OFF_FMT, (unsigned long) (ctio->dxfer_len / sector_size), c_descr->offset / sector_size); @@ -725,7 +725,7 @@ tcmd_rdwr_done(struct ccb_accept_tio *at a_descr->targ_req += ctio->dxfer_len; if (notaio) { if (debug) - warnx("write sync %lud @ block " + warnx("write sync %lu @ block " OFF_FMT, (unsigned long) (ctio->dxfer_len / sector_size), c_descr->offset / sector_size); @@ -742,7 +742,7 @@ tcmd_rdwr_done(struct ccb_accept_tio *at tcmd_rdwr_done(atio, ctio, AIO_DONE); } else { if (debug) - warnx("write async %lud @ block " + warnx("write async %lu @ block " OFF_FMT, (unsigned long) (ctio->dxfer_len / sector_size), c_descr->offset / sector_size); From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 15:50:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 554971065670; Thu, 12 Jan 2012 15:50:22 +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 3BFC58FC15; Thu, 12 Jan 2012 15: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 q0CFoMRx016221; Thu, 12 Jan 2012 15:50:22 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0CFoMsW016219; Thu, 12 Jan 2012 15:50:22 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201201121550.q0CFoMsW016219@svn.freebsd.org> From: Alexander Motin Date: Thu, 12 Jan 2012 15:50:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230018 - stable/8/share/examples/scsi_target X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 15:50:22 -0000 Author: mav Date: Thu Jan 12 15:50:21 2012 New Revision: 230018 URL: http://svn.freebsd.org/changeset/base/230018 Log: MFC r228462: - Fix different variable types use in different files after r121184, causing problems on amd64. - s/%lud/%lu/. Sponsored by: iXsystems, Inc. Modified: stable/8/share/examples/scsi_target/scsi_cmds.c Directory Properties: stable/8/share/examples/ (props changed) stable/8/share/examples/cvsup/ (props changed) Modified: stable/8/share/examples/scsi_target/scsi_cmds.c ============================================================================== --- stable/8/share/examples/scsi_target/scsi_cmds.c Thu Jan 12 15:49:06 2012 (r230017) +++ stable/8/share/examples/scsi_target/scsi_cmds.c Thu Jan 12 15:50:21 2012 (r230018) @@ -103,8 +103,8 @@ static struct targ_cdb_handlers cdb_hand static struct scsi_inquiry_data inq_data; static struct initiator_state istates[MAX_INITIATORS]; extern int debug; -extern uint64_t volume_size; -extern size_t sector_size; +extern off_t volume_size; +extern u_int sector_size; extern size_t buf_size; cam_status @@ -609,7 +609,7 @@ start_io(struct ccb_accept_tio *atio, st if (dir == CAM_DIR_IN) { if (notaio) { if (debug) - warnx("read sync %lud @ block " OFF_FMT, + warnx("read sync %lu @ block " OFF_FMT, (unsigned long) (ctio->dxfer_len / sector_size), c_descr->offset / sector_size); @@ -625,7 +625,7 @@ start_io(struct ccb_accept_tio *atio, st } } else { if (debug) - warnx("read async %lud @ block " OFF_FMT, + warnx("read async %lu @ block " OFF_FMT, (unsigned long) (ctio->dxfer_len / sector_size), c_descr->offset / sector_size); @@ -725,7 +725,7 @@ tcmd_rdwr_done(struct ccb_accept_tio *at a_descr->targ_req += ctio->dxfer_len; if (notaio) { if (debug) - warnx("write sync %lud @ block " + warnx("write sync %lu @ block " OFF_FMT, (unsigned long) (ctio->dxfer_len / sector_size), c_descr->offset / sector_size); @@ -742,7 +742,7 @@ tcmd_rdwr_done(struct ccb_accept_tio *at tcmd_rdwr_done(atio, ctio, AIO_DONE); } else { if (debug) - warnx("write async %lud @ block " + warnx("write async %lu @ block " OFF_FMT, (unsigned long) (ctio->dxfer_len / sector_size), c_descr->offset / sector_size); From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 15:56:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45752106566C; Thu, 12 Jan 2012 15:56:18 +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 24B1B8FC08; Thu, 12 Jan 2012 15:56: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 q0CFuIIb016480; Thu, 12 Jan 2012 15:56:18 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0CFuHbw016478; Thu, 12 Jan 2012 15:56:17 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201201121556.q0CFuHbw016478@svn.freebsd.org> From: Alexander Motin Date: Thu, 12 Jan 2012 15:56:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230019 - stable/9/sys/dev/isp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 15:56:18 -0000 Author: mav Date: Thu Jan 12 15:56:17 2012 New Revision: 230019 URL: http://svn.freebsd.org/changeset/base/230019 Log: MFC r228461: Fix few bugs in isp(4) target mode support: - in destroy_lun_state() assert hold == 1 instead of 0, as it should receive hold taken by the create_lun_state() or get_lun_statep() before; - fix hold count leak inside rls_lun_statep() that also fired above assert; - in destroy_lun_state() use SIM bus number instead of SIM path id for ISP_GET_PC_ADDR(), as it was before r196008; - make isp_disable_lun() to set status in CCB; - make isp_target_mark_aborted() set status into the proper CCB. Reviewed by: mjacob Sponsored by: iXsystems, inc. Modified: stable/9/sys/dev/isp/isp_freebsd.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/9/sys/dev/isp/isp_freebsd.c Thu Jan 12 15:50:21 2012 (r230018) +++ stable/9/sys/dev/isp/isp_freebsd.c Thu Jan 12 15:56:17 2012 (r230019) @@ -1079,8 +1079,9 @@ static ISP_INLINE void destroy_lun_state(ispsoftc_t *isp, tstate_t *tptr) { struct tslist *lhp; - KASSERT((tptr->hold == 0), ("tptr still held")); - ISP_GET_PC_ADDR(isp, xpt_path_path_id(tptr->owner), lun_hash[LUN_HASH_FUNC(xpt_path_lun_id(tptr->owner))], lhp); + KASSERT((tptr->hold != 0), ("tptr is not held")); + KASSERT((tptr->hold == 1), ("tptr still held (%d)", tptr->hold)); + ISP_GET_PC_ADDR(isp, cam_sim_bus(xpt_path_sim(tptr->owner)), lun_hash[LUN_HASH_FUNC(xpt_path_lun_id(tptr->owner))], lhp); SLIST_REMOVE(lhp, tptr, tstate, next); xpt_free_path(tptr->owner); free(tptr, M_DEVBUF); @@ -1308,12 +1309,13 @@ isp_disable_lun(ispsoftc_t *isp, union c mtx_sleep(isp, &isp->isp_lock, PRIBIO, "want_isp_disable_lun", 0); } isp->isp_osinfo.tmbusy = 1; + status = CAM_REQ_INPROG; /* * Find the state pointer. */ if ((tptr = get_lun_statep(isp, bus, lun)) == NULL) { - ccb->ccb_h.status = CAM_PATH_INVALID; + status = CAM_PATH_INVALID; goto done; } @@ -1333,13 +1335,13 @@ isp_disable_lun(ispsoftc_t *isp, union c } isp->isp_osinfo.rptr = &status; - status = CAM_REQ_INPROG; if (isp_lun_cmd(isp, RQSTYPE_ENABLE_LUN, bus, lun, 0, 0)) { status = CAM_RESRC_UNAVAIL; } else { mtx_sleep(ccb, &isp->isp_lock, PRIBIO, "isp_disable_lun", 0); } done: + ccb->ccb_h.status = status; if (status == CAM_REQ_CMP) { xpt_print(ccb->ccb_h.path, "now disabled for target mode\n"); } @@ -2941,23 +2943,25 @@ isp_target_mark_aborted(ispsoftc_t *isp, { tstate_t *tptr; atio_private_data_t *atp; + union ccb *accb = ccb->cab.abort_ccb; - tptr = get_lun_statep(isp, XS_CHANNEL(ccb), XS_LUN(ccb)); + tptr = get_lun_statep(isp, XS_CHANNEL(accb), XS_LUN(accb)); if (tptr == NULL) { - tptr = get_lun_statep(isp, XS_CHANNEL(ccb), CAM_LUN_WILDCARD); + tptr = get_lun_statep(isp, XS_CHANNEL(accb), CAM_LUN_WILDCARD); if (tptr == NULL) { ccb->ccb_h.status = CAM_REQ_INVALID; return; } } - atp = isp_get_atpd(isp, tptr, ccb->atio.tag_id); + atp = isp_get_atpd(isp, tptr, accb->atio.tag_id); if (atp == NULL) { ccb->ccb_h.status = CAM_REQ_INVALID; - return; + } else { + atp->dead = 1; + ccb->ccb_h.status = CAM_REQ_CMP; } - atp->dead = 1; - ccb->ccb_h.status = CAM_REQ_CMP; + rls_lun_statep(isp, tptr); } static void @@ -4511,7 +4515,7 @@ isp_action(struct cam_sim *sim, union cc switch (accb->ccb_h.func_code) { #ifdef ISP_TARGET_MODE case XPT_ACCEPT_TARGET_IO: - isp_target_mark_aborted(isp, accb); + isp_target_mark_aborted(isp, ccb); break; #endif case XPT_SCSI_IO: From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 15:57:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C28E1065672; Thu, 12 Jan 2012 15:57: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 058928FC24; Thu, 12 Jan 2012 15:57: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 q0CFv3lZ016535; Thu, 12 Jan 2012 15:57:03 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0CFv3GT016533; Thu, 12 Jan 2012 15:57:03 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201201121557.q0CFv3GT016533@svn.freebsd.org> From: Alexander Motin Date: Thu, 12 Jan 2012 15:57:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230020 - stable/8/sys/dev/isp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 15:57:04 -0000 Author: mav Date: Thu Jan 12 15:57:03 2012 New Revision: 230020 URL: http://svn.freebsd.org/changeset/base/230020 Log: MFC r228461: Fix few bugs in isp(4) target mode support: - in destroy_lun_state() assert hold == 1 instead of 0, as it should receive hold taken by the create_lun_state() or get_lun_statep() before; - fix hold count leak inside rls_lun_statep() that also fired above assert; - in destroy_lun_state() use SIM bus number instead of SIM path id for ISP_GET_PC_ADDR(), as it was before r196008; - make isp_disable_lun() to set status in CCB; - make isp_target_mark_aborted() set status into the proper CCB. Reviewed by: mjacob Sponsored by: iXsystems, inc. Modified: stable/8/sys/dev/isp/isp_freebsd.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/8/sys/dev/isp/isp_freebsd.c Thu Jan 12 15:56:17 2012 (r230019) +++ stable/8/sys/dev/isp/isp_freebsd.c Thu Jan 12 15:57:03 2012 (r230020) @@ -1037,8 +1037,9 @@ static ISP_INLINE void destroy_lun_state(ispsoftc_t *isp, tstate_t *tptr) { struct tslist *lhp; - KASSERT((tptr->hold == 0), ("tptr still held")); - ISP_GET_PC_ADDR(isp, xpt_path_path_id(tptr->owner), lun_hash[LUN_HASH_FUNC(xpt_path_lun_id(tptr->owner))], lhp); + KASSERT((tptr->hold != 0), ("tptr is not held")); + KASSERT((tptr->hold == 1), ("tptr still held (%d)", tptr->hold)); + ISP_GET_PC_ADDR(isp, cam_sim_bus(xpt_path_sim(tptr->owner)), lun_hash[LUN_HASH_FUNC(xpt_path_lun_id(tptr->owner))], lhp); SLIST_REMOVE(lhp, tptr, tstate, next); xpt_free_path(tptr->owner); free(tptr, M_DEVBUF); @@ -1266,12 +1267,13 @@ isp_disable_lun(ispsoftc_t *isp, union c mtx_sleep(isp, &isp->isp_lock, PRIBIO, "want_isp_disable_lun", 0); } isp->isp_osinfo.tmbusy = 1; + status = CAM_REQ_INPROG; /* * Find the state pointer. */ if ((tptr = get_lun_statep(isp, bus, lun)) == NULL) { - ccb->ccb_h.status = CAM_PATH_INVALID; + status = CAM_PATH_INVALID; goto done; } @@ -1291,13 +1293,13 @@ isp_disable_lun(ispsoftc_t *isp, union c } isp->isp_osinfo.rptr = &status; - status = CAM_REQ_INPROG; if (isp_lun_cmd(isp, RQSTYPE_ENABLE_LUN, bus, lun, 0, 0)) { status = CAM_RESRC_UNAVAIL; } else { mtx_sleep(ccb, &isp->isp_lock, PRIBIO, "isp_disable_lun", 0); } done: + ccb->ccb_h.status = status; if (status == CAM_REQ_CMP) { xpt_print(ccb->ccb_h.path, "now disabled for target mode\n"); } @@ -2899,23 +2901,25 @@ isp_target_mark_aborted(ispsoftc_t *isp, { tstate_t *tptr; atio_private_data_t *atp; + union ccb *accb = ccb->cab.abort_ccb; - tptr = get_lun_statep(isp, XS_CHANNEL(ccb), XS_LUN(ccb)); + tptr = get_lun_statep(isp, XS_CHANNEL(accb), XS_LUN(accb)); if (tptr == NULL) { - tptr = get_lun_statep(isp, XS_CHANNEL(ccb), CAM_LUN_WILDCARD); + tptr = get_lun_statep(isp, XS_CHANNEL(accb), CAM_LUN_WILDCARD); if (tptr == NULL) { ccb->ccb_h.status = CAM_REQ_INVALID; return; } } - atp = isp_get_atpd(isp, tptr, ccb->atio.tag_id); + atp = isp_get_atpd(isp, tptr, accb->atio.tag_id); if (atp == NULL) { ccb->ccb_h.status = CAM_REQ_INVALID; - return; + } else { + atp->dead = 1; + ccb->ccb_h.status = CAM_REQ_CMP; } - atp->dead = 1; - ccb->ccb_h.status = CAM_REQ_CMP; + rls_lun_statep(isp, tptr); } static void @@ -4403,7 +4407,7 @@ isp_action(struct cam_sim *sim, union cc switch (accb->ccb_h.func_code) { #ifdef ISP_TARGET_MODE case XPT_ACCEPT_TARGET_IO: - isp_target_mark_aborted(isp, accb); + isp_target_mark_aborted(isp, ccb); break; #endif case XPT_SCSI_IO: From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 16:51:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A797F106564A; Thu, 12 Jan 2012 16:51:56 +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 885CD8FC19; Thu, 12 Jan 2012 16:51: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 q0CGpugA018312; Thu, 12 Jan 2012 16:51:56 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0CGpuww018310; Thu, 12 Jan 2012 16:51:56 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201121651.q0CGpuww018310@svn.freebsd.org> From: Ed Schouten Date: Thu, 12 Jan 2012 16:51: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: r230021 - head/contrib/compiler-rt/lib X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 16:51:56 -0000 Author: ed Date: Thu Jan 12 16:51:56 2012 New Revision: 230021 URL: http://svn.freebsd.org/changeset/base/230021 Log: Add a workaround to prevent endless recursion in compiler-rt. SPARC and MIPS CPUs don't have special instructions to count leading/trailing zeroes. The compiler-rt library provides fallback rountines for these. The 64-bit routines, __clzdi2 and __ctzdi2, are implemented as simple wrappers around the compiler built-in __builtin_clz(), assuming these will expand to either 32-bit CPU instructions or calls to __clzsi2 and __ctzsi2. Unfortunately, our GCC 4.2 probably thinks that because the operand is stored in a 64-bit register, it might just be a better idea to invoke its 64-bit equivalent, simply resulting into endless recursion. Fix this by defining __builtin_clz and __builtin_ctz to __clzsi2 and __ctzsi2 explicitly. Modified: head/contrib/compiler-rt/lib/int_lib.h Modified: head/contrib/compiler-rt/lib/int_lib.h ============================================================================== --- head/contrib/compiler-rt/lib/int_lib.h Thu Jan 12 15:57:03 2012 (r230020) +++ head/contrib/compiler-rt/lib/int_lib.h Thu Jan 12 16:51:56 2012 (r230021) @@ -43,4 +43,24 @@ /* Include internal utility function declarations. */ #include "int_util.h" +/* + * Workaround for LLVM bug 11663. Prevent endless recursion in + * __c?zdi2(), where calls to __builtin_c?z() are expanded to + * __c?zdi2() instead of __c?zsi2(). + * + * Instead of placing this workaround in c?zdi2.c, put it in this + * global header to prevent other C files from making the detour + * through __c?zdi2() as well. + * + * This problem has only been observed on FreeBSD for sparc64 and + * mips64 with GCC 4.2.1. + */ +#if defined(__FreeBSD__) && (defined(__sparc64__) || \ + defined(__mips_n64) || defined(__mips_o64)) +si_int __clzsi2(si_int); +si_int __ctzsi2(si_int); +#define __builtin_clz __clzsi2 +#define __builtin_ctz __ctzsi2 +#endif + #endif /* INT_LIB_H */ From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 17:07:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED9F5106567A; Thu, 12 Jan 2012 17:07:33 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id EF6E68FC1F; Thu, 12 Jan 2012 17:07:32 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:a06e:a9a1:daf:164d] (unknown [IPv6:2001:7b8:3a7:0:a06e:a9a1:daf:164d]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id C10F65C37; Thu, 12 Jan 2012 18:07:31 +0100 (CET) Message-ID: <4F0F1355.2010709@FreeBSD.org> Date: Thu, 12 Jan 2012 18:07:33 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0) Gecko/20120106 Thunderbird/10.0 MIME-Version: 1.0 To: Jung-uk Kim References: <201010131033.o9DAX1EE080534@svn.freebsd.org> <201010141505.14869.jkim@FreeBSD.org> <201010141523.29842.jkim@FreeBSD.org> In-Reply-To: <201010141523.29842.jkim@FreeBSD.org> Content-Type: multipart/mixed; boundary="------------020707010109000404020808" Cc: src-committers@freebsd.org, Rui Paulo , John Baldwin , svn-src-all@freebsd.org, Dmitry Morozovsky , svn-src-head@freebsd.org, John Nielsen , Peter Grehan Subject: Re: svn commit: r213765 - head/sys/dev/aic7xxx/aicasm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 17:07:34 -0000 This is a multi-part message in MIME format. --------------020707010109000404020808 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 2010-10-14 21:23, Jung-uk Kim wrote: > On Thursday 14 October 2010 03:11 pm, Dmitry Morozovsky wrote: >> On Thu, 14 Oct 2010, Jung-uk Kim wrote: ... >> cc -O2 -pipe -nostdinc -I/usr/include -I. >> -I/FreeBSD/src.current.svn/sys/dev/aic7xxx/aicasm -std=gnu99 >> -Wsystem-headers -Werror -Wall -Wno-format-y2k -W >> -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes >> -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch >> -Wshadow -Wunused-parameter -Wcast-align -Wno-pointer-sign -c >> aicasm_scan.c >> cc1: warnings being treated as errors >> /FreeBSD/src.current.svn/sys/dev/aic7xxx/aicasm/aicasm_scan.l:840: >> warning: function declaration isn't a prototype ... > Hmm... That means "make buildkernel" did not pick up newly built lex. > That's bad. :-( I know it's very, very late to respond to this, but I just had an email conversation with Peter Grehan, where he ran into this problem when attempting to build -CURRENT on 8.1-RELEASE. This doesn't have the followup r214779 yet, where the needed update to lex is merged. Of course, I also know that building -CURRENT on 8.1-RELEASE is officially not supported, but if there is a relatively simple fix to make it work, it should not be a problem to apply, right? :) The root of the problem is that, even if buildworld is completed, the "stage 2.3: build tools" (kernel-specific) part of Makefile.inc1 uses lex and yacc from /usr/bin, *not* the ones built under ${WORLDTMP} (usually in /usr/obj/usr/src/tmp/legacy/usr/bin). Therefore, I propose to set PATH to ${BPATH}:${PATH} in this stage, so the "good" versions of lex and yacc are used. As per attached diff. (NOTE: even with this diff applied, doing 'make buildkernel' without first doing 'make buildworld' or 'make kernel-toolchain' will not work, because there will be no copy of lex and yacc in /usr/obj.) --------------020707010109000404020808 Content-Type: text/x-diff; name="fix-aicasm-lex-yacc-1.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="fix-aicasm-lex-yacc-1.diff" Index: Makefile.inc1 =================================================================== --- Makefile.inc1 (revision 229979) +++ Makefile.inc1 (working copy) @@ -832,6 +832,7 @@ @echo ">>> stage 2.3: build tools" @echo "--------------------------------------------------------------" cd ${KRNLOBJDIR}/${_kernel}; \ + PATH=${BPATH}:${PATH} \ MAKESRCPATH=${KERNSRCDIR}/dev/aic7xxx/aicasm \ ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF \ -f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile @@ -839,6 +840,7 @@ .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules) .for target in obj depend all cd ${KERNSRCDIR}/modules/aic7xxx/aicasm; \ + PATH=${BPATH}:${PATH} \ MAKEOBJDIRPREFIX=${KRNLOBJDIR}/${_kernel}/modules \ ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF ${target} .endfor --------------020707010109000404020808-- From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 17:28:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3A18106566B; Thu, 12 Jan 2012 17:28:00 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 922E18FC15; Thu, 12 Jan 2012 17:28: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 q0CHS0us019460; Thu, 12 Jan 2012 17:28:00 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0CHS0HT019458; Thu, 12 Jan 2012 17:28:00 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201201121728.q0CHS0HT019458@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 12 Jan 2012 17:28: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: r230023 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 17:28:00 -0000 Author: luigi Date: Thu Jan 12 17:28:00 2012 New Revision: 230023 URL: http://svn.freebsd.org/changeset/base/230023 Log: fix the initialization of the rings when netmap is used, to adapt it to the changes in 228387 . Now the code is similar to the one used in other drivers. Not applicable to stable/9 and stable/8 Modified: head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Thu Jan 12 17:06:46 2012 (r230022) +++ head/sys/dev/e1000/if_em.c Thu Jan 12 17:28:00 2012 (r230023) @@ -4019,6 +4019,10 @@ em_setup_receive_ring(struct rx_ring *rx struct em_buffer *rxbuf; bus_dma_segment_t seg[1]; int rsize, nsegs, error; +#ifdef DEV_NETMAP + struct netmap_adapter *na = NA(adapter->ifp); + struct netmap_slot *slot; +#endif /* Clear the ring contents */ @@ -4026,6 +4030,9 @@ em_setup_receive_ring(struct rx_ring *rx rsize = roundup2(adapter->num_rx_desc * sizeof(struct e1000_rx_desc), EM_DBA_ALIGN); bzero((void *)rxr->rx_base, rsize); +#ifdef DEV_NETMAP + slot = netmap_reset(na, NR_RX, 0, 0); +#endif /* ** Free current RX buffer structs and their mbufs @@ -4043,6 +4050,22 @@ em_setup_receive_ring(struct rx_ring *rx /* Now replenish the mbufs */ for (int j = 0; j != adapter->num_rx_desc; ++j) { rxbuf = &rxr->rx_buffers[j]; +#ifdef DEV_NETMAP + if (slot) { + /* slot si is mapped to the j-th NIC-ring entry */ + int si = j + na->rx_rings[0].nkr_hwofs; + uint64_t paddr; + void *addr; + + if (si > na->num_rx_desc) + si -= na->num_rx_desc; + addr = PNMB(slot + si, &paddr); + netmap_load_map(rxr->rxtag, rxbuf->map, addr); + /* Update descriptor */ + rxr->rx_base[j].buffer_addr = htole64(paddr); + continue; + } +#endif /* DEV_NETMAP */ rxbuf->m_head = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR, adapter->rx_mbuf_sz); if (rxbuf->m_head == NULL) { @@ -4073,63 +4096,6 @@ em_setup_receive_ring(struct rx_ring *rx bus_dmamap_sync(rxr->rxdma.dma_tag, rxr->rxdma.dma_map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); -#ifdef DEV_NETMAP - { - /* - * This driver is slightly different from the standard: - * it refills the rings in blocks of 8, so the while() - * above completes any leftover work. Also, after if_init() - * the ring starts at rxr->next_to_check instead of 0. - * - * Currently: we leave the mbufs allocated even in netmap - * mode, and simply make the NIC ring point to the - * correct buffer (netmap_buf or mbuf) depending on - * the mode. To avoid mbuf leaks, when in netmap mode we - * must make sure that next_to_refresh == next_to_check - 1 - * so that the above while() loop is never run on init. - * - * A better way would be to free the mbufs when entering - * netmap mode, and set next_to_refresh/check in - * a way that the mbufs are completely reallocated - * when going back to standard mode. - */ - struct netmap_adapter *na = NA(adapter->ifp); - struct netmap_slot *slot = netmap_reset(na, - NR_RX, rxr->me, rxr->next_to_check); - int sj = slot ? na->rx_rings[rxr->me].nkr_hwofs : 0; - - /* slot sj corresponds to entry j in the NIC ring */ - if (sj < 0) - sj += adapter->num_rx_desc; - - for (int j = 0; j != adapter->num_rx_desc; j++, sj++) { - rxbuf = &rxr->rx_buffers[j]; - /* no mbuf and regular mode -> skip this entry */ - if (rxbuf->m_head == NULL && !slot) - continue; - /* Handle wrap. Cannot use "na" here, could be NULL */ - if (sj >= adapter->num_rx_desc) - sj -= adapter->num_rx_desc; - /* see comment, set slot addr and map */ - if (slot) { - uint64_t paddr; - void *addr = PNMB(slot + sj, &paddr); - netmap_load_map(rxr->rxtag, rxbuf->map, addr); - /* Update descriptor */ - rxr->rx_base[j].buffer_addr = htole64(paddr); - } else { - /* Get the memory mapping */ - bus_dmamap_load_mbuf_sg(rxr->rxtag, - rxbuf->map, rxbuf->m_head, seg, - &nsegs, BUS_DMA_NOWAIT); - /* Update descriptor */ - rxr->rx_base[j].buffer_addr = htole64(seg[0].ds_addr); - } - bus_dmamap_sync(rxr->rxtag, rxbuf->map, BUS_DMASYNC_PREREAD); - } - } -#endif /* DEV_NETMAP */ - fail: EM_RX_UNLOCK(rxr); return (error); @@ -4313,21 +4279,18 @@ em_initialize_receive_unit(struct adapte E1000_WRITE_REG(hw, E1000_RDBAL(i), (u32)bus_addr); /* Setup the Head and Tail Descriptor Pointers */ E1000_WRITE_REG(hw, E1000_RDH(i), 0); - E1000_WRITE_REG(hw, E1000_RDT(i), adapter->num_rx_desc - 1); #ifdef DEV_NETMAP /* * an init() while a netmap client is active must * preserve the rx buffers passed to userspace. * In this driver it means we adjust RDT to - * something different from next_to_refresh. + * something different from na->num_rx_desc - 1. */ if (ifp->if_capenable & IFCAP_NETMAP) { struct netmap_adapter *na = NA(adapter->ifp); struct netmap_kring *kring = &na->rx_rings[i]; - int t = rxr->next_to_refresh - kring->nr_hwavail; + int t = na->num_rx_desc - 1 - kring->nr_hwavail; - if (t < 0) - t += na->num_rx_desc; E1000_WRITE_REG(hw, E1000_RDT(i), t); } else #endif /* DEV_NETMAP */ From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 17:30:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F0FE1065672; Thu, 12 Jan 2012 17:30:46 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F30C8FC18; Thu, 12 Jan 2012 17:30: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 q0CHUjQk019588; Thu, 12 Jan 2012 17:30:45 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0CHUjCw019586; Thu, 12 Jan 2012 17:30:45 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201201121730.q0CHUjCw019586@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 12 Jan 2012 17:30:45 +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: r230024 - head/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 17:30:46 -0000 Author: luigi Date: Thu Jan 12 17:30:44 2012 New Revision: 230024 URL: http://svn.freebsd.org/changeset/base/230024 Log: clear the pointer after freeing the mbuf. Without that, we risk a double free if the subsequent mbuf allocation fails. This bug is not netmap-related and was introduced in rev. 228387 Modified: head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Thu Jan 12 17:28:00 2012 (r230023) +++ head/sys/dev/e1000/if_em.c Thu Jan 12 17:30:44 2012 (r230024) @@ -4044,6 +4044,7 @@ em_setup_receive_ring(struct rx_ring *rx BUS_DMASYNC_POSTREAD); bus_dmamap_unload(rxr->rxtag, rxbuf->map); m_freem(rxbuf->m_head); + rxbuf->m_head = NULL; /* mark as freed */ } } From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 17:55:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFEBB1065672; Thu, 12 Jan 2012 17:55:22 +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 9DB218FC16; Thu, 12 Jan 2012 17:55: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 q0CHtMJ2020350; Thu, 12 Jan 2012 17:55:22 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0CHtMA2020344; Thu, 12 Jan 2012 17:55:22 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201121755.q0CHtMA2020344@svn.freebsd.org> From: Ed Schouten Date: Thu, 12 Jan 2012 17:55: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: r230025 - head/contrib/compiler-rt/lib/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 17:55:22 -0000 Author: ed Date: Thu Jan 12 17:55:22 2012 New Revision: 230025 URL: http://svn.freebsd.org/changeset/base/230025 Log: Add SPARC64 version of div/mod written in assembly. This version is similar to the code shipped with libgcc. It is based on the code from the SPARC64 architecture manual, provided without any restrictions. Tested by: flo@ Added: head/contrib/compiler-rt/lib/sparc64/ head/contrib/compiler-rt/lib/sparc64/divmod.m4 head/contrib/compiler-rt/lib/sparc64/divsi3.S head/contrib/compiler-rt/lib/sparc64/generate.sh head/contrib/compiler-rt/lib/sparc64/modsi3.S head/contrib/compiler-rt/lib/sparc64/udivsi3.S head/contrib/compiler-rt/lib/sparc64/umodsi3.S Added: head/contrib/compiler-rt/lib/sparc64/divmod.m4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/compiler-rt/lib/sparc64/divmod.m4 Thu Jan 12 17:55:22 2012 (r230025) @@ -0,0 +1,250 @@ +/* + * This m4 code has been taken from The SPARC Architecture Manual Version 8. + */ + +/* + * Division/Remainder + * + * Input is: + * dividend -- the thing being divided + * divisor -- how many ways to divide it + * Important parameters: + * N -- how many bits per iteration we try to get + * as our current guess: define(N, 4) define(TWOSUPN, 16) + * WORDSIZE -- how many bits altogether we're talking about: + * obviously: define(WORDSIZE, 32) + * A derived constant: + * TOPBITS -- how many bits are in the top "decade" of a number: + * define(TOPBITS, eval( WORDSIZE - N*((WORDSIZE-1)/N) ) ) + * Important variables are: + * Q -- the partial quotient under development -- initially 0 + * R -- the remainder so far -- initially == the dividend + * ITER -- number of iterations of the main division loop which will + * be required. Equal to CEIL( lg2(quotient)/N ) + * Note that this is log_base_(2ˆN) of the quotient. + * V -- the current comparand -- initially divisor*2ˆ(ITER*N-1) + * Cost: + * current estimate for non-large dividend is + * CEIL( lg2(quotient) / N ) x ( 10 + 7N/2 ) + C + * a large dividend is one greater than 2ˆ(31-TOPBITS) and takes a + * different path, as the upper bits of the quotient must be developed + * one bit at a time. + * This uses the m4 and cpp macro preprocessors. + */ + +define(dividend, `%o0') +define(divisor,`%o1') +define(Q, `%o2') +define(R, `%o3') +define(ITER, `%o4') +define(V, `%o5') +define(SIGN, `%g3') +define(T, `%g1') +define(SC,`%g2') +/* + * This is the recursive definition of how we develop quotient digits. + * It takes three important parameters: + * $1 -- the current depth, 1<=$1<=N + * $2 -- the current accumulation of quotient bits + * N -- max depth + * We add a new bit to $2 and either recurse or insert the bits in the quotient. + * Dynamic input: + * R -- current remainder + * Q -- current quotient + * V -- current comparand + * cc -- set on current value of R + * Dynamic output: + * R', Q', V', cc' + */ + +#include "../assembly.h" + +.text + .align 4 + +define(DEVELOP_QUOTIENT_BITS, +` !depth $1, accumulated bits $2 + bl L.$1.eval(TWOSUPN+$2) + srl V,1,V + ! remainder is nonnegative + subcc R,V,R + ifelse( $1, N, + ` b 9f + add Q, ($2*2+1), Q + ',` DEVELOP_QUOTIENT_BITS( incr($1), `eval(2*$2+1)') + ') +L.$1.eval(TWOSUPN+$2): + ! remainder is negative + addcc R,V,R + ifelse( $1, N, + ` b 9f + add Q, ($2*2-1), Q + ',` DEVELOP_QUOTIENT_BITS( incr($1), `eval(2*$2-1)') + ') + ifelse( $1, 1, `9:') +') +ifelse( ANSWER, `quotient', ` +DEFINE_COMPILERRT_FUNCTION(__udivsi3) + save %sp,-64,%sp ! do this for debugging + b divide + mov 0,SIGN ! result always nonnegative +DEFINE_COMPILERRT_FUNCTION(__divsi3) + save %sp,-64,%sp ! do this for debugging + orcc divisor,dividend,%g0 ! are either dividend or divisor negative + bge divide ! if not, skip this junk + xor divisor,dividend,SIGN ! record sign of result in sign of SIGN + tst divisor + bge 2f + tst dividend + ! divisor < 0 + bge divide + neg divisor + 2: + ! dividend < 0 + neg dividend + ! FALL THROUGH +',` +DEFINE_COMPILERRT_FUNCTION(__umodsi3) + save %sp,-64,%sp ! do this for debugging + b divide + mov 0,SIGN ! result always nonnegative +DEFINE_COMPILERRT_FUNCTION(__modsi3) + save %sp,-64,%sp ! do this for debugging + orcc divisor,dividend,%g0 ! are either dividend or divisor negative + bge divide ! if not, skip this junk + mov dividend,SIGN ! record sign of result in sign of SIGN + tst divisor + bge 2f + tst dividend + ! divisor < 0 + bge divide + neg divisor + 2: + ! dividend < 0 + neg dividend + ! FALL THROUGH +') + +divide: + ! Compute size of quotient, scale comparand. + orcc divisor,%g0,V ! movcc divisor,V + te 2 ! if divisor = 0 + mov dividend,R + mov 0,Q + sethi %hi(1<<(WORDSIZE-TOPBITS-1)),T + cmp R,T + blu not_really_big + mov 0,ITER + ! + ! Here, the dividend is >= 2ˆ(31-N) or so. We must be careful here, + ! as our usual N-at-a-shot divide step will cause overflow and havoc. + ! The total number of bits in the result here is N*ITER+SC, where + ! SC <= N. + ! Compute ITER in an unorthodox manner: know we need to Shift V into +! the top decade: so don't even bother to compare to R. +1: + cmp V,T + bgeu 3f + mov 1,SC + sll V,N,V + b 1b + inc ITER +! Now compute SC +2: addcc V,V,V + bcc not_too_big + add SC,1,SC + ! We're here if the divisor overflowed when Shifting. + ! This means that R has the high-order bit set. + ! Restore V and subtract from R. + sll T,TOPBITS,T ! high order bit + srl V,1,V ! rest of V + add V,T,V + b do_single_div + dec SC +not_too_big: +3: cmp V,R + blu 2b + nop + be do_single_div + nop +! V > R: went too far: back up 1 step +! srl V,1,V +! dec SC +! do single-bit divide steps +! +! We have to be careful here. We know that R >= V, so we can do the +! first divide step without thinking. BUT, the others are conditional, +! and are only done if R >= 0. Because both R and V may have the high- +! order bit set in the first step, just falling into the regular +! division loop will mess up the first time around. +! So we unroll slightly... +do_single_div: + deccc SC + bl end_regular_divide + nop + sub R,V,R + mov 1,Q + b end_single_divloop + nop +single_divloop: + sll Q,1,Q + bl 1f + srl V,1,V + ! R >= 0 + sub R,V,R + b 2f + inc Q + 1: ! R < 0 + add R,V,R + dec Q + 2: + end_single_divloop: + deccc SC + bge single_divloop + tst R + b end_regular_divide + nop + +not_really_big: +1: + sll V,N,V + cmp V,R + bleu 1b + inccc ITER + be got_result + dec ITER +do_regular_divide: + ! Do the main division iteration + tst R + ! Fall through into divide loop +divloop: + sll Q,N,Q + DEVELOP_QUOTIENT_BITS( 1, 0 ) +end_regular_divide: + deccc ITER + bge divloop + tst R + bge got_result + nop + ! non-restoring fixup here +ifelse( ANSWER, `quotient', +` dec Q +',` add R,divisor,R +') + +got_result: + tst SIGN + bge 1f + restore + ! answer < 0 + retl ! leaf-routine return +ifelse( ANSWER, `quotient', +` neg %o2,%o0 ! quotient <- -Q +',` neg %o3,%o0 ! remainder <- -R +') +1: + retl ! leaf-routine return +ifelse( ANSWER, `quotient', +` mov %o2,%o0 ! quotient <- Q +',` mov %o3,%o0 ! remainder <- R +') Added: head/contrib/compiler-rt/lib/sparc64/divsi3.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/compiler-rt/lib/sparc64/divsi3.S Thu Jan 12 17:55:22 2012 (r230025) @@ -0,0 +1,333 @@ +/* + * This m4 code has been taken from The SPARC Architecture Manual Version 8. + */ +/* + * Division/Remainder + * + * Input is: + * dividend -- the thing being divided + * divisor -- how many ways to divide it + * Important parameters: + * N -- how many bits per iteration we try to get + * as our current guess: + * WORDSIZE -- how many bits altogether we're talking about: + * obviously: + * A derived constant: + * TOPBITS -- how many bits are in the top "decade" of a number: + * + * Important variables are: + * Q -- the partial quotient under development -- initially 0 + * R -- the remainder so far -- initially == the dividend + * ITER -- number of iterations of the main division loop which will + * be required. Equal to CEIL( lg2(quotient)/4 ) + * Note that this is log_base_(2ˆ4) of the quotient. + * V -- the current comparand -- initially divisor*2ˆ(ITER*4-1) + * Cost: + * current estimate for non-large dividend is + * CEIL( lg2(quotient) / 4 ) x ( 10 + 74/2 ) + C + * a large dividend is one greater than 2ˆ(31-4 ) and takes a + * different path, as the upper bits of the quotient must be developed + * one bit at a time. + * This uses the m4 and cpp macro preprocessors. + */ +/* + * This is the recursive definition of how we develop quotient digits. + * It takes three important parameters: + * $1 -- the current depth, 1<=$1<=4 + * $2 -- the current accumulation of quotient bits + * 4 -- max depth + * We add a new bit to $2 and either recurse or insert the bits in the quotient. + * Dynamic input: + * %o3 -- current remainder + * %o2 -- current quotient + * %o5 -- current comparand + * cc -- set on current value of %o3 + * Dynamic output: + * %o3', %o2', %o5', cc' + */ +#include "../assembly.h" +.text + .align 4 +DEFINE_COMPILERRT_FUNCTION(__udivsi3) + save %sp,-64,%sp ! do this for debugging + b divide + mov 0,%g3 ! result always nonnegative +DEFINE_COMPILERRT_FUNCTION(__divsi3) + save %sp,-64,%sp ! do this for debugging + orcc %o1,%o0,%g0 ! are either %o0 or %o1 negative + bge divide ! if not, skip this junk + xor %o1,%o0,%g3 ! record sign of result in sign of %g3 + tst %o1 + bge 2f + tst %o0 + ! %o1 < 0 + bge divide + neg %o1 + 2: + ! %o0 < 0 + neg %o0 + ! FALL THROUGH +divide: + ! Compute size of quotient, scale comparand. + orcc %o1,%g0,%o5 ! movcc %o1,%o5 + te 2 ! if %o1 = 0 + mov %o0,%o3 + mov 0,%o2 + sethi %hi(1<<(32-4 -1)),%g1 + cmp %o3,%g1 + blu not_really_big + mov 0,%o4 + ! + ! Here, the %o0 is >= 2ˆ(31-4) or so. We must be careful here, + ! as our usual 4-at-a-shot divide step will cause overflow and havoc. + ! The total number of bits in the result here is 4*%o4+%g2, where + ! %g2 <= 4. + ! Compute %o4 in an unorthodox manner: know we need to Shift %o5 into +! the top decade: so don't even bother to compare to %o3. +1: + cmp %o5,%g1 + bgeu 3f + mov 1,%g2 + sll %o5,4,%o5 + b 1b + inc %o4 +! Now compute %g2 +2: addcc %o5,%o5,%o5 + bcc not_too_big + add %g2,1,%g2 + ! We're here if the %o1 overflowed when Shifting. + ! This means that %o3 has the high-order bit set. + ! Restore %o5 and subtract from %o3. + sll %g1,4 ,%g1 ! high order bit + srl %o5,1,%o5 ! rest of %o5 + add %o5,%g1,%o5 + b do_single_div + dec %g2 +not_too_big: +3: cmp %o5,%o3 + blu 2b + nop + be do_single_div + nop +! %o5 > %o3: went too far: back up 1 step +! srl %o5,1,%o5 +! dec %g2 +! do single-bit divide steps +! +! We have to be careful here. We know that %o3 >= %o5, so we can do the +! first divide step without thinking. BUT, the others are conditional, +! and are only done if %o3 >= 0. Because both %o3 and %o5 may have the high- +! order bit set in the first step, just falling into the regular +! division loop will mess up the first time around. +! So we unroll slightly... +do_single_div: + deccc %g2 + bl end_regular_divide + nop + sub %o3,%o5,%o3 + mov 1,%o2 + b end_single_divloop + nop +single_divloop: + sll %o2,1,%o2 + bl 1f + srl %o5,1,%o5 + ! %o3 >= 0 + sub %o3,%o5,%o3 + b 2f + inc %o2 + 1: ! %o3 < 0 + add %o3,%o5,%o3 + dec %o2 + 2: + end_single_divloop: + deccc %g2 + bge single_divloop + tst %o3 + b end_regular_divide + nop +not_really_big: +1: + sll %o5,4,%o5 + cmp %o5,%o3 + bleu 1b + inccc %o4 + be got_result + dec %o4 +do_regular_divide: + ! Do the main division iteration + tst %o3 + ! Fall through into divide loop +divloop: + sll %o2,4,%o2 + !depth 1, accumulated bits 0 + bl L.1.16 + srl %o5,1,%o5 + ! remainder is nonnegative + subcc %o3,%o5,%o3 + !depth 2, accumulated bits 1 + bl L.2.17 + srl %o5,1,%o5 + ! remainder is nonnegative + subcc %o3,%o5,%o3 + !depth 3, accumulated bits 3 + bl L.3.19 + srl %o5,1,%o5 + ! remainder is nonnegative + subcc %o3,%o5,%o3 + !depth 4, accumulated bits 7 + bl L.4.23 + srl %o5,1,%o5 + ! remainder is nonnegative + subcc %o3,%o5,%o3 + b 9f + add %o2, (7*2+1), %o2 +L.4.23: + ! remainder is negative + addcc %o3,%o5,%o3 + b 9f + add %o2, (7*2-1), %o2 +L.3.19: + ! remainder is negative + addcc %o3,%o5,%o3 + !depth 4, accumulated bits 5 + bl L.4.21 + srl %o5,1,%o5 + ! remainder is nonnegative + subcc %o3,%o5,%o3 + b 9f + add %o2, (5*2+1), %o2 +L.4.21: + ! remainder is negative + addcc %o3,%o5,%o3 + b 9f + add %o2, (5*2-1), %o2 +L.2.17: + ! remainder is negative + addcc %o3,%o5,%o3 + !depth 3, accumulated bits 1 + bl L.3.17 + srl %o5,1,%o5 + ! remainder is nonnegative + subcc %o3,%o5,%o3 + !depth 4, accumulated bits 3 + bl L.4.19 + srl %o5,1,%o5 + ! remainder is nonnegative + subcc %o3,%o5,%o3 + b 9f + add %o2, (3*2+1), %o2 +L.4.19: + ! remainder is negative + addcc %o3,%o5,%o3 + b 9f + add %o2, (3*2-1), %o2 +L.3.17: + ! remainder is negative + addcc %o3,%o5,%o3 + !depth 4, accumulated bits 1 + bl L.4.17 + srl %o5,1,%o5 + ! remainder is nonnegative + subcc %o3,%o5,%o3 + b 9f + add %o2, (1*2+1), %o2 +L.4.17: + ! remainder is negative + addcc %o3,%o5,%o3 + b 9f + add %o2, (1*2-1), %o2 +L.1.16: + ! remainder is negative + addcc %o3,%o5,%o3 + !depth 2, accumulated bits -1 + bl L.2.15 + srl %o5,1,%o5 + ! remainder is nonnegative + subcc %o3,%o5,%o3 + !depth 3, accumulated bits -1 + bl L.3.15 + srl %o5,1,%o5 + ! remainder is nonnegative + subcc %o3,%o5,%o3 + !depth 4, accumulated bits -1 + bl L.4.15 + srl %o5,1,%o5 + ! remainder is nonnegative + subcc %o3,%o5,%o3 + b 9f + add %o2, (-1*2+1), %o2 +L.4.15: + ! remainder is negative + addcc %o3,%o5,%o3 + b 9f + add %o2, (-1*2-1), %o2 +L.3.15: + ! remainder is negative + addcc %o3,%o5,%o3 + !depth 4, accumulated bits -3 + bl L.4.13 + srl %o5,1,%o5 + ! remainder is nonnegative + subcc %o3,%o5,%o3 + b 9f + add %o2, (-3*2+1), %o2 +L.4.13: + ! remainder is negative + addcc %o3,%o5,%o3 + b 9f + add %o2, (-3*2-1), %o2 +L.2.15: + ! remainder is negative + addcc %o3,%o5,%o3 + !depth 3, accumulated bits -3 + bl L.3.13 + srl %o5,1,%o5 + ! remainder is nonnegative + subcc %o3,%o5,%o3 + !depth 4, accumulated bits -5 + bl L.4.11 + srl %o5,1,%o5 + ! remainder is nonnegative + subcc %o3,%o5,%o3 + b 9f + add %o2, (-5*2+1), %o2 +L.4.11: + ! remainder is negative + addcc %o3,%o5,%o3 + b 9f + add %o2, (-5*2-1), %o2 +L.3.13: + ! remainder is negative + addcc %o3,%o5,%o3 + !depth 4, accumulated bits -7 + bl L.4.9 + srl %o5,1,%o5 + ! remainder is nonnegative + subcc %o3,%o5,%o3 + b 9f + add %o2, (-7*2+1), %o2 +L.4.9: + ! remainder is negative + addcc %o3,%o5,%o3 + b 9f + add %o2, (-7*2-1), %o2 + 9: +end_regular_divide: + deccc %o4 + bge divloop + tst %o3 + bge got_result + nop + ! non-restoring fixup here + dec %o2 +got_result: + tst %g3 + bge 1f + restore + ! answer < 0 + retl ! leaf-routine return + neg %o2,%o0 ! quotient <- -%o2 +1: + retl ! leaf-routine return + mov %o2,%o0 ! quotient <- %o2 Added: head/contrib/compiler-rt/lib/sparc64/generate.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/compiler-rt/lib/sparc64/generate.sh Thu Jan 12 17:55:22 2012 (r230025) @@ -0,0 +1,6 @@ +#!/bin/sh + +m4 divmod.m4 | sed -e 's/[[:space:]]*$//' | grep -v '^$' > modsi3.S +m4 -DANSWER=quotient divmod.m4 | sed -e 's/[[:space:]]*$//' | grep -v '^$' > divsi3.S +echo '! This file intentionally left blank' > umodsi3.S +echo '! This file intentionally left blank' > udivsi3.S Added: head/contrib/compiler-rt/lib/sparc64/modsi3.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/compiler-rt/lib/sparc64/modsi3.S Thu Jan 12 17:55:22 2012 (r230025) @@ -0,0 +1,333 @@ +/* + * This m4 code has been taken from The SPARC Architecture Manual Version 8. + */ +/* + * Division/Remainder + * + * Input is: + * dividend -- the thing being divided + * divisor -- how many ways to divide it + * Important parameters: + * N -- how many bits per iteration we try to get + * as our current guess: + * WORDSIZE -- how many bits altogether we're talking about: + * obviously: + * A derived constant: + * TOPBITS -- how many bits are in the top "decade" of a number: + * + * Important variables are: + * Q -- the partial quotient under development -- initially 0 + * R -- the remainder so far -- initially == the dividend + * ITER -- number of iterations of the main division loop which will + * be required. Equal to CEIL( lg2(quotient)/4 ) + * Note that this is log_base_(2ˆ4) of the quotient. + * V -- the current comparand -- initially divisor*2ˆ(ITER*4-1) + * Cost: + * current estimate for non-large dividend is + * CEIL( lg2(quotient) / 4 ) x ( 10 + 74/2 ) + C + * a large dividend is one greater than 2ˆ(31-4 ) and takes a + * different path, as the upper bits of the quotient must be developed + * one bit at a time. + * This uses the m4 and cpp macro preprocessors. + */ +/* + * This is the recursive definition of how we develop quotient digits. + * It takes three important parameters: + * $1 -- the current depth, 1<=$1<=4 + * $2 -- the current accumulation of quotient bits + * 4 -- max depth + * We add a new bit to $2 and either recurse or insert the bits in the quotient. + * Dynamic input: + * %o3 -- current remainder + * %o2 -- current quotient + * %o5 -- current comparand + * cc -- set on current value of %o3 + * Dynamic output: + * %o3', %o2', %o5', cc' + */ +#include "../assembly.h" +.text + .align 4 +DEFINE_COMPILERRT_FUNCTION(__umodsi3) + save %sp,-64,%sp ! do this for debugging + b divide + mov 0,%g3 ! result always nonnegative +DEFINE_COMPILERRT_FUNCTION(__modsi3) + save %sp,-64,%sp ! do this for debugging + orcc %o1,%o0,%g0 ! are either %o0 or %o1 negative + bge divide ! if not, skip this junk + mov %o0,%g3 ! record sign of result in sign of %g3 + tst %o1 + bge 2f + tst %o0 + ! %o1 < 0 + bge divide + neg %o1 + 2: + ! %o0 < 0 + neg %o0 + ! FALL THROUGH +divide: + ! Compute size of quotient, scale comparand. + orcc %o1,%g0,%o5 ! movcc %o1,%o5 + te 2 ! if %o1 = 0 + mov %o0,%o3 + mov 0,%o2 + sethi %hi(1<<(32-4 -1)),%g1 + cmp %o3,%g1 + blu not_really_big + mov 0,%o4 + ! + ! Here, the %o0 is >= 2ˆ(31-4) or so. We must be careful here, + ! as our usual 4-at-a-shot divide step will cause overflow and havoc. + ! The total number of bits in the result here is 4*%o4+%g2, where + ! %g2 <= 4. + ! Compute %o4 in an unorthodox manner: know we need to Shift %o5 into +! the top decade: so don't even bother to compare to %o3. +1: + cmp %o5,%g1 + bgeu 3f + mov 1,%g2 + sll %o5,4,%o5 + b 1b + inc %o4 +! Now compute %g2 +2: addcc %o5,%o5,%o5 + bcc not_too_big + add %g2,1,%g2 + ! We're here if the %o1 overflowed when Shifting. + ! This means that %o3 has the high-order bit set. + ! Restore %o5 and subtract from %o3. + sll %g1,4 ,%g1 ! high order bit + srl %o5,1,%o5 ! rest of %o5 + add %o5,%g1,%o5 + b do_single_div + dec %g2 +not_too_big: +3: cmp %o5,%o3 + blu 2b + nop + be do_single_div + nop +! %o5 > %o3: went too far: back up 1 step +! srl %o5,1,%o5 +! dec %g2 +! do single-bit divide steps +! +! We have to be careful here. We know that %o3 >= %o5, so we can do the +! first divide step without thinking. BUT, the others are conditional, +! and are only done if %o3 >= 0. Because both %o3 and %o5 may have the high- +! order bit set in the first step, just falling into the regular +! division loop will mess up the first time around. +! So we unroll slightly... +do_single_div: + deccc %g2 + bl end_regular_divide + nop + sub %o3,%o5,%o3 + mov 1,%o2 + b end_single_divloop + nop +single_divloop: + sll %o2,1,%o2 + bl 1f + srl %o5,1,%o5 + ! %o3 >= 0 + sub %o3,%o5,%o3 + b 2f + inc %o2 + 1: ! %o3 < 0 + add %o3,%o5,%o3 + dec %o2 + 2: + end_single_divloop: + deccc %g2 + bge single_divloop + tst %o3 + b end_regular_divide + nop +not_really_big: +1: + sll %o5,4,%o5 + cmp %o5,%o3 + bleu 1b + inccc %o4 + be got_result + dec %o4 +do_regular_divide: + ! Do the main division iteration + tst %o3 + ! Fall through into divide loop +divloop: + sll %o2,4,%o2 + !depth 1, accumulated bits 0 + bl L.1.16 + srl %o5,1,%o5 + ! remainder is nonnegative + subcc %o3,%o5,%o3 + !depth 2, accumulated bits 1 + bl L.2.17 + srl %o5,1,%o5 + ! remainder is nonnegative + subcc %o3,%o5,%o3 + !depth 3, accumulated bits 3 + bl L.3.19 + srl %o5,1,%o5 + ! remainder is nonnegative + subcc %o3,%o5,%o3 + !depth 4, accumulated bits 7 + bl L.4.23 + srl %o5,1,%o5 + ! remainder is nonnegative + subcc %o3,%o5,%o3 + b 9f + add %o2, (7*2+1), %o2 +L.4.23: + ! remainder is negative + addcc %o3,%o5,%o3 + b 9f + add %o2, (7*2-1), %o2 +L.3.19: + ! remainder is negative + addcc %o3,%o5,%o3 + !depth 4, accumulated bits 5 + bl L.4.21 + srl %o5,1,%o5 + ! remainder is nonnegative + subcc %o3,%o5,%o3 + b 9f + add %o2, (5*2+1), %o2 +L.4.21: + ! remainder is negative + addcc %o3,%o5,%o3 + b 9f + add %o2, (5*2-1), %o2 +L.2.17: + ! remainder is negative + addcc %o3,%o5,%o3 + !depth 3, accumulated bits 1 + bl L.3.17 + srl %o5,1,%o5 + ! remainder is nonnegative + subcc %o3,%o5,%o3 + !depth 4, accumulated bits 3 + bl L.4.19 + srl %o5,1,%o5 + ! remainder is nonnegative + subcc %o3,%o5,%o3 + b 9f + add %o2, (3*2+1), %o2 +L.4.19: + ! remainder is negative + addcc %o3,%o5,%o3 + b 9f + add %o2, (3*2-1), %o2 +L.3.17: + ! remainder is negative + addcc %o3,%o5,%o3 + !depth 4, accumulated bits 1 + bl L.4.17 + srl %o5,1,%o5 + ! remainder is nonnegative + subcc %o3,%o5,%o3 + b 9f + add %o2, (1*2+1), %o2 +L.4.17: + ! remainder is negative + addcc %o3,%o5,%o3 + b 9f + add %o2, (1*2-1), %o2 +L.1.16: + ! remainder is negative + addcc %o3,%o5,%o3 + !depth 2, accumulated bits -1 + bl L.2.15 + srl %o5,1,%o5 + ! remainder is nonnegative + subcc %o3,%o5,%o3 + !depth 3, accumulated bits -1 + bl L.3.15 + srl %o5,1,%o5 + ! remainder is nonnegative + subcc %o3,%o5,%o3 + !depth 4, accumulated bits -1 + bl L.4.15 + srl %o5,1,%o5 + ! remainder is nonnegative + subcc %o3,%o5,%o3 + b 9f + add %o2, (-1*2+1), %o2 +L.4.15: + ! remainder is negative + addcc %o3,%o5,%o3 + b 9f + add %o2, (-1*2-1), %o2 +L.3.15: + ! remainder is negative + addcc %o3,%o5,%o3 + !depth 4, accumulated bits -3 + bl L.4.13 + srl %o5,1,%o5 + ! remainder is nonnegative + subcc %o3,%o5,%o3 + b 9f + add %o2, (-3*2+1), %o2 +L.4.13: + ! remainder is negative + addcc %o3,%o5,%o3 + b 9f + add %o2, (-3*2-1), %o2 +L.2.15: + ! remainder is negative + addcc %o3,%o5,%o3 + !depth 3, accumulated bits -3 + bl L.3.13 + srl %o5,1,%o5 + ! remainder is nonnegative + subcc %o3,%o5,%o3 + !depth 4, accumulated bits -5 + bl L.4.11 + srl %o5,1,%o5 + ! remainder is nonnegative + subcc %o3,%o5,%o3 + b 9f + add %o2, (-5*2+1), %o2 +L.4.11: + ! remainder is negative + addcc %o3,%o5,%o3 + b 9f + add %o2, (-5*2-1), %o2 +L.3.13: + ! remainder is negative + addcc %o3,%o5,%o3 + !depth 4, accumulated bits -7 + bl L.4.9 + srl %o5,1,%o5 + ! remainder is nonnegative + subcc %o3,%o5,%o3 + b 9f + add %o2, (-7*2+1), %o2 +L.4.9: + ! remainder is negative + addcc %o3,%o5,%o3 + b 9f + add %o2, (-7*2-1), %o2 + 9: +end_regular_divide: + deccc %o4 + bge divloop + tst %o3 + bge got_result + nop + ! non-restoring fixup here + add %o3,%o1,%o3 +got_result: + tst %g3 + bge 1f + restore + ! answer < 0 + retl ! leaf-routine return + neg %o3,%o0 ! remainder <- -%o3 +1: + retl ! leaf-routine return + mov %o3,%o0 ! remainder <- %o3 Added: head/contrib/compiler-rt/lib/sparc64/udivsi3.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/compiler-rt/lib/sparc64/udivsi3.S Thu Jan 12 17:55:22 2012 (r230025) @@ -0,0 +1 @@ +! This file intentionally left blank Added: head/contrib/compiler-rt/lib/sparc64/umodsi3.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/compiler-rt/lib/sparc64/umodsi3.S Thu Jan 12 17:55:22 2012 (r230025) @@ -0,0 +1 @@ +! This file intentionally left blank From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 18:39:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6ED63106566B; Thu, 12 Jan 2012 18:39:37 +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 528E58FC08; Thu, 12 Jan 2012 18:39: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 q0CIdb3B021716; Thu, 12 Jan 2012 18:39:37 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0CIdbID021713; Thu, 12 Jan 2012 18:39:37 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201201121839.q0CIdbID021713@svn.freebsd.org> From: Robert Watson Date: Thu, 12 Jan 2012 18:39: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: r230026 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 18:39:37 -0000 Author: rwatson Date: Thu Jan 12 18:39:37 2012 New Revision: 230026 URL: http://svn.freebsd.org/changeset/base/230026 Log: Clarify throughout the vlan(4) code the difference between a "tag" (the 802.1q-defined 16-bit VID, CFI, and PCP field in host by order) and a VLAN ID (VID). Tags go in packets. VIDs identify VLANs. No functional change is intended, so this should be safe to MFC. Further cleanup with functional changes will be committed separately (for example, renaming vlan_tag/vlan_tag_p, which modify the KPI and KBI). Reviewed by: bz Sponsored by: ADARA Networks, Inc. MFC after: 3 days Modified: head/sys/net/if_vlan.c head/sys/net/if_vlan_var.h Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Thu Jan 12 17:55:22 2012 (r230025) +++ head/sys/net/if_vlan.c Thu Jan 12 18:39:37 2012 (r230026) @@ -114,7 +114,7 @@ struct ifvlan { #endif }; #define ifv_proto ifv_mib.ifvm_proto -#define ifv_tag ifv_mib.ifvm_tag +#define ifv_vid ifv_mib.ifvm_tag #define ifv_encaplen ifv_mib.ifvm_encaplen #define ifv_mtufudge ifv_mib.ifvm_mtufudge #define ifv_mintu ifv_mib.ifvm_mintu @@ -178,7 +178,7 @@ static int vlan_inshash(struct ifvlantru static int vlan_remhash(struct ifvlantrunk *trunk, struct ifvlan *ifv); static void vlan_growhash(struct ifvlantrunk *trunk, int howmuch); static __inline struct ifvlan * vlan_gethash(struct ifvlantrunk *trunk, - uint16_t tag); + uint16_t vid); #endif static void trunk_destroy(struct ifvlantrunk *trunk); @@ -198,7 +198,7 @@ static void vlan_link_state(struct ifnet static void vlan_capabilities(struct ifvlan *ifv); static void vlan_trunk_capabilities(struct ifnet *ifp); -static struct ifnet *vlan_clone_match_ethertag(struct if_clone *, +static struct ifnet *vlan_clone_match_ethervid(struct if_clone *, const char *, int *); static int vlan_clone_match(struct if_clone *, const char *); static int vlan_clone_create(struct if_clone *, char *, size_t, caddr_t); @@ -266,9 +266,9 @@ vlan_inshash(struct ifvlantrunk *trunk, KASSERT(trunk->hwidth > 0, ("%s: hwidth not positive", __func__)); b = 1 << trunk->hwidth; - i = HASH(ifv->ifv_tag, trunk->hmask); + i = HASH(ifv->ifv_vid, trunk->hmask); LIST_FOREACH(ifv2, &trunk->hash[i], ifv_list) - if (ifv->ifv_tag == ifv2->ifv_tag) + if (ifv->ifv_vid == ifv2->ifv_vid) return (EEXIST); /* @@ -278,7 +278,7 @@ vlan_inshash(struct ifvlantrunk *trunk, */ if (trunk->refcnt > (b * b) / 2) { vlan_growhash(trunk, 1); - i = HASH(ifv->ifv_tag, trunk->hmask); + i = HASH(ifv->ifv_vid, trunk->hmask); } LIST_INSERT_HEAD(&trunk->hash[i], ifv, ifv_list); trunk->refcnt++; @@ -296,7 +296,7 @@ vlan_remhash(struct ifvlantrunk *trunk, KASSERT(trunk->hwidth > 0, ("%s: hwidth not positive", __func__)); b = 1 << trunk->hwidth; - i = HASH(ifv->ifv_tag, trunk->hmask); + i = HASH(ifv->ifv_vid, trunk->hmask); LIST_FOREACH(ifv2, &trunk->hash[i], ifv_list) if (ifv2 == ifv) { trunk->refcnt--; @@ -348,7 +348,7 @@ vlan_growhash(struct ifvlantrunk *trunk, for (i = 0; i < n; i++) while ((ifv = LIST_FIRST(&trunk->hash[i])) != NULL) { LIST_REMOVE(ifv, ifv_list); - j = HASH(ifv->ifv_tag, n2 - 1); + j = HASH(ifv->ifv_vid, n2 - 1); LIST_INSERT_HEAD(&hash2[j], ifv, ifv_list); } free(trunk->hash, M_VLAN); @@ -362,14 +362,14 @@ vlan_growhash(struct ifvlantrunk *trunk, } static __inline struct ifvlan * -vlan_gethash(struct ifvlantrunk *trunk, uint16_t tag) +vlan_gethash(struct ifvlantrunk *trunk, uint16_t vid) { struct ifvlan *ifv; TRUNK_LOCK_RASSERT(trunk); - LIST_FOREACH(ifv, &trunk->hash[HASH(tag, trunk->hmask)], ifv_list) - if (ifv->ifv_tag == tag) + LIST_FOREACH(ifv, &trunk->hash[HASH(vid, trunk->hmask)], ifv_list) + if (ifv->ifv_vid == vid) return (ifv); return (NULL); } @@ -393,19 +393,19 @@ vlan_dumphash(struct ifvlantrunk *trunk) #else static __inline struct ifvlan * -vlan_gethash(struct ifvlantrunk *trunk, uint16_t tag) +vlan_gethash(struct ifvlantrunk *trunk, uint16_t vid) { - return trunk->vlans[tag]; + return trunk->vlans[vid]; } static __inline int vlan_inshash(struct ifvlantrunk *trunk, struct ifvlan *ifv) { - if (trunk->vlans[ifv->ifv_tag] != NULL) + if (trunk->vlans[ifv->ifv_vid] != NULL) return EEXIST; - trunk->vlans[ifv->ifv_tag] = ifv; + trunk->vlans[ifv->ifv_vid] = ifv; trunk->refcnt++; return (0); @@ -415,7 +415,7 @@ static __inline int vlan_remhash(struct ifvlantrunk *trunk, struct ifvlan *ifv) { - trunk->vlans[ifv->ifv_tag] = NULL; + trunk->vlans[ifv->ifv_vid] = NULL; trunk->refcnt--; return (0); @@ -617,17 +617,21 @@ vlan_trunkdev(struct ifnet *ifp) } /* - * Return the 16bit vlan tag for this interface. + * Return the 12-bit VLAN VID for this interface, for use by external + * components such as Infiniband. + * + * XXXRW: Note that the function name here is historical; it should be named + * vlan_vid(). */ static int -vlan_tag(struct ifnet *ifp, uint16_t *tagp) +vlan_tag(struct ifnet *ifp, uint16_t *vidp) { struct ifvlan *ifv; if (ifp->if_type != IFT_L2VLAN) return (EINVAL); ifv = ifp->if_softc; - *tagp = ifv->ifv_tag; + *vidp = ifv->ifv_vid; return (0); } @@ -663,10 +667,10 @@ vlan_setcookie(struct ifnet *ifp, void * } /* - * Return the vlan device present at the specific tag. + * Return the vlan device present at the specific VID. */ static struct ifnet * -vlan_devat(struct ifnet *ifp, uint16_t tag) +vlan_devat(struct ifnet *ifp, uint16_t vid) { struct ifvlantrunk *trunk; struct ifvlan *ifv; @@ -676,7 +680,7 @@ vlan_devat(struct ifnet *ifp, uint16_t t return (NULL); ifp = NULL; TRUNK_RLOCK(trunk); - ifv = vlan_gethash(trunk, tag); + ifv = vlan_gethash(trunk, vid); if (ifv) ifp = ifv->ifv_ifp; TRUNK_RUNLOCK(trunk); @@ -786,11 +790,11 @@ VNET_SYSUNINIT(vnet_vlan_uninit, SI_SUB_ #endif static struct ifnet * -vlan_clone_match_ethertag(struct if_clone *ifc, const char *name, int *tag) +vlan_clone_match_ethervid(struct if_clone *ifc, const char *name, int *vidp) { const char *cp; struct ifnet *ifp; - int t; + int vid; /* Check for . style interface names. */ IFNET_RLOCK_NOSLEEP(); @@ -809,13 +813,13 @@ vlan_clone_match_ethertag(struct if_clon continue; if (*cp == '\0') continue; - t = 0; + vid = 0; for(; *cp >= '0' && *cp <= '9'; cp++) - t = (t * 10) + (*cp - '0'); + vid = (vid * 10) + (*cp - '0'); if (*cp != '\0') continue; - if (tag != NULL) - *tag = t; + if (vidp != NULL) + *vidp = vid; break; } IFNET_RUNLOCK_NOSLEEP(); @@ -828,7 +832,7 @@ vlan_clone_match(struct if_clone *ifc, c { const char *cp; - if (vlan_clone_match_ethertag(ifc, name, NULL) != NULL) + if (vlan_clone_match_ethervid(ifc, name, NULL) != NULL) return (1); if (strncmp(VLANNAME, name, strlen(VLANNAME)) != 0) @@ -848,7 +852,7 @@ vlan_clone_create(struct if_clone *ifc, int wildcard; int unit; int error; - int tag; + int vid; int ethertag; struct ifvlan *ifv; struct ifnet *ifp; @@ -866,6 +870,9 @@ vlan_clone_create(struct if_clone *ifc, * must be configured separately. * The first technique is preferred; the latter two are * supported for backwards compatibilty. + * + * XXXRW: Note historic use of the word "tag" here. New ioctls may be + * called for. */ if (params) { error = copyin(params, &vlr, sizeof(vlr)); @@ -875,7 +882,7 @@ vlan_clone_create(struct if_clone *ifc, if (p == NULL) return ENXIO; /* - * Don't let the caller set up a VLAN tag with + * Don't let the caller set up a VLAN VID with * anything except VLID bits. */ if (vlr.vlr_tag & ~EVL_VLID_MASK) @@ -885,18 +892,18 @@ vlan_clone_create(struct if_clone *ifc, return (error); ethertag = 1; - tag = vlr.vlr_tag; + vid = vlr.vlr_tag; wildcard = (unit < 0); - } else if ((p = vlan_clone_match_ethertag(ifc, name, &tag)) != NULL) { + } else if ((p = vlan_clone_match_ethervid(ifc, name, &vid)) != NULL) { ethertag = 1; unit = -1; wildcard = 0; /* - * Don't let the caller set up a VLAN tag with + * Don't let the caller set up a VLAN VID with * anything except VLID bits. */ - if (tag & ~EVL_VLID_MASK) + if (vid & ~EVL_VLID_MASK) return (EINVAL); } else { ethertag = 0; @@ -958,7 +965,7 @@ vlan_clone_create(struct if_clone *ifc, sdl->sdl_type = IFT_L2VLAN; if (ethertag) { - error = vlan_config(ifv, p, tag); + error = vlan_config(ifv, p, vid); if (error != 0) { /* * Since we've partialy failed, we need to back @@ -1068,10 +1075,10 @@ vlan_transmit(struct ifnet *ifp, struct * packet tag that holds it. */ if (p->if_capenable & IFCAP_VLAN_HWTAGGING) { - m->m_pkthdr.ether_vtag = ifv->ifv_tag; + m->m_pkthdr.ether_vtag = ifv->ifv_vid; m->m_flags |= M_VLANTAG; } else { - m = ether_vlanencap(m, ifv->ifv_tag); + m = ether_vlanencap(m, ifv->ifv_vid); if (m == NULL) { if_printf(ifp, "unable to prepend VLAN header\n"); ifp->if_oerrors++; @@ -1105,7 +1112,7 @@ vlan_input(struct ifnet *ifp, struct mbu { struct ifvlantrunk *trunk = ifp->if_vlantrunk; struct ifvlan *ifv; - uint16_t tag; + uint16_t vid; KASSERT(trunk != NULL, ("%s: no trunk", __func__)); @@ -1114,7 +1121,7 @@ vlan_input(struct ifnet *ifp, struct mbu * Packet is tagged, but m contains a normal * Ethernet frame; the tag is stored out-of-band. */ - tag = EVL_VLANOFTAG(m->m_pkthdr.ether_vtag); + vid = EVL_VLANOFTAG(m->m_pkthdr.ether_vtag); m->m_flags &= ~M_VLANTAG; } else { struct ether_vlan_header *evl; @@ -1130,7 +1137,7 @@ vlan_input(struct ifnet *ifp, struct mbu return; } evl = mtod(m, struct ether_vlan_header *); - tag = EVL_VLANOFTAG(ntohs(evl->evl_tag)); + vid = EVL_VLANOFTAG(ntohs(evl->evl_tag)); /* * Remove the 802.1q header by copying the Ethernet @@ -1155,7 +1162,7 @@ vlan_input(struct ifnet *ifp, struct mbu } TRUNK_RLOCK(trunk); - ifv = vlan_gethash(trunk, tag); + ifv = vlan_gethash(trunk, vid); if (ifv == NULL || !UP_AND_RUNNING(ifv->ifv_ifp)) { TRUNK_RUNLOCK(trunk); m_freem(m); @@ -1172,14 +1179,14 @@ vlan_input(struct ifnet *ifp, struct mbu } static int -vlan_config(struct ifvlan *ifv, struct ifnet *p, uint16_t tag) +vlan_config(struct ifvlan *ifv, struct ifnet *p, uint16_t vid) { struct ifvlantrunk *trunk; struct ifnet *ifp; int error = 0; /* VID numbers 0x0 and 0xFFF are reserved */ - if (tag == 0 || tag == 0xFFF) + if (vid == 0 || vid == 0xFFF) return (EINVAL); if (p->if_type != IFT_ETHER && (p->if_capenable & IFCAP_VLAN_HWTAGGING) == 0) @@ -1211,7 +1218,7 @@ exists: TRUNK_LOCK(trunk); } - ifv->ifv_tag = tag; /* must set this before vlan_inshash() */ + ifv->ifv_vid = vid; /* must set this before vlan_inshash() */ error = vlan_inshash(trunk, ifv); if (error) goto done; @@ -1289,7 +1296,7 @@ exists: done: TRUNK_UNLOCK(trunk); if (error == 0) - EVENTHANDLER_INVOKE(vlan_config, p, ifv->ifv_tag); + EVENTHANDLER_INVOKE(vlan_config, p, ifv->ifv_vid); VLAN_UNLOCK(); return (error); @@ -1377,7 +1384,7 @@ vlan_unconfig_locked(struct ifnet *ifp) * to cleanup anyway. */ if (parent != NULL) - EVENTHANDLER_INVOKE(vlan_unconfig, parent, ifv->ifv_tag); + EVENTHANDLER_INVOKE(vlan_unconfig, parent, ifv->ifv_vid); } /* Handle a reference counted flag that should be set on the parent as well */ @@ -1622,7 +1629,7 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd break; } /* - * Don't let the caller set up a VLAN tag with + * Don't let the caller set up a VLAN VID with * anything except VLID bits. */ if (vlr.vlr_tag & ~EVL_VLID_MASK) { @@ -1649,7 +1656,7 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd if (TRUNK(ifv) != NULL) { strlcpy(vlr.vlr_parent, PARENT(ifv)->if_xname, sizeof(vlr.vlr_parent)); - vlr.vlr_tag = ifv->ifv_tag; + vlr.vlr_tag = ifv->ifv_vid; } VLAN_UNLOCK(); error = copyout(&vlr, ifr->ifr_data, sizeof(vlr)); Modified: head/sys/net/if_vlan_var.h ============================================================================== --- head/sys/net/if_vlan_var.h Thu Jan 12 17:55:22 2012 (r230025) +++ head/sys/net/if_vlan_var.h Thu Jan 12 18:39:37 2012 (r230026) @@ -108,7 +108,7 @@ struct vlanreq { * received VLAN tag (containing both vlan and priority information) * into the ether_vtag mbuf packet header field: * - * m->m_pkthdr.ether_vtag = vlan_id; // ntohs()? + * m->m_pkthdr.ether_vtag = vtag; // ntohs()? * m->m_flags |= M_VLANTAG; * * to mark the packet m with the specified VLAN tag. @@ -133,15 +133,15 @@ struct vlanreq { #define VLAN_TRUNKDEV(_ifp) \ (_ifp)->if_type == IFT_L2VLAN ? (*vlan_trunkdev_p)((_ifp)) : NULL -#define VLAN_TAG(_ifp, _tag) \ - (_ifp)->if_type == IFT_L2VLAN ? (*vlan_tag_p)((_ifp), (_tag)) : EINVAL +#define VLAN_TAG(_ifp, _vid) \ + (_ifp)->if_type == IFT_L2VLAN ? (*vlan_tag_p)((_ifp), (_vid)) : EINVAL #define VLAN_COOKIE(_ifp) \ (_ifp)->if_type == IFT_L2VLAN ? (*vlan_cookie_p)((_ifp)) : NULL #define VLAN_SETCOOKIE(_ifp, _cookie) \ (_ifp)->if_type == IFT_L2VLAN ? \ (*vlan_setcookie_p)((_ifp), (_cookie)) : EINVAL -#define VLAN_DEVAT(_ifp, _tag) \ - (_ifp)->if_vlantrunk != NULL ? (*vlan_devat_p)((_ifp), (_tag)) : NULL +#define VLAN_DEVAT(_ifp, _vid) \ + (_ifp)->if_vlantrunk != NULL ? (*vlan_devat_p)((_ifp), (_vid)) : NULL extern void (*vlan_trunk_cap_p)(struct ifnet *); extern struct ifnet *(*vlan_trunkdev_p)(struct ifnet *); From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 19:33:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9590D106564A for ; Thu, 12 Jan 2012 19:33:24 +0000 (UTC) (envelope-from pfg@freebsd.org) Received: from nm11.bullet.mail.sp2.yahoo.com (nm11.bullet.mail.sp2.yahoo.com [98.139.91.81]) by mx1.freebsd.org (Postfix) with SMTP id 6CB5B8FC15 for ; Thu, 12 Jan 2012 19:33:24 +0000 (UTC) Received: from [98.139.91.68] by nm11.bullet.mail.sp2.yahoo.com with NNFMP; 12 Jan 2012 19:33:24 -0000 Received: from [98.139.91.36] by tm8.bullet.mail.sp2.yahoo.com with NNFMP; 12 Jan 2012 19:33:24 -0000 Received: from [127.0.0.1] by omp1036.mail.sp2.yahoo.com with NNFMP; 12 Jan 2012 19:33:24 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 52261.87007.bm@omp1036.mail.sp2.yahoo.com Received: (qmail 44936 invoked by uid 60001); 12 Jan 2012 19:33:23 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1326396803; bh=doK6XD9YP7KhNwNvh0iVQM104GGVlwGqCbm6URuH3Qk=; h=X-YMail-OSG:Received:X-RocketYMMF:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=1W6EjK6dr8affuI6HpHhj3qCCd9ZHbVa/vN4GjkNnf8/FXFrluw8lb9kosojeYBm0jNzGb9DQ8VtwMlydryHtSYrbMMiHFY0CeDDs7JO4bNOYw/3bqBjctEniZV/pEXoHhXLnL7g6oOJYaHP4UPhfRlh7O/jjOmsDhRZhOOWOXo= X-YMail-OSG: 4m6HZiIVM1nWBXvJ5yJwBpoCa6xQ32FmoghyaputhW3E4LI ixBiSLGAMPkpJ_0aRAwodny0n1En0eDHbuYqxEctxCVGmiUHNCSR1xGUR.dT mqBQkaacsEuvid1VOgdU8uxzcncOG0seBZx3XaLNbGDm6kAJ8CFPvSLkH4us diKC0tAAiZHQ2eLaqk6hK7.L1ovHxRxdZ1eB.TLigpjq11p6iE8YTq6f_8GS fJRjnl1T.wx.XPbZVcDpBuYoZQO_Ciyo4IzIt4g06cAWNMc47njzcIqpT6DW rioU12sc.ilj8xg6qm8bEN3W_nfwUlWhc88B0qAzOcIRF9xGQS.Mhd8O48lv teRCEY0cBJYmE6sZ5kAenCJw5ccvHqhXHfP4GhJzVq7jXirmCv3SMlufGv41 yrDgAmA_8mBmTP_C1NuE95AGR6eR0K8CHPiT8CVeNpTs0wOmwrThUUWjr5oa dfaTNrXNhRjSk8b0eTkLporX.5pxtR1ZVAqb5bKmd Received: from [200.118.157.7] by web113506.mail.gq1.yahoo.com via HTTP; Thu, 12 Jan 2012 11:33:23 PST X-RocketYMMF: giffunip X-Mailer: YahooMailClassic/15.0.4 YahooMailWebService/0.8.115.331698 Message-ID: <1326396803.27040.YahooMailClassic@web113506.mail.gq1.yahoo.com> Date: Thu, 12 Jan 2012 11:33:23 -0800 (PST) From: Pedro Giffuni To: John Baldwin In-Reply-To: <201201120743.41757.jhb@freebsd.org> MIME-Version: 1.0 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, joel@freebsd.org Subject: Re: svn commit: r229981 - in head/sys: conf dev/sound/pci gnu/dev/sound/pci modules/sound/driver/emu10kx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pfg@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 19:33:24 -0000 Hello;=0A=0A--- Gio 12/1/12, John Baldwin ha scritto:=0A= =0A> Da: John Baldwin =0A> Oggetto: Re: svn commit: r22998= 1 - in head/sys: conf dev/sound/pci gnu/dev/sound/pci modules/sound/driver/= emu10kx=0A> A: "Pedro F. Giffuni" =0A> Cc: src-committers@= freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, joel@freebs= d.org=0A> Data: Gioved=EC 12 gennaio 2012, 07:43=0A> On Wednesday, January = 11, 2012=0A> 4:17:14 pm Pedro F. Giffuni wrote:=0A> > Author: pfg=0A> > Dat= e: Wed Jan 11 21:17:14 2012=0A> > New Revision: 229981=0A> > URL: http://sv= n.freebsd.org/changeset/base/229981=0A> >=0A...=A0=A0=A0=0A> >=A0=A0=A0The = emu10kx driver is now free from the GPL.=0A> >=A0=A0=A0=0A> >=A0=A0=A0PR:= =A0=A0=A0 =A0=A0=A0 153901=0A> >=A0=A0=A0Tested by:=A0=A0=A0 mav, joel=0A> = >=A0=A0=A0Approved by:=A0=A0=A0 jhb (mentor)=0A> >=A0=A0=A0MFC after:=A0=A0= =A0 2 weeks=0A> =0A> Is the emu10kx driver a superset of em10k1 now (meanin= g=0A> does it support all=0A> the em10k1 devices and should em10k1 be retir= ed)?=0A> =0A=0ABoth device drivers seem to have diverged significantly=0Aan= d while emu10kx seems to be superior, some people still=0Ahave problems wit= h it:=0A=0Ahttp://docs.freebsd.org/cgi/mid.cgi?201201100024.q0A0OF24069073= =0A=0Aso I suggest we keep both at least for a while.=0A=0A> Also, it seems= we should definitely add 'snd_emu10kx' to=0A> GENERIC on x86 and possible = 'snd_emu10k1'.=0A> =0A=0A+1=0A=0APedro. From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 19:37:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B55DF106564A; Thu, 12 Jan 2012 19:37:12 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-tul01m020-f182.google.com (mail-tul01m020-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 319F08FC12; Thu, 12 Jan 2012 19:37:11 +0000 (UTC) Received: by obbta17 with SMTP id ta17so1762944obb.13 for ; Thu, 12 Jan 2012 11:37:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=KXij0YTuK7jwcDz8ACxCxisT0Nmh2uu2giPY+u2O43M=; b=ifWOo2T62Xz+Osb5IsmJBj2F2bMKhlSsLwtl378AoJRVTND0j+xFOLOMHtIYzu68NM 679xyDo3/GrLp4T6cpnJCCIAtbs5cJGnae/nbVsOsCfrao5waKHTJeoPNXkt+xg7/5kj A+cPLuMg/RSC8yxyPtRiN/nrESwpWRrFjcvAY= Received: by 10.50.214.73 with SMTP id ny9mr5826910igc.1.1326397031486; Thu, 12 Jan 2012 11:37:11 -0800 (PST) Received: from kruse-40.4.ixsystems.com (drawbridge.ixsystems.com. [206.40.55.65]) by mx.google.com with ESMTPS id 36sm20344413ibc.6.2012.01.12.11.37.09 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 12 Jan 2012 11:37:10 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=iso-8859-1 From: Garrett Cooper In-Reply-To: <1326396803.27040.YahooMailClassic@web113506.mail.gq1.yahoo.com> Date: Thu, 12 Jan 2012 11:37:13 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <157C90FE-FB2E-4710-881E-70C47A5C08B9@gmail.com> References: <1326396803.27040.YahooMailClassic@web113506.mail.gq1.yahoo.com> To: pfg@freebsd.org X-Mailer: Apple Mail (2.1251.1) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin , joel@freebsd.org Subject: Re: svn commit: r229981 - in head/sys: conf dev/sound/pci gnu/dev/sound/pci modules/sound/driver/emu10kx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 19:37:12 -0000 On Jan 12, 2012, at 11:33 AM, Pedro Giffuni wrote: > Hello; >=20 > --- Gio 12/1/12, John Baldwin ha scritto: >=20 >> Da: John Baldwin >> Oggetto: Re: svn commit: r229981 - in head/sys: conf dev/sound/pci = gnu/dev/sound/pci modules/sound/driver/emu10kx >> A: "Pedro F. Giffuni" >> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, = svn-src-head@freebsd.org, joel@freebsd.org >> Data: Gioved=EC 12 gennaio 2012, 07:43 >> On Wednesday, January 11, 2012 >> 4:17:14 pm Pedro F. Giffuni wrote: >>> Author: pfg >>> Date: Wed Jan 11 21:17:14 2012 >>> New Revision: 229981 >>> URL: http://svn.freebsd.org/changeset/base/229981 >>>=20 > ... =20 >>> The emu10kx driver is now free from the GPL. >>> =20 >>> PR: 153901 >>> Tested by: mav, joel >>> Approved by: jhb (mentor) >>> MFC after: 2 weeks >>=20 >> Is the emu10kx driver a superset of em10k1 now (meaning >> does it support all >> the em10k1 devices and should em10k1 be retired)? >>=20 >=20 > Both device drivers seem to have diverged significantly > and while emu10kx seems to be superior, some people still > have problems with it: >=20 > http://docs.freebsd.org/cgi/mid.cgi?201201100024.q0A0OF24069073 >=20 > so I suggest we keep both at least for a while. >=20 >> Also, it seems we should definitely add 'snd_emu10kx' to >> GENERIC on x86 and possible 'snd_emu10k1'. >>=20 SB Audigy chipsets are also treated differently for both cases. = My Audigy 4 card for instance is detected with both drivers, but only = the 10kx driver works with the card; similarly IIRC there are some = things that work with the 10k1 driver that don't work the same with the = 10kx. So while this would be nice to have, I'm not sure if it's an = effective use of FreeBSD's time to invest in as these chipsets are = effectively obsolete. Thanks! -Garrett= From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 19:38:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63A42106566C; Thu, 12 Jan 2012 19:38:20 +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 38C758FC21; Thu, 12 Jan 2012 19:38:20 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id E51FE46B90; Thu, 12 Jan 2012 14:38:19 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 30187B95A; Thu, 12 Jan 2012 14:38:19 -0500 (EST) From: John Baldwin To: Eygene Ryabinkin Date: Thu, 12 Jan 2012 14:38:16 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201201120648.q0C6mBio096662@svn.freebsd.org> <201201120748.28564.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201201121438.16674.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 12 Jan 2012 14:38:19 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230007 - in head: etc etc/rc.d share/man/man8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 19:38:20 -0000 On Thursday, January 12, 2012 9:35:05 am Eygene Ryabinkin wrote: > Thu, Jan 12, 2012 at 07:48:28AM -0500, John Baldwin wrote: > > Alternatively, devd could have invoked a wrapper script that only > > ran /etc/rc.d/dhclient if dhcpif was true for the interface. All > > other uses of /etc/rc.d/dhclient in our system scripts are > > conditional on that check. > > True, and it was suggested by Doug Barton. But why bother when > the 'quiet' keyword is reserved for such cases? Hmm, that's not quite how I see this. Either /etc/rc.d/dhclient should silently exit if dhcpif is not true for the given interface, or it should always whine IMO. Given that everywhere else uses dhcpif to decide if dhclient should be run, it seems that an explicit test of that should be used here as well, even if it means an extra script. In short, this approach is not consisent with all other users of the dhclient script, and this seems a hackish approach whose primary goal is to avoid having devd use a wrapper script. Perhaps that goal is worth the tradeoff, but it's not really clean. By your argument, btw since we use quietstart during boot, ifn_start shouldn't even check dhcpif at all now, but just always run the dhclient script (and if you did make that change, I would protest that it was very wrong). -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 20:30:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA1C2106564A; Thu, 12 Jan 2012 20:30:20 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 98B2A8FC12; Thu, 12 Jan 2012 20:30: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 q0CKUKMu025107; Thu, 12 Jan 2012 20:30:20 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0CKUKiV025105; Thu, 12 Jan 2012 20:30:20 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201201122030.q0CKUKiV025105@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 12 Jan 2012 20:30:20 +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: r230027 - head/usr.bin/printf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 20:30:20 -0000 Author: pfg Date: Thu Jan 12 20:30:20 2012 New Revision: 230027 URL: http://svn.freebsd.org/changeset/base/230027 Log: Style cleanups for printf. PR: bin/152934 Approved by: jhb (mentor) Obtained from: Illumos MFC after: 2 weeks Modified: head/usr.bin/printf/printf.c Modified: head/usr.bin/printf/printf.c ============================================================================== --- head/usr.bin/printf/printf.c Thu Jan 12 18:39:37 2012 (r230026) +++ head/usr.bin/printf/printf.c Thu Jan 12 20:30:20 2012 (r230027) @@ -66,21 +66,21 @@ static const char rcsid[] = #include "error.h" #endif -#define PF(f, func) do { \ - char *b = NULL; \ - if (havewidth) \ - if (haveprec) \ +#define PF(f, func) do { \ + char *b = NULL; \ + if (havewidth) \ + if (haveprec) \ (void)asprintf(&b, f, fieldwidth, precision, func); \ - else \ - (void)asprintf(&b, f, fieldwidth, func); \ - else if (haveprec) \ - (void)asprintf(&b, f, precision, func); \ - else \ - (void)asprintf(&b, f, func); \ - if (b) { \ - (void)fputs(b, stdout); \ - free(b); \ - } \ + else \ + (void)asprintf(&b, f, fieldwidth, func); \ + else if (haveprec) \ + (void)asprintf(&b, f, precision, func); \ + else \ + (void)asprintf(&b, f, func); \ + if (b) { \ + (void)fputs(b, stdout); \ + free(b); \ + } \ } while (0) static int asciicode(void); @@ -357,10 +357,10 @@ mknum(char *str, char ch) static int escape(char *fmt, int percent, size_t *len) { - char *save, *store; - int value, c; + char *save, *store, c; + int value; - for (save = store = fmt; (c = *fmt); ++fmt, ++store) { + for (save = store = fmt; ((c = *fmt) != 0); ++fmt, ++store) { if (c != '\\') { *store = c; continue; @@ -414,7 +414,7 @@ escape(char *fmt, int percent, size_t *l *store++ = '%'; *store = '%'; } else - *store = value; + *store = (char)value; break; default: *store = *fmt; From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 20:39:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6BFA1065670; Thu, 12 Jan 2012 20:39:54 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 94D7F8FC13; Thu, 12 Jan 2012 20:39: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 q0CKds5L025446; Thu, 12 Jan 2012 20:39:54 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0CKds35025444; Thu, 12 Jan 2012 20:39:54 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201201122039.q0CKds35025444@svn.freebsd.org> From: Christian Brueffer Date: Thu, 12 Jan 2012 20:39:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230028 - stable/9/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 20:39:54 -0000 Author: brueffer Date: Thu Jan 12 20:39:54 2012 New Revision: 230028 URL: http://svn.freebsd.org/changeset/base/230028 Log: MFC: r229585 Fix typo. Modified: stable/9/share/man/man4/bce.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/bce.4 ============================================================================== --- stable/9/share/man/man4/bce.4 Thu Jan 12 20:30:20 2012 (r230027) +++ stable/9/share/man/man4/bce.4 Thu Jan 12 20:39:54 2012 (r230028) @@ -251,7 +251,7 @@ status block. .It "bce%d: Could not allocate status block DMA memory!" The driver could not allocate DMA addressable memory for the controller's status block. -.It "bce_d: Could not map status block DMA memory!" +.It "bce%d: Could not map status block DMA memory!" The driver could not map the status block memory into the controller's DMA address space. .It "bce%d: Could not allocate statistics block DMA tag!" From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 20:45:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11C3F1065670; Thu, 12 Jan 2012 20:45:57 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F406A8FC15; Thu, 12 Jan 2012 20:45: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 q0CKjuc5025695; Thu, 12 Jan 2012 20:45:56 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0CKjurQ025693; Thu, 12 Jan 2012 20:45:56 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201201122045.q0CKjurQ025693@svn.freebsd.org> From: Christian Brueffer Date: Thu, 12 Jan 2012 20:45:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230029 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 20:45:57 -0000 Author: brueffer Date: Thu Jan 12 20:45:56 2012 New Revision: 230029 URL: http://svn.freebsd.org/changeset/base/230029 Log: MFC: r229585 Fix typo. Modified: stable/8/share/man/man4/bce.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/bce.4 ============================================================================== --- stable/8/share/man/man4/bce.4 Thu Jan 12 20:39:54 2012 (r230028) +++ stable/8/share/man/man4/bce.4 Thu Jan 12 20:45:56 2012 (r230029) @@ -251,7 +251,7 @@ status block. .It "bce%d: Could not allocate status block DMA memory!" The driver could not allocate DMA addressable memory for the controller's status block. -.It "bce_d: Could not map status block DMA memory!" +.It "bce%d: Could not map status block DMA memory!" The driver could not map the status block memory into the controller's DMA address space. .It "bce%d: Could not allocate statistics block DMA tag!" From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 20:51:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3592106566C; Thu, 12 Jan 2012 20:51:01 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D15CA8FC12; Thu, 12 Jan 2012 20:51:01 +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 q0CKp1Pw025962; Thu, 12 Jan 2012 20:51:01 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0CKp1Ei025960; Thu, 12 Jan 2012 20:51:01 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201201122051.q0CKp1Ei025960@svn.freebsd.org> From: Christian Brueffer Date: Thu, 12 Jan 2012 20:51:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230030 - stable/7/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 20:51:02 -0000 Author: brueffer Date: Thu Jan 12 20:51:01 2012 New Revision: 230030 URL: http://svn.freebsd.org/changeset/base/230030 Log: MFC: r229585 Fix typo. Modified: stable/7/share/man/man4/bce.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/bce.4 ============================================================================== --- stable/7/share/man/man4/bce.4 Thu Jan 12 20:45:56 2012 (r230029) +++ stable/7/share/man/man4/bce.4 Thu Jan 12 20:51:01 2012 (r230030) @@ -251,7 +251,7 @@ status block. .It "bce%d: Could not allocate status block DMA memory!" The driver could not allocate DMA addressable memory for the controller's status block. -.It "bce_d: Could not map status block DMA memory!" +.It "bce%d: Could not map status block DMA memory!" The driver could not map the status block memory into the controller's DMA address space. .It "bce%d: Could not allocate statistics block DMA tag!" From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 21:12:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C171A106564A; Thu, 12 Jan 2012 21:12:16 +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 AF66E8FC18; Thu, 12 Jan 2012 21:12: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 q0CLCG41026647; Thu, 12 Jan 2012 21:12:16 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0CLCGb6026645; Thu, 12 Jan 2012 21:12:16 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201201122112.q0CLCGb6026645@svn.freebsd.org> From: Hiroki Sato Date: Thu, 12 Jan 2012 21:12:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230031 - stable/9/release/doc/en_US.ISO8859-1/errata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 21:12:16 -0000 Author: hrs Date: Thu Jan 12 21:12:16 2012 New Revision: 230031 URL: http://svn.freebsd.org/changeset/base/230031 Log: Document EN-12:01. Modified: stable/9/release/doc/en_US.ISO8859-1/errata/article.sgml Modified: stable/9/release/doc/en_US.ISO8859-1/errata/article.sgml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/errata/article.sgml Thu Jan 12 20:51:01 2012 (r230030) +++ stable/9/release/doc/en_US.ISO8859-1/errata/article.sgml Thu Jan 12 21:12:16 2012 (r230031) @@ -220,18 +220,11 @@ Open Issues -No open issues. -]]> - -No open issues. -]]> - -No open issues. -]]> - + In some releases prior to &release.current;, upgrading by + using &man.freebsd-update.8; can fail. This issue has been + fixed by a change in Errata Notice EN-12:01. For more + information, see From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 21:21:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5D341065676; Thu, 12 Jan 2012 21:21:20 +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 A3B148FC17; Thu, 12 Jan 2012 21:21: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 q0CLLKmt026962; Thu, 12 Jan 2012 21:21:20 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0CLLKig026956; Thu, 12 Jan 2012 21:21:20 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201201122121.q0CLLKig026956@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 12 Jan 2012 21:21:20 +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: r230032 - in head/sys/dev/usb: . controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 21:21:20 -0000 Author: hselasky Date: Thu Jan 12 21:21:20 2012 New Revision: 230032 URL: http://svn.freebsd.org/changeset/base/230032 Log: - Try to fix support for USB 3.0 HUBs. - Try to fix support for USB 3.0 suspend and resume. MFC after: 1 week Modified: head/sys/dev/usb/controller/xhci.c head/sys/dev/usb/usb.h head/sys/dev/usb/usb_hub.c head/sys/dev/usb/usb_request.c head/sys/dev/usb/usb_request.h Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Thu Jan 12 21:12:16 2012 (r230031) +++ head/sys/dev/usb/controller/xhci.c Thu Jan 12 21:21:20 2012 (r230032) @@ -2211,9 +2211,10 @@ xhci_configure_device(struct usb_device struct usb_device *hubdev; uint32_t temp; uint32_t route; + uint32_t rh_port; uint8_t is_hub; uint8_t index; - uint8_t rh_port; + uint8_t depth; index = udev->controller_slot_id; @@ -2235,6 +2236,8 @@ xhci_configure_device(struct usb_device if (hubdev->parent_hub == NULL) break; + depth = hubdev->parent_hub->depth; + /* * NOTE: HS/FS/LS devices and the SS root HUB can have * more than 15 ports @@ -2242,17 +2245,18 @@ xhci_configure_device(struct usb_device rh_port = hubdev->port_no; - if (hubdev->parent_hub->parent_hub == NULL) + if (depth == 0) break; - route *= 16; - if (rh_port > 15) - route |= 15; - else - route |= rh_port; + rh_port = 15; + + if (depth < 6) + route |= rh_port << (4 * (depth - 1)); } + DPRINTF("Route=0x%08x\n", route); + temp = XHCI_SCTX_0_ROUTE_SET(route); switch (sc->sc_hw.devs[index].state) { @@ -3063,6 +3067,7 @@ xhci_roothub_exec(struct usb_device *ude case UHF_C_PORT_CONFIG_ERROR: XWRITE4(sc, oper, port, v | XHCI_PS_CEC); break; + case UHF_C_PORT_SUSPEND: case UHF_C_PORT_LINK_STATE: XWRITE4(sc, oper, port, v | XHCI_PS_PLC); break; @@ -3190,7 +3195,7 @@ xhci_roothub_exec(struct usb_device *ude if (v & XHCI_PS_PR) i |= UPS_RESET; if (v & XHCI_PS_PP) - i |= UPS_PORT_POWER; + i |= UPS_PORT_POWER_SS; USETW(sc->sc_hub_desc.ps.wPortStatus, i); i = 0; Modified: head/sys/dev/usb/usb.h ============================================================================== --- head/sys/dev/usb/usb.h Thu Jan 12 21:12:16 2012 (r230031) +++ head/sys/dev/usb/usb.h Thu Jan 12 21:21:20 2012 (r230032) @@ -688,6 +688,7 @@ struct usb_port_status { #define UPS_PORT_LS_LOOPBACK 0x0B #define UPS_PORT_LS_RESUME 0x0F #define UPS_PORT_POWER 0x0100 +#define UPS_PORT_POWER_SS 0x0200 /* super-speed only */ #define UPS_LOW_SPEED 0x0200 #define UPS_HIGH_SPEED 0x0400 #define UPS_OTHER_SPEED 0x0600 /* currently FreeBSD specific */ Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Thu Jan 12 21:12:16 2012 (r230031) +++ head/sys/dev/usb/usb_hub.c Thu Jan 12 21:21:20 2012 (r230032) @@ -369,10 +369,25 @@ repeat: } /* check if there is no power on the port and print a warning */ - if (!(sc->sc_st.port_status & UPS_PORT_POWER)) { - DPRINTF("WARNING: strange, connected port %d " - "has no power\n", portno); + switch (udev->speed) { + case USB_SPEED_HIGH: + case USB_SPEED_FULL: + case USB_SPEED_LOW: + if (!(sc->sc_st.port_status & UPS_PORT_POWER)) { + DPRINTF("WARNING: strange, connected port %d " + "has no power\n", portno); + } + break; + case USB_SPEED_SUPER: + if (!(sc->sc_st.port_status & UPS_PORT_POWER_SS)) { + DPRINTF("WARNING: strange, connected port %d " + "has no power\n", portno); + } + break; + default: + break; } + /* check if the device is in Host Mode */ if (!(sc->sc_st.port_status & UPS_PORT_MODE_DEVICE)) { @@ -611,6 +626,7 @@ uhub_suspend_resume_port(struct uhub_sof switch (UPS_PORT_LINK_STATE_GET(sc->sc_st.port_status)) { case UPS_PORT_LS_U0: case UPS_PORT_LS_U1: + case UPS_PORT_LS_U2: case UPS_PORT_LS_RESUME: is_suspend = 0; break; @@ -632,8 +648,7 @@ uhub_suspend_resume_port(struct uhub_sof */ if (is_suspend == 0) usb_dev_resume_peer(child); - else if ((child->flags.usb_mode == USB_MODE_DEVICE) || - (usb_device_20_compatible(child) == 0)) + else if (child->flags.usb_mode == USB_MODE_DEVICE) usb_dev_suspend_peer(child); } done: @@ -2064,7 +2079,6 @@ usb_peer_should_wakeup(struct usb_device (udev->pwr_save.write_refs != 0) || ((udev->pwr_save.read_refs != 0) && (udev->flags.usb_mode == USB_MODE_HOST) && - (usb_device_20_compatible(udev) != 0) && (usb_peer_can_wakeup(udev) == 0))); } @@ -2244,6 +2258,14 @@ usb_dev_resume_peer(struct usb_device *u DPRINTFN(0, "Resuming port failed\n"); return; } + } else { + /* resume current port (Valid in Host and Device Mode) */ + err = usbd_req_set_port_link_state(udev->parent_hub, + NULL, udev->port_no, UPS_PORT_LS_U0); + if (err) { + DPRINTFN(0, "Resuming port failed\n"); + return; + } } /* resume settle time */ @@ -2285,8 +2307,7 @@ usb_dev_resume_peer(struct usb_device *u usbd_sr_unlock(udev); /* check if peer has wakeup capability */ - if (usb_peer_can_wakeup(udev) && - usb_device_20_compatible(udev)) { + if (usb_peer_can_wakeup(udev)) { /* clear remote wakeup */ err = usbd_req_clear_device_feature(udev, NULL, UF_DEVICE_REMOTE_WAKEUP); @@ -2347,8 +2368,7 @@ repeat: } } - if (usb_peer_can_wakeup(udev) && - usb_device_20_compatible(udev)) { + if (usb_peer_can_wakeup(udev)) { /* * This request needs to be done before we set * "udev->flags.self_suspended": @@ -2380,8 +2400,7 @@ repeat: USB_BUS_UNLOCK(udev->bus); if (err != 0) { - if (usb_peer_can_wakeup(udev) && - usb_device_20_compatible(udev)) { + if (usb_peer_can_wakeup(udev)) { /* allow device to do remote wakeup */ err = usbd_req_clear_device_feature(udev, NULL, UF_DEVICE_REMOTE_WAKEUP); @@ -2437,6 +2456,14 @@ repeat: DPRINTFN(0, "Suspending port failed\n"); return; } + } else { + /* suspend current port */ + err = usbd_req_set_port_link_state(udev->parent_hub, + NULL, udev->port_no, UPS_PORT_LS_U3); + if (err) { + DPRINTFN(0, "Suspending port failed\n"); + return; + } } udev = udev->parent_hub; Modified: head/sys/dev/usb/usb_request.c ============================================================================== --- head/sys/dev/usb/usb_request.c Thu Jan 12 21:12:16 2012 (r230031) +++ head/sys/dev/usb/usb_request.c Thu Jan 12 21:21:20 2012 (r230032) @@ -2164,3 +2164,27 @@ usbd_req_clear_tt_buffer(struct usb_devi USETW(req.wLength, 0); return (usbd_do_request(udev, mtx, &req, 0)); } + +/*------------------------------------------------------------------------* + * usbd_req_set_port_link_state + * + * USB 3.0 specific request + * + * Returns: + * 0: Success + * Else: Failure + *------------------------------------------------------------------------*/ +usb_error_t +usbd_req_set_port_link_state(struct usb_device *udev, struct mtx *mtx, + uint8_t port, uint8_t link_state) +{ + struct usb_device_request req; + + req.bmRequestType = UT_WRITE_CLASS_OTHER; + req.bRequest = UR_SET_FEATURE; + USETW(req.wValue, UHF_PORT_LINK_STATE); + req.wIndex[0] = port; + req.wIndex[1] = link_state; + USETW(req.wLength, 0); + return (usbd_do_request(udev, mtx, &req, 0)); +} Modified: head/sys/dev/usb/usb_request.h ============================================================================== --- head/sys/dev/usb/usb_request.h Thu Jan 12 21:12:16 2012 (r230031) +++ head/sys/dev/usb/usb_request.h Thu Jan 12 21:21:20 2012 (r230032) @@ -89,5 +89,7 @@ usb_error_t usbd_req_reset_tt(struct usb uint8_t port); usb_error_t usbd_req_clear_tt_buffer(struct usb_device *udev, struct mtx *mtx, uint8_t port, uint8_t addr, uint8_t type, uint8_t endpoint); +usb_error_t usbd_req_set_port_link_state(struct usb_device *udev, + struct mtx *mtx, uint8_t port, uint8_t link_state); #endif /* _USB_REQUEST_H_ */ From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 22:08:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CD069106566B; Thu, 12 Jan 2012 22:08:33 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BBFD68FC0A; Thu, 12 Jan 2012 22:08: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 q0CM8XPV028507; Thu, 12 Jan 2012 22:08:33 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0CM8XhE028505; Thu, 12 Jan 2012 22:08:33 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201201122208.q0CM8XhE028505@svn.freebsd.org> From: "Kenneth D. Merry" Date: Thu, 12 Jan 2012 22: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: r230033 - head/sys/cam/ctl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 22:08:33 -0000 Author: ken Date: Thu Jan 12 22:08:33 2012 New Revision: 230033 URL: http://svn.freebsd.org/changeset/base/230033 Log: Silence some unnecessary verbosity. Reported by: mav MFC after: 1 month Modified: head/sys/cam/ctl/scsi_ctl.c Modified: head/sys/cam/ctl/scsi_ctl.c ============================================================================== --- head/sys/cam/ctl/scsi_ctl.c Thu Jan 12 21:21:20 2012 (r230032) +++ head/sys/cam/ctl/scsi_ctl.c Thu Jan 12 22:08:33 2012 (r230033) @@ -305,8 +305,10 @@ ctlfeasync(void *callback_arg, uint32_t /* Don't attach if it doesn't support target mode */ if ((cpi->target_sprt & PIT_PROCESSOR) == 0) { +#ifdef CTLFEDEBUG printf("%s: SIM %s%d doesn't support target mode\n", __func__, cpi->dev_name, cpi->unit_number); +#endif break; } @@ -421,8 +423,10 @@ ctlfeasync(void *callback_arg, uint32_t * XXX KDM need to figure out whether we're the master or * slave. */ +#ifdef CTLFEDEBUG printf("%s: calling ctl_frontend_register() for %s%d\n", __func__, cpi->dev_name, cpi->unit_number); +#endif retval = ctl_frontend_register(fe, /*master_SC*/ 1); if (retval != 0) { printf("%s: ctl_frontend_register() failed with " From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 22:12:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69ADC106564A; Thu, 12 Jan 2012 22:12:42 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58B7B8FC19; Thu, 12 Jan 2012 22:12: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 q0CMCgTV028734; Thu, 12 Jan 2012 22:12:42 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0CMCgS7028732; Thu, 12 Jan 2012 22:12:42 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201201122212.q0CMCgS7028732@svn.freebsd.org> From: "Kenneth D. Merry" Date: Thu, 12 Jan 2012 22:12: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: r230034 - head/usr.bin/ctlstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 22:12:42 -0000 Author: ken Date: Thu Jan 12 22:12:42 2012 New Revision: 230034 URL: http://svn.freebsd.org/changeset/base/230034 Log: Fix building ctlstat with clang. Submitted by: Dan McGregor MFC after: 1 month Modified: head/usr.bin/ctlstat/ctlstat.c Modified: head/usr.bin/ctlstat/ctlstat.c ============================================================================== --- head/usr.bin/ctlstat/ctlstat.c Thu Jan 12 22:08:33 2012 (r230033) +++ head/usr.bin/ctlstat/ctlstat.c Thu Jan 12 22:12:42 2012 (r230034) @@ -146,7 +146,7 @@ static void compute_stats(struct ctl_lun static void usage(int error) { - fprintf(error ? stderr : stdout, ctlstat_usage); + fputs(ctlstat_usage, error ? stderr : stdout); } static int From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 22:21:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AEDB2106564A; Thu, 12 Jan 2012 22:21:20 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9289F8FC17; Thu, 12 Jan 2012 22:21: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 q0CMLK9j029037; Thu, 12 Jan 2012 22:21:20 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0CMLKqP029035; Thu, 12 Jan 2012 22:21:20 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201201122221.q0CMLKqP029035@svn.freebsd.org> From: Justin Hibbits Date: Thu, 12 Jan 2012 22:21:20 +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: r230035 - head/sys/powerpc/powermac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 22:21:20 -0000 Author: jhibbits Date: Thu Jan 12 22:21:20 2012 New Revision: 230035 URL: http://svn.freebsd.org/changeset/base/230035 Log: Add PWM monitoring sysctl to G4 MDD (Windtunnel) fan driver. While there, clean up some style nits. Approved by: nwhitehorn (mentor) MFC after: 3 days Modified: head/sys/powerpc/powermac/windtunnel.c Modified: head/sys/powerpc/powermac/windtunnel.c ============================================================================== --- head/sys/powerpc/powermac/windtunnel.c Thu Jan 12 22:12:42 2012 (r230034) +++ head/sys/powerpc/powermac/windtunnel.c Thu Jan 12 22:21:20 2012 (r230035) @@ -59,8 +59,7 @@ struct adm1030_softc { device_t sc_dev; struct intr_config_hook enum_hook; uint32_t sc_addr; - phandle_t sc_thermostat_phandle; - device_t sc_thermostat_dev; + int sc_pwm; }; /* Regular bus attachment functions */ @@ -70,7 +69,8 @@ static int adm1030_attach(device_t); /* Utility functions */ static void adm1030_start(void *xdev); static int adm1030_write_byte(device_t dev, uint32_t addr, uint8_t reg, uint8_t buf); -static int adm1030_set(struct adm1030_softc *fan, int pwm); +static int adm1030_set(struct adm1030_softc *fan, int pwm); +static int adm1030_sysctl(SYSCTL_HANDLER_ARGS); static device_method_t adm1030_methods[] = { /* Device interface */ @@ -151,6 +151,8 @@ static int adm1030_attach(device_t dev) { struct adm1030_softc *sc; + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree; sc = device_get_softc(dev); @@ -158,17 +160,19 @@ adm1030_attach(device_t dev) sc->enum_hook.ich_arg = dev; /* - * We have to wait until interrupts are enabled. I2C read and write - * only works if the interrupts are available. The unin/i2c is - * controlled by the htpic on unin. But this is not the master. The - * openpic on mac-io is controlling the htpic. This one gets attached - * after the mac-io probing and then the interrupts will be - * available. + * Wait until interrupts are available, which won't be until the openpic is + * intialized. */ if (config_intrhook_establish(&sc->enum_hook) != 0) return (ENOMEM); + ctx = device_get_sysctl_ctx(dev); + tree = device_get_sysctl_tree(dev); + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "pwm", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, dev, + 0, adm1030_sysctl, "I", "Fan PWM Rate"); + return (0); } @@ -188,7 +192,7 @@ adm1030_start(void *xdev) /* Use the RPM fields as PWM duty cycles. */ sc->fan.min_rpm = 0; - sc->fan.max_rpm = 15; + sc->fan.max_rpm = 0x0F; sc->fan.default_rpm = 2; strcpy(sc->fan.name, "MDD Case fan"); @@ -211,6 +215,26 @@ static int adm1030_set(struct adm1030_so if (adm1030_write_byte(fan->sc_dev, fan->sc_addr, 0x22, pwm) < 0) return (-1); + fan->sc_pwm = pwm; return (0); } +static int +adm1030_sysctl(SYSCTL_HANDLER_ARGS) +{ + device_t adm1030; + struct adm1030_softc *sc; + int pwm, error; + + adm1030 = arg1; + sc = device_get_softc(adm1030); + + pwm = sc->sc_pwm; + + error = sysctl_handle_int(oidp, &pwm, 0, req); + + if (error || !req->newptr) + return (error); + + return (adm1030_set(sc, pwm)); +} From owner-svn-src-all@FreeBSD.ORG Thu Jan 12 22:49:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3963106564A; Thu, 12 Jan 2012 22:49:36 +0000 (UTC) (envelope-from ghelmer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A84188FC13; Thu, 12 Jan 2012 22:49: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 q0CMna4t030203; Thu, 12 Jan 2012 22:49:36 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0CMnaZe030200; Thu, 12 Jan 2012 22:49:36 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201201122249.q0CMnaZe030200@svn.freebsd.org> From: Guy Helmer Date: Thu, 12 Jan 2012 22:49: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: r230037 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2012 22:49:36 -0000 Author: ghelmer Date: Thu Jan 12 22:49:36 2012 New Revision: 230037 URL: http://svn.freebsd.org/changeset/base/230037 Log: Move struct pidfh definition into pidfile.c, and leave a forward declaration for pidfh in libutil.h in its place. This allows us to hide the contents of the pidfh structure, and also allowed removal of the "#ifdef _SYS_PARAM_H" guard from around the pidfile_* function prototypes. Suggested by pjd. Modified: head/lib/libutil/libutil.h head/lib/libutil/pidfile.c Modified: head/lib/libutil/libutil.h ============================================================================== --- head/lib/libutil/libutil.h Thu Jan 12 22:30:41 2012 (r230036) +++ head/lib/libutil/libutil.h Thu Jan 12 22:49:36 2012 (r230037) @@ -48,6 +48,11 @@ typedef __gid_t gid_t; #define _GID_T_DECLARED #endif +#ifndef _MODE_T_DECLARED +typedef __mode_t mode_t; +#define _MODE_T_DECLARED +#endif + #ifndef _PID_T_DECLARED typedef __pid_t pid_t; #define _PID_T_DECLARED @@ -73,21 +78,12 @@ typedef struct _property { char *value; } *properties; -#ifdef _SYS_PARAM_H_ -/* for pidfile.c */ -struct pidfh { - int pf_fd; - char pf_path[MAXPATHLEN + 1]; - __dev_t pf_dev; - ino_t pf_ino; -}; -#endif - /* Avoid pulling in all the include files for no need */ struct in_addr; struct kinfo_file; struct kinfo_proc; struct kinfo_vmentry; +struct pidfh; struct sockaddr; struct termios; struct winsize; @@ -174,14 +170,12 @@ struct group int gr_tmp(int _mdf); #endif -#ifdef _SYS_PARAM_H_ int pidfile_close(struct pidfh *_pfh); int pidfile_fileno(const struct pidfh *_pfh); struct pidfh * pidfile_open(const char *_path, mode_t _mode, pid_t *_pidptr); int pidfile_remove(struct pidfh *_pfh); int pidfile_write(struct pidfh *_pfh); -#endif #ifdef _UFS_UFS_QUOTA_H_ struct fstab; Modified: head/lib/libutil/pidfile.c ============================================================================== --- head/lib/libutil/pidfile.c Thu Jan 12 22:30:41 2012 (r230036) +++ head/lib/libutil/pidfile.c Thu Jan 12 22:49:36 2012 (r230037) @@ -41,6 +41,13 @@ __FBSDID("$FreeBSD$"); #include #include +struct pidfh { + int pf_fd; + char pf_path[MAXPATHLEN + 1]; + dev_t pf_dev; + ino_t pf_ino; +}; + static int _pidfile_remove(struct pidfh *pfh, int freeit); static int From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 00:00:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9DA9106566C; Fri, 13 Jan 2012 00:00:59 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) by mx1.freebsd.org (Postfix) with ESMTP id 7DD178FC18; Fri, 13 Jan 2012 00:00:58 +0000 (UTC) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.14.4/8.14.4/ALCHEMY.FRANKEN.DE) with ESMTP id q0D00wat055981; Fri, 13 Jan 2012 01:00:58 +0100 (CET) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.14.4/8.14.4/Submit) id q0D00wk6055980; Fri, 13 Jan 2012 01:00:58 +0100 (CET) (envelope-from marius) Date: Fri, 13 Jan 2012 01:00:57 +0100 From: Marius Strobl To: Ed Schouten Message-ID: <20120113000057.GA23960@alchemy.franken.de> References: <201201121755.q0CHtMA2020344@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201201121755.q0CHtMA2020344@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230025 - head/contrib/compiler-rt/lib/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 00:01:00 -0000 On Thu, Jan 12, 2012 at 05:55:22PM +0000, Ed Schouten wrote: > Author: ed > Date: Thu Jan 12 17:55:22 2012 > New Revision: 230025 > URL: http://svn.freebsd.org/changeset/base/230025 > > Log: > Add SPARC64 version of div/mod written in assembly. > > This version is similar to the code shipped with libgcc. It is based on > the code from the SPARC64 architecture manual, provided without any > restrictions. > > Tested by: flo@ > > +#include "../assembly.h" > + > +.text > + .align 4 > + <...> > +ifelse( ANSWER, `quotient', ` > +DEFINE_COMPILERRT_FUNCTION(__udivsi3) > + save %sp,-64,%sp ! do this for debugging Uhm, these are V8-specific, for V9 the C compiler frame size should be 192 instead of 64 and the function alignment should be 32 instead of 4 bytes (at least with GCC and US1-optimizations enabled as we default to on sparc64), see . However, given that these functions only seem to obtain new register window for debugging purposes you probably alternatively could just remove the saves and the corresponding restores completely. Marius From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 00:38:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE6D4106566B; Fri, 13 Jan 2012 00:38:00 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A1F8D8FC19; Fri, 13 Jan 2012 00:38: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 q0D0c0Ui033668; Fri, 13 Jan 2012 00:38:00 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0D0c0Af033666; Fri, 13 Jan 2012 00:38:00 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201130038.q0D0c0Af033666@svn.freebsd.org> From: Eitan Adler Date: Fri, 13 Jan 2012 00:38:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230038 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 00:38:01 -0000 Author: eadler (ports committer) Date: Fri Jan 13 00:38:00 2012 New Revision: 230038 URL: http://svn.freebsd.org/changeset/base/230038 Log: MFC r228470: - Add a sysctl to allow non-root users the ability to set idle priorities. - While here fix up some style nits. Approved by: jhb Modified: stable/8/sys/kern/kern_resource.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/kern/kern_resource.c ============================================================================== --- stable/8/sys/kern/kern_resource.c Thu Jan 12 22:49:36 2012 (r230037) +++ stable/8/sys/kern/kern_resource.c Fri Jan 13 00:38:00 2012 (r230038) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -272,6 +273,10 @@ donice(struct thread *td, struct proc *p return (0); } +static int unprivileged_idprio; +SYSCTL_INT(_security_bsd, OID_AUTO, unprivileged_idprio, CTLFLAG_RW, + &unprivileged_idprio, 0, "Allow non-root users to set an idle priority"); + /* * Set realtime priority for LWP. */ @@ -322,18 +327,26 @@ rtprio_thread(struct thread *td, struct break; /* Disallow setting rtprio in most cases if not superuser. */ -/* - * Realtime priority has to be restricted for reasons which should be - * obvious. However, for idle priority, there is a potential for - * system deadlock if an idleprio process gains a lock on a resource - * that other processes need (and the idleprio process can't run - * due to a CPU-bound normal process). Fix me! XXX - */ -#if 0 - if (RTP_PRIO_IS_REALTIME(rtp.type)) { -#else - if (rtp.type != RTP_PRIO_NORMAL) { -#endif + + /* + * Realtime priority has to be restricted for reasons which + * should be obvious. However, for idleprio processes, there is + * a potential for system deadlock if an idleprio process gains + * a lock on a resource that other processes need (and the + * idleprio process can't run due to a CPU-bound normal + * process). Fix me! XXX + * + * This problem is not only related to idleprio process. + * A user level program can obtain a file lock and hold it + * indefinitely. Additionally, without idleprio processes it is + * still conceivable that a program with low priority will never + * get to run. In short, allowing this feature might make it + * easier to lock a resource indefinitely, but it is not the + * only thing that makes it possible. + */ + if (RTP_PRIO_BASE(rtp.type) == RTP_PRIO_REALTIME || + (RTP_PRIO_BASE(rtp.type) == RTP_PRIO_IDLE && + unprivileged_idprio == 0)) { error = priv_check(td, PRIV_SCHED_RTPRIO); if (error) break; @@ -426,19 +439,14 @@ rtprio(td, uap) if ((error = p_cansched(td, p)) || (error = cierror)) break; - /* Disallow setting rtprio in most cases if not superuser. */ -/* - * Realtime priority has to be restricted for reasons which should be - * obvious. However, for idle priority, there is a potential for - * system deadlock if an idleprio process gains a lock on a resource - * that other processes need (and the idleprio process can't run - * due to a CPU-bound normal process). Fix me! XXX - */ -#if 0 - if (RTP_PRIO_IS_REALTIME(rtp.type)) { -#else - if (rtp.type != RTP_PRIO_NORMAL) { -#endif + /* + * Disallow setting rtprio in most cases if not superuser. + * See the comment in sys_rtprio_thread about idprio + * threads holding a lock. + */ + if (RTP_PRIO_BASE(rtp.type) == RTP_PRIO_REALTIME || + (RTP_PRIO_BASE(rtp.type) == RTP_PRIO_IDLE && + !unprivileged_idprio)) { error = priv_check(td, PRIV_SCHED_RTPRIO); if (error) break; From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 00:38:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6818D1065687; Fri, 13 Jan 2012 00:38:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B9418FC22; Fri, 13 Jan 2012 00:38: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 q0D0calH033723; Fri, 13 Jan 2012 00:38:36 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0D0caJs033721; Fri, 13 Jan 2012 00:38:36 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201130038.q0D0caJs033721@svn.freebsd.org> From: Eitan Adler Date: Fri, 13 Jan 2012 00:38:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230039 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 00:38:36 -0000 Author: eadler (ports committer) Date: Fri Jan 13 00:38:35 2012 New Revision: 230039 URL: http://svn.freebsd.org/changeset/base/230039 Log: MFC r228470: - Add a sysctl to allow non-root users the ability to set idle priorities. - While here fix up some style nits. Approved by: jhb Modified: stable/9/sys/kern/kern_resource.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_resource.c ============================================================================== --- stable/9/sys/kern/kern_resource.c Fri Jan 13 00:38:00 2012 (r230038) +++ stable/9/sys/kern/kern_resource.c Fri Jan 13 00:38:35 2012 (r230039) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -273,6 +274,10 @@ donice(struct thread *td, struct proc *p return (0); } +static int unprivileged_idprio; +SYSCTL_INT(_security_bsd, OID_AUTO, unprivileged_idprio, CTLFLAG_RW, + &unprivileged_idprio, 0, "Allow non-root users to set an idle priority"); + /* * Set realtime priority for LWP. */ @@ -321,18 +326,26 @@ sys_rtprio_thread(struct thread *td, str break; /* Disallow setting rtprio in most cases if not superuser. */ -/* - * Realtime priority has to be restricted for reasons which should be - * obvious. However, for idle priority, there is a potential for - * system deadlock if an idleprio process gains a lock on a resource - * that other processes need (and the idleprio process can't run - * due to a CPU-bound normal process). Fix me! XXX - */ -#if 0 - if (RTP_PRIO_IS_REALTIME(rtp.type)) { -#else - if (rtp.type != RTP_PRIO_NORMAL) { -#endif + + /* + * Realtime priority has to be restricted for reasons which + * should be obvious. However, for idleprio processes, there is + * a potential for system deadlock if an idleprio process gains + * a lock on a resource that other processes need (and the + * idleprio process can't run due to a CPU-bound normal + * process). Fix me! XXX + * + * This problem is not only related to idleprio process. + * A user level program can obtain a file lock and hold it + * indefinitely. Additionally, without idleprio processes it is + * still conceivable that a program with low priority will never + * get to run. In short, allowing this feature might make it + * easier to lock a resource indefinitely, but it is not the + * only thing that makes it possible. + */ + if (RTP_PRIO_BASE(rtp.type) == RTP_PRIO_REALTIME || + (RTP_PRIO_BASE(rtp.type) == RTP_PRIO_IDLE && + unprivileged_idprio == 0)) { error = priv_check(td, PRIV_SCHED_RTPRIO); if (error) break; @@ -417,19 +430,14 @@ sys_rtprio(td, uap) if ((error = p_cansched(td, p)) || (error = cierror)) break; - /* Disallow setting rtprio in most cases if not superuser. */ -/* - * Realtime priority has to be restricted for reasons which should be - * obvious. However, for idle priority, there is a potential for - * system deadlock if an idleprio process gains a lock on a resource - * that other processes need (and the idleprio process can't run - * due to a CPU-bound normal process). Fix me! XXX - */ -#if 0 - if (RTP_PRIO_IS_REALTIME(rtp.type)) { -#else - if (rtp.type != RTP_PRIO_NORMAL) { -#endif + /* + * Disallow setting rtprio in most cases if not superuser. + * See the comment in sys_rtprio_thread about idprio + * threads holding a lock. + */ + if (RTP_PRIO_BASE(rtp.type) == RTP_PRIO_REALTIME || + (RTP_PRIO_BASE(rtp.type) == RTP_PRIO_IDLE && + !unprivileged_idprio)) { error = priv_check(td, PRIV_SCHED_RTPRIO); if (error) break; From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 02:33:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E112D1065670; Fri, 13 Jan 2012 02:33:55 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CFE328FC0C; Fri, 13 Jan 2012 02:33: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 q0D2XtPb037277; Fri, 13 Jan 2012 02:33:55 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0D2XtWR037275; Fri, 13 Jan 2012 02:33:55 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201201130233.q0D2XtWR037275@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 13 Jan 2012 02:33: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: r230040 - head/sys/contrib/octeon-sdk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 02:33:56 -0000 Author: gonzo Date: Fri Jan 13 02:33:55 2012 New Revision: 230040 URL: http://svn.freebsd.org/changeset/base/230040 Log: - Do not enumerate PCIe bus on CN56XX Pass 1 devices to avoid hard hang. There is known issue with this hardware. Submitted by: Andrew Duane Modified: head/sys/contrib/octeon-sdk/cvmx-pcie.c Modified: head/sys/contrib/octeon-sdk/cvmx-pcie.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-pcie.c Fri Jan 13 00:38:35 2012 (r230039) +++ head/sys/contrib/octeon-sdk/cvmx-pcie.c Fri Jan 13 02:33:55 2012 (r230040) @@ -501,6 +501,12 @@ retry: } } + /* Make sure a CN56XX pass 1 isn't trying to do anything; errata for PASS 1 */ + if (OCTEON_IS_MODEL(OCTEON_CN56XX_PASS1_X)) { + cvmx_dprintf ("PCIe port %d: CN56XX_PASS_1, skipping\n", pcie_port); + return -1; + } + /* PCIe switch arbitration mode. '0' == fixed priority NPEI, PCIe0, then PCIe1. '1' == round robin. */ npei_ctl_status.s.arb = 1; /* Allow up to 0x20 config retries */ From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 03:21:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EE8C1065670; Fri, 13 Jan 2012 03:21:47 +0000 (UTC) (envelope-from rea@codelabs.ru) Received: from 0.mx.codelabs.ru (0.mx.codelabs.ru [144.206.177.45]) by mx1.freebsd.org (Postfix) with ESMTP id 1CA098FC0A; Fri, 13 Jan 2012 03:21:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=codelabs.ru; s=two; h=Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=VcPf7tYrA2tYOgYDkCjNGKkgnQyhgZ2O4Mifid9YUhI=; b=aWPZ228ZiqrxybmeqqM8SOW3zRy9N6t2sHkb8XP1sGs+IvsExjgckL3DBrLVgH2ilaa3FqIyIp5gfQ5IFLr2cD+JKM42pmoNZgRmFEYpHchw0qHDP41mMGjKKZNobWeU1DoIeqoMcYDmeDa3nlcOECNn6+mpLPbJSoKtkzACeEkg3OmWVkmFUtSr5TEACLyD6nW22a8ylv6+yKstKl+TffDu6CYA5VQ4b+v4QNU7nWBSLzhiSf0SV5tGQ3Q9Z8zuGyuM5OrnUurZvXCVx2y5+W/746xYLMXdIi5g4Hp08LBQrEkIAM1cygSjNILHklNeCKVmSsMuwVQYHXiLIeN9uQ==; Received: from phoenix.codelabs.ru (ppp91-77-166-241.pppoe.mtu-net.ru [91.77.166.241]) by 0.mx.codelabs.ru with esmtpsa (TLSv1:AES256-SHA:256) id 1RlXi5-000O5W-TP; Fri, 13 Jan 2012 06:21:46 +0300 Date: Fri, 13 Jan 2012 11:21:48 +0400 From: Eygene Ryabinkin To: John Baldwin Message-ID: References: <201201120648.q0C6mBio096662@svn.freebsd.org> <201201120748.28564.jhb@freebsd.org> <201201121438.16674.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wac7ysb48OaltWcw" Content-Disposition: inline In-Reply-To: <201201121438.16674.jhb@freebsd.org> Sender: rea@codelabs.ru Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230007 - in head: etc etc/rc.d share/man/man8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 03:21:47 -0000 --wac7ysb48OaltWcw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Thu, Jan 12, 2012 at 02:38:16PM -0500, John Baldwin wrote: > On Thursday, January 12, 2012 9:35:05 am Eygene Ryabinkin wrote: > > True, and it was suggested by Doug Barton. But why bother when > > the 'quiet' keyword is reserved for such cases? >=20 > Hmm, that's not quite how I see this. Either /etc/rc.d/dhclient > should silently exit if dhcpif is not true for the given interface, > or it should always whine IMO. It should tell one why it won't start DHCP on the interface, so it should whine at least for the ordinary usage (service dhclient start ), otherwise it will be hard to understand what's going on. > Given that everywhere else uses dhcpif to decide if dhclient should > be run, it seems that an explicit test of that should be used here > as well, even if it means an extra script. In short, this approach > is not consisent with all other users of the dhclient script, As I see, the only other conditional consumer of the dhclient script is /etc/network.subr, procedure ifconfig_up. And it has the other reason to invoke dhcpif: it determines if dhclient should be run synchronously and invokes it explicitely only in this case; for the asynchronous dhclient it relies on the devd to do the work once the interface will come up. > and this seems a hackish approach whose primary goal is to avoid > having devd use a wrapper script. Perhaps that goal is worth the > tradeoff, but it's not really clean. Well, partly my reasoning for suppressing the error message was the following one: 'quiet' will silence the messages about non-enabled service (via _enabled) that is set via rc.conf and in DHCP case we also have rc.conf knob (per-interface 'dhcp' keyword), so that's not a different case. But seems like the whole problem is that I used the err() function instead of doing 'echo $errmsg; exit 1'. Such code shouldn't be conditionalized for the devd, since it is only syslog message that worried people; devd doesn't care what is written to the standard output or the standard error by the scripts it invokes once it become the daemon, since everything goes to /dev/null after calling daemon(3). So, seems like that the following dhclient_pre_check() will make everyone happy: {{{ dhclient_pre_check() { if [ -z "${rc_force}" ] && ! dhcpif $ifn; then echo "'$ifn' is not a DHCP-enabled interface" exit 1 fi } }}} Hadn't tested it yet, but will do it today. > By your argument, btw since we use quietstart during boot, ifn_start > shouldn't even check dhcpif at all now, but just always run the > dhclient script (and if you did make that change, I would protest that > it was very wrong). Well, ifn_start (ifconfig_up to be precise) calls 'dhclient start' and not the 'quietstart'. Moreover, as I had explained, there is other dance with syncdhcpif there, so it can't just invoke dhclient unconditionally. The related topic: in the process of grepping for dhclient within /etc, I had found that /etc/netstart still wants to invoke it. But it will do a lone '/etc/rc.d/dhclient quietstart' and this will never be useful in the current state of dhclient: it will refuse to process any commands without the interface being specified. And since we have the invocation of /etc/rc.d/netif just two lines above, I think that it will be good to remove call to dhclient from /etc/netstart. At the time of the original addition of call to dhclient to /etc/netstart (r114213), dhclient script had another form, http://svnweb.freebsd.org/base/head/etc/rc.d/dhclient?revision=3D113759&v= iew=3Dmarkup&pathrev=3D114213 and it was really a normal rc.d script that requires only one argument. Now it is more of a helper-type script. =2E Am I missing something important here or the removal can really be done? Thanks. --=20 Eygene Ryabinkin ,,,^..^,,, [ Life's unfair - but root password helps! | codelabs.ru ] [ 82FE 06BC D497 C0DE 49EC 4FF0 16AF 9EAE 8152 ECFB | freebsd.org ] --wac7ysb48OaltWcw Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iF4EABEIAAYFAk8P24wACgkQFq+eroFS7Ps6BQD/aS/GbOO736pyJAJm65/9JHgr eJfcNb4fH9Pox+UQzqIBAIYx6ryjgBrxGTHt1dy8GQqsGal+lGk3tjEWdqtj55K1 =7gDJ -----END PGP SIGNATURE----- --wac7ysb48OaltWcw-- From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 05:37:32 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DA4F106564A; Fri, 13 Jan 2012 05:37:32 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 213808FC0C; Fri, 13 Jan 2012 05:37:31 +0000 (UTC) Received: from lstewart.caia.swin.edu.au (lstewart.caia.swin.edu.au [136.186.229.95]) by lauren.room52.net (Postfix) with ESMTPSA id EF2FF7E8DD; Fri, 13 Jan 2012 16:37:29 +1100 (EST) Message-ID: <4F0FC319.7050305@freebsd.org> Date: Fri, 13 Jan 2012 16:37:29 +1100 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:8.0) Gecko/20111127 Thunderbird/8.0 MIME-Version: 1.0 To: Garrett Wollman References: <201201120550.q0C5oXEQ094718@svn.freebsd.org> In-Reply-To: <201201120550.q0C5oXEQ094718@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lauren.room52.net Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r230005 - head/usr.sbin/tzsetup X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 05:37:32 -0000 On 01/12/12 16:50, Garrett Wollman wrote: > Author: wollman > Date: Thu Jan 12 05:50:32 2012 > New Revision: 230005 > URL: http://svn.freebsd.org/changeset/base/230005 > > Log: > Use a reasonable-sized buffer when formatting error messages about > installing zoneinfo. While we're in the vicinity, add some missing > error checking to eliminate an unhelpful error message when unlink() > fails. > > /me is embarrassed by the quality of his 16-year-old code. > The whole thing is awful and could stand a complete rewrite. > > PR: 164038 > Submitted by: Devin Teske (but implemented differently) > > Modified: > head/usr.sbin/tzsetup/tzsetup.c > > Modified: head/usr.sbin/tzsetup/tzsetup.c > ============================================================================== > --- head/usr.sbin/tzsetup/tzsetup.c Thu Jan 12 05:47:28 2012 (r230004) > +++ head/usr.sbin/tzsetup/tzsetup.c Thu Jan 12 05:50:32 2012 (r230005) > @@ -57,6 +57,13 @@ __FBSDID("$FreeBSD$"); > #define _PATH_DB "/var/db/zoneinfo" > #define _PATH_WALL_CMOS_CLOCK "/etc/wall_cmos_clock" > > +#ifdef PATH_MAX > +#define SILLY_BUFFER_SIZE 2*PATH_MAX > +#else > +#warning "Somebody needs to fix this to dynamically size this buffer." > +#define SILLY_BUFFER_SIZE 2048 > +#endif > Would use of sbuf(9) (which is also built as a library for use by userspace code) solve the problem? When used with the SBUF_AUTOEXTEND flag, it's perfectly suited for this kind of use. Cheers, Lawrence From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 06:14:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4415106566B; Fri, 13 Jan 2012 06:14:03 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C32F48FC17; Fri, 13 Jan 2012 06:14:03 +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 q0D6E3TX045038; Fri, 13 Jan 2012 06:14:03 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0D6E3IA045036; Fri, 13 Jan 2012 06:14:03 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <201201130614.q0D6E3IA045036@svn.freebsd.org> From: Maxim Konovalov Date: Fri, 13 Jan 2012 06:14:03 +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: r230042 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 06:14:03 -0000 Author: maxim Date: Fri Jan 13 06:14:03 2012 New Revision: 230042 URL: http://svn.freebsd.org/changeset/base/230042 Log: o Mac OS X 10.7 added (belatedly). FreeBSD 9.0-RELEASE added. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Fri Jan 13 03:38:08 2012 (r230041) +++ head/share/misc/bsd-family-tree Fri Jan 13 06:14:03 2012 (r230042) @@ -247,11 +247,14 @@ FreeBSD 5.2 | | | FreeBSD FreeBSD | | | | | 8.2 7.4 | | | DragonFly 2.10.1 | v | | OpenBSD 4.9 | - | | | | | - | | | | | + | Mac OS X | | | + | 10.7 | | | | | | OpenBSD 5.0 | + +--FreeBSD | | | | + | 9.0 | | | | + | v | | | | | | | | | -FreeBSD 9 -current | NetBSD -current OpenBSD -current | +FreeBSD 10 -current | NetBSD -current OpenBSD -current | | | | | | v v v v v @@ -537,7 +540,9 @@ FreeBSD 7.4 2011-02-24 [FBD] FreeBSD 8.2 2011-02-24 [FBD] DragonFly 2.10.1 2011-04-26 [DFB] OpenBSD 4.9 2011-05-01 [OBD] +Mac OS X 10.7 2011-07-20 [APL] OpenBSD 5.0 2011-11-01 [OBD] +FreeBSD 9.0 2012-01-12 [FBD] Bibliography ------------------------ From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 06:18:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C05C106564A; Fri, 13 Jan 2012 06:18:24 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B0708FC08; Fri, 13 Jan 2012 06:18: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 q0D6IOe6045195; Fri, 13 Jan 2012 06:18:24 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0D6IOhL045193; Fri, 13 Jan 2012 06:18:24 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <201201130618.q0D6IOhL045193@svn.freebsd.org> From: Maxim Konovalov Date: Fri, 13 Jan 2012 06: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: r230043 - head/share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 06:18:24 -0000 Author: maxim Date: Fri Jan 13 06:18:23 2012 New Revision: 230043 URL: http://svn.freebsd.org/changeset/base/230043 Log: Copyright years updated. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Fri Jan 13 06:14:03 2012 (r230042) +++ head/share/misc/bsd-family-tree Fri Jan 13 06:18:23 2012 (r230043) @@ -600,7 +600,7 @@ original BSD announcements from Usenet o Steven M. Schultz for providing 2.8BSD, 2.10BSD, 2.11BSD manual pages. -- -Copyright (c) 1997-2007 Wolfram Schneider +Copyright (c) 1997-2012 Wolfram Schneider URL: http://cvsweb.freebsd.org/src/share/misc/bsd-family-tree $FreeBSD$ From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 06:51:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03926106566B; Fri, 13 Jan 2012 06:51:16 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB5598FC14; Fri, 13 Jan 2012 06:51: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 q0D6pFwU046748; Fri, 13 Jan 2012 06:51:15 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0D6pF0l046741; Fri, 13 Jan 2012 06:51:15 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201201130651.q0D6pF0l046741@svn.freebsd.org> From: Kevin Lo Date: Fri, 13 Jan 2012 06:51: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: r230044 - in head: usr.bin/mail usr.bin/tftp usr.bin/unzip usr.sbin/config usr.sbin/lpr/lpc usr.sbin/timed/timedc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 06:51:16 -0000 Author: kevlo Date: Fri Jan 13 06:51:15 2012 New Revision: 230044 URL: http://svn.freebsd.org/changeset/base/230044 Log: fgets(3) returns a pointer, so compare against NULL, not integer 0. Modified: head/usr.bin/mail/edit.c head/usr.bin/tftp/main.c head/usr.bin/unzip/unzip.c head/usr.sbin/config/mkmakefile.c head/usr.sbin/lpr/lpc/lpc.c head/usr.sbin/timed/timedc/timedc.c Modified: head/usr.bin/mail/edit.c ============================================================================== --- head/usr.bin/mail/edit.c Fri Jan 13 06:18:23 2012 (r230043) +++ head/usr.bin/mail/edit.c Fri Jan 13 06:51:15 2012 (r230044) @@ -89,7 +89,7 @@ edit1(int *msgvec, int type) char *p; printf("Edit message %d [ynq]? ", msgvec[i]); - if (fgets(buf, sizeof(buf), stdin) == 0) + if (fgets(buf, sizeof(buf), stdin) == NULL) break; for (p = buf; *p == ' ' || *p == '\t'; p++) ; Modified: head/usr.bin/tftp/main.c ============================================================================== --- head/usr.bin/tftp/main.c Fri Jan 13 06:18:23 2012 (r230043) +++ head/usr.bin/tftp/main.c Fri Jan 13 06:51:15 2012 (r230044) @@ -734,7 +734,7 @@ command(void) history(hist, &he, H_ENTER, bp); } else { line[0] = 0; - if (fgets(line, sizeof line , stdin) == 0) { + if (fgets(line, sizeof line , stdin) == NULL) { if (feof(stdin)) { exit(txrx_error); } else { Modified: head/usr.bin/unzip/unzip.c ============================================================================== --- head/usr.bin/unzip/unzip.c Fri Jan 13 06:18:23 2012 (r230043) +++ head/usr.bin/unzip/unzip.c Fri Jan 13 06:51:15 2012 (r230044) @@ -422,7 +422,7 @@ handle_existing_file(char **path) fprintf(stderr, "replace %s? [y]es, [n]o, [A]ll, [N]one, [r]ename: ", *path); - if (fgets(buf, sizeof(buf), stdin) == 0) { + if (fgets(buf, sizeof(buf), stdin) == NULL) { clearerr(stdin); printf("NULL\n(EOF or read error, " "treating as \"[N]one\"...)\n"); Modified: head/usr.sbin/config/mkmakefile.c ============================================================================== --- head/usr.sbin/config/mkmakefile.c Fri Jan 13 06:18:23 2012 (r230043) +++ head/usr.sbin/config/mkmakefile.c Fri Jan 13 06:51:15 2012 (r230044) @@ -1,5 +1,5 @@ /* - * Copyright (c) 1993, 19801990 + * Copyright (c) 1980, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -154,7 +154,7 @@ makefile(void) fprintf(ofp, "PROFLEVEL=%d\n", profiling); if (*srcdir != '\0') fprintf(ofp,"S=%s\n", srcdir); - while (fgets(line, BUFSIZ, ifp) != 0) { + while (fgets(line, BUFSIZ, ifp) != NULL) { if (*line != '%') { fprintf(ofp, "%s", line); continue; @@ -204,7 +204,7 @@ makehints(void) ifp = fopen(hint->hint_name, "r"); if (ifp == NULL) err(1, "%s", hint->hint_name); - while (fgets(line, BUFSIZ, ifp) != 0) { + while (fgets(line, BUFSIZ, ifp) != NULL) { /* zap trailing CR and/or LF */ while ((s = strrchr(line, '\n')) != NULL) *s = '\0'; @@ -266,7 +266,7 @@ makeenv(void) fprintf(ofp, "int envmode = %d;\n", envmode); fprintf(ofp, "char static_env[] = {\n"); if (ifp) { - while (fgets(line, BUFSIZ, ifp) != 0) { + while (fgets(line, BUFSIZ, ifp) != NULL) { /* zap trailing CR and/or LF */ while ((s = strrchr(line, '\n')) != NULL) *s = '\0'; Modified: head/usr.sbin/lpr/lpc/lpc.c ============================================================================== --- head/usr.sbin/lpr/lpc/lpc.c Fri Jan 13 06:18:23 2012 (r230043) +++ head/usr.sbin/lpr/lpc/lpc.c Fri Jan 13 06:51:15 2012 (r230044) @@ -188,7 +188,7 @@ cmdscanner(void) history(hist, &he, H_ENTER, bp); } else { - if (fgets(cmdline, MAX_CMDLINE, stdin) == 0) + if (fgets(cmdline, MAX_CMDLINE, stdin) == NULL) quit(0, NULL); if (cmdline[0] == 0 || cmdline[0] == '\n') break; Modified: head/usr.sbin/timed/timedc/timedc.c ============================================================================== --- head/usr.sbin/timed/timedc/timedc.c Fri Jan 13 06:18:23 2012 (r230043) +++ head/usr.sbin/timed/timedc/timedc.c Fri Jan 13 06:51:15 2012 (r230044) @@ -105,7 +105,7 @@ main(argc, argv) printf("timedc> "); (void) fflush(stdout); } - if (fgets(cmdline, sizeof(cmdline), stdin) == 0) + if (fgets(cmdline, sizeof(cmdline), stdin) == NULL) quit(); if (cmdline[0] == 0) break; From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 06:57:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5EEFE106564A; Fri, 13 Jan 2012 06:57:00 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EEB218FC13; Fri, 13 Jan 2012 06:56: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 q0D6uxvf046977; Fri, 13 Jan 2012 06:56:59 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0D6uxxW046975; Fri, 13 Jan 2012 06:56:59 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201201130656.q0D6uxxW046975@svn.freebsd.org> From: Kevin Lo Date: Fri, 13 Jan 2012 06:56: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: r230045 - head/sbin/routed X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 06:57:00 -0000 Author: kevlo Date: Fri Jan 13 06:56:59 2012 New Revision: 230045 URL: http://svn.freebsd.org/changeset/base/230045 Log: Fix a style bug Modified: head/sbin/routed/parms.c Modified: head/sbin/routed/parms.c ============================================================================== --- head/sbin/routed/parms.c Fri Jan 13 06:51:15 2012 (r230044) +++ head/sbin/routed/parms.c Fri Jan 13 06:56:59 2012 (r230045) @@ -188,7 +188,7 @@ gwkludge(void) } for (lnum = 1; ; lnum++) { - if (0 == fgets(lbuf, sizeof(lbuf), fp)) + if (fgets(lbuf, sizeof(lbuf), fp) == NULL) break; lptr = lbuf; while (*lptr == ' ') From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 07:00:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60769106566C; Fri, 13 Jan 2012 07:00:48 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4FA828FC1C; Fri, 13 Jan 2012 07:00: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 q0D70m86047155; Fri, 13 Jan 2012 07:00:48 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0D70meY047153; Fri, 13 Jan 2012 07:00:48 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201201130700.q0D70meY047153@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 13 Jan 2012 07:00: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: r230046 - head/sys/mips/mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 07:00:48 -0000 Author: gonzo Date: Fri Jan 13 07:00:47 2012 New Revision: 230046 URL: http://svn.freebsd.org/changeset/base/230046 Log: - Fix .rela case of R_MIPS_26 relocation. Addednds save diferently for .rel and .rela sections. It's shifted right two bits for former but saved as-is for latter. Modified: head/sys/mips/mips/elf_machdep.c Modified: head/sys/mips/mips/elf_machdep.c ============================================================================== --- head/sys/mips/mips/elf_machdep.c Fri Jan 13 06:56:59 2012 (r230045) +++ head/sys/mips/mips/elf_machdep.c Fri Jan 13 07:00:47 2012 (r230046) @@ -227,7 +227,11 @@ elf_reloc_internal(linker_file_t lf, Elf return (-1); addend &= 0x03ffffff; - addend <<= 2; + /* + * Addendum for .rela R_MIPS_26 is not shifted right + */ + if (rela == NULL) + addend <<= 2; addr += ((Elf_Addr)where & 0xf0000000) | addend; addr >>= 2; From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 07:08:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B5FA106564A; Fri, 13 Jan 2012 07:08:22 +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 6F65B8FC15; Fri, 13 Jan 2012 07:08: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 q0D78M2x047744; Fri, 13 Jan 2012 07:08:22 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0D78M0F047741; Fri, 13 Jan 2012 07:08:22 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201201130708.q0D78M0F047741@svn.freebsd.org> From: Kirk McKusick Date: Fri, 13 Jan 2012 07:08:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230047 - stable/9/sbin/dump X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 07:08:22 -0000 Author: mckusick Date: Fri Jan 13 07:08:21 2012 New Revision: 230047 URL: http://svn.freebsd.org/changeset/base/230047 Log: MFC: 226520 The current /etc/dumpdates file restricts device names to 32 characters. With the addition of various GEOM layers some device names now exceed this length, for example /dev/mirror/encrypted.elig.journal. This change expands the field to 53 bytes which brings the /etc/dumpdates lines to 80 characters. Exceeding 80 characters makes the /etc/dumpdates file much less human readable. A test is added to dump so that it verifies that the device name will fit in the 53 character field failing the dump if it is too long. This change has been checked to verify that its /etc/dumpdates file is compatible with older versions of dump. Reported by: Martin Sugioarto PR: kern/160678 Modified: stable/9/sbin/dump/dump.h stable/9/sbin/dump/itime.c Directory Properties: stable/9/sbin/dump/ (props changed) Modified: stable/9/sbin/dump/dump.h ============================================================================== --- stable/9/sbin/dump/dump.h Fri Jan 13 07:00:47 2012 (r230046) +++ stable/9/sbin/dump/dump.h Fri Jan 13 07:08:21 2012 (r230047) @@ -171,9 +171,10 @@ void putdumptime(void); if (ddatev != NULL) \ for (ddp = ddatev[i = 0]; i < nddates; ddp = ddatev[++i]) -#define DUMPOUTFMT "%-32s %d %s" /* for printf */ +#define DUMPFMTLEN 53 /* max device pathname length */ +#define DUMPOUTFMT "%-*s %d %s" /* for printf */ /* name, level, ctime(date) */ -#define DUMPINFMT "%32s %d %[^\n]\n" /* inverse for scanf */ +#define DUMPINFMT "%s %d %[^\n]\n" /* inverse for scanf */ void sig(int signo); Modified: stable/9/sbin/dump/itime.c ============================================================================== --- stable/9/sbin/dump/itime.c Fri Jan 13 07:00:47 2012 (r230046) +++ stable/9/sbin/dump/itime.c Fri Jan 13 07:08:21 2012 (r230047) @@ -222,7 +222,10 @@ static void dumprecout(FILE *file, const struct dumpdates *what) { - if (fprintf(file, DUMPOUTFMT, what->dd_name, + if (strlen(what->dd_name) > DUMPFMTLEN) + quit("Name '%s' exceeds DUMPFMTLEN (%d) bytes\n", + what->dd_name, DUMPFMTLEN); + if (fprintf(file, DUMPOUTFMT, DUMPFMTLEN, what->dd_name, what->dd_level, ctime(&what->dd_ddate)) < 0) quit("%s: %s\n", dumpdates, strerror(errno)); } From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 07:10:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D090106564A; Fri, 13 Jan 2012 07:10:53 +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 70D878FC14; Fri, 13 Jan 2012 07:10:53 +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 q0D7ArjH047879; Fri, 13 Jan 2012 07:10:53 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0D7ArqQ047876; Fri, 13 Jan 2012 07:10:53 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201201130710.q0D7ArqQ047876@svn.freebsd.org> From: Kirk McKusick Date: Fri, 13 Jan 2012 07:10:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230048 - stable/8/sbin/dump X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 07:10:53 -0000 Author: mckusick Date: Fri Jan 13 07:10:52 2012 New Revision: 230048 URL: http://svn.freebsd.org/changeset/base/230048 Log: MFC: 226520 The current /etc/dumpdates file restricts device names to 32 characters. With the addition of various GEOM layers some device names now exceed this length, for example /dev/mirror/encrypted.elig.journal. This change expands the field to 53 bytes which brings the /etc/dumpdates lines to 80 characters. Exceeding 80 characters makes the /etc/dumpdates file much less human readable. A test is added to dump so that it verifies that the device name will fit in the 53 character field failing the dump if it is too long. This change has been checked to verify that its /etc/dumpdates file is compatible with older versions of dump. Reported by: Martin Sugioarto PR: kern/160678 Modified: stable/8/sbin/dump/dump.h stable/8/sbin/dump/itime.c Directory Properties: stable/8/sbin/dump/ (props changed) Modified: stable/8/sbin/dump/dump.h ============================================================================== --- stable/8/sbin/dump/dump.h Fri Jan 13 07:08:21 2012 (r230047) +++ stable/8/sbin/dump/dump.h Fri Jan 13 07:10:52 2012 (r230048) @@ -171,9 +171,10 @@ void putdumptime(void); if (ddatev != NULL) \ for (ddp = ddatev[i = 0]; i < nddates; ddp = ddatev[++i]) -#define DUMPOUTFMT "%-32s %d %s" /* for printf */ +#define DUMPFMTLEN 53 /* max device pathname length */ +#define DUMPOUTFMT "%-*s %d %s" /* for printf */ /* name, level, ctime(date) */ -#define DUMPINFMT "%32s %d %[^\n]\n" /* inverse for scanf */ +#define DUMPINFMT "%s %d %[^\n]\n" /* inverse for scanf */ void sig(int signo); Modified: stable/8/sbin/dump/itime.c ============================================================================== --- stable/8/sbin/dump/itime.c Fri Jan 13 07:08:21 2012 (r230047) +++ stable/8/sbin/dump/itime.c Fri Jan 13 07:10:52 2012 (r230048) @@ -222,7 +222,10 @@ static void dumprecout(FILE *file, const struct dumpdates *what) { - if (fprintf(file, DUMPOUTFMT, what->dd_name, + if (strlen(what->dd_name) > DUMPFMTLEN) + quit("Name '%s' exceeds DUMPFMTLEN (%d) bytes\n", + what->dd_name, DUMPFMTLEN); + if (fprintf(file, DUMPOUTFMT, DUMPFMTLEN, what->dd_name, what->dd_level, ctime(&what->dd_ddate)) < 0) quit("%s: %s\n", dumpdates, strerror(errno)); } From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 07:19:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D70D106566C; Fri, 13 Jan 2012 07:19:03 +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 3B92E8FC15; Fri, 13 Jan 2012 07:19:03 +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 q0D7J3a8048187; Fri, 13 Jan 2012 07:19:03 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0D7J39q048182; Fri, 13 Jan 2012 07:19:03 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201201130719.q0D7J39q048182@svn.freebsd.org> From: Kirk McKusick Date: Fri, 13 Jan 2012 07:19:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230049 - stable/9/sbin/newfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 07:19:03 -0000 Author: mckusick Date: Fri Jan 13 07:19:02 2012 New Revision: 230049 URL: http://svn.freebsd.org/changeset/base/230049 Log: MFC: 228794 Reduce NFPI by half to keep the default number of inodes the same with the now default 32K/4K filesystem the same as the number of inodes in the previously default 16K/2K filesystem. PR: bin/162659 Reported by: Olivier Cochard-Labbe Modified: stable/9/sbin/newfs/newfs.h Directory Properties: stable/9/sbin/newfs/ (props changed) Modified: stable/9/sbin/newfs/newfs.h ============================================================================== --- stable/9/sbin/newfs/newfs.h Fri Jan 13 07:10:52 2012 (r230048) +++ stable/9/sbin/newfs/newfs.h Fri Jan 13 07:19:02 2012 (r230049) @@ -70,7 +70,7 @@ * We allocate one inode slot per NFPI fragments, expecting this * to be far more than we will ever need. */ -#define NFPI 4 +#define NFPI 2 /* * variables set up by front end. From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 07:28:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B3281065670; Fri, 13 Jan 2012 07:28:35 +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 5F7B08FC13; Fri, 13 Jan 2012 07:28: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 q0D7SZpZ048512; Fri, 13 Jan 2012 07:28:35 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0D7SZmU048509; Fri, 13 Jan 2012 07:28:35 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201201130728.q0D7SZmU048509@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 13 Jan 2012 07:28: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: r230050 - in head/sys/dev/usb: . controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 07:28:35 -0000 Author: hselasky Date: Fri Jan 13 07:28:34 2012 New Revision: 230050 URL: http://svn.freebsd.org/changeset/base/230050 Log: Correct use of USB 3.0 POWER bit in the port status register, hence it was overlapping the USB 3.0 root HUB's speed bits. Reported by: Kohji Okuno MFC after: 1 week Modified: head/sys/dev/usb/controller/xhci.c head/sys/dev/usb/usb_hub.c Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Fri Jan 13 07:19:02 2012 (r230049) +++ head/sys/dev/usb/controller/xhci.c Fri Jan 13 07:28:34 2012 (r230050) @@ -3194,8 +3194,13 @@ xhci_roothub_exec(struct usb_device *ude i |= UPS_OVERCURRENT_INDICATOR; if (v & XHCI_PS_PR) i |= UPS_RESET; - if (v & XHCI_PS_PP) - i |= UPS_PORT_POWER_SS; + if (v & XHCI_PS_PP) { + /* + * The USB 3.0 RH is using the + * USB 2.0's power bit + */ + i |= UPS_PORT_POWER; + } USETW(sc->sc_hub_desc.ps.wPortStatus, i); i = 0; Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Fri Jan 13 07:19:02 2012 (r230049) +++ head/sys/dev/usb/usb_hub.c Fri Jan 13 07:28:34 2012 (r230050) @@ -327,6 +327,7 @@ uhub_reattach_port(struct uhub_softc *sc enum usb_dev_speed speed; enum usb_hc_mode mode; usb_error_t err; + uint16_t power_mask; uint8_t timeout; DPRINTF("reattaching port %d\n", portno); @@ -373,20 +374,22 @@ repeat: case USB_SPEED_HIGH: case USB_SPEED_FULL: case USB_SPEED_LOW: - if (!(sc->sc_st.port_status & UPS_PORT_POWER)) { - DPRINTF("WARNING: strange, connected port %d " - "has no power\n", portno); - } + power_mask = UPS_PORT_POWER; break; case USB_SPEED_SUPER: - if (!(sc->sc_st.port_status & UPS_PORT_POWER_SS)) { - DPRINTF("WARNING: strange, connected port %d " - "has no power\n", portno); - } + if (udev->parent_hub == NULL) + power_mask = UPS_PORT_POWER; + else + power_mask = UPS_PORT_POWER_SS; break; default: + power_mask = 0; break; } + if (!(sc->sc_st.port_status & power_mask)) { + DPRINTF("WARNING: strange, connected port %d " + "has no power\n", portno); + } /* check if the device is in Host Mode */ From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 07:57:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D796106564A; Fri, 13 Jan 2012 07:57:37 +0000 (UTC) (envelope-from joel@vnode.se) Received: from mail.vnode.se (mail.vnode.se [62.119.52.80]) by mx1.freebsd.org (Postfix) with ESMTP id 8E6AA8FC08; Fri, 13 Jan 2012 07:57:36 +0000 (UTC) Received: from mail.vnode.se (localhost [127.0.0.1]) by mail.vnode.se (Postfix) with ESMTP id AC724E3F07A; Fri, 13 Jan 2012 08:57:34 +0100 (CET) X-Virus-Scanned: amavisd-new at vnode.se Received: from mail.vnode.se ([127.0.0.1]) by mail.vnode.se (mail.vnode.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eD-5VlHdIY7G; Fri, 13 Jan 2012 08:57:29 +0100 (CET) Received: from goofy01.vnodelab.local (unknown [212.247.52.12]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.vnode.se (Postfix) with ESMTPSA id 7246FE3F079; Fri, 13 Jan 2012 08:57:28 +0100 (CET) Date: Fri, 13 Jan 2012 08:57:26 +0100 From: Joel Dahl To: Pedro Giffuni Message-ID: <20120113075726.GA11137@goofy01.vnodelab.local> References: <201201120743.41757.jhb@freebsd.org> <1326396803.27040.YahooMailClassic@web113506.mail.gq1.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1326396803.27040.YahooMailClassic@web113506.mail.gq1.yahoo.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin , joel@freebsd.org Subject: Re: svn commit: r229981 - in head/sys: conf dev/sound/pci gnu/dev/sound/pci modules/sound/driver/emu10kx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 07:57:37 -0000 On 12-01-2012 11:33, Pedro Giffuni wrote: > Hello; > > --- Gio 12/1/12, John Baldwin ha scritto: > > > Da: John Baldwin > > Oggetto: Re: svn commit: r229981 - in head/sys: conf dev/sound/pci gnu/dev/sound/pci modules/sound/driver/emu10kx > > A: "Pedro F. Giffuni" > > Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, joel@freebsd.org > > Data: Giovedì 12 gennaio 2012, 07:43 > > On Wednesday, January 11, 2012 > > 4:17:14 pm Pedro F. Giffuni wrote: > > > Author: pfg > > > Date: Wed Jan 11 21:17:14 2012 > > > New Revision: 229981 > > > URL: http://svn.freebsd.org/changeset/base/229981 > > > > ...    > > >   The emu10kx driver is now free from the GPL. > > >    > > >   PR:        153901 > > >   Tested by:    mav, joel > > >   Approved by:    jhb (mentor) > > >   MFC after:    2 weeks > > > > Is the emu10kx driver a superset of em10k1 now (meaning > > does it support all > > the em10k1 devices and should em10k1 be retired)? > > > > Both device drivers seem to have diverged significantly > and while emu10kx seems to be superior, some people still > have problems with it: > > http://docs.freebsd.org/cgi/mid.cgi?201201100024.q0A0OF24069073 This has already been fixed and MFC'd, AFAIK. -- Joel From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 08:24:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C2D11065673; Fri, 13 Jan 2012 08:24:53 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-tul01m020-f182.google.com (mail-tul01m020-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 274508FC15; Fri, 13 Jan 2012 08:24:52 +0000 (UTC) Received: by obbta17 with SMTP id ta17so2857915obb.13 for ; Fri, 13 Jan 2012 00:24:52 -0800 (PST) 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=MhwV+R7WPiwOEm2BQufYh5TzrBYbSgG5LQP26QmPZJw=; b=alVZVwn/M2BL/pjRj+K2cERS9Pkc/vN0njTehT+YjZgEpxrEUNEWpRBpc84lET5bpx 2QgcA8WOE3nC99xuv6r4GJ82bjeztZDyjVGWiXkSVBSIyhp6jvrN8lrphKlcikUx1R2+ OkAIRUiBBTi2dLqf9TimmBV/gDcU/4NHnYX1Q= MIME-Version: 1.0 Received: by 10.182.122.5 with SMTP id lo5mr34238obb.13.1326443092530; Fri, 13 Jan 2012 00:24:52 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.182.171.67 with HTTP; Fri, 13 Jan 2012 00:24:52 -0800 (PST) In-Reply-To: <201201130651.q0D6pF0l046741@svn.freebsd.org> References: <201201130651.q0D6pF0l046741@svn.freebsd.org> Date: Fri, 13 Jan 2012 11:24:52 +0300 X-Google-Sender-Auth: LQhhVbGnHd5kNsVGkK6xdDvlG9Y Message-ID: From: Sergey Kandaurov To: Kevin Lo 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 Subject: Re: svn commit: r230044 - in head: usr.bin/mail usr.bin/tftp usr.bin/unzip usr.sbin/config usr.sbin/lpr/lpc usr.sbin/timed/timedc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 08:24:53 -0000 On 13 January 2012 10:51, Kevin Lo wrote: > Author: kevlo > Date: Fri Jan 13 06:51:15 2012 > New Revision: 230044 > URL: http://svn.freebsd.org/changeset/base/230044 > > Log: > =A0fgets(3) returns a pointer, so compare against NULL, not integer 0. > [...] > Modified: head/usr.sbin/config/mkmakefile.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/config/mkmakefile.c =A0 Fri Jan 13 06:18:23 2012 =A0 = =A0 =A0 =A0(r230043) > +++ head/usr.sbin/config/mkmakefile.c =A0 Fri Jan 13 06:51:15 2012 =A0 = =A0 =A0 =A0(r230044) > @@ -1,5 +1,5 @@ > =A0/* > - * Copyright (c) 1993, 19801990 > + * Copyright (c) 1980, 1993 This should be rather "Copyright (c) 1980, 1990, 1993" It was "1980,1990" until 4.4BSD-Alpha (and i386bsd), then changed to "1993, 19801990" in 4.4BSD-Lite. --=20 wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 09:08:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B872106566B; Fri, 13 Jan 2012 09:08:42 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2AA038FC08; Fri, 13 Jan 2012 09:08: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 q0D98gS3052403; Fri, 13 Jan 2012 09:08:42 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0D98fhr052401; Fri, 13 Jan 2012 09:08:41 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201201130908.q0D98fhr052401@svn.freebsd.org> From: Kevin Lo Date: Fri, 13 Jan 2012 09:08: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: r230051 - head/usr.sbin/config X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 09:08:42 -0000 Author: kevlo Date: Fri Jan 13 09:08:41 2012 New Revision: 230051 URL: http://svn.freebsd.org/changeset/base/230051 Log: Fix copyright year Spotted by: pluknet Modified: head/usr.sbin/config/mkmakefile.c Modified: head/usr.sbin/config/mkmakefile.c ============================================================================== --- head/usr.sbin/config/mkmakefile.c Fri Jan 13 07:28:34 2012 (r230050) +++ head/usr.sbin/config/mkmakefile.c Fri Jan 13 09:08:41 2012 (r230051) @@ -1,5 +1,5 @@ /* - * Copyright (c) 1980, 1993 + * Copyright (c) 1980, 1990, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 09:10:59 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B877106566C; Fri, 13 Jan 2012 09:10:59 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from ns.kevlo.org (kevlo.org [220.128.136.52]) by mx1.freebsd.org (Postfix) with ESMTP id B97758FC1B; Fri, 13 Jan 2012 09:10:57 +0000 (UTC) Received: from [127.0.0.1] (kevlo@kevlo.org [220.128.136.52]) by ns.kevlo.org (8.14.3/8.14.3) with ESMTP id q0D9AuRv009970; Fri, 13 Jan 2012 17:10:56 +0800 (CST) From: Kevin Lo To: Sergey Kandaurov In-Reply-To: References: <201201130651.q0D6pF0l046741@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Fri, 13 Jan 2012 17:10:56 +0800 Message-ID: <1326445856.1878.1.camel@esl.kevlo.org> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r230044 - in head: usr.bin/mail usr.bin/tftp usr.bin/unzip usr.sbin/config usr.sbin/lpr/lpc usr.sbin/timed/timedc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 09:10:59 -0000 On Fri, 2012-01-13 at 11:24 +0300, Sergey Kandaurov wrote: > On 13 January 2012 10:51, Kevin Lo wrote: > > Author: kevlo > > Date: Fri Jan 13 06:51:15 2012 > > New Revision: 230044 > > URL: http://svn.freebsd.org/changeset/base/230044 > > > > Log: > > fgets(3) returns a pointer, so compare against NULL, not integer 0. > > > [...] > > Modified: head/usr.sbin/config/mkmakefile.c > > ============================================================================== > > --- head/usr.sbin/config/mkmakefile.c Fri Jan 13 06:18:23 2012 (r230043) > > +++ head/usr.sbin/config/mkmakefile.c Fri Jan 13 06:51:15 2012 (r230044) > > @@ -1,5 +1,5 @@ > > /* > > - * Copyright (c) 1993, 19801990 > > + * Copyright (c) 1980, 1993 > > This should be rather "Copyright (c) 1980, 1990, 1993" > It was "1980,1990" until 4.4BSD-Alpha (and i386bsd), > then changed to "1993, 19801990" in 4.4BSD-Lite. My bad. This change should be done in a separate commit. Just committed the fix to HEAD, thanks for pointing that out. Kevin From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 10:21:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6579E106566B; Fri, 13 Jan 2012 10:21:16 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 462C98FC1C; Fri, 13 Jan 2012 10:21: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 q0DALGml055212; Fri, 13 Jan 2012 10:21:16 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DALGXU055209; Fri, 13 Jan 2012 10:21:16 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201201131021.q0DALGXU055209@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 13 Jan 2012 10:21: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: r230052 - head/sys/dev/netmap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 10:21:16 -0000 Author: luigi Date: Fri Jan 13 10:21:15 2012 New Revision: 230052 URL: http://svn.freebsd.org/changeset/base/230052 Log: Two performance-related fixes: 1. as reported by Alexander Fiveg, the allocator was reporting half of the allocated memory. Fix this by exiting from the loop earlier (not too critical because this code is going away soon). 2. following a discussion on freebsd-current http://lists.freebsd.org/pipermail/freebsd-current/2012-January/031144.html turns out that (re)loading the dmamap was expensive and not optimized. This operation is in the critical path when doing zero-copy forwarding between interfaces. At least on netmap and i386/amd64, the bus_dmamap_load can be completely bypassed if the map is NULL, so we do it. The latter change gives an almost 3x improvement in forwarding performance, from the previous 9.5Mpps at 2.9GHz to the current line rate (14.2Mpps) at 1.733GHz. (this is for 64+4 byte packets, in other configurations the PCIe bus is a bottleneck). Modified: head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_kern.h Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Fri Jan 13 09:08:41 2012 (r230051) +++ head/sys/dev/netmap/netmap.c Fri Jan 13 10:21:15 2012 (r230052) @@ -426,7 +426,6 @@ netmap_dtor(void *data) } - /* * Create and return a new ``netmap_if`` object, and possibly also * rings and packet buffors. @@ -1393,30 +1392,6 @@ netmap_reset(struct netmap_adapter *na, return kring->ring->slot; } -static void -ns_dmamap_cb(__unused void *arg, __unused bus_dma_segment_t * segs, - __unused int nseg, __unused int error) -{ -} - -/* unload a bus_dmamap and create a new one. Used when the - * buffer in the slot is changed. - * XXX buflen is probably not needed, buffers have constant size. - */ -void -netmap_reload_map(bus_dma_tag_t tag, bus_dmamap_t map, void *buf) -{ - bus_dmamap_unload(tag, map); - bus_dmamap_load(tag, map, buf, NETMAP_BUF_SIZE, ns_dmamap_cb, - NULL, BUS_DMA_NOWAIT); -} - -void -netmap_load_map(bus_dma_tag_t tag, bus_dmamap_t map, void *buf) -{ - bus_dmamap_load(tag, map, buf, NETMAP_BUF_SIZE, ns_dmamap_cb, - NULL, BUS_DMA_NOWAIT); -} /*------ netmap memory allocator -------*/ /* @@ -1541,7 +1516,7 @@ netmap_memory_init(void) int i, n, sz = NETMAP_MEMORY_SIZE; int extra_sz = 0; // space for rings and two spare buffers - for (; !buf && sz >= 1<<20; sz >>=1) { + for (; sz >= 1<<20; sz >>=1) { extra_sz = sz/200; extra_sz = (extra_sz + 2*PAGE_SIZE - 1) & ~(PAGE_SIZE-1); buf = contigmalloc(sz + extra_sz, @@ -1552,6 +1527,8 @@ netmap_memory_init(void) PAGE_SIZE, /* alignment */ 0 /* boundary */ ); + if (buf) + break; } if (buf == NULL) return (ENOMEM); Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Fri Jan 13 09:08:41 2012 (r230051) +++ head/sys/dev/netmap/netmap_kern.h Fri Jan 13 10:21:15 2012 (r230052) @@ -169,16 +169,8 @@ int netmap_start(struct ifnet *, struct enum txrx { NR_RX = 0, NR_TX = 1 }; struct netmap_slot *netmap_reset(struct netmap_adapter *na, enum txrx tx, int n, u_int new_cur); -void netmap_load_map(bus_dma_tag_t tag, bus_dmamap_t map, void *buf); -void netmap_reload_map(bus_dma_tag_t tag, bus_dmamap_t map, void *buf); int netmap_ring_reinit(struct netmap_kring *); -/* - * XXX eventually, get rid of netmap_total_buffers and netmap_buffer_base - * in favour of the structure - */ -// struct netmap_buf_pool; -// extern struct netmap_buf_pool nm_buf_pool; extern u_int netmap_total_buffers; extern char *netmap_buffer_base; extern int netmap_verbose; // XXX debugging @@ -203,6 +195,35 @@ enum { #define NA(_ifp) ((struct netmap_adapter *)WNA(_ifp)) +/* Callback invoked by the dma machinery after a successfull dmamap_load */ +static void netmap_dmamap_cb(__unused void *arg, + __unused bus_dma_segment_t * segs, __unused int nseg, __unused int error) +{ +} + +/* bus_dmamap_load wrapper: call aforementioned function if map != NULL. + * XXX can we do it without a callback ? + */ +static inline void +netmap_load_map(bus_dma_tag_t tag, bus_dmamap_t map, void *buf) +{ + if (map) + bus_dmamap_load(tag, map, buf, NETMAP_BUF_SIZE, + netmap_dmamap_cb, NULL, BUS_DMA_NOWAIT); +} + +/* update the map when a buffer changes. */ +static inline void +netmap_reload_map(bus_dma_tag_t tag, bus_dmamap_t map, void *buf) +{ + if (map) { + bus_dmamap_unload(tag, map); + bus_dmamap_load(tag, map, buf, NETMAP_BUF_SIZE, + netmap_dmamap_cb, NULL, BUS_DMA_NOWAIT); + } +} + + /* * NMB return the virtual address of a buffer (buffer 0 on bad index) * PNMB also fills the physical address From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 10:21:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E49CC106567A; Fri, 13 Jan 2012 10:21:17 +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 CE61D8FC27; Fri, 13 Jan 2012 10:21: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 q0DALHAb055248; Fri, 13 Jan 2012 10:21:17 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DALH1m055244; Fri, 13 Jan 2012 10:21:17 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201201131021.q0DALH1m055244@svn.freebsd.org> From: Alexander Motin Date: Fri, 13 Jan 2012 10:21: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: r230053 - head/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 10:21:18 -0000 Author: mav Date: Fri Jan 13 10:21:17 2012 New Revision: 230053 URL: http://svn.freebsd.org/changeset/base/230053 Log: Add BIO_DELETE support for SCSI Direct Access devices (da). Depending on device capabilities use different methods to implement it. Currently used method can be read/set via kern.cam.da.X.delete_method sysctls. Possible values are: NONE - no provisioning support reported by the device; DISABLE - provisioning support was disabled because of errors; ZERO - use WRITE SAME (10) command to write zeroes; WS10 - use WRITE SAME (10) command with UNMAP bit set; WS16 - use WRITE SAME (16) command with UNMAP bit set; UNMAP - use UNMAP command (equivalent of the ATA DSM TRIM command). The last two methods (UNMAP and WS16) are defined by SBC specification and the UNMAP method is the most advanced one. The rest of methods I've found supported in Linux, and as soon as they were trivial to implement, then why not? Hope they will be useful in some cases. Unluckily I have no devices properly reporting parameters of the logical block provisioning support via respective VPD pages (0xB0 and 0xB2). So all info I have/use now is the flag telling whether logical block provisioning is supported or not. As result, specific methods chosen now by trying different ones in order (UNMAP, WS16, DISABLE) and checking completion status to fallback if needed. I don't expect problems from this, as if something go wrong, it should just disable itself. It may disable even too aggressively if only some command parameter misfit. Unlike Linux, which executes each delete with separate request, I've implemented here the same request aggregation as implemented in ada driver. Tests on SSDs I have show much better results doing it this way: above 8GB/s of the linear delete on Intel SATA SSD on LSI SAS HBA (mps). Reviewed by: silence on scsi@ MFC after: 2 month Sponsored by: iXsystems, Inc. Modified: head/sys/cam/scsi/scsi_all.c head/sys/cam/scsi/scsi_all.h head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Fri Jan 13 10:21:15 2012 (r230052) +++ head/sys/cam/scsi/scsi_all.c Fri Jan 13 10:21:17 2012 (r230053) @@ -364,6 +364,8 @@ static struct op_table_entry scsi_op_cod { 0x40, D | T | L | P | W | R | O | M | S | C, "CHANGE DEFINITION" }, /* 41 O WRITE SAME(10) */ { 0x41, D, "WRITE SAME(10)" }, + /* 42 O UNMAP */ + { 0x42, D, "UNMAP" }, /* 42 O READ SUB-CHANNEL */ { 0x42, R, "READ SUB-CHANNEL" }, /* 43 O READ TOC/PMA/ATIP */ @@ -5570,6 +5572,104 @@ scsi_read_write(struct ccb_scsiio *csio, } void +scsi_write_same(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int8_t tag_action, u_int8_t byte2, + int minimum_cmd_size, u_int64_t lba, u_int32_t block_count, + u_int8_t *data_ptr, u_int32_t dxfer_len, u_int8_t sense_len, + u_int32_t timeout) +{ + u_int8_t cdb_len; + if ((minimum_cmd_size < 16) && + ((block_count & 0xffff) == block_count) && + ((lba & 0xffffffff) == lba)) { + /* + * Need a 10 byte cdb. + */ + struct scsi_write_same_10 *scsi_cmd; + + scsi_cmd = (struct scsi_write_same_10 *)&csio->cdb_io.cdb_bytes; + scsi_cmd->opcode = WRITE_SAME_10; + scsi_cmd->byte2 = byte2; + scsi_ulto4b(lba, scsi_cmd->addr); + scsi_cmd->group = 0; + scsi_ulto2b(block_count, scsi_cmd->length); + scsi_cmd->control = 0; + cdb_len = sizeof(*scsi_cmd); + + CAM_DEBUG(csio->ccb_h.path, CAM_DEBUG_SUBTRACE, + ("10byte: %x%x%x%x:%x%x: %d\n", scsi_cmd->addr[0], + scsi_cmd->addr[1], scsi_cmd->addr[2], + scsi_cmd->addr[3], scsi_cmd->length[0], + scsi_cmd->length[1], dxfer_len)); + } else { + /* + * 16 byte CDB. We'll only get here if the LBA is larger + * than 2^32, or if the user asks for a 16 byte command. + */ + struct scsi_write_same_16 *scsi_cmd; + + scsi_cmd = (struct scsi_write_same_16 *)&csio->cdb_io.cdb_bytes; + scsi_cmd->opcode = WRITE_SAME_16; + scsi_cmd->byte2 = byte2; + scsi_u64to8b(lba, scsi_cmd->addr); + scsi_ulto4b(block_count, scsi_cmd->length); + scsi_cmd->group = 0; + scsi_cmd->control = 0; + cdb_len = sizeof(*scsi_cmd); + + CAM_DEBUG(csio->ccb_h.path, CAM_DEBUG_SUBTRACE, + ("16byte: %x%x%x%x%x%x%x%x:%x%x%x%x: %d\n", + scsi_cmd->addr[0], scsi_cmd->addr[1], + scsi_cmd->addr[2], scsi_cmd->addr[3], + scsi_cmd->addr[4], scsi_cmd->addr[5], + scsi_cmd->addr[6], scsi_cmd->addr[7], + scsi_cmd->length[0], scsi_cmd->length[1], + scsi_cmd->length[2], scsi_cmd->length[3], + dxfer_len)); + } + cam_fill_csio(csio, + retries, + cbfcnp, + /*flags*/CAM_DIR_OUT, + tag_action, + data_ptr, + dxfer_len, + sense_len, + cdb_len, + timeout); +} + +void +scsi_unmap(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int8_t tag_action, u_int8_t byte2, + u_int8_t *data_ptr, u_int16_t dxfer_len, u_int8_t sense_len, + u_int32_t timeout) +{ + struct scsi_unmap *scsi_cmd; + + scsi_cmd = (struct scsi_unmap *)&csio->cdb_io.cdb_bytes; + scsi_cmd->opcode = UNMAP; + scsi_cmd->byte2 = byte2; + scsi_ulto4b(0, scsi_cmd->reserved); + scsi_cmd->group = 0; + scsi_ulto2b(dxfer_len, scsi_cmd->length); + scsi_cmd->control = 0; + + cam_fill_csio(csio, + retries, + cbfcnp, + /*flags*/CAM_DIR_OUT, + tag_action, + data_ptr, + dxfer_len, + sense_len, + sizeof(*scsi_cmd), + timeout); +} + +void scsi_receive_diagnostic_results(struct ccb_scsiio *csio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb*), uint8_t tag_action, int pcv, uint8_t page_code, Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Fri Jan 13 10:21:15 2012 (r230052) +++ head/sys/cam/scsi/scsi_all.h Fri Jan 13 10:21:17 2012 (r230053) @@ -819,6 +819,41 @@ struct scsi_rw_16 u_int8_t control; }; +struct scsi_write_same_10 +{ + uint8_t opcode; + uint8_t byte2; +#define SWS_LBDATA 0x02 +#define SWS_PBDATA 0x04 +#define SWS_UNMAP 0x08 +#define SWS_ANCHOR 0x10 + uint8_t addr[4]; + uint8_t group; + uint8_t length[2]; + uint8_t control; +}; + +struct scsi_write_same_16 +{ + uint8_t opcode; + uint8_t byte2; + uint8_t addr[8]; + uint8_t length[4]; + uint8_t group; + uint8_t control; +}; + +struct scsi_unmap +{ + uint8_t opcode; + uint8_t byte2; +#define SU_ANCHOR 0x01 + uint8_t reserved[4]; + uint8_t group; + uint8_t length[2]; + uint8_t control; +}; + struct scsi_write_verify_10 { uint8_t opcode; @@ -957,6 +992,8 @@ struct ata_pass_16 { #define WRITE_BUFFER 0x3B #define READ_BUFFER 0x3C #define CHANGE_DEFINITION 0x40 +#define WRITE_SAME_10 0x41 +#define UNMAP 0x42 #define LOG_SELECT 0x4C #define LOG_SENSE 0x4D #define MODE_SELECT_10 0x55 @@ -970,6 +1007,7 @@ struct ata_pass_16 { #define WRITE_16 0x8A #define WRITE_VERIFY_16 0x8E #define SYNCHRONIZE_CACHE_16 0x91 +#define WRITE_SAME_16 0x93 #define SERVICE_ACTION_IN 0x9E #define REPORT_LUNS 0xA0 #define ATA_PASS_12 0xA1 @@ -2312,6 +2350,20 @@ void scsi_read_write(struct ccb_scsiio * u_int32_t dxfer_len, u_int8_t sense_len, u_int32_t timeout); +void scsi_write_same(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int8_t tag_action, u_int8_t byte2, + int minimum_cmd_size, u_int64_t lba, + u_int32_t block_count, u_int8_t *data_ptr, + u_int32_t dxfer_len, u_int8_t sense_len, + u_int32_t timeout); + +void scsi_unmap(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int8_t tag_action, u_int8_t byte2, + u_int8_t *data_ptr, u_int16_t dxfer_len, + u_int8_t sense_len, u_int32_t timeout); + void scsi_start_stop(struct ccb_scsiio *csio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, int start, int load_eject, Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Fri Jan 13 10:21:15 2012 (r230052) +++ head/sys/cam/scsi/scsi_da.c Fri Jan 13 10:21:17 2012 (r230053) @@ -83,8 +83,7 @@ typedef enum { DA_FLAG_RETRY_UA = 0x080, DA_FLAG_OPEN = 0x100, DA_FLAG_SCTX_INIT = 0x200, - DA_FLAG_CAN_RC16 = 0x400, - DA_FLAG_CAN_LBPME = 0x800 + DA_FLAG_CAN_RC16 = 0x400 } da_flags; typedef enum { @@ -101,10 +100,24 @@ typedef enum { DA_CCB_BUFFER_IO = 0x03, DA_CCB_WAITING = 0x04, DA_CCB_DUMP = 0x05, + DA_CCB_DELETE = 0x06, DA_CCB_TYPE_MASK = 0x0F, DA_CCB_RETRY_UA = 0x10 } da_ccb_state; +typedef enum { + DA_DELETE_NONE, + DA_DELETE_DISABLE, + DA_DELETE_ZERO, + DA_DELETE_WS10, + DA_DELETE_WS16, + DA_DELETE_UNMAP, + DA_DELETE_MAX = DA_DELETE_UNMAP +} da_delete_methods; + +static const char *da_delete_method_names[] = + { "NONE", "DISABLE", "ZERO", "WS10", "WS16", "UNMAP" }; + /* Offsets into our private area for storing information */ #define ccb_state ppriv_field0 #define ccb_bp ppriv_ptr1 @@ -119,8 +132,12 @@ struct disk_params { u_int stripeoffset; }; +#define UNMAP_MAX_RANGES 512 + struct da_softc { struct bio_queue_head bio_queue; + struct bio_queue_head delete_queue; + struct bio_queue_head delete_run_queue; SLIST_ENTRY(da_softc) links; LIST_HEAD(, ccb_hdr) pending_ccbs; da_state state; @@ -130,6 +147,10 @@ struct da_softc { int error_inject; int ordered_tag_count; int outstanding_cmds; + int unmap_max_ranges; + int unmap_max_lba; + int delete_running; + da_delete_methods delete_method; struct disk_params params; struct disk *disk; union ccb saved_ccb; @@ -138,6 +159,7 @@ struct da_softc { struct sysctl_oid *sysctl_tree; struct callout sendordered_c; uint64_t wwpn; + uint8_t unmap_buf[UNMAP_MAX_RANGES * 16 + 8]; }; struct da_quirk_entry { @@ -796,6 +818,7 @@ static void daasync(void *callback_arg, struct cam_path *path, void *arg); static void dasysctlinit(void *context, int pending); static int dacmdsizesysctl(SYSCTL_HANDLER_ARGS); +static int dadeletemethodsysctl(SYSCTL_HANDLER_ARGS); static periph_ctor_t daregister; static periph_dtor_t dacleanup; static periph_start_t dastart; @@ -916,6 +939,10 @@ daopen(struct disk *dp) softc->disk->d_fwheads = softc->params.heads; softc->disk->d_devstat->block_size = softc->params.secsize; softc->disk->d_devstat->flags &= ~DEVSTAT_BS_UNAVAILABLE; + if (softc->delete_method > DA_DELETE_DISABLE) + softc->disk->d_flags |= DISKFLAG_CANDELETE; + else + softc->disk->d_flags &= ~DISKFLAG_CANDELETE; if ((softc->flags & DA_FLAG_PACK_REMOVABLE) != 0 && (softc->quirks & DA_Q_NO_PREVENT) == 0) @@ -1013,6 +1040,26 @@ daclose(struct disk *dp) return (0); } +static void +daschedule(struct cam_periph *periph) +{ + struct da_softc *softc = (struct da_softc *)periph->softc; + uint32_t prio; + + /* Check if cam_periph_getccb() was called. */ + prio = periph->immediate_priority; + + /* Check if we have more work to do. */ + if (bioq_first(&softc->bio_queue) || + (!softc->delete_running && bioq_first(&softc->delete_queue))) { + prio = CAM_PRIORITY_NORMAL; + } + + /* Schedule CCB if any of above is true. */ + if (prio != CAM_PRIORITY_NONE) + xpt_schedule(periph, prio); +} + /* * Actually translate the requested transfer into one the physical driver * can understand. The transfer is described by a buf and will include @@ -1045,12 +1092,18 @@ dastrategy(struct bio *bp) /* * Place it in the queue of disk activities for this disk */ - bioq_disksort(&softc->bio_queue, bp); + if (bp->bio_cmd == BIO_DELETE) { + if (bp->bio_bcount == 0) + biodone(bp); + else + bioq_disksort(&softc->delete_queue, bp); + } else + bioq_disksort(&softc->bio_queue, bp); /* * Schedule ourselves for performing the work. */ - xpt_schedule(periph, CAM_PRIORITY_NORMAL); + daschedule(periph); cam_periph_unlock(periph); return; @@ -1213,6 +1266,7 @@ daoninvalidate(struct cam_periph *periph * with XPT_ABORT_CCB. */ bioq_flush(&softc->bio_queue, NULL, ENXIO); + bioq_flush(&softc->delete_queue, NULL, ENXIO); disk_gone(softc->disk); xpt_print(periph->path, "lost device - %d outstanding, %d refs\n", @@ -1358,6 +1412,10 @@ dasysctlinit(void *context, int pending) * the fly. */ SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "delete_method", CTLTYPE_STRING | CTLFLAG_RW, + &softc->delete_method, 0, dadeletemethodsysctl, "A", + "BIO_DELETE execution method"); + SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "minimum_cmd_size", CTLTYPE_INT | CTLFLAG_RW, &softc->minimum_cmd_size, 0, dacmdsizesysctl, "I", "Minimum CDB size"); @@ -1431,6 +1489,32 @@ dacmdsizesysctl(SYSCTL_HANDLER_ARGS) return (0); } +static int +dadeletemethodsysctl(SYSCTL_HANDLER_ARGS) +{ + char buf[16]; + int error; + const char *p; + int i, value; + + value = *(int *)arg1; + if (value < 0 || value > DA_DELETE_MAX) + p = "UNKNOWN"; + else + p = da_delete_method_names[value]; + strncpy(buf, p, sizeof(buf)); + error = sysctl_handle_string(oidp, buf, sizeof(buf), req); + if (error != 0 || req->newptr == NULL) + return (error); + for (i = 0; i <= DA_DELETE_MAX; i++) { + if (strcmp(buf, da_delete_method_names[i]) != 0) + continue; + *(int *)arg1 = i; + return (0); + } + return (EINVAL); +} + static cam_status daregister(struct cam_periph *periph, void *arg) { @@ -1463,10 +1547,14 @@ daregister(struct cam_periph *periph, vo LIST_INIT(&softc->pending_ccbs); softc->state = DA_STATE_PROBE; bioq_init(&softc->bio_queue); + bioq_init(&softc->delete_queue); + bioq_init(&softc->delete_run_queue); if (SID_IS_REMOVABLE(&cgd->inq_data)) softc->flags |= DA_FLAG_PACK_REMOVABLE; if ((cgd->inq_data.flags & SID_CmdQue) != 0) softc->flags |= DA_FLAG_TAGGED_QUEUING; + softc->unmap_max_ranges = UNMAP_MAX_RANGES; + softc->unmap_max_lba = 1024*1024*2; periph->softc = softc; @@ -1621,13 +1709,10 @@ dastart(struct cam_periph *periph, union switch (softc->state) { case DA_STATE_NORMAL: { - /* Pull a buffer from the queue and get going on it */ - struct bio *bp; + struct bio *bp, *bp1; + uint8_t tag_code; - /* - * See if there is a buf with work for us to do.. - */ - bp = bioq_first(&softc->bio_queue); + /* Execute immediate CCB if waiting. */ if (periph->immediate_priority <= periph->pinfo.priority) { CAM_DEBUG_PRINT(CAM_DEBUG_SUBTRACE, ("queuing for immediate ccb\n")); @@ -1636,84 +1721,186 @@ dastart(struct cam_periph *periph, union periph_links.sle); periph->immediate_priority = CAM_PRIORITY_NONE; wakeup(&periph->ccb_list); - } else if (bp == NULL) { - xpt_release_ccb(start_ccb); - } else { - u_int8_t tag_code; + /* May have more work to do, so ensure we stay scheduled */ + daschedule(periph); + break; + } - bioq_remove(&softc->bio_queue, bp); + /* Run BIO_DELETE if not running yet. */ + if (!softc->delete_running && + (bp = bioq_first(&softc->delete_queue)) != NULL) { + uint64_t lba; + u_int count; + + if (softc->delete_method == DA_DELETE_UNMAP) { + uint8_t *buf = softc->unmap_buf; + uint64_t lastlba = (uint64_t)-1; + uint32_t lastcount = 0; + int blocks = 0, off, ranges = 0; + + softc->delete_running = 1; + bzero(softc->unmap_buf, sizeof(softc->unmap_buf)); + bp1 = bp; + do { + bioq_remove(&softc->delete_queue, bp1); + if (bp1 != bp) + bioq_insert_tail(&softc->delete_run_queue, bp1); + lba = bp1->bio_pblkno; + count = bp1->bio_bcount / softc->params.secsize; + + /* Try to extend the previous range. */ + if (lba == lastlba) { + lastcount += count; + off = (ranges - 1) * 16 + 8; + scsi_ulto4b(lastcount, &buf[off + 8]); + } else if (count > 0) { + off = ranges * 16 + 8; + scsi_u64to8b(lba, &buf[off + 0]); + scsi_ulto4b(count, &buf[off + 8]); + lastcount = count; + ranges++; + } + blocks += count; + lastlba = lba + count; + bp1 = bioq_first(&softc->delete_queue); + if (bp1 == NULL || + ranges >= softc->unmap_max_ranges || + blocks + bp1->bio_bcount / + softc->params.secsize > softc->unmap_max_lba) + break; + } while (1); + scsi_ulto2b(count * 16 + 6, &buf[0]); + scsi_ulto2b(count * 16, &buf[2]); + + scsi_unmap(&start_ccb->csio, + /*retries*/da_retry_count, + /*cbfcnp*/dadone, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*byte2*/0, + /*data_ptr*/ buf, + /*dxfer_len*/ count * 16 + 8, + /*sense_len*/SSD_FULL_SIZE, + da_default_timeout * 1000); + start_ccb->ccb_h.ccb_state = DA_CCB_DELETE; + goto out; + } else if (softc->delete_method == DA_DELETE_ZERO || + softc->delete_method == DA_DELETE_WS10 || + softc->delete_method == DA_DELETE_WS16) { + softc->delete_running = 1; + lba = bp->bio_pblkno; + count = 0; + bp1 = bp; + do { + bioq_remove(&softc->delete_queue, bp1); + if (bp1 != bp) + bioq_insert_tail(&softc->delete_run_queue, bp1); + count += bp1->bio_bcount / softc->params.secsize; + bp1 = bioq_first(&softc->delete_queue); + if (bp1 == NULL || + lba + count != bp1->bio_pblkno || + count + bp1->bio_bcount / + softc->params.secsize > 0xffff) + break; + } while (1); + + scsi_write_same(&start_ccb->csio, + /*retries*/da_retry_count, + /*cbfcnp*/dadone, + /*tag_action*/MSG_SIMPLE_Q_TAG, + /*byte2*/softc->delete_method == + DA_DELETE_ZERO ? 0 : SWS_UNMAP, + softc->delete_method == + DA_DELETE_WS16 ? 16 : 10, + /*lba*/lba, + /*block_count*/count, + /*data_ptr*/ __DECONST(void *, + zero_region), + /*dxfer_len*/ softc->params.secsize, + /*sense_len*/SSD_FULL_SIZE, + da_default_timeout * 1000); + start_ccb->ccb_h.ccb_state = DA_CCB_DELETE; + goto out; + } else { + bioq_flush(&softc->delete_queue, NULL, 0); + /* FALLTHROUGH */ + } + } - if ((bp->bio_flags & BIO_ORDERED) != 0 - || (softc->flags & DA_FLAG_NEED_OTAG) != 0) { - softc->flags &= ~DA_FLAG_NEED_OTAG; - softc->ordered_tag_count++; - tag_code = MSG_ORDERED_Q_TAG; - } else { - tag_code = MSG_SIMPLE_Q_TAG; - } - switch (bp->bio_cmd) { - case BIO_READ: - case BIO_WRITE: - scsi_read_write(&start_ccb->csio, - /*retries*/da_retry_count, - /*cbfcnp*/dadone, - /*tag_action*/tag_code, - /*read_op*/bp->bio_cmd - == BIO_READ, - /*byte2*/0, - softc->minimum_cmd_size, - /*lba*/bp->bio_pblkno, - /*block_count*/bp->bio_bcount / - softc->params.secsize, - /*data_ptr*/ bp->bio_data, - /*dxfer_len*/ bp->bio_bcount, - /*sense_len*/SSD_FULL_SIZE, - da_default_timeout * 1000); - break; - case BIO_FLUSH: - /* - * BIO_FLUSH doesn't currently communicate - * range data, so we synchronize the cache - * over the whole disk. We also force - * ordered tag semantics the flush applies - * to all previously queued I/O. - */ - scsi_synchronize_cache(&start_ccb->csio, - /*retries*/1, - /*cbfcnp*/dadone, - MSG_ORDERED_Q_TAG, - /*begin_lba*/0, - /*lb_count*/0, - SSD_FULL_SIZE, - da_default_timeout*1000); - break; - } - start_ccb->ccb_h.ccb_state = DA_CCB_BUFFER_IO; + /* Run regular command. */ + bp = bioq_takefirst(&softc->bio_queue); + if (bp == NULL) { + xpt_release_ccb(start_ccb); + break; + } + + if ((bp->bio_flags & BIO_ORDERED) != 0 || + (softc->flags & DA_FLAG_NEED_OTAG) != 0) { + softc->flags &= ~DA_FLAG_NEED_OTAG; + softc->ordered_tag_count++; + tag_code = MSG_ORDERED_Q_TAG; + } else { + tag_code = MSG_SIMPLE_Q_TAG; + } + switch (bp->bio_cmd) { + case BIO_READ: + case BIO_WRITE: + scsi_read_write(&start_ccb->csio, + /*retries*/da_retry_count, + /*cbfcnp*/dadone, + /*tag_action*/tag_code, + /*read_op*/bp->bio_cmd + == BIO_READ, + /*byte2*/0, + softc->minimum_cmd_size, + /*lba*/bp->bio_pblkno, + /*block_count*/bp->bio_bcount / + softc->params.secsize, + /*data_ptr*/ bp->bio_data, + /*dxfer_len*/ bp->bio_bcount, + /*sense_len*/SSD_FULL_SIZE, + da_default_timeout * 1000); + break; + case BIO_FLUSH: /* - * Block out any asyncronous callbacks - * while we touch the pending ccb list. + * BIO_FLUSH doesn't currently communicate + * range data, so we synchronize the cache + * over the whole disk. We also force + * ordered tag semantics the flush applies + * to all previously queued I/O. */ - LIST_INSERT_HEAD(&softc->pending_ccbs, - &start_ccb->ccb_h, periph_links.le); - softc->outstanding_cmds++; - - /* We expect a unit attention from this device */ - if ((softc->flags & DA_FLAG_RETRY_UA) != 0) { - start_ccb->ccb_h.ccb_state |= DA_CCB_RETRY_UA; - softc->flags &= ~DA_FLAG_RETRY_UA; - } - - start_ccb->ccb_h.ccb_bp = bp; - bp = bioq_first(&softc->bio_queue); - - xpt_action(start_ccb); + scsi_synchronize_cache(&start_ccb->csio, + /*retries*/1, + /*cbfcnp*/dadone, + MSG_ORDERED_Q_TAG, + /*begin_lba*/0, + /*lb_count*/0, + SSD_FULL_SIZE, + da_default_timeout*1000); + break; } - - if (bp != NULL) { - /* Have more work to do, so ensure we stay scheduled */ - xpt_schedule(periph, CAM_PRIORITY_NORMAL); + start_ccb->ccb_h.ccb_state = DA_CCB_BUFFER_IO; + +out: + /* + * Block out any asyncronous callbacks + * while we touch the pending ccb list. + */ + LIST_INSERT_HEAD(&softc->pending_ccbs, + &start_ccb->ccb_h, periph_links.le); + softc->outstanding_cmds++; + + /* We expect a unit attention from this device */ + if ((softc->flags & DA_FLAG_RETRY_UA) != 0) { + start_ccb->ccb_h.ccb_state |= DA_CCB_RETRY_UA; + softc->flags &= ~DA_FLAG_RETRY_UA; } + + start_ccb->ccb_h.ccb_bp = bp; + xpt_action(start_ccb); + + /* May have more work to do, so ensure we stay scheduled */ + daschedule(periph); break; } case DA_STATE_PROBE: @@ -1779,9 +1966,42 @@ cmd6workaround(union ccb *ccb) struct scsi_rw_10 *cmd10; struct da_softc *softc; u_int8_t *cdb; + struct bio *bp; int frozen; cdb = ccb->csio.cdb_io.cdb_bytes; + softc = (struct da_softc *)xpt_path_periph(ccb->ccb_h.path)->softc; + + if (ccb->ccb_h.ccb_state == DA_CCB_DELETE) { + if (softc->delete_method == DA_DELETE_UNMAP) { + xpt_print(ccb->ccb_h.path, "UNMAP is not supported, " + "switching to WRITE SAME(16) with UNMAP.\n"); + softc->delete_method = DA_DELETE_WS16; + } else if (softc->delete_method == DA_DELETE_WS16) { + xpt_print(ccb->ccb_h.path, + "WRITE SAME(16) with UNMAP is not supported, " + "disabling BIO_DELETE.\n"); + softc->delete_method = DA_DELETE_DISABLE; + } else if (softc->delete_method == DA_DELETE_WS10) { + xpt_print(ccb->ccb_h.path, + "WRITE SAME(10) with UNMAP is not supported, " + "disabling BIO_DELETE.\n"); + softc->delete_method = DA_DELETE_DISABLE; + } else if (softc->delete_method == DA_DELETE_ZERO) { + xpt_print(ccb->ccb_h.path, + "WRITE SAME(10) is not supported, " + "disabling BIO_DELETE.\n"); + softc->delete_method = DA_DELETE_DISABLE; + } else + softc->delete_method = DA_DELETE_DISABLE; + while ((bp = bioq_takefirst(&softc->delete_run_queue)) + != NULL) + bioq_disksort(&softc->delete_queue, bp); + bioq_insert_tail(&softc->delete_queue, + (struct bio *)ccb->ccb_h.ccb_bp); + ccb->ccb_h.ccb_bp = NULL; + return (0); + } /* Translation only possible if CDB is an array and cmd is R/W6 */ if ((ccb->ccb_h.flags & CAM_CDB_POINTER) != 0 || @@ -1790,8 +2010,7 @@ cmd6workaround(union ccb *ccb) xpt_print(ccb->ccb_h.path, "READ(6)/WRITE(6) not supported, " "increasing minimum_cmd_size to 10.\n"); - softc = (struct da_softc *)xpt_path_periph(ccb->ccb_h.path)->softc; - softc->minimum_cmd_size = 10; + softc->minimum_cmd_size = 10; bcopy(cdb, &cmd6, sizeof(struct scsi_rw_6)); cmd10 = (struct scsi_rw_10 *)cdb; @@ -1829,8 +2048,9 @@ dadone(struct cam_periph *periph, union csio = &done_ccb->csio; switch (csio->ccb_h.ccb_state & DA_CCB_TYPE_MASK) { case DA_CCB_BUFFER_IO: + case DA_CCB_DELETE: { - struct bio *bp; + struct bio *bp, *bp1; bp = (struct bio *)done_ccb->ccb_h.ccb_bp; if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { @@ -1850,6 +2070,7 @@ dadone(struct cam_periph *periph, union */ return; } + bp = (struct bio *)done_ccb->ccb_h.ccb_bp; if (error != 0) { int queued_error; @@ -1877,10 +2098,12 @@ dadone(struct cam_periph *periph, union } bioq_flush(&softc->bio_queue, NULL, queued_error); - bp->bio_error = error; - bp->bio_resid = bp->bio_bcount; - bp->bio_flags |= BIO_ERROR; - } else { + if (bp != NULL) { + bp->bio_error = error; + bp->bio_resid = bp->bio_bcount; + bp->bio_flags |= BIO_ERROR; + } + } else if (bp != NULL) { bp->bio_resid = csio->resid; bp->bio_error = 0; if (bp->bio_resid != 0) @@ -1892,7 +2115,7 @@ dadone(struct cam_periph *periph, union /*reduction*/0, /*timeout*/0, /*getcount_only*/0); - } else { + } else if (bp != NULL) { if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) panic("REQ_CMP with QFRZN"); bp->bio_resid = csio->resid; @@ -1921,7 +2144,22 @@ dadone(struct cam_periph *periph, union softc->outstanding_cmds); } - biodone(bp); + if ((csio->ccb_h.ccb_state & DA_CCB_TYPE_MASK) == + DA_CCB_DELETE) { + while ((bp1 = bioq_takefirst(&softc->delete_run_queue)) + != NULL) { + bp1->bio_resid = bp->bio_resid; + bp1->bio_error = bp->bio_error; + if (bp->bio_flags & BIO_ERROR) + bp1->bio_flags |= BIO_ERROR; + biodone(bp1); + } + softc->delete_running = 0; + if (bp != NULL) + biodone(bp); + daschedule(periph); + } else if (bp != NULL) + biodone(bp); break; } case DA_CCB_PROBE: @@ -1991,10 +2229,9 @@ dadone(struct cam_periph *periph, union } else { dasetgeom(periph, block_size, maxsector, lbppbe, lalba & SRC16_LALBA); - if (lalba & SRC16_LBPME) - softc->flags |= DA_FLAG_CAN_LBPME; - else - softc->flags &= ~DA_FLAG_CAN_LBPME; + if ((lalba & SRC16_LBPME) && + softc->delete_method == DA_DELETE_NONE) + softc->delete_method = DA_DELETE_UNMAP; dp = &softc->params; snprintf(announce_buf, sizeof(announce_buf), "%juMB (%ju %u byte sectors: %dH %dS/T " @@ -2381,10 +2618,9 @@ done: } else { dasetgeom(periph, block_len, maxsector, lbppbe, lalba & SRC16_LALBA); - if (lalba & SRC16_LBPME) - softc->flags |= DA_FLAG_CAN_LBPME; - else - softc->flags &= ~DA_FLAG_CAN_LBPME; + if ((lalba & SRC16_LBPME) && + softc->delete_method == DA_DELETE_NONE) + softc->delete_method = DA_DELETE_UNMAP; } } From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 10:54:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5E381065676; Fri, 13 Jan 2012 10:54:26 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 754488FC24; Fri, 13 Jan 2012 10:54:26 +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 q0DAsQBh059121; Fri, 13 Jan 2012 10:54:26 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DAsQO1059119; Fri, 13 Jan 2012 10:54:26 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201201131054.q0DAsQO1059119@svn.freebsd.org> From: Jaakko Heinonen Date: Fri, 13 Jan 2012 10:54:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230054 - stable/9/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 10:54:26 -0000 Author: jh Date: Fri Jan 13 10:54:26 2012 New Revision: 230054 URL: http://svn.freebsd.org/changeset/base/230054 Log: MFC r228358: - Fix markup. - Remove trailing whitespace. MFC r228359: sbuf_data() hasn't returned NULL for overflowed buffers since r71721. MFC r228784: Follow style(9) more closely in the example. Modified: stable/9/share/man/man9/sbuf.9 Directory Properties: stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/sbuf.9 ============================================================================== --- stable/9/share/man/man9/sbuf.9 Fri Jan 13 10:21:17 2012 (r230053) +++ stable/9/share/man/man9/sbuf.9 Fri Jan 13 10:54:26 2012 (r230054) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 25, 2011 +.Dd December 21, 2011 .Dt SBUF 9 .Os .Sh NAME @@ -117,7 +117,7 @@ defined in .Pp Any errors encountered during the allocation or composition of the string will be latched in the data structure, -making a single error test at the end of the composition +making a single error test at the end of the composition sufficient to determine success or failure of the entire process. .Pp The @@ -391,7 +391,8 @@ function returns the actual string; only works on a finished .Fa sbuf . The -.Fn sbuf_len function returns the length of the string. +.Fn sbuf_len +function returns the length of the string. For an .Fa sbuf with an attached drain, @@ -462,12 +463,8 @@ function returns a non-zero value if the drain error, and zero otherwise. .Pp The -.Fn sbuf_data -and .Fn sbuf_len -functions return -.Dv NULL -and \-1, respectively, if the buffer overflowed. +function returns \-1 if the buffer overflowed. .Pp The .Fn sbuf_copyin @@ -482,7 +479,7 @@ being finished, or returns the error code from the drain if one is attached. .Pp The -.Fn sbuf_finish 3 +.Fn sbuf_finish 3 function (the userland version) will return zero for success and \-1 and set errno on error. .Sh EXAMPLES @@ -498,8 +495,8 @@ TAILQ_FOREACH(foo, &foolist, list) { sbuf_printf(sb, " Address: %s\en", foo->address); sbuf_printf(sb, " Zip: %s\en", foo->zipcode); } -if (sbuf_finish(sb)) /* Check for any and all errors */ - err(1,"Could not generate message"); +if (sbuf_finish(sb) != 0) /* Check for any and all errors */ + err(1, "Could not generate message"); transmit_msg(sbuf_data(sb), sbuf_len(sb)); sbuf_delete(sb); .Ed From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 11:01:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48F68106567F; Fri, 13 Jan 2012 11:01:24 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3409A8FC18; Fri, 13 Jan 2012 11:01: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 q0DB1O1p059378; Fri, 13 Jan 2012 11:01:24 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DB1OqS059376; Fri, 13 Jan 2012 11:01:24 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201201131101.q0DB1OqS059376@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 13 Jan 2012 11:01: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: r230055 - head/sys/dev/netmap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 11:01:24 -0000 Author: luigi Date: Fri Jan 13 11:01:23 2012 New Revision: 230055 URL: http://svn.freebsd.org/changeset/base/230055 Log: fix indentation Modified: head/sys/dev/netmap/if_re_netmap.h Modified: head/sys/dev/netmap/if_re_netmap.h ============================================================================== --- head/sys/dev/netmap/if_re_netmap.h Fri Jan 13 10:54:26 2012 (r230054) +++ head/sys/dev/netmap/if_re_netmap.h Fri Jan 13 11:01:23 2012 (r230055) @@ -25,7 +25,7 @@ /* * $FreeBSD$ - * $Id: if_re_netmap.h 9802 2011-12-02 18:42:37Z luigi $ + * $Id: if_re_netmap.h 10075 2011-12-25 22:55:48Z luigi $ * * netmap support for if_re */ @@ -409,7 +409,7 @@ re_netmap_rx_init(struct rl_softc *sc) addr = PNMB(slot + l, &paddr); netmap_reload_map(sc->rl_ldata.rl_rx_mtag, - sc->rl_ldata.rl_rx_desc[i].rx_dmamap, addr); + sc->rl_ldata.rl_rx_desc[i].rx_dmamap, addr); bus_dmamap_sync(sc->rl_ldata.rl_rx_mtag, sc->rl_ldata.rl_rx_desc[i].rx_dmamap, BUS_DMASYNC_PREREAD); desc[i].rl_bufaddr_lo = htole32(RL_ADDR_LO(paddr)); From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 11:06:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4285A106564A; Fri, 13 Jan 2012 11:06:32 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1D07C8FC08; Fri, 13 Jan 2012 11:06: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 q0DB6Vf3059847; Fri, 13 Jan 2012 11:06:31 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DB6Vx8059845; Fri, 13 Jan 2012 11:06:31 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201201131106.q0DB6Vx8059845@svn.freebsd.org> From: Jaakko Heinonen Date: Fri, 13 Jan 2012 11:06:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230056 - stable/8/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 11:06:32 -0000 Author: jh Date: Fri Jan 13 11:06:31 2012 New Revision: 230056 URL: http://svn.freebsd.org/changeset/base/230056 Log: Partially MFC r228358: Fix markup. Modified: stable/8/share/man/man9/sbuf.9 Directory Properties: stable/8/share/man/man9/ (props changed) Modified: stable/8/share/man/man9/sbuf.9 ============================================================================== --- stable/8/share/man/man9/sbuf.9 Fri Jan 13 11:01:23 2012 (r230055) +++ stable/8/share/man/man9/sbuf.9 Fri Jan 13 11:06:31 2012 (r230056) @@ -380,7 +380,8 @@ function returns the actual string; only works on a finished .Fa sbuf . The -.Fn sbuf_len function returns the length of the string. +.Fn sbuf_len +function returns the length of the string. For an .Fa sbuf with an attached drain, From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 11:10:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B0D6106564A; Fri, 13 Jan 2012 11:10:18 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E836A8FC17; Fri, 13 Jan 2012 11:10: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 q0DBAHNX060010; Fri, 13 Jan 2012 11:10:17 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DBAH4i060008; Fri, 13 Jan 2012 11:10:17 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201201131110.q0DBAH4i060008@svn.freebsd.org> From: Jaakko Heinonen Date: Fri, 13 Jan 2012 11:10:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230057 - stable/8/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 11:10:18 -0000 Author: jh Date: Fri Jan 13 11:10:17 2012 New Revision: 230057 URL: http://svn.freebsd.org/changeset/base/230057 Log: MFC r228359: sbuf_data() hasn't returned NULL for overflowed buffers since r71721. Modified: stable/8/share/man/man9/sbuf.9 Directory Properties: stable/8/share/man/man9/ (props changed) Modified: stable/8/share/man/man9/sbuf.9 ============================================================================== --- stable/8/share/man/man9/sbuf.9 Fri Jan 13 11:06:31 2012 (r230056) +++ stable/8/share/man/man9/sbuf.9 Fri Jan 13 11:10:17 2012 (r230057) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 25, 2011 +.Dd December 9, 2011 .Dt SBUF 9 .Os .Sh NAME @@ -456,12 +456,8 @@ function returns a non-zero value if the buffer overflowed, and zero otherwise. .Pp The -.Fn sbuf_data -and .Fn sbuf_len -functions return -.Dv NULL -and \-1, respectively, if the buffer overflowed. +function returns \-1 if the buffer overflowed. .Pp The .Fn sbuf_copyin From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 11:58:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71EB7106567A; Fri, 13 Jan 2012 11:58:07 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 51A738FC16; Fri, 13 Jan 2012 11:58: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 q0DBw7pi061747; Fri, 13 Jan 2012 11:58:07 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DBw7pn061744; Fri, 13 Jan 2012 11:58:07 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201201131158.q0DBw7pn061744@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 13 Jan 2012 11:58: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: r230058 - head/sys/dev/netmap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 11:58:07 -0000 Author: luigi Date: Fri Jan 13 11:58:06 2012 New Revision: 230058 URL: http://svn.freebsd.org/changeset/base/230058 Log: indentation and whitespace fixes Modified: head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_kern.h Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Fri Jan 13 11:10:17 2012 (r230057) +++ head/sys/dev/netmap/netmap.c Fri Jan 13 11:58:06 2012 (r230058) @@ -1056,6 +1056,7 @@ netmap_poll(__unused struct cdev *dev, i struct netmap_kring *kring; u_int core_lock, i, check_all, want_tx, want_rx, revents = 0; void *adapter; + enum {NO_CL, NEED_CL, LOCKED_CL }; /* see below */ if (devfs_get_cdevpriv((void **)&priv) != 0 || priv == NULL) return POLLERR; @@ -1130,8 +1131,7 @@ netmap_poll(__unused struct cdev *dev, i * to remember to release the lock once done. * LOCKED_CL core lock is set, so we need to release it. */ - enum {NO_CL, NEED_CL, LOCKED_CL }; - core_lock = (check_all || !na->separate_locks) ? NEED_CL:NO_CL; + core_lock = (check_all || !na->separate_locks) ? NEED_CL : NO_CL; /* * We start with a lock free round which is good if we have * data available. If this fails, then lock and call the sync Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Fri Jan 13 11:10:17 2012 (r230057) +++ head/sys/dev/netmap/netmap_kern.h Fri Jan 13 11:58:06 2012 (r230058) @@ -39,13 +39,13 @@ MALLOC_DECLARE(M_NETMAP); #endif #define ND(format, ...) -#define D(format, ...) \ - do { \ - struct timeval __xxts; \ +#define D(format, ...) \ + do { \ + struct timeval __xxts; \ microtime(&__xxts); \ - printf("%03d.%06d %s [%d] " format "\n",\ - (int)__xxts.tv_sec % 1000, (int)__xxts.tv_usec, \ - __FUNCTION__, __LINE__, ##__VA_ARGS__); \ + printf("%03d.%06d %s [%d] " format "\n", \ + (int)__xxts.tv_sec % 1000, (int)__xxts.tv_usec, \ + __FUNCTION__, __LINE__, ##__VA_ARGS__); \ } while (0) struct netmap_adapter; @@ -197,7 +197,7 @@ enum { /* Callback invoked by the dma machinery after a successfull dmamap_load */ static void netmap_dmamap_cb(__unused void *arg, - __unused bus_dma_segment_t * segs, __unused int nseg, __unused int error) + __unused bus_dma_segment_t * segs, __unused int nseg, __unused int error) { } @@ -209,7 +209,7 @@ netmap_load_map(bus_dma_tag_t tag, bus_d { if (map) bus_dmamap_load(tag, map, buf, NETMAP_BUF_SIZE, - netmap_dmamap_cb, NULL, BUS_DMA_NOWAIT); + netmap_dmamap_cb, NULL, BUS_DMA_NOWAIT); } /* update the map when a buffer changes. */ @@ -219,7 +219,7 @@ netmap_reload_map(bus_dma_tag_t tag, bus if (map) { bus_dmamap_unload(tag, map); bus_dmamap_load(tag, map, buf, NETMAP_BUF_SIZE, - netmap_dmamap_cb, NULL, BUS_DMA_NOWAIT); + netmap_dmamap_cb, NULL, BUS_DMA_NOWAIT); } } @@ -227,7 +227,6 @@ netmap_reload_map(bus_dma_tag_t tag, bus /* * NMB return the virtual address of a buffer (buffer 0 on bad index) * PNMB also fills the physical address - * XXX this is a special version with hardwired 2k bufs */ static inline void * NMB(struct netmap_slot *slot) From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 12:40:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F1EE1065676; Fri, 13 Jan 2012 12:40:34 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2FFF88FC0A; Fri, 13 Jan 2012 12:40: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 q0DCeYFo063075; Fri, 13 Jan 2012 12:40:34 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DCeXhu063073; Fri, 13 Jan 2012 12:40:33 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201201131240.q0DCeXhu063073@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Fri, 13 Jan 2012 12:40: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: r230059 - head/sbin/geom/class/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 12:40:34 -0000 Author: des Date: Fri Jan 13 12:40:33 2012 New Revision: 230059 URL: http://svn.freebsd.org/changeset/base/230059 Log: Provide a better explanation for the sizing of the boot partition, and reduce the size of the partition in the example from 128 blocks to 94 blocks so it will end on a 128-block boundary. Also remove the -b option from the next example. MFC after: 3 weeks Modified: head/sbin/geom/class/part/gpart.8 Modified: head/sbin/geom/class/part/gpart.8 ============================================================================== --- head/sbin/geom/class/part/gpart.8 Fri Jan 13 11:58:06 2012 (r230058) +++ head/sbin/geom/class/part/gpart.8 Fri Jan 13 12:40:33 2012 (r230059) @@ -960,17 +960,21 @@ partition that can boot from a .Cm freebsd-ufs partition, and install bootstrap code into it. -This partition must be larger than -.Pa /boot/gptboot , -or the GPT boot you are planning to write, but smaller than 545 KB. -A size of 15 blocks (7680 bytes) would be sufficient for -booting from UFS but 128 blocks (64 KB) is used in -this example to reserve some space for potential -future need (e.g.\& a larger +This partition must be larger than the bootstrap code +.Po +usually either +.Pa /boot/gptboot +or .Pa /boot/gptzfsboot -for booting from a ZFS partition). +.Pc , +but smaller than 545 kB since the first-stage loader will load the +entire partition into memory during boot, regardless of how much data +it actually contains. +This example uses 94 blocks (47 kB) so the next partition will be +aligned on a 64 kB boundary without the need to specify an explicit +offset or alignment. .Bd -literal -offset indent -/sbin/gpart add -b 34 -s 128 -t freebsd-boot ad0 +/sbin/gpart add -b 34 -s 94 -t freebsd-boot ad0 /sbin/gpart bootcode -p /boot/gptboot -i 1 ad0 .Ed .Pp @@ -978,7 +982,7 @@ Create a 512MB-sized .Cm freebsd-ufs partition to contain a UFS filesystem from which the system can boot. .Bd -literal -offset indent -/sbin/gpart add -b 162 -s 1048576 -t freebsd-ufs ad0 +/sbin/gpart add -s 512M -t freebsd-ufs ad0 .Ed .Pp Create an MBR scheme on From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 15:40:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EF7B106566C; Fri, 13 Jan 2012 15:40:50 +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 6E9E68FC14; Fri, 13 Jan 2012 15:40: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 q0DFeoYv068551; Fri, 13 Jan 2012 15:40:50 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DFeoe8068546; Fri, 13 Jan 2012 15:40:50 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201131540.q0DFeoe8068546@svn.freebsd.org> From: Ed Schouten Date: Fri, 13 Jan 2012 15:40: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: r230060 - in head: . lib/libc/gen tools/build/options usr.bin usr.bin/wtmpcvt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 15:40:50 -0000 Author: ed Date: Fri Jan 13 15:40:49 2012 New Revision: 230060 URL: http://svn.freebsd.org/changeset/base/230060 Log: Remove wtmpcvt(1). The wtmpcvt(1) utility converts wtmp files to the new format used by utmpx(3). Now that HEAD has been branched to stable/9 and 9.0 is released, there is no need for it in HEAD. MFC after: never Deleted: head/usr.bin/wtmpcvt/ Modified: head/ObsoleteFiles.inc head/lib/libc/gen/getutxent.3 head/tools/build/options/WITHOUT_UTMPX head/usr.bin/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Jan 13 12:40:33 2012 (r230059) +++ head/ObsoleteFiles.inc Fri Jan 13 15:40:49 2012 (r230060) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20120113: removal of wtmpcvt(1) +OLD_FILES+=usr/bin/wtmpcvt +OLD_FILES+=usr/share/man/man1/wtmpcvt.1.gz # 20111214: eventtimers(7) moved to eventtimers(4) OLD_FILES+=usr/share/man/man7/eventtimers.7.gz # 20111125: amd(4) removed Modified: head/lib/libc/gen/getutxent.3 ============================================================================== --- head/lib/libc/gen/getutxent.3 Fri Jan 13 12:40:33 2012 (r230059) +++ head/lib/libc/gen/getutxent.3 Fri Jan 13 15:40:49 2012 (r230060) @@ -418,7 +418,6 @@ The file format is invalid. .Sh SEE ALSO .Xr last 1 , .Xr write 1 , -.Xr wtmpcvt 1 , .Xr getpid 2 , .Xr gettimeofday 2 , .Xr tty 4 , Modified: head/tools/build/options/WITHOUT_UTMPX ============================================================================== --- head/tools/build/options/WITHOUT_UTMPX Fri Jan 13 12:40:33 2012 (r230059) +++ head/tools/build/options/WITHOUT_UTMPX Fri Jan 13 15:40:49 2012 (r230060) @@ -3,7 +3,6 @@ Set to not build user accounting tools s .Xr last 1 , .Xr users 1 , .Xr who 1 , -.Xr wtmpcvt 1 , .Xr ac 8 , .Xr lastlogin 8 and Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Fri Jan 13 12:40:33 2012 (r230059) +++ head/usr.bin/Makefile Fri Jan 13 15:40:49 2012 (r230060) @@ -340,7 +340,6 @@ SUBDIR+= usbhidctl SUBDIR+= last SUBDIR+= users SUBDIR+= who -SUBDIR+= wtmpcvt .endif .include From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 15:43:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9864F1065673; Fri, 13 Jan 2012 15:43:02 +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 6C8568FC15; Fri, 13 Jan 2012 15:43:02 +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 q0DFh277068653; Fri, 13 Jan 2012 15:43:02 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DFh2qn068651; Fri, 13 Jan 2012 15:43:02 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201131543.q0DFh2qn068651@svn.freebsd.org> From: Ed Schouten Date: Fri, 13 Jan 2012 15:43:02 +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: r230061 - head/share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 15:43:02 -0000 Author: ed Date: Fri Jan 13 15:43:01 2012 New Revision: 230061 URL: http://svn.freebsd.org/changeset/base/230061 Log: Regenerate src.conf(5). Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Fri Jan 13 15:40:49 2012 (r230060) +++ head/share/man/man5/src.conf.5 Fri Jan 13 15:43:01 2012 (r230061) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 221733 2011-05-10 13:01:11Z ru .\" $FreeBSD$ -.Dd December 30, 2011 +.Dd January 13, 2012 .Dt SRC.CONF 5 .Os .Sh NAME @@ -252,7 +252,7 @@ Set to build some programs without optio Set to not build .Xr calendar 1 . .It Va WITHOUT_CAPSICUM -.\" $FreeBSD$ +.\" from FreeBSD: head/tools/build/options/WITHOUT_CAPSICUM 229319 2012-01-02 21:57:58Z rwatson Set to not build Capsicum support into system programs. .It Va WITHOUT_CDDL .\" from FreeBSD: head/tools/build/options/WITHOUT_CDDL 163861 2006-11-01 09:02:11Z jb @@ -930,12 +930,11 @@ When set, it also enforces the following .\" from FreeBSD: head/tools/build/options/WITHOUT_USB 156932 2006-03-21 07:50:50Z ru Set to not build USB-related programs and libraries. .It Va WITHOUT_UTMPX -.\" from FreeBSD: head/tools/build/options/WITHOUT_UTMPX 223209 2011-06-17 21:30:21Z ed +.\" from FreeBSD: head/tools/build/options/WITHOUT_UTMPX 230060 2012-01-13 15:40:49Z ed Set to not build user accounting tools such as .Xr last 1 , .Xr users 1 , .Xr who 1 , -.Xr wtmpcvt 1 , .Xr ac 8 , .Xr lastlogin 8 and From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 16:01:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16FBA106566B; Fri, 13 Jan 2012 16:01:35 +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 0292C8FC1A; Fri, 13 Jan 2012 16:01: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 q0DG1Y7N069297; Fri, 13 Jan 2012 16:01:34 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DG1YdV069295; Fri, 13 Jan 2012 16:01:34 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201131601.q0DG1YdV069295@svn.freebsd.org> From: Ed Schouten Date: Fri, 13 Jan 2012 16:01:34 +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: r230062 - head/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 16:01:36 -0000 Author: ed Date: Fri Jan 13 16:01:34 2012 New Revision: 230062 URL: http://svn.freebsd.org/changeset/base/230062 Log: Correct mistake in atomic_flag macros. The _explicit versions only have two parameters, namely the object and the order. There is no need to pass the values of the atomic variable. Modified: head/include/stdatomic.h Modified: head/include/stdatomic.h ============================================================================== --- head/include/stdatomic.h Fri Jan 13 15:43:01 2012 (r230061) +++ head/include/stdatomic.h Fri Jan 13 16:01:34 2012 (r230062) @@ -325,9 +325,8 @@ typedef atomic_bool atomic_flag; atomic_compare_exchange_strong_explicit(object, 0, 1, order, order) #define atomic_flag_clear(object) \ - atomic_flag_clear_explicit(object, 0, memory_order_seq_cst) + atomic_flag_clear_explicit(object, memory_order_seq_cst) #define atomic_flag_test_and_set(object) \ - atomic_flag_test_and_set_explicit(object, 0, 1, \ - memory_order_seq_cst, memory_order_seq_cst) + atomic_flag_test_and_set_explicit(object, memory_order_seq_cst) #endif /* !_STDATOMIC_H_ */ From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 17:13:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57ACE1065675; Fri, 13 Jan 2012 17:13:47 +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 41D318FC13; Fri, 13 Jan 2012 17:13: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 q0DHDlig071606; Fri, 13 Jan 2012 17:13:47 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DHDlBf071603; Fri, 13 Jan 2012 17:13:47 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201201131713.q0DHDlBf071603@svn.freebsd.org> From: "George V. Neville-Neil" Date: Fri, 13 Jan 2012 17:13: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: r230063 - head/sys/dev/hwpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 17:13:47 -0000 Author: gnn Date: Fri Jan 13 17:13:46 2012 New Revision: 230063 URL: http://svn.freebsd.org/changeset/base/230063 Log: Clean up a switch statement for uncore events on Westmere processors. Submitted by: Davide Italiano Reviewed by: gnn MFC after: 1 week Modified: head/sys/dev/hwpmc/hwpmc_uncore.c head/sys/dev/hwpmc/hwpmc_uncore.h Modified: head/sys/dev/hwpmc/hwpmc_uncore.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_uncore.c Fri Jan 13 16:01:34 2012 (r230062) +++ head/sys/dev/hwpmc/hwpmc_uncore.c Fri Jan 13 17:13:46 2012 (r230063) @@ -974,26 +974,18 @@ ucp_start_pmc(int cpu, int ri) /* Event specific configuration. */ switch (pm->pm_event) { case PMC_EV_UCP_EVENT_0CH_04H_E: + case PMC_EV_UCP_EVENT_0CH_08H_E: wrmsr(MSR_GQ_SNOOP_MESF,0x2); break; case PMC_EV_UCP_EVENT_0CH_04H_F: + case PMC_EV_UCP_EVENT_0CH_08H_F: wrmsr(MSR_GQ_SNOOP_MESF,0x8); break; case PMC_EV_UCP_EVENT_0CH_04H_M: - wrmsr(MSR_GQ_SNOOP_MESF,0x1); - break; - case PMC_EV_UCP_EVENT_0CH_04H_S: - wrmsr(MSR_GQ_SNOOP_MESF,0x4); - break; - case PMC_EV_UCP_EVENT_0CH_08H_E: - wrmsr(MSR_GQ_SNOOP_MESF,0x2); - break; - case PMC_EV_UCP_EVENT_0CH_08H_F: - wrmsr(MSR_GQ_SNOOP_MESF,0x8); - break; case PMC_EV_UCP_EVENT_0CH_08H_M: wrmsr(MSR_GQ_SNOOP_MESF,0x1); break; + case PMC_EV_UCP_EVENT_0CH_04H_S: case PMC_EV_UCP_EVENT_0CH_08H_S: wrmsr(MSR_GQ_SNOOP_MESF,0x4); break; Modified: head/sys/dev/hwpmc/hwpmc_uncore.h ============================================================================== --- head/sys/dev/hwpmc/hwpmc_uncore.h Fri Jan 13 16:01:34 2012 (r230062) +++ head/sys/dev/hwpmc/hwpmc_uncore.h Fri Jan 13 17:13:46 2012 (r230063) @@ -87,7 +87,6 @@ struct pmc_md_ucp_op_pmcallocate { #define UC_GLOBAL_CTRL 0x391 #define UC_GLOBAL_OVF_CTRL 0x393 - #define UC_GLOBAL_STATUS_FLAG_CLRCHG (1ULL << 63) #define UC_GLOBAL_STATUS_FLAG_OVFPMI (1ULL << 61) #define UC_GLOBAL_CTRL_FLAG_FRZ (1ULL << 63) From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 18:32:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6901F106564A; Fri, 13 Jan 2012 18:32:56 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 532678FC15; Fri, 13 Jan 2012 18:32: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 q0DIWuRM074059; Fri, 13 Jan 2012 18:32:56 GMT (envelope-from truckman@svn.freebsd.org) Received: (from truckman@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DIWuK0074056; Fri, 13 Jan 2012 18:32:56 GMT (envelope-from truckman@svn.freebsd.org) Message-Id: <201201131832.q0DIWuK0074056@svn.freebsd.org> From: Don Lewis Date: Fri, 13 Jan 2012 18:32: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: r230064 - head/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 18:32:56 -0000 Author: truckman Date: Fri Jan 13 18:32:56 2012 New Revision: 230064 URL: http://svn.freebsd.org/changeset/base/230064 Log: Allow an MBR primary or extended Linux swap partition to be specified as the system dump device. This was already allowed for GPT. The Linux swap metadata at the beginning of the partition should not be disturbed because the crash dump is written at the end. Reviewed by: alfred, pjd, marcel MFC after: 2 weeks Modified: head/sys/geom/part/g_part_ebr.c head/sys/geom/part/g_part_mbr.c Modified: head/sys/geom/part/g_part_ebr.c ============================================================================== --- head/sys/geom/part/g_part_ebr.c Fri Jan 13 17:13:46 2012 (r230063) +++ head/sys/geom/part/g_part_ebr.c Fri Jan 13 18:32:56 2012 (r230064) @@ -333,9 +333,10 @@ g_part_ebr_dumpto(struct g_part_table *t { struct g_part_ebr_entry *entry; - /* Allow dumping to a FreeBSD partition only. */ + /* Allow dumping to a FreeBSD partition or Linux swap partition only. */ entry = (struct g_part_ebr_entry *)baseentry; - return ((entry->ent.dp_typ == DOSPTYP_386BSD) ? 1 : 0); + return ((entry->ent.dp_typ == DOSPTYP_386BSD || + entry->ent.dp_typ == DOSPTYP_LINSWP) ? 1 : 0); } #if defined(GEOM_PART_EBR_COMPAT) Modified: head/sys/geom/part/g_part_mbr.c ============================================================================== --- head/sys/geom/part/g_part_mbr.c Fri Jan 13 17:13:46 2012 (r230063) +++ head/sys/geom/part/g_part_mbr.c Fri Jan 13 18:32:56 2012 (r230064) @@ -304,9 +304,10 @@ g_part_mbr_dumpto(struct g_part_table *t { struct g_part_mbr_entry *entry; - /* Allow dumping to a FreeBSD partition only. */ + /* Allow dumping to a FreeBSD partition or Linux swap partition only. */ entry = (struct g_part_mbr_entry *)baseentry; - return ((entry->ent.dp_typ == DOSPTYP_386BSD) ? 1 : 0); + return ((entry->ent.dp_typ == DOSPTYP_386BSD || + entry->ent.dp_typ == DOSPTYP_LINSWP) ? 1 : 0); } static int From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 18:49:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E56ED106564A; Fri, 13 Jan 2012 18:49:04 +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 CB18B8FC1B; Fri, 13 Jan 2012 18:49: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 q0DIn4wA074578; Fri, 13 Jan 2012 18:49:04 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DIn4aT074574; Fri, 13 Jan 2012 18:49:04 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201131849.q0DIn4aT074574@svn.freebsd.org> From: John Baldwin Date: Fri, 13 Jan 2012 18:49:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230065 - in stable/9: sys/boot/i386/boot0 usr.sbin/boot0cfg X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 18:49:05 -0000 Author: jhb Date: Fri Jan 13 18:49:04 2012 New Revision: 230065 URL: http://svn.freebsd.org/changeset/base/230065 Log: MFC 228738: Allow boot0cfg to force a PXE boot via boot0 on the next boot. - Fix boot0 to check for PXE when using the pre-set setting for the preferred slice. - Update boot0cfg to use slice 6 to select PXE. Accept a 'pxe' argument instead of a number for the 's' option as a way to select PXE as well. Modified: stable/9/sys/boot/i386/boot0/boot0.S stable/9/usr.sbin/boot0cfg/boot0cfg.8 stable/9/usr.sbin/boot0cfg/boot0cfg.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/usr.sbin/boot0cfg/ (props changed) Modified: stable/9/sys/boot/i386/boot0/boot0.S ============================================================================== --- stable/9/sys/boot/i386/boot0/boot0.S Fri Jan 13 18:32:56 2012 (r230064) +++ stable/9/sys/boot/i386/boot0/boot0.S Fri Jan 13 18:49:04 2012 (r230065) @@ -413,6 +413,7 @@ got_key: 3: #endif /* ONLY_F_KEYS */ #endif /* SIO */ +check_selection: cmpb $0x5,%al # F1..F6 or 1..6 ? #ifdef PXE /* enable PXE/INT18 using F6 */ jne 1f; @@ -421,7 +422,6 @@ got_key: #endif /* PXE */ jae beep # Not in F1..F5, beep -check_selection: /* * We have a selection. If it's a bad selection go back to complain. * The bits in MNUOPT were set when the options were printed. Modified: stable/9/usr.sbin/boot0cfg/boot0cfg.8 ============================================================================== --- stable/9/usr.sbin/boot0cfg/boot0cfg.8 Fri Jan 13 18:32:56 2012 (r230064) +++ stable/9/usr.sbin/boot0cfg/boot0cfg.8 Fri Jan 13 18:49:04 2012 (r230065) @@ -146,6 +146,9 @@ Set the default boot selection to .Ar slice . Values between 1 and 4 refer to slices; a value of 5 refers to the option of booting from a second disk. +The special string +.Dq PXE +or a value of 6 can be used to boot via PXE. .It Fl t Ar ticks Set the timeout value to .Ar ticks . Modified: stable/9/usr.sbin/boot0cfg/boot0cfg.c ============================================================================== --- stable/9/usr.sbin/boot0cfg/boot0cfg.c Fri Jan 13 18:32:56 2012 (r230064) +++ stable/9/usr.sbin/boot0cfg/boot0cfg.c Fri Jan 13 18:49:04 2012 (r230065) @@ -168,7 +168,10 @@ main(int argc, char *argv[]) o_flag = 1; break; case 's': - s_arg = argtoi(optarg, 1, 5, 's'); + if (strcasecmp(optarg, "pxe") == 0) + s_arg = 6; + else + s_arg = argtoi(optarg, 1, 6, 's'); break; case 't': t_arg = argtoi(optarg, 1, 0xffff, 't'); @@ -441,8 +444,10 @@ display_mbr(u_int8_t *mbr) printf("default_selection=F%d (", mbr[OFF_OPT] + 1); if (mbr[OFF_OPT] < 4) printf("Slice %d", mbr[OFF_OPT] + 1); - else + else if (mbr[OFF_OPT] == 4) printf("Drive 1"); + else + printf("PXE"); printf(")\n"); } From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 18:49:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A516210657C5; Fri, 13 Jan 2012 18:49:28 +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 846418FC15; Fri, 13 Jan 2012 18:49: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 q0DInS1I074627; Fri, 13 Jan 2012 18:49:28 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DInSic074623; Fri, 13 Jan 2012 18:49:28 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201131849.q0DInSic074623@svn.freebsd.org> From: John Baldwin Date: Fri, 13 Jan 2012 18:49:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230066 - in stable/8: sys/boot/i386/boot0 usr.sbin/boot0cfg X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 18:49:28 -0000 Author: jhb Date: Fri Jan 13 18:49:28 2012 New Revision: 230066 URL: http://svn.freebsd.org/changeset/base/230066 Log: MFC 228738: Allow boot0cfg to force a PXE boot via boot0 on the next boot. - Fix boot0 to check for PXE when using the pre-set setting for the preferred slice. - Update boot0cfg to use slice 6 to select PXE. Accept a 'pxe' argument instead of a number for the 's' option as a way to select PXE as well. Modified: stable/8/sys/boot/i386/boot0/boot0.S stable/8/usr.sbin/boot0cfg/boot0cfg.8 stable/8/usr.sbin/boot0cfg/boot0cfg.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/usr.sbin/boot0cfg/ (props changed) Modified: stable/8/sys/boot/i386/boot0/boot0.S ============================================================================== --- stable/8/sys/boot/i386/boot0/boot0.S Fri Jan 13 18:49:04 2012 (r230065) +++ stable/8/sys/boot/i386/boot0/boot0.S Fri Jan 13 18:49:28 2012 (r230066) @@ -413,6 +413,7 @@ got_key: 3: #endif /* ONLY_F_KEYS */ #endif /* SIO */ +check_selection: cmpb $0x5,%al # F1..F6 or 1..6 ? #ifdef PXE /* enable PXE/INT18 using F6 */ jne 1f; @@ -421,7 +422,6 @@ got_key: #endif /* PXE */ jae beep # Not in F1..F5, beep -check_selection: /* * We have a selection. If it's a bad selection go back to complain. * The bits in MNUOPT were set when the options were printed. Modified: stable/8/usr.sbin/boot0cfg/boot0cfg.8 ============================================================================== --- stable/8/usr.sbin/boot0cfg/boot0cfg.8 Fri Jan 13 18:49:04 2012 (r230065) +++ stable/8/usr.sbin/boot0cfg/boot0cfg.8 Fri Jan 13 18:49:28 2012 (r230066) @@ -146,6 +146,9 @@ Set the default boot selection to .Ar slice . Values between 1 and 4 refer to slices; a value of 5 refers to the option of booting from a second disk. +The special string +.Dq PXE +or a value of 6 can be used to boot via PXE. .It Fl t Ar ticks Set the timeout value to .Ar ticks . Modified: stable/8/usr.sbin/boot0cfg/boot0cfg.c ============================================================================== --- stable/8/usr.sbin/boot0cfg/boot0cfg.c Fri Jan 13 18:49:04 2012 (r230065) +++ stable/8/usr.sbin/boot0cfg/boot0cfg.c Fri Jan 13 18:49:28 2012 (r230066) @@ -168,7 +168,10 @@ main(int argc, char *argv[]) o_flag = 1; break; case 's': - s_arg = argtoi(optarg, 1, 5, 's'); + if (strcasecmp(optarg, "pxe") == 0) + s_arg = 6; + else + s_arg = argtoi(optarg, 1, 6, 's'); break; case 't': t_arg = argtoi(optarg, 1, 0xffff, 't'); @@ -441,8 +444,10 @@ display_mbr(u_int8_t *mbr) printf("default_selection=F%d (", mbr[OFF_OPT] + 1); if (mbr[OFF_OPT] < 4) printf("Slice %d", mbr[OFF_OPT] + 1); - else + else if (mbr[OFF_OPT] == 4) printf("Drive 1"); + else + printf("PXE"); printf(")\n"); } From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 18:53:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37CA9106566C; Fri, 13 Jan 2012 18:53:49 +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 21BA28FC13; Fri, 13 Jan 2012 18:53: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 q0DIrnEd074817; Fri, 13 Jan 2012 18:53:49 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DIrmII074813; Fri, 13 Jan 2012 18:53:48 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201131853.q0DIrmII074813@svn.freebsd.org> From: John Baldwin Date: Fri, 13 Jan 2012 18:53:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230067 - in stable/9/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 18:53:49 -0000 Author: jhb Date: Fri Jan 13 18:53:48 2012 New Revision: 230067 URL: http://svn.freebsd.org/changeset/base/230067 Log: MFC 228849, 229727: Add post-VOP hooks for VOP_DELETEEXTATTR() and VOP_SETEXTATTR() and use these to trigger a NOTE_ATTRIB EVFILT_VNODE kevent when the extended attributes of a vnode are changed. Modified: stable/9/sys/kern/vfs_subr.c stable/9/sys/kern/vnode_if.src stable/9/sys/sys/vnode.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/kern/vfs_subr.c ============================================================================== --- stable/9/sys/kern/vfs_subr.c Fri Jan 13 18:49:28 2012 (r230066) +++ stable/9/sys/kern/vfs_subr.c Fri Jan 13 18:53:48 2012 (r230067) @@ -4033,6 +4033,15 @@ vop_create_post(void *ap, int rc) } void +vop_deleteextattr_post(void *ap, int rc) +{ + struct vop_deleteextattr_args *a = ap; + + if (!rc) + VFS_KNOTE_LOCKED(a->a_vp, NOTE_ATTRIB); +} + +void vop_link_post(void *ap, int rc) { struct vop_link_args *a = ap; @@ -4114,6 +4123,15 @@ vop_setattr_post(void *ap, int rc) } void +vop_setextattr_post(void *ap, int rc) +{ + struct vop_setextattr_args *a = ap; + + if (!rc) + VFS_KNOTE_LOCKED(a->a_vp, NOTE_ATTRIB); +} + +void vop_symlink_post(void *ap, int rc) { struct vop_symlink_args *a = ap; Modified: stable/9/sys/kern/vnode_if.src ============================================================================== --- stable/9/sys/kern/vnode_if.src Fri Jan 13 18:49:28 2012 (r230066) +++ stable/9/sys/kern/vnode_if.src Fri Jan 13 18:53:48 2012 (r230067) @@ -569,6 +569,7 @@ vop_openextattr { %% deleteextattr vp E E E +%! deleteextattr post vop_deleteextattr_post vop_deleteextattr { IN struct vnode *vp; @@ -580,6 +581,7 @@ vop_deleteextattr { %% setextattr vp E E E +%! setextattr post vop_setextattr_post vop_setextattr { IN struct vnode *vp; Modified: stable/9/sys/sys/vnode.h ============================================================================== --- stable/9/sys/sys/vnode.h Fri Jan 13 18:49:28 2012 (r230066) +++ stable/9/sys/sys/vnode.h Fri Jan 13 18:53:48 2012 (r230067) @@ -705,6 +705,7 @@ int vop_panic(struct vop_generic_args *a /* These are called from within the actual VOPS. */ void vop_create_post(void *a, int rc); +void vop_deleteextattr_post(void *a, int rc); void vop_link_post(void *a, int rc); void vop_lock_pre(void *a); void vop_lock_post(void *a, int rc); @@ -717,6 +718,7 @@ void vop_rename_post(void *a, int rc); void vop_rename_pre(void *a); void vop_rmdir_post(void *a, int rc); void vop_setattr_post(void *a, int rc); +void vop_setextattr_post(void *a, int rc); void vop_strategy_pre(void *a); void vop_symlink_post(void *a, int rc); void vop_unlock_post(void *a, int rc); From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 18:54:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03AB2106564A; Fri, 13 Jan 2012 18:54:11 +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 C78638FC18; Fri, 13 Jan 2012 18:54: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 q0DIsA9e074873; Fri, 13 Jan 2012 18:54:10 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DIsAGX074869; Fri, 13 Jan 2012 18:54:10 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201131854.q0DIsAGX074869@svn.freebsd.org> From: John Baldwin Date: Fri, 13 Jan 2012 18:54:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230068 - in stable/8/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 18:54:11 -0000 Author: jhb Date: Fri Jan 13 18:54:10 2012 New Revision: 230068 URL: http://svn.freebsd.org/changeset/base/230068 Log: MFC 228849, 229727: Add post-VOP hooks for VOP_DELETEEXTATTR() and VOP_SETEXTATTR() and use these to trigger a NOTE_ATTRIB EVFILT_VNODE kevent when the extended attributes of a vnode are changed. Modified: stable/8/sys/kern/vfs_subr.c stable/8/sys/kern/vnode_if.src stable/8/sys/sys/vnode.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/vfs_subr.c ============================================================================== --- stable/8/sys/kern/vfs_subr.c Fri Jan 13 18:53:48 2012 (r230067) +++ stable/8/sys/kern/vfs_subr.c Fri Jan 13 18:54:10 2012 (r230068) @@ -4003,6 +4003,15 @@ vop_create_post(void *ap, int rc) } void +vop_deleteextattr_post(void *ap, int rc) +{ + struct vop_deleteextattr_args *a = ap; + + if (!rc) + VFS_KNOTE_LOCKED(a->a_vp, NOTE_ATTRIB); +} + +void vop_link_post(void *ap, int rc) { struct vop_link_args *a = ap; @@ -4084,6 +4093,15 @@ vop_setattr_post(void *ap, int rc) } void +vop_setextattr_post(void *ap, int rc) +{ + struct vop_setextattr_args *a = ap; + + if (!rc) + VFS_KNOTE_LOCKED(a->a_vp, NOTE_ATTRIB); +} + +void vop_symlink_post(void *ap, int rc) { struct vop_symlink_args *a = ap; Modified: stable/8/sys/kern/vnode_if.src ============================================================================== --- stable/8/sys/kern/vnode_if.src Fri Jan 13 18:53:48 2012 (r230067) +++ stable/8/sys/kern/vnode_if.src Fri Jan 13 18:54:10 2012 (r230068) @@ -562,6 +562,7 @@ vop_openextattr { %% deleteextattr vp E E E +%! deleteextattr post vop_deleteextattr_post vop_deleteextattr { IN struct vnode *vp; @@ -573,6 +574,7 @@ vop_deleteextattr { %% setextattr vp E E E +%! setextattr post vop_setextattr_post vop_setextattr { IN struct vnode *vp; Modified: stable/8/sys/sys/vnode.h ============================================================================== --- stable/8/sys/sys/vnode.h Fri Jan 13 18:53:48 2012 (r230067) +++ stable/8/sys/sys/vnode.h Fri Jan 13 18:54:10 2012 (r230068) @@ -705,6 +705,7 @@ int vop_panic(struct vop_generic_args *a /* These are called from within the actual VOPS. */ void vop_create_post(void *a, int rc); +void vop_deleteextattr_post(void *a, int rc); void vop_link_post(void *a, int rc); void vop_lock_pre(void *a); void vop_lock_post(void *a, int rc); @@ -717,6 +718,7 @@ void vop_rename_post(void *a, int rc); void vop_rename_pre(void *a); void vop_rmdir_post(void *a, int rc); void vop_setattr_post(void *a, int rc); +void vop_setextattr_post(void *a, int rc); void vop_strategy_pre(void *a); void vop_symlink_post(void *a, int rc); void vop_unlock_post(void *a, int rc); From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 18:58:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C434E106566C; Fri, 13 Jan 2012 18:58: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 AF1238FC08; Fri, 13 Jan 2012 18:58: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 q0DIwFMj075052; Fri, 13 Jan 2012 18:58:15 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DIwFNc075050; Fri, 13 Jan 2012 18:58:15 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201131858.q0DIwFNc075050@svn.freebsd.org> From: John Baldwin Date: Fri, 13 Jan 2012 18:58:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230069 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 18:58:15 -0000 Author: jhb Date: Fri Jan 13 18:58:15 2012 New Revision: 230069 URL: http://svn.freebsd.org/changeset/base/230069 Log: MFC 229622: Fix a logic bug in change 228207 in the check for a thread's new user priority being a realtime priority. Modified: stable/9/sys/kern/kern_resource.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/kern/kern_resource.c ============================================================================== --- stable/9/sys/kern/kern_resource.c Fri Jan 13 18:54:10 2012 (r230068) +++ stable/9/sys/kern/kern_resource.c Fri Jan 13 18:58:15 2012 (r230069) @@ -497,7 +497,7 @@ rtp_to_pri(struct rtprio *rtp, struct th oldpri = td->td_user_pri; sched_user_prio(td, newpri); if (td->td_user_pri != oldpri && (td == curthread || - td->td_priority == oldpri || td->td_user_pri >= PRI_MAX_REALTIME)) + td->td_priority == oldpri || td->td_user_pri <= PRI_MAX_REALTIME)) sched_prio(td, td->td_user_pri); if (TD_ON_UPILOCK(td) && oldpri != newpri) { critical_enter(); From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 18:58:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CE381065795; Fri, 13 Jan 2012 18:58:32 +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 284B48FC15; Fri, 13 Jan 2012 18:58: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 q0DIwWZE075096; Fri, 13 Jan 2012 18:58:32 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DIwWIr075094; Fri, 13 Jan 2012 18:58:32 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201131858.q0DIwWIr075094@svn.freebsd.org> From: John Baldwin Date: Fri, 13 Jan 2012 18:58:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230070 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 18:58:32 -0000 Author: jhb Date: Fri Jan 13 18:58:31 2012 New Revision: 230070 URL: http://svn.freebsd.org/changeset/base/230070 Log: MFC 229622: Fix a logic bug in change 228207 in the check for a thread's new user priority being a realtime priority. Modified: stable/8/sys/kern/kern_resource.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/kern_resource.c ============================================================================== --- stable/8/sys/kern/kern_resource.c Fri Jan 13 18:58:15 2012 (r230069) +++ stable/8/sys/kern/kern_resource.c Fri Jan 13 18:58:31 2012 (r230070) @@ -506,7 +506,7 @@ rtp_to_pri(struct rtprio *rtp, struct th oldpri = td->td_user_pri; sched_user_prio(td, newpri); if (td->td_user_pri != oldpri && (td == curthread || - td->td_priority == oldpri || td->td_user_pri >= PRI_MAX_REALTIME)) + td->td_priority == oldpri || td->td_user_pri <= PRI_MAX_REALTIME)) sched_prio(td, td->td_user_pri); if (TD_ON_UPILOCK(td) && oldpri != newpri) { thread_unlock(td); From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 19:03:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C77F106564A; Fri, 13 Jan 2012 19:03:31 +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 0C37C8FC12; Fri, 13 Jan 2012 19:03: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 q0DJ3UTh075365; Fri, 13 Jan 2012 19:03:30 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DJ3UkH075363; Fri, 13 Jan 2012 19:03:30 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201131903.q0DJ3UkH075363@svn.freebsd.org> From: John Baldwin Date: Fri, 13 Jan 2012 19:03:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230071 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 19:03:31 -0000 Author: jhb Date: Fri Jan 13 19:03:30 2012 New Revision: 230071 URL: http://svn.freebsd.org/changeset/base/230071 Log: MFC 229728: Add 5 spare VOPs as placeholders to avoid breaking the KBI in the future when new VOPs are MFC'd to a branch. Modified: stable/9/sys/kern/vnode_if.src Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/kern/vnode_if.src ============================================================================== --- stable/9/sys/kern/vnode_if.src Fri Jan 13 18:58:31 2012 (r230070) +++ stable/9/sys/kern/vnode_if.src Fri Jan 13 19:03:30 2012 (r230071) @@ -50,7 +50,7 @@ # X: locked if not nil. # # The paramater named "vpp" is assumed to be always used with double -# indirection (**vpp) and that name is hard-codeed in vnode_if.awk ! +# indirection (**vpp) and that name is hard-coded in vnode_if.awk ! # # Lines starting with %! specify a pre or post-condition function # to call before/after the vop call. @@ -639,3 +639,28 @@ vop_advise { IN off_t end; IN int advice; }; + +# The VOPs below are spares at the end of the table to allow new VOPs to be +# added in stable branches without breaking the KBI. New VOPs in HEAD should +# be added above these spares. When merging a new VOP to a stable branch, +# the new VOP should replace one of the spares. + +vop_spare1 { + IN struct vnode *vp; +}; + +vop_spare2 { + IN struct vnode *vp; +}; + +vop_spare3 { + IN struct vnode *vp; +}; + +vop_spare4 { + IN struct vnode *vp; +}; + +vop_spare5 { + IN struct vnode *vp; +}; From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 19:10:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7CF3106566B; Fri, 13 Jan 2012 19:10:53 +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 B81B28FC08; Fri, 13 Jan 2012 19:10:53 +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 q0DJArqI075695; Fri, 13 Jan 2012 19:10:53 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DJArNe075693; Fri, 13 Jan 2012 19:10:53 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201131910.q0DJArNe075693@svn.freebsd.org> From: John Baldwin Date: Fri, 13 Jan 2012 19:10:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230072 - stable/9/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 19:10:54 -0000 Author: jhb Date: Fri Jan 13 19:10:53 2012 New Revision: 230072 URL: http://svn.freebsd.org/changeset/base/230072 Log: MFC 229400: Improve the cscope target's handling of MD directories. Automatically include the MACHINE_CPUARCH directory if it differents from MACHINE when building an index for a single machine. Also, include the 'x86' directory when building an index for i386, pc98, or amd64. Modified: stable/9/sys/Makefile Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/Makefile ============================================================================== --- stable/9/sys/Makefile Fri Jan 13 19:03:30 2012 (r230071) +++ stable/9/sys/Makefile Fri Jan 13 19:10:53 2012 (r230072) @@ -13,10 +13,18 @@ CSCOPEDIRS= boot bsm cam cddl compat con netgraph netinet netinet6 netipsec netipx netnatm netncp \ netsmb nfs nfsclient nfsserver nlm opencrypto \ pci rpc security sys ufs vm xdr xen ${CSCOPE_ARCHDIR} +.if !defined(CSCOPE_ARCHDIR) .if defined(ALL_ARCH) -CSCOPE_ARCHDIR ?= amd64 arm i386 ia64 mips pc98 powerpc sparc64 x86 +CSCOPE_ARCHDIR = amd64 arm i386 ia64 mips pc98 powerpc sparc64 x86 .else -CSCOPE_ARCHDIR ?= ${MACHINE} +CSCOPE_ARCHDIR = ${MACHINE} +.if ${MACHINE} != ${MACHINE_CPUARCH} +CSCOPE_ARCHDIR += ${MACHINE_CPUARCH} +.endif +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +CSCOPE_ARCHDIR += x86 +.endif +.endif .endif # Loadable kernel modules From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 19:13:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 674C8106566B; Fri, 13 Jan 2012 19:13:44 +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 37D0B8FC0C; Fri, 13 Jan 2012 19:13: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 q0DJDiFK075824; Fri, 13 Jan 2012 19:13:44 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DJDiYn075822; Fri, 13 Jan 2012 19:13:44 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201131913.q0DJDiYn075822@svn.freebsd.org> From: John Baldwin Date: Fri, 13 Jan 2012 19:13:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230073 - stable/8/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 19:13:44 -0000 Author: jhb Date: Fri Jan 13 19:13:43 2012 New Revision: 230073 URL: http://svn.freebsd.org/changeset/base/230073 Log: MFC 215605,215606,222952,229400: Various improvements to the 'cscope' target: - Add x86 to ALL_ARCH. - Add lex and yacc sources to things cscope'd. - Include sys/xen in cscope tag file generation. - Improve the cscope target's handling of MD directories. Automatically include the MACHINE_ARCH directory if it differs from MACHINE when building an index for a single machine. Also, include the 'x86' directory when building an index for i386, pc98, or amd64. Modified: stable/8/sys/Makefile Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/Makefile ============================================================================== --- stable/8/sys/Makefile Fri Jan 13 19:10:53 2012 (r230072) +++ stable/8/sys/Makefile Fri Jan 13 19:13:43 2012 (r230073) @@ -12,11 +12,19 @@ CSCOPEDIRS= boot bsm cam cddl compat con geom gnu isa kern libkern modules net net80211 netatalk \ netgraph netinet netinet6 netipsec netipx netnatm netncp \ netsmb nfs nfsclient nfsserver nlm opencrypto \ - pci rpc security sys ufs vm xdr ${CSCOPE_ARCHDIR} + pci rpc security sys ufs vm xdr xen ${CSCOPE_ARCHDIR} +.if !defined(CSCOPE_ARCHDIR) .if defined(ALL_ARCH) -CSCOPE_ARCHDIR ?= amd64 arm i386 ia64 mips pc98 powerpc sparc64 sun4v +CSCOPE_ARCHDIR = amd64 arm i386 ia64 mips pc98 powerpc sparc64 sun4v x86 .else -CSCOPE_ARCHDIR ?= ${MACHINE} +CSCOPE_ARCHDIR = ${MACHINE} +.if ${MACHINE} != ${MACHINE_ARCH} +CSCOPE_ARCHDIR += ${MACHINE_ARCH} +.endif +.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" +CSCOPE_ARCHDIR += x86 +.endif +.endif .endif # Loadable kernel modules @@ -34,7 +42,7 @@ cscope.out: ${.CURDIR}/cscope.files ${.CURDIR}/cscope.files: .PHONY cd ${.CURDIR}; \ - find ${CSCOPEDIRS} -name "*.[chSs]" -a -type f > ${.TARGET} + find ${CSCOPEDIRS} -name "*.[chSsly]" -a -type f > ${.TARGET} cscope-clean: rm -f cscope.files cscope.out cscope.in.out cscope.po.out From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 19:20:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C8C2106566B; Fri, 13 Jan 2012 19:20: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 56CCD8FC08; Fri, 13 Jan 2012 19:20: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 q0DJK9SD076078; Fri, 13 Jan 2012 19:20:09 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DJK9iB076075; Fri, 13 Jan 2012 19:20:09 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201131920.q0DJK9iB076075@svn.freebsd.org> From: John Baldwin Date: Fri, 13 Jan 2012 19:20:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230074 - in stable/9/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 19:20:09 -0000 Author: jhb Date: Fri Jan 13 19:20:09 2012 New Revision: 230074 URL: http://svn.freebsd.org/changeset/base/230074 Log: MFC 229414,229476,229477: Various fixes to the SIOC[DG]LIFADDR ioctl handlers: - Grab a reference on any matching interface address (ifa) before dropping the IF_ADDR_LOCK() and release the reference after using it to prevent a potential use-after-free. - Fix the IPv4 ioctl handlers in in_lifaddr_ioctl() to work with IPv4 interface addresses rather than IPv6. - Add missing interface address list locking in the IPv4 handlers. Modified: stable/9/sys/netinet/in.c stable/9/sys/netinet6/in6.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/netinet/in.c ============================================================================== --- stable/9/sys/netinet/in.c Fri Jan 13 19:13:43 2012 (r230073) +++ stable/9/sys/netinet/in.c Fri Jan 13 19:20:09 2012 (r230074) @@ -704,7 +704,7 @@ in_lifaddr_ioctl(struct socket *so, u_lo if (iflr->flags & IFLR_PREFIX) return (EINVAL); - /* copy args to in_aliasreq, perform ioctl(SIOCAIFADDR_IN6). */ + /* copy args to in_aliasreq, perform ioctl(SIOCAIFADDR). */ bzero(&ifra, sizeof(ifra)); bcopy(iflr->iflr_name, ifra.ifra_name, sizeof(ifra.ifra_name)); @@ -753,8 +753,9 @@ in_lifaddr_ioctl(struct socket *so, u_lo } } + IF_ADDR_LOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { - if (ifa->ifa_addr->sa_family != AF_INET6) + if (ifa->ifa_addr->sa_family != AF_INET) continue; if (match.s_addr == 0) break; @@ -763,6 +764,9 @@ in_lifaddr_ioctl(struct socket *so, u_lo if (candidate.s_addr == match.s_addr) break; } + if (ifa != NULL) + ifa_ref(ifa); + IF_ADDR_UNLOCK(ifp); if (ifa == NULL) return (EADDRNOTAVAIL); ia = (struct in_ifaddr *)ifa; @@ -781,12 +785,13 @@ in_lifaddr_ioctl(struct socket *so, u_lo in_mask2len(&ia->ia_sockmask.sin_addr); iflr->flags = 0; /*XXX*/ + ifa_free(ifa); return (0); } else { struct in_aliasreq ifra; - /* fill in_aliasreq and do ioctl(SIOCDIFADDR_IN6) */ + /* fill in_aliasreq and do ioctl(SIOCDIFADDR) */ bzero(&ifra, sizeof(ifra)); bcopy(iflr->iflr_name, ifra.ifra_name, sizeof(ifra.ifra_name)); @@ -799,6 +804,7 @@ in_lifaddr_ioctl(struct socket *so, u_lo } bcopy(&ia->ia_sockmask, &ifra.ifra_dstaddr, ia->ia_sockmask.sin_len); + ifa_free(ifa); return (in_control(so, SIOCDIFADDR, (caddr_t)&ifra, ifp, td)); Modified: stable/9/sys/netinet6/in6.c ============================================================================== --- stable/9/sys/netinet6/in6.c Fri Jan 13 19:13:43 2012 (r230073) +++ stable/9/sys/netinet6/in6.c Fri Jan 13 19:20:09 2012 (r230074) @@ -1738,6 +1738,8 @@ in6_lifaddr_ioctl(struct socket *so, u_l if (IN6_ARE_ADDR_EQUAL(&candidate, &match)) break; } + if (ifa != NULL) + ifa_ref(ifa); IF_ADDR_UNLOCK(ifp); if (!ifa) return EADDRNOTAVAIL; @@ -1750,16 +1752,20 @@ in6_lifaddr_ioctl(struct socket *so, u_l bcopy(&ia->ia_addr, &iflr->addr, ia->ia_addr.sin6_len); error = sa6_recoverscope( (struct sockaddr_in6 *)&iflr->addr); - if (error != 0) + if (error != 0) { + ifa_free(ifa); return (error); + } if ((ifp->if_flags & IFF_POINTOPOINT) != 0) { bcopy(&ia->ia_dstaddr, &iflr->dstaddr, ia->ia_dstaddr.sin6_len); error = sa6_recoverscope( (struct sockaddr_in6 *)&iflr->dstaddr); - if (error != 0) + if (error != 0) { + ifa_free(ifa); return (error); + } } else bzero(&iflr->dstaddr, sizeof(iflr->dstaddr)); @@ -1767,6 +1773,7 @@ in6_lifaddr_ioctl(struct socket *so, u_l in6_mask2len(&ia->ia_prefixmask.sin6_addr, NULL); iflr->flags = ia->ia6_flags; /* XXX */ + ifa_free(ifa); return 0; } else { @@ -1790,6 +1797,7 @@ in6_lifaddr_ioctl(struct socket *so, u_l ia->ia_prefixmask.sin6_len); ifra.ifra_flags = ia->ia6_flags; + ifa_free(ifa); return in6_control(so, SIOCDIFADDR_IN6, (caddr_t)&ifra, ifp, td); } From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 19:20:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE5971065677; Fri, 13 Jan 2012 19:20:33 +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 9E04D8FC0C; Fri, 13 Jan 2012 19:20: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 q0DJKXZq076130; Fri, 13 Jan 2012 19:20:33 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DJKXCP076127; Fri, 13 Jan 2012 19:20:33 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201131920.q0DJKXCP076127@svn.freebsd.org> From: John Baldwin Date: Fri, 13 Jan 2012 19:20:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230075 - in stable/8/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 19:20:34 -0000 Author: jhb Date: Fri Jan 13 19:20:33 2012 New Revision: 230075 URL: http://svn.freebsd.org/changeset/base/230075 Log: MFC 229414,229476,229477: Various fixes to the SIOC[DG]LIFADDR ioctl handlers: - Grab a reference on any matching interface address (ifa) before dropping the IF_ADDR_LOCK() and release the reference after using it to prevent a potential use-after-free. - Fix the IPv4 ioctl handlers in in_lifaddr_ioctl() to work with IPv4 interface addresses rather than IPv6. - Add missing interface address list locking in the IPv4 handlers. Modified: stable/8/sys/netinet/in.c stable/8/sys/netinet6/in6.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/netinet/in.c ============================================================================== --- stable/8/sys/netinet/in.c Fri Jan 13 19:20:09 2012 (r230074) +++ stable/8/sys/netinet/in.c Fri Jan 13 19:20:33 2012 (r230075) @@ -720,7 +720,7 @@ in_lifaddr_ioctl(struct socket *so, u_lo if (iflr->flags & IFLR_PREFIX) return (EINVAL); - /* copy args to in_aliasreq, perform ioctl(SIOCAIFADDR_IN6). */ + /* copy args to in_aliasreq, perform ioctl(SIOCAIFADDR). */ bzero(&ifra, sizeof(ifra)); bcopy(iflr->iflr_name, ifra.ifra_name, sizeof(ifra.ifra_name)); @@ -769,8 +769,9 @@ in_lifaddr_ioctl(struct socket *so, u_lo } } + IF_ADDR_LOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) { - if (ifa->ifa_addr->sa_family != AF_INET6) + if (ifa->ifa_addr->sa_family != AF_INET) continue; if (match.s_addr == 0) break; @@ -779,6 +780,9 @@ in_lifaddr_ioctl(struct socket *so, u_lo if (candidate.s_addr == match.s_addr) break; } + if (ifa != NULL) + ifa_ref(ifa); + IF_ADDR_UNLOCK(ifp); if (ifa == NULL) return (EADDRNOTAVAIL); ia = (struct in_ifaddr *)ifa; @@ -797,12 +801,13 @@ in_lifaddr_ioctl(struct socket *so, u_lo in_mask2len(&ia->ia_sockmask.sin_addr); iflr->flags = 0; /*XXX*/ + ifa_free(ifa); return (0); } else { struct in_aliasreq ifra; - /* fill in_aliasreq and do ioctl(SIOCDIFADDR_IN6) */ + /* fill in_aliasreq and do ioctl(SIOCDIFADDR) */ bzero(&ifra, sizeof(ifra)); bcopy(iflr->iflr_name, ifra.ifra_name, sizeof(ifra.ifra_name)); @@ -815,6 +820,7 @@ in_lifaddr_ioctl(struct socket *so, u_lo } bcopy(&ia->ia_sockmask, &ifra.ifra_dstaddr, ia->ia_sockmask.sin_len); + ifa_free(ifa); return (in_control(so, SIOCDIFADDR, (caddr_t)&ifra, ifp, td)); Modified: stable/8/sys/netinet6/in6.c ============================================================================== --- stable/8/sys/netinet6/in6.c Fri Jan 13 19:20:09 2012 (r230074) +++ stable/8/sys/netinet6/in6.c Fri Jan 13 19:20:33 2012 (r230075) @@ -1655,6 +1655,8 @@ in6_lifaddr_ioctl(struct socket *so, u_l if (IN6_ARE_ADDR_EQUAL(&candidate, &match)) break; } + if (ifa != NULL) + ifa_ref(ifa); IF_ADDR_UNLOCK(ifp); if (!ifa) return EADDRNOTAVAIL; @@ -1667,16 +1669,20 @@ in6_lifaddr_ioctl(struct socket *so, u_l bcopy(&ia->ia_addr, &iflr->addr, ia->ia_addr.sin6_len); error = sa6_recoverscope( (struct sockaddr_in6 *)&iflr->addr); - if (error != 0) + if (error != 0) { + ifa_free(ifa); return (error); + } if ((ifp->if_flags & IFF_POINTOPOINT) != 0) { bcopy(&ia->ia_dstaddr, &iflr->dstaddr, ia->ia_dstaddr.sin6_len); error = sa6_recoverscope( (struct sockaddr_in6 *)&iflr->dstaddr); - if (error != 0) + if (error != 0) { + ifa_free(ifa); return (error); + } } else bzero(&iflr->dstaddr, sizeof(iflr->dstaddr)); @@ -1684,6 +1690,7 @@ in6_lifaddr_ioctl(struct socket *so, u_l in6_mask2len(&ia->ia_prefixmask.sin6_addr, NULL); iflr->flags = ia->ia6_flags; /* XXX */ + ifa_free(ifa); return 0; } else { @@ -1707,6 +1714,7 @@ in6_lifaddr_ioctl(struct socket *so, u_l ia->ia_prefixmask.sin6_len); ifra.ifra_flags = ia->ia6_flags; + ifa_free(ifa); return in6_control(so, SIOCDIFADDR_IN6, (caddr_t)&ifra, ifp, td); } From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 19:50:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40B19106566C; Fri, 13 Jan 2012 19:50:53 +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 200088FC0A; Fri, 13 Jan 2012 19:50:53 +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 q0DJorNQ077553; Fri, 13 Jan 2012 19:50:53 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DJoqKE077548; Fri, 13 Jan 2012 19:50:52 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201131950.q0DJoqKE077548@svn.freebsd.org> From: John Baldwin Date: Fri, 13 Jan 2012 19:50:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230076 - in stable/9/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 19:50:53 -0000 Author: jhb Date: Fri Jan 13 19:50:52 2012 New Revision: 230076 URL: http://svn.freebsd.org/changeset/base/230076 Log: MFC 229390,229420,229479: Fix some races in the multicast code by removing places where we would drop the IF_ADDR_LOCK while walking an interface's multicast address list: - Use TAILQ_FOREACH() instead of TAILQ_FOREACH_SAFE() for some loops that do not modify the queues they iterate over. - When cancelling multicast timers on an interface, don't release the reference on a group in the leaving state while iterating over the loop. Instead, use the same approach used in igmp_ifdetach() and mld_ifdetach() of placing the groups to free on a pending release list and then releasing the references after dropping the IF_ADDR_LOCK. - Use the mli_relinmhead list normally used to defer calls to in6m_release_locked() to defer calls to mld_v1_transmit_report() until after the IF_ADDR_LOCK is dropped. Modified: stable/9/sys/netinet/igmp.c stable/9/sys/netinet6/in6.c stable/9/sys/netinet6/mld6.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/netinet/igmp.c ============================================================================== --- stable/9/sys/netinet/igmp.c Fri Jan 13 19:20:33 2012 (r230075) +++ stable/9/sys/netinet/igmp.c Fri Jan 13 19:50:52 2012 (r230076) @@ -1641,7 +1641,7 @@ igmp_fasttimo_vnet(void) struct ifqueue qrq; /* Query response packets */ struct ifnet *ifp; struct igmp_ifinfo *igi; - struct ifmultiaddr *ifma, *tifma; + struct ifmultiaddr *ifma; struct in_multi *inm; int loop, uri_fasthz; @@ -1708,8 +1708,7 @@ igmp_fasttimo_vnet(void) } IF_ADDR_LOCK(ifp); - TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, - tifma) { + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_INET || ifma->ifma_protospec == NULL) continue; @@ -2003,7 +2002,7 @@ igmp_v3_cancel_link_timers(struct igmp_i { struct ifmultiaddr *ifma; struct ifnet *ifp; - struct in_multi *inm; + struct in_multi *inm, *tinm; CTR3(KTR_IGMPV3, "%s: cancel v3 timers on ifp %p(%s)", __func__, igi->igi_ifp, igi->igi_ifp->if_xname); @@ -2049,14 +2048,8 @@ igmp_v3_cancel_link_timers(struct igmp_i * transition to REPORTING to ensure the host leave * message is sent upstream to the old querier -- * transition to NOT would lose the leave and race. - * - * SMPNG: Must drop and re-acquire IF_ADDR_LOCK - * around inm_release_locked(), as it is not - * a recursive mutex. */ - IF_ADDR_UNLOCK(ifp); - inm_release_locked(inm); - IF_ADDR_LOCK(ifp); + SLIST_INSERT_HEAD(&igi->igi_relinmhead, inm, inm_nrele); /* FALLTHROUGH */ case IGMP_G_QUERY_PENDING_MEMBER: case IGMP_SG_QUERY_PENDING_MEMBER: @@ -2075,6 +2068,10 @@ igmp_v3_cancel_link_timers(struct igmp_i _IF_DRAIN(&inm->inm_scq); } IF_ADDR_UNLOCK(ifp); + SLIST_FOREACH_SAFE(inm, &igi->igi_relinmhead, inm_nrele, tinm) { + SLIST_REMOVE_HEAD(&igi->igi_relinmhead, inm_nrele); + inm_release_locked(inm); + } } /* @@ -3320,7 +3317,7 @@ igmp_v3_merge_state_changes(struct in_mu static void igmp_v3_dispatch_general_query(struct igmp_ifinfo *igi) { - struct ifmultiaddr *ifma, *tifma; + struct ifmultiaddr *ifma; struct ifnet *ifp; struct in_multi *inm; int retval, loop; @@ -3334,7 +3331,7 @@ igmp_v3_dispatch_general_query(struct ig ifp = igi->igi_ifp; IF_ADDR_LOCK(ifp); - TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, tifma) { + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_INET || ifma->ifma_protospec == NULL) continue; Modified: stable/9/sys/netinet6/in6.c ============================================================================== --- stable/9/sys/netinet6/in6.c Fri Jan 13 19:20:33 2012 (r230075) +++ stable/9/sys/netinet6/in6.c Fri Jan 13 19:50:52 2012 (r230076) @@ -1299,7 +1299,7 @@ in6_purgeaddr(struct ifaddr *ifa) struct sockaddr_in6 mltaddr, mltmask; int plen, error; struct rtentry *rt; - struct ifaddr *ifa0, *nifa; + struct ifaddr *ifa0; /* * find another IPv6 address as the gateway for the @@ -1307,7 +1307,7 @@ in6_purgeaddr(struct ifaddr *ifa) * address routes */ IF_ADDR_LOCK(ifp); - TAILQ_FOREACH_SAFE(ifa0, &ifp->if_addrhead, ifa_link, nifa) { + TAILQ_FOREACH(ifa0, &ifp->if_addrhead, ifa_link) { if ((ifa0->ifa_addr->sa_family != AF_INET6) || memcmp(&satosin6(ifa0->ifa_addr)->sin6_addr, &ia->ia_addr.sin6_addr, Modified: stable/9/sys/netinet6/mld6.c ============================================================================== --- stable/9/sys/netinet6/mld6.c Fri Jan 13 19:20:33 2012 (r230075) +++ stable/9/sys/netinet6/mld6.c Fri Jan 13 19:50:52 2012 (r230076) @@ -121,7 +121,8 @@ static int mld_v1_input_query(struct ifn /*const*/ struct mld_hdr *); static int mld_v1_input_report(struct ifnet *, const struct ip6_hdr *, /*const*/ struct mld_hdr *); -static void mld_v1_process_group_timer(struct in6_multi *, const int); +static void mld_v1_process_group_timer(struct mld_ifinfo *, + struct in6_multi *); static void mld_v1_process_querier_timers(struct mld_ifinfo *); static int mld_v1_transmit_report(struct in6_multi *, const int); static void mld_v1_update_group(struct in6_multi *, const int); @@ -1335,8 +1336,8 @@ mld_fasttimo_vnet(void) struct ifqueue qrq; /* Query response packets */ struct ifnet *ifp; struct mld_ifinfo *mli; - struct ifmultiaddr *ifma, *tifma; - struct in6_multi *inm; + struct ifmultiaddr *ifma; + struct in6_multi *inm, *tinm; int uri_fasthz; uri_fasthz = 0; @@ -1400,24 +1401,14 @@ mld_fasttimo_vnet(void) } IF_ADDR_LOCK(ifp); - TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, - tifma) { + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_INET6 || ifma->ifma_protospec == NULL) continue; inm = (struct in6_multi *)ifma->ifma_protospec; switch (mli->mli_version) { case MLD_VERSION_1: - /* - * XXX Drop IF_ADDR lock temporarily to - * avoid recursion caused by a potential - * call by in6ifa_ifpforlinklocal(). - * rwlock candidate? - */ - IF_ADDR_UNLOCK(ifp); - mld_v1_process_group_timer(inm, - mli->mli_version); - IF_ADDR_LOCK(ifp); + mld_v1_process_group_timer(mli, inm); break; case MLD_VERSION_2: mld_v2_process_group_timers(mli, &qrq, @@ -1427,9 +1418,25 @@ mld_fasttimo_vnet(void) } IF_ADDR_UNLOCK(ifp); - if (mli->mli_version == MLD_VERSION_2) { - struct in6_multi *tinm; - + switch (mli->mli_version) { + case MLD_VERSION_1: + /* + * Transmit reports for this lifecycle. This + * is done while not holding IF_ADDR_LOCK + * since this can call + * in6ifa_ifpforlinklocal() which locks + * IF_ADDR_LOCK internally as well as + * ip6_output() to transmit a packet. + */ + SLIST_FOREACH_SAFE(inm, &mli->mli_relinmhead, + in6m_nrele, tinm) { + SLIST_REMOVE_HEAD(&mli->mli_relinmhead, + in6m_nrele); + (void)mld_v1_transmit_report(inm, + MLD_LISTENER_REPORT); + } + break; + case MLD_VERSION_2: mld_dispatch_queue(&qrq, 0); mld_dispatch_queue(&scq, 0); @@ -1443,6 +1450,7 @@ mld_fasttimo_vnet(void) in6m_nrele); in6m_release_locked(inm); } + break; } } @@ -1456,7 +1464,7 @@ out_locked: * Will update the global pending timer flags. */ static void -mld_v1_process_group_timer(struct in6_multi *inm, const int version) +mld_v1_process_group_timer(struct mld_ifinfo *mli, struct in6_multi *inm) { int report_timer_expired; @@ -1483,8 +1491,8 @@ mld_v1_process_group_timer(struct in6_mu case MLD_REPORTING_MEMBER: if (report_timer_expired) { inm->in6m_state = MLD_IDLE_MEMBER; - (void)mld_v1_transmit_report(inm, - MLD_LISTENER_REPORT); + SLIST_INSERT_HEAD(&mli->mli_relinmhead, inm, + in6m_nrele); } break; case MLD_G_QUERY_PENDING_MEMBER: @@ -1655,7 +1663,7 @@ mld_v2_cancel_link_timers(struct mld_ifi { struct ifmultiaddr *ifma; struct ifnet *ifp; - struct in6_multi *inm; + struct in6_multi *inm, *tinm; CTR3(KTR_MLD, "%s: cancel v2 timers on ifp %p(%s)", __func__, mli->mli_ifp, mli->mli_ifp->if_xname); @@ -1694,14 +1702,9 @@ mld_v2_cancel_link_timers(struct mld_ifi * If we are leaving the group and switching * version, we need to release the final * reference held for issuing the INCLUDE {}. - * - * SMPNG: Must drop and re-acquire IF_ADDR_LOCK - * around in6m_release_locked(), as it is not - * a recursive mutex. */ - IF_ADDR_UNLOCK(ifp); - in6m_release_locked(inm); - IF_ADDR_LOCK(ifp); + SLIST_INSERT_HEAD(&mli->mli_relinmhead, inm, + in6m_nrele); /* FALLTHROUGH */ case MLD_G_QUERY_PENDING_MEMBER: case MLD_SG_QUERY_PENDING_MEMBER: @@ -1719,6 +1722,10 @@ mld_v2_cancel_link_timers(struct mld_ifi } } IF_ADDR_UNLOCK(ifp); + SLIST_FOREACH_SAFE(inm, &mli->mli_relinmhead, in6m_nrele, tinm) { + SLIST_REMOVE_HEAD(&mli->mli_relinmhead, in6m_nrele); + in6m_release_locked(inm); + } } /* @@ -2975,7 +2982,7 @@ mld_v2_merge_state_changes(struct in6_mu static void mld_v2_dispatch_general_query(struct mld_ifinfo *mli) { - struct ifmultiaddr *ifma, *tifma; + struct ifmultiaddr *ifma; struct ifnet *ifp; struct in6_multi *inm; int retval; @@ -2989,7 +2996,7 @@ mld_v2_dispatch_general_query(struct mld ifp = mli->mli_ifp; IF_ADDR_LOCK(ifp); - TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, tifma) { + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_INET6 || ifma->ifma_protospec == NULL) continue; From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 19:51:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AB4F1065675; Fri, 13 Jan 2012 19:51:16 +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 23CF68FC17; Fri, 13 Jan 2012 19:51: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 q0DJpGH5077604; Fri, 13 Jan 2012 19:51:16 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DJpFUM077600; Fri, 13 Jan 2012 19:51:15 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201131951.q0DJpFUM077600@svn.freebsd.org> From: John Baldwin Date: Fri, 13 Jan 2012 19:51:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230077 - in stable/8/sys: netinet netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 19:51:16 -0000 Author: jhb Date: Fri Jan 13 19:51:15 2012 New Revision: 230077 URL: http://svn.freebsd.org/changeset/base/230077 Log: MFC 229390,229420,229479: Fix some races in the multicast code by removing places where we would drop the IF_ADDR_LOCK while walking an interface's multicast address list: - Use TAILQ_FOREACH() instead of TAILQ_FOREACH_SAFE() for some loops that do not modify the queues they iterate over. - When cancelling multicast timers on an interface, don't release the reference on a group in the leaving state while iterating over the loop. Instead, use the same approach used in igmp_ifdetach() and mld_ifdetach() of placing the groups to free on a pending release list and then releasing the references after dropping the IF_ADDR_LOCK. - Use the mli_relinmhead list normally used to defer calls to in6m_release_locked() to defer calls to mld_v1_transmit_report() until after the IF_ADDR_LOCK is dropped. Modified: stable/8/sys/netinet/igmp.c stable/8/sys/netinet6/in6.c stable/8/sys/netinet6/mld6.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/netinet/igmp.c ============================================================================== --- stable/8/sys/netinet/igmp.c Fri Jan 13 19:50:52 2012 (r230076) +++ stable/8/sys/netinet/igmp.c Fri Jan 13 19:51:15 2012 (r230077) @@ -1641,7 +1641,7 @@ igmp_fasttimo_vnet(void) struct ifqueue qrq; /* Query response packets */ struct ifnet *ifp; struct igmp_ifinfo *igi; - struct ifmultiaddr *ifma, *tifma; + struct ifmultiaddr *ifma; struct in_multi *inm; int loop, uri_fasthz; @@ -1708,8 +1708,7 @@ igmp_fasttimo_vnet(void) } IF_ADDR_LOCK(ifp); - TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, - tifma) { + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_INET || ifma->ifma_protospec == NULL) continue; @@ -2003,7 +2002,7 @@ igmp_v3_cancel_link_timers(struct igmp_i { struct ifmultiaddr *ifma; struct ifnet *ifp; - struct in_multi *inm; + struct in_multi *inm, *tinm; CTR3(KTR_IGMPV3, "%s: cancel v3 timers on ifp %p(%s)", __func__, igi->igi_ifp, igi->igi_ifp->if_xname); @@ -2049,14 +2048,8 @@ igmp_v3_cancel_link_timers(struct igmp_i * transition to REPORTING to ensure the host leave * message is sent upstream to the old querier -- * transition to NOT would lose the leave and race. - * - * SMPNG: Must drop and re-acquire IF_ADDR_LOCK - * around inm_release_locked(), as it is not - * a recursive mutex. */ - IF_ADDR_UNLOCK(ifp); - inm_release_locked(inm); - IF_ADDR_LOCK(ifp); + SLIST_INSERT_HEAD(&igi->igi_relinmhead, inm, inm_nrele); /* FALLTHROUGH */ case IGMP_G_QUERY_PENDING_MEMBER: case IGMP_SG_QUERY_PENDING_MEMBER: @@ -2075,6 +2068,10 @@ igmp_v3_cancel_link_timers(struct igmp_i _IF_DRAIN(&inm->inm_scq); } IF_ADDR_UNLOCK(ifp); + SLIST_FOREACH_SAFE(inm, &igi->igi_relinmhead, inm_nrele, tinm) { + SLIST_REMOVE_HEAD(&igi->igi_relinmhead, inm_nrele); + inm_release_locked(inm); + } } /* @@ -3320,7 +3317,7 @@ igmp_v3_merge_state_changes(struct in_mu static void igmp_v3_dispatch_general_query(struct igmp_ifinfo *igi) { - struct ifmultiaddr *ifma, *tifma; + struct ifmultiaddr *ifma; struct ifnet *ifp; struct in_multi *inm; int retval, loop; @@ -3334,7 +3331,7 @@ igmp_v3_dispatch_general_query(struct ig ifp = igi->igi_ifp; IF_ADDR_LOCK(ifp); - TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, tifma) { + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_INET || ifma->ifma_protospec == NULL) continue; Modified: stable/8/sys/netinet6/in6.c ============================================================================== --- stable/8/sys/netinet6/in6.c Fri Jan 13 19:50:52 2012 (r230076) +++ stable/8/sys/netinet6/in6.c Fri Jan 13 19:51:15 2012 (r230077) @@ -1195,7 +1195,7 @@ in6_purgeaddr(struct ifaddr *ifa) struct sockaddr_in6 mask, addr; int plen, error; struct rtentry *rt; - struct ifaddr *ifa0, *nifa; + struct ifaddr *ifa0; /* * find another IPv6 address as the gateway for the @@ -1203,7 +1203,7 @@ in6_purgeaddr(struct ifaddr *ifa) * address routes */ IF_ADDR_LOCK(ifp); - TAILQ_FOREACH_SAFE(ifa0, &ifp->if_addrhead, ifa_link, nifa) { + TAILQ_FOREACH(ifa0, &ifp->if_addrhead, ifa_link) { if ((ifa0->ifa_addr->sa_family != AF_INET6) || memcmp(&satosin6(ifa0->ifa_addr)->sin6_addr, &ia->ia_addr.sin6_addr, Modified: stable/8/sys/netinet6/mld6.c ============================================================================== --- stable/8/sys/netinet6/mld6.c Fri Jan 13 19:50:52 2012 (r230076) +++ stable/8/sys/netinet6/mld6.c Fri Jan 13 19:51:15 2012 (r230077) @@ -121,7 +121,8 @@ static int mld_v1_input_query(struct ifn /*const*/ struct mld_hdr *); static int mld_v1_input_report(struct ifnet *, const struct ip6_hdr *, /*const*/ struct mld_hdr *); -static void mld_v1_process_group_timer(struct in6_multi *, const int); +static void mld_v1_process_group_timer(struct mld_ifinfo *, + struct in6_multi *); static void mld_v1_process_querier_timers(struct mld_ifinfo *); static int mld_v1_transmit_report(struct in6_multi *, const int); static void mld_v1_update_group(struct in6_multi *, const int); @@ -1332,8 +1333,8 @@ mld_fasttimo_vnet(void) struct ifqueue qrq; /* Query response packets */ struct ifnet *ifp; struct mld_ifinfo *mli; - struct ifmultiaddr *ifma, *tifma; - struct in6_multi *inm; + struct ifmultiaddr *ifma; + struct in6_multi *inm, *tinm; int uri_fasthz; uri_fasthz = 0; @@ -1397,24 +1398,14 @@ mld_fasttimo_vnet(void) } IF_ADDR_LOCK(ifp); - TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, - tifma) { + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_INET6 || ifma->ifma_protospec == NULL) continue; inm = (struct in6_multi *)ifma->ifma_protospec; switch (mli->mli_version) { case MLD_VERSION_1: - /* - * XXX Drop IF_ADDR lock temporarily to - * avoid recursion caused by a potential - * call by in6ifa_ifpforlinklocal(). - * rwlock candidate? - */ - IF_ADDR_UNLOCK(ifp); - mld_v1_process_group_timer(inm, - mli->mli_version); - IF_ADDR_LOCK(ifp); + mld_v1_process_group_timer(mli, inm); break; case MLD_VERSION_2: mld_v2_process_group_timers(mli, &qrq, @@ -1424,9 +1415,25 @@ mld_fasttimo_vnet(void) } IF_ADDR_UNLOCK(ifp); - if (mli->mli_version == MLD_VERSION_2) { - struct in6_multi *tinm; - + switch (mli->mli_version) { + case MLD_VERSION_1: + /* + * Transmit reports for this lifecycle. This + * is done while not holding IF_ADDR_LOCK + * since this can call + * in6ifa_ifpforlinklocal() which locks + * IF_ADDR_LOCK internally as well as + * ip6_output() to transmit a packet. + */ + SLIST_FOREACH_SAFE(inm, &mli->mli_relinmhead, + in6m_nrele, tinm) { + SLIST_REMOVE_HEAD(&mli->mli_relinmhead, + in6m_nrele); + (void)mld_v1_transmit_report(inm, + MLD_LISTENER_REPORT); + } + break; + case MLD_VERSION_2: mld_dispatch_queue(&qrq, 0); mld_dispatch_queue(&scq, 0); @@ -1440,6 +1447,7 @@ mld_fasttimo_vnet(void) in6m_nrele); in6m_release_locked(inm); } + break; } } @@ -1453,7 +1461,7 @@ out_locked: * Will update the global pending timer flags. */ static void -mld_v1_process_group_timer(struct in6_multi *inm, const int version) +mld_v1_process_group_timer(struct mld_ifinfo *mli, struct in6_multi *inm) { int report_timer_expired; @@ -1480,8 +1488,8 @@ mld_v1_process_group_timer(struct in6_mu case MLD_REPORTING_MEMBER: if (report_timer_expired) { inm->in6m_state = MLD_IDLE_MEMBER; - (void)mld_v1_transmit_report(inm, - MLD_LISTENER_REPORT); + SLIST_INSERT_HEAD(&mli->mli_relinmhead, inm, + in6m_nrele); } break; case MLD_G_QUERY_PENDING_MEMBER: @@ -1652,7 +1660,7 @@ mld_v2_cancel_link_timers(struct mld_ifi { struct ifmultiaddr *ifma; struct ifnet *ifp; - struct in6_multi *inm; + struct in6_multi *inm, *tinm; CTR3(KTR_MLD, "%s: cancel v2 timers on ifp %p(%s)", __func__, mli->mli_ifp, mli->mli_ifp->if_xname); @@ -1691,14 +1699,9 @@ mld_v2_cancel_link_timers(struct mld_ifi * If we are leaving the group and switching * version, we need to release the final * reference held for issuing the INCLUDE {}. - * - * SMPNG: Must drop and re-acquire IF_ADDR_LOCK - * around in6m_release_locked(), as it is not - * a recursive mutex. */ - IF_ADDR_UNLOCK(ifp); - in6m_release_locked(inm); - IF_ADDR_LOCK(ifp); + SLIST_INSERT_HEAD(&mli->mli_relinmhead, inm, + in6m_nrele); /* FALLTHROUGH */ case MLD_G_QUERY_PENDING_MEMBER: case MLD_SG_QUERY_PENDING_MEMBER: @@ -1716,6 +1719,10 @@ mld_v2_cancel_link_timers(struct mld_ifi } } IF_ADDR_UNLOCK(ifp); + SLIST_FOREACH_SAFE(inm, &mli->mli_relinmhead, in6m_nrele, tinm) { + SLIST_REMOVE_HEAD(&mli->mli_relinmhead, in6m_nrele); + in6m_release_locked(inm); + } } /* @@ -2972,7 +2979,7 @@ mld_v2_merge_state_changes(struct in6_mu static void mld_v2_dispatch_general_query(struct mld_ifinfo *mli) { - struct ifmultiaddr *ifma, *tifma; + struct ifmultiaddr *ifma; struct ifnet *ifp; struct in6_multi *inm; int retval; @@ -2986,7 +2993,7 @@ mld_v2_dispatch_general_query(struct mld ifp = mli->mli_ifp; IF_ADDR_LOCK(ifp); - TAILQ_FOREACH_SAFE(ifma, &ifp->if_multiaddrs, ifma_link, tifma) { + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_INET6 || ifma->ifma_protospec == NULL) continue; From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 19:54:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E28B6106564A; Fri, 13 Jan 2012 19:54:00 +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 C1F5F8FC0C; Fri, 13 Jan 2012 19:54: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 q0DJs071077733; Fri, 13 Jan 2012 19:54:00 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DJs0fA077731; Fri, 13 Jan 2012 19:54:00 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201131954.q0DJs0fA077731@svn.freebsd.org> From: John Baldwin Date: Fri, 13 Jan 2012 19:54:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230078 - stable/9/sys/x86/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 19:54:01 -0000 Author: jhb Date: Fri Jan 13 19:54:00 2012 New Revision: 230078 URL: http://svn.freebsd.org/changeset/base/230078 Log: MFC 229427: Fix a few bugs in the SRAT parsing code: - Actually increment ndomain when building our list of known domains so that we can properly renumber them to be 0-based and dense. - If the number of domains exceeds the configured maximum (VM_NDOMAIN), bail out of processing the SRAT and disable NUMA rather than hitting an obscure panic later. - Don't bother parsing the SRAT at all if VM_NDOMAIN is set to 1 to disable NUMA (the default). Modified: stable/9/sys/x86/acpica/srat.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/x86/acpica/srat.c ============================================================================== --- stable/9/sys/x86/acpica/srat.c Fri Jan 13 19:51:15 2012 (r230077) +++ stable/9/sys/x86/acpica/srat.c Fri Jan 13 19:54:00 2012 (r230078) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include +#if VM_NDOMAIN > 1 struct cpu_info { int enabled:1; int has_memory:1; @@ -237,9 +238,9 @@ check_phys_avail(void) /* * Renumber the memory domains to be compact and zero-based if not - * already. + * already. Returns an error if there are too many domains. */ -static void +static int renumber_domains(void) { int domains[VM_PHYSSEG_MAX]; @@ -261,6 +262,11 @@ renumber_domains(void) for (j = ndomain; j > slot; j--) domains[j] = domains[j - 1]; domains[slot] = mem_info[i].domain; + ndomain++; + if (ndomain > VM_NDOMAIN) { + printf("SRAT: Too many memory domains\n"); + return (EFBIG); + } } /* Renumber each domain to its index in the sorted 'domains' list. */ @@ -280,6 +286,7 @@ renumber_domains(void) if (cpus[j].enabled && cpus[j].domain == domains[i]) cpus[j].domain = i; } + return (0); } /* @@ -306,13 +313,12 @@ parse_srat(void *dummy) srat_walk_table(srat_parse_entry, &error); acpi_unmap_table(srat); srat = NULL; - if (error || check_domains() != 0 || check_phys_avail() != 0) { + if (error || check_domains() != 0 || check_phys_avail() != 0 || + renumber_domains() != 0) { srat_physaddr = 0; return; } - renumber_domains(); - /* Point vm_phys at our memory affinity table. */ mem_affinity = mem_info; } @@ -354,3 +360,4 @@ srat_set_cpus(void *dummy) } } SYSINIT(srat_set_cpus, SI_SUB_CPU, SI_ORDER_ANY, srat_set_cpus, NULL); +#endif /* VM_NDOMAIN > 1 */ From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 20:15:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F8281065677; Fri, 13 Jan 2012 20:15:28 +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 EDA948FC08; Fri, 13 Jan 2012 20:15:27 +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 q0DKFRjR078452; Fri, 13 Jan 2012 20:15:27 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DKFRcR078448; Fri, 13 Jan 2012 20:15:27 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201132015.q0DKFRcR078448@svn.freebsd.org> From: John Baldwin Date: Fri, 13 Jan 2012 20:15:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230079 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 20:15:28 -0000 Author: jhb Date: Fri Jan 13 20:15:27 2012 New Revision: 230079 URL: http://svn.freebsd.org/changeset/base/230079 Log: MFC 229429: Some small fixes to CPU accounting for threads: - Only initialize the per-cpu switchticks and switchtime in sched_throw() for the very first context switch on APs during boot. This avoids a small gap between the middle of thread_exit() and sched_throw() where time is not accounted to any thread. - In thread_exit(), update the timestamp bookkeeping to track the changes to mi_switch() introduced by td_rux so that the code once again matches the comment claiming it is mimicing mi_switch(). Specifically, only update the per-thread stats directly and depend on ruxagg() to update p_rux rather than adjusting p_rux directly. While here, move the timestamp bookkeeping as late in the function as possible. Modified: stable/9/sys/kern/kern_thread.c stable/9/sys/kern/sched_4bsd.c stable/9/sys/kern/sched_ule.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/kern/kern_thread.c ============================================================================== --- stable/9/sys/kern/kern_thread.c Fri Jan 13 19:54:00 2012 (r230078) +++ stable/9/sys/kern/kern_thread.c Fri Jan 13 20:15:27 2012 (r230079) @@ -381,7 +381,7 @@ thread_free(struct thread *td) void thread_exit(void) { - uint64_t new_switchtime; + uint64_t runtime, new_switchtime; struct thread *td; struct thread *td2; struct proc *p; @@ -410,15 +410,6 @@ thread_exit(void) */ cpu_thread_exit(td); /* XXXSMP */ - /* Do the same timestamp bookkeeping that mi_switch() would do. */ - new_switchtime = cpu_ticks(); - p->p_rux.rux_runtime += (new_switchtime - PCPU_GET(switchtime)); - PCPU_SET(switchtime, new_switchtime); - PCPU_SET(switchticks, ticks); - PCPU_INC(cnt.v_swtch); - /* Save our resource usage in our process. */ - td->td_ru.ru_nvcsw++; - rucollect(&p->p_ru, &td->td_ru); /* * The last thread is left attached to the process * So that the whole bundle gets recycled. Skip @@ -467,7 +458,21 @@ thread_exit(void) PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_OUT); #endif PROC_UNLOCK(p); + + /* Do the same timestamp bookkeeping that mi_switch() would do. */ + new_switchtime = cpu_ticks(); + runtime = new_switchtime - PCPU_GET(switchtime); + td->td_runtime += runtime; + td->td_incruntime += runtime; + PCPU_SET(switchtime, new_switchtime); + PCPU_SET(switchticks, ticks); + PCPU_INC(cnt.v_swtch); + + /* Save our resource usage in our process. */ + td->td_ru.ru_nvcsw++; ruxagg(p, td); + rucollect(&p->p_ru, &td->td_ru); + thread_lock(td); PROC_SUNLOCK(p); td->td_state = TDS_INACTIVE; Modified: stable/9/sys/kern/sched_4bsd.c ============================================================================== --- stable/9/sys/kern/sched_4bsd.c Fri Jan 13 19:54:00 2012 (r230078) +++ stable/9/sys/kern/sched_4bsd.c Fri Jan 13 20:15:27 2012 (r230079) @@ -1571,14 +1571,14 @@ sched_throw(struct thread *td) if (td == NULL) { mtx_lock_spin(&sched_lock); spinlock_exit(); + PCPU_SET(switchtime, cpu_ticks()); + PCPU_SET(switchticks, ticks); } else { lock_profile_release_lock(&sched_lock.lock_object); MPASS(td->td_lock == &sched_lock); } mtx_assert(&sched_lock, MA_OWNED); KASSERT(curthread->td_md.md_spinlock_count == 1, ("invalid count")); - PCPU_SET(switchtime, cpu_ticks()); - PCPU_SET(switchticks, ticks); cpu_throw(td, choosethread()); /* doesn't return */ } Modified: stable/9/sys/kern/sched_ule.c ============================================================================== --- stable/9/sys/kern/sched_ule.c Fri Jan 13 19:54:00 2012 (r230078) +++ stable/9/sys/kern/sched_ule.c Fri Jan 13 20:15:27 2012 (r230079) @@ -2581,6 +2581,8 @@ sched_throw(struct thread *td) /* Correct spinlock nesting and acquire the correct lock. */ TDQ_LOCK(tdq); spinlock_exit(); + PCPU_SET(switchtime, cpu_ticks()); + PCPU_SET(switchticks, ticks); } else { MPASS(td->td_lock == TDQ_LOCKPTR(tdq)); tdq_load_rem(tdq, td); @@ -2589,8 +2591,6 @@ sched_throw(struct thread *td) KASSERT(curthread->td_md.md_spinlock_count == 1, ("invalid count")); newtd = choosethread(); TDQ_LOCKPTR(tdq)->mtx_lock = (uintptr_t)newtd; - PCPU_SET(switchtime, cpu_ticks()); - PCPU_SET(switchticks, ticks); cpu_throw(td, newtd); /* doesn't return */ } From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 20:15:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7DE91065673; Fri, 13 Jan 2012 20:15:49 +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 A815C8FC14; Fri, 13 Jan 2012 20:15: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 q0DKFnsW078561; Fri, 13 Jan 2012 20:15:49 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DKFnHP078557; Fri, 13 Jan 2012 20:15:49 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201132015.q0DKFnHP078557@svn.freebsd.org> From: John Baldwin Date: Fri, 13 Jan 2012 20:15:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230080 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 20:15:49 -0000 Author: jhb Date: Fri Jan 13 20:15:49 2012 New Revision: 230080 URL: http://svn.freebsd.org/changeset/base/230080 Log: MFC 229429: Some small fixes to CPU accounting for threads: - Only initialize the per-cpu switchticks and switchtime in sched_throw() for the very first context switch on APs during boot. This avoids a small gap between the middle of thread_exit() and sched_throw() where time is not accounted to any thread. - In thread_exit(), update the timestamp bookkeeping to track the changes to mi_switch() introduced by td_rux so that the code once again matches the comment claiming it is mimicing mi_switch(). Specifically, only update the per-thread stats directly and depend on ruxagg() to update p_rux rather than adjusting p_rux directly. While here, move the timestamp bookkeeping as late in the function as possible. Modified: stable/8/sys/kern/kern_thread.c stable/8/sys/kern/sched_4bsd.c stable/8/sys/kern/sched_ule.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/kern_thread.c ============================================================================== --- stable/8/sys/kern/kern_thread.c Fri Jan 13 20:15:27 2012 (r230079) +++ stable/8/sys/kern/kern_thread.c Fri Jan 13 20:15:49 2012 (r230080) @@ -333,7 +333,7 @@ thread_free(struct thread *td) void thread_exit(void) { - uint64_t new_switchtime; + uint64_t runtime, new_switchtime; struct thread *td; struct thread *td2; struct proc *p; @@ -362,15 +362,6 @@ thread_exit(void) */ cpu_thread_exit(td); /* XXXSMP */ - /* Do the same timestamp bookkeeping that mi_switch() would do. */ - new_switchtime = cpu_ticks(); - p->p_rux.rux_runtime += (new_switchtime - PCPU_GET(switchtime)); - PCPU_SET(switchtime, new_switchtime); - PCPU_SET(switchticks, ticks); - PCPU_INC(cnt.v_swtch); - /* Save our resource usage in our process. */ - td->td_ru.ru_nvcsw++; - rucollect(&p->p_ru, &td->td_ru); /* * The last thread is left attached to the process * So that the whole bundle gets recycled. Skip @@ -419,7 +410,21 @@ thread_exit(void) PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_OUT); #endif PROC_UNLOCK(p); + + /* Do the same timestamp bookkeeping that mi_switch() would do. */ + new_switchtime = cpu_ticks(); + runtime = new_switchtime - PCPU_GET(switchtime); + td->td_runtime += runtime; + td->td_incruntime += runtime; + PCPU_SET(switchtime, new_switchtime); + PCPU_SET(switchticks, ticks); + PCPU_INC(cnt.v_swtch); + + /* Save our resource usage in our process. */ + td->td_ru.ru_nvcsw++; ruxagg(p, td); + rucollect(&p->p_ru, &td->td_ru); + thread_lock(td); PROC_SUNLOCK(p); td->td_state = TDS_INACTIVE; Modified: stable/8/sys/kern/sched_4bsd.c ============================================================================== --- stable/8/sys/kern/sched_4bsd.c Fri Jan 13 20:15:27 2012 (r230079) +++ stable/8/sys/kern/sched_4bsd.c Fri Jan 13 20:15:49 2012 (r230080) @@ -1571,14 +1571,14 @@ sched_throw(struct thread *td) if (td == NULL) { mtx_lock_spin(&sched_lock); spinlock_exit(); + PCPU_SET(switchtime, cpu_ticks()); + PCPU_SET(switchticks, ticks); } else { lock_profile_release_lock(&sched_lock.lock_object); MPASS(td->td_lock == &sched_lock); } mtx_assert(&sched_lock, MA_OWNED); KASSERT(curthread->td_md.md_spinlock_count == 1, ("invalid count")); - PCPU_SET(switchtime, cpu_ticks()); - PCPU_SET(switchticks, ticks); cpu_throw(td, choosethread()); /* doesn't return */ } Modified: stable/8/sys/kern/sched_ule.c ============================================================================== --- stable/8/sys/kern/sched_ule.c Fri Jan 13 20:15:27 2012 (r230079) +++ stable/8/sys/kern/sched_ule.c Fri Jan 13 20:15:49 2012 (r230080) @@ -2585,6 +2585,8 @@ sched_throw(struct thread *td) /* Correct spinlock nesting and acquire the correct lock. */ TDQ_LOCK(tdq); spinlock_exit(); + PCPU_SET(switchtime, cpu_ticks()); + PCPU_SET(switchticks, ticks); } else { MPASS(td->td_lock == TDQ_LOCKPTR(tdq)); tdq_load_rem(tdq, td); @@ -2593,8 +2595,6 @@ sched_throw(struct thread *td) KASSERT(curthread->td_md.md_spinlock_count == 1, ("invalid count")); newtd = choosethread(); TDQ_LOCKPTR(tdq)->mtx_lock = (uintptr_t)newtd; - PCPU_SET(switchtime, cpu_ticks()); - PCPU_SET(switchticks, ticks); cpu_throw(td, newtd); /* doesn't return */ } From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 20:22:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AF2A106566B; Fri, 13 Jan 2012 20:22:58 +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 142A78FC0A; Fri, 13 Jan 2012 20:22: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 q0DKMvKu078836; Fri, 13 Jan 2012 20:22:57 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DKMvXc078834; Fri, 13 Jan 2012 20:22:57 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201132022.q0DKMvXc078834@svn.freebsd.org> From: John Baldwin Date: Fri, 13 Jan 2012 20:22:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230081 - stable/9/sys/modules/kgssapi_krb5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 20:22:58 -0000 Author: jhb Date: Fri Jan 13 20:22:57 2012 New Revision: 230081 URL: http://svn.freebsd.org/changeset/base/230081 Log: MFC 229519: Fix 'make clean' for this module so it cleans up the generated gssd.h. Modified: stable/9/sys/modules/kgssapi_krb5/Makefile Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/modules/kgssapi_krb5/Makefile ============================================================================== --- stable/9/sys/modules/kgssapi_krb5/Makefile Fri Jan 13 20:15:49 2012 (r230080) +++ stable/9/sys/modules/kgssapi_krb5/Makefile Fri Jan 13 20:22:57 2012 (r230081) @@ -13,6 +13,7 @@ SRCS= krb5_mech.c \ SRCS+= kgss_if.h gssd.h MFILES= kgssapi/kgss_if.m +CLEANFILES= gssd.h S= ${.CURDIR}/../.. From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 20:23:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86E691065678; Fri, 13 Jan 2012 20:23:18 +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 7168A8FC08; Fri, 13 Jan 2012 20:23: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 q0DKNIYE078881; Fri, 13 Jan 2012 20:23:18 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DKNIId078879; Fri, 13 Jan 2012 20:23:18 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201132023.q0DKNIId078879@svn.freebsd.org> From: John Baldwin Date: Fri, 13 Jan 2012 20:23:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230082 - stable/8/sys/modules/kgssapi_krb5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 20:23:18 -0000 Author: jhb Date: Fri Jan 13 20:23:18 2012 New Revision: 230082 URL: http://svn.freebsd.org/changeset/base/230082 Log: MFC 229519: Fix 'make clean' for this module so it cleans up the generated gssd.h. Modified: stable/8/sys/modules/kgssapi_krb5/Makefile Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/modules/kgssapi_krb5/Makefile ============================================================================== --- stable/8/sys/modules/kgssapi_krb5/Makefile Fri Jan 13 20:22:57 2012 (r230081) +++ stable/8/sys/modules/kgssapi_krb5/Makefile Fri Jan 13 20:23:18 2012 (r230082) @@ -13,6 +13,7 @@ SRCS= krb5_mech.c \ SRCS+= kgss_if.h gssd.h MFILES= kgssapi/kgss_if.m +CLEANFILES= gssd.h S= ${.CURDIR}/../.. From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 20:25:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A8671065673; Fri, 13 Jan 2012 20:25:39 +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 4550C8FC08; Fri, 13 Jan 2012 20:25: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 q0DKPd5A079015; Fri, 13 Jan 2012 20:25:39 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DKPddv079013; Fri, 13 Jan 2012 20:25:39 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201132025.q0DKPddv079013@svn.freebsd.org> From: John Baldwin Date: Fri, 13 Jan 2012 20:25:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230083 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 20:25:39 -0000 Author: jhb Date: Fri Jan 13 20:25:38 2012 New Revision: 230083 URL: http://svn.freebsd.org/changeset/base/230083 Log: MFC 228960: Cap the priority calculated from the current thread's running tick count at SCHED_PRI_RANGE to prevent overflows in the priority value. This can happen due to irregularities with clock interrupts under certain virtualization environments. Modified: stable/9/sys/kern/sched_ule.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/kern/sched_ule.c ============================================================================== --- stable/9/sys/kern/sched_ule.c Fri Jan 13 20:23:18 2012 (r230082) +++ stable/9/sys/kern/sched_ule.c Fri Jan 13 20:25:38 2012 (r230083) @@ -1429,7 +1429,8 @@ sched_priority(struct thread *td) } else { pri = SCHED_PRI_MIN; if (td->td_sched->ts_ticks) - pri += SCHED_PRI_TICKS(td->td_sched); + pri += min(SCHED_PRI_TICKS(td->td_sched), + SCHED_PRI_RANGE); pri += SCHED_PRI_NICE(td->td_proc->p_nice); KASSERT(pri >= PRI_MIN_BATCH && pri <= PRI_MAX_BATCH, ("sched_priority: invalid priority %d: nice %d, " From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 20:25:57 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17695106564A; Fri, 13 Jan 2012 20:25:57 +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 028398FC15; Fri, 13 Jan 2012 20:25: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 q0DKPuc2079059; Fri, 13 Jan 2012 20:25:56 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DKPuVn079057; Fri, 13 Jan 2012 20:25:56 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201132025.q0DKPuVn079057@svn.freebsd.org> From: John Baldwin Date: Fri, 13 Jan 2012 20:25:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230084 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 20:25:57 -0000 Author: jhb Date: Fri Jan 13 20:25:56 2012 New Revision: 230084 URL: http://svn.freebsd.org/changeset/base/230084 Log: MFC 228960: Cap the priority calculated from the current thread's running tick count at SCHED_PRI_RANGE to prevent overflows in the priority value. This can happen due to irregularities with clock interrupts under certain virtualization environments. Modified: stable/8/sys/kern/sched_ule.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/sched_ule.c ============================================================================== --- stable/8/sys/kern/sched_ule.c Fri Jan 13 20:25:38 2012 (r230083) +++ stable/8/sys/kern/sched_ule.c Fri Jan 13 20:25:56 2012 (r230084) @@ -1426,7 +1426,8 @@ sched_priority(struct thread *td) } else { pri = SCHED_PRI_MIN; if (td->td_sched->ts_ticks) - pri += SCHED_PRI_TICKS(td->td_sched); + pri += min(SCHED_PRI_TICKS(td->td_sched), + SCHED_PRI_RANGE); pri += SCHED_PRI_NICE(td->td_proc->p_nice); KASSERT(pri >= PRI_MIN_BATCH && pri <= PRI_MAX_BATCH, ("sched_priority: invalid priority %d: nice %d, " From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 20:28:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E528C106566C; Fri, 13 Jan 2012 20:28:11 +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 CF58F8FC1A; Fri, 13 Jan 2012 20:28:11 +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 q0DKSBVn079188; Fri, 13 Jan 2012 20:28:11 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DKSBx0079186; Fri, 13 Jan 2012 20:28:11 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201132028.q0DKSBx0079186@svn.freebsd.org> From: John Baldwin Date: Fri, 13 Jan 2012 20:28:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230085 - stable/9/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 20:28:12 -0000 Author: jhb Date: Fri Jan 13 20:28:11 2012 New Revision: 230085 URL: http://svn.freebsd.org/changeset/base/230085 Log: MFC 228961: Further relax the strictness of enforcing allocations to only come from decoded ranges. Pass any request for a specific range that fails because it is not in a decoded range for an ACPI Host-PCI bridge up to the parent to see if it can still be allocated. This is based on the assumption that many BIOSes are inconsistent/broken and that settings programmed into BARs or resources assigned to other built-in components are more trustworthy than the list of decoded resource ranges in _CRS. This effectively limits the decoded ranges to only being used for "wildcard" ranges when allocating fresh resources for a BAR, etc. At some point I would like to only be this permissive during an early scan of firmware-assigned resources during boot and to be strict about all later allocations, but that isn't viable currently. Modified: stable/9/sys/dev/acpica/acpi_pcib_acpi.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/dev/acpica/acpi_pcib_acpi.c ============================================================================== --- stable/9/sys/dev/acpica/acpi_pcib_acpi.c Fri Jan 13 20:25:56 2012 (r230084) +++ stable/9/sys/dev/acpica/acpi_pcib_acpi.c Fri Jan 13 20:28:11 2012 (r230085) @@ -511,8 +511,17 @@ acpi_pcib_acpi_alloc_resource(device_t d sc = device_get_softc(dev); res = pcib_host_res_alloc(&sc->ap_host_res, child, type, rid, start, end, count, flags); + + /* + * XXX: If this is a request for a specific range, assume it is + * correct and pass it up to the parent. What we probably want to + * do long-term is explicitly trust any firmware-configured + * resources during the initial bus scan on boot and then disable + * this after that. + */ if (res == NULL && start + count - 1 == end) - res = acpi_alloc_sysres(child, type, rid, start, end, count, flags); + res = bus_generic_alloc_resource(dev, child, type, rid, start, end, + count, flags); return (res); #else return (bus_generic_alloc_resource(dev, child, type, rid, start, end, From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 20:35:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7084E106566B; Fri, 13 Jan 2012 20:35:13 +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 504A58FC14; Fri, 13 Jan 2012 20:35: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 q0DKZDqr079490; Fri, 13 Jan 2012 20:35:13 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DKZDEm079487; Fri, 13 Jan 2012 20:35:13 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201132035.q0DKZDEm079487@svn.freebsd.org> From: John Baldwin Date: Fri, 13 Jan 2012 20:35:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230086 - stable/9/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 20:35:13 -0000 Author: jhb Date: Fri Jan 13 20:35:12 2012 New Revision: 230086 URL: http://svn.freebsd.org/changeset/base/230086 Log: MFC 229665,229672,229700: Remove the assertion from tcp_input() that rcv_nxt is always greater than or equal to rcv_adv and fix tcp_twstart() to handle this case by assuming the last window was zero rather than a negative value. The code in tcp_input() already safely handled this case. It can happen due to delayed ACKs along with a remote sender that sends data beyond the window we previously advertised. If we have room in our socket buffer for the extra data beyond the advertised window, we will accept it. However, if the ACK for that segment is delayed, then we will not effectively fixup rcv_adv to account for that extra data until the next segment arrives and forces out an ACK. When that next segment arrives, rcv_nxt will be beyond rcv_adv. Modified: stable/9/sys/netinet/tcp_input.c stable/9/sys/netinet/tcp_timewait.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/netinet/tcp_input.c ============================================================================== --- stable/9/sys/netinet/tcp_input.c Fri Jan 13 20:28:11 2012 (r230085) +++ stable/9/sys/netinet/tcp_input.c Fri Jan 13 20:35:12 2012 (r230086) @@ -1826,9 +1826,6 @@ tcp_do_segment(struct mbuf *m, struct tc win = sbspace(&so->so_rcv); if (win < 0) win = 0; - KASSERT(SEQ_GEQ(tp->rcv_adv, tp->rcv_nxt), - ("tcp_input negative window: tp %p rcv_nxt %u rcv_adv %u", tp, - tp->rcv_nxt, tp->rcv_adv)); tp->rcv_wnd = imax(win, (int)(tp->rcv_adv - tp->rcv_nxt)); /* Reset receive buffer auto scaling when not in bulk receive mode. */ Modified: stable/9/sys/netinet/tcp_timewait.c ============================================================================== --- stable/9/sys/netinet/tcp_timewait.c Fri Jan 13 20:28:11 2012 (r230085) +++ stable/9/sys/netinet/tcp_timewait.c Fri Jan 13 20:35:12 2012 (r230086) @@ -242,10 +242,10 @@ tcp_twstart(struct tcpcb *tp) /* * Recover last window size sent. */ - KASSERT(SEQ_GEQ(tp->rcv_adv, tp->rcv_nxt), - ("tcp_twstart negative window: tp %p rcv_nxt %u rcv_adv %u", tp, - tp->rcv_nxt, tp->rcv_adv)); - tw->last_win = (tp->rcv_adv - tp->rcv_nxt) >> tp->rcv_scale; + if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt)) + tw->last_win = (tp->rcv_adv - tp->rcv_nxt) >> tp->rcv_scale; + else + tw->last_win = 0; /* * Set t_recent if timestamps are used on the connection. From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 20:35:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3C6F106564A; Fri, 13 Jan 2012 20:35: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 83CEC8FC12; Fri, 13 Jan 2012 20:35: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 q0DKZhJ5079543; Fri, 13 Jan 2012 20:35:43 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DKZh80079540; Fri, 13 Jan 2012 20:35:43 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201132035.q0DKZh80079540@svn.freebsd.org> From: John Baldwin Date: Fri, 13 Jan 2012 20:35:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230087 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 20:35:44 -0000 Author: jhb Date: Fri Jan 13 20:35:43 2012 New Revision: 230087 URL: http://svn.freebsd.org/changeset/base/230087 Log: MFC 221891,229665,229672,229700: Remove the assertion from tcp_input() that rcv_nxt is always greater than or equal to rcv_adv and fix tcp_twstart() to handle this case by assuming the last window was zero rather than a negative value. The code in tcp_input() already safely handled this case. It can happen due to delayed ACKs along with a remote sender that sends data beyond the window we previously advertised. If we have room in our socket buffer for the extra data beyond the advertised window, we will accept it. However, if the ACK for that segment is delayed, then we will not effectively fixup rcv_adv to account for that extra data until the next segment arrives and forces out an ACK. When that next segment arrives, rcv_nxt will be beyond rcv_adv. Modified: stable/8/sys/netinet/tcp_input.c stable/8/sys/netinet/tcp_timewait.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/netinet/tcp_input.c ============================================================================== --- stable/8/sys/netinet/tcp_input.c Fri Jan 13 20:35:12 2012 (r230086) +++ stable/8/sys/netinet/tcp_input.c Fri Jan 13 20:35:43 2012 (r230087) @@ -1776,9 +1776,6 @@ tcp_do_segment(struct mbuf *m, struct tc win = sbspace(&so->so_rcv); if (win < 0) win = 0; - KASSERT(SEQ_GEQ(tp->rcv_adv, tp->rcv_nxt), - ("tcp_input negative window: tp %p rcv_nxt %u rcv_adv %u", tp, - tp->rcv_adv, tp->rcv_nxt)); tp->rcv_wnd = imax(win, (int)(tp->rcv_adv - tp->rcv_nxt)); /* Reset receive buffer auto scaling when not in bulk receive mode. */ Modified: stable/8/sys/netinet/tcp_timewait.c ============================================================================== --- stable/8/sys/netinet/tcp_timewait.c Fri Jan 13 20:35:12 2012 (r230086) +++ stable/8/sys/netinet/tcp_timewait.c Fri Jan 13 20:35:43 2012 (r230087) @@ -228,10 +228,10 @@ tcp_twstart(struct tcpcb *tp) /* * Recover last window size sent. */ - KASSERT(SEQ_GEQ(tp->rcv_adv, tp->rcv_nxt), - ("tcp_twstart negative window: tp %p rcv_nxt %u rcv_adv %u", tp, - tp->rcv_adv, tp->rcv_nxt)); - tw->last_win = (tp->rcv_adv - tp->rcv_nxt) >> tp->rcv_scale; + if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt)) + tw->last_win = (tp->rcv_adv - tp->rcv_nxt) >> tp->rcv_scale; + else + tw->last_win = 0; /* * Set t_recent if timestamps are used on the connection. From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 20:50:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7A54106566B; Fri, 13 Jan 2012 20:50:18 +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 A14CB8FC0C; Fri, 13 Jan 2012 20:50: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 q0DKoItM080016; Fri, 13 Jan 2012 20:50:18 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DKoI2H080014; Fri, 13 Jan 2012 20:50:18 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201201132050.q0DKoI2H080014@svn.freebsd.org> From: Hiroki Sato Date: Fri, 13 Jan 2012 20:50:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230088 - stable/9/release/doc/en_US.ISO8859-1/errata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 20:50:18 -0000 Author: hrs Date: Fri Jan 13 20:50:18 2012 New Revision: 230088 URL: http://svn.freebsd.org/changeset/base/230088 Log: Add an open issue and workaround about possible device detection failure on FreeBSD/{amd64,i386}. Modified: stable/9/release/doc/en_US.ISO8859-1/errata/article.sgml Modified: stable/9/release/doc/en_US.ISO8859-1/errata/article.sgml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/errata/article.sgml Fri Jan 13 20:35:43 2012 (r230087) +++ stable/9/release/doc/en_US.ISO8859-1/errata/article.sgml Fri Jan 13 20:50:18 2012 (r230088) @@ -225,6 +225,23 @@ fixed by a change in Errata Notice EN-12:01. For more information, see + + &os; &release.current; includes several + changes to improve resource management of PCI devices. Some x86 + machines may not boot or may have devices that no longer attach + when using ACPI as a result of these changes. This can be + worked around by setting a &man.loader.8; tunable + debug.acpi.disabled to + hostres. To do this, enter the following + lines at the loader prompt: + + set debug.acpi.disabled="hostres" +boot + + Or, put the following line into + /boot/loader.conf: + + debug.acpi.disabled="hostres" From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 21:14:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A61F1065673; Fri, 13 Jan 2012 21:14:17 +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 609E78FC19; Fri, 13 Jan 2012 21:14:17 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id F1BC146B23; Fri, 13 Jan 2012 16:14:16 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 75BA3B915; Fri, 13 Jan 2012 16:14:16 -0500 (EST) From: John Baldwin To: Hiroki Sato Date: Fri, 13 Jan 2012 16:12:39 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201201132050.q0DKoI2H080014@svn.freebsd.org> In-Reply-To: <201201132050.q0DKoI2H080014@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201201131612.39632.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 13 Jan 2012 16:14:16 -0500 (EST) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org Subject: Re: svn commit: r230088 - stable/9/release/doc/en_US.ISO8859-1/errata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 21:14:17 -0000 On Friday, January 13, 2012 3:50:18 pm Hiroki Sato wrote: > Author: hrs > Date: Fri Jan 13 20:50:18 2012 > New Revision: 230088 > URL: http://svn.freebsd.org/changeset/base/230088 > > Log: > Add an open issue and workaround about possible device detection failure on > FreeBSD/{amd64,i386}. Thanks! -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 22:16:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDC6D106566B; Fri, 13 Jan 2012 22:16:47 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B203E8FC08; Fri, 13 Jan 2012 22:16: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 q0DMGlib082561; Fri, 13 Jan 2012 22:16:47 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DMGlFO082558; Fri, 13 Jan 2012 22:16:47 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201201132216.q0DMGlFO082558@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 13 Jan 2012 22:16: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: r230089 - in head/usr.sbin/acpi: acpidb iasl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 22:16:48 -0000 Author: jkim Date: Fri Jan 13 22:16:47 2012 New Revision: 230089 URL: http://svn.freebsd.org/changeset/base/230089 Log: Remove unused ACPICA sources from userland makefiles. Modified: head/usr.sbin/acpi/acpidb/Makefile head/usr.sbin/acpi/iasl/Makefile Modified: head/usr.sbin/acpi/acpidb/Makefile ============================================================================== --- head/usr.sbin/acpi/acpidb/Makefile Fri Jan 13 20:50:18 2012 (r230088) +++ head/usr.sbin/acpi/acpidb/Makefile Fri Jan 13 22:16:47 2012 (r230089) @@ -15,7 +15,7 @@ SRCS+= dmbuffer.c dmnames.c dmobject.c d # events SRCS+= evevent.c evglock.c evgpe.c evgpeblk.c evgpeinit.c \ evgpeutil.c evmisc.c evregion.c evrgnini.c evsci.c \ - evxface.c evxfevnt.c evxfgpe.c evxfregn.c + evxface.c evxfevnt.c evxfregn.c # hardware SRCS+= hwacpi.c hwgpe.c hwpci.c hwregs.c hwsleep.c hwvalid.c \ @@ -52,8 +52,7 @@ SRCS+= rsaddr.c rscalc.c rscreate.c rsdu rsserial.c rsutils.c rsxface.c # tables -SRCS+= tbfadt.c tbfind.c tbinstal.c tbutils.c tbxface.c \ - tbxfroot.c +SRCS+= tbfadt.c tbfind.c tbinstal.c tbutils.c tbxface.c # utilities SRCS+= utaddress.c utalloc.c utcache.c utcopy.c utdebug.c \ Modified: head/usr.sbin/acpi/iasl/Makefile ============================================================================== --- head/usr.sbin/acpi/iasl/Makefile Fri Jan 13 20:50:18 2012 (r230088) +++ head/usr.sbin/acpi/iasl/Makefile Fri Jan 13 22:16:47 2012 (r230089) @@ -26,8 +26,8 @@ SRCS+= aslanalyze.c aslbtypes.c aslcodeg SRCS+= dbfileio.c # disassembler -SRCS+= dmbuffer.c dmnames.c dmobject.c dmopcode.c dmresrc.c \ - dmresrcl.c dmresrcl2.c dmresrcs.c dmutils.c dmwalk.c +SRCS+= dmbuffer.c dmnames.c dmopcode.c dmresrc.c dmresrcl.c \ + dmresrcl2.c dmresrcs.c dmutils.c dmwalk.c # interpreter/dispatcher SRCS+= dsargs.c dscontrol.c dsfield.c dsobject.c dsopcode.c \ @@ -37,8 +37,8 @@ SRCS+= dsargs.c dscontrol.c dsfield.c ds # interpreter/executer SRCS+= exconvrt.c excreate.c exdump.c exmisc.c exmutex.c \ exnames.c exoparg1.c exoparg2.c exoparg3.c exoparg6.c \ - exprep.c exregion.c exresnte.c exresolv.c exresop.c \ - exstore.c exstoren.c exstorob.c exsystem.c exutils.c + exprep.c exresnte.c exresolv.c exresop.c exstore.c \ + exstoren.c exstorob.c exsystem.c exutils.c # interpreter/parser SRCS+= psargs.c psloop.c psopcode.c psparse.c psscope.c \ @@ -46,7 +46,7 @@ SRCS+= psargs.c psloop.c psopcode.c pspa # namespace SRCS+= nsaccess.c nsalloc.c nsdump.c nsnames.c nsobject.c \ - nsparse.c nssearch.c nsutils.c nswalk.c nsxfobj.c + nsparse.c nssearch.c nsutils.c nswalk.c # os_specific/service_layers SRCS+= osunixxf.c @@ -57,8 +57,8 @@ SRCS+= tbfadt.c tbinstal.c tbutils.c tbx # utilities SRCS+= utaddress.c utalloc.c utcache.c utcopy.c utdebug.c \ utdecode.c utdelete.c utglobal.c utinit.c utlock.c \ - utmath.c utmisc.c utmutex.c utobject.c utosi.c \ - utresrc.c utstate.c utxface.c utxferror.c + utmath.c utmisc.c utmutex.c utobject.c utresrc.c \ + utstate.c utxface.c utxferror.c WARNS?= 2 From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 22:19:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06AA41065672; Fri, 13 Jan 2012 22:19:15 +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 E99CD8FC13; Fri, 13 Jan 2012 22:19: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 q0DMJEKl082667; Fri, 13 Jan 2012 22:19:14 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DMJEKo082665; Fri, 13 Jan 2012 22:19:14 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201201132219.q0DMJEKo082665@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 13 Jan 2012 22:19: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: r230090 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 22:19:15 -0000 Author: hselasky Date: Fri Jan 13 22:19:14 2012 New Revision: 230090 URL: http://svn.freebsd.org/changeset/base/230090 Log: Bugfix: Make sure the XHCI driver doesn't clear the route string field. Else USB 3.0 HUBs won't work. MFC after: 5 days Modified: head/sys/dev/usb/controller/xhci.c Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Fri Jan 13 22:16:47 2012 (r230089) +++ head/sys/dev/usb/controller/xhci.c Fri Jan 13 22:19:14 2012 (r230090) @@ -2264,7 +2264,7 @@ xhci_configure_device(struct usb_device temp |= XHCI_SCTX_0_CTX_NUM_SET(XHCI_MAX_ENDPOINTS - 1); break; default: - temp = XHCI_SCTX_0_CTX_NUM_SET(1); + temp |= XHCI_SCTX_0_CTX_NUM_SET(1); break; } From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 22:26:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27E84106564A; Fri, 13 Jan 2012 22:26:14 +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 0B4D78FC08; Fri, 13 Jan 2012 22:26: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 q0DMQDGB082919; Fri, 13 Jan 2012 22:26:13 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DMQDZC082916; Fri, 13 Jan 2012 22:26:13 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201201132226.q0DMQDZC082916@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 13 Jan 2012 22:26: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: r230091 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 22:26:14 -0000 Author: hselasky Date: Fri Jan 13 22:26:13 2012 New Revision: 230091 URL: http://svn.freebsd.org/changeset/base/230091 Log: Improve support for USB 3.0 HUBs. In certain states we should do a warm reset instead of the default reset. MFC after: 5 days Modified: head/sys/dev/usb/usb_hub.c head/sys/dev/usb/usb_request.c Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Fri Jan 13 22:19:14 2012 (r230090) +++ head/sys/dev/usb/usb_hub.c Fri Jan 13 22:26:13 2012 (r230091) @@ -627,14 +627,15 @@ uhub_suspend_resume_port(struct uhub_sof } } else { switch (UPS_PORT_LINK_STATE_GET(sc->sc_st.port_status)) { - case UPS_PORT_LS_U0: - case UPS_PORT_LS_U1: - case UPS_PORT_LS_U2: - case UPS_PORT_LS_RESUME: + case UPS_PORT_LS_U3: + is_suspend = 1; + break; + case UPS_PORT_LS_SS_INA: + usbd_req_warm_reset_port(udev, NULL, portno); is_suspend = 0; break; default: - is_suspend = 1; + is_suspend = 0; break; } } @@ -793,7 +794,8 @@ uhub_explore(struct usb_device *udev) break; } } - if (sc->sc_st.port_change & (UPS_C_SUSPEND | UPS_C_PORT_LINK_STATE)) { + if (sc->sc_st.port_change & (UPS_C_SUSPEND | + UPS_C_PORT_LINK_STATE)) { err = uhub_suspend_resume_port(sc, portno); if (err) { /* most likely the HUB is gone */ Modified: head/sys/dev/usb/usb_request.c ============================================================================== --- head/sys/dev/usb/usb_request.c Fri Jan 13 22:19:14 2012 (r230090) +++ head/sys/dev/usb/usb_request.c Fri Jan 13 22:26:13 2012 (r230091) @@ -785,12 +785,17 @@ usbd_req_reset_port(struct usb_device *u struct usb_port_status ps; usb_error_t err; uint16_t n; + uint16_t status; + uint16_t change; #ifdef USB_DEBUG uint16_t pr_poll_delay; uint16_t pr_recovery_delay; #endif + + DPRINTF("\n"); + /* clear any leftover port reset changes first */ usbd_req_clear_port_feature( udev, mtx, port, UHF_C_PORT_RESET); @@ -817,9 +822,6 @@ usbd_req_reset_port(struct usb_device *u #endif n = 0; while (1) { - uint16_t status; - uint16_t change; - #ifdef USB_DEBUG /* wait for the device to recover from reset */ usb_pause_mtx(mtx, USB_MS_TO_TICKS(pr_poll_delay)); @@ -830,9 +832,9 @@ usbd_req_reset_port(struct usb_device *u n += USB_PORT_RESET_DELAY; #endif err = usbd_req_get_port_status(udev, mtx, &ps, port); - if (err) { + if (err) goto done; - } + status = UGETW(ps.wPortStatus); change = UGETW(ps.wPortChange); @@ -862,9 +864,9 @@ usbd_req_reset_port(struct usb_device *u /* clear port reset first */ err = usbd_req_clear_port_feature( udev, mtx, port, UHF_C_PORT_RESET); - if (err) { + if (err) goto done; - } + /* check for timeout */ if (n == 0) { err = USB_ERR_TIMEOUT; @@ -898,21 +900,50 @@ done: * disabled. *------------------------------------------------------------------------*/ usb_error_t -usbd_req_warm_reset_port(struct usb_device *udev, struct mtx *mtx, uint8_t port) +usbd_req_warm_reset_port(struct usb_device *udev, struct mtx *mtx, + uint8_t port) { struct usb_port_status ps; usb_error_t err; uint16_t n; + uint16_t status; + uint16_t change; #ifdef USB_DEBUG uint16_t pr_poll_delay; uint16_t pr_recovery_delay; #endif - err = usbd_req_set_port_feature(udev, mtx, port, UHF_BH_PORT_RESET); - if (err) { + + DPRINTF("\n"); + + err = usbd_req_get_port_status(udev, mtx, &ps, port); + if (err) goto done; + + status = UGETW(ps.wPortStatus); + + switch (UPS_PORT_LINK_STATE_GET(status)) { + case UPS_PORT_LS_U3: + case UPS_PORT_LS_COMP_MODE: + case UPS_PORT_LS_LOOPBACK: + case UPS_PORT_LS_SS_INA: + break; + default: + DPRINTF("Wrong state for warm reset\n"); + return (0); } + + /* clear any leftover warm port reset changes first */ + usbd_req_clear_port_feature(udev, mtx, + port, UHF_C_BH_PORT_RESET); + + /* set warm port reset */ + err = usbd_req_set_port_feature(udev, mtx, + port, UHF_BH_PORT_RESET); + if (err) + goto done; + #ifdef USB_DEBUG /* range check input parameters */ pr_poll_delay = usb_pr_poll_delay; @@ -938,17 +969,20 @@ usbd_req_warm_reset_port(struct usb_devi n += USB_PORT_RESET_DELAY; #endif err = usbd_req_get_port_status(udev, mtx, &ps, port); - if (err) { + if (err) goto done; - } + + status = UGETW(ps.wPortStatus); + change = UGETW(ps.wPortChange); + /* if the device disappeared, just give up */ - if (!(UGETW(ps.wPortStatus) & UPS_CURRENT_CONNECT_STATUS)) { + if (!(status & UPS_CURRENT_CONNECT_STATUS)) goto done; - } + /* check if reset is complete */ - if (UGETW(ps.wPortChange) & UPS_C_BH_PORT_RESET) { + if (change & UPS_C_BH_PORT_RESET) break; - } + /* check for timeout */ if (n > 1000) { n = 0; @@ -959,9 +993,9 @@ usbd_req_warm_reset_port(struct usb_devi /* clear port reset first */ err = usbd_req_clear_port_feature( udev, mtx, port, UHF_C_BH_PORT_RESET); - if (err) { + if (err) goto done; - } + /* check for timeout */ if (n == 0) { err = USB_ERR_TIMEOUT; @@ -2004,6 +2038,10 @@ retry: } } + /* Try to warm reset first */ + if (parent_hub->speed == USB_SPEED_SUPER) + usbd_req_warm_reset_port(parent_hub, mtx, udev->port_no); + /* Try to reset the parent HUB port. */ err = usbd_req_reset_port(parent_hub, mtx, udev->port_no); if (err) { From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 22:48:48 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67AD6106566B; Fri, 13 Jan 2012 22:48:48 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id D6FEF8FC15; Fri, 13 Jan 2012 22:48:47 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q0DMmkgZ015908; Sat, 14 Jan 2012 02:48:46 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q0DMmkqi015907; Sat, 14 Jan 2012 02:48:46 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sat, 14 Jan 2012 02:48:46 +0400 From: Gleb Smirnoff To: Ermal Lu?i Message-ID: <20120113224846.GR74141@FreeBSD.org> References: <201201090850.q098oNme031479@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: 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: r229850 - in head: etc/rc.d sys/contrib/pf/net sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 22:48:48 -0000 On Fri, Jan 13, 2012 at 11:34:15PM +0100, Ermal Lu?i wrote: E> You ARE testing this right? Sure. E> Since you removed code that you do not actually mention at all in the E> commit message!!! What code are you worried about? E> On Mon, Jan 9, 2012 at 9:50 AM, Gleb Smirnoff wrote: E> E> > Author: glebius E> > Date: Mon Jan 9 08:50:22 2012 E> > New Revision: 229850 E> > URL: http://svn.freebsd.org/changeset/base/229850 E> > E> > Log: E> > Bunch of fixes to pfsync(4) module load/unload: E> > E> > o Make the pfsync.ko actually usable. Before this change loading it E> > didn't register protosw, so was a nop. However, a module /boot/kernel E> > did confused users. E> > o Rewrite the way we are joining multicast group: E> > - Move multicast initialization/destruction to separate functions. E> > - Don't allocate memory if we aren't going to join a multicast group. E> > - Use modern API for joining/leaving multicast group. E> > - Now the utterly wrong pfsync_ifdetach() isn't needed. E> > o Move module initialization from SYSINIT(9) to moduledata_t method. E> > o Refuse to unload module, unless asked forcibly. E> > o Improve a bit some FreeBSD porting code: E> > - Use separate malloc type. E> > - Simplify swi sheduling. E> > E> > This change is probably wrong from VIMAGE viewpoint, however pfsync E> > wasn't VIMAGE-correct before this change, too. E> > E> > Glanced at by: bz -- Totus tuus, Glebius. From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 22:57:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41FB61065680; Fri, 13 Jan 2012 22:57:44 +0000 (UTC) (envelope-from ermal.luci@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id E21CD8FC17; Fri, 13 Jan 2012 22:57:43 +0000 (UTC) Received: by iagz16 with SMTP id z16so290501iag.13 for ; Fri, 13 Jan 2012 14:57:43 -0800 (PST) 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=MsdiUp0jx5jjF9au0Vjf5qb4fYmuEwD+ZIPf/l7KDDU=; b=Yq7cWZPCghj8nxLPn7zYYCWJkWCb6XT1fpo/BjDCOYQT3PbMHeYLNWc4Cyh8ZWRjE+ xe+U+wXnzTJ10gA9KZ7P1mFaBdAl3LCZLzFbrxCNv4l4TncXP7Q6exigXEDNKQTB/vCV nQ1d4DZH9h5D9f90XqF+oowjo0/UU54j9qilI= MIME-Version: 1.0 Received: by 10.50.153.133 with SMTP id vg5mr1633745igb.8.1326494055055; Fri, 13 Jan 2012 14:34:15 -0800 (PST) Sender: ermal.luci@gmail.com Received: by 10.231.119.82 with HTTP; Fri, 13 Jan 2012 14:34:15 -0800 (PST) In-Reply-To: <201201090850.q098oNme031479@svn.freebsd.org> References: <201201090850.q098oNme031479@svn.freebsd.org> Date: Fri, 13 Jan 2012 23:34:15 +0100 X-Google-Sender-Auth: WqD_QL8-BrVQESl6r_Ki2fYJFBI Message-ID: From: =?ISO-8859-1?Q?Ermal_Lu=E7i?= To: Gleb Smirnoff 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: r229850 - in head: etc/rc.d sys/contrib/pf/net sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 22:57:44 -0000 You ARE testing this right? Since you removed code that you do not actually mention at all in the commit message!!! On Mon, Jan 9, 2012 at 9:50 AM, Gleb Smirnoff wrote: > Author: glebius > Date: Mon Jan 9 08:50:22 2012 > New Revision: 229850 > URL: http://svn.freebsd.org/changeset/base/229850 > > Log: > Bunch of fixes to pfsync(4) module load/unload: > > o Make the pfsync.ko actually usable. Before this change loading it > didn't register protosw, so was a nop. However, a module /boot/kernel > did confused users. > o Rewrite the way we are joining multicast group: > - Move multicast initialization/destruction to separate functions. > - Don't allocate memory if we aren't going to join a multicast group. > - Use modern API for joining/leaving multicast group. > - Now the utterly wrong pfsync_ifdetach() isn't needed. > o Move module initialization from SYSINIT(9) to moduledata_t method. > o Refuse to unload module, unless asked forcibly. > o Improve a bit some FreeBSD porting code: > - Use separate malloc type. > - Simplify swi sheduling. > > This change is probably wrong from VIMAGE viewpoint, however pfsync > wasn't VIMAGE-correct before this change, too. > > Glanced at by: bz > > Modified: > head/etc/rc.d/pfsync > head/sys/contrib/pf/net/if_pfsync.c > head/sys/netinet/in_proto.c > > Modified: head/etc/rc.d/pfsync > > ============================================================================== > --- head/etc/rc.d/pfsync Mon Jan 9 08:36:12 2012 (r229849) > +++ head/etc/rc.d/pfsync Mon Jan 9 08:50:22 2012 (r229850) > @@ -18,13 +18,6 @@ required_modules="pf" > > pfsync_prestart() > { > - # XXX Currently pfsync cannot be a module as it must register > - # a network protocol in a static kernel table. > - if ! kldstat -q -m pfsync; then > - warn "pfsync(4) must be statically compiled in the kernel." > - return 1 > - fi > - > case "$pfsync_syncdev" in > '') > warn "pfsync_syncdev is not set." > > Modified: head/sys/contrib/pf/net/if_pfsync.c > > ============================================================================== > --- head/sys/contrib/pf/net/if_pfsync.c Mon Jan 9 08:36:12 2012 > (r229849) > +++ head/sys/contrib/pf/net/if_pfsync.c Mon Jan 9 08:50:22 2012 > (r229850) > @@ -87,6 +87,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #else > #include > #include > @@ -295,21 +296,25 @@ struct pfsync_softc { > #else > struct timeout sc_tmo; > #endif > -#ifdef __FreeBSD__ > - eventhandler_tag sc_detachtag; > -#endif > - > }; > > #ifdef __FreeBSD__ > +static MALLOC_DEFINE(M_PFSYNC, "pfsync", "pfsync data"); > static VNET_DEFINE(struct pfsync_softc *, pfsyncif) = NULL; > #define V_pfsyncif VNET(pfsyncif) > - > +static VNET_DEFINE(void *, pfsync_swi_cookie) = NULL; > +#define V_pfsync_swi_cookie VNET(pfsync_swi_cookie) > static VNET_DEFINE(struct pfsyncstats, pfsyncstats); > #define V_pfsyncstats VNET(pfsyncstats) > static VNET_DEFINE(int, pfsync_carp_adj) = CARP_MAXSKEW; > #define V_pfsync_carp_adj VNET(pfsync_carp_adj) > > +static void pfsyncintr(void *); > +static int pfsync_multicast_setup(struct pfsync_softc *); > +static void pfsync_multicast_cleanup(struct pfsync_softc *); > +static int pfsync_init(void); > +static void pfsync_uninit(void); > + > SYSCTL_NODE(_net, OID_AUTO, pfsync, CTLFLAG_RW, 0, "PFSYNC"); > SYSCTL_VNET_STRUCT(_net_pfsync, OID_AUTO, stats, CTLFLAG_RW, > &VNET_NAME(pfsyncstats), pfsyncstats, > @@ -322,16 +327,6 @@ struct pfsyncstats pfsyncstats; > #define V_pfsyncstats pfsyncstats > #endif > > -#ifdef __FreeBSD__ > -static void pfsyncintr(void *); > -struct pfsync_swi { > - void * pfsync_swi_cookie; > -}; > -static struct pfsync_swi pfsync_swi; > -#define schednetisr(p) swi_sched(pfsync_swi.pfsync_swi_cookie, 0) > -#define NETISR_PFSYNC > -#endif > - > void pfsyncattach(int); > #ifdef __FreeBSD__ > int pfsync_clone_create(struct if_clone *, int, caddr_t); > @@ -377,8 +372,6 @@ void pfsync_bulk_update(void *); > void pfsync_bulk_fail(void *); > > #ifdef __FreeBSD__ > -void pfsync_ifdetach(void *, struct ifnet *); > - > /* XXX: ugly */ > #define betoh64 (unsigned long long)be64toh > #define timeout_del callout_stop > @@ -390,6 +383,10 @@ int pfsync_sync_ok; > #endif > > #ifdef __FreeBSD__ > +VNET_DEFINE(struct ifc_simple_data, pfsync_cloner_data); > +VNET_DEFINE(struct if_clone, pfsync_cloner); > +#define V_pfsync_cloner_data VNET(pfsync_cloner_data) > +#define V_pfsync_cloner VNET(pfsync_cloner) > IFC_SIMPLE_DECLARE(pfsync, 1); > #else > struct if_clone pfsync_cloner = > @@ -415,25 +412,20 @@ pfsync_clone_create(struct if_clone *ifc > if (unit != 0) > return (EINVAL); > > -#ifndef __FreeBSD__ > +#ifdef __FreeBSD__ > + sc = malloc(sizeof(struct pfsync_softc), M_PFSYNC, M_WAITOK | > M_ZERO); > + sc->pfsync_sync_ok = 1; > +#else > pfsync_sync_ok = 1; > + sc = malloc(sizeof(*pfsyncif), M_DEVBUF, M_NOWAIT | M_ZERO); > #endif > > - sc = malloc(sizeof(struct pfsync_softc), M_DEVBUF, M_NOWAIT | > M_ZERO); > - if (sc == NULL) > - return (ENOMEM); > - > for (q = 0; q < PFSYNC_S_COUNT; q++) > TAILQ_INIT(&sc->sc_qs[q]); > > #ifdef __FreeBSD__ > - sc->pfsync_sync_ok = 1; > - sc->sc_pool = uma_zcreate("pfsync", PFSYNC_PLSIZE, > - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); > - if (sc->sc_pool == NULL) { > - free(sc, M_DEVBUF); > - return (ENOMEM); > - } > + sc->sc_pool = uma_zcreate("pfsync", PFSYNC_PLSIZE, NULL, NULL, > NULL, > + NULL, UMA_ALIGN_PTR, 0); > #else > pool_init(&sc->sc_pool, PFSYNC_PLSIZE, 0, 0, 0, "pfsync", NULL); > #endif > @@ -446,13 +438,7 @@ pfsync_clone_create(struct if_clone *ifc > sc->sc_len = PFSYNC_MINPKT; > sc->sc_maxupdates = 128; > > -#ifdef __FreeBSD__ > - sc->sc_imo.imo_membership = (struct in_multi **)malloc( > - (sizeof(struct in_multi *) * IP_MIN_MEMBERSHIPS), M_DEVBUF, > - M_NOWAIT | M_ZERO); > - sc->sc_imo.imo_max_memberships = IP_MIN_MEMBERSHIPS; > - sc->sc_imo.imo_multicast_vif = -1; > -#else > +#ifndef __FreeBSD__ > sc->sc_imo.imo_membership = (struct in_multi **)malloc( > (sizeof(struct in_multi *) * IP_MIN_MEMBERSHIPS), M_IPMOPTS, > M_WAITOK | M_ZERO); > @@ -462,26 +448,11 @@ pfsync_clone_create(struct if_clone *ifc > #ifdef __FreeBSD__ > ifp = sc->sc_ifp = if_alloc(IFT_PFSYNC); > if (ifp == NULL) { > - free(sc->sc_imo.imo_membership, M_DEVBUF); > uma_zdestroy(sc->sc_pool); > - free(sc, M_DEVBUF); > + free(sc, M_PFSYNC); > return (ENOSPC); > } > if_initname(ifp, ifc->ifc_name, unit); > - > - sc->sc_detachtag = EVENTHANDLER_REGISTER(ifnet_departure_event, > -#ifdef __FreeBSD__ > - pfsync_ifdetach, V_pfsyncif, EVENTHANDLER_PRI_ANY); > -#else > - pfsync_ifdetach, pfsyncif, EVENTHANDLER_PRI_ANY); > -#endif > - if (sc->sc_detachtag == NULL) { > - if_free(ifp); > - free(sc->sc_imo.imo_membership, M_DEVBUF); > - uma_zdestroy(sc->sc_pool); > - free(sc, M_DEVBUF); > - return (ENOSPC); > - } > #else > ifp = &sc->sc_if; > snprintf(ifp->if_xname, sizeof ifp->if_xname, "pfsync%d", unit); > @@ -540,7 +511,6 @@ pfsync_clone_destroy(struct ifnet *ifp) > struct pfsync_softc *sc = ifp->if_softc; > > #ifdef __FreeBSD__ > - EVENTHANDLER_DEREGISTER(ifnet_departure_event, sc->sc_detachtag); > PF_LOCK(); > #endif > timeout_del(&sc->sc_bulkfail_tmo); > @@ -573,11 +543,13 @@ pfsync_clone_destroy(struct ifnet *ifp) > #endif > #ifdef __FreeBSD__ > if_free(ifp); > - free(sc->sc_imo.imo_membership, M_DEVBUF); > + if (sc->sc_imo.imo_membership) > + pfsync_multicast_cleanup(sc); > + free(sc, M_PFSYNC); > #else > free(sc->sc_imo.imo_membership, M_IPMOPTS); > -#endif > free(sc, M_DEVBUF); > +#endif > > #ifdef __FreeBSD__ > V_pfsyncif = NULL; > @@ -1886,12 +1858,15 @@ pfsyncioctl(struct ifnet *ifp, u_long cm > sc->sc_sync_if = NULL; > #ifdef __FreeBSD__ > PF_UNLOCK(); > -#endif > + if (imo->imo_membership) > + pfsync_multicast_cleanup(sc); > +#else > if (imo->imo_num_memberships > 0) { > in_delmulti(imo->imo_membership[ > --imo->imo_num_memberships]); > imo->imo_multicast_ifp = NULL; > } > +#endif > break; > } > > @@ -1916,57 +1891,53 @@ pfsyncioctl(struct ifnet *ifp, u_long cm > pfsync_sendout(); > sc->sc_sync_if = sifp; > > - if (imo->imo_num_memberships > 0) { > #ifdef __FreeBSD__ > + if (imo->imo_membership) { > PF_UNLOCK(); > -#endif > - > in_delmulti(imo->imo_membership[--imo->imo_num_memberships]); > -#ifdef __FreeBSD__ > + pfsync_multicast_cleanup(sc); > PF_LOCK(); > -#endif > + } > +#else > + if (imo->imo_num_memberships > 0) { > + > in_delmulti(imo->imo_membership[--imo->imo_num_memberships]); > imo->imo_multicast_ifp = NULL; > } > +#endif > > - if (sc->sc_sync_if && > #ifdef __FreeBSD__ > + if (sc->sc_sync_if && > sc->sc_sync_peer.s_addr == htonl(INADDR_PFSYNC_GROUP)) { > + PF_UNLOCK(); > + error = pfsync_multicast_setup(sc); > + if (error) > + return (error); > + PF_LOCK(); > + } > #else > + if (sc->sc_sync_if && > sc->sc_sync_peer.s_addr == INADDR_PFSYNC_GROUP) { > -#endif > struct in_addr addr; > > if (!(sc->sc_sync_if->if_flags & IFF_MULTICAST)) { > sc->sc_sync_if = NULL; > -#ifdef __FreeBSD__ > - PF_UNLOCK(); > -#endif > splx(s); > return (EADDRNOTAVAIL); > } > > -#ifdef __FreeBSD__ > - addr.s_addr = htonl(INADDR_PFSYNC_GROUP); > -#else > addr.s_addr = INADDR_PFSYNC_GROUP; > -#endif > > -#ifdef __FreeBSD__ > - PF_UNLOCK(); > -#endif > if ((imo->imo_membership[0] = > in_addmulti(&addr, sc->sc_sync_if)) == NULL) { > sc->sc_sync_if = NULL; > splx(s); > return (ENOBUFS); > } > -#ifdef __FreeBSD__ > - PF_LOCK(); > -#endif > imo->imo_num_memberships++; > imo->imo_multicast_ifp = sc->sc_sync_if; > imo->imo_multicast_ttl = PFSYNC_DFLTTL; > imo->imo_multicast_loop = 0; > } > +#endif /* !__FreeBSD__ */ > > ip = &sc->sc_template; > bzero(ip, sizeof(*ip)); > @@ -2365,7 +2336,7 @@ pfsync_sendout(void) > sc->sc_len = PFSYNC_MINPKT; > > IFQ_ENQUEUE(&sc->sc_ifp->if_snd, m, dummy_error); > - schednetisr(NETISR_PFSYNC); > + swi_sched(V_pfsync_swi_cookie, 0); > #else > sc->sc_if.if_opackets++; > sc->sc_if.if_obytes += m->m_pkthdr.len; > @@ -3342,54 +3313,91 @@ pfsync_sysctl(int *name, u_int namelen, > } > > #ifdef __FreeBSD__ > -void > -pfsync_ifdetach(void *arg, struct ifnet *ifp) > +static int > +pfsync_multicast_setup(struct pfsync_softc *sc) > { > - struct pfsync_softc *sc = (struct pfsync_softc *)arg; > - struct ip_moptions *imo; > - > - if (sc == NULL || sc->sc_sync_if != ifp) > - return; /* not for us; unlocked read */ > + struct ip_moptions *imo = &sc->sc_imo; > + int error; > > - CURVNET_SET(sc->sc_ifp->if_vnet); > + if (!(sc->sc_sync_if->if_flags & IFF_MULTICAST)) { > + sc->sc_sync_if = NULL; > + return (EADDRNOTAVAIL); > + } > > - PF_LOCK(); > + imo->imo_membership = (struct in_multi **)malloc( > + (sizeof(struct in_multi *) * IP_MIN_MEMBERSHIPS), M_PFSYNC, > + M_WAITOK | M_ZERO); > + imo->imo_max_memberships = IP_MIN_MEMBERSHIPS; > + imo->imo_multicast_vif = -1; > > - /* Deal with a member interface going away from under us. */ > - sc->sc_sync_if = NULL; > - imo = &sc->sc_imo; > - if (imo->imo_num_memberships > 0) { > - KASSERT(imo->imo_num_memberships == 1, > - ("%s: imo_num_memberships != 1", __func__)); > - /* > - * Our event handler is always called after protocol > - * domains have been detached from the underlying ifnet. > - * Do not call in_delmulti(); we held a single reference > - * which the protocol domain has purged in > in_purgemaddrs(). > - */ > - PF_UNLOCK(); > - imo->imo_membership[--imo->imo_num_memberships] = NULL; > - PF_LOCK(); > - imo->imo_multicast_ifp = NULL; > - } > + if ((error = in_joingroup(sc->sc_sync_if, &sc->sc_sync_peer, NULL, > + &imo->imo_membership[0])) != 0) { > + free(imo->imo_membership, M_PFSYNC); > + return (error); > + } > + imo->imo_num_memberships++; > + imo->imo_multicast_ifp = sc->sc_sync_if; > + imo->imo_multicast_ttl = PFSYNC_DFLTTL; > + imo->imo_multicast_loop = 0; > > - PF_UNLOCK(); > - > - CURVNET_RESTORE(); > + return (0); > } > > +static void > +pfsync_multicast_cleanup(struct pfsync_softc *sc) > +{ > + struct ip_moptions *imo = &sc->sc_imo; > + > + in_leavegroup(imo->imo_membership[0], NULL); > + free(imo->imo_membership, M_PFSYNC); > + imo->imo_membership = NULL; > + imo->imo_multicast_ifp = NULL; > +} > + > +#ifdef INET > +extern struct domain inetdomain; > +static struct protosw in_pfsync_protosw = { > + .pr_type = SOCK_RAW, > + .pr_domain = &inetdomain, > + .pr_protocol = IPPROTO_PFSYNC, > + .pr_flags = PR_ATOMIC|PR_ADDR, > + .pr_input = pfsync_input, > + .pr_output = (pr_output_t *)rip_output, > + .pr_ctloutput = rip_ctloutput, > + .pr_usrreqs = &rip_usrreqs > +}; > +#endif > + > static int > -vnet_pfsync_init(const void *unused) > +pfsync_init() > { > + VNET_ITERATOR_DECL(vnet_iter); > int error = 0; > > - pfsyncattach(0); > - > - error = swi_add(NULL, "pfsync", pfsyncintr, V_pfsyncif, > - SWI_NET, INTR_MPSAFE, &pfsync_swi.pfsync_swi_cookie); > + VNET_LIST_RLOCK(); > + VNET_FOREACH(vnet_iter) { > + CURVNET_SET(vnet_iter); > + V_pfsync_cloner = pfsync_cloner; > + V_pfsync_cloner_data = pfsync_cloner_data; > + V_pfsync_cloner.ifc_data = &V_pfsync_cloner_data; > + if_clone_attach(&V_pfsync_cloner); > + error = swi_add(NULL, "pfsync", pfsyncintr, V_pfsyncif, > + SWI_NET, INTR_MPSAFE, &V_pfsync_swi_cookie); > + CURVNET_RESTORE(); > + if (error) > + goto fail_locked; > + } > + VNET_LIST_RUNLOCK(); > +#ifdef INET > + error = pf_proto_register(PF_INET, &in_pfsync_protosw); > if (error) > - panic("%s: swi_add %d", __func__, error); > - > + goto fail; > + error = ipproto_register(IPPROTO_PFSYNC); > + if (error) { > + pf_proto_unregister(PF_INET, IPPROTO_PFSYNC, SOCK_RAW); > + goto fail; > + } > +#endif > PF_LOCK(); > pfsync_state_import_ptr = pfsync_state_import; > pfsync_up_ptr = pfsync_up; > @@ -3402,13 +3410,27 @@ vnet_pfsync_init(const void *unused) > PF_UNLOCK(); > > return (0); > + > +fail: > + VNET_LIST_RLOCK(); > +fail_locked: > + VNET_FOREACH(vnet_iter) { > + CURVNET_SET(vnet_iter); > + if (V_pfsync_swi_cookie) { > + swi_remove(V_pfsync_swi_cookie); > + if_clone_detach(&V_pfsync_cloner); > + } > + CURVNET_RESTORE(); > + } > + VNET_LIST_RUNLOCK(); > + > + return (error); > } > > -static int > -vnet_pfsync_uninit(const void *unused) > +static void > +pfsync_uninit() > { > - > - swi_remove(pfsync_swi.pfsync_swi_cookie); > + VNET_ITERATOR_DECL(vnet_iter); > > PF_LOCK(); > pfsync_state_import_ptr = NULL; > @@ -3421,30 +3443,18 @@ vnet_pfsync_uninit(const void *unused) > pfsync_defer_ptr = NULL; > PF_UNLOCK(); > > - if_clone_detach(&pfsync_cloner); > - > - return (0); > + ipproto_unregister(IPPROTO_PFSYNC); > + pf_proto_unregister(PF_INET, IPPROTO_PFSYNC, SOCK_RAW); > + VNET_LIST_RLOCK(); > + VNET_FOREACH(vnet_iter) { > + CURVNET_SET(vnet_iter); > + swi_remove(V_pfsync_swi_cookie); > + if_clone_detach(&V_pfsync_cloner); > + CURVNET_RESTORE(); > + } > + VNET_LIST_RUNLOCK(); > } > > -/* Define startup order. */ > -#define PFSYNC_SYSINIT_ORDER SI_SUB_PROTO_IF > -#define PFSYNC_MODEVENT_ORDER (SI_ORDER_FIRST) /* On boot slot > in here. */ > -#define PFSYNC_VNET_ORDER (PFSYNC_MODEVENT_ORDER + 2) /* > Later still. */ > - > -/* > - * Starting up. > - * VNET_SYSINIT is called for each existing vnet and each new vnet. > - */ > -VNET_SYSINIT(vnet_pfsync_init, PFSYNC_SYSINIT_ORDER, PFSYNC_VNET_ORDER, > - vnet_pfsync_init, NULL); > - > -/* > - * Closing up shop. These are done in REVERSE ORDER, > - * Not called on reboot. > - * VNET_SYSUNINIT is called for each exiting vnet as it exits. > - */ > -VNET_SYSUNINIT(vnet_pfsync_uninit, PFSYNC_SYSINIT_ORDER, > PFSYNC_VNET_ORDER, > - vnet_pfsync_uninit, NULL); > static int > pfsync_modevent(module_t mod, int type, void *data) > { > @@ -3452,21 +3462,23 @@ pfsync_modevent(module_t mod, int type, > > switch (type) { > case MOD_LOAD: > -#ifndef __FreeBSD__ > - pfsyncattach(0); > -#endif > + error = pfsync_init(); > + break; > + case MOD_QUIESCE: > + /* > + * Module should not be unloaded due to race conditions. > + */ > + error = EPERM; > break; > case MOD_UNLOAD: > -#ifndef __FreeBSD__ > - if_clone_detach(&pfsync_cloner); > -#endif > + pfsync_uninit(); > break; > default: > error = EINVAL; > break; > } > > - return error; > + return (error); > } > > static moduledata_t pfsync_mod = { > @@ -3477,7 +3489,7 @@ static moduledata_t pfsync_mod = { > > #define PFSYNC_MODVER 1 > > -DECLARE_MODULE(pfsync, pfsync_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); > +DECLARE_MODULE(pfsync, pfsync_mod, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY); > MODULE_VERSION(pfsync, PFSYNC_MODVER); > MODULE_DEPEND(pfsync, pf, PF_MODVER, PF_MODVER, PF_MODVER); > #endif /* __FreeBSD__ */ > > Modified: head/sys/netinet/in_proto.c > > ============================================================================== > --- head/sys/netinet/in_proto.c Mon Jan 9 08:36:12 2012 (r229849) > +++ head/sys/netinet/in_proto.c Mon Jan 9 08:50:22 2012 (r229850) > @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); > #include "opt_ipsec.h" > #include "opt_inet.h" > #include "opt_inet6.h" > -#include "opt_pf.h" > #include "opt_sctp.h" > #include "opt_mpath.h" > > @@ -101,11 +100,6 @@ static struct pr_usrreqs nousrreqs; > #include > #endif /* SCTP */ > > -#ifdef DEV_PFSYNC > -#include > -#include > -#endif > - > FEATURE(inet, "Internet Protocol version 4"); > > extern struct domain inetdomain; > @@ -317,17 +311,6 @@ struct protosw inetsw[] = { > .pr_ctloutput = rip_ctloutput, > .pr_usrreqs = &rip_usrreqs > }, > -#ifdef DEV_PFSYNC > -{ > - .pr_type = SOCK_RAW, > - .pr_domain = &inetdomain, > - .pr_protocol = IPPROTO_PFSYNC, > - .pr_flags = PR_ATOMIC|PR_ADDR, > - .pr_input = pfsync_input, > - .pr_ctloutput = rip_ctloutput, > - .pr_usrreqs = &rip_usrreqs > -}, > -#endif /* DEV_PFSYNC */ > /* Spacer n-times for loadable protocols. */ > IPPROTOSPACER, > IPPROTOSPACER, > @@ -397,6 +380,3 @@ SYSCTL_NODE(_net_inet, IPPROTO_IPCOMP, i > SYSCTL_NODE(_net_inet, IPPROTO_IPIP, ipip, CTLFLAG_RW, 0, "IPIP"); > #endif /* IPSEC */ > SYSCTL_NODE(_net_inet, IPPROTO_RAW, raw, CTLFLAG_RW, 0, "RAW"); > -#ifdef DEV_PFSYNC > -SYSCTL_NODE(_net_inet, IPPROTO_PFSYNC, pfsync, CTLFLAG_RW, 0, "PFSYNC"); > -#endif > -- Ermal From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 23:25:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10539106564A; Fri, 13 Jan 2012 23:25:36 +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 D91928FC13; Fri, 13 Jan 2012 23:25: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 q0DNPZpi084912; Fri, 13 Jan 2012 23:25:35 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DNPZXM084910; Fri, 13 Jan 2012 23:25:35 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201201132325.q0DNPZXM084910@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 13 Jan 2012 23:25: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: r230092 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 23:25:36 -0000 Author: pjd Date: Fri Jan 13 23:25:35 2012 New Revision: 230092 URL: http://svn.freebsd.org/changeset/base/230092 Log: Style cleanups. MFC after: 3 days Modified: head/sbin/hastd/secondary.c Modified: head/sbin/hastd/secondary.c ============================================================================== --- head/sbin/hastd/secondary.c Fri Jan 13 22:26:13 2012 (r230091) +++ head/sbin/hastd/secondary.c Fri Jan 13 23:25:35 2012 (r230092) @@ -282,8 +282,10 @@ init_remote(struct hast_resource *res, s (uintmax_t)resuid, (uintmax_t)res->hr_resuid); pjdlog_error("%s", errmsg); nv_add_string(nvout, errmsg, "errmsg"); - if (hast_proto_send(res, res->hr_remotein, nvout, NULL, 0) == -1) { - pjdlog_exit(EX_TEMPFAIL, "Unable to send response to %s", + if (hast_proto_send(res, res->hr_remotein, nvout, + NULL, 0) == -1) { + pjdlog_exit(EX_TEMPFAIL, + "Unable to send response to %s", res->hr_remoteaddr); } nv_free(nvout); @@ -327,8 +329,10 @@ init_remote(struct hast_resource *res, s free(map); pjdlog_error("Split-brain detected, exiting."); nv_add_string(nvout, "Split-brain condition!", "errmsg"); - if (hast_proto_send(res, res->hr_remotein, nvout, NULL, 0) == -1) { - pjdlog_exit(EX_TEMPFAIL, "Unable to send response to %s", + if (hast_proto_send(res, res->hr_remotein, nvout, + NULL, 0) == -1) { + pjdlog_exit(EX_TEMPFAIL, + "Unable to send response to %s", res->hr_remoteaddr); } nv_free(nvout); @@ -475,7 +479,8 @@ hastd_secondary(struct hast_resource *re } static void -reqlog(int loglevel, int debuglevel, int error, struct hio *hio, const char *fmt, ...) +reqlog(int loglevel, int debuglevel, int error, struct hio *hio, + const char *fmt, ...) { char msg[1024]; va_list ap; @@ -838,7 +843,7 @@ send_thread(void *arg) nv_add_int16(nvout, hio->hio_error, "error"); if (hast_proto_send(res, res->hr_remoteout, nvout, data, length) == -1) { - secondary_exit(EX_TEMPFAIL, "Unable to send reply."); + secondary_exit(EX_TEMPFAIL, "Unable to send reply"); } nv_free(nvout); pjdlog_debug(2, "send: (%p) Moving request to the free queue.", From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 23:25:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DAD43106566B; Fri, 13 Jan 2012 23:25:58 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C8F4D8FC12; Fri, 13 Jan 2012 23:25: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 q0DNPwSA084955; Fri, 13 Jan 2012 23:25:58 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DNPw0Y084953; Fri, 13 Jan 2012 23:25:58 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201132325.q0DNPw0Y084953@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 13 Jan 2012 23:25:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230093 - stable/8/sbin/dhclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 23:25:59 -0000 Author: glebius Date: Fri Jan 13 23:25:58 2012 New Revision: 230093 URL: http://svn.freebsd.org/changeset/base/230093 Log: Merge r228463, that explicily uses 255.0.0.0 mask for the temporary prefix. This change isn't actually needed in the stable/8, but let it be here, in case if anyone tries to run stable/8 world on a head/ kernel. Modified: stable/8/sbin/dhclient/dhclient-script Directory Properties: stable/8/sbin/dhclient/ (props changed) Modified: stable/8/sbin/dhclient/dhclient-script ============================================================================== --- stable/8/sbin/dhclient/dhclient-script Fri Jan 13 23:25:35 2012 (r230092) +++ stable/8/sbin/dhclient/dhclient-script Fri Jan 13 23:25:58 2012 (r230093) @@ -305,7 +305,7 @@ MEDIUM) PREINIT) delete_old_alias - $IFCONFIG $interface inet alias 0.0.0.0 netmask 0.0.0.0 broadcast 255.255.255.255 up + $IFCONFIG $interface inet alias 0.0.0.0 netmask 255.0.0.0 broadcast 255.255.255.255 up ;; ARPCHECK|ARPSEND) From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 23:31:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF261106564A; Fri, 13 Jan 2012 23:31:36 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B415E8FC0C; Fri, 13 Jan 2012 23:31: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 q0DNVakj085156; Fri, 13 Jan 2012 23:31:36 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DNVaQo085152; Fri, 13 Jan 2012 23:31:36 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201201132331.q0DNVaQo085152@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 13 Jan 2012 23:31: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: r230094 - in head/sys/mips: include mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 23:31:37 -0000 Author: gonzo Date: Fri Jan 13 23:31:36 2012 New Revision: 230094 URL: http://svn.freebsd.org/changeset/base/230094 Log: Fix backtrace for MIPS64: - Properly print 64-bit addresses - Get whole 64 bits of address using kdbpeekd - Make check for kernel address compatible with MIPS64 Modified: head/sys/mips/include/db_machdep.h head/sys/mips/mips/db_trace.c head/sys/mips/mips/support.S Modified: head/sys/mips/include/db_machdep.h ============================================================================== --- head/sys/mips/include/db_machdep.h Fri Jan 13 23:25:58 2012 (r230093) +++ head/sys/mips/include/db_machdep.h Fri Jan 13 23:31:36 2012 (r230094) @@ -93,6 +93,7 @@ db_addr_t next_instr_address(db_addr_t, int db_inst_type(int); db_addr_t branch_taken(int inst, db_addr_t pc); void stacktrace_subr(register_t pc, register_t sp, register_t ra, int (*)(const char *, ...)); -int kdbpeek(int *); +int32_t kdbpeek(int *); +int64_t kdbpeekd(int *); #endif /* !_MIPS_DB_MACHDEP_H_ */ Modified: head/sys/mips/mips/db_trace.c ============================================================================== --- head/sys/mips/mips/db_trace.c Fri Jan 13 23:25:58 2012 (r230093) +++ head/sys/mips/mips/db_trace.c Fri Jan 13 23:31:36 2012 (r230094) @@ -49,10 +49,13 @@ extern char edata[]; */ #define MIPS_END_OF_FUNCTION(ins) ((ins) == 0x03e00008) -/* - * kdbpeekD(addr) - skip one word starting at 'addr', then read the second word - */ -#define kdbpeekD(addr) kdbpeek(((int *)(addr)) + 1) +#if defined(__mips_n64) +# define MIPS_IS_VALID_KERNELADDR(reg) ((((reg) & 3) == 0) && \ + ((vm_offset_t)(reg) >= MIPS_XKPHYS_START)) +#else +# define MIPS_IS_VALID_KERNELADDR(reg) ((((reg) & 3) == 0) && \ + ((vm_offset_t)(reg) >= MIPS_KSEG0_START)) +#endif /* * Functions ``special'' enough to print by name @@ -141,8 +144,8 @@ loop: } /* check for bad SP: could foul up next frame */ /*XXX MIPS64 bad: this hard-coded SP is lame */ - if (sp & 3 || (uintptr_t)sp < 0x80000000u) { - (*printfn) ("SP 0x%x: not in kernel\n", sp); + if (!MIPS_IS_VALID_KERNELADDR(sp)) { + (*printfn) ("SP 0x%jx: not in kernel\n", sp); ra = 0; subr = 0; goto done; @@ -182,8 +185,8 @@ loop: } /* check for bad PC */ /*XXX MIPS64 bad: These hard coded constants are lame */ - if (pc & 3 || pc < (uintptr_t)0x80000000) { - (*printfn) ("PC 0x%x: not in kernel\n", pc); + if (!MIPS_IS_VALID_KERNELADDR(pc)) { + (*printfn) ("PC 0x%jx: not in kernel\n", pc); ra = 0; goto done; } @@ -304,27 +307,27 @@ loop: mask |= (1 << i.IType.rt); switch (i.IType.rt) { case 4:/* a0 */ - args[0] = kdbpeekD((int *)(sp + (short)i.IType.imm)); + args[0] = kdbpeekd((int *)(sp + (short)i.IType.imm)); valid_args[0] = 1; break; case 5:/* a1 */ - args[1] = kdbpeekD((int *)(sp + (short)i.IType.imm)); + args[1] = kdbpeekd((int *)(sp + (short)i.IType.imm)); valid_args[1] = 1; break; case 6:/* a2 */ - args[2] = kdbpeekD((int *)(sp + (short)i.IType.imm)); + args[2] = kdbpeekd((int *)(sp + (short)i.IType.imm)); valid_args[2] = 1; break; case 7:/* a3 */ - args[3] = kdbpeekD((int *)(sp + (short)i.IType.imm)); + args[3] = kdbpeekd((int *)(sp + (short)i.IType.imm)); valid_args[3] = 1; break; case 31: /* ra */ - ra = kdbpeekD((int *)(sp + (short)i.IType.imm)); + ra = kdbpeekd((int *)(sp + (short)i.IType.imm)); } break; @@ -350,7 +353,7 @@ done: (*printfn)("?"); } - (*printfn) (") ra %x sp %x sz %d\n", ra, sp, stksize); + (*printfn) (") ra %jx sp %jx sz %d\n", ra, sp, stksize); if (ra) { if (pc == ra && stksize == 0) Modified: head/sys/mips/mips/support.S ============================================================================== --- head/sys/mips/mips/support.S Fri Jan 13 23:25:58 2012 (r230093) +++ head/sys/mips/mips/support.S Fri Jan 13 23:31:36 2012 (r230094) @@ -1340,6 +1340,25 @@ LEAF(kdbpeek) PTR_S zero, U_PCB_ONFAULT(t1) END(kdbpeek) +LEAF(kdbpeekd) + PTR_LA v1, ddberr + and v0, a0, 3 # unaligned ? + GET_CPU_PCPU(t1) + PTR_L t1, PC_CURPCB(t1) + bne v0, zero, 1f + PTR_S v1, U_PCB_ONFAULT(t1) + + ld v0, (a0) + jr ra + PTR_S zero, U_PCB_ONFAULT(t1) + +1: + REG_LHI v0, 0(a0) + REG_LLO v0, 7(a0) + jr ra + PTR_S zero, U_PCB_ONFAULT(t1) +END(kdbpeekd) + ddberr: jr ra nop From owner-svn-src-all@FreeBSD.ORG Fri Jan 13 23:32:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AD6D106564A; Fri, 13 Jan 2012 23:32:27 +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 7940C8FC08; Fri, 13 Jan 2012 23:32:27 +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 q0DNWRJ6085218; Fri, 13 Jan 2012 23:32:27 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0DNWRYw085215; Fri, 13 Jan 2012 23:32:27 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201201132332.q0DNWRYw085215@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 13 Jan 2012 23:32:27 +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: r230095 - in head: bin/sh tools/regression/bin/sh/builtins X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2012 23:32:27 -0000 Author: jilles Date: Fri Jan 13 23:32:27 2012 New Revision: 230095 URL: http://svn.freebsd.org/changeset/base/230095 Log: sh: Properly show "Not a directory" error in cd builtin. The errno message display added in r222292 did not take attempting to cd to a non-directory or something that cannot be stat()ed into account. PR: bin/164070 MFC after: 10 days Added: head/tools/regression/bin/sh/builtins/cd8.0 (contents, props changed) Modified: head/bin/sh/cd.c Modified: head/bin/sh/cd.c ============================================================================== --- head/bin/sh/cd.c Fri Jan 13 23:31:36 2012 (r230094) +++ head/bin/sh/cd.c Fri Jan 13 23:32:27 2012 (r230095) @@ -130,7 +130,12 @@ cdcmd(int argc, char **argv) (path = bltinlookup("CDPATH", 1)) == NULL) path = nullstr; while ((p = padvance(&path, dest)) != NULL) { - if (stat(p, &statb) >= 0 && S_ISDIR(statb.st_mode)) { + if (stat(p, &statb) < 0) { + if (errno != ENOENT) + errno1 = errno; + } else if (!S_ISDIR(statb.st_mode)) + errno1 = ENOTDIR; + else { if (!print) { /* * XXX - rethink Added: head/tools/regression/bin/sh/builtins/cd8.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/cd8.0 Fri Jan 13 23:32:27 2012 (r230095) @@ -0,0 +1,26 @@ +# $FreeBSD$ + +# The exact wording of the error message is not standardized, but giving +# a description of the errno is useful. + +LC_ALL=C +export LC_ALL +r=0 + +t() { + exec 3>&1 + errmsg=`cd "$1" 2>&1 >&3 3>&-` + exec 3>&- + case $errmsg in + *[Nn]ot\ a\ directory*) + ;; + *) + printf "Wrong error message for %s: %s\n" "$1" "$errmsg" + r=3 + ;; + esac +} + +t /dev/tty +t /dev/tty/x +exit $r From owner-svn-src-all@FreeBSD.ORG Sat Jan 14 00:36:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A57A9106566B; Sat, 14 Jan 2012 00:36:07 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 94A1E8FC0C; Sat, 14 Jan 2012 00:36: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 q0E0a7m4087277; Sat, 14 Jan 2012 00:36:07 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0E0a7lx087275; Sat, 14 Jan 2012 00:36:07 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201201140036.q0E0a7lx087275@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sat, 14 Jan 2012 00:36: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: r230097 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 00:36:07 -0000 Author: gonzo Date: Sat Jan 14 00:36:07 2012 New Revision: 230097 URL: http://svn.freebsd.org/changeset/base/230097 Log: Fix kernel modules loading for MIPS64 kernel: On amd64, link_elf_obj.c must specify KERNBASE rather than VM_MIN_KERNEL_ADDRESS to vm_map_find() because kernel loadable modules must be mapped for execution in the same upper region of the kernel map as the kernel code and data segments. For MIPS32 KERNBASE lies below KVA area (it's less than VM_MIN_KERNEL_ADDRESS) so basically vm_map_find got whole KVA to look through. On MIPS64 it's not the case because KERNBASE is set to the very end of XKSEG, well out of KVA bounds, so vm_map_find always fails. We should use VM_MIN_KERNEL_ADDRESS as a base for vm_map_find. Details obtained from: alc@ Modified: head/sys/kern/link_elf_obj.c Modified: head/sys/kern/link_elf_obj.c ============================================================================== --- head/sys/kern/link_elf_obj.c Sat Jan 14 00:28:02 2012 (r230096) +++ head/sys/kern/link_elf_obj.c Sat Jan 14 00:36:07 2012 (r230097) @@ -684,7 +684,11 @@ link_elf_load_file(linker_class_t cls, c * location of code and data in the kernel's address space, request a * mapping that is above the kernel. */ +#ifdef __amd64__ mapbase = KERNBASE; +#else + mapbase = VM_MIN_KERNEL_ADDRESS; +#endif error = vm_map_find(kernel_map, ef->object, 0, &mapbase, round_page(mapsize), TRUE, VM_PROT_ALL, VM_PROT_ALL, FALSE); if (error) { From owner-svn-src-all@FreeBSD.ORG Sat Jan 14 02:18:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 651EF106566B; Sat, 14 Jan 2012 02:18:43 +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 532798FC0C; Sat, 14 Jan 2012 02:18: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 q0E2IhLr090620; Sat, 14 Jan 2012 02:18:43 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0E2Igad090552; Sat, 14 Jan 2012 02:18:42 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201201140218.q0E2Igad090552@svn.freebsd.org> From: Doug Barton Date: Sat, 14 Jan 2012 02:18: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: r230099 - head/etc/rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 02:18:43 -0000 Author: dougb Date: Sat Jan 14 02:18:41 2012 New Revision: 230099 URL: http://svn.freebsd.org/changeset/base/230099 Log: Prepare for the removal of set_rcvar() by changing the rcvar= assignments to the literal values it would have returned. The concept of set_rcvar() was nice in theory, but the forks it creates are a drag on the startup process, which is especially noticeable on slower systems, such as embedded ones. During the discussion on freebsd-rc@ a preference was expressed for using ${name}_enable instead of the literal values. However the code portability concept doesn't really apply since there are so many other places where the literal name has to be searched for and replaced. Also, using the literal value is also a tiny bit faster than dereferencing the variables, and every little bit helps. Modified: head/etc/rc.d/accounting head/etc/rc.d/amd head/etc/rc.d/apm head/etc/rc.d/apmd head/etc/rc.d/bootparams head/etc/rc.d/bsnmpd head/etc/rc.d/bthidd head/etc/rc.d/cleanvar head/etc/rc.d/cleartmp head/etc/rc.d/cron head/etc/rc.d/ddb head/etc/rc.d/devd head/etc/rc.d/dmesg head/etc/rc.d/ftp-proxy head/etc/rc.d/ftpd head/etc/rc.d/gptboot head/etc/rc.d/hastd head/etc/rc.d/hcsecd head/etc/rc.d/hostapd head/etc/rc.d/inetd head/etc/rc.d/ip6addrctl head/etc/rc.d/ipfilter head/etc/rc.d/ipfs head/etc/rc.d/ipmon head/etc/rc.d/ipnat head/etc/rc.d/ipsec head/etc/rc.d/ipxrouted head/etc/rc.d/jail head/etc/rc.d/keyserv head/etc/rc.d/lpd head/etc/rc.d/mountd head/etc/rc.d/moused head/etc/rc.d/mroute6d head/etc/rc.d/mrouted head/etc/rc.d/natd head/etc/rc.d/netwait head/etc/rc.d/newsyslog head/etc/rc.d/nfscbd head/etc/rc.d/nfsd head/etc/rc.d/nfsuserd head/etc/rc.d/nscd head/etc/rc.d/ntpd head/etc/rc.d/ntpdate head/etc/rc.d/pf head/etc/rc.d/pflog head/etc/rc.d/pfsync head/etc/rc.d/powerd head/etc/rc.d/ppp head/etc/rc.d/pppoed head/etc/rc.d/quota head/etc/rc.d/rarpd head/etc/rc.d/rfcomm_pppd_server head/etc/rc.d/route6d head/etc/rc.d/routed head/etc/rc.d/rpcbind head/etc/rc.d/rtadvd head/etc/rc.d/rtsold head/etc/rc.d/rwho head/etc/rc.d/sdpd head/etc/rc.d/sendmail head/etc/rc.d/sshd head/etc/rc.d/syslogd head/etc/rc.d/timed head/etc/rc.d/ubthidhci head/etc/rc.d/virecover head/etc/rc.d/watchdogd Modified: head/etc/rc.d/accounting ============================================================================== --- head/etc/rc.d/accounting Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/accounting Sat Jan 14 02:18:41 2012 (r230099) @@ -11,7 +11,7 @@ . /etc/rc.subr name="accounting" -rcvar=`set_rcvar` +rcvar="accounting_enable" accounting_command="/usr/sbin/accton" accounting_file="/var/account/acct" Modified: head/etc/rc.d/amd ============================================================================== --- head/etc/rc.d/amd Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/amd Sat Jan 14 02:18:41 2012 (r230099) @@ -11,7 +11,7 @@ . /etc/rc.subr name="amd" -rcvar=`set_rcvar` +rcvar="amd_enable" command="/usr/sbin/${name}" start_precmd="amd_precmd" command_args="&" Modified: head/etc/rc.d/apm ============================================================================== --- head/etc/rc.d/apm Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/apm Sat Jan 14 02:18:41 2012 (r230099) @@ -11,7 +11,7 @@ . /etc/rc.subr name="apm" -rcvar=`set_rcvar` +rcvar="apm_enable" start_precmd="apm_precmd" command="/usr/sbin/${name}" start_cmd="${command} -e enable" Modified: head/etc/rc.d/apmd ============================================================================== --- head/etc/rc.d/apmd Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/apmd Sat Jan 14 02:18:41 2012 (r230099) @@ -11,7 +11,7 @@ . /etc/rc.subr name="apmd" -rcvar=`set_rcvar` +rcvar="apmd_enable" command="/usr/sbin/${name}" start_precmd="apmd_prestart" Modified: head/etc/rc.d/bootparams ============================================================================== --- head/etc/rc.d/bootparams Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/bootparams Sat Jan 14 02:18:41 2012 (r230099) @@ -11,7 +11,7 @@ . /etc/rc.subr name="bootparamd" -rcvar=`set_rcvar` +rcvar="bootparamd_enable" required_files="/etc/bootparams" command="/usr/sbin/${name}" Modified: head/etc/rc.d/bsnmpd ============================================================================== --- head/etc/rc.d/bsnmpd Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/bsnmpd Sat Jan 14 02:18:41 2012 (r230099) @@ -10,7 +10,7 @@ . /etc/rc.subr name="bsnmpd" -rcvar=`set_rcvar` +rcvar="bsnmpd_enable" command="/usr/sbin/${name}" pidfile="/var/run/snmpd.pid" Modified: head/etc/rc.d/bthidd ============================================================================== --- head/etc/rc.d/bthidd Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/bthidd Sat Jan 14 02:18:41 2012 (r230099) @@ -11,9 +11,9 @@ . /etc/rc.subr name="bthidd" +rcvar="bthidd_enable" command="/usr/sbin/${name}" pidfile="/var/run/${name}.pid" -rcvar=`set_rcvar` start_precmd="bthidd_prestart" bthidd_prestart() Modified: head/etc/rc.d/cleanvar ============================================================================== --- head/etc/rc.d/cleanvar Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/cleanvar Sat Jan 14 02:18:41 2012 (r230099) @@ -9,7 +9,7 @@ . /etc/rc.subr name="cleanvar" -rcvar=`set_rcvar` +rcvar="cleanvar_enable" start_precmd="${name}_prestart" start_cmd="${name}_start" Modified: head/etc/rc.d/cleartmp ============================================================================== --- head/etc/rc.d/cleartmp Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/cleartmp Sat Jan 14 02:18:41 2012 (r230099) @@ -11,7 +11,7 @@ name="cleartmp" # Disguise rcvar for the start method to run irrespective of its setting. -rcvar1=`set_rcvar clear_tmp` +rcvar1="clear_tmp_enable" start_cmd="${name}_start" stop_cmd=":" Modified: head/etc/rc.d/cron ============================================================================== --- head/etc/rc.d/cron Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/cron Sat Jan 14 02:18:41 2012 (r230099) @@ -11,7 +11,7 @@ . /etc/rc.subr name="cron" -rcvar="`set_rcvar`" +rcvar="cron_enable" command="/usr/sbin/${name}" pidfile="/var/run/${name}.pid" Modified: head/etc/rc.d/ddb ============================================================================== --- head/etc/rc.d/ddb Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/ddb Sat Jan 14 02:18:41 2012 (r230099) @@ -11,7 +11,7 @@ . /etc/rc.subr name="ddb" -rcvar=`set_rcvar` +rcvar="ddb_enable" command="/sbin/${name}" start_precmd="ddb_prestart" stop_cmd=":" Modified: head/etc/rc.d/devd ============================================================================== --- head/etc/rc.d/devd Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/devd Sat Jan 14 02:18:41 2012 (r230099) @@ -11,7 +11,7 @@ . /etc/rc.subr name="devd" -rcvar=`set_rcvar` +rcvar="devd_enable" command="/sbin/${name}" start_precmd=${name}_prestart Modified: head/etc/rc.d/dmesg ============================================================================== --- head/etc/rc.d/dmesg Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/dmesg Sat Jan 14 02:18:41 2012 (r230099) @@ -11,7 +11,7 @@ . /etc/rc.subr name="dmesg" -rcvar=`set_rcvar` +rcvar="dmesg_enable" dmesg_file="/var/run/dmesg.boot" start_cmd="do_dmesg" stop_cmd=":" Modified: head/etc/rc.d/ftp-proxy ============================================================================== --- head/etc/rc.d/ftp-proxy Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/ftp-proxy Sat Jan 14 02:18:41 2012 (r230099) @@ -10,7 +10,7 @@ . /etc/rc.subr name="ftpproxy" -rcvar=`set_rcvar` +rcvar="ftpproxy_enable" command="/usr/sbin/ftp-proxy" load_rc_config $name Modified: head/etc/rc.d/ftpd ============================================================================== --- head/etc/rc.d/ftpd Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/ftpd Sat Jan 14 02:18:41 2012 (r230099) @@ -10,7 +10,7 @@ . /etc/rc.subr name="ftpd" -rcvar=`set_rcvar` +rcvar="ftpd_enable" command="/usr/libexec/${name}" pidfile="/var/run/${name}.pid" start_precmd=ftpd_prestart Modified: head/etc/rc.d/gptboot ============================================================================== --- head/etc/rc.d/gptboot Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/gptboot Sat Jan 14 02:18:41 2012 (r230099) @@ -34,7 +34,7 @@ . /etc/rc.subr name="gptboot" -rcvar=`set_rcvar` +rcvar="gptboot_enable" start_cmd="gptboot_report" gptboot_report() Modified: head/etc/rc.d/hastd ============================================================================== --- head/etc/rc.d/hastd Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/hastd Sat Jan 14 02:18:41 2012 (r230099) @@ -11,7 +11,7 @@ . /etc/rc.subr name="hastd" -rcvar=`set_rcvar` +rcvar="hastd_enable" pidfile="/var/run/${name}.pid" command="/sbin/${name}" hastctl="/sbin/hastctl" Modified: head/etc/rc.d/hcsecd ============================================================================== --- head/etc/rc.d/hcsecd Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/hcsecd Sat Jan 14 02:18:41 2012 (r230099) @@ -11,9 +11,9 @@ . /etc/rc.subr name="hcsecd" +rcvar="hcsecd_enable" command="/usr/sbin/${name}" pidfile="/var/run/${name}.pid" -rcvar=`set_rcvar` required_modules="ng_btsocket" load_rc_config $name Modified: head/etc/rc.d/hostapd ============================================================================== --- head/etc/rc.d/hostapd Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/hostapd Sat Jan 14 02:18:41 2012 (r230099) @@ -10,8 +10,8 @@ . /etc/rc.subr name="hostapd" +rcvar="hostapd_enable" command="/usr/sbin/${name}" -rcvar=`set_rcvar` conf_file="/etc/${name}.conf" pidfile="/var/run/${name}.pid" Modified: head/etc/rc.d/inetd ============================================================================== --- head/etc/rc.d/inetd Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/inetd Sat Jan 14 02:18:41 2012 (r230099) @@ -10,7 +10,7 @@ . /etc/rc.subr name="inetd" -rcvar=`set_rcvar` +rcvar="inetd_enable" command="/usr/sbin/${name}" pidfile="/var/run/${name}.pid" required_files="/etc/${name}.conf" Modified: head/etc/rc.d/ip6addrctl ============================================================================== --- head/etc/rc.d/ip6addrctl Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/ip6addrctl Sat Jan 14 02:18:41 2012 (r230099) @@ -12,7 +12,7 @@ . /etc/network.subr name="ip6addrctl" -rcvar=`set_rcvar` +rcvar="ip6addrctl_enable" start_cmd="ip6addrctl_start" stop_cmd="ip6addrctl_stop" extra_commands="status prefer_ipv6 prefer_ipv4" Modified: head/etc/rc.d/ipfilter ============================================================================== --- head/etc/rc.d/ipfilter Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/ipfilter Sat Jan 14 02:18:41 2012 (r230099) @@ -10,7 +10,7 @@ . /etc/rc.subr name="ipfilter" -rcvar=`set_rcvar` +rcvar="ipfilter_enable" load_rc_config $name stop_precmd="test -f ${ipfilter_rules} -o -f ${ipv6_ipfilter_rules}" Modified: head/etc/rc.d/ipfs ============================================================================== --- head/etc/rc.d/ipfs Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/ipfs Sat Jan 14 02:18:41 2012 (r230099) @@ -10,7 +10,7 @@ . /etc/rc.subr name="ipfs" -rcvar=`set_rcvar` +rcvar="ipfs_enable" start_cmd="ipfs_start" stop_cmd="ipfs_stop" start_precmd="ipfs_prestart" Modified: head/etc/rc.d/ipmon ============================================================================== --- head/etc/rc.d/ipmon Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/ipmon Sat Jan 14 02:18:41 2012 (r230099) @@ -11,7 +11,7 @@ . /etc/rc.subr name="ipmon" -rcvar=`set_rcvar` +rcvar="ipmon_enable" command="/sbin/${name}" start_precmd="ipmon_precmd" Modified: head/etc/rc.d/ipnat ============================================================================== --- head/etc/rc.d/ipnat Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/ipnat Sat Jan 14 02:18:41 2012 (r230099) @@ -10,7 +10,7 @@ . /etc/rc.subr name="ipnat" -rcvar=`set_rcvar` +rcvar="ipnat_enable" load_rc_config $name start_cmd="ipnat_start" stop_cmd="${ipnat_program} -F -C" Modified: head/etc/rc.d/ipsec ============================================================================== --- head/etc/rc.d/ipsec Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/ipsec Sat Jan 14 02:18:41 2012 (r230099) @@ -11,7 +11,7 @@ . /etc/rc.subr name="ipsec" -rcvar=`set_rcvar` +rcvar="ipsec_enable" start_precmd="ipsec_prestart" start_cmd="ipsec_start" stop_precmd="test -f $ipsec_file" Modified: head/etc/rc.d/ipxrouted ============================================================================== --- head/etc/rc.d/ipxrouted Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/ipxrouted Sat Jan 14 02:18:41 2012 (r230099) @@ -11,7 +11,7 @@ . /etc/rc.subr name="ipxrouted" -rcvar=`set_rcvar` +rcvar="ipxrouted_enable" command="/usr/sbin/IPXrouted" command_args="> /dev/null 2>&1" Modified: head/etc/rc.d/jail ============================================================================== --- head/etc/rc.d/jail Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/jail Sat Jan 14 02:18:41 2012 (r230099) @@ -17,7 +17,7 @@ . /etc/rc.subr name="jail" -rcvar=`set_rcvar` +rcvar="jail_enable" start_precmd="jail_prestart" start_cmd="jail_start" Modified: head/etc/rc.d/keyserv ============================================================================== --- head/etc/rc.d/keyserv Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/keyserv Sat Jan 14 02:18:41 2012 (r230099) @@ -13,7 +13,7 @@ . /etc/rc.subr name="keyserv" -rcvar=`set_rcvar` +rcvar="keyserv_enable" command="/usr/sbin/${name}" start_precmd="keyserv_prestart" Modified: head/etc/rc.d/lpd ============================================================================== --- head/etc/rc.d/lpd Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/lpd Sat Jan 14 02:18:41 2012 (r230099) @@ -11,7 +11,7 @@ . /etc/rc.subr name="lpd" -rcvar=`set_rcvar` +rcvar="lpd_enable" command="/usr/sbin/${name}" required_files="/etc/printcap" start_precmd="chkprintcap" Modified: head/etc/rc.d/mountd ============================================================================== --- head/etc/rc.d/mountd Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/mountd Sat Jan 14 02:18:41 2012 (r230099) @@ -10,7 +10,7 @@ . /etc/rc.subr name="mountd" -rcvar=`set_rcvar` +rcvar="mountd_enable" command="/usr/sbin/${name}" pidfile="/var/run/${name}.pid" required_files="/etc/exports" Modified: head/etc/rc.d/moused ============================================================================== --- head/etc/rc.d/moused Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/moused Sat Jan 14 02:18:41 2012 (r230099) @@ -10,7 +10,7 @@ . /etc/rc.subr name="moused" -rcvar=`set_rcvar` +rcvar="moused_enable" command="/usr/sbin/${name}" start_cmd="moused_start" pidprefix="/var/run/moused" @@ -23,7 +23,7 @@ load_rc_config $name # if [ -n "$2" ]; then eval moused_$2_enable=\${moused_$2_enable-${moused_nondefault_enable}} - rcvar=`set_rcvar moused_$2` + rcvar="moused_${2}_enable" pidfile="${pidprefix}.$2.pid" pidarg="-I $pidfile" fi Modified: head/etc/rc.d/mroute6d ============================================================================== --- head/etc/rc.d/mroute6d Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/mroute6d Sat Jan 14 02:18:41 2012 (r230099) @@ -11,7 +11,7 @@ . /etc/rc.subr name="mroute6d" -rcvar=`set_rcvar` +rcvar="mroute6d_enable" command="/usr/local/sbin/pim6dd" load_rc_config $name Modified: head/etc/rc.d/mrouted ============================================================================== --- head/etc/rc.d/mrouted Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/mrouted Sat Jan 14 02:18:41 2012 (r230099) @@ -10,7 +10,7 @@ . /etc/rc.subr name="mrouted" -rcvar=`set_rcvar` +rcvar="mrouted_enable" command="/usr/local/sbin/${name}" pidfile="/var/run/${name}.pid" required_files="/etc/${name}.conf" Modified: head/etc/rc.d/natd ============================================================================== --- head/etc/rc.d/natd Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/natd Sat Jan 14 02:18:41 2012 (r230099) @@ -10,7 +10,7 @@ . /etc/network.subr name="natd" -rcvar=`set_rcvar` +rcvar="natd_enable" command="/sbin/${name}" pidfile="/var/run/${name}.pid" start_precmd="natd_precmd" Modified: head/etc/rc.d/netwait ============================================================================== --- head/etc/rc.d/netwait Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/netwait Sat Jan 14 02:18:41 2012 (r230099) @@ -14,7 +14,7 @@ . /etc/rc.subr name="netwait" -rcvar=`set_rcvar` +rcvar="netwait_enable" start_cmd="${name}_start" stop_cmd=":" Modified: head/etc/rc.d/newsyslog ============================================================================== --- head/etc/rc.d/newsyslog Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/newsyslog Sat Jan 14 02:18:41 2012 (r230099) @@ -9,7 +9,7 @@ . /etc/rc.subr name="newsyslog" -rcvar=`set_rcvar` +rcvar="newsyslog_enable" required_files="/etc/newsyslog.conf" command="/usr/sbin/${name}" start_cmd="newsyslog_start" Modified: head/etc/rc.d/nfscbd ============================================================================== --- head/etc/rc.d/nfscbd Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/nfscbd Sat Jan 14 02:18:41 2012 (r230099) @@ -10,7 +10,7 @@ . /etc/rc.subr name="nfscbd" -rcvar=`set_rcvar` +rcvar="nfscbd_enable" command="/usr/sbin/${name}" sig_stop="USR1" Modified: head/etc/rc.d/nfsd ============================================================================== --- head/etc/rc.d/nfsd Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/nfsd Sat Jan 14 02:18:41 2012 (r230099) @@ -10,7 +10,7 @@ . /etc/rc.subr name="nfsd" -rcvar=`set_rcvar nfs_server` +rcvar="nfs_server_enable" command="/usr/sbin/${name}" load_rc_config $name Modified: head/etc/rc.d/nfsuserd ============================================================================== --- head/etc/rc.d/nfsuserd Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/nfsuserd Sat Jan 14 02:18:41 2012 (r230099) @@ -10,7 +10,7 @@ . /etc/rc.subr name="nfsuserd" -rcvar=`set_rcvar` +rcvar="nfsuserd_enable" command="/usr/sbin/${name}" sig_stop="USR1" Modified: head/etc/rc.d/nscd ============================================================================== --- head/etc/rc.d/nscd Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/nscd Sat Jan 14 02:18:41 2012 (r230099) @@ -19,7 +19,7 @@ . /etc/rc.subr name="nscd" -rcvar=`set_rcvar` +rcvar="nscd_enable" command=/usr/sbin/nscd extra_commands="flush" Modified: head/etc/rc.d/ntpd ============================================================================== --- head/etc/rc.d/ntpd Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/ntpd Sat Jan 14 02:18:41 2012 (r230099) @@ -11,7 +11,7 @@ . /etc/rc.subr name="ntpd" -rcvar=`set_rcvar` +rcvar="ntpd_enable" command="/usr/sbin/${name}" pidfile="/var/run/${name}.pid" start_precmd="ntpd_precmd" Modified: head/etc/rc.d/ntpdate ============================================================================== --- head/etc/rc.d/ntpdate Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/ntpdate Sat Jan 14 02:18:41 2012 (r230099) @@ -10,7 +10,7 @@ . /etc/rc.subr name="ntpdate" -rcvar=`set_rcvar` +rcvar="ntpdate_enable" stop_cmd=":" start_cmd="ntpdate_start" Modified: head/etc/rc.d/pf ============================================================================== --- head/etc/rc.d/pf Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/pf Sat Jan 14 02:18:41 2012 (r230099) @@ -11,7 +11,7 @@ . /etc/rc.subr name="pf" -rcvar=`set_rcvar` +rcvar="pf_enable" load_rc_config $name start_cmd="pf_start" stop_cmd="pf_stop" Modified: head/etc/rc.d/pflog ============================================================================== --- head/etc/rc.d/pflog Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/pflog Sat Jan 14 02:18:41 2012 (r230099) @@ -10,7 +10,7 @@ . /etc/rc.subr name="pflog" -rcvar=`set_rcvar` +rcvar="pflog_enable" command="/sbin/pflogd" pidfile="/var/run/pflogd.pid" start_precmd="pflog_prestart" Modified: head/etc/rc.d/pfsync ============================================================================== --- head/etc/rc.d/pfsync Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/pfsync Sat Jan 14 02:18:41 2012 (r230099) @@ -10,7 +10,7 @@ . /etc/rc.subr name="pfsync" -rcvar=`set_rcvar` +rcvar="pfsync_enable" start_precmd="pfsync_prestart" start_cmd="pfsync_start" stop_cmd="pfsync_stop" Modified: head/etc/rc.d/powerd ============================================================================== --- head/etc/rc.d/powerd Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/powerd Sat Jan 14 02:18:41 2012 (r230099) @@ -11,7 +11,7 @@ . /etc/rc.subr name="powerd" -rcvar=`set_rcvar` +rcvar="powerd_enable" command="/usr/sbin/${name}" stop_postcmd=powerd_poststop Modified: head/etc/rc.d/ppp ============================================================================== --- head/etc/rc.d/ppp Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/ppp Sat Jan 14 02:18:41 2012 (r230099) @@ -10,7 +10,7 @@ . /etc/rc.subr name="ppp" -rcvar=`set_rcvar` +rcvar="ppp_enable" command="/usr/sbin/${name}" start_cmd="ppp_start" stop_cmd="ppp_stop" Modified: head/etc/rc.d/pppoed ============================================================================== --- head/etc/rc.d/pppoed Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/pppoed Sat Jan 14 02:18:41 2012 (r230099) @@ -11,7 +11,7 @@ . /etc/rc.subr name="pppoed" -rcvar="`set_rcvar`" +rcvar="pppoed_enable" start_cmd="pppoed_start" # XXX stop_cmd will not be straightforward stop_cmd=":" Modified: head/etc/rc.d/quota ============================================================================== --- head/etc/rc.d/quota Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/quota Sat Jan 14 02:18:41 2012 (r230099) @@ -13,7 +13,7 @@ . /etc/rc.subr name="quota" -rcvar=`set_rcvar` +rcvar="quota_enable" load_rc_config $name start_cmd="quota_start" stop_cmd="/usr/sbin/quotaoff ${quotaoff_flags}" Modified: head/etc/rc.d/rarpd ============================================================================== --- head/etc/rc.d/rarpd Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/rarpd Sat Jan 14 02:18:41 2012 (r230099) @@ -11,7 +11,7 @@ . /etc/rc.subr name="rarpd" -rcvar=`set_rcvar` +rcvar="rarpd_enable" command="/usr/sbin/${name}" pidfile="/var/run/${name}.pid" required_files="/etc/ethers" Modified: head/etc/rc.d/rfcomm_pppd_server ============================================================================== --- head/etc/rc.d/rfcomm_pppd_server Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/rfcomm_pppd_server Sat Jan 14 02:18:41 2012 (r230099) @@ -11,7 +11,7 @@ . /etc/rc.subr name="rfcomm_pppd_server" -rcvar=`set_rcvar` +rcvar="rfcomm_pppd_server_enable" command="/usr/sbin/rfcomm_pppd" start_cmd="rfcomm_pppd_server_start" stop_cmd="rfcomm_pppd_server_stop" Modified: head/etc/rc.d/route6d ============================================================================== --- head/etc/rc.d/route6d Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/route6d Sat Jan 14 02:18:41 2012 (r230099) @@ -10,7 +10,7 @@ . /etc/rc.subr name="route6d" -rcvar=`set_rcvar` +rcvar="route6d_enable" set_rcvar_obsolete ipv6_router_enable route6d_enable set_rcvar_obsolete ipv6_router route6d_program Modified: head/etc/rc.d/routed ============================================================================== --- head/etc/rc.d/routed Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/routed Sat Jan 14 02:18:41 2012 (r230099) @@ -10,8 +10,8 @@ . /etc/rc.subr name="routed" +rcvar="routed_enable" desc="network RIP and router discovery routing daemon" -rcvar=`set_rcvar` set_rcvar_obsolete router_enable routed_enable set_rcvar_obsolete router routed_program Modified: head/etc/rc.d/rpcbind ============================================================================== --- head/etc/rc.d/rpcbind Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/rpcbind Sat Jan 14 02:18:41 2012 (r230099) @@ -10,7 +10,7 @@ . /etc/rc.subr name="rpcbind" -rcvar=`set_rcvar` +rcvar="rpcbind_enable" command="/usr/sbin/${name}" stop_postcmd='/bin/rm -f /var/run/rpcbind.*' Modified: head/etc/rc.d/rtadvd ============================================================================== --- head/etc/rc.d/rtadvd Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/rtadvd Sat Jan 14 02:18:41 2012 (r230099) @@ -12,7 +12,7 @@ . /etc/network.subr name="rtadvd" -rcvar=`set_rcvar` +rcvar="rtadvd_enable" command="/usr/sbin/${name}" start_precmd="rtadvd_precmd" Modified: head/etc/rc.d/rtsold ============================================================================== --- head/etc/rc.d/rtsold Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/rtsold Sat Jan 14 02:18:41 2012 (r230099) @@ -11,7 +11,7 @@ . /etc/rc.subr name="rtsold" -rcvar=`set_rcvar` +rcvar="rtsold_enable" command="/usr/sbin/${name}" pidfile="/var/run/${name}.pid" start_postcmd="rtsold_poststart" Modified: head/etc/rc.d/rwho ============================================================================== --- head/etc/rc.d/rwho Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/rwho Sat Jan 14 02:18:41 2012 (r230099) @@ -11,7 +11,7 @@ . /etc/rc.subr name="rwhod" -rcvar="`set_rcvar`" +rcvar="rwhod_enable" command="/usr/sbin/${name}" load_rc_config $name Modified: head/etc/rc.d/sdpd ============================================================================== --- head/etc/rc.d/sdpd Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/sdpd Sat Jan 14 02:18:41 2012 (r230099) @@ -12,7 +12,7 @@ name="sdpd" command="/usr/sbin/${name}" -rcvar=`set_rcvar` +rcvar="sdpd_enable" required_modules="ng_btsocket" load_rc_config $name Modified: head/etc/rc.d/sendmail ============================================================================== --- head/etc/rc.d/sendmail Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/sendmail Sat Jan 14 02:18:41 2012 (r230099) @@ -15,7 +15,7 @@ . /etc/rc.subr name="sendmail" -rcvar=`set_rcvar` +rcvar="sendmail_enable" required_files="/etc/mail/${name}.cf" start_precmd="sendmail_precmd" @@ -79,14 +79,14 @@ required_files= if checkyesno sendmail_submit_enable; then name="sendmail_submit" - rcvar=`set_rcvar` + rcvar="sendmail_submit_enable" start_cmd="${command} ${sendmail_submit_flags}" run_rc_command "$1" fi if checkyesno sendmail_outbound_enable; then name="sendmail_outbound" - rcvar=`set_rcvar` + rcvar="sendmail_outbound_enable" start_cmd="${command} ${sendmail_outbound_flags}" run_rc_command "$1" fi Modified: head/etc/rc.d/sshd ============================================================================== --- head/etc/rc.d/sshd Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/sshd Sat Jan 14 02:18:41 2012 (r230099) @@ -10,7 +10,7 @@ . /etc/rc.subr name="sshd" -rcvar=`set_rcvar` +rcvar="sshd_enable" command="/usr/sbin/${name}" keygen_cmd="sshd_keygen" start_precmd="sshd_precmd" Modified: head/etc/rc.d/syslogd ============================================================================== --- head/etc/rc.d/syslogd Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/syslogd Sat Jan 14 02:18:41 2012 (r230099) @@ -10,7 +10,7 @@ . /etc/rc.subr name="syslogd" -rcvar=`set_rcvar` +rcvar="syslogd_enable" pidfile="/var/run/syslog.pid" command="/usr/sbin/${name}" required_files="/etc/syslog.conf" @@ -41,7 +41,7 @@ syslogd_precmd() # for _l in $altlog_proglist; do eval _ldir=\$${_l}_chrootdir - if checkyesno `set_rcvar $_l` && [ -n "$_ldir" ]; then + if checkyesno ${_l}_enable && [ -n "$_ldir" ]; then echo "${_ldir}/var/run/log" >> $sockfile fi done Modified: head/etc/rc.d/timed ============================================================================== --- head/etc/rc.d/timed Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/timed Sat Jan 14 02:18:41 2012 (r230099) @@ -11,7 +11,7 @@ . /etc/rc.subr name="timed" -rcvar=`set_rcvar` +rcvar="timed_enable" command="/usr/sbin/${name}" load_rc_config $name Modified: head/etc/rc.d/ubthidhci ============================================================================== --- head/etc/rc.d/ubthidhci Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/ubthidhci Sat Jan 14 02:18:41 2012 (r230099) @@ -11,8 +11,8 @@ . /etc/rc.subr name="ubthidhci" +rcvar="ubthidhci_enable" command="/usr/sbin/usbconfig" -rcvar=`set_rcvar` start_precmd="ubthidhci_prestart" ubthidhci_prestart() Modified: head/etc/rc.d/virecover ============================================================================== --- head/etc/rc.d/virecover Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/virecover Sat Jan 14 02:18:41 2012 (r230099) @@ -12,7 +12,7 @@ . /etc/rc.subr name="virecover" -rcvar="`set_rcvar`" +rcvar="virecover_enable" stop_cmd=":" start_cmd="virecover_start" Modified: head/etc/rc.d/watchdogd ============================================================================== --- head/etc/rc.d/watchdogd Sat Jan 14 00:53:26 2012 (r230098) +++ head/etc/rc.d/watchdogd Sat Jan 14 02:18:41 2012 (r230099) @@ -34,7 +34,7 @@ . /etc/rc.subr name="watchdogd" -rcvar="`set_rcvar`" +rcvar="watchdogd_enable" command="/usr/sbin/${name}" pidfile="/var/run/${name}.pid" From owner-svn-src-all@FreeBSD.ORG Sat Jan 14 04:04:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 351D41065675; Sat, 14 Jan 2012 04:04:59 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 245098FC08; Sat, 14 Jan 2012 04:04: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 q0E44xbS093998; Sat, 14 Jan 2012 04:04:59 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0E44wFa093996; Sat, 14 Jan 2012 04:04:58 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201201140404.q0E44wFa093996@svn.freebsd.org> From: Rick Macklem Date: Sat, 14 Jan 2012 04:04: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: r230100 - head/sys/fs/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 04:04:59 -0000 Author: rmacklem Date: Sat Jan 14 04:04:58 2012 New Revision: 230100 URL: http://svn.freebsd.org/changeset/base/230100 Log: Tai Horgan reported via email that there were two places in the new NFSv4 server where the code follows the wrong list. Fortunately, for these fairly rare cases, the lc_stateid[] lists are normally empty. This patch fixes the code to follow the correct list. Reported by: tai.horgan at isilon.com Discussed with: zack MFC after: 2 weeks Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Sat Jan 14 02:18:41 2012 (r230099) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Sat Jan 14 04:04:58 2012 (r230100) @@ -315,7 +315,7 @@ nfsrv_setclient(struct nfsrv_descript *n for (i = 0; i < NFSSTATEHASHSIZE; i++) { LIST_NEWHEAD(&new_clp->lc_stateid[i], &clp->lc_stateid[i], ls_hash); - LIST_FOREACH(tstp, &new_clp->lc_stateid[i], ls_list) + LIST_FOREACH(tstp, &new_clp->lc_stateid[i], ls_hash) tstp->ls_clp = new_clp; } LIST_INSERT_HEAD(NFSCLIENTHASH(new_clp->lc_clientid), new_clp, @@ -369,7 +369,7 @@ nfsrv_setclient(struct nfsrv_descript *n for (i = 0; i < NFSSTATEHASHSIZE; i++) { LIST_NEWHEAD(&new_clp->lc_stateid[i], &clp->lc_stateid[i], ls_hash); - LIST_FOREACH(tstp, &new_clp->lc_stateid[i], ls_list) + LIST_FOREACH(tstp, &new_clp->lc_stateid[i], ls_hash) tstp->ls_clp = new_clp; } LIST_INSERT_HEAD(NFSCLIENTHASH(new_clp->lc_clientid), new_clp, From owner-svn-src-all@FreeBSD.ORG Sat Jan 14 07:26:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFB63106564A; Sat, 14 Jan 2012 07:26:17 +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 9AA5D8FC08; Sat, 14 Jan 2012 07:26: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 q0E7QHAB000338; Sat, 14 Jan 2012 07:26:17 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0E7QHv9000336; Sat, 14 Jan 2012 07:26:17 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201201140726.q0E7QHv9000336@svn.freebsd.org> From: Kirk McKusick Date: Sat, 14 Jan 2012 07:26: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: r230101 - head/sys/ufs/ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 07:26:18 -0000 Author: mckusick Date: Sat Jan 14 07:26:16 2012 New Revision: 230101 URL: http://svn.freebsd.org/changeset/base/230101 Log: Convert FFS mount error messages from kernel printf's to using the vfs_mount_error error message facility provided by the nmount interface. Clean up formatting of mount warnings which still need to use kernel printf's since they do not return errors. Requested by: Craig Rodrigues MFC after: 2 weeks Modified: head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Sat Jan 14 04:04:58 2012 (r230100) +++ head/sys/ufs/ffs/ffs_vfsops.c Sat Jan 14 07:26:16 2012 (r230101) @@ -196,11 +196,13 @@ ffs_mount(struct mount *mp) 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"); + vfs_mount_error(mp, + "Checker enable: Must be read-only"); return (EINVAL); } } else if (vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0) == 0) { - printf("Checker enable: Must be read-only\n"); + vfs_mount_error(mp, + "Checker enable: Must be read-only"); return (EINVAL); } /* Set to -1 if we are done */ @@ -210,8 +212,9 @@ ffs_mount(struct mount *mp) if (vfs_getopt(mp->mnt_optnew, "nfsv4acls", NULL, NULL) == 0) { if (mntorflags & MNT_ACLS) { - printf("WARNING: \"acls\" and \"nfsv4acls\" " - "options are mutually exclusive\n"); + vfs_mount_error(mp, + "\"acls\" and \"nfsv4acls\" options " + "are mutually exclusive"); return (EINVAL); } mntorflags |= MNT_NFS4ACLS; @@ -292,8 +295,8 @@ ffs_mount(struct mount *mp) } if (fs->fs_pendingblocks != 0 || fs->fs_pendinginodes != 0) { - printf("%s: %s: blocks %jd files %d\n", - fs->fs_fsmnt, "update error", + printf("WARNING: %s Update error: blocks %jd " + "files %d\n", fs->fs_fsmnt, (intmax_t)fs->fs_pendingblocks, fs->fs_pendinginodes); fs->fs_pendingblocks = 0; @@ -336,7 +339,8 @@ ffs_mount(struct mount *mp) * If we are running a checker, do not allow upgrade. */ if (ump->um_fsckpid > 0) { - printf("Active checker, cannot rw upgrade\n"); + vfs_mount_error(mp, + "Active checker, cannot upgrade to write"); return (EINVAL); } /* @@ -360,15 +364,16 @@ ffs_mount(struct mount *mp) ((fs->fs_flags & (FS_SUJ | FS_NEEDSFSCK)) == 0 && (fs->fs_flags & FS_DOSOFTDEP))) { - printf("WARNING: %s was not %s\n", - fs->fs_fsmnt, "properly dismounted"); + printf("WARNING: %s was not properly " + "dismounted\n", fs->fs_fsmnt); } else { - printf( -"WARNING: R/W mount of %s denied. Filesystem is not clean - run fsck\n", - fs->fs_fsmnt); - if (fs->fs_flags & FS_SUJ) - printf( -"WARNING: Forced mount will invalidate journal contents\n"); + vfs_mount_error(mp, + "R/W mount of %s denied. %s.%s", + fs->fs_fsmnt, + "Filesystem is not clean - run fsck", + (fs->fs_flags & FS_SUJ) == 0 ? "" : + " Forced mount will invalidate" + " journal contents"); return (EPERM); } } @@ -439,7 +444,8 @@ ffs_mount(struct mount *mp) */ if (fsckpid > 0) { if (ump->um_fsckpid != 0) { - printf("Active checker already running on %s\n", + vfs_mount_error(mp, + "Active checker already running on %s", fs->fs_fsmnt); return (EINVAL); } @@ -454,7 +460,8 @@ ffs_mount(struct mount *mp) g_topology_unlock(); PICKUP_GIANT(); if (error) { - printf("Checker activation failed on %s\n", + vfs_mount_error(mp, + "Checker activation failed on %s", fs->fs_fsmnt); return (error); } @@ -543,8 +550,8 @@ ffs_mount(struct mount *mp) g_topology_unlock(); PICKUP_GIANT(); if (error) { - printf("Checker activation failed on %s\n", - fs->fs_fsmnt); + printf("WARNING: %s: Checker activation " + "failed\n", fs->fs_fsmnt); } else { ump->um_fsckpid = fsckpid; if (fs->fs_snapinum[0] != 0) @@ -655,8 +662,8 @@ ffs_reload(struct mount *mp, struct thre ffs_oldfscompat_read(fs, VFSTOUFS(mp), sblockloc); UFS_LOCK(ump); if (fs->fs_pendingblocks != 0 || fs->fs_pendinginodes != 0) { - printf("%s: reload pending error: blocks %jd files %d\n", - fs->fs_fsmnt, (intmax_t)fs->fs_pendingblocks, + printf("WARNING: %s: reload pending error: blocks %jd " + "files %d\n", fs->fs_fsmnt, (intmax_t)fs->fs_pendingblocks, fs->fs_pendinginodes); fs->fs_pendingblocks = 0; fs->fs_pendinginodes = 0; @@ -822,27 +829,25 @@ ffs_mountfs(devvp, mp, td) printf("WARNING: %s was not properly dismounted\n", fs->fs_fsmnt); } else { - printf( -"WARNING: R/W mount of %s denied. Filesystem is not clean - run fsck\n", - fs->fs_fsmnt); - if (fs->fs_flags & FS_SUJ) - printf( -"WARNING: Forced mount will invalidate journal contents\n"); + vfs_mount_error(mp, "R/W mount of %s denied. %s%s", + fs->fs_fsmnt, "Filesystem is not clean - run fsck.", + (fs->fs_flags & FS_SUJ) == 0 ? "" : + " Forced mount will invalidate journal contents"); error = EPERM; goto out; } if ((fs->fs_pendingblocks != 0 || fs->fs_pendinginodes != 0) && (mp->mnt_flag & MNT_FORCE)) { - printf("%s: lost blocks %jd files %d\n", fs->fs_fsmnt, - (intmax_t)fs->fs_pendingblocks, + printf("WARNING: %s: lost blocks %jd files %d\n", + fs->fs_fsmnt, (intmax_t)fs->fs_pendingblocks, fs->fs_pendinginodes); fs->fs_pendingblocks = 0; fs->fs_pendinginodes = 0; } } if (fs->fs_pendingblocks != 0 || fs->fs_pendinginodes != 0) { - printf("%s: mount pending error: blocks %jd files %d\n", - fs->fs_fsmnt, (intmax_t)fs->fs_pendingblocks, + printf("WARNING: %s: mount pending error: blocks %jd " + "files %d\n", fs->fs_fsmnt, (intmax_t)fs->fs_pendingblocks, fs->fs_pendinginodes); fs->fs_pendingblocks = 0; fs->fs_pendinginodes = 0; @@ -862,16 +867,15 @@ ffs_mountfs(devvp, mp, td) mp->mnt_flag |= MNT_GJOURNAL; MNT_IUNLOCK(mp); } else { - printf( -"WARNING: %s: GJOURNAL flag on fs but no gjournal provider below\n", + printf("WARNING: %s: GJOURNAL flag on fs " + "but no gjournal provider below\n", mp->mnt_stat.f_mntonname); free(mp->mnt_gjprovider, M_UFSMNT); mp->mnt_gjprovider = NULL; } #else - printf( -"WARNING: %s: GJOURNAL flag on fs but no UFS_GJOURNAL support\n", - mp->mnt_stat.f_mntonname); + printf("WARNING: %s: GJOURNAL flag on fs but no " + "UFS_GJOURNAL support\n", mp->mnt_stat.f_mntonname); #endif } else { mp->mnt_gjprovider = NULL; @@ -955,9 +959,8 @@ ffs_mountfs(devvp, mp, td) mp->mnt_flag |= MNT_MULTILABEL; MNT_IUNLOCK(mp); #else - printf( -"WARNING: %s: multilabel flag on fs but no MAC support\n", - mp->mnt_stat.f_mntonname); + printf("WARNING: %s: multilabel flag on fs but " + "no MAC support\n", mp->mnt_stat.f_mntonname); #endif } if ((fs->fs_flags & FS_ACLS) != 0) { @@ -965,8 +968,9 @@ ffs_mountfs(devvp, mp, td) MNT_ILOCK(mp); if (mp->mnt_flag & MNT_NFS4ACLS) - printf("WARNING: ACLs flag on fs conflicts with " - "\"nfsv4acls\" mount option; option ignored\n"); + printf("WARNING: %s: ACLs flag on fs conflicts with " + "\"nfsv4acls\" mount option; option ignored\n", + mp->mnt_stat.f_mntonname); mp->mnt_flag &= ~MNT_NFS4ACLS; mp->mnt_flag |= MNT_ACLS; @@ -981,16 +985,16 @@ ffs_mountfs(devvp, mp, td) MNT_ILOCK(mp); if (mp->mnt_flag & MNT_ACLS) - printf("WARNING: NFSv4 ACLs flag on fs conflicts with " - "\"acls\" mount option; option ignored\n"); + printf("WARNING: %s: NFSv4 ACLs flag on fs conflicts " + "with \"acls\" mount option; option ignored\n", + mp->mnt_stat.f_mntonname); mp->mnt_flag &= ~MNT_ACLS; mp->mnt_flag |= MNT_NFS4ACLS; MNT_IUNLOCK(mp); #else - printf( -"WARNING: %s: NFSv4 ACLs flag on fs but no ACLs support\n", - mp->mnt_stat.f_mntonname); + printf("WARNING: %s: NFSv4 ACLs flag on fs but no " + "ACLs support\n", mp->mnt_stat.f_mntonname); #endif } if ((fs->fs_flags & FS_TRIM) != 0) { @@ -998,12 +1002,12 @@ ffs_mountfs(devvp, mp, td) if (g_io_getattr("GEOM::candelete", cp, &size, &ump->um_candelete) == 0) { if (!ump->um_candelete) - printf( -"WARNING: %s: TRIM flag on fs but disk does not support TRIM\n", + printf("WARNING: %s: TRIM flag on fs but disk " + "does not support TRIM\n", mp->mnt_stat.f_mntonname); } else { - printf( -"WARNING: %s: TRIM flag on fs but cannot get whether disk supports TRIM\n", + printf("WARNING: %s: TRIM flag on fs but disk does " + "not confirm that it supports TRIM\n", mp->mnt_stat.f_mntonname); ump->um_candelete = 0; } @@ -1210,15 +1214,16 @@ ffs_unmount(mp, mntflags) flags = 0; td = curthread; fs = ump->um_fs; + susp = 0; if (mntflags & MNT_FORCE) { flags |= FORCECLOSE; susp = fs->fs_ronly != 0; - } else - susp = 0; + } #ifdef UFS_EXTATTR if ((error = ufs_extattr_stop(mp, td))) { if (error != EOPNOTSUPP) - printf("ffs_unmount: ufs_extattr_stop returned %d\n", + printf("WARNING: unmount %s: ufs_extattr_stop " + "returned errno %d\n", mp->mnt_stat.f_mntonname, error); e_restart = 0; } else { @@ -1256,8 +1261,8 @@ ffs_unmount(mp, mntflags) UFS_LOCK(ump); if (fs->fs_pendingblocks != 0 || fs->fs_pendinginodes != 0) { - printf("%s: unmount pending error: blocks %jd files %d\n", - fs->fs_fsmnt, (intmax_t)fs->fs_pendingblocks, + printf("WARNING: unmount %s: pending error: blocks %jd " + "files %d\n", fs->fs_fsmnt, (intmax_t)fs->fs_pendingblocks, fs->fs_pendinginodes); fs->fs_pendingblocks = 0; fs->fs_pendinginodes = 0; @@ -1433,10 +1438,9 @@ ffs_sync(mp, waitfor) td = curthread; fs = ump->um_fs; - if (fs->fs_fmod != 0 && fs->fs_ronly != 0 && ump->um_fsckpid == 0) { - printf("fs = %s\n", fs->fs_fsmnt); - panic("ffs_sync: rofs mod"); - } + if (fs->fs_fmod != 0 && fs->fs_ronly != 0 && ump->um_fsckpid == 0) + panic("%s: ffs_sync: modification on read-only filesystem", + fs->fs_fsmnt); /* * Write back each (modified) inode. */ @@ -1844,13 +1848,13 @@ ffs_sbupdate(ump, waitfor, suspended) bp = sbbp; if (fs->fs_magic == FS_UFS1_MAGIC && fs->fs_sblockloc != SBLOCK_UFS1 && (fs->fs_flags & FS_FLAGS_UPDATED) == 0) { - printf("%s: correcting fs_sblockloc from %jd to %d\n", + printf("WARNING: %s: correcting fs_sblockloc from %jd to %d\n", fs->fs_fsmnt, fs->fs_sblockloc, SBLOCK_UFS1); fs->fs_sblockloc = SBLOCK_UFS1; } if (fs->fs_magic == FS_UFS2_MAGIC && fs->fs_sblockloc != SBLOCK_UFS2 && (fs->fs_flags & FS_FLAGS_UPDATED) == 0) { - printf("%s: correcting fs_sblockloc from %jd to %d\n", + printf("WARNING: %s: correcting fs_sblockloc from %jd to %d\n", fs->fs_fsmnt, fs->fs_sblockloc, SBLOCK_UFS2); fs->fs_sblockloc = SBLOCK_UFS2; } From owner-svn-src-all@FreeBSD.ORG Sat Jan 14 08:11:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 663A91065672; Sat, 14 Jan 2012 08:11:41 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 552A38FC0C; Sat, 14 Jan 2012 08: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 q0E8Bf5g001856; Sat, 14 Jan 2012 08:11:41 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0E8BfFw001854; Sat, 14 Jan 2012 08:11:41 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201201140811.q0E8BfFw001854@svn.freebsd.org> From: David Schultz Date: Sat, 14 Jan 2012 08: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: r230102 - head/tools/regression/lib/msun X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 08:11:41 -0000 Author: das Date: Sat Jan 14 08:11:40 2012 New Revision: 230102 URL: http://svn.freebsd.org/changeset/base/230102 Log: Fix a test that doesn't work on architectures where long double is no wider than double. Thanks to Ian Lepore for catching the bug. Modified: head/tools/regression/lib/msun/test-next.c Modified: head/tools/regression/lib/msun/test-next.c ============================================================================== --- head/tools/regression/lib/msun/test-next.c Sat Jan 14 07:26:16 2012 (r230101) +++ head/tools/regression/lib/msun/test-next.c Sat Jan 14 08:11:40 2012 (r230102) @@ -211,7 +211,9 @@ main(int argc, char *argv[]) test(idd(nextafter(DBL_MAX, INFINITY)), INFINITY, ex_over); test(idd(nextafter(INFINITY, 0.0)), DBL_MAX, 0); test(idd(nexttoward(DBL_MAX, DBL_MAX * 2.0L)), INFINITY, ex_over); +#if LDBL_MANT_DIG > 53 test(idd(nexttoward(INFINITY, DBL_MAX * 2.0L)), DBL_MAX, 0); +#endif testf(idf(nextafterf(FLT_MAX, INFINITY)), INFINITY, ex_over); testf(idf(nextafterf(INFINITY, 0.0)), FLT_MAX, 0); From owner-svn-src-all@FreeBSD.ORG Sat Jan 14 08:59:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D599C106564A; Sat, 14 Jan 2012 08:59:02 +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 AA5E08FC16; Sat, 14 Jan 2012 08:59:02 +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 q0E8x2Op003417; Sat, 14 Jan 2012 08:59:02 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0E8x2gV003415; Sat, 14 Jan 2012 08:59:02 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201201140859.q0E8x2gV003415@svn.freebsd.org> From: Doug Barton Date: Sat, 14 Jan 2012 08:59:02 +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: r230103 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 08:59:02 -0000 Author: dougb Date: Sat Jan 14 08:59:02 2012 New Revision: 230103 URL: http://svn.freebsd.org/changeset/base/230103 Log: Now that its callers have been udpated, remove set_rcvar(). The concept of set_rcvar() was nice in theory, but the forks it creates are a drag on the startup process, which is especially noticeable on slower systems, such as embedded ones. Modified: head/etc/rc.subr Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Sat Jan 14 08:11:40 2012 (r230102) +++ head/etc/rc.subr Sat Jan 14 08:59:02 2012 (r230103) @@ -54,47 +54,6 @@ JID=`$PS -p $$ -o jid=` # functions # --------- -# set_rcvar [var] [defval] [desc] -# -# Echo or define a rc.conf(5) variable name. Global variable -# $rcvars is used. -# -# If no argument is specified, echo "${name}_enable". -# -# If only a var is specified, echo "${var}_enable". -# -# If var and defval are specified, the ${var} is defined as -# rc.conf(5) variable and the default value is ${defvar}. An -# optional argument $desc can also be specified to add a -# description for that. -# -set_rcvar() -{ - case $# in - 0) - echo ${name}_enable - ;; - 1) - echo ${1}_enable - ;; - *) - debug "rcvar_define: \$$1=$2 is added" \ - " as a rc.conf(5) variable." - - local _var - _var=$1 - rcvars="${rcvars# } $_var" - eval ${_var}_defval=\"$2\" - shift 2 - # encode multiple lines of _desc - for l in "$@"; do - eval ${_var}_desc=\"\${${_var}_desc#^^}^^$l\" - done - eval ${_var}_desc=\"\${${_var}_desc#^^}\" - ;; - esac -} - # set_rcvar_obsolete oldvar [newvar] [msg] # Define obsolete variable. # Global variable $rcvars_obsolete is used. @@ -856,8 +815,8 @@ $command $rc_flags $command_args" echo "" fi echo "#" - # Get unique vars in $rcvar $rcvars - for _v in $rcvar $rcvars; do + # Get unique vars in $rcvar + for _v in $rcvar; do case $v in $_v\ *|\ *$_v|*\ $_v\ *) ;; *) v="${v# } $_v" ;; @@ -1003,7 +962,7 @@ run_rc_script() unset name command command_args command_interpreter \ extra_commands pidfile procname \ - rcvar rcvars rcvars_obsolete required_dirs required_files \ + rcvar rcvars_obsolete required_dirs required_files \ required_vars eval unset ${_arg}_cmd ${_arg}_precmd ${_arg}_postcmd @@ -1035,7 +994,7 @@ run_rc_script() # load_rc_config() { - local _name _var _defval _v _msg _new + local _name _rcvar_val _var _defval _v _msg _new _name=$1 if [ -z "$_name" ]; then err 3 'USAGE: load_rc_config name' @@ -1060,7 +1019,7 @@ load_rc_config() fi # Set defaults if defined. - for _var in $rcvar $rcvars; do + for _var in $rcvar; do eval _defval=\$${_var}_defval if [ -n "$_defval" ]; then eval : \${$_var:=\$${_var}_defval} From owner-svn-src-all@FreeBSD.ORG Sat Jan 14 09:10:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46867106564A; Sat, 14 Jan 2012 09:10:21 +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 355B48FC15; Sat, 14 Jan 2012 09:10: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 q0E9ALXc003805; Sat, 14 Jan 2012 09:10:21 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0E9AKdG003803; Sat, 14 Jan 2012 09:10:20 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201201140910.q0E9AKdG003803@svn.freebsd.org> From: Michael Tuexen Date: Sat, 14 Jan 2012 09:10:20 +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: r230104 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 09:10:21 -0000 Author: tuexen Date: Sat Jan 14 09:10:20 2012 New Revision: 230104 URL: http://svn.freebsd.org/changeset/base/230104 Log: Fix two bugs, which result in a panic when calling getsockopt() using SCTP_RECVINFO or SCTP_NXTINFO. Reported by Clement Lecigne and forwarded to us by zi@. MFC after: 3 days. Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sat Jan 14 08:59:02 2012 (r230103) +++ head/sys/netinet/sctp_usrreq.c Sat Jan 14 09:10:20 2012 (r230104) @@ -3019,7 +3019,7 @@ flags_out: SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; } else { - SCTP_INP_RUNLOCK(inp); + SCTP_INP_RLOCK(inp); onoff = sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVRCVINFO); SCTP_INP_RUNLOCK(inp); } @@ -3038,7 +3038,7 @@ flags_out: SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; } else { - SCTP_INP_RUNLOCK(inp); + SCTP_INP_RLOCK(inp); onoff = sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVNXTINFO); SCTP_INP_RUNLOCK(inp); } From owner-svn-src-all@FreeBSD.ORG Sat Jan 14 09:10:54 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6425F1065670; Sat, 14 Jan 2012 09:10:54 +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 1EEE68FC1F; Sat, 14 Jan 2012 09:10:52 +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 LAA29090; Sat, 14 Jan 2012 11:10:51 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1RlzdS-000Lbs-VZ; Sat, 14 Jan 2012 11:10:50 +0200 Message-ID: <4F114699.2090008@FreeBSD.org> Date: Sat, 14 Jan 2012 11:10:49 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: Doug Barton References: <201201140859.q0E8x2gV003415@svn.freebsd.org> In-Reply-To: <201201140859.q0E8x2gV003415@svn.freebsd.org> X-Enigmail-Version: undefined 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: r230103 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 09:10:54 -0000 on 14/01/2012 10:59 Doug Barton said the following: > Author: dougb > Date: Sat Jan 14 08:59:02 2012 > New Revision: 230103 > URL: http://svn.freebsd.org/changeset/base/230103 > > Log: > Now that its callers have been udpated, remove set_rcvar(). > > The concept of set_rcvar() was nice in theory, but the forks > it creates are a drag on the startup process, which is especially > noticeable on slower systems, such as embedded ones. Will this break ports that install rc.d scripts? -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Sat Jan 14 09:17:11 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id D146A106564A; Sat, 14 Jan 2012 09:17:11 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id ACA3B150992; Sat, 14 Jan 2012 09:17:10 +0000 (UTC) Message-ID: <4F114815.1080001@FreeBSD.org> Date: Sat, 14 Jan 2012 01:17:09 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: Andriy Gapon References: <201201140859.q0E8x2gV003415@svn.freebsd.org> <4F114699.2090008@FreeBSD.org> In-Reply-To: <4F114699.2090008@FreeBSD.org> X-Enigmail-Version: undefined 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: r230103 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 09:17:11 -0000 On 01/14/2012 01:10, Andriy Gapon wrote: > on 14/01/2012 10:59 Doug Barton said the following: >> Author: dougb >> Date: Sat Jan 14 08:59:02 2012 >> New Revision: 230103 >> URL: http://svn.freebsd.org/changeset/base/230103 >> >> Log: >> Now that its callers have been udpated, remove set_rcvar(). >> >> The concept of set_rcvar() was nice in theory, but the forks >> it creates are a drag on the startup process, which is especially >> noticeable on slower systems, such as embedded ones. > > Will this break ports that install rc.d scripts? Please see my HEADS UP message to -current. -- You can observe a lot just by watching. -- Yogi Berra Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Sat Jan 14 09:18:05 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24CFE106564A; Sat, 14 Jan 2012 09:18:05 +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 D0A918FC08; Sat, 14 Jan 2012 09:18:03 +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 LAA29165; Sat, 14 Jan 2012 11:18:02 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1RlzkQ-000LcP-0V; Sat, 14 Jan 2012 11:18:02 +0200 Message-ID: <4F114849.2030809@FreeBSD.org> Date: Sat, 14 Jan 2012 11:18:01 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: Doug Barton References: <201201140859.q0E8x2gV003415@svn.freebsd.org> <4F114699.2090008@FreeBSD.org> <4F114815.1080001@FreeBSD.org> In-Reply-To: <4F114815.1080001@FreeBSD.org> X-Enigmail-Version: undefined 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: r230103 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 09:18:05 -0000 on 14/01/2012 11:17 Doug Barton said the following: > On 01/14/2012 01:10, Andriy Gapon wrote: >> on 14/01/2012 10:59 Doug Barton said the following: >>> Author: dougb >>> Date: Sat Jan 14 08:59:02 2012 >>> New Revision: 230103 >>> URL: http://svn.freebsd.org/changeset/base/230103 >>> >>> Log: >>> Now that its callers have been udpated, remove set_rcvar(). >>> >>> The concept of set_rcvar() was nice in theory, but the forks >>> it creates are a drag on the startup process, which is especially >>> noticeable on slower systems, such as embedded ones. >> >> Will this break ports that install rc.d scripts? > > Please see my HEADS UP message to -current. Thank you. -- Andriy Gapon From owner-svn-src-all@FreeBSD.ORG Sat Jan 14 09:26:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99915106566B; Sat, 14 Jan 2012 09:26:28 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 2913C8FC0A; Sat, 14 Jan 2012 09:26:28 +0000 (UTC) Received: by iagz16 with SMTP id z16so1230349iag.13 for ; Sat, 14 Jan 2012 01:26:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=mH2V1ItPgnpdahmjx9X2ndYayyUWXG1SNV19G06ZqoA=; b=nKGREmB47rYGk90+7tH5SbT2MswZtD5d7KZg+L0DgB5KQ3HyHh4ad8oYU4JGdj2s64 tK0E3L9BZWgAt4q6ILC3B0gyLEIyxPPd9wsymwNwW6Ef1NcAqped5xqNoE6oVgK8dRYi xQAErhcR5EglfyLY3n1F9YLrV1rZzFrDs00EQ= Received: by 10.50.104.163 with SMTP id gf3mr1555054igb.26.1326533187667; Sat, 14 Jan 2012 01:26:27 -0800 (PST) Received: from fuji-wireless.local (c-24-6-49-154.hsd1.ca.comcast.net. [24.6.49.154]) by mx.google.com with ESMTPS id bj3sm11674220igb.4.2012.01.14.01.26.26 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 14 Jan 2012 01:26:26 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=windows-1252 From: Garrett Cooper In-Reply-To: <4F114849.2030809@FreeBSD.org> Date: Sat, 14 Jan 2012 01:26:24 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <2DED097D-FA2E-46A9-B316-5FF130524E84@gmail.com> References: <201201140859.q0E8x2gV003415@svn.freebsd.org> <4F114699.2090008@FreeBSD.org> <4F114815.1080001@FreeBSD.org> <4F114849.2030809@FreeBSD.org> To: Andriy Gapon X-Mailer: Apple Mail (2.1251.1) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Doug Barton , src-committers@FreeBSD.org Subject: Re: svn commit: r230103 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 09:26:28 -0000 On Jan 14, 2012, at 1:18 AM, Andriy Gapon wrote: > on 14/01/2012 11:17 Doug Barton said the following: >> On 01/14/2012 01:10, Andriy Gapon wrote: >>> on 14/01/2012 10:59 Doug Barton said the following: >>>> Author: dougb >>>> Date: Sat Jan 14 08:59:02 2012 >>>> New Revision: 230103 >>>> URL: http://svn.freebsd.org/changeset/base/230103 >>>>=20 >>>> Log: >>>> Now that its callers have been udpated, remove set_rcvar(). >>>>=20 >>>> The concept of set_rcvar() was nice in theory, but the forks >>>> it creates are a drag on the startup process, which is especially >>>> noticeable on slower systems, such as embedded ones. >>>=20 >>> Will this break ports that install rc.d scripts? >>=20 >> Please see my HEADS UP message to -current. >=20 > Thank you. Adding an entry to UPDATING would be appreciated though=85 Thanks, -Garrett= From owner-svn-src-all@FreeBSD.ORG Sat Jan 14 09:31:22 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id EBC4D106564A; Sat, 14 Jan 2012 09:31:22 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id E49DF1521D0; Sat, 14 Jan 2012 09:31:21 +0000 (UTC) Message-ID: <4F114B69.3070404@FreeBSD.org> Date: Sat, 14 Jan 2012 01:31:21 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: Garrett Cooper References: <201201140859.q0E8x2gV003415@svn.freebsd.org> <4F114699.2090008@FreeBSD.org> <4F114815.1080001@FreeBSD.org> <4F114849.2030809@FreeBSD.org> <2DED097D-FA2E-46A9-B316-5FF130524E84@gmail.com> In-Reply-To: <2DED097D-FA2E-46A9-B316-5FF130524E84@gmail.com> X-Enigmail-Version: undefined OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Andriy Gapon Subject: Re: svn commit: r230103 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 09:31:23 -0000 On 01/14/2012 01:26, Garrett Cooper wrote: > Adding an entry to UPDATING would be appreciated though… Good point. It's done now. :) Doug -- You can observe a lot just by watching. -- Yogi Berra Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Sat Jan 14 09:32:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74DBE1065670; Sat, 14 Jan 2012 09:32:59 +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 641E08FC0A; Sat, 14 Jan 2012 09:32: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 q0E9Wx8d004501; Sat, 14 Jan 2012 09:32:59 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0E9WxS0004499; Sat, 14 Jan 2012 09:32:59 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201201140932.q0E9WxS0004499@svn.freebsd.org> From: Doug Barton Date: Sat, 14 Jan 2012 09:32: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: r230105 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 09:32:59 -0000 Author: dougb Date: Sat Jan 14 09:32:58 2012 New Revision: 230105 URL: http://svn.freebsd.org/changeset/base/230105 Log: Add an entry detailing the removal of set_rcvar() from /etc/rc.subr Requested by: Garrett Cooper Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Sat Jan 14 09:10:20 2012 (r230104) +++ head/UPDATING Sat Jan 14 09:32:58 2012 (r230105) @@ -22,6 +22,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 machines to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20120114: + The set_rcvar() function has been removed from /etc/rc.subr. All + base and ports rc.d scripts have been updated, so if you have a + port installed with a script in /usr/local/etc/rc.d you can either + hand-edit the rcvar= line, or reinstall the port. + 20120109: panic(9) now stops other CPUs in the SMP systems, disables interrupts on the current CPU and prevents other threads from running. From owner-svn-src-all@FreeBSD.ORG Sat Jan 14 09:42:05 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D68E1065781; Sat, 14 Jan 2012 09:42:05 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.freebsd.org (Postfix) with ESMTP id 8F6258FC15; Sat, 14 Jan 2012 09:42:03 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0E9fxcX014140 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 14 Jan 2012 20:42:01 +1100 Date: Sat, 14 Jan 2012 20:41:59 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Guy Helmer In-Reply-To: <201201121545.q0CFj8fu015959@svn.freebsd.org> Message-ID: <20120114204053.N1458@besplex.bde.org> References: <201201121545.q0CFj8fu015959@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: r230016 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 09:42:05 -0000 On Thu, 12 Jan 2012, Guy Helmer wrote: > Log: > Fix disorder in MAN and MLINKS lists. > > Requested by bde. Thanks. This completes fixing all the old style bugs that I noticed in libutil.h and the Makefile. I noticed some new ones... Bruce From owner-svn-src-all@FreeBSD.ORG Sat Jan 14 09:57:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82A23106574A; Sat, 14 Jan 2012 09:57:14 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 711FE8FC13; Sat, 14 Jan 2012 09:57: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 q0E9vEHi005254; Sat, 14 Jan 2012 09:57:14 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0E9vEZL005252; Sat, 14 Jan 2012 09:57:14 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201140957.q0E9vEZL005252@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 14 Jan 2012 09:57: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: r230106 - head/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 09:57:14 -0000 Author: glebius Date: Sat Jan 14 09:57:13 2012 New Revision: 230106 URL: http://svn.freebsd.org/changeset/base/230106 Log: - Add possibility to build release from a certain revision, supplied via -r. - To ease adding new features, roll out a getopt loop here. Reviewed by: nwhitehorn Modified: head/release/generate-release.sh Modified: head/release/generate-release.sh ============================================================================== --- head/release/generate-release.sh Sat Jan 14 09:32:58 2012 (r230105) +++ head/release/generate-release.sh Sat Jan 14 09:57:13 2012 (r230106) @@ -3,7 +3,7 @@ # generate-release.sh: check out source trees, and build release components with # totally clean, fresh trees. # -# Usage: generate-release.sh svn-branch scratch-dir +# Usage: generate-release.sh [-r revision] svn-branch scratch-dir # # Environment variables: # CVSUP_HOST: Host of a cvsup server to obtain the ports and documentation @@ -21,10 +21,38 @@ # $FreeBSD$ # +usage() +{ + echo "Usage: $0 [-r revision] svn-branch scratch-dir" + exit 1 +} + +args=`getopt r: $*` +if [ $? -ne 0 ]; then + usage +fi +set -- $args +REVISION= +while true; do + case "$1" in + -r) + REVISION="-r $2" + shift; shift + ;; + --) + shift; break + ;; + esac +done + +if [ $# -lt 2 ]; then + usage +fi + mkdir -p $2/usr/src set -e # Everything must succeed -svn co ${SVNROOT:-svn://svn.freebsd.org/base}/$1 $2/usr/src +svn co ${SVNROOT:-svn://svn.freebsd.org/base}/$1 $2/usr/src $REVISION if [ ! -z $CVSUP_HOST ]; then cat > $2/docports-supfile << EOF *default host=$CVSUP_HOST From owner-svn-src-all@FreeBSD.ORG Sat Jan 14 10:59:33 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63880106566B; Sat, 14 Jan 2012 10:59: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 95F438FC0C; Sat, 14 Jan 2012 10:59:32 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0EAxRMf010903 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 14 Jan 2012 21:59:28 +1100 Date: Sat, 14 Jan 2012 21:59:27 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Guy Helmer In-Reply-To: <201201122249.q0CMnaZe030200@svn.freebsd.org> Message-ID: <20120114204720.Q1458@besplex.bde.org> References: <201201122249.q0CMnaZe030200@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: r230037 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 10:59:33 -0000 On Thu, 12 Jan 2012, Guy Helmer wrote: > Log: > Move struct pidfh definition into pidfile.c, and leave a forward declaration > for pidfh in libutil.h in its place. > This allows us to hide the contents of the pidfh structure, and also > allowed removal of the "#ifdef _SYS_PARAM_H" guard from around the > pidfile_* function prototypes. > > Suggested by pjd. This has some new style bugs, and I noticed some more old ones: > Modified: head/lib/libutil/libutil.h > ============================================================================== > --- head/lib/libutil/libutil.h Thu Jan 12 22:30:41 2012 (r230036) > +++ head/lib/libutil/libutil.h Thu Jan 12 22:49:36 2012 (r230037) > @@ -48,6 +48,11 @@ typedef __gid_t gid_t; > #define _GID_T_DECLARED > #endif > > +#ifndef _MODE_T_DECLARED > +typedef __mode_t mode_t; > +#define _MODE_T_DECLARED > +#endif > + It's good to declare mode_t, since pidfile_open() uses it and we want to remove the dependency on . However, this definition doesn't follow KNF or the style of all the other typedef declarations in the file, since all the others follow KNF and thus have a space instead of a tab after #define and also after typedef. There are many other misfomatted spaces after #define's in this file: - for the defines for the property API (PROPERTY*). This API is ugly. I think it was mainly for sysinstall. Maybe it can be removed. Other bugs in it include its man page source being named property.3 but calling itself properties(3). There is no link from property(3), so properties(3) doesn't exist. - for the defines of UU*. These have secondary style bugs: - space instead of tab[s] after the macro name. This is worse, since it results in the macro bodies not being lined up. - bogus parentheses around macro bodies. Such parentheses are ugly enough when they are necessary, but they are not necessary for 2 of 9 cases here, since the macro body consists of a single token. - there is no comment before the UU* defines, unlike for all other groups of defines in the file. - for the defines of UU*. These have secondary style bugs: - bogus parentheses around macro bodies. As above, but worse since none of the 4 macro bodies needs them. - for the defines of PWSCAN*. - for the defines of HN*. The grouping for the 2 HN* sections is unclear The comment for the first group applies to both groups, while the comment for the second group is just unclear). This is described clearly in the man page: the 2 groups are for 2 parameters. In the header file, one of the parameters is misnamed and the other is not named. - the defines for the idempotency ifdef and for FPARSELN* and HD* are actually formatted normally. The section headers for flags definitions could be more uniform and complete. I like the style "/* Flags for : */". No need to mention the function name if the parameter name is unique and/or if the macro names indicate the function or API name like they should. > -#ifdef _SYS_PARAM_H_ > -/* for pidfile.c */ > -struct pidfh { > - int pf_fd; > - char pf_path[MAXPATHLEN + 1]; > - __dev_t pf_dev; > - ino_t pf_ino; > -}; > -#endif After moving this to pidfile.c, the man page seems to be bogus. It still says that is a prerequisite, but I think that header was only needed for MAXPATHLEN here. I checked that still compiles by itself (you had to add this typedef for that), and that most or all of its manpages except pidfile(3) only say to include it. properties(3) still says that is a prerequisite, but that hasn't been the case for 9 years or more, since other typedefs like the one for mode_t were added in 2002. realhostname(3) still says that and are prerequisites, buf obviously they aren't, since compiles by itself. was also cleaned up in 2002, so is not a prerequisite for it. realhostname() uses struct in_addr, but this doesn't make a prerequsite for using realhostname(), since you can always use it with a null pointer, or more usefully, with a pointer constructed somewhere else that knows the complete struct in_addr. pw_*(3) and PWSCAN* seem to be undocumented. Almost everything else in libutil.h is documented. > - > /* Avoid pulling in all the include files for no need */ > struct in_addr; > struct kinfo_file; > struct kinfo_proc; > struct kinfo_vmentry; The last 3 declarations are bogus. The kinfo* structs aren't used in parameter lists. Thus forward-declaring them has no effect. > +struct pidfh; struct pidfh is a return type for one of the prototypes. Unfortunately, alphabetical ordering results other prototypes being declared first. Thus this forward declaration is needed. > @@ -174,14 +170,12 @@ struct group > int gr_tmp(int _mdf); > #endif > > -#ifdef _SYS_PARAM_H_ > int pidfile_close(struct pidfh *_pfh); > int pidfile_fileno(const struct pidfh *_pfh); > struct pidfh * > pidfile_open(const char *_path, mode_t _mode, pid_t *_pidptr); > int pidfile_remove(struct pidfh *_pfh); > int pidfile_write(struct pidfh *_pfh); > -#endif Now these are unsorted, since a separate section to hold them is not needed. It was used just to make the ifdef easier to read (we don't want to split up the main list with blank lines around each ifdef, and without such blank lines the ifdefs are harder to read). Bruce From owner-svn-src-all@FreeBSD.ORG Sat Jan 14 12:11:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25CED106564A; Sat, 14 Jan 2012 12:11:38 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-tul01m020-f182.google.com (mail-tul01m020-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id C69E88FC08; Sat, 14 Jan 2012 12:11:37 +0000 (UTC) Received: by obbta17 with SMTP id ta17so4796517obb.13 for ; Sat, 14 Jan 2012 04:11:37 -0800 (PST) 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=bEd6xCEw/Fe3wA1UwLdE0RuY5viqrjqBpf1ebatnF1c=; b=clWTTYeFsJwOJ06qBFzq/NAVQJL0RERepvhDr4fTaziH1vvP7L0YV7Ai76RuUM7Si9 F8prMCQ9SfUqVkw/7DHHhLZTOO4A4kAOfkzUubJUG9MFMmp6sfv5VK+6cKxZ+Dl0l3T9 l6ydf9oAZCY1+sCqMeoAXVWRKl3H6oKn5q4jI= MIME-Version: 1.0 Received: by 10.182.43.10 with SMTP id s10mr4134713obl.43.1326543097311; Sat, 14 Jan 2012 04:11:37 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.182.171.67 with HTTP; Sat, 14 Jan 2012 04:11:37 -0800 (PST) In-Reply-To: <201201140859.q0E8x2gV003415@svn.freebsd.org> References: <201201140859.q0E8x2gV003415@svn.freebsd.org> Date: Sat, 14 Jan 2012 15:11:37 +0300 X-Google-Sender-Auth: rkmHLvgBE5ztSpZdr_yt8quRHmM Message-ID: From: Sergey Kandaurov To: Doug Barton 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 Subject: Re: svn commit: r230103 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 12:11:38 -0000 On 14 January 2012 12:59, Doug Barton wrote: > Author: dougb > Date: Sat Jan 14 08:59:02 2012 > New Revision: 230103 > URL: http://svn.freebsd.org/changeset/base/230103 > > Log: > =A0Now that its callers have been udpated, remove set_rcvar(). > > =A0The concept of set_rcvar() was nice in theory, but the forks > =A0it creates are a drag on the startup process, which is especially > =A0noticeable on slower systems, such as embedded ones. > > Modified: > =A0head/etc/rc.subr > Hi, rc(8) and rc.subr(8) still reference this function. Also, it would be fine to have some adoption to the new set_rcvar-less order like printing The Big Warning and still doing its job in Y.x branch and stop doing anything in the next Y+1.x branch. --=20 wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Sat Jan 14 14:43:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB958106566C; Sat, 14 Jan 2012 14:43:22 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A757D8FC13; Sat, 14 Jan 2012 14:43: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 q0EEhM3B037026; Sat, 14 Jan 2012 14:43:22 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0EEhM5w037024; Sat, 14 Jan 2012 14:43:22 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201141443.q0EEhM5w037024@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 14 Jan 2012 14:43: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: r230107 - head/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 14:43:22 -0000 Author: glebius Date: Sat Jan 14 14:43:22 2012 New Revision: 230107 URL: http://svn.freebsd.org/changeset/base/230107 Log: Autoguess number of make jobs based on hw.ncpu. MAKE_FLAGS can override this. While here move 'mkdir' down below 'set -e'. Modified: head/release/generate-release.sh Modified: head/release/generate-release.sh ============================================================================== --- head/release/generate-release.sh Sat Jan 14 09:57:13 2012 (r230106) +++ head/release/generate-release.sh Sat Jan 14 14:43:22 2012 (r230107) @@ -49,9 +49,18 @@ if [ $# -lt 2 ]; then usage fi -mkdir -p $2/usr/src set -e # Everything must succeed +case $MAKE_FLAGS in + *-j*) + ;; + *) + MAKE_FLAGS="$MAKE_FLAGS -j "$(sysctl -n hw.ncpu) + ;; +esac + +mkdir -p $2/usr/src + svn co ${SVNROOT:-svn://svn.freebsd.org/base}/$1 $2/usr/src $REVISION if [ ! -z $CVSUP_HOST ]; then cat > $2/docports-supfile << EOF From owner-svn-src-all@FreeBSD.ORG Sat Jan 14 17:07:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC4501065670; Sat, 14 Jan 2012 17:07:52 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8DA908FC0A; Sat, 14 Jan 2012 17:07:52 +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 q0EH7qce041354; Sat, 14 Jan 2012 17:07:52 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0EH7qUb041349; Sat, 14 Jan 2012 17:07:52 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201141707.q0EH7qUb041349@svn.freebsd.org> From: Eitan Adler Date: Sat, 14 Jan 2012 17:07:52 +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: r230108 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 17:07:52 -0000 Author: eadler (ports committer) Date: Sat Jan 14 17:07:52 2012 New Revision: 230108 URL: http://svn.freebsd.org/changeset/base/230108 Log: - Fix trivial typo Approved by: nwhitehorn MFC after: 3 days Modified: head/sys/net/bpf_buffer.c head/sys/net/bpf_buffer.h head/sys/net/bpf_zerocopy.c head/sys/net/bpf_zerocopy.h Modified: head/sys/net/bpf_buffer.c ============================================================================== --- head/sys/net/bpf_buffer.c Sat Jan 14 14:43:22 2012 (r230107) +++ head/sys/net/bpf_buffer.c Sat Jan 14 17:07:52 2012 (r230108) @@ -2,7 +2,7 @@ * Copyright (c) 2007 Seccuris Inc. * All rights reserved. * - * This sofware was developed by Robert N. M. Watson under contract to + * This software was developed by Robert N. M. Watson under contract to * Seccuris Inc. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/net/bpf_buffer.h ============================================================================== --- head/sys/net/bpf_buffer.h Sat Jan 14 14:43:22 2012 (r230107) +++ head/sys/net/bpf_buffer.h Sat Jan 14 17:07:52 2012 (r230108) @@ -2,7 +2,7 @@ * Copyright (c) 2007 Seccuris Inc. * All rights reserved. * - * This sofware was developed by Robert N. M. Watson under contract to + * This software was developed by Robert N. M. Watson under contract to * Seccuris Inc. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/net/bpf_zerocopy.c ============================================================================== --- head/sys/net/bpf_zerocopy.c Sat Jan 14 14:43:22 2012 (r230107) +++ head/sys/net/bpf_zerocopy.c Sat Jan 14 17:07:52 2012 (r230108) @@ -2,7 +2,7 @@ * Copyright (c) 2007 Seccuris Inc. * All rights reserved. * - * This sofware was developed by Robert N. M. Watson under contract to + * This software was developed by Robert N. M. Watson under contract to * Seccuris Inc. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/net/bpf_zerocopy.h ============================================================================== --- head/sys/net/bpf_zerocopy.h Sat Jan 14 14:43:22 2012 (r230107) +++ head/sys/net/bpf_zerocopy.h Sat Jan 14 17:07:52 2012 (r230108) @@ -2,7 +2,7 @@ * Copyright (c) 2007 Seccuris Inc. * All rights reserved. * - * This sofware was developed by Robert N. M. Watson under contract to + * This software was developed by Robert N. M. Watson under contract to * Seccuris Inc. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-all@FreeBSD.ORG Sat Jan 14 17:34:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFE21106564A; Sat, 14 Jan 2012 17:34:32 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9AB988FC0C; Sat, 14 Jan 2012 17:34: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 q0EHYWdB042175; Sat, 14 Jan 2012 17:34:32 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0EHYWBj042173; Sat, 14 Jan 2012 17:34:32 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201141734.q0EHYWBj042173@svn.freebsd.org> From: Eitan Adler Date: Sat, 14 Jan 2012 17:34: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: r230109 - head/sys/boot/forth X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 17:34:32 -0000 Author: eadler (ports committer) Date: Sat Jan 14 17:34:32 2012 New Revision: 230109 URL: http://svn.freebsd.org/changeset/base/230109 Log: - Document TheDraw splash screens in the default loader.conf Submitted by: Jason Hellenthal Approved by: glebius MFC after: 3 days Modified: head/sys/boot/forth/loader.conf Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Sat Jan 14 17:07:52 2012 (r230108) +++ head/sys/boot/forth/loader.conf Sat Jan 14 17:34:32 2012 (r230109) @@ -31,9 +31,10 @@ verbose_loading="NO" # Set to YES for v splash_bmp_load="NO" # Set this to YES for bmp splash screen! splash_pcx_load="NO" # Set this to YES for pcx splash screen! +splash_txt_load="NO" # Set this to YES for TheDraw splash screen! vesa_load="NO" # Set this to YES to load the vesa module bitmap_load="NO" # Set this to YES if you want splash screen! -bitmap_name="splash.bmp" # Set this to the name of the bmp or pcx file +bitmap_name="splash.bmp" # Set this to the name of the file bitmap_type="splash_image_data" # and place it on the module_path From owner-svn-src-all@FreeBSD.ORG Sat Jan 14 18:16:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95F68106564A; Sat, 14 Jan 2012 18:16:10 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 80A3E8FC08; Sat, 14 Jan 2012 18:16: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 q0EIGAsD043448; Sat, 14 Jan 2012 18:16:10 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0EIGAhc043446; Sat, 14 Jan 2012 18:16:10 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201141816.q0EIGAhc043446@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 14 Jan 2012 18:16: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: r230110 - head/share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 18:16:10 -0000 Author: glebius Date: Sat Jan 14 18:16:10 2012 New Revision: 230110 URL: http://svn.freebsd.org/changeset/base/230110 Log: No need to run buildworld before generate-release.sh. Modified: head/share/man/man7/release.7 Modified: head/share/man/man7/release.7 ============================================================================== --- head/share/man/man7/release.7 Sat Jan 14 17:34:32 2012 (r230109) +++ head/share/man/man7/release.7 Sat Jan 14 18:16:10 2012 (r230110) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 18, 2011 +.Dd January 14, 2012 .Dt RELEASE 7 .Os .Sh NAME @@ -316,9 +316,7 @@ The following sequence of commands can b .Dq "-CURRENT snapshot" in a clean environment, including ports and documentation: .Bd -literal -offset indent -cd /usr/src -make buildworld -cd release +cd /usr/src/release export CVSUP_HOST=cvsupN.freebsd.org sh generate-release.sh head /local3/release .Ed From owner-svn-src-all@FreeBSD.ORG Sat Jan 14 18:29:11 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C61EC1065670; Sat, 14 Jan 2012 18:29:11 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 37D3B8FC15; Sat, 14 Jan 2012 18:29:10 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 8229DE23; Sat, 14 Jan 2012 19:29:09 +0100 (CET) Date: Sat, 14 Jan 2012 19:27:59 +0100 From: Pawel Jakub Dawidek To: Bruce Evans Message-ID: <20120114182758.GJ1694@garage.freebsd.pl> References: <201201122249.q0CMnaZe030200@svn.freebsd.org> <20120114204720.Q1458@besplex.bde.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="j+MD90OnwjQyWNYt" Content-Disposition: inline In-Reply-To: <20120114204720.Q1458@besplex.bde.org> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Guy Helmer Subject: Re: svn commit: r230037 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 18:29:12 -0000 --j+MD90OnwjQyWNYt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jan 14, 2012 at 09:59:27PM +1100, Bruce Evans wrote: > On Thu, 12 Jan 2012, Guy Helmer wrote: >=20 > > Log: > > Move struct pidfh definition into pidfile.c, and leave a forward decla= ration > > for pidfh in libutil.h in its place. > > This allows us to hide the contents of the pidfh structure, and also > > allowed removal of the "#ifdef _SYS_PARAM_H" guard from around the > > pidfile_* function prototypes. > > > > Suggested by pjd. >=20 > This has some new style bugs, and I noticed some more old ones: >=20 > > Modified: head/lib/libutil/libutil.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/lib/libutil/libutil.h Thu Jan 12 22:30:41 2012 (r230036) > > +++ head/lib/libutil/libutil.h Thu Jan 12 22:49:36 2012 (r230037) > > @@ -48,6 +48,11 @@ typedef __gid_t gid_t; > > #define _GID_T_DECLARED > > #endif > > > > +#ifndef _MODE_T_DECLARED > > +typedef __mode_t mode_t; > > +#define _MODE_T_DECLARED > > +#endif > > + >=20 > It's good to declare mode_t, since pidfile_open() uses it and we want > to remove the dependency on . However, this definition > doesn't follow KNF or the style of all the other typedef declarations > in the file, since all the others follow KNF and thus have a space > instead of a tab after #define and also after typedef. I think you mixed space with tab. All the others have a tab after #define and typedef. I fully agree this should be consistent. > > -#ifdef _SYS_PARAM_H_ > > -/* for pidfile.c */ > > -struct pidfh { > > - int pf_fd; > > - char pf_path[MAXPATHLEN + 1]; > > - __dev_t pf_dev; > > - ino_t pf_ino; > > -}; > > -#endif >=20 > After moving this to pidfile.c, the man page seems to be bogus. It > still says that is a prerequisite, but I think that > header was only needed for MAXPATHLEN here. I checked that > still compiles by itself (you had to add this typedef for that), and > that most or all of its manpages except pidfile(3) only say to include > it. I already pointed that out to Guy and also introduced him to concept of pre-commit reviews:) > > @@ -174,14 +170,12 @@ struct group > > int gr_tmp(int _mdf); > > #endif > > > > -#ifdef _SYS_PARAM_H_ > > int pidfile_close(struct pidfh *_pfh); > > int pidfile_fileno(const struct pidfh *_pfh); > > struct pidfh * > > pidfile_open(const char *_path, mode_t _mode, pid_t *_pidptr); > > int pidfile_remove(struct pidfh *_pfh); > > int pidfile_write(struct pidfh *_pfh); > > -#endif >=20 > Now these are unsorted, since a separate section to hold them is not > needed. It was used just to make the ifdef easier to read (we don't > want to split up the main list with blank lines around each ifdef, and > without such blank lines the ifdefs are harder to read). I'd prefer not to change that. All those functions are part of pidfile(3) API and it would be better, IMHO, to keep them together here too. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --j+MD90OnwjQyWNYt Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk8RyS4ACgkQForvXbEpPzTcAgCfU+II2xcUQ1KjDM7FywkOHoRj KiIAniUhLMhFGzl5s7ew9MVx+xES1tTA =Ehm9 -----END PGP SIGNATURE----- --j+MD90OnwjQyWNYt-- From owner-svn-src-all@FreeBSD.ORG Sat Jan 14 19:08:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3356F1065670; Sat, 14 Jan 2012 19:08:40 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 02E708FC1A; Sat, 14 Jan 2012 19:08: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 q0EJ8dGg045193; Sat, 14 Jan 2012 19:08:39 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0EJ8d9A045190; Sat, 14 Jan 2012 19:08:39 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201201141908.q0EJ8d9A045190@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sat, 14 Jan 2012 19:08:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230111 - in stable/9: lib/libc/net sbin/route X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 19:08:40 -0000 Author: ume Date: Sat Jan 14 19:08:39 2012 New Revision: 230111 URL: http://svn.freebsd.org/changeset/base/230111 Log: MFC r229766: Handle the internal scope address representation of the KAME IPv6 stack for the node-local multicast address. Modified: stable/9/lib/libc/net/getaddrinfo.c stable/9/sbin/route/route.c Directory Properties: stable/9/lib/libc/ (props changed) stable/9/sbin/route/ (props changed) Modified: stable/9/lib/libc/net/getaddrinfo.c ============================================================================== --- stable/9/lib/libc/net/getaddrinfo.c Sat Jan 14 18:16:10 2012 (r230110) +++ stable/9/lib/libc/net/getaddrinfo.c Sat Jan 14 19:08:39 2012 (r230111) @@ -1576,7 +1576,8 @@ ip6_str2scopeid(char *scope, struct sock if (*scope == '\0') return -1; - if (IN6_IS_ADDR_LINKLOCAL(a6) || IN6_IS_ADDR_MC_LINKLOCAL(a6)) { + if (IN6_IS_ADDR_LINKLOCAL(a6) || IN6_IS_ADDR_MC_LINKLOCAL(a6) || + IN6_IS_ADDR_MC_NODELOCAL(a6)) { /* * We currently assume a one-to-one mapping between links * and interfaces, so we simply use interface indices for Modified: stable/9/sbin/route/route.c ============================================================================== --- stable/9/sbin/route/route.c Sat Jan 14 18:16:10 2012 (r230110) +++ stable/9/sbin/route/route.c Sat Jan 14 19:08:39 2012 (r230111) @@ -375,7 +375,8 @@ routename(struct sockaddr *sa) #ifdef __KAME__ if (sa->sa_len == sizeof(struct sockaddr_in6) && (IN6_IS_ADDR_LINKLOCAL(&sin6.sin6_addr) || - IN6_IS_ADDR_MC_LINKLOCAL(&sin6.sin6_addr)) && + IN6_IS_ADDR_MC_LINKLOCAL(&sin6.sin6_addr) || + IN6_IS_ADDR_MC_NODELOCAL(&sin6.sin6_addr)) && sin6.sin6_scope_id == 0) { sin6.sin6_scope_id = ntohs(*(u_int16_t *)&sin6.sin6_addr.s6_addr[2]); @@ -500,7 +501,8 @@ netname(struct sockaddr *sa) #ifdef __KAME__ if (sa->sa_len == sizeof(struct sockaddr_in6) && (IN6_IS_ADDR_LINKLOCAL(&sin6.sin6_addr) || - IN6_IS_ADDR_MC_LINKLOCAL(&sin6.sin6_addr)) && + IN6_IS_ADDR_MC_LINKLOCAL(&sin6.sin6_addr) || + IN6_IS_ADDR_MC_NODELOCAL(&sin6.sin6_addr)) && sin6.sin6_scope_id == 0) { sin6.sin6_scope_id = ntohs(*(u_int16_t *)&sin6.sin6_addr.s6_addr[2]); @@ -1002,7 +1004,8 @@ getaddr(int which, char *str, struct hos memcpy(&su->sin6, res->ai_addr, sizeof(su->sin6)); #ifdef __KAME__ if ((IN6_IS_ADDR_LINKLOCAL(&su->sin6.sin6_addr) || - IN6_IS_ADDR_MC_LINKLOCAL(&su->sin6.sin6_addr)) && + IN6_IS_ADDR_MC_LINKLOCAL(&su->sin6.sin6_addr) || + IN6_IS_ADDR_MC_NODELOCAL(&su->sin6.sin6_addr)) && su->sin6.sin6_scope_id) { *(u_int16_t *)&su->sin6.sin6_addr.s6_addr[2] = htons(su->sin6.sin6_scope_id); From owner-svn-src-all@FreeBSD.ORG Sat Jan 14 19:22:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06DE4106566B; Sat, 14 Jan 2012 19:22:46 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA53F8FC16; Sat, 14 Jan 2012 19:22: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 q0EJMjB0045699; Sat, 14 Jan 2012 19:22:45 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0EJMjmF045696; Sat, 14 Jan 2012 19:22:45 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201201141922.q0EJMjmF045696@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sat, 14 Jan 2012 19:22:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230112 - in stable/8: lib/libc/net sbin/route X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 19:22:46 -0000 Author: ume Date: Sat Jan 14 19:22:45 2012 New Revision: 230112 URL: http://svn.freebsd.org/changeset/base/230112 Log: MFC r229766: Handle the internal scope address representation of the KAME IPv6 stack for the node-local multicast address. Modified: stable/8/lib/libc/net/getaddrinfo.c stable/8/sbin/route/route.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/sbin/route/ (props changed) Modified: stable/8/lib/libc/net/getaddrinfo.c ============================================================================== --- stable/8/lib/libc/net/getaddrinfo.c Sat Jan 14 19:08:39 2012 (r230111) +++ stable/8/lib/libc/net/getaddrinfo.c Sat Jan 14 19:22:45 2012 (r230112) @@ -1576,7 +1576,8 @@ ip6_str2scopeid(char *scope, struct sock if (*scope == '\0') return -1; - if (IN6_IS_ADDR_LINKLOCAL(a6) || IN6_IS_ADDR_MC_LINKLOCAL(a6)) { + if (IN6_IS_ADDR_LINKLOCAL(a6) || IN6_IS_ADDR_MC_LINKLOCAL(a6) || + IN6_IS_ADDR_MC_NODELOCAL(a6)) { /* * We currently assume a one-to-one mapping between links * and interfaces, so we simply use interface indices for Modified: stable/8/sbin/route/route.c ============================================================================== --- stable/8/sbin/route/route.c Sat Jan 14 19:08:39 2012 (r230111) +++ stable/8/sbin/route/route.c Sat Jan 14 19:22:45 2012 (r230112) @@ -375,7 +375,8 @@ routename(struct sockaddr *sa) #ifdef __KAME__ if (sa->sa_len == sizeof(struct sockaddr_in6) && (IN6_IS_ADDR_LINKLOCAL(&sin6.sin6_addr) || - IN6_IS_ADDR_MC_LINKLOCAL(&sin6.sin6_addr)) && + IN6_IS_ADDR_MC_LINKLOCAL(&sin6.sin6_addr) || + IN6_IS_ADDR_MC_NODELOCAL(&sin6.sin6_addr)) && sin6.sin6_scope_id == 0) { sin6.sin6_scope_id = ntohs(*(u_int16_t *)&sin6.sin6_addr.s6_addr[2]); @@ -500,7 +501,8 @@ netname(struct sockaddr *sa) #ifdef __KAME__ if (sa->sa_len == sizeof(struct sockaddr_in6) && (IN6_IS_ADDR_LINKLOCAL(&sin6.sin6_addr) || - IN6_IS_ADDR_MC_LINKLOCAL(&sin6.sin6_addr)) && + IN6_IS_ADDR_MC_LINKLOCAL(&sin6.sin6_addr) || + IN6_IS_ADDR_MC_NODELOCAL(&sin6.sin6_addr)) && sin6.sin6_scope_id == 0) { sin6.sin6_scope_id = ntohs(*(u_int16_t *)&sin6.sin6_addr.s6_addr[2]); @@ -1002,7 +1004,8 @@ getaddr(int which, char *str, struct hos memcpy(&su->sin6, res->ai_addr, sizeof(su->sin6)); #ifdef __KAME__ if ((IN6_IS_ADDR_LINKLOCAL(&su->sin6.sin6_addr) || - IN6_IS_ADDR_MC_LINKLOCAL(&su->sin6.sin6_addr)) && + IN6_IS_ADDR_MC_LINKLOCAL(&su->sin6.sin6_addr) || + IN6_IS_ADDR_MC_NODELOCAL(&su->sin6.sin6_addr)) && su->sin6.sin6_scope_id) { *(u_int16_t *)&su->sin6.sin6_addr.s6_addr[2] = htons(su->sin6.sin6_scope_id); From owner-svn-src-all@FreeBSD.ORG Sat Jan 14 19:38:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57FFF106567A; Sat, 14 Jan 2012 19:38:25 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4336A8FC16; Sat, 14 Jan 2012 19:38: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 q0EJcPl6046212; Sat, 14 Jan 2012 19:38:25 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0EJcPc7046209; Sat, 14 Jan 2012 19:38:25 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201201141938.q0EJcPc7046209@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sat, 14 Jan 2012 19:38:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230113 - in stable/9/kerberos5: . lib/libhdb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 19:38:25 -0000 Author: ume Date: Sat Jan 14 19:38:24 2012 New Revision: 230113 URL: http://svn.freebsd.org/changeset/base/230113 Log: MFC r228284, r228308: - Make heimdal buildable with WITH_OPENLDAP defined, again. - Our heimdal uses the deprecated OpenLDAP functions. - Don't support OpenLDAP during lib32 build. Modified: stable/9/kerberos5/Makefile.inc stable/9/kerberos5/lib/libhdb/Makefile Directory Properties: stable/9/kerberos5/ (props changed) Modified: stable/9/kerberos5/Makefile.inc ============================================================================== --- stable/9/kerberos5/Makefile.inc Sat Jan 14 19:22:45 2012 (r230112) +++ stable/9/kerberos5/Makefile.inc Sat Jan 14 19:38:24 2012 (r230113) @@ -6,11 +6,11 @@ KRB5DIR= ${.CURDIR}/../../../crypto/heim CFLAGS+= -DHAVE_CONFIG_H -I${.CURDIR}/../../include -.if defined(WITH_OPENLDAP) +.if defined(WITH_OPENLDAP) && !defined(COMPAT_32BIT) OPENLDAPBASE?= /usr/local LDAPLDADD= -lldap -llber LDAPDPADD= ${LDAPLDADD:C;^-l(.*)$;${OPENLDAPBASE}/lib/lib\1.a;} -LDAPCFLAGS= -I${OPENLDAPBASE}/include -DOPENLDAP=1 +LDAPCFLAGS= -I${OPENLDAPBASE}/include -DOPENLDAP=1 -DLDAP_DEPRECATED=1 LDAPLDFLAGS= -L${OPENLDAPBASE}/lib -Wl,-rpath,${OPENLDAPBASE}/lib .endif Modified: stable/9/kerberos5/lib/libhdb/Makefile ============================================================================== --- stable/9/kerberos5/lib/libhdb/Makefile Sat Jan 14 19:22:45 2012 (r230112) +++ stable/9/kerberos5/lib/libhdb/Makefile Sat Jan 14 19:38:24 2012 (r230113) @@ -1,9 +1,9 @@ # $FreeBSD$ LIB= hdb -LDFLAGS= -Wl,--no-undefined -LDADD= -lasn1 -lcom_err -lkrb5 -lroken -DPADD= ${LIBASN1} ${LIBCOM_ERR} ${LIBKRB5} ${LIBROKEN} +LDFLAGS= -Wl,--no-undefined ${LDAPLDFLAGS} +LDADD= -lasn1 -lcom_err -lkrb5 -lroken ${LDAPLDADD} +DPADD= ${LIBASN1} ${LIBCOM_ERR} ${LIBKRB5} ${LIBROKEN} ${LDAPDPADD} INCS= hdb-private.h \ hdb-protos.h \ From owner-svn-src-all@FreeBSD.ORG Sat Jan 14 21:02:34 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5A841065670; Sat, 14 Jan 2012 21:02:34 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.freebsd.org (Postfix) with ESMTP id 7899C8FC0C; Sat, 14 Jan 2012 21:02:34 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0EL2Uin020035 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 15 Jan 2012 08:02:32 +1100 Date: Sun, 15 Jan 2012 08:02:30 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Pawel Jakub Dawidek In-Reply-To: <20120114182758.GJ1694@garage.freebsd.pl> Message-ID: <20120115073823.O843@besplex.bde.org> References: <201201122249.q0CMnaZe030200@svn.freebsd.org> <20120114204720.Q1458@besplex.bde.org> <20120114182758.GJ1694@garage.freebsd.pl> 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, Guy Helmer , Bruce Evans Subject: Re: svn commit: r230037 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 21:02:35 -0000 On Sat, 14 Jan 2012, Pawel Jakub Dawidek wrote: > On Sat, Jan 14, 2012 at 09:59:27PM +1100, Bruce Evans wrote: >> ... >> It's good to declare mode_t, since pidfile_open() uses it and we want >> to remove the dependency on . However, this definition >> doesn't follow KNF or the style of all the other typedef declarations >> in the file, since all the others follow KNF and thus have a space >> instead of a tab after #define and also after typedef. > > I think you mixed space with tab. All the others have a tab after > #define and typedef. I fully agree this should be consistent. Oops. >>> -#ifdef _SYS_PARAM_H_ >>> int pidfile_close(struct pidfh *_pfh); >>> int pidfile_fileno(const struct pidfh *_pfh); >>> struct pidfh * >>> pidfile_open(const char *_path, mode_t _mode, pid_t *_pidptr); >>> int pidfile_remove(struct pidfh *_pfh); >>> int pidfile_write(struct pidfh *_pfh); >>> -#endif >> >> Now these are unsorted, since a separate section to hold them is not >> needed. It was used just to make the ifdef easier to read (we don't >> want to split up the main list with blank lines around each ifdef, and >> without such blank lines the ifdefs are harder to read). > > I'd prefer not to change that. All those functions are part of pidfile(3) > API and it would be better, IMHO, to keep them together here too. The functions have a unique prefix, so they are grouped nicely when sorted into a long list. While I'm here, I'll complain about the verboseness of that prefix :-). Other APIs in the file mostly use short prefixes: - kinfo_. Should have been ki_ like its struct member names. pidfile uses a good prefix for its struct member names too. - properties_/property_. Bad, like the rest of the API. - uu_. A weird nondescriptive name for serial device locking protocol. Is it from uucp? But its weirdness makes it memorable, unlike a generic English word like `property'. Better yet, I don't have to quote it here. - f. Stdio's prefix meaning `file'. To fit indentifiers in 8 characters, it can't even have an underscore. - pw_. Old prefix/abbrieviation for `password'. It's more readable than `password' once you are used to it. - gr_. Newer prefix for `group'. More verbose than the g in gid. - quota_. At least the English word is short. Just noticed some more disorder: the groups of the defines at the end are in random (mostly historical) order (U*, HO*, F*, PW*, HN* (for the last parameter of humanize_number()), HN* (for the second last parameter...), HD*. If the pidfile API had defines and if the API is kept in its own section, its defines should be in that section. Most of the other APIs that have a man page are large enough to deserve the same treatment if it is done for pidfile. Some like dehumanize^Wscientificize^W humanize_number() are larger although they have fewer functions, since they have lots of defines. Bruce From owner-svn-src-all@FreeBSD.ORG Sat Jan 14 21:09:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57E3D106566B; Sat, 14 Jan 2012 21:09:55 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 424828FC14; Sat, 14 Jan 2012 21:09: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 q0EL9tLd049004; Sat, 14 Jan 2012 21:09:55 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0EL9tHp049002; Sat, 14 Jan 2012 21:09:55 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201201142109.q0EL9tHp049002@svn.freebsd.org> From: David Schultz Date: Sat, 14 Jan 2012 21:09: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: r230114 - head/tools/regression/lib/libc/stdio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 21:09:55 -0000 Author: das Date: Sat Jan 14 21:09:54 2012 New Revision: 230114 URL: http://svn.freebsd.org/changeset/base/230114 Log: Update the tests for arm and other ports where long double is the same as double, similar to r178141. Modified: head/tools/regression/lib/libc/stdio/test-printfloat.c Modified: head/tools/regression/lib/libc/stdio/test-printfloat.c ============================================================================== --- head/tools/regression/lib/libc/stdio/test-printfloat.c Sat Jan 14 19:38:24 2012 (r230113) +++ head/tools/regression/lib/libc/stdio/test-printfloat.c Sat Jan 14 21:09:54 2012 (r230114) @@ -266,9 +266,9 @@ main(int argc, char *argv[]) testfmt("0x1p-16494", "%La", 0x1p-16494L); testfmt("0x1.2345p-16384", "%La", 0x1.2345p-16384L); #else - testfmt("0xc.90fdaa22168cp-2", "%La", 0x3.243f6a8885a31p0L); - testfmt("0x8p-1077", "%La", 0x1p-1074L); - testfmt("0x9.8765p-1024", "%La", 0x9.8765p-1024L); + testfmt("0x1.921fb54442d18p+1", "%La", 0x3.243f6a8885a31p0L); + testfmt("0x1p-1074", "%La", 0x1p-1074L); + testfmt("0x1.30ecap-1021", "%La", 0x9.8765p-1024L); #endif printf("ok 10 - printfloat\n"); From owner-svn-src-all@FreeBSD.ORG Sat Jan 14 21:38:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D51501065678; Sat, 14 Jan 2012 21:38:31 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A5AAD8FC18; Sat, 14 Jan 2012 21:38: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 q0ELcVqE049879; Sat, 14 Jan 2012 21:38:31 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0ELcVju049875; Sat, 14 Jan 2012 21:38:31 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201201142138.q0ELcVju049875@svn.freebsd.org> From: David Schultz Date: Sat, 14 Jan 2012 21:38: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: r230115 - head/tools/regression/lib/libc/stdio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 21:38:31 -0000 Author: das Date: Sat Jan 14 21:38:31 2012 New Revision: 230115 URL: http://svn.freebsd.org/changeset/base/230115 Log: Add .t files for tests, missed in prior checkins, so that prove(1) works in this directory. Added: head/tools/regression/lib/libc/stdio/test-getdelim.t - copied unchanged from r230114, head/tools/regression/lib/libc/stdio/test-printfloat.t head/tools/regression/lib/libc/stdio/test-print-positional.t - copied unchanged from r230114, head/tools/regression/lib/libc/stdio/test-printfloat.t head/tools/regression/lib/libc/stdio/test-printbasic.t - copied unchanged from r230114, head/tools/regression/lib/libc/stdio/test-printfloat.t Copied: head/tools/regression/lib/libc/stdio/test-getdelim.t (from r230114, head/tools/regression/lib/libc/stdio/test-printfloat.t) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/lib/libc/stdio/test-getdelim.t Sat Jan 14 21:38:31 2012 (r230115, copy of r230114, head/tools/regression/lib/libc/stdio/test-printfloat.t) @@ -0,0 +1,10 @@ +#!/bin/sh +# $FreeBSD$ + +cd `dirname $0` + +executable=`basename $0 .t` + +make $executable 2>&1 > /dev/null + +exec ./$executable Copied: head/tools/regression/lib/libc/stdio/test-print-positional.t (from r230114, head/tools/regression/lib/libc/stdio/test-printfloat.t) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/lib/libc/stdio/test-print-positional.t Sat Jan 14 21:38:31 2012 (r230115, copy of r230114, head/tools/regression/lib/libc/stdio/test-printfloat.t) @@ -0,0 +1,10 @@ +#!/bin/sh +# $FreeBSD$ + +cd `dirname $0` + +executable=`basename $0 .t` + +make $executable 2>&1 > /dev/null + +exec ./$executable Copied: head/tools/regression/lib/libc/stdio/test-printbasic.t (from r230114, head/tools/regression/lib/libc/stdio/test-printfloat.t) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/lib/libc/stdio/test-printbasic.t Sat Jan 14 21:38:31 2012 (r230115, copy of r230114, head/tools/regression/lib/libc/stdio/test-printfloat.t) @@ -0,0 +1,10 @@ +#!/bin/sh +# $FreeBSD$ + +cd `dirname $0` + +executable=`basename $0 .t` + +make $executable 2>&1 > /dev/null + +exec ./$executable From owner-svn-src-all@FreeBSD.ORG Sat Jan 14 21:43:20 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B2B6106564A; Sat, 14 Jan 2012 21:43:20 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id E48B18FC12; Sat, 14 Jan 2012 21:43:19 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0ELhHFT017484 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 15 Jan 2012 08:43:17 +1100 Date: Sun, 15 Jan 2012 08:43:17 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andreas Tobler In-Reply-To: <4F07529B.2060608@FreeBSD.org> Message-ID: <20120115080256.E843@besplex.bde.org> References: <201201060921.q069Lfi8081051@svn.freebsd.org> <20120106225728.G9027@besplex.bde.org> <4F07529B.2060608@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, Bruce Evans Subject: Re: svn commit: r229693 - in head/lib/libc: powerpc powerpc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 21:43:20 -0000 On Fri, 6 Jan 2012, Andreas Tobler wrote: Sorry for the delay. > Hi Bruce, > > thank you for the feedback. I wasn't aware about the fine details. > > I try to understand and implement what you suggest. It may take several > iterations until I match everything. OK. >> The easiest way to fix this is to remove WEAK_ALIAS() and add an asm >> API WEAK_REFERENCE(). Unfortunately, ALIAS is a better name than >> REFERENCE. __weak_reference() is not so easy to change since it is >> used extensively > > So, I started with a WEAK_REFERENCE macro in sys/powerpc/asm.h > It is like the WEAK_ALIAS but with reversed arguments: > > +#define WEAK_REFERENCE(sym, alias) \ > + .weak alias; \ > + alias = sym > + > > Here I do not have a preference for the "=" implementation, is it "=" or is > it .set ..... I prefer .equ, since it is what is ised for weak_reference() and it has minor syntactial advantages. Anyway, This is much easier to change than uses of the macro. > > If we find a final version I'll be able to delete the WEAK_ALIAS. Yes, delete it before it is used much. The only thing to worry about is use of it in ports. I checked a 2005 version of NetBSD. It has separate sys/cdefs files for aout and elf, and spells things completely backwards relative to FreeBSD there: - __asm is spelled __asm__ - the order is reversed in all macros: (alias,sym). The misformatting of no space after the comma in this to support aout is preserved in cdefs_elf.h. - #alias and #sym are not used rawly, even for elf. They are surrounded by _C_LABEL() or _C_LABEL_STRING(). For elf, this usually makes no difference, but there is an option to add an underscore for elf too. OTOH, K&R is not supported, so there are no additional files, ifdefs or macro obfuscations to support it (FreeBSD still has ifdefs for it, but doesn't support aout). - it has __strong_alias() there, but no __strong_reference() - it has __weak_alias() there, but no __weak_reference() - it has __weak_extern() (expands to a plain .weak) - it has __warn_references(). This is the only one that needs much magic (.stabs declarations). - it "=" instead of ".equ" or ".set" - it uses single-line asms instead of multi-line ones, except for the ones with .stabs. This gives additional ugliness from string concatenation and explicit newlines or semicolons to separate the statements (newlines are used, which makes the output more readable, but tabs are not used). One feature of K&R is that this feature is unavailable, so FreeBSD couldn't use it in the K&R part of the ifdef and it may as well not use it in the STDC part. In summary, unportability to NetBSD couldn't be implemented much better if done intentionally. To preserve this intentionally, we shouldn't define __weak_alias(), but should keep __weak_reference() with its args reversed. >> Similarly for STRONG_ALIAS() and __strong_reference(), except >> STRONG_REFERENCE() doesn't exist for most arches and __strong_reference() >> didn't exist until this week, so neither is used extensively. I didn't check what NetBSD does for asm macros. > ... > If I get the above right, the snippet from above should look like this, > right? > > @@ -51,20 +51,17 @@ > ld %r0,16(%r1); \ > mtlr %r0; \ > blr; \ > -ENTRY(__CONCAT(__sys_,x)); \ > - .weak CNAME(x); \ > - .set CNAME(x),CNAME(__CONCAT(__sys_,x)); \ > - .weak CNAME(__CONCAT(_,x)); \ > - .set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \ > +ENTRY(__CONCAT(__sys_, x)); \ > + WEAK_REFERENCE(__CONCAT(__sys_, x), x); \ > + WEAK_REFERENCE(__CONCAT(__sys_, x), __CONCAT(_, x)); \ > _SYSCALL(x); \ > bso 2b Yes, assuming the args are in the right order. I would also change `x' to a meaningful name. At least on i386, uses x in most places, but csym and asmsym in 2 places, while uses meaningul parameter names in most places. > If we want to stay with WEAK_ALIAS I can at least fix the style bugs. It is the arg order that I care about most, and with __weak_alias() or WEAK_ALIAS() we should remain compatible with the opposite order in NetBSD. Bruce From owner-svn-src-all@FreeBSD.ORG Sat Jan 14 21:51:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B856106566B; Sat, 14 Jan 2012 21:51: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 CFF7C8FC0C; Sat, 14 Jan 2012 21:51: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 q0ELpiHZ050288; Sat, 14 Jan 2012 21:51:44 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0ELpi1Z050285; Sat, 14 Jan 2012 21:51:44 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201201142151.q0ELpi1Z050285@svn.freebsd.org> From: Doug Barton Date: Sat, 14 Jan 2012 21:51: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: r230116 - head/share/man/man8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 21:51:45 -0000 Author: dougb Date: Sat Jan 14 21:51:44 2012 New Revision: 230116 URL: http://svn.freebsd.org/changeset/base/230116 Log: Remove documentation for set_rcvar() now that it has been removed. Modified: head/share/man/man8/rc.8 head/share/man/man8/rc.subr.8 Modified: head/share/man/man8/rc.8 ============================================================================== --- head/share/man/man8/rc.8 Sat Jan 14 21:38:31 2012 (r230115) +++ head/share/man/man8/rc.8 Sat Jan 14 21:51:44 2012 (r230116) @@ -35,7 +35,7 @@ .\" @(#)rc.8 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd November 17, 2009 +.Dd January 14, 2012 .Dt RC 8 .Os .Sh NAME @@ -485,7 +485,7 @@ Most scripts require little more than th \&. /etc/rc.subr name="foo" -rcvar=`set_rcvar` +rcvar=foo_enable command="/usr/local/bin/foo" load_rc_config $name @@ -506,7 +506,7 @@ The script may list and define as many c \&. /etc/rc.subr name="foo" -rcvar=`set_rcvar` +rcvar=foo_enable command="/usr/local/bin/foo" extra_commands="nop hello" hello_cmd="echo Hello World." Modified: head/share/man/man8/rc.subr.8 ============================================================================== --- head/share/man/man8/rc.subr.8 Sat Jan 14 21:38:31 2012 (r230115) +++ head/share/man/man8/rc.subr.8 Sat Jan 14 21:51:44 2012 (r230116) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 18, 2007 +.Dd January 14, 2012 .Dt RC.SUBR 8 .Os .Sh NAME @@ -73,8 +73,6 @@ .It .Ic run_rc_script Ar file Ar argument .It -.Ic set_rcvar Op Ar base -.It .Ic wait_for_pids Op Ar pid ... .It .Ic warn Ar message @@ -832,32 +830,6 @@ signal is sent to the parent process, which is assumed to be .Xr rc 8 . Otherwise, the shell exits with a non-zero status. -.It Ic set_rcvar Op Ar base -Set the variable name required to start a service. -In -.Fx -a daemon is usually controlled by an -.Xr rc.conf 5 -variable consisting of a daemon's name postfixed by the string -.Dq Li "_enable" . -This is not the case in -.Nx . -When the following line is included in a script: -.Pp -.Dl "rcvar=`set_rcvar`" -.Pp -this function will use the value of the -.Va $name -variable, which should be defined by the calling script, -to construct the appropriate -.Xr rc.conf 5 -knob. -If the -.Ar base -argument is set it will use -.Ar base -instead of -.Va $name . .It Ic wait_for_pids Op Ar pid ... Wait until all of the provided .Ar pids From owner-svn-src-all@FreeBSD.ORG Sat Jan 14 21:54:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B50F106564A; Sat, 14 Jan 2012 21:54:13 +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 15E318FC08; Sat, 14 Jan 2012 21:54: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 q0ELsCSI050399; Sat, 14 Jan 2012 21:54:12 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0ELsCHg050397; Sat, 14 Jan 2012 21:54:12 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201201142154.q0ELsCHg050397@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 14 Jan 2012 21:54: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: r230117 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 21:54:13 -0000 Author: jilles Date: Sat Jan 14 21:54:12 2012 New Revision: 230117 URL: http://svn.freebsd.org/changeset/base/230117 Log: sh: Fix out of bounds array access when trap is used with an invalid signal. MFC after: 1 week Modified: head/bin/sh/trap.c Modified: head/bin/sh/trap.c ============================================================================== --- head/bin/sh/trap.c Sat Jan 14 21:51:44 2012 (r230116) +++ head/bin/sh/trap.c Sat Jan 14 21:54:12 2012 (r230117) @@ -191,10 +191,11 @@ trapcmd(int argc, char **argv) argv++; } } - while (*argv) { + for (; *argv; argv++) { if ((signo = sigstring_to_signum(*argv)) == -1) { warning("bad signal %s", *argv); errors = 1; + continue; } INTOFF; if (action) @@ -205,7 +206,6 @@ trapcmd(int argc, char **argv) if (signo != 0) setsignal(signo); INTON; - argv++; } return errors; } From owner-svn-src-all@FreeBSD.ORG Sat Jan 14 22:03:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 36F951065672; Sat, 14 Jan 2012 22:03:22 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-198-245.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 572DD154F0C; Sat, 14 Jan 2012 22:03:21 +0000 (UTC) Message-ID: <4F11FBA8.1070005@FreeBSD.org> Date: Sat, 14 Jan 2012 14:03:20 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: Sergey Kandaurov References: <201201140859.q0E8x2gV003415@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: undefined 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: r230103 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 22:03:22 -0000 On 01/14/2012 04:11, Sergey Kandaurov wrote: > On 14 January 2012 12:59, Doug Barton wrote: >> Author: dougb >> Date: Sat Jan 14 08:59:02 2012 >> New Revision: 230103 >> URL: http://svn.freebsd.org/changeset/base/230103 >> >> Log: >> Now that its callers have been udpated, remove set_rcvar(). >> >> The concept of set_rcvar() was nice in theory, but the forks >> it creates are a drag on the startup process, which is especially >> noticeable on slower systems, such as embedded ones. >> >> Modified: >> head/etc/rc.subr >> > > Hi, > > rc(8) and rc.subr(8) still reference this function. Not any more. :) I ran out of steam last night, and so I'm finishing up the doc stuff today. But thanks for the reminder. > Also, it would be fine to have some adoption to the new > set_rcvar-less order like printing The Big Warning and > still doing its job in Y.x branch and stop doing anything > in the next Y+1.x branch. If that becomes necessary, we can certainly do it. This is early enough in the 10-current cycle that I think we should be able to catch all the stragglers well before 10-release, and I personally have no plans to MFC the removal of set_rcvar from rc.subr. But, you know what they say about the best-laid plans .... Doug -- You can observe a lot just by watching. -- Yogi Berra Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Sat Jan 14 22:46:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF28F106564A; Sat, 14 Jan 2012 22:46:18 +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 DAB448FC12; Sat, 14 Jan 2012 22:46: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 q0EMkI8Q052013; Sat, 14 Jan 2012 22:46:18 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0EMkI6P052011; Sat, 14 Jan 2012 22:46:18 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201201142246.q0EMkI6P052011@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 14 Jan 2012 22:46: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: r230118 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 22:46:19 -0000 Author: jilles Date: Sat Jan 14 22:46:18 2012 New Revision: 230118 URL: http://svn.freebsd.org/changeset/base/230118 Log: sh: Change input buffer size from 1023 to 1024. PR: bin/161756 Modified: head/bin/sh/input.c Modified: head/bin/sh/input.c ============================================================================== --- head/bin/sh/input.c Sat Jan 14 21:54:12 2012 (r230117) +++ head/bin/sh/input.c Sat Jan 14 22:46:18 2012 (r230118) @@ -97,7 +97,7 @@ int parsenleft; /* copy of parsefile-> MKINIT int parselleft; /* copy of parsefile->lleft */ char *parsenextc; /* copy of parsefile->nextc */ MKINIT struct parsefile basepf; /* top level input file */ -char basebuf[BUFSIZ]; /* buffer for top level input file */ +char basebuf[BUFSIZ + 1]; /* buffer for top level input file */ static struct parsefile *parsefile = &basepf; /* current input file */ int init_editline = 0; /* editline library initialized? */ int whichprompt; /* 1 == PS1, 2 == PS2 */ @@ -189,8 +189,8 @@ retry: nr = 0; else { nr = el_len; - if (nr > BUFSIZ - 1) - nr = BUFSIZ - 1; + if (nr > BUFSIZ) + nr = BUFSIZ; memcpy(parsenextc, rl_cp, nr); if (nr != el_len) { el_len -= nr; @@ -200,7 +200,7 @@ retry: } } else #endif - nr = read(parsefile->fd, parsenextc, BUFSIZ - 1); + nr = read(parsefile->fd, parsenextc, BUFSIZ); if (nr <= 0) { if (nr < 0) { @@ -428,13 +428,13 @@ setinputfd(int fd, int push) (void)fcntl(fd, F_SETFD, FD_CLOEXEC); if (push) { pushfile(); - parsefile->buf = ckmalloc(BUFSIZ); + parsefile->buf = ckmalloc(BUFSIZ + 1); } if (parsefile->fd > 0) close(parsefile->fd); parsefile->fd = fd; if (parsefile->buf == NULL) - parsefile->buf = ckmalloc(BUFSIZ); + parsefile->buf = ckmalloc(BUFSIZ + 1); parselleft = parsenleft = 0; plinno = 1; } From owner-svn-src-all@FreeBSD.ORG Sat Jan 14 22:51:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56511106566B; Sat, 14 Jan 2012 22:51:35 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 40BC48FC08; Sat, 14 Jan 2012 22:51: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 q0EMpZtB052201; Sat, 14 Jan 2012 22:51:35 GMT (envelope-from csjp@svn.freebsd.org) Received: (from csjp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0EMpZKd052199; Sat, 14 Jan 2012 22:51:35 GMT (envelope-from csjp@svn.freebsd.org) Message-Id: <201201142251.q0EMpZKd052199@svn.freebsd.org> From: "Christian S.J. Peron" Date: Sat, 14 Jan 2012 22:51: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: r230119 - head/sys/contrib/pf/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 22:51:35 -0000 Author: csjp Date: Sat Jan 14 22:51:34 2012 New Revision: 230119 URL: http://svn.freebsd.org/changeset/base/230119 Log: Revert to the old behavior of allocating table/table entries using M_NOWAIT. Currently, the code allows for sleeping in the ioctl path to guarantee allocation. However code also handles ENOMEM gracefully, so propagate this error back to user-space, rather than sleeping while holding the global pf mutex. Reviewed by: glebius Discussed with: bz Modified: head/sys/contrib/pf/net/pf_table.c Modified: head/sys/contrib/pf/net/pf_table.c ============================================================================== --- head/sys/contrib/pf/net/pf_table.c Sat Jan 14 22:46:18 2012 (r230118) +++ head/sys/contrib/pf/net/pf_table.c Sat Jan 14 22:51:34 2012 (r230119) @@ -927,16 +927,12 @@ pfr_create_kentry(struct pfr_addr *ad, i { struct pfr_kentry *ke; - if (intr) #ifdef __FreeBSD__ - ke = pool_get(&V_pfr_kentry_pl, PR_NOWAIT | PR_ZERO); + ke = pool_get(&V_pfr_kentry_pl, PR_NOWAIT | PR_ZERO); #else + if (intr) ke = pool_get(&pfr_kentry_pl, PR_NOWAIT | PR_ZERO); -#endif else -#ifdef __FreeBSD__ - ke = pool_get(&V_pfr_kentry_pl, PR_WAITOK|PR_ZERO); -#else ke = pool_get(&pfr_kentry_pl, PR_WAITOK|PR_ZERO|PR_LIMITFAIL); #endif if (ke == NULL) @@ -2081,16 +2077,12 @@ pfr_create_ktable(struct pfr_table *tbl, struct pfr_ktable *kt; struct pf_ruleset *rs; - if (intr) #ifdef __FreeBSD__ - kt = pool_get(&V_pfr_ktable_pl, PR_NOWAIT|PR_ZERO); + kt = pool_get(&V_pfr_ktable_pl, PR_NOWAIT|PR_ZERO); #else + if (intr) kt = pool_get(&pfr_ktable_pl, PR_NOWAIT|PR_ZERO|PR_LIMITFAIL); -#endif else -#ifdef __FreeBSD__ - kt = pool_get(&V_pfr_ktable_pl, PR_WAITOK|PR_ZERO); -#else kt = pool_get(&pfr_ktable_pl, PR_WAITOK|PR_ZERO|PR_LIMITFAIL); #endif if (kt == NULL) From owner-svn-src-all@FreeBSD.ORG Sat Jan 14 23:04:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45F7B106566C; Sat, 14 Jan 2012 23:04:28 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3028A8FC15; Sat, 14 Jan 2012 23:04: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 q0EN4SuT052638; Sat, 14 Jan 2012 23:04:28 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0EN4SEJ052635; Sat, 14 Jan 2012 23:04:28 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201201142304.q0EN4SEJ052635@svn.freebsd.org> From: Alan Cox Date: Sat, 14 Jan 2012 23:04: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: r230120 - head/sys/fs/tmpfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 23:04:28 -0000 Author: alc Date: Sat Jan 14 23:04:27 2012 New Revision: 230120 URL: http://svn.freebsd.org/changeset/base/230120 Log: Neither tmpfs_nocacheread() nor tmpfs_mappedwrite() needs to call vm_object_pip_{add,subtract}() on the swap object because the swap object can't be destroyed while the vnode is exclusively locked. Moreover, even if the swap object could have been destroyed during tmpfs_nocacheread() and tmpfs_mappedwrite() this code is broken because vm_object_pip_subtract() does not wake up the sleeping thread that is trying to destroy the swap object. Free invalid pages after an I/O error. There is no virtue in keeping them around in the swap object creating more work for the page daemon. (I believe that any non-busy page in the swap object will now always be valid.) vm_pager_get_pages() does not return a standard errno, so its return value should not be returned by tmpfs without translation to an errno value. There is no reason for the wakeup on vpg in tmpfs_mappedwrite() to occur with the swap object locked. Eliminate printf()s from tmpfs_nocacheread() and tmpfs_mappedwrite(). (The swap pager already spam your console if data corruption is imminent.) Reviewed by: kib MFC after: 3 weeks Modified: head/sys/fs/tmpfs/tmpfs_subr.c head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Sat Jan 14 22:51:34 2012 (r230119) +++ head/sys/fs/tmpfs/tmpfs_subr.c Sat Jan 14 23:04:27 2012 (r230120) @@ -929,6 +929,7 @@ retry: vm_page_sleep(m, "tmfssz"); goto retry; } + MPASS(m->valid == VM_PAGE_BITS_ALL); } else if (vm_pager_has_page(uobj, idx, NULL, NULL)) { m = vm_page_alloc(uobj, idx, VM_ALLOC_NORMAL); if (m == NULL) { @@ -957,7 +958,6 @@ retry: } if (m != NULL) { pmap_zero_page_area(m, base, PAGE_SIZE - base); - MPASS(m->valid == VM_PAGE_BITS_ALL); vm_page_dirty(m); vm_pager_page_unswapped(m); } Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Sat Jan 14 22:51:34 2012 (r230119) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Sat Jan 14 23:04:27 2012 (r230120) @@ -437,18 +437,20 @@ tmpfs_nocacheread(vm_object_t tobj, vm_p vm_offset_t offset, size_t tlen, struct uio *uio) { vm_page_t m; - int error; + int error, rv; VM_OBJECT_LOCK(tobj); - vm_object_pip_add(tobj, 1); m = vm_page_grab(tobj, idx, VM_ALLOC_WIRED | VM_ALLOC_NORMAL | VM_ALLOC_RETRY); if (m->valid != VM_PAGE_BITS_ALL) { if (vm_pager_has_page(tobj, idx, NULL, NULL)) { - error = vm_pager_get_pages(tobj, &m, 1, 0); - if (error != 0) { - printf("tmpfs get pages from pager error [read]\n"); - goto out; + rv = vm_pager_get_pages(tobj, &m, 1, 0); + if (rv != VM_PAGER_OK) { + vm_page_lock(m); + vm_page_free(m); + vm_page_unlock(m); + VM_OBJECT_UNLOCK(tobj); + return (EIO); } } else vm_page_zero_invalid(m, TRUE); @@ -456,12 +458,10 @@ tmpfs_nocacheread(vm_object_t tobj, vm_p VM_OBJECT_UNLOCK(tobj); error = uiomove_fromphys(&m, offset, tlen, uio); VM_OBJECT_LOCK(tobj); -out: vm_page_lock(m); vm_page_unwire(m, TRUE); vm_page_unlock(m); vm_page_wakeup(m); - vm_object_pip_subtract(tobj, 1); VM_OBJECT_UNLOCK(tobj); return (error); @@ -624,7 +624,7 @@ tmpfs_mappedwrite(vm_object_t vobj, vm_o vm_offset_t offset; off_t addr; size_t tlen; - int error; + int error, rv; error = 0; @@ -664,14 +664,16 @@ lookupvpg: } nocache: VM_OBJECT_LOCK(tobj); - vm_object_pip_add(tobj, 1); tpg = vm_page_grab(tobj, idx, VM_ALLOC_WIRED | VM_ALLOC_NORMAL | VM_ALLOC_RETRY); if (tpg->valid != VM_PAGE_BITS_ALL) { if (vm_pager_has_page(tobj, idx, NULL, NULL)) { - error = vm_pager_get_pages(tobj, &tpg, 1, 0); - if (error != 0) { - printf("tmpfs get pages from pager error [write]\n"); + rv = vm_pager_get_pages(tobj, &tpg, 1, 0); + if (rv != VM_PAGER_OK) { + vm_page_lock(tpg); + vm_page_free(tpg); + vm_page_unlock(tpg); + error = EIO; goto out; } } else @@ -685,9 +687,6 @@ nocache: pmap_copy_page(vpg, tpg); } VM_OBJECT_LOCK(tobj); -out: - if (vobj != NULL) - VM_OBJECT_LOCK(vobj); if (error == 0) { KASSERT(tpg->valid == VM_PAGE_BITS_ALL, ("parts of tpg invalid")); @@ -697,12 +696,13 @@ out: vm_page_unwire(tpg, TRUE); vm_page_unlock(tpg); vm_page_wakeup(tpg); - if (vpg != NULL) +out: + VM_OBJECT_UNLOCK(tobj); + if (vpg != NULL) { + VM_OBJECT_LOCK(vobj); vm_page_wakeup(vpg); - if (vobj != NULL) VM_OBJECT_UNLOCK(vobj); - vm_object_pip_subtract(tobj, 1); - VM_OBJECT_UNLOCK(tobj); + } return (error); } From owner-svn-src-all@FreeBSD.ORG Sat Jan 14 23:10:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A76921065673; Sat, 14 Jan 2012 23:10:18 +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 91D568FC14; Sat, 14 Jan 2012 23:10: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 q0ENAItB052837; Sat, 14 Jan 2012 23:10:18 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0ENAIaF052835; Sat, 14 Jan 2012 23:10:18 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201201142310.q0ENAIaF052835@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 14 Jan 2012 23:10: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: r230121 - head/tools/regression/bin/sh/expansion X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 23:10:18 -0000 Author: jilles Date: Sat Jan 14 23:10:18 2012 New Revision: 230121 URL: http://svn.freebsd.org/changeset/base/230121 Log: sh: Add testcases that should not be broken by future optimizations. Added: head/tools/regression/bin/sh/expansion/cmdsubst12.0 (contents, props changed) head/tools/regression/bin/sh/expansion/cmdsubst13.0 (contents, props changed) Added: head/tools/regression/bin/sh/expansion/cmdsubst12.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/cmdsubst12.0 Sat Jan 14 23:10:18 2012 (r230121) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +f() { + echo x$(printf foo >&2)y +} +[ "$(f 2>&1)" = "fooxy" ] Added: head/tools/regression/bin/sh/expansion/cmdsubst13.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/cmdsubst13.0 Sat Jan 14 23:10:18 2012 (r230121) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +x=1 y=2 +[ "$( + case $((x+=1)) in + ($((y+=1))) echo bad1 ;; + ($((y-1))) echo $x.$y ;; + ($((y=2))) echo bad2 ;; + (*) echo bad3 ;; + esac +)" = "2.3" ] || echo "Error at $LINENO" +[ "$x.$y" = "1.2" ] || echo "Error at $LINENO" From owner-svn-src-all@FreeBSD.ORG Sat Jan 14 23:19:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EA4D91065675; Sat, 14 Jan 2012 23:19:10 +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 D5C108FC12; Sat, 14 Jan 2012 23:19: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 q0ENJAEH053172; Sat, 14 Jan 2012 23:19:10 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0ENJAHj053170; Sat, 14 Jan 2012 23:19:10 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201201142319.q0ENJAHj053170@svn.freebsd.org> From: Doug Barton Date: Sat, 14 Jan 2012 23:19: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: r230122 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 23:19:11 -0000 Author: dougb Date: Sat Jan 14 23:19:10 2012 New Revision: 230122 URL: http://svn.freebsd.org/changeset/base/230122 Log: For the mass rc.d changes, add a command line to make the update easier Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Sat Jan 14 23:10:18 2012 (r230121) +++ head/UPDATING Sat Jan 14 23:19:10 2012 (r230122) @@ -28,6 +28,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 port installed with a script in /usr/local/etc/rc.d you can either hand-edit the rcvar= line, or reinstall the port. + An easy way to handle the mass-update of /etc/rc.d: + rm /etc/rc.d/* && mergemaster -i + 20120109: panic(9) now stops other CPUs in the SMP systems, disables interrupts on the current CPU and prevents other threads from running.