From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 01:23:14 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA355106566B; Sun, 15 Aug 2010 01:23:14 +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 8B4D88FC08; Sun, 15 Aug 2010 01:23:14 +0000 (UTC) Received: from lawrence1.loshell.room52.net (ppp59-167-184-191.static.internode.on.net [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id 69E387E853; Sun, 15 Aug 2010 11:23:12 +1000 (EST) Message-ID: <4C67417B.8030103@freebsd.org> Date: Sun, 15 Aug 2010 11:23:07 +1000 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-AU; rv:1.9.2.8) Gecko/20100810 Lightning/1.0b2 Thunderbird/3.1.2 MIME-Version: 1.0 To: Andre Oppermann References: <201008142040.o7EKete7038340@svn.freebsd.org> In-Reply-To: <201008142040.o7EKete7038340@svn.freebsd.org> 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: r211315 - 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, 15 Aug 2010 01:23:14 -0000 On 08/15/10 06:40, Andre Oppermann wrote: > Author: andre > Date: Sat Aug 14 20:40:55 2010 > New Revision: 211315 > URL: http://svn.freebsd.org/changeset/base/211315 > > Log: > Disable TCP inflight limiter by default. > > It was experimental and interferes with the normal congestion control > algorithms by instating a separate, possibly lower, ceiling for the > amount of data that is in flight to the remote host. With high speed > internet connections the inflight limit frequently has been estimated > too low due to the noisy nature of the RTT measurements. > > This code gives way for the upcoming pluggable congestion control > framework. It is the task of the congestion control algorithm to > set the congestion window and amount of inflight data without external > interference. > > Reviewed by: lstewart > MFC after: 1 week > Removal after: 1 month Hooray! Please remember to drop freebsd-net@ a note about the impending removal to give people a chance to speak up. Cheers, Lawrence From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 07:59:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8CEE71065696; Sun, 15 Aug 2010 07:59:42 +0000 (UTC) (envelope-from tim@kientzle.com) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id 504C28FC08; Sun, 15 Aug 2010 07:59:42 +0000 (UTC) Received: by pvg4 with SMTP id 4so1753092pvg.13 for ; Sun, 15 Aug 2010 00:59:42 -0700 (PDT) Received: by 10.142.83.14 with SMTP id g14mr3211540wfb.201.1281857737775; Sun, 15 Aug 2010 00:35:37 -0700 (PDT) Received: from [192.168.43.181] (m3d0536d0.tmodns.net [208.54.5.61]) by mx.google.com with ESMTPS id 23sm6184844wfa.22.2010.08.15.00.35.33 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 15 Aug 2010 00:35:35 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: Tim Kientzle In-Reply-To: <201008141840.o7EIe5ju035714@svn.freebsd.org> Date: Sun, 15 Aug 2010 00:35:29 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <1B6F3618-9EEF-4C94-B198-8E0900AC5794@kientzle.com> References: <201008141840.o7EIe5ju035714@svn.freebsd.org> To: Warner Losh X-Mailer: Apple Mail (2.1081) 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: r211310 - 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: Sun, 15 Aug 2010 07:59:42 -0000 On Aug 14, 2010, at 11:40 AM, Warner Losh wrote: > Author: imp > Date: Sat Aug 14 18:40:05 2010 > New Revision: 211310 > URL: http://svn.freebsd.org/changeset/base/211310 >=20 > Log: > Map COMPAT_IA32 to COMPAT_FREEBSD32 >=20 > Added: > stable/8/sys/conf/options-compat (contents, props changed) >=20 > Added: stable/8/sys/conf/options-compat > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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 00:00:00 1970 (empty, because file is newly added) > +++ stable/8/sys/conf/options-compat Sat Aug 14 18:40:05 2010 = (r211310) > @@ -0,0 +1,2 @@ > +# $FreeBSD$ > +COMPAT_IA32 COMPAT_FREEBSD32 This breaks the build for i386. "make kernel" in a clean checkout produces an error about "COMPAT_IA32 not in options". Tim From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 08:32:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42EFD1065674; Sun, 15 Aug 2010 08:32:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 324218FC1E; Sun, 15 Aug 2010 08:32:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7F8W9uB052630; Sun, 15 Aug 2010 08:32:09 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7F8W9i2052628; Sun, 15 Aug 2010 08:32:09 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201008150832.o7F8W9i2052628@svn.freebsd.org> From: Warner Losh Date: Sun, 15 Aug 2010 08:32: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: r211323 - 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: Sun, 15 Aug 2010 08:32:10 -0000 Author: imp Date: Sun Aug 15 08:32:09 2010 New Revision: 211323 URL: http://svn.freebsd.org/changeset/base/211323 Log: Need to add COMPAT_IA32 to options.i386 too Modified: stable/8/sys/conf/options.i386 Modified: stable/8/sys/conf/options.i386 ============================================================================== --- stable/8/sys/conf/options.i386 Sun Aug 15 06:10:08 2010 (r211322) +++ stable/8/sys/conf/options.i386 Sun Aug 15 08:32:09 2010 (r211323) @@ -20,6 +20,7 @@ POWERFAIL_NMI opt_trap.h # Options for emulators. These should only be used at config time, so # they are handled like options for static filesystems # (see src/sys/conf/options), except for broken debugging options. +COMPAT_IA32 opt_dontuse.h COMPAT_AOUT opt_dontuse.h IBCS2 opt_dontuse.h COMPAT_LINUX opt_dontuse.h From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 08:38:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7643E10656AB; Sun, 15 Aug 2010 08:38:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A3058FC17; Sun, 15 Aug 2010 08:38:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7F8cmNg052813; Sun, 15 Aug 2010 08:38:48 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7F8cmZG052806; Sun, 15 Aug 2010 08:38:48 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201008150838.o7F8cmZG052806@svn.freebsd.org> From: Warner Losh Date: Sun, 15 Aug 2010 08:38:48 +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: r211324 - 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: Sun, 15 Aug 2010 08:38:48 -0000 Author: imp Date: Sun Aug 15 08:38:48 2010 New Revision: 211324 URL: http://svn.freebsd.org/changeset/base/211324 Log: Add lame COMPAT_IA32 lines to all the options.* files until I fix config. Modified: stable/8/sys/conf/options.arm stable/8/sys/conf/options.mips stable/8/sys/conf/options.pc98 stable/8/sys/conf/options.powerpc stable/8/sys/conf/options.sparc64 stable/8/sys/conf/options.sun4v Modified: stable/8/sys/conf/options.arm ============================================================================== --- stable/8/sys/conf/options.arm Sun Aug 15 08:32:09 2010 (r211323) +++ stable/8/sys/conf/options.arm Sun Aug 15 08:38:48 2010 (r211324) @@ -36,3 +36,6 @@ VERBOSE_INIT_ARM opt_global.h AT91_BWCT opt_at91.h AT91_TSC opt_at91.h AT91_KWIKBYTE opt_at91.h + +# Needed for the compatibility mapping for amd64 -- will go away soon +COMPAT_IA32 opt_dontuse.h Modified: stable/8/sys/conf/options.mips ============================================================================== --- stable/8/sys/conf/options.mips Sun Aug 15 08:32:09 2010 (r211323) +++ stable/8/sys/conf/options.mips Sun Aug 15 08:38:48 2010 (r211324) @@ -55,3 +55,6 @@ TARGET_EMULATOR opt_ddb.h TICK_USE_YAMON_FREQ opt_global.h TICK_USE_MALTA_RTC opt_global.h + +# Needed for the compatibility mapping for amd64 -- will go away soon +COMPAT_IA32 opt_dontuse.h Modified: stable/8/sys/conf/options.pc98 ============================================================================== --- stable/8/sys/conf/options.pc98 Sun Aug 15 08:32:09 2010 (r211323) +++ stable/8/sys/conf/options.pc98 Sun Aug 15 08:38:48 2010 (r211324) @@ -18,6 +18,7 @@ POWERFAIL_NMI opt_trap.h # Options for emulators. These should only be used at config time, so # they are handled like options for static filesystems # (see src/sys/conf/options), except for broken debugging options. +COMPAT_IA32 opt_dontuse.h COMPAT_AOUT opt_dontuse.h IBCS2 opt_dontuse.h COMPAT_LINUX opt_dontuse.h Modified: stable/8/sys/conf/options.powerpc ============================================================================== --- stable/8/sys/conf/options.powerpc Sun Aug 15 08:32:09 2010 (r211323) +++ stable/8/sys/conf/options.powerpc Sun Aug 15 08:38:48 2010 (r211324) @@ -17,3 +17,6 @@ PSIM SC_OFWFB opt_ofwfb.h OFWCONS_POLL_HZ opt_ofw.h + +# Needed for the compatibility mapping for amd64 -- will go away soon +COMPAT_IA32 opt_dontuse.h Modified: stable/8/sys/conf/options.sparc64 ============================================================================== --- stable/8/sys/conf/options.sparc64 Sun Aug 15 08:32:09 2010 (r211323) +++ stable/8/sys/conf/options.sparc64 Sun Aug 15 08:38:48 2010 (r211324) @@ -30,3 +30,6 @@ SCHIZO_DEBUG opt_schizo.h SUNKBD_DFLT_KEYMAP opt_sunkbd.h SUNKBD_EMULATE_ATKBD opt_sunkbd.h + +# Needed for the compatibility mapping for amd64 -- will go away soon +COMPAT_IA32 opt_dontuse.h Modified: stable/8/sys/conf/options.sun4v ============================================================================== --- stable/8/sys/conf/options.sun4v Sun Aug 15 08:32:09 2010 (r211323) +++ stable/8/sys/conf/options.sun4v Sun Aug 15 08:38:48 2010 (r211324) @@ -13,3 +13,6 @@ DTRACE opt_global.h TRAP_TRACING opt_trap_trace.h TRAP_TRACE_ENTRIES opt_trap_trace.h + +# Needed for the compatibility mapping for amd64 -- will go away soon +COMPAT_IA32 opt_dontuse.h From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 08:40:31 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AA421065672; Sun, 15 Aug 2010 08:40:31 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 2BF578FC08; Sun, 15 Aug 2010 08:40:31 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o7F8YwvA035306; Sun, 15 Aug 2010 02:34:58 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 15 Aug 2010 02:35:31 -0600 (MDT) Message-Id: <20100815.023531.319083499606209625.imp@bsdimp.com> To: tim@kientzle.com From: "M. Warner Losh" In-Reply-To: <1B6F3618-9EEF-4C94-B198-8E0900AC5794@kientzle.com> References: <201008141840.o7EIe5ju035714@svn.freebsd.org> <1B6F3618-9EEF-4C94-B198-8E0900AC5794@kientzle.com> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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: r211310 - 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: Sun, 15 Aug 2010 08:40:31 -0000 In message: <1B6F3618-9EEF-4C94-B198-8E0900AC5794@kientzle.com> Tim Kientzle writes: : On Aug 14, 2010, at 11:40 AM, Warner Losh wrote: : : > Author: imp : > Date: Sat Aug 14 18:40:05 2010 : > New Revision: 211310 : > URL: http://svn.freebsd.org/changeset/base/211310 : > : > Log: : > Map COMPAT_IA32 to COMPAT_FREEBSD32 : > : > Added: : > stable/8/sys/conf/options-compat (contents, props changed) : > : > Added: stable/8/sys/conf/options-compat : > ============================================================================== : > --- /dev/null 00:00:00 1970 (empty, because file is newly added) : > +++ stable/8/sys/conf/options-compat Sat Aug 14 18:40:05 2010 (r211310) : > @@ -0,0 +1,2 @@ : > +# $FreeBSD$ : > +COMPAT_IA32 COMPAT_FREEBSD32 : : This breaks the build for i386. : : "make kernel" in a clean checkout produces an error about : "COMPAT_IA32 not in options". Yea, I neglected to commit the options.i386 file. I've just done that now. I may also need to commit this to mips, et al. Doing test builds to find out. Grump. Warner From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 08:44:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C7241065696; Sun, 15 Aug 2010 08:44:33 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F06628FC12; Sun, 15 Aug 2010 08:44:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7F8iWtR052954; Sun, 15 Aug 2010 08:44:32 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7F8iWsB052952; Sun, 15 Aug 2010 08:44:32 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201008150844.o7F8iWsB052952@svn.freebsd.org> From: Warner Losh Date: Sun, 15 Aug 2010 08:44: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: r211325 - 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: Sun, 15 Aug 2010 08:44:33 -0000 Author: imp Date: Sun Aug 15 08:44:32 2010 New Revision: 211325 URL: http://svn.freebsd.org/changeset/base/211325 Log: Turns out that it is a bad idea to have a missing compat option be a fatal condition. While it works out really well for diagnosing the case where you want it, but don't have it, it works really badly for the case where you don't have it and don't want it. Remove the printf and exit pair. Replate it with simple return to silently ignore this condition. This is needed to fix the COMPAT_IA32 being required in options.* in stable, but we need to run this change through -current first... MFC after: 3 days Modified: head/usr.sbin/config/mkoptions.c Modified: head/usr.sbin/config/mkoptions.c ============================================================================== --- head/usr.sbin/config/mkoptions.c Sun Aug 15 08:38:48 2010 (r211324) +++ head/usr.sbin/config/mkoptions.c Sun Aug 15 08:44:32 2010 (r211325) @@ -351,9 +351,11 @@ update_option(const char *this, char *va return; } } - fprintf(stderr, "Compat option %s not listed in options file.\n", - this); - exit(1); + /* + * Option not found, but that's OK, we just ignore it since it + * may be for another arch. + */ + return; } static int From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 08:49:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C9EB10656A7; Sun, 15 Aug 2010 08:49:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0CBFC8FC12; Sun, 15 Aug 2010 08:49:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7F8n75b053141; Sun, 15 Aug 2010 08:49:07 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7F8n7QZ053139; Sun, 15 Aug 2010 08:49:07 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201008150849.o7F8n7QZ053139@svn.freebsd.org> From: Warner Losh Date: Sun, 15 Aug 2010 08:49: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: r211326 - 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: Sun, 15 Aug 2010 08:49:08 -0000 Author: imp Date: Sun Aug 15 08:49:07 2010 New Revision: 211326 URL: http://svn.freebsd.org/changeset/base/211326 Log: Given the lag between introducing the options-compat and fixing the bug in the config file was long, and merged to stable, we have to bump the version here so that stable/8 kernels can have their required version number bumped to make sure the right config is used. MFC after: 3 days Modified: head/usr.sbin/config/configvers.h Modified: head/usr.sbin/config/configvers.h ============================================================================== --- head/usr.sbin/config/configvers.h Sun Aug 15 08:44:32 2010 (r211325) +++ head/usr.sbin/config/configvers.h Sun Aug 15 08:49:07 2010 (r211326) @@ -49,5 +49,5 @@ * * $FreeBSD$ */ -#define CONFIGVERS 600010 +#define CONFIGVERS 600011 #define MAJOR_VERS(x) ((x) / 100000) From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 08:57:17 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB7A510656B8; Sun, 15 Aug 2010 08:57:17 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 6B6528FC2B; Sun, 15 Aug 2010 08:57:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o7F8kIKE035377; Sun, 15 Aug 2010 02:46:18 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sun, 15 Aug 2010 02:46:51 -0600 (MDT) Message-Id: <20100815.024651.276219111537201295.imp@bsdimp.com> To: tim@kientzle.com From: "M. Warner Losh" In-Reply-To: <1B6F3618-9EEF-4C94-B198-8E0900AC5794@kientzle.com> References: <201008141840.o7EIe5ju035714@svn.freebsd.org> <1B6F3618-9EEF-4C94-B198-8E0900AC5794@kientzle.com> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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: r211310 - 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: Sun, 15 Aug 2010 08:57:17 -0000 In message: <1B6F3618-9EEF-4C94-B198-8E0900AC5794@kientzle.com> Tim Kientzle writes: : On Aug 14, 2010, at 11:40 AM, Warner Losh wrote: : : > Author: imp : > Date: Sat Aug 14 18:40:05 2010 : > New Revision: 211310 : > URL: http://svn.freebsd.org/changeset/base/211310 : > : > Log: : > Map COMPAT_IA32 to COMPAT_FREEBSD32 : > : > Added: : > stable/8/sys/conf/options-compat (contents, props changed) : > : > Added: stable/8/sys/conf/options-compat : > ============================================================================== : > --- /dev/null 00:00:00 1970 (empty, because file is newly added) : > +++ stable/8/sys/conf/options-compat Sat Aug 14 18:40:05 2010 (r211310) : > @@ -0,0 +1,2 @@ : > +# $FreeBSD$ : > +COMPAT_IA32 COMPAT_FREEBSD32 : : This breaks the build for i386. : : "make kernel" in a clean checkout produces an error about : "COMPAT_IA32 not in options". OK. I've fixed this for all the other architectures supported in stable/8. I've also pushed a fix into -current that will fix this problem when merged to stable so we can take them back out... Sorry for the hassle... Warner From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 09:30:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D881210656A3; Sun, 15 Aug 2010 09:30:13 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ADBF48FC15; Sun, 15 Aug 2010 09:30:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7F9UDZb054328; Sun, 15 Aug 2010 09:30:13 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7F9UD2P054326; Sun, 15 Aug 2010 09:30:13 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201008150930.o7F9UD2P054326@svn.freebsd.org> From: Andre Oppermann Date: Sun, 15 Aug 2010 09:30: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: r211327 - 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, 15 Aug 2010 09:30:13 -0000 Author: andre Date: Sun Aug 15 09:30:13 2010 New Revision: 211327 URL: http://svn.freebsd.org/changeset/base/211327 Log: Add more logging points for failures in syncache_socket() to report when a new socket couldn't be created because one of in_pcbinshash(), in6_pcbconnect() or in_pcbconnect() failed. Logging is conditional on net.inet.tcp.log_debug being enabled. MFC after: 1 week Modified: head/sys/netinet/tcp_syncache.c Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Sun Aug 15 08:49:07 2010 (r211326) +++ head/sys/netinet/tcp_syncache.c Sun Aug 15 09:30:13 2010 (r211327) @@ -627,6 +627,7 @@ syncache_socket(struct syncache *sc, str struct inpcb *inp = NULL; struct socket *so; struct tcpcb *tp; + int error = 0; char *s; INP_INFO_WLOCK_ASSERT(&V_tcbinfo); @@ -675,7 +676,7 @@ syncache_socket(struct syncache *sc, str } #endif inp->inp_lport = sc->sc_inc.inc_lport; - if (in_pcbinshash(inp) != 0) { + if ((error = in_pcbinshash(inp)) != 0) { /* * Undo the assignments above if we failed to * put the PCB on the hash lists. @@ -687,6 +688,12 @@ syncache_socket(struct syncache *sc, str #endif inp->inp_laddr.s_addr = INADDR_ANY; inp->inp_lport = 0; + if ((s = tcp_log_addrs(&sc->sc_inc, NULL, NULL, NULL))) { + log(LOG_DEBUG, "%s; %s: in_pcbinshash failed " + "with error %i\n", + s, __func__, error); + free(s, M_TCPLOG); + } goto abort; } #ifdef IPSEC @@ -721,9 +728,15 @@ syncache_socket(struct syncache *sc, str laddr6 = inp->in6p_laddr; if (IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr)) inp->in6p_laddr = sc->sc_inc.inc6_laddr; - if (in6_pcbconnect(inp, (struct sockaddr *)&sin6, - thread0.td_ucred)) { + if ((error = in6_pcbconnect(inp, (struct sockaddr *)&sin6, + thread0.td_ucred)) != 0) { inp->in6p_laddr = laddr6; + if ((s = tcp_log_addrs(&sc->sc_inc, NULL, NULL, NULL))) { + log(LOG_DEBUG, "%s; %s: in6_pcbconnect failed " + "with error %i\n", + s, __func__, error); + free(s, M_TCPLOG); + } goto abort; } /* Override flowlabel from in6_pcbconnect. */ @@ -750,9 +763,15 @@ syncache_socket(struct syncache *sc, str laddr = inp->inp_laddr; if (inp->inp_laddr.s_addr == INADDR_ANY) inp->inp_laddr = sc->sc_inc.inc_laddr; - if (in_pcbconnect(inp, (struct sockaddr *)&sin, - thread0.td_ucred)) { + if ((error = in_pcbconnect(inp, (struct sockaddr *)&sin, + thread0.td_ucred)) != 0) { inp->inp_laddr = laddr; + if ((s = tcp_log_addrs(&sc->sc_inc, NULL, NULL, NULL))) { + log(LOG_DEBUG, "%s; %s: in_pcbconnect failed " + "with error %i\n", + s, __func__, error); + free(s, M_TCPLOG); + } goto abort; } } From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 09:45:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6336C106564A; Sun, 15 Aug 2010 09:45:08 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id E801B8FC12; Sun, 15 Aug 2010 09:45:07 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id E81FF41C705; Sun, 15 Aug 2010 11:45:06 +0200 (CEST) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id r501J+W53qtY; Sun, 15 Aug 2010 11:45:05 +0200 (CEST) Received: by mail.cksoft.de (Postfix, from userid 66) id C76CF41C713; Sun, 15 Aug 2010 11:45:05 +0200 (CEST) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 202914448EC; Sun, 15 Aug 2010 09:41:13 +0000 (UTC) Date: Sun, 15 Aug 2010 09:41:13 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Andre Oppermann In-Reply-To: <201008150930.o7F9UD2P054326@svn.freebsd.org> Message-ID: <20100815094057.F48418@maildrop.int.zabbadoz.net> References: <201008150930.o7F9UD2P054326@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 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: r211327 - 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, 15 Aug 2010 09:45:08 -0000 On Sun, 15 Aug 2010, Andre Oppermann wrote: > Author: andre > Date: Sun Aug 15 09:30:13 2010 > New Revision: 211327 > URL: http://svn.freebsd.org/changeset/base/211327 > > Log: > Add more logging points for failures in syncache_socket() to > report when a new socket couldn't be created because one of > in_pcbinshash(), in6_pcbconnect() or in_pcbconnect() failed. > > Logging is conditional on net.inet.tcp.log_debug being enabled. > > MFC after: 1 week > > Modified: > head/sys/netinet/tcp_syncache.c > > Modified: head/sys/netinet/tcp_syncache.c > ============================================================================== > --- head/sys/netinet/tcp_syncache.c Sun Aug 15 08:49:07 2010 (r211326) > +++ head/sys/netinet/tcp_syncache.c Sun Aug 15 09:30:13 2010 (r211327) > @@ -627,6 +627,7 @@ syncache_socket(struct syncache *sc, str > struct inpcb *inp = NULL; > struct socket *so; > struct tcpcb *tp; > + int error = 0; Is there any need to initialize here? > char *s; > > INP_INFO_WLOCK_ASSERT(&V_tcbinfo); > @@ -675,7 +676,7 @@ syncache_socket(struct syncache *sc, str > } > #endif > inp->inp_lport = sc->sc_inc.inc_lport; > - if (in_pcbinshash(inp) != 0) { > + if ((error = in_pcbinshash(inp)) != 0) { > /* > * Undo the assignments above if we failed to > * put the PCB on the hash lists. > @@ -687,6 +688,12 @@ syncache_socket(struct syncache *sc, str > #endif > inp->inp_laddr.s_addr = INADDR_ANY; > inp->inp_lport = 0; > + if ((s = tcp_log_addrs(&sc->sc_inc, NULL, NULL, NULL))) { > + log(LOG_DEBUG, "%s; %s: in_pcbinshash failed " > + "with error %i\n", > + s, __func__, error); > + free(s, M_TCPLOG); > + } > goto abort; > } > #ifdef IPSEC > @@ -721,9 +728,15 @@ syncache_socket(struct syncache *sc, str > laddr6 = inp->in6p_laddr; > if (IN6_IS_ADDR_UNSPECIFIED(&inp->in6p_laddr)) > inp->in6p_laddr = sc->sc_inc.inc6_laddr; > - if (in6_pcbconnect(inp, (struct sockaddr *)&sin6, > - thread0.td_ucred)) { > + if ((error = in6_pcbconnect(inp, (struct sockaddr *)&sin6, > + thread0.td_ucred)) != 0) { > inp->in6p_laddr = laddr6; > + if ((s = tcp_log_addrs(&sc->sc_inc, NULL, NULL, NULL))) { > + log(LOG_DEBUG, "%s; %s: in6_pcbconnect failed " > + "with error %i\n", > + s, __func__, error); > + free(s, M_TCPLOG); > + } > goto abort; > } > /* Override flowlabel from in6_pcbconnect. */ > @@ -750,9 +763,15 @@ syncache_socket(struct syncache *sc, str > laddr = inp->inp_laddr; > if (inp->inp_laddr.s_addr == INADDR_ANY) > inp->inp_laddr = sc->sc_inc.inc_laddr; > - if (in_pcbconnect(inp, (struct sockaddr *)&sin, > - thread0.td_ucred)) { > + if ((error = in_pcbconnect(inp, (struct sockaddr *)&sin, > + thread0.td_ucred)) != 0) { > inp->inp_laddr = laddr; > + if ((s = tcp_log_addrs(&sc->sc_inc, NULL, NULL, NULL))) { > + log(LOG_DEBUG, "%s; %s: in_pcbconnect failed " > + "with error %i\n", > + s, __func__, error); > + free(s, M_TCPLOG); > + } > goto abort; > } > } > -- Bjoern A. Zeeb This signature is about you not me. From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 11:32:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0B8C10656A8; Sun, 15 Aug 2010 11:32:05 +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 905D08FC16; Sun, 15 Aug 2010 11:32:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FBW5mf059037; Sun, 15 Aug 2010 11:32:05 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FBW5oY059035; Sun, 15 Aug 2010 11:32:05 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201008151132.o7FBW5oY059035@svn.freebsd.org> From: Adrian Chadd Date: Sun, 15 Aug 2010 11:32: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: r211328 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2010 11:32:05 -0000 Author: adrian Date: Sun Aug 15 11:32:05 2010 New Revision: 211328 URL: http://svn.freebsd.org/changeset/base/211328 Log: The comment is misleading - that register setting seems to kick off the initial chip NF cal. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Sun Aug 15 09:30:13 2010 (r211327) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Sun Aug 15 11:32:05 2010 (r211328) @@ -221,6 +221,7 @@ ar5416InitCal(struct ath_hal *ah, const * higher than normal value if DC offset and noise floor cal are * triggered at the same time. */ + /* XXX this actually kicks off a NF calibration -adrian */ OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NF); /* * Try to make sure the above NF cal completes, just so From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 11:40:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2737A10656A7; Sun, 15 Aug 2010 11:40:54 +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 170AF8FC1B; Sun, 15 Aug 2010 11:40:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FBergJ059342; Sun, 15 Aug 2010 11:40:53 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FBer3f059340; Sun, 15 Aug 2010 11:40:53 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201008151140.o7FBer3f059340@svn.freebsd.org> From: Adrian Chadd Date: Sun, 15 Aug 2010 11:40: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: r211330 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2010 11:40:54 -0000 Author: adrian Date: Sun Aug 15 11:40:53 2010 New Revision: 211330 URL: http://svn.freebsd.org/changeset/base/211330 Log: Fix indenting/whitespace issues introduced by me. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Sun Aug 15 11:38:38 2010 (r211329) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Sun Aug 15 11:40:53 2010 (r211330) @@ -232,7 +232,7 @@ ar5416InitCal(struct ath_hal *ah, const "not complete in time; noisy environment?\n", __func__); return AH_FALSE; } - + /* Initialize list pointers */ cal->cal_list = cal->cal_last = cal->cal_curr = AH_NULL; From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 13:07:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3A5810656A5; Sun, 15 Aug 2010 13:07:08 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E34E98FC13; Sun, 15 Aug 2010 13:07:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FD78t9061239; Sun, 15 Aug 2010 13:07:08 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FD78qp061237; Sun, 15 Aug 2010 13:07:08 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201008151307.o7FD78qp061237@svn.freebsd.org> From: Andre Oppermann Date: Sun, 15 Aug 2010 13:07: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: r211332 - 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, 15 Aug 2010 13:07:09 -0000 Author: andre Date: Sun Aug 15 13:07:08 2010 New Revision: 211332 URL: http://svn.freebsd.org/changeset/base/211332 Log: Initializing the new error variable to zero in syncache_socket() is not necessary. Noticed by: bz Modified: head/sys/netinet/tcp_syncache.c Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Sun Aug 15 11:44:08 2010 (r211331) +++ head/sys/netinet/tcp_syncache.c Sun Aug 15 13:07:08 2010 (r211332) @@ -627,7 +627,7 @@ syncache_socket(struct syncache *sc, str struct inpcb *inp = NULL; struct socket *so; struct tcpcb *tp; - int error = 0; + int error; char *s; INP_INFO_WLOCK_ASSERT(&V_tcbinfo); From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 13:25:19 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58141106574F; Sun, 15 Aug 2010 13:25:19 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2D6FC8FC14; Sun, 15 Aug 2010 13:25:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FDPJWY061616; Sun, 15 Aug 2010 13:25:19 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FDPJfE061613; Sun, 15 Aug 2010 13:25:19 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201008151325.o7FDPJfE061613@svn.freebsd.org> From: Andre Oppermann Date: Sun, 15 Aug 2010 13:25: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: r211333 - 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, 15 Aug 2010 13:25:19 -0000 Author: andre Date: Sun Aug 15 13:25:18 2010 New Revision: 211333 URL: http://svn.freebsd.org/changeset/base/211333 Log: Fix the interaction between 'ICMP fragmentation needed' MTU updates, path MTU discovery and the tcp_minmss limiter for very small MTU's. When the MTU suggested by the gateway via ICMP, or if there isn't any the next smaller step from ip_next_mtu(), is lower than the floor enforced by net.inet.tcp.minmss (default 216) the value is ignored and the default MSS (512) is used instead. However the DF flag in the IP header is still set in tcp_output() preventing fragmentation by the gateway. Fix this by using tcp_minmss as the MSS and clear the DF flag if the suggested MTU is too low. This turns off path MTU dissovery for the remainder of the session and allows fragmentation to be done by the gateway. Only MTU's smaller than 256 are affected. The smallest official MTU specified is for AX.25 packet radio at 256 octets. PR: kern/146628 Tested by: Matthew Luckie MFC after: 1 week Modified: head/sys/netinet/tcp_output.c head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Sun Aug 15 13:07:08 2010 (r211332) +++ head/sys/netinet/tcp_output.c Sun Aug 15 13:25:18 2010 (r211333) @@ -1186,8 +1186,10 @@ timer: * This might not be the best thing to do according to RFC3390 * Section 2. However the tcp hostcache migitates the problem * so it affects only the first tcp connection with a host. + * + * NB: Don't set DF on small MTU/MSS to have a safe fallback. */ - if (V_path_mtu_discovery) + if (V_path_mtu_discovery && tp->t_maxopd > V_tcp_minmss) ip->ip_off |= IP_DF; error = ip_output(m, tp->t_inpcb->inp_options, NULL, Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Sun Aug 15 13:07:08 2010 (r211332) +++ head/sys/netinet/tcp_subr.c Sun Aug 15 13:25:18 2010 (r211333) @@ -1339,11 +1339,9 @@ tcp_ctlinput(int cmd, struct sockaddr *s if (!mtu) mtu = ip_next_mtu(ip->ip_len, 1); - if (mtu < max(296, V_tcp_minmss - + sizeof(struct tcpiphdr))) - mtu = 0; - if (!mtu) - mtu = V_tcp_mssdflt + if (mtu < V_tcp_minmss + + sizeof(struct tcpiphdr)) + mtu = V_tcp_minmss + sizeof(struct tcpiphdr); /* * Only cache the the MTU if it From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 13:47:24 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E488B10656A8 for ; Sun, 15 Aug 2010 13:47:23 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 3E9718FC1C for ; Sun, 15 Aug 2010 13:47:23 +0000 (UTC) Received: (qmail 91479 invoked from network); 15 Aug 2010 11:49:47 -0000 Received: from localhost (HELO [127.0.0.1]) ([127.0.0.1]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 15 Aug 2010 11:49:47 -0000 Message-ID: <4C67E9AA.60608@freebsd.org> Date: Sun, 15 Aug 2010 15:20:42 +0200 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.11) Gecko/20100711 Thunderbird/3.0.6 MIME-Version: 1.0 To: "Bjoern A. Zeeb" References: <201008150930.o7F9UD2P054326@svn.freebsd.org> <20100815094057.F48418@maildrop.int.zabbadoz.net> In-Reply-To: <20100815094057.F48418@maildrop.int.zabbadoz.net> 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 Subject: Re: svn commit: r211327 - 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, 15 Aug 2010 13:47:24 -0000 On 15.08.2010 11:41, Bjoern A. Zeeb wrote: > On Sun, 15 Aug 2010, Andre Oppermann wrote: > >> Author: andre >> Date: Sun Aug 15 09:30:13 2010 >> New Revision: 211327 >> URL: http://svn.freebsd.org/changeset/base/211327 >> >> Log: >> Add more logging points for failures in syncache_socket() to >> report when a new socket couldn't be created because one of >> in_pcbinshash(), in6_pcbconnect() or in_pcbconnect() failed. >> >> Logging is conditional on net.inet.tcp.log_debug being enabled. >> >> MFC after: 1 week >> >> Modified: >> head/sys/netinet/tcp_syncache.c >> >> Modified: head/sys/netinet/tcp_syncache.c >> ============================================================================== >> >> --- head/sys/netinet/tcp_syncache.c Sun Aug 15 08:49:07 2010 (r211326) >> +++ head/sys/netinet/tcp_syncache.c Sun Aug 15 09:30:13 2010 (r211327) >> @@ -627,6 +627,7 @@ syncache_socket(struct syncache *sc, str >> struct inpcb *inp = NULL; >> struct socket *so; >> struct tcpcb *tp; >> + int error = 0; > > > Is there any need to initialize here? No. Actually not. Was just my style of using safe initial values. But here the return value is the socket pointer of NULL. The error is not passed back directly. Fixed in r211332. Thanks for noticing and reporting. -- Andre From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 14:38:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C88E1065697; Sun, 15 Aug 2010 14:38:01 +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 5BFDC8FC12; Sun, 15 Aug 2010 14:38:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FEc1d0062992; Sun, 15 Aug 2010 14:38:01 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FEc1Q4062990; Sun, 15 Aug 2010 14:38:01 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201008151438.o7FEc1Q4062990@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 15 Aug 2010 14:38: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: r211335 - head/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: Sun, 15 Aug 2010 14:38:01 -0000 Author: kib Date: Sun Aug 15 14:38:01 2010 New Revision: 211335 URL: http://svn.freebsd.org/changeset/base/211335 Log: Add convenience defines for hidden and default/exported attributes. MFC after: 2 weeks Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Sun Aug 15 14:11:58 2010 (r211334) +++ head/sys/sys/cdefs.h Sun Aug 15 14:38:01 2010 (r211335) @@ -305,6 +305,14 @@ #define __predict_false(exp) (exp) #endif +#if __GNUC_PREREQ__(4, 2) +#define __hidden __attribute((visibility("hidden"))) +#define __exported __attribute((visibility("default"))) +#else +#define __hidden +#define __exported +#endif + /* * We define this here since , , and * require it. From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 14:44:48 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C6A81065675; Sun, 15 Aug 2010 14:44:48 +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 4B0CB8FC1B; Sun, 15 Aug 2010 14:44:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FEimnB063153; Sun, 15 Aug 2010 14:44:48 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FEimYA063143; Sun, 15 Aug 2010 14:44:48 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201008151444.o7FEimYA063143@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 15 Aug 2010 14:44: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: r211336 - head/tools/regression/fstest/tests/chmod X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2010 14:44:48 -0000 Author: pjd Date: Sun Aug 15 14:44:48 2010 New Revision: 211336 URL: http://svn.freebsd.org/changeset/base/211336 Log: More tests (especially for lchmod(2)), less code duplication. Modified: head/tools/regression/fstest/tests/chmod/00.t head/tools/regression/fstest/tests/chmod/04.t head/tools/regression/fstest/tests/chmod/05.t head/tools/regression/fstest/tests/chmod/06.t head/tools/regression/fstest/tests/chmod/07.t head/tools/regression/fstest/tests/chmod/08.t head/tools/regression/fstest/tests/chmod/09.t head/tools/regression/fstest/tests/chmod/10.t head/tools/regression/fstest/tests/chmod/11.t Modified: head/tools/regression/fstest/tests/chmod/00.t ============================================================================== --- head/tools/regression/fstest/tests/chmod/00.t Sun Aug 15 14:38:01 2010 (r211335) +++ head/tools/regression/fstest/tests/chmod/00.t Sun Aug 15 14:44:48 2010 (r211336) @@ -7,9 +7,9 @@ dir=`dirname $0` . ${dir}/../misc.sh if supported lchmod; then - echo "1..77" + echo "1..203" else - echo "1..58" + echo "1..119" fi n0=`namegen` @@ -20,116 +20,100 @@ expect 0 mkdir ${n2} 0755 cdir=`pwd` cd ${n2} -expect 0 create ${n0} 0644 -expect 0644 stat ${n0} mode -expect 0 chmod ${n0} 0111 -expect 0111 stat ${n0} mode -expect 0 unlink ${n0} - -expect 0 mkdir ${n0} 0755 -expect 0755 stat ${n0} mode -expect 0 chmod ${n0} 0753 -expect 0753 stat ${n0} mode -expect 0 rmdir ${n0} - -expect 0 mkfifo ${n0} 0644 -expect 0644 stat ${n0} mode -expect 0 chmod ${n0} 0310 -expect 0310 stat ${n0} mode -expect 0 unlink ${n0} - -expect 0 create ${n0} 0644 -expect 0 symlink ${n0} ${n1} -expect 0644 stat ${n1} mode -expect 0 chmod ${n1} 0321 -expect 0321 stat ${n1} mode -expect 0321 lstat ${n0} mode -expect 0 unlink ${n0} -expect 0 unlink ${n1} - -if supported lchmod; then - expect 0 create ${n0} 0644 - expect 0 symlink ${n0} ${n1} - expect 0644 stat ${n1} mode - expect 0 lchmod ${n1} 0321 - expect 0321 lstat ${n1} mode - expect 0 lchmod ${n1} 0531 - expect 0531 lstat ${n1} mode - expect 0644 stat ${n0} mode - expect 0644 stat ${n1} mode - expect 0 unlink ${n0} - expect 0 unlink ${n1} -fi +for type in regular dir fifo block char socket symlink; do + if [ "${type}" != "symlink" ]; then + create_file ${type} ${n0} + expect 0 chmod ${n0} 0111 + expect 0111 stat ${n0} mode + + expect 0 symlink ${n0} ${n1} + mode=`${fstest} lstat ${n1} mode` + expect 0 chmod ${n1} 0222 + expect 0222 stat ${n1} mode + expect 0222 stat ${n0} mode + expect ${mode} lstat ${n1} mode + expect 0 unlink ${n1} + + if [ "${type}" = "dir" ]; then + expect 0 rmdir ${n0} + else + expect 0 unlink ${n0} + fi + fi + + if supported lchmod; then + create_file ${type} ${n0} + expect 0 lchmod ${n0} 0111 + expect 0111 lstat ${n0} mode + if [ "${type}" = "dir" ]; then + expect 0 rmdir ${n0} + else + expect 0 unlink ${n0} + fi + fi +done # successful chmod(2) updates ctime. -expect 0 create ${n0} 0644 -ctime1=`${fstest} stat ${n0} ctime` -sleep 1 -expect 0 chmod ${n0} 0111 -ctime2=`${fstest} stat ${n0} ctime` -test_check $ctime1 -lt $ctime2 -expect 0 unlink ${n0} - -expect 0 mkdir ${n0} 0755 -ctime1=`${fstest} stat ${n0} ctime` -sleep 1 -expect 0 chmod ${n0} 0753 -ctime2=`${fstest} stat ${n0} ctime` -test_check $ctime1 -lt $ctime2 -expect 0 rmdir ${n0} - -expect 0 mkfifo ${n0} 0644 -ctime1=`${fstest} stat ${n0} ctime` -sleep 1 -expect 0 chmod ${n0} 0310 -ctime2=`${fstest} stat ${n0} ctime` -test_check $ctime1 -lt $ctime2 -expect 0 unlink ${n0} - -if supported lchmod; then - expect 0 symlink ${n1} ${n0} - ctime1=`${fstest} lstat ${n0} ctime` - sleep 1 - expect 0 lchmod ${n0} 0321 - ctime2=`${fstest} lstat ${n0} ctime` - test_check $ctime1 -lt $ctime2 - expect 0 unlink ${n0} -fi +for type in regular dir fifo block char socket symlink; do + if [ "${type}" != "symlink" ]; then + create_file ${type} ${n0} + ctime1=`${fstest} stat ${n0} ctime` + sleep 1 + expect 0 chmod ${n0} 0111 + ctime2=`${fstest} stat ${n0} ctime` + test_check $ctime1 -lt $ctime2 + if [ "${type}" = "dir" ]; then + expect 0 rmdir ${n0} + else + expect 0 unlink ${n0} + fi + fi + + if supported lchmod; then + create_file ${type} ${n0} + ctime1=`${fstest} lstat ${n0} ctime` + sleep 1 + expect 0 lchmod ${n0} 0111 + ctime2=`${fstest} lstat ${n0} ctime` + test_check $ctime1 -lt $ctime2 + if [ "${type}" = "dir" ]; then + expect 0 rmdir ${n0} + else + expect 0 unlink ${n0} + fi + fi +done # unsuccessful chmod(2) does not update ctime. -expect 0 create ${n0} 0644 -ctime1=`${fstest} stat ${n0} ctime` -sleep 1 -expect EPERM -u 65534 chmod ${n0} 0111 -ctime2=`${fstest} stat ${n0} ctime` -test_check $ctime1 -eq $ctime2 -expect 0 unlink ${n0} - -expect 0 mkdir ${n0} 0755 -ctime1=`${fstest} stat ${n0} ctime` -sleep 1 -expect EPERM -u 65534 chmod ${n0} 0753 -ctime2=`${fstest} stat ${n0} ctime` -test_check $ctime1 -eq $ctime2 -expect 0 rmdir ${n0} - -expect 0 mkfifo ${n0} 0644 -ctime1=`${fstest} stat ${n0} ctime` -sleep 1 -expect EPERM -u 65534 chmod ${n0} 0310 -ctime2=`${fstest} stat ${n0} ctime` -test_check $ctime1 -eq $ctime2 -expect 0 unlink ${n0} - -if supported lchmod; then - expect 0 symlink ${n1} ${n0} - ctime1=`${fstest} lstat ${n0} ctime` - sleep 1 - expect EPERM -u 65534 lchmod ${n0} 0321 - ctime2=`${fstest} lstat ${n0} ctime` - test_check $ctime1 -eq $ctime2 - expect 0 unlink ${n0} -fi +for type in regular dir fifo block char socket symlink; do + if [ "${type}" != "symlink" ]; then + create_file ${type} ${n0} + ctime1=`${fstest} stat ${n0} ctime` + sleep 1 + expect EPERM -u 65534 chmod ${n0} 0111 + ctime2=`${fstest} stat ${n0} ctime` + test_check $ctime1 -eq $ctime2 + if [ "${type}" = "dir" ]; then + expect 0 rmdir ${n0} + else + expect 0 unlink ${n0} + fi + fi + + if supported lchmod; then + create_file ${type} ${n0} + ctime1=`${fstest} lstat ${n0} ctime` + sleep 1 + expect EPERM -u 65534 lchmod ${n0} 0321 + ctime2=`${fstest} lstat ${n0} ctime` + test_check $ctime1 -eq $ctime2 + if [ "${type}" = "dir" ]; then + expect 0 rmdir ${n0} + else + expect 0 unlink ${n0} + fi + fi +done # POSIX: If the calling process does not have appropriate privileges, and if # the group ID of the file does not match the effective group ID or one of the @@ -144,17 +128,10 @@ expect 02755 stat ${n0} mode expect 0 -u 65535 -g 65535 chmod ${n0} 0755 expect 0755 stat ${n0} mode -# Unfortunately FreeBSD doesn't clear set-gid bit, but returns EPERM instead. -case "${os}" in -FreeBSD) - expect EPERM -u 65535 -g 65534 chmod ${n0} 02755 - expect 0755 stat ${n0} mode - ;; -*) - expect 0 -u 65535 -g 65534 chmod ${n0} 02755 - expect 0755 stat ${n0} mode - ;; -esac +todo FreeBSD "S_ISGID should be removed and chmod(2) should success and FreeBSD returns EPERM." +expect 0 -u 65535 -g 65534 chmod ${n0} 02755 +expect 0755 stat ${n0} mode + expect 0 unlink ${n0} cd ${cdir} Modified: head/tools/regression/fstest/tests/chmod/04.t ============================================================================== --- head/tools/regression/fstest/tests/chmod/04.t Sun Aug 15 14:38:01 2010 (r211335) +++ head/tools/regression/fstest/tests/chmod/04.t Sun Aug 15 14:44:48 2010 (r211336) @@ -6,12 +6,24 @@ desc="chmod returns ENOENT if the named dir=`dirname $0` . ${dir}/../misc.sh -echo "1..4" +if supported lchmod; then + echo "1..9" +else + echo "1..7" +fi n0=`namegen` n1=`namegen` +n2=`namegen` expect 0 mkdir ${n0} 0755 expect ENOENT chmod ${n0}/${n1}/test 0644 expect ENOENT chmod ${n0}/${n1} 0644 +if supported lchmod; then + expect ENOENT lchmod ${n0}/${n1}/test 0644 + expect ENOENT lchmod ${n0}/${n1} 0644 +fi +expect 0 symlink ${n2} ${n0}/${n1} +expect ENOENT chmod ${n0}/${n1} 0644 +expect 0 unlink ${n0}/${n1} expect 0 rmdir ${n0} Modified: head/tools/regression/fstest/tests/chmod/05.t ============================================================================== --- head/tools/regression/fstest/tests/chmod/05.t Sun Aug 15 14:38:01 2010 (r211335) +++ head/tools/regression/fstest/tests/chmod/05.t Sun Aug 15 14:44:48 2010 (r211336) @@ -6,7 +6,11 @@ desc="chmod returns EACCES when search p dir=`dirname $0` . ${dir}/../misc.sh -echo "1..14" +if supported lchmod; then + echo "1..19" +else + echo "1..14" +fi n0=`namegen` n1=`namegen` @@ -25,6 +29,13 @@ expect EACCES -u 65534 -g 65534 chmod ${ expect 0 chmod ${n1} 0755 expect 0 -u 65534 -g 65534 chmod ${n1}/${n2} 0420 expect 0420 -u 65534 -g 65534 stat ${n1}/${n2} mode +if supported lchmod; then + expect 0 chmod ${n1} 0644 + expect EACCES -u 65534 -g 65534 lchmod ${n1}/${n2} 0410 + expect 0 chmod ${n1} 0755 + expect 0 -u 65534 -g 65534 lchmod ${n1}/${n2} 0710 + expect 0710 -u 65534 -g 65534 stat ${n1}/${n2} mode +fi expect 0 -u 65534 -g 65534 unlink ${n1}/${n2} expect 0 rmdir ${n1} cd ${cdir} Modified: head/tools/regression/fstest/tests/chmod/06.t ============================================================================== --- head/tools/regression/fstest/tests/chmod/06.t Sun Aug 15 14:38:01 2010 (r211335) +++ head/tools/regression/fstest/tests/chmod/06.t Sun Aug 15 14:44:48 2010 (r211336) @@ -6,7 +6,11 @@ desc="chmod returns ELOOP if too many sy dir=`dirname $0` . ${dir}/../misc.sh -echo "1..6" +if supported lchmod; then + echo "1..8" +else + echo "1..6" +fi n0=`namegen` n1=`namegen` @@ -15,5 +19,9 @@ expect 0 symlink ${n0} ${n1} expect 0 symlink ${n1} ${n0} expect ELOOP chmod ${n0}/test 0644 expect ELOOP chmod ${n1}/test 0644 +if supported lchmod; then + expect ELOOP lchmod ${n0}/test 0644 + expect ELOOP lchmod ${n1}/test 0644 +fi expect 0 unlink ${n0} expect 0 unlink ${n1} Modified: head/tools/regression/fstest/tests/chmod/07.t ============================================================================== --- head/tools/regression/fstest/tests/chmod/07.t Sun Aug 15 14:38:01 2010 (r211335) +++ head/tools/regression/fstest/tests/chmod/07.t Sun Aug 15 14:44:48 2010 (r211336) @@ -6,17 +6,23 @@ desc="chmod returns EPERM if the operati dir=`dirname $0` . ${dir}/../misc.sh -echo "1..14" +if supported lchmod; then + echo "1..34" +else + echo "1..25" +fi n0=`namegen` n1=`namegen` n2=`namegen` +n3=`namegen` expect 0 mkdir ${n0} 0755 cdir=`pwd` cd ${n0} expect 0 mkdir ${n1} 0755 expect 0 chown ${n1} 65534 65534 + expect 0 -u 65534 -g 65534 create ${n1}/${n2} 0644 expect 0 -u 65534 -g 65534 chmod ${n1}/${n2} 0642 expect 0642 stat ${n1}/${n2} mode @@ -26,6 +32,31 @@ expect 0 chown ${n1}/${n2} 0 0 expect EPERM -u 65534 -g 65534 chmod ${n1}/${n2} 0641 expect 0642 stat ${n1}/${n2} mode expect 0 unlink ${n1}/${n2} + +expect 0 -u 65534 -g 65534 create ${n1}/${n2} 0644 +expect 0 -u 65534 -g 65534 symlink ${n2} ${n1}/${n3} +expect 0 -u 65534 -g 65534 chmod ${n1}/${n3} 0642 +expect 0642,65534,65534 stat ${n1}/${n2} mode,uid,gid +expect EPERM -u 65533 -g 65533 chmod ${n1}/${n3} 0641 +expect 0642,65534,65534 stat ${n1}/${n2} mode,uid,gid +expect 0 chown ${n1}/${n3} 0 0 +expect EPERM -u 65534 -g 65534 chmod ${n1}/${n3} 0641 +expect 0642,0,0 stat ${n1}/${n2} mode,uid,gid +expect 0 unlink ${n1}/${n2} +expect 0 unlink ${n1}/${n3} + +if supported lchmod; then + expect 0 -u 65534 -g 65534 create ${n1}/${n2} 0644 + expect 0 -u 65534 -g 65534 lchmod ${n1}/${n2} 0642 + expect 0642 stat ${n1}/${n2} mode + expect EPERM -u 65533 -g 65533 lchmod ${n1}/${n2} 0641 + expect 0642 stat ${n1}/${n2} mode + expect 0 chown ${n1}/${n2} 0 0 + expect EPERM -u 65534 -g 65534 lchmod ${n1}/${n2} 0641 + expect 0642 stat ${n1}/${n2} mode + expect 0 unlink ${n1}/${n2} +fi + expect 0 rmdir ${n1} cd ${cdir} expect 0 rmdir ${n0} Modified: head/tools/regression/fstest/tests/chmod/08.t ============================================================================== --- head/tools/regression/fstest/tests/chmod/08.t Sun Aug 15 14:38:01 2010 (r211335) +++ head/tools/regression/fstest/tests/chmod/08.t Sun Aug 15 14:44:48 2010 (r211336) @@ -10,10 +10,10 @@ require chflags case "${os}:${fs}" in FreeBSD:ZFS) - echo "1..22" + echo "1..29" ;; FreeBSD:UFS) - echo "1..44" + echo "1..54" ;; *) quick_exit @@ -24,16 +24,21 @@ n0=`namegen` expect 0 create ${n0} 0644 expect 0 chflags ${n0} SF_IMMUTABLE expect EPERM chmod ${n0} 0600 +supported lchmod && expect EPERM lchmod ${n0} 0600 expect 0644 stat ${n0} mode expect 0 chflags ${n0} none expect 0 chmod ${n0} 0600 expect 0600 stat ${n0} mode +supported lchmod && expect 0 lchmod ${n0} 0400 +supported lchmod && expect 0400 stat ${n0} mode expect 0 unlink ${n0} expect 0 create ${n0} 0644 expect 0 chflags ${n0} SF_NOUNLINK expect 0 chmod ${n0} 0600 expect 0600 stat ${n0} mode +supported lchmod && expect 0 lchmod ${n0} 0400 +supported lchmod && expect 0400 stat ${n0} mode expect 0 chflags ${n0} none expect 0 unlink ${n0} @@ -43,15 +48,18 @@ FreeBSD:ZFS) expect 0 chflags ${n0} SF_APPEND expect 0 chmod ${n0} 0600 expect 0600 stat ${n0} mode + supported lchmod && expect 0 lchmod ${n0} 0500 + supported lchmod && expect 0500 stat ${n0} mode expect 0 chflags ${n0} none - expect 0 chmod ${n0} 0600 - expect 0600 stat ${n0} mode + expect 0 chmod ${n0} 0400 + expect 0400 stat ${n0} mode expect 0 unlink ${n0} ;; FreeBSD:UFS) expect 0 create ${n0} 0644 expect 0 chflags ${n0} SF_APPEND expect EPERM chmod ${n0} 0600 + supported lchmod && expect EPERM lchmod ${n0} 0600 expect 0644 stat ${n0} mode expect 0 chflags ${n0} none expect 0 chmod ${n0} 0600 @@ -61,6 +69,7 @@ FreeBSD:UFS) expect 0 create ${n0} 0644 expect 0 chflags ${n0} UF_IMMUTABLE expect EPERM chmod ${n0} 0600 + supported lchmod && expect EPERM lchmod ${n0} 0600 expect 0644 stat ${n0} mode expect 0 chflags ${n0} none expect 0 chmod ${n0} 0600 @@ -71,12 +80,15 @@ FreeBSD:UFS) expect 0 chflags ${n0} UF_NOUNLINK expect 0 chmod ${n0} 0600 expect 0600 stat ${n0} mode + supported lchmod && expect 0 lchmod ${n0} 0400 + supported lchmod && expect 0400 stat ${n0} mode expect 0 chflags ${n0} none expect 0 unlink ${n0} expect 0 create ${n0} 0644 expect 0 chflags ${n0} UF_APPEND expect EPERM chmod ${n0} 0600 + supported lchmod && expect EPERM lchmod ${n0} 0600 expect 0644 stat ${n0} mode expect 0 chflags ${n0} none expect 0 chmod ${n0} 0600 Modified: head/tools/regression/fstest/tests/chmod/09.t ============================================================================== --- head/tools/regression/fstest/tests/chmod/09.t Sun Aug 15 14:38:01 2010 (r211335) +++ head/tools/regression/fstest/tests/chmod/09.t Sun Aug 15 14:44:48 2010 (r211336) @@ -8,7 +8,7 @@ dir=`dirname $0` [ "${os}:${fs}" = "FreeBSD:UFS" ] || quick_exit -echo "1..10" +echo "1..15" n0=`namegen` n1=`namegen` @@ -20,12 +20,17 @@ mount /dev/md${n} ${n0} expect 0 create ${n0}/${n1} 0644 expect 0 chmod ${n0}/${n1} 0640 expect 0640 stat ${n0}/${n1} mode +expect 0 lchmod ${n0}/${n1} 0530 +expect 0530 stat ${n0}/${n1} mode mount -ur /dev/md${n} expect EROFS chmod ${n0}/${n1} 0600 -expect 0640 stat ${n0}/${n1} mode +expect EROFS lchmod ${n0}/${n1} 0600 +expect 0530 stat ${n0}/${n1} mode mount -uw /dev/md${n} expect 0 chmod ${n0}/${n1} 0600 expect 0600 stat ${n0}/${n1} mode +expect 0 lchmod ${n0}/${n1} 0640 +expect 0640 stat ${n0}/${n1} mode expect 0 unlink ${n0}/${n1} umount /dev/md${n} mdconfig -d -u ${n} Modified: head/tools/regression/fstest/tests/chmod/10.t ============================================================================== --- head/tools/regression/fstest/tests/chmod/10.t Sun Aug 15 14:38:01 2010 (r211335) +++ head/tools/regression/fstest/tests/chmod/10.t Sun Aug 15 14:44:48 2010 (r211336) @@ -6,7 +6,15 @@ desc="chmod returns EFAULT if the path a dir=`dirname $0` . ${dir}/../misc.sh -echo "1..2" +if supported lchmod; then + echo "1..4" +else + echo "1..2" +fi expect EFAULT chmod NULL 0644 expect EFAULT chmod DEADCODE 0644 +if supported lchmod; then + expect EFAULT lchmod NULL 0644 + expect EFAULT lchmod DEADCODE 0644 +fi Modified: head/tools/regression/fstest/tests/chmod/11.t ============================================================================== --- head/tools/regression/fstest/tests/chmod/11.t Sun Aug 15 14:38:01 2010 (r211335) +++ head/tools/regression/fstest/tests/chmod/11.t Sun Aug 15 14:44:48 2010 (r211336) @@ -6,48 +6,113 @@ desc="chmod returns EFTYPE if the effect dir=`dirname $0` . ${dir}/../misc.sh -echo "1..20" +if supported lchmod; then + echo "1..173" +else + echo "1..109" +fi n0=`namegen` n1=`namegen` +n2=`namegen` expect 0 mkdir ${n0} 0755 cdir=`pwd` cd ${n0} -expect 0 mkdir ${n1} 0755 -expect 0 chmod ${n1} 01755 -expect 01755 stat ${n1} mode -expect 0 rmdir ${n1} - -expect 0 create ${n1} 0644 -expect 0 chmod ${n1} 01644 -expect 01644 stat ${n1} mode -expect 0 unlink ${n1} +for type in regular dir fifo block char socket symlink; do + if [ "${type}" != "symlink" ]; then + create_file ${type} ${n1} + expect 0 chmod ${n1} 01621 + expect 01621 stat ${n1} mode + expect 0 symlink ${n1} ${n2} + expect 0 chmod ${n2} 01700 + expect 01700 stat ${n1} mode + expect 0 unlink ${n2} + if [ "${type}" = "dir" ]; then + expect 0 rmdir ${n1} + else + expect 0 unlink ${n1} + fi + fi + + if supported lchmod; then + create_file ${type} ${n1} + expect 0 lchmod ${n1} 01621 + expect 01621 lstat ${n1} mode + if [ "${type}" = "dir" ]; then + expect 0 rmdir ${n1} + else + expect 0 unlink ${n1} + fi + fi +done expect 0 mkdir ${n1} 0755 expect 0 chown ${n1} 65534 65534 expect 0 -u 65534 -g 65534 chmod ${n1} 01755 expect 01755 stat ${n1} mode +expect 0 symlink ${n1} ${n2} +expect 0 chmod ${n2} 01700 +expect 01700 stat ${n1} mode +expect 0 unlink ${n2} expect 0 rmdir ${n1} -expect 0 create ${n1} 0644 -expect 0 chown ${n1} 65534 65534 -case "${os}" in -FreeBSD) - expect EFTYPE -u 65534 -g 65534 chmod ${n1} 01644 - expect 0644 stat ${n1} mode - ;; -SunOS) - expect 0 -u 65534 -g 65534 chmod ${n1} 01644 - expect 0644 stat ${n1} mode - ;; -Linux) - expect 0 -u 65534 -g 65534 chmod ${n1} 01644 - expect 01644 stat ${n1} mode - ;; -esac -expect 0 unlink ${n1} +for type in regular fifo block char socket symlink; do + if [ "${type}" != "symlink" ]; then + create_file ${type} ${n1} 0640 65534 65534 + expect 0 symlink ${n1} ${n2} + case "${os}" in + FreeBSD) + expect EFTYPE -u 65534 -g 65534 chmod ${n1} 01644 + expect 0640 stat ${n1} mode + expect EFTYPE -u 65534 -g 65534 chmod ${n2} 01644 + expect 0640 stat ${n1} mode + ;; + SunOS) + expect 0 -u 65534 -g 65534 chmod ${n1} 01644 + expect 0644 stat ${n1} mode + expect 0 -u 65534 -g 65534 chmod ${n2} 01640 + expect 0640 stat ${n1} mode + ;; + Linux) + expect 0 -u 65534 -g 65534 chmod ${n1} 01644 + expect 01644 stat ${n1} mode + expect 0 -u 65534 -g 65534 chmod ${n2} 01640 + expect 01640 stat ${n1} mode + ;; + esac + expect 0 unlink ${n2} + if [ "${type}" = "dir" ]; then + expect 0 rmdir ${n1} + else + expect 0 unlink ${n1} + fi + fi + + if supported lchmod; then + create_file ${type} ${n1} 0640 65534 65534 + case "${os}" in + FreeBSD) + expect EFTYPE -u 65534 -g 65534 lchmod ${n1} 01644 + expect 0640 lstat ${n1} mode + ;; + SunOS) + expect 0 -u 65534 -g 65534 lchmod ${n1} 01644 + expect 0644 lstat ${n1} mode + ;; + Linux) + expect 0 -u 65534 -g 65534 lchmod ${n1} 01644 + expect 01644 lstat ${n1} mode + ;; + esac + if [ "${type}" = "dir" ]; then + expect 0 rmdir ${n1} + else + expect 0 unlink ${n1} + fi + fi +done cd ${cdir} expect 0 rmdir ${n0} From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 14:45:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0280C10656F7; Sun, 15 Aug 2010 14:45:02 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id ACE078FC1B; Sun, 15 Aug 2010 14:45:02 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id EF9901FFC34; Sun, 15 Aug 2010 14:45:01 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 7A2548454E; Sun, 15 Aug 2010 16:45:01 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: mdf@FreeBSD.org References: <201008141434.o7EEYaSA030301@svn.freebsd.org> Date: Sun, 15 Aug 2010 16:45:01 +0200 In-Reply-To: (mdf@freebsd.org's message of "Sat, 14 Aug 2010 14:45:29 +0000") Message-ID: <86k4nsc4uq.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211304 - 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: Sun, 15 Aug 2010 14:45:03 -0000 mdf@FreeBSD.org writes: > I think it's possible for the number to overflow but also not shrink. > e.g. 0x12345678T. Ah, you're right, I didn't think of that. Thanks. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 14:50:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7ACEA1065697; Sun, 15 Aug 2010 14:50:03 +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 6A61D8FC19; Sun, 15 Aug 2010 14:50:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FEo3vw063367; Sun, 15 Aug 2010 14:50:03 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FEo3cZ063365; Sun, 15 Aug 2010 14:50:03 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201008151450.o7FEo3cZ063365@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sun, 15 Aug 2010 14:50: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: r211337 - 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: Sun, 15 Aug 2010 14:50:03 -0000 Author: des Date: Sun Aug 15 14:50:03 2010 New Revision: 211337 URL: http://svn.freebsd.org/changeset/base/211337 Log: Fix the overflow test. It is possible for the result of an overflowing shift to be larger than the original value, e.g. (uint64_t)1 << 53 = 0x20000000000000 ((uint64_t)1 << 53) << 10 = 0x8000000000000000 Modified: head/lib/libutil/expand_number.c Modified: head/lib/libutil/expand_number.c ============================================================================== --- head/lib/libutil/expand_number.c Sun Aug 15 14:44:48 2010 (r211336) +++ head/lib/libutil/expand_number.c Sun Aug 15 14:50:03 2010 (r211337) @@ -67,7 +67,7 @@ expand_number(const char *buf, uint64_t } #define SHIFT(n, b) \ - do { if ((n << b) < n) goto overflow; n <<= b; } while (0) + do { if (((n << b) >> b) != n) goto overflow; n <<= b; } while (0) switch (tolower((unsigned char)*endptr)) { case 'e': From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 14:55:33 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0845B106564A; Sun, 15 Aug 2010 14:55:33 +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 EBE148FC12; Sun, 15 Aug 2010 14:55:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FEtWL5063517; Sun, 15 Aug 2010 14:55:32 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FEtW75063515; Sun, 15 Aug 2010 14:55:32 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201008151455.o7FEtW75063515@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sun, 15 Aug 2010 14:55:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211338 - 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: Sun, 15 Aug 2010 14:55:33 -0000 Author: des Date: Sun Aug 15 14:55:32 2010 New Revision: 211338 URL: http://svn.freebsd.org/changeset/base/211338 Log: no-op commit to note that the example given in the previous commit is a very bad one, since the shift does not actually overflow. This is a better example (assuming uint64_t = unsigned long long): ~0LLU >> 9 = 0x7fffffffffffffLLU ~0LLU >> 9 << 10 = 0xfffffffffffffc00LLU ~0LLU >> 9 << 10 >> 10 = 0x3fffffffffffffLLU Modified: head/lib/libutil/expand_number.c Modified: head/lib/libutil/expand_number.c ============================================================================== --- head/lib/libutil/expand_number.c Sun Aug 15 14:50:03 2010 (r211337) +++ head/lib/libutil/expand_number.c Sun Aug 15 14:55:32 2010 (r211338) @@ -66,7 +66,7 @@ expand_number(const char *buf, uint64_t return (0); } -#define SHIFT(n, b) \ +#define SHIFT(n, b) \ do { if (((n << b) >> b) != n) goto overflow; n <<= b; } while (0) switch (tolower((unsigned char)*endptr)) { From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 15:33:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EB431065694; Sun, 15 Aug 2010 15:33:04 +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 3E09B8FC17; Sun, 15 Aug 2010 15:33:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FFX4ng064344; Sun, 15 Aug 2010 15:33:04 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FFX4EK064342; Sun, 15 Aug 2010 15:33:04 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201008151533.o7FFX4EK064342@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 15 Aug 2010 15:33: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: r211339 - head/sys/modules/sem X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2010 15:33:04 -0000 Author: kib Date: Sun Aug 15 15:33:01 2010 New Revision: 211339 URL: http://svn.freebsd.org/changeset/base/211339 Log: Add missed dependency. Submitted by: gcooper MFC after: 1 week Modified: head/sys/modules/sem/Makefile Modified: head/sys/modules/sem/Makefile ============================================================================== --- head/sys/modules/sem/Makefile Sun Aug 15 14:55:32 2010 (r211338) +++ head/sys/modules/sem/Makefile Sun Aug 15 15:33:01 2010 (r211339) @@ -3,6 +3,6 @@ .PATH: ${.CURDIR}/../../kern KMOD= sem -SRCS= uipc_sem.c opt_posix.h vnode_if.h +SRCS= uipc_sem.c opt_compat.h opt_posix.h vnode_if.h .include From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 16:02:27 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8507C1065670; Sun, 15 Aug 2010 16:02:27 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1EAA28FC15; Sun, 15 Aug 2010 16:02:26 +0000 (UTC) Received: from c122-106-147-41.carlnfd1.nsw.optusnet.com.au (c122-106-147-41.carlnfd1.nsw.optusnet.com.au [122.106.147.41]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id o7FG2N2w013608 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 16 Aug 2010 02:02:24 +1000 Date: Mon, 16 Aug 2010 02:02:23 +1000 (EST) From: Bruce Evans X-X-Sender: bde@delplex.bde.org To: Dag-Erling Smorgrav In-Reply-To: <201008151455.o7FEtW75063515@svn.freebsd.org> Message-ID: <20100816010236.U14975@delplex.bde.org> References: <201008151455.o7FEtW75063515@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: r211338 - 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: Sun, 15 Aug 2010 16:02:27 -0000 On Sun, 15 Aug 2010, Dag-Erling Smorgrav wrote: > Log: > no-op commit to note that the example given in the previous commit is > a very bad one, since the shift does not actually overflow. Indeed. You barely escaped more mail about it :-). > This is > a better example (assuming uint64_t = unsigned long long): > > ~0LLU >> 9 = 0x7fffffffffffffLLU > ~0LLU >> 9 << 10 = 0xfffffffffffffc00LLU > ~0LLU >> 9 << 10 >> 10 = 0x3fffffffffffffLLU > > Modified: > head/lib/libutil/expand_number.c > > Modified: head/lib/libutil/expand_number.c > ============================================================================== > --- head/lib/libutil/expand_number.c Sun Aug 15 14:50:03 2010 (r211337) > +++ head/lib/libutil/expand_number.c Sun Aug 15 14:55:32 2010 (r211338) > @@ -66,7 +66,7 @@ expand_number(const char *buf, uint64_t > return (0); > } > > -#define SHIFT(n, b) \ > +#define SHIFT(n, b) \ > do { if (((n << b) >> b) != n) goto overflow; n <<= b; } while (0) > > switch (tolower((unsigned char)*endptr)) { > Strangely enough, this is now equivalent to the range check in dd (expand_number() copied many small bugs from dd/args.c and added many large ones including breaking both range checks). dd supports a more general multiplier and uses multiply/divide instead of left-shift/right-shift in the check. For the more general multiplier, it is more clear that the simple check which was used, i.e., ((number << 10) < number), doesn't work. I wrote or fixed the overflow checks in dd (except for the one that allows undefined behaviour), but for the multiplier one I now prefer direct range checking instead of possibly letting overflow occur and then checking that it didn't occur. Overflow gives undefined behaviour for negative numbers, so there is no alternative for them. This turns out to be simplest anyway. Overflow will occur iff n exceeds some threshold, and it is easy to calculate the threshold. In the above, the threshold is something like (UINTMAX_MAX >> 10), and in dd it is something like (UINTMAX_MAX / mult) for the unsigned case, or 2 thresholds (INTMAX_MIN / mult) and (INTMAX_MAX / mult) for the signed case. This method is already used in FreeBSD's implementation of the strtol() family. Bruce From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 16:28:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 598E71065673; Sun, 15 Aug 2010 16:28:09 +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 48EFD8FC15; Sun, 15 Aug 2010 16:28:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FGS9UB065436; Sun, 15 Aug 2010 16:28:09 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FGS9hX065434; Sun, 15 Aug 2010 16:28:09 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201008151628.o7FGS9hX065434@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sun, 15 Aug 2010 16:28: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: r211340 - head/lib/libc/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, 15 Aug 2010 16:28:09 -0000 Author: ume Date: Sun Aug 15 16:28:08 2010 New Revision: 211340 URL: http://svn.freebsd.org/changeset/base/211340 Log: Correct the return code from _dns_gethostby*() to correspond with h_errno. Obtained from: NetBSD MFC after: 2 weeks Modified: head/lib/libc/net/gethostbydns.c Modified: head/lib/libc/net/gethostbydns.c ============================================================================== --- head/lib/libc/net/gethostbydns.c Sun Aug 15 15:33:01 2010 (r211339) +++ head/lib/libc/net/gethostbydns.c Sun Aug 15 16:28:08 2010 (r211340) @@ -522,18 +522,26 @@ _dns_gethostbyname(void *rval, void *cb_ free(buf); dprintf("res_nsearch failed (%d)\n", n, statp); *h_errnop = statp->res_h_errno; - return (0); + return (NS_NOTFOUND); } else if (n > sizeof(buf->buf)) { free(buf); dprintf("static buffer is too small (%d)\n", n, statp); *h_errnop = statp->res_h_errno; - return (0); + return (NS_UNAVAIL); } error = gethostanswer(buf, n, name, type, &he, hed, statp); free(buf); if (error != 0) { *h_errnop = statp->res_h_errno; - return (NS_NOTFOUND); + switch (statp->res_h_errno) { + case HOST_NOT_FOUND: + return (NS_NOTFOUND); + case TRY_AGAIN: + return (NS_TRYAGAIN); + default: + return (NS_UNAVAIL); + } + /*NOTREACHED*/ } if (__copy_hostent(&he, hptr, buffer, buflen) != 0) { *errnop = errno; @@ -632,7 +640,15 @@ _dns_gethostbyaddr(void *rval, void *cb_ if (gethostanswer(buf, n, qbuf, T_PTR, &he, hed, statp) != 0) { free(buf); *h_errnop = statp->res_h_errno; - return (NS_NOTFOUND); /* h_errno was set by gethostanswer() */ + switch (statp->res_h_errno) { + case HOST_NOT_FOUND: + return (NS_NOTFOUND); + case TRY_AGAIN: + return (NS_TRYAGAIN); + default: + return (NS_UNAVAIL); + } + /*NOTREACHED*/ } free(buf); #ifdef SUNSECURITY From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 17:14:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3989C106566B; Sun, 15 Aug 2010 17:14:06 +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 288538FC0A; Sun, 15 Aug 2010 17:14:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FHE6Ft066369; Sun, 15 Aug 2010 17:14:06 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FHE6bI066367; Sun, 15 Aug 2010 17:14:06 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201008151714.o7FHE6bI066367@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 15 Aug 2010 17:14: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: r211341 - 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: Sun, 15 Aug 2010 17:14:06 -0000 Author: jilles Date: Sun Aug 15 17:14:05 2010 New Revision: 211341 URL: http://svn.freebsd.org/changeset/base/211341 Log: sh: Test that all bytes from 1 to 127 can be used in IFS. This also passes on stable/8. Added: head/tools/regression/bin/sh/expansion/ifs2.0 (contents, props changed) Added: head/tools/regression/bin/sh/expansion/ifs2.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/expansion/ifs2.0 Sun Aug 15 17:14:05 2010 (r211341) @@ -0,0 +1,24 @@ +# $FreeBSD$ + +failures=0 +i=1 +set -f +while [ "$i" -le 127 ]; do + # A different byte still in the range 1..127. + i2=$((i^2+(i==2))) + # Add a character to work around command substitution's removal of + # final newlines, then remove it again. + c=$(printf \\"$(printf %o@ "$i")") + c=${c%@} + c2=$(printf \\"$(printf %o@ "$i2")") + c2=${c2%@} + IFS=$c + set -- $c2$c$c2$c$c2 + if [ "$#" -ne 3 ] || [ "$1" != "$c2" ] || [ "$2" != "$c2" ] || + [ "$3" != "$c2" ]; then + echo "Bad results for separator $i (word $i2)" >&2 + : $((failures += 1)) + fi + i=$((i+1)) +done +exit $((failures > 0)) From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 17:49:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0FB41065675; Sun, 15 Aug 2010 17:49:41 +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 E051D8FC19; Sun, 15 Aug 2010 17:49:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FHnfJC067077; Sun, 15 Aug 2010 17:49:41 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FHnftT067075; Sun, 15 Aug 2010 17:49:41 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201008151749.o7FHnftT067075@svn.freebsd.org> From: Jaakko Heinonen Date: Sun, 15 Aug 2010 17:49: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: r211342 - head/sbin/bsdlabel X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2010 17:49:42 -0000 Author: jh Date: Sun Aug 15 17:49:41 2010 New Revision: 211342 URL: http://svn.freebsd.org/changeset/base/211342 Log: - Check that strtoul(3) succeeds to convert the entire string in a few places. - In getasciilabel(), set the disk type only when a valid type is given. PR: bin/86765 MFC after: 2 weeks Modified: head/sbin/bsdlabel/bsdlabel.c Modified: head/sbin/bsdlabel/bsdlabel.c ============================================================================== --- head/sbin/bsdlabel/bsdlabel.c Sun Aug 15 17:14:05 2010 (r211341) +++ head/sbin/bsdlabel/bsdlabel.c Sun Aug 15 17:49:41 2010 (r211342) @@ -755,7 +755,7 @@ word(char *cp) static int getasciilabel(FILE *f, struct disklabel *lp) { - char *cp; + char *cp, *endp; const char **cpp; u_int part; char *tp, line[BUFSIZ]; @@ -794,11 +794,15 @@ getasciilabel(FILE *f, struct disklabel } if (cpp < &dktypenames[DKMAXTYPES]) continue; - v = strtoul(tp, NULL, 10); + errno = 0; + v = strtoul(tp, &endp, 10); + if (errno != 0 || *endp != '\0') + v = DKMAXTYPES; if (v >= DKMAXTYPES) fprintf(stderr, "line %d:%s %lu\n", lineno, "Warning, unknown disk type", v); - lp->d_type = v; + else + lp->d_type = v; continue; } if (!strcmp(cp, "flags")) { @@ -1023,7 +1027,7 @@ static int getasciipartspec(char *tp, struct disklabel *lp, int part, int lineno) { struct partition *pp; - char *cp; + char *cp, *endp; const char **cpp; u_long v; @@ -1059,9 +1063,12 @@ getasciipartspec(char *tp, struct diskla if (*cpp != NULL) { pp->p_fstype = cpp - fstypenames; } else { - if (isdigit(*cp)) - v = strtoul(cp, NULL, 10); - else + if (isdigit(*cp)) { + errno = 0; + v = strtoul(cp, &endp, 10); + if (errno != 0 || *endp != '\0') + v = FSMAXTYPES; + } else v = FSMAXTYPES; if (v >= FSMAXTYPES) { fprintf(stderr, From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 18:32:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22B2B106564A; Sun, 15 Aug 2010 18:32:07 +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 EBCC48FC17; Sun, 15 Aug 2010 18:32:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FIW6UL068106; Sun, 15 Aug 2010 18:32:06 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FIW6nA068103; Sun, 15 Aug 2010 18:32:06 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201008151832.o7FIW6nA068103@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Sun, 15 Aug 2010 18:32: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: r211343 - 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: Sun, 15 Aug 2010 18:32:07 -0000 Author: des Date: Sun Aug 15 18:32:06 2010 New Revision: 211343 URL: http://svn.freebsd.org/changeset/base/211343 Log: Further simplify the code, and update the manpage. Submitted by: Christoph Mallon Modified: head/lib/libutil/expand_number.3 head/lib/libutil/expand_number.c Modified: head/lib/libutil/expand_number.3 ============================================================================== --- head/lib/libutil/expand_number.3 Sun Aug 15 17:49:41 2010 (r211342) +++ head/lib/libutil/expand_number.3 Sun Aug 15 18:32:06 2010 (r211343) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 16, 2007 +.Dd August 15, 2010 .Dt EXPAND_NUMBER 3 .Os .Sh NAME @@ -37,14 +37,14 @@ .In libutil.h .Ft int .Fo expand_number -.Fa "const char *buf" "int64_t *num" +.Fa "const char *buf" "uint64_t *num" .Fc .Sh DESCRIPTION The .Fn expand_number function unformats the .Fa buf -string and stores a signed 64-bit quantity at address pointed out by the +string and stores a unsigned 64-bit quantity at address pointed out by the .Fa num argument. .Pp Modified: head/lib/libutil/expand_number.c ============================================================================== --- head/lib/libutil/expand_number.c Sun Aug 15 17:49:41 2010 (r211342) +++ head/lib/libutil/expand_number.c Sun Aug 15 18:32:06 2010 (r211343) @@ -36,7 +36,7 @@ __FBSDID("$FreeBSD$"); #include /* - * Convert an expression of the following forms to a int64_t. + * Convert an expression of the following forms to a uint64_t. * 1) A positive decimal number. * 2) A positive decimal number followed by a 'b' or 'B' (mult by 1). * 3) A positive decimal number followed by a 'k' or 'K' (mult by 1 << 10). @@ -50,6 +50,7 @@ int expand_number(const char *buf, uint64_t *num) { uint64_t number; + unsigned shift; char *endptr; number = strtoumax(buf, &endptr, 0); @@ -60,41 +61,41 @@ expand_number(const char *buf, uint64_t return (-1); } - if (*endptr == '\0') { - /* No unit. */ - *num = number; - return (0); - } - -#define SHIFT(n, b) \ - do { if (((n << b) >> b) != n) goto overflow; n <<= b; } while (0) - switch (tolower((unsigned char)*endptr)) { case 'e': - SHIFT(number, 10); + shift = 60; + break; case 'p': - SHIFT(number, 10); + shift = 50; + break; case 't': - SHIFT(number, 10); + shift = 40; + break; case 'g': - SHIFT(number, 10); + shift = 30; + break; case 'm': - SHIFT(number, 10); + shift = 20; + break; case 'k': - SHIFT(number, 10); - case 'b': + shift = 10; break; + case 'b': + case '\0': /* No unit. */ + *num = number; + return (0); default: /* Unrecognized unit. */ errno = EINVAL; return (-1); } - *num = number; - return (0); + if ((number << shift) >> shift != number) { + /* Overflow */ + errno = ERANGE; + return (-1); + } -overflow: - /* Overflow */ - errno = ERANGE; - return (-1); + *num = number << shift; + return (0); } From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 19:07:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A929910656A3; Sun, 15 Aug 2010 19:07:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E71E8FC12; Sun, 15 Aug 2010 19:07:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FJ7iZ6068926; Sun, 15 Aug 2010 19:07:44 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FJ7i5X068924; Sun, 15 Aug 2010 19:07:44 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201008151907.o7FJ7i5X068924@svn.freebsd.org> From: Warner Losh Date: Sun, 15 Aug 2010 19:07: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: r211344 - 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, 15 Aug 2010 19:07:44 -0000 Author: imp Date: Sun Aug 15 19:07:44 2010 New Revision: 211344 URL: http://svn.freebsd.org/changeset/base/211344 Log: Nothing uses TARGET_EMULATOR, so gc it. Modified: head/sys/conf/options.mips Modified: head/sys/conf/options.mips ============================================================================== --- head/sys/conf/options.mips Sun Aug 15 18:32:06 2010 (r211343) +++ head/sys/conf/options.mips Sun Aug 15 19:07:44 2010 (r211344) @@ -51,7 +51,6 @@ CFE_ENV opt_global.h CFE_ENV_SIZE opt_global.h NOFPU opt_global.h -TARGET_EMULATOR opt_ddb.h TICK_USE_YAMON_FREQ opt_global.h TICK_USE_MALTA_RTC opt_global.h From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 20:16:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49E34106566B; Sun, 15 Aug 2010 20:16:59 +0000 (UTC) (envelope-from bruce@cran.org.uk) Received: from muon.cran.org.uk (muon.cran.org.uk [204.109.60.94]) by mx1.freebsd.org (Postfix) with ESMTP id 24F648FC1A; Sun, 15 Aug 2010 20:16:58 +0000 (UTC) Received: from unknown (client-86-31-88-103.midd.adsl.virginmedia.com [86.31.88.103]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by muon.cran.org.uk (Postfix) with ESMTPSA id E01E35C25; Sun, 15 Aug 2010 19:57:22 +0000 (UTC) Date: Sun, 15 Aug 2010 20:57:24 +0100 From: Bruce Cran To: Dag-Erling Smorgrav Message-ID: <20100815205724.00007e0f@unknown> In-Reply-To: <201008141434.o7EEYaSA030301@svn.freebsd.org> References: <201008141434.o7EEYaSA030301@svn.freebsd.org> X-Mailer: Claws Mail 3.7.4cvs1 (GTK+ 2.16.0; i586-pc-mingw32msvc) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211304 - 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: Sun, 15 Aug 2010 20:16:59 -0000 On Sat, 14 Aug 2010 14:34:36 +0000 (UTC) Dag-Erling Smorgrav wrote: > Author: des > Date: Sat Aug 14 14:34:36 2010 > New Revision: 211304 > URL: http://svn.freebsd.org/changeset/base/211304 > > Log: > Simplify expand_number() by combining the (unrolled) loop with the > switch. Since expand_number() does not accept negative numbers, > switch from int64_t to uint64_t; this makes it easier to check for > overflow. > MFC after: 3 weeks Somewhat related, there are overflow bugs in humanize_number - for example df(1) fails to display space from a 100PB filesystem correctly. -- Bruce Cran From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 20:34:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6A9C106566B; Sun, 15 Aug 2010 20:34:51 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D63988FC13; Sun, 15 Aug 2010 20:34:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FKYpRY070849; Sun, 15 Aug 2010 20:34:51 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FKYpmG070847; Sun, 15 Aug 2010 20:34:51 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201008152034.o7FKYpmG070847@svn.freebsd.org> From: Navdeep Parhar Date: Sun, 15 Aug 2010 20:34: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: r211345 - head/sys/dev/cxgb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2010 20:34:52 -0000 Author: np Date: Sun Aug 15 20:34:51 2010 New Revision: 211345 URL: http://svn.freebsd.org/changeset/base/211345 Log: wakeup is required if the adapter lock is released anywhere during init and not just for the may_sleep case. Pointed out by: Isilon MFC after: 3 days Modified: head/sys/dev/cxgb/cxgb_main.c Modified: head/sys/dev/cxgb/cxgb_main.c ============================================================================== --- head/sys/dev/cxgb/cxgb_main.c Sun Aug 15 19:07:44 2010 (r211344) +++ head/sys/dev/cxgb/cxgb_main.c Sun Aug 15 20:34:51 2010 (r211345) @@ -1778,11 +1778,12 @@ cxgb_init_locked(struct port_info *p) struct adapter *sc = p->adapter; struct ifnet *ifp = p->ifp; struct cmac *mac = &p->mac; - int i, rc = 0, may_sleep = 0; + int i, rc = 0, may_sleep = 0, gave_up_lock = 0; ADAPTER_LOCK_ASSERT_OWNED(sc); while (!IS_DOOMED(p) && IS_BUSY(sc)) { + gave_up_lock = 1; if (mtx_sleep(&sc->flags, &sc->lock, PCATCH, "cxgbinit", 0)) { rc = EINTR; goto done; @@ -1802,6 +1803,7 @@ cxgb_init_locked(struct port_info *p) if (may_sleep) { SET_BUSY(sc); + gave_up_lock = 1; ADAPTER_UNLOCK(sc); } @@ -1849,8 +1851,9 @@ done: ADAPTER_LOCK(sc); KASSERT(IS_BUSY(sc), ("%s: controller not busy.", __func__)); CLR_BUSY(sc); - wakeup_one(&sc->flags); } + if (gave_up_lock) + wakeup_one(&sc->flags); ADAPTER_UNLOCK(sc); return (rc); } From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 20:45:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0F051065670; Sun, 15 Aug 2010 20:45:16 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8FA1A8FC12; Sun, 15 Aug 2010 20:45:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FKjGs9071149; Sun, 15 Aug 2010 20:45:16 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FKjG1H071145; Sun, 15 Aug 2010 20:45:16 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201008152045.o7FKjG1H071145@svn.freebsd.org> From: Navdeep Parhar Date: Sun, 15 Aug 2010 20:45: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: r211346 - head/sys/dev/cxgb/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2010 20:45:16 -0000 Author: np Date: Sun Aug 15 20:45:16 2010 New Revision: 211346 URL: http://svn.freebsd.org/changeset/base/211346 Log: Always reset the XGMAC's XAUI PCS on a link up. MFC after: 3 days Modified: head/sys/dev/cxgb/common/cxgb_common.h head/sys/dev/cxgb/common/cxgb_t3_hw.c head/sys/dev/cxgb/common/cxgb_xgmac.c Modified: head/sys/dev/cxgb/common/cxgb_common.h ============================================================================== --- head/sys/dev/cxgb/common/cxgb_common.h Sun Aug 15 20:34:51 2010 (r211345) +++ head/sys/dev/cxgb/common/cxgb_common.h Sun Aug 15 20:45:16 2010 (r211346) @@ -745,6 +745,7 @@ int t3_mc7_bd_read(struct mc7 *mc7, unsi int t3_mac_init(struct cmac *mac); void t3b_pcs_reset(struct cmac *mac); +void t3c_pcs_force_los(struct cmac *mac); void t3_mac_disable_exact_filters(struct cmac *mac); void t3_mac_enable_exact_filters(struct cmac *mac); int t3_mac_enable(struct cmac *mac, int which); Modified: head/sys/dev/cxgb/common/cxgb_t3_hw.c ============================================================================== --- head/sys/dev/cxgb/common/cxgb_t3_hw.c Sun Aug 15 20:34:51 2010 (r211345) +++ head/sys/dev/cxgb/common/cxgb_t3_hw.c Sun Aug 15 20:45:16 2010 (r211346) @@ -1558,6 +1558,13 @@ void t3_link_changed(adapter_t *adapter, pi->link_fault = LF_YES; } + if (uses_xaui(adapter)) { + if (adapter->params.rev >= T3_REV_C) + t3c_pcs_force_los(mac); + else + t3b_pcs_reset(mac); + } + /* Don't report link up */ link_ok = 0; } else { @@ -1584,12 +1591,20 @@ void t3_link_changed(adapter_t *adapter, /* down -> up, or up -> up with changed settings */ if (adapter->params.rev > 0 && uses_xaui(adapter)) { + + if (adapter->params.rev >= T3_REV_C) + t3c_pcs_force_los(mac); + else + t3b_pcs_reset(mac); + t3_write_reg(adapter, A_XGM_XAUI_ACT_CTRL + mac->offset, F_TXACTENABLE | F_RXEN); } + /* disable TX FIFO drain */ t3_set_reg_field(adapter, A_XGM_TXFIFO_CFG + mac->offset, F_ENDROPPKT, 0); + t3_mac_enable(mac, MAC_DIRECTION_TX | MAC_DIRECTION_RX); t3_set_reg_field(adapter, A_XGM_STAT_CTRL + mac->offset, F_CLRSTATS, 1); @@ -1609,20 +1624,21 @@ void t3_link_changed(adapter_t *adapter, t3_set_reg_field(adapter, A_XGM_INT_ENABLE + mac->offset, F_XGM_INT, 0); - } - if (!link_fault) t3_mac_disable(mac, MAC_DIRECTION_RX); - /* - * Make sure Tx FIFO continues to drain, even as rxen is left - * high to help detect and indicate remote faults. - */ - t3_set_reg_field(adapter, A_XGM_TXFIFO_CFG + mac->offset, 0, - F_ENDROPPKT); - t3_write_reg(adapter, A_XGM_RX_CTRL + mac->offset, 0); - t3_write_reg(adapter, A_XGM_TX_CTRL + mac->offset, F_TXEN); - t3_write_reg(adapter, A_XGM_RX_CTRL + mac->offset, F_RXEN); + /* + * Make sure Tx FIFO continues to drain, even as rxen is + * left high to help detect and indicate remote faults. + */ + t3_set_reg_field(adapter, + A_XGM_TXFIFO_CFG + mac->offset, 0, F_ENDROPPKT); + t3_write_reg(adapter, A_XGM_RX_CTRL + mac->offset, 0); + t3_write_reg(adapter, + A_XGM_TX_CTRL + mac->offset, F_TXEN); + t3_write_reg(adapter, + A_XGM_RX_CTRL + mac->offset, F_RXEN); + } } t3_os_link_changed(adapter, port_id, link_ok, speed, duplex, fc, Modified: head/sys/dev/cxgb/common/cxgb_xgmac.c ============================================================================== --- head/sys/dev/cxgb/common/cxgb_xgmac.c Sun Aug 15 20:34:51 2010 (r211345) +++ head/sys/dev/cxgb/common/cxgb_xgmac.c Sun Aug 15 20:45:16 2010 (r211346) @@ -97,11 +97,40 @@ void t3b_pcs_reset(struct cmac *mac) { t3_set_reg_field(mac->adapter, A_XGM_RESET_CTRL + mac->offset, F_PCS_RESET_, 0); - udelay(20); + + /* No delay required */ + t3_set_reg_field(mac->adapter, A_XGM_RESET_CTRL + mac->offset, 0, F_PCS_RESET_); } +void t3c_pcs_force_los(struct cmac *mac) +{ + t3_set_reg_field(mac->adapter, A_XGM_SERDES_STAT0 + mac->offset, + F_LOWSIGFORCEEN0 | F_LOWSIGFORCEVALUE0, + F_LOWSIGFORCEEN0 | F_LOWSIGFORCEVALUE0); + t3_set_reg_field(mac->adapter, A_XGM_SERDES_STAT1 + mac->offset, + F_LOWSIGFORCEEN1 | F_LOWSIGFORCEVALUE1, + F_LOWSIGFORCEEN1 | F_LOWSIGFORCEVALUE1); + t3_set_reg_field(mac->adapter, A_XGM_SERDES_STAT2 + mac->offset, + F_LOWSIGFORCEEN2 | F_LOWSIGFORCEVALUE2, + F_LOWSIGFORCEEN2 | F_LOWSIGFORCEVALUE2); + t3_set_reg_field(mac->adapter, A_XGM_SERDES_STAT3 + mac->offset, + F_LOWSIGFORCEEN3 | F_LOWSIGFORCEVALUE3, + F_LOWSIGFORCEEN3 | F_LOWSIGFORCEVALUE3); + + /* No delay required */ + + t3_set_reg_field(mac->adapter, A_XGM_SERDES_STAT0 + mac->offset, + F_LOWSIGFORCEEN0, 0); + t3_set_reg_field(mac->adapter, A_XGM_SERDES_STAT1 + mac->offset, + F_LOWSIGFORCEEN1, 0); + t3_set_reg_field(mac->adapter, A_XGM_SERDES_STAT2 + mac->offset, + F_LOWSIGFORCEEN2, 0); + t3_set_reg_field(mac->adapter, A_XGM_SERDES_STAT3 + mac->offset, + F_LOWSIGFORCEEN3, 0); +} + /** * t3_mac_init - initialize a MAC * @mac: the MAC to initialize From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 20:52:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 624D61065694; Sun, 15 Aug 2010 20:52:16 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3763B8FC17; Sun, 15 Aug 2010 20:52:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FKqG8J071338; Sun, 15 Aug 2010 20:52:16 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FKqGZk071336; Sun, 15 Aug 2010 20:52:16 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201008152052.o7FKqGZk071336@svn.freebsd.org> From: Navdeep Parhar Date: Sun, 15 Aug 2010 20:52: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: r211347 - head/sys/dev/cxgb/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2010 20:52:16 -0000 Author: np Date: Sun Aug 15 20:52:15 2010 New Revision: 211347 URL: http://svn.freebsd.org/changeset/base/211347 Log: Fix tx pause quanta and timer calculations. MFC after: 3 days Modified: head/sys/dev/cxgb/common/cxgb_xgmac.c Modified: head/sys/dev/cxgb/common/cxgb_xgmac.c ============================================================================== --- head/sys/dev/cxgb/common/cxgb_xgmac.c Sun Aug 15 20:45:16 2010 (r211346) +++ head/sys/dev/cxgb/common/cxgb_xgmac.c Sun Aug 15 20:52:15 2010 (r211347) @@ -462,7 +462,7 @@ static int rx_fifo_hwm(int mtu) */ int t3_mac_set_mtu(struct cmac *mac, unsigned int mtu) { - int hwm, lwm, divisor; + int hwm, lwm; int ipg; unsigned int thres, v, reg; adapter_t *adap = mac->adapter; @@ -541,16 +541,6 @@ int t3_mac_set_mtu(struct cmac *mac, uns t3_set_reg_field(adap, A_XGM_TXFIFO_CFG + mac->offset, V_TXFIFOTHRESH(M_TXFIFOTHRESH) | V_TXIPG(M_TXIPG), V_TXFIFOTHRESH(thres) | V_TXIPG(ipg)); - - /* Assuming a minimum drain rate of 2.5Gbps... - */ - if (adap->params.rev > 0) { - divisor = (adap->params.rev == T3_REV_C) ? 64 : 8; - t3_write_reg(adap, A_XGM_PAUSE_TIMER + mac->offset, - (hwm - lwm) * 4 / divisor); - } - t3_write_reg(adap, A_XGM_TX_PAUSE_QUANTA + mac->offset, - MAC_RXFIFO_SIZE * 4 * 8 / 512); return 0; } @@ -570,9 +560,17 @@ int t3_mac_set_speed_duplex_fc(struct cm u32 val; adapter_t *adap = mac->adapter; unsigned int oft = mac->offset; + unsigned int pause_bits; if (duplex >= 0 && duplex != DUPLEX_FULL) return -EINVAL; + + pause_bits = MAC_RXFIFO_SIZE * 4 * 8; + t3_write_reg(adap, A_XGM_TX_PAUSE_QUANTA + mac->offset, + pause_bits / 512); + t3_write_reg(adap, A_XGM_PAUSE_TIMER + mac->offset, + (pause_bits >> (adap->params.rev == T3_REV_C ? 10 : 7))); + if (mac->multiport) { u32 rx_max_pkt_size = G_RXMAXPKTSIZE(t3_read_reg(adap, @@ -581,9 +579,9 @@ int t3_mac_set_speed_duplex_fc(struct cm val &= ~V_RXFIFOPAUSEHWM(M_RXFIFOPAUSEHWM); val |= V_RXFIFOPAUSEHWM(rx_fifo_hwm(rx_max_pkt_size) / 8); t3_write_reg(adap, A_XGM_RXFIFO_CFG + oft, val); - t3_set_reg_field(adap, A_XGM_TX_CFG + oft, F_TXPAUSEEN, F_TXPAUSEEN); + return t3_vsc7323_set_speed_fc(adap, speed, fc, mac->ext_port); } if (speed >= 0) { From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 20:56:14 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 091921065674; Sun, 15 Aug 2010 20:56:14 +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 EC64C8FC1A; Sun, 15 Aug 2010 20:56:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FKuDO2071454; Sun, 15 Aug 2010 20:56:13 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FKuDax071452; Sun, 15 Aug 2010 20:56:13 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201008152056.o7FKuDax071452@svn.freebsd.org> From: Christian Brueffer Date: Sun, 15 Aug 2010 20:56: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: r211348 - 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: Sun, 15 Aug 2010 20:56:14 -0000 Author: brueffer Date: Sun Aug 15 20:56:13 2010 New Revision: 211348 URL: http://svn.freebsd.org/changeset/base/211348 Log: Use our standard section 4 SYNOPSIS. While here, fixed markup whitespace and adapted an Xref. Modified: head/share/man/man4/tpm.4 Modified: head/share/man/man4/tpm.4 ============================================================================== --- head/share/man/man4/tpm.4 Sun Aug 15 20:52:15 2010 (r211347) +++ head/share/man/man4/tpm.4 Sun Aug 15 20:56:13 2010 (r211348) @@ -15,14 +15,26 @@ .\" .\" $FreeBSD$ .\" -.Dd March 8, 2010 +.Dd August 15, 2010 .Dt TPM 4 .Os .Sh NAME .Nm tpm .Nd Trusted Platform Module .Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent .Cd "device tpm" +.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 +tpm_load="YES" +.Ed .Pp In .Pa /boot/device.hints : @@ -62,7 +74,7 @@ interrupt vector in .Pa /boot/device.hints . .Sh SEE ALSO .Xr intro 4 , -.Xr files.conf 5, +.Xr device.hints 5 , .Xr config 8 .Sh AUTHORS .An -nosplit From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 21:06:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 067DB1065695; Sun, 15 Aug 2010 21:06:54 +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 CEB8A8FC08; Sun, 15 Aug 2010 21:06:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FL6rjO071754; Sun, 15 Aug 2010 21:06:53 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FL6r9B071750; Sun, 15 Aug 2010 21:06:53 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201008152106.o7FL6r9B071750@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 15 Aug 2010 21: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: r211349 - 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: Sun, 15 Aug 2010 21:06:54 -0000 Author: jilles Date: Sun Aug 15 21:06:53 2010 New Revision: 211349 URL: http://svn.freebsd.org/changeset/base/211349 Log: sh: Fix break/continue/return sometimes not skipping the rest of dot script. In our implementation and most others, a break or continue in a dot script can break or continue a loop outside the dot script. This should cause all further commands in the dot script to be skipped. However, cmdloop() did not know about this and continued to parse and execute commands from the dot script. As described in the man page, a return in a dot script in a function returns from the function, not only from the dot script. There was a similar issue as with break and continue. In various other shells, the return appears to return from the dot script, but POSIX seems not very clear about this. Added: head/tools/regression/bin/sh/builtins/break1.0 (contents, props changed) head/tools/regression/bin/sh/builtins/return5.0 (contents, props changed) Modified: head/bin/sh/main.c Modified: head/bin/sh/main.c ============================================================================== --- head/bin/sh/main.c Sun Aug 15 20:56:13 2010 (r211348) +++ head/bin/sh/main.c Sun Aug 15 21:06:53 2010 (r211349) @@ -232,8 +232,9 @@ cmdloop(int top) } popstackmark(&smark); setstackmark(&smark); - if (evalskip == SKIPFILE) { - evalskip = 0; + if (evalskip != 0) { + if (evalskip == SKIPFILE) + evalskip = 0; break; } } Added: head/tools/regression/bin/sh/builtins/break1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/break1.0 Sun Aug 15 21:06:53 2010 (r211349) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +if [ "$1" != nested ]; then + while :; do + set -- nested + . "$0" + echo bad2 + exit 2 + done + exit 0 +fi +# To trigger the bug, the following commands must be at the top level, +# with newlines in between. +break +echo bad1 +exit 1 Added: head/tools/regression/bin/sh/builtins/return5.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/return5.0 Sun Aug 15 21:06:53 2010 (r211349) @@ -0,0 +1,17 @@ +# $FreeBSD$ + +if [ "$1" != nested ]; then + f() { + set -- nested + . "$0" + # Allow return to return from the function or the dot script. + return 4 + } + f + exit $(($? ^ 4)) +fi +# To trigger the bug, the following commands must be at the top level, +# with newlines in between. +return 4 +echo bad +exit 1 From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 21:19:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 98D281065674; Sun, 15 Aug 2010 21:19:42 +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 8732D8FC12; Sun, 15 Aug 2010 21:19:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FLJgHD072046; Sun, 15 Aug 2010 21:19:42 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FLJgKF072044; Sun, 15 Aug 2010 21:19:42 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201008152119.o7FLJgKF072044@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 15 Aug 2010 21:19: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: r211350 - head/tools/regression/fstest/tests/chown X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2010 21:19:42 -0000 Author: pjd Date: Sun Aug 15 21:19:42 2010 New Revision: 211350 URL: http://svn.freebsd.org/changeset/base/211350 Log: More tests. Modified: head/tools/regression/fstest/tests/chown/00.t Modified: head/tools/regression/fstest/tests/chown/00.t ============================================================================== --- head/tools/regression/fstest/tests/chown/00.t Sun Aug 15 21:06:53 2010 (r211349) +++ head/tools/regression/fstest/tests/chown/00.t Sun Aug 15 21:19:42 2010 (r211350) @@ -7,9 +7,9 @@ dir=`dirname $0` . ${dir}/../misc.sh if supported lchmod; then - echo "1..264" + echo "1..1349" else - echo "1..249" + echo "1..1323" fi n0=`namegen` @@ -21,419 +21,438 @@ cdir=`pwd` cd ${n2} # super-user can always modify ownership - -expect 0 create ${n0} 0644 -expect 0 chown ${n0} 123 456 -expect 123,456 lstat ${n0} uid,gid -expect 0 chown ${n0} 0 0 -expect 0,0 lstat ${n0} uid,gid -expect 0 unlink ${n0} - -expect 0 mkfifo ${n0} 0644 -expect 0 chown ${n0} 123 456 -expect 123,456 lstat ${n0} uid,gid -expect 0 chown ${n0} 0 0 -expect 0,0 lstat ${n0} uid,gid -expect 0 unlink ${n0} - -expect 0 mknod ${n0} b 0644 1 2 -expect 0 chown ${n0} 123 456 -expect 123,456 lstat ${n0} uid,gid -expect 0 chown ${n0} 0 0 -expect 0,0 lstat ${n0} uid,gid -expect 0 unlink ${n0} - -expect 0 mknod ${n0} c 0644 1 2 -expect 0 chown ${n0} 123 456 -expect 123,456 lstat ${n0} uid,gid -expect 0 chown ${n0} 0 0 -expect 0,0 lstat ${n0} uid,gid -expect 0 unlink ${n0} - -expect 0 bind ${n0} -expect 0 chown ${n0} 123 456 -expect 123,456 lstat ${n0} uid,gid -expect 0 chown ${n0} 0 0 -expect 0,0 lstat ${n0} uid,gid -expect 0 unlink ${n0} - -expect 0 mkdir ${n0} 0755 -expect 0 chown ${n0} 123 456 -expect 123,456 lstat ${n0} uid,gid -expect 0 chown ${n0} 0 0 -expect 0,0 lstat ${n0} uid,gid -expect 0 rmdir ${n0} - -expect 0 create ${n0} 0644 -expect 0 symlink ${n0} ${n1} -expect 0 chown ${n1} 123 456 -expect 123,456 stat ${n1} uid,gid -expect 123,456 stat ${n0} uid,gid -expect 0 lchown ${n1} 135 579 -expect 135,579 lstat ${n1} uid,gid -expect 123,456 stat ${n1} uid,gid -expect 123,456 stat ${n0} uid,gid -expect 0 unlink ${n0} -expect 0 unlink ${n1} +for type in regular dir fifo block char socket symlink; do + if [ "${type}" != "symlink" ]; then + create_file ${type} ${n0} + + expect 0 chown ${n0} 123 456 + expect 123,456 lstat ${n0} uid,gid + expect 0 chown ${n0} 0 0 + expect 0,0 lstat ${n0} uid,gid + + expect 0 symlink ${n0} ${n1} + uidgid=`${fstest} lstat ${n1} uid,gid` + expect 0 chown ${n1} 123 456 + expect 123,456 stat ${n1} uid,gid + expect 123,456 stat ${n0} uid,gid + expect ${uidgid} lstat ${n1} uid,gid + expect 0 unlink ${n1} + + if [ "${type}" = "dir" ]; then + expect 0 rmdir ${n0} + else + expect 0 unlink ${n0} + fi + fi + + create_file ${type} ${n0} + expect 0 lchown ${n0} 123 456 + expect 123,456 lstat ${n0} uid,gid + if [ "${type}" = "dir" ]; then + expect 0 rmdir ${n0} + else + expect 0 unlink ${n0} + fi +done # non-super-user can modify file group if he is owner of a file and # gid he is setting is in his groups list. +for type in regular dir fifo block char socket symlink; do + if [ "${type}" != "symlink" ]; then + create_file ${type} ${n0} + + expect 0 chown ${n0} 65534 65533 + expect 65534,65533 lstat ${n0} uid,gid + expect 0 -u 65534 -g 65532,65531 -- chown ${n0} -1 65532 + expect 65534,65532 lstat ${n0} uid,gid + expect 0 -u 65534 -g 65532,65531 chown ${n0} 65534 65531 + expect 65534,65531 lstat ${n0} uid,gid + + expect 0 symlink ${n0} ${n1} + uidgid=`${fstest} lstat ${n1} uid,gid` + expect 0 chown ${n1} 65534 65533 + expect 65534,65533 stat ${n0} uid,gid + expect 65534,65533 stat ${n1} uid,gid + expect ${uidgid} lstat ${n1} uid,gid + expect 0 -u 65534 -g 65532,65531 -- chown ${n1} -1 65532 + expect 65534,65532 stat ${n0} uid,gid + expect 65534,65532 stat ${n1} uid,gid + expect ${uidgid} lstat ${n1} uid,gid + expect 0 -u 65534 -g 65532,65531 chown ${n1} 65534 65531 + expect 65534,65531 stat ${n0} uid,gid + expect 65534,65531 stat ${n1} uid,gid + expect ${uidgid} lstat ${n1} uid,gid + expect 0 unlink ${n1} + + if [ "${type}" = "dir" ]; then + expect 0 rmdir ${n0} + else + expect 0 unlink ${n0} + fi + fi -expect 0 create ${n0} 0644 -expect 0 chown ${n0} 65534 65533 -expect 65534,65533 lstat ${n0} uid,gid -expect 0 -u 65534 -g 65532,65531 -- chown ${n0} -1 65532 -expect 65534,65532 lstat ${n0} uid,gid -expect 0 -u 65534 -g 65532,65531 chown ${n0} 65534 65531 -expect 65534,65531 lstat ${n0} uid,gid -expect 0 unlink ${n0} + create_file ${type} ${n0} + expect 0 lchown ${n0} 65534 65533 + expect 65534,65533 lstat ${n0} uid,gid + expect 0 -u 65534 -g 65532,65531 -- lchown ${n0} -1 65532 + expect 65534,65532 lstat ${n0} uid,gid + expect 0 -u 65534 -g 65532,65531 lchown ${n0} 65534 65531 + expect 65534,65531 lstat ${n0} uid,gid + if [ "${type}" = "dir" ]; then + expect 0 rmdir ${n0} + else + expect 0 unlink ${n0} + fi +done # chown(2) return 0 if user is not owner of a file, but chown(2) is called # with both uid and gid equal to -1. +for type in regular dir fifo block char socket symlink; do + if [ "${type}" != "symlink" ]; then + create_file ${type} ${n0} + + expect 0 chown ${n0} 65534 65533 + expect 0 -u 65532 -g 65531 -- chown ${n0} -1 -1 + expect 65534,65533 stat ${n0} uid,gid + + expect 0 symlink ${n0} ${n1} + uidgid=`${fstest} lstat ${n1} uid,gid` + expect 0 chown ${n1} 65534 65533 + expect 65534,65533 stat ${n0} uid,gid + expect 65534,65533 stat ${n1} uid,gid + expect ${uidgid} lstat ${n1} uid,gid + expect 0 -u 65532 -g 65531 -- chown ${n0} -1 -1 + expect 65534,65533 stat ${n0} uid,gid + expect 65534,65533 stat ${n1} uid,gid + expect ${uidgid} lstat ${n1} uid,gid + expect 0 unlink ${n1} + + if [ "${type}" = "dir" ]; then + expect 0 rmdir ${n0} + else + expect 0 unlink ${n0} + fi + fi -expect 0 create ${n0} 0644 -expect 0 chown ${n0} 65534 65533 -expect 0 -u 65532 -g 65531 -- chown ${n0} -1 -1 -expect 0 unlink ${n0} + create_file ${type} ${n0} + expect 0 lchown ${n0} 65534 65533 + expect 0 -u 65532 -g 65531 -- lchown ${n0} -1 -1 + expect 65534,65533 lstat ${n0} uid,gid + if [ "${type}" = "dir" ]; then + expect 0 rmdir ${n0} + else + expect 0 unlink ${n0} + fi +done # when super-user calls chown(2), set-uid and set-gid bits may be removed. - -expect 0 create ${n0} 0644 -expect 0 chown ${n0} 65534 65533 -expect 0 chmod ${n0} 06555 -expect 06555 lstat ${n0} mode -expect 0 chown ${n0} 65532 65531 -expect "06555|0555" lstat ${n0} mode -expect 0 unlink ${n0} - -expect 0 create ${n0} 0644 -expect 0 chown ${n0} 0 0 -expect 0 chmod ${n0} 06555 -expect 06555 lstat ${n0} mode -expect 0 chown ${n0} 65534 65533 -expect "06555|0555" lstat ${n0} mode -expect 0 unlink ${n0} - -expect 0 create ${n0} 0644 -expect 0 chown ${n0} 65534 65533 -expect 0 chmod ${n0} 06555 -expect 06555 lstat ${n0} mode -expect 0 chown ${n0} 0 0 -expect "06555|0555" lstat ${n0} mode -expect 0 unlink ${n0} +for type in regular dir fifo block char socket symlink; do + if [ "${type}" != "symlink" ]; then + create_file ${type} ${n0} + + expect 0 chown ${n0} 65534 65533 + expect 0 chmod ${n0} 06555 + expect 06555,65534,65533 stat ${n0} mode,uid,gid + expect 0 chown ${n0} 65532 65531 + expect "(06555|0555),65532,65531" stat ${n0} mode,uid,gid + expect 0 chmod ${n0} 06555 + expect 06555,65532,65531 stat ${n0} mode,uid,gid + expect 0 chown ${n0} 0 0 + expect "(06555|0555),0,0" stat ${n0} mode,uid,gid + + expect 0 symlink ${n0} ${n1} + expect 0 chown ${n1} 65534 65533 + expect 0 chmod ${n1} 06555 + expect 06555,65534,65533 stat ${n0} mode,uid,gid + expect 06555,65534,65533 stat ${n1} mode,uid,gid + expect 0 chown ${n1} 65532 65531 + expect "(06555|0555),65532,65531" stat ${n0} mode,uid,gid + expect "(06555|0555),65532,65531" stat ${n1} mode,uid,gid + expect 0 chmod ${n1} 06555 + expect 06555,65532,65531 stat ${n0} mode,uid,gid + expect 06555,65532,65531 stat ${n1} mode,uid,gid + expect 0 chown ${n1} 0 0 + expect "(06555|0555),0,0" stat ${n0} mode,uid,gid + expect "(06555|0555),0,0" stat ${n1} mode,uid,gid + expect 0 unlink ${n1} + + if [ "${type}" = "dir" ]; then + expect 0 rmdir ${n0} + else + expect 0 unlink ${n0} + fi + fi + + if [ "${type}" != "symlink" ] || supported lchmod; then + create_file ${type} ${n0} + expect 0 lchown ${n0} 65534 65533 + if supported lchmod; then + expect 0 lchmod ${n0} 06555 + else + expect 0 chmod ${n0} 06555 + fi + expect 06555,65534,65533 lstat ${n0} mode,uid,gid + expect 0 lchown ${n0} 65532 65531 + expect "(06555|0555),65532,65531" lstat ${n0} mode,uid,gid + if supported lchmod; then + expect 0 lchmod ${n0} 06555 + else + expect 0 chmod ${n0} 06555 + fi + expect 06555,65532,65531 lstat ${n0} mode,uid,gid + expect 0 lchown ${n0} 0 0 + expect "(06555|0555),0,0" lstat ${n0} mode,uid,gid + if [ "${type}" = "dir" ]; then + expect 0 rmdir ${n0} + else + expect 0 unlink ${n0} + fi + fi +done # when non-super-user calls chown(2) successfully, set-uid and set-gid bits may # be removed, except when both uid and gid are equal to -1. - -expect 0 create ${n0} 0644 -expect 0 chown ${n0} 65534 65533 -expect 0 chmod ${n0} 06555 -expect 06555 lstat ${n0} mode -expect 0 -u 65534 -g 65533,65532 chown ${n0} 65534 65532 -expect 0555,65534,65532 lstat ${n0} mode,uid,gid -expect 0 chmod ${n0} 06555 -expect 06555 lstat ${n0} mode -expect 0 -u 65534 -g 65533,65532 -- chown ${n0} -1 65533 -expect 0555,65534,65533 lstat ${n0} mode,uid,gid -expect 0 chmod ${n0} 06555 -expect 06555 lstat ${n0} mode -expect 0 -u 65534 -g 65533,65532 -- chown ${n0} -1 -1 -expect "06555,65534,65533|0555,65534,65533" lstat ${n0} mode,uid,gid -expect 0 unlink ${n0} - -expect 0 mkdir ${n0} 0755 -expect 0 chown ${n0} 65534 65533 -expect 0 chmod ${n0} 06555 -expect 06555 lstat ${n0} mode -expect 0 -u 65534 -g 65533,65532 chown ${n0} 65534 65532 -expect "0555,65534,65532|06555,65534,65532" lstat ${n0} mode,uid,gid -expect 0 chmod ${n0} 06555 -expect 06555 lstat ${n0} mode -expect 0 -u 65534 -g 65533,65532 -- chown ${n0} -1 65533 -expect "0555,65534,65533|06555,65534,65533" lstat ${n0} mode,uid,gid -expect 0 chmod ${n0} 06555 -expect 06555 lstat ${n0} mode -expect 0 -u 65534 -g 65533,65532 -- chown ${n0} -1 -1 -expect 06555,65534,65533 lstat ${n0} mode,uid,gid -expect 0 rmdir ${n0} - -if supported lchmod; then - expect 0 symlink ${n1} ${n0} - expect 0 lchown ${n0} 65534 65533 - expect 0 lchmod ${n0} 06555 - expect 06555 lstat ${n0} mode - expect 0 -u 65534 -g 65533,65532 lchown ${n0} 65534 65532 - expect 0555,65534,65532 lstat ${n0} mode,uid,gid - expect 0 lchmod ${n0} 06555 - expect 06555 lstat ${n0} mode - expect 0 -u 65534 -g 65533,65532 -- lchown ${n0} -1 65533 - expect 0555,65534,65533 lstat ${n0} mode,uid,gid - expect 0 lchmod ${n0} 06555 - expect 06555 lstat ${n0} mode - expect 0 -u 65534 -g 65533,65532 -- lchown ${n0} -1 -1 - expect 06555,65534,65533 lstat ${n0} mode,uid,gid - expect 0 unlink ${n0} -fi +for type in regular dir fifo block char socket symlink; do + if [ "${type}" != "symlink" ]; then + create_file ${type} ${n0} + + expect 0 chown ${n0} 65534 65533 + expect 0 chmod ${n0} 06555 + expect 06555,65534,65533 stat ${n0} mode,uid,gid + expect 0 -u 65534 -g 65533,65532 chown ${n0} 65534 65532 + expect 0555,65534,65532 stat ${n0} mode,uid,gid + expect 0 chmod ${n0} 06555 + expect 06555,65534,65532 stat ${n0} mode,uid,gid + expect 0 -u 65534 -g 65533,65532 -- chown ${n0} -1 65533 + expect 0555,65534,65533 stat ${n0} mode,uid,gid + expect 0 chmod ${n0} 06555 + expect 06555,65534,65533 stat ${n0} mode,uid,gid + expect 0 -u 65534 -g 65533,65532 -- chown ${n0} -1 -1 + expect "(06555|0555),65534,65533" stat ${n0} mode,uid,gid + + expect 0 symlink ${n0} ${n1} + expect 0 chown ${n1} 65534 65533 + expect 0 chmod ${n1} 06555 + expect 06555,65534,65533 stat ${n0} mode,uid,gid + expect 06555,65534,65533 stat ${n1} mode,uid,gid + expect 0 -u 65534 -g 65533,65532 chown ${n1} 65534 65532 + expect 0555,65534,65532 stat ${n0} mode,uid,gid + expect 0555,65534,65532 stat ${n1} mode,uid,gid + expect 0 chmod ${n1} 06555 + expect 06555,65534,65532 stat ${n0} mode,uid,gid + expect 06555,65534,65532 stat ${n1} mode,uid,gid + expect 0 -u 65534 -g 65533,65532 -- chown ${n1} -1 65533 + expect 0555,65534,65533 stat ${n0} mode,uid,gid + expect 0555,65534,65533 stat ${n1} mode,uid,gid + expect 0 chmod ${n1} 06555 + expect 06555,65534,65533 stat ${n0} mode,uid,gid + expect 06555,65534,65533 stat ${n1} mode,uid,gid + expect 0 -u 65534 -g 65533,65532 -- chown ${n1} -1 -1 + expect "(06555|0555),65534,65533" stat ${n0} mode,uid,gid + expect "(06555|0555),65534,65533" stat ${n1} mode,uid,gid + expect 0 unlink ${n1} + + if [ "${type}" = "dir" ]; then + expect 0 rmdir ${n0} + else + expect 0 unlink ${n0} + fi + fi + + if [ "${type}" != "symlink" ] || supported lchmod; then + create_file ${type} ${n0} + + expect 0 lchown ${n0} 65534 65533 + if supported lchmod; then + expect 0 lchmod ${n0} 06555 + else + expect 0 chmod ${n0} 06555 + fi + expect 06555,65534,65533 lstat ${n0} mode,uid,gid + expect 0 -u 65534 -g 65533,65532 lchown ${n0} 65534 65532 + expect 0555,65534,65532 lstat ${n0} mode,uid,gid + if supported lchmod; then + expect 0 lchmod ${n0} 06555 + else + expect 0 chmod ${n0} 06555 + fi + expect 06555,65534,65532 lstat ${n0} mode,uid,gid + expect 0 -u 65534 -g 65533,65532 -- lchown ${n0} -1 65533 + expect 0555,65534,65533 lstat ${n0} mode,uid,gid + if supported lchmod; then + expect 0 lchmod ${n0} 06555 + else + expect 0 chmod ${n0} 06555 + fi + expect 06555,65534,65533 lstat ${n0} mode,uid,gid + expect 0 -u 65534 -g 65533,65532 -- lchown ${n0} -1 -1 + expect "(06555|0555),65534,65533" lstat ${n0} mode,uid,gid + + if [ "${type}" = "dir" ]; then + expect 0 rmdir ${n0} + else + expect 0 unlink ${n0} + fi + fi +done # successfull chown(2) call (except uid and gid equal to -1) updates ctime. +for type in regular dir fifo block char socket symlink; do + if [ "${type}" != "symlink" ]; then + create_file ${type} ${n0} + + ctime1=`${fstest} stat ${n0} ctime` + sleep 1 + expect 0 chown ${n0} 65534 65533 + expect 65534,65533 stat ${n0} uid,gid + ctime2=`${fstest} stat ${n0} ctime` + test_check $ctime1 -lt $ctime2 + ctime1=`${fstest} stat ${n0} ctime` + sleep 1 + expect 0 -u 65534 -g 65532 chown ${n0} 65534 65532 + expect 65534,65532 stat ${n0} uid,gid + ctime2=`${fstest} stat ${n0} ctime` + test_check $ctime1 -lt $ctime2 + + expect 0 symlink ${n0} ${n1} + ctime1=`${fstest} stat ${n1} ctime` + sleep 1 + expect 0 chown ${n1} 65533 65532 + expect 65533,65532 stat ${n1} uid,gid + ctime2=`${fstest} stat ${n1} ctime` + test_check $ctime1 -lt $ctime2 + ctime1=`${fstest} stat ${n1} ctime` + sleep 1 + expect 0 -u 65533 -g 65531 chown ${n1} 65533 65531 + expect 65533,65531 stat ${n1} uid,gid + ctime2=`${fstest} stat ${n1} ctime` + test_check $ctime1 -lt $ctime2 + expect 0 unlink ${n1} + + if [ "${type}" = "dir" ]; then + expect 0 rmdir ${n0} + else + expect 0 unlink ${n0} + fi + fi -expect 0 create ${n0} 0644 -ctime1=`${fstest} stat ${n0} ctime` -sleep 1 -expect 0 chown ${n0} 65534 65533 -expect 65534,65533 lstat ${n0} uid,gid -ctime2=`${fstest} stat ${n0} ctime` -test_check $ctime1 -lt $ctime2 -expect 0 unlink ${n0} - -expect 0 mkdir ${n0} 0755 -ctime1=`${fstest} stat ${n0} ctime` -sleep 1 -expect 0 chown ${n0} 65534 65533 -expect 65534,65533 lstat ${n0} uid,gid -ctime2=`${fstest} stat ${n0} ctime` -test_check $ctime1 -lt $ctime2 -expect 0 rmdir ${n0} - -expect 0 mkfifo ${n0} 0644 -ctime1=`${fstest} stat ${n0} ctime` -sleep 1 -expect 0 chown ${n0} 65534 65533 -expect 65534,65533 lstat ${n0} uid,gid -ctime2=`${fstest} stat ${n0} ctime` -test_check $ctime1 -lt $ctime2 -expect 0 unlink ${n0} - -expect 0 mknod ${n0} b 0644 1 2 -ctime1=`${fstest} stat ${n0} ctime` -sleep 1 -expect 0 chown ${n0} 65534 65533 -expect 65534,65533 lstat ${n0} uid,gid -ctime2=`${fstest} stat ${n0} ctime` -test_check $ctime1 -lt $ctime2 -expect 0 unlink ${n0} - -expect 0 mknod ${n0} c 0644 1 2 -ctime1=`${fstest} stat ${n0} ctime` -sleep 1 -expect 0 chown ${n0} 65534 65533 -expect 65534,65533 lstat ${n0} uid,gid -ctime2=`${fstest} stat ${n0} ctime` -test_check $ctime1 -lt $ctime2 -expect 0 unlink ${n0} - -expect 0 bind ${n0} -ctime1=`${fstest} stat ${n0} ctime` -sleep 1 -expect 0 chown ${n0} 65534 65533 -expect 65534,65533 lstat ${n0} uid,gid -ctime2=`${fstest} stat ${n0} ctime` -test_check $ctime1 -lt $ctime2 -expect 0 unlink ${n0} - -expect 0 symlink ${n1} ${n0} -ctime1=`${fstest} lstat ${n0} ctime` -sleep 1 -expect 0 lchown ${n0} 65534 65533 -expect 65534,65533 lstat ${n0} uid,gid -ctime2=`${fstest} lstat ${n0} ctime` -test_check $ctime1 -lt $ctime2 -expect 0 unlink ${n0} - -expect 0 create ${n0} 0644 -expect 0 chown ${n0} 65534 65533 -ctime1=`${fstest} stat ${n0} ctime` -sleep 1 -expect 0 -u 65534 -g 65532 chown ${n0} 65534 65532 -expect 65534,65532 lstat ${n0} uid,gid -ctime2=`${fstest} stat ${n0} ctime` -test_check $ctime1 -lt $ctime2 -expect 0 unlink ${n0} - -expect 0 mkdir ${n0} 0755 -expect 0 chown ${n0} 65534 65533 -ctime1=`${fstest} stat ${n0} ctime` -sleep 1 -expect 0 -u 65534 -g 65532 chown ${n0} 65534 65532 -expect 65534,65532 lstat ${n0} uid,gid -ctime2=`${fstest} stat ${n0} ctime` -test_check $ctime1 -lt $ctime2 -expect 0 rmdir ${n0} - -expect 0 mkfifo ${n0} 0644 -expect 0 chown ${n0} 65534 65533 -ctime1=`${fstest} stat ${n0} ctime` -sleep 1 -expect 0 chown ${n0} 65534 65533 -expect 0 -u 65534 -g 65532 chown ${n0} 65534 65532 -expect 65534,65532 lstat ${n0} uid,gid -ctime2=`${fstest} stat ${n0} ctime` -test_check $ctime1 -lt $ctime2 -expect 0 unlink ${n0} - -expect 0 mknod ${n0} b 0644 1 2 -expect 0 chown ${n0} 65534 65533 -ctime1=`${fstest} stat ${n0} ctime` -sleep 1 -expect 0 chown ${n0} 65534 65533 -expect 0 -u 65534 -g 65532 chown ${n0} 65534 65532 -expect 65534,65532 lstat ${n0} uid,gid -ctime2=`${fstest} stat ${n0} ctime` -test_check $ctime1 -lt $ctime2 -expect 0 unlink ${n0} - -expect 0 mknod ${n0} c 0644 1 2 -expect 0 chown ${n0} 65534 65533 -ctime1=`${fstest} stat ${n0} ctime` -sleep 1 -expect 0 chown ${n0} 65534 65533 -expect 0 -u 65534 -g 65532 chown ${n0} 65534 65532 -expect 65534,65532 lstat ${n0} uid,gid -ctime2=`${fstest} stat ${n0} ctime` -test_check $ctime1 -lt $ctime2 -expect 0 unlink ${n0} - -expect 0 bind ${n0} -expect 0 chown ${n0} 65534 65533 -ctime1=`${fstest} stat ${n0} ctime` -sleep 1 -expect 0 chown ${n0} 65534 65533 -expect 0 -u 65534 -g 65532 chown ${n0} 65534 65532 -expect 65534,65532 lstat ${n0} uid,gid -ctime2=`${fstest} stat ${n0} ctime` -test_check $ctime1 -lt $ctime2 -expect 0 unlink ${n0} - -expect 0 symlink ${n1} ${n0} -expect 0 lchown ${n0} 65534 65533 -ctime1=`${fstest} lstat ${n0} ctime` -sleep 1 -expect 0 -u 65534 -g 65532 lchown ${n0} 65534 65532 -expect 65534,65532 lstat ${n0} uid,gid -ctime2=`${fstest} lstat ${n0} ctime` -test_check $ctime1 -lt $ctime2 -expect 0 unlink ${n0} - -expect 0 create ${n0} 0644 -ctime1=`${fstest} stat ${n0} ctime` -sleep 1 -expect 0 -- chown ${n0} -1 -1 -ctime2=`${fstest} stat ${n0} ctime` -todo Linux "According to POSIX: If both owner and group are -1, the times need not be updated." -test_check $ctime1 -eq $ctime2 -expect 0 unlink ${n0} - -expect 0 mkdir ${n0} 0644 -ctime1=`${fstest} stat ${n0} ctime` -sleep 1 -expect 0 -- chown ${n0} -1 -1 -ctime2=`${fstest} stat ${n0} ctime` -todo Linux "According to POSIX: If both owner and group are -1, the times need not be updated." -test_check $ctime1 -eq $ctime2 -expect 0 rmdir ${n0} - -expect 0 mkfifo ${n0} 0644 -ctime1=`${fstest} stat ${n0} ctime` -sleep 1 -expect 0 -- chown ${n0} -1 -1 -ctime2=`${fstest} stat ${n0} ctime` -todo Linux "According to POSIX: If both owner and group are -1, the times need not be updated." -test_check $ctime1 -eq $ctime2 -expect 0 unlink ${n0} - -expect 0 mknod ${n0} b 0644 1 2 -ctime1=`${fstest} stat ${n0} ctime` -sleep 1 -expect 0 -- chown ${n0} -1 -1 -ctime2=`${fstest} stat ${n0} ctime` -todo Linux "According to POSIX: If both owner and group are -1, the times need not be updated." -test_check $ctime1 -eq $ctime2 -expect 0 unlink ${n0} - -expect 0 mknod ${n0} c 0644 1 2 -ctime1=`${fstest} stat ${n0} ctime` -sleep 1 -expect 0 -- chown ${n0} -1 -1 -ctime2=`${fstest} stat ${n0} ctime` -todo Linux "According to POSIX: If both owner and group are -1, the times need not be updated." -test_check $ctime1 -eq $ctime2 -expect 0 unlink ${n0} - -expect 0 bind ${n0} -ctime1=`${fstest} stat ${n0} ctime` -sleep 1 -expect 0 -- chown ${n0} -1 -1 -ctime2=`${fstest} stat ${n0} ctime` -todo Linux "According to POSIX: If both owner and group are -1, the times need not be updated." -test_check $ctime1 -eq $ctime2 -expect 0 unlink ${n0} - -expect 0 symlink ${n1} ${n0} -ctime1=`${fstest} lstat ${n0} ctime` -sleep 1 -expect 0 -- lchown ${n0} -1 -1 -ctime2=`${fstest} lstat ${n0} ctime` -todo Linux "According to POSIX: If both owner and group are -1, the times need not be updated." -test_check $ctime1 -eq $ctime2 -expect 0 unlink ${n0} + create_file ${type} ${n0} -# unsuccessful chown(2) does not update ctime. + ctime1=`${fstest} lstat ${n0} ctime` + sleep 1 + expect 0 lchown ${n0} 65534 65533 + expect 65534,65533 lstat ${n0} uid,gid + ctime2=`${fstest} lstat ${n0} ctime` + test_check $ctime1 -lt $ctime2 + ctime1=`${fstest} lstat ${n0} ctime` + sleep 1 + expect 0 -u 65534 -g 65532 lchown ${n0} 65534 65532 + expect 65534,65532 lstat ${n0} uid,gid + ctime2=`${fstest} lstat ${n0} ctime` + test_check $ctime1 -lt $ctime2 + + if [ "${type}" = "dir" ]; then + expect 0 rmdir ${n0} + else + expect 0 unlink ${n0} + fi +done + +for type in regular dir fifo block char socket symlink; do + if [ "${type}" != "symlink" ]; then + create_file ${type} ${n0} + + ctime1=`${fstest} stat ${n0} ctime` + sleep 1 + expect 0 -- chown ${n0} -1 -1 + ctime2=`${fstest} stat ${n0} ctime` + todo Linux "According to POSIX: If both owner and group are -1, the times need not be updated." + test_check $ctime1 -eq $ctime2 + expect 0,0 stat ${n0} uid,gid + + expect 0 symlink ${n0} ${n1} + ctime1=`${fstest} stat ${n1} ctime` + sleep 1 + expect 0 -- chown ${n1} -1 -1 + ctime2=`${fstest} stat ${n1} ctime` + todo Linux "According to POSIX: If both owner and group are -1, the times need not be updated." + test_check $ctime1 -eq $ctime2 + expect 0,0 stat ${n1} uid,gid + expect 0 unlink ${n1} + + if [ "${type}" = "dir" ]; then + expect 0 rmdir ${n0} + else + expect 0 unlink ${n0} + fi + fi + + create_file ${type} ${n0} + + ctime1=`${fstest} lstat ${n0} ctime` + sleep 1 + expect 0 -- lchown ${n0} -1 -1 + ctime2=`${fstest} lstat ${n0} ctime` + todo Linux "According to POSIX: If both owner and group are -1, the times need not be updated." + test_check $ctime1 -eq $ctime2 + expect 0,0 lstat ${n0} uid,gid + + if [ "${type}" = "dir" ]; then + expect 0 rmdir ${n0} + else + expect 0 unlink ${n0} + fi +done -expect 0 create ${n0} 0644 -ctime1=`${fstest} stat ${n0} ctime` -sleep 1 -expect EPERM -u 65534 -- chown ${n0} 65534 -1 -ctime2=`${fstest} stat ${n0} ctime` -test_check $ctime1 -eq $ctime2 -expect 0 unlink ${n0} - -expect 0 mkdir ${n0} 0755 -ctime1=`${fstest} stat ${n0} ctime` -sleep 1 -expect EPERM -u 65534 -g 65534 -- chown ${n0} -1 65534 -ctime2=`${fstest} stat ${n0} ctime` -test_check $ctime1 -eq $ctime2 -expect 0 rmdir ${n0} - -expect 0 mkfifo ${n0} 0644 -ctime1=`${fstest} stat ${n0} ctime` -sleep 1 -expect EPERM -u 65534 -g 65534 chown ${n0} 65534 65534 -ctime2=`${fstest} stat ${n0} ctime` -test_check $ctime1 -eq $ctime2 -expect 0 unlink ${n0} - -expect 0 mknod ${n0} b 0644 1 2 -ctime1=`${fstest} stat ${n0} ctime` -sleep 1 -expect EPERM -u 65534 -g 65534 chown ${n0} 65534 65534 -ctime2=`${fstest} stat ${n0} ctime` -test_check $ctime1 -eq $ctime2 -expect 0 unlink ${n0} - -expect 0 mknod ${n0} c 0644 1 2 -ctime1=`${fstest} stat ${n0} ctime` -sleep 1 -expect EPERM -u 65534 -g 65534 chown ${n0} 65534 65534 -ctime2=`${fstest} stat ${n0} ctime` -test_check $ctime1 -eq $ctime2 -expect 0 unlink ${n0} - -expect 0 bind ${n0} -ctime1=`${fstest} stat ${n0} ctime` -sleep 1 -expect EPERM -u 65534 -g 65534 chown ${n0} 65534 65534 -ctime2=`${fstest} stat ${n0} ctime` -test_check $ctime1 -eq $ctime2 -expect 0 unlink ${n0} - -expect 0 symlink ${n1} ${n0} -ctime1=`${fstest} lstat ${n0} ctime` -sleep 1 -expect EPERM -u 65534 -g 65534 lchown ${n0} 65534 65534 -ctime2=`${fstest} lstat ${n0} ctime` -test_check $ctime1 -eq $ctime2 -expect 0 unlink ${n0} +# unsuccessful chown(2) does not update ctime. +for type in regular dir fifo block char socket symlink; do + if [ "${type}" != "symlink" ]; then + create_file ${type} ${n0} + + ctime1=`${fstest} stat ${n0} ctime` + sleep 1 + expect EPERM -u 65534 -- chown ${n0} 65534 -1 + expect EPERM -u 65534 -g 65534 -- chown ${n0} -1 65534 + expect EPERM -u 65534 -g 65534 chown ${n0} 65534 65534 + ctime2=`${fstest} stat ${n0} ctime` + test_check $ctime1 -eq $ctime2 + expect 0,0 stat ${n0} uid,gid + + expect 0 symlink ${n0} ${n1} + ctime1=`${fstest} stat ${n1} ctime` + sleep 1 + expect EPERM -u 65534 -- chown ${n1} 65534 -1 + expect EPERM -u 65534 -g 65534 -- chown ${n1} -1 65534 + expect EPERM -u 65534 -g 65534 chown ${n1} 65534 65534 + ctime2=`${fstest} stat ${n1} ctime` + test_check $ctime1 -eq $ctime2 + expect 0,0 stat ${n1} uid,gid + expect 0 unlink ${n1} + + if [ "${type}" = "dir" ]; then + expect 0 rmdir ${n0} + else + expect 0 unlink ${n0} + fi + fi + + create_file ${type} ${n0} + + ctime1=`${fstest} lstat ${n0} ctime` + sleep 1 + expect EPERM -u 65534 -- lchown ${n0} 65534 -1 + expect EPERM -u 65534 -g 65534 -- lchown ${n0} -1 65534 + expect EPERM -u 65534 -g 65534 lchown ${n0} 65534 65534 + ctime2=`${fstest} lstat ${n0} ctime` + test_check $ctime1 -eq $ctime2 + expect 0,0 lstat ${n0} uid,gid + + if [ "${type}" = "dir" ]; then + expect 0 rmdir ${n0} + else + expect 0 unlink ${n0} + fi +done cd ${cdir} expect 0 rmdir ${n2} From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 21:20:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E27B910656A9; Sun, 15 Aug 2010 21:20:40 +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 D18F38FC1C; Sun, 15 Aug 2010 21:20:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FLKeSX072115; Sun, 15 Aug 2010 21:20:40 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FLKejs072112; Sun, 15 Aug 2010 21:20:40 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201008152120.o7FLKejs072112@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 15 Aug 2010 21:20: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: r211351 - head/tools/regression/fstest X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2010 21:20:41 -0000 Author: pjd Date: Sun Aug 15 21:20:40 2010 New Revision: 211351 URL: http://svn.freebsd.org/changeset/base/211351 Log: Update copyright years. Modified: head/tools/regression/fstest/LICENSE head/tools/regression/fstest/fstest.c Modified: head/tools/regression/fstest/LICENSE ============================================================================== --- head/tools/regression/fstest/LICENSE Sun Aug 15 21:19:42 2010 (r211350) +++ head/tools/regression/fstest/LICENSE Sun Aug 15 21:20:40 2010 (r211351) @@ -2,7 +2,7 @@ $FreeBSD$ License for all regression tests available with fstest: -Copyright (c) 2006-2007 Pawel Jakub Dawidek +Copyright (c) 2006-2010 Pawel Jakub Dawidek All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/tools/regression/fstest/fstest.c ============================================================================== --- head/tools/regression/fstest/fstest.c Sun Aug 15 21:19:42 2010 (r211350) +++ head/tools/regression/fstest/fstest.c Sun Aug 15 21:20:40 2010 (r211351) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2006-2007 Pawel Jakub Dawidek + * Copyright (c) 2006-2010 Pawel Jakub Dawidek * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 21:24:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F4AD106564A; Sun, 15 Aug 2010 21:24:18 +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 445848FC16; Sun, 15 Aug 2010 21:24:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FLOIkx072235; Sun, 15 Aug 2010 21:24:18 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FLOIAO072234; Sun, 15 Aug 2010 21:24:18 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201008152124.o7FLOIAO072234@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 15 Aug 2010 21:24: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: r211352 - in head/tools/regression: fstest pjdfstest X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2010 21:24:18 -0000 Author: pjd Date: Sun Aug 15 21:24:17 2010 New Revision: 211352 URL: http://svn.freebsd.org/changeset/base/211352 Log: Give fstest a more unique name: pjdfstest. It is released from time to time and used outside FreeBSD, so it is good to have a name one can google. Added: head/tools/regression/pjdfstest/ - copied from r211351, head/tools/regression/fstest/ Deleted: head/tools/regression/fstest/ From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 21:25:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A61C91065670; Sun, 15 Aug 2010 21:25: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 7ABED8FC13; Sun, 15 Aug 2010 21:25:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FLPqxG072303; Sun, 15 Aug 2010 21:25:52 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FLPq9B072299; Sun, 15 Aug 2010 21:25:52 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201008152125.o7FLPq9B072299@svn.freebsd.org> From: Christian Brueffer Date: Sun, 15 Aug 2010 21:25: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: r211353 - in head: . 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: Sun, 15 Aug 2010 21:25:52 -0000 Author: brueffer Date: Sun Aug 15 21:25:52 2010 New Revision: 211353 URL: http://svn.freebsd.org/changeset/base/211353 Log: Tie up some loose ends r88509 left behind: - chooseproc() is long gone, MLINK choosethread instead - Update NAME section for choosethread - Mark chooseproc.9 for removal PR: 149549 Submitted by: pluknet MFC after: 1 week Modified: head/ObsoleteFiles.inc head/share/man/man9/Makefile head/share/man/man9/runqueue.9 Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Aug 15 21:24:17 2010 (r211352) +++ head/ObsoleteFiles.inc Sun Aug 15 21:25:52 2010 (r211353) @@ -14,6 +14,8 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20100815: retired last traces of chooseproc(9) +OLD_FILES+=usr/share/man/man9/chooseproc.9.gz # 20100806: removal of unused libcompat routines OLD_FILES+=usr/share/man/man3/ascftime.3.gz OLD_FILES+=usr/share/man/man3/cfree.3.gz Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Sun Aug 15 21:24:17 2010 (r211352) +++ head/share/man/man9/Makefile Sun Aug 15 21:25:52 2010 (r211353) @@ -994,7 +994,7 @@ MLINKS+=rtalloc.9 rtalloc1.9 \ rtalloc.9 rtalloc_ign.9 \ rtalloc.9 RTFREE.9 \ rtalloc.9 rtfree.9 -MLINKS+=runqueue.9 chooseproc.9 \ +MLINKS+=runqueue.9 choosethread.9 \ runqueue.9 procrunnable.9 \ runqueue.9 remrunqueue.9 \ runqueue.9 setrunqueue.9 Modified: head/share/man/man9/runqueue.9 ============================================================================== --- head/share/man/man9/runqueue.9 Sun Aug 15 21:24:17 2010 (r211352) +++ head/share/man/man9/runqueue.9 Sun Aug 15 21:25:52 2010 (r211353) @@ -23,11 +23,11 @@ .\" .\" $FreeBSD$ .\" -.Dd November 3, 2000 +.Dd August 15, 2010 .Dt RUNQUEUE 9 .Os .Sh NAME -.Nm chooseproc , +.Nm choosethread , .Nm procrunnable , .Nm remrunqueue , .Nm setrunqueue From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 21:29:03 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBF8A1065698; Sun, 15 Aug 2010 21:29:03 +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 DAA9C8FC13; Sun, 15 Aug 2010 21:29:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FLT3c8072401; Sun, 15 Aug 2010 21:29:03 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FLT3ur072394; Sun, 15 Aug 2010 21:29:03 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201008152129.o7FLT3ur072394@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 15 Aug 2010 21:29: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: r211354 - in head/tools/regression/pjdfstest: . tests X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2010 21:29:04 -0000 Author: pjd Date: Sun Aug 15 21:29:03 2010 New Revision: 211354 URL: http://svn.freebsd.org/changeset/base/211354 Log: Finish renaming fstest to pjdfstest. Added: head/tools/regression/pjdfstest/pjdfstest.c - copied, changed from r211352, head/tools/regression/pjdfstest/fstest.c Deleted: head/tools/regression/pjdfstest/fstest.c Modified: head/tools/regression/pjdfstest/LICENSE head/tools/regression/pjdfstest/Makefile head/tools/regression/pjdfstest/README head/tools/regression/pjdfstest/tests/conf head/tools/regression/pjdfstest/tests/misc.sh Modified: head/tools/regression/pjdfstest/LICENSE ============================================================================== --- head/tools/regression/pjdfstest/LICENSE Sun Aug 15 21:25:52 2010 (r211353) +++ head/tools/regression/pjdfstest/LICENSE Sun Aug 15 21:29:03 2010 (r211354) @@ -1,6 +1,6 @@ $FreeBSD$ -License for all regression tests available with fstest: +License for all regression tests available with pjdfstest: Copyright (c) 2006-2010 Pawel Jakub Dawidek All rights reserved. Modified: head/tools/regression/pjdfstest/Makefile ============================================================================== --- head/tools/regression/pjdfstest/Makefile Sun Aug 15 21:25:52 2010 (r211353) +++ head/tools/regression/pjdfstest/Makefile Sun Aug 15 21:29:03 2010 (r211354) @@ -1,6 +1,6 @@ # $FreeBSD$ -PROG= fstest +PROG= pjdfstest ${PROG}: ${PROG}.c @OSTYPE=`uname`; \ Modified: head/tools/regression/pjdfstest/README ============================================================================== --- head/tools/regression/pjdfstest/README Sun Aug 15 21:25:52 2010 (r211353) +++ head/tools/regression/pjdfstest/README Sun Aug 15 21:29:03 2010 (r211354) @@ -1,17 +1,17 @@ $FreeBSD$ -Few notes on how to use fstest in short steps: +Few notes on how to use pjdfstest in short steps: - # cd fstest + # cd pjdfstest # vi tests/conf Change 'fs' to file system type you want to test (UFS or ZFS). # vi Makefile You need to manually tweak few things by editing CFLAGS lines at the top of the file. # make - It will compile fstest utility which is used by regression tests. + It will compile pjdfstest utility which is used by regression tests. # cd /path/to/file/system/you/want/to/test/ - # prove -r /path/to/fstest/ + # prove -r /path/to/pjdfstest/tests That's all. Enjoy. Copied and modified: head/tools/regression/pjdfstest/pjdfstest.c (from r211352, head/tools/regression/pjdfstest/fstest.c) ============================================================================== --- head/tools/regression/pjdfstest/fstest.c Sun Aug 15 21:24:17 2010 (r211352, copy source) +++ head/tools/regression/pjdfstest/pjdfstest.c Sun Aug 15 21:29:03 2010 (r211354) @@ -264,7 +264,7 @@ static void usage(void) { - fprintf(stderr, "usage: fstest [-U umask] [-u uid] [-g gid1[,gid2[...]]] syscall args ...\n"); + fprintf(stderr, "usage: pjdfstest [-U umask] [-u uid] [-g gid1[,gid2[...]]] syscall args ...\n"); exit(1); } Modified: head/tools/regression/pjdfstest/tests/conf ============================================================================== --- head/tools/regression/pjdfstest/tests/conf Sun Aug 15 21:25:52 2010 (r211353) +++ head/tools/regression/pjdfstest/tests/conf Sun Aug 15 21:29:03 2010 (r211354) @@ -1,5 +1,5 @@ # $FreeBSD$ -# fstest configuration file +# pjdfstest configuration file # Supported operating systems: FreeBSD, Darwin, SunOS, Linux os=`uname` Modified: head/tools/regression/pjdfstest/tests/misc.sh ============================================================================== --- head/tools/regression/pjdfstest/tests/misc.sh Sun Aug 15 21:25:52 2010 (r211353) +++ head/tools/regression/pjdfstest/tests/misc.sh Sun Aug 15 21:29:03 2010 (r211354) @@ -10,7 +10,7 @@ case "${dir}" in maindir="`pwd`/${dir}/../.." ;; esac -fstest="${maindir}/fstest" +fstest="${maindir}/pjdfstest" . ${maindir}/tests/conf expect() @@ -42,7 +42,7 @@ jexpect() d="${2}" e="${3}" shift 3 - r=`jail -s ${s} / fstest 127.0.0.1 /bin/sh -c "cd ${d} && ${fstest} $* 2>/dev/null" | tail -1` + r=`jail -s ${s} / pjdfstest 127.0.0.1 /bin/sh -c "cd ${d} && ${fstest} $* 2>/dev/null" | tail -1` echo "${r}" | ${GREP} -Eq '^'${e}'$' if [ $? -eq 0 ]; then if [ -z "${todomsg}" ]; then @@ -89,7 +89,7 @@ todo() namegen() { - echo "fstest_`dd if=/dev/urandom bs=1k count=1 2>/dev/null | openssl md5`" + echo "pjdfstest_`dd if=/dev/urandom bs=1k count=1 2>/dev/null | openssl md5`" } namegen_len() From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 21:34:51 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 441001065695; Sun, 15 Aug 2010 21:34:51 +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 3327D8FC0A; Sun, 15 Aug 2010 21:34:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FLYpgQ072554; Sun, 15 Aug 2010 21:34:51 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FLYpIq072552; Sun, 15 Aug 2010 21:34:51 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201008152134.o7FLYpIq072552@svn.freebsd.org> From: Christian Brueffer Date: Sun, 15 Aug 2010 21:34: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: r211355 - 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: Sun, 15 Aug 2010 21:34:51 -0000 Author: brueffer Date: Sun Aug 15 21:34:50 2010 New Revision: 211355 URL: http://svn.freebsd.org/changeset/base/211355 Log: Fixed a typo and added a comma. PR: 148681 Submitted by: Glen Barber MFC after: 1 week Modified: head/share/man/man4/ng_atm.4 Modified: head/share/man/man4/ng_atm.4 ============================================================================== --- head/share/man/man4/ng_atm.4 Sun Aug 15 21:29:03 2010 (r211354) +++ head/share/man/man4/ng_atm.4 Sun Aug 15 21:34:50 2010 (r211355) @@ -138,7 +138,7 @@ Hooks for dynamically initiated VCIs can .Xr netgraph 4 as long as the name does not collide with one of the three predefined names. .Pp -To initiate packet sending an receiving on a dynamic hook one has to issue +To initiate packet sending and receiving on a dynamic hook, one has to issue a .Dv NGM_ATM_CPCS_INIT control message. From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 21:37:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2108A1065670; Sun, 15 Aug 2010 21:37:31 +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 1027F8FC13; Sun, 15 Aug 2010 21:37:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FLbUok072639; Sun, 15 Aug 2010 21:37:30 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FLbU23072637; Sun, 15 Aug 2010 21:37:30 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201008152137.o7FLbU23072637@svn.freebsd.org> From: Christian Brueffer Date: Sun, 15 Aug 2010 21:37: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: r211356 - head/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: Sun, 15 Aug 2010 21:37:31 -0000 Author: brueffer Date: Sun Aug 15 21:37:30 2010 New Revision: 211356 URL: http://svn.freebsd.org/changeset/base/211356 Log: Fixed a typo. PR: 148701 Submitted by: Glen Barber MFC after: 1 week Modified: head/share/man/man9/crypto.9 Modified: head/share/man/man9/crypto.9 ============================================================================== --- head/share/man/man9/crypto.9 Sun Aug 15 21:34:50 2010 (r211355) +++ head/share/man/man9/crypto.9 Sun Aug 15 21:37:30 2010 (r211356) @@ -143,7 +143,7 @@ not The same holds for the framework. Thus, a callback mechanism is used to notify a consumer that a request has been completed (the -callback is specified by the consumer on an per-request basis). +callback is specified by the consumer on a per-request basis). The callback is invoked by the framework whether the request was successfully completed or not. An error indication is provided in the latter case. From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 21:43:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 215531065673; Sun, 15 Aug 2010 21:43: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 E9A908FC13; Sun, 15 Aug 2010 21:43:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FLhpDj072801; Sun, 15 Aug 2010 21:43:51 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FLhp7P072799; Sun, 15 Aug 2010 21:43:51 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008152143.o7FLhp7P072799@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 15 Aug 2010 21:43: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: r211357 - stable/8/sys/dev/ste X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2010 21:43:52 -0000 Author: yongari Date: Sun Aug 15 21:43:51 2010 New Revision: 211357 URL: http://svn.freebsd.org/changeset/base/211357 Log: MFC r211089: It seems some old Sundace(now IC Plus Corp.) controllers do not like memory mapped register access. Typical problem from the issue was MII access returned unreliable values. I'm not sure this comes from lack of register flushing in MII access after accessing STE_PHYCTL register though. To address the issue, read hints data that controls which type of memory mapping should be used in driver. ste(4) still prefers memory mapping to io mapping but honor hints entered by user except for controllers that have problems with memory mapping. The hint to use iomapping could be given by adding the following line to /boot/device.hints file. hint.ste.0.prefer_iomap="1" PR: kern/149285 Modified: stable/8/sys/dev/ste/if_ste.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (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/sys/dev/e1000/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/ste/if_ste.c ============================================================================== --- stable/8/sys/dev/ste/if_ste.c Sun Aug 15 21:37:30 2010 (r211356) +++ stable/8/sys/dev/ste/if_ste.c Sun Aug 15 21:43:51 2010 (r211357) @@ -1059,7 +1059,7 @@ ste_attach(device_t dev) struct ste_softc *sc; struct ifnet *ifp; uint16_t eaddr[ETHER_ADDR_LEN / 2]; - int error = 0, pmc, rid; + int error = 0, pmc, prefer_iomap, rid; sc = device_get_softc(dev); sc->ste_dev = dev; @@ -1081,12 +1081,25 @@ ste_attach(device_t dev) */ pci_enable_busmaster(dev); - /* Prefer memory space register mapping over IO space. */ - sc->ste_res_id = PCIR_BAR(1); - sc->ste_res_type = SYS_RES_MEMORY; - sc->ste_res = bus_alloc_resource_any(dev, sc->ste_res_type, - &sc->ste_res_id, RF_ACTIVE); - if (sc->ste_res == NULL) { + /* + * Prefer memory space register mapping over IO space but use + * IO space for a device that is known to have issues on memory + * mapping. + */ + prefer_iomap = 0; + if (pci_get_device(dev) == ST_DEVICEID_ST201_1) + prefer_iomap = 1; + else + resource_int_value(device_get_name(sc->ste_dev), + device_get_unit(sc->ste_dev), "prefer_iomap", + &prefer_iomap); + if (prefer_iomap == 0) { + sc->ste_res_id = PCIR_BAR(1); + sc->ste_res_type = SYS_RES_MEMORY; + sc->ste_res = bus_alloc_resource_any(dev, sc->ste_res_type, + &sc->ste_res_id, RF_ACTIVE); + } + if (prefer_iomap || sc->ste_res == NULL) { sc->ste_res_id = PCIR_BAR(0); sc->ste_res_type = SYS_RES_IOPORT; sc->ste_res = bus_alloc_resource_any(dev, sc->ste_res_type, From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 21:46:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2C021065672; Sun, 15 Aug 2010 21:46: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 A6C2A8FC08; Sun, 15 Aug 2010 21:46:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FLkNRx072916; Sun, 15 Aug 2010 21:46:23 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FLkNGB072914; Sun, 15 Aug 2010 21:46:23 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008152146.o7FLkNGB072914@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 15 Aug 2010 21:46:23 +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: r211358 - stable/7/sys/dev/ste X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2010 21:46:24 -0000 Author: yongari Date: Sun Aug 15 21:46:23 2010 New Revision: 211358 URL: http://svn.freebsd.org/changeset/base/211358 Log: MFC r211089: It seems some old Sundace(now IC Plus Corp.) controllers do not like memory mapped register access. Typical problem from the issue was MII access returned unreliable values. I'm not sure this comes from lack of register flushing in MII access after accessing STE_PHYCTL register though. To address the issue, read hints data that controls which type of memory mapping should be used in driver. ste(4) still prefers memory mapping to io mapping but honor hints entered by user except for controllers that have problems with memory mapping. The hint to use iomapping could be given by adding the following line to /boot/device.hints file. hint.ste.0.prefer_iomap="1" PR: kern/149285 Modified: stable/7/sys/dev/ste/if_ste.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/ste/if_ste.c ============================================================================== --- stable/7/sys/dev/ste/if_ste.c Sun Aug 15 21:43:51 2010 (r211357) +++ stable/7/sys/dev/ste/if_ste.c Sun Aug 15 21:46:23 2010 (r211358) @@ -1053,7 +1053,7 @@ ste_attach(device_t dev) struct ste_softc *sc; struct ifnet *ifp; uint16_t eaddr[ETHER_ADDR_LEN / 2]; - int error = 0, pmc, rid; + int error = 0, pmc, prefer_iomap, rid; sc = device_get_softc(dev); sc->ste_dev = dev; @@ -1075,12 +1075,25 @@ ste_attach(device_t dev) */ pci_enable_busmaster(dev); - /* Prefer memory space register mapping over IO space. */ - sc->ste_res_id = PCIR_BAR(1); - sc->ste_res_type = SYS_RES_MEMORY; - sc->ste_res = bus_alloc_resource_any(dev, sc->ste_res_type, - &sc->ste_res_id, RF_ACTIVE); - if (sc->ste_res == NULL) { + /* + * Prefer memory space register mapping over IO space but use + * IO space for a device that is known to have issues on memory + * mapping. + */ + prefer_iomap = 0; + if (pci_get_device(dev) == ST_DEVICEID_ST201_1) + prefer_iomap = 1; + else + resource_int_value(device_get_name(sc->ste_dev), + device_get_unit(sc->ste_dev), "prefer_iomap", + &prefer_iomap); + if (prefer_iomap == 0) { + sc->ste_res_id = PCIR_BAR(1); + sc->ste_res_type = SYS_RES_MEMORY; + sc->ste_res = bus_alloc_resource_any(dev, sc->ste_res_type, + &sc->ste_res_id, RF_ACTIVE); + } + if (prefer_iomap || sc->ste_res == NULL) { sc->ste_res_id = PCIR_BAR(0); sc->ste_res_type = SYS_RES_IOPORT; sc->ste_res = bus_alloc_resource_any(dev, sc->ste_res_type, From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 21:51:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2D6D1065744; Sun, 15 Aug 2010 21:51:10 +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 971768FC1A; Sun, 15 Aug 2010 21:51:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FLpAdR073052; Sun, 15 Aug 2010 21:51:10 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FLpAxt073050; Sun, 15 Aug 2010 21:51:10 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008152151.o7FLpAxt073050@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 15 Aug 2010 21:51: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: r211359 - stable/8/sys/dev/sk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2010 21:51:10 -0000 Author: yongari Date: Sun Aug 15 21:51:10 2010 New Revision: 211359 URL: http://svn.freebsd.org/changeset/base/211359 Log: MFC r209865: Some revision of Yukon controller generates corrupted frame when TX checksum offloading is enabled. The frame has a valid checksum value so payload might be modified during TX checksum calculation. Disable TX checksum offloading but give users chance to enable it when they know their controller works without problems with TX checksum offloading. Reported by: Andrzej Tobola iem dot pw dot edu dot pl> Modified: stable/8/sys/dev/sk/if_sk.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (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/sys/dev/e1000/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/sk/if_sk.c ============================================================================== --- stable/8/sys/dev/sk/if_sk.c Sun Aug 15 21:46:23 2010 (r211358) +++ stable/8/sys/dev/sk/if_sk.c Sun Aug 15 21:51:10 2010 (r211359) @@ -1169,14 +1169,17 @@ sk_ioctl(ifp, command, data) break; } mask = ifr->ifr_reqcap ^ ifp->if_capenable; - if (mask & IFCAP_HWCSUM) { - ifp->if_capenable ^= IFCAP_HWCSUM; - if (IFCAP_HWCSUM & ifp->if_capenable && - IFCAP_HWCSUM & ifp->if_capabilities) - ifp->if_hwassist = SK_CSUM_FEATURES; + if ((mask & IFCAP_TXCSUM) != 0 && + (IFCAP_TXCSUM & ifp->if_capabilities) != 0) { + ifp->if_capenable ^= IFCAP_TXCSUM; + if ((ifp->if_capenable & IFCAP_TXCSUM) != 0) + ifp->if_hwassist |= SK_CSUM_FEATURES; else - ifp->if_hwassist = 0; + ifp->if_hwassist &= ~SK_CSUM_FEATURES; } + if ((mask & IFCAP_RXCSUM) != 0 && + (IFCAP_RXCSUM & ifp->if_capabilities) != 0) + ifp->if_capenable ^= IFCAP_RXCSUM; SK_IF_UNLOCK(sc_if); break; default: @@ -1363,13 +1366,23 @@ sk_attach(dev) * SK_GENESIS has a bug in checksum offload - From linux. */ if (sc_if->sk_softc->sk_type != SK_GENESIS) { - ifp->if_capabilities = IFCAP_HWCSUM; - ifp->if_hwassist = SK_CSUM_FEATURES; + ifp->if_capabilities = IFCAP_TXCSUM | IFCAP_RXCSUM; + ifp->if_hwassist = 0; } else { ifp->if_capabilities = 0; ifp->if_hwassist = 0; } ifp->if_capenable = ifp->if_capabilities; + /* + * Some revision of Yukon controller generates corrupted + * frame when TX checksum offloading is enabled. The + * frame has a valid checksum value so payload might be + * modified during TX checksum calculation. Disable TX + * checksum offloading but give users chance to enable it + * when they know their controller works without problems + * with TX checksum offloading. + */ + ifp->if_capenable &= ~IFCAP_TXCSUM; ifp->if_ioctl = sk_ioctl; ifp->if_start = sk_start; ifp->if_init = sk_init; From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 21:53:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D5AA106566C; Sun, 15 Aug 2010 21:53:08 +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 1187D8FC19; Sun, 15 Aug 2010 21:53:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FLr7wR073145; Sun, 15 Aug 2010 21:53:07 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FLr7Zd073143; Sun, 15 Aug 2010 21:53:07 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008152153.o7FLr7Zd073143@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 15 Aug 2010 21:53:07 +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: r211360 - stable/7/sys/dev/sk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2010 21:53:08 -0000 Author: yongari Date: Sun Aug 15 21:53:07 2010 New Revision: 211360 URL: http://svn.freebsd.org/changeset/base/211360 Log: MFC r209865: Some revision of Yukon controller generates corrupted frame when TX checksum offloading is enabled. The frame has a valid checksum value so payload might be modified during TX checksum calculation. Disable TX checksum offloading but give users chance to enable it when they know their controller works without problems with TX checksum offloading. Reported by: Andrzej Tobola iem dot pw dot edu dot pl> Modified: stable/7/sys/dev/sk/if_sk.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/sk/if_sk.c ============================================================================== --- stable/7/sys/dev/sk/if_sk.c Sun Aug 15 21:51:10 2010 (r211359) +++ stable/7/sys/dev/sk/if_sk.c Sun Aug 15 21:53:07 2010 (r211360) @@ -1169,14 +1169,17 @@ sk_ioctl(ifp, command, data) break; } mask = ifr->ifr_reqcap ^ ifp->if_capenable; - if (mask & IFCAP_HWCSUM) { - ifp->if_capenable ^= IFCAP_HWCSUM; - if (IFCAP_HWCSUM & ifp->if_capenable && - IFCAP_HWCSUM & ifp->if_capabilities) - ifp->if_hwassist = SK_CSUM_FEATURES; + if ((mask & IFCAP_TXCSUM) != 0 && + (IFCAP_TXCSUM & ifp->if_capabilities) != 0) { + ifp->if_capenable ^= IFCAP_TXCSUM; + if ((ifp->if_capenable & IFCAP_TXCSUM) != 0) + ifp->if_hwassist |= SK_CSUM_FEATURES; else - ifp->if_hwassist = 0; + ifp->if_hwassist &= ~SK_CSUM_FEATURES; } + if ((mask & IFCAP_RXCSUM) != 0 && + (IFCAP_RXCSUM & ifp->if_capabilities) != 0) + ifp->if_capenable ^= IFCAP_RXCSUM; SK_IF_UNLOCK(sc_if); break; default: @@ -1363,13 +1366,23 @@ sk_attach(dev) * SK_GENESIS has a bug in checksum offload - From linux. */ if (sc_if->sk_softc->sk_type != SK_GENESIS) { - ifp->if_capabilities = IFCAP_HWCSUM; - ifp->if_hwassist = SK_CSUM_FEATURES; + ifp->if_capabilities = IFCAP_TXCSUM | IFCAP_RXCSUM; + ifp->if_hwassist = 0; } else { ifp->if_capabilities = 0; ifp->if_hwassist = 0; } ifp->if_capenable = ifp->if_capabilities; + /* + * Some revision of Yukon controller generates corrupted + * frame when TX checksum offloading is enabled. The + * frame has a valid checksum value so payload might be + * modified during TX checksum calculation. Disable TX + * checksum offloading but give users chance to enable it + * when they know their controller works without problems + * with TX checksum offloading. + */ + ifp->if_capenable &= ~IFCAP_TXCSUM; ifp->if_ioctl = sk_ioctl; ifp->if_start = sk_start; ifp->if_timer = 0; From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 21:56:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2FBD41065672; Sun, 15 Aug 2010 21:56: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 03C778FC18; Sun, 15 Aug 2010 21:56:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FLukuA073347; Sun, 15 Aug 2010 21:56:46 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FLukdh073344; Sun, 15 Aug 2010 21:56:46 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008152156.o7FLukdh073344@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 15 Aug 2010 21:56: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: r211361 - stable/8/sys/dev/sge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2010 21:56:47 -0000 Author: yongari Date: Sun Aug 15 21:56:45 2010 New Revision: 211361 URL: http://svn.freebsd.org/changeset/base/211361 Log: MFC r209818: Remove enabling RX checksum offloading in RX filter setup. RX checksum is enabled in sge_init_locked(). While I'm here do not set RX checksum bits in RX descriptor initialization. It is controller's job to set these bits. Tested by: xclin cs dot nctu dot edu dot tw > Modified: stable/8/sys/dev/sge/if_sge.c stable/8/sys/dev/sge/if_sgereg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (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/sys/dev/e1000/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/sge/if_sge.c ============================================================================== --- stable/8/sys/dev/sge/if_sge.c Sun Aug 15 21:53:07 2010 (r211360) +++ stable/8/sys/dev/sge/if_sge.c Sun Aug 15 21:56:45 2010 (r211361) @@ -480,7 +480,7 @@ sge_rxfilter(struct sge_softc *sc) } if_maddr_runlock(ifp); } - CSR_WRITE_2(sc, RxMacControl, rxfilt | 0x02); + CSR_WRITE_2(sc, RxMacControl, rxfilt); CSR_WRITE_4(sc, RxHashTable, hashes[0]); CSR_WRITE_4(sc, RxHashTable2, hashes[1]); } @@ -1118,8 +1118,7 @@ sge_newbuf(struct sge_softc *sc, int pro desc->sge_flags = htole32(segs[0].ds_len); if (prod == SGE_RX_RING_CNT - 1) desc->sge_flags |= htole32(RING_END); - desc->sge_cmdsts = htole32(RDC_OWN | RDC_INTR | RDC_IP_CSUM | - RDC_TCP_CSUM | RDC_UDP_CSUM); + desc->sge_cmdsts = htole32(RDC_OWN | RDC_INTR); return (0); } @@ -1133,8 +1132,7 @@ sge_discard_rxbuf(struct sge_softc *sc, desc->sge_flags = htole32(MCLBYTES - SGE_RX_BUF_ALIGN); if (index == SGE_RX_RING_CNT - 1) desc->sge_flags |= htole32(RING_END); - desc->sge_cmdsts = htole32(RDC_OWN | RDC_INTR | RDC_IP_CSUM | - RDC_TCP_CSUM | RDC_UDP_CSUM); + desc->sge_cmdsts = htole32(RDC_OWN | RDC_INTR); } /* @@ -1665,7 +1663,7 @@ sge_init_locked(struct sge_softc *sc) for (i = 0; i < ETHER_ADDR_LEN; i++) CSR_WRITE_1(sc, RxMacAddr + i, IF_LLADDR(ifp)[i]); /* Configure RX MAC. */ - rxfilt = RXMAC_STRIP_FCS | RXMAC_PAD_ENB; + rxfilt = RXMAC_STRIP_FCS | RXMAC_PAD_ENB | RXMAC_CSUM_ENB; CSR_WRITE_2(sc, RxMacControl, rxfilt); sge_rxfilter(sc); sge_setvlan(sc); Modified: stable/8/sys/dev/sge/if_sgereg.h ============================================================================== --- stable/8/sys/dev/sge/if_sgereg.h Sun Aug 15 21:53:07 2010 (r211360) +++ stable/8/sys/dev/sge/if_sgereg.h Sun Aug 15 21:56:45 2010 (r211361) @@ -140,6 +140,7 @@ #define RXMAC_STRIP_VLAN 0x0020 #define RXMAC_STRIP_FCS 0x0010 #define RXMAC_PAD_ENB 0x0004 +#define RXMAC_CSUM_ENB 0x0002 #define SGE_RX_PAD_BYTES 10 From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 21:58:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A5941065679; Sun, 15 Aug 2010 21:58:05 +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 4E54A8FC0C; Sun, 15 Aug 2010 21:58:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FLw5Df073423; Sun, 15 Aug 2010 21:58:05 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FLw5TI073420; Sun, 15 Aug 2010 21:58:05 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008152158.o7FLw5TI073420@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 15 Aug 2010 21:58:05 +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: r211362 - stable/7/sys/dev/sge X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2010 21:58:05 -0000 Author: yongari Date: Sun Aug 15 21:58:05 2010 New Revision: 211362 URL: http://svn.freebsd.org/changeset/base/211362 Log: MFC r209818: Remove enabling RX checksum offloading in RX filter setup. RX checksum is enabled in sge_init_locked(). While I'm here do not set RX checksum bits in RX descriptor initialization. It is controller's job to set these bits. Tested by: xclin cs dot nctu dot edu dot tw > Modified: stable/7/sys/dev/sge/if_sge.c stable/7/sys/dev/sge/if_sgereg.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/sge/if_sge.c ============================================================================== --- stable/7/sys/dev/sge/if_sge.c Sun Aug 15 21:56:45 2010 (r211361) +++ stable/7/sys/dev/sge/if_sge.c Sun Aug 15 21:58:05 2010 (r211362) @@ -480,7 +480,7 @@ sge_rxfilter(struct sge_softc *sc) } IF_ADDR_UNLOCK(ifp); } - CSR_WRITE_2(sc, RxMacControl, rxfilt | 0x02); + CSR_WRITE_2(sc, RxMacControl, rxfilt); CSR_WRITE_4(sc, RxHashTable, hashes[0]); CSR_WRITE_4(sc, RxHashTable2, hashes[1]); } @@ -1118,8 +1118,7 @@ sge_newbuf(struct sge_softc *sc, int pro desc->sge_flags = htole32(segs[0].ds_len); if (prod == SGE_RX_RING_CNT - 1) desc->sge_flags |= htole32(RING_END); - desc->sge_cmdsts = htole32(RDC_OWN | RDC_INTR | RDC_IP_CSUM | - RDC_TCP_CSUM | RDC_UDP_CSUM); + desc->sge_cmdsts = htole32(RDC_OWN | RDC_INTR); return (0); } @@ -1133,8 +1132,7 @@ sge_discard_rxbuf(struct sge_softc *sc, desc->sge_flags = htole32(MCLBYTES - SGE_RX_BUF_ALIGN); if (index == SGE_RX_RING_CNT - 1) desc->sge_flags |= htole32(RING_END); - desc->sge_cmdsts = htole32(RDC_OWN | RDC_INTR | RDC_IP_CSUM | - RDC_TCP_CSUM | RDC_UDP_CSUM); + desc->sge_cmdsts = htole32(RDC_OWN | RDC_INTR); } /* @@ -1665,7 +1663,7 @@ sge_init_locked(struct sge_softc *sc) for (i = 0; i < ETHER_ADDR_LEN; i++) CSR_WRITE_1(sc, RxMacAddr + i, IF_LLADDR(ifp)[i]); /* Configure RX MAC. */ - rxfilt = RXMAC_STRIP_FCS | RXMAC_PAD_ENB; + rxfilt = RXMAC_STRIP_FCS | RXMAC_PAD_ENB | RXMAC_CSUM_ENB; CSR_WRITE_2(sc, RxMacControl, rxfilt); sge_rxfilter(sc); sge_setvlan(sc); Modified: stable/7/sys/dev/sge/if_sgereg.h ============================================================================== --- stable/7/sys/dev/sge/if_sgereg.h Sun Aug 15 21:56:45 2010 (r211361) +++ stable/7/sys/dev/sge/if_sgereg.h Sun Aug 15 21:58:05 2010 (r211362) @@ -140,6 +140,7 @@ #define RXMAC_STRIP_VLAN 0x0020 #define RXMAC_STRIP_FCS 0x0010 #define RXMAC_PAD_ENB 0x0004 +#define RXMAC_CSUM_ENB 0x0002 #define SGE_RX_PAD_BYTES 10 From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 22:15:05 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 227021065693; Sun, 15 Aug 2010 22:15:05 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1077A8FC17; Sun, 15 Aug 2010 22:15:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FMF4Si073979; Sun, 15 Aug 2010 22:15:04 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FMF4N3073972; Sun, 15 Aug 2010 22:15:04 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201008152215.o7FMF4N3073972@svn.freebsd.org> From: Gabor Kovesdan Date: Sun, 15 Aug 2010 22:15: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: r211364 - head/usr.bin/grep X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2010 22:15:05 -0000 Author: gabor Date: Sun Aug 15 22:15:04 2010 New Revision: 211364 URL: http://svn.freebsd.org/changeset/base/211364 Log: - Revert strlcpy() changes to memcpy() because it's more efficient and former may be safer but in this case it doesn't add extra safety [1] - Fix -w option [2] - Fix handling of GREP_OPTIONS [3] - Fix --line-buffered - Make stdin input imply --line-buffered so that tail -f can be piped to grep [4] - Imply -h if single file is grepped, this is the GNU behaviour - Reduce locking overhead to gain some more performance [5] - Inline some functions to help the compiler better optimize the code - Use shortcut for empty files [6] PR: bin/149425 [6] Prodded by: jilles [1] Reported by: Alex Kozlov [2] [3], swell.k@gmail.com [2], poyopoyo@puripuri.plala.or.jp [4] Submitted by: scf [5], Shuichi KITAGUCHI [6] Approved by: delphij (mentor) Modified: head/usr.bin/grep/fastgrep.c head/usr.bin/grep/file.c head/usr.bin/grep/grep.c head/usr.bin/grep/grep.h head/usr.bin/grep/queue.c head/usr.bin/grep/util.c Modified: head/usr.bin/grep/fastgrep.c ============================================================================== --- head/usr.bin/grep/fastgrep.c Sun Aug 15 22:09:43 2010 (r211363) +++ head/usr.bin/grep/fastgrep.c Sun Aug 15 22:15:04 2010 (r211364) @@ -46,8 +46,8 @@ __FBSDID("$FreeBSD$"); #include "grep.h" -static int grep_cmp(const unsigned char *, const unsigned char *, size_t); -static void grep_revstr(unsigned char *, int); +static inline int grep_cmp(const unsigned char *, const unsigned char *, size_t); +static inline void grep_revstr(unsigned char *, int); void fgrepcomp(fastgrep_t *fg, const char *pat) @@ -273,7 +273,7 @@ grep_search(fastgrep_t *fg, unsigned cha * Returns: i >= 0 on failure (position that it failed) * -1 on success */ -static int +static inline int grep_cmp(const unsigned char *pat, const unsigned char *data, size_t len) { size_t size; @@ -318,7 +318,7 @@ grep_cmp(const unsigned char *pat, const return (-1); } -static void +static inline void grep_revstr(unsigned char *str, int len) { int i; Modified: head/usr.bin/grep/file.c ============================================================================== --- head/usr.bin/grep/file.c Sun Aug 15 22:09:43 2010 (r211363) +++ head/usr.bin/grep/file.c Sun Aug 15 22:15:04 2010 (r211364) @@ -67,14 +67,14 @@ static int bzerr; * Returns a single character according to the file type. * Returns -1 on failure. */ -int +static inline int grep_fgetc(struct file *f) { unsigned char c; switch (filebehave) { case FILE_STDIO: - return (fgetc(f->f)); + return (getc_unlocked(f->f)); case FILE_GZIP: return (gzgetc(f->gzf)); case FILE_BZIP: @@ -92,13 +92,13 @@ grep_fgetc(struct file *f) * Returns true if the file position is a EOF, returns false * otherwise. */ -int +static inline int grep_feof(struct file *f) { switch (filebehave) { case FILE_STDIO: - return (feof(f->f)); + return (feof_unlocked(f->f)); case FILE_GZIP: return (gzeof(f->gzf)); case FILE_BZIP: @@ -131,6 +131,9 @@ grep_fgetln(struct file *f, size_t *len) st.st_size = MAXBUFSIZ; else if (stat(fname, &st) != 0) err(2, NULL); + /* no need to allocate buffer. */ + if (st.st_size == 0) + return (NULL); bufsiz = (MAXBUFSIZ > (st.st_size * PREREAD_M)) ? (st.st_size / 2) : MAXBUFSIZ; @@ -142,6 +145,8 @@ grep_fgetln(struct file *f, size_t *len) if (ch == EOF) break; binbuf[i++] = ch; + if ((ch == '\n') && lbflag) + break; } f->binary = memchr(binbuf, (filebehave != FILE_GZIP) ? @@ -184,11 +189,16 @@ grep_stdin_open(void) { struct file *f; + /* Processing stdin implies --line-buffered for tail -f to work. */ + lbflag = true; + snprintf(fname, sizeof fname, "%s", getstr(1)); f = grep_malloc(sizeof *f); + binbuf = NULL; if ((f->f = fdopen(STDIN_FILENO, "r")) != NULL) { + flockfile(f->f); f->stdin = true; return (f); } @@ -209,11 +219,14 @@ grep_open(const char *path) f = grep_malloc(sizeof *f); + binbuf = NULL; f->stdin = false; switch (filebehave) { case FILE_STDIO: - if ((f->f = fopen(path, "r")) != NULL) + if ((f->f = fopen(path, "r")) != NULL) { + flockfile(f->f); return (f); + } break; case FILE_GZIP: if ((f->gzf = gzopen(fname, "r")) != NULL) @@ -238,6 +251,7 @@ grep_close(struct file *f) switch (filebehave) { case FILE_STDIO: + funlockfile(f->f); fclose(f->f); break; case FILE_GZIP: @@ -251,5 +265,4 @@ grep_close(struct file *f) /* Reset read buffer for the file we are closing */ binbufptr = NULL; free(binbuf); - } Modified: head/usr.bin/grep/grep.c ============================================================================== --- head/usr.bin/grep/grep.c Sun Aug 15 22:09:43 2010 (r211363) +++ head/usr.bin/grep/grep.c Sun Aug 15 22:15:04 2010 (r211364) @@ -121,8 +121,8 @@ int devbehave = DEV_READ; /* -D: handl int dirbehave = DIR_READ; /* -dRr: handling of directories */ int linkbehave = LINK_READ; /* -OpS: handling of symlinks */ -bool dexclude, dinclude; /* --exclude amd --include */ -bool fexclude, finclude; /* --exclude-dir and --include-dir */ +bool dexclude, dinclude; /* --exclude-dir and --include-dir */ +bool fexclude, finclude; /* --exclude and --include */ enum { BIN_OPT = CHAR_MAX + 1, @@ -236,7 +236,8 @@ add_pattern(char *pat, size_t len) --len; /* pat may not be NUL-terminated */ pattern[patterns] = grep_malloc(len + 1); - strlcpy(pattern[patterns], pat, len + 1); + memcpy(pattern[patterns], pat, len); + pattern[patterns][len] = '\0'; ++patterns; } @@ -355,38 +356,33 @@ main(int argc, char *argv[]) eopts = getenv("GREP_OPTIONS"); - eargc = 1; + /* support for extra arguments in GREP_OPTIONS */ + eargc = 0; if (eopts != NULL) { char *str; - for(i = 0; i < strlen(eopts); i++) - if (eopts[i] == ' ') + /* make an estimation of how many extra arguments we have */ + for (unsigned int j = 0; j < strlen(eopts); j++) + if (eopts[j] == ' ') eargc++; eargv = (char **)grep_malloc(sizeof(char *) * (eargc + 1)); - str = strtok(eopts, " "); eargc = 0; - - while(str != NULL) { - eargv[++eargc] = (char *)grep_malloc(sizeof(char) * - (strlen(str) + 1)); - strlcpy(eargv[eargc], str, strlen(str) + 1); - str = strtok(NULL, " "); - } - eargv[++eargc] = NULL; + /* parse extra arguments */ + while ((str = strsep(&eopts, " ")) != NULL) + eargv[eargc++] = grep_strdup(str); aargv = (char **)grep_calloc(eargc + argc + 1, sizeof(char *)); - aargv[0] = argv[0]; - for(i = 1; i < eargc; i++) - aargv[i] = eargv[i]; - for(int j = 1; j < argc; j++) - aargv[i++] = argv[j]; - - aargc = eargc + argc - 1; + aargv[0] = argv[0]; + for (i = 0; i < eargc; i++) + aargv[i + 1] = eargv[i]; + for (int j = 1; j < argc; j++, i++) + aargv[i + 1] = argv[j]; + aargc = eargc + argc; } else { aargv = argv; aargc = argc; @@ -609,11 +605,11 @@ main(int argc, char *argv[]) add_fpattern(optarg, EXCL_PAT); break; case R_DINCLUDE_OPT: - dexclude = true; + dinclude = true; add_dpattern(optarg, INCL_PAT); break; case R_DEXCLUDE_OPT: - dinclude = true; + dexclude = true; add_dpattern(optarg, EXCL_PAT); break; case HELP_OPT: @@ -685,12 +681,15 @@ main(int argc, char *argv[]) if (dirbehave == DIR_RECURSE) c = grep_tree(aargv); - else + else { + if (aargc == 1) + hflag = true; for (c = 0; aargc--; ++aargv) { if ((finclude || fexclude) && !file_matching(*aargv)) continue; c+= procfile(*aargv); } + } #ifndef WITHOUT_NLS catclose(catalog); Modified: head/usr.bin/grep/grep.h ============================================================================== --- head/usr.bin/grep/grep.h Sun Aug 15 22:09:43 2010 (r211363) +++ head/usr.bin/grep/grep.h Sun Aug 15 22:15:04 2010 (r211364) @@ -115,7 +115,7 @@ extern int cflags, eflags; extern bool Eflag, Fflag, Gflag, Hflag, Lflag, bflag, cflag, hflag, iflag, lflag, mflag, nflag, oflag, qflag, sflag, vflag, wflag, xflag; -extern bool dexclude, dinclude, fexclude, finclude, nullflag; +extern bool dexclude, dinclude, fexclude, finclude, lbflag, nullflag; extern unsigned long long Aflag, Bflag, mcount; extern char *label; extern const char *color; @@ -134,7 +134,6 @@ extern fastgrep_t *fg_pattern; extern char re_error[RE_ERROR_BUF + 1]; /* Seems big enough */ /* util.c */ -bool dir_matching(const char *dname); bool file_matching(const char *fname); int procfile(const char *fn); int grep_tree(char **argv); @@ -153,8 +152,6 @@ void clearqueue(void); void grep_close(struct file *f); struct file *grep_stdin_open(void); struct file *grep_open(const char *path); -int grep_feof(struct file *f); -int grep_fgetc(struct file *f); char *grep_fgetln(struct file *f, size_t *len); /* fastgrep.c */ Modified: head/usr.bin/grep/queue.c ============================================================================== --- head/usr.bin/grep/queue.c Sun Aug 15 22:09:43 2010 (r211363) +++ head/usr.bin/grep/queue.c Sun Aug 15 22:15:04 2010 (r211364) @@ -60,7 +60,7 @@ enqueue(struct str *x) item->data.len = x->len; item->data.line_no = x->line_no; item->data.off = x->off; - strcpy(item->data.dat, x->dat); + memcpy(item->data.dat, x->dat, x->len); item->data.file = x->file; STAILQ_INSERT_TAIL(&queue, item, list); Modified: head/usr.bin/grep/util.c ============================================================================== --- head/usr.bin/grep/util.c Sun Aug 15 22:09:43 2010 (r211363) +++ head/usr.bin/grep/util.c Sun Aug 15 22:15:04 2010 (r211364) @@ -72,7 +72,7 @@ file_matching(const char *fname) return (ret); } -bool +static inline bool dir_matching(const char *dname) { bool ret; @@ -144,9 +144,10 @@ grep_tree(char **argv) if (dexclude || dinclude) { if ((d = strrchr(p->fts_path, '/')) != NULL) { dir = grep_malloc(sizeof(char) * - (d - p->fts_path + 2)); - strlcpy(dir, p->fts_path, (d - p->fts_path + 1)); + memcpy(dir, p->fts_path, + d - p->fts_path); + dir[d - p->fts_path] = '\0'; } ok = dir_matching(dir); free(dir); @@ -276,7 +277,7 @@ procfile(const char *fn) * matches. The matching lines are passed to printline() to display the * appropriate output. */ -static int +static inline int procline(struct str *l, int nottext) { regmatch_t matches[MAX_LINE_MATCHES]; @@ -317,30 +318,20 @@ procline(struct str *l, int nottext) (size_t)pmatch.rm_eo != l->len) r = REG_NOMATCH; /* Check for whole word match */ - if (r == 0 && wflag && pmatch.rm_so != 0 && - (size_t)pmatch.rm_eo != l->len) { - wchar_t *wbegin; - wint_t wend; - size_t size; + if (r == 0 && wflag && pmatch.rm_so != 0) { + wint_t wbegin, wend; - size = mbstowcs(NULL, l->dat, - pmatch.rm_so); - - if (size == ((size_t) - 1)) + wbegin = wend = L' '; + if (pmatch.rm_so != 0 && + sscanf(&l->dat[pmatch.rm_so - 1], + "%lc", &wbegin) != 1) + r = REG_NOMATCH; + else if ((size_t)pmatch.rm_eo != l->len && + sscanf(&l->dat[pmatch.rm_eo], + "%lc", &wend) != 1) + r = REG_NOMATCH; + else if (iswword(wbegin) || iswword(wend)) r = REG_NOMATCH; - else { - wbegin = grep_malloc(size); - if (mbstowcs(wbegin, l->dat, - pmatch.rm_so) == ((size_t) - 1)) - r = REG_NOMATCH; - else if (sscanf(&l->dat[pmatch.rm_eo], - "%lc", &wend) != 1) - r = REG_NOMATCH; - else if (iswword(wbegin[wcslen(wbegin)]) || - iswword(wend)) - r = REG_NOMATCH; - free(wbegin); - } } if (r == 0) { if (m == 0) From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 22:16:52 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 158B11065675; Sun, 15 Aug 2010 22:16:52 +0000 (UTC) (envelope-from marc@blackend.org) Received: from abigail.blackend.org (ns0.blackend.org [82.227.222.164]) by mx1.freebsd.org (Postfix) with ESMTP id 8593F8FC13; Sun, 15 Aug 2010 22:16:51 +0000 (UTC) Received: from gothic.blackend.org (gothic.blackend.org [192.168.1.203]) by abigail.blackend.org (8.13.4/8.13.3) with ESMTP id o7FM6Zh9040532; Mon, 16 Aug 2010 00:06:35 +0200 (CEST) (envelope-from marc@abigail.blackend.org) Received: from gothic.blackend.org (localhost [127.0.0.1]) by gothic.blackend.org (8.14.4/8.14.4) with ESMTP id o7FM6ZUF085951; Mon, 16 Aug 2010 00:06:35 +0200 (CEST) (envelope-from marc@gothic.blackend.org) Received: (from marc@localhost) by gothic.blackend.org (8.14.4/8.14.4/Submit) id o7FM6Ztu085950; Mon, 16 Aug 2010 00:06:35 +0200 (CEST) (envelope-from marc) Date: Mon, 16 Aug 2010 00:06:35 +0200 From: Marc Fonvieille To: Bruce Cran Message-ID: <20100815220635.GA79635@gothic.blackend.org> References: <201007162042.o6GKgKHJ016694@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201007162042.o6GKgKHJ016694@svn.freebsd.org> X-Useless-Header: blackend.org X-Operating-System: FreeBSD 8.1-RELEASE User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r210175 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2010 22:16:52 -0000 On Fri, Jul 16, 2010 at 08:42:20PM +0000, Bruce Cran wrote: > Author: brucec > Date: Fri Jul 16 20:42:20 2010 > New Revision: 210175 > URL: http://svn.freebsd.org/changeset/base/210175 > > Log: > FreeBSD 8 doesn't support kernel PPP or SLIP; remove code for configuring > and installing via such devices from sysinstall. > > Reviewed by: randi > Approved by: rrs (mentor) > MFC after: 1 month > > Modified: > head/usr.sbin/sysinstall/devices.c > head/usr.sbin/sysinstall/install.c > head/usr.sbin/sysinstall/menus.c > head/usr.sbin/sysinstall/network.c > [...] > > Modified: head/usr.sbin/sysinstall/install.c > ============================================================================== > --- head/usr.sbin/sysinstall/install.c Fri Jul 16 20:28:45 2010 (r210174) > +++ head/usr.sbin/sysinstall/install.c Fri Jul 16 20:42:20 2010 (r210175) > @@ -692,7 +692,7 @@ nodisks: > "may do so by typing: /usr/sbin/sysinstall."); > } > if (mediaDevice->type != DEVICE_TYPE_FTP && mediaDevice->type != DEVICE_TYPE_NFS) { > - if (!msgYesNo("Would you like to configure any Ethernet or SLIP/PPP network devices?")) { > + if (!msgYesNo("Would you like to configure any Ethernet network devices?")) { > Device *tmp = tcpDeviceSelect(); > > if (tmp && !((DevInfo *)tmp->private)->use_dhcp && !msgYesNo("Would you like to bring the %s interface up right now?", tmp->name)) > > Modified: head/usr.sbin/sysinstall/menus.c > ============================================================================== > --- head/usr.sbin/sysinstall/menus.c Fri Jul 16 20:28:45 2010 (r210174) > +++ head/usr.sbin/sysinstall/menus.c Fri Jul 16 20:42:20 2010 (r210175) > @@ -882,13 +882,8 @@ DMenu MenuMediaFTP = { > DMenu MenuNetworkDevice = { > DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, > "Network interface information required", > - "If you are using PPP over a serial device, as opposed to a direct\n" > - "ethernet connection, then you may first need to dial your Internet\n" > - "Service Provider using the ppp utility we provide for that purpose.\n" > - "If you're using SLIP over a serial device then the expectation is\n" > - "that you have a HARDWIRED connection.\n\n" > - "You can also install over a parallel port using a special \"laplink\"\n" > - "cable to another machine running FreeBSD.", > + "Please select the ethernet device to configure.\n\n" > + "", > "Press F1 to read network configuration manual", > "network_device", > { { NULL } }, > We still support PLIP (with a laplink cable) since a plip0 interface is displayed on this screen during installation if you have a parallel port on the motherboard. So maybe we should reword that with "Please select the Ethernet or the PLIP device to configure.\n\n" -- Marc From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 22:36:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F8FD1065694; Sun, 15 Aug 2010 22:36: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 5E35E8FC19; Sun, 15 Aug 2010 22:36:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FMaCUB074465; Sun, 15 Aug 2010 22:36:12 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FMaCF0074463; Sun, 15 Aug 2010 22:36:12 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008152236.o7FMaCF0074463@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 15 Aug 2010 22:36: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: r211365 - 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: Sun, 15 Aug 2010 22:36:12 -0000 Author: yongari Date: Sun Aug 15 22:36:12 2010 New Revision: 211365 URL: http://svn.freebsd.org/changeset/base/211365 Log: MFC r208917: Remove unused macros. Modified: 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/cam/ (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/sys/dev/e1000/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/8/sys/dev/bge/if_bgereg.h Sun Aug 15 22:15:04 2010 (r211364) +++ stable/8/sys/dev/bge/if_bgereg.h Sun Aug 15 22:36:12 2010 (r211365) @@ -2086,9 +2086,6 @@ struct bge_status_block { struct bge_sts_idx bge_idx[16]; }; -#define BGE_TX_CONSIDX(x, i) x->bge_idx[i].bge_tx_considx -#define BGE_RX_PRODIDX(x, i) x->bge_idx[i].bge_rx_prodidx - #define BGE_STATFLAG_UPDATED 0x00000001 #define BGE_STATFLAG_LINKSTATE_CHANGED 0x00000002 #define BGE_STATFLAG_ERROR 0x00000004 @@ -2475,15 +2472,9 @@ struct bge_gib { pci_write_config(dev, reg, (pci_read_config(dev, reg, s) & ~(x)), s) /* - * Memory management stuff. Note: the SSLOTS, MSLOTS and JSLOTS - * values are tuneable. They control the actual amount of buffers - * allocated for the standard, mini and jumbo receive rings. + * Memory management stuff. */ -#define BGE_SSLOTS 256 -#define BGE_MSLOTS 256 -#define BGE_JSLOTS 384 - #define BGE_NSEG_JUMBO 4 #define BGE_NSEG_NEW 32 #define BGE_TSOSEG_SZ 4096 From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 22:37:32 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F5D010656A4; Sun, 15 Aug 2010 22:37:32 +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 6DDBA8FC1D; Sun, 15 Aug 2010 22:37:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FMbWWa074535; Sun, 15 Aug 2010 22:37:32 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FMbW1t074533; Sun, 15 Aug 2010 22:37:32 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008152237.o7FMbW1t074533@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 15 Aug 2010 22:37:32 +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: r211366 - 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: Sun, 15 Aug 2010 22:37:32 -0000 Author: yongari Date: Sun Aug 15 22:37:32 2010 New Revision: 211366 URL: http://svn.freebsd.org/changeset/base/211366 Log: MFC r208917: Remove unused macros. Modified: 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_bgereg.h ============================================================================== --- stable/7/sys/dev/bge/if_bgereg.h Sun Aug 15 22:36:12 2010 (r211365) +++ stable/7/sys/dev/bge/if_bgereg.h Sun Aug 15 22:37:32 2010 (r211366) @@ -2086,9 +2086,6 @@ struct bge_status_block { struct bge_sts_idx bge_idx[16]; }; -#define BGE_TX_CONSIDX(x, i) x->bge_idx[i].bge_tx_considx -#define BGE_RX_PRODIDX(x, i) x->bge_idx[i].bge_rx_prodidx - #define BGE_STATFLAG_UPDATED 0x00000001 #define BGE_STATFLAG_LINKSTATE_CHANGED 0x00000002 #define BGE_STATFLAG_ERROR 0x00000004 @@ -2475,15 +2472,9 @@ struct bge_gib { pci_write_config(dev, reg, (pci_read_config(dev, reg, s) & ~(x)), s) /* - * Memory management stuff. Note: the SSLOTS, MSLOTS and JSLOTS - * values are tuneable. They control the actual amount of buffers - * allocated for the standard, mini and jumbo receive rings. + * Memory management stuff. */ -#define BGE_SSLOTS 256 -#define BGE_MSLOTS 256 -#define BGE_JSLOTS 384 - #define BGE_NSEG_JUMBO 4 #define BGE_NSEG_NEW 32 #define BGE_TSOSEG_SZ 4096 From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 22:40:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5A55106566B; Sun, 15 Aug 2010 22:40: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 C3FD08FC16; Sun, 15 Aug 2010 22:40:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FMel3m074640; Sun, 15 Aug 2010 22:40:47 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FMelkB074638; Sun, 15 Aug 2010 22:40:47 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008152240.o7FMelkB074638@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 15 Aug 2010 22:40: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: r211367 - 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: Sun, 15 Aug 2010 22:40:48 -0000 Author: yongari Date: Sun Aug 15 22:40:47 2010 New Revision: 211367 URL: http://svn.freebsd.org/changeset/base/211367 Log: MFC r209714: It seems read DMA mode register requires both IPv4 TSO and IPv6 TSO configuration to get IPv4 TSO work on BCM57780. While I'm here apply the same fix to BCM5785 which shares similar hardware feature of BCM57780. This change makes TSO work on BCM57780. Tested by: Tong Liu gmail dot com> Modified: stable/8/sys/dev/bge/if_bge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (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/sys/dev/e1000/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Sun Aug 15 22:37:32 2010 (r211366) +++ stable/8/sys/dev/bge/if_bge.c Sun Aug 15 22:40:47 2010 (r211367) @@ -1861,8 +1861,12 @@ bge_blockinit(struct bge_softc *sc) BGE_RDMAMODE_MBUF_SBD_CRPT_ATTN; if (sc->bge_flags & BGE_FLAG_PCIE) val |= BGE_RDMAMODE_FIFO_LONG_BURST; - if (sc->bge_flags & BGE_FLAG_TSO) + if (sc->bge_flags & BGE_FLAG_TSO) { val |= BGE_RDMAMODE_TSO4_ENABLE; + if (sc->bge_asicrev == BGE_ASICREV_BCM5785 || + sc->bge_asicrev == BGE_ASICREV_BCM57780) + val |= BGE_RDMAMODE_TSO6_ENABLE; + } CSR_WRITE_4(sc, BGE_RDMA_MODE, val); DELAY(40); From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 22:42:16 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F944106567A; Sun, 15 Aug 2010 22:42:16 +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 F24928FC1D; Sun, 15 Aug 2010 22:42:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FMgFE2074719; Sun, 15 Aug 2010 22:42:15 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FMgFA2074717; Sun, 15 Aug 2010 22:42:15 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008152242.o7FMgFA2074717@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 15 Aug 2010 22:42:15 +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: r211368 - 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: Sun, 15 Aug 2010 22:42:16 -0000 Author: yongari Date: Sun Aug 15 22:42:15 2010 New Revision: 211368 URL: http://svn.freebsd.org/changeset/base/211368 Log: MFC r209714: It seems read DMA mode register requires both IPv4 TSO and IPv6 TSO configuration to get IPv4 TSO work on BCM57780. While I'm here apply the same fix to BCM5785 which shares similar hardware feature of BCM57780. This change makes TSO work on BCM57780. Tested by: Tong Liu gmail dot com> Modified: stable/7/sys/dev/bge/if_bge.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/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Sun Aug 15 22:40:47 2010 (r211367) +++ stable/7/sys/dev/bge/if_bge.c Sun Aug 15 22:42:15 2010 (r211368) @@ -1861,8 +1861,12 @@ bge_blockinit(struct bge_softc *sc) BGE_RDMAMODE_MBUF_SBD_CRPT_ATTN; if (sc->bge_flags & BGE_FLAG_PCIE) val |= BGE_RDMAMODE_FIFO_LONG_BURST; - if (sc->bge_flags & BGE_FLAG_TSO) + if (sc->bge_flags & BGE_FLAG_TSO) { val |= BGE_RDMAMODE_TSO4_ENABLE; + if (sc->bge_asicrev == BGE_ASICREV_BCM5785 || + sc->bge_asicrev == BGE_ASICREV_BCM57780) + val |= BGE_RDMAMODE_TSO6_ENABLE; + } CSR_WRITE_4(sc, BGE_RDMA_MODE, val); DELAY(40); From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 22:44:29 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D7811065696; Sun, 15 Aug 2010 22:44: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 44F338FC14; Sun, 15 Aug 2010 22:44:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FMiTdX074830; Sun, 15 Aug 2010 22:44:29 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FMiT7T074828; Sun, 15 Aug 2010 22:44:29 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008152244.o7FMiT7T074828@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 15 Aug 2010 22:44: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: r211369 - 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: Sun, 15 Aug 2010 22:44:29 -0000 Author: yongari Date: Sun Aug 15 22:44:28 2010 New Revision: 211369 URL: http://svn.freebsd.org/changeset/base/211369 Log: MFC r209741: Zero entire status block and add missing bus_dmamap_sync(9). Modified: stable/8/sys/dev/bge/if_bge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (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/sys/dev/e1000/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Sun Aug 15 22:42:15 2010 (r211368) +++ stable/8/sys/dev/bge/if_bge.c Sun Aug 15 22:44:28 2010 (r211369) @@ -1787,15 +1787,19 @@ bge_blockinit(struct bge_softc *sc) BGE_ADDR_HI(sc->bge_ldata.bge_status_block_paddr)); CSR_WRITE_4(sc, BGE_HCC_STATUSBLK_ADDR_LO, BGE_ADDR_LO(sc->bge_ldata.bge_status_block_paddr)); - sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx = 0; - sc->bge_ldata.bge_status_block->bge_idx[0].bge_tx_cons_idx = 0; /* Set up status block size. */ if (sc->bge_asicrev == BGE_ASICREV_BCM5700 && - sc->bge_chipid != BGE_CHIPID_BCM5700_C0) + sc->bge_chipid != BGE_CHIPID_BCM5700_C0) { val = BGE_STATBLKSZ_FULL; - else + bzero(sc->bge_ldata.bge_status_block, BGE_STATUS_BLK_SZ); + } else { val = BGE_STATBLKSZ_32BYTE; + bzero(sc->bge_ldata.bge_status_block, 32); + } + bus_dmamap_sync(sc->bge_cdata.bge_status_tag, + sc->bge_cdata.bge_status_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); /* Turn on host coalescing state machine */ CSR_WRITE_4(sc, BGE_HCC_MODE, val | BGE_HCCMODE_ENABLE); From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 22:45:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE30F106566C; Sun, 15 Aug 2010 22:45:40 +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 ACB718FC12; Sun, 15 Aug 2010 22:45:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FMjerU074906; Sun, 15 Aug 2010 22:45:40 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FMjelN074904; Sun, 15 Aug 2010 22:45:40 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008152245.o7FMjelN074904@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 15 Aug 2010 22:45: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: r211370 - 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: Sun, 15 Aug 2010 22:45:40 -0000 Author: yongari Date: Sun Aug 15 22:45:40 2010 New Revision: 211370 URL: http://svn.freebsd.org/changeset/base/211370 Log: MFC r209741: Zero entire status block and add missing bus_dmamap_sync(9). Modified: stable/7/sys/dev/bge/if_bge.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/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Sun Aug 15 22:44:28 2010 (r211369) +++ stable/7/sys/dev/bge/if_bge.c Sun Aug 15 22:45:40 2010 (r211370) @@ -1787,15 +1787,19 @@ bge_blockinit(struct bge_softc *sc) BGE_ADDR_HI(sc->bge_ldata.bge_status_block_paddr)); CSR_WRITE_4(sc, BGE_HCC_STATUSBLK_ADDR_LO, BGE_ADDR_LO(sc->bge_ldata.bge_status_block_paddr)); - sc->bge_ldata.bge_status_block->bge_idx[0].bge_rx_prod_idx = 0; - sc->bge_ldata.bge_status_block->bge_idx[0].bge_tx_cons_idx = 0; /* Set up status block size. */ if (sc->bge_asicrev == BGE_ASICREV_BCM5700 && - sc->bge_chipid != BGE_CHIPID_BCM5700_C0) + sc->bge_chipid != BGE_CHIPID_BCM5700_C0) { val = BGE_STATBLKSZ_FULL; - else + bzero(sc->bge_ldata.bge_status_block, BGE_STATUS_BLK_SZ); + } else { val = BGE_STATBLKSZ_32BYTE; + bzero(sc->bge_ldata.bge_status_block, 32); + } + bus_dmamap_sync(sc->bge_cdata.bge_status_tag, + sc->bge_cdata.bge_status_map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); /* Turn on host coalescing state machine */ CSR_WRITE_4(sc, BGE_HCC_MODE, val | BGE_HCCMODE_ENABLE); From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 22:51:52 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80131106566B; Sun, 15 Aug 2010 22:51: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 6E3618FC17; Sun, 15 Aug 2010 22:51:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FMpqU5075151; Sun, 15 Aug 2010 22:51:52 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FMpqeD075149; Sun, 15 Aug 2010 22:51:52 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008152251.o7FMpqeD075149@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 15 Aug 2010 22:51: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: r211371 - 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: Sun, 15 Aug 2010 22:51:52 -0000 Author: yongari Date: Sun Aug 15 22:51:52 2010 New Revision: 211371 URL: http://svn.freebsd.org/changeset/base/211371 Log: MFC r210011,210013-210015: r210011: Make bge_stop_fw() static. While I'm here use ANSI function definitions. r210013: style. r210014: Fix error message for jumbo buffer allocation failure. r210015: Prefer PCIR_BAR macro over BGE_PCI_BAR0. Modified: stable/8/sys/dev/bge/if_bge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (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/sys/dev/e1000/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Sun Aug 15 22:45:40 2010 (r211370) +++ stable/8/sys/dev/bge/if_bge.c Sun Aug 15 22:51:52 2010 (r211371) @@ -437,6 +437,7 @@ static int bge_poll(struct ifnet *ifp, e static void bge_sig_post_reset(struct bge_softc *, int); static void bge_sig_legacy(struct bge_softc *, int); static void bge_sig_pre_reset(struct bge_softc *, int); +static void bge_stop_fw(struct bge_softc *); static int bge_reset(struct bge_softc *); static void bge_link_upd(struct bge_softc *); @@ -859,7 +860,7 @@ bge_miibus_writereg(device_t dev, int ph if (sc->bge_asicrev == BGE_ASICREV_BCM5906 && (reg == BRGPHY_MII_1000CTL || reg == BRGPHY_MII_AUXCTL)) - return(0); + return (0); /* Reading with autopolling on may trigger PCI errors */ autopoll = CSR_READ_4(sc, BGE_MI_MODE); @@ -1264,10 +1265,9 @@ bge_setvlan(struct bge_softc *sc) } static void -bge_sig_pre_reset(sc, type) - struct bge_softc *sc; - int type; +bge_sig_pre_reset(struct bge_softc *sc, int type) { + /* * Some chips don't like this so only do this if ASF is enabled */ @@ -1287,10 +1287,9 @@ bge_sig_pre_reset(sc, type) } static void -bge_sig_post_reset(sc, type) - struct bge_softc *sc; - int type; +bge_sig_post_reset(struct bge_softc *sc, int type) { + if (sc->bge_asf_mode & ASF_NEW_HANDSHAKE) { switch (type) { case BGE_RESET_START: @@ -1305,10 +1304,9 @@ bge_sig_post_reset(sc, type) } static void -bge_sig_legacy(sc, type) - struct bge_softc *sc; - int type; +bge_sig_legacy(struct bge_softc *sc, int type) { + if (sc->bge_asf_mode) { switch (type) { case BGE_RESET_START: @@ -1321,10 +1319,8 @@ bge_sig_legacy(sc, type) } } -void bge_stop_fw(struct bge_softc *); -void -bge_stop_fw(sc) - struct bge_softc *sc; +static void +bge_stop_fw(struct bge_softc *sc) { int i; @@ -2564,7 +2560,7 @@ bge_attach(device_t dev) */ pci_enable_busmaster(dev); - rid = BGE_PCI_BAR0; + rid = PCIR_BAR(0); sc->bge_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); @@ -3074,7 +3070,7 @@ bge_release_resources(struct bge_softc * if (sc->bge_res != NULL) bus_release_resource(dev, SYS_RES_MEMORY, - BGE_PCI_BAR0, sc->bge_res); + PCIR_BAR(0), sc->bge_res); if (sc->bge_ifp != NULL) if_free(sc->bge_ifp); @@ -3118,7 +3114,7 @@ bge_reset(struct bge_softc *sc) if (sc->bge_asicrev == BGE_ASICREV_BCM5752 || BGE_IS_5755_PLUS(sc)) { if (bootverbose) - device_printf(sc->bge_dev, "Disabling fastboot\n"); + device_printf(dev, "Disabling fastboot\n"); CSR_WRITE_4(sc, BGE_FASTBOOT_PC, 0x0); } @@ -3239,7 +3235,7 @@ bge_reset(struct bge_softc *sc) DELAY(100); } if (i == BGE_TIMEOUT) { - device_printf(sc->bge_dev, "reset timed out\n"); + device_printf(dev, "reset timed out\n"); return (1); } } else { @@ -3257,8 +3253,9 @@ bge_reset(struct bge_softc *sc) } if ((sc->bge_flags & BGE_FLAG_EADDR) && i == BGE_TIMEOUT) - device_printf(sc->bge_dev, "firmware handshake timed out, " - "found 0x%08x\n", val); + device_printf(dev, + "firmware handshake timed out, found 0x%08x\n", + val); } /* @@ -3310,7 +3307,7 @@ bge_reset(struct bge_softc *sc) } DELAY(10000); - return(0); + return (0); } static __inline void @@ -4298,7 +4295,8 @@ bge_init_locked(struct bge_softc *sc) if (ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + ETHER_VLAN_ENCAP_LEN > (MCLBYTES - ETHER_ALIGN)) { if (bge_init_rx_ring_jumbo(sc) != 0) { - device_printf(sc->bge_dev, "no memory for std Rx buffers.\n"); + device_printf(sc->bge_dev, + "no memory for jumbo Rx buffers.\n"); bge_stop(sc); return; } From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 22:53:46 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E00B6106564A; Sun, 15 Aug 2010 22:53: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 CE2B08FC19; Sun, 15 Aug 2010 22:53:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FMrkfL075266; Sun, 15 Aug 2010 22:53:46 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FMrkt9075264; Sun, 15 Aug 2010 22:53:46 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008152253.o7FMrkt9075264@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 15 Aug 2010 22:53:46 +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: r211372 - 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: Sun, 15 Aug 2010 22:53:47 -0000 Author: yongari Date: Sun Aug 15 22:53:46 2010 New Revision: 211372 URL: http://svn.freebsd.org/changeset/base/211372 Log: MFC r210011,210013-210015: r210011: Make bge_stop_fw() static. While I'm here use ANSI function definitions. r210013: style. r210014: Fix error message for jumbo buffer allocation failure. r210015: Prefer PCIR_BAR macro over BGE_PCI_BAR0. Modified: stable/7/sys/dev/bge/if_bge.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/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Sun Aug 15 22:51:52 2010 (r211371) +++ stable/7/sys/dev/bge/if_bge.c Sun Aug 15 22:53:46 2010 (r211372) @@ -437,6 +437,7 @@ static void bge_poll(struct ifnet *ifp, static void bge_sig_post_reset(struct bge_softc *, int); static void bge_sig_legacy(struct bge_softc *, int); static void bge_sig_pre_reset(struct bge_softc *, int); +static void bge_stop_fw(struct bge_softc *); static int bge_reset(struct bge_softc *); static void bge_link_upd(struct bge_softc *); @@ -859,7 +860,7 @@ bge_miibus_writereg(device_t dev, int ph if (sc->bge_asicrev == BGE_ASICREV_BCM5906 && (reg == BRGPHY_MII_1000CTL || reg == BRGPHY_MII_AUXCTL)) - return(0); + return (0); /* Reading with autopolling on may trigger PCI errors */ autopoll = CSR_READ_4(sc, BGE_MI_MODE); @@ -1264,10 +1265,9 @@ bge_setvlan(struct bge_softc *sc) } static void -bge_sig_pre_reset(sc, type) - struct bge_softc *sc; - int type; +bge_sig_pre_reset(struct bge_softc *sc, int type) { + /* * Some chips don't like this so only do this if ASF is enabled */ @@ -1287,10 +1287,9 @@ bge_sig_pre_reset(sc, type) } static void -bge_sig_post_reset(sc, type) - struct bge_softc *sc; - int type; +bge_sig_post_reset(struct bge_softc *sc, int type) { + if (sc->bge_asf_mode & ASF_NEW_HANDSHAKE) { switch (type) { case BGE_RESET_START: @@ -1305,10 +1304,9 @@ bge_sig_post_reset(sc, type) } static void -bge_sig_legacy(sc, type) - struct bge_softc *sc; - int type; +bge_sig_legacy(struct bge_softc *sc, int type) { + if (sc->bge_asf_mode) { switch (type) { case BGE_RESET_START: @@ -1321,10 +1319,8 @@ bge_sig_legacy(sc, type) } } -void bge_stop_fw(struct bge_softc *); -void -bge_stop_fw(sc) - struct bge_softc *sc; +static void +bge_stop_fw(struct bge_softc *sc) { int i; @@ -2564,7 +2560,7 @@ bge_attach(device_t dev) */ pci_enable_busmaster(dev); - rid = BGE_PCI_BAR0; + rid = PCIR_BAR(0); sc->bge_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE | PCI_RF_DENSE); @@ -3074,7 +3070,7 @@ bge_release_resources(struct bge_softc * if (sc->bge_res != NULL) bus_release_resource(dev, SYS_RES_MEMORY, - BGE_PCI_BAR0, sc->bge_res); + PCIR_BAR(0), sc->bge_res); if (sc->bge_ifp != NULL) if_free(sc->bge_ifp); @@ -3118,7 +3114,7 @@ bge_reset(struct bge_softc *sc) if (sc->bge_asicrev == BGE_ASICREV_BCM5752 || BGE_IS_5755_PLUS(sc)) { if (bootverbose) - device_printf(sc->bge_dev, "Disabling fastboot\n"); + device_printf(dev, "Disabling fastboot\n"); CSR_WRITE_4(sc, BGE_FASTBOOT_PC, 0x0); } @@ -3239,7 +3235,7 @@ bge_reset(struct bge_softc *sc) DELAY(100); } if (i == BGE_TIMEOUT) { - device_printf(sc->bge_dev, "reset timed out\n"); + device_printf(dev, "reset timed out\n"); return (1); } } else { @@ -3257,8 +3253,9 @@ bge_reset(struct bge_softc *sc) } if ((sc->bge_flags & BGE_FLAG_EADDR) && i == BGE_TIMEOUT) - device_printf(sc->bge_dev, "firmware handshake timed out, " - "found 0x%08x\n", val); + device_printf(dev, + "firmware handshake timed out, found 0x%08x\n", + val); } /* @@ -3310,7 +3307,7 @@ bge_reset(struct bge_softc *sc) } DELAY(10000); - return(0); + return (0); } static __inline void @@ -4294,7 +4291,8 @@ bge_init_locked(struct bge_softc *sc) if (ifp->if_mtu + ETHER_HDR_LEN + ETHER_CRC_LEN + ETHER_VLAN_ENCAP_LEN > (MCLBYTES - ETHER_ALIGN)) { if (bge_init_rx_ring_jumbo(sc) != 0) { - device_printf(sc->bge_dev, "no memory for std Rx buffers.\n"); + device_printf(sc->bge_dev, + "no memory for jumbo Rx buffers.\n"); bge_stop(sc); return; } From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 22:57:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E44A21065696; Sun, 15 Aug 2010 22:57:50 +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 B87AC8FC13; Sun, 15 Aug 2010 22:57:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FMvoCg075409; Sun, 15 Aug 2010 22:57:50 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FMvoHJ075406; Sun, 15 Aug 2010 22:57:50 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008152257.o7FMvoHJ075406@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 15 Aug 2010 22:57: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: r211373 - 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: Sun, 15 Aug 2010 22:57:51 -0000 Author: yongari Date: Sun Aug 15 22:57:50 2010 New Revision: 211373 URL: http://svn.freebsd.org/changeset/base/211373 Log: MFC r210083,210152: r210083: Remove enabling Data FIFO protection with indirect memory access. r165114 added that code and that change ignored the same logic committed in r135772. In addition, data FIFO protection should be selectively enabled instead of applying to all PCIe devices. While I'm here add BCM5785 to devices that do not require this fix. r210152: Use Miscellaneous Configuration Register bit definition instead of magic number. 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/cam/ (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/sys/dev/e1000/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Sun Aug 15 22:53:46 2010 (r211372) +++ stable/8/sys/dev/bge/if_bge.c Sun Aug 15 22:57:50 2010 (r211373) @@ -3143,7 +3143,7 @@ bge_reset(struct bge_softc *sc) * powered up in D0 uninitialized. */ if (BGE_IS_5705_PLUS(sc)) - reset |= 0x04000000; + reset |= BGE_MISCCFG_GPHY_PD_OVERRIDE; /* Issue global reset */ write_op(sc, BGE_MISC_CFG, reset); @@ -3272,11 +3272,6 @@ bge_reset(struct bge_softc *sc) DELAY(10); } - if (sc->bge_flags & BGE_FLAG_PCIE) { - reset = bge_readmem_ind(sc, 0x7C00); - bge_writemem_ind(sc, 0x7C00, reset | (1 << 25)); - } - /* Fix up byte swapping. */ CSR_WRITE_4(sc, BGE_MODE_CTL, BGE_DMA_SWAP_OPTIONS | BGE_MODECTL_BYTESWAP_DATA); @@ -3301,7 +3296,9 @@ bge_reset(struct bge_softc *sc) /* XXX: Broadcom Linux driver. */ if (sc->bge_flags & BGE_FLAG_PCIE && - sc->bge_chipid != BGE_CHIPID_BCM5750_A0) { + sc->bge_chipid != BGE_CHIPID_BCM5750_A0 && + sc->bge_asicrev != BGE_ASICREV_BCM5785) { + /* Enable Data FIFO protection. */ val = CSR_READ_4(sc, 0x7C00); CSR_WRITE_4(sc, 0x7C00, val | (1 << 25)); } Modified: stable/8/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/8/sys/dev/bge/if_bgereg.h Sun Aug 15 22:53:46 2010 (r211372) +++ stable/8/sys/dev/bge/if_bgereg.h Sun Aug 15 22:57:50 2010 (r211373) @@ -1823,6 +1823,7 @@ #define BGE_MISCCFG_BOARD_ID_5788 0x00010000 #define BGE_MISCCFG_BOARD_ID_5788M 0x00018000 #define BGE_MISCCFG_EPHY_IDDQ 0x00200000 +#define BGE_MISCCFG_GPHY_PD_OVERRIDE 0x04000000 #define BGE_32BITTIME_66MHZ (0x41 << 1) From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 22:59:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77D46106566B; Sun, 15 Aug 2010 22:59: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 4BC658FC08; Sun, 15 Aug 2010 22:59:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FMxa0Q075500; Sun, 15 Aug 2010 22:59:36 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FMxalI075497; Sun, 15 Aug 2010 22:59:36 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008152259.o7FMxalI075497@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 15 Aug 2010 22:59: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: r211374 - 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: Sun, 15 Aug 2010 22:59:36 -0000 Author: yongari Date: Sun Aug 15 22:59:35 2010 New Revision: 211374 URL: http://svn.freebsd.org/changeset/base/211374 Log: MFC r210083,210152: r210083: Remove enabling Data FIFO protection with indirect memory access. r165114 added that code and that change ignored the same logic committed in r135772. In addition, data FIFO protection should be selectively enabled instead of applying to all PCIe devices. While I'm here add BCM5785 to devices that do not require this fix. r210152: Use Miscellaneous Configuration Register bit definition instead of magic number. 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 Sun Aug 15 22:57:50 2010 (r211373) +++ stable/7/sys/dev/bge/if_bge.c Sun Aug 15 22:59:35 2010 (r211374) @@ -3143,7 +3143,7 @@ bge_reset(struct bge_softc *sc) * powered up in D0 uninitialized. */ if (BGE_IS_5705_PLUS(sc)) - reset |= 0x04000000; + reset |= BGE_MISCCFG_GPHY_PD_OVERRIDE; /* Issue global reset */ write_op(sc, BGE_MISC_CFG, reset); @@ -3272,11 +3272,6 @@ bge_reset(struct bge_softc *sc) DELAY(10); } - if (sc->bge_flags & BGE_FLAG_PCIE) { - reset = bge_readmem_ind(sc, 0x7C00); - bge_writemem_ind(sc, 0x7C00, reset | (1 << 25)); - } - /* Fix up byte swapping. */ CSR_WRITE_4(sc, BGE_MODE_CTL, BGE_DMA_SWAP_OPTIONS | BGE_MODECTL_BYTESWAP_DATA); @@ -3301,7 +3296,9 @@ bge_reset(struct bge_softc *sc) /* XXX: Broadcom Linux driver. */ if (sc->bge_flags & BGE_FLAG_PCIE && - sc->bge_chipid != BGE_CHIPID_BCM5750_A0) { + sc->bge_chipid != BGE_CHIPID_BCM5750_A0 && + sc->bge_asicrev != BGE_ASICREV_BCM5785) { + /* Enable Data FIFO protection. */ val = CSR_READ_4(sc, 0x7C00); CSR_WRITE_4(sc, 0x7C00, val | (1 << 25)); } Modified: stable/7/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/7/sys/dev/bge/if_bgereg.h Sun Aug 15 22:57:50 2010 (r211373) +++ stable/7/sys/dev/bge/if_bgereg.h Sun Aug 15 22:59:35 2010 (r211374) @@ -1823,6 +1823,7 @@ #define BGE_MISCCFG_BOARD_ID_5788 0x00010000 #define BGE_MISCCFG_BOARD_ID_5788M 0x00018000 #define BGE_MISCCFG_EPHY_IDDQ 0x00200000 +#define BGE_MISCCFG_GPHY_PD_OVERRIDE 0x04000000 #define BGE_32BITTIME_66MHZ (0x41 << 1) From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 23:02:41 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CFB61065698; Sun, 15 Aug 2010 23:02:41 +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 7141E8FC19; Sun, 15 Aug 2010 23:02:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FN2fGR075627; Sun, 15 Aug 2010 23:02:41 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FN2fFT075625; Sun, 15 Aug 2010 23:02:41 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008152302.o7FN2fFT075625@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 15 Aug 2010 23:02: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: r211375 - 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: Sun, 15 Aug 2010 23:02:41 -0000 Author: yongari Date: Sun Aug 15 23:02:41 2010 New Revision: 211375 URL: http://svn.freebsd.org/changeset/base/211375 Log: MFC r205651: Use pci_get_max_read_req() and pci_set_max_read_req() to set maximim read request size. Modified: stable/8/sys/dev/bge/if_bge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (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/sys/dev/e1000/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Sun Aug 15 22:59:35 2010 (r211374) +++ stable/8/sys/dev/bge/if_bge.c Sun Aug 15 23:02:41 2010 (r211375) @@ -423,7 +423,6 @@ static uint32_t bge_readreg_ind(struct b #endif static void bge_writemem_direct(struct bge_softc *, int, int); static void bge_writereg_ind(struct bge_softc *, int, int); -static void bge_set_max_readrq(struct bge_softc *); static int bge_miibus_readreg(device_t, int, int); static int bge_miibus_writereg(device_t, int, int, int); @@ -564,32 +563,6 @@ bge_writemem_ind(struct bge_softc *sc, i pci_write_config(dev, BGE_PCI_MEMWIN_BASEADDR, 0, 4); } -/* - * PCI Express only - */ -static void -bge_set_max_readrq(struct bge_softc *sc) -{ - device_t dev; - uint16_t val; - - dev = sc->bge_dev; - - val = pci_read_config(dev, sc->bge_expcap + PCIR_EXPRESS_DEVICE_CTL, 2); - if ((val & PCIM_EXP_CTL_MAX_READ_REQUEST) != - BGE_PCIE_DEVCTL_MAX_READRQ_4096) { - if (bootverbose) - device_printf(dev, "adjust device control 0x%04x ", - val); - val &= ~PCIM_EXP_CTL_MAX_READ_REQUEST; - val |= BGE_PCIE_DEVCTL_MAX_READRQ_4096; - pci_write_config(dev, sc->bge_expcap + PCIR_EXPRESS_DEVICE_CTL, - val, 2); - if (bootverbose) - printf("-> 0x%04x\n", val); - } -} - #ifdef notdef static uint32_t bge_readreg_ind(struct bge_softc *sc, int off) @@ -2705,7 +2678,8 @@ bge_attach(device_t dev) */ sc->bge_flags |= BGE_FLAG_PCIE; sc->bge_expcap = reg; - bge_set_max_readrq(sc); + if (pci_get_max_read_req(dev) != 4096) + pci_set_max_read_req(dev, 4096); } else { /* * Check if the device is in PCI-X Mode. From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 23:07:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3B3C1065674; Sun, 15 Aug 2010 23:07: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 A7C698FC13; Sun, 15 Aug 2010 23:07:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FN76Q8075751; Sun, 15 Aug 2010 23:07:06 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FN76MC075749; Sun, 15 Aug 2010 23:07:06 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008152307.o7FN76MC075749@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 15 Aug 2010 23:07: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: r211376 - 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: Sun, 15 Aug 2010 23:07:06 -0000 Author: yongari Date: Sun Aug 15 23:07:06 2010 New Revision: 211376 URL: http://svn.freebsd.org/changeset/base/211376 Log: MFC r205651: Use pci_get_max_read_req() and pci_set_max_read_req() to set maximim read request size. Modified: stable/7/sys/dev/bge/if_bge.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/bge/if_bge.c ============================================================================== --- stable/7/sys/dev/bge/if_bge.c Sun Aug 15 23:02:41 2010 (r211375) +++ stable/7/sys/dev/bge/if_bge.c Sun Aug 15 23:07:06 2010 (r211376) @@ -423,7 +423,6 @@ static uint32_t bge_readreg_ind(struct b #endif static void bge_writemem_direct(struct bge_softc *, int, int); static void bge_writereg_ind(struct bge_softc *, int, int); -static void bge_set_max_readrq(struct bge_softc *); static int bge_miibus_readreg(device_t, int, int); static int bge_miibus_writereg(device_t, int, int, int); @@ -564,32 +563,6 @@ bge_writemem_ind(struct bge_softc *sc, i pci_write_config(dev, BGE_PCI_MEMWIN_BASEADDR, 0, 4); } -/* - * PCI Express only - */ -static void -bge_set_max_readrq(struct bge_softc *sc) -{ - device_t dev; - uint16_t val; - - dev = sc->bge_dev; - - val = pci_read_config(dev, sc->bge_expcap + PCIR_EXPRESS_DEVICE_CTL, 2); - if ((val & PCIM_EXP_CTL_MAX_READ_REQUEST) != - BGE_PCIE_DEVCTL_MAX_READRQ_4096) { - if (bootverbose) - device_printf(dev, "adjust device control 0x%04x ", - val); - val &= ~PCIM_EXP_CTL_MAX_READ_REQUEST; - val |= BGE_PCIE_DEVCTL_MAX_READRQ_4096; - pci_write_config(dev, sc->bge_expcap + PCIR_EXPRESS_DEVICE_CTL, - val, 2); - if (bootverbose) - printf("-> 0x%04x\n", val); - } -} - #ifdef notdef static uint32_t bge_readreg_ind(struct bge_softc *sc, int off) @@ -2705,7 +2678,8 @@ bge_attach(device_t dev) */ sc->bge_flags |= BGE_FLAG_PCIE; sc->bge_expcap = reg; - bge_set_max_readrq(sc); + if (pci_get_max_read_req(dev) != 4096) + pci_set_max_read_req(dev, 4096); } else { /* * Check if the device is in PCI-X Mode. From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 23:11:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E97B1065670; Sun, 15 Aug 2010 23:11: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 7CB2C8FC08; Sun, 15 Aug 2010 23:11:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FNBceR075897; Sun, 15 Aug 2010 23:11:38 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FNBcpn075895; Sun, 15 Aug 2010 23:11:38 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008152311.o7FNBcpn075895@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 15 Aug 2010 23:11: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: r211377 - stable/8/sys/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: Sun, 15 Aug 2010 23:11:38 -0000 Author: yongari Date: Sun Aug 15 23:11:38 2010 New Revision: 211377 URL: http://svn.freebsd.org/changeset/base/211377 Log: MFC r210244: Implement WOL. WOL is supported on RTL8139B or newer controllers. PR: kern/148013 Modified: stable/8/sys/pci/if_rl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (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/sys/dev/e1000/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/pci/if_rl.c ============================================================================== --- stable/8/sys/pci/if_rl.c Sun Aug 15 23:07:06 2010 (r211376) +++ stable/8/sys/pci/if_rl.c Sun Aug 15 23:11:38 2010 (r211377) @@ -222,6 +222,8 @@ static int rl_suspend(device_t); static void rl_tick(void *); static void rl_txeof(struct rl_softc *); static void rl_watchdog(struct rl_softc *); +static void rl_setwol(struct rl_softc *); +static void rl_clrwol(struct rl_softc *); #ifdef RL_USEIOSPACE #define RL_RES SYS_RES_IOPORT @@ -803,7 +805,7 @@ rl_attach(device_t dev) struct rl_type *t; struct sysctl_ctx_list *ctx; struct sysctl_oid_list *children; - int error = 0, i, rid; + int error = 0, hwrev, i, pmc, rid; int unit; uint16_t rl_did = 0; char tn[32]; @@ -938,6 +940,25 @@ rl_attach(device_t dev) ifp->if_start = rl_start; ifp->if_init = rl_init; ifp->if_capabilities = IFCAP_VLAN_MTU; + /* Check WOL for RTL8139B or newer controllers. */ + if (sc->rl_type == RL_8139 && + pci_find_extcap(sc->rl_dev, PCIY_PMG, &pmc) == 0) { + hwrev = CSR_READ_4(sc, RL_TXCFG) & RL_TXCFG_HWREV; + switch (hwrev) { + case RL_HWREV_8139B: + case RL_HWREV_8130: + case RL_HWREV_8139C: + case RL_HWREV_8139D: + case RL_HWREV_8101: + case RL_HWREV_8100: + ifp->if_capabilities |= IFCAP_WOL; + /* Disable WOL. */ + rl_clrwol(sc); + break; + default: + break; + } + } ifp->if_capenable = ifp->if_capabilities; #ifdef DEVICE_POLLING ifp->if_capabilities |= IFCAP_POLLING; @@ -1926,7 +1947,7 @@ rl_ioctl(struct ifnet *ifp, u_long comma struct ifreq *ifr = (struct ifreq *)data; struct mii_data *mii; struct rl_softc *sc = ifp->if_softc; - int error = 0; + int error = 0, mask; switch (command) { case SIOCSIFFLAGS: @@ -1953,6 +1974,7 @@ rl_ioctl(struct ifnet *ifp, u_long comma error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command); break; case SIOCSIFCAP: + mask = ifr->ifr_reqcap ^ ifp->if_capenable; #ifdef DEVICE_POLLING if (ifr->ifr_reqcap & IFCAP_POLLING && !(ifp->if_capenable & IFCAP_POLLING)) { @@ -1978,6 +2000,15 @@ rl_ioctl(struct ifnet *ifp, u_long comma return (error); } #endif /* DEVICE_POLLING */ + if ((mask & IFCAP_WOL) != 0 && + (ifp->if_capabilities & IFCAP_WOL) != 0) { + if ((mask & IFCAP_WOL_UCAST) != 0) + ifp->if_capenable ^= IFCAP_WOL_UCAST; + if ((mask & IFCAP_WOL_MCAST) != 0) + ifp->if_capenable ^= IFCAP_WOL_MCAST; + if ((mask & IFCAP_WOL_MAGIC) != 0) + ifp->if_capenable ^= IFCAP_WOL_MAGIC; + } break; default: error = ether_ioctl(ifp, command, data); @@ -2066,6 +2097,7 @@ rl_suspend(device_t dev) RL_LOCK(sc); rl_stop(sc); + rl_setwol(sc); sc->suspended = 1; RL_UNLOCK(sc); @@ -2082,12 +2114,31 @@ rl_resume(device_t dev) { struct rl_softc *sc; struct ifnet *ifp; + int pmc; + uint16_t pmstat; sc = device_get_softc(dev); ifp = sc->rl_ifp; RL_LOCK(sc); + if ((ifp->if_capabilities & IFCAP_WOL) != 0 && + pci_find_extcap(sc->rl_dev, PCIY_PMG, &pmc) == 0) { + /* Disable PME and clear PME status. */ + pmstat = pci_read_config(sc->rl_dev, + pmc + PCIR_POWER_STATUS, 2); + if ((pmstat & PCIM_PSTAT_PMEENABLE) != 0) { + pmstat &= ~PCIM_PSTAT_PMEENABLE; + pci_write_config(sc->rl_dev, + pmc + PCIR_POWER_STATUS, pmstat, 2); + } + /* + * Clear WOL matching such that normal Rx filtering + * wouldn't interfere with WOL patterns. + */ + rl_clrwol(sc); + } + /* reinitialize interface if necessary */ if (ifp->if_flags & IFF_UP) rl_init_locked(sc); @@ -2112,7 +2163,93 @@ rl_shutdown(device_t dev) RL_LOCK(sc); rl_stop(sc); + /* + * Mark interface as down since otherwise we will panic if + * interrupt comes in later on, which can happen in some + * cases. + */ + sc->rl_ifp->if_flags &= ~IFF_UP; + rl_setwol(sc); RL_UNLOCK(sc); return (0); } + +static void +rl_setwol(struct rl_softc *sc) +{ + struct ifnet *ifp; + int pmc; + uint16_t pmstat; + uint8_t v; + + RL_LOCK_ASSERT(sc); + + ifp = sc->rl_ifp; + if ((ifp->if_capabilities & IFCAP_WOL) == 0) + return; + if (pci_find_extcap(sc->rl_dev, PCIY_PMG, &pmc) != 0) + return; + + /* Enable config register write. */ + CSR_WRITE_1(sc, RL_EECMD, RL_EE_MODE); + + /* Enable PME. */ + v = CSR_READ_1(sc, RL_CFG1); + v &= ~RL_CFG1_PME; + if ((ifp->if_capenable & IFCAP_WOL) != 0) + v |= RL_CFG1_PME; + CSR_WRITE_1(sc, RL_CFG1, v); + + v = CSR_READ_1(sc, RL_CFG3); + v &= ~(RL_CFG3_WOL_LINK | RL_CFG3_WOL_MAGIC); + if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0) + v |= RL_CFG3_WOL_MAGIC; + CSR_WRITE_1(sc, RL_CFG3, v); + + /* Config register write done. */ + CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_OFF); + + v = CSR_READ_1(sc, RL_CFG5); + v &= ~(RL_CFG5_WOL_BCAST | RL_CFG5_WOL_MCAST | RL_CFG5_WOL_UCAST); + v &= ~RL_CFG5_WOL_LANWAKE; + if ((ifp->if_capenable & IFCAP_WOL_UCAST) != 0) + v |= RL_CFG5_WOL_UCAST; + if ((ifp->if_capenable & IFCAP_WOL_MCAST) != 0) + v |= RL_CFG5_WOL_MCAST | RL_CFG5_WOL_BCAST; + if ((ifp->if_capenable & IFCAP_WOL) != 0) + v |= RL_CFG5_WOL_LANWAKE; + CSR_WRITE_1(sc, RL_CFG5, v); + /* Request PME if WOL is requested. */ + pmstat = pci_read_config(sc->rl_dev, pmc + PCIR_POWER_STATUS, 2); + pmstat &= ~(PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE); + if ((ifp->if_capenable & IFCAP_WOL) != 0) + pmstat |= PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE; + pci_write_config(sc->rl_dev, pmc + PCIR_POWER_STATUS, pmstat, 2); +} + +static void +rl_clrwol(struct rl_softc *sc) +{ + struct ifnet *ifp; + uint8_t v; + + ifp = sc->rl_ifp; + if ((ifp->if_capabilities & IFCAP_WOL) == 0) + return; + + /* Enable config register write. */ + CSR_WRITE_1(sc, RL_EECMD, RL_EE_MODE); + + v = CSR_READ_1(sc, RL_CFG3); + v &= ~(RL_CFG3_WOL_LINK | RL_CFG3_WOL_MAGIC); + CSR_WRITE_1(sc, RL_CFG3, v); + + /* Config register write done. */ + CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_OFF); + + v = CSR_READ_1(sc, RL_CFG5); + v &= ~(RL_CFG5_WOL_BCAST | RL_CFG5_WOL_MCAST | RL_CFG5_WOL_UCAST); + v &= ~RL_CFG5_WOL_LANWAKE; + CSR_WRITE_1(sc, RL_CFG5, v); +} From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 23:13:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71F891065672; Sun, 15 Aug 2010 23:13:09 +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 602908FC22; Sun, 15 Aug 2010 23:13:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FND9Ac075971; Sun, 15 Aug 2010 23:13:09 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FND9WN075969; Sun, 15 Aug 2010 23:13:09 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008152313.o7FND9WN075969@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 15 Aug 2010 23:13:09 +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: r211378 - stable/7/sys/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: Sun, 15 Aug 2010 23:13:09 -0000 Author: yongari Date: Sun Aug 15 23:13:09 2010 New Revision: 211378 URL: http://svn.freebsd.org/changeset/base/211378 Log: MFC r210244: Implement WOL. WOL is supported on RTL8139B or newer controllers. PR: kern/148013 Modified: stable/7/sys/pci/if_rl.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/pci/if_rl.c ============================================================================== --- stable/7/sys/pci/if_rl.c Sun Aug 15 23:11:38 2010 (r211377) +++ stable/7/sys/pci/if_rl.c Sun Aug 15 23:13:09 2010 (r211378) @@ -221,6 +221,8 @@ static int rl_suspend(device_t); static void rl_tick(void *); static void rl_txeof(struct rl_softc *); static void rl_watchdog(struct rl_softc *); +static void rl_setwol(struct rl_softc *); +static void rl_clrwol(struct rl_softc *); #ifdef RL_USEIOSPACE #define RL_RES SYS_RES_IOPORT @@ -800,7 +802,7 @@ rl_attach(device_t dev) struct ifnet *ifp; struct rl_softc *sc; struct rl_type *t; - int error = 0, i, rid; + int error = 0, hwrev, i, pmc, rid; int unit; uint16_t rl_did = 0; @@ -926,6 +928,25 @@ rl_attach(device_t dev) ifp->if_start = rl_start; ifp->if_init = rl_init; ifp->if_capabilities = IFCAP_VLAN_MTU; + /* Check WOL for RTL8139B or newer controllers. */ + if (sc->rl_type == RL_8139 && + pci_find_extcap(sc->rl_dev, PCIY_PMG, &pmc) == 0) { + hwrev = CSR_READ_4(sc, RL_TXCFG) & RL_TXCFG_HWREV; + switch (hwrev) { + case RL_HWREV_8139B: + case RL_HWREV_8130: + case RL_HWREV_8139C: + case RL_HWREV_8139D: + case RL_HWREV_8101: + case RL_HWREV_8100: + ifp->if_capabilities |= IFCAP_WOL; + /* Disable WOL. */ + rl_clrwol(sc); + break; + default: + break; + } + } ifp->if_capenable = ifp->if_capabilities; #ifdef DEVICE_POLLING ifp->if_capabilities |= IFCAP_POLLING; @@ -1776,7 +1797,7 @@ rl_ioctl(struct ifnet *ifp, u_long comma struct ifreq *ifr = (struct ifreq *)data; struct mii_data *mii; struct rl_softc *sc = ifp->if_softc; - int error = 0; + int error = 0, mask; switch (command) { case SIOCSIFFLAGS: @@ -1803,6 +1824,7 @@ rl_ioctl(struct ifnet *ifp, u_long comma error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command); break; case SIOCSIFCAP: + mask = ifr->ifr_reqcap ^ ifp->if_capenable; #ifdef DEVICE_POLLING if (ifr->ifr_reqcap & IFCAP_POLLING && !(ifp->if_capenable & IFCAP_POLLING)) { @@ -1828,6 +1850,15 @@ rl_ioctl(struct ifnet *ifp, u_long comma return (error); } #endif /* DEVICE_POLLING */ + if ((mask & IFCAP_WOL) != 0 && + (ifp->if_capabilities & IFCAP_WOL) != 0) { + if ((mask & IFCAP_WOL_UCAST) != 0) + ifp->if_capenable ^= IFCAP_WOL_UCAST; + if ((mask & IFCAP_WOL_MCAST) != 0) + ifp->if_capenable ^= IFCAP_WOL_MCAST; + if ((mask & IFCAP_WOL_MAGIC) != 0) + ifp->if_capenable ^= IFCAP_WOL_MAGIC; + } break; default: error = ether_ioctl(ifp, command, data); @@ -1916,6 +1947,7 @@ rl_suspend(device_t dev) RL_LOCK(sc); rl_stop(sc); + rl_setwol(sc); sc->suspended = 1; RL_UNLOCK(sc); @@ -1932,12 +1964,31 @@ rl_resume(device_t dev) { struct rl_softc *sc; struct ifnet *ifp; + int pmc; + uint16_t pmstat; sc = device_get_softc(dev); ifp = sc->rl_ifp; RL_LOCK(sc); + if ((ifp->if_capabilities & IFCAP_WOL) != 0 && + pci_find_extcap(sc->rl_dev, PCIY_PMG, &pmc) == 0) { + /* Disable PME and clear PME status. */ + pmstat = pci_read_config(sc->rl_dev, + pmc + PCIR_POWER_STATUS, 2); + if ((pmstat & PCIM_PSTAT_PMEENABLE) != 0) { + pmstat &= ~PCIM_PSTAT_PMEENABLE; + pci_write_config(sc->rl_dev, + pmc + PCIR_POWER_STATUS, pmstat, 2); + } + /* + * Clear WOL matching such that normal Rx filtering + * wouldn't interfere with WOL patterns. + */ + rl_clrwol(sc); + } + /* reinitialize interface if necessary */ if (ifp->if_flags & IFF_UP) rl_init_locked(sc); @@ -1962,7 +2013,93 @@ rl_shutdown(device_t dev) RL_LOCK(sc); rl_stop(sc); + /* + * Mark interface as down since otherwise we will panic if + * interrupt comes in later on, which can happen in some + * cases. + */ + sc->rl_ifp->if_flags &= ~IFF_UP; + rl_setwol(sc); RL_UNLOCK(sc); return (0); } + +static void +rl_setwol(struct rl_softc *sc) +{ + struct ifnet *ifp; + int pmc; + uint16_t pmstat; + uint8_t v; + + RL_LOCK_ASSERT(sc); + + ifp = sc->rl_ifp; + if ((ifp->if_capabilities & IFCAP_WOL) == 0) + return; + if (pci_find_extcap(sc->rl_dev, PCIY_PMG, &pmc) != 0) + return; + + /* Enable config register write. */ + CSR_WRITE_1(sc, RL_EECMD, RL_EE_MODE); + + /* Enable PME. */ + v = CSR_READ_1(sc, RL_CFG1); + v &= ~RL_CFG1_PME; + if ((ifp->if_capenable & IFCAP_WOL) != 0) + v |= RL_CFG1_PME; + CSR_WRITE_1(sc, RL_CFG1, v); + + v = CSR_READ_1(sc, RL_CFG3); + v &= ~(RL_CFG3_WOL_LINK | RL_CFG3_WOL_MAGIC); + if ((ifp->if_capenable & IFCAP_WOL_MAGIC) != 0) + v |= RL_CFG3_WOL_MAGIC; + CSR_WRITE_1(sc, RL_CFG3, v); + + /* Config register write done. */ + CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_OFF); + + v = CSR_READ_1(sc, RL_CFG5); + v &= ~(RL_CFG5_WOL_BCAST | RL_CFG5_WOL_MCAST | RL_CFG5_WOL_UCAST); + v &= ~RL_CFG5_WOL_LANWAKE; + if ((ifp->if_capenable & IFCAP_WOL_UCAST) != 0) + v |= RL_CFG5_WOL_UCAST; + if ((ifp->if_capenable & IFCAP_WOL_MCAST) != 0) + v |= RL_CFG5_WOL_MCAST | RL_CFG5_WOL_BCAST; + if ((ifp->if_capenable & IFCAP_WOL) != 0) + v |= RL_CFG5_WOL_LANWAKE; + CSR_WRITE_1(sc, RL_CFG5, v); + /* Request PME if WOL is requested. */ + pmstat = pci_read_config(sc->rl_dev, pmc + PCIR_POWER_STATUS, 2); + pmstat &= ~(PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE); + if ((ifp->if_capenable & IFCAP_WOL) != 0) + pmstat |= PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE; + pci_write_config(sc->rl_dev, pmc + PCIR_POWER_STATUS, pmstat, 2); +} + +static void +rl_clrwol(struct rl_softc *sc) +{ + struct ifnet *ifp; + uint8_t v; + + ifp = sc->rl_ifp; + if ((ifp->if_capabilities & IFCAP_WOL) == 0) + return; + + /* Enable config register write. */ + CSR_WRITE_1(sc, RL_EECMD, RL_EE_MODE); + + v = CSR_READ_1(sc, RL_CFG3); + v &= ~(RL_CFG3_WOL_LINK | RL_CFG3_WOL_MAGIC); + CSR_WRITE_1(sc, RL_CFG3, v); + + /* Config register write done. */ + CSR_WRITE_1(sc, RL_EECMD, RL_EEMODE_OFF); + + v = CSR_READ_1(sc, RL_CFG5); + v &= ~(RL_CFG5_WOL_BCAST | RL_CFG5_WOL_MCAST | RL_CFG5_WOL_UCAST); + v &= ~RL_CFG5_WOL_LANWAKE; + CSR_WRITE_1(sc, RL_CFG5, v); +} From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 23:26:47 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4AE9D1065672; Sun, 15 Aug 2010 23:26: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 1F2C88FC15; Sun, 15 Aug 2010 23:26:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FNQla2076567; Sun, 15 Aug 2010 23:26:47 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FNQlfo076565; Sun, 15 Aug 2010 23:26:47 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008152326.o7FNQlfo076565@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 15 Aug 2010 23:26: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: r211379 - stable/8/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2010 23:26:47 -0000 Author: yongari Date: Sun Aug 15 23:26:46 2010 New Revision: 211379 URL: http://svn.freebsd.org/changeset/base/211379 Log: MFC r207391: - Pass flow control settings back to bce(4). Modified: stable/8/sys/dev/mii/brgphy.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (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/sys/dev/e1000/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/mii/brgphy.c ============================================================================== --- stable/8/sys/dev/mii/brgphy.c Sun Aug 15 23:13:09 2010 (r211378) +++ stable/8/sys/dev/mii/brgphy.c Sun Aug 15 23:26:46 2010 (r211379) @@ -685,16 +685,15 @@ brgphy_status(struct mii_softc *sc) } -#if 0 - /* Todo: Change bge/bce to use these settings. */ + /* Todo: Change bge to use these settings. */ - /* Fetch flow control settings from the PHY */ + /* Fetch flow control settings from the copper PHY. */ if ((sc->mii_flags & MIIF_HAVEFIBER) == 0) { - /* Set FLAG0 is RX is enabled and FLAG1 if TX is enabled */ + /* Set FLAG0 if RX is enabled and FLAG1 if TX is enabled */ if ((anar & BRGPHY_ANAR_PC) && (anlpar & BRGPHY_ANLPAR_PC)) { mii->mii_media_active |= IFM_FLAG0 | IFM_FLAG1; } else if (!(anar & BRGPHY_ANAR_PC) && (anlpar & BRGPHY_ANAR_ASP) && - (anlpar & BRPHY_ANLPAR_PC) && (anlpar & BRGPHY_ANLPAR_ASP)) { + (anlpar & BRGPHY_ANLPAR_PC) && (anlpar & BRGPHY_ANLPAR_ASP)) { mii->mii_media_active |= IFM_FLAG1; } else if ((anar & BRGPHY_ANAR_PC) && (anar & BRGPHY_ANAR_ASP) && !(anlpar & BRGPHY_ANLPAR_PC) && (anlpar & BRGPHY_ANLPAR_ASP)) { @@ -703,7 +702,6 @@ brgphy_status(struct mii_softc *sc) } /* Todo: Add support for fiber settings too. */ -#endif brgphy_status_exit: From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 23:28:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 104D910656A4; Sun, 15 Aug 2010 23:28: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 F2E758FC15; Sun, 15 Aug 2010 23:28:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FNSBPq076766; Sun, 15 Aug 2010 23:28:11 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FNSBsS076764; Sun, 15 Aug 2010 23:28:11 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008152328.o7FNSBsS076764@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 15 Aug 2010 23:28: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: r211380 - stable/7/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2010 23:28:12 -0000 Author: yongari Date: Sun Aug 15 23:28:11 2010 New Revision: 211380 URL: http://svn.freebsd.org/changeset/base/211380 Log: MFC r207391: - Pass flow control settings back to bce(4). Modified: stable/7/sys/dev/mii/brgphy.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/mii/brgphy.c ============================================================================== --- stable/7/sys/dev/mii/brgphy.c Sun Aug 15 23:26:46 2010 (r211379) +++ stable/7/sys/dev/mii/brgphy.c Sun Aug 15 23:28:11 2010 (r211380) @@ -673,16 +673,15 @@ brgphy_status(struct mii_softc *sc) } -#if 0 - /* Todo: Change bge/bce to use these settings. */ + /* Todo: Change bge to use these settings. */ - /* Fetch flow control settings from the PHY */ + /* Fetch flow control settings from the copper PHY. */ if ((sc->mii_flags & MIIF_HAVEFIBER) == 0) { - /* Set FLAG0 is RX is enabled and FLAG1 if TX is enabled */ + /* Set FLAG0 if RX is enabled and FLAG1 if TX is enabled */ if ((anar & BRGPHY_ANAR_PC) && (anlpar & BRGPHY_ANLPAR_PC)) { mii->mii_media_active |= IFM_FLAG0 | IFM_FLAG1; } else if (!(anar & BRGPHY_ANAR_PC) && (anlpar & BRGPHY_ANAR_ASP) && - (anlpar & BRPHY_ANLPAR_PC) && (anlpar & BRGPHY_ANLPAR_ASP)) { + (anlpar & BRGPHY_ANLPAR_PC) && (anlpar & BRGPHY_ANLPAR_ASP)) { mii->mii_media_active |= IFM_FLAG1; } else if ((anar & BRGPHY_ANAR_PC) && (anar & BRGPHY_ANAR_ASP) && !(anlpar & BRGPHY_ANLPAR_PC) && (anlpar & BRGPHY_ANLPAR_ASP)) { @@ -691,7 +690,6 @@ brgphy_status(struct mii_softc *sc) } /* Todo: Add support for fiber settings too. */ -#endif brgphy_status_exit: From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 23:30:54 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FCD51065696; Sun, 15 Aug 2010 23:30: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 0D07D8FC1C; Sun, 15 Aug 2010 23:30:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FNUsDi077106; Sun, 15 Aug 2010 23:30:54 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FNUrPg077103; Sun, 15 Aug 2010 23:30:53 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008152330.o7FNUrPg077103@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 15 Aug 2010 23:30: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: r211381 - 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: Sun, 15 Aug 2010 23:30:54 -0000 Author: yongari Date: Sun Aug 15 23:30:53 2010 New Revision: 211381 URL: http://svn.freebsd.org/changeset/base/211381 Log: MFC r207411: - Enable flow control. - Print device details only when verbose boot is enabled. - Add debug output for shared memory access. - Add debug statistics (checksum offload & VLAN frame counters). - Modify TX path to update consumer index for each frame completed rather than updating the consumer index only once for a group of frames to improve small packet performance. - Print driver/firmware pulse messages only when verbose boot is enabled. - Add debug sysctl to clear statistics. - Fix more style(9) violations. 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/cam/ (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/sys/dev/e1000/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/bce/if_bce.c ============================================================================== --- stable/8/sys/dev/bce/if_bce.c Sun Aug 15 23:28:11 2010 (r211380) +++ stable/8/sys/dev/bce/if_bce.c Sun Aug 15 23:30:53 2010 (r211381) @@ -303,7 +303,7 @@ static void bce_dump_txbd (struct bce_s 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 *, @@ -368,7 +368,7 @@ 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 *, +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 *); @@ -379,7 +379,7 @@ static void bce_release_resources (struc /****************************************************************************/ static int bce_fw_sync (struct bce_softc *, u32); static void bce_load_rv2p_fw (struct bce_softc *, u32 *, u32, u32); -static void bce_load_cpu_fw (struct bce_softc *, +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 *); @@ -401,21 +401,21 @@ static int bce_blockinit (struct bce_ 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 *, +static struct mbuf *bce_tso_setup (struct bce_softc *, struct mbuf **, u16 *); static int bce_tx_encap (struct bce_softc *, struct mbuf **); static void bce_start_locked (struct ifnet *); @@ -566,7 +566,7 @@ bce_probe(device_t dev) /* Print out the device identity. */ snprintf(descbuf, BCE_DEVDESC_MAX, "%s (%c%d)", - t->bce_name, (((pci_read_config(dev, + t->bce_name, (((pci_read_config(dev, PCIR_REVID, 4) & 0xf0) >> 4) + 'A'), (pci_read_config(dev, PCIR_REVID, 4) & 0xf)); @@ -593,57 +593,60 @@ bce_probe(device_t dev) static void bce_print_adapter_info(struct bce_softc *sc) { - int i = 0; + int i = 0; DBENTER(BCE_VERBOSE_LOAD); - 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)); - - /* Bus info. */ - if (sc->bce_flags & BCE_PCIE_FLAG) { - printf("Bus (PCIe x%d, ", sc->link_width); - switch (sc->link_speed) { - case 1: printf("2.5Gbps); "); break; - case 2: printf("5Gbps); "); break; - default: printf("Unknown link speed); "); + if (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)); + + + /* Bus info. */ + if (sc->bce_flags & BCE_PCIE_FLAG) { + printf("Bus (PCIe x%d, ", sc->link_width); + switch (sc->link_speed) { + case 1: printf("2.5Gbps); "); break; + case 2: printf("5Gbps); "); break; + default: printf("Unknown link speed); "); + } + } else { + printf("Bus (PCI%s, %s, %dMHz); ", + ((sc->bce_flags & BCE_PCIX_FLAG) ? "-X" : ""), + ((sc->bce_flags & BCE_PCI_32BIT_FLAG) ? + "32-bit" : "64-bit"), sc->bus_speed_mhz); } - } else { - printf("Bus (PCI%s, %s, %dMHz); ", - ((sc->bce_flags & BCE_PCIX_FLAG) ? "-X" : ""), - ((sc->bce_flags & BCE_PCI_32BIT_FLAG) ? - "32-bit" : "64-bit"), sc->bus_speed_mhz); - } - /* Firmware version and device features. */ - printf("B/C (%s); Flags (", sc->bce_bc_ver); + /* Firmware version and device features. */ + printf("B/C (%s); Flags (", sc->bce_bc_ver); -#ifdef BCE_JUMBO_HDRSPLIT - printf("SPLT"); - i++; -#endif + #ifdef BCE_JUMBO_HDRSPLIT + printf("SPLT"); + i++; + #endif - if (sc->bce_flags & BCE_USING_MSI_FLAG) { - if (i > 0) printf("|"); - printf("MSI"); i++; - } + if (sc->bce_flags & BCE_USING_MSI_FLAG) { + if (i > 0) printf("|"); + printf("MSI"); i++; + } - if (sc->bce_flags & BCE_USING_MSIX_FLAG) { - if (i > 0) printf("|"); - printf("MSI-X"); i++; - } + if (sc->bce_flags & BCE_USING_MSIX_FLAG) { + if (i > 0) printf("|"); + printf("MSI-X"); i++; + } - if (sc->bce_phy_flags & BCE_PHY_2_5G_CAPABLE_FLAG) { - if (i > 0) printf("|"); - printf("2.5G"); i++; - } + if (sc->bce_phy_flags & BCE_PHY_2_5G_CAPABLE_FLAG) { + if (i > 0) printf("|"); + printf("2.5G"); i++; + } - if (sc->bce_flags & BCE_MFW_ENABLE_FLAG) { - if (i > 0) printf("|"); - printf("MFW); MFW (%s)\n", sc->bce_mfw_ver); - } else { - printf(")\n"); + if (sc->bce_flags & BCE_MFW_ENABLE_FLAG) { + if (i > 0) printf("|"); + printf("MFW); MFW (%s)\n", sc->bce_mfw_ver); + } else { + printf(")\n"); + } } DBEXIT(BCE_VERBOSE_LOAD); @@ -785,13 +788,13 @@ bce_attach(device_t dev) (bce_msi_enable >= 1) && (sc->bce_msi_count == 0)) { sc->bce_msi_count = 1; if ((error = pci_alloc_msi(dev, &sc->bce_msi_count)) != 0) { - BCE_PRINTF("%s(%d): MSI allocation failed! error = %d\n", - __FILE__, __LINE__, error); + BCE_PRINTF("%s(%d): MSI allocation failed! " + "error = %d\n", __FILE__, __LINE__, error); sc->bce_msi_count = 0; pci_release_msi(dev); } else { - DBPRINT(sc, BCE_INFO_LOAD, "%s(): Using MSI interrupt.\n", - __FUNCTION__); + DBPRINT(sc, BCE_INFO_LOAD, "%s(): Using MSI " + "interrupt.\n", __FUNCTION__); sc->bce_flags |= BCE_USING_MSI_FLAG; if ((BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5709) || (BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5716)) @@ -848,10 +851,11 @@ bce_attach(device_t dev) case BCE_CHIP_ID_5709_B0: case BCE_CHIP_ID_5709_B1: case BCE_CHIP_ID_5709_B2: - BCE_PRINTF("%s(%d): Unsupported controller revision (%c%d)!\n", - __FILE__, __LINE__, - (((pci_read_config(dev, PCIR_REVID, 4) & 0xf0) >> 4) + 'A'), - (pci_read_config(dev, PCIR_REVID, 4) & 0xf)); + BCE_PRINTF("%s(%d): Unsupported controller " + "revision (%c%d)!\n", __FILE__, __LINE__, + (((pci_read_config(dev, PCIR_REVID, 4) & + 0xf0) >> 4) + 'A'), (pci_read_config(dev, + PCIR_REVID, 4) & 0xf)); rc = ENODEV; goto bce_attach_fail; } @@ -1072,19 +1076,19 @@ bce_attach(device_t dev) ifp = sc->bce_ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { BCE_PRINTF("%s(%d): Interface allocation failed!\n", - __FILE__, __LINE__); + __FILE__, __LINE__); rc = ENXIO; goto bce_attach_fail; } /* Initialize the ifnet interface. */ - ifp->if_softc = sc; + ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; - ifp->if_ioctl = bce_ioctl; - ifp->if_start = bce_start; - ifp->if_init = bce_init; - ifp->if_mtu = ETHERMTU; + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; + ifp->if_ioctl = bce_ioctl; + ifp->if_start = bce_start; + ifp->if_init = bce_init; + ifp->if_mtu = ETHERMTU; if (bce_tso_enable) { ifp->if_hwassist = BCE_IF_HWASSIST | CSUM_TSO; @@ -1095,7 +1099,7 @@ bce_attach(device_t dev) ifp->if_capabilities = BCE_IF_CAPABILITIES; } - ifp->if_capenable = ifp->if_capabilities; + ifp->if_capenable = ifp->if_capabilities; /* * Assume standard mbuf sizes for buffer allocation. @@ -1105,16 +1109,17 @@ bce_attach(device_t dev) #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->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; + 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 ifp->if_snd.ifq_drv_maxlen = USABLE_TX_BD; @@ -1126,14 +1131,14 @@ bce_attach(device_t dev) else ifp->if_baudrate = IF_Mbps(1000); - /* Handle any special PHY initialization for SerDes PHYs. */ - bce_init_media(sc); + /* Handle any special PHY initialization for SerDes PHYs. */ + bce_init_media(sc); /* MII child bus by probing the PHY. */ if (mii_phy_probe(dev, &sc->bce_miibus, bce_ifmedia_upd, bce_ifmedia_sts)) { BCE_PRINTF("%s(%d): No PHY found on child MII bus!\n", - __FILE__, __LINE__); + __FILE__, __LINE__); rc = ENXIO; goto bce_attach_fail; } @@ -1155,7 +1160,7 @@ bce_attach(device_t dev) if (rc) { BCE_PRINTF("%s(%d): Failed to setup IRQ!\n", - __FILE__, __LINE__); + __FILE__, __LINE__); bce_detach(dev); goto bce_attach_exit; } @@ -1396,6 +1401,9 @@ bce_reg_wr_ind(struct bce_softc *sc, u32 static void bce_shmem_wr(struct bce_softc *sc, u32 offset, u32 val) { + DBPRINT(sc, BCE_VERBOSE_FIRMWARE, "%s(): Writing 0x%08X to " + "0x%08X\n", __FUNCTION__, val, offset); + bce_reg_wr_ind(sc, sc->bce_shmem_base + offset, val); } @@ -1411,7 +1419,12 @@ bce_shmem_wr(struct bce_softc *sc, u32 o static u32 bce_shmem_rd(struct bce_softc *sc, u32 offset) { - return (bce_reg_rd_ind(sc, sc->bce_shmem_base + offset)); + u32 val = bce_reg_rd_ind(sc, sc->bce_shmem_base + offset); + + DBPRINT(sc, BCE_VERBOSE_FIRMWARE, "%s(): Reading 0x%08X from " + "0x%08X\n", __FUNCTION__, val, offset); + + return val; } @@ -1430,9 +1443,9 @@ bce_ctx_rd(struct bce_softc *sc, u32 cid { u32 idx, offset, retry_cnt = 5, val; - DBRUNIF((cid_addr > MAX_CID_ADDR || ctx_offset & 0x3 || cid_addr & CTX_MASK), - BCE_PRINTF("%s(): Invalid CID address: 0x%08X.\n", - __FUNCTION__, cid_addr)); + DBRUNIF((cid_addr > MAX_CID_ADDR || ctx_offset & 0x3 || + cid_addr & CTX_MASK), BCE_PRINTF("%s(): Invalid CID " + "address: 0x%08X.\n", __FUNCTION__, cid_addr)); offset = ctx_offset + cid_addr; @@ -1450,8 +1463,8 @@ bce_ctx_rd(struct bce_softc *sc, u32 cid if (val & BCE_CTX_CTX_CTRL_READ_REQ) BCE_PRINTF("%s(%d); Unable to read CTX memory: " - "cid_addr = 0x%08X, offset = 0x%08X!\n", - __FILE__, __LINE__, cid_addr, ctx_offset); + "cid_addr = 0x%08X, offset = 0x%08X!\n", + __FILE__, __LINE__, cid_addr, ctx_offset); val = REG_RD(sc, BCE_CTX_CTX_DATA); } else { @@ -1487,7 +1500,7 @@ bce_ctx_wr(struct bce_softc *sc, u32 cid DBRUNIF((cid_addr > MAX_CID_ADDR || ctx_offset & 0x3 || cid_addr & CTX_MASK), BCE_PRINTF("%s(): Invalid CID address: 0x%08X.\n", - __FUNCTION__, cid_addr)); + __FUNCTION__, cid_addr)); if ((BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5709) || (BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5716)) { @@ -1504,8 +1517,8 @@ bce_ctx_wr(struct bce_softc *sc, u32 cid if (val & BCE_CTX_CTX_CTRL_WRITE_REQ) BCE_PRINTF("%s(%d); Unable to write CTX memory: " - "cid_addr = 0x%08X, offset = 0x%08X!\n", - __FILE__, __LINE__, cid_addr, ctx_offset); + "cid_addr = 0x%08X, offset = 0x%08X!\n", + __FILE__, __LINE__, cid_addr, ctx_offset); } else { REG_WR(sc, BCE_CTX_DATA_ADR, offset); @@ -1706,54 +1719,73 @@ bce_miibus_statchg(device_t dev) 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); + BCE_EMAC_MODE_MAC_LOOP | BCE_EMAC_MODE_FORCE_LINK | + BCE_EMAC_MODE_25G); - /* Set MII or GMII interface based on the speed negotiated by the PHY. */ + /* 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, "Enabling 10Mb interface.\n"); + DBPRINT(sc, BCE_INFO_PHY, + "Enabling 10Mb interface.\n"); val |= BCE_EMAC_MODE_PORT_MII_10; break; } /* fall-through */ case IFM_100_TX: - DBPRINT(sc, BCE_INFO, "Enabling MII interface.\n"); + DBPRINT(sc, BCE_INFO_PHY, "Enabling MII interface.\n"); val |= BCE_EMAC_MODE_PORT_MII; break; case IFM_2500_SX: - DBPRINT(sc, BCE_INFO, "Enabling 2.5G MAC mode.\n"); + 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, "Enabling GMII interface.\n"); + DBPRINT(sc, BCE_INFO_PHY, "Enabling GMII interface.\n"); val |= BCE_EMAC_MODE_PORT_GMII; break; default: - DBPRINT(sc, BCE_INFO, "Unknown speed, enabling default GMII " - "interface.\n"); + DBPRINT(sc, BCE_INFO_PHY, "Unknown link speed, enabling " + "default GMII interface.\n"); val |= BCE_EMAC_MODE_PORT_GMII; } - /* Set half or full duplex based on the duplicity negotiated by the PHY. */ + /* Set half or full duplex based on PHY settings. */ if ((mii->mii_media_active & IFM_GMASK) == IFM_HDX) { - DBPRINT(sc, BCE_INFO, "Setting Half-Duplex interface.\n"); + DBPRINT(sc, BCE_INFO_PHY, + "Setting Half-Duplex interface.\n"); val |= BCE_EMAC_MODE_HALF_DUPLEX; } else - DBPRINT(sc, BCE_INFO, "Setting Full-Duplex interface.\n"); + DBPRINT(sc, BCE_INFO_PHY, + "Setting Full-Duplex interface.\n"); REG_WR(sc, BCE_EMAC_MODE, val); -#if 0 - /* ToDo: Enable flow control support in brgphy and bge. */ /* FLAG0 is set if RX is enabled and FLAG1 if TX is enabled */ - if (mii->mii_media_active & IFM_FLAG0) + if (mii->mii_media_active & IFM_FLAG0) { + 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); - if (mii->mii_media_active & IFM_FLAG1) - BCE_SETBIT(sc, BCE_EMAC_RX_MODE, BCE_EMAC_TX_MODE_FLOW_EN); -#endif + } else { + DBPRINT(sc, BCE_INFO_PHY, + "%s(): Disabling RX flow control.\n", __FUNCTION__); + BCE_CLRBIT(sc, BCE_EMAC_RX_MODE, BCE_EMAC_RX_MODE_FLOW_EN); + } + + if (mii->mii_media_active & IFM_FLAG1) { + 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); + sc->bce_flags |= BCE_USING_TX_FLOW_CONTROL; + } else { + DBPRINT(sc, BCE_INFO_PHY, + "%s(): Disabling TX flow control.\n", __FUNCTION__); + BCE_CLRBIT(sc, BCE_EMAC_TX_MODE, BCE_EMAC_TX_MODE_FLOW_EN); + sc->bce_flags &= ~BCE_USING_TX_FLOW_CONTROL; + } + + /* ToDo: Update watermarks in bce_init_rx_context(). */ DBEXIT(BCE_VERBOSE_PHY); } @@ -1926,8 +1958,8 @@ bce_enable_nvram_access(struct bce_softc val = REG_RD(sc, BCE_NVM_ACCESS_ENABLE); /* Enable both bits, even on read. */ - REG_WR(sc, BCE_NVM_ACCESS_ENABLE, - val | BCE_NVM_ACCESS_ENABLE_EN | BCE_NVM_ACCESS_ENABLE_WR_EN); + REG_WR(sc, BCE_NVM_ACCESS_ENABLE, val | + BCE_NVM_ACCESS_ENABLE_EN | BCE_NVM_ACCESS_ENABLE_WR_EN); DBEXIT(BCE_VERBOSE_NVRAM); } @@ -1951,9 +1983,8 @@ bce_disable_nvram_access(struct bce_soft val = REG_RD(sc, BCE_NVM_ACCESS_ENABLE); /* Disable both bits, even after read. */ - REG_WR(sc, BCE_NVM_ACCESS_ENABLE, - val & ~(BCE_NVM_ACCESS_ENABLE_EN | - BCE_NVM_ACCESS_ENABLE_WR_EN)); + REG_WR(sc, BCE_NVM_ACCESS_ENABLE, val & + ~(BCE_NVM_ACCESS_ENABLE_EN | BCE_NVM_ACCESS_ENABLE_WR_EN)); DBEXIT(BCE_VERBOSE_NVRAM); } @@ -1983,7 +2014,7 @@ bce_nvram_erase_page(struct bce_softc *s /* Build an erase command. */ cmd = BCE_NVM_COMMAND_ERASE | BCE_NVM_COMMAND_WR | - BCE_NVM_COMMAND_DOIT; + BCE_NVM_COMMAND_DOIT; /* * Clear the DONE bit separately, set the NVRAM adress to erase, @@ -2026,8 +2057,8 @@ bce_nvram_erase_page_exit: /* 0 on success and the 32 bit value read, positive value on failure. */ /****************************************************************************/ static int -bce_nvram_read_dword(struct bce_softc *sc, u32 offset, u8 *ret_val, - u32 cmd_flags) +bce_nvram_read_dword(struct bce_softc *sc, + u32 offset, u8 *ret_val, u32 cmd_flags) { u32 cmd; int i, rc = 0; @@ -2040,8 +2071,8 @@ bce_nvram_read_dword(struct bce_softc *s /* Calculate the offset for buffered flash if translation is used. */ if (sc->bce_flash_info->flags & BCE_NV_TRANSLATE) { offset = ((offset / sc->bce_flash_info->page_size) << - sc->bce_flash_info->page_bits) + - (offset % sc->bce_flash_info->page_size); + sc->bce_flash_info->page_bits) + + (offset % sc->bce_flash_info->page_size); } /* @@ -2070,8 +2101,8 @@ bce_nvram_read_dword(struct bce_softc *s /* Check for errors. */ if (i >= NVRAM_TIMEOUT_COUNT) { - BCE_PRINTF("%s(%d): Timeout error reading NVRAM at offset 0x%08X!\n", - __FILE__, __LINE__, offset); + BCE_PRINTF("%s(%d): Timeout error reading NVRAM at " + "offset 0x%08X!\n", __FILE__, __LINE__, offset); rc = EBUSY; } @@ -2106,8 +2137,8 @@ bce_nvram_write_dword(struct bce_softc * /* Calculate the offset for buffered flash if translation is used. */ if (sc->bce_flash_info->flags & BCE_NV_TRANSLATE) { offset = ((offset / sc->bce_flash_info->page_size) << - sc->bce_flash_info->page_bits) + - (offset % sc->bce_flash_info->page_size); + sc->bce_flash_info->page_bits) + + (offset % sc->bce_flash_info->page_size); } /* @@ -2129,8 +2160,8 @@ bce_nvram_write_dword(struct bce_softc * break; } if (j >= NVRAM_TIMEOUT_COUNT) { - BCE_PRINTF("%s(%d): Timeout error writing NVRAM at offset 0x%08X\n", - __FILE__, __LINE__, offset); + BCE_PRINTF("%s(%d): Timeout error writing NVRAM at " + "offset 0x%08X\n", __FILE__, __LINE__, offset); rc = EBUSY; } @@ -2232,7 +2263,7 @@ bce_init_nvram(struct bce_softc *sc) if (j == entry_count) { sc->bce_flash_info = NULL; BCE_PRINTF("%s(%d): Unknown Flash NVRAM found!\n", - __FILE__, __LINE__); + __FILE__, __LINE__); rc = ENODEV; } @@ -2246,8 +2277,8 @@ bce_init_nvram_get_flash_size: sc->bce_flash_size = sc->bce_flash_info->total_size; DBPRINT(sc, BCE_INFO_LOAD, "%s(): Found %s, size = 0x%08X\n", - __FUNCTION__, sc->bce_flash_info->name, - sc->bce_flash_info->total_size); + __FUNCTION__, sc->bce_flash_info->name, + sc->bce_flash_info->total_size); DBEXIT(BCE_VERBOSE_NVRAM); return rc; @@ -2604,7 +2635,8 @@ bce_nvram_test(struct bce_softc *sc) * the magic value at offset 0. */ if ((rc = bce_nvram_read(sc, 0, data, 4)) != 0) { - BCE_PRINTF("%s(%d): Unable to read NVRAM!\n", __FILE__, __LINE__); + BCE_PRINTF("%s(%d): Unable to read NVRAM!\n", + __FILE__, __LINE__); goto bce_nvram_test_exit; } @@ -2615,9 +2647,9 @@ bce_nvram_test(struct bce_softc *sc) magic = bce_be32toh(buf[0]); if (magic != BCE_NVRAM_MAGIC) { rc = ENODEV; - BCE_PRINTF("%s(%d): Invalid NVRAM magic value! Expected: 0x%08X, " - "Found: 0x%08X\n", - __FILE__, __LINE__, BCE_NVRAM_MAGIC, magic); + BCE_PRINTF("%s(%d): Invalid NVRAM magic value! " + "Expected: 0x%08X, Found: 0x%08X\n", + __FILE__, __LINE__, BCE_NVRAM_MAGIC, magic); goto bce_nvram_test_exit; } @@ -2626,26 +2658,27 @@ bce_nvram_test(struct bce_softc *sc) * configuration data. */ if ((rc = bce_nvram_read(sc, 0x100, data, BCE_NVRAM_SIZE)) != 0) { - BCE_PRINTF("%s(%d): Unable to read Manufacturing Information from " - "NVRAM!\n", __FILE__, __LINE__); + BCE_PRINTF("%s(%d): Unable to read manufacturing " + "Information from NVRAM!\n", __FILE__, __LINE__); goto bce_nvram_test_exit; } csum = ether_crc32_le(data, 0x100); if (csum != BCE_CRC32_RESIDUAL) { rc = ENODEV; - BCE_PRINTF("%s(%d): Invalid Manufacturing Information NVRAM CRC! " - "Expected: 0x%08X, Found: 0x%08X\n", - __FILE__, __LINE__, BCE_CRC32_RESIDUAL, csum); + BCE_PRINTF("%s(%d): Invalid manufacturing information " + "NVRAM CRC! Expected: 0x%08X, Found: 0x%08X\n", + __FILE__, __LINE__, BCE_CRC32_RESIDUAL, csum); goto bce_nvram_test_exit; } csum = ether_crc32_le(data + 0x100, 0x100); if (csum != BCE_CRC32_RESIDUAL) { rc = ENODEV; - BCE_PRINTF("%s(%d): Invalid Feature Configuration Information " - "NVRAM CRC! Expected: 0x%08X, Found: 08%08X\n", - __FILE__, __LINE__, BCE_CRC32_RESIDUAL, csum); + BCE_PRINTF("%s(%d): Invalid feature configuration " + "information NVRAM CRC! Expected: 0x%08X, " + "Found: 08%08X\n", __FILE__, __LINE__, + BCE_CRC32_RESIDUAL, csum); } bce_nvram_test_exit: @@ -2666,7 +2699,7 @@ bce_get_media(struct bce_softc *sc) { u32 val; - DBENTER(BCE_VERBOSE); + DBENTER(BCE_VERBOSE_PHY); /* Assume PHY address for copper controllers. */ sc->bce_phy_addr = 1; @@ -2692,10 +2725,10 @@ bce_get_media(struct bce_softc *sc) } if (val & BCE_MISC_DUAL_MEDIA_CTRL_STRAP_OVERRIDE) - strap = (val & + strap = (val & BCE_MISC_DUAL_MEDIA_CTRL_PHY_CTRL) >> 21; else - strap = (val & + strap = (val & BCE_MISC_DUAL_MEDIA_CTRL_PHY_CTRL_STRAP) >> 8; if (pci_get_function(sc->bce_dev) == 0) { @@ -2744,7 +2777,7 @@ bce_get_media(struct bce_softc *sc) val = bce_shmem_rd(sc, BCE_SHARED_HW_CFG_CONFIG); if (val & BCE_SHARED_HW_CFG_PHY_2_5G) { - sc->bce_phy_flags |= + sc->bce_phy_flags |= BCE_PHY_2_5G_CAPABLE_FLAG; DBPRINT(sc, BCE_INFO_LOAD, "Found 2.5Gb " "capable adapter\n"); @@ -2758,7 +2791,7 @@ bce_get_media_exit: DBPRINT(sc, (BCE_INFO_LOAD | BCE_INFO_PHY), "Using PHY address %d.\n", sc->bce_phy_addr); - DBEXIT(BCE_VERBOSE); + DBEXIT(BCE_VERBOSE_PHY); } @@ -3056,7 +3089,9 @@ bce_dma_map_addr(void *arg, bus_dma_segm /* Simulate a mapping failure. */ DBRUNIF(DB_RANDOMTRUE(dma_map_addr_failed_sim_control), - error = ENOMEM); + error = ENOMEM); + + /* ToDo: How to increment debug sim_count variable here? */ /* Check for an error and signal the caller that an error occurred. */ if (error) { @@ -3154,7 +3189,7 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - DBPRINT(sc, BCE_INFO, "%s(): status_block_paddr = 0x%jX\n", + DBPRINT(sc, BCE_INFO_LOAD, "%s(): status_block_paddr = 0x%jX\n", __FUNCTION__, (uintmax_t) sc->status_block_paddr); /* @@ -3193,7 +3228,7 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - DBPRINT(sc, BCE_INFO, "%s(): stats_block_paddr = 0x%jX\n", + DBPRINT(sc, BCE_INFO_LOAD, "%s(): stats_block_paddr = 0x%jX\n", __FUNCTION__, (uintmax_t) sc->stats_block_paddr); /* BCM5709 uses host memory as cache for context memory. */ @@ -3217,8 +3252,8 @@ bce_dma_alloc(device_t dev) BCE_DMA_BOUNDARY, sc->max_bus_addr, BUS_SPACE_MAXADDR, NULL, NULL, BCM_PAGE_SIZE, 1, BCM_PAGE_SIZE, 0, NULL, NULL, &sc->ctx_tag)) { - BCE_PRINTF("%s(%d): Could not allocate CTX DMA tag!\n", - __FILE__, __LINE__); + BCE_PRINTF("%s(%d): Could not allocate CTX " + "DMA tag!\n", __FILE__, __LINE__); rc = ENOMEM; goto bce_dma_alloc_exit; } @@ -3248,8 +3283,9 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - DBPRINT(sc, BCE_INFO, "%s(): ctx_paddr[%d] = 0x%jX\n", - __FUNCTION__, i, (uintmax_t) sc->ctx_paddr[i]); + DBPRINT(sc, BCE_INFO_LOAD, "%s(): ctx_paddr[%d] " + "= 0x%jX\n", __FUNCTION__, i, + (uintmax_t) sc->ctx_paddr[i]); } } @@ -3262,15 +3298,15 @@ bce_dma_alloc(device_t dev) sc->max_bus_addr, BUS_SPACE_MAXADDR, NULL, NULL, BCE_TX_CHAIN_PAGE_SZ, 1, BCE_TX_CHAIN_PAGE_SZ, 0, NULL, NULL, &sc->tx_bd_chain_tag)) { - BCE_PRINTF("%s(%d): Could not allocate TX descriptor chain " - "DMA tag!\n", __FILE__, __LINE__); + BCE_PRINTF("%s(%d): Could not allocate TX descriptor " + "chain DMA tag!\n", __FILE__, __LINE__); rc = ENOMEM; goto bce_dma_alloc_exit; } for (i = 0; i < TX_PAGES; i++) { - if(bus_dmamem_alloc(sc->tx_bd_chain_tag, + if(bus_dmamem_alloc(sc->tx_bd_chain_tag, (void **)&sc->tx_bd_chain[i], BUS_DMA_NOWAIT, &sc->tx_bd_chain_map[i])) { BCE_PRINTF("%s(%d): Could not allocate TX descriptor " @@ -3291,8 +3327,9 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - DBPRINT(sc, BCE_INFO, "%s(): tx_bd_chain_paddr[%d] = 0x%jX\n", - __FUNCTION__, i, (uintmax_t) sc->tx_bd_chain_paddr[i]); + DBPRINT(sc, BCE_INFO_LOAD, "%s(): tx_bd_chain_paddr[%d] = " + "0x%jX\n", __FUNCTION__, i, + (uintmax_t) sc->tx_bd_chain_paddr[i]); } /* Check the required size before mapping to conserve resources. */ @@ -3368,8 +3405,9 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - DBPRINT(sc, BCE_INFO, "%s(): rx_bd_chain_paddr[%d] = 0x%jX\n", - __FUNCTION__, i, (uintmax_t) sc->rx_bd_chain_paddr[i]); + DBPRINT(sc, BCE_INFO_LOAD, "%s(): rx_bd_chain_paddr[%d] = " + "0x%jX\n", __FUNCTION__, i, + (uintmax_t) sc->rx_bd_chain_paddr[i]); } /* @@ -3383,9 +3421,10 @@ bce_dma_alloc(device_t dev) #endif max_segments = 1; - DBPRINT(sc, BCE_INFO, "%s(): Creating rx_mbuf_tag (max size = 0x%jX " - "max segments = %d, max segment size = 0x%jX)\n", __FUNCTION__, - (uintmax_t) max_size, max_segments, (uintmax_t) max_seg_size); + DBPRINT(sc, BCE_INFO_LOAD, "%s(): Creating rx_mbuf_tag " + "(max size = 0x%jX max segments = %d, max segment " + "size = 0x%jX)\n", __FUNCTION__, (uintmax_t) max_size, + max_segments, (uintmax_t) max_seg_size); if (bus_dma_tag_create(sc->parent_tag, 1, BCE_DMA_BOUNDARY, sc->max_bus_addr, BUS_SPACE_MAXADDR, NULL, NULL, max_size, @@ -3429,7 +3468,7 @@ bce_dma_alloc(device_t dev) (void **)&sc->pg_bd_chain[i], BUS_DMA_NOWAIT, &sc->pg_bd_chain_map[i])) { BCE_PRINTF("%s(%d): Could not allocate page " - "descriptor chain DMA memory!\n", + "descriptor chain DMA memory!\n", __FILE__, __LINE__); rc = ENOMEM; goto bce_dma_alloc_exit; @@ -3437,7 +3476,7 @@ bce_dma_alloc(device_t dev) bzero((char *)sc->pg_bd_chain[i], BCE_PG_CHAIN_PAGE_SZ); - error = bus_dmamap_load(sc->pg_bd_chain_tag, + error = bus_dmamap_load(sc->pg_bd_chain_tag, sc->pg_bd_chain_map[i], sc->pg_bd_chain[i], BCE_PG_CHAIN_PAGE_SZ, bce_dma_map_addr, &sc->pg_bd_chain_paddr[i], BUS_DMA_NOWAIT); @@ -3449,8 +3488,9 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - DBPRINT(sc, BCE_INFO, "%s(): pg_bd_chain_paddr[%d] = 0x%jX\n", - __FUNCTION__, i, (uintmax_t) sc->pg_bd_chain_paddr[i]); + DBPRINT(sc, BCE_INFO_LOAD, "%s(): pg_bd_chain_paddr[%d] = " + "0x%jX\n", __FUNCTION__, i, + (uintmax_t) sc->pg_bd_chain_paddr[i]); } /* @@ -3524,7 +3564,7 @@ bce_release_resources(struct bce_softc * if (sc->bce_res_mem != NULL) { DBPRINT(sc, BCE_INFO_RESET, "Releasing PCI memory.\n"); - bus_release_resource(dev, SYS_RES_MEMORY, PCIR_BAR(0), + bus_release_resource(dev, SYS_RES_MEMORY, PCIR_BAR(0), sc->bce_res_mem); } @@ -3582,7 +3622,7 @@ bce_fw_sync(struct bce_softc *sc, u32 ms DELAY(1000); } - /* If we've timed out, tell the bootcode that we've stopped waiting. */ + /* If we've timed out, tell bootcode that we've stopped waiting. */ if (((val & BCE_FW_MSG_ACK) != (msg_data & BCE_DRV_MSG_SEQ)) && ((msg_data & BCE_DRV_MSG_DATA) != BCE_DRV_MSG_DATA_WAIT0)) { @@ -4319,22 +4359,22 @@ bce_init_cpus(struct bce_softc *sc) (BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5716)) { if ((BCE_CHIP_REV(sc) == BCE_CHIP_REV_Ax)) { - bce_load_rv2p_fw(sc, bce_xi90_rv2p_proc1, - sizeof(bce_xi90_rv2p_proc1), RV2P_PROC1); - bce_load_rv2p_fw(sc, bce_xi90_rv2p_proc2, - sizeof(bce_xi90_rv2p_proc2), RV2P_PROC2); + bce_load_rv2p_fw(sc, bce_xi90_rv2p_proc1, + sizeof(bce_xi90_rv2p_proc1), RV2P_PROC1); + bce_load_rv2p_fw(sc, bce_xi90_rv2p_proc2, + sizeof(bce_xi90_rv2p_proc2), RV2P_PROC2); } else { - bce_load_rv2p_fw(sc, bce_xi_rv2p_proc1, - sizeof(bce_xi_rv2p_proc1), RV2P_PROC1); - bce_load_rv2p_fw(sc, bce_xi_rv2p_proc2, - sizeof(bce_xi_rv2p_proc2), RV2P_PROC2); + bce_load_rv2p_fw(sc, bce_xi_rv2p_proc1, + sizeof(bce_xi_rv2p_proc1), RV2P_PROC1); + bce_load_rv2p_fw(sc, bce_xi_rv2p_proc2, + sizeof(bce_xi_rv2p_proc2), RV2P_PROC2); } } else { - bce_load_rv2p_fw(sc, bce_rv2p_proc1, - sizeof(bce_rv2p_proc1), RV2P_PROC1); + bce_load_rv2p_fw(sc, bce_rv2p_proc1, + sizeof(bce_rv2p_proc1), RV2P_PROC1); bce_load_rv2p_fw(sc, bce_rv2p_proc2, - sizeof(bce_rv2p_proc2), RV2P_PROC2); + sizeof(bce_rv2p_proc2), RV2P_PROC2); } bce_init_rxp_cpu(sc); @@ -4373,7 +4413,7 @@ bce_init_ctx(struct bce_softc *sc) * in host memory so prepare the host memory * for access. */ - val = BCE_CTX_COMMAND_ENABLED | + val = BCE_CTX_COMMAND_ENABLED | BCE_CTX_COMMAND_MEM_INIT | (1 << 12); val |= (BCM_PAGE_BITS - 8) << 16; REG_WR(sc, BCE_CTX_COMMAND, val); @@ -4406,7 +4446,7 @@ bce_init_ctx(struct bce_softc *sc) /* Verify the context memory write was successful. */ for (j = 0; j < retry_cnt; j++) { val = REG_RD(sc, BCE_CTX_HOST_PAGE_TBL_CTRL); - if ((val & + if ((val & BCE_CTX_HOST_PAGE_TBL_CTRL_WRITE_REQ) == 0) break; DELAY(5); @@ -4461,6 +4501,7 @@ bce_get_mac_addr(struct bce_softc *sc) u32 mac_lo = 0, mac_hi = 0; DBENTER(BCE_VERBOSE_RESET); + /* * The NetXtreme II bootcode populates various NIC * power-on and runtime configuration items in a @@ -4475,7 +4516,7 @@ bce_get_mac_addr(struct bce_softc *sc) if ((mac_lo == 0) && (mac_hi == 0)) { BCE_PRINTF("%s(%d): Invalid Ethernet address!\n", - __FILE__, __LINE__); + __FILE__, __LINE__); } else { sc->eaddr[0] = (u_char)(mac_hi >> 8); sc->eaddr[1] = (u_char)(mac_hi >> 0); @@ -4485,7 +4526,8 @@ bce_get_mac_addr(struct bce_softc *sc) sc->eaddr[5] = (u_char)(mac_lo >> 0); } - DBPRINT(sc, BCE_INFO_MISC, "Permanent Ethernet address = %6D\n", sc->eaddr, ":"); + DBPRINT(sc, BCE_INFO_MISC, "Permanent Ethernet " + "address = %6D\n", sc->eaddr, ":"); DBEXIT(BCE_VERBOSE_RESET); } @@ -4505,14 +4547,15 @@ bce_set_mac_addr(struct bce_softc *sc) /* ToDo: Add support for setting multiple MAC addresses. */ DBENTER(BCE_VERBOSE_RESET); - DBPRINT(sc, BCE_INFO_MISC, "Setting Ethernet address = %6D\n", sc->eaddr, ":"); + DBPRINT(sc, BCE_INFO_MISC, "Setting Ethernet address = " + "%6D\n", sc->eaddr, ":"); val = (mac_addr[0] << 8) | mac_addr[1]; REG_WR(sc, BCE_EMAC_MAC_MATCH0, val); val = (mac_addr[2] << 24) | (mac_addr[3] << 16) | - (mac_addr[4] << 8) | mac_addr[5]; + (mac_addr[4] << 8) | mac_addr[5]; REG_WR(sc, BCE_EMAC_MAC_MATCH1, val); @@ -4598,20 +4641,20 @@ bce_reset(struct bce_softc *sc, u32 rese DBENTER(BCE_VERBOSE_RESET); DBPRINT(sc, BCE_VERBOSE_RESET, "%s(): reset_code = 0x%08X\n", - __FUNCTION__, reset_code); + __FUNCTION__, reset_code); /* Wait for pending PCI transactions to complete. */ REG_WR(sc, BCE_MISC_ENABLE_CLR_BITS, - BCE_MISC_ENABLE_CLR_BITS_TX_DMA_ENABLE | - BCE_MISC_ENABLE_CLR_BITS_DMA_ENGINE_ENABLE | - BCE_MISC_ENABLE_CLR_BITS_RX_DMA_ENABLE | - BCE_MISC_ENABLE_CLR_BITS_HOST_COALESCE_ENABLE); + BCE_MISC_ENABLE_CLR_BITS_TX_DMA_ENABLE | + BCE_MISC_ENABLE_CLR_BITS_DMA_ENGINE_ENABLE | + BCE_MISC_ENABLE_CLR_BITS_RX_DMA_ENABLE | + BCE_MISC_ENABLE_CLR_BITS_HOST_COALESCE_ENABLE); val = REG_RD(sc, BCE_MISC_ENABLE_CLR_BITS); DELAY(5); /* Disable DMA */ if ((BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5709) || - (BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5716)) { + (BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5716)) { val = REG_RD(sc, BCE_MISC_NEW_CORE_CTL); val &= ~BCE_MISC_NEW_CORE_CTL_DMA_ENABLE; REG_WR(sc, BCE_MISC_NEW_CORE_CTL, val); @@ -4634,26 +4677,26 @@ bce_reset(struct bce_softc *sc, u32 rese /* Chip reset. */ if ((BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5709) || - (BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5716)) { + (BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5716)) { REG_WR(sc, BCE_MISC_COMMAND, BCE_MISC_COMMAND_SW_RESET); REG_RD(sc, BCE_MISC_COMMAND); DELAY(5); val = BCE_PCICFG_MISC_CONFIG_REG_WINDOW_ENA | - BCE_PCICFG_MISC_CONFIG_TARGET_MB_WORD_SWAP; + BCE_PCICFG_MISC_CONFIG_TARGET_MB_WORD_SWAP; pci_write_config(sc->bce_dev, BCE_PCICFG_MISC_CONFIG, val, 4); } else { val = BCE_PCICFG_MISC_CONFIG_CORE_RST_REQ | - BCE_PCICFG_MISC_CONFIG_REG_WINDOW_ENA | - BCE_PCICFG_MISC_CONFIG_TARGET_MB_WORD_SWAP; + BCE_PCICFG_MISC_CONFIG_REG_WINDOW_ENA | + BCE_PCICFG_MISC_CONFIG_TARGET_MB_WORD_SWAP; REG_WR(sc, BCE_PCICFG_MISC_CONFIG, val); /* Allow up to 30us for reset to complete. */ for (i = 0; i < 10; i++) { val = REG_RD(sc, BCE_PCICFG_MISC_CONFIG); if ((val & (BCE_PCICFG_MISC_CONFIG_CORE_RST_REQ | - BCE_PCICFG_MISC_CONFIG_CORE_RST_BSY)) == 0) { + BCE_PCICFG_MISC_CONFIG_CORE_RST_BSY)) == 0) { break; } DELAY(10); @@ -4661,9 +4704,9 @@ bce_reset(struct bce_softc *sc, u32 rese /* Check that reset completed successfully. */ if (val & (BCE_PCICFG_MISC_CONFIG_CORE_RST_REQ | - BCE_PCICFG_MISC_CONFIG_CORE_RST_BSY)) { + BCE_PCICFG_MISC_CONFIG_CORE_RST_BSY)) { BCE_PRINTF("%s(%d): Reset failed!\n", - __FILE__, __LINE__); + __FILE__, __LINE__); rc = EBUSY; goto bce_reset_exit; } @@ -4673,7 +4716,7 @@ bce_reset(struct bce_softc *sc, u32 rese val = REG_RD(sc, BCE_PCI_SWAP_DIAG0); if (val != 0x01020304) { BCE_PRINTF("%s(%d): Byte swap is incorrect!\n", - __FILE__, __LINE__); + __FILE__, __LINE__); rc = ENODEV; goto bce_reset_exit; } @@ -4685,8 +4728,8 @@ bce_reset(struct bce_softc *sc, u32 rese /* Wait for the firmware to finish its initialization. */ rc = bce_fw_sync(sc, BCE_DRV_MSG_DATA_WAIT1 | reset_code); if (rc) - BCE_PRINTF("%s(%d): Firmware did not complete initialization!\n", - __FILE__, __LINE__); + BCE_PRINTF("%s(%d): Firmware did not complete " + "initialization!\n", __FILE__, __LINE__); bce_reset_exit: DBEXIT(BCE_VERBOSE_RESET); @@ -4709,13 +4752,13 @@ bce_chipinit(struct bce_softc *sc) * channels and PCI clock compensation delay. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 23:32:23 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D201E106566B; Sun, 15 Aug 2010 23:32: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 BF7048FC15; Sun, 15 Aug 2010 23:32:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FNWNoS077465; Sun, 15 Aug 2010 23:32:23 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FNWNBT077462; Sun, 15 Aug 2010 23:32:23 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008152332.o7FNWNBT077462@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 15 Aug 2010 23:32:23 +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: r211382 - 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: Sun, 15 Aug 2010 23:32:24 -0000 Author: yongari Date: Sun Aug 15 23:32:23 2010 New Revision: 211382 URL: http://svn.freebsd.org/changeset/base/211382 Log: MFC r207411: - Enable flow control. - Print device details only when verbose boot is enabled. - Add debug output for shared memory access. - Add debug statistics (checksum offload & VLAN frame counters). - Modify TX path to update consumer index for each frame completed rather than updating the consumer index only once for a group of frames to improve small packet performance. - Print driver/firmware pulse messages only when verbose boot is enabled. - Add debug sysctl to clear statistics. - Fix more style(9) violations. 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 Sun Aug 15 23:30:53 2010 (r211381) +++ stable/7/sys/dev/bce/if_bce.c Sun Aug 15 23:32:23 2010 (r211382) @@ -303,7 +303,7 @@ static void bce_dump_txbd (struct bce_s 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 *, @@ -368,7 +368,7 @@ 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 *, +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 *); @@ -379,7 +379,7 @@ static void bce_release_resources (struc /****************************************************************************/ static int bce_fw_sync (struct bce_softc *, u32); static void bce_load_rv2p_fw (struct bce_softc *, u32 *, u32, u32); -static void bce_load_cpu_fw (struct bce_softc *, +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 *); @@ -401,21 +401,21 @@ static int bce_blockinit (struct bce_ 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 *, +static struct mbuf *bce_tso_setup (struct bce_softc *, struct mbuf **, u16 *); static int bce_tx_encap (struct bce_softc *, struct mbuf **); static void bce_start_locked (struct ifnet *); @@ -566,7 +566,7 @@ bce_probe(device_t dev) /* Print out the device identity. */ snprintf(descbuf, BCE_DEVDESC_MAX, "%s (%c%d)", - t->bce_name, (((pci_read_config(dev, + t->bce_name, (((pci_read_config(dev, PCIR_REVID, 4) & 0xf0) >> 4) + 'A'), (pci_read_config(dev, PCIR_REVID, 4) & 0xf)); @@ -593,57 +593,60 @@ bce_probe(device_t dev) static void bce_print_adapter_info(struct bce_softc *sc) { - int i = 0; + int i = 0; DBENTER(BCE_VERBOSE_LOAD); - 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)); - - /* Bus info. */ - if (sc->bce_flags & BCE_PCIE_FLAG) { - printf("Bus (PCIe x%d, ", sc->link_width); - switch (sc->link_speed) { - case 1: printf("2.5Gbps); "); break; - case 2: printf("5Gbps); "); break; - default: printf("Unknown link speed); "); + if (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)); + + + /* Bus info. */ + if (sc->bce_flags & BCE_PCIE_FLAG) { + printf("Bus (PCIe x%d, ", sc->link_width); + switch (sc->link_speed) { + case 1: printf("2.5Gbps); "); break; + case 2: printf("5Gbps); "); break; + default: printf("Unknown link speed); "); + } + } else { + printf("Bus (PCI%s, %s, %dMHz); ", + ((sc->bce_flags & BCE_PCIX_FLAG) ? "-X" : ""), + ((sc->bce_flags & BCE_PCI_32BIT_FLAG) ? + "32-bit" : "64-bit"), sc->bus_speed_mhz); } - } else { - printf("Bus (PCI%s, %s, %dMHz); ", - ((sc->bce_flags & BCE_PCIX_FLAG) ? "-X" : ""), - ((sc->bce_flags & BCE_PCI_32BIT_FLAG) ? - "32-bit" : "64-bit"), sc->bus_speed_mhz); - } - /* Firmware version and device features. */ - printf("B/C (%s); Flags (", sc->bce_bc_ver); + /* Firmware version and device features. */ + printf("B/C (%s); Flags (", sc->bce_bc_ver); -#ifdef BCE_JUMBO_HDRSPLIT - printf("SPLT"); - i++; -#endif + #ifdef BCE_JUMBO_HDRSPLIT + printf("SPLT"); + i++; + #endif - if (sc->bce_flags & BCE_USING_MSI_FLAG) { - if (i > 0) printf("|"); - printf("MSI"); i++; - } + if (sc->bce_flags & BCE_USING_MSI_FLAG) { + if (i > 0) printf("|"); + printf("MSI"); i++; + } - if (sc->bce_flags & BCE_USING_MSIX_FLAG) { - if (i > 0) printf("|"); - printf("MSI-X"); i++; - } + if (sc->bce_flags & BCE_USING_MSIX_FLAG) { + if (i > 0) printf("|"); + printf("MSI-X"); i++; + } - if (sc->bce_phy_flags & BCE_PHY_2_5G_CAPABLE_FLAG) { - if (i > 0) printf("|"); - printf("2.5G"); i++; - } + if (sc->bce_phy_flags & BCE_PHY_2_5G_CAPABLE_FLAG) { + if (i > 0) printf("|"); + printf("2.5G"); i++; + } - if (sc->bce_flags & BCE_MFW_ENABLE_FLAG) { - if (i > 0) printf("|"); - printf("MFW); MFW (%s)\n", sc->bce_mfw_ver); - } else { - printf(")\n"); + if (sc->bce_flags & BCE_MFW_ENABLE_FLAG) { + if (i > 0) printf("|"); + printf("MFW); MFW (%s)\n", sc->bce_mfw_ver); + } else { + printf(")\n"); + } } DBEXIT(BCE_VERBOSE_LOAD); @@ -785,13 +788,13 @@ bce_attach(device_t dev) (bce_msi_enable >= 1) && (sc->bce_msi_count == 0)) { sc->bce_msi_count = 1; if ((error = pci_alloc_msi(dev, &sc->bce_msi_count)) != 0) { - BCE_PRINTF("%s(%d): MSI allocation failed! error = %d\n", - __FILE__, __LINE__, error); + BCE_PRINTF("%s(%d): MSI allocation failed! " + "error = %d\n", __FILE__, __LINE__, error); sc->bce_msi_count = 0; pci_release_msi(dev); } else { - DBPRINT(sc, BCE_INFO_LOAD, "%s(): Using MSI interrupt.\n", - __FUNCTION__); + DBPRINT(sc, BCE_INFO_LOAD, "%s(): Using MSI " + "interrupt.\n", __FUNCTION__); sc->bce_flags |= BCE_USING_MSI_FLAG; if ((BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5709) || (BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5716)) @@ -848,10 +851,11 @@ bce_attach(device_t dev) case BCE_CHIP_ID_5709_B0: case BCE_CHIP_ID_5709_B1: case BCE_CHIP_ID_5709_B2: - BCE_PRINTF("%s(%d): Unsupported controller revision (%c%d)!\n", - __FILE__, __LINE__, - (((pci_read_config(dev, PCIR_REVID, 4) & 0xf0) >> 4) + 'A'), - (pci_read_config(dev, PCIR_REVID, 4) & 0xf)); + BCE_PRINTF("%s(%d): Unsupported controller " + "revision (%c%d)!\n", __FILE__, __LINE__, + (((pci_read_config(dev, PCIR_REVID, 4) & + 0xf0) >> 4) + 'A'), (pci_read_config(dev, + PCIR_REVID, 4) & 0xf)); rc = ENODEV; goto bce_attach_fail; } @@ -1072,19 +1076,19 @@ bce_attach(device_t dev) ifp = sc->bce_ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { BCE_PRINTF("%s(%d): Interface allocation failed!\n", - __FILE__, __LINE__); + __FILE__, __LINE__); rc = ENXIO; goto bce_attach_fail; } /* Initialize the ifnet interface. */ - ifp->if_softc = sc; + ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; - ifp->if_ioctl = bce_ioctl; - ifp->if_start = bce_start; - ifp->if_init = bce_init; - ifp->if_mtu = ETHERMTU; + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; + ifp->if_ioctl = bce_ioctl; + ifp->if_start = bce_start; + ifp->if_init = bce_init; + ifp->if_mtu = ETHERMTU; if (bce_tso_enable) { ifp->if_hwassist = BCE_IF_HWASSIST | CSUM_TSO; @@ -1095,7 +1099,7 @@ bce_attach(device_t dev) ifp->if_capabilities = BCE_IF_CAPABILITIES; } - ifp->if_capenable = ifp->if_capabilities; + ifp->if_capenable = ifp->if_capabilities; /* * Assume standard mbuf sizes for buffer allocation. @@ -1105,16 +1109,17 @@ bce_attach(device_t dev) #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->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; + 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 ifp->if_snd.ifq_drv_maxlen = USABLE_TX_BD; @@ -1126,14 +1131,14 @@ bce_attach(device_t dev) else ifp->if_baudrate = IF_Mbps(1000); - /* Handle any special PHY initialization for SerDes PHYs. */ - bce_init_media(sc); + /* Handle any special PHY initialization for SerDes PHYs. */ + bce_init_media(sc); /* MII child bus by probing the PHY. */ if (mii_phy_probe(dev, &sc->bce_miibus, bce_ifmedia_upd, bce_ifmedia_sts)) { BCE_PRINTF("%s(%d): No PHY found on child MII bus!\n", - __FILE__, __LINE__); + __FILE__, __LINE__); rc = ENXIO; goto bce_attach_fail; } @@ -1155,7 +1160,7 @@ bce_attach(device_t dev) if (rc) { BCE_PRINTF("%s(%d): Failed to setup IRQ!\n", - __FILE__, __LINE__); + __FILE__, __LINE__); bce_detach(dev); goto bce_attach_exit; } @@ -1396,6 +1401,9 @@ bce_reg_wr_ind(struct bce_softc *sc, u32 static void bce_shmem_wr(struct bce_softc *sc, u32 offset, u32 val) { + DBPRINT(sc, BCE_VERBOSE_FIRMWARE, "%s(): Writing 0x%08X to " + "0x%08X\n", __FUNCTION__, val, offset); + bce_reg_wr_ind(sc, sc->bce_shmem_base + offset, val); } @@ -1411,7 +1419,12 @@ bce_shmem_wr(struct bce_softc *sc, u32 o static u32 bce_shmem_rd(struct bce_softc *sc, u32 offset) { - return (bce_reg_rd_ind(sc, sc->bce_shmem_base + offset)); + u32 val = bce_reg_rd_ind(sc, sc->bce_shmem_base + offset); + + DBPRINT(sc, BCE_VERBOSE_FIRMWARE, "%s(): Reading 0x%08X from " + "0x%08X\n", __FUNCTION__, val, offset); + + return val; } @@ -1430,9 +1443,9 @@ bce_ctx_rd(struct bce_softc *sc, u32 cid { u32 idx, offset, retry_cnt = 5, val; - DBRUNIF((cid_addr > MAX_CID_ADDR || ctx_offset & 0x3 || cid_addr & CTX_MASK), - BCE_PRINTF("%s(): Invalid CID address: 0x%08X.\n", - __FUNCTION__, cid_addr)); + DBRUNIF((cid_addr > MAX_CID_ADDR || ctx_offset & 0x3 || + cid_addr & CTX_MASK), BCE_PRINTF("%s(): Invalid CID " + "address: 0x%08X.\n", __FUNCTION__, cid_addr)); offset = ctx_offset + cid_addr; @@ -1450,8 +1463,8 @@ bce_ctx_rd(struct bce_softc *sc, u32 cid if (val & BCE_CTX_CTX_CTRL_READ_REQ) BCE_PRINTF("%s(%d); Unable to read CTX memory: " - "cid_addr = 0x%08X, offset = 0x%08X!\n", - __FILE__, __LINE__, cid_addr, ctx_offset); + "cid_addr = 0x%08X, offset = 0x%08X!\n", + __FILE__, __LINE__, cid_addr, ctx_offset); val = REG_RD(sc, BCE_CTX_CTX_DATA); } else { @@ -1487,7 +1500,7 @@ bce_ctx_wr(struct bce_softc *sc, u32 cid DBRUNIF((cid_addr > MAX_CID_ADDR || ctx_offset & 0x3 || cid_addr & CTX_MASK), BCE_PRINTF("%s(): Invalid CID address: 0x%08X.\n", - __FUNCTION__, cid_addr)); + __FUNCTION__, cid_addr)); if ((BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5709) || (BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5716)) { @@ -1504,8 +1517,8 @@ bce_ctx_wr(struct bce_softc *sc, u32 cid if (val & BCE_CTX_CTX_CTRL_WRITE_REQ) BCE_PRINTF("%s(%d); Unable to write CTX memory: " - "cid_addr = 0x%08X, offset = 0x%08X!\n", - __FILE__, __LINE__, cid_addr, ctx_offset); + "cid_addr = 0x%08X, offset = 0x%08X!\n", + __FILE__, __LINE__, cid_addr, ctx_offset); } else { REG_WR(sc, BCE_CTX_DATA_ADR, offset); @@ -1706,54 +1719,73 @@ bce_miibus_statchg(device_t dev) 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); + BCE_EMAC_MODE_MAC_LOOP | BCE_EMAC_MODE_FORCE_LINK | + BCE_EMAC_MODE_25G); - /* Set MII or GMII interface based on the speed negotiated by the PHY. */ + /* 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, "Enabling 10Mb interface.\n"); + DBPRINT(sc, BCE_INFO_PHY, + "Enabling 10Mb interface.\n"); val |= BCE_EMAC_MODE_PORT_MII_10; break; } /* fall-through */ case IFM_100_TX: - DBPRINT(sc, BCE_INFO, "Enabling MII interface.\n"); + DBPRINT(sc, BCE_INFO_PHY, "Enabling MII interface.\n"); val |= BCE_EMAC_MODE_PORT_MII; break; case IFM_2500_SX: - DBPRINT(sc, BCE_INFO, "Enabling 2.5G MAC mode.\n"); + 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, "Enabling GMII interface.\n"); + DBPRINT(sc, BCE_INFO_PHY, "Enabling GMII interface.\n"); val |= BCE_EMAC_MODE_PORT_GMII; break; default: - DBPRINT(sc, BCE_INFO, "Unknown speed, enabling default GMII " - "interface.\n"); + DBPRINT(sc, BCE_INFO_PHY, "Unknown link speed, enabling " + "default GMII interface.\n"); val |= BCE_EMAC_MODE_PORT_GMII; } - /* Set half or full duplex based on the duplicity negotiated by the PHY. */ + /* Set half or full duplex based on PHY settings. */ if ((mii->mii_media_active & IFM_GMASK) == IFM_HDX) { - DBPRINT(sc, BCE_INFO, "Setting Half-Duplex interface.\n"); + DBPRINT(sc, BCE_INFO_PHY, + "Setting Half-Duplex interface.\n"); val |= BCE_EMAC_MODE_HALF_DUPLEX; } else - DBPRINT(sc, BCE_INFO, "Setting Full-Duplex interface.\n"); + DBPRINT(sc, BCE_INFO_PHY, + "Setting Full-Duplex interface.\n"); REG_WR(sc, BCE_EMAC_MODE, val); -#if 0 - /* ToDo: Enable flow control support in brgphy and bge. */ /* FLAG0 is set if RX is enabled and FLAG1 if TX is enabled */ - if (mii->mii_media_active & IFM_FLAG0) + if (mii->mii_media_active & IFM_FLAG0) { + 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); - if (mii->mii_media_active & IFM_FLAG1) - BCE_SETBIT(sc, BCE_EMAC_RX_MODE, BCE_EMAC_TX_MODE_FLOW_EN); -#endif + } else { + DBPRINT(sc, BCE_INFO_PHY, + "%s(): Disabling RX flow control.\n", __FUNCTION__); + BCE_CLRBIT(sc, BCE_EMAC_RX_MODE, BCE_EMAC_RX_MODE_FLOW_EN); + } + + if (mii->mii_media_active & IFM_FLAG1) { + 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); + sc->bce_flags |= BCE_USING_TX_FLOW_CONTROL; + } else { + DBPRINT(sc, BCE_INFO_PHY, + "%s(): Disabling TX flow control.\n", __FUNCTION__); + BCE_CLRBIT(sc, BCE_EMAC_TX_MODE, BCE_EMAC_TX_MODE_FLOW_EN); + sc->bce_flags &= ~BCE_USING_TX_FLOW_CONTROL; + } + + /* ToDo: Update watermarks in bce_init_rx_context(). */ DBEXIT(BCE_VERBOSE_PHY); } @@ -1926,8 +1958,8 @@ bce_enable_nvram_access(struct bce_softc val = REG_RD(sc, BCE_NVM_ACCESS_ENABLE); /* Enable both bits, even on read. */ - REG_WR(sc, BCE_NVM_ACCESS_ENABLE, - val | BCE_NVM_ACCESS_ENABLE_EN | BCE_NVM_ACCESS_ENABLE_WR_EN); + REG_WR(sc, BCE_NVM_ACCESS_ENABLE, val | + BCE_NVM_ACCESS_ENABLE_EN | BCE_NVM_ACCESS_ENABLE_WR_EN); DBEXIT(BCE_VERBOSE_NVRAM); } @@ -1951,9 +1983,8 @@ bce_disable_nvram_access(struct bce_soft val = REG_RD(sc, BCE_NVM_ACCESS_ENABLE); /* Disable both bits, even after read. */ - REG_WR(sc, BCE_NVM_ACCESS_ENABLE, - val & ~(BCE_NVM_ACCESS_ENABLE_EN | - BCE_NVM_ACCESS_ENABLE_WR_EN)); + REG_WR(sc, BCE_NVM_ACCESS_ENABLE, val & + ~(BCE_NVM_ACCESS_ENABLE_EN | BCE_NVM_ACCESS_ENABLE_WR_EN)); DBEXIT(BCE_VERBOSE_NVRAM); } @@ -1983,7 +2014,7 @@ bce_nvram_erase_page(struct bce_softc *s /* Build an erase command. */ cmd = BCE_NVM_COMMAND_ERASE | BCE_NVM_COMMAND_WR | - BCE_NVM_COMMAND_DOIT; + BCE_NVM_COMMAND_DOIT; /* * Clear the DONE bit separately, set the NVRAM adress to erase, @@ -2026,8 +2057,8 @@ bce_nvram_erase_page_exit: /* 0 on success and the 32 bit value read, positive value on failure. */ /****************************************************************************/ static int -bce_nvram_read_dword(struct bce_softc *sc, u32 offset, u8 *ret_val, - u32 cmd_flags) +bce_nvram_read_dword(struct bce_softc *sc, + u32 offset, u8 *ret_val, u32 cmd_flags) { u32 cmd; int i, rc = 0; @@ -2040,8 +2071,8 @@ bce_nvram_read_dword(struct bce_softc *s /* Calculate the offset for buffered flash if translation is used. */ if (sc->bce_flash_info->flags & BCE_NV_TRANSLATE) { offset = ((offset / sc->bce_flash_info->page_size) << - sc->bce_flash_info->page_bits) + - (offset % sc->bce_flash_info->page_size); + sc->bce_flash_info->page_bits) + + (offset % sc->bce_flash_info->page_size); } /* @@ -2070,8 +2101,8 @@ bce_nvram_read_dword(struct bce_softc *s /* Check for errors. */ if (i >= NVRAM_TIMEOUT_COUNT) { - BCE_PRINTF("%s(%d): Timeout error reading NVRAM at offset 0x%08X!\n", - __FILE__, __LINE__, offset); + BCE_PRINTF("%s(%d): Timeout error reading NVRAM at " + "offset 0x%08X!\n", __FILE__, __LINE__, offset); rc = EBUSY; } @@ -2106,8 +2137,8 @@ bce_nvram_write_dword(struct bce_softc * /* Calculate the offset for buffered flash if translation is used. */ if (sc->bce_flash_info->flags & BCE_NV_TRANSLATE) { offset = ((offset / sc->bce_flash_info->page_size) << - sc->bce_flash_info->page_bits) + - (offset % sc->bce_flash_info->page_size); + sc->bce_flash_info->page_bits) + + (offset % sc->bce_flash_info->page_size); } /* @@ -2129,8 +2160,8 @@ bce_nvram_write_dword(struct bce_softc * break; } if (j >= NVRAM_TIMEOUT_COUNT) { - BCE_PRINTF("%s(%d): Timeout error writing NVRAM at offset 0x%08X\n", - __FILE__, __LINE__, offset); + BCE_PRINTF("%s(%d): Timeout error writing NVRAM at " + "offset 0x%08X\n", __FILE__, __LINE__, offset); rc = EBUSY; } @@ -2232,7 +2263,7 @@ bce_init_nvram(struct bce_softc *sc) if (j == entry_count) { sc->bce_flash_info = NULL; BCE_PRINTF("%s(%d): Unknown Flash NVRAM found!\n", - __FILE__, __LINE__); + __FILE__, __LINE__); rc = ENODEV; } @@ -2246,8 +2277,8 @@ bce_init_nvram_get_flash_size: sc->bce_flash_size = sc->bce_flash_info->total_size; DBPRINT(sc, BCE_INFO_LOAD, "%s(): Found %s, size = 0x%08X\n", - __FUNCTION__, sc->bce_flash_info->name, - sc->bce_flash_info->total_size); + __FUNCTION__, sc->bce_flash_info->name, + sc->bce_flash_info->total_size); DBEXIT(BCE_VERBOSE_NVRAM); return rc; @@ -2604,7 +2635,8 @@ bce_nvram_test(struct bce_softc *sc) * the magic value at offset 0. */ if ((rc = bce_nvram_read(sc, 0, data, 4)) != 0) { - BCE_PRINTF("%s(%d): Unable to read NVRAM!\n", __FILE__, __LINE__); + BCE_PRINTF("%s(%d): Unable to read NVRAM!\n", + __FILE__, __LINE__); goto bce_nvram_test_exit; } @@ -2615,9 +2647,9 @@ bce_nvram_test(struct bce_softc *sc) magic = bce_be32toh(buf[0]); if (magic != BCE_NVRAM_MAGIC) { rc = ENODEV; - BCE_PRINTF("%s(%d): Invalid NVRAM magic value! Expected: 0x%08X, " - "Found: 0x%08X\n", - __FILE__, __LINE__, BCE_NVRAM_MAGIC, magic); + BCE_PRINTF("%s(%d): Invalid NVRAM magic value! " + "Expected: 0x%08X, Found: 0x%08X\n", + __FILE__, __LINE__, BCE_NVRAM_MAGIC, magic); goto bce_nvram_test_exit; } @@ -2626,26 +2658,27 @@ bce_nvram_test(struct bce_softc *sc) * configuration data. */ if ((rc = bce_nvram_read(sc, 0x100, data, BCE_NVRAM_SIZE)) != 0) { - BCE_PRINTF("%s(%d): Unable to read Manufacturing Information from " - "NVRAM!\n", __FILE__, __LINE__); + BCE_PRINTF("%s(%d): Unable to read manufacturing " + "Information from NVRAM!\n", __FILE__, __LINE__); goto bce_nvram_test_exit; } csum = ether_crc32_le(data, 0x100); if (csum != BCE_CRC32_RESIDUAL) { rc = ENODEV; - BCE_PRINTF("%s(%d): Invalid Manufacturing Information NVRAM CRC! " - "Expected: 0x%08X, Found: 0x%08X\n", - __FILE__, __LINE__, BCE_CRC32_RESIDUAL, csum); + BCE_PRINTF("%s(%d): Invalid manufacturing information " + "NVRAM CRC! Expected: 0x%08X, Found: 0x%08X\n", + __FILE__, __LINE__, BCE_CRC32_RESIDUAL, csum); goto bce_nvram_test_exit; } csum = ether_crc32_le(data + 0x100, 0x100); if (csum != BCE_CRC32_RESIDUAL) { rc = ENODEV; - BCE_PRINTF("%s(%d): Invalid Feature Configuration Information " - "NVRAM CRC! Expected: 0x%08X, Found: 08%08X\n", - __FILE__, __LINE__, BCE_CRC32_RESIDUAL, csum); + BCE_PRINTF("%s(%d): Invalid feature configuration " + "information NVRAM CRC! Expected: 0x%08X, " + "Found: 08%08X\n", __FILE__, __LINE__, + BCE_CRC32_RESIDUAL, csum); } bce_nvram_test_exit: @@ -2666,7 +2699,7 @@ bce_get_media(struct bce_softc *sc) { u32 val; - DBENTER(BCE_VERBOSE); + DBENTER(BCE_VERBOSE_PHY); /* Assume PHY address for copper controllers. */ sc->bce_phy_addr = 1; @@ -2692,10 +2725,10 @@ bce_get_media(struct bce_softc *sc) } if (val & BCE_MISC_DUAL_MEDIA_CTRL_STRAP_OVERRIDE) - strap = (val & + strap = (val & BCE_MISC_DUAL_MEDIA_CTRL_PHY_CTRL) >> 21; else - strap = (val & + strap = (val & BCE_MISC_DUAL_MEDIA_CTRL_PHY_CTRL_STRAP) >> 8; if (pci_get_function(sc->bce_dev) == 0) { @@ -2744,7 +2777,7 @@ bce_get_media(struct bce_softc *sc) val = bce_shmem_rd(sc, BCE_SHARED_HW_CFG_CONFIG); if (val & BCE_SHARED_HW_CFG_PHY_2_5G) { - sc->bce_phy_flags |= + sc->bce_phy_flags |= BCE_PHY_2_5G_CAPABLE_FLAG; DBPRINT(sc, BCE_INFO_LOAD, "Found 2.5Gb " "capable adapter\n"); @@ -2758,7 +2791,7 @@ bce_get_media_exit: DBPRINT(sc, (BCE_INFO_LOAD | BCE_INFO_PHY), "Using PHY address %d.\n", sc->bce_phy_addr); - DBEXIT(BCE_VERBOSE); + DBEXIT(BCE_VERBOSE_PHY); } @@ -3056,7 +3089,9 @@ bce_dma_map_addr(void *arg, bus_dma_segm /* Simulate a mapping failure. */ DBRUNIF(DB_RANDOMTRUE(dma_map_addr_failed_sim_control), - error = ENOMEM); + error = ENOMEM); + + /* ToDo: How to increment debug sim_count variable here? */ /* Check for an error and signal the caller that an error occurred. */ if (error) { @@ -3154,7 +3189,7 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - DBPRINT(sc, BCE_INFO, "%s(): status_block_paddr = 0x%jX\n", + DBPRINT(sc, BCE_INFO_LOAD, "%s(): status_block_paddr = 0x%jX\n", __FUNCTION__, (uintmax_t) sc->status_block_paddr); /* @@ -3193,7 +3228,7 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - DBPRINT(sc, BCE_INFO, "%s(): stats_block_paddr = 0x%jX\n", + DBPRINT(sc, BCE_INFO_LOAD, "%s(): stats_block_paddr = 0x%jX\n", __FUNCTION__, (uintmax_t) sc->stats_block_paddr); /* BCM5709 uses host memory as cache for context memory. */ @@ -3217,8 +3252,8 @@ bce_dma_alloc(device_t dev) BCE_DMA_BOUNDARY, sc->max_bus_addr, BUS_SPACE_MAXADDR, NULL, NULL, BCM_PAGE_SIZE, 1, BCM_PAGE_SIZE, 0, NULL, NULL, &sc->ctx_tag)) { - BCE_PRINTF("%s(%d): Could not allocate CTX DMA tag!\n", - __FILE__, __LINE__); + BCE_PRINTF("%s(%d): Could not allocate CTX " + "DMA tag!\n", __FILE__, __LINE__); rc = ENOMEM; goto bce_dma_alloc_exit; } @@ -3248,8 +3283,9 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - DBPRINT(sc, BCE_INFO, "%s(): ctx_paddr[%d] = 0x%jX\n", - __FUNCTION__, i, (uintmax_t) sc->ctx_paddr[i]); + DBPRINT(sc, BCE_INFO_LOAD, "%s(): ctx_paddr[%d] " + "= 0x%jX\n", __FUNCTION__, i, + (uintmax_t) sc->ctx_paddr[i]); } } @@ -3262,15 +3298,15 @@ bce_dma_alloc(device_t dev) sc->max_bus_addr, BUS_SPACE_MAXADDR, NULL, NULL, BCE_TX_CHAIN_PAGE_SZ, 1, BCE_TX_CHAIN_PAGE_SZ, 0, NULL, NULL, &sc->tx_bd_chain_tag)) { - BCE_PRINTF("%s(%d): Could not allocate TX descriptor chain " - "DMA tag!\n", __FILE__, __LINE__); + BCE_PRINTF("%s(%d): Could not allocate TX descriptor " + "chain DMA tag!\n", __FILE__, __LINE__); rc = ENOMEM; goto bce_dma_alloc_exit; } for (i = 0; i < TX_PAGES; i++) { - if(bus_dmamem_alloc(sc->tx_bd_chain_tag, + if(bus_dmamem_alloc(sc->tx_bd_chain_tag, (void **)&sc->tx_bd_chain[i], BUS_DMA_NOWAIT, &sc->tx_bd_chain_map[i])) { BCE_PRINTF("%s(%d): Could not allocate TX descriptor " @@ -3291,8 +3327,9 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - DBPRINT(sc, BCE_INFO, "%s(): tx_bd_chain_paddr[%d] = 0x%jX\n", - __FUNCTION__, i, (uintmax_t) sc->tx_bd_chain_paddr[i]); + DBPRINT(sc, BCE_INFO_LOAD, "%s(): tx_bd_chain_paddr[%d] = " + "0x%jX\n", __FUNCTION__, i, + (uintmax_t) sc->tx_bd_chain_paddr[i]); } /* Check the required size before mapping to conserve resources. */ @@ -3368,8 +3405,9 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - DBPRINT(sc, BCE_INFO, "%s(): rx_bd_chain_paddr[%d] = 0x%jX\n", - __FUNCTION__, i, (uintmax_t) sc->rx_bd_chain_paddr[i]); + DBPRINT(sc, BCE_INFO_LOAD, "%s(): rx_bd_chain_paddr[%d] = " + "0x%jX\n", __FUNCTION__, i, + (uintmax_t) sc->rx_bd_chain_paddr[i]); } /* @@ -3383,9 +3421,10 @@ bce_dma_alloc(device_t dev) #endif max_segments = 1; - DBPRINT(sc, BCE_INFO, "%s(): Creating rx_mbuf_tag (max size = 0x%jX " - "max segments = %d, max segment size = 0x%jX)\n", __FUNCTION__, - (uintmax_t) max_size, max_segments, (uintmax_t) max_seg_size); + DBPRINT(sc, BCE_INFO_LOAD, "%s(): Creating rx_mbuf_tag " + "(max size = 0x%jX max segments = %d, max segment " + "size = 0x%jX)\n", __FUNCTION__, (uintmax_t) max_size, + max_segments, (uintmax_t) max_seg_size); if (bus_dma_tag_create(sc->parent_tag, 1, BCE_DMA_BOUNDARY, sc->max_bus_addr, BUS_SPACE_MAXADDR, NULL, NULL, max_size, @@ -3429,7 +3468,7 @@ bce_dma_alloc(device_t dev) (void **)&sc->pg_bd_chain[i], BUS_DMA_NOWAIT, &sc->pg_bd_chain_map[i])) { BCE_PRINTF("%s(%d): Could not allocate page " - "descriptor chain DMA memory!\n", + "descriptor chain DMA memory!\n", __FILE__, __LINE__); rc = ENOMEM; goto bce_dma_alloc_exit; @@ -3437,7 +3476,7 @@ bce_dma_alloc(device_t dev) bzero((char *)sc->pg_bd_chain[i], BCE_PG_CHAIN_PAGE_SZ); - error = bus_dmamap_load(sc->pg_bd_chain_tag, + error = bus_dmamap_load(sc->pg_bd_chain_tag, sc->pg_bd_chain_map[i], sc->pg_bd_chain[i], BCE_PG_CHAIN_PAGE_SZ, bce_dma_map_addr, &sc->pg_bd_chain_paddr[i], BUS_DMA_NOWAIT); @@ -3449,8 +3488,9 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - DBPRINT(sc, BCE_INFO, "%s(): pg_bd_chain_paddr[%d] = 0x%jX\n", - __FUNCTION__, i, (uintmax_t) sc->pg_bd_chain_paddr[i]); + DBPRINT(sc, BCE_INFO_LOAD, "%s(): pg_bd_chain_paddr[%d] = " + "0x%jX\n", __FUNCTION__, i, + (uintmax_t) sc->pg_bd_chain_paddr[i]); } /* @@ -3524,7 +3564,7 @@ bce_release_resources(struct bce_softc * if (sc->bce_res_mem != NULL) { DBPRINT(sc, BCE_INFO_RESET, "Releasing PCI memory.\n"); - bus_release_resource(dev, SYS_RES_MEMORY, PCIR_BAR(0), + bus_release_resource(dev, SYS_RES_MEMORY, PCIR_BAR(0), sc->bce_res_mem); } @@ -3582,7 +3622,7 @@ bce_fw_sync(struct bce_softc *sc, u32 ms DELAY(1000); } - /* If we've timed out, tell the bootcode that we've stopped waiting. */ + /* If we've timed out, tell bootcode that we've stopped waiting. */ if (((val & BCE_FW_MSG_ACK) != (msg_data & BCE_DRV_MSG_SEQ)) && ((msg_data & BCE_DRV_MSG_DATA) != BCE_DRV_MSG_DATA_WAIT0)) { @@ -4319,22 +4359,22 @@ bce_init_cpus(struct bce_softc *sc) (BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5716)) { if ((BCE_CHIP_REV(sc) == BCE_CHIP_REV_Ax)) { - bce_load_rv2p_fw(sc, bce_xi90_rv2p_proc1, - sizeof(bce_xi90_rv2p_proc1), RV2P_PROC1); - bce_load_rv2p_fw(sc, bce_xi90_rv2p_proc2, - sizeof(bce_xi90_rv2p_proc2), RV2P_PROC2); + bce_load_rv2p_fw(sc, bce_xi90_rv2p_proc1, + sizeof(bce_xi90_rv2p_proc1), RV2P_PROC1); + bce_load_rv2p_fw(sc, bce_xi90_rv2p_proc2, + sizeof(bce_xi90_rv2p_proc2), RV2P_PROC2); } else { - bce_load_rv2p_fw(sc, bce_xi_rv2p_proc1, - sizeof(bce_xi_rv2p_proc1), RV2P_PROC1); - bce_load_rv2p_fw(sc, bce_xi_rv2p_proc2, - sizeof(bce_xi_rv2p_proc2), RV2P_PROC2); + bce_load_rv2p_fw(sc, bce_xi_rv2p_proc1, + sizeof(bce_xi_rv2p_proc1), RV2P_PROC1); + bce_load_rv2p_fw(sc, bce_xi_rv2p_proc2, + sizeof(bce_xi_rv2p_proc2), RV2P_PROC2); } } else { - bce_load_rv2p_fw(sc, bce_rv2p_proc1, - sizeof(bce_rv2p_proc1), RV2P_PROC1); + bce_load_rv2p_fw(sc, bce_rv2p_proc1, + sizeof(bce_rv2p_proc1), RV2P_PROC1); bce_load_rv2p_fw(sc, bce_rv2p_proc2, - sizeof(bce_rv2p_proc2), RV2P_PROC2); + sizeof(bce_rv2p_proc2), RV2P_PROC2); } bce_init_rxp_cpu(sc); @@ -4373,7 +4413,7 @@ bce_init_ctx(struct bce_softc *sc) * in host memory so prepare the host memory * for access. */ - val = BCE_CTX_COMMAND_ENABLED | + val = BCE_CTX_COMMAND_ENABLED | BCE_CTX_COMMAND_MEM_INIT | (1 << 12); val |= (BCM_PAGE_BITS - 8) << 16; REG_WR(sc, BCE_CTX_COMMAND, val); @@ -4406,7 +4446,7 @@ bce_init_ctx(struct bce_softc *sc) /* Verify the context memory write was successful. */ for (j = 0; j < retry_cnt; j++) { val = REG_RD(sc, BCE_CTX_HOST_PAGE_TBL_CTRL); - if ((val & + if ((val & BCE_CTX_HOST_PAGE_TBL_CTRL_WRITE_REQ) == 0) break; DELAY(5); @@ -4461,6 +4501,7 @@ bce_get_mac_addr(struct bce_softc *sc) u32 mac_lo = 0, mac_hi = 0; DBENTER(BCE_VERBOSE_RESET); + /* * The NetXtreme II bootcode populates various NIC * power-on and runtime configuration items in a @@ -4475,7 +4516,7 @@ bce_get_mac_addr(struct bce_softc *sc) if ((mac_lo == 0) && (mac_hi == 0)) { BCE_PRINTF("%s(%d): Invalid Ethernet address!\n", - __FILE__, __LINE__); + __FILE__, __LINE__); } else { sc->eaddr[0] = (u_char)(mac_hi >> 8); sc->eaddr[1] = (u_char)(mac_hi >> 0); @@ -4485,7 +4526,8 @@ bce_get_mac_addr(struct bce_softc *sc) sc->eaddr[5] = (u_char)(mac_lo >> 0); } - DBPRINT(sc, BCE_INFO_MISC, "Permanent Ethernet address = %6D\n", sc->eaddr, ":"); + DBPRINT(sc, BCE_INFO_MISC, "Permanent Ethernet " + "address = %6D\n", sc->eaddr, ":"); DBEXIT(BCE_VERBOSE_RESET); } @@ -4505,14 +4547,15 @@ bce_set_mac_addr(struct bce_softc *sc) /* ToDo: Add support for setting multiple MAC addresses. */ DBENTER(BCE_VERBOSE_RESET); - DBPRINT(sc, BCE_INFO_MISC, "Setting Ethernet address = %6D\n", sc->eaddr, ":"); + DBPRINT(sc, BCE_INFO_MISC, "Setting Ethernet address = " + "%6D\n", sc->eaddr, ":"); val = (mac_addr[0] << 8) | mac_addr[1]; REG_WR(sc, BCE_EMAC_MAC_MATCH0, val); val = (mac_addr[2] << 24) | (mac_addr[3] << 16) | - (mac_addr[4] << 8) | mac_addr[5]; + (mac_addr[4] << 8) | mac_addr[5]; REG_WR(sc, BCE_EMAC_MAC_MATCH1, val); @@ -4598,20 +4641,20 @@ bce_reset(struct bce_softc *sc, u32 rese DBENTER(BCE_VERBOSE_RESET); DBPRINT(sc, BCE_VERBOSE_RESET, "%s(): reset_code = 0x%08X\n", - __FUNCTION__, reset_code); + __FUNCTION__, reset_code); /* Wait for pending PCI transactions to complete. */ REG_WR(sc, BCE_MISC_ENABLE_CLR_BITS, - BCE_MISC_ENABLE_CLR_BITS_TX_DMA_ENABLE | - BCE_MISC_ENABLE_CLR_BITS_DMA_ENGINE_ENABLE | - BCE_MISC_ENABLE_CLR_BITS_RX_DMA_ENABLE | - BCE_MISC_ENABLE_CLR_BITS_HOST_COALESCE_ENABLE); + BCE_MISC_ENABLE_CLR_BITS_TX_DMA_ENABLE | + BCE_MISC_ENABLE_CLR_BITS_DMA_ENGINE_ENABLE | + BCE_MISC_ENABLE_CLR_BITS_RX_DMA_ENABLE | + BCE_MISC_ENABLE_CLR_BITS_HOST_COALESCE_ENABLE); val = REG_RD(sc, BCE_MISC_ENABLE_CLR_BITS); DELAY(5); /* Disable DMA */ if ((BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5709) || - (BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5716)) { + (BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5716)) { val = REG_RD(sc, BCE_MISC_NEW_CORE_CTL); val &= ~BCE_MISC_NEW_CORE_CTL_DMA_ENABLE; REG_WR(sc, BCE_MISC_NEW_CORE_CTL, val); @@ -4634,26 +4677,26 @@ bce_reset(struct bce_softc *sc, u32 rese /* Chip reset. */ if ((BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5709) || - (BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5716)) { + (BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5716)) { REG_WR(sc, BCE_MISC_COMMAND, BCE_MISC_COMMAND_SW_RESET); REG_RD(sc, BCE_MISC_COMMAND); DELAY(5); val = BCE_PCICFG_MISC_CONFIG_REG_WINDOW_ENA | - BCE_PCICFG_MISC_CONFIG_TARGET_MB_WORD_SWAP; + BCE_PCICFG_MISC_CONFIG_TARGET_MB_WORD_SWAP; pci_write_config(sc->bce_dev, BCE_PCICFG_MISC_CONFIG, val, 4); } else { val = BCE_PCICFG_MISC_CONFIG_CORE_RST_REQ | - BCE_PCICFG_MISC_CONFIG_REG_WINDOW_ENA | - BCE_PCICFG_MISC_CONFIG_TARGET_MB_WORD_SWAP; + BCE_PCICFG_MISC_CONFIG_REG_WINDOW_ENA | + BCE_PCICFG_MISC_CONFIG_TARGET_MB_WORD_SWAP; REG_WR(sc, BCE_PCICFG_MISC_CONFIG, val); /* Allow up to 30us for reset to complete. */ for (i = 0; i < 10; i++) { val = REG_RD(sc, BCE_PCICFG_MISC_CONFIG); if ((val & (BCE_PCICFG_MISC_CONFIG_CORE_RST_REQ | - BCE_PCICFG_MISC_CONFIG_CORE_RST_BSY)) == 0) { + BCE_PCICFG_MISC_CONFIG_CORE_RST_BSY)) == 0) { break; } DELAY(10); @@ -4661,9 +4704,9 @@ bce_reset(struct bce_softc *sc, u32 rese /* Check that reset completed successfully. */ if (val & (BCE_PCICFG_MISC_CONFIG_CORE_RST_REQ | - BCE_PCICFG_MISC_CONFIG_CORE_RST_BSY)) { + BCE_PCICFG_MISC_CONFIG_CORE_RST_BSY)) { BCE_PRINTF("%s(%d): Reset failed!\n", - __FILE__, __LINE__); + __FILE__, __LINE__); rc = EBUSY; goto bce_reset_exit; } @@ -4673,7 +4716,7 @@ bce_reset(struct bce_softc *sc, u32 rese val = REG_RD(sc, BCE_PCI_SWAP_DIAG0); if (val != 0x01020304) { BCE_PRINTF("%s(%d): Byte swap is incorrect!\n", - __FILE__, __LINE__); + __FILE__, __LINE__); rc = ENODEV; goto bce_reset_exit; } @@ -4685,8 +4728,8 @@ bce_reset(struct bce_softc *sc, u32 rese /* Wait for the firmware to finish its initialization. */ rc = bce_fw_sync(sc, BCE_DRV_MSG_DATA_WAIT1 | reset_code); if (rc) - BCE_PRINTF("%s(%d): Firmware did not complete initialization!\n", - __FILE__, __LINE__); + BCE_PRINTF("%s(%d): Firmware did not complete " + "initialization!\n", __FILE__, __LINE__); bce_reset_exit: DBEXIT(BCE_VERBOSE_RESET); @@ -4709,13 +4752,13 @@ bce_chipinit(struct bce_softc *sc) * channels and PCI clock compensation delay. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 23:38:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15546106564A; Sun, 15 Aug 2010 23:38:50 +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 0325F8FC1A; Sun, 15 Aug 2010 23:38:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FNcnwh078327; Sun, 15 Aug 2010 23:38:49 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FNcnD9078325; Sun, 15 Aug 2010 23:38:49 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008152338.o7FNcnD9078325@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 15 Aug 2010 23:38: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: r211383 - 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: Sun, 15 Aug 2010 23:38:50 -0000 Author: yongari Date: Sun Aug 15 23:38:49 2010 New Revision: 211383 URL: http://svn.freebsd.org/changeset/base/211383 Log: MFC r210257,210259-210261: r210257: When we didn't find a matching flash device, do not touch flash config data. While I'm here, use return code of bce_init_nvram() to set error instead of directly setting ENODEV. r210259: Have bce_init_ctx() return error code and make caller check the return code. If context was not setup correctly give up initialization. While I'm here move variable declarations to the beginning of the function. r210260: Don't change current media in bce_stop(). There is no need to do this here. r210261: Correctly check the result of media selection. Previously it always returned success. Modified: stable/8/sys/dev/bce/if_bce.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (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/sys/dev/e1000/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/bce/if_bce.c ============================================================================== --- stable/8/sys/dev/bce/if_bce.c Sun Aug 15 23:32:23 2010 (r211382) +++ stable/8/sys/dev/bce/if_bce.c Sun Aug 15 23:38:49 2010 (r211383) @@ -423,13 +423,13 @@ 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 void bce_ifmedia_upd_locked (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_mgmt_init_locked (struct bce_softc *sc); -static void 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 *); @@ -2264,7 +2264,8 @@ bce_init_nvram(struct bce_softc *sc) sc->bce_flash_info = NULL; BCE_PRINTF("%s(%d): Unknown Flash NVRAM found!\n", __FILE__, __LINE__); - rc = ENODEV; + DBEXIT(BCE_VERBOSE_NVRAM); + return (ENODEV); } bce_init_nvram_get_flash_size: @@ -4395,16 +4396,18 @@ bce_init_cpus(struct bce_softc *sc) /* Returns: */ /* Nothing. */ /****************************************************************************/ -static void +static int bce_init_ctx(struct bce_softc *sc) { + u32 offset, val, vcid_addr; + int i, j, rc, retry_cnt; + rc = 0; DBENTER(BCE_VERBOSE_RESET | BCE_VERBOSE_CTX); if ((BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5709) || (BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5716)) { - int i, retry_cnt = CTX_INIT_RETRY_COUNT; - u32 val; + retry_cnt = CTX_INIT_RETRY_COUNT; DBPRINT(sc, BCE_INFO_CTX, "Initializing 5709 context.\n"); @@ -4425,15 +4428,14 @@ bce_init_ctx(struct bce_softc *sc) break; DELAY(2); } - - /* ToDo: Consider returning an error here. */ - DBRUNIF((val & BCE_CTX_COMMAND_MEM_INIT), - BCE_PRINTF("%s(): Context memory initialization " - "failed!\n", __FUNCTION__)); + if ((val & BCE_CTX_COMMAND_MEM_INIT) != 0) { + BCE_PRINTF("%s(): Context memory initialization failed!\n", + __FUNCTION__); + rc = EBUSY; + goto init_ctx_fail; + } for (i = 0; i < sc->ctx_pages; i++) { - int j; - /* Set the physical address of the context memory. */ REG_WR(sc, BCE_CTX_HOST_PAGE_TBL_DATA0, BCE_ADDR_LO(sc->ctx_paddr[i] & 0xfffffff0) | @@ -4451,14 +4453,14 @@ bce_init_ctx(struct bce_softc *sc) break; DELAY(5); } - - /* ToDo: Consider returning an error here. */ - DBRUNIF((val & BCE_CTX_HOST_PAGE_TBL_CTRL_WRITE_REQ), - BCE_PRINTF("%s(): Failed to initialize " - "context page %d!\n", __FUNCTION__, i)); + if ((val & BCE_CTX_HOST_PAGE_TBL_CTRL_WRITE_REQ) != 0) { + BCE_PRINTF("%s(): Failed to initialize " + "context page %d!\n", __FUNCTION__, i); + rc = EBUSY; + goto init_ctx_fail; + } } } else { - u32 vcid_addr, offset; DBPRINT(sc, BCE_INFO, "Initializing 5706/5708 context.\n"); @@ -4485,7 +4487,9 @@ bce_init_ctx(struct bce_softc *sc) } } +init_ctx_fail: DBEXIT(BCE_VERBOSE_RESET | BCE_VERBOSE_CTX); + return (rc); } @@ -4573,9 +4577,6 @@ static void bce_stop(struct bce_softc *sc) { struct ifnet *ifp; - struct ifmedia_entry *ifm; - struct mii_data *mii = NULL; - int mtmp, itmp; DBENTER(BCE_VERBOSE_RESET); @@ -4583,8 +4584,6 @@ bce_stop(struct bce_softc *sc) ifp = sc->bce_ifp; - mii = device_get_softc(sc->bce_miibus); - callout_stop(&sc->bce_tick_callout); /* Disable the transmit/receive blocks. */ @@ -4603,25 +4602,6 @@ bce_stop(struct bce_softc *sc) /* Free TX buffers. */ bce_free_tx_chain(sc); - /* - * Isolate/power down the PHY, but leave the media selection - * unchanged so that things will be put back to normal when - * we bring the interface back up. - */ - - itmp = ifp->if_flags; - ifp->if_flags |= IFF_UP; - - /* If we are called from bce_detach(), mii is already NULL. */ - if (mii != NULL) { - ifm = mii->mii_media.ifm_cur; - mtmp = ifm->ifm_media; - ifm->ifm_media = IFM_ETHER | IFM_NONE; - mii_mediachg(mii); - ifm->ifm_media = mtmp; - } - - ifp->if_flags = itmp; sc->watchdog_timer = 0; sc->bce_link_up = FALSE; @@ -4784,7 +4764,8 @@ bce_chipinit(struct bce_softc *sc) BCE_MISC_ENABLE_STATUS_BITS_CONTEXT_ENABLE); /* Initialize context mapping and zero out the quick contexts. */ - bce_init_ctx(sc); + if ((rc = bce_init_ctx(sc)) != 0) + goto bce_chipinit_exit; /* Initialize the on-boards CPUs */ bce_init_cpus(sc); @@ -4796,10 +4777,8 @@ bce_chipinit(struct bce_softc *sc) } /* Prepare NVRAM for access. */ - if (bce_init_nvram(sc)) { - rc = ENODEV; + if ((rc = bce_init_nvram(sc)) != 0) goto bce_chipinit_exit; - } /* Set the kernel bypass block size */ val = REG_RD(sc, BCE_MQ_CONFIG); @@ -5813,15 +5792,16 @@ static int bce_ifmedia_upd(struct ifnet *ifp) { struct bce_softc *sc = ifp->if_softc; + int error; DBENTER(BCE_VERBOSE); BCE_LOCK(sc); - bce_ifmedia_upd_locked(ifp); + error = bce_ifmedia_upd_locked(ifp); BCE_UNLOCK(sc); DBEXIT(BCE_VERBOSE); - return (0); + return (error); } @@ -5831,14 +5811,16 @@ bce_ifmedia_upd(struct ifnet *ifp) /* Returns: */ /* Nothing. */ /****************************************************************************/ -static void +static int bce_ifmedia_upd_locked(struct ifnet *ifp) { struct bce_softc *sc = ifp->if_softc; struct mii_data *mii; + int error; DBENTER(BCE_VERBOSE_PHY); + error = 0; BCE_LOCK_ASSERT(sc); mii = device_get_softc(sc->bce_miibus); @@ -5852,10 +5834,11 @@ bce_ifmedia_upd_locked(struct ifnet *ifp LIST_FOREACH(miisc, &mii->mii_phys, mii_list) mii_phy_reset(miisc); } - mii_mediachg(mii); + error = mii_mediachg(mii); } DBEXIT(BCE_VERBOSE_PHY); + return (error); } From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 23:40:44 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D4C6106564A; Sun, 15 Aug 2010 23:40:44 +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 6B5828FC14; Sun, 15 Aug 2010 23:40:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FNeiD0078593; Sun, 15 Aug 2010 23:40:44 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FNeiNQ078591; Sun, 15 Aug 2010 23:40:44 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008152340.o7FNeiNQ078591@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 15 Aug 2010 23:40:44 +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: r211384 - 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: Sun, 15 Aug 2010 23:40:44 -0000 Author: yongari Date: Sun Aug 15 23:40:44 2010 New Revision: 211384 URL: http://svn.freebsd.org/changeset/base/211384 Log: MFC r210257,210259-210261: r210257: When we didn't find a matching flash device, do not touch flash config data. While I'm here, use return code of bce_init_nvram() to set error instead of directly setting ENODEV. r210259: Have bce_init_ctx() return error code and make caller check the return code. If context was not setup correctly give up initialization. While I'm here move variable declarations to the beginning of the function. r210260: Don't change current media in bce_stop(). There is no need to do this here. r210261: Correctly check the result of media selection. Previously it always returned success. Modified: stable/7/sys/dev/bce/if_bce.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/bce/if_bce.c ============================================================================== --- stable/7/sys/dev/bce/if_bce.c Sun Aug 15 23:38:49 2010 (r211383) +++ stable/7/sys/dev/bce/if_bce.c Sun Aug 15 23:40:44 2010 (r211384) @@ -423,13 +423,13 @@ 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 void bce_ifmedia_upd_locked (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_mgmt_init_locked (struct bce_softc *sc); -static void 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 *); @@ -2264,7 +2264,8 @@ bce_init_nvram(struct bce_softc *sc) sc->bce_flash_info = NULL; BCE_PRINTF("%s(%d): Unknown Flash NVRAM found!\n", __FILE__, __LINE__); - rc = ENODEV; + DBEXIT(BCE_VERBOSE_NVRAM); + return (ENODEV); } bce_init_nvram_get_flash_size: @@ -4395,16 +4396,18 @@ bce_init_cpus(struct bce_softc *sc) /* Returns: */ /* Nothing. */ /****************************************************************************/ -static void +static int bce_init_ctx(struct bce_softc *sc) { + u32 offset, val, vcid_addr; + int i, j, rc, retry_cnt; + rc = 0; DBENTER(BCE_VERBOSE_RESET | BCE_VERBOSE_CTX); if ((BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5709) || (BCE_CHIP_NUM(sc) == BCE_CHIP_NUM_5716)) { - int i, retry_cnt = CTX_INIT_RETRY_COUNT; - u32 val; + retry_cnt = CTX_INIT_RETRY_COUNT; DBPRINT(sc, BCE_INFO_CTX, "Initializing 5709 context.\n"); @@ -4425,15 +4428,14 @@ bce_init_ctx(struct bce_softc *sc) break; DELAY(2); } - - /* ToDo: Consider returning an error here. */ - DBRUNIF((val & BCE_CTX_COMMAND_MEM_INIT), - BCE_PRINTF("%s(): Context memory initialization " - "failed!\n", __FUNCTION__)); + if ((val & BCE_CTX_COMMAND_MEM_INIT) != 0) { + BCE_PRINTF("%s(): Context memory initialization failed!\n", + __FUNCTION__); + rc = EBUSY; + goto init_ctx_fail; + } for (i = 0; i < sc->ctx_pages; i++) { - int j; - /* Set the physical address of the context memory. */ REG_WR(sc, BCE_CTX_HOST_PAGE_TBL_DATA0, BCE_ADDR_LO(sc->ctx_paddr[i] & 0xfffffff0) | @@ -4451,14 +4453,14 @@ bce_init_ctx(struct bce_softc *sc) break; DELAY(5); } - - /* ToDo: Consider returning an error here. */ - DBRUNIF((val & BCE_CTX_HOST_PAGE_TBL_CTRL_WRITE_REQ), - BCE_PRINTF("%s(): Failed to initialize " - "context page %d!\n", __FUNCTION__, i)); + if ((val & BCE_CTX_HOST_PAGE_TBL_CTRL_WRITE_REQ) != 0) { + BCE_PRINTF("%s(): Failed to initialize " + "context page %d!\n", __FUNCTION__, i); + rc = EBUSY; + goto init_ctx_fail; + } } } else { - u32 vcid_addr, offset; DBPRINT(sc, BCE_INFO, "Initializing 5706/5708 context.\n"); @@ -4485,7 +4487,9 @@ bce_init_ctx(struct bce_softc *sc) } } +init_ctx_fail: DBEXIT(BCE_VERBOSE_RESET | BCE_VERBOSE_CTX); + return (rc); } @@ -4573,9 +4577,6 @@ static void bce_stop(struct bce_softc *sc) { struct ifnet *ifp; - struct ifmedia_entry *ifm; - struct mii_data *mii = NULL; - int mtmp, itmp; DBENTER(BCE_VERBOSE_RESET); @@ -4583,8 +4584,6 @@ bce_stop(struct bce_softc *sc) ifp = sc->bce_ifp; - mii = device_get_softc(sc->bce_miibus); - callout_stop(&sc->bce_tick_callout); /* Disable the transmit/receive blocks. */ @@ -4603,25 +4602,6 @@ bce_stop(struct bce_softc *sc) /* Free TX buffers. */ bce_free_tx_chain(sc); - /* - * Isolate/power down the PHY, but leave the media selection - * unchanged so that things will be put back to normal when - * we bring the interface back up. - */ - - itmp = ifp->if_flags; - ifp->if_flags |= IFF_UP; - - /* If we are called from bce_detach(), mii is already NULL. */ - if (mii != NULL) { - ifm = mii->mii_media.ifm_cur; - mtmp = ifm->ifm_media; - ifm->ifm_media = IFM_ETHER | IFM_NONE; - mii_mediachg(mii); - ifm->ifm_media = mtmp; - } - - ifp->if_flags = itmp; sc->watchdog_timer = 0; sc->bce_link_up = FALSE; @@ -4784,7 +4764,8 @@ bce_chipinit(struct bce_softc *sc) BCE_MISC_ENABLE_STATUS_BITS_CONTEXT_ENABLE); /* Initialize context mapping and zero out the quick contexts. */ - bce_init_ctx(sc); + if ((rc = bce_init_ctx(sc)) != 0) + goto bce_chipinit_exit; /* Initialize the on-boards CPUs */ bce_init_cpus(sc); @@ -4796,10 +4777,8 @@ bce_chipinit(struct bce_softc *sc) } /* Prepare NVRAM for access. */ - if (bce_init_nvram(sc)) { - rc = ENODEV; + if ((rc = bce_init_nvram(sc)) != 0) goto bce_chipinit_exit; - } /* Set the kernel bypass block size */ val = REG_RD(sc, BCE_MQ_CONFIG); @@ -5813,15 +5792,16 @@ static int bce_ifmedia_upd(struct ifnet *ifp) { struct bce_softc *sc = ifp->if_softc; + int error; DBENTER(BCE_VERBOSE); BCE_LOCK(sc); - bce_ifmedia_upd_locked(ifp); + error = bce_ifmedia_upd_locked(ifp); BCE_UNLOCK(sc); DBEXIT(BCE_VERBOSE); - return (0); + return (error); } @@ -5831,14 +5811,16 @@ bce_ifmedia_upd(struct ifnet *ifp) /* Returns: */ /* Nothing. */ /****************************************************************************/ -static void +static int bce_ifmedia_upd_locked(struct ifnet *ifp) { struct bce_softc *sc = ifp->if_softc; struct mii_data *mii; + int error; DBENTER(BCE_VERBOSE_PHY); + error = 0; BCE_LOCK_ASSERT(sc); mii = device_get_softc(sc->bce_miibus); @@ -5852,10 +5834,11 @@ bce_ifmedia_upd_locked(struct ifnet *ifp LIST_FOREACH(miisc, &mii->mii_phys, mii_list) mii_phy_reset(miisc); } - mii_mediachg(mii); + error = mii_mediachg(mii); } DBEXIT(BCE_VERBOSE_PHY); + return (error); } From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 23:47:04 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 760E51065679; Sun, 15 Aug 2010 23:47:04 +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 63EBE8FC19; Sun, 15 Aug 2010 23:47:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FNl4Sa078797; Sun, 15 Aug 2010 23:47:04 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FNl4K1078795; Sun, 15 Aug 2010 23:47:04 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008152347.o7FNl4K1078795@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 15 Aug 2010 23:47:04 +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: r211385 - 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: Sun, 15 Aug 2010 23:47:04 -0000 Author: yongari Date: Sun Aug 15 23:47:04 2010 New Revision: 211385 URL: http://svn.freebsd.org/changeset/base/211385 Log: MFC r210263,210267,210269-210270: r210263: Do not report current link state if interface is not UP. r210267: Add KASSERT to check number of returned DMA segments. r210269: Use bus_get_dma_tag() to get parent tag. Also use BUS_SPACE_MAXSIZE_32BIT to specify sum of all segment lengths. Previously it used MAXBSIZE which was wrong. r210270: Specify BUS_DMA_ZERO flag to bus_dmamem_alloc(9) and remove bzero() calls. Also add BUS_DMA_COHERENT flag to bus_dmamem_alloc(9) to take advantage of efficient synchronization for architectures that support that feature. Modified: stable/8/sys/dev/bce/if_bce.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (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/sys/dev/e1000/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/bce/if_bce.c ============================================================================== --- stable/8/sys/dev/bce/if_bce.c Sun Aug 15 23:40:44 2010 (r211384) +++ stable/8/sys/dev/bce/if_bce.c Sun Aug 15 23:47:04 2010 (r211385) @@ -3088,6 +3088,8 @@ bce_dma_map_addr(void *arg, bus_dma_segm { bus_addr_t *busaddr = arg; + KASSERT(nseg == 1, ("%s(): Too many segments returned (%d)!", + __FUNCTION__, nseg)); /* Simulate a mapping failure. */ DBRUNIF(DB_RANDOMTRUE(dma_map_addr_failed_sim_control), error = ENOMEM); @@ -3144,10 +3146,10 @@ bce_dma_alloc(device_t dev) /* * Allocate the parent bus DMA tag appropriate for PCI. */ - if (bus_dma_tag_create(NULL, 1, BCE_DMA_BOUNDARY, + if (bus_dma_tag_create(bus_get_dma_tag(dev), 1, BCE_DMA_BOUNDARY, sc->max_bus_addr, BUS_SPACE_MAXADDR, NULL, NULL, - MAXBSIZE, BUS_SPACE_UNRESTRICTED, BUS_SPACE_MAXSIZE_32BIT, - 0, NULL, NULL, &sc->parent_tag)) { + BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT, 0, NULL, NULL, + &sc->parent_tag)) { BCE_PRINTF("%s(%d): Could not allocate parent DMA tag!\n", __FILE__, __LINE__); rc = ENOMEM; @@ -3170,15 +3172,14 @@ bce_dma_alloc(device_t dev) } if(bus_dmamem_alloc(sc->status_tag, (void **)&sc->status_block, - BUS_DMA_NOWAIT, &sc->status_map)) { + BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_COHERENT, + &sc->status_map)) { BCE_PRINTF("%s(%d): Could not allocate status block " "DMA memory!\n", __FILE__, __LINE__); rc = ENOMEM; goto bce_dma_alloc_exit; } - bzero((char *)sc->status_block, BCE_STATUS_BLK_SZ); - error = bus_dmamap_load(sc->status_tag, sc->status_map, sc->status_block, BCE_STATUS_BLK_SZ, bce_dma_map_addr, &sc->status_block_paddr, BUS_DMA_NOWAIT); @@ -3209,15 +3210,13 @@ bce_dma_alloc(device_t dev) } if (bus_dmamem_alloc(sc->stats_tag, (void **)&sc->stats_block, - BUS_DMA_NOWAIT, &sc->stats_map)) { + BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_COHERENT, &sc->stats_map)) { BCE_PRINTF("%s(%d): Could not allocate statistics block " "DMA memory!\n", __FILE__, __LINE__); rc = ENOMEM; goto bce_dma_alloc_exit; } - bzero((char *)sc->stats_block, BCE_STATS_BLK_SZ); - error = bus_dmamap_load(sc->stats_tag, sc->stats_map, sc->stats_block, BCE_STATS_BLK_SZ, bce_dma_map_addr, &sc->stats_block_paddr, BUS_DMA_NOWAIT); @@ -3263,7 +3262,7 @@ bce_dma_alloc(device_t dev) if(bus_dmamem_alloc(sc->ctx_tag, (void **)&sc->ctx_block[i], - BUS_DMA_NOWAIT, + BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_COHERENT, &sc->ctx_map[i])) { BCE_PRINTF("%s(%d): Could not allocate CTX " "DMA memory!\n", __FILE__, __LINE__); @@ -3271,8 +3270,6 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - bzero((char *)sc->ctx_block[i], BCM_PAGE_SIZE); - error = bus_dmamap_load(sc->ctx_tag, sc->ctx_map[i], sc->ctx_block[i], BCM_PAGE_SIZE, bce_dma_map_addr, &sc->ctx_paddr[i], BUS_DMA_NOWAIT); @@ -3308,7 +3305,8 @@ bce_dma_alloc(device_t dev) for (i = 0; i < TX_PAGES; i++) { if(bus_dmamem_alloc(sc->tx_bd_chain_tag, - (void **)&sc->tx_bd_chain[i], BUS_DMA_NOWAIT, + (void **)&sc->tx_bd_chain[i], + BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_COHERENT, &sc->tx_bd_chain_map[i])) { BCE_PRINTF("%s(%d): Could not allocate TX descriptor " "chain DMA memory!\n", __FILE__, __LINE__); @@ -3384,7 +3382,8 @@ bce_dma_alloc(device_t dev) for (i = 0; i < RX_PAGES; i++) { if (bus_dmamem_alloc(sc->rx_bd_chain_tag, - (void **)&sc->rx_bd_chain[i], BUS_DMA_NOWAIT, + (void **)&sc->rx_bd_chain[i], + BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_COHERENT, &sc->rx_bd_chain_map[i])) { BCE_PRINTF("%s(%d): Could not allocate RX descriptor " "chain DMA memory!\n", __FILE__, __LINE__); @@ -3392,8 +3391,6 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - bzero((char *)sc->rx_bd_chain[i], BCE_RX_CHAIN_PAGE_SZ); - error = bus_dmamap_load(sc->rx_bd_chain_tag, sc->rx_bd_chain_map[i], sc->rx_bd_chain[i], BCE_RX_CHAIN_PAGE_SZ, bce_dma_map_addr, @@ -3427,9 +3424,10 @@ bce_dma_alloc(device_t dev) "size = 0x%jX)\n", __FUNCTION__, (uintmax_t) max_size, max_segments, (uintmax_t) max_seg_size); - if (bus_dma_tag_create(sc->parent_tag, 1, BCE_DMA_BOUNDARY, - sc->max_bus_addr, BUS_SPACE_MAXADDR, NULL, NULL, max_size, - max_segments, max_seg_size, 0, NULL, NULL, &sc->rx_mbuf_tag)) { + if (bus_dma_tag_create(sc->parent_tag, 1, + BCE_DMA_BOUNDARY, sc->max_bus_addr, BUS_SPACE_MAXADDR, NULL, NULL, + max_size, max_segments, max_seg_size, 0, NULL, NULL, + &sc->rx_mbuf_tag)) { BCE_PRINTF("%s(%d): Could not allocate RX mbuf DMA tag!\n", __FILE__, __LINE__); rc = ENOMEM; @@ -3466,7 +3464,8 @@ bce_dma_alloc(device_t dev) 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, + (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", @@ -3475,8 +3474,6 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - bzero((char *)sc->pg_bd_chain[i], BCE_PG_CHAIN_PAGE_SZ); - error = bus_dmamap_load(sc->pg_bd_chain_tag, sc->pg_bd_chain_map[i], sc->pg_bd_chain[i], BCE_PG_CHAIN_PAGE_SZ, bce_dma_map_addr, @@ -5858,6 +5855,10 @@ bce_ifmedia_sts(struct ifnet *ifp, struc BCE_LOCK(sc); + if ((ifp->if_flags & IFF_UP) == 0) { + BCE_UNLOCK(sc); + return; + } mii = device_get_softc(sc->bce_miibus); mii_pollstat(mii); From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 23:48:59 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 142CF1065674; Sun, 15 Aug 2010 23:48:59 +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 01FC88FC14; Sun, 15 Aug 2010 23:48:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FNmwf9078910; Sun, 15 Aug 2010 23:48:58 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FNmwiF078908; Sun, 15 Aug 2010 23:48:58 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008152348.o7FNmwiF078908@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 15 Aug 2010 23:48:58 +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: r211386 - 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: Sun, 15 Aug 2010 23:48:59 -0000 Author: yongari Date: Sun Aug 15 23:48:58 2010 New Revision: 211386 URL: http://svn.freebsd.org/changeset/base/211386 Log: MFC r210263,210267,210269-210270: r210263: Do not report current link state if interface is not UP. r210267: Add KASSERT to check number of returned DMA segments. r210269: Use bus_get_dma_tag() to get parent tag. Also use BUS_SPACE_MAXSIZE_32BIT to specify sum of all segment lengths. Previously it used MAXBSIZE which was wrong. r210270: Specify BUS_DMA_ZERO flag to bus_dmamem_alloc(9) and remove bzero() calls. Also add BUS_DMA_COHERENT flag to bus_dmamem_alloc(9) to take advantage of efficient synchronization for architectures that support that feature. Modified: stable/7/sys/dev/bce/if_bce.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/bce/if_bce.c ============================================================================== --- stable/7/sys/dev/bce/if_bce.c Sun Aug 15 23:47:04 2010 (r211385) +++ stable/7/sys/dev/bce/if_bce.c Sun Aug 15 23:48:58 2010 (r211386) @@ -3088,6 +3088,8 @@ bce_dma_map_addr(void *arg, bus_dma_segm { bus_addr_t *busaddr = arg; + KASSERT(nseg == 1, ("%s(): Too many segments returned (%d)!", + __FUNCTION__, nseg)); /* Simulate a mapping failure. */ DBRUNIF(DB_RANDOMTRUE(dma_map_addr_failed_sim_control), error = ENOMEM); @@ -3144,10 +3146,10 @@ bce_dma_alloc(device_t dev) /* * Allocate the parent bus DMA tag appropriate for PCI. */ - if (bus_dma_tag_create(NULL, 1, BCE_DMA_BOUNDARY, + if (bus_dma_tag_create(bus_get_dma_tag(dev), 1, BCE_DMA_BOUNDARY, sc->max_bus_addr, BUS_SPACE_MAXADDR, NULL, NULL, - MAXBSIZE, BUS_SPACE_UNRESTRICTED, BUS_SPACE_MAXSIZE_32BIT, - 0, NULL, NULL, &sc->parent_tag)) { + BUS_SPACE_MAXSIZE_32BIT, 0, BUS_SPACE_MAXSIZE_32BIT, 0, NULL, NULL, + &sc->parent_tag)) { BCE_PRINTF("%s(%d): Could not allocate parent DMA tag!\n", __FILE__, __LINE__); rc = ENOMEM; @@ -3170,15 +3172,14 @@ bce_dma_alloc(device_t dev) } if(bus_dmamem_alloc(sc->status_tag, (void **)&sc->status_block, - BUS_DMA_NOWAIT, &sc->status_map)) { + BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_COHERENT, + &sc->status_map)) { BCE_PRINTF("%s(%d): Could not allocate status block " "DMA memory!\n", __FILE__, __LINE__); rc = ENOMEM; goto bce_dma_alloc_exit; } - bzero((char *)sc->status_block, BCE_STATUS_BLK_SZ); - error = bus_dmamap_load(sc->status_tag, sc->status_map, sc->status_block, BCE_STATUS_BLK_SZ, bce_dma_map_addr, &sc->status_block_paddr, BUS_DMA_NOWAIT); @@ -3209,15 +3210,13 @@ bce_dma_alloc(device_t dev) } if (bus_dmamem_alloc(sc->stats_tag, (void **)&sc->stats_block, - BUS_DMA_NOWAIT, &sc->stats_map)) { + BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_COHERENT, &sc->stats_map)) { BCE_PRINTF("%s(%d): Could not allocate statistics block " "DMA memory!\n", __FILE__, __LINE__); rc = ENOMEM; goto bce_dma_alloc_exit; } - bzero((char *)sc->stats_block, BCE_STATS_BLK_SZ); - error = bus_dmamap_load(sc->stats_tag, sc->stats_map, sc->stats_block, BCE_STATS_BLK_SZ, bce_dma_map_addr, &sc->stats_block_paddr, BUS_DMA_NOWAIT); @@ -3263,7 +3262,7 @@ bce_dma_alloc(device_t dev) if(bus_dmamem_alloc(sc->ctx_tag, (void **)&sc->ctx_block[i], - BUS_DMA_NOWAIT, + BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_COHERENT, &sc->ctx_map[i])) { BCE_PRINTF("%s(%d): Could not allocate CTX " "DMA memory!\n", __FILE__, __LINE__); @@ -3271,8 +3270,6 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - bzero((char *)sc->ctx_block[i], BCM_PAGE_SIZE); - error = bus_dmamap_load(sc->ctx_tag, sc->ctx_map[i], sc->ctx_block[i], BCM_PAGE_SIZE, bce_dma_map_addr, &sc->ctx_paddr[i], BUS_DMA_NOWAIT); @@ -3308,7 +3305,8 @@ bce_dma_alloc(device_t dev) for (i = 0; i < TX_PAGES; i++) { if(bus_dmamem_alloc(sc->tx_bd_chain_tag, - (void **)&sc->tx_bd_chain[i], BUS_DMA_NOWAIT, + (void **)&sc->tx_bd_chain[i], + BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_COHERENT, &sc->tx_bd_chain_map[i])) { BCE_PRINTF("%s(%d): Could not allocate TX descriptor " "chain DMA memory!\n", __FILE__, __LINE__); @@ -3384,7 +3382,8 @@ bce_dma_alloc(device_t dev) for (i = 0; i < RX_PAGES; i++) { if (bus_dmamem_alloc(sc->rx_bd_chain_tag, - (void **)&sc->rx_bd_chain[i], BUS_DMA_NOWAIT, + (void **)&sc->rx_bd_chain[i], + BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_COHERENT, &sc->rx_bd_chain_map[i])) { BCE_PRINTF("%s(%d): Could not allocate RX descriptor " "chain DMA memory!\n", __FILE__, __LINE__); @@ -3392,8 +3391,6 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - bzero((char *)sc->rx_bd_chain[i], BCE_RX_CHAIN_PAGE_SZ); - error = bus_dmamap_load(sc->rx_bd_chain_tag, sc->rx_bd_chain_map[i], sc->rx_bd_chain[i], BCE_RX_CHAIN_PAGE_SZ, bce_dma_map_addr, @@ -3427,9 +3424,10 @@ bce_dma_alloc(device_t dev) "size = 0x%jX)\n", __FUNCTION__, (uintmax_t) max_size, max_segments, (uintmax_t) max_seg_size); - if (bus_dma_tag_create(sc->parent_tag, 1, BCE_DMA_BOUNDARY, - sc->max_bus_addr, BUS_SPACE_MAXADDR, NULL, NULL, max_size, - max_segments, max_seg_size, 0, NULL, NULL, &sc->rx_mbuf_tag)) { + if (bus_dma_tag_create(sc->parent_tag, 1, + BCE_DMA_BOUNDARY, sc->max_bus_addr, BUS_SPACE_MAXADDR, NULL, NULL, + max_size, max_segments, max_seg_size, 0, NULL, NULL, + &sc->rx_mbuf_tag)) { BCE_PRINTF("%s(%d): Could not allocate RX mbuf DMA tag!\n", __FILE__, __LINE__); rc = ENOMEM; @@ -3466,7 +3464,8 @@ bce_dma_alloc(device_t dev) 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, + (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", @@ -3475,8 +3474,6 @@ bce_dma_alloc(device_t dev) goto bce_dma_alloc_exit; } - bzero((char *)sc->pg_bd_chain[i], BCE_PG_CHAIN_PAGE_SZ); - error = bus_dmamap_load(sc->pg_bd_chain_tag, sc->pg_bd_chain_map[i], sc->pg_bd_chain[i], BCE_PG_CHAIN_PAGE_SZ, bce_dma_map_addr, @@ -5858,6 +5855,10 @@ bce_ifmedia_sts(struct ifnet *ifp, struc BCE_LOCK(sc); + if ((ifp->if_flags & IFF_UP) == 0) { + BCE_UNLOCK(sc); + return; + } mii = device_get_softc(sc->bce_miibus); mii_pollstat(mii); From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 23:56:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DEA651065697; Sun, 15 Aug 2010 23:56: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 CD30C8FC0C; Sun, 15 Aug 2010 23:56:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FNuv3k079104; Sun, 15 Aug 2010 23:56:57 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FNuvIs079101; Sun, 15 Aug 2010 23:56:57 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008152356.o7FNuvIs079101@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 15 Aug 2010 23:56:57 +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: r211387 - 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: Sun, 15 Aug 2010 23:56:58 -0000 Author: yongari Date: Sun Aug 15 23:56:57 2010 New Revision: 211387 URL: http://svn.freebsd.org/changeset/base/211387 Log: MFC r210271: Specify BCE_RX_BUF_ALIGN alignment for RX buffers. All bce(4) controllers require RX buffers aligned on BCE_RX_BUF_ALIGN bytes. 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/cam/ (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/sys/dev/e1000/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/bce/if_bce.c ============================================================================== --- stable/8/sys/dev/bce/if_bce.c Sun Aug 15 23:48:58 2010 (r211386) +++ stable/8/sys/dev/bce/if_bce.c Sun Aug 15 23:56:57 2010 (r211387) @@ -3424,7 +3424,7 @@ bce_dma_alloc(device_t dev) "size = 0x%jX)\n", __FUNCTION__, (uintmax_t) max_size, max_segments, (uintmax_t) max_seg_size); - if (bus_dma_tag_create(sc->parent_tag, 1, + if (bus_dma_tag_create(sc->parent_tag, BCE_RX_BUF_ALIGN, BCE_DMA_BOUNDARY, sc->max_bus_addr, BUS_SPACE_MAXADDR, NULL, NULL, max_size, max_segments, max_seg_size, 0, NULL, NULL, &sc->rx_mbuf_tag)) { Modified: stable/8/sys/dev/bce/if_bcereg.h ============================================================================== --- stable/8/sys/dev/bce/if_bcereg.h Sun Aug 15 23:48:58 2010 (r211386) +++ stable/8/sys/dev/bce/if_bcereg.h Sun Aug 15 23:56:57 2010 (r211387) @@ -6316,6 +6316,7 @@ struct fw_info { #define BCE_DMA_ALIGN 8 #define BCE_DMA_BOUNDARY 0 +#define BCE_RX_BUF_ALIGN 16 #define BCE_MAX_CONTEXT 4 From owner-svn-src-all@FreeBSD.ORG Sun Aug 15 23:58:22 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F23E1065679; Sun, 15 Aug 2010 23:58:22 +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 0DF978FC1E; Sun, 15 Aug 2010 23:58:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7FNwLgL079180; Sun, 15 Aug 2010 23:58:21 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7FNwLNW079177; Sun, 15 Aug 2010 23:58:21 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008152358.o7FNwLNW079177@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 15 Aug 2010 23:58:21 +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: r211388 - 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: Sun, 15 Aug 2010 23:58:22 -0000 Author: yongari Date: Sun Aug 15 23:58:21 2010 New Revision: 211388 URL: http://svn.freebsd.org/changeset/base/211388 Log: MFC r210271: Specify BCE_RX_BUF_ALIGN alignment for RX buffers. All bce(4) controllers require RX buffers aligned on BCE_RX_BUF_ALIGN bytes. 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 Sun Aug 15 23:56:57 2010 (r211387) +++ stable/7/sys/dev/bce/if_bce.c Sun Aug 15 23:58:21 2010 (r211388) @@ -3424,7 +3424,7 @@ bce_dma_alloc(device_t dev) "size = 0x%jX)\n", __FUNCTION__, (uintmax_t) max_size, max_segments, (uintmax_t) max_seg_size); - if (bus_dma_tag_create(sc->parent_tag, 1, + if (bus_dma_tag_create(sc->parent_tag, BCE_RX_BUF_ALIGN, BCE_DMA_BOUNDARY, sc->max_bus_addr, BUS_SPACE_MAXADDR, NULL, NULL, max_size, max_segments, max_seg_size, 0, NULL, NULL, &sc->rx_mbuf_tag)) { Modified: stable/7/sys/dev/bce/if_bcereg.h ============================================================================== --- stable/7/sys/dev/bce/if_bcereg.h Sun Aug 15 23:56:57 2010 (r211387) +++ stable/7/sys/dev/bce/if_bcereg.h Sun Aug 15 23:58:21 2010 (r211388) @@ -6313,6 +6313,7 @@ struct fw_info { #define BCE_DMA_ALIGN 8 #define BCE_DMA_BOUNDARY 0 +#define BCE_RX_BUF_ALIGN 16 #define BCE_MAX_CONTEXT 4 From owner-svn-src-all@FreeBSD.ORG Mon Aug 16 08:48:39 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB3AD106566B; Mon, 16 Aug 2010 08:48:39 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B9A108FC1A; Mon, 16 Aug 2010 08:48:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7G8mdpB090048; Mon, 16 Aug 2010 08:48:39 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7G8md65090046; Mon, 16 Aug 2010 08:48:39 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201008160848.o7G8md65090046@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 16 Aug 2010 08:48:39 +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: r211390 - stable/8/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: Mon, 16 Aug 2010 08:48:39 -0000 Author: ae Date: Mon Aug 16 08:48:39 2010 New Revision: 211390 URL: http://svn.freebsd.org/changeset/base/211390 Log: MFC r210746: Release access for consumers that are opened, but will be destroyed indirectly by orphan method. PR: 148688 MFC r210792: Check that table is not NULL before access, it can be NULL for some cases. Approved by: kib (mentor) Modified: stable/8/sys/geom/part/g_part.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (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/sys/dev/e1000/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/geom/part/g_part.c ============================================================================== --- stable/8/sys/geom/part/g_part.c Mon Aug 16 04:22:29 2010 (r211389) +++ stable/8/sys/geom/part/g_part.c Mon Aug 16 08:48:39 2010 (r211390) @@ -1738,6 +1738,7 @@ static void g_part_orphan(struct g_consumer *cp) { struct g_provider *pp; + struct g_part_table *table; pp = cp->provider; KASSERT(pp != NULL, (__func__)); @@ -1745,6 +1746,9 @@ g_part_orphan(struct g_consumer *cp) g_topology_assert(); KASSERT(pp->error != 0, (__func__)); + table = cp->geom->softc; + if (table != NULL && table->gpt_opened) + g_access(cp, -1, -1, -1); g_part_wither(cp->geom, pp->error); } From owner-svn-src-all@FreeBSD.ORG Mon Aug 16 08:51:21 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F2BE1065693; Mon, 16 Aug 2010 08:51:21 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 402228FC14; Mon, 16 Aug 2010 08:51:21 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 45C061FFC33; Mon, 16 Aug 2010 08:51:20 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 0D04C84559; Mon, 16 Aug 2010 10:51:20 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Bruce Cran References: <201008141434.o7EEYaSA030301@svn.freebsd.org> <20100815205724.00007e0f@unknown> Date: Mon, 16 Aug 2010 10:51:19 +0200 In-Reply-To: <20100815205724.00007e0f@unknown> (Bruce Cran's message of "Sun, 15 Aug 2010 20:57:24 +0100") Message-ID: <86wrrraqk8.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211304 - 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: Mon, 16 Aug 2010 08:51:21 -0000 Bruce Cran writes: > Somewhat related, there are overflow bugs in humanize_number - for > example df(1) fails to display space from a 100PB filesystem > correctly. Patch? :) DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Mon Aug 16 08:51:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03CB41065694; Mon, 16 Aug 2010 08:51:36 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC25B8FC1B; Mon, 16 Aug 2010 08:51:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7G8pZgl090152; Mon, 16 Aug 2010 08:51:35 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7G8pZqR090150; Mon, 16 Aug 2010 08:51:35 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201008160851.o7G8pZqR090150@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Mon, 16 Aug 2010 08:51:35 +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: r211391 - stable/8/sys/geom/sched X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2010 08:51:36 -0000 Author: ae Date: Mon Aug 16 08:51:35 2010 New Revision: 211391 URL: http://svn.freebsd.org/changeset/base/211391 Log: MFC r210747: Forward ioctl requests to original geom. PR: 148540 Approved by: kib (mentor) Modified: stable/8/sys/geom/sched/g_sched.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (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/sys/dev/e1000/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/geom/sched/g_sched.c ============================================================================== --- stable/8/sys/geom/sched/g_sched.c Mon Aug 16 08:48:39 2010 (r211390) +++ stable/8/sys/geom/sched/g_sched.c Mon Aug 16 08:51:35 2010 (r211391) @@ -136,6 +136,8 @@ static void g_sched_dumpconf(struct sbuf struct g_geom *gp, struct g_consumer *cp, struct g_provider *pp); static void g_sched_init(struct g_class *mp); static void g_sched_fini(struct g_class *mp); +static int g_sched_ioctl(struct g_provider *pp, u_long cmd, void *data, + int fflag, struct thread *td); struct g_class g_sched_class = { .name = G_SCHED_CLASS_NAME, @@ -144,6 +146,7 @@ struct g_class g_sched_class = { .taste = g_sched_taste, .destroy_geom = g_sched_destroy_geom, .init = g_sched_init, + .ioctl = g_sched_ioctl, .fini = g_sched_fini }; @@ -1601,6 +1604,22 @@ g_sched_fini(struct g_class *mp) mtx_destroy(&me.gs_mtx); } +static int +g_sched_ioctl(struct g_provider *pp, u_long cmd, void *data, int fflag, + struct thread *td) +{ + struct g_consumer *cp; + struct g_geom *gp; + + cp = LIST_FIRST(&pp->geom->consumer); + if (cp == NULL) + return (ENOIOCTL); + gp = cp->provider->geom; + if (gp->ioctl == NULL) + return (ENOIOCTL); + return (gp->ioctl(cp->provider, cmd, data, fflag, td)); +} + /* * Read the i-th argument for a request, skipping the /dev/ * prefix if present. From owner-svn-src-all@FreeBSD.ORG Mon Aug 16 11:22:12 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66A2B10656A8; Mon, 16 Aug 2010 11:22:12 +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 4B4188FC19; Mon, 16 Aug 2010 11:22:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7GBMCJt096961; Mon, 16 Aug 2010 11:22:12 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7GBMCEU096959; Mon, 16 Aug 2010 11:22:12 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201008161122.o7GBMCEU096959@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 16 Aug 2010 11:22: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: r211392 - 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: Mon, 16 Aug 2010 11:22:12 -0000 Author: des Date: Mon Aug 16 11:22:12 2010 New Revision: 211392 URL: http://svn.freebsd.org/changeset/base/211392 Log: Old patch I had lying around: clean up and use stpcpy(3) instead of sprintf(3). Modified: head/lib/libutil/pw_util.c Modified: head/lib/libutil/pw_util.c ============================================================================== --- head/lib/libutil/pw_util.c Mon Aug 16 08:51:35 2010 (r211391) +++ head/lib/libutil/pw_util.c Mon Aug 16 11:22:12 2010 (r211392) @@ -67,7 +67,7 @@ static const char rcsid[] = #include #include -#include +#include "libutil.h" static pid_t editpid = -1; static int lockfd = -1; @@ -557,43 +557,50 @@ pw_tempname(void) struct passwd * pw_dup(const struct passwd *pw) { + char *dst; struct passwd *npw; ssize_t len; - len = sizeof(*npw) + - (pw->pw_name ? strlen(pw->pw_name) + 1 : 0) + - (pw->pw_passwd ? strlen(pw->pw_passwd) + 1 : 0) + - (pw->pw_class ? strlen(pw->pw_class) + 1 : 0) + - (pw->pw_gecos ? strlen(pw->pw_gecos) + 1 : 0) + - (pw->pw_dir ? strlen(pw->pw_dir) + 1 : 0) + - (pw->pw_shell ? strlen(pw->pw_shell) + 1 : 0); + len = sizeof(*npw); + if (pw->pw_name != NULL) + len += strlen(pw->pw_name) + 1; + if (pw->pw_passwd != NULL) + len += strlen(pw->pw_passwd) + 1; + if (pw->pw_class != NULL) + len += strlen(pw->pw_class) + 1; + if (pw->pw_gecos != NULL) + len += strlen(pw->pw_gecos) + 1; + if (pw->pw_dir != NULL) + len += strlen(pw->pw_dir) + 1; + if (pw->pw_shell != NULL) + len += strlen(pw->pw_shell) + 1; if ((npw = malloc((size_t)len)) == NULL) return (NULL); memcpy(npw, pw, sizeof(*npw)); - len = sizeof(*npw); - if (pw->pw_name) { - npw->pw_name = ((char *)npw) + len; - len += sprintf(npw->pw_name, "%s", pw->pw_name) + 1; - } - if (pw->pw_passwd) { - npw->pw_passwd = ((char *)npw) + len; - len += sprintf(npw->pw_passwd, "%s", pw->pw_passwd) + 1; - } - if (pw->pw_class) { - npw->pw_class = ((char *)npw) + len; - len += sprintf(npw->pw_class, "%s", pw->pw_class) + 1; - } - if (pw->pw_gecos) { - npw->pw_gecos = ((char *)npw) + len; - len += sprintf(npw->pw_gecos, "%s", pw->pw_gecos) + 1; - } - if (pw->pw_dir) { - npw->pw_dir = ((char *)npw) + len; - len += sprintf(npw->pw_dir, "%s", pw->pw_dir) + 1; - } - if (pw->pw_shell) { - npw->pw_shell = ((char *)npw) + len; - len += sprintf(npw->pw_shell, "%s", pw->pw_shell) + 1; + dst = (char *)npw + sizeof(*npw); + if (pw->pw_name != NULL) { + npw->pw_name = dst; + dst = stpcpy(npw->pw_name, pw->pw_name) + 1; + } + if (pw->pw_passwd != NULL) { + npw->pw_passwd = dst; + dst = stpcpy(npw->pw_passwd, pw->pw_passwd) + 1; + } + if (pw->pw_class != NULL) { + npw->pw_class = dst; + dst = stpcpy(npw->pw_class, pw->pw_class) + 1; + } + if (pw->pw_gecos != NULL) { + npw->pw_gecos = dst; + dst = stpcpy(npw->pw_gecos, pw->pw_gecos) + 1; + } + if (pw->pw_dir != NULL) { + npw->pw_dir = dst; + dst = stpcpy(npw->pw_dir, pw->pw_dir) + 1; + } + if (pw->pw_shell != NULL) { + npw->pw_shell = dst; + dst = stpcpy(npw->pw_shell, pw->pw_shell) + 1; } return (npw); } From owner-svn-src-all@FreeBSD.ORG Mon Aug 16 11:32:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B454106566C; Mon, 16 Aug 2010 11:32:20 +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 8A5528FC0A; Mon, 16 Aug 2010 11:32:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7GBWKwo097185; Mon, 16 Aug 2010 11:32:20 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7GBWKhx097183; Mon, 16 Aug 2010 11:32:20 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201008161132.o7GBWKhx097183@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 16 Aug 2010 11:32: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: r211393 - 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: Mon, 16 Aug 2010 11:32:20 -0000 Author: des Date: Mon Aug 16 11:32:20 2010 New Revision: 211393 URL: http://svn.freebsd.org/changeset/base/211393 Log: In setusercontext(), do not apply user settings unless running as the user in question (usually but not necessarily because we were called with LOGIN_SETUSER). This plugs a hole where users could raise their resource limits and expand their CPU mask. MFC after: 3 weeks Modified: head/lib/libutil/login_class.c Modified: head/lib/libutil/login_class.c ============================================================================== --- head/lib/libutil/login_class.c Mon Aug 16 11:22:12 2010 (r211392) +++ head/lib/libutil/login_class.c Mon Aug 16 11:32:20 2010 (r211393) @@ -525,7 +525,7 @@ setusercontext(login_cap_t *lc, const st /* * Now, we repeat some of the above for the user's private entries */ - if ((lc = login_getuserclass(pwd)) != NULL) { + if (getuid() == uid && (lc = login_getuserclass(pwd)) != NULL) { mymask = setlogincontext(lc, pwd, mymask, flags); login_close(lc); } From owner-svn-src-all@FreeBSD.ORG Mon Aug 16 11:41:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 548AE1065695; Mon, 16 Aug 2010 11:41:10 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 15C778FC13; Mon, 16 Aug 2010 11:41:09 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 0A3931FFC33; Mon, 16 Aug 2010 11:41:09 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id C7E2584559; Mon, 16 Aug 2010 13:41:08 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: src-committers@freebsd.org References: <201008161132.o7GBWKhx097183@svn.freebsd.org> Date: Mon, 16 Aug 2010 13:41:08 +0200 In-Reply-To: <201008161132.o7GBWKhx097183@svn.freebsd.org> (Dag-Erling Smorgrav's message of "Mon, 16 Aug 2010 11:32:20 +0000 (UTC)") Message-ID: <86mxsm4wff.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r211393 - 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: Mon, 16 Aug 2010 11:41:10 -0000 Dag-Erling Smorgrav writes: > Log: > In setusercontext(), do not apply user settings unless running as the > user in question (usually but not necessarily because we were called > with LOGIN_SETUSER). This plugs a hole where users could raise their > resource limits and expand their CPU mask. Note that this commit semi-intentionally introduces another bug: in some cases, the user's limits will not be applied at all. This is by far the lesser of two evils, and is easy (albeit time-consuming) to fix. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Mon Aug 16 11:48:06 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 877161065673; Mon, 16 Aug 2010 11:48:06 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id DE61B8FC14; Mon, 16 Aug 2010 11:48:04 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 022C21FFC33; Mon, 16 Aug 2010 11:48:03 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id B211684559; Mon, 16 Aug 2010 13:48:03 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: src-committers@freebsd.org References: <201008161132.o7GBWKhx097183@svn.freebsd.org> <86mxsm4wff.fsf@ds4.des.no> Date: Mon, 16 Aug 2010 13:48:03 +0200 In-Reply-To: <86mxsm4wff.fsf@ds4.des.no> ("Dag-Erling =?utf-8?Q?Sm=C3=B8rg?= =?utf-8?Q?rav=22's?= message of "Mon, 16 Aug 2010 13:41:08 +0200") Message-ID: <86bp924w3w.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r211393 - 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: Mon, 16 Aug 2010 11:48:06 -0000 Dag-Erling Sm=C3=B8rgrav writes: > Note that this commit semi-intentionally introduces another bug: in some > cases, the user's limits will not be applied at all. This is by far the > lesser of two evils, and is easy (albeit time-consuming) to fix. Specifically, each of the files listed below needs to be audited. Those that already call setusercontext() with the LOGIN_SETUSER flag set are fine. Those that don't need to do so either instead of or shortly after calling setuid(). contrib/lukemftpd/src/ftpd.c: setusercontext(NULL, getpwuid(0), 0, contrib/lukemftpd/src/ftpd.c- LOGIN_SETPRIORITY|LOGIN_SETRESOURCES|= LOGIN_SETUMASK|LOGIN_SETMAC); contrib/lukemftpd/src/ftpd.c-#endif -- contrib/lukemftpd/src/ftpd.c: setusercontext(lc, pw, 0, contrib/lukemftpd/src/ftpd.c- LOGIN_SETLOGIN|LOGIN_SETGROUP|LOGIN_SETPRIOR= ITY| contrib/lukemftpd/src/ftpd.c- LOGIN_SETRESOURCES|LOGIN_SETUMASK|LOGIN_SETM= AC); -- contrib/sendmail/src/deliver.c: setusercontext(NULL, pwd, pwd->pw_ui= d, contrib/sendmail/src/deliver.c- sucflags) =3D=3D -1 && contrib/sendmail/src/deliver.c- suidwarn) -- contrib/sendmail/src/deliver.c: syserr("openmailer: setusercontext() fa= iled"); contrib/sendmail/src/deliver.c- exit(EX_TEMPFAIL); contrib/sendmail/src/deliver.c- } -- crypto/openssh/openbsd-compat/port-irix.c:irix_setusercontext(struct passwd= *pw) crypto/openssh/openbsd-compat/port-irix.c-{ crypto/openssh/openbsd-compat/port-irix.c-#ifdef WITH_IRIX_PROJECT -- crypto/openssh/session.c: (void) setusercontext(lc, pw, pw->pw_uid, crypto/openssh/session.c- LOGIN_SETENV|LOGIN_SETPATH); crypto/openssh/session.c- copy_environment(environ, &env, &envsize); -- crypto/openssh/session.c:do_setusercontext(struct passwd *pw) crypto/openssh/session.c-{ crypto/openssh/session.c- char *chroot_path, *tmp; -- crypto/openssh/session.c: if (setusercontext(lc, pw, pw->pw_uid, crypto/openssh/session.c- (LOGIN_SETALL & ~(LOGIN_SETENV|LOGIN_SETPATH= |LOGIN_SETUSER))) < 0) { crypto/openssh/session.c- perror("unable to set user context"); -- crypto/openssh/session.c: irix_setusercontext(pw); crypto/openssh/session.c-# endif /* defined(WITH_IRIX_PROJECT) || defined(W= ITH_IRIX_JOBS) || defined(WITH_IRIX_ARRAY) */ crypto/openssh/session.c-# ifdef _AIX -- crypto/openssh/session.c: if (setusercontext(lc, pw, pw->pw_uid, LOGIN_SET= USER) < 0) { crypto/openssh/session.c- perror("unable to set user context (setuser)"); crypto/openssh/session.c- exit(1); -- crypto/openssh/session.c: do_setusercontext(pw); crypto/openssh/session.c- child_close_fds(); crypto/openssh/session.c- do_pwchange(s); -- crypto/openssh/session.c: do_setusercontext(pw); crypto/openssh/session.c- /* crypto/openssh/session.c: * PAM session modules in do_setusercontext may = have crypto/openssh/session.c- * generated messages, so if this in an interact= ive crypto/openssh/session.c- * login then display them too. -- crypto/openssh/sshd.c: do_setusercontext(privsep_pw); crypto/openssh/sshd.c-#else crypto/openssh/sshd.c- gidset[0] =3D privsep_pw->pw_gid; -- crypto/openssh/sshd.c: do_setusercontext(authctxt->pw); crypto/openssh/sshd.c- crypto/openssh/sshd.c- skip: -- libexec/atrun/atrun.c: if (setusercontext(NULL, pentry, uid, LOGIN_SETALL & libexec/atrun/atrun.c- ~(LOGIN_SETPRIORITY | LOGIN_SETPATH | LOGIN_SETENV)= ) !=3D 0) libexec/atrun/atrun.c: exit(EXIT_FAILURE); /* setusercontext() logged t= he error */ libexec/atrun/atrun.c-#else /* LOGIN_CAP */ libexec/atrun/atrun.c- if (initgroups(pentry->pw_name,pentry->pw_gid)) -- libexec/atrun/atrun.c: if (setusercontext(NULL, pentry, uid, LOGIN_SETALL) = !=3D 0) libexec/atrun/atrun.c: exit(EXIT_FAILURE); /* setusercontext() logged t= he error */ libexec/atrun/atrun.c-#else /* LOGIN_CAP */ libexec/atrun/atrun.c- if (initgroups(pentry->pw_name,pentry->pw_gid)) -- libexec/ftpd/ftpd.c: setusercontext(NULL, getpwuid(0), 0, libexec/ftpd/ftpd.c- LOGIN_SETPRIORITY|LOGIN_SETRESOURCES|LOGIN_SET= UMASK| libexec/ftpd/ftpd.c- LOGIN_SETMAC); -- libexec/ftpd/ftpd.c: setusercontext(lc, pw, 0, libexec/ftpd/ftpd.c- LOGIN_SETLOGIN|LOGIN_SETGROUP|LOGIN_SETPRIORITY| libexec/ftpd/ftpd.c- LOGIN_SETRESOURCES|LOGIN_SETUMASK|LOGIN_SETMAC); -- libexec/rshd/rshd.c: if (setusercontext(lc, pwd, pwd->pw_uid, LOGIN_SETGROU= P) !=3D 0) { libexec/rshd/rshd.c: syslog(LOG_ERR, "setusercontext: %m"); libexec/rshd/rshd.c- exit(1); libexec/rshd/rshd.c- } -- libexec/rshd/rshd.c: if (setusercontext(lc, pwd, pwd->pw_uid, libexec/rshd/rshd.c- LOGIN_SETALL & ~LOGIN_SETGROUP) < 0) { libexec/rshd/rshd.c: syslog(LOG_ERR, "setusercontext(): %m"); libexec/rshd/rshd.c- exit(1); libexec/rshd/rshd.c- } -- release/picobsd/tinyware/login/pico-login.c: * We need to do this before s= etusercontext() because that may release/picobsd/tinyware/login/pico-login.c- * set or reset some environme= nt variables. release/picobsd/tinyware/login/pico-login.c- */ -- release/picobsd/tinyware/login/pico-login.c: if (setusercontext(lc, pwd, pw= d->pw_uid, LOGIN_SETGROUP) !=3D 0) { release/picobsd/tinyware/login/pico-login.c: syslog(LOG_ERR,= "setusercontext() failed - exiting"); release/picobsd/tinyware/login/pico-login.c- exit(1); release/picobsd/tinyware/login/pico-login.c- } -- release/picobsd/tinyware/login/pico-login.c: if (setusercontext(lc, pwd, pw= d->pw_uid, release/picobsd/tinyware/login/pico-login.c- LOGIN_SETALL & ~(LOGIN_SET= LOGIN|LOGIN_SETGROUP)) !=3D 0) { release/picobsd/tinyware/login/pico-login.c: syslog(LOG_ERR,= "setusercontext() failed - exiting"); release/picobsd/tinyware/login/pico-login.c- exit(1); release/picobsd/tinyware/login/pico-login.c- } -- sbin/init/init.c: setusercontext(lc, (struct passwd*)NULL, 0, sbin/init/init.c- LOGIN_SETPRIORITY | LOGIN_SETRESOURCES); sbin/init/init.c- login_close(lc); -- usr.bin/login/login.c: if (setusercontext(lc, pwd, pwd->pw_uid, LOGIN_SETGR= OUP) !=3D 0) { usr.bin/login/login.c: syslog(LOG_ERR, "setusercontext() failed - exiting"= ); usr.bin/login/login.c- bail(NO_SLEEP_EXIT, 1); usr.bin/login/login.c- } -- usr.bin/login/login.c: if (setusercontext(lc, pwd, pwd->pw_uid, usr.bin/login/login.c- LOGIN_SETALL & ~(LOGIN_SETLOGIN|LOGIN_SETGROUP))= !=3D 0) { usr.bin/login/login.c: syslog(LOG_ERR, "setusercontext() failed - exiting"= ); usr.bin/login/login.c- exit(1); usr.bin/login/login.c- } -- usr.bin/newgrp/newgrp.c: setusercontext(lc, pwd, pwd->pw_uid, usr.bin/newgrp/newgrp.c- LOGIN_SETPATH|LOGIN_SETUMASK|LOGIN_SETENV); usr.bin/newgrp/newgrp.c- login_close(lc); -- usr.bin/su/su.c: if (setusercontext(lc, pwd, pwd->pw_uid, LOGIN_SETGROUP) <= 0) usr.bin/su/su.c: err(1, "setusercontext"); usr.bin/su/su.c- usr.bin/su/su.c- retcode =3D pam_setcred(pamh, PAM_ESTABLISH_CRED); -- usr.bin/su/su.c: if (setusercontext(lc, pwd, pwd->pw_uid, setwhat) < 0) usr.bin/su/su.c: err(1, "setusercontext"); usr.bin/su/su.c- usr.bin/su/su.c- if (!asme) { -- usr.bin/su/su.c: setusercontext(lc, pwd, pwd->pw_uid, usr.bin/su/su.c- LOGIN_SETPATH | LOGIN_SETUMASK | usr.bin/su/su.c- LOGIN_SETENV); -- usr.sbin/cron/cron/do_command.c: setusercontext(lc, pwd, e->uid, usr.sbin/cron/cron/do_command.c- LOGIN_SETALL & ~(LOGIN_SETPATH|LOGIN= _SETENV)) =3D=3D 0) usr.sbin/cron/cron/do_command.c- (void) endpwent(); -- usr.sbin/cron/cron/popen.c: setusercontext(lc, pwd, e->uid, usr.sbin/cron/cron/popen.c- LOGIN_SETALL & ~(LOGIN_SETPATH|LOGIN_SET= ENV)) =3D=3D 0) usr.sbin/cron/cron/popen.c- (void) endpwent(); -- usr.sbin/daemon/daemon.c: if (setusercontext(NULL, pw, pw->pw_uid, LOGIN_SE= TALL) !=3D 0) usr.sbin/daemon/daemon.c- errx(1, "failed to set user environment"); usr.sbin/daemon/daemon.c-} -- usr.sbin/inetd/inetd.c: if (setusercontext(lc, pwd, pwd->pw_uid, usr.sbin/inetd/inetd.c- LOGIN_SETALL & ~LOGIN_SETMAC) usr.sbin/inetd/inetd.c- !=3D 0) { -- usr.sbin/inetd/inetd.c: "%s: can't setusercontext(..%s..): %m", usr.sbin/inetd/inetd.c- sep->se_service, sep->se_user); usr.sbin/inetd/inetd.c- _exit(EX_OSERR); -- usr.sbin/jail/jail.c: if (setusercontext(lcap, pwd, pwd->pw_uid, usr.sbin/jail/jail.c- LOGIN_SETALL & ~LOGIN_SETGROUP & ~LOGIN_SETLOGIN= ) !=3D 0) usr.sbin/jail/jail.c: err(1, "setusercontext"); usr.sbin/jail/jail.c- login_close(lcap); usr.sbin/jail/jail.c- } -- usr.sbin/jexec/jexec.c: if (setusercontext(lcap, pwd, pwd->pw_uid, usr.sbin/jexec/jexec.c- LOGIN_SETALL & ~LOGIN_SETGROUP & ~LOGIN_SETLOG= IN) !=3D 0) usr.sbin/jexec/jexec.c: err(1, "setusercontext"); usr.sbin/jexec/jexec.c- login_close(lcap); usr.sbin/jexec/jexec.c- } DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@FreeBSD.ORG Mon Aug 16 12:19:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BC2B106564A; Mon, 16 Aug 2010 12:19:36 +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 8AF118FC16; Mon, 16 Aug 2010 12:19:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7GCJaci098190; Mon, 16 Aug 2010 12:19:36 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7GCJanq098188; Mon, 16 Aug 2010 12:19:36 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201008161219.o7GCJanq098188@svn.freebsd.org> From: Ed Schouten Date: Mon, 16 Aug 2010 12:19: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: r211394 - head/usr.bin/script X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2010 12:19:36 -0000 Author: ed Date: Mon Aug 16 12:19:36 2010 New Revision: 211394 URL: http://svn.freebsd.org/changeset/base/211394 Log: Mark functions and variables as static. All these functions and variables are local to this compilation unit, so there is no reason why we shouldn't mark them static. This slightly reduces the binary size. Modified: head/usr.bin/script/script.c Modified: head/usr.bin/script/script.c ============================================================================== --- head/usr.bin/script/script.c Mon Aug 16 11:32:20 2010 (r211393) +++ head/usr.bin/script/script.c Mon Aug 16 12:19:36 2010 (r211394) @@ -63,19 +63,18 @@ static const char sccsid[] = "@(#)script #include #include -FILE *fscript; -int master, slave; -int child; -const char *fname; -int qflg, ttyflg; - -struct termios tt; - -void done(int) __dead2; -void dooutput(void); -void doshell(char **); -void fail(void); -void finish(void); +static FILE *fscript; +static int master, slave; +static int child; +static const char *fname; +static int qflg, ttyflg; + +static struct termios tt; + +static void done(int) __dead2; +static void doshell(char **); +static void fail(void); +static void finish(void); static void usage(void); int @@ -216,7 +215,7 @@ usage(void) exit(1); } -void +static void finish(void) { int e, status; @@ -232,7 +231,7 @@ finish(void) } } -void +static void doshell(char **av) { const char *shell; @@ -254,14 +253,14 @@ doshell(char **av) fail(); } -void +static void fail(void) { (void)kill(0, SIGTERM); done(1); } -void +static void done(int eno) { time_t tvec; From owner-svn-src-all@FreeBSD.ORG Mon Aug 16 12:37:18 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02F7D1065670; Mon, 16 Aug 2010 12:37:18 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC2348FC1A; Mon, 16 Aug 2010 12:37:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7GCbHNh098627; Mon, 16 Aug 2010 12:37:17 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7GCbHeu098625; Mon, 16 Aug 2010 12:37:17 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201008161237.o7GCbHeu098625@svn.freebsd.org> From: Joel Dahl Date: Mon, 16 Aug 2010 12:37: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: r211395 - 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: Mon, 16 Aug 2010 12:37:18 -0000 Author: joel (doc committer) Date: Mon Aug 16 12:37:17 2010 New Revision: 211395 URL: http://svn.freebsd.org/changeset/base/211395 Log: Fix .Dd from last commit. Submitted by Nobuyuki Koganemaru Modified: head/share/man/man4/bwi.4 Modified: head/share/man/man4/bwi.4 ============================================================================== --- head/share/man/man4/bwi.4 Mon Aug 16 12:19:36 2010 (r211394) +++ head/share/man/man4/bwi.4 Mon Aug 16 12:37:17 2010 (r211395) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 30, 2009 +.Dd June 30, 2010 .Dt BWI 4 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Mon Aug 16 14:24:01 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0329B10656AA; Mon, 16 Aug 2010 14:24:01 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC0E18FC1C; Mon, 16 Aug 2010 14:24:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7GEO0Cq000798; Mon, 16 Aug 2010 14:24:00 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7GEO0WV000794; Mon, 16 Aug 2010 14:24:00 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201008161424.o7GEO0WV000794@svn.freebsd.org> From: Andre Oppermann Date: Mon, 16 Aug 2010 14:24: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: r211396 - 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: Mon, 16 Aug 2010 14:24:01 -0000 Author: andre Date: Mon Aug 16 14:24:00 2010 New Revision: 211396 URL: http://svn.freebsd.org/changeset/base/211396 Log: Add uma_zone_get_max() to obtain the effective limit after a call to uma_zone_set_max(). The UMA zone limit is not exactly set to the value supplied but rounded up to completely fill the backing store increment (a page normally). This can lead to surprising situations where the number of elements allocated from UMA is higher than the supplied limit value. The new get function reads back the effective value so that the supplied limit value can be adjusted to the real limit. Reviewed by: jeffr MFC after: 1 week Modified: head/sys/vm/uma.h head/sys/vm/uma_core.c Modified: head/sys/vm/uma.h ============================================================================== --- head/sys/vm/uma.h Mon Aug 16 12:37:17 2010 (r211395) +++ head/sys/vm/uma.h Mon Aug 16 14:24:00 2010 (r211396) @@ -459,6 +459,18 @@ int uma_zone_set_obj(uma_zone_t zone, st void uma_zone_set_max(uma_zone_t zone, int nitems); /* + * Obtains the effective limit on the number of items in a zone + * + * Arguments: + * zone The zone to obtain the effective limit from + * + * Return: + * 0 No limit + * int The effective limit of the zone + */ +int uma_zone_get_max(uma_zone_t zone); + +/* * The following two routines (uma_zone_set_init/fini) * are used to set the backend init/fini pair which acts on an * object as it becomes allocated and is placed in a slab within Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Mon Aug 16 12:37:17 2010 (r211395) +++ head/sys/vm/uma_core.c Mon Aug 16 14:24:00 2010 (r211396) @@ -2797,6 +2797,24 @@ uma_zone_set_max(uma_zone_t zone, int ni } /* See uma.h */ +int +uma_zone_get_max(uma_zone_t zone) +{ + int nitems; + uma_keg_t keg; + + ZONE_LOCK(zone); + keg = zone_first_keg(zone); + if (keg->uk_maxpages) + nitems = keg->uk_maxpages * keg->uk_ipers; + else + nitems = 0; + ZONE_UNLOCK(zone); + + return (nitems); +} + +/* See uma.h */ void uma_zone_set_init(uma_zone_t zone, uma_init uminit) { From owner-svn-src-all@FreeBSD.ORG Mon Aug 16 15:18:31 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 855A91065694; Mon, 16 Aug 2010 15:18:31 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6FFE08FC0C; Mon, 16 Aug 2010 15:18:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7GFIV49002128; Mon, 16 Aug 2010 15:18:31 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7GFIUis002051; Mon, 16 Aug 2010 15:18:30 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201008161518.o7GFIUis002051@svn.freebsd.org> From: Joel Dahl Date: Mon, 16 Aug 2010 15:18: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: r211397 - in head: lib/libbluetooth lib/libc/gen lib/libc/net lib/libc/stdlib lib/libc/sys lib/libedit lib/libelf lib/libgeom lib/libgpib lib/libgssapi lib/libpmc lib/libradius lib/libr... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2010 15:18:31 -0000 Author: joel (doc committer) Date: Mon Aug 16 15:18:30 2010 New Revision: 211397 URL: http://svn.freebsd.org/changeset/base/211397 Log: Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while translating these manual pages. Minor corrections by me. Submitted by: Nobuyuki Koganemaru Modified: head/lib/libbluetooth/bluetooth.3 head/lib/libc/gen/dlopen.3 head/lib/libc/net/inet6_rth_space.3 head/lib/libc/net/sctp_send.3 head/lib/libc/net/sctp_sendmsg.3 head/lib/libc/stdlib/getopt_long.3 head/lib/libc/sys/getfh.2 head/lib/libc/sys/kldstat.2 head/lib/libc/sys/ntp_adjtime.2 head/lib/libc/sys/open.2 head/lib/libc/sys/shm_open.2 head/lib/libedit/editline.3 head/lib/libelf/elf.3 head/lib/libgeom/libgeom.3 head/lib/libgpib/gpib.3 head/lib/libgssapi/gss_accept_sec_context.3 head/lib/libgssapi/gss_acquire_cred.3 head/lib/libgssapi/gssapi.3 head/lib/libpmc/pmc.3 head/lib/libpmc/pmc.corei7.3 head/lib/libpmc/pmc.corei7uc.3 head/lib/libpmc/pmc.westmere.3 head/lib/libpmc/pmc.westmereuc.3 head/lib/libpmc/pmc_event_names_of_class.3 head/lib/libpmc/pmc_read.3 head/lib/libradius/libradius.3 head/lib/librpcsec_gss/rpcsec_gss.3 head/lib/libsdp/sdp.3 head/lib/libusb/libusb20.3 head/lib/libutil/quotafile.3 head/lib/msun/man/fdim.3 head/sbin/devd/devd.conf.5 head/sbin/fsck_ffs/fsck_ffs.8 head/sbin/geom/core/geom.8 head/sbin/hastctl/hastctl.8 head/sbin/hastd/hast.conf.5 head/sbin/ifconfig/ifconfig.8 head/sbin/ipfw/ipfw.8 head/share/man/man4/bktr.4 head/share/man/man4/bt.4 head/share/man/man4/gbde.4 head/share/man/man4/hwpmc.4 head/share/man/man4/ip.4 head/share/man/man4/lmc.4 head/share/man/man4/mac_lomac.4 head/share/man/man4/man4.i386/glxsb.4 head/share/man/man4/meteor.4 head/share/man/man4/mk48txx.4 head/share/man/man4/net80211.4 head/share/man/man4/netgraph.4 head/share/man/man4/ng_btsocket.4 head/share/man/man4/ngatmbase.4 head/share/man/man4/pcm.4 head/share/man/man4/sctp.4 head/share/man/man4/termios.4 head/share/man/man4/u3g.4 head/share/man/man5/mqueuefs.5 head/share/man/man5/periodic.conf.5 head/share/man/man7/bsd.snmpmod.mk.7 head/share/man/man9/DEVICE_PROBE.9 head/share/man/man9/VOP_LISTEXTATTR.9 head/share/man/man9/VOP_VPTOCNP.9 head/share/man/man9/g_geom.9 head/share/man/man9/g_wither_geom.9 head/share/man/man9/ieee80211.9 head/share/man/man9/kproc.9 head/share/man/man9/netisr.9 head/share/man/man9/vm_page_bits.9 head/usr.bin/cpio/bsdcpio.1 head/usr.bin/systat/systat.1 head/usr.sbin/bsnmpd/modules/snmp_bridge/snmp_bridge.3 head/usr.sbin/bsnmpd/modules/snmp_wlan/snmp_wlan.3 head/usr.sbin/freebsd-update/freebsd-update.8 head/usr.sbin/i2c/i2c.8 head/usr.sbin/lmcconfig/lmcconfig.8 head/usr.sbin/nfscbd/nfscbd.8 head/usr.sbin/nfsd/nfsv4.4 head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.8 head/usr.sbin/pciconf/pciconf.8 head/usr.sbin/portsnap/portsnap/portsnap.8 Modified: head/lib/libbluetooth/bluetooth.3 ============================================================================== --- head/lib/libbluetooth/bluetooth.3 Mon Aug 16 14:24:00 2010 (r211396) +++ head/lib/libbluetooth/bluetooth.3 Mon Aug 16 15:18:30 2010 (r211397) @@ -545,7 +545,7 @@ function performs Bluetooth inquiry. The .Fa devname parameter specifies which local Bluetooth device should perform an inquiry. -If not secified, i.e. +If not specified, i.e. .Dv NULL , then first available device will be used. The Modified: head/lib/libc/gen/dlopen.3 ============================================================================== --- head/lib/libc/gen/dlopen.3 Mon Aug 16 14:24:00 2010 (r211396) +++ head/lib/libc/gen/dlopen.3 Mon Aug 16 15:18:30 2010 (r211397) @@ -149,7 +149,7 @@ The same behaviour may be requested by option of the static linker .Xr ld 1 . .It Dv RTLD_NOLOAD -Ony return valid handle for the object if it is already loaded in +Only return valid handle for the object if it is already loaded in the process address space, otherwise .Dv NULL is returned. Modified: head/lib/libc/net/inet6_rth_space.3 ============================================================================== --- head/lib/libc/net/inet6_rth_space.3 Mon Aug 16 14:24:00 2010 (r211396) +++ head/lib/libc/net/inet6_rth_space.3 Mon Aug 16 15:18:30 2010 (r211397) @@ -101,7 +101,8 @@ The .Fn inet6_rth_init function initializes the pre-allocated buffer pointed to by .Fa bp -to contain a routing header of the specified type The +to contain a routing header of the specified type. +The .Fa bp_len argument is used to verify that the buffer is large enough. The caller must allocate the buffer pointed to by bp. Modified: head/lib/libc/net/sctp_send.3 ============================================================================== --- head/lib/libc/net/sctp_send.3 Mon Aug 16 14:24:00 2010 (r211396) +++ head/lib/libc/net/sctp_send.3 Mon Aug 16 15:18:30 2010 (r211397) @@ -187,7 +187,7 @@ The .Fa sinfo->sinfo_timetolive argument is then a number of milliseconds for which the data is attempted to be transmitted. -If that many milliseconds ellapse +If that many milliseconds elapse and the peer has not acknowledged the data, the data will be skipped and no longer transmitted. Note that this policy does Modified: head/lib/libc/net/sctp_sendmsg.3 ============================================================================== --- head/lib/libc/net/sctp_sendmsg.3 Mon Aug 16 14:24:00 2010 (r211396) +++ head/lib/libc/net/sctp_sendmsg.3 Mon Aug 16 15:18:30 2010 (r211397) @@ -180,7 +180,7 @@ to find the association but also as the .Pp For a one-to-many type (SOCK_SEQPACKET) socket the flag .Dv SCTP_SENDALL -can be used as a convient way to make one send call and have +can be used as a convenient way to make one send call and have all associations that are under the socket get a copy of the message. Note that this mechanism is quite efficient and makes only one actual copy of the data which is shared by all the associations for sending. @@ -199,7 +199,7 @@ The .Fa timetolive argument is then a number of milliseconds for which the data is attempted to be transmitted. -If that many milliseconds ellapse +If that many milliseconds elapse and the peer has not acknowledged the data, the data will be skipped and no longer transmitted. Note that this policy does Modified: head/lib/libc/stdlib/getopt_long.3 ============================================================================== --- head/lib/libc/stdlib/getopt_long.3 Mon Aug 16 14:24:00 2010 (r211396) +++ head/lib/libc/stdlib/getopt_long.3 Mon Aug 16 15:18:30 2010 (r211397) @@ -469,9 +469,9 @@ The .Fn getopt_long and .Fn getopt_long_only -functions first appeared in +functions first appeared in the .Tn GNU -libiberty. +libiberty library. The first .Bx implementation of Modified: head/lib/libc/sys/getfh.2 ============================================================================== --- head/lib/libc/sys/getfh.2 Mon Aug 16 14:24:00 2010 (r211396) +++ head/lib/libc/sys/getfh.2 Mon Aug 16 15:18:30 2010 (r211397) @@ -69,7 +69,7 @@ These system calls are restricted to the The .Fn getfh and -.Fn lgetfgh +.Fn lgetfh system calls fail if one or more of the following are true: .Bl -tag -width Er Modified: head/lib/libc/sys/kldstat.2 ============================================================================== --- head/lib/libc/sys/kldstat.2 Mon Aug 16 14:24:00 2010 (r211396) +++ head/lib/libc/sys/kldstat.2 Mon Aug 16 15:18:30 2010 (r211397) @@ -129,6 +129,6 @@ The interface first appeared in .Fx 3.0 . .Sh BUGS -The pathname many not be accurate if the file system mounts have +The pathname may not be accurate if the file system mounts have changed since the module was loaded, or if this function is called within a chrooted environment. Modified: head/lib/libc/sys/ntp_adjtime.2 ============================================================================== --- head/lib/libc/sys/ntp_adjtime.2 Mon Aug 16 14:24:00 2010 (r211396) +++ head/lib/libc/sys/ntp_adjtime.2 Mon Aug 16 15:18:30 2010 (r211397) @@ -284,7 +284,7 @@ At the end of the day, second 23:59:59 w .It TIME_OOP Leap second in progress. .It TIME_WAIT -Leap second has occurred within the last few seconds.. +Leap second has occurred within the last few seconds. .It TIME_ERROR Clock not synchronized. .El Modified: head/lib/libc/sys/open.2 ============================================================================== --- head/lib/libc/sys/open.2 Mon Aug 16 14:24:00 2010 (r211396) +++ head/lib/libc/sys/open.2 Mon Aug 16 15:18:30 2010 (r211397) @@ -296,9 +296,9 @@ created has its immutable flag set, see .Xr chflags 2 manual page for more information. .It Bq Er EPERM -.Dv The named file has its immutable flag set and the file is to be modified. +The named file has its immutable flag set and the file is to be modified. .It Bq Er EPERM -.Dv The named file has its append-only flag set, the file is to be modified, and +The named file has its append-only flag set, the file is to be modified, and .Dv O_TRUNC is specified or .Dv O_APPEND Modified: head/lib/libc/sys/shm_open.2 ============================================================================== --- head/lib/libc/sys/shm_open.2 Mon Aug 16 14:24:00 2010 (r211396) +++ head/lib/libc/sys/shm_open.2 Mon Aug 16 15:18:30 2010 (r211397) @@ -231,7 +231,7 @@ is specified and the named shared memory .Dv O_CREAT and .Dv O_EXCL -are specified and the named shared memory object dies exist. +are specified and the named shared memory object does exist. .It Bq Er EACCES The required permissions (for reading or reading and writing) are denied. .El Modified: head/lib/libedit/editline.3 ============================================================================== --- head/lib/libedit/editline.3 Mon Aug 16 14:24:00 2010 (r211396) +++ head/lib/libedit/editline.3 Mon Aug 16 15:18:30 2010 (r211397) @@ -738,7 +738,7 @@ and before a new line is to be tokenized .It Fn tok_line Tokenize .Fa li , -If successful, modify: +if successful, modify .Fa argv to contain the words, .Fa argc Modified: head/lib/libelf/elf.3 ============================================================================== --- head/lib/libelf/elf.3 Mon Aug 16 14:24:00 2010 (r211396) +++ head/lib/libelf/elf.3 Mon Aug 16 15:18:30 2010 (r211397) @@ -463,7 +463,7 @@ Close an ELF descriptor and release all .It Fn elf_memory Opens an .Xr ar 1 -archive or ELF object present in a memory arena. +archive or ELF object present in a memory area. .It Fn elf_version Sets the operating version. .El @@ -563,7 +563,7 @@ descriptor and can set the member of the descriptor to point to a region of memory allocated using .Xr malloc 3 . -It is the applications responsibility to free this arena, though the +It is the applications responsibility to free this area, though the library will reclaim the space used by the .Vt Elf_Data descriptor itself. Modified: head/lib/libgeom/libgeom.3 ============================================================================== --- head/lib/libgeom/libgeom.3 Mon Aug 16 14:24:00 2010 (r211396) +++ head/lib/libgeom/libgeom.3 Mon Aug 16 15:18:30 2010 (r211397) @@ -392,4 +392,4 @@ library appeared in .Sh AUTHORS .An Poul-Henning Kamp Aq phk@FreeBSD.org .An Lukas Ertl Aq le@FreeBSD.org -.An Pawel Jakub Dawidek pjd@FreeBSD.org +.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org Modified: head/lib/libgpib/gpib.3 ============================================================================== --- head/lib/libgpib/gpib.3 Mon Aug 16 14:24:00 2010 (r211396) +++ head/lib/libgpib/gpib.3 Mon Aug 16 15:18:30 2010 (r211397) @@ -524,7 +524,7 @@ is used to configure the parallel poll r .Fa v . .Em This function is currently not implemented. .Pp -The fucntion +The function .Fn ibrd is used to receive .Fa cnt Modified: head/lib/libgssapi/gss_accept_sec_context.3 ============================================================================== --- head/lib/libgssapi/gss_accept_sec_context.3 Mon Aug 16 14:24:00 2010 (r211396) +++ head/lib/libgssapi/gss_accept_sec_context.3 Mon Aug 16 15:18:30 2010 (r211397) @@ -121,7 +121,7 @@ following restrictions apply to the outp .Pp The value returned via the .Fa time_rec -parameter is undefined Unless the +parameter is undefined unless the accompanying .Fa ret_flags parameter contains the bit Modified: head/lib/libgssapi/gss_acquire_cred.3 ============================================================================== --- head/lib/libgssapi/gss_acquire_cred.3 Mon Aug 16 14:24:00 2010 (r211396) +++ head/lib/libgssapi/gss_acquire_cred.3 Mon Aug 16 15:18:30 2010 (r211397) @@ -184,7 +184,7 @@ Type contained within desired_name param .It GSS_S_BAD_NAME Value supplied for desired_name parameter is ill formed. .It GSS_S_CREDENTIALS_EXPIRED -The credentials could not be acquired Because they have expired. +The credentials could not be acquired because they have expired. .It GSS_S_NO_CRED No credentials were found for the specified name. .El Modified: head/lib/libgssapi/gssapi.3 ============================================================================== --- head/lib/libgssapi/gssapi.3 Mon Aug 16 14:24:00 2010 (r211396) +++ head/lib/libgssapi/gssapi.3 Mon Aug 16 15:18:30 2010 (r211397) @@ -139,7 +139,7 @@ GSS-API Context-Level Routines: .It gss_init_sec_context Initiate a security context with a peer application .It gss_accept_sec_context - Accept a security context initiated by a peer application +Accept a security context initiated by a peer application .It gss_delete_sec_context Discard a security context .It gss_process_context_token Modified: head/lib/libpmc/pmc.3 ============================================================================== --- head/lib/libpmc/pmc.3 Mon Aug 16 14:24:00 2010 (r211396) +++ head/lib/libpmc/pmc.3 Mon Aug 16 15:18:30 2010 (r211397) @@ -48,7 +48,7 @@ Performance monitoring counters (PMCs) a using a software abstraction. These .Dq abstract -PMCs can have one two scopes: +PMCs can have two scopes: .Bl -bullet .It System scope. Modified: head/lib/libpmc/pmc.corei7.3 ============================================================================== --- head/lib/libpmc/pmc.corei7.3 Mon Aug 16 14:24:00 2010 (r211396) +++ head/lib/libpmc/pmc.corei7.3 Mon Aug 16 15:18:30 2010 (r211397) @@ -993,7 +993,7 @@ Counting: Faulting executions of GETSEC/ count as retired instructions. .It Li INST_RETIRED.X87 .Pq Event C0H , Umask 02H -Counts the number of MMX instructions retired:. +Counts the number of MMX instructions retired. .It Li INST_RETIRED.MMX .Pq Event C0H , Umask 04H Counts the number of floating point computational operations retired: Modified: head/lib/libpmc/pmc.corei7uc.3 ============================================================================== --- head/lib/libpmc/pmc.corei7uc.3 Mon Aug 16 14:24:00 2010 (r211396) +++ head/lib/libpmc/pmc.corei7uc.3 Mon Aug 16 15:18:30 2010 (r211397) @@ -434,7 +434,7 @@ Counts cycles all the entries in the DRA occupied with isochronous read requests. .It Li QMC_ISOC_FULL.READ.CH1 .Pq Event 28H , Umask 02H -Counts cycles all the entries in the DRAM channel 1high priority queue are +Counts cycles all the entries in the DRAM channel 1 high priority queue are occupied with isochronous read requests. .It Li QMC_ISOC_FULL.READ.CH2 .Pq Event 28H , Umask 04H Modified: head/lib/libpmc/pmc.westmere.3 ============================================================================== --- head/lib/libpmc/pmc.westmere.3 Mon Aug 16 14:24:00 2010 (r211396) +++ head/lib/libpmc/pmc.westmere.3 Mon Aug 16 15:18:30 2010 (r211397) @@ -975,7 +975,7 @@ Counting: Faulting executions of GETSEC/ count as retired instructions. .It Li INST_RETIRED.X87 .Pq Event C0H , Umask 02H -Counts the number of floating point computational operations retired: +Counts the number of floating point computational operations retired floating point computational operations executed by the assist handler and sub-operations of complex floating point instructions like transcendental instructions. Modified: head/lib/libpmc/pmc.westmereuc.3 ============================================================================== --- head/lib/libpmc/pmc.westmereuc.3 Mon Aug 16 14:24:00 2010 (r211396) +++ head/lib/libpmc/pmc.westmereuc.3 Mon Aug 16 15:18:30 2010 (r211397) @@ -464,7 +464,7 @@ Counts cycles all the entries in the DRA occupied with isochronous read requests. .It Li QMC_ISOC_FULL.READ.CH1 .Pq Event 28H , Umask 02H -Counts cycles all the entries in the DRAM channel 1high priority queue are +Counts cycles all the entries in the DRAM channel 1 high priority queue are occupied with isochronous read requests. .It Li QMC_ISOC_FULL.READ.CH2 .Pq Event 28H , Umask 04H Modified: head/lib/libpmc/pmc_event_names_of_class.3 ============================================================================== --- head/lib/libpmc/pmc_event_names_of_class.3 Mon Aug 16 14:24:00 2010 (r211396) +++ head/lib/libpmc/pmc_event_names_of_class.3 Mon Aug 16 15:18:30 2010 (r211397) @@ -68,7 +68,7 @@ Argument .Fa cl was invalid. .It Bq Er ENOMEM -Allocation of a memory arena to hold the result failed. +Allocation of a memory area to hold the result failed. .El .Sh SEE ALSO .Xr pmc 3 , Modified: head/lib/libpmc/pmc_read.3 ============================================================================== --- head/lib/libpmc/pmc_read.3 Mon Aug 16 14:24:00 2010 (r211396) +++ head/lib/libpmc/pmc_read.3 Mon Aug 16 15:18:30 2010 (r211397) @@ -46,7 +46,7 @@ These functions read and write the curre .Pp Function .Fn pmc_read -with read the current value of the PMC specified by argument +will read the current value of the PMC specified by argument .Fa pmc and write it to the location specified by argument .Fa value . Modified: head/lib/libradius/libradius.3 ============================================================================== --- head/lib/libradius/libradius.3 Mon Aug 16 14:24:00 2010 (r211396) +++ head/lib/libradius/libradius.3 Mon Aug 16 15:18:30 2010 (r211397) @@ -464,7 +464,7 @@ subsequent library calls using the same To free the resources used by the RADIUS library, call .Fn rad_close . .Ss Server operation -Server mode operates much alike to client mode, except packet send and receieve +Server mode operates much alike to client mode, except packet send and receive steps are swapped. To operate as server you should obtain server context with .Fn rad_server_open function, passing opened and bound UDP socket file descriptor as argument. Modified: head/lib/librpcsec_gss/rpcsec_gss.3 ============================================================================== --- head/lib/librpcsec_gss/rpcsec_gss.3 Mon Aug 16 14:24:00 2010 (r211396) +++ head/lib/librpcsec_gss/rpcsec_gss.3 Mon Aug 16 15:18:30 2010 (r211397) @@ -68,7 +68,7 @@ typedef enum { .Ed .It Vt rpc_gss_options_ret_t This structure contains various optional values which are used while -creating a security contect. +creating a security context. .Bd -literal typedef struct { int req_flags; /* GSS request bits */ Modified: head/lib/libsdp/sdp.3 ============================================================================== --- head/lib/libsdp/sdp.3 Mon Aug 16 14:24:00 2010 (r211396) +++ head/lib/libsdp/sdp.3 Mon Aug 16 15:18:30 2010 (r211397) @@ -270,7 +270,7 @@ Note: attributes are returned in the ord Attribute Response. SDP server could return several attributes for the same record. In this case the order of the attributes will be: all attributes for the first -records, then all attributes for the secord record etc. +records, then all attributes for the second record etc. .Pp The .Fn sdp_attr2desc Modified: head/lib/libusb/libusb20.3 ============================================================================== --- head/lib/libusb/libusb20.3 Mon Aug 16 14:24:00 2010 (r211396) +++ head/lib/libusb/libusb20.3 Mon Aug 16 15:18:30 2010 (r211397) @@ -524,7 +524,7 @@ returns a zero terminated string describ .Pp . .Fn libusb20_dev_get_info -retrives the BSD specific usb_device_info structure into the memory location given by +retrieves the BSD specific usb_device_info structure into the memory location given by .Fa pinfo . The USB device given by .Fa pdev Modified: head/lib/libutil/quotafile.3 ============================================================================== --- head/lib/libutil/quotafile.3 Mon Aug 16 14:24:00 2010 (r211396) +++ head/lib/libutil/quotafile.3 Mon Aug 16 15:18:30 2010 (r211397) @@ -121,7 +121,7 @@ The .Fn quota_on function enables quotas for the filesystem associated with its .Va qf -argument which may have been opened +argument which may have been opened with .Dv O_RDONLY or .Dv O_RDWR . @@ -138,7 +138,7 @@ The .Fn quota_off function disables quotas for the filesystem associated with its .Va qf -argument which may have been opened +argument which may have been opened with .Dv O_RDONLY or .Dv O_RDWR . Modified: head/lib/msun/man/fdim.3 ============================================================================== --- head/lib/msun/man/fdim.3 Mon Aug 16 14:24:00 2010 (r211396) +++ head/lib/msun/man/fdim.3 Mon Aug 16 15:18:30 2010 (r211397) @@ -65,7 +65,7 @@ is an \*(Na, then an \*(Na is returned. Otherwise, the result is .Li +0.0 . .Pp -Overflow or underflow may occur iff the exact result is not +Overflow or underflow may occur if the exact result is not representable in the return type. No other exceptions are raised. .Sh SEE ALSO Modified: head/sbin/devd/devd.conf.5 ============================================================================== --- head/sbin/devd/devd.conf.5 Mon Aug 16 14:24:00 2010 (r211396) +++ head/sbin/devd/devd.conf.5 Mon Aug 16 15:18:30 2010 (r211397) @@ -380,7 +380,7 @@ USB device is detached from the system. .Bl -tag -width ".Li DETACH" -compact .It Sy Type .It Li ATTACH -USB interface is attached from a device. +USB interface is attached to a device. .It Li DETACH USB interface is detached from a device. .El Modified: head/sbin/fsck_ffs/fsck_ffs.8 ============================================================================== --- head/sbin/fsck_ffs/fsck_ffs.8 Mon Aug 16 14:24:00 2010 (r211396) +++ head/sbin/fsck_ffs/fsck_ffs.8 Mon Aug 16 15:18:30 2010 (r211397) @@ -179,7 +179,7 @@ and block 160 for UFS2. Check if file system was dismounted cleanly. If so, skip file system checks (like "preen"). However, if the file system was not cleanly dismounted, do full checks, -is if +as if .Nm was invoked without .Fl C . Modified: head/sbin/geom/core/geom.8 ============================================================================== --- head/sbin/geom/core/geom.8 Mon Aug 16 14:24:00 2010 (r211396) +++ head/sbin/geom/core/geom.8 Mon Aug 16 15:18:30 2010 (r211397) @@ -84,7 +84,7 @@ Load the kernel module that implements t This command is only available if the class does not yet exist in the kernel and the file .Pa geom_ Ns Ao Ar class Ac Ns Pa .ko -can be found in one of the directories specifed in +can be found in one of the directories specified in .Va kern.module_path sysctl. .It Cm unload Modified: head/sbin/hastctl/hastctl.8 ============================================================================== --- head/sbin/hastctl/hastctl.8 Mon Aug 16 14:24:00 2010 (r211396) +++ head/sbin/hastctl/hastctl.8 Mon Aug 16 15:18:30 2010 (r211397) @@ -105,7 +105,7 @@ The default extent size is Maximum number of dirty extents to keep dirty all the time. Most recently used extents are kept dirty to reduce number of metadata updates. -The default numer of most recently used extents which will be kept +The default number of most recently used extents which will be kept dirty is .Va 64 . .It Fl m Ar mediasize Modified: head/sbin/hastd/hast.conf.5 ============================================================================== --- head/sbin/hastd/hast.conf.5 Mon Aug 16 14:24:00 2010 (r211396) +++ head/sbin/hastd/hast.conf.5 Mon Aug 16 15:18:30 2010 (r211397) @@ -34,7 +34,7 @@ .Nm hast.conf .Nd configuration file for the .Xr hastd 8 -deamon and the +daemon and the .Xr hastctl 8 utility. .Sh DESCRIPTION Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Mon Aug 16 14:24:00 2010 (r211396) +++ head/sbin/ifconfig/ifconfig.8 Mon Aug 16 15:18:30 2010 (r211397) @@ -939,7 +939,7 @@ should be used by specifying ``6:g''. Similarly the channel width can be specified by appending it with ``/''; e.g. ``6/40'' specifies a 40MHz wide channel, These attributes can be combined as in: ``6:ht/40''. -The full set of flags specified following a `:'' are: +The full set of flags specified following a ``:'' are: .Cm a (802.11a), .Cm b @@ -966,7 +966,7 @@ The full set of channel widths following (20MHz mostly for use in specifying ht20), and .Cm 40 -(40MHz mostly for use in specifying ht40), +(40MHz mostly for use in specifying ht40). In addition, a 40MHz HT channel specification may include the location of the extension channel by appending ``+'' or ``-'' for above and below, @@ -999,7 +999,7 @@ according to a least-congested criteria. DFS support is mandatory for some 5Ghz frequencies in certain locales (e.g. ETSI). By default DFS is enabled according to the regulatory definitions -specified in /etc/regdomain.xml and the curent country code, regdomain, +specified in /etc/regdomain.xml and the current country code, regdomain, and channel. Note the underlying device (and driver) must support radar detection for full DFS support to work. @@ -1719,7 +1719,7 @@ If an .Ar index is not given, key 1 is set. A WEP key will be either 5 or 13 -characters (40 or 104 bits) depending of the local network and the +characters (40 or 104 bits) depending on the local network and the capabilities of the adaptor. It may be specified either as a plain string or as a string of hexadecimal digits preceded by @@ -1942,7 +1942,7 @@ Nodes on the mesh without a path to this discover a path to us. .It Cm PROACTIVE Send broadcast path requests every two seconds and every node must reply with -with a path reply even if it already has a path to this root mesh station, +with a path reply even if it already has a path to this root mesh station. .It Cm RANN Send broadcast root announcement (RANN) frames. Nodes on the mesh without a path to this root mesh station with try to Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Mon Aug 16 14:24:00 2010 (r211396) +++ head/sbin/ipfw/ipfw.8 Mon Aug 16 15:18:30 2010 (r211397) @@ -1917,7 +1917,7 @@ and .Pp The SCHED_MASK is used to assign flows to one or more scheduler instances, one for each -value of the packet's 5-fuple after applying SCHED_MASK. +value of the packet's 5-tuple after applying SCHED_MASK. As an example, using ``src-ip 0xffffff00'' creates one instance for each /24 destination subnet. .Pp @@ -2098,7 +2098,7 @@ with either delay or probability first, to the chosen format. The unit for delay is milliseconds. Data points do not need to be sorted. -Also, tne number of actual lines can be different +Also, the number of actual lines can be different from the value of the "samples" parameter: .Nm utility will sort and interpolate Modified: head/share/man/man4/bktr.4 ============================================================================== --- head/share/man/man4/bktr.4 Mon Aug 16 14:24:00 2010 (r211396) +++ head/share/man/man4/bktr.4 Mon Aug 16 15:18:30 2010 (r211397) @@ -128,7 +128,7 @@ is set to an integer from 1 to 23 taken .Em sysctl hw.bt848.tuner=nnnn This can be used to override the tuner make which was detected at boot time. .Ql nnnn -is set to an integer from 1 to 16 taken from the following table: +is set to an integer from 0 to 16 taken from the following table: .Pp .Bl -tag -compact -width 22n .It NO_TUNER Modified: head/share/man/man4/bt.4 ============================================================================== --- head/share/man/man4/bt.4 Mon Aug 16 14:24:00 2010 (r211396) +++ head/share/man/man4/bt.4 Mon Aug 16 15:18:30 2010 (r211397) @@ -57,7 +57,7 @@ MultiMaster "W" Series Host Adapters: .Pp .Em "Adapter Bus Commands Description" BT-948 PCI 192 Ultra SCSI-3 -BT-958 PCI 192 Wide ULtra SCSI-3 +BT-958 PCI 192 Wide Ultra SCSI-3 BT-958D PCI 192 Wide Differential Ultra SCSI-3 .El .Bl -column "BT-956CD " "ISA " "Commands " Description Modified: head/share/man/man4/gbde.4 ============================================================================== --- head/share/man/man4/gbde.4 Mon Aug 16 14:24:00 2010 (r211396) +++ head/share/man/man4/gbde.4 Mon Aug 16 15:18:30 2010 (r211397) @@ -127,7 +127,7 @@ a very impossible task. .Pp Armed with one or more sector keys, our patient attacker will then go through essentially the same exercise, using the sector key and the -encrypted sector key to find the key used to encrypt the sectorkey. +encrypted sector key to find the key used to encrypt the sector key. .Pp Armed with one or more of these .Dq kkeys , Modified: head/share/man/man4/hwpmc.4 ============================================================================== --- head/share/man/man4/hwpmc.4 Mon Aug 16 14:24:00 2010 (r211396) +++ head/share/man/man4/hwpmc.4 Mon Aug 16 15:18:30 2010 (r211397) @@ -81,7 +81,7 @@ Some architectures offer faster methods .It Em Sampling In sampling modes, the PMCs are configured to sample the CPU instruction pointer (and optionally to capture the call chain leading -upto the sampled instruction pointer) after a configurable number of +up to the sampled instruction pointer) after a configurable number of hardware events have been observed. Instruction pointer samples and call chain records are usually directed to a log file for subsequent analysis. Modified: head/share/man/man4/ip.4 ============================================================================== --- head/share/man/man4/ip.4 Mon Aug 16 14:24:00 2010 (r211396) +++ head/share/man/man4/ip.4 Mon Aug 16 15:18:30 2010 (r211397) @@ -757,7 +757,7 @@ and .Va ip_off fields .Em must -be provided in host byte order . +be provided in host byte order. All other fields must be provided in network byte order. See .Xr byteorder 3 Modified: head/share/man/man4/lmc.4 ============================================================================== --- head/share/man/man4/lmc.4 Mon Aug 16 14:24:00 2010 (r211396) +++ head/share/man/man4/lmc.4 Mon Aug 16 15:18:30 2010 (r211397) @@ -517,7 +517,7 @@ packets occasionally. .Ss Device Polling .\" A T3 receiver can generate over 100K interrupts per second, -This can cause a system to +this can cause a system to .Dq live-lock : spend all of its time servicing interrupts. Modified: head/share/man/man4/mac_lomac.4 ============================================================================== --- head/share/man/man4/mac_lomac.4 Mon Aug 16 14:24:00 2010 (r211396) +++ head/share/man/man4/mac_lomac.4 Mon Aug 16 15:18:30 2010 (r211397) @@ -63,7 +63,7 @@ which protects the integrity of system o an information flow policy coupled with the subject demotion via floating labels. In LOMAC, all system subjects and objects are assigned integrity labels, made -up of one or more hierarchal grades, depending on the their types. +up of one or more hierarchial grades, depending on the their types. Together, these label elements permit all labels to be placed in a partial order, with information flow protections and demotion decisions based on a dominance operator Modified: head/share/man/man4/man4.i386/glxsb.4 ============================================================================== --- head/share/man/man4/man4.i386/glxsb.4 Mon Aug 16 14:24:00 2010 (r211396) +++ head/share/man/man4/man4.i386/glxsb.4 Mon Aug 16 15:18:30 2010 (r211397) @@ -94,4 +94,4 @@ by It was ported to .Fx by -.An Patrick Lamaiziere Aq patfbsd@davenulle.org +.An Patrick Lamaiziere Aq patfbsd@davenulle.org . Modified: head/share/man/man4/meteor.4 ============================================================================== --- head/share/man/man4/meteor.4 Mon Aug 16 14:24:00 2010 (r211396) +++ head/share/man/man4/meteor.4 Mon Aug 16 15:18:30 2010 (r211397) @@ -525,7 +525,7 @@ The .Dv METEORSETGEO will also attempt to reallocate a new contiguous kernel buffer if the new geometry exceeds the old geometry. -On +On the other hand, if the new geometry will fit in the existing buffer, the existing buffer is used. .Pp Modified: head/share/man/man4/mk48txx.4 ============================================================================== --- head/share/man/man4/mk48txx.4 Mon Aug 16 14:24:00 2010 (r211396) +++ head/share/man/man4/mk48txx.4 Mon Aug 16 15:18:30 2010 (r211397) @@ -158,7 +158,7 @@ When this flag is set, the .Nm driver will register as a watchdog via the interface defined in -.Xr 9 watchdog +.Xr watchdog 9 if supported by the specific chip model. .It Dv MK48TXX_WDOG_ENABLE_WDS When this flag is set, Modified: head/share/man/man4/net80211.4 ============================================================================== --- head/share/man/man4/net80211.4 Mon Aug 16 14:24:00 2010 (r211396) +++ head/share/man/man4/net80211.4 Mon Aug 16 15:18:30 2010 (r211397) @@ -230,7 +230,7 @@ Return the MAC address for the current B .Va i_data . When the interface is running, the bssid is either the value configured locally (e.g. for an IBSS network started by the local station) -or the value adopted when joing an existing network. +or the value adopted when joining an existing network. For WDS interfaces this value is the address of the remote station. When the interface is not running, the bssid returned is the desired bssid, if any, that has been configured. @@ -485,12 +485,12 @@ and .It Dv IEEE80211_IOC_PUREG Return whether ``pure 11g'' mode is enabled in .Va i_val . -This setting is meaningful only for acces point operation; +This setting is meaningful only for access point operation; when non-zero, 802.11b stations will not be allowed to associate. .It Dv IEEE80211_IOC_PUREN Return whether ``pure 11n'' mode is enabled in .Va i_val . -This setting is meaningful only for acces point operation; +This setting is meaningful only for access point operation; when non-zero, legacy (non-11n capable) stations will not be allowed to associate. .It Dv IEEE80211_IOC_REGDOMAIN @@ -595,7 +595,7 @@ Return whether Atheros Dynamic Turbo mod Dynamic Turbo mode is a non-standard protocol extension available only on Atheros devices where channel width is dynamically changed between 20MHz and 40MHz. -Note tht enabling Dynamic Turbo mode support does not guarantee use; +Note that enabling Dynamic Turbo mode support does not guarantee use; both client and access point must use Atheros devices and support must be enabled on both sides. .It Dv IEEE80211_IOC_TXPARAMS @@ -654,7 +654,7 @@ together with an optional IEEE80211_WMEP parameter for the BSS or the channel is desired. If WME is not supported then .Er EINVAL -wil be returned. +will be returned. .It Dv IEEE80211_IOC_WME_CWMAX Return the WME CWmax setting (log2) for the specified Access Class (AC) in .Va i_val . Modified: head/share/man/man4/netgraph.4 ============================================================================== --- head/share/man/man4/netgraph.4 Mon Aug 16 14:24:00 2010 (r211396) +++ head/share/man/man4/netgraph.4 Mon Aug 16 15:18:30 2010 (r211397) @@ -531,7 +531,7 @@ The message can be examined using the macro, or completely extracted from the item using the .Fn NGI_GET_MSG which also removes the reference within the item. -If the Item still holds a reference to the message when it is freed +If the item still holds a reference to the message when it is freed (using the .Fn NG_FREE_ITEM macro), then the message will also be freed appropriately. Modified: head/share/man/man4/ng_btsocket.4 ============================================================================== --- head/share/man/man4/ng_btsocket.4 Mon Aug 16 14:24:00 2010 (r211396) +++ head/share/man/man4/ng_btsocket.4 Mon Aug 16 15:18:30 2010 (r211397) @@ -69,7 +69,7 @@ struct sockaddr_hci { }; .Ed .Pp -Raw HCI sockets support number of +Raw HCI sockets support a number of .Xr ioctl 2 requests such as: .Bl -tag -width indent Modified: head/share/man/man4/ngatmbase.4 ============================================================================== --- head/share/man/man4/ngatmbase.4 Mon Aug 16 14:24:00 2010 (r211396) +++ head/share/man/man4/ngatmbase.4 Mon Aug 16 15:18:30 2010 (r211397) @@ -110,7 +110,7 @@ The list of pieces must be terminated by The .Fn uni_msg_destroy function -destroyes the messages and frees all the messages's memory. +destroys the messages and frees all the messages's memory. .Pp The .Fn uni_msg_unpack_mbuf Modified: head/share/man/man4/pcm.4 ============================================================================== --- head/share/man/man4/pcm.4 Mon Aug 16 14:24:00 2010 (r211396) +++ head/share/man/man4/pcm.4 Mon Aug 16 15:18:30 2010 (r211397) @@ -341,7 +341,7 @@ The sound system will dynamically create Set to .Dq 0 if no -.Tn VCHANS +.Tn VCHANs are desired. Maximum value is 256. .It Va hw.snd.report_soft_formats Modified: head/share/man/man4/sctp.4 ============================================================================== --- head/share/man/man4/sctp.4 Mon Aug 16 14:24:00 2010 (r211396) +++ head/share/man/man4/sctp.4 Mon Aug 16 15:18:30 2010 (r211397) @@ -203,7 +203,7 @@ association. .It Dv SCTP_INITMSG This option allows you to get or set the default sending parameters when an association is implicitly setup. -It allows you to change such things as the maxium number of +It allows you to change such things as the maximum number of streams allowed inbound and the number of streams requested of the peer. .It Dv SCTP_AUTOCLOSE @@ -278,7 +278,7 @@ By default, when opening an IPV6 socket, data arrives on the socket from a peer's V4 address the V4 address will be presented with an address family of AF_INET. -If this is undesireable, then this option +If this is undesirable, then this option can be enabled which will then convert all V4 addresses into mapped V6 representations. .It Dv SCTP_MAXSEG @@ -338,8 +338,8 @@ a peer. This option will let you get or set the list of HMAC algorithms used to authenticate peers. Note that the HMAC values are in priority order where -the first HMAC identifier is the most prefered -and the last is the least prefered. +the first HMAC identifier is the most preferred +and the last is the least preferred. .It Dv SCTP_AUTH_ACTIVE_KEY This option allows you to make a key active for the generation of authentication information. Modified: head/share/man/man4/termios.4 ============================================================================== --- head/share/man/man4/termios.4 Mon Aug 16 14:24:00 2010 (r211396) +++ head/share/man/man4/termios.4 Mon Aug 16 15:18:30 2010 (r211397) @@ -1053,7 +1053,7 @@ overflowing the input queue. The precise conditions under which .Dv STOP and -START +.Dv START characters are transmitted are implementation defined. .Pp If Modified: head/share/man/man4/u3g.4 ============================================================================== --- head/share/man/man4/u3g.4 Mon Aug 16 14:24:00 2010 (r211396) +++ head/share/man/man4/u3g.4 Mon Aug 16 15:18:30 2010 (r211397) @@ -90,7 +90,7 @@ additional commands to switch it to mode The .Xr u3gstub 4 device will attach temporarily to a 3G device with a mass storage device and -force it to switch to modem mode, +force it to switch to modem mode. The attach and detach of .Xr u3gstub and any driver disk device present on the 3G device is hidden, unless the Modified: head/share/man/man5/mqueuefs.5 ============================================================================== --- head/share/man/man5/mqueuefs.5 Mon Aug 16 14:24:00 2010 (r211396) +++ head/share/man/man5/mqueuefs.5 Mon Aug 16 15:18:30 2010 (r211397) @@ -36,7 +36,7 @@ .Sh SYNOPSIS To link into kernel: .Pp -.D1 Cd "options P1003_1B_MQUEUE" +.Cd "options P1003_1B_MQUEUE" .Pp To load as a kernel loadable module: .Pp Modified: head/share/man/man5/periodic.conf.5 ============================================================================== --- head/share/man/man5/periodic.conf.5 Mon Aug 16 14:24:00 2010 (r211396) +++ head/share/man/man5/periodic.conf.5 Mon Aug 16 15:18:30 2010 (r211397) @@ -629,7 +629,7 @@ The default value if no value is set is The same as .Va daily_scrub_zfs_default_threshold but specific to the pool -.Va Ns Ao Ar poolname Ac Ns . +.Ao Ar poolname Ac Ns . .It Va daily_local .Pq Vt str Set to a list of extra scripts that should be run after all other Modified: head/share/man/man7/bsd.snmpmod.mk.7 ============================================================================== --- head/share/man/man7/bsd.snmpmod.mk.7 Mon Aug 16 14:24:00 2010 (r211396) +++ head/share/man/man7/bsd.snmpmod.mk.7 Mon Aug 16 15:18:30 2010 (r211397) @@ -67,7 +67,7 @@ A list of extra MIB definition files for .Xr gensnmptree 1 . This is optional. This file list is given to both calls to -.Xr gensnmptree 1 \(em +.Xr gensnmptree 1 No \(em the one that extracts the symbols in .Va XSYM from the MIB definitions and the one that Modified: head/share/man/man9/DEVICE_PROBE.9 ============================================================================== --- head/share/man/man9/DEVICE_PROBE.9 Mon Aug 16 14:24:00 2010 (r211396) +++ head/share/man/man9/DEVICE_PROBE.9 Mon Aug 16 15:18:30 2010 (r211397) @@ -91,7 +91,7 @@ magical about them. .Bl -tag -width BUS_PROBE_NOWILDCARD .It BUS_PROBE_SPECIFIC The device that cannot be reprobed, and that no -possible other driver may exist (typically legacy drivers who don't fallow +possible other driver may exist (typically legacy drivers who don't follow all the rules, or special needs drivers). .It BUS_PROBE_VENDOR The device is supported by a vendor driver. Modified: head/share/man/man9/VOP_LISTEXTATTR.9 ============================================================================== --- head/share/man/man9/VOP_LISTEXTATTR.9 Mon Aug 16 14:24:00 2010 (r211396) +++ head/share/man/man9/VOP_LISTEXTATTR.9 Mon Aug 16 15:18:30 2010 (r211397) @@ -78,7 +78,7 @@ will be .Dv NULL when .Fa size -is not, and vise versa. +is not, and vice versa. .It Fa cred The user credentials to use in authorizing the request. .It Fa td Modified: head/share/man/man9/VOP_VPTOCNP.9 ============================================================================== --- head/share/man/man9/VOP_VPTOCNP.9 Mon Aug 16 14:24:00 2010 (r211396) +++ head/share/man/man9/VOP_VPTOCNP.9 Mon Aug 16 15:18:30 2010 (r211397) @@ -42,7 +42,7 @@ .Sh DESCRIPTION This translates a vnode into its component name, and writes that name to the head of the buffer specified by -.Fa buf +.Fa buf . .Bl -tag -width buflen .It Fa vp The vnode to translate. Modified: head/share/man/man9/g_geom.9 ============================================================================== --- head/share/man/man9/g_geom.9 Mon Aug 16 14:24:00 2010 (r211396) +++ head/share/man/man9/g_geom.9 Mon Aug 16 15:18:30 2010 (r211397) @@ -109,9 +109,9 @@ The topology lock has to be held. .Fn g_destroy_geom : .Bl -item -offset indent .It -The geom cannot posses any providers. +The geom cannot possess any providers. .It -The geom cannot posses any consumers. +The geom cannot possess any consumers. .It The topology lock has to be held. .El Modified: head/share/man/man9/g_wither_geom.9 ============================================================================== --- head/share/man/man9/g_wither_geom.9 Mon Aug 16 14:24:00 2010 (r211396) +++ head/share/man/man9/g_wither_geom.9 Mon Aug 16 15:18:30 2010 (r211397) @@ -54,7 +54,7 @@ This is an automatic to avoid duplicated code in all classes. Before it is called, field .Va softc -should be disposed off and set to +should be disposed of and set to .Dv NULL . Note that the .Fn g_wither_geom Modified: head/share/man/man9/ieee80211.9 ============================================================================== --- head/share/man/man9/ieee80211.9 Mon Aug 16 14:24:00 2010 (r211396) +++ head/share/man/man9/ieee80211.9 Mon Aug 16 15:18:30 2010 (r211397) @@ -205,11 +205,11 @@ method. Transmit a raw 802.11 frame. The default method drops the frame and generates a message on the console. .It Dv ic_updateslot -Update hardware state after an 802.11 IFS slot time change, +Update hardware state after an 802.11 IFS slot time change. There is no default method; the pointer may be NULL in which case it will not be used. .It Dv ic_update_mcast -Update hardware for a change in the multicast packet filter, +Update hardware for a change in the multicast packet filter. The default method prints a console message. .It Dv ic_update_promisc Update hardware for a change in the promiscuous mode setting. @@ -261,13 +261,13 @@ The default method ages frames on the po and pending frames in the receive reorder queues (for stations using A-MPDU). .It Dv ic_node_drain Reclaim all optional resources associated with a node. -This call is used to free up resources when they are in short supply, +This call is used to free up resources when they are in short supply. .It Dv ic_node_getrssi Return the Receive Signal Strength Indication (RSSI) in .5 dBm units for the specified node. This interface returns a subset of the information returned by -.Dv ic_node_getsignal , +.Dv ic_node_getsignal . The default method calculates a filtered average over the last ten samples passed in to .Xr ieee80211_input 9 @@ -341,7 +341,7 @@ Drivers may interpose this method if the for handling transmit A-MPDU. .It Dv ic_addb_response Process a received ADDBA Response Action frame and setup resources as -needed for doing transmit A-MPDU, +needed for doing transmit A-MPDU. .It Dv ic_addb_stop Shutdown an A-MPDU transmit stream for the specified station and AC. The default method reclaims local state after sending a DelBA Action frame. @@ -490,7 +490,7 @@ Devices supports hardware CKIP cipher. The follow general 802.11n capabilities are defined. The first capabilities are defined exactly as they appear in the 802.11n specification. -Capabilities beginning with IEEE80211_HTC_AMPDU are used soley by the +Capabilities beginning with IEEE80211_HTC_AMPDU are used solely by the .Nm layer. .Bl -tag -width IEEE80211_C_8023ENCAP Modified: head/share/man/man9/kproc.9 ============================================================================== --- head/share/man/man9/kproc.9 Mon Aug 16 14:24:00 2010 (r211396) +++ head/share/man/man9/kproc.9 Mon Aug 16 15:18:30 2010 (r211397) @@ -244,7 +244,7 @@ when it is called by the new process. The .Fa procptr pointer points to a -.Vt "struct proc " +.Vt "struct proc" pointer that is the location to be updated with the new proc pointer if a new process is created, or if not .Dv NULL , @@ -255,7 +255,7 @@ then a new process is created and the fi If not NULL, the .Fa tdptr pointer points to a -.Vt "struct thread " +.Vt "struct thread" pointer that is the location to be updated with the new thread pointer. The .Fa flags Modified: head/share/man/man9/netisr.9 ============================================================================== --- head/share/man/man9/netisr.9 Mon Aug 16 14:24:00 2010 (r211396) +++ head/share/man/man9/netisr.9 Mon Aug 16 15:18:30 2010 (r211397) @@ -103,7 +103,7 @@ If the protocol implements .Va nh_m2flow , then .Nm -will query the protocol in the evet that the +will query the protocol in the event that the .Vt mbuf doesn't have a flow ID, falling back on source ordering. .It NETISR_POLICY_CPU @@ -120,7 +120,7 @@ whose fields are defined as follows: .Bl -tag -width "netisr_handler_t nh_handler" .It Vt "const char *" Va nh_name Unique character string name of the protocol, which may be included in -.Xr 2 sysctl +.Xr sysctl 2 MIB names, so should not contain whitespace. .It Vt netisr_handler_t Va nh_handler Protocol handler function that will be invoked on each packet received for Modified: head/share/man/man9/vm_page_bits.9 ============================================================================== --- head/share/man/man9/vm_page_bits.9 Mon Aug 16 14:24:00 2010 (r211396) +++ head/share/man/man9/vm_page_bits.9 Mon Aug 16 15:18:30 2010 (r211397) @@ -84,7 +84,7 @@ The range is expected to be .Dv DEV_BSIZE aligned and no larger than .Dv PAGE_SIZE . -If it is not properly aligned, any unaligned chucks of the +If it is not properly aligned, any unaligned chunks of the .Dv DEV_BSIZE blocks at the beginning and end of the range will be zeroed. .Pp Modified: head/usr.bin/cpio/bsdcpio.1 ============================================================================== --- head/usr.bin/cpio/bsdcpio.1 Mon Aug 16 14:24:00 2010 (r211396) +++ head/usr.bin/cpio/bsdcpio.1 Mon Aug 16 15:18:30 2010 (r211397) @@ -295,7 +295,7 @@ for more information. .Sh EXAMPLES The .Nm -command is traditionally used to copy file heirarchies in conjunction +command is traditionally used to copy file hierarchies in conjunction with the .Xr find 1 command. Modified: head/usr.bin/systat/systat.1 ============================================================================== --- head/usr.bin/systat/systat.1 Mon Aug 16 14:24:00 2010 (r211396) +++ head/usr.bin/systat/systat.1 Mon Aug 16 15:18:30 2010 (r211397) @@ -225,7 +225,7 @@ Like the display, except that it displays .Tn IPv6 -statics. +statistics. It does not display .Tn UDP statistics. .It Ic tcp Modified: head/usr.sbin/bsnmpd/modules/snmp_bridge/snmp_bridge.3 ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_bridge/snmp_bridge.3 Mon Aug 16 14:24:00 2010 (r211396) +++ head/usr.sbin/bsnmpd/modules/snmp_bridge/snmp_bridge.3 Mon Aug 16 15:18:30 2010 (r211397) @@ -30,7 +30,7 @@ .Os .Sh NAME .Nm snmp_bridge -.Nd "bridge module for snmpd. +.Nd "bridge module for snmpd" .Sh LIBRARY .Pq begemotSnmpdModulePath."bridge" = "/usr/lib/snmp_bridge.so" .Sh DESCRIPTION @@ -46,7 +46,7 @@ MIB also defines additional objects whic similar to .Xr ifconfig 8 for configuring bridge interfaces. -Therefore one should consider adding write comminities or loading the +Therefore one should consider adding write communities or loading the .Nm module on systems where security is crucial. .Sh IMPLEMENTATION NOTES Modified: head/usr.sbin/bsnmpd/modules/snmp_wlan/snmp_wlan.3 ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_wlan/snmp_wlan.3 Mon Aug 16 14:24:00 2010 (r211396) +++ head/usr.sbin/bsnmpd/modules/snmp_wlan/snmp_wlan.3 Mon Aug 16 15:18:30 2010 (r211397) @@ -45,7 +45,7 @@ management of virtual wireless interface state data and configuration capabilities of .Xr ifconfig 8 for configuring virtual wireless interfaces. -Therefore one should consider adding write comminities or loading the +Therefore one should consider adding write communities or loading the .Nm module on systems where security is crucial. .Sh IMPLEMENTATION NOTES Modified: head/usr.sbin/freebsd-update/freebsd-update.8 ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.8 Mon Aug 16 14:24:00 2010 (r211396) +++ head/usr.sbin/freebsd-update/freebsd-update.8 Mon Aug 16 15:18:30 2010 (r211397) @@ -56,7 +56,7 @@ Release Engineering Team, e.g., .Fx 7.3-RELEASE and .Fx -8.0, but not +8.0-RELEASE, but not .Fx 6.3-STABLE or .Fx Modified: head/usr.sbin/i2c/i2c.8 ============================================================================== --- head/usr.sbin/i2c/i2c.8 Mon Aug 16 14:24:00 2010 (r211396) +++ head/usr.sbin/i2c/i2c.8 Mon Aug 16 15:18:30 2010 (r211397) @@ -78,7 +78,7 @@ transfer has been written to the device *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Aug 16 17:18:09 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5636C1065674; Mon, 16 Aug 2010 17:18:09 +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 43D788FC14; Mon, 16 Aug 2010 17:18:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7GHI9gw004685; Mon, 16 Aug 2010 17:18:09 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7GHI9ne004674; Mon, 16 Aug 2010 17:18:09 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201008161718.o7GHI9ne004674@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 16 Aug 2010 17:18: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: r211399 - in head/tools/regression/bin/sh: builtins execution set-e X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2010 17:18:09 -0000 Author: jilles Date: Mon Aug 16 17:18:08 2010 New Revision: 211399 URL: http://svn.freebsd.org/changeset/base/211399 Log: sh: Get rid of unnecessary non-standard empty lists. POSIX does not allow constructs like: if cmd; then fi { } Add a colon dummy command, except in a test that verifies that such empty lists do not cause crashes when used as a function definition. Modified: head/tools/regression/bin/sh/builtins/command3.0 head/tools/regression/bin/sh/builtins/command5.0 head/tools/regression/bin/sh/builtins/command6.0 head/tools/regression/bin/sh/execution/func2.0 head/tools/regression/bin/sh/set-e/elif1.0 head/tools/regression/bin/sh/set-e/elif2.0 head/tools/regression/bin/sh/set-e/if1.0 head/tools/regression/bin/sh/set-e/if3.0 head/tools/regression/bin/sh/set-e/while1.0 head/tools/regression/bin/sh/set-e/while2.0 Modified: head/tools/regression/bin/sh/builtins/command3.0 ============================================================================== --- head/tools/regression/bin/sh/builtins/command3.0 Mon Aug 16 15:51:41 2010 (r211398) +++ head/tools/regression/bin/sh/builtins/command3.0 Mon Aug 16 17:18:08 2010 (r211399) @@ -4,6 +4,7 @@ command -v true command -v /bin/ls fun() { + : } command -v fun command -v break Modified: head/tools/regression/bin/sh/builtins/command5.0 ============================================================================== --- head/tools/regression/bin/sh/builtins/command5.0 Mon Aug 16 15:51:41 2010 (r211398) +++ head/tools/regression/bin/sh/builtins/command5.0 Mon Aug 16 17:18:08 2010 (r211399) @@ -4,6 +4,7 @@ command -V true command -V /bin/ls fun() { + : } command -V fun command -V break Modified: head/tools/regression/bin/sh/builtins/command6.0 ============================================================================== --- head/tools/regression/bin/sh/builtins/command6.0 Mon Aug 16 15:51:41 2010 (r211398) +++ head/tools/regression/bin/sh/builtins/command6.0 Mon Aug 16 17:18:08 2010 (r211399) @@ -5,6 +5,7 @@ command -pV true command -pV /bin/ls fun() { + : } command -pV fun command -pV break Modified: head/tools/regression/bin/sh/execution/func2.0 ============================================================================== --- head/tools/regression/bin/sh/execution/func2.0 Mon Aug 16 15:51:41 2010 (r211398) +++ head/tools/regression/bin/sh/execution/func2.0 Mon Aug 16 17:18:08 2010 (r211399) @@ -1,4 +1,5 @@ # $FreeBSD$ +# The empty pairs of braces here are to test that this does not cause a crash. f() { } f Modified: head/tools/regression/bin/sh/set-e/elif1.0 ============================================================================== --- head/tools/regression/bin/sh/set-e/elif1.0 Mon Aug 16 15:51:41 2010 (r211398) +++ head/tools/regression/bin/sh/set-e/elif1.0 Mon Aug 16 17:18:08 2010 (r211399) @@ -1,5 +1,7 @@ # $FreeBSD$ set -e if false; then + : elif false; then + : fi Modified: head/tools/regression/bin/sh/set-e/elif2.0 ============================================================================== --- head/tools/regression/bin/sh/set-e/elif2.0 Mon Aug 16 15:51:41 2010 (r211398) +++ head/tools/regression/bin/sh/set-e/elif2.0 Mon Aug 16 17:18:08 2010 (r211399) @@ -1,5 +1,7 @@ # $FreeBSD$ set -e if false; then + : elif false; false; then + : fi Modified: head/tools/regression/bin/sh/set-e/if1.0 ============================================================================== --- head/tools/regression/bin/sh/set-e/if1.0 Mon Aug 16 15:51:41 2010 (r211398) +++ head/tools/regression/bin/sh/set-e/if1.0 Mon Aug 16 17:18:08 2010 (r211399) @@ -1,4 +1,5 @@ # $FreeBSD$ set -e if false; then + : fi Modified: head/tools/regression/bin/sh/set-e/if3.0 ============================================================================== --- head/tools/regression/bin/sh/set-e/if3.0 Mon Aug 16 15:51:41 2010 (r211398) +++ head/tools/regression/bin/sh/set-e/if3.0 Mon Aug 16 17:18:08 2010 (r211399) @@ -1,4 +1,5 @@ # $FreeBSD$ set -e if false; false; then + : fi Modified: head/tools/regression/bin/sh/set-e/while1.0 ============================================================================== --- head/tools/regression/bin/sh/set-e/while1.0 Mon Aug 16 15:51:41 2010 (r211398) +++ head/tools/regression/bin/sh/set-e/while1.0 Mon Aug 16 17:18:08 2010 (r211399) @@ -1,4 +1,5 @@ # $FreeBSD$ set -e while false; do + : done Modified: head/tools/regression/bin/sh/set-e/while2.0 ============================================================================== --- head/tools/regression/bin/sh/set-e/while2.0 Mon Aug 16 15:51:41 2010 (r211398) +++ head/tools/regression/bin/sh/set-e/while2.0 Mon Aug 16 17:18:08 2010 (r211399) @@ -1,4 +1,5 @@ # $FreeBSD$ set -e while false; false; do + : done From owner-svn-src-all@FreeBSD.ORG Mon Aug 16 17:48:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 30ADC10656A5; Mon, 16 Aug 2010 17:48:56 +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 04DDE8FC08; Mon, 16 Aug 2010 17:48:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7GHmtjU005308; Mon, 16 Aug 2010 17:48:55 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7GHmtRI005304; Mon, 16 Aug 2010 17:48:55 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201008161748.o7GHmtRI005304@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 16 Aug 2010 17:48: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: r211400 - in head/sys/modules: em igb ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2010 17:48:56 -0000 Author: yongari Date: Mon Aug 16 17:48:55 2010 New Revision: 211400 URL: http://svn.freebsd.org/changeset/base/211400 Log: Remove unnecessary clean target in em(4), igb(4) and ixgbe(4). While here also remove man target in igb(4). Reviewed by: jfv Modified: head/sys/modules/em/Makefile head/sys/modules/igb/Makefile head/sys/modules/ixgbe/Makefile Modified: head/sys/modules/em/Makefile ============================================================================== --- head/sys/modules/em/Makefile Mon Aug 16 17:18:08 2010 (r211399) +++ head/sys/modules/em/Makefile Mon Aug 16 17:48:55 2010 (r211400) @@ -18,10 +18,4 @@ CFLAGS += -I${.CURDIR}/../../dev/e1000 # DEVICE_POLLING for a non-interrupt-driven method #CFLAGS += -DDEVICE_POLLING -clean: - rm -f device_if.h bus_if.h pci_if.h setdef* - rm -f *.o *.kld *.ko - rm -f @ machine - rm -f ${CLEANFILES} - .include Modified: head/sys/modules/igb/Makefile ============================================================================== --- head/sys/modules/igb/Makefile Mon Aug 16 17:18:08 2010 (r211399) +++ head/sys/modules/igb/Makefile Mon Aug 16 17:48:55 2010 (r211400) @@ -14,14 +14,4 @@ CFLAGS += -I${.CURDIR}/../../dev/e1000 - # not advisable since MSIX gives better results #CFLAGS += -DDEVICE_POLLING -clean: - rm -f device_if.h bus_if.h pci_if.h setdef* - rm -f *.o *.kld *.ko - rm -f @ machine - rm -f ${CLEANFILES} - -man: - mv /usr/share/man/man4/igb.4.gz /usr/share/man/man4/igbSAVE.4.gz - cp igb.4 /usr/share/man/man4/ - .include Modified: head/sys/modules/ixgbe/Makefile ============================================================================== --- head/sys/modules/ixgbe/Makefile Mon Aug 16 17:18:08 2010 (r211399) +++ head/sys/modules/ixgbe/Makefile Mon Aug 16 17:48:55 2010 (r211400) @@ -8,9 +8,4 @@ SRCS += ixgbe_common.c ixgbe_api.c ix SRCS += ixgbe_82599.c ixgbe_82598.c CFLAGS+= -I${.CURDIR}/../../dev/ixgbe -DSMP -DIXGBE_FDIR -clean: - rm -f device_if.h bus_if.h pci_if.h setdef* *_StripErr - rm -f *.o *.kld *.ko - rm -f @ machine - .include From owner-svn-src-all@FreeBSD.ORG Mon Aug 16 18:47:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CDA641065670; Mon, 16 Aug 2010 18:47:35 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC78F8FC12; Mon, 16 Aug 2010 18:47:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7GIlZ1d006588; Mon, 16 Aug 2010 18:47:35 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7GIlZNq006586; Mon, 16 Aug 2010 18:47:35 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201008161847.o7GIlZNq006586@svn.freebsd.org> From: Ulrich Spoerlein Date: Mon, 16 Aug 2010 18:47:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211401 - head/contrib/bsnmp/snmpd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2010 18:47:36 -0000 Author: uqs Date: Mon Aug 16 18:47:35 2010 New Revision: 211401 URL: http://svn.freebsd.org/changeset/base/211401 Log: Wordsmithing of bsnmpd.1 PR: docs/149157 Submitted by: Warren Block MFC after: 1 week Modified: head/contrib/bsnmp/snmpd/bsnmpd.1 Modified: head/contrib/bsnmp/snmpd/bsnmpd.1 ============================================================================== --- head/contrib/bsnmp/snmpd/bsnmpd.1 Mon Aug 16 17:48:55 2010 (r211400) +++ head/contrib/bsnmp/snmpd/bsnmpd.1 Mon Aug 16 18:47:35 2010 (r211401) @@ -49,7 +49,7 @@ .Sh DESCRIPTION The .Nm -daemon server the internet SNMP (Simple Network Management Protocol). +daemon serves the internet SNMP (Simple Network Management Protocol). It is intended to serve only the absolute basic MIBs and implement all other MIBs through loadable modules. In this way the @@ -59,11 +59,10 @@ can be used in unexpected ways. The options are as follows: .Bl -tag -width ".It Fl D Ar options" .It Fl d -This option is used for debugging -.Nm -and causes it not to daemonize itself. +Do not daemonize. +Used for debugging. .It Fl h -This option prints a short usage message. +Print a short usage message. .It Fl c Ar file Use .Ar file @@ -75,33 +74,32 @@ flag followed by a comma separated strin The following options are available. .Bl -tag -width ".It Cm trace Ns Cm = Ns Cm level" .It Cm dump -This option causes all sent and received PDUs to be dumped to the terminal. +Dump all sent and received PDUs to the terminal. .It Cm events -This causes the debugging level of the event library (see +Set the debugging level of the event library (see .Xr eventlib 3 ) -to be set to 10. +to 10. .It Cm trace Ns Cm = Ns Cm level -This option causes the snmp library trace flag to be set to the specified +Set the snmp library trace flag to the specified value. The value can be specified in the usual C-syntax for numbers. .El .It Fl I Ar paths -This option specifies a colon separated list of directories to search for -configuration include files. +Specify a colon separated list of directories to search for configuration +include files. The default is .Pa /etc:/usr/etc/:/usr/local/etc . These paths are only searched for include specified within <> parentheses. .It Fl l Ar prefix -The +Use .Ar prefix -is used as the default basename for the pid and the configuration files. +as the default basename for the pid and the configuration files. .It Fl m Ar variable Ns Op = Ns Ar value Define a configuration variable. .It Fl p Ar file Specify an alternate pid file instead of the default one. .El .Sh CONFIGURATION -The .Nm reads its configuration from either the default or the user specified configuration file. @@ -218,7 +216,7 @@ If the element is a hostname, the IP address of the host is looked up and the four elements of the IP address are appended to the oid. .Pp -For example a oid of +For example, an oid of .Bd -unfilled -offset indent myvariable.27.foooll.[localhost]."&^!" .Ed @@ -253,13 +251,13 @@ is .It Pa /var/run/ Ns Ao Ar prefix Ac Ns \&.pid Default pid file. .It Pa /etc:/usr/etc/:/usr/local/etc -This is the default search path for system include files. +Default search path for system include files. .It Pa @MIBSPATH@FOKUS-MIB.txt .It Pa @MIBSPATH@BEGEMOT-MIB.txt .It Pa @MIBSPATH@BEGEMOT-SNMPD.txt -The definitions for the MIBs implemented in the daemon. +Definitions for the MIBs implemented in the daemon. .It Pa /etc/hosts.allow, /etc/hosts.deny -Access controls that should be enforced by TCP wrappers should be defined here. +Access controls that should be enforced by TCP wrappers are defined here. Further details are described in .Xr hosts_access 5 . .El From owner-svn-src-all@FreeBSD.ORG Mon Aug 16 19:05:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA5C61065670; Mon, 16 Aug 2010 19:05:10 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A97608FC27; Mon, 16 Aug 2010 19:05:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7GJ5ATG007089; Mon, 16 Aug 2010 19:05:10 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7GJ5AOd007087; Mon, 16 Aug 2010 19:05:10 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201008161905.o7GJ5AOd007087@svn.freebsd.org> From: Ulrich Spoerlein Date: Mon, 16 Aug 2010 19:05: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: r211402 - head/contrib/bsnmp/snmpd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2010 19:05:10 -0000 Author: uqs Date: Mon Aug 16 19:05:10 2010 New Revision: 211402 URL: http://svn.freebsd.org/changeset/base/211402 Log: Bump document date after content changes. Pointy hat to: uqs Modified: head/contrib/bsnmp/snmpd/bsnmpd.1 Modified: head/contrib/bsnmp/snmpd/bsnmpd.1 ============================================================================== --- head/contrib/bsnmp/snmpd/bsnmpd.1 Mon Aug 16 18:47:35 2010 (r211401) +++ head/contrib/bsnmp/snmpd/bsnmpd.1 Mon Aug 16 19:05:10 2010 (r211402) @@ -31,7 +31,7 @@ .\" .\" $Begemot: bsnmp/snmpd/bsnmpd.1,v 1.12 2006/02/27 09:50:03 brandt_h Exp $ .\" -.Dd February 27, 2006 +.Dd August 16, 2010 .Dt BSNMPD 1 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Mon Aug 16 20:22:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F7C31065693; Mon, 16 Aug 2010 20:22:07 +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 2CD028FC14; Mon, 16 Aug 2010 20:22:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7GKM7lo008936; Mon, 16 Aug 2010 20:22:07 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7GKM7hi008935; Mon, 16 Aug 2010 20:22:07 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201008162022.o7GKM7hi008935@svn.freebsd.org> From: John Baldwin Date: Mon, 16 Aug 2010 20:22:07 +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: r211403 - in stable/8/sys: . amd64/include/xen cam cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/e1000 dev/xen/xenpci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2010 20:22:07 -0000 Author: jhb Date: Mon Aug 16 20:22:06 2010 New Revision: 211403 URL: http://svn.freebsd.org/changeset/base/211403 Log: Hoist mergeinfo for sys/dev/e1000 back up to sys/. Modified: Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (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/sys/dev/e1000/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) From owner-svn-src-all@FreeBSD.ORG Mon Aug 16 21:12:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DB09106567A; Mon, 16 Aug 2010 21:12:26 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D0D98FC1E; Mon, 16 Aug 2010 21:12:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7GLCQRl010036; Mon, 16 Aug 2010 21:12:26 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7GLCQaZ010034; Mon, 16 Aug 2010 21:12:26 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201008162112.o7GLCQaZ010034@svn.freebsd.org> From: Joel Dahl Date: Mon, 16 Aug 2010 21:12: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: r211404 - head/contrib/bsnmp/snmpd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2010 21:12:26 -0000 Author: joel (doc committer) Date: Mon Aug 16 21:12:26 2010 New Revision: 211404 URL: http://svn.freebsd.org/changeset/base/211404 Log: Fix two minor typos. Modified: head/contrib/bsnmp/snmpd/snmpmod.3 Modified: head/contrib/bsnmp/snmpd/snmpmod.3 ============================================================================== --- head/contrib/bsnmp/snmpd/snmpmod.3 Mon Aug 16 20:22:06 2010 (r211403) +++ head/contrib/bsnmp/snmpd/snmpmod.3 Mon Aug 16 21:12:26 2010 (r211404) @@ -558,7 +558,7 @@ For modules that implement SNMP client f it may be necessary to identify SNMP requests by their identifier to allow easier routing of responses to the correct sub-system. Request id ranges -provide a way to aquire globally non-overlapping sub-ranges of the entire +provide a way to acquire globally non-overlapping sub-ranges of the entire 31-bit id range. .Pp A request id range is allocated with @@ -586,7 +586,7 @@ The function .Fn reqid_istype checks whether the request id .Fa reqid -is withing the range identified by +is within the range identified by .Fa type . The function .Fn reqid_type From owner-svn-src-all@FreeBSD.ORG Mon Aug 16 21:14:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16976106564A; Mon, 16 Aug 2010 21:14:50 +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 057DC8FC0C; Mon, 16 Aug 2010 21:14:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7GLEnta010116; Mon, 16 Aug 2010 21:14:49 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7GLEnYr010113; Mon, 16 Aug 2010 21:14:49 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201008162114.o7GLEnYr010113@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 16 Aug 2010 21:14:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211405 - head/tools/regression/bin/sh/parser X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2010 21:14:50 -0000 Author: jilles Date: Mon Aug 16 21:14:49 2010 New Revision: 211405 URL: http://svn.freebsd.org/changeset/base/211405 Log: sh: Split off a more dubious test from parser/heredoc2.0. Added: head/tools/regression/bin/sh/parser/heredoc8.0 (contents, props changed) Modified: head/tools/regression/bin/sh/parser/heredoc2.0 Modified: head/tools/regression/bin/sh/parser/heredoc2.0 ============================================================================== --- head/tools/regression/bin/sh/parser/heredoc2.0 Mon Aug 16 21:12:26 2010 (r211404) +++ head/tools/regression/bin/sh/parser/heredoc2.0 Mon Aug 16 21:14:49 2010 (r211405) @@ -17,11 +17,6 @@ EOF )" = "ast*que?non"' check '"$(cat < Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E3A6106566C; Mon, 16 Aug 2010 21:26:48 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F1C498FC15; Mon, 16 Aug 2010 21:26:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7GLQliK010393; Mon, 16 Aug 2010 21:26:47 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7GLQlO4010390; Mon, 16 Aug 2010 21:26:47 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201008162126.o7GLQlO4010390@svn.freebsd.org> From: Joel Dahl Date: Mon, 16 Aug 2010 21:26: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: r211406 - 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: Mon, 16 Aug 2010 21:26:48 -0000 Author: joel (doc committer) Date: Mon Aug 16 21:26:47 2010 New Revision: 211406 URL: http://svn.freebsd.org/changeset/base/211406 Log: Put parentheses around a few macros to prevent mdoc warnings. Modified: head/share/man/man4/enc.4 head/share/man/man4/ipsec.4 Modified: head/share/man/man4/enc.4 ============================================================================== --- head/share/man/man4/enc.4 Mon Aug 16 21:14:49 2010 (r211405) +++ head/share/man/man4/enc.4 Mon Aug 16 21:26:47 2010 (r211406) @@ -82,10 +82,10 @@ framework can be independently controlle variables: .Bl -column net.enc.out.ipsec_filter_mask 0x00000000 0x00000000 .It Sy "Name Defaults Suggested" -.It "net.enc.out.ipsec_bpf_mask" 0x00000003 0x00000001 -.It "net.enc.out.ipsec_filter_mask" 0x00000001 0x00000001 -.It "net.enc.in.ipsec_bpf_mask" 0x00000001 0x00000002 -.It "net.enc.in.ipsec_filter_mask" 0x00000001 0x00000002 +.It "net.enc.out.ipsec_bpf_mask 0x00000003 0x00000001" +.It "net.enc.out.ipsec_filter_mask 0x00000001 0x00000001" +.It "net.enc.in.ipsec_bpf_mask 0x00000001 0x00000002" +.It "net.enc.in.ipsec_filter_mask 0x00000001 0x00000002" .El .Pp For the incoming path a value of Modified: head/share/man/man4/ipsec.4 ============================================================================== --- head/share/man/man4/ipsec.4 Mon Aug 16 21:14:49 2010 (r211405) +++ head/share/man/man4/ipsec.4 Mon Aug 16 21:26:47 2010 (r211406) @@ -90,8 +90,8 @@ To properly filter on the inner packets tunnel with firewalls, you can change the values of the following sysctls .Bl -column net.inet6.ipsec6.filtertunnel default enable .It Sy "Name Default Enable" -.It net.inet.ipsec.filtertunnel 0 1 -.It net.inet6.ipsec6.filtertunnel 0 1 +.It "net.inet.ipsec.filtertunnel 0 1" +.It "net.inet6.ipsec6.filtertunnel 0 1" .El .\" .Ss Kernel interface From owner-svn-src-all@FreeBSD.ORG Mon Aug 16 21:53:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4D611065674; Mon, 16 Aug 2010 21:53:56 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from mail.vnode.se (mail.vnode.se [62.119.52.80]) by mx1.freebsd.org (Postfix) with ESMTP id 7AB408FC08; Mon, 16 Aug 2010 21:53:56 +0000 (UTC) Received: from mail.vnode.se (localhost [127.0.0.1]) by mail.vnode.se (Postfix) with ESMTP id 9F83BE3F07B; Mon, 16 Aug 2010 23:37:54 +0200 (CEST) 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 KwKoGQz-U+HH; Mon, 16 Aug 2010 23:37:52 +0200 (CEST) Received: from pluto.vnode.local (unknown [83.223.1.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.vnode.se (Postfix) with ESMTPSA id 9FC56E3F079; Mon, 16 Aug 2010 23:37:51 +0200 (CEST) Date: Mon, 16 Aug 2010 23:37:49 +0200 From: Joel Dahl To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20100816213749.GD1207@pluto.vnode.local> References: <201008162126.o7GLQlO4010390@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201008162126.o7GLQlO4010390@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Subject: Re: svn commit: r211406 - 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: Mon, 16 Aug 2010 21:53:56 -0000 On 16-08-2010 21:26, Joel Dahl wrote: > Author: joel (doc committer) > Date: Mon Aug 16 21:26:47 2010 > New Revision: 211406 > URL: http://svn.freebsd.org/changeset/base/211406 > > Log: > Put parentheses around a few macros to prevent mdoc warnings. Rule number one: Don't commit when you're about to fall asleep. The real log message should be: "Put quotes around a few macros to prevent mdoc warnings". -- Joel From owner-svn-src-all@FreeBSD.ORG Mon Aug 16 21:59:56 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87DD510656A3; Mon, 16 Aug 2010 21:59:56 +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 773B68FC18; Mon, 16 Aug 2010 21:59:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7GLxu3o011015; Mon, 16 Aug 2010 21:59:56 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7GLxuhh011013; Mon, 16 Aug 2010 21:59:56 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201008162159.o7GLxuhh011013@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 16 Aug 2010 21:59: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: r211407 - 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: Mon, 16 Aug 2010 21:59:56 -0000 Author: pjd Date: Mon Aug 16 21:59:56 2010 New Revision: 211407 URL: http://svn.freebsd.org/changeset/base/211407 Log: The 'size' variable is there to limit how many bytes we want to copy from 'addr'. It is very likely that size of 'addr' is larger than 'size', so checking strlcpy() return value is bogus. MFC after: 3 weeks Modified: head/sbin/hastd/proto_tcp4.c Modified: head/sbin/hastd/proto_tcp4.c ============================================================================== --- head/sbin/hastd/proto_tcp4.c Mon Aug 16 21:26:47 2010 (r211406) +++ head/sbin/hastd/proto_tcp4.c Mon Aug 16 21:59:56 2010 (r211407) @@ -156,8 +156,7 @@ tcp4_addr(const char *addr, struct socka size = (size_t)(pp - addr + 1); if (size > sizeof(iporhost)) return (ENAMETOOLONG); - if (strlcpy(iporhost, addr, size) >= size) - return (ENAMETOOLONG); + (void)strlcpy(iporhost, addr, size); } /* Convert string (IP address or host name) to in_addr_t. */ ip = str2ip(iporhost); From owner-svn-src-all@FreeBSD.ORG Mon Aug 16 22:23:20 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CE5A10656A5; Mon, 16 Aug 2010 22:23:20 +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 10E498FC17; Mon, 16 Aug 2010 22:23:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7GMNJ7K011551; Mon, 16 Aug 2010 22:23:19 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7GMNJ70011546; Mon, 16 Aug 2010 22:23:19 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201008162223.o7GMNJ70011546@svn.freebsd.org> From: Jilles Tjoelker Date: Mon, 16 Aug 2010 22:23: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: r211408 - in head/tools/regression/bin/sh: builtins execution X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2010 22:23:20 -0000 Author: jilles Date: Mon Aug 16 22:23:19 2010 New Revision: 211408 URL: http://svn.freebsd.org/changeset/base/211408 Log: sh: Reduce unnecessary testsuite failures with other shells. Modified: head/tools/regression/bin/sh/builtins/fc1.0 head/tools/regression/bin/sh/builtins/fc2.0 head/tools/regression/bin/sh/execution/redir1.0 head/tools/regression/bin/sh/execution/redir2.0 Modified: head/tools/regression/bin/sh/builtins/fc1.0 ============================================================================== --- head/tools/regression/bin/sh/builtins/fc1.0 Mon Aug 16 21:59:56 2010 (r211407) +++ head/tools/regression/bin/sh/builtins/fc1.0 Mon Aug 16 22:23:19 2010 (r211408) @@ -1,6 +1,6 @@ # $FreeBSD$ set -e -trap 'echo Broken pipe -- test failed' pipe +trap 'echo Broken pipe -- test failed' PIPE P=${TMPDIR:-/tmp} cd $P Modified: head/tools/regression/bin/sh/builtins/fc2.0 ============================================================================== --- head/tools/regression/bin/sh/builtins/fc2.0 Mon Aug 16 21:59:56 2010 (r211407) +++ head/tools/regression/bin/sh/builtins/fc2.0 Mon Aug 16 22:23:19 2010 (r211408) @@ -1,6 +1,6 @@ # $FreeBSD$ set -e -trap 'echo Broken pipe -- test failed' pipe +trap 'echo Broken pipe -- test failed' PIPE P=${TMPDIR:-/tmp} cd $P Modified: head/tools/regression/bin/sh/execution/redir1.0 ============================================================================== --- head/tools/regression/bin/sh/execution/redir1.0 Mon Aug 16 21:59:56 2010 (r211407) +++ head/tools/regression/bin/sh/execution/redir1.0 Mon Aug 16 22:23:19 2010 (r211408) @@ -1,5 +1,5 @@ # $FreeBSD$ -trap ': $((brokenpipe+=1))' pipe +trap ': $((brokenpipe+=1))' PIPE P=${TMPDIR:-/tmp} cd $P @@ -17,7 +17,7 @@ if [ $brokenpipe -ne 0 ]; then rc=3 fi wait -echo dummy >&4 +echo dummy >&4 2>/dev/null if [ $brokenpipe -eq 1 ]; then : ${rc:=0} fi Modified: head/tools/regression/bin/sh/execution/redir2.0 ============================================================================== --- head/tools/regression/bin/sh/execution/redir2.0 Mon Aug 16 21:59:56 2010 (r211407) +++ head/tools/regression/bin/sh/execution/redir2.0 Mon Aug 16 22:23:19 2010 (r211408) @@ -1,5 +1,5 @@ # $FreeBSD$ -trap ': $((brokenpipe+=1))' pipe +trap ': $((brokenpipe+=1))' PIPE P=${TMPDIR:-/tmp} cd $P @@ -17,7 +17,7 @@ mkfifo fifo1 fifo2 exec 4>fifo2 exec 3>fifo1 -echo dummy >&4 +echo dummy >&4 2>/dev/null if [ $brokenpipe -eq 1 ]; then : ${rc:=0} fi From owner-svn-src-all@FreeBSD.ORG Tue Aug 17 00:50:32 2010 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0BB81065695; Tue, 17 Aug 2010 00:50: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 8E0A48FC16; Tue, 17 Aug 2010 00:50:32 +0000 (UTC) Received: from lawrence1.loshell.room52.net (ppp59-167-184-191.static.internode.on.net [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id D83337E8A1; Tue, 17 Aug 2010 10:50:30 +1000 (EST) Message-ID: <4C69DCD3.6010707@freebsd.org> Date: Tue, 17 Aug 2010 10:50:27 +1000 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-AU; rv:1.9.2.8) Gecko/20100810 Lightning/1.0b2 Thunderbird/3.1.2 MIME-Version: 1.0 To: Andre Oppermann References: <201008161424.o7GEO0WV000794@svn.freebsd.org> In-Reply-To: <201008161424.o7GEO0WV000794@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on lauren.room52.net Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r211396 - 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, 17 Aug 2010 00:50:32 -0000 On 08/17/10 00:24, Andre Oppermann wrote: > Author: andre > Date: Mon Aug 16 14:24:00 2010 > New Revision: 211396 > URL: http://svn.freebsd.org/changeset/base/211396 > > Log: > Add uma_zone_get_max() to obtain the effective limit after a call > to uma_zone_set_max(). > > The UMA zone limit is not exactly set to the value supplied but > rounded up to completely fill the backing store increment (a page > normally). This can lead to surprising situations where the number > of elements allocated from UMA is higher than the supplied limit > value. The new get function reads back the effective value so that > the supplied limit value can be adjusted to the real limit. > > Reviewed by: jeffr > MFC after: 1 week Cool, thanks! Cheers, Lawrence From owner-svn-src-all@FreeBSD.ORG Tue Aug 17 02:50:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 207051065694; Tue, 17 Aug 2010 02:50:13 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 105048FC20; Tue, 17 Aug 2010 02:50:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7H2oChu016464; Tue, 17 Aug 2010 02:50:12 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7H2oCa8016462; Tue, 17 Aug 2010 02:50:12 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201008170250.o7H2oCa8016462@svn.freebsd.org> From: David Xu Date: Tue, 17 Aug 2010 02:50:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211409 - head/lib/libthr/thread X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2010 02:50:13 -0000 Author: davidxu Date: Tue Aug 17 02:50:12 2010 New Revision: 211409 URL: http://svn.freebsd.org/changeset/base/211409 Log: Tweak code a bit to be POSIX compatible, when a cancellation request is acted upon, or when a thread calls pthread_exit(), the thread first disables cancellation by setting its cancelability state to PTHREAD_CANCEL_DISABLE and its cancelability type to PTHREAD_CANCEL_DEFERRED. The cancelability state remains set to PTHREAD_CANCEL_DISABLE until the thread has terminated. It has no effect if a cancellation cleanup handler or thread-specific data destructor routine changes the cancelability state to PTHREAD_CANCEL_ENABLE. Modified: head/lib/libthr/thread/thr_exit.c Modified: head/lib/libthr/thread/thr_exit.c ============================================================================== --- head/lib/libthr/thread/thr_exit.c Mon Aug 16 22:23:19 2010 (r211408) +++ head/lib/libthr/thread/thr_exit.c Tue Aug 17 02:50:12 2010 (r211409) @@ -81,6 +81,8 @@ _pthread_exit(void *status) /* Flag this thread as exiting. */ curthread->cancelling = 1; + curthread->cancel_enable = 0; + curthread->cancel_async = 0; _thr_exit_cleanup(); From owner-svn-src-all@FreeBSD.ORG Tue Aug 17 06:08:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41E5610656A3; Tue, 17 Aug 2010 06:08: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 30A8F8FC08; Tue, 17 Aug 2010 06:08:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7H68Auv020512; Tue, 17 Aug 2010 06:08:10 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7H68ArB020505; Tue, 17 Aug 2010 06:08:10 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201008170608.o7H68ArB020505@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 17 Aug 2010 06:08: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: r211410 - head/tools/regression/pjdfstest/tests/chown X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2010 06:08:10 -0000 Author: pjd Date: Tue Aug 17 06:08:09 2010 New Revision: 211410 URL: http://svn.freebsd.org/changeset/base/211410 Log: More tests, especially for lchown(2). Modified: head/tools/regression/pjdfstest/tests/chown/01.t head/tools/regression/pjdfstest/tests/chown/04.t head/tools/regression/pjdfstest/tests/chown/05.t head/tools/regression/pjdfstest/tests/chown/06.t head/tools/regression/pjdfstest/tests/chown/07.t head/tools/regression/pjdfstest/tests/chown/10.t Modified: head/tools/regression/pjdfstest/tests/chown/01.t ============================================================================== --- head/tools/regression/pjdfstest/tests/chown/01.t Tue Aug 17 02:50:12 2010 (r211409) +++ head/tools/regression/pjdfstest/tests/chown/01.t Tue Aug 17 06:08:09 2010 (r211410) @@ -6,7 +6,7 @@ desc="chown returns ENOTDIR if a compone dir=`dirname $0` . ${dir}/../misc.sh -echo "1..5" +echo "1..6" n0=`namegen` n1=`namegen` @@ -14,5 +14,6 @@ n1=`namegen` expect 0 mkdir ${n0} 0755 expect 0 create ${n0}/${n1} 0644 expect ENOTDIR chown ${n0}/${n1}/test 65534 65534 +expect ENOTDIR lchown ${n0}/${n1}/test 65534 65534 expect 0 unlink ${n0}/${n1} expect 0 rmdir ${n0} Modified: head/tools/regression/pjdfstest/tests/chown/04.t ============================================================================== --- head/tools/regression/pjdfstest/tests/chown/04.t Tue Aug 17 02:50:12 2010 (r211409) +++ head/tools/regression/pjdfstest/tests/chown/04.t Tue Aug 17 06:08:09 2010 (r211410) @@ -6,12 +6,18 @@ desc="chown returns ENOENT if the named dir=`dirname $0` . ${dir}/../misc.sh -echo "1..4" +echo "1..9" n0=`namegen` n1=`namegen` +n2=`namegen` expect 0 mkdir ${n0} 0755 expect ENOENT chown ${n0}/${n1}/test 65534 65534 expect ENOENT chown ${n0}/${n1} 65534 65534 +expect ENOENT lchown ${n0}/${n1}/test 65534 65534 +expect ENOENT lchown ${n0}/${n1} 65534 65534 +expect 0 symlink ${n2} ${n0}/${n1} +expect ENOENT chown ${n0}/${n1} 65534 65534 +expect 0 unlink ${n0}/${n1} expect 0 rmdir ${n0} Modified: head/tools/regression/pjdfstest/tests/chown/05.t ============================================================================== --- head/tools/regression/pjdfstest/tests/chown/05.t Tue Aug 17 02:50:12 2010 (r211409) +++ head/tools/regression/pjdfstest/tests/chown/05.t Tue Aug 17 06:08:09 2010 (r211410) @@ -6,7 +6,7 @@ desc="chown returns EACCES when search p dir=`dirname $0` . ${dir}/../misc.sh -echo "1..15" +echo "1..18" n0=`namegen` n1=`namegen` @@ -22,11 +22,14 @@ expect 0 -u 65534 -g 65533,65534 -- chow expect 65534,65533 -u 65534 -g 65534 stat ${n1}/${n2} uid,gid expect 0 chmod ${n1} 0644 expect EACCES -u 65534 -g 65533,65534 -- chown ${n1}/${n2} -1 65534 +expect EACCES -u 65534 -g 65533,65534 -- lchown ${n1}/${n2} -1 65534 expect 0 chmod ${n1} 0755 expect 65534,65533 -u 65534 -g 65534 stat ${n1}/${n2} uid,gid expect 0 -u 65534 -g 65533,65534 -- chown ${n1}/${n2} -1 65534 expect 65534,65534 -u 65534 -g 65534 stat ${n1}/${n2} uid,gid -expect 0 -u 65534 -g 65534 unlink ${n1}/${n2} +expect 0 -u 65534 -g 65533,65534 -- lchown ${n1}/${n2} -1 65533 +expect 65534,65533 -u 65534 -g 65533 stat ${n1}/${n2} uid,gid +expect 0 unlink ${n1}/${n2} expect 0 rmdir ${n1} cd ${cdir} expect 0 rmdir ${n0} Modified: head/tools/regression/pjdfstest/tests/chown/06.t ============================================================================== --- head/tools/regression/pjdfstest/tests/chown/06.t Tue Aug 17 02:50:12 2010 (r211409) +++ head/tools/regression/pjdfstest/tests/chown/06.t Tue Aug 17 06:08:09 2010 (r211410) @@ -6,14 +6,18 @@ desc="chown returns ELOOP if too many sy dir=`dirname $0` . ${dir}/../misc.sh -echo "1..6" +echo "1..10" n0=`namegen` n1=`namegen` expect 0 symlink ${n0} ${n1} expect 0 symlink ${n1} ${n0} +expect ELOOP chown ${n0} 65534 65534 +expect ELOOP chown ${n1} 65534 65534 expect ELOOP chown ${n0}/test 65534 65534 expect ELOOP chown ${n1}/test 65534 65534 +expect ELOOP lchown ${n0}/test 65534 65534 +expect ELOOP lchown ${n1}/test 65534 65534 expect 0 unlink ${n0} expect 0 unlink ${n1} Modified: head/tools/regression/pjdfstest/tests/chown/07.t ============================================================================== --- head/tools/regression/pjdfstest/tests/chown/07.t Tue Aug 17 02:50:12 2010 (r211409) +++ head/tools/regression/pjdfstest/tests/chown/07.t Tue Aug 17 06:08:09 2010 (r211410) @@ -6,23 +6,48 @@ desc="chown returns EPERM if the operati dir=`dirname $0` . ${dir}/../misc.sh -echo "1..11" +echo "1..132" n0=`namegen` n1=`namegen` n2=`namegen` +n3=`namegen` expect 0 mkdir ${n0} 0755 cdir=`pwd` cd ${n0} expect 0 mkdir ${n1} 0755 expect 0 chown ${n1} 65534 65534 -expect 0 -u 65534 -g 65534 create ${n1}/${n2} 0644 -expect EPERM -u 65534 -g 65534 chown ${n1}/${n2} 65533 65533 -expect EPERM -u 65533 -g 65533 chown ${n1}/${n2} 65534 65534 -expect EPERM -u 65533 -g 65533 chown ${n1}/${n2} 65533 65533 -expect EPERM -u 65534 -g 65534 -- chown ${n1}/${n2} -1 65533 -expect 0 unlink ${n1}/${n2} +for type in regular dir fifo block char socket symlink; do + if [ "${type}" != "symlink" ]; then + create_file ${type} ${n1}/${n2} 65534 65534 + expect EPERM -u 65534 -g 65534 chown ${n1}/${n2} 65533 65533 + expect EPERM -u 65533 -g 65533 chown ${n1}/${n2} 65534 65534 + expect EPERM -u 65533 -g 65533 chown ${n1}/${n2} 65533 65533 + expect EPERM -u 65534 -g 65534 -- chown ${n1}/${n2} -1 65533 + expect 0 -u 65534 -g 65534 symlink ${n2} ${n1}/${n3} + expect EPERM -u 65534 -g 65534 chown ${n1}/${n3} 65533 65533 + expect EPERM -u 65533 -g 65533 chown ${n1}/${n3} 65534 65534 + expect EPERM -u 65533 -g 65533 chown ${n1}/${n3} 65533 65533 + expect EPERM -u 65534 -g 65534 -- chown ${n1}/${n3} -1 65533 + expect 0 unlink ${n1}/${n3} + if [ "${type}" = "dir" ]; then + expect 0 rmdir ${n1}/${n2} + else + expect 0 unlink ${n1}/${n2} + fi + fi + create_file ${type} ${n1}/${n2} 65534 65534 + expect EPERM -u 65534 -g 65534 lchown ${n1}/${n2} 65533 65533 + expect EPERM -u 65533 -g 65533 lchown ${n1}/${n2} 65534 65534 + expect EPERM -u 65533 -g 65533 lchown ${n1}/${n2} 65533 65533 + expect EPERM -u 65534 -g 65534 -- lchown ${n1}/${n2} -1 65533 + if [ "${type}" = "dir" ]; then + expect 0 rmdir ${n1}/${n2} + else + expect 0 unlink ${n1}/${n2} + fi +done expect 0 rmdir ${n1} cd ${cdir} expect 0 rmdir ${n0} Modified: head/tools/regression/pjdfstest/tests/chown/10.t ============================================================================== --- head/tools/regression/pjdfstest/tests/chown/10.t Tue Aug 17 02:50:12 2010 (r211409) +++ head/tools/regression/pjdfstest/tests/chown/10.t Tue Aug 17 06:08:09 2010 (r211410) @@ -6,7 +6,9 @@ desc="chown returns EFAULT if the path a dir=`dirname $0` . ${dir}/../misc.sh -echo "1..2" +echo "1..4" expect EFAULT chown NULL 65534 65534 expect EFAULT chown DEADCODE 65534 65534 +expect EFAULT lchown NULL 65534 65534 +expect EFAULT lchown DEADCODE 65534 65534 From owner-svn-src-all@FreeBSD.ORG Tue Aug 17 07:13:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29703106566B; Tue, 17 Aug 2010 07:13:45 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (unknown [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id B9BD08FC08; Tue, 17 Aug 2010 07:13:44 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 9F13D2A28CBE; Tue, 17 Aug 2010 09:13:43 +0200 (CEST) Date: Tue, 17 Aug 2010 09:13:43 +0200 From: Ed Schouten To: Andre Oppermann Message-ID: <20100817071343.GV2978@hoeg.nl> References: <201008161424.o7GEO0WV000794@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Lez9QO3Seu3ycz0M" Content-Disposition: inline In-Reply-To: <201008161424.o7GEO0WV000794@svn.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r211396 - 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, 17 Aug 2010 07:13:45 -0000 --Lez9QO3Seu3ycz0M Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Andre Oppermann wrote: > + if (keg->uk_maxpages) > + nitems =3D keg->uk_maxpages * keg->uk_ipers; > + else > + nitems =3D 0; So what's the actual meaning of the if-statement here? If keg->uk_maxpages =3D=3D 0, the multiplication will always yield 0 as well, right? --=20 Ed Schouten WWW: http://80386.nl/ --Lez9QO3Seu3ycz0M Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iEYEARECAAYFAkxqNqcACgkQ52SDGA2eCwXgrwCfbSSlGLt3hHqSnSy9D5MOrYBB piAAn0R1sK++BY2OstCw64sszKr6fKou =+47z -----END PGP SIGNATURE----- --Lez9QO3Seu3ycz0M-- From owner-svn-src-all@FreeBSD.ORG Tue Aug 17 07:58:10 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A748F1065674; Tue, 17 Aug 2010 07:58:10 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 946338FC0A; Tue, 17 Aug 2010 07:58:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7H7wA8k023268; Tue, 17 Aug 2010 07:58:10 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7H7wAwa023266; Tue, 17 Aug 2010 07:58:10 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201008170758.o7H7wAwa023266@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 17 Aug 2010 07:58: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: r211411 - stable/8/sys/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: Tue, 17 Aug 2010 07:58:10 -0000 Author: bz Date: Tue Aug 17 07:58:10 2010 New Revision: 211411 URL: http://svn.freebsd.org/changeset/base/211411 Log: MFC r211301: In rip6_input(), in case of multicast, we might skip the normal processing and go to the next iteration early if multicast filtering would decide that this socket shall not receive the data. Unlock the pcb in that case or we leak the read lock and next time trying to get a write lock, would hang forever. PR: kern/149608 Submitted by: Chris Luke (chrisy flirble.org) Modified: stable/8/sys/netinet6/raw_ip6.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cam/ (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/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/netinet6/raw_ip6.c ============================================================================== --- stable/8/sys/netinet6/raw_ip6.c Tue Aug 17 06:08:09 2010 (r211410) +++ stable/8/sys/netinet6/raw_ip6.c Tue Aug 17 07:58:10 2010 (r211411) @@ -248,6 +248,7 @@ rip6_input(struct mbuf **mp, int *offp, } if (blocked != MCAST_PASS) { IP6STAT_INC(ip6s_notmember); + INP_RUNLOCK(in6p); continue; } } From owner-svn-src-all@FreeBSD.ORG Tue Aug 17 08:55:45 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8AD8B1065697; Tue, 17 Aug 2010 08:55:45 +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 7629C8FC25; Tue, 17 Aug 2010 08:55:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7H8tjX4024451; Tue, 17 Aug 2010 08:55:45 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7H8tjDX024438; Tue, 17 Aug 2010 08:55:45 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201008170855.o7H8tjDX024438@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 17 Aug 2010 08:55: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: r211412 - in head/sys: amd64/include arm/include compat/freebsd32 i386/include ia64/include kern mips/include powerpc/include sparc64/include sun4v/include 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: Tue, 17 Aug 2010 08:55:45 -0000 Author: kib Date: Tue Aug 17 08:55:45 2010 New Revision: 211412 URL: http://svn.freebsd.org/changeset/base/211412 Log: Supply some useful information to the started image using ELF aux vectors. In particular, provide pagesize and pagesizes array, the canary value for SSP use, number of host CPUs and osreldate. Tested by: marius (sparc64) MFC after: 1 month Modified: head/sys/amd64/include/elf.h head/sys/arm/include/elf.h head/sys/compat/freebsd32/freebsd32_misc.c head/sys/i386/include/elf.h head/sys/ia64/include/elf.h head/sys/kern/imgact_elf.c head/sys/kern/kern_exec.c head/sys/mips/include/elf.h head/sys/powerpc/include/elf.h head/sys/sparc64/include/elf.h head/sys/sun4v/include/elf.h head/sys/sys/imgact.h Modified: head/sys/amd64/include/elf.h ============================================================================== --- head/sys/amd64/include/elf.h Tue Aug 17 07:58:10 2010 (r211411) +++ head/sys/amd64/include/elf.h Tue Aug 17 08:55:45 2010 (r211412) @@ -88,8 +88,14 @@ __ElfType(Auxinfo); #define AT_GID 13 /* Real gid. */ #define AT_EGID 14 /* Effective gid. */ #define AT_EXECPATH 15 /* Path to the executable. */ +#define AT_CANARY 16 /* Canary for SSP */ +#define AT_CANARYLEN 17 /* Length of the canary. */ +#define AT_OSRELDATE 18 /* OSRELDATE. */ +#define AT_NCPUS 19 /* Number of CPUs. */ +#define AT_PAGESIZES 20 /* Pagesizes. */ +#define AT_PAGESIZESLEN 21 /* Number of pagesizes. */ -#define AT_COUNT 16 /* Count of defined aux entry types. */ +#define AT_COUNT 22 /* Count of defined aux entry types. */ /* * Relocation types. Modified: head/sys/arm/include/elf.h ============================================================================== --- head/sys/arm/include/elf.h Tue Aug 17 07:58:10 2010 (r211411) +++ head/sys/arm/include/elf.h Tue Aug 17 08:55:45 2010 (r211412) @@ -76,8 +76,14 @@ __ElfType(Auxinfo); #define AT_GID 13 /* Real gid. */ #define AT_EGID 14 /* Effective gid. */ #define AT_EXECPATH 15 /* Path to the executable. */ +#define AT_CANARY 16 /* Canary for SSP */ +#define AT_CANARYLEN 17 /* Length of the canary. */ +#define AT_OSRELDATE 18 /* OSRELDATE. */ +#define AT_NCPUS 19 /* Number of CPUs. */ +#define AT_PAGESIZES 20 /* Pagesizes. */ +#define AT_PAGESIZESLEN 21 /* Number of pagesizes. */ -#define AT_COUNT 16 /* Count of defined aux entry types. */ +#define AT_COUNT 22 /* Count of defined aux entry types. */ #define R_ARM_COUNT 33 /* Count of defined relocation types. */ Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Tue Aug 17 07:58:10 2010 (r211411) +++ head/sys/compat/freebsd32/freebsd32_misc.c Tue Aug 17 08:55:45 2010 (r211412) @@ -2525,11 +2525,13 @@ syscall32_helper_unregister(struct sysca register_t * freebsd32_copyout_strings(struct image_params *imgp) { - int argc, envc; + int argc, envc, i; u_int32_t *vectp; char *stringp, *destp; u_int32_t *stack_base; struct freebsd32_ps_strings *arginfo; + char canary[sizeof(long) * 8]; + int32_t pagesizes32[MAXPAGESIZES]; size_t execpath_len; int szsigcode; @@ -2545,8 +2547,10 @@ freebsd32_copyout_strings(struct image_p sv_psstrings; szsigcode = *(imgp->proc->p_sysent->sv_szsigcode); destp = (caddr_t)arginfo - szsigcode - SPARE_USRSPACE - - roundup(execpath_len, sizeof(char *)) - - roundup((ARG_MAX - imgp->args->stringspace), sizeof(char *)); + roundup(execpath_len, sizeof(char *)) - + roundup(sizeof(canary), sizeof(char *)) - + roundup(sizeof(pagesizes32), sizeof(char *)) - + roundup((ARG_MAX - imgp->args->stringspace), sizeof(char *)); /* * install sigcode @@ -2565,6 +2569,25 @@ freebsd32_copyout_strings(struct image_p } /* + * Prepare the canary for SSP. + */ + arc4rand(canary, sizeof(canary), 0); + imgp->canary = (uintptr_t)arginfo - szsigcode - execpath_len - + sizeof(canary); + copyout(canary, (void *)imgp->canary, sizeof(canary)); + imgp->canarylen = sizeof(canary); + + /* + * Prepare the pagesizes array. + */ + for (i = 0; i < MAXPAGESIZES; i++) + pagesizes32[i] = (uint32_t)pagesizes[i]; + imgp->pagesizes = (uintptr_t)arginfo - szsigcode - execpath_len - + roundup(sizeof(canary), sizeof(char *)) - sizeof(pagesizes32); + copyout(pagesizes32, (void *)imgp->pagesizes, sizeof(pagesizes32)); + imgp->pagesizeslen = sizeof(pagesizes32); + + /* * If we have a valid auxargs ptr, prepare some room * on the stack. */ Modified: head/sys/i386/include/elf.h ============================================================================== --- head/sys/i386/include/elf.h Tue Aug 17 07:58:10 2010 (r211411) +++ head/sys/i386/include/elf.h Tue Aug 17 08:55:45 2010 (r211412) @@ -90,8 +90,14 @@ __ElfType(Auxinfo); #define AT_GID 13 /* Real gid. */ #define AT_EGID 14 /* Effective gid. */ #define AT_EXECPATH 15 /* Path to the executable. */ +#define AT_CANARY 16 /* Canary for SSP. */ +#define AT_CANARYLEN 17 /* Length of the canary. */ +#define AT_OSRELDATE 18 /* OSRELDATE. */ +#define AT_NCPUS 19 /* Number of CPUs. */ +#define AT_PAGESIZES 20 /* Pagesizes. */ +#define AT_PAGESIZESLEN 21 /* Number of pagesizes. */ -#define AT_COUNT 16 /* Count of defined aux entry types. */ +#define AT_COUNT 22 /* Count of defined aux entry types. */ /* * Relocation types. Modified: head/sys/ia64/include/elf.h ============================================================================== --- head/sys/ia64/include/elf.h Tue Aug 17 07:58:10 2010 (r211411) +++ head/sys/ia64/include/elf.h Tue Aug 17 08:55:45 2010 (r211412) @@ -89,8 +89,14 @@ __ElfType(Auxinfo); #define AT_GID 13 /* Real gid. */ #define AT_EGID 14 /* Effective gid. */ #define AT_EXECPATH 15 /* Path to the executable. */ +#define AT_CANARY 16 /* Canary for SSP */ +#define AT_CANARYLEN 17 /* Length of the canary. */ +#define AT_OSRELDATE 18 /* OSRELDATE. */ +#define AT_NCPUS 19 /* Number of CPUs. */ +#define AT_PAGESIZES 20 /* Pagesizes. */ +#define AT_PAGESIZESLEN 21 /* Number of pagesizes. */ -#define AT_COUNT 16 /* Count of defined aux entry types. */ +#define AT_COUNT 22 /* Count of defined aux entry types. */ /* * Values for e_flags. Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Tue Aug 17 07:58:10 2010 (r211411) +++ head/sys/kern/imgact_elf.c Tue Aug 17 08:55:45 2010 (r211412) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -972,6 +973,16 @@ __elfN(freebsd_fixup)(register_t **stack AUXARGS_ENTRY(pos, AT_BASE, args->base); if (imgp->execpathp != 0) AUXARGS_ENTRY(pos, AT_EXECPATH, imgp->execpathp); + AUXARGS_ENTRY(pos, AT_OSRELDATE, osreldate); + if (imgp->canary != 0) { + AUXARGS_ENTRY(pos, AT_CANARY, imgp->canary); + AUXARGS_ENTRY(pos, AT_CANARYLEN, imgp->canarylen); + } + AUXARGS_ENTRY(pos, AT_NCPUS, mp_ncpus); + if (imgp->pagesizes != 0) { + AUXARGS_ENTRY(pos, AT_PAGESIZES, imgp->pagesizes); + AUXARGS_ENTRY(pos, AT_PAGESIZESLEN, imgp->pagesizeslen); + } AUXARGS_ENTRY(pos, AT_NULL, 0); free(imgp->auxargs, M_TEMP); Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Tue Aug 17 07:58:10 2010 (r211411) +++ head/sys/kern/kern_exec.c Tue Aug 17 08:55:45 2010 (r211412) @@ -385,6 +385,10 @@ do_execve(td, args, mac_p) imgp->args = args; imgp->execpath = imgp->freepath = NULL; imgp->execpathp = 0; + imgp->canary = 0; + imgp->canarylen = 0; + imgp->pagesizes = 0; + imgp->pagesizeslen = 0; #ifdef MAC error = mac_execve_enter(imgp, mac_p); @@ -1197,8 +1201,10 @@ exec_copyout_strings(imgp) struct ps_strings *arginfo; struct proc *p; size_t execpath_len; - int szsigcode; + int szsigcode, szps; + char canary[sizeof(long) * 8]; + szps = sizeof(pagesizes[0]) * MAXPAGESIZES; /* * Calculate string base and vector table pointers. * Also deal with signal trampoline code for this exec type. @@ -1214,6 +1220,8 @@ exec_copyout_strings(imgp) szsigcode = *(p->p_sysent->sv_szsigcode); destp = (caddr_t)arginfo - szsigcode - SPARE_USRSPACE - roundup(execpath_len, sizeof(char *)) - + roundup(sizeof(canary), sizeof(char *)) - + roundup(szps, sizeof(char *)) - roundup((ARG_MAX - imgp->args->stringspace), sizeof(char *)); /* @@ -1233,6 +1241,23 @@ exec_copyout_strings(imgp) } /* + * Prepare the canary for SSP. + */ + arc4rand(canary, sizeof(canary), 0); + imgp->canary = (uintptr_t)arginfo - szsigcode - execpath_len - + sizeof(canary); + copyout(canary, (void *)imgp->canary, sizeof(canary)); + imgp->canarylen = sizeof(canary); + + /* + * Prepare the pagesizes array. + */ + imgp->pagesizes = (uintptr_t)arginfo - szsigcode - execpath_len - + roundup(sizeof(canary), sizeof(char *)) - szps; + copyout(pagesizes, (void *)imgp->pagesizes, szps); + imgp->pagesizeslen = szps; + + /* * If we have a valid auxargs ptr, prepare some room * on the stack. */ @@ -1249,8 +1274,8 @@ exec_copyout_strings(imgp) * for argument of Runtime loader. */ vectp = (char **)(destp - (imgp->args->argc + - imgp->args->envc + 2 + imgp->auxarg_size + execpath_len) * - sizeof(char *)); + imgp->args->envc + 2 + imgp->auxarg_size) + * sizeof(char *)); } else { /* * The '+ 2' is for the null pointers at the end of each of Modified: head/sys/mips/include/elf.h ============================================================================== --- head/sys/mips/include/elf.h Tue Aug 17 07:58:10 2010 (r211411) +++ head/sys/mips/include/elf.h Tue Aug 17 08:55:45 2010 (r211412) @@ -251,8 +251,14 @@ __ElfType(Auxinfo); #define AT_GID 13 /* Real gid. */ #define AT_EGID 14 /* Effective gid. */ #define AT_EXECPATH 15 /* Path to the executable. */ +#define AT_CANARY 16 /* Canary for SSP */ +#define AT_CANARYLEN 17 /* Length of the canary. */ +#define AT_OSRELDATE 18 /* OSRELDATE. */ +#define AT_NCPUS 19 /* Number of CPUs. */ +#define AT_PAGESIZES 20 /* Pagesizes. */ +#define AT_PAGESIZESLEN 21 /* Number of pagesizes. */ -#define AT_COUNT 16 /* Count of defined aux entry types. */ +#define AT_COUNT 22 /* Count of defined aux entry types. */ #define ET_DYN_LOAD_ADDR 0x0120000 Modified: head/sys/powerpc/include/elf.h ============================================================================== --- head/sys/powerpc/include/elf.h Tue Aug 17 07:58:10 2010 (r211411) +++ head/sys/powerpc/include/elf.h Tue Aug 17 08:55:45 2010 (r211412) @@ -99,8 +99,14 @@ __ElfType(Auxinfo); #define AT_ICACHEBSIZE 11 /* Instruction cache block size for the uP. */ #define AT_UCACHEBSIZE 12 /* Cache block size, or `0' if cache not unified. */ #define AT_EXECPATH 13 /* Path to the executable. */ +#define AT_CANARY 14 /* Canary for SSP */ +#define AT_CANARYLEN 15 /* Length of the canary. */ +#define AT_OSRELDATE 16 /* OSRELDATE. */ +#define AT_NCPUS 17 /* Number of CPUs. */ +#define AT_PAGESIZES 18 /* Pagesizes. */ +#define AT_PAGESIZESLEN 19 /* Number of pagesizes. */ -#define AT_COUNT 14 /* Count of defined aux entry types. */ +#define AT_COUNT 20 /* Count of defined aux entry types. */ /* * Relocation types. Modified: head/sys/sparc64/include/elf.h ============================================================================== --- head/sys/sparc64/include/elf.h Tue Aug 17 07:58:10 2010 (r211411) +++ head/sys/sparc64/include/elf.h Tue Aug 17 08:55:45 2010 (r211412) @@ -84,8 +84,14 @@ __ElfType(Auxinfo); #define AT_GID 13 /* Real gid. */ #define AT_EGID 14 /* Effective gid. */ #define AT_EXECPATH 15 /* Path to the executable. */ +#define AT_CANARY 16 /* Canary for SSP */ +#define AT_CANARYLEN 17 /* Length of the canary. */ +#define AT_OSRELDATE 18 /* OSRELDATE. */ +#define AT_NCPUS 19 /* Number of CPUs. */ +#define AT_PAGESIZES 20 /* Pagesizes. */ +#define AT_PAGESIZESLEN 21 /* Number of pagesizes. */ -#define AT_COUNT 16 /* Count of defined aux entry types. */ +#define AT_COUNT 22 /* Count of defined aux entry types. */ /* Define "machine" characteristics */ #if __ELF_WORD_SIZE == 32 Modified: head/sys/sun4v/include/elf.h ============================================================================== --- head/sys/sun4v/include/elf.h Tue Aug 17 07:58:10 2010 (r211411) +++ head/sys/sun4v/include/elf.h Tue Aug 17 08:55:45 2010 (r211412) @@ -84,8 +84,14 @@ __ElfType(Auxinfo); #define AT_GID 13 /* Real gid. */ #define AT_EGID 14 /* Effective gid. */ #define AT_EXECPATH 15 /* Path to the executable. */ +#define AT_CANARY 16 /* Canary for SSP */ +#define AT_CANARYLEN 17 /* Length of the canary. */ +#define AT_OSRELDATE 18 /* OSRELDATE. */ +#define AT_NCPUS 19 /* Number of CPUs. */ +#define AT_PAGESIZES 20 /* Pagesizes. */ +#define AT_PAGESIZESLEN 21 /* Number of pagesizes. */ -#define AT_COUNT 16 /* Count of defined aux entry types. */ +#define AT_COUNT 22 /* Count of defined aux entry types. */ /* Define "machine" characteristics */ #if __ELF_WORD_SIZE == 32 Modified: head/sys/sys/imgact.h ============================================================================== --- head/sys/sys/imgact.h Tue Aug 17 07:58:10 2010 (r211411) +++ head/sys/sys/imgact.h Tue Aug 17 08:55:45 2010 (r211412) @@ -71,6 +71,10 @@ struct image_params { char *execpath; unsigned long execpathp; char *freepath; + unsigned long canary; + int canarylen; + unsigned long pagesizes; + int pagesizeslen; }; #ifdef _KERNEL From owner-svn-src-all@FreeBSD.ORG Tue Aug 17 09:05:40 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20C29106564A; Tue, 17 Aug 2010 09:05: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 0E4218FC08; Tue, 17 Aug 2010 09:05:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7H95dkZ024762; Tue, 17 Aug 2010 09:05:39 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7H95dbh024759; Tue, 17 Aug 2010 09:05:39 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201008170905.o7H95dbh024759@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 17 Aug 2010 09:05: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: r211413 - head/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2010 09:05:40 -0000 Author: kib Date: Tue Aug 17 09:05:39 2010 New Revision: 211413 URL: http://svn.freebsd.org/changeset/base/211413 Log: Use the newly provided aux vectors to get pagesize and osreldate information. Use local version of getpagesize(), rtld_getpagesize() in private allocator. Override the __getosreldate() previously fetched from libc_pic.a with local version that uses aux value if present. Note that __getosreldate() is used by rtld indirectly, by mmap(2) libc wrapper. To be able to utilize aux, split digest_dynamic() for use by init_rtld() into two parts, where the first one does not call malloc(), and the second part uses it. init_rtld() is able to initialize global variables before digest_dynamic2() calls. In particular, pagesize and osreldate are set up from the aux values. Now, rtld avoids (two) sysctl calls in startup. Tested by: marius (sparc64) MFC after: 1 month Modified: head/libexec/rtld-elf/malloc.c head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/malloc.c ============================================================================== --- head/libexec/rtld-elf/malloc.c Tue Aug 17 08:55:45 2010 (r211412) +++ head/libexec/rtld-elf/malloc.c Tue Aug 17 09:05:39 2010 (r211413) @@ -48,6 +48,7 @@ static char *rcsid = "$FreeBSD$"; */ #include +#include #include #include #include @@ -152,6 +153,26 @@ botch(s) static void xprintf(const char *, ...); #define TRACE() xprintf("TRACE %s:%d\n", __FILE__, __LINE__) +extern int pagesize; + +static int +rtld_getpagesize(void) +{ + int mib[2]; + size_t size; + + if (pagesize != 0) + return (pagesize); + + mib[0] = CTL_HW; + mib[1] = HW_PAGESIZE; + size = sizeof(pagesize); + if (sysctl(mib, 2, &pagesize, &size, NULL, 0) == -1) + return (-1); + return (pagesize); + +} + void * malloc(nbytes) size_t nbytes; @@ -166,7 +187,7 @@ malloc(nbytes) * align break pointer so all data will be page aligned. */ if (pagesz == 0) { - pagesz = n = getpagesize(); + pagesz = n = rtld_getpagesize(); if (morepages(NPOOLPAGES) == 0) return NULL; op = (union overhead *)(pagepool_start); Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Tue Aug 17 08:55:45 2010 (r211412) +++ head/libexec/rtld-elf/rtld.c Tue Aug 17 09:05:39 2010 (r211413) @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -84,6 +85,9 @@ typedef struct Struct_DoneList { */ static const char *basename(const char *); static void die(void) __dead2; +static void digest_dynamic1(Obj_Entry *, int, const Elf_Dyn **, + const Elf_Dyn **); +static void digest_dynamic2(Obj_Entry *, const Elf_Dyn *, const Elf_Dyn *); static void digest_dynamic(Obj_Entry *, int); static Obj_Entry *digest_phdr(const Elf_Phdr *, int, caddr_t, const char *); static Obj_Entry *dlcheck(void *); @@ -97,7 +101,7 @@ static char *find_library(const char *, static const char *gethints(void); static void init_dag(Obj_Entry *); static void init_dag1(Obj_Entry *, Obj_Entry *, DoneList *); -static void init_rtld(caddr_t); +static void init_rtld(caddr_t, Elf_Auxinfo **); static void initlist_add_neededs(Needed_Entry *, Objlist *); static void initlist_add_objects(Obj_Entry *, Obj_Entry **, Objlist *); static bool is_exported(const Elf_Sym *); @@ -188,6 +192,8 @@ extern Elf_Dyn _DYNAMIC; #define RTLD_IS_DYNAMIC() (&_DYNAMIC != NULL) #endif +int osreldate, pagesize; + /* * These are the functions the dynamic linker exports to application * programs. They are the only symbols the dynamic linker is willing @@ -350,7 +356,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ /* Initialize and relocate ourselves. */ assert(aux_info[AT_BASE] != NULL); - init_rtld((caddr_t) aux_info[AT_BASE]->a_un.a_ptr); + init_rtld((caddr_t) aux_info[AT_BASE]->a_un.a_ptr, aux_info); __progname = obj_rtld.path; argv0 = argv[0] != NULL ? argv[0] : "(null)"; @@ -737,14 +743,16 @@ die(void) * information in its Obj_Entry structure. */ static void -digest_dynamic(Obj_Entry *obj, int early) +digest_dynamic1(Obj_Entry *obj, int early, const Elf_Dyn **dyn_rpath, + const Elf_Dyn **dyn_soname) { const Elf_Dyn *dynp; Needed_Entry **needed_tail = &obj->needed; - const Elf_Dyn *dyn_rpath = NULL; - const Elf_Dyn *dyn_soname = NULL; int plttype = DT_REL; + *dyn_rpath = NULL; + *dyn_soname = NULL; + obj->bind_now = false; for (dynp = obj->dynamic; dynp->d_tag != DT_NULL; dynp++) { switch (dynp->d_tag) { @@ -868,11 +876,11 @@ digest_dynamic(Obj_Entry *obj, int early * We have to wait until later to process this, because we * might not have gotten the address of the string table yet. */ - dyn_rpath = dynp; + *dyn_rpath = dynp; break; case DT_SONAME: - dyn_soname = dynp; + *dyn_soname = dynp; break; case DT_INIT: @@ -961,6 +969,12 @@ digest_dynamic(Obj_Entry *obj, int early obj->pltrelasize = obj->pltrelsize; obj->pltrelsize = 0; } +} + +static void +digest_dynamic2(Obj_Entry *obj, const Elf_Dyn *dyn_rpath, + const Elf_Dyn *dyn_soname) +{ if (obj->z_origin && obj->origin_path == NULL) { obj->origin_path = xmalloc(PATH_MAX); @@ -978,6 +992,16 @@ digest_dynamic(Obj_Entry *obj, int early object_add_name(obj, obj->strtab + dyn_soname->d_un.d_val); } +static void +digest_dynamic(Obj_Entry *obj, int early) +{ + const Elf_Dyn *dyn_rpath; + const Elf_Dyn *dyn_soname; + + digest_dynamic1(obj, early, &dyn_rpath, &dyn_soname); + digest_dynamic2(obj, dyn_rpath, dyn_soname); +} + /* * Process a shared object's program header. This is used only for the * main program, when the kernel has already loaded the main program @@ -1304,9 +1328,11 @@ init_dag1(Obj_Entry *root, Obj_Entry *ob * this function is to relocate the dynamic linker. */ static void -init_rtld(caddr_t mapbase) +init_rtld(caddr_t mapbase, Elf_Auxinfo **aux_info) { Obj_Entry objtmp; /* Temporary rtld object */ + const Elf_Dyn *dyn_rpath; + const Elf_Dyn *dyn_soname; /* * Conjure up an Obj_Entry structure for the dynamic linker. @@ -1323,7 +1349,7 @@ init_rtld(caddr_t mapbase) #endif if (RTLD_IS_DYNAMIC()) { objtmp.dynamic = rtld_dynamic(&objtmp); - digest_dynamic(&objtmp, 1); + digest_dynamic1(&objtmp, 1, &dyn_rpath, &dyn_soname); assert(objtmp.needed == NULL); #if !defined(__mips__) /* MIPS and SH{3,5} have a bogus DT_TEXTREL. */ @@ -1344,6 +1370,13 @@ init_rtld(caddr_t mapbase) /* Now that non-local variables can be accesses, copy out obj_rtld. */ memcpy(&obj_rtld, &objtmp, sizeof(obj_rtld)); + if (aux_info[AT_PAGESZ] != NULL) + pagesize = aux_info[AT_PAGESZ]->a_un.a_val; + if (aux_info[AT_OSRELDATE] != NULL) + osreldate = aux_info[AT_OSRELDATE]->a_un.a_val; + + digest_dynamic2(&obj_rtld, dyn_rpath, dyn_soname); + /* Replace the path with a dynamically allocated copy. */ obj_rtld.path = xstrdup(PATH_RTLD); @@ -3630,3 +3663,23 @@ fetch_ventry(const Obj_Entry *obj, unsig } return NULL; } + +int +__getosreldate(void) +{ + size_t len; + int oid[2]; + int error, osrel; + + if (osreldate != 0) + return (osreldate); + + oid[0] = CTL_KERN; + oid[1] = KERN_OSRELDATE; + osrel = 0; + len = sizeof(osrel); + error = sysctl(oid, 2, &osrel, &len, NULL, 0); + if (error == 0 && osrel > 0 && len == sizeof(osrel)) + osreldate = osrel; + return (osreldate); +} From owner-svn-src-all@FreeBSD.ORG Tue Aug 17 09:08:28 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94F9410656A3; Tue, 17 Aug 2010 09:08:28 +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 83A238FC08; Tue, 17 Aug 2010 09:08:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7H98Sp7024850; Tue, 17 Aug 2010 09:08:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7H98SVw024848; Tue, 17 Aug 2010 09:08:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201008170908.o7H98SVw024848@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 17 Aug 2010 09:08: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: r211414 - head/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2010 09:08:28 -0000 Author: kib Date: Tue Aug 17 09:08:28 2010 New Revision: 211414 URL: http://svn.freebsd.org/changeset/base/211414 Log: Provide the starting image with the pointer to ELF aux vector. It is written into the __elf_aux_vector variable, if the symbol is present. Idea from: kan Tested by: marius (sparc64) MFC after: 1 month Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Tue Aug 17 09:05:39 2010 (r211413) +++ head/libexec/rtld-elf/rtld.c Tue Aug 17 09:08:28 2010 (r211414) @@ -541,6 +541,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ dbg("initializing key program variables"); set_program_var("__progname", argv[0] != NULL ? basename(argv[0]) : ""); set_program_var("environ", env); + set_program_var("__elf_aux_vector", aux); dbg("initializing thread locks"); lockdflt_init(); From owner-svn-src-all@FreeBSD.ORG Tue Aug 17 09:11:38 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D4321065693; Tue, 17 Aug 2010 09:11:38 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8AE058FC0A; Tue, 17 Aug 2010 09:11:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7H9BcS5024963; Tue, 17 Aug 2010 09:11:38 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7H9BcOv024960; Tue, 17 Aug 2010 09:11:38 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201008170911.o7H9BcOv024960@svn.freebsd.org> From: Bruce Cran Date: Tue, 17 Aug 2010 09:11:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211415 - head/usr.sbin/powerd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2010 09:11:38 -0000 Author: brucec Date: Tue Aug 17 09:11:38 2010 New Revision: 211415 URL: http://svn.freebsd.org/changeset/base/211415 Log: Add -m and -M options to control the minimum and maximum frequency. PR: bin/145063 Submitted by: Boris Kochergin Reviewed by: cperciva Approved by: rrs (mentor) MFC after: 2 weeks Modified: head/usr.sbin/powerd/powerd.8 head/usr.sbin/powerd/powerd.c Modified: head/usr.sbin/powerd/powerd.8 ============================================================================== --- head/usr.sbin/powerd/powerd.8 Tue Aug 17 09:08:28 2010 (r211414) +++ head/usr.sbin/powerd/powerd.8 Tue Aug 17 09:11:38 2010 (r211415) @@ -35,6 +35,8 @@ .Op Fl a Ar mode .Op Fl b Ar mode .Op Fl i Ar percent +.Op Fl m Ar freq +.Op Fl M Ar freq .Op Fl n Ar mode .Op Fl p Ar ival .Op Fl P Ar pidfile @@ -79,6 +81,10 @@ to use while on battery power. Specifies the CPU load percent level when adaptive mode should begin to degrade performance to save power. The default is 50% or lower. +.It Fl m Ar freq +Specifies the minimum frequency to throttle down to. +.It Fl M Ar freq +Specifies the maximum frequency to throttle up to. .It Fl n Ar mode Selects the .Ar mode Modified: head/usr.sbin/powerd/powerd.c ============================================================================== --- head/usr.sbin/powerd/powerd.c Tue Aug 17 09:08:28 2010 (r211414) +++ head/usr.sbin/powerd/powerd.c Tue Aug 17 09:11:38 2010 (r211415) @@ -84,7 +84,8 @@ const char *modes[] = { #define DEVCTL_MAXBUF 1024 static int read_usage_times(int *load); -static int read_freqs(int *numfreqs, int **freqs, int **power); +static int read_freqs(int *numfreqs, int **freqs, int **power, + int minfreq, int maxfreq); static int set_freq(int freq); static void acline_init(void); static void acline_read(void); @@ -174,10 +175,10 @@ read_usage_times(int *load) } static int -read_freqs(int *numfreqs, int **freqs, int **power) +read_freqs(int *numfreqs, int **freqs, int **power, int minfreq, int maxfreq) { char *freqstr, *p, *q; - int i; + int i, j; size_t len = 0; if (sysctl(levels_mib, 4, NULL, &len, NULL, 0)) @@ -201,19 +202,30 @@ read_freqs(int *numfreqs, int **freqs, i free(*freqs); return (-1); } - for (i = 0, p = freqstr; i < *numfreqs; i++) { + for (i = 0, j = 0, p = freqstr; i < *numfreqs; i++) { q = strchr(p, ' '); if (q != NULL) *q = '\0'; - if (sscanf(p, "%d/%d", &(*freqs)[i], &(*power)[i]) != 2) { + if (sscanf(p, "%d/%d", &(*freqs)[j], &(*power)[i]) != 2) { free(freqstr); free(*freqs); free(*power); return (-1); } + if (((*freqs)[j] >= minfreq || minfreq == -1) && + ((*freqs)[j] <= maxfreq || maxfreq == -1)) + j++; p = q + 1; } + *numfreqs = j; + if ((*freqs = realloc(*freqs, *numfreqs * sizeof(int))) == NULL) { + free(freqstr); + free(*freqs); + free(*power); + return (-1); + } + free(freqstr); return (0); } @@ -422,7 +434,7 @@ usage(void) { fprintf(stderr, -"usage: powerd [-v] [-a mode] [-b mode] [-i %%] [-n mode] [-p ival] [-r %%] [-P pidfile]\n"); +"usage: powerd [-v] [-a mode] [-b mode] [-i %%] [-m freq] [-M freq] [-n mode] [-p ival] [-r %%] [-P pidfile]\n"); exit(1); } @@ -435,6 +447,7 @@ main(int argc, char * argv[]) struct pidfh *pfh = NULL; const char *pidfile = NULL; int freq, curfreq, initfreq, *freqs, i, j, *mwatts, numfreqs, load; + int minfreq = -1, maxfreq = -1; int ch, mode, mode_ac, mode_battery, mode_none, idle, to; uint64_t mjoules_used; size_t len; @@ -452,7 +465,7 @@ main(int argc, char * argv[]) if (geteuid() != 0) errx(1, "must be root to run"); - while ((ch = getopt(argc, argv, "a:b:i:n:p:P:r:v")) != -1) + while ((ch = getopt(argc, argv, "a:b:i:m:M:n:p:P:r:v")) != -1) switch (ch) { case 'a': parse_mode(optarg, &mode_ac, ch); @@ -468,6 +481,22 @@ main(int argc, char * argv[]) usage(); } break; + case 'm': + minfreq = atoi(optarg); + if (minfreq < 0) { + warnx("%d is not a valid CPU frequency", + minfreq); + usage(); + } + break; + case 'M': + maxfreq = atoi(optarg); + if (maxfreq < 0) { + warnx("%d is not a valid CPU frequency", + maxfreq); + usage(); + } + break; case 'n': parse_mode(optarg, &mode_none, ch); break; @@ -515,8 +544,10 @@ main(int argc, char * argv[]) /* Check if we can read the load and supported freqs. */ if (read_usage_times(NULL)) err(1, "read_usage_times"); - if (read_freqs(&numfreqs, &freqs, &mwatts)) + if (read_freqs(&numfreqs, &freqs, &mwatts, minfreq, maxfreq)) err(1, "error reading supported CPU frequencies"); + if (numfreqs == 0) + errx(1, "no CPU frequencies in user-specified range"); /* Run in the background unless in verbose mode. */ if (!vflag) { @@ -552,6 +583,49 @@ main(int argc, char * argv[]) i = get_freq_id(curfreq, freqs, numfreqs); if (freq < 1) freq = 1; + + /* + * If we are in adaptive mode and the current frequency is outside the + * user-defined range, adjust it to be within the user-defined range. + */ + acline_read(); + if (acline_status > SRC_UNKNOWN) + errx(1, "invalid AC line status %d", acline_status); + if ((acline_status == SRC_AC && + (mode_ac == MODE_ADAPTIVE || mode_ac == MODE_HIADAPTIVE)) || + (acline_status == SRC_BATTERY && + (mode_battery == MODE_ADAPTIVE || mode_battery == MODE_HIADAPTIVE)) || + (acline_status == SRC_UNKNOWN && + (mode_none == MODE_ADAPTIVE || mode_none == MODE_HIADAPTIVE))) { + /* Read the current frequency. */ + len = sizeof(curfreq); + if (sysctl(freq_mib, 4, &curfreq, &len, NULL, 0) != 0) { + if (vflag) + warn("error reading current CPU frequency"); + } + if (curfreq < freqs[numfreqs - 1]) { + if (vflag) { + printf("CPU frequency is below user-defined " + "minimum; changing frequency to %d " + "MHz\n", freqs[numfreqs - 1]); + } + if (set_freq(freqs[numfreqs - 1]) != 0) { + warn("error setting CPU freq %d", + freqs[numfreqs - 1]); + } + } else if (curfreq > freqs[0]) { + if (vflag) { + printf("CPU frequency is above user-defined " + "maximum; changing frequency to %d " + "MHz\n", freqs[0]); + } + if (set_freq(freqs[0]) != 0) { + warn("error setting CPU freq %d", + freqs[0]); + } + } + } + idle = 0; /* Main loop. */ for (;;) { From owner-svn-src-all@FreeBSD.ORG Tue Aug 17 09:13:26 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8435A1065670; Tue, 17 Aug 2010 09:13:26 +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 712328FC18; Tue, 17 Aug 2010 09:13:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7H9DQFf025045; Tue, 17 Aug 2010 09:13:26 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7H9DQZV025034; Tue, 17 Aug 2010 09:13:26 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201008170913.o7H9DQZV025034@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 17 Aug 2010 09:13: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: r211416 - in head/lib/libc: gen include stdlib 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: Tue, 17 Aug 2010 09:13:26 -0000 Author: kib Date: Tue Aug 17 09:13:26 2010 New Revision: 211416 URL: http://svn.freebsd.org/changeset/base/211416 Log: Use aux vector to get values for SSP canary, pagesize, pagesizes array, number of host CPUs and osreldate. This eliminates the last sysctl(2) calls from the dynamically linked image startup. No objections from: kan Tested by: marius (sparc64) MFC after: 1 month Added: head/lib/libc/gen/aux.c (contents, props changed) Modified: head/lib/libc/gen/Makefile.inc head/lib/libc/gen/Symbol.map head/lib/libc/gen/__getosreldate.c head/lib/libc/gen/getosreldate.c head/lib/libc/gen/getpagesize.c head/lib/libc/gen/getpagesizes.c head/lib/libc/include/libc_private.h head/lib/libc/stdlib/malloc.c head/lib/libc/sys/stack_protector.c Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Tue Aug 17 09:11:38 2010 (r211415) +++ head/lib/libc/gen/Makefile.inc Tue Aug 17 09:13:26 2010 (r211416) @@ -7,7 +7,7 @@ SRCS+= __getosreldate.c __xuname.c \ _once_stub.c _pthread_stubs.c _rand48.c _spinlock_stub.c \ _thread_init.c \ - alarm.c arc4random.c assert.c basename.c check_utility_compat.c \ + alarm.c arc4random.c assert.c aux.c basename.c check_utility_compat.c \ clock.c closedir.c confstr.c \ crypt.c ctermid.c daemon.c devname.c dirname.c disklabel.c \ dlfcn.c drand48.c erand48.c err.c errlst.c errno.c \ Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Tue Aug 17 09:11:38 2010 (r211415) +++ head/lib/libc/gen/Symbol.map Tue Aug 17 09:13:26 2010 (r211416) @@ -492,4 +492,6 @@ FBSDprivate_1.0 { _libc_sem_timedwait_compat; _libc_sem_post_compat; _libc_sem_getvalue_compat; + + __elf_aux_vector; }; Modified: head/lib/libc/gen/__getosreldate.c ============================================================================== --- head/lib/libc/gen/__getosreldate.c Tue Aug 17 09:11:38 2010 (r211415) +++ head/lib/libc/gen/__getosreldate.c Tue Aug 17 09:13:26 2010 (r211416) @@ -29,6 +29,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include "libc_private.h" int __getosreldate(void); @@ -51,7 +54,11 @@ __getosreldate(void) if (osreldate != 0) return (osreldate); - + + error = _elf_aux_info(AT_OSRELDATE, &osreldate, sizeof(osreldate)); + if (error == 0 && osreldate != 0) + return (osreldate); + oid[0] = CTL_KERN; oid[1] = KERN_OSRELDATE; osrel = 0; Added: head/lib/libc/gen/aux.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/gen/aux.c Tue Aug 17 09:13:26 2010 (r211416) @@ -0,0 +1,146 @@ +/*- + * Copyright 2010 Konstantin Belousov . + * 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 ``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 BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "namespace.h" +#include +#include +#include +#include +#include +#include "un-namespace.h" +#include "libc_private.h" + +Elf_Auxinfo *__elf_aux_vector; + +static pthread_once_t aux_once = PTHREAD_ONCE_INIT; + +static int pagesize, osreldate, canary_len, ncpus, pagesizes_len; +static char *canary, *pagesizes; + +static void +init_aux(void) +{ + Elf_Auxinfo *aux; + + for (aux = __elf_aux_vector; aux->a_type != AT_NULL; aux++) { + switch (aux->a_type) { + case AT_CANARY: + canary = (char *)(aux->a_un.a_ptr); + break; + + case AT_CANARYLEN: + canary_len = aux->a_un.a_val; + break; + + case AT_PAGESIZES: + pagesizes = (char *)(aux->a_un.a_ptr); + break; + + case AT_PAGESIZESLEN: + pagesizes_len = aux->a_un.a_val; + break; + + case AT_PAGESZ: + pagesize = aux->a_un.a_val; + break; + + case AT_OSRELDATE: + osreldate = aux->a_un.a_val; + break; + + case AT_NCPUS: + ncpus = aux->a_un.a_val; + break; + } + } +} + +int +_elf_aux_info(int aux, void *buf, int buflen) +{ + int res; + + if (__elf_aux_vector == NULL) + return (ENOSYS); + _once(&aux_once, init_aux); + + switch (aux) { + case AT_CANARY: + if (canary != NULL && canary_len >= buflen) { + memcpy(buf, canary, buflen); + memset(canary, 0, canary_len); + canary = NULL; + res = 0; + } else + res = ENOENT; + break; + case AT_PAGESIZES: + if (pagesizes != NULL && pagesizes_len >= buflen) { + memcpy(buf, pagesizes, buflen); + res = 0; + } else + res = ENOENT; + break; + + case AT_PAGESZ: + if (buflen == sizeof(int)) { + if (pagesize != 0) { + *(int *)buf = pagesize; + res = 0; + } else + res = ENOENT; + } else + res = EINVAL; + break; + case AT_OSRELDATE: + if (buflen == sizeof(int)) { + if (osreldate != 0) { + *(int *)buf = osreldate; + res = 0; + } else + res = ENOENT; + } else + res = EINVAL; + break; + case AT_NCPUS: + if (buflen == sizeof(int)) { + if (ncpus != 0) { + *(int *)buf = ncpus; + res = 0; + } else + res = ENOENT; + } else + res = EINVAL; + break; + default: + res = ENOENT; + break; + } + return (res); +} Modified: head/lib/libc/gen/getosreldate.c ============================================================================== --- head/lib/libc/gen/getosreldate.c Tue Aug 17 09:11:38 2010 (r211415) +++ head/lib/libc/gen/getosreldate.c Tue Aug 17 09:13:26 2010 (r211416) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -45,15 +46,17 @@ getosreldate(void) int mib[2]; size_t size; int value; - char *temp; + if ((temp = getenv("OSVERSION"))) { + value = atoi(temp); + return (value); + } + mib[0] = CTL_KERN; mib[1] = KERN_OSRELDATE; size = sizeof value; if (sysctl(mib, 2, &value, &size, NULL, 0) == -1) return (-1); - if ((temp = getenv("OSVERSION"))) - value = atoi(temp); return (value); } Modified: head/lib/libc/gen/getpagesize.c ============================================================================== --- head/lib/libc/gen/getpagesize.c Tue Aug 17 09:11:38 2010 (r211415) +++ head/lib/libc/gen/getpagesize.c Tue Aug 17 09:13:26 2010 (r211416) @@ -36,8 +36,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include +#include "libc_private.h" + /* * This is unlikely to change over the running time of any * program, so we cache the result to save some syscalls. @@ -52,13 +56,20 @@ getpagesize() int mib[2]; static int value; size_t size; + int error; + + if (value != 0) + return (value); + + error = _elf_aux_info(AT_PAGESZ, &value, sizeof(value)); + if (error == 0 && value != 0) + return (value); + + mib[0] = CTL_HW; + mib[1] = HW_PAGESIZE; + size = sizeof value; + if (sysctl(mib, 2, &value, &size, NULL, 0) == -1) + return (-1); - if (!value) { - mib[0] = CTL_HW; - mib[1] = HW_PAGESIZE; - size = sizeof value; - if (sysctl(mib, 2, &value, &size, NULL, 0) == -1) - return (-1); - } return (value); } Modified: head/lib/libc/gen/getpagesizes.c ============================================================================== --- head/lib/libc/gen/getpagesizes.c Tue Aug 17 09:11:38 2010 (r211415) +++ head/lib/libc/gen/getpagesizes.c Tue Aug 17 09:13:26 2010 (r211416) @@ -32,6 +32,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include + +#include "libc_private.h" /* * Retrieves page size information from the system. Specifically, returns the @@ -51,7 +54,7 @@ getpagesizes(size_t pagesize[], int nele static u_long ps[MAXPAGESIZES]; static int nops; size_t size; - int i; + int error, i; if (nelem < 0 || (nelem > 0 && pagesize == NULL)) { errno = EINVAL; @@ -59,9 +62,13 @@ getpagesizes(size_t pagesize[], int nele } /* Cache the result of the sysctl(2). */ if (nops == 0) { + error = _elf_aux_info(AT_PAGESIZES, ps, sizeof(ps)); size = sizeof(ps); - if (sysctlbyname("hw.pagesizes", ps, &size, NULL, 0) == -1) - return (-1); + if (error != 0 || ps[0] == 0) { + if (sysctlbyname("hw.pagesizes", ps, &size, NULL, 0) + == -1) + return (-1); + } /* Count the number of page sizes that are supported. */ nops = size / sizeof(ps[0]); while (nops > 0 && ps[nops - 1] == 0) Modified: head/lib/libc/include/libc_private.h ============================================================================== --- head/lib/libc/include/libc_private.h Tue Aug 17 09:11:38 2010 (r211415) +++ head/lib/libc/include/libc_private.h Tue Aug 17 09:13:26 2010 (r211416) @@ -213,4 +213,6 @@ extern int __sys_fcntl(int, int, ...); /* execve() with PATH processing to implement posix_spawnp() */ int _execvpe(const char *, char * const *, char * const *); +int _elf_aux_info(int aux, void *buf, int buflen); + #endif /* _LIBC_PRIVATE_H_ */ Modified: head/lib/libc/stdlib/malloc.c ============================================================================== --- head/lib/libc/stdlib/malloc.c Tue Aug 17 09:11:38 2010 (r211415) +++ head/lib/libc/stdlib/malloc.c Tue Aug 17 09:13:26 2010 (r211416) @@ -180,6 +180,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -194,6 +195,8 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" +#include "libc_private.h" + #define RB_COMPACT #include "rb.h" #if (defined(MALLOC_TCACHE) && defined(MALLOC_STATS)) @@ -5353,14 +5356,20 @@ small_size2bin_init_hard(void) static unsigned malloc_ncpus(void) { + int mib[2]; unsigned ret; - size_t retlen = sizeof(ret); - int mib[] = {CTL_HW, HW_NCPU}; + int error; + size_t len; - if (sysctl(mib, sizeof(mib) / sizeof(int), &ret, &retlen, - (void *)0, 0) == -1) { - /* Error. */ - ret = 1; + error = _elf_aux_info(AT_NCPUS, &ret, sizeof(ret)); + if (error != 0 || ret == 0) { + mib[0] = CTL_HW; + mib[1] = HW_NCPU; + len = sizeof(ret); + if (sysctl(mib, 2, &ret, &len, (void *)NULL, 0) == -1) { + /* Error. */ + ret = 1; + } } return (ret); Modified: head/lib/libc/sys/stack_protector.c ============================================================================== --- head/lib/libc/sys/stack_protector.c Tue Aug 17 09:11:38 2010 (r211415) +++ head/lib/libc/sys/stack_protector.c Tue Aug 17 09:13:26 2010 (r211416) @@ -34,10 +34,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include #include +#include "libc_private.h" extern int __sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, size_t newlen); @@ -54,9 +57,14 @@ __guard_setup(void) { int mib[2]; size_t len; + int error; if (__stack_chk_guard[0] != 0) return; + error = _elf_aux_info(AT_CANARY, __stack_chk_guard, + sizeof(__stack_chk_guard)); + if (error == 0 && __stack_chk_guard[0] != 0) + return; mib[0] = CTL_KERN; mib[1] = KERN_ARND; From owner-svn-src-all@FreeBSD.ORG Tue Aug 17 09:39:07 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FFC0106566B; Tue, 17 Aug 2010 09:39:07 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0DD088FC08; Tue, 17 Aug 2010 09:39:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7H9d6Hl025667; Tue, 17 Aug 2010 09:39:06 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7H9d63p025660; Tue, 17 Aug 2010 09:39:06 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201008170939.o7H9d63p025660@svn.freebsd.org> From: Bruce Cran Date: Tue, 17 Aug 2010 09:39: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: r211417 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2010 09:39:07 -0000 Author: brucec Date: Tue Aug 17 09:39:06 2010 New Revision: 211417 URL: http://svn.freebsd.org/changeset/base/211417 Log: To restart, sysinstall calls execl. Since it will create a new process, we can't check to see if sysinstall is running as init just by checking if the PID is 0. Introduce a new option that sets the RunningAsInit flag, and update the code to check RunningAsInit intstead of getpid(). PR: bin/38854 Submitted by: Peter Sedeffow Approved by: rrs (mentor) MFC after: 1 month Modified: head/usr.sbin/sysinstall/globals.c head/usr.sbin/sysinstall/install.c head/usr.sbin/sysinstall/main.c head/usr.sbin/sysinstall/msg.c head/usr.sbin/sysinstall/system.c head/usr.sbin/sysinstall/termcap.c Modified: head/usr.sbin/sysinstall/globals.c ============================================================================== --- head/usr.sbin/sysinstall/globals.c Tue Aug 17 09:13:26 2010 (r211416) +++ head/usr.sbin/sysinstall/globals.c Tue Aug 17 09:39:06 2010 (r211417) @@ -76,13 +76,10 @@ globalsInit(void) { DebugFD = -1; ColorDisplay = FALSE; - Fake = FALSE; - Restarting = FALSE; OnVTY = FALSE; DialogActive = FALSE; VarHead = NULL; mediaDevice = NULL; - RunningAsInit = FALSE; HomeChunk = NULL; RootChunk = NULL; Modified: head/usr.sbin/sysinstall/install.c ============================================================================== --- head/usr.sbin/sysinstall/install.c Tue Aug 17 09:13:26 2010 (r211416) +++ head/usr.sbin/sysinstall/install.c Tue Aug 17 09:39:06 2010 (r211417) @@ -1274,7 +1274,7 @@ installVarDefaults(dialogMenuItem *self) variable_set2(VAR_FIXIT_TTY, "serial", 0); variable_set2(VAR_PKG_TMPDIR, "/var/tmp", 0); variable_set2(VAR_MEDIA_TIMEOUT, itoa(MEDIA_TIMEOUT), 0); - if (getpid() != 1) + if (!RunningAsInit) variable_set2(SYSTEM_STATE, "update", 0); else variable_set2(SYSTEM_STATE, "init", 0); Modified: head/usr.sbin/sysinstall/main.c ============================================================================== --- head/usr.sbin/sysinstall/main.c Tue Aug 17 09:13:26 2010 (r211416) +++ head/usr.sbin/sysinstall/main.c Tue Aug 17 09:39:06 2010 (r211417) @@ -56,12 +56,42 @@ main(int argc, char **argv) int choice, scroll, curr, max, status; char titlestr[80], *arch, *osrel, *ostype; struct rlimit rlim; - + char *arg; + int i; + int optionArgs = 0; + /* Record name to be able to restart */ StartName = argv[0]; + Restarting = FALSE; + RunningAsInit = FALSE; + Fake = FALSE; + + for (i = 1; i < argc; i++) { + arg = argv[i]; + + if (arg[0] != '-') + break; + + optionArgs++; + + if (!strcmp(arg, "-fake")) { + variable_set2(VAR_DEBUG, "YES", 0); + Fake = TRUE; + } else if (!strcmp(arg, "-restart")) { + Restarting = TRUE; + } else if (!strcmp(arg, "-fakeInit")) { + RunningAsInit = TRUE; + } + + arg = argv[optionArgs+1]; + } + + if (getpid() == 1) + RunningAsInit = TRUE; + /* Catch fatal signals and complain about them if running as init */ - if (getpid() == 1) { + if (RunningAsInit) { signal(SIGBUS, screech); signal(SIGSEGV, screech); } @@ -105,13 +135,8 @@ main(int argc, char **argv) if (!RunningAsInit) installEnvironment(); - if (argc > 1 && !strcmp(argv[1], "-fake")) { - variable_set2(VAR_DEBUG, "YES", 0); - Fake = TRUE; + if (Fake) msgConfirm("I'll be just faking it from here on out, OK?"); - } - if (argc > 1 && !strcmp(argv[1], "-restart")) - Restarting = TRUE; /* Try to preserve our scroll-back buffer */ if (OnVTY) { @@ -140,19 +165,14 @@ main(int argc, char **argv) /* First, see if we have any arguments to process (and argv[0] counts if it's not "sysinstall") */ if (!RunningAsInit) { - int i, start_arg; - - if (!strstr(argv[0], "sysinstall")) - start_arg = 0; - else if (Fake || Restarting) - start_arg = 2; - else - start_arg = 1; - for (i = start_arg; i < argc; i++) { + for (i = optionArgs+1; i < argc; i++) { if (DITEM_STATUS(dispatchCommand(argv[i])) != DITEM_SUCCESS) systemShutdown(1); } - if (argc > start_arg) + + /* If we were given commands to process on the command line, just exit + * now */ + if (argc > optionArgs+1) systemShutdown(0); } else @@ -187,7 +207,7 @@ main(int argc, char **argv) while (1) { choice = scroll = curr = max = 0; dmenuOpen(&MenuInitial, &choice, &scroll, &curr, &max, TRUE); - if (getpid() != 1 + if (!RunningAsInit #if defined(__sparc64__) || !msgNoYes("Are you sure you wish to exit? The system will halt.") #else Modified: head/usr.sbin/sysinstall/msg.c ============================================================================== --- head/usr.sbin/sysinstall/msg.c Tue Aug 17 09:13:26 2010 (r211416) +++ head/usr.sbin/sysinstall/msg.c Tue Aug 17 09:39:06 2010 (r211417) @@ -233,7 +233,7 @@ msgFatal(char *fmt, ...) mvaddstr(StatusLine, 0, errstr); addstr(" - "); addstr("PRESS ANY KEY TO "); - if (getpid() == 1) + if (RunningAsInit) addstr("REBOOT"); else addstr("QUIT"); Modified: head/usr.sbin/sysinstall/system.c ============================================================================== --- head/usr.sbin/sysinstall/system.c Tue Aug 17 09:13:26 2010 (r211416) +++ head/usr.sbin/sysinstall/system.c Tue Aug 17 09:39:06 2010 (r211417) @@ -59,13 +59,20 @@ static int intr_restart(dialogMenuItem *self) { int ret, fd, fdmax; + char *arg; mediaClose(); free_variables(); fdmax = getdtablesize(); for (fd = 3; fd < fdmax; fd++) close(fd); - ret = execl(StartName, StartName, "-restart", (char *)NULL); + + if (RunningAsInit) + arg = "-restart -fakeInit"; + else + arg = "-restart"; + + ret = execl(StartName, StartName, arg, NULL); msgDebug("execl failed (%s)\n", strerror(errno)); /* NOTREACHED */ return -1; @@ -148,11 +155,10 @@ systemInitialize(int argc, char **argv) variable_set2(VAR_DEBUG, "YES", 0); /* Are we running as init? */ - if (getpid() == 1) { + if (RunningAsInit) { struct ufs_args ufs_args; int fd; - RunningAsInit = 1; setsid(); close(0); fd = open("/dev/ttyv0", O_RDWR); Modified: head/usr.sbin/sysinstall/termcap.c ============================================================================== --- head/usr.sbin/sysinstall/termcap.c Tue Aug 17 09:13:26 2010 (r211416) +++ head/usr.sbin/sysinstall/termcap.c Tue Aug 17 09:39:06 2010 (r211417) @@ -105,7 +105,7 @@ set_termcap(void) else { int i, on; - if (getpid() == 1) { + if (RunningAsInit) { DebugFD = open("/dev/ttyv1", O_WRONLY); if (DebugFD != -1) { on = 1; From owner-svn-src-all@FreeBSD.ORG Tue Aug 17 09:42:50 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 943E31065696; Tue, 17 Aug 2010 09:42:50 +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 687C88FC1D; Tue, 17 Aug 2010 09:42:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7H9goJG025785; Tue, 17 Aug 2010 09:42:50 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7H9gov7025783; Tue, 17 Aug 2010 09:42:50 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201008170942.o7H9gov7025783@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 17 Aug 2010 09:42: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: r211418 - head/tools/test/auxinfo X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2010 09:42:50 -0000 Author: kib Date: Tue Aug 17 09:42:50 2010 New Revision: 211418 URL: http://svn.freebsd.org/changeset/base/211418 Log: Add simple test to check the functioning of retrieval of pagesize()/pagesizes() after change to use aux vector. Note that public function getosreldate() is different from libc-internal __getosreldate() and does not use aux to fetch osreldate value. MFC after: 1 month Added: head/tools/test/auxinfo/ head/tools/test/auxinfo/Makefile (contents, props changed) head/tools/test/auxinfo/auxinfo.c (contents, props changed) Added: head/tools/test/auxinfo/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/test/auxinfo/Makefile Tue Aug 17 09:42:50 2010 (r211418) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PROG= auxinfo +NO_MAN= +WARNS?= 6 + +.include Added: head/tools/test/auxinfo/auxinfo.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/test/auxinfo/auxinfo.c Tue Aug 17 09:42:50 2010 (r211418) @@ -0,0 +1,58 @@ +/* + * This file is in public domain. + * Written by Konstantin Belousov + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include + +static void +test_pagesizes(void) +{ + size_t *ps; + int i, nelem; + + nelem = getpagesizes(NULL, 0); + if (nelem == -1) + err(1, "getpagesizes(NULL, 0)"); + ps = malloc(nelem * sizeof(size_t)); + if (ps == NULL) + err(1, "malloc"); + nelem = getpagesizes(ps, nelem); + if (nelem == -1) + err(1, "getpagesizes"); + printf("Supported page sizes:"); + for (i = 0; i < nelem; i++) + printf(" %jd", (intmax_t)ps[i]); + printf("\n"); +} + +static void +test_pagesize(void) +{ + + printf("Pagesize: %d\n", getpagesize()); +} + +static void +test_osreldate(void) +{ + + printf("OSRELDATE: %d\n", getosreldate()); +} + +int +main(int argc __unused, char *argv[] __unused) +{ + + test_pagesizes(); + test_pagesize(); + test_osreldate(); + return (0); +} From owner-svn-src-all@FreeBSD.ORG Tue Aug 17 09:51:08 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D97191065672; Tue, 17 Aug 2010 09:51:08 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C843A8FC16; Tue, 17 Aug 2010 09:51:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7H9p8iK025991; Tue, 17 Aug 2010 09:51:08 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7H9p8Tc025989; Tue, 17 Aug 2010 09:51:08 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201008170951.o7H9p8Tc025989@svn.freebsd.org> From: Bruce Cran Date: Tue, 17 Aug 2010 09:51: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: r211419 - head/contrib/top X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2010 09:51:08 -0000 Author: brucec Date: Tue Aug 17 09:51:08 2010 New Revision: 211419 URL: http://svn.freebsd.org/changeset/base/211419 Log: Since top displays the uptime including seconds, there is no need to add 30 onto it, which may have been used for rounding purposes in other utilities. PR: bin/147934 Submitted by: Janne Snabb Approved by: rrs (mentor) MFC after: 2 weeks Modified: head/contrib/top/display.c Modified: head/contrib/top/display.c ============================================================================== --- head/contrib/top/display.c Tue Aug 17 09:42:50 2010 (r211418) +++ head/contrib/top/display.c Tue Aug 17 09:51:08 2010 (r211419) @@ -1273,7 +1273,6 @@ time_t *tod; if (bt->tv_sec != -1) { uptime = *tod - bt->tv_sec; - uptime += 30; days = uptime / 86400; uptime %= 86400; hrs = uptime / 3600; From owner-svn-src-all@FreeBSD.ORG Tue Aug 17 10:48:57 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 404E01065679; Tue, 17 Aug 2010 10:48:57 +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 907588FC0A; Tue, 17 Aug 2010 10:48:56 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o7HAmqR2006084 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 17 Aug 2010 13:48:52 +0300 (EEST) (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.4/8.14.4) with ESMTP id o7HAmq3F038383; Tue, 17 Aug 2010 13:48:52 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o7HAmq20038382; Tue, 17 Aug 2010 13:48:52 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 17 Aug 2010 13:48:52 +0300 From: Kostik Belousov To: Bruce Cran Message-ID: <20100817104852.GB2396@deviant.kiev.zoral.com.ua> References: <201008170939.o7H9d63p025660@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pAMbS1LL1U6QDnK3" Content-Disposition: inline In-Reply-To: <201008170939.o7H9d63p025660@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=-2.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_20, DNS_FROM_OPENWHOIS autolearn=no 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: r211417 - head/usr.sbin/sysinstall X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2010 10:48:57 -0000 --pAMbS1LL1U6QDnK3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 17, 2010 at 09:39:06AM +0000, Bruce Cran wrote: > Author: brucec > Date: Tue Aug 17 09:39:06 2010 > New Revision: 211417 > URL: http://svn.freebsd.org/changeset/base/211417 >=20 > Log: > To restart, sysinstall calls execl. Since it will create a new process,= we execl(3) does not create new process, it changes the executed program of th= e=20 existing process. In particular, the pid is left unchanged. > can't check to see if sysinstall is running as init just by checking if= the > PID is 0. Introduce a new option that sets the RunningAsInit flag, and = update init pid is 1. > the code to check RunningAsInit intstead of getpid(). > =20 > PR: bin/38854 > Submitted by: Peter Sedeffow > Approved by: rrs (mentor) > MFC after: 1 month --pAMbS1LL1U6QDnK3 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkxqaRMACgkQC3+MBN1Mb4iWTgCgocsz16Nn89Mr0BheyyjA5uoi sxYAoN4RWblOk0qbbEFhF0DQ39ofpbWv =vPNh -----END PGP SIGNATURE----- --pAMbS1LL1U6QDnK3-- From owner-svn-src-all@FreeBSD.ORG Tue Aug 17 12:04:17 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C529110656BC; Tue, 17 Aug 2010 12:04:17 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9990B8FC1B; Tue, 17 Aug 2010 12:04:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7HC4HP3031759; Tue, 17 Aug 2010 12:04:17 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7HC4H3c031756; Tue, 17 Aug 2010 12:04:17 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201008171204.o7HC4H3c031756@svn.freebsd.org> From: Edwin Groothuis Date: Tue, 17 Aug 2010 12:04:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r211420 - vendor/tzdata/dist X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2010 12:04:17 -0000 Author: edwin Date: Tue Aug 17 12:04:17 2010 New Revision: 211420 URL: http://svn.freebsd.org/changeset/base/211420 Log: Vendor import of tzdata2010l - Fix start times of DST for Egypt. - clocks were set back one hour at 2010-08-11 00:00:00 local time in Gaza and the West Bank. Obtained from: ftp://elsie.nci.nih.gov/pub/ Modified: vendor/tzdata/dist/africa vendor/tzdata/dist/asia Modified: vendor/tzdata/dist/africa ============================================================================== --- vendor/tzdata/dist/africa Tue Aug 17 09:51:08 2010 (r211419) +++ vendor/tzdata/dist/africa Tue Aug 17 12:04:17 2010 (r211420) @@ -1,5 +1,5 @@ #
-# @(#)africa	8.27
+# @(#)africa	8.28
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -311,8 +311,8 @@ Rule	Egypt	2007	only	-	Sep	Thu>=1	23:00s
 
 Rule	Egypt	2008	only	-	Aug	lastThu	23:00s	0	-
 Rule	Egypt	2009	only	-	Aug	20	23:00s	0	-
-Rule	Egypt	2010	only	-	Aug	10	23:00s	0	-
-Rule	Egypt	2010	only	-	Sep	9	0:00s	1:00	S
+Rule	Egypt	2010	only	-	Aug	11	0:00	0	-
+Rule	Egypt	2010	only	-	Sep	10	0:00	1:00	S
 Rule	Egypt	2010	max	-	Sep	lastThu	23:00s	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]

Modified: vendor/tzdata/dist/asia
==============================================================================
--- vendor/tzdata/dist/asia	Tue Aug 17 09:51:08 2010	(r211419)
+++ vendor/tzdata/dist/asia	Tue Aug 17 12:04:17 2010	(r211420)
@@ -1,4 +1,4 @@
-# @(#)asia	8.60
+# @(#)asia	8.61
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -2178,6 +2178,18 @@ Zone	Asia/Karachi	4:28:12 -	LMT	1907
 # "At 12:01am Friday, clocks in Israel and the West Bank will change to
 # 1:01am, while Gaza clocks will change at 12:01am Saturday morning."
 
+# From Steffen Thorsen (2010-08-11):
+# According to several sources, including
+# 
+# http://www.maannews.net/eng/ViewDetails.aspx?ID=306795
+# 
+# the clocks were set back one hour at 2010-08-11 00:00:00 local time in 
+# Gaza and the West Bank.
+# Some more background info:
+# 
+# http://www.timeanddate.com/news/time/westbank-gaza-end-dst-2010.html
+# 
+
 # The rules for Egypt are stolen from the `africa' file.
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule EgyptAsia	1957	only	-	May	10	0:00	1:00	S
@@ -2198,6 +2210,7 @@ Rule Palestine	2008	only	-	Aug	lastFri	2
 Rule Palestine	2009	only	-	Mar	lastFri	0:00	1:00	S
 Rule Palestine	2010	max	-	Mar	lastSat	0:01	1:00	S
 Rule Palestine	2009	max	-	Sep	Fri>=1	2:00	0	-
+Rule Palestine	2010	only	-	Aug	11	0:00	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Gaza	2:17:52	-	LMT	1900 Oct

From owner-svn-src-all@FreeBSD.ORG  Tue Aug 17 12:05:49 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 55C6E10656C1;
	Tue, 17 Aug 2010 12:05:49 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2A4738FC16;
	Tue, 17 Aug 2010 12:05:49 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7HC5nhB031829;
	Tue, 17 Aug 2010 12:05:49 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7HC5nsL031828;
	Tue, 17 Aug 2010 12:05:49 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201008171205.o7HC5nsL031828@svn.freebsd.org>
From: Edwin Groothuis 
Date: Tue, 17 Aug 2010 12:05:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-vendor@freebsd.org
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r211421 - vendor/tzdata/tzdata2010l
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 17 Aug 2010 12:05:49 -0000

Author: edwin
Date: Tue Aug 17 12:05:48 2010
New Revision: 211421
URL: http://svn.freebsd.org/changeset/base/211421

Log:
  Tag of tzdata2010l

Added:
  vendor/tzdata/tzdata2010l/
     - copied from r211420, vendor/tzdata/dist/

From owner-svn-src-all@FreeBSD.ORG  Tue Aug 17 12:10:35 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7790D1065698;
	Tue, 17 Aug 2010 12:10:35 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4CE9E8FC1E;
	Tue, 17 Aug 2010 12:10:35 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7HCAZmV032004;
	Tue, 17 Aug 2010 12:10:35 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7HCAZOs032001;
	Tue, 17 Aug 2010 12:10:35 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201008171210.o7HCAZOs032001@svn.freebsd.org>
From: Edwin Groothuis 
Date: Tue, 17 Aug 2010 12:10: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: r211422 - head/contrib/tzdata
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 17 Aug 2010 12:10:35 -0000

Author: edwin
Date: Tue Aug 17 12:10:35 2010
New Revision: 211422
URL: http://svn.freebsd.org/changeset/base/211422

Log:
  MFV of r211420, tzdata2010l
  
  - Fix start times of DST for Egypt.
  - clocks were set back one hour at 2010-08-11 00:00:00 local time
    in Gaza and the West Bank.
  
  Obtained from:  ftp://elsie.nci.nih.gov/pub/

Modified:
  head/contrib/tzdata/africa
  head/contrib/tzdata/asia
Directory Properties:
  head/contrib/tzdata/   (props changed)

Modified: head/contrib/tzdata/africa
==============================================================================
--- head/contrib/tzdata/africa	Tue Aug 17 12:05:48 2010	(r211421)
+++ head/contrib/tzdata/africa	Tue Aug 17 12:10:35 2010	(r211422)
@@ -1,5 +1,5 @@
 # 
-# @(#)africa	8.27
+# @(#)africa	8.28
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -311,8 +311,8 @@ Rule	Egypt	2007	only	-	Sep	Thu>=1	23:00s
 
 Rule	Egypt	2008	only	-	Aug	lastThu	23:00s	0	-
 Rule	Egypt	2009	only	-	Aug	20	23:00s	0	-
-Rule	Egypt	2010	only	-	Aug	10	23:00s	0	-
-Rule	Egypt	2010	only	-	Sep	9	0:00s	1:00	S
+Rule	Egypt	2010	only	-	Aug	11	0:00	0	-
+Rule	Egypt	2010	only	-	Sep	10	0:00	1:00	S
 Rule	Egypt	2010	max	-	Sep	lastThu	23:00s	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]

Modified: head/contrib/tzdata/asia
==============================================================================
--- head/contrib/tzdata/asia	Tue Aug 17 12:05:48 2010	(r211421)
+++ head/contrib/tzdata/asia	Tue Aug 17 12:10:35 2010	(r211422)
@@ -1,4 +1,4 @@
-# @(#)asia	8.60
+# @(#)asia	8.61
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -2178,6 +2178,18 @@ Zone	Asia/Karachi	4:28:12 -	LMT	1907
 # "At 12:01am Friday, clocks in Israel and the West Bank will change to
 # 1:01am, while Gaza clocks will change at 12:01am Saturday morning."
 
+# From Steffen Thorsen (2010-08-11):
+# According to several sources, including
+# 
+# http://www.maannews.net/eng/ViewDetails.aspx?ID=306795
+# 
+# the clocks were set back one hour at 2010-08-11 00:00:00 local time in 
+# Gaza and the West Bank.
+# Some more background info:
+# 
+# http://www.timeanddate.com/news/time/westbank-gaza-end-dst-2010.html
+# 
+
 # The rules for Egypt are stolen from the `africa' file.
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule EgyptAsia	1957	only	-	May	10	0:00	1:00	S
@@ -2198,6 +2210,7 @@ Rule Palestine	2008	only	-	Aug	lastFri	2
 Rule Palestine	2009	only	-	Mar	lastFri	0:00	1:00	S
 Rule Palestine	2010	max	-	Mar	lastSat	0:01	1:00	S
 Rule Palestine	2009	max	-	Sep	Fri>=1	2:00	0	-
+Rule Palestine	2010	only	-	Aug	11	0:00	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Gaza	2:17:52	-	LMT	1900 Oct

From owner-svn-src-all@FreeBSD.ORG  Tue Aug 17 12:16:06 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E24FF1065696;
	Tue, 17 Aug 2010 12:16:06 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B62488FC1B;
	Tue, 17 Aug 2010 12:16:06 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7HCG6ml032169;
	Tue, 17 Aug 2010 12:16:06 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7HCG6h0032165;
	Tue, 17 Aug 2010 12:16:06 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201008171216.o7HCG6h0032165@svn.freebsd.org>
From: Edwin Groothuis 
Date: Tue, 17 Aug 2010 12:16:06 +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: r211423 - stable/8/share/zoneinfo
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 17 Aug 2010 12:16:07 -0000

Author: edwin
Date: Tue Aug 17 12:16:06 2010
New Revision: 211423
URL: http://svn.freebsd.org/changeset/base/211423

Log:
  MFC of 211422, tzdata2010l
  
  - Fix start times of DST for Egypt.
  - clocks were set back one hour at 2010-08-11 00:00:00 local time
    in Gaza and the West Bank.
  
  Obtained from:  ftp://elsie.nci.nih.gov/pub/

Modified:
  stable/8/share/zoneinfo/africa
  stable/8/share/zoneinfo/asia
Directory Properties:
  stable/8/share/zoneinfo/   (props changed)

Modified: stable/8/share/zoneinfo/africa
==============================================================================
--- stable/8/share/zoneinfo/africa	Tue Aug 17 12:10:35 2010	(r211422)
+++ stable/8/share/zoneinfo/africa	Tue Aug 17 12:16:06 2010	(r211423)
@@ -1,5 +1,5 @@
 # 
-# @(#)africa	8.27
+# @(#)africa	8.28
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -311,8 +311,8 @@ Rule	Egypt	2007	only	-	Sep	Thu>=1	23:00s
 
 Rule	Egypt	2008	only	-	Aug	lastThu	23:00s	0	-
 Rule	Egypt	2009	only	-	Aug	20	23:00s	0	-
-Rule	Egypt	2010	only	-	Aug	10	23:00s	0	-
-Rule	Egypt	2010	only	-	Sep	9	0:00s	1:00	S
+Rule	Egypt	2010	only	-	Aug	11	0:00	0	-
+Rule	Egypt	2010	only	-	Sep	10	0:00	1:00	S
 Rule	Egypt	2010	max	-	Sep	lastThu	23:00s	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]

Modified: stable/8/share/zoneinfo/asia
==============================================================================
--- stable/8/share/zoneinfo/asia	Tue Aug 17 12:10:35 2010	(r211422)
+++ stable/8/share/zoneinfo/asia	Tue Aug 17 12:16:06 2010	(r211423)
@@ -1,4 +1,4 @@
-# @(#)asia	8.60
+# @(#)asia	8.61
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -2178,6 +2178,18 @@ Zone	Asia/Karachi	4:28:12 -	LMT	1907
 # "At 12:01am Friday, clocks in Israel and the West Bank will change to
 # 1:01am, while Gaza clocks will change at 12:01am Saturday morning."
 
+# From Steffen Thorsen (2010-08-11):
+# According to several sources, including
+# 
+# http://www.maannews.net/eng/ViewDetails.aspx?ID=306795
+# 
+# the clocks were set back one hour at 2010-08-11 00:00:00 local time in 
+# Gaza and the West Bank.
+# Some more background info:
+# 
+# http://www.timeanddate.com/news/time/westbank-gaza-end-dst-2010.html
+# 
+
 # The rules for Egypt are stolen from the `africa' file.
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule EgyptAsia	1957	only	-	May	10	0:00	1:00	S
@@ -2198,6 +2210,7 @@ Rule Palestine	2008	only	-	Aug	lastFri	2
 Rule Palestine	2009	only	-	Mar	lastFri	0:00	1:00	S
 Rule Palestine	2010	max	-	Mar	lastSat	0:01	1:00	S
 Rule Palestine	2009	max	-	Sep	Fri>=1	2:00	0	-
+Rule Palestine	2010	only	-	Aug	11	0:00	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Gaza	2:17:52	-	LMT	1900 Oct

From owner-svn-src-all@FreeBSD.ORG  Tue Aug 17 12:17:24 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BA23210656A7;
	Tue, 17 Aug 2010 12:17:24 +0000 (UTC)
	(envelope-from gahr@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 954E68FC18;
	Tue, 17 Aug 2010 12:17:24 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7HCHOu3032256;
	Tue, 17 Aug 2010 12:17:24 GMT (envelope-from gahr@svn.freebsd.org)
Received: (from gahr@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7HCHOTp032253;
	Tue, 17 Aug 2010 12:17:24 GMT (envelope-from gahr@svn.freebsd.org)
Message-Id: <201008171217.o7HCHOTp032253@svn.freebsd.org>
From: Pietro Cerutti 
Date: Tue, 17 Aug 2010 12:17: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: r211424 - in head/sys: amd64/amd64 i386/i386
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 17 Aug 2010 12:17:24 -0000

Author: gahr (ports committer)
Date: Tue Aug 17 12:17:24 2010
New Revision: 211424
URL: http://svn.freebsd.org/changeset/base/211424

Log:
  - The iMac9,1 needs the PAT workaround as well
  
  Approved by:	cognet

Modified:
  head/sys/amd64/amd64/pmap.c
  head/sys/i386/i386/pmap.c

Modified: head/sys/amd64/amd64/pmap.c
==============================================================================
--- head/sys/amd64/amd64/pmap.c	Tue Aug 17 12:16:06 2010	(r211423)
+++ head/sys/amd64/amd64/pmap.c	Tue Aug 17 12:17:24 2010	(r211424)
@@ -620,7 +620,8 @@ pmap_init_pat(void)
 		if (sysenv != NULL) {
 			if (strncmp(sysenv, "MacBook5,1", 10) == 0 ||
 			    strncmp(sysenv, "MacBookPro5,5", 13) == 0 ||
-			    strncmp(sysenv, "Macmini3,1", 10) == 0)
+			    strncmp(sysenv, "Macmini3,1", 10) == 0 ||
+			    strncmp(sysenv, "iMac9,1", 7) == 0)
 				pat_works = 0;
 			freeenv(sysenv);
 		}

Modified: head/sys/i386/i386/pmap.c
==============================================================================
--- head/sys/i386/i386/pmap.c	Tue Aug 17 12:16:06 2010	(r211423)
+++ head/sys/i386/i386/pmap.c	Tue Aug 17 12:17:24 2010	(r211424)
@@ -518,7 +518,8 @@ pmap_init_pat(void)
 			if (sysenv != NULL) {
 				if (strncmp(sysenv, "MacBook5,1", 10) == 0 ||
 				    strncmp(sysenv, "MacBookPro5,5", 13) == 0 ||
-				    strncmp(sysenv, "Macmini3,1", 10) == 0)
+				    strncmp(sysenv, "Macmini3,1", 10) == 0 ||
+				    strncmp(sysenv, "iMac9,1", 7) == 0)
 					pat_works = 0;
 				freeenv(sysenv);
 			}

From owner-svn-src-all@FreeBSD.ORG  Tue Aug 17 12:17:32 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CA00010656F3;
	Tue, 17 Aug 2010 12:17:32 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9D1E38FC1D;
	Tue, 17 Aug 2010 12:17:32 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7HCHWcW032297;
	Tue, 17 Aug 2010 12:17:32 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7HCHW6t032294;
	Tue, 17 Aug 2010 12:17:32 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201008171217.o7HCHW6t032294@svn.freebsd.org>
From: Edwin Groothuis 
Date: Tue, 17 Aug 2010 12:17:32 +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: r211425 - stable/7/share/zoneinfo
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 17 Aug 2010 12:17:33 -0000

Author: edwin
Date: Tue Aug 17 12:17:32 2010
New Revision: 211425
URL: http://svn.freebsd.org/changeset/base/211425

Log:
  MFC of 211422, tzdata2010l
  
  - Fix start times of DST for Egypt.
  - clocks were set back one hour at 2010-08-11 00:00:00 local time
    in Gaza and the West Bank.
  
  Obtained from:  ftp://elsie.nci.nih.gov/pub/

Modified:
  stable/7/share/zoneinfo/africa
  stable/7/share/zoneinfo/asia
Directory Properties:
  stable/7/share/zoneinfo/   (props changed)

Modified: stable/7/share/zoneinfo/africa
==============================================================================
--- stable/7/share/zoneinfo/africa	Tue Aug 17 12:17:24 2010	(r211424)
+++ stable/7/share/zoneinfo/africa	Tue Aug 17 12:17:32 2010	(r211425)
@@ -1,5 +1,5 @@
 # 
-# @(#)africa	8.27
+# @(#)africa	8.28
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -311,8 +311,8 @@ Rule	Egypt	2007	only	-	Sep	Thu>=1	23:00s
 
 Rule	Egypt	2008	only	-	Aug	lastThu	23:00s	0	-
 Rule	Egypt	2009	only	-	Aug	20	23:00s	0	-
-Rule	Egypt	2010	only	-	Aug	10	23:00s	0	-
-Rule	Egypt	2010	only	-	Sep	9	0:00s	1:00	S
+Rule	Egypt	2010	only	-	Aug	11	0:00	0	-
+Rule	Egypt	2010	only	-	Sep	10	0:00	1:00	S
 Rule	Egypt	2010	max	-	Sep	lastThu	23:00s	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]

Modified: stable/7/share/zoneinfo/asia
==============================================================================
--- stable/7/share/zoneinfo/asia	Tue Aug 17 12:17:24 2010	(r211424)
+++ stable/7/share/zoneinfo/asia	Tue Aug 17 12:17:32 2010	(r211425)
@@ -1,4 +1,4 @@
-# @(#)asia	8.60
+# @(#)asia	8.61
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -2178,6 +2178,18 @@ Zone	Asia/Karachi	4:28:12 -	LMT	1907
 # "At 12:01am Friday, clocks in Israel and the West Bank will change to
 # 1:01am, while Gaza clocks will change at 12:01am Saturday morning."
 
+# From Steffen Thorsen (2010-08-11):
+# According to several sources, including
+# 
+# http://www.maannews.net/eng/ViewDetails.aspx?ID=306795
+# 
+# the clocks were set back one hour at 2010-08-11 00:00:00 local time in 
+# Gaza and the West Bank.
+# Some more background info:
+# 
+# http://www.timeanddate.com/news/time/westbank-gaza-end-dst-2010.html
+# 
+
 # The rules for Egypt are stolen from the `africa' file.
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule EgyptAsia	1957	only	-	May	10	0:00	1:00	S
@@ -2198,6 +2210,7 @@ Rule Palestine	2008	only	-	Aug	lastFri	2
 Rule Palestine	2009	only	-	Mar	lastFri	0:00	1:00	S
 Rule Palestine	2010	max	-	Mar	lastSat	0:01	1:00	S
 Rule Palestine	2009	max	-	Sep	Fri>=1	2:00	0	-
+Rule Palestine	2010	only	-	Aug	11	0:00	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Gaza	2:17:52	-	LMT	1900 Oct

From owner-svn-src-all@FreeBSD.ORG  Tue Aug 17 12:17:43 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 189D410656C8;
	Tue, 17 Aug 2010 12:17:43 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E0D498FC21;
	Tue, 17 Aug 2010 12:17:42 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7HCHgbi032337;
	Tue, 17 Aug 2010 12:17:42 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7HCHg21032334;
	Tue, 17 Aug 2010 12:17:42 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201008171217.o7HCHg21032334@svn.freebsd.org>
From: Edwin Groothuis 
Date: Tue, 17 Aug 2010 12:17:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org
X-SVN-Group: stable-6
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r211426 - stable/6/share/zoneinfo
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 17 Aug 2010 12:17:43 -0000

Author: edwin
Date: Tue Aug 17 12:17:42 2010
New Revision: 211426
URL: http://svn.freebsd.org/changeset/base/211426

Log:
  MFC of 211422, tzdata2010l
  
  - Fix start times of DST for Egypt.
  - clocks were set back one hour at 2010-08-11 00:00:00 local time
    in Gaza and the West Bank.
  
  Obtained from:  ftp://elsie.nci.nih.gov/pub/

Modified:
  stable/6/share/zoneinfo/africa
  stable/6/share/zoneinfo/asia
Directory Properties:
  stable/6/share/zoneinfo/   (props changed)

Modified: stable/6/share/zoneinfo/africa
==============================================================================
--- stable/6/share/zoneinfo/africa	Tue Aug 17 12:17:32 2010	(r211425)
+++ stable/6/share/zoneinfo/africa	Tue Aug 17 12:17:42 2010	(r211426)
@@ -1,5 +1,5 @@
 # 
-# @(#)africa	8.27
+# @(#)africa	8.28
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -311,8 +311,8 @@ Rule	Egypt	2007	only	-	Sep	Thu>=1	23:00s
 
 Rule	Egypt	2008	only	-	Aug	lastThu	23:00s	0	-
 Rule	Egypt	2009	only	-	Aug	20	23:00s	0	-
-Rule	Egypt	2010	only	-	Aug	10	23:00s	0	-
-Rule	Egypt	2010	only	-	Sep	9	0:00s	1:00	S
+Rule	Egypt	2010	only	-	Aug	11	0:00	0	-
+Rule	Egypt	2010	only	-	Sep	10	0:00	1:00	S
 Rule	Egypt	2010	max	-	Sep	lastThu	23:00s	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]

Modified: stable/6/share/zoneinfo/asia
==============================================================================
--- stable/6/share/zoneinfo/asia	Tue Aug 17 12:17:32 2010	(r211425)
+++ stable/6/share/zoneinfo/asia	Tue Aug 17 12:17:42 2010	(r211426)
@@ -1,4 +1,4 @@
-# @(#)asia	8.60
+# @(#)asia	8.61
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -2178,6 +2178,18 @@ Zone	Asia/Karachi	4:28:12 -	LMT	1907
 # "At 12:01am Friday, clocks in Israel and the West Bank will change to
 # 1:01am, while Gaza clocks will change at 12:01am Saturday morning."
 
+# From Steffen Thorsen (2010-08-11):
+# According to several sources, including
+# 
+# http://www.maannews.net/eng/ViewDetails.aspx?ID=306795
+# 
+# the clocks were set back one hour at 2010-08-11 00:00:00 local time in 
+# Gaza and the West Bank.
+# Some more background info:
+# 
+# http://www.timeanddate.com/news/time/westbank-gaza-end-dst-2010.html
+# 
+
 # The rules for Egypt are stolen from the `africa' file.
 # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
 Rule EgyptAsia	1957	only	-	May	10	0:00	1:00	S
@@ -2198,6 +2210,7 @@ Rule Palestine	2008	only	-	Aug	lastFri	2
 Rule Palestine	2009	only	-	Mar	lastFri	0:00	1:00	S
 Rule Palestine	2010	max	-	Mar	lastSat	0:01	1:00	S
 Rule Palestine	2009	max	-	Sep	Fri>=1	2:00	0	-
+Rule Palestine	2010	only	-	Aug	11	0:00	0	-
 
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Asia/Gaza	2:17:52	-	LMT	1900 Oct

From owner-svn-src-all@FreeBSD.ORG  Tue Aug 17 13:02:08 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 60EA510656A8;
	Tue, 17 Aug 2010 13:02:08 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5026E8FC1D;
	Tue, 17 Aug 2010 13:02:08 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7HD28Or033595;
	Tue, 17 Aug 2010 13:02:08 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7HD282r033593;
	Tue, 17 Aug 2010 13:02:08 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201008171302.o7HD282r033593@svn.freebsd.org>
From: Rui Paulo 
Date: Tue, 17 Aug 2010 13:02: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: r211427 - head/share/mk
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 17 Aug 2010 13:02:08 -0000

Author: rpaulo
Date: Tue Aug 17 13:02:08 2010
New Revision: 211427
URL: http://svn.freebsd.org/changeset/base/211427

Log:
  Make sure any -U CFLAGS are not filtered out when calling mkdep, as
  gnu/usr.bin/cc/libiberty first defines the PREFIX macro, and then
  undefines it again, so mkdep with clang complains.
  
  Submitted by:	Dimitry Andric 
  Reviewed by:	ru

Modified:
  head/share/mk/bsd.dep.mk

Modified: head/share/mk/bsd.dep.mk
==============================================================================
--- head/share/mk/bsd.dep.mk	Tue Aug 17 12:17:42 2010	(r211426)
+++ head/share/mk/bsd.dep.mk	Tue Aug 17 13:02:08 2010	(r211427)
@@ -126,13 +126,13 @@ depend: beforedepend ${DEPENDFILE} after
 # Different types of sources are compiled with slightly different flags.
 # Split up the sources, and filter out headers and non-applicable flags.
 .if ${CC} == "icc"
-MKDEP_CFLAGS=	${CFLAGS:M-X*} ${CFLAGS:M-[BID]*}
-MKDEP_CXXFLAGS=	${CXXFLAGS:M-X*} ${CXXFLAGS:M-[BID]*}
-MKDEP_OBJCFLAGS=${OBJCFLAGS:M-X*} ${OBJCFLAGS:M-[BID]*}
+MKDEP_CFLAGS=	${CFLAGS:M-X*} ${CFLAGS:M-[BIDU]*}
+MKDEP_CXXFLAGS=	${CXXFLAGS:M-X*} ${CXXFLAGS:M-[BIDU]*}
+MKDEP_OBJCFLAGS=${OBJCFLAGS:M-X*} ${OBJCFLAGS:M-[BIDU]*}
 .else
-MKDEP_CFLAGS=	${CFLAGS:M-nostdinc*} ${CFLAGS:M-[BID]*}
-MKDEP_CXXFLAGS=	${CXXFLAGS:M-nostdinc*} ${CXXFLAGS:M-[BID]*}
-MKDEP_OBJCFLAGS=${OBJCFLAGS:M-nostdinc*} ${OBJCFLAGS:M-[BID]*} ${OBJCFLAGS:M-Wno-import*}
+MKDEP_CFLAGS=	${CFLAGS:M-nostdinc*} ${CFLAGS:M-[BIDU]*}
+MKDEP_CXXFLAGS=	${CXXFLAGS:M-nostdinc*} ${CXXFLAGS:M-[BIDU]*}
+MKDEP_OBJCFLAGS=${OBJCFLAGS:M-nostdinc*} ${OBJCFLAGS:M-[BIDU]*} ${OBJCFLAGS:M-Wno-import*}
 .endif
 
 DPSRCS+= ${SRCS}

From owner-svn-src-all@FreeBSD.ORG  Tue Aug 17 15:02:33 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D3BC31065674;
	Tue, 17 Aug 2010 15:02:33 +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 BF9BD8FC14;
	Tue, 17 Aug 2010 15:02:33 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7HF2X9t036162;
	Tue, 17 Aug 2010 15:02:33 GMT (envelope-from jh@svn.freebsd.org)
Received: (from jh@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7HF2XY5036159;
	Tue, 17 Aug 2010 15:02:33 GMT (envelope-from jh@svn.freebsd.org)
Message-Id: <201008171502.o7HF2XY5036159@svn.freebsd.org>
From: Jaakko Heinonen 
Date: Tue, 17 Aug 2010 15:02: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: r211428 - in stable/8: tools/regression/usr.bin
	tools/regression/usr.bin/comm tools/regression/usr.bin/pkill
	usr.bin/comm
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 17 Aug 2010 15:02:34 -0000

Author: jh
Date: Tue Aug 17 15:02:33 2010
New Revision: 211428
URL: http://svn.freebsd.org/changeset/base/211428

Log:
  MFC r200442:
  
  Don't read the newline character to line buffer because lines are passed
  to wcscoll(3). Newline characters could cause incorrect results when
  comparing lines.
  
  Also, if an input line didn't contain a newline character, it was
  omitted from the output. According to my interpretation, SUSv3 requires
  that the newline is always printed.
  
  Add regression tests for the cases.
  
  PR:		bin/140976
  
  MFC r200604:
  
  - Prevent overflowing of the buffer length variable in getline() by
    limiting its maximum value.
  - Exit if reallocf(3) fails in getline(). Failure was silently
    considered as end-of-file.
  
  MFC r204896 by ache:
  
  Rewrite input processing to not exit with error on the first EILSEQ found
  in the input data but fallback to "binary comparison" instead.
  
  POSIX says: "The input files shall be text files", nothing more,
  so the text file with illegal sequence is valid input.
  BTW, GNU sort does not fails on EILSEQ too.
  
  MFC r204928 by ache:
  
  Add SIZE_MAX overflow check

Added:
  stable/8/tools/regression/usr.bin/comm/
     - copied from r200442, head/tools/regression/usr.bin/comm/
Modified:
  stable/8/tools/regression/usr.bin/Makefile
  stable/8/usr.bin/comm/comm.c
Directory Properties:
  stable/8/tools/regression/usr.bin/   (props changed)
  stable/8/tools/regression/usr.bin/pkill/pgrep-_g.t   (props changed)
  stable/8/tools/regression/usr.bin/pkill/pgrep-_s.t   (props changed)
  stable/8/tools/regression/usr.bin/pkill/pkill-_g.t   (props changed)
  stable/8/tools/regression/usr.bin/sed/   (props changed)
  stable/8/usr.bin/comm/   (props changed)

Modified: stable/8/tools/regression/usr.bin/Makefile
==============================================================================
--- stable/8/tools/regression/usr.bin/Makefile	Tue Aug 17 13:02:08 2010	(r211427)
+++ stable/8/tools/regression/usr.bin/Makefile	Tue Aug 17 15:02:33 2010	(r211428)
@@ -1,5 +1,5 @@
 # $FreeBSD$
 
-SUBDIR=	apply calendar file2c join jot m4 printf sed tr uudecode uuencode xargs lastcomm
+SUBDIR=	apply calendar comm file2c join jot m4 printf sed tr uudecode uuencode xargs lastcomm
 
 .include 

Modified: stable/8/usr.bin/comm/comm.c
==============================================================================
--- stable/8/usr.bin/comm/comm.c	Tue Aug 17 13:02:08 2010	(r211427)
+++ stable/8/usr.bin/comm/comm.c	Tue Aug 17 15:02:33 2010	(r211428)
@@ -52,6 +52,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
+#define _WITH_GETLINE
 #include 
 #include 
 #include 
@@ -59,39 +61,31 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#define	MAXLINELEN	(LINE_MAX + 1)
-
-const wchar_t *tabs[] = { L"", L"\t", L"\t\t" };
+int iflag;
+const char *tabs[] = { "", "\t", "\t\t" };
 
 FILE   *file(const char *);
-wchar_t	*getline(wchar_t *, size_t *, FILE *);
-void	show(FILE *, const char *, const wchar_t *, wchar_t *, size_t *);
-int     wcsicoll(const wchar_t *, const wchar_t *);
+wchar_t	*convert(const char *);
+void	show(FILE *, const char *, const char *, char **, size_t *);
 static void	usage(void);
 
 int
 main(int argc, char *argv[])
 {
 	int comp, read1, read2;
-	int ch, flag1, flag2, flag3, iflag;
+	int ch, flag1, flag2, flag3;
 	FILE *fp1, *fp2;
-	const wchar_t *col1, *col2, *col3;
+	const char *col1, *col2, *col3;
 	size_t line1len, line2len;
-	wchar_t *line1, *line2;
-	const wchar_t **p;
-
-	flag1 = flag2 = flag3 = 1;
-	iflag = 0;
-
- 	line1len = MAXLINELEN;
- 	line2len = MAXLINELEN;
- 	line1 = malloc(line1len * sizeof(*line1));
- 	line2 = malloc(line2len * sizeof(*line2));
-	if (line1 == NULL || line2 == NULL)
-		err(1, "malloc");
+	char *line1, *line2;
+	ssize_t n1, n2;
+	wchar_t *tline1, *tline2;
+	const char **p;
 
 	(void) setlocale(LC_ALL, "");
 
+	flag1 = flag2 = flag3 = 1;
+
 	while ((ch = getopt(argc, argv, "123i")) != -1)
 		switch(ch) {
 		case '1':
@@ -129,41 +123,57 @@ main(int argc, char *argv[])
 	if (flag3)
 		col3 = *p;
 
+	line1len = line2len = 0;
+	line1 = line2 = NULL;
+	n1 = n2 = -1;
+
 	for (read1 = read2 = 1;;) {
 		/* read next line, check for EOF */
 		if (read1) {
-			line1 = getline(line1, &line1len, fp1);
-			if (line1 == NULL && ferror(fp1))
+			n1 = getline(&line1, &line1len, fp1);
+			if (n1 < 0 && ferror(fp1))
 				err(1, "%s", argv[0]);
+			if (n1 > 0 && line1[n1 - 1] == '\n')
+				line1[n1 - 1] = '\0';
+
 		}
 		if (read2) {
-			line2 = getline(line2, &line2len, fp2);
-			if (line2 == NULL && ferror(fp2))
+			n2 = getline(&line2, &line2len, fp2);
+			if (n2 < 0 && ferror(fp2))
 				err(1, "%s", argv[1]);
+			if (n2 > 0 && line2[n2 - 1] == '\n')
+				line2[n2 - 1] = '\0';
 		}
 
 		/* if one file done, display the rest of the other file */
-		if (line1 == NULL) {
-			if (line2 != NULL && col2 != NULL)
-				show(fp2, argv[1], col2, line2, &line2len);
+		if (n1 < 0) {
+			if (n2 >= 0 && col2 != NULL)
+				show(fp2, argv[1], col2, &line2, &line2len);
 			break;
 		}
-		if (line2 == NULL) {
-			if (line1 != NULL && col1 != NULL)
-				show(fp1, argv[0], col1, line1, &line1len);
+		if (n2 < 0) {
+			if (n1 >= 0 && col1 != NULL)
+				show(fp1, argv[0], col1, &line1, &line1len);
 			break;
 		}
 
-		/* lines are the same */
-		if(iflag)
-			comp = wcsicoll(line1, line2);
+		tline2 = NULL;
+		if ((tline1 = convert(line1)) != NULL)
+			tline2 = convert(line2);
+		if (tline1 == NULL || tline2 == NULL)
+			comp = strcmp(line1, line2);
 		else
-			comp = wcscoll(line1, line2);
+			comp = wcscoll(tline1, tline2);
+		if (tline1 != NULL)
+			free(tline1);
+		if (tline2 != NULL)
+			free(tline2);
 
+		/* lines are the same */
 		if (!comp) {
 			read1 = read2 = 1;
 			if (col3 != NULL)
-				(void)printf("%ls%ls", col3, line1);
+				(void)printf("%s%s\n", col3, line1);
 			continue;
 		}
 
@@ -172,48 +182,52 @@ main(int argc, char *argv[])
 			read1 = 1;
 			read2 = 0;
 			if (col1 != NULL)
-				(void)printf("%ls%ls", col1, line1);
+				(void)printf("%s%s\n", col1, line1);
 		} else {
 			read1 = 0;
 			read2 = 1;
 			if (col2 != NULL)
-				(void)printf("%ls%ls", col2, line2);
+				(void)printf("%s%s\n", col2, line2);
 		}
 	}
 	exit(0);
 }
 
 wchar_t *
-getline(wchar_t *buf, size_t *buflen, FILE *fp)
+convert(const char *str)
 {
-	size_t bufpos;
-	wint_t ch;
+	size_t n;
+	wchar_t *buf, *p;
 
-	bufpos = 0;
-	do {
-		if ((ch = getwc(fp)) != WEOF) {
-			if (bufpos + 2 >= *buflen) {
-				*buflen = *buflen * 2;
-				buf = reallocf(buf, *buflen * sizeof(*buf));
-				if (buf == NULL)
-					return (NULL);
-			}
-			buf[bufpos++] = ch;
-		}
-	} while (ch != WEOF && ch != '\n');
-	if (bufpos + 1 != *buflen)
-		buf[bufpos] = '\0';
+	if ((n = mbstowcs(NULL, str, 0)) == (size_t)-1)
+		return (NULL);
+	if (SIZE_MAX / sizeof(*buf) < n + 1)
+		errx(1, "conversion buffer length overflow");
+	if ((buf = malloc((n + 1) * sizeof(*buf))) == NULL)
+		err(1, "malloc");
+	if (mbstowcs(buf, str, n + 1) != n)
+		errx(1, "internal mbstowcs() error");
+
+	if (iflag) {
+		for (p = buf; *p != L'\0'; p++)
+			*p = towlower(*p);
+	}
 
-	return (bufpos != 0 || ch == '\n' ? buf : NULL);
+	return (buf);
 }
 
 void
-show(FILE *fp, const char *fn, const wchar_t *offset, wchar_t *buf, size_t *buflen)
+show(FILE *fp, const char *fn, const char *offset, char **bufp, size_t *buflenp)
 {
+	ssize_t n;
 
 	do {
-		(void)printf("%ls%ls", offset, buf);
-	} while ((buf = getline(buf, buflen, fp)) != NULL);
+		(void)printf("%s%s\n", offset, *bufp);
+		if ((n = getline(bufp, buflenp, fp)) < 0)
+			break;
+		if (n > 0 && (*bufp)[n - 1] == '\n')
+			(*bufp)[n - 1] = '\0';
+	} while (1);
 	if (ferror(fp))
 		err(1, "%s", fn);
 }
@@ -237,52 +251,3 @@ usage(void)
 	(void)fprintf(stderr, "usage: comm [-123i] file1 file2\n");
 	exit(1);
 }
-
-static size_t wcsicoll_l1_buflen = 0, wcsicoll_l2_buflen = 0;
-static wchar_t *wcsicoll_l1_buf = NULL, *wcsicoll_l2_buf = NULL;
-
-int
-wcsicoll(const wchar_t *s1, const wchar_t *s2)
-{
-	wchar_t *p;
-	size_t l1, l2;
-	size_t new_l1_buflen, new_l2_buflen;
-
-	l1 = wcslen(s1) + 1;
-	l2 = wcslen(s2) + 1;
-	new_l1_buflen = wcsicoll_l1_buflen;
-	new_l2_buflen = wcsicoll_l2_buflen;
-	while (new_l1_buflen < l1) {
-		if (new_l1_buflen == 0)
-			new_l1_buflen = MAXLINELEN;
-		else
-			new_l1_buflen *= 2;
-	}
-	while (new_l2_buflen < l2) {
-		if (new_l2_buflen == 0)
-			new_l2_buflen = MAXLINELEN;
-		else
-			new_l2_buflen *= 2;
-	}
-	if (new_l1_buflen > wcsicoll_l1_buflen) {
-		wcsicoll_l1_buf = reallocf(wcsicoll_l1_buf, new_l1_buflen * sizeof(*wcsicoll_l1_buf));
-		if (wcsicoll_l1_buf == NULL)
-                	err(1, "reallocf");
-		wcsicoll_l1_buflen = new_l1_buflen;
-	}
-	if (new_l2_buflen > wcsicoll_l2_buflen) {
-		wcsicoll_l2_buf = reallocf(wcsicoll_l2_buf, new_l2_buflen * sizeof(*wcsicoll_l2_buf));
-		if (wcsicoll_l2_buf == NULL)
-                	err(1, "reallocf");
-		wcsicoll_l2_buflen = new_l2_buflen;
-	}
-
-	for (p = wcsicoll_l1_buf; *s1; s1++)
-		*p++ = towlower(*s1);
-	*p = '\0';
-	for (p = wcsicoll_l2_buf; *s2; s2++)
-		*p++ = towlower(*s2);
-	*p = '\0';
-
-	return (wcscoll(wcsicoll_l1_buf, wcsicoll_l2_buf));
-}

From owner-svn-src-all@FreeBSD.ORG  Tue Aug 17 15:07:23 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 702C61065674;
	Tue, 17 Aug 2010 15:07:23 +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 546288FC1A;
	Tue, 17 Aug 2010 15:07:23 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7HF7NdO036281;
	Tue, 17 Aug 2010 15:07:23 GMT (envelope-from jh@svn.freebsd.org)
Received: (from jh@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7HF7NiU036279;
	Tue, 17 Aug 2010 15:07:23 GMT (envelope-from jh@svn.freebsd.org)
Message-Id: <201008171507.o7HF7NiU036279@svn.freebsd.org>
From: Jaakko Heinonen 
Date: Tue, 17 Aug 2010 15:07: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: r211429 - stable/8/usr.bin/uniq
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 17 Aug 2010 15:07:23 -0000

Author: jh
Date: Tue Aug 17 15:07:23 2010
New Revision: 211429
URL: http://svn.freebsd.org/changeset/base/211429

Log:
  MFC r200633:
  
  Sync getline() with comm(1):
  
   - Prevent overflowing of the buffer length variable in getline() by
     limiting its maximum value.
   - Exit if reallocf(3) fails in getline(). Failure was silently
     considered as end-of-file.
  
  MFC r204803 by ache:
  
  1) Rewrite input processing to not exit with error on the first EILSEQ found
  in the input data but fallback to "binary equal" check instead.
  
  POSIX says: "The input file shall be a text file", nothing more,
  so the text file with illegal sequence is valid input.
  BTW, GNU sort does not fails on EILSEQ too.
  
  2) Speedup input processing a bit in complex cases like skipping fields,
  chars or ignore case.
  
  3) Enforce the implied LINE_MAX limit (from POSIX definition of "text file"
  and POSIX uniq(1) description).
  
  MFC r204811 by ache:
  
  Remove vestiges of old %-format which prevents build on amd64
  
  MFC r204876 by ache:
  
  1) Reimplement (differently) unlimited line length restricted in prev.
  commit.
  
  2) Honor missing the very last \n (if absent) on output.
  
  MFC r204927 by ache:
  
  Add SIZE_MAX overflow check

Modified:
  stable/8/usr.bin/uniq/uniq.c
Directory Properties:
  stable/8/usr.bin/uniq/   (props changed)

Modified: stable/8/usr.bin/uniq/uniq.c
==============================================================================
--- stable/8/usr.bin/uniq/uniq.c	Tue Aug 17 15:02:33 2010	(r211428)
+++ stable/8/usr.bin/uniq/uniq.c	Tue Aug 17 15:07:23 2010	(r211429)
@@ -52,6 +52,8 @@ static const char rcsid[] =
 #include 
 #include 
 #include 
+#include 
+#define _WITH_GETLINE
 #include 
 #include 
 #include 
@@ -59,30 +61,26 @@ static const char rcsid[] =
 #include 
 #include 
 
-#define	MAXLINELEN	(LINE_MAX + 1)
-
-int cflag, dflag, uflag;
+int cflag, dflag, uflag, iflag;
 int numchars, numfields, repeats;
 
 FILE	*file(const char *, const char *);
-wchar_t	*getline(wchar_t *, size_t *, FILE *);
-void	 show(FILE *, wchar_t *);
+wchar_t	*convert(const char *);
+int	 inlcmp(const char *, const char *);
+void	 show(FILE *, const char *);
 wchar_t	*skip(wchar_t *);
 void	 obsolete(char *[]);
 static void	 usage(void);
-int      wcsicoll(wchar_t *, wchar_t *);
 
 int
 main (int argc, char *argv[])
 {
-	wchar_t *t1, *t2;
+	wchar_t *tprev, *tthis;
 	FILE *ifp, *ofp;
-	int ch, b1;
-	size_t prevbuflen, thisbuflen;
-	wchar_t *prevline, *thisline;
-	char *p;
+	int ch, comp;
+	size_t prevbuflen, thisbuflen, b1;
+	char *prevline, *thisline, *p;
 	const char *ifn;
-	int iflag = 0, comp;
 
 	(void) setlocale(LC_ALL, "");
 
@@ -137,48 +135,48 @@ main (int argc, char *argv[])
 	if (argc > 1)
 		ofp = file(argv[1], "w");
 
- 	prevbuflen = MAXLINELEN;
- 	thisbuflen = MAXLINELEN;
- 	prevline = malloc(prevbuflen * sizeof(*prevline));
- 	thisline = malloc(thisbuflen * sizeof(*thisline));
-	if (prevline == NULL || thisline == NULL)
-		err(1, "malloc");
+	prevbuflen = thisbuflen = 0;
+	prevline = thisline = NULL;
 
-	if ((prevline = getline(prevline, &prevbuflen, ifp)) == NULL) {
+	if (getline(&prevline, &prevbuflen, ifp) < 0) {
 		if (ferror(ifp))
 			err(1, "%s", ifn);
 		exit(0);
 	}
+	tprev = convert(prevline);
+
 	if (!cflag && uflag && dflag)
 		show(ofp, prevline);
 
-	while ((thisline = getline(thisline, &thisbuflen, ifp)) != NULL) {
-		/* If requested get the chosen fields + character offsets. */
-		if (numfields || numchars) {
-			t1 = skip(thisline);
-			t2 = skip(prevline);
-		} else {
-			t1 = thisline;
-			t2 = prevline;
-		}
-
-		/* If different, print; set previous to new value. */
-		if (iflag)
-			comp = wcsicoll(t1, t2);
+	tthis = NULL;
+	while (getline(&thisline, &thisbuflen, ifp) >= 0) {
+		if (tthis != NULL)
+			free(tthis);
+		tthis = convert(thisline);
+
+		if (tthis == NULL && tprev == NULL)
+			comp = inlcmp(thisline, prevline);
+		else if (tthis == NULL || tprev == NULL)
+			comp = 1;
 		else
-			comp = wcscoll(t1, t2);
+			comp = wcscoll(tthis, tprev);
 
 		if (comp) {
+			/* If different, print; set previous to new value. */
 			if (cflag || !dflag || !uflag)
 				show(ofp, prevline);
-			t1 = prevline;
+			p = prevline;
 			b1 = prevbuflen;
 			prevline = thisline;
 			prevbuflen = thisbuflen;
+			if (tprev != NULL)
+				free(tprev);
+			tprev = tthis;
 			if (!cflag && uflag && dflag)
 				show(ofp, prevline);
-			thisline = t1;
+			thisline = p;
 			thisbuflen = b1;
+			tthis = NULL;
 			repeats = 0;
 		} else
 			++repeats;
@@ -191,25 +189,55 @@ main (int argc, char *argv[])
 }
 
 wchar_t *
-getline(wchar_t *buf, size_t *buflen, FILE *fp)
+convert(const char *str)
 {
-	size_t bufpos;
-	wint_t ch;
+	size_t n;
+	wchar_t *buf, *ret, *p;
 
-	bufpos = 0;
-	while ((ch = getwc(fp)) != WEOF && ch != '\n') {
-		if (bufpos + 2 >= *buflen) {
-			*buflen = *buflen * 2;
-			buf = reallocf(buf, *buflen * sizeof(*buf));
-			if (buf == NULL)
-				return (NULL);
-		}
-		buf[bufpos++] = ch;
+	if ((n = mbstowcs(NULL, str, 0)) == (size_t)-1)
+		return (NULL);
+	if (SIZE_MAX / sizeof(*buf) < n + 1)
+		errx(1, "conversion buffer length overflow");
+	if ((buf = malloc((n + 1) * sizeof(*buf))) == NULL)
+		err(1, "malloc");
+	if (mbstowcs(buf, str, n + 1) != n)
+		errx(1, "internal mbstowcs() error");
+	/* The last line may not end with \n. */
+	if (n > 0 && buf[n - 1] == L'\n')
+		buf[n - 1] = L'\0';
+
+	/* If requested get the chosen fields + character offsets. */
+	if (numfields || numchars) {
+		if ((ret = wcsdup(skip(buf))) == NULL)
+			err(1, "wcsdup");
+		free(buf);
+	} else
+		ret = buf;
+
+	if (iflag) {
+		for (p = ret; *p != L'\0'; p++)
+			*p = towlower(*p);
 	}
-	if (bufpos + 1 != *buflen)
-		buf[bufpos] = '\0';
 
-	return (bufpos != 0 || ch == '\n' ? buf : NULL);
+	return (ret);
+}
+
+int
+inlcmp(const char *s1, const char *s2)
+{
+	int c1, c2;
+
+	while (*s1 == *s2++)
+		if (*s1++ == '\0')
+			return (0);
+	c1 = (unsigned char)*s1;
+	c2 = (unsigned char)*(s2 - 1);
+	/* The last line may not end with \n. */
+	if (c1 == '\n')
+		c1 = '\0';
+	if (c2 == '\n')
+		c2 = '\0';
+	return (c1 - c2);
 }
 
 /*
@@ -218,13 +246,13 @@ getline(wchar_t *buf, size_t *buflen, FI
  *	of the line.
  */
 void
-show(FILE *ofp, wchar_t *str)
+show(FILE *ofp, const char *str)
 {
 
 	if (cflag)
-		(void)fprintf(ofp, "%4d %ls\n", repeats + 1, str);
+		(void)fprintf(ofp, "%4d %s", repeats + 1, str);
 	if ((dflag && repeats) || (uflag && !repeats))
-		(void)fprintf(ofp, "%ls\n", str);
+		(void)fprintf(ofp, "%s", str);
 }
 
 wchar_t *
@@ -232,13 +260,14 @@ skip(wchar_t *str)
 {
 	int nchars, nfields;
 
-	for (nfields = 0; *str != '\0' && nfields++ != numfields; ) {
+	for (nfields = 0; *str != L'\0' && nfields++ != numfields; ) {
 		while (iswblank(*str))
 			str++;
-		while (*str != '\0' && !iswblank(*str))
+		while (*str != L'\0' && !iswblank(*str))
 			str++;
 	}
-	for (nchars = numchars; nchars-- && *str; ++str);
+	for (nchars = numchars; nchars-- && *str != L'\0'; ++str)
+		;
 	return(str);
 }
 
@@ -288,52 +317,3 @@ usage(void)
 "usage: uniq [-c | -d | -u] [-i] [-f fields] [-s chars] [input [output]]\n");
 	exit(1);
 }
-
-static size_t wcsicoll_l1_buflen = 0, wcsicoll_l2_buflen = 0;
-static wchar_t *wcsicoll_l1_buf = NULL, *wcsicoll_l2_buf = NULL;
-
-int
-wcsicoll(wchar_t *s1, wchar_t *s2)
-{
-	wchar_t *p;
-	size_t l1, l2;
-	size_t new_l1_buflen, new_l2_buflen;
-
-	l1 = wcslen(s1) + 1;
-	l2 = wcslen(s2) + 1;
-	new_l1_buflen = wcsicoll_l1_buflen;
-	new_l2_buflen = wcsicoll_l2_buflen;
-	while (new_l1_buflen < l1) {
-		if (new_l1_buflen == 0)
-			new_l1_buflen = MAXLINELEN;
-		else
-			new_l1_buflen *= 2;
-	}
-	while (new_l2_buflen < l2) {
-		if (new_l2_buflen == 0)
-			new_l2_buflen = MAXLINELEN;
-		else
-			new_l2_buflen *= 2;
-	}
-	if (new_l1_buflen > wcsicoll_l1_buflen) {
-		wcsicoll_l1_buf = reallocf(wcsicoll_l1_buf, new_l1_buflen * sizeof(*wcsicoll_l1_buf));
-		if (wcsicoll_l1_buf == NULL)
-                	err(1, "reallocf");
-		wcsicoll_l1_buflen = new_l1_buflen;
-	}
-	if (new_l2_buflen > wcsicoll_l2_buflen) {
-		wcsicoll_l2_buf = reallocf(wcsicoll_l2_buf, new_l2_buflen * sizeof(*wcsicoll_l2_buf));
-		if (wcsicoll_l2_buf == NULL)
-                	err(1, "reallocf");
-		wcsicoll_l2_buflen = new_l2_buflen;
-	}
-
-	for (p = wcsicoll_l1_buf; *s1; s1++)
-		*p++ = towlower(*s1);
-	*p = '\0';
-	for (p = wcsicoll_l2_buf; *s2; s2++)
-		*p++ = towlower(*s2);
-	*p = '\0';
-
-	return (wcscoll(wcsicoll_l1_buf, wcsicoll_l2_buf));
-}

From owner-svn-src-all@FreeBSD.ORG  Tue Aug 17 15:44:52 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E9C54106564A;
	Tue, 17 Aug 2010 15:44:52 +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 D7CA78FC1A;
	Tue, 17 Aug 2010 15:44:52 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7HFiqe2037056;
	Tue, 17 Aug 2010 15:44:52 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7HFiqfF037045;
	Tue, 17 Aug 2010 15:44:52 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201008171544.o7HFiqfF037045@svn.freebsd.org>
From: John Baldwin 
Date: Tue, 17 Aug 2010 15:44: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: r211430 - in head/sys/dev: acpica 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: Tue, 17 Aug 2010 15:44:53 -0000

Author: jhb
Date: Tue Aug 17 15:44:52 2010
New Revision: 211430
URL: http://svn.freebsd.org/changeset/base/211430

Log:
  Add a new method to the PCI bridge interface, PCIB_POWER_FOR_SLEEP().  This
  method is used by the PCI bus driver to query the power management system
  to determine the proper device state to be used for a device during suspend
  and resume.  For the ACPI PCI bridge drivers this calls
  acpi_device_pwr_for_sleep().  This removes ACPI-specific knowledge from
  the PCI and PCI-PCI bridge drivers.
  
  Reviewed by:	jkim

Modified:
  head/sys/dev/acpica/acpi.c
  head/sys/dev/acpica/acpi_pcib.c
  head/sys/dev/acpica/acpi_pcib_acpi.c
  head/sys/dev/acpica/acpi_pcib_pci.c
  head/sys/dev/acpica/acpi_pcibvar.h
  head/sys/dev/acpica/acpivar.h
  head/sys/dev/pci/pci.c
  head/sys/dev/pci/pci_pci.c
  head/sys/dev/pci/pci_private.h
  head/sys/dev/pci/pcib_if.m

Modified: head/sys/dev/acpica/acpi.c
==============================================================================
--- head/sys/dev/acpica/acpi.c	Tue Aug 17 15:07:23 2010	(r211429)
+++ head/sys/dev/acpica/acpi.c	Tue Aug 17 15:44:52 2010	(r211430)
@@ -129,8 +129,6 @@ static char	*acpi_device_id_probe(device
 static ACPI_STATUS acpi_device_eval_obj(device_t bus, device_t dev,
 		    ACPI_STRING pathname, ACPI_OBJECT_LIST *parameters,
 		    ACPI_BUFFER *ret);
-static int	acpi_device_pwr_for_sleep(device_t bus, device_t dev,
-		    int *dstate);
 static ACPI_STATUS acpi_device_scan_cb(ACPI_HANDLE h, UINT32 level,
 		    void *context, void **retval);
 static ACPI_STATUS acpi_device_scan_children(device_t bus, device_t dev,
@@ -1415,7 +1413,7 @@ acpi_device_eval_obj(device_t bus, devic
     return (AcpiEvaluateObject(h, pathname, parameters, ret));
 }
 
-static int
+int
 acpi_device_pwr_for_sleep(device_t bus, device_t dev, int *dstate)
 {
     struct acpi_softc *sc;

Modified: head/sys/dev/acpica/acpi_pcib.c
==============================================================================
--- head/sys/dev/acpica/acpi_pcib.c	Tue Aug 17 15:07:23 2010	(r211429)
+++ head/sys/dev/acpica/acpi_pcib.c	Tue Aug 17 15:44:52 2010	(r211430)
@@ -275,3 +275,14 @@ out:
 
     return_VALUE (interrupt);
 }
+
+int
+acpi_pcib_power_for_sleep(device_t pcib, device_t dev, int *pstate)
+{
+    device_t acpi_dev;
+
+    acpi_dev = devclass_get_device(devclass_find("acpi"), 0);
+    acpi_device_pwr_for_sleep(acpi_dev, dev, pstate);
+    return (0);
+}
+

Modified: head/sys/dev/acpica/acpi_pcib_acpi.c
==============================================================================
--- head/sys/dev/acpica/acpi_pcib_acpi.c	Tue Aug 17 15:07:23 2010	(r211429)
+++ head/sys/dev/acpica/acpi_pcib_acpi.c	Tue Aug 17 15:44:52 2010	(r211430)
@@ -116,6 +116,7 @@ static device_method_t acpi_pcib_acpi_me
     DEVMETHOD(pcib_alloc_msix,		acpi_pcib_alloc_msix),
     DEVMETHOD(pcib_release_msix,	pcib_release_msix),
     DEVMETHOD(pcib_map_msi,		acpi_pcib_map_msi),
+    DEVMETHOD(pcib_power_for_sleep,	acpi_pcib_power_for_sleep),
 
     {0, 0}
 };

Modified: head/sys/dev/acpica/acpi_pcib_pci.c
==============================================================================
--- head/sys/dev/acpica/acpi_pcib_pci.c	Tue Aug 17 15:07:23 2010	(r211429)
+++ head/sys/dev/acpica/acpi_pcib_pci.c	Tue Aug 17 15:44:52 2010	(r211430)
@@ -80,6 +80,7 @@ static device_method_t acpi_pcib_pci_met
 
     /* pcib interface */
     DEVMETHOD(pcib_route_interrupt,	acpi_pcib_pci_route_interrupt),
+    DEVMETHOD(pcib_power_for_sleep,	acpi_pcib_power_for_sleep),
 
     {0, 0}
 };

Modified: head/sys/dev/acpica/acpi_pcibvar.h
==============================================================================
--- head/sys/dev/acpica/acpi_pcibvar.h	Tue Aug 17 15:07:23 2010	(r211429)
+++ head/sys/dev/acpica/acpi_pcibvar.h	Tue Aug 17 15:44:52 2010	(r211430)
@@ -38,6 +38,8 @@ int	acpi_pci_link_route_interrupt(device
 int	acpi_pcib_attach(device_t bus, ACPI_BUFFER *prt, int busno);
 int	acpi_pcib_route_interrupt(device_t pcib, device_t dev, int pin,
     ACPI_BUFFER *prtbuf);
+int	acpi_pcib_power_for_sleep(device_t pcib, device_t dev,
+    int *pstate);
 
 #endif /* _KERNEL */
 

Modified: head/sys/dev/acpica/acpivar.h
==============================================================================
--- head/sys/dev/acpica/acpivar.h	Tue Aug 17 15:07:23 2010	(r211429)
+++ head/sys/dev/acpica/acpivar.h	Tue Aug 17 15:44:52 2010	(r211430)
@@ -393,6 +393,8 @@ EVENTHANDLER_DECLARE(acpi_wakeup_event, 
 /* Device power control. */
 ACPI_STATUS	acpi_pwr_wake_enable(ACPI_HANDLE consumer, int enable);
 ACPI_STATUS	acpi_pwr_switch_consumer(ACPI_HANDLE consumer, int state);
+int		acpi_device_pwr_for_sleep(device_t bus, device_t dev,
+		    int *dstate);
 
 /* Misc. */
 static __inline struct acpi_softc *

Modified: head/sys/dev/pci/pci.c
==============================================================================
--- head/sys/dev/pci/pci.c	Tue Aug 17 15:07:23 2010	(r211429)
+++ head/sys/dev/pci/pci.c	Tue Aug 17 15:44:52 2010	(r211430)
@@ -69,13 +69,6 @@ __FBSDID("$FreeBSD$");
 #include "pcib_if.h"
 #include "pci_if.h"
 
-#ifdef __HAVE_ACPI
-#include 
-#include "acpi_if.h"
-#else
-#define	ACPI_PWR_FOR_SLEEP(x, y, z)
-#endif
-
 static pci_addr_t	pci_mapbase(uint64_t mapreg);
 static const char	*pci_maptype(uint64_t mapreg);
 static int		pci_mapsize(uint64_t testval);
@@ -2914,16 +2907,13 @@ int
 pci_suspend(device_t dev)
 {
 	int dstate, error, i, numdevs;
-	device_t acpi_dev, child, *devlist;
+	device_t child, *devlist, pcib;
 	struct pci_devinfo *dinfo;
 
 	/*
 	 * Save the PCI configuration space for each child and set the
 	 * device in the appropriate power state for this sleep state.
 	 */
-	acpi_dev = NULL;
-	if (pci_do_power_resume)
-		acpi_dev = devclass_get_device(devclass_find("acpi"), 0);
 	if ((error = device_get_children(dev, &devlist, &numdevs)) != 0)
 		return (error);
 	for (i = 0; i < numdevs; i++) {
@@ -2940,22 +2930,23 @@ pci_suspend(device_t dev)
 	}
 
 	/*
-	 * Always set the device to D3.  If ACPI suggests a different
-	 * power state, use it instead.  If ACPI is not present, the
-	 * firmware is responsible for managing device power.  Skip
-	 * children who aren't attached since they are powered down
-	 * separately.  Only manage type 0 devices for now.
+	 * Always set the device to D3.  If the firmware suggests a
+	 * different power state, use it instead.  If power management
+	 * is not present, the firmware is responsible for managing
+	 * device power.  Skip children who aren't attached since they
+	 * are powered down separately.  Only manage type 0 devices
+	 * for now.
 	 */
-	for (i = 0; acpi_dev && i < numdevs; i++) {
+	pcib = device_get_parent(dev);
+	for (i = 0; pci_do_power_resume && i < numdevs; i++) {
 		child = devlist[i];
 		dinfo = (struct pci_devinfo *) device_get_ivars(child);
+		dstate = PCI_POWERSTATE_D3;
 		if (device_is_attached(child) &&
 		    (dinfo->cfg.hdrtype & PCIM_HDRTYPE) ==
-		    PCIM_HDRTYPE_NORMAL) {
-			dstate = PCI_POWERSTATE_D3;
-			ACPI_PWR_FOR_SLEEP(acpi_dev, child, &dstate);
+		    PCIM_HDRTYPE_NORMAL &&
+		    PCIB_POWER_FOR_SLEEP(pcib, dev, &dstate) == 0)
 			pci_set_powerstate(child, dstate);
-		}
 	}
 	free(devlist, M_TEMP);
 	return (0);
@@ -2965,31 +2956,29 @@ int
 pci_resume(device_t dev)
 {
 	int i, numdevs, error;
-	device_t acpi_dev, child, *devlist;
+	device_t child, *devlist, pcib;
 	struct pci_devinfo *dinfo;
 
 	/*
 	 * Set each child to D0 and restore its PCI configuration space.
 	 */
-	acpi_dev = NULL;
-	if (pci_do_power_resume)
-		acpi_dev = devclass_get_device(devclass_find("acpi"), 0);
 	if ((error = device_get_children(dev, &devlist, &numdevs)) != 0)
 		return (error);
+	pcib = device_get_parent(dev);
 	for (i = 0; i < numdevs; i++) {
 		/*
-		 * Notify ACPI we're going to D0 but ignore the result.  If
-		 * ACPI is not present, the firmware is responsible for
-		 * managing device power.  Only manage type 0 devices for now.
+		 * Notify power managment we're going to D0 but ignore
+		 * the result.  If power management is not present,
+		 * the firmware is responsible for managing device
+		 * power.  Only manage type 0 devices for now.
 		 */
 		child = devlist[i];
 		dinfo = (struct pci_devinfo *) device_get_ivars(child);
-		if (acpi_dev && device_is_attached(child) &&
+		if (device_is_attached(child) &&
 		    (dinfo->cfg.hdrtype & PCIM_HDRTYPE) ==
-		    PCIM_HDRTYPE_NORMAL) {
-			ACPI_PWR_FOR_SLEEP(acpi_dev, child, NULL);
+		    PCIM_HDRTYPE_NORMAL &&
+		    PCIB_POWER_FOR_SLEEP(pcib, dev, NULL) == 0)
 			pci_set_powerstate(child, PCI_POWERSTATE_D0);
-		}
 
 		/* Now the device is powered up, restore its config space. */
 		pci_cfg_restore(child, dinfo);

Modified: head/sys/dev/pci/pci_pci.c
==============================================================================
--- head/sys/dev/pci/pci_pci.c	Tue Aug 17 15:07:23 2010	(r211429)
+++ head/sys/dev/pci/pci_pci.c	Tue Aug 17 15:44:52 2010	(r211430)
@@ -48,22 +48,16 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 #include 
 
 #include "pcib_if.h"
 
-#ifdef __HAVE_ACPI
-#include 
-#include "acpi_if.h"
-#else
-#define	ACPI_PWR_FOR_SLEEP(x, y, z)
-#endif
-
-extern int		pci_do_power_resume;
-
 static int		pcib_probe(device_t dev);
 static int		pcib_suspend(device_t dev);
 static int		pcib_resume(device_t dev);
+static int		pcib_power_for_sleep(device_t pcib, device_t dev,
+			    int *pstate);
 
 static device_method_t pcib_methods[] = {
     /* Device interface */
@@ -95,6 +89,7 @@ static device_method_t pcib_methods[] = 
     DEVMETHOD(pcib_alloc_msix,		pcib_alloc_msix),
     DEVMETHOD(pcib_release_msix,	pcib_release_msix),
     DEVMETHOD(pcib_map_msi,		pcib_map_msi),
+    DEVMETHOD(pcib_power_for_sleep,	pcib_power_for_sleep),
 
     { 0, 0 }
 };
@@ -447,18 +442,16 @@ pcib_attach(device_t dev)
 int
 pcib_suspend(device_t dev)
 {
-	device_t	acpi_dev;
+	device_t	pcib;
 	int		dstate, error;
 
 	pcib_cfg_save(device_get_softc(dev));
 	error = bus_generic_suspend(dev);
 	if (error == 0 && pci_do_power_resume) {
-		acpi_dev = devclass_get_device(devclass_find("acpi"), 0);
-		if (acpi_dev != NULL) {
-			dstate = PCI_POWERSTATE_D3;
-			ACPI_PWR_FOR_SLEEP(acpi_dev, dev, &dstate);
+		dstate = PCI_POWERSTATE_D3;
+		pcib = device_get_parent(device_get_parent(dev));
+		if (PCIB_POWER_FOR_SLEEP(pcib, dev, &dstate) == 0)
 			pci_set_powerstate(dev, dstate);
-		}
 	}
 	return (error);
 }
@@ -466,14 +459,12 @@ pcib_suspend(device_t dev)
 int
 pcib_resume(device_t dev)
 {
-	device_t	acpi_dev;
+	device_t	pcib;
 
 	if (pci_do_power_resume) {
-		acpi_dev = devclass_get_device(devclass_find("acpi"), 0);
-		if (acpi_dev != NULL) {
-			ACPI_PWR_FOR_SLEEP(acpi_dev, dev, NULL);
+		pcib = device_get_parent(device_get_parent(dev));
+		if (PCIB_POWER_FOR_SLEEP(pcib, dev, NULL) == 0)
 			pci_set_powerstate(dev, PCI_POWERSTATE_D0);
-		}
 	}
 	pcib_cfg_restore(device_get_softc(dev));
 	return (bus_generic_resume(dev));
@@ -790,6 +781,16 @@ pcib_map_msi(device_t pcib, device_t dev
 	return (0);
 }
 
+/* Pass request for device power state up to parent bridge. */
+int
+pcib_power_for_sleep(device_t pcib, device_t dev, int *pstate)
+{
+	device_t bus;
+
+	bus = device_get_parent(pcib);
+	return (PCIB_POWER_FOR_SLEEP(bus, dev, pstate));
+}
+
 /*
  * Try to read the bus number of a host-PCI bridge using appropriate config
  * registers.

Modified: head/sys/dev/pci/pci_private.h
==============================================================================
--- head/sys/dev/pci/pci_private.h	Tue Aug 17 15:07:23 2010	(r211429)
+++ head/sys/dev/pci/pci_private.h	Tue Aug 17 15:44:52 2010	(r211430)
@@ -38,6 +38,8 @@
  */
 DECLARE_CLASS(pci_driver);
 
+extern int 	pci_do_power_resume;
+
 void		pci_add_children(device_t dev, int domain, int busno,
 		    size_t dinfo_size);
 void		pci_add_child(device_t bus, struct pci_devinfo *dinfo);

Modified: head/sys/dev/pci/pcib_if.m
==============================================================================
--- head/sys/dev/pci/pcib_if.m	Tue Aug 17 15:07:23 2010	(r211429)
+++ head/sys/dev/pci/pcib_if.m	Tue Aug 17 15:44:52 2010	(r211430)
@@ -144,3 +144,13 @@ METHOD int map_msi {
 	uint64_t	*addr;
 	uint32_t	*data;
 };
+
+#
+# Return the device power state to be used during a system sleep state
+# transition such as suspend and resume.
+#
+METHOD int power_for_sleep {
+	device_t	pcib;
+	device_t	dev;
+	int		*pstate;
+};

From owner-svn-src-all@FreeBSD.ORG  Tue Aug 17 16:25:44 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D6C4F10656A7;
	Tue, 17 Aug 2010 16:25:44 +0000 (UTC) (envelope-from uqs@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C5C5A8FC0C;
	Tue, 17 Aug 2010 16:25:44 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7HGPihb038028;
	Tue, 17 Aug 2010 16:25:44 GMT (envelope-from uqs@svn.freebsd.org)
Received: (from uqs@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7HGPi9L038025;
	Tue, 17 Aug 2010 16:25:44 GMT (envelope-from uqs@svn.freebsd.org)
Message-Id: <201008171625.o7HGPi9L038025@svn.freebsd.org>
From: Ulrich Spoerlein 
Date: Tue, 17 Aug 2010 16:25: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: r211431 - stable/8/games/grdc
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 17 Aug 2010 16:25:45 -0000

Author: uqs
Date: Tue Aug 17 16:25:44 2010
New Revision: 211431
URL: http://svn.freebsd.org/changeset/base/211431

Log:
  MFC r203920,210755,210809,210827:
  
  - WARNS?=6 cleanup
  - fix timekeeping for user-supplied value n
  - de-obfuscate the timekeeping of now/delay

Modified:
  stable/8/games/grdc/Makefile
  stable/8/games/grdc/grdc.c
Directory Properties:
  stable/8/games/grdc/   (props changed)

Modified: stable/8/games/grdc/Makefile
==============================================================================
--- stable/8/games/grdc/Makefile	Tue Aug 17 15:44:52 2010	(r211430)
+++ stable/8/games/grdc/Makefile	Tue Aug 17 16:25:44 2010	(r211431)
@@ -1,9 +1,9 @@
 # $FreeBSD$
 
-PROG=   grdc
-WARNS?=	2
-MAN=   grdc.6
-DPADD=  ${LIBNCURSES}
-LDADD=  -lncurses
+PROG=	grdc
+MAN=	grdc.6
+WARNS?=	6
+DPADD=	${LIBNCURSES}
+LDADD=	-lncurses
 
 .include 

Modified: stable/8/games/grdc/grdc.c
==============================================================================
--- stable/8/games/grdc/grdc.c	Tue Aug 17 15:44:52 2010	(r211430)
+++ stable/8/games/grdc/grdc.c	Tue Aug 17 16:25:44 2010	(r211431)
@@ -15,21 +15,18 @@
  */
 
 #include 
-#include 
-#include 
 #include 
+#include 
 #include 
-#ifndef NONPOSIX
+#include 
 #include 
-#endif
 
 #define YBASE	10
 #define XBASE	10
 #define XLENGTH 58
 #define YDEPTH  7
 
-/* it won't be */
-time_t now; /* yeah! */
+struct timespec now;
 struct tm *tm;
 
 short disp[11] = {
@@ -48,24 +45,23 @@ void movto(int, int);
 void sighndl(int);
 void usage(void);
 
-void sighndl(signo)
-int signo;
+void
+sighndl(int signo)
 {
 	sigtermed=signo;
 }
 
 int
-main(argc, argv)
-int argc;
-char **argv;
-{
-struct timespec ts;
-long t, a;
-int i, j, s, k;
-int n;
-int ch;
-int scrol;
-int t12;
+main(int argc, char *argv[])
+{
+	struct timespec delay;
+	time_t prev_sec;
+	long t, a;
+	int i, j, s, k;
+	int n;
+	int ch;
+	int scrol;
+	int t12;
 
 	t12 = scrol = 0;
 
@@ -90,9 +86,14 @@ int t12;
 		/* NOTREACHED */
 	}
 
-	if (argc > 0)
-		n = atoi(*argv);
-	else
+	if (argc > 0) {
+		n = atoi(*argv) + 1;
+		if (n < 1) {
+			warnx("number of seconds is out of range");
+			usage();
+			/* NOTREACHED */
+		}
+	} else
 		n = 0;
 
 	initscr();
@@ -137,10 +138,11 @@ int t12;
 
 		attrset(COLOR_PAIR(2));
 	}
-	time(&now);
+	clock_gettime(CLOCK_REALTIME_FAST, &now);
+	prev_sec = now.tv_sec;
 	do {
 		mask = 0;
-		tm = localtime(&now);
+		tm = localtime(&now.tv_sec);
 		set(tm->tm_sec%10, 0);
 		set(tm->tm_sec/10, 4);
 		set(tm->tm_min%10, 10);
@@ -194,19 +196,20 @@ int t12;
 		}
 		movto(6, 0);
 		refresh();
-		clock_gettime(CLOCK_REALTIME_FAST, &ts);
-		if (ts.tv_sec == now) {
-			if (ts.tv_nsec > 0) {
-				ts.tv_sec = 0;
-				ts.tv_nsec = 1000000000 - ts.tv_nsec;
+		clock_gettime(CLOCK_REALTIME_FAST, &now);
+		if (now.tv_sec == prev_sec) {
+			if (delay.tv_nsec > 0) {
+				delay.tv_sec = 0;
+				delay.tv_nsec = 1000000000 - now.tv_nsec;
 			} else {
-				ts.tv_sec = 1;
-				ts.tv_nsec = 0;
+				delay.tv_sec = 1;
+				delay.tv_nsec = 0;
 			}
-			nanosleep(&ts, NULL);
-			now = ts.tv_sec + 1;
-		} else
-			now = ts.tv_sec;
+			nanosleep(&delay, NULL);
+			clock_gettime(CLOCK_REALTIME_FAST, &now);
+		}
+		n -= now.tv_sec - prev_sec;
+		prev_sec = now.tv_sec;
 		if (sigtermed) {
 			standend();
 			clear();
@@ -214,7 +217,7 @@ int t12;
 			endwin();
 			errx(1, "terminated by signal %d", (int)sigtermed);
 		}
-	} while(--n);
+	} while (n);
 	standend();
 	clear();
 	refresh();
@@ -225,7 +228,7 @@ int t12;
 void
 set(int t, int n)
 {
-int i, m;
+	int i, m;
 
 	m = 7<
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CFC2B1065737;
	Tue, 17 Aug 2010 16:27:13 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id BF7678FC20;
	Tue, 17 Aug 2010 16:27:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7HGRD7B038106;
	Tue, 17 Aug 2010 16:27:13 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7HGRDC0038104;
	Tue, 17 Aug 2010 16:27:13 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201008171627.o7HGRDC0038104@svn.freebsd.org>
From: Adrian Chadd 
Date: Tue, 17 Aug 2010 16:27: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: r211432 - head/sys/dev/flash
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 17 Aug 2010 16:27:13 -0000

Author: adrian
Date: Tue Aug 17 16:27:13 2010
New Revision: 211432
URL: http://svn.freebsd.org/changeset/base/211432

Log:
  Add s25sl064a, an 8mb SPI flash part.

Modified:
  head/sys/dev/flash/mx25l.c

Modified: head/sys/dev/flash/mx25l.c
==============================================================================
--- head/sys/dev/flash/mx25l.c	Tue Aug 17 16:25:44 2010	(r211431)
+++ head/sys/dev/flash/mx25l.c	Tue Aug 17 16:27:13 2010	(r211432)
@@ -93,6 +93,7 @@ struct mx25l_flash_ident flash_devices[]
 	{ "mx25ll64",  0xc2, 0x2017, 64 * 1024, 128, FL_NONE },
 	{ "mx25ll128", 0xc2, 0x2018, 64 * 1024, 256, FL_ERASE_4K | FL_ERASE_32K },
 	{ "s25fl128",  0x01, 0x2018, 64 * 1024, 256, FL_NONE },
+	{ "s25sl064a", 0x01, 0x0216, 64 * 1024, 128, FL_NONE },
 };
 
 static uint8_t

From owner-svn-src-all@FreeBSD.ORG  Tue Aug 17 16:41:17 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3AE701065673;
	Tue, 17 Aug 2010 16:41:17 +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 DA9348FC08;
	Tue, 17 Aug 2010 16:41:16 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7HGfGLU038438;
	Tue, 17 Aug 2010 16:41:16 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7HGfGY4038433;
	Tue, 17 Aug 2010 16:41:16 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201008171641.o7HGfGY4038433@svn.freebsd.org>
From: John Baldwin 
Date: Tue, 17 Aug 2010 16:41: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: r211433 - 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: Tue, 17 Aug 2010 16:41:17 -0000

Author: jhb
Date: Tue Aug 17 16:41:16 2010
New Revision: 211433
URL: http://svn.freebsd.org/changeset/base/211433

Log:
  Ensure a minimum "slop" of 10 extra pcb structures when providing a
  memory size estimate to userland for pcb list sysctls.  The previous
  behavior of a "slop" of n/8 does not work well for small values of n
  (e.g. no slop at all if you have less than 8 open UDP connections).
  
  Reviewed by:	bz
  MFC after:	1 week

Modified:
  head/sys/netinet/ip_divert.c
  head/sys/netinet/raw_ip.c
  head/sys/netinet/tcp_subr.c
  head/sys/netinet/udp_usrreq.c

Modified: head/sys/netinet/ip_divert.c
==============================================================================
--- head/sys/netinet/ip_divert.c	Tue Aug 17 16:27:13 2010	(r211432)
+++ head/sys/netinet/ip_divert.c	Tue Aug 17 16:41:16 2010	(r211433)
@@ -592,8 +592,8 @@ div_pcblist(SYSCTL_HANDLER_ARGS)
 	 */
 	if (req->oldptr == 0) {
 		n = V_divcbinfo.ipi_count;
-		req->oldidx = 2 * (sizeof xig)
-			+ (n + n/8) * sizeof(struct xinpcb);
+		n += imax(n / 8, 10);
+		req->oldidx = 2 * (sizeof xig) + n * sizeof(struct xinpcb);
 		return 0;
 	}
 

Modified: head/sys/netinet/raw_ip.c
==============================================================================
--- head/sys/netinet/raw_ip.c	Tue Aug 17 16:27:13 2010	(r211432)
+++ head/sys/netinet/raw_ip.c	Tue Aug 17 16:41:16 2010	(r211433)
@@ -993,8 +993,8 @@ rip_pcblist(SYSCTL_HANDLER_ARGS)
 	 */
 	if (req->oldptr == 0) {
 		n = V_ripcbinfo.ipi_count;
-		req->oldidx = 2 * (sizeof xig)
-		    + (n + n/8) * sizeof(struct xinpcb);
+		n += imax(n / 8, 10);
+		req->oldidx = 2 * (sizeof xig) + n * sizeof(struct xinpcb);
 		return (0);
 	}
 

Modified: head/sys/netinet/tcp_subr.c
==============================================================================
--- head/sys/netinet/tcp_subr.c	Tue Aug 17 16:27:13 2010	(r211432)
+++ head/sys/netinet/tcp_subr.c	Tue Aug 17 16:41:16 2010	(r211433)
@@ -1022,8 +1022,9 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS)
 	if (req->oldptr == NULL) {
 		m = syncache_pcbcount();
 		n = V_tcbinfo.ipi_count;
-		req->oldidx = 2 * (sizeof xig)
-			+ ((m + n) + n/8) * sizeof(struct xtcpcb);
+		n += imax(n / 8, 10);
+		req->oldidx = 2 * (sizeof xig) +
+		    (m + n) * sizeof(struct xtcpcb);
 		return (0);
 	}
 

Modified: head/sys/netinet/udp_usrreq.c
==============================================================================
--- head/sys/netinet/udp_usrreq.c	Tue Aug 17 16:27:13 2010	(r211432)
+++ head/sys/netinet/udp_usrreq.c	Tue Aug 17 16:41:16 2010	(r211433)
@@ -707,8 +707,8 @@ udp_pcblist(SYSCTL_HANDLER_ARGS)
 	 */
 	if (req->oldptr == 0) {
 		n = V_udbinfo.ipi_count;
-		req->oldidx = 2 * (sizeof xig)
-			+ (n + n/8) * sizeof(struct xinpcb);
+		n += imax(n / 8, 10);
+		req->oldidx = 2 * (sizeof xig) + n * sizeof(struct xinpcb);
 		return (0);
 	}
 

From owner-svn-src-all@FreeBSD.ORG  Tue Aug 17 17:11:15 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 64AD9106567A;
	Tue, 17 Aug 2010 17:11:15 +0000 (UTC)
	(envelope-from mjacob@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 54ACC8FC12;
	Tue, 17 Aug 2010 17:11:15 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7HHBFRv039175;
	Tue, 17 Aug 2010 17:11:15 GMT (envelope-from mjacob@svn.freebsd.org)
Received: (from mjacob@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7HHBFce039173;
	Tue, 17 Aug 2010 17:11:15 GMT (envelope-from mjacob@svn.freebsd.org)
Message-Id: <201008171711.o7HHBFce039173@svn.freebsd.org>
From: Matt Jacob 
Date: Tue, 17 Aug 2010 17:11: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: r211434 - 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: Tue, 17 Aug 2010 17:11:15 -0000

Author: mjacob
Date: Tue Aug 17 17:11:15 2010
New Revision: 211434
URL: http://svn.freebsd.org/changeset/base/211434

Log:
  Now is as good a time as any to find out if we induce breakage
  by issueing aborts for any pending commands when we're decommssioning
  a disk.
  
  MFC after:	3 months

Modified:
  head/sys/cam/scsi/scsi_da.c

Modified: head/sys/cam/scsi/scsi_da.c
==============================================================================
--- head/sys/cam/scsi/scsi_da.c	Tue Aug 17 16:41:16 2010	(r211433)
+++ head/sys/cam/scsi/scsi_da.c	Tue Aug 17 17:11:15 2010	(r211434)
@@ -958,6 +958,8 @@ dainit(void)
 static void
 daoninvalidate(struct cam_periph *periph)
 {
+	struct ccb_abort cab;
+	struct ccb_hdr *ccb_h, *ccb_h_t;
 	struct da_softc *softc;
 
 	softc = (struct da_softc *)periph->softc;
@@ -967,15 +969,29 @@ daoninvalidate(struct cam_periph *periph
 	 */
 	xpt_register_async(0, daasync, periph, periph->path);
 
+	/*
+	 * Invalidate the pack label
+	 */
 	softc->flags |= DA_FLAG_PACK_INVALID;
 
 	/*
 	 * Return all queued I/O with ENXIO.
-	 * XXX Handle any transactions queued to the card
-	 *     with XPT_ABORT_CCB.
 	 */
 	bioq_flush(&softc->bio_queue, NULL, ENXIO);
 
+	/*
+	 * Issue aborts for any pending commands.
+	 */
+	xpt_setup_ccb(&cab.ccb_h, periph->path, CAM_PRIORITY_NORMAL+1);
+	cab.ccb_h.func_code = XPT_ABORT;
+	LIST_FOREACH_SAFE(ccb_h, &softc->pending_ccbs, periph_links.le, ccb_h_t) {
+		cab.abort_ccb = (union ccb *)ccb_h;
+		xpt_action((union ccb *)&cab);
+	}
+
+	/*
+	 * This disk is *history*....
+	 */
 	disk_gone(softc->disk);
 	xpt_print(periph->path, "lost device\n");
 }

From owner-svn-src-all@FreeBSD.ORG  Tue Aug 17 17:25:09 2010
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 920141065694;
	Tue, 17 Aug 2010 17:25:09 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au
	[211.29.132.190])
	by mx1.freebsd.org (Postfix) with ESMTP id 13C188FC1E;
	Tue, 17 Aug 2010 17:25:08 +0000 (UTC)
Received: from c122-106-147-41.carlnfd1.nsw.optusnet.com.au
	(c122-106-147-41.carlnfd1.nsw.optusnet.com.au [122.106.147.41])
	by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	o7HHP4ih009338
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 18 Aug 2010 03:25:05 +1000
Date: Wed, 18 Aug 2010 03:25:04 +1000 (EST)
From: Bruce Evans 
X-X-Sender: bde@delplex.bde.org
To: Joel Dahl 
In-Reply-To: <201008161518.o7GFIUis002051@svn.freebsd.org>
Message-ID: <20100818022442.Q16707@delplex.bde.org>
References: <201008161518.o7GFIUis002051@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: r211397 - in head: lib/libbluetooth lib/libc/gen
 lib/libc/net lib/libc/stdlib lib/libc/sys lib/libedit lib/libelf lib/libgeom
 lib/libgpib lib/libgssapi lib/libpmc lib/libradius lib/libr...
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 17 Aug 2010 17:25:09 -0000

Hi Joel,

On Mon, 16 Aug 2010, Joel Dahl wrote:

> Log:
>  Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while
>  translating these manual pages.  Minor corrections by me.

I noticed a few fixes missed nearby while checking the change in msun.

> Modified: head/lib/libbluetooth/bluetooth.3
> ==============================================================================
> --- head/lib/libbluetooth/bluetooth.3	Mon Aug 16 14:24:00 2010	(r211396)
> +++ head/lib/libbluetooth/bluetooth.3	Mon Aug 16 15:18:30 2010	(r211397)
> @@ -545,7 +545,7 @@ function performs Bluetooth inquiry.
> The
> .Fa devname
> parameter specifies which local Bluetooth device should perform an inquiry.
> -If not secified, i.e.
> +If not specified, i.e.
> .Dv NULL ,
> then first available device will be used.
> The
>

Still missing a comma after "i.e.,".  Some consider the comma optional, but
not me.  In /usr/share/man/man* there are ~currently 1861 lines matching
"i.e." and 1442 lines matching "i.e.," (counting links multiply).

> Modified: head/lib/libc/gen/dlopen.3
> ==============================================================================
> --- head/lib/libc/gen/dlopen.3	Mon Aug 16 14:24:00 2010	(r211396)
> +++ head/lib/libc/gen/dlopen.3	Mon Aug 16 15:18:30 2010	(r211397)
> @@ -149,7 +149,7 @@ The same behaviour may be requested by
> option of the static linker
> .Xr ld 1 .
> .It Dv RTLD_NOLOAD
> -Ony return valid handle for the object if it is already loaded in
> +Only return valid handle for the object if it is already loaded in
> the process address space, otherwise
> .Dv NULL
> is returned.
>

Still missing a "a".

> Modified: head/lib/libc/stdlib/getopt_long.3
> ==============================================================================
> --- head/lib/libc/stdlib/getopt_long.3	Mon Aug 16 14:24:00 2010	(r211396)
> +++ head/lib/libc/stdlib/getopt_long.3	Mon Aug 16 15:18:30 2010	(r211397)
> @@ -469,9 +469,9 @@ The
> .Fn getopt_long
> and
> .Fn getopt_long_only
> -functions first appeared in
> +functions first appeared in the
> .Tn GNU
> -libiberty.
> +libiberty library.
> The first
> .Bx
> implementation of
>

Hmm, what happened to -liberty?  I see that the pun is sort of reversed
in file and directory names -- they have to have a prefix of `lib', so
after removing this prefix and adding -l, the name is -liberty.

Shouldn't .Lb be used here?  Perhaps it only works for installed libraries.
If not, the same wording as .Lb produces should be used here.  This gives
something like "GNU iberty libary (libiberty, -liberty)".

> Modified: head/lib/libc/sys/kldstat.2
> ==============================================================================
> --- head/lib/libc/sys/kldstat.2	Mon Aug 16 14:24:00 2010	(r211396)
> +++ head/lib/libc/sys/kldstat.2	Mon Aug 16 15:18:30 2010	(r211397)
> @@ -129,6 +129,6 @@ The
> interface first appeared in
> .Fx 3.0 .
> .Sh BUGS
> -The pathname many not be accurate if the file system mounts have
> +The pathname may not be accurate if the file system mounts have
> changed since the module was loaded, or if this function is called
> within a chrooted environment.
>

"might" instead of "may" should be used in this context (else the
reader should wonder why the pathname not permitted to be accurate).

FreeBSD man pages mostly get this wrong.  me.  In /usr/share/man/man*
there are ~currently 1795 lines matching "may not" and "93 matching
"might not".

> .It TIME_ERROR
> Clock not synchronized.
> .El
>
> Modified: head/lib/libc/sys/open.2
> ==============================================================================
> --- head/lib/libc/sys/open.2	Mon Aug 16 14:24:00 2010	(r211396)
> +++ head/lib/libc/sys/open.2	Mon Aug 16 15:18:30 2010	(r211397)
> @@ -296,9 +296,9 @@ created has its immutable flag set, see
> .Xr chflags 2
> manual page for more information.

Still has a grammar error (comma splice).

> .It Bq Er EPERM
> -.Dv The named file has its immutable flag set and the file is to be modified.
> +The named file has its immutable flag set and the file is to be modified.
> .It Bq Er EPERM
> -.Dv The named file has its append-only flag set, the file is to be modified, and
> +The named file has its append-only flag set, the file is to be modified, and
> .Dv O_TRUNC
> is specified or
> .Dv O_APPEND
>
> Modified: head/lib/libelf/elf.3
> ==============================================================================
> --- head/lib/libelf/elf.3	Mon Aug 16 14:24:00 2010	(r211396)
> +++ head/lib/libelf/elf.3	Mon Aug 16 15:18:30 2010	(r211397)
> @@ -463,7 +463,7 @@ Close an ELF descriptor and release all
> .It Fn elf_memory
> Opens an
> .Xr ar 1
> -archive or ELF object present in a memory arena.
> +archive or ELF object present in a memory area.
> .It Fn elf_version
> Sets the operating version.
> .El
> @@ -563,7 +563,7 @@ descriptor and can set the
> member of the descriptor to point to a region of memory allocated
> using
> .Xr malloc 3 .
> -It is the applications responsibility to free this arena, though the
> +It is the applications responsibility to free this area, though the

Still missing an apostrophe.

> library will reclaim the space used by the
> .Vt Elf_Data
> descriptor itself.
>
> Modified: head/lib/libpmc/pmc.westmere.3
> ==============================================================================
> --- head/lib/libpmc/pmc.westmere.3	Mon Aug 16 14:24:00 2010	(r211396)
> +++ head/lib/libpmc/pmc.westmere.3	Mon Aug 16 15:18:30 2010	(r211397)
> @@ -975,7 +975,7 @@ Counting: Faulting executions of GETSEC/
> count as retired instructions.
> .It Li INST_RETIRED.X87
> .Pq Event C0H , Umask 02H
> -Counts the number of floating point computational operations retired:
> +Counts the number of floating point computational operations retired
> floating point computational operations executed by the assist handler and
> sub-operations of complex floating point instructions like transcendental
> instructions.
>

This now has nonsense grammar instead of bad grammar.  At first I thought
that it was a semicolon splice with the semicolon misspelled as a colon.
It was actually of the form "Counts the number of : ", where the  is long (5 words) and its description is much
longer (2 lines plus 1 word).  It is easy to see how translators would
have problems parsing this.  Attempted quick fix:

Counts the number of floating point computational operations retired
(i.e.,
floating point computational operations executed by the assist handler and
sub-operations of complex floating point instructions like transcendental
instructions
).

But the long description probably doesn't belong here.

> Modified: head/lib/libpmc/pmc.westmereuc.3
> ==============================================================================
> --- head/lib/libpmc/pmc.westmereuc.3	Mon Aug 16 14:24:00 2010	(r211396)
> +++ head/lib/libpmc/pmc.westmereuc.3	Mon Aug 16 15:18:30 2010	(r211397)
> @@ -464,7 +464,7 @@ Counts cycles all the entries in the DRA
> occupied with isochronous read requests.
> .It Li QMC_ISOC_FULL.READ.CH1
> .Pq Event 28H , Umask 02H
> -Counts cycles all the entries in the DRAM channel 1high priority queue are
> +Counts cycles all the entries in the DRAM channel 1 high priority queue are
> occupied with isochronous read requests.
> .It Li QMC_ISOC_FULL.READ.CH2
> .Pq Event 28H , Umask 04H
>

Still unparseable.  Maybe "Counts cycles of ... queue that are ..."

> Modified: head/lib/libradius/libradius.3
> ==============================================================================
> --- head/lib/libradius/libradius.3	Mon Aug 16 14:24:00 2010	(r211396)
> +++ head/lib/libradius/libradius.3	Mon Aug 16 15:18:30 2010	(r211397)
> @@ -464,7 +464,7 @@ subsequent library calls using the same
> To free the resources used by the RADIUS library, call
> .Fn rad_close .
> .Ss Server operation
> -Server mode operates much alike to client mode, except packet send and receieve
> +Server mode operates much alike to client mode, except packet send and receive

Still has bogus "to".

Still missing a "the" before "packet".

> steps are swapped. To operate as server you should obtain server context with
> .Fn rad_server_open
> function, passing opened and bound UDP socket file descriptor as argument.

Still has a hard sentence break and is missing a couple of "the"s and a
couple of "a"'s or "an"s.  I dare not look closer.

> Modified: head/lib/libusb/libusb20.3
> ==============================================================================
> --- head/lib/libusb/libusb20.3	Mon Aug 16 14:24:00 2010	(r211396)
> +++ head/lib/libusb/libusb20.3	Mon Aug 16 15:18:30 2010	(r211397)
> @@ -524,7 +524,7 @@ returns a zero terminated string describ
> .Pp
> .
> .Fn libusb20_dev_get_info
> -retrives the BSD specific usb_device_info structure into the memory location given by
> +retrieves the BSD specific usb_device_info structure into the memory location given by
> .Fa pinfo .
> The USB device given by
> .Fa pdev
>

Needs a hyphen before "specific".

In /usr/share/man/man* there are ~currently 1253 lines matching "\-specific"
and 5907 matching " specific".

> Modified: head/lib/libutil/quotafile.3
> ==============================================================================
> --- head/lib/libutil/quotafile.3	Mon Aug 16 14:24:00 2010	(r211396)
> +++ head/lib/libutil/quotafile.3	Mon Aug 16 15:18:30 2010	(r211397)
> @@ -121,7 +121,7 @@ The
> .Fn quota_on
> function enables quotas for the filesystem associated with its
> .Va qf
> -argument which may have been opened
> +argument which may have been opened with
> .Dv O_RDONLY
> or
> .Dv O_RDWR .
> @@ -138,7 +138,7 @@ The
> .Fn quota_off
> function disables quotas for the filesystem associated with its
> .Va qf
> -argument which may have been opened
> +argument which may have been opened with
> .Dv O_RDONLY
> or
> .Dv O_RDWR .
>

Here "may" instead of "might" is not too bad.

> Modified: head/lib/msun/man/fdim.3
> ==============================================================================
> --- head/lib/msun/man/fdim.3	Mon Aug 16 14:24:00 2010	(r211396)
> +++ head/lib/msun/man/fdim.3	Mon Aug 16 15:18:30 2010	(r211397)
> @@ -65,7 +65,7 @@ is an \*(Na, then an \*(Na is returned.
> Otherwise, the result is
> .Li +0.0 .
> .Pp
> -Overflow or underflow may occur iff the exact result is not
> +Overflow or underflow may occur if the exact result is not
> representable in the return type.
> No other exceptions are raised.
> .Sh SEE ALSO
>

"iff" was apparently used intentionally.  It means "if and only if",
which is more than "if".  But "iff" might be too informal for man page.
tcsh.1 is the only other man page that uses it.

> Modified: head/sbin/devd/devd.conf.5
> ...

Got bored here.

Bruce

From owner-svn-src-all@FreeBSD.ORG  Tue Aug 17 17:30:56 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 63EFA10656B6;
	Tue, 17 Aug 2010 17:30:56 +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 542078FC1C;
	Tue, 17 Aug 2010 17:30:56 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7HHUuur039601;
	Tue, 17 Aug 2010 17:30:56 GMT (envelope-from ume@svn.freebsd.org)
Received: (from ume@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7HHUu90039599;
	Tue, 17 Aug 2010 17:30:56 GMT (envelope-from ume@svn.freebsd.org)
Message-Id: <201008171730.o7HHUu90039599@svn.freebsd.org>
From: Hajimu UMEMOTO 
Date: Tue, 17 Aug 2010 17:30: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: r211435 - head/sys/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: Tue, 17 Aug 2010 17:30:56 -0000

Author: ume
Date: Tue Aug 17 17:30:56 2010
New Revision: 211435
URL: http://svn.freebsd.org/changeset/base/211435

Log:
  Make `ping6 -I' work with net.inet6.ip6.use_defaultzone=1.
  
  MFC after:	2 weeks

Modified:
  head/sys/netinet6/raw_ip6.c

Modified: head/sys/netinet6/raw_ip6.c
==============================================================================
--- head/sys/netinet6/raw_ip6.c	Tue Aug 17 17:11:15 2010	(r211434)
+++ head/sys/netinet6/raw_ip6.c	Tue Aug 17 17:30:56 2010	(r211435)
@@ -401,6 +401,7 @@ rip6_output(m, va_alist)
 	struct ifnet *oifp = NULL;
 	int type = 0, code = 0;		/* for ICMPv6 output statistics only */
 	int scope_ambiguous = 0;
+	int use_defzone = 0;
 	struct in6_addr in6a;
 	va_list ap;
 
@@ -430,9 +431,11 @@ rip6_output(m, va_alist)
 	 * XXX: we may still need to determine the zone later.
 	 */
 	if (!(so->so_state & SS_ISCONNECTED)) {
-		if (dstsock->sin6_scope_id == 0 && !V_ip6_use_defzone)
+		if (!optp->ip6po_pktinfo || !optp->ip6po_pktinfo->ipi6_ifindex)
+			use_defzone = V_ip6_use_defzone;
+		if (dstsock->sin6_scope_id == 0 && !use_defzone)
 			scope_ambiguous = 1;
-		if ((error = sa6_embedscope(dstsock, V_ip6_use_defzone)) != 0)
+		if ((error = sa6_embedscope(dstsock, use_defzone)) != 0)
 			goto bad;
 	}
 

From owner-svn-src-all@FreeBSD.ORG  Tue Aug 17 17:42:59 2010
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B38401065679;
	Tue, 17 Aug 2010 17:42:59 +0000 (UTC)
	(envelope-from uqs@spoerlein.net)
Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2001:470:9a47::1])
	by mx1.freebsd.org (Postfix) with ESMTP id EF2008FC1A;
	Tue, 17 Aug 2010 17:42:58 +0000 (UTC)
Received: from elmar.spoerlein.net (p57B4F89F.dip.t-dialin.net
	[87.180.248.159])
	by acme.spoerlein.net (8.14.4/8.14.4) with ESMTP id o7HHguPq056802
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 17 Aug 2010 19:42:58 +0200 (CEST)
	(envelope-from uqs@spoerlein.net)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=spoerlein.net;
	s=dkim200908; t=1282066978;
	bh=pkc2T6m/Yg5dXaA2Z9kysIEpq5H/pJ3zZlHhe7f2hls=;
	h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
	Content-Type:In-Reply-To;
	b=YKVqGYAORu8sF2PY5QxYrMGYOOFjwuitlLrPcSHEgKqpJbtk9JqKVtnLLGm7nEoJB
	2ULs0HPKIsrQMJ3nBALroYgOkFVCAqPLlfp0/igZ8VyGzluoQnLiTXJxMgNzQ/ocWo
	M5Zwg/j8PNVyztsS05mry2kEZRJWzwjwQaLupxBU=
Received: from elmar.spoerlein.net (localhost [127.0.0.1])
	by elmar.spoerlein.net (8.14.4/8.14.4) with ESMTP id o7HHgpco048334
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 17 Aug 2010 19:42:51 +0200 (CEST)
	(envelope-from uqs@spoerlein.net)
Received: (from uqs@localhost)
	by elmar.spoerlein.net (8.14.4/8.14.4/Submit) id o7HHgpYT048198;
	Tue, 17 Aug 2010 19:42:51 +0200 (CEST)
	(envelope-from uqs@spoerlein.net)
Date: Tue, 17 Aug 2010 19:42:50 +0200
From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= 
To: Joel Dahl 
Message-ID: <20100817174250.GA3940@elmar.spoerlein.net>
Mail-Followup-To: Ulrich =?utf-8?B?U3DDtnJsZWlu?= ,
	Joel Dahl , src-committers@FreeBSD.org,
	svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org
References: <201008161518.o7GFIUis002051@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201008161518.o7GFIUis002051@svn.freebsd.org>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r211397 - in head: lib/libbluetooth lib/libc/gen
 lib/libc/net lib/libc/stdlib lib/libc/sys lib/libedit lib/libelf
 lib/libgeom lib/libgpib lib/libgssapi lib/libpmc lib/libradius lib/libr...
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 17 Aug 2010 17:42:59 -0000

On Mon, 16.08.2010 at 15:18:30 +0000, Joel Dahl wrote:
> Author: joel (doc committer)
> Date: Mon Aug 16 15:18:30 2010
> New Revision: 211397
> URL: http://svn.freebsd.org/changeset/base/211397
> 
> Log:
>   Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while
>   translating these manual pages.  Minor corrections by me.
>   
>   Submitted by:	Nobuyuki Koganemaru 

Awesome!

Cheers,
Uli

From owner-svn-src-all@FreeBSD.ORG  Tue Aug 17 18:00:01 2010
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 52D0E1065673;
	Tue, 17 Aug 2010 18:00:01 +0000 (UTC)
	(envelope-from scottl@samsco.org)
Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57])
	by mx1.freebsd.org (Postfix) with ESMTP id EFEFC8FC12;
	Tue, 17 Aug 2010 18:00:00 +0000 (UTC)
Received: from [127.0.0.1] (pooker.samsco.org [168.103.85.57])
	(authenticated bits=0)
	by pooker.samsco.org (8.14.4/8.14.4) with ESMTP id o7HHxvL5002457;
	Tue, 17 Aug 2010 11:59:57 -0600 (MDT)
	(envelope-from scottl@samsco.org)
Mime-Version: 1.0 (Apple Message framework v1078)
Content-Type: text/plain; charset=us-ascii
From: Scott Long 
In-Reply-To: <201008171711.o7HHBFce039173@svn.freebsd.org>
Date: Tue, 17 Aug 2010 11:59:57 -0600
Content-Transfer-Encoding: quoted-printable
Message-Id: <810BE039-72EA-4020-8B42-8D1274E888AA@samsco.org>
References: <201008171711.o7HHBFce039173@svn.freebsd.org>
To: Matt Jacob 
X-Mailer: Apple Mail (2.1078)
X-Spam-Status: No, score=-50.0 required=3.8 tests=ALL_TRUSTED,
	T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.0
X-Spam-Checker-Version: SpamAssassin 3.3.0 (2010-01-18) on pooker.samsco.org
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r211434 - 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: Tue, 17 Aug 2010 18:00:01 -0000

This is violates the policy that CAM has effectively had for a long time =
that separates protocol error handling in the periph from transport =
error recovery in the SIM.  I think it's better to encourage SIMs to =
register an AC_LOST_DEVICE event and handle command aborts themselves.  =
Most drivers have a busy queue and know what outstanding CCBs belong to =
what devices/targets.  And in the age of SAS, the SIMs are going to know =
about dead devices long before the periph will, and should already be in =
the process of aborting the outstanding commands and returning the CCBs. =
 SIMs that don't probably don't even properly timeout outstanding =
commands, so they'll have much deeper problems than this.

I'm in the middle of working on this for the mps driver.  Your change =
may or may not get in the way of the design I already have, where the =
SIM autonomously dequeues and completes all outstanding CCBs to dead =
devices.  I'll hopefully have an answer in the coming weeks and let you =
know.  Please don't MFC before then.

Scott



On Aug 17, 2010, at 11:11 AM, Matt Jacob wrote:

> Author: mjacob
> Date: Tue Aug 17 17:11:15 2010
> New Revision: 211434
> URL: http://svn.freebsd.org/changeset/base/211434
>=20
> Log:
>  Now is as good a time as any to find out if we induce breakage
>  by issueing aborts for any pending commands when we're decommssioning
>  a disk.
>=20
>  MFC after:	3 months
>=20
> Modified:
>  head/sys/cam/scsi/scsi_da.c
>=20
> Modified: head/sys/cam/scsi/scsi_da.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/cam/scsi/scsi_da.c	Tue Aug 17 16:41:16 2010	=
(r211433)
> +++ head/sys/cam/scsi/scsi_da.c	Tue Aug 17 17:11:15 2010	=
(r211434)
> @@ -958,6 +958,8 @@ dainit(void)
> static void
> daoninvalidate(struct cam_periph *periph)
> {
> +	struct ccb_abort cab;
> +	struct ccb_hdr *ccb_h, *ccb_h_t;
> 	struct da_softc *softc;
>=20
> 	softc =3D (struct da_softc *)periph->softc;
> @@ -967,15 +969,29 @@ daoninvalidate(struct cam_periph *periph
> 	 */
> 	xpt_register_async(0, daasync, periph, periph->path);
>=20
> +	/*
> +	 * Invalidate the pack label
> +	 */
> 	softc->flags |=3D DA_FLAG_PACK_INVALID;
>=20
> 	/*
> 	 * Return all queued I/O with ENXIO.
> -	 * XXX Handle any transactions queued to the card
> -	 *     with XPT_ABORT_CCB.
> 	 */
> 	bioq_flush(&softc->bio_queue, NULL, ENXIO);
>=20
> +	/*
> +	 * Issue aborts for any pending commands.
> +	 */
> +	xpt_setup_ccb(&cab.ccb_h, periph->path, CAM_PRIORITY_NORMAL+1);
> +	cab.ccb_h.func_code =3D XPT_ABORT;
> +	LIST_FOREACH_SAFE(ccb_h, &softc->pending_ccbs, periph_links.le, =
ccb_h_t) {
> +		cab.abort_ccb =3D (union ccb *)ccb_h;
> +		xpt_action((union ccb *)&cab);
> +	}
> +
> +	/*
> +	 * This disk is *history*....
> +	 */
> 	disk_gone(softc->disk);
> 	xpt_print(periph->path, "lost device\n");
> }


From owner-svn-src-all@FreeBSD.ORG  Tue Aug 17 18:18:28 2010
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4BE681065672;
	Tue, 17 Aug 2010 18:18:28 +0000 (UTC) (envelope-from mj@feral.com)
Received: from ns1.feral.com (ns1.feral.com [192.67.166.1])
	by mx1.freebsd.org (Postfix) with ESMTP id EBDA98FC08;
	Tue, 17 Aug 2010 18:18:27 +0000 (UTC)
Received: from [192.168.0.103] (m206-63.dsl.tsoft.com [198.144.206.63])
	by ns1.feral.com (8.14.3/8.14.3) with ESMTP id o7HI5Dka093736;
	Tue, 17 Aug 2010 11:05:13 -0700 (PDT) (envelope-from mj@feral.com)
Message-ID: <4C6ACF53.5080607@feral.com>
Date: Tue, 17 Aug 2010 11:05:07 -0700
From: Matthew Jacob 
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
	rv:1.9.1.11) Gecko/20100711 Thunderbird/3.0.6
MIME-Version: 1.0
To: Scott Long 
References: <201008171711.o7HHBFce039173@svn.freebsd.org>
	<810BE039-72EA-4020-8B42-8D1274E888AA@samsco.org>
In-Reply-To: <810BE039-72EA-4020-8B42-8D1274E888AA@samsco.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.2.3
	(ns1.feral.com [192.67.166.1]);
	Tue, 17 Aug 2010 11:05:14 -0700 (PDT)
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, Matt Jacob 
Subject: Re: svn commit: r211434 - 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: Tue, 17 Aug 2010 18:18:28 -0000

On 8/17/2010 10:59 AM, Scott Long wrote:
> This is violates the policy that CAM has effectively had for a long time that separates protocol error handling in the periph from transport error recovery in the SIM.  I think it's better to encourage SIMs to register an AC_LOST_DEVICE event and handle command aborts themselves.  Most drivers have a busy queue and know what outstanding CCBs belong to what devices/targets.  And in the age of SAS, the SIMs are going to know about dead devices long before the periph will, and should already be in the process of aborting the outstanding commands and returning the CCBs.  SIMs that don't probably don't even properly timeout outstanding commands, so they'll have much deeper problems than this.
>
> I'm in the middle of working on this for the mps driver.  Your change may or may not get in the way of the design I already have, where the SIM autonomously dequeues and completes all outstanding CCBs to dead devices.  I'll hopefully have an answer in the coming weeks and let you know.  Please don't MFC before then.
>
>    

Oh, okay. I don't need to MFC it then, depending on the state of your work.


All of the periph drivers had this XXX. I'm doing practical work at 
present to try and handle device lossage in current systems.

Not sure about this being a violation of policy. There's nothing in this 
that says anything about protocol errors or what. If the device is going 
away, it is not unreasonable to call into CAM to make sure any inflight 
CCBs are aborted, wherever they may be. The reality here is that this 
goes straight to the SIM, but that need not be so.

From owner-svn-src-all@FreeBSD.ORG  Tue Aug 17 19:23:28 2010
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EF20E1065695;
	Tue, 17 Aug 2010 19:23:28 +0000 (UTC)
	(envelope-from peterjeremy@acm.org)
Received: from mail18.syd.optusnet.com.au (mail18.syd.optusnet.com.au
	[211.29.132.199])
	by mx1.freebsd.org (Postfix) with ESMTP id 5DCA28FC1A;
	Tue, 17 Aug 2010 19:23:27 +0000 (UTC)
Received: from server.vk2pj.dyndns.org
	(c220-239-116-103.belrs4.nsw.optusnet.com.au [220.239.116.103])
	by mail18.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	o7HJNOAe012239
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 18 Aug 2010 05:23:26 +1000
X-Bogosity: Ham, spamicity=0.000000
Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1])
	by server.vk2pj.dyndns.org (8.14.4/8.14.4) with ESMTP id o7HJNKRu047316;
	Wed, 18 Aug 2010 05:23:20 +1000 (EST)
	(envelope-from peter@server.vk2pj.dyndns.org)
Received: (from peter@localhost)
	by server.vk2pj.dyndns.org (8.14.4/8.14.4/Submit) id o7HJNK0Q047304;
	Wed, 18 Aug 2010 05:23:20 +1000 (EST) (envelope-from peter)
Date: Wed, 18 Aug 2010 05:23:20 +1000
From: Peter Jeremy 
To: Marc Fonvieille 
Message-ID: <20100817192319.GA28604@server.vk2pj.dyndns.org>
References: <201007162042.o6GKgKHJ016694@svn.freebsd.org>
	<20100815220635.GA79635@gothic.blackend.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="qDbXVdCdHGoSgWSk"
Content-Disposition: inline
In-Reply-To: <20100815220635.GA79635@gothic.blackend.org>
X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, Bruce Cran 
Subject: Re: svn commit: r210175 - head/usr.sbin/sysinstall
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 17 Aug 2010 19:23:29 -0000


--qDbXVdCdHGoSgWSk
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On 2010-Aug-16 00:06:35 +0200, Marc Fonvieille  wrote:
>We still support PLIP (with a laplink cable) since a plip0 interface
>is displayed on this screen during installation if you have a parallel
>port on the motherboard.

Has anyone actually verified that it still works?  I know I haven't
used it for more than a decade.

--=20
Peter Jeremy

--qDbXVdCdHGoSgWSk
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (FreeBSD)

iEYEARECAAYFAkxq4acACgkQ/opHv/APuIda2QCdETzR5BEfuVxomBortiDz1Cc4
OWQAoLgU+XvhAMzGQir3UADNXvxvxLTK
=taAA
-----END PGP SIGNATURE-----

--qDbXVdCdHGoSgWSk--

From owner-svn-src-all@FreeBSD.ORG  Tue Aug 17 19:35:50 2010
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E13461065673;
	Tue, 17 Aug 2010 19:35:50 +0000 (UTC)
	(envelope-from marc@blackend.org)
Received: from abigail.blackend.org (ns0.blackend.org [82.227.222.164])
	by mx1.freebsd.org (Postfix) with ESMTP id 5BC1C8FC18;
	Tue, 17 Aug 2010 19:35:49 +0000 (UTC)
Received: from gothic.blackend.org (gothic.blackend.org [192.168.1.203])
	by abigail.blackend.org (8.13.4/8.13.3) with ESMTP id o7HJZiTX060792;
	Tue, 17 Aug 2010 21:35:44 +0200 (CEST)
	(envelope-from marc@abigail.blackend.org)
Received: from gothic.blackend.org (localhost [127.0.0.1])
	by gothic.blackend.org (8.14.4/8.14.4) with ESMTP id o7HJZiXF001854;
	Tue, 17 Aug 2010 21:35:44 +0200 (CEST)
	(envelope-from marc@gothic.blackend.org)
Received: (from marc@localhost)
	by gothic.blackend.org (8.14.4/8.14.4/Submit) id o7HJZidU001853;
	Tue, 17 Aug 2010 21:35:44 +0200 (CEST) (envelope-from marc)
Date: Tue, 17 Aug 2010 21:35:44 +0200
From: Marc Fonvieille 
To: Peter Jeremy 
Message-ID: <20100817193544.GA1485@gothic.blackend.org>
References: <201007162042.o6GKgKHJ016694@svn.freebsd.org>
	<20100815220635.GA79635@gothic.blackend.org>
	<20100817192319.GA28604@server.vk2pj.dyndns.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="k1lZvvs/B4yU6o8G"
Content-Disposition: inline
In-Reply-To: <20100817192319.GA28604@server.vk2pj.dyndns.org>
X-Useless-Header: blackend.org
X-Operating-System: FreeBSD 8.1-RELEASE
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, Bruce Cran 
Subject: Re: svn commit: r210175 - head/usr.sbin/sysinstall
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 17 Aug 2010 19:35:51 -0000


--k1lZvvs/B4yU6o8G
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Aug 18, 2010 at 05:23:20AM +1000, Peter Jeremy wrote:
> On 2010-Aug-16 00:06:35 +0200, Marc Fonvieille  wro=
te:
> >We still support PLIP (with a laplink cable) since a plip0 interface
> >is displayed on this screen during installation if you have a parallel
> >port on the motherboard.
>=20
> Has anyone actually verified that it still works?  I know I haven't
> used it for more than a decade.
>

I forgot to mention that I did not test it (since 4.X).

--=20
Marc

--k1lZvvs/B4yU6o8G
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (FreeBSD)

iD8DBQFMauSPzQ9RwE+OdOgRAqDwAKCjez7rXm3DI6/771xcEut4E5dPBACgrOnT
E/VaEhdg1nqQrRkI00WNYZo=
=yxr/
-----END PGP SIGNATURE-----

--k1lZvvs/B4yU6o8G--

From owner-svn-src-all@FreeBSD.ORG  Tue Aug 17 19:37:57 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: by hub.freebsd.org (Postfix, from userid 1033)
	id D0B6D1065674; Tue, 17 Aug 2010 19:37:57 +0000 (UTC)
Date: Tue, 17 Aug 2010 19:37:57 +0000
From: Alexey Dokuchaev 
To: Jens Schweikhardt 
Message-ID: <20100817193757.GA92936@FreeBSD.org>
References: <201008142148.o7ELmMTO039767@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=koi8-r
Content-Disposition: inline
In-Reply-To: <201008142148.o7ELmMTO039767@svn.freebsd.org>
User-Agent: Mutt/1.4.2.1i
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r211318 - head/usr.sbin/sysinstall
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 17 Aug 2010 19:37:57 -0000

On Sat, Aug 14, 2010 at 09:48:22PM +0000, Jens Schweikhardt wrote:
> Author: schweikh
> Date: Sat Aug 14 21:48:22 2010
> New Revision: 211318
> URL: http://svn.freebsd.org/changeset/base/211318
> 
> Log:
>   Correctly spell janice and jimmy as janis and jimi (assuming
>   the famous rock stars meant were Miss Joplin and Mr Hendrix.)

Are you sure this is correct message for the commit, or I am simply
missing the irony?

./danfe

From owner-svn-src-all@FreeBSD.ORG  Tue Aug 17 19:58:35 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 34E2F106566C;
	Tue, 17 Aug 2010 19:58:35 +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 041C38FC29;
	Tue, 17 Aug 2010 19:58:35 +0000 (UTC)
Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net
	[66.111.2.69])
	by cyrus.watson.org (Postfix) with ESMTPSA id 979C746B58;
	Tue, 17 Aug 2010 15:58:34 -0400 (EDT)
Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9])
	by bigwig.baldwin.cx (Postfix) with ESMTPSA id B38428A050;
	Tue, 17 Aug 2010 15:58:33 -0400 (EDT)
From: John Baldwin 
To: Peter Jeremy 
Date: Tue, 17 Aug 2010 15:53:59 -0400
User-Agent: KMail/1.13.5 (FreeBSD/7.3-CBSD-20100217; KDE/4.4.5; amd64; ; )
References: <201007162042.o6GKgKHJ016694@svn.freebsd.org>
	<20100815220635.GA79635@gothic.blackend.org>
	<20100817192319.GA28604@server.vk2pj.dyndns.org>
In-Reply-To: <20100817192319.GA28604@server.vk2pj.dyndns.org>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="iso-8859-15"
Content-Transfer-Encoding: 7bit
Message-Id: <201008171553.59435.jhb@freebsd.org>
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1
	(bigwig.baldwin.cx); Tue, 17 Aug 2010 15:58:33 -0400 (EDT)
X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx
X-Virus-Status: Clean
X-Spam-Status: No, score=-2.6 required=4.2 tests=AWL,BAYES_00 autolearn=ham
	version=3.2.5
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Marc Fonvieille ,
	Bruce Cran 
Subject: Re: svn commit: r210175 - head/usr.sbin/sysinstall
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 17 Aug 2010 19:58:35 -0000

On Tuesday, August 17, 2010 3:23:20 pm Peter Jeremy wrote:
> On 2010-Aug-16 00:06:35 +0200, Marc Fonvieille  wrote:
> >We still support PLIP (with a laplink cable) since a plip0 interface
> >is displayed on this screen during installation if you have a parallel
> >port on the motherboard.
> 
> Has anyone actually verified that it still works?  I know I haven't
> used it for more than a decade.

Someone tested plip for me a year or so ago when I locked 
ppbus/ppc/ppi/lpt/plip/vpo.

-- 
John Baldwin

From owner-svn-src-all@FreeBSD.ORG  Tue Aug 17 20:02:17 2010
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id ED6A1106566C
	for ; Tue, 17 Aug 2010 20:02:17 +0000 (UTC)
	(envelope-from bf1783@googlemail.com)
Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com
	[209.85.215.182])
	by mx1.freebsd.org (Postfix) with ESMTP id 60B878FC1D
	for ; Tue, 17 Aug 2010 20:02:16 +0000 (UTC)
Received: by eyh6 with SMTP id 6so3998905eyh.13
	for ; Tue, 17 Aug 2010 13:02:16 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=googlemail.com; s=gamma;
	h=domainkey-signature:mime-version:received:received:reply-to:date
	:message-id:subject:from:to:cc:content-type;
	bh=xJDytWH1MKlDqtSHjWIsFknT4FlnZUbOtBoOx9CnGGE=;
	b=ovVYLIWgrkgi5dCYMgZ2mqGhv/Mh4Bpb+QpEhB+/MxUnsHQCAkga0GPJWFMXXSTEk2
	1o7q7smg4qYZQPuisilX4IQNCM1HEEqpRKbT2nDKRzpyMuzwQZ0Cbpf4ana3icvJ7Do8
	IwobC382Twql27ZbilPQe8xzal6v0z8F+V+os=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma;
	h=mime-version:reply-to:date:message-id:subject:from:to:cc
	:content-type;
	b=p7WXeHMjpCm3EdSIsh3m2Wh4sxlHMqD0/Hf50AFJmGDT7RGC7h6Uy0tVx++PMSWgmo
	KRpm2dpre5FEkKuepwPA7uNXX91vc900falSdp6MVeld8nevuHxCpz0oIiddw/QI+Ond
	5rCQ0R/+p6IUdwIarqvEgWaICkHgfNtLV0gA4=
MIME-Version: 1.0
Received: by 10.216.188.1 with SMTP id z1mr6073731wem.57.1282073794799; Tue,
	17 Aug 2010 12:36:34 -0700 (PDT)
Received: by 10.216.183.212 with HTTP; Tue, 17 Aug 2010 12:36:33 -0700 (PDT)
Date: Tue, 17 Aug 2010 19:36:33 +0000
Message-ID: 
From: "b. f." 
To: svn-src-all@FreeBSD.org
Content-Type: text/plain; charset=ISO-8859-1
Cc: Peter Jeremy 
Subject: Re: svn commit: r210175 - head/usr.sbin/sysinstall
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
Reply-To: bf1783@gmail.com
List-Id: "SVN commit messages 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, 17 Aug 2010 20:02:18 -0000

Peter Jeremy wrote:
>On 2010-Aug-16 00:06:35 +0200, Marc Fonvieille  wrote:
>>We still support PLIP (with a laplink cable) since a plip0 interface
>>is displayed on this screen during installation if you have a parallel
>>port on the motherboard.
>
>Has anyone actually verified that it still works?  I know I haven't
>used it for more than a decade.

It worked when I tested it not so long ago, after John Baldwin made it mpsafe:

http://svn.freebsd.org/viewvc/base?view=revision&revision=187576

Slow, but occasionally useful.

b.

From owner-svn-src-all@FreeBSD.ORG  Tue Aug 17 20:26:17 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5497210656AB;
	Tue, 17 Aug 2010 20:26:17 +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 4429D8FC1D;
	Tue, 17 Aug 2010 20:26:17 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7HKQHSo044756;
	Tue, 17 Aug 2010 20:26:17 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7HKQHUO044754;
	Tue, 17 Aug 2010 20:26:17 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201008172026.o7HKQHUO044754@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Tue, 17 Aug 2010 20: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: r211436 - 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: Tue, 17 Aug 2010 20:26:17 -0000

Author: des
Date: Tue Aug 17 20:26:17 2010
New Revision: 211436
URL: http://svn.freebsd.org/changeset/base/211436

Log:
  Split kernel stage 3.2 (build everything) into 3.2 (build the kernel)
  and 3.3 (build the modules).  IMHO, this makes it a little easier to
  track the progress of a kernel build using whereintheworld et al.
  
  MFC after:	3 weeks

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1	Tue Aug 17 17:30:56 2010	(r211435)
+++ head/Makefile.inc1	Tue Aug 17 20:26:17 2010	(r211436)
@@ -814,9 +814,16 @@ buildkernel:
 .endif
 	@echo
 	@echo "--------------------------------------------------------------"
-	@echo ">>> stage 3.2: building everything"
+	@echo ">>> stage 3.2: building the kernel"
 	@echo "--------------------------------------------------------------"
-	cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} all -DNO_MODULES_OBJ
+	cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} kernel-all -DNO_MODULES_OBJ
+	@echo
+.if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules)
+	@echo "--------------------------------------------------------------"
+	@echo ">>> stage 3.3: building the modules"
+	@echo "--------------------------------------------------------------"
+	cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} modules-all -DNO_MODULES_OBJ
+.endif
 	@echo "--------------------------------------------------------------"
 	@echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
 	@echo "--------------------------------------------------------------"

From owner-svn-src-all@FreeBSD.ORG  Tue Aug 17 20:39:29 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1DA861065697;
	Tue, 17 Aug 2010 20:39:29 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0B3858FC1D;
	Tue, 17 Aug 2010 20:39:29 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7HKdSBs045290;
	Tue, 17 Aug 2010 20:39:28 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7HKdSWY045281;
	Tue, 17 Aug 2010 20:39:28 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201008172039.o7HKdSWY045281@svn.freebsd.org>
From: Rui Paulo 
Date: Tue, 17 Aug 2010 20:39: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: r211437 - in head: share/mk sys/conf
	sys/dev/aic7xxx/aicasm sys/i386/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: Tue, 17 Aug 2010 20:39:29 -0000

Author: rpaulo
Date: Tue Aug 17 20:39:28 2010
New Revision: 211437
URL: http://svn.freebsd.org/changeset/base/211437

Log:
  For every instance of '.if ${CC} == "foo"' or '.if ${CC} != "foo"' in
  Makefiles or *.mk files, use ${CC:T:Mfoo} instead, so only the basename
  of the compiler command (excluding any arguments) is considered.
  
  This allows you to use, for example, CC="/nondefault/path/clang -xxx",
  and still have the various tests in bsd.*.mk identify your compiler as
  clang correctly.
  
  ICC if cases were also changed.
  
  Submitted by:	Dimitry Andric 

Modified:
  head/share/mk/bsd.dep.mk
  head/share/mk/bsd.lib.mk
  head/share/mk/bsd.sys.mk
  head/sys/conf/kern.mk
  head/sys/conf/kern.pre.mk
  head/sys/conf/kmod.mk
  head/sys/dev/aic7xxx/aicasm/Makefile
  head/sys/i386/acpica/Makefile

Modified: head/share/mk/bsd.dep.mk
==============================================================================
--- head/share/mk/bsd.dep.mk	Tue Aug 17 20:26:17 2010	(r211436)
+++ head/share/mk/bsd.dep.mk	Tue Aug 17 20:39:28 2010	(r211437)
@@ -125,7 +125,7 @@ depend: beforedepend ${DEPENDFILE} after
 
 # Different types of sources are compiled with slightly different flags.
 # Split up the sources, and filter out headers and non-applicable flags.
-.if ${CC} == "icc"
+.if ${CC:T:Micc} == "icc"
 MKDEP_CFLAGS=	${CFLAGS:M-X*} ${CFLAGS:M-[BIDU]*}
 MKDEP_CXXFLAGS=	${CXXFLAGS:M-X*} ${CXXFLAGS:M-[BIDU]*}
 MKDEP_OBJCFLAGS=${OBJCFLAGS:M-X*} ${OBJCFLAGS:M-[BIDU]*}

Modified: head/share/mk/bsd.lib.mk
==============================================================================
--- head/share/mk/bsd.lib.mk	Tue Aug 17 20:26:17 2010	(r211436)
+++ head/share/mk/bsd.lib.mk	Tue Aug 17 20:39:28 2010	(r211437)
@@ -65,7 +65,7 @@ PICFLAG=-fpic
 .endif
 .endif
 
-.if ${CC} == "icc"
+.if ${CC:T:Micc} == "icc"
 PO_FLAG=-p
 .else
 PO_FLAG=-pg

Modified: head/share/mk/bsd.sys.mk
==============================================================================
--- head/share/mk/bsd.sys.mk	Tue Aug 17 20:26:17 2010	(r211436)
+++ head/share/mk/bsd.sys.mk	Tue Aug 17 20:39:28 2010	(r211437)
@@ -11,7 +11,7 @@
 # the default is gnu99 for now
 CSTD		?= gnu99
 
-.if ${CC} != "icc"
+.if ${CC:T:Micc} != "icc"
 . if ${CSTD} == "k&r"
 CFLAGS		+= -traditional
 . elif ${CSTD} == "c89" || ${CSTD} == "c90"
@@ -24,7 +24,7 @@ CFLAGS		+= -std=iso9899:1999
 CFLAGS		+= -std=${CSTD}
 . endif
 .endif
-.if !defined(NO_WARNS) && ${CC} != "icc"
+.if !defined(NO_WARNS) && ${CC:T:Micc} != "icc"
 # -pedantic is problematic because it also imposes namespace restrictions
 #CFLAGS		+= -pedantic
 . if defined(WARNS)
@@ -79,7 +79,7 @@ CWARNFLAGS	+=	-Werror
 CWARNFLAGS	+=	-Wno-unknown-pragmas
 .endif
 
-.if ${MK_SSP} != "no" && ${CC} != "icc" && ${MACHINE_ARCH} != "ia64" && \
+.if ${MK_SSP} != "no" && ${CC:T:Micc} != "icc" && ${MACHINE_ARCH} != "ia64" && \
 	${MACHINE_ARCH} != "arm" && ${MACHINE_ARCH} != "mips"
 # Don't use -Wstack-protector as it breaks world with -Werror.
 SSP_CFLAGS	?=	-fstack-protector

Modified: head/sys/conf/kern.mk
==============================================================================
--- head/sys/conf/kern.mk	Tue Aug 17 20:26:17 2010	(r211436)
+++ head/sys/conf/kern.mk	Tue Aug 17 20:39:28 2010	(r211437)
@@ -6,7 +6,7 @@
 # Note that the newly added -Wcast-qual is responsible for generating 
 # most of the remaining warnings.  Warnings introduced with -Wall will
 # also pop up, but are easier to fix.
-.if ${CC} == "icc"
+.if ${CC:T:Micc} == "icc"
 #CWARNFLAGS=	-w2	# use this if you are terribly bored
 CWARNFLAGS=
 .else
@@ -29,8 +29,8 @@ CWARNFLAGS?=	-Wall -Wredundant-decls -Wn
 # operations inside the kernel itself.  These operations are exclusively
 # reserved for user applications.
 #
-.if ${MACHINE_ARCH} == "i386" && ${CC} != "icc"
-.if ${CC} != "clang"
+.if ${MACHINE_ARCH} == "i386" && ${CC:T:Micc} != "icc"
+.if ${CC:T:Mclang} != "clang"
 CFLAGS+=	-mno-align-long-strings -mpreferred-stack-boundary=2
 .endif
 CFLAGS+=	-mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3
@@ -93,20 +93,20 @@ INLINE_LIMIT?=	8000
 # GCC 3.0 and above like to do certain optimizations based on the
 # assumption that the program is linked against libc.  Stop this.
 #
-.if ${CC} == "icc"
+.if ${CC:T:Micc} == "icc"
 CFLAGS+=	-nolib_inline
 .else
 CFLAGS+=	-ffreestanding
 .endif
 
-.if ${CC} == "icc"
+.if ${CC:T:Micc} == "icc"
 CFLAGS+=	-restrict
 .endif
 
 #
 # GCC SSP support.
 #
-.if ${MK_SSP} != "no" && ${CC} != "icc" && ${MACHINE_ARCH} != "ia64" && \
+.if ${MK_SSP} != "no" && ${CC:T:Micc} != "icc" && ${MACHINE_ARCH} != "ia64" && \
 	${MACHINE_ARCH} != "arm" && ${MACHINE_ARCH} != "mips"
 CFLAGS+=	-fstack-protector
 .endif

Modified: head/sys/conf/kern.pre.mk
==============================================================================
--- head/sys/conf/kern.pre.mk	Tue Aug 17 20:26:17 2010	(r211436)
+++ head/sys/conf/kern.pre.mk	Tue Aug 17 20:39:28 2010	(r211437)
@@ -23,7 +23,7 @@ NM?=		nm
 OBJCOPY?=	objcopy
 SIZE?=		size
 
-.if ${CC} == "icc"
+.if ${CC:T:Micc} == "icc"
 COPTFLAGS?=	-O
 .else
 . if defined(DEBUG)
@@ -48,7 +48,7 @@ COPTFLAGS+= ${_ICC_CPUCFLAGS:C/(-x[^M^K^
 COPTFLAGS+= ${_CPUCFLAGS}
 . endif
 .endif
-.if ${CC} == "icc"
+.if ${CC:T:Micc} == "icc"
 C_DIALECT=
 NOSTDINC= -X
 .else
@@ -92,8 +92,8 @@ INCLUDES+= -I$S/dev/cxgb
 
 CFLAGS=	${COPTFLAGS} ${C_DIALECT} ${DEBUG} ${CWARNFLAGS}
 CFLAGS+= ${INCLUDES} -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h
-.if ${CC} != "icc"
-.if ${CC} != "clang"
+.if ${CC:T:Micc} != "icc"
+.if ${CC:T:Mclang} != "clang"
 CFLAGS+= -fno-common -finline-limit=${INLINE_LIMIT}
 .if ${MACHINE_CPUARCH} != "mips"
 CFLAGS+= --param inline-unit-growth=100
@@ -111,7 +111,7 @@ WERROR?= -Werror
 ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${CFLAGS}
 
 .if defined(PROFLEVEL) && ${PROFLEVEL} >= 1
-.if ${CC} == "icc" || ${CC} == "clang"
+.if ${CC:T:Micc} == "icc" || ${CC:T:Mclang} == "clang"
 .error "Profiling doesn't work with icc or clang yet"
 .endif
 CFLAGS+=	-DGPROF -falign-functions=16

Modified: head/sys/conf/kmod.mk
==============================================================================
--- head/sys/conf/kmod.mk	Tue Aug 17 20:26:17 2010	(r211436)
+++ head/sys/conf/kmod.mk	Tue Aug 17 20:39:28 2010	(r211437)
@@ -81,7 +81,7 @@ OBJCOPY?=	objcopy
 
 .SUFFIXES: .out .o .c .cc .cxx .C .y .l .s .S
 
-.if ${CC} == "icc"
+.if ${CC:T:Micc} == "icc"
 CFLAGS:=	${CFLAGS:C/(-x[^M^K^W]+)[MKW]+|-x[MKW]+/\1/}
 .else
 . if !empty(CFLAGS:M-O[23s]) && empty(CFLAGS:M-fno-strict-aliasing)
@@ -94,7 +94,7 @@ CFLAGS+=	-D_KERNEL
 CFLAGS+=	-DKLD_MODULE
 
 # Don't use any standard or source-relative include directories.
-.if ${CC} == "icc"
+.if ${CC:T:Micc} == "icc"
 NOSTDINC=	-X
 .else
 CSTD=		c99
@@ -114,7 +114,7 @@ CFLAGS+=	-I. -I@
 # for example.
 CFLAGS+=	-I@/contrib/altq
 
-.if ${CC} != "icc" && ${CC} != "clang"
+.if ${CC:T:Micc} != "icc" && ${CC:T:Mclang} != "clang"
 CFLAGS+=	-finline-limit=${INLINE_LIMIT}
 CFLAGS+= --param inline-unit-growth=100
 CFLAGS+= --param large-function-growth=1000
@@ -122,7 +122,7 @@ CFLAGS+= --param large-function-growth=1
 
 # Disallow common variables, and if we end up with commons from
 # somewhere unexpected, allocate storage for them in the module itself.
-.if ${CC} != "icc"
+.if ${CC:T:Micc} != "icc"
 CFLAGS+=	-fno-common
 .endif
 LDFLAGS+=	-d -warn-common

Modified: head/sys/dev/aic7xxx/aicasm/Makefile
==============================================================================
--- head/sys/dev/aic7xxx/aicasm/Makefile	Tue Aug 17 20:26:17 2010	(r211436)
+++ head/sys/dev/aic7xxx/aicasm/Makefile	Tue Aug 17 20:39:28 2010	(r211437)
@@ -24,7 +24,7 @@ WARNS?=	5
 DEPENDFILE=	.depend_aicasm
 .endif
 
-.if ${CC} == "icc"
+.if ${CC:T:Micc} == "icc"
 CFLAGS+=	-restrict
 NOSTDINC=	-X
 .else

Modified: head/sys/i386/acpica/Makefile
==============================================================================
--- head/sys/i386/acpica/Makefile	Tue Aug 17 20:26:17 2010	(r211436)
+++ head/sys/i386/acpica/Makefile	Tue Aug 17 20:39:28 2010	(r211437)
@@ -9,7 +9,7 @@ DEPENDFILE=
 MAKESRCPATH= ${.CURDIR}
 CLEANFILES= acpi_wakecode.h acpi_wakecode.bin acpi_wakecode.o
 .endif
-.if ${CC} == "icc"
+.if ${CC:T:Micc} == "icc"
 CFLAGS+=	-restrict
 NOSTDINC=	-X
 .else

From owner-svn-src-all@FreeBSD.ORG  Tue Aug 17 21:04:48 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 90A201065698;
	Tue, 17 Aug 2010 21:04:48 +0000 (UTC)
	(envelope-from max@love2party.net)
Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.8])
	by mx1.freebsd.org (Postfix) with ESMTP id E41DF8FC12;
	Tue, 17 Aug 2010 21:04:46 +0000 (UTC)
Received: from f8x64.laiers.local (dslb-088-064-182-253.pools.arcor-ip.net
	[88.64.182.253])
	by mrelayeu.kundenserver.de (node=mreu0) with ESMTP (Nemesis)
	id 0La0Mr-1PAsOF09pl-00ljOd; Tue, 17 Aug 2010 22:52:10 +0200
From: Max Laier 
Organization: FreeBSD
To: "Dag-Erling Smorgrav" 
Date: Tue, 17 Aug 2010 22:52:08 +0200
User-Agent: KMail/1.13.5 (FreeBSD/8.1-RELEASE; KDE/4.4.5; amd64; ; )
References: <201008172026.o7HKQHUO044754@svn.freebsd.org>
In-Reply-To: <201008172026.o7HKQHUO044754@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201008172252.09064.max@love2party.net>
X-Provags-ID: V02:K0:Dqvu+xy3V541Bv4TK5NL7XbqiU9aUQD2cjMrIw3OdzR
	iavu+rLHqsk32i9sqaJ1y70vx3fkQuHv8WFJTcZtqe0Bnjeh7r
	QbmVi1mdwyXUn+GtiGC+jEMC50Tm1Ivuiqtz+pprqEpLgO/QzZ
	SLKzE9rW9Fu9RnyyfzYN6pLNP7VAmuKL7ICy1yqOZiGkhclT6i
	37SgLXg/g6TcBcZOE//ow==
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r211436 - 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: Tue, 17 Aug 2010 21:04:48 -0000

On Tuesday 17 August 2010 22:26:17 Dag-Erling Smorgrav wrote:
> Author: des
> Date: Tue Aug 17 20:26:17 2010
> New Revision: 211436
> URL: http://svn.freebsd.org/changeset/base/211436
> 
> Log:
>   Split kernel stage 3.2 (build everything) into 3.2 (build the kernel)
>   and 3.3 (build the modules).  IMHO, this makes it a little easier to
>   track the progress of a kernel build using whereintheworld et al.

I believe this kills "make -j" performance as the module build does depth 
first and there's hardly any opportunity for parallelism in the individual 
modules.

Max

>   MFC after:	3 weeks
> 
> Modified:
>   head/Makefile.inc1
> 
> Modified: head/Makefile.inc1
> ===========================================================================
> === --- head/Makefile.inc1	Tue Aug 17 17:30:56 2010	(r211435)
> +++ head/Makefile.inc1	Tue Aug 17 20:26:17 2010	(r211436)
> @@ -814,9 +814,16 @@ buildkernel:
>  .endif
>  	@echo
>  	@echo "--------------------------------------------------------------"
> -	@echo ">>> stage 3.2: building everything"
> +	@echo ">>> stage 3.2: building the kernel"
>  	@echo "--------------------------------------------------------------"
> -	cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} all -DNO_MODULES_OBJ
> +	cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} kernel-all -DNO_MODULES_OBJ
> +	@echo
> +.if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) &&
> exists(${KERNSRCDIR}/modules) +	@echo
> "--------------------------------------------------------------" +	@echo
> ">>> stage 3.3: building the modules"
> +	@echo "--------------------------------------------------------------"
> +	cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} modules-all -DNO_MODULES_OBJ
> +.endif
>  	@echo "--------------------------------------------------------------"
>  	@echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
>  	@echo "--------------------------------------------------------------"

From owner-svn-src-all@FreeBSD.ORG  Tue Aug 17 21:28:41 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1FFEB1065679;
	Tue, 17 Aug 2010 21:28:41 +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 0E19B8FC12;
	Tue, 17 Aug 2010 21:28:41 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7HLSeb3046418;
	Tue, 17 Aug 2010 21:28:40 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7HLSekX046412;
	Tue, 17 Aug 2010 21:28:40 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201008172128.o7HLSekX046412@svn.freebsd.org>
From: John Baldwin 
Date: Tue, 17 Aug 2010 21:28: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: r211438 - in stable/7/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: Tue, 17 Aug 2010 21:28:41 -0000

Author: jhb
Date: Tue Aug 17 21:28:40 2010
New Revision: 211438
URL: http://svn.freebsd.org/changeset/base/211438

Log:
  MFC 175682,175683,175686:
  Generally, anything that runs rc.d scripts internally should
  start using the quiet prefix (i.e. quietstart, quietstop, etc...).

Modified:
  stable/7/etc/devd.conf
  stable/7/etc/netstart
  stable/7/etc/rc.d/ipfw
  stable/7/etc/rc.d/mountcritremote
  stable/7/etc/rc.d/ppp
Directory Properties:
  stable/7/etc/   (props changed)

Modified: stable/7/etc/devd.conf
==============================================================================
--- stable/7/etc/devd.conf	Tue Aug 17 20:39:28 2010	(r211437)
+++ stable/7/etc/devd.conf	Tue Aug 17 21:28:40 2010	(r211438)
@@ -53,7 +53,7 @@ notify 0 {
 	match "system"		"IFNET";
 	match "type"		"LINK_UP";
 	media-type		"ethernet";
-	action "/etc/rc.d/dhclient start $subsystem";
+	action "/etc/rc.d/dhclient quietstart $subsystem";
 };
 
 #
@@ -73,7 +73,7 @@ notify 0 {
 	match "system"		"IFNET";
 	match "type"		"LINK_UP";
 	media-type		"802.11";
-	action "/etc/rc.d/dhclient start $subsystem";
+	action "/etc/rc.d/dhclient quietstart $subsystem";
 };
 
 # An entry like this might be in a different file, but is included here
@@ -91,11 +91,11 @@ detach 100 {
 # When a USB Bluetooth dongle appears activate it
 attach 100 {
 	device-name "ubt[0-9]+";
-	action "/etc/rc.d/bluetooth start $device-name";
+	action "/etc/rc.d/bluetooth quietstart $device-name";
 };
 detach 100 {
 	device-name "ubt[0-9]+";
-	action "/etc/rc.d/bluetooth stop $device-name";
+	action "/etc/rc.d/bluetooth quietstop $device-name";
 };
 
 # When a USB keyboard arrives, attach it as the console keyboard.
@@ -112,7 +112,7 @@ detach 100 {
 # stops automatically (actually it bombs :) when the device disappears.
 attach 100 {
 	device-name "ums[0-9]+";
-	action "/etc/rc.d/moused start $device-name";
+	action "/etc/rc.d/moused quietstart $device-name";
 };
 
 # Firmware download into the ActiveWire board. After the firmware download is

Modified: stable/7/etc/netstart
==============================================================================
--- stable/7/etc/netstart	Tue Aug 17 20:39:28 2010	(r211437)
+++ stable/7/etc/netstart	Tue Aug 17 21:28:40 2010	(r211438)
@@ -37,30 +37,32 @@
 . /etc/rc.subr
 
 load_rc_config 'XXX'
-/etc/rc.d/devd start
-/etc/rc.d/hostid start
-/etc/rc.d/hostname start
-/etc/rc.d/ipmon start
-/etc/rc.d/ipfilter start
-/etc/rc.d/ipnat start
-/etc/rc.d/ipfs start
-/etc/rc.d/sppp start
-# /etc/rc.d/atm1 start
-# . /etc/rc.d/atm2.sh start
-# . /etc/rc.d/atm3.sh start
-/etc/rc.d/netif start
-/etc/rc.d/ipsec start
-/etc/rc.d/dhclient start
-/etc/rc.d/isdnd start
-/etc/rc.d/ppp start
-/etc/rc.d/ipfw start
-/etc/rc.d/ip6fw start
-/etc/rc.d/network_ipv6 start
-/etc/rc.d/routing start
-/etc/rc.d/mroute6d start
-/etc/rc.d/route6d start
-/etc/rc.d/mrouted start
-/etc/rc.d/routed start
-/etc/rc.d/nisdomain start
+_start=quietstart
+
+/etc/rc.d/devd ${_start}
+/etc/rc.d/hostid ${_start}
+/etc/rc.d/hostname ${_start}
+/etc/rc.d/ipmon ${_start}
+/etc/rc.d/ipfilter ${_start}
+/etc/rc.d/ipnat ${_start}
+/etc/rc.d/ipfs ${_start}
+/etc/rc.d/sppp ${_start}
+# /etc/rc.d/atm1 ${_start}
+# . /etc/rc.d/atm2.sh ${_start}
+# . /etc/rc.d/atm3.sh ${_start}
+/etc/rc.d/netif ${_start}
+/etc/rc.d/ipsec ${_start}
+/etc/rc.d/dhclient ${_start}
+/etc/rc.d/isdnd ${_start}
+/etc/rc.d/ppp ${_start}
+/etc/rc.d/ipfw ${_start}
+/etc/rc.d/ip6fw ${_start}
+/etc/rc.d/network_ipv6 ${_start}
+/etc/rc.d/routing ${_start}
+/etc/rc.d/mroute6d ${_start}
+/etc/rc.d/route6d ${_start}
+/etc/rc.d/mrouted ${_start}
+/etc/rc.d/routed ${_start}
+/etc/rc.d/nisdomain ${_start}
 
 exit 0

Modified: stable/7/etc/rc.d/ipfw
==============================================================================
--- stable/7/etc/rc.d/ipfw	Tue Aug 17 20:39:28 2010	(r211437)
+++ stable/7/etc/rc.d/ipfw	Tue Aug 17 21:28:40 2010	(r211438)
@@ -66,7 +66,7 @@ ipfw_poststart()
 	#
 	for _coscript in ${firewall_coscripts} ; do
 		if [ -f "${_coscript}" ]; then
-			${_coscript} start
+			${_coscript} quietstart
 		fi
 	done
 
@@ -87,7 +87,7 @@ ipfw_stop()
 	#
 	for _coscript in `reverse_list ${firewall_coscripts}` ; do
 		if [ -f "${_coscript}" ]; then
-			${_coscript} stop
+			${_coscript} quietstop
 		fi
 	done
 }

Modified: stable/7/etc/rc.d/mountcritremote
==============================================================================
--- stable/7/etc/rc.d/mountcritremote	Tue Aug 17 20:39:28 2010	(r211437)
+++ stable/7/etc/rc.d/mountcritremote	Tue Aug 17 21:28:40 2010	(r211438)
@@ -65,7 +65,7 @@ mountcritremote_start()
 	done
 
 	# Cleanup /var again just in case it's a network mount.
-	/etc/rc.d/cleanvar reload
+	/etc/rc.d/cleanvar quietreload
 	rm -f /var/run/clean_var /var/spool/lock/clean_var
 }
 

Modified: stable/7/etc/rc.d/ppp
==============================================================================
--- stable/7/etc/rc.d/ppp	Tue Aug 17 20:39:28 2010	(r211437)
+++ stable/7/etc/rc.d/ppp	Tue Aug 17 21:28:40 2010	(r211438)
@@ -95,8 +95,8 @@ ppp_poststart()
 {
 	# Re-Sync ipfilter and pf so they pick up any new network interfaces
 	#
-	/etc/rc.d/ipfilter resync
-	/etc/rc.d/pf resync
+	/etc/rc.d/ipfilter quietresync
+	/etc/rc.d/pf quietresync
 }
 
 ppp_stop_profile() {

From owner-svn-src-all@FreeBSD.ORG  Tue Aug 17 21:34:19 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 83A431065673;
	Tue, 17 Aug 2010 21:34:19 +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 58F7B8FC13;
	Tue, 17 Aug 2010 21:34:19 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7HLYJKj046562;
	Tue, 17 Aug 2010 21:34:19 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7HLYJ7A046560;
	Tue, 17 Aug 2010 21:34:19 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201008172134.o7HLYJ7A046560@svn.freebsd.org>
From: John Baldwin 
Date: Tue, 17 Aug 2010 21:34: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: r211439 - 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: Tue, 17 Aug 2010 21:34:19 -0000

Author: jhb
Date: Tue Aug 17 21:34:19 2010
New Revision: 211439
URL: http://svn.freebsd.org/changeset/base/211439

Log:
  Keep the process locked when calling ktrops() or ktrsetchildren() instead
  of dropping the lock only to immediately reacquire it.

Modified:
  head/sys/kern/kern_ktrace.c

Modified: head/sys/kern/kern_ktrace.c
==============================================================================
--- head/sys/kern/kern_ktrace.c	Tue Aug 17 21:28:40 2010	(r211438)
+++ head/sys/kern/kern_ktrace.c	Tue Aug 17 21:34:19 2010	(r211439)
@@ -741,7 +741,6 @@ ktrace(td, uap)
 				PROC_UNLOCK(p); 
 				continue;
 			}
-			PROC_UNLOCK(p); 
 			nfound++;
 			if (descend)
 				ret |= ktrsetchildren(td, p, ops, facs, vp);
@@ -758,18 +757,13 @@ ktrace(td, uap)
 		 * by pid
 		 */
 		p = pfind(uap->pid);
-		if (p == NULL) {
-			sx_sunlock(&proctree_lock);
+		if (p == NULL)
 			error = ESRCH;
-			goto done;
-		}
-		error = p_cansee(td, p);
-		/*
-		 * The slock of the proctree lock will keep this process
-		 * from going away, so unlocking the proc here is ok.
-		 */
-		PROC_UNLOCK(p);
+		else
+			error = p_cansee(td, p);
 		if (error) {
+			if (p != NULL)
+				PROC_UNLOCK(p);
 			sx_sunlock(&proctree_lock);
 			goto done;
 		}
@@ -841,11 +835,16 @@ ktrops(td, p, ops, facs, vp)
 	struct vnode *tracevp = NULL;
 	struct ucred *tracecred = NULL;
 
-	PROC_LOCK(p);
+	PROC_LOCK_ASSERT(p, MA_OWNED);
 	if (!ktrcanset(td, p)) {
 		PROC_UNLOCK(p);
 		return (0);
 	}
+	if (p->p_flag & P_WEXIT) {
+		/* If the process is exiting, just ignore it. */
+		PROC_UNLOCK(p);
+		return (1);
+	}
 	mtx_lock(&ktrace_mtx);
 	if (ops == KTROP_SET) {
 		if (p->p_tracevp != vp) {
@@ -900,6 +899,7 @@ ktrsetchildren(td, top, ops, facs, vp)
 	register int ret = 0;
 
 	p = top;
+	PROC_LOCK_ASSERT(p, MA_OWNED);
 	sx_assert(&proctree_lock, SX_LOCKED);
 	for (;;) {
 		ret |= ktrops(td, p, ops, facs, vp);
@@ -919,6 +919,7 @@ ktrsetchildren(td, top, ops, facs, vp)
 			}
 			p = p->p_pptr;
 		}
+		PROC_LOCK(p);
 	}
 	/*NOTREACHED*/
 }

From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 00:26:14 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 59B4810656A5;
	Wed, 18 Aug 2010 00:26: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 48C9E8FC1C;
	Wed, 18 Aug 2010 00:26:14 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7I0QEsh049756;
	Wed, 18 Aug 2010 00:26:14 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7I0QEBO049753;
	Wed, 18 Aug 2010 00:26:14 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201008180026.o7I0QEBO049753@svn.freebsd.org>
From: Adrian Chadd 
Date: Wed, 18 Aug 2010 00:26: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: r211440 - head/sys/mips/atheros
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 18 Aug 2010 00:26:14 -0000

Author: adrian
Date: Wed Aug 18 00:26:14 2010
New Revision: 211440
URL: http://svn.freebsd.org/changeset/base/211440

Log:
  Import initial AR91XX and AR724X CPU register definitions.
  
  Obtained from:	Linux

Added:
  head/sys/mips/atheros/ar724xreg.h   (contents, props changed)
  head/sys/mips/atheros/ar91xxreg.h   (contents, props changed)

Added: head/sys/mips/atheros/ar724xreg.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/mips/atheros/ar724xreg.h	Wed Aug 18 00:26:14 2010	(r211440)
@@ -0,0 +1,81 @@
+/*-
+ * Copyright (c) 2010 Adrian Chadd
+ * 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$ */
+
+#ifndef	__AR72XX_REG_H__
+#define	__AR72XX_REG_H__
+
+#define	AR724X_PLL_REG_CPU_CONFIG	AR71XX_PLL_CPU_BASE + 0x00
+#define	AR724X_PLL_REG_PCIE_CONFIG	AR71XX_PLL_CPU_BASE + 0x18
+
+#define	AR724X_PLL_DIV_SHIFT		0
+#define	AR724X_PLL_DIV_MASK		0x3ff
+#define	AR724X_PLL_REF_DIV_SHIFT	10
+#define	AR724X_PLL_REF_DIV_MASK		0xf
+#define	AR724X_AHB_DIV_SHIFT		19
+#define	AR724X_AHB_DIV_MASK		0x1
+#define	AR724X_DDR_DIV_SHIFT		22
+#define	AR724X_DDR_DIV_MASK		0x3
+
+#define	AR724X_PLL_VAL_1000		0x00110000
+#define	AR724X_PLL_VAL_100		0x00001099
+#define	AR724X_PLL_VAL_10		0x00991099
+
+#define	AR724X_BASE_FREQ		5000000
+
+/* XXX so USB requires different init code? -adrian */
+#define	AR7240_OHCI_BASE		0x1b000000
+#define	AR7240_OHCI_SIZE		0x01000000
+#define	AR724X_DDR_REG_FLUSH_USB	(AR71XX_DDR_CONFIG + 0x84)
+
+#define	AR724X_PCI_CRP_BASE		(AR71XX_APB_BASE + 0x000C0000)
+#define	AR724X_PCI_CRP_SIZE		0x100
+
+#define	AR724X_PCI_CTRL_BASE		(AR71XX_APB_BASE + 0x000F0000)
+#define	AR724X_PCI_CTRL_SIZE		0x100
+
+#define	AR724X_GPIO_FUNC_GE0_MII_CLK_EN		(1 >> 19)
+#define	AR724X_GPIO_FUNC_SPI_EN			(1 >> 18)
+#define	AR724X_GPIO_FUNC_SPI_CS_EN2		(1 >> 14)
+#define	AR724X_GPIO_FUNC_SPI_CS_EN1		(1 >> 13)
+#define	AR724X_GPIO_FUNC_CLK_OBS5_EN		(1 >> 12)
+#define	AR724X_GPIO_FUNC_CLK_OBS4_EN		(1 >> 11)
+#define	AR724X_GPIO_FUNC_CLK_OBS3_EN		(1 >> 10)
+#define	AR724X_GPIO_FUNC_CLK_OBS2_EN		(1 >> 9)
+#define	AR724X_GPIO_FUNC_CLK_OBS1_EN		(1 >> 8)
+#define	AR724X_GPIO_FUNC_ETH_SWITCH_LED4_EN	(1 >> 7)
+#define	AR724X_GPIO_FUNC_ETH_SWITCH_LED3_EN	(1 >> 6)
+#define	AR724X_GPIO_FUNC_ETH_SWITCH_LED2_EN	(1 >> 5)
+#define	AR724X_GPIO_FUNC_ETH_SWITCH_LED1_EN	(1 >> 4)
+#define	AR724X_GPIO_FUNC_ETH_SWITCH_LED0_EN	(1 >> 3)
+#define	AR724X_GPIO_FUNC_UART_RTS_CTS_EN	(1 >> 2)
+#define	AR724X_GPIO_FUNC_UART_EN		(1 >> 1)
+#define	AR724X_GPIO_FUNC_JTAG_DISABLE		(1 >> 0)
+
+#define	AR724X_GPIO_COUNT		18
+
+#endif

Added: head/sys/mips/atheros/ar91xxreg.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/mips/atheros/ar91xxreg.h	Wed Aug 18 00:26:14 2010	(r211440)
@@ -0,0 +1,83 @@
+/*-
+ * Copyright (c) 2010 Adrian Chadd
+ * 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$ */
+
+#ifndef	__AR91XX_REG_H__
+#define	__AR91XX_REG_H__
+
+#define	AR91XX_BASE_FREQ		5000000
+
+/* reset block */
+#define	AR91XX_RESET_REG_RESET_MODULE	AR71XX_RST_BLOCK_BASE + 0x1c
+
+/* PLL block */
+#define	AR91XX_PLL_REG_CPU_CONFIG       AR71XX_PLL_CPU_BASE + 0x00
+#define	AR91XX_PLL_REG_ETH_CONFIG       AR71XX_PLL_CPU_BASE + 0x04
+#define	AR91XX_PLL_REG_ETH0_INT_CLOCK   AR71XX_PLL_CPU_BASE + 0x14
+#define	AR91XX_PLL_REG_ETH1_INT_CLOCK   AR71XX_PLL_CPU_BASE + 0x18
+
+#define	AR91XX_PLL_DIV_SHIFT		0
+#define	AR91XX_PLL_DIV_MASK		0x3ff
+#define	AR91XX_DDR_DIV_SHIFT		22
+#define	AR91XX_DDR_DIV_MASK		0x3
+#define	AR91XX_AHB_DIV_SHIFT		19
+#define	AR91XX_AHB_DIV_MASK		0x1
+
+#define	AR91XX_ETH0_PLL_SHIFT		20
+#define	AR91XX_ETH1_PLL_SHIFT		22
+
+#define	AR91XX_PLL_VAL_1000		0x1a000000
+#define	AR91XX_PLL_VAL_100		0x13000a44
+#define	AR91XX_PLL_VAL_10		0x00441099
+
+/* DDR block */
+#define	AR91XX_DDR_CTRLBASE		(AR71XX_APB_BASE + 0)
+#define	AR91XX_DDR_CTRL_SIZE		0x10000
+#define	AR91XX_DDR_REG_FLUSH_GE0	AR91XX_DDR_CTRLBASE + 0x7c
+#define	AR91XX_DDR_REG_FLUSH_GE1	AR91XX_DDR_CTRLBASE + 0x80
+#define	AR91XX_DDR_REG_FLUSH_USB	AR91XX_DDR_CTRLBASE + 0x84
+#define	AR91XX_DDR_REG_FLUSH_WMAC	AR91XX_DDR_CTRLBASE + 0x88
+
+/* WMAC stuff */
+#define	AR91XX_WMAC_BASE		(AR71XX_APB_BASE + 0x000C0000)
+#define	AR91XX_WMAC_SIZE		0x30000
+
+/* GPIO stuff */
+#define	AR91XX_GPIO_FUNC_WMAC_LED_EN	(1 << 22)
+#define	AR91XX_GPIO_FUNC_EXP_PORT_CS_EN	(1 << 21)
+#define	AR91XX_GPIO_FUNC_I2S_REFCLKEN	(1 << 20)
+#define	AR91XX_GPIO_FUNC_I2S_MCKEN	(1 << 19)
+#define	AR91XX_GPIO_FUNC_I2S1_EN	(1 << 18)
+#define	AR91XX_GPIO_FUNC_I2S0_EN	(1 << 17)
+#define	AR91XX_GPIO_FUNC_SLIC_EN	(1 << 16)
+#define	AR91XX_GPIO_FUNC_UART_RTSCTS_EN	(1 << 9)
+#define	AR91XX_GPIO_FUNC_UART_EN	(1 << 8)
+#define	AR91XX_GPIO_FUNC_USB_CLK_EN	(1 << 4)
+
+#define	AR91XX_GPIO_COUNT		22
+
+#endif

From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 07:38:13 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CAD581065694;
	Wed, 18 Aug 2010 07:38:13 +0000 (UTC)
	(envelope-from jchandra@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9FEB08FC21;
	Wed, 18 Aug 2010 07:38:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7I7cDeZ058551;
	Wed, 18 Aug 2010 07:38:13 GMT
	(envelope-from jchandra@svn.freebsd.org)
Received: (from jchandra@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7I7cDhh058549;
	Wed, 18 Aug 2010 07:38:13 GMT
	(envelope-from jchandra@svn.freebsd.org)
Message-Id: <201008180738.o7I7cDhh058549@svn.freebsd.org>
From: "Jayachandran C." 
Date: Wed, 18 Aug 2010 07:38: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: r211445 - 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: Wed, 18 Aug 2010 07:38:13 -0000

Author: jchandra
Date: Wed Aug 18 07:38:13 2010
New Revision: 211445
URL: http://svn.freebsd.org/changeset/base/211445

Log:
  Make return statements style(9) compliant in MIPS pmap.c
  
  Reported by: neel
  
  Reviewed by:	neel (earlier version)

Modified:
  head/sys/mips/mips/pmap.c

Modified: head/sys/mips/mips/pmap.c
==============================================================================
--- head/sys/mips/mips/pmap.c	Wed Aug 18 07:37:16 2010	(r211444)
+++ head/sys/mips/mips/pmap.c	Wed Aug 18 07:38:13 2010	(r211445)
@@ -267,6 +267,7 @@ static struct local_sysmaps sysmap_lmem[
 static __inline pd_entry_t *
 pmap_segmap(pmap_t pmap, vm_offset_t va)
 {
+
 	return (&pmap->pm_segtab[pmap_seg_index(va)]);
 }
 
@@ -295,13 +296,15 @@ pmap_pde(pmap_t pmap, vm_offset_t va)
 static __inline pd_entry_t *
 pmap_pdpe_to_pde(pd_entry_t *pdpe, vm_offset_t va)
 {
-	return pdpe;
+
+	return (pdpe);
 }
 
 static __inline 
 pd_entry_t *pmap_pde(pmap_t pmap, vm_offset_t va)
 {
-	return pmap_segmap(pmap, va);
+
+	return (pmap_segmap(pmap, va));
 }
 #endif
 
@@ -356,7 +359,7 @@ pmap_steal_memory(vm_size_t size)
 	}
 	va = MIPS_PHYS_TO_KSEG0(pa);
 	bzero((caddr_t)va, size);
-	return va;
+	return (va);
 }
 
 /*
@@ -750,7 +753,7 @@ pmap_extract(pmap_t pmap, vm_offset_t va
 		retval = TLBLO_PTE_TO_PA(*pte) | (va & PAGE_MASK);
 	}
 	PMAP_UNLOCK(pmap);
-	return retval;
+	return (retval);
 }
 
 /*
@@ -1007,7 +1010,7 @@ pmap_unuse_pt(pmap_t pmap, vm_offset_t v
 			pmap->pm_ptphint = mpte;
 		}
 	}
-	return pmap_unwire_pte_hold(pmap, va, mpte);
+	return (pmap_unwire_pte_hold(pmap, va, mpte));
 }
 
 void
@@ -1561,7 +1564,7 @@ pmap_remove_pte(struct pmap *pmap, pt_en
 
 		pmap_remove_entry(pmap, m, va);
 	}
-	return pmap_unuse_pt(pmap, va, NULL);
+	return (pmap_unuse_pt(pmap, va, NULL));
 }
 
 /*
@@ -2609,10 +2612,10 @@ pmap_testbit(vm_page_t m, int bit)
 	boolean_t rv = FALSE;
 
 	if (m->flags & PG_FICTITIOUS)
-		return rv;
+		return (rv);
 
 	if (TAILQ_FIRST(&m->md.pv_list) == NULL)
-		return rv;
+		return (rv);
 
 	mtx_assert(&vm_page_queue_mtx, MA_OWNED);
 	TAILQ_FOREACH(pv, &m->md.pv_list, pv_list) {
@@ -2933,7 +2936,7 @@ pmap_mapdev(vm_offset_t pa, vm_size_t si
 	 * pa > 0x20000000 we should make proper mapping * using pmap_kenter.
 	 */
 	if ((pa + size - 1) < MIPS_KSEG0_LARGEST_PHYS)
-		return (void *)MIPS_PHYS_TO_KSEG1(pa);
+		return ((void *)MIPS_PHYS_TO_KSEG1(pa));
 	else {
 		offset = pa & PAGE_MASK;
 		size = roundup(size + offset, PAGE_SIZE);
@@ -3239,11 +3242,11 @@ page_is_managed(vm_offset_t pa)
 
 		m = PHYS_TO_VM_PAGE(pa);
 		if (m == NULL)
-			return 0;
+			return (0);
 		if ((m->flags & (PG_FICTITIOUS | PG_UNMANAGED)) == 0)
-			return 1;
+			return (1);
 	}
-	return 0;
+	return (0);
 }
 
 static int

From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 08:22:09 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 82EC11065742;
	Wed, 18 Aug 2010 08:22: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 726E18FC21;
	Wed, 18 Aug 2010 08:22:09 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7I8M9RC059567;
	Wed, 18 Aug 2010 08:22:09 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7I8M9F9059565;
	Wed, 18 Aug 2010 08:22:09 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201008180822.o7I8M9F9059565@svn.freebsd.org>
From: Adrian Chadd 
Date: Wed, 18 Aug 2010 08:22: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: r211447 - head/sys/mips/atheros
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 18 Aug 2010 08:22:09 -0000

Author: adrian
Date: Wed Aug 18 08:22:09 2010
New Revision: 211447
URL: http://svn.freebsd.org/changeset/base/211447

Log:
  Bring over the first cut of the Atheros-specific SoC operations.
  
  Each of these SoCs have different devices, different hardware initialisation
  methods and, quite likely, different quirks. These functions will abstract
  out the SoC differences and keep these differences out of the drivers (eg
  USB init, if_arge, etc.)

Added:
  head/sys/mips/atheros/ar71xx_cpudef.h   (contents, props changed)

Added: head/sys/mips/atheros/ar71xx_cpudef.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/mips/atheros/ar71xx_cpudef.h	Wed Aug 18 08:22:09 2010	(r211447)
@@ -0,0 +1,108 @@
+/*-
+ * Copyright (c) 2010 Adrian Chadd
+ * 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$ */
+
+#ifndef	__AR71XX_CPUDEF_H__
+#define	__AR71XX_CPUDEF_H__
+
+struct ar71xx_cpu_def {
+	void (* detect_mem_size) (void);
+	void (* detect_sys_frequency) (void);
+	void (* ar71xx_chip_device_stop) (uint32_t);
+	void (* ar71xx_chip_device_start) (uint32_t);
+	int (* ar71xx_chip_device_stopped) (uint32_t);
+	void (* ar71xx_chip_set_pll_ge0) (int);
+	void (* ar71xx_chip_set_pll_ge1) (int);
+	void (* ar71xx_chip_ddr_flush_ge0) (void);
+	void (* ar71xx_chip_ddr_flush_ge1) (void);
+	uint32_t (* ar71xx_chip_get_eth_pll) (unsigned int, int);
+
+	/*
+	 * From Linux - Handling this IRQ is a bit special.
+	 * AR71xx - AR71XX_DDR_REG_FLUSH_PCI
+	 * AR724x - AR724X_DDR_REG_FLUSH_PCIE
+	 * AR91xx - AR91XX_DDR_REG_FLUSH_WMAC
+	 *
+	 * These are set when STATUSF_IP2 is set in regiser c0.
+	 * This flush is done before the IRQ is handled to make
+	 * sure the driver correctly sees any memory updates.
+	 */
+	void (* ar71xx_chip_irq_flush_ip2) (void);
+	/*
+	 * The USB peripheral init code is subtly different for
+	 * each chip.
+	 */
+	void (* ar71xx_chip_init_usb_peripheral) (void);
+};
+
+extern struct ar71xx_cpu_def * ar71xx_cpu_ops;
+
+static inline void ar71xx_detect_sys_frequency(void)
+{
+	ar71xx_cpu_ops->detect_sys_frequency();
+}
+
+static inline void ar71xx_device_stop(uint32_t mask)
+{
+	ar71xx_cpu_ops->ar71xx_chip_device_stop(mask);
+}
+
+static inline void ar71xx_device_start(uint32_t mask)
+{
+	ar71xx_cpu_ops->ar71xx_chip_device_start(mask);
+}
+
+static inline int ar71xx_device_stopped(uint32_t mask)
+{
+	return ar71xx_cpu_ops->ar71xx_chip_device_stopped(mask);
+}
+
+static inline void ar71xx_device_flush_ddr_ge0(void)
+{
+	ar71xx_cpu_ops->ar71xx_chip_ddr_flush_ge0();
+}
+
+static inline void ar71xx_device_flush_ddr_ge1(void)
+{
+	ar71xx_cpu_ops->ar71xx_chip_ddr_flush_ge1();
+}
+
+static inline void ar71xx_init_usb_peripheral(void)
+{
+	ar71xx_cpu_ops->ar71xx_chip_init_usb_peripheral();
+}
+
+/* XXX shouldn't be here! */
+extern uint32_t u_ar71xx_cpu_freq;
+extern uint32_t u_ar71xx_ahb_freq;
+extern uint32_t u_ar71xx_ddr_freq;
+
+static inline uint64_t ar71xx_cpu_freq(void) { return u_ar71xx_cpu_freq; }
+static inline uint64_t ar71xx_ahb_freq(void) { return u_ar71xx_ahb_freq; }
+static inline uint64_t ar71xx_ddr_freq(void) { return u_ar71xx_ddr_freq; }
+ 
+#endif

From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 08:22:58 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B675F1065674;
	Wed, 18 Aug 2010 08:22:58 +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 A6BA48FC15;
	Wed, 18 Aug 2010 08:22:58 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7I8MwoM059617;
	Wed, 18 Aug 2010 08:22:58 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7I8MwqQ059615;
	Wed, 18 Aug 2010 08:22:58 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201008180822.o7I8MwqQ059615@svn.freebsd.org>
From: Adrian Chadd 
Date: Wed, 18 Aug 2010 08:22: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: r211448 - head/sys/mips/atheros
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 18 Aug 2010 08:22:58 -0000

Author: adrian
Date: Wed Aug 18 08:22:58 2010
New Revision: 211448
URL: http://svn.freebsd.org/changeset/base/211448

Log:
  Add a further register definition for USB device initialisation.
  
  Obtained from:	Linux

Modified:
  head/sys/mips/atheros/ar91xxreg.h

Modified: head/sys/mips/atheros/ar91xxreg.h
==============================================================================
--- head/sys/mips/atheros/ar91xxreg.h	Wed Aug 18 08:22:09 2010	(r211447)
+++ head/sys/mips/atheros/ar91xxreg.h	Wed Aug 18 08:22:58 2010	(r211448)
@@ -34,6 +34,8 @@
 /* reset block */
 #define	AR91XX_RESET_REG_RESET_MODULE	AR71XX_RST_BLOCK_BASE + 0x1c
 
+#define	AR91XX_RST_RESET_MODULE_USBSUS_OVERRIDE	(1 << 10)
+
 /* PLL block */
 #define	AR91XX_PLL_REG_CPU_CONFIG       AR71XX_PLL_CPU_BASE + 0x00
 #define	AR91XX_PLL_REG_ETH_CONFIG       AR71XX_PLL_CPU_BASE + 0x04

From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 09:01:50 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A9DFE106566B;
	Wed, 18 Aug 2010 09:01:50 +0000 (UTC) (envelope-from des@des.no)
Received: from smtp.des.no (smtp.des.no [194.63.250.102])
	by mx1.freebsd.org (Postfix) with ESMTP id 670D78FC1B;
	Wed, 18 Aug 2010 09:01:50 +0000 (UTC)
Received: from ds4.des.no (des.no [84.49.246.2])
	by smtp.des.no (Postfix) with ESMTP id 7896B1FFC33;
	Wed, 18 Aug 2010 09:01:49 +0000 (UTC)
Received: by ds4.des.no (Postfix, from userid 1001)
	id 4AFE18454E; Wed, 18 Aug 2010 11:01:49 +0200 (CEST)
From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= 
To: Alexey Dokuchaev 
References: <201008142148.o7ELmMTO039767@svn.freebsd.org>
	<20100817193757.GA92936@FreeBSD.org>
Date: Wed, 18 Aug 2010 11:01:49 +0200
In-Reply-To: <20100817193757.GA92936@FreeBSD.org> (Alexey Dokuchaev's message
	of "Tue, 17 Aug 2010 19:37:57 +0000")
Message-ID: <86hbisb8g2.fsf@ds4.des.no>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Jens Schweikhardt 
Subject: Re: svn commit: r211318 - head/usr.sbin/sysinstall
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 18 Aug 2010 09:01:50 -0000

Alexey Dokuchaev  writes:
> Jens Schweikhardt  writes:
> > Log:
> >   Correctly spell janice and jimmy as janis and jimi (assuming
> >   the famous rock stars meant were Miss Joplin and Mr Hendrix.)
> Are you sure this is correct message for the commit, or I am simply
> missing the irony?

Look at the very end of the patch.

I wonder who Frank is, though - Zappa?

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no

From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 09:11:45 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 993D01065698;
	Wed, 18 Aug 2010 09:11:45 +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 89BF68FC12;
	Wed, 18 Aug 2010 09:11:45 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7I9Bj6E060570;
	Wed, 18 Aug 2010 09:11:45 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7I9Bj1j060568;
	Wed, 18 Aug 2010 09:11:45 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201008180911.o7I9Bj1j060568@svn.freebsd.org>
From: Adrian Chadd 
Date: Wed, 18 Aug 2010 09:11: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: r211449 - head/sys/mips/atheros
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 18 Aug 2010 09:11:45 -0000

Author: adrian
Date: Wed Aug 18 09:11:45 2010
New Revision: 211449
URL: http://svn.freebsd.org/changeset/base/211449

Log:
  Add a DDR flush function, inspired by both Linux and if_arge.c.

Modified:
  head/sys/mips/atheros/ar71xxreg.h

Modified: head/sys/mips/atheros/ar71xxreg.h
==============================================================================
--- head/sys/mips/atheros/ar71xxreg.h	Wed Aug 18 08:22:58 2010	(r211448)
+++ head/sys/mips/atheros/ar71xxreg.h	Wed Aug 18 09:11:45 2010	(r211449)
@@ -491,5 +491,15 @@ ar71xx_ahb_freq(void)
 	return (freq);
 }
 
+static inline void
+ar71xx_ddr_flush(uint32_t reg)
+{ 
+	ATH_WRITE_REG(reg, 1);
+	while ((ATH_READ_REG(reg) & 0x1))
+		;
+	ATH_WRITE_REG(reg, 1);
+	while ((ATH_READ_REG(reg) & 0x1))
+		;
+} 
 
 #endif /* _AR71XX_REG_H_ */

From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 09:18:37 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BD3731065670;
	Wed, 18 Aug 2010 09:18:37 +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 ADC1E8FC08;
	Wed, 18 Aug 2010 09:18:37 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7I9IbAN060741;
	Wed, 18 Aug 2010 09:18:37 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7I9Ib1T060739;
	Wed, 18 Aug 2010 09:18:37 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201008180918.o7I9Ib1T060739@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Wed, 18 Aug 2010 09:18: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: r211450 - 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: Wed, 18 Aug 2010 09:18:37 -0000

Author: des
Date: Wed Aug 18 09:18:37 2010
New Revision: 211450
URL: http://svn.freebsd.org/changeset/base/211450

Log:
  Revert r211436; it was a good idea, but not fully thought out.

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1	Wed Aug 18 09:11:45 2010	(r211449)
+++ head/Makefile.inc1	Wed Aug 18 09:18:37 2010	(r211450)
@@ -814,16 +814,9 @@ buildkernel:
 .endif
 	@echo
 	@echo "--------------------------------------------------------------"
-	@echo ">>> stage 3.2: building the kernel"
+	@echo ">>> stage 3.2: building everything"
 	@echo "--------------------------------------------------------------"
-	cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} kernel-all -DNO_MODULES_OBJ
-	@echo
-.if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules)
-	@echo "--------------------------------------------------------------"
-	@echo ">>> stage 3.3: building the modules"
-	@echo "--------------------------------------------------------------"
-	cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} modules-all -DNO_MODULES_OBJ
-.endif
+	cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} all -DNO_MODULES_OBJ
 	@echo "--------------------------------------------------------------"
 	@echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
 	@echo "--------------------------------------------------------------"

From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 09:28:12 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 758E11065674;
	Wed, 18 Aug 2010 09:28:12 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 662AD8FC1B;
	Wed, 18 Aug 2010 09:28:12 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7I9SCcr061312;
	Wed, 18 Aug 2010 09:28:12 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7I9SCl2061310;
	Wed, 18 Aug 2010 09:28:12 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201008180928.o7I9SCl2061310@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Wed, 18 Aug 2010 09:28: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: r211451 - 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: Wed, 18 Aug 2010 09:28:12 -0000

Author: bz
Date: Wed Aug 18 09:28:12 2010
New Revision: 211451
URL: http://svn.freebsd.org/changeset/base/211451

Log:
  When calculating the expected memory size for userspace, also take the
  number of syncache entries into account for the surplus we add to account
  for a possible increase of records in the re-entry window.
  
  Discussed with:		jhb, silby
  MFC after:		1 week

Modified:
  head/sys/netinet/tcp_subr.c

Modified: head/sys/netinet/tcp_subr.c
==============================================================================
--- head/sys/netinet/tcp_subr.c	Wed Aug 18 09:18:37 2010	(r211450)
+++ head/sys/netinet/tcp_subr.c	Wed Aug 18 09:28:12 2010	(r211451)
@@ -1022,7 +1022,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS)
 	if (req->oldptr == NULL) {
 		m = syncache_pcbcount();
 		n = V_tcbinfo.ipi_count;
-		n += imax(n / 8, 10);
+		n += imax((m + n) / 8, 10);
 		req->oldidx = 2 * (sizeof xig) +
 		    (m + n) * sizeof(struct xtcpcb);
 		return (0);

From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 09:28:43 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 03CC510656C5;
	Wed, 18 Aug 2010 09:28:43 +0000 (UTC) (envelope-from des@des.no)
Received: from smtp.des.no (smtp.des.no [194.63.250.102])
	by mx1.freebsd.org (Postfix) with ESMTP id BAC5A8FC13;
	Wed, 18 Aug 2010 09:28:42 +0000 (UTC)
Received: from ds4.des.no (des.no [84.49.246.2])
	by smtp.des.no (Postfix) with ESMTP id BC3E31FFC33;
	Wed, 18 Aug 2010 09:28:41 +0000 (UTC)
Received: by ds4.des.no (Postfix, from userid 1001)
	id 950768456E; Wed, 18 Aug 2010 11:28:41 +0200 (CEST)
From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= 
To: src-committers@freebsd.org
References: <201008180918.o7I9Ib1T060739@svn.freebsd.org>
Date: Wed, 18 Aug 2010 11:28:41 +0200
In-Reply-To: <201008180918.o7I9Ib1T060739@svn.freebsd.org> (Dag-Erling
	Smorgrav's message of "Wed, 18 Aug 2010 09:18:37 +0000 (UTC)")
Message-ID: <8662z8b77a.fsf@ds4.des.no>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org
Subject: Re: svn commit: r211450 - 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: Wed, 18 Aug 2010 09:28:43 -0000

Dag-Erling Smorgrav  writes:
> Log:
>   Revert r211436; it was a good idea, but not fully thought out.

The probem is that the kernel config may have "makeoptions NO_MODULES",
in which case there is no modules-all target.

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no

From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 12:09:28 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 39D771065672;
	Wed, 18 Aug 2010 12:09:28 +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 2A6FB8FC14;
	Wed, 18 Aug 2010 12:09:28 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7IC9SqJ068298;
	Wed, 18 Aug 2010 12:09:28 GMT (envelope-from pjd@svn.freebsd.org)
Received: (from pjd@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7IC9Shj068296;
	Wed, 18 Aug 2010 12:09:28 GMT (envelope-from pjd@svn.freebsd.org)
Message-Id: <201008181209.o7IC9Shj068296@svn.freebsd.org>
From: Pawel Jakub Dawidek 
Date: Wed, 18 Aug 2010 12:09: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: r211452 - 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: Wed, 18 Aug 2010 12:09:28 -0000

Author: pjd
Date: Wed Aug 18 12:09:27 2010
New Revision: 211452
URL: http://svn.freebsd.org/changeset/base/211452

Log:
  For some setups sending data in 128kB chunks makes communication very slow. No
  idea why. 32kB on the other hand seems to work properly everywhere.
  
  Reported by:	Thomas Steen Rasmussen 
  MFC after:	3 weeks

Modified:
  head/sbin/hastd/proto_common.c

Modified: head/sbin/hastd/proto_common.c
==============================================================================
--- head/sbin/hastd/proto_common.c	Wed Aug 18 09:28:12 2010	(r211451)
+++ head/sbin/hastd/proto_common.c	Wed Aug 18 12:09:27 2010	(r211452)
@@ -42,8 +42,7 @@ __FBSDID("$FreeBSD$");
 
 /* Maximum size of packet we want to use when sending data. */
 #ifndef MAX_SEND_SIZE
-//#define	MAX_SEND_SIZE	32768
-#define	MAX_SEND_SIZE	131072
+#define	MAX_SEND_SIZE	32768
 #endif
 
 int

From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 12:52:22 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 299691065697;
	Wed, 18 Aug 2010 12:52:22 +0000 (UTC)
	(envelope-from jchandra@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 18A1F8FC0A;
	Wed, 18 Aug 2010 12:52:22 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7ICqM3I069249;
	Wed, 18 Aug 2010 12:52:22 GMT
	(envelope-from jchandra@svn.freebsd.org)
Received: (from jchandra@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7ICqMC3069244;
	Wed, 18 Aug 2010 12:52:22 GMT
	(envelope-from jchandra@svn.freebsd.org)
Message-Id: <201008181252.o7ICqMC3069244@svn.freebsd.org>
From: "Jayachandran C." 
Date: Wed, 18 Aug 2010 12:52: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: r211453 - 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: Wed, 18 Aug 2010 12:52:22 -0000

Author: jchandra
Date: Wed Aug 18 12:52:21 2010
New Revision: 211453
URL: http://svn.freebsd.org/changeset/base/211453

Log:
  MIPS n64 support - continued...
  
  1. On n64, use XKPHYS to map page table pages instead of KSEG0. Maintain
     just one freepages list on n64.
  
     The changes are mainly to introduce MIPS_PHYS_TO_DIRECT(pa),
     MIPS_DIRECT_TO_PHYS(), which will use KSEG0 in 32 bit compilation
     and XKPHYS in 64 bit compilation.
  
  2. Change macro based PMAP_LMEM_MAP1(), PMAP_LMEM_MAP2(), PMAP_LMEM_UNMAP()
    to inline functions.
  
  3. Introduce MIPS_DIRECT_MAPPABLE(pa), which will further reduce the cases
     in which we will need to have a special case for 64 bit compilation.
  
  4. Update CP0 hazard definitions for CPU_RMI - the cpu does not need any
     nops
  
  Reviewed by:	neel

Modified:
  head/sys/mips/include/cpuregs.h
  head/sys/mips/include/vmparam.h
  head/sys/mips/mips/exception.S
  head/sys/mips/mips/pmap.c

Modified: head/sys/mips/include/cpuregs.h
==============================================================================
--- head/sys/mips/include/cpuregs.h	Wed Aug 18 12:09:27 2010	(r211452)
+++ head/sys/mips/include/cpuregs.h	Wed Aug 18 12:52:21 2010	(r211453)
@@ -76,8 +76,10 @@
  * Caching of mapped addresses is controlled by bits in the TLB entry.
  */
 
-#define	MIPS_KSEG0_LARGEST_PHYS         (0x20000000)
-#define	MIPS_PHYS_MASK			(0x1fffffff)
+#define	MIPS_KSEG0_LARGEST_PHYS		(0x20000000)
+#define	MIPS_KSEG0_PHYS_MASK		(0x1fffffff)
+#define	MIPS_XKPHYS_LARGEST_PHYS	(0x10000000000)  /* 40 bit PA */
+#define	MIPS_XKPHYS_PHYS_MASK		(0x0ffffffffff)
 
 #ifndef LOCORE
 #define	MIPS_KUSEG_START		0x00000000
@@ -95,8 +97,8 @@
 
 #define	MIPS_PHYS_TO_KSEG0(x)		((uintptr_t)(x) | MIPS_KSEG0_START)
 #define	MIPS_PHYS_TO_KSEG1(x)		((uintptr_t)(x) | MIPS_KSEG1_START)
-#define	MIPS_KSEG0_TO_PHYS(x)		((uintptr_t)(x) & MIPS_PHYS_MASK)
-#define	MIPS_KSEG1_TO_PHYS(x)		((uintptr_t)(x) & MIPS_PHYS_MASK)
+#define	MIPS_KSEG0_TO_PHYS(x)		((uintptr_t)(x) & MIPS_KSEG0_PHYS_MASK)
+#define	MIPS_KSEG1_TO_PHYS(x)		((uintptr_t)(x) & MIPS_KSEG0_PHYS_MASK)
 
 #define	MIPS_IS_KSEG0_ADDR(x)					\
 	(((vm_offset_t)(x) >= MIPS_KSEG0_START) &&		\
@@ -107,9 +109,6 @@
 #define	MIPS_IS_VALID_PTR(x)		(MIPS_IS_KSEG0_ADDR(x) || \
 					    MIPS_IS_KSEG1_ADDR(x))
 
-#define	MIPS_XKPHYS_START		0x8000000000000000
-#define	MIPS_XKPHYS_END			0xbfffffffffffffff
-
 /*
  * Cache Coherency Attributes:
  *	UC:	Uncached.
@@ -180,19 +179,34 @@
 #define	MIPS_PHYS_TO_XKPHYS_UNCACHED(x) \
 	((0x2ULL << 62) | ((unsigned long long)(MIPS_CCA_UNCACHED) << 59) | (x))
 
-#define	MIPS_XKPHYS_TO_PHYS(x)		((x) & 0x07ffffffffffffffULL)
+#define	MIPS_XKPHYS_TO_PHYS(x)		((uintptr_t)(x) & MIPS_XKPHYS_PHYS_MASK)
 
+#define	MIPS_XKPHYS_START		0x8000000000000000
+#define	MIPS_XKPHYS_END			0xbfffffffffffffff
 #define	MIPS_XUSEG_START		0x0000000000000000
 #define	MIPS_XUSEG_END			0x0000010000000000
-
 #define	MIPS_XKSEG_START		0xc000000000000000
 #define	MIPS_XKSEG_END			0xc00000ff80000000
 
+#ifdef __mips_n64
+#define	MIPS_DIRECT_MAPPABLE(pa)	1
+#define	MIPS_PHYS_TO_DIRECT(pa)		MIPS_PHYS_TO_XKPHYS_CACHED(pa)
+#define	MIPS_PHYS_TO_DIRECT_UNCACHED(pa)	MIPS_PHYS_TO_XKPHYS_UNCACHED(pa)
+#define	MIPS_DIRECT_TO_PHYS(va)		MIPS_XKPHYS_TO_PHYS(va)
+#else
+#define	MIPS_DIRECT_MAPPABLE(pa)	((pa) < MIPS_KSEG0_LARGEST_PHYS)
+#define	MIPS_PHYS_TO_DIRECT(pa)		MIPS_PHYS_TO_KSEG0(pa)
+#define	MIPS_PHYS_TO_DIRECT_UNCACHED(pa)	MIPS_PHYS_TO_KSEG1(pa)
+#define	MIPS_DIRECT_TO_PHYS(va)		MIPS_KSEG0_TO_PHYS(va)
+#endif
+
 /* CPU dependent mtc0 hazard hook */
 #ifdef CPU_CNMIPS
 #define	COP0_SYNC  nop; nop; nop; nop; nop;
 #elif defined(CPU_SB1)
 #define COP0_SYNC  ssnop; ssnop; ssnop; ssnop; ssnop; ssnop; ssnop; ssnop; ssnop
+#elif defined(CPU_RMI)
+#define COP0_SYNC
 #else
 /*
  * Pick a reasonable default based on the "typical" spacing described in the

Modified: head/sys/mips/include/vmparam.h
==============================================================================
--- head/sys/mips/include/vmparam.h	Wed Aug 18 12:09:27 2010	(r211452)
+++ head/sys/mips/include/vmparam.h	Wed Aug 18 12:52:21 2010	(r211453)
@@ -96,7 +96,7 @@
 #define	VM_MINUSER_ADDRESS	((vm_offset_t)0x00000000)
 #define	VM_MAX_MMAP_ADDR	VM_MAXUSER_ADDRESS
 
-#if defined(__mips_n64)
+#ifdef __mips_n64
 #define	VM_MAXUSER_ADDRESS	(VM_MINUSER_ADDRESS + (NPDEPG * NBSEG))
 #define	VM_MIN_KERNEL_ADDRESS	((vm_offset_t)0xc000000000000000)
 #define	VM_MAX_KERNEL_ADDRESS	(VM_MIN_KERNEL_ADDRESS + (NPDEPG * NBSEG))
@@ -185,7 +185,7 @@
  *	  allocations use HIGHMEM if available, and then DEFAULT. 
  *	- HIGHMEM for other pages 
  */
-#if 0 /* Not yet, change n64 to use xkphys */
+#ifdef __mips_n64
 #define	VM_NFREELIST		1
 #define	VM_FREELIST_DEFAULT	0
 #define	VM_FREELIST_DIRECT	VM_FREELIST_DEFAULT

Modified: head/sys/mips/mips/exception.S
==============================================================================
--- head/sys/mips/mips/exception.S	Wed Aug 18 12:09:27 2010	(r211452)
+++ head/sys/mips/mips/exception.S	Wed Aug 18 12:52:21 2010	(r211453)
@@ -1167,7 +1167,7 @@ eintrcnt:
 	.text
 VECTOR(MipsCache, unknown)
 	PTR_LA	k0, _C_LABEL(MipsCacheException)
-	li	k1, MIPS_PHYS_MASK
+	li	k1, MIPS_KSEG0_PHYS_MASK
 	and	k0, k1
 	PTR_LI	k1, MIPS_KSEG1_START
 	or	k0, k1

Modified: head/sys/mips/mips/pmap.c
==============================================================================
--- head/sys/mips/mips/pmap.c	Wed Aug 18 12:09:27 2010	(r211452)
+++ head/sys/mips/mips/pmap.c	Wed Aug 18 12:52:21 2010	(r211453)
@@ -198,68 +198,135 @@ static void pmap_invalidate_all_action(v
 static void pmap_update_page_action(void *arg);
 #endif
 
-#if !defined(__mips_n64)
+#ifndef __mips_n64
+/*
+ * This structure is for high memory (memory above 512Meg in 32 bit)
+ * This memory area does not have direct mapping, so we a mechanism to do
+ * temporary per-CPU mapping to access these addresses.
+ *
+ * At bootup we reserve 2 virtual pages per CPU for mapping highmem pages, to 
+ * access a highmem physical address on a CPU, we will disable interrupts and
+ * add the mapping from the reserved virtual address for the CPU to the physical
+ * address in the kernel pagetable.
+ */
 struct local_sysmaps {
-	vm_offset_t base;
-	uint16_t valid1, valid2;
+	vm_offset_t	base;
+	uint32_t	saved_intr;
+	uint16_t	valid1, valid2;
 };
-
-/* This structure is for large memory
- * above 512Meg. We can't (in 32 bit mode)
- * just use the direct mapped MIPS_KSEG0_TO_PHYS()
- * macros since we can't see the memory and must
- * map it in when we need to access it. In 64
- * bit mode this goes away.
- */
 static struct local_sysmaps sysmap_lmem[MAXCPU];
 
-#define	PMAP_LMEM_MAP1(va, phys)					\
-	int cpu;							\
-	struct local_sysmaps *sysm;					\
-	pt_entry_t *pte, npte;						\
-									\
-	intr = intr_disable();						\
-	cpu = PCPU_GET(cpuid);						\
-	sysm = &sysmap_lmem[cpu];					\
-	va = sysm->base;						\
-	npte = TLBLO_PA_TO_PFN(phys) |					\
-	    PTE_D | PTE_V | PTE_G | PTE_W | PTE_C_CACHE;		\
-	pte = pmap_pte(kernel_pmap, va);				\
-	*pte = npte;							\
-	sysm->valid1 = 1
-
-#define	PMAP_LMEM_MAP2(va1, phys1, va2, phys2)				\
-	int cpu;							\
-	struct local_sysmaps *sysm;					\
-	pt_entry_t *pte, npte;						\
-									\
-	intr = intr_disable();						\
-	cpu = PCPU_GET(cpuid);						\
-	sysm = &sysmap_lmem[cpu];					\
-	va1 = sysm->base;						\
-	va2 = sysm->base + PAGE_SIZE;					\
-	npte = TLBLO_PA_TO_PFN(phys1) |					\
-	    PTE_D | PTE_V | PTE_G | PTE_W | PTE_C_CACHE;		\
-	pte = pmap_pte(kernel_pmap, va1);				\
-	*pte = npte;							\
-	npte =  TLBLO_PA_TO_PFN(phys2) |				\
-	    PTE_D | PTE_V | PTE_G | PTE_W | PTE_C_CACHE;		\
-	pte = pmap_pte(kernel_pmap, va2);				\
-	*pte = npte;							\
-	sysm->valid1 = 1;						\
+static __inline void
+pmap_alloc_lmem_map(void)
+{
+	int i;
+
+	for (i = 0; i < MAXCPU; i++) {
+		sysmap_lmem[i].base = virtual_avail;
+		virtual_avail += PAGE_SIZE * 2;
+		sysmap_lmem[i].valid1 = sysmap_lmem[i].valid2 = 0;
+	}
+}
+
+static __inline vm_offset_t
+pmap_lmem_map1(vm_paddr_t phys)
+{
+	struct local_sysmaps *sysm;
+	pt_entry_t *pte, npte;
+	vm_offset_t va;
+	uint32_t intr;
+	int cpu;
+
+	intr = intr_disable();
+	cpu = PCPU_GET(cpuid);
+	sysm = &sysmap_lmem[cpu];
+	sysm->saved_intr = intr;
+	va = sysm->base;
+	npte = TLBLO_PA_TO_PFN(phys) |
+	    PTE_D | PTE_V | PTE_G | PTE_W | PTE_C_CACHE;
+	pte = pmap_pte(kernel_pmap, va);
+	*pte = npte;
+	sysm->valid1 = 1;
+	return (va);
+}
+
+static __inline vm_offset_t
+pmap_lmem_map2(vm_paddr_t phys1, vm_paddr_t phys2)
+{
+	struct local_sysmaps *sysm;
+	pt_entry_t *pte, npte;
+	vm_offset_t va1, va2;
+	uint32_t intr;
+	int cpu;
+
+	intr = intr_disable();
+	cpu = PCPU_GET(cpuid);
+	sysm = &sysmap_lmem[cpu];
+	sysm->saved_intr = intr;
+	va1 = sysm->base;
+	va2 = sysm->base + PAGE_SIZE;
+	npte = TLBLO_PA_TO_PFN(phys1) |
+	    PTE_D | PTE_V | PTE_G | PTE_W | PTE_C_CACHE;
+	pte = pmap_pte(kernel_pmap, va1);
+	*pte = npte;
+	npte =  TLBLO_PA_TO_PFN(phys2) |
+	    PTE_D | PTE_V | PTE_G | PTE_W | PTE_C_CACHE;
+	pte = pmap_pte(kernel_pmap, va2);
+	*pte = npte;
+	sysm->valid1 = 1;
 	sysm->valid2 = 1;
+	return (va1);
+}
 
-#define	PMAP_LMEM_UNMAP()						\
-	pte = pmap_pte(kernel_pmap, sysm->base);			\
-	*pte = PTE_G;							\
-	tlb_invalidate_address(kernel_pmap, sysm->base);		\
-	sysm->valid1 = 0;						\
-	pte = pmap_pte(kernel_pmap, sysm->base + PAGE_SIZE);		\
-	*pte = PTE_G;							\
-	tlb_invalidate_address(kernel_pmap, sysm->base + PAGE_SIZE);	\
-	sysm->valid2 = 0;						\
-	intr_restore(intr)
-#endif
+static __inline void
+pmap_lmem_unmap(void)
+{
+	struct local_sysmaps *sysm;
+	pt_entry_t *pte;
+	int cpu;
+
+	cpu = PCPU_GET(cpuid);
+	sysm = &sysmap_lmem[cpu];
+	pte = pmap_pte(kernel_pmap, sysm->base);
+	*pte = PTE_G;
+	tlb_invalidate_address(kernel_pmap, sysm->base);
+	sysm->valid1 = 0;
+	if (sysm->valid2) {
+		pte = pmap_pte(kernel_pmap, sysm->base + PAGE_SIZE);
+		*pte = PTE_G;
+		tlb_invalidate_address(kernel_pmap, sysm->base + PAGE_SIZE);
+		sysm->valid2 = 0;
+	}
+	intr_restore(sysm->saved_intr);
+}
+#else  /* __mips_n64 */
+
+static __inline void
+pmap_alloc_lmem_map(void)
+{
+}
+
+static __inline vm_offset_t
+pmap_lmem_map1(vm_paddr_t phys)
+{
+
+	return (0);
+}
+
+static __inline vm_offset_t
+pmap_lmem_map2(vm_paddr_t phys1, vm_paddr_t phys2)
+{
+
+	return (0);
+}
+
+static __inline vm_offset_t 
+pmap_lmem_unmap(void)
+{
+
+	return (0);
+}
+#endif /* !__mips_n64 */
 
 /*
  * Page table entry lookup routines.
@@ -354,10 +421,9 @@ pmap_steal_memory(vm_size_t size)
 
 	pa = phys_avail[0];
 	phys_avail[0] += size;
-	if (pa >= MIPS_KSEG0_LARGEST_PHYS) {
+	if (MIPS_DIRECT_MAPPABLE(pa) == 0)
 		panic("Out of memory below 512Meg?");
-	}
-	va = MIPS_PHYS_TO_KSEG0(pa);
+	va = MIPS_PHYS_TO_DIRECT(pa);
 	bzero((caddr_t)va, size);
 	return (va);
 }
@@ -429,9 +495,7 @@ void
 pmap_bootstrap(void)
 {
 	int i;
-#if !defined(__mips_n64)
-	int memory_larger_than_512meg = 0;
-#endif
+	int need_local_mappings = 0; 
 
 	/* Sort. */
 again:
@@ -459,10 +523,13 @@ again:
 		}
 	}
 
-#if !defined(__mips_n64)
-	if (phys_avail[i - 1] >= MIPS_KSEG0_LARGEST_PHYS)
-		memory_larger_than_512meg = 1;
-#endif
+       	/*
+	 * In 32 bit, we may have memory which cannot be mapped directly
+	 * this memory will need temporary mapping before it can be
+	 * accessed.
+	 */
+	if (!MIPS_DIRECT_MAPPABLE(phys_avail[i - 1]))
+		need_local_mappings = 1;
 
 	/*
 	 * Copy the phys_avail[] array before we start stealing memory from it.
@@ -521,22 +588,8 @@ again:
 		printf("pcpu is available at virtual address %p.\n", pcpup);
 #endif
 
-#if !defined(__mips_n64)
-	/*
-	 * Steal some virtual space that will not be in kernel_segmap. This
-	 * va memory space will be used to map in kernel pages that are
-	 * outside the 512Meg region. Note that we only do this steal when
-	 * we do have memory in this region, that way for systems with
-	 * smaller memory we don't "steal" any va ranges :-)
-	 */
-	if (memory_larger_than_512meg) {
-		for (i = 0; i < MAXCPU; i++) {
-			sysmap_lmem[i].base = virtual_avail;
-			virtual_avail += PAGE_SIZE * 2;
-			sysmap_lmem[i].valid1 = sysmap_lmem[i].valid2 = 0;
-		}
-	}
-#endif
+	if (need_local_mappings)
+		pmap_alloc_lmem_map();
 	pmap_create_kernel_pagetable();
 	pmap_max_asid = VMNUM_PIDS;
 	mips_wr_entryhi(0);
@@ -850,20 +903,13 @@ pmap_kremove(vm_offset_t va)
  *
  *	Use XKPHYS for 64 bit, and KSEG0 where possible for 32 bit.
  */
-#if defined(__mips_n64)
-vm_offset_t
-pmap_map(vm_offset_t *virt, vm_offset_t start, vm_offset_t end, int prot)
-{
-	return (MIPS_PHYS_TO_XKPHYS_CACHED(start));
-}
-#else
 vm_offset_t
 pmap_map(vm_offset_t *virt, vm_offset_t start, vm_offset_t end, int prot)
 {
 	vm_offset_t va, sva;
 
-	if (end <= MIPS_KSEG0_LARGEST_PHYS)
-		return (MIPS_PHYS_TO_KSEG0(start));
+	if (MIPS_DIRECT_MAPPABLE(end))
+		return (MIPS_PHYS_TO_DIRECT(start));
 
 	va = sva = *virt;
 	while (start < end) {
@@ -874,7 +920,6 @@ pmap_map(vm_offset_t *virt, vm_offset_t 
 	*virt = va;
 	return (sva);
 }
-#endif
 
 /*
  * Add a list of wired pages to the kva
@@ -971,7 +1016,7 @@ _pmap_unwire_pte_hold(pmap_t pmap, vm_of
 		 * Recursively decrement next level pagetable refcount
 		 */
 		pdp = (pd_entry_t *)*pmap_segmap(pmap, va);
-		pdpg = PHYS_TO_VM_PAGE(MIPS_KSEG0_TO_PHYS(pdp));
+		pdpg = PHYS_TO_VM_PAGE(MIPS_DIRECT_TO_PHYS(pdp));
 		pmap_unwire_pte_hold(pmap, va, pdpg);
 	}
 #endif
@@ -1006,7 +1051,7 @@ pmap_unuse_pt(pmap_t pmap, vm_offset_t v
 			mpte = pmap->pm_ptphint;
 		} else {
 			pteva = *pmap_pde(pmap, va);
-			mpte = PHYS_TO_VM_PAGE(MIPS_KSEG0_TO_PHYS(pteva));
+			mpte = PHYS_TO_VM_PAGE(MIPS_DIRECT_TO_PHYS(pteva));
 			pmap->pm_ptphint = mpte;
 		}
 	}
@@ -1035,7 +1080,11 @@ static void
 pmap_grow_pte_page_cache()
 {
 
+#ifdef __mips_n64
+	vm_contig_grow_cache(3, 0, MIPS_XKPHYS_LARGEST_PHYS);
+#else
 	vm_contig_grow_cache(3, 0, MIPS_KSEG0_LARGEST_PHYS);
+#endif
 }
 
 static vm_page_t
@@ -1075,7 +1124,7 @@ pmap_pinit(pmap_t pmap)
 	while ((ptdpg = pmap_alloc_pte_page(NUSERPGTBLS, VM_ALLOC_NORMAL)) == NULL)
 	       pmap_grow_pte_page_cache();
 
-	ptdva = MIPS_PHYS_TO_KSEG0(VM_PAGE_TO_PHYS(ptdpg));
+	ptdva = MIPS_PHYS_TO_DIRECT(VM_PAGE_TO_PHYS(ptdpg));
 	pmap->pm_segtab = (pd_entry_t *)ptdva;
 	pmap->pm_active = 0;
 	pmap->pm_ptphint = NULL;
@@ -1126,7 +1175,7 @@ _pmap_allocpte(pmap_t pmap, unsigned pte
 	 * Map the pagetable page into the process address space, if it
 	 * isn't already there.
 	 */
-	pageva = MIPS_PHYS_TO_KSEG0(VM_PAGE_TO_PHYS(m));
+	pageva = MIPS_PHYS_TO_DIRECT(VM_PAGE_TO_PHYS(m));
 
 #ifdef __mips_n64
 	if (ptepindex >= NUPDE) {
@@ -1149,7 +1198,7 @@ _pmap_allocpte(pmap_t pmap, unsigned pte
 				return (NULL);
 			}
 		} else {
-			pg = PHYS_TO_VM_PAGE(MIPS_KSEG0_TO_PHYS(*pdep));
+			pg = PHYS_TO_VM_PAGE(MIPS_DIRECT_TO_PHYS(*pdep));
 			pg->wire_count++;
 		}
 		/* Next level entry */
@@ -1202,7 +1251,7 @@ retry:
 		    (pmap->pm_ptphint->pindex == ptepindex)) {
 			m = pmap->pm_ptphint;
 		} else {
-			m = PHYS_TO_VM_PAGE(MIPS_KSEG0_TO_PHYS(*pde));
+			m = PHYS_TO_VM_PAGE(MIPS_DIRECT_TO_PHYS(*pde));
 			pmap->pm_ptphint = m;
 		}
 		m->wire_count++;
@@ -1250,7 +1299,7 @@ pmap_release(pmap_t pmap)
 	    pmap->pm_stats.resident_count));
 
 	ptdva = (vm_offset_t)pmap->pm_segtab;
-	ptdpg = PHYS_TO_VM_PAGE(MIPS_KSEG0_TO_PHYS(ptdva));
+	ptdpg = PHYS_TO_VM_PAGE(MIPS_DIRECT_TO_PHYS(ptdva));
 
 	ptdpg->wire_count--;
 	atomic_subtract_int(&cnt.v_wire_count, 1);
@@ -1281,7 +1330,7 @@ pmap_growkernel(vm_offset_t addr)
 			nkpg = pmap_alloc_pte_page(nkpt, VM_ALLOC_INTERRUPT);
 			if (nkpg == NULL)
 				panic("pmap_growkernel: no memory to grow kernel");
-			*pdpe = (pd_entry_t)MIPS_PHYS_TO_KSEG0(VM_PAGE_TO_PHYS(nkpg));
+			*pdpe = (pd_entry_t)MIPS_PHYS_TO_DIRECT(VM_PAGE_TO_PHYS(nkpg));
 			continue; /* try again */
 		}
 #endif
@@ -1302,7 +1351,7 @@ pmap_growkernel(vm_offset_t addr)
 		if (!nkpg)
 			panic("pmap_growkernel: no memory to grow kernel");
 		nkpt++;
-		*pde = (pd_entry_t)MIPS_PHYS_TO_KSEG0(VM_PAGE_TO_PHYS(nkpg));
+		*pde = (pd_entry_t)MIPS_PHYS_TO_DIRECT(VM_PAGE_TO_PHYS(nkpg));
 
 		/*
 		 * The R[4-7]?00 stores only one copy of the Global bit in
@@ -2080,7 +2129,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_
 					mpte = pmap->pm_ptphint;
 				} else {
 					mpte = PHYS_TO_VM_PAGE(
-						MIPS_KSEG0_TO_PHYS(*pde));
+						MIPS_DIRECT_TO_PHYS(*pde));
 					pmap->pm_ptphint = mpte;
 				}
 				mpte->wire_count++;
@@ -2156,30 +2205,21 @@ pmap_enter_quick_locked(pmap_t pmap, vm_
  *
  * Use XKPHYS for 64 bit, and KSEG0 where possible for 32 bit.
  */
-#if defined(__mips_n64)
-void *
-pmap_kenter_temporary(vm_paddr_t pa, int i)
-{
-	return ((void *)MIPS_PHYS_TO_XKPHYS_CACHED(pa));
-}
-void
-pmap_kenter_temporary_free(vm_paddr_t pa)
-{
-}
-#else
 void *
 pmap_kenter_temporary(vm_paddr_t pa, int i)
 {
 	vm_offset_t va;
-	register_t intr;
+
 	if (i != 0)
 		printf("%s: ERROR!!! More than one page of virtual address mapping not supported\n",
 		    __func__);
 
-	if (pa < MIPS_KSEG0_LARGEST_PHYS) {
-		va = MIPS_PHYS_TO_KSEG0(pa);
+	if (MIPS_DIRECT_MAPPABLE(pa)) {
+		va = MIPS_PHYS_TO_DIRECT(pa);
 	} else {
+#ifndef __mips_n64    /* XXX : to be converted to new style */
 		int cpu;
+		register_t intr;
 		struct local_sysmaps *sysm;
 		pt_entry_t *pte, npte;
 
@@ -2199,6 +2239,7 @@ pmap_kenter_temporary(vm_paddr_t pa, int
 		pmap_update_page(kernel_pmap, sysm->base, npte);
 		va = sysm->base;
 		intr_restore(intr);
+#endif
 	}
 	return ((void *)va);
 }
@@ -2206,14 +2247,17 @@ pmap_kenter_temporary(vm_paddr_t pa, int
 void
 pmap_kenter_temporary_free(vm_paddr_t pa)
 {
+#ifndef __mips_n64    /* XXX : to be converted to new style */
 	int cpu;
 	register_t intr;
 	struct local_sysmaps *sysm;
+#endif
 
-	if (pa < MIPS_KSEG0_LARGEST_PHYS) {
+	if (MIPS_DIRECT_MAPPABLE(pa)) {
 		/* nothing to do for this case */
 		return;
 	}
+#ifndef __mips_n64    /* XXX : to be converted to new style */
 	cpu = PCPU_GET(cpuid);
 	sysm = &sysmap_lmem[cpu];
 	if (sysm->valid1) {
@@ -2226,8 +2270,8 @@ pmap_kenter_temporary_free(vm_paddr_t pa
 		intr_restore(intr);
 		sysm->valid1 = 0;
 	}
-}
 #endif
+}
 
 /*
  * Moved the code to Machine Independent
@@ -2336,113 +2380,65 @@ pmap_copy(pmap_t dst_pmap, pmap_t src_pm
  *
  * 	Use XKPHYS for 64 bit, and KSEG0 where possible for 32 bit.
  */
-#if defined (__mips_n64)
-void
-pmap_zero_page(vm_page_t m)
-{
-	vm_offset_t va;
-	vm_paddr_t phys = VM_PAGE_TO_PHYS(m);
-
-	va = MIPS_PHYS_TO_XKPHYS_CACHED(phys);
-	bzero((caddr_t)va, PAGE_SIZE);
-	mips_dcache_wbinv_range(va, PAGE_SIZE);
-}
-#else
 void
 pmap_zero_page(vm_page_t m)
 {
 	vm_offset_t va;
 	vm_paddr_t phys = VM_PAGE_TO_PHYS(m);
-	register_t intr;
-
-	if (phys < MIPS_KSEG0_LARGEST_PHYS) {
-		va = MIPS_PHYS_TO_KSEG0(phys);
 
+	if (MIPS_DIRECT_MAPPABLE(phys)) {
+		va = MIPS_PHYS_TO_DIRECT(phys);
 		bzero((caddr_t)va, PAGE_SIZE);
 		mips_dcache_wbinv_range(va, PAGE_SIZE);
 	} else {
-		PMAP_LMEM_MAP1(va, phys);
-
+		va = pmap_lmem_map1(phys);
 		bzero((caddr_t)va, PAGE_SIZE);
 		mips_dcache_wbinv_range(va, PAGE_SIZE);
-
-		PMAP_LMEM_UNMAP();
+		pmap_lmem_unmap();
 	}
 }
-#endif
+
 /*
  *	pmap_zero_page_area zeros the specified hardware page by mapping
  *	the page into KVM and using bzero to clear its contents.
  *
  *	off and size may not cover an area beyond a single hardware page.
  */
-#if defined (__mips_n64)
-void
-pmap_zero_page_area(vm_page_t m, int off, int size)
-{
-	vm_offset_t va;
-	vm_paddr_t phys = VM_PAGE_TO_PHYS(m);
-
-	va = MIPS_PHYS_TO_XKPHYS_CACHED(phys);
-	bzero((char *)(caddr_t)va + off, size);
-	mips_dcache_wbinv_range(va + off, size);
-}
-#else
 void
 pmap_zero_page_area(vm_page_t m, int off, int size)
 {
 	vm_offset_t va;
 	vm_paddr_t phys = VM_PAGE_TO_PHYS(m);
-	register_t intr;
 
-	if (phys < MIPS_KSEG0_LARGEST_PHYS) {
-		va = MIPS_PHYS_TO_KSEG0(phys);
+	if (MIPS_DIRECT_MAPPABLE(phys)) {
+		va = MIPS_PHYS_TO_DIRECT(phys);
 		bzero((char *)(caddr_t)va + off, size);
 		mips_dcache_wbinv_range(va + off, size);
 	} else {
-		PMAP_LMEM_MAP1(va, phys);
-
+		va = pmap_lmem_map1(phys);
 		bzero((char *)va + off, size);
 		mips_dcache_wbinv_range(va + off, size);
-
-		PMAP_LMEM_UNMAP();
+		pmap_lmem_unmap();
 	}
 }
-#endif
-
-#if defined (__mips_n64)
-void
-pmap_zero_page_idle(vm_page_t m)
-{
-	vm_offset_t va;
-	vm_paddr_t phys = VM_PAGE_TO_PHYS(m);
 
-	va = MIPS_PHYS_TO_XKPHYS_CACHED(phys);
-	bzero((caddr_t)va, PAGE_SIZE);
-	mips_dcache_wbinv_range(va, PAGE_SIZE);
-}
-#else
 void
 pmap_zero_page_idle(vm_page_t m)
 {
 	vm_offset_t va;
 	vm_paddr_t phys = VM_PAGE_TO_PHYS(m);
-	register_t intr;
 
-	if (phys < MIPS_KSEG0_LARGEST_PHYS) {
-		va = MIPS_PHYS_TO_KSEG0(phys);
+	if (MIPS_DIRECT_MAPPABLE(phys)) {
+		va = MIPS_PHYS_TO_DIRECT(phys);
 		bzero((caddr_t)va, PAGE_SIZE);
 		mips_dcache_wbinv_range(va, PAGE_SIZE);
 	} else {
-		PMAP_LMEM_MAP1(va, phys);
-
+		va = pmap_lmem_map1(phys);
 		bzero((caddr_t)va, PAGE_SIZE);
 		mips_dcache_wbinv_range(va, PAGE_SIZE);
-
-		PMAP_LMEM_UNMAP();
+		pmap_lmem_unmap();
 	}
 }
-#endif
 
 /*
  *	pmap_copy_page copies the specified (machine independent)
@@ -2452,31 +2448,14 @@ pmap_zero_page_idle(vm_page_t m)
  *
  * 	Use XKPHYS for 64 bit, and KSEG0 where possible for 32 bit.
  */
-#if defined (__mips_n64)
-void
-pmap_copy_page(vm_page_t src, vm_page_t dst)
-{
-	vm_offset_t va_src, va_dst;
-	vm_paddr_t phy_src = VM_PAGE_TO_PHYS(src);
-	vm_paddr_t phy_dst = VM_PAGE_TO_PHYS(dst);
-
-	pmap_flush_pvcache(src);
-	mips_dcache_wbinv_range_index(MIPS_PHYS_TO_XKPHYS_CACHED(phy_dst), PAGE_SIZE);
-	va_src = MIPS_PHYS_TO_XKPHYS_CACHED(phy_src);
-	va_dst = MIPS_PHYS_TO_XKPHYS_CACHED(phy_dst);
-	bcopy((caddr_t)va_src, (caddr_t)va_dst, PAGE_SIZE);
-	mips_dcache_wbinv_range(va_dst, PAGE_SIZE);
-}
-#else
 void
 pmap_copy_page(vm_page_t src, vm_page_t dst)
 {
 	vm_offset_t va_src, va_dst;
-	vm_paddr_t phy_src = VM_PAGE_TO_PHYS(src);
-	vm_paddr_t phy_dst = VM_PAGE_TO_PHYS(dst);
-	register_t intr;
+	vm_paddr_t phys_src = VM_PAGE_TO_PHYS(src);
+	vm_paddr_t phys_dst = VM_PAGE_TO_PHYS(dst);
 
-	if ((phy_src < MIPS_KSEG0_LARGEST_PHYS) && (phy_dst < MIPS_KSEG0_LARGEST_PHYS)) {
+	if (MIPS_DIRECT_MAPPABLE(phys_src) && MIPS_DIRECT_MAPPABLE(phys_dst)) {
 		/* easy case, all can be accessed via KSEG0 */
 		/*
 		 * Flush all caches for VA that are mapped to this page
@@ -2484,21 +2463,19 @@ pmap_copy_page(vm_page_t src, vm_page_t 
 		 */
 		pmap_flush_pvcache(src);
 		mips_dcache_wbinv_range_index(
-		    MIPS_PHYS_TO_KSEG0(phy_dst), PAGE_SIZE);
-		va_src = MIPS_PHYS_TO_KSEG0(phy_src);
-		va_dst = MIPS_PHYS_TO_KSEG0(phy_dst);
+		    MIPS_PHYS_TO_DIRECT(phys_dst), PAGE_SIZE);
+		va_src = MIPS_PHYS_TO_DIRECT(phys_src);
+		va_dst = MIPS_PHYS_TO_DIRECT(phys_dst);
 		bcopy((caddr_t)va_src, (caddr_t)va_dst, PAGE_SIZE);
 		mips_dcache_wbinv_range(va_dst, PAGE_SIZE);
 	} else {
-		PMAP_LMEM_MAP2(va_src, phy_src, va_dst, phy_dst);
-
+		va_src = pmap_lmem_map2(phys_src, phys_dst);
+		va_dst = va_src + PAGE_SIZE;
 		bcopy((void *)va_src, (void *)va_dst, PAGE_SIZE);
 		mips_dcache_wbinv_range(va_dst, PAGE_SIZE);
-
-		PMAP_LMEM_UNMAP();
+		pmap_lmem_unmap();
 	}
 }
-#endif
 
 /*
  * Returns true if the pmap's pv is one of the first
@@ -2914,18 +2891,6 @@ pmap_clear_reference(vm_page_t m)
  *
  * Use XKPHYS uncached for 64 bit, and KSEG1 where possible for 32 bit.
  */
-#if defined(__mips_n64)
-void *
-pmap_mapdev(vm_offset_t pa, vm_size_t size)
-{
-	return ((void *)MIPS_PHYS_TO_XKPHYS_UNCACHED(pa));
-}
-
-void
-pmap_unmapdev(vm_offset_t va, vm_size_t size)
-{
-}
-#else
 void *
 pmap_mapdev(vm_offset_t pa, vm_size_t size)
 {
@@ -2935,8 +2900,8 @@ pmap_mapdev(vm_offset_t pa, vm_size_t si
 	 * KSEG1 maps only first 512M of phys address space. For 
 	 * pa > 0x20000000 we should make proper mapping * using pmap_kenter.
 	 */
-	if ((pa + size - 1) < MIPS_KSEG0_LARGEST_PHYS)
-		return ((void *)MIPS_PHYS_TO_KSEG1(pa));
+	if (MIPS_DIRECT_MAPPABLE(pa + size - 1))
+		return ((void *)MIPS_PHYS_TO_DIRECT_UNCACHED(pa));
 	else {
 		offset = pa & PAGE_MASK;
 		size = roundup(size + offset, PAGE_SIZE);
@@ -2959,6 +2924,7 @@ pmap_mapdev(vm_offset_t pa, vm_size_t si
 void
 pmap_unmapdev(vm_offset_t va, vm_size_t size)
 {
+#ifndef __mips_n64
 	vm_offset_t base, offset, tmpva;
 
 	/* If the address is within KSEG1 then there is nothing to do */
@@ -2971,8 +2937,8 @@ pmap_unmapdev(vm_offset_t va, vm_size_t 
 	for (tmpva = base; tmpva < base + size; tmpva += PAGE_SIZE)
 		pmap_kremove(tmpva);
 	kmem_free(kernel_map, base, size);
-}
 #endif
+}
 
 /*
  * perform the pmap work for mincore

From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 14:41:35 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1133C1065693;
	Wed, 18 Aug 2010 14:41:35 +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 DA8728FC21;
	Wed, 18 Aug 2010 14:41:34 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7IEfYIb071600;
	Wed, 18 Aug 2010 14:41:34 GMT (envelope-from jh@svn.freebsd.org)
Received: (from jh@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7IEfY4e071598;
	Wed, 18 Aug 2010 14:41:34 GMT (envelope-from jh@svn.freebsd.org)
Message-Id: <201008181441.o7IEfY4e071598@svn.freebsd.org>
From: Jaakko Heinonen 
Date: Wed, 18 Aug 2010 14:41:34 +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: r211454 - stable/7/sbin/bsdlabel
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 18 Aug 2010 14:41:35 -0000

Author: jh
Date: Wed Aug 18 14:41:34 2010
New Revision: 211454
URL: http://svn.freebsd.org/changeset/base/211454

Log:
  MFC r209614:
  
  - Don't assign the return value from read(2) to a variable of type
    int.
  - Use errx(3) instead of err(3) to print the error message on short
    reads in readlabel(). errno won't be set on short reads which can
    easily occur here due to the fixed size read request.
  
  PR:		144307

Modified:
  stable/7/sbin/bsdlabel/bsdlabel.c
Directory Properties:
  stable/7/sbin/bsdlabel/   (props changed)

Modified: stable/7/sbin/bsdlabel/bsdlabel.c
==============================================================================
--- stable/7/sbin/bsdlabel/bsdlabel.c	Wed Aug 18 12:52:21 2010	(r211453)
+++ stable/7/sbin/bsdlabel/bsdlabel.c	Wed Aug 18 14:41:34 2010	(r211454)
@@ -334,7 +334,7 @@ makelabel(const char *type, struct diskl
 static void
 readboot(void)
 {
-	int fd, i;
+	int fd;
 	struct stat st;
 	uint64_t *p;
 
@@ -345,8 +345,7 @@ readboot(void)
 		err(1, "cannot open %s", xxboot);
 	fstat(fd, &st);
 	if (alphacksum && st.st_size <= BBSIZE - 512) {
-		i = read(fd, bootarea + 512, st.st_size);
-		if (i != st.st_size)
+		if (read(fd, bootarea + 512, st.st_size) != st.st_size)
 			err(1, "read error %s", xxboot);
 
 		/*
@@ -359,8 +358,7 @@ readboot(void)
 		p[62] = 0;
 		return;
 	} else if ((!alphacksum) && st.st_size <= BBSIZE) {
-		i = read(fd, bootarea, st.st_size);
-		if (i != st.st_size)
+		if (read(fd, bootarea, st.st_size) != st.st_size)
 			err(1, "read error %s", xxboot);
 		return;
 	}
@@ -466,6 +464,7 @@ get_file_parms(int f)
 static int
 readlabel(int flag)
 {
+	ssize_t nbytes;
 	int f, i;
 	int error;
 	struct gctl_req *grq;
@@ -484,8 +483,11 @@ readlabel(int flag)
 		errx(1,
 		    "disks with more than 2^32-1 sectors are not supported");
 	(void)lseek(f, (off_t)0, SEEK_SET);
-	if (read(f, bootarea, BBSIZE) != BBSIZE)
+	nbytes = read(f, bootarea, BBSIZE);
+	if (nbytes == -1)
 		err(4, "%s read", specname);
+	if (nbytes != BBSIZE)
+		errx(4, "couldn't read %d bytes from %s", BBSIZE, specname);
 	close (f);
 	error = bsd_disklabel_le_dec(
 	    bootarea + (labeloffset + labelsoffset * secsize),

From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 15:38:11 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 438441065697;
	Wed, 18 Aug 2010 15:38:11 +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 33D8B8FC08;
	Wed, 18 Aug 2010 15:38:11 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7IFcB34072870;
	Wed, 18 Aug 2010 15:38:11 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7IFcBm2072868;
	Wed, 18 Aug 2010 15:38:11 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201008181538.o7IFcBm2072868@svn.freebsd.org>
From: Alexander Motin 
Date: Wed, 18 Aug 2010 15:38: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: r211455 - head/sys/geom/mirror
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 18 Aug 2010 15:38:11 -0000

Author: mav
Date: Wed Aug 18 15:38:10 2010
New Revision: 211455
URL: http://svn.freebsd.org/changeset/base/211455

Log:
  Remove bintime_cmp() function, unused since r200086.
  
  MFC after:	1 week

Modified:
  head/sys/geom/mirror/g_mirror.c

Modified: head/sys/geom/mirror/g_mirror.c
==============================================================================
--- head/sys/geom/mirror/g_mirror.c	Wed Aug 18 14:41:34 2010	(r211454)
+++ head/sys/geom/mirror/g_mirror.c	Wed Aug 18 15:38:10 2010	(r211455)
@@ -844,21 +844,6 @@ g_mirror_unidle(struct g_mirror_softc *s
 	}
 }
 
-static __inline int
-bintime_cmp(struct bintime *bt1, struct bintime *bt2)
-{
-
-	if (bt1->sec < bt2->sec)
-		return (-1);
-	else if (bt1->sec > bt2->sec)
-		return (1);
-	if (bt1->frac < bt2->frac)
-		return (-1);
-	else if (bt1->frac > bt2->frac)
-		return (1);
-	return (0);
-}
-
 static void
 g_mirror_done(struct bio *bp)
 {

From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 15:49:44 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F06391065674;
	Wed, 18 Aug 2010 15:49:44 +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 DFCC38FC15;
	Wed, 18 Aug 2010 15:49:44 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7IFniDD073230;
	Wed, 18 Aug 2010 15:49:44 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7IFni4g073228;
	Wed, 18 Aug 2010 15:49:44 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201008181549.o7IFni4g073228@svn.freebsd.org>
From: Alexander Motin 
Date: Wed, 18 Aug 2010 15:49: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: r211456 - stable/8/sys/dev/ahci
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 18 Aug 2010 15:49:45 -0000

Author: mav
Date: Wed Aug 18 15:49:44 2010
New Revision: 211456
URL: http://svn.freebsd.org/changeset/base/211456

Log:
  MFC r208813:
  Fix attach errors handling.
  
  Found with:   Coverity Prevent(tm)
  CID:          3424

Modified:
  stable/8/sys/dev/ahci/ahci.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cam/   (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/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/ahci/ahci.c
==============================================================================
--- stable/8/sys/dev/ahci/ahci.c	Wed Aug 18 15:38:10 2010	(r211455)
+++ stable/8/sys/dev/ahci/ahci.c	Wed Aug 18 15:49:44 2010	(r211456)
@@ -892,9 +892,9 @@ ahci_ch_attach(device_t dev)
 	rid = ATA_IRQ_RID;
 	if (!(ch->r_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ,
 	    &rid, RF_SHAREABLE | RF_ACTIVE))) {
-		bus_release_resource(dev, SYS_RES_MEMORY, ch->unit, ch->r_mem);
 		device_printf(dev, "Unable to map interrupt\n");
-		return (ENXIO);
+		error = ENXIO;
+		goto err0;
 	}
 	if ((bus_setup_intr(dev, ch->r_irq, ATA_INTR_FLAGS, NULL,
 	    ahci_ch_intr_locked, dev, &ch->ih))) {
@@ -928,9 +928,10 @@ ahci_ch_attach(device_t dev)
 	    (ch->caps & AHCI_CAP_SNCQ) ? ch->numslots : 0,
 	    devq);
 	if (ch->sim == NULL) {
+		cam_simq_free(devq);
 		device_printf(dev, "unable to allocate sim\n");
 		error = ENOMEM;
-		goto err2;
+		goto err1;
 	}
 	if (xpt_bus_register(ch->sim, dev, 0) != CAM_SUCCESS) {
 		device_printf(dev, "unable to register xpt bus\n");
@@ -957,6 +958,7 @@ err2:
 	cam_sim_free(ch->sim, /*free_devq*/TRUE);
 err1:
 	bus_release_resource(dev, SYS_RES_IRQ, ATA_IRQ_RID, ch->r_irq);
+err0:
 	bus_release_resource(dev, SYS_RES_MEMORY, ch->unit, ch->r_mem);
 	mtx_unlock(&ch->mtx);
 	return (error);

From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 15:51:33 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2B1921065693;
	Wed, 18 Aug 2010 15:51:33 +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 1AD828FC16;
	Wed, 18 Aug 2010 15:51:33 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7IFpWw1073316;
	Wed, 18 Aug 2010 15:51:33 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7IFpW4X073314;
	Wed, 18 Aug 2010 15:51:32 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201008181551.o7IFpW4X073314@svn.freebsd.org>
From: Alexander Motin 
Date: Wed, 18 Aug 2010 15:51: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: r211457 - stable/8/sys/dev/ahci
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 18 Aug 2010 15:51:33 -0000

Author: mav
Date: Wed Aug 18 15:51:32 2010
New Revision: 211457
URL: http://svn.freebsd.org/changeset/base/211457

Log:
  MFC r208814:
  Plug memory leak to silent Coverity. Error is still not really handled.
  
  Found with:   Coverity Prevent(tm)
  CID:          4130

Modified:
  stable/8/sys/dev/ahci/ahci.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cam/   (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/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/ahci/ahci.c
==============================================================================
--- stable/8/sys/dev/ahci/ahci.c	Wed Aug 18 15:49:44 2010	(r211456)
+++ stable/8/sys/dev/ahci/ahci.c	Wed Aug 18 15:51:32 2010	(r211457)
@@ -2041,6 +2041,7 @@ ahci_issue_read_log(device_t dev)
 	ataio = &ccb->ataio;
 	ataio->data_ptr = malloc(512, M_AHCI, M_NOWAIT);
 	if (ataio->data_ptr == NULL) {
+		xpt_free_ccb(ccb);
 		device_printf(dev, "Unable allocate memory for READ LOG command");
 		return; /* XXX */
 	}

From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 15:52:38 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7D4C0106566B;
	Wed, 18 Aug 2010 15:52:38 +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 6D1A28FC1A;
	Wed, 18 Aug 2010 15:52:38 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7IFqch6073392;
	Wed, 18 Aug 2010 15:52:38 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7IFqc1O073390;
	Wed, 18 Aug 2010 15:52:38 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201008181552.o7IFqc1O073390@svn.freebsd.org>
From: Alexander Motin 
Date: Wed, 18 Aug 2010 15:52: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: r211458 - stable/8/sys/dev/ahci
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 18 Aug 2010 15:52:38 -0000

Author: mav
Date: Wed Aug 18 15:52:38 2010
New Revision: 211458
URL: http://svn.freebsd.org/changeset/base/211458

Log:
  MFC r208907:
  Disable NCQ and PMP support for VIA VT8251 AHCI. It was reported to be
  unreliable under load. Linux does the same.

Modified:
  stable/8/sys/dev/ahci/ahci.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cam/   (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/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/ahci/ahci.c
==============================================================================
--- stable/8/sys/dev/ahci/ahci.c	Wed Aug 18 15:51:32 2010	(r211457)
+++ stable/8/sys/dev/ahci/ahci.c	Wed Aug 18 15:52:38 2010	(r211458)
@@ -239,8 +239,8 @@ static struct {
 	{0x0d8d10de, 0x00, "NVIDIA MCP89",	AHCI_Q_NOAA},
 	{0x0d8e10de, 0x00, "NVIDIA MCP89",	AHCI_Q_NOAA},
 	{0x0d8f10de, 0x00, "NVIDIA MCP89",	AHCI_Q_NOAA},
-	{0x33491106, 0x00, "VIA VT8251",	0},
-	{0x62871106, 0x00, "VIA VT8251",	0},
+	{0x33491106, 0x00, "VIA VT8251",	AHCI_Q_NOPMP|AHCI_Q_NONCQ},
+	{0x62871106, 0x00, "VIA VT8251",	AHCI_Q_NOPMP|AHCI_Q_NONCQ},
 	{0x11841039, 0x00, "SiS 966",		0},
 	{0x11851039, 0x00, "SiS 968",		0},
 	{0x01861039, 0x00, "SiS 968",		0},

From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 15:55:21 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2D7161065675;
	Wed, 18 Aug 2010 15:55:21 +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 02F548FC0A;
	Wed, 18 Aug 2010 15:55:21 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7IFtKuo073530;
	Wed, 18 Aug 2010 15:55:20 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7IFtKmF073528;
	Wed, 18 Aug 2010 15:55:20 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201008181555.o7IFtKmF073528@svn.freebsd.org>
From: Alexander Motin 
Date: Wed, 18 Aug 2010 15:55:20 +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: r211459 - stable/8/sys/dev/siis
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 18 Aug 2010 15:55:21 -0000

Author: mav
Date: Wed Aug 18 15:55:20 2010
New Revision: 211459
URL: http://svn.freebsd.org/changeset/base/211459

Log:
  MFC r208816:
  Fix attach errors handling.
  
  Found with:   Coverity Prevent(tm)
  CID:          3477

Modified:
  stable/8/sys/dev/siis/siis.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cam/   (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/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/siis/siis.c
==============================================================================
--- stable/8/sys/dev/siis/siis.c	Wed Aug 18 15:52:38 2010	(r211458)
+++ stable/8/sys/dev/siis/siis.c	Wed Aug 18 15:55:20 2010	(r211459)
@@ -478,9 +478,9 @@ siis_ch_attach(device_t dev)
 	rid = ATA_IRQ_RID;
 	if (!(ch->r_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ,
 	    &rid, RF_SHAREABLE | RF_ACTIVE))) {
-		bus_release_resource(dev, SYS_RES_MEMORY, ch->unit, ch->r_mem);
 		device_printf(dev, "Unable to map interrupt\n");
-		return (ENXIO);
+		error = ENXIO;
+		goto err0;
 	}
 	if ((bus_setup_intr(dev, ch->r_irq, ATA_INTR_FLAGS, NULL,
 	    siis_ch_intr_locked, dev, &ch->ih))) {
@@ -499,9 +499,10 @@ siis_ch_attach(device_t dev)
 	ch->sim = cam_sim_alloc(siisaction, siispoll, "siisch", ch,
 	    device_get_unit(dev), &ch->mtx, 2, SIIS_MAX_SLOTS, devq);
 	if (ch->sim == NULL) {
+		cam_simq_free(devq);
 		device_printf(dev, "unable to allocate sim\n");
 		error = ENOMEM;
-		goto err2;
+		goto err1;
 	}
 	if (xpt_bus_register(ch->sim, dev, 0) != CAM_SUCCESS) {
 		device_printf(dev, "unable to register xpt bus\n");
@@ -523,6 +524,7 @@ err2:
 	cam_sim_free(ch->sim, /*free_devq*/TRUE);
 err1:
 	bus_release_resource(dev, SYS_RES_IRQ, ATA_IRQ_RID, ch->r_irq);
+err0:
 	bus_release_resource(dev, SYS_RES_MEMORY, ch->unit, ch->r_mem);
 	mtx_unlock(&ch->mtx);
 	return (error);

From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 15:56:09 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B289D10656AA;
	Wed, 18 Aug 2010 15:56:09 +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 A27148FC20;
	Wed, 18 Aug 2010 15:56:09 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7IFu9p5073599;
	Wed, 18 Aug 2010 15:56:09 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7IFu9xV073597;
	Wed, 18 Aug 2010 15:56:09 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201008181556.o7IFu9xV073597@svn.freebsd.org>
From: Alexander Motin 
Date: Wed, 18 Aug 2010 15:56: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: r211460 - stable/8/sys/dev/siis
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 18 Aug 2010 15:56:09 -0000

Author: mav
Date: Wed Aug 18 15:56:09 2010
New Revision: 211460
URL: http://svn.freebsd.org/changeset/base/211460

Log:
  MFC r208817:
  Plug memory leak to silent Coverity. Error is still not really handled.
  
  Found with:   Coverity Prevent(tm)
  CID:          4196

Modified:
  stable/8/sys/dev/siis/siis.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cam/   (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/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/siis/siis.c
==============================================================================
--- stable/8/sys/dev/siis/siis.c	Wed Aug 18 15:55:20 2010	(r211459)
+++ stable/8/sys/dev/siis/siis.c	Wed Aug 18 15:56:09 2010	(r211460)
@@ -1338,6 +1338,7 @@ siis_issue_read_log(device_t dev)
 	ataio = &ccb->ataio;
 	ataio->data_ptr = malloc(512, M_SIIS, M_NOWAIT);
 	if (ataio->data_ptr == NULL) {
+		xpt_free_ccb(ccb);
 		device_printf(dev, "Unable allocate memory for READ LOG command");
 		return; /* XXX */
 	}

From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 15:58:27 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 14F921065679;
	Wed, 18 Aug 2010 15:58:27 +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 04A848FC1C;
	Wed, 18 Aug 2010 15:58:27 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7IFwQ4a073717;
	Wed, 18 Aug 2010 15:58:26 GMT (envelope-from mav@svn.freebsd.org)
Received: (from mav@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7IFwQG4073715;
	Wed, 18 Aug 2010 15:58:26 GMT (envelope-from mav@svn.freebsd.org)
Message-Id: <201008181558.o7IFwQG4073715@svn.freebsd.org>
From: Alexander Motin 
Date: Wed, 18 Aug 2010 15:58:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
X-SVN-Group: stable-8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r211461 - stable/8/sys/dev/mvs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 18 Aug 2010 15:58:27 -0000

Author: mav
Date: Wed Aug 18 15:58:26 2010
New Revision: 211461
URL: http://svn.freebsd.org/changeset/base/211461

Log:
  MFC r208818:
  Plug memory leak to silent Coverity. Error is still not really handled.
  
  Found with:   Coverity Prevent(tm)
  CID:          4137

Modified:
  stable/8/sys/dev/mvs/mvs.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cam/   (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/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/mvs/mvs.c
==============================================================================
--- stable/8/sys/dev/mvs/mvs.c	Wed Aug 18 15:56:09 2010	(r211460)
+++ stable/8/sys/dev/mvs/mvs.c	Wed Aug 18 15:58:26 2010	(r211461)
@@ -1727,6 +1727,7 @@ mvs_issue_read_log(device_t dev)
 	ataio = &ccb->ataio;
 	ataio->data_ptr = malloc(512, M_MVS, M_NOWAIT);
 	if (ataio->data_ptr == NULL) {
+		xpt_free_ccb(ccb);
 		device_printf(dev, "Unable allocate memory for READ LOG command");
 		return; /* XXX */
 	}

From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 17:39:47 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DD924106566B;
	Wed, 18 Aug 2010 17:39:47 +0000 (UTC)
	(envelope-from andre@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CD91E8FC1E;
	Wed, 18 Aug 2010 17:39:47 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7IHdlAd075927;
	Wed, 18 Aug 2010 17:39:47 GMT (envelope-from andre@svn.freebsd.org)
Received: (from andre@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7IHdlv3075923;
	Wed, 18 Aug 2010 17:39:47 GMT (envelope-from andre@svn.freebsd.org)
Message-Id: <201008181739.o7IHdlv3075923@svn.freebsd.org>
From: Andre Oppermann 
Date: Wed, 18 Aug 2010 17:39: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: r211462 - 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: Wed, 18 Aug 2010 17:39:48 -0000

Author: andre
Date: Wed Aug 18 17:39:47 2010
New Revision: 211462
URL: http://svn.freebsd.org/changeset/base/211462

Log:
  Untangle the net.inet.tcp.log_in_vain and net.inet.tcp.log_debug
  sysctl's and remove any side effects.
  
  Both sysctl's share the same backend infrastructure and due to the
  way it was implemented enabling net.inet.tcp.log_in_vain would also
  cause log_debug output to be generated.  This was surprising and
  eventually annoying to the user.
  
  The log output backend is kept the same but a little shim is inserted
  to properly separate log_in_vain and log_debug and to remove any side
  effects.
  
  PR:		kern/137317
  MFC after:	1 week

Modified:
  head/sys/netinet/tcp_input.c
  head/sys/netinet/tcp_subr.c
  head/sys/netinet/tcp_var.h

Modified: head/sys/netinet/tcp_input.c
==============================================================================
--- head/sys/netinet/tcp_input.c	Wed Aug 18 15:58:26 2010	(r211461)
+++ head/sys/netinet/tcp_input.c	Wed Aug 18 17:39:47 2010	(r211462)
@@ -571,7 +571,7 @@ findpcb:
 		 */
 		if ((tcp_log_in_vain == 1 && (thflags & TH_SYN)) ||
 		    tcp_log_in_vain == 2) {
-			if ((s = tcp_log_addrs(NULL, th, (void *)ip, ip6)))
+			if ((s = tcp_log_vain(NULL, th, (void *)ip, ip6)))
 				log(LOG_INFO, "%s; %s: Connection attempt "
 				    "to closed port\n", s, __func__);
 		}

Modified: head/sys/netinet/tcp_subr.c
==============================================================================
--- head/sys/netinet/tcp_subr.c	Wed Aug 18 15:58:26 2010	(r211461)
+++ head/sys/netinet/tcp_subr.c	Wed Aug 18 17:39:47 2010	(r211462)
@@ -268,6 +268,8 @@ VNET_DEFINE(uma_zone_t, sack_hole_zone);
 
 static struct inpcb *tcp_notify(struct inpcb *, int);
 static void	tcp_isn_tick(void *);
+static char *	tcp_log_addr(struct in_conninfo *inc, struct tcphdr *th,
+		    void *ip4hdr, const void *ip6hdr);
 
 /*
  * Target size of TCP PCB hash tables. Must be a power of two.
@@ -2234,9 +2236,33 @@ SYSCTL_PROC(_net_inet_tcp, TCPCTL_DROP, 
  * and ip6_hdr pointers have to be passed as void pointers.
  */
 char *
+tcp_log_vain(struct in_conninfo *inc, struct tcphdr *th, void *ip4hdr,
+    const void *ip6hdr)
+{
+
+	/* Is logging enabled? */
+	if (tcp_log_in_vain == 0)
+		return (NULL);
+
+	return (tcp_log_addr(inc, th, ip4hdr, ip6hdr));
+}
+
+char *
 tcp_log_addrs(struct in_conninfo *inc, struct tcphdr *th, void *ip4hdr,
     const void *ip6hdr)
 {
+
+	/* Is logging enabled? */
+	if (tcp_log_debug == 0)
+		return (NULL);
+
+	return (tcp_log_addr(inc, th, ip4hdr, ip6hdr));
+}
+
+static char *
+tcp_log_addr(struct in_conninfo *inc, struct tcphdr *th, void *ip4hdr,
+    const void *ip6hdr)
+{
 	char *s, *sp;
 	size_t size;
 	struct ip *ip;
@@ -2259,10 +2285,6 @@ tcp_log_addrs(struct in_conninfo *inc, s
 	    2 * INET_ADDRSTRLEN;
 #endif /* INET6 */
 
-	/* Is logging enabled? */
-	if (tcp_log_debug == 0 && tcp_log_in_vain == 0)
-		return (NULL);
-
 	s = malloc(size, M_TCPLOG, M_ZERO|M_NOWAIT);
 	if (s == NULL)
 		return (NULL);

Modified: head/sys/netinet/tcp_var.h
==============================================================================
--- head/sys/netinet/tcp_var.h	Wed Aug 18 15:58:26 2010	(r211461)
+++ head/sys/netinet/tcp_var.h	Wed Aug 18 17:39:47 2010	(r211462)
@@ -611,6 +611,8 @@ void	 tcp_destroy(void);
 void	 tcp_fini(void *);
 char 	*tcp_log_addrs(struct in_conninfo *, struct tcphdr *, void *,
 	    const void *);
+char	*tcp_log_vain(struct in_conninfo *, struct tcphdr *, void *,
+	    const void *);
 int	 tcp_reass(struct tcpcb *, struct tcphdr *, int *, struct mbuf *);
 void	 tcp_reass_init(void);
 #ifdef VIMAGE

From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 17:40:10 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 77F991065706;
	Wed, 18 Aug 2010 17:40:10 +0000 (UTC)
	(envelope-from gabor@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5C9E68FC0A;
	Wed, 18 Aug 2010 17:40:10 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7IHeAlw075989;
	Wed, 18 Aug 2010 17:40:10 GMT (envelope-from gabor@svn.freebsd.org)
Received: (from gabor@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7IHeA4c075984;
	Wed, 18 Aug 2010 17:40:10 GMT (envelope-from gabor@svn.freebsd.org)
Message-Id: <201008181740.o7IHeA4c075984@svn.freebsd.org>
From: Gabor Kovesdan 
Date: Wed, 18 Aug 2010 17:40: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: r211463 - head/usr.bin/grep
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 18 Aug 2010 17:40:10 -0000

Author: gabor
Date: Wed Aug 18 17:40:10 2010
New Revision: 211463
URL: http://svn.freebsd.org/changeset/base/211463

Log:
  - Refactor file reading code to use pure syscalls and an internal buffer
    instead of stdio.  This gives BSD grep a very big performance boost,
    its speed is now almost comparable to GNU grep.
  
  Submitted by:	Dimitry Andric 
  Approved by:	delphij (mentor)

Modified:
  head/usr.bin/grep/fastgrep.c
  head/usr.bin/grep/file.c
  head/usr.bin/grep/grep.h
  head/usr.bin/grep/util.c

Modified: head/usr.bin/grep/fastgrep.c
==============================================================================
--- head/usr.bin/grep/fastgrep.c	Wed Aug 18 17:39:47 2010	(r211462)
+++ head/usr.bin/grep/fastgrep.c	Wed Aug 18 17:40:10 2010	(r211463)
@@ -198,7 +198,7 @@ fastcomp(fastgrep_t *fg, const char *pat
 }
 
 int
-grep_search(fastgrep_t *fg, unsigned char *data, size_t len, regmatch_t *pmatch)
+grep_search(fastgrep_t *fg, const unsigned char *data, size_t len, regmatch_t *pmatch)
 {
 	unsigned int j;
 	int ret = REG_NOMATCH;

Modified: head/usr.bin/grep/file.c
==============================================================================
--- head/usr.bin/grep/file.c	Wed Aug 18 17:39:47 2010	(r211462)
+++ head/usr.bin/grep/file.c	Wed Aug 18 17:40:10 2010	(r211463)
@@ -2,7 +2,8 @@
 
 /*-
  * Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav
- * Copyright (C) 2008-2009 Gabor Kovesdan 
+ * Copyright (C) 2008-2010 Gabor Kovesdan 
+ * Copyright (C) 2010 Dimitry Andric 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -37,7 +38,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -47,222 +49,204 @@ __FBSDID("$FreeBSD$");
 
 #include "grep.h"
 
-static char	 fname[MAXPATHLEN];	/* file name */
+#define	MAXBUFSIZ	(32 * 1024)
+#define	LNBUFBUMP	80
 
-#define		 MAXBUFSIZ	(16 * 1024)
-#define		 PREREAD_M	0.2
+static gzFile gzbufdesc;
+static BZFILE* bzbufdesc;
 
-/* Some global variables for the buffering and reading. */
-static char	*lnbuf;
-static size_t	 lnbuflen;
-static unsigned char *binbuf;
-static int	 binbufsiz;
-unsigned char	*binbufptr;
-static int	 bzerr;
+static unsigned char buffer[MAXBUFSIZ];
+static unsigned char *bufpos;
+static size_t bufrem;
 
-#define iswbinary(ch)	(!iswspace((ch)) && iswcntrl((ch)) && \
-			    (ch != L'\b') && (ch != L'\0'))
+static unsigned char *lnbuf;
+static size_t lnbuflen;
 
-/*
- * Returns a single character according to the file type.
- * Returns -1 on failure.
- */
 static inline int
-grep_fgetc(struct file *f)
+grep_refill(struct file *f)
 {
-	unsigned char c;
+	ssize_t nr;
+	int bzerr;
 
-	switch (filebehave) {
-	case FILE_STDIO:
-		return (getc_unlocked(f->f));
-	case FILE_GZIP:
-		return (gzgetc(f->gzf));
-	case FILE_BZIP:
-		BZ2_bzRead(&bzerr, f->bzf, &c, 1);
-		if (bzerr == BZ_STREAM_END)
-			return (-1);
-		else if (bzerr != BZ_SEQUENCE_ERROR && bzerr != BZ_OK)
-			errx(2, "%s", getstr(2));
-		return (c);
-	}
-	return (-1);
+	bufpos = buffer;
+	bufrem = 0;
+
+	if (filebehave == FILE_GZIP)
+		nr = gzread(gzbufdesc, buffer, MAXBUFSIZ);
+	else if (filebehave == FILE_BZIP && bzbufdesc != NULL) {
+		nr = BZ2_bzRead(&bzerr, bzbufdesc, buffer, MAXBUFSIZ);
+		switch (bzerr) {
+		case BZ_OK:
+		case BZ_STREAM_END:
+			/* No problem, nr will be okay */
+			break;
+		case BZ_DATA_ERROR_MAGIC:
+			/*
+			 * As opposed to gzread(), which simply returns the
+			 * plain file data, if it is not in the correct
+			 * compressed format, BZ2_bzRead() instead aborts.
+			 *
+			 * So, just restart at the beginning of the file again,
+			 * and use plain reads from now on.
+			 */
+			BZ2_bzReadClose(&bzerr, bzbufdesc);
+			bzbufdesc = NULL;
+			if (lseek(f->fd, 0, SEEK_SET) == -1)
+				return (-1);
+			nr = read(f->fd, buffer, MAXBUFSIZ);
+			break;
+		default:
+			/* Make sure we exit with an error */
+			nr = -1;
+		}
+	} else
+		nr = read(f->fd, buffer, MAXBUFSIZ);
+
+	if (nr < 0)
+		return (-1);
+
+	bufrem = nr;
+	return (0);
 }
 
-/*
- * Returns true if the file position is a EOF, returns false
- * otherwise.
- */
 static inline int
-grep_feof(struct file *f)
+grep_lnbufgrow(size_t newlen)
 {
 
-	switch (filebehave) {
-	case FILE_STDIO:
-		return (feof_unlocked(f->f));
-	case FILE_GZIP:
-		return (gzeof(f->gzf));
-	case FILE_BZIP:
-		return (bzerr == BZ_STREAM_END);
+	if (lnbuflen < newlen) {
+		lnbuf = grep_realloc(lnbuf, newlen);
+		lnbuflen = newlen;
 	}
-	return (1);
+
+	return (0);
 }
 
-/*
- * At the first call, fills in an internal buffer and checks if the given
- * file is a binary file and sets the binary flag accordingly.  Then returns
- * a single line and sets len to the length of the returned line.
- * At any other call returns a single line either from the internal buffer
- * or from the file if the buffer is exhausted and sets len to the length
- * of the line.
- */
 char *
-grep_fgetln(struct file *f, size_t *len)
+grep_fgetln(struct file *f, size_t *lenp)
 {
-	struct stat st;
-	size_t bufsiz, i = 0;
-	int ch = 0;
-
-	/* Fill in the buffer if it is empty. */
-	if (binbufptr == NULL) {
-
-		/* Only pre-read to the buffer if we need the binary check. */
-		if (binbehave != BINFILE_TEXT) {
-			if (f->stdin)
-				st.st_size = MAXBUFSIZ;
-			else if (stat(fname, &st) != 0)
-				err(2, NULL);
-			/* no need to allocate buffer. */
-			if (st.st_size == 0)
-				return (NULL);
-
-			bufsiz = (MAXBUFSIZ > (st.st_size * PREREAD_M)) ?
-			    (st.st_size / 2) : MAXBUFSIZ;
-
-			binbuf = grep_malloc(sizeof(char) * bufsiz);
-
-			while (i < bufsiz) {
-				ch = grep_fgetc(f);
-				if (ch == EOF)
-					break;
-				binbuf[i++] = ch;
-				if ((ch == '\n') && lbflag)
-					break;
-			}
-
-			f->binary = memchr(binbuf, (filebehave != FILE_GZIP) ?
-			    '\0' : '\200', i - 1) != NULL;
-		}
-		binbufsiz = i;
-		binbufptr = binbuf;
-	}
-
-	/* Read a line whether from the buffer or from the file itself. */
-	for (i = 0; !(grep_feof(f) &&
-	    (binbufptr == &binbuf[binbufsiz])); i++) {
-		if (binbufptr == &binbuf[binbufsiz]) {
-			ch = grep_fgetc(f);
-		} else {
-			ch = binbufptr[0];
-			binbufptr++;
-		}
-		if (i >= lnbuflen) {
-			lnbuflen *= 2;
-			lnbuf = grep_realloc(lnbuf, ++lnbuflen);
-		}
-		if ((ch == '\n') || (ch == EOF)) {
-			lnbuf[i] = '\0';
+	unsigned char *p;
+	char *ret;
+	size_t len;
+	size_t off;
+	ptrdiff_t diff;
+
+	/* Fill the buffer, if necessary */
+	if (bufrem == 0 && grep_refill(f) != 0)
+		goto error;
+
+	if (bufrem == 0) {
+		/* Return zero length to indicate EOF */
+		*lenp = 0;
+		return (bufpos);
+	}
+
+	/* Look for a newline in the remaining part of the buffer */
+	if ((p = memchr(bufpos, '\n', bufrem)) != NULL) {
+		++p; /* advance over newline */
+		ret = bufpos;
+		len = p - bufpos;
+		bufrem -= len;
+		bufpos = p;
+		*lenp = len;
+		return (ret);
+	}
+
+	/* We have to copy the current buffered data to the line buffer */
+	for (len = bufrem, off = 0; ; len += bufrem) {
+		/* Make sure there is room for more data */
+		if (grep_lnbufgrow(len + LNBUFBUMP))
+			goto error;
+		memcpy(lnbuf + off, bufpos, len - off);
+		off = len;
+		if (grep_refill(f) != 0)
+			goto error;
+		if (bufrem == 0)
+			/* EOF: return partial line */
 			break;
-		} else
-			lnbuf[i] = ch;
+		if ((p = memchr(bufpos, '\n', bufrem)) == NULL)
+			continue;
+		/* got it: finish up the line (like code above) */
+		++p;
+		diff = p - bufpos;
+		len += diff;
+		if (grep_lnbufgrow(len))
+		    goto error;
+		memcpy(lnbuf + off, bufpos, diff);
+		bufrem -= diff;
+		bufpos = p;
+		break;
 	}
-	if (grep_feof(f) && (i == 0) && (ch != '\n'))
-		return (NULL);
-	*len = i;
+	*lenp = len;
 	return (lnbuf);
+
+error:
+	*lenp = 0;
+	return (NULL);
 }
 
-/*
- * Opens the standard input for processing.
- */
-struct file *
-grep_stdin_open(void)
+static inline struct file *
+grep_file_init(struct file *f)
 {
-	struct file *f;
 
-	/* Processing stdin implies --line-buffered for tail -f to work. */
-	lbflag = true;
+	if (filebehave == FILE_GZIP &&
+	    (gzbufdesc = gzdopen(f->fd, "r")) == NULL)
+		goto error;
 
-	snprintf(fname, sizeof fname, "%s", getstr(1));
+	if (filebehave == FILE_BZIP &&
+	    (bzbufdesc = BZ2_bzdopen(f->fd, "r")) == NULL)
+		goto error;
 
-	f = grep_malloc(sizeof *f);
+	/* Fill read buffer, also catches errors early */
+	if (grep_refill(f) != 0)
+		goto error;
 
-	binbuf = NULL;
-	if ((f->f = fdopen(STDIN_FILENO, "r")) != NULL) {
-		flockfile(f->f);
-		f->stdin = true;
-		return (f);
-	}
+	/* Check for binary stuff, if necessary */
+	if (binbehave != BINFILE_TEXT && memchr(bufpos, '\0', bufrem) != NULL)
+		f->binary = true;
 
+	return (f);
+error:
+	close(f->fd);
 	free(f);
 	return (NULL);
 }
 
 /*
- * Opens a normal, a gzipped or a bzip2 compressed file for processing.
+ * Opens a file for processing.
  */
 struct file *
 grep_open(const char *path)
 {
 	struct file *f;
 
-	snprintf(fname, sizeof fname, "%s", path);
-
 	f = grep_malloc(sizeof *f);
-
-	binbuf = NULL;
-	f->stdin = false;
-	switch (filebehave) {
-	case FILE_STDIO:
-		if ((f->f = fopen(path, "r")) != NULL) {
-			flockfile(f->f);
-			return (f);
-		}
-		break;
-	case FILE_GZIP:
-		if ((f->gzf = gzopen(fname, "r")) != NULL)
-			return (f);
-		break;
-	case FILE_BZIP:
-		if ((f->bzf = BZ2_bzopen(fname, "r")) != NULL)
-			return (f);
-		break;
+	memset(f, 0, sizeof *f);
+	if (path == NULL) {
+		/* Processing stdin implies --line-buffered. */
+		lbflag = true;
+		f->fd = STDIN_FILENO;
+	} else if ((f->fd = open(path, O_RDONLY)) == -1) {
+		free(f);
+		return (NULL);
 	}
 
-	free(f);
-	return (NULL);
+	return (grep_file_init(f));
 }
 
 /*
- * Closes a normal, a gzipped or a bzip2 compressed file.
+ * Closes a file.
  */
 void
 grep_close(struct file *f)
 {
 
-	switch (filebehave) {
-	case FILE_STDIO:
-		funlockfile(f->f);
-		fclose(f->f);
-		break;
-	case FILE_GZIP:
-		gzclose(f->gzf);
-		break;
-	case FILE_BZIP:
-		BZ2_bzclose(f->bzf);
-		break;
-	}
+	close(f->fd);
 
-	/* Reset read buffer for the file we are closing */
-	binbufptr = NULL;
-	free(binbuf);
+	/* Reset read buffer and line buffer */
+	bufpos = buffer;
+	bufrem = 0;
+
+	free(lnbuf);
+	lnbuf = NULL;
+	lnbuflen = 0;
 }

Modified: head/usr.bin/grep/grep.h
==============================================================================
--- head/usr.bin/grep/grep.h	Wed Aug 18 17:39:47 2010	(r211462)
+++ head/usr.bin/grep/grep.h	Wed Aug 18 17:40:10 2010	(r211463)
@@ -77,12 +77,8 @@ extern const char		*errstr[];
 #define MAX_LINE_MATCHES	32
 
 struct file {
-	struct mmfile	*mmf;
-	BZFILE		*bzf;
-	FILE		*f;
-	gzFile		*gzf;
+	int		 fd;
 	bool		 binary;
-	bool		 stdin;
 };
 
 struct str {
@@ -150,11 +146,10 @@ void	 clearqueue(void);
 
 /* file.c */
 void		 grep_close(struct file *f);
-struct file	*grep_stdin_open(void);
 struct file	*grep_open(const char *path);
 char		*grep_fgetln(struct file *f, size_t *len);
 
 /* fastgrep.c */
 int		 fastcomp(fastgrep_t *, const char *);
 void		 fgrepcomp(fastgrep_t *, const char *);
-int		 grep_search(fastgrep_t *, unsigned char *, size_t, regmatch_t *);
+int		 grep_search(fastgrep_t *, const unsigned char *, size_t, regmatch_t *);

Modified: head/usr.bin/grep/util.c
==============================================================================
--- head/usr.bin/grep/util.c	Wed Aug 18 17:39:47 2010	(r211462)
+++ head/usr.bin/grep/util.c	Wed Aug 18 17:40:10 2010	(r211463)
@@ -184,7 +184,7 @@ procfile(const char *fn)
 
 	if (strcmp(fn, "-") == 0) {
 		fn = label != NULL ? label : getstr(1);
-		f = grep_stdin_open();
+		f = grep_open(NULL);
 	} else {
 		if (!stat(fn, &sb)) {
 			/* Check if we need to process the file */
@@ -215,7 +215,7 @@ procfile(const char *fn)
 
 	for (c = 0;  c == 0 || !(lflag || qflag); ) {
 		ln.off += ln.len + 1;
-		if ((ln.dat = grep_fgetln(f, &ln.len)) == NULL) {
+		if ((ln.dat = grep_fgetln(f, &ln.len)) == NULL || ln.len == 0) {
 			if (ln.line_no == 0 && matchall)
 				exit(0);
 			else

From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 18:05:55 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 207931065679;
	Wed, 18 Aug 2010 18:05:55 +0000 (UTC)
	(envelope-from andre@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 0FA868FC17;
	Wed, 18 Aug 2010 18:05:55 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7II5sJI076530;
	Wed, 18 Aug 2010 18:05:54 GMT (envelope-from andre@svn.freebsd.org)
Received: (from andre@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7II5s1R076527;
	Wed, 18 Aug 2010 18:05:54 GMT (envelope-from andre@svn.freebsd.org)
Message-Id: <201008181805.o7II5s1R076527@svn.freebsd.org>
From: Andre Oppermann 
Date: Wed, 18 Aug 2010 18:05: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: r211464 - 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: Wed, 18 Aug 2010 18:05:55 -0000

Author: andre
Date: Wed Aug 18 18:05:54 2010
New Revision: 211464
URL: http://svn.freebsd.org/changeset/base/211464

Log:
  If a TCP connection has been idle for one retransmit timeout or more
  it must reset its congestion window back to the initial window.
  
  RFC3390 has increased the initial window from 1 segment to up to
  4 segments.
  
  The initial window increase of RFC3390 wasn't reflected into the
  restart window which remained at its original defaults of 4 segments
  for local and 1 segment for all other connections.  Both values are
  controllable through sysctl net.inet.tcp.local_slowstart_flightsize
  and net.inet.tcp.slowstart_flightsize.
  
  The increase helps TCP's slow start algorithm to open up the congestion
  window much faster.
  
  Reviewed by:	lstewart
  MFC after:	1 week

Modified:
  head/sys/netinet/tcp_output.c
  head/sys/netinet/tcp_var.h

Modified: head/sys/netinet/tcp_output.c
==============================================================================
--- head/sys/netinet/tcp_output.c	Wed Aug 18 17:40:10 2010	(r211463)
+++ head/sys/netinet/tcp_output.c	Wed Aug 18 18:05:54 2010	(r211464)
@@ -140,7 +140,7 @@ tcp_output(struct tcpcb *tp)
 {
 	struct socket *so = tp->t_inpcb->inp_socket;
 	long len, recwin, sendwin;
-	int off, flags, error;
+	int off, flags, error, rw;
 	struct mbuf *m;
 	struct ip *ip = NULL;
 	struct ipovly *ipov = NULL;
@@ -176,23 +176,34 @@ tcp_output(struct tcpcb *tp)
 	idle = (tp->t_flags & TF_LASTIDLE) || (tp->snd_max == tp->snd_una);
 	if (idle && ticks - tp->t_rcvtime >= tp->t_rxtcur) {
 		/*
-		 * We have been idle for "a while" and no acks are
-		 * expected to clock out any data we send --
-		 * slow start to get ack "clock" running again.
+		 * If we've been idle for more than one retransmit
+		 * timeout the old congestion window is no longer
+		 * current and we have to reduce it to the restart
+		 * window before we can transmit again.
 		 *
-		 * Set the slow-start flight size depending on whether
-		 * this is a local network or not.
+		 * The restart window is the initial window or the last
+		 * CWND, whichever is smaller.
+		 * 
+		 * This is done to prevent us from flooding the path with
+		 * a full CWND at wirespeed, overloading router and switch
+		 * buffers along the way.
+		 *
+		 * See RFC5681 Section 4.1. "Restarting Idle Connections".
 		 */
-		int ss = V_ss_fltsz;
+		if (V_tcp_do_rfc3390)
+			rw = min(4 * tp->t_maxseg,
+				 max(2 * tp->t_maxseg, 4380));
 #ifdef INET6
-		if (isipv6) {
-			if (in6_localaddr(&tp->t_inpcb->in6p_faddr))
-				ss = V_ss_fltsz_local;
-		} else
-#endif /* INET6 */
-		if (in_localaddr(tp->t_inpcb->inp_faddr))
-			ss = V_ss_fltsz_local;
-		tp->snd_cwnd = tp->t_maxseg * ss;
+		else if ((isipv6 ? in6_localaddr(&tp->t_inpcb->in6p_faddr) :
+			  in_localaddr(tp->t_inpcb->inp_faddr)))
+#else
+		else if (in_localaddr(tp->t_inpcb->inp_faddr))
+#endif
+			rw = V_ss_fltsz_local * tp->t_maxseg;
+		else
+			rw = V_ss_fltsz * tp->t_maxseg;
+
+		tp->snd_cwnd = min(rw, tp->snd_cwnd);
 	}
 	tp->t_flags &= ~TF_LASTIDLE;
 	if (idle) {

Modified: head/sys/netinet/tcp_var.h
==============================================================================
--- head/sys/netinet/tcp_var.h	Wed Aug 18 17:40:10 2010	(r211463)
+++ head/sys/netinet/tcp_var.h	Wed Aug 18 18:05:54 2010	(r211464)
@@ -565,6 +565,7 @@ extern	int tcp_log_in_vain;
 VNET_DECLARE(int, tcp_mssdflt);	/* XXX */
 VNET_DECLARE(int, tcp_minmss);
 VNET_DECLARE(int, tcp_delack_enabled);
+VNET_DECLARE(int, tcp_do_rfc3390);
 VNET_DECLARE(int, tcp_do_newreno);
 VNET_DECLARE(int, path_mtu_discovery);
 VNET_DECLARE(int, ss_fltsz);
@@ -575,6 +576,7 @@ VNET_DECLARE(int, ss_fltsz_local);
 #define	V_tcp_mssdflt		VNET(tcp_mssdflt)
 #define	V_tcp_minmss		VNET(tcp_minmss)
 #define	V_tcp_delack_enabled	VNET(tcp_delack_enabled)
+#define	V_tcp_do_rfc3390	VNET(tcp_do_rfc3390)
 #define	V_tcp_do_newreno	VNET(tcp_do_newreno)
 #define	V_path_mtu_discovery	VNET(path_mtu_discovery)
 #define	V_ss_fltsz		VNET(ss_fltsz)

From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 19:30:13 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: by hub.freebsd.org (Postfix, from userid 1033)
	id 3FF45106567A; Wed, 18 Aug 2010 19:30:13 +0000 (UTC)
Date: Wed, 18 Aug 2010 19:30:13 +0000
From: Alexey Dokuchaev 
To: Dag-Erling Sm??rgrav 
Message-ID: <20100818193013.GA61328@FreeBSD.org>
References: <201008142148.o7ELmMTO039767@svn.freebsd.org>
	<20100817193757.GA92936@FreeBSD.org> <86hbisb8g2.fsf@ds4.des.no>
Mime-Version: 1.0
Content-Type: text/plain; charset=koi8-r
Content-Disposition: inline
In-Reply-To: <86hbisb8g2.fsf@ds4.des.no>
User-Agent: Mutt/1.4.2.1i
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Jens Schweikhardt 
Subject: Re: svn commit: r211318 - head/usr.sbin/sysinstall
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 18 Aug 2010 19:30:13 -0000

On Wed, Aug 18, 2010 at 11:01:49AM +0200, Dag-Erling Sm??rgrav wrote:
> Alexey Dokuchaev  writes:
> > Jens Schweikhardt  writes:
> > > Log:
> > >   Correctly spell janice and jimmy as janis and jimi (assuming
> > >   the famous rock stars meant were Miss Joplin and Mr Hendrix.)
> > Are you sure this is correct message for the commit, or I am simply
> > missing the irony?
> 
> Look at the very end of the patch.

Actually, I did; but the last hunk is just a whitespace change,
irrelevant to the commit message (just as most of the other hunks).
No wonder I missed the hunk before the last one.

./danfe

From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 20:23:47 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9A61410656C5;
	Wed, 18 Aug 2010 20:23:47 +0000 (UTC)
	(envelope-from gavin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 899798FC08;
	Wed, 18 Aug 2010 20:23:47 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7IKNlMX079396;
	Wed, 18 Aug 2010 20:23:47 GMT (envelope-from gavin@svn.freebsd.org)
Received: (from gavin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7IKNlLV079394;
	Wed, 18 Aug 2010 20:23:47 GMT (envelope-from gavin@svn.freebsd.org)
Message-Id: <201008182023.o7IKNlLV079394@svn.freebsd.org>
From: Gavin Atkinson 
Date: Wed, 18 Aug 2010 20:23:47 +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: r211465 - stable/7/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, 18 Aug 2010 20:23:47 -0000

Author: gavin
Date: Wed Aug 18 20:23:47 2010
New Revision: 211465
URL: http://svn.freebsd.org/changeset/base/211465

Log:
  Merge 210839 from head:
  
    Do not free sc if attach failed, as it was allocated by the bus
    infrastructure, not us.  This appears to be a leftover from an older
    version of the driver.
  
  Submitted by:	avg
  Tested by:	Anton Shterenlikht 

Modified:
  stable/7/sys/dev/sound/pci/hda/hdac.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/sound/pci/hda/hdac.c
==============================================================================
--- stable/7/sys/dev/sound/pci/hda/hdac.c	Wed Aug 18 18:05:54 2010	(r211464)
+++ stable/7/sys/dev/sound/pci/hda/hdac.c	Wed Aug 18 20:23:47 2010	(r211465)
@@ -4258,7 +4258,6 @@ hdac_attach_fail:
 	hdac_dma_free(sc, &sc->corb_dma);
 	hdac_mem_free(sc);
 	snd_mtxfree(sc->lock);
-	free(sc, M_DEVBUF);
 
 	return (ENXIO);
 }

From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 20:23:56 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5E28A106577E;
	Wed, 18 Aug 2010 20:23:56 +0000 (UTC)
	(envelope-from gavin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3534B8FC1C;
	Wed, 18 Aug 2010 20:23:56 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7IKNuAs079433;
	Wed, 18 Aug 2010 20:23:56 GMT (envelope-from gavin@svn.freebsd.org)
Received: (from gavin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7IKNuxn079431;
	Wed, 18 Aug 2010 20:23:56 GMT (envelope-from gavin@svn.freebsd.org)
Message-Id: <201008182023.o7IKNuxn079431@svn.freebsd.org>
From: Gavin Atkinson 
Date: Wed, 18 Aug 2010 20:23: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: r211466 - 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, 18 Aug 2010 20:23:56 -0000

Author: gavin
Date: Wed Aug 18 20:23:55 2010
New Revision: 211466
URL: http://svn.freebsd.org/changeset/base/211466

Log:
  Merge 210839 from head:
  
    Do not free sc if attach failed, as it was allocated by the bus
    infrastructure, not us.  This appears to be a leftover from an older
    version of the driver.
  
  Submitted by:	avg
  Tested by:	Anton Shterenlikht 

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/cam/   (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/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/sound/pci/hda/hdac.c
==============================================================================
--- stable/8/sys/dev/sound/pci/hda/hdac.c	Wed Aug 18 20:23:47 2010	(r211465)
+++ stable/8/sys/dev/sound/pci/hda/hdac.c	Wed Aug 18 20:23:55 2010	(r211466)
@@ -4304,7 +4304,6 @@ hdac_attach_fail:
 	hdac_dma_free(sc, &sc->corb_dma);
 	hdac_mem_free(sc);
 	snd_mtxfree(sc->lock);
-	free(sc, M_DEVBUF);
 
 	return (ENXIO);
 }

From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 20:26:50 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A7CB110656AA;
	Wed, 18 Aug 2010 20:26:50 +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 9782B8FC14;
	Wed, 18 Aug 2010 20:26:50 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7IKQoe3079527;
	Wed, 18 Aug 2010 20:26:50 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7IKQoVb079525;
	Wed, 18 Aug 2010 20:26:50 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201008182026.o7IKQoVb079525@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Wed, 18 Aug 2010 20:26: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: r211467 - head/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: Wed, 18 Aug 2010 20:26:50 -0000

Author: jilles
Date: Wed Aug 18 20:26:50 2010
New Revision: 211467
URL: http://svn.freebsd.org/changeset/base/211467

Log:
  sh: Add a test for break from a trap action.

Added:
  head/tools/regression/bin/sh/builtins/break2.0   (contents, props changed)
  head/tools/regression/bin/sh/builtins/break2.0.stdout   (contents, props changed)

Added: head/tools/regression/bin/sh/builtins/break2.0
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/regression/bin/sh/builtins/break2.0	Wed Aug 18 20:26:50 2010	(r211467)
@@ -0,0 +1,12 @@
+# $FreeBSD$
+
+# It is not immediately obvious that this should work, and someone probably
+# relies on it.
+
+while :; do
+	trap 'break' USR1
+	kill -USR1 $$
+	echo bad
+	exit 1
+done
+echo good

Added: head/tools/regression/bin/sh/builtins/break2.0.stdout
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/tools/regression/bin/sh/builtins/break2.0.stdout	Wed Aug 18 20:26:50 2010	(r211467)
@@ -0,0 +1 @@
+good

From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 20:37:41 2010
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 23DE0106567A;
	Wed, 18 Aug 2010 20:37:41 +0000 (UTC)
	(envelope-from peterjeremy@acm.org)
Received: from mail36.syd.optusnet.com.au (mail36.syd.optusnet.com.au
	[211.29.133.76])
	by mx1.freebsd.org (Postfix) with ESMTP id 8ED8B8FC1B;
	Wed, 18 Aug 2010 20:37:40 +0000 (UTC)
Received: from server.vk2pj.dyndns.org
	(c220-239-116-103.belrs4.nsw.optusnet.com.au [220.239.116.103])
	by mail36.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	o7IKbWT7025921
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 19 Aug 2010 06:37:32 +1000
X-Bogosity: Ham, spamicity=0.000000
Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1])
	by server.vk2pj.dyndns.org (8.14.4/8.14.4) with ESMTP id o7IKbVZ6055540;
	Thu, 19 Aug 2010 06:37:31 +1000 (EST)
	(envelope-from peter@server.vk2pj.dyndns.org)
Received: (from peter@localhost)
	by server.vk2pj.dyndns.org (8.14.4/8.14.4/Submit) id o7IKbU4V055539;
	Thu, 19 Aug 2010 06:37:30 +1000 (EST) (envelope-from peter)
Date: Thu, 19 Aug 2010 06:37:30 +1000
From: Peter Jeremy 
To: Alexey Dokuchaev 
Message-ID: <20100818203730.GA55464@server.vk2pj.dyndns.org>
References: <201008142148.o7ELmMTO039767@svn.freebsd.org>
	<20100817193757.GA92936@FreeBSD.org> <86hbisb8g2.fsf@ds4.des.no>
	<20100818193013.GA61328@FreeBSD.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="FCuugMFkClbJLl1L"
Content-Disposition: inline
In-Reply-To: <20100818193013.GA61328@FreeBSD.org>
X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: svn-src-head@FreeBSD.org, Dag-Erling Sm??rgrav ,
	svn-src-all@FreeBSD.org, src-committers@FreeBSD.org,
	Jens Schweikhardt 
Subject: Re: svn commit: r211318 - head/usr.sbin/sysinstall
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 18 Aug 2010 20:37:41 -0000


--FCuugMFkClbJLl1L
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On 2010-Aug-18 19:30:13 +0000, Alexey Dokuchaev  wrote:
>Actually, I did; but the last hunk is just a whitespace change,
>irrelevant to the commit message (just as most of the other hunks).
>No wonder I missed the hunk before the last one.

Probably a good example of why the Project's guidelines require the
separation of whitespace and functional changes.

--=20
Peter Jeremy

--FCuugMFkClbJLl1L
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (FreeBSD)

iEYEARECAAYFAkxsRIoACgkQ/opHv/APuIeYkACfdk7sSkQpOqParPIqD9EYFVy/
zX8Anjc5jjsxa1HFdpoIfM0BMwIk8A6H
=ZZhK
-----END PGP SIGNATURE-----

--FCuugMFkClbJLl1L--

From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 20:38:47 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BADAD10656C5;
	Wed, 18 Aug 2010 20:38:47 +0000 (UTC)
	(envelope-from gavin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A9F898FC27;
	Wed, 18 Aug 2010 20:38:47 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7IKcl38079816;
	Wed, 18 Aug 2010 20:38:47 GMT (envelope-from gavin@svn.freebsd.org)
Received: (from gavin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7IKclaB079814;
	Wed, 18 Aug 2010 20:38:47 GMT (envelope-from gavin@svn.freebsd.org)
Message-Id: <201008182038.o7IKclaB079814@svn.freebsd.org>
From: Gavin Atkinson 
Date: Wed, 18 Aug 2010 20:38: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: r211468 - stable/8/release/picobsd/tinyware/login
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 18 Aug 2010 20:38:47 -0000

Author: gavin
Date: Wed Aug 18 20:38:47 2010
New Revision: 211468
URL: http://svn.freebsd.org/changeset/base/211468

Log:
  Merge r211077, r211079 from head:
  
    Correct two error messages to match the failure they are reporting.
  
    Correct the login.conf variable name used for obtaining the login prompt.

Modified:
  stable/8/release/picobsd/tinyware/login/pico-login.c
Directory Properties:
  stable/8/release/picobsd/tinyware/login/   (props changed)

Modified: stable/8/release/picobsd/tinyware/login/pico-login.c
==============================================================================
--- stable/8/release/picobsd/tinyware/login/pico-login.c	Wed Aug 18 20:26:50 2010	(r211467)
+++ stable/8/release/picobsd/tinyware/login/pico-login.c	Wed Aug 18 20:38:47 2010	(r211468)
@@ -278,7 +278,8 @@ main(argc, argv)
 	 * Get "login-retries" & "login-backoff" from default class
 	 */
 	lc = login_getclass(NULL);
-	prompt = login_getcapstr(lc, "prompt", DEFAULT_PROMPT, DEFAULT_PROMPT);
+	prompt = login_getcapstr(lc, "login_prompt",
+	    DEFAULT_PROMPT, DEFAULT_PROMPT);
 	passwd_prompt = login_getcapstr(lc, "passwd_prompt",
 	    DEFAULT_PASSWD_PROMPT, DEFAULT_PASSWD_PROMPT);
 	retries = login_getcapnum(lc, "login-retries", DEFAULT_RETRIES,
@@ -533,10 +534,10 @@ main(argc, argv)
 	 * devices, we just clear them.
 	 */
 	if (chflags(ttyn, 0) && errno != EOPNOTSUPP)
-		syslog(LOG_ERR, "chmod(%s): %m", ttyn);
+		syslog(LOG_ERR, "chflags(%s): %m", ttyn);
 	if (chown(ttyn, pwd->pw_uid,
 	    (gr = getgrnam(TTYGRPNAME)) ? gr->gr_gid : pwd->pw_gid))
-		syslog(LOG_ERR, "chmod(%s): %m", ttyn);
+		syslog(LOG_ERR, "chown(%s): %m", ttyn);
 
 
 	/*

From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 20:39:00 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7B5DB10656DF;
	Wed, 18 Aug 2010 20:39:00 +0000 (UTC)
	(envelope-from gavin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6A6928FC20;
	Wed, 18 Aug 2010 20:39:00 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7IKd0uh079855;
	Wed, 18 Aug 2010 20:39:00 GMT (envelope-from gavin@svn.freebsd.org)
Received: (from gavin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7IKd0vp079853;
	Wed, 18 Aug 2010 20:39:00 GMT (envelope-from gavin@svn.freebsd.org)
Message-Id: <201008182039.o7IKd0vp079853@svn.freebsd.org>
From: Gavin Atkinson 
Date: Wed, 18 Aug 2010 20:39:00 +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: r211469 - stable/7/release/picobsd/tinyware/login
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 18 Aug 2010 20:39:00 -0000

Author: gavin
Date: Wed Aug 18 20:39:00 2010
New Revision: 211469
URL: http://svn.freebsd.org/changeset/base/211469

Log:
  Merge r211077, r211079 from head:
  
    Correct two error messages to match the failure they are reporting.
  
    Correct the login.conf variable name used for obtaining the login prompt.

Modified:
  stable/7/release/picobsd/tinyware/login/pico-login.c
Directory Properties:
  stable/7/release/picobsd/tinyware/login/   (props changed)

Modified: stable/7/release/picobsd/tinyware/login/pico-login.c
==============================================================================
--- stable/7/release/picobsd/tinyware/login/pico-login.c	Wed Aug 18 20:38:47 2010	(r211468)
+++ stable/7/release/picobsd/tinyware/login/pico-login.c	Wed Aug 18 20:39:00 2010	(r211469)
@@ -278,7 +278,8 @@ main(argc, argv)
 	 * Get "login-retries" & "login-backoff" from default class
 	 */
 	lc = login_getclass(NULL);
-	prompt = login_getcapstr(lc, "prompt", DEFAULT_PROMPT, DEFAULT_PROMPT);
+	prompt = login_getcapstr(lc, "login_prompt",
+	    DEFAULT_PROMPT, DEFAULT_PROMPT);
 	passwd_prompt = login_getcapstr(lc, "passwd_prompt",
 	    DEFAULT_PASSWD_PROMPT, DEFAULT_PASSWD_PROMPT);
 	retries = login_getcapnum(lc, "login-retries", DEFAULT_RETRIES,
@@ -533,10 +534,10 @@ main(argc, argv)
 	 * devices, we just clear them.
 	 */
 	if (chflags(ttyn, 0) && errno != EOPNOTSUPP)
-		syslog(LOG_ERR, "chmod(%s): %m", ttyn);
+		syslog(LOG_ERR, "chflags(%s): %m", ttyn);
 	if (chown(ttyn, pwd->pw_uid,
 	    (gr = getgrnam(TTYGRPNAME)) ? gr->gr_gid : pwd->pw_gid))
-		syslog(LOG_ERR, "chmod(%s): %m", ttyn);
+		syslog(LOG_ERR, "chown(%s): %m", ttyn);
 
 
 	/*

From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 20:42:30 2010
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: by hub.freebsd.org (Postfix, from userid 1033)
	id 1C9501065693; Wed, 18 Aug 2010 20:42:30 +0000 (UTC)
Date: Wed, 18 Aug 2010 20:42:30 +0000
From: Alexey Dokuchaev 
To: Peter Jeremy 
Message-ID: <20100818204230.GA78161@FreeBSD.org>
References: <201008142148.o7ELmMTO039767@svn.freebsd.org>
	<20100817193757.GA92936@FreeBSD.org> <86hbisb8g2.fsf@ds4.des.no>
	<20100818193013.GA61328@FreeBSD.org>
	<20100818203730.GA55464@server.vk2pj.dyndns.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=koi8-r
Content-Disposition: inline
In-Reply-To: <20100818203730.GA55464@server.vk2pj.dyndns.org>
User-Agent: Mutt/1.4.2.1i
Cc: svn-src-head@FreeBSD.org, Dag-Erling Sm??rgrav ,
	svn-src-all@FreeBSD.org, src-committers@FreeBSD.org,
	Jens Schweikhardt 
Subject: Re: svn commit: r211318 - head/usr.sbin/sysinstall
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 18 Aug 2010 20:42:30 -0000

On Thu, Aug 19, 2010 at 06:37:30AM +1000, Peter Jeremy wrote:
> On 2010-Aug-18 19:30:13 +0000, Alexey Dokuchaev  wrote:
> >Actually, I did; but the last hunk is just a whitespace change,
> >irrelevant to the commit message (just as most of the other hunks).
> >No wonder I missed the hunk before the last one.
> 
> Probably a good example of why the Project's guidelines require the
> separation of whitespace and functional changes.

That was exactly my point.  :-)

./danfe

From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 20:48:43 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 576811065673;
	Wed, 18 Aug 2010 20:48:43 +0000 (UTC)
	(envelope-from mdf356@gmail.com)
Received: from mail-ew0-f54.google.com (mail-ew0-f54.google.com
	[209.85.215.54])
	by mx1.freebsd.org (Postfix) with ESMTP id 33C818FC15;
	Wed, 18 Aug 2010 20:48:41 +0000 (UTC)
Received: by ewy26 with SMTP id 26so882731ewy.13
	for ; Wed, 18 Aug 2010 13:48:41 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:sender:received
	:in-reply-to:references:date:x-google-sender-auth:message-id:subject
	:from:to:content-type:content-transfer-encoding;
	bh=QRhPZHnignX8FQXzgeixwmAsg2iWfXnf8Owvqgwf5LY=;
	b=SZE18KSPw1LH9TTwlXaEkj9HGFoAqkV30nyN84CwAu21kVgvdLJ0gMjEVn6nxq6wmm
	3oXfN25YvDXZXVBby7cY+98nzYQMp44uehzaexGYTYYniwVVNKsZUNn8Micd3+pt2hhW
	XFrbUDA/OlD8o2cnfc0yTKC2CpjPjqSw8vMkQ=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:content-type
	:content-transfer-encoding;
	b=m9GUXdzkjR/ExxxwoFMc7wtYBimz5tTXLO9B1ISRAwPegpHrwO8XTKE0CofWuWZ/r1
	+7EJZMiqT42xnavJy38uR39YGxZAfW7KPABeiVLYJwy/E1yl4FP/O0LJEN4vQEQAx7Sn
	2CbrIjgFDX/JdT8zJdkPDJxHloTaN3R8ZgufU=
MIME-Version: 1.0
Received: by 10.213.14.208 with SMTP id h16mr842198eba.14.1282164520704; Wed,
	18 Aug 2010 13:48:40 -0700 (PDT)
Sender: mdf356@gmail.com
Received: by 10.213.108.132 with HTTP; Wed, 18 Aug 2010 13:48:40 -0700 (PDT)
In-Reply-To: <201008181740.o7IHeA4c075984@svn.freebsd.org>
References: <201008181740.o7IHeA4c075984@svn.freebsd.org>
Date: Wed, 18 Aug 2010 13:48:40 -0700
X-Google-Sender-Auth: 05wtm3wIyWRbFmjKHqTUY_Z0Ce8
Message-ID: 
From: mdf@FreeBSD.org
To: Gabor Kovesdan , src-committers@freebsd.org,
	svn-src-all@freebsd.org, svn-src-head@freebsd.org
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: 
Subject: Re: svn commit: r211463 - head/usr.bin/grep
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 18 Aug 2010 20:48:43 -0000

On Wed, Aug 18, 2010 at 10:40 AM, Gabor Kovesdan  wrote:
> Author: gabor
> Date: Wed Aug 18 17:40:10 2010
> New Revision: 211463
> URL: http://svn.freebsd.org/changeset/base/211463
>
> Log:
> =A0- Refactor file reading code to use pure syscalls and an internal buff=
er
> =A0 =A0instead of stdio. =A0This gives BSD grep a very big performance bo=
ost,
> =A0 =A0its speed is now almost comparable to GNU grep.

I didn't read all of the details in the profiling mails in the thread,
but does this mean that work on stdio would give a performance boost
to many apps?  Or is there something specific about how grep(1) is
using its input that makes it a horse of a different color?

Thanks,
matthew


>
> =A0Submitted by: Dimitry Andric 
> =A0Approved by: =A0delphij (mentor)
>
> Modified:
> =A0head/usr.bin/grep/fastgrep.c
> =A0head/usr.bin/grep/file.c
> =A0head/usr.bin/grep/grep.h
> =A0head/usr.bin/grep/util.c
>
> Modified: head/usr.bin/grep/fastgrep.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/grep/fastgrep.c =A0 =A0 =A0 =A0Wed Aug 18 17:39:47 2010 =
=A0 =A0 =A0 =A0(r211462)
> +++ head/usr.bin/grep/fastgrep.c =A0 =A0 =A0 =A0Wed Aug 18 17:40:10 2010 =
=A0 =A0 =A0 =A0(r211463)
> @@ -198,7 +198,7 @@ fastcomp(fastgrep_t *fg, const char *pat
> =A0}
>
> =A0int
> -grep_search(fastgrep_t *fg, unsigned char *data, size_t len, regmatch_t =
*pmatch)
> +grep_search(fastgrep_t *fg, const unsigned char *data, size_t len, regma=
tch_t *pmatch)
> =A0{
> =A0 =A0 =A0 =A0unsigned int j;
> =A0 =A0 =A0 =A0int ret =3D REG_NOMATCH;
>
> Modified: head/usr.bin/grep/file.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/grep/file.c =A0 =A0Wed Aug 18 17:39:47 2010 =A0 =A0 =A0 =
=A0(r211462)
> +++ head/usr.bin/grep/file.c =A0 =A0Wed Aug 18 17:40:10 2010 =A0 =A0 =A0 =
=A0(r211463)
> @@ -2,7 +2,8 @@
>
> =A0/*-
> =A0* Copyright (c) 1999 James Howard and Dag-Erling Co=EFdan Sm=F8rgrav
> - * Copyright (C) 2008-2009 Gabor Kovesdan 
> + * Copyright (C) 2008-2010 Gabor Kovesdan 
> + * Copyright (C) 2010 Dimitry Andric 
> =A0* All rights reserved.
> =A0*
> =A0* Redistribution and use in source and binary forms, with or without
> @@ -37,7 +38,8 @@ __FBSDID("$FreeBSD$");
> =A0#include 
> =A0#include 
> =A0#include 
> -#include 
> +#include 
> +#include 
> =A0#include 
> =A0#include 
> =A0#include 
> @@ -47,222 +49,204 @@ __FBSDID("$FreeBSD$");
>
> =A0#include "grep.h"
>
> -static char =A0 =A0 fname[MAXPATHLEN]; =A0 =A0 /* file name */
> +#define =A0 =A0 =A0 =A0MAXBUFSIZ =A0 =A0 =A0 (32 * 1024)
> +#define =A0 =A0 =A0 =A0LNBUFBUMP =A0 =A0 =A0 80
>
> -#define =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 MAXBUFSIZ =A0 =A0 =A0(16 * 1024)
> -#define =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 PREREAD_M =A0 =A0 =A00.2
> +static gzFile gzbufdesc;
> +static BZFILE* bzbufdesc;
>
> -/* Some global variables for the buffering and reading. */
> -static char =A0 =A0*lnbuf;
> -static size_t =A0 lnbuflen;
> -static unsigned char *binbuf;
> -static int =A0 =A0 =A0binbufsiz;
> -unsigned char =A0*binbufptr;
> -static int =A0 =A0 =A0bzerr;
> +static unsigned char buffer[MAXBUFSIZ];
> +static unsigned char *bufpos;
> +static size_t bufrem;
>
> -#define iswbinary(ch) =A0(!iswspace((ch)) && iswcntrl((ch)) && \
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (ch !=3D L'\b') && =
(ch !=3D L'\0'))
> +static unsigned char *lnbuf;
> +static size_t lnbuflen;
>
> -/*
> - * Returns a single character according to the file type.
> - * Returns -1 on failure.
> - */
> =A0static inline int
> -grep_fgetc(struct file *f)
> +grep_refill(struct file *f)
> =A0{
> - =A0 =A0 =A0 unsigned char c;
> + =A0 =A0 =A0 ssize_t nr;
> + =A0 =A0 =A0 int bzerr;
>
> - =A0 =A0 =A0 switch (filebehave) {
> - =A0 =A0 =A0 case FILE_STDIO:
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (getc_unlocked(f->f));
> - =A0 =A0 =A0 case FILE_GZIP:
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (gzgetc(f->gzf));
> - =A0 =A0 =A0 case FILE_BZIP:
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 BZ2_bzRead(&bzerr, f->bzf, &c, 1);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (bzerr =3D=3D BZ_STREAM_END)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (-1);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 else if (bzerr !=3D BZ_SEQUENCE_ERROR && bz=
err !=3D BZ_OK)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 errx(2, "%s", getstr(2));
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (c);
> - =A0 =A0 =A0 }
> - =A0 =A0 =A0 return (-1);
> + =A0 =A0 =A0 bufpos =3D buffer;
> + =A0 =A0 =A0 bufrem =3D 0;
> +
> + =A0 =A0 =A0 if (filebehave =3D=3D FILE_GZIP)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 nr =3D gzread(gzbufdesc, buffer, MAXBUFSIZ)=
;
> + =A0 =A0 =A0 else if (filebehave =3D=3D FILE_BZIP && bzbufdesc !=3D NULL=
) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 nr =3D BZ2_bzRead(&bzerr, bzbufdesc, buffer=
, MAXBUFSIZ);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 switch (bzerr) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 case BZ_OK:
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 case BZ_STREAM_END:
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* No problem, nr will be o=
kay */
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 case BZ_DATA_ERROR_MAGIC:
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /*
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* As opposed to gzread()=
, which simply returns the
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* plain file data, if it=
 is not in the correct
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* compressed format, BZ2=
_bzRead() instead aborts.
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* So, just restart at th=
e beginning of the file again,
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* and use plain reads fr=
om now on.
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0*/
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 BZ2_bzReadClose(&bzerr, bzb=
ufdesc);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 bzbufdesc =3D NULL;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (lseek(f->fd, 0, SEEK_SE=
T) =3D=3D -1)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (-1)=
;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 nr =3D read(f->fd, buffer, =
MAXBUFSIZ);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 default:
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Make sure we exit with a=
n error */
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 nr =3D -1;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 }
> + =A0 =A0 =A0 } else
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 nr =3D read(f->fd, buffer, MAXBUFSIZ);
> +
> + =A0 =A0 =A0 if (nr < 0)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (-1);
> +
> + =A0 =A0 =A0 bufrem =3D nr;
> + =A0 =A0 =A0 return (0);
> =A0}
>
> -/*
> - * Returns true if the file position is a EOF, returns false
> - * otherwise.
> - */
> =A0static inline int
> -grep_feof(struct file *f)
> +grep_lnbufgrow(size_t newlen)
> =A0{
>
> - =A0 =A0 =A0 switch (filebehave) {
> - =A0 =A0 =A0 case FILE_STDIO:
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (feof_unlocked(f->f));
> - =A0 =A0 =A0 case FILE_GZIP:
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (gzeof(f->gzf));
> - =A0 =A0 =A0 case FILE_BZIP:
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (bzerr =3D=3D BZ_STREAM_END);
> + =A0 =A0 =A0 if (lnbuflen < newlen) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 lnbuf =3D grep_realloc(lnbuf, newlen);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 lnbuflen =3D newlen;
> =A0 =A0 =A0 =A0}
> - =A0 =A0 =A0 return (1);
> +
> + =A0 =A0 =A0 return (0);
> =A0}
>
> -/*
> - * At the first call, fills in an internal buffer and checks if the give=
n
> - * file is a binary file and sets the binary flag accordingly. =A0Then r=
eturns
> - * a single line and sets len to the length of the returned line.
> - * At any other call returns a single line either from the internal buff=
er
> - * or from the file if the buffer is exhausted and sets len to the lengt=
h
> - * of the line.
> - */
> =A0char *
> -grep_fgetln(struct file *f, size_t *len)
> +grep_fgetln(struct file *f, size_t *lenp)
> =A0{
> - =A0 =A0 =A0 struct stat st;
> - =A0 =A0 =A0 size_t bufsiz, i =3D 0;
> - =A0 =A0 =A0 int ch =3D 0;
> -
> - =A0 =A0 =A0 /* Fill in the buffer if it is empty. */
> - =A0 =A0 =A0 if (binbufptr =3D=3D NULL) {
> -
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Only pre-read to the buffer if we need t=
he binary check. */
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (binbehave !=3D BINFILE_TEXT) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (f->stdin)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 st.st_size =
=3D MAXBUFSIZ;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 else if (stat(fname, &st) !=
=3D 0)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 err(2, NULL=
);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* no need to allocate buff=
er. */
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (st.st_size =3D=3D 0)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (NUL=
L);
> -
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 bufsiz =3D (MAXBUFSIZ > (st=
.st_size * PREREAD_M)) ?
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (st.st_size / 2) : =
MAXBUFSIZ;
> -
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 binbuf =3D grep_malloc(size=
of(char) * bufsiz);
> -
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 while (i < bufsiz) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ch =3D grep=
_fgetc(f);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (ch =3D=
=3D EOF)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 break;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 binbuf[i++]=
 =3D ch;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((ch =3D=
=3D '\n') && lbflag)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 break;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 }
> -
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 f->binary =3D memchr(binbuf=
, (filebehave !=3D FILE_GZIP) ?
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 '\0' : '\200', i - =
1) !=3D NULL;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 }
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 binbufsiz =3D i;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 binbufptr =3D binbuf;
> - =A0 =A0 =A0 }
> -
> - =A0 =A0 =A0 /* Read a line whether from the buffer or from the file its=
elf. */
> - =A0 =A0 =A0 for (i =3D 0; !(grep_feof(f) &&
> - =A0 =A0 =A0 =A0 =A0 (binbufptr =3D=3D &binbuf[binbufsiz])); i++) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (binbufptr =3D=3D &binbuf[binbufsiz]) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ch =3D grep_fgetc(f);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 } else {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ch =3D binbufptr[0];
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 binbufptr++;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 }
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (i >=3D lnbuflen) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 lnbuflen *=3D 2;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 lnbuf =3D grep_realloc(lnbu=
f, ++lnbuflen);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 }
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((ch =3D=3D '\n') || (ch =3D=3D EOF)) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 lnbuf[i] =3D '\0';
> + =A0 =A0 =A0 unsigned char *p;
> + =A0 =A0 =A0 char *ret;
> + =A0 =A0 =A0 size_t len;
> + =A0 =A0 =A0 size_t off;
> + =A0 =A0 =A0 ptrdiff_t diff;
> +
> + =A0 =A0 =A0 /* Fill the buffer, if necessary */
> + =A0 =A0 =A0 if (bufrem =3D=3D 0 && grep_refill(f) !=3D 0)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto error;
> +
> + =A0 =A0 =A0 if (bufrem =3D=3D 0) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Return zero length to indicate EOF */
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 *lenp =3D 0;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (bufpos);
> + =A0 =A0 =A0 }
> +
> + =A0 =A0 =A0 /* Look for a newline in the remaining part of the buffer *=
/
> + =A0 =A0 =A0 if ((p =3D memchr(bufpos, '\n', bufrem)) !=3D NULL) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ++p; /* advance over newline */
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ret =3D bufpos;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 len =3D p - bufpos;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 bufrem -=3D len;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 bufpos =3D p;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 *lenp =3D len;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (ret);
> + =A0 =A0 =A0 }
> +
> + =A0 =A0 =A0 /* We have to copy the current buffered data to the line bu=
ffer */
> + =A0 =A0 =A0 for (len =3D bufrem, off =3D 0; ; len +=3D bufrem) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Make sure there is room for more data */
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (grep_lnbufgrow(len + LNBUFBUMP))
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto error;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 memcpy(lnbuf + off, bufpos, len - off);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 off =3D len;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (grep_refill(f) !=3D 0)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto error;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (bufrem =3D=3D 0)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* EOF: return partial line=
 */
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 } else
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 lnbuf[i] =3D ch;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((p =3D memchr(bufpos, '\n', bufrem)) =
=3D=3D NULL)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 continue;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* got it: finish up the line (like code ab=
ove) */
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 ++p;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 diff =3D p - bufpos;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 len +=3D diff;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (grep_lnbufgrow(len))
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto error;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 memcpy(lnbuf + off, bufpos, diff);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 bufrem -=3D diff;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 bufpos =3D p;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 break;
> =A0 =A0 =A0 =A0}
> - =A0 =A0 =A0 if (grep_feof(f) && (i =3D=3D 0) && (ch !=3D '\n'))
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (NULL);
> - =A0 =A0 =A0 *len =3D i;
> + =A0 =A0 =A0 *lenp =3D len;
> =A0 =A0 =A0 =A0return (lnbuf);
> +
> +error:
> + =A0 =A0 =A0 *lenp =3D 0;
> + =A0 =A0 =A0 return (NULL);
> =A0}
>
> -/*
> - * Opens the standard input for processing.
> - */
> -struct file *
> -grep_stdin_open(void)
> +static inline struct file *
> +grep_file_init(struct file *f)
> =A0{
> - =A0 =A0 =A0 struct file *f;
>
> - =A0 =A0 =A0 /* Processing stdin implies --line-buffered for tail -f to =
work. */
> - =A0 =A0 =A0 lbflag =3D true;
> + =A0 =A0 =A0 if (filebehave =3D=3D FILE_GZIP &&
> + =A0 =A0 =A0 =A0 =A0 (gzbufdesc =3D gzdopen(f->fd, "r")) =3D=3D NULL)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto error;
>
> - =A0 =A0 =A0 snprintf(fname, sizeof fname, "%s", getstr(1));
> + =A0 =A0 =A0 if (filebehave =3D=3D FILE_BZIP &&
> + =A0 =A0 =A0 =A0 =A0 (bzbufdesc =3D BZ2_bzdopen(f->fd, "r")) =3D=3D NULL=
)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto error;
>
> - =A0 =A0 =A0 f =3D grep_malloc(sizeof *f);
> + =A0 =A0 =A0 /* Fill read buffer, also catches errors early */
> + =A0 =A0 =A0 if (grep_refill(f) !=3D 0)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto error;
>
> - =A0 =A0 =A0 binbuf =3D NULL;
> - =A0 =A0 =A0 if ((f->f =3D fdopen(STDIN_FILENO, "r")) !=3D NULL) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 flockfile(f->f);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 f->stdin =3D true;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (f);
> - =A0 =A0 =A0 }
> + =A0 =A0 =A0 /* Check for binary stuff, if necessary */
> + =A0 =A0 =A0 if (binbehave !=3D BINFILE_TEXT && memchr(bufpos, '\0', buf=
rem) !=3D NULL)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 f->binary =3D true;
>
> + =A0 =A0 =A0 return (f);
> +error:
> + =A0 =A0 =A0 close(f->fd);
> =A0 =A0 =A0 =A0free(f);
> =A0 =A0 =A0 =A0return (NULL);
> =A0}
>
> =A0/*
> - * Opens a normal, a gzipped or a bzip2 compressed file for processing.
> + * Opens a file for processing.
> =A0*/
> =A0struct file *
> =A0grep_open(const char *path)
> =A0{
> =A0 =A0 =A0 =A0struct file *f;
>
> - =A0 =A0 =A0 snprintf(fname, sizeof fname, "%s", path);
> -
> =A0 =A0 =A0 =A0f =3D grep_malloc(sizeof *f);
> -
> - =A0 =A0 =A0 binbuf =3D NULL;
> - =A0 =A0 =A0 f->stdin =3D false;
> - =A0 =A0 =A0 switch (filebehave) {
> - =A0 =A0 =A0 case FILE_STDIO:
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((f->f =3D fopen(path, "r")) !=3D NULL) =
{
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 flockfile(f->f);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (f);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 }
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 break;
> - =A0 =A0 =A0 case FILE_GZIP:
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((f->gzf =3D gzopen(fname, "r")) !=3D NU=
LL)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (f);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 break;
> - =A0 =A0 =A0 case FILE_BZIP:
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((f->bzf =3D BZ2_bzopen(fname, "r")) !=
=3D NULL)
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (f);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 break;
> + =A0 =A0 =A0 memset(f, 0, sizeof *f);
> + =A0 =A0 =A0 if (path =3D=3D NULL) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Processing stdin implies --line-buffered=
. */
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 lbflag =3D true;
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 f->fd =3D STDIN_FILENO;
> + =A0 =A0 =A0 } else if ((f->fd =3D open(path, O_RDONLY)) =3D=3D -1) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 free(f);
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (NULL);
> =A0 =A0 =A0 =A0}
>
> - =A0 =A0 =A0 free(f);
> - =A0 =A0 =A0 return (NULL);
> + =A0 =A0 =A0 return (grep_file_init(f));
> =A0}
>
> =A0/*
> - * Closes a normal, a gzipped or a bzip2 compressed file.
> + * Closes a file.
> =A0*/
> =A0void
> =A0grep_close(struct file *f)
> =A0{
>
> - =A0 =A0 =A0 switch (filebehave) {
> - =A0 =A0 =A0 case FILE_STDIO:
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 funlockfile(f->f);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 fclose(f->f);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 break;
> - =A0 =A0 =A0 case FILE_GZIP:
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 gzclose(f->gzf);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 break;
> - =A0 =A0 =A0 case FILE_BZIP:
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 BZ2_bzclose(f->bzf);
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 break;
> - =A0 =A0 =A0 }
> + =A0 =A0 =A0 close(f->fd);
>
> - =A0 =A0 =A0 /* Reset read buffer for the file we are closing */
> - =A0 =A0 =A0 binbufptr =3D NULL;
> - =A0 =A0 =A0 free(binbuf);
> + =A0 =A0 =A0 /* Reset read buffer and line buffer */
> + =A0 =A0 =A0 bufpos =3D buffer;
> + =A0 =A0 =A0 bufrem =3D 0;
> +
> + =A0 =A0 =A0 free(lnbuf);
> + =A0 =A0 =A0 lnbuf =3D NULL;
> + =A0 =A0 =A0 lnbuflen =3D 0;
> =A0}
>
> Modified: head/usr.bin/grep/grep.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/usr.bin/grep/grep.h =A0 =A0Wed Aug 18 17:39:47 2010 =A0 =A0 =A0 =
=A0(r211462)
> +++ head/usr.bin/grep/grep.h =A0 =A0Wed Aug 18 17:40:10 2010 =A0 =A0 =A0 =
=A0(r211463)
> @@ -77,12 +77,8 @@ extern const char =A0 =A0 =A0 =A0 =A0 =A0*errstr[];
> =A0#define MAX_LINE_MATCHES =A0 =A0 =A0 32
>
> =A0struct file {
> - =A0 =A0 =A0 struct mmfile =A0 *mmf;
> - =A0 =A0 =A0 BZFILE =A0 =A0 =A0 =A0 =A0*bzf;
> - =A0 =A0 =A0 FILE =A0 =A0 =A0 =A0 =A0 =A0*f;
> - =A0 =A0 =A0 gzFile =A0 =A0 =A0 =A0 =A0*gzf;
> + =A0 =A0 =A0 int =A0 =A0 =A0 =A0 =A0 =A0 =A0fd;
> =A0 =A0 =A0 =A0bool =A0 =A0 =A0 =A0 =A0 =A0 binary;
> - =A0 =A0 =A0 bool =A0 =A0 =A0 =A0 =A0 =A0 stdin;
> =A0};
>
> =A0struct str {
> @@ -150,11 +146,10 @@ void =A0 =A0 =A0 clearqueue(void);
>
> =A0/* file.c */
> =A0void =A0 =A0 =A0 =A0 =A0 =A0grep_close(struct file *f);
> -struct file =A0 =A0*grep_stdin_open(void);
> =A0struct file =A0 =A0*grep_open(const char *path);
> =A0char =A0 =A0 =A0 =A0 =A0 *grep_fgetln(struct file *f, size_t *len);
>
> =A0/* fastgrep.c */
> =A0int =A0 =A0 =A0 =A0 =A0 =A0 fastcomp(fastgrep_t *, const char *);
> =A0void =A0 =A0 =A0 =A0 =A0 =A0fgrepcomp(fastgrep_t *, const char *);
> -int =A0 =A0 =A0 =A0 =A0 =A0 grep_search(fastgrep_t *, unsigned char *, s=
ize_t, regmatch_t *);
> +int =A0 =A0 =A0 =A0 =A0 =A0 grep_search(fastgrep_t *, const unsigned cha=
r *, size_t, regmatch_t *);
>
> Modified: head/usr.bin/grep/util.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/grep/util.c =A0 =A0Wed Aug 18 17:39:47 2010 =A0 =A0 =A0 =
=A0(r211462)
> +++ head/usr.bin/grep/util.c =A0 =A0Wed Aug 18 17:40:10 2010 =A0 =A0 =A0 =
=A0(r211463)
> @@ -184,7 +184,7 @@ procfile(const char *fn)
>
> =A0 =A0 =A0 =A0if (strcmp(fn, "-") =3D=3D 0) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0fn =3D label !=3D NULL ? label : getstr(1)=
;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 f =3D grep_stdin_open();
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 f =3D grep_open(NULL);
> =A0 =A0 =A0 =A0} else {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (!stat(fn, &sb)) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/* Check if we need to pro=
cess the file */
> @@ -215,7 +215,7 @@ procfile(const char *fn)
>
> =A0 =A0 =A0 =A0for (c =3D 0; =A0c =3D=3D 0 || !(lflag || qflag); ) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ln.off +=3D ln.len + 1;
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((ln.dat =3D grep_fgetln(f, &ln.len)) =
=3D=3D NULL) {
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((ln.dat =3D grep_fgetln(f, &ln.len)) =
=3D=3D NULL || ln.len =3D=3D 0) {
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (ln.line_no =3D=3D 0 &&=
 matchall)
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0exit(0);
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0else
>

From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 21:02:38 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4CF6B1065696;
	Wed, 18 Aug 2010 21:02:38 +0000 (UTC)
	(envelope-from gabor@FreeBSD.org)
Received: from server.mypc.hu (server.mypc.hu [87.229.73.95])
	by mx1.freebsd.org (Postfix) with ESMTP id 0301C8FC17;
	Wed, 18 Aug 2010 21:02:37 +0000 (UTC)
Received: from server.mypc.hu (localhost [127.0.0.1])
	by server.mypc.hu (Postfix) with ESMTP id 3C19E14DC6E8;
	Wed, 18 Aug 2010 23:02:37 +0200 (CEST)
X-Virus-Scanned: amavisd-new at server.mypc.hu
Received: from server.mypc.hu ([127.0.0.1])
	by server.mypc.hu (server.mypc.hu [127.0.0.1]) (amavisd-new, port 10024)
	with LMTP id umeqWp3ykYvU; Wed, 18 Aug 2010 23:02:34 +0200 (CEST)
Received: from [192.168.1.105] (catv-80-99-92-167.catv.broadband.hu
	[80.99.92.167])
	(using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
	(No client certificate requested)
	by server.mypc.hu (Postfix) with ESMTPSA id 924E314DC315;
	Wed, 18 Aug 2010 23:02:34 +0200 (CEST)
Message-ID: <4C6C4A67.4000002@FreeBSD.org>
Date: Wed, 18 Aug 2010 23:02:31 +0200
From: Gabor Kovesdan 
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-PT;
	rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2
MIME-Version: 1.0
To: mdf@FreeBSD.org
References: <201008181740.o7IHeA4c075984@svn.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
Subject: Re: svn commit: r211463 - head/usr.bin/grep
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 18 Aug 2010 21:02:38 -0000

  Em 2010.08.18. 22:48, mdf@FreeBSD.org escreveu:
> On Wed, Aug 18, 2010 at 10:40 AM, Gabor Kovesdan  wrote:
>> Author: gabor
>> Date: Wed Aug 18 17:40:10 2010
>> New Revision: 211463
>> URL: http://svn.freebsd.org/changeset/base/211463
>>
>> Log:
>>   - Refactor file reading code to use pure syscalls and an internal buffer
>>     instead of stdio.  This gives BSD grep a very big performance boost,
>>     its speed is now almost comparable to GNU grep.
> I didn't read all of the details in the profiling mails in the thread,
> but does this mean that work on stdio would give a performance boost
> to many apps?  Or is there something specific about how grep(1) is
> using its input that makes it a horse of a different color?
In stdio, there is some overhead of FILE * locking but in first phase we 
reduced that overhead by locking once after opening and releasing the 
lock once before closing (it's fine given that grep isn't threaded). In 
the previous code, grep read data by character (calling fgetc_unlocked) 
and now it reads in bigger chunks, this is another difference, which may 
have improved the performance. We haven't checked using stdio in chunks, 
because dealing directly with file descriptors made it easier to handle 
gzip/bzip2 files, so after having seen that the old solution was wrong, 
this idea came directly. So I cannot surely answer the question. It 
would be an interesting task to run a benchmark on this, though.

Gabor


From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 21:17:57 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 79C751065697;
	Wed, 18 Aug 2010 21:17:57 +0000 (UTC)
	(envelope-from gavin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 67B458FC13;
	Wed, 18 Aug 2010 21:17:57 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7ILHvXr080664;
	Wed, 18 Aug 2010 21:17:57 GMT (envelope-from gavin@svn.freebsd.org)
Received: (from gavin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7ILHvMo080661;
	Wed, 18 Aug 2010 21:17:57 GMT (envelope-from gavin@svn.freebsd.org)
Message-Id: <201008182117.o7ILHvMo080661@svn.freebsd.org>
From: Gavin Atkinson 
Date: Wed, 18 Aug 2010 21:17:57 +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: r211470 - in stable/8/sys/dev/usb: . serial
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 18 Aug 2010 21:17:57 -0000

Author: gavin
Date: Wed Aug 18 21:17:57 2010
New Revision: 211470
URL: http://svn.freebsd.org/changeset/base/211470

Log:
  Merge r210524 from head:
  
    - Support two devices made by West Mountain Radio in uslcom(4) [1]
  
    - Remove duplicate SILABS CP2102 define from usbdevs
  
  Merge r211022 from head:
  
    Sync the list of devices supported by uslcom(4) with NetBSD, Linux, OpenBSD
    and BeOS.  The devices supported by uslcom(4) are now in sync with:
  
    NetBSD  src/sys/dev/usb/uslsa.c 1.11
    OpenBSD src/sys/dev/usb/uslcom.c 1.20
    Linux   source/drivers/usb/serial/cp210x.c from kernel 2.6.35
    BeOS    usb_serial/driver.c 1.32
  
    Two vendor/product IDs from Linux have not been added to uslcom(4):
      SILABS SAEL - This device has special code in u3g to support it
      SILABS GSM2228 - I suspect this should also be covered by u3g(4).
  
  PR:		usb/131912 [1]
  Submitted by:	Jack Twilley  [1]

Modified:
  stable/8/sys/dev/usb/serial/uslcom.c
  stable/8/sys/dev/usb/usbdevs
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cam/   (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/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/serial/uslcom.c
==============================================================================
--- stable/8/sys/dev/usb/serial/uslcom.c	Wed Aug 18 20:39:00 2010	(r211469)
+++ stable/8/sys/dev/usb/serial/uslcom.c	Wed Aug 18 21:17:57 2010	(r211470)
@@ -177,23 +177,78 @@ static struct ucom_callback uslcom_callb
 static const struct usb_device_id uslcom_devs[] = {
 #define	USLCOM_DEV(v,p)  { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) }
     USLCOM_DEV(BALTECH, CARDREADER),
+    USLCOM_DEV(CLIPSAL, 5500PCU),
+    USLCOM_DEV(DATAAPEX, MULTICOM),
+    USLCOM_DEV(DELL, DW700),
+    USLCOM_DEV(DIGIANSWER, ZIGBEE802154),
     USLCOM_DEV(DYNASTREAM, ANTDEVBOARD),
+    USLCOM_DEV(DYNASTREAM, ANTDEVBOARD2),
+    USLCOM_DEV(DYNASTREAM, ANT2USB),
+    USLCOM_DEV(ELV, USBI2C),
+    USLCOM_DEV(FOXCONN, PIRELLI_DP_L10),
+    USLCOM_DEV(GEMALTO, PROXPU),
     USLCOM_DEV(JABLOTRON, PC60B),
+    USLCOM_DEV(MEI, CASHFLOW_SC),
+    USLCOM_DEV(MEI, S2000),
+    USLCOM_DEV(JABLOTRON, PC60B),
+    USLCOM_DEV(OWEN, AC4),
+    USLCOM_DEV(PHILIPS, ACE1001),
+    USLCOM_DEV(PLX, CA42),
+    USLCOM_DEV(SILABS, AEROCOMM),
+    USLCOM_DEV(SILABS, AMBER_AMB2560),
     USLCOM_DEV(SILABS, ARGUSISP),
+    USLCOM_DEV(SILABS, ARKHAM_DS101_A),
+    USLCOM_DEV(SILABS, ARKHAM_DS101_M),
+    USLCOM_DEV(SILABS, ARYGON_MIFARE),
+    USLCOM_DEV(SILABS, AVIT_USB_TTL),
+    USLCOM_DEV(SILABS, BEI_VCP),
+    USLCOM_DEV(SILABS, BSM7DUSB),
+    USLCOM_DEV(SILABS, BURNSIDE),
+    USLCOM_DEV(SILABS, C2_EDGE_MODEM),
+    USLCOM_DEV(SILABS, CP2102),
+    USLCOM_DEV(SILABS, CP210X_2),
     USLCOM_DEV(SILABS, CRUMB128),
+    USLCOM_DEV(SILABS, CYGNAL),
+    USLCOM_DEV(SILABS, CYGNAL_DEBUG),
+    USLCOM_DEV(SILABS, CYGNAL_GPS),
     USLCOM_DEV(SILABS, DEGREE),
-    USLCOM_DEV(SILABS, BURNSIDE),
+    USLCOM_DEV(SILABS, EMS_C1007),
     USLCOM_DEV(SILABS, HELICOM),
+    USLCOM_DEV(SILABS, IMS_USB_RS422),
+    USLCOM_DEV(SILABS, INFINITY_MIC),
+    USLCOM_DEV(SILABS, INSYS_MODEM),
+    USLCOM_DEV(SILABS, KYOCERA_GPS),
     USLCOM_DEV(SILABS, LIPOWSKY_HARP),
     USLCOM_DEV(SILABS, LIPOWSKY_JTAG),
     USLCOM_DEV(SILABS, LIPOWSKY_LIN),
+    USLCOM_DEV(SILABS, MC35PU),
+    USLCOM_DEV(SILABS, MJS_TOSLINK),
+    USLCOM_DEV(SILABS, MSD_DASHHAWK),
     USLCOM_DEV(SILABS, POLOLU),
-    USLCOM_DEV(SILABS, CP2102),
-    USLCOM_DEV(SILABS, CP210X_2),
+    USLCOM_DEV(SILABS, PROCYON_AVS),
+    USLCOM_DEV(SILABS, SB_PARAMOUNT_ME),
     USLCOM_DEV(SILABS, SUUNTO),
+    USLCOM_DEV(SILABS, TAMSMASTER),
+    USLCOM_DEV(SILABS, TELEGESYS_ETRX2),
+    USLCOM_DEV(SILABS, TRACIENT),
     USLCOM_DEV(SILABS, TRAQMATE),
+    USLCOM_DEV(SILABS, USBCOUNT50),
+    USLCOM_DEV(SILABS, USBPULSE100),
+    USLCOM_DEV(SILABS, USBSCOPE50),
+    USLCOM_DEV(SILABS, USBWAVE12),
+    USLCOM_DEV(SILABS, VSTABI),
+    USLCOM_DEV(SILABS, WAVIT),
+    USLCOM_DEV(SILABS, WMRBATT),
+    USLCOM_DEV(SILABS, WMRRIGBLASTER),
+    USLCOM_DEV(SILABS, WMRRIGTALK),
+    USLCOM_DEV(SILABS, ZEPHYR_BIO),
     USLCOM_DEV(SILABS2, DCU11CLONE),
+    USLCOM_DEV(SILABS3, GPRS_MODEM),
+    USLCOM_DEV(SILABS4, 100EU_MODEM),
+    USLCOM_DEV(SYNTECH, CYPHERLAB100),
     USLCOM_DEV(USI, MC60),
+    USLCOM_DEV(VAISALA, CABLE),
+    USLCOM_DEV(WAVESENSE, JAZZ),
 #undef USLCOM_DEV
 };
 

Modified: stable/8/sys/dev/usb/usbdevs
==============================================================================
--- stable/8/sys/dev/usb/usbdevs	Wed Aug 18 20:39:00 2010	(r211469)
+++ stable/8/sys/dev/usb/usbdevs	Wed Aug 18 21:17:57 2010	(r211470)
@@ -440,8 +440,10 @@ vendor AIPTEK		0x08ca	AIPTEK Internation
 vendor SMARTBRIDGES	0x08d1	SmartBridges
 vendor FUJITSUSIEMENS	0x08d4	Fujitsu-Siemens
 vendor BILLIONTON	0x08dd	Billionton Systems
+vendor GEMALTO		0x08e6	Gemalto SA
 vendor EXTENDED		0x08e9	Extended Systems
 vendor MSYSTEMS		0x08ec	M-Systems
+vendor DIGIANSWER	0x08fd	Digianswer
 vendor AUTHENTEC	0x08ff	AuthenTec
 vendor AUDIOTECHNICA	0x0909	Audio-Technica
 vendor TRUMPION		0x090a	Trumpion Microelectronics
@@ -509,6 +511,7 @@ vendor USR		0x0baf	U.S. Robotics
 vendor AMBIT		0x0bb2	Ambit Microsystems
 vendor HTC		0x0bb4	HTC
 vendor REALTEK		0x0bda	Realtek
+vendor MEI		0x0bed	MEI
 vendor ADDONICS2	0x0bf6	Addonics Technology
 vendor FSC		0x0bf8	Fujitsu Siemens Computers
 vendor AGATE		0x0c08	Agate Technologies
@@ -565,6 +568,8 @@ vendor USI		0x10ab	USI
 vendor PLX		0x10b5	PLX
 vendor ASANTE		0x10bd	Asante
 vendor SILABS		0x10c4	Silicon Labs
+vendor SILABS3		0x10c5	Silicon Labs
+vendor SILABS4		0x10ce	Silicon Labs
 vendor ACTIONS		0x10d6  Actions
 vendor AIRPLUS		0x1011  Airplus
 vendor ANALOG		0x1110	Analog Devices
@@ -619,6 +624,7 @@ vendor UBIQUAM		0x1529	UBIQUAM Co., Ltd.
 vendor JMICRON		0x152d	JMicron
 vendor UBLOX		0x1546	U-blox
 vendor PNY		0x154b	PNY
+vendor OWEN		0x1555	Owen
 vendor OQO		0x1557	OQO
 vendor UMEDIA		0x157e	U-MEDIA Communications
 vendor FIBERLINE	0x1582	Fiberline
@@ -631,6 +637,7 @@ vendor AMOI		0x1614	Amoi Electronics
 vendor GOODWAY		0x1631	Good Way Technology
 vendor ENTREGA		0x1645	Entrega
 vendor ACTIONTEC	0x1668	Actiontec Electronics
+vendor CLIPSAL		0x166a	Clipsal
 vendor CISCOLINKSYS2	0x167b  Cisco-Linksys
 vendor ATHEROS		0x168c	Atheros Communications
 vendor GIGASET		0x1690	Gigaset
@@ -644,8 +651,11 @@ vendor SENAO		0x1740	Senao
 vendor ASUS2		0x1761	ASUS
 vendor SWEEX2		0x177f	Sweex
 vendor METAGEEK		0x1781	MetaGeek
+vendor WAVESENSE	0x17f4	WaveSense
+vendor VAISALA		0x1843	Vaisala
 vendor AMIT		0x18c5	AMIT
 vendor QCOM		0x18e8	Qcom
+vendor ELV		0x18ef	ELV
 vendor LINKSYS3		0x1915	Linksys
 vendor QUALCOMMINC	0x19d2	Qualcomm, Incorporated
 vendor WCH2		0x1a86	QinHeng Electronics
@@ -699,6 +709,7 @@ vendor SITECOM2		0x9016	Sitecom
 vendor MOSCHIP		0x9710	MosChip Semiconductor
 vendor MARVELL		0x9e88	Marvell Technology Group Ltd.
 vendor 3COM3		0xa727	3Com
+vendor DATAAPEX		0xdaae	DataApex
 vendor HP2		0xf003	Hewlett Packard
 vendor USRP		0xfffe	GNU Radio USRP
 
@@ -1186,6 +1197,9 @@ product CISCOLINKSYS WUSBF54G	0x0024	WUS
 product	CISCOLINKSYS2 RT3070	0x4001	RT3070
 product	CISCOLINKSYS3 RT3070	0x0101	RT3070
 
+/* Clipsal products */
+product CLIPSAL 5500PCU		0x0303	5500PCU C-Bus
+
 /* CMOTECH products */
 product CMOTECH CNU510		0x5141	CDMA Technologies USB modem
 product CMOTECH CNU550		0x5543	CDMA 2000 1xRTT/1xEVDO USB modem
@@ -1291,6 +1305,9 @@ product DAISY DMC		0x6901	USB MultiMedia
 /* Dallas Semiconductor products */
 product DALLAS J6502		0x4201	J-6502 speakers
 
+/* DataApex products */
+product DATAAPEX MULTICOM	0xead6	MultiCom
+
 /* Dell products */
 product DELL PORT		0x0058	Port Replicator
 product DELL AIO926		0x5115	Photo AIO Printer 926
@@ -1314,6 +1331,7 @@ product DELL U5520_3		0x8138	Dell 5520 3
 product DELL U5730		0x8180	Dell 5730 3G
 product DELL U5730_2		0x8181	Dell 5730 3G
 product DELL U5730_3		0x8182	Dell 5730 3G
+product DELL DW700		0x9500	Dell DW700 GPS
 
 /* Delorme Paublishing products */
 product DELORME EARTHMATE	0x0100	Earthmate GPS
@@ -1333,6 +1351,9 @@ product DIGI ACCELEPORT2	0x0002	AccelePo
 product DIGI ACCELEPORT4	0x0004	AccelePort USB 4
 product DIGI ACCELEPORT8	0x0008	AccelePort USB 8
 
+/* Digianswer A/S products */
+product DIGIANSWER ZIGBEE802154	0x000a	ZigBee/802.15.4 MAC
+
 /* D-Link products */
 /*product DLINK DSBS25		0x0100	DSB-S25 serial*/
 product DLINK DUBE100		0x1a00	10/100 Ethernet
@@ -1389,6 +1410,8 @@ product DRESDENELEKTRONIK WIRELESSHANDHE
 
 /* Dynastream Innovations */
 product DYNASTREAM ANTDEVBOARD	0x1003	ANT dev board
+product DYNASTREAM ANT2USB	0x1004	ANT2USB
+product DYNASTREAM ANTDEVBOARD2	0x1006	ANT dev board
 
 /* Edimax products */
 product EDIMAX EW7318USG	0x7318	USB Wireless dongle
@@ -1426,6 +1449,9 @@ product ELECOM LDUSBTX3		0xabc1	LD-USB/T
 product ELSA MODEM1		0x2265	ELSA Modem Board
 product ELSA USB2ETHERNET	0x3000	Microlink USB2Ethernet
 
+/* ELV products */
+product ELV USBI2C		0xe00f	USB-I2C interface
+
 /* EMS products */
 product EMS DUAL_SHOOTER	0x0003	PSX gun controller converter
 
@@ -1506,6 +1532,9 @@ product FIBERLINE WL430U	0x6003	WL-430U
 /* Fossil, Inc products */
 product FOSSIL WRISTPDA		0x0002	Wrist PDA
 
+/* Foxconn products */
+product FOXCONN PIRELLI_DP_L10	0xe000	Pirelli DP-L10
+
 /* Freecom products */
 product FREECOM DVD		0xfc01	DVD drive
 product FREECOM HDD		0xfc05	Classic SL Hard Drive
@@ -1558,6 +1587,9 @@ product FUJITSUSIEMENS SCR	0x0009	Fujits
 /* Garmin products */
 product GARMIN IQUE_3600	0x0004	iQue 3600
 
+/* Gemalto products */
+product GEMALTO PROXPU		0x5501	Prox-PU/CU
+
 /* General Instruments (Motorola) products */
 product GENERALINSTMNTS SB5100	0x5100	SURFboard SB5100 Cable modem
 
@@ -2058,6 +2090,10 @@ product METRICOM RICOCHET_GS	0x0001	Rico
 product MGE UPS1		0x0001	MGE UPS SYSTEMS PROTECTIONCENTER 1
 product MGE UPS2		0xffff	MGE UPS SYSTEMS PROTECTIONCENTER 2
 
+/* MEI products */
+product MEI CASHFLOW_SC		0x1100	Cashflow-SC Cash Acceptor
+product MEI S2000		0x1101	Seies 2000 Combo Acceptor
+
 /* Micro Star International products */
 product MSI BT_DONGLE		0x1967	Bluetooth USB dongle
 product MSI RT3070_1		0x3820	RT3070
@@ -2339,6 +2375,9 @@ product OQO BT01		0x0003	model 01 Blueto
 product OQO ETHER01PLUS		0x7720	model 01+ Ethernet
 product OQO ETHER01		0x8150	model 01 Ethernet interface
 
+/* Owen.ru products */
+product OWEN AC4		0x0004	AC4 USB-RS485 converter
+
 /* Palm Computing, Inc. product */
 product PALM SERIAL		0x0080	USB Serial
 product PALM M500		0x0001	Palm m500
@@ -2382,6 +2421,7 @@ product PHILIPS HUB		0x0201	hub
 product PHILIPS PCA646VC	0x0303	PCA646VC PC Camera
 product PHILIPS PCVC680K	0x0308	PCVC680K Vesta Pro PC Camera
 product PHILIPS DSS150		0x0471	DSS 150 Digital Speaker System
+product PHILIPS ACE1001		0x066a	AKTAKOM ACE-1001 cable
 product PHILIPS SPE3030CC	0x083a	USB 2.0 External Disk
 product PHILIPS SNU5600		0x1236	SNU5600
 product PHILIPS UM10016		0x1552	ISP 1581 Hi-Speed USB MPEG2 Encoder Reference Kit
@@ -2420,6 +2460,7 @@ product PLEXTOR 40_12_40U	0x0011	PlexWri
 
 /* PLX products */
 product PLX TESTBOARD		0x9060	test board
+product PLX CA42		0xac70	CA-42
 
 /* PNY products */
 product PNY ATTACHE2		0x0010	USB 2.0 Flash Drive
@@ -2793,22 +2834,59 @@ product SILICOM U2E		0x0001	U2E
 product SILICOM GPE		0x0002	Psion Gold Port Ethernet
 
 /* SI Labs */
+product SILABS	VSTABI		0x0f91	Vstabi
+product SILABS	ARKHAM_DS101_M	0x1101	Arkham DS101 Monitor
+product SILABS	ARKHAM_DS101_A	0x1601	Arkham DS101 Adapter
+product SILABS	BSM7DUSB	0x800a	BSM7-D-USB
 product SILABS	POLOLU		0x803b	Pololu Serial
+product SILABS	CYGNAL_DEBUG	0x8044	Cygnal Debug Adapter
+product SILABS	SB_PARAMOUNT_ME	0x8043	Software Bisque Paramount ME
 product SILABS	SAEL		0x8053	SA-EL USB
+product SILABS	GSM2228		0x8054	Enfora GSM2228 USB
 product SILABS	ARGUSISP	0x8066	Argussoft ISP
+product SILABS	IMS_USB_RS422	0x806f	IMS USB-RS422
 product SILABS	CRUMB128	0x807a	Crumb128 board
 product SILABS	DEGREE		0x80ca	Degree Controls Inc
+product SILABS	TRACIENT	0x80dd	Tracient RFID
 product SILABS	TRAQMATE	0x80ed	Track Systems Traqmate
 product SILABS	SUUNTO		0x80f6	Suunto Sports Instrument
+product SILABS	ARYGON_MIFARE	0x8115	Arygon Mifare RFID reader
 product SILABS	BURNSIDE	0x813d	Burnside Telecon Deskmobile
+product SILABS	TAMSMASTER	0x813f	Tams Master Easy Control
+product SILABS	WMRBATT		0x814a	WMR RIGblaster Plug&Play
+product SILABS	WMRRIGBLASTER	0x814a	WMR RIGblaster Plug&Play
+product SILABS	WMRRIGTALK	0x814b	WMR RIGtalk RT1
 product SILABS	HELICOM		0x815e	Helicomm IP-Link 1220-DVM
-product SILABS	CP2102		0xea60	SILABS USB UART
+product SILABS	AVIT_USB_TTL	0x818b	AVIT Research USB-TTL
+product SILABS	MJS_TOSLINK	0x819f	MJS USB-TOSLINk
+product SILABS	WAVIT		0x81a6	ThinkOptics WavIt
+product SILABS	MSD_DASHHAWK	0x81ac	MSD DashHawk
+product SILABS	INSYS_MODEM	0x81ad	INSYS Modem
 product SILABS	LIPOWSKY_JTAG	0x81c8	Lipowsky Baby-JTAG
 product SILABS	LIPOWSKY_LIN	0x81e2	Lipowsky Baby-LIN
+product SILABS	AEROCOMM	0x81e7	Aerocomm Radio
+product SILABS	ZEPHYR_BIO	0x81e8	Zephyr Bioharness
+product SILABS	EMS_C1007	0x81f2	EMS C1007 HF RFID controller
 product SILABS	LIPOWSKY_HARP	0x8218	Lipowsky HARP-1
-product SILABS	CP2102		0xea60	SILABS USB UARTa
+product SILABS	C2_EDGE_MODEM	0x822b	Commander 2 EDGE(GSM) Modem
+product SILABS	CYGNAL_GPS	0x826b	Cygnal Fasttrax GPS
+product SILABS	TELEGESYS_ETRX2	0x8293	Telegesys ETRX2USB
+product SILABS	PROCYON_AVS	0x82f9	Procyon AVS
+product SILABS	MC35PU		0x8341	MC35pu
+product SILABS	CYGNAL		0x8382	Cygnal
+product SILABS	AMBER_AMB2560	0x83a8	Amber Wireless AMB2560
+product SILABS	KYOCERA_GPS	0x8411	Kyocera GPS
+product SILABS	BEI_VCP		0x846e	BEI USB Sensor (VCP)
+product SILABS	CP2102		0xea60	SILABS USB UART
 product SILABS	CP210X_2	0xea61	CP210x Serial
+product SILABS	INFINITY_MIC	0xea71	Infinity GPS-MIC-1 Radio Monophone
+product SILABS	USBSCOPE50	0xf001	USBscope50
+product SILABS	USBWAVE12	0xf002	USBwave12
+product SILABS	USBPULSE100	0xf003	USBpulse100
+product SILABS	USBCOUNT50	0xf004	USBcount50
 product SILABS2 DCU11CLONE	0xaa26	DCU-11 clone
+product SILABS3 GPRS_MODEM	0xea61	GPRS Modem
+product SILABS4 100EU_MODEM	0xea61	GPRS Modem 100EU
 
 /* Silicon Portals Inc. */
 product SILICONPORTALS YAPPH_NF	0x0200	YAP Phone (no firmware)
@@ -2956,6 +3034,9 @@ product SUN KBD_HUB		0x100e	Kbd Hub
 /* Super Top products */
 product	SUPERTOP IDE		0x6600	USB-IDE
 
+/* Syntech products */
+product	SYNTECH CYPHERLAB100	0x1000	CipherLab USB Barcode Scanner
+
 /* Teclast products */
 product TECLAST TLC300		0x3203	USB Media Player
 
@@ -3093,6 +3174,9 @@ product VIA USB2IDEBRIDGE	0x6204	USB 2.0
 /* USI products */
 product USI MC60		0x10c5	MC60 Serial
 
+/* Vaisala products */
+product VAISALA CABLE		0x0200	USB Interface cable
+
 /* VidzMedia products */
 product VIDZMEDIA MONSTERTV	0x4fb1	MonsterTV P2H
 
@@ -3122,6 +3206,9 @@ product WACOM GRAPHIRE3_4X5	0x0013	Graph
 product WACOM INTUOSA5		0x0021	Intuos A5
 product WACOM GD0912U		0x0022	Intuos 9x12 Graphics Tablet
 
+/* WaveSense products */
+product WAVESENSE JAZZ		0xaaaa	Jazz blood glucose meter
+
 /* WCH products */
 product WCH CH341SER		0x5523	CH341/CH340 USB-Serial Bridge
 product WCH2 CH341SER		0x7523	CH341/CH340 USB-Serial Bridge

From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 21:25:49 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B784C10656A3;
	Wed, 18 Aug 2010 21:25:49 +0000 (UTC)
	(envelope-from dimitry@andric.com)
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 75FB28FC12;
	Wed, 18 Aug 2010 21:25:49 +0000 (UTC)
Received: from [IPv6:2001:7b8:3a7:0:f4aa:bf1e:4470:d911] (unknown
	[IPv6:2001:7b8:3a7:0:f4aa:bf1e:4470:d911])
	(using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
	(No client certificate requested)
	by tensor.andric.com (Postfix) with ESMTPSA id 9BC565C59;
	Wed, 18 Aug 2010 23:25:48 +0200 (CEST)
Message-ID: <4C6C4FDD.8080803@andric.com>
Date: Wed, 18 Aug 2010 23:25:49 +0200
From: Dimitry Andric 
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US;
	rv:1.9.2.9pre) Gecko/20100814 Lanikai/3.1.3pre
MIME-Version: 1.0
To: mdf@FreeBSD.org
References: <201008181740.o7IHeA4c075984@svn.freebsd.org>
	
In-Reply-To: 
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, Gabor Kovesdan 
Subject: Re: svn commit: r211463 - head/usr.bin/grep
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 18 Aug 2010 21:25:49 -0000

On 2010-08-18 22:48, mdf@FreeBSD.org wrote:
>>  - Refactor file reading code to use pure syscalls and an internal buffer
>>    instead of stdio.  This gives BSD grep a very big performance boost,
>>    its speed is now almost comparable to GNU grep.
> 
> I didn't read all of the details in the profiling mails in the thread,
> but does this mean that work on stdio would give a performance boost
> to many apps?  Or is there something specific about how grep(1) is
> using its input that makes it a horse of a different color?

Originally, it was reading files 1 character at a time, using fgetc(3),
the locking version even.  This is usually not the fastest way to read
a large file with stdio. :)

If grep did not have to support .gz or .bz2 files, we could just have
plugged in stdio's fgetln(3).  I tried this approach first on some
non-compressed files, and it performed much better than fgetc'ing.

The reading code that was now committed, is basically the same algorithm
as fgetln() uses internally, but it can handle gzip and bzip2 input too.

From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 21:39:42 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D4EDE1065696;
	Wed, 18 Aug 2010 21:39:42 +0000 (UTC)
	(envelope-from gavin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C3BB38FC0A;
	Wed, 18 Aug 2010 21:39:42 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7ILdgUJ081114;
	Wed, 18 Aug 2010 21:39:42 GMT (envelope-from gavin@svn.freebsd.org)
Received: (from gavin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7ILdg1E081111;
	Wed, 18 Aug 2010 21:39:42 GMT (envelope-from gavin@svn.freebsd.org)
Message-Id: <201008182139.o7ILdg1E081111@svn.freebsd.org>
From: Gavin Atkinson 
Date: Wed, 18 Aug 2010 21:39:42 +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: r211471 - in stable/8/sys/dev/usb: . serial
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 18 Aug 2010 21:39:43 -0000

Author: gavin
Date: Wed Aug 18 21:39:42 2010
New Revision: 211471
URL: http://svn.freebsd.org/changeset/base/211471

Log:
  Merge r210556 from head:
    Support the Pyramid KBS USB LCD under uftdi(4)
  
  PR:		usb/129758
  Submitted by:	joao lima 

Modified:
  stable/8/sys/dev/usb/serial/uftdi.c
  stable/8/sys/dev/usb/usbdevs
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cam/   (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/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/serial/uftdi.c
==============================================================================
--- stable/8/sys/dev/usb/serial/uftdi.c	Wed Aug 18 21:17:57 2010	(r211470)
+++ stable/8/sys/dev/usb/serial/uftdi.c	Wed Aug 18 21:39:42 2010	(r211471)
@@ -233,6 +233,7 @@ static struct usb_device_id uftdi_devs[]
 	UFTDI_DEV(FTDI, CFA_634, 8U232AM),
 	UFTDI_DEV(FTDI, CFA_635, 8U232AM),
 	UFTDI_DEV(FTDI, USBSERIAL, 8U232AM),
+	UFTDI_DEV(FTDI, KBS, 8U232AM),
 	UFTDI_DEV(FTDI, MX2_3, 8U232AM),
 	UFTDI_DEV(FTDI, MX4_5, 8U232AM),
 	UFTDI_DEV(FTDI, LK202, 8U232AM),

Modified: stable/8/sys/dev/usb/usbdevs
==============================================================================
--- stable/8/sys/dev/usb/usbdevs	Wed Aug 18 21:17:57 2010	(r211470)
+++ stable/8/sys/dev/usb/usbdevs	Wed Aug 18 21:39:42 2010	(r211471)
@@ -1554,6 +1554,7 @@ product FTDI TACTRIX_OPENPORT_13M 0xcc48
 product FTDI TACTRIX_OPENPORT_13S 0xcc49 OpenPort 1.3 Subaru
 product FTDI TACTRIX_OPENPORT_13U 0xcc4a OpenPort 1.3 Universal
 product FTDI GAMMASCOUT		0xd678	Gamma-Scout
+product FTDI KBS		0xe6c8	Pyramid KBS USB LCD
 product FTDI EISCOU		0xe888	Expert ISDN Control USB
 product FTDI UOPTBR		0xe889	USB-RS232 OptoBridge
 product FTDI EMCU2D		0xe88a	Expert mouseCLOCK USB II

From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 21:44:51 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2953D1065694;
	Wed, 18 Aug 2010 21:44:51 +0000 (UTC)
	(envelope-from gavin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 181B58FC13;
	Wed, 18 Aug 2010 21:44:51 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7ILioXe081269;
	Wed, 18 Aug 2010 21:44:50 GMT (envelope-from gavin@svn.freebsd.org)
Received: (from gavin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7ILiolN081266;
	Wed, 18 Aug 2010 21:44:50 GMT (envelope-from gavin@svn.freebsd.org)
Message-Id: <201008182144.o7ILiolN081266@svn.freebsd.org>
From: Gavin Atkinson 
Date: Wed, 18 Aug 2010 21:44: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: r211472 - in stable/8/sys/dev/usb: . serial
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 18 Aug 2010 21:44:51 -0000

Author: gavin
Date: Wed Aug 18 21:44:50 2010
New Revision: 211472
URL: http://svn.freebsd.org/changeset/base/211472

Log:
  Merge r210571 from head:
    Add support for the Corega CG-USBRS232R to uplcom(4)
  
  PR:		usb/129173
  Submitted by:	SHIMAOKA Shunsuke 

Modified:
  stable/8/sys/dev/usb/serial/uplcom.c
  stable/8/sys/dev/usb/usbdevs
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cam/   (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/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/serial/uplcom.c
==============================================================================
--- stable/8/sys/dev/usb/serial/uplcom.c	Wed Aug 18 21:39:42 2010	(r211471)
+++ stable/8/sys/dev/usb/serial/uplcom.c	Wed Aug 18 21:44:50 2010	(r211472)
@@ -292,6 +292,8 @@ static const struct usb_device_id uplcom
 	UPLCOM_DEV(PROLIFIC2, WSIM, 0, 0xFFFF, PL2303X),
 	/* Mobile Action MA-620 Infrared Adapter */
 	UPLCOM_DEV(MOBILEACTION, MA620, 0, 0xFFFF, PL2303X),
+	/* Corega CG-USBRS232R */
+	UPLCOM_DEV(COREGA, CGUSBRS232R, 0, 0xFFFF, PL2303X),
 };
 #undef UPLCOM_DEV
 

Modified: stable/8/sys/dev/usb/usbdevs
==============================================================================
--- stable/8/sys/dev/usb/usbdevs	Wed Aug 18 21:39:42 2010	(r211471)
+++ stable/8/sys/dev/usb/usbdevs	Wed Aug 18 21:44:50 2010	(r211472)
@@ -1248,6 +1248,7 @@ product COREGA FETHER_USB_TXS	0x000d	FEt
 product COREGA WLANUSB		0x0012	Wireless LAN Stick-11
 product COREGA FETHER_USB2_TX	0x0017	FEther USB2-TX
 product COREGA WLUSB_11_KEY	0x001a	ULUSB-11 Key
+product COREGA CGUSBRS232R	0x002a	CG-USBRS232R
 product COREGA CGWLUSB2GL	0x002d	CG-WLUSB2GL
 product COREGA CGWLUSB2GPX	0x002e	CG-WLUSB2GPX
 product COREGA RT2870_1		0x002f	RT2870

From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 21:51:06 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3C516106566B;
	Wed, 18 Aug 2010 21:51:06 +0000 (UTC)
	(envelope-from gavin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2B48A8FC18;
	Wed, 18 Aug 2010 21:51:06 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7ILp6tl081420;
	Wed, 18 Aug 2010 21:51:06 GMT (envelope-from gavin@svn.freebsd.org)
Received: (from gavin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7ILp6Rq081417;
	Wed, 18 Aug 2010 21:51:06 GMT (envelope-from gavin@svn.freebsd.org)
Message-Id: <201008182151.o7ILp6Rq081417@svn.freebsd.org>
From: Gavin Atkinson 
Date: Wed, 18 Aug 2010 21:51: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: r211473 - stable/7/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: Wed, 18 Aug 2010 21:51:06 -0000

Author: gavin
Date: Wed Aug 18 21:51:05 2010
New Revision: 211473
URL: http://svn.freebsd.org/changeset/base/211473

Log:
  Merge r210571 from head:
    Add support for the Corega CG-USBRS232R to uplcom(4)
  
  PR:		usb/129173
  Submitted by:	SHIMAOKA Shunsuke 

Modified:
  stable/7/sys/dev/usb/uplcom.c
  stable/7/sys/dev/usb/usbdevs

Modified: stable/7/sys/dev/usb/uplcom.c
==============================================================================
--- stable/7/sys/dev/usb/uplcom.c	Wed Aug 18 21:44:50 2010	(r211472)
+++ stable/7/sys/dev/usb/uplcom.c	Wed Aug 18 21:51:05 2010	(r211473)
@@ -275,6 +275,9 @@ static const struct uplcom_product {
 	/* Mobile Action MA-620 Infrared Adapter */
 	{ USB_VENDOR_MOBILEACTION, USB_PRODUCT_MOBILEACTION_MA620, -1,
 	  TYPE_PL2303X },
+	/* Corega CG-USBRS232R */
+	{ USB_VENDOR_COREGA, USB_PRODUCT_COREGA_CGUSBRS232R, -1,
+	  TYPE_PL2303X },
 	{ 0, 0 }
 };
 

Modified: stable/7/sys/dev/usb/usbdevs
==============================================================================
--- stable/7/sys/dev/usb/usbdevs	Wed Aug 18 21:44:50 2010	(r211472)
+++ stable/7/sys/dev/usb/usbdevs	Wed Aug 18 21:51:05 2010	(r211473)
@@ -1073,6 +1073,7 @@ product COREGA FETHER_USB_TXS	0x000d	FEt
 product COREGA WLANUSB		0x0012	Wireless LAN Stick-11
 product COREGA FETHER_USB2_TX	0x0017	FEther USB2-TX
 product COREGA WLUSB_11_KEY	0x001a	ULUSB-11 Key
+product COREGA CGUSBRS232R	0x002a	CG-USBRS232R
 product COREGA CGWLUSB2GL	0x002d	CG-WLUSB2GL
 product COREGA CGWLUSB2GPX	0x002e	CG-WLUSB2GPX
 product COREGA WLUSB_11_STICK	0x7613	WLAN USB Stick 11

From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 21:53:38 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 69F461065698;
	Wed, 18 Aug 2010 21:53:38 +0000 (UTC)
	(envelope-from gavin@ury.york.ac.uk)
Received: from ixe-mta-27.emailfiltering.com (ixe-mta-27-tx.emailfiltering.com
	[194.116.199.158])
	by mx1.freebsd.org (Postfix) with ESMTP id 4E0D48FC0A;
	Wed, 18 Aug 2010 21:53:36 +0000 (UTC)
Received: from mail-gw12.york.ac.uk ([144.32.129.162])
	by ixe-mta-27.emailfiltering.com with emfmta (version 4.6.0.72) by TLS
	id 723981274 for src-committers@freebsd.org; d258cd192eeda2aa;
	Wed, 18 Aug 2010 22:53:36 +0100
Received: from ury.york.ac.uk ([144.32.108.81]:50744)
	by mail-gw12.york.ac.uk with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from )
	id 1OlqZj-00078R-BT; Wed, 18 Aug 2010 22:53:35 +0100
Received: from gavin (helo=localhost)
	by ury.york.ac.uk with local-esmtp (Exim 4.72)
	(envelope-from )
	id 1OlqZj-0005YP-5p; Wed, 18 Aug 2010 22:53:35 +0100
Date: Wed, 18 Aug 2010 22:53:35 +0100 (BST)
From: Gavin Atkinson 
X-X-Sender: gavin@ury.york.ac.uk
To: src-committers@freebsd.org, svn-src-all@freebsd.org, 
	svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
In-Reply-To: <201008182151.o7ILp6Rq081417@svn.freebsd.org>
Message-ID: 
References: <201008182151.o7ILp6Rq081417@svn.freebsd.org>
User-Agent: Alpine 2.00 (LNX 1167 2008-08-23)
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: 
Cc: 
Subject: Re: svn commit: r211473 - stable/7/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: Wed, 18 Aug 2010 21:53:38 -0000

On Wed, 18 Aug 2010, Gavin Atkinson wrote:
> Author: gavin
> Date: Wed Aug 18 21:51:05 2010
> New Revision: 211473
> URL: http://svn.freebsd.org/changeset/base/211473
> 
> Log:
>   Merge r210571 from head:
>     Add support for the Corega CG-USBRS232R to uplcom(4)

Apologies, should have mentioned in the commit log:

This is a hand-merge, rather than a direct merge, due to the 
difference in stacks betweenn head and stable/7.

Gavin

From owner-svn-src-all@FreeBSD.ORG  Wed Aug 18 22:06:44 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5F8E0106564A;
	Wed, 18 Aug 2010 22:06:44 +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 4CC0A8FC0A;
	Wed, 18 Aug 2010 22:06:44 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7IM6iDB081865;
	Wed, 18 Aug 2010 22:06:44 GMT (envelope-from pjd@svn.freebsd.org)
Received: (from pjd@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7IM6ibp081849;
	Wed, 18 Aug 2010 22:06:44 GMT (envelope-from pjd@svn.freebsd.org)
Message-Id: <201008182206.o7IM6ibp081849@svn.freebsd.org>
From: Pawel Jakub Dawidek 
Date: Wed, 18 Aug 2010 22:06: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: r211474 - in head/tools/regression/pjdfstest/tests:
	chflags chmod chown link mkdir mkfifo mknod open rename rmdir
	symlink
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 18 Aug 2010 22:06:44 -0000

Author: pjd
Date: Wed Aug 18 22:06:43 2010
New Revision: 211474
URL: http://svn.freebsd.org/changeset/base/211474

Log:
  More tests.

Modified:
  head/tools/regression/pjdfstest/tests/chflags/01.t
  head/tools/regression/pjdfstest/tests/chmod/01.t
  head/tools/regression/pjdfstest/tests/chmod/06.t
  head/tools/regression/pjdfstest/tests/chown/01.t
  head/tools/regression/pjdfstest/tests/link/01.t
  head/tools/regression/pjdfstest/tests/link/10.t
  head/tools/regression/pjdfstest/tests/mkdir/01.t
  head/tools/regression/pjdfstest/tests/mkfifo/01.t
  head/tools/regression/pjdfstest/tests/mkfifo/09.t
  head/tools/regression/pjdfstest/tests/mknod/01.t
  head/tools/regression/pjdfstest/tests/mknod/08.t
  head/tools/regression/pjdfstest/tests/open/01.t
  head/tools/regression/pjdfstest/tests/rename/12.t
  head/tools/regression/pjdfstest/tests/rmdir/06.t
  head/tools/regression/pjdfstest/tests/symlink/08.t

Modified: head/tools/regression/pjdfstest/tests/chflags/01.t
==============================================================================
--- head/tools/regression/pjdfstest/tests/chflags/01.t	Wed Aug 18 21:51:05 2010	(r211473)
+++ head/tools/regression/pjdfstest/tests/chflags/01.t	Wed Aug 18 22:06:43 2010	(r211474)
@@ -8,13 +8,15 @@ dir=`dirname $0`
 
 require chflags
 
-echo "1..5"
+echo "1..17"
 
 n0=`namegen`
 n1=`namegen`
 
 expect 0 mkdir ${n0} 0755
-expect 0 create ${n0}/${n1} 0644
-expect ENOTDIR chflags ${n0}/${n1}/test SF_IMMUTABLE
-expect 0 unlink ${n0}/${n1}
+for type in regular fifo block char socket; do
+	create_file ${type} ${n0}/${n1}
+	expect ENOTDIR chflags ${n0}/${n1}/test SF_IMMUTABLE
+	expect 0 unlink ${n0}/${n1}
+done
 expect 0 rmdir ${n0}

Modified: head/tools/regression/pjdfstest/tests/chmod/01.t
==============================================================================
--- head/tools/regression/pjdfstest/tests/chmod/01.t	Wed Aug 18 21:51:05 2010	(r211473)
+++ head/tools/regression/pjdfstest/tests/chmod/01.t	Wed Aug 18 22:06:43 2010	(r211474)
@@ -6,13 +6,15 @@ desc="chmod returns ENOTDIR if a compone
 dir=`dirname $0`
 . ${dir}/../misc.sh
 
-echo "1..5"
+echo "1..17"
 
 n0=`namegen`
 n1=`namegen`
 
 expect 0 mkdir ${n0} 0755
-expect 0 create ${n0}/${n1} 0644
-expect ENOTDIR chmod ${n0}/${n1}/test 0644
-expect 0 unlink ${n0}/${n1}
+for type in regular fifo block char socket; do
+	create_file ${type} ${n0}/${n1}
+	expect ENOTDIR chmod ${n0}/${n1}/test 0644
+	expect 0 unlink ${n0}/${n1}
+done
 expect 0 rmdir ${n0}

Modified: head/tools/regression/pjdfstest/tests/chmod/06.t
==============================================================================
--- head/tools/regression/pjdfstest/tests/chmod/06.t	Wed Aug 18 21:51:05 2010	(r211473)
+++ head/tools/regression/pjdfstest/tests/chmod/06.t	Wed Aug 18 22:06:43 2010	(r211474)
@@ -7,9 +7,9 @@ dir=`dirname $0`
 . ${dir}/../misc.sh
 
 if supported lchmod; then
-	echo "1..8"
+	echo "1..10"
 else
-	echo "1..6"
+	echo "1..8"
 fi
 
 n0=`namegen`
@@ -17,6 +17,8 @@ n1=`namegen`
 
 expect 0 symlink ${n0} ${n1}
 expect 0 symlink ${n1} ${n0}
+expect ELOOP chmod ${n0} 0644
+expect ELOOP chmod ${n1} 0644
 expect ELOOP chmod ${n0}/test 0644
 expect ELOOP chmod ${n1}/test 0644
 if supported lchmod; then

Modified: head/tools/regression/pjdfstest/tests/chown/01.t
==============================================================================
--- head/tools/regression/pjdfstest/tests/chown/01.t	Wed Aug 18 21:51:05 2010	(r211473)
+++ head/tools/regression/pjdfstest/tests/chown/01.t	Wed Aug 18 22:06:43 2010	(r211474)
@@ -6,14 +6,16 @@ desc="chown returns ENOTDIR if a compone
 dir=`dirname $0`
 . ${dir}/../misc.sh
 
-echo "1..6"
+echo "1..22"
 
 n0=`namegen`
 n1=`namegen`
 
 expect 0 mkdir ${n0} 0755
-expect 0 create ${n0}/${n1} 0644
-expect ENOTDIR chown ${n0}/${n1}/test 65534 65534
-expect ENOTDIR lchown ${n0}/${n1}/test 65534 65534
-expect 0 unlink ${n0}/${n1}
+for type in regular fifo block char socket; do
+	create_file ${type} ${n0}/${n1}
+	expect ENOTDIR chown ${n0}/${n1}/test 65534 65534
+	expect ENOTDIR lchown ${n0}/${n1}/test 65534 65534
+	expect 0 unlink ${n0}/${n1}
+done
 expect 0 rmdir ${n0}

Modified: head/tools/regression/pjdfstest/tests/link/01.t
==============================================================================
--- head/tools/regression/pjdfstest/tests/link/01.t	Wed Aug 18 21:51:05 2010	(r211473)
+++ head/tools/regression/pjdfstest/tests/link/01.t	Wed Aug 18 22:06:43 2010	(r211474)
@@ -6,17 +6,19 @@ desc="link returns ENOTDIR if a componen
 dir=`dirname $0`
 . ${dir}/../misc.sh
 
-echo "1..8"
+echo "1..32"
 
 n0=`namegen`
 n1=`namegen`
 n2=`namegen`
 
 expect 0 mkdir ${n0} 0755
-expect 0 create ${n0}/${n1} 0644
-expect ENOTDIR link ${n0}/${n1}/test ${n0}/${n2}
-expect 0 create ${n0}/${n2} 0644
-expect ENOTDIR link ${n0}/${n2} ${n0}/${n1}/test
-expect 0 unlink ${n0}/${n1}
-expect 0 unlink ${n0}/${n2}
+for type in regular fifo block char socket; do
+	create_file ${type} ${n0}/${n1}
+	expect ENOTDIR link ${n0}/${n1}/test ${n0}/${n2}
+	create_file ${type} ${n0}/${n2}
+	expect ENOTDIR link ${n0}/${n2} ${n0}/${n1}/test
+	expect 0 unlink ${n0}/${n1}
+	expect 0 unlink ${n0}/${n2}
+done
 expect 0 rmdir ${n0}

Modified: head/tools/regression/pjdfstest/tests/link/10.t
==============================================================================
--- head/tools/regression/pjdfstest/tests/link/10.t	Wed Aug 18 21:51:05 2010	(r211473)
+++ head/tools/regression/pjdfstest/tests/link/10.t	Wed Aug 18 22:06:43 2010	(r211474)
@@ -6,27 +6,21 @@ desc="link returns EEXIST if the destina
 dir=`dirname $0`
 . ${dir}/../misc.sh
 
-echo "1..14"
+echo "1..23"
 
 n0=`namegen`
 n1=`namegen`
 
 expect 0 create ${n0} 0644
 
-expect 0 create ${n1} 0644
-expect EEXIST link ${n0} ${n1}
-expect 0 unlink ${n1}
-
-expect 0 mkdir ${n1} 0755
-expect EEXIST link ${n0} ${n1}
-expect 0 rmdir ${n1}
-
-expect 0 symlink test ${n1}
-expect EEXIST link ${n0} ${n1}
-expect 0 unlink ${n1}
-
-expect 0 mkfifo ${n1} 0644
-expect EEXIST link ${n0} ${n1}
-expect 0 unlink ${n1}
+for type in regular dir fifo block char socket symlink; do
+	create_file ${type} ${n1}
+	expect EEXIST link ${n0} ${n1}
+	if [ "${type}" = "dir" ]; then
+		expect 0 rmdir ${n1}
+	else
+		expect 0 unlink ${n1}
+	fi
+done
 
 expect 0 unlink ${n0}

Modified: head/tools/regression/pjdfstest/tests/mkdir/01.t
==============================================================================
--- head/tools/regression/pjdfstest/tests/mkdir/01.t	Wed Aug 18 21:51:05 2010	(r211473)
+++ head/tools/regression/pjdfstest/tests/mkdir/01.t	Wed Aug 18 22:06:43 2010	(r211474)
@@ -6,13 +6,15 @@ desc="mkdir returns ENOTDIR if a compone
 dir=`dirname $0`
 . ${dir}/../misc.sh
 
-echo "1..5"
+echo "1..17"
 
 n0=`namegen`
 n1=`namegen`
 
 expect 0 mkdir ${n0} 0755
-expect 0 create ${n0}/${n1} 0644
-expect ENOTDIR mkdir ${n0}/${n1}/test 0755
-expect 0 unlink ${n0}/${n1}
+for type in regular fifo block char socket; do
+	create_file ${type} ${n0}/${n1}
+	expect ENOTDIR mkdir ${n0}/${n1}/test 0755
+	expect 0 unlink ${n0}/${n1}
+done
 expect 0 rmdir ${n0}

Modified: head/tools/regression/pjdfstest/tests/mkfifo/01.t
==============================================================================
--- head/tools/regression/pjdfstest/tests/mkfifo/01.t	Wed Aug 18 21:51:05 2010	(r211473)
+++ head/tools/regression/pjdfstest/tests/mkfifo/01.t	Wed Aug 18 22:06:43 2010	(r211474)
@@ -6,13 +6,15 @@ desc="mkfifo returns ENOTDIR if a compon
 dir=`dirname $0`
 . ${dir}/../misc.sh
 
-echo "1..5"
+echo "1..17"
 
 n0=`namegen`
 n1=`namegen`
 
 expect 0 mkdir ${n0} 0755
-expect 0 create ${n0}/${n1} 0644
-expect ENOTDIR mkfifo ${n0}/${n1}/test 0644
-expect 0 unlink ${n0}/${n1}
+for type in regular fifo block char socket; do
+	create_file ${type} ${n0}/${n1}
+	expect ENOTDIR mkfifo ${n0}/${n1}/test 0644
+	expect 0 unlink ${n0}/${n1}
+done
 expect 0 rmdir ${n0}

Modified: head/tools/regression/pjdfstest/tests/mkfifo/09.t
==============================================================================
--- head/tools/regression/pjdfstest/tests/mkfifo/09.t	Wed Aug 18 21:51:05 2010	(r211473)
+++ head/tools/regression/pjdfstest/tests/mkfifo/09.t	Wed Aug 18 22:06:43 2010	(r211474)
@@ -6,22 +6,16 @@ desc="mkfifo returns EEXIST if the named
 dir=`dirname $0`
 . ${dir}/../misc.sh
 
-echo "1..12"
+echo "1..21"
 
 n0=`namegen`
 
-expect 0 mkdir ${n0} 0755
-expect EEXIST mkfifo ${n0} 0644
-expect 0 rmdir ${n0}
-
-expect 0 create ${n0} 0644
-expect EEXIST mkfifo ${n0} 0644
-expect 0 unlink ${n0}
-
-expect 0 symlink test ${n0}
-expect EEXIST mkfifo ${n0} 0644
-expect 0 unlink ${n0}
-
-expect 0 mkfifo ${n0} 0644
-expect EEXIST mkfifo ${n0} 0644
-expect 0 unlink ${n0}
+for type in regular dir fifo block char socket symlink; do
+	create_file ${type} ${n0}
+	expect EEXIST mkfifo ${n0} 0644
+	if [ "${type}" = "dir" ]; then
+		expect 0 rmdir ${n0}
+	else
+		expect 0 unlink ${n0}
+	fi
+done

Modified: head/tools/regression/pjdfstest/tests/mknod/01.t
==============================================================================
--- head/tools/regression/pjdfstest/tests/mknod/01.t	Wed Aug 18 21:51:05 2010	(r211473)
+++ head/tools/regression/pjdfstest/tests/mknod/01.t	Wed Aug 18 22:06:43 2010	(r211474)
@@ -6,13 +6,17 @@ desc="mknod returns ENOTDIR if a compone
 dir=`dirname $0`
 . ${dir}/../misc.sh
 
-echo "1..5"
+echo "1..27"
 
 n0=`namegen`
 n1=`namegen`
 
 expect 0 mkdir ${n0} 0755
-expect 0 create ${n0}/${n1} 0644
-expect ENOTDIR mknod ${n0}/${n1}/test f 0644 0 0
-expect 0 unlink ${n0}/${n1}
+for type in regular fifo block char socket; do
+	create_file ${type} ${n0}/${n1}
+	expect ENOTDIR mknod ${n0}/${n1}/test b 0644 1 2
+	expect ENOTDIR mknod ${n0}/${n1}/test c 0644 1 2
+	expect ENOTDIR mknod ${n0}/${n1}/test f 0644 0 0
+	expect 0 unlink ${n0}/${n1}
+done
 expect 0 rmdir ${n0}

Modified: head/tools/regression/pjdfstest/tests/mknod/08.t
==============================================================================
--- head/tools/regression/pjdfstest/tests/mknod/08.t	Wed Aug 18 21:51:05 2010	(r211473)
+++ head/tools/regression/pjdfstest/tests/mknod/08.t	Wed Aug 18 22:06:43 2010	(r211474)
@@ -6,30 +6,18 @@ desc="mknod returns EEXIST if the named 
 dir=`dirname $0`
 . ${dir}/../misc.sh
 
-echo "1..18"
+echo "1..35"
 
 n0=`namegen`
 
-expect 0 mkdir ${n0} 0755
-expect EEXIST mknod ${n0} f 0644 0 0
-expect 0 rmdir ${n0}
-
-expect 0 create ${n0} 0644
-expect EEXIST mknod ${n0} f 0644 0 0
-expect 0 unlink ${n0}
-
-expect 0 symlink test ${n0}
-expect EEXIST mknod ${n0} f 0644 0 0
-expect 0 unlink ${n0}
-
-expect 0 mkfifo ${n0} 0644
-expect EEXIST mknod ${n0} f 0644 0 0
-expect 0 unlink ${n0}
-
-expect 0 bind ${n0}
-expect EEXIST mknod ${n0} f 0644 0 0
-expect 0 unlink ${n0}
-
-expect 0 mknod ${n0} f 0644 0 0
-expect EEXIST mknod ${n0} f 0644 0 0
-expect 0 unlink ${n0}
+for type in regular dir fifo block char socket symlink; do
+	create_file ${type} ${n0}
+	expect EEXIST mknod ${n0} b 0644 0 0
+	expect EEXIST mknod ${n0} c 0644 0 0
+	expect EEXIST mknod ${n0} f 0644 0 0
+	if [ "${type}" = "dir" ]; then
+		expect 0 rmdir ${n0}
+	else
+		expect 0 unlink ${n0}
+	fi
+done

Modified: head/tools/regression/pjdfstest/tests/open/01.t
==============================================================================
--- head/tools/regression/pjdfstest/tests/open/01.t	Wed Aug 18 21:51:05 2010	(r211473)
+++ head/tools/regression/pjdfstest/tests/open/01.t	Wed Aug 18 22:06:43 2010	(r211474)
@@ -6,13 +6,16 @@ desc="open returns ENOTDIR if a componen
 dir=`dirname $0`
 . ${dir}/../misc.sh
 
-echo "1..5"
+echo "1..22"
 
 n0=`namegen`
 n1=`namegen`
 
 expect 0 mkdir ${n0} 0755
-expect 0 create ${n0}/${n1} 0644
-expect ENOTDIR open ${n0}/${n1}/test O_CREAT 0644
-expect 0 unlink ${n0}/${n1}
+for type in regular fifo block char socket; do
+	create_file ${type} ${n0}/${n1}
+	expect ENOTDIR open ${n0}/${n1}/test O_RDONLY
+	expect ENOTDIR open ${n0}/${n1}/test O_CREAT 0644
+	expect 0 unlink ${n0}/${n1}
+done
 expect 0 rmdir ${n0}

Modified: head/tools/regression/pjdfstest/tests/rename/12.t
==============================================================================
--- head/tools/regression/pjdfstest/tests/rename/12.t	Wed Aug 18 21:51:05 2010	(r211473)
+++ head/tools/regression/pjdfstest/tests/rename/12.t	Wed Aug 18 22:06:43 2010	(r211474)
@@ -6,17 +6,19 @@ desc="rename returns ENOTDIR if a compon
 dir=`dirname $0`
 . ${dir}/../misc.sh
 
-echo "1..8"
+echo "1..32"
 
 n0=`namegen`
 n1=`namegen`
 n2=`namegen`
 
 expect 0 mkdir ${n0} 0755
-expect 0 create ${n0}/${n1} 0644
-expect ENOTDIR rename ${n0}/${n1}/test ${n0}/${n2}
-expect 0 create ${n0}/${n2} 0644
-expect ENOTDIR link ${n0}/${n2} ${n0}/${n1}/test
-expect 0 unlink ${n0}/${n1}
-expect 0 unlink ${n0}/${n2}
+for type in regular fifo block char socket; do
+	create_file ${type} ${n0}/${n1}
+	expect ENOTDIR rename ${n0}/${n1}/test ${n0}/${n2}
+	create_file ${type} ${n0}/${n2}
+	expect ENOTDIR link ${n0}/${n2} ${n0}/${n1}/test
+	expect 0 unlink ${n0}/${n1}
+	expect 0 unlink ${n0}/${n2}
+done
 expect 0 rmdir ${n0}

Modified: head/tools/regression/pjdfstest/tests/rmdir/06.t
==============================================================================
--- head/tools/regression/pjdfstest/tests/rmdir/06.t	Wed Aug 18 21:51:05 2010	(r211473)
+++ head/tools/regression/pjdfstest/tests/rmdir/06.t	Wed Aug 18 22:06:43 2010	(r211474)
@@ -6,31 +6,19 @@ desc="rmdir returns EEXIST or ENOTEMPTY 
 dir=`dirname $0`
 . ${dir}/../misc.sh
 
-echo "1..20"
+echo "1..23"
 
 n0=`namegen`
 n1=`namegen`
 
 expect 0 mkdir ${n0} 0755
-expect 0 mkdir ${n0}/${n1} 0755
-expect "EEXIST|ENOTEMPTY" rmdir ${n0}
-expect 0 rmdir ${n0}/${n1}
-expect 0 rmdir ${n0}
-
-expect 0 mkdir ${n0} 0755
-expect 0 create ${n0}/${n1} 0644
-expect "EEXIST|ENOTEMPTY" rmdir ${n0}
-expect 0 unlink ${n0}/${n1}
-expect 0 rmdir ${n0}
-
-expect 0 mkdir ${n0} 0755
-expect 0 symlink test ${n0}/${n1}
-expect "EEXIST|ENOTEMPTY" rmdir ${n0}
-expect 0 unlink ${n0}/${n1}
-expect 0 rmdir ${n0}
-
-expect 0 mkdir ${n0} 0755
-expect 0 mkfifo ${n0}/${n1} 0644
-expect "EEXIST|ENOTEMPTY" rmdir ${n0}
-expect 0 unlink ${n0}/${n1}
+for type in regular dir fifo block char socket symlink; do
+	create_file ${type} ${n0}/${n1}
+	expect "EEXIST|ENOTEMPTY" rmdir ${n0}
+	if [ "${type}" = "dir" ]; then
+		expect 0 rmdir ${n0}/${n1}
+	else
+		expect 0 unlink ${n0}/${n1}
+	fi
+done
 expect 0 rmdir ${n0}

Modified: head/tools/regression/pjdfstest/tests/symlink/08.t
==============================================================================
--- head/tools/regression/pjdfstest/tests/symlink/08.t	Wed Aug 18 21:51:05 2010	(r211473)
+++ head/tools/regression/pjdfstest/tests/symlink/08.t	Wed Aug 18 22:06:43 2010	(r211474)
@@ -6,18 +6,16 @@ desc="symlink returns EEXIST if the name
 dir=`dirname $0`
 . ${dir}/../misc.sh
 
-echo "1..9"
+echo "1..21"
 
 n0=`namegen`
 
-expect 0 create ${n0} 0644
-expect EEXIST symlink test ${n0}
-expect 0 unlink ${n0}
-
-expect 0 mkdir ${n0} 0755
-expect EEXIST symlink test ${n0}
-expect 0 rmdir ${n0}
-
-expect 0 symlink test ${n0}
-expect EEXIST symlink test ${n0}
-expect 0 unlink ${n0}
+for type in regular dir fifo block char socket symlink; do
+	create_file ${type} ${n0}
+	expect EEXIST symlink test ${n0}
+	if [ "${type}" = "dir" ]; then
+		expect 0 rmdir ${n0}
+	else
+		expect 0 unlink ${n0}
+	fi
+done

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 01:34:01 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4A69C1065695;
	Thu, 19 Aug 2010 01:34:01 +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 39B478FC14;
	Thu, 19 Aug 2010 01:34:01 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7J1Y107085782;
	Thu, 19 Aug 2010 01:34:01 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7J1Y1lV085780;
	Thu, 19 Aug 2010 01:34:01 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201008190134.o7J1Y1lV085780@svn.freebsd.org>
From: Xin LI 
Date: Thu, 19 Aug 2010 01: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: r211475 - head/usr.bin/gzip
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 01:34:01 -0000

Author: delphij
Date: Thu Aug 19 01:34:00 2010
New Revision: 211475
URL: http://svn.freebsd.org/changeset/base/211475

Log:
  Check return value of dup(), it could be -1 when the system is running
  out of file descriptors for instance.
  
  Found with:	Coverity Prevent(tm)
  CID:		6084
  MFC after:	1 month

Modified:
  head/usr.bin/gzip/unpack.c

Modified: head/usr.bin/gzip/unpack.c
==============================================================================
--- head/usr.bin/gzip/unpack.c	Wed Aug 18 22:06:43 2010	(r211474)
+++ head/usr.bin/gzip/unpack.c	Thu Aug 19 01:34:00 2010	(r211475)
@@ -312,7 +312,14 @@ unpack(int in, int out, char *pre, size_
 {
 	unpack_descriptor_t	unpackd;
 
-	unpack_parse_header(dup(in), dup(out), pre, prelen, bytes_in, &unpackd);
+	in = dup(in);
+	if (in == -1)
+		maybe_err("dup");
+	out = dup(out);
+	if (out == -1)
+		maybe_err("dup");
+
+	unpack_parse_header(in, out, pre, prelen, bytes_in, &unpackd);
 	unpack_decode(&unpackd, bytes_in);
 	unpack_descriptor_fini(&unpackd);
 

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 02:03:12 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 698AC1065674;
	Thu, 19 Aug 2010 02:03:12 +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 5789D8FC13;
	Thu, 19 Aug 2010 02:03:12 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7J23CMo086350;
	Thu, 19 Aug 2010 02:03:12 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7J23C51086339;
	Thu, 19 Aug 2010 02:03:12 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201008190203.o7J23C51086339@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 19 Aug 2010 02:03: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: r211476 - head/sys/mips/atheros
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 02:03:12 -0000

Author: adrian
Date: Thu Aug 19 02:03:12 2010
New Revision: 211476
URL: http://svn.freebsd.org/changeset/base/211476

Log:
  Preparation work for supporting the AR91xx and AR724x.
  
  * Implement a SoC probe function, from Linux, which determines the
    SoC family, type and revision. This only probes the AR71xx series
    SoC and (currently) panics on others.
  
  * Migrate some of the AR71XX specific hardware init (USB device, determining
    system frequencies) into using the cpuops introduced in an earlier commit.
    Other SoC specific hardware stuff (per-device flush/WB, GPIO pin wiring,
    Ethernet PLL setup, other things I've likely missed) will be introduced in
    subsequent commits.
  
  Reviewed by:	imp@
  Obtained from:	(partially) Linux

Added:
  head/sys/mips/atheros/ar71xx_chip.c   (contents, props changed)
  head/sys/mips/atheros/ar71xx_chip.h   (contents, props changed)
  head/sys/mips/atheros/ar71xx_setup.c   (contents, props changed)
  head/sys/mips/atheros/ar71xx_setup.h   (contents, props changed)
Modified:
  head/sys/mips/atheros/ar71xx_machdep.c
  head/sys/mips/atheros/ar71xx_wdog.c
  head/sys/mips/atheros/ar71xxreg.h
  head/sys/mips/atheros/files.ar71xx
  head/sys/mips/atheros/uart_bus_ar71xx.c
  head/sys/mips/atheros/uart_cpu_ar71xx.c

Added: head/sys/mips/atheros/ar71xx_chip.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/mips/atheros/ar71xx_chip.c	Thu Aug 19 02:03:12 2010	(r211476)
@@ -0,0 +1,180 @@
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+
+#include 
+
+#include "opt_ddb.h"
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+ 
+#include 
+#include 
+ 
+#include 
+ 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+ 
+#include 
+
+#include 
+
+#include 
+
+/* XXX these should replace the current definitions in ar71xxreg.h */
+/* XXX perhaps an ar71xx_chip.h header file? */
+#define AR71XX_PLL_REG_CPU_CONFIG       AR71XX_PLL_CPU_BASE + 0x00
+#define AR71XX_PLL_REG_SEC_CONFIG       AR71XX_PLL_CPU_BASE + 0x04
+#define AR71XX_PLL_REG_ETH0_INT_CLOCK   AR71XX_PLL_CPU_BASE + 0x10
+#define AR71XX_PLL_REG_ETH1_INT_CLOCK   AR71XX_PLL_CPU_BASE + 0x14
+
+#define AR71XX_PLL_DIV_SHIFT            3
+#define AR71XX_PLL_DIV_MASK             0x1f
+#define AR71XX_CPU_DIV_SHIFT            16
+#define AR71XX_CPU_DIV_MASK             0x3
+#define AR71XX_DDR_DIV_SHIFT            18
+#define AR71XX_DDR_DIV_MASK             0x3
+#define AR71XX_AHB_DIV_SHIFT            20
+#define AR71XX_AHB_DIV_MASK             0x7
+
+#define AR71XX_ETH0_PLL_SHIFT           17
+#define AR71XX_ETH1_PLL_SHIFT           19
+
+/* XXX these shouldn't be in here - this file is a per-chip file */
+/* XXX these should be in the top-level ar71xx type, not ar71xx -chip */
+uint32_t u_ar71xx_cpu_freq;
+uint32_t u_ar71xx_ahb_freq;
+uint32_t u_ar71xx_ddr_freq;
+
+static void
+ar71xx_chip_detect_mem_size(void)
+{
+}
+
+static void
+ar71xx_chip_detect_sys_frequency(void)
+{
+	uint32_t pll;
+	uint32_t freq;
+	uint32_t div;
+
+	pll = ATH_READ_REG(AR71XX_PLL_REG_CPU_CONFIG);
+
+	div = ((pll >> AR71XX_PLL_DIV_SHIFT) & AR71XX_PLL_DIV_MASK) + 1;
+	freq = div * AR71XX_BASE_FREQ;
+
+	div = ((pll >> AR71XX_CPU_DIV_SHIFT) & AR71XX_CPU_DIV_MASK) + 1;
+	u_ar71xx_cpu_freq = freq / div;
+
+	div = ((pll >> AR71XX_DDR_DIV_SHIFT) & AR71XX_DDR_DIV_MASK) + 1;
+	u_ar71xx_ddr_freq = freq / div;
+
+	div = (((pll >> AR71XX_AHB_DIV_SHIFT) & AR71XX_AHB_DIV_MASK) + 1) * 2;
+	u_ar71xx_ahb_freq = u_ar71xx_cpu_freq / div;
+}
+
+/*
+ * This does not lock the CPU whilst doing the work!
+ */
+static void
+ar71xx_chip_device_stop(uint32_t mask)
+{
+	uint32_t reg;
+
+	reg = ATH_READ_REG(AR71XX_RST_RESET);
+	ATH_WRITE_REG(AR71XX_RST_RESET, reg | mask);
+}
+
+static void
+ar71xx_chip_device_start(uint32_t mask)
+{
+	uint32_t reg;
+
+	reg = ATH_READ_REG(AR71XX_RST_RESET);
+	ATH_WRITE_REG(AR71XX_RST_RESET, reg & ~mask);
+}
+
+static int
+ar71xx_chip_device_stopped(uint32_t mask)
+{
+	uint32_t reg;
+
+	reg = ATH_READ_REG(AR71XX_RST_RESET);
+        return ((reg & mask) == mask);
+}
+
+static void
+ar71xx_chip_set_pll_ge0(int speed)
+{
+}
+
+static void
+ar71xx_chip_set_pll_ge1(int speed)
+{
+}
+
+static void
+ar71xx_chip_ddr_flush_ge0(void)
+{
+	ar71xx_ddr_flush(AR71XX_WB_FLUSH_GE0);
+}
+
+static void
+ar71xx_chip_ddr_flush_ge1(void)
+{
+	ar71xx_ddr_flush(AR71XX_WB_FLUSH_GE1);
+}
+
+static uint32_t
+ar71xx_chip_get_eth_pll(unsigned int mac, int speed)
+{
+	return 0;
+}
+
+static void
+ar71xx_chip_init_usb_peripheral(void)
+{
+	ar71xx_device_stop(RST_RESET_USB_OHCI_DLL | RST_RESET_USB_HOST | RST_RESET_USB_PHY);
+	DELAY(1000);
+
+	ar71xx_device_start(RST_RESET_USB_OHCI_DLL | RST_RESET_USB_HOST | RST_RESET_USB_PHY);
+	DELAY(1000);
+
+	ATH_WRITE_REG(AR71XX_USB_CTRL_CONFIG,
+	    USB_CTRL_CONFIG_OHCI_DES_SWAP | USB_CTRL_CONFIG_OHCI_BUF_SWAP |
+	    USB_CTRL_CONFIG_EHCI_DES_SWAP | USB_CTRL_CONFIG_EHCI_BUF_SWAP);
+
+	ATH_WRITE_REG(AR71XX_USB_CTRL_FLADJ,
+	    (32 << USB_CTRL_FLADJ_HOST_SHIFT) | (3 << USB_CTRL_FLADJ_A5_SHIFT));
+
+	DELAY(1000);
+}
+
+struct ar71xx_cpu_def ar71xx_chip_def = {
+	&ar71xx_chip_detect_mem_size,
+	&ar71xx_chip_detect_sys_frequency,
+	&ar71xx_chip_device_stop,
+	&ar71xx_chip_device_start,
+	&ar71xx_chip_device_stopped,
+	&ar71xx_chip_set_pll_ge0,
+	&ar71xx_chip_set_pll_ge1,
+	&ar71xx_chip_ddr_flush_ge0,
+	&ar71xx_chip_ddr_flush_ge1,
+	&ar71xx_chip_get_eth_pll,
+	NULL,
+	&ar71xx_chip_init_usb_peripheral,
+};

Added: head/sys/mips/atheros/ar71xx_chip.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/mips/atheros/ar71xx_chip.h	Thu Aug 19 02:03:12 2010	(r211476)
@@ -0,0 +1,34 @@
+/*-
+ * Copyright (c) 2010 Adrian Chadd
+ * 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$ */
+
+#ifndef	__AR71XX_CHIP_H__
+#define	__AR71XX_CHIP_H__
+
+extern struct ar71xx_cpu_def ar71xx_chip_def;
+
+#endif

Modified: head/sys/mips/atheros/ar71xx_machdep.c
==============================================================================
--- head/sys/mips/atheros/ar71xx_machdep.c	Thu Aug 19 01:34:00 2010	(r211475)
+++ head/sys/mips/atheros/ar71xx_machdep.c	Thu Aug 19 02:03:12 2010	(r211476)
@@ -57,6 +57,9 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
+#include 
+#include 
+
 extern char edata[], end[];
 
 uint32_t ar711_base_mac[ETHER_ADDR_LEN];
@@ -202,11 +205,21 @@ platform_start(__register_t a0 __unused,
 	 * should be called first.
 	 */
 	init_param1();
+
+	/* Detect the system type - this is needed for subsequent chipset-specific calls */
+	ar71xx_detect_sys_type();
+	ar71xx_detect_sys_frequency();
+
 	platform_counter_freq = ar71xx_cpu_freq();
 	mips_timer_init_params(platform_counter_freq, 1);
 	cninit();
 	init_static_kenv(boot1_env, sizeof(boot1_env));
 
+	printf("CPU platform: %s\n", ar71xx_get_system_type());
+	printf("CPU Frequency=%d MHz\n", u_ar71xx_cpu_freq / 1000000);
+	printf("CPU DDR Frequency=%d MHz\n", u_ar71xx_ddr_freq / 1000000);
+	printf("CPU AHB Frequency=%d MHz\n", u_ar71xx_ahb_freq / 1000000); 
+
 	printf("platform frequency: %lld\n", platform_counter_freq);
 	printf("arguments: \n");
 	printf("  a0 = %08x\n", a0);

Added: head/sys/mips/atheros/ar71xx_setup.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/mips/atheros/ar71xx_setup.c	Thu Aug 19 02:03:12 2010	(r211476)
@@ -0,0 +1,119 @@
+/*-
+ * Copyright (c) 2010 Adrian Chadd
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+
+#include 
+
+#include "opt_ddb.h"
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+ 
+#include 
+#include 
+ 
+#include 
+ 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+ 
+#include 
+#include 
+
+#include 
+
+#include 
+
+#define	AR71XX_SYS_TYPE_LEN		128
+
+static char ar71xx_sys_type[AR71XX_SYS_TYPE_LEN];
+enum ar71xx_soc_type ar71xx_soc;
+struct ar71xx_cpu_def * ar71xx_cpu_ops = NULL;
+
+void
+ar71xx_detect_sys_type(void)
+{
+	char *chip = "????";
+	uint32_t id;
+	uint32_t major;
+	uint32_t minor;
+	uint32_t rev = 0;
+
+	id = ATH_READ_REG(AR71XX_RST_RESET_REG_REV_ID);
+	major = id & REV_ID_MAJOR_MASK;
+
+	switch (major) {
+	case REV_ID_MAJOR_AR71XX:
+		minor = id & AR71XX_REV_ID_MINOR_MASK;
+		rev = id >> AR71XX_REV_ID_REVISION_SHIFT;
+		rev &= AR71XX_REV_ID_REVISION_MASK;
+		ar71xx_cpu_ops	= &ar71xx_chip_def;
+		switch (minor) {
+		case AR71XX_REV_ID_MINOR_AR7130:
+			ar71xx_soc = AR71XX_SOC_AR7130;
+			chip = "7130";
+			break;
+
+		case AR71XX_REV_ID_MINOR_AR7141:
+			ar71xx_soc = AR71XX_SOC_AR7141;
+			chip = "7141";
+			break;
+
+		case AR71XX_REV_ID_MINOR_AR7161:
+			ar71xx_soc = AR71XX_SOC_AR7161;
+			chip = "7161";
+			break;
+		}
+		break;
+
+	default:
+		panic("ar71xx: unknown chip id:0x%08x\n", id);
+	}
+
+	sprintf(ar71xx_sys_type, "Atheros AR%s rev %u", chip, rev);
+}
+
+const char *
+ar71xx_get_system_type(void)
+{
+	return ar71xx_sys_type;
+}
+

Added: head/sys/mips/atheros/ar71xx_setup.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/mips/atheros/ar71xx_setup.h	Thu Aug 19 02:03:12 2010	(r211476)
@@ -0,0 +1,48 @@
+/*-
+ * Copyright (c) 2010 Adrian Chadd
+ * 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$ */
+
+#ifndef	__AR71XX_SETUP_H__
+#define	__AR71XX_SETUP_H__
+
+enum ar71xx_soc_type {
+	AR71XX_SOC_UNKNOWN,
+	AR71XX_SOC_AR7130,
+	AR71XX_SOC_AR7141,
+	AR71XX_SOC_AR7161,
+	AR71XX_SOC_AR7240,
+	AR71XX_SOC_AR7241,
+	AR71XX_SOC_AR7242,
+	AR71XX_SOC_AR9130,
+	AR71XX_SOC_AR9132
+};
+extern enum ar71xx_soc_type ar71xx_soc;   
+
+extern void ar71xx_detect_sys_type(void);
+extern const char *ar71xx_get_system_type(void);
+
+#endif

Modified: head/sys/mips/atheros/ar71xx_wdog.c
==============================================================================
--- head/sys/mips/atheros/ar71xx_wdog.c	Thu Aug 19 01:34:00 2010	(r211475)
+++ head/sys/mips/atheros/ar71xx_wdog.c	Thu Aug 19 02:03:12 2010	(r211476)
@@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 
 struct ar71xx_wdog_softc {
 	device_t dev;

Modified: head/sys/mips/atheros/ar71xxreg.h
==============================================================================
--- head/sys/mips/atheros/ar71xxreg.h	Thu Aug 19 01:34:00 2010	(r211475)
+++ head/sys/mips/atheros/ar71xxreg.h	Thu Aug 19 02:03:12 2010	(r211476)
@@ -161,6 +161,7 @@
 #define			GPIO_FUNC_USB_CLK_EN    (0)
 
 #define	AR71XX_BASE_FREQ		40000000
+#define	AR71XX_PLL_CPU_BASE		0x18050000
 #define	AR71XX_PLL_CPU_CONFIG		0x18050000
 #define		PLL_SW_UPDATE			(1 << 31)
 #define		PLL_LOCKED			(1 << 30)
@@ -235,6 +236,23 @@
 #define		RST_RESET_PCI_BUS	(1 <<  1)
 #define		RST_RESET_PCI_CORE	(1 <<  0)
 
+/* Chipset revision details */
+#define	AR71XX_RST_RESET_REG_REV_ID	0x18060090
+#define		REV_ID_MAJOR_MASK	0xfff0
+#define		REV_ID_MAJOR_AR71XX	0x00a0
+#define		REV_ID_MAJOR_AR913X	0x00b0
+#define		REV_ID_MAJOR_AR7240	0x00c0
+#define		REV_ID_MAJOR_AR7241	0x0100
+#define		REV_ID_MAJOR_AR7242	0x1100
+
+/* AR71XX chipset revision details */
+#define		AR71XX_REV_ID_MINOR_MASK	0x3
+#define		AR71XX_REV_ID_MINOR_AR7130	0x0
+#define		AR71XX_REV_ID_MINOR_AR7141	0x1
+#define		AR71XX_REV_ID_MINOR_AR7161	0x2
+#define		AR71XX_REV_ID_REVISION_MASK	0x3
+#define		AR71XX_REV_ID_REVISION_SHIFT	2
+
 /*
  * GigE adapters region
  */
@@ -459,38 +477,6 @@
 #define ATH_WRITE_REG(reg, val) \
     *((volatile uint32_t *)MIPS_PHYS_TO_KSEG1((reg))) = (val)
 
-static inline uint64_t
-ar71xx_cpu_freq(void)
-{
-        uint32_t pll_config, div;
-        uint64_t freq;
-
-        /* PLL freq */
-        pll_config = ATH_READ_REG(AR71XX_PLL_CPU_CONFIG);
-        div = ((pll_config >> PLL_FB_SHIFT) & PLL_FB_MASK) + 1;
-        freq = div * AR71XX_BASE_FREQ;
-        /* CPU freq */
-        div = ((pll_config >> PLL_CPU_DIV_SEL_SHIFT) & PLL_CPU_DIV_SEL_MASK)
-            + 1;
-        freq = freq / div;
-
-	return (freq);
-}
-
-static inline uint64_t
-ar71xx_ahb_freq(void)
-{
-        uint32_t pll_config, div;
-        uint64_t freq;
-
-        /* PLL freq */
-        pll_config = ATH_READ_REG(AR71XX_PLL_CPU_CONFIG);
-        /* AHB freq */
-        div = (((pll_config >> PLL_AHB_DIV_SHIFT) & PLL_AHB_DIV_MASK) + 1) * 2;
-        freq = ar71xx_cpu_freq() / div;
-	return (freq);
-}
-
 static inline void
 ar71xx_ddr_flush(uint32_t reg)
 { 

Modified: head/sys/mips/atheros/files.ar71xx
==============================================================================
--- head/sys/mips/atheros/files.ar71xx	Thu Aug 19 01:34:00 2010	(r211475)
+++ head/sys/mips/atheros/files.ar71xx	Thu Aug 19 02:03:12 2010	(r211476)
@@ -15,3 +15,5 @@ mips/atheros/uart_cpu_ar71xx.c	optional 
 mips/atheros/ar71xx_bus_space_reversed.c	standard
 mips/mips/intr_machdep.c        standard
 mips/mips/tick.c		standard
+mips/atheros/ar71xx_setup.c	standard
+mips/atheros/ar71xx_chip.c	standard

Modified: head/sys/mips/atheros/uart_bus_ar71xx.c
==============================================================================
--- head/sys/mips/atheros/uart_bus_ar71xx.c	Thu Aug 19 01:34:00 2010	(r211475)
+++ head/sys/mips/atheros/uart_bus_ar71xx.c	Thu Aug 19 02:03:12 2010	(r211476)
@@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 
 #include "uart_if.h"
 

Modified: head/sys/mips/atheros/uart_cpu_ar71xx.c
==============================================================================
--- head/sys/mips/atheros/uart_cpu_ar71xx.c	Thu Aug 19 01:34:00 2010	(r211475)
+++ head/sys/mips/atheros/uart_cpu_ar71xx.c	Thu Aug 19 02:03:12 2010	(r211476)
@@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 #include 
 
 bus_space_tag_t uart_bus_space_io;

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 02:04:35 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 87A101065697;
	Thu, 19 Aug 2010 02:04:35 +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 5CCBB8FC15;
	Thu, 19 Aug 2010 02:04:35 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7J24ZQF086408;
	Thu, 19 Aug 2010 02:04:35 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7J24ZLI086406;
	Thu, 19 Aug 2010 02:04:35 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201008190204.o7J24ZLI086406@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 19 Aug 2010 02:04: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: r211477 - head/sys/mips/atheros
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 02:04:35 -0000

Author: adrian
Date: Thu Aug 19 02:04:35 2010
New Revision: 211477
URL: http://svn.freebsd.org/changeset/base/211477

Log:
  Make if_arge use the new cpuops rather than hard coding the DDR flush registers.

Modified:
  head/sys/mips/atheros/if_arge.c

Modified: head/sys/mips/atheros/if_arge.c
==============================================================================
--- head/sys/mips/atheros/if_arge.c	Thu Aug 19 02:03:12 2010	(r211476)
+++ head/sys/mips/atheros/if_arge.c	Thu Aug 19 02:04:35 2010	(r211477)
@@ -79,6 +79,7 @@ MODULE_DEPEND(arge, miibus, 1, 1, 1);
 
 #include 
 #include 
+#include 
 
 #undef ARGE_DEBUG
 #ifdef ARGE_DEBUG
@@ -181,14 +182,11 @@ MTX_SYSINIT(miibus_mtx, &miibus_mtx, "ar
 static void
 arge_flush_ddr(struct arge_softc *sc)
 {
-
-	ATH_WRITE_REG(sc->arge_ddr_flush_reg, 1);
-	while (ATH_READ_REG(sc->arge_ddr_flush_reg) & 1)
-		;
-
-	ATH_WRITE_REG(sc->arge_ddr_flush_reg, 1);
-	while (ATH_READ_REG(sc->arge_ddr_flush_reg) & 1)
-		;
+	if (sc->arge_mac_unit == 0) {
+		ar71xx_device_flush_ddr_ge0();
+	} else {
+		ar71xx_device_flush_ddr_ge1();
+	}
 }
 
 static int 
@@ -237,11 +235,9 @@ arge_attach(device_t dev)
 	KASSERT(((sc->arge_mac_unit == 0) || (sc->arge_mac_unit == 1)), 
 	    ("if_arge: Only MAC0 and MAC1 supported"));
 	if (sc->arge_mac_unit == 0) {
-		sc->arge_ddr_flush_reg = AR71XX_WB_FLUSH_GE0;
 		sc->arge_pll_reg = AR71XX_PLL_ETH_INT0_CLK;
 		sc->arge_pll_reg_shift = 17;
 	} else {
-		sc->arge_ddr_flush_reg = AR71XX_WB_FLUSH_GE1;
 		sc->arge_pll_reg = AR71XX_PLL_ETH_INT1_CLK;
 		sc->arge_pll_reg_shift = 19;
 	}
@@ -381,19 +377,9 @@ arge_attach(device_t dev)
 	DELAY(20);
 
 	/* Step 2. Punt the MAC core from the central reset register */
-	reg = ATH_READ_REG(AR71XX_RST_RESET);
-	if (sc->arge_mac_unit == 0) 
-		reg |= RST_RESET_GE0_MAC;
-	else if (sc->arge_mac_unit == 1) 
-		reg |= RST_RESET_GE1_MAC;
-	ATH_WRITE_REG(AR71XX_RST_RESET, reg);
+	ar71xx_device_stop(sc->arge_mac_unit == 0 ? RST_RESET_GE0_MAC : RST_RESET_GE1_MAC);
 	DELAY(100);
-	reg = ATH_READ_REG(AR71XX_RST_RESET);
-	if (sc->arge_mac_unit == 0) 
-		reg &= ~RST_RESET_GE0_MAC;
-	else if (sc->arge_mac_unit == 1) 
-		reg &= ~RST_RESET_GE1_MAC;
-	ATH_WRITE_REG(AR71XX_RST_RESET, reg);
+	ar71xx_device_start(sc->arge_mac_unit == 0 ? RST_RESET_GE0_MAC : RST_RESET_GE1_MAC);
 
 	/* Step 3. Reconfigure MAC block */
 	ARGE_WRITE(sc, AR71XX_MAC_CFG1, 

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 02:05:17 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1B90F1065695;
	Thu, 19 Aug 2010 02:05:17 +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 0B4AD8FC1F;
	Thu, 19 Aug 2010 02:05:17 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7J25GoU086467;
	Thu, 19 Aug 2010 02:05:16 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7J25G8G086465;
	Thu, 19 Aug 2010 02:05:16 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201008190205.o7J25G8G086465@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 19 Aug 2010 02:05: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: r211478 - head/sys/mips/atheros
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 02:05:17 -0000

Author: adrian
Date: Thu Aug 19 02:05:16 2010
New Revision: 211478
URL: http://svn.freebsd.org/changeset/base/211478

Log:
  Make the PCI initialisation path use the new cpuops rather than directly
  programming the reset register.

Modified:
  head/sys/mips/atheros/ar71xx_pci.c

Modified: head/sys/mips/atheros/ar71xx_pci.c
==============================================================================
--- head/sys/mips/atheros/ar71xx_pci.c	Thu Aug 19 02:04:35 2010	(r211477)
+++ head/sys/mips/atheros/ar71xx_pci.c	Thu Aug 19 02:05:16 2010	(r211478)
@@ -56,6 +56,8 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
+
 #undef AR71XX_PCI_DEBUG
 #ifdef AR71XX_PCI_DEBUG
 #define dprintf printf
@@ -258,7 +260,6 @@ ar71xx_pci_attach(device_t dev)
 {
 	int busno = 0;
 	int rid = 0;
-	uint32_t reset;
 	struct ar71xx_pci_softc *sc = device_get_softc(dev);
 
 	sc->sc_mem_rman.rm_type = RMAN_ARRAY;
@@ -295,15 +296,10 @@ ar71xx_pci_attach(device_t dev)
 	}
 
 	/* reset PCI core and PCI bus */
-	reset = ATH_READ_REG(AR71XX_RST_RESET);
-	reset |= (RST_RESET_PCI_CORE | RST_RESET_PCI_BUS);
-	ATH_WRITE_REG(AR71XX_RST_RESET, reset);
-	ATH_READ_REG(AR71XX_RST_RESET);
+	ar71xx_device_stop(RST_RESET_PCI_CORE | RST_RESET_PCI_BUS);
 	DELAY(100000);
 
-	reset &= ~(RST_RESET_PCI_CORE | RST_RESET_PCI_BUS);
-	ATH_WRITE_REG(AR71XX_RST_RESET, reset);
-	ATH_READ_REG(AR71XX_RST_RESET);
+	ar71xx_device_start(RST_RESET_PCI_CORE | RST_RESET_PCI_BUS);
 	DELAY(100000);
 
 	/* Init PCI windows */

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 02:10:06 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 43E8E1065673;
	Thu, 19 Aug 2010 02:10:06 +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 3340D8FC16;
	Thu, 19 Aug 2010 02:10:06 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7J2A6T4086632;
	Thu, 19 Aug 2010 02:10:06 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7J2A6GO086630;
	Thu, 19 Aug 2010 02:10:06 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201008190210.o7J2A6GO086630@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 19 Aug 2010 02:10: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: r211479 - head/sys/mips/atheros
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 02:10:06 -0000

Author: adrian
Date: Thu Aug 19 02:10:05 2010
New Revision: 211479
URL: http://svn.freebsd.org/changeset/base/211479

Log:
  Remove the now-unused DDR flush register value.

Modified:
  head/sys/mips/atheros/if_argevar.h

Modified: head/sys/mips/atheros/if_argevar.h
==============================================================================
--- head/sys/mips/atheros/if_argevar.h	Thu Aug 19 02:05:16 2010	(r211478)
+++ head/sys/mips/atheros/if_argevar.h	Thu Aug 19 02:10:05 2010	(r211479)
@@ -150,7 +150,6 @@ struct arge_softc {
 	uint32_t		arge_intr_status;
 	int			arge_mac_unit;
 	int			arge_phymask;
-	uint32_t		arge_ddr_flush_reg;
 	uint32_t		arge_pll_reg;
 	uint32_t		arge_pll_reg_shift;
 	int			arge_if_flags;

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 02:12:05 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0E09E1065696;
	Thu, 19 Aug 2010 02:12:05 +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 F1BBB8FC08;
	Thu, 19 Aug 2010 02:12:04 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7J2C4ad086728;
	Thu, 19 Aug 2010 02:12:04 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7J2C4OQ086726;
	Thu, 19 Aug 2010 02:12:04 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201008190212.o7J2C4OQ086726@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 19 Aug 2010 02:12: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: r211480 - head/sys/mips/atheros
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 02:12:05 -0000

Author: adrian
Date: Thu Aug 19 02:12:04 2010
New Revision: 211480
URL: http://svn.freebsd.org/changeset/base/211480

Log:
  Migrate the CPU reset path to use the new cpuops.

Modified:
  head/sys/mips/atheros/ar71xx_machdep.c

Modified: head/sys/mips/atheros/ar71xx_machdep.c
==============================================================================
--- head/sys/mips/atheros/ar71xx_machdep.c	Thu Aug 19 02:10:05 2010	(r211479)
+++ head/sys/mips/atheros/ar71xx_machdep.c	Thu Aug 19 02:12:04 2010	(r211480)
@@ -121,9 +121,7 @@ platform_identify(void)
 void
 platform_reset(void)
 {
-	uint32_t reg = ATH_READ_REG(AR71XX_RST_RESET);
-
-	ATH_WRITE_REG(AR71XX_RST_RESET, reg | RST_RESET_FULL_CHIP);
+	ar71xx_device_stop(RST_RESET_FULL_CHIP);
 	/* Wait for reset */
 	while(1)
 		;

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 02:14:54 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0791910656A9;
	Thu, 19 Aug 2010 02:14:54 +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 EB3768FC1E;
	Thu, 19 Aug 2010 02:14:53 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7J2ErFF086833;
	Thu, 19 Aug 2010 02:14:53 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7J2Er3u086831;
	Thu, 19 Aug 2010 02:14:53 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201008190214.o7J2Er3u086831@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 19 Aug 2010 02:14: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: r211481 - head/sys/mips/atheros
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 02:14:54 -0000

Author: adrian
Date: Thu Aug 19 02:14:53 2010
New Revision: 211481
URL: http://svn.freebsd.org/changeset/base/211481

Log:
  Initialise the USB system using cpuops rather than the AR71XX specific method.

Modified:
  head/sys/mips/atheros/ar71xx_machdep.c

Modified: head/sys/mips/atheros/ar71xx_machdep.c
==============================================================================
--- head/sys/mips/atheros/ar71xx_machdep.c	Thu Aug 19 02:12:04 2010	(r211480)
+++ head/sys/mips/atheros/ar71xx_machdep.c	Thu Aug 19 02:14:53 2010	(r211481)
@@ -255,22 +255,7 @@ platform_start(__register_t a0 __unused,
 	/*
 	 * Reset USB devices 
 	 */
-	reg = ATH_READ_REG(AR71XX_RST_RESET);
-	reg |= 
-	    RST_RESET_USB_OHCI_DLL | RST_RESET_USB_HOST | RST_RESET_USB_PHY;
-	ATH_WRITE_REG(AR71XX_RST_RESET, reg);
-	DELAY(1000);
-	reg &= 
-	    ~(RST_RESET_USB_OHCI_DLL | RST_RESET_USB_HOST | RST_RESET_USB_PHY);
-	ATH_WRITE_REG(AR71XX_RST_RESET, reg);
-	
-	ATH_WRITE_REG(AR71XX_USB_CTRL_CONFIG,
-	    USB_CTRL_CONFIG_OHCI_DES_SWAP | USB_CTRL_CONFIG_OHCI_BUF_SWAP |
-	    USB_CTRL_CONFIG_EHCI_DES_SWAP | USB_CTRL_CONFIG_EHCI_BUF_SWAP);
-
-	ATH_WRITE_REG(AR71XX_USB_CTRL_FLADJ, 
-	    (32 << USB_CTRL_FLADJ_HOST_SHIFT) | (3 << USB_CTRL_FLADJ_A5_SHIFT));
-	DELAY(1000);
+	ar71xx_init_usb_peripheral();
 
 	kdb_init();
 #ifdef KDB

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 02:15:40 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 360F010656A4;
	Thu, 19 Aug 2010 02:15:40 +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 251DD8FC18;
	Thu, 19 Aug 2010 02:15:40 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7J2Fetn086908;
	Thu, 19 Aug 2010 02:15:40 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7J2FeIu086906;
	Thu, 19 Aug 2010 02:15:40 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201008190215.o7J2FeIu086906@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 19 Aug 2010 02:15: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: r211482 - head/sys/mips/atheros
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 02:15:40 -0000

Author: adrian
Date: Thu Aug 19 02:15:39 2010
New Revision: 211482
URL: http://svn.freebsd.org/changeset/base/211482

Log:
  Remove now unused 'reg'.

Modified:
  head/sys/mips/atheros/ar71xx_machdep.c

Modified: head/sys/mips/atheros/ar71xx_machdep.c
==============================================================================
--- head/sys/mips/atheros/ar71xx_machdep.c	Thu Aug 19 02:14:53 2010	(r211481)
+++ head/sys/mips/atheros/ar71xx_machdep.c	Thu Aug 19 02:15:39 2010	(r211482)
@@ -144,7 +144,6 @@ platform_start(__register_t a0 __unused,
     __register_t a2 __unused, __register_t a3 __unused)
 {
 	uint64_t platform_counter_freq;
-	uint32_t reg;
 	int argc, i, count = 0;
 	char **argv, **envp;
 	vm_offset_t kernend;

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 03:19:26 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D116A106564A;
	Thu, 19 Aug 2010 03:19:26 +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 A5B918FC13;
	Thu, 19 Aug 2010 03:19:26 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7J3JQEQ088467;
	Thu, 19 Aug 2010 03:19:26 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7J3JQDQ088463;
	Thu, 19 Aug 2010 03:19:26 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201008190319.o7J3JQDQ088463@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Thu, 19 Aug 2010 03:19: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: r211483 - in head/sys: conf powerpc/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: Thu, 19 Aug 2010 03:19:27 -0000

Author: nwhitehorn
Date: Thu Aug 19 03:19:26 2010
New Revision: 211483
URL: http://svn.freebsd.org/changeset/base/211483

Log:
  Unbreak the LINT kernel on powerpc64. Note that the LINT kernel
  configuration is TARGET_ARCH specific and must be generated with
  TARGET_ARCH set.
  
  Reviewed by:	imp

Modified:
  head/sys/conf/makeLINT.mk
  head/sys/powerpc/conf/Makefile
  head/sys/powerpc/conf/NOTES

Modified: head/sys/conf/makeLINT.mk
==============================================================================
--- head/sys/conf/makeLINT.mk	Thu Aug 19 02:15:39 2010	(r211482)
+++ head/sys/conf/makeLINT.mk	Thu Aug 19 03:19:26 2010	(r211483)
@@ -17,3 +17,6 @@ LINT: ${NOTES} ../../conf/makeLINT.sed
 	echo "ident ${.TARGET}-VIMAGE"	>> ${.TARGET}-VIMAGE
 	echo "options VIMAGE"		>> ${.TARGET}-VIMAGE
 .endif
+.if ${TARGET} == "powerpc"
+	echo "machine	${TARGET} ${TARGET_ARCH}" >> ${.TARGET}
+.endif

Modified: head/sys/powerpc/conf/Makefile
==============================================================================
--- head/sys/powerpc/conf/Makefile	Thu Aug 19 02:15:39 2010	(r211482)
+++ head/sys/powerpc/conf/Makefile	Thu Aug 19 03:19:26 2010	(r211483)
@@ -1,5 +1,8 @@
 # $FreeBSD$
 
 TARGET=powerpc
+.if ${MACHINE_ARCH} == powerpc || ${MACHINE_ARCH} == powerpc64
+TARGET_ARCH?=${MACHINE_ARCH}
+.endif
 
 .include "${.CURDIR}/../../conf/makeLINT.mk"

Modified: head/sys/powerpc/conf/NOTES
==============================================================================
--- head/sys/powerpc/conf/NOTES	Thu Aug 19 02:15:39 2010	(r211482)
+++ head/sys/powerpc/conf/NOTES	Thu Aug 19 03:19:26 2010	(r211483)
@@ -8,7 +8,8 @@
 #####################################################################
 # CPU OPTIONS
 
-machine		powerpc powerpc
+# You must specify a machine directive to choose powerpc or powerpc64
+#machine		powerpc powerpc[64]
 
 #
 # You must specify at least one CPU (the one you intend to run on).
@@ -44,6 +45,7 @@ device		snd_davbus	# Apple Davbus Audio
 #####################################################################
 # Devices we don't want to deal with
 
+nodevice	bktr
 nodevice	fdc
 nodevice	ppc
 nodevice	splash

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 03:31:26 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EB87D10656A3;
	Thu, 19 Aug 2010 03:31:26 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DB1A18FC15;
	Thu, 19 Aug 2010 03:31:26 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7J3VQHs088731;
	Thu, 19 Aug 2010 03:31:26 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7J3VQem088729;
	Thu, 19 Aug 2010 03:31:26 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <201008190331.o7J3VQem088729@svn.freebsd.org>
From: Warner Losh 
Date: Thu, 19 Aug 2010 03:31: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: r211484 -
	head/sys/cddl/contrib/opensolaris/uts/common/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, 19 Aug 2010 03:31:27 -0000

Author: imp
Date: Thu Aug 19 03:31:26 2010
New Revision: 211484
URL: http://svn.freebsd.org/changeset/base/211484

Log:
  First cut at mips n64 ABI support

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h

Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h	Thu Aug 19 03:19:26 2010	(r211483)
+++ head/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h	Thu Aug 19 03:31:26 2010	(r211484)
@@ -403,6 +403,25 @@ extern "C" {
 #define	_INT_ALIGNMENT			4
 #define	_FLOAT_ALIGNMENT		4
 #define	_FLOAT_COMPLEX_ALIGNMENT	4
+#if defined(__mips_n64)
+#define	_LONG_ALIGNMENT			8
+#define	_LONG_LONG_ALIGNMENT		8
+#define	_DOUBLE_ALIGNMENT		8
+#define	_DOUBLE_COMPLEX_ALIGNMENT	8
+#define	_LONG_DOUBLE_ALIGNMENT		8
+#define	_LONG_DOUBLE_COMPLEX_ALIGNMENT	8
+#define	_POINTER_ALIGNMENT		8
+#define	_MAX_ALIGNMENT			8
+#define	_ALIGNMENT_REQUIRED		0
+
+#define	_LONG_LONG_ALIGNMENT_32		_INT_ALIGNMENT
+/*
+ * Define the appropriate "implementation choices".
+ */
+#if !defined(_LP64)
+#define	_LP64
+#endif
+#else
 #define	_LONG_ALIGNMENT			4
 #define	_LONG_LONG_ALIGNMENT		4
 #define	_DOUBLE_ALIGNMENT		4
@@ -422,6 +441,7 @@ extern "C" {
 #if !defined(_I32LPx) && defined(_KERNEL)
 #define	_I32LPx
 #endif
+#endif
 #define	_SUNOS_VTOC_16
 #define	_DMA_USES_PHYSADDR
 #define	_FIRMWARE_NEEDS_FDISK

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 05:59:28 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 53312106564A;
	Thu, 19 Aug 2010 05:59:28 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 40C3B8FC1F;
	Thu, 19 Aug 2010 05:59:28 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7J5xSHc091546;
	Thu, 19 Aug 2010 05:59:28 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7J5xShO091533;
	Thu, 19 Aug 2010 05:59:28 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <201008190559.o7J5xShO091533@svn.freebsd.org>
From: Warner Losh 
Date: Thu, 19 Aug 2010 05:59:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r211485 - in head/usr.sbin/pc-sysinstall: backend
	backend-query conf doc pc-sysinstall
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 05:59:28 -0000

Author: imp
Date: Thu Aug 19 05:59:27 2010
New Revision: 211485
URL: http://svn.freebsd.org/changeset/base/211485

Log:
  Various updates to support new pc-sysinstall directive
  "installPackages" that will install packages and all package
  dependencies.
  
  PR:		148606
  Submitted by:	John Hixon

Added:
  head/usr.sbin/pc-sysinstall/backend-query/set-mirror.sh   (contents, props changed)
  head/usr.sbin/pc-sysinstall/backend/functions-installpackages.sh   (contents, props changed)
Modified:
  head/usr.sbin/pc-sysinstall/backend-query/Makefile
  head/usr.sbin/pc-sysinstall/backend-query/get-packages.sh
  head/usr.sbin/pc-sysinstall/backend/Makefile
  head/usr.sbin/pc-sysinstall/backend/functions-ftp.sh
  head/usr.sbin/pc-sysinstall/backend/functions-packages.sh
  head/usr.sbin/pc-sysinstall/backend/functions-runcommands.sh
  head/usr.sbin/pc-sysinstall/backend/parseconfig.sh
  head/usr.sbin/pc-sysinstall/conf/pc-sysinstall.conf
  head/usr.sbin/pc-sysinstall/doc/help-index
  head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh

Modified: head/usr.sbin/pc-sysinstall/backend-query/Makefile
==============================================================================
--- head/usr.sbin/pc-sysinstall/backend-query/Makefile	Thu Aug 19 03:31:26 2010	(r211484)
+++ head/usr.sbin/pc-sysinstall/backend-query/Makefile	Thu Aug 19 05:59:27 2010	(r211485)
@@ -3,8 +3,8 @@
 FILES=	detect-laptop.sh detect-nics.sh detect-emulation.sh disk-info.sh \
 	disk-list.sh disk-part.sh enable-net.sh get-packages.sh list-config.sh \
 	list-components.sh list-mirrors.sh list-packages.sh list-rsync-backups.sh \
-	list-tzones.sh query-langs.sh send-logs.sh setup-ssh-keys.sh sys-mem.sh \
-	test-live.sh test-netup.sh update-part-list.sh xkeyboard-layouts.sh \
+	list-tzones.sh query-langs.sh send-logs.sh set-mirror.sh setup-ssh-keys.sh \
+	sys-mem.sh test-live.sh test-netup.sh update-part-list.sh xkeyboard-layouts.sh \
 	xkeyboard-models.sh xkeyboard-variants.sh
 FILESMODE=	${BINMODE}
 FILESDIR=${SHAREDIR}/pc-sysinstall/backend-query

Modified: head/usr.sbin/pc-sysinstall/backend-query/get-packages.sh
==============================================================================
--- head/usr.sbin/pc-sysinstall/backend-query/get-packages.sh	Thu Aug 19 03:31:26 2010	(r211484)
+++ head/usr.sbin/pc-sysinstall/backend-query/get-packages.sh	Thu Aug 19 05:59:27 2010	(r211485)
@@ -31,24 +31,16 @@
 . ${PROGDIR}/backend/functions.sh
 . ${PROGDIR}/backend/functions-packages.sh
 
-DEFAULT_FTP_SERVER="ftp.freebsd.org"
-FTP_SERVER="${1}"
 ID=`id -u`
-
 if [ "${ID}" -ne "0" ]
 then
 	echo "Error: must be root!" 
 	exit 1
 fi
 
-if [ -z "${FTP_SERVER}" ]
-then
-	FTP_SERVER="${DEFAULT_FTP_SERVER}"
-fi
-
 if [ ! -f "${PKGDIR}/INDEX" ]
 then
-	get_package_index "${FTP_SERVER}"
+	get_package_index
 fi
 
 if [ -f "${PKGDIR}/INDEX" ]

Added: head/usr.sbin/pc-sysinstall/backend-query/set-mirror.sh
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/usr.sbin/pc-sysinstall/backend-query/set-mirror.sh	Thu Aug 19 05:59:27 2010	(r211485)
@@ -0,0 +1,40 @@
+#!/bin/sh
+#-
+# Copyright (c) 2010 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 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$
+
+. ${PROGDIR}/backend/functions.sh
+. ${PROGDIR}/backend/functions-ftp.sh
+
+MIRROR="${1}"
+
+if [ -z "${MIRROR}" ]
+then
+	echo "Error: No mirror specified!"
+	exit 1
+fi
+
+set_ftp_mirror "${MIRROR}"
+exit 0

Modified: head/usr.sbin/pc-sysinstall/backend/Makefile
==============================================================================
--- head/usr.sbin/pc-sysinstall/backend/Makefile	Thu Aug 19 03:31:26 2010	(r211484)
+++ head/usr.sbin/pc-sysinstall/backend/Makefile	Thu Aug 19 05:59:27 2010	(r211485)
@@ -2,7 +2,7 @@
 
 FILES=	functions-bsdlabel.sh functions-cleanup.sh functions-disk.sh \
 	functions-extractimage.sh functions-ftp.sh functions-installcomponents.sh \
-	functions-localize.sh functions-mountdisk.sh \
+	functions-installpackages.sh functions-localize.sh functions-mountdisk.sh \
 	functions-mountoptical.sh functions-networking.sh \
 	functions-newfs.sh functions-packages.sh functions-parse.sh \
 	functions-runcommands.sh functions-unmount.sh \

Modified: head/usr.sbin/pc-sysinstall/backend/functions-ftp.sh
==============================================================================
--- head/usr.sbin/pc-sysinstall/backend/functions-ftp.sh	Thu Aug 19 03:31:26 2010	(r211484)
+++ head/usr.sbin/pc-sysinstall/backend/functions-ftp.sh	Thu Aug 19 05:59:27 2010	(r211485)
@@ -30,6 +30,8 @@
 . ${BACKEND}/functions.sh
 . ${BACKEND}/functions-parse.sh
 
+DEFAULT_FTP_SERVER="ftp.freebsd.org"
+
 MAIN_FTP_SERVERS="\
 Main Site: ftp.freebsd.org"
 
@@ -274,7 +276,25 @@ show_mirrors()
     done
     IFS="${SAVE_IFS}"
   fi
-}
+};
+
+set_ftp_mirror()
+{
+	MIRROR="${1}"
+	echo "${MIRROR}" > "${CONFDIR}/mirrors.conf"
+};
+
+get_ftp_mirror()
+{
+	MIRROR="${DEFAULT_FTP_SERVER}"
+	if [ -f "${CONFDIR}/mirrors.conf" ]
+	then
+		MIRROR=`cat "${CONFDIR}/mirrors.conf"`
+	fi
+
+	VAL="${MIRROR}"
+	export VAL
+};
 
 get_ftp_mirrors()
 {
@@ -371,4 +391,4 @@ get_ftp_mirrors()
   fi
 
   export VAL
-}
+};

Added: head/usr.sbin/pc-sysinstall/backend/functions-installpackages.sh
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/usr.sbin/pc-sysinstall/backend/functions-installpackages.sh	Thu Aug 19 05:59:27 2010	(r211485)
@@ -0,0 +1,118 @@
+#!/bin/sh
+#-
+# Copyright (c) 2010 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 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$
+
+# Functions which check and load any optional packages specified in the config
+
+. ${BACKEND}/functions.sh
+. ${BACKEND}/functions-parse.sh
+
+# Recursively determine all dependencies for this package
+determine_package_dependencies()
+{
+	local PKGNAME="${1}"
+	local DEPFILE="${2}"
+
+	grep "${PKGNAME}" "${DEPFILE}" >/dev/null
+	if [ "$?" -ne "0" ]
+	then
+		echo "${PKGNAME}" >> "${DEPFILE}"
+		get_package_dependencies "${PKGNAME}" "1"
+		local DEPS="${VAL}"
+
+		for d in ${DEPS}
+		do
+			get_all_package_dependencies "${d}" "${DEPFILE}"
+		done
+	fi
+};
+
+# Fetch packages dependencies from a file
+fetch_package_dependencies()
+{
+	local DEPFILE
+	local DEPS
+
+	DEPFILE="${1}"
+	DEPS=`cat "${DEPFILE}"`
+
+	for d in ${DEPS}
+	do
+		get_package_short_name "${d}"
+		SNAME="${VAL}"
+
+		get_package_category "${SNAME}"
+		CATEGORY="${VAL}"
+
+		fetch_package "${CATEGORY}" "${d}"
+	done
+};
+
+# Check for any packages specified, and begin loading them
+install_packages()
+{
+   # First, lets check and see if we even have any packages to install
+	get_value_from_cfg installPackages
+	if [ ! -z "${VAL}" ]
+	then
+	  mkdir -p "${PKGTMPDIR}"
+
+	  HERE=`pwd`
+	  cd "${PKGTMPDIR}"
+
+      # Lets start by cleaning up the string and getting it ready to parse
+      strip_white_space ${VAL}
+      PACKAGES=`echo ${VAL} | sed -e "s|,| |g"`
+      for i in $PACKAGES
+	  do
+		if get_package_name "${i}"
+		then
+			PKGNAME="${VAL}"
+			DEPFILE="${PKGTMPDIR}/.${PKGNAME}.deps"
+
+			touch "${DEPFILE}"
+			determine_package_dependencies "${PKGNAME}" "${DEPFILE}"
+			fetch_package_dependencies "${DEPFILE}"
+
+			# If the package is not already installed, install it!
+			if ! run_chroot_cmd "pkg_info -e ${PKGNAME}"
+			then
+				echo_log "Adding package ${PKGNAME}"
+				pkg_add -C "${FSMNT}" "${PKGNAME}.tbz" >/dev/null 2>&1
+				if [ "$?" -eq "0" ]
+				then
+					echo_log "${PKGNAME} successfully installed!"
+				fi
+			fi
+
+			rm "${DEPFILE}"
+		fi
+	  done
+
+	  #rm -rf "${PKGTMPDIR}"
+	  cd "${HERE}"
+	fi
+};

Modified: head/usr.sbin/pc-sysinstall/backend/functions-packages.sh
==============================================================================
--- head/usr.sbin/pc-sysinstall/backend/functions-packages.sh	Thu Aug 19 03:31:26 2010	(r211484)
+++ head/usr.sbin/pc-sysinstall/backend/functions-packages.sh	Thu Aug 19 05:59:27 2010	(r211485)
@@ -34,29 +34,30 @@
 
 get_package_index()
 {
-	FTP_SERVER="${1}"
-	FTP_DIR="ftp://${FTP_SERVER}/pub/FreeBSD/releases/${FBSD_ARCH}/${FBSD_BRANCH}/packages"
 	INDEX_FILE="INDEX"
 	USE_BZIP2=0
 
+	get_ftp_mirror
+	FTP_SERVER="${VAL}"
+
+	FTP_DIR="ftp://${FTP_SERVER}/pub/FreeBSD/releases/${FBSD_ARCH}/${FBSD_BRANCH}/packages"
+
 	if [ -f "/usr/bin/bzip2" ]
 	then
 		INDEX_FILE="${INDEX_FILE}.bz2"
 		USE_BZIP2=1
 	fi
 
-	ftp "${FTP_DIR}/${INDEX_FILE}"
-	if [ -f "${INDEX_FILE}" ]
-	then
-		if [ "${USE_BZIP2}" -eq  "1" ]
-		then
-			bzip2 -d "${INDEX_FILE}"
-			INDEX_FILE="${INDEX_FILE%.bz2}"
-		fi
+	fetch_file "${FTP_DIR}/${INDEX_FILE}" "${PKGDIR}/${INDEX_FILE}" "1"
 
-		mv "${INDEX_FILE}" "${PKGDIR}"
+	HERE=`pwd`
+	cd "${PKGDIR}"
+	if [ -f "${INDEX_FILE}" ] && [ "${USE_BZIP2}" -eq "1" ]
+	then
+		bzip2 -d "${INDEX_FILE}"
 	fi
-}
+	cd "${HERE}"
+};
 
 parse_package_index()
 {
@@ -67,9 +68,11 @@ parse_package_index()
 
 	while read -r line
 	do
+		PKGNAME=""
 		CATEGORY=""
 		PACKAGE=""
 		DESC=""
+		DEPS=""
 		i=0
 
 		SAVE_IFS="${IFS}"
@@ -77,7 +80,11 @@ parse_package_index()
 
 		for part in ${line}
 		do
-			if [ "${i}" -eq "1" ]
+			if [ "${i}" -eq "0" ]
+			then
+				PKGNAME="${part}"
+
+			elif [ "${i}" -eq "1" ]
 			then
 				PACKAGE=`basename "${part}"`
 
@@ -88,17 +95,23 @@ parse_package_index()
 			elif [ "${i}" -eq "6" ]
 			then
 				CATEGORY=`echo "${part}" | cut -f1 -d' '`
+
+			elif [ "${i}" -eq "8" ]
+			then
+				DEPS="${part}"
 			fi
 
 			i=$((i+1))
 		done
 
 		echo "${CATEGORY}|${PACKAGE}|${DESC}" >> "${INDEX_FILE}.parsed"
+		echo "${PACKAGE}|${PKGNAME}|${DEPS}" >> "${INDEX_FILE}.deps"
+
 		IFS="${SAVE_IFS}"
 	done
 
 	exec 0<&3
-}
+};
 
 show_package_file()
 {
@@ -117,7 +130,7 @@ show_package_file()
 	done
 
 	exec 0<&3
-}
+};
 
 show_packages_by_category()
 {
@@ -128,7 +141,7 @@ show_packages_by_category()
 	grep "^${CATEGORY}|" "${INDEX_FILE}" > "${TMPFILE}"
 	show_package_file "${TMPFILE}"
 	rm "${TMPFILE}"
-}
+};
 
 show_package_by_name()
 {
@@ -140,9 +153,118 @@ show_package_by_name()
 	grep "^${CATEGORY}|${PACKAGE}" "${INDEX_FILE}" > "${TMPFILE}"
 	show_package_file "${TMPFILE}"
 	rm "${TMPFILE}"
-}
+};
 
 show_packages()
 {
 	show_package_file "${PKGDIR}/INDEX.parsed"
-}
+};
+
+get_package_dependencies()
+{
+	PACKAGE="${1}"
+	LONG="${2:-0}"
+	RES=0
+
+	INDEX_FILE="${PKGDIR}/INDEX.deps"
+	REGEX="^${PACKAGE}|"
+
+	if [ "${LONG}" -ne "0" ]
+	then
+		REGEX="^.*|${PACKAGE}|"
+	fi
+
+	LINE=`grep "${REGEX}" "${INDEX_FILE}" 2>/dev/null`
+	DEPS=`echo "${LINE}"|cut -f3 -d'|'`
+
+	VAL="${DEPS}"
+	export VAL
+
+	if [ -z "${VAL}" ]
+	then
+		RES=1
+	fi
+
+	return ${RES}
+};
+
+get_package_name()
+{
+	PACKAGE="${1}"
+	RES=0
+
+	INDEX_FILE="${PKGDIR}/INDEX.deps"
+	REGEX="^${PACKAGE}|"
+	
+	LINE=`grep "${REGEX}" "${INDEX_FILE}" 2>/dev/null`
+	NAME=`echo "${LINE}"|cut -f2 -d'|'`
+
+	VAL="${NAME}"
+	export VAL
+
+	if [ -z "${VAL}" ]
+	then
+		RES=1
+	fi
+
+	return ${RES}
+};
+
+get_package_short_name()
+{
+	PACKAGE="${1}"
+	RES=0
+
+	INDEX_FILE="${PKGDIR}/INDEX.deps"
+	REGEX="^.*|${PACKAGE}|"
+	
+	LINE=`grep "${REGEX}" "${INDEX_FILE}" 2>/dev/null`
+	NAME=`echo "${LINE}"|cut -f1 -d'|'`
+
+	VAL="${NAME}"
+	export VAL
+
+	if [ -z "${VAL}" ]
+	then
+		RES=1
+	fi
+
+	return ${RES}
+};
+
+get_package_category()
+{
+	PACKAGE="${1}"
+	INDEX_FILE="${PKGDIR}/INDEX.parsed"
+	RES=0
+
+	LINE=`grep "|${PACKAGE}|" "${INDEX_FILE}" 2>/dev/null`
+	NAME=`echo "${LINE}"|cut -f1 -d'|'`
+
+	VAL="${NAME}"
+	export VAL
+
+	if [ -z "${VAL}" ]
+	then
+		RES=1
+	fi
+
+	return ${RES}
+};
+
+fetch_package()
+{
+	CATEGORY="${1}"
+	PACKAGE="${2}"
+
+	get_ftp_mirror
+	FTP_SERVER="${VAL}"
+
+	PACKAGE="${PACKAGE}.tbz"
+	if [ ! -f "${PKGTMPDIR}/${PACKAGE}" ]
+	then
+		PKGPATH="${CATEGORY}/${PACKAGE}"
+		FTP_PATH="ftp://${FTP_SERVER}/pub/FreeBSD/releases/${FBSD_ARCH}/${FBSD_BRANCH}/packages/${PKGPATH}"
+		fetch_file "${FTP_PATH}" "${PKGTMPDIR}/" "0"
+	fi
+};

Modified: head/usr.sbin/pc-sysinstall/backend/functions-runcommands.sh
==============================================================================
--- head/usr.sbin/pc-sysinstall/backend/functions-runcommands.sh	Thu Aug 19 03:31:26 2010	(r211484)
+++ head/usr.sbin/pc-sysinstall/backend/functions-runcommands.sh	Thu Aug 19 05:59:27 2010	(r211485)
@@ -37,7 +37,10 @@ run_chroot_cmd()
   echo "$CMD" >${FSMNT}/.runcmd.sh
   chmod 755 ${FSMNT}/.runcmd.sh
   chroot ${FSMNT} sh /.runcmd.sh
+  RES=$?
+
   rm ${FSMNT}/.runcmd.sh
+  return ${RES}
 };
 
 run_chroot_script()
@@ -50,8 +53,10 @@ run_chroot_script()
 
   echo_log "Running chroot script: ${SCRIPT}"
   chroot ${FSMNT} /.${SBASE}
+  RES=$?
 
   rm ${FSMNT}/.${SBASE}
+  return ${RES}
 };
 
 
@@ -64,7 +69,10 @@ run_ext_cmd()
   echo "${CMD}"> ${TMPDIR}/.runcmd.sh
   chmod 755 ${TMPDIR}/.runcmd.sh
   sh ${TMPDIR}/.runcmd.sh
+  RES=$?
+
   rm ${TMPDIR}/.runcmd.sh
+  return ${RES}
 };
 
 

Modified: head/usr.sbin/pc-sysinstall/backend/parseconfig.sh
==============================================================================
--- head/usr.sbin/pc-sysinstall/backend/parseconfig.sh	Thu Aug 19 03:31:26 2010	(r211484)
+++ head/usr.sbin/pc-sysinstall/backend/parseconfig.sh	Thu Aug 19 05:59:27 2010	(r211485)
@@ -35,12 +35,15 @@
 . ${BACKEND}/functions-disk.sh
 . ${BACKEND}/functions-extractimage.sh
 . ${BACKEND}/functions-installcomponents.sh
+. ${BACKEND}/functions-installpackages.sh
 . ${BACKEND}/functions-localize.sh
 . ${BACKEND}/functions-mountdisk.sh
 . ${BACKEND}/functions-networking.sh
 . ${BACKEND}/functions-newfs.sh
+. ${BACKEND}/functions-packages.sh
 . ${BACKEND}/functions-parse.sh
 . ${BACKEND}/functions-runcommands.sh
+. ${BACKEND}/functions-ftp.sh
 . ${BACKEND}/functions-unmount.sh
 . ${BACKEND}/functions-upgrade.sh
 . ${BACKEND}/functions-users.sh
@@ -117,6 +120,9 @@ then
   # Check if we have any optional modules to load 
   install_components
 
+  # Check if we have any packages to install
+  install_packages
+
   # Do any localization in configuration
   run_localize
   
@@ -158,6 +164,9 @@ else
   # Check if we have any optional modules to load 
   install_components
 
+  # Check if we have any packages to install
+  install_packages
+
   # All finished, unmount the file-systems
   unmount_upgrade
 

Modified: head/usr.sbin/pc-sysinstall/conf/pc-sysinstall.conf
==============================================================================
--- head/usr.sbin/pc-sysinstall/conf/pc-sysinstall.conf	Thu Aug 19 03:31:26 2010	(r211484)
+++ head/usr.sbin/pc-sysinstall/conf/pc-sysinstall.conf	Thu Aug 19 05:59:27 2010	(r211485)
@@ -51,6 +51,10 @@ export COMPFILEDIR
 COMPTMPDIR="/usr/.componenttmp"
 export COMPTMPDIR
 
+# set the package temp directory, which is relative to FSMNT
+PKGTMPDIR="/usr/.pkgtmp"
+export PKGTMPDIR
+
 # Variables to set the location of installation data
 UZIP_FILE="PCBSD.ufs.uzip"
 TAR_FILE="PCBSD.tbz"

Modified: head/usr.sbin/pc-sysinstall/doc/help-index
==============================================================================
--- head/usr.sbin/pc-sysinstall/doc/help-index	Thu Aug 19 03:31:26 2010	(r211484)
+++ head/usr.sbin/pc-sysinstall/doc/help-index	Thu Aug 19 05:59:27 2010	(r211485)
@@ -34,10 +34,10 @@ System Query Commands
     list-components
         Returns a listing of the available components which can be installed
 
-    list-mirrors
+    list-mirrors [country]
         Returns a listing of the available FTP mirrors
 
-    list-packages
+    list-packages [category] [package]
         Returns a listing of the available packages
 
     list-rsync-backups   
@@ -55,6 +55,9 @@ System Query Commands
     sys-mem
         Return the size of installed system RAM in MegaBytes
 
+    set-mirror 
+        Set FTP mirror
+
     test-netup
         Test if an internet connection is available
     

Modified: head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh
==============================================================================
--- head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh	Thu Aug 19 03:31:26 2010	(r211484)
+++ head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh	Thu Aug 19 05:59:27 2010	(r211485)
@@ -43,8 +43,11 @@ export PROGDIR
 COMPDIR="${PROGDIR}/components"
 export COMPDIR
 
+CONFDIR="${PROGDIR}/conf"
+export CONFDIR
+
 # Set this to the packages location
-PKGDIR="${PROGDIR}/conf"
+PKGDIR="${CONFDIR}"
 export PKGDIR
 
 # End of user-editable configuration
@@ -184,6 +187,10 @@ case $1 in
   get-packages) ${QUERYDIR}/get-packages.sh "${2}"
   ;;
 
+  # Function to set FTP mirror
+  set-mirror) ${QUERYDIR}/set-mirror.sh "${2}"
+  ;;
+
   # Function which allows setting up of SSH keys
   setup-ssh-keys) ${QUERYDIR}/setup-ssh-keys.sh "${2}" "${3}" "${4}"
   ;;

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 06:01:25 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8B656106566B;
	Thu, 19 Aug 2010 06:01:25 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7A35D8FC27;
	Thu, 19 Aug 2010 06:01:25 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7J61PwK091711;
	Thu, 19 Aug 2010 06:01:25 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7J61PF8091706;
	Thu, 19 Aug 2010 06:01:25 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <201008190601.o7J61PF8091706@svn.freebsd.org>
From: Warner Losh 
Date: Thu, 19 Aug 2010 06:01: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: r211486 - in head/usr.sbin/pc-sysinstall: backend
	backend-query
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 06:01:25 -0000

Author: imp
Date: Thu Aug 19 06:01:25 2010
New Revision: 211486
URL: http://svn.freebsd.org/changeset/base/211486

Log:
  Updates to pc-sysinstall that allow FTP installation of FreeBSD.
  
  PR:		148661
  Submitted by:	John Hixson

Modified:
  head/usr.sbin/pc-sysinstall/backend-query/list-packages.sh
  head/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh
  head/usr.sbin/pc-sysinstall/backend/functions-installpackages.sh
  head/usr.sbin/pc-sysinstall/backend/functions-packages.sh

Modified: head/usr.sbin/pc-sysinstall/backend-query/list-packages.sh
==============================================================================
--- head/usr.sbin/pc-sysinstall/backend-query/list-packages.sh	Thu Aug 19 05:59:27 2010	(r211485)
+++ head/usr.sbin/pc-sysinstall/backend-query/list-packages.sh	Thu Aug 19 06:01:25 2010	(r211486)
@@ -56,14 +56,26 @@ then
 	NARGS=$((NARGS+1))
 fi
 
-echo "Available Packages:"
 if [ "${NARGS}" -eq "0" ]
 then
 	show_packages
 
 elif [ "${NARGS}" -eq "1" ]
 then
-	show_packages_by_category "${PACKAGE_CATEGORY}"
+	
+	if [ "${PACKAGE_CATEGORY}" = "@INDEX@" ]
+	then
+		if [ -f "${PKGDIR}/INDEX" ]
+		then
+			echo "${PKGDIR}/INDEX"
+			exit 0
+		else
+			exit 1
+		fi
+		
+	else
+		show_packages_by_category "${PACKAGE_CATEGORY}"
+	fi
 
 elif [ "${NARGS}" -eq "2" ]
 then

Modified: head/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh
==============================================================================
--- head/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh	Thu Aug 19 05:59:27 2010	(r211485)
+++ head/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh	Thu Aug 19 06:01:25 2010	(r211486)
@@ -203,6 +203,69 @@ fetch_install_file()
 
 };
 
+# Function which will download freebsd install files
+fetch_split_files()
+{
+  get_value_from_cfg ftpHost
+  if [ -z "$VAL" ]
+  then
+    exit_err "ERROR: Install medium was set to ftp, but no ftpHost was provided!" 
+  fi
+  FTPHOST="${VAL}"
+
+  get_value_from_cfg ftpDir
+  if [ -z "$VAL" ]
+  then
+    exit_err "ERROR: Install medium was set to ftp, but no ftpDir was provided!" 
+  fi
+  FTPDIR="${VAL}"
+
+  # Check if we have a /usr partition to save the download
+  if [ -d "${FSMNT}/usr" ]
+  then
+    OUTFILE="${FSMNT}/usr/.fetch-${INSFILE}"
+  else
+    OUTFILE="${FSMNT}/.fetch-${INSFILE}"
+  fi
+
+  NETRC="${OUTFILE}/.netrc"
+  cat<"${NETRC}"
+machine ${FTPHOST}
+login anonymous
+password anonymous
+macdef INSTALL
+bin
+prompt
+EOF
+
+  DIRS="base catpages dict doc games info manpages proflibs kernels src"
+  if [ "${FBSD_ARCH}" = "amd64" ]
+  then
+	DIRS="${DIRS} lib32"
+  fi
+
+  for d in ${DIRS}
+  do
+	cat<>"${NETRC}"
+cd ${FTPDIR}/${d}
+lcd ${OUTFILE}/${d}
+mreget *
+EOF
+  done
+
+	cat<>"${NETRC}"
+bye
+
+
+EOF
+
+   # Fetch the files via ftp
+   echo "$ INSTALL" | ftp -N "${NETRC}" "${FTPHOST}"
+
+  # Done fetching, now reset the INSFILE to our downloaded archived
+  INSFILE="${OUTFILE}" ; export INSFILE
+}
+
 # Function which does the rsync download from the server specifed in cfg
 start_rsync_copy()
 {
@@ -304,8 +367,17 @@ init_extraction()
           	start_extract_uzip_tar
 		  fi
           ;;
-     ftp) fetch_install_file
-          start_extract_uzip_tar 
+     ftp)
+		  if [ "$PACKAGETYPE" = "split" ]
+		  then
+			fetch_split_files
+
+			INSDIR="${INSFILE}" ; export INSDIR
+			start_extract_split
+		  else
+          	fetch_install_file
+          	start_extract_uzip_tar 
+		  fi
           ;;
      rsync) start_rsync_copy
             ;;

Modified: head/usr.sbin/pc-sysinstall/backend/functions-installpackages.sh
==============================================================================
--- head/usr.sbin/pc-sysinstall/backend/functions-installpackages.sh	Thu Aug 19 05:59:27 2010	(r211485)
+++ head/usr.sbin/pc-sysinstall/backend/functions-installpackages.sh	Thu Aug 19 06:01:25 2010	(r211486)
@@ -45,7 +45,7 @@ determine_package_dependencies()
 
 		for d in ${DEPS}
 		do
-			get_all_package_dependencies "${d}" "${DEPFILE}"
+			determine_package_dependencies "${d}" "${DEPFILE}"
 		done
 	fi
 };
@@ -55,9 +55,11 @@ fetch_package_dependencies()
 {
 	local DEPFILE
 	local DEPS
+	local SAVEDIR
 
 	DEPFILE="${1}"
 	DEPS=`cat "${DEPFILE}"`
+	SAVEDIR="${2}"
 
 	for d in ${DEPS}
 	do
@@ -67,7 +69,7 @@ fetch_package_dependencies()
 		get_package_category "${SNAME}"
 		CATEGORY="${VAL}"
 
-		fetch_package "${CATEGORY}" "${d}"
+		fetch_package "${CATEGORY}" "${d}" "${SAVEDIR}"
 	done
 };
 
@@ -78,10 +80,19 @@ install_packages()
 	get_value_from_cfg installPackages
 	if [ ! -z "${VAL}" ]
 	then
-	  mkdir -p "${PKGTMPDIR}"
-
 	  HERE=`pwd`
-	  cd "${PKGTMPDIR}"
+	  rc_nohalt "mkdir -p ${FSMNT}/${PKGTMPDIR}"
+	  rc_nohalt "cd ${FSMNT}/${PKGTMPDIR}"
+
+	  if [ ! -f "${CONFDIR}/INDEX" ]
+	  then
+		get_package_index
+	  fi
+
+	  if [ ! -f "${CONFDIR}/INDEX.parsed" ]
+	  then
+		parse_package_index
+	  fi
 
       # Lets start by cleaning up the string and getting it ready to parse
       strip_white_space ${VAL}
@@ -91,28 +102,24 @@ install_packages()
 		if get_package_name "${i}"
 		then
 			PKGNAME="${VAL}"
-			DEPFILE="${PKGTMPDIR}/.${PKGNAME}.deps"
+			DEPFILE="${FSMNT}/${PKGTMPDIR}/.${PKGNAME}.deps"
 
-			touch "${DEPFILE}"
+			rc_nohalt "touch ${DEPFILE}"
 			determine_package_dependencies "${PKGNAME}" "${DEPFILE}"
-			fetch_package_dependencies "${DEPFILE}"
+			fetch_package_dependencies "${DEPFILE}" "${FSMNT}/${PKGTMPDIR}"
 
 			# If the package is not already installed, install it!
 			if ! run_chroot_cmd "pkg_info -e ${PKGNAME}"
 			then
-				echo_log "Adding package ${PKGNAME}"
-				pkg_add -C "${FSMNT}" "${PKGNAME}.tbz" >/dev/null 2>&1
-				if [ "$?" -eq "0" ]
-				then
-					echo_log "${PKGNAME} successfully installed!"
-				fi
+				rc_nohalt "pkg_add -C ${FSMNT} ${PKGTMPDIR}/${PKGNAME}.tbz"
 			fi
 
-			rm "${DEPFILE}"
+			rc_nohalt "rm ${DEPFILE}"
 		fi
+
+		rc_nohalt "cd ${HERE}"
 	  done
 
-	  #rm -rf "${PKGTMPDIR}"
-	  cd "${HERE}"
+	  #rm -rf "${FSMNT}/${PKGTMPDIR}"
 	fi
 };

Modified: head/usr.sbin/pc-sysinstall/backend/functions-packages.sh
==============================================================================
--- head/usr.sbin/pc-sysinstall/backend/functions-packages.sh	Thu Aug 19 05:59:27 2010	(r211485)
+++ head/usr.sbin/pc-sysinstall/backend/functions-packages.sh	Thu Aug 19 06:01:25 2010	(r211486)
@@ -32,31 +32,80 @@
 . ${BACKEND}/functions-ftp.sh
 
 
-get_package_index()
+get_package_index_by_ftp()
 {
+	local INDEX_FILE
+	local FTP_SERVER
+
+	FTP_SERVER="${1}"
 	INDEX_FILE="INDEX"
 	USE_BZIP2=0
 
-	get_ftp_mirror
-	FTP_SERVER="${VAL}"
-
-	FTP_DIR="ftp://${FTP_SERVER}/pub/FreeBSD/releases/${FBSD_ARCH}/${FBSD_BRANCH}/packages"
-
 	if [ -f "/usr/bin/bzip2" ]
 	then
 		INDEX_FILE="${INDEX_FILE}.bz2"
 		USE_BZIP2=1
 	fi
 
-	fetch_file "${FTP_DIR}/${INDEX_FILE}" "${PKGDIR}/${INDEX_FILE}" "1"
+	INDEX_PATH="${CONFDIR}/${INDEX_FILE}"
+	fetch_file "${FTP_SERVER}/${INDEX_FILE}" "${INDEX_PATH}" "1"
+	if [ -f "${INDEX_PATH}" ] && [ "${USE_BZIP2}" -eq "1" ]
+	then
+		bzip2 -d "${INDEX_PATH}"
+	fi
+};
+
+get_package_index_by_fs()
+{
+	local INDEX_FILE
+
+	INDEX_FILE="${CDMNT}/packages/INDEX"
+	fetch_file "${INDEX_FILE}" "${CONFDIR}/" "0"
+};
 
-	HERE=`pwd`
-	cd "${PKGDIR}"
-	if [ -f "${INDEX_FILE}" ] && [ "${USE_BZIP2}" -eq "1" ]
+get_package_index()
+{
+	RES=0
+
+	if [ -z "${INSTALLMODE}" ]
 	then
-		bzip2 -d "${INDEX_FILE}"
+		get_ftp_mirror
+		FTPHOST="${VAL}"
+
+		FTPDIR="/pub/FreeBSD/releases/${FBSD_ARCH}/${FBSD_BRANCH}"
+		FTPPATH="ftp://${FTPHOST}${FTPDIR}/packages"
+
+		get_package_index_by_ftp "${FTPPATH}"
+
+	else
+		get_value_from_cfg ftpHost
+		if [ -z "$VAL" ]
+		then
+			exit_err "ERROR: Install medium was set to ftp, but no ftpHost was provided!" 
+		fi
+		FTPHOST="${VAL}"
+
+		get_value_from_cfg ftpDir
+		if [ -z "$VAL" ]
+		then
+			exit_err "ERROR: Install medium was set to ftp, but no ftpDir was provided!" 
+		fi
+		FTPDIR="${VAL}"
+
+		FTPPATH="ftp://${FTPHOST}${FTPDIR}"
+
+		case "${INSTALLMEDIUM}" in
+		usb|dvd) get_package_index_by_fs
+			;;
+		ftp) get_package_index_by_ftp "${FTPPATH}"
+			;;
+		*) RES=1
+			;;
+		esac
+
 	fi
-	cd "${HERE}"
+
+	return ${RES}
 };
 
 parse_package_index()
@@ -117,6 +166,8 @@ show_package_file()
 {
 	PKGFILE="${1}"
 
+	echo "Available Packages:"
+
 	exec 3<&0
 	exec 0<"${PKGFILE}"
 
@@ -252,19 +303,62 @@ get_package_category()
 	return ${RES}
 };
 
-fetch_package()
+fetch_package_by_ftp()
 {
 	CATEGORY="${1}"
 	PACKAGE="${2}"
+	SAVEDIR="${3}"
 
-	get_ftp_mirror
-	FTP_SERVER="${VAL}"
+	get_value_from_cfg ftpHost
+	if [ -z "$VAL" ]
+	then
+		exit_err "ERROR: Install medium was set to ftp, but no ftpHost was provided!" 
+	fi
+	FTPHOST="${VAL}"
+
+	get_value_from_cfg ftpDir
+	if [ -z "$VAL" ]
+	then
+		exit_err "ERROR: Install medium was set to ftp, but no ftpDir was provided!" 
+	fi
+	FTPDIR="${VAL}"
 
 	PACKAGE="${PACKAGE}.tbz"
-	if [ ! -f "${PKGTMPDIR}/${PACKAGE}" ]
+	FTP_SERVER="ftp://${FTPHOST}${FTPDIR}"
+
+	if [ ! -f "${SAVEDIR}/${PACKAGE}" ]
 	then
 		PKGPATH="${CATEGORY}/${PACKAGE}"
-		FTP_PATH="ftp://${FTP_SERVER}/pub/FreeBSD/releases/${FBSD_ARCH}/${FBSD_BRANCH}/packages/${PKGPATH}"
-		fetch_file "${FTP_PATH}" "${PKGTMPDIR}/" "0"
+		FTP_PATH="${FTP_HOST}/packages/${PKGPATH}"
+		fetch_file "${FTP_PATH}" "${SAVEDIR}/" "0"
+	fi
+};
+
+fetch_package_by_fs()
+{
+	CATEGORY="${1}"
+	PACKAGE="${2}"
+	SAVEDIR="${3}"
+
+	PACKAGE="${PACKAGE}.tbz"
+	if [ ! -f "${SAVEDIR}/${PACKAGE}" ]
+	then
+		fetch_file "${CDMNT}/packages/${CATEGORY}/${PACKAGE}" "${SAVEDIR}/" "0"
 	fi
 };
+
+fetch_package()
+{
+	CATEGORY="${1}"
+	PACKAGE="${2}"
+	SAVEDIR="${3}"
+
+	case "${INSTALLMEDIUM}" in
+	usb|dvd)
+		fetch_package_by_fs "${CATEGORY}" "${PACKAGE}" "${SAVEDIR}"
+		;;
+	ftp)
+		fetch_package_by_ftp "${CATEGORY}" "${PACKAGE}" "${SAVEDIR}"
+		;;
+	esac
+};

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 06:02:32 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 15BCB106566B;
	Thu, 19 Aug 2010 06:02:32 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id EF8DF8FC15;
	Thu, 19 Aug 2010 06:02:31 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7J62Vkr091766;
	Thu, 19 Aug 2010 06:02:31 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7J62VN1091762;
	Thu, 19 Aug 2010 06:02:31 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <201008190602.o7J62VN1091762@svn.freebsd.org>
From: Warner Losh 
Date: Thu, 19 Aug 2010 06:02: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: r211487 - in head/usr.sbin/pc-sysinstall: backend
	pc-sysinstall
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 06:02:32 -0000

Author: imp
Date: Thu Aug 19 06:02:31 2010
New Revision: 211487
URL: http://svn.freebsd.org/changeset/base/211487

Log:
  Some cleanup, changed some echo's to echo_log, check for PROGDIR so
  that different PROGDIR's can be set.
  
  PR:		148806
  Submitted by:	John Hixson

Modified:
  head/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh
  head/usr.sbin/pc-sysinstall/backend/functions-packages.sh
  head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh

Modified: head/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh
==============================================================================
--- head/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh	Thu Aug 19 06:01:25 2010	(r211486)
+++ head/usr.sbin/pc-sysinstall/backend/functions-extractimage.sh	Thu Aug 19 06:02:31 2010	(r211487)
@@ -123,7 +123,7 @@ start_extract_split()
 	cd "${dir}"
 	if [ -f "install.sh" ]
 	then
-	  echo "Extracting" `basename ${dir}`
+	  echo_log "Extracting" `basename ${dir}`
       echo "y" | sh install.sh >/dev/null
       if [ "$?" != "0" ]
       then
@@ -139,7 +139,7 @@ start_extract_split()
   cd "${KERNELS}"
   if [ -f "install.sh" ]
   then
-	echo "Extracting" `basename ${KERNELS}`
+	echo_log "Extracting" `basename ${KERNELS}`
     echo "y" | sh install.sh generic >/dev/null
     if [ "$?" != "0" ]
     then
@@ -155,7 +155,7 @@ start_extract_split()
   cd "${SOURCE}"
   if [ -f "install.sh" ]
   then
-	echo "Extracting" `basename ${SOURCE}`
+	echo_log "Extracting" `basename ${SOURCE}`
     echo "y" | sh install.sh all >/dev/null
     if [ "$?" != "0" ]
     then
@@ -259,8 +259,8 @@ bye
 
 EOF
 
-   # Fetch the files via ftp
-   echo "$ INSTALL" | ftp -N "${NETRC}" "${FTPHOST}"
+  # Fetch the files via ftp
+  echo "$ INSTALL" | ftp -N "${NETRC}" "${FTPHOST}"
 
   # Done fetching, now reset the INSFILE to our downloaded archived
   INSFILE="${OUTFILE}" ; export INSFILE

Modified: head/usr.sbin/pc-sysinstall/backend/functions-packages.sh
==============================================================================
--- head/usr.sbin/pc-sysinstall/backend/functions-packages.sh	Thu Aug 19 06:01:25 2010	(r211486)
+++ head/usr.sbin/pc-sysinstall/backend/functions-packages.sh	Thu Aug 19 06:02:31 2010	(r211487)
@@ -63,6 +63,22 @@ get_package_index_by_fs()
 	fetch_file "${INDEX_FILE}" "${CONFDIR}/" "0"
 };
 
+get_package_index_size()
+{
+	if [ -f "${CONFDIR}/INDEX" ]
+	then
+		SIZE=`ls -l ${CONFDIR}/INDEX | awk '{ print $5 }'`
+	else
+		get_ftp_mirror
+		FTPHOST="${VAL}"
+
+		FTPDIR="/pub/FreeBSD/releases/${FBSD_ARCH}/${FBSD_BRANCH}"
+		FTPPATH="ftp://${FTPHOST}${FTPDIR}/packages"
+
+		fetch -s "${FTPPATH}/INDEX.bz2"
+	fi
+};
+
 get_package_index()
 {
 	RES=0

Modified: head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh
==============================================================================
--- head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh	Thu Aug 19 06:01:25 2010	(r211486)
+++ head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh	Thu Aug 19 06:02:31 2010	(r211487)
@@ -36,8 +36,11 @@
 # User-editable configuration variables
 
 # Set this to the program location
-PROGDIR="/usr/share/pc-sysinstall"
-export PROGDIR
+if [ -z "${PROGDIR}" ]
+then
+	PROGDIR="/usr/share/pc-sysinstall"
+	export PROGDIR
+fi
 
 # Set this to the components location
 COMPDIR="${PROGDIR}/components"

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 06:05:05 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A46F91065673;
	Thu, 19 Aug 2010 06:05:05 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 940AB8FC14;
	Thu, 19 Aug 2010 06:05:05 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7J655ES091852;
	Thu, 19 Aug 2010 06:05:05 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7J655PO091850;
	Thu, 19 Aug 2010 06:05:05 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <201008190605.o7J655PO091850@svn.freebsd.org>
From: Warner Losh 
Date: Thu, 19 Aug 2010 06:05: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: r211488 - head/usr.sbin/pc-sysinstall/backend
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 06:05:05 -0000

Author: imp
Date: Thu Aug 19 06:05:05 2010
New Revision: 211488
URL: http://svn.freebsd.org/changeset/base/211488

Log:
  Simple patch to add support zpool virtual devices that are not
  currently supported.
  
  PR:		149599
  Submitted by:	John Hixson

Modified:
  head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh

Modified: head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh
==============================================================================
--- head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh	Thu Aug 19 06:02:31 2010	(r211487)
+++ head/usr.sbin/pc-sysinstall/backend/functions-bsdlabel.sh	Thu Aug 19 06:05:05 2010	(r211488)
@@ -58,20 +58,13 @@ get_fs_line_xvars()
     echo $LINE | grep '^ZFS' >/dev/null 2>/dev/null
     if [ "$?" = "0" ] ; then
       ZTYPE="NONE"
-      ZFSVARS="`echo $LINE | cut -d '(' -f 2- | cut -d ')' -f 1`"
+      ZFSVARS="`echo $LINE | cut -d '(' -f 2- | cut -d ')' -f 1 | xargs`"
 
-      # Check if we are doing raidz setup
-      echo $ZFSVARS | grep "^raidz:" >/dev/null 2>/dev/null
-      if [ "$?" = "0" ] ; then
-       ZTYPE="raidz" 
-       ZFSVARS="`echo $ZFSVARS | sed 's|raidz: ||g' | sed 's|raidz:||g'`"
-      fi
-
-      echo $ZFSVARS | grep "^mirror:" >/dev/null 2>/dev/null
-      if [ "$?" = "0" ] ; then
-        ZTYPE="mirror" 
-        ZFSVARS="`echo $ZFSVARS | sed 's|mirror: ||g' | sed 's|mirror:||g'`"
-      fi
+      echo $ZFSVARS | grep -E "^(disk|file|mirror|raidz(1|2)?|spare|log|cache):" >/dev/null 2>/dev/null
+	  if [ "$?" = "0" ] ; then
+       ZTYPE=`echo $ZFSVARS | cut -f1 -d:`
+       ZFSVARS=`echo $ZFSVARS | sed "s|$ZTYPE: ||g" | sed "s|$ZTYPE:||g"`
+	  fi
 
       # Return the ZFS options
       if [ "${ZTYPE}" = "NONE" ] ; then

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 06:05:12 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7DF021065773;
	Thu, 19 Aug 2010 06:05:12 +0000 (UTC)
	(envelope-from joel@FreeBSD.org)
Received: from mail.vnode.se (mail.vnode.se [62.119.52.80])
	by mx1.freebsd.org (Postfix) with ESMTP id 2EC3A8FC0A;
	Thu, 19 Aug 2010 06:05:12 +0000 (UTC)
Received: from mail.vnode.se (localhost [127.0.0.1])
	by mail.vnode.se (Postfix) with ESMTP id ACE90E3F07A;
	Thu, 19 Aug 2010 08:05:10 +0200 (CEST)
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 94O0JZQDkgJQ; Thu, 19 Aug 2010 08:05:08 +0200 (CEST)
Received: from pluto.vnode.local (unknown [83.223.1.131])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.vnode.se (Postfix) with ESMTPSA id AEF50E3F079;
	Thu, 19 Aug 2010 08:05:07 +0200 (CEST)
Date: Thu, 19 Aug 2010 08:05:05 +0200
From: Joel Dahl 
To: Adrian Chadd 
Message-ID: <20100819060505.GA1244@pluto.vnode.local>
References: <201008190203.o7J23C51086339@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201008190203.o7J23C51086339@svn.freebsd.org>
User-Agent: Mutt/1.5.20 (2009-06-14)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r211476 - head/sys/mips/atheros
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 06:05:12 -0000

On 19-08-2010  2:03, Adrian Chadd wrote:
> Author: adrian
> Date: Thu Aug 19 02:03:12 2010
> New Revision: 211476
> URL: http://svn.freebsd.org/changeset/base/211476
> 
> Log:
>   Preparation work for supporting the AR91xx and AR724x.
>   
>   * Implement a SoC probe function, from Linux, which determines the
>     SoC family, type and revision. This only probes the AR71xx series
>     SoC and (currently) panics on others.
>   
>   * Migrate some of the AR71XX specific hardware init (USB device, determining
>     system frequencies) into using the cpuops introduced in an earlier commit.
>     Other SoC specific hardware stuff (per-device flush/WB, GPIO pin wiring,
>     Ethernet PLL setup, other things I've likely missed) will be introduced in
>     subsequent commits.
>   
>   Reviewed by:	imp@
>   Obtained from:	(partially) Linux
> 
> Added:
>   head/sys/mips/atheros/ar71xx_chip.c   (contents, props changed)

This file has no license information.

--
Joel

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 06:07:50 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F31DE106564A;
	Thu, 19 Aug 2010 06:07:49 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C801A8FC13;
	Thu, 19 Aug 2010 06:07:49 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7J67nZH091948;
	Thu, 19 Aug 2010 06:07:49 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7J67nWO091944;
	Thu, 19 Aug 2010 06:07:49 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <201008190607.o7J67nWO091944@svn.freebsd.org>
From: Warner Losh 
Date: Thu, 19 Aug 2010 06:07:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r211489 - in head/usr.sbin/pc-sysinstall: backend-query
	pc-sysinstall
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 06:07:50 -0000

Author: imp
Date: Thu Aug 19 06:07:49 2010
New Revision: 211489
URL: http://svn.freebsd.org/changeset/base/211489

Log:
  Added "-m" option to "disk-list" to list memory disks along with
  standard disks.
  
  PR:		149749
  Submitted by:	John Hixson

Modified:
  head/usr.sbin/pc-sysinstall/backend-query/disk-info.sh
  head/usr.sbin/pc-sysinstall/backend-query/disk-list.sh
  head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh

Modified: head/usr.sbin/pc-sysinstall/backend-query/disk-info.sh
==============================================================================
--- head/usr.sbin/pc-sysinstall/backend-query/disk-info.sh	Thu Aug 19 06:05:05 2010	(r211488)
+++ head/usr.sbin/pc-sysinstall/backend-query/disk-info.sh	Thu Aug 19 06:07:49 2010	(r211489)
@@ -54,15 +54,18 @@ HEADS="${VAL}"
 get_disk_sectors "${DISK}"
 SECS="${VAL}"
 
-echo "cylinders=${CYLS}"
-echo "heads=${HEADS}"
-echo "sectors=${SECS}"
 
 # Now get the disks size in MB
 KB="`diskinfo -v ${1} | grep 'bytes' | cut -d '#' -f 1 | tr -s '\t' ' ' | tr -d ' '`"
 MB=$(convert_byte_to_megabyte ${KB})
-echo "size=$MB"
 
 # Now get the Controller Type
 CTYPE="`dmesg | grep "^${1}:" | grep "B <" | cut -d '>' -f 2 | cut -d ' ' -f 3-10`"
+
+
+echo "cylinders=${CYLS}"
+echo "heads=${HEADS}"
+echo "sectors=${SECS}"
+echo "size=$MB"
 echo "type=$CTYPE"
+

Modified: head/usr.sbin/pc-sysinstall/backend-query/disk-list.sh
==============================================================================
--- head/usr.sbin/pc-sysinstall/backend-query/disk-list.sh	Thu Aug 19 06:05:05 2010	(r211488)
+++ head/usr.sbin/pc-sysinstall/backend-query/disk-list.sh	Thu Aug 19 06:07:49 2010	(r211489)
@@ -25,8 +25,18 @@
 #
 # $FreeBSD$
 
+ARGS=$1
+
 # Create our device listing
 SYSDISK=$(sysctl -n kern.disks)
+if [ "${ARGS}" = "-m" ]
+then
+	MDS=`mdconfig -l`
+	if [ -n "${MDS}" ]
+	then
+		SYSDISK="${SYSDISK} ${MDS}"
+	fi
+fi
 
 # Now loop through these devices, and list the disk drives
 for i in ${SYSDISK}
@@ -45,6 +55,10 @@ do
   if [ -z "$NEWLINE" ]; then
     NEWLINE=" "
   fi
+  if echo "${DEV}" | grep -E '^md[0-9]+' >/dev/null 2>/dev/null
+  then
+	NEWLINE=" "
+  fi
 
   # Save the disk list
   if [ ! -z "$DLIST" ]

Modified: head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh
==============================================================================
--- head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh	Thu Aug 19 06:05:05 2010	(r211488)
+++ head/usr.sbin/pc-sysinstall/pc-sysinstall/pc-sysinstall.sh	Thu Aug 19 06:07:49 2010	(r211489)
@@ -143,7 +143,7 @@ case $1 in
   ;;
 
   # The user is wanting to query which disks are available
-  disk-list) ${QUERYDIR}/disk-list.sh
+  disk-list) ${QUERYDIR}/disk-list.sh "${2}"
   ;;
   
   # The user is wanting to query a disk's partitions

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 06:11:07 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 330C510656A6;
	Thu, 19 Aug 2010 06:11:07 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 224098FC13;
	Thu, 19 Aug 2010 06:11:07 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7J6B7bL092067;
	Thu, 19 Aug 2010 06:11:07 GMT (envelope-from imp@svn.freebsd.org)
Received: (from imp@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7J6B7ed092064;
	Thu, 19 Aug 2010 06:11:07 GMT (envelope-from imp@svn.freebsd.org)
Message-Id: <201008190611.o7J6B7ed092064@svn.freebsd.org>
From: Warner Losh 
Date: Thu, 19 Aug 2010 06:11: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: r211490 - in head/usr.sbin/pc-sysinstall: backend
	examples
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 06:11:07 -0000

Author: imp
Date: Thu Aug 19 06:11:06 2010
New Revision: 211490
URL: http://svn.freebsd.org/changeset/base/211490

Log:
  This patch to pc-sysinstall allows the setting of a new config
  variable for installation, which lets the user/front-end select
  between MBR or GPT partitioning schemes when doing a dedicated disk
  installation.
  
  PR:		149772
  Submitted by:	Kris Moore

Modified:
  head/usr.sbin/pc-sysinstall/backend/functions-disk.sh
  head/usr.sbin/pc-sysinstall/examples/README

Modified: head/usr.sbin/pc-sysinstall/backend/functions-disk.sh
==============================================================================
--- head/usr.sbin/pc-sysinstall/backend/functions-disk.sh	Thu Aug 19 06:07:49 2010	(r211489)
+++ head/usr.sbin/pc-sysinstall/backend/functions-disk.sh	Thu Aug 19 06:11:06 2010	(r211490)
@@ -406,6 +406,18 @@ setup_disk_slice()
        fi
      fi
 
+     # Check if we have a partscheme specified
+     echo $line | grep "^partscheme=" >/dev/null 2>/dev/null
+     if [ "$?" = "0" ] ; then
+       # Found a partscheme= entry, lets read / set it 
+       get_value_from_string "${line}"
+       strip_white_space "$VAL"
+       PSCHEME="$VAL"
+       if [ "$PSCHEME" != "GPT" -a "$PSCHEME" != "MBR" ] ; then
+	 exit_err "Unknown partition scheme: $PSCHEME" 
+       fi
+     fi
+
      echo $line | grep "^bootManager=" >/dev/null 2>/dev/null
      if [ "$?" = "0" ]
      then
@@ -422,8 +434,13 @@ setup_disk_slice()
        if [ ! -z "${DISK}" -a ! -z "${PTYPE}" ]
        then
          case ${PTYPE} in
-                   all|ALL) tmpSLICE="${DISK}p1"  
-                        run_gpart_full "${DISK}" "${BMANAGER}" ;;
+               all|ALL) if [ "$PSCHEME" = "MBR" -o -z "$PSCHEME" ] ; then
+			  PSCHEME="MBR"
+			  tmpSLICE="${DISK}s1"  
+			else
+			  tmpSLICE="${DISK}p1"  
+			fi
+                        run_gpart_full "${DISK}" "${BMANAGER}" "${PSCHEME}" ;;
            s1|s2|s3|s4) tmpSLICE="${DISK}${PTYPE}" 
                         # Get the number of the slice we are working on
                         s="`echo ${PTYPE} | awk '{print substr($0,length,1)}'`" 
@@ -449,7 +466,7 @@ setup_disk_slice()
 
 
          # Increment our disk counter to look for next disk and unset
-         unset BMANAGER PTYPE DISK MIRRORDISK MIRRORBAL
+         unset BMANAGER PTYPE DISK MIRRORDISK MIRRORBAL PSCHEME
          disknum="`expr $disknum + 1`"
        else
          exit_err "ERROR: commitDiskPart was called without procceding disk= and partition= entries!!!" 
@@ -477,7 +494,7 @@ stop_gjournal() {
   fi
 } ;
 
-# Function which runs gpart and creates a single large slice
+# Function which runs gpart and creates a single large GPT partition scheme
 init_gpt_full_disk()
 {
   _intDISK=$1
@@ -506,14 +523,82 @@ init_gpt_full_disk()
 
 }
 
+# Function which runs gpart and creates a single large MBR partition scheme
+init_mbr_full_disk()
+{
+  _intDISK=$1
+  _intBOOT=$2
+ 
+  startblock="63"
+
+  # Set our sysctl so we can overwrite any geom using drives
+  sysctl kern.geom.debugflags=16 >>${LOGOUT} 2>>${LOGOUT}
+
+  # Stop any journaling
+  stop_gjournal "${_intDISK}"
+
+  # Remove any existing partitions
+  delete_all_gpart "${_intDISK}"
+
+  #Erase any existing bootloader
+  echo_log "Cleaning up ${_intDISK}"
+  rc_halt "dd if=/dev/zero of=/dev/${_intDISK} count=2048"
+
+  sleep 2
+
+  echo_log "Running gpart on ${_intDISK}"
+  rc_halt "gpart create -s mbr ${_intDISK}"
+
+  # Lets figure out disk size in blocks
+  # Get the cyl of this disk
+  get_disk_cyl "${_intDISK}"
+  cyl="${VAL}"
+
+  # Get the heads of this disk
+  get_disk_heads "${_intDISK}"
+  head="${VAL}"
+
+  # Get the tracks/sectors of this disk
+  get_disk_sectors "${_intDISK}"
+  sec="${VAL}"
+
+  # Multiply them all together to get our total blocks
+  totalblocks="`expr ${cyl} \* ${head}`"
+  totalblocks="`expr ${totalblocks} \* ${sec}`"
+
+
+  # Now set the ending block to the total disk block size
+  sizeblock="`expr ${totalblocks} - ${startblock}`"
+
+  # Install new partition setup
+  echo_log "Running gpart add on ${_intDISK}"
+  rc_halt "gpart add -b ${startblock} -s ${sizeblock} -t freebsd -i 1 ${_intDISK}"
+  sleep 2
+  
+  echo_log "Cleaning up ${_intDISK}s1"
+  rc_halt "dd if=/dev/zero of=/dev/${_intDISK}s1 count=1024"
+  
+  if [ "$_intBOOT" = "bsd" ] ; then
+    echo_log "Stamping boot sector on ${_intDISK}"
+    rc_halt "gpart bootcode -b /boot/boot0 ${_intDISK}"
+  fi
+
+}
+
 # Function which runs gpart and creates a single large slice
 run_gpart_full()
 {
   DISK=$1
+  BOOT=$2
+  SCHEME=$3
 
-  init_gpt_full_disk "$DISK"
-
-  slice="${DISK}-1-gpt"
+  if [ "$SCHEME" = "MBR" ] ; then
+    init_mbr_full_disk "$DISK" "$BOOT"
+    slice="${DISK}-1-mbr"
+  else
+    init_gpt_full_disk "$DISK"
+    slice="${DISK}-1-gpt"
+  fi
 
   # Lets save our slice, so we know what to look for in the config file later on
   if [ -z "$WORKINGSLICES" ]

Modified: head/usr.sbin/pc-sysinstall/examples/README
==============================================================================
--- head/usr.sbin/pc-sysinstall/examples/README	Thu Aug 19 06:07:49 2010	(r211489)
+++ head/usr.sbin/pc-sysinstall/examples/README	Thu Aug 19 06:11:06 2010	(r211490)
@@ -128,6 +128,11 @@ Setting this to "s1, s2, s3 or s4" will 
 
 (This tag is unused for upgrades)
 
+# partscheme=(MBR/GPT)
+
+When performing a "full" disk (partition=all), the partscheme= variable is used
+to determine the partition scheme type gpart will be using on the disk. Valid
+choices are MBR or GPT. 
 
 # mirror=(disk device such as ad1)
 

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 07:54:15 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BCBD110656A5;
	Thu, 19 Aug 2010 07:54:15 +0000 (UTC)
	(envelope-from gavin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 911698FC1E;
	Thu, 19 Aug 2010 07:54:15 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7J7sFP8094421;
	Thu, 19 Aug 2010 07:54:15 GMT (envelope-from gavin@svn.freebsd.org)
Received: (from gavin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7J7sFWb094418;
	Thu, 19 Aug 2010 07:54:15 GMT (envelope-from gavin@svn.freebsd.org)
Message-Id: <201008190754.o7J7sFWb094418@svn.freebsd.org>
From: Gavin Atkinson 
Date: Thu, 19 Aug 2010 07:54:15 +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: r211491 - stable/7/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: Thu, 19 Aug 2010 07:54:15 -0000

Author: gavin
Date: Thu Aug 19 07:54:15 2010
New Revision: 211491
URL: http://svn.freebsd.org/changeset/base/211491

Log:
  Merge r208016 from head:
    Add new FTDI USB device ID for the Gamma-Scout radioactivity meter. [1]
  
  Merge r210556 from head:
    Support the Pyramid KBS USB LCD under uftdi(4) [2]
  
  PR:		kern/146483 [1] usb/129758 [2]
  Submitted by:	Andre Albsmeier [1]
  Submitted by:	joao lima  [2]

Modified:
  stable/7/sys/dev/usb/uftdi.c
  stable/7/sys/dev/usb/usbdevs
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/usb/uftdi.c
==============================================================================
--- stable/7/sys/dev/usb/uftdi.c	Thu Aug 19 06:11:06 2010	(r211490)
+++ stable/7/sys/dev/usb/uftdi.c	Thu Aug 19 07:54:15 2010	(r211491)
@@ -165,6 +165,8 @@ uftdi_match(device_t self)
 	     uaa->product == USB_PRODUCT_FTDI_TACTRIX_OPENPORT_13M ||
 	     uaa->product == USB_PRODUCT_FTDI_TACTRIX_OPENPORT_13S ||
 	     uaa->product == USB_PRODUCT_FTDI_TACTRIX_OPENPORT_13U ||
+	     uaa->product == USB_PRODUCT_FTDI_GAMMASCOUT ||
+	     uaa->product == USB_PRODUCT_FTDI_KBS ||
 	     uaa->product == USB_PRODUCT_FTDI_EISCOU ||
 	     uaa->product == USB_PRODUCT_FTDI_UOPTBR ||
 	     uaa->product == USB_PRODUCT_FTDI_EMCU2D ||

Modified: stable/7/sys/dev/usb/usbdevs
==============================================================================
--- stable/7/sys/dev/usb/usbdevs	Thu Aug 19 06:11:06 2010	(r211490)
+++ stable/7/sys/dev/usb/usbdevs	Thu Aug 19 07:54:15 2010	(r211491)
@@ -1303,6 +1303,8 @@ product FTDI SERIAL_2232C	0x6010	FT2232C
 product FTDI TACTRIX_OPENPORT_13M 0xcc48 OpenPort 1.3 Mitsubishi
 product FTDI TACTRIX_OPENPORT_13S 0xcc49 OpenPort 1.3 Subaru
 product FTDI TACTRIX_OPENPORT_13U 0xcc4a OpenPort 1.3 Universal
+product FTDI GAMMASCOUT		0xd678	Gamma-Scout
+product FTDI KBS		0xe6c8	Pyramid KBS USB LCD
 product FTDI EISCOU		0xe888	Expert ISDN Control USB
 product FTDI UOPTBR		0xe889	USB-RS232 OptoBridge
 product FTDI EMCU2D		0xe88a	Expert mouseCLOCK USB II

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 08:03:36 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6D4271065693;
	Thu, 19 Aug 2010 08:03:36 +0000 (UTC)
	(envelope-from gavin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 413648FC1C;
	Thu, 19 Aug 2010 08:03:36 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7J83aNF094716;
	Thu, 19 Aug 2010 08:03:36 GMT (envelope-from gavin@svn.freebsd.org)
Received: (from gavin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7J83aYN094715;
	Thu, 19 Aug 2010 08:03:36 GMT (envelope-from gavin@svn.freebsd.org)
Message-Id: <201008190803.o7J83aYN094715@svn.freebsd.org>
From: Gavin Atkinson 
Date: Thu, 19 Aug 2010 08:03: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: r211492 - in stable/7/sys: . cddl/contrib/opensolaris
	contrib/dev/acpica contrib/pf
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 08:03:36 -0000

Author: gavin
Date: Thu Aug 19 08:03:35 2010
New Revision: 211492
URL: http://svn.freebsd.org/changeset/base/211492

Log:
  Mark r210571 as merged, missed in r211473.

Modified:
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)

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 08:11:07 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5912E1065673;
	Thu, 19 Aug 2010 08:11:07 +0000 (UTC)
	(envelope-from gavin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 47E0F8FC14;
	Thu, 19 Aug 2010 08:11:07 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7J8B7ue094939;
	Thu, 19 Aug 2010 08:11:07 GMT (envelope-from gavin@svn.freebsd.org)
Received: (from gavin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7J8B7KY094937;
	Thu, 19 Aug 2010 08:11:07 GMT (envelope-from gavin@svn.freebsd.org)
Message-Id: <201008190811.o7J8B7KY094937@svn.freebsd.org>
From: Gavin Atkinson 
Date: Thu, 19 Aug 2010 08:11:07 +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: r211493 - stable/7/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: Thu, 19 Aug 2010 08:11:07 -0000

Author: gavin
Date: Thu Aug 19 08:11:07 2010
New Revision: 211493
URL: http://svn.freebsd.org/changeset/base/211493

Log:
  Merge r186427 from head (original commit by remko):
    Add support for the MaxSream USB test carrier.
  
  PR:		usb/117546
  Submitted by:	Daniel J. O'Connor 

Modified:
  stable/7/sys/dev/usb/uftdi.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/usb/uftdi.c
==============================================================================
--- stable/7/sys/dev/usb/uftdi.c	Thu Aug 19 08:03:35 2010	(r211492)
+++ stable/7/sys/dev/usb/uftdi.c	Thu Aug 19 08:11:07 2010	(r211493)
@@ -171,7 +171,8 @@ uftdi_match(device_t self)
 	     uaa->product == USB_PRODUCT_FTDI_UOPTBR ||
 	     uaa->product == USB_PRODUCT_FTDI_EMCU2D ||
 	     uaa->product == USB_PRODUCT_FTDI_PCMSFU ||
-	     uaa->product == USB_PRODUCT_FTDI_EMCU2H ))
+	     uaa->product == USB_PRODUCT_FTDI_EMCU2H ||
+	     uaa->product == USB_PRODUCT_FTDI_MAXSTREAM ))
 		return (UMATCH_VENDOR_PRODUCT);
 	if (uaa->vendor == USB_VENDOR_SIIG2 &&
 	    (uaa->product == USB_PRODUCT_SIIG2_US2308))

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 08:50:11 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D46441065693;
	Thu, 19 Aug 2010 08:50:11 +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 C22E98FC29;
	Thu, 19 Aug 2010 08:50:11 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7J8oBXX095926;
	Thu, 19 Aug 2010 08:50:11 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7J8oBtR095924;
	Thu, 19 Aug 2010 08:50:11 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201008190850.o7J8oBtR095924@svn.freebsd.org>
From: Konstantin Belousov 
Date: Thu, 19 Aug 2010 08:50:11 +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: r211494 - stable/8/sys/opencrypto
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 08:50:12 -0000

Author: kib
Date: Thu Aug 19 08:50:11 2010
New Revision: 211494
URL: http://svn.freebsd.org/changeset/base/211494

Log:
  MFC r210631:
  Add compat32 shims for opencrypto(4).

Modified:
  stable/8/sys/opencrypto/cryptodev.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cam/   (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/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/opencrypto/cryptodev.c
==============================================================================
--- stable/8/sys/opencrypto/cryptodev.c	Thu Aug 19 08:11:07 2010	(r211493)
+++ stable/8/sys/opencrypto/cryptodev.c	Thu Aug 19 08:50:11 2010	(r211494)
@@ -35,6 +35,8 @@
 #include 
 __FBSDID("$FreeBSD$");
 
+#include "opt_compat.h"
+
 #include 
 #include 
 #include 
@@ -56,6 +58,201 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#ifdef COMPAT_FREEBSD32
+#include 
+#include 
+
+struct session_op32 {
+	u_int32_t	cipher;
+	u_int32_t	mac;
+	u_int32_t	keylen;
+	u_int32_t	key;
+	int		mackeylen;
+	u_int32_t	mackey;
+	u_int32_t	ses;
+};
+
+struct session2_op32 {
+	u_int32_t	cipher;
+	u_int32_t	mac;
+	u_int32_t	keylen;
+	u_int32_t	key;
+	int		mackeylen;
+	u_int32_t	mackey;
+	u_int32_t	ses;
+	int		crid;
+	int		pad[4];
+};
+
+struct crypt_op32 {
+	u_int32_t	ses;
+	u_int16_t	op;
+	u_int16_t	flags;
+	u_int		len;
+	u_int32_t	src, dst;
+	u_int32_t	mac;
+	u_int32_t	iv;
+};
+
+struct crparam32 {
+	u_int32_t	crp_p;
+	u_int		crp_nbits;
+};
+
+struct crypt_kop32 {
+	u_int		crk_op;
+	u_int		crk_status;
+	u_short		crk_iparams;
+	u_short		crk_oparams;
+	u_int		crk_crid;
+	struct crparam32	crk_param[CRK_MAXPARAM];
+};
+
+struct cryptotstat32 {
+	struct timespec32	acc;
+	struct timespec32	min;
+	struct timespec32	max;
+	u_int32_t	count;
+};
+
+struct cryptostats32 {
+	u_int32_t	cs_ops;
+	u_int32_t	cs_errs;
+	u_int32_t	cs_kops;
+	u_int32_t	cs_kerrs;
+	u_int32_t	cs_intrs;
+	u_int32_t	cs_rets;
+	u_int32_t	cs_blocks;
+	u_int32_t	cs_kblocks;
+	struct cryptotstat32 cs_invoke;
+	struct cryptotstat32 cs_done;
+	struct cryptotstat32 cs_cb;
+	struct cryptotstat32 cs_finis;
+};
+
+#define	CIOCGSESSION32	_IOWR('c', 101, struct session_op32)
+#define	CIOCCRYPT32	_IOWR('c', 103, struct crypt_op32)
+#define	CIOCKEY32	_IOWR('c', 104, struct crypt_kop32)
+#define	CIOCGSESSION232	_IOWR('c', 106, struct session2_op32)
+#define	CIOCKEY232	_IOWR('c', 107, struct crypt_kop32)
+
+static void
+session_op_from_32(const struct session_op32 *from, struct session_op *to)
+{
+
+	CP(*from, *to, cipher);
+	CP(*from, *to, mac);
+	CP(*from, *to, keylen);
+	PTRIN_CP(*from, *to, key);
+	CP(*from, *to, mackeylen);
+	PTRIN_CP(*from, *to, mackey);
+	CP(*from, *to, ses);
+}
+
+static void
+session2_op_from_32(const struct session2_op32 *from, struct session2_op *to)
+{
+
+	session_op_from_32((const struct session_op32 *)from,
+	    (struct session_op *)to);
+	CP(*from, *to, crid);
+}
+
+static void
+session_op_to_32(const struct session_op *from, struct session_op32 *to)
+{
+
+	CP(*from, *to, cipher);
+	CP(*from, *to, mac);
+	CP(*from, *to, keylen);
+	PTROUT_CP(*from, *to, key);
+	CP(*from, *to, mackeylen);
+	PTROUT_CP(*from, *to, mackey);
+	CP(*from, *to, ses);
+}
+
+static void
+session2_op_to_32(const struct session2_op *from, struct session2_op32 *to)
+{
+
+	session_op_to_32((const struct session_op *)from,
+	    (struct session_op32 *)to);
+	CP(*from, *to, crid);
+}
+
+static void
+crypt_op_from_32(const struct crypt_op32 *from, struct crypt_op *to)
+{
+
+	CP(*from, *to, ses);
+	CP(*from, *to, op);
+	CP(*from, *to, flags);
+	CP(*from, *to, len);
+	PTRIN_CP(*from, *to, src);
+	PTRIN_CP(*from, *to, dst);
+	PTRIN_CP(*from, *to, mac);
+	PTRIN_CP(*from, *to, iv);
+}
+
+static void
+crypt_op_to_32(const struct crypt_op *from, struct crypt_op32 *to)
+{
+
+	CP(*from, *to, ses);
+	CP(*from, *to, op);
+	CP(*from, *to, flags);
+	CP(*from, *to, len);
+	PTROUT_CP(*from, *to, src);
+	PTROUT_CP(*from, *to, dst);
+	PTROUT_CP(*from, *to, mac);
+	PTROUT_CP(*from, *to, iv);
+}
+
+static void
+crparam_from_32(const struct crparam32 *from, struct crparam *to)
+{
+
+	PTRIN_CP(*from, *to, crp_p);
+	CP(*from, *to, crp_nbits);
+}
+
+static void
+crparam_to_32(const struct crparam *from, struct crparam32 *to)
+{
+
+	PTROUT_CP(*from, *to, crp_p);
+	CP(*from, *to, crp_nbits);
+}
+
+static void
+crypt_kop_from_32(const struct crypt_kop32 *from, struct crypt_kop *to)
+{
+	int i;
+
+	CP(*from, *to, crk_op);
+	CP(*from, *to, crk_status);
+	CP(*from, *to, crk_iparams);
+	CP(*from, *to, crk_oparams);
+	CP(*from, *to, crk_crid);
+	for (i = 0; i < CRK_MAXPARAM; i++)
+		crparam_from_32(&from->crk_param[i], &to->crk_param[i]);
+}
+
+static void
+crypt_kop_to_32(const struct crypt_kop *from, struct crypt_kop32 *to)
+{
+	int i;
+
+	CP(*from, *to, crk_op);
+	CP(*from, *to, crk_status);
+	CP(*from, *to, crk_iparams);
+	CP(*from, *to, crk_oparams);
+	CP(*from, *to, crk_crid);
+	for (i = 0; i < CRK_MAXPARAM; i++)
+		crparam_to_32(&from->crk_param[i], &to->crk_param[i]);
+}
+#endif
+
 struct csession {
 	TAILQ_ENTRY(csession) next;
 	u_int64_t	sid;
@@ -180,11 +377,27 @@ cryptof_ioctl(
 	u_int64_t sid;
 	u_int32_t ses;
 	int error = 0, crid;
+#ifdef COMPAT_FREEBSD32
+	struct session2_op sopc;
+	struct crypt_op copc;
+	struct crypt_kop kopc;
+#endif
 
 	switch (cmd) {
 	case CIOCGSESSION:
 	case CIOCGSESSION2:
-		sop = (struct session_op *)data;
+#ifdef COMPAT_FREEBSD32
+	case CIOCGSESSION32:
+	case CIOCGSESSION232:
+		if (cmd == CIOCGSESSION32) {
+			session_op_from_32(data, (struct session_op *)&sopc);
+			sop = (struct session_op *)&sopc;
+		} else if (cmd == CIOCGSESSION232) {
+			session2_op_from_32(data, &sopc);
+			sop = (struct session_op *)&sopc;
+		} else
+#endif
+			sop = (struct session_op *)data;
 		switch (sop->cipher) {
 		case 0:
 			break;
@@ -294,7 +507,11 @@ cryptof_ioctl(
 		}
 
 		/* NB: CIOGSESSION2 has the crid */
-		if (cmd == CIOCGSESSION2) {
+		if (cmd == CIOCGSESSION2
+#ifdef COMPAT_FREEBSD32
+		    || cmd == CIOCGSESSION232
+#endif
+			) {
 			crid = SES2(sop)->crid;
 			error = checkforsoftware(crid);
 			if (error)
@@ -315,7 +532,11 @@ cryptof_ioctl(
 			goto bail;
 		}
 		sop->ses = cse->ses;
-		if (cmd == CIOCGSESSION2) {
+		if (cmd == CIOCGSESSION2
+#ifdef COMPAT_FREEBSD32
+		    || cmd == CIOCGSESSION232
+#endif
+		    ) {
 			/* return hardware/driver id */
 			SES2(sop)->crid = CRYPTO_SESID2HID(cse->sid);
 		}
@@ -326,6 +547,15 @@ bail:
 			if (cria.cri_key)
 				free(cria.cri_key, M_XDATA);
 		}
+#ifdef COMPAT_FREEBSD32
+		else {
+			if (cmd == CIOCGSESSION32)
+				session_op_to_32(sop, data);
+			else if (cmd == CIOCGSESSION232)
+				session2_op_to_32((struct session2_op *)sop,
+				    data);
+		}
+#endif
 		break;
 	case CIOCFSESSION:
 		ses = *(u_int32_t *)data;
@@ -336,25 +566,54 @@ bail:
 		error = csefree(cse);
 		break;
 	case CIOCCRYPT:
-		cop = (struct crypt_op *)data;
+#ifdef COMPAT_FREEBSD32
+	case CIOCCRYPT32:
+		if (cmd == CIOCCRYPT32) {
+			cop = &copc;
+			crypt_op_from_32(data, cop);
+		} else
+#endif
+			cop = (struct crypt_op *)data;
 		cse = csefind(fcr, cop->ses);
 		if (cse == NULL)
 			return (EINVAL);
 		error = cryptodev_op(cse, cop, active_cred, td);
+#ifdef COMPAT_FREEBSD32
+		if (error == 0 && cmd == CIOCCRYPT32)
+			crypt_op_to_32(cop, data);
+#endif
 		break;
 	case CIOCKEY:
 	case CIOCKEY2:
+#ifdef COMPAT_FREEBSD32
+	case CIOCKEY32:
+	case CIOCKEY232:
+#endif
 		if (!crypto_userasymcrypto)
 			return (EPERM);		/* XXX compat? */
-		mtx_lock(&Giant);
-		kop = (struct crypt_kop *)data;
-		if (cmd == CIOCKEY) {
+#ifdef COMPAT_FREEBSD32
+		if (cmd == CIOCKEY32 || cmd == CIOCKEY232) {
+			kop = &kopc;
+			crypt_kop_from_32(data, kop);
+		} else
+#endif
+			kop = (struct crypt_kop *)data;
+		if (cmd == CIOCKEY
+#ifdef COMPAT_FREEBSD32
+		    || cmd == CIOCKEY32
+#endif
+		    ) {
 			/* NB: crypto core enforces s/w driver use */
 			kop->crk_crid =
 			    CRYPTOCAP_F_HARDWARE | CRYPTOCAP_F_SOFTWARE;
 		}
+		mtx_lock(&Giant);
 		error = cryptodev_key(kop);
 		mtx_unlock(&Giant);
+#ifdef COMPAT_FREEBSD32
+		if (cmd == CIOCKEY32 || cmd == CIOCKEY232)
+			crypt_kop_to_32(kop, data);
+#endif
 		break;
 	case CIOCASYMFEAT:
 		if (!crypto_userasymcrypto) {

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 09:00:18 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5C82C1065670;
	Thu, 19 Aug 2010 09:00:18 +0000 (UTC)
	(envelope-from netchild@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4A18B8FC28;
	Thu, 19 Aug 2010 09:00:18 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7J90IY9096263;
	Thu, 19 Aug 2010 09:00:18 GMT
	(envelope-from netchild@svn.freebsd.org)
Received: (from netchild@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7J90IKu096259;
	Thu, 19 Aug 2010 09:00:18 GMT
	(envelope-from netchild@svn.freebsd.org)
Message-Id: <201008190900.o7J90IKu096259@svn.freebsd.org>
From: Alexander Leidinger 
Date: Thu, 19 Aug 2010 09:00: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: r211495 - in stable/8: etc/periodic/daily
	share/man/man5 tools/build/mk
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 09:00:18 -0000

Author: netchild
Date: Thu Aug 19 09:00:17 2010
New Revision: 211495
URL: http://svn.freebsd.org/changeset/base/211495

Log:
  MFC
  
  r209195:
    Add a periodic zfs scrub script.
  
    Features:
     - configurable amount of days between scrubs (default value or per pool)
     - do not scrub directly after pool creation (respects the configured
       number of days between scrubs)
     - do not scrub if a scrub is in progress
     - tells how to see the status of the scrub
     - tells how many days since the last scrub if it skips the scrubbing
     - warns if a non-existent pool is specified explicitely
       (default: no pools specified -> all currently imported pools are
       handled)
     - runs late in the periodic run to not slow down the other periodic daily
       scripts
  
  r209250:
    - connect the zfs scrub script
    - move the zfs status script into the MK_ZFS conditional to respect
      WITHOUT_ZFS
  
  r209253:
    Add the ZFS periodic daily scripts to the ZFS part. (make delete-old)
  
  Requested by:	"J. Hellenthal" 
  PR:		149271

Modified:
  stable/8/etc/periodic/daily/Makefile
  stable/8/share/man/man5/periodic.conf.5
  stable/8/tools/build/mk/OptionalObsoleteFiles.inc
Directory Properties:
  stable/8/etc/periodic/daily/   (props changed)
  stable/8/share/man/man5/   (props changed)
  stable/8/tools/build/mk/   (props changed)

Modified: stable/8/etc/periodic/daily/Makefile
==============================================================================
--- stable/8/etc/periodic/daily/Makefile	Thu Aug 19 08:50:11 2010	(r211494)
+++ stable/8/etc/periodic/daily/Makefile	Thu Aug 19 09:00:17 2010	(r211495)
@@ -8,7 +8,6 @@ FILES=	100.clean-disks \
 	200.backup-passwd \
 	330.news \
 	400.status-disks \
-	404.status-zfs \
 	405.status-ata-raid \
 	406.status-gmirror \
 	407.status-graid3 \
@@ -53,4 +52,9 @@ FILES+=	150.clean-hoststat \
 	500.queuerun
 .endif
 
+.if ${MK_ZFS} != "no"
+FILES+=	404.status-zfs \
+	800.scrub-zfs
+.endif
+
 .include 

Modified: stable/8/share/man/man5/periodic.conf.5
==============================================================================
--- stable/8/share/man/man5/periodic.conf.5	Thu Aug 19 08:50:11 2010	(r211494)
+++ stable/8/share/man/man5/periodic.conf.5	Thu Aug 19 09:00:17 2010	(r211495)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 12, 2007
+.Dd June 15, 2010
 .Dt PERIODIC.CONF 5
 .Os
 .Sh NAME
@@ -611,6 +611,25 @@ when
 .Va daily_queuerun_enable
 is set to
 .Dq Li YES .
+.It Va daily_scrub_zfs_enable
+.Pq Vt bool
+Set to
+.Dq Li YES
+if you want to run a zfs scrub periodically.
+.It Va daily_scrub_zfs_pools
+.Pq Vt str
+A space separated list of names of zfs pools to scrub.
+If the list is empty or not set, all zfs pools are scrubbed.
+.It Va daily_scrub_zfs_default_threshold
+.Pq Vt int
+Number of days between a scrub if no pool-specific threshold is set.
+The default value if no value is set is 30.
+.It Va daily_scrub_zfs_ Ns Ao Ar poolname Ac Ns Va _threshold
+.Pq Vt int
+The same as
+.Va daily_scrub_zfs_default_threshold
+but specific to the pool
+.Va Ns Ao Ar poolname Ac Ns .
 .It Va daily_local
 .Pq Vt str
 Set to a list of extra scripts that should be run after all other

Modified: stable/8/tools/build/mk/OptionalObsoleteFiles.inc
==============================================================================
--- stable/8/tools/build/mk/OptionalObsoleteFiles.inc	Thu Aug 19 08:50:11 2010	(r211494)
+++ stable/8/tools/build/mk/OptionalObsoleteFiles.inc	Thu Aug 19 09:00:17 2010	(r211495)
@@ -344,6 +344,8 @@ OLD_FILES+=usr/lib/libuutil.so
 .if ${MK_ZFS} == no
 OLD_LIBS+=lib/libzfs.so.1
 OLD_LIBS+=lib/libzpool.so.1
+OLD_FILES+=etc/periodic/daily/404.status-zfs
+OLD_FILES+=etc/periodic/daily/800.scrub-zfs
 OLD_FILES+=sbin/zfs
 OLD_FILES+=sbin/zpool
 OLD_FILES+=usr/lib/libzfs.a

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 09:29:00 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 36E7310656AA;
	Thu, 19 Aug 2010 09:29:00 +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 2617C8FC18;
	Thu, 19 Aug 2010 09:29:00 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7J9T0MZ096910;
	Thu, 19 Aug 2010 09:29:00 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7J9SxSJ096903;
	Thu, 19 Aug 2010 09:28:59 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201008190928.o7J9SxSJ096903@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Thu, 19 Aug 2010 09:28: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: r211496 - head/usr.bin/grep
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 09:29:00 -0000

Author: des
Date: Thu Aug 19 09:28:59 2010
New Revision: 211496
URL: http://svn.freebsd.org/changeset/base/211496

Log:
  UTFize my name.

Modified:
  head/usr.bin/grep/fastgrep.c
  head/usr.bin/grep/file.c
  head/usr.bin/grep/grep.c
  head/usr.bin/grep/grep.h
  head/usr.bin/grep/queue.c
  head/usr.bin/grep/util.c

Modified: head/usr.bin/grep/fastgrep.c
==============================================================================
--- head/usr.bin/grep/fastgrep.c	Thu Aug 19 09:00:17 2010	(r211495)
+++ head/usr.bin/grep/fastgrep.c	Thu Aug 19 09:28:59 2010	(r211496)
@@ -1,7 +1,7 @@
 /*	$OpenBSD: util.c,v 1.36 2007/10/02 17:59:18 otto Exp $	*/
 
 /*-
- * Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav
+ * Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav
  * Copyright (C) 2008 Gabor Kovesdan 
  * All rights reserved.
  *

Modified: head/usr.bin/grep/file.c
==============================================================================
--- head/usr.bin/grep/file.c	Thu Aug 19 09:00:17 2010	(r211495)
+++ head/usr.bin/grep/file.c	Thu Aug 19 09:28:59 2010	(r211496)
@@ -1,7 +1,7 @@
 /*	$OpenBSD: file.c,v 1.11 2010/07/02 20:48:48 nicm Exp $	*/
 
 /*-
- * Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav
+ * Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav
  * Copyright (C) 2008-2010 Gabor Kovesdan 
  * Copyright (C) 2010 Dimitry Andric 
  * All rights reserved.

Modified: head/usr.bin/grep/grep.c
==============================================================================
--- head/usr.bin/grep/grep.c	Thu Aug 19 09:00:17 2010	(r211495)
+++ head/usr.bin/grep/grep.c	Thu Aug 19 09:28:59 2010	(r211496)
@@ -1,7 +1,7 @@
 /*	$OpenBSD: grep.c,v 1.42 2010/07/02 22:18:03 tedu Exp $	*/
 
 /*-
- * Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav
+ * Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav
  * Copyright (C) 2008-2009 Gabor Kovesdan 
  * All rights reserved.
  *

Modified: head/usr.bin/grep/grep.h
==============================================================================
--- head/usr.bin/grep/grep.h	Thu Aug 19 09:00:17 2010	(r211495)
+++ head/usr.bin/grep/grep.h	Thu Aug 19 09:28:59 2010	(r211496)
@@ -2,7 +2,7 @@
 /*	$FreeBSD$	*/
 
 /*-
- * Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav
+ * Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav
  * Copyright (c) 2008-2009 Gabor Kovesdan 
  * All rights reserved.
  *

Modified: head/usr.bin/grep/queue.c
==============================================================================
--- head/usr.bin/grep/queue.c	Thu Aug 19 09:00:17 2010	(r211495)
+++ head/usr.bin/grep/queue.c	Thu Aug 19 09:28:59 2010	(r211496)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav
+ * Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without

Modified: head/usr.bin/grep/util.c
==============================================================================
--- head/usr.bin/grep/util.c	Thu Aug 19 09:00:17 2010	(r211495)
+++ head/usr.bin/grep/util.c	Thu Aug 19 09:28:59 2010	(r211496)
@@ -1,7 +1,7 @@
 /*	$OpenBSD: util.c,v 1.39 2010/07/02 22:18:03 tedu Exp $	*/
 
 /*-
- * Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav
+ * Copyright (c) 1999 James Howard and Dag-Erling Coïdan Smørgrav
  * Copyright (C) 2008-2010 Gabor Kovesdan 
  * All rights reserved.
  *

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 09:33:32 2010
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AAEE5106564A;
	Thu, 19 Aug 2010 09:33:32 +0000 (UTC) (envelope-from des@des.no)
Received: from smtp.des.no (smtp.des.no [194.63.250.102])
	by mx1.freebsd.org (Postfix) with ESMTP id 66B378FC18;
	Thu, 19 Aug 2010 09:33:32 +0000 (UTC)
Received: from ds4.des.no (des.no [84.49.246.2])
	by smtp.des.no (Postfix) with ESMTP id A59121FFC34;
	Thu, 19 Aug 2010 09:33:31 +0000 (UTC)
Received: by ds4.des.no (Postfix, from userid 1001)
	id 7EB3A84559; Thu, 19 Aug 2010 11:33:31 +0200 (CEST)
From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= 
To: Peter Jeremy 
References: <201008142148.o7ELmMTO039767@svn.freebsd.org>
	<20100817193757.GA92936@FreeBSD.org> <86hbisb8g2.fsf@ds4.des.no>
	<20100818193013.GA61328@FreeBSD.org>
	<20100818203730.GA55464@server.vk2pj.dyndns.org>
Date: Thu, 19 Aug 2010 11:33:31 +0200
In-Reply-To: <20100818203730.GA55464@server.vk2pj.dyndns.org> (Peter Jeremy's
	message of "Thu, 19 Aug 2010 06:37:30 +1000")
Message-ID: <86r5hvc5g4.fsf@ds4.des.no>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@FreeBSD.org, Alexey Dokuchaev ,
	src-committers@FreeBSD.org, svn-src-all@FreeBSD.org,
	Jens Schweikhardt 
Subject: Re: svn commit: r211318 - head/usr.sbin/sysinstall
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 09:33:32 -0000

Peter Jeremy  writes:
> Probably a good example of why the Project's guidelines require the
> separation of whitespace and functional changes.

Well, the second-to-last hunk is not really a functional change either.

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 10:30:01 2010
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: by hub.freebsd.org (Postfix, from userid 1033)
	id 8FB3610656A3; Thu, 19 Aug 2010 10:30:01 +0000 (UTC)
Date: Thu, 19 Aug 2010 10:30:01 +0000
From: Alexey Dokuchaev 
To: Dag-Erling Sm??rgrav 
Message-ID: <20100819103001.GA28487@FreeBSD.org>
References: <201008142148.o7ELmMTO039767@svn.freebsd.org>
	<20100817193757.GA92936@FreeBSD.org> <86hbisb8g2.fsf@ds4.des.no>
	<20100818193013.GA61328@FreeBSD.org>
	<20100818203730.GA55464@server.vk2pj.dyndns.org>
	<86r5hvc5g4.fsf@ds4.des.no>
Mime-Version: 1.0
Content-Type: text/plain; charset=koi8-r
Content-Disposition: inline
In-Reply-To: <86r5hvc5g4.fsf@ds4.des.no>
User-Agent: Mutt/1.4.2.1i
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org, Peter Jeremy ,
	Jens Schweikhardt 
Subject: Re: svn commit: r211318 - head/usr.sbin/sysinstall
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 10:30:01 -0000

On Thu, Aug 19, 2010 at 11:33:31AM +0200, Dag-Erling Sm??rgrav wrote:
> Peter Jeremy  writes:
> > Probably a good example of why the Project's guidelines require the
> > separation of whitespace and functional changes.
> 
> Well, the second-to-last hunk is not really a functional change either.

Right, but the commit message could and should be better.  Anyway, it's
probably getting beyond being useful talk, so I'll go back to hacking.

./danfe

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 11:16:52 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9521B10656A7;
	Thu, 19 Aug 2010 11:16:52 +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 849838FC19;
	Thu, 19 Aug 2010 11:16:52 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7JBGqGj001928;
	Thu, 19 Aug 2010 11:16:52 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7JBGqEc001926;
	Thu, 19 Aug 2010 11:16:52 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201008191116.o7JBGqEc001926@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 19 Aug 2010 11:16: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: r211497 - head/sys/mips/atheros
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 11:16:52 -0000

Author: adrian
Date: Thu Aug 19 11:16:52 2010
New Revision: 211497
URL: http://svn.freebsd.org/changeset/base/211497

Log:
  style(9) pick from imp@ .

Modified:
  head/sys/mips/atheros/if_arge.c

Modified: head/sys/mips/atheros/if_arge.c
==============================================================================
--- head/sys/mips/atheros/if_arge.c	Thu Aug 19 09:28:59 2010	(r211496)
+++ head/sys/mips/atheros/if_arge.c	Thu Aug 19 11:16:52 2010	(r211497)
@@ -182,11 +182,10 @@ MTX_SYSINIT(miibus_mtx, &miibus_mtx, "ar
 static void
 arge_flush_ddr(struct arge_softc *sc)
 {
-	if (sc->arge_mac_unit == 0) {
+	if (sc->arge_mac_unit == 0)
 		ar71xx_device_flush_ddr_ge0();
-	} else {
+	else
 		ar71xx_device_flush_ddr_ge1();
-	}
 }
 
 static int 

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 11:18:50 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9F5C51065697;
	Thu, 19 Aug 2010 11:18:50 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8EBCF8FC13;
	Thu, 19 Aug 2010 11:18:50 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7JBIogK002001;
	Thu, 19 Aug 2010 11:18:50 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7JBIoHN001999;
	Thu, 19 Aug 2010 11:18:50 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201008191118.o7JBIoHN001999@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 19 Aug 2010 11:18: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: r211498 - head/sys/mips/atheros
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 11:18:50 -0000

Author: adrian
Date: Thu Aug 19 11:18:50 2010
New Revision: 211498
URL: http://svn.freebsd.org/changeset/base/211498

Log:
  Add missing licence.

Modified:
  head/sys/mips/atheros/ar71xx_chip.c

Modified: head/sys/mips/atheros/ar71xx_chip.c
==============================================================================
--- head/sys/mips/atheros/ar71xx_chip.c	Thu Aug 19 11:16:52 2010	(r211497)
+++ head/sys/mips/atheros/ar71xx_chip.c	Thu Aug 19 11:18:50 2010	(r211498)
@@ -1,3 +1,29 @@
+/*-
+ * Copyright (c) 2010 Adrian Chadd
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
 #include 
 __FBSDID("$FreeBSD$");
 

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 11:19:21 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E71A31065698;
	Thu, 19 Aug 2010 11:19:21 +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 D6CB38FC1D;
	Thu, 19 Aug 2010 11:19:21 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7JBJL71002051;
	Thu, 19 Aug 2010 11:19:21 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7JBJLvH002049;
	Thu, 19 Aug 2010 11:19:21 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201008191119.o7JBJLvH002049@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Thu, 19 Aug 2010 11:19: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: r211499 - head/sbin/ipfw
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 11:19:22 -0000

Author: des
Date: Thu Aug 19 11:19:21 2010
New Revision: 211499
URL: http://svn.freebsd.org/changeset/base/211499

Log:
  expand_number(3) takes a uint64_t * now.
  
  MFC after:	3 weeks

Modified:
  head/sbin/ipfw/dummynet.c

Modified: head/sbin/ipfw/dummynet.c
==============================================================================
--- head/sbin/ipfw/dummynet.c	Thu Aug 19 11:18:50 2010	(r211498)
+++ head/sbin/ipfw/dummynet.c	Thu Aug 19 11:19:21 2010	(r211499)
@@ -1130,7 +1130,7 @@ end_mask:
 			NEED(p, "burst");
 			NEED1("burst needs argument\n");
 			errno = 0;
-			if (expand_number(av[0], (int64_t *)&p->burst) < 0)
+			if (expand_number(av[0], &p->burst) < 0)
 				if (errno != ERANGE)
 					errx(EX_DATAERR,
 					    "burst: invalid argument");

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 11:20:25 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 36B3D10656A6;
	Thu, 19 Aug 2010 11:20:25 +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 264998FC14;
	Thu, 19 Aug 2010 11:20:25 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7JBKPaH002126;
	Thu, 19 Aug 2010 11:20:25 GMT (envelope-from des@svn.freebsd.org)
Received: (from des@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7JBKPma002124;
	Thu, 19 Aug 2010 11:20:25 GMT (envelope-from des@svn.freebsd.org)
Message-Id: <201008191120.o7JBKPma002124@svn.freebsd.org>
From: Dag-Erling Smorgrav 
Date: Thu, 19 Aug 2010 11:20: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: r211500 - head/sbin/geom/core
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 11:20:25 -0000

Author: des
Date: Thu Aug 19 11:20:24 2010
New Revision: 211500
URL: http://svn.freebsd.org/changeset/base/211500

Log:
  expand_number(3) takes a uint64_t * now; intmax_t was never correct
  except by accident.
  
  MFC after:	3 weeks

Modified:
  head/sbin/geom/core/geom.c

Modified: head/sbin/geom/core/geom.c
==============================================================================
--- head/sbin/geom/core/geom.c	Thu Aug 19 11:19:21 2010	(r211499)
+++ head/sbin/geom/core/geom.c	Thu Aug 19 11:20:24 2010	(r211500)
@@ -237,7 +237,7 @@ static void
 set_option(struct gctl_req *req, struct g_option *opt, const char *val)
 {
 	char *s;
-	intmax_t number;
+	uint64_t number;
 
 	if (G_OPT_TYPE(opt) == G_TYPE_NUMBER ||
 	    G_OPT_TYPE(opt) == G_TYPE_ASCNUM) {

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 11:28:31 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 347871065694;
	Thu, 19 Aug 2010 11:28:31 +0000 (UTC) (envelope-from des@des.no)
Received: from smtp.des.no (smtp.des.no [194.63.250.102])
	by mx1.freebsd.org (Postfix) with ESMTP id E6B3D8FC1B;
	Thu, 19 Aug 2010 11:28:30 +0000 (UTC)
Received: from ds4.des.no (des.no [84.49.246.2])
	by smtp.des.no (Postfix) with ESMTP id 1B9C21FFC33;
	Thu, 19 Aug 2010 11:28:30 +0000 (UTC)
Received: by ds4.des.no (Postfix, from userid 1001)
	id D9554845D4; Thu, 19 Aug 2010 13:28:29 +0200 (CEST)
From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= 
To: mdf@FreeBSD.org
References: <201008181740.o7IHeA4c075984@svn.freebsd.org>
	
Date: Thu, 19 Aug 2010 13:28:29 +0200
In-Reply-To: 
	(mdf@freebsd.org's message of "Wed, 18 Aug 2010 13:48:40 -0700")
Message-ID: <86tymqc04i.fsf@ds4.des.no>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Gabor Kovesdan 
Subject: Re: svn commit: r211463 - head/usr.bin/grep
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 11:28:31 -0000

mdf@FreeBSD.org writes:
> I didn't read all of the details in the profiling mails in the thread,
> but does this mean that work on stdio would give a performance boost
> to many apps?

No, just that stdio is not the appropriate tool in this case.

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 11:31:04 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6A4CB1065695;
	Thu, 19 Aug 2010 11:31:04 +0000 (UTC)
	(envelope-from anchie@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 57FBD8FC1B;
	Thu, 19 Aug 2010 11:31:04 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7JBV4c8002423;
	Thu, 19 Aug 2010 11:31:04 GMT (envelope-from anchie@svn.freebsd.org)
Received: (from anchie@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7JBV4Yf002412;
	Thu, 19 Aug 2010 11:31:04 GMT (envelope-from anchie@svn.freebsd.org)
Message-Id: <201008191131.o7JBV4Yf002412@svn.freebsd.org>
From: Ana Kukec 
Date: Thu, 19 Aug 2010 11: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: r211501 - in head/sys: modules modules/send netinet
	netinet6 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, 19 Aug 2010 11:31:04 -0000

Author: anchie
Date: Thu Aug 19 11:31:03 2010
New Revision: 211501
URL: http://svn.freebsd.org/changeset/base/211501

Log:
  MFp4: anchie_soc2009 branch:
  
  Add kernel side support for Secure Neighbor Discovery (SeND), RFC 3971.
  
  The implementation consists of a kernel module that gets packets from
  the nd6 code, sends them to user space on a dedicated socket and reinjects
  them back for further processing.
  
  Hooks are used from nd6 code paths to divert relevant packets to the
  send implementation for processing in user space.  The hooks are only
  triggered if the send module is loaded. In case no user space
  application is connected to the send socket, processing continues
  normaly as if the module would not be loaded. Unloading the module
  is not possible at this time due to missing nd6 locking.
  
  The native SeND socket is similar to a raw IPv6 socket but with its own,
  internal pseudo-protocol.
  
  Approved by:	bz (mentor)

Added:
  head/sys/modules/send/
  head/sys/modules/send/Makefile   (contents, props changed)
  head/sys/netinet6/send.c   (contents, props changed)
  head/sys/netinet6/send.h   (contents, props changed)
Modified:
  head/sys/modules/Makefile
  head/sys/netinet/in.h
  head/sys/netinet6/icmp6.c
  head/sys/netinet6/nd6.c
  head/sys/netinet6/nd6_nbr.c
  head/sys/netinet6/raw_ip6.c
  head/sys/sys/mbuf.h

Modified: head/sys/modules/Makefile
==============================================================================
--- head/sys/modules/Makefile	Thu Aug 19 11:20:24 2010	(r211500)
+++ head/sys/modules/Makefile	Thu Aug 19 11:31:03 2010	(r211501)
@@ -257,6 +257,7 @@ SUBDIR=	${_3dfx} \
 	${_scsi_low} \
 	sdhci \
 	sem \
+	send \
 	sf \
 	sge \
 	siba_bwn \

Added: head/sys/modules/send/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/modules/send/Makefile	Thu Aug 19 11:31:03 2010	(r211501)
@@ -0,0 +1,7 @@
+# $FreeBSD$
+.PATH: ${.CURDIR}/../../netinet6
+
+KMOD=	send
+SRCS=	send.c
+
+.include 

Modified: head/sys/netinet/in.h
==============================================================================
--- head/sys/netinet/in.h	Thu Aug 19 11:20:24 2010	(r211500)
+++ head/sys/netinet/in.h	Thu Aug 19 11:31:03 2010	(r211501)
@@ -252,6 +252,7 @@ __END_DECLS
 
 /* Only used internally, so can be outside the range of valid IP protocols. */
 #define	IPPROTO_DIVERT		258		/* divert pseudo-protocol */
+#define	IPPROTO_SEND		259		/* SeND pseudo-protocol */
 
 /*
  * Defined to avoid confusion.  The master value is defined by

Modified: head/sys/netinet6/icmp6.c
==============================================================================
--- head/sys/netinet6/icmp6.c	Thu Aug 19 11:20:24 2010	(r211500)
+++ head/sys/netinet6/icmp6.c	Thu Aug 19 11:31:03 2010	(r211501)
@@ -105,6 +105,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #ifdef IPSEC
 #include 
@@ -414,6 +415,7 @@ icmp6_input(struct mbuf **mp, int *offp,
 	int icmp6len = m->m_pkthdr.len - *offp;
 	int code, sum, noff;
 	char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN];
+	int ip6len, error;
 
 	ifp = m->m_pkthdr.rcvif;
 
@@ -428,6 +430,7 @@ icmp6_input(struct mbuf **mp, int *offp,
 	 */
 
 	ip6 = mtod(m, struct ip6_hdr *);
+	ip6len = sizeof(struct ip6_hdr) + ntohs(ip6->ip6_plen);
 	if (icmp6len < sizeof(struct icmp6_hdr)) {
 		ICMP6STAT_INC(icp6s_tooshort);
 		goto freeit;
@@ -766,11 +769,35 @@ icmp6_input(struct mbuf **mp, int *offp,
 			goto badlen;
 		if ((n = m_copym(m, 0, M_COPYALL, M_DONTWAIT)) == NULL) {
 			/* give up local */
-			nd6_rs_input(m, off, icmp6len);
+
+			/* Send incoming SeND packet to user space. */
+			if (send_sendso_input_hook != NULL) {
+				IP6_EXTHDR_CHECK(m, off,
+				    icmp6len, IPPROTO_DONE);
+				error = send_sendso_input_hook(m, ifp,
+				    SND_IN, ip6len);
+				/* -1 == no app on SEND socket */
+				if (error == 0)
+					return (IPPROTO_DONE);
+				nd6_rs_input(m, off, icmp6len);
+			} else
+				nd6_rs_input(m, off, icmp6len);
 			m = NULL;
 			goto freeit;
 		}
-		nd6_rs_input(n, off, icmp6len);
+		if (send_sendso_input_hook != NULL) {
+			IP6_EXTHDR_CHECK(m, off,
+			    icmp6len, IPPROTO_DONE);
+                        error = send_sendso_input_hook(n, ifp,
+			    SND_IN, ip6len);
+			if (error == 0) {
+				m_freem(n);
+				return (IPPROTO_DONE);
+			}
+			/* -1 == no app on SEND socket */
+			nd6_rs_input(n, off, icmp6len);
+		} else
+			nd6_rs_input(n, off, icmp6len);
 		/* m stays. */
 		break;
 
@@ -781,12 +808,28 @@ icmp6_input(struct mbuf **mp, int *offp,
 		if (icmp6len < sizeof(struct nd_router_advert))
 			goto badlen;
 		if ((n = m_copym(m, 0, M_COPYALL, M_DONTWAIT)) == NULL) {
-			/* give up local */
-			nd6_ra_input(m, off, icmp6len);
+
+			/* Send incoming SeND-protected/ND packet to user space. */
+			if (send_sendso_input_hook != NULL) {
+				error = send_sendso_input_hook(m, ifp,
+				    SND_IN, ip6len);
+				if (error == 0)
+					return (IPPROTO_DONE);
+				nd6_ra_input(m, off, icmp6len);
+			} else
+				nd6_ra_input(m, off, icmp6len);
 			m = NULL;
+			m_freem(n);
 			goto freeit;
 		}
-		nd6_ra_input(n, off, icmp6len);
+		if (send_sendso_input_hook != NULL) {
+			error = send_sendso_input_hook(n, ifp,
+			    SND_IN, ip6len);
+			if (error == 0)
+				return (IPPROTO_DONE);
+			nd6_ra_input(n, off, icmp6len);
+		} else
+			nd6_ra_input(n, off, icmp6len);
 		/* m stays. */
 		break;
 
@@ -797,12 +840,26 @@ icmp6_input(struct mbuf **mp, int *offp,
 		if (icmp6len < sizeof(struct nd_neighbor_solicit))
 			goto badlen;
 		if ((n = m_copym(m, 0, M_COPYALL, M_DONTWAIT)) == NULL) {
-			/* give up local */
-			nd6_ns_input(m, off, icmp6len);
+			if (send_sendso_input_hook != NULL) {
+				error = send_sendso_input_hook(m, ifp,
+				    SND_IN, ip6len);
+				if (error == 0)
+					return (IPPROTO_DONE);
+				nd6_ns_input(m, off, icmp6len);
+			} else
+				nd6_ns_input(m, off, icmp6len);
+			m_freem(n);
 			m = NULL;
 			goto freeit;
 		}
-		nd6_ns_input(n, off, icmp6len);
+		if (send_sendso_input_hook != NULL) {
+			error = send_sendso_input_hook(n, ifp,
+			    SND_IN, ip6len);
+			if (error == 0)
+				return (IPPROTO_DONE);
+			nd6_ns_input(n, off, icmp6len);
+		} else
+			nd6_ns_input(n, off, icmp6len);
 		/* m stays. */
 		break;
 
@@ -813,12 +870,28 @@ icmp6_input(struct mbuf **mp, int *offp,
 		if (icmp6len < sizeof(struct nd_neighbor_advert))
 			goto badlen;
 		if ((n = m_copym(m, 0, M_COPYALL, M_DONTWAIT)) == NULL) {
-			/* give up local */
-			nd6_na_input(m, off, icmp6len);
+
+			/* Send incoming SeND-protected/ND packet to user space. */
+			if (send_sendso_input_hook != NULL) {
+				error = send_sendso_input_hook(m, ifp,
+				    SND_IN, ip6len);
+				if (error == 0)
+					return (IPPROTO_DONE);
+				nd6_na_input(m, off, icmp6len);
+			} else
+				nd6_na_input(m, off, icmp6len);
+			m_freem(n);
 			m = NULL;
 			goto freeit;
 		}
-		nd6_na_input(n, off, icmp6len);
+		if (send_sendso_input_hook != NULL) {
+			error = send_sendso_input_hook(n, ifp,
+			    SND_IN, ip6len);
+			if (error == 0)
+				return (IPPROTO_DONE);
+			nd6_na_input(n, off, icmp6len);
+		} else
+			nd6_na_input(n, off, icmp6len);
 		/* m stays. */
 		break;
 
@@ -829,12 +902,26 @@ icmp6_input(struct mbuf **mp, int *offp,
 		if (icmp6len < sizeof(struct nd_redirect))
 			goto badlen;
 		if ((n = m_copym(m, 0, M_COPYALL, M_DONTWAIT)) == NULL) {
-			/* give up local */
-			icmp6_redirect_input(m, off);
+			if (send_sendso_input_hook != NULL) {
+				error = send_sendso_input_hook(m, ifp,
+				    SND_IN, ip6len);
+		 		if (error == 0)
+					return (IPPROTO_DONE);
+			    icmp6_redirect_input(m, off);
+			} else
+				icmp6_redirect_input(m, off);
+			m_freem(n);
 			m = NULL;
 			goto freeit;
 		}
-		icmp6_redirect_input(n, off);
+		if (send_sendso_input_hook != NULL) {
+			error = send_sendso_input_hook(n, ifp,
+			    SND_IN, ip6len);
+			if (error == 0)
+				return (IPPROTO_DONE);
+			icmp6_redirect_input(n, off);
+		} else
+			icmp6_redirect_input(n, off);
 		/* m stays. */
 		break;
 
@@ -2476,6 +2563,7 @@ icmp6_redirect_output(struct mbuf *m0, s
 	struct in6_addr *router_ll6;
 	struct ip6_hdr *sip6;	/* m0 as struct ip6_hdr */
 	struct mbuf *m = NULL;	/* newly allocated one */
+	struct m_tag *mtag;
 	struct ip6_hdr *ip6;	/* m as struct ip6_hdr */
 	struct nd_redirect *nd_rd;
 	struct llentry *ln = NULL;
@@ -2735,6 +2823,15 @@ noredhdropt:;
 	nd_rd->nd_rd_cksum = in6_cksum(m, IPPROTO_ICMPV6,
 	    sizeof(*ip6), ntohs(ip6->ip6_plen));
 
+        if (send_sendso_input_hook != NULL) {
+		mtag = m_tag_get(PACKET_TAG_ND_OUTGOING, sizeof(unsigned short),
+			M_NOWAIT);
+		if (mtag == NULL)
+			goto fail;
+		*(unsigned short *)(mtag + 1) = nd_rd->nd_rd_type;
+		m_tag_prepend(m, mtag);
+	}
+
 	/* send the packet to outside... */
 	ip6_output(m, NULL, NULL, 0, NULL, &outif, NULL);
 	if (outif) {

Modified: head/sys/netinet6/nd6.c
==============================================================================
--- head/sys/netinet6/nd6.c	Thu Aug 19 11:20:24 2010	(r211500)
+++ head/sys/netinet6/nd6.c	Thu Aug 19 11:31:03 2010	(r211501)
@@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -121,6 +122,8 @@ VNET_DEFINE(int, nd6_recalc_reachtm_inte
 
 static struct sockaddr_in6 all1_sa;
 
+int	(*send_sendso_input_hook)(struct mbuf *, struct ifnet *, int, int);
+
 static int nd6_is_new_addr_neighbor __P((struct sockaddr_in6 *,
 	struct ifnet *));
 static void nd6_setmtu0(struct ifnet *, struct nd_ifinfo *);
@@ -1758,9 +1761,12 @@ nd6_output_lle(struct ifnet *ifp, struct
 	struct mbuf **chain)
 {
 	struct mbuf *m = m0;
+	struct m_tag *mtag;
 	struct llentry *ln = lle;
+	struct ip6_hdr *ip6;
 	int error = 0;
 	int flags = 0;
+	int ip6len;
 
 #ifdef INVARIANTS
 	if (lle != NULL) {
@@ -1935,6 +1941,28 @@ nd6_output_lle(struct ifnet *ifp, struct
 #ifdef MAC
 	mac_netinet6_nd6_send(ifp, m);
 #endif
+
+	/*
+	 * If called from nd6_ns_output() (NS), nd6_na_output() (NA),
+	 * icmp6_redirect_output() (REDIRECT) or from rip6_output() (RS, RA
+	 * as handled by rtsol and rtadvd), mbufs will be tagged for SeND
+	 * to be diverted to user space.  When re-injected into the kernel,
+	 * send_output() will directly dispatch them to the outgoing interface.
+	 */
+	if (send_sendso_input_hook != NULL) {
+		mtag = m_tag_find(m, PACKET_TAG_ND_OUTGOING, NULL);
+		if (mtag != NULL) {
+			ip6 = mtod(m, struct ip6_hdr *);
+			ip6len = sizeof(struct ip6_hdr) + ntohs(ip6->ip6_plen);
+			/* Use the SEND socket */
+			error = send_sendso_input_hook(m, ifp, SND_OUT,
+			    ip6len);
+			/* -1 == no app on SEND socket */
+			if (error == 0 || error != -1)
+			    return (error);
+		}
+	}
+
 	/*
 	 * We were passed in a pointer to an lle with the lock held 
 	 * this means that we can't call if_output as we will

Modified: head/sys/netinet6/nd6_nbr.c
==============================================================================
--- head/sys/netinet6/nd6_nbr.c	Thu Aug 19 11:20:24 2010	(r211500)
+++ head/sys/netinet6/nd6_nbr.c	Thu Aug 19 11:31:03 2010	(r211501)
@@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #define SDL(s) ((struct sockaddr_dl *)s)
 
@@ -379,6 +380,7 @@ nd6_ns_output(struct ifnet *ifp, const s
     const struct in6_addr *taddr6, struct llentry *ln, int dad)
 {
 	struct mbuf *m;
+	struct m_tag *mtag;
 	struct ip6_hdr *ip6;
 	struct nd_neighbor_solicit *nd_ns;
 	struct in6_addr *src, src_in;
@@ -557,6 +559,15 @@ nd6_ns_output(struct ifnet *ifp, const s
 	nd_ns->nd_ns_cksum =
 	    in6_cksum(m, IPPROTO_ICMPV6, sizeof(*ip6), icmp6len);
 
+	if (send_sendso_input_hook != NULL) {
+		mtag = m_tag_get(PACKET_TAG_ND_OUTGOING,
+			sizeof(unsigned short), M_NOWAIT);
+		if (mtag == NULL)
+			goto bad;
+		*(unsigned short *)(mtag + 1) = nd_ns->nd_ns_type;
+		m_tag_prepend(m, mtag);
+	}
+
 	ip6_output(m, NULL, &ro, dad ? IPV6_UNSPECSRC : 0, &im6o, NULL, NULL);
 	icmp6_ifstat_inc(ifp, ifs6_out_msg);
 	icmp6_ifstat_inc(ifp, ifs6_out_neighborsolicit);
@@ -604,6 +615,7 @@ nd6_na_input(struct mbuf *m, int off, in
 	struct llentry *ln = NULL;
 	union nd_opts ndopts;
 	struct mbuf *chain = NULL;
+	struct m_tag *mtag;
 	struct sockaddr_in6 sin6;
 	char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN];
 
@@ -873,6 +885,15 @@ nd6_na_input(struct mbuf *m, int off, in
 			 * we assume ifp is not a loopback here, so just set
 			 * the 2nd argument as the 1st one.
 			 */
+
+			if (send_sendso_input_hook != NULL) {
+				mtag = m_tag_get(PACKET_TAG_ND_OUTGOING,
+				    sizeof(unsigned short), M_NOWAIT);
+				if (mtag == NULL)
+					goto bad;
+				m_tag_prepend(m, mtag);
+			}
+
 			nd6_output_lle(ifp, ifp, m_hold, L3_ADDR_SIN6(ln), NULL, ln, &chain);
 		}
 	}
@@ -917,6 +938,7 @@ nd6_na_output(struct ifnet *ifp, const s
     struct sockaddr *sdl0)
 {
 	struct mbuf *m;
+	struct m_tag *mtag;
 	struct ip6_hdr *ip6;
 	struct nd_neighbor_advert *nd_na;
 	struct ip6_moptions im6o;
@@ -1055,6 +1077,15 @@ nd6_na_output(struct ifnet *ifp, const s
 	nd_na->nd_na_cksum =
 	    in6_cksum(m, IPPROTO_ICMPV6, sizeof(struct ip6_hdr), icmp6len);
 
+	if (send_sendso_input_hook != NULL) {
+		mtag = m_tag_get(PACKET_TAG_ND_OUTGOING,
+		    sizeof(unsigned short), M_NOWAIT);
+		if (mtag == NULL)
+			goto bad;
+		*(unsigned short *)(mtag + 1) = nd_na->nd_na_type;
+		m_tag_prepend(m, mtag);
+	}
+
 	ip6_output(m, NULL, &ro, 0, &im6o, NULL, NULL);
 	icmp6_ifstat_inc(ifp, ifs6_out_msg);
 	icmp6_ifstat_inc(ifp, ifs6_out_neighboradvert);

Modified: head/sys/netinet6/raw_ip6.c
==============================================================================
--- head/sys/netinet6/raw_ip6.c	Thu Aug 19 11:20:24 2010	(r211500)
+++ head/sys/netinet6/raw_ip6.c	Thu Aug 19 11:31:03 2010	(r211501)
@@ -92,6 +92,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -99,6 +100,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #ifdef IPSEC
 #include 
@@ -390,6 +392,7 @@ rip6_output(m, va_alist)
 #endif
 {
 	struct mbuf *control;
+	struct m_tag *mtag;
 	struct socket *so;
 	struct sockaddr_in6 *dstsock;
 	struct in6_addr *dst;
@@ -532,6 +535,23 @@ rip6_output(m, va_alist)
 		*p = in6_cksum(m, ip6->ip6_nxt, sizeof(*ip6), plen);
 	}
 
+	/*
+	 * Send RA/RS messages to user land for protection, before sending
+	 * them to rtadvd/rtsol.
+	 */
+	if ((send_sendso_input_hook != NULL) &&
+	    so->so_proto->pr_protocol == IPPROTO_ICMPV6) {
+		switch (type) {
+		case ND_ROUTER_ADVERT:
+		case ND_ROUTER_SOLICIT:
+			mtag = m_tag_get(PACKET_TAG_ND_OUTGOING,
+				sizeof(unsigned short), M_NOWAIT);
+			if (mtag == NULL)
+				goto bad;
+			m_tag_prepend(m, mtag);
+		}
+	}
+
 	error = ip6_output(m, optp, NULL, 0, in6p->in6p_moptions, &oifp, in6p);
 	if (so->so_proto->pr_protocol == IPPROTO_ICMPV6) {
 		if (oifp)

Added: head/sys/netinet6/send.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/netinet6/send.c	Thu Aug 19 11:31:03 2010	(r211501)
@@ -0,0 +1,367 @@
+/*-
+ * Copyright (c) 2009-2010 Ana Kukec 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+
+MALLOC_DEFINE(M_SEND, "send", "Secure Neighbour Discovery");
+
+/*
+ * The socket used to communicate with the SeND daemon.
+ */
+static VNET_DEFINE(struct socket *, send_so);
+#define	V_send_so	VNET(send_so)
+
+u_long	send_sendspace	= 8 * (1024 + sizeof(struct sockaddr_send));
+u_long	send_recvspace	= 9216;
+
+struct mtx	send_mtx;
+#define SEND_LOCK_INIT()	mtx_init(&send_mtx, "send_mtx", NULL, MTX_DEF)
+#define SEND_LOCK()		mtx_lock(&send_mtx)
+#define SEND_UNLOCK()		mtx_unlock(&send_mtx)
+#define SEND_LOCK_DESTROY()     mtx_destroy(&send_mtx)
+
+static int
+send_attach(struct socket *so, int proto, struct thread *td)
+{
+	int error;
+
+	SEND_LOCK();
+	if (V_send_so != NULL) {
+		SEND_UNLOCK();
+		return (EEXIST);
+	}
+
+	error = priv_check(td, PRIV_NETINET_RAW);
+	if (error) {
+		SEND_UNLOCK();
+		return(error);
+	}
+
+	if (proto != IPPROTO_SEND) {
+		SEND_UNLOCK();
+		return (EPROTONOSUPPORT);
+	}
+	error = soreserve(so, send_sendspace, send_recvspace);
+	if (error) {
+		SEND_UNLOCK();
+		return(error);
+	}
+
+	V_send_so = so;
+	SEND_UNLOCK();
+
+	return (0);
+}
+
+static int
+send_output(struct mbuf *m, struct ifnet *ifp, int direction)
+{
+	struct ip6_hdr *ip6;
+	struct sockaddr_in6 dst;
+	struct icmp6_hdr *icmp6;
+	int icmp6len;
+
+	/*
+	 * Receive incoming (SeND-protected) or outgoing traffic
+	 * (SeND-validated) from the SeND user space application.
+	 */
+
+	switch (direction) {
+	case SND_IN:
+		if (m->m_len < (sizeof(struct ip6_hdr) +
+		    sizeof(struct icmp6_hdr))) {
+			m = m_pullup(m, sizeof(struct ip6_hdr) +
+			    sizeof(struct icmp6_hdr));
+			if (!m)
+				return (ENOBUFS);
+		}
+
+		/* Before passing off the mbuf record the proper interface. */
+		m->m_pkthdr.rcvif = ifp;
+
+		if (m->m_flags & M_PKTHDR)
+			icmp6len = m->m_pkthdr.len - sizeof(struct ip6_hdr);
+		else
+			panic("Doh! not the first mbuf.");
+
+		ip6 = mtod(m, struct ip6_hdr *);
+		icmp6 = (struct icmp6_hdr *)(ip6 + 1);
+
+		/*
+		 * Output the packet as icmp6.c:icpm6_input() would do.
+		 * The mbuf is always consumed, so we do not have to
+		 * care about that.
+		 */
+		switch (icmp6->icmp6_type) {
+		case ND_NEIGHBOR_SOLICIT:
+			nd6_ns_input(m, sizeof(struct ip6_hdr), icmp6len);
+			break;
+		case ND_NEIGHBOR_ADVERT:
+			nd6_na_input(m, sizeof(struct ip6_hdr), icmp6len);
+			break;
+		case ND_REDIRECT:
+			icmp6_redirect_input(m, sizeof(struct ip6_hdr));
+			break;
+		case ND_ROUTER_SOLICIT:
+			nd6_rs_input(m, sizeof(struct ip6_hdr), icmp6len);
+			break;
+		case ND_ROUTER_ADVERT:
+			nd6_ra_input(m, sizeof(struct ip6_hdr), icmp6len);
+			break;
+		default:
+			return (ENOSYS);
+		}
+		return (0);
+
+	case SND_OUT:
+		if (m->m_len < sizeof(struct ip6_hdr)) {
+			m = m_pullup(m, sizeof(struct ip6_hdr));
+			if (!m)
+				return (ENOBUFS);
+		}
+		ip6 = mtod(m, struct ip6_hdr *);
+		if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst))
+			m->m_flags |= M_MCAST;
+
+		bzero(&dst, sizeof(dst));
+		dst.sin6_family = AF_INET6;
+		dst.sin6_len = sizeof(dst);
+		dst.sin6_addr = ip6->ip6_dst;
+
+		/*
+		 * Output the packet as nd6.c:nd6_output_lle() would do.
+		 * The mbuf is always consumed, so we do not have to care
+		 * about that.
+		 * XXX-BZ as we added data, what about fragmenting,
+		 * if now needed?
+		 */
+		int error;
+		error = ((*ifp->if_output)(ifp, m, (struct sockaddr *)&dst,
+		    NULL));
+		if (error)
+			error = ENOENT;
+		return (error);
+
+	default:
+		panic("%s: direction %d neither SND_IN nor SND_OUT.",
+		     __func__, direction);
+	}
+}
+
+/*
+ * Receive a SeND message from user space to be either send out by the kernel
+ * or, with SeND ICMPv6 options removed, to be further processed by the icmp6
+ * input path.
+ */
+static int
+send_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *nam,
+    struct mbuf *control, struct thread *td)
+{
+	struct sockaddr_send *sendsrc;
+	struct ifnet *ifp;
+	int error;
+
+	KASSERT(V_send_so == so, ("%s: socket %p not send socket %p",
+		__func__, so, V_send_so));
+
+	sendsrc = (struct sockaddr_send *)nam;
+	ifp = ifnet_byindex_ref(sendsrc->send_ifidx);
+	if (ifp == NULL) {
+		error = ENETUNREACH;
+		goto err;
+	}
+
+	error = send_output(m, ifp, sendsrc->send_direction);
+	if_rele(ifp);
+	m = NULL;
+
+err:
+	if (m != NULL)
+		m_freem(m);
+	return (error);
+}
+
+static void
+send_close(struct socket *so)
+{
+
+	SEND_LOCK();
+	if (V_send_so)
+		V_send_so = NULL;
+	SEND_UNLOCK();
+}
+
+/*
+ * Send a SeND message to user space, that was either received and has to be
+ * validated or was about to be send out and has to be handled by the SEND
+ * daemon adding SeND ICMPv6 options.
+ */
+static int
+send_input(struct mbuf *m, struct ifnet *ifp, int direction, int msglen __unused)
+{
+	struct ip6_hdr *ip6;
+	struct sockaddr_send sendsrc;
+
+	SEND_LOCK();
+	if (V_send_so == NULL) {
+		SEND_UNLOCK();
+		return (-1);
+	}
+
+	/*
+	 * Make sure to clear any possible internally embedded scope before
+	 * passing the packet to user space for SeND cryptographic signature
+	 * validation to succeed.
+	 */
+	ip6 = mtod(m, struct ip6_hdr *);
+	in6_clearscope(&ip6->ip6_src);
+	in6_clearscope(&ip6->ip6_dst);
+
+	bzero(&sendsrc, sizeof(sendsrc));
+	sendsrc.send_len = sizeof(sendsrc);
+	sendsrc.send_family = AF_INET6;
+	sendsrc.send_direction = direction;
+	sendsrc.send_ifidx = ifp->if_index;
+
+	/*
+	 * Send incoming or outgoing traffic to user space either to be
+	 * protected (outgoing) or validated (incoming) according to rfc3971.
+	 */
+	SOCKBUF_LOCK(&V_send_so->so_rcv);
+	if (sbappendaddr_locked(&V_send_so->so_rcv,
+	    (struct sockaddr *)&sendsrc, m, NULL) == 0) {
+		SOCKBUF_UNLOCK(&V_send_so->so_rcv);
+		/* XXX stats. */
+		m_freem(m);
+	} else {
+		sorwakeup_locked(V_send_so);
+	}
+
+	SEND_UNLOCK();
+	return (0);
+}
+
+struct pr_usrreqs send_usrreqs = {
+	.pru_attach =		send_attach,
+	.pru_send =		send_send,
+	.pru_detach =		send_close
+};
+struct protosw send_protosw = {
+	.pr_type =		SOCK_RAW,
+	.pr_flags =		PR_ATOMIC|PR_ADDR,
+	.pr_protocol =		IPPROTO_SEND,
+	.pr_usrreqs =		&send_usrreqs
+};
+
+static int
+send_modevent(module_t mod, int type, void *unused)
+{
+#ifdef __notyet__
+	VNET_ITERATOR_DECL(vnet_iter);
+#endif
+	int error;
+
+	switch (type) {
+	case MOD_LOAD:
+		SEND_LOCK_INIT();
+
+		error = pf_proto_register(PF_INET6, &send_protosw);
+		if (error != 0) {
+			printf("%s:%d: MOD_LOAD pf_proto_register(): %d\n",
+			   __func__, __LINE__, error);
+			SEND_LOCK_DESTROY();
+			break;
+		}
+		send_sendso_input_hook = send_input;
+		break;
+	case MOD_UNLOAD:
+		/* Do not allow unloading w/o locking. */
+		return (EBUSY);
+#ifdef __notyet__
+		VNET_LIST_RLOCK_NOSLEEP();
+		SEND_LOCK();
+		VNET_FOREACH(vnet_iter) {
+			CURVNET_SET(vnet_iter);
+			if (V_send_so != NULL) {
+				CURVNET_RESTORE();
+				SEND_UNLOCK();
+				VNET_LIST_RUNLOCK_NOSLEEP();
+				return (EBUSY);
+			}
+			CURVNET_RESTORE();
+		}
+		SEND_UNLOCK();
+		VNET_LIST_RUNLOCK_NOSLEEP();
+		error = pf_proto_unregister(PF_INET6, IPPROTO_SEND, SOCK_RAW);
+		if (error == 0)
+			SEND_LOCK_DESTROY();
+		send_sendso_input_hook = NULL;
+		break;
+#endif
+	default:
+		error = 0;
+		break;
+	}
+
+	return (error);
+}
+
+static moduledata_t sendmod = {
+	"send",
+	send_modevent,
+	0
+};
+
+DECLARE_MODULE(send, sendmod, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY);

Added: head/sys/netinet6/send.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/netinet6/send.h	Thu Aug 19 11:31:03 2010	(r211501)
@@ -0,0 +1,45 @@
+/*-
+ * Copyright (c) 2009-2010 Ana Kukec 
+ * 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$
+ */
+
+#ifndef _NETINET6_SEND_H_
+#define _NETINET6_SEND_H_
+
+#define	SND_OUT		0	/* Outgoing traffic */
+#define	SND_IN		1	/* Incoming traffic. */
+
+struct sockaddr_send {
+	unsigned char		send_len;	/* total length */
+	sa_family_t		send_family;	/* address family */
+	int			send_direction;
+	int			send_ifidx;
+	char			send_zero[8];
+};
+
+extern int (*send_sendso_input_hook)(struct mbuf *, struct ifnet *, int, int);
+
+#endif /* _NETINET6_SEND_H_ */

Modified: head/sys/sys/mbuf.h
==============================================================================
--- head/sys/sys/mbuf.h	Thu Aug 19 11:20:24 2010	(r211500)
+++ head/sys/sys/mbuf.h	Thu Aug 19 11:31:03 2010	(r211501)
@@ -903,6 +903,7 @@ struct mbuf	*m_unshare(struct mbuf *, in
 #define	PACKET_TAG_IPOPTIONS			27 /* Saved IP options */
 #define	PACKET_TAG_CARP				28 /* CARP info */
 #define	PACKET_TAG_IPSEC_NAT_T_PORTS		29 /* two uint16_t */
+#define	PACKET_TAG_ND_OUTGOING			30 /* ND outgoing */
 
 /* Specific cookies and tags. */
 

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 11:40:10 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 94CE410656F8;
	Thu, 19 Aug 2010 11:40:10 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 830498FC1F;
	Thu, 19 Aug 2010 11:40:10 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7JBeA64002648;
	Thu, 19 Aug 2010 11:40:10 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7JBeAAi002642;
	Thu, 19 Aug 2010 11:40:10 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201008191140.o7JBeAAi002642@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 19 Aug 2010 11:40: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: r211502 - head/sys/mips/atheros
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 11:40:10 -0000

Author: adrian
Date: Thu Aug 19 11:40:10 2010
New Revision: 211502
URL: http://svn.freebsd.org/changeset/base/211502

Log:
  Add initial Atheros AR91XX support.
  
  This works well enough to bring a system up to single-user mode
  using an MDROOT.
  
  Known Issues:
  
  * The EHCI USB doesn't currently work and will panic the kernel during
    attach.
  * The onboard ethernet won't work until the PLL routines have been
    fleshed out and shoe-horned into if_arge.
  * The WMAC device glue (and quite likely the if_ath support)
    hasn't yet been implemented.

Added:
  head/sys/mips/atheros/ar91xx_chip.c   (contents, props changed)
  head/sys/mips/atheros/ar91xx_chip.h   (contents, props changed)
Modified:
  head/sys/mips/atheros/ar71xx_setup.c
  head/sys/mips/atheros/ar71xxreg.h
  head/sys/mips/atheros/files.ar71xx

Modified: head/sys/mips/atheros/ar71xx_setup.c
==============================================================================
--- head/sys/mips/atheros/ar71xx_setup.c	Thu Aug 19 11:31:03 2010	(r211501)
+++ head/sys/mips/atheros/ar71xx_setup.c	Thu Aug 19 11:40:10 2010	(r211502)
@@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 
 #define	AR71XX_SYS_TYPE_LEN		128
 
@@ -104,6 +105,25 @@ ar71xx_detect_sys_type(void)
 		}
 		break;
 
+	case REV_ID_MAJOR_AR913X:
+		minor = id & AR91XX_REV_ID_MINOR_MASK;
+		rev = id >> AR91XX_REV_ID_REVISION_SHIFT;
+		rev &= AR91XX_REV_ID_REVISION_MASK;
+		ar71xx_cpu_ops	= &ar91xx_chip_def;
+		switch (minor) {
+		case AR91XX_REV_ID_MINOR_AR9130:
+			ar71xx_soc = AR71XX_SOC_AR9130;
+			chip = "9130";
+			break;
+
+		case AR91XX_REV_ID_MINOR_AR9132:
+			ar71xx_soc = AR71XX_SOC_AR9132;
+			chip = "9132";
+			break;
+		}
+		break;
+
+
 	default:
 		panic("ar71xx: unknown chip id:0x%08x\n", id);
 	}

Modified: head/sys/mips/atheros/ar71xxreg.h
==============================================================================
--- head/sys/mips/atheros/ar71xxreg.h	Thu Aug 19 11:31:03 2010	(r211501)
+++ head/sys/mips/atheros/ar71xxreg.h	Thu Aug 19 11:40:10 2010	(r211502)
@@ -195,6 +195,9 @@
 #define	AR71XX_PLL_ETH_EXT_CLK		0x18050018
 #define	AR71XX_PLL_PCI_CLK		0x1805001C
 
+/* Reset block */
+#define	AR71XX_RST_BLOCK_BASE	0x18060000
+
 #define AR71XX_RST_WDOG_CONTROL	0x18060008
 #define		RST_WDOG_LAST			(1 << 31)
 #define		RST_WDOG_ACTION_MASK		3
@@ -253,6 +256,13 @@
 #define		AR71XX_REV_ID_REVISION_MASK	0x3
 #define		AR71XX_REV_ID_REVISION_SHIFT	2
 
+/* AR91XX chipset revision details */
+#define		AR91XX_REV_ID_MINOR_MASK	0x3
+#define		AR91XX_REV_ID_MINOR_AR9130	0x0
+#define		AR91XX_REV_ID_MINOR_AR9132	0x1
+#define		AR91XX_REV_ID_REVISION_MASK	0x3
+#define		AR91XX_REV_ID_REVISION_SHIFT	2
+
 /*
  * GigE adapters region
  */

Added: head/sys/mips/atheros/ar91xx_chip.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/mips/atheros/ar91xx_chip.c	Thu Aug 19 11:40:10 2010	(r211502)
@@ -0,0 +1,171 @@
+/*-
+ * Copyright (c) 2010 Adrian Chadd
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+
+#include 
+
+#include "opt_ddb.h"
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+ 
+#include 
+#include 
+ 
+#include 
+ 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+ 
+#include 
+#include 
+
+#include 
+#include 
+
+static void
+ar91xx_chip_detect_mem_size(void)
+{
+}
+
+static void
+ar91xx_chip_detect_sys_frequency(void)
+{
+        uint32_t pll;
+        uint32_t freq;
+        uint32_t div;
+        
+        pll = ATH_READ_REG(AR91XX_PLL_REG_CPU_CONFIG);
+
+        div = ((pll >> AR91XX_PLL_DIV_SHIFT) & AR91XX_PLL_DIV_MASK);
+        freq = div * AR91XX_BASE_FREQ;
+        
+        u_ar71xx_cpu_freq = freq;
+
+        div = ((pll >> AR91XX_DDR_DIV_SHIFT) & AR91XX_DDR_DIV_MASK) + 1;
+        u_ar71xx_ddr_freq = freq / div;
+        
+        div = (((pll >> AR91XX_AHB_DIV_SHIFT) & AR91XX_AHB_DIV_MASK) + 1) * 2;
+        u_ar71xx_ahb_freq = u_ar71xx_cpu_freq / div;
+}
+
+static void
+ar91xx_chip_device_stop(uint32_t mask)
+{
+        uint32_t reg;
+        
+        reg = ATH_READ_REG(AR91XX_RESET_REG_RESET_MODULE);
+        ATH_WRITE_REG(AR91XX_RESET_REG_RESET_MODULE, reg | mask);
+}
+
+static void
+ar91xx_chip_device_start(uint32_t mask)
+{
+        uint32_t reg;
+        
+        reg = ATH_READ_REG(AR91XX_RESET_REG_RESET_MODULE);
+        ATH_WRITE_REG(AR91XX_RESET_REG_RESET_MODULE, reg & ~mask);
+}
+
+static int
+ar91xx_chip_device_stopped(uint32_t mask)
+{
+        uint32_t reg;
+        
+        reg = ATH_READ_REG(AR91XX_RESET_REG_RESET_MODULE);
+        return ((reg & mask) == mask);
+}
+
+static void
+ar91xx_chip_set_pll_ge0(int speed)
+{
+}
+
+static void
+ar91xx_chip_set_pll_ge1(int speed)
+{
+}
+
+static void
+ar91xx_chip_ddr_flush_ge0(void)
+{
+	ar71xx_ddr_flush(AR91XX_DDR_REG_FLUSH_GE0);
+}
+
+static void
+ar91xx_chip_ddr_flush_ge1(void)
+{
+	ar71xx_ddr_flush(AR91XX_DDR_REG_FLUSH_GE1);
+}
+
+static uint32_t
+ar91xx_chip_get_eth_pll(unsigned int mac, int speed)
+{
+        return 0;
+}
+
+static void
+ar91xx_chip_init_usb_peripheral(void)
+{
+	ar71xx_device_stop(AR91XX_RST_RESET_MODULE_USBSUS_OVERRIDE);
+	DELAY(100);
+
+	ar71xx_device_start(RST_RESET_USB_HOST);
+	DELAY(100);
+
+	ar71xx_device_start(RST_RESET_USB_PHY);
+	DELAY(100);
+}
+
+struct ar71xx_cpu_def ar91xx_chip_def = {
+        &ar91xx_chip_detect_mem_size,
+        &ar91xx_chip_detect_sys_frequency,
+        &ar91xx_chip_device_stop,
+        &ar91xx_chip_device_start,
+        &ar91xx_chip_device_stopped,
+        &ar91xx_chip_set_pll_ge0,
+        &ar91xx_chip_set_pll_ge1,
+        &ar91xx_chip_ddr_flush_ge0,
+        &ar91xx_chip_ddr_flush_ge1,
+        &ar91xx_chip_get_eth_pll,
+	NULL,
+	&ar91xx_chip_init_usb_peripheral,
+};

Added: head/sys/mips/atheros/ar91xx_chip.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/mips/atheros/ar91xx_chip.h	Thu Aug 19 11:40:10 2010	(r211502)
@@ -0,0 +1,34 @@
+/*-
+ * Copyright (c) 2010 Adrian Chadd
+ * 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$ */
+
+#ifndef	__AR91XX_CHIP_H__
+#define	__AR91XX_CHIP_H__
+
+extern struct ar71xx_cpu_def ar91xx_chip_def;
+
+#endif

Modified: head/sys/mips/atheros/files.ar71xx
==============================================================================
--- head/sys/mips/atheros/files.ar71xx	Thu Aug 19 11:31:03 2010	(r211501)
+++ head/sys/mips/atheros/files.ar71xx	Thu Aug 19 11:40:10 2010	(r211502)
@@ -17,3 +17,4 @@ mips/mips/intr_machdep.c        standard
 mips/mips/tick.c		standard
 mips/atheros/ar71xx_setup.c	standard
 mips/atheros/ar71xx_chip.c	standard
+mips/atheros/ar91xx_chip.c	standard

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 11:53:55 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AE29310656A4;
	Thu, 19 Aug 2010 11:53:55 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9C6D08FC17;
	Thu, 19 Aug 2010 11:53:55 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7JBrtaO002986;
	Thu, 19 Aug 2010 11:53:55 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7JBrtbl002979;
	Thu, 19 Aug 2010 11:53:55 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201008191153.o7JBrtbl002979@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 19 Aug 2010 11:53: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: r211503 - head/sys/mips/atheros
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 11:53:55 -0000

Author: adrian
Date: Thu Aug 19 11:53:55 2010
New Revision: 211503
URL: http://svn.freebsd.org/changeset/base/211503

Log:
  Add some initial AR724X chipset support.
  
  This is untested but should at least allow an AR724X to boot.
  
  The current code is lacking the detail needed to expose the PCIe bus.
  It is also lacking any NIC, PLL or flush/WB code.

Added:
  head/sys/mips/atheros/ar724x_chip.c   (contents, props changed)
  head/sys/mips/atheros/ar724x_chip.h   (contents, props changed)
Modified:
  head/sys/mips/atheros/ar71xx_setup.c
  head/sys/mips/atheros/ar71xxreg.h
  head/sys/mips/atheros/ar724xreg.h
  head/sys/mips/atheros/files.ar71xx

Modified: head/sys/mips/atheros/ar71xx_setup.c
==============================================================================
--- head/sys/mips/atheros/ar71xx_setup.c	Thu Aug 19 11:40:10 2010	(r211502)
+++ head/sys/mips/atheros/ar71xx_setup.c	Thu Aug 19 11:53:55 2010	(r211503)
@@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
+#include 
 #include 
 
 #define	AR71XX_SYS_TYPE_LEN		128
@@ -105,6 +106,27 @@ ar71xx_detect_sys_type(void)
 		}
 		break;
 
+	case REV_ID_MAJOR_AR7240:
+		ar71xx_soc = AR71XX_SOC_AR7240;
+		chip = "7240";
+		ar71xx_cpu_ops	= &ar724x_chip_def;
+		rev = (id & AR724X_REV_ID_REVISION_MASK);
+		break;
+
+	case REV_ID_MAJOR_AR7241:
+		ar71xx_soc = AR71XX_SOC_AR7241;
+		chip = "7241";
+		ar71xx_cpu_ops	= &ar724x_chip_def;
+		rev = (id & AR724X_REV_ID_REVISION_MASK);
+		break;
+
+	case REV_ID_MAJOR_AR7242:
+		ar71xx_soc = AR71XX_SOC_AR7242;
+		chip = "7242";
+		ar71xx_cpu_ops	= &ar724x_chip_def;
+		rev = (id & AR724X_REV_ID_REVISION_MASK);
+		break;
+
 	case REV_ID_MAJOR_AR913X:
 		minor = id & AR91XX_REV_ID_MINOR_MASK;
 		rev = id >> AR91XX_REV_ID_REVISION_SHIFT;

Modified: head/sys/mips/atheros/ar71xxreg.h
==============================================================================
--- head/sys/mips/atheros/ar71xxreg.h	Thu Aug 19 11:40:10 2010	(r211502)
+++ head/sys/mips/atheros/ar71xxreg.h	Thu Aug 19 11:53:55 2010	(r211503)
@@ -256,6 +256,9 @@
 #define		AR71XX_REV_ID_REVISION_MASK	0x3
 #define		AR71XX_REV_ID_REVISION_SHIFT	2
 
+/* AR724X chipset revision details */
+#define		AR724X_REV_ID_REVISION_MASK	0x3
+
 /* AR91XX chipset revision details */
 #define		AR91XX_REV_ID_MINOR_MASK	0x3
 #define		AR91XX_REV_ID_MINOR_AR9130	0x0

Added: head/sys/mips/atheros/ar724x_chip.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/mips/atheros/ar724x_chip.c	Thu Aug 19 11:53:55 2010	(r211503)
@@ -0,0 +1,165 @@
+/*-
+ * Copyright (c) 2010 Adrian Chadd
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+
+#include 
+
+#include "opt_ddb.h"
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+ 
+#include 
+#include 
+ 
+#include 
+ 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+ 
+#include 
+#include 
+
+#include 
+#include 
+
+static void
+ar724x_chip_detect_mem_size(void)
+{
+}
+
+static void
+ar724x_chip_detect_sys_frequency(void)
+{
+	uint32_t pll;
+	uint32_t freq;
+	uint32_t div;
+	 
+	pll = ATH_READ_REG(AR724X_PLL_REG_CPU_CONFIG);
+	
+	div = ((pll >> AR724X_PLL_DIV_SHIFT) & AR724X_PLL_DIV_MASK);
+	freq = div * AR724X_BASE_FREQ;
+
+	div = ((pll >> AR724X_PLL_REF_DIV_SHIFT) & AR724X_PLL_REF_DIV_MASK);
+	freq *= div;
+	
+	u_ar71xx_cpu_freq = freq;
+	
+	div = ((pll >> AR724X_DDR_DIV_SHIFT) & AR724X_DDR_DIV_MASK) + 1;
+	u_ar71xx_ddr_freq = freq / div;
+	
+	div = (((pll >> AR724X_AHB_DIV_SHIFT) & AR724X_AHB_DIV_MASK) + 1) * 2;
+	u_ar71xx_ahb_freq = u_ar71xx_cpu_freq / div;
+}
+
+static void
+ar724x_chip_device_stop(uint32_t mask)
+{
+	uint32_t mask_inv, reg;
+
+	mask_inv = mask & AR724X_RESET_MODULE_USB_OHCI_DLL;
+	reg = ATH_READ_REG(AR724X_RESET_REG_RESET_MODULE);
+	reg |= mask;
+	reg &= ~mask_inv;
+	ATH_WRITE_REG(AR724X_RESET_REG_RESET_MODULE, reg);
+}
+
+static void
+ar724x_chip_device_start(uint32_t mask)
+{
+	uint32_t mask_inv, reg;
+
+	mask_inv = mask & AR724X_RESET_MODULE_USB_OHCI_DLL;
+	reg = ATH_READ_REG(AR724X_RESET_REG_RESET_MODULE);
+	reg &= ~mask;
+	reg |= mask_inv;
+	ATH_WRITE_REG(AR724X_RESET_REG_RESET_MODULE, reg);
+}
+
+static int
+ar724x_chip_device_stopped(uint32_t mask)
+{
+	uint32_t reg;
+
+	reg = ATH_READ_REG(AR724X_RESET_REG_RESET_MODULE);
+	return ((reg & mask) == mask);
+}
+
+static void
+ar724x_chip_set_pll_ge0(int speed)
+{
+}
+
+static void
+ar724x_chip_set_pll_ge1(int speed)
+{
+}
+
+static void
+ar724x_chip_ddr_flush_ge0(void)
+{
+}
+
+static void
+ar724x_chip_ddr_flush_ge1(void)
+{
+}
+
+static uint32_t
+ar724x_chip_get_eth_pll(unsigned int mac, int speed)
+{
+        return 0;
+}
+
+struct ar71xx_cpu_def ar724x_chip_def = {
+        &ar724x_chip_detect_mem_size,
+        &ar724x_chip_detect_sys_frequency,
+        &ar724x_chip_device_stop,
+        &ar724x_chip_device_start,
+        &ar724x_chip_device_stopped,
+        &ar724x_chip_set_pll_ge0,
+        &ar724x_chip_set_pll_ge1,
+        &ar724x_chip_ddr_flush_ge0,
+        &ar724x_chip_ddr_flush_ge1,
+        &ar724x_chip_get_eth_pll,
+	NULL,		/* ar71xx_chip_irq_flush_ip2 */
+	NULL		/* ar71xx_chip_init_usb_peripheral */
+};

Added: head/sys/mips/atheros/ar724x_chip.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/mips/atheros/ar724x_chip.h	Thu Aug 19 11:53:55 2010	(r211503)
@@ -0,0 +1,34 @@
+/*-
+ * Copyright (c) 2010 Adrian Chadd
+ * 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$ */
+
+#ifndef	__AR724X_CHIP_H__
+#define	__AR724X_CHIP_H__
+
+extern struct ar71xx_cpu_def ar724x_chip_def;
+
+#endif

Modified: head/sys/mips/atheros/ar724xreg.h
==============================================================================
--- head/sys/mips/atheros/ar724xreg.h	Thu Aug 19 11:40:10 2010	(r211502)
+++ head/sys/mips/atheros/ar724xreg.h	Thu Aug 19 11:53:55 2010	(r211503)
@@ -47,6 +47,9 @@
 
 #define	AR724X_BASE_FREQ		5000000
 
+#define	AR724X_RESET_REG_RESET_MODULE	AR71XX_RST_BLOCK_BASE + 0x1c
+#define	AR724X_RESET_MODULE_USB_OHCI_DLL	(1 << 3)
+
 /* XXX so USB requires different init code? -adrian */
 #define	AR7240_OHCI_BASE		0x1b000000
 #define	AR7240_OHCI_SIZE		0x01000000

Modified: head/sys/mips/atheros/files.ar71xx
==============================================================================
--- head/sys/mips/atheros/files.ar71xx	Thu Aug 19 11:40:10 2010	(r211502)
+++ head/sys/mips/atheros/files.ar71xx	Thu Aug 19 11:53:55 2010	(r211503)
@@ -17,4 +17,5 @@ mips/mips/intr_machdep.c        standard
 mips/mips/tick.c		standard
 mips/atheros/ar71xx_setup.c	standard
 mips/atheros/ar71xx_chip.c	standard
+mips/atheros/ar724x_chip.c	standard
 mips/atheros/ar91xx_chip.c	standard

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 11:55:04 2010
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EE7121065695;
	Thu, 19 Aug 2010 11:55:03 +0000 (UTC) (envelope-from anchie@fer.hr)
Received: from munja.zvne.fer.hr (munja.zvne.fer.hr [161.53.66.248])
	by mx1.freebsd.org (Postfix) with ESMTP id 6DD768FC0C;
	Thu, 19 Aug 2010 11:55:03 +0000 (UTC)
Received: from sluga.fer.hr ([161.53.66.244]) by munja.zvne.fer.hr with
	Microsoft SMTPSVC(6.0.3790.4675); Thu, 19 Aug 2010 13:42:56 +0200
Received: from anchie-MacBook.lan ([93.136.87.252]) by sluga.fer.hr with
	Microsoft SMTPSVC(6.0.3790.4675); Thu, 19 Aug 2010 13:42:55 +0200
Message-ID: <4C6D18BE.2000905@fer.hr>
Date: Thu, 19 Aug 2010 13:42:54 +0200
From: Ana Kukec 
User-Agent: Thunderbird 2.0.0.24 (Macintosh/20100228)
MIME-Version: 1.0
To: Ana Kukec 
References: <201008191131.o7JBV4Yf002412@svn.freebsd.org>
In-Reply-To: <201008191131.o7JBV4Yf002412@svn.freebsd.org>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-OriginalArrivalTime: 19 Aug 2010 11:42:56.0109 (UTC)
	FILETIME=[AA5C01D0:01CB3F93]
Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r211501 - in head/sys: modules modules/send netinet
 netinet6 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, 19 Aug 2010 11:55:04 -0000

Hi all,

A man page for the kernel side SeND, and an updated port with Secure 
Neighbor Discovery application will follow soon.


Ana Kukec wrote:
> Author: anchie
> Date: Thu Aug 19 11:31:03 2010
> New Revision: 211501
> URL: http://svn.freebsd.org/changeset/base/211501
>
> Log:
>   MFp4: anchie_soc2009 branch:
>   
>   Add kernel side support for Secure Neighbor Discovery (SeND), RFC 3971.
>   
>   The implementation consists of a kernel module that gets packets from
>   the nd6 code, sends them to user space on a dedicated socket and reinjects
>   them back for further processing.
>   
>   Hooks are used from nd6 code paths to divert relevant packets to the
>   send implementation for processing in user space.  The hooks are only
>   triggered if the send module is loaded. In case no user space
>   application is connected to the send socket, processing continues
>   normaly as if the module would not be loaded. Unloading the module
>   is not possible at this time due to missing nd6 locking.
>   
>   The native SeND socket is similar to a raw IPv6 socket but with its own,
>   internal pseudo-protocol.
>   
>   Approved by:	bz (mentor)
>
> Added:
>   head/sys/modules/send/
>   head/sys/modules/send/Makefile   (contents, props changed)
>   head/sys/netinet6/send.c   (contents, props changed)
>   head/sys/netinet6/send.h   (contents, props changed)
> Modified:
>   head/sys/modules/Makefile
>   head/sys/netinet/in.h
>   head/sys/netinet6/icmp6.c
>   head/sys/netinet6/nd6.c
>   head/sys/netinet6/nd6_nbr.c
>   head/sys/netinet6/raw_ip6.c
>   head/sys/sys/mbuf.h
>
>   


Ana

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 12:52:50 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 308FE1065694;
	Thu, 19 Aug 2010 12:52:50 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 201F08FC16;
	Thu, 19 Aug 2010 12:52:50 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7JCqnko004423;
	Thu, 19 Aug 2010 12:52:49 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7JCqnBm004421;
	Thu, 19 Aug 2010 12:52:49 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201008191252.o7JCqnBm004421@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 19 Aug 2010 12:52:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r211504 - head/sys/mips/atheros
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 12:52:50 -0000

Author: adrian
Date: Thu Aug 19 12:52:49 2010
New Revision: 211504
URL: http://svn.freebsd.org/changeset/base/211504

Log:
  Fix mistaken indenting.

Modified:
  head/sys/mips/atheros/ar71xx_setup.c

Modified: head/sys/mips/atheros/ar71xx_setup.c
==============================================================================
--- head/sys/mips/atheros/ar71xx_setup.c	Thu Aug 19 11:53:55 2010	(r211503)
+++ head/sys/mips/atheros/ar71xx_setup.c	Thu Aug 19 12:52:49 2010	(r211504)
@@ -87,7 +87,7 @@ ar71xx_detect_sys_type(void)
 		minor = id & AR71XX_REV_ID_MINOR_MASK;
 		rev = id >> AR71XX_REV_ID_REVISION_SHIFT;
 		rev &= AR71XX_REV_ID_REVISION_MASK;
-		ar71xx_cpu_ops	= &ar71xx_chip_def;
+		ar71xx_cpu_ops = &ar71xx_chip_def;
 		switch (minor) {
 		case AR71XX_REV_ID_MINOR_AR7130:
 			ar71xx_soc = AR71XX_SOC_AR7130;
@@ -109,21 +109,21 @@ ar71xx_detect_sys_type(void)
 	case REV_ID_MAJOR_AR7240:
 		ar71xx_soc = AR71XX_SOC_AR7240;
 		chip = "7240";
-		ar71xx_cpu_ops	= &ar724x_chip_def;
+		ar71xx_cpu_ops = &ar724x_chip_def;
 		rev = (id & AR724X_REV_ID_REVISION_MASK);
 		break;
 
 	case REV_ID_MAJOR_AR7241:
 		ar71xx_soc = AR71XX_SOC_AR7241;
 		chip = "7241";
-		ar71xx_cpu_ops	= &ar724x_chip_def;
+		ar71xx_cpu_ops = &ar724x_chip_def;
 		rev = (id & AR724X_REV_ID_REVISION_MASK);
 		break;
 
 	case REV_ID_MAJOR_AR7242:
 		ar71xx_soc = AR71XX_SOC_AR7242;
 		chip = "7242";
-		ar71xx_cpu_ops	= &ar724x_chip_def;
+		ar71xx_cpu_ops = &ar724x_chip_def;
 		rev = (id & AR724X_REV_ID_REVISION_MASK);
 		break;
 
@@ -131,7 +131,7 @@ ar71xx_detect_sys_type(void)
 		minor = id & AR91XX_REV_ID_MINOR_MASK;
 		rev = id >> AR91XX_REV_ID_REVISION_SHIFT;
 		rev &= AR91XX_REV_ID_REVISION_MASK;
-		ar71xx_cpu_ops	= &ar91xx_chip_def;
+		ar71xx_cpu_ops = &ar91xx_chip_def;
 		switch (minor) {
 		case AR91XX_REV_ID_MINOR_AR9130:
 			ar71xx_soc = AR71XX_SOC_AR9130;

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 12:53:08 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7F47D1065696
	for ; Thu, 19 Aug 2010 12:53:08 +0000 (UTC)
	(envelope-from andre@freebsd.org)
Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2])
	by mx1.freebsd.org (Postfix) with ESMTP id E4D288FC23
	for ; Thu, 19 Aug 2010 12:53:07 +0000 (UTC)
Received: (qmail 2440 invoked from network); 19 Aug 2010 12:52:59 -0000
Received: from localhost (HELO [127.0.0.1]) ([127.0.0.1])
	(envelope-sender )
	by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP
	for ; 19 Aug 2010 12:52:59 -0000
Message-ID: <4C6D2933.9020306@freebsd.org>
Date: Thu, 19 Aug 2010 14:53:07 +0200
From: Andre Oppermann 
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
	rv:1.9.1.11) Gecko/20100711 Thunderbird/3.0.6
MIME-Version: 1.0
To: Adrian Chadd 
References: <201008191153.o7JBrtbl002979@svn.freebsd.org>
In-Reply-To: <201008191153.o7JBrtbl002979@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: r211503 - head/sys/mips/atheros
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 12:53:08 -0000

On 19.08.2010 13:53, Adrian Chadd wrote:
> Author: adrian
> Date: Thu Aug 19 11:53:55 2010
> New Revision: 211503
> URL: http://svn.freebsd.org/changeset/base/211503
>
> Log:
>    Add some initial AR724X chipset support.
>
>    This is untested but should at least allow an AR724X to boot.

Isn't this something that should be done on a project branch and
merged back when in a good working state?

>    The current code is lacking the detail needed to expose the PCIe bus.
>    It is also lacking any NIC, PLL or flush/WB code.

-- 
Andre

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 12:59:57 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AC13110656A9;
	Thu, 19 Aug 2010 12:59:57 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8156B8FC0C;
	Thu, 19 Aug 2010 12:59:57 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7JCxvWJ004615;
	Thu, 19 Aug 2010 12:59:57 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7JCxv3i004613;
	Thu, 19 Aug 2010 12:59:57 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201008191259.o7JCxv3i004613@svn.freebsd.org>
From: Rui Paulo 
Date: Thu, 19 Aug 2010 12:59: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: r211505 - head/contrib/gcc
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 12:59:57 -0000

Author: rpaulo
Date: Thu Aug 19 12:59:57 2010
New Revision: 211505
URL: http://svn.freebsd.org/changeset/base/211505

Log:
  Remove unneeded casts in inline assembly in contrib/gcc/longlong.h,
  which are apparently "heinous" GNU extensions, so clang can
  compile this without using the -fheinous-gnu-extensions option.
  
  Results in *no* binary change, neither with clang, nor with gcc.
  
  Submitted by:	Dimitry Andric 

Modified:
  head/contrib/gcc/longlong.h

Modified: head/contrib/gcc/longlong.h
==============================================================================
--- head/contrib/gcc/longlong.h	Thu Aug 19 12:52:49 2010	(r211504)
+++ head/contrib/gcc/longlong.h	Thu Aug 19 12:59:57 2010	(r211505)
@@ -314,38 +314,38 @@ UDItype __umulsidi3 (USItype, USItype);
 #if (defined (__i386__) || defined (__i486__)) && W_TYPE_SIZE == 32
 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
   __asm__ ("addl %5,%1\n\tadcl %3,%0"					\
-	   : "=r" ((USItype) (sh)),					\
-	     "=&r" ((USItype) (sl))					\
-	   : "%0" ((USItype) (ah)),					\
-	     "g" ((USItype) (bh)),					\
-	     "%1" ((USItype) (al)),					\
-	     "g" ((USItype) (bl)))
+	   : "=r" (sh),							\
+	     "=&r" (sl)							\
+	   : "%0" (ah),							\
+	     "g" (bh),							\
+	     "%1" (al),							\
+	     "g" (bl))
 #define sub_ddmmss(sh, sl, ah, al, bh, bl) \
   __asm__ ("subl %5,%1\n\tsbbl %3,%0"					\
-	   : "=r" ((USItype) (sh)),					\
-	     "=&r" ((USItype) (sl))					\
-	   : "0" ((USItype) (ah)),					\
-	     "g" ((USItype) (bh)),					\
-	     "1" ((USItype) (al)),					\
-	     "g" ((USItype) (bl)))
+	   : "=r" (sh),							\
+	     "=&r" (sl)							\
+	   : "0" (ah),							\
+	     "g" (bh),							\
+	     "1" (al),							\
+	     "g" (bl))
 #define umul_ppmm(w1, w0, u, v) \
   __asm__ ("mull %3"							\
-	   : "=a" ((USItype) (w0)),					\
-	     "=d" ((USItype) (w1))					\
-	   : "%0" ((USItype) (u)),					\
-	     "rm" ((USItype) (v)))
+	   : "=a" (w0),							\
+	     "=d" (w1)							\
+	   : "%0" (u),							\
+	     "rm" (v))
 #define udiv_qrnnd(q, r, n1, n0, dv) \
   __asm__ ("divl %4"							\
-	   : "=a" ((USItype) (q)),					\
-	     "=d" ((USItype) (r))					\
-	   : "0" ((USItype) (n0)),					\
-	     "1" ((USItype) (n1)),					\
-	     "rm" ((USItype) (dv)))
+	   : "=a" (q),							\
+	     "=d" (r)							\
+	   : "0" (n0),							\
+	     "1" (n1),							\
+	     "rm" (dv))
 #define count_leading_zeros(count, x) \
   do {									\
     USItype __cbtmp;							\
     __asm__ ("bsrl %1,%0"						\
-	     : "=r" (__cbtmp) : "rm" ((USItype) (x)));			\
+	     : "=r" (__cbtmp) : "rm" (x));				\
     (count) = __cbtmp ^ 31;						\
   } while (0)
 #define count_trailing_zeros(count, x) \

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 13:24:14 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 474921065679;
	Thu, 19 Aug 2010 13:24:14 +0000 (UTC)
	(envelope-from netchild@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 35A418FC1D;
	Thu, 19 Aug 2010 13:24:14 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7JDOECk005223;
	Thu, 19 Aug 2010 13:24:14 GMT
	(envelope-from netchild@svn.freebsd.org)
Received: (from netchild@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7JDOEtY005222;
	Thu, 19 Aug 2010 13:24:14 GMT
	(envelope-from netchild@svn.freebsd.org)
Message-Id: <201008191324.o7JDOEtY005222@svn.freebsd.org>
From: Alexander Leidinger 
Date: Thu, 19 Aug 2010 13:24: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: r211506 - stable/8/etc/periodic/daily
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 13:24:14 -0000

Author: netchild
Date: Thu Aug 19 13:24:13 2010
New Revision: 211506
URL: http://svn.freebsd.org/changeset/base/211506

Log:
  sort of MFC: r211495 was supposed to add this script from HEAD, and while
  the merge seems to have been successful, the script does not show up
  in releng-8. This is a "svn copy head/.../800.zfs-scrub ." as retrying
  the svn merge does not result in the file showing up. This may not be
  the best way to fix the problem in svn, but it is the only way I'm aware of
  to fix the stable branch (which is IMO more important than to use a potential
  best way I'm not aware of).
  
  Relevant commit log for this file (r209195):
    Add a periodic zfs scrub script.
  
    Features:
     - configurable amount of days between scrubs (default value or per pool)
     - do not scrub directly after pool creation (respects the configured
       number of days between scrubs)
     - do not scrub if a scrub is in progress
     - tells how to see the status of the scrub
     - tells how many days since the last scrub if it skips the scrubbing
     - warns if a non-existent pool is specified explicitely
       (default: no pools specified -> all currently imported pools are
       handled)
     - runs late in the periodic run to not slow down the other periodic daily
       scripts

Added:
     - copied unchanged from r211505, head/etc/periodic/daily/800.scrub-zfs
Directory Properties:
  stable/8/etc/periodic/daily/800.scrub-zfs   (props changed)

Copied: stable/8/etc/periodic/daily/800.scrub-zfs (from r211505, head/etc/periodic/daily/800.scrub-zfs)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/etc/periodic/daily/800.scrub-zfs	Thu Aug 19 13:24:13 2010	(r211506, copy of r211505, head/etc/periodic/daily/800.scrub-zfs)
@@ -0,0 +1,86 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# If there is a global system configuration file, suck it in.
+#
+if [ -r /etc/defaults/periodic.conf ]
+then
+    . /etc/defaults/periodic.conf
+    source_periodic_confs
+fi
+
+: ${daily_scrub_zfs_default_threshold=30}
+
+case "$daily_scrub_zfs_enable" in
+    [Yy][Ee][Ss])
+	echo
+	echo 'Scrubbing of zfs pools:'
+
+	if [ -z "${daily_scrub_zfs_pools}" ]; then
+		daily_scrub_zfs_pools="$(zpool list -H -o name)"
+	fi
+
+	for pool in ${daily_scrub_zfs_pools}; do
+		# sanity check
+		zpool list ${pool} >/dev/null 2>&1
+		if [ $? -ne 0 ]; then
+			echo "   WARNING: pool '${pool}' specified in"
+			echo "            '/etc/periodic.conf:daily_scrub_zfs_pools'"
+			echo "            does not exist"
+			continue
+		fi
+
+		# successful only if there is at least one pool to scrub
+		rc=0
+
+		# determine how many days shall be between scrubs
+		eval _pool_threshold=\${daily_scrub_zfs_${pool}_threshold}
+		if [ -z "${_pool_threshold}" ];then
+			_pool_threshold=${daily_scrub_zfs_default_threshold}
+		fi
+
+		_last_scrub=$(zpool history ${pool} | \
+		    egrep "^[0-9\.\:\-]{19} zpool scrub ${pool}\$" | tail -1 |\
+		    cut -d ' ' -f 1)
+		if [ -z "${_last_scrub}" ]; then
+			# creation time of the pool if no scrub was done
+			_last_scrub=$(zpool history ${pool} | \
+			    sed -ne '2s/ .*$//p')
+		fi
+
+		# Now minus last scrub (both in seconds) converted to days.
+		_scrub_diff=$(expr -e \( $(date +%s) - \
+		    $(date -j -f %F.%T ${_last_scrub} +%s) \) / 60 / 60 / 24)
+		if [ ${_scrub_diff} -le ${_pool_threshold} ]; then
+			echo "   skipping scrubbing of pool '${pool}':"
+			echo "      last scrubbing is ${_scrub_diff} days ago, threshold is set to ${_pool_threshold} days"
+			continue
+		fi
+
+		_status="$(zpool status ${pool} | grep scrub:)"
+		case "${_status}" in
+			*"scrub in progress"*)
+				echo "   scrubbing of pool '${pool}' already in progress, skipping:"
+				;;
+			*"none requested"*)
+				echo "   starting first scrubbing (after reboot) of pool '${pool}':"
+				zpool scrub ${pool}
+				;;
+			*)
+				echo "   starting scrubbing of pool '${pool}':"
+				zpool scrub ${pool}
+				;;
+		esac
+
+		echo "      consult 'zpool status ${pool}' for the result"
+	done
+	;;
+
+    *)
+	rc=0
+	;;
+esac
+
+exit $rc

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 13:33:33 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 39DE81065694;
	Thu, 19 Aug 2010 13:33:33 +0000 (UTC)
	(envelope-from alexander@leidinger.net)
Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de
	[217.11.53.44])
	by mx1.freebsd.org (Postfix) with ESMTP id D44EA8FC18;
	Thu, 19 Aug 2010 13:33:32 +0000 (UTC)
Received: from outgoing.leidinger.net (p57B3B444.dip.t-dialin.net
	[87.179.180.68])
	by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id AA8A9844010;
	Thu, 19 Aug 2010 15:17:03 +0200 (CEST)
Received: from webmail.leidinger.net (webmail.leidinger.net [192.168.1.102])
	by outgoing.leidinger.net (Postfix) with ESMTP id 52DAF1335;
	Thu, 19 Aug 2010 15:17:00 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=Leidinger.net;
	s=outgoing-alex; t=1282223820;
	bh=tvfYvDC72MnG7AJRdeBGt2qLVwNcpImlgjjPpX5aQ+A=;
	h=Message-ID:Date:From:To:Cc:Subject:References:In-Reply-To:
	MIME-Version:Content-Type:Content-Transfer-Encoding;
	b=FUawxC1IRuhwfPfr9AyAiCc1mAPqJmLvvqd8M2jA/sw9NXdb9ebgmrAVm0WSLskid
	O8IoIuyqXQvnyY82aar4M8yzo6k1Qcn4XOPh+b9ISElgeTOrCjD+1OEjd9zFgSRECb
	5n/BYMaWINoXMNGlI/DGRBlRwBQTmYmu19w/kfo3BvWCEQkoCZ6pqkpPHP53471ePe
	gDNx81LfYpasdgxFkX1Kke88q/tvAkGwXeKInW3m1AGZYrUw1xu/4oq0MYCTmQsze3
	sf7uVt0+fZmFsxMVwo0U2+hlfozD2G7C3SFR7E134xx9aP0+N8nzbTz33D+ZJPrrMd
	ETkpOTK72o46g==
Received: (from www@localhost)
	by webmail.leidinger.net (8.14.4/8.13.8/Submit) id o7JDH0nm049945;
	Thu, 19 Aug 2010 15:17:00 +0200 (CEST)
	(envelope-from Alexander@Leidinger.net)
Received: from pslux.ec.europa.eu (pslux.ec.europa.eu [158.169.9.14]) by
	webmail.leidinger.net (Horde Framework) with HTTP; Thu, 19 Aug 2010
	15:16:59 +0200
Message-ID: <20100819151659.549969mtfkxo4xkw@webmail.leidinger.net>
Date: Thu, 19 Aug 2010 15:16:59 +0200
From: Alexander Leidinger 
To: Alexander Leidinger 
References: <201008190900.o7J90IKu096259@svn.freebsd.org>
In-Reply-To: <201008190900.o7J90IKu096259@svn.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain;
 charset=UTF-8;
 DelSp="Yes";
 format="flowed"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
User-Agent: Dynamic Internet Messaging Program (DIMP) H3 (1.1.4)
X-EBL-MailScanner-Information: Please contact the ISP for more information
X-EBL-MailScanner-ID: AA8A9844010.A3D4E
X-EBL-MailScanner: Found to be clean
X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN,
	SpamAssassin (not cached, score=-0.946, required 6,
	autolearn=disabled, ALL_TRUSTED -1.00, DKIM_SIGNED 0.10,
	DKIM_VALID -0.10, DKIM_VALID_AU -0.10, TW_SV 0.08, TW_ZF 0.08)
X-EBL-MailScanner-From: alexander@leidinger.net
X-EBL-MailScanner-Watermark: 1282828624.85379@FtRjlOxhrZI/b2zsz+AaKg
X-EBL-Spam-Status: No
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: r211495 - in stable/8: etc/periodic/daily
 share/man/man5 tools/build/mk
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 13:33:33 -0000

Quoting Alexander Leidinger  (from Thu, 19 Aug  
2010 09:00:18 +0000 (UTC)):

> Author: netchild
> Date: Thu Aug 19 09:00:17 2010
> New Revision: 211495
> URL: http://svn.freebsd.org/changeset/base/211495
>
> Log:
>   MFC
>
>   r209195:
>     Add a periodic zfs scrub script.

Somehow the periodic script does not show in the commit. I will have a  
look at this.


> Modified:
>   stable/8/etc/periodic/daily/Makefile
>   stable/8/share/man/man5/periodic.conf.5
>   stable/8/tools/build/mk/OptionalObsoleteFiles.inc
> Directory Properties:
>   stable/8/etc/periodic/daily/   (props changed)
>   stable/8/share/man/man5/   (props changed)
>   stable/8/tools/build/mk/   (props changed)

Bye,
Alexander.

-- 
I only touch base with reality on an as-needed basis!
		-- Royal Floyd Mengot (Klaus)

http://www.Leidinger.net    Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org       netchild @ FreeBSD.org  : PGP ID = 72077137

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 14:36:46 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6637F10656AE;
	Thu, 19 Aug 2010 14:36:46 +0000 (UTC)
	(envelope-from asmrookie@gmail.com)
Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com
	[209.85.216.182])
	by mx1.freebsd.org (Postfix) with ESMTP id A77B18FC14;
	Thu, 19 Aug 2010 14:36:45 +0000 (UTC)
Received: by qyk4 with SMTP id 4so2146570qyk.13
	for ; Thu, 19 Aug 2010 07:36:45 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:sender:received
	:in-reply-to:references:date:x-google-sender-auth:message-id:subject
	:from:to:cc:content-type:content-transfer-encoding;
	bh=tiT1x8qcVSQKPEG8iODP4pM/kaJpIaRAgZrO9CBdn2s=;
	b=aicM4ayg34+VfMgHW41Z6HWl7oehTlLB/706jS7+5HOXur6B02hOZ5zDB4QvTHtKqP
	0fesnZuqT5re1jtJv5maNoPT/uOlELOyPu8bDtzkXvFf8eLmojlWrLzQPSzRdJPRk9qC
	zGZCoVP/435rdCjsr3y4Xe4ZgTyDdeG675ZOw=
DomainKey-Signature: a=rsa-sha1; c=nofws; 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;
	b=j3c9FslzMPCS/CAeGX1DeBAJtkY+jFXocrkpHmYUseEFSmTBhGuSAiVYR66xC3z11I
	p7deLpEGlvH029yB4baSTUZm7iKgWZm1G3wmi3ORDKgjxaJ++6LEeKDOaDHCYoBwA1gT
	qft9nXj/LJy0sSIYk/h3Znt7kdnvqUNXgB/B8=
MIME-Version: 1.0
Received: by 10.229.219.70 with SMTP id ht6mr7375125qcb.105.1282228604820;
	Thu, 19 Aug 2010 07:36:44 -0700 (PDT)
Sender: asmrookie@gmail.com
Received: by 10.229.251.6 with HTTP; Thu, 19 Aug 2010 07:36:44 -0700 (PDT)
In-Reply-To: <86bp924w3w.fsf@ds4.des.no>
References: <201008161132.o7GBWKhx097183@svn.freebsd.org>
	<86mxsm4wff.fsf@ds4.des.no> <86bp924w3w.fsf@ds4.des.no>
Date: Thu, 19 Aug 2010 16:36:44 +0200
X-Google-Sender-Auth: m6tz0U4rZuxo_o-cOaMjt6UqYK4
Message-ID: 
From: Attilio Rao 
To: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= 
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r211393 - 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, 19 Aug 2010 14:36:46 -0000

2010/8/16 Dag-Erling Sm=C3=B8rgrav :
> Dag-Erling Sm=C3=B8rgrav  writes:
>> Note that this commit semi-intentionally introduces another bug: in some
>> cases, the user's limits will not be applied at all. =C2=A0This is by fa=
r the
>> lesser of two evils, and is easy (albeit time-consuming) to fix.
>
> Specifically, each of the files listed below needs to be audited. =C2=A0T=
hose
> that already call setusercontext() with the LOGIN_SETUSER flag set are
> fine. =C2=A0Those that don't need to do so either instead of or shortly a=
fter
> calling setuid().

[snip]

> --
> libexec/ftpd/ftpd.c: =C2=A0 =C2=A0setusercontext(NULL, getpwuid(0), 0,
> libexec/ftpd/ftpd.c- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 LOGIN_SETPRIORITY|LOGIN_SETRESOURCES|LOGIN_SETUMASK|
> libexec/ftpd/ftpd.c- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 LOGIN_SETMAC);
> --
> libexec/ftpd/ftpd.c: =C2=A0 =C2=A0setusercontext(lc, pw, 0,
> libexec/ftpd/ftpd.c- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0LOGIN_SETLO=
GIN|LOGIN_SETGROUP|LOGIN_SETPRIORITY|
> libexec/ftpd/ftpd.c- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0LOGIN_SETRE=
SOURCES|LOGIN_SETUMASK|LOGIN_SETMAC);

It seems to me that ftpd doesn't need any change, do you agree?

Thanks,
Attilio


--=20
Peace can only be achieved by understanding - A. Einstein

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 14:46:12 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 673291065675;
	Thu, 19 Aug 2010 14:46:12 +0000 (UTC) (envelope-from des@des.no)
Received: from smtp.des.no (smtp.des.no [194.63.250.102])
	by mx1.freebsd.org (Postfix) with ESMTP id 25DF58FC0A;
	Thu, 19 Aug 2010 14:46:11 +0000 (UTC)
Received: from ds4.des.no (des.no [84.49.246.2])
	by smtp.des.no (Postfix) with ESMTP id 40F351FFC33;
	Thu, 19 Aug 2010 14:46:11 +0000 (UTC)
Received: by ds4.des.no (Postfix, from userid 1001)
	id 1A87C8454D; Thu, 19 Aug 2010 16:46:11 +0200 (CEST)
From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= 
To: Attilio Rao 
References: <201008161132.o7GBWKhx097183@svn.freebsd.org>
	<86mxsm4wff.fsf@ds4.des.no> <86bp924w3w.fsf@ds4.des.no>
	
Date: Thu, 19 Aug 2010 16:46:11 +0200
In-Reply-To: 
	(Attilio Rao's message of "Thu, 19 Aug 2010 16:36:44 +0200")
Message-ID: <8662z6r77w.fsf@ds4.des.no>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r211393 - 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, 19 Aug 2010 14:46:12 -0000

Attilio Rao  writes:
> It seems to me that ftpd doesn't need any change, do you agree?

Hmm, it never calls setuid(), but it does call seteuid() before
setusercontext().  Perhaps the test in setusercontext() should be
changed to use geteuid() instead of getuid().

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 14:51:39 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id ECBE21065673;
	Thu, 19 Aug 2010 14:51:39 +0000 (UTC)
	(envelope-from asmrookie@gmail.com)
Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com
	[209.85.216.54])
	by mx1.freebsd.org (Postfix) with ESMTP id 722538FC18;
	Thu, 19 Aug 2010 14:51:39 +0000 (UTC)
Received: by qwg5 with SMTP id 5so2026782qwg.13
	for ; Thu, 19 Aug 2010 07:51:38 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:sender:received
	:in-reply-to:references:date:x-google-sender-auth:message-id:subject
	:from:to:cc:content-type:content-transfer-encoding;
	bh=XvUsSuZ2XHstwfX220r3SqCle4OGvHMyFrKgdyRqSHM=;
	b=Eo3B5e8wiVsjZ3P9At/LqRh56aCgjlgAmTHh56J6YpnrNaZ4SpyUIc1Vu3rKUa/4EW
	N+yIwECToTOtKSPOmnHN08V5+5TQNVY4dVwIaekV6bLblDP1I5HaGHD+9xR3NAKhuW1Q
	hKHpdSHpu8zsXIEbm6sdSsKFHK0cej4D0Y7v4=
DomainKey-Signature: a=rsa-sha1; c=nofws; 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;
	b=CBkhlmpMWrF4Vpt4/G7RSyPHCmLhCdqZDlG6LA/Q3uU+WUkxvrSSZHO2wBb9EqM5s+
	yk1nKSZWxbhaNuRCj4xtDqVIs++gijg9FJKgqEc1QOCuXjGnKGxiNUaYm13sK72o+wgF
	ZnilqcLPJI7OJdvJr6w3a869x7lkKLT5PmPxM=
MIME-Version: 1.0
Received: by 10.229.227.210 with SMTP id jb18mr7400986qcb.93.1282229497809;
	Thu, 19 Aug 2010 07:51:37 -0700 (PDT)
Sender: asmrookie@gmail.com
Received: by 10.229.251.6 with HTTP; Thu, 19 Aug 2010 07:51:37 -0700 (PDT)
In-Reply-To: <8662z6r77w.fsf@ds4.des.no>
References: <201008161132.o7GBWKhx097183@svn.freebsd.org>
	<86mxsm4wff.fsf@ds4.des.no> <86bp924w3w.fsf@ds4.des.no>
	
	<8662z6r77w.fsf@ds4.des.no>
Date: Thu, 19 Aug 2010 16:51:37 +0200
X-Google-Sender-Auth: iSEprwKMxoC0vUMW3B3h5nfUTSc
Message-ID: 
From: Attilio Rao 
To: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= 
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r211393 - 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, 19 Aug 2010 14:51:40 -0000

2010/8/19 Dag-Erling Sm=C3=B8rgrav :
> Attilio Rao  writes:
>> It seems to me that ftpd doesn't need any change, do you agree?
>
> Hmm, it never calls setuid(), but it does call seteuid() before
> setusercontext(). =C2=A0Perhaps the test in setusercontext() should be
> changed to use geteuid() instead of getuid().

Yes, I think that it probabilly makes more sense (geteuid() testing in
setusercontext()).

Thanks,
Attilio


--=20
Peace can only be achieved by understanding - A. Einstein

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 15:33:44 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 08F591065673;
	Thu, 19 Aug 2010 15:33:44 +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 EC0A88FC1E;
	Thu, 19 Aug 2010 15:33:43 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7JFXh1k008119;
	Thu, 19 Aug 2010 15:33:43 GMT (envelope-from jh@svn.freebsd.org)
Received: (from jh@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7JFXhrk008115;
	Thu, 19 Aug 2010 15:33:43 GMT (envelope-from jh@svn.freebsd.org)
Message-Id: <201008191533.o7JFXhrk008115@svn.freebsd.org>
From: Jaakko Heinonen 
Date: Thu, 19 Aug 2010 15:33: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: r211507 - stable/8/sys/fs/devfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 15:33:44 -0000

Author: jh
Date: Thu Aug 19 15:33:43 2010
New Revision: 211507
URL: http://svn.freebsd.org/changeset/base/211507

Log:
  MFC r208951:
  
  Add a new function devfs_parent_dirent() for resolving devfs parent
  directory entry. Use the new function in devfs_fqpn(), devfs_lookupx()
  and devfs_vptocnp() instead of manually resolving the parent entry.

Modified:
  stable/8/sys/fs/devfs/devfs.h
  stable/8/sys/fs/devfs/devfs_devs.c
  stable/8/sys/fs/devfs/devfs_vnops.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cam/   (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/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/fs/devfs/devfs.h
==============================================================================
--- stable/8/sys/fs/devfs/devfs.h	Thu Aug 19 13:24:13 2010	(r211506)
+++ stable/8/sys/fs/devfs/devfs.h	Thu Aug 19 15:33:43 2010	(r211507)
@@ -180,6 +180,7 @@ void devfs_populate (struct devfs_mount 
 void devfs_cleanup (struct devfs_mount *dm);
 void devfs_unmount_final(struct devfs_mount *mp);
 struct devfs_dirent *devfs_newdirent (char *name, int namelen);
+struct devfs_dirent *devfs_parent_dirent(struct devfs_dirent *de);
 struct devfs_dirent *devfs_vmkdir (struct devfs_mount *, char *name, int namelen, struct devfs_dirent *dotdot, u_int inode);
 struct devfs_dirent *devfs_find (struct devfs_dirent *dd, const char *name, int namelen);
 

Modified: stable/8/sys/fs/devfs/devfs_devs.c
==============================================================================
--- stable/8/sys/fs/devfs/devfs_devs.c	Thu Aug 19 13:24:13 2010	(r211506)
+++ stable/8/sys/fs/devfs/devfs_devs.c	Thu Aug 19 15:33:43 2010	(r211507)
@@ -195,6 +195,26 @@ devfs_newdirent(char *name, int namelen)
 }
 
 struct devfs_dirent *
+devfs_parent_dirent(struct devfs_dirent *de)
+{
+
+	if (de->de_dirent->d_type != DT_DIR)
+		return (de->de_dir);
+
+	if (de->de_flags & (DE_DOT | DE_DOTDOT))
+		return (NULL);
+
+	de = TAILQ_FIRST(&de->de_dlist);	/* "." */
+	if (de == NULL)
+		return (NULL);
+	de = TAILQ_NEXT(de, de_list);		/* ".." */
+	if (de == NULL)
+		return (NULL);
+
+	return (de->de_dir);
+}
+
+struct devfs_dirent *
 devfs_vmkdir(struct devfs_mount *dmp, char *name, int namelen, struct devfs_dirent *dotdot, u_int inode)
 {
 	struct devfs_dirent *dd;

Modified: stable/8/sys/fs/devfs/devfs_vnops.c
==============================================================================
--- stable/8/sys/fs/devfs/devfs_vnops.c	Thu Aug 19 13:24:13 2010	(r211506)
+++ stable/8/sys/fs/devfs/devfs_vnops.c	Thu Aug 19 15:33:43 2010	(r211507)
@@ -230,9 +230,11 @@ devfs_vptocnp(struct vop_vptocnp_args *a
 		goto finished;
 	}
 	*buflen = i;
-	de = TAILQ_FIRST(&de->de_dlist);	/* "." */
-	de = TAILQ_NEXT(de, de_list);		/* ".." */
-	de = de->de_dir;
+	de = devfs_parent_dirent(de);
+	if (de == NULL) {
+		error = ENOENT;
+		goto finished;
+	}
 	mtx_lock(&devfs_de_interlock);
 	*dvp = de->de_vnode;
 	if (*dvp != NULL) {
@@ -278,9 +280,9 @@ devfs_fqpn(char *buf, struct vnode *dvp,
 			 return (NULL);
 		bcopy(de->de_dirent->d_name, buf + i,
 		    de->de_dirent->d_namlen);
-		de = TAILQ_FIRST(&de->de_dlist);	/* "." */
-		de = TAILQ_NEXT(de, de_list);		/* ".." */
-		de = de->de_dir;
+		de = devfs_parent_dirent(de);
+		if (de == NULL)
+			return (NULL);
 	}
 	return (buf + i);
 }
@@ -778,10 +780,10 @@ devfs_lookupx(struct vop_lookup_args *ap
 	if (flags & ISDOTDOT) {
 		if ((flags & ISLASTCN) && nameiop != LOOKUP)
 			return (EINVAL);
+		de = devfs_parent_dirent(dd);
+		if (de == NULL)
+			return (ENOENT);
 		VOP_UNLOCK(dvp, 0);
-		de = TAILQ_FIRST(&dd->de_dlist);	/* "." */
-		de = TAILQ_NEXT(de, de_list);		/* ".." */
-		de = de->de_dir;
 		error = devfs_allocv(de, dvp->v_mount, vpp);
 		*dm_unlock = 0;
 		vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY);

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 15:55:51 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 42F2710656AA;
	Thu, 19 Aug 2010 15:55:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 330C58FC08;
	Thu, 19 Aug 2010 15:55:51 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7JFtpso008699;
	Thu, 19 Aug 2010 15:55:51 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7JFtpEI008697;
	Thu, 19 Aug 2010 15:55:51 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201008191555.o7JFtpEI008697@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 19 Aug 2010 15:55: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: r211508 - head/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, 19 Aug 2010 15:55:51 -0000

Author: jhb
Date: Thu Aug 19 15:55:50 2010
New Revision: 211508
URL: http://svn.freebsd.org/changeset/base/211508

Log:
  Remove an unused macro.  exit1() invokes ktrprocexit() directly.

Modified:
  head/sys/sys/ktrace.h

Modified: head/sys/sys/ktrace.h
==============================================================================
--- head/sys/sys/ktrace.h	Thu Aug 19 15:33:43 2010	(r211507)
+++ head/sys/sys/ktrace.h	Thu Aug 19 15:55:50 2010	(r211508)
@@ -73,10 +73,6 @@ struct ktr_header {
 	if (KTRCHECKDRAIN(td))						\
 		ktruserret(td);						\
 } while (0)
-#define	KTRPROCEXIT(td) do {						\
-	if (KTRCHECKDRAIN(td))						\
-		ktrprocexit(td);					\
-} while (0)
 
 /*
  * ktrace record types

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 16:15:31 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3B72210656A6;
	Thu, 19 Aug 2010 16:15:31 +0000 (UTC)
	(envelope-from adrian@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 2B4AF8FC14;
	Thu, 19 Aug 2010 16:15:31 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7JGFVDs009206;
	Thu, 19 Aug 2010 16:15:31 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7JGFVIA009204;
	Thu, 19 Aug 2010 16:15:31 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201008191615.o7JGFVIA009204@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 19 Aug 2010 16:15: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: r211509 - head/sys/mips/atheros
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 16:15:31 -0000

Author: adrian
Date: Thu Aug 19 16:15:30 2010
New Revision: 211509
URL: http://svn.freebsd.org/changeset/base/211509

Log:
  add the PLL set functions to cpuops

Modified:
  head/sys/mips/atheros/ar71xx_cpudef.h

Modified: head/sys/mips/atheros/ar71xx_cpudef.h
==============================================================================
--- head/sys/mips/atheros/ar71xx_cpudef.h	Thu Aug 19 15:55:50 2010	(r211508)
+++ head/sys/mips/atheros/ar71xx_cpudef.h	Thu Aug 19 16:15:30 2010	(r211509)
@@ -81,6 +81,16 @@ static inline int ar71xx_device_stopped(
 	return ar71xx_cpu_ops->ar71xx_chip_device_stopped(mask);
 }
 
+static inline void ar71xx_device_set_pll_ge0(int speed)
+{
+	ar71xx_cpu_ops->ar71xx_chip_set_pll_ge0(speed);
+}
+
+static inline void ar71xx_device_set_pll_ge1(int speed)
+{
+	ar71xx_cpu_ops->ar71xx_chip_set_pll_ge1(speed);
+}
+
 static inline void ar71xx_device_flush_ddr_ge0(void)
 {
 	ar71xx_cpu_ops->ar71xx_chip_ddr_flush_ge0();

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 16:25:15 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CB6AA10656A3;
	Thu, 19 Aug 2010 16:25:15 +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 BAEB18FC18;
	Thu, 19 Aug 2010 16:25:15 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7JGPFvZ009459;
	Thu, 19 Aug 2010 16:25:15 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7JGPFph009455;
	Thu, 19 Aug 2010 16:25:15 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201008191625.o7JGPFph009455@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 19 Aug 2010 16: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: r211510 - head/sys/mips/atheros
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 16:25:15 -0000

Author: adrian
Date: Thu Aug 19 16:25:15 2010
New Revision: 211510
URL: http://svn.freebsd.org/changeset/base/211510

Log:
  Implement PLL generalisation in preparation for use in if_arge.
  
  * Add a function to write to the relevant PLL register
  * Break out the PLL configuration for the AR71XX into the CPU ops,
    lifted from if_arge.c.
  * Add the AR91XX PLL configuration ops, using the AR91XX register
    definitions.

Modified:
  head/sys/mips/atheros/ar71xx_chip.c
  head/sys/mips/atheros/ar71xxreg.h
  head/sys/mips/atheros/ar91xx_chip.c

Modified: head/sys/mips/atheros/ar71xx_chip.c
==============================================================================
--- head/sys/mips/atheros/ar71xx_chip.c	Thu Aug 19 16:15:30 2010	(r211509)
+++ head/sys/mips/atheros/ar71xx_chip.c	Thu Aug 19 16:25:15 2010	(r211510)
@@ -77,9 +77,6 @@ __FBSDID("$FreeBSD$");
 #define AR71XX_AHB_DIV_SHIFT            20
 #define AR71XX_AHB_DIV_MASK             0x7
 
-#define AR71XX_ETH0_PLL_SHIFT           17
-#define AR71XX_ETH1_PLL_SHIFT           19
-
 /* XXX these shouldn't be in here - this file is a per-chip file */
 /* XXX these should be in the top-level ar71xx type, not ar71xx -chip */
 uint32_t u_ar71xx_cpu_freq;
@@ -143,14 +140,51 @@ ar71xx_chip_device_stopped(uint32_t mask
         return ((reg & mask) == mask);
 }
 
+/* Speed is either 10, 100 or 1000 */
 static void
 ar71xx_chip_set_pll_ge0(int speed)
 {
+	uint32_t pll;
+
+	switch(speed) {
+		case 10:
+			pll = PLL_ETH_INT_CLK_10;
+			break;
+		case 100:
+			pll = PLL_ETH_INT_CLK_100;
+			break;
+		case 1000:
+			pll = PLL_ETH_INT_CLK_1000;
+			break;
+		default:
+			printf("ar71xx_chip_set_pll_ge0: invalid speed %d\n", speed);
+			return;
+	}
+
+	ar71xx_write_pll(AR71XX_PLL_SEC_CONFIG, AR71XX_PLL_ETH_INT0_CLK, pll, AR71XX_PLL_ETH0_SHIFT);
 }
 
 static void
 ar71xx_chip_set_pll_ge1(int speed)
 {
+	uint32_t pll;
+
+	switch(speed) {
+		case 10:
+			pll = PLL_ETH_INT_CLK_10;
+			break;
+		case 100:
+			pll = PLL_ETH_INT_CLK_100;
+			break;
+		case 1000:
+			pll = PLL_ETH_INT_CLK_1000;
+			break;
+		default:
+			printf("ar71xx_chip_set_pll_ge1: invalid speed %d\n", speed);
+			return;
+	}
+
+	ar71xx_write_pll(AR71XX_PLL_SEC_CONFIG, AR71XX_PLL_ETH_INT1_CLK, pll, AR71XX_PLL_ETH1_SHIFT);
 }
 
 static void

Modified: head/sys/mips/atheros/ar71xxreg.h
==============================================================================
--- head/sys/mips/atheros/ar71xxreg.h	Thu Aug 19 16:15:30 2010	(r211509)
+++ head/sys/mips/atheros/ar71xxreg.h	Thu Aug 19 16:25:15 2010	(r211510)
@@ -182,6 +182,8 @@
 #define		PLL_BYPASS			(1 << 1)
 #define		PLL_POWER_DOWN			(1 << 0)
 #define	AR71XX_PLL_SEC_CONFIG		0x18050004
+#define		AR71XX_PLL_ETH0_SHIFT		17
+#define		AR71XX_PLL_ETH1_SHIFT		19
 #define	AR71XX_PLL_CPU_CLK_CTRL		0x18050008
 #define	AR71XX_PLL_ETH_INT0_CLK		0x18050010
 #define	AR71XX_PLL_ETH_INT1_CLK		0x18050014
@@ -501,4 +503,27 @@ ar71xx_ddr_flush(uint32_t reg)
 		;
 } 
 
+static inline void
+ar71xx_write_pll(uint32_t cfg_reg, uint32_t pll_reg, uint32_t pll, uint32_t pll_reg_shift)
+{
+	uint32_t sec_cfg;
+
+	/* set PLL registers */
+	sec_cfg = ATH_READ_REG(cfg_reg);
+	sec_cfg &= ~(3 << pll_reg_shift);
+	sec_cfg |= (2 << pll_reg_shift);
+
+	ATH_WRITE_REG(cfg_reg, sec_cfg);
+	DELAY(100);
+
+	ATH_WRITE_REG(pll_reg, pll);
+	sec_cfg |= (3 << pll_reg_shift);
+	ATH_WRITE_REG(cfg_reg, sec_cfg);
+	DELAY(100);
+
+	sec_cfg &= ~(3 << pll_reg_shift);
+	ATH_WRITE_REG(cfg_reg, sec_cfg);
+	DELAY(100);
+}
+
 #endif /* _AR71XX_REG_H_ */

Modified: head/sys/mips/atheros/ar91xx_chip.c
==============================================================================
--- head/sys/mips/atheros/ar91xx_chip.c	Thu Aug 19 16:15:30 2010	(r211509)
+++ head/sys/mips/atheros/ar91xx_chip.c	Thu Aug 19 16:25:15 2010	(r211510)
@@ -117,11 +117,45 @@ ar91xx_chip_device_stopped(uint32_t mask
 static void
 ar91xx_chip_set_pll_ge0(int speed)
 {
+	uint32_t pll;
+
+	switch(speed) {
+		case 10:
+			pll = AR91XX_PLL_VAL_10;
+			break;
+		case 100:
+			pll = AR91XX_PLL_VAL_100;
+			break;
+		case 1000:
+			pll = AR91XX_PLL_VAL_1000;
+			break;
+		default:
+			printf("ar91xx_chip_set_pll_ge0: invalid speed %d\n", speed);
+			return;
+	}
+	ar71xx_write_pll(AR91XX_PLL_REG_ETH_CONFIG, AR91XX_PLL_REG_ETH0_INT_CLOCK, pll, AR91XX_ETH0_PLL_SHIFT);
 }
 
 static void
 ar91xx_chip_set_pll_ge1(int speed)
 {
+	uint32_t pll;
+
+	switch(speed) {
+		case 10:
+			pll = AR91XX_PLL_VAL_10;
+			break;
+		case 100:
+			pll = AR91XX_PLL_VAL_100;
+			break;
+		case 1000:
+			pll = AR91XX_PLL_VAL_1000;
+			break;
+		default:
+			printf("ar91xx_chip_set_pll_ge0: invalid speed %d\n", speed);
+			return;
+	}
+	ar71xx_write_pll(AR91XX_PLL_REG_ETH_CONFIG, AR91XX_PLL_REG_ETH1_INT_CLOCK, pll, AR91XX_ETH1_PLL_SHIFT);
 }
 
 static void

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 16:29:09 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0C51810656AC;
	Thu, 19 Aug 2010 16:29: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 E4CB78FC1C;
	Thu, 19 Aug 2010 16:29:08 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7JGT89e009580;
	Thu, 19 Aug 2010 16:29:08 GMT (envelope-from adrian@svn.freebsd.org)
Received: (from adrian@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7JGT86G009577;
	Thu, 19 Aug 2010 16:29:08 GMT (envelope-from adrian@svn.freebsd.org)
Message-Id: <201008191629.o7JGT86G009577@svn.freebsd.org>
From: Adrian Chadd 
Date: Thu, 19 Aug 2010 16:29: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: r211511 - head/sys/mips/atheros
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 16:29:09 -0000

Author: adrian
Date: Thu Aug 19 16:29:08 2010
New Revision: 211511
URL: http://svn.freebsd.org/changeset/base/211511

Log:
  Migrate if_arge to use the PLL cpuops.
  
  This has been lightly tested on the AR7161 and AR9132.

Modified:
  head/sys/mips/atheros/if_arge.c
  head/sys/mips/atheros/if_argevar.h

Modified: head/sys/mips/atheros/if_arge.c
==============================================================================
--- head/sys/mips/atheros/if_arge.c	Thu Aug 19 16:25:15 2010	(r211510)
+++ head/sys/mips/atheros/if_arge.c	Thu Aug 19 16:29:08 2010	(r211511)
@@ -233,13 +233,6 @@ arge_attach(device_t dev)
 
 	KASSERT(((sc->arge_mac_unit == 0) || (sc->arge_mac_unit == 1)), 
 	    ("if_arge: Only MAC0 and MAC1 supported"));
-	if (sc->arge_mac_unit == 0) {
-		sc->arge_pll_reg = AR71XX_PLL_ETH_INT0_CLK;
-		sc->arge_pll_reg_shift = 17;
-	} else {
-		sc->arge_pll_reg = AR71XX_PLL_ETH_INT1_CLK;
-		sc->arge_pll_reg_shift = 19;
-	}
 
 	/*
 	 *  Get which PHY of 5 available we should use for this unit
@@ -668,7 +661,8 @@ arge_link_task(void *arg, int pending)
 static void
 arge_set_pll(struct arge_softc *sc, int media, int duplex)
 {
-	uint32_t		cfg, ifcontrol, rx_filtmask, pll, sec_cfg;
+	uint32_t		cfg, ifcontrol, rx_filtmask;
+	int if_speed;
 
 	cfg = ARGE_READ(sc, AR71XX_MAC_CFG2);
 	cfg &= ~(MAC_CFG2_IFACE_MODE_1000 
@@ -687,21 +681,21 @@ arge_set_pll(struct arge_softc *sc, int 
 	switch(media) {
 	case IFM_10_T:
 		cfg |= MAC_CFG2_IFACE_MODE_10_100;
-		pll = PLL_ETH_INT_CLK_10;
+		if_speed = 10;
 		break;
 	case IFM_100_TX:
 		cfg |= MAC_CFG2_IFACE_MODE_10_100;
 		ifcontrol |= MAC_IFCONTROL_SPEED;
-		pll = PLL_ETH_INT_CLK_100;
+		if_speed = 100;
 		break;
 	case IFM_1000_T:
 	case IFM_1000_SX:
 		cfg |= MAC_CFG2_IFACE_MODE_1000;
 		rx_filtmask |= FIFO_RX_MASK_BYTE_MODE;
-		pll = PLL_ETH_INT_CLK_1000;
+		if_speed = 1000;
 		break;
 	default:
-		pll = PLL_ETH_INT_CLK_100;
+		if_speed = 100;
 		device_printf(sc->arge_dev, 
 		    "Unknown media %d\n", media);
 	}
@@ -715,22 +709,10 @@ arge_set_pll(struct arge_softc *sc, int 
 	    rx_filtmask);
 
 	/* set PLL registers */
-	sec_cfg = ATH_READ_REG(AR71XX_PLL_SEC_CONFIG);
-	sec_cfg &= ~(3 << sc->arge_pll_reg_shift);
-	sec_cfg |= (2 << sc->arge_pll_reg_shift);
-
-	ATH_WRITE_REG(AR71XX_PLL_SEC_CONFIG, sec_cfg);
-	DELAY(100);
-
-	ATH_WRITE_REG(sc->arge_pll_reg, pll);
-
-	sec_cfg |= (3 << sc->arge_pll_reg_shift);
-	ATH_WRITE_REG(AR71XX_PLL_SEC_CONFIG, sec_cfg);
-	DELAY(100);
-
-	sec_cfg &= ~(3 << sc->arge_pll_reg_shift);
-	ATH_WRITE_REG(AR71XX_PLL_SEC_CONFIG, sec_cfg);
-	DELAY(100);
+	if (sc->arge_mac_unit == 0)
+		ar71xx_device_set_pll_ge0(if_speed);
+	else
+		ar71xx_device_set_pll_ge1(if_speed);
 }
 
 

Modified: head/sys/mips/atheros/if_argevar.h
==============================================================================
--- head/sys/mips/atheros/if_argevar.h	Thu Aug 19 16:25:15 2010	(r211510)
+++ head/sys/mips/atheros/if_argevar.h	Thu Aug 19 16:29:08 2010	(r211511)
@@ -150,8 +150,6 @@ struct arge_softc {
 	uint32_t		arge_intr_status;
 	int			arge_mac_unit;
 	int			arge_phymask;
-	uint32_t		arge_pll_reg;
-	uint32_t		arge_pll_reg_shift;
 	int			arge_if_flags;
 	uint32_t		arge_debug;
 	struct {

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 16:38:58 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DAC83106564A;
	Thu, 19 Aug 2010 16:38: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 CB0988FC1A;
	Thu, 19 Aug 2010 16:38:58 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7JGcwIJ009827;
	Thu, 19 Aug 2010 16:38:58 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7JGcwbf009825;
	Thu, 19 Aug 2010 16:38:58 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201008191638.o7JGcwbf009825@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 19 Aug 2010 16:38: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: r211512 - 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: Thu, 19 Aug 2010 16:38:58 -0000

Author: jhb
Date: Thu Aug 19 16:38:58 2010
New Revision: 211512
URL: http://svn.freebsd.org/changeset/base/211512

Log:
  Fix a whitespace nit and remove a questioning comment.  STAILQ_CONCAT()
  does require the STAILQ the existing list is being added to to already
  be initialized (it is CONCAT() vs MOVE()).

Modified:
  head/sys/kern/kern_ktrace.c

Modified: head/sys/kern/kern_ktrace.c
==============================================================================
--- head/sys/kern/kern_ktrace.c	Thu Aug 19 16:29:08 2010	(r211511)
+++ head/sys/kern/kern_ktrace.c	Thu Aug 19 16:38:58 2010	(r211512)
@@ -107,7 +107,7 @@ static int data_lengths[] = {
 	0,					/* KTR_NAMEI */
 	sizeof(struct ktr_genio),		/* KTR_GENIO */
 	sizeof(struct ktr_psig),		/* KTR_PSIG */
-	sizeof(struct ktr_csw),			/* KTR_CSW */
+	sizeof(struct ktr_csw),		/* KTR_CSW */
 	0,					/* KTR_USER */
 	0,					/* KTR_STRUCT */
 	0,					/* KTR_SYSCTL */
@@ -336,7 +336,7 @@ ktr_drain(struct thread *td)
 	ktrace_assert(td);
 	sx_assert(&ktrace_sx, SX_XLOCKED);
 
-	STAILQ_INIT(&local_queue);	/* XXXRW: needed? */
+	STAILQ_INIT(&local_queue);
 
 	if (!STAILQ_EMPTY(&td->td_proc->p_ktr)) {
 		mtx_lock(&ktrace_mtx);

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 16:39:00 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DC123106567A;
	Thu, 19 Aug 2010 16:39:00 +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 B7AC58FC29;
	Thu, 19 Aug 2010 16:39:00 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7JGd0C1009862;
	Thu, 19 Aug 2010 16:39:00 GMT (envelope-from jh@svn.freebsd.org)
Received: (from jh@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7JGd0jT009860;
	Thu, 19 Aug 2010 16:39:00 GMT (envelope-from jh@svn.freebsd.org)
Message-Id: <201008191639.o7JGd0jT009860@svn.freebsd.org>
From: Jaakko Heinonen 
Date: Thu, 19 Aug 2010 16:39: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: r211513 - head/sys/fs/devfs
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 16:39:01 -0000

Author: jh
Date: Thu Aug 19 16:39:00 2010
New Revision: 211513
URL: http://svn.freebsd.org/changeset/base/211513

Log:
  Call dev_rel() in error paths.
  
  Reported by:	kib
  Reviewed by:	kib
  MFC after:	2 weeks

Modified:
  head/sys/fs/devfs/devfs_vnops.c

Modified: head/sys/fs/devfs/devfs_vnops.c
==============================================================================
--- head/sys/fs/devfs/devfs_vnops.c	Thu Aug 19 16:38:58 2010	(r211512)
+++ head/sys/fs/devfs/devfs_vnops.c	Thu Aug 19 16:39:00 2010	(r211513)
@@ -848,6 +848,8 @@ devfs_lookupx(struct vop_lookup_args *ap
 			*dm_unlock = 0;
 			sx_xunlock(&dmp->dm_lock);
 			devfs_unmount_final(dmp);
+			if (cdev != NULL)
+				dev_rel(cdev);
 			return (ENOENT);
 		}
 		if (cdev == NULL)
@@ -859,6 +861,7 @@ devfs_lookupx(struct vop_lookup_args *ap
 			*dm_unlock = 0;
 			sx_xunlock(&dmp->dm_lock);
 			devfs_unmount_final(dmp);
+			dev_rel(cdev);
 			return (ENOENT);
 		}
 

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 16:40:31 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3CF2C106566B;
	Thu, 19 Aug 2010 16:40: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 2D4258FC13;
	Thu, 19 Aug 2010 16:40:31 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7JGeVDR009941;
	Thu, 19 Aug 2010 16:40:31 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7JGeV51009939;
	Thu, 19 Aug 2010 16:40:31 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201008191640.o7JGeV51009939@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 19 Aug 2010 16:40: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: r211514 - 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: Thu, 19 Aug 2010 16:40:31 -0000

Author: jhb
Date: Thu Aug 19 16:40:30 2010
New Revision: 211514
URL: http://svn.freebsd.org/changeset/base/211514

Log:
  There isn't really a need to hold the ktrace mutex just to read the value
  of p_traceflag that is stored in the kinfo_proc structure.  It is still
  racey even with the lock and the code will read a consistent snapshot of
  the flag without the lock.

Modified:
  head/sys/kern/kern_proc.c

Modified: head/sys/kern/kern_proc.c
==============================================================================
--- head/sys/kern/kern_proc.c	Thu Aug 19 16:39:00 2010	(r211513)
+++ head/sys/kern/kern_proc.c	Thu Aug 19 16:40:30 2010	(r211514)
@@ -64,10 +64,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#ifdef KTRACE
-#include 
-#include 
-#endif
 
 #ifdef DDB
 #include 
@@ -717,9 +713,7 @@ fill_kinfo_proc_only(struct proc *p, str
 	kp->ki_textvp = p->p_textvp;
 #ifdef KTRACE
 	kp->ki_tracep = p->p_tracevp;
-	mtx_lock(&ktrace_mtx);
 	kp->ki_traceflag = p->p_traceflag;
-	mtx_unlock(&ktrace_mtx);
 #endif
 	kp->ki_fd = p->p_fd;
 	kp->ki_vmspace = p->p_vmspace;

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 16:41:28 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4E0271065673;
	Thu, 19 Aug 2010 16:41: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 3BDFE8FC17;
	Thu, 19 Aug 2010 16:41:28 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7JGfSZw010023;
	Thu, 19 Aug 2010 16:41:28 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7JGfS6v010013;
	Thu, 19 Aug 2010 16:41:28 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201008191641.o7JGfS6v010013@svn.freebsd.org>
From: John Baldwin 
Date: Thu, 19 Aug 2010 16:41: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: r211515 - in head/sys: amd64/amd64 amd64/ia32 i386/i386
	ia64/ia64 kern powerpc/aim powerpc/booke sparc64/sparc64 sun4v/sun4v
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 16:41:28 -0000

Author: jhb
Date: Thu Aug 19 16:41:27 2010
New Revision: 211515
URL: http://svn.freebsd.org/changeset/base/211515

Log:
  Remove unused KTRACE includes.

Modified:
  head/sys/amd64/amd64/trap.c
  head/sys/amd64/ia32/ia32_syscall.c
  head/sys/i386/i386/trap.c
  head/sys/ia64/ia64/trap.c
  head/sys/kern/sched_ule.c
  head/sys/powerpc/aim/trap.c
  head/sys/powerpc/booke/trap.c
  head/sys/sparc64/sparc64/trap.c
  head/sys/sun4v/sun4v/trap.c

Modified: head/sys/amd64/amd64/trap.c
==============================================================================
--- head/sys/amd64/amd64/trap.c	Thu Aug 19 16:40:30 2010	(r211514)
+++ head/sys/amd64/amd64/trap.c	Thu Aug 19 16:41:27 2010	(r211515)
@@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$");
 #include "opt_isa.h"
 #include "opt_kdb.h"
 #include "opt_kdtrace.h"
-#include "opt_ktrace.h"
 
 #include 
 #include 
@@ -70,9 +69,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#ifdef KTRACE
-#include 
-#endif
 #ifdef HWPMC_HOOKS
 #include 
 #endif

Modified: head/sys/amd64/ia32/ia32_syscall.c
==============================================================================
--- head/sys/amd64/ia32/ia32_syscall.c	Thu Aug 19 16:40:30 2010	(r211514)
+++ head/sys/amd64/ia32/ia32_syscall.c	Thu Aug 19 16:41:27 2010	(r211515)
@@ -45,7 +45,6 @@ __FBSDID("$FreeBSD$");
 #include "opt_clock.h"
 #include "opt_cpu.h"
 #include "opt_isa.h"
-#include "opt_ktrace.h"
 
 #include 
 #include 
@@ -65,9 +64,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#ifdef KTRACE
-#include 
-#endif
 #include 
 
 #include 

Modified: head/sys/i386/i386/trap.c
==============================================================================
--- head/sys/i386/i386/trap.c	Thu Aug 19 16:40:30 2010	(r211514)
+++ head/sys/i386/i386/trap.c	Thu Aug 19 16:41:27 2010	(r211515)
@@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$");
 #include "opt_isa.h"
 #include "opt_kdb.h"
 #include "opt_kdtrace.h"
-#include "opt_ktrace.h"
 #include "opt_npx.h"
 #include "opt_trap.h"
 
@@ -72,9 +71,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#ifdef KTRACE
-#include 
-#endif
 #ifdef HWPMC_HOOKS
 #include 
 #endif

Modified: head/sys/ia64/ia64/trap.c
==============================================================================
--- head/sys/ia64/ia64/trap.c	Thu Aug 19 16:40:30 2010	(r211514)
+++ head/sys/ia64/ia64/trap.c	Thu Aug 19 16:41:27 2010	(r211515)
@@ -28,7 +28,6 @@
 __FBSDID("$FreeBSD$");
 
 #include "opt_ddb.h"
-#include "opt_ktrace.h"
 
 #include 
 #include 
@@ -67,11 +66,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #endif
 
-#ifdef KTRACE
-#include 
-#include 
-#endif
-
 #include 
 
 #include 

Modified: head/sys/kern/sched_ule.c
==============================================================================
--- head/sys/kern/sched_ule.c	Thu Aug 19 16:40:30 2010	(r211514)
+++ head/sys/kern/sched_ule.c	Thu Aug 19 16:41:27 2010	(r211515)
@@ -62,10 +62,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#ifdef KTRACE
-#include 
-#include 
-#endif
 
 #ifdef HWPMC_HOOKS
 #include 

Modified: head/sys/powerpc/aim/trap.c
==============================================================================
--- head/sys/powerpc/aim/trap.c	Thu Aug 19 16:40:30 2010	(r211514)
+++ head/sys/powerpc/aim/trap.c	Thu Aug 19 16:41:27 2010	(r211515)
@@ -34,8 +34,6 @@
 #include 
 __FBSDID("$FreeBSD$");
 
-#include "opt_ktrace.h"
-
 #include 
 #include 
 #include 
@@ -50,9 +48,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#ifdef KTRACE
-#include 
-#endif
 #include 
 
 #include 

Modified: head/sys/powerpc/booke/trap.c
==============================================================================
--- head/sys/powerpc/booke/trap.c	Thu Aug 19 16:40:30 2010	(r211514)
+++ head/sys/powerpc/booke/trap.c	Thu Aug 19 16:41:27 2010	(r211515)
@@ -35,7 +35,6 @@
 __FBSDID("$FreeBSD$");
 
 #include "opt_fpu_emu.h"
-#include "opt_ktrace.h"
 
 #include 
 #include 
@@ -51,9 +50,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#ifdef KTRACE
-#include 
-#endif
 #include 
 
 #include 

Modified: head/sys/sparc64/sparc64/trap.c
==============================================================================
--- head/sys/sparc64/sparc64/trap.c	Thu Aug 19 16:40:30 2010	(r211514)
+++ head/sys/sparc64/sparc64/trap.c	Thu Aug 19 16:41:27 2010	(r211515)
@@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$");
 
 #include "opt_ddb.h"
 #include "opt_ktr.h"
-#include "opt_ktrace.h"
 
 #include 
 #include 
@@ -65,10 +64,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#ifdef KTRACE
-#include 
-#include 
-#endif
 #include 
 
 #include 

Modified: head/sys/sun4v/sun4v/trap.c
==============================================================================
--- head/sys/sun4v/sun4v/trap.c	Thu Aug 19 16:40:30 2010	(r211514)
+++ head/sys/sun4v/sun4v/trap.c	Thu Aug 19 16:41:27 2010	(r211515)
@@ -42,7 +42,6 @@
 
 #include "opt_ddb.h"
 #include "opt_ktr.h"
-#include "opt_ktrace.h"
 
 #include 
 #include 
@@ -62,10 +61,6 @@
 #include 
 #include 
 #include 
-#ifdef KTRACE
-#include 
-#include 
-#endif
 
 #include 
 

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 17:00:33 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D7FD110656A9;
	Thu, 19 Aug 2010 17:00:33 +0000 (UTC) (envelope-from jfv@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C7C608FC1B;
	Thu, 19 Aug 2010 17:00:33 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7JH0XuD010586;
	Thu, 19 Aug 2010 17:00:33 GMT (envelope-from jfv@svn.freebsd.org)
Received: (from jfv@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7JH0XEp010584;
	Thu, 19 Aug 2010 17:00:33 GMT (envelope-from jfv@svn.freebsd.org)
Message-Id: <201008191700.o7JH0XEp010584@svn.freebsd.org>
From: Jack F Vogel 
Date: Thu, 19 Aug 2010 17:00: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: r211516 - 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, 19 Aug 2010 17:00:34 -0000

Author: jfv
Date: Thu Aug 19 17:00:33 2010
New Revision: 211516
URL: http://svn.freebsd.org/changeset/base/211516

Log:
  Eliminate the ambiguous queue setting logic for
  the VF, it made it possible to have 2 queues which
  we don't want, the HOST is unable to handle it.

Modified:
  head/sys/dev/e1000/if_igb.c

Modified: head/sys/dev/e1000/if_igb.c
==============================================================================
--- head/sys/dev/e1000/if_igb.c	Thu Aug 19 16:41:27 2010	(r211515)
+++ head/sys/dev/e1000/if_igb.c	Thu Aug 19 17:00:33 2010	(r211516)
@@ -2473,8 +2473,8 @@ igb_setup_msix(struct adapter *adapter)
 	if ((adapter->hw.mac.type == e1000_82575) && (queues > 4))
 		queues = 4;
 
-	/* Limit the VF adapter to one queues */
-	if ((adapter->hw.mac.type == e1000_vfadapt) && (queues > 2))
+	/* Limit the VF adapter to one queue */
+	if (adapter->hw.mac.type == e1000_vfadapt)
 		queues = 1;
 
 	/*

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 17:24:20 2010
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8EB451065693;
	Thu, 19 Aug 2010 17:24:20 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85])
	by mx1.freebsd.org (Postfix) with ESMTP id 4EB618FC15;
	Thu, 19 Aug 2010 17:24:20 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
	by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o7JHKcLG098528;
	Thu, 19 Aug 2010 11:20:38 -0600 (MDT) (envelope-from imp@bsdimp.com)
Date: Thu, 19 Aug 2010 11:20:40 -0600 (MDT)
Message-Id: <20100819.112040.914206331691540228.imp@bsdimp.com>
To: andre@FreeBSD.org
From: "M. Warner Losh" 
In-Reply-To: <4C6D2933.9020306@freebsd.org>
References: <201008191153.o7JBrtbl002979@svn.freebsd.org>
	<4C6D2933.9020306@freebsd.org>
X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@FreeBSD.org, adrian@FreeBSD.org, src-committers@FreeBSD.org,
	svn-src-all@FreeBSD.org
Subject: Re: svn commit: r211503 - head/sys/mips/atheros
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 17:24:20 -0000

In message: <4C6D2933.9020306@freebsd.org>
            Andre Oppermann  writes:
: On 19.08.2010 13:53, Adrian Chadd wrote:
: > Author: adrian
: > Date: Thu Aug 19 11:53:55 2010
: > New Revision: 211503
: > URL: http://svn.freebsd.org/changeset/base/211503
: >
: > Log:
: >    Add some initial AR724X chipset support.
: >
: >    This is untested but should at least allow an AR724X to boot.
: 
: Isn't this something that should be done on a project branch and
: merged back when in a good working state?

We don't have a branch for mips stuff these days.  This stuff is OK,
since the AR724X is just being rolled out right now...  For non AR724x
systems, this won't affect anything...

Warner

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 17:54:34 2010
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 487D010656A7
	for ; Thu, 19 Aug 2010 17:54:34 +0000 (UTC)
	(envelope-from andre@freebsd.org)
Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2])
	by mx1.freebsd.org (Postfix) with ESMTP id 92BD08FC18
	for ; Thu, 19 Aug 2010 17:54:33 +0000 (UTC)
Received: (qmail 19692 invoked from network); 19 Aug 2010 17:54:23 -0000
Received: from localhost (HELO [127.0.0.1]) ([127.0.0.1])
	(envelope-sender )
	by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP
	for ; 19 Aug 2010 17:54:23 -0000
Message-ID: <4C6D6FD7.7060106@freebsd.org>
Date: Thu, 19 Aug 2010 19:54:31 +0200
From: Andre Oppermann 
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
	rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2
MIME-Version: 1.0
To: "M. Warner Losh" 
References: <201008191153.o7JBrtbl002979@svn.freebsd.org>	<4C6D2933.9020306@freebsd.org>
	<20100819.112040.914206331691540228.imp@bsdimp.com>
In-Reply-To: <20100819.112040.914206331691540228.imp@bsdimp.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@FreeBSD.org, adrian@FreeBSD.org, src-committers@FreeBSD.org,
	svn-src-all@FreeBSD.org
Subject: Re: svn commit: r211503 - head/sys/mips/atheros
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 17:54:34 -0000

On 19.08.2010 19:20, M. Warner Losh wrote:
> In message:<4C6D2933.9020306@freebsd.org>
>              Andre Oppermann  writes:
> : On 19.08.2010 13:53, Adrian Chadd wrote:
> :>  Author: adrian
> :>  Date: Thu Aug 19 11:53:55 2010
> :>  New Revision: 211503
> :>  URL: http://svn.freebsd.org/changeset/base/211503
> :>
> :>  Log:
> :>     Add some initial AR724X chipset support.
> :>
> :>     This is untested but should at least allow an AR724X to boot.
> :
> : Isn't this something that should be done on a project branch and
> : merged back when in a good working state?
>
> We don't have a branch for mips stuff these days.  This stuff is OK,
> since the AR724X is just being rolled out right now...  For non AR724x
> systems, this won't affect anything...

I was more concerned about tree breakage for non-tested code.  When
developing something bleeding edge it is often useful to just commit
some stuff and have it sorted out later.  In head this is more
dangerous.  A small AR724X development branch would be ideal for
this.  Branching is cheap with SVN these days.

-- 
Andre

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 18:51:56 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D41CB1065673;
	Thu, 19 Aug 2010 18:51:56 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85])
	by mx1.freebsd.org (Postfix) with ESMTP id 8D9EC8FC18;
	Thu, 19 Aug 2010 18:51:56 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
	by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o7JIgtq4099386;
	Thu, 19 Aug 2010 12:42:55 -0600 (MDT) (envelope-from imp@bsdimp.com)
Date: Thu, 19 Aug 2010 12:42:58 -0600 (MDT)
Message-Id: <20100819.124258.885796242215807555.imp@bsdimp.com>
To: andre@freebsd.org
From: "M. Warner Losh" 
In-Reply-To: <4C6D6FD7.7060106@freebsd.org>
References: <4C6D2933.9020306@freebsd.org>
	<20100819.112040.914206331691540228.imp@bsdimp.com>
	<4C6D6FD7.7060106@freebsd.org>
X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, adrian@freebsd.org, src-committers@freebsd.org,
	svn-src-all@freebsd.org
Subject: Re: svn commit: r211503 - head/sys/mips/atheros
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 18:51:56 -0000

In message: <4C6D6FD7.7060106@freebsd.org>
            Andre Oppermann  writes:
: On 19.08.2010 19:20, M. Warner Losh wrote:
: > In message:<4C6D2933.9020306@freebsd.org>
: >              Andre Oppermann  writes:
: > : On 19.08.2010 13:53, Adrian Chadd wrote:
: > :>  Author: adrian
: > :>  Date: Thu Aug 19 11:53:55 2010
: > :>  New Revision: 211503
: > :>  URL: http://svn.freebsd.org/changeset/base/211503
: > :>
: > :>  Log:
: > :>     Add some initial AR724X chipset support.
: > :>
: > :>     This is untested but should at least allow an AR724X to boot.
: > :
: > : Isn't this something that should be done on a project branch and
: > : merged back when in a good working state?
: >
: > We don't have a branch for mips stuff these days.  This stuff is OK,
: > since the AR724X is just being rolled out right now...  For non AR724x
: > systems, this won't affect anything...
: 
: I was more concerned about tree breakage for non-tested code.  When
: developing something bleeding edge it is often useful to just commit
: some stuff and have it sorted out later.  In head this is more
: dangerous.  A small AR724X development branch would be ideal for
: this.  Branching is cheap with SVN these days.

Merging isn't that cheap with svn.  The svn:mergeinfo properties make
them a pita.  Given that this code won't break anything, except
possibly the now-unsupported AR724x, I think a branch would be
overkill.  We'd have to drag that branch along all the time until we
can get actual hardware to test it on, which is a high overhead.

Warner

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 19:06:10 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C40271065694
	for ; Thu, 19 Aug 2010 19:06:10 +0000 (UTC)
	(envelope-from andre@freebsd.org)
Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2])
	by mx1.freebsd.org (Postfix) with ESMTP id 336B28FC16
	for ; Thu, 19 Aug 2010 19:06:09 +0000 (UTC)
Received: (qmail 23656 invoked from network); 19 Aug 2010 19:05:58 -0000
Received: from localhost (HELO [127.0.0.1]) ([127.0.0.1])
	(envelope-sender )
	by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP
	for ; 19 Aug 2010 19:05:58 -0000
Message-ID: <4C6D80A0.4080901@freebsd.org>
Date: Thu, 19 Aug 2010 21:06:08 +0200
From: Andre Oppermann 
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
	rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2
MIME-Version: 1.0
To: "M. Warner Losh" 
References: <4C6D2933.9020306@freebsd.org>	<20100819.112040.914206331691540228.imp@bsdimp.com>	<4C6D6FD7.7060106@freebsd.org>
	<20100819.124258.885796242215807555.imp@bsdimp.com>
In-Reply-To: <20100819.124258.885796242215807555.imp@bsdimp.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, adrian@freebsd.org, src-committers@freebsd.org,
	svn-src-all@freebsd.org
Subject: Re: svn commit: r211503 - head/sys/mips/atheros
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 19:06:10 -0000

On 19.08.2010 20:42, M. Warner Losh wrote:
> In message:<4C6D6FD7.7060106@freebsd.org>
>              Andre Oppermann  writes:
> : On 19.08.2010 19:20, M. Warner Losh wrote:
> :>  In message:<4C6D2933.9020306@freebsd.org>
> :>               Andre Oppermann   writes:
> :>  : On 19.08.2010 13:53, Adrian Chadd wrote:
> :>  :>   Author: adrian
> :>  :>   Date: Thu Aug 19 11:53:55 2010
> :>  :>   New Revision: 211503
> :>  :>   URL: http://svn.freebsd.org/changeset/base/211503
> :>  :>
> :>  :>   Log:
> :>  :>      Add some initial AR724X chipset support.
> :>  :>
> :>  :>      This is untested but should at least allow an AR724X to boot.
> :>  :
> :>  : Isn't this something that should be done on a project branch and
> :>  : merged back when in a good working state?
> :>
> :>  We don't have a branch for mips stuff these days.  This stuff is OK,
> :>  since the AR724X is just being rolled out right now...  For non AR724x
> :>  systems, this won't affect anything...
> :
> : I was more concerned about tree breakage for non-tested code.  When
> : developing something bleeding edge it is often useful to just commit
> : some stuff and have it sorted out later.  In head this is more
> : dangerous.  A small AR724X development branch would be ideal for
> : this.  Branching is cheap with SVN these days.
>
> Merging isn't that cheap with svn.  The svn:mergeinfo properties make
> them a pita.  Given that this code won't break anything, except
> possibly the now-unsupported AR724x, I think a branch would be
> overkill.  We'd have to drag that branch along all the time until we
> can get actual hardware to test it on, which is a high overhead.

Didn't know that branching and merging isn't that easy with SVN after
all.  This was one of the supposed benefits for switching from CVS.
If there is no risk of head breakage I don't mind at all.

-- 
Andre

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 19:21:51 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id DDAD510656A5;
	Thu, 19 Aug 2010 19:21:51 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85])
	by mx1.freebsd.org (Postfix) with ESMTP id EF4348FC1C;
	Thu, 19 Aug 2010 19:21:50 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
	by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o7JJGuOb099741;
	Thu, 19 Aug 2010 13:16:56 -0600 (MDT) (envelope-from imp@bsdimp.com)
Date: Thu, 19 Aug 2010 13:16:58 -0600 (MDT)
Message-Id: <20100819.131658.84240036293427615.imp@bsdimp.com>
To: andre@freebsd.org
From: "M. Warner Losh" 
In-Reply-To: <4C6D80A0.4080901@freebsd.org>
References: <4C6D6FD7.7060106@freebsd.org>
	<20100819.124258.885796242215807555.imp@bsdimp.com>
	<4C6D80A0.4080901@freebsd.org>
X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@freebsd.org, adrian@freebsd.org, src-committers@freebsd.org,
	svn-src-all@freebsd.org
Subject: Re: svn commit: r211503 - head/sys/mips/atheros
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 19:21:52 -0000

In message: <4C6D80A0.4080901@freebsd.org>
            Andre Oppermann  writes:
: On 19.08.2010 20:42, M. Warner Losh wrote:
: > In message:<4C6D6FD7.7060106@freebsd.org>
: >              Andre Oppermann  writes:
: > : On 19.08.2010 19:20, M. Warner Losh wrote:
: > :>  In message:<4C6D2933.9020306@freebsd.org>
: > :>               Andre Oppermann   writes:
: > :>  : On 19.08.2010 13:53, Adrian Chadd wrote:
: > :>  :>   Author: adrian
: > :>  :>   Date: Thu Aug 19 11:53:55 2010
: > :>  :>   New Revision: 211503
: > :>  :>   URL: http://svn.freebsd.org/changeset/base/211503
: > :>  :>
: > :>  :>   Log:
: > :>  :>      Add some initial AR724X chipset support.
: > :>  :>
: > :> :> This is untested but should at least allow an AR724X to boot.
: > :>  :
: > :>  : Isn't this something that should be done on a project branch and
: > :>  : merged back when in a good working state?
: > :>
: > :> We don't have a branch for mips stuff these days.  This stuff is
: > OK,
: > :> since the AR724X is just being rolled out right now...  For non
: > AR724x
: > :>  systems, this won't affect anything...
: > :
: > : I was more concerned about tree breakage for non-tested code.  When
: > : developing something bleeding edge it is often useful to just commit
: > : some stuff and have it sorted out later.  In head this is more
: > : dangerous.  A small AR724X development branch would be ideal for
: > : this.  Branching is cheap with SVN these days.
: >
: > Merging isn't that cheap with svn.  The svn:mergeinfo properties make
: > them a pita.  Given that this code won't break anything, except
: > possibly the now-unsupported AR724x, I think a branch would be
: > overkill.  We'd have to drag that branch along all the time until we
: > can get actual hardware to test it on, which is a high overhead.
: 
: Didn't know that branching and merging isn't that easy with SVN after
: all.  This was one of the supposed benefits for switching from CVS.
: If there is no risk of head breakage I don't mind at all.

Branching is a lot easier and saner.  But there's still a cost to
branching that must be weighed...

Warner

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 20:12:42 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 946101065695;
	Thu, 19 Aug 2010 20:12:42 +0000 (UTC)
	(envelope-from juli@clockworksquid.com)
Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com
	[74.125.82.182])
	by mx1.freebsd.org (Postfix) with ESMTP id 8E1C08FC0C;
	Thu, 19 Aug 2010 20:12:41 +0000 (UTC)
Received: by wyj26 with SMTP id 26so3052811wyj.13
	for ; Thu, 19 Aug 2010 13:12:40 -0700 (PDT)
Received: by 10.216.71.132 with SMTP id r4mr1107651wed.102.1282248760461; Thu,
	19 Aug 2010 13:12:40 -0700 (PDT)
MIME-Version: 1.0
Sender: juli@clockworksquid.com
Received: by 10.216.5.5 with HTTP; Thu, 19 Aug 2010 13:12:20 -0700 (PDT)
In-Reply-To: <20100819.131658.84240036293427615.imp@bsdimp.com>
References: <4C6D6FD7.7060106@freebsd.org>
	<20100819.124258.885796242215807555.imp@bsdimp.com>
	<4C6D80A0.4080901@freebsd.org>
	<20100819.131658.84240036293427615.imp@bsdimp.com>
From: Juli Mallett 
Date: Thu, 19 Aug 2010 13:12:20 -0700
X-Google-Sender-Auth: XaWFq_nWE_erNbkJlwo_E-NmRCA
Message-ID: 
To: "M. Warner Losh" 
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, adrian@freebsd.org, src-committers@freebsd.org,
	andre@freebsd.org, svn-src-all@freebsd.org
Subject: Re: svn commit: r211503 - head/sys/mips/atheros
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 20:12:42 -0000

On Thu, Aug 19, 2010 at 12:16, M. Warner Losh  wrote:
> Branching is a lot easier and saner. =A0But there's still a cost to
> branching that must be weighed...

As long as one isn't trying to be overly-clever in using the tools it
really isn't so bad and is about as bad as Perforce.  I don't think we
should ever use the merge command to merge commits to head from a
short-lived/non-vendor branch.  It really sounds like you have had an
unusually-bad experience with Subversion and I think we should try to
dissect that rather than writing off developing in branches.

I haven't had any significant problems with merging from head to my
branch until I reached the level of having dozens of files and
directories added in my branch originally and then looped-back from
head.

I, like Adrian, tend to do very sort of incremental work and lots of
little commits to break up my progress (and to have lots of points to
revert to.)  It has generally been my understanding that we frown on
doing that sort of thing in head.  I don't see the point of generating
an E-Mail to everyone who reads the commit lists to add a small,
unused header file, except in very occasional circumstances.  I think
that's a great level of detail to work at in a branch.

Juli.

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 20:35:54 2010
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D904410656AE
	for ; Thu, 19 Aug 2010 20:35:54 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4])
	by mx1.freebsd.org (Postfix) with ESMTP id 65FC48FC08
	for ; Thu, 19 Aug 2010 20:35:54 +0000 (UTC)
Received: (qmail 13904 invoked by uid 399); 19 Aug 2010 20:35:53 -0000
Received: from localhost (HELO lap.dougb.net) (dougb@dougbarton.us@127.0.0.1)
	by localhost with ESMTPAM; 19 Aug 2010 20:35:53 -0000
X-Originating-IP: 127.0.0.1
X-Sender: dougb@dougbarton.us
Message-ID: <4C6D95A8.9070105@FreeBSD.org>
Date: Thu, 19 Aug 2010 13:35:52 -0700
From: Doug Barton 
Organization: http://SupersetSolutions.com/
User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US;
	rv:1.9.2.8) Gecko/20100807 Thunderbird/3.1.2
MIME-Version: 1.0
To: Ana Kukec 
References: <201008191131.o7JBV4Yf002412@svn.freebsd.org>
	<4C6D18BE.2000905@fer.hr>
In-Reply-To: <4C6D18BE.2000905@fer.hr>
X-Enigmail-Version: 1.1.2
OpenPGP: id=1A1ABC84
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@FreeBSD.org, Ana Kukec ,
	svn-src-all@FreeBSD.org, src-committers@FreeBSD.org
Subject: Re: svn commit: r211501 - in head/sys: modules modules/send netinet
 netinet6 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, 19 Aug 2010 20:35:54 -0000

On 08/19/2010 04:42, Ana Kukec wrote:
> Hi all,
>
> A man page for the kernel side SeND, and an updated port with Secure
> Neighbor Discovery application will follow soon.

At minimum committing the man page along with new code is how such 
things should be done. Can you define "soon?"


Doug

-- 

	Improve the effectiveness of your Internet presence with
	a domain name makeover!    http://SupersetSolutions.com/

	Computers are useless. They can only give you answers.
			-- Pablo Picasso


From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 21:11:51 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E5BF610656A3;
	Thu, 19 Aug 2010 21:11:51 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85])
	by mx1.freebsd.org (Postfix) with ESMTP id 9F0888FC13;
	Thu, 19 Aug 2010 21:11:51 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
	by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o7JL8MTs000869;
	Thu, 19 Aug 2010 15:08:22 -0600 (MDT) (envelope-from imp@bsdimp.com)
Date: Thu, 19 Aug 2010 15:08:24 -0600 (MDT)
Message-Id: <20100819.150824.1004138037722500360.imp@bsdimp.com>
To: jmallett@freebsd.org
From: "M. Warner Losh" 
In-Reply-To: 
References: <4C6D80A0.4080901@freebsd.org>
	<20100819.131658.84240036293427615.imp@bsdimp.com>
	
X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, adrian@freebsd.org, src-committers@freebsd.org,
	andre@freebsd.org, svn-src-all@freebsd.org
Subject: Re: svn commit: r211503 - head/sys/mips/atheros
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 21:11:52 -0000

In message: 
            Juli Mallett  writes:
: On Thu, Aug 19, 2010 at 12:16, M. Warner Losh  wrote:=

: > Branching is a lot easier and saner. =A0But there's still a cost to=

: > branching that must be weighed...
: =

: As long as one isn't trying to be overly-clever in using the tools it=

: really isn't so bad and is about as bad as Perforce.  I don't think w=
e
: should ever use the merge command to merge commits to head from a
: short-lived/non-vendor branch.  It really sounds like you have had an=

: unusually-bad experience with Subversion and I think we should try to=

: dissect that rather than writing off developing in branches.

The tbemd branch has been a pita to keep going as long as I've had
to...

: I haven't had any significant problems with merging from head to my
: branch until I reached the level of having dozens of files and
: directories added in my branch originally and then looped-back from
: head.

yea.  I'll admit that part of my angst is from the projects/mips tree,
which did get somewhat out of hand.

: I, like Adrian, tend to do very sort of incremental work and lots of
: little commits to break up my progress (and to have lots of points to=

: revert to.)  It has generally been my understanding that we frown on
: doing that sort of thing in head.  I don't see the point of generatin=
g
: an E-Mail to everyone who reads the commit lists to add a small,
: unused header file, except in very occasional circumstances.  I think=

: that's a great level of detail to work at in a branch.

Yea, perforce will generate mail only for those that opt in...

Warner

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 21:55:09 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4955B1065675;
	Thu, 19 Aug 2010 21:55:07 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3])
	by mx1.freebsd.org (Postfix) with ESMTP id 5D9D98FC20;
	Thu, 19 Aug 2010 21:55:07 +0000 (UTC)
Received: from localhost (amavis.fra.cksoft.de [192.168.74.71])
	by mail.cksoft.de (Postfix) with ESMTP id 5CDC141C705;
	Thu, 19 Aug 2010 23:55:06 +0200 (CEST)
X-Virus-Scanned: amavisd-new at cksoft.de
Received: from mail.cksoft.de ([192.168.74.103])
	by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new,
	port 10024)
	with ESMTP id ZRnl8rkGU2LK; Thu, 19 Aug 2010 23:55:05 +0200 (CEST)
Received: by mail.cksoft.de (Postfix, from userid 66)
	id 9660941C736; Thu, 19 Aug 2010 23:55:05 +0200 (CEST)
Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net
	[10.111.66.10])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.int.zabbadoz.net (Postfix) with ESMTP id E14884448EC;
	Thu, 19 Aug 2010 21:50:58 +0000 (UTC)
Date: Thu, 19 Aug 2010 21:50:58 +0000 (UTC)
From: "Bjoern A. Zeeb" 
X-X-Sender: bz@maildrop.int.zabbadoz.net
To: Doug Barton 
In-Reply-To: <4C6D95A8.9070105@FreeBSD.org>
Message-ID: <20100819213159.B48418@maildrop.int.zabbadoz.net>
References: <201008191131.o7JBV4Yf002412@svn.freebsd.org>
	<4C6D18BE.2000905@fer.hr> <4C6D95A8.9070105@FreeBSD.org>
X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842
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: r211501 - in head/sys: modules modules/send netinet
 netinet6 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, 19 Aug 2010 21:55:09 -0000

On Thu, 19 Aug 2010, Doug Barton wrote:

> On 08/19/2010 04:42, Ana Kukec wrote:
>> Hi all,
>> 
>> A man page for the kernel side SeND, and an updated port with Secure
>> Neighbor Discovery application will follow soon.
>
> At minimum committing the man page along with new code is how such things 
> should be done. Can you define "soon?"

Yes I can: soon will be when it'll be comitted.  Meanwhile if you have
time I'd know several dozen other things we don't have a man page for ...

/bz

-- 
Bjoern A. Zeeb                       This signature is about you not me.

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 21:59:39 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id ED1691065697;
	Thu, 19 Aug 2010 21:59:39 +0000 (UTC)
	(envelope-from edwin@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DC6118FC15;
	Thu, 19 Aug 2010 21:59:39 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7JLxd0K017335;
	Thu, 19 Aug 2010 21:59:39 GMT (envelope-from edwin@svn.freebsd.org)
Received: (from edwin@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7JLxdvp017333;
	Thu, 19 Aug 2010 21:59:39 GMT (envelope-from edwin@svn.freebsd.org)
Message-Id: <201008192159.o7JLxdvp017333@svn.freebsd.org>
From: Edwin Groothuis 
Date: Thu, 19 Aug 2010 21:59: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: r211517 - head/usr.bin/calendar
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 21:59:40 -0000

Author: edwin
Date: Thu Aug 19 21:59:39 2010
New Revision: 211517
URL: http://svn.freebsd.org/changeset/base/211517

Log:
  '\0' -> 0
  
  Fix silly mistake by being overly zeaolous[sp] of applying the style rules.

Modified:
  head/usr.bin/calendar/locale.c

Modified: head/usr.bin/calendar/locale.c
==============================================================================
--- head/usr.bin/calendar/locale.c	Thu Aug 19 17:00:33 2010	(r211516)
+++ head/usr.bin/calendar/locale.c	Thu Aug 19 21:59:39 2010	(r211517)
@@ -76,7 +76,7 @@ setnnames(void)
 	int i, l;
 	struct tm tm;
 
-	memset(&tm, '\0', sizeof(struct tm));
+	memset(&tm, 0, sizeof(struct tm));
 	for (i = 0; i < 7; i++) {
 		tm.tm_wday = i;
 		strftime(buf, sizeof(buf), "%a", &tm);
@@ -104,7 +104,7 @@ setnnames(void)
 		fndays[i].len = strlen(buf);
 	}
 
-	memset(&tm, '\0', sizeof(struct tm));
+	memset(&tm, 0, sizeof(struct tm));
 	for (i = 0; i < 12; i++) {
 		tm.tm_mon = i;
 		strftime(buf, sizeof(buf), "%b", &tm);

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 22:21:02 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AF3BE1065673;
	Thu, 19 Aug 2010 22:21:02 +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 045A18FC16;
	Thu, 19 Aug 2010 22:21:01 +0000 (UTC)
Received: from c211-30-198-138.carlnfd1.nsw.optusnet.com.au
	(c211-30-198-138.carlnfd1.nsw.optusnet.com.au [211.30.198.138])
	by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	o7JMKwub011061
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Fri, 20 Aug 2010 08:20:59 +1000
Date: Fri, 20 Aug 2010 08:20:57 +1000 (EST)
From: Bruce Evans 
X-X-Sender: bde@delplex.bde.org
To: Rui Paulo 
In-Reply-To: <201008191259.o7JCxv3i004613@svn.freebsd.org>
Message-ID: <20100820075236.L18914@delplex.bde.org>
References: <201008191259.o7JCxv3i004613@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: r211505 - head/contrib/gcc
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 22:21:02 -0000

On Thu, 19 Aug 2010, Rui Paulo wrote:

> Log:
>  Remove unneeded casts in inline assembly in contrib/gcc/longlong.h,

These seem to be needed, and some of them valid.  Any lvalue arg that
can be put in a register can be cast to USItype (unsigned int) on i386.
The args are macro args, so they may have any integer type no larger
than USItype originally, and they must be cast to USItype for the asms
to work if the args are smaller than USItype...

>  which are apparently "heinous" GNU extensions, so clang can
>  compile this without using the -fheinous-gnu-extensions option.

But when the args are lvalues, casting them is invalid.  This is
apparently the heinous extension depended on.

>
>  Results in *no* binary change, neither with clang, nor with gcc.

This cannot be tested by compiling a few binaries, since the few binaries
might not include enough examples to give test coverage of cases with
args smaller than USItype.  Perhaps the macros are only used for building
libgcc, but this is unclear.

> Modified: head/contrib/gcc/longlong.h
> ==============================================================================
> --- head/contrib/gcc/longlong.h	Thu Aug 19 12:52:49 2010	(r211504)
> +++ head/contrib/gcc/longlong.h	Thu Aug 19 12:59:57 2010	(r211505)
> @@ -314,38 +314,38 @@ UDItype __umulsidi3 (USItype, USItype);
> #if (defined (__i386__) || defined (__i486__)) && W_TYPE_SIZE == 32
> #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
>   __asm__ ("addl %5,%1\n\tadcl %3,%0"					\
> -	   : "=r" ((USItype) (sh)),					\
> -	     "=&r" ((USItype) (sl))					\

I can only see a problem with casting lvalues (2 here).  The corrected
version might use "USItype _sh = (sh); ... (sh) = _sh;", etc.

> -	   : "%0" ((USItype) (ah)),					\
> -	     "g" ((USItype) (bh)),					\
> -	     "%1" ((USItype) (al)),					\
> -	     "g" ((USItype) (bl)))
> +	   : "=r" (sh),							\
> +	     "=&r" (sl)							\
> +	   : "%0" (ah),							\
> +	     "g" (bh),							\
> +	     "%1" (al),							\
> +	     "g" (bl))
> #define sub_ddmmss(sh, sl, ah, al, bh, bl) \
>   __asm__ ("subl %5,%1\n\tsbbl %3,%0"					\
> -	   : "=r" ((USItype) (sh)),					\
> -	     "=&r" ((USItype) (sl))					\

Most of the asms have 2 problematic lvalues.

> -	   : "0" ((USItype) (ah)),					\

Casting this rvalue shouldn't cause problems, but it is unclear if "0"
can be the same arg as "=r" if they are cast differently.

> -	     "g" ((USItype) (bh)),					\
> -	     "1" ((USItype) (al)),					\
> -	     "g" ((USItype) (bl)))
> +	   : "=r" (sh),							\
> +	     "=&r" (sl)							\
> +	   : "0" (ah),							\
> +	     "g" (bh),							\
> +	     "1" (al),							\
> +	     "g" (bl))
> #define umul_ppmm(w1, w0, u, v) \
>   __asm__ ("mull %3"							\
> -	   : "=a" ((USItype) (w0)),					\
> -	     "=d" ((USItype) (w1))					\
> -	   : "%0" ((USItype) (u)),					\
> -	     "rm" ((USItype) (v)))
> +	   : "=a" (w0),							\
> +	     "=d" (w1)							\
> +	   : "%0" (u),							\
> +	     "rm" (v))
> #define udiv_qrnnd(q, r, n1, n0, dv) \
>   __asm__ ("divl %4"							\
> -	   : "=a" ((USItype) (q)),					\
> -	     "=d" ((USItype) (r))					\
> -	   : "0" ((USItype) (n0)),					\
> -	     "1" ((USItype) (n1)),					\
> -	     "rm" ((USItype) (dv)))
> +	   : "=a" (q),							\
> +	     "=d" (r)							\
> +	   : "0" (n0),							\
> +	     "1" (n1),							\
> +	     "rm" (dv))
> #define count_leading_zeros(count, x) \
>   do {									\
>     USItype __cbtmp;							\
>     __asm__ ("bsrl %1,%0"						\
> -	     : "=r" (__cbtmp) : "rm" ((USItype) (x)));			\
> +	     : "=r" (__cbtmp) : "rm" (x));				\

Here the lvalue is already a temporary variable, and there should be
no problem casting the rvalue.

>     (count) = __cbtmp ^ 31;						\
>   } while (0)
> #define count_trailing_zeros(count, x) \
>

Here the lvalue already wasn't casted, and the rvalue is still casted.

Bruce

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 22:37:43 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E562B106566B;
	Thu, 19 Aug 2010 22:37:43 +0000 (UTC)
	(envelope-from attilio@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B9B7C8FC15;
	Thu, 19 Aug 2010 22:37:43 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7JMbhoQ018295;
	Thu, 19 Aug 2010 22:37:43 GMT (envelope-from attilio@svn.freebsd.org)
Received: (from attilio@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7JMbhY9018292;
	Thu, 19 Aug 2010 22:37:43 GMT (envelope-from attilio@svn.freebsd.org)
Message-Id: <201008192237.o7JMbhY9018292@svn.freebsd.org>
From: Attilio Rao 
Date: Thu, 19 Aug 2010 22:37: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: r211518 - in head/sys: amd64/amd64 i386/i386
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 22:37:44 -0000

Author: attilio
Date: Thu Aug 19 22:37:43 2010
New Revision: 211518
URL: http://svn.freebsd.org/changeset/base/211518

Log:
  Revert part of the r211149 as I erroneously ported the logical_cpus from
  Yahoo! patchset as a mask (and according manipulating variables) while
  it is actually a CPU count.
  
  Submitted by:	neel
  MFC after:	1 month
  X-MFC:		211149

Modified:
  head/sys/amd64/amd64/mp_machdep.c
  head/sys/i386/i386/mp_machdep.c

Modified: head/sys/amd64/amd64/mp_machdep.c
==============================================================================
--- head/sys/amd64/amd64/mp_machdep.c	Thu Aug 19 21:59:39 2010	(r211517)
+++ head/sys/amd64/amd64/mp_machdep.c	Thu Aug 19 22:37:43 2010	(r211518)
@@ -127,7 +127,7 @@ extern inthand_t IDTVEC(fast_syscall), I
  * Local data and functions.
  */
 
-static cpumask_t logical_cpus;
+static u_int logical_cpus;
 static volatile cpumask_t ipi_nmi_pending;
 
 /* used to hold the AP's until we are ready to release them */
@@ -162,8 +162,8 @@ static int	start_all_aps(void);
 static int	start_ap(int apic_id);
 static void	release_aps(void *dummy);
 
-static cpumask_t	hlt_logical_cpus;
-static cpumask_t	hyperthreading_cpus;
+static int	hlt_logical_cpus;
+static u_int	hyperthreading_cpus;
 static cpumask_t	hyperthreading_cpus_mask;
 static int	hyperthreading_allowed = 1;
 static struct	sysctl_ctx_list logical_cpu_clist;

Modified: head/sys/i386/i386/mp_machdep.c
==============================================================================
--- head/sys/i386/i386/mp_machdep.c	Thu Aug 19 21:59:39 2010	(r211517)
+++ head/sys/i386/i386/mp_machdep.c	Thu Aug 19 22:37:43 2010	(r211518)
@@ -174,7 +174,7 @@ static u_long *ipi_statclock_counts[MAXC
  * Local data and functions.
  */
 
-static cpumask_t logical_cpus;
+static u_int logical_cpus;
 static volatile cpumask_t ipi_nmi_pending;
 
 /* used to hold the AP's until we are ready to release them */
@@ -210,8 +210,8 @@ static int	start_all_aps(void);
 static int	start_ap(int apic_id);
 static void	release_aps(void *dummy);
 
-static cpumask_t	hlt_logical_cpus;
-static cpumask_t	hyperthreading_cpus;
+static int	hlt_logical_cpus;
+static u_int	hyperthreading_cpus;
 static cpumask_t	hyperthreading_cpus_mask;
 static int	hyperthreading_allowed = 1;
 static struct	sysctl_ctx_list logical_cpu_clist;

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 22:55:18 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4DA501065673;
	Thu, 19 Aug 2010 22:55:18 +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 3CCEB8FC0A;
	Thu, 19 Aug 2010 22:55:18 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7JMtIVU018713;
	Thu, 19 Aug 2010 22:55:18 GMT (envelope-from delphij@svn.freebsd.org)
Received: (from delphij@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7JMtI23018711;
	Thu, 19 Aug 2010 22:55:18 GMT (envelope-from delphij@svn.freebsd.org)
Message-Id: <201008192255.o7JMtI23018711@svn.freebsd.org>
From: Xin LI 
Date: Thu, 19 Aug 2010 22:55: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: r211519 - head/usr.bin/grep
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 22:55:18 -0000

Author: delphij
Date: Thu Aug 19 22:55:17 2010
New Revision: 211519
URL: http://svn.freebsd.org/changeset/base/211519

Log:
  Revert a minor part of revision 211364:
  
   - Imply -h if single file is grepped, this is the GNU behaviour
  
  This is already done by code above the change and have caused a regression
  since this instance of code does not check Hflag.
  
  Reported by:	davidxu
  Pointy hat to:	delphij

Modified:
  head/usr.bin/grep/grep.c

Modified: head/usr.bin/grep/grep.c
==============================================================================
--- head/usr.bin/grep/grep.c	Thu Aug 19 22:37:43 2010	(r211518)
+++ head/usr.bin/grep/grep.c	Thu Aug 19 22:55:17 2010	(r211519)
@@ -681,15 +681,12 @@ main(int argc, char *argv[])
 
 	if (dirbehave == DIR_RECURSE)
 		c = grep_tree(aargv);
-	else {
-		if (aargc == 1)
-			hflag = true;
+	else
 		for (c = 0; aargc--; ++aargv) {
 			if ((finclude || fexclude) && !file_matching(*aargv))
 				continue;
 			c+= procfile(*aargv);
 		}
-	}
 
 #ifndef WITHOUT_NLS
 	catclose(catalog);

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 23:16:45 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4AC121065675;
	Thu, 19 Aug 2010 23:16:45 +0000 (UTC)
	(envelope-from anchie@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 1F6878FC13;
	Thu, 19 Aug 2010 23:16:45 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7JNGjNX019206;
	Thu, 19 Aug 2010 23:16:45 GMT (envelope-from anchie@svn.freebsd.org)
Received: (from anchie@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7JNGjMx019204;
	Thu, 19 Aug 2010 23:16:45 GMT (envelope-from anchie@svn.freebsd.org)
Message-Id: <201008192316.o7JNGjMx019204@svn.freebsd.org>
From: Ana Kukec 
Date: Thu, 19 Aug 2010 23: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: r211520 - head/sys/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: Thu, 19 Aug 2010 23:16:45 -0000

Author: anchie
Date: Thu Aug 19 23:16:44 2010
New Revision: 211520
URL: http://svn.freebsd.org/changeset/base/211520

Log:
  Fix mbuf leakages and remove unneccessary duplicate mbuf frees.
  Use the right copy of an mbuf for the IP6_EXTHDR_CHECK.
  
  Reported by:	zec, hrs
  Approved by:	bz (mentor)

Modified:
  head/sys/netinet6/icmp6.c

Modified: head/sys/netinet6/icmp6.c
==============================================================================
--- head/sys/netinet6/icmp6.c	Thu Aug 19 22:55:17 2010	(r211519)
+++ head/sys/netinet6/icmp6.c	Thu Aug 19 23:16:44 2010	(r211520)
@@ -786,14 +786,12 @@ icmp6_input(struct mbuf **mp, int *offp,
 			goto freeit;
 		}
 		if (send_sendso_input_hook != NULL) {
-			IP6_EXTHDR_CHECK(m, off,
+			IP6_EXTHDR_CHECK(n, off,
 			    icmp6len, IPPROTO_DONE);
                         error = send_sendso_input_hook(n, ifp,
 			    SND_IN, ip6len);
-			if (error == 0) {
-				m_freem(n);
-				return (IPPROTO_DONE);
-			}
+			if (error == 0)
+				goto freeit;
 			/* -1 == no app on SEND socket */
 			nd6_rs_input(n, off, icmp6len);
 		} else
@@ -819,14 +817,13 @@ icmp6_input(struct mbuf **mp, int *offp,
 			} else
 				nd6_ra_input(m, off, icmp6len);
 			m = NULL;
-			m_freem(n);
 			goto freeit;
 		}
 		if (send_sendso_input_hook != NULL) {
 			error = send_sendso_input_hook(n, ifp,
 			    SND_IN, ip6len);
 			if (error == 0)
-				return (IPPROTO_DONE);
+				goto freeit;
 			nd6_ra_input(n, off, icmp6len);
 		} else
 			nd6_ra_input(n, off, icmp6len);
@@ -848,7 +845,6 @@ icmp6_input(struct mbuf **mp, int *offp,
 				nd6_ns_input(m, off, icmp6len);
 			} else
 				nd6_ns_input(m, off, icmp6len);
-			m_freem(n);
 			m = NULL;
 			goto freeit;
 		}
@@ -856,7 +852,7 @@ icmp6_input(struct mbuf **mp, int *offp,
 			error = send_sendso_input_hook(n, ifp,
 			    SND_IN, ip6len);
 			if (error == 0)
-				return (IPPROTO_DONE);
+				goto freeit;
 			nd6_ns_input(n, off, icmp6len);
 		} else
 			nd6_ns_input(n, off, icmp6len);
@@ -880,7 +876,6 @@ icmp6_input(struct mbuf **mp, int *offp,
 				nd6_na_input(m, off, icmp6len);
 			} else
 				nd6_na_input(m, off, icmp6len);
-			m_freem(n);
 			m = NULL;
 			goto freeit;
 		}
@@ -888,7 +883,7 @@ icmp6_input(struct mbuf **mp, int *offp,
 			error = send_sendso_input_hook(n, ifp,
 			    SND_IN, ip6len);
 			if (error == 0)
-				return (IPPROTO_DONE);
+				goto freeit;
 			nd6_na_input(n, off, icmp6len);
 		} else
 			nd6_na_input(n, off, icmp6len);
@@ -910,7 +905,6 @@ icmp6_input(struct mbuf **mp, int *offp,
 			    icmp6_redirect_input(m, off);
 			} else
 				icmp6_redirect_input(m, off);
-			m_freem(n);
 			m = NULL;
 			goto freeit;
 		}
@@ -918,7 +912,7 @@ icmp6_input(struct mbuf **mp, int *offp,
 			error = send_sendso_input_hook(n, ifp,
 			    SND_IN, ip6len);
 			if (error == 0)
-				return (IPPROTO_DONE);
+				goto freeit;
 			icmp6_redirect_input(n, off);
 		} else
 			icmp6_redirect_input(n, off);

From owner-svn-src-all@FreeBSD.ORG  Thu Aug 19 23:40:39 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B9CD3106566C;
	Thu, 19 Aug 2010 23:40:39 +0000 (UTC)
	(envelope-from dimitry@andric.com)
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 3D1548FC1C;
	Thu, 19 Aug 2010 23:40:39 +0000 (UTC)
Received: from [IPv6:2001:7b8:3a7:0:18ec:2038:19e5:d1cb] (unknown
	[IPv6:2001:7b8:3a7:0:18ec:2038:19e5:d1cb])
	(using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
	(No client certificate requested)
	by tensor.andric.com (Postfix) with ESMTPSA id 561EC5C59;
	Fri, 20 Aug 2010 01:40:38 +0200 (CEST)
Message-ID: <4C6DC0F8.9040001@andric.com>
Date: Fri, 20 Aug 2010 01:40:40 +0200
From: Dimitry Andric 
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US;
	rv:1.9.2.9pre) Gecko/20100814 Lanikai/3.1.3pre
MIME-Version: 1.0
To: Bruce Evans 
References: <201008191259.o7JCxv3i004613@svn.freebsd.org>
	<20100820075236.L18914@delplex.bde.org>
In-Reply-To: <20100820075236.L18914@delplex.bde.org>
Content-Type: multipart/mixed; boundary="------------040908050209090200010707"
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Rui Paulo 
Subject: Re: svn commit: r211505 - head/contrib/gcc
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 19 Aug 2010 23:40:39 -0000

This is a multi-part message in MIME format.
--------------040908050209090200010707
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

On 2010-08-20 00:20, Bruce Evans wrote:
> These seem to be needed, and some of them valid.  Any lvalue arg that
> can be put in a register can be cast to USItype (unsigned int) on i386.
> The args are macro args, so they may have any integer type no larger
> than USItype originally, and they must be cast to USItype for the asms
> to work if the args are smaller than USItype...

But will the casts not potentially hide problems, if you pass the wrong
types to those macros?  Maybe it is better if the compiler complains
that some argument is of an incompatible type, than just forcing it to
cast?


>>  which are apparently "heinous" GNU extensions, so clang can
>>  compile this without using the -fheinous-gnu-extensions option.
> 
> But when the args are lvalues, casting them is invalid.  This is
> apparently the heinous extension depended on.

Yes, clang complains precisely about that:

gnu/lib/libgcc/../../../contrib/gcc/libgcc2.c:536:22: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions
  DWunion w = {.ll = __umulsidi3 (uu.s.low, vv.s.low)};
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from gnu/lib/libgcc/../../../contrib/gcc/libgcc2.c:65:
In file included from gnu/lib/libgcc/../../../contrib/gcc/libgcc2.h:435:
gnu/lib/libgcc/../../../contrib/gcc/longlong.h:1293:5: note: instantiated from:
    umul_ppmm (__w.s.high, __w.s.low, u, v);                            \
    ^

It turns out that only removing the casts for these specific lvalues is
indeed enough to make clang happy.  Attached patch reverts all other
changes, if that is to be preferred.


>>  Results in *no* binary change, neither with clang, nor with gcc.
> 
> This cannot be tested by compiling a few binaries, since the few binaries
> might not include enough examples to give test coverage of cases with
> args smaller than USItype.  Perhaps the macros are only used for building
> libgcc, but this is unclear.

contrib/gcc/longlong.h is only used in contrib/gcc/libgcc2.h, and in
contrib/gcc/config/soft-fp/soft-fp.h.  On i386, soft-fp is not used,
and libgcc2.h is only used in contrib/gcc/libgcc2.c, so libgcc is the
only consumer, as far as I can see.

--------------040908050209090200010707
Content-Type: text/plain;
 name="longlong-minimal.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="longlong-minimal.diff"

diff --git a/contrib/gcc/longlong.h b/contrib/gcc/longlong.h
index 8805d91..a789d16 100644
--- a/contrib/gcc/longlong.h
+++ b/contrib/gcc/longlong.h
@@ -314,38 +314,38 @@ UDItype __umulsidi3 (USItype, USItype);
 #if (defined (__i386__) || defined (__i486__)) && W_TYPE_SIZE == 32
 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
   __asm__ ("addl %5,%1\n\tadcl %3,%0"					\
-	   : "=r" (sh),							\
-	     "=&r" (sl)							\
-	   : "%0" (ah),							\
-	     "g" (bh),							\
-	     "%1" (al),							\
-	     "g" (bl))
+	   : "=r" ((USItype) (sh)),					\
+	     "=&r" ((USItype) (sl))					\
+	   : "%0" ((USItype) (ah)),					\
+	     "g" ((USItype) (bh)),					\
+	     "%1" ((USItype) (al)),					\
+	     "g" ((USItype) (bl)))
 #define sub_ddmmss(sh, sl, ah, al, bh, bl) \
   __asm__ ("subl %5,%1\n\tsbbl %3,%0"					\
 	   : "=r" (sh),							\
 	     "=&r" (sl)							\
-	   : "0" (ah),							\
-	     "g" (bh),							\
-	     "1" (al),							\
-	     "g" (bl))
+	   : "0" ((USItype) (ah)),					\
+	     "g" ((USItype) (bh)),					\
+	     "1" ((USItype) (al)),					\
+	     "g" ((USItype) (bl)))
 #define umul_ppmm(w1, w0, u, v) \
   __asm__ ("mull %3"							\
 	   : "=a" (w0),							\
 	     "=d" (w1)							\
-	   : "%0" (u),							\
-	     "rm" (v))
+	   : "%0" ((USItype) (u)),					\
+	     "rm" ((USItype) (v)))
 #define udiv_qrnnd(q, r, n1, n0, dv) \
   __asm__ ("divl %4"							\
 	   : "=a" (q),							\
 	     "=d" (r)							\
-	   : "0" (n0),							\
-	     "1" (n1),							\
-	     "rm" (dv))
+	   : "0" ((USItype) (n0)),					\
+	     "1" ((USItype) (n1)),					\
+	     "rm" ((USItype) (dv)))
 #define count_leading_zeros(count, x) \
   do {									\
     USItype __cbtmp;							\
     __asm__ ("bsrl %1,%0"						\
-	     : "=r" (__cbtmp) : "rm" (x));				\
+	     : "=r" (__cbtmp) : "rm" ((USItype) (x)));			\
     (count) = __cbtmp ^ 31;						\
   } while (0)
 #define count_trailing_zeros(count, x) \

--------------040908050209090200010707--

From owner-svn-src-all@FreeBSD.ORG  Fri Aug 20 01:23:17 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A01731065697;
	Fri, 20 Aug 2010 01:23:17 +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 8F3C88FC18;
	Fri, 20 Aug 2010 01:23:17 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7K1NHFY021997;
	Fri, 20 Aug 2010 01:23:17 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7K1NHeD021995;
	Fri, 20 Aug 2010 01:23:17 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201008200123.o7K1NHeD021995@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Fri, 20 Aug 2010 01:23: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: r211521 - 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: Fri, 20 Aug 2010 01:23:17 -0000

Author: nwhitehorn
Date: Fri Aug 20 01:23:17 2010
New Revision: 211521
URL: http://svn.freebsd.org/changeset/base/211521

Log:
  FPU EMU is 32-bit only for now, so mark it as a powerpc-only feature.
  This fixes powerpc64 LINT.

Modified:
  head/sys/conf/files.powerpc

Modified: head/sys/conf/files.powerpc
==============================================================================
--- head/sys/conf/files.powerpc	Thu Aug 19 23:16:44 2010	(r211520)
+++ head/sys/conf/files.powerpc	Fri Aug 20 01:23:17 2010	(r211521)
@@ -102,15 +102,15 @@ powerpc/booke/trap.c		optional	e500
 powerpc/booke/vm_machdep.c	optional	e500
 powerpc/cpufreq/dfs.c		optional	cpufreq
 powerpc/cpufreq/pcr.c		optional	cpufreq aim
-powerpc/fpu/fpu_add.c		optional	fpu_emu
-powerpc/fpu/fpu_compare.c	optional	fpu_emu
-powerpc/fpu/fpu_div.c		optional	fpu_emu
-powerpc/fpu/fpu_emu.c		optional	fpu_emu
-powerpc/fpu/fpu_explode.c	optional	fpu_emu
-powerpc/fpu/fpu_implode.c	optional	fpu_emu
-powerpc/fpu/fpu_mul.c		optional	fpu_emu
-powerpc/fpu/fpu_sqrt.c		optional	fpu_emu
-powerpc/fpu/fpu_subr.c		optional	fpu_emu
+powerpc/fpu/fpu_add.c		optional	fpu_emu powerpc
+powerpc/fpu/fpu_compare.c	optional	fpu_emu powerpc
+powerpc/fpu/fpu_div.c		optional	fpu_emu powerpc
+powerpc/fpu/fpu_emu.c		optional	fpu_emu powerpc
+powerpc/fpu/fpu_explode.c	optional	fpu_emu powerpc
+powerpc/fpu/fpu_implode.c	optional	fpu_emu powerpc
+powerpc/fpu/fpu_mul.c		optional	fpu_emu powerpc
+powerpc/fpu/fpu_sqrt.c		optional	fpu_emu powerpc
+powerpc/fpu/fpu_subr.c		optional	fpu_emu powerpc
 powerpc/mambo/mambocall.S	optional	mambo
 powerpc/mambo/mambo.c		optional	mambo
 powerpc/mambo/mambo_console.c	optional	mambo

From owner-svn-src-all@FreeBSD.ORG  Fri Aug 20 01:33:43 2010
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 31CEB1065673
	for ; Fri, 20 Aug 2010 01:33:43 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4])
	by mx1.freebsd.org (Postfix) with ESMTP id CC2F88FC27
	for ; Fri, 20 Aug 2010 01:33:42 +0000 (UTC)
Received: (qmail 11146 invoked by uid 399); 20 Aug 2010 01:33:41 -0000
Received: from localhost (HELO lap.dougb.net) (dougb@dougbarton.us@127.0.0.1)
	by localhost with ESMTPAM; 20 Aug 2010 01:33:41 -0000
X-Originating-IP: 127.0.0.1
X-Sender: dougb@dougbarton.us
Message-ID: <4C6DDB74.3090102@FreeBSD.org>
Date: Thu, 19 Aug 2010 18:33:40 -0700
From: Doug Barton 
Organization: http://SupersetSolutions.com/
User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US;
	rv:1.9.2.8) Gecko/20100807 Thunderbird/3.1.2
MIME-Version: 1.0
To: "Bjoern A. Zeeb" 
References: <201008191131.o7JBV4Yf002412@svn.freebsd.org>
	<4C6D18BE.2000905@fer.hr> <4C6D95A8.9070105@FreeBSD.org>
	<20100819213159.B48418@maildrop.int.zabbadoz.net>
In-Reply-To: <20100819213159.B48418@maildrop.int.zabbadoz.net>
X-Enigmail-Version: 1.1.2
OpenPGP: id=1A1ABC84
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@FreeBSD.org, Ana Kukec ,
	svn-src-all@FreeBSD.org, src-committers@FreeBSD.org
Subject: Re: svn commit: r211501 - in head/sys: modules modules/send netinet
 netinet6 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, 20 Aug 2010 01:33:43 -0000

On 08/19/2010 14:50, Bjoern A. Zeeb wrote:
> On Thu, 19 Aug 2010, Doug Barton wrote:
>
>> On 08/19/2010 04:42, Ana Kukec wrote:
>>> Hi all,
>>>
>>> A man page for the kernel side SeND, and an updated port with
>>> Secure Neighbor Discovery application will follow soon.
>>
>> At minimum committing the man page along with new code is how such
>>  things should be done. Can you define "soon?"
>
> Yes I can: soon will be when it'll be comitted.

I'm guessing that's an attempt at humor, but what I'm looking for is an 
actual timeline. If the answer is "in the next day or two" then that's 
fine, we'll let this one go with a warning. If the answer is "someday" 
then I'm going to request that the code be backed out until the man 
page(s) are done. I'm actually trying to be reasonable and work with a 
new developer so that they can learn how we like to have things done 
around here. What are you trying to do?

> Meanwhile if you have time I'd know several dozen other things we
> don't have a man page for ...

I would definitely recommend that you make a list of them, preferably 
someplace visible like the wiki. If you don't already have access to the 
wiki (or some other suitable forum) then send the list to -doc@ and 
we'll make sure that it gets posted. Given the recent resurgence of 
interest in updating our documentation it certainly wouldn't hurt to 
have some examples of low-hanging fruit that we can turn budding mdoc 
gurus loose on.

Meanwhile, the fact that in the past code has been committed without man 
pages is the exact cause of the problem you're describing. It is 
certainly not a justification for continuing to do it wrong.


Doug

-- 

	Improve the effectiveness of your Internet presence with
	a domain name makeover!    http://SupersetSolutions.com/

	Computers are useless. They can only give you answers.
			-- Pablo Picasso


From owner-svn-src-all@FreeBSD.ORG  Fri Aug 20 04:15:05 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B606610656A3;
	Fri, 20 Aug 2010 04:15:05 +0000 (UTC)
	(envelope-from davidxu@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A61648FC12;
	Fri, 20 Aug 2010 04:15:05 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7K4F5Z0025823;
	Fri, 20 Aug 2010 04:15:05 GMT (envelope-from davidxu@svn.freebsd.org)
Received: (from davidxu@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7K4F5ll025821;
	Fri, 20 Aug 2010 04:15:05 GMT (envelope-from davidxu@svn.freebsd.org)
Message-Id: <201008200415.o7K4F5ll025821@svn.freebsd.org>
From: David Xu 
Date: Fri, 20 Aug 2010 04:15: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: r211522 - head/lib/libthr/thread
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 20 Aug 2010 04:15:05 -0000

Author: davidxu
Date: Fri Aug 20 04:15:05 2010
New Revision: 211522
URL: http://svn.freebsd.org/changeset/base/211522

Log:
  According to specification, function fcntl() is a cancellation point only
  when cmd argument is F_SETLKW.

Modified:
  head/lib/libthr/thread/thr_syscalls.c

Modified: head/lib/libthr/thread/thr_syscalls.c
==============================================================================
--- head/lib/libthr/thread/thr_syscalls.c	Fri Aug 20 01:23:17 2010	(r211521)
+++ head/lib/libthr/thread/thr_syscalls.c	Fri Aug 20 04:15:05 2010	(r211522)
@@ -242,8 +242,6 @@ __fcntl(int fd, int cmd,...)
 	int	ret;
 	va_list	ap;
 	
-	_thr_cancel_enter(curthread);
-
 	va_start(ap, cmd);
 	switch (cmd) {
 	case F_DUPFD:
@@ -257,6 +255,17 @@ __fcntl(int fd, int cmd,...)
 	case F_GETFL:
 		ret = __sys_fcntl(fd, cmd);
 		break;
+
+	case F_OSETLKW:
+	case F_SETLKW:
+		_thr_cancel_enter(curthread);
+#ifdef SYSCALL_COMPAT
+		ret = __fcntl_compat(fd, cmd, va_arg(ap, void *));
+#else
+		ret = __sys_fcntl(fd, cmd, va_arg(ap, void *));
+#endif
+		_thr_cancel_leave(curthread);
+		break;
 	default:
 #ifdef SYSCALL_COMPAT
 		ret = __fcntl_compat(fd, cmd, va_arg(ap, void *));
@@ -266,8 +275,6 @@ __fcntl(int fd, int cmd,...)
 	}
 	va_end(ap);
 
-	_thr_cancel_leave(curthread);
-
 	return (ret);
 }
 

From owner-svn-src-all@FreeBSD.ORG  Fri Aug 20 04:28:30 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AFDC510656A3;
	Fri, 20 Aug 2010 04:28:30 +0000 (UTC)
	(envelope-from davidxu@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A02BC8FC1A;
	Fri, 20 Aug 2010 04:28:30 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7K4SU0d026146;
	Fri, 20 Aug 2010 04:28:30 GMT (envelope-from davidxu@svn.freebsd.org)
Received: (from davidxu@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7K4SUYU026144;
	Fri, 20 Aug 2010 04:28:30 GMT (envelope-from davidxu@svn.freebsd.org)
Message-Id: <201008200428.o7K4SUYU026144@svn.freebsd.org>
From: David Xu 
Date: Fri, 20 Aug 2010 04:28: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: r211523 - 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: Fri, 20 Aug 2010 04:28:30 -0000

Author: davidxu
Date: Fri Aug 20 04:28:30 2010
New Revision: 211523
URL: http://svn.freebsd.org/changeset/base/211523

Log:
  If thread set a TDP_WAKEUP for itself, clears the flag and returns EINTR
  immediately, this is used for implementing reliable pthread cancellation.

Modified:
  head/sys/kern/subr_sleepqueue.c

Modified: head/sys/kern/subr_sleepqueue.c
==============================================================================
--- head/sys/kern/subr_sleepqueue.c	Fri Aug 20 04:15:05 2010	(r211522)
+++ head/sys/kern/subr_sleepqueue.c	Fri Aug 20 04:28:30 2010	(r211523)
@@ -408,6 +408,12 @@ sleepq_catch_signals(void *wchan, int pr
 	sc = SC_LOOKUP(wchan);
 	mtx_assert(&sc->sc_lock, MA_OWNED);
 	MPASS(wchan != NULL);
+	if ((td->td_pflags & TDP_WAKEUP) != 0) {
+		td->td_pflags &= ~TDP_WAKEUP;
+		ret = EINTR;
+		goto out;
+	}
+
 	/*
 	 * See if there are any pending signals for this thread.  If not
 	 * we can switch immediately.  Otherwise do the signal processing
@@ -453,6 +459,7 @@ sleepq_catch_signals(void *wchan, int pr
 		sleepq_switch(wchan, pri);
 		return (0);
 	}
+out:
 	/*
 	 * There were pending signals and this thread is still
 	 * on the sleep queue, remove it from the sleep queue.

From owner-svn-src-all@FreeBSD.ORG  Fri Aug 20 05:15:40 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 14AFF10656A3;
	Fri, 20 Aug 2010 05:15:40 +0000 (UTC)
	(envelope-from davidxu@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 034658FC13;
	Fri, 20 Aug 2010 05:15:40 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7K5FeSf027061;
	Fri, 20 Aug 2010 05:15:40 GMT (envelope-from davidxu@svn.freebsd.org)
Received: (from davidxu@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7K5Fdsq027054;
	Fri, 20 Aug 2010 05:15:39 GMT (envelope-from davidxu@svn.freebsd.org)
Message-Id: <201008200515.o7K5Fdsq027054@svn.freebsd.org>
From: David Xu 
Date: Fri, 20 Aug 2010 05:15: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: r211524 - head/lib/libthr/thread
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 20 Aug 2010 05:15:40 -0000

Author: davidxu
Date: Fri Aug 20 05:15:39 2010
New Revision: 211524
URL: http://svn.freebsd.org/changeset/base/211524

Log:
    In current implementation, thread cancellation is done in signal handler,
  which does not know what is the state of interrupted system call, for
  example, open() system call opened a file and the thread is still cancelled,
  result is descriptor leak, there are other problems which can cause resource
  leak or undeterminable side effect when a thread is cancelled. However, this
  is no longer true in new implementation.
  
    In defering mode, a thread is canceled if cancellation request is pending and
  later the thread enters a cancellation point, otherwise, a later
  pthread_cancel() just causes SIGCANCEL to be sent to the target thread, and
  causes target thread to abort system call, userland code in libthr then checks
  cancellation state, and cancels the thread if needed. For example, the
  cancellation point open(), the thread may be canceled at start,
  but later, if it opened a file descriptor, it is not canceled, this avoids
  file handle leak. Another example is read(), a thread may be canceled at start
  of the function, but later, if it read some bytes from a socket, the thread
  is not canceled, the caller then can decide if it should still enable cancelling
  or disable it and continue reading data until it thinks it has read all
  bytes of a packet, and keeps a protocol stream in health state, if user ignores
  partly reading of a packet without disabling cancellation, then second iteration
  of read loop cause the thread to be cancelled.
  An exception is that the close() cancellation point always closes a file handle
  despite whether the thread is cancelled or not.
  
    The old mechanism is still kept, for a functions which is not so easily to
  fix a cancellation problem, the rough mechanism is used.
  
  Reviewed by: kib@

Modified:
  head/lib/libthr/thread/thr_cancel.c
  head/lib/libthr/thread/thr_cond.c
  head/lib/libthr/thread/thr_join.c
  head/lib/libthr/thread/thr_private.h
  head/lib/libthr/thread/thr_sig.c
  head/lib/libthr/thread/thr_syscalls.c

Modified: head/lib/libthr/thread/thr_cancel.c
==============================================================================
--- head/lib/libthr/thread/thr_cancel.c	Fri Aug 20 04:28:30 2010	(r211523)
+++ head/lib/libthr/thread/thr_cancel.c	Fri Aug 20 05:15:39 2010	(r211524)
@@ -42,7 +42,7 @@ static inline void
 testcancel(struct pthread *curthread)
 {
 	if (__predict_false(SHOULD_CANCEL(curthread) &&
-	    !THR_IN_CRITICAL(curthread) && curthread->cancel_defer == 0))
+	    !THR_IN_CRITICAL(curthread)))
 		_pthread_exit(PTHREAD_CANCELED);
 }
 
@@ -143,40 +143,44 @@ _pthread_testcancel(void)
 void
 _thr_cancel_enter(struct pthread *curthread)
 {
-	if (curthread->cancel_enable) {
-		curthread->cancel_point++;
+	curthread->cancel_point++;
+	if (curthread->cancel_enable)
 		testcancel(curthread);
+}
+
+void
+_thr_cancel_enter_defer(struct pthread *curthread, int maycancel)
+{
+	curthread->cancel_defer++;
+	curthread->cancel_point++;
+	if (__predict_false(SHOULD_CANCEL(curthread) &&
+	    !THR_IN_CRITICAL(curthread))) {
+		if (!maycancel)
+			thr_wake(curthread->tid);
+		else
+			_pthread_exit(PTHREAD_CANCELED);
 	}
 }
 
 void
 _thr_cancel_leave(struct pthread *curthread)
 {
-	if (curthread->cancel_enable)
-		curthread->cancel_point--;
+	curthread->cancel_point--;
 }
 
 void
-_thr_cancel_enter_defer(struct pthread *curthread)
+_thr_cancel_leave2(struct pthread *curthread, int maycancel)
 {
-	if (curthread->cancel_enable) {
-		curthread->cancel_point++;
+	if (curthread->cancel_enable && maycancel)
 		testcancel(curthread);
-		curthread->cancel_defer++;
-	}
+	curthread->cancel_point--;
 }
 
 void
-_thr_cancel_leave_defer(struct pthread *curthread, int check)
+_thr_cancel_leave_defer(struct pthread *curthread, int maycancel)
 {
-	if (curthread->cancel_enable) {
-		if (!check) {
-			curthread->cancel_point--;
-			curthread->cancel_defer--;
-		} else {
-			curthread->cancel_defer--;
-			testcancel(curthread);
-			curthread->cancel_point--;
-		}
-	}
+	if (curthread->cancel_enable && maycancel)
+		testcancel(curthread);
+	curthread->cancel_point--;
+	curthread->cancel_defer--;
 }

Modified: head/lib/libthr/thread/thr_cond.c
==============================================================================
--- head/lib/libthr/thread/thr_cond.c	Fri Aug 20 04:28:30 2010	(r211523)
+++ head/lib/libthr/thread/thr_cond.c	Fri Aug 20 05:15:39 2010	(r211524)
@@ -162,6 +162,14 @@ cond_cancel_handler(void *arg)
 	_mutex_cv_lock(info->mutex, info->count);
 }
 
+/*
+ * Cancellation behaivor:
+ *   Thread may be canceled at start, if thread is canceled, it means it
+ *   did not get a wakeup from pthread_cond_signal(), otherwise, it is
+ *   not canceled.
+ *   Thread cancellation never cause wakeup from pthread_cond_signal()
+ *   to be lost.
+ */
 static int
 cond_wait_common(pthread_cond_t *cond, pthread_mutex_t *mutex,
 	const struct timespec *abstime, int cancel)
@@ -180,6 +188,8 @@ cond_wait_common(pthread_cond_t *cond, p
 	    (ret = init_static(curthread, cond)) != 0))
 		return (ret);
 
+	_thr_testcancel(curthread);
+
 	cv = *cond;
 	THR_UMUTEX_LOCK(curthread, &cv->c_lock);
 	ret = _mutex_cv_unlock(mutex, &info.count);
@@ -200,10 +210,10 @@ cond_wait_common(pthread_cond_t *cond, p
 
 	if (cancel) {
 		THR_CLEANUP_PUSH(curthread, cond_cancel_handler, &info);
-		_thr_cancel_enter_defer(curthread);
+		_thr_cancel_enter_defer(curthread, 0);
 		ret = _thr_ucond_wait(&cv->c_kerncv, &cv->c_lock, tsp, 1);
 		info.cond = NULL;
-		_thr_cancel_leave_defer(curthread, ret);
+		_thr_cancel_leave_defer(curthread, (ret != 0));
 		THR_CLEANUP_POP(curthread, 0);
 	} else {
 		ret = _thr_ucond_wait(&cv->c_kerncv, &cv->c_lock, tsp, 0);

Modified: head/lib/libthr/thread/thr_join.c
==============================================================================
--- head/lib/libthr/thread/thr_join.c	Fri Aug 20 04:28:30 2010	(r211523)
+++ head/lib/libthr/thread/thr_join.c	Fri Aug 20 05:15:39 2010	(r211524)
@@ -68,6 +68,10 @@ _pthread_timedjoin_np(pthread_t pthread,
 	return (join_common(pthread, thread_return, abstime));
 }
 
+/*
+ * Cancellation behavior:
+ *   if the thread is canceled, joinee is not recycled.
+ */
 static int
 join_common(pthread_t pthread, void **thread_return,
 	const struct timespec *abstime)
@@ -103,10 +107,11 @@ join_common(pthread_t pthread, void **th
 	THREAD_LIST_UNLOCK(curthread);
 
 	THR_CLEANUP_PUSH(curthread, backout_join, pthread);
-	_thr_cancel_enter(curthread);
+	_thr_cancel_enter_defer(curthread, 1);
 
 	tid = pthread->tid;
 	while (pthread->tid != TID_TERMINATED) {
+		_thr_testcancel(curthread);
 		if (abstime != NULL) {
 			clock_gettime(CLOCK_REALTIME, &ts);
 			TIMESPEC_SUB(&ts2, abstime, &ts);
@@ -122,7 +127,7 @@ join_common(pthread_t pthread, void **th
 			break;
 	}
 
-	_thr_cancel_leave(curthread);
+	_thr_cancel_leave_defer(curthread, 0);
 	THR_CLEANUP_POP(curthread, 0);
 
 	if (ret == ETIMEDOUT) {

Modified: head/lib/libthr/thread/thr_private.h
==============================================================================
--- head/lib/libthr/thread/thr_private.h	Fri Aug 20 04:28:30 2010	(r211523)
+++ head/lib/libthr/thread/thr_private.h	Fri Aug 20 05:15:39 2010	(r211524)
@@ -644,7 +644,8 @@ void	_thread_printf(int, const char *, .
 void	_thr_spinlock_init(void) __hidden;
 void	_thr_cancel_enter(struct pthread *) __hidden;
 void	_thr_cancel_leave(struct pthread *) __hidden;
-void	_thr_cancel_enter_defer(struct pthread *) __hidden;
+void	_thr_cancel_leave2(struct pthread *, int) __hidden;
+void	_thr_cancel_enter_defer(struct pthread *, int) __hidden;
 void	_thr_cancel_leave_defer(struct pthread *, int) __hidden;
 void	_thr_testcancel(struct pthread *) __hidden;
 void	_thr_signal_block(struct pthread *) __hidden;

Modified: head/lib/libthr/thread/thr_sig.c
==============================================================================
--- head/lib/libthr/thread/thr_sig.c	Fri Aug 20 04:28:30 2010	(r211523)
+++ head/lib/libthr/thread/thr_sig.c	Fri Aug 20 05:15:39 2010	(r211524)
@@ -67,8 +67,6 @@ sigcancel_handler(int sig __unused,
 {
 	struct pthread *curthread = _get_curthread();
 
-	if (curthread->cancel_defer && curthread->cancel_pending)
-		thr_wake(curthread->tid);
 	curthread->in_sigcancel_handler++;
 	_thr_ast(curthread);
 	curthread->in_sigcancel_handler--;
@@ -77,13 +75,50 @@ sigcancel_handler(int sig __unused,
 void
 _thr_ast(struct pthread *curthread)
 {
-	if (!THR_IN_CRITICAL(curthread)) {
-		_thr_testcancel(curthread);
-		if (__predict_false((curthread->flags &
-		    (THR_FLAGS_NEED_SUSPEND | THR_FLAGS_SUSPENDED))
-			== THR_FLAGS_NEED_SUSPEND))
-			_thr_suspend_check(curthread);
+
+	if (THR_IN_CRITICAL(curthread))
+		return;
+
+	if (curthread->cancel_pending && curthread->cancel_enable
+		&& !curthread->cancelling) {
+		if (curthread->cancel_async) {
+			/*
+		 	 * asynchronous cancellation mode, act upon
+			 * immediately.
+		 	 */
+			_pthread_exit(PTHREAD_CANCELED);
+		} else {
+			/*
+		 	 * Otherwise, we are in defer mode, and we are at
+			 * cancel point, tell kernel to not block the current
+			 * thread on next cancelable system call.
+			 * 
+			 * There are two cases we should call thr_wake() to 
+			 * turn on TDP_WAKEUP in kernel:
+			 * 1) we are going to call a cancelable system call,
+			 *    non-zero cancel_point means we are already in
+			 *    cancelable state, next system call is cancelable.
+			 * 2) because _thr_ast() may be called by
+			 *    THR_CRITICAL_LEAVE() which is used by rtld rwlock
+			 *    and any libthr internal locks, when rtld rwlock
+			 *    is used, it is mostly caused my an unresolved PLT.
+			 *    those routines may clear the TDP_WAKEUP flag by
+			 *    invoking some system calls, in those cases, we
+			 *    also should reenable the flag.
+		 	 */
+			if (curthread->cancel_point) {
+				if (curthread->cancel_defer)
+					thr_wake(curthread->tid);
+				else
+					_pthread_exit(PTHREAD_CANCELED);
+			}
+		}
 	}
+
+	if (__predict_false((curthread->flags &
+	    (THR_FLAGS_NEED_SUSPEND | THR_FLAGS_SUSPENDED))
+		== THR_FLAGS_NEED_SUSPEND))
+		_thr_suspend_check(curthread);
 }
 
 void
@@ -296,6 +331,11 @@ _sigtimedwait(const sigset_t *set, sigin
 	return (ret);
 }
 
+/*
+ * Cancellation behavior:
+ *   Thread may be canceled at start, if thread got signal,
+ *   it is not canceled.
+ */
 int
 __sigtimedwait(const sigset_t *set, siginfo_t *info,
 	const struct timespec * timeout)
@@ -311,9 +351,9 @@ __sigtimedwait(const sigset_t *set, sigi
 		pset = &newset;
 	} else
 		pset = set;
-	_thr_cancel_enter(curthread);
+	_thr_cancel_enter_defer(curthread, 1);
 	ret = __sys_sigtimedwait(pset, info, timeout);
-	_thr_cancel_leave(curthread);
+	_thr_cancel_leave_defer(curthread, (ret == -1));
 	return (ret);
 }
 
@@ -335,6 +375,11 @@ _sigwaitinfo(const sigset_t *set, siginf
 	return (ret);
 }
 
+/*
+ * Cancellation behavior:
+ *   Thread may be canceled at start, if thread got signal,
+ *   it is not canceled.
+ */ 
 int
 __sigwaitinfo(const sigset_t *set, siginfo_t *info)
 {
@@ -350,9 +395,9 @@ __sigwaitinfo(const sigset_t *set, sigin
 	} else
 		pset = set;
 
-	_thr_cancel_enter(curthread);
+	_thr_cancel_enter_defer(curthread, 1);
 	ret = __sys_sigwaitinfo(pset, info);
-	_thr_cancel_leave(curthread);
+	_thr_cancel_leave_defer(curthread, ret == -1);
 	return (ret);
 }
 
@@ -374,6 +419,11 @@ _sigwait(const sigset_t *set, int *sig)
 	return (ret);
 }
 
+/*
+ * Cancellation behavior:
+ *   Thread may be canceled at start, if thread got signal,
+ *   it is not canceled.
+ */ 
 int
 __sigwait(const sigset_t *set, int *sig)
 {
@@ -389,8 +439,8 @@ __sigwait(const sigset_t *set, int *sig)
 	} else 
 		pset = set;
 
-	_thr_cancel_enter(curthread);
+	_thr_cancel_enter_defer(curthread, 1);
 	ret = __sys_sigwait(pset, sig);
-	_thr_cancel_leave(curthread);
+	_thr_cancel_leave_defer(curthread, (ret != 0));
 	return (ret);
 }

Modified: head/lib/libthr/thread/thr_syscalls.c
==============================================================================
--- head/lib/libthr/thread/thr_syscalls.c	Fri Aug 20 04:28:30 2010	(r211523)
+++ head/lib/libthr/thread/thr_syscalls.c	Fri Aug 20 05:15:39 2010	(r211524)
@@ -158,6 +158,10 @@ ssize_t	__writev(int, const struct iovec
 
 __weak_reference(__accept, accept);
 
+/*
+ * Cancellation behavior:
+ *   If thread is canceled, no socket is created.
+ */
 int
 __accept(int s, struct sockaddr *addr, socklen_t *addrlen)
 {
@@ -165,9 +169,9 @@ __accept(int s, struct sockaddr *addr, s
 	int ret;
 
 	curthread = _get_curthread();
-	_thr_cancel_enter(curthread);
+	_thr_cancel_enter_defer(curthread, 1);
 	ret = __sys_accept(s, addr, addrlen);
-	_thr_cancel_leave(curthread);
+	_thr_cancel_leave_defer(curthread, ret == -1);
 
  	return (ret);
 }
@@ -190,61 +194,84 @@ __aio_suspend(const struct aiocb * const
 
 __weak_reference(__close, close);
 
+/*
+ * Cancellation behavior:
+ *   According to manual of close(), the file descriptor is always deleted.
+ *   Here, thread is only canceled after the system call, so the file
+ *   descriptor is always deleted despite whether the thread is canceled
+ *   or not.
+ */
 int
 __close(int fd)
 {
 	struct pthread	*curthread = _get_curthread();
 	int	ret;
 
-	_thr_cancel_enter(curthread);
+	_thr_cancel_enter_defer(curthread, 0);
 	ret = __sys_close(fd);
-	_thr_cancel_leave(curthread);
+	_thr_cancel_leave_defer(curthread, 1);
 	
 	return (ret);
 }
 
 __weak_reference(__connect, connect);
 
+/*
+ * Cancellation behavior:
+ *   If the thread is canceled, connection is not made.
+ */
 int
 __connect(int fd, const struct sockaddr *name, socklen_t namelen)
 {
 	struct pthread *curthread = _get_curthread();
 	int ret;
 
-	_thr_cancel_enter(curthread);
+	_thr_cancel_enter_defer(curthread, 0);
 	ret = __sys_connect(fd, name, namelen);
-	_thr_cancel_leave(curthread);
+	_thr_cancel_leave_defer(curthread, ret == -1);
 
  	return (ret);
 }
 
 __weak_reference(___creat, creat);
 
+/*
+ * Cancellation behavior:
+ *   If thread is canceled, file is not created.
+ */
 int
 ___creat(const char *path, mode_t mode)
 {
 	struct pthread *curthread = _get_curthread();
 	int ret;
 
-	_thr_cancel_enter(curthread);
+	_thr_cancel_enter_defer(curthread, 1);
 	ret = __creat(path, mode);
-	_thr_cancel_leave(curthread);
+	_thr_cancel_leave_defer(curthread, ret == -1);
 	
 	return ret;
 }
 
 __weak_reference(__fcntl, fcntl);
 
+/*
+ * Cancellation behavior:
+ *   According to specification, only F_SETLKW is a cancellation point.
+ *   Thread is only canceled at start, or canceled if the system call
+ *   is failure, this means the function does not generate side effect
+ *   if it is canceled.
+ */
 int
 __fcntl(int fd, int cmd,...)
 {
 	struct pthread *curthread = _get_curthread();
 	int	ret;
 	va_list	ap;
-	
+
 	va_start(ap, cmd);
 	switch (cmd) {
 	case F_DUPFD:
+	case F_DUP2FD:
 		ret = __sys_fcntl(fd, cmd, va_arg(ap, int));
 		break;
 	case F_SETFD:
@@ -255,16 +282,15 @@ __fcntl(int fd, int cmd,...)
 	case F_GETFL:
 		ret = __sys_fcntl(fd, cmd);
 		break;
-
 	case F_OSETLKW:
 	case F_SETLKW:
-		_thr_cancel_enter(curthread);
+		_thr_cancel_enter_defer(curthread, 1);
 #ifdef SYSCALL_COMPAT
 		ret = __fcntl_compat(fd, cmd, va_arg(ap, void *));
 #else
 		ret = __sys_fcntl(fd, cmd, va_arg(ap, void *));
 #endif
-		_thr_cancel_leave(curthread);
+		_thr_cancel_leave_defer(curthread, ret == -1);
 		break;
 	default:
 #ifdef SYSCALL_COMPAT
@@ -280,30 +306,38 @@ __fcntl(int fd, int cmd,...)
 
 __weak_reference(__fsync, fsync);
 
+/*
+ * Cancellation behavior:
+ *   Thread may be canceled after system call.
+ */
 int
 __fsync(int fd)
 {
 	struct pthread *curthread = _get_curthread();
 	int	ret;
 
-	_thr_cancel_enter(curthread);
+	_thr_cancel_enter_defer(curthread, 0);
 	ret = __sys_fsync(fd);
-	_thr_cancel_leave(curthread);
+	_thr_cancel_leave_defer(curthread, 1);
 
 	return (ret);
 }
 
 __weak_reference(__msync, msync);
 
+/*
+ * Cancellation behavior:
+ *   Thread may be canceled after system call.
+ */
 int
 __msync(void *addr, size_t len, int flags)
 {
 	struct pthread *curthread = _get_curthread();
 	int	ret;
 
-	_thr_cancel_enter(curthread);
+	_thr_cancel_enter_defer(curthread, 0);
 	ret = __sys_msync(addr, len, flags);
-	_thr_cancel_leave(curthread);
+	_thr_cancel_leave_defer(curthread, 1);
 
 	return ret;
 }
@@ -326,6 +360,10 @@ __nanosleep(const struct timespec *time_
 
 __weak_reference(__open, open);
 
+/*
+ * Cancellation behavior:
+ *   If the thread is canceled, file is not opened.
+ */
 int
 __open(const char *path, int flags,...)
 {
@@ -334,8 +372,6 @@ __open(const char *path, int flags,...)
 	int	mode = 0;
 	va_list	ap;
 
-	_thr_cancel_enter(curthread);
-	
 	/* Check if the file is being created: */
 	if (flags & O_CREAT) {
 		/* Get the creation mode: */
@@ -344,15 +380,19 @@ __open(const char *path, int flags,...)
 		va_end(ap);
 	}
 	
+	_thr_cancel_enter_defer(curthread, 1);
 	ret = __sys_open(path, flags, mode);
-
-	_thr_cancel_leave(curthread);
+	_thr_cancel_leave_defer(curthread, ret == -1);
 
 	return ret;
 }
 
 __weak_reference(__openat, openat);
 
+/*
+ * Cancellation behavior:
+ *   If the thread is canceled, file is not opened.
+ */
 int
 __openat(int fd, const char *path, int flags, ...)
 {
@@ -361,7 +401,6 @@ __openat(int fd, const char *path, int f
 	int	mode = 0;
 	va_list	ap;
 
-	_thr_cancel_enter(curthread);
 	
 	/* Check if the file is being created: */
 	if (flags & O_CREAT) {
@@ -371,30 +410,40 @@ __openat(int fd, const char *path, int f
 		va_end(ap);
 	}
 	
+	_thr_cancel_enter_defer(curthread, 1);
 	ret = __sys_openat(fd, path, flags, mode);
-
-	_thr_cancel_leave(curthread);
+	_thr_cancel_leave_defer(curthread, ret == -1);
 
 	return ret;
 }
 
 __weak_reference(__poll, poll);
 
+/*
+ * Cancellation behavior:
+ *   Thread may be canceled at start, but if the system call returns something,
+ *   the thread is not canceled.
+ */
 int
 __poll(struct pollfd *fds, unsigned int nfds, int timeout)
 {
 	struct pthread *curthread = _get_curthread();
 	int ret;
 
-	_thr_cancel_enter(curthread);
+	_thr_cancel_enter_defer(curthread, 1);
 	ret = __sys_poll(fds, nfds, timeout);
-	_thr_cancel_leave(curthread);
+	_thr_cancel_leave_defer(curthread, ret == -1);
 
 	return ret;
 }
 
 __weak_reference(___pselect, pselect);
 
+/*
+ * Cancellation behavior:
+ *   Thread may be canceled at start, but if the system call returns something,
+ *   the thread is not canceled.
+ */
 int 
 ___pselect(int count, fd_set *rfds, fd_set *wfds, fd_set *efds, 
 	const struct timespec *timo, const sigset_t *mask)
@@ -402,45 +451,59 @@ ___pselect(int count, fd_set *rfds, fd_s
 	struct pthread *curthread = _get_curthread();
 	int ret;
 
-	_thr_cancel_enter(curthread);
+	_thr_cancel_enter_defer(curthread, 1);
 	ret = __sys_pselect(count, rfds, wfds, efds, timo, mask);
-	_thr_cancel_leave(curthread);
+	_thr_cancel_leave_defer(curthread, ret == -1);
 
 	return (ret);
 }
 
 __weak_reference(__read, read);
 
+/*
+ * Cancellation behavior:
+ *   Thread may be canceled at start, but if the system call got some data, 
+ *   the thread is not canceled.
+ */
 ssize_t
 __read(int fd, void *buf, size_t nbytes)
 {
 	struct pthread *curthread = _get_curthread();
 	ssize_t	ret;
 
-	_thr_cancel_enter(curthread);
+	_thr_cancel_enter_defer(curthread, 1);
 	ret = __sys_read(fd, buf, nbytes);
-	_thr_cancel_leave(curthread);
+	_thr_cancel_leave_defer(curthread, ret == -1);
 
 	return ret;
 }
 
 __weak_reference(__readv, readv);
 
+/*
+ * Cancellation behavior:
+ *   Thread may be canceled at start, but if the system call got some data, 
+ *   the thread is not canceled.
+ */
 ssize_t
 __readv(int fd, const struct iovec *iov, int iovcnt)
 {
 	struct pthread *curthread = _get_curthread();
 	ssize_t ret;
 
-	_thr_cancel_enter(curthread);
+	_thr_cancel_enter_defer(curthread, 1);
 	ret = __sys_readv(fd, iov, iovcnt);
-	_thr_cancel_leave(curthread);
-
+	_thr_cancel_leave_defer(curthread, ret == -1);
 	return ret;
 }
 
 __weak_reference(__recvfrom, recvfrom);
 
+/*
+ * Cancellation behavior:
+ *   Thread may be canceled at start, but if the system call got some data, 
+ *   the thread is not canceled.
+ */
 ssize_t
 __recvfrom(int s, void *b, size_t l, int f, struct sockaddr *from,
     socklen_t *fl)
@@ -448,28 +511,38 @@ __recvfrom(int s, void *b, size_t l, int
 	struct pthread *curthread = _get_curthread();
 	ssize_t ret;
 
-	_thr_cancel_enter(curthread);
+	_thr_cancel_enter_defer(curthread, 1);
 	ret = __sys_recvfrom(s, b, l, f, from, fl);
-	_thr_cancel_leave(curthread);
+	_thr_cancel_leave_defer(curthread, ret == -1);
 	return (ret);
 }
 
 __weak_reference(__recvmsg, recvmsg);
 
+/*
+ * Cancellation behavior:
+ *   Thread may be canceled at start, but if the system call got some data, 
+ *   the thread is not canceled.
+ */
 ssize_t
 __recvmsg(int s, struct msghdr *m, int f)
 {
 	struct pthread *curthread = _get_curthread();
 	ssize_t ret;
 
-	_thr_cancel_enter(curthread);
+	_thr_cancel_enter_defer(curthread, 1);
 	ret = __sys_recvmsg(s, m, f);
-	_thr_cancel_leave(curthread);
+	_thr_cancel_leave_defer(curthread, ret == -1);
 	return (ret);
 }
 
 __weak_reference(__select, select);
 
+/*
+ * Cancellation behavior:
+ *   Thread may be canceled at start, but if the system call returns something,
+ *   the thread is not canceled.
+ */
 int 
 __select(int numfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
 	struct timeval *timeout)
@@ -477,28 +550,38 @@ __select(int numfds, fd_set *readfds, fd
 	struct pthread *curthread = _get_curthread();
 	int ret;
 
-	_thr_cancel_enter(curthread);
+	_thr_cancel_enter_defer(curthread, 1);
 	ret = __sys_select(numfds, readfds, writefds, exceptfds, timeout);
-	_thr_cancel_leave(curthread);
+	_thr_cancel_leave_defer(curthread, ret == -1);
 	return ret;
 }
 
 __weak_reference(__sendmsg, sendmsg);
 
+/*
+ * Cancellation behavior:
+ *   Thread may be canceled at start, but if the system call sent
+ *   data, the thread is not canceled.
+ */
 ssize_t
 __sendmsg(int s, const struct msghdr *m, int f)
 {
 	struct pthread *curthread = _get_curthread();
 	ssize_t ret;
 
-	_thr_cancel_enter(curthread);
+	_thr_cancel_enter_defer(curthread, 1);
 	ret = __sys_sendmsg(s, m, f);
-	_thr_cancel_leave(curthread);
+	_thr_cancel_leave_defer(curthread, ret <= 0);
 	return (ret);
 }
 
 __weak_reference(__sendto, sendto);
 
+/*
+ * Cancellation behavior:
+ *   Thread may be canceled at start, but if the system call sent some
+ *   data, the thread is not canceled.
+ */
 ssize_t
 __sendto(int s, const void *m, size_t l, int f, const struct sockaddr *t,
     socklen_t tl)
@@ -506,9 +589,9 @@ __sendto(int s, const void *m, size_t l,
 	struct pthread *curthread = _get_curthread();
 	ssize_t ret;
 
-	_thr_cancel_enter(curthread);
+	_thr_cancel_enter_defer(curthread, 1);
 	ret = __sys_sendto(s, m, l, f, t, tl);
-	_thr_cancel_leave(curthread);
+	_thr_cancel_leave_defer(curthread, ret <= 0);
 	return (ret);
 }
 
@@ -544,16 +627,20 @@ ___system(const char *string)
 
 __weak_reference(___tcdrain, tcdrain);
 
+/*
+ * Cancellation behavior:
+ *   If thread is canceled, the system call is not completed,
+ *   this means not all bytes were drained.
+ */
 int
 ___tcdrain(int fd)
 {
 	struct pthread *curthread = _get_curthread();
 	int	ret;
 	
-	_thr_cancel_enter(curthread);
+	_thr_cancel_enter_defer(curthread, 1);
 	ret = __tcdrain(fd);
-	_thr_cancel_leave(curthread);
-
+	_thr_cancel_leave_defer(curthread, ret == -1);
 	return (ret);
 }
 
@@ -574,90 +661,118 @@ ___usleep(useconds_t useconds)
 
 __weak_reference(___wait, wait);
 
+/*
+ * Cancellation behavior:
+ *   Thread may be canceled at start, but if the system call returns
+ *   a child pid, the thread is not canceled.
+ */
 pid_t
 ___wait(int *istat)
 {
 	struct pthread *curthread = _get_curthread();
 	pid_t	ret;
 
-	_thr_cancel_enter(curthread);
+	_thr_cancel_enter_defer(curthread, 1);
 	ret = __wait(istat);
-	_thr_cancel_leave(curthread);
+	_thr_cancel_leave_defer(curthread, ret <= 0);
 
 	return ret;
 }
 
 __weak_reference(__wait3, wait3);
 
+/*
+ * Cancellation behavior:
+ *   Thread may be canceled at start, but if the system call returns
+ *   a child pid, the thread is not canceled.
+ */
 pid_t
 __wait3(int *status, int options, struct rusage *rusage)
 {
 	struct pthread *curthread = _get_curthread();
 	pid_t ret;
 
-	_thr_cancel_enter(curthread);
+	_thr_cancel_enter_defer(curthread, 1);
 	ret = _wait4(WAIT_ANY, status, options, rusage);
-	_thr_cancel_leave(curthread);
+	_thr_cancel_leave_defer(curthread, ret <= 0);
 
 	return (ret);
 }
 
 __weak_reference(__wait4, wait4);
 
+/*
+ * Cancellation behavior:
+ *   Thread may be canceled at start, but if the system call returns
+ *   a child pid, the thread is not canceled.
+ */
 pid_t
 __wait4(pid_t pid, int *status, int options, struct rusage *rusage)
 {
 	struct pthread *curthread = _get_curthread();
 	pid_t ret;
 
-	_thr_cancel_enter(curthread);
+	_thr_cancel_enter_defer(curthread, 1);
 	ret = __sys_wait4(pid, status, options, rusage);
-	_thr_cancel_leave(curthread);
+	_thr_cancel_leave_defer(curthread, ret <= 0);
 
 	return ret;
 }
 
 __weak_reference(___waitpid, waitpid);
 
+/*
+ * Cancellation behavior:
+ *   Thread may be canceled at start, but if the system call returns
+ *   a child pid, the thread is not canceled.
+ */
 pid_t
 ___waitpid(pid_t wpid, int *status, int options)
 {
 	struct pthread *curthread = _get_curthread();
 	pid_t	ret;
 
-	_thr_cancel_enter(curthread);
+	_thr_cancel_enter_defer(curthread, 1);
 	ret = __waitpid(wpid, status, options);
-	_thr_cancel_leave(curthread);
+	_thr_cancel_leave_defer(curthread, ret <= 0);
 	
 	return ret;
 }
 
 __weak_reference(__write, write);
 
+/*
+ * Cancellation behavior:
+ *   Thread may be canceled at start, but if the thread wrote some data,
+ *   it is not canceled.
+ */
 ssize_t
 __write(int fd, const void *buf, size_t nbytes)
 {
 	struct pthread *curthread = _get_curthread();
 	ssize_t	ret;
 
-	_thr_cancel_enter(curthread);
+	_thr_cancel_enter_defer(curthread, 1);
 	ret = __sys_write(fd, buf, nbytes);
-	_thr_cancel_leave(curthread);
-
+	_thr_cancel_leave_defer(curthread, (ret <= 0));
 	return ret;
 }
 
 __weak_reference(__writev, writev);
 
+/*
+ * Cancellation behavior:
+ *   Thread may be canceled at start, but if the thread wrote some data,
+ *   it is not canceled.
+ */
 ssize_t
 __writev(int fd, const struct iovec *iov, int iovcnt)
 {
 	struct pthread *curthread = _get_curthread();
 	ssize_t ret;
 
-	_thr_cancel_enter(curthread);
+	_thr_cancel_enter_defer(curthread, 1);
 	ret = __sys_writev(fd, iov, iovcnt);
-	_thr_cancel_leave(curthread);
-
+	_thr_cancel_leave_defer(curthread, (ret <= 0));
 	return ret;
 }

From owner-svn-src-all@FreeBSD.ORG  Fri Aug 20 09:14:29 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8DD7610656A7;
	Fri, 20 Aug 2010 09:14:29 +0000 (UTC) (envelope-from des@des.no)
Received: from smtp.des.no (smtp.des.no [194.63.250.102])
	by mx1.freebsd.org (Postfix) with ESMTP id 4A5DB8FC1A;
	Fri, 20 Aug 2010 09:14:29 +0000 (UTC)
Received: from ds4.des.no (des.no [84.49.246.2])
	by smtp.des.no (Postfix) with ESMTP id 601B41FFC33;
	Fri, 20 Aug 2010 09:14:28 +0000 (UTC)
Received: by ds4.des.no (Postfix, from userid 1001)
	id C062B8456E; Fri, 20 Aug 2010 11:14:27 +0200 (CEST)
From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= 
To: Attilio Rao 
References: <201008161132.o7GBWKhx097183@svn.freebsd.org>
	<86mxsm4wff.fsf@ds4.des.no> <86bp924w3w.fsf@ds4.des.no>
	
	<8662z6r77w.fsf@ds4.des.no>
	
Date: Fri, 20 Aug 2010 11:14:27 +0200
In-Reply-To: 
	(Attilio Rao's message of "Thu, 19 Aug 2010 16:51:37 +0200")
Message-ID: <861v9ty7bg.fsf@ds4.des.no>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r211393 - 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: Fri, 20 Aug 2010 09:14:29 -0000

Attilio Rao  writes:
> Dag-Erling Sm=C3=B8rgrav  writes:
> > Perhaps the test in setusercontext() should be changed to use
> > geteuid() instead of getuid().
> Yes, I think that it probabilly makes more sense (geteuid() testing in
> setusercontext()).

What if the user's ~/.login_conf sets a custom PATH, and the application
switches back to root privs and fork()-exec()s some other program?

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no

From owner-svn-src-all@FreeBSD.ORG  Fri Aug 20 12:26:03 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3ACD01065673;
	Fri, 20 Aug 2010 12:26:03 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 29C9F8FC14;
	Fri, 20 Aug 2010 12:26:03 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7KCQ3HO037342;
	Fri, 20 Aug 2010 12:26:03 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7KCQ3v8037340;
	Fri, 20 Aug 2010 12:26:03 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201008201226.o7KCQ3v8037340@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Fri, 20 Aug 2010 12:26:03 +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: r211525 - stable/7/sys/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, 20 Aug 2010 12:26:03 -0000

Author: bz
Date: Fri Aug 20 12:26:02 2010
New Revision: 211525
URL: http://svn.freebsd.org/changeset/base/211525

Log:
  MFC r211115:
  
    MFp4 CH180235:
  
    Add proto spacers to inet6sw like we have for legacy IP. This allows us
    to dynamically pf_proto_register() for INET6 from modules, needed by
    upcoming CARP changes and SeND.
    MC and SCTP could make use of it as well in theory in the future after
    upcoming VIMAGE vnet teardown work.
  
    Discussed with:	will, anchie

Modified:
  stable/7/sys/netinet6/in6_proto.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/netinet6/in6_proto.c
==============================================================================
--- stable/7/sys/netinet6/in6_proto.c	Fri Aug 20 05:15:39 2010	(r211524)
+++ stable/7/sys/netinet6/in6_proto.c	Fri Aug 20 12:26:02 2010	(r211525)
@@ -134,6 +134,14 @@ static	struct pr_usrreqs nousrreqs;
 #define PR_LISTEN	0
 #define PR_ABRTACPTDIS	0
 
+/* Spacer for loadable protocols. */
+#define IP6PROTOSPACER   			\
+{						\
+	.pr_domain =		&inet6domain,	\
+	.pr_protocol =		PROTO_SPACER,	\
+	.pr_usrreqs =		&nousrreqs	\
+}
+
 struct ip6protosw inet6sw[] = {
 {
 	.pr_type =		0,
@@ -326,6 +334,15 @@ struct ip6protosw inet6sw[] = {
 	.pr_usrreqs =		&rip6_usrreqs
 },
 #endif /* DEV_CARP */
+/* Spacer n-times for loadable protocols. */
+IP6PROTOSPACER,
+IP6PROTOSPACER,
+IP6PROTOSPACER,
+IP6PROTOSPACER,
+IP6PROTOSPACER,
+IP6PROTOSPACER,
+IP6PROTOSPACER,
+IP6PROTOSPACER,
 /* raw wildcard */
 {
 	.pr_type =		SOCK_RAW,

From owner-svn-src-all@FreeBSD.ORG  Fri Aug 20 13:42:48 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D0D671065698;
	Fri, 20 Aug 2010 13:42:48 +0000 (UTC)
	(envelope-from davidxu@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id C049F8FC25;
	Fri, 20 Aug 2010 13:42:48 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7KDgmB1038864;
	Fri, 20 Aug 2010 13:42:48 GMT (envelope-from davidxu@svn.freebsd.org)
Received: (from davidxu@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7KDgmUE038862;
	Fri, 20 Aug 2010 13:42:48 GMT (envelope-from davidxu@svn.freebsd.org)
Message-Id: <201008201342.o7KDgmUE038862@svn.freebsd.org>
From: David Xu 
Date: Fri, 20 Aug 2010 13:42: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: r211526 - head/lib/libthr/thread
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 20 Aug 2010 13:42:48 -0000

Author: davidxu
Date: Fri Aug 20 13:42:48 2010
New Revision: 211526
URL: http://svn.freebsd.org/changeset/base/211526

Log:
  Reduce redundant code.
  
  Submitted by: kib

Modified:
  head/lib/libthr/thread/thr_sig.c

Modified: head/lib/libthr/thread/thr_sig.c
==============================================================================
--- head/lib/libthr/thread/thr_sig.c	Fri Aug 20 12:26:02 2010	(r211525)
+++ head/lib/libthr/thread/thr_sig.c	Fri Aug 20 13:42:48 2010	(r211526)
@@ -268,23 +268,26 @@ _pthread_sigmask(int how, const sigset_t
 
 __weak_reference(__sigsuspend, sigsuspend);
 
-int
-_sigsuspend(const sigset_t * set)
+static const sigset_t *
+thr_remove_thr_signals(const sigset_t *set, sigset_t *newset)
 {
-	sigset_t newset;
 	const sigset_t *pset;
-	int ret;
 
 	if (SIGISMEMBER(*set, SIGCANCEL)) {
-		newset = *set;
-		SIGDELSET(newset, SIGCANCEL);
-		pset = &newset;
+		*newset = *set;
+		SIGDELSET(*newset, SIGCANCEL);
+		pset = newset;
 	} else
 		pset = set;
+	return (pset);
+}
 
-	ret = __sys_sigsuspend(pset);
+int
+_sigsuspend(const sigset_t * set)
+{
+	sigset_t newset;
 
-	return (ret);
+	return (__sys_sigsuspend(thr_remove_thr_signals(set, &newset)));
 }
 
 int
@@ -292,18 +295,10 @@ __sigsuspend(const sigset_t * set)
 {
 	struct pthread *curthread = _get_curthread();
 	sigset_t newset;
-	const sigset_t *pset;
 	int ret;
 
-	if (SIGISMEMBER(*set, SIGCANCEL)) {
-		newset = *set;
-		SIGDELSET(newset, SIGCANCEL);
-		pset = &newset;
-	} else
-		pset = set;
-
 	_thr_cancel_enter(curthread);
-	ret = __sys_sigsuspend(pset);
+	ret = __sys_sigsuspend(thr_remove_thr_signals(set, &newset));
 	_thr_cancel_leave(curthread);
 
 	return (ret);
@@ -318,17 +313,9 @@ _sigtimedwait(const sigset_t *set, sigin
 	const struct timespec * timeout)
 {
 	sigset_t newset;
-	const sigset_t *pset;
-	int ret;
 
-	if (SIGISMEMBER(*set, SIGCANCEL)) {
-		newset = *set;
-		SIGDELSET(newset, SIGCANCEL);
-		pset = &newset;
-	} else
-		pset = set;
-	ret = __sys_sigtimedwait(pset, info, timeout);
-	return (ret);
+	return (__sys_sigtimedwait(thr_remove_thr_signals(set, &newset), info,
+	    timeout));
 }
 
 /*
@@ -342,17 +329,11 @@ __sigtimedwait(const sigset_t *set, sigi
 {
 	struct pthread	*curthread = _get_curthread();
 	sigset_t newset;
-	const sigset_t *pset;
 	int ret;
 
-	if (SIGISMEMBER(*set, SIGCANCEL)) {
-		newset = *set;
-		SIGDELSET(newset, SIGCANCEL);
-		pset = &newset;
-	} else
-		pset = set;
 	_thr_cancel_enter_defer(curthread, 1);
-	ret = __sys_sigtimedwait(pset, info, timeout);
+	ret = __sys_sigtimedwait(thr_remove_thr_signals(set, &newset), info,
+	    timeout);
 	_thr_cancel_leave_defer(curthread, (ret == -1));
 	return (ret);
 }
@@ -361,18 +342,8 @@ int
 _sigwaitinfo(const sigset_t *set, siginfo_t *info)
 {
 	sigset_t newset;
-	const sigset_t *pset;
-	int ret;
-
-	if (SIGISMEMBER(*set, SIGCANCEL)) {
-		newset = *set;
-		SIGDELSET(newset, SIGCANCEL);
-		pset = &newset;
-	} else
-		pset = set;
 
-	ret = __sys_sigwaitinfo(pset, info);
-	return (ret);
+	return (__sys_sigwaitinfo(thr_remove_thr_signals(set, &newset), info));
 }
 
 /*
@@ -385,18 +356,10 @@ __sigwaitinfo(const sigset_t *set, sigin
 {
 	struct pthread	*curthread = _get_curthread();
 	sigset_t newset;
-	const sigset_t *pset;
 	int ret;
 
-	if (SIGISMEMBER(*set, SIGCANCEL)) {
-		newset = *set;
-		SIGDELSET(newset, SIGCANCEL);
-		pset = &newset;
-	} else
-		pset = set;
-
 	_thr_cancel_enter_defer(curthread, 1);
-	ret = __sys_sigwaitinfo(pset, info);
+	ret = __sys_sigwaitinfo(thr_remove_thr_signals(set, &newset), info);
 	_thr_cancel_leave_defer(curthread, ret == -1);
 	return (ret);
 }
@@ -405,18 +368,8 @@ int
 _sigwait(const sigset_t *set, int *sig)
 {
 	sigset_t newset;
-	const sigset_t *pset;
-	int ret;
-
-	if (SIGISMEMBER(*set, SIGCANCEL)) {
-		newset = *set;
-		SIGDELSET(newset, SIGCANCEL);
-		pset = &newset;
-	} else 
-		pset = set;
 
-	ret = __sys_sigwait(pset, sig);
-	return (ret);
+	return (__sys_sigwait(thr_remove_thr_signals(set, &newset), sig));
 }
 
 /*
@@ -429,18 +382,10 @@ __sigwait(const sigset_t *set, int *sig)
 {
 	struct pthread	*curthread = _get_curthread();
 	sigset_t newset;
-	const sigset_t *pset;
 	int ret;
 
-	if (SIGISMEMBER(*set, SIGCANCEL)) {
-		newset = *set;
-		SIGDELSET(newset, SIGCANCEL);
-		pset = &newset;
-	} else 
-		pset = set;
-
 	_thr_cancel_enter_defer(curthread, 1);
-	ret = __sys_sigwait(pset, sig);
+	ret = __sys_sigwait(thr_remove_thr_signals(set, &newset), sig);
 	_thr_cancel_leave_defer(curthread, (ret != 0));
 	return (ret);
 }

From owner-svn-src-all@FreeBSD.ORG  Fri Aug 20 15:26:09 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8E82E1065674;
	Fri, 20 Aug 2010 15:26:09 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7E0FF8FC18;
	Fri, 20 Aug 2010 15:26:09 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7KFQ9Ih041134;
	Fri, 20 Aug 2010 15:26:09 GMT (envelope-from bz@svn.freebsd.org)
Received: (from bz@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7KFQ9KF041132;
	Fri, 20 Aug 2010 15:26:09 GMT (envelope-from bz@svn.freebsd.org)
Message-Id: <201008201526.o7KFQ9KF041132@svn.freebsd.org>
From: "Bjoern A. Zeeb" 
Date: Fri, 20 Aug 2010 15:26: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: r211527 - stable/8/sys/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, 20 Aug 2010 15:26:09 -0000

Author: bz
Date: Fri Aug 20 15:26:09 2010
New Revision: 211527
URL: http://svn.freebsd.org/changeset/base/211527

Log:
  MFC r211115:
  
    MFp4 CH180235:
  
    Add proto spacers to inet6sw like we have for legacy IP. This allows us
    to dynamically pf_proto_register() for INET6 from modules, needed by
    upcoming CARP changes and SeND.
    MC and SCTP could make use of it as well in theory in the future after
    upcoming VIMAGE vnet teardown work.
  
    Discussed with:	will, anchie

Modified:
  stable/8/sys/netinet6/in6_proto.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cam/   (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/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/netinet6/in6_proto.c
==============================================================================
--- stable/8/sys/netinet6/in6_proto.c	Fri Aug 20 13:42:48 2010	(r211526)
+++ stable/8/sys/netinet6/in6_proto.c	Fri Aug 20 15:26:09 2010	(r211527)
@@ -140,6 +140,14 @@ static	struct pr_usrreqs nousrreqs;
 #define PR_LISTEN	0
 #define PR_ABRTACPTDIS	0
 
+/* Spacer for loadable protocols. */
+#define IP6PROTOSPACER   			\
+{						\
+	.pr_domain =		&inet6domain,	\
+	.pr_protocol =		PROTO_SPACER,	\
+	.pr_usrreqs =		&nousrreqs	\
+}
+
 struct ip6protosw inet6sw[] = {
 {
 	.pr_type =		0,
@@ -335,6 +343,15 @@ struct ip6protosw inet6sw[] = {
 	.pr_usrreqs =		&rip6_usrreqs
 },
 #endif /* DEV_CARP */
+/* Spacer n-times for loadable protocols. */
+IP6PROTOSPACER,
+IP6PROTOSPACER,
+IP6PROTOSPACER,
+IP6PROTOSPACER,
+IP6PROTOSPACER,
+IP6PROTOSPACER,
+IP6PROTOSPACER,
+IP6PROTOSPACER,
 /* raw wildcard */
 {
 	.pr_type =		SOCK_RAW,

From owner-svn-src-all@FreeBSD.ORG  Fri Aug 20 17:20:06 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 276A710656A5;
	Fri, 20 Aug 2010 17:20:06 +0000 (UTC)
	(envelope-from mjacob@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 178398FC08;
	Fri, 20 Aug 2010 17:20:06 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7KHK5Z1043512;
	Fri, 20 Aug 2010 17:20:05 GMT (envelope-from mjacob@svn.freebsd.org)
Received: (from mjacob@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7KHK5T4043510;
	Fri, 20 Aug 2010 17:20:05 GMT (envelope-from mjacob@svn.freebsd.org)
Message-Id: <201008201720.o7KHK5T4043510@svn.freebsd.org>
From: Matt Jacob 
Date: Fri, 20 Aug 2010 17:20: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: r211529 - 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, 20 Aug 2010 17:20:06 -0000

Author: mjacob
Date: Fri Aug 20 17:20:05 2010
New Revision: 211529
URL: http://svn.freebsd.org/changeset/base/211529

Log:
  Revert r211434. Offline discussions have convinced me that this should
  be left alone for now.

Modified:
  head/sys/cam/scsi/scsi_da.c

Modified: head/sys/cam/scsi/scsi_da.c
==============================================================================
--- head/sys/cam/scsi/scsi_da.c	Fri Aug 20 16:00:36 2010	(r211528)
+++ head/sys/cam/scsi/scsi_da.c	Fri Aug 20 17:20:05 2010	(r211529)
@@ -958,8 +958,6 @@ dainit(void)
 static void
 daoninvalidate(struct cam_periph *periph)
 {
-	struct ccb_abort cab;
-	struct ccb_hdr *ccb_h, *ccb_h_t;
 	struct da_softc *softc;
 
 	softc = (struct da_softc *)periph->softc;
@@ -969,29 +967,15 @@ daoninvalidate(struct cam_periph *periph
 	 */
 	xpt_register_async(0, daasync, periph, periph->path);
 
-	/*
-	 * Invalidate the pack label
-	 */
 	softc->flags |= DA_FLAG_PACK_INVALID;
 
 	/*
 	 * Return all queued I/O with ENXIO.
+	 * XXX Handle any transactions queued to the card
+	 *     with XPT_ABORT_CCB.
 	 */
 	bioq_flush(&softc->bio_queue, NULL, ENXIO);
 
-	/*
-	 * Issue aborts for any pending commands.
-	 */
-	xpt_setup_ccb(&cab.ccb_h, periph->path, CAM_PRIORITY_NORMAL+1);
-	cab.ccb_h.func_code = XPT_ABORT;
-	LIST_FOREACH_SAFE(ccb_h, &softc->pending_ccbs, periph_links.le, ccb_h_t) {
-		cab.abort_ccb = (union ccb *)ccb_h;
-		xpt_action((union ccb *)&cab);
-	}
-
-	/*
-	 * This disk is *history*....
-	 */
 	disk_gone(softc->disk);
 	xpt_print(periph->path, "lost device\n");
 }

From owner-svn-src-all@FreeBSD.ORG  Fri Aug 20 17:52:49 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6E0091065697;
	Fri, 20 Aug 2010 17:52:49 +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 5E1EF8FC15;
	Fri, 20 Aug 2010 17:52:49 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7KHqnOl044145;
	Fri, 20 Aug 2010 17:52:49 GMT (envelope-from ume@svn.freebsd.org)
Received: (from ume@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7KHqnu1044143;
	Fri, 20 Aug 2010 17:52:49 GMT (envelope-from ume@svn.freebsd.org)
Message-Id: <201008201752.o7KHqnu1044143@svn.freebsd.org>
From: Hajimu UMEMOTO 
Date: Fri, 20 Aug 2010 17:52:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r211530 - head/sys/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, 20 Aug 2010 17:52:49 -0000

Author: ume
Date: Fri Aug 20 17:52:49 2010
New Revision: 211530
URL: http://svn.freebsd.org/changeset/base/211530

Log:
  optp may be NULL.

Modified:
  head/sys/netinet6/raw_ip6.c

Modified: head/sys/netinet6/raw_ip6.c
==============================================================================
--- head/sys/netinet6/raw_ip6.c	Fri Aug 20 17:20:05 2010	(r211529)
+++ head/sys/netinet6/raw_ip6.c	Fri Aug 20 17:52:49 2010	(r211530)
@@ -434,7 +434,8 @@ rip6_output(m, va_alist)
 	 * XXX: we may still need to determine the zone later.
 	 */
 	if (!(so->so_state & SS_ISCONNECTED)) {
-		if (!optp->ip6po_pktinfo || !optp->ip6po_pktinfo->ipi6_ifindex)
+		if (!optp || !optp->ip6po_pktinfo ||
+		    !optp->ip6po_pktinfo->ipi6_ifindex)
 			use_defzone = V_ip6_use_defzone;
 		if (dstsock->sin6_scope_id == 0 && !use_defzone)
 			scope_ambiguous = 1;

From owner-svn-src-all@FreeBSD.ORG  Fri Aug 20 18:19:38 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E6B1C1065670;
	Fri, 20 Aug 2010 18:19:38 +0000 (UTC)
	(envelope-from pluknet@gmail.com)
Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com
	[209.85.216.182])
	by mx1.freebsd.org (Postfix) with ESMTP id 708608FC1E;
	Fri, 20 Aug 2010 18:19:38 +0000 (UTC)
Received: by qyk4 with SMTP id 4so3818034qyk.13
	for ; Fri, 20 Aug 2010 11:19:37 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:received:received:in-reply-to
	:references:date:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	bh=vL6Bl9fW2Wi5hNaBdWMC3yOGNdTZrBV6pyVCg4x+sS0=;
	b=gwqdb+czUw0Lx3BgYZrYKR5XjaauWwxK6RbnhLH1f6lmPrennDkGv4oWr/9LTtP2G3
	p5CmyjJTeIOSW3HMDVDGmQdY3PKJrF1SrQpKRXgxl4aSdxWkxZ9j5VYgnTXDRYrivz2j
	SixUOztQZFnoGFCYJMKr9UaiCZxwvq1ACaMpI=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:content-transfer-encoding;
	b=gRSZ4DfPxpa4PLEXjxu87df/JHwRCjvxfgTBEGIRCAeSB3od3xmdH6g+5tXkVJbwra
	FiiyrgxuYE0W4Sq2tMdtTDGy3x0F0tpUC6nH/5A6iGlJ6NWq4vCl0U+tJe+OntArki6D
	VvNyg5othoEhqe3qvvlGOXAIvmG/EuL3B1wh4=
MIME-Version: 1.0
Received: by 10.229.249.200 with SMTP id ml8mr1381593qcb.115.1282328377402;
	Fri, 20 Aug 2010 11:19:37 -0700 (PDT)
Received: by 10.229.26.81 with HTTP; Fri, 20 Aug 2010 11:19:37 -0700 (PDT)
In-Reply-To: <201008201752.o7KHqnu1044143@svn.freebsd.org>
References: <201008201752.o7KHqnu1044143@svn.freebsd.org>
Date: Fri, 20 Aug 2010 22:19:37 +0400
Message-ID: 
From: pluknet 
To: Hajimu UMEMOTO 
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: r211530 - head/sys/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, 20 Aug 2010 18:19:39 -0000

On 20 August 2010 21:52, Hajimu UMEMOTO  wrote:
> Author: ume
> Date: Fri Aug 20 17:52:49 2010
> New Revision: 211530
> URL: http://svn.freebsd.org/changeset/base/211530
>
> Log:
> =A0optp may be NULL.
>
> Modified:
> =A0head/sys/netinet6/raw_ip6.c
>
> Modified: head/sys/netinet6/raw_ip6.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/netinet6/raw_ip6.c Fri Aug 20 17:20:05 2010 =A0 =A0 =A0 =A0(=
r211529)
> +++ head/sys/netinet6/raw_ip6.c Fri Aug 20 17:52:49 2010 =A0 =A0 =A0 =A0(=
r211530)
> @@ -434,7 +434,8 @@ rip6_output(m, va_alist)
> =A0 =A0 =A0 =A0 * XXX: we may still need to determine the zone later.
> =A0 =A0 =A0 =A0 */
> =A0 =A0 =A0 =A0if (!(so->so_state & SS_ISCONNECTED)) {
> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (!optp->ip6po_pktinfo || !optp->ip6po_pk=
tinfo->ipi6_ifindex)
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (!optp || !optp->ip6po_pktinfo ||
> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 !optp->ip6po_pktinfo->ipi6_ifindex)

Hi.

I think it still continues to test the remain condition
regardless of test result of the first part (!optp).

That should work:

 -               if (!optp->ip6po_pktinfo || !optp->ip6po_pktinfo->ipi6_ifi=
ndex)
 +               if (optp !=3D NULL && (!optp->ip6po_pktinfo ||
 +                   !optp->ip6po_pktinfo->ipi6_ifindex))

--=20
wbr,
pluknet

From owner-svn-src-all@FreeBSD.ORG  Fri Aug 20 18:41:09 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7EE771065675;
	Fri, 20 Aug 2010 18:41:09 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85])
	by mx1.freebsd.org (Postfix) with ESMTP id 3CAD78FC18;
	Fri, 20 Aug 2010 18:41:09 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
	by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o7KIbdkB012302;
	Fri, 20 Aug 2010 12:37:39 -0600 (MDT) (envelope-from imp@bsdimp.com)
Date: Fri, 20 Aug 2010 12:37:42 -0600 (MDT)
Message-Id: <20100820.123742.600640546137300360.imp@bsdimp.com>
To: des@des.no
From: "M. Warner Losh" 
In-Reply-To: <861v9ty7bg.fsf@ds4.des.no>
References: <8662z6r77w.fsf@ds4.des.no>
	
	<861v9ty7bg.fsf@ds4.des.no>
X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: attilio@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r211393 - 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: Fri, 20 Aug 2010 18:41:09 -0000

In message: <861v9ty7bg.fsf@ds4.des.no>
            Dag-Erling Sm=F8rgrav  writes:
: Attilio Rao  writes:
: > Dag-Erling Sm=F8rgrav  writes:
: > > Perhaps the test in setusercontext() should be changed to use
: > > geteuid() instead of getuid().
: > Yes, I think that it probabilly makes more sense (geteuid() testing=
 in
: > setusercontext()).
: =

: What if the user's ~/.login_conf sets a custom PATH, and the applicat=
ion
: switches back to root privs and fork()-exec()s some other program?

And we're back to the reason for why issetugid() :)

Warner

From owner-svn-src-all@FreeBSD.ORG  Fri Aug 20 19:21:22 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 3CFB8106566B;
	Fri, 20 Aug 2010 19:21:22 +0000 (UTC) (envelope-from des@des.no)
Received: from smtp.des.no (smtp.des.no [194.63.250.102])
	by mx1.freebsd.org (Postfix) with ESMTP id F019D8FC1D;
	Fri, 20 Aug 2010 19:21:21 +0000 (UTC)
Received: from ds4.des.no (des.no [84.49.246.2])
	by smtp.des.no (Postfix) with ESMTP id 37ED91FFC38;
	Fri, 20 Aug 2010 19:21:21 +0000 (UTC)
Received: by ds4.des.no (Postfix, from userid 1001)
	id 19F1F845D7; Fri, 20 Aug 2010 21:21:21 +0200 (CEST)
From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= 
To: "M. Warner Losh" 
References: <8662z6r77w.fsf@ds4.des.no>
	
	<861v9ty7bg.fsf@ds4.des.no>
	<20100820.123742.600640546137300360.imp@bsdimp.com>
Date: Fri, 20 Aug 2010 21:21:21 +0200
In-Reply-To: <20100820.123742.600640546137300360.imp@bsdimp.com> (M. Warner
	Losh's message of "Fri, 20 Aug 2010 12:37:42 -0600 (MDT)")
Message-ID: <86bp8xf5u6.fsf@ds4.des.no>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Cc: attilio@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r211393 - 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: Fri, 20 Aug 2010 19:21:22 -0000

"M. Warner Losh"  writes:
> And we're back to the reason for why issetugid() :)

Does setuid() "untaint" a program?

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no

From owner-svn-src-all@FreeBSD.ORG  Fri Aug 20 19:36:39 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 618A31065672;
	Fri, 20 Aug 2010 19:36:39 +0000 (UTC) (envelope-from imp@bsdimp.com)
Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85])
	by mx1.freebsd.org (Postfix) with ESMTP id 0B8508FC18;
	Fri, 20 Aug 2010 19:36:38 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
	by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o7KJWaM1012872;
	Fri, 20 Aug 2010 13:32:36 -0600 (MDT) (envelope-from imp@bsdimp.com)
Date: Fri, 20 Aug 2010 13:32:40 -0600 (MDT)
Message-Id: <20100820.133240.271446115529437414.imp@bsdimp.com>
To: des@des.no
From: "M. Warner Losh" 
In-Reply-To: <86bp8xf5u6.fsf@ds4.des.no>
References: <861v9ty7bg.fsf@ds4.des.no>
	<20100820.123742.600640546137300360.imp@bsdimp.com>
	<86bp8xf5u6.fsf@ds4.des.no>
X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Cc: attilio@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r211393 - 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: Fri, 20 Aug 2010 19:36:39 -0000

In message: <86bp8xf5u6.fsf@ds4.des.no>
            Dag-Erling Sm=F8rgrav  writes:
: "M. Warner Losh"  writes:
: > And we're back to the reason for why issetugid() :)
: =

: Does setuid() "untaint" a program?

No.

Warner

From owner-svn-src-all@FreeBSD.ORG  Fri Aug 20 19:40:30 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6BC88106577E;
	Fri, 20 Aug 2010 19:40:30 +0000 (UTC) (envelope-from des@des.no)
Received: from smtp.des.no (smtp.des.no [194.63.250.102])
	by mx1.freebsd.org (Postfix) with ESMTP id 292F18FC20;
	Fri, 20 Aug 2010 19:40:30 +0000 (UTC)
Received: from ds4.des.no (des.no [84.49.246.2])
	by smtp.des.no (Postfix) with ESMTP id 600881FFC34;
	Fri, 20 Aug 2010 19:40:29 +0000 (UTC)
Received: by ds4.des.no (Postfix, from userid 1001)
	id 40EFB8456E; Fri, 20 Aug 2010 21:40:29 +0200 (CEST)
From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= 
To: "M. Warner Losh" 
References: <861v9ty7bg.fsf@ds4.des.no>
	<20100820.123742.600640546137300360.imp@bsdimp.com>
	<86bp8xf5u6.fsf@ds4.des.no>
	<20100820.133240.271446115529437414.imp@bsdimp.com>
Date: Fri, 20 Aug 2010 21:40:29 +0200
In-Reply-To: <20100820.133240.271446115529437414.imp@bsdimp.com> (M. Warner
	Losh's message of "Fri, 20 Aug 2010 13:32:40 -0600 (MDT)")
Message-ID: <86iq35dqdu.fsf@ds4.des.no>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (berkeley-unix)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Cc: attilio@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r211393 - 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: Fri, 20 Aug 2010 19:40:30 -0000

"M. Warner Losh"  writes:
> Dag-Erling Sm=C3=B8rgrav  writes:
> > "M. Warner Losh"  writes:
> > > And we're back to the reason for why issetugid() :)
> > Does setuid() "untaint" a program?
> No.

Yet I would argue that it is safe to apply the user's .login_conf after
setuid(), so issetugid() is not an appropriate test.

DES
--=20
Dag-Erling Sm=C3=B8rgrav - des@des.no

From owner-svn-src-all@FreeBSD.ORG  Fri Aug 20 19:46:51 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 10E761065697;
	Fri, 20 Aug 2010 19:46:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id F266A8FC20;
	Fri, 20 Aug 2010 19:46:50 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7KJkoFw046363;
	Fri, 20 Aug 2010 19:46:50 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7KJkoWU046348;
	Fri, 20 Aug 2010 19:46:50 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201008201946.o7KJkoWU046348@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 20 Aug 2010 19:46: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: r211531 - in head/sys: fs/devfs fs/nfsclient fs/nwfs
	fs/pseudofs fs/smbfs gnu/fs/xfs/FreeBSD kern nfsclient 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: Fri, 20 Aug 2010 19:46:51 -0000

Author: jhb
Date: Fri Aug 20 19:46:50 2010
New Revision: 211531
URL: http://svn.freebsd.org/changeset/base/211531

Log:
  Add dedicated routines to toggle lockmgr flags such as LK_NOSHARE and
  LK_CANRECURSE after a lock is created.  Use them to implement macros that
  otherwise manipulated the flags directly.  Assert that the associated
  lockmgr lock is exclusively locked by the current thread when manipulating
  these flags to ensure the flag updates are safe.  This last change required
  some minor shuffling in a few filesystems to exclusively lock a brand new
  vnode slightly earlier.
  
  Reviewed by:	kib
  MFC after:	3 days

Modified:
  head/sys/fs/devfs/devfs_vnops.c
  head/sys/fs/nfsclient/nfs_clnode.c
  head/sys/fs/nfsclient/nfs_clport.c
  head/sys/fs/nwfs/nwfs_node.c
  head/sys/fs/pseudofs/pseudofs_vncache.c
  head/sys/fs/smbfs/smbfs_node.c
  head/sys/gnu/fs/xfs/FreeBSD/xfs_freebsd_iget.c
  head/sys/kern/kern_lock.c
  head/sys/kern/vfs_lookup.c
  head/sys/nfsclient/nfs_node.c
  head/sys/sys/lockmgr.h
  head/sys/sys/vnode.h
  head/sys/ufs/ffs/ffs_softdep.c
  head/sys/ufs/ffs/ffs_vfsops.c

Modified: head/sys/fs/devfs/devfs_vnops.c
==============================================================================
--- head/sys/fs/devfs/devfs_vnops.c	Fri Aug 20 17:52:49 2010	(r211530)
+++ head/sys/fs/devfs/devfs_vnops.c	Fri Aug 20 19:46:50 2010	(r211531)
@@ -412,8 +412,8 @@ devfs_allocv(struct devfs_dirent *de, st
 	} else {
 		vp->v_type = VBAD;
 	}
-	VN_LOCK_ASHARE(vp);
 	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY | LK_NOWITNESS);
+	VN_LOCK_ASHARE(vp);
 	mtx_lock(&devfs_de_interlock);
 	vp->v_data = de;
 	de->de_vnode = vp;

Modified: head/sys/fs/nfsclient/nfs_clnode.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clnode.c	Fri Aug 20 17:52:49 2010	(r211530)
+++ head/sys/fs/nfsclient/nfs_clnode.c	Fri Aug 20 19:46:50 2010	(r211531)
@@ -140,6 +140,7 @@ ncl_nget(struct mount *mntp, u_int8_t *f
 	/*
 	 * NFS supports recursive and shared locking.
 	 */
+	lockmgr(vp->v_vnlock, LK_EXCLUSIVE | LK_NOWITNESS, NULL);
 	VN_LOCK_AREC(vp);
 	VN_LOCK_ASHARE(vp);
 	/* 
@@ -157,7 +158,6 @@ ncl_nget(struct mount *mntp, u_int8_t *f
 	    M_NFSFH, M_WAITOK);
 	bcopy(fhp, np->n_fhp->nfh_fh, fhsize);
 	np->n_fhp->nfh_len = fhsize;
-	lockmgr(vp->v_vnlock, LK_EXCLUSIVE | LK_NOWITNESS, NULL);
 	error = insmntque(vp, mntp);
 	if (error != 0) {
 		*npp = NULL;

Modified: head/sys/fs/nfsclient/nfs_clport.c
==============================================================================
--- head/sys/fs/nfsclient/nfs_clport.c	Fri Aug 20 17:52:49 2010	(r211530)
+++ head/sys/fs/nfsclient/nfs_clport.c	Fri Aug 20 19:46:50 2010	(r211531)
@@ -230,9 +230,9 @@ nfscl_nget(struct mount *mntp, struct vn
 	/*
 	 * NFS supports recursive and shared locking.
 	 */
+	lockmgr(vp->v_vnlock, LK_EXCLUSIVE | LK_NOWITNESS, NULL);
 	VN_LOCK_AREC(vp);
 	VN_LOCK_ASHARE(vp);
-	lockmgr(vp->v_vnlock, LK_EXCLUSIVE | LK_NOWITNESS, NULL);
 	error = insmntque(vp, mntp);
 	if (error != 0) {
 		*npp = NULL;

Modified: head/sys/fs/nwfs/nwfs_node.c
==============================================================================
--- head/sys/fs/nwfs/nwfs_node.c	Fri Aug 20 17:52:49 2010	(r211530)
+++ head/sys/fs/nwfs/nwfs_node.c	Fri Aug 20 19:46:50 2010	(r211531)
@@ -185,7 +185,6 @@ rescan:
 	if (dvp) {
 		np->n_parent = VTONW(dvp)->n_fid;
 	}
-	VN_LOCK_AREC(vp);
 	sx_xlock(&nwhashlock);
 	/*
 	 * Another process can create vnode while we blocked in malloc() or
@@ -202,6 +201,7 @@ rescan:
 	nhpp = NWNOHASH(fid);
 	LIST_INSERT_HEAD(nhpp, np, n_hash);
 	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
+	VN_LOCK_AREC(vp);
 	sx_xunlock(&nwhashlock);
 	
 	ASSERT_VOP_LOCKED(dvp, "nwfs_allocvp");

Modified: head/sys/fs/pseudofs/pseudofs_vncache.c
==============================================================================
--- head/sys/fs/pseudofs/pseudofs_vncache.c	Fri Aug 20 17:52:49 2010	(r211530)
+++ head/sys/fs/pseudofs/pseudofs_vncache.c	Fri Aug 20 19:46:50 2010	(r211531)
@@ -189,8 +189,8 @@ retry:
 	if ((pn->pn_flags & PFS_PROCDEP) != 0)
 		(*vpp)->v_vflag |= VV_PROCDEP;
 	pvd->pvd_vnode = *vpp;
-	VN_LOCK_AREC(*vpp);
 	vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY);
+	VN_LOCK_AREC(*vpp);
 	error = insmntque(*vpp, mp);
 	if (error != 0) {
 		free(pvd, M_PFSVNCACHE);

Modified: head/sys/fs/smbfs/smbfs_node.c
==============================================================================
--- head/sys/fs/smbfs/smbfs_node.c	Fri Aug 20 17:52:49 2010	(r211530)
+++ head/sys/fs/smbfs/smbfs_node.c	Fri Aug 20 19:46:50 2010	(r211531)
@@ -253,8 +253,8 @@ loop:
 	} else if (vp->v_type == VREG)
 		SMBERROR("new vnode '%s' born without parent ?\n", np->n_name);
 
-	VN_LOCK_AREC(vp);
 	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
+	VN_LOCK_AREC(vp);
 
 	smbfs_hash_lock(smp);
 	LIST_FOREACH(np2, nhpp, n_hash) {

Modified: head/sys/gnu/fs/xfs/FreeBSD/xfs_freebsd_iget.c
==============================================================================
--- head/sys/gnu/fs/xfs/FreeBSD/xfs_freebsd_iget.c	Fri Aug 20 17:52:49 2010	(r211530)
+++ head/sys/gnu/fs/xfs/FreeBSD/xfs_freebsd_iget.c	Fri Aug 20 19:46:50 2010	(r211531)
@@ -389,8 +389,8 @@ xfs_vn_allocate(xfs_mount_t *mp, xfs_ino
 		return (error);
 	}
 
-	VN_LOCK_AREC(vp);
 	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
+	VN_LOCK_AREC(vp);
 	error = insmntque(vp, XVFSTOMNT(XFS_MTOVFS(mp)));
 	if (error != 0) {
 		kmem_free(vdata, sizeof(*vdata));

Modified: head/sys/kern/kern_lock.c
==============================================================================
--- head/sys/kern/kern_lock.c	Fri Aug 20 17:52:49 2010	(r211530)
+++ head/sys/kern/kern_lock.c	Fri Aug 20 19:46:50 2010	(r211531)
@@ -396,6 +396,34 @@ lockinit(struct lock *lk, int pri, const
 	STACK_ZERO(lk);
 }
 
+/*
+ * XXX: Gross hacks to manipulate external lock flags after
+ * initialization.  Used for certain vnode and buf locks.
+ */
+void
+lockallowshare(struct lock *lk)
+{
+
+	lockmgr_assert(lk, KA_XLOCKED);
+	lk->lock_object.lo_flags &= ~LK_NOSHARE;
+}
+
+void
+lockallowrecurse(struct lock *lk)
+{
+
+	lockmgr_assert(lk, KA_XLOCKED);
+	lk->lock_object.lo_flags |= LO_RECURSABLE;
+}
+
+void
+lockdisablerecurse(struct lock *lk)
+{
+
+	lockmgr_assert(lk, KA_XLOCKED);
+	lk->lock_object.lo_flags &= ~LO_RECURSABLE;
+}
+
 void
 lockdestroy(struct lock *lk)
 {

Modified: head/sys/kern/vfs_lookup.c
==============================================================================
--- head/sys/kern/vfs_lookup.c	Fri Aug 20 17:52:49 2010	(r211530)
+++ head/sys/kern/vfs_lookup.c	Fri Aug 20 19:46:50 2010	(r211531)
@@ -84,14 +84,13 @@ static struct vnode *vp_crossmp;
 static void
 nameiinit(void *dummy __unused)
 {
-	int error;
 
 	namei_zone = uma_zcreate("NAMEI", MAXPATHLEN, NULL, NULL, NULL, NULL,
 	    UMA_ALIGN_PTR, 0);
-	error = getnewvnode("crossmp", NULL, &dead_vnodeops, &vp_crossmp);
-	if (error != 0)
-		panic("nameiinit: getnewvnode");
+	getnewvnode("crossmp", NULL, &dead_vnodeops, &vp_crossmp);
+	vn_lock(vp_crossmp, LK_EXCLUSIVE);
 	VN_LOCK_ASHARE(vp_crossmp);
+	VOP_UNLOCK(vp_crossmp, 0);
 }
 SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_SECOND, nameiinit, NULL);
 

Modified: head/sys/nfsclient/nfs_node.c
==============================================================================
--- head/sys/nfsclient/nfs_node.c	Fri Aug 20 17:52:49 2010	(r211530)
+++ head/sys/nfsclient/nfs_node.c	Fri Aug 20 19:46:50 2010	(r211531)
@@ -150,6 +150,7 @@ nfs_nget(struct mount *mntp, nfsfh_t *fh
 	/*
 	 * NFS supports recursive and shared locking.
 	 */
+	lockmgr(vp->v_vnlock, LK_EXCLUSIVE | LK_NOWITNESS, NULL);
 	VN_LOCK_AREC(vp);
 	VN_LOCK_ASHARE(vp);
 	if (fhsize > NFS_SMALLFH) {
@@ -158,7 +159,6 @@ nfs_nget(struct mount *mntp, nfsfh_t *fh
 		np->n_fhp = &np->n_fh;
 	bcopy((caddr_t)fhp, (caddr_t)np->n_fhp, fhsize);
 	np->n_fhsize = fhsize;
-	lockmgr(vp->v_vnlock, LK_EXCLUSIVE | LK_NOWITNESS, NULL);
 	error = insmntque(vp, mntp);
 	if (error != 0) {
 		*npp = NULL;

Modified: head/sys/sys/lockmgr.h
==============================================================================
--- head/sys/sys/lockmgr.h	Fri Aug 20 17:52:49 2010	(r211530)
+++ head/sys/sys/lockmgr.h	Fri Aug 20 19:46:50 2010	(r211531)
@@ -73,7 +73,10 @@ void	 _lockmgr_assert(struct lock *lk, i
 #endif
 void	 _lockmgr_disown(struct lock *lk, const char *file, int line);
 
+void	 lockallowrecurse(struct lock *lk);
+void	 lockallowshare(struct lock *lk);
 void	 lockdestroy(struct lock *lk);
+void	 lockdisablerecurse(struct lock *lk);
 void	 lockinit(struct lock *lk, int prio, const char *wmesg, int timo,
 	    int flags);
 #ifdef DDB

Modified: head/sys/sys/vnode.h
==============================================================================
--- head/sys/sys/vnode.h	Fri Aug 20 17:52:49 2010	(r211530)
+++ head/sys/sys/vnode.h	Fri Aug 20 19:46:50 2010	(r211531)
@@ -419,10 +419,8 @@ extern	struct vattr va_null;		/* predefi
 #define	VI_UNLOCK(vp)	mtx_unlock(&(vp)->v_interlock)
 #define	VI_MTX(vp)	(&(vp)->v_interlock)
 
-#define	VN_LOCK_AREC(vp)						\
-	((vp)->v_vnlock->lock_object.lo_flags |= LO_RECURSABLE)
-#define	VN_LOCK_ASHARE(vp)						\
-	((vp)->v_vnlock->lock_object.lo_flags &= ~LK_NOSHARE)
+#define	VN_LOCK_AREC(vp)	lockallowrecurse((vp)->v_vnlock)
+#define	VN_LOCK_ASHARE(vp)	lockallowshare((vp)->v_vnlock)
 
 #endif /* _KERNEL */
 

Modified: head/sys/ufs/ffs/ffs_softdep.c
==============================================================================
--- head/sys/ufs/ffs/ffs_softdep.c	Fri Aug 20 17:52:49 2010	(r211530)
+++ head/sys/ufs/ffs/ffs_softdep.c	Fri Aug 20 19:46:50 2010	(r211531)
@@ -904,8 +904,8 @@ MTX_SYSINIT(softdep_lock, &lk, "Softdep 
 #define ACQUIRE_LOCK(lk)		mtx_lock(lk)
 #define FREE_LOCK(lk)			mtx_unlock(lk)
 
-#define	BUF_AREC(bp)	((bp)->b_lock.lock_object.lo_flags |= LO_RECURSABLE)
-#define	BUF_NOREC(bp)	((bp)->b_lock.lock_object.lo_flags &= ~LO_RECURSABLE)
+#define	BUF_AREC(bp)			lockallowrecurse(&(bp)->b_lock)
+#define	BUF_NOREC(bp)			lockdisablerecurse(&(bp)->b_lock)
 
 /*
  * Worklist queue management.

Modified: head/sys/ufs/ffs/ffs_vfsops.c
==============================================================================
--- head/sys/ufs/ffs/ffs_vfsops.c	Fri Aug 20 17:52:49 2010	(r211530)
+++ head/sys/ufs/ffs/ffs_vfsops.c	Fri Aug 20 19:46:50 2010	(r211531)
@@ -1501,6 +1501,7 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags
 	/*
 	 * FFS supports recursive locking.
 	 */
+	lockmgr(vp->v_vnlock, LK_EXCLUSIVE, NULL);
 	VN_LOCK_AREC(vp);
 	vp->v_data = ip;
 	vp->v_bufobj.bo_bsize = fs->fs_bsize;
@@ -1518,7 +1519,6 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags
 	}
 #endif
 
-	lockmgr(vp->v_vnlock, LK_EXCLUSIVE, NULL);
 	if (ffs_flags & FFSV_FORCEINSMQ)
 		vp->v_vflag |= VV_FORCEINSMQ;
 	error = insmntque(vp, mp);

From owner-svn-src-all@FreeBSD.ORG  Fri Aug 20 20:33:16 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 15EE31065670;
	Fri, 20 Aug 2010 20:33:14 +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 F250D8FC13;
	Fri, 20 Aug 2010 20:33:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7KKXDLp047336;
	Fri, 20 Aug 2010 20:33:13 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7KKXDg2047330;
	Fri, 20 Aug 2010 20:33:13 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201008202033.o7KKXDg2047330@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 20 Aug 2010 20:33:13 +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: r211532 - in stable/7/sys: fs/nwfs fs/pseudofs fs/smbfs
	gnu/fs/xfs/FreeBSD 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, 20 Aug 2010 20:33:16 -0000

Author: jhb
Date: Fri Aug 20 20:33:13 2010
New Revision: 211532
URL: http://svn.freebsd.org/changeset/base/211532

Log:
  MFC: Use VN_LOCK_AREC() and VN_LOCK_ASHARE() rather than manipulating
  lockmgr lock flags directly.

Modified:
  stable/7/sys/fs/nwfs/nwfs_node.c
  stable/7/sys/fs/pseudofs/pseudofs_vncache.c
  stable/7/sys/fs/smbfs/smbfs_node.c
  stable/7/sys/gnu/fs/xfs/FreeBSD/xfs_freebsd_iget.c
  stable/7/sys/kern/vfs_lookup.c

Modified: stable/7/sys/fs/nwfs/nwfs_node.c
==============================================================================
--- stable/7/sys/fs/nwfs/nwfs_node.c	Fri Aug 20 19:46:50 2010	(r211531)
+++ stable/7/sys/fs/nwfs/nwfs_node.c	Fri Aug 20 20:33:13 2010	(r211532)
@@ -192,7 +192,7 @@ rescan:
 	if (dvp) {
 		np->n_parent = VTONW(dvp)->n_fid;
 	}
-	vp->v_vnlock->lk_flags |= LK_CANRECURSE;
+	VN_LOCK_AREC(vp);
 	sx_xlock(&nwhashlock);
 	/*
 	 * Another process can create vnode while we blocked in malloc() or

Modified: stable/7/sys/fs/pseudofs/pseudofs_vncache.c
==============================================================================
--- stable/7/sys/fs/pseudofs/pseudofs_vncache.c	Fri Aug 20 19:46:50 2010	(r211531)
+++ stable/7/sys/fs/pseudofs/pseudofs_vncache.c	Fri Aug 20 20:33:13 2010	(r211532)
@@ -189,7 +189,7 @@ retry:
 	if ((pn->pn_flags & PFS_PROCDEP) != 0)
 		(*vpp)->v_vflag |= VV_PROCDEP;
 	pvd->pvd_vnode = *vpp;
-	(*vpp)->v_vnlock->lk_flags |= LK_CANRECURSE;
+	VN_LOCK_AREC(*vpp);
 	vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY, curthread);
 	error = insmntque(*vpp, mp);
 	if (error != 0) {

Modified: stable/7/sys/fs/smbfs/smbfs_node.c
==============================================================================
--- stable/7/sys/fs/smbfs/smbfs_node.c	Fri Aug 20 19:46:50 2010	(r211531)
+++ stable/7/sys/fs/smbfs/smbfs_node.c	Fri Aug 20 20:33:13 2010	(r211532)
@@ -259,7 +259,7 @@ loop:
 	} else if (vp->v_type == VREG)
 		SMBERROR("new vnode '%s' born without parent ?\n", np->n_name);
 
-	vp->v_vnlock->lk_flags |= LK_CANRECURSE;
+	VN_LOCK_AREC(vp);
 	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
 
 	smbfs_hash_lock(smp);

Modified: stable/7/sys/gnu/fs/xfs/FreeBSD/xfs_freebsd_iget.c
==============================================================================
--- stable/7/sys/gnu/fs/xfs/FreeBSD/xfs_freebsd_iget.c	Fri Aug 20 19:46:50 2010	(r211531)
+++ stable/7/sys/gnu/fs/xfs/FreeBSD/xfs_freebsd_iget.c	Fri Aug 20 20:33:13 2010	(r211532)
@@ -29,6 +29,8 @@
  * For further information regarding this notice, see:
  *
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+ *
+ * $FreeBSD$
  */
 
 #include "xfs.h"
@@ -389,7 +391,7 @@ xfs_vn_allocate(xfs_mount_t *mp, xfs_ino
 		return (error);
 	}
 
-	vp->v_vnlock->lk_flags |= LK_CANRECURSE;
+	VN_LOCK_AREC(vp);
 	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, curthread);
 	error = insmntque(vp, XVFSTOMNT(XFS_MTOVFS(mp)));
 	if (error != 0) {

Modified: stable/7/sys/kern/vfs_lookup.c
==============================================================================
--- stable/7/sys/kern/vfs_lookup.c	Fri Aug 20 19:46:50 2010	(r211531)
+++ stable/7/sys/kern/vfs_lookup.c	Fri Aug 20 20:33:13 2010	(r211532)
@@ -83,7 +83,7 @@ nameiinit(void *dummy __unused)
 	error = getnewvnode("crossmp", NULL, &dead_vnodeops, &vp_crossmp);
 	if (error != 0)
 		panic("nameiinit: getnewvnode");
-	vp_crossmp->v_vnlock->lk_flags &= ~LK_NOSHARE;
+	VN_LOCK_ASHARE(vp_crossmp);
 }
 SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_SECOND, nameiinit, NULL);
 

From owner-svn-src-all@FreeBSD.ORG  Fri Aug 20 20:37:18 2010
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6782F10656A7;
	Fri, 20 Aug 2010 20:37:18 +0000 (UTC)
	(envelope-from brde@optusnet.com.au)
Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au
	[211.29.132.186])
	by mx1.freebsd.org (Postfix) with ESMTP id F3E9F8FC1D;
	Fri, 20 Aug 2010 20:37:17 +0000 (UTC)
Received: from c122-107-127-123.carlnfd1.nsw.optusnet.com.au
	(c122-107-127-123.carlnfd1.nsw.optusnet.com.au [122.107.127.123])
	by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id
	o7KKakCg007642
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Sat, 21 Aug 2010 06:36:48 +1000
Date: Sat, 21 Aug 2010 06:36:45 +1000 (EST)
From: Bruce Evans 
X-X-Sender: bde@delplex.bde.org
To: Dimitry Andric 
In-Reply-To: <4C6DC0F8.9040001@andric.com>
Message-ID: <20100821054033.M19850@delplex.bde.org>
References: <201008191259.o7JCxv3i004613@svn.freebsd.org>
	<20100820075236.L18914@delplex.bde.org> <4C6DC0F8.9040001@andric.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, Rui Paulo ,
	Bruce Evans 
Subject: Re: svn commit: r211505 - head/contrib/gcc
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 20 Aug 2010 20:37:18 -0000

On Fri, 20 Aug 2010, Dimitry Andric wrote:

> On 2010-08-20 00:20, Bruce Evans wrote:
>> These seem to be needed, and some of them valid.  Any lvalue arg that
>> can be put in a register can be cast to USItype (unsigned int) on i386.
>> The args are macro args, so they may have any integer type no larger
>> than USItype originally, and they must be cast to USItype for the asms
>> to work if the args are smaller than USItype...
>
> But will the casts not potentially hide problems, if you pass the wrong
> types to those macros?  Maybe it is better if the compiler complains
> that some argument is of an incompatible type, than just forcing it to
> cast?

This is unclear.  All integer types are compatible to some extent.
Upcasting them always works and downcasting them works iff the value
is not changed.

>>>  which are apparently "heinous" GNU extensions, so clang can
>>>  compile this without using the -fheinous-gnu-extensions option.
>>
>> But when the args are lvalues, casting them is invalid.  This is
>> apparently the heinous extension depended on.
>
> Yes, clang complains precisely about that:
>
> gnu/lib/libgcc/../../../contrib/gcc/libgcc2.c:536:22: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions
>  DWunion w = {.ll = __umulsidi3 (uu.s.low, vv.s.low)};
>                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> In file included from gnu/lib/libgcc/../../../contrib/gcc/libgcc2.c:65:
> In file included from gnu/lib/libgcc/../../../contrib/gcc/libgcc2.h:435:
> gnu/lib/libgcc/../../../contrib/gcc/longlong.h:1293:5: note: instantiated from:
>    umul_ppmm (__w.s.high, __w.s.low, u, v);                            \
>    ^
>
> It turns out that only removing the casts for these specific lvalues is
> indeed enough to make clang happy.  Attached patch reverts all other
> changes, if that is to be preferred.

I prefer this.

>>>  Results in *no* binary change, neither with clang, nor with gcc.
>>
>> This cannot be tested by compiling a few binaries, since the few binaries
>> might not include enough examples to give test coverage of cases with
>> args smaller than USItype.  Perhaps the macros are only used for building
>> libgcc, but this is unclear.
>
> contrib/gcc/longlong.h is only used in contrib/gcc/libgcc2.h, and in
> contrib/gcc/config/soft-fp/soft-fp.h.  On i386, soft-fp is not used,
> and libgcc2.h is only used in contrib/gcc/libgcc2.c, so libgcc is the
> only consumer, as far as I can see.

There are many parameters.  Probably the casts are needed for some arches,
so gnu can't just remove them and wouldn't like your patch.  But they should
fix the casts of lvalues someday.

The ifdefs are hard to untangle.  I thought I found a simple case where
the cast helps, but actually the ifdefs make the cast have no effect
although the code is logically wrong.  From your patch:

%  #define count_leading_zeros(count, x) \
%    do {									\
%      USItype __cbtmp;							\
%      __asm__ ("bsrl %1,%0"						\
% -	     : "=r" (__cbtmp) : "rm" (x));				\
% +	     : "=r" (__cbtmp) : "rm" ((USItype) (x)));			\
%      (count) = __cbtmp ^ 31;						\
%    } while (0)
%  #define count_trailing_zeros(count, x) \

This interface is supposed to operate on `UWtype x'.  UWtype is UDItype
on some arches, so casting it to USItype breaks it.  However, the breakage
is only logical since all this is under a __i386__ && W_TYPE_SIZE == 32
ifdef, which makes UWtype the same width as USItype so the cast has no
effect if x has the correct type.

The above wouldn't work on amd64 since the correct code is bsrq with no
cast (the value is 64 bits; the cast would give a 32-bit value; apart from 
breaking the value, this would give invalid asm like "bsrq %eax" if the
casted value ends up in a register.  Handling all the cases is apparently
too hard, so longlong.h doesn't have any special support for clz on amd64
and a generic version -- the above is apparently used for __clzsi2() and
_clzdi2() on i386, but on amd64 a slow loop is used.  gcc asm still seems
to be missing support for writing this correctly ("bsr%[mumble1] %1,%0",
where %[mumble1] is either q or l (or w or b?) depending on the size of %1).

Bruce

From owner-svn-src-all@FreeBSD.ORG  Fri Aug 20 20:58:58 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 426EA1065675;
	Fri, 20 Aug 2010 20:58: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 2FF0A8FC13;
	Fri, 20 Aug 2010 20:58:58 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7KKwwgw047839;
	Fri, 20 Aug 2010 20:58:58 GMT (envelope-from jhb@svn.freebsd.org)
Received: (from jhb@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7KKwvdp047830;
	Fri, 20 Aug 2010 20:58:57 GMT (envelope-from jhb@svn.freebsd.org)
Message-Id: <201008202058.o7KKwvdp047830@svn.freebsd.org>
From: John Baldwin 
Date: Fri, 20 Aug 2010 20:58: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: r211533 - in stable/7/sys:
	cddl/contrib/opensolaris/uts/common/fs/zfs fs/cd9660 fs/udf
	kern 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: Fri, 20 Aug 2010 20:58:58 -0000

Author: jhb
Date: Fri Aug 20 20:58:57 2010
New Revision: 211533
URL: http://svn.freebsd.org/changeset/base/211533

Log:
  Revert 210173 as it did not properly fix the bug.  It assumed that the
  VI_LOCK() for a given vnode was used as the internal interlock for that
  vnode's v_lock lockmgr lock.  This is not the case.  Instead, add dedicated
  routines to toggle the LK_NOSHARE and LK_CANRECURSE flags.  These routines
  lock the lockmgr lock's internal interlock to synchronize the updates to
  the flags member with other threads attempting to acquire the lock.  The
  VN_LOCK_A*() macros now invoke these routines, and the softupdates code
  uses these routines to temporarly enable recursion on buffer locks.
  
  Reviewed by:	kib

Modified:
  stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
  stable/7/sys/fs/cd9660/cd9660_vfsops.c
  stable/7/sys/fs/udf/udf_vfsops.c
  stable/7/sys/kern/kern_lock.c
  stable/7/sys/sys/lockmgr.h
  stable/7/sys/sys/vnode.h
  stable/7/sys/ufs/ffs/ffs_softdep.c
  stable/7/sys/ufs/ffs/ffs_vfsops.c

Modified: stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
==============================================================================
--- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c	Fri Aug 20 20:33:13 2010	(r211532)
+++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c	Fri Aug 20 20:58:57 2010	(r211533)
@@ -618,11 +618,8 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_bu
 		vp->v_op = &zfs_fifoops;
 		break;
 	}
-	if (vp->v_type != VFIFO) {
-		VI_LOCK(vp);
+	if (vp->v_type != VFIFO)
 		VN_LOCK_ASHARE(vp);
-		VI_UNLOCK(vp);
-	}
 
 	mutex_enter(&zfsvfs->z_znodes_lock);
 	list_insert_tail(&zfsvfs->z_all_znodes, zp);

Modified: stable/7/sys/fs/cd9660/cd9660_vfsops.c
==============================================================================
--- stable/7/sys/fs/cd9660/cd9660_vfsops.c	Fri Aug 20 20:33:13 2010	(r211532)
+++ stable/7/sys/fs/cd9660/cd9660_vfsops.c	Fri Aug 20 20:58:57 2010	(r211533)
@@ -821,9 +821,7 @@ cd9660_vget_internal(mp, ino, flags, vpp
 		vp->v_op = &cd9660_fifoops;
 		break;
 	default:
-		VI_LOCK(vp);
 		VN_LOCK_ASHARE(vp);
-		VI_UNLOCK(vp);
 		break;
 	}
 

Modified: stable/7/sys/fs/udf/udf_vfsops.c
==============================================================================
--- stable/7/sys/fs/udf/udf_vfsops.c	Fri Aug 20 20:33:13 2010	(r211532)
+++ stable/7/sys/fs/udf/udf_vfsops.c	Fri Aug 20 20:58:57 2010	(r211533)
@@ -709,11 +709,8 @@ udf_vget(struct mount *mp, ino_t ino, in
 		break;
 	}
 
-	if (vp->v_type != VFIFO) {
-		VI_LOCK(vp);
+	if (vp->v_type != VFIFO)
 		VN_LOCK_ASHARE(vp);
-		VI_UNLOCK(vp);
-	}
 
 	if (ino == udf_getid(&udfmp->root_icb))
 		vp->v_vflag |= VV_ROOT;

Modified: stable/7/sys/kern/kern_lock.c
==============================================================================
--- stable/7/sys/kern/kern_lock.c	Fri Aug 20 20:33:13 2010	(r211532)
+++ stable/7/sys/kern/kern_lock.c	Fri Aug 20 20:58:57 2010	(r211533)
@@ -555,6 +555,40 @@ lockinit(lkp, prio, wmesg, timo, flags)
 }
 
 /*
+ * XXX: Gross hacks to manipulate external lock flags after
+ * initialization.  Used for certain vnode and buf locks.
+ */
+void
+lockallowshare(lkp)
+	struct lock *lkp;
+{
+
+	mtx_lock(lkp->lk_interlock);
+	lkp->lk_flags &= ~LK_NOSHARE;
+	mtx_unlock(lkp->lk_interlock);
+}
+
+void
+lockallowrecurse(lkp)
+	struct lock *lkp;
+{
+
+	mtx_lock(lkp->lk_interlock);
+	lkp->lk_flags |= LK_CANRECURSE;
+	mtx_unlock(lkp->lk_interlock);
+}
+
+void
+lockdisablerecurse(lkp)
+	struct lock *lkp;
+{
+
+	mtx_lock(lkp->lk_interlock);
+	lkp->lk_flags &= ~LK_CANRECURSE;
+	mtx_unlock(lkp->lk_interlock);
+}
+
+/*
  * Destroy a lock.
  */
 void

Modified: stable/7/sys/sys/lockmgr.h
==============================================================================
--- stable/7/sys/sys/lockmgr.h	Fri Aug 20 20:33:13 2010	(r211532)
+++ stable/7/sys/sys/lockmgr.h	Fri Aug 20 20:58:57 2010	(r211533)
@@ -214,6 +214,9 @@ void	lockmgr_printinfo(struct lock *);
 int	lockstatus(struct lock *, struct thread *);
 int	lockcount(struct lock *);
 int	lockwaiters(struct lock *);
+void	lockallowshare(struct lock *);
+void	lockallowrecurse(struct lock *);
+void	lockdisablerecurse(struct lock *);
 
 #define	lockmgr(lock, flags, mtx, td)					\
 	_lockmgr((lock), (flags), (mtx), (td), LOCK_FILE, LOCK_LINE)

Modified: stable/7/sys/sys/vnode.h
==============================================================================
--- stable/7/sys/sys/vnode.h	Fri Aug 20 20:33:13 2010	(r211532)
+++ stable/7/sys/sys/vnode.h	Fri Aug 20 20:58:57 2010	(r211533)
@@ -398,8 +398,8 @@ extern void	(*lease_updatetime)(int delt
 #define	VI_UNLOCK(vp)	mtx_unlock(&(vp)->v_interlock)
 #define	VI_MTX(vp)	(&(vp)->v_interlock)
 
-#define	VN_LOCK_AREC(vp)	((vp)->v_vnlock->lk_flags |= LK_CANRECURSE)
-#define	VN_LOCK_ASHARE(vp)	((vp)->v_vnlock->lk_flags &= ~LK_NOSHARE)
+#define	VN_LOCK_AREC(vp)	lockallowrecurse((vp)->v_vnlock)
+#define	VN_LOCK_ASHARE(vp)	lockallowshare((vp)->v_vnlock)
 
 #endif /* _KERNEL */
 

Modified: stable/7/sys/ufs/ffs/ffs_softdep.c
==============================================================================
--- stable/7/sys/ufs/ffs/ffs_softdep.c	Fri Aug 20 20:33:13 2010	(r211532)
+++ stable/7/sys/ufs/ffs/ffs_softdep.c	Fri Aug 20 20:58:57 2010	(r211533)
@@ -5291,9 +5291,7 @@ top:
 		return (0);
 loop:
 	/* While syncing snapshots, we must allow recursive lookups */
-	mtx_lock(bp->b_lock.lk_interlock);
-	bp->b_lock.lk_flags |= LK_CANRECURSE;
-	mtx_unlock(bp->b_lock.lk_interlock);
+	lockallowrecurse(&bp->b_lock);
 	ACQUIRE_LOCK(&lk);
 	/*
 	 * As we hold the buffer locked, none of its dependencies
@@ -5435,9 +5433,7 @@ loop:
 		/* We reach here only in error and unlocked */
 		if (error == 0)
 			panic("softdep_sync_metadata: zero error");
-		mtx_lock(bp->b_lock.lk_interlock);
-		bp->b_lock.lk_flags &= ~LK_CANRECURSE;
-		mtx_unlock(bp->b_lock.lk_interlock);
+		lockdisablerecurse(&bp->b_lock);
 		bawrite(bp);
 		return (error);
 	}
@@ -5449,9 +5445,7 @@ loop:
 			break;
 	}
 	VI_UNLOCK(vp);
-	mtx_lock(bp->b_lock.lk_interlock);
-	bp->b_lock.lk_flags &= ~LK_CANRECURSE;
-	mtx_unlock(bp->b_lock.lk_interlock);
+	lockdisablerecurse(&bp->b_lock);
 	bawrite(bp);
 	if (nbp != NULL) {
 		bp = nbp;

Modified: stable/7/sys/ufs/ffs/ffs_vfsops.c
==============================================================================
--- stable/7/sys/ufs/ffs/ffs_vfsops.c	Fri Aug 20 20:33:13 2010	(r211532)
+++ stable/7/sys/ufs/ffs/ffs_vfsops.c	Fri Aug 20 20:58:57 2010	(r211533)
@@ -1519,9 +1519,7 @@ ffs_vgetf(mp, ino, flags, vpp, ffs_flags
 	 */
 	if (vp->v_type != VFIFO) {
 		/* FFS supports shared locking for all files except fifos. */
-		VI_LOCK(vp);
 		VN_LOCK_ASHARE(vp);
-		VI_UNLOCK(vp);
 	}
 
 	/*

From owner-svn-src-all@FreeBSD.ORG  Fri Aug 20 23:51:34 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9D08D1065695;
	Fri, 20 Aug 2010 23:51:34 +0000 (UTC)
	(envelope-from davidxu@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8C8168FC1C;
	Fri, 20 Aug 2010 23:51:34 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7KNpYSi051061;
	Fri, 20 Aug 2010 23:51:34 GMT (envelope-from davidxu@svn.freebsd.org)
Received: (from davidxu@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7KNpYvo051059;
	Fri, 20 Aug 2010 23:51:34 GMT (envelope-from davidxu@svn.freebsd.org)
Message-Id: <201008202351.o7KNpYvo051059@svn.freebsd.org>
From: David Xu 
Date: Fri, 20 Aug 2010 23: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: r211534 - 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: Fri, 20 Aug 2010 23:51:34 -0000

Author: davidxu
Date: Fri Aug 20 23:51:34 2010
New Revision: 211534
URL: http://svn.freebsd.org/changeset/base/211534

Log:
  make sure thread lock is locked.

Modified:
  head/sys/kern/subr_sleepqueue.c

Modified: head/sys/kern/subr_sleepqueue.c
==============================================================================
--- head/sys/kern/subr_sleepqueue.c	Fri Aug 20 20:58:57 2010	(r211533)
+++ head/sys/kern/subr_sleepqueue.c	Fri Aug 20 23:51:34 2010	(r211534)
@@ -411,6 +411,7 @@ sleepq_catch_signals(void *wchan, int pr
 	if ((td->td_pflags & TDP_WAKEUP) != 0) {
 		td->td_pflags &= ~TDP_WAKEUP;
 		ret = EINTR;
+		thread_lock(td);
 		goto out;
 	}
 

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 08:49:54 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0147B1065675;
	Sat, 21 Aug 2010 08:49:54 +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 E60718FC08;
	Sat, 21 Aug 2010 08:49:53 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7L8nrXL061673;
	Sat, 21 Aug 2010 08:49:53 GMT (envelope-from kib@svn.freebsd.org)
Received: (from kib@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7L8nrTO061670;
	Sat, 21 Aug 2010 08:49:53 GMT (envelope-from kib@svn.freebsd.org)
Message-Id: <201008210849.o7L8nrTO061670@svn.freebsd.org>
From: Konstantin Belousov 
Date: Sat, 21 Aug 2010 08:49: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: r211536 - stable/8/bin/sleep
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 08:49:54 -0000

Author: kib
Date: Sat Aug 21 08:49:53 2010
New Revision: 211536
URL: http://svn.freebsd.org/changeset/base/211536

Log:
  MFC r210679:
  Report the time left for the sleep on SIGINFO.
  Be stricter in the checking of interval specification.
  
  MFC r210696:
  Deal with proper format for printing time_t.
  
  MFC r210749:
  Simplify argument parser by using sscanf(); simplify usage() by not
  refusing to use stdio.
  Reduce nesting level in the sleep loop by returning earlier for negative
  timeouts.
  Limit the maximum timeout to INT_MAX seconds.
  
  MFC r210750:
  Document the new argument parser for sleep(1) and SIGINFO behaviour.
  Remove higlight for the unportability notice.

Modified:
  stable/8/bin/sleep/sleep.1
  stable/8/bin/sleep/sleep.c
Directory Properties:
  stable/8/bin/sleep/   (props changed)

Modified: stable/8/bin/sleep/sleep.1
==============================================================================
--- stable/8/bin/sleep/sleep.1	Sat Aug 21 04:04:46 2010	(r211535)
+++ stable/8/bin/sleep/sleep.1	Sat Aug 21 08:49:53 2010	(r211536)
@@ -51,6 +51,10 @@ suspends execution for a minimum of
 If the
 .Nm
 command receives a signal, it takes the standard action.
+When the
+.Dv SIGINFO
+signal is received, the estimate of the amount of seconds left to
+sleep is printed on the standard output.
 .Sh IMPLEMENTATION NOTES
 The
 .Dv SIGALRM
@@ -58,14 +62,11 @@ signal is not handled specially by this 
 .Pp
 The
 .Nm
-command will accept and honor a non-integer number of specified seconds
-(with a
-.Ql .\&
-character as a decimal point).
-.Bf Sy
+command allows and honors a non-integer number of seconds to sleep
+in any form acceptable by
+.Xr strtod 3 .
 This is a non-portable extension, and its use will nearly guarantee that
 a shell script will not execute properly on another system.
-.Ef
 .Sh EXIT STATUS
 .Ex -std
 .Sh EXAMPLES

Modified: stable/8/bin/sleep/sleep.c
==============================================================================
--- stable/8/bin/sleep/sleep.c	Sat Aug 21 04:04:46 2010	(r211535)
+++ stable/8/bin/sleep/sleep.c	Sat Aug 21 08:49:53 2010	(r211536)
@@ -42,84 +42,61 @@ static char sccsid[] = "@(#)sleep.c	8.3 
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
-#include 
 
-void usage(void);
+static void usage(void);
+
+static volatile sig_atomic_t report_requested;
+static void
+report_request(int signo __unused)
+{
+
+	report_requested = 1;
+}
 
 int
 main(int argc, char *argv[])
 {
 	struct timespec time_to_sleep;
-	long l;
-	int neg;
-	char *p;
+	double d;
+	time_t original;
+	char buf[2];
 
-	if (argc != 2) {
+	if (argc != 2)
 		usage();
-		return(1);
-	}
-
-	p = argv[1];
 
-	/* Skip over leading whitespaces. */
-	while (isspace((unsigned char)*p))
-		++p;
-
-	/* Check for optional `+' or `-' sign. */
-	neg = 0;
-	if (*p == '-') {
-		neg = 1;
-		++p;
-		if (!isdigit((unsigned char)*p) && *p != '.') {
-			usage();
-			return(1);
-		}
-	}
-	else if (*p == '+')
-		++p;
-
-	/* Calculate seconds. */
-	if (isdigit((unsigned char)*p)) {
-		l = strtol(p, &p, 10);
-		if (l > INT_MAX) {
-			/*
-			 * Avoid overflow when `seconds' is huge.  This assumes
-			 * that the maximum value for a time_t is <= INT_MAX.
-			 */
-			l = INT_MAX;
-		}
-	} else
-		l = 0;
-	time_to_sleep.tv_sec = (time_t)l;
-
-	/* Calculate nanoseconds. */
-	time_to_sleep.tv_nsec = 0;
-
-	if (*p == '.') {		/* Decimal point. */
-		l = 100000000L;
-		do {
-			if (isdigit((unsigned char)*++p))
-				time_to_sleep.tv_nsec += (*p - '0') * l;
-			else
-				break;
-			l /= 10;
-		} while (l);
+	if (sscanf(argv[1], "%lf%1s", &d, buf) != 1)
+		usage();
+	if (d > INT_MAX)
+		usage();
+	if (d <= 0)
+		return (0);
+	original = time_to_sleep.tv_sec = (time_t)d;
+	time_to_sleep.tv_nsec = 1e9 * (d - time_to_sleep.tv_sec);
+
+	signal(SIGINFO, report_request);
+	while (nanosleep(&time_to_sleep, &time_to_sleep) != 0) {
+		if (report_requested) {
+			/* Reporting does not bother with nanoseconds. */
+			warnx("about %d second(s) left out of the original %d",
+			    (int)time_to_sleep.tv_sec, (int)original);
+			report_requested = 0;
+		} else
+			break;
 	}
-
-	if (!neg && (time_to_sleep.tv_sec > 0 || time_to_sleep.tv_nsec > 0))
-		(void)nanosleep(&time_to_sleep, (struct timespec *)NULL);
-
-	return(0);
+	return (0);
 }
 
-void
+static void
 usage(void)
 {
-	const char msg[] = "usage: sleep seconds\n";
 
-	write(STDERR_FILENO, msg, sizeof(msg) - 1);
+	fprintf(stderr, "usage: sleep seconds\n");
+	exit(1);
 }

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 10:27:31 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 262731065672;
	Sat, 21 Aug 2010 10:27:31 +0000 (UTC)
	(envelope-from rpaulo@freebsd.org)
Received: from karen.lavabit.com (karen.lavabit.com [72.249.41.33])
	by mx1.freebsd.org (Postfix) with ESMTP id DDFDF8FC15;
	Sat, 21 Aug 2010 10:27:30 +0000 (UTC)
Received: from d.earth.lavabit.com (d.earth.lavabit.com [192.168.111.13])
	by karen.lavabit.com (Postfix) with ESMTP id 0E01911BAD2;
	Sat, 21 Aug 2010 05:27:30 -0500 (CDT)
Received: from 10.0.10.3 (54.81.54.77.rev.vodafone.pt [77.54.81.54])
	by lavabit.com with ESMTP id NS08RJRZN0F4;
	Sat, 21 Aug 2010 05:27:30 -0500
Mime-Version: 1.0 (Apple Message framework v1081)
Content-Type: text/plain; charset=us-ascii
From: Rui Paulo 
In-Reply-To: <20100821054033.M19850@delplex.bde.org>
Date: Sat, 21 Aug 2010 11:27:26 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <91DC7F07-404F-4F9F-973D-682F97425DD2@FreeBSD.org>
References: <201008191259.o7JCxv3i004613@svn.freebsd.org>
	<20100820075236.L18914@delplex.bde.org>
	<4C6DC0F8.9040001@andric.com>
	<20100821054033.M19850@delplex.bde.org>
To: Bruce Evans 
X-Mailer: Apple Mail (2.1081)
Cc: svn-src-head@FreeBSD.org, Dimitry Andric ,
	src-committers@FreeBSD.org, svn-src-all@FreeBSD.org
Subject: Re: svn commit: r211505 - head/contrib/gcc
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 10:27:31 -0000


On 20 Aug 2010, at 21:36, Bruce Evans wrote:

> On Fri, 20 Aug 2010, Dimitry Andric wrote:
>=20
>> On 2010-08-20 00:20, Bruce Evans wrote:
>>> These seem to be needed, and some of them valid.  Any lvalue arg =
that
>>> can be put in a register can be cast to USItype (unsigned int) on =
i386.
>>> The args are macro args, so they may have any integer type no larger
>>> than USItype originally, and they must be cast to USItype for the =
asms
>>> to work if the args are smaller than USItype...
>>=20
>> But will the casts not potentially hide problems, if you pass the =
wrong
>> types to those macros?  Maybe it is better if the compiler complains
>> that some argument is of an incompatible type, than just forcing it =
to
>> cast?
>=20
> This is unclear.  All integer types are compatible to some extent.
> Upcasting them always works and downcasting them works iff the value
> is not changed.

I think he meant that downcasting might not work.

>=20
>>>> which are apparently "heinous" GNU extensions, so clang can
>>>> compile this without using the -fheinous-gnu-extensions option.
>>>=20
>>> But when the args are lvalues, casting them is invalid.  This is
>>> apparently the heinous extension depended on.
>>=20
>> Yes, clang complains precisely about that:
>>=20
>> gnu/lib/libgcc/../../../contrib/gcc/libgcc2.c:536:22: error: invalid =
use of a cast in a inline asm context requiring an l-value: remove the =
cast or build with -fheinous-gnu-extensions
>> DWunion w =3D {.ll =3D __umulsidi3 (uu.s.low, vv.s.low)};
>>                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> In file included from =
gnu/lib/libgcc/../../../contrib/gcc/libgcc2.c:65:
>> In file included from =
gnu/lib/libgcc/../../../contrib/gcc/libgcc2.h:435:
>> gnu/lib/libgcc/../../../contrib/gcc/longlong.h:1293:5: note: =
instantiated from:
>>   umul_ppmm (__w.s.high, __w.s.low, u, v);                            =
\
>>   ^
>>=20
>> It turns out that only removing the casts for these specific lvalues =
is
>> indeed enough to make clang happy.  Attached patch reverts all other
>> changes, if that is to be preferred.
>=20
> I prefer this.

I'll commit this.

>=20
>>>> Results in *no* binary change, neither with clang, nor with gcc.
>>>=20
>>> This cannot be tested by compiling a few binaries, since the few =
binaries
>>> might not include enough examples to give test coverage of cases =
with
>>> args smaller than USItype.  Perhaps the macros are only used for =
building
>>> libgcc, but this is unclear.
>>=20
>> contrib/gcc/longlong.h is only used in contrib/gcc/libgcc2.h, and in
>> contrib/gcc/config/soft-fp/soft-fp.h.  On i386, soft-fp is not used,
>> and libgcc2.h is only used in contrib/gcc/libgcc2.c, so libgcc is the
>> only consumer, as far as I can see.
>=20
> There are many parameters.  Probably the casts are needed for some =
arches,
> so gnu can't just remove them and wouldn't like your patch.  But they =
should
> fix the casts of lvalues someday.
>=20
> The ifdefs are hard to untangle.  I thought I found a simple case =
where
> the cast helps, but actually the ifdefs make the cast have no effect
> although the code is logically wrong.  =46rom your patch:
>=20
> %  #define count_leading_zeros(count, x) \
> %    do {									=
\
> %      USItype __cbtmp;							=
\
> %      __asm__ ("bsrl %1,%0"						=
\
> % -	     : "=3Dr" (__cbtmp) : "rm" (x));				=
\
> % +	     : "=3Dr" (__cbtmp) : "rm" ((USItype) (x)));			=
\
> %      (count) =3D __cbtmp ^ 31;						=
\
> %    } while (0)
> %  #define count_trailing_zeros(count, x) \
>=20
> This interface is supposed to operate on `UWtype x'.  UWtype is =
UDItype
> on some arches, so casting it to USItype breaks it.  However, the =
breakage
> is only logical since all this is under a __i386__ && W_TYPE_SIZE =3D=3D=
 32
> ifdef, which makes UWtype the same width as USItype so the cast has no
> effect if x has the correct type.
>=20
> The above wouldn't work on amd64 since the correct code is bsrq with =
no
> cast (the value is 64 bits; the cast would give a 32-bit value; apart =
from breaking the value, this would give invalid asm like "bsrq %eax" if =
the
> casted value ends up in a register.  Handling all the cases is =
apparently
> too hard, so longlong.h doesn't have any special support for clz on =
amd64
> and a generic version -- the above is apparently used for __clzsi2() =
and
> _clzdi2() on i386, but on amd64 a slow loop is used.  gcc asm still =
seems
> to be missing support for writing this correctly ("bsr%[mumble1] =
%1,%0",
> where %[mumble1] is either q or l (or w or b?) depending on the size =
of %1).

I agree with you. Thanks for the careful analysis.

Regards,
--
Rui Paulo



From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 10:31:26 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BAA141065696;
	Sat, 21 Aug 2010 10:31:26 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 91F258FC15;
	Sat, 21 Aug 2010 10:31:26 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LAVQJ6065676;
	Sat, 21 Aug 2010 10:31:26 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LAVQLt065674;
	Sat, 21 Aug 2010 10:31:26 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201008211031.o7LAVQLt065674@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Aug 2010 10:31: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: r211537 - head/contrib/gcc
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 10:31:26 -0000

Author: rpaulo
Date: Sat Aug 21 10:31:26 2010
New Revision: 211537
URL: http://svn.freebsd.org/changeset/base/211537

Log:
  Revert part of r211505. Some of the removed casts are actually safe so
  put them back in again. Also, clang only complained about the lvalue
  cast.
  
  Submitted by:	Dimitry Andric 
  Pointed out:	bde

Modified:
  head/contrib/gcc/longlong.h

Modified: head/contrib/gcc/longlong.h
==============================================================================
--- head/contrib/gcc/longlong.h	Sat Aug 21 08:49:53 2010	(r211536)
+++ head/contrib/gcc/longlong.h	Sat Aug 21 10:31:26 2010	(r211537)
@@ -314,38 +314,38 @@ UDItype __umulsidi3 (USItype, USItype);
 #if (defined (__i386__) || defined (__i486__)) && W_TYPE_SIZE == 32
 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
   __asm__ ("addl %5,%1\n\tadcl %3,%0"					\
-	   : "=r" (sh),							\
-	     "=&r" (sl)							\
-	   : "%0" (ah),							\
-	     "g" (bh),							\
-	     "%1" (al),							\
-	     "g" (bl))
+	   : "=r" ((USItype) (sh)),					\
+	     "=&r" ((USItype) (sl))					\
+	   : "%0" ((USItype) (ah)),					\
+	     "g" ((USItype) (bh)),					\
+	     "%1" ((USItype) (al)),					\
+	     "g" ((USItype) (bl)))
 #define sub_ddmmss(sh, sl, ah, al, bh, bl) \
   __asm__ ("subl %5,%1\n\tsbbl %3,%0"					\
 	   : "=r" (sh),							\
 	     "=&r" (sl)							\
-	   : "0" (ah),							\
-	     "g" (bh),							\
-	     "1" (al),							\
-	     "g" (bl))
+	   : "0" ((USItype) (ah)),					\
+	     "g" ((USItype) (bh)),					\
+	     "1" ((USItype) (al)),					\
+	     "g" ((USItype) (bl)))
 #define umul_ppmm(w1, w0, u, v) \
   __asm__ ("mull %3"							\
 	   : "=a" (w0),							\
 	     "=d" (w1)							\
-	   : "%0" (u),							\
-	     "rm" (v))
+	   : "%0" ((USItype) (u)),					\
+	     "rm" ((USItype) (v)))
 #define udiv_qrnnd(q, r, n1, n0, dv) \
   __asm__ ("divl %4"							\
 	   : "=a" (q),							\
 	     "=d" (r)							\
-	   : "0" (n0),							\
-	     "1" (n1),							\
-	     "rm" (dv))
+	   : "0" ((USItype) (n0)),					\
+	     "1" ((USItype) (n1)),					\
+	     "rm" ((USItype) (dv)))
 #define count_leading_zeros(count, x) \
   do {									\
     USItype __cbtmp;							\
     __asm__ ("bsrl %1,%0"						\
-	     : "=r" (__cbtmp) : "rm" (x));				\
+	     : "=r" (__cbtmp) : "rm" ((USItype) (x)));			\
     (count) = __cbtmp ^ 31;						\
   } while (0)
 #define count_trailing_zeros(count, x) \

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 10:38:51 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0CFD61065673;
	Sat, 21 Aug 2010 10:38:51 +0000 (UTC)
	(envelope-from andre@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id F1FF78FC08;
	Sat, 21 Aug 2010 10:38:50 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LAcokm065859;
	Sat, 21 Aug 2010 10:38:50 GMT (envelope-from andre@svn.freebsd.org)
Received: (from andre@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LAcopt065857;
	Sat, 21 Aug 2010 10:38:50 GMT (envelope-from andre@svn.freebsd.org)
Message-Id: <201008211038.o7LAcopt065857@svn.freebsd.org>
From: Andre Oppermann 
Date: Sat, 21 Aug 2010 10:38: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: r211538 - 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: Sat, 21 Aug 2010 10:38:51 -0000

Author: andre
Date: Sat Aug 21 10:38:50 2010
New Revision: 211538
URL: http://svn.freebsd.org/changeset/base/211538

Log:
  MFC r211315:
  
    Disable TCP inflight limiter by default.

Modified:
  stable/8/sys/netinet/tcp_subr.c

Modified: stable/8/sys/netinet/tcp_subr.c
==============================================================================
--- stable/8/sys/netinet/tcp_subr.c	Sat Aug 21 10:31:26 2010	(r211537)
+++ stable/8/sys/netinet/tcp_subr.c	Sat Aug 21 10:38:50 2010	(r211538)
@@ -221,7 +221,7 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO,
 SYSCTL_NODE(_net_inet_tcp, OID_AUTO, inflight, CTLFLAG_RW, 0,
     "TCP inflight data limiting");
 
-static VNET_DEFINE(int, tcp_inflight_enable) = 1;
+static VNET_DEFINE(int, tcp_inflight_enable) = 0;
 #define	V_tcp_inflight_enable		VNET(tcp_inflight_enable)
 SYSCTL_VNET_INT(_net_inet_tcp_inflight, OID_AUTO, enable, CTLFLAG_RW,
     &VNET_NAME(tcp_inflight_enable), 0,

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 10:39:51 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9F7A110656AC;
	Sat, 21 Aug 2010 10:39:51 +0000 (UTC)
	(envelope-from andre@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8625B8FC0A;
	Sat, 21 Aug 2010 10:39:51 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LAdpMm065914;
	Sat, 21 Aug 2010 10:39:51 GMT (envelope-from andre@svn.freebsd.org)
Received: (from andre@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LAdp30065912;
	Sat, 21 Aug 2010 10:39:51 GMT (envelope-from andre@svn.freebsd.org)
Message-Id: <201008211039.o7LAdp30065912@svn.freebsd.org>
From: Andre Oppermann 
Date: Sat, 21 Aug 2010 10:39:51 +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: r211539 - stable/7/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, 21 Aug 2010 10:39:52 -0000

Author: andre
Date: Sat Aug 21 10:39:51 2010
New Revision: 211539
URL: http://svn.freebsd.org/changeset/base/211539

Log:
  MFC r211315:
  
    Disable TCP inflight limiter by default.

Modified:
  stable/7/sys/netinet/tcp_subr.c

Modified: stable/7/sys/netinet/tcp_subr.c
==============================================================================
--- stable/7/sys/netinet/tcp_subr.c	Sat Aug 21 10:38:50 2010	(r211538)
+++ stable/7/sys/netinet/tcp_subr.c	Sat Aug 21 10:39:51 2010	(r211539)
@@ -206,7 +206,7 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, isn_
 SYSCTL_NODE(_net_inet_tcp, OID_AUTO, inflight, CTLFLAG_RW, 0,
     "TCP inflight data limiting");
 
-static int	tcp_inflight_enable = 1;
+static int	tcp_inflight_enable = 0;
 SYSCTL_INT(_net_inet_tcp_inflight, OID_AUTO, enable, CTLFLAG_RW,
     &tcp_inflight_enable, 0, "Enable automatic TCP inflight data limiting");
 

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 10:40:13 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 22B981065697;
	Sat, 21 Aug 2010 10:40:13 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 14A688FC0A;
	Sat, 21 Aug 2010 10:40:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LAeCFJ065967;
	Sat, 21 Aug 2010 10:40:12 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LAeCUj065965;
	Sat, 21 Aug 2010 10:40:12 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201008211040.o7LAeCUj065965@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Aug 2010 10:40: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: r211540 - head/lib/libelf
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 10:40:13 -0000

Author: rpaulo
Date: Sat Aug 21 10:40:12 2010
New Revision: 211540
URL: http://svn.freebsd.org/changeset/base/211540

Log:
  Install a PIC libelf. This will be needed by the DTrace runtime
  instrumentation object (dtri.o).
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/lib/libelf/Makefile

Modified: head/lib/libelf/Makefile
==============================================================================
--- head/lib/libelf/Makefile	Sat Aug 21 10:39:51 2010	(r211539)
+++ head/lib/libelf/Makefile	Sat Aug 21 10:40:12 2010	(r211540)
@@ -55,6 +55,7 @@ SRCS=	elf_begin.c						\
 	${GENSRCS}
 INCS=	libelf.h gelf.h
 
+INSTALL_PIC_ARCHIVE=yes
 GENSRCS=	libelf_fsize.c libelf_msize.c libelf_convert.c
 CLEANFILES=	${GENSRCS}
 CFLAGS+=	-I. -I${.CURDIR}

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 10:40:44 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 727771065696;
	Sat, 21 Aug 2010 10:40:44 +0000 (UTC)
	(envelope-from andre@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 637E18FC12;
	Sat, 21 Aug 2010 10:40:44 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LAeiX0066010;
	Sat, 21 Aug 2010 10:40:44 GMT (envelope-from andre@svn.freebsd.org)
Received: (from andre@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LAeiXd066008;
	Sat, 21 Aug 2010 10:40:44 GMT (envelope-from andre@svn.freebsd.org)
Message-Id: <201008211040.o7LAeiXd066008@svn.freebsd.org>
From: Andre Oppermann 
Date: Sat, 21 Aug 2010 10:40:44 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org
X-SVN-Group: stable-6
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r211541 - stable/6/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, 21 Aug 2010 10:40:44 -0000

Author: andre
Date: Sat Aug 21 10:40:44 2010
New Revision: 211541
URL: http://svn.freebsd.org/changeset/base/211541

Log:
  MFC r211315:
  
    Disable TCP inflight limiter by default.

Modified:
  stable/6/sys/netinet/tcp_subr.c

Modified: stable/6/sys/netinet/tcp_subr.c
==============================================================================
--- stable/6/sys/netinet/tcp_subr.c	Sat Aug 21 10:40:12 2010	(r211540)
+++ stable/6/sys/netinet/tcp_subr.c	Sat Aug 21 10:40:44 2010	(r211541)
@@ -231,7 +231,7 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, nolo
 SYSCTL_NODE(_net_inet_tcp, OID_AUTO, inflight, CTLFLAG_RW, 0,
     "TCP inflight data limiting");
 
-static int	tcp_inflight_enable = 1;
+static int	tcp_inflight_enable = 0;
 SYSCTL_INT(_net_inet_tcp_inflight, OID_AUTO, enable, CTLFLAG_RW,
     &tcp_inflight_enable, 0, "Enable automatic TCP inflight data limiting");
 

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 11:01:40 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 882F710656A8;
	Sat, 21 Aug 2010 11:01:40 +0000 (UTC)
	(envelope-from andre@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 78F698FC0C;
	Sat, 21 Aug 2010 11:01:40 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LB1eDE066561;
	Sat, 21 Aug 2010 11:01:40 GMT (envelope-from andre@svn.freebsd.org)
Received: (from andre@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LB1eud066559;
	Sat, 21 Aug 2010 11:01:40 GMT (envelope-from andre@svn.freebsd.org)
Message-Id: <201008211101.o7LB1eud066559@svn.freebsd.org>
From: Andre Oppermann 
Date: Sat, 21 Aug 2010 11:01:40 +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: r211542 - 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: Sat, 21 Aug 2010 11:01:40 -0000

Author: andre
Date: Sat Aug 21 11:01:40 2010
New Revision: 211542
URL: http://svn.freebsd.org/changeset/base/211542

Log:
  MFC r211316:
  
    Change the messages of the ICMP bad port bandwidth limiter from
    a kernel printf to a log output with the priority of LOG_NOTICE.

Modified:
  stable/8/sys/netinet/ip_icmp.c

Modified: stable/8/sys/netinet/ip_icmp.c
==============================================================================
--- stable/8/sys/netinet/ip_icmp.c	Sat Aug 21 10:40:44 2010	(r211541)
+++ stable/8/sys/netinet/ip_icmp.c	Sat Aug 21 11:01:40 2010	(r211542)
@@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -975,7 +976,7 @@ badport_bandlim(int which)
 		 * the previous behaviour at the expense of added complexity.
 		 */
 		if (V_icmplim_output && opps > V_icmplim)
-			printf("Limiting %s from %d to %d packets/sec\n",
+			log(LOG_NOTICE, "Limiting %s from %d to %d packets/sec\n",
 				r->type, opps, V_icmplim);
 	}
 	return 0;			/* okay to send packet */

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 11:02:18 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id EDBD8106566B;
	Sat, 21 Aug 2010 11:02:18 +0000 (UTC)
	(envelope-from andre@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id DEBD18FC1F;
	Sat, 21 Aug 2010 11:02:18 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LB2IWg066614;
	Sat, 21 Aug 2010 11:02:18 GMT (envelope-from andre@svn.freebsd.org)
Received: (from andre@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LB2IWp066612;
	Sat, 21 Aug 2010 11:02:18 GMT (envelope-from andre@svn.freebsd.org)
Message-Id: <201008211102.o7LB2IWp066612@svn.freebsd.org>
From: Andre Oppermann 
Date: Sat, 21 Aug 2010 11:02:18 +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: r211543 - stable/7/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, 21 Aug 2010 11:02:19 -0000

Author: andre
Date: Sat Aug 21 11:02:18 2010
New Revision: 211543
URL: http://svn.freebsd.org/changeset/base/211543

Log:
  MFC r211316:
  
    Change the messages of the ICMP bad port bandwidth limiter from
    a kernel printf to a log output with the priority of LOG_NOTICE.

Modified:
  stable/7/sys/netinet/ip_icmp.c

Modified: stable/7/sys/netinet/ip_icmp.c
==============================================================================
--- stable/7/sys/netinet/ip_icmp.c	Sat Aug 21 11:01:40 2010	(r211542)
+++ stable/7/sys/netinet/ip_icmp.c	Sat Aug 21 11:02:18 2010	(r211543)
@@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -920,7 +921,7 @@ badport_bandlim(int which)
 		 * the previous behaviour at the expense of added complexity.
 		 */
 		if (icmplim_output && opps > icmplim)
-			printf("Limiting %s from %d to %d packets/sec\n",
+			log(LOG_NOTICE, "Limiting %s from %d to %d packets/sec\n",
 				r->type, opps, icmplim);
 	}
 	return 0;			/* okay to send packet */

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 11:02:54 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id AAB861065694;
	Sat, 21 Aug 2010 11:02:54 +0000 (UTC)
	(envelope-from andre@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9B9988FC16;
	Sat, 21 Aug 2010 11:02:54 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LB2suY066658;
	Sat, 21 Aug 2010 11:02:54 GMT (envelope-from andre@svn.freebsd.org)
Received: (from andre@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LB2ssb066656;
	Sat, 21 Aug 2010 11:02:54 GMT (envelope-from andre@svn.freebsd.org)
Message-Id: <201008211102.o7LB2ssb066656@svn.freebsd.org>
From: Andre Oppermann 
Date: Sat, 21 Aug 2010 11:02:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org
X-SVN-Group: stable-6
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r211544 - stable/6/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, 21 Aug 2010 11:02:54 -0000

Author: andre
Date: Sat Aug 21 11:02:54 2010
New Revision: 211544
URL: http://svn.freebsd.org/changeset/base/211544

Log:
  MFC r211316:
  
    Change the messages of the ICMP bad port bandwidth limiter from
    a kernel printf to a log output with the priority of LOG_NOTICE.

Modified:
  stable/6/sys/netinet/ip_icmp.c

Modified: stable/6/sys/netinet/ip_icmp.c
==============================================================================
--- stable/6/sys/netinet/ip_icmp.c	Sat Aug 21 11:02:18 2010	(r211543)
+++ stable/6/sys/netinet/ip_icmp.c	Sat Aug 21 11:02:54 2010	(r211544)
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -922,7 +923,7 @@ badport_bandlim(int which)
 		 * the previous behaviour at the expense of added complexity.
 		 */
 		if (icmplim_output && opps > icmplim)
-			printf("Limiting %s from %d to %d packets/sec\n",
+			log(LOG_NOTICE, "Limiting %s from %d to %d packets/sec\n",
 				r->type, opps, icmplim);
 	}
 	return 0;			/* okay to send packet */

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 11:04:39 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 81B811065698;
	Sat, 21 Aug 2010 11:04:39 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6EB2E8FC14;
	Sat, 21 Aug 2010 11:04:39 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LB4dEf066820;
	Sat, 21 Aug 2010 11:04:39 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LB4c7Z066736;
	Sat, 21 Aug 2010 11:04:38 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201008211104.o7LB4c7Z066736@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Aug 2010 11:04:38 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r211545 - in
	head/cddl/contrib/opensolaris/cmd/dtrace/test: cmd/scripts
	tst/common/aggs tst/common/assocs tst/common/dtraceUtil
	tst/common/funcs tst/common/ip tst/common/misc tst/common...
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 11:04:39 -0000

Author: rpaulo
Date: Sat Aug 21 11:04:38 2010
New Revision: 211545
URL: http://svn.freebsd.org/changeset/base/211545

Log:
  Port most of the DTrace tests to FreeBSD.
  
  Sponsored by:	The FreeBSD Foundation

Added:
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/Makefile   (contents, props changed)
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/main.c   (contents, props changed)
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/prov.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/prov.h   (contents, props changed)
Modified:
  head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.subr.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.orthogonality.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.AddSearchPath.d.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithModule.d.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ELFGenerationOut.d.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ELFGenerationWithO.d.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.PreprocessorStatement.d.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoofew.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoomany.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoofew.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoomany.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.index.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv4remote.pl
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv6remote.pl
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localicmp.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteicmp.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteudp.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6localicmp.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6remoteicmp.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.include.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.schrock.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.fork.c
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.gcc.c
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex1.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex2.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex4.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.largeusersym.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.walltimestamp.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printT.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.printY.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.sym.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printf/tst.sym.d.out
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.exec.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.execfail.ENOENT.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.execfail.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.sigwait.d
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.D_MACRO_UNUSED.overflow.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.arguments.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.egid.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.euid.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.gid.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.ppid.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.projid.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.sid.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.stringmacro.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.taskid.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.uid.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.c
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.badguess.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose1.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose2.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose3.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.eliminate.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.entryreturn.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.fork.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.guess32.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.guess64.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.header.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.include.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.linkpriv.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.linkunpriv.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiple.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.nodtrace.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.onlyenabled.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.reeval.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.static.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.static2.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.user.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.ucaller.ksh
  head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/usdt/tst.tailcall.ksh

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dtest.pl	Sat Aug 21 11:04:38 2010	(r211545)
@@ -43,7 +43,7 @@ $USAGE = "Usage: $PNAME [-abfghjlnqs] [-
 
 @dtrace_argv = ();
 
-$ksh_path = '/bin/sh';
+$ksh_path = '/usr/local/bin/ksh';
 
 @files = ();
 %exceptions = ();

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.subr.d
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.subr.d	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/aggs/tst.subr.d	Sat Aug 21 11:04:38 2010	(r211545)
@@ -26,7 +26,6 @@
 
 #pragma ident	"%Z%%M%	%I%	%E% SMI"
 
-#include 
 
 #define INTFUNC(x)			\
 	BEGIN				\

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.orthogonality.d
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.orthogonality.d	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/assocs/tst.orthogonality.d	Sat Aug 21 11:04:38 2010	(r211545)
@@ -39,13 +39,13 @@ BEGIN
 }
 
 BEGIN
-/b[curthread->t_did] == 0/
+/b[curthread->td_flags] == 0/
 {
 	exit(0);
 }
 
 BEGIN
 {
-	printf("value should be 0; value is %x!", b[curthread->t_did]);
+	printf("value should be 0; value is %x!", b[curthread->td_flags]);
 	exit(1);
 }

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.AddSearchPath.d.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.AddSearchPath.d.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.AddSearchPath.d.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -78,5 +78,5 @@ if [ "$status" -ne 0 ]; then
 	exit $status
 fi
 
-/usr/bin/rm -f $tempfile
+/bin/rm -f $tempfile
 exit 0

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithModule.d.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithModule.d.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.DestructWithModule.d.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -44,7 +44,7 @@ fi
 
 dtrace=$1
 
-$dtrace -qwm unix'{chill(15); printf("Done chilling"); exit(0);}'
+$dtrace -qwm kernel'{chill(15); printf("Done chilling"); exit(0);}'
 status=$?
 
 if [ "$status" -ne 0 ]; then

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ELFGenerationOut.d.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ELFGenerationOut.d.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ELFGenerationOut.d.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -69,5 +69,5 @@ if [ ! -a "d.out" ]; then
 	exit 1
 fi
 
-/usr/bin/rm -f "d.out"
+/bin/rm -f "d.out"
 exit 0

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ELFGenerationWithO.d.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ELFGenerationWithO.d.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.ELFGenerationWithO.d.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -70,5 +70,5 @@ if [ ! -a "outputFile" ]; then
 	exit 1
 fi
 
-/usr/bin/rm -f "outputFile"
+/bin/rm -f "outputFile"
 exit 0

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.PreprocessorStatement.d.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.PreprocessorStatement.d.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/dtraceUtil/tst.PreprocessorStatement.d.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -43,7 +43,6 @@ script()
 {
 	$dtrace -CH -s /dev/stdin <
 
 	BEGIN
 	{

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoofew.d
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoofew.d	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoofew.d	Sat Aug 21 11:04:38 2010	(r211545)
@@ -34,7 +34,7 @@
  *
  */
 
-lockstat:genunix:mutex_enter:adaptive-acquire
+lockstat:kernel:mtx_lock:adaptive-acquire
 {
 	mutex_owned();
 	exit(1);

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoomany.d
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoomany.d	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.motoomany.d	Sat Aug 21 11:04:38 2010	(r211545)
@@ -34,7 +34,7 @@
  *
  */
 
-lockstat:genunix:mutex_enter:adaptive-acquire
+lockstat:kernel:mtx_lock:adaptive-acquire
 {
 	mutex_owned((kmutex_t *)arg0, 99);
 	exit(1);

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoofew.d
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoofew.d	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoofew.d	Sat Aug 21 11:04:38 2010	(r211545)
@@ -36,7 +36,7 @@
  */
 
 
-lockstat:genunix:mutex_enter:adaptive-acquire
+lockstat:kernel:mtx_lock:adaptive-acquire
 {
 	mutex_type_adaptive();
 	exit(1);

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoomany.d
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoomany.d	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/err.D_PROTO_LEN.mtatoomany.d	Sat Aug 21 11:04:38 2010	(r211545)
@@ -35,7 +35,7 @@
  */
 
 
-lockstat:genunix:mutex_enter:adaptive-acquire
+lockstat:kernel:mtx_lock:adaptive-acquire
 {
 	mutex_type_adaptive((kmutex_t *)arg0, 99);
 	exit(1);

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.index.d
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.index.d	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/funcs/tst.index.d	Sat Aug 21 11:04:38 2010	(r211545)
@@ -80,7 +80,7 @@ BEGIN
 	i++;
 
 	end = j = k = 0;
-	printf("#!/usr/perl5/bin/perl\n\nBEGIN {\n");
+	printf("#!/usr/bin/perl\n\nBEGIN {\n");
 }
 
 tick-1ms

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv4remote.pl
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv4remote.pl	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv4remote.pl	Sat Aug 21 11:04:38 2010	(r211545)
@@ -50,7 +50,7 @@ my $local = "";
 my $remote = "";
 my %Broadcast;
 my $up;
-open IFCONFIG, '/usr/sbin/ifconfig -a |' or die "Couldn't run ifconfig: $!\n";
+open IFCONFIG, '/sbin/ifconfig -a |' or die "Couldn't run ifconfig: $!\n";
 while () {
 	next if /^lo/;
 
@@ -73,7 +73,7 @@ die "Could not determine local IP addres
 # Find the first remote host that responds to an icmp echo,
 # which isn't a local address.
 #
-open PING, "/usr/sbin/ping -ns $Broadcast{$local} 56 $MAXHOSTS |" or
+open PING, "/sbin/ping -ns $Broadcast{$local} 56 $MAXHOSTS |" or
     die "Couldn't run ping: $!\n";
 while () {
 	if (/bytes from (.*): / and not defined $Broadcast{$1}) {

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv6remote.pl
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv6remote.pl	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/get.ipv6remote.pl	Sat Aug 21 11:04:38 2010	(r211545)
@@ -50,7 +50,7 @@ my $local = "";
 my $remote = "";
 my %Local;
 my $up;
-open IFCONFIG, '/usr/sbin/ifconfig -a inet6 |'
+open IFCONFIG, '/sbin/ifconfig -a inet6 |'
     or die "Couldn't run ifconfig: $!\n";
 while () {
 	next if /^lo/;
@@ -74,7 +74,7 @@ exit 1 if $local eq "";
 # Find the first remote host that responds to an icmp echo,
 # which isn't a local address.
 #
-open PING, "/usr/sbin/ping -ns -A inet6 $MULTICAST 56 $MAXHOSTS |" or
+open PING, "/sbin/ping -ns -A inet6 $MULTICAST 56 $MAXHOSTS |" or
     die "Couldn't run ping: $!\n";
 while () {
 	if (/bytes from (.*): / and not defined $Local{$1}) {

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localicmp.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localicmp.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localicmp.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -45,7 +45,7 @@ fi
 dtrace=$1
 local=127.0.0.1
 
-$dtrace -c "/usr/sbin/ping $local 3" -qs /dev/stdin <ip_saddr == "$local" && args[2]->ip_daddr == "$local" &&
     args[4]->ipv4_protocol == IPPROTO_ICMP/

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localtcp.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -120,6 +120,6 @@ EODTRACE
 status=$?
 
 cd /
-/usr/bin/rm -rf $DIR
+/bin/rm -rf $DIR
 
 exit $status

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4localudp.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -57,7 +57,7 @@ fi
 dtrace=$1
 local=127.0.0.1
 
-$dtrace -c "/usr/sbin/ping -U $local" -qs /dev/stdin <ip_saddr == "$source" && args[2]->ip_daddr == "$dest" &&

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remotetcp.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -123,6 +123,6 @@ EODTRACE
 status=$?
 
 cd /
-/usr/bin/rm -rf $DIR
+/bin/rm -rf $DIR
 
 exit $?

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteudp.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteudp.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv4remoteudp.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -60,7 +60,7 @@ if (( $? != 0 )); then
 	exit 4
 fi
 
-$dtrace -c "/usr/sbin/ping -U $dest" -qs /dev/stdin <ip_saddr == "$local" && args[2]->ip_daddr == "$local" &&
     args[5]->ipv6_nexthdr == IPPROTO_ICMPV6/

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6remoteicmp.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6remoteicmp.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.ipv6remoteicmp.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -62,9 +62,9 @@ fi
 #
 # Shake loose any ICMPv6 Neighbor advertisement messages before tracing.
 #
-/usr/sbin/ping $dest 3 > /dev/null 2>&1
+/sbin/ping $dest 3 > /dev/null 2>&1
 
-$dtrace -c "/usr/sbin/ping $dest 3" -qs /dev/stdin <ip_saddr == "$source" && args[2]->ip_daddr == "$dest" &&

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.localtcpstate.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -177,6 +177,6 @@ EODTRACE
 status=$?
 
 cd /
-/usr/bin/rm -rf $DIR
+/bin/rm -rf $DIR
 
 exit $status

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/ip/tst.remotetcpstate.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -167,6 +167,6 @@ EODTRACE
 status=$?
 
 cd /
-/usr/bin/rm -rf $DIR
+/bin/rm -rf $DIR
 
 exit $status

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.include.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.include.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.include.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -31,7 +31,7 @@ if [ $# != 1 ]; then
 fi
 
 dtrace=$1
-CC=/usr/sfw/bin/gcc
+CC=/usr/bin/gcc
 CFLAGS=
 
 doit()

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.schrock.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.schrock.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/misc/tst.schrock.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -39,7 +39,7 @@ dtrace=$1
 # LD_NOEXEC_64 variable prevents nm from re-execing itself.
 #
 LD_NOEXEC_64=tomeeisrad $dtrace -F -s /dev/stdin -c \
-    '/usr/ccs/bin/nm /bin/ls' stat <
 #include 
+#include 
 
 void
 go(void)
 {
 	pid_t pid;
 
-	(void) posix_spawn(&pid, "/usr/bin/ls", NULL, NULL, NULL, NULL);
+	(void) posix_spawn(&pid, "/bin/ls", NULL, NULL, NULL, NULL);
 
 	(void) waitpid(pid, NULL, 0);
 }

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex1.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex1.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex1.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -88,6 +88,6 @@ script
 status=$?
 
 cd /tmp
-/usr/bin/rm -rf $DIR
+/bin/rm -rf $DIR
 
 exit $status

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex2.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex2.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex2.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -126,6 +126,6 @@ script
 status=$?
 
 cd /tmp
-/usr/bin/rm -rf $DIR
+/bin/rm -rf $DIR
 
 exit $status

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex3.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -97,6 +97,6 @@ script
 status=$?
 
 cd /tmp
-/usr/bin/rm -rf $DIR
+/bin/rm -rf $DIR
 
 exit $status

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex4.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex4.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.provregex4.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -149,6 +149,6 @@ script
 status=$?
 
 cd /tmp
-/usr/bin/rm -rf $DIR
+/bin/rm -rf $DIR
 
 exit $status

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.largeusersym.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.largeusersym.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.largeusersym.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -78,6 +78,6 @@ script
 status=$?
 
 cd /
-/usr/bin/rm -rf $DIR
+/bin/rm -rf $DIR
 
 exit $status

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.walltimestamp.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.walltimestamp.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.walltimestamp.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -33,7 +33,7 @@ fi
 dtrace=$1
 
 # The output files assumes the timezone is US/Pacific
-TZ=US/Pacific
+export TZ=America/Los_Angeles
 
 $dtrace -s /dev/stdin <exec = 1;
 	}
 
-	proc:::exec_success
+	proc:::exec-success
 	/self->exec/
 	{
 		exit(0);

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.execfail.ENOENT.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.execfail.ENOENT.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.execfail.ENOENT.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -42,7 +42,7 @@ script()
 		self->exec = 1;
 	}
 
-	proc:::exec_failure
+	proc:::exec-failure
 	/self->exec && args[0] == ENOENT/
 	{
 		exit(0);

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.execfail.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.execfail.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.execfail.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -45,7 +45,7 @@ script()
 		self->exec = 1;
 	}
 
-	proc:::exec_failure
+	proc:::exec-failure
 	/self->exec/
 	{
 		exit(0);

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.sigwait.d
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.sigwait.d	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/proc/tst.sigwait.d	Sat Aug 21 11:04:38 2010	(r211545)
@@ -28,13 +28,13 @@
 
 #pragma D option destructive
 
-proc:::signal_send
+proc:::signal-send
 /args[1]->p_pid == $1 && args[2] == SIGUSR1/
 {
 	sent = 1;
 }
 
-proc:::signal_clear
+proc:::signal-clear
 /pid == $1 && args[0] == SIGUSR1 && sent/
 {
 	exit(0);

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.D_MACRO_UNUSED.overflow.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.D_MACRO_UNUSED.overflow.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.D_MACRO_UNUSED.overflow.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -70,11 +70,11 @@ fi
 grep "D_MACRO_UNUSED" /var/tmp/err.$$.txt >/dev/null 2>&1
 if [ $? -ne 0 ]; then
 	print -u2 "Expected error D_MACRO_UNUSED not returned"
-	/usr/bin/rm -f /var/tmp/err.$$.txt
+	/bin/rm -f /var/tmp/err.$$.txt
 	exit 1
 fi
 
-/usr/bin/rm -f $dfilename
-/usr/bin/rm -f /var/tmp/err.$$.txt
+/bin/rm -f $dfilename
+/bin/rm -f /var/tmp/err.$$.txt
 
 exit 0

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.arguments.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.arguments.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.arguments.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -42,7 +42,7 @@ fi
 
 dtrace=$1
 
-bname=`/bin/basename $0`
+bname=`/usr/bin/basename $0`
 
 dfilename=/var/tmp/$bname.$$
 
@@ -85,6 +85,6 @@ if [[ ${outarray[0]} != 1 || ${outarray[
 	exit 1
 fi
 
-/usr/bin/rm -f $dfilename
+/bin/rm -f $dfilename
 exit 0
 

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.egid.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.egid.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.egid.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -43,7 +43,7 @@ if [ $# != 1 ]; then
 fi
 
 dtrace=$1
-bname=`/bin/basename $0`
+bname=`/usr/bin/basename $0`
 dfilename=/var/tmp/$bname.$$.d
 
 ## Create .d file
@@ -70,14 +70,14 @@ EOF
 #chmod 555 the .d file
 
 chmod 555 $dfilename >/dev/null 2>&1
-if [ &? -ne 0 ]; then
+if [ $? -ne 0 ]; then
 	print -u2 "chmod $dfilename failed"
 	exit 1
 fi
 
 #Get the groupid of the calling process using ps
 
-groupid=`ps -o pid,gid | grep "$$ " | awk '{print $2}' 2>/dev/null`
+groupid=`ps -o pid,pgid | grep "$$ " | awk '{print $2}' 2>/dev/null`
 if [ $? -ne 0 ]; then
 	print -u2 "unable to get uid of the current process with pid = $$"
 	exit 1
@@ -93,5 +93,5 @@ fi
 
 #Cleanup leftovers
 
-/usr/bin/rm -f $dfilename
+/bin/rm -f $dfilename
 exit 0

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.euid.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.euid.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.euid.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -82,5 +82,5 @@ if [ $? -ne 0 ]; then
 	exit 1
 fi
 
-#/usr/bin/rm -f $dfilename
+#/bin/rm -f $dfilename
 exit 0

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.gid.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.gid.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.gid.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -82,5 +82,5 @@ if [ $? -ne 0 ]; then
 	exit 1
 fi
 
-#/usr/bin/rm -f $dfilename
+#/bin/rm -f $dfilename
 exit 0

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.ppid.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.ppid.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.ppid.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -82,5 +82,5 @@ if [ $? -ne 0 ]; then
 	exit 1
 fi
 
-#/usr/bin/rm -f $dfilename
+#/bin/rm -f $dfilename
 exit 0

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.projid.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.projid.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.projid.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -82,5 +82,5 @@ if [ $? -ne 0 ]; then
 	exit 1
 fi
 
-#/usr/bin/rm -f $dfilename
+#/bin/rm -f $dfilename
 exit 0

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.sid.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.sid.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.sid.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -82,5 +82,5 @@ if [ $? -ne 0 ]; then
 	exit 1
 fi
 
-#/usr/bin/rm -f $dfilename
+#/bin/rm -f $dfilename
 exit 0

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.stringmacro.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.stringmacro.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.stringmacro.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -74,5 +74,5 @@ if [ "$output" != "this is test" ]; then
 	exit 1
 fi
 
-/usr/bin/rm -f $dfilename
+/bin/rm -f $dfilename
 exit 0

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.taskid.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.taskid.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.taskid.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -82,5 +82,5 @@ if [ $? -ne 0 ]; then
 	exit 1
 fi
 
-#/usr/bin/rm -f $dfilename
+#/bin/rm -f $dfilename
 exit 0

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.uid.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.uid.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scripting/tst.uid.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -82,5 +82,5 @@ if [ $? -ne 0 ]; then
 	exit 1
 fi
 
-#/usr/bin/rm -f $dfilename
+#/bin/rm -f $dfilename
 exit 0

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.c
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.c	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sdt/tst.sdtargs.c	Sat Aug 21 11:04:38 2010	(r211545)
@@ -27,11 +27,16 @@
 #pragma ident	"%Z%%M%	%I%	%E% SMI"
 
 #include 
+#ifndef __FreeBSD__
 #include 
+#endif
 
 int
 main(int argc, char **argv)
 {
+#ifdef __FreeBSD__
+	return (1);
+#else
 	while (1) {
 		if (uadmin(A_SDTTEST, 0, 0) < 0) {
 			perror("uadmin");
@@ -42,4 +47,5 @@ main(int argc, char **argv)
 	}
 
 	return (0);
+#endif
 }

Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/Makefile	Sat Aug 21 11:04:38 2010	(r211545)
@@ -0,0 +1,13 @@
+all: main
+
+main: main.o prov.o
+	$(CC) -o main main.o prov.o
+
+main.o: main.c prov.h
+	$(CC) -c main.c
+
+prov.h: prov.d
+	/usr/sbin/dtrace -h -s prov.d
+
+prov.o: prov.d main.o
+	/usr/sbin/dtrace -G -32 -s prov.d main.o

Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/main.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/main.c	Sat Aug 21 11:04:38 2010	(r211545)
@@ -0,0 +1,11 @@
+#include 
+#include 
+#include "prov.h"
+
+int
+main(int argc, char **argv, char **envp)
+{
+	envp[0] = (char*)0xff;
+	TESTER_ENTRY();
+	return 0;
+}

Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/prov.d
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/prov.d	Sat Aug 21 11:04:38 2010	(r211545)
@@ -0,0 +1,3 @@
+provider tester {
+	probe entry();
+};

Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/prov.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/prov.h	Sat Aug 21 11:04:38 2010	(r211545)
@@ -0,0 +1,46 @@
+/*
+ * Generated by dtrace(1M).
+ */
+
+#ifndef	_PROV_H
+#define	_PROV_H
+
+#include 
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+#if _DTRACE_VERSION
+
+#define	TESTER_ENTRY() \
+	__dtrace_tester___entry()
+#ifndef	__sparc
+#define	TESTER_ENTRY_ENABLED() \
+	__dtraceenabled_tester___entry()
+#else
+#define	TESTER_ENTRY_ENABLED() \
+	__dtraceenabled_tester___entry(0)
+#endif
+
+
+extern void __dtrace_tester___entry(void);
+#ifndef	__sparc
+extern int __dtraceenabled_tester___entry(void);
+#else
+extern int __dtraceenabled_tester___entry(long);
+#endif
+
+#else
+
+#define	TESTER_ENTRY()
+#define	TESTER_ENTRY_ENABLED() (0)
+
+#endif
+
+
+#ifdef	__cplusplus
+}
+#endif
+
+#endif	/* _PROV_H */

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.badguess.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.badguess.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.badguess.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -79,6 +79,6 @@ if [ $? -eq 0 ]; then
 fi
 
 cd /
-/usr/bin/rm -rf $DIR
+/bin/rm -rf $DIR
 
 exit 0

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose1.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose1.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose1.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -125,7 +125,7 @@ main(int argc, char **argv)
 }
 EOF
 
-/usr/ccs/bin/make > /dev/null
+/usr/bin/make > /dev/null
 if [ $? -ne 0 ]; then
 	print -u2 "failed to build"
 	exit 1
@@ -154,6 +154,6 @@ script 2>&1
 status=$?
 
 cd /
-/usr/bin/rm -rf $DIR
+/bin/rm -rf $DIR
 
 exit $status

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose2.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose2.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose2.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -136,7 +136,7 @@ main(int argc, char **argv)
 }
 EOF
 
-/usr/ccs/bin/make > /dev/null
+/usr/bin/make > /dev/null
 if [ $? -ne 0 ]; then
 	print -u2 "failed to build"
 	exit 1
@@ -155,6 +155,6 @@ script
 status=$?
 
 cd /
-/usr/bin/rm -rf $DIR
+/bin/rm -rf $DIR
 
 exit $status

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose3.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose3.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.dlclose3.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -131,7 +131,7 @@ main(int argc, char **argv)
 }
 EOF
 
-/usr/ccs/bin/make > /dev/null
+/usr/bin/make > /dev/null
 if [ $? -ne 0 ]; then
 	print -u2 "failed to build"
 	exit 1
@@ -165,6 +165,6 @@ script
 status=$?
 
 cd /
-/usr/bin/rm -rf $DIR
+/bin/rm -rf $DIR
 
 exit $status

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.eliminate.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.eliminate.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.eliminate.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -101,6 +101,6 @@ if [ $? -eq 0 ]; then
 fi
 
 cd /
-/usr/bin/rm -rf $DIR
+/bin/rm -rf $DIR
 
 exit 0

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -91,6 +91,6 @@ script
 status=$?
 
 cd /
-/usr/bin/rm -rf $DIR
+/bin/rm -rf $DIR
 
 exit $status

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.enabled2.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -108,6 +108,6 @@ script
 status=$?
 
 cd /
-/usr/bin/rm -rf $DIR
+/bin/rm -rf $DIR
 
 exit $status

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.entryreturn.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.entryreturn.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.entryreturn.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -113,6 +113,6 @@ script | cut -c5-
 status=$?
 
 cd /
-/usr/bin/rm -rf $DIR
+/bin/rm -rf $DIR
 
 exit $status

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.fork.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.fork.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.fork.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -100,6 +100,6 @@ script
 status=$?
 
 cd /
-/usr/bin/rm -rf $DIR
+/bin/rm -rf $DIR
 
 exit $status

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.guess32.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.guess32.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.guess32.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -91,6 +91,6 @@ script
 status=$?
 
 cd /
-/usr/bin/rm -rf $DIR
+/bin/rm -rf $DIR
 
 exit $status

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.guess64.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.guess64.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.guess64.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -95,6 +95,6 @@ else
 fi
 
 cd /
-/usr/bin/rm -rf $DIR
+/bin/rm -rf $DIR
 
 exit $status

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.header.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.header.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.header.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -82,4 +82,4 @@ if [ $? -ne 0 ]; then
 fi
 
 cd /
-/usr/bin/rm -rf $DIR
+/bin/rm -rf $DIR

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.include.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.include.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.include.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -56,6 +56,6 @@ fi
 status=$?
 
 cd /
-/usr/bin/rm -rf $DIR
+/bin/rm -rf $DIR
 
 exit $status

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.linkpriv.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.linkpriv.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.linkpriv.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -79,4 +79,4 @@ if [ $? -ne 0 ]; then
 fi
 
 cd /
-/usr/bin/rm -rf $DIR
+/bin/rm -rf $DIR

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.linkunpriv.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.linkunpriv.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.linkunpriv.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -81,4 +81,4 @@ if [ $? -ne 0 ]; then
 fi
 
 cd /
-/usr/bin/rm -rf $DIR
+/bin/rm -rf $DIR

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiple.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiple.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.multiple.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -94,6 +94,6 @@ script
 status=$?
 
 cd /
-/usr/bin/rm -rf $DIR
+/bin/rm -rf $DIR
 
 exit $status

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.nodtrace.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.nodtrace.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.nodtrace.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -85,6 +85,6 @@ fi
 status=$?
 
 cd /
-/usr/bin/rm -rf $DIR
+/bin/rm -rf $DIR
 
 exit $status

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.onlyenabled.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.onlyenabled.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.onlyenabled.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -79,4 +79,4 @@ if [ $? -ne 0 ]; then
 fi
 
 cd /
-/usr/bin/rm -rf $DIR
+/bin/rm -rf $DIR

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.reeval.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.reeval.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.reeval.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -93,6 +93,6 @@ script
 status=$?
 
 cd /
-/usr/bin/rm -rf $DIR
+/bin/rm -rf $DIR
 
 exit $status

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.static.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.static.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.static.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -93,6 +93,6 @@ script
 status=$?
 
 cd /
-/usr/bin/rm -rf $DIR
+/bin/rm -rf $DIR
 
 exit $status

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.static2.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.static2.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.static2.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -103,6 +103,6 @@ script
 status=$?
 
 cd /
-/usr/bin/rm -rf $DIR
+/bin/rm -rf $DIR
 
 exit $status

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.user.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.user.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.user.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -91,6 +91,6 @@ script
 status=$?
 
 cd /
-/usr/bin/rm -rf $DIR
+/bin/rm -rf $DIR
 
 exit $status

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.ucaller.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.ucaller.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/vars/tst.ucaller.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -38,7 +38,7 @@ fi
 
 dtrace=$1
 
-$dtrace -qs /dev/stdin -c "/usr/bin/echo" <calloc = 1;

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/usdt/tst.tailcall.ksh
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/usdt/tst.tailcall.ksh	Sat Aug 21 11:02:54 2010	(r211544)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/sparc/usdt/tst.tailcall.ksh	Sat Aug 21 11:04:38 2010	(r211545)
@@ -76,7 +76,7 @@ provider test {
 };
 EOF
 

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 11:06:21 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A266A106566B;
	Sat, 21 Aug 2010 11:06:21 +0000 (UTC)
	(envelope-from bschmidt@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 93D7D8FC18;
	Sat, 21 Aug 2010 11:06:21 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LB6LDK066903;
	Sat, 21 Aug 2010 11:06:21 GMT
	(envelope-from bschmidt@svn.freebsd.org)
Received: (from bschmidt@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LB6LIK066901;
	Sat, 21 Aug 2010 11:06:21 GMT
	(envelope-from bschmidt@svn.freebsd.org)
Message-Id: <201008211106.o7LB6LIK066901@svn.freebsd.org>
From: Bernhard Schmidt 
Date: Sat, 21 Aug 2010 11:06: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: r211546 - 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: Sat, 21 Aug 2010 11:06:21 -0000

Author: bschmidt
Date: Sat Aug 21 11:06:21 2010
New Revision: 211546
URL: http://svn.freebsd.org/changeset/base/211546

Log:
  Wrap remaining ieee80211_ratectl_node_init() calls missed in r211314.
  
  MFC after:	1 week

Modified:
  head/sys/net80211/ieee80211_node.c

Modified: head/sys/net80211/ieee80211_node.c
==============================================================================
--- head/sys/net80211/ieee80211_node.c	Sat Aug 21 11:04:38 2010	(r211545)
+++ head/sys/net80211/ieee80211_node.c	Sat Aug 21 11:06:21 2010	(r211546)
@@ -1404,7 +1404,8 @@ ieee80211_fakeup_adhoc_node(struct ieee8
 #endif
 		}
 		ieee80211_node_setuptxparms(ni);
-		ieee80211_ratectl_node_init(ni);
+		if (vap->iv_caps & IEEE80211_C_RATECTL)
+			ieee80211_ratectl_node_init(ni);
 		if (ic->ic_newassoc != NULL)
 			ic->ic_newassoc(ni, 1);
 		/* XXX not right for 802.1x/WPA */
@@ -1474,7 +1475,8 @@ ieee80211_add_neighbor(struct ieee80211v
 		if (ieee80211_iserp_rateset(&ni->ni_rates))
 			ni->ni_flags |= IEEE80211_NODE_ERP;
 		ieee80211_node_setuptxparms(ni);
-		ieee80211_ratectl_node_init(ni);
+		if (vap->iv_caps & IEEE80211_C_RATECTL)
+			ieee80211_ratectl_node_init(ni);
 		if (ic->ic_newassoc != NULL)
 			ic->ic_newassoc(ni, 1);
 		/* XXX not right for 802.1x/WPA */
@@ -2343,7 +2345,8 @@ ieee80211_node_join(struct ieee80211_nod
 	);
 
 	ieee80211_node_setuptxparms(ni);
-	ieee80211_ratectl_node_init(ni);
+	if (vap->iv_caps & IEEE80211_C_RATECTL)
+		ieee80211_ratectl_node_init(ni);
 	/* give driver a chance to setup state like ni_txrate */
 	if (ic->ic_newassoc != NULL)
 		ic->ic_newassoc(ni, newassoc);

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 11:09:03 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7BDFF10656A3;
	Sat, 21 Aug 2010 11:09:03 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 6DACC8FC08;
	Sat, 21 Aug 2010 11:09:03 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LB93mV066997;
	Sat, 21 Aug 2010 11:09:03 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LB93uQ066995;
	Sat, 21 Aug 2010 11:09:03 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201008211109.o7LB93uQ066995@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Aug 2010 11:09: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: r211547 - head/cddl/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: Sat, 21 Aug 2010 11:09:03 -0000

Author: rpaulo
Date: Sat Aug 21 11:09:03 2010
New Revision: 211547
URL: http://svn.freebsd.org/changeset/base/211547

Log:
  The DTrace instrumentation object is going to be i386/amd64 only.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/cddl/lib/Makefile

Modified: head/cddl/lib/Makefile
==============================================================================
--- head/cddl/lib/Makefile	Sat Aug 21 11:06:21 2010	(r211546)
+++ head/cddl/lib/Makefile	Sat Aug 21 11:09:03 2010	(r211547)
@@ -2,7 +2,7 @@
 
 .include 
 
-SUBDIR=	drti \
+SUBDIR=	${_drti} \
 	libavl \
 	libctf \
 	${_libdtrace} \
@@ -20,6 +20,7 @@ _libzpool=	libzpool
 .endif
 
 .if ${MACHINE_ARCH} == amd64 || ${MACHINE_ARCH} == i386
+_drti=		drti
 _libdtrace=	libdtrace
 .endif
 

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 11:10:58 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id F13E91065673;
	Sat, 21 Aug 2010 11:10:58 +0000 (UTC)
	(envelope-from andre@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E21618FC0A;
	Sat, 21 Aug 2010 11:10:58 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LBAwnf067077;
	Sat, 21 Aug 2010 11:10:58 GMT (envelope-from andre@svn.freebsd.org)
Received: (from andre@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LBAw7H067075;
	Sat, 21 Aug 2010 11:10:58 GMT (envelope-from andre@svn.freebsd.org)
Message-Id: <201008211110.o7LBAw7H067075@svn.freebsd.org>
From: Andre Oppermann 
Date: Sat, 21 Aug 2010 11:10: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: r211548 - 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: Sat, 21 Aug 2010 11:10:59 -0000

Author: andre
Date: Sat Aug 21 11:10:58 2010
New Revision: 211548
URL: http://svn.freebsd.org/changeset/base/211548

Log:
  MFC r211317:
  
    Reset the internal tso flag in tcp_output() on every iteration
    of sendalot.

Modified:
  stable/8/sys/netinet/tcp_output.c

Modified: stable/8/sys/netinet/tcp_output.c
==============================================================================
--- stable/8/sys/netinet/tcp_output.c	Sat Aug 21 11:09:03 2010	(r211547)
+++ stable/8/sys/netinet/tcp_output.c	Sat Aug 21 11:10:58 2010	(r211548)
@@ -153,7 +153,7 @@ tcp_output(struct tcpcb *tp)
 	int idle, sendalot;
 	int sack_rxmit, sack_bytes_rxmt;
 	struct sackhole *p;
-	int tso = 0;
+	int tso;
 	struct tcpopt to;
 #if 0
 	int maxburst = TCP_MAXBURST;
@@ -211,6 +211,7 @@ again:
 	    SEQ_LT(tp->snd_nxt, tp->snd_max))
 		tcp_sack_adjust(tp);
 	sendalot = 0;
+	tso = 0;
 	off = tp->snd_nxt - tp->snd_una;
 	sendwin = min(tp->snd_wnd, tp->snd_cwnd);
 	sendwin = min(sendwin, tp->snd_bwnd);
@@ -490,9 +491,9 @@ after_sack_rexmit:
 		} else {
 			len = tp->t_maxseg;
 			sendalot = 1;
-			tso = 0;
 		}
 	}
+
 	if (sack_rxmit) {
 		if (SEQ_LT(p->rxmit + len, tp->snd_una + so->so_snd.sb_cc))
 			flags &= ~TH_FIN;
@@ -1051,6 +1052,8 @@ send:
 	 * XXX: Fixme: This is currently not the case for IPv6.
 	 */
 	if (tso) {
+		KASSERT(len > tp->t_maxopd - optlen,
+		    ("%s: len <= tso_segsz", __func__));
 		m->m_pkthdr.csum_flags |= CSUM_TSO;
 		m->m_pkthdr.tso_segsz = tp->t_maxopd - optlen;
 	}

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 11:11:33 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 49B9E106564A;
	Sat, 21 Aug 2010 11:11:33 +0000 (UTC)
	(envelope-from andre@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3A9FA8FC1C;
	Sat, 21 Aug 2010 11:11:33 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LBBXDx067140;
	Sat, 21 Aug 2010 11:11:33 GMT (envelope-from andre@svn.freebsd.org)
Received: (from andre@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LBBXpJ067138;
	Sat, 21 Aug 2010 11:11:33 GMT (envelope-from andre@svn.freebsd.org)
Message-Id: <201008211111.o7LBBXpJ067138@svn.freebsd.org>
From: Andre Oppermann 
Date: Sat, 21 Aug 2010 11:11:33 +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: r211549 - stable/7/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, 21 Aug 2010 11:11:33 -0000

Author: andre
Date: Sat Aug 21 11:11:32 2010
New Revision: 211549
URL: http://svn.freebsd.org/changeset/base/211549

Log:
  MFC r211317:
  
    Reset the internal tso flag in tcp_output() on every iteration
    of sendalot.

Modified:
  stable/7/sys/netinet/tcp_output.c

Modified: stable/7/sys/netinet/tcp_output.c
==============================================================================
--- stable/7/sys/netinet/tcp_output.c	Sat Aug 21 11:10:58 2010	(r211548)
+++ stable/7/sys/netinet/tcp_output.c	Sat Aug 21 11:11:32 2010	(r211549)
@@ -140,7 +140,7 @@ tcp_output(struct tcpcb *tp)
 	int idle, sendalot;
 	int sack_rxmit, sack_bytes_rxmt;
 	struct sackhole *p;
-	int tso = 0;
+	int tso;
 	struct tcpopt to;
 #if 0
 	int maxburst = TCP_MAXBURST;
@@ -198,6 +198,7 @@ again:
 	    SEQ_LT(tp->snd_nxt, tp->snd_max))
 		tcp_sack_adjust(tp);
 	sendalot = 0;
+	tso = 0;
 	off = tp->snd_nxt - tp->snd_una;
 	sendwin = min(tp->snd_wnd, tp->snd_cwnd);
 	sendwin = min(sendwin, tp->snd_bwnd);
@@ -477,9 +478,9 @@ after_sack_rexmit:
 		} else {
 			len = tp->t_maxseg;
 			sendalot = 1;
-			tso = 0;
 		}
 	}
+
 	if (sack_rxmit) {
 		if (SEQ_LT(p->rxmit + len, tp->snd_una + so->so_snd.sb_cc))
 			flags &= ~TH_FIN;
@@ -995,6 +996,8 @@ send:
 	 * XXX: Fixme: This is currently not the case for IPv6.
 	 */
 	if (tso) {
+		KASSERT(len > tp->t_maxopd - optlen,
+		    ("%s: len <= tso_segsz", __func__));
 		m->m_pkthdr.csum_flags |= CSUM_TSO;
 		m->m_pkthdr.tso_segsz = tp->t_maxopd - optlen;
 	}

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 11:14:50 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 92C87106566B;
	Sat, 21 Aug 2010 11:14:50 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 8479E8FC0C;
	Sat, 21 Aug 2010 11:14:50 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LBEoHC067235;
	Sat, 21 Aug 2010 11:14:50 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LBEo9a067233;
	Sat, 21 Aug 2010 11:14:50 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201008211114.o7LBEo9a067233@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Aug 2010 11:14: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: r211550 - head/cddl/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: Sat, 21 Aug 2010 11:14:50 -0000

Author: rpaulo
Date: Sat Aug 21 11:14:50 2010
New Revision: 211550
URL: http://svn.freebsd.org/changeset/base/211550

Log:
  Use double quotes when checking the value of MACHINE_ARCH.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/cddl/lib/Makefile

Modified: head/cddl/lib/Makefile
==============================================================================
--- head/cddl/lib/Makefile	Sat Aug 21 11:11:32 2010	(r211549)
+++ head/cddl/lib/Makefile	Sat Aug 21 11:14:50 2010	(r211550)
@@ -19,7 +19,7 @@ _libzpool=	libzpool
 .endif
 .endif
 
-.if ${MACHINE_ARCH} == amd64 || ${MACHINE_ARCH} == i386
+.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
 _drti=		drti
 _libdtrace=	libdtrace
 .endif

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 11:32:54 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B73BD1065696;
	Sat, 21 Aug 2010 11:32:54 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id A74C38FC14;
	Sat, 21 Aug 2010 11:32:54 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LBWslF067618;
	Sat, 21 Aug 2010 11:32:54 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LBWsX0067616;
	Sat, 21 Aug 2010 11:32:54 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201008211132.o7LBWsX0067616@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Aug 2010 11:32:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-vendor@freebsd.org
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r211551 - in vendor/dtracetoolkit: . dist
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 11:32:54 -0000

Author: rpaulo
Date: Sat Aug 21 11:32:54 2010
New Revision: 211551
URL: http://svn.freebsd.org/changeset/base/211551

Log:
  Import dtruss from Brendan Gregg's DTraceToolkit.
  
  Sponsored by:	The FreeBSD Foundation

Added:
  vendor/dtracetoolkit/
  vendor/dtracetoolkit/dist/
  vendor/dtracetoolkit/dist/dtruss   (contents, props changed)

Added: vendor/dtracetoolkit/dist/dtruss
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/dtracetoolkit/dist/dtruss	Sat Aug 21 11:32:54 2010	(r211551)
@@ -0,0 +1,467 @@
+#!/usr/bin/sh
+#
+# dtruss - print process system call time details.
+#          Written using DTrace (Solaris 10 3/05).
+#
+# $Id: dtruss 9 2007-08-07 10:21:07Z brendan $
+#
+# USAGE: dtruss [-acdeflhoLs] [-t syscall] { -p PID | -n name | command }
+#
+#		-p PID		# examine this PID
+#		-n name		# examine this process name
+#		-t syscall	# examine this syscall only
+#		-a		# print all details
+#		-c		# print system call counts
+#		-d		# print relative timestamps (us)
+#		-e		# print elapsed times (us)
+#		-f		# follow children as they are forked
+#		-l		# force printing of pid/lwpid per line
+#		-o		# print on cpu times (us)
+#		-s		# print stack backtraces
+#		-L		# don't print pid/lwpid per line
+#		-b bufsize	# dynamic variable buf size (default is "4m")
+#  eg,
+#		dtruss df -h	# run and examine the "df -h" command
+#		dtruss -p 1871	# examine PID 1871
+#		dtruss -n tar	# examine all processes called "tar"
+#		dtruss -f test.sh	# run test.sh and follow children
+#
+# See the man page dtruss(1M) for further details.
+#
+# SEE ALSO: procsystime    # DTraceToolkit
+#           dapptrace      # DTraceToolkit
+#           truss
+#
+# COPYRIGHT: Copyright (c) 2005, 2006, 2007 Brendan Gregg.
+#
+# CDDL HEADER START
+#
+#  The contents of this file are subject to the terms of the
+#  Common Development and Distribution License, Version 1.0 only
+#  (the "License").  You may not use this file except in compliance
+#  with the License.
+#
+#  You can obtain a copy of the license at Docs/cddl1.txt
+#  or http://www.opensolaris.org/os/licensing.
+#  See the License for the specific language governing permissions
+#  and limitations under the License.
+#
+# CDDL HEADER END
+#
+# TODO: Track signals, more output formatting.
+#
+# 29-Apr-2005   Brendan Gregg   Created this.
+# 09-May-2005      "      " 	Fixed evaltime (thanks Adam L.)
+# 16-May-2005	   "      "	Added -t syscall tracing.
+# 17-Jun-2005	   "      "	Added -s stack backtraces.
+# 17-Jun-2005	   "      "	Last update.
+# 29-Jun-2007	   "      "	Used progenyof() (thanks Aaron Gutman).
+# 06-Aug-2007	   "      "	Various updates.
+#
+
+
+##############################
+# --- Process Arguments ---
+#
+
+### Default variables
+opt_pid=0; opt_name=0; pid=0; pname="."; opt_elapsed=0; opt_cpu=0
+opt_counts=0; opt_relative=0; opt_printid=0; opt_follow=0; opt_command=0
+command=""; opt_buf=0; buf="4m"; opt_trace=0; trace="."; opt_stack=0
+
+### Process options
+while getopts ab:cdefhln:op:st:L name
+do
+        case $name in
+	b)	opt_buf=1; buf=$OPTARG ;;
+        p)      opt_pid=1; pid=$OPTARG ;;
+        n)      opt_name=1; pname=$OPTARG ;;
+        t)      opt_trace=1; trace=$OPTARG ;;
+	a)	opt_counts=1; opt_relative=1; opt_elapsed=1; opt_follow=1
+		opt_printid=1; opt_cpu=1 ;;
+	c)	opt_counts=1 ;;
+	d)	opt_relative=1 ;;
+	e)	opt_elapsed=1 ;;
+	f)	opt_follow=1 ;;
+	l)	opt_printid=1 ;;
+	o)	opt_cpu=1 ;;
+	L)	opt_printid=-1 ;;
+	s)	opt_stack=-1 ;;
+        h|?)    cat <<-END >&2
+		USAGE: dtruss [-acdefholLs] [-t syscall] { -p PID | -n name | command }
+
+		          -p PID          # examine this PID
+		          -n name         # examine this process name
+		          -t syscall      # examine this syscall only
+		          -a              # print all details
+		          -c              # print syscall counts
+		          -d              # print relative times (us)
+		          -e              # print elapsed times (us)
+		          -f              # follow children (-p or cmd only)
+		          -l              # force printing pid/lwpid
+		          -o              # print on cpu times
+		          -s              # print stack backtraces
+		          -L              # don't print pid/lwpid
+		          -b bufsize      # dynamic variable buf size
+		   eg,
+		       dtruss df -h       # run and examine "df -h"
+		       dtruss -p 1871     # examine PID 1871
+		       dtruss -n tar      # examine all processes called "tar"
+		       dtruss -f test.sh  # run test.sh and follow children
+		END
+		exit 1
+        esac
+done
+shift `expr $OPTIND - 1`
+
+### Option logic
+if [ $opt_pid -eq 0 -a $opt_name -eq 0 ]; then
+	opt_command=1
+	if [ "$*" = "" ]; then
+		$0 -h
+		exit
+	fi
+	command="$*"	# yes, I meant $*!
+fi
+if [ $opt_follow -eq 1 -o $opt_name -eq 1 ]; then
+	if [ $opt_printid -ne -1 ]; then
+		opt_printid=1
+	else
+		opt_printid=0
+	fi
+fi
+if [ $opt_follow -eq 1 -a $opt_name -eq 1 ]; then
+	echo "ERROR: -f option cannot be used with -n (use -p or cmd instead)."
+	exit 1
+fi
+
+### Option translation
+if [ "$trace" = "exec" ]; then trace="exece"; fi
+if [ "$trace" = "time" ]; then trace="gtime"; fi
+if [ "$trace" = "exit" ]; then trace="rexit"; fi
+
+
+#################################
+# --- Main Program, DTrace ---
+#
+
+### Define D Script
+dtrace='
+#pragma D option quiet
+#pragma D option switchrate=10
+ 
+/*
+ * Command line arguments
+ */
+inline int OPT_command   = '$opt_command';
+inline int OPT_follow    = '$opt_follow';
+inline int OPT_printid   = '$opt_printid';
+inline int OPT_relative  = '$opt_relative';
+inline int OPT_elapsed   = '$opt_elapsed';
+inline int OPT_cpu       = '$opt_cpu';
+inline int OPT_counts    = '$opt_counts';
+inline int OPT_pid       = '$opt_pid';
+inline int OPT_name      = '$opt_name';
+inline int OPT_trace     = '$opt_trace';
+inline int OPT_stack     = '$opt_stack';
+inline string NAME       = "'$pname'";
+inline string TRACE      = "'$trace'";
+
+dtrace:::BEGIN 
+{
+	/* print header */
+	OPT_printid  ? printf("%-9s  ", "PID/LWP") : 1;
+	OPT_relative ? printf("%8s ", "RELATIVE") : 1;
+	OPT_elapsed  ? printf("%7s ", "ELAPSD") : 1;
+	OPT_cpu      ? printf("%6s ", "CPU") : 1;
+	printf("SYSCALL(args) \t\t = return\n");
+}
+
+/*
+ * Save syscall entry info
+ */
+syscall:::entry
+/((OPT_command || OPT_pid) && pid == $target) || 
+ (OPT_name && execname == NAME) ||
+ (OPT_follow && progenyof($target))/
+{
+	/* set start details */
+	self->start = timestamp;
+	self->vstart = vtimestamp;
+	self->arg0 = arg0;
+	self->arg1 = arg1;
+	self->arg2 = arg2;
+
+	/* count occurances */
+	OPT_counts == 1 ? @Counts[probefunc] = count() : 1;
+}
+
+/*
+ * Follow children
+ */
+syscall::fork*:return
+/(OPT_follow && progenyof($target)) && (!OPT_trace || (TRACE == probefunc))/
+{
+	/* print output */
+	self->code = errno == 0 ? "" : "Err#";
+	OPT_printid  ? printf("%6d/%d:  ", pid, tid) : 1;
+	OPT_relative ? printf("%8d:  ", vtimestamp/1000) : 1;
+	OPT_elapsed  ? printf("%7d:  ", 0) : 1;
+	OPT_cpu      ? printf("%6d ", 0) : 1;
+	printf("%s(0x%X, 0x%X, 0x%X)\t\t = %d %s%d\n", probefunc,
+	    self->arg0, self->arg1, self->arg2, (int)arg0, self->code,
+	    (int)errno);
+}
+
+/*
+ * Check for syscall tracing
+ */
+syscall:::entry
+/OPT_trace && probefunc != TRACE/
+{
+	/* drop info */
+	self->start = 0;
+	self->vstart = 0;
+	self->arg0 = 0;
+	self->arg1 = 0;
+	self->arg2 = 0;
+}
+
+/*
+ * Print return data
+ */
+
+/*
+ * The following code is written in an intentionally repetative way.
+ * The first versions had no code redundancies, but performed badly during
+ * benchmarking. The priority here is speed, not cleverness. I know there
+ * are many obvious shortcuts to this code, I have tried them. This style has
+ * shown in benchmarks to be the fastest (fewest probes fired, fewest actions).
+ */
+
+/* print 3 args, return as hex */
+syscall::lwp_sigmask:return
+/self->start/
+{
+	/* calculate elapsed time */
+	this->elapsed = timestamp - self->start;
+	self->start = 0;
+	this->cpu = vtimestamp - self->vstart;
+	self->vstart = 0;
+	self->code = errno == 0 ? "" : "Err#";
+ 
+	/* print optional fields */
+	OPT_printid  ? printf("%6d/%d:  ", pid, tid) : 1;
+	OPT_relative ? printf("%8d ", vtimestamp/1000) : 1;
+	OPT_elapsed  ? printf("%7d ", this->elapsed/1000) : 1;
+	OPT_cpu ? printf("%6d ", this->cpu/1000) : 1;
+ 
+	/* print main data */
+	printf("%s(0x%X, 0x%X, 0x%X)\t\t = 0x%X %s%d\n", probefunc,
+	    (int)self->arg0, self->arg1, self->arg2, (int)arg0,
+	    self->code, (int)errno);
+	OPT_stack ? ustack()    : 1;
+	OPT_stack ? trace("\n") : 1;
+	self->arg0 = 0;
+	self->arg1 = 0;
+	self->arg2 = 0;
+}
+
+/* print 3 args, arg0 as a string */
+syscall::stat*:return, 
+syscall::lstat*:return, 
+syscall::open*:return,
+syscall::resolvepath:return
+/self->start/
+{
+	/* calculate elapsed time */
+	this->elapsed = timestamp - self->start;
+	self->start = 0;
+	this->cpu = vtimestamp - self->vstart;
+	self->vstart = 0;
+	self->code = errno == 0 ? "" : "Err#";
+ 
+	/* print optional fields */
+	OPT_printid  ? printf("%6d/%d:  ", pid, tid) : 1;
+	OPT_relative ? printf("%8d ", vtimestamp/1000) : 1;
+	OPT_elapsed  ? printf("%7d ", this->elapsed/1000) : 1;
+	OPT_cpu      ? printf("%6d ", this->cpu/1000) : 1;
+ 
+	/* print main data */
+	printf("%s(\"%S\", 0x%X, 0x%X)\t\t = %d %s%d\n", probefunc,
+	    copyinstr(self->arg0), self->arg1, self->arg2, (int)arg0,
+	    self->code, (int)errno);
+	OPT_stack ? ustack()    : 1;
+	OPT_stack ? trace("\n") : 1;
+	self->arg0 = 0;
+	self->arg1 = 0;
+	self->arg2 = 0;
+}
+
+/* print 3 args, arg1 as a string */
+syscall::write:return,
+syscall::pwrite:return,
+syscall::*read*:return
+/self->start/
+{
+	/* calculate elapsed time */
+	this->elapsed = timestamp - self->start;
+	self->start = 0;
+	this->cpu = vtimestamp - self->vstart;
+	self->vstart = 0;
+	self->code = errno == 0 ? "" : "Err#";
+ 
+	/* print optional fields */
+	OPT_printid  ? printf("%6d/%d:  ", pid, tid) : 1;
+	OPT_relative ? printf("%8d ", vtimestamp/1000) : 1;
+	OPT_elapsed  ? printf("%7d ", this->elapsed/1000) : 1;
+	OPT_cpu      ? printf("%6d ", this->cpu/1000) : 1;
+ 
+	/* print main data */
+	printf("%s(0x%X, \"%S\", 0x%X)\t\t = %d %s%d\n", probefunc, self->arg0,
+	    stringof(copyin(self->arg1, self->arg2)), self->arg2, (int)arg0,
+	    self->code, (int)errno);
+	OPT_stack ? ustack()    : 1;
+	OPT_stack ? trace("\n") : 1;
+	self->arg0 = 0;
+	self->arg1 = 0;
+	self->arg2 = 0;
+}
+
+/* print 0 arg output */
+syscall::gtime:return,
+syscall::*fork*:return
+/self->start/
+{
+	/* calculate elapsed time */
+	this->elapsed = timestamp - self->start;
+	self->start = 0;
+	this->cpu = vtimestamp - self->vstart;
+	self->vstart = 0;
+	self->code = errno == 0 ? "" : "Err#";
+ 
+	/* print optional fields */
+	OPT_printid  ? printf("%6d/%d:  ", pid, tid) : 1;
+	OPT_relative ? printf("%8d ", vtimestamp/1000) : 1;
+	OPT_elapsed  ? printf("%7d ", this->elapsed/1000) : 1;
+	OPT_cpu      ? printf("%6d ", this->cpu/1000) : 1;
+ 
+	/* print main data */
+	printf("%s()\t\t = %d %s%d\n", probefunc,
+	    (int)arg0, self->code, (int)errno);
+	OPT_stack ? ustack()    : 1;
+	OPT_stack ? trace("\n") : 1;
+	self->arg0 = 0;
+	self->arg1 = 0;
+	self->arg2 = 0;
+}
+
+/* print 1 arg output */
+syscall::brk:return,
+syscall::times:return,
+syscall::stime:return,
+syscall::close:return
+/self->start/
+{
+	/* calculate elapsed time */
+	this->elapsed = timestamp - self->start;
+	self->start = 0;
+	this->cpu = vtimestamp - self->vstart;
+	self->vstart = 0;
+	self->code = errno == 0 ? "" : "Err#";
+ 
+	/* print optional fields */
+	OPT_printid  ? printf("%6d/%d:  ", pid, tid) : 1;
+	OPT_relative ? printf("%8d ", vtimestamp/1000) : 1;
+	OPT_elapsed  ? printf("%7d ", this->elapsed/1000) : 1;
+	OPT_cpu      ? printf("%6d ", this->cpu/1000) : 1;
+ 
+	/* print main data */
+	printf("%s(0x%X)\t\t = %d %s%d\n", probefunc, self->arg0,
+	    (int)arg0, self->code, (int)errno);
+	OPT_stack ? ustack()    : 1;
+	OPT_stack ? trace("\n") : 1;
+	self->arg0 = 0;
+	self->arg1 = 0;
+	self->arg2 = 0;
+}
+
+/* print 2 arg output */
+syscall::utime:return,
+syscall::munmap:return
+/self->start/
+{
+	/* calculate elapsed time */
+	this->elapsed = timestamp - self->start;
+	self->start = 0;
+	this->cpu = vtimestamp - self->vstart;
+	self->vstart = 0;
+	self->code = errno == 0 ? "" : "Err#";
+ 
+	/* print optional fields */
+	OPT_printid  ? printf("%6d/%d:  ", pid, tid) : 1;
+	OPT_relative ? printf("%8d ", vtimestamp/1000) : 1;
+	OPT_elapsed  ? printf("%7d ", this->elapsed/1000) : 1;
+	OPT_cpu      ? printf("%6d ", this->cpu/1000) : 1;
+ 
+	/* print main data */
+	printf("%s(0x%X, 0x%X)\t\t = %d %s%d\n", probefunc, self->arg0,
+	    self->arg1, (int)arg0, self->code, (int)errno);
+	OPT_stack ? ustack()    : 1;
+	OPT_stack ? trace("\n") : 1;
+	self->arg0 = 0;
+	self->arg1 = 0;
+	self->arg2 = 0;
+}
+
+/* print 3 arg output - default */
+syscall:::return
+/self->start/
+{
+	/* calculate elapsed time */
+	this->elapsed = timestamp - self->start;
+	self->start = 0;
+	this->cpu = vtimestamp - self->vstart;
+	self->vstart = 0;
+	self->code = errno == 0 ? "" : "Err#";
+ 
+	/* print optional fields */
+	OPT_printid  ? printf("%6d/%d:  ", pid, tid) : 1;
+	OPT_relative ? printf("%8d ", vtimestamp/1000) : 1;
+	OPT_elapsed  ? printf("%7d ", this->elapsed/1000) : 1;
+	OPT_cpu      ? printf("%6d ", this->cpu/1000) : 1;
+ 
+	/* print main data */
+	printf("%s(0x%X, 0x%X, 0x%X)\t\t = %d %s%d\n", probefunc, self->arg0,
+	    self->arg1, self->arg2, (int)arg0, self->code, (int)errno);
+	OPT_stack ? ustack()    : 1;
+	OPT_stack ? trace("\n") : 1;
+	self->arg0 = 0;
+	self->arg1 = 0;
+	self->arg2 = 0;
+}
+
+/* program exited */
+proc:::exit
+/(OPT_command || OPT_pid) && pid == $target/
+{
+	exit(0);
+}
+
+/* print counts */
+dtrace:::END
+{
+	OPT_counts == 1 ? printf("\n%-32s %16s\n", "CALL", "COUNT") : 1;
+	OPT_counts == 1 ? printa("%-32s %@16d\n", @Counts) : 1;
+}
+'
+
+### Run DTrace
+if [ $opt_command -eq 1 ]; then
+	/usr/sbin/dtrace -x dynvarsize=$buf -x evaltime=exec -n "$dtrace" \
+	    -c "$command" >&2
+elif [ $opt_pid -eq 1 ]; then
+	/usr/sbin/dtrace -x dynvarsize=$buf -n "$dtrace" -p "$pid" >&2
+else
+	/usr/sbin/dtrace -x dynvarsize=$buf -n "$dtrace" >&2
+fi

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 11:33:50 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 677561065693;
	Sat, 21 Aug 2010 11:33:50 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 3E69C8FC08;
	Sat, 21 Aug 2010 11:33:50 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LBXoVO067686;
	Sat, 21 Aug 2010 11:33:50 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LBXoLD067685;
	Sat, 21 Aug 2010 11:33:50 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201008211133.o7LBXoLD067685@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Aug 2010 11:33:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-vendor@freebsd.org
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r211552 - vendor/dtracetoolkit/0.99
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 11:33:50 -0000

Author: rpaulo
Date: Sat Aug 21 11:33:49 2010
New Revision: 211552
URL: http://svn.freebsd.org/changeset/base/211552

Log:
  Tag the latest DTraceToolkit import.
  
  Sponsored by:	The FreeBSD Foundation

Added:
  vendor/dtracetoolkit/0.99/
     - copied from r211551, vendor/dtracetoolkit/dist/

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 11:35:08 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5FBA510656A8;
	Sat, 21 Aug 2010 11:35:08 +0000 (UTC) (envelope-from bz@FreeBSD.org)
Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3])
	by mx1.freebsd.org (Postfix) with ESMTP id 1B6308FC1D;
	Sat, 21 Aug 2010 11:35:08 +0000 (UTC)
Received: from localhost (amavis.fra.cksoft.de [192.168.74.71])
	by mail.cksoft.de (Postfix) with ESMTP id 6F8CF41C749;
	Sat, 21 Aug 2010 13:35:07 +0200 (CEST)
X-Virus-Scanned: amavisd-new at cksoft.de
Received: from mail.cksoft.de ([192.168.74.103])
	by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new,
	port 10024)
	with ESMTP id qTNyuN+PpnNN; Sat, 21 Aug 2010 13:35:06 +0200 (CEST)
Received: by mail.cksoft.de (Postfix, from userid 66)
	id 0D19A41C752; Sat, 21 Aug 2010 13:35:06 +0200 (CEST)
Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net
	[10.111.66.10])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mail.int.zabbadoz.net (Postfix) with ESMTP id AA19D4448F3;
	Sat, 21 Aug 2010 11:33:55 +0000 (UTC)
Date: Sat, 21 Aug 2010 11:33:55 +0000 (UTC)
From: "Bjoern A. Zeeb" 
X-X-Sender: bz@maildrop.int.zabbadoz.net
To: Andre Oppermann 
In-Reply-To: <201008211110.o7LBAw7H067075@svn.freebsd.org>
Message-ID: <20100821113326.P48418@maildrop.int.zabbadoz.net>
References: <201008211110.o7LBAw7H067075@svn.freebsd.org>
X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
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: r211548 - 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: Sat, 21 Aug 2010 11:35:08 -0000

On Sat, 21 Aug 2010, Andre Oppermann wrote:

> Author: andre
> Date: Sat Aug 21 11:10:58 2010
> New Revision: 211548
> URL: http://svn.freebsd.org/changeset/base/211548
>
> Log:
>  MFC r211317:
>
>    Reset the internal tso flag in tcp_output() on every iteration
>    of sendalot.
>
> Modified:
>  stable/8/sys/netinet/tcp_output.c

Would you my recording the merge-info for all of those?

/bz

-- 
Bjoern A. Zeeb                       This signature is about you not me.

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 11:41:32 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 68D8910656A4;
	Sat, 21 Aug 2010 11:41:32 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5A16E8FC17;
	Sat, 21 Aug 2010 11:41:32 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LBfWE6067925;
	Sat, 21 Aug 2010 11:41:32 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LBfWdv067923;
	Sat, 21 Aug 2010 11:41:32 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201008211141.o7LBfWdv067923@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Aug 2010 11:41: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: r211553 - head/sys/cddl/compat/opensolaris/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, 21 Aug 2010 11:41:32 -0000

Author: rpaulo
Date: Sat Aug 21 11:41:32 2010
New Revision: 211553
URL: http://svn.freebsd.org/changeset/base/211553

Log:
  Add sysname to struct opensolaris_utsname. This is needed by one DTrace
  test.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/cddl/compat/opensolaris/kern/opensolaris_misc.c

Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_misc.c
==============================================================================
--- head/sys/cddl/compat/opensolaris/kern/opensolaris_misc.c	Sat Aug 21 11:33:49 2010	(r211552)
+++ head/sys/cddl/compat/opensolaris/kern/opensolaris_misc.c	Sat Aug 21 11:41:32 2010	(r211553)
@@ -38,7 +38,8 @@ __FBSDID("$FreeBSD$");
 char hw_serial[11] = "0";
 
 struct opensolaris_utsname utsname = {
-	.nodename = "unset"
+	.nodename = "unset",
+	.sysname  = "SunOS"
 };
 
 int

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 11:50:54 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E1654106566C;
	Sat, 21 Aug 2010 11:50:53 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id CF3338FC17;
	Sat, 21 Aug 2010 11:50:53 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LBorpo068165;
	Sat, 21 Aug 2010 11:50:53 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LBorx5068156;
	Sat, 21 Aug 2010 11:50:53 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201008211150.o7LBorx5068156@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Aug 2010 11:50: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: r211554 - in head/cddl: contrib/opensolaris/cmd/dtrace
	contrib/opensolaris/lib/libdtrace/common
	contrib/opensolaris/lib/libdtrace/i386 lib/libdtrace
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 11:50:54 -0000

Author: rpaulo
Date: Sat Aug 21 11:50:53 2010
New Revision: 211554
URL: http://svn.freebsd.org/changeset/base/211554

Log:
  Add libdtrace support for tracing userland programs.
  
  Summary of changes:
  * Implement a compatibility shim between Solaris libproc and our
  libproc and remove several ifdefs because of this.
  * Port the drti to FreeBSD.
  * Implement the missing DOODAD sections
  * Link with libproc and librtld_db
  * Support for ustack, jstack and uregs (by sson@)
  * Misc bugfixing
  
  When writing the SUWN_dof section, we had to resort to building the ELF
  file layout by "hand". This is the job of libelf, but our libelf doesn't
  support this yet. When libelf is fixed, we can remove the code under
  #ifdef BROKEN_LIBELF.
  
  Sponsored by:	The FreeBSD Foundation

Added:
  head/cddl/lib/libdtrace/libproc_compat.h   (contents, props changed)
  head/cddl/lib/libdtrace/regs_x86.d   (contents, props changed)
Modified:
  head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pid.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_proc.h
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c
  head/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h
  head/cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.c
  head/cddl/lib/libdtrace/Makefile

Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c	Sat Aug 21 11:41:32 2010	(r211553)
+++ head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c	Sat Aug 21 11:50:53 2010	(r211554)
@@ -773,19 +773,27 @@ compile_str(dtrace_cmd_t *dcp)
 static void
 prochandler(struct ps_prochandle *P, const char *msg, void *arg)
 {
-fatal("DOODAD in function %s, file %s, line %d\n",__FUNCTION__,__FILE__,__LINE__);
-#ifdef DOODAD
+#if defined(sun)
 	const psinfo_t *prp = Ppsinfo(P);
 	int pid = Pstatus(P)->pr_pid;
 	char name[SIG2STR_MAX];
+#else
+	int wstatus = proc_getwstat(P);
+	int pid = proc_getpid(P);
+#endif
 
 	if (msg != NULL) {
 		notice("pid %d: %s\n", pid, msg);
 		return;
 	}
 
+#if defined(sun)
 	switch (Pstate(P)) {
+#else
+	switch (proc_state(P)) {
+#endif
 	case PS_UNDEAD:
+#if defined(sun)
 		/*
 		 * Ideally we would like to always report pr_wstat here, but it
 		 * isn't possible given current /proc semantics.  If we grabbed
@@ -798,9 +806,20 @@ fatal("DOODAD in function %s, file %s, l
 			notice("pid %d terminated by %s\n", pid,
 			    proc_signame(WTERMSIG(prp->pr_wstat),
 			    name, sizeof (name)));
+#else
+		if (WIFSIGNALED(wstatus)) {
+			notice("pid %d terminated by %d\n", pid,
+			    WTERMSIG(wstatus));
+#endif
+#if defined(sun)
 		} else if (prp != NULL && WEXITSTATUS(prp->pr_wstat) != 0) {
 			notice("pid %d exited with status %d\n",
 			    pid, WEXITSTATUS(prp->pr_wstat));
+#else
+		} else if (WEXITSTATUS(wstatus) != 0) {
+			notice("pid %d exited with status %d\n",
+			    pid, WEXITSTATUS(wstatus));
+#endif
 		} else {
 			notice("pid %d has exited\n", pid);
 		}
@@ -812,7 +831,6 @@ fatal("DOODAD in function %s, file %s, l
 		g_pslive--;
 		break;
 	}
-#endif
 }
 
 /*ARGSUSED*/

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c	Sat Aug 21 11:41:32 2010	(r211553)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/drti.c	Sat Aug 21 11:50:53 2010	(r211554)
@@ -34,6 +34,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 /*
  * In Solaris 10 GA, the only mechanism for communicating helper information
@@ -53,12 +55,16 @@
  */
 
 static const char *devnamep = "/dev/dtrace/helper";
+#if defined(sun)
 static const char *olddevname = "/devices/pseudo/dtrace@0:helper";
+#endif
 
 static const char *modname;	/* Name of this load object */
 static int gen;			/* DOF helper generation */
+#if defined(sun)
 extern dof_hdr_t __SUNW_dof;	/* DOF defined in the .SUNW_dof section */
-static boolean_t dof_init_debug = B_FALSE;	/* From DTRACE_DOF_INIT_DEBUG */
+#endif
+static boolean_t dof_init_debug = B_TRUE;	/* From DTRACE_DOF_INIT_DEBUG */
 
 static void
 dprintf(int debug, const char *fmt, ...)
@@ -83,6 +89,36 @@ dprintf(int debug, const char *fmt, ...)
 	va_end(ap);
 }
 
+#if !defined(sun)
+static void
+fixsymbol(Elf *e, Elf_Data *data, size_t idx, int nprobes, char *buf,
+    dof_sec_t *sec, int *fixedprobes, char *dofstrtab)
+{
+	GElf_Sym sym;
+	char *s;
+	unsigned char *funcname;
+	dof_probe_t *prb;
+	int j = 0;
+	int ndx;
+
+	while (gelf_getsym(data, j++, &sym) != NULL) {
+		prb = (dof_probe_t *)(buf + sec->dofs_offset);
+
+		for (ndx = nprobes; ndx; ndx--, prb += 1) {
+			funcname = dofstrtab + prb->dofpr_func;
+			s = elf_strptr(e, idx, sym.st_name);
+			if (strcmp(s, funcname) == 0) {
+				dprintf(1, "fixing %s() symbol\n", s);
+				prb->dofpr_addr = sym.st_value;
+				(*fixedprobes)++;
+			}
+		}
+		if (*fixedprobes == nprobes)
+			break;
+	}
+}
+#endif
+
 #if defined(sun)
 #pragma init(dtrace_dof_init)
 #else
@@ -92,22 +128,39 @@ static void dtrace_dof_init(void) __attr
 static void
 dtrace_dof_init(void)
 {
+#if defined(sun)
 	dof_hdr_t *dof = &__SUNW_dof;
+#else
+	dof_hdr_t *dof = NULL;
+#endif
 #ifdef _LP64
 	Elf64_Ehdr *elf;
 #else
 	Elf32_Ehdr *elf;
 #endif
 	dof_helper_t dh;
-#if defined(sun)
 	Link_map *lmp;
+#if defined(sun)
 	Lmid_t lmid;
 #else
-	struct link_map *lmp;
 	u_long lmid = 0;
+	dof_sec_t *sec;
+	size_t i;
 #endif
 	int fd;
 	const char *p;
+#if !defined(sun)
+	Elf *e;
+	Elf_Scn *scn = NULL;
+	Elf_Data *symtabdata = NULL, *dynsymdata = NULL;
+	GElf_Shdr shdr;
+	int efd, nprobes;
+	char *s;
+	size_t shstridx, symtabidx = 0, dynsymidx = 0;
+	unsigned char *dofstrtab = NULL;
+	unsigned char *buf;
+	int fixedprobes = 0;
+#endif
 
 	if (getenv("DTRACE_DOF_INIT_DISABLE") != NULL)
 		return;
@@ -127,10 +180,46 @@ dtrace_dof_init(void)
 	}
 #endif
 
+
 	if ((modname = strrchr(lmp->l_name, '/')) == NULL)
 		modname = lmp->l_name;
 	else
 		modname++;
+#if !defined(sun)
+	elf_version(EV_CURRENT);
+	if ((efd = open(lmp->l_name, O_RDONLY, 0)) < 0) {
+		dprintf(1, "couldn't open file for reading\n");
+		return;
+	}
+	if ((e = elf_begin(efd, ELF_C_READ, NULL)) == NULL) {
+		dprintf(1, "elf_begin failed\n");
+		close(efd);
+		return;
+	}
+	elf_getshdrstrndx(e, &shstridx);
+	dof = NULL;
+	while ((scn = elf_nextscn(e, scn)) != NULL) {
+		gelf_getshdr(scn, &shdr);
+		if (shdr.sh_type == SHT_SYMTAB) {
+			symtabidx = shdr.sh_link;
+			symtabdata = elf_getdata(scn, NULL);
+		} else if (shdr.sh_type == SHT_DYNSYM) {
+			dynsymidx = shdr.sh_link;
+			dynsymdata = elf_getdata(scn, NULL);
+		} else if (shdr.sh_type == SHT_PROGBITS) {
+			s = elf_strptr(e, shstridx, shdr.sh_name);
+			if  (s && strcmp(s, ".SUNW_dof") == 0) {
+				dof = elf_getdata(scn, NULL)->d_buf;
+			}
+		}
+	}
+	if (dof == NULL) {
+		dprintf(1, "SUNW_dof section not found\n");
+		elf_end(e);
+		close(efd);
+		return;
+	}
+#endif
 
 	if (dof->dofh_ident[DOF_ID_MAG0] != DOF_MAG_MAG0 ||
 	    dof->dofh_ident[DOF_ID_MAG1] != DOF_MAG_MAG1 ||
@@ -158,7 +247,7 @@ dtrace_dof_init(void)
 
 	if ((fd = open64(devnamep, O_RDWR)) < 0) {
 		dprintf(1, "failed to open helper device %s", devnamep);
-
+#if defined(sun)
 		/*
 		 * If the device path wasn't explicitly set, try again with
 		 * the old device path.
@@ -172,14 +261,79 @@ dtrace_dof_init(void)
 			dprintf(1, "failed to open helper device %s", devnamep);
 			return;
 		}
+#else
+		return;
+#endif
 	}
-
+#if !defined(sun)
+	/*
+	 * We need to fix the base address of each probe since this wasn't
+	 * done by ld(1). (ld(1) needs to grow support for parsing the
+	 * SUNW_dof section).
+	 *
+	 * The complexity of this is not that great. The first for loop
+	 * iterates over the sections inside the DOF file. There are usually
+	 * 10 sections here. We asume the STRTAB section comes first and the
+	 * PROBES section comes after. Since we are only interested in fixing
+	 * data inside the PROBES section we quit the for loop after processing
+	 * the PROBES section. It's usually the case that the first section
+	 * is the STRTAB section and the second section is the PROBES section,
+	 * so this for loop is not meaningful when doing complexity analysis.
+	 *
+	 * After finding the probes section, we iterate over the symbols
+	 * in the symtab section. When we find a symbol name that matches
+	 * the probe function name, we fix it. If we have fixed all the
+	 * probes, we exit all the loops and we are done.
+	 * The number of probes is given by the variable 'nprobes' and this
+	 * depends entirely on the user, but some optimizations were done.
+	 *
+	 * We are assuming the number of probes is less than the number of
+	 * symbols (libc can have 4k symbols, for example).
+	 */
+	sec = (dof_sec_t *)(dof + 1);
+	buf = (char *)dof;
+	for (i = 0; i < dof->dofh_secnum; i++, sec++) {
+		if (sec->dofs_type == DOF_SECT_STRTAB)
+			dofstrtab = (unsigned char *)(buf + sec->dofs_offset);
+		else if (sec->dofs_type == DOF_SECT_PROBES && dofstrtab)
+			break;
+	
+	}
+	nprobes = sec->dofs_size / sec->dofs_entsize;
+	fixsymbol(e, symtabdata, symtabidx, nprobes, buf, sec, &fixedprobes,
+	    dofstrtab);
+	if (fixedprobes != nprobes) {
+		/*
+		 * If we haven't fixed all the probes using the
+		 * symtab section, look inside the dynsym
+		 * section.
+		 */
+		fixsymbol(e, dynsymdata, dynsymidx, nprobes, buf, sec,
+		    &fixedprobes, dofstrtab);
+	}
+	if (fixedprobes != nprobes) {
+		fprintf(stderr, "WARNING: number of probes "
+		    "fixed does not match the number of "
+		    "defined probes (%d != %d, "
+		    "respectively)\n", fixedprobes, nprobes);
+		fprintf(stderr, "WARNING: some probes might "
+		    "not fire or your program might crash\n");
+	}
+#endif
 	if ((gen = ioctl(fd, DTRACEHIOC_ADDDOF, &dh)) == -1)
 		dprintf(1, "DTrace ioctl failed for DOF at %p", dof);
-	else
+	else {
 		dprintf(1, "DTrace ioctl succeeded for DOF at %p\n", dof);
+#if !defined(sun)
+		gen = dh.gen;
+#endif
+	}
 
 	(void) close(fd);
+#if !defined(sun)
+	elf_end(e);
+	(void) close(efd);
+#endif
 }
 
 #if defined(sun)
@@ -198,7 +352,7 @@ dtrace_dof_fini(void)
 		return;
 	}
 
-	if ((gen = ioctl(fd, DTRACEHIOC_REMOVE, gen)) == -1)
+	if ((gen = ioctl(fd, DTRACEHIOC_REMOVE, &gen)) == -1)
 		dprintf(1, "DTrace ioctl failed to remove DOF (%d)\n", gen);
 	else
 		dprintf(1, "DTrace ioctl removed DOF (%d)\n", gen);

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c	Sat Aug 21 11:41:32 2010	(r211553)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_aggregate.c	Sat Aug 21 11:50:53 2010	(r211554)
@@ -36,6 +36,7 @@
 #include 
 #else
 #include 
+#include 
 #endif
 #include 
 
@@ -264,11 +265,7 @@ dt_aggregate_usym(dtrace_hdl_t *dtp, uin
 
 	dt_proc_lock(dtp, P);
 
-#if defined(sun)
 	if (Plookup_by_addr(P, *pc, NULL, 0, &sym) == 0)
-#else
-	if (proc_addr2sym(P, *pc, NULL, 0, &sym) == 0)
-#endif
 		*pc = sym.st_value;
 
 	dt_proc_unlock(dtp, P);
@@ -291,11 +288,7 @@ dt_aggregate_umod(dtrace_hdl_t *dtp, uin
 
 	dt_proc_lock(dtp, P);
 
-#if defined(sun)
 	if ((map = Paddr_to_map(P, *pc)) != NULL)
-#else
-	if ((map = proc_addr2map(P, *pc)) != NULL)
-#endif
 		*pc = map->pr_vaddr;
 
 	dt_proc_unlock(dtp, P);

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c	Sat Aug 21 11:41:32 2010	(r211553)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c	Sat Aug 21 11:50:53 2010	(r211554)
@@ -34,6 +34,9 @@
 #include 
 #endif
 #include 
+#if !defined(sun)
+#include 
+#endif
 
 #define	DT_MASK_LO 0x00000000FFFFFFFFULL
 
@@ -952,17 +955,9 @@ dt_print_ustack(dtrace_hdl_t *dtp, FILE 
 		if ((err = dt_printf(dtp, fp, "%*s", indent, "")) < 0)
 			break;
 
-#if defined(sun)
 		if (P != NULL && Plookup_by_addr(P, pc[i],
-#else
-		if (P != NULL && proc_addr2sym(P, pc[i],
-#endif
 		    name, sizeof (name), &sym) == 0) {
-#if defined(sun)
 			(void) Pobjname(P, pc[i], objname, sizeof (objname));
-#else
-			(void) proc_objname(P, pc[i], objname, sizeof (objname));
-#endif
 
 			if (pc[i] > sym.st_value) {
 				(void) snprintf(c, sizeof (c),
@@ -973,12 +968,8 @@ dt_print_ustack(dtrace_hdl_t *dtp, FILE 
 				    "%s`%s", dt_basename(objname), name);
 			}
 		} else if (str != NULL && str[0] != '\0' && str[0] != '@' &&
-#if defined(sun)
 		    (P != NULL && ((map = Paddr_to_map(P, pc[i])) == NULL ||
 		    (map->pr_mflags & MA_WRITE)))) {
-#else
-		    (P != NULL && ((map = proc_addr2map(P, pc[i])) == NULL))) {
-#endif
 			/*
 			 * If the current string pointer in the string table
 			 * does not point to an empty string _and_ the program
@@ -994,11 +985,7 @@ dt_print_ustack(dtrace_hdl_t *dtp, FILE 
 			 */
 			(void) snprintf(c, sizeof (c), "%s", str);
 		} else {
-#if defined(sun)
 			if (P != NULL && Pobjname(P, pc[i], objname,
-#else
-			if (P != NULL && proc_objname(P, pc[i], objname,
-#endif
 			    sizeof (objname)) != 0) {
 				(void) snprintf(c, sizeof (c), "%s`0x%llx",
 				    dt_basename(objname), (u_longlong_t)pc[i]);
@@ -1068,11 +1055,7 @@ dt_print_usym(dtrace_hdl_t *dtp, FILE *f
 
 			dt_proc_lock(dtp, P);
 
-#if defined(sun)
 			if (Plookup_by_addr(P, pc, NULL, 0, &sym) == 0)
-#else
-			if (proc_addr2sym(P, pc, NULL, 0, &sym) == 0)
-#endif
 				pc = sym.st_value;
 
 			dt_proc_unlock(dtp, P);
@@ -1115,11 +1098,7 @@ dt_print_umod(dtrace_hdl_t *dtp, FILE *f
 	if (P != NULL)
 		dt_proc_lock(dtp, P); /* lock handle while we perform lookups */
 
-#if defined(sun)
 	if (P != NULL && Pobjname(P, pc, objname, sizeof (objname)) != 0) {
-#else
-	if (P != NULL && proc_objname(P, pc, objname, sizeof (objname)) != 0) {
-#endif
 		(void) snprintf(c, sizeof (c), "%s", dt_basename(objname));
 	} else {
 		(void) snprintf(c, sizeof (c), "0x%llx", (u_longlong_t)pc);

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c	Sat Aug 21 11:41:32 2010	(r211553)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c	Sat Aug 21 11:50:53 2010	(r211554)
@@ -51,6 +51,9 @@
 #include 
 #else
 #include 
+#include 
+#include 
+#include 
 #endif
 #include 
 #include 
@@ -412,7 +415,6 @@ prepare_elf64(dtrace_hdl_t *dtp, const d
 		s = &dofs[dofrh->dofr_tgtsec];
 
 		for (j = 0; j < nrel; j++) {
-printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__);
 #ifdef DOODAD
 #if defined(__arm__)
 /* XXX */
@@ -1519,14 +1521,29 @@ process_obj(dtrace_hdl_t *dtp, const cha
 
 			off = rela.r_offset - fsym.st_value;
 			if (dt_modtext(dtp, data_tgt->d_buf, eprobe,
-			    &rela, &off) != 0) {
+			    &rela, &off) != 0)
 				goto err;
-			}
 
 			if (dt_probe_define(pvp, prp, s, r, off, eprobe) != 0) {
 				return (dt_link_error(dtp, elf, fd, bufs,
 				    "failed to allocate space for probe"));
 			}
+#if !defined(sun)
+			/*
+			 * Our linker doesn't understand the SUNW_IGNORE ndx and
+			 * will try to use this relocation when we build the
+			 * final executable. Since we are done processing this
+			 * relocation, mark it as inexistant and let libelf
+			 * remove it from the file.
+			 * If this wasn't done, we would have garbage added to
+			 * the executable file as the symbol is going to be
+			 * change from UND to ABS.
+			 */
+			rela.r_offset = 0;
+			rela.r_info  = 0;
+			rela.r_addend = 0;
+			(void) gelf_update_rela(data_rel, i, &rela);
+#endif
 
 			mod = 1;
 			(void) elf_flagdata(data_tgt, ELF_C_SET, ELF_F_DIRTY);
@@ -1538,13 +1555,13 @@ process_obj(dtrace_hdl_t *dtp, const cha
 			 * already been processed by an earlier link
 			 * invocation.
 			 */
-printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__);
-#ifdef DOODAD
+#if !defined(sun)
+#define SHN_SUNW_IGNORE	SHN_ABS
+#endif
 			if (rsym.st_shndx != SHN_SUNW_IGNORE) {
 				rsym.st_shndx = SHN_SUNW_IGNORE;
 				(void) gelf_update_sym(data_sym, ndx, &rsym);
 			}
-#endif
 		}
 	}
 
@@ -1554,6 +1571,9 @@ printf("%s:%s(%d): DOODAD\n",__FUNCTION_
 	(void) elf_end(elf);
 	(void) close(fd);
 
+#if !defined(sun)
+	if (nsym > 0)
+#endif
 	while ((pair = bufs) != NULL) {
 		bufs = pair->dlp_next;
 		dt_free(dtp, pair->dlp_str);
@@ -1574,6 +1594,19 @@ dtrace_program_link(dtrace_hdl_t *dtp, d
 {
 #if !defined(sun)
 	char tfile[PATH_MAX];
+	Elf *e;
+	Elf_Scn *scn;
+	Elf_Data *data;
+	GElf_Shdr shdr;
+	int efd;
+	size_t stridx;
+	unsigned char *buf;
+	char *s;
+	int loc;
+	GElf_Ehdr ehdr;
+	Elf_Scn *scn0;
+	GElf_Shdr shdr0;
+	uint64_t off, rc;
 #endif
 	char drti[PATH_MAX];
 	dof_hdr_t *dof;
@@ -1697,12 +1730,17 @@ dtrace_program_link(dtrace_hdl_t *dtp, d
 		(void) unlink(file);
 #endif
 
+#if defined(sun)
 	if (dtp->dt_oflags & DTRACE_O_LP64)
 		status = dump_elf64(dtp, dof, fd);
 	else
 		status = dump_elf32(dtp, dof, fd);
 
 	if (status != 0 || lseek(fd, 0, SEEK_SET) != 0) {
+#else
+	/* We don't write the ELF header, just the DOF section */
+	if (dt_write(dtp, fd, dof, dof->dofh_filesz) < dof->dofh_filesz) {
+#endif
 		return (dt_link_error(dtp, NULL, -1, NULL,
 		    "failed to write %s: %s", file, strerror(errno)));
 	}
@@ -1726,7 +1764,7 @@ dtrace_program_link(dtrace_hdl_t *dtp, d
 
 		(void) snprintf(cmd, len, fmt, dtp->dt_ld_path, file, fd, drti);
 #else
-		const char *fmt = "%s -o %s -r %s %s";
+		const char *fmt = "%s -o %s -r %s";
 
 #if defined(__amd64__)
 		/*
@@ -1748,11 +1786,14 @@ dtrace_program_link(dtrace_hdl_t *dtp, d
 		len = snprintf(&tmp, 1, fmt, dtp->dt_ld_path, file, tfile,
 		    drti) + 1;
 
+#if !defined(sun)
+		len *= 2;
+#endif
 		cmd = alloca(len);
 
-		(void) snprintf(cmd, len, fmt, dtp->dt_ld_path, file, tfile, drti);
+		(void) snprintf(cmd, len, fmt, dtp->dt_ld_path, file,
+		    drti);
 #endif
-
 		if ((status = system(cmd)) == -1) {
 			ret = dt_link_error(dtp, NULL, -1, NULL,
 			    "failed to run %s: %s", dtp->dt_ld_path,
@@ -1760,8 +1801,6 @@ dtrace_program_link(dtrace_hdl_t *dtp, d
 			goto done;
 		}
 
-		(void) close(fd); /* release temporary file */
-
 		if (WIFSIGNALED(status)) {
 			ret = dt_link_error(dtp, NULL, -1, NULL,
 			    "failed to link %s: %s failed due to signal %d",
@@ -1775,6 +1814,138 @@ dtrace_program_link(dtrace_hdl_t *dtp, d
 			    file, dtp->dt_ld_path, WEXITSTATUS(status));
 			goto done;
 		}
+#if !defined(sun)
+#define BROKEN_LIBELF
+		/*
+		 * FreeBSD's ld(1) is not instructed to interpret and add
+		 * correctly the SUNW_dof section present in tfile.
+		 * We use libelf to add this section manually and hope the next
+		 * ld invocation won't remove it.
+		 */
+		elf_version(EV_CURRENT);
+		if ((efd = open(file, O_RDWR, 0)) < 0) {
+			ret = dt_link_error(dtp, NULL, -1, NULL,
+			    "failed to open file %s: %s",
+			    file, strerror(errno));
+			goto done;
+		}
+		if ((e = elf_begin(efd, ELF_C_RDWR, NULL)) == NULL) {
+			close(efd);
+			ret = dt_link_error(dtp, NULL, -1, NULL,
+			    "failed to open elf file: %s",
+			    elf_errmsg(elf_errno()));
+			goto done;
+		}
+		/*
+		 * Add the string '.SUWN_dof' to the shstrtab section.
+		 */
+#ifdef BROKEN_LIBELF
+		elf_flagelf(e, ELF_C_SET, ELF_F_LAYOUT);
+#endif
+		elf_getshdrstrndx(e, &stridx);
+		scn = elf_getscn(e, stridx);
+		gelf_getshdr(scn, &shdr);
+		data = elf_newdata(scn);
+		data->d_off = shdr.sh_size;
+		data->d_buf = ".SUNW_dof";
+		data->d_size = 10;
+		data->d_type = ELF_T_BYTE;
+		loc = shdr.sh_size;
+		shdr.sh_size += data->d_size;
+		gelf_update_shdr(scn, &shdr);
+#ifdef BROKEN_LIBELF
+		off = shdr.sh_offset;
+		rc = shdr.sh_offset + shdr.sh_size;
+		gelf_getehdr(e, &ehdr);
+		if (ehdr.e_shoff > off) {
+			off = ehdr.e_shoff + ehdr.e_shnum * ehdr.e_shentsize;
+			rc = roundup(rc, 8);
+			ehdr.e_shoff = rc;
+			gelf_update_ehdr(e, &ehdr);
+			rc += ehdr.e_shnum * ehdr.e_shentsize;
+		}
+		for (;;) {
+			scn0 = NULL;
+			scn = NULL;
+			while ((scn = elf_nextscn(e, scn)) != NULL) {
+				gelf_getshdr(scn, &shdr);
+				if (shdr.sh_type == SHT_NOBITS ||
+				    shdr.sh_offset < off)
+					continue;
+				/* Find the immediately adjcent section. */
+				if (scn0 == NULL ||
+				    shdr.sh_offset < shdr0.sh_offset) {
+					scn0 = scn;
+					gelf_getshdr(scn0, &shdr0);
+				}
+			}
+			if (scn0 == NULL)
+				break;
+			/* Load section data to work around another bug */
+			elf_getdata(scn0, NULL);
+			/* Update section header, assure section alignment */
+			off = shdr0.sh_offset + shdr0.sh_size;
+			rc = roundup(rc, shdr0.sh_addralign);
+			shdr0.sh_offset = rc;
+			gelf_update_shdr(scn0, &shdr0);
+			rc += shdr0.sh_size;
+		}
+		if (elf_update(e, ELF_C_WRITE) < 0) {
+			ret = dt_link_error(dtp, NULL, -1, NULL,
+			    "failed to add append the shstrtab section: %s",
+			    elf_errmsg(elf_errno()));
+			elf_end(e);
+			close(efd);
+			goto done;
+		}
+		elf_end(e);
+		e = elf_begin(efd, ELF_C_RDWR, NULL);
+#endif
+		/*
+		 * Construct the .SUNW_dof section.
+		 */
+		scn = elf_newscn(e);
+		data = elf_newdata(scn);
+		buf = mmap(NULL, dof->dofh_filesz, PROT_READ, MAP_SHARED,
+		    fd, 0);
+		if (buf == MAP_FAILED) {
+			ret = dt_link_error(dtp, NULL, -1, NULL,
+			    "failed to mmap buffer %s", strerror(errno));
+			elf_end(e);
+			close(efd);
+			goto done;
+		}
+		data->d_buf = buf;
+		data->d_align = 4;
+		data->d_size = dof->dofh_filesz;
+		data->d_version = EV_CURRENT;
+		gelf_getshdr(scn, &shdr);
+		shdr.sh_name = loc;
+		shdr.sh_flags = SHF_ALLOC;
+		/*
+		 * Actually this should be SHT_SUNW_dof, but FreeBSD's ld(1)
+		 * will remove this 'unknown' section when we try to create an
+		 * executable using the object we are modifying, so we stop
+		 * playing by the rules and use SHT_PROGBITS.
+		 * Also, note that our drti has modifications to handle this.
+		 */
+		shdr.sh_type = SHT_PROGBITS;
+		shdr.sh_addralign = 4;
+		gelf_update_shdr(scn, &shdr);
+		if (elf_update(e, ELF_C_WRITE) < 0) {
+			ret = dt_link_error(dtp, NULL, -1, NULL,
+			    "failed to add the SUNW_dof section: %s",
+			    elf_errmsg(elf_errno()));
+			munmap(buf, dof->dofh_filesz);
+			elf_end(e);
+			close(efd);
+			goto done;
+		}
+		munmap(buf, dof->dofh_filesz);
+		elf_end(e);
+		close(efd);
+#endif
+		(void) close(fd); /* release temporary file */
 	} else {
 		(void) close(fd);
 	}

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c	Sat Aug 21 11:41:32 2010	(r211553)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c	Sat Aug 21 11:50:53 2010	(r211554)
@@ -283,10 +283,8 @@ static const dt_ident_t _dtrace_globals[
 	DT_VERS_1_5, &dt_idops_func, "string(int, void *)" },
 { "ipl", DT_IDENT_SCALAR, 0, DIF_VAR_IPL, DT_ATTR_STABCMN, DT_VERS_1_0,
 	&dt_idops_type, "uint_t" },
-#if defined(sun)
 { "jstack", DT_IDENT_ACTFUNC, 0, DT_ACT_JSTACK, DT_ATTR_STABCMN, DT_VERS_1_0,
 	&dt_idops_func, "stack(...)" },
-#endif
 { "lltostr", DT_IDENT_FUNC, 0, DIF_SUBR_LLTOSTR, DT_ATTR_STABCMN, DT_VERS_1_0,
 	&dt_idops_func, "string(int64_t)" },
 { "lquantize", DT_IDENT_AGGFUNC, 0, DTRACEAGG_LQUANTIZE,
@@ -465,8 +463,10 @@ static const dt_ident_t _dtrace_globals[
 #if defined(sun)
 { "uaddr", DT_IDENT_ACTFUNC, 0, DT_ACT_UADDR, DT_ATTR_STABCMN,
 	DT_VERS_1_2, &dt_idops_func, "_usymaddr(uintptr_t)" },
+#endif
 { "ucaller", DT_IDENT_SCALAR, 0, DIF_VAR_UCALLER, DT_ATTR_STABCMN,
 	DT_VERS_1_2, &dt_idops_type, "uint64_t" },
+#if defined(sun)
 { "ufunc", DT_IDENT_ACTFUNC, 0, DT_ACT_USYM, DT_ATTR_STABCMN,
 	DT_VERS_1_2, &dt_idops_func, "_usymaddr(uintptr_t)" },
 #endif
@@ -475,6 +475,7 @@ static const dt_ident_t _dtrace_globals[
 #if defined(sun)
 { "umod", DT_IDENT_ACTFUNC, 0, DT_ACT_UMOD, DT_ATTR_STABCMN,
 	DT_VERS_1_2, &dt_idops_func, "_usymaddr(uintptr_t)" },
+#endif
 { "uregs", DT_IDENT_ARRAY, 0, DIF_VAR_UREGS, DT_ATTR_STABCMN, DT_VERS_1_0,
 	&dt_idops_regs, NULL },
 { "ustack", DT_IDENT_ACTFUNC, 0, DT_ACT_USTACK, DT_ATTR_STABCMN, DT_VERS_1_0,
@@ -482,6 +483,7 @@ static const dt_ident_t _dtrace_globals[
 { "ustackdepth", DT_IDENT_SCALAR, 0, DIF_VAR_USTACKDEPTH,
 	DT_ATTR_STABCMN, DT_VERS_1_2,
 	&dt_idops_type, "uint32_t" },
+#if defined(sun)
 { "usym", DT_IDENT_ACTFUNC, 0, DT_ACT_USYM, DT_ATTR_STABCMN,
 	DT_VERS_1_2, &dt_idops_func, "_usymaddr(uintptr_t)" },
 #endif
@@ -760,9 +762,7 @@ int _dtrace_argmax = 32;	/* default maxi
 
 int _dtrace_debug = 0;		/* debug messages enabled (off) */
 const char *const _dtrace_version = DT_VERS_STRING; /* API version string */
-#if defined(sun)
 int _dtrace_rdvers = RD_VERSION; /* rtld_db feature version */
-#endif
 
 typedef struct dt_fdlist {
 	int *df_fds;		/* array of provider driver file descriptors */
@@ -780,12 +780,10 @@ _dtrace_init(void)
 {
 	_dtrace_debug = getenv("DTRACE_DEBUG") != NULL;
 
-#if defined(sun)
 	for (; _dtrace_rdvers > 0; _dtrace_rdvers--) {
 		if (rd_init(_dtrace_rdvers) == RD_OK)
 			break;
 	}
-#endif
 #if defined(__i386__)
 	/* make long doubles 64 bits -sson */
 	(void) fpsetprec(FP_PE);
@@ -1102,7 +1100,11 @@ alloc:
 
 	bzero(dtp, sizeof (dtrace_hdl_t));
 	dtp->dt_oflags = flags;
+#if defined(sun)
 	dtp->dt_prcmode = DT_PROC_STOP_PREINIT;
+#else
+	dtp->dt_prcmode = DT_PROC_STOP_POSTINIT;
+#endif
 	dtp->dt_linkmode = DT_LINK_KERNEL;
 	dtp->dt_linktype = DT_LTYP_ELF;
 	dtp->dt_xlatemode = DT_XL_STATIC;

Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pid.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pid.c	Sat Aug 21 11:41:32 2010	(r211553)
+++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pid.c	Sat Aug 21 11:50:53 2010	(r211554)
@@ -40,6 +40,9 @@
 #include 
 #include 
 #include 
+#if !defined(sun)
+#include 
+#endif
 
 typedef struct dt_pid_probe {
 	dtrace_hdl_t *dpp_dtp;
@@ -142,7 +145,6 @@ dt_pid_per_sym(dt_pid_probe_t *pp, const
 	    pp->dpp_obj);
 
 	if (!isdash && gmatch("return", pp->dpp_name)) {
-#ifdef DOODAD
 		if (dt_pid_create_return_probe(pp->dpp_pr, dtp, ftp, symp,
 		    pp->dpp_stret) < 0) {
 			return (dt_pid_error(dtp, pcb, dpr, ftp,
@@ -150,20 +152,17 @@ dt_pid_per_sym(dt_pid_probe_t *pp, const
 			    "for '%s': %s", func,
 			    dtrace_errmsg(dtp, dtrace_errno(dtp))));
 		}
-#endif
 
 		nmatches++;
 	}
 
 	if (!isdash && gmatch("entry", pp->dpp_name)) {
-#ifdef DOODAD
 		if (dt_pid_create_entry_probe(pp->dpp_pr, dtp, ftp, symp) < 0) {
 			return (dt_pid_error(dtp, pcb, dpr, ftp,
 			    D_PROC_CREATEFAIL, "failed to create entry probe "
 			    "for '%s': %s", func,
 			    dtrace_errmsg(dtp, dtrace_errno(dtp))));
 		}
-#endif
 
 		nmatches++;
 	}
@@ -182,10 +181,8 @@ dt_pid_per_sym(dt_pid_probe_t *pp, const
 			    (u_longlong_t)off, func));
 		}
 
-#ifdef DOODAD
 		err = dt_pid_create_offset_probe(pp->dpp_pr, pp->dpp_dtp, ftp,
 		    symp, off);
-#endif
 
 		if (err == DT_PROC_ERR) {
 			return (dt_pid_error(dtp, pcb, dpr, ftp,
@@ -203,7 +200,6 @@ dt_pid_per_sym(dt_pid_probe_t *pp, const
 		nmatches++;
 
 	} else if (glob && !isdash) {
-#ifdef DOODAD
 		if (dt_pid_create_glob_offset_probes(pp->dpp_pr,
 		    pp->dpp_dtp, ftp, symp, pp->dpp_name) < 0) {
 			return (dt_pid_error(dtp, pcb, dpr, ftp,
@@ -211,7 +207,6 @@ dt_pid_per_sym(dt_pid_probe_t *pp, const
 			    "failed to create offset probes in '%s': %s", func,
 			    dtrace_errmsg(dtp, dtrace_errno(dtp))));
 		}
-#endif
 
 		nmatches++;
 	}
@@ -279,7 +274,6 @@ dt_pid_per_mod(void *arg, const prmap_t 
 		pp->dpp_obj = obj;
 	else
 		pp->dpp_obj++;
-
 #if defined(sun)
 	if (Pxlookup_by_name(pp->dpp_pr, pp->dpp_lmid, obj, ".stret1", &sym,
 	    NULL) == 0)
@@ -305,25 +299,10 @@ dt_pid_per_mod(void *arg, const prmap_t 
 	else
 		pp->dpp_stret[3] = 0;
 #else
-	if (proc_name2sym(pp->dpp_pr, obj, ".stret1", &sym) == 0)
-		pp->dpp_stret[0] = sym.st_value;
-	else
-		pp->dpp_stret[0] = 0;
-
-	if (proc_name2sym(pp->dpp_pr, obj, ".stret2", &sym) == 0)
-		pp->dpp_stret[1] = sym.st_value;
-	else
-		pp->dpp_stret[1] = 0;
-
-	if (proc_name2sym(pp->dpp_pr, obj, ".stret4", &sym) == 0)
-		pp->dpp_stret[2] = sym.st_value;
-	else
-		pp->dpp_stret[2] = 0;
-
-	if (proc_name2sym(pp->dpp_pr, obj, ".stret8", &sym) == 0)
-		pp->dpp_stret[3] = sym.st_value;
-	else
-		pp->dpp_stret[3] = 0;
+	pp->dpp_stret[0] = 0;
+	pp->dpp_stret[1] = 0;
+	pp->dpp_stret[2] = 0;
+	pp->dpp_stret[3] = 0;
 #endif
 
 	dt_dprintf("%s stret %llx %llx %llx %llx\n", obj,
@@ -345,12 +324,8 @@ dt_pid_per_mod(void *arg, const prmap_t 
 		 * just fail silently in the hopes that some other object will
 		 * contain the desired symbol.
 		 */
-#if defined(sun)
 		if (Pxlookup_by_name(pp->dpp_pr, pp->dpp_lmid, obj,
 		    pp->dpp_func, &sym, NULL) != 0) {
-#else
-		if (proc_name2sym(pp->dpp_pr, obj, pp->dpp_func, &sym) != 0) {
-#endif
 			if (strcmp("-", pp->dpp_func) == 0) {
 				sym.st_name = 0;
 				sym.st_info =
@@ -390,16 +365,11 @@ dt_pid_per_mod(void *arg, const prmap_t 
 			return (0);
 #endif
 
-#if defined(sun)
 		(void) Plookup_by_addr(pp->dpp_pr, sym.st_value, pp->dpp_func,
-#else
-		(void) proc_addr2sym(pp->dpp_pr, sym.st_value, pp->dpp_func,
-#endif
 		    DTRACE_FUNCNAMELEN, &sym);
 
 		return (dt_pid_per_sym(pp, &sym, pp->dpp_func));
 	} else {
-#ifdef DOODAD
 		uint_t nmatches = pp->dpp_nmatches;
 
 		if (Psymbol_iter_by_addr(pp->dpp_pr, obj, PR_SYMTAB,
@@ -415,7 +385,6 @@ dt_pid_per_mod(void *arg, const prmap_t 
 			    BIND_ANY | TYPE_FUNC, dt_pid_sym_filt, pp) == 1)
 				return (1);
 		}
-#endif
 	}
 
 	return (0);
@@ -459,14 +428,16 @@ dt_pid_mod_filt(void *arg, const prmap_t
 static const prmap_t *
 dt_pid_fix_mod(dtrace_probedesc_t *pdp, struct ps_prochandle *P)
 {
-#ifdef DOODAD
 	char m[MAXPATHLEN];
+#if defined(sun)
 	Lmid_t lmid = PR_LMID_EVERY;
-	const char *obj;
+#else
+	Lmid_t lmid = 0;
 #endif
+	const char *obj;
 	const prmap_t *pmp;
 
-#ifdef DOODAD
+#if defined(sun)
 	/*
 	 * Pick apart the link map from the library name.
 	 */
@@ -487,10 +458,14 @@ dt_pid_fix_mod(dtrace_probedesc_t *pdp, 
 	} else {
 		obj = pdp->dtpd_mod;
 	}
+#else
+	obj = pdp->dtpd_mod;
+#endif
 
 	if ((pmp = Plmid_to_map(P, lmid, obj)) == NULL)
 		return (NULL);
 
+#if defined(sun)
 	(void) Pobjname(P, pmp->pr_vaddr, m, sizeof (m));
 	if ((obj = strrchr(m, '/')) == NULL)
 		obj = &m[0];
@@ -498,11 +473,9 @@ dt_pid_fix_mod(dtrace_probedesc_t *pdp, 
 		obj++;
 
 	(void) Plmid(P, pmp->pr_vaddr, &lmid);
+#endif
 
 	dt_pid_objname(pdp->dtpd_mod, sizeof (pdp->dtpd_mod), lmid, obj);
-#else
-pmp = NULL;
-#endif
 
 	return (pmp);
 }
@@ -544,13 +517,8 @@ dt_pid_create_pid_probes(dtrace_probedes
 			pp.dpp_mod = pdp->dtpd_mod;
 			(void) strcpy(pdp->dtpd_mod, "a.out");
 		} else if (strisglob(pp.dpp_mod) ||
-#if defined(sun)
 		    (aout = Pname_to_map(pp.dpp_pr, "a.out")) == NULL ||
 		    (pmp = Pname_to_map(pp.dpp_pr, pp.dpp_mod)) == NULL ||
-#else
-		    (aout = proc_name2map(pp.dpp_pr, "a.out")) == NULL ||
-		    (pmp = proc_name2map(pp.dpp_pr, pp.dpp_mod)) == NULL ||
-#endif
 		    aout->pr_vaddr != pmp->pr_vaddr) {
 			return (dt_pid_error(dtp, pcb, dpr, NULL, D_PROC_LIB,

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 11:58:08 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C30771065675;
	Sat, 21 Aug 2010 11:58:08 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 9980A8FC0C;
	Sat, 21 Aug 2010 11:58:08 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LBw8Av068351;
	Sat, 21 Aug 2010 11:58:08 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LBw8CY068349;
	Sat, 21 Aug 2010 11:58:08 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201008211158.o7LBw8CY068349@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Aug 2010 11:58: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: r211555 -
	head/sys/cddl/contrib/opensolaris/uts/common/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: Sat, 21 Aug 2010 11:58:08 -0000

Author: rpaulo
Date: Sat Aug 21 11:58:08 2010
New Revision: 211555
URL: http://svn.freebsd.org/changeset/base/211555

Log:
  Port the DTrace helper ioctls to FreeBSD and add a helper member to
  dof_helper_t (needed by drti.o).
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h

Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h	Sat Aug 21 11:50:53 2010	(r211554)
+++ head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h	Sat Aug 21 11:58:08 2010	(r211555)
@@ -1322,15 +1322,24 @@ typedef struct {
  * helpers and should no longer be used.  No other ioctls are valid on the
  * helper minor node.
  */
+#if defined(sun)
 #define	DTRACEHIOC		(('d' << 24) | ('t' << 16) | ('h' << 8))
 #define	DTRACEHIOC_ADD		(DTRACEHIOC | 1)	/* add helper */
 #define	DTRACEHIOC_REMOVE	(DTRACEHIOC | 2)	/* remove helper */
 #define	DTRACEHIOC_ADDDOF	(DTRACEHIOC | 3)	/* add helper DOF */
+#else
+#define	DTRACEHIOC_ADD		_IOWR('z', 1, dof_hdr_t)/* add helper */
+#define	DTRACEHIOC_REMOVE	_IOW('z', 2, int)	/* remove helper */
+#define	DTRACEHIOC_ADDDOF	_IOWR('z', 3, dof_helper_t)/* add helper DOF */
+#endif
 
 typedef struct dof_helper {
 	char dofhp_mod[DTRACE_MODNAMELEN];	/* executable or library name */
 	uint64_t dofhp_addr;			/* base address of object */
 	uint64_t dofhp_dof;			/* address of helper DOF */
+#if !defined(sun)
+	int gen;
+#endif
 } dof_helper_t;
 
 #define	DTRACEMNR_DTRACE	"dtrace"	/* node for DTrace ops */
@@ -2219,10 +2228,11 @@ extern void dtrace_vtime_enable(void);
 extern void dtrace_vtime_disable(void);
 
 struct regs;
+struct reg;
 
 #if defined(sun)
-extern int (*dtrace_pid_probe_ptr)(struct regs *);
-extern int (*dtrace_return_probe_ptr)(struct regs *);
+extern int (*dtrace_pid_probe_ptr)(struct reg *);
+extern int (*dtrace_return_probe_ptr)(struct reg *);
 extern void (*dtrace_fasttrap_fork_ptr)(proc_t *, proc_t *);
 extern void (*dtrace_fasttrap_exec_ptr)(proc_t *);
 extern void (*dtrace_fasttrap_exit_ptr)(proc_t *);

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 12:07:44 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id D074A1065695;
	Sat, 21 Aug 2010 12:07:44 +0000 (UTC)
	(envelope-from rpaulo@freebsd.org)
Received: from karen.lavabit.com (karen.lavabit.com [72.249.41.33])
	by mx1.freebsd.org (Postfix) with ESMTP id 535E38FC0C;
	Sat, 21 Aug 2010 12:07:44 +0000 (UTC)
Received: from d.earth.lavabit.com (d.earth.lavabit.com [192.168.111.13])
	by karen.lavabit.com (Postfix) with ESMTP id CBCD311B988;
	Sat, 21 Aug 2010 07:07:43 -0500 (CDT)
Received: from 10.0.10.3 (54.81.54.77.rev.vodafone.pt [77.54.81.54])
	by lavabit.com with ESMTP id 0W3PGIZP2RIU;
	Sat, 21 Aug 2010 07:07:43 -0500
Mime-Version: 1.0 (Apple Message framework v1081)
Content-Type: text/plain; charset=us-ascii
From: Rui Paulo 
In-Reply-To: <4C6DDB74.3090102@FreeBSD.org>
Date: Sat, 21 Aug 2010 13:07:39 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <7186318F-0921-41E5-9641-3D6B45E0623B@FreeBSD.org>
References: <201008191131.o7JBV4Yf002412@svn.freebsd.org>
	<4C6D18BE.2000905@fer.hr> <4C6D95A8.9070105@FreeBSD.org>
	<20100819213159.B48418@maildrop.int.zabbadoz.net>
	<4C6DDB74.3090102@FreeBSD.org>
To: Doug Barton 
X-Mailer: Apple Mail (2.1081)
Cc: svn-src-head@FreeBSD.org, Ana Kukec ,
	svn-src-all@FreeBSD.org, "Bjoern A. Zeeb" ,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r211501 - in head/sys: modules modules/send netinet
	netinet6 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: Sat, 21 Aug 2010 12:07:44 -0000

On 20 Aug 2010, at 02:33, Doug Barton wrote:

> On 08/19/2010 14:50, Bjoern A. Zeeb wrote:
>> On Thu, 19 Aug 2010, Doug Barton wrote:
>>=20
>>> On 08/19/2010 04:42, Ana Kukec wrote:
>>>> Hi all,
>>>>=20
>>>> A man page for the kernel side SeND, and an updated port with
>>>> Secure Neighbor Discovery application will follow soon.
>>>=20
>>> At minimum committing the man page along with new code is how such
>>> things should be done. Can you define "soon?"
>>=20
>> Yes I can: soon will be when it'll be comitted.
>=20
> I'm guessing that's an attempt at humor, but what I'm looking for is =
an actual timeline. If the answer is "in the next day or two" then =
that's fine, we'll let this one go with a warning. If the answer is =
"someday" then I'm going to request that the code be backed out until =
the man page(s) are done. I'm actually trying to be reasonable and work =
with a new developer so that they can learn how we like to have things =
done around here. What are you trying to do?

What? Are you serious? Do you really want some code to be backed out =
because it doesn't have a man page yet? Talking about overkill..
You don't seem to have an idea how many times code was committed without =
a man page.
I didn't see you complain back then.. It's very likely you wouldn't be =
complaining if the developer in question hadn't posted a message to the =
mailing list saying she intends to commit a man page soon.

>=20
>> Meanwhile if you have time I'd know several dozen other things we
>> don't have a man page for ...
>=20
> I would definitely recommend that you make a list of them, preferably =
someplace visible like the wiki. If you don't already have access to the =
wiki (or some other suitable forum) then send the list to -doc@ and =
we'll make sure that it gets posted. Given the recent resurgence of =
interest in updating our documentation it certainly wouldn't hurt to =
have some examples of low-hanging fruit that we can turn budding mdoc =
gurus loose on.
>=20
> Meanwhile, the fact that in the past code has been committed without =
man pages is the exact cause of the problem you're describing. It is =
certainly not a justification for continuing to do it wrong.

Reverting code just because it doesn't have a man page is pointless. =
Everyone can write the damn man page, but not everyone can write code. =
You should really take this into consideration when proposing a commit =
to be reverted.

Regards,
--
Rui Paulo



From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 12:55:40 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1D6BE10656A6;
	Sat, 21 Aug 2010 12:55:40 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E83DF8FC0A;
	Sat, 21 Aug 2010 12:55:39 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LCtdn7069644;
	Sat, 21 Aug 2010 12:55:39 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LCtdVX069643;
	Sat, 21 Aug 2010 12:55:39 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201008211255.o7LCtdVX069643@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Aug 2010 12:55:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-vendor@freebsd.org
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r211556 - in vendor/dtracetoolkit: 0.99 dist
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 12:55:40 -0000

Author: rpaulo
Date: Sat Aug 21 12:55:39 2010
New Revision: 211556
URL: http://svn.freebsd.org/changeset/base/211556

Log:
  Revert the import because the vendor/dtracetoolkit directory was created
  at the same time as the import. This makes the svn merge in head unable
  to understand what I was trying to accomplish and doesn't allow me to
  merge dtracetoolkit to head.
  
  Sponsored by:	The FreeBSD Foundation

Deleted:
  vendor/dtracetoolkit/0.99/
  vendor/dtracetoolkit/dist/

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 13:15:56 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C0021106564A;
	Sat, 21 Aug 2010 13:15:56 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id B00F08FC17;
	Sat, 21 Aug 2010 13:15:56 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LDFu2T070061;
	Sat, 21 Aug 2010 13:15:56 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LDFuJ8070059;
	Sat, 21 Aug 2010 13:15:56 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201008211315.o7LDFuJ8070059@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Aug 2010 13:15:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-vendor@freebsd.org
X-SVN-Group: vendor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r211557 - vendor/dtracetoolkit/dist
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 13:15:56 -0000

Author: rpaulo
Date: Sat Aug 21 13:15:56 2010
New Revision: 211557
URL: http://svn.freebsd.org/changeset/base/211557

Log:
  Import dtruss from Brendan Gregg's DTraceToolkit.
  
  Sponsored by:	The FreeBSD Foundation

Added:
  vendor/dtracetoolkit/dist/
  vendor/dtracetoolkit/dist/dtruss   (contents, props changed)

Added: vendor/dtracetoolkit/dist/dtruss
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/dtracetoolkit/dist/dtruss	Sat Aug 21 13:15:56 2010	(r211557)
@@ -0,0 +1,467 @@
+#!/usr/bin/sh
+#
+# dtruss - print process system call time details.
+#          Written using DTrace (Solaris 10 3/05).
+#
+# $Id: dtruss 9 2007-08-07 10:21:07Z brendan $
+#
+# USAGE: dtruss [-acdeflhoLs] [-t syscall] { -p PID | -n name | command }
+#
+#		-p PID		# examine this PID
+#		-n name		# examine this process name
+#		-t syscall	# examine this syscall only
+#		-a		# print all details
+#		-c		# print system call counts
+#		-d		# print relative timestamps (us)
+#		-e		# print elapsed times (us)
+#		-f		# follow children as they are forked
+#		-l		# force printing of pid/lwpid per line
+#		-o		# print on cpu times (us)
+#		-s		# print stack backtraces
+#		-L		# don't print pid/lwpid per line
+#		-b bufsize	# dynamic variable buf size (default is "4m")
+#  eg,
+#		dtruss df -h	# run and examine the "df -h" command
+#		dtruss -p 1871	# examine PID 1871
+#		dtruss -n tar	# examine all processes called "tar"
+#		dtruss -f test.sh	# run test.sh and follow children
+#
+# See the man page dtruss(1M) for further details.
+#
+# SEE ALSO: procsystime    # DTraceToolkit
+#           dapptrace      # DTraceToolkit
+#           truss
+#
+# COPYRIGHT: Copyright (c) 2005, 2006, 2007 Brendan Gregg.
+#
+# CDDL HEADER START
+#
+#  The contents of this file are subject to the terms of the
+#  Common Development and Distribution License, Version 1.0 only
+#  (the "License").  You may not use this file except in compliance
+#  with the License.
+#
+#  You can obtain a copy of the license at Docs/cddl1.txt
+#  or http://www.opensolaris.org/os/licensing.
+#  See the License for the specific language governing permissions
+#  and limitations under the License.
+#
+# CDDL HEADER END
+#
+# TODO: Track signals, more output formatting.
+#
+# 29-Apr-2005   Brendan Gregg   Created this.
+# 09-May-2005      "      " 	Fixed evaltime (thanks Adam L.)
+# 16-May-2005	   "      "	Added -t syscall tracing.
+# 17-Jun-2005	   "      "	Added -s stack backtraces.
+# 17-Jun-2005	   "      "	Last update.
+# 29-Jun-2007	   "      "	Used progenyof() (thanks Aaron Gutman).
+# 06-Aug-2007	   "      "	Various updates.
+#
+
+
+##############################
+# --- Process Arguments ---
+#
+
+### Default variables
+opt_pid=0; opt_name=0; pid=0; pname="."; opt_elapsed=0; opt_cpu=0
+opt_counts=0; opt_relative=0; opt_printid=0; opt_follow=0; opt_command=0
+command=""; opt_buf=0; buf="4m"; opt_trace=0; trace="."; opt_stack=0
+
+### Process options
+while getopts ab:cdefhln:op:st:L name
+do
+        case $name in
+	b)	opt_buf=1; buf=$OPTARG ;;
+        p)      opt_pid=1; pid=$OPTARG ;;
+        n)      opt_name=1; pname=$OPTARG ;;
+        t)      opt_trace=1; trace=$OPTARG ;;
+	a)	opt_counts=1; opt_relative=1; opt_elapsed=1; opt_follow=1
+		opt_printid=1; opt_cpu=1 ;;
+	c)	opt_counts=1 ;;
+	d)	opt_relative=1 ;;
+	e)	opt_elapsed=1 ;;
+	f)	opt_follow=1 ;;
+	l)	opt_printid=1 ;;
+	o)	opt_cpu=1 ;;
+	L)	opt_printid=-1 ;;
+	s)	opt_stack=-1 ;;
+        h|?)    cat <<-END >&2
+		USAGE: dtruss [-acdefholLs] [-t syscall] { -p PID | -n name | command }
+
+		          -p PID          # examine this PID
+		          -n name         # examine this process name
+		          -t syscall      # examine this syscall only
+		          -a              # print all details
+		          -c              # print syscall counts
+		          -d              # print relative times (us)
+		          -e              # print elapsed times (us)
+		          -f              # follow children (-p or cmd only)
+		          -l              # force printing pid/lwpid
+		          -o              # print on cpu times
+		          -s              # print stack backtraces
+		          -L              # don't print pid/lwpid
+		          -b bufsize      # dynamic variable buf size
+		   eg,
+		       dtruss df -h       # run and examine "df -h"
+		       dtruss -p 1871     # examine PID 1871
+		       dtruss -n tar      # examine all processes called "tar"
+		       dtruss -f test.sh  # run test.sh and follow children
+		END
+		exit 1
+        esac
+done
+shift `expr $OPTIND - 1`
+
+### Option logic
+if [ $opt_pid -eq 0 -a $opt_name -eq 0 ]; then
+	opt_command=1
+	if [ "$*" = "" ]; then
+		$0 -h
+		exit
+	fi
+	command="$*"	# yes, I meant $*!
+fi
+if [ $opt_follow -eq 1 -o $opt_name -eq 1 ]; then
+	if [ $opt_printid -ne -1 ]; then
+		opt_printid=1
+	else
+		opt_printid=0
+	fi
+fi
+if [ $opt_follow -eq 1 -a $opt_name -eq 1 ]; then
+	echo "ERROR: -f option cannot be used with -n (use -p or cmd instead)."
+	exit 1
+fi
+
+### Option translation
+if [ "$trace" = "exec" ]; then trace="exece"; fi
+if [ "$trace" = "time" ]; then trace="gtime"; fi
+if [ "$trace" = "exit" ]; then trace="rexit"; fi
+
+
+#################################
+# --- Main Program, DTrace ---
+#
+
+### Define D Script
+dtrace='
+#pragma D option quiet
+#pragma D option switchrate=10
+ 
+/*
+ * Command line arguments
+ */
+inline int OPT_command   = '$opt_command';
+inline int OPT_follow    = '$opt_follow';
+inline int OPT_printid   = '$opt_printid';
+inline int OPT_relative  = '$opt_relative';
+inline int OPT_elapsed   = '$opt_elapsed';
+inline int OPT_cpu       = '$opt_cpu';
+inline int OPT_counts    = '$opt_counts';
+inline int OPT_pid       = '$opt_pid';
+inline int OPT_name      = '$opt_name';
+inline int OPT_trace     = '$opt_trace';
+inline int OPT_stack     = '$opt_stack';
+inline string NAME       = "'$pname'";
+inline string TRACE      = "'$trace'";
+
+dtrace:::BEGIN 
+{
+	/* print header */
+	OPT_printid  ? printf("%-9s  ", "PID/LWP") : 1;
+	OPT_relative ? printf("%8s ", "RELATIVE") : 1;
+	OPT_elapsed  ? printf("%7s ", "ELAPSD") : 1;
+	OPT_cpu      ? printf("%6s ", "CPU") : 1;
+	printf("SYSCALL(args) \t\t = return\n");
+}
+
+/*
+ * Save syscall entry info
+ */
+syscall:::entry
+/((OPT_command || OPT_pid) && pid == $target) || 
+ (OPT_name && execname == NAME) ||
+ (OPT_follow && progenyof($target))/
+{
+	/* set start details */
+	self->start = timestamp;
+	self->vstart = vtimestamp;
+	self->arg0 = arg0;
+	self->arg1 = arg1;
+	self->arg2 = arg2;
+
+	/* count occurances */
+	OPT_counts == 1 ? @Counts[probefunc] = count() : 1;
+}
+
+/*
+ * Follow children
+ */
+syscall::fork*:return
+/(OPT_follow && progenyof($target)) && (!OPT_trace || (TRACE == probefunc))/
+{
+	/* print output */
+	self->code = errno == 0 ? "" : "Err#";
+	OPT_printid  ? printf("%6d/%d:  ", pid, tid) : 1;
+	OPT_relative ? printf("%8d:  ", vtimestamp/1000) : 1;
+	OPT_elapsed  ? printf("%7d:  ", 0) : 1;
+	OPT_cpu      ? printf("%6d ", 0) : 1;
+	printf("%s(0x%X, 0x%X, 0x%X)\t\t = %d %s%d\n", probefunc,
+	    self->arg0, self->arg1, self->arg2, (int)arg0, self->code,
+	    (int)errno);
+}
+
+/*
+ * Check for syscall tracing
+ */
+syscall:::entry
+/OPT_trace && probefunc != TRACE/
+{
+	/* drop info */
+	self->start = 0;
+	self->vstart = 0;
+	self->arg0 = 0;
+	self->arg1 = 0;
+	self->arg2 = 0;
+}
+
+/*
+ * Print return data
+ */
+
+/*
+ * The following code is written in an intentionally repetative way.
+ * The first versions had no code redundancies, but performed badly during
+ * benchmarking. The priority here is speed, not cleverness. I know there
+ * are many obvious shortcuts to this code, I have tried them. This style has
+ * shown in benchmarks to be the fastest (fewest probes fired, fewest actions).
+ */
+
+/* print 3 args, return as hex */
+syscall::lwp_sigmask:return
+/self->start/
+{
+	/* calculate elapsed time */
+	this->elapsed = timestamp - self->start;
+	self->start = 0;
+	this->cpu = vtimestamp - self->vstart;
+	self->vstart = 0;
+	self->code = errno == 0 ? "" : "Err#";
+ 
+	/* print optional fields */
+	OPT_printid  ? printf("%6d/%d:  ", pid, tid) : 1;
+	OPT_relative ? printf("%8d ", vtimestamp/1000) : 1;
+	OPT_elapsed  ? printf("%7d ", this->elapsed/1000) : 1;
+	OPT_cpu ? printf("%6d ", this->cpu/1000) : 1;
+ 
+	/* print main data */
+	printf("%s(0x%X, 0x%X, 0x%X)\t\t = 0x%X %s%d\n", probefunc,
+	    (int)self->arg0, self->arg1, self->arg2, (int)arg0,
+	    self->code, (int)errno);
+	OPT_stack ? ustack()    : 1;
+	OPT_stack ? trace("\n") : 1;
+	self->arg0 = 0;
+	self->arg1 = 0;
+	self->arg2 = 0;
+}
+
+/* print 3 args, arg0 as a string */
+syscall::stat*:return, 
+syscall::lstat*:return, 
+syscall::open*:return,
+syscall::resolvepath:return
+/self->start/
+{
+	/* calculate elapsed time */
+	this->elapsed = timestamp - self->start;
+	self->start = 0;
+	this->cpu = vtimestamp - self->vstart;
+	self->vstart = 0;
+	self->code = errno == 0 ? "" : "Err#";
+ 
+	/* print optional fields */
+	OPT_printid  ? printf("%6d/%d:  ", pid, tid) : 1;
+	OPT_relative ? printf("%8d ", vtimestamp/1000) : 1;
+	OPT_elapsed  ? printf("%7d ", this->elapsed/1000) : 1;
+	OPT_cpu      ? printf("%6d ", this->cpu/1000) : 1;
+ 
+	/* print main data */
+	printf("%s(\"%S\", 0x%X, 0x%X)\t\t = %d %s%d\n", probefunc,
+	    copyinstr(self->arg0), self->arg1, self->arg2, (int)arg0,
+	    self->code, (int)errno);
+	OPT_stack ? ustack()    : 1;
+	OPT_stack ? trace("\n") : 1;
+	self->arg0 = 0;
+	self->arg1 = 0;
+	self->arg2 = 0;
+}
+
+/* print 3 args, arg1 as a string */
+syscall::write:return,
+syscall::pwrite:return,
+syscall::*read*:return
+/self->start/
+{
+	/* calculate elapsed time */
+	this->elapsed = timestamp - self->start;
+	self->start = 0;
+	this->cpu = vtimestamp - self->vstart;
+	self->vstart = 0;
+	self->code = errno == 0 ? "" : "Err#";
+ 
+	/* print optional fields */
+	OPT_printid  ? printf("%6d/%d:  ", pid, tid) : 1;
+	OPT_relative ? printf("%8d ", vtimestamp/1000) : 1;
+	OPT_elapsed  ? printf("%7d ", this->elapsed/1000) : 1;
+	OPT_cpu      ? printf("%6d ", this->cpu/1000) : 1;
+ 
+	/* print main data */
+	printf("%s(0x%X, \"%S\", 0x%X)\t\t = %d %s%d\n", probefunc, self->arg0,
+	    stringof(copyin(self->arg1, self->arg2)), self->arg2, (int)arg0,
+	    self->code, (int)errno);
+	OPT_stack ? ustack()    : 1;
+	OPT_stack ? trace("\n") : 1;
+	self->arg0 = 0;
+	self->arg1 = 0;
+	self->arg2 = 0;
+}
+
+/* print 0 arg output */
+syscall::gtime:return,
+syscall::*fork*:return
+/self->start/
+{
+	/* calculate elapsed time */
+	this->elapsed = timestamp - self->start;
+	self->start = 0;
+	this->cpu = vtimestamp - self->vstart;
+	self->vstart = 0;
+	self->code = errno == 0 ? "" : "Err#";
+ 
+	/* print optional fields */
+	OPT_printid  ? printf("%6d/%d:  ", pid, tid) : 1;
+	OPT_relative ? printf("%8d ", vtimestamp/1000) : 1;
+	OPT_elapsed  ? printf("%7d ", this->elapsed/1000) : 1;
+	OPT_cpu      ? printf("%6d ", this->cpu/1000) : 1;
+ 
+	/* print main data */
+	printf("%s()\t\t = %d %s%d\n", probefunc,
+	    (int)arg0, self->code, (int)errno);
+	OPT_stack ? ustack()    : 1;
+	OPT_stack ? trace("\n") : 1;
+	self->arg0 = 0;
+	self->arg1 = 0;
+	self->arg2 = 0;
+}
+
+/* print 1 arg output */
+syscall::brk:return,
+syscall::times:return,
+syscall::stime:return,
+syscall::close:return
+/self->start/
+{
+	/* calculate elapsed time */
+	this->elapsed = timestamp - self->start;
+	self->start = 0;
+	this->cpu = vtimestamp - self->vstart;
+	self->vstart = 0;
+	self->code = errno == 0 ? "" : "Err#";
+ 
+	/* print optional fields */
+	OPT_printid  ? printf("%6d/%d:  ", pid, tid) : 1;
+	OPT_relative ? printf("%8d ", vtimestamp/1000) : 1;
+	OPT_elapsed  ? printf("%7d ", this->elapsed/1000) : 1;
+	OPT_cpu      ? printf("%6d ", this->cpu/1000) : 1;
+ 
+	/* print main data */
+	printf("%s(0x%X)\t\t = %d %s%d\n", probefunc, self->arg0,
+	    (int)arg0, self->code, (int)errno);
+	OPT_stack ? ustack()    : 1;
+	OPT_stack ? trace("\n") : 1;
+	self->arg0 = 0;
+	self->arg1 = 0;
+	self->arg2 = 0;
+}
+
+/* print 2 arg output */
+syscall::utime:return,
+syscall::munmap:return
+/self->start/
+{
+	/* calculate elapsed time */
+	this->elapsed = timestamp - self->start;
+	self->start = 0;
+	this->cpu = vtimestamp - self->vstart;
+	self->vstart = 0;
+	self->code = errno == 0 ? "" : "Err#";
+ 
+	/* print optional fields */
+	OPT_printid  ? printf("%6d/%d:  ", pid, tid) : 1;
+	OPT_relative ? printf("%8d ", vtimestamp/1000) : 1;
+	OPT_elapsed  ? printf("%7d ", this->elapsed/1000) : 1;
+	OPT_cpu      ? printf("%6d ", this->cpu/1000) : 1;
+ 
+	/* print main data */
+	printf("%s(0x%X, 0x%X)\t\t = %d %s%d\n", probefunc, self->arg0,
+	    self->arg1, (int)arg0, self->code, (int)errno);
+	OPT_stack ? ustack()    : 1;
+	OPT_stack ? trace("\n") : 1;
+	self->arg0 = 0;
+	self->arg1 = 0;
+	self->arg2 = 0;
+}
+
+/* print 3 arg output - default */
+syscall:::return
+/self->start/
+{
+	/* calculate elapsed time */
+	this->elapsed = timestamp - self->start;
+	self->start = 0;
+	this->cpu = vtimestamp - self->vstart;
+	self->vstart = 0;
+	self->code = errno == 0 ? "" : "Err#";
+ 
+	/* print optional fields */
+	OPT_printid  ? printf("%6d/%d:  ", pid, tid) : 1;
+	OPT_relative ? printf("%8d ", vtimestamp/1000) : 1;
+	OPT_elapsed  ? printf("%7d ", this->elapsed/1000) : 1;
+	OPT_cpu      ? printf("%6d ", this->cpu/1000) : 1;
+ 
+	/* print main data */
+	printf("%s(0x%X, 0x%X, 0x%X)\t\t = %d %s%d\n", probefunc, self->arg0,
+	    self->arg1, self->arg2, (int)arg0, self->code, (int)errno);
+	OPT_stack ? ustack()    : 1;
+	OPT_stack ? trace("\n") : 1;
+	self->arg0 = 0;
+	self->arg1 = 0;
+	self->arg2 = 0;
+}
+
+/* program exited */
+proc:::exit
+/(OPT_command || OPT_pid) && pid == $target/
+{
+	exit(0);
+}
+
+/* print counts */
+dtrace:::END
+{
+	OPT_counts == 1 ? printf("\n%-32s %16s\n", "CALL", "COUNT") : 1;
+	OPT_counts == 1 ? printa("%-32s %@16d\n", @Counts) : 1;
+}
+'
+
+### Run DTrace
+if [ $opt_command -eq 1 ]; then
+	/usr/sbin/dtrace -x dynvarsize=$buf -x evaltime=exec -n "$dtrace" \
+	    -c "$command" >&2
+elif [ $opt_pid -eq 1 ]; then
+	/usr/sbin/dtrace -x dynvarsize=$buf -n "$dtrace" -p "$pid" >&2
+else
+	/usr/sbin/dtrace -x dynvarsize=$buf -n "$dtrace" >&2
+fi

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 13:21:05 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A8A311065695;
	Sat, 21 Aug 2010 13:21:05 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7F8098FC08;
	Sat, 21 Aug 2010 13:21:05 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LDL5Qt070207;
	Sat, 21 Aug 2010 13:21:05 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LDL5UM070206;
	Sat, 21 Aug 2010 13:21:05 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201008211321.o7LDL5UM070206@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Aug 2010 13:21: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: r211558 - head/cddl/contrib/dtracetoolkit
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 13:21:05 -0000

Author: rpaulo
Date: Sat Aug 21 13:21:05 2010
New Revision: 211558
URL: http://svn.freebsd.org/changeset/base/211558

Log:
  Add a directory for the DTraceToolkit.
  
  Sponsored by:	The FreeBSD Foundation

Added:
  head/cddl/contrib/dtracetoolkit/

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 13:42:12 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 60A50106566B;
	Sat, 21 Aug 2010 13:42:12 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 520E28FC1D;
	Sat, 21 Aug 2010 13:42:12 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LDgCjR070823;
	Sat, 21 Aug 2010 13:42:12 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LDgCXd070821;
	Sat, 21 Aug 2010 13:42:12 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201008211342.o7LDgCXd070821@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Aug 2010 13:42:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
	svn-src-head@freebsd.org
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Cc: 
Subject: svn commit: r211560 - 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, 21 Aug 2010 13:42:12 -0000

Author: rpaulo
Date: Sat Aug 21 13:42:12 2010
New Revision: 211560
URL: http://svn.freebsd.org/changeset/base/211560

Log:
  Add libelf to the prebuild libs.
  
  This is needed for the DTrace instrumentation object.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1	Sat Aug 21 13:23:54 2010	(r211559)
+++ head/Makefile.inc1	Sat Aug 21 13:42:12 2010	(r211560)
@@ -1142,7 +1142,7 @@ gnu/lib/libgcc__L: lib/libc__L
 _prebuild_libs=	${_kerberos5_lib_libasn1} ${_kerberos5_lib_libheimntlm} \
 		${_kerberos5_lib_libhx509} ${_kerberos5_lib_libkrb5} \
 		${_kerberos5_lib_libroken} \
-		lib/libbz2 lib/libcom_err lib/libcrypt \
+		lib/libbz2 lib/libcom_err lib/libcrypt lib/libelf \
 		lib/libexpat lib/libfetch \
 		${_lib_libgssapi} ${_lib_libipx} \
 		lib/libkiconv lib/libkvm lib/liblzma lib/libmd \

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 13:48:05 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4503F106564A;
	Sat, 21 Aug 2010 13:48:05 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 363108FC0A;
	Sat, 21 Aug 2010 13:48:05 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LDm5fW070983;
	Sat, 21 Aug 2010 13:48:05 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LDm55c070981;
	Sat, 21 Aug 2010 13:48:05 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201008211348.o7LDm55c070981@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Aug 2010 13:48: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: r211561 - head/cddl/lib/drti
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 13:48:05 -0000

Author: rpaulo
Date: Sat Aug 21 13:48:04 2010
New Revision: 211561
URL: http://svn.freebsd.org/changeset/base/211561

Log:
  Link drti.o with a PIC version of libelf. This is needed because
  drti.o depends on libelf and this avoids linking every other drti.o
  program (namely programs with USDT probes) with libelf.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/cddl/lib/drti/Makefile

Modified: head/cddl/lib/drti/Makefile
==============================================================================
--- head/cddl/lib/drti/Makefile	Sat Aug 21 13:42:12 2010	(r211560)
+++ head/cddl/lib/drti/Makefile	Sat Aug 21 13:48:04 2010	(r211561)
@@ -8,13 +8,20 @@ FILESOWN=	${LIBOWN}
 FILESGRP=	${LIBGRP}
 FILESMODE=	${LIBMODE}
 FILESDIR=	${LIBDIR}/dtrace
-CLEANFILES=	${FILES}
+CLEANFILES=	${FILES} ${FILES}.tmp
 
 CFLAGS+=	-I${.CURDIR}/../../../sys/cddl/compat/opensolaris \
 		-I${.CURDIR}/../../../cddl/compat/opensolaris/include \
 		-I${OPENSOLARIS_USR_DISTDIR}/head \
 		-I${OPENSOLARIS_USR_DISTDIR}/lib/libctf/common \
 		-I${OPENSOLARIS_USR_DISTDIR}/lib/libdtrace/common \
-		-I${OPENSOLARIS_SYS_DISTDIR}/uts/common
+		-I${OPENSOLARIS_SYS_DISTDIR}/uts/common \
+		-DPIC -fpic
+
+.c.o:
+	${CC} ${CFLAGS} -c ${.IMPSRC}
+	mv ${FILES} ${FILES}.tmp
+	${LD} -o ${FILES} -r ${FILES}.tmp ${LIBELF_PIC}
+	rm -f ${FILES}.tmp
 
 .include 

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 13:54:34 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 42A9A10656A5;
	Sat, 21 Aug 2010 13:54:34 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 27B568FC13;
	Sat, 21 Aug 2010 13:54:34 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LDsY6K071128;
	Sat, 21 Aug 2010 13:54:34 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LDsYTd071125;
	Sat, 21 Aug 2010 13:54:34 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201008211354.o7LDsYTd071125@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Aug 2010 13:54: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: r211562 - in head/cddl:
	contrib/opensolaris/cmd/plockstat usr.sbin/plockstat
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 13:54:34 -0000

Author: rpaulo
Date: Sat Aug 21 13:54:33 2010
New Revision: 211562
URL: http://svn.freebsd.org/changeset/base/211562

Log:
  Port plockstat to FreeBSD. This will be connected to the build later.
  
  Sponsored by:	The FreeBSD Foundation

Added:
  head/cddl/usr.sbin/plockstat/
  head/cddl/usr.sbin/plockstat/Makefile   (contents, props changed)
Modified:
  head/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c

Modified: head/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c	Sat Aug 21 13:48:04 2010	(r211561)
+++ head/cddl/contrib/opensolaris/cmd/plockstat/plockstat.c	Sat Aug 21 13:54:33 2010	(r211562)
@@ -24,7 +24,9 @@
  * Use is subject to license terms.
  */
 
+#if defined(sun)
 #pragma ident	"%Z%%M%	%I%	%E% SMI"
+#endif
 
 #include 
 #include 
@@ -41,6 +43,7 @@
 #include 
 #include 
 #include 
+#include 
 
 static char *g_pname;
 static dtrace_hdl_t *g_dtp;
@@ -502,7 +505,12 @@ getsym(struct ps_prochandle *P, uintptr_
 {
 	char name[256];
 	GElf_Sym sym;
+#if defined(sun)
 	prsyminfo_t info;
+#else
+	prmap_t *map;
+	int info; /* XXX unused */
+#endif
 	size_t len;
 
 	if (P == NULL || Pxlookup_by_addr(P, addr, name, sizeof (name),
@@ -510,6 +518,7 @@ getsym(struct ps_prochandle *P, uintptr_
 		(void) snprintf(buf, size, "%#lx", addr);
 		return (0);
 	}
+#if defined(sun)
 	if (info.prs_object == NULL)
 		info.prs_object = "";
 
@@ -520,15 +529,19 @@ getsym(struct ps_prochandle *P, uintptr_
 	}
 
 	len = snprintf(buf, size, "%s`%s", info.prs_object, info.prs_name);
+#else
+	map = proc_addr2map(P, addr);
+	len = snprintf(buf, size, "%s`%s", map->pr_mapname, name);
+#endif
 	buf += len;
 	size -= len;
 
 	if (sym.st_value != addr)
 		len = snprintf(buf, size, "+%#lx", addr - sym.st_value);
 
-	if (nolocks && strcmp("libc.so.1", info.prs_object) == 0 &&
-	    (strstr("mutex", info.prs_name) == 0 ||
-	    strstr("rw", info.prs_name) == 0))
+	if (nolocks && strcmp("libc.so.1", map->pr_mapname) == 0 &&
+	    (strstr("mutex", name) == 0 ||
+	    strstr("rw", name) == 0))
 		return (-1);
 
 	return (0);
@@ -655,8 +668,13 @@ process_aggregate(const dtrace_aggdata_t
 static void
 prochandler(struct ps_prochandle *P, const char *msg, void *arg)
 {
+#if defined(sun)
 	const psinfo_t *prp = Ppsinfo(P);
 	int pid = Pstatus(P)->pr_pid;
+#else
+	int pid = proc_getpid(P);
+	int wstat = proc_getwstat(P);
+#endif
 	char name[SIG2STR_MAX];
 
 	if (msg != NULL) {
@@ -674,13 +692,13 @@ prochandler(struct ps_prochandle *P, con
 		 * When /proc provides a stable pr_wstat in the status file,
 		 * this code can be improved by examining this new pr_wstat.
 		 */
-		if (prp != NULL && WIFSIGNALED(prp->pr_wstat)) {
+		if (WIFSIGNALED(wstat)) {
 			notice("pid %d terminated by %s\n", pid,
-			    proc_signame(WTERMSIG(prp->pr_wstat),
+			    proc_signame(WTERMSIG(wstat),
 			    name, sizeof (name)));
-		} else if (prp != NULL && WEXITSTATUS(prp->pr_wstat) != 0) {
+		} else if (WEXITSTATUS(wstat) != 0) {
 			notice("pid %d exited with status %d\n",
-			    pid, WEXITSTATUS(prp->pr_wstat));
+			    pid, WEXITSTATUS(wstat));
 		} else {
 			notice("pid %d has exited\n", pid);
 		}
@@ -755,7 +773,9 @@ intr(int signo)
 int
 main(int argc, char **argv)
 {
+#if defined(sun)
 	ucred_t *ucp;
+#endif
 	int err;
 	int opt_C = 0, opt_H = 0, opt_p = 0, opt_v = 0;
 	char c, *p, *end;
@@ -764,7 +784,7 @@ main(int argc, char **argv)
 
 	g_pname = basename(argv[0]);
 	argv[0] = g_pname; /* rewrite argv[0] for getopt errors */
-
+#if defined(sun)
 	/*
 	 * Make sure we have the required dtrace_proc privilege.
 	 */
@@ -777,6 +797,7 @@ main(int argc, char **argv)
 
 		ucred_free(ucp);
 	}
+#endif
 
 	while ((c = getopt(argc, argv, PLOCKSTAT_OPTSTR)) != EOF) {
 		switch (c) {
@@ -907,7 +928,7 @@ main(int argc, char **argv)
 
 	if (opt_H) {
 		dprog_add(g_hold_init);
-		if (g_opt_s == NULL)
+		if (!g_opt_s)
 			dprog_add(g_hold_times);
 		else
 			dprog_add(g_hold_histogram);
@@ -915,7 +936,7 @@ main(int argc, char **argv)
 
 	if (opt_C) {
 		dprog_add(g_ctnd_init);
-		if (g_opt_s == NULL)
+		if (!g_opt_s)
 			dprog_add(g_ctnd_times);
 		else
 			dprog_add(g_ctnd_histogram);
@@ -941,7 +962,7 @@ main(int argc, char **argv)
 		if ((g_pr = dtrace_proc_grab(g_dtp, (pid_t)pid, 0)) == NULL)
 			dfatal(NULL);
 	} else {
-		if ((g_pr = dtrace_proc_create(g_dtp, argv[0], argv)) == NULL)
+		if ((g_pr = dtrace_proc_create(g_dtp, argv[0], argv, NULL, NULL)) == NULL)
 			dfatal(NULL);
 	}
 
@@ -966,7 +987,11 @@ main(int argc, char **argv)
 
 	if (opt_v)
 		(void) printf("%s: tracing enabled for pid %d\n", g_pname,
+#if defined(sun)
 		    (int)Pstatus(g_pr)->pr_pid);
+#else
+		    (int)proc_getpid(g_pr));
+#endif
 
 	do {
 		if (!g_intr && !done)

Added: head/cddl/usr.sbin/plockstat/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/usr.sbin/plockstat/Makefile	Sat Aug 21 13:54:33 2010	(r211562)
@@ -0,0 +1,27 @@
+# $FreeBSD$
+
+.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/plockstat
+
+PROG=		plockstat
+NO_MAN=
+SRCS=		plockstat.c 
+BINDIR?=	/usr/sbin
+
+WARNS?=		1
+
+CFLAGS+=	-I${.CURDIR}/../../../sys/cddl/compat/opensolaris \
+		-I${.CURDIR}/../../../cddl/compat/opensolaris/include \
+		-I${OPENSOLARIS_USR_DISTDIR}/head \
+		-I${OPENSOLARIS_USR_DISTDIR}/lib/libdtrace/common \
+		-I${OPENSOLARIS_USR_DISTDIR}/lib/libproc/common \
+		-I${OPENSOLARIS_SYS_DISTDIR}/uts/common \
+		-I${OPENSOLARIS_SYS_DISTDIR}/compat \
+		-I${.CURDIR}/../../../cddl/lib/libdtrace \
+		-I${.CURDIR}/../../../sys
+
+DPADD=		${LIBPTHREAD} ${LIBDTRACE} ${LIBY} ${LIBL} ${LIBPROC} ${LIBCTF}\
+		${LIBELF} ${LIBZ} ${LIBRT} ${LIBRTLD_DB} ${LIBUTIL}
+LDADD=		-lpthread -ldtrace -ly -ll -lproc -lctf -lelf -lz -lrt \
+		-lrtld_db -lutil
+
+.include 

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 13:56:29 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 96B6F10656A8;
	Sat, 21 Aug 2010 13:56:29 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 87C8B8FC15;
	Sat, 21 Aug 2010 13:56:29 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LDuT98071218;
	Sat, 21 Aug 2010 13:56:29 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LDuTbo071216;
	Sat, 21 Aug 2010 13:56:29 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201008211356.o7LDuTbo071216@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Aug 2010 13:56: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: r211563 - head/cddl/usr.sbin/dtruss
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 13:56:29 -0000

Author: rpaulo
Date: Sat Aug 21 13:56:29 2010
New Revision: 211563
URL: http://svn.freebsd.org/changeset/base/211563

Log:
  Add a Makefile for dtruss.
  
  Sponsored by:	The FreeBSD Foundation

Added:
  head/cddl/usr.sbin/dtruss/
  head/cddl/usr.sbin/dtruss/Makefile   (contents, props changed)

Added: head/cddl/usr.sbin/dtruss/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/cddl/usr.sbin/dtruss/Makefile	Sat Aug 21 13:56:29 2010	(r211563)
@@ -0,0 +1,8 @@
+# $FreeBSD$
+
+.PATH: ${.CURDIR}/../../../cddl/contrib/dtracetoolkit
+
+SCRIPTS=dtruss
+NO_MAN=
+
+.include 

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 13:59:13 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A2C591065670;
	Sat, 21 Aug 2010 13:59:13 +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 245A98FC15;
	Sat, 21 Aug 2010 13:59:12 +0000 (UTC)
Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua
	[10.1.1.148])
	by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o7LDx8dI071308
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Sat, 21 Aug 2010 16:59:08 +0300 (EEST)
	(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.4/8.14.4) with ESMTP id
	o7LDx8g9091629; Sat, 21 Aug 2010 16:59:08 +0300 (EEST)
	(envelope-from kostikbel@gmail.com)
Received: (from kostik@localhost)
	by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o7LDx8Ko091628; 
	Sat, 21 Aug 2010 16:59:08 +0300 (EEST)
	(envelope-from kostikbel@gmail.com)
X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to
	kostikbel@gmail.com using -f
Date: Sat, 21 Aug 2010 16:59:08 +0300
From: Kostik Belousov 
To: Rui Paulo 
Message-ID: <20100821135908.GT2396@deviant.kiev.zoral.com.ua>
References: <201008211348.o7LDm55c070981@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="wPZoOnycM2UpxKV4"
Content-Disposition: inline
In-Reply-To: <201008211348.o7LDm55c070981@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=-2.2 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50,
	DNS_FROM_OPENWHOIS autolearn=no 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: r211561 - head/cddl/lib/drti
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 13:59:13 -0000


--wPZoOnycM2UpxKV4
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Aug 21, 2010 at 01:48:05PM +0000, Rui Paulo wrote:
> Author: rpaulo
> Date: Sat Aug 21 13:48:04 2010
> New Revision: 211561
> URL: http://svn.freebsd.org/changeset/base/211561
>=20
> Log:
>   Link drti.o with a PIC version of libelf. This is needed because
>   drti.o depends on libelf and this avoids linking every other drti.o
>   program (namely programs with USDT probes) with libelf.
What is wrong with having libelf as dependency of the resulting
binary ?

>  =20
>   Sponsored by:	The FreeBSD Foundation
>=20
> Modified:
>   head/cddl/lib/drti/Makefile
>=20
> Modified: head/cddl/lib/drti/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
> --- head/cddl/lib/drti/Makefile	Sat Aug 21 13:42:12 2010	(r211560)
> +++ head/cddl/lib/drti/Makefile	Sat Aug 21 13:48:04 2010	(r211561)
> @@ -8,13 +8,20 @@ FILESOWN=3D	${LIBOWN}
>  FILESGRP=3D	${LIBGRP}
>  FILESMODE=3D	${LIBMODE}
>  FILESDIR=3D	${LIBDIR}/dtrace
> -CLEANFILES=3D	${FILES}
> +CLEANFILES=3D	${FILES} ${FILES}.tmp
> =20
>  CFLAGS+=3D	-I${.CURDIR}/../../../sys/cddl/compat/opensolaris \
>  		-I${.CURDIR}/../../../cddl/compat/opensolaris/include \
>  		-I${OPENSOLARIS_USR_DISTDIR}/head \
>  		-I${OPENSOLARIS_USR_DISTDIR}/lib/libctf/common \
>  		-I${OPENSOLARIS_USR_DISTDIR}/lib/libdtrace/common \
> -		-I${OPENSOLARIS_SYS_DISTDIR}/uts/common
> +		-I${OPENSOLARIS_SYS_DISTDIR}/uts/common \
> +		-DPIC -fpic
> +
> +.c.o:
> +	${CC} ${CFLAGS} -c ${.IMPSRC}
> +	mv ${FILES} ${FILES}.tmp
> +	${LD} -o ${FILES} -r ${FILES}.tmp ${LIBELF_PIC}
> +	rm -f ${FILES}.tmp
> =20
>  .include 

--wPZoOnycM2UpxKV4
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAkxv26wACgkQC3+MBN1Mb4jkZQCdGoODTJaob18OTgg1/glmCNEU
EvEAmQHV6y5eflNoO6PLEishRNTIB7nP
=6RhA
-----END PGP SIGNATURE-----

--wPZoOnycM2UpxKV4--

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 13:59:41 2010
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7E57D1065693;
	Sat, 21 Aug 2010 13:59:41 +0000 (UTC)
	(envelope-from dimitry@andric.com)
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 4057D8FC12;
	Sat, 21 Aug 2010 13:59:41 +0000 (UTC)
Received: from [IPv6:2001:7b8:3a7:0:5bf:3b80:dc99:ff32] (unknown
	[IPv6:2001:7b8:3a7:0:5bf:3b80:dc99:ff32])
	(using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
	(No client certificate requested)
	by tensor.andric.com (Postfix) with ESMTPSA id 243425C59;
	Sat, 21 Aug 2010 15:59:40 +0200 (CEST)
Message-ID: <4C6FDBCF.6070101@andric.com>
Date: Sat, 21 Aug 2010 15:59:43 +0200
From: Dimitry Andric 
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US;
	rv:1.9.2.9pre) Gecko/20100814 Lanikai/3.1.3pre
MIME-Version: 1.0
To: Bruce Evans 
References: <201008191259.o7JCxv3i004613@svn.freebsd.org>
	<20100820075236.L18914@delplex.bde.org>
	<4C6DC0F8.9040001@andric.com>
	<20100821054033.M19850@delplex.bde.org>
In-Reply-To: <20100821054033.M19850@delplex.bde.org>
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, Rui Paulo 
Subject: Re: svn commit: r211505 - head/contrib/gcc
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 13:59:41 -0000

On 2010-08-20 22:36, Bruce Evans wrote:
> On Fri, 20 Aug 2010, Dimitry Andric wrote:
[...] 
>> But will the casts not potentially hide problems, if you pass the wrong
>> types to those macros?  Maybe it is better if the compiler complains
>> that some argument is of an incompatible type, than just forcing it to
>> cast?
> This is unclear.  All integer types are compatible to some extent.
> Upcasting them always works and downcasting them works iff the value
> is not changed.

I meant this in the context of this llvm PR, about matching inline asm
input constraints with output constraints of an incompatible type:

  http://llvm.org/bugs/show_bug.cgi?id=3373

Clang is currently somewhat pickier about the arguments to inline asm,
which we also noticed in OpenSSL code, where a rotate-left macro is
defined (for i386 and amd64) as:

#   define ROTATE(a,n)	({ register unsigned int ret;	\
				  asm (			\
				  "roll %1,%0"		\
				  : "=r"(ret)		\
				  : "I"(n), "0"(a)	\
				  : "cc");		\
			     ret;			\
			  })

On amd64, it was being called with the 'a' argument being of unsigned
long type.  Clang complained:

crypto/openssl/crypto/md4/md4_dgst.c:117:2:
error: unsupported inline asm: input with type 'unsigned long' matching
output with type 'unsigned int'
	  R0(A,B,C,D,X( 0), 3,0); HOST_c2l(data,l); X( 2)=l;
	  ^~~~~~~~~~~~~~~~~~~~~~

In this case, the OpenSSL developers chose to explicitly cast 'a' to
'unsigned int' (see ).

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 14:02:05 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 15F4E1065695;
	Sat, 21 Aug 2010 14:02:05 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 071B68FC17;
	Sat, 21 Aug 2010 14:02:05 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LE24A2071386;
	Sat, 21 Aug 2010 14:02:04 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LE24ep071384;
	Sat, 21 Aug 2010 14:02:04 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201008211402.o7LE24ep071384@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Aug 2010 14:02: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: r211564 - head/cddl/usr.sbin
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 14:02:05 -0000

Author: rpaulo
Date: Sat Aug 21 14:02:04 2010
New Revision: 211564
URL: http://svn.freebsd.org/changeset/base/211564

Log:
  Use double quotes when checking the value of MACHINE_ARCH.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/cddl/usr.sbin/Makefile

Modified: head/cddl/usr.sbin/Makefile
==============================================================================
--- head/cddl/usr.sbin/Makefile	Sat Aug 21 13:56:29 2010	(r211563)
+++ head/cddl/usr.sbin/Makefile	Sat Aug 21 14:02:04 2010	(r211564)
@@ -12,7 +12,7 @@ _zdb=	zdb
 .endif
 .endif
 
-.if ${MACHINE_ARCH} == amd64 || ${MACHINE_ARCH} == i386
+.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
 _dtrace=	dtrace
 _lockstat=	lockstat
 .endif

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 14:08:04 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 66B99106564A;
	Sat, 21 Aug 2010 14:08:04 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 57F4E8FC08;
	Sat, 21 Aug 2010 14:08:04 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LE84DP071523;
	Sat, 21 Aug 2010 14:08:04 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LE84TZ071521;
	Sat, 21 Aug 2010 14:08:04 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201008211408.o7LE84TZ071521@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Aug 2010 14:08: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: r211565 - head/share/mk
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 14:08:04 -0000

Author: rpaulo
Date: Sat Aug 21 14:08:04 2010
New Revision: 211565
URL: http://svn.freebsd.org/changeset/base/211565

Log:
  Add the definition of LIBELF_PIC.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/share/mk/bsd.libnames.mk

Modified: head/share/mk/bsd.libnames.mk
==============================================================================
--- head/share/mk/bsd.libnames.mk	Sat Aug 21 14:02:04 2010	(r211564)
+++ head/share/mk/bsd.libnames.mk	Sat Aug 21 14:08:04 2010	(r211565)
@@ -45,6 +45,7 @@ LIBDTRACE?=	${DESTDIR}${LIBDIR}/libdtrac
 LIBDWARF?=	${DESTDIR}${LIBDIR}/libdwarf.a
 LIBEDIT?=	${DESTDIR}${LIBDIR}/libedit.a
 LIBELF?=	${DESTDIR}${LIBDIR}/libelf.a
+LIBELF_PIC?=	${DESTDIR}${LIBDIR}/libelf_pic.a
 LIBFETCH?=	${DESTDIR}${LIBDIR}/libfetch.a
 LIBFL?=		"don't use LIBFL, use LIBL"
 LIBFORM?=	${DESTDIR}${LIBDIR}/libform.a

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 14:09:24 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 83AD710656A7;
	Sat, 21 Aug 2010 14:09:24 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 7475D8FC25;
	Sat, 21 Aug 2010 14:09:24 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LE9OgU071579;
	Sat, 21 Aug 2010 14:09:24 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LE9OWr071577;
	Sat, 21 Aug 2010 14:09:24 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201008211409.o7LE9OWr071577@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Aug 2010 14:09: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: r211566 - head/sys/cddl/compat/opensolaris/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: Sat, 21 Aug 2010 14:09:24 -0000

Author: rpaulo
Date: Sat Aug 21 14:09:24 2010
New Revision: 211566
URL: http://svn.freebsd.org/changeset/base/211566

Log:
  Add a sysname char * to struct opensolaris_utsname.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/cddl/compat/opensolaris/sys/misc.h

Modified: head/sys/cddl/compat/opensolaris/sys/misc.h
==============================================================================
--- head/sys/cddl/compat/opensolaris/sys/misc.h	Sat Aug 21 14:08:04 2010	(r211565)
+++ head/sys/cddl/compat/opensolaris/sys/misc.h	Sat Aug 21 14:09:24 2010	(r211566)
@@ -46,6 +46,7 @@
 #ifdef _KERNEL
 struct opensolaris_utsname {
 	char *nodename;
+	char *sysname;
 };
 
 extern char hw_serial[11];

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 14:14:24 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A604F10656A8;
	Sat, 21 Aug 2010 14:14:24 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 954928FC1E;
	Sat, 21 Aug 2010 14:14:24 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LEEOuq071720;
	Sat, 21 Aug 2010 14:14:24 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LEEOFG071718;
	Sat, 21 Aug 2010 14:14:24 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201008211414.o7LEEOFG071718@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Aug 2010 14:14: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: r211567 - head/tools/test/dtrace
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 14:14:24 -0000

Author: rpaulo
Date: Sat Aug 21 14:14:24 2010
New Revision: 211567
URL: http://svn.freebsd.org/changeset/base/211567

Log:
  Update for the new tests.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/tools/test/dtrace/Makefile

Modified: head/tools/test/dtrace/Makefile
==============================================================================
--- head/tools/test/dtrace/Makefile	Sat Aug 21 14:09:24 2010	(r211566)
+++ head/tools/test/dtrace/Makefile	Sat Aug 21 14:14:24 2010	(r211567)
@@ -1,274 +1,206 @@
 # $FreeBSD$
 
 TESTSRCDIR=	${.CURDIR}/../../../cddl/contrib/opensolaris/cmd/dtrace/test
+CFLAGS+=	-w
 DTEST=		${TESTSRCDIR}/cmd/scripts/dtest.pl -n
 
 IGNORE=		\
-	${TESTSRCDIR}/tst/common/arrays/err.D_IDENT_UNDEF.badureg.d		\
-	${TESTSRCDIR}/tst/common/printa/err.D_PRINTF_ARG_TYPE.jstack.d		\
-	${TESTSRCDIR}/tst/common/printa/err.D_PRINTF_ARG_TYPE.ustack.d		\
-	${TESTSRCDIR}/tst/common/printa/tst.stack.d				\
-	${TESTSRCDIR}/tst/common/stack/err.D_USTACK_FRAMES.bad.d		\
-	${TESTSRCDIR}/tst/common/stack/err.D_USTACK_PROTO.bad.d			\
-	${TESTSRCDIR}/tst/common/stack/err.D_USTACK_STRSIZE.bad.d		\
-	${TESTSRCDIR}/tst/common/stop/tst.stop1.d				\
-	${TESTSRCDIR}/tst/common/aggs/tst.subr.d				\
-	${TESTSRCDIR}/tst/common/aggs/tst.signature.d				\
-	${TESTSRCDIR}/tst/common/arrays/tst.uregsarray.d			\
-	${TESTSRCDIR}/tst/common/assocs/err.D_OP_INCOMPAT.dupgtype.d		\
-	${TESTSRCDIR}/tst/common/assocs/err.D_OP_INCOMPAT.dupttype.d		\
-	${TESTSRCDIR}/tst/common/assocs/tst.orthogonality.d			\
-	${TESTSRCDIR}/tst/common/buffering/tst.cputime.ksh			\
-	${TESTSRCDIR}/tst/common/buffering/tst.ring3.d				\
-	${TESTSRCDIR}/tst/common/builtinvar/tst.psinfo.d			\
-	${TESTSRCDIR}/tst/common/builtinvar/tst.psinfo1.d			\
-	${TESTSRCDIR}/tst/common/drops/drp.DTRACEDROP_STKSTROVERFLOW.d		\
-	${TESTSRCDIR}/tst/common/dtraceUtil/err.D_PDESC_ZERO.InvalidDescription1.d	\
-	${TESTSRCDIR}/tst/common/dtraceUtil/tst.DataModel32.d.ksh		\
-	${TESTSRCDIR}/tst/common/dtraceUtil/tst.DestructWithFunction.d.ksh	\
-	${TESTSRCDIR}/tst/common/dtraceUtil/tst.DestructWithModule.d.ksh	\
-	${TESTSRCDIR}/tst/common/dtraceUtil/tst.PreprocessorStatement.d.ksh	\
-	${TESTSRCDIR}/tst/common/dtraceUtil/tst.ZeroFunctionProbes.d.ksh	\
-	${TESTSRCDIR}/tst/common/funcs/err.D_PROTO_ARG.mobadarg.d		\
-	${TESTSRCDIR}/tst/common/funcs/err.D_PROTO_LEN.motoofew.d		\
-	${TESTSRCDIR}/tst/common/funcs/err.D_PROTO_LEN.motoomany.d		\
-	${TESTSRCDIR}/tst/common/funcs/err.D_PROTO_LEN.mtabadarg.d		\
-	${TESTSRCDIR}/tst/common/funcs/err.D_PROTO_LEN.mtatoofew.d		\
-	${TESTSRCDIR}/tst/common/funcs/err.D_PROTO_LEN.mtatoomany.d		\
-	${TESTSRCDIR}/tst/common/funcs/tst.bcopy.d				\
-	${TESTSRCDIR}/tst/common/funcs/tst.copyin.d				\
-	${TESTSRCDIR}/tst/common/funcs/tst.copyinto.d				\
-	${TESTSRCDIR}/tst/common/funcs/tst.ddi_pathname.d			\
-	${TESTSRCDIR}/tst/common/inline/err.D_OP_INCOMPAT.badxlate.d		\
-	${TESTSRCDIR}/tst/common/inline/tst.InlineDataAssign.d			\
-	${TESTSRCDIR}/tst/common/inline/tst.InlineExpression.d			\
-	${TESTSRCDIR}/tst/common/inline/tst.InlineTypedef.d			\
-	${TESTSRCDIR}/tst/common/io/tst.fds.c					\
-	${TESTSRCDIR}/tst/common/java_api/tst.FunctionLookup.c			\
-	${TESTSRCDIR}/tst/common/java_api/tst.ProbeData.c			\
-	${TESTSRCDIR}/tst/common/misc/tst.dynopt.d				\
-	${TESTSRCDIR}/tst/common/misc/tst.include.ksh				\
-	${TESTSRCDIR}/tst/common/misc/tst.roch.d				\
-	${TESTSRCDIR}/tst/common/misc/tst.schrock.ksh				\
-	${TESTSRCDIR}/tst/common/nfs/tst.call.c					\
-	${TESTSRCDIR}/tst/common/nfs/tst.call.d					\
-	${TESTSRCDIR}/tst/common/nfs/tst.call3.c				\
-	${TESTSRCDIR}/tst/common/nfs/tst.call3.d				\
-	${TESTSRCDIR}/tst/common/offsetof/err.D_OFFSETOF_BITFIELD.bitfield.d	\
-	${TESTSRCDIR}/tst/common/pid/err.D_PDESC_ZERO.badlib.d			\
-	${TESTSRCDIR}/tst/common/pid/err.D_PDESC_ZERO.badproc1.d		\
-	${TESTSRCDIR}/tst/common/pid/err.D_PROC_BADPID.badproc2.d		\
-	${TESTSRCDIR}/tst/common/pid/err.D_PROC_CREATEFAIL.many.d		\
-	${TESTSRCDIR}/tst/common/pid/err.D_PROC_FUNC.badfunc.d			\
-	${TESTSRCDIR}/tst/common/pid/err.D_PROC_LIB.libdash.d			\
-	${TESTSRCDIR}/tst/common/pid/err.D_PROC_NAME.alldash.d			\
-	${TESTSRCDIR}/tst/common/pid/err.D_PROC_NAME.badname.d			\
-	${TESTSRCDIR}/tst/common/pid/err.D_PROC_NAME.globdash.d			\
-	${TESTSRCDIR}/tst/common/pid/err.D_PROC_OFF.toobig.d			\
-	${TESTSRCDIR}/tst/common/pid/tst.addprobes.ksh 				\
-	${TESTSRCDIR}/tst/common/pid/tst.args1.c				\
-	${TESTSRCDIR}/tst/common/pid/tst.args1.d				\
-	${TESTSRCDIR}/tst/common/pid/tst.coverage.d				\
-	${TESTSRCDIR}/tst/common/pid/tst.emptystack.d				\
-	${TESTSRCDIR}/tst/common/pid/tst.float.c				\
-	${TESTSRCDIR}/tst/common/pid/tst.float.d				\
-	${TESTSRCDIR}/tst/common/pid/tst.fork.c					\
-	${TESTSRCDIR}/tst/common/pid/tst.fork.d					\
-	${TESTSRCDIR}/tst/common/pid/tst.gcc.c					\
-	${TESTSRCDIR}/tst/common/pid/tst.gcc.d					\
-	${TESTSRCDIR}/tst/common/pid/tst.main.ksh				\
-	${TESTSRCDIR}/tst/common/pid/tst.manypids.ksh				\
-	${TESTSRCDIR}/tst/common/pid/tst.probemod.ksh				\
-	${TESTSRCDIR}/tst/common/pid/tst.provregex1.ksh				\
-	${TESTSRCDIR}/tst/common/pid/tst.provregex2.ksh				\
-	${TESTSRCDIR}/tst/common/pid/tst.provregex3.ksh				\
-	${TESTSRCDIR}/tst/common/pid/tst.provregex4.ksh				\
-	${TESTSRCDIR}/tst/common/pid/tst.ret1.c					\
-	${TESTSRCDIR}/tst/common/pid/tst.ret1.d					\
-	${TESTSRCDIR}/tst/common/pid/tst.ret2.c					\
-	${TESTSRCDIR}/tst/common/pid/tst.ret2.d					\
-	${TESTSRCDIR}/tst/common/pid/tst.vfork.c				\
-	${TESTSRCDIR}/tst/common/pid/tst.vfork.d				\
-	${TESTSRCDIR}/tst/common/pid/tst.weak1.c				\
-	${TESTSRCDIR}/tst/common/pid/tst.weak1.d				\
-	${TESTSRCDIR}/tst/common/pid/tst.weak2.c				\
-	${TESTSRCDIR}/tst/common/pid/tst.weak2.d				\
-	${TESTSRCDIR}/tst/common/plockstat/tst.available.d			\
-	${TESTSRCDIR}/tst/common/plockstat/tst.libmap.d				\
-	${TESTSRCDIR}/tst/common/pointers/err.D_OP_LVAL.AddressChange.d		\
-	${TESTSRCDIR}/tst/common/pointers/tst.GlobalVar.d			\
-	${TESTSRCDIR}/tst/common/pointers/tst.basic1.d				\
-	${TESTSRCDIR}/tst/common/pointers/tst.basic2.d				\
-	${TESTSRCDIR}/tst/common/predicates/tst.argsnotcached.d			\
-	${TESTSRCDIR}/tst/common/printa/tst.walltimestamp.ksh			\
-	${TESTSRCDIR}/tst/common/printf/tst.basics.d				\
-	${TESTSRCDIR}/tst/common/printf/tst.printT.ksh				\
-	${TESTSRCDIR}/tst/common/printf/tst.printY.ksh				\
-	${TESTSRCDIR}/tst/common/printf/tst.str.d				\
-	${TESTSRCDIR}/tst/common/printf/tst.sym.d				\
-	${TESTSRCDIR}/tst/common/privs/tst.func_access.ksh			\
-	${TESTSRCDIR}/tst/common/privs/tst.op_access.ksh			\
-	${TESTSRCDIR}/tst/common/proc/tst.discard.ksh				\
-	${TESTSRCDIR}/tst/common/proc/tst.signal.ksh				\
-	${TESTSRCDIR}/tst/common/proc/tst.startexit.ksh				\
-	${TESTSRCDIR}/tst/common/profile-n/tst.ufuncsort.c			\
-	${TESTSRCDIR}/tst/common/scalars/tst.misc.d				\
-	${TESTSRCDIR}/tst/common/scalars/tst.selfarray2.d			\
-	${TESTSRCDIR}/tst/common/scripting/err.D_MACRO_UNDEF.invalidargs.d	\
-	${TESTSRCDIR}/tst/common/scripting/err.D_OP_LVAL.rdonly.d		\
-	${TESTSRCDIR}/tst/common/scripting/err.D_OP_WRITE.usepidmacro.d		\
-	${TESTSRCDIR}/tst/common/scripting/err.D_SYNTAX.concat.d		\
-	${TESTSRCDIR}/tst/common/scripting/err.D_SYNTAX.desc.d			\
-	${TESTSRCDIR}/tst/common/scripting/err.D_SYNTAX.inval.d			\
-	${TESTSRCDIR}/tst/common/scripting/err.D_SYNTAX.pid.d			\
-	${TESTSRCDIR}/tst/common/scripting/tst.arguments.ksh			\
-	${TESTSRCDIR}/tst/common/scripting/tst.egid.ksh				\
-	${TESTSRCDIR}/tst/common/scripting/tst.gid.ksh				\
-	${TESTSRCDIR}/tst/common/scripting/tst.projid.ksh			\
-	${TESTSRCDIR}/tst/common/scripting/tst.taskid.ksh			\
-	${TESTSRCDIR}/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithBreakPoint.d	\
-	${TESTSRCDIR}/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithChill.d	\
-	${TESTSRCDIR}/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithCopyOut.d	\
-	${TESTSRCDIR}/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithCopyOutStr.d	\
-	${TESTSRCDIR}/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithPanic.d	\
-	${TESTSRCDIR}/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithRaise.d	\
-	${TESTSRCDIR}/tst/common/speculation/err.D_ACT_SPEC.SpeculateWithStop.d	\
-	${TESTSRCDIR}/tst/common/syscall/tst.args.c				\
-	${TESTSRCDIR}/tst/common/syscall/tst.args.d				\
-	${TESTSRCDIR}/tst/common/syscall/tst.openret.ksh			\
-	${TESTSRCDIR}/tst/common/sysevent/tst.post.c				\
-	${TESTSRCDIR}/tst/common/sysevent/tst.post.d				\
-	${TESTSRCDIR}/tst/common/sysevent/tst.post_chan.c			\
-	${TESTSRCDIR}/tst/common/sysevent/tst.post_chan.d			\
-	${TESTSRCDIR}/tst/common/trace/tst.misc.d				\
-	${TESTSRCDIR}/tst/common/tracemem/err.D_TRACEMEM_ADDR.badaddr.d		\
-	${TESTSRCDIR}/tst/common/tracemem/tst.rootvp.d				\
-	${TESTSRCDIR}/tst/common/translators/tst.ProcModelTrans.d		\
-	${TESTSRCDIR}/tst/common/types/err.D_XLATE_REDECL.ResultDynType.d	\
-	${TESTSRCDIR}/tst/common/types/tst.ptrops.d				\
-	${TESTSRCDIR}/tst/common/types/tst.struct.d				\
-	${TESTSRCDIR}/tst/common/types/tst.typedef.d				\
-	${TESTSRCDIR}/tst/common/usdt/tst.argmap.c				\
-	${TESTSRCDIR}/tst/common/usdt/tst.args.c				\
-	${TESTSRCDIR}/tst/common/usdt/tst.forker.c				\
-	${TESTSRCDIR}/tst/common/ustack/tst.bigstack.c				\
-	${TESTSRCDIR}/tst/common/ustack/tst.spin.c				\
-	${TESTSRCDIR}/tst/common/vars/tst.ppid.d				\
-	${TESTSRCDIR}/tst/common/vars/tst.ucaller.ksh				\
-	${TESTSRCDIR}/tst/common/vars/tst.walltimestamp.d			\
+	${TESTSRCDIR}/tst/common/aggs/tst.subr.d			\
+	${TESTSRCDIR}/tst/common/buffering/tst.cputime.ksh		\
+	${TESTSRCDIR}/tst/common/buffering/tst.ring3.d			\
+	${TESTSRCDIR}/tst/common/cpc/err.D_PDESC_ZERO.lowfrequency.d	\
+	${TESTSRCDIR}/tst/common/cpc/err.D_PDESC_ZERO.malformedoverflow.d\
+	${TESTSRCDIR}/tst/common/cpc/err.D_PDESC_ZERO.nonexistentevent.d\
+	${TESTSRCDIR}/tst/common/cpc/err.cpcvscpustatpart1.ksh		\
+	${TESTSRCDIR}/tst/common/cpc/err.cpcvscpustatpart2.ksh		\
+	${TESTSRCDIR}/tst/common/cpc/err.cputrackfailtostart.ksh	\
+	${TESTSRCDIR}/tst/common/cpc/err.cputrackterminates.ksh		\
+	${TESTSRCDIR}/tst/common/cpc/err.toomanyenablings.d		\
+	${TESTSRCDIR}/tst/common/cpc/tst.allcpus.ksh			\
+	${TESTSRCDIR}/tst/common/cpc/tst.genericevent.d			\
+	${TESTSRCDIR}/tst/common/cpc/tst.platformevent.ksh		\
+	${TESTSRCDIR}/tst/common/dtraceUtil/man.ListProbesWithFunctions	\
+	${TESTSRCDIR}/tst/common/dtraceUtil/man.ListProbesWithModules	\
+	${TESTSRCDIR}/tst/common/dtraceUtil/man.ListProbesWithNames	\
+	${TESTSRCDIR}/tst/common/dtraceUtil/man.ListProbesWithProviders	\
+	${TESTSRCDIR}/tst/common/dtraceUtil/man.TraceFunctions		\
+	${TESTSRCDIR}/tst/common/dtraceUtil/man.TraceModule		\
+	${TESTSRCDIR}/tst/common/dtraceUtil/man.TraceNames		\
+	${TESTSRCDIR}/tst/common/dtraceUtil/man.TraceProvider		\
+	${TESTSRCDIR}/tst/common/dtraceUtil/tst.InvalidModule3.d.ksh	\
+	${TESTSRCDIR}/tst/common/dtraceUtil/tst.InvalidProvider3.d.ksh	\
+	${TESTSRCDIR}/tst/common/dtraceUtil/tst.InvalidTraceFunc7.d.ksh	\
+	${TESTSRCDIR}/tst/common/dtraceUtil/tst.InvalidTraceModule6.d.ksh\
+	${TESTSRCDIR}/tst/common/dtraceUtil/tst.InvalidTraceProvider4.d.ksh\
+	${TESTSRCDIR}/tst/common/funcs/tst.bcopy.d			\
+	${TESTSRCDIR}/tst/common/funcs/tst.copyin.d			\
+	${TESTSRCDIR}/tst/common/funcs/tst.copyinto.d			\
+	${TESTSRCDIR}/tst/common/funcs/tst.ddi_pathname.d		\
+	${TESTSRCDIR}/tst/common/funcs/tst.index.d			\
+	${TESTSRCDIR}/tst/common/inline/err.D_OP_INCOMPAT.badxlate.d	\
+	${TESTSRCDIR}/tst/common/inline/tst.InlineTypedef.d		\
+	${TESTSRCDIR}/tst/common/io/tst.fds.c				\
+	${TESTSRCDIR}/tst/common/java_api/tst.FunctionLookup.c		\
+	${TESTSRCDIR}/tst/common/java_api/tst.ProbeData.c		\
+	${TESTSRCDIR}/common/misc/tst.include.ksh			\
+	${TESTSRCDIR}/tst/common/misc/tst.roch.d			\
+	${TESTSRCDIR}/tst/common/nfs/tst.call.c				\
+	${TESTSRCDIR}/tst/common/nfs/tst.call.d				\
+	${TESTSRCDIR}/tst/common/nfs/tst.call3.c			\
+	${TESTSRCDIR}/tst/common/nfs/tst.call3.d			\
+	${TESTSRCDIR}/tst/common/offsetof/err.D_OFFSETOF_BITFIELD.bitfield.d\
+	${TESTSRCDIR}/tst/common/pointers/err.D_OP_LVAL.AddressChange.d	\
+	${TESTSRCDIR}/tst/common/pointers/tst.GlobalVar.d		\
+	${TESTSRCDIR}/tst/common/pointers/tst.basic1.d			\
+	${TESTSRCDIR}/tst/common/pointers/tst.basic2.d			\
+	${TESTSRCDIR}/tst/common/predicates/tst.argsnotcached.d		\
+	${TESTSRCDIR}/tst/common/privs/tst.func_access.ksh		\
+	${TESTSRCDIR}/tst/common/privs/tst.op_access.ksh		\
+	${TESTSRCDIR}/tst/common/proc/tst.discard.ksh			\
+	${TESTSRCDIR}/tst/common/proc/tst.signal.ksh			\
+	${TESTSRCDIR}/tst/common/proc/tst.startexit.ksh			\
+	${TESTSRCDIR}/tst/common/profile-n/tst.ufuncsort.c		\
+	${TESTSRCDIR}/tst/common/scalars/tst.misc.d			\
+	${TESTSRCDIR}/tst/common/scalars/tst.selfarray2.d		\
+	${TESTSRCDIR}/tst/common/sysevent/tst.post.c			\
+	${TESTSRCDIR}/tst/common/sysevent/tst.post.d			\
+	${TESTSRCDIR}/tst/common/sysevent/tst.post_chan.c		\
+	${TESTSRCDIR}/tst/common/sysevent/tst.post_chan.d		\
+	${TESTSRCDIR}/tst/common/trace/tst.misc.d			\
+	${TESTSRCDIR}/tst/common/tracemem/err.D_TRACEMEM_ADDR.badaddr.d	\
+	${TESTSRCDIR}/tst/common/tracemem/tst.rootvp.d			\
+	${TESTSRCDIR}/tst/common/translators/tst.ProcModelTrans.d	\
+	${TESTSRCDIR}/tst/common/types/err.D_XLATE_REDECL.ResultDynType.d\
+	${TESTSRCDIR}/tst/common/types/tst.ptrops.d			\
+	${TESTSRCDIR}/tst/common/types/tst.struct.d			\
+	${TESTSRCDIR}/tst/common/types/tst.typedef.d			\
+	${TESTSRCDIR}/tst/common/vars/tst.ucaller.ksh			\
+	${TESTSRCDIR}/tst/common/vars/tst.walltimestamp.d		\
+	${TESTSRCDIR}/tst/common/usdt/tst.argmap.c			\
+	${TESTSRCDIR}/tst/common/usdt/tst.args.c			\
+	${TESTSRCDIR}/tst/common/usdt/tst.forker.c			\
+	${TESTSRCDIR}/tst/common/ip/tst.ipv4localtcp.ksh		\
+	${TESTSRCDIR}/tst/common/ip/tst.ipv4localudp.ksh		\
+	${TESTSRCDIR}/tst/common/ip/tst.ipv4remotetcp.ksh		\
+	${TESTSRCDIR}/tst/common/ip/tst.ipv4remoteudp.ksh		\
+	${TESTSRCDIR}/tst/common/ip/tst.localtcpstate.ksh		\
+	${TESTSRCDIR}/tst/common/ip/tst.remotetcpstate.ksh		\
+	${TESTSRCDIR}/tst/common/scripting/tst.projid.ksh		\
+	${TESTSRCDIR}/tst/common/scripting/tst.taskid.ksh
+
+
 
 NOTWORK+= \
-	${TESTSRCDIR}/tst/common/io/tst.fds.d					\
-	${TESTSRCDIR}/tst/common/java_api/tst.Abort.ksh				\
-	${TESTSRCDIR}/tst/common/java_api/tst.Bean.ksh				\
-	${TESTSRCDIR}/tst/common/java_api/tst.Close.ksh				\
-	${TESTSRCDIR}/tst/common/java_api/tst.Drop.ksh				\
-	${TESTSRCDIR}/tst/common/java_api/tst.Enable.ksh			\
-	${TESTSRCDIR}/tst/common/java_api/tst.FunctionLookup.ksh		\
-	${TESTSRCDIR}/tst/common/java_api/tst.MaxConsumers.ksh			\
-	${TESTSRCDIR}/tst/common/java_api/tst.MultiAggPrinta.ksh		\
-	${TESTSRCDIR}/tst/common/java_api/tst.ProbeData.ksh			\
-	${TESTSRCDIR}/tst/common/java_api/tst.ProbeDescription.ksh		\
-	${TESTSRCDIR}/tst/common/java_api/tst.StateMachine.ksh			\
-	${TESTSRCDIR}/tst/common/java_api/tst.StopLock.ksh 			\
-	${TESTSRCDIR}/tst/common/java_api/tst.printa.d				\
-	${TESTSRCDIR}/tst/common/lexer/err.D_CHR_NL.char.d			\
-	${TESTSRCDIR}/tst/common/lexer/err.D_STR_NL.string.d			\
-	${TESTSRCDIR}/tst/common/mdb/tst.dtracedcmd.ksh				\
-	${TESTSRCDIR}/tst/common/mib/tst.icmp.ksh				\
-	${TESTSRCDIR}/tst/common/mib/tst.tcp.ksh				\
-	${TESTSRCDIR}/tst/common/mib/tst.udp.ksh				\
-	${TESTSRCDIR}/tst/common/profile-n/tst.func.ksh				\
-	${TESTSRCDIR}/tst/common/profile-n/tst.mod.ksh				\
-	${TESTSRCDIR}/tst/common/profile-n/tst.sym.ksh				\
-	${TESTSRCDIR}/tst/common/profile-n/tst.ufunc.ksh			\
-	${TESTSRCDIR}/tst/common/profile-n/tst.ufuncsort.ksh			\
-	${TESTSRCDIR}/tst/common/profile-n/tst.umod.ksh				\
-	${TESTSRCDIR}/tst/common/profile-n/tst.usym.ksh				\
-	${TESTSRCDIR}/tst/common/safety/tst.basename.d				\
-	${TESTSRCDIR}/tst/common/safety/tst.caller.d				\
-	${TESTSRCDIR}/tst/common/safety/tst.cleanpath.d				\
-	${TESTSRCDIR}/tst/common/safety/tst.copyin.d				\
-	${TESTSRCDIR}/tst/common/safety/tst.copyin2.d				\
-	${TESTSRCDIR}/tst/common/safety/tst.ddi_pathname.d			\
-	${TESTSRCDIR}/tst/common/safety/tst.dirname.d				\
-	${TESTSRCDIR}/tst/common/safety/tst.errno.d				\
-	${TESTSRCDIR}/tst/common/safety/tst.execname.d				\
-	${TESTSRCDIR}/tst/common/safety/tst.gid.d				\
-	${TESTSRCDIR}/tst/common/safety/tst.hton.d				\
-	${TESTSRCDIR}/tst/common/safety/tst.index.d				\
-	${TESTSRCDIR}/tst/common/safety/tst.msgdsize.d				\
-	${TESTSRCDIR}/tst/common/safety/tst.msgsize.d				\
-	${TESTSRCDIR}/tst/common/safety/tst.null.d				\
-	${TESTSRCDIR}/tst/common/safety/tst.pid.d				\
-	${TESTSRCDIR}/tst/common/safety/tst.ppid.d				\
-	${TESTSRCDIR}/tst/common/safety/tst.progenyof.d				\
-	${TESTSRCDIR}/tst/common/safety/tst.random.d				\
-	${TESTSRCDIR}/tst/common/safety/tst.rw.d				\
-	${TESTSRCDIR}/tst/common/safety/tst.shortstr.d				\
-	${TESTSRCDIR}/tst/common/safety/tst.stack.d				\
-	${TESTSRCDIR}/tst/common/safety/tst.stackdepth.d			\
-	${TESTSRCDIR}/tst/common/safety/tst.stddev.d				\
-	${TESTSRCDIR}/tst/common/safety/tst.strchr.d				\
-	${TESTSRCDIR}/tst/common/safety/tst.strjoin.d				\
-	${TESTSRCDIR}/tst/common/safety/tst.strstr.d				\
-	${TESTSRCDIR}/tst/common/safety/tst.strtok.d				\
-	${TESTSRCDIR}/tst/common/safety/tst.substr.d				\
-	${TESTSRCDIR}/tst/common/safety/tst.ucaller.d				\
-	${TESTSRCDIR}/tst/common/safety/tst.uid.d				\
-	${TESTSRCDIR}/tst/common/safety/tst.unalign.d				\
-	${TESTSRCDIR}/tst/common/safety/tst.uregs.d				\
-	${TESTSRCDIR}/tst/common/safety/tst.ustack.d				\
-	${TESTSRCDIR}/tst/common/safety/tst.ustackdepth.d			\
-	${TESTSRCDIR}/tst/common/safety/tst.vahole.d				\
-	${TESTSRCDIR}/tst/common/safety/tst.violentdeath.ksh			\
-	${TESTSRCDIR}/tst/common/safety/tst.zonename.d				\
-	${TESTSRCDIR}/tst/common/sched/tst.enqueue.d				\
-	${TESTSRCDIR}/tst/common/sched/tst.oncpu.d				\
-	${TESTSRCDIR}/tst/common/sched/tst.stackdepth.d				\
-	${TESTSRCDIR}/tst/common/usdt/argmap.d					\
-	${TESTSRCDIR}/tst/common/usdt/args.d					\
-	${TESTSRCDIR}/tst/common/usdt/forker.d					\
-	${TESTSRCDIR}/tst/common/usdt/tst.andpid.ksh				\
-	${TESTSRCDIR}/tst/common/usdt/tst.argmap.d				\
-	${TESTSRCDIR}/tst/common/usdt/tst.args.d				\
-	${TESTSRCDIR}/tst/common/usdt/tst.badguess.ksh				\
-	${TESTSRCDIR}/tst/common/usdt/tst.dlclose1.ksh				\
-	${TESTSRCDIR}/tst/common/usdt/tst.dlclose2.ksh				\
-	${TESTSRCDIR}/tst/common/usdt/tst.dlclose3.ksh				\
-	${TESTSRCDIR}/tst/common/usdt/tst.eliminate.ksh				\
-	${TESTSRCDIR}/tst/common/usdt/tst.enabled.ksh				\
-	${TESTSRCDIR}/tst/common/usdt/tst.entryreturn.ksh			\
-	${TESTSRCDIR}/tst/common/usdt/tst.fork.ksh				\
-	${TESTSRCDIR}/tst/common/usdt/tst.forker.ksh				\
-	${TESTSRCDIR}/tst/common/usdt/tst.guess32.ksh				\
-	${TESTSRCDIR}/tst/common/usdt/tst.guess64.ksh				\
-	${TESTSRCDIR}/tst/common/usdt/tst.header.ksh				\
-	${TESTSRCDIR}/tst/common/usdt/tst.include.ksh				\
-	${TESTSRCDIR}/tst/common/usdt/tst.linkpriv.ksh				\
-	${TESTSRCDIR}/tst/common/usdt/tst.linkunpriv.ksh			\
-	${TESTSRCDIR}/tst/common/usdt/tst.multiple.ksh				\
-	${TESTSRCDIR}/tst/common/usdt/tst.nodtrace.ksh				\
-	${TESTSRCDIR}/tst/common/usdt/tst.onlyenabled.ksh			\
-	${TESTSRCDIR}/tst/common/usdt/tst.reeval.ksh				\
-	${TESTSRCDIR}/tst/common/usdt/tst.static.ksh				\
-	${TESTSRCDIR}/tst/common/usdt/tst.static2.ksh				\
-	${TESTSRCDIR}/tst/common/usdt/tst.user.ksh				\
-	${TESTSRCDIR}/tst/common/ustack/tst.bigstack.d				\
-	${TESTSRCDIR}/tst/common/ustack/tst.depth.ksh				\
-	${TESTSRCDIR}/tst/common/ustack/tst.spin.ksh				\
+	${TESTSRCDIR}/tst/common/io/tst.fds.d				\
+	${TESTSRCDIR}/tst/common/java_api/tst.Abort.ksh			\
+	${TESTSRCDIR}/tst/common/java_api/tst.Bean.ksh			\
+	${TESTSRCDIR}/tst/common/java_api/tst.Close.ksh			\
+	${TESTSRCDIR}/tst/common/java_api/tst.Drop.ksh			\
+	${TESTSRCDIR}/tst/common/java_api/tst.Enable.ksh		\
+	${TESTSRCDIR}/tst/common/java_api/tst.FunctionLookup.ksh	\
+	${TESTSRCDIR}/tst/common/java_api/tst.GetAggregate.ksh		\
+	${TESTSRCDIR}/tst/common/java_api/tst.MaxConsumers.ksh		\
+	${TESTSRCDIR}/tst/common/java_api/tst.MultiAggPrinta.ksh	\
+	${TESTSRCDIR}/tst/common/java_api/tst.ProbeData.ksh		\
+	${TESTSRCDIR}/tst/common/java_api/tst.ProbeDescription.ksh	\
+	${TESTSRCDIR}/tst/common/java_api/tst.StateMachine.ksh		\
+	${TESTSRCDIR}/tst/common/java_api/tst.StopLock.ksh 		\
+	${TESTSRCDIR}/tst/common/java_api/tst.printa.d			\
+	${TESTSRCDIR}/tst/common/lexer/err.D_CHR_NL.char.d		\
+	${TESTSRCDIR}/tst/common/lexer/err.D_STR_NL.string.d		\
+	${TESTSRCDIR}/tst/common/mdb/tst.dtracedcmd.ksh			\
+	${TESTSRCDIR}/tst/common/mib/tst.icmp.ksh			\
+	${TESTSRCDIR}/tst/common/mib/tst.tcp.ksh			\
+	${TESTSRCDIR}/tst/common/mib/tst.udp.ksh			\
+	${TESTSRCDIR}/tst/common/profile-n/tst.func.ksh			\
+	${TESTSRCDIR}/tst/common/profile-n/tst.mod.ksh			\
+	${TESTSRCDIR}/tst/common/profile-n/tst.sym.ksh			\
+	${TESTSRCDIR}/tst/common/profile-n/tst.ufunc.ksh		\
+	${TESTSRCDIR}/tst/common/profile-n/tst.ufuncsort.ksh		\
+	${TESTSRCDIR}/tst/common/profile-n/tst.umod.ksh			\
+	${TESTSRCDIR}/tst/common/profile-n/tst.usym.ksh			\
+	${TESTSRCDIR}/tst/common/safety/tst.basename.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.caller.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.cleanpath.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.copyin.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.copyin2.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.ddi_pathname.d		\
+	${TESTSRCDIR}/tst/common/safety/tst.dirname.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.errno.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.execname.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.gid.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.hton.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.index.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.msgdsize.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.msgsize.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.null.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.pid.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.ppid.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.progenyof.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.random.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.rw.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.shortstr.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.stack.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.stackdepth.d		\
+	${TESTSRCDIR}/tst/common/safety/tst.stddev.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.strchr.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.strjoin.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.strstr.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.strtok.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.substr.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.ucaller.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.uid.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.unalign.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.ustack.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.ustackdepth.d		\
+	${TESTSRCDIR}/tst/common/safety/tst.vahole.d			\
+	${TESTSRCDIR}/tst/common/safety/tst.violentdeath.ksh		\
+	${TESTSRCDIR}/tst/common/safety/tst.zonename.d			\
+	${TESTSRCDIR}/tst/common/sched/tst.enqueue.d			\
+	${TESTSRCDIR}/tst/common/sched/tst.oncpu.d			\
+	${TESTSRCDIR}/tst/common/sched/tst.stackdepth.d			\
+	${TESTSRCDIR}/tst/common/sdt/tst.sdtargs.d			\
+	${TESTSRCDIR}/tst/common/usdt/argmap.d				\
+	${TESTSRCDIR}/tst/common/usdt/args.d				\
+	${TESTSRCDIR}/tst/common/usdt/forker.d				\
+	${TESTSRCDIR}/tst/common/usdt/tst.andpid.ksh			\
+	${TESTSRCDIR}/tst/common/usdt/tst.argmap.d			\
+	${TESTSRCDIR}/tst/common/usdt/tst.args.d			\
+	${TESTSRCDIR}/tst/common/usdt/tst.badguess.ksh			\
+	${TESTSRCDIR}/tst/common/usdt/tst.dlclose1.ksh			\
+	${TESTSRCDIR}/tst/common/usdt/tst.dlclose2.ksh			\
+	${TESTSRCDIR}/tst/common/usdt/tst.dlclose3.ksh			\
+	${TESTSRCDIR}/tst/common/usdt/tst.eliminate.ksh			\
+	${TESTSRCDIR}/tst/common/usdt/tst.enabled.ksh			\
+	${TESTSRCDIR}/tst/common/usdt/tst.entryreturn.ksh		\
+	${TESTSRCDIR}/tst/common/usdt/tst.fork.ksh			\
+	${TESTSRCDIR}/tst/common/usdt/tst.forker.ksh			\
+	${TESTSRCDIR}/tst/common/usdt/tst.guess32.ksh			\
+	${TESTSRCDIR}/tst/common/usdt/tst.guess64.ksh			\
+	${TESTSRCDIR}/tst/common/usdt/tst.header.ksh			\
+	${TESTSRCDIR}/tst/common/usdt/tst.include.ksh			\
+	${TESTSRCDIR}/tst/common/usdt/tst.linkpriv.ksh			\
+	${TESTSRCDIR}/tst/common/usdt/tst.linkunpriv.ksh		\
+	${TESTSRCDIR}/tst/common/usdt/tst.multiple.ksh			\
+	${TESTSRCDIR}/tst/common/usdt/tst.nodtrace.ksh			\
+	${TESTSRCDIR}/tst/common/usdt/tst.onlyenabled.ksh		\
+	${TESTSRCDIR}/tst/common/usdt/tst.reeval.ksh			\
+	${TESTSRCDIR}/tst/common/usdt/tst.static.ksh			\
+	${TESTSRCDIR}/tst/common/usdt/tst.static2.ksh			\
+	${TESTSRCDIR}/tst/common/usdt/tst.user.ksh			\
+	${TESTSRCDIR}/tst/common/misc/tst.schrock.ksh 
 
 # --------------------------------------------------------------------------------
 # Tests that just don't complete (even to fail) at the moment...
 
 NOTWORK+= \
-	${TESTSRCDIR}/tst/common/dtraceUtil/tst.ZeroModuleProbes.d.ksh		\
-	${TESTSRCDIR}/tst/common/printa/tst.many.d				\
-	${TESTSRCDIR}/tst/common/scalars/err.D_OP_INCOMPAT.dupgtype.d		\
-	${TESTSRCDIR}/tst/common/scalars/err.D_OP_INCOMPAT.dupltype.d		\
-	${TESTSRCDIR}/tst/common/scalars/err.D_OP_INCOMPAT.dupttype.d		\
-	${TESTSRCDIR}/tst/common/vars/tst.gid.d					\
-	${TESTSRCDIR}/tst/common/vars/tst.uid.d					\
+	${TESTSRCDIR}/tst/common/dtraceUtil/tst.ZeroModuleProbes.d.ksh	\
+	${TESTSRCDIR}/tst/common/printa/tst.many.d			\
+	${TESTSRCDIR}/tst/common/scalars/err.D_OP_INCOMPAT.dupgtype.d	\
+	${TESTSRCDIR}/tst/common/scalars/err.D_OP_INCOMPAT.dupltype.d	\
+	${TESTSRCDIR}/tst/common/scalars/err.D_OP_INCOMPAT.dupttype.d	\
+	${TESTSRCDIR}/tst/common/vars/tst.gid.d				\
+	${TESTSRCDIR}/tst/common/vars/tst.uid.d				\
 
 # --------------------------------------------------------------------------------
 # Tests that currently hang the system:
@@ -276,10 +208,10 @@ NOTWORK+= \
 NOTWORK+= \
 	${TESTSRCDIR}/tst/common/fbtprovider/tst.basic.d	\
 	${TESTSRCDIR}/tst/common/fbtprovider/tst.return.d	\
-	${TESTSRCDIR}/tst/common/grammar/tst.stmts.d	\
+	${TESTSRCDIR}/tst/common/grammar/tst.stmts.d		\
 	${TESTSRCDIR}/tst/common/misc/tst.enablerace.ksh	\
-	${TESTSRCDIR}/tst/common/predicates/tst.predcache.ksh			\
-	${TESTSRCDIR}/tst/common/proc/tst.exitkilled.ksh			\
+	${TESTSRCDIR}/tst/common/predicates/tst.predcache.ksh	\
+	${TESTSRCDIR}/tst/common/proc/tst.exitkilled.ksh	\
 
 .if ${MACHINE_ARCH} == "i386"
 
@@ -320,10 +252,14 @@ NOTWORK+= ${TESTSRCDIR}/tst/common/built
 	${TESTSRCDIR}/tst/common/builtinvar/tst.ipl1.d
 
 # --------------------------------------------------------------------------------
-# This test relies on the Solaris ping behaviour of exiting after a number of
+# These tests relies on the Solaris ping behaviour of exiting after a number of
 # pings. On FreeBSD ping doesn't do that.
 
-NOTWORK+= ${TESTSRCDIR}/tst/common/funcs/tst.system.d
+NOTWORK+= ${TESTSRCDIR}/tst/common/funcs/tst.system.d 		\
+	${TESTSRCDIR}/tst/common/ip/tst.ipv6remoteicmp.ksh 	\
+	${TESTSRCDIR}/tst/common/ip/tst.ipv6localicmp.ksh 	\
+	${TESTSRCDIR}/tst/common/ip/tst.ipv4localicmp.ksh 	\
+	${TESTSRCDIR}/tst/common/ip/tst.ipv4remoteicmp.ksh 
 
 # --------------------------------------------------------------------------------
 # This test checks for a leading tab on a line before #define. That is illegal

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 14:16:53 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CD9C71065693;
	Sat, 21 Aug 2010 14:16:53 +0000 (UTC)
	(envelope-from rpaulo@freebsd.org)
Received: from karen.lavabit.com (karen.lavabit.com [72.249.41.33])
	by mx1.freebsd.org (Postfix) with ESMTP id A5B278FC0A;
	Sat, 21 Aug 2010 14:16:53 +0000 (UTC)
Received: from d.earth.lavabit.com (d.earth.lavabit.com [192.168.111.13])
	by karen.lavabit.com (Postfix) with ESMTP id D5FEA11BAD1;
	Sat, 21 Aug 2010 09:16:52 -0500 (CDT)
Received: from 10.0.10.3 (54.81.54.77.rev.vodafone.pt [77.54.81.54])
	by lavabit.com with ESMTP id YPGRCWZQ2SVK;
	Sat, 21 Aug 2010 09:16:52 -0500
Mime-Version: 1.0 (Apple Message framework v1081)
Content-Type: text/plain; charset=us-ascii
From: Rui Paulo 
In-Reply-To: <20100821135908.GT2396@deviant.kiev.zoral.com.ua>
Date: Sat, 21 Aug 2010 15:16:49 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <64B55A11-14C3-4297-93F6-40BA74854F98@FreeBSD.org>
References: <201008211348.o7LDm55c070981@svn.freebsd.org>
	<20100821135908.GT2396@deviant.kiev.zoral.com.ua>
To: Kostik Belousov 
X-Mailer: Apple Mail (2.1081)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r211561 - head/cddl/lib/drti
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 14:16:53 -0000


On 21 Aug 2010, at 14:59, Kostik Belousov wrote:

> On Sat, Aug 21, 2010 at 01:48:05PM +0000, Rui Paulo wrote:
>> Author: rpaulo
>> Date: Sat Aug 21 13:48:04 2010
>> New Revision: 211561
>> URL: http://svn.freebsd.org/changeset/base/211561
>>=20
>> Log:
>>  Link drti.o with a PIC version of libelf. This is needed because
>>  drti.o depends on libelf and this avoids linking every other drti.o
>>  program (namely programs with USDT probes) with libelf.
> What is wrong with having libelf as dependency of the resulting
> binary ?

The resulting binary can be a library. If I add drti.o to the libthr =
library, every other program will break because it can't find libelf =
symbols. The only way to fix it would be to rebuild every program that =
depends on libthr and I don't want that to happen.

Regards,
--
Rui Paulo



From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 14:23:44 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7AA2F106566B;
	Sat, 21 Aug 2010 14:23:44 +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 E84018FC12;
	Sat, 21 Aug 2010 14:23:43 +0000 (UTC)
Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua
	[10.1.1.148])
	by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o7LENega073027
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Sat, 21 Aug 2010 17:23:40 +0300 (EEST)
	(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.4/8.14.4) with ESMTP id
	o7LENeYR091890; Sat, 21 Aug 2010 17:23:40 +0300 (EEST)
	(envelope-from kostikbel@gmail.com)
Received: (from kostik@localhost)
	by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o7LENe2A091889; 
	Sat, 21 Aug 2010 17:23:40 +0300 (EEST)
	(envelope-from kostikbel@gmail.com)
X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to
	kostikbel@gmail.com using -f
Date: Sat, 21 Aug 2010 17:23:40 +0300
From: Kostik Belousov 
To: Rui Paulo 
Message-ID: <20100821142340.GU2396@deviant.kiev.zoral.com.ua>
References: <201008211348.o7LDm55c070981@svn.freebsd.org>
	<20100821135908.GT2396@deviant.kiev.zoral.com.ua>
	<64B55A11-14C3-4297-93F6-40BA74854F98@FreeBSD.org>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="39O/V63PqfeKD+Ez"
Content-Disposition: inline
In-Reply-To: <64B55A11-14C3-4297-93F6-40BA74854F98@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=-2.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_40,
	DNS_FROM_OPENWHOIS autolearn=no 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: r211561 - head/cddl/lib/drti
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 14:23:44 -0000


--39O/V63PqfeKD+Ez
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Aug 21, 2010 at 03:16:49PM +0100, Rui Paulo wrote:
>=20
> On 21 Aug 2010, at 14:59, Kostik Belousov wrote:
>=20
> > On Sat, Aug 21, 2010 at 01:48:05PM +0000, Rui Paulo wrote:
> >> Author: rpaulo
> >> Date: Sat Aug 21 13:48:04 2010
> >> New Revision: 211561
> >> URL: http://svn.freebsd.org/changeset/base/211561
> >>=20
> >> Log:
> >>  Link drti.o with a PIC version of libelf. This is needed because
> >>  drti.o depends on libelf and this avoids linking every other drti.o
> >>  program (namely programs with USDT probes) with libelf.
> > What is wrong with having libelf as dependency of the resulting
> > binary ?
>=20
> The resulting binary can be a library. If I add drti.o to the libthr
> library, every other program will break because it can't find libelf
> symbols. The only way to fix it would be to rebuild every program that
> depends on libthr and I don't want that to happen.

I do not understand this. If drti.o is added to a library, library should
also record a dependency on libelf, i.e. be linked with it. Since you
already modifying link command to add drti.o, what is the problem to
add -lelf ?

--39O/V63PqfeKD+Ez
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAkxv4WwACgkQC3+MBN1Mb4gl+wCgt42/LduJy9MMQXiqCz/JrtDc
CYwAmwaRSI7iNR+rNuKxuvyn1joyTbU6
=7qh/
-----END PGP SIGNATURE-----

--39O/V63PqfeKD+Ez--

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 14:28:48 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 903BC1065679;
	Sat, 21 Aug 2010 14:28:48 +0000 (UTC)
	(envelope-from marius@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 812418FC08;
	Sat, 21 Aug 2010 14:28:48 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LESmIN072115;
	Sat, 21 Aug 2010 14:28:48 GMT (envelope-from marius@svn.freebsd.org)
Received: (from marius@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LESmab072113;
	Sat, 21 Aug 2010 14:28:48 GMT (envelope-from marius@svn.freebsd.org)
Message-Id: <201008211428.o7LESmab072113@svn.freebsd.org>
From: Marius Strobl 
Date: Sat, 21 Aug 2010 14:28: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: r211568 - head/sys/sparc64/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: Sat, 21 Aug 2010 14:28:48 -0000

Author: marius
Date: Sat Aug 21 14:28:48 2010
New Revision: 211568
URL: http://svn.freebsd.org/changeset/base/211568

Log:
  Skip a KASSERT which isn't appropriate when not employing page coloring.
  Reported by: Michael Moll

Modified:
  head/sys/sparc64/sparc64/pmap.c

Modified: head/sys/sparc64/sparc64/pmap.c
==============================================================================
--- head/sys/sparc64/sparc64/pmap.c	Sat Aug 21 14:14:24 2010	(r211567)
+++ head/sys/sparc64/sparc64/pmap.c	Sat Aug 21 14:28:48 2010	(r211568)
@@ -833,14 +833,15 @@ pmap_cache_remove(vm_page_t m, vm_offset
 	    m->md.colors[DCACHE_COLOR(va)]);
 	KASSERT((m->flags & PG_FICTITIOUS) == 0,
 	    ("pmap_cache_remove: fake page"));
-	KASSERT(m->md.colors[DCACHE_COLOR(va)] > 0,
-	    ("pmap_cache_remove: no mappings %d <= 0",
-	    m->md.colors[DCACHE_COLOR(va)]));
 	PMAP_STATS_INC(pmap_ncache_remove);
 
 	if (dcache_color_ignore != 0)
 		return;
 
+	KASSERT(m->md.colors[DCACHE_COLOR(va)] > 0,
+	    ("pmap_cache_remove: no mappings %d <= 0",
+	    m->md.colors[DCACHE_COLOR(va)]));
+
 	/*
 	 * Find the color for this virtual address and note the removal of
 	 * the mapping.

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 14:33:39 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 45AFB106564A;
	Sat, 21 Aug 2010 14:33:39 +0000 (UTC)
	(envelope-from rpaulo@freebsd.org)
Received: from karen.lavabit.com (karen.lavabit.com [72.249.41.33])
	by mx1.freebsd.org (Postfix) with ESMTP id 1B9BF8FC15;
	Sat, 21 Aug 2010 14:33:38 +0000 (UTC)
Received: from d.earth.lavabit.com (d.earth.lavabit.com [192.168.111.13])
	by karen.lavabit.com (Postfix) with ESMTP id 89EFF11B9AF;
	Sat, 21 Aug 2010 09:33:38 -0500 (CDT)
Received: from 10.0.10.3 (54.81.54.77.rev.vodafone.pt [77.54.81.54])
	by lavabit.com with ESMTP id CHQXDMRO3O74;
	Sat, 21 Aug 2010 09:33:38 -0500
Mime-Version: 1.0 (Apple Message framework v1081)
Content-Type: text/plain; charset=us-ascii
From: Rui Paulo 
In-Reply-To: <20100821142340.GU2396@deviant.kiev.zoral.com.ua>
Date: Sat, 21 Aug 2010 15:33:35 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: 
References: <201008211348.o7LDm55c070981@svn.freebsd.org>
	<20100821135908.GT2396@deviant.kiev.zoral.com.ua>
	<64B55A11-14C3-4297-93F6-40BA74854F98@FreeBSD.org>
	<20100821142340.GU2396@deviant.kiev.zoral.com.ua>
To: Kostik Belousov 
X-Mailer: Apple Mail (2.1081)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r211561 - head/cddl/lib/drti
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 14:33:39 -0000


On 21 Aug 2010, at 15:23, Kostik Belousov wrote:

> On Sat, Aug 21, 2010 at 03:16:49PM +0100, Rui Paulo wrote:
>>=20
>> On 21 Aug 2010, at 14:59, Kostik Belousov wrote:
>>=20
>>> On Sat, Aug 21, 2010 at 01:48:05PM +0000, Rui Paulo wrote:
>>>> Author: rpaulo
>>>> Date: Sat Aug 21 13:48:04 2010
>>>> New Revision: 211561
>>>> URL: http://svn.freebsd.org/changeset/base/211561
>>>>=20
>>>> Log:
>>>> Link drti.o with a PIC version of libelf. This is needed because
>>>> drti.o depends on libelf and this avoids linking every other drti.o
>>>> program (namely programs with USDT probes) with libelf.
>>> What is wrong with having libelf as dependency of the resulting
>>> binary ?
>>=20
>> The resulting binary can be a library. If I add drti.o to the libthr
>> library, every other program will break because it can't find libelf
>> symbols. The only way to fix it would be to rebuild every program =
that
>> depends on libthr and I don't want that to happen.
>=20
> I do not understand this. If drti.o is added to a library, library =
should
> also record a dependency on libelf, i.e. be linked with it. Since you
> already modifying link command to add drti.o, what is the problem to
> add -lelf ?

I wanted the same steps to be done in FreeBSD as in Solaris. I.e., in =
Solaris you don't need to link with -lelf your program after you added =
DTrace probes to it.
I believe this is a good tradeoff.

Regards,
--
Rui Paulo



From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 14:59:37 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6A7721065695;
	Sat, 21 Aug 2010 14:59:37 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5B62C8FC15;
	Sat, 21 Aug 2010 14:59:37 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LExbJe072864;
	Sat, 21 Aug 2010 14:59:37 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LExbVx072862;
	Sat, 21 Aug 2010 14:59:37 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201008211459.o7LExbVx072862@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Aug 2010 14:59: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: r211570 - head/gnu/lib/libobjc
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 14:59:37 -0000

Author: rpaulo
Date: Sat Aug 21 14:59:37 2010
New Revision: 211570
URL: http://svn.freebsd.org/changeset/base/211570

Log:
  We need to pull bsd.own.mk before modifying the CC variable. Otherwise
  it will be overwritten when we include bsd.lib.mk.
  
  Pointed out by:	Dimitry Andric 

Modified:
  head/gnu/lib/libobjc/Makefile

Modified: head/gnu/lib/libobjc/Makefile
==============================================================================
--- head/gnu/lib/libobjc/Makefile	Sat Aug 21 14:50:16 2010	(r211569)
+++ head/gnu/lib/libobjc/Makefile	Sat Aug 21 14:59:37 2010	(r211570)
@@ -1,5 +1,7 @@
 # $FreeBSD$
 
+.include 
+
 OBJCDIR=${.CURDIR}/../../../contrib/libobjc
 GCCDIR=	${.CURDIR}/../../../contrib/gcc
 GCCLIB=	${.CURDIR}/../../../contrib/gcclibs

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 15:01:59 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6988B10656A5;
	Sat, 21 Aug 2010 15:01:59 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 5A90A8FC19;
	Sat, 21 Aug 2010 15:01:59 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LF1xJY072985;
	Sat, 21 Aug 2010 15:01:59 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LF1x7c072983;
	Sat, 21 Aug 2010 15:01:59 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201008211501.o7LF1x7c072983@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Aug 2010 15:01: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: r211571 - head/sys/boot/i386/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: Sat, 21 Aug 2010 15:01:59 -0000

Author: rpaulo
Date: Sat Aug 21 15:01:59 2010
New Revision: 211571
URL: http://svn.freebsd.org/changeset/base/211571

Log:
  Make sure the boot2 stage is compiled with gcc, as clang has no
  problems compiling it, but it just gets too big at the moment, even
  with -Os.  This is not applicable to gptboot, though.
  
  Submitted by:	Dimitry Andric 

Modified:
  head/sys/boot/i386/boot2/Makefile

Modified: head/sys/boot/i386/boot2/Makefile
==============================================================================
--- head/sys/boot/i386/boot2/Makefile	Sat Aug 21 14:59:37 2010	(r211570)
+++ head/sys/boot/i386/boot2/Makefile	Sat Aug 21 15:01:59 2010	(r211571)
@@ -1,5 +1,10 @@
 # $FreeBSD$
 
+.include 
+
+# XXX: clang can compile the boot code just fine, but boot2 gets too big
+CC:=${CC:C/^cc|^clang/gcc/}
+
 FILES=		boot boot1 boot2
 
 NM?=		nm

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 15:39:06 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 863E8106566C;
	Sat, 21 Aug 2010 15:39:06 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 773278FC16;
	Sat, 21 Aug 2010 15:39:06 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LFd6Y3073684;
	Sat, 21 Aug 2010 15:39:06 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LFd6HQ073682;
	Sat, 21 Aug 2010 15:39:06 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201008211539.o7LFd6HQ073682@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Aug 2010 15:39: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: r211572 - 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, 21 Aug 2010 15:39:06 -0000

Author: rpaulo
Date: Sat Aug 21 15:39:06 2010
New Revision: 211572
URL: http://svn.freebsd.org/changeset/base/211572

Log:
  Add clang to the cross-tools build stage.
  
  Submitted by:	Dimitry Andric 

Modified:
  head/Makefile.inc1

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1	Sat Aug 21 15:01:59 2010	(r211571)
+++ head/Makefile.inc1	Sat Aug 21 15:39:06 2010	(r211572)
@@ -1078,8 +1078,15 @@ _kgzip=		usr.sbin/kgzip
 .endif
 .endif
 
+.if ${CC:T:Mclang} == "clang"
+_clang=		usr.bin/clang
+_clang_libs=	lib/clang
+.endif
+
 cross-tools:
 .for _tool in \
+    ${_clang_libs} \
+    ${_clang} \
     gnu/usr.bin/binutils \
     gnu/usr.bin/cc \
     usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint \

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 15:46:34 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5582E10656A3;
	Sat, 21 Aug 2010 15:46:34 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 4484A8FC1C;
	Sat, 21 Aug 2010 15:46:34 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LFkYIl073898;
	Sat, 21 Aug 2010 15:46:34 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LFkY83073894;
	Sat, 21 Aug 2010 15:46:34 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201008211546.o7LFkY83073894@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Aug 2010 15:46: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: r211573 - in head: contrib/llvm/tools/clang/lib/Driver
	contrib/llvm/tools/clang/lib/Frontend lib/clang
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 15:46:34 -0000

Author: rpaulo
Date: Sat Aug 21 15:46:33 2010
New Revision: 211573
URL: http://svn.freebsd.org/changeset/base/211573

Log:
  Modify clang so that when TOOLS_PREFIX is defined we register the
  CLANG_PREFIX macro. This changes the default header search path when we
  are building clang as part of cross-tools.
  
  Submitted by:	Dimitry Andric 
  Reviewed by:	freebsd-current

Modified:
  head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp
  head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp
  head/lib/clang/clang.build.mk

Modified: head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp
==============================================================================
--- head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp	Sat Aug 21 15:39:06 2010	(r211572)
+++ head/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp	Sat Aug 21 15:46:33 2010	(r211573)
@@ -26,6 +26,10 @@
 
 #include  // ::getenv
 
+#ifndef CLANG_PREFIX
+#define CLANG_PREFIX
+#endif
+
 using namespace clang::driver;
 using namespace clang::driver::toolchains;
 
@@ -869,11 +873,9 @@ FreeBSD::FreeBSD(const HostInfo &Host, c
   getProgramPaths().push_back(getDriver().Dir + "/../libexec");
   getProgramPaths().push_back("/usr/libexec");
   if (Lib32) {
-    getFilePaths().push_back(getDriver().Dir + "/../lib32");
-    getFilePaths().push_back("/usr/lib32");
+    getFilePaths().push_back(CLANG_PREFIX "/usr/lib32");
   } else {
-    getFilePaths().push_back(getDriver().Dir + "/../lib");
-    getFilePaths().push_back("/usr/lib");
+    getFilePaths().push_back(CLANG_PREFIX "/usr/lib");
   }
 }
 

Modified: head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp
==============================================================================
--- head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp	Sat Aug 21 15:39:06 2010	(r211572)
+++ head/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp	Sat Aug 21 15:46:33 2010	(r211573)
@@ -30,6 +30,9 @@
   #define WIN32_LEAN_AND_MEAN 1
   #include 
 #endif
+#ifndef CLANG_PREFIX
+#define CLANG_PREFIX
+#endif
 using namespace clang;
 using namespace clang::frontend;
 
@@ -408,9 +411,10 @@ static bool getWindowsSDKDir(std::string
 
 void InitHeaderSearch::AddDefaultCIncludePaths(const llvm::Triple &triple,
                                             const HeaderSearchOptions &HSOpts) {
-#if 0 /* Remove unneeded include paths. */
   // FIXME: temporary hack: hard-coded paths.
-  AddPath("/usr/local/include", System, true, false, false);
+#ifndef __FreeBSD__
+  AddPath(CLANG_PREFIX "/usr/local/include", System, true, false, false);
+#endif
 
   // Builtin includes use #include_next directives and should be positioned
   // just prior C include dirs.
@@ -421,7 +425,6 @@ void InitHeaderSearch::AddDefaultCInclud
     P.appendComponent("include");
     AddPath(P.str(), System, false, false, false, /*IgnoreSysRoot=*/ true);
   }
-#endif
 
   // Add dirs specified via 'configure --with-c-include-dirs'.
   llvm::StringRef CIncludeDirs(C_INCLUDE_DIRS);
@@ -518,13 +521,15 @@ void InitHeaderSearch::AddDefaultCInclud
   case llvm::Triple::MinGW32:
     AddPath("c:/mingw/include", System, true, false, false);
     break;
+  case llvm::Triple::FreeBSD:
+    AddPath(CLANG_PREFIX "/usr/include/clang/" CLANG_VERSION_STRING,
+      System, false, false, false);
+    break;
   default:
     break;
   }
 
-  AddPath("/usr/include/clang/" CLANG_VERSION_STRING,
-    System, false, false, false);
-  AddPath("/usr/include", System, false, false, false);
+  AddPath(CLANG_PREFIX "/usr/include", System, false, false, false);
 }
 
 void InitHeaderSearch::
@@ -726,8 +731,10 @@ AddDefaultCPlusPlusIncludePaths(const ll
   case llvm::Triple::FreeBSD:
     // FreeBSD 8.0
     // FreeBSD 7.3
-    AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2", "", "", "", triple);
-    AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2/backward", "", "", "", triple);
+    AddGnuCPlusPlusIncludePaths(CLANG_PREFIX "/usr/include/c++/4.2",
+                                "", "", "", triple);
+    AddGnuCPlusPlusIncludePaths(CLANG_PREFIX "/usr/include/c++/4.2/backward",
+                                "", "", "", triple);
     break;
   case llvm::Triple::Minix:
     AddGnuCPlusPlusIncludePaths("/usr/gnu/include/c++/4.4.3",

Modified: head/lib/clang/clang.build.mk
==============================================================================
--- head/lib/clang/clang.build.mk	Sat Aug 21 15:39:06 2010	(r211572)
+++ head/lib/clang/clang.build.mk	Sat Aug 21 15:46:33 2010	(r211573)
@@ -28,6 +28,10 @@ LLVM_REQUIRES_RTTI=
 CFLAGS+=-fno-rtti
 .endif
 
+.ifdef TOOLS_PREFIX
+CFLAGS+=-DCLANG_PREFIX=\"${TOOLS_PREFIX}\"
+.endif
+
 .PATH:	${LLVM_SRCS}/${SRCDIR}
 
 TBLGEN=tblgen ${CFLAGS:M-I*}

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 16:40:04 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BE0071065696;
	Sat, 21 Aug 2010 16:40:04 +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 ADED28FC08;
	Sat, 21 Aug 2010 16:40:04 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LGe4qG075127;
	Sat, 21 Aug 2010 16:40:04 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LGe4k1075125;
	Sat, 21 Aug 2010 16:40:04 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201008211640.o7LGe4k1075125@svn.freebsd.org>
From: Andriy Gapon 
Date: Sat, 21 Aug 2010 16:40:04 +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: r211574 - stable/8/sys/dev/ichwd
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 16:40:04 -0000

Author: avg
Date: Sat Aug 21 16:40:04 2010
New Revision: 211574
URL: http://svn.freebsd.org/changeset/base/211574

Log:
  MFC r210454: ichwd: correct range check for timeout value

Modified:
  stable/8/sys/dev/ichwd/ichwd.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cam/   (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/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/ichwd/ichwd.c
==============================================================================
--- stable/8/sys/dev/ichwd/ichwd.c	Sat Aug 21 15:46:33 2010	(r211573)
+++ stable/8/sys/dev/ichwd/ichwd.c	Sat Aug 21 16:40:04 2010	(r211574)
@@ -256,8 +256,8 @@ ichwd_tmr_set(struct ichwd_softc *sc, un
 		uint8_t tmr_val8 = ichwd_read_tco_1(sc, TCO_TMR1);
 
 		tmr_val8 &= 0xc0;
-		if (timeout > 0xbf)
-			timeout = 0xbf;
+		if (timeout > 0x3f)
+			timeout = 0x3f;
 		tmr_val8 |= timeout;
 		ichwd_write_tco_1(sc, TCO_TMR1, tmr_val8);
 	} else {

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 16:42:50 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7E2F41065694;
	Sat, 21 Aug 2010 16:42:50 +0000 (UTC)
	(envelope-from ume@mahoroba.org)
Received: from mail.mahoroba.org (ent.mahoroba.org [IPv6:2001:2f0:104:8010::1])
	by mx1.freebsd.org (Postfix) with ESMTP id 250DD8FC08;
	Sat, 21 Aug 2010 16:42:49 +0000 (UTC)
Received: from yuga.mahoroba.org (ume@yuga-m.mahoroba.org
	[IPv6:2001:2f0:104:801c:21b:d3ff:fe38:5381])
	(user=ume mech=DIGEST-MD5 bits=0)
	by mail.mahoroba.org (8.14.4/8.14.4) with ESMTP/inet6 id o7LGgdm6080387
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Sun, 22 Aug 2010 01:42:40 +0900 (JST)
	(envelope-from ume@mahoroba.org)
Date: Sun, 22 Aug 2010 01:42:38 +0900
Message-ID: 
From: Hajimu UMEMOTO 
To: pluknet 
In-Reply-To: 
References: <201008201752.o7KHqnu1044143@svn.freebsd.org>
	
User-Agent: xcite1.58> Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6
	(Maruoka) FLIM/1.14.9 (=?ISO-2022-JP-2?B?R29qGyQoRCtXGyhC?=) APEL/10.8
	Emacs/23.2 (i386-portbld-freebsd8.1) MULE/6.0 (HANACHIRUSATO)
X-Operating-System: FreeBSD 8.1-STABLE
X-PGP-Key: http://www.imasy.or.jp/~ume/publickey.asc
X-PGP-Fingerprint: 1F00 0B9E 2164 70FC 6DC5  BF5F 04E9 F086 BF90 71FE
Organization: Internet Mutual Aid Society, YOKOHAMA
MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka")
Content-Type: text/plain; charset=US-ASCII
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6
	(mail.mahoroba.org [IPv6:2001:2f0:104:8010::1]);
	Sun, 22 Aug 2010 01:42:41 +0900 (JST)
X-Virus-Scanned: clamav-milter 0.96.2 at asuka.mahoroba.org
X-Virus-Status: Clean
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD
	autolearn=ham version=3.3.1
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on asuka.mahoroba.org
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r211530 - head/sys/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: Sat, 21 Aug 2010 16:42:50 -0000

Hi,

>>>>> On Fri, 20 Aug 2010 22:19:37 +0400
>>>>> pluknet  said:

pluknet> I think it still continues to test the remain condition
pluknet> regardless of test result of the first part (!optp).

No, I don't think my fix is wrong.  If the evaluation matches, the
latter should not be evaluated.

pluknet> That should work:

pluknet>  -               if (!optp->ip6po_pktinfo || !optp->ip6po_pktinfo->ipi6_ifindex)
pluknet>  +               if (optp != NULL && (!optp->ip6po_pktinfo ||
pluknet>  +                   !optp->ip6po_pktinfo->ipi6_ifindex))

With your proposal, when optp is NULL, use_defzone doesn't set.  It is
not desired thing.

Sincerely,

--
Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan
ume@mahoroba.org  ume@{,jp.}FreeBSD.org
http://www.imasy.org/~ume/

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 16:47:42 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2CCD01065694;
	Sat, 21 Aug 2010 16:47:42 +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 1D1778FC12;
	Sat, 21 Aug 2010 16:47:42 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LGlgGT075345;
	Sat, 21 Aug 2010 16:47:42 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LGlfKF075343;
	Sat, 21 Aug 2010 16:47:41 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201008211647.o7LGlfKF075343@svn.freebsd.org>
From: Andriy Gapon 
Date: Sat, 21 Aug 2010 16:47:41 +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: r211575 - stable/7/sys/dev/ichwd
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 16:47:42 -0000

Author: avg
Date: Sat Aug 21 16:47:41 2010
New Revision: 211575
URL: http://svn.freebsd.org/changeset/base/211575

Log:
  MFC r210454: ichwd: correct range check for timeout value

Modified:
  stable/7/sys/dev/ichwd/ichwd.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/ichwd/ichwd.c
==============================================================================
--- stable/7/sys/dev/ichwd/ichwd.c	Sat Aug 21 16:40:04 2010	(r211574)
+++ stable/7/sys/dev/ichwd/ichwd.c	Sat Aug 21 16:47:41 2010	(r211575)
@@ -256,8 +256,8 @@ ichwd_tmr_set(struct ichwd_softc *sc, un
 		uint8_t tmr_val8 = ichwd_read_tco_1(sc, TCO_TMR1);
 
 		tmr_val8 &= 0xc0;
-		if (timeout > 0xbf)
-			timeout = 0xbf;
+		if (timeout > 0x3f)
+			timeout = 0x3f;
 		tmr_val8 |= timeout;
 		ichwd_write_tco_1(sc, TCO_TMR1, tmr_val8);
 	} else {

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 16:55:39 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 39A591065698;
	Sat, 21 Aug 2010 16:55:39 +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 E48BB8FC1F;
	Sat, 21 Aug 2010 16:55:37 +0000 (UTC)
Received: from porto.topspin.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 TAA18190;
	Sat, 21 Aug 2010 19:45:14 +0300 (EEST)
	(envelope-from avg@freebsd.org)
Received: from localhost.topspin.kiev.ua ([127.0.0.1])
	by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD))
	id 1OmrBx-0006iP-MG; Sat, 21 Aug 2010 19:45:13 +0300
Message-ID: <4C700298.3070907@freebsd.org>
Date: Sat, 21 Aug 2010 19:45:12 +0300
From: Andriy Gapon 
User-Agent: Thunderbird 2.0.0.24 (X11/20100603)
MIME-Version: 1.0
To: src-committers@freebsd.org
References: <201008211640.o7LGe4k1075125@svn.freebsd.org>
In-Reply-To: <201008211640.o7LGe4k1075125@svn.freebsd.org>
X-Enigmail-Version: 0.96.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org,
	svn-src-stable-8@freebsd.org
Subject: Re: svn commit: r211574 - stable/8/sys/dev/ichwd
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 16:55:39 -0000

on 21/08/2010 19:40 Andriy Gapon said the following:
> Author: avg
> Date: Sat Aug 21 16:40:04 2010
> New Revision: 211574
> URL: http://svn.freebsd.org/changeset/base/211574
> 
> Log:
>   MFC r210454: ichwd: correct range check for timeout value
> 
> Modified:
>   stable/8/sys/dev/ichwd/ichwd.c
> Directory Properties:
>   stable/8/sys/   (props changed)
>   stable/8/sys/amd64/include/xen/   (props changed)
>   stable/8/sys/cam/   (props changed)

BTW, why do we have mergeinfo property on sys/cam now?

-- 
Andriy Gapon

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 16:55:42 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 00CC71065693;
	Sat, 21 Aug 2010 16:55:42 +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 452978FC12;
	Sat, 21 Aug 2010 16:55:40 +0000 (UTC)
Received: from porto.topspin.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 TAA18163;
	Sat, 21 Aug 2010 19:43:50 +0300 (EEST)
	(envelope-from avg@freebsd.org)
Received: from localhost.topspin.kiev.ua ([127.0.0.1])
	by porto.topspin.kiev.ua with esmtp (Exim 4.34 (FreeBSD))
	id 1OmrAc-0006iF-Ch; Sat, 21 Aug 2010 19:43:50 +0300
Message-ID: <4C700245.1000906@freebsd.org>
Date: Sat, 21 Aug 2010 19:43:49 +0300
From: Andriy Gapon 
User-Agent: Thunderbird 2.0.0.24 (X11/20100603)
MIME-Version: 1.0
To: "Bjoern A. Zeeb" 
References: <201008211110.o7LBAw7H067075@svn.freebsd.org>
	<20100821113326.P48418@maildrop.int.zabbadoz.net>
In-Reply-To: <20100821113326.P48418@maildrop.int.zabbadoz.net>
X-Enigmail-Version: 0.96.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org, Andre Oppermann ,
	svn-src-stable-8@freebsd.org
Subject: Re: svn commit: r211548 - 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: Sat, 21 Aug 2010 16:55:42 -0000

on 21/08/2010 14:33 Bjoern A. Zeeb said the following:
> On Sat, 21 Aug 2010, Andre Oppermann wrote:
> 
>> Author: andre
>> Date: Sat Aug 21 11:10:58 2010
>> New Revision: 211548
>> URL: http://svn.freebsd.org/changeset/base/211548
>>
>> Log:
>>  MFC r211317:
>>
>>    Reset the internal tso flag in tcp_output() on every iteration
>>    of sendalot.
>>
>> Modified:
>>  stable/8/sys/netinet/tcp_output.c
> 
> Would you my recording the merge-info for all of those?

I guess s/my/mind/? :)

-- 
Andriy Gapon

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 17:06:54 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A12C51065695;
	Sat, 21 Aug 2010 17:06:54 +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 1D8D68FC14;
	Sat, 21 Aug 2010 17:06:53 +0000 (UTC)
Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua
	[10.1.1.148])
	by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o7LH6nsD084386
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Sat, 21 Aug 2010 20:06:49 +0300 (EEST)
	(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.4/8.14.4) with ESMTP id
	o7LH6nrV092939; Sat, 21 Aug 2010 20:06:49 +0300 (EEST)
	(envelope-from kostikbel@gmail.com)
Received: (from kostik@localhost)
	by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o7LH6nRR092938; 
	Sat, 21 Aug 2010 20:06:49 +0300 (EEST)
	(envelope-from kostikbel@gmail.com)
X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to
	kostikbel@gmail.com using -f
Date: Sat, 21 Aug 2010 20:06:49 +0300
From: Kostik Belousov 
To: Rui Paulo 
Message-ID: <20100821170649.GV2396@deviant.kiev.zoral.com.ua>
References: <201008211348.o7LDm55c070981@svn.freebsd.org>
	<20100821135908.GT2396@deviant.kiev.zoral.com.ua>
	<64B55A11-14C3-4297-93F6-40BA74854F98@FreeBSD.org>
	<20100821142340.GU2396@deviant.kiev.zoral.com.ua>
	
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="J+UeKfBGib79GnN+"
Content-Disposition: inline
In-Reply-To: 
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=-2.2 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_50,
	DNS_FROM_OPENWHOIS autolearn=no 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: r211561 - head/cddl/lib/drti
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 17:06:54 -0000


--J+UeKfBGib79GnN+
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Aug 21, 2010 at 03:33:35PM +0100, Rui Paulo wrote:
>=20
> On 21 Aug 2010, at 15:23, Kostik Belousov wrote:
>=20
> > On Sat, Aug 21, 2010 at 03:16:49PM +0100, Rui Paulo wrote:
> >>=20
> >> On 21 Aug 2010, at 14:59, Kostik Belousov wrote:
> >>=20
> >>> On Sat, Aug 21, 2010 at 01:48:05PM +0000, Rui Paulo wrote:
> >>>> Author: rpaulo
> >>>> Date: Sat Aug 21 13:48:04 2010
> >>>> New Revision: 211561
> >>>> URL: http://svn.freebsd.org/changeset/base/211561
> >>>>=20
> >>>> Log:
> >>>> Link drti.o with a PIC version of libelf. This is needed because
> >>>> drti.o depends on libelf and this avoids linking every other drti.o
> >>>> program (namely programs with USDT probes) with libelf.
> >>> What is wrong with having libelf as dependency of the resulting
> >>> binary ?
> >>=20
> >> The resulting binary can be a library. If I add drti.o to the libthr
> >> library, every other program will break because it can't find libelf
> >> symbols. The only way to fix it would be to rebuild every program that
> >> depends on libthr and I don't want that to happen.
> >=20
> > I do not understand this. If drti.o is added to a library, library shou=
ld
> > also record a dependency on libelf, i.e. be linked with it. Since you
> > already modifying link command to add drti.o, what is the problem to
> > add -lelf ?
>=20
> I wanted the same steps to be done in FreeBSD as in Solaris. I.e., in
> I Solaris you don't need to link with -lelf your program after you
> I added DTrace probes to it believe this is a good tradeoff          .

The drawbacks of linking library statically are, at least:
- Wasted space.
- Harder upgrade when libelf changes. Much harder for ports and hand-
  compiled programs.
- The mess that happen when the binary also linked with -lelf, and
  either your drti.o is linked, or a library that linked with its
  dcrti.o.
Pro argument seems to be that one less diff with Solaris code is needed.

This is becoming rather long.

--J+UeKfBGib79GnN+
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAkxwB6kACgkQC3+MBN1Mb4jkAACfcmWuKmjGmYv4Gg12wsdlZZst
pnsAnivKSN0fVYo2FYfcxasBZyqMh+mN
=LDUh
-----END PGP SIGNATURE-----

--J+UeKfBGib79GnN+--

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 17:20:01 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C149010656A7;
	Sat, 21 Aug 2010 17:20:01 +0000 (UTC)
	(envelope-from rpaulo@freebsd.org)
Received: from karen.lavabit.com (karen.lavabit.com [72.249.41.33])
	by mx1.freebsd.org (Postfix) with ESMTP id 822668FC18;
	Sat, 21 Aug 2010 17:20:01 +0000 (UTC)
Received: from d.earth.lavabit.com (d.earth.lavabit.com [192.168.111.13])
	by karen.lavabit.com (Postfix) with ESMTP id 08C6111BAD0;
	Sat, 21 Aug 2010 12:20:01 -0500 (CDT)
Received: from 10.0.10.3 (54.81.54.77.rev.vodafone.pt [77.54.81.54])
	by lavabit.com with ESMTP id RIXEHCNNSXXV;
	Sat, 21 Aug 2010 12:20:01 -0500
Mime-Version: 1.0 (Apple Message framework v1081)
Content-Type: text/plain; charset=us-ascii
From: Rui Paulo 
In-Reply-To: <20100821170649.GV2396@deviant.kiev.zoral.com.ua>
Date: Sat, 21 Aug 2010 18:19:56 +0100
Content-Transfer-Encoding: 7bit
Message-Id: <7E3C9150-017F-48C7-8230-25D66154C5F3@freebsd.org>
References: <201008211348.o7LDm55c070981@svn.freebsd.org>
	<20100821135908.GT2396@deviant.kiev.zoral.com.ua>
	<64B55A11-14C3-4297-93F6-40BA74854F98@FreeBSD.org>
	<20100821142340.GU2396@deviant.kiev.zoral.com.ua>
	
	<20100821170649.GV2396@deviant.kiev.zoral.com.ua>
To: Kostik Belousov 
X-Mailer: Apple Mail (2.1081)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r211561 - head/cddl/lib/drti
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 17:20:01 -0000

On 21 Aug 2010, at 18:06, Kostik Belousov wrote:

> On Sat, Aug 21, 2010 at 03:33:35PM +0100, Rui Paulo wrote:
>> 
>> On 21 Aug 2010, at 15:23, Kostik Belousov wrote:
>> 
>>> On Sat, Aug 21, 2010 at 03:16:49PM +0100, Rui Paulo wrote:
>>>> 
>>>> On 21 Aug 2010, at 14:59, Kostik Belousov wrote:
>>>> 
>>>>> On Sat, Aug 21, 2010 at 01:48:05PM +0000, Rui Paulo wrote:
>>>>>> Author: rpaulo
>>>>>> Date: Sat Aug 21 13:48:04 2010
>>>>>> New Revision: 211561
>>>>>> URL: http://svn.freebsd.org/changeset/base/211561
>>>>>> 
>>>>>> Log:
>>>>>> Link drti.o with a PIC version of libelf. This is needed because
>>>>>> drti.o depends on libelf and this avoids linking every other drti.o
>>>>>> program (namely programs with USDT probes) with libelf.
>>>>> What is wrong with having libelf as dependency of the resulting
>>>>> binary ?
>>>> 
>>>> The resulting binary can be a library. If I add drti.o to the libthr
>>>> library, every other program will break because it can't find libelf
>>>> symbols. The only way to fix it would be to rebuild every program that
>>>> depends on libthr and I don't want that to happen.
>>> 
>>> I do not understand this. If drti.o is added to a library, library should
>>> also record a dependency on libelf, i.e. be linked with it. Since you
>>> already modifying link command to add drti.o, what is the problem to
>>> add -lelf ?
>> 
>> I wanted the same steps to be done in FreeBSD as in Solaris. I.e., in
>> I Solaris you don't need to link with -lelf your program after you
>> I added DTrace probes to it believe this is a good tradeoff          .
> 
> The drawbacks of linking library statically are, at least:
> - Wasted space.

This is certainly not a problem nowadays.

> - Harder upgrade when libelf changes. Much harder for ports and hand-
>  compiled programs.
> - The mess that happen when the binary also linked with -lelf, and
>  either your drti.o is linked, or a library that linked with its
>  dcrti.o.

I'll try to find a way to make DTrace do the linking, if possible.

Regards,
--
Rui Paulo



From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 17:30:00 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 15F5A1065674;
	Sat, 21 Aug 2010 17:30:00 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id E001B8FC0C;
	Sat, 21 Aug 2010 17:29:59 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LHTx5a076188;
	Sat, 21 Aug 2010 17:29:59 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LHTxjY076184;
	Sat, 21 Aug 2010 17:29:59 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201008211729.o7LHTxjY076184@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Aug 2010 17:29: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: r211577 - in head: . cddl/lib/drti lib/libelf
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 17:30:00 -0000

Author: rpaulo
Date: Sat Aug 21 17:29:59 2010
New Revision: 211577
URL: http://svn.freebsd.org/changeset/base/211577

Log:
  Don't link drti.o with libelf_pic.a. This means that all software with
  userland SDT probes must be linked with libelf explicitly.
  
  Requested by:	kib
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/Makefile.inc1
  head/cddl/lib/drti/Makefile
  head/lib/libelf/Makefile

Modified: head/Makefile.inc1
==============================================================================
--- head/Makefile.inc1	Sat Aug 21 17:15:37 2010	(r211576)
+++ head/Makefile.inc1	Sat Aug 21 17:29:59 2010	(r211577)
@@ -1149,7 +1149,7 @@ gnu/lib/libgcc__L: lib/libc__L
 _prebuild_libs=	${_kerberos5_lib_libasn1} ${_kerberos5_lib_libheimntlm} \
 		${_kerberos5_lib_libhx509} ${_kerberos5_lib_libkrb5} \
 		${_kerberos5_lib_libroken} \
-		lib/libbz2 lib/libcom_err lib/libcrypt lib/libelf \
+		lib/libbz2 lib/libcom_err lib/libcrypt \
 		lib/libexpat lib/libfetch \
 		${_lib_libgssapi} ${_lib_libipx} \
 		lib/libkiconv lib/libkvm lib/liblzma lib/libmd \

Modified: head/cddl/lib/drti/Makefile
==============================================================================
--- head/cddl/lib/drti/Makefile	Sat Aug 21 17:15:37 2010	(r211576)
+++ head/cddl/lib/drti/Makefile	Sat Aug 21 17:29:59 2010	(r211577)
@@ -8,7 +8,7 @@ FILESOWN=	${LIBOWN}
 FILESGRP=	${LIBGRP}
 FILESMODE=	${LIBMODE}
 FILESDIR=	${LIBDIR}/dtrace
-CLEANFILES=	${FILES} ${FILES}.tmp
+CLEANFILES=	${FILES}
 
 CFLAGS+=	-I${.CURDIR}/../../../sys/cddl/compat/opensolaris \
 		-I${.CURDIR}/../../../cddl/compat/opensolaris/include \
@@ -18,10 +18,4 @@ CFLAGS+=	-I${.CURDIR}/../../../sys/cddl/
 		-I${OPENSOLARIS_SYS_DISTDIR}/uts/common \
 		-DPIC -fpic
 
-.c.o:
-	${CC} ${CFLAGS} -c ${.IMPSRC}
-	mv ${FILES} ${FILES}.tmp
-	${LD} -o ${FILES} -r ${FILES}.tmp ${LIBELF_PIC}
-	rm -f ${FILES}.tmp
-
 .include 

Modified: head/lib/libelf/Makefile
==============================================================================
--- head/lib/libelf/Makefile	Sat Aug 21 17:15:37 2010	(r211576)
+++ head/lib/libelf/Makefile	Sat Aug 21 17:29:59 2010	(r211577)
@@ -55,7 +55,6 @@ SRCS=	elf_begin.c						\
 	${GENSRCS}
 INCS=	libelf.h gelf.h
 
-INSTALL_PIC_ARCHIVE=yes
 GENSRCS=	libelf_fsize.c libelf_msize.c libelf_convert.c
 CLEANFILES=	${GENSRCS}
 CFLAGS+=	-I. -I${.CURDIR}

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 17:32:01 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B8C2A1065673;
	Sat, 21 Aug 2010 17:32:01 +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 368578FC0C;
	Sat, 21 Aug 2010 17:32:01 +0000 (UTC)
Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua
	[10.1.1.148])
	by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o7LHVwPX085965
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Sat, 21 Aug 2010 20:31:58 +0300 (EEST)
	(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.4/8.14.4) with ESMTP id
	o7LHVvge093124; Sat, 21 Aug 2010 20:31:57 +0300 (EEST)
	(envelope-from kostikbel@gmail.com)
Received: (from kostik@localhost)
	by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o7LHVv4j093123; 
	Sat, 21 Aug 2010 20:31:57 +0300 (EEST)
	(envelope-from kostikbel@gmail.com)
X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to
	kostikbel@gmail.com using -f
Date: Sat, 21 Aug 2010 20:31:57 +0300
From: Kostik Belousov 
To: Rui Paulo 
Message-ID: <20100821173157.GY2396@deviant.kiev.zoral.com.ua>
References: <201008211729.o7LHTxjY076184@svn.freebsd.org>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="hJVFpZSnnomxDa7F"
Content-Disposition: inline
In-Reply-To: <201008211729.o7LHTxjY076184@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=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_05,
	DNS_FROM_OPENWHOIS autolearn=no 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: r211577 - in head: . cddl/lib/drti lib/libelf
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 17:32:01 -0000


--hJVFpZSnnomxDa7F
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Aug 21, 2010 at 05:29:59PM +0000, Rui Paulo wrote:
> Author: rpaulo
> Date: Sat Aug 21 17:29:59 2010
> New Revision: 211577
> URL: http://svn.freebsd.org/changeset/base/211577
>=20
> Log:
>   Don't link drti.o with libelf_pic.a. This means that all software with
>   userland SDT probes must be linked with libelf explicitly.
>  =20
>   Requested by:	kib
Thanks.

--hJVFpZSnnomxDa7F
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (FreeBSD)

iEYEARECAAYFAkxwDY0ACgkQC3+MBN1Mb4grLgCgxdpWR9ly+gDPzf5DJNzCbHtw
8iIAoLRESuzi9B3Qe7A8n1vm+k4JCxR4
=689i
-----END PGP SIGNATURE-----

--hJVFpZSnnomxDa7F--

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 17:37:01 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 722441065695;
	Sat, 21 Aug 2010 17:37:01 +0000 (UTC)
	(envelope-from swell.k@gmail.com)
Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com
	[209.85.161.54])
	by mx1.freebsd.org (Postfix) with ESMTP id 71BB18FC14;
	Sat, 21 Aug 2010 17:37:00 +0000 (UTC)
Received: by fxm4 with SMTP id 4so2692077fxm.13
	for ; Sat, 21 Aug 2010 10:36:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:received:received:from:to:cc:subject:references
	:date:in-reply-to:message-id:user-agent:mime-version:content-type;
	bh=eXizwvsjedwIQfeH8xkp7/Wo6Qp3oX7OfLXMh+45BpY=;
	b=h9N+nUIqiKitWoc+Ma91tu7KqDYU12RYwChwcjb/tCCu5WtdvVRouAa/AKmgqQMUbo
	U6AZLZhao4y/TT7a4fgbtypBldCscG51mavkSz5q+j5SPhm82X5kleptwjoVjCi+WtcK
	trwOm2UivLkfDFaVkVNzj/N7iVuOs+Vko3g6g=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=from:to:cc:subject:references:date:in-reply-to:message-id
	:user-agent:mime-version:content-type;
	b=T5f3jdlU46GVfccN2DFPYh2ub73akgL9SnxzSCTLGQvL9NdBgmTQRp+0yuqiqHwdIK
	DJbiwEXiEfohpvCP+ojqwP9IujC3xslZTNa6tb0btUqyu5/E9XgHZcEuBtJIke4HLba7
	LQvJ2r+DuFEdq3BHbszCuriWJrHX9s0lxcSIo=
Received: by 10.223.119.196 with SMTP id a4mr2380756far.65.1282412219323;
	Sat, 21 Aug 2010 10:36:59 -0700 (PDT)
Received: from localhost (narf.dsw2k3.info [195.71.226.87])
	by mx.google.com with ESMTPS id e17sm1687651faa.39.2010.08.21.10.36.55
	(version=SSLv3 cipher=RC4-MD5); Sat, 21 Aug 2010 10:36:58 -0700 (PDT)
From: Anonymous 
To: Rui Paulo 
References: <201008211729.o7LHTxjY076184__28575.1806608916$1282411832$gmane$org@svn.freebsd.org>
Date: Sat, 21 Aug 2010 21:36:49 +0400
In-Reply-To: <201008211729.o7LHTxjY076184__28575.1806608916$1282411832$gmane$org@svn.freebsd.org>
	(Rui Paulo's message of "Sat, 21 Aug 2010 17:29:59 +0000 (UTC)")
Message-ID: <86mxsfuatq.fsf@gmail.com>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (berkeley-unix)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r211577 - in head: . cddl/lib/drti lib/libelf
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 17:37:01 -0000

Rui Paulo  writes:

> Author: rpaulo
> Date: Sat Aug 21 17:29:59 2010
> New Revision: 211577
> URL: http://svn.freebsd.org/changeset/base/211577
>
> Log:
>   Don't link drti.o with libelf_pic.a. This means that all software with
>   userland SDT probes must be linked with libelf explicitly.
>   
>   Requested by:	kib
>   Sponsored by:	The FreeBSD Foundation
>
> Modified:
>   head/Makefile.inc1
>   head/cddl/lib/drti/Makefile
>   head/lib/libelf/Makefile
>

I think there was one more file.

> Author: rpaulo
> Date: Sat Aug 21 14:08:04 2010
> New Revision: 211565
> URL: http://svn.freebsd.org/changeset/base/211565
>
> Log:
>   Add the definition of LIBELF_PIC.
>   
>   Sponsored by:	The FreeBSD Foundation
>
> Modified:
>   head/share/mk/bsd.libnames.mk
>
> Modified: head/share/mk/bsd.libnames.mk
> ==============================================================================
> --- head/share/mk/bsd.libnames.mk	Sat Aug 21 14:02:04 2010	(r211564)
> +++ head/share/mk/bsd.libnames.mk	Sat Aug 21 14:08:04 2010	(r211565)
> @@ -45,6 +45,7 @@ LIBDTRACE?=	${DESTDIR}${LIBDIR}/libdtrac
>  LIBDWARF?=	${DESTDIR}${LIBDIR}/libdwarf.a
>  LIBEDIT?=	${DESTDIR}${LIBDIR}/libedit.a
>  LIBELF?=	${DESTDIR}${LIBDIR}/libelf.a
> +LIBELF_PIC?=	${DESTDIR}${LIBDIR}/libelf_pic.a
>  LIBFETCH?=	${DESTDIR}${LIBDIR}/libfetch.a
>  LIBFL?=		"don't use LIBFL, use LIBL"
>  LIBFORM?=	${DESTDIR}${LIBDIR}/libform.a

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 17:48:29 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B46081065670;
	Sat, 21 Aug 2010 17:48:29 +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 89DFA8FC0A;
	Sat, 21 Aug 2010 17:48:29 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LHmT50076628;
	Sat, 21 Aug 2010 17:48:29 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LHmTok076626;
	Sat, 21 Aug 2010 17:48:29 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201008211748.o7LHmTok076626@svn.freebsd.org>
From: Andriy Gapon 
Date: Sat, 21 Aug 2010 17:48: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: r211578 - 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: Sat, 21 Aug 2010 17:48:29 -0000

Author: avg
Date: Sat Aug 21 17:48:29 2010
New Revision: 211578
URL: http://svn.freebsd.org/changeset/base/211578

Log:
  MFC r210422: cpufreq: allocate long-lived buffer for handling of sysctl
  requests

Modified:
  stable/8/sys/kern/kern_cpu.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cam/   (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/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/kern/kern_cpu.c
==============================================================================
--- stable/8/sys/kern/kern_cpu.c	Sat Aug 21 17:29:59 2010	(r211577)
+++ stable/8/sys/kern/kern_cpu.c	Sat Aug 21 17:48:29 2010	(r211578)
@@ -76,6 +76,7 @@ struct cpufreq_softc {
 	device_t			dev;
 	struct sysctl_ctx_list		sysctl_ctx;
 	struct task			startup_task;
+	struct cf_level			*levels_buf;
 };
 
 struct cf_setting_array {
@@ -180,6 +181,8 @@ cpufreq_attach(device_t dev)
 
 	CF_DEBUG("initializing one-time data for %s\n",
 	    device_get_nameunit(dev));
+	sc->levels_buf = malloc(CF_MAX_LEVELS * sizeof(*sc->levels_buf),
+	    M_DEVBUF, M_WAITOK);
 	SYSCTL_ADD_PROC(&sc->sysctl_ctx,
 	    SYSCTL_CHILDREN(device_get_sysctl_tree(parent)),
 	    OID_AUTO, "freq", CTLTYPE_INT | CTLFLAG_RW, sc, 0,
@@ -227,6 +230,7 @@ cpufreq_detach(device_t dev)
 	numdevs = devclass_get_count(cpufreq_dc);
 	if (numdevs == 1) {
 		CF_DEBUG("final shutdown for %s\n", device_get_nameunit(dev));
+		free(sc->levels_buf, M_DEVBUF);
 	}
 
 	return (0);
@@ -870,9 +874,7 @@ cpufreq_curr_sysctl(SYSCTL_HANDLER_ARGS)
 
 	devs = NULL;
 	sc = oidp->oid_arg1;
-	levels = malloc(CF_MAX_LEVELS * sizeof(*levels), M_TEMP, M_NOWAIT);
-	if (levels == NULL)
-		return (ENOMEM);
+	levels = sc->levels_buf;
 
 	error = CPUFREQ_GET(sc->dev, &levels[0]);
 	if (error)
@@ -915,8 +917,6 @@ cpufreq_curr_sysctl(SYSCTL_HANDLER_ARGS)
 out:
 	if (devs)
 		free(devs, M_TEMP);
-	if (levels)
-		free(levels, M_TEMP);
 	return (error);
 }
 
@@ -934,7 +934,7 @@ cpufreq_levels_sysctl(SYSCTL_HANDLER_ARG
 
 	/* Get settings from the device and generate the output string. */
 	count = CF_MAX_LEVELS;
-	levels = malloc(count * sizeof(*levels), M_TEMP, M_NOWAIT);
+	levels = sc->levels_buf;
 	if (levels == NULL) {
 		sbuf_delete(&sb);
 		return (ENOMEM);
@@ -957,7 +957,6 @@ cpufreq_levels_sysctl(SYSCTL_HANDLER_ARG
 	error = sysctl_handle_string(oidp, sbuf_data(&sb), sbuf_len(&sb), req);
 
 out:
-	free(levels, M_TEMP);
 	sbuf_delete(&sb);
 	return (error);
 }

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 17:52:33 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 81DFC10656A4;
	Sat, 21 Aug 2010 17:52:33 +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 573ED8FC0C;
	Sat, 21 Aug 2010 17:52:33 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LHqXsr076759;
	Sat, 21 Aug 2010 17:52:33 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LHqXQ9076757;
	Sat, 21 Aug 2010 17:52:33 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201008211752.o7LHqXQ9076757@svn.freebsd.org>
From: Andriy Gapon 
Date: Sat, 21 Aug 2010 17:52:33 +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: r211579 - 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: Sat, 21 Aug 2010 17:52:33 -0000

Author: avg
Date: Sat Aug 21 17:52:33 2010
New Revision: 211579
URL: http://svn.freebsd.org/changeset/base/211579

Log:
  MFC r210422: cpufreq: allocate long-lived buffer for handling of sysctl
  requests

Modified:
  stable/7/sys/kern/kern_cpu.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/kern/kern_cpu.c
==============================================================================
--- stable/7/sys/kern/kern_cpu.c	Sat Aug 21 17:48:29 2010	(r211578)
+++ stable/7/sys/kern/kern_cpu.c	Sat Aug 21 17:52:33 2010	(r211579)
@@ -76,6 +76,7 @@ struct cpufreq_softc {
 	device_t			dev;
 	struct sysctl_ctx_list		sysctl_ctx;
 	struct task			startup_task;
+	struct cf_level			*levels_buf;
 };
 
 struct cf_setting_array {
@@ -176,6 +177,8 @@ cpufreq_attach(device_t dev)
 
 	CF_DEBUG("initializing one-time data for %s\n",
 	    device_get_nameunit(dev));
+	sc->levels_buf = malloc(CF_MAX_LEVELS * sizeof(*sc->levels_buf),
+	    M_DEVBUF, M_WAITOK);
 	SYSCTL_ADD_PROC(&sc->sysctl_ctx,
 	    SYSCTL_CHILDREN(device_get_sysctl_tree(parent)),
 	    OID_AUTO, "freq", CTLTYPE_INT | CTLFLAG_RW, sc, 0,
@@ -223,6 +226,7 @@ cpufreq_detach(device_t dev)
 	numdevs = devclass_get_count(cpufreq_dc);
 	if (numdevs == 1) {
 		CF_DEBUG("final shutdown for %s\n", device_get_nameunit(dev));
+		free(sc->levels_buf, M_DEVBUF);
 	}
 
 	return (0);
@@ -861,9 +865,7 @@ cpufreq_curr_sysctl(SYSCTL_HANDLER_ARGS)
 
 	devs = NULL;
 	sc = oidp->oid_arg1;
-	levels = malloc(CF_MAX_LEVELS * sizeof(*levels), M_TEMP, M_NOWAIT);
-	if (levels == NULL)
-		return (ENOMEM);
+	levels = sc->levels_buf;
 
 	error = CPUFREQ_GET(sc->dev, &levels[0]);
 	if (error)
@@ -906,8 +908,6 @@ cpufreq_curr_sysctl(SYSCTL_HANDLER_ARGS)
 out:
 	if (devs)
 		free(devs, M_TEMP);
-	if (levels)
-		free(levels, M_TEMP);
 	return (error);
 }
 
@@ -925,7 +925,7 @@ cpufreq_levels_sysctl(SYSCTL_HANDLER_ARG
 
 	/* Get settings from the device and generate the output string. */
 	count = CF_MAX_LEVELS;
-	levels = malloc(count * sizeof(*levels), M_TEMP, M_NOWAIT);
+	levels = sc->levels_buf;
 	if (levels == NULL) {
 		sbuf_delete(&sb);
 		return (ENOMEM);
@@ -948,7 +948,6 @@ cpufreq_levels_sysctl(SYSCTL_HANDLER_ARG
 	error = sysctl_handle_string(oidp, sbuf_data(&sb), sbuf_len(&sb), req);
 
 out:
-	free(levels, M_TEMP);
 	sbuf_delete(&sb);
 	return (error);
 }

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 17:53:16 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5567410656AA;
	Sat, 21 Aug 2010 17:53:16 +0000 (UTC)
	(envelope-from rpaulo@FreeBSD.org)
Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c])
	by mx1.freebsd.org (Postfix) with ESMTP id 45F9F8FC19;
	Sat, 21 Aug 2010 17:53:16 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LHrGJa076811;
	Sat, 21 Aug 2010 17:53:16 GMT (envelope-from rpaulo@svn.freebsd.org)
Received: (from rpaulo@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LHrGlQ076809;
	Sat, 21 Aug 2010 17:53:16 GMT (envelope-from rpaulo@svn.freebsd.org)
Message-Id: <201008211753.o7LHrGlQ076809@svn.freebsd.org>
From: Rui Paulo 
Date: Sat, 21 Aug 2010 17:53: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: r211580 - head/share/mk
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 17:53:16 -0000

Author: rpaulo
Date: Sat Aug 21 17:53:16 2010
New Revision: 211580
URL: http://svn.freebsd.org/changeset/base/211580

Log:
  Remove LIBELF_PIC.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/share/mk/bsd.libnames.mk

Modified: head/share/mk/bsd.libnames.mk
==============================================================================
--- head/share/mk/bsd.libnames.mk	Sat Aug 21 17:52:33 2010	(r211579)
+++ head/share/mk/bsd.libnames.mk	Sat Aug 21 17:53:16 2010	(r211580)
@@ -45,7 +45,6 @@ LIBDTRACE?=	${DESTDIR}${LIBDIR}/libdtrac
 LIBDWARF?=	${DESTDIR}${LIBDIR}/libdwarf.a
 LIBEDIT?=	${DESTDIR}${LIBDIR}/libedit.a
 LIBELF?=	${DESTDIR}${LIBDIR}/libelf.a
-LIBELF_PIC?=	${DESTDIR}${LIBDIR}/libelf_pic.a
 LIBFETCH?=	${DESTDIR}${LIBDIR}/libfetch.a
 LIBFL?=		"don't use LIBFL, use LIBL"
 LIBFORM?=	${DESTDIR}${LIBDIR}/libform.a

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 17:53:44 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5B4D81065679;
	Sat, 21 Aug 2010 17:53:44 +0000 (UTC)
	(envelope-from rpaulo@freebsd.org)
Received: from karen.lavabit.com (karen.lavabit.com [72.249.41.33])
	by mx1.freebsd.org (Postfix) with ESMTP id 3310B8FC18;
	Sat, 21 Aug 2010 17:53:43 +0000 (UTC)
Received: from d.earth.lavabit.com (d.earth.lavabit.com [192.168.111.13])
	by karen.lavabit.com (Postfix) with ESMTP id 8C3B211BAC2;
	Sat, 21 Aug 2010 12:53:43 -0500 (CDT)
Received: from 10.0.10.3 (54.81.54.77.rev.vodafone.pt [77.54.81.54])
	by lavabit.com with ESMTP id 2PM5DBDJRKMZ;
	Sat, 21 Aug 2010 12:53:43 -0500
Mime-Version: 1.0 (Apple Message framework v1081)
Content-Type: text/plain; charset=us-ascii
From: Rui Paulo 
In-Reply-To: <86mxsfuatq.fsf@gmail.com>
Date: Sat, 21 Aug 2010 18:53:33 +0100
Content-Transfer-Encoding: 7bit
Message-Id: <6AC9F4D1-64C7-4432-BE0D-73AE20D506DF@FreeBSD.org>
References: <201008211729.o7LHTxjY076184__28575.1806608916$1282411832$gmane$org@svn.freebsd.org>
	<86mxsfuatq.fsf@gmail.com>
To: Anonymous 
X-Mailer: Apple Mail (2.1081)
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org,
	src-committers@freebsd.org
Subject: Re: svn commit: r211577 - in head: . cddl/lib/drti lib/libelf
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 17:53:44 -0000


On 21 Aug 2010, at 18:36, Anonymous wrote:

> Rui Paulo  writes:
> 
>> Author: rpaulo
>> Date: Sat Aug 21 17:29:59 2010
>> New Revision: 211577
>> URL: http://svn.freebsd.org/changeset/base/211577
>> 
>> Log:
>>  Don't link drti.o with libelf_pic.a. This means that all software with
>>  userland SDT probes must be linked with libelf explicitly.
>> 
>>  Requested by:	kib
>>  Sponsored by:	The FreeBSD Foundation
>> 
>> Modified:
>>  head/Makefile.inc1
>>  head/cddl/lib/drti/Makefile
>>  head/lib/libelf/Makefile
>> 
> 
> I think there was one more file.

Thanks, fixed.

Regards,
--
Rui Paulo



From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 18:20:52 2010
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 377B110656AD
	for ; Sat, 21 Aug 2010 18:20:52 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4])
	by mx1.freebsd.org (Postfix) with ESMTP id B66638FC15
	for ; Sat, 21 Aug 2010 18:20:51 +0000 (UTC)
Received: (qmail 17788 invoked by uid 399); 21 Aug 2010 18:20:50 -0000
Received: from localhost (HELO lap.dougb.net) (dougb@dougbarton.us@127.0.0.1)
	by localhost with ESMTPAM; 21 Aug 2010 18:20:50 -0000
X-Originating-IP: 127.0.0.1
X-Sender: dougb@dougbarton.us
Message-ID: <4C701901.8030505@FreeBSD.org>
Date: Sat, 21 Aug 2010 11:20:49 -0700
From: Doug Barton 
Organization: http://SupersetSolutions.com/
User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US;
	rv:1.9.2.8) Gecko/20100807 Thunderbird/3.1.2
MIME-Version: 1.0
To: Rui Paulo 
References: <201008191131.o7JBV4Yf002412@svn.freebsd.org>
	<4C6D18BE.2000905@fer.hr> <4C6D95A8.9070105@FreeBSD.org>
	<20100819213159.B48418@maildrop.int.zabbadoz.net>
	<4C6DDB74.3090102@FreeBSD.org>
	<7186318F-0921-41E5-9641-3D6B45E0623B@FreeBSD.org>
In-Reply-To: <7186318F-0921-41E5-9641-3D6B45E0623B@FreeBSD.org>
X-Enigmail-Version: 1.1.2
OpenPGP: id=1A1ABC84
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Cc: svn-src-head@FreeBSD.org, Ana Kukec ,
	svn-src-all@FreeBSD.org, "Bjoern A. Zeeb" ,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r211501 - in head/sys: modules modules/send netinet
 netinet6 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: Sat, 21 Aug 2010 18:20:52 -0000

On 08/21/2010 05:07, Rui Paulo wrote:
>> Meanwhile, the fact that in the past code has been committed
>> without man pages is the exact cause of the problem you're
>> describing. It is certainly not a justification for continuing to
>> do it wrong.
>
> Reverting code just because it doesn't have a man page is pointless.
> Everyone can write the damn man page, but not everyone can write
> code. You should really take this into consideration when proposing a
> commit to be reverted.

So let's assume that having lots of code in the tree without a man page 
is a problem. Further, let's assume that we don't want the problem to 
get worse. How do you propose that we accomplish that?


Doug

-- 

	Improve the effectiveness of your Internet presence with
	a domain name makeover!    http://SupersetSolutions.com/

	Computers are useless. They can only give you answers.
			-- Pablo Picasso


From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 18:20:56 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 597231065679;
	Sat, 21 Aug 2010 18:20:56 +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 487E78FC19;
	Sat, 21 Aug 2010 18:20:56 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LIKuMD077345;
	Sat, 21 Aug 2010 18:20:56 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LIKupm077343;
	Sat, 21 Aug 2010 18:20:56 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201008211820.o7LIKupm077343@svn.freebsd.org>
From: Andriy Gapon 
Date: Sat, 21 Aug 2010 18:20: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: r211581 -
	stable/8/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: Sat, 21 Aug 2010 18:20:56 -0000

Author: avg
Date: Sat Aug 21 18:20:56 2010
New Revision: 211581
URL: http://svn.freebsd.org/changeset/base/211581

Log:
  MFC r210427: zfs arc_memory_throttle: available memory is free + cache

Modified:
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cam/   (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/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
==============================================================================
--- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Sat Aug 21 17:53:16 2010	(r211580)
+++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Sat Aug 21 18:20:56 2010	(r211581)
@@ -3612,6 +3612,8 @@ arc_memory_throttle(uint64_t reserve, ui
 #ifdef _KERNEL
 	uint64_t inflight_data = arc_anon->arcs_size;
 	uint64_t available_memory = ptoa((uintmax_t)cnt.v_free_count);
+	uint64_t available_memory = ptoa((uintmax_t)cnt.v_free_count
+	    + cnt.v_cache_count);
 	static uint64_t page_load = 0;
 	static uint64_t last_txg = 0;
 

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 18:26:55 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id CE6BD1065675;
	Sat, 21 Aug 2010 18:26:55 +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 BCF0F8FC15;
	Sat, 21 Aug 2010 18:26:55 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LIQtg8077439;
	Sat, 21 Aug 2010 18:26:55 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LIQtJV077437;
	Sat, 21 Aug 2010 18:26:55 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201008211826.o7LIQtJV077437@svn.freebsd.org>
From: Andriy Gapon 
Date: Sat, 21 Aug 2010 18:26:55 +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: r211582 -
	stable/7/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: Sat, 21 Aug 2010 18:26:55 -0000

Author: avg
Date: Sat Aug 21 18:26:55 2010
New Revision: 211582
URL: http://svn.freebsd.org/changeset/base/211582

Log:
  MFC r210427: zfs arc_memory_throttle: available memory is free + cache

Modified:
  stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.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/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
==============================================================================
--- stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Sat Aug 21 18:20:56 2010	(r211581)
+++ stable/7/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Sat Aug 21 18:26:55 2010	(r211582)
@@ -3297,6 +3297,8 @@ arc_memory_throttle(uint64_t reserve, ui
 #ifdef _KERNEL
 	uint64_t inflight_data = arc_anon->arcs_size;
 	uint64_t available_memory = ptoa((uintmax_t)cnt.v_free_count);
+	uint64_t available_memory = ptoa((uintmax_t)cnt.v_free_count
+	    + cnt.v_cache_count);
 	static uint64_t page_load = 0;
 	static uint64_t last_txg = 0;
 

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 18:38:57 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 1EC2110656A5;
	Sat, 21 Aug 2010 18:38:57 +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 D0E328FC13;
	Sat, 21 Aug 2010 18:38:56 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LIcuaq077670;
	Sat, 21 Aug 2010 18:38:56 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LIcupO077668;
	Sat, 21 Aug 2010 18:38:56 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201008211838.o7LIcupO077668@svn.freebsd.org>
From: Andriy Gapon 
Date: Sat, 21 Aug 2010 18:38: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: r211583 - stable/8/contrib/binutils/ld/emultempl
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 18:38:57 -0000

Author: avg
Date: Sat Aug 21 18:38:56 2010
New Revision: 211583
URL: http://svn.freebsd.org/changeset/base/211583

Log:
  MFC r210245: binutils/ld: fix incorrect placement of __start_SECNAME in
  some cases

Modified:
  stable/8/contrib/binutils/ld/emultempl/elf32.em
Directory Properties:
  stable/8/contrib/binutils/   (props changed)

Modified: stable/8/contrib/binutils/ld/emultempl/elf32.em
==============================================================================
--- stable/8/contrib/binutils/ld/emultempl/elf32.em	Sat Aug 21 18:26:55 2010	(r211582)
+++ stable/8/contrib/binutils/ld/emultempl/elf32.em	Sat Aug 21 18:38:56 2010	(r211583)
@@ -1314,26 +1314,6 @@ gld${EMULATION_NAME}_place_orphan (lang_
       lang_list_init (stat_ptr);
     }
 
-  if (config.build_constructors)
-    {
-      /* If the name of the section is representable in C, then create
-	 symbols to mark the start and the end of the section.  */
-      for (ps = secname; *ps != '\0'; ps++)
-	if (! ISALNUM (*ps) && *ps != '_')
-	  break;
-      if (*ps == '\0')
-	{
-	  char *symname;
-	  etree_type *e_align;
-
-	  symname = (char *) xmalloc (ps - secname + sizeof "__start_");
-	  sprintf (symname, "__start_%s", secname);
-	  e_align = exp_unop (ALIGN_K,
-			      exp_intop ((bfd_vma) 1 << s->alignment_power));
-	  lang_add_assignment (exp_assop ('=', symname, e_align));
-	}
-    }
-
   address = NULL;
   if (link_info.relocatable || (s->flags & (SEC_LOAD | SEC_ALLOC)) == 0)
     address = exp_intop ((bfd_vma) 0);
@@ -1354,6 +1334,26 @@ gld${EMULATION_NAME}_place_orphan (lang_
 					    (etree_type *) NULL,
 					    load_base);
 
+  if (config.build_constructors)
+    {
+      /* If the name of the section is representable in C, then create
+	 symbols to mark the start and the end of the section.  */
+      for (ps = secname; *ps != '\0'; ps++)
+	if (! ISALNUM (*ps) && *ps != '_')
+	  break;
+      if (*ps == '\0')
+	{
+	  char *symname;
+	  etree_type *e_align;
+
+	  symname = (char *) xmalloc (ps - secname + sizeof "__start_");
+	  sprintf (symname, "__start_%s", secname);
+	  lang_add_assignment (exp_assop ('=', symname,
+					  exp_unop (ABSOLUTE,
+						    exp_nameop (NAME, "."))));
+	}
+    }
+
   lang_add_section (&os->children, s, os, file);
 
   lang_leave_output_section_statement

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 18:40:43 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 54FEB1065698;
	Sat, 21 Aug 2010 18:40:43 +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 29FD38FC14;
	Sat, 21 Aug 2010 18:40:43 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LIehaJ077758;
	Sat, 21 Aug 2010 18:40:43 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LIehIB077756;
	Sat, 21 Aug 2010 18:40:43 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201008211840.o7LIehIB077756@svn.freebsd.org>
From: Andriy Gapon 
Date: Sat, 21 Aug 2010 18:40: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: r211584 - stable/7/contrib/binutils/ld/emultempl
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 18:40:43 -0000

Author: avg
Date: Sat Aug 21 18:40:42 2010
New Revision: 211584
URL: http://svn.freebsd.org/changeset/base/211584

Log:
  MFC r210245: binutils/ld: fix incorrect placement of __start_SECNAME in
  some cases

Modified:
  stable/7/contrib/binutils/ld/emultempl/elf32.em
Directory Properties:
  stable/7/contrib/binutils/   (props changed)

Modified: stable/7/contrib/binutils/ld/emultempl/elf32.em
==============================================================================
--- stable/7/contrib/binutils/ld/emultempl/elf32.em	Sat Aug 21 18:38:56 2010	(r211583)
+++ stable/7/contrib/binutils/ld/emultempl/elf32.em	Sat Aug 21 18:40:42 2010	(r211584)
@@ -1314,26 +1314,6 @@ gld${EMULATION_NAME}_place_orphan (lang_
       lang_list_init (stat_ptr);
     }
 
-  if (config.build_constructors)
-    {
-      /* If the name of the section is representable in C, then create
-	 symbols to mark the start and the end of the section.  */
-      for (ps = secname; *ps != '\0'; ps++)
-	if (! ISALNUM (*ps) && *ps != '_')
-	  break;
-      if (*ps == '\0')
-	{
-	  char *symname;
-	  etree_type *e_align;
-
-	  symname = (char *) xmalloc (ps - secname + sizeof "__start_");
-	  sprintf (symname, "__start_%s", secname);
-	  e_align = exp_unop (ALIGN_K,
-			      exp_intop ((bfd_vma) 1 << s->alignment_power));
-	  lang_add_assignment (exp_assop ('=', symname, e_align));
-	}
-    }
-
   address = NULL;
   if (link_info.relocatable || (s->flags & (SEC_LOAD | SEC_ALLOC)) == 0)
     address = exp_intop ((bfd_vma) 0);
@@ -1354,6 +1334,26 @@ gld${EMULATION_NAME}_place_orphan (lang_
 					    (etree_type *) NULL,
 					    load_base);
 
+  if (config.build_constructors)
+    {
+      /* If the name of the section is representable in C, then create
+	 symbols to mark the start and the end of the section.  */
+      for (ps = secname; *ps != '\0'; ps++)
+	if (! ISALNUM (*ps) && *ps != '_')
+	  break;
+      if (*ps == '\0')
+	{
+	  char *symname;
+	  etree_type *e_align;
+
+	  symname = (char *) xmalloc (ps - secname + sizeof "__start_");
+	  sprintf (symname, "__start_%s", secname);
+	  lang_add_assignment (exp_assop ('=', symname,
+					  exp_unop (ABSOLUTE,
+						    exp_nameop (NAME, "."))));
+	}
+    }
+
   lang_add_section (&os->children, s, os, file);
 
   lang_leave_output_section_statement

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 18:48:24 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 8B7B110656A8;
	Sat, 21 Aug 2010 18:48:24 +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 607D28FC0C;
	Sat, 21 Aug 2010 18:48:24 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LImOXw077969;
	Sat, 21 Aug 2010 18:48:24 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LImOkb077966;
	Sat, 21 Aug 2010 18:48:24 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201008211848.o7LImOkb077966@svn.freebsd.org>
From: Andriy Gapon 
Date: Sat, 21 Aug 2010 18:48:24 +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: r211585 - in stable/8/sys: boot/common 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, 21 Aug 2010 18:48:24 -0000

Author: avg
Date: Sat Aug 21 18:48:24 2010
New Revision: 211585
URL: http://svn.freebsd.org/changeset/base/211585

Log:
  MFC r210423: completely ignore zero-sized elf sections in modules of elf
  object type (amd64)

Modified:
  stable/8/sys/boot/common/load_elf_obj.c
  stable/8/sys/kern/link_elf_obj.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cam/   (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/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/boot/common/load_elf_obj.c
==============================================================================
--- stable/8/sys/boot/common/load_elf_obj.c	Sat Aug 21 18:40:42 2010	(r211584)
+++ stable/8/sys/boot/common/load_elf_obj.c	Sat Aug 21 18:48:24 2010	(r211585)
@@ -221,6 +221,8 @@ __elfN(obj_loadimage)(struct preloaded_f
 	for (i = 0; i < hdr->e_shnum; i++)
 		shdr[i].sh_addr = 0;
 	for (i = 0; i < hdr->e_shnum; i++) {
+		if (shdr[i].sh_size == 0)
+			continue;
 		switch (shdr[i].sh_type) {
 		case SHT_PROGBITS:
 		case SHT_NOBITS:

Modified: stable/8/sys/kern/link_elf_obj.c
==============================================================================
--- stable/8/sys/kern/link_elf_obj.c	Sat Aug 21 18:40:42 2010	(r211584)
+++ stable/8/sys/kern/link_elf_obj.c	Sat Aug 21 18:48:24 2010	(r211585)
@@ -555,6 +555,8 @@ link_elf_load_file(linker_class_t cls, c
 	symtabindex = -1;
 	symstrindex = -1;
 	for (i = 0; i < hdr->e_shnum; i++) {
+		if (shdr[i].sh_size == 0)
+			continue;
 		switch (shdr[i].sh_type) {
 		case SHT_PROGBITS:
 		case SHT_NOBITS:
@@ -677,6 +679,8 @@ link_elf_load_file(linker_class_t cls, c
 	/* Size up code/data(progbits) and bss(nobits). */
 	alignmask = 0;
 	for (i = 0; i < hdr->e_shnum; i++) {
+		if (shdr[i].sh_size == 0)
+			continue;
 		switch (shdr[i].sh_type) {
 		case SHT_PROGBITS:
 		case SHT_NOBITS:
@@ -737,6 +741,8 @@ link_elf_load_file(linker_class_t cls, c
 	ra = 0;
 	alignmask = 0;
 	for (i = 0; i < hdr->e_shnum; i++) {
+		if (shdr[i].sh_size == 0)
+			continue;
 		switch (shdr[i].sh_type) {
 		case SHT_PROGBITS:
 		case SHT_NOBITS:

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 18:51:25 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B4DAE1065672;
	Sat, 21 Aug 2010 18:51:25 +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 8A2C58FC1A;
	Sat, 21 Aug 2010 18:51:25 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LIpPXf078079;
	Sat, 21 Aug 2010 18:51:25 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LIpPaC078076;
	Sat, 21 Aug 2010 18:51:25 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201008211851.o7LIpPaC078076@svn.freebsd.org>
From: Andriy Gapon 
Date: Sat, 21 Aug 2010 18:51: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: r211586 - in stable/7/sys: boot/common 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, 21 Aug 2010 18:51:25 -0000

Author: avg
Date: Sat Aug 21 18:51:25 2010
New Revision: 211586
URL: http://svn.freebsd.org/changeset/base/211586

Log:
  MFC r210423: completely ignore zero-sized elf sections in modules of elf
  object type (amd64)

Modified:
  stable/7/sys/boot/common/load_elf_obj.c
  stable/7/sys/kern/link_elf_obj.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/boot/common/load_elf_obj.c
==============================================================================
--- stable/7/sys/boot/common/load_elf_obj.c	Sat Aug 21 18:48:24 2010	(r211585)
+++ stable/7/sys/boot/common/load_elf_obj.c	Sat Aug 21 18:51:25 2010	(r211586)
@@ -221,6 +221,8 @@ __elfN(obj_loadimage)(struct preloaded_f
 	for (i = 0; i < hdr->e_shnum; i++)
 		shdr[i].sh_addr = 0;
 	for (i = 0; i < hdr->e_shnum; i++) {
+		if (shdr[i].sh_size == 0)
+			continue;
 		switch (shdr[i].sh_type) {
 		case SHT_PROGBITS:
 		case SHT_NOBITS:

Modified: stable/7/sys/kern/link_elf_obj.c
==============================================================================
--- stable/7/sys/kern/link_elf_obj.c	Sat Aug 21 18:48:24 2010	(r211585)
+++ stable/7/sys/kern/link_elf_obj.c	Sat Aug 21 18:51:25 2010	(r211586)
@@ -522,6 +522,8 @@ link_elf_load_file(linker_class_t cls, c
 	symtabindex = -1;
 	symstrindex = -1;
 	for (i = 0; i < hdr->e_shnum; i++) {
+		if (shdr[i].sh_size == 0)
+			continue;
 		switch (shdr[i].sh_type) {
 		case SHT_PROGBITS:
 		case SHT_NOBITS:
@@ -644,6 +646,8 @@ link_elf_load_file(linker_class_t cls, c
 	/* Size up code/data(progbits) and bss(nobits). */
 	alignmask = 0;
 	for (i = 0; i < hdr->e_shnum; i++) {
+		if (shdr[i].sh_size == 0)
+			continue;
 		switch (shdr[i].sh_type) {
 		case SHT_PROGBITS:
 		case SHT_NOBITS:
@@ -704,6 +708,8 @@ link_elf_load_file(linker_class_t cls, c
 	ra = 0;
 	alignmask = 0;
 	for (i = 0; i < hdr->e_shnum; i++) {
+		if (shdr[i].sh_size == 0)
+			continue;
 		switch (shdr[i].sh_type) {
 		case SHT_PROGBITS:
 		case SHT_NOBITS:

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 18:54:13 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id B7EA41065674;
	Sat, 21 Aug 2010 18:54:13 +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 8D02B8FC17;
	Sat, 21 Aug 2010 18:54:13 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LIsDBI078174;
	Sat, 21 Aug 2010 18:54:13 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LIsDKw078172;
	Sat, 21 Aug 2010 18:54:13 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201008211854.o7LIsDKw078172@svn.freebsd.org>
From: Andriy Gapon 
Date: Sat, 21 Aug 2010 18:54:13 +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: r211587 - stable/8/gnu/usr.bin/gdb/kgdb
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 18:54:13 -0000

Author: avg
Date: Sat Aug 21 18:54:13 2010
New Revision: 211587
URL: http://svn.freebsd.org/changeset/base/211587

Log:
  MFC r210424: kgdb: correctly map sections to addresses in elf object
  modules (amd64)

Modified:
  stable/8/gnu/usr.bin/gdb/kgdb/kld.c
Directory Properties:
  stable/8/gnu/usr.bin/gdb/kgdb/   (props changed)

Modified: stable/8/gnu/usr.bin/gdb/kgdb/kld.c
==============================================================================
--- stable/8/gnu/usr.bin/gdb/kgdb/kld.c	Sat Aug 21 18:51:25 2010	(r211586)
+++ stable/8/gnu/usr.bin/gdb/kgdb/kld.c	Sat Aug 21 18:54:13 2010	(r211587)
@@ -198,12 +198,32 @@ find_kld_address (char *arg, CORE_ADDR *
 }
 
 static void
+adjust_section_address (struct section_table *sec, CORE_ADDR *curr_base)
+{
+	struct bfd_section *asect = sec->the_bfd_section;
+	bfd *abfd = sec->bfd;
+
+	if ((abfd->flags & (EXEC_P | DYNAMIC)) != 0) {
+		sec->addr += *curr_base;
+		sec->endaddr += *curr_base;
+		return;
+	}
+
+	*curr_base = align_power(*curr_base,
+	    bfd_get_section_alignment(abfd, asect));
+	sec->addr = *curr_base;
+	sec->endaddr = sec->addr + bfd_section_size(abfd, asect);
+	*curr_base = sec->endaddr;
+}
+
+static void
 load_kld (char *path, CORE_ADDR base_addr, int from_tty)
 {
 	struct section_addr_info *sap;
 	struct section_table *sections = NULL, *sections_end = NULL, *s;
 	struct cleanup *cleanup;
 	bfd *bfd;
+	CORE_ADDR curr_addr;
 	int i;
 
 	/* Open the kld. */
@@ -224,10 +244,9 @@ load_kld (char *path, CORE_ADDR base_add
 	if (build_section_table (bfd, §ions, §ions_end))
 		error("\"%s\": can't find file sections", path);
 	cleanup = make_cleanup(xfree, sections);
-	for (s = sections; s < sections_end; s++) {
-		s->addr += base_addr;
-		s->endaddr += base_addr;
-	}
+	curr_addr = base_addr;
+	for (s = sections; s < sections_end; s++)
+		adjust_section_address(s, &curr_addr);
 
 	/* Build a section addr info to pass to symbol_file_add(). */
 	sap = build_section_addr_info_from_section_table (sections,
@@ -284,9 +303,12 @@ kgdb_add_kld_cmd (char *arg, int from_tt
 static void
 kld_relocate_section_addresses (struct so_list *so, struct section_table *sec)
 {
+	static CORE_ADDR curr_addr;
+
+	if (sec == so->sections)
+		curr_addr = so->lm_info->base_address;
 
-	sec->addr += so->lm_info->base_address;
-	sec->endaddr += so->lm_info->base_address;
+	adjust_section_address(sec, &curr_addr);
 }
 
 static void

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 18:55:29 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4C1DD1065693;
	Sat, 21 Aug 2010 18:55:29 +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 2159A8FC14;
	Sat, 21 Aug 2010 18:55:29 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LItTMJ078268;
	Sat, 21 Aug 2010 18:55:29 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LItTco078266;
	Sat, 21 Aug 2010 18:55:29 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201008211855.o7LItTco078266@svn.freebsd.org>
From: Andriy Gapon 
Date: Sat, 21 Aug 2010 18:55: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: r211588 - stable/7/gnu/usr.bin/gdb/kgdb
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 18:55:29 -0000

Author: avg
Date: Sat Aug 21 18:55:28 2010
New Revision: 211588
URL: http://svn.freebsd.org/changeset/base/211588

Log:
  MFC r210424: kgdb: correctly map sections to addresses in elf object
  modules (amd64)

Modified:
  stable/7/gnu/usr.bin/gdb/kgdb/kld.c
Directory Properties:
  stable/7/gnu/usr.bin/gdb/kgdb/   (props changed)

Modified: stable/7/gnu/usr.bin/gdb/kgdb/kld.c
==============================================================================
--- stable/7/gnu/usr.bin/gdb/kgdb/kld.c	Sat Aug 21 18:54:13 2010	(r211587)
+++ stable/7/gnu/usr.bin/gdb/kgdb/kld.c	Sat Aug 21 18:55:28 2010	(r211588)
@@ -198,12 +198,32 @@ find_kld_address (char *arg, CORE_ADDR *
 }
 
 static void
+adjust_section_address (struct section_table *sec, CORE_ADDR *curr_base)
+{
+	struct bfd_section *asect = sec->the_bfd_section;
+	bfd *abfd = sec->bfd;
+
+	if ((abfd->flags & (EXEC_P | DYNAMIC)) != 0) {
+		sec->addr += *curr_base;
+		sec->endaddr += *curr_base;
+		return;
+	}
+
+	*curr_base = align_power(*curr_base,
+	    bfd_get_section_alignment(abfd, asect));
+	sec->addr = *curr_base;
+	sec->endaddr = sec->addr + bfd_section_size(abfd, asect);
+	*curr_base = sec->endaddr;
+}
+
+static void
 load_kld (char *path, CORE_ADDR base_addr, int from_tty)
 {
 	struct section_addr_info *sap;
 	struct section_table *sections = NULL, *sections_end = NULL, *s;
 	struct cleanup *cleanup;
 	bfd *bfd;
+	CORE_ADDR curr_addr;
 	int i;
 
 	/* Open the kld. */
@@ -224,10 +244,9 @@ load_kld (char *path, CORE_ADDR base_add
 	if (build_section_table (bfd, §ions, §ions_end))
 		error("\"%s\": can't find file sections", path);
 	cleanup = make_cleanup(xfree, sections);
-	for (s = sections; s < sections_end; s++) {
-		s->addr += base_addr;
-		s->endaddr += base_addr;
-	}
+	curr_addr = base_addr;
+	for (s = sections; s < sections_end; s++)
+		adjust_section_address(s, &curr_addr);
 
 	/* Build a section addr info to pass to symbol_file_add(). */
 	sap = build_section_addr_info_from_section_table (sections,
@@ -284,9 +303,12 @@ kgdb_add_kld_cmd (char *arg, int from_tt
 static void
 kld_relocate_section_addresses (struct so_list *so, struct section_table *sec)
 {
+	static CORE_ADDR curr_addr;
+
+	if (sec == so->sections)
+		curr_addr = so->lm_info->base_address;
 
-	sec->addr += so->lm_info->base_address;
-	sec->endaddr += so->lm_info->base_address;
+	adjust_section_address(sec, &curr_addr);
 }
 
 static void

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 19:02:49 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 67ACC106564A;
	Sat, 21 Aug 2010 19:02:49 +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 562218FC14;
	Sat, 21 Aug 2010 19:02:49 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LJ2n0b078462;
	Sat, 21 Aug 2010 19:02:49 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LJ2n94078459;
	Sat, 21 Aug 2010 19:02:49 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201008211902.o7LJ2n94078459@svn.freebsd.org>
From: Andriy Gapon 
Date: Sat, 21 Aug 2010 19:02: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: r211589 -
	stable/8/cddl/contrib/opensolaris/lib/libdtrace/common
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 19:02:49 -0000

Author: avg
Date: Sat Aug 21 19:02:49 2010
New Revision: 211589
URL: http://svn.freebsd.org/changeset/base/211589

Log:
  MFC r210425: dtrace: correctly map sections to addresses in elf object
  modules (amd64)

Modified:
  stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h
  stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c
Directory Properties:
  stable/8/cddl/contrib/opensolaris/   (props changed)

Modified: stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h
==============================================================================
--- stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h	Sat Aug 21 18:55:28 2010	(r211588)
+++ stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h	Sat Aug 21 19:02:49 2010	(r211589)
@@ -137,6 +137,7 @@ typedef struct dt_module {
 	dt_idhash_t *dm_extern;	/* external symbol definitions */
 #if !defined(sun)
 	caddr_t dm_reloc_offset;	/* Symbol relocation offset. */
+	uintptr_t *dm_sec_offsets;
 #endif
 } dt_module_t;
 

Modified: stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c
==============================================================================
--- stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c	Sat Aug 21 18:55:28 2010	(r211588)
+++ stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c	Sat Aug 21 19:02:49 2010	(r211589)
@@ -83,6 +83,14 @@ dt_module_syminit32(dt_module_t *dmp)
 	uint_t i, n = dmp->dm_nsymelems;
 	uint_t asrsv = 0;
 
+#if defined(__FreeBSD__)
+	GElf_Ehdr ehdr;
+	int is_elf_obj;
+
+	gelf_getehdr(dmp->dm_elf, &ehdr);
+	is_elf_obj = (ehdr.e_type == ET_REL);
+#endif
+
 	for (i = 0; i < n; i++, sym++) {
 		const char *name = base + sym->st_name;
 		uchar_t type = ELF32_ST_TYPE(sym->st_info);
@@ -97,8 +105,12 @@ dt_module_syminit32(dt_module_t *dmp)
 		    (ELF32_ST_BIND(sym->st_info) != STB_LOCAL || sym->st_size)) {
 			asrsv++; /* reserve space in the address map */
 
-#if !defined(sun)
+#if defined(__FreeBSD__)
 			sym->st_value += (Elf_Addr) dmp->dm_reloc_offset;
+			if (is_elf_obj && sym->st_shndx != SHN_UNDEF &&
+			    sym->st_shndx < ehdr.e_shnum)
+				sym->st_value +=
+				    dmp->dm_sec_offsets[sym->st_shndx];
 #endif
 		}
 
@@ -117,6 +129,14 @@ dt_module_syminit64(dt_module_t *dmp)
 	uint_t i, n = dmp->dm_nsymelems;
 	uint_t asrsv = 0;
 
+#if defined(__FreeBSD__)
+	GElf_Ehdr ehdr;
+	int is_elf_obj;
+
+	gelf_getehdr(dmp->dm_elf, &ehdr);
+	is_elf_obj = (ehdr.e_type == ET_REL);
+#endif
+
 	for (i = 0; i < n; i++, sym++) {
 		const char *name = base + sym->st_name;
 		uchar_t type = ELF64_ST_TYPE(sym->st_info);
@@ -130,9 +150,12 @@ dt_module_syminit64(dt_module_t *dmp)
 		if (sym->st_value != 0 &&
 		    (ELF64_ST_BIND(sym->st_info) != STB_LOCAL || sym->st_size)) {
 			asrsv++; /* reserve space in the address map */
-
-#if !defined(sun)
+#if defined(__FreeBSD__)
 			sym->st_value += (Elf_Addr) dmp->dm_reloc_offset;
+			if (is_elf_obj && sym->st_shndx != SHN_UNDEF &&
+			    sym->st_shndx < ehdr.e_shnum)
+				sym->st_value +=
+				    dmp->dm_sec_offsets[sym->st_shndx];
 #endif
 		}
 
@@ -722,7 +745,12 @@ dt_module_unload(dtrace_hdl_t *dtp, dt_m
 		free(dmp->dm_asmap);
 		dmp->dm_asmap = NULL;
 	}
-
+#if defined(__FreeBSD__)
+	if (dmp->dm_sec_offsets != NULL) {
+		free(dmp->dm_sec_offsets);
+		dmp->dm_sec_offsets = NULL;
+	}
+#endif
 	dmp->dm_symfree = 0;
 	dmp->dm_nsymbuckets = 0;
 	dmp->dm_nsymelems = 0;
@@ -846,9 +874,12 @@ dt_module_update(dtrace_hdl_t *dtp, stru
 	(void) snprintf(fname, sizeof (fname),
 	    "%s/%s/object", OBJFS_ROOT, name);
 #else
+	GElf_Ehdr ehdr;
 	GElf_Phdr ph;
 	char name[MAXPATHLEN];
+	uintptr_t mapbase, alignmask;
 	int i = 0;
+	int is_elf_obj;
 
 	(void) strlcpy(name, k_stat->name, sizeof(name));
 	(void) strlcpy(fname, k_stat->pathname, sizeof(fname));
@@ -893,7 +924,20 @@ dt_module_update(dtrace_hdl_t *dtp, stru
 		dt_module_destroy(dtp, dmp);
 		return;
 	}
-
+#if defined(__FreeBSD__)
+	mapbase = (uintptr_t)k_stat->address;
+	gelf_getehdr(dmp->dm_elf, &ehdr);
+	is_elf_obj = (ehdr.e_type == ET_REL);
+	if (is_elf_obj) {
+		dmp->dm_sec_offsets =
+		    malloc(ehdr.e_shnum * sizeof(*dmp->dm_sec_offsets));
+		if (dmp->dm_sec_offsets == NULL) {
+			dt_dprintf("failed to allocate memory\n");
+			dt_module_destroy(dtp, dmp);
+			return;
+		}
+	}
+#endif
 	/*
 	 * Iterate over the section headers locating various sections of
 	 * interest and use their attributes to flesh out the dt_module_t.
@@ -902,7 +946,19 @@ dt_module_update(dtrace_hdl_t *dtp, stru
 		if (gelf_getshdr(sp, &sh) == NULL || sh.sh_type == SHT_NULL ||
 		    (s = elf_strptr(dmp->dm_elf, shstrs, sh.sh_name)) == NULL)
 			continue; /* skip any malformed sections */
-
+#if defined(__FreeBSD__)
+		if (sh.sh_size == 0)
+			continue;
+		if (is_elf_obj && (sh.sh_type == SHT_PROGBITS ||
+		    sh.sh_type == SHT_NOBITS)) {
+			alignmask = sh.sh_addralign - 1;
+			mapbase += alignmask;
+			mapbase &= ~alignmask;
+			sh.sh_addr = mapbase;
+			dmp->dm_sec_offsets[elf_ndxscn(sp)] = sh.sh_addr;
+			mapbase += sh.sh_size;
+		}
+#endif
 		if (strcmp(s, ".text") == 0) {
 			dmp->dm_text_size = sh.sh_size;
 			dmp->dm_text_va = sh.sh_addr;
@@ -927,6 +983,13 @@ dt_module_update(dtrace_hdl_t *dtp, stru
 #if defined(sun)
 	dmp->dm_modid = (int)OBJFS_MODID(st.st_ino);
 #else
+	/*
+	 * Include .rodata and special sections into .text.
+	 * This depends on default section layout produced by GNU ld
+	 * for ELF objects and libraries:
+	 * [Text][R/O data][R/W data][Dynamic][BSS][Non loadable]
+	 */
+	dmp->dm_text_size = dmp->dm_data_va - dmp->dm_text_va;
 #if defined(__i386__)
 	/*
 	 * Find the first load section and figure out the relocation

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 19:09:34 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 81F0B10656A3;
	Sat, 21 Aug 2010 19:09:34 +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 706EE8FC08;
	Sat, 21 Aug 2010 19:09:34 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LJ9Ys1078660;
	Sat, 21 Aug 2010 19:09:34 GMT (envelope-from avg@svn.freebsd.org)
Received: (from avg@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LJ9Yvm078657;
	Sat, 21 Aug 2010 19:09:34 GMT (envelope-from avg@svn.freebsd.org)
Message-Id: <201008211909.o7LJ9Yvm078657@svn.freebsd.org>
From: Andriy Gapon 
Date: Sat, 21 Aug 2010 19:09:34 +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: r211590 -
	stable/7/cddl/contrib/opensolaris/lib/libdtrace/common
X-BeenThere: svn-src-all@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "SVN commit messages 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, 21 Aug 2010 19:09:34 -0000

Author: avg
Date: Sat Aug 21 19:09:34 2010
New Revision: 211590
URL: http://svn.freebsd.org/changeset/base/211590

Log:
  MFC r210425: dtrace: correctly map sections to addresses in elf object
  modules (amd64)

Modified:
  stable/7/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h
  stable/7/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c
Directory Properties:
  stable/7/cddl/contrib/opensolaris/   (props changed)

Modified: stable/7/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h
==============================================================================
--- stable/7/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h	Sat Aug 21 19:02:49 2010	(r211589)
+++ stable/7/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h	Sat Aug 21 19:09:34 2010	(r211590)
@@ -137,6 +137,7 @@ typedef struct dt_module {
 	dt_idhash_t *dm_extern;	/* external symbol definitions */
 #if !defined(sun)
 	caddr_t dm_reloc_offset;	/* Symbol relocation offset. */
+	uintptr_t *dm_sec_offsets;
 #endif
 } dt_module_t;
 

Modified: stable/7/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c
==============================================================================
--- stable/7/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c	Sat Aug 21 19:02:49 2010	(r211589)
+++ stable/7/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c	Sat Aug 21 19:09:34 2010	(r211590)
@@ -83,6 +83,14 @@ dt_module_syminit32(dt_module_t *dmp)
 	uint_t i, n = dmp->dm_nsymelems;
 	uint_t asrsv = 0;
 
+#if defined(__FreeBSD__)
+	GElf_Ehdr ehdr;
+	int is_elf_obj;
+
+	gelf_getehdr(dmp->dm_elf, &ehdr);
+	is_elf_obj = (ehdr.e_type == ET_REL);
+#endif
+
 	for (i = 0; i < n; i++, sym++) {
 		const char *name = base + sym->st_name;
 		uchar_t type = ELF32_ST_TYPE(sym->st_info);
@@ -97,8 +105,12 @@ dt_module_syminit32(dt_module_t *dmp)
 		    (ELF32_ST_BIND(sym->st_info) != STB_LOCAL || sym->st_size)) {
 			asrsv++; /* reserve space in the address map */
 
-#if !defined(sun)
+#if defined(__FreeBSD__)
 			sym->st_value += (Elf_Addr) dmp->dm_reloc_offset;
+			if (is_elf_obj && sym->st_shndx != SHN_UNDEF &&
+			    sym->st_shndx < ehdr.e_shnum)
+				sym->st_value +=
+				    dmp->dm_sec_offsets[sym->st_shndx];
 #endif
 		}
 
@@ -117,6 +129,14 @@ dt_module_syminit64(dt_module_t *dmp)
 	uint_t i, n = dmp->dm_nsymelems;
 	uint_t asrsv = 0;
 
+#if defined(__FreeBSD__)
+	GElf_Ehdr ehdr;
+	int is_elf_obj;
+
+	gelf_getehdr(dmp->dm_elf, &ehdr);
+	is_elf_obj = (ehdr.e_type == ET_REL);
+#endif
+
 	for (i = 0; i < n; i++, sym++) {
 		const char *name = base + sym->st_name;
 		uchar_t type = ELF64_ST_TYPE(sym->st_info);
@@ -130,9 +150,12 @@ dt_module_syminit64(dt_module_t *dmp)
 		if (sym->st_value != 0 &&
 		    (ELF64_ST_BIND(sym->st_info) != STB_LOCAL || sym->st_size)) {
 			asrsv++; /* reserve space in the address map */
-
-#if !defined(sun)
+#if defined(__FreeBSD__)
 			sym->st_value += (Elf_Addr) dmp->dm_reloc_offset;
+			if (is_elf_obj && sym->st_shndx != SHN_UNDEF &&
+			    sym->st_shndx < ehdr.e_shnum)
+				sym->st_value +=
+				    dmp->dm_sec_offsets[sym->st_shndx];
 #endif
 		}
 
@@ -722,7 +745,12 @@ dt_module_unload(dtrace_hdl_t *dtp, dt_m
 		free(dmp->dm_asmap);
 		dmp->dm_asmap = NULL;
 	}
-
+#if defined(__FreeBSD__)
+	if (dmp->dm_sec_offsets != NULL) {
+		free(dmp->dm_sec_offsets);
+		dmp->dm_sec_offsets = NULL;
+	}
+#endif
 	dmp->dm_symfree = 0;
 	dmp->dm_nsymbuckets = 0;
 	dmp->dm_nsymelems = 0;
@@ -846,9 +874,12 @@ dt_module_update(dtrace_hdl_t *dtp, stru
 	(void) snprintf(fname, sizeof (fname),
 	    "%s/%s/object", OBJFS_ROOT, name);
 #else
+	GElf_Ehdr ehdr;
 	GElf_Phdr ph;
 	char name[MAXPATHLEN];
+	uintptr_t mapbase, alignmask;
 	int i = 0;
+	int is_elf_obj;
 
 	(void) strlcpy(name, k_stat->name, sizeof(name));
 	(void) strlcpy(fname, k_stat->pathname, sizeof(fname));
@@ -893,7 +924,20 @@ dt_module_update(dtrace_hdl_t *dtp, stru
 		dt_module_destroy(dtp, dmp);
 		return;
 	}
-
+#if defined(__FreeBSD__)
+	mapbase = (uintptr_t)k_stat->address;
+	gelf_getehdr(dmp->dm_elf, &ehdr);
+	is_elf_obj = (ehdr.e_type == ET_REL);
+	if (is_elf_obj) {
+		dmp->dm_sec_offsets =
+		    malloc(ehdr.e_shnum * sizeof(*dmp->dm_sec_offsets));
+		if (dmp->dm_sec_offsets == NULL) {
+			dt_dprintf("failed to allocate memory\n");
+			dt_module_destroy(dtp, dmp);
+			return;
+		}
+	}
+#endif
 	/*
 	 * Iterate over the section headers locating various sections of
 	 * interest and use their attributes to flesh out the dt_module_t.
@@ -902,7 +946,19 @@ dt_module_update(dtrace_hdl_t *dtp, stru
 		if (gelf_getshdr(sp, &sh) == NULL || sh.sh_type == SHT_NULL ||
 		    (s = elf_strptr(dmp->dm_elf, shstrs, sh.sh_name)) == NULL)
 			continue; /* skip any malformed sections */
-
+#if defined(__FreeBSD__)
+		if (sh.sh_size == 0)
+			continue;
+		if (is_elf_obj && (sh.sh_type == SHT_PROGBITS ||
+		    sh.sh_type == SHT_NOBITS)) {
+			alignmask = sh.sh_addralign - 1;
+			mapbase += alignmask;
+			mapbase &= ~alignmask;
+			sh.sh_addr = mapbase;
+			dmp->dm_sec_offsets[elf_ndxscn(sp)] = sh.sh_addr;
+			mapbase += sh.sh_size;
+		}
+#endif
 		if (strcmp(s, ".text") == 0) {
 			dmp->dm_text_size = sh.sh_size;
 			dmp->dm_text_va = sh.sh_addr;
@@ -927,6 +983,13 @@ dt_module_update(dtrace_hdl_t *dtp, stru
 #if defined(sun)
 	dmp->dm_modid = (int)OBJFS_MODID(st.st_ino);
 #else
+	/*
+	 * Include .rodata and special sections into .text.
+	 * This depends on default section layout produced by GNU ld
+	 * for ELF objects and libraries:
+	 * [Text][R/O data][R/W data][Dynamic][BSS][Non loadable]
+	 */
+	dmp->dm_text_size = dmp->dm_data_va - dmp->dm_text_va;
 #if defined(__i386__)
 	/*
 	 * Find the first load section and figure out the relocation

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 19:31:58 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A5D9A106564A;
	Sat, 21 Aug 2010 19:31:58 +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 94E1F8FC0A;
	Sat, 21 Aug 2010 19:31:58 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LJVw7k079178;
	Sat, 21 Aug 2010 19:31:58 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LJVw0x079176;
	Sat, 21 Aug 2010 19:31:58 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201008211931.o7LJVw0x079176@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Sat, 21 Aug 2010 19:31: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: r211591 - stable/8/sys/sun4v/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: Sat, 21 Aug 2010 19:31:58 -0000

Author: nwhitehorn
Date: Sat Aug 21 19:31:58 2010
New Revision: 211591
URL: http://svn.freebsd.org/changeset/base/211591

Log:
  MFC r209963:
  Add a missing architecture declaration to the machine specification
  for sun4v.

Modified:
  stable/8/sys/sun4v/conf/DEFAULTS
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cam/   (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/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/sun4v/conf/DEFAULTS
==============================================================================
--- stable/8/sys/sun4v/conf/DEFAULTS	Sat Aug 21 19:09:34 2010	(r211590)
+++ stable/8/sys/sun4v/conf/DEFAULTS	Sat Aug 21 19:31:58 2010	(r211591)
@@ -3,7 +3,7 @@
 #
 # $FreeBSD$
 
-machine		sun4v
+machine		sun4v sparc64
 
 # Pseudo devices.
 device		mem		# Memory and kernel memory devices

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 20:02:39 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 2732F1065695;
	Sat, 21 Aug 2010 20:02:39 +0000 (UTC)
	(envelope-from rpaulo@freebsd.org)
Received: from karen.lavabit.com (karen.lavabit.com [72.249.41.33])
	by mx1.freebsd.org (Postfix) with ESMTP id 979AF8FC13;
	Sat, 21 Aug 2010 20:02:38 +0000 (UTC)
Received: from d.earth.lavabit.com (d.earth.lavabit.com [192.168.111.13])
	by karen.lavabit.com (Postfix) with ESMTP id 030DB11B8B4;
	Sat, 21 Aug 2010 15:02:38 -0500 (CDT)
Received: from 10.0.10.3 (54.81.54.77.rev.vodafone.pt [77.54.81.54])
	by lavabit.com with ESMTP id C6BMZWVQVM25;
	Sat, 21 Aug 2010 15:02:37 -0500
Mime-Version: 1.0 (Apple Message framework v1081)
Content-Type: text/plain; charset=us-ascii
From: Rui Paulo 
In-Reply-To: <4C701901.8030505@FreeBSD.org>
Date: Sat, 21 Aug 2010 21:02:34 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: 
References: <201008191131.o7JBV4Yf002412@svn.freebsd.org>
	<4C6D18BE.2000905@fer.hr> <4C6D95A8.9070105@FreeBSD.org>
	<20100819213159.B48418@maildrop.int.zabbadoz.net>
	<4C6DDB74.3090102@FreeBSD.org>
	<7186318F-0921-41E5-9641-3D6B45E0623B@FreeBSD.org>
	<4C701901.8030505@FreeBSD.org>
To: Doug Barton 
X-Mailer: Apple Mail (2.1081)
Cc: svn-src-head@FreeBSD.org, Ana Kukec ,
	svn-src-all@FreeBSD.org, "Bjoern A. Zeeb" ,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r211501 - in head/sys: modules modules/send netinet
	netinet6 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: Sat, 21 Aug 2010 20:02:39 -0000


On 21 Aug 2010, at 19:20, Doug Barton wrote:

> On 08/21/2010 05:07, Rui Paulo wrote:
>>> Meanwhile, the fact that in the past code has been committed
>>> without man pages is the exact cause of the problem you're
>>> describing. It is certainly not a justification for continuing to
>>> do it wrong.
>>=20
>> Reverting code just because it doesn't have a man page is pointless.
>> Everyone can write the damn man page, but not everyone can write
>> code. You should really take this into consideration when proposing a
>> commit to be reverted.
>=20
> So let's assume that having lots of code in the tree without a man =
page is a problem. Further, let's assume that we don't want the problem =
to get worse. How do you propose that we accomplish that?

By writing man pages...?

Like I said, everyone can write a man page.. I did write man pages for =
stuff that hasn't had a man page for years (ctfmerge, ctfconvert, etc.).

Regards,
--
Rui Paulo



From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 20:48:09 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id A4F7910656A3;
	Sat, 21 Aug 2010 20:48:09 +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 9364C8FC0A;
	Sat, 21 Aug 2010 20:48:09 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LKm9g9080782;
	Sat, 21 Aug 2010 20:48:09 GMT (envelope-from jilles@svn.freebsd.org)
Received: (from jilles@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LKm9Zb080779;
	Sat, 21 Aug 2010 20:48:09 GMT (envelope-from jilles@svn.freebsd.org)
Message-Id: <201008212048.o7LKm9Zb080779@svn.freebsd.org>
From: Jilles Tjoelker 
Date: Sat, 21 Aug 2010 20:48: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: r211592 - in stable/8: bin/sh
	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, 21 Aug 2010 20:48:09 -0000

Author: jilles
Date: Sat Aug 21 20:48:09 2010
New Revision: 211592
URL: http://svn.freebsd.org/changeset/base/211592

Log:
  MFC r211155: sh: Fix heap-based buffer overflow in pathname generation.
  
  The buffer for generated pathnames could be too small in some cases. It
  happened to be always at least PATH_MAX long, so there was never an overflow
  if the resulting pathnames would be usable.
  
  This bug may be abused if a script subjects input from an untrusted source
  to pathname generation, which a bad idea anyhow. Most shell scripts do not
  work on untrusted data. secteam@ says no advisory is necessary.
  
  PR:		bin/148733
  Reported by:	Changming Sun snnn119 at gmail com

Added:
  stable/8/tools/regression/bin/sh/expansion/pathname3.0
     - copied unchanged from r211155, head/tools/regression/bin/sh/expansion/pathname3.0
Modified:
  stable/8/bin/sh/expand.c
Directory Properties:
  stable/8/bin/sh/   (props changed)
  stable/8/tools/regression/bin/sh/   (props changed)

Modified: stable/8/bin/sh/expand.c
==============================================================================
--- stable/8/bin/sh/expand.c	Sat Aug 21 19:31:58 2010	(r211591)
+++ stable/8/bin/sh/expand.c	Sat Aug 21 20:48:09 2010	(r211592)
@@ -1074,8 +1074,8 @@ ifsbreakup(char *string, struct arglist 
  * should be escapes.  The results are stored in the list exparg.
  */
 
-STATIC char *expdir;
-
+STATIC char expdir[PATH_MAX];
+#define expdir_end (expdir + sizeof(expdir))
 
 STATIC void
 expandmeta(struct strlist *str, int flag __unused)
@@ -1098,14 +1098,7 @@ expandmeta(struct strlist *str, int flag
 		}
 		savelastp = exparg.lastp;
 		INTOFF;
-		if (expdir == NULL) {
-			int i = strlen(str->text);
-			expdir = ckmalloc(i < 2048 ? 2048 : i); /* XXX */
-		}
-
 		expmeta(expdir, str->text);
-		ckfree(expdir);
-		expdir = NULL;
 		INTON;
 		if (exparg.lastp == savelastp) {
 			/*
@@ -1194,6 +1187,8 @@ expmeta(char *enddir, char *name)
 			*enddir++ = *p;
 			if (*p == '\0')
 				break;
+			if (enddir == expdir_end)
+				return;
 		}
 		if (metaflag == 0 || lstat(expdir, &statb) >= 0)
 			addfname(expdir);
@@ -1208,6 +1203,8 @@ expmeta(char *enddir, char *name)
 			if (*p == CTLESC)
 				p++;
 			*enddir++ = *p++;
+			if (enddir == expdir_end)
+				return;
 		}
 	}
 	if (enddir == expdir) {
@@ -1241,15 +1238,17 @@ expmeta(char *enddir, char *name)
 		if (dp->d_name[0] == '.' && ! matchdot)
 			continue;
 		if (patmatch(start, dp->d_name, 0)) {
-			if (atend) {
-				scopy(dp->d_name, enddir);
+			if (enddir + dp->d_namlen + 1 > expdir_end)
+				continue;
+			memcpy(enddir, dp->d_name, dp->d_namlen + 1);
+			if (atend)
 				addfname(expdir);
-			} else {
-				for (p = enddir, q = dp->d_name;
-				     (*p++ = *q++) != '\0';)
+			else {
+				if (enddir + dp->d_namlen + 2 > expdir_end)
 					continue;
-				p[-1] = '/';
-				expmeta(p, endname);
+				enddir[dp->d_namlen] = '/';
+				enddir[dp->d_namlen + 1] = '\0';
+				expmeta(enddir + dp->d_namlen + 1, endname);
 			}
 		}
 	}

Copied: stable/8/tools/regression/bin/sh/expansion/pathname3.0 (from r211155, head/tools/regression/bin/sh/expansion/pathname3.0)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/tools/regression/bin/sh/expansion/pathname3.0	Sat Aug 21 20:48:09 2010	(r211592, copy of r211155, head/tools/regression/bin/sh/expansion/pathname3.0)
@@ -0,0 +1,29 @@
+# $FreeBSD$
+
+v=12345678
+v=$v$v$v$v
+v=$v$v$v$v
+v=$v$v$v$v
+v=$v$v$v$v
+v=$v$v$v$v
+# 8192 bytes
+v=${v##???}
+[ /*/$v = "/*/$v" ] || exit 1
+
+s=////
+s=$s$s$s$s
+s=$s$s$s$s
+s=$s$s$s$s
+s=$s$s$s$s
+# 1024 bytes
+s=${s##??????????}
+[ /var/empt[y]/$s/$v = "/var/empt[y]/$s/$v" ] || exit 2
+while [ ${#s} -lt 1034 ]; do
+	set -- /.${s}et[c]
+	[ ${#s} -gt 1018 ] || [ "$1" = /.${s}etc ] || exit 3
+	set -- /.${s}et[c]/
+	[ ${#s} -gt 1017 ] || [ "$1" = /.${s}etc/ ] || exit 4
+	set -- /.${s}et[c]/.
+	[ ${#s} -gt 1016 ] || [ "$1" = /.${s}etc/. ] || exit 5
+	s=$s/
+done

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 21:15:49 2010
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E793710656A8
	for ; Sat, 21 Aug 2010 21:15:49 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4])
	by mx1.freebsd.org (Postfix) with ESMTP id 89CBE8FC1B
	for ; Sat, 21 Aug 2010 21:15:49 +0000 (UTC)
Received: (qmail 7402 invoked by uid 399); 21 Aug 2010 21:15:47 -0000
Received: from localhost (HELO laptop.dougb.net)
	(dougb@dougbarton.us@127.0.0.1)
	by localhost with ESMTPAM; 21 Aug 2010 21:15:47 -0000
X-Originating-IP: 127.0.0.1
X-Sender: dougb@dougbarton.us
Date: Sat, 21 Aug 2010 14:15:45 -0700 (PDT)
From: Doug Barton 
To: Rui Paulo 
In-Reply-To: 
Message-ID: 
References: <201008191131.o7JBV4Yf002412@svn.freebsd.org>
	<4C6D18BE.2000905@fer.hr> <4C6D95A8.9070105@FreeBSD.org>
	<20100819213159.B48418@maildrop.int.zabbadoz.net>
	<4C6DDB74.3090102@FreeBSD.org>
	<7186318F-0921-41E5-9641-3D6B45E0623B@FreeBSD.org>
	<4C701901.8030505@FreeBSD.org>
	
User-Agent: Alpine 2.00 (BSF 1167 2008-08-23)
X-message-flag: Outlook -- Not just for spreading viruses anymore!
OpenPGP: id=1A1ABC84
Organization: http://SupersetSolutions.com/
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@FreeBSD.org, Ana Kukec ,
	svn-src-all@FreeBSD.org, "Bjoern A. Zeeb" ,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r211501 - in head/sys: modules modules/send netinet
 netinet6 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: Sat, 21 Aug 2010 21:15:50 -0000

On Sat, 21 Aug 2010, Rui Paulo wrote:

> On 21 Aug 2010, at 19:20, Doug Barton wrote:
>
>> On 08/21/2010 05:07, Rui Paulo wrote:
>>>> Meanwhile, the fact that in the past code has been committed
>>>> without man pages is the exact cause of the problem you're
>>>> describing. It is certainly not a justification for continuing to
>>>> do it wrong.
>>>
>>> Reverting code just because it doesn't have a man page is pointless.
>>> Everyone can write the damn man page, but not everyone can write
>>> code. You should really take this into consideration when proposing a
>>> commit to be reverted.
>>
>> So let's assume that having lots of code in the tree without a man page is a problem. Further, let's assume that we don't want the problem to get worse. How do you propose that we accomplish that?
>
> By writing man pages...?

But that's the status quo (I.e., hope that people will/eventually write 
man pages for stuff) and it hasn't worked so far. The situation isn't 
actually going to be improved until we make a change. A simple (and I 
think abundantly reasonable) change that we can make today is, "Don't 
allow new work to be committed without a man page."

Meanwhile, there are a lot of benefits to this idea above and beyond the 
obvious one of having man pages for stuff. The biggest single benefit is 
that actually writing documentation for things forces you to re-examine 
assumptions, work through non-obvious and/or non-default code paths, 
etc. Speaking for myself, it's happened on more than one occasion that 
as I sit down to document some piece of code I realize that there are 
either bugs, or at least a better way of doing something. Requiring 
developers to work through this process before code goes into the tree 
gets us better code in addition to documentation.


Doug

-- 

 	Improve the effectiveness of your Internet presence with
 	a domain name makeover!    http://SupersetSolutions.com/

 	Computers are useless. They can only give you answers.
 			-- Pablo Picasso


From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 21:48:51 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id ED74C1065696;
	Sat, 21 Aug 2010 21:48:51 +0000 (UTC)
	(envelope-from rpaulo@freebsd.org)
Received: from karen.lavabit.com (karen.lavabit.com [72.249.41.33])
	by mx1.freebsd.org (Postfix) with ESMTP id 750ED8FC12;
	Sat, 21 Aug 2010 21:48:51 +0000 (UTC)
Received: from d.earth.lavabit.com (d.earth.lavabit.com [192.168.111.13])
	by karen.lavabit.com (Postfix) with ESMTP id E264911B93D;
	Sat, 21 Aug 2010 16:48:50 -0500 (CDT)
Received: from 10.0.10.3 (54.81.54.77.rev.vodafone.pt [77.54.81.54])
	by lavabit.com with ESMTP id S0YDTUEBVC55;
	Sat, 21 Aug 2010 16:48:50 -0500
Mime-Version: 1.0 (Apple Message framework v1081)
Content-Type: text/plain; charset=us-ascii
From: Rui Paulo 
In-Reply-To: 
Date: Sat, 21 Aug 2010 22:48:46 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <26CBB559-FA72-4688-92E9-ED9CEA151B2C@FreeBSD.org>
References: <201008191131.o7JBV4Yf002412@svn.freebsd.org>
	<4C6D18BE.2000905@fer.hr> <4C6D95A8.9070105@FreeBSD.org>
	<20100819213159.B48418@maildrop.int.zabbadoz.net>
	<4C6DDB74.3090102@FreeBSD.org>
	<7186318F-0921-41E5-9641-3D6B45E0623B@FreeBSD.org>
	<4C701901.8030505@FreeBSD.org>
	
	
To: Doug Barton 
X-Mailer: Apple Mail (2.1081)
Cc: svn-src-head@FreeBSD.org, Ana Kukec ,
	svn-src-all@FreeBSD.org, "Bjoern A. Zeeb" ,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r211501 - in head/sys: modules modules/send netinet
	netinet6 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: Sat, 21 Aug 2010 21:48:52 -0000


On 21 Aug 2010, at 22:15, Doug Barton wrote:

> On Sat, 21 Aug 2010, Rui Paulo wrote:
>=20
>> On 21 Aug 2010, at 19:20, Doug Barton wrote:
>>=20
>>> On 08/21/2010 05:07, Rui Paulo wrote:
>>>>> Meanwhile, the fact that in the past code has been committed
>>>>> without man pages is the exact cause of the problem you're
>>>>> describing. It is certainly not a justification for continuing to
>>>>> do it wrong.
>>>>=20
>>>> Reverting code just because it doesn't have a man page is =
pointless.
>>>> Everyone can write the damn man page, but not everyone can write
>>>> code. You should really take this into consideration when proposing =
a
>>>> commit to be reverted.
>>>=20
>>> So let's assume that having lots of code in the tree without a man =
page is a problem. Further, let's assume that we don't want the problem =
to get worse. How do you propose that we accomplish that?
>>=20
>> By writing man pages...?
>=20
> But that's the status quo (I.e., hope that people will/eventually =
write man pages for stuff) and it hasn't worked so far. The situation =
isn't actually going to be improved until we make a change. A simple =
(and I think abundantly reasonable) change that we can make today is, =
"Don't allow new work to be committed without a man page."
>=20
> Meanwhile, there are a lot of benefits to this idea above and beyond =
the obvious one of having man pages for stuff. The biggest single =
benefit is that actually writing documentation for things forces you to =
re-examine assumptions, work through non-obvious and/or non-default code =
paths, etc. Speaking for myself, it's happened on more than one occasion =
that as I sit down to document some piece of code I realize that there =
are either bugs, or at least a better way of doing something. Requiring =
developers to work through this process before code goes into the tree =
gets us better code in addition to documentation.

If your concern is to change the status quo, you do understand that you =
picked the worst possible thread to hijack ? Esp. since the author =
promised to roll out a man page.

Regards,
--
Rui Paulo



From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 22:23:22 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4EC0B1065693;
	Sat, 21 Aug 2010 22:23:22 +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 3C17B8FC15;
	Sat, 21 Aug 2010 22:23:22 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LMNM0M082646;
	Sat, 21 Aug 2010 22:23:22 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Received: (from nwhitehorn@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LMNM2j082641;
	Sat, 21 Aug 2010 22:23:22 GMT
	(envelope-from nwhitehorn@svn.freebsd.org)
Message-Id: <201008212223.o7LMNM2j082641@svn.freebsd.org>
From: Nathan Whitehorn 
Date: Sat, 21 Aug 2010 22:23: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: r211593 - in stable/8/sys/powerpc: aim booke 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: Sat, 21 Aug 2010 22:23:22 -0000

Author: nwhitehorn
Date: Sat Aug 21 22:23:22 2010
New Revision: 211593
URL: http://svn.freebsd.org/changeset/base/211593

Log:
  MFC r209812:
  
  Replace the existing PowerPC busdma implementation with the one from
  amd64 (with slight modifications). This provides support for bounce
  buffers, which are required on systems with RAM above 4 GB.

Modified:
  stable/8/sys/powerpc/aim/vm_machdep.c
  stable/8/sys/powerpc/booke/vm_machdep.c
  stable/8/sys/powerpc/powerpc/busdma_machdep.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cam/   (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/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/powerpc/aim/vm_machdep.c
==============================================================================
--- stable/8/sys/powerpc/aim/vm_machdep.c	Sat Aug 21 20:48:09 2010	(r211592)
+++ stable/8/sys/powerpc/aim/vm_machdep.c	Sat Aug 21 22:23:22 2010	(r211593)
@@ -358,10 +358,8 @@ sf_buf_free(struct sf_buf *sf)
 void
 swi_vm(void *dummy)
 {
-#if 0 /* XXX: Don't have busdma stuff yet */
 	if (busdma_swi_pending != 0)
 		busdma_swi();
-#endif
 }
 
 /*

Modified: stable/8/sys/powerpc/booke/vm_machdep.c
==============================================================================
--- stable/8/sys/powerpc/booke/vm_machdep.c	Sat Aug 21 20:48:09 2010	(r211592)
+++ stable/8/sys/powerpc/booke/vm_machdep.c	Sat Aug 21 22:23:22 2010	(r211593)
@@ -357,10 +357,8 @@ sf_buf_free(struct sf_buf *sf)
 void
 swi_vm(void *dummy)
 {
-#if 0 /* XXX: Don't have busdma stuff yet */
 	if (busdma_swi_pending != 0)
 		busdma_swi();
-#endif
 }
 
 /*

Modified: stable/8/sys/powerpc/powerpc/busdma_machdep.c
==============================================================================
--- stable/8/sys/powerpc/powerpc/busdma_machdep.c	Sat Aug 21 20:48:09 2010	(r211592)
+++ stable/8/sys/powerpc/powerpc/busdma_machdep.c	Sat Aug 21 22:23:22 2010	(r211593)
@@ -1,5 +1,4 @@
 /*-
- * Copyright (c) 2002 Peter Grehan
  * Copyright (c) 1997, 1998 Justin T. Gibbs.
  * All rights reserved.
  *
@@ -23,27 +22,28 @@
  * 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.
- *
- *   From i386/busdma_machdep.c,v 1.26 2002/04/19 22:58:09 alfred
  */
 
-#include 
-__FBSDID("$FreeBSD$");
-
 /*
- * Bus dma support routines
+ * From amd64/busdma_machdep.c, r204214
  */
 
+#include 
+__FBSDID("$FreeBSD$");
+
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -51,34 +51,122 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
-#include 
+#include 
+
+#define MAX_BPAGES 8192
+
+struct bounce_zone;
 
 struct bus_dma_tag {
-	bus_dma_tag_t     parent;
-	bus_size_t        alignment;
-	bus_size_t        boundary;
-	bus_addr_t        lowaddr;
-	bus_addr_t        highaddr;
+	bus_dma_tag_t	  parent;
+	bus_size_t	  alignment;
+	bus_size_t	  boundary;
+	bus_addr_t	  lowaddr;
+	bus_addr_t	  highaddr;
 	bus_dma_filter_t *filter;
-	void             *filterarg;
-	bus_size_t        maxsize;
-	u_int             nsegments;
-	bus_size_t        maxsegsz;
-	int               flags;
-	int               ref_count;
-	int               map_count;
+	void		 *filterarg;
+	bus_size_t	  maxsize;
+	u_int		  nsegments;
+	bus_size_t	  maxsegsz;
+	int		  flags;
+	int		  ref_count;
+	int		  map_count;
 	bus_dma_lock_t	 *lockfunc;
 	void		 *lockfuncarg;
+	bus_dma_segment_t *segments;
+	struct bounce_zone *bounce_zone;
+};
+
+struct bounce_page {
+	vm_offset_t	vaddr;		/* kva of bounce buffer */
+	bus_addr_t	busaddr;	/* Physical address */
+	vm_offset_t	datavaddr;	/* kva of client data */
+	bus_size_t	datacount;	/* client data count */
+	STAILQ_ENTRY(bounce_page) links;
+};
+
+int busdma_swi_pending;
+
+struct bounce_zone {
+	STAILQ_ENTRY(bounce_zone) links;
+	STAILQ_HEAD(bp_list, bounce_page) bounce_page_list;
+	int		total_bpages;
+	int		free_bpages;
+	int		reserved_bpages;
+	int		active_bpages;
+	int		total_bounced;
+	int		total_deferred;
+	int		map_count;
+	bus_size_t	alignment;
+	bus_addr_t	lowaddr;
+	char		zoneid[8];
+	char		lowaddrid[20];
+	struct sysctl_ctx_list sysctl_tree;
+	struct sysctl_oid *sysctl_tree_top;
 };
 
+static struct mtx bounce_lock;
+static int total_bpages;
+static int busdma_zonecount;
+static STAILQ_HEAD(, bounce_zone) bounce_zone_list;
+
+SYSCTL_NODE(_hw, OID_AUTO, busdma, CTLFLAG_RD, 0, "Busdma parameters");
+SYSCTL_INT(_hw_busdma, OID_AUTO, total_bpages, CTLFLAG_RD, &total_bpages, 0,
+	   "Total bounce pages");
+
 struct bus_dmamap {
-        bus_dma_tag_t          dmat;
-        void                  *buf;             /* unmapped buffer pointer */
-        bus_size_t             buflen;          /* unmapped buffer length */
-        bus_dmamap_callback_t *callback;
-        void                  *callback_arg;
+	struct bp_list	       bpages;
+	int		       pagesneeded;
+	int		       pagesreserved;
+	bus_dma_tag_t	       dmat;
+	void		      *buf;		/* unmapped buffer pointer */
+	bus_size_t	       buflen;		/* unmapped buffer length */
+	bus_dmamap_callback_t *callback;
+	void		      *callback_arg;
+	STAILQ_ENTRY(bus_dmamap) links;
 };
 
+static STAILQ_HEAD(, bus_dmamap) bounce_map_waitinglist;
+static STAILQ_HEAD(, bus_dmamap) bounce_map_callbacklist;
+static struct bus_dmamap nobounce_dmamap;
+
+static void init_bounce_pages(void *dummy);
+static int alloc_bounce_zone(bus_dma_tag_t dmat);
+static int alloc_bounce_pages(bus_dma_tag_t dmat, u_int numpages);
+static int reserve_bounce_pages(bus_dma_tag_t dmat, bus_dmamap_t map,
+				int commit);
+static bus_addr_t add_bounce_page(bus_dma_tag_t dmat, bus_dmamap_t map,
+				   vm_offset_t vaddr, bus_size_t size);
+static void free_bounce_page(bus_dma_tag_t dmat, struct bounce_page *bpage);
+static __inline int run_filter(bus_dma_tag_t dmat, bus_addr_t paddr);
+
+/*
+ * Return true if a match is made.
+ *
+ * To find a match walk the chain of bus_dma_tag_t's looking for 'paddr'.
+ *
+ * If paddr is within the bounds of the dma tag then call the filter callback
+ * to check for a match, if there is no filter callback then assume a match.
+ */
+static __inline int
+run_filter(bus_dma_tag_t dmat, bus_addr_t paddr)
+{
+	int retval;
+
+	retval = 0;
+
+	do {
+		if (((paddr > dmat->lowaddr && paddr <= dmat->highaddr)
+		 || ((paddr & (dmat->alignment - 1)) != 0))
+		 && (dmat->filter == NULL
+		  || (*dmat->filter)(dmat->filterarg, paddr) != 0))
+			retval = 1;
+
+		dmat = dmat->parent;		
+	} while (retval == 0 && dmat != NULL);
+	return (retval);
+}
+
 /*
  * Convenience function for manipulating driver locks from busdma (during
  * busdma_swi, for example).  Drivers that don't provide their own locks
@@ -112,42 +200,53 @@ busdma_lock_mutex(void *arg, bus_dma_loc
 static void
 dflt_lock(void *arg, bus_dma_lock_op_t op)
 {
-#ifdef INVARIANTS
 	panic("driver error: busdma dflt_lock called");
-#else
-	printf("DRIVER_ERROR: busdma dflt_lock called\n");
-#endif
 }
 
+#define BUS_DMA_COULD_BOUNCE	BUS_DMA_BUS3
+#define BUS_DMA_MIN_ALLOC_COMP	BUS_DMA_BUS4
 /*
  * Allocate a device specific dma_tag.
  */
 int
 bus_dma_tag_create(bus_dma_tag_t parent, bus_size_t alignment,
-    bus_size_t boundary, bus_addr_t lowaddr, bus_addr_t highaddr,
-    bus_dma_filter_t *filter, void *filterarg, bus_size_t maxsize,
-    int nsegments, bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc,
-    void *lockfuncarg, bus_dma_tag_t *dmat)
+		   bus_size_t boundary, bus_addr_t lowaddr,
+		   bus_addr_t highaddr, bus_dma_filter_t *filter,
+		   void *filterarg, bus_size_t maxsize, int nsegments,
+		   bus_size_t maxsegsz, int flags, bus_dma_lock_t *lockfunc,
+		   void *lockfuncarg, bus_dma_tag_t *dmat)
 {
 	bus_dma_tag_t newtag;
 	int error = 0;
 
+	/* Basic sanity checking */
+	if (boundary != 0 && boundary < maxsegsz)
+		maxsegsz = boundary;
+
+	if (maxsegsz == 0) {
+		return (EINVAL);
+	}
+
 	/* Return a NULL tag on failure */
 	*dmat = NULL;
 
-	newtag = (bus_dma_tag_t)malloc(sizeof(*newtag), M_DEVBUF, M_NOWAIT);
-	if (newtag == NULL)
+	newtag = (bus_dma_tag_t)malloc(sizeof(*newtag), M_DEVBUF,
+	    M_ZERO | M_NOWAIT);
+	if (newtag == NULL) {
+		CTR4(KTR_BUSDMA, "%s returned tag %p tag flags 0x%x error %d",
+		    __func__, newtag, 0, error);
 		return (ENOMEM);
+	}
 
 	newtag->parent = parent;
 	newtag->alignment = alignment;
 	newtag->boundary = boundary;
-	newtag->lowaddr = trunc_page((vm_offset_t)lowaddr) + (PAGE_SIZE - 1);
-	newtag->highaddr = trunc_page((vm_offset_t)highaddr) + (PAGE_SIZE - 1);
+	newtag->lowaddr = trunc_page((vm_paddr_t)lowaddr) + (PAGE_SIZE - 1);
+	newtag->highaddr = trunc_page((vm_paddr_t)highaddr) + (PAGE_SIZE - 1);
 	newtag->filter = filter;
 	newtag->filterarg = filterarg;
-        newtag->maxsize = maxsize;
-        newtag->nsegments = nsegments;
+	newtag->maxsize = maxsize;
+	newtag->nsegments = nsegments;
 	newtag->maxsegsz = maxsegsz;
 	newtag->flags = flags;
 	newtag->ref_count = 1; /* Count ourself */
@@ -159,61 +258,107 @@ bus_dma_tag_create(bus_dma_tag_t parent,
 		newtag->lockfunc = dflt_lock;
 		newtag->lockfuncarg = NULL;
 	}
+	newtag->segments = NULL;
 
-        /*
-	 * Take into account any restrictions imposed by our parent tag
-	 */
-        if (parent != NULL) {
-                newtag->lowaddr = min(parent->lowaddr, newtag->lowaddr);
-                newtag->highaddr = max(parent->highaddr, newtag->highaddr);
+	/* Take into account any restrictions imposed by our parent tag */
+	if (parent != NULL) {
+		newtag->lowaddr = MIN(parent->lowaddr, newtag->lowaddr);
+		newtag->highaddr = MAX(parent->highaddr, newtag->highaddr);
 		if (newtag->boundary == 0)
 			newtag->boundary = parent->boundary;
 		else if (parent->boundary != 0)
-                	newtag->boundary = MIN(parent->boundary,
+			newtag->boundary = MIN(parent->boundary,
 					       newtag->boundary);
-                if (newtag->filter == NULL) {
-                        /*
-                         * Short circuit looking at our parent directly
-                         * since we have encapsulated all of its information
-                         */
-                        newtag->filter = parent->filter;
-                        newtag->filterarg = parent->filterarg;
-                        newtag->parent = parent->parent;
+		if (newtag->filter == NULL) {
+			/*
+			 * Short circuit looking at our parent directly
+			 * since we have encapsulated all of its information
+			 */
+			newtag->filter = parent->filter;
+			newtag->filterarg = parent->filterarg;
+			newtag->parent = parent->parent;
 		}
 		if (newtag->parent != NULL)
 			atomic_add_int(&parent->ref_count, 1);
 	}
 
-	*dmat = newtag;
+	if (newtag->lowaddr < ptoa((vm_paddr_t)Maxmem)
+	 || newtag->alignment > 1)
+		newtag->flags |= BUS_DMA_COULD_BOUNCE;
+
+	if (((newtag->flags & BUS_DMA_COULD_BOUNCE) != 0) &&
+	    (flags & BUS_DMA_ALLOCNOW) != 0) {
+		struct bounce_zone *bz;
+
+		/* Must bounce */
+
+		if ((error = alloc_bounce_zone(newtag)) != 0) {
+			free(newtag, M_DEVBUF);
+			return (error);
+		}
+		bz = newtag->bounce_zone;
+
+		if (ptoa(bz->total_bpages) < maxsize) {
+			int pages;
+
+			pages = atop(maxsize) - bz->total_bpages;
+
+			/* Add pages to our bounce pool */
+			if (alloc_bounce_pages(newtag, pages) < pages)
+				error = ENOMEM;
+		}
+		/* Performed initial allocation */
+		newtag->flags |= BUS_DMA_MIN_ALLOC_COMP;
+	}
+	
+	if (error != 0) {
+		free(newtag, M_DEVBUF);
+	} else {
+		*dmat = newtag;
+	}
+	CTR4(KTR_BUSDMA, "%s returned tag %p tag flags 0x%x error %d",
+	    __func__, newtag, (newtag != NULL ? newtag->flags : 0), error);
 	return (error);
 }
 
 int
 bus_dma_tag_destroy(bus_dma_tag_t dmat)
 {
+	bus_dma_tag_t dmat_copy;
+	int error;
+
+	error = 0;
+	dmat_copy = dmat;
+
 	if (dmat != NULL) {
-		
-                if (dmat->map_count != 0)
-                        return (EBUSY);
-		
-                while (dmat != NULL) {
-                        bus_dma_tag_t parent;
-			
-                        parent = dmat->parent;
-                        atomic_subtract_int(&dmat->ref_count, 1);
-                        if (dmat->ref_count == 0) {
-                                free(dmat, M_DEVBUF);
-                                /*
-                                 * Last reference count, so
-                                 * release our reference
-                                 * count on our parent.
-                                 */
-                                dmat = parent;
-                        } else
-                                dmat = NULL;
-                }
-        }
-        return (0);
+
+		if (dmat->map_count != 0) {
+			error = EBUSY;
+			goto out;
+		}
+
+		while (dmat != NULL) {
+			bus_dma_tag_t parent;
+
+			parent = dmat->parent;
+			atomic_subtract_int(&dmat->ref_count, 1);
+			if (dmat->ref_count == 0) {
+				if (dmat->segments != NULL)
+					free(dmat->segments, M_DEVBUF);
+				free(dmat, M_DEVBUF);
+				/*
+				 * Last reference count, so
+				 * release our reference
+				 * count on our parent.
+				 */
+				dmat = parent;
+			} else
+				dmat = NULL;
+		}
+	}
+out:
+	CTR3(KTR_BUSDMA, "%s tag %p error %d", __func__, dmat_copy, error);
+	return (error);
 }
 
 /*
@@ -223,10 +368,83 @@ bus_dma_tag_destroy(bus_dma_tag_t dmat)
 int
 bus_dmamap_create(bus_dma_tag_t dmat, int flags, bus_dmamap_t *mapp)
 {
-	*mapp = NULL;
-	dmat->map_count++;
+	int error;
 
-	return (0);
+	error = 0;
+
+	if (dmat->segments == NULL) {
+		dmat->segments = (bus_dma_segment_t *)malloc(
+		    sizeof(bus_dma_segment_t) * dmat->nsegments, M_DEVBUF,
+		    M_NOWAIT);
+		if (dmat->segments == NULL) {
+			CTR3(KTR_BUSDMA, "%s: tag %p error %d",
+			    __func__, dmat, ENOMEM);
+			return (ENOMEM);
+		}
+	}
+
+	/*
+	 * Bouncing might be required if the driver asks for an active
+	 * exclusion region, a data alignment that is stricter than 1, and/or
+	 * an active address boundary.
+	 */
+	if (dmat->flags & BUS_DMA_COULD_BOUNCE) {
+
+		/* Must bounce */
+		struct bounce_zone *bz;
+		int maxpages;
+
+		if (dmat->bounce_zone == NULL) {
+			if ((error = alloc_bounce_zone(dmat)) != 0)
+				return (error);
+		}
+		bz = dmat->bounce_zone;
+
+		*mapp = (bus_dmamap_t)malloc(sizeof(**mapp), M_DEVBUF,
+					     M_NOWAIT | M_ZERO);
+		if (*mapp == NULL) {
+			CTR3(KTR_BUSDMA, "%s: tag %p error %d",
+			    __func__, dmat, ENOMEM);
+			return (ENOMEM);
+		}
+
+		/* Initialize the new map */
+		STAILQ_INIT(&((*mapp)->bpages));
+
+		/*
+		 * Attempt to add pages to our pool on a per-instance
+		 * basis up to a sane limit.
+		 */
+		if (dmat->alignment > 1)
+			maxpages = MAX_BPAGES;
+		else
+			maxpages = MIN(MAX_BPAGES, Maxmem -atop(dmat->lowaddr));
+		if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0
+		 || (bz->map_count > 0 && bz->total_bpages < maxpages)) {
+			int pages;
+
+			pages = MAX(atop(dmat->maxsize), 1);
+			pages = MIN(maxpages - bz->total_bpages, pages);
+			pages = MAX(pages, 1);
+			if (alloc_bounce_pages(dmat, pages) < pages)
+				error = ENOMEM;
+
+			if ((dmat->flags & BUS_DMA_MIN_ALLOC_COMP) == 0) {
+				if (error == 0)
+					dmat->flags |= BUS_DMA_MIN_ALLOC_COMP;
+			} else {
+				error = 0;
+			}
+		}
+		bz->map_count++;
+	} else {
+		*mapp = NULL;
+	}
+	if (error == 0)
+		dmat->map_count++;
+	CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d",
+	    __func__, dmat, dmat->flags, error);
+	return (error);
 }
 
 /*
@@ -236,13 +454,22 @@ bus_dmamap_create(bus_dma_tag_t dmat, in
 int
 bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmamap_t map)
 {
-        if (map != NULL) {
-		panic("dmamap_destroy: NULL?\n");
-        }
-        dmat->map_count--;
-        return (0);
+	if (map != NULL && map != &nobounce_dmamap) {
+		if (STAILQ_FIRST(&map->bpages) != NULL) {
+			CTR3(KTR_BUSDMA, "%s: tag %p error %d",
+			    __func__, dmat, EBUSY);
+			return (EBUSY);
+		}
+		if (dmat->bounce_zone)
+			dmat->bounce_zone->map_count--;
+		free(map, M_DEVBUF);
+	}
+	dmat->map_count--;
+	CTR2(KTR_BUSDMA, "%s: tag %p error 0", __func__, dmat);
+	return (0);
 }
 
+
 /*
  * Allocate a piece of memory that can be efficiently mapped into
  * bus device space based on the constraints lited in the dma tag.
@@ -250,7 +477,7 @@ bus_dmamap_destroy(bus_dma_tag_t dmat, b
  */
 int
 bus_dmamem_alloc(bus_dma_tag_t dmat, void** vaddr, int flags,
-    bus_dmamap_t *mapp)
+		 bus_dmamap_t *mapp)
 {
 	int mflags;
 
@@ -258,56 +485,87 @@ bus_dmamem_alloc(bus_dma_tag_t dmat, voi
 		mflags = M_NOWAIT;
 	else
 		mflags = M_WAITOK;
+
+	/* If we succeed, no mapping/bouncing will be required */
+	*mapp = NULL;
+
+	if (dmat->segments == NULL) {
+		dmat->segments = (bus_dma_segment_t *)malloc(
+		    sizeof(bus_dma_segment_t) * dmat->nsegments, M_DEVBUF,
+		    mflags);
+		if (dmat->segments == NULL) {
+			CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d",
+			    __func__, dmat, dmat->flags, ENOMEM);
+			return (ENOMEM);
+		}
+	}
 	if (flags & BUS_DMA_ZERO)
 		mflags |= M_ZERO;
 
-        *mapp = NULL;
-
 	/* 
 	 * XXX:
 	 * (dmat->alignment < dmat->maxsize) is just a quick hack; the exact
 	 * alignment guarantees of malloc need to be nailed down, and the
 	 * code below should be rewritten to take that into account.
 	 *
-	 * In the meantime, we'll return an error if malloc gets it wrong.
+	 * In the meantime, we'll warn the user if malloc gets it wrong.
 	 */
-	if (dmat->maxsize <= PAGE_SIZE &&
-	    dmat->alignment < dmat->maxsize) {
+	if ((dmat->maxsize <= PAGE_SIZE) &&
+	   (dmat->alignment < dmat->maxsize) &&
+	    dmat->lowaddr >= ptoa((vm_paddr_t)Maxmem)) {
 		*vaddr = malloc(dmat->maxsize, M_DEVBUF, mflags);
-        } else {
-                /*
-                 * XXX Use Contigmalloc until it is merged into this facility
-                 *     and handles multi-seg allocations.  Nobody is doing
-                 *     multi-seg allocations yet though.
-                 */
-                *vaddr = contigmalloc(dmat->maxsize, M_DEVBUF, mflags,
-                    0ul, dmat->lowaddr, dmat->alignment? dmat->alignment : 1ul,
-                    dmat->boundary);
-        }
-
-        if (*vaddr == NULL)
-                return (ENOMEM);
-
-	if ((uintptr_t)*vaddr % dmat->alignment)
-		printf("XXX: %s: alignment not respected!\n", __func__);
-
-        return (0);
+	} else {
+		/*
+		 * XXX Use Contigmalloc until it is merged into this facility
+		 *     and handles multi-seg allocations.  Nobody is doing
+		 *     multi-seg allocations yet though.
+		 * XXX Certain AGP hardware does.
+		 */
+		*vaddr = contigmalloc(dmat->maxsize, M_DEVBUF, mflags,
+		    0ul, dmat->lowaddr, dmat->alignment? dmat->alignment : 1ul,
+		    dmat->boundary);
+	}
+	if (*vaddr == NULL) {
+		CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d",
+		    __func__, dmat, dmat->flags, ENOMEM);
+		return (ENOMEM);
+	} else if ((uintptr_t)*vaddr & (dmat->alignment - 1)) {
+		printf("bus_dmamem_alloc failed to align memory properly.\n");
+	}
+#ifdef NOTYET
+	if (flags & BUS_DMA_NOCACHE)
+		pmap_change_attr((vm_offset_t)*vaddr, dmat->maxsize,
+		    PAT_UNCACHEABLE);
+#endif
+	CTR4(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d",
+	    __func__, dmat, dmat->flags, 0);
+	return (0);
 }
 
 /*
- * Free a piece of memory and it's allocated dmamap, that was allocated
+ * Free a piece of memory and it's allociated dmamap, that was allocated
  * via bus_dmamem_alloc.  Make the same choice for free/contigfree.
  */
 void
 bus_dmamem_free(bus_dma_tag_t dmat, void *vaddr, bus_dmamap_t map)
 {
-        if (map != NULL)
-                panic("bus_dmamem_free: Invalid map freed\n");
-        if (dmat->maxsize <= PAGE_SIZE &&
-	    dmat->alignment < dmat->maxsize)
+	/*
+	 * dmamem does not need to be bounced, so the map should be
+	 * NULL
+	 */
+	if (map != NULL)
+		panic("bus_dmamem_free: Invalid map freed\n");
+#ifdef NOTYET
+	pmap_change_attr((vm_offset_t)vaddr, dmat->maxsize, PAT_WRITE_BACK);
+#endif
+	if ((dmat->maxsize <= PAGE_SIZE) &&
+	   (dmat->alignment < dmat->maxsize) &&
+	    dmat->lowaddr >= ptoa((vm_paddr_t)Maxmem))
 		free(vaddr, M_DEVBUF);
-        else
+	else {
 		contigfree(vaddr, dmat->maxsize, M_DEVBUF);
+	}
+	CTR3(KTR_BUSDMA, "%s: tag %p flags 0x%x", __func__, dmat, dmat->flags);
 }
 
 /*
@@ -316,26 +574,89 @@ bus_dmamem_free(bus_dma_tag_t dmat, void
  * the starting segment on entrance, and the ending segment on exit.
  * first indicates if this is the first invocation of this function.
  */
-static int
-bus_dmamap_load_buffer(bus_dma_tag_t dmat, bus_dma_segment_t segs[],
-    void *buf, bus_size_t buflen, struct thread *td, int flags,
-    vm_offset_t *lastaddrp, int *segp, int first)
+static __inline int
+_bus_dmamap_load_buffer(bus_dma_tag_t dmat,
+    			bus_dmamap_t map,
+			void *buf, bus_size_t buflen,
+			pmap_t pmap,
+			int flags,
+			bus_addr_t *lastaddrp,
+			bus_dma_segment_t *segs,
+			int *segp,
+			int first)
 {
 	bus_size_t sgsize;
 	bus_addr_t curaddr, lastaddr, baddr, bmask;
-	vm_offset_t vaddr = (vm_offset_t)buf;
+	vm_offset_t vaddr;
+	bus_addr_t paddr;
 	int seg;
-	pmap_t pmap;
 
-	if (td != NULL)
-		pmap = vmspace_pmap(td->td_proc->p_vmspace);
-	else
-		pmap = NULL;
+	if (map == NULL)
+		map = &nobounce_dmamap;
+
+	if ((map != &nobounce_dmamap && map->pagesneeded == 0) 
+	 && ((dmat->flags & BUS_DMA_COULD_BOUNCE) != 0)) {
+		vm_offset_t	vendaddr;
+
+		CTR4(KTR_BUSDMA, "lowaddr= %d Maxmem= %d, boundary= %d, "
+		    "alignment= %d", dmat->lowaddr, ptoa((vm_paddr_t)Maxmem),
+		    dmat->boundary, dmat->alignment);
+		CTR3(KTR_BUSDMA, "map= %p, nobouncemap= %p, pagesneeded= %d",
+		    map, &nobounce_dmamap, map->pagesneeded);
+		/*
+		 * Count the number of bounce pages
+		 * needed in order to complete this transfer
+		 */
+		vaddr = (vm_offset_t)buf;
+		vendaddr = (vm_offset_t)buf + buflen;
+
+		while (vaddr < vendaddr) {
+			bus_size_t sg_len;
 
+			sg_len = PAGE_SIZE - ((vm_offset_t)vaddr & PAGE_MASK);
+			if (pmap)
+				paddr = pmap_extract(pmap, vaddr);
+			else
+				paddr = pmap_kextract(vaddr);
+			if (run_filter(dmat, paddr) != 0) {
+				sg_len = roundup2(sg_len, dmat->alignment);
+				map->pagesneeded++;
+			}
+			vaddr += sg_len;
+		}
+		CTR1(KTR_BUSDMA, "pagesneeded= %d\n", map->pagesneeded);
+	}
+
+	/* Reserve Necessary Bounce Pages */
+	if (map->pagesneeded != 0) {
+		mtx_lock(&bounce_lock);
+		if (flags & BUS_DMA_NOWAIT) {
+			if (reserve_bounce_pages(dmat, map, 0) != 0) {
+				mtx_unlock(&bounce_lock);
+				return (ENOMEM);
+			}
+		} else {
+			if (reserve_bounce_pages(dmat, map, 1) != 0) {
+				/* Queue us for resources */
+				map->dmat = dmat;
+				map->buf = buf;
+				map->buflen = buflen;
+				STAILQ_INSERT_TAIL(&bounce_map_waitinglist,
+				    map, links);
+				mtx_unlock(&bounce_lock);
+				return (EINPROGRESS);
+			}
+		}
+		mtx_unlock(&bounce_lock);
+	}
+
+	vaddr = (vm_offset_t)buf;
 	lastaddr = *lastaddrp;
 	bmask = ~(dmat->boundary - 1);
 
 	for (seg = *segp; buflen > 0 ; ) {
+		bus_size_t max_sgsize;
+
 		/*
 		 * Get the physical address for this segment.
 		 */
@@ -347,11 +668,15 @@ bus_dmamap_load_buffer(bus_dma_tag_t dma
 		/*
 		 * Compute the segment size, and adjust counts.
 		 */
-		sgsize = PAGE_SIZE - ((u_long)curaddr & PAGE_MASK);
-		if (sgsize > dmat->maxsegsz)
-			sgsize = dmat->maxsegsz;
-		if (buflen < sgsize)
-			sgsize = buflen;
+		max_sgsize = MIN(buflen, dmat->maxsegsz);
+		sgsize = PAGE_SIZE - ((vm_offset_t)curaddr & PAGE_MASK);
+		if (map->pagesneeded != 0 && run_filter(dmat, curaddr)) {
+			sgsize = roundup2(sgsize, dmat->alignment);
+			sgsize = MIN(sgsize, max_sgsize);
+			curaddr = add_bounce_page(dmat, map, vaddr, sgsize);
+		} else {
+			sgsize = MIN(sgsize, max_sgsize);
+		}
 
 		/*
 		 * Make sure we don't cross any boundaries.
@@ -364,7 +689,7 @@ bus_dmamap_load_buffer(bus_dma_tag_t dma
 
 		/*
 		 * Insert chunk into a segment, coalescing with
-		 * the previous segment if possible.
+		 * previous segment if possible.
 		 */
 		if (first) {
 			segs[seg].ds_addr = curaddr;
@@ -403,59 +728,71 @@ bus_dmamap_load_buffer(bus_dma_tag_t dma
  */
 int
 bus_dmamap_load(bus_dma_tag_t dmat, bus_dmamap_t map, void *buf,
-    bus_size_t buflen, bus_dmamap_callback_t *callback,
-    void *callback_arg, int flags)
+		bus_size_t buflen, bus_dmamap_callback_t *callback,
+		void *callback_arg, int flags)
 {
-#ifdef __CC_SUPPORTS_DYNAMIC_ARRAY_INIT
-	bus_dma_segment_t	dm_segments[dmat->nsegments];
-#else
-	bus_dma_segment_t	dm_segments[BUS_DMAMAP_NSEGS];
-#endif
-	vm_offset_t		lastaddr;
-	int			error, nsegs;
+	bus_addr_t		lastaddr = 0;
+	int			error, nsegs = 0;
 
-	if (map != NULL)
-		panic("bus_dmamap_load: Invalid map\n");
+	if (map != NULL) {
+		flags |= BUS_DMA_WAITOK;
+		map->callback = callback;
+		map->callback_arg = callback_arg;
+	}
 
-	lastaddr = (vm_offset_t)0;
-	nsegs = 0;	
-	error = bus_dmamap_load_buffer(dmat, dm_segments, buf, buflen,
-	    NULL, flags, &lastaddr, &nsegs, 1);
+	error = _bus_dmamap_load_buffer(dmat, map, buf, buflen, NULL, flags,
+	     &lastaddr, dmat->segments, &nsegs, 1);
 
-	if (error == 0)
-		(*callback)(callback_arg, dm_segments, nsegs + 1, 0);
+	CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d",
+	    __func__, dmat, dmat->flags, error, nsegs + 1);
+
+	if (error == EINPROGRESS) {
+		return (error);
+	}
+
+	if (error)
+		(*callback)(callback_arg, dmat->segments, 0, error);
 	else
-		(*callback)(callback_arg, NULL, 0, error);
+		(*callback)(callback_arg, dmat->segments, nsegs + 1, 0);
+
+	/*
+	 * Return ENOMEM to the caller so that it can pass it up the stack.
+	 * This error only happens when NOWAIT is set, so deferal is disabled.
+	 */
+	if (error == ENOMEM)
+		return (error);
 
 	return (0);
 }
 
+
 /*
- * Like bus_dmamap_load(), but for mbufs.
+ * Like _bus_dmamap_load(), but for mbufs.
  */
 int
-bus_dmamap_load_mbuf(bus_dma_tag_t dmat, bus_dmamap_t map, struct mbuf *m0,
-    bus_dmamap_callback2_t *callback, void *callback_arg, int flags)
+bus_dmamap_load_mbuf(bus_dma_tag_t dmat, bus_dmamap_t map,
+		     struct mbuf *m0,
+		     bus_dmamap_callback2_t *callback, void *callback_arg,
+		     int flags)
 {
-#ifdef __CC_SUPPORTS_DYNAMIC_ARRAY_INIT
-	bus_dma_segment_t dm_segments[dmat->nsegments];
-#else
-	bus_dma_segment_t dm_segments[BUS_DMAMAP_NSEGS];
-#endif
-	int nsegs = 0, error = 0;
+	int nsegs, error;
 
 	M_ASSERTPKTHDR(m0);
 
+	flags |= BUS_DMA_NOWAIT;
+	nsegs = 0;
+	error = 0;
 	if (m0->m_pkthdr.len <= dmat->maxsize) {
 		int first = 1;
-		vm_offset_t lastaddr = 0;
+		bus_addr_t lastaddr = 0;
 		struct mbuf *m;
 
 		for (m = m0; m != NULL && error == 0; m = m->m_next) {
 			if (m->m_len > 0) {
-				error = bus_dmamap_load_buffer(dmat,
-				    dm_segments, m->m_data, m->m_len, NULL,
-				    flags, &lastaddr, &nsegs, first);
+				error = _bus_dmamap_load_buffer(dmat, map,
+						m->m_data, m->m_len,
+						NULL, flags, &lastaddr,
+						dmat->segments, &nsegs, first);
 				first = 0;
 			}
 		}
@@ -464,90 +801,96 @@ bus_dmamap_load_mbuf(bus_dma_tag_t dmat,
 	}
 
 	if (error) {
-		/* 
-		 * force "no valid mappings" on error in callback.
-		 */
-		(*callback)(callback_arg, dm_segments, 0, 0, error);
+		/* force "no valid mappings" in callback */
+		(*callback)(callback_arg, dmat->segments, 0, 0, error);
 	} else {
-		(*callback)(callback_arg, dm_segments, nsegs+1,
-		    m0->m_pkthdr.len, error);
+		(*callback)(callback_arg, dmat->segments,
+			    nsegs+1, m0->m_pkthdr.len, error);
 	}
+	CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d",
+	    __func__, dmat, dmat->flags, error, nsegs + 1);
 	return (error);
 }
 
 int
-bus_dmamap_load_mbuf_sg(bus_dma_tag_t dmat, bus_dmamap_t map, struct mbuf *m0,
-    bus_dma_segment_t *segs, int *nsegs, int flags)
+bus_dmamap_load_mbuf_sg(bus_dma_tag_t dmat, bus_dmamap_t map,
+			struct mbuf *m0, bus_dma_segment_t *segs, int *nsegs,
+			int flags)
 {
-	int error = 0;
+	int error;
 
 	M_ASSERTPKTHDR(m0);
 
+	flags |= BUS_DMA_NOWAIT;
 	*nsegs = 0;
-
+	error = 0;
 	if (m0->m_pkthdr.len <= dmat->maxsize) {
 		int first = 1;
-		vm_offset_t lastaddr = 0;
+		bus_addr_t lastaddr = 0;
 		struct mbuf *m;
 
 		for (m = m0; m != NULL && error == 0; m = m->m_next) {
 			if (m->m_len > 0) {
-				error = bus_dmamap_load_buffer(dmat,
-				    segs, m->m_data, m->m_len, NULL,
-				    flags, &lastaddr, nsegs, first);
+				error = _bus_dmamap_load_buffer(dmat, map,
+						m->m_data, m->m_len,
+						NULL, flags, &lastaddr,
+						segs, nsegs, first);
 				first = 0;
 			}
 		}
-		++*nsegs;
 	} else {
 		error = EINVAL;
 	}
 
+	/* XXX FIXME: Having to increment nsegs is really annoying */
+	++*nsegs;
+	CTR5(KTR_BUSDMA, "%s: tag %p tag flags 0x%x error %d nsegs %d",
+	    __func__, dmat, dmat->flags, error, *nsegs);
 	return (error);
 }
 
 /*
- * Like bus_dmamap_load(), but for uios.
+ * Like _bus_dmamap_load(), but for uios.
  */
 int
-bus_dmamap_load_uio(bus_dma_tag_t dmat, bus_dmamap_t map, struct uio *uio,
-    bus_dmamap_callback2_t *callback, void *callback_arg, int flags)
+bus_dmamap_load_uio(bus_dma_tag_t dmat, bus_dmamap_t map,
+		    struct uio *uio,
+		    bus_dmamap_callback2_t *callback, void *callback_arg,
+		    int flags)
 {
-	vm_offset_t lastaddr;
-#ifdef __CC_SUPPORTS_DYNAMIC_ARRAY_INIT
-	bus_dma_segment_t dm_segments[dmat->nsegments];
-#else
-	bus_dma_segment_t dm_segments[BUS_DMAMAP_NSEGS];
-#endif
-	int nsegs, i, error, first;
+	bus_addr_t lastaddr = 0;
+	int nsegs, error, first, i;
 	bus_size_t resid;
 	struct iovec *iov;
-	struct thread *td = NULL;
+	pmap_t pmap;
 
+	flags |= BUS_DMA_NOWAIT;
 	resid = uio->uio_resid;
 	iov = uio->uio_iov;
 
 	if (uio->uio_segflg == UIO_USERSPACE) {
-		td = uio->uio_td;
-		KASSERT(td != NULL,
-		    ("bus_dmamap_load_uio: USERSPACE but no proc"));
-	}

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 22:36:22 2010
Return-Path: 
Delivered-To: svn-src-all@FreeBSD.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 30A0F1065695
	for ; Sat, 21 Aug 2010 22:36:22 +0000 (UTC)
	(envelope-from dougb@FreeBSD.org)
Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4])
	by mx1.freebsd.org (Postfix) with ESMTP id ACA818FC1B
	for ; Sat, 21 Aug 2010 22:36:21 +0000 (UTC)
Received: (qmail 6563 invoked by uid 399); 21 Aug 2010 22:36:20 -0000
Received: from localhost (HELO laptop.dougb.net)
	(dougb@dougbarton.us@127.0.0.1)
	by localhost with ESMTPAM; 21 Aug 2010 22:36:20 -0000
X-Originating-IP: 127.0.0.1
X-Sender: dougb@dougbarton.us
Date: Sat, 21 Aug 2010 15:36:19 -0700 (PDT)
From: Doug Barton 
To: Rui Paulo 
In-Reply-To: <26CBB559-FA72-4688-92E9-ED9CEA151B2C@FreeBSD.org>
Message-ID: 
References: <201008191131.o7JBV4Yf002412@svn.freebsd.org>
	<4C6D18BE.2000905@fer.hr> <4C6D95A8.9070105@FreeBSD.org>
	<20100819213159.B48418@maildrop.int.zabbadoz.net>
	<4C6DDB74.3090102@FreeBSD.org>
	<7186318F-0921-41E5-9641-3D6B45E0623B@FreeBSD.org>
	<4C701901.8030505@FreeBSD.org>
	
	
	<26CBB559-FA72-4688-92E9-ED9CEA151B2C@FreeBSD.org>
User-Agent: Alpine 2.00 (BSF 1167 2008-08-23)
X-message-flag: Outlook -- Not just for spreading viruses anymore!
OpenPGP: id=1A1ABC84
Organization: http://SupersetSolutions.com/
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
Cc: svn-src-head@FreeBSD.org, Ana Kukec ,
	svn-src-all@FreeBSD.org, "Bjoern A. Zeeb" ,
	src-committers@FreeBSD.org
Subject: Re: svn commit: r211501 - in head/sys: modules modules/send netinet
 netinet6 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: Sat, 21 Aug 2010 22:36:22 -0000

On Sat, 21 Aug 2010, Rui Paulo wrote:

> If your concern is to change the status quo, you do understand that 
> you picked the worst possible thread to hijack ? Esp. since the author 
> promised to roll out a man page.

I didn't hijack anything, I responded to Ana's message saying that a man 
page was forthcoming. To me, since Ana intends to write a man page 
anyway I thought this was an excellent opportunity to highlight the fact 
that committing the man page along with the code is the preferred course 
of action.


Doug

--

 	Improve the effectiveness of your Internet presence with
 	a domain name makeover!    http://SupersetSolutions.com/

 	Computers are useless. They can only give you answers.
 			-- Pablo Picasso


From owner-svn-src-all@FreeBSD.ORG  Sat Aug 21 23:13:16 2010
Return-Path: 
Delivered-To: svn-src-all@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id C96801065673;
	Sat, 21 Aug 2010 23:13:16 +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 B98D28FC18;
	Sat, 21 Aug 2010 23:13:16 +0000 (UTC)
Received: from svn.freebsd.org (localhost [127.0.0.1])
	by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7LNDG2l083606;
	Sat, 21 Aug 2010 23:13:16 GMT (envelope-from yongari@svn.freebsd.org)
Received: (from yongari@localhost)
	by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7LNDGpH083604;
	Sat, 21 Aug 2010 23:13:16 GMT (envelope-from yongari@svn.freebsd.org)
Message-Id: <201008212313.o7LNDGpH083604@svn.freebsd.org>
From: Pyun YongHyeon 
Date: Sat, 21 Aug 2010 23:13: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: r211594 - head/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: Sat, 21 Aug 2010 23:13:16 -0000

Author: yongari
Date: Sat Aug 21 23:13:16 2010
New Revision: 211594
URL: http://svn.freebsd.org/changeset/base/211594

Log:
  Load tunable from loader.conf(5) instead of device.hints(5).

Modified:
  head/sys/dev/bge/if_bge.c

Modified: head/sys/dev/bge/if_bge.c
==============================================================================
--- head/sys/dev/bge/if_bge.c	Sat Aug 21 22:23:22 2010	(r211593)
+++ head/sys/dev/bge/if_bge.c	Sat Aug 21 23:13:16 2010	(r211594)
@@ -4898,6 +4898,8 @@ bge_add_sysctls(struct bge_softc *sc)
 	struct sysctl_ctx_list *ctx;
 	struct sysctl_oid_list *children, *schildren;
 	struct sysctl_oid *tree;
+	char tn[32];
+	int unit;
 
 	ctx = device_get_sysctl_ctx(sc->bge_dev);
 	children = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->bge_dev));
@@ -4917,6 +4919,7 @@ bge_add_sysctls(struct bge_softc *sc)
 
 #endif
 
+	unit = device_get_unit(sc->bge_dev);
 	/*
 	 * A common design characteristic for many Broadcom client controllers
 	 * is that they only support a single outstanding DMA read operation
@@ -4929,13 +4932,13 @@ bge_add_sysctls(struct bge_softc *sc)
 	 * performance is about 850Mbps. However forcing coalescing mbufs
 	 * consumes a lot of CPU cycles, so leave it off by default.
 	 */
+	sc->bge_forced_collapse = 0;
+	snprintf(tn, sizeof(tn), "dev.bge.%d.forced_collapse", unit);
+	TUNABLE_INT_FETCH(tn, &sc->bge_forced_collapse);
 	SYSCTL_ADD_INT(ctx, children, OID_AUTO, "forced_collapse",
 	    CTLFLAG_RW, &sc->bge_forced_collapse, 0,
 	    "Number of fragmented TX buffers of a frame allowed before "
 	    "forced collapsing");
-	resource_int_value(device_get_name(sc->bge_dev),
-	    device_get_unit(sc->bge_dev), "forced_collapse",
-	    &sc->bge_forced_collapse);
 
 	if (BGE_IS_5705_PLUS(sc))
 		return;