From owner-svn-src-all@FreeBSD.ORG Sun Feb 26 00:06:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA40C106566C; Sun, 26 Feb 2012 00:06:50 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 661198FC08; Sun, 26 Feb 2012 00:06:49 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 467D3B43; Sun, 26 Feb 2012 01:06:48 +0100 (CET) Date: Sun, 26 Feb 2012 01:05:29 +0100 From: Pawel Jakub Dawidek To: Adrian Chadd Message-ID: <20120226000529.GK1344@garage.freebsd.pl> References: <201202250801.q1P81Tdx006994@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="SLauP2uySp+9cKYP" Content-Disposition: inline In-Reply-To: <201202250801.q1P81Tdx006994@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232147 - head/sys/dev/wi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Feb 2012 00:06:50 -0000 --SLauP2uySp+9cKYP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Feb 25, 2012 at 08:01:29AM +0000, Adrian Chadd wrote: > Author: adrian > Date: Sat Feb 25 08:01:29 2012 > New Revision: 232147 > URL: http://svn.freebsd.org/changeset/base/232147 >=20 > Log: > If an interrupt is received with no vap attached, just fail LINK events. > =20 > This fixes a NULL pointer dereference which occurs if the vap list is > empty but someone brings up the wi0 interface. >=20 > Modified: > head/sys/dev/wi/if_wi.c >=20 > Modified: head/sys/dev/wi/if_wi.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/wi/if_wi.c Sat Feb 25 07:58:59 2012 (r232146) > +++ head/sys/dev/wi/if_wi.c Sat Feb 25 08:01:29 2012 (r232147) > @@ -1511,6 +1511,10 @@ wi_info_intr(struct wi_softc *sc) > case WI_INFO_LINK_STAT: > wi_read_bap(sc, fid, sizeof(ltbuf), &stat, sizeof(stat)); > DPRINTF(("wi_info_intr: LINK_STAT 0x%x\n", le16toh(stat))); > + > + if (vap =3D=3D NULL) > + goto finish; > + > switch (le16toh(stat)) { > case WI_INFO_LINK_STAT_CONNECTED: > if (vap->iv_state =3D=3D IEEE80211_S_RUN && > @@ -1566,6 +1570,7 @@ wi_info_intr(struct wi_softc *sc) > le16toh(ltbuf[1]), le16toh(ltbuf[0]))); > break; > } > +finish: > CSR_WRITE_2(sc, WI_EVENT_ACK, WI_EV_INFO); > } Can't you just 'break' instead of using goto? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --SLauP2uySp+9cKYP Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk9Jd0kACgkQForvXbEpPzRwwACgsmQR8LYDIP9xEkvb0MVeYIjQ ruIAn2WksOvKx0y5I6GDeLPfp/LSWLOm =7Co+ -----END PGP SIGNATURE----- --SLauP2uySp+9cKYP-- From owner-svn-src-all@FreeBSD.ORG Sun Feb 26 00:52:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C0F11065677; Sun, 26 Feb 2012 00:52:11 +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 6582B8FC1A; Sun, 26 Feb 2012 00:52:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1Q0qBnh040780; Sun, 26 Feb 2012 00:52:11 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1Q0qBmW040778; Sun, 26 Feb 2012 00:52:11 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201202260052.q1Q0qBmW040778@svn.freebsd.org> From: Christian Brueffer Date: Sun, 26 Feb 2012 00:52:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232167 - stable/9/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2012 00:52:11 -0000 Author: brueffer Date: Sun Feb 26 00:52:10 2012 New Revision: 232167 URL: http://svn.freebsd.org/changeset/base/232167 Log: MFC: r232056 Rename DESCRIPTION section to HARDWARE, so this manpage can be used for automatic hardware notes generation. Modified: stable/9/share/man/man4/isci.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/isci.4 ============================================================================== --- stable/9/share/man/man4/isci.4 Sat Feb 25 21:06:39 2012 (r232166) +++ stable/9/share/man/man4/isci.4 Sun Feb 26 00:52:10 2012 (r232167) @@ -52,7 +52,7 @@ Or, to load the driver as a module at bo .Bd -literal -offset indent isci_load="YES" .Ed -.Sh DESCRIPTION +.Sh HARDWARE The .Nm driver provides support for Intel C600 From owner-svn-src-all@FreeBSD.ORG Sun Feb 26 00:54:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB43A1065672; Sun, 26 Feb 2012 00:54: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 6A7238FC14; Sun, 26 Feb 2012 00:54:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1Q0sESE040888; Sun, 26 Feb 2012 00:54:14 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1Q0sEcT040885; Sun, 26 Feb 2012 00:54:14 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201202260054.q1Q0sEcT040885@svn.freebsd.org> From: Christian Brueffer Date: Sun, 26 Feb 2012 00:54:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232168 - in stable/9/release/doc: en_US.ISO8859-1/hardware share/misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2012 00:54:14 -0000 Author: brueffer Date: Sun Feb 26 00:54:13 2012 New Revision: 232168 URL: http://svn.freebsd.org/changeset/base/232168 Log: MFC: r232060 Add isci(4) to the hardware notes. Modified: stable/9/release/doc/en_US.ISO8859-1/hardware/article.sgml stable/9/release/doc/share/misc/dev.archlist.txt Directory Properties: stable/9/release/ (props changed) stable/9/release/doc/en_US.ISO8859-1/hardware/ (props changed) stable/9/release/picobsd/tinyware/passwd/ (props changed) Modified: stable/9/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- stable/9/release/doc/en_US.ISO8859-1/hardware/article.sgml Sun Feb 26 00:52:10 2012 (r232167) +++ stable/9/release/doc/en_US.ISO8859-1/hardware/article.sgml Sun Feb 26 00:54:13 2012 (r232168) @@ -790,6 +790,8 @@ &hwlist.ips; + &hwlist.isci; + &hwlist.isp; &hwlist.mfi; Modified: stable/9/release/doc/share/misc/dev.archlist.txt ============================================================================== --- stable/9/release/doc/share/misc/dev.archlist.txt Sun Feb 26 00:52:10 2012 (r232167) +++ stable/9/release/doc/share/misc/dev.archlist.txt Sun Feb 26 00:54:13 2012 (r232168) @@ -80,6 +80,7 @@ ida i386 ie i386 iir i386,ia64,amd64 ips i386,amd64 +isci i386,amd64 ixgb i386,amd64 kue i386,pc98,ia64,amd64,powerpc lge i386,pc98,amd64 From owner-svn-src-all@FreeBSD.ORG Sun Feb 26 00:59:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02914106564A; Sun, 26 Feb 2012 00:59:01 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.mail.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id 7C73D8FC08; Sun, 26 Feb 2012 00:59:00 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap4EAHSDSU+DaFvO/2dsb2JhbABBhSeud4FzAQEEASNWBRYUBAICDRkCWQaIFAULpWCRA4Evi28DIQICBQIKAQYEBwIGBxULBgMChEQBAjpQB4I6gRYEiE+MbpMM X-IronPort-AV: E=Sophos;i="4.73,483,1325480400"; d="scan'208";a="157913757" Received: from erie.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.206]) by esa-annu-pri.mail.uoguelph.ca with ESMTP; 25 Feb 2012 19:58:59 -0500 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id 44583B3FFC; Sat, 25 Feb 2012 19:58:59 -0500 (EST) Date: Sat, 25 Feb 2012 19:58:59 -0500 (EST) From: Rick Macklem To: Maxim Konovalov Message-ID: <788625604.124085.1330217939168.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <201202251206.q1PC6eaF016823@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.91.202] X-Mailer: Zimbra 6.0.10_GA_2692 (ZimbraWebClient - FF3.0 (Linux)/6.0.10_GA_2692) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232156 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2012 00:59:01 -0000 Maxim Konovalov wrote: > Author: maxim > Date: Sat Feb 25 12:06:40 2012 > New Revision: 232156 > URL: http://svn.freebsd.org/changeset/base/232156 > > Log: > o Reduce chances for integer overflow. > o More verbose sysctl description added. > > MFC after: 2 weeks > Sponsored by: Nginx, Inc. > > Modified: > head/sys/kern/vfs_cache.c > > Modified: head/sys/kern/vfs_cache.c > ============================================================================== > --- head/sys/kern/vfs_cache.c Sat Feb 25 11:07:32 2012 (r232155) > +++ head/sys/kern/vfs_cache.c Sat Feb 25 12:06:40 2012 (r232156) > @@ -369,7 +369,7 @@ sysctl_debug_hashstat_nchash(SYSCTL_HAND > maxlength = count; > } > n_nchash = nchash + 1; > - pct = (used * 100 * 100) / n_nchash; > + pct = (used * 100) / (n_nchash / 100); You might want to consider a sanity check to make sure n_nchash is >= 100, to avoid a "divide by zero". There was an NFS PR# a while back, where "desiredvnodes" was set very small and resulted in a "divide by zero" in the NFS code. Just a suggestion, rick > error = SYSCTL_OUT(req, &n_nchash, sizeof(n_nchash)); > if (error) > return (error); > @@ -386,7 +386,7 @@ sysctl_debug_hashstat_nchash(SYSCTL_HAND > } > SYSCTL_PROC(_debug_hashstat, OID_AUTO, nchash, CTLTYPE_INT|CTLFLAG_RD| > CTLFLAG_MPSAFE, 0, 0, sysctl_debug_hashstat_nchash, "I", > - "nchash chain lengths"); > + "nchash statistics (number of total/used buckets, maximum chain > length, usage percentage)"); > #endif > > /* From owner-svn-src-all@FreeBSD.ORG Sun Feb 26 01:46:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99B4D106566B; Sun, 26 Feb 2012 01:46:34 +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 257048FC0A; Sun, 26 Feb 2012 01:46:33 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q1Q1kULG001155 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 26 Feb 2012 12:46:31 +1100 Date: Sun, 26 Feb 2012 12:46:30 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Rick Macklem In-Reply-To: <788625604.124085.1330217939168.JavaMail.root@erie.cs.uoguelph.ca> Message-ID: <20120226122354.D2293@besplex.bde.org> References: <788625604.124085.1330217939168.JavaMail.root@erie.cs.uoguelph.ca> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Maxim Konovalov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232156 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2012 01:46:34 -0000 On Sat, 25 Feb 2012, Rick Macklem wrote: >> Log: >> o Reduce chances for integer overflow. >> o More verbose sysctl description added. >> >> MFC after: 2 weeks >> Sponsored by: Nginx, Inc. >> >> Modified: >> head/sys/kern/vfs_cache.c >> >> Modified: head/sys/kern/vfs_cache.c >> ============================================================================== >> --- head/sys/kern/vfs_cache.c Sat Feb 25 11:07:32 2012 (r232155) >> +++ head/sys/kern/vfs_cache.c Sat Feb 25 12:06:40 2012 (r232156) >> @@ -369,7 +369,7 @@ sysctl_debug_hashstat_nchash(SYSCTL_HAND >> maxlength = count; >> } >> n_nchash = nchash + 1; >> - pct = (used * 100 * 100) / n_nchash; >> + pct = (used * 100) / (n_nchash / 100); > > You might want to consider a sanity check to make > sure n_nchash is >= 100, to avoid a "divide by zero". > > There was an NFS PR# a while back, where "desiredvnodes" was > set very small and resulted in a "divide by zero" in the NFS code. Interesting. I considered mentioning this possibility in my reply, but decided that desiredvnodes is always initially at least a few hundred, since even an unbootable machine with 4MB memory has 1024 4K-pages. You can tune desiredvnodes down to a bad value, but another old bug is that tuning desiredvnodes doesn't affect the namecache, so you can't make the above divide by provided n_nchash was initially not bad. In nfs, the problem is larger and still exists in oldnfs: % nfsclient/nfs_vfsops.c- nmp->nm_wsize = NFS_WSIZE; % nfsclient/nfs_vfsops.c- nmp->nm_rsize = NFS_RSIZE; % nfsclient/nfs_vfsops.c- } % nfsclient/nfs_vfsops.c: nmp->nm_wcommitsize = hibufspace / (desiredvnodes / 1000); Now the divisor is 1000, so problems occur with the initial value occurs on machines with 10 times as much memory as ones which have a problem in the namecache code, and a good initial value can be tuned down to ensure division by zero. % nfsclient/nfs_vfsops.c- nmp->nm_readdirsize = NFS_READDIRSIZE; % nfsclient/nfs_vfsops.c- nmp->nm_numgrps = NFS_MAXGRPS; % nfsclient/nfs_vfsops.c- nmp->nm_readahead = NFS_DEFRAHEAD; % -- % fs/nfsclient/nfs_clvfsops.c- nmp->nm_timeo = NFS_TIMEO; % fs/nfsclient/nfs_clvfsops.c- nmp->nm_retry = NFS_RETRANS; % fs/nfsclient/nfs_clvfsops.c- nmp->nm_readahead = NFS_DEFRAHEAD; % fs/nfsclient/nfs_clvfsops.c: if (desiredvnodes >= 11000) % fs/nfsclient/nfs_clvfsops.c: nmp->nm_wcommitsize = hibufspace / (desiredvnodes / 1000); % fs/nfsclient/nfs_clvfsops.c- else % fs/nfsclient/nfs_clvfsops.c- nmp->nm_wcommitsize = hibufspace / 10; % fs/nfsclient/nfs_clvfsops.c- Has been fixed, but if you only want to avoid division by 0, then a simpler fix is to split up the powers of 10, e.g.: nmp->nm_wcommitsize = hibufspace * 100 / (desiredvnodes / 10); No one would set desiredvnodes to < 10, but now there is possible overflow for the multiplication, and this is even easier to arrange then division by zero since it is easy to set highbufspace to a non-physical value (2**63-1 on 64-bit machines). So this is too fragile. Except the sysctls are privileged and we should rely on their users to not misuse them. Bruce From owner-svn-src-all@FreeBSD.ORG Sun Feb 26 06:04:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20493106564A; Sun, 26 Feb 2012 06:04: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 EA02E8FC12; Sun, 26 Feb 2012 06:04:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1Q64ijX051068; Sun, 26 Feb 2012 06:04:44 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1Q64i9e051065; Sun, 26 Feb 2012 06:04:44 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201202260604.q1Q64i9e051065@svn.freebsd.org> From: Adrian Chadd Date: Sun, 26 Feb 2012 06:04: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: r232170 - head/sys/dev/ath/ath_rate/sample X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Feb 2012 06:04:45 -0000 Author: adrian Date: Sun Feb 26 06:04:44 2012 New Revision: 232170 URL: http://svn.freebsd.org/changeset/base/232170 Log: Add in some debugging code to check whether the current rate table has been bait-and-switched from the rate control code. This will avoid the panic that I saw and will avoid sending invalid rates (eg 11a/11g OFDM rates when in 11b, on 11b-only NICs (AR5211)) where the rate table is not "big". It also will point out situations where this occurs for the 11n NICs which will have sufficiently large rate tables that "invalid rix" doesn't occur. I'll try to follow this up with a commit that adds a current operating mode check. The "rix" is only relevant to the current operating mode and rate table. PR: kern/165475 Modified: head/sys/dev/ath/ath_rate/sample/sample.c head/sys/dev/ath/ath_rate/sample/sample.h Modified: head/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.c Sun Feb 26 02:24:40 2012 (r232169) +++ head/sys/dev/ath/ath_rate/sample/sample.c Sun Feb 26 06:04:44 2012 (r232170) @@ -495,6 +495,14 @@ ath_rate_findrate(struct ath_softc *sc, ath_rate_update_static_rix(sc, &an->an_node); + if (sn->currates != sc->sc_currates) { + device_printf(sc->sc_dev, "%s: currates != sc_currates!\n", + __func__); + rix = 0; + *try0 = ATH_TXMAXTRY; + goto done; + } + if (sn->static_rix != -1) { rix = sn->static_rix; *try0 = ATH_TXMAXTRY; @@ -621,6 +629,20 @@ ath_rate_findrate(struct ath_softc *sc, } *try0 = mrr ? sn->sched[rix].t0 : ATH_TXMAXTRY; done: + + /* + * This bug totally sucks and should be fixed. + * + * For now though, let's not panic, so we can start to figure + * out how to better reproduce it. + */ + if (rix < 0 || rix >= rt->rateCount) { + printf("%s: ERROR: rix %d out of bounds (rateCount=%d)\n", + __func__, + rix, + rt->rateCount); + rix = 0; /* XXX just default for now */ + } KASSERT(rix >= 0 && rix < rt->rateCount, ("rix is %d", rix)); *rix0 = rix; @@ -1073,6 +1095,8 @@ ath_rate_ctl_reset(struct ath_softc *sc, sn->static_rix = -1; ath_rate_update_static_rix(sc, ni); + sn->currates = sc->sc_currates; + /* * Construct a bitmask of usable rates. This has all * negotiated rates minus those marked by the hal as Modified: head/sys/dev/ath/ath_rate/sample/sample.h ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.h Sun Feb 26 02:24:40 2012 (r232169) +++ head/sys/dev/ath/ath_rate/sample/sample.h Sun Feb 26 06:04:44 2012 (r232170) @@ -86,6 +86,8 @@ struct sample_node { uint32_t ratemask; /* bit mask of valid rate indices */ const struct txschedule *sched; /* tx schedule table */ + const HAL_RATE_TABLE *currates; + struct rate_stats stats[NUM_PACKET_SIZE_BINS][SAMPLE_MAXRATES]; int last_sample_rix[NUM_PACKET_SIZE_BINS]; From owner-svn-src-all@FreeBSD.ORG Sun Feb 26 07:24:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFFC2106566B; Sun, 26 Feb 2012 07:24:08 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 22EAF8FC08; Sun, 26 Feb 2012 07:24:07 +0000 (UTC) Received: by werl4 with SMTP id l4so12266wer.13 for ; Sat, 25 Feb 2012 23:24:07 -0800 (PST) Received-SPF: pass (google.com: domain of adrian.chadd@gmail.com designates 10.180.101.37 as permitted sender) client-ip=10.180.101.37; Authentication-Results: mr.google.com; spf=pass (google.com: domain of adrian.chadd@gmail.com designates 10.180.101.37 as permitted sender) smtp.mail=adrian.chadd@gmail.com; dkim=pass header.i=adrian.chadd@gmail.com Received: from mr.google.com ([10.180.101.37]) by 10.180.101.37 with SMTP id fd5mr10161315wib.1.1330241047081 (num_hops = 1); Sat, 25 Feb 2012 23:24:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=wReNGcVmYqXnPszvGcoYjMXCVNjBFUUtxeoploHcEQU=; b=g63/JUbEl2Jx/98j9PeEI/ajIJHkbGNBjf9NqyyajOIR5UwmN0al2CjmZlAQq9ZcAx XDRK0fVZphdM6o+DiP5QpXiX8VdAakoJYQMdjR31qfDIG25tu+b9EVcvwUNLQx72pXaQ PwSszs406L1t+VVJeNL+BKWYVkDIBdU2b/6js= MIME-Version: 1.0 Received: by 10.180.101.37 with SMTP id fd5mr8018099wib.1.1330241046975; Sat, 25 Feb 2012 23:24:06 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.154.199 with HTTP; Sat, 25 Feb 2012 23:24:06 -0800 (PST) In-Reply-To: <201202250801.q1P81Tdx006994@svn.freebsd.org> References: <201202250801.q1P81Tdx006994@svn.freebsd.org> Date: Sat, 25 Feb 2012 23:24:06 -0800 X-Google-Sender-Auth: MYtO1xKjYXZluUSmhAItI71TlHM Message-ID: From: Adrian Chadd To: 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: r232147 - head/sys/dev/wi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Feb 2012 07:24:09 -0000 Good point.. Adiran On 25 February 2012 00:01, Adrian Chadd wrote: > Author: adrian > Date: Sat Feb 25 08:01:29 2012 > New Revision: 232147 > URL: http://svn.freebsd.org/changeset/base/232147 > > Log: > =A0If an interrupt is received with no vap attached, just fail LINK event= s. > > =A0This fixes a NULL pointer dereference which occurs if the vap list is > =A0empty but someone brings up the wi0 interface. > > Modified: > =A0head/sys/dev/wi/if_wi.c > > Modified: head/sys/dev/wi/if_wi.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/wi/if_wi.c =A0 =A0 Sat Feb 25 07:58:59 2012 =A0 =A0 =A0 = =A0(r232146) > +++ head/sys/dev/wi/if_wi.c =A0 =A0 Sat Feb 25 08:01:29 2012 =A0 =A0 =A0 = =A0(r232147) > @@ -1511,6 +1511,10 @@ wi_info_intr(struct wi_softc *sc) > =A0 =A0 =A0 =A0case WI_INFO_LINK_STAT: > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0wi_read_bap(sc, fid, sizeof(ltbuf), &stat,= sizeof(stat)); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0DPRINTF(("wi_info_intr: LINK_STAT 0x%x\n",= le16toh(stat))); > + > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (vap =3D=3D NULL) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto finish; > + > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0switch (le16toh(stat)) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case WI_INFO_LINK_STAT_CONNECTED: > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (vap->iv_state =3D=3D I= EEE80211_S_RUN && > @@ -1566,6 +1570,7 @@ wi_info_intr(struct wi_softc *sc) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0le16toh(ltbuf[1]), le16toh(ltbuf[0= ]))); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > =A0 =A0 =A0 =A0} > +finish: > =A0 =A0 =A0 =A0CSR_WRITE_2(sc, WI_EVENT_ACK, WI_EV_INFO); > =A0} > From owner-svn-src-all@FreeBSD.ORG Sun Feb 26 10:20:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0EA61065672; Sun, 26 Feb 2012 10:20:13 +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 DF54D8FC14; Sun, 26 Feb 2012 10:20:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1QAKDY0058911; Sun, 26 Feb 2012 10:20:13 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1QAKDpn058909; Sun, 26 Feb 2012 10:20:13 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201202261020.q1QAKDpn058909@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 26 Feb 2012 10:20:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232171 - stable/9/sys/netinet/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: Sun, 26 Feb 2012 10:20:14 -0000 Author: ae Date: Sun Feb 26 10:20:13 2012 New Revision: 232171 URL: http://svn.freebsd.org/changeset/base/232171 Log: MFC r231991: Don't use `m' after m_megapullup. PR: kern/165373 Modified: stable/9/sys/netinet/ipfw/ip_fw_nat.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/ipfw/ip_fw_nat.c ============================================================================== --- stable/9/sys/netinet/ipfw/ip_fw_nat.c Sun Feb 26 06:04:44 2012 (r232170) +++ stable/9/sys/netinet/ipfw/ip_fw_nat.c Sun Feb 26 10:20:13 2012 (r232171) @@ -315,7 +315,7 @@ ipfw_nat(struct ip_fw_args *args, struct } if (retval == PKT_ALIAS_RESPOND) - m->m_flags |= M_SKIP_FIREWALL; + mcl->m_flags |= M_SKIP_FIREWALL; mcl->m_pkthdr.len = mcl->m_len = ntohs(ip->ip_len); /* From owner-svn-src-all@FreeBSD.ORG Sun Feb 26 10:20:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5855D1065672; Sun, 26 Feb 2012 10:20:56 +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 1222E8FC13; Sun, 26 Feb 2012 10:20:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1QAKtfH058966; Sun, 26 Feb 2012 10:20:55 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1QAKtwX058964; Sun, 26 Feb 2012 10:20:55 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201202261020.q1QAKtwX058964@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Sun, 26 Feb 2012 10:20:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232172 - stable/8/sys/netinet/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: Sun, 26 Feb 2012 10:20:56 -0000 Author: ae Date: Sun Feb 26 10:20:55 2012 New Revision: 232172 URL: http://svn.freebsd.org/changeset/base/232172 Log: MFC r231991: Don't use `m' after m_megapullup. PR: kern/165373 Approved by: re (kib) Modified: stable/8/sys/netinet/ipfw/ip_fw_nat.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/netinet/ipfw/ip_fw_nat.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_fw_nat.c Sun Feb 26 10:20:13 2012 (r232171) +++ stable/8/sys/netinet/ipfw/ip_fw_nat.c Sun Feb 26 10:20:55 2012 (r232172) @@ -315,7 +315,7 @@ ipfw_nat(struct ip_fw_args *args, struct } if (retval == PKT_ALIAS_RESPOND) - m->m_flags |= M_SKIP_FIREWALL; + mcl->m_flags |= M_SKIP_FIREWALL; mcl->m_pkthdr.len = mcl->m_len = ntohs(ip->ip_len); /* From owner-svn-src-all@FreeBSD.ORG Sun Feb 26 11:51:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC284106566B; Sun, 26 Feb 2012 11:51:23 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id C41AC8FC14; Sun, 26 Feb 2012 11:51:22 +0000 (UTC) Received: by lagz14 with SMTP id z14so6213344lag.13 for ; Sun, 26 Feb 2012 03:51:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=3fvW3hrk4f07A3jeTvDUOQXhcWrbwC8kZthvt1351z8=; b=j9mVWNbz+vkIXA8XAZcINWnh//V/HaLVmrZu3SwhWhO1PMez1nKub9E0a4dzNBIsm1 R0VOuMGNQMoQX6r4A0x1TCQdJ7O7qemOUSu0kF8KZrz31uNQYUTF3PTaL4kmByX0d3wB Hf78bMG/krid59Q1HVUlmu7yA6aFsXY+ElwnM= MIME-Version: 1.0 Received: by 10.152.125.20 with SMTP id mm20mr6422981lab.6.1330257081568; Sun, 26 Feb 2012 03:51:21 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.152.18.4 with HTTP; Sun, 26 Feb 2012 03:51:21 -0800 (PST) In-Reply-To: <201202221505.q1MF5JNt057163@svn.freebsd.org> References: <201202221505.q1MF5JNt057163@svn.freebsd.org> Date: Sun, 26 Feb 2012 14:51:21 +0300 X-Google-Sender-Auth: rbsT2hhYKe0JmfWwvudCn-tatnk Message-ID: From: Sergey Kandaurov To: Josh Paetzel 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: r231999 - 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, 26 Feb 2012 11:51:25 -0000 On 22 February 2012 19:05, Josh Paetzel wrote: > Author: jpaetzel > Date: Wed Feb 22 15:05:19 2012 > New Revision: 231999 > URL: http://svn.freebsd.org/changeset/base/231999 > > Log: > =A0Fix various typos and normalize spelling. [...] > @@ -602,7 +602,7 @@ options =A0 =A0 FLOWTABLE > =A0options =A0 =A0 =A0 =A0SCTP > =A0# There are bunches of options: > =A0# this one turns on all sorts of > -# nastly printing that you can > +# nastily printing that you can > =A0# do. It's all controlled by a > =A0# bit mask (settable by socket opt and > =A0# by sysctl). Including will not cause adj. nasty? --=20 wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Sun Feb 26 12:54:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D6BB106564A; Sun, 26 Feb 2012 12:54:30 +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 0BCBD8FC0A; Sun, 26 Feb 2012 12:54:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1QCsT9E065979; Sun, 26 Feb 2012 12:54:29 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1QCsT3t065977; Sun, 26 Feb 2012 12:54:29 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201202261254.q1QCsT3t065977@svn.freebsd.org> From: Christian Brueffer Date: Sun, 26 Feb 2012 12:54: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: r232174 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2012 12:54:30 -0000 Author: brueffer Date: Sun Feb 26 12:54:29 2012 New Revision: 232174 URL: http://svn.freebsd.org/changeset/base/232174 Log: MFC: r232056 Rename DESCRIPTION section to HARDWARE, so this manpage can be used for automatic hardware notes generation. Approved by: re (kib) Modified: stable/8/share/man/man4/isci.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/isci.4 ============================================================================== --- stable/8/share/man/man4/isci.4 Sun Feb 26 10:52:57 2012 (r232173) +++ stable/8/share/man/man4/isci.4 Sun Feb 26 12:54:29 2012 (r232174) @@ -52,7 +52,7 @@ Or, to load the driver as a module at bo .Bd -literal -offset indent isci_load="YES" .Ed -.Sh DESCRIPTION +.Sh HARDWARE The .Nm driver provides support for Intel C600 From owner-svn-src-all@FreeBSD.ORG Sun Feb 26 12:56:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 005AB1065672; Sun, 26 Feb 2012 12:56:12 +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 E1AF78FC0C; Sun, 26 Feb 2012 12:56:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1QCuClB066082; Sun, 26 Feb 2012 12:56:12 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1QCuCdF066079; Sun, 26 Feb 2012 12:56:12 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201202261256.q1QCuCdF066079@svn.freebsd.org> From: Christian Brueffer Date: Sun, 26 Feb 2012 12:56: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: r232175 - in stable/8/release: doc/en_US.ISO8859-1/hardware doc/share/misc picobsd/floppy.tree/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: Sun, 26 Feb 2012 12:56:13 -0000 Author: brueffer Date: Sun Feb 26 12:56:12 2012 New Revision: 232175 URL: http://svn.freebsd.org/changeset/base/232175 Log: MFC: r232060 Add isci(4) to the hardware notes. Approved by: re (kib) Modified: stable/8/release/doc/en_US.ISO8859-1/hardware/article.sgml stable/8/release/doc/share/misc/dev.archlist.txt Directory Properties: stable/8/release/ (props changed) stable/8/release/doc/en_US.ISO8859-1/hardware/ (props changed) stable/8/release/picobsd/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/ (props changed) stable/8/release/picobsd/floppy.tree/sbin/dhclient-script (props changed) stable/8/release/picobsd/qemu/ (props changed) stable/8/release/picobsd/tinyware/login/ (props changed) stable/8/release/picobsd/tinyware/passwd/ (props changed) stable/8/release/powerpc/ (props changed) Modified: stable/8/release/doc/en_US.ISO8859-1/hardware/article.sgml ============================================================================== --- stable/8/release/doc/en_US.ISO8859-1/hardware/article.sgml Sun Feb 26 12:54:29 2012 (r232174) +++ stable/8/release/doc/en_US.ISO8859-1/hardware/article.sgml Sun Feb 26 12:56:12 2012 (r232175) @@ -737,6 +737,8 @@ &hwlist.ips; + &hwlist.isci; + &hwlist.isp; &hwlist.mfi; Modified: stable/8/release/doc/share/misc/dev.archlist.txt ============================================================================== --- stable/8/release/doc/share/misc/dev.archlist.txt Sun Feb 26 12:54:29 2012 (r232174) +++ stable/8/release/doc/share/misc/dev.archlist.txt Sun Feb 26 12:56:12 2012 (r232175) @@ -80,6 +80,7 @@ ida i386 ie i386 iir i386,ia64,amd64 ips i386,amd64 +isci i386,amd64 ixgb i386,amd64 kue i386,pc98,ia64,amd64,powerpc lge i386,pc98,amd64 From owner-svn-src-all@FreeBSD.ORG Sun Feb 26 13:27:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1913106566C; Sun, 26 Feb 2012 13:27:22 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B0E4C8FC0C; Sun, 26 Feb 2012 13:27:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1QDRM61067031; Sun, 26 Feb 2012 13:27:22 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1QDRMaG067029; Sun, 26 Feb 2012 13:27:22 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201202261327.q1QDRMaG067029@svn.freebsd.org> From: Justin Hibbits Date: Sun, 26 Feb 2012 13:27: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: r232176 - head/sys/modules/scc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Feb 2012 13:27:22 -0000 Author: jhibbits Date: Sun Feb 26 13:27:22 2012 New Revision: 232176 URL: http://svn.freebsd.org/changeset/base/232176 Log: Fix the scc(4) module build. Without the file it's missing a required symbol. Approved by: nwhitehorn (mentor) MFC after: 3 days Modified: head/sys/modules/scc/Makefile Modified: head/sys/modules/scc/Makefile ============================================================================== --- head/sys/modules/scc/Makefile Sun Feb 26 12:56:12 2012 (r232175) +++ head/sys/modules/scc/Makefile Sun Feb 26 13:27:22 2012 (r232176) @@ -6,7 +6,7 @@ scc_bfe= scc_bfe_ebus.c scc_bfe_sbus.c .endif .if ${MACHINE_CPUARCH} == "powerpc" -scc_bfe= scc_bfe_macio.c scc_bfe_quicc.c +scc_bfe= scc_bfe_macio.c scc_bfe_quicc.c scc_dev_quicc.c .endif KMOD= scc From owner-svn-src-all@FreeBSD.ORG Sun Feb 26 13:45:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 929481065670; Sun, 26 Feb 2012 13:45:25 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 804878FC16; Sun, 26 Feb 2012 13:45:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1QDjP86067632; Sun, 26 Feb 2012 13:45:25 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1QDjPqc067626; Sun, 26 Feb 2012 13:45:25 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201202261345.q1QDjPqc067626@svn.freebsd.org> From: Justin Hibbits Date: Sun, 26 Feb 2012 13:45: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: r232177 - in head: etc/devd sys/conf sys/powerpc/conf sys/powerpc/powermac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2012 13:45:25 -0000 Author: jhibbits Date: Sun Feb 26 13:45:25 2012 New Revision: 232177 URL: http://svn.freebsd.org/changeset/base/232177 Log: Add backlight control to ATI-graphics PowerBooks and iBooks. Approved by: nwhitehorn (mentor) MFC after: 1 week Added: head/sys/powerpc/powermac/atibl.c (contents, props changed) Modified: head/etc/devd/apple.conf head/sys/conf/files.powerpc head/sys/powerpc/conf/GENERIC head/sys/powerpc/conf/GENERIC64 Modified: head/etc/devd/apple.conf ============================================================================== --- head/etc/devd/apple.conf Sun Feb 26 13:27:22 2012 (r232176) +++ head/etc/devd/apple.conf Sun Feb 26 13:45:25 2012 (r232177) @@ -19,6 +19,26 @@ notify 0 { }; +# The next blocks enable brightness hotkeys that can be found on Apple laptops +notify 0 { + match "system" "PMU"; + match "subsystem" "keys"; + match "type" "brightness"; + match "notify" "down"; + action "sysctl dev.backlight.0.level=\ + $(expr `sysctl -n dev.backlight.0.level` - 10)"; +}; + +notify 0 { + match "system" "PMU"; + match "subsystem" "keys"; + match "type" "brightness"; + match "notify" "up"; + action "sysctl dev.backlight.0.level=\ + $(expr `sysctl -n dev.backlight.0.level` + 10)"; +}; + + # The next blocks enable volume hotkeys that can be found on Apple laptops notify 0 { match "system" "PMU"; Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sun Feb 26 13:27:22 2012 (r232176) +++ head/sys/conf/files.powerpc Sun Feb 26 13:45:25 2012 (r232177) @@ -145,6 +145,7 @@ powerpc/ofw/rtas.c optional aim powerpc/powermac/ata_kauai.c optional powermac ata | powermac atamacio powerpc/powermac/ata_macio.c optional powermac ata | powermac atamacio powerpc/powermac/ata_dbdma.c optional powermac ata | powermac atamacio +powerpc/powermac/atibl.c optional powermac atibl powerpc/powermac/cuda.c optional powermac cuda powerpc/powermac/cpcht.c optional powermac pci powerpc/powermac/dbdma.c optional powermac pci Modified: head/sys/powerpc/conf/GENERIC ============================================================================== --- head/sys/powerpc/conf/GENERIC Sun Feb 26 13:27:22 2012 (r232176) +++ head/sys/powerpc/conf/GENERIC Sun Feb 26 13:45:25 2012 (r232177) @@ -194,6 +194,7 @@ device max6690 # PowerMac7,2 temperatu device powermac_nvram # Open Firmware configuration NVRAM device smu # Apple System Management Unit device windtunnel # Apple G4 MDD fan controller +device atibl # ATI-based backlight driver for PowerBooks/iBooks # ADB support device adb Modified: head/sys/powerpc/conf/GENERIC64 ============================================================================== --- head/sys/powerpc/conf/GENERIC64 Sun Feb 26 13:27:22 2012 (r232176) +++ head/sys/powerpc/conf/GENERIC64 Sun Feb 26 13:45:25 2012 (r232177) @@ -188,6 +188,7 @@ device fcu # Apple Fan Control Unit device max6690 # PowerMac7,2 temperature sensor device powermac_nvram # Open Firmware configuration NVRAM device smu # Apple System Management Unit +device atibl # ATI-based backlight driver for PowerBooks/iBooks # ADB support device adb Added: head/sys/powerpc/powermac/atibl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/powermac/atibl.c Sun Feb 26 13:45:25 2012 (r232177) @@ -0,0 +1,196 @@ +/*- + * Copyright (c) 2012 Justin Hibbits + * 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 +#include +#include +#include +#include +#include +#include + +#include + +#include + +/* From the xf86-video-ati driver's radeon_reg.h */ +#define RADEON_LVDS_GEN_CNTL 0x02d0 +#define RADEON_LVDS_ON (1 << 0) +#define RADEON_LVDS_DISPLAY_DIS (1 << 1) +#define RADEON_LVDS_PANEL_TYPE (1 << 2) +#define RADEON_LVDS_PANEL_FORMAT (1 << 3) +#define RADEON_LVDS_RST_FM (1 << 6) +#define RADEON_LVDS_EN (1 << 7) +#define RADEON_LVDS_BL_MOD_LEVEL_SHIFT 8 +#define RADEON_LVDS_BL_MOD_LEVEL_MASK (0xff << 8) +#define RADEON_LVDS_BL_MOD_EN (1 << 16) +#define RADEON_LVDS_DIGON (1 << 18) +#define RADEON_LVDS_BLON (1 << 19) + +struct atibl_softc { + device_t dev; + struct resource *sc_memr; +}; + +static void atibl_identify(driver_t *driver, device_t parent); +static int atibl_probe(device_t dev); +static int atibl_attach(device_t dev); +static int atibl_setlevel(struct atibl_softc *sc, int newlevel); +static int atibl_getlevel(struct atibl_softc *sc); +static int atibl_sysctl(SYSCTL_HANDLER_ARGS); + +static device_method_t atibl_methods[] = { + /* Device interface */ + DEVMETHOD(device_identify, atibl_identify), + DEVMETHOD(device_probe, atibl_probe), + DEVMETHOD(device_attach, atibl_attach), + {0, 0}, +}; + +static driver_t atibl_driver = { + "backlight", + atibl_methods, + sizeof(struct atibl_softc) +}; + +static devclass_t atibl_devclass; + +DRIVER_MODULE(atibl, vgapci, atibl_driver, atibl_devclass, 0, 0); + +static void +atibl_identify(driver_t *driver, device_t parent) +{ + if (device_find_child(parent, "backlight", -1) == NULL) + device_add_child(parent, "backlight", -1); +} + +static int +atibl_probe(device_t dev) +{ + char control[8]; + phandle_t handle; + + handle = OF_finddevice("mac-io/backlight"); + + if (handle <= 0) + return (ENXIO); + + if (OF_getprop(handle, "backlight-control", &control, sizeof(control)) < 0) + return (ENXIO); + + if (strcmp(control, "ati") != 0) + return (ENXIO); + + device_set_desc(dev, "PowerBook backlight"); + + return (0); +} + +static int +atibl_attach(device_t dev) +{ + struct atibl_softc *sc; + struct sysctl_ctx_list *ctx; + struct sysctl_oid *tree; + int rid; + + sc = device_get_softc(dev); + + rid = 0x18; /* BAR[2], for the MMIO register */ + sc->sc_memr = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE | RF_SHAREABLE); + if (sc->sc_memr == NULL) { + device_printf(dev, "Could not alloc mem resource!\n"); + return (ENXIO); + } + + ctx = device_get_sysctl_ctx(dev); + tree = device_get_sysctl_tree(dev); + + SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "level", CTLTYPE_INT | CTLFLAG_RW, sc, 0, + atibl_sysctl, "I", "Backlight level (0-100)"); + + return (0); +} + +static int +atibl_setlevel(struct atibl_softc *sc, int newlevel) +{ + uint32_t lvds_gen_cntl; + + if (newlevel > 100) + newlevel = 100; + + if (newlevel < 0) + newlevel = 0; + + newlevel = (newlevel * 5) / 2 + 5; + lvds_gen_cntl = bus_read_4(sc->sc_memr, RADEON_LVDS_GEN_CNTL); + lvds_gen_cntl |= RADEON_LVDS_BL_MOD_EN; + lvds_gen_cntl &= ~RADEON_LVDS_BL_MOD_LEVEL_MASK; + lvds_gen_cntl |= (newlevel << RADEON_LVDS_BL_MOD_LEVEL_SHIFT) & + RADEON_LVDS_BL_MOD_LEVEL_MASK; + bus_write_4(sc->sc_memr, RADEON_LVDS_GEN_CNTL, lvds_gen_cntl); + + return (0); +} + +static int +atibl_getlevel(struct atibl_softc *sc) +{ + uint32_t lvds_gen_cntl; + int level; + + lvds_gen_cntl = bus_read_4(sc->sc_memr, RADEON_LVDS_GEN_CNTL); + + level = ((lvds_gen_cntl & RADEON_LVDS_BL_MOD_LEVEL_MASK) >> + RADEON_LVDS_BL_MOD_LEVEL_SHIFT); + level = ((level - 5) * 2) / 5; + + return (level); +} + +static int +atibl_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct atibl_softc *sc; + int newlevel, error; + + sc = arg1; + + newlevel = atibl_getlevel(sc); + + error = sysctl_handle_int(oidp, &newlevel, 0, req); + + if (error || !req->newptr) + return (error); + + return (atibl_setlevel(sc, newlevel)); +} From owner-svn-src-all@FreeBSD.ORG Sun Feb 26 13:51:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DDCB106566C; Sun, 26 Feb 2012 13:51:05 +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 543728FC0C; Sun, 26 Feb 2012 13:51:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1QDp5Lh067830; Sun, 26 Feb 2012 13:51:05 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1QDp571067828; Sun, 26 Feb 2012 13:51:05 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202261351.q1QDp571067828@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 26 Feb 2012 13:51: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: r232178 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2012 13:51:05 -0000 Author: kib Date: Sun Feb 26 13:51:05 2012 New Revision: 232178 URL: http://svn.freebsd.org/changeset/base/232178 Log: Remove apparently redundand checks for socket so_proto being non-NULL from sosetopt() and sogetopt(). No exposed sockets may have so_proto invalid. Discussed with: bz, rwatson Reviewed by: glebius MFC after: 2 weeks Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Sun Feb 26 13:45:25 2012 (r232177) +++ head/sys/kern/uipc_socket.c Sun Feb 26 13:51:05 2012 (r232178) @@ -2447,7 +2447,7 @@ sosetopt(struct socket *so, struct socko CURVNET_SET(so->so_vnet); error = 0; if (sopt->sopt_level != SOL_SOCKET) { - if (so->so_proto && so->so_proto->pr_ctloutput) { + if (so->so_proto->pr_ctloutput != NULL) { error = (*so->so_proto->pr_ctloutput)(so, sopt); CURVNET_RESTORE(); return (error); @@ -2508,8 +2508,7 @@ sosetopt(struct socket *so, struct socko error = EINVAL; goto bad; } - if (so->so_proto != NULL && - ((so->so_proto->pr_domain->dom_family == PF_INET) || + if (((so->so_proto->pr_domain->dom_family == PF_INET) || (so->so_proto->pr_domain->dom_family == PF_INET6) || (so->so_proto->pr_domain->dom_family == PF_ROUTE))) { so->so_fibnum = optval; @@ -2641,11 +2640,8 @@ sosetopt(struct socket *so, struct socko error = ENOPROTOOPT; break; } - if (error == 0 && so->so_proto != NULL && - so->so_proto->pr_ctloutput != NULL) { - (void) ((*so->so_proto->pr_ctloutput) - (so, sopt)); - } + if (error == 0 && so->so_proto->pr_ctloutput != NULL) + (void)(*so->so_proto->pr_ctloutput)(so, sopt); } bad: CURVNET_RESTORE(); @@ -2695,7 +2691,7 @@ sogetopt(struct socket *so, struct socko CURVNET_SET(so->so_vnet); error = 0; if (sopt->sopt_level != SOL_SOCKET) { - if (so->so_proto && so->so_proto->pr_ctloutput) + if (so->so_proto->pr_ctloutput != NULL) error = (*so->so_proto->pr_ctloutput)(so, sopt); else error = ENOPROTOOPT; From owner-svn-src-all@FreeBSD.ORG Sun Feb 26 13:55:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4C96106566B; Sun, 26 Feb 2012 13:55:43 +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 D44788FC12; Sun, 26 Feb 2012 13:55:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1QDthwV068044; Sun, 26 Feb 2012 13:55:43 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1QDth33068041; Sun, 26 Feb 2012 13:55:43 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202261355.q1QDth33068041@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 26 Feb 2012 13:55:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232179 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2012 13:55:44 -0000 Author: kib Date: Sun Feb 26 13:55:43 2012 New Revision: 232179 URL: http://svn.freebsd.org/changeset/base/232179 Log: Add SO_PROTOCOL/SO_PROTOTYPE socket SOL_SOCKET-level option to get the socket protocol number. This is useful since the socket type can be implemented by different protocols in the same protocol family, e.g. SOCK_STREAM may be provided by both TCP and SCTP. Submitted by: Jukka A. Ukkonen PR: kern/162352 Discussed with: bz Reviewed by: glebius MFC after: 2 weeks Modified: head/sys/kern/uipc_socket.c head/sys/sys/socket.h Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Sun Feb 26 13:51:05 2012 (r232178) +++ head/sys/kern/uipc_socket.c Sun Feb 26 13:55:43 2012 (r232179) @@ -2733,6 +2733,10 @@ integer: optval = so->so_type; goto integer; + case SO_PROTOCOL: + optval = so->so_proto->pr_protocol; + goto integer; + case SO_ERROR: SOCK_LOCK(so); optval = so->so_error; Modified: head/sys/sys/socket.h ============================================================================== --- head/sys/sys/socket.h Sun Feb 26 13:51:05 2012 (r232178) +++ head/sys/sys/socket.h Sun Feb 26 13:55:43 2012 (r232179) @@ -138,6 +138,8 @@ typedef __uid_t uid_t; #define SO_LISTENINCQLEN 0x1013 /* socket's incomplete queue length */ #define SO_SETFIB 0x1014 /* use this FIB to route */ #define SO_USER_COOKIE 0x1015 /* user cookie (dummynet etc.) */ +#define SO_PROTOCOL 0x1016 /* get socket protocol (Linux name) */ +#define SO_PROTOTYPE SO_PROTOCOL /* alias for SO_PROTOCOL (SunOS name) */ #endif /* From owner-svn-src-all@FreeBSD.ORG Sun Feb 26 13:57:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0EE411065673; Sun, 26 Feb 2012 13:57:25 +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 F249B8FC20; Sun, 26 Feb 2012 13:57:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1QDvOeK068137; Sun, 26 Feb 2012 13:57:24 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1QDvOcs068135; Sun, 26 Feb 2012 13:57:24 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202261357.q1QDvOcs068135@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 26 Feb 2012 13:57:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232180 - head/lib/libc/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, 26 Feb 2012 13:57:25 -0000 Author: kib Date: Sun Feb 26 13:57:24 2012 New Revision: 232180 URL: http://svn.freebsd.org/changeset/base/232180 Log: Document SO_PROTOCOL socket option. Discussed with: bz Reviewed by: glebius MFC after: 2 weeks Modified: head/lib/libc/sys/getsockopt.2 Modified: head/lib/libc/sys/getsockopt.2 ============================================================================== --- head/lib/libc/sys/getsockopt.2 Sun Feb 26 13:55:43 2012 (r232179) +++ head/lib/libc/sys/getsockopt.2 Sun Feb 26 13:57:24 2012 (r232180) @@ -28,7 +28,7 @@ .\" @(#)getsockopt.2 8.4 (Berkeley) 5/2/95 .\" $FreeBSD$ .\" -.Dd November 21, 2011 +.Dd February 26, 2012 .Dt GETSOCKOPT 2 .Os .Sh NAME @@ -172,6 +172,8 @@ for the socket .It Dv SO_BINTIME Ta "enables reception of a timestamp with datagrams" .It Dv SO_ACCEPTCONN Ta "get listening status of the socket (get only)" .It Dv SO_TYPE Ta "get the type of the socket (get only)" +.It Dv SO_PROTOCOL Ta "get the protocol number for the socket (get only)" +.It Dv SO_PROTOTYPE Ta "SunOS alias for the Linux SO_PROTOCOL (get only)" .It Dv SO_ERROR Ta "get and clear error on the socket (get only)" .It Dv SO_SETFIB Ta "set the associated FIB (routing table) for the socket (set only)" .El @@ -449,7 +451,10 @@ and for .Ed .Pp .Dv SO_ACCEPTCONN , -.Dv SO_TYPE +.Dv SO_TYPE , +.Dv SO_PROTOCOL +(and its alias +.Dv SO_PROTOTYPE ) and .Dv SO_ERROR are options used only with @@ -463,6 +468,12 @@ system call was invoked on the socket. returns the type of the socket, such as .Dv SOCK_STREAM ; it is useful for servers that inherit sockets on startup. +.Dv SO_PROTOCOL +returns the protocol number for the socket, for +.Dv AF_INET +and +.Dv AF_INET6 +address families. .Dv SO_ERROR returns any pending error on the socket and clears the error status. From owner-svn-src-all@FreeBSD.ORG Sun Feb 26 14:25:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 5F1F91065670; Sun, 26 Feb 2012 14:25:05 +0000 (UTC) Date: Sun, 26 Feb 2012 14:25:05 +0000 From: Alexander Best To: Bruce Evans Message-ID: <20120226142505.GA63828@freebsd.org> References: <201202232134.q1NLYEq5024067@svn.freebsd.org> <20120224093807.GA88853@freebsd.org> <4F476FEA.1090004@FreeBSD.org> <20120224112224.GA13109@freebsd.org> <20120225061506.C2626@besplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120225061506.C2626@besplex.bde.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Dimitry Andric Subject: Re: svn commit: r232074 - head/sys/cam/ctl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2012 14:25:05 -0000 On Sat Feb 25 12, Bruce Evans wrote: > On Fri, 24 Feb 2012, Alexander Best wrote: > > >On Fri Feb 24 12, Dimitry Andric wrote: > >>On 2012-02-24 10:38, Alexander Best wrote: > >>>which will turn all -Wformat-invalid-specifier and -Wformat-extra-args > >>>errors > >>>into warnings (because clang tot doesn't support -fformat-extensions)? > >> > >>It would be better to push our format extensions upstream, I think. > >>Though the option should probably be renamed to something else, e.g. > >>-ffreebsd-extensions, or such. > > It is only for format extensions. The idea is that a C compiler that > supports warning about unsupported printf formats must warn about > uses of format extensions (no matter whose they are) unless instructed > not to do so. It seems excessive to have separate flags > -fbsd-format-extensions -ffreebsd-format-extensions > -fotherbsd-format-extensions -fgnu-format-extensions > -flinux-format-extensions ..., so I used a single flag. If > -fbsd-format-extensions existed, then it would have only %b as an > extension. > > Anyway, clang already supports -fformat-extensions. The following > compiles with this, but fails messily without it: > > % #include > % > % void > % foo(void) > % { > % printf("0x%b\n", 1, "\1foo"); > % } > > gcc (FreeBSD-gcc) complains about %#b, but clang doesn't. I don't know > if %#b is valid, but it should be. > > >i'm still confused regarding the actual politics regarding this change. > >everytime this comes up i get a different answer. the last one was that > >since > >the special printf format is only used for kernel code, the > >-fformat-extensions > >code within clang base shouldn't be pushed upstream. > > Is it only the FreeBSD version of clang that has it? Does FreeBSD has any > other significant local changes? The flag should be push upstream, but > there are likely to always be OS-specific details. For example, if %#b > is indeed invalid and someone fixes the kernel to support it, you don't > want to have to wait for the upstream sources to be synchronized before > using %#b. yes. only the clang version that ships with the freebsd src has support for -fformat-extensions, however i couldn't find any referrence to it in the clang(1) manual page. so it seems the support was only hacked into the clang source and the manual page wasn't updated. getting these changes pushed upstream would be nice. it's very likely that the clang folks will rename -fformat-extensions to something else, but it shouldn't be a big problem handling the different flag names in some *.mk file. i don't know, if the freebsd of clang has any other major differences compared to the vendor version. maybe the freebsd-clang wiki page has some details about this matter (or will direct you to people who know the answer). cheers. alex > > Bruce From owner-svn-src-all@FreeBSD.ORG Sun Feb 26 14:25:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6FF71065674; Sun, 26 Feb 2012 14:25:48 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BCB738FC14; Sun, 26 Feb 2012 14:25:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1QEPm32069105; Sun, 26 Feb 2012 14:25:48 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1QEPm9g069102; Sun, 26 Feb 2012 14:25:48 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201202261425.q1QEPm9g069102@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 26 Feb 2012 14:25: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: r232181 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2012 14:25:49 -0000 Author: trociny Date: Sun Feb 26 14:25:48 2012 New Revision: 232181 URL: http://svn.freebsd.org/changeset/base/232181 Log: Add sysctl to retrieve or set umask of another process. Submitted by: Dmitry Banschikov Discussed with: kib, rwatson Reviewed by: kib MFC after: 2 weeks Modified: head/sys/kern/kern_proc.c head/sys/sys/sysctl.h Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Sun Feb 26 13:57:24 2012 (r232180) +++ head/sys/kern/kern_proc.c Sun Feb 26 14:25:48 2012 (r232181) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -2471,6 +2472,49 @@ sysctl_kern_proc_ps_strings(SYSCTL_HANDL return (error); } +/* + * This sysctl allows a process to retrieve or/and set umask of + * another process. + */ +static int +sysctl_kern_proc_umask(SYSCTL_HANDLER_ARGS) +{ + int *name = (int *)arg1; + u_int namelen = arg2; + struct proc *p; + int error; + u_short fd_cmask; + + if (namelen != 1) + return (EINVAL); + + if (req->newptr != NULL && req->newlen != sizeof(fd_cmask)) + return (EINVAL); + + error = pget((pid_t)name[0], PGET_WANTREAD, &p); + if (error != 0) + return (error); + + FILEDESC_SLOCK(p->p_fd); + fd_cmask = p->p_fd->fd_cmask; + FILEDESC_SUNLOCK(p->p_fd); + error = SYSCTL_OUT(req, &fd_cmask, sizeof(fd_cmask)); + if (error != 0) + goto errout; + + if (req->newptr != NULL) { + error = SYSCTL_IN(req, &fd_cmask, sizeof(fd_cmask)); + if (error == 0) { + FILEDESC_XLOCK(p->p_fd); + p->p_fd->fd_cmask = fd_cmask & ALLPERMS; + FILEDESC_XUNLOCK(p->p_fd); + } + } +errout: + PRELE(p); + return (error); +} + SYSCTL_NODE(_kern, KERN_PROC, proc, CTLFLAG_RD, 0, "Process table"); SYSCTL_PROC(_kern_proc, KERN_PROC_ALL, all, CTLFLAG_RD|CTLTYPE_STRUCT| @@ -2572,3 +2616,7 @@ static SYSCTL_NODE(_kern_proc, KERN_PROC static SYSCTL_NODE(_kern_proc, KERN_PROC_PS_STRINGS, ps_strings, CTLFLAG_RD | CTLFLAG_MPSAFE, sysctl_kern_proc_ps_strings, "Process ps_strings location"); + +static SYSCTL_NODE(_kern_proc, KERN_PROC_UMASK, umask, CTLFLAG_RW | + CTLFLAG_ANYBODY | CTLFLAG_MPSAFE, sysctl_kern_proc_umask, + "Process umask"); Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Sun Feb 26 13:57:24 2012 (r232180) +++ head/sys/sys/sysctl.h Sun Feb 26 14:25:48 2012 (r232181) @@ -563,6 +563,7 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a #define KERN_PROC_AUXV 36 /* get ELF auxiliary vector */ #define KERN_PROC_RLIMIT 37 /* process resource limits */ #define KERN_PROC_PS_STRINGS 38 /* get ps_strings location */ +#define KERN_PROC_UMASK 39 /* process umask */ /* * KERN_IPC identifiers From owner-svn-src-all@FreeBSD.ORG Sun Feb 26 14:27:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97084106564A; Sun, 26 Feb 2012 14:27:35 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D2818FC0A; Sun, 26 Feb 2012 14:27:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1QERZaJ069201; Sun, 26 Feb 2012 14:27:35 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1QERZqE069199; Sun, 26 Feb 2012 14:27:35 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201202261427.q1QERZqE069199@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 26 Feb 2012 14:27: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: r232182 - head/usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Feb 2012 14:27:35 -0000 Author: trociny Date: Sun Feb 26 14:27:34 2012 New Revision: 232182 URL: http://svn.freebsd.org/changeset/base/232182 Log: When displaying security credential information show also process umask. Submitted by: Dmitry Banschikov Discussed with: rwatson MFC after: 2 weeks Modified: head/usr.bin/procstat/procstat_cred.c Modified: head/usr.bin/procstat/procstat_cred.c ============================================================================== --- head/usr.bin/procstat/procstat_cred.c Sun Feb 26 14:25:48 2012 (r232181) +++ head/usr.bin/procstat/procstat_cred.c Sun Feb 26 14:27:34 2012 (r232182) @@ -38,6 +38,8 @@ #include "procstat.h" +static const char *get_umask(struct kinfo_proc *kipp); + void procstat_cred(struct kinfo_proc *kipp) { @@ -48,9 +50,9 @@ procstat_cred(struct kinfo_proc *kipp) gid_t *groups = NULL; if (!hflag) - printf("%5s %-16s %5s %5s %5s %5s %5s %5s %5s %-15s\n", "PID", - "COMM", "EUID", "RUID", "SVUID", "EGID", "RGID", "SVGID", - "FLAGS", "GROUPS"); + printf("%5s %-16s %5s %5s %5s %5s %5s %5s %5s %5s %-15s\n", + "PID", "COMM", "EUID", "RUID", "SVUID", "EGID", "RGID", + "SVGID", "UMASK", "FLAGS", "GROUPS"); printf("%5d ", kipp->ki_pid); printf("%-16s ", kipp->ki_comm); @@ -60,6 +62,7 @@ procstat_cred(struct kinfo_proc *kipp) printf("%5d ", kipp->ki_groups[0]); printf("%5d ", kipp->ki_rgid); printf("%5d ", kipp->ki_svgid); + printf("%5s ", get_umask(kipp)); printf("%s", kipp->ki_cr_flags & CRED_FLAG_CAPMODE ? "C" : "-"); printf(" "); @@ -98,3 +101,26 @@ procstat_cred(struct kinfo_proc *kipp) printf("\n"); } + +static const char * +get_umask(struct kinfo_proc *kipp) +{ + int error; + int mib[4]; + size_t len; + u_short fd_cmask; + static char umask[4]; + + mib[0] = CTL_KERN; + mib[1] = KERN_PROC; + mib[2] = KERN_PROC_UMASK; + mib[3] = kipp->ki_pid; + len = sizeof(fd_cmask); + error = sysctl(mib, 4, &fd_cmask, &len, NULL, 0); + if (error == 0) { + snprintf(umask, 4, "%03o", fd_cmask); + return (umask); + } else { + return ("-"); + } +} From owner-svn-src-all@FreeBSD.ORG Sun Feb 26 15:14:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2DC4106564A; Sun, 26 Feb 2012 15:14:29 +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 A21478FC08; Sun, 26 Feb 2012 15:14:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1QFETUC070812; Sun, 26 Feb 2012 15:14:29 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1QFET0v070810; Sun, 26 Feb 2012 15:14:29 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201202261514.q1QFET0v070810@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 26 Feb 2012 15:14: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: r232183 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2012 15:14:29 -0000 Author: jilles Date: Sun Feb 26 15:14:29 2012 New Revision: 232183 URL: http://svn.freebsd.org/changeset/base/232183 Log: Fix fchmod() and fchown() on fifos. The new fifo implementation in r232055 broke fchmod() and fchown() on fifos. Postfix needs this. Submitted by: gianni Reported by: dougb Modified: head/sys/kern/sys_pipe.c Modified: head/sys/kern/sys_pipe.c ============================================================================== --- head/sys/kern/sys_pipe.c Sun Feb 26 14:27:34 2012 (r232182) +++ head/sys/kern/sys_pipe.c Sun Feb 26 15:14:29 2012 (r232183) @@ -152,6 +152,8 @@ static fo_poll_t pipe_poll; static fo_kqfilter_t pipe_kqfilter; static fo_stat_t pipe_stat; static fo_close_t pipe_close; +static fo_chmod_t pipe_chmod; +static fo_chown_t pipe_chown; struct fileops pipeops = { .fo_read = pipe_read, @@ -162,8 +164,8 @@ struct fileops pipeops = { .fo_kqfilter = pipe_kqfilter, .fo_stat = pipe_stat, .fo_close = pipe_close, - .fo_chmod = invfo_chmod, - .fo_chown = invfo_chown, + .fo_chmod = pipe_chmod, + .fo_chown = pipe_chown, .fo_flags = DFLAG_PASSABLE }; @@ -1548,6 +1550,43 @@ pipe_close(fp, td) return (0); } +static int +pipe_chmod(fp, mode, active_cred, td) + struct file *fp; + mode_t mode; + struct ucred *active_cred; + struct thread *td; +{ + struct pipe *cpipe; + int error; + + cpipe = fp->f_data; + if (cpipe->pipe_state & PIPE_NAMED) + error = vn_chmod(fp, mode, active_cred, td); + else + error = invfo_chmod(fp, mode, active_cred, td); + return (error); +} + +static int +pipe_chown(fp, uid, gid, active_cred, td) + struct file *fp; + uid_t uid; + gid_t gid; + struct ucred *active_cred; + struct thread *td; +{ + struct pipe *cpipe; + int error; + + cpipe = fp->f_data; + if (cpipe->pipe_state & PIPE_NAMED) + error = vn_chown(fp, uid, gid, active_cred, td); + else + error = invfo_chown(fp, uid, gid, active_cred, td); + return (error); +} + static void pipe_free_kmem(cpipe) struct pipe *cpipe; From owner-svn-src-all@FreeBSD.ORG Sun Feb 26 15:32:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9706D106564A; Sun, 26 Feb 2012 15:32:02 +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 7BFCC8FC08; Sun, 26 Feb 2012 15:32:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1QFW2Hg071426; Sun, 26 Feb 2012 15:32:02 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1QFW285071424; Sun, 26 Feb 2012 15:32:02 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201202261532.q1QFW285071424@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 26 Feb 2012 15:32: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: r232184 - head/tools/regression/fifo/fifo_misc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2012 15:32:02 -0000 Author: jilles Date: Sun Feb 26 15:32:02 2012 New Revision: 232184 URL: http://svn.freebsd.org/changeset/base/232184 Log: Check fchmod()/fchown() in fifo_misc test. Modified: head/tools/regression/fifo/fifo_misc/fifo_misc.c Modified: head/tools/regression/fifo/fifo_misc/fifo_misc.c ============================================================================== --- head/tools/regression/fifo/fifo_misc/fifo_misc.c Sun Feb 26 15:14:29 2012 (r232183) +++ head/tools/regression/fifo/fifo_misc/fifo_misc.c Sun Feb 26 15:32:02 2012 (r232184) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2005 Robert N. M. Watson + * Copyright (c) 2012 Jilles Tjoelker * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -223,6 +224,97 @@ test_ioctl(void) cleanfifo("testfifo", reader_fd, writer_fd); } +/* + * fchmod(2)/fchown(2) on FIFO should work. + */ +static void +test_chmodchown(void) +{ + struct stat sb; + int reader_fd, writer_fd; + uid_t u; + gid_t g; + + makefifo("testfifo", __func__); + + if (openfifo("testfifo", __func__, &reader_fd, &writer_fd) < 0) { + warn("%s: openfifo", __func__); + cleanfifo("testfifo", -1, -1); + exit(-1); + } + + if (fchmod(reader_fd, 0666) != 0) { + warn("%s: fchmod", __func__); + cleanfifo("testfifo", reader_fd, writer_fd); + exit(-1); + } + + if (stat("testfifo", &sb) != 0) { + warn("%s: stat", __func__); + cleanfifo("testfifo", reader_fd, writer_fd); + exit(-1); + } + + if ((sb.st_mode & 0777) != 0666) { + warnx("%s: stat chmod result", __func__); + cleanfifo("testfifo", reader_fd, writer_fd); + exit(-1); + } + + if (fstat(writer_fd, &sb) != 0) { + warn("%s: fstat", __func__); + cleanfifo("testfifo", reader_fd, writer_fd); + exit(-1); + } + + if ((sb.st_mode & 0777) != 0666) { + warnx("%s: fstat chmod result", __func__); + cleanfifo("testfifo", reader_fd, writer_fd); + exit(-1); + } + + if (fchown(reader_fd, -1, -1) != 0) { + warn("%s: fchown 1", __func__); + cleanfifo("testfifo", reader_fd, writer_fd); + exit(-1); + } + + u = geteuid(); + if (u == 0) + u = 1; + g = getegid(); + if (fchown(reader_fd, u, g) != 0) { + warn("%s: fchown 2", __func__); + cleanfifo("testfifo", reader_fd, writer_fd); + exit(-1); + } + if (stat("testfifo", &sb) != 0) { + warn("%s: stat", __func__); + cleanfifo("testfifo", reader_fd, writer_fd); + exit(-1); + } + + if (sb.st_uid != u || sb.st_gid != g) { + warnx("%s: stat chown result", __func__); + cleanfifo("testfifo", reader_fd, writer_fd); + exit(-1); + } + + if (fstat(writer_fd, &sb) != 0) { + warn("%s: fstat", __func__); + cleanfifo("testfifo", reader_fd, writer_fd); + exit(-1); + } + + if (sb.st_uid != u || sb.st_gid != g) { + warnx("%s: fstat chown result", __func__); + cleanfifo("testfifo", reader_fd, writer_fd); + exit(-1); + } + + cleanfifo("testfifo", -1, -1); +} + int main(int argc, char *argv[]) { @@ -238,6 +330,7 @@ main(int argc, char *argv[]) test_lseek(); test_truncate(); test_ioctl(); + test_chmodchown(); return (0); } From owner-svn-src-all@FreeBSD.ORG Sun Feb 26 16:05:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2EF2106566B; Sun, 26 Feb 2012 16:05:20 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B23738FC1C; Sun, 26 Feb 2012 16:05:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1QG5KE8072592; Sun, 26 Feb 2012 16:05:20 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1QG5KfZ072590; Sun, 26 Feb 2012 16:05:20 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201202261605.q1QG5KfZ072590@svn.freebsd.org> From: Kevin Lo Date: Sun, 26 Feb 2012 16:05: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: r232185 - head/sys/dev/dpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Feb 2012 16:05:20 -0000 Author: kevlo Date: Sun Feb 26 16:05:20 2012 New Revision: 232185 URL: http://svn.freebsd.org/changeset/base/232185 Log: Remove duplicate assignment of CTS_SPI_VALID_SYNC_RATE bit Modified: head/sys/dev/dpt/dpt_scsi.c Modified: head/sys/dev/dpt/dpt_scsi.c ============================================================================== --- head/sys/dev/dpt/dpt_scsi.c Sun Feb 26 15:32:02 2012 (r232184) +++ head/sys/dev/dpt/dpt_scsi.c Sun Feb 26 16:05:20 2012 (r232185) @@ -1034,7 +1034,6 @@ dpt_action(struct cam_sim *sim, union cc spi->valid = CTS_SPI_VALID_SYNC_RATE | CTS_SPI_VALID_SYNC_OFFSET - | CTS_SPI_VALID_SYNC_RATE | CTS_SPI_VALID_BUS_WIDTH | CTS_SPI_VALID_DISC; scsi->valid = CTS_SCSI_VALID_TQ; From owner-svn-src-all@FreeBSD.ORG Sun Feb 26 16:30:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39A97106566B; Sun, 26 Feb 2012 16:30:40 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 269C58FC14; Sun, 26 Feb 2012 16:30:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1QGUebZ073542; Sun, 26 Feb 2012 16:30:40 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1QGUdIZ073536; Sun, 26 Feb 2012 16:30:39 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201202261630.q1QGUdIZ073536@svn.freebsd.org> From: Martin Matuska Date: Sun, 26 Feb 2012 16:30: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: r232186 - in head: cddl/contrib/opensolaris/cmd/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/kern sys/sys usr.sbin/jail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Feb 2012 16:30:40 -0000 Author: mm Date: Sun Feb 26 16:30:39 2012 New Revision: 232186 URL: http://svn.freebsd.org/changeset/base/232186 Log: Analogous to r232059, add a parameter for the ZFS file system: allow.mount.zfs: allow mounting the zfs filesystem inside a jail This way the permssions for mounting all current VFCF_JAIL filesystems inside a jail are controlled wia allow.mount.* jail parameters. Update sysctl descriptions. Update jail(8) and zfs(8) manpages. TODO: document the connection of allow.mount.* and VFCF_JAIL for kernel developers MFC after: 10 days Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c head/sys/kern/kern_jail.c head/sys/sys/jail.h head/usr.sbin/jail/jail.8 Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sun Feb 26 16:05:20 2012 (r232185) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Sun Feb 26 16:30:39 2012 (r232186) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 26, 2011 +.Dd February 26, 2012 .Dt ZFS 8 .Os .Sh NAME @@ -413,9 +413,15 @@ subcommand. You cannot attach a dataset same dataset to another jails. To allow management of the dataset from within a jail, the .Sy jailed -property has to be set. The +property has to be set and the jail needs access to the +.Pa /dev/zfs +device. The .Sy quota -property cannot be changed from within a jail. +property cannot be changed from within a jail. See +.Xr jail 8 +for information on how to allow mounting +.Tn ZFS +datasets from within a jail. .Pp .No A Tn ZFS dataset can be detached from a jail using the @@ -2715,13 +2721,12 @@ to the jail identified by JID From now on this file system tree can be managed from within a jail if the .Sy jailed property has been set. To use this functionality, the jail needs the -.Va enforce_statfs -parameter set to -.Sy 0 -and the .Va allow.mount -parameter set to -.Sy 1 . +and +.Va allow.mount.zfs +parameters set to 1 and the +.Va enforce_statfs +parameter set to a value lower than 2. .Pp See .Xr jail 8 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun Feb 26 16:05:20 2012 (r232185) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Sun Feb 26 16:30:39 2012 (r232186) @@ -60,6 +60,7 @@ #include #include #include +#include #include "zfs_comutil.h" struct mtx zfs_debug_mtx; @@ -1533,6 +1534,9 @@ zfs_mount(vfs_t *vfsp) int error = 0; int canwrite; + if (!prison_allow(td->td_ucred, PR_ALLOW_MOUNT_ZFS)) + return (EPERM); + if (vfs_getopt(vfsp->mnt_optnew, "from", (void **)&osname, NULL)) return (EINVAL); Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Sun Feb 26 16:05:20 2012 (r232185) +++ head/sys/kern/kern_jail.c Sun Feb 26 16:30:39 2012 (r232186) @@ -203,6 +203,7 @@ static char *pr_allow_names[] = { "allow.socket_af", "allow.mount.devfs", "allow.mount.nullfs", + "allow.mount.zfs", }; const size_t pr_allow_names_size = sizeof(pr_allow_names); @@ -216,6 +217,7 @@ static char *pr_allow_nonames[] = { "allow.nosocket_af", "allow.mount.nodevfs", "allow.mount.nonullfs", + "allow.mount.nozfs", }; const size_t pr_allow_nonames_size = sizeof(pr_allow_nonames); @@ -4199,11 +4201,15 @@ SYSCTL_PROC(_security_jail, OID_AUTO, mo SYSCTL_PROC(_security_jail, OID_AUTO, mount_devfs_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_MOUNT_DEVFS, sysctl_jail_default_allow, "I", - "Processes in jail can mount/unmount the devfs file system"); + "Processes in jail can mount the devfs file system"); SYSCTL_PROC(_security_jail, OID_AUTO, mount_nullfs_allowed, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, PR_ALLOW_MOUNT_NULLFS, sysctl_jail_default_allow, "I", - "Processes in jail can mount/unmount the nullfs file system"); + "Processes in jail can mount the nullfs file system"); +SYSCTL_PROC(_security_jail, OID_AUTO, mount_zfs_allowed, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, + NULL, PR_ALLOW_MOUNT_ZFS, sysctl_jail_default_allow, "I", + "Processes in jail can mount the zfs file system"); static int sysctl_jail_default_level(SYSCTL_HANDLER_ARGS) @@ -4347,9 +4353,11 @@ SYSCTL_JAIL_PARAM_SUBNODE(allow, mount, SYSCTL_JAIL_PARAM(_allow_mount, , CTLTYPE_INT | CTLFLAG_RW, "B", "Jail may mount/unmount jail-friendly file systems in general"); SYSCTL_JAIL_PARAM(_allow_mount, devfs, CTLTYPE_INT | CTLFLAG_RW, - "B", "Jail may mount/unmount the devfs file system"); + "B", "Jail may mount the devfs file system"); SYSCTL_JAIL_PARAM(_allow_mount, nullfs, CTLTYPE_INT | CTLFLAG_RW, - "B", "Jail may mount/unmount the nullfs file system"); + "B", "Jail may mount the nullfs file system"); +SYSCTL_JAIL_PARAM(_allow_mount, zfs, CTLTYPE_INT | CTLFLAG_RW, + "B", "Jail may mount the zfs file system"); void prison_racct_foreach(void (*callback)(struct racct *racct, Modified: head/sys/sys/jail.h ============================================================================== --- head/sys/sys/jail.h Sun Feb 26 16:05:20 2012 (r232185) +++ head/sys/sys/jail.h Sun Feb 26 16:30:39 2012 (r232186) @@ -225,7 +225,8 @@ struct prison_racct { #define PR_ALLOW_SOCKET_AF 0x0040 #define PR_ALLOW_MOUNT_DEVFS 0x0080 #define PR_ALLOW_MOUNT_NULLFS 0x0100 -#define PR_ALLOW_ALL 0x01ff +#define PR_ALLOW_MOUNT_ZFS 0x0200 +#define PR_ALLOW_ALL 0x03ff /* * OSD methods Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Sun Feb 26 16:05:20 2012 (r232185) +++ head/usr.sbin/jail/jail.8 Sun Feb 26 16:30:39 2012 (r232186) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 23, 2012 +.Dd February 26, 2012 .Dt JAIL 8 .Os .Sh NAME @@ -427,6 +427,17 @@ This permission is effective only togeth and if .Va enforce_statfs is set to a value lower than 2. +.It Va allow.mount.zfs +privileged users inside the jail will be able to mount and unmount the +ZFS file system. +This permission is effective only together with +.Va allow.mount +and if +.Va enforce_statfs +is set to a value lower than 2. See +.Xr zfs 8 +for information on how to configure the ZFS filesystem to operate from +within a jail. .It Va allow.quotas The prison root may administer quotas on the jail's filesystem(s). This includes filesystems that the jail may share with other jails or From owner-svn-src-all@FreeBSD.ORG Sun Feb 26 17:39:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE200106566C; Sun, 26 Feb 2012 17:39:47 +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 5EE7F8FC13; Sun, 26 Feb 2012 17:39:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1QHdlgB076015; Sun, 26 Feb 2012 17:39:47 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1QHdluw076013; Sun, 26 Feb 2012 17:39:47 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201202261739.q1QHdluw076013@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 26 Feb 2012 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: r232187 - head/usr.bin/xargs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Feb 2012 17:39:47 -0000 Author: jilles Date: Sun Feb 26 17:39:46 2012 New Revision: 232187 URL: http://svn.freebsd.org/changeset/base/232187 Log: xargs: Fix comma splice in error message. Reported by: bde Modified: head/usr.bin/xargs/xargs.c Modified: head/usr.bin/xargs/xargs.c ============================================================================== --- head/usr.bin/xargs/xargs.c Sun Feb 26 16:30:39 2012 (r232186) +++ head/usr.bin/xargs/xargs.c Sun Feb 26 17:39:46 2012 (r232187) @@ -609,10 +609,10 @@ waitchildren(const char *name, int waita * exit 1-125. */ if (WIFSIGNALED(status)) - errx(1, "%s: terminated with signal %d, aborting", + errx(1, "%s: terminated with signal %d; aborting", name, WTERMSIG(status)); if (WEXITSTATUS(status) == 255) - errx(1, "%s: exited with status 255, aborting", name); + errx(1, "%s: exited with status 255; aborting", name); if (WEXITSTATUS(status)) rval = 1; } From owner-svn-src-all@FreeBSD.ORG Sun Feb 26 19:10:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B42D1065670; Sun, 26 Feb 2012 19:10:14 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8682C8FC0C; Sun, 26 Feb 2012 19:10:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1QJAE5x079072; Sun, 26 Feb 2012 19:10:14 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1QJAEsj079070; Sun, 26 Feb 2012 19:10:14 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201202261910.q1QJAEsj079070@svn.freebsd.org> From: Alan Cox Date: Sun, 26 Feb 2012 19:10: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: r232192 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2012 19:10:14 -0000 Author: alc Date: Sun Feb 26 19:10:14 2012 New Revision: 232192 URL: http://svn.freebsd.org/changeset/base/232192 Log: Fix typo. MFC after: 1 week Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Sun Feb 26 19:05:17 2012 (r232191) +++ head/sys/kern/vfs_bio.c Sun Feb 26 19:10:14 2012 (r232192) @@ -3062,7 +3062,7 @@ allocbuf(struct buf *bp, int size) /* * We must allocate system pages since blocking - * here could intefere with paging I/O, no + * here could interfere with paging I/O, no * matter which process we are. * * We can only test VPO_BUSY here. Blocking on From owner-svn-src-all@FreeBSD.ORG Sun Feb 26 20:56:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E43E6106564A; Sun, 26 Feb 2012 20:56:49 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF3F58FC08; Sun, 26 Feb 2012 20:56:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1QKunKk082816; Sun, 26 Feb 2012 20:56:49 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1QKunNg082814; Sun, 26 Feb 2012 20:56:49 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <201202262056.q1QKunNg082814@svn.freebsd.org> From: Poul-Henning Kamp Date: Sun, 26 Feb 2012 20:56: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: r232197 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2012 20:56:50 -0000 Author: phk Date: Sun Feb 26 20:56:49 2012 New Revision: 232197 URL: http://svn.freebsd.org/changeset/base/232197 Log: Also call the low-level driver if ->c_iflag & (IXON|IXOFF|IXANY) changes. Uftdi(4) examines (c_iflag & (IXON|IXOFF)) to control hw XON-XOFF support. This is obviously no good, if changes to those bits are not communicated down the stack. Modified: head/sys/kern/tty.c Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Sun Feb 26 20:30:21 2012 (r232196) +++ head/sys/kern/tty.c Sun Feb 26 20:56:49 2012 (r232197) @@ -1481,6 +1481,8 @@ tty_generic_ioctl(struct tty *tp, u_long */ if ((t->c_cflag & CIGNORE) == 0 && (tp->t_termios.c_cflag != t->c_cflag || + ((tp->t_termios.c_iflag ^ t->c_iflag) & + (IXON|IXOFF|IXANY)) || tp->t_termios.c_ispeed != t->c_ispeed || tp->t_termios.c_ospeed != t->c_ospeed)) { error = ttydevsw_param(tp, t); From owner-svn-src-all@FreeBSD.ORG Sun Feb 26 21:02:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6EB8D1065670; Sun, 26 Feb 2012 21:02:32 +0000 (UTC) (envelope-from giovanni.trematerra@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 080F88FC0A; Sun, 26 Feb 2012 21:02:31 +0000 (UTC) Received: by qao25 with SMTP id 25so1146208qao.13 for ; Sun, 26 Feb 2012 13:02:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=7kg67PPUZ1D0T2GkCJKRMqBsHeIByyjCoQpjKuuBX1g=; b=OwcGCpTvewKyUDAnwUzIl1vWaJl+1GF36/u+NvCjieSn10Sb161GeQv3bqJsHMui9X o/GYAzSQg8fmWBP6QanSDWpx+1IC2R7c4EOIacEfM2Yprsu4ysMbmAcyQ96lkQARimKE /M4EoQa9j3VZ0Zkk7p7nPU7tdpAhdcsU/pGE0= MIME-Version: 1.0 Received: by 10.224.174.72 with SMTP id s8mr7031919qaz.67.1330288684611; Sun, 26 Feb 2012 12:38:04 -0800 (PST) Received: by 10.229.82.7 with HTTP; Sun, 26 Feb 2012 12:38:04 -0800 (PST) In-Reply-To: <201202261514.q1QFET0v070810@svn.freebsd.org> References: <201202261514.q1QFET0v070810@svn.freebsd.org> Date: Sun, 26 Feb 2012 21:38:04 +0100 Message-ID: From: Giovanni Trematerra To: Jilles Tjoelker 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: r232183 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2012 21:02:32 -0000 On Sun, Feb 26, 2012 at 4:14 PM, Jilles Tjoelker wrote= : > Author: jilles > Date: Sun Feb 26 15:14:29 2012 > New Revision: 232183 > URL: http://svn.freebsd.org/changeset/base/232183 > > Log: > =A0Fix fchmod() and fchown() on fifos. > > =A0The new fifo implementation in r232055 broke fchmod() and fchown() on = fifos. > =A0Postfix needs this. > > =A0Submitted by: gianni > =A0Reported by: =A0dougb > > Modified: > =A0head/sys/kern/sys_pipe.c > Thank you. And just for the record: Pointy hat to: gianni From owner-svn-src-all@FreeBSD.ORG Sun Feb 26 21:12:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE75C106566B; Sun, 26 Feb 2012 21:12:51 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id 46BDB8FC08; Sun, 26 Feb 2012 21:12:51 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id CF8522A28CC5; Sun, 26 Feb 2012 22:12:48 +0100 (CET) Date: Sun, 26 Feb 2012 22:12:48 +0100 From: Ed Schouten To: Jilles Tjoelker Message-ID: <20120226211248.GO32748@hoeg.nl> References: <201202261514.q1QFET0v070810@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="muT+E17Lr9urPYYJ" Content-Disposition: inline In-Reply-To: <201202261514.q1QFET0v070810@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232183 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2012 21:12:51 -0000 --muT+E17Lr9urPYYJ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Jilles, * Jilles Tjoelker , 20120226 16:14: > +static int > +pipe_chmod(fp, mode, active_cred, td) > + struct file *fp; > + mode_t mode; > + struct ucred *active_cred; > + struct thread *td; > +{ > + struct pipe *cpipe; > + int error; > + > + cpipe =3D fp->f_data; > + if (cpipe->pipe_state & PIPE_NAMED) > + error =3D vn_chmod(fp, mode, active_cred, td); > + else > + error =3D invfo_chmod(fp, mode, active_cred, td); > + return (error); > +} Maybe this would be a useless optimisation, but wouldn't it be better to just use two separate struct fileops here? --=20 Ed Schouten WWW: http://80386.nl/ --muT+E17Lr9urPYYJ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iQIcBAEBAgAGBQJPSqBQAAoJEG5e2P40kaK7d6wP/A5/zifopAwbfdOAYtZxltsR 71A7spratlXH4d+hTpw8T2UERHZ/f12FieBTodAVgzr3lJ75P+5l+gR3gM3MWhIG Zgz712HcCdkFyo6JnFx2PY4HeyRGvErBrvJ3vCbAXN1quwSynShvwOvFhP+45yAK FjsV2KQmQ+1sNQdH2oftP1QpcX/dAjU2olRDyP+8QGNmSK7w2IAKJkzuV7FieMc2 rtj36QyElaNGJJCOGpJvfgyaNI5ly0U1s3P2G32zXLLzor0/TuWc5VAMEHZquTcu TGKMvTx/0XzanAv4Xyot9qaslaWtBNSOvzzpCUu7mbMCXawE14HPp7kBQ3LnQbxH VUTtGtD+Voo1skc4xtW1ad42dHgH4k8+f3mw0pzYtibiNxn3SwDmW8mi2j0EHaiE MeJuinX4u7G6IsA5dTvEHuzQV/Nc60RfgmJRMpPNdjtu6z0wGyi8wN8MGgDsHSq7 O/GaDkMsN2J96Fu/ejYFQGKlJIy8kPZ3FPaE5IgUp2L5+VCFPhO/B//xHW7p+flF H7PILa7RQtw2HC6zX8vquS8KpBJJeigmqpIH0yb4RnNeB3Exh1Q5uXVhshJBm9OD ytK7jycShznMSE2ySMwCfwteXRuzVXt1wpbim7CYA2NNGii09h34IPp3+fKSwNbN YLobmbuadEF3XMRVvZq8 =FLIB -----END PGP SIGNATURE----- --muT+E17Lr9urPYYJ-- From owner-svn-src-all@FreeBSD.ORG Sun Feb 26 21:24:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70AEA106566B; Sun, 26 Feb 2012 21:24:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 420F68FC08; Sun, 26 Feb 2012 21:24:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1QLO3Vk083687; Sun, 26 Feb 2012 21:24:03 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1QLO3O8083685; Sun, 26 Feb 2012 21:24:03 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201202262124.q1QLO3O8083685@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 26 Feb 2012 21:24:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232198 - stable/9/sys/dev/sound/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: Sun, 26 Feb 2012 21:24:03 -0000 Author: hselasky Date: Sun Feb 26 21:24:02 2012 New Revision: 232198 URL: http://svn.freebsd.org/changeset/base/232198 Log: MFC r232039: Avoid creating PCM devices for MIDI only adapters. Modified: stable/9/sys/dev/sound/usb/uaudio.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/9/sys/dev/sound/usb/uaudio.c Sun Feb 26 20:56:49 2012 (r232197) +++ stable/9/sys/dev/sound/usb/uaudio.c Sun Feb 26 21:24:02 2012 (r232198) @@ -626,21 +626,21 @@ uaudio_attach(device_t dev) sc->sc_mixer_count); if (sc->sc_play_chan.valid) { - device_printf(dev, "Play: %d Hz, %d ch, %s format\n", + device_printf(dev, "Play: %d Hz, %d ch, %s format.\n", sc->sc_play_chan.sample_rate, sc->sc_play_chan.p_asf1d->bNrChannels, sc->sc_play_chan.p_fmt->description); } else { - device_printf(dev, "No playback!\n"); + device_printf(dev, "No playback.\n"); } if (sc->sc_rec_chan.valid) { - device_printf(dev, "Record: %d Hz, %d ch, %s format\n", + device_printf(dev, "Record: %d Hz, %d ch, %s format.\n", sc->sc_rec_chan.sample_rate, sc->sc_rec_chan.p_asf1d->bNrChannels, sc->sc_rec_chan.p_fmt->description); } else { - device_printf(dev, "No recording!\n"); + device_printf(dev, "No recording.\n"); } if (sc->sc_midi_chan.valid) { @@ -648,9 +648,9 @@ uaudio_attach(device_t dev) if (umidi_probe(dev)) { goto detach; } - device_printf(dev, "MIDI sequencer\n"); + device_printf(dev, "MIDI sequencer.\n"); } else { - device_printf(dev, "No midi sequencer\n"); + device_printf(dev, "No midi sequencer.\n"); } DPRINTF("doing child attach\n"); @@ -659,13 +659,21 @@ uaudio_attach(device_t dev) sc->sc_sndcard_func.func = SCF_PCM; - child = device_add_child(dev, "pcm", -1); + /* + * Only attach a PCM device if we have a playback, recording + * or mixer device present: + */ + if (sc->sc_play_chan.valid || + sc->sc_rec_chan.valid || + sc->sc_mix_info) { + child = device_add_child(dev, "pcm", -1); - if (child == NULL) { - DPRINTF("out of memory\n"); - goto detach; + if (child == NULL) { + DPRINTF("out of memory\n"); + goto detach; + } + device_set_ivars(child, &sc->sc_sndcard_func); } - device_set_ivars(child, &sc->sc_sndcard_func); if (bus_generic_attach(dev)) { DPRINTF("child attach failed\n"); From owner-svn-src-all@FreeBSD.ORG Sun Feb 26 21:24:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0C221065849; Sun, 26 Feb 2012 21:24:27 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ACC498FC17; Sun, 26 Feb 2012 21:24:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1QLORPl083738; Sun, 26 Feb 2012 21:24:27 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1QLORF6083736; Sun, 26 Feb 2012 21:24:27 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <201202262124.q1QLORF6083736@svn.freebsd.org> From: Alexander Kabaev Date: Sun, 26 Feb 2012 21:24:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232199 - head/sys/x86/cpufreq X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Feb 2012 21:24:27 -0000 Author: kan Date: Sun Feb 26 21:24:27 2012 New Revision: 232199 URL: http://svn.freebsd.org/changeset/base/232199 Log: Fix apparent logic reversal in setting the 'auto_mode' flag. MFC after: 2 weeks Modified: head/sys/x86/cpufreq/p4tcc.c Modified: head/sys/x86/cpufreq/p4tcc.c ============================================================================== --- head/sys/x86/cpufreq/p4tcc.c Sun Feb 26 21:24:02 2012 (r232198) +++ head/sys/x86/cpufreq/p4tcc.c Sun Feb 26 21:24:27 2012 (r232199) @@ -276,9 +276,9 @@ p4tcc_set(device_t dev, const struct cf_ * what the current mode. */ if (msr & TCC_ENABLE_ONDEMAND) - sc->auto_mode = TRUE; - else sc->auto_mode = FALSE; + else + sc->auto_mode = TRUE; return (0); } From owner-svn-src-all@FreeBSD.ORG Sun Feb 26 22:09:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FEED106566B; Sun, 26 Feb 2012 22:09: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 30F318FC08; Sun, 26 Feb 2012 22:09:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1QM9MqB085092; Sun, 26 Feb 2012 22:09:22 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1QM9LdP085089; Sun, 26 Feb 2012 22:09:21 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201202262209.q1QM9LdP085089@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 26 Feb 2012 22:09: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: r232200 - in head/usr.sbin/bsdinstall: distextract distfetch X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Feb 2012 22:09:22 -0000 Author: nwhitehorn Date: Sun Feb 26 22:09:21 2012 New Revision: 232200 URL: http://svn.freebsd.org/changeset/base/232200 Log: Fix segfault if distfetch and distextract binaries are run standalone without the DISTRIBUTIONS environment variable set. PR: bin/165492 Submitted by: Fernando Apesteguia MFC after: 4 days Modified: head/usr.sbin/bsdinstall/distextract/distextract.c head/usr.sbin/bsdinstall/distfetch/distfetch.c Modified: head/usr.sbin/bsdinstall/distextract/distextract.c ============================================================================== --- head/usr.sbin/bsdinstall/distextract/distextract.c Sun Feb 26 21:24:27 2012 (r232199) +++ head/usr.sbin/bsdinstall/distextract/distextract.c Sun Feb 26 22:09:21 2012 (r232200) @@ -38,9 +38,16 @@ static int extract_files(int nfiles, con int main(void) { - char *diststring = strdup(getenv("DISTRIBUTIONS")); + char *diststring; const char **dists; int i, retval, ndists = 0; + + if (getenv("DISTRIBUTIONS") == NULL) { + fprintf(stderr, "DISTRIBUTIONS variable is not set\n"); + return (1); + } + + diststring = strdup(getenv("DISTRIBUTIONS")); for (i = 0; diststring[i] != 0; i++) if (isspace(diststring[i]) && !isspace(diststring[i+1])) ndists++; Modified: head/usr.sbin/bsdinstall/distfetch/distfetch.c ============================================================================== --- head/usr.sbin/bsdinstall/distfetch/distfetch.c Sun Feb 26 21:24:27 2012 (r232199) +++ head/usr.sbin/bsdinstall/distfetch/distfetch.c Sun Feb 26 22:09:21 2012 (r232200) @@ -37,9 +37,16 @@ static int fetch_files(int nfiles, char int main(void) { - char *diststring = strdup(getenv("DISTRIBUTIONS")); + char *diststring; char **urls; int i, nfetched, ndists = 0; + + if (getenv("DISTRIBUTIONS") == NULL) { + fprintf(stderr, "DISTRIBUTIONS variable is not set\n"); + return (1); + } + + diststring = strdup(getenv("DISTRIBUTIONS")); for (i = 0; diststring[i] != 0; i++) if (isspace(diststring[i]) && !isspace(diststring[i+1])) ndists++; From owner-svn-src-all@FreeBSD.ORG Sun Feb 26 22:28:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD12D106564A; Sun, 26 Feb 2012 22:28:44 +0000 (UTC) (envelope-from giovanni.trematerra@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 230A38FC08; Sun, 26 Feb 2012 22:28:43 +0000 (UTC) Received: by qao25 with SMTP id 25so1171098qao.13 for ; Sun, 26 Feb 2012 14:28:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=W9/HjDIOPku7/ONd5W9FGotIXGM51et9/h277uL/0QU=; b=I9KwvxxJoDi5+sX/DBxtQf/lODrF6eK26UpQqJwd9C4gqvTHxu8RlBQTQ8WVZtg1/T V4Z+w472X0+upS+fGnIyRKs4foUR3VP1cIY+DnbHIVwCsRDg+yCj+ldz1ZSc7bzMnT7l bNno0QcKLwH1T9t3W0kzmkKthdHUb0FXqoSDc= MIME-Version: 1.0 Received: by 10.224.195.135 with SMTP id ec7mr7504046qab.54.1330295322591; Sun, 26 Feb 2012 14:28:42 -0800 (PST) Received: by 10.229.82.7 with HTTP; Sun, 26 Feb 2012 14:28:42 -0800 (PST) In-Reply-To: <20120226211248.GO32748@hoeg.nl> References: <201202261514.q1QFET0v070810@svn.freebsd.org> <20120226211248.GO32748@hoeg.nl> Date: Sun, 26 Feb 2012 23:28:42 +0100 Message-ID: From: Giovanni Trematerra To: Ed Schouten Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Jilles Tjoelker , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232183 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2012 22:28:44 -0000 On Sun, Feb 26, 2012 at 10:12 PM, Ed Schouten wrote: > Hi Jilles, > > * Jilles Tjoelker , 20120226 16:14: >> +static int >> +pipe_chmod(fp, mode, active_cred, td) >> + =A0 =A0 struct file *fp; >> + =A0 =A0 mode_t mode; >> + =A0 =A0 struct ucred *active_cred; >> + =A0 =A0 struct thread *td; >> +{ >> + =A0 =A0 struct pipe *cpipe; >> + =A0 =A0 int error; >> + >> + =A0 =A0 cpipe =3D fp->f_data; >> + =A0 =A0 if (cpipe->pipe_state & PIPE_NAMED) >> + =A0 =A0 =A0 =A0 =A0 =A0 error =3D vn_chmod(fp, mode, active_cred, td); >> + =A0 =A0 else >> + =A0 =A0 =A0 =A0 =A0 =A0 error =3D invfo_chmod(fp, mode, active_cred, t= d); >> + =A0 =A0 return (error); >> +} > > Maybe this would be a useless optimisation, but wouldn't it be better to > just use two separate struct fileops here? > I don't think the problem here is related to performance. it might be a problem of readability. I prefer to use one fileops for pipes and fifos just to remark that fifos are actual pipes. If others think that would be better to have two separated fileops, for readability, I'm not against it. -- Gianni From owner-svn-src-all@FreeBSD.ORG Sun Feb 26 23:06:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9D32106566C; Sun, 26 Feb 2012 23:06:30 +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 C4C528FC0C; Sun, 26 Feb 2012 23:06:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1QN6Upc086992; Sun, 26 Feb 2012 23:06:30 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1QN6UiM086990; Sun, 26 Feb 2012 23:06:30 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201202262306.q1QN6UiM086990@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 26 Feb 2012 23:06: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: r232201 - head/usr.bin/xargs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Feb 2012 23:06:30 -0000 Author: jilles Date: Sun Feb 26 23:06:30 2012 New Revision: 232201 URL: http://svn.freebsd.org/changeset/base/232201 Log: xargs: Remove an unclear comment that only tried to repeat what the code did Reported by: bde Modified: head/usr.bin/xargs/xargs.c Modified: head/usr.bin/xargs/xargs.c ============================================================================== --- head/usr.bin/xargs/xargs.c Sun Feb 26 22:09:21 2012 (r232200) +++ head/usr.bin/xargs/xargs.c Sun Feb 26 23:06:30 2012 (r232201) @@ -604,10 +604,6 @@ waitchildren(const char *name, int waita errno = childerr; err(errno == ENOENT ? 127 : 126, "%s", name); } - /* - * If utility signaled or exited with a value of 255, - * exit 1-125. - */ if (WIFSIGNALED(status)) errx(1, "%s: terminated with signal %d; aborting", name, WTERMSIG(status)); From owner-svn-src-all@FreeBSD.ORG Sun Feb 26 23:25:43 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F9AB106564A; Sun, 26 Feb 2012 23:25:43 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id 8FB638FC18; Sun, 26 Feb 2012 23:25:42 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 4EA0B1DD416; Mon, 27 Feb 2012 00:25:41 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id 1FBDD28470; Mon, 27 Feb 2012 00:25:41 +0100 (CET) Date: Mon, 27 Feb 2012 00:25:40 +0100 From: Jilles Tjoelker To: Bruce Evans Message-ID: <20120226232540.GA34962@stack.nl> References: <201202241235.q1OCZH2U059017@svn.freebsd.org> <20120225024051.C1150@besplex.bde.org> <20120224210141.GA3223@stack.nl> <20120225084319.P3207@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120225084319.P3207@besplex.bde.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r232108 - head/usr.bin/xargs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 26 Feb 2012 23:25:43 -0000 On Sat, Feb 25, 2012 at 09:10:04AM +1100, Bruce Evans wrote: > On Fri, 24 Feb 2012, Jilles Tjoelker wrote: > > > On Sat, Feb 25, 2012 at 04:27:35AM +1100, Bruce Evans wrote: > > ... > >> Utilities are quite broken near here too: > >> - under -current: > >> - utilities still don't support signals >= 32, but give better error > >> messages. > > > > kill(1) (both /bin/kill and the 9.x/10.x sh builtin) has passed > > arbitrary signal numbers to kill(2) for quite a while. > > Apparently I got confused by testing several versions. In -current, > the bugs are just that: > - bash-4.2 builtin kill doesn't understand signals >= 32, despite > supposedly being configured for FreeBSD > - bash-4.2 prints confusing termination messages which made me think > that /bin/kill didn't work: > - for signal 127, it prints "Stopped ..." > - for signal 126, it prints "Unknown signal: 126". I didn't notice > this was printed by bash(1) and not by kill(1). > A bug in builtin kill turned up: with kill(1), both bash and sh print > the termination message immediately, with builtin kill neither prints > it until a newline is entered. That's not a bug, but a normal race condition. With external kill, the kill process usually takes long enough to shut down and be waited for that the kill victim will have terminated too. With builtin kill, the shell proceeds very quickly and often the kill victim will not have terminated yet. > >> Neither WIFSTOPPED() nor WIFEXITED() are tested, so the result of the > >> misclassification is turning signal 127 into a normal exit with status > >> 0. A normal WIFSTOPPED() should not get here, else job control would > >> just break xargs, so the bug can probably be worked around by turning > >> WIFSTOPPED() into WIFSIGNALED() here, or just blindly using WTERMSIG() > >> != 0 to classify signals. > > I don't think xargs should work around that bug, particularly not by > > introducing unspecified behaviour (the value of WTERMSIG(x) when > > !WIFSIGNALED(x)). > OK. So it needs to be disallowed in the kernel. Hmm. The kernel allows 0 <= sig <= 128 (_SIG_MAXSIG). It also allows signals 33..64 which do not have a documented meaning. I wonder what will break if I change _SIG_MAXSIG to 126. This will disallow all operations on signals 127 and 128 and change the sigacts structure. Alternatively, the check in sys_kill() and friends could be tightened. -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Mon Feb 27 00:11:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0ABDB106566B; Mon, 27 Feb 2012 00:11:51 +0000 (UTC) (envelope-from pawel.worach@gmail.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id B25458FC0A; Mon, 27 Feb 2012 00:11:49 +0000 (UTC) Received: by lagz14 with SMTP id z14so6743553lag.13 for ; Sun, 26 Feb 2012 16:11:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=A+ofTZI8oAXq3PsVhpjghCbuTgQIYWbL8an2YdEUdt4=; b=hdBkswxMeY3uho88ASGr7Ofu0r3ONqNNpGDwvCRpZmcqn/P0RrqUMfMn0klNqasy0w alqbxFkzJT+jGsSPO+byJS0kasn6Et0qoDZrSYSCofa0erb0fK7oD24CX1xQIsaeXxZ4 tOpJJ5S6D7beNprxxr56Pc4XY9hNURbSmHbMI= Received: by 10.152.130.102 with SMTP id od6mr7845743lab.14.1330299970897; Sun, 26 Feb 2012 15:46:10 -0800 (PST) Received: from [172.16.0.199] (host-78-64-61-69.homerun.telia.com. [78.64.61.69]) by mx.google.com with ESMTPS id mj2sm11925996lab.2.2012.02.26.15.46.08 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 26 Feb 2012 15:46:09 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=iso-8859-1 From: Pawel Worach In-Reply-To: <4F476FEA.1090004@FreeBSD.org> Date: Mon, 27 Feb 2012 00:46:06 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201202232134.q1NLYEq5024067@svn.freebsd.org> <20120224093807.GA88853@freebsd.org> <4F476FEA.1090004@FreeBSD.org> To: Dimitry Andric X-Mailer: Apple Mail (2.1257) Cc: svn-src-head@freebsd.org, Alexander Best , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232074 - head/sys/cam/ctl X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 00:11:51 -0000 On Feb 24, 2012, at 12:09, Dimitry Andric wrote: > On 2012-02-24 10:38, Alexander Best wrote: >> is the clang version in base able to do complete universe builds for = i386 and >> amd64 without the need for NO_WERROR=3D and WERROR=3D now? >=20 > "universe" means all arches, and all kernel configs, so no. The = status > for head with clang is as follows: >=20 > - buildworld with default options, e.g. no WITH_XXX or WITHOUT_XXX > settings, will complete without any (fatal) warnings. > - buildkernel of the default GENERIC config still has one warning = left, > in sys/dev/mps/mps_sas.c. It should be simple to fix, but I'm > checking it with Ken first. > - The LINT kernel configs probably have many warnings left. I haven't > tested those extensively. >=20 > As soon as world & kernel compile without warnings, I'd like to have a > tinderbox that continually builds with clang. So head won't be > regressing any more. :) >=20 >=20 >> ps: are there any plans to add support for compiling kernel+userland = with clang >> tot? maybe this can be accomplished by doing something like >>=20 >> echo "WITH_CLANG_TOT=3Dyes" >> /etc/src.conf >=20 > I'm not working on this at the moment. Pawel Worach (CC'd) has a > buildbot setup that builds FreeBSD daily with clang ToT. Apparently > just a few patches are needed. You will find all the patches and hacks to build FreeBSD with llvm/clang = trunk here: http://llvm-amd64.freebsd.your.org/patches/ clang-*.diff contains the FreeBSD local changes, -fformat-extensions and = worldtmp prefix stuff. freebsd-*.diff contains the patches for FreeBSD to fix/disable -Werror = warnings found by clang trunk and needed hacks to the build infrastructure to use an out-of-tree = compiler. Just set CC and CXX to the *full path* of your custom version of clang. >> which will turn all -Wformat-invalid-specifier and = -Wformat-extra-args errors >> into warnings (because clang tot doesn't support = -fformat-extensions)? >=20 > It would be better to push our format extensions upstream, I think. > Though the option should probably be renamed to something else, e.g. > -ffreebsd-extensions, or such. --=20 Pawel From owner-svn-src-all@FreeBSD.ORG Mon Feb 27 01:48:48 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E229E106564A; Mon, 27 Feb 2012 01:48:48 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail15.syd.optusnet.com.au (mail15.syd.optusnet.com.au [211.29.132.196]) by mx1.freebsd.org (Postfix) with ESMTP id 6152E8FC0A; Mon, 27 Feb 2012 01:48:47 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail15.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q1R1mhds008571 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 27 Feb 2012 12:48:45 +1100 Date: Mon, 27 Feb 2012 12:48:43 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jilles Tjoelker In-Reply-To: <20120226232540.GA34962@stack.nl> Message-ID: <20120227123912.I2260@besplex.bde.org> References: <201202241235.q1OCZH2U059017@svn.freebsd.org> <20120225024051.C1150@besplex.bde.org> <20120224210141.GA3223@stack.nl> <20120225084319.P3207@besplex.bde.org> <20120226232540.GA34962@stack.nl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans Subject: Re: svn commit: r232108 - head/usr.bin/xargs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Feb 2012 01:48:49 -0000 On Mon, 27 Feb 2012, Jilles Tjoelker wrote: > On Sat, Feb 25, 2012 at 09:10:04AM +1100, Bruce Evans wrote: >> On Fri, 24 Feb 2012, Jilles Tjoelker wrote: >>> I don't think xargs should work around that bug, particularly not by >>> introducing unspecified behaviour (the value of WTERMSIG(x) when >>> !WIFSIGNALED(x)). > >> OK. So it needs to be disallowed in the kernel. > > Hmm. The kernel allows 0 <= sig <= 128 (_SIG_MAXSIG). It also allows > signals 33..64 which do not have a documented meaning. > > I wonder what will break if I change _SIG_MAXSIG to 126. This will > disallow all operations on signals 127 and 128 and change the sigacts > structure. Alternatively, the check in sys_kill() and friends could be > tightened. I forgot about the extra one. 128 gives slightly more brokenness than 127 -- shells are confused by it, and turn it into $? = 0. Was the old PR about #127 or #128 or both? I think nothing should be using these signals, so nothing should break if you change _SIG_MAXSIG to 126 and change the sigacts struct to use a harder-coded 128. Bruce From owner-svn-src-all@FreeBSD.ORG Mon Feb 27 05:49:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0C1D106566C; Mon, 27 Feb 2012 05:49:00 +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 B378B8FC12; Mon, 27 Feb 2012 05:49:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1R5n0Pm000115; Mon, 27 Feb 2012 05:49:00 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1R5n0gG000113; Mon, 27 Feb 2012 05:49:00 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201202270549.q1R5n0gG000113@svn.freebsd.org> From: Xin LI Date: Mon, 27 Feb 2012 05:49: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: r232202 - head/usr.sbin/cron/crontab X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 05:49:01 -0000 Author: delphij Date: Mon Feb 27 05:49:00 2012 New Revision: 232202 URL: http://svn.freebsd.org/changeset/base/232202 Log: Drop setuid status while doing file operations to prevent potential information leak. This changeset is intended to be a minimal one to make backports easier. Reviewed by: kevlo, remko MFC after: 1 week Modified: head/usr.sbin/cron/crontab/crontab.c Modified: head/usr.sbin/cron/crontab/crontab.c ============================================================================== --- head/usr.sbin/cron/crontab/crontab.c Sun Feb 26 23:06:30 2012 (r232201) +++ head/usr.sbin/cron/crontab/crontab.c Mon Feb 27 05:49:00 2012 (r232202) @@ -194,6 +194,17 @@ parse_args(argc, argv) } if (Option == opt_replace) { + /* relinquish the setuid status of the binary during + * the open, lest nonroot users read files they should + * not be able to read. we can't use access() here + * since there's a race condition. thanks go out to + * Arnt Gulbrandsen for spotting + * the race. + */ + + if (swap_uids() < OK) + err(ERROR_EXIT, "swapping uids"); + /* we have to open the file here because we're going to * chdir(2) into /var/cron before we get around to * reading the file. @@ -204,21 +215,11 @@ parse_args(argc, argv) !strcmp(resolved_path, SYSCRONTAB)) { err(ERROR_EXIT, SYSCRONTAB " must be edited manually"); } else { - /* relinquish the setuid status of the binary during - * the open, lest nonroot users read files they should - * not be able to read. we can't use access() here - * since there's a race condition. thanks go out to - * Arnt Gulbrandsen for spotting - * the race. - */ - - if (swap_uids() < OK) - err(ERROR_EXIT, "swapping uids"); if (!(NewCrontab = fopen(Filename, "r"))) err(ERROR_EXIT, "%s", Filename); - if (swap_uids_back() < OK) - err(ERROR_EXIT, "swapping uids back"); } + if (swap_uids_back() < OK) + err(ERROR_EXIT, "swapping uids back"); } Debug(DMISC, ("user=%s, file=%s, option=%s\n", @@ -363,11 +364,15 @@ edit_cmd() { goto fatal; } again: + if (swap_uids() < OK) + err(ERROR_EXIT, "swapping uids"); if (stat(Filename, &statbuf) < 0) { warn("stat"); fatal: unlink(Filename); exit(ERROR_EXIT); } + if (swap_uids_back() < OK) + err(ERROR_EXIT, "swapping uids back"); if (statbuf.st_dev != fsbuf.st_dev || statbuf.st_ino != fsbuf.st_ino) errx(ERROR_EXIT, "temp file must be edited in place"); if (MD5File(Filename, orig_md5) == NULL) { @@ -433,6 +438,8 @@ edit_cmd() { editor, WTERMSIG(waiter), WCOREDUMP(waiter) ?"" :"no "); goto fatal; } + if (swap_uids() < OK) + err(ERROR_EXIT, "swapping uids"); if (stat(Filename, &statbuf) < 0) { warn("stat"); goto fatal; @@ -443,6 +450,8 @@ edit_cmd() { warn("MD5"); goto fatal; } + if (swap_uids_back() < OK) + err(ERROR_EXIT, "swapping uids back"); if (strcmp(orig_md5, new_md5) == 0 && !syntax_error) { warnx("no changes made to crontab"); goto remove; From owner-svn-src-all@FreeBSD.ORG Mon Feb 27 08:29:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B424106566B; Mon, 27 Feb 2012 08:29:29 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 4F73F8FC0C; Mon, 27 Feb 2012 08:29:29 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id 9BFB5F5B; Mon, 27 Feb 2012 09:29:27 +0100 (CET) Date: Mon, 27 Feb 2012 09:28:11 +0100 From: Pawel Jakub Dawidek To: Mikolaj Golub Message-ID: <20120227082811.GC1363@garage.freebsd.pl> References: <201202261425.q1QEPm9g069102@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="kVXhAStRUZ/+rrGn" Content-Disposition: inline In-Reply-To: <201202261425.q1QEPm9g069102@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232181 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 08:29:29 -0000 --kVXhAStRUZ/+rrGn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 26, 2012 at 02:25:48PM +0000, Mikolaj Golub wrote: > Author: trociny > Date: Sun Feb 26 14:25:48 2012 > New Revision: 232181 > URL: http://svn.freebsd.org/changeset/base/232181 >=20 > Log: > Add sysctl to retrieve or set umask of another process. "set umask of another process"? This seems... weird. What's the purpose of this change? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --kVXhAStRUZ/+rrGn Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk9LPpsACgkQForvXbEpPzRd+gCg+B7iHkbc/4Yoe1qMWnaoHpf8 020AoLK5msskGDctIRSZzXeovGu+ZnQ1 =lYBl -----END PGP SIGNATURE----- --kVXhAStRUZ/+rrGn-- From owner-svn-src-all@FreeBSD.ORG Mon Feb 27 08:50:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF6DD1065670; Mon, 27 Feb 2012 08:50:05 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-ee0-f54.google.com (mail-ee0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id C97EB8FC15; Mon, 27 Feb 2012 08:50:04 +0000 (UTC) Received: by eekd17 with SMTP id d17so1291602eek.13 for ; Mon, 27 Feb 2012 00:50:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:organization:references:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=4Rv6zdW7iQPKmeOxGWIR/K3KpCm/9Hkx4+/eM/QPXpE=; b=w7aH4kzMpApmCcCD7Lo0asOKdyhv2Femc1iPejdsNrc6cqu7MbadCEQlKC8AmcVAwP iyIrkOC0qrw9fTDPFYjScEO2nJfWqwlwxnrvXwAcBsxhsW93Fa+gNYBBVm91PA5x8skJ 3W2rBTo8BIepMFtgiZTIEi9p3gCSrlKVm/1xo= Received: by 10.213.19.207 with SMTP id c15mr1412899ebb.67.1330332603731; Mon, 27 Feb 2012 00:50:03 -0800 (PST) Received: from localhost ([94.27.39.186]) by mx.google.com with ESMTPS id o49sm55647665eeb.7.2012.02.27.00.50.01 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 27 Feb 2012 00:50:02 -0800 (PST) From: Mikolaj Golub To: Pawel Jakub Dawidek Organization: TOA Ukraine References: <201202261425.q1QEPm9g069102@svn.freebsd.org> <20120227082811.GC1363@garage.freebsd.pl> Sender: Mikolaj Golub Date: Mon, 27 Feb 2012 10:49:59 +0200 In-Reply-To: <20120227082811.GC1363@garage.freebsd.pl> (Pawel Jakub Dawidek's message of "Mon, 27 Feb 2012 09:28:11 +0100") Message-ID: <864nucd5jc.fsf@in138.ua3> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (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, Konstantin Belousov Subject: Re: svn commit: r232181 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 08:50:06 -0000 On Mon, 27 Feb 2012 09:28:11 +0100 Pawel Jakub Dawidek wrote: PJD> On Sun, Feb 26, 2012 at 02:25:48PM +0000, Mikolaj Golub wrote: >> Author: trociny >> Date: Sun Feb 26 14:25:48 2012 >> New Revision: 232181 >> URL: http://svn.freebsd.org/changeset/base/232181 >> >> Log: >> Add sysctl to retrieve or set umask of another process. PJD> "set umask of another process"? This seems... weird. What's the purpose PJD> of this change? When we were discussing this with Kostik and Robert, and I asked if it could be useful to have the sysctl rw, Kostik described a real situation when he had had to change umask of another process: umask had not been set properly on an aplication start but it could not be restarted until the end of the day. Kostik was able to fix it using gdb but having an easier way looked useful. -- Mikolaj Golub From owner-svn-src-all@FreeBSD.ORG Mon Feb 27 08:55:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0ED561065672; Mon, 27 Feb 2012 08:55:33 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F2C758FC0A; Mon, 27 Feb 2012 08:55:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1R8tW2B007155; Mon, 27 Feb 2012 08:55:32 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1R8tWVD007153; Mon, 27 Feb 2012 08:55:32 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201202270855.q1R8tWVD007153@svn.freebsd.org> From: Kevin Lo Date: Mon, 27 Feb 2012 08: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: r232203 - head/sys/dev/sf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Feb 2012 08:55:33 -0000 Author: kevlo Date: Mon Feb 27 08:55:32 2012 New Revision: 232203 URL: http://svn.freebsd.org/changeset/base/232203 Log: Remove duplicate assignment of SF_IMR_RXDQ2_DMADONE bit Modified: head/sys/dev/sf/if_sfreg.h Modified: head/sys/dev/sf/if_sfreg.h ============================================================================== --- head/sys/dev/sf/if_sfreg.h Mon Feb 27 05:49:00 2012 (r232202) +++ head/sys/dev/sf/if_sfreg.h Mon Feb 27 08:55:32 2012 (r232203) @@ -352,7 +352,7 @@ #define SF_INTRS \ (SF_IMR_RXDQ2_NOBUFS|SF_IMR_RXDQ1_DMADONE|SF_IMR_RXDQ2_DMADONE| \ - SF_IMR_TX_DMADONE|SF_IMR_RXDQ1_NOBUFS|SF_IMR_RXDQ2_DMADONE| \ + SF_IMR_TX_DMADONE|SF_IMR_RXDQ1_NOBUFS| \ SF_IMR_NORMALINTR|SF_IMR_ABNORMALINTR|SF_IMR_TXCQ_NOBUFS| \ SF_IMR_RXCQ1_NOBUFS|SF_IMR_RXCQ2_NOBUFS|SF_IMR_STATSOFLOW| \ SF_IMR_TX_LOFIFO|SF_IMR_DMAERR|SF_IMR_RXGFP_NORESP| \ From owner-svn-src-all@FreeBSD.ORG Mon Feb 27 08:57:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7853E106566B; Mon, 27 Feb 2012 08:57:03 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 684A08FC1B; Mon, 27 Feb 2012 08:57:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1R8v3JH007241; Mon, 27 Feb 2012 08:57:03 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1R8v3jQ007239; Mon, 27 Feb 2012 08:57:03 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201202270857.q1R8v3jQ007239@svn.freebsd.org> From: Kevin Lo Date: Mon, 27 Feb 2012 08:57: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: r232204 - head/sys/dev/pcn X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Feb 2012 08:57:03 -0000 Author: kevlo Date: Mon Feb 27 08:57:02 2012 New Revision: 232204 URL: http://svn.freebsd.org/changeset/base/232204 Log: Fix logic error Modified: head/sys/dev/pcn/if_pcn.c Modified: head/sys/dev/pcn/if_pcn.c ============================================================================== --- head/sys/dev/pcn/if_pcn.c Mon Feb 27 08:55:32 2012 (r232203) +++ head/sys/dev/pcn/if_pcn.c Mon Feb 27 08:57:02 2012 (r232204) @@ -966,7 +966,7 @@ pcn_tick(xsc) mii_tick(mii); /* link just died */ - if (sc->pcn_link & !(mii->mii_media_status & IFM_ACTIVE)) + if (sc->pcn_link && !(mii->mii_media_status & IFM_ACTIVE)) sc->pcn_link = 0; /* link just came up, restart */ From owner-svn-src-all@FreeBSD.ORG Mon Feb 27 09:00:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF6FF1065672; Mon, 27 Feb 2012 09:00:54 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 8781D8FC17; Mon, 27 Feb 2012 09:00:54 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id 26A57F75; Mon, 27 Feb 2012 10:00:53 +0100 (CET) Date: Mon, 27 Feb 2012 09:59:37 +0100 From: Pawel Jakub Dawidek To: Mikolaj Golub Message-ID: <20120227085937.GD1363@garage.freebsd.pl> References: <201202261425.q1QEPm9g069102@svn.freebsd.org> <20120227082811.GC1363@garage.freebsd.pl> <864nucd5jc.fsf@in138.ua3> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="EY/WZ/HvNxOox07X" Content-Disposition: inline In-Reply-To: <864nucd5jc.fsf@in138.ua3> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov Subject: Re: svn commit: r232181 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 09:00:55 -0000 --EY/WZ/HvNxOox07X Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 27, 2012 at 10:49:59AM +0200, Mikolaj Golub wrote: >=20 > On Mon, 27 Feb 2012 09:28:11 +0100 Pawel Jakub Dawidek wrote: >=20 > PJD> On Sun, Feb 26, 2012 at 02:25:48PM +0000, Mikolaj Golub wrote: > >> Author: trociny > >> Date: Sun Feb 26 14:25:48 2012 > >> New Revision: 232181 > >> URL: http://svn.freebsd.org/changeset/base/232181 > >>=20 > >> Log: > >> Add sysctl to retrieve or set umask of another process. >=20 > PJD> "set umask of another process"? This seems... weird. What's the pur= pose > PJD> of this change? >=20 > When we were discussing this with Kostik and Robert, and I asked if it co= uld > be useful to have the sysctl rw, Kostik described a real situation when h= e had > had to change umask of another process: umask had not been set properly o= n an > aplication start but it could not be restarted until the end of the day. > Kostik was able to fix it using gdb but having an easier way looked usefu= l. As a debugging feature it might be useful, but I wonder if we don't open Pandora's box, as I can see the same arguments for being able to change process current working directory, its real/effective/saved uid/gid, its groups, etc. Application can get really confused by this. From what I see we require the process to have permission to debug the target process, which is fine, but wherever it is documented I'd like there be a warning this is for debug purposes and can confuse application. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --EY/WZ/HvNxOox07X Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk9LRfgACgkQForvXbEpPzRxAgCgj+2KdqWT9VW3M+W5eE02ldpU zkQAnjAykxiGlnkZjDXHZqRoT7JEL7Z6 =jAZN -----END PGP SIGNATURE----- --EY/WZ/HvNxOox07X-- From owner-svn-src-all@FreeBSD.ORG Mon Feb 27 09:30:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3843E106566B; Mon, 27 Feb 2012 09:30:00 +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 9DCCE8FC0C; Mon, 27 Feb 2012 09:29:58 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q1R9TpnX056319; Mon, 27 Feb 2012 11:29:51 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q1R9Tp0Q032962; Mon, 27 Feb 2012 11:29:51 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q1R9Tpv0032961; Mon, 27 Feb 2012 11:29:51 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 27 Feb 2012 11:29:51 +0200 From: Konstantin Belousov To: Mikolaj Golub Message-ID: <20120227092951.GB55074@deviant.kiev.zoral.com.ua> References: <201202261425.q1QEPm9g069102@svn.freebsd.org> <20120227082811.GC1363@garage.freebsd.pl> <864nucd5jc.fsf@in138.ua3> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Y7P0gPYVJgs55uY0" Content-Disposition: inline In-Reply-To: <864nucd5jc.fsf@in138.ua3> 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=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek Subject: Re: svn commit: r232181 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 09:30:00 -0000 --Y7P0gPYVJgs55uY0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 27, 2012 at 10:49:59AM +0200, Mikolaj Golub wrote: >=20 > On Mon, 27 Feb 2012 09:28:11 +0100 Pawel Jakub Dawidek wrote: >=20 > PJD> On Sun, Feb 26, 2012 at 02:25:48PM +0000, Mikolaj Golub wrote: > >> Author: trociny > >> Date: Sun Feb 26 14:25:48 2012 > >> New Revision: 232181 > >> URL: http://svn.freebsd.org/changeset/base/232181 > >>=20 > >> Log: > >> Add sysctl to retrieve or set umask of another process. >=20 > PJD> "set umask of another process"? This seems... weird. What's the pur= pose > PJD> of this change? >=20 > When we were discussing this with Kostik and Robert, and I asked if it co= uld > be useful to have the sysctl rw, Kostik described a real situation when h= e had > had to change umask of another process: umask had not been set properly o= n an > aplication start but it could not be restarted until the end of the day. > Kostik was able to fix it using gdb but having an easier way looked usefu= l. kgdb, not gdb. It is indeed possible to write a ptrace-based utility that inject a code payload that would change umask. Since this is very risky but indeed possib= le, having the straighforward kernel facility is justified. Patch puts the same restrictions on the caller as ptrace(). --Y7P0gPYVJgs55uY0 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk9LTQ8ACgkQC3+MBN1Mb4hLYwCgh2jXh1tdvHOXqfJCry0ZkJPM kE4AoMz88aIr1aT7ZpoevFODTzVhiw63 =KTy8 -----END PGP SIGNATURE----- --Y7P0gPYVJgs55uY0-- From owner-svn-src-all@FreeBSD.ORG Mon Feb 27 10:31:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F0361065675; Mon, 27 Feb 2012 10:31:55 +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 04A978FC1A; Mon, 27 Feb 2012 10:31:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1RAVsGD013197; Mon, 27 Feb 2012 10:31:54 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1RAVsjO013195; Mon, 27 Feb 2012 10:31:54 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201202271031.q1RAVsjO013195@svn.freebsd.org> From: Alexander Motin Date: Mon, 27 Feb 2012 10:31: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: r232207 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 10:31:55 -0000 Author: mav Date: Mon Feb 27 10:31:54 2012 New Revision: 232207 URL: http://svn.freebsd.org/changeset/base/232207 Log: Rework CPU load balancing in SCHED_ULE: - In sched_pickcpu() be more careful taking previous CPU on SMT systems. Do it only if all other logical CPUs of that physical one are idle to avoid extra resource sharing. - In sched_pickcpu() change general logic of CPU selection. First look for idle CPU, sharing last level cache with previously used one, skipping SMT CPU groups. If none found, search all CPUs for the least loaded one, where the thread with its priority can run now. If none found, search just for the least loaded CPU. - Make cpu_search() compare lowest/highest CPU load when comparing CPU groups with equal load. That allows to differentiate 1+1 and 2+0 loads. - Make cpu_search() to prefer specified (previous) CPU or group if load is equal. This improves cache affinity for more complicated topologies. - Randomize CPU selection if above factors are equal. Previous code tend to prefer CPUs with lower IDs, causing unneeded collisions. - Rework periodic balancer in sched_balance_group(). With cpu_search() more intelligent now, make balansing process flat, removing recursion over the topology tree. That fixes double swap problem and makes load distribution more even and predictable. All together this gives 10-15% performance improvement in many tests on CPUs with SMT, such as Core i7, for number of threads is less then number of logical CPUs. In some tests it also gives positive effect to systems without SMT. Reviewed by: jeff Tested by: flo, hackers@ MFC after: 1 month Sponsored by: iXsystems, Inc. Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Mon Feb 27 09:10:24 2012 (r232206) +++ head/sys/kern/sched_ule.c Mon Feb 27 10:31:54 2012 (r232207) @@ -258,7 +258,6 @@ struct cpu_group *cpu_top; /* CPU topol static int rebalance = 1; static int balance_interval = 128; /* Default set in sched_initticks(). */ static int affinity; -static int steal_htt = 1; static int steal_idle = 1; static int steal_thresh = 2; @@ -268,6 +267,7 @@ static int steal_thresh = 2; static struct tdq tdq_cpu[MAXCPU]; static struct tdq *balance_tdq; static int balance_ticks; +static DPCPU_DEFINE(uint32_t, randomval); #define TDQ_SELF() (&tdq_cpu[PCPU_GET(cpuid)]) #define TDQ_CPU(x) (&tdq_cpu[(x)]) @@ -553,9 +553,11 @@ tdq_setlowpri(struct tdq *tdq, struct th #ifdef SMP struct cpu_search { cpuset_t cs_mask; - u_int cs_load; - u_int cs_cpu; - int cs_limit; /* Min priority for low min load for high. */ + u_int cs_prefer; + int cs_pri; /* Min priority for low. */ + int cs_limit; /* Max load for low, min load for high. */ + int cs_cpu; + int cs_load; }; #define CPU_SEARCH_LOWEST 0x1 @@ -566,44 +568,14 @@ struct cpu_search { for ((cpu) = 0; (cpu) <= mp_maxid; (cpu)++) \ if (CPU_ISSET(cpu, &mask)) -static __inline int cpu_search(struct cpu_group *cg, struct cpu_search *low, +static __inline int cpu_search(const struct cpu_group *cg, struct cpu_search *low, struct cpu_search *high, const int match); -int cpu_search_lowest(struct cpu_group *cg, struct cpu_search *low); -int cpu_search_highest(struct cpu_group *cg, struct cpu_search *high); -int cpu_search_both(struct cpu_group *cg, struct cpu_search *low, +int cpu_search_lowest(const struct cpu_group *cg, struct cpu_search *low); +int cpu_search_highest(const struct cpu_group *cg, struct cpu_search *high); +int cpu_search_both(const struct cpu_group *cg, struct cpu_search *low, struct cpu_search *high); /* - * This routine compares according to the match argument and should be - * reduced in actual instantiations via constant propagation and dead code - * elimination. - */ -static __inline int -cpu_compare(int cpu, struct cpu_search *low, struct cpu_search *high, - const int match) -{ - struct tdq *tdq; - - tdq = TDQ_CPU(cpu); - if (match & CPU_SEARCH_LOWEST) - if (CPU_ISSET(cpu, &low->cs_mask) && - tdq->tdq_load < low->cs_load && - tdq->tdq_lowpri > low->cs_limit) { - low->cs_cpu = cpu; - low->cs_load = tdq->tdq_load; - } - if (match & CPU_SEARCH_HIGHEST) - if (CPU_ISSET(cpu, &high->cs_mask) && - tdq->tdq_load >= high->cs_limit && - tdq->tdq_load > high->cs_load && - tdq->tdq_transferable) { - high->cs_cpu = cpu; - high->cs_load = tdq->tdq_load; - } - return (tdq->tdq_load); -} - -/* * Search the tree of cpu_groups for the lowest or highest loaded cpu * according to the match argument. This routine actually compares the * load on all paths through the tree and finds the least loaded cpu on @@ -615,33 +587,42 @@ cpu_compare(int cpu, struct cpu_search * * also recursive to the depth of the tree. */ static __inline int -cpu_search(struct cpu_group *cg, struct cpu_search *low, +cpu_search(const struct cpu_group *cg, struct cpu_search *low, struct cpu_search *high, const int match) { - int total; + struct cpu_search lgroup; + struct cpu_search hgroup; + cpuset_t cpumask; + struct cpu_group *child; + struct tdq *tdq; + int cpu, i, hload, lload, load, total, rnd; total = 0; - if (cg->cg_children) { - struct cpu_search lgroup; - struct cpu_search hgroup; - struct cpu_group *child; - u_int lload; - int hload; - int load; - int i; - - lload = -1; + cpumask = cg->cg_mask; + if (match & CPU_SEARCH_LOWEST) { + lload = INT_MAX; + low->cs_load = INT_MAX; + lgroup = *low; + } + if (match & CPU_SEARCH_HIGHEST) { hload = -1; - for (i = 0; i < cg->cg_children; i++) { + high->cs_load = -1; + hgroup = *high; + } + + /* Iterate through the child CPU groups and then remaining CPUs. */ + for (i = 0, cpu = 0; i <= cg->cg_children; ) { + if (i >= cg->cg_children) { + while (cpu <= mp_maxid && !CPU_ISSET(cpu, &cpumask)) + cpu++; + if (cpu > mp_maxid) + break; + child = NULL; + } else child = &cg->cg_child[i]; - if (match & CPU_SEARCH_LOWEST) { - lgroup = *low; - lgroup.cs_load = -1; - } - if (match & CPU_SEARCH_HIGHEST) { - hgroup = *high; - lgroup.cs_load = 0; - } + + if (child) { /* Handle child CPU group. */ + CPU_NAND(&cpumask, &child->cg_mask); switch (match) { case CPU_SEARCH_LOWEST: load = cpu_search_lowest(child, &lgroup); @@ -653,23 +634,52 @@ cpu_search(struct cpu_group *cg, struct load = cpu_search_both(child, &lgroup, &hgroup); break; } - total += load; - if (match & CPU_SEARCH_LOWEST) - if (load < lload || low->cs_cpu == -1) { - *low = lgroup; - lload = load; + } else { /* Handle child CPU. */ + tdq = TDQ_CPU(cpu); + load = tdq->tdq_load * 256; + rnd = DPCPU_SET(randomval, + DPCPU_GET(randomval) * 69069 + 5) >> 26; + if (match & CPU_SEARCH_LOWEST) { + if (cpu == low->cs_prefer) + load -= 64; + /* If that CPU is allowed and get data. */ + if (CPU_ISSET(cpu, &lgroup.cs_mask) && + tdq->tdq_lowpri > lgroup.cs_pri && + tdq->tdq_load <= lgroup.cs_limit) { + lgroup.cs_cpu = cpu; + lgroup.cs_load = load - rnd; } - if (match & CPU_SEARCH_HIGHEST) - if (load > hload || high->cs_cpu == -1) { - hload = load; - *high = hgroup; + } + if (match & CPU_SEARCH_HIGHEST) + if (CPU_ISSET(cpu, &hgroup.cs_mask) && + tdq->tdq_load >= hgroup.cs_limit && + tdq->tdq_transferable) { + hgroup.cs_cpu = cpu; + hgroup.cs_load = load - rnd; } } - } else { - int cpu; + total += load; - CPUSET_FOREACH(cpu, cg->cg_mask) - total += cpu_compare(cpu, low, high, match); + /* We have info about child item. Compare it. */ + if (match & CPU_SEARCH_LOWEST) { + if ((load < lload) || + (load == lload && lgroup.cs_load < low->cs_load)) { + lload = load; + low->cs_cpu = lgroup.cs_cpu; + low->cs_load = lgroup.cs_load; + } + } + if (match & CPU_SEARCH_HIGHEST) + if ((load > hload) || + (load == hload && hgroup.cs_load > high->cs_load)) { + hload = load; + high->cs_cpu = hgroup.cs_cpu; + high->cs_load = hgroup.cs_load; + } + if (child) + i++; + else + cpu++; } return (total); } @@ -679,19 +689,19 @@ cpu_search(struct cpu_group *cg, struct * optimization. */ int -cpu_search_lowest(struct cpu_group *cg, struct cpu_search *low) +cpu_search_lowest(const struct cpu_group *cg, struct cpu_search *low) { return cpu_search(cg, low, NULL, CPU_SEARCH_LOWEST); } int -cpu_search_highest(struct cpu_group *cg, struct cpu_search *high) +cpu_search_highest(const struct cpu_group *cg, struct cpu_search *high) { return cpu_search(cg, NULL, high, CPU_SEARCH_HIGHEST); } int -cpu_search_both(struct cpu_group *cg, struct cpu_search *low, +cpu_search_both(const struct cpu_group *cg, struct cpu_search *low, struct cpu_search *high) { return cpu_search(cg, low, high, CPU_SEARCH_BOTH); @@ -703,14 +713,16 @@ cpu_search_both(struct cpu_group *cg, st * acceptable. */ static inline int -sched_lowest(struct cpu_group *cg, cpuset_t mask, int pri) +sched_lowest(const struct cpu_group *cg, cpuset_t mask, int pri, int maxload, + int prefer) { struct cpu_search low; low.cs_cpu = -1; - low.cs_load = -1; + low.cs_prefer = prefer; low.cs_mask = mask; - low.cs_limit = pri; + low.cs_pri = pri; + low.cs_limit = maxload; cpu_search_lowest(cg, &low); return low.cs_cpu; } @@ -719,12 +731,11 @@ sched_lowest(struct cpu_group *cg, cpuse * Find the cpu with the highest load via the highest loaded path. */ static inline int -sched_highest(struct cpu_group *cg, cpuset_t mask, int minload) +sched_highest(const struct cpu_group *cg, cpuset_t mask, int minload) { struct cpu_search high; high.cs_cpu = -1; - high.cs_load = 0; high.cs_mask = mask; high.cs_limit = minload; cpu_search_highest(cg, &high); @@ -735,17 +746,17 @@ sched_highest(struct cpu_group *cg, cpus * Simultaneously find the highest and lowest loaded cpu reachable via * cg. */ -static inline void -sched_both(struct cpu_group *cg, cpuset_t mask, int *lowcpu, int *highcpu) +static inline void +sched_both(const struct cpu_group *cg, cpuset_t mask, int *lowcpu, int *highcpu) { struct cpu_search high; struct cpu_search low; low.cs_cpu = -1; - low.cs_limit = -1; - low.cs_load = -1; + low.cs_prefer = -1; + low.cs_pri = -1; + low.cs_limit = INT_MAX; low.cs_mask = mask; - high.cs_load = 0; high.cs_cpu = -1; high.cs_limit = -1; high.cs_mask = mask; @@ -758,30 +769,45 @@ sched_both(struct cpu_group *cg, cpuset_ static void sched_balance_group(struct cpu_group *cg) { - cpuset_t mask; - int high; - int low; - int i; + cpuset_t hmask, lmask; + int high, low, anylow; - CPU_FILL(&mask); + CPU_FILL(&hmask); for (;;) { - sched_both(cg, mask, &low, &high); - if (low == high || low == -1 || high == -1) + high = sched_highest(cg, hmask, 1); + /* Stop if there is no more CPU with transferrable threads. */ + if (high == -1) break; - if (sched_balance_pair(TDQ_CPU(high), TDQ_CPU(low))) + CPU_CLR(high, &hmask); + CPU_COPY(&hmask, &lmask); + /* Stop if there is no more CPU left for low. */ + if (CPU_EMPTY(&lmask)) break; - /* - * If we failed to move any threads determine which cpu - * to kick out of the set and try again. - */ - if (TDQ_CPU(high)->tdq_transferable == 0) - CPU_CLR(high, &mask); - else - CPU_CLR(low, &mask); + anylow = 1; +nextlow: + low = sched_lowest(cg, lmask, -1, + TDQ_CPU(high)->tdq_load - 1, high); + /* Stop if we looked well and found no less loaded CPU. */ + if (anylow && low == -1) + break; + /* Go to next high if we found no less loaded CPU. */ + if (low == -1) + continue; + /* Transfer thread from high to low. */ + if (sched_balance_pair(TDQ_CPU(high), TDQ_CPU(low))) { + /* CPU that got thread can no longer be a donor. */ + CPU_CLR(low, &hmask); + } else { + /* + * If failed, then there is no threads on high + * that can run on this low. Drop low from low + * mask and look for different one. + */ + CPU_CLR(low, &lmask); + anylow = 0; + goto nextlow; + } } - - for (i = 0; i < cg->cg_children; i++) - sched_balance_group(&cg->cg_child[i]); } static void @@ -834,32 +860,17 @@ tdq_unlock_pair(struct tdq *one, struct static int sched_balance_pair(struct tdq *high, struct tdq *low) { - int transferable; - int high_load; - int low_load; int moved; - int move; int cpu; - int diff; - int i; tdq_lock_pair(high, low); - transferable = high->tdq_transferable; - high_load = high->tdq_load; - low_load = low->tdq_load; moved = 0; /* * Determine what the imbalance is and then adjust that to how many * threads we actually have to give up (transferable). */ - if (transferable != 0) { - diff = high_load - low_load; - move = diff / 2; - if (diff & 0x1) - move++; - move = min(move, transferable); - for (i = 0; i < move; i++) - moved += tdq_move(high, low); + if (high->tdq_transferable != 0 && high->tdq_load > low->tdq_load && + (moved = tdq_move(high, low)) > 0) { /* * In case the target isn't the current cpu IPI it to force a * reschedule with the new workload. @@ -1003,8 +1014,7 @@ runq_steal_from(struct runq *rq, int cpu { struct rqbits *rqb; struct rqhead *rqh; - struct thread *td; - int first; + struct thread *td, *first; int bit; int pri; int i; @@ -1012,7 +1022,7 @@ runq_steal_from(struct runq *rq, int cpu rqb = &rq->rq_status; bit = start & (RQB_BPW -1); pri = 0; - first = 0; + first = NULL; again: for (i = RQB_WORD(start); i < RQB_LEN; bit = 0, i++) { if (rqb->rqb_bits[i] == 0) @@ -1031,7 +1041,7 @@ again: if (first && THREAD_CAN_MIGRATE(td) && THREAD_CAN_SCHED(td, cpu)) return (td); - first = 1; + first = td; } } if (start != 0) { @@ -1039,6 +1049,9 @@ again: goto again; } + if (first && THREAD_CAN_MIGRATE(first) && + THREAD_CAN_SCHED(first, cpu)) + return (first); return (NULL); } @@ -1140,13 +1153,11 @@ SCHED_STAT_DEFINE(pickcpu_migration, "Se static int sched_pickcpu(struct thread *td, int flags) { - struct cpu_group *cg; + struct cpu_group *cg, *ccg; struct td_sched *ts; struct tdq *tdq; cpuset_t mask; - int self; - int pri; - int cpu; + int cpu, pri, self; self = PCPU_GET(cpuid); ts = td->td_sched; @@ -1161,45 +1172,70 @@ sched_pickcpu(struct thread *td, int fla * Prefer to run interrupt threads on the processors that generate * the interrupt. */ + pri = td->td_priority; if (td->td_priority <= PRI_MAX_ITHD && THREAD_CAN_SCHED(td, self) && curthread->td_intr_nesting_level && ts->ts_cpu != self) { SCHED_STAT_INC(pickcpu_intrbind); ts->ts_cpu = self; + if (TDQ_CPU(self)->tdq_lowpri > pri) { + SCHED_STAT_INC(pickcpu_affinity); + return (ts->ts_cpu); + } } /* * If the thread can run on the last cpu and the affinity has not * expired or it is idle run it there. */ - pri = td->td_priority; tdq = TDQ_CPU(ts->ts_cpu); - if (THREAD_CAN_SCHED(td, ts->ts_cpu)) { - if (tdq->tdq_lowpri > PRI_MIN_IDLE) { + cg = tdq->tdq_cg; + if (THREAD_CAN_SCHED(td, ts->ts_cpu) && + tdq->tdq_lowpri >= PRI_MIN_IDLE && + SCHED_AFFINITY(ts, CG_SHARE_L2)) { + if (cg->cg_flags & CG_FLAG_THREAD) { + CPUSET_FOREACH(cpu, cg->cg_mask) { + if (TDQ_CPU(cpu)->tdq_lowpri < PRI_MIN_IDLE) + break; + } + } else + cpu = INT_MAX; + if (cpu > mp_maxid) { SCHED_STAT_INC(pickcpu_idle_affinity); return (ts->ts_cpu); } - if (SCHED_AFFINITY(ts, CG_SHARE_L2) && tdq->tdq_lowpri > pri) { - SCHED_STAT_INC(pickcpu_affinity); - return (ts->ts_cpu); - } } /* - * Search for the highest level in the tree that still has affinity. + * Search for the last level cache CPU group in the tree. + * Skip caches with expired affinity time and SMT groups. + * Affinity to higher level caches will be handled less aggressively. */ - cg = NULL; - for (cg = tdq->tdq_cg; cg != NULL; cg = cg->cg_parent) - if (SCHED_AFFINITY(ts, cg->cg_level)) - break; + for (ccg = NULL; cg != NULL; cg = cg->cg_parent) { + if (cg->cg_flags & CG_FLAG_THREAD) + continue; + if (!SCHED_AFFINITY(ts, cg->cg_level)) + continue; + ccg = cg; + } + if (ccg != NULL) + cg = ccg; cpu = -1; + /* Search the group for the less loaded idle CPU we can run now. */ mask = td->td_cpuset->cs_mask; - if (cg) - cpu = sched_lowest(cg, mask, pri); + if (cg != NULL && cg != cpu_top && + CPU_CMP(&cg->cg_mask, &cpu_top->cg_mask) != 0) + cpu = sched_lowest(cg, mask, max(pri, PRI_MAX_TIMESHARE), + INT_MAX, ts->ts_cpu); + /* Search globally for the less loaded CPU we can run now. */ + if (cpu == -1) + cpu = sched_lowest(cpu_top, mask, pri, INT_MAX, ts->ts_cpu); + /* Search globally for the less loaded CPU. */ if (cpu == -1) - cpu = sched_lowest(cpu_top, mask, -1); + cpu = sched_lowest(cpu_top, mask, -1, INT_MAX, ts->ts_cpu); /* * Compare the lowest loaded cpu to current cpu. */ if (THREAD_CAN_SCHED(td, self) && TDQ_CPU(self)->tdq_lowpri > pri && - TDQ_CPU(cpu)->tdq_lowpri < PRI_MIN_IDLE) { + TDQ_CPU(cpu)->tdq_lowpri < PRI_MIN_IDLE && + TDQ_CPU(self)->tdq_load <= TDQ_CPU(cpu)->tdq_load + 1) { SCHED_STAT_INC(pickcpu_local); cpu = self; } else @@ -2750,8 +2786,6 @@ SYSCTL_INT(_kern_sched, OID_AUTO, balanc SYSCTL_INT(_kern_sched, OID_AUTO, balance_interval, CTLFLAG_RW, &balance_interval, 0, "Average frequency in stathz ticks to run the long-term balancer"); -SYSCTL_INT(_kern_sched, OID_AUTO, steal_htt, CTLFLAG_RW, &steal_htt, 0, - "Steals work from another hyper-threaded core on idle"); SYSCTL_INT(_kern_sched, OID_AUTO, steal_idle, CTLFLAG_RW, &steal_idle, 0, "Attempts to steal work from other cores before idling"); SYSCTL_INT(_kern_sched, OID_AUTO, steal_thresh, CTLFLAG_RW, &steal_thresh, 0, From owner-svn-src-all@FreeBSD.ORG Mon Feb 27 13:38:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 974BA1065672; Mon, 27 Feb 2012 13:38:52 +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 84D308FC0C; Mon, 27 Feb 2012 13:38:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1RDcqTt020038; Mon, 27 Feb 2012 13:38:52 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1RDcqEQ020033; Mon, 27 Feb 2012 13:38:52 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201202271338.q1RDcqEQ020033@svn.freebsd.org> From: David Xu Date: Mon, 27 Feb 2012 13:38:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232209 - in head: lib/libthr/thread sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 13:38:52 -0000 Author: davidxu Date: Mon Feb 27 13:38:52 2012 New Revision: 232209 URL: http://svn.freebsd.org/changeset/base/232209 Log: Follow changes made in revision 232144, pass absolute timeout to kernel, this eliminates a clock_gettime() syscall. Modified: head/lib/libthr/thread/thr_rwlock.c head/lib/libthr/thread/thr_umtx.c head/lib/libthr/thread/thr_umtx.h head/sys/kern/kern_umtx.c Modified: head/lib/libthr/thread/thr_rwlock.c ============================================================================== --- head/lib/libthr/thread/thr_rwlock.c Mon Feb 27 13:04:09 2012 (r232208) +++ head/lib/libthr/thread/thr_rwlock.c Mon Feb 27 13:38:52 2012 (r232209) @@ -123,7 +123,6 @@ rwlock_rdlock_common(pthread_rwlock_t *r { struct pthread *curthread = _get_curthread(); pthread_rwlock_t prwlock; - struct timespec ts, ts2, *tsp; int flags; int ret; @@ -162,18 +161,8 @@ rwlock_rdlock_common(pthread_rwlock_t *r return (EINVAL); for (;;) { - if (abstime) { - clock_gettime(CLOCK_REALTIME, &ts); - TIMESPEC_SUB(&ts2, abstime, &ts); - if (ts2.tv_sec < 0 || - (ts2.tv_sec == 0 && ts2.tv_nsec <= 0)) - return (ETIMEDOUT); - tsp = &ts2; - } else - tsp = NULL; - /* goto kernel and lock it */ - ret = __thr_rwlock_rdlock(&prwlock->lock, flags, tsp); + ret = __thr_rwlock_rdlock(&prwlock->lock, flags, abstime); if (ret != EINTR) break; @@ -255,7 +244,6 @@ rwlock_wrlock_common (pthread_rwlock_t * { struct pthread *curthread = _get_curthread(); pthread_rwlock_t prwlock; - struct timespec ts, ts2, *tsp; int ret; CHECK_AND_INIT_RWLOCK @@ -275,18 +263,8 @@ rwlock_wrlock_common (pthread_rwlock_t * return (EINVAL); for (;;) { - if (abstime != NULL) { - clock_gettime(CLOCK_REALTIME, &ts); - TIMESPEC_SUB(&ts2, abstime, &ts); - if (ts2.tv_sec < 0 || - (ts2.tv_sec == 0 && ts2.tv_nsec <= 0)) - return (ETIMEDOUT); - tsp = &ts2; - } else - tsp = NULL; - /* goto kernel and lock it */ - ret = __thr_rwlock_wrlock(&prwlock->lock, tsp); + ret = __thr_rwlock_wrlock(&prwlock->lock, abstime); if (ret == 0) { prwlock->owner = curthread; break; Modified: head/lib/libthr/thread/thr_umtx.c ============================================================================== --- head/lib/libthr/thread/thr_umtx.c Mon Feb 27 13:04:09 2012 (r232208) +++ head/lib/libthr/thread/thr_umtx.c Mon Feb 27 13:38:52 2012 (r232209) @@ -265,15 +265,42 @@ _thr_ucond_broadcast(struct ucond *cv) } int -__thr_rwlock_rdlock(struct urwlock *rwlock, int flags, struct timespec *tsp) +__thr_rwlock_rdlock(struct urwlock *rwlock, int flags, + const struct timespec *tsp) { - return _umtx_op_err(rwlock, UMTX_OP_RW_RDLOCK, flags, NULL, tsp); + struct _umtx_time timeout, *tm_p; + size_t tm_size; + + if (tsp == NULL) { + tm_p = NULL; + tm_size = 0; + } else { + timeout._timeout = *tsp; + timeout._flags = UMTX_ABSTIME; + timeout._clockid = CLOCK_REALTIME; + tm_p = &timeout; + tm_size = sizeof(timeout); + } + return _umtx_op_err(rwlock, UMTX_OP_RW_RDLOCK, flags, (void *)tm_size, tm_p); } int -__thr_rwlock_wrlock(struct urwlock *rwlock, struct timespec *tsp) +__thr_rwlock_wrlock(struct urwlock *rwlock, const struct timespec *tsp) { - return _umtx_op_err(rwlock, UMTX_OP_RW_WRLOCK, 0, NULL, tsp); + struct _umtx_time timeout, *tm_p; + size_t tm_size; + + if (tsp == NULL) { + tm_p = NULL; + tm_size = 0; + } else { + timeout._timeout = *tsp; + timeout._flags = UMTX_ABSTIME; + timeout._clockid = CLOCK_REALTIME; + tm_p = &timeout; + tm_size = sizeof(timeout); + } + return _umtx_op_err(rwlock, UMTX_OP_RW_WRLOCK, 0, (void *)tm_size, tm_p); } int Modified: head/lib/libthr/thread/thr_umtx.h ============================================================================== --- head/lib/libthr/thread/thr_umtx.h Mon Feb 27 13:04:09 2012 (r232208) +++ head/lib/libthr/thread/thr_umtx.h Mon Feb 27 13:38:52 2012 (r232209) @@ -60,8 +60,10 @@ void _thr_ucond_init(struct ucond *cv) _ int _thr_ucond_signal(struct ucond *cv) __hidden; int _thr_ucond_broadcast(struct ucond *cv) __hidden; -int __thr_rwlock_rdlock(struct urwlock *rwlock, int flags, struct timespec *tsp) __hidden; -int __thr_rwlock_wrlock(struct urwlock *rwlock, struct timespec *tsp) __hidden; +int __thr_rwlock_rdlock(struct urwlock *rwlock, int flags, + const struct timespec *tsp) __hidden; +int __thr_rwlock_wrlock(struct urwlock *rwlock, + const struct timespec *tsp) __hidden; int __thr_rwlock_unlock(struct urwlock *rwlock) __hidden; /* Internal used only */ Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Mon Feb 27 13:04:09 2012 (r232208) +++ head/sys/kern/kern_umtx.c Mon Feb 27 13:38:52 2012 (r232209) @@ -2289,7 +2289,6 @@ do_cv_wait(struct thread *td, struct uco struct timespec *timeout, u_long wflags) { struct umtx_q *uq; - struct timeval tv; struct timespec cts, ets, tts; uint32_t flags; uint32_t clockid; @@ -2345,9 +2344,8 @@ do_cv_wait(struct thread *td, struct uco kern_clock_gettime(td, clockid, &cts); timespecsub(&tts, &cts); } - TIMESPEC_TO_TIMEVAL(&tv, &tts); for (;;) { - error = umtxq_sleep(uq, "ucond", tvtohz(&tv)); + error = umtxq_sleep(uq, "ucond", tstohz(&tts)); if (error != ETIMEDOUT) break; kern_clock_gettime(td, clockid, &cts); @@ -2357,7 +2355,6 @@ do_cv_wait(struct thread *td, struct uco } tts = ets; timespecsub(&tts, &cts); - TIMESPEC_TO_TIMEVAL(&tv, &tts); } } } @@ -2555,27 +2552,30 @@ sleep: } static int -do_rw_rdlock2(struct thread *td, void *obj, long val, struct timespec *timeout) +do_rw_rdlock2(struct thread *td, void *obj, long val, struct _umtx_time *timeout) { - struct timespec ts, ts2, ts3; - struct timeval tv; + struct timespec cts, ets, tts; int error; - getnanouptime(&ts); - timespecadd(&ts, timeout); - TIMESPEC_TO_TIMEVAL(&tv, timeout); + kern_clock_gettime(td, timeout->_clockid, &cts); + if ((timeout->_flags & UMTX_ABSTIME) == 0) { + ets = cts; + timespecadd(&ets, &timeout->_timeout); + tts = timeout->_timeout; + } else { + ets = timeout->_timeout; + tts = timeout->_timeout; + timespecsub(&tts, &cts); + } for (;;) { - error = do_rw_rdlock(td, obj, val, tvtohz(&tv)); + error = do_rw_rdlock(td, obj, val, tstohz(&tts)); if (error != ETIMEDOUT) break; - getnanouptime(&ts2); - if (timespeccmp(&ts2, &ts, >=)) { - error = ETIMEDOUT; + kern_clock_gettime(td, timeout->_clockid, &cts); + if (timespeccmp(&cts, &ets, >=)) break; - } - ts3 = ts; - timespecsub(&ts3, &ts2); - TIMESPEC_TO_TIMEVAL(&tv, &ts3); + tts = ets; + timespecsub(&tts, &cts); } if (error == ERESTART) error = EINTR; @@ -2692,27 +2692,30 @@ sleep: } static int -do_rw_wrlock2(struct thread *td, void *obj, struct timespec *timeout) +do_rw_wrlock2(struct thread *td, void *obj, struct _umtx_time *timeout) { - struct timespec ts, ts2, ts3; - struct timeval tv; + struct timespec cts, ets, tts; int error; - getnanouptime(&ts); - timespecadd(&ts, timeout); - TIMESPEC_TO_TIMEVAL(&tv, timeout); + kern_clock_gettime(td, timeout->_clockid, &cts); + if ((timeout->_flags & UMTX_ABSTIME) == 0) { + ets = cts; + timespecadd(&ets, &timeout->_timeout); + tts = timeout->_timeout; + } else { + ets = timeout->_timeout; + tts = timeout->_timeout; + timespecsub(&tts, &cts); + } for (;;) { - error = do_rw_wrlock(td, obj, tvtohz(&tv)); + error = do_rw_wrlock(td, obj, tstohz(&tts)); if (error != ETIMEDOUT) break; - getnanouptime(&ts2); - if (timespeccmp(&ts2, &ts, >=)) { - error = ETIMEDOUT; + kern_clock_gettime(td, timeout->_clockid, &cts); + if (timespeccmp(&cts, &ets, >=)) break; - } - ts3 = ts; - timespecsub(&ts3, &ts2); - TIMESPEC_TO_TIMEVAL(&tv, &ts3); + tts = ets; + timespecsub(&tts, &cts); } if (error == ERESTART) error = EINTR; @@ -3159,14 +3162,15 @@ __umtx_op_cv_broadcast(struct thread *td static int __umtx_op_rw_rdlock(struct thread *td, struct _umtx_op_args *uap) { - struct timespec timeout; + struct _umtx_time timeout; int error; /* Allow a null timespec (wait forever). */ if (uap->uaddr2 == NULL) { error = do_rw_rdlock(td, uap->obj, uap->val, 0); } else { - error = umtx_copyin_timeout(uap->uaddr2, &timeout); + error = umtx_copyin_umtx_time(uap->uaddr2, + (size_t)uap->uaddr1, &timeout); if (error != 0) return (error); error = do_rw_rdlock2(td, uap->obj, uap->val, &timeout); @@ -3177,14 +3181,15 @@ __umtx_op_rw_rdlock(struct thread *td, s static int __umtx_op_rw_wrlock(struct thread *td, struct _umtx_op_args *uap) { - struct timespec timeout; + struct _umtx_time timeout; int error; /* Allow a null timespec (wait forever). */ if (uap->uaddr2 == NULL) { error = do_rw_wrlock(td, uap->obj, 0); } else { - error = umtx_copyin_timeout(uap->uaddr2, &timeout); + error = umtx_copyin_umtx_time(uap->uaddr2, + (size_t)uap->uaddr1, &timeout); if (error != 0) return (error); @@ -3430,14 +3435,15 @@ __umtx_op_cv_wait_compat32(struct thread static int __umtx_op_rw_rdlock_compat32(struct thread *td, struct _umtx_op_args *uap) { - struct timespec timeout; + struct _umtx_time timeout; int error; /* Allow a null timespec (wait forever). */ if (uap->uaddr2 == NULL) { error = do_rw_rdlock(td, uap->obj, uap->val, 0); } else { - error = umtx_copyin_timeout32(uap->uaddr2, &timeout); + error = umtx_copyin_umtx_time32(uap->uaddr2, + (size_t)uap->uaddr1, &timeout); if (error != 0) return (error); error = do_rw_rdlock2(td, uap->obj, uap->val, &timeout); @@ -3448,17 +3454,17 @@ __umtx_op_rw_rdlock_compat32(struct thre static int __umtx_op_rw_wrlock_compat32(struct thread *td, struct _umtx_op_args *uap) { - struct timespec timeout; + struct _umtx_time timeout; int error; /* Allow a null timespec (wait forever). */ if (uap->uaddr2 == NULL) { error = do_rw_wrlock(td, uap->obj, 0); } else { - error = umtx_copyin_timeout32(uap->uaddr2, &timeout); + error = umtx_copyin_umtx_time32(uap->uaddr2, + (size_t)uap->uaddr1, &timeout); if (error != 0) return (error); - error = do_rw_wrlock2(td, uap->obj, &timeout); } return (error); From owner-svn-src-all@FreeBSD.ORG Mon Feb 27 14:30:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DBB81065672; Mon, 27 Feb 2012 14:30:05 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id C4DBB8FC12; Mon, 27 Feb 2012 14:30:04 +0000 (UTC) Received: by yenq7 with SMTP id q7so302229yen.13 for ; Mon, 27 Feb 2012 06:30:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=/xrmBaI5+usmSpbn6+v3PDG5rJgJiyqFDPyJPsLowQc=; b=LZ7+UCROdKWOsfPSgV2eh9V3ljmM9N99Pp47JY59xVI5Y/kF4MA7CJxNXb8L7DFwnz 6NKsFEi5IV+gM6mGhT6LIGFHutwKFc+QSMKRDRUPXAO9rbHybMvw/Hc5KoeZdUHknwEV uyVZIcYg7Pu8ehYn5hOmZzd4ONRmmbJDF3b2Y= Received: by 10.236.201.195 with SMTP id b43mr15773199yho.75.1330353004141; Mon, 27 Feb 2012 06:30:04 -0800 (PST) MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.100.93.1 with HTTP; Mon, 27 Feb 2012 06:29:24 -0800 (PST) In-Reply-To: <201202271338.q1RDcqEQ020033@svn.freebsd.org> References: <201202271338.q1RDcqEQ020033@svn.freebsd.org> From: Ivan Voras Date: Mon, 27 Feb 2012 15:29:24 +0100 X-Google-Sender-Auth: zxnp-jXKB8QnHFisoWGsfzZbmtA Message-ID: To: David Xu 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: r232209 - in head: lib/libthr/thread sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 14:30:05 -0000 On 27 February 2012 14:38, David Xu wrote: > Author: davidxu > Date: Mon Feb 27 13:38:52 2012 > New Revision: 232209 > URL: http://svn.freebsd.org/changeset/base/232209 > > Log: > =C2=A0Follow changes made in revision 232144, pass absolute timeout to ke= rnel, > =C2=A0this eliminates a clock_gettime() syscall. Any chance of a MFC? I use rwlocks a lot; removing a syscall from all operations looks like a nice improvement. From owner-svn-src-all@FreeBSD.ORG Mon Feb 27 16:08:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6EA2E1065675; Mon, 27 Feb 2012 16:08:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E2A98FC0C; Mon, 27 Feb 2012 16:08:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1RG8IKL025687; Mon, 27 Feb 2012 16:08:18 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1RG8Iaj025685; Mon, 27 Feb 2012 16:08:18 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202271608.q1RG8Iaj025685@svn.freebsd.org> From: John Baldwin Date: Mon, 27 Feb 2012 16:08: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: r232218 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 16:08:18 -0000 Author: jhb Date: Mon Feb 27 16:08:18 2012 New Revision: 232218 URL: http://svn.freebsd.org/changeset/base/232218 Log: Clear the a device's description string anytime it's driver changes. Descriptions are specific to drivers and we don't change drivers on attached devices. This fixes a few places where we were not clearing the description when detaching a driver (e.g. with device_attach() failed). While here, fix a few other nits: - Remove spurious call to remove a device's driver from devclass_driver_deleted(). device_detach() removes it already. - Fix a typo. Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Mon Feb 27 15:59:17 2012 (r232217) +++ head/sys/kern/subr_bus.c Mon Feb 27 16:08:18 2012 (r232218) @@ -1129,7 +1129,6 @@ devclass_driver_deleted(devclass_t buscl dev->parent->devclass == busclass) { if ((error = device_detach(dev)) != 0) return (error); - (void)device_set_driver(dev, NULL); BUS_PROBE_NOMATCH(dev->parent, dev); devnomatch(dev); dev->flags |= DF_DONENOMATCH; @@ -2097,7 +2096,7 @@ device_probe_child(device_t dev, device_ /* XXX What happens if we rebid and got no best? */ if (best) { /* - * If this device was atached, and we were asked to + * If this device was attached, and we were asked to * rescan, and it is a different driver, then we have * to detach the old driver and reattach this new one. * Note, we don't have to check for DF_REBID here @@ -2604,6 +2603,7 @@ device_set_driver(device_t dev, driver_t free(dev->softc, M_BUS_SC); dev->softc = NULL; } + device_set_desc(dev, NULL); kobj_delete((kobj_t) dev, NULL); dev->driver = driver; if (driver) { @@ -2789,7 +2789,6 @@ device_detach(device_t dev) dev->state = DS_NOTPRESENT; (void)device_set_driver(dev, NULL); - device_set_desc(dev, NULL); device_sysctl_fini(dev); return (0); From owner-svn-src-all@FreeBSD.ORG Mon Feb 27 16:10:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D415D1065672; Mon, 27 Feb 2012 16:10:26 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C3B548FC16; Mon, 27 Feb 2012 16:10:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1RGAQ9q025807; Mon, 27 Feb 2012 16:10:26 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1RGAQOI025805; Mon, 27 Feb 2012 16:10:26 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201202271610.q1RGAQOI025805@svn.freebsd.org> From: Kevin Lo Date: Mon, 27 Feb 2012 16:10: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: r232219 - head/sys/dev/mlx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Feb 2012 16:10:26 -0000 Author: kevlo Date: Mon Feb 27 16:10:26 2012 New Revision: 232219 URL: http://svn.freebsd.org/changeset/base/232219 Log: Remove unused variable count. This variable is initialized but not used. Modified: head/sys/dev/mlx/mlx.c Modified: head/sys/dev/mlx/mlx.c ============================================================================== --- head/sys/dev/mlx/mlx.c Mon Feb 27 16:08:18 2012 (r232218) +++ head/sys/dev/mlx/mlx.c Mon Feb 27 16:10:26 2012 (r232219) @@ -2254,7 +2254,7 @@ static void mlx_complete(struct mlx_softc *sc) { struct mlx_command *mc, *nc; - int s, count; + int s; debug_called(2); @@ -2263,7 +2263,6 @@ mlx_complete(struct mlx_softc *sc) return; s = splbio(); - count = 0; /* scan the list of busy/done commands */ mc = TAILQ_FIRST(&sc->mlx_work); From owner-svn-src-all@FreeBSD.ORG Mon Feb 27 16:28:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1033) id 610061065672; Mon, 27 Feb 2012 16:28:03 +0000 (UTC) Date: Mon, 27 Feb 2012 16:28:03 +0000 From: Alexey Dokuchaev To: John Baldwin Message-ID: <20120227162803.GA85675@FreeBSD.org> References: <201202271608.q1RG8Iaj025685@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201202271608.q1RG8Iaj025685@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: r232218 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 16:28:03 -0000 On Mon, Feb 27, 2012 at 04:08:18PM +0000, John Baldwin wrote: > Author: jhb > Date: Mon Feb 27 16:08:18 2012 > New Revision: 232218 > URL: http://svn.freebsd.org/changeset/base/232218 > > Log: > Clear the a device's description string anytime it's driver changes. > Descriptions are specific to drivers and we don't change drivers on attached > devices. This fixes a few places where we were not clearing the description > when detaching a driver (e.g. with device_attach() failed). While here, fix > a few other nits: > - Remove spurious call to remove a device's driver from > devclass_driver_deleted(). device_detach() removes it already. > - Fix a typo. Thanks John, Please MFC it at least as far as RELENG_8. ./danfe From owner-svn-src-all@FreeBSD.ORG Mon Feb 27 17:04:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16750106564A; Mon, 27 Feb 2012 17:04:19 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 062598FC17; Mon, 27 Feb 2012 17:04:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1RH4IC6027942; Mon, 27 Feb 2012 17:04:18 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1RH4IBM027940; Mon, 27 Feb 2012 17:04:18 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201202271704.q1RH4IBM027940@svn.freebsd.org> From: Sean Bruno Date: Mon, 27 Feb 2012 17:04: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: r232225 - head/sys/dev/isci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Feb 2012 17:04:19 -0000 Author: sbruno Date: Mon Feb 27 17:04:18 2012 New Revision: 232225 URL: http://svn.freebsd.org/changeset/base/232225 Log: Update PCI-IDs with devices found on Intel SDP Return BUS_PROBE_DEFAULT so that non-default drivers may be loaded Reviewed by: jharris@ Obtained from: Yahoo! Inc. and Intel MFC after: 3 days Modified: head/sys/dev/isci/isci.c Modified: head/sys/dev/isci/isci.c ============================================================================== --- head/sys/dev/isci/isci.c Mon Feb 27 16:18:49 2012 (r232224) +++ head/sys/dev/isci/isci.c Mon Feb 27 17:04:18 2012 (r232225) @@ -98,7 +98,11 @@ static struct _pcsid { 0x1d688086, "Intel(R) C600 Series Chipset SAS Controller" }, { 0x1d698086, "Intel(R) C600 Series Chipset SAS Controller" }, { 0x1d6a8086, "Intel(R) C600 Series Chipset SAS Controller (SATA mode)" }, - { 0x1d6b8086, "Intel(R) C600 Series Chipset SAS Controller (SATA mode)" }, + { 0x1d6b8086, "Intel(R) C600 Series Chipset SAS Controller (SATA mode)" }, + { 0x1d6c8086, "Intel(R) C600 Series Chipset SAS Controller" }, + { 0x1d6d8086, "Intel(R) C600 Series Chipset SAS Controller" }, + { 0x1d6e8086, "Intel(R) C600 Series Chipset SAS Controller" }, + { 0x1d6f8086, "Intel(R) C600 Series Chipset SAS Controller (SATA mode)" }, { 0x00000000, NULL } }; @@ -114,7 +118,7 @@ isci_probe (device_t device) if (ep->desc) { device_set_desc(device, ep->desc); - return (0); + return (BUS_PROBE_DEFAULT); } else return (ENXIO); From owner-svn-src-all@FreeBSD.ORG Mon Feb 27 17:28:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29BC4106564A; Mon, 27 Feb 2012 17:28:23 +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 199BE8FC19; Mon, 27 Feb 2012 17:28:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1RHSMWo028882; Mon, 27 Feb 2012 17:28:22 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1RHSMA2028880; Mon, 27 Feb 2012 17:28:22 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202271728.q1RHSMA2028880@svn.freebsd.org> From: John Baldwin Date: Mon, 27 Feb 2012 17:28: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: r232226 - head/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Feb 2012 17:28:23 -0000 Author: jhb Date: Mon Feb 27 17:28:22 2012 New Revision: 232226 URL: http://svn.freebsd.org/changeset/base/232226 Log: Update incorrect comment. Modified: head/sys/amd64/amd64/cpu_switch.S Modified: head/sys/amd64/amd64/cpu_switch.S ============================================================================== --- head/sys/amd64/amd64/cpu_switch.S Mon Feb 27 17:04:18 2012 (r232225) +++ head/sys/amd64/amd64/cpu_switch.S Mon Feb 27 17:28:22 2012 (r232226) @@ -76,7 +76,7 @@ ENTRY(cpu_throw) movq PCPU(CURPMAP),%rdx LK btrl %eax,PM_ACTIVE(%rdx) /* clear old */ 1: - movq TD_PCB(%rsi),%r8 /* newtd->td_proc */ + movq TD_PCB(%rsi),%r8 /* newtd->td_pcb */ movq PCB_CR3(%r8),%rdx movq %rdx,%cr3 /* new address space */ jmp swact From owner-svn-src-all@FreeBSD.ORG Mon Feb 27 17:28:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5A3F21065679; Mon, 27 Feb 2012 17:28:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A3B38FC17; Mon, 27 Feb 2012 17:28:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1RHSmVY028932; Mon, 27 Feb 2012 17:28:48 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1RHSmpN028930; Mon, 27 Feb 2012 17:28:48 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202271728.q1RHSmpN028930@svn.freebsd.org> From: John Baldwin Date: Mon, 27 Feb 2012 17: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: r232227 - head/sys/amd64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 17:28:48 -0000 Author: jhb Date: Mon Feb 27 17:28:47 2012 New Revision: 232227 URL: http://svn.freebsd.org/changeset/base/232227 Log: Correct function prototype for read_rflags(). Modified: head/sys/amd64/include/cpufunc.h Modified: head/sys/amd64/include/cpufunc.h ============================================================================== --- head/sys/amd64/include/cpufunc.h Mon Feb 27 17:28:22 2012 (r232226) +++ head/sys/amd64/include/cpufunc.h Mon Feb 27 17:28:47 2012 (r232227) @@ -727,7 +727,7 @@ uint64_t rdr5(void); uint64_t rdr6(void); uint64_t rdr7(void); uint64_t rdtsc(void); -u_int read_rflags(void); +u_long read_rflags(void); u_int rfs(void); u_int rgs(void); void wbinvd(void); From owner-svn-src-all@FreeBSD.ORG Mon Feb 27 17:29:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C6091065673; Mon, 27 Feb 2012 17:29:37 +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 7BD858FC12; Mon, 27 Feb 2012 17:29:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1RHTb4I029000; Mon, 27 Feb 2012 17:29:37 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1RHTbsr028997; Mon, 27 Feb 2012 17:29:37 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202271729.q1RHTbsr028997@svn.freebsd.org> From: John Baldwin Date: Mon, 27 Feb 2012 17:29: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: r232228 - in head/sys: amd64/include i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 17:29:37 -0000 Author: jhb Date: Mon Feb 27 17:29:37 2012 New Revision: 232228 URL: http://svn.freebsd.org/changeset/base/232228 Log: Resort the IDT_DTRACE_RET constant after it was changed to be less than IDT_SYSCALL. Modified: head/sys/amd64/include/segments.h head/sys/i386/include/segments.h Modified: head/sys/amd64/include/segments.h ============================================================================== --- head/sys/amd64/include/segments.h Mon Feb 27 17:28:47 2012 (r232227) +++ head/sys/amd64/include/segments.h Mon Feb 27 17:29:37 2012 (r232228) @@ -213,8 +213,8 @@ struct region_descriptor { #define IDT_MC 18 /* #MC: Machine Check */ #define IDT_XF 19 /* #XF: SIMD Floating-Point Exception */ #define IDT_IO_INTS NRSVIDT /* Base of IDT entries for I/O interrupts. */ -#define IDT_SYSCALL 0x80 /* System Call Interrupt Vector */ #define IDT_DTRACE_RET 0x20 /* DTrace pid provider Interrupt Vector */ +#define IDT_SYSCALL 0x80 /* System Call Interrupt Vector */ /* * Entries in the Global Descriptor Table (GDT) Modified: head/sys/i386/include/segments.h ============================================================================== --- head/sys/i386/include/segments.h Mon Feb 27 17:28:47 2012 (r232227) +++ head/sys/i386/include/segments.h Mon Feb 27 17:29:37 2012 (r232228) @@ -206,8 +206,8 @@ struct region_descriptor { #define IDT_MC 18 /* #MC: Machine Check */ #define IDT_XF 19 /* #XF: SIMD Floating-Point Exception */ #define IDT_IO_INTS NRSVIDT /* Base of IDT entries for I/O interrupts. */ -#define IDT_SYSCALL 0x80 /* System Call Interrupt Vector */ #define IDT_DTRACE_RET 0x20 /* DTrace pid provider Interrupt Vector */ +#define IDT_SYSCALL 0x80 /* System Call Interrupt Vector */ /* * Entries in the Global Descriptor Table (GDT) From owner-svn-src-all@FreeBSD.ORG Mon Feb 27 17:29:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC16F106577F; Mon, 27 Feb 2012 17:29:43 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 354FF8FC15; Mon, 27 Feb 2012 17:29:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1RHTgOT029040; Mon, 27 Feb 2012 17:29:42 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1RHTgBj029038; Mon, 27 Feb 2012 17:29:42 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201202271729.q1RHTgBj029038@svn.freebsd.org> From: Sean Bruno Date: Mon, 27 Feb 2012 17:29:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232229 - stable/9/sys/dev/isci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Feb 2012 17:29:44 -0000 Author: sbruno Date: Mon Feb 27 17:29:42 2012 New Revision: 232229 URL: http://svn.freebsd.org/changeset/base/232229 Log: MFC r231860 During work to port isci(4) to stable/7 I noted that the maxio portion of struct ccb_pathinq from sys/cam/cam_ccb.h wasn't added to stable/7 at all and didn't appear in stable/8 until svn R195534. Since __FreeBSD_version did not get bumped until svn R195634, assume that maxio is valid at 800102 or higher. Obtained from: Yahoo! Inc. Modified: stable/9/sys/dev/isci/isci_controller.c Modified: stable/9/sys/dev/isci/isci_controller.c ============================================================================== --- stable/9/sys/dev/isci/isci_controller.c Mon Feb 27 17:29:37 2012 (r232228) +++ stable/9/sys/dev/isci/isci_controller.c Mon Feb 27 17:29:42 2012 (r232229) @@ -549,7 +549,7 @@ void isci_action(struct cam_sim *sim, un cpi->hba_eng_cnt = 0; cpi->max_target = SCI_MAX_REMOTE_DEVICES - 1; cpi->max_lun = ISCI_MAX_LUN; -#if __FreeBSD_version >= 704100 +#if __FreeBSD_version >= 800102 cpi->maxio = isci_io_request_get_max_io_size(); #endif cpi->unit_number = cam_sim_unit(sim); From owner-svn-src-all@FreeBSD.ORG Mon Feb 27 17:30:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACB89106564A; Mon, 27 Feb 2012 17:30:21 +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 831948FC17; Mon, 27 Feb 2012 17:30:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1RHULOV029127; Mon, 27 Feb 2012 17:30:21 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1RHULHQ029125; Mon, 27 Feb 2012 17:30:21 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202271730.q1RHULHQ029125@svn.freebsd.org> From: John Baldwin Date: Mon, 27 Feb 2012 17:30: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: r232230 - head/sys/i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 17:30:21 -0000 Author: jhb Date: Mon Feb 27 17:30:21 2012 New Revision: 232230 URL: http://svn.freebsd.org/changeset/base/232230 Log: Remove completely duplicate '#ifdef XEN' section. Modified: head/sys/i386/include/apicvar.h Modified: head/sys/i386/include/apicvar.h ============================================================================== --- head/sys/i386/include/apicvar.h Mon Feb 27 17:29:42 2012 (r232229) +++ head/sys/i386/include/apicvar.h Mon Feb 27 17:30:21 2012 (r232230) @@ -103,35 +103,6 @@ */ /* Interrupts for local APIC LVT entries other than the timer. */ -#ifdef XEN -/* These are the Xen i386 APIC definitions */ -#define APIC_LOCAL_INTS 240 -#define APIC_ERROR_INT APIC_LOCAL_INTS -#define APIC_THERMAL_INT (APIC_LOCAL_INTS + 1) -#define APIC_CMC_INT (APIC_LOCAL_INTS + 2) -#define APIC_IPI_INTS (APIC_LOCAL_INTS + 3) - -#define IPI_RENDEZVOUS (APIC_IPI_INTS) /* Inter-CPU rendezvous. */ -#define IPI_INVLTLB (APIC_IPI_INTS + 1) /* TLB Shootdown IPIs */ -#define IPI_INVLPG (APIC_IPI_INTS + 2) -#define IPI_INVLRNG (APIC_IPI_INTS + 3) -#define IPI_INVLCACHE (APIC_IPI_INTS + 4) -#define IPI_LAZYPMAP (APIC_IPI_INTS + 5) /* Lazy pmap release. */ -/* Vector to handle bitmap based IPIs */ -#define IPI_BITMAP_VECTOR (APIC_IPI_INTS + 6) - -/* IPIs handled by IPI_BITMAPED_VECTOR (XXX ups is there a better place?) */ -#define IPI_AST 0 /* Generate software trap. */ -#define IPI_PREEMPT 1 -#define IPI_HARDCLOCK 2 -#define IPI_BITMAP_LAST IPI_HARDCLOCK -#define IPI_IS_BITMAPED(x) ((x) <= IPI_BITMAP_LAST) - -#define IPI_STOP (APIC_IPI_INTS + 7) /* Stop CPU until restarted. */ -#define IPI_STOP_HARD (APIC_IPI_INTS + 8) /* Stop CPU with a NMI. */ - -#else /* XEN */ -/* These are the normal i386 APIC definitions */ #define APIC_LOCAL_INTS 240 #define APIC_ERROR_INT APIC_LOCAL_INTS #define APIC_THERMAL_INT (APIC_LOCAL_INTS + 1) @@ -156,7 +127,6 @@ #define IPI_STOP (APIC_IPI_INTS + 7) /* Stop CPU until restarted. */ #define IPI_STOP_HARD (APIC_IPI_INTS + 8) /* Stop CPU with a NMI. */ -#endif /* XEN */ /* * The spurious interrupt can share the priority class with the IPIs since From owner-svn-src-all@FreeBSD.ORG Mon Feb 27 17:31:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 956D41065672; Mon, 27 Feb 2012 17:31:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 855D08FC14; Mon, 27 Feb 2012 17:31:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1RHVcaO029221; Mon, 27 Feb 2012 17:31:38 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1RHVcMJ029219; Mon, 27 Feb 2012 17:31:38 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202271731.q1RHVcMJ029219@svn.freebsd.org> From: John Baldwin Date: Mon, 27 Feb 2012 17:31: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: r232231 - head/sys/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: Mon, 27 Feb 2012 17:31:38 -0000 Author: jhb Date: Mon Feb 27 17:31:38 2012 New Revision: 232231 URL: http://svn.freebsd.org/changeset/base/232231 Log: MFamd64: Don't whine about interrupts being disabled for an NMI. Modified: head/sys/i386/i386/trap.c Modified: head/sys/i386/i386/trap.c ============================================================================== --- head/sys/i386/i386/trap.c Mon Feb 27 17:30:21 2012 (r232230) +++ head/sys/i386/i386/trap.c Mon Feb 27 17:31:38 2012 (r232231) @@ -304,8 +304,9 @@ trap(struct trapframe *frame) uprintf( "pid %ld (%s): trap %d with interrupts disabled\n", (long)curproc->p_pid, curthread->td_name, type); - else if (type != T_BPTFLT && type != T_TRCTRAP && - frame->tf_eip != (int)cpu_switch_load_gs) { + else if (type != T_NMI && type != T_BPTFLT && + type != T_TRCTRAP && + frame->tf_eip != (int)cpu_switch_load_gs) { /* * XXX not quite right, since this may be for a * multiple fault in user mode. @@ -315,9 +316,9 @@ trap(struct trapframe *frame) /* * Page faults need interrupts disabled until later, * and we shouldn't enable interrupts while holding - * a spin lock or if servicing an NMI. + * a spin lock. */ - if (type != T_NMI && type != T_PAGEFLT && + if (type != T_PAGEFLT && td->td_md.md_spinlock_count == 0) enable_intr(); } From owner-svn-src-all@FreeBSD.ORG Mon Feb 27 17:33:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BEF851065678; Mon, 27 Feb 2012 17:33:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AED4F8FC19; Mon, 27 Feb 2012 17:33:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1RHXGa9029339; Mon, 27 Feb 2012 17:33:16 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1RHXGuA029337; Mon, 27 Feb 2012 17:33:16 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202271733.q1RHXGuA029337@svn.freebsd.org> From: John Baldwin Date: Mon, 27 Feb 2012 17:33: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: r232232 - head/sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Feb 2012 17:33:16 -0000 Author: jhb Date: Mon Feb 27 17:33:16 2012 New Revision: 232232 URL: http://svn.freebsd.org/changeset/base/232232 Log: - Panic up front if a kernel does not include 'device atpic' and an APIC is not found. - Don't panic if lapic_enable_cmc() is called and the APIC is not enabled. This can happen due to booting a kernel with APIC disabled on a CPU that supports CMCI. - Wrap a long line. Modified: head/sys/x86/x86/local_apic.c Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Mon Feb 27 17:31:38 2012 (r232231) +++ head/sys/x86/x86/local_apic.c Mon Feb 27 17:33:16 2012 (r232232) @@ -34,6 +34,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_atpic.h" #include "opt_hwpmc_hooks.h" #include "opt_kdtrace.h" @@ -308,7 +309,8 @@ lapic_create(u_int apic_id, int boot_cpu lapics[apic_id].la_ioint_irqs[APIC_TIMER_INT - APIC_IO_INTS] = IRQ_TIMER; #ifdef KDTRACE_HOOKS - lapics[apic_id].la_ioint_irqs[IDT_DTRACE_RET - APIC_IO_INTS] = IRQ_DTRACE_RET; + lapics[apic_id].la_ioint_irqs[IDT_DTRACE_RET - APIC_IO_INTS] = + IRQ_DTRACE_RET; #endif @@ -890,6 +892,10 @@ lapic_enable_cmc(void) { u_int apic_id; +#ifdef DEV_ATPIC + if (lapic == NULL) + return; +#endif apic_id = PCPU_GET(apic_id); KASSERT(lapics[apic_id].la_present, ("%s: missing APIC %u", __func__, apic_id)); @@ -1286,6 +1292,9 @@ apic_init(void *dummy __unused) if (best_enum == NULL) { if (bootverbose) printf("APIC: Could not find any APICs.\n"); +#ifndef DEV_ATPIC + panic("running without device atpic requires a local APIC"); +#endif return; } From owner-svn-src-all@FreeBSD.ORG Mon Feb 27 17:39:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87820106564A; Mon, 27 Feb 2012 17:39:34 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D8AC8FC15; Mon, 27 Feb 2012 17:39:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1RHdYCY029561; Mon, 27 Feb 2012 17:39:34 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1RHdYVr029559; Mon, 27 Feb 2012 17:39:34 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201202271739.q1RHdYVr029559@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 27 Feb 2012 17:39: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: r232233 - head/usr.bin/fstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Feb 2012 17:39:34 -0000 Author: pluknet Date: Mon Feb 27 17:39:34 2012 New Revision: 232233 URL: http://svn.freebsd.org/changeset/base/232233 Log: Backout r230934 which didn't work with unix sockets and several filesystem layers mounted at the specified path. Pointy hat to: pluknet Modified: head/usr.bin/fstat/fstat.c Modified: head/usr.bin/fstat/fstat.c ============================================================================== --- head/usr.bin/fstat/fstat.c Mon Feb 27 17:33:16 2012 (r232232) +++ head/usr.bin/fstat/fstat.c Mon Feb 27 17:39:34 2012 (r232233) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include @@ -225,53 +224,28 @@ static void print_file_info(struct procstat *procstat, struct filestat *fst, const char *uname, const char *cmd, int pid) { - struct sockstat sock; struct vnstat vn; DEVS *d; const char *filename; int error, fsmatch = 0; char errbuf[_POSIX2_LINE_MAX]; - error = 0; filename = NULL; if (checkfile != 0) { - switch (fst->fs_type) { - case PS_FST_TYPE_VNODE: - case PS_FST_TYPE_FIFO: - error = procstat_get_vnode_info(procstat, fst, &vn, errbuf); - break; - case PS_FST_TYPE_SOCKET: - error = procstat_get_socket_info(procstat, fst, &sock, errbuf); - break; - default: + if (fst->fs_type != PS_FST_TYPE_VNODE && + fst->fs_type != PS_FST_TYPE_FIFO) return; - } + error = procstat_get_vnode_info(procstat, fst, &vn, errbuf); if (error != 0) return; for (d = devs; d != NULL; d = d->next) - switch (fst->fs_type) { - case PS_FST_TYPE_VNODE: - case PS_FST_TYPE_FIFO: - if (d->fsid == vn.vn_fsid) { - fsmatch = 1; - if ((unsigned)d->ino == vn.vn_fileid) { - filename = d->name; - break; - } - } - break; - case PS_FST_TYPE_SOCKET: - if (sock.dom_family == AF_UNIX) { - fsmatch = 1; - if (strcmp(((struct sockaddr_un *) - (&sock.sa_local))->sun_path, - d->name) == 0) { - filename = d->name; - break; - } + if (d->fsid == vn.vn_fsid) { + fsmatch = 1; + if ((unsigned)d->ino == vn.vn_fileid) { + filename = d->name; + break; } - break; } if (fsmatch == 0 || (filename == NULL && fsflg == 0)) return; From owner-svn-src-all@FreeBSD.ORG Mon Feb 27 17:41:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F93F106564A; Mon, 27 Feb 2012 17:41:24 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D8E258FC0A; Mon, 27 Feb 2012 17:41:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1RHfNtf029653; Mon, 27 Feb 2012 17:41:23 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1RHfNDL029651; Mon, 27 Feb 2012 17:41:23 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201202271741.q1RHfNDL029651@svn.freebsd.org> From: Sergey Kandaurov Date: Mon, 27 Feb 2012 17:41:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232234 - stable/9/usr.bin/fstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Feb 2012 17:41:24 -0000 Author: pluknet Date: Mon Feb 27 17:41:23 2012 New Revision: 232234 URL: http://svn.freebsd.org/changeset/base/232234 Log: Backout r230934 (MFCed as r231859) which didn't work with unix sockets and several filesystem layers mounted at the specified path. Pointy hat to: pluknet Reported by: flo via broken tinderbox Modified: stable/9/usr.bin/fstat/fstat.c Directory Properties: stable/9/usr.bin/fstat/ (props changed) Modified: stable/9/usr.bin/fstat/fstat.c ============================================================================== --- stable/9/usr.bin/fstat/fstat.c Mon Feb 27 17:39:34 2012 (r232233) +++ stable/9/usr.bin/fstat/fstat.c Mon Feb 27 17:41:23 2012 (r232234) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include @@ -225,53 +224,28 @@ static void print_file_info(struct procstat *procstat, struct filestat *fst, const char *uname, const char *cmd, int pid) { - struct sockstat sock; struct vnstat vn; DEVS *d; const char *filename; int error, fsmatch = 0; char errbuf[_POSIX2_LINE_MAX]; - error = 0; filename = NULL; if (checkfile != 0) { - switch (fst->fs_type) { - case PS_FST_TYPE_VNODE: - case PS_FST_TYPE_FIFO: - error = procstat_get_vnode_info(procstat, fst, &vn, errbuf); - break; - case PS_FST_TYPE_SOCKET: - error = procstat_get_socket_info(procstat, fst, &sock, errbuf); - break; - default: + if (fst->fs_type != PS_FST_TYPE_VNODE && + fst->fs_type != PS_FST_TYPE_FIFO) return; - } + error = procstat_get_vnode_info(procstat, fst, &vn, errbuf); if (error != 0) return; for (d = devs; d != NULL; d = d->next) - switch (fst->fs_type) { - case PS_FST_TYPE_VNODE: - case PS_FST_TYPE_FIFO: - if (d->fsid == vn.vn_fsid) { - fsmatch = 1; - if ((unsigned)d->ino == vn.vn_fileid) { - filename = d->name; - break; - } - } - break; - case PS_FST_TYPE_SOCKET: - if (sock.dom_family == AF_UNIX) { - fsmatch = 1; - if (strcmp(((struct sockaddr_un *) - (&sock.sa_local))->sun_path, - d->name) == 0) { - filename = d->name; - break; - } + if (d->fsid == vn.vn_fsid) { + fsmatch = 1; + if ((unsigned)d->ino == vn.vn_fileid) { + filename = d->name; + break; } - break; } if (fsmatch == 0 || (filename == NULL && fsflg == 0)) return; From owner-svn-src-all@FreeBSD.ORG Mon Feb 27 18:10:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46F9D106566B; Mon, 27 Feb 2012 18:10:22 +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 1CC638FC1E; Mon, 27 Feb 2012 18:10:22 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id CA20446B3F; Mon, 27 Feb 2012 13:10:21 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 35D9AB967; Mon, 27 Feb 2012 13:10:21 -0500 (EST) From: John Baldwin To: Sergey Kandaurov Date: Mon, 27 Feb 2012 10:43:07 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201202221505.q1MF5JNt057163@svn.freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201202271043.07379.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 27 Feb 2012 13:10:21 -0500 (EST) Cc: Josh Paetzel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231999 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 18:10:22 -0000 On Sunday, February 26, 2012 6:51:21 am Sergey Kandaurov wrote: > On 22 February 2012 19:05, Josh Paetzel wrote: > > Author: jpaetzel > > Date: Wed Feb 22 15:05:19 2012 > > New Revision: 231999 > > URL: http://svn.freebsd.org/changeset/base/231999 > > > > Log: > > Fix various typos and normalize spelling. > [...] > > @@ -602,7 +602,7 @@ options FLOWTABLE > > options SCTP > > # There are bunches of options: > > # this one turns on all sorts of > > -# nastly printing that you can > > +# nastily printing that you can > > # do. It's all controlled by a > > # bit mask (settable by socket opt and > > # by sysctl). Including will not cause > > adj. nasty? Yeah, 'nastily printing' doesn't read well here and doesn't seem to be the intent. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Feb 27 18:10:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B80CA106577E; Mon, 27 Feb 2012 18:10:28 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 515EE8FC0A; Mon, 27 Feb 2012 18:10:28 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 097B346B4C; Mon, 27 Feb 2012 13:10:28 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 670DFB99E; Mon, 27 Feb 2012 13:10:27 -0500 (EST) From: John Baldwin To: Alexey Dokuchaev Date: Mon, 27 Feb 2012 12:12:43 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201202271608.q1RG8Iaj025685@svn.freebsd.org> <20120227162803.GA85675@FreeBSD.org> In-Reply-To: <20120227162803.GA85675@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="koi8-r" Content-Transfer-Encoding: 7bit Message-Id: <201202271212.43914.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 27 Feb 2012 13:10:27 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232218 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 18:10:28 -0000 On Monday, February 27, 2012 11:28:03 am Alexey Dokuchaev wrote: > On Mon, Feb 27, 2012 at 04:08:18PM +0000, John Baldwin wrote: > > Author: jhb > > Date: Mon Feb 27 16:08:18 2012 > > New Revision: 232218 > > URL: http://svn.freebsd.org/changeset/base/232218 > > > > Log: > > Clear the a device's description string anytime it's driver changes. > > Descriptions are specific to drivers and we don't change drivers on attached > > devices. This fixes a few places where we were not clearing the description > > when detaching a driver (e.g. with device_attach() failed). While here, fix > > a few other nits: > > - Remove spurious call to remove a device's driver from > > devclass_driver_deleted(). device_detach() removes it already. > > - Fix a typo. > > Thanks John, > > Please MFC it at least as far as RELENG_8. Oh, whoops, I forgot to add 'MFC after'. I will MFC it. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Feb 27 18:17:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D93801065670; Mon, 27 Feb 2012 18:17:03 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C83E18FC08; Mon, 27 Feb 2012 18:17:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1RIH3ro030855; Mon, 27 Feb 2012 18:17:03 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1RIH396030852; Mon, 27 Feb 2012 18:17:03 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201202271817.q1RIH396030852@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 27 Feb 2012 18:17:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232235 - stable/9/sys/dev/fb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Feb 2012 18:17:04 -0000 Author: jkim Date: Mon Feb 27 18:17:03 2012 New Revision: 232235 URL: http://svn.freebsd.org/changeset/base/232235 Log: MFC: r231841, r231842 Properly check VESA video mode number. Modified: stable/9/sys/dev/fb/vesa.c stable/9/sys/dev/fb/vesa.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/fb/vesa.c ============================================================================== --- stable/9/sys/dev/fb/vesa.c Mon Feb 27 17:41:23 2012 (r232234) +++ stable/9/sys/dev/fb/vesa.c Mon Feb 27 18:17:03 2012 (r232235) @@ -1311,7 +1311,9 @@ vesa_set_mode(video_adapter_t *adp, int if (!(info.vi_flags & V_INFO_GRAPHICS)) info.vi_flags &= ~V_INFO_LINEAR; - if (vesa_bios_set_mode(mode | ((info.vi_flags & V_INFO_LINEAR) ? 0x4000 : 0))) + if ((info.vi_flags & V_INFO_LINEAR) != 0) + mode |= 0x4000; + if (vesa_bios_set_mode(mode)) return (1); /* Palette format is reset by the above VBE function call. */ @@ -1329,7 +1331,7 @@ vesa_set_mode(video_adapter_t *adp, int #if VESA_DEBUG > 0 printf("VESA: mode set!\n"); #endif - vesa_adp->va_mode = mode; + vesa_adp->va_mode = mode & 0x1ff; /* Mode number is 9-bit. */ vesa_adp->va_flags &= ~V_ADP_COLOR; vesa_adp->va_flags |= (info.vi_flags & V_INFO_COLOR) ? V_ADP_COLOR : 0; Modified: stable/9/sys/dev/fb/vesa.h ============================================================================== --- stable/9/sys/dev/fb/vesa.h Mon Feb 27 17:41:23 2012 (r232234) +++ stable/9/sys/dev/fb/vesa.h Mon Feb 27 18:17:03 2012 (r232235) @@ -126,7 +126,7 @@ struct vesa_mode #ifdef _KERNEL -#define VESA_MODE(x) ((x) >= M_VESA_BASE) +#define VESA_MODE(x) ((x) >= M_VESA_BASE && (x) <= M_VESA_MODE_MAX) int vesa_load_ioctl(void); int vesa_unload_ioctl(void); From owner-svn-src-all@FreeBSD.ORG Mon Feb 27 18:28:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6EEC1065673; Mon, 27 Feb 2012 18:28:18 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C58998FC0C; Mon, 27 Feb 2012 18:28:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1RISI8h031359; Mon, 27 Feb 2012 18:28:18 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1RISIWB031357; Mon, 27 Feb 2012 18:28:18 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201202271828.q1RISIWB031357@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 27 Feb 2012 18:28:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232236 - stable/9/sys/dev/fb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 27 Feb 2012 18:28:19 -0000 Author: jkim Date: Mon Feb 27 18:28:18 2012 New Revision: 232236 URL: http://svn.freebsd.org/changeset/base/232236 Log: MFC: r231843, r232061, r232063, r232065, r232069 - Set the initial mode for the adapter after executing VESA BIOS POST. - Probe supported states for save/restore function. - Defer to VGA methods if no state is supported. Modified: stable/9/sys/dev/fb/vesa.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/fb/vesa.c ============================================================================== --- stable/9/sys/dev/fb/vesa.c Mon Feb 27 18:17:03 2012 (r232235) +++ stable/9/sys/dev/fb/vesa.c Mon Feb 27 18:28:18 2012 (r232236) @@ -1,6 +1,6 @@ /*- * Copyright (c) 1998 Kazutaka YOKOTA and Michael Smith - * Copyright (c) 2009-2010 Jung-uk Kim + * Copyright (c) 2009-2012 Jung-uk Kim * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -80,6 +80,7 @@ typedef struct adp_state adp_state_t; static struct mtx vesa_lock; +static int vesa_state; static void *vesa_state_buf = NULL; static uint32_t vesa_state_buf_offs = 0; static ssize_t vesa_state_buf_size = 0; @@ -205,13 +206,7 @@ static int vesa_bios_load_palette2(int s #define STATE_SIZE 0 #define STATE_SAVE 1 #define STATE_LOAD 2 -#define STATE_HW (1<<0) -#define STATE_DATA (1<<1) -#define STATE_DAC (1<<2) -#define STATE_REG (1<<3) -#define STATE_MOST (STATE_HW | STATE_DATA | STATE_REG) -#define STATE_ALL (STATE_HW | STATE_DATA | STATE_DAC | STATE_REG) -static ssize_t vesa_bios_state_buf_size(void); +static ssize_t vesa_bios_state_buf_size(int); static int vesa_bios_save_restore(int code, void *p); #ifdef MODE_TABLE_BROKEN static int vesa_bios_get_line_length(void); @@ -509,14 +504,14 @@ vesa_bios_load_palette2(int start, int c } static ssize_t -vesa_bios_state_buf_size(void) +vesa_bios_state_buf_size(int state) { x86regs_t regs; x86bios_init_regs(®s); regs.R_AX = 0x4f04; /* regs.R_DL = STATE_SIZE; */ - regs.R_CX = STATE_MOST; + regs.R_CX = state; x86bios_intr(®s, 0x10); @@ -537,7 +532,7 @@ vesa_bios_save_restore(int code, void *p x86bios_init_regs(®s); regs.R_AX = 0x4f04; regs.R_DL = code; - regs.R_CX = STATE_MOST; + regs.R_CX = vesa_state; regs.R_ES = X86BIOS_PHYSTOSEG(vesa_state_buf_offs); regs.R_BX = X86BIOS_PHYSTOOFF(vesa_state_buf_offs); @@ -1041,7 +1036,12 @@ vesa_bios_init(void) x86bios_free(vmbuf, sizeof(*buf)); - vesa_state_buf_size = vesa_bios_state_buf_size(); + /* Probe supported save/restore states. */ + for (i = 0; i < 4; i++) + if (vesa_bios_state_buf_size(1 << i) > 0) + vesa_state |= 1 << i; + if (vesa_state != 0) + vesa_state_buf_size = vesa_bios_state_buf_size(vesa_state); vesa_palette = x86bios_alloc(&vesa_palette_offs, VESA_PALETTE_SIZE + vesa_state_buf_size, M_WAITOK); if (vesa_state_buf_size > 0) { @@ -1451,15 +1451,13 @@ static int vesa_save_state(video_adapter_t *adp, void *p, size_t size) { - if (adp != vesa_adp) + if (adp != vesa_adp || vesa_state_buf_size == 0) return ((*prevvidsw->save_state)(adp, p, size)); - if (vesa_state_buf_size == 0) - return (1); if (size == 0) return (offsetof(adp_state_t, regs) + vesa_state_buf_size); if (size < (offsetof(adp_state_t, regs) + vesa_state_buf_size)) - return (1); + return (EINVAL); ((adp_state_t *)p)->sig = V_STATE_SIG; bzero(((adp_state_t *)p)->regs, vesa_state_buf_size); @@ -1469,18 +1467,20 @@ vesa_save_state(video_adapter_t *adp, vo static int vesa_load_state(video_adapter_t *adp, void *p) { + int mode; - if ((adp != vesa_adp) || (((adp_state_t *)p)->sig != V_STATE_SIG)) + if (adp != vesa_adp) return ((*prevvidsw->load_state)(adp, p)); - if (vesa_state_buf_size == 0) - return (1); - /* Try BIOS POST to restore a sane state. */ (void)vesa_bios_post(); - (void)int10_set_mode(adp->va_initial_bios_mode); - (void)vesa_set_mode(adp, adp->va_mode); + mode = adp->va_mode; + (void)vesa_set_mode(adp, adp->va_initial_mode); + if (mode != adp->va_initial_mode) + (void)vesa_set_mode(adp, mode); + if (((adp_state_t *)p)->sig != V_STATE_SIG) + return ((*prevvidsw->load_state)(adp, p)); return (vesa_bios_save_restore(STATE_LOAD, ((adp_state_t *)p)->regs)); } From owner-svn-src-all@FreeBSD.ORG Mon Feb 27 18:28:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BAD9F1065673; Mon, 27 Feb 2012 18:28: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 AAB098FC0A; Mon, 27 Feb 2012 18:28:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1RISVaf031400; Mon, 27 Feb 2012 18:28:31 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1RISVmf031398; Mon, 27 Feb 2012 18:28:31 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202271828.q1RISVmf031398@svn.freebsd.org> From: John Baldwin Date: Mon, 27 Feb 2012 18:28: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: r232237 - 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: Mon, 27 Feb 2012 18:28:31 -0000 Author: jhb Date: Mon Feb 27 18:28:31 2012 New Revision: 232237 URL: http://svn.freebsd.org/changeset/base/232237 Log: Typo. Modified: head/sys/sys/rman.h Modified: head/sys/sys/rman.h ============================================================================== --- head/sys/sys/rman.h Mon Feb 27 18:28:18 2012 (r232236) +++ head/sys/sys/rman.h Mon Feb 27 18:28:31 2012 (r232237) @@ -50,7 +50,7 @@ #define RF_ALIGNMENT_SHIFT 10 /* alignment size bit starts bit 10 */ #define RF_ALIGNMENT_MASK (0x003F << RF_ALIGNMENT_SHIFT) - /* resource address alignemnt size bit mask */ + /* resource address alignment size bit mask */ #define RF_ALIGNMENT_LOG2(x) ((x) << RF_ALIGNMENT_SHIFT) #define RF_ALIGNMENT(x) (((x) & RF_ALIGNMENT_MASK) >> RF_ALIGNMENT_SHIFT) From owner-svn-src-all@FreeBSD.ORG Mon Feb 27 19:05:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96AF41065670; Mon, 27 Feb 2012 19:05:02 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 838638FC24; Mon, 27 Feb 2012 19:05:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1RJ52tt032781; Mon, 27 Feb 2012 19:05:02 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1RJ52Se032771; Mon, 27 Feb 2012 19:05:02 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201202271905.q1RJ52Se032771@svn.freebsd.org> From: Luigi Rizzo Date: Mon, 27 Feb 2012 19:05: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: r232238 - in head: share/man/man4 sys/dev/e1000 sys/dev/ixgbe sys/dev/netmap sys/dev/re sys/net tools/tools/netmap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 19:05:02 -0000 Author: luigi Date: Mon Feb 27 19:05:01 2012 New Revision: 232238 URL: http://svn.freebsd.org/changeset/base/232238 Log: A bunch of netmap fixes: USERSPACE: 1. add support for devices with different number of rx and tx queues; 2. add better support for zero-copy operation, adding an extra field to the netmap ring to indicate how many buffers we have already processed but not yet released (with help from Eddie Kohler); 3. The two changes above unfortunately require an API change, so while at it add a version field and some spares to the ioctl() argument to help detect mismatches. 4. update the manual page for the two changes above; 5. update sample applications in tools/tools/netmap KERNEL: 1. simplify the internal structures moving the global wait queues to the 'struct netmap_adapter'; 2. simplify the functions that map kring<->nic ring indexes 3. normalize device-specific code, helps mainteinance; 4. start exploring the impact of micro-optimizations (prefetch etc.) in the ixgbe driver. Use 'legacy' descriptors on the tx ring and prefetch slots gives about 20% speedup at 900 MHz. Another 7-10% would come from removing the explict calls to bus_dmamap* in the core (they are effectively NOPs in this case, but it takes expensive load of the per-buffer dma maps to figure out that they are all NULL. Rx performance not investigated. I am postponing the MFC so i can import a few more improvements before merging. Modified: head/share/man/man4/netmap.4 head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_igb.c head/sys/dev/e1000/if_lem.c head/sys/dev/ixgbe/ixgbe.c head/sys/dev/netmap/if_em_netmap.h head/sys/dev/netmap/if_igb_netmap.h head/sys/dev/netmap/if_lem_netmap.h head/sys/dev/netmap/if_re_netmap.h head/sys/dev/netmap/ixgbe_netmap.h head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_kern.h head/sys/dev/re/if_re.c head/sys/net/netmap.h head/sys/net/netmap_user.h head/tools/tools/netmap/bridge.c head/tools/tools/netmap/pcap.c head/tools/tools/netmap/pkt-gen.c Modified: head/share/man/man4/netmap.4 ============================================================================== --- head/share/man/man4/netmap.4 Mon Feb 27 18:28:31 2012 (r232237) +++ head/share/man/man4/netmap.4 Mon Feb 27 19:05:01 2012 (r232238) @@ -28,7 +28,7 @@ .\" $FreeBSD$ .\" $Id: netmap.4 9662 2011-11-16 13:18:06Z luigi $: stable/8/share/man/man4/bpf.4 181694 2008-08-13 17:45:06Z ed $ .\" -.Dd November 16, 2011 +.Dd February 27, 2012 .Dt NETMAP 4 .Os .Sh NAME @@ -123,8 +123,9 @@ one ring pair (numbered N) for packets f struct netmap_ring { const ssize_t buf_ofs; const uint32_t num_slots; /* number of slots in the ring. */ - uint32_t avail; /* number of usable slots */ - uint32_t cur; /* 'current' index for the user side */ + uint32_t avail; /* number of usable slots */ + uint32_t cur; /* 'current' index for the user side */ + uint32_t reserved; /* not refilled before current */ const uint16_t nr_buf_size; uint16_t flags; @@ -173,10 +174,14 @@ defined as follows: .Bd -literal struct nmreq { char nr_name[IFNAMSIZ]; + uint32_t nr_version; /* API version */ +#define NETMAP_API 2 /* current version */ uint32_t nr_offset; /* nifp offset in the shared region */ uint32_t nr_memsize; /* size of the shared region */ - uint32_t nr_numdescs; /* descriptors per queue */ - uint16_t nr_numqueues; + uint32_t nr_tx_slots; /* slots in tx rings */ + uint32_t nr_rx_slots; /* slots in rx rings */ + uint16_t nr_tx_rings; /* number of tx rings */ + uint16_t nr_rx_rings; /* number of tx rings */ uint16_t nr_ringid; /* ring(s) we care about */ #define NETMAP_HW_RING 0x4000 /* low bits indicate one hw ring */ #define NETMAP_SW_RING 0x2000 /* we process the sw ring */ @@ -199,8 +204,10 @@ and are: returns information about the interface named in nr_name. On return, nr_memsize indicates the size of the shared netmap memory region (this is device-independent), -nr_numslots indicates how many buffers are in a ring, -nr_numrings indicates the number of rings supported by the hardware. +nr_tx_slots and nr_rx_slots indicates how many buffers are in a +transmit and receive ring, +nr_tx_rings and nr_rx_rings indicates the number of transmit +and receive rings supported by the hardware. .Pp If the device does not support netmap, the ioctl returns EINVAL. .It Dv NIOCREGIF @@ -266,6 +273,7 @@ struct netmap_request nmr; fd = open("/dev/netmap", O_RDWR); bzero(&nmr, sizeof(nmr)); strcpy(nmr.nm_name, "ix0"); +nmr.nm_version = NETMAP_API; ioctl(fd, NIOCREG, &nmr); p = mmap(0, nmr.memsize, fd); nifp = NETMAP_IF(p, nmr.offset); Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Mon Feb 27 18:28:31 2012 (r232237) +++ head/sys/dev/e1000/if_em.c Mon Feb 27 19:05:01 2012 (r232238) @@ -3296,7 +3296,7 @@ em_setup_transmit_ring(struct tx_ring *t } #ifdef DEV_NETMAP if (slot) { - int si = netmap_tidx_n2k(na, txr->me, i); + int si = netmap_idx_n2k(&na->tx_rings[txr->me], i); uint64_t paddr; void *addr; @@ -3759,7 +3759,7 @@ em_txeof(struct tx_ring *txr) selwakeuppri(&na->tx_rings[txr->me].si, PI_NET); EM_TX_UNLOCK(txr); EM_CORE_LOCK(adapter); - selwakeuppri(&na->tx_rings[na->num_queues + 1].si, PI_NET); + selwakeuppri(&na->tx_si, PI_NET); EM_CORE_UNLOCK(adapter); EM_TX_LOCK(txr); return (FALSE); @@ -4051,7 +4051,7 @@ em_setup_receive_ring(struct rx_ring *rx rxbuf = &rxr->rx_buffers[j]; #ifdef DEV_NETMAP if (slot) { - int si = netmap_ridx_n2k(na, rxr->me, j); + int si = netmap_idx_n2k(&na->rx_rings[rxr->me], j); uint64_t paddr; void *addr; @@ -4370,10 +4370,11 @@ em_rxeof(struct rx_ring *rxr, int count, if (ifp->if_capenable & IFCAP_NETMAP) { struct netmap_adapter *na = NA(ifp); + na->rx_rings[rxr->me].nr_kflags |= NKR_PENDINTR; selwakeuppri(&na->rx_rings[rxr->me].si, PI_NET); EM_RX_UNLOCK(rxr); EM_CORE_LOCK(adapter); - selwakeuppri(&na->rx_rings[na->num_queues + 1].si, PI_NET); + selwakeuppri(&na->rx_si, PI_NET); EM_CORE_UNLOCK(adapter); return (0); } Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Mon Feb 27 18:28:31 2012 (r232237) +++ head/sys/dev/e1000/if_igb.c Mon Feb 27 19:05:01 2012 (r232238) @@ -3315,7 +3315,7 @@ igb_setup_transmit_ring(struct tx_ring * } #ifdef DEV_NETMAP if (slot) { - int si = netmap_tidx_n2k(na, txr->me, i); + int si = netmap_idx_n2k(&na->tx_rings[txr->me], i); /* no need to set the address */ netmap_load_map(txr->txtag, txbuf->map, NMB(slot + si)); } @@ -3693,7 +3693,7 @@ igb_txeof(struct tx_ring *txr) selwakeuppri(&na->tx_rings[txr->me].si, PI_NET); IGB_TX_UNLOCK(txr); IGB_CORE_LOCK(adapter); - selwakeuppri(&na->tx_rings[na->num_queues + 1].si, PI_NET); + selwakeuppri(&na->tx_si, PI_NET); IGB_CORE_UNLOCK(adapter); IGB_TX_LOCK(txr); return FALSE; @@ -4057,7 +4057,7 @@ igb_setup_receive_ring(struct rx_ring *r #ifdef DEV_NETMAP if (slot) { /* slot sj is mapped to the i-th NIC-ring entry */ - int sj = netmap_ridx_n2k(na, rxr->me, j); + int sj = netmap_idx_n2k(&na->rx_rings[rxr->me], j); uint64_t paddr; void *addr; @@ -4554,10 +4554,11 @@ igb_rxeof(struct igb_queue *que, int cou if (ifp->if_capenable & IFCAP_NETMAP) { struct netmap_adapter *na = NA(ifp); + na->rx_rings[rxr->me].nr_kflags |= NKR_PENDINTR; selwakeuppri(&na->rx_rings[rxr->me].si, PI_NET); IGB_RX_UNLOCK(rxr); IGB_CORE_LOCK(adapter); - selwakeuppri(&na->rx_rings[na->num_queues + 1].si, PI_NET); + selwakeuppri(&na->rx_si, PI_NET); IGB_CORE_UNLOCK(adapter); return (0); } Modified: head/sys/dev/e1000/if_lem.c ============================================================================== --- head/sys/dev/e1000/if_lem.c Mon Feb 27 18:28:31 2012 (r232237) +++ head/sys/dev/e1000/if_lem.c Mon Feb 27 19:05:01 2012 (r232238) @@ -2669,7 +2669,7 @@ lem_setup_transmit_structures(struct ada #ifdef DEV_NETMAP if (slot) { /* the i-th NIC entry goes to slot si */ - int si = netmap_tidx_n2k(na, 0, i); + int si = netmap_idx_n2k(&na->tx_rings[0], i); uint64_t paddr; void *addr; @@ -3243,7 +3243,7 @@ lem_setup_receive_structures(struct adap #ifdef DEV_NETMAP if (slot) { /* the i-th NIC entry goes to slot si */ - int si = netmap_ridx_n2k(na, 0, i); + int si = netmap_idx_n2k(&na->rx_rings[0], i); uint64_t paddr; void *addr; @@ -3475,7 +3475,9 @@ lem_rxeof(struct adapter *adapter, int c #ifdef DEV_NETMAP if (ifp->if_capenable & IFCAP_NETMAP) { - selwakeuppri(&NA(ifp)->rx_rings[0].si, PI_NET); + struct netmap_adapter *na = NA(ifp); + na->rx_rings[0].nr_kflags |= NKR_PENDINTR; + selwakeuppri(&na->rx_rings[0].si, PI_NET); EM_RX_UNLOCK(adapter); return (0); } Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Mon Feb 27 18:28:31 2012 (r232237) +++ head/sys/dev/ixgbe/ixgbe.c Mon Feb 27 19:05:01 2012 (r232238) @@ -2970,10 +2970,10 @@ ixgbe_setup_transmit_ring(struct tx_ring * kring->nkr_hwofs positions "ahead" wrt the * corresponding slot in the NIC ring. In some drivers * (not here) nkr_hwofs can be negative. Function - * netmap_tidx_n2k() handles wraparounds properly. + * netmap_idx_n2k() handles wraparounds properly. */ if (slot) { - int si = netmap_tidx_n2k(na, txr->me, i); + int si = netmap_idx_n2k(&na->tx_rings[txr->me], i); netmap_load_map(txr->txtag, txbuf->map, NMB(slot + si)); } #endif /* DEV_NETMAP */ @@ -3491,7 +3491,7 @@ ixgbe_txeof(struct tx_ring *txr) selwakeuppri(&na->tx_rings[txr->me].si, PI_NET); IXGBE_TX_UNLOCK(txr); IXGBE_CORE_LOCK(adapter); - selwakeuppri(&na->tx_rings[na->num_queues + 1].si, PI_NET); + selwakeuppri(&na->tx_si, PI_NET); IXGBE_CORE_UNLOCK(adapter); IXGBE_TX_LOCK(txr); } @@ -3922,7 +3922,7 @@ ixgbe_setup_receive_ring(struct rx_ring * an mbuf, so end the block with a continue; */ if (slot) { - int sj = netmap_ridx_n2k(na, rxr->me, j); + int sj = netmap_idx_n2k(&na->rx_rings[rxr->me], j); uint64_t paddr; void *addr; @@ -4376,7 +4376,7 @@ ixgbe_rxeof(struct ix_queue *que, int co selwakeuppri(&na->rx_rings[rxr->me].si, PI_NET); IXGBE_RX_UNLOCK(rxr); IXGBE_CORE_LOCK(adapter); - selwakeuppri(&na->rx_rings[na->num_queues + 1].si, PI_NET); + selwakeuppri(&na->rx_si, PI_NET); IXGBE_CORE_UNLOCK(adapter); return (FALSE); } Modified: head/sys/dev/netmap/if_em_netmap.h ============================================================================== --- head/sys/dev/netmap/if_em_netmap.h Mon Feb 27 18:28:31 2012 (r232237) +++ head/sys/dev/netmap/if_em_netmap.h Mon Feb 27 19:05:01 2012 (r232238) @@ -25,45 +25,23 @@ /* * $FreeBSD$ - * $Id: if_em_netmap.h 9802 2011-12-02 18:42:37Z luigi $ + * $Id: if_em_netmap.h 10627 2012-02-23 19:37:15Z luigi $ * - * netmap support for if_em.c + * netmap support for em. * - * For structure and details on the individual functions please see - * ixgbe_netmap.h + * For more details on netmap support please see ixgbe_netmap.h */ + #include #include #include #include /* vtophys ? */ #include + static void em_netmap_block_tasks(struct adapter *); static void em_netmap_unblock_tasks(struct adapter *); -static int em_netmap_reg(struct ifnet *, int onoff); -static int em_netmap_txsync(struct ifnet *, u_int, int); -static int em_netmap_rxsync(struct ifnet *, u_int, int); -static void em_netmap_lock_wrapper(struct ifnet *, int, u_int); - - -static void -em_netmap_attach(struct adapter *adapter) -{ - struct netmap_adapter na; - - bzero(&na, sizeof(na)); - - na.ifp = adapter->ifp; - na.separate_locks = 1; - na.num_tx_desc = adapter->num_tx_desc; - na.num_rx_desc = adapter->num_rx_desc; - na.nm_txsync = em_netmap_txsync; - na.nm_rxsync = em_netmap_rxsync; - na.nm_lock = em_netmap_lock_wrapper; - na.nm_register = em_netmap_reg; - netmap_attach(&na, adapter->num_queues); -} static void @@ -137,7 +115,7 @@ em_netmap_unblock_tasks(struct adapter * /* - * register-unregister routine + * Register/unregister routine */ static int em_netmap_reg(struct ifnet *ifp, int onoff) @@ -180,17 +158,17 @@ fail: /* - * Reconcile hardware and user view of the transmit ring. + * Reconcile kernel and user view of the transmit ring. */ static int em_netmap_txsync(struct ifnet *ifp, u_int ring_nr, int do_lock) { struct adapter *adapter = ifp->if_softc; struct tx_ring *txr = &adapter->tx_rings[ring_nr]; - struct netmap_adapter *na = NA(adapter->ifp); + struct netmap_adapter *na = NA(ifp); struct netmap_kring *kring = &na->tx_rings[ring_nr]; struct netmap_ring *ring = kring->ring; - int j, k, l, n = 0, lim = kring->nkr_num_slots - 1; + u_int j, k, l, n = 0, lim = kring->nkr_num_slots - 1; /* generate an interrupt approximately every half ring */ int report_frequency = kring->nkr_num_slots >> 1; @@ -204,16 +182,17 @@ em_netmap_txsync(struct ifnet *ifp, u_in bus_dmamap_sync(txr->txdma.dma_tag, txr->txdma.dma_map, BUS_DMASYNC_POSTREAD); - /* check for new packets to send. - * j indexes the netmap ring, l indexes the nic ring, and - * j = kring->nr_hwcur, l = E1000_TDT (not tracked), - * j == (l + kring->nkr_hwofs) % ring_size + /* + * Process new packets to send. j is the current index in the + * netmap ring, l is the corresponding index in the NIC ring. */ j = kring->nr_hwcur; - if (j != k) { /* we have packets to send */ - l = netmap_tidx_k2n(na, ring_nr, j); + if (j != k) { /* we have new packets to send */ + l = netmap_idx_k2n(kring, j); for (n = 0; j != k; n++) { + /* slot is the current slot in the netmap ring */ struct netmap_slot *slot = &ring->slot[j]; + /* curr is the current slot in the nic ring */ struct e1000_tx_desc *curr = &txr->tx_base[l]; struct em_buffer *txbuf = &txr->tx_buffers[l]; int flags = ((slot->flags & NS_REPORT) || @@ -221,7 +200,7 @@ em_netmap_txsync(struct ifnet *ifp, u_in E1000_TXD_CMD_RS : 0; uint64_t paddr; void *addr = PNMB(slot, &paddr); - int len = slot->len; + u_int len = slot->len; if (addr == netmap_buffer_base || len > NETMAP_BUF_SIZE) { if (do_lock) @@ -230,25 +209,21 @@ em_netmap_txsync(struct ifnet *ifp, u_in } slot->flags &= ~NS_REPORT; - curr->upper.data = 0; - curr->lower.data = - htole32(adapter->txd_cmd | len | - (E1000_TXD_CMD_EOP | flags) ); if (slot->flags & NS_BUF_CHANGED) { curr->buffer_addr = htole64(paddr); /* buffer has changed, reload map */ netmap_reload_map(txr->txtag, txbuf->map, addr); slot->flags &= ~NS_BUF_CHANGED; } - + curr->upper.data = 0; + curr->lower.data = htole32(adapter->txd_cmd | len | + (E1000_TXD_CMD_EOP | flags) ); bus_dmamap_sync(txr->txtag, txbuf->map, BUS_DMASYNC_PREWRITE); j = (j == lim) ? 0 : j + 1; l = (l == lim) ? 0 : l + 1; } - kring->nr_hwcur = k; - - /* decrease avail by number of sent packets */ + kring->nr_hwcur = k; /* the saved ring->cur */ kring->nr_hwavail -= n; bus_dmamap_sync(txr->txdma.dma_tag, txr->txdma.dma_map, @@ -275,7 +250,7 @@ em_netmap_txsync(struct ifnet *ifp, u_in kring->nr_hwavail += delta; } } - /* update avail to what the hardware knows */ + /* update avail to what the kernel knows */ ring->avail = kring->nr_hwavail; if (do_lock) @@ -292,10 +267,12 @@ em_netmap_rxsync(struct ifnet *ifp, u_in { struct adapter *adapter = ifp->if_softc; struct rx_ring *rxr = &adapter->rx_rings[ring_nr]; - struct netmap_adapter *na = NA(adapter->ifp); + struct netmap_adapter *na = NA(ifp); struct netmap_kring *kring = &na->rx_rings[ring_nr]; struct netmap_ring *ring = kring->ring; - int j, k, l, n, lim = kring->nkr_num_slots - 1; + u_int j, l, n, lim = kring->nkr_num_slots - 1; + int force_update = do_lock || kring->nr_kflags & NKR_PENDINTR; + u_int k = ring->cur, resvd = ring->reserved; k = ring->cur; if (k > lim) @@ -308,37 +285,45 @@ em_netmap_rxsync(struct ifnet *ifp, u_in bus_dmamap_sync(rxr->rxdma.dma_tag, rxr->rxdma.dma_map, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); - /* import newly received packets into the netmap ring. - * j is an index in the netmap ring, l in the NIC ring, and - * j = (kring->nr_hwcur + kring->nr_hwavail) % ring_size - * l = rxr->next_to_check; - * and - * j == (l + kring->nkr_hwofs) % ring_size + /* + * Import newly received packets into the netmap ring. + * j is an index in the netmap ring, l in the NIC ring. */ l = rxr->next_to_check; - j = netmap_ridx_n2k(na, ring_nr, l); - for (n = 0; ; n++) { - struct e1000_rx_desc *curr = &rxr->rx_base[l]; - - if ((curr->status & E1000_RXD_STAT_DD) == 0) - break; - ring->slot[j].len = le16toh(curr->length); - bus_dmamap_sync(rxr->rxtag, rxr->rx_buffers[l].map, - BUS_DMASYNC_POSTREAD); - j = (j == lim) ? 0 : j + 1; - /* make sure next_to_refresh follows next_to_check */ - rxr->next_to_refresh = l; // XXX - l = (l == lim) ? 0 : l + 1; - } - if (n) { - rxr->next_to_check = l; - kring->nr_hwavail += n; + j = netmap_idx_n2k(kring, l); + if (netmap_no_pendintr || force_update) { + for (n = 0; ; n++) { + struct e1000_rx_desc *curr = &rxr->rx_base[l]; + uint32_t staterr = le32toh(curr->status); + + if ((staterr & E1000_RXD_STAT_DD) == 0) + break; + ring->slot[j].len = le16toh(curr->length); + bus_dmamap_sync(rxr->rxtag, rxr->rx_buffers[l].map, + BUS_DMASYNC_POSTREAD); + j = (j == lim) ? 0 : j + 1; + /* make sure next_to_refresh follows next_to_check */ + rxr->next_to_refresh = l; // XXX + l = (l == lim) ? 0 : l + 1; + } + if (n) { /* update the state variables */ + rxr->next_to_check = l; + kring->nr_hwavail += n; + } + kring->nr_kflags &= ~NKR_PENDINTR; } - /* skip past packets that userspace has already processed */ + /* skip past packets that userspace has released */ j = kring->nr_hwcur; /* netmap ring index */ - if (j != k) { /* userspace has read some packets. */ - l = netmap_ridx_k2n(na, ring_nr, j); /* NIC ring index */ + if (resvd > 0) { + if (resvd + ring->avail >= lim + 1) { + D("XXX invalid reserve/avail %d %d", resvd, ring->avail); + ring->reserved = resvd = 0; // XXX panic... + } + k = (k >= resvd) ? k - resvd : k + lim + 1 - resvd; + } + if (j != k) { /* userspace has released some packets. */ + l = netmap_idx_k2n(kring, j); /* NIC ring index */ for (n = 0; j != k; n++) { struct netmap_slot *slot = &ring->slot[j]; struct e1000_rx_desc *curr = &rxr->rx_base[l]; @@ -352,17 +337,15 @@ em_netmap_rxsync(struct ifnet *ifp, u_in return netmap_ring_reinit(kring); } - curr->status = 0; if (slot->flags & NS_BUF_CHANGED) { curr->buffer_addr = htole64(paddr); /* buffer has changed, reload map */ netmap_reload_map(rxr->rxtag, rxbuf->map, addr); slot->flags &= ~NS_BUF_CHANGED; } - + curr->status = 0; bus_dmamap_sync(rxr->rxtag, rxbuf->map, BUS_DMASYNC_PREREAD); - j = (j == lim) ? 0 : j + 1; l = (l == lim) ? 0 : l + 1; } @@ -378,9 +361,29 @@ em_netmap_rxsync(struct ifnet *ifp, u_in E1000_WRITE_REG(&adapter->hw, E1000_RDT(rxr->me), l); } /* tell userspace that there are new packets */ - ring->avail = kring->nr_hwavail ; + ring->avail = kring->nr_hwavail - resvd; if (do_lock) EM_RX_UNLOCK(rxr); return 0; } + + +static void +em_netmap_attach(struct adapter *adapter) +{ + struct netmap_adapter na; + + bzero(&na, sizeof(na)); + + na.ifp = adapter->ifp; + na.separate_locks = 1; + na.num_tx_desc = adapter->num_tx_desc; + na.num_rx_desc = adapter->num_rx_desc; + na.nm_txsync = em_netmap_txsync; + na.nm_rxsync = em_netmap_rxsync; + na.nm_lock = em_netmap_lock_wrapper; + na.nm_register = em_netmap_reg; + netmap_attach(&na, adapter->num_queues); +} + /* end of file */ Modified: head/sys/dev/netmap/if_igb_netmap.h ============================================================================== --- head/sys/dev/netmap/if_igb_netmap.h Mon Feb 27 18:28:31 2012 (r232237) +++ head/sys/dev/netmap/if_igb_netmap.h Mon Feb 27 19:05:01 2012 (r232238) @@ -25,41 +25,19 @@ /* * $FreeBSD$ - * $Id: if_igb_netmap.h 9802 2011-12-02 18:42:37Z luigi $ + * $Id: if_igb_netmap.h 10627 2012-02-23 19:37:15Z luigi $ * - * netmap modifications for igb contributed by Ahmed Kooli + * Netmap support for igb, partly contributed by Ahmed Kooli + * For details on netmap support please see ixgbe_netmap.h */ + #include #include #include #include /* vtophys ? */ #include -static int igb_netmap_reg(struct ifnet *, int onoff); -static int igb_netmap_txsync(struct ifnet *, u_int, int); -static int igb_netmap_rxsync(struct ifnet *, u_int, int); -static void igb_netmap_lock_wrapper(struct ifnet *, int, u_int); - - -static void -igb_netmap_attach(struct adapter *adapter) -{ - struct netmap_adapter na; - - bzero(&na, sizeof(na)); - - na.ifp = adapter->ifp; - na.separate_locks = 1; - na.num_tx_desc = adapter->num_tx_desc; - na.num_rx_desc = adapter->num_rx_desc; - na.nm_txsync = igb_netmap_txsync; - na.nm_rxsync = igb_netmap_rxsync; - na.nm_lock = igb_netmap_lock_wrapper; - na.nm_register = igb_netmap_reg; - netmap_attach(&na, adapter->num_queues); -} - /* * wrapper to export locks to the generic code @@ -134,17 +112,17 @@ fail: /* - * Reconcile hardware and user view of the transmit ring. + * Reconcile kernel and user view of the transmit ring. */ static int igb_netmap_txsync(struct ifnet *ifp, u_int ring_nr, int do_lock) { struct adapter *adapter = ifp->if_softc; struct tx_ring *txr = &adapter->tx_rings[ring_nr]; - struct netmap_adapter *na = NA(adapter->ifp); + struct netmap_adapter *na = NA(ifp); struct netmap_kring *kring = &na->tx_rings[ring_nr]; struct netmap_ring *ring = kring->ring; - int j, k, l, n = 0, lim = kring->nkr_num_slots - 1; + u_int j, k, l, n = 0, lim = kring->nkr_num_slots - 1; /* generate an interrupt approximately every half ring */ int report_frequency = kring->nkr_num_slots >> 1; @@ -164,14 +142,16 @@ igb_netmap_txsync(struct ifnet *ifp, u_i * j == (l + kring->nkr_hwofs) % ring_size */ j = kring->nr_hwcur; - if (j != k) { /* we have packets to send */ + if (j != k) { /* we have new packets to send */ /* 82575 needs the queue index added */ u32 olinfo_status = (adapter->hw.mac.type == e1000_82575) ? (txr->me << 4) : 0; - l = netmap_tidx_k2n(na, ring_nr, j); + l = netmap_idx_k2n(kring, j); for (n = 0; j != k; n++) { + /* slot is the current slot in the netmap ring */ struct netmap_slot *slot = &ring->slot[j]; + /* curr is the current slot in the nic ring */ union e1000_adv_tx_desc *curr = (union e1000_adv_tx_desc *)&txr->tx_base[l]; struct igb_tx_buffer *txbuf = &txr->tx_buffers[l]; @@ -180,7 +160,7 @@ igb_netmap_txsync(struct ifnet *ifp, u_i E1000_ADVTXD_DCMD_RS : 0; uint64_t paddr; void *addr = PNMB(slot, &paddr); - int len = slot->len; + u_int len = slot->len; if (addr == netmap_buffer_base || len > NETMAP_BUF_SIZE) { if (do_lock) @@ -189,8 +169,13 @@ igb_netmap_txsync(struct ifnet *ifp, u_i } slot->flags &= ~NS_REPORT; - // XXX set the address unconditionally + if (slot->flags & NS_BUF_CHANGED) { + /* buffer has changed, reload map */ + netmap_reload_map(txr->txtag, txbuf->map, addr); + slot->flags &= ~NS_BUF_CHANGED; + } curr->read.buffer_addr = htole64(paddr); + // XXX check olinfo and cmd_type_len curr->read.olinfo_status = htole32(olinfo_status | (len<< E1000_ADVTXD_PAYLEN_SHIFT)); @@ -199,20 +184,13 @@ igb_netmap_txsync(struct ifnet *ifp, u_i E1000_ADVTXD_DCMD_IFCS | E1000_ADVTXD_DCMD_DEXT | E1000_ADVTXD_DCMD_EOP | flags); - if (slot->flags & NS_BUF_CHANGED) { - /* buffer has changed, reload map */ - netmap_reload_map(txr->txtag, txbuf->map, addr); - slot->flags &= ~NS_BUF_CHANGED; - } bus_dmamap_sync(txr->txtag, txbuf->map, BUS_DMASYNC_PREWRITE); j = (j == lim) ? 0 : j + 1; l = (l == lim) ? 0 : l + 1; } - kring->nr_hwcur = k; - - /* decrease avail by number of sent packets */ + kring->nr_hwcur = k; /* the saved ring->cur */ kring->nr_hwavail -= n; /* Set the watchdog XXX ? */ @@ -243,7 +221,7 @@ igb_netmap_txsync(struct ifnet *ifp, u_i kring->nr_hwavail += delta; } } - /* update avail to what the hardware knows */ + /* update avail to what the kernel knows */ ring->avail = kring->nr_hwavail; if (do_lock) @@ -260,10 +238,12 @@ igb_netmap_rxsync(struct ifnet *ifp, u_i { struct adapter *adapter = ifp->if_softc; struct rx_ring *rxr = &adapter->rx_rings[ring_nr]; - struct netmap_adapter *na = NA(adapter->ifp); + struct netmap_adapter *na = NA(ifp); struct netmap_kring *kring = &na->rx_rings[ring_nr]; struct netmap_ring *ring = kring->ring; - int j, k, l, n, lim = kring->nkr_num_slots - 1; + u_int j, l, n, lim = kring->nkr_num_slots - 1; + int force_update = do_lock || kring->nr_kflags & NKR_PENDINTR; + u_int k = ring->cur, resvd = ring->reserved; k = ring->cur; if (k > lim) @@ -276,36 +256,43 @@ igb_netmap_rxsync(struct ifnet *ifp, u_i bus_dmamap_sync(rxr->rxdma.dma_tag, rxr->rxdma.dma_map, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); - /* import newly received packets into the netmap ring. - * j is an index in the netmap ring, l in the NIC ring, and - * j = (kring->nr_hwcur + kring->nr_hwavail) % ring_size - * l = rxr->next_to_check; - * and - * j == (l + kring->nkr_hwofs) % ring_size + /* + * import newly received packets into the netmap ring. + * j is an index in the netmap ring, l in the NIC ring. */ l = rxr->next_to_check; - j = netmap_ridx_n2k(na, ring_nr, l); - for (n = 0; ; n++) { - union e1000_adv_rx_desc *curr = &rxr->rx_base[l]; - uint32_t staterr = le32toh(curr->wb.upper.status_error); - - if ((staterr & E1000_RXD_STAT_DD) == 0) - break; - ring->slot[j].len = le16toh(curr->wb.upper.length); - bus_dmamap_sync(rxr->ptag, - rxr->rx_buffers[l].pmap, BUS_DMASYNC_POSTREAD); - j = (j == lim) ? 0 : j + 1; - l = (l == lim) ? 0 : l + 1; - } - if (n) { - rxr->next_to_check = l; - kring->nr_hwavail += n; + j = netmap_idx_n2k(kring, l); + if (netmap_no_pendintr || force_update) { + for (n = 0; ; n++) { + union e1000_adv_rx_desc *curr = &rxr->rx_base[l]; + uint32_t staterr = le32toh(curr->wb.upper.status_error); + + if ((staterr & E1000_RXD_STAT_DD) == 0) + break; + ring->slot[j].len = le16toh(curr->wb.upper.length); + bus_dmamap_sync(rxr->ptag, + rxr->rx_buffers[l].pmap, BUS_DMASYNC_POSTREAD); + j = (j == lim) ? 0 : j + 1; + l = (l == lim) ? 0 : l + 1; + } + if (n) { /* update the state variables */ + rxr->next_to_check = l; + kring->nr_hwavail += n; + } + kring->nr_kflags &= ~NKR_PENDINTR; } - /* skip past packets that userspace has already processed */ - j = kring->nr_hwcur; - if (j != k) { /* userspace has read some packets. */ - l = netmap_ridx_k2n(na, ring_nr, j); + /* skip past packets that userspace has released */ + j = kring->nr_hwcur; /* netmap ring index */ + if (resvd > 0) { + if (resvd + ring->avail >= lim + 1) { + D("XXX invalid reserve/avail %d %d", resvd, ring->avail); + ring->reserved = resvd = 0; // XXX panic... + } + k = (k >= resvd) ? k - resvd : k + lim + 1 - resvd; + } + if (j != k) { /* userspace has released some packets. */ + l = netmap_idx_k2n(kring, j); for (n = 0; j != k; n++) { struct netmap_slot *slot = ring->slot + j; union e1000_adv_rx_desc *curr = &rxr->rx_base[l]; @@ -319,16 +306,14 @@ igb_netmap_rxsync(struct ifnet *ifp, u_i return netmap_ring_reinit(kring); } - curr->wb.upper.status_error = 0; - curr->read.pkt_addr = htole64(paddr); if (slot->flags & NS_BUF_CHANGED) { netmap_reload_map(rxr->ptag, rxbuf->pmap, addr); slot->flags &= ~NS_BUF_CHANGED; } - + curr->read.pkt_addr = htole64(paddr); + curr->wb.upper.status_error = 0; bus_dmamap_sync(rxr->ptag, rxbuf->pmap, BUS_DMASYNC_PREREAD); - j = (j == lim) ? 0 : j + 1; l = (l == lim) ? 0 : l + 1; } @@ -344,9 +329,28 @@ igb_netmap_rxsync(struct ifnet *ifp, u_i E1000_WRITE_REG(&adapter->hw, E1000_RDT(rxr->me), l); } /* tell userspace that there are new packets */ - ring->avail = kring->nr_hwavail ; + ring->avail = kring->nr_hwavail - resvd; if (do_lock) IGB_RX_UNLOCK(rxr); return 0; } + + +static void +igb_netmap_attach(struct adapter *adapter) +{ + struct netmap_adapter na; + + bzero(&na, sizeof(na)); + + na.ifp = adapter->ifp; + na.separate_locks = 1; + na.num_tx_desc = adapter->num_tx_desc; + na.num_rx_desc = adapter->num_rx_desc; + na.nm_txsync = igb_netmap_txsync; + na.nm_rxsync = igb_netmap_rxsync; + na.nm_lock = igb_netmap_lock_wrapper; + na.nm_register = igb_netmap_reg; + netmap_attach(&na, adapter->num_queues); +} /* end of file */ Modified: head/sys/dev/netmap/if_lem_netmap.h ============================================================================== --- head/sys/dev/netmap/if_lem_netmap.h Mon Feb 27 18:28:31 2012 (r232237) +++ head/sys/dev/netmap/if_lem_netmap.h Mon Feb 27 19:05:01 2012 (r232238) @@ -23,14 +23,14 @@ * SUCH DAMAGE. */ + /* * $FreeBSD$ - * $Id: if_lem_netmap.h 9802 2011-12-02 18:42:37Z luigi $ + * $Id: if_lem_netmap.h 10627 2012-02-23 19:37:15Z luigi $ * - * netmap support for if_lem.c + * netmap support for "lem" * - * For structure and details on the individual functions please see - * ixgbe_netmap.h + * For details on netmap support please see ixgbe_netmap.h */ #include @@ -39,30 +39,6 @@ #include /* vtophys ? */ #include -static int lem_netmap_reg(struct ifnet *, int onoff); -static int lem_netmap_txsync(struct ifnet *, u_int, int); -static int lem_netmap_rxsync(struct ifnet *, u_int, int); -static void lem_netmap_lock_wrapper(struct ifnet *, int, u_int); - - -static void -lem_netmap_attach(struct adapter *adapter) -{ - struct netmap_adapter na; - - bzero(&na, sizeof(na)); - - na.ifp = adapter->ifp; - na.separate_locks = 1; - na.num_tx_desc = adapter->num_tx_desc; - na.num_rx_desc = adapter->num_rx_desc; - na.nm_txsync = lem_netmap_txsync; - na.nm_rxsync = lem_netmap_rxsync; - na.nm_lock = lem_netmap_lock_wrapper; - na.nm_register = lem_netmap_reg; - netmap_attach(&na, 1); -} - static void lem_netmap_lock_wrapper(struct ifnet *ifp, int what, u_int ringid) @@ -94,7 +70,7 @@ lem_netmap_lock_wrapper(struct ifnet *if /* - * register-unregister routine + * Register/unregister */ static int lem_netmap_reg(struct ifnet *ifp, int onoff) @@ -104,7 +80,7 @@ lem_netmap_reg(struct ifnet *ifp, int on int error = 0; if (na == NULL) - return EINVAL; /* no netmap support here */ + return EINVAL; lem_disable_intr(adapter); @@ -144,20 +120,21 @@ fail: /* - * Reconcile hardware and user view of the transmit ring. + * Reconcile kernel and user view of the transmit ring. */ static int lem_netmap_txsync(struct ifnet *ifp, u_int ring_nr, int do_lock) { struct adapter *adapter = ifp->if_softc; - struct netmap_adapter *na = NA(adapter->ifp); + struct netmap_adapter *na = NA(ifp); struct netmap_kring *kring = &na->tx_rings[ring_nr]; struct netmap_ring *ring = kring->ring; - int j, k, l, n = 0, lim = kring->nkr_num_slots - 1; + u_int j, k, l, n = 0, lim = kring->nkr_num_slots - 1; /* generate an interrupt approximately every half ring */ int report_frequency = kring->nkr_num_slots >> 1; + /* take a copy of ring->cur now, and never read it again */ k = ring->cur; if (k > lim) return netmap_ring_reinit(kring); @@ -166,17 +143,17 @@ lem_netmap_txsync(struct ifnet *ifp, u_i EM_TX_LOCK(adapter); bus_dmamap_sync(adapter->txdma.dma_tag, adapter->txdma.dma_map, BUS_DMASYNC_POSTREAD); - - /* check for new packets to send. - * j indexes the netmap ring, l indexes the nic ring, and - * j = kring->nr_hwcur, l = E1000_TDT (not tracked), - * j == (l + kring->nkr_hwofs) % ring_size + /* + * Process new packets to send. j is the current index in the + * netmap ring, l is the corresponding index in the NIC ring. */ j = kring->nr_hwcur; - if (j != k) { /* we have packets to send */ - l = netmap_tidx_k2n(na, ring_nr, j); + if (j != k) { /* we have new packets to send */ + l = netmap_idx_k2n(kring, j); for (n = 0; j != k; n++) { + /* slot is the current slot in the netmap ring */ struct netmap_slot *slot = &ring->slot[j]; + /* curr is the current slot in the nic ring */ struct e1000_tx_desc *curr = &adapter->tx_desc_base[l]; struct em_buffer *txbuf = &adapter->tx_buffer_area[l]; int flags = ((slot->flags & NS_REPORT) || @@ -184,7 +161,7 @@ lem_netmap_txsync(struct ifnet *ifp, u_i E1000_TXD_CMD_RS : 0; uint64_t paddr; void *addr = PNMB(slot, &paddr); - int len = slot->len; + u_int len = slot->len; if (addr == netmap_buffer_base || len > NETMAP_BUF_SIZE) { if (do_lock) @@ -193,25 +170,23 @@ lem_netmap_txsync(struct ifnet *ifp, u_i } slot->flags &= ~NS_REPORT; - curr->upper.data = 0; - curr->lower.data = - htole32( adapter->txd_cmd | len | - (E1000_TXD_CMD_EOP | flags) ); if (slot->flags & NS_BUF_CHANGED) { - curr->buffer_addr = htole64(paddr); /* buffer has changed, reload map */ netmap_reload_map(adapter->txtag, txbuf->map, addr); + curr->buffer_addr = htole64(paddr); slot->flags &= ~NS_BUF_CHANGED; } + curr->upper.data = 0; + curr->lower.data = + htole32( adapter->txd_cmd | len | + (E1000_TXD_CMD_EOP | flags) ); bus_dmamap_sync(adapter->txtag, txbuf->map, BUS_DMASYNC_PREWRITE); j = (j == lim) ? 0 : j + 1; l = (l == lim) ? 0 : l + 1; } - kring->nr_hwcur = k; - - /* decrease avail by number of sent packets */ + kring->nr_hwcur = k; /* the saved ring->cur */ kring->nr_hwavail -= n; bus_dmamap_sync(adapter->txdma.dma_tag, adapter->txdma.dma_map, @@ -231,14 +206,14 @@ lem_netmap_txsync(struct ifnet *ifp, u_i } delta = l - adapter->next_tx_to_clean; if (delta) { - /* some completed, increment hwavail. */ + /* some tx completed, increment hwavail. */ if (delta < 0) delta += kring->nkr_num_slots; adapter->next_tx_to_clean = l; kring->nr_hwavail += delta; } } - /* update avail to what the hardware knows */ + /* update avail to what the kernel knows */ ring->avail = kring->nr_hwavail; if (do_lock) @@ -254,12 +229,13 @@ static int lem_netmap_rxsync(struct ifnet *ifp, u_int ring_nr, int do_lock) { struct adapter *adapter = ifp->if_softc; - struct netmap_adapter *na = NA(adapter->ifp); + struct netmap_adapter *na = NA(ifp); struct netmap_kring *kring = &na->rx_rings[ring_nr]; struct netmap_ring *ring = kring->ring; - int j, k, l, n, lim = kring->nkr_num_slots - 1; + int j, l, n, lim = kring->nkr_num_slots - 1; + int force_update = do_lock || kring->nr_kflags & NKR_PENDINTR; + u_int k = ring->cur, resvd = ring->reserved; - k = ring->cur; if (k > lim) return netmap_ring_reinit(kring); @@ -270,42 +246,50 @@ lem_netmap_rxsync(struct ifnet *ifp, u_i bus_dmamap_sync(adapter->rxdma.dma_tag, adapter->rxdma.dma_map, BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); - /* import newly received packets into the netmap ring - * j is an index in the netmap ring, l in the NIC ring, and - * j = (kring->nr_hwcur + kring->nr_hwavail) % ring_size - * l = rxr->next_to_check; - * and - * j == (l + kring->nkr_hwofs) % ring_size + /* + * Import newly received packets into the netmap ring. + * j is an index in the netmap ring, l in the NIC ring. */ l = adapter->next_rx_desc_to_check; - j = netmap_ridx_n2k(na, ring_nr, l); - for (n = 0; ; n++) { - struct e1000_rx_desc *curr = &adapter->rx_desc_base[l]; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Feb 27 20:52:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3B3F106566B; Mon, 27 Feb 2012 20:52:20 +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 AF4238FC15; Mon, 27 Feb 2012 20:52:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1RKqKjD036549; Mon, 27 Feb 2012 20:52:20 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1RKqKnl036547; Mon, 27 Feb 2012 20:52:20 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202272052.q1RKqKnl036547@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 27 Feb 2012 20:52: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: r232239 - 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: Mon, 27 Feb 2012 20:52:20 -0000 Author: kib Date: Mon Feb 27 20:52:20 2012 New Revision: 232239 URL: http://svn.freebsd.org/changeset/base/232239 Log: Fix a race in top non-interactive mode. Use plain sleep(3) call instead of arming timer and then pausing. If SIGALRM is delivered before pause(3) is entered, top hangs. Submitted by: Andrey Zonov MFC after: 1 week Modified: head/contrib/top/top.c Modified: head/contrib/top/top.c ============================================================================== --- head/contrib/top/top.c Mon Feb 27 19:05:01 2012 (r232238) +++ head/contrib/top/top.c Mon Feb 27 20:52:20 2012 (r232239) @@ -70,7 +70,6 @@ int pcpu_stats = No; /* signal handling routines */ sigret_t leave(); -sigret_t onalrm(); sigret_t tstop(); #ifdef SIGWINCH sigret_t winch(); @@ -723,12 +722,7 @@ restart: no_command = Yes; if (!interactive) { - /* set up alarm */ - (void) signal(SIGALRM, onalrm); - (void) alarm((unsigned)delay); - - /* wait for the rest of it .... */ - pause(); + sleep(delay); } else while (no_command) { @@ -1174,11 +1168,3 @@ int status; exit(status); /*NOTREACHED*/ } - -sigret_t onalrm() /* SIGALRM handler */ - -{ - /* this is only used in batch mode to break out of the pause() */ - /* return; */ -} - From owner-svn-src-all@FreeBSD.ORG Mon Feb 27 21:10:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96A0F106564A; Mon, 27 Feb 2012 21:10: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 813948FC08; Mon, 27 Feb 2012 21:10:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1RLABqS037143; Mon, 27 Feb 2012 21:10:11 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1RLABjb037139; Mon, 27 Feb 2012 21:10:11 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202272110.q1RLABjb037139@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 27 Feb 2012 21:10: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: r232240 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2012 21:10:11 -0000 Author: kib Date: Mon Feb 27 21:10:10 2012 New Revision: 232240 URL: http://svn.freebsd.org/changeset/base/232240 Log: Currently, the debugger attached to the process executing vfork() does not get syscall exit notification until the child performed exec of exit. Swap the order of doing ptracestop() and waiting for P_PPWAIT clearing, by postponing the wait into syscallret after ptracestop() notification is done. Reported, tested and reviewed by: Dmitry Mikulin MFC after: 2 weeks Modified: head/sys/kern/kern_fork.c head/sys/kern/subr_syscall.c head/sys/sys/proc.h Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Mon Feb 27 20:52:20 2012 (r232239) +++ head/sys/kern/kern_fork.c Mon Feb 27 21:10:10 2012 (r232240) @@ -708,6 +708,10 @@ do_fork(struct thread *td, int flags, st _PHOLD(p2); p2_held = 1; } + if (flags & RFPPWAIT) { + td->td_pflags |= TDP_RFPPWAIT; + td->td_rfppwait_p = p2; + } PROC_UNLOCK(p2); if ((flags & RFSTOPPED) == 0) { /* @@ -740,14 +744,6 @@ do_fork(struct thread *td, int flags, st cv_wait(&p2->p_dbgwait, &p2->p_mtx); if (p2_held) _PRELE(p2); - - /* - * Preserve synchronization semantics of vfork. If waiting for - * child to exec or exit, set P_PPWAIT on child, and sleep on our - * proc (in case of exit). - */ - while (p2->p_flag & P_PPWAIT) - cv_wait(&p2->p_pwait, &p2->p_mtx); PROC_UNLOCK(p2); } Modified: head/sys/kern/subr_syscall.c ============================================================================== --- head/sys/kern/subr_syscall.c Mon Feb 27 20:52:20 2012 (r232239) +++ head/sys/kern/subr_syscall.c Mon Feb 27 21:10:10 2012 (r232240) @@ -165,7 +165,7 @@ syscallenter(struct thread *td, struct s static inline void syscallret(struct thread *td, int error, struct syscall_args *sa __unused) { - struct proc *p; + struct proc *p, *p2; int traced; p = td->td_proc; @@ -223,4 +223,23 @@ syscallret(struct thread *td, int error, td->td_dbgflags &= ~(TDB_SCX | TDB_EXEC | TDB_FORK); PROC_UNLOCK(p); } + + if (td->td_pflags & TDP_RFPPWAIT) { + /* + * Preserve synchronization semantics of vfork. If + * waiting for child to exec or exit, fork set + * P_PPWAIT on child, and there we sleep on our proc + * (in case of exit). + * + * Do it after the ptracestop() above is finished, to + * not block our debugger until child execs or exits + * to finish vfork wait. + */ + td->td_pflags &= ~TDP_RFPPWAIT; + p2 = td->td_rfppwait_p; + PROC_LOCK(p2); + while (p2->p_flag & P_PPWAIT) + cv_wait(&p2->p_pwait, &p2->p_mtx); + PROC_UNLOCK(p2); + } } Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Mon Feb 27 20:52:20 2012 (r232239) +++ head/sys/sys/proc.h Mon Feb 27 21:10:10 2012 (r232240) @@ -311,6 +311,7 @@ struct thread { struct vnet *td_vnet; /* (k) Effective vnet. */ const char *td_vnet_lpush; /* (k) Debugging vnet push / pop. */ struct trapframe *td_intr_frame;/* (k) Frame of the current irq */ + struct proc *td_rfppwait_p; /* (k) The vforked child */ }; struct mtx *thread_lock_block(struct thread *); @@ -415,6 +416,7 @@ do { \ #define TDP_CALLCHAIN 0x00400000 /* Capture thread's callchain */ #define TDP_IGNSUSP 0x00800000 /* Permission to ignore the MNTK_SUSPEND* */ #define TDP_AUDITREC 0x01000000 /* Audit record pending on thread */ +#define TDP_RFPPWAIT 0x02000000 /* Handle RFPPWAIT on syscall exit */ /* * Reasons that the current thread can not be run yet. From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 00:29:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5052D1065675; Tue, 28 Feb 2012 00:29:55 +0000 (UTC) (envelope-from minimarmot@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id C20D28FC19; Tue, 28 Feb 2012 00:29:54 +0000 (UTC) Received: by vcge1 with SMTP id e1so2698585vcg.13 for ; Mon, 27 Feb 2012 16:29:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=7EYLYo+0YeyDeP/fGfhjErYr56FUtvR19kjsG0wId0w=; b=ARWGQgPBh/G3Da/kCWGNdl/ktViX6DqCOiZMJX4eQanZTzwiXa7ePuep7X1/AAuJoC 3qERRZc2UBfLA/KrV9fD8hdzYVuy1mMFt54/aInmuuONID+WFxVCWVOxlm/8z286Ri4y A7ZOdO4jgX+nDbsbe2rMaCdiLSwc6JZElxiqw= MIME-Version: 1.0 Received: by 10.52.100.97 with SMTP id ex1mr4528418vdb.127.1330387545257; Mon, 27 Feb 2012 16:05:45 -0800 (PST) Received: by 10.52.29.236 with HTTP; Mon, 27 Feb 2012 16:05:45 -0800 (PST) In-Reply-To: <201202271905.q1RJ52Se032771@svn.freebsd.org> References: <201202271905.q1RJ52Se032771@svn.freebsd.org> Date: Mon, 27 Feb 2012 19:05:45 -0500 Message-ID: From: Ben Kaduk To: Luigi Rizzo 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: r232238 - in head: share/man/man4 sys/dev/e1000 sys/dev/ixgbe sys/dev/netmap sys/dev/re sys/net tools/tools/netmap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2012 00:29:55 -0000 On Mon, Feb 27, 2012 at 2:05 PM, Luigi Rizzo wrote: > Author: luigi > Date: Mon Feb 27 19:05:01 2012 > New Revision: 232238 > URL: http://svn.freebsd.org/changeset/base/232238 > > Log: > =A0A bunch of netmap fixes: > > =A0USERSPACE: > =A01. add support for devices with different number of rx and tx queues; > > =A02. add better support for zero-copy operation, adding an extra field > =A0 =A0 to the netmap ring to indicate how many buffers we have already p= rocessed > =A0 =A0 but not yet released (with help from Eddie Kohler); > > =A03. The two changes above unfortunately require an API change, so while > =A0 =A0 at it add a version field and some spares to the ioctl() argument > =A0 =A0 to help detect mismatches. Is it worth bumping __FreeBSD_version? -Ben Kaduk From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 02:59:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26994106564A; Tue, 28 Feb 2012 02:59:05 +0000 (UTC) (envelope-from listlog2011@gmail.com) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 0DAC88FC0C; Tue, 28 Feb 2012 02:59:05 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q1S2x2ZC085097; Tue, 28 Feb 2012 02:59:03 GMT (envelope-from listlog2011@gmail.com) Message-ID: <4F4C42F5.2070006@gmail.com> Date: Tue, 28 Feb 2012 10:59:01 +0800 From: David Xu User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: Ivan Voras References: <201202271338.q1RDcqEQ020033@svn.freebsd.org> In-Reply-To: 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, David Xu Subject: Re: svn commit: r232209 - in head: lib/libthr/thread sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: davidxu@freebsd.org List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2012 02:59:05 -0000 On 2012/2/27 22:29, Ivan Voras wrote: > On 27 February 2012 14:38, David Xu wrote: >> Author: davidxu >> Date: Mon Feb 27 13:38:52 2012 >> New Revision: 232209 >> URL: http://svn.freebsd.org/changeset/base/232209 >> >> Log: >> Follow changes made in revision 232144, pass absolute timeout to kernel, >> this eliminates a clock_gettime() syscall. > Any chance of a MFC? > > I use rwlocks a lot; removing a syscall from all operations looks like > a nice improvement. > Yes, I will do a MFC when it is ready. ;-) From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 03:11:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7634F106564A; Tue, 28 Feb 2012 03:11:03 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 61FFF8FC0C; Tue, 28 Feb 2012 03:11:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1S3B3M4049211; Tue, 28 Feb 2012 03:11:03 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1S3B3RT049208; Tue, 28 Feb 2012 03:11:03 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201202280311.q1S3B3RT049208@svn.freebsd.org> From: Glen Barber Date: Tue, 28 Feb 2012 03:11: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: r232243 - head/share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2012 03:11:03 -0000 Author: gjb (doc committer) Date: Tue Feb 28 03:11:02 2012 New Revision: 232243 URL: http://svn.freebsd.org/changeset/base/232243 Log: Fix a few rendering nits in rc.conf(5) with regards to mentioning jail_parallel_enable. Modified: head/share/man/man5/rc.conf.5 Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Mon Feb 27 22:37:35 2012 (r232242) +++ head/share/man/man5/rc.conf.5 Tue Feb 28 03:11:02 2012 (r232243) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 25, 2012 +.Dd February 27, 2012 .Dt RC.CONF 5 .Os .Sh NAME @@ -3754,11 +3754,11 @@ indicates that the highest frequency (le If set to .Dq Li NO , any configured jails will not be started. -.It jail_parallel_start +.It Va jail_parallel_start .Pq Vt bool If set to -.Dq Li YES -all configured jails will be started in the background (= in parallel). +.Dq Li YES , +all configured jails will be started in the background (in parallel). .It Va jail_list .Pq Vt str A space separated list of names for jails. From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 04:05:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2B25106564A; Tue, 28 Feb 2012 04:05:36 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8DA968FC0A; Tue, 28 Feb 2012 04:05:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1S45atj050905; Tue, 28 Feb 2012 04:05:36 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1S45ah5050902; Tue, 28 Feb 2012 04:05:36 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201202280405.q1S45ah5050902@svn.freebsd.org> From: Adrian Chadd Date: Tue, 28 Feb 2012 04:05: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: r232244 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2012 04:05:36 -0000 Author: adrian Date: Tue Feb 28 04:05:35 2012 New Revision: 232244 URL: http://svn.freebsd.org/changeset/base/232244 Log: Track the number of bad beacons received. PR: kern/165517 Modified: head/sys/net80211/ieee80211_ioctl.h head/sys/net80211/ieee80211_sta.c Modified: head/sys/net80211/ieee80211_ioctl.h ============================================================================== --- head/sys/net80211/ieee80211_ioctl.h Tue Feb 28 03:11:02 2012 (r232243) +++ head/sys/net80211/ieee80211_ioctl.h Tue Feb 28 04:05:35 2012 (r232244) @@ -241,8 +241,9 @@ struct ieee80211_stats { uint32_t is_mesh_notproxy; /* dropped 'cuz not proxying */ uint32_t is_rx_badalign; /* dropped 'cuz misaligned */ uint32_t is_hwmp_proxy; /* PREP for proxy route */ + uint32_t is_beacon_bad; /* Number of bad beacons */ - uint32_t is_spare[11]; + uint32_t is_spare[10]; }; /* Modified: head/sys/net80211/ieee80211_sta.c ============================================================================== --- head/sys/net80211/ieee80211_sta.c Tue Feb 28 03:11:02 2012 (r232243) +++ head/sys/net80211/ieee80211_sta.c Tue Feb 28 04:05:35 2012 (r232244) @@ -1305,8 +1305,10 @@ sta_recv_mgmt(struct ieee80211_node *ni, return; } /* XXX probe response in sta mode when !scanning? */ - if (ieee80211_parse_beacon(ni, m0, &scan) != 0) + if (ieee80211_parse_beacon(ni, m0, &scan) != 0) { + vap->iv_stats.is_beacon_bad++; return; + } /* * Count frame now that we know it's to be processed. */ From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 04:06:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7ABA5106564A; Tue, 28 Feb 2012 04:06:43 +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 653EF8FC1C; Tue, 28 Feb 2012 04:06:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1S46hK0050976; Tue, 28 Feb 2012 04:06:43 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1S46hUD050974; Tue, 28 Feb 2012 04:06:43 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201202280406.q1S46hUD050974@svn.freebsd.org> From: Adrian Chadd Date: Tue, 28 Feb 2012 04:06: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: r232245 - head/tools/tools/net80211/wlanstats X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Feb 2012 04:06:43 -0000 Author: adrian Date: Tue Feb 28 04:06:42 2012 New Revision: 232245 URL: http://svn.freebsd.org/changeset/base/232245 Log: Add is_beacon_bad. PR: kern/165517 Modified: head/tools/tools/net80211/wlanstats/wlanstats.c Modified: head/tools/tools/net80211/wlanstats/wlanstats.c ============================================================================== --- head/tools/tools/net80211/wlanstats/wlanstats.c Tue Feb 28 04:05:35 2012 (r232244) +++ head/tools/tools/net80211/wlanstats/wlanstats.c Tue Feb 28 04:06:42 2012 (r232245) @@ -370,6 +370,8 @@ static const struct fmt wlanstats[] = { { 5, "noise", "noise", "current noise floor (dBm)" }, #define S_SIGNAL AFTER(S_NOISE) { 5, "signal", "sig", "current signal (dBm)" }, +#define S_BEACON_BAD AFTER(S_SIGNAL) + { 9, "beacon_bad", "beaconbad", "bad beacons received" }, }; struct wlanstatfoo_p { @@ -814,6 +816,7 @@ wlan_get_curstat(struct statfoo *sf, int case S_RX_MCAST: NSTAT(rx_mcast); case S_TX_UCAST: NSTAT(tx_ucast); case S_TX_MCAST: NSTAT(tx_mcast); + case S_BEACON_BAD: STAT(beacon_bad); } return wlan_getinfo(wf, s, b, bs); #undef NSTAT @@ -972,6 +975,7 @@ wlan_get_totstat(struct statfoo *sf, int case S_RX_MCAST: NSTAT(rx_mcast); case S_TX_UCAST: NSTAT(tx_ucast); case S_TX_MCAST: NSTAT(tx_mcast); + case S_BEACON_BAD: STAT(beacon_bad); } return wlan_getinfo(wf, s, b, bs); #undef NSTAT From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 05:23:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F3BF1065674; Tue, 28 Feb 2012 05:23:30 +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 19D2E8FC0C; Tue, 28 Feb 2012 05:23:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1S5NT3o053427; Tue, 28 Feb 2012 05:23:29 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1S5NTak053424; Tue, 28 Feb 2012 05:23:29 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201202280523.q1S5NTak053424@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 28 Feb 2012 05:23: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: r232246 - in head/sys/dev: mii re X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Feb 2012 05:23:30 -0000 Author: yongari Date: Tue Feb 28 05:23:29 2012 New Revision: 232246 URL: http://svn.freebsd.org/changeset/base/232246 Log: Prefer RL_GMEDIASTAT register to RGEPHY_MII_SSR register to extract a link status of PHY when parent driver is re(4). RGEPHY_MII_SSR register does not seem to report correct PHY status on some integrated PHYs used with re(4). Unfortunately, RealTek PHYs have no additional information to differentiate integrated PHYs from external ones so relying on PHY model number is not enough to know that. However, it seems RGEPHY_MII_SSR register exists for external RealTek PHYs so checking parent driver would be good indication to know which PHY was used. In other words, for non-re(4) controllers, the PHY is external one and its revision number is greater than or equal to 2. This change fixes intermittent link UP/DOWN messages reported on RTL8169 controller. Also, mii_attach(9) is tried after setting interface name since rgephy(4) have to know parent driver name. PR: kern/165509 Modified: head/sys/dev/mii/rgephy.c head/sys/dev/re/if_re.c Modified: head/sys/dev/mii/rgephy.c ============================================================================== --- head/sys/dev/mii/rgephy.c Tue Feb 28 04:06:42 2012 (r232245) +++ head/sys/dev/mii/rgephy.c Tue Feb 28 05:23:29 2012 (r232246) @@ -110,10 +110,15 @@ static int rgephy_attach(device_t dev) { struct mii_softc *sc; + struct mii_attach_args *ma; + u_int flags; sc = device_get_softc(dev); - - mii_phy_dev_attach(dev, 0, &rgephy_funcs, 0); + ma = device_get_ivars(dev); + flags = 0; + if (strcmp(ma->mii_data->mii_ifp->if_dname, "re") == 0) + flags |= MIIF_PHYPRIV0; + mii_phy_dev_attach(dev, flags, &rgephy_funcs, 0); /* RTL8169S do not report auto-sense; add manually. */ sc->mii_capabilities = (PHY_READ(sc, MII_BMSR) | BMSR_ANEG) & @@ -243,7 +248,8 @@ setit: * Check to see if we have link. If we do, we don't * need to restart the autonegotiation process. */ - if (sc->mii_mpd_rev >= 2) { + if ((sc->mii_flags & MIIF_PHYPRIV0) == 0 && + sc->mii_mpd_rev >= 2) { /* RTL8211B(L) */ reg = PHY_READ(sc, RGEPHY_MII_SSR); if (reg & RGEPHY_SSR_LINK) { @@ -298,7 +304,7 @@ rgephy_status(struct mii_softc *sc) mii->mii_media_status = IFM_AVALID; mii->mii_media_active = IFM_ETHER; - if (sc->mii_mpd_rev >= 2) { + if ((sc->mii_flags & MIIF_PHYPRIV0) == 0 && sc->mii_mpd_rev >= 2) { ssr = PHY_READ(sc, RGEPHY_MII_SSR); if (ssr & RGEPHY_SSR_LINK) mii->mii_media_status |= IFM_ACTIVE; @@ -328,7 +334,7 @@ rgephy_status(struct mii_softc *sc) } } - if (sc->mii_mpd_rev >= 2) { + if ((sc->mii_flags & MIIF_PHYPRIV0) == 0 && sc->mii_mpd_rev >= 2) { ssr = PHY_READ(sc, RGEPHY_MII_SSR); switch (ssr & RGEPHY_SSR_SPD_MASK) { case RGEPHY_SSR_S1000: @@ -484,7 +490,7 @@ rgephy_reset(struct mii_softc *sc) { uint16_t ssr; - if (sc->mii_mpd_rev == 3) { + if ((sc->mii_flags & MIIF_PHYPRIV0) == 0 && sc->mii_mpd_rev == 3) { /* RTL8211C(L) */ ssr = PHY_READ(sc, RGEPHY_MII_SSR); if ((ssr & RGEPHY_SSR_ALDPS) != 0) { Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Tue Feb 28 04:06:42 2012 (r232245) +++ head/sys/dev/re/if_re.c Tue Feb 28 05:23:29 2012 (r232246) @@ -1577,19 +1577,6 @@ re_attach(device_t dev) re_gmii_writereg(dev, 1, 0x0e, 0); } -#define RE_PHYAD_INTERNAL 0 - - /* Do MII setup. */ - phy = RE_PHYAD_INTERNAL; - if (sc->rl_type == RL_8169) - phy = 1; - error = mii_attach(dev, &sc->rl_miibus, ifp, re_ifmedia_upd, - re_ifmedia_sts, BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, MIIF_DOPAUSE); - if (error != 0) { - device_printf(dev, "attaching PHYs failed\n"); - goto fail; - } - ifp->if_softc = sc; if_initname(ifp, device_get_name(dev), device_get_unit(dev)); ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; @@ -1614,6 +1601,19 @@ re_attach(device_t dev) TASK_INIT(&sc->rl_inttask, 0, re_int_task, sc); +#define RE_PHYAD_INTERNAL 0 + + /* Do MII setup. */ + phy = RE_PHYAD_INTERNAL; + if (sc->rl_type == RL_8169) + phy = 1; + error = mii_attach(dev, &sc->rl_miibus, ifp, re_ifmedia_upd, + re_ifmedia_sts, BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, MIIF_DOPAUSE); + if (error != 0) { + device_printf(dev, "attaching PHYs failed\n"); + goto fail; + } + /* * Call MI attach routine. */ From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 05:48:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5AD21065670 for ; Tue, 28 Feb 2012 05:48:16 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 3168B8FC0C for ; Tue, 28 Feb 2012 05:48:15 +0000 (UTC) Received: by bkcjc3 with SMTP id jc3so2299790bkc.13 for ; Mon, 27 Feb 2012 21:48:15 -0800 (PST) Received-SPF: pass (google.com: domain of andrey@zonov.org designates 10.204.153.215 as permitted sender) client-ip=10.204.153.215; Authentication-Results: mr.google.com; spf=pass (google.com: domain of andrey@zonov.org designates 10.204.153.215 as permitted sender) smtp.mail=andrey@zonov.org Received: from mr.google.com ([10.204.153.215]) by 10.204.153.215 with SMTP id l23mr3552423bkw.11.1330408095043 (num_hops = 1); Mon, 27 Feb 2012 21:48:15 -0800 (PST) Received: by 10.204.153.215 with SMTP id l23mr2805074bkw.11.1330408094834; Mon, 27 Feb 2012 21:48:14 -0800 (PST) Received: from [10.254.254.77] (ppp109-252-213-87.pppoe.spdop.ru. [109.252.213.87]) by mx.google.com with ESMTPS id t17sm28888718bke.6.2012.02.27.21.48.13 (version=SSLv3 cipher=OTHER); Mon, 27 Feb 2012 21:48:14 -0800 (PST) Message-ID: <4F4C6A9D.9060508@zonov.org> Date: Tue, 28 Feb 2012 09:48:13 +0400 From: Andrey Zonov User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.8.1.24) Gecko/20100228 Thunderbird/2.0.0.24 Mnenhy/0.7.6.0 MIME-Version: 1.0 To: Konstantin Belousov References: <201202272052.q1RKqKnl036547@svn.freebsd.org> In-Reply-To: <201202272052.q1RKqKnl036547@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQk+dXBdm9XdQBRocI1sJ75syOm9oklS4P2xHVYcyNv8JVlUvwxc4U7syOV9QiqhF6blL3nW Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232239 - 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, 28 Feb 2012 05:48:17 -0000 On 28.02.2012 0:52, Konstantin Belousov wrote: > Author: kib > Date: Mon Feb 27 20:52:20 2012 > New Revision: 232239 > URL: http://svn.freebsd.org/changeset/base/232239 > > Log: > Fix a race in top non-interactive mode. Use plain sleep(3) call instead > of arming timer and then pausing. If SIGALRM is delivered before pause(3) > is entered, top hangs. > > Submitted by: Andrey Zonov > MFC after: 1 week > > Modified: > head/contrib/top/top.c > Thanks a lot! -- Andrey Zonov From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 06:30:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F725106566B; Tue, 28 Feb 2012 06:30:05 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id DF73B8FC13; Tue, 28 Feb 2012 06:30:04 +0000 (UTC) Received: from julian-mac.elischer.org (c-67-180-24-15.hsd1.ca.comcast.net [67.180.24.15]) (authenticated bits=0) by vps1.elischer.org (8.14.4/8.14.4) with ESMTP id q1S6U1YJ098762 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 27 Feb 2012 22:30:03 -0800 (PST) (envelope-from julian@freebsd.org) Message-ID: <4F4C746D.3040005@freebsd.org> Date: Mon, 27 Feb 2012 22:30:05 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.27) Gecko/20120216 Thunderbird/3.1.19 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <201202261425.q1QEPm9g069102@svn.freebsd.org> <20120227082811.GC1363@garage.freebsd.pl> In-Reply-To: <20120227082811.GC1363@garage.freebsd.pl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Mikolaj Golub , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232181 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2012 06:30:05 -0000 On 2/27/12 12:28 AM, Pawel Jakub Dawidek wrote: > On Sun, Feb 26, 2012 at 02:25:48PM +0000, Mikolaj Golub wrote: >> Author: trociny >> Date: Sun Feb 26 14:25:48 2012 >> New Revision: 232181 >> URL: http://svn.freebsd.org/changeset/base/232181 >> >> Log: >> Add sysctl to retrieve or set umask of another process. > "set umask of another process"? This seems... weird. What's the purpose > of this change? I also wondered on seeing this.. who was it discussed with, and what usage makes this a requirement? Julian From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 06:34:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E93D106564A; Tue, 28 Feb 2012 06:34:24 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id 18E398FC12; Tue, 28 Feb 2012 06:34:23 +0000 (UTC) Received: from julian-mac.elischer.org (c-67-180-24-15.hsd1.ca.comcast.net [67.180.24.15]) (authenticated bits=0) by vps1.elischer.org (8.14.4/8.14.4) with ESMTP id q1S6YLPa098788 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 27 Feb 2012 22:34:23 -0800 (PST) (envelope-from julian@freebsd.org) Message-ID: <4F4C7571.7010407@freebsd.org> Date: Mon, 27 Feb 2012 22:34:25 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.27) Gecko/20120216 Thunderbird/3.1.19 MIME-Version: 1.0 To: Konstantin Belousov References: <201202261425.q1QEPm9g069102@svn.freebsd.org> <20120227082811.GC1363@garage.freebsd.pl> <864nucd5jc.fsf@in138.ua3> <20120227092951.GB55074@deviant.kiev.zoral.com.ua> In-Reply-To: <20120227092951.GB55074@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Mikolaj Golub , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek Subject: Re: svn commit: r232181 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2012 06:34:24 -0000 On 2/27/12 1:29 AM, Konstantin Belousov wrote: > On Mon, Feb 27, 2012 at 10:49:59AM +0200, Mikolaj Golub wrote: >> On Mon, 27 Feb 2012 09:28:11 +0100 Pawel Jakub Dawidek wrote: >> >> PJD> On Sun, Feb 26, 2012 at 02:25:48PM +0000, Mikolaj Golub wrote: >> >> Author: trociny >> >> Date: Sun Feb 26 14:25:48 2012 >> >> New Revision: 232181 >> >> URL: http://svn.freebsd.org/changeset/base/232181 >> >> >> >> Log: >> >> Add sysctl to retrieve or set umask of another process. >> >> PJD> "set umask of another process"? This seems... weird. What's the purpose >> PJD> of this change? >> >> When we were discussing this with Kostik and Robert, and I asked if it could >> be useful to have the sysctl rw, Kostik described a real situation when he had >> had to change umask of another process: umask had not been set properly on an >> aplication start but it could not be restarted until the end of the day. >> Kostik was able to fix it using gdb but having an easier way looked useful. > kgdb, not gdb. > > It is indeed possible to write a ptrace-based utility that inject a code > payload that would change umask. Since this is very risky but indeed possible, > having the straighforward kernel facility is justified. Why not have a sysctl to change a process' uid, cwd, memory limits, etc. etc. I don't think this belongs in the kernel by default. It's not exactl a call for backout but It's teh next thing short of that. a call for "do you REALLY think we need this particular specific case catered for?" Julian > Patch puts the same restrictions on the caller as ptrace(). From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 07:13:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1024106566B; Tue, 28 Feb 2012 07:13:12 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 578268FC08; Tue, 28 Feb 2012 07:13:11 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id EB4A67300A; Tue, 28 Feb 2012 08:31:22 +0100 (CET) Date: Tue, 28 Feb 2012 08:31:22 +0100 From: Luigi Rizzo To: Ben Kaduk Message-ID: <20120228073122.GC57270@onelab2.iet.unipi.it> References: <201202271905.q1RJ52Se032771@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, Luigi Rizzo , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r232238 - in head: share/man/man4 sys/dev/e1000 sys/dev/ixgbe sys/dev/netmap sys/dev/re sys/net tools/tools/netmap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2012 07:13:12 -0000 On Mon, Feb 27, 2012 at 07:05:45PM -0500, Ben Kaduk wrote: ... > > ?1. add support for devices with different number of rx and tx queues; > > > > ?2. add better support for zero-copy operation, adding an extra field > > ? ? to the netmap ring to indicate how many buffers we have already processed > > ? ? but not yet released (with help from Eddie Kohler); > > > > ?3. The two changes above unfortunately require an API change, so while > > ? ? at it add a version field and some spares to the ioctl() argument > > ? ? to help detect mismatches. > > Is it worth bumping __FreeBSD_version? I don't think it is necessary. There is basically no code that uses the netmap API except for the examples in tools/tools/netmap, and i now have a NETMAP_API macro that defines the version without the need for using __FreeBSD_version cheers luigi From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 07:29:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 959DA1065674; Tue, 28 Feb 2012 07:29:32 +0000 (UTC) (envelope-from to.my.trociny@gmail.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 6C85B8FC1E; Tue, 28 Feb 2012 07:29:30 +0000 (UTC) Received: by eaan10 with SMTP id n10so2489268eaa.13 for ; Mon, 27 Feb 2012 23:29:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:organization:references:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=b2FsuzvHI91fpXhjFufDCwual+IkgsUDJUlv+GGb7oI=; b=i6lfPwkjpjRcZbRRGPECWOd9N/RvalPp60QFQEYSHBZS8aTC0xfwU/PykoUtScbB/A LWLDocF/sJpqDZ4d4MkfiAo1Pht5WrhShS6BTlsdJELZ631yeJNveR6LlTWX1xZxbUc0 v13wH/DJrRIQDLUzLEolTEijiEqnmpU2bfuXw= Received: by 10.213.6.209 with SMTP id a17mr3995519eba.137.1330414170127; Mon, 27 Feb 2012 23:29:30 -0800 (PST) Received: from localhost ([94.27.39.186]) by mx.google.com with ESMTPS id v51sm67407936eef.2.2012.02.27.23.29.28 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 27 Feb 2012 23:29:29 -0800 (PST) From: Mikolaj Golub To: Julian Elischer Organization: TOA Ukraine References: <201202261425.q1QEPm9g069102@svn.freebsd.org> <20120227082811.GC1363@garage.freebsd.pl> <864nucd5jc.fsf@in138.ua3> <20120227092951.GB55074@deviant.kiev.zoral.com.ua> <4F4C7571.7010407@freebsd.org> Sender: Mikolaj Golub Date: Tue, 28 Feb 2012 09:29:26 +0200 In-Reply-To: <4F4C7571.7010407@freebsd.org> (Julian Elischer's message of "Mon, 27 Feb 2012 22:34:25 -0800") Message-ID: <86zkc3bell.fsf@in138.ua3> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: src-committers@freebsd.org, Pawel Jakub Dawidek , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Robert Watson , Konstantin Belousov Subject: Re: svn commit: r232181 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2012 07:29:32 -0000 On Mon, 27 Feb 2012 22:34:25 -0800 Julian Elischer wrote: JE> On 2/27/12 1:29 AM, Konstantin Belousov wrote: >> On Mon, Feb 27, 2012 at 10:49:59AM +0200, Mikolaj Golub wrote: >>> On Mon, 27 Feb 2012 09:28:11 +0100 Pawel Jakub Dawidek wrote: >>> >>> PJD> On Sun, Feb 26, 2012 at 02:25:48PM +0000, Mikolaj Golub wrote: >>> >> Author: trociny >>> >> Date: Sun Feb 26 14:25:48 2012 >>> >> New Revision: 232181 >>> >> URL: http://svn.freebsd.org/changeset/base/232181 >>> >> >>> >> Log: >>> >> Add sysctl to retrieve or set umask of another process. >>> >>> PJD> "set umask of another process"? This seems... weird. What's the purpose >>> PJD> of this change? >>> >>> When we were discussing this with Kostik and Robert, and I asked if it could >>> be useful to have the sysctl rw, Kostik described a real situation when he had >>> had to change umask of another process: umask had not been set properly on an >>> aplication start but it could not be restarted until the end of the day. >>> Kostik was able to fix it using gdb but having an easier way looked useful. >> kgdb, not gdb. >> >> It is indeed possible to write a ptrace-based utility that inject a code >> payload that would change umask. Since this is very risky but indeed possible, >> having the straighforward kernel facility is justified. JE> Why not have a sysctl to change a process' uid, cwd, memory limits, JE> etc. etc. We already can change limits. Ability to change cwd and may be uid I think could be useful too. This not necessary should be a sysctl though. JE> I don't think this belongs in the kernel by default. It's not exactl a JE> call for backout but It's teh next thing short of that. a call for "do JE> you REALLY think we need this particular specific case catered for?" The main goal of the patch was to provide ability to get another process umask. It looks like usefulness of this is not questioned here. When ways to do this were discussed with Kostik and Robert options to extend kinfo_proc or add another sysctl were considered. Adding a new sysctl won because it does not break ABI, may be controlled by p_candebug() and actually kinfo_proc did not look like a right place for umask. So when it was decided to make a new sysctl the question arose if it should be RW or RO. Making it RW was just a matter of couple lines, and as there were cases when this could be useful why not? I should mention that Robert was not very happy with having this RW but did not object strongly. Sorry, it was my mistake I did not discuss this in public before committing. Will do the next time. Although I still think it is a useful thing. I don't think it is bad to have debugging tools that provide ability to control another process without tricks with kgdb or code injection. -- Mikolaj Golub From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 07:35:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64CA3106564A; Tue, 28 Feb 2012 07:35:08 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3718E8FC1E; Tue, 28 Feb 2012 07:35:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1S7Z8G7057943; Tue, 28 Feb 2012 07:35:08 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1S7Z8VT057940; Tue, 28 Feb 2012 07:35:08 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201202280735.q1S7Z8VT057940@svn.freebsd.org> From: Martin Matuska Date: Tue, 28 Feb 2012 07:35: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: r232247 - in head: share/man/man5 usr.sbin/jail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Feb 2012 07:35:08 -0000 Author: mm Date: Tue Feb 28 07:35:07 2012 New Revision: 232247 URL: http://svn.freebsd.org/changeset/base/232247 Log: mdoc(7) stype - start new sentences on new line MFC after: 1 week Modified: head/share/man/man5/devfs.5 head/usr.sbin/jail/jail.8 Modified: head/share/man/man5/devfs.5 ============================================================================== --- head/share/man/man5/devfs.5 Tue Feb 28 05:23:29 2012 (r232246) +++ head/share/man/man5/devfs.5 Tue Feb 28 07:35:07 2012 (r232247) @@ -103,12 +103,13 @@ The following devfs file system-specific .It Cm ruleset Ns No = Ns Ar ruleset Set ruleset number .Ar ruleset -as the current ruleset for the mount-point and apply all its rules. If the -ruleset number +as the current ruleset for the mount-point and apply all its rules. +If the ruleset number .Ar ruleset does not exist, an empty ruleset with the number .Ar ruleset -is created. See +is created. +See .Xr devfs 8 for more information on working with devfs rulesets. .El Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Tue Feb 28 05:23:29 2012 (r232246) +++ head/usr.sbin/jail/jail.8 Tue Feb 28 07:35:07 2012 (r232247) @@ -303,16 +303,17 @@ If the system securelevel is changed, an least as secure. .It Va devfs_ruleset The number of the devfs ruleset that is enforced for mounting devfs in -this jail. A value of zero (default) means no ruleset is enforced. Descendant -jails inherit the parent jail's devfs ruleset enforcement. Mounting devfs -inside a jail is possible only if the +this jail. +A value of zero (default) means no ruleset is enforced. +Descendant jails inherit the parent jail's devfs ruleset enforcement. +Mounting devfs inside a jail is possible only if the .Va allow.mount and .Va allow.mount.devfs permissions are effective and .Va enforce_statfs -is set to a value lower than 2. Devfs rules and rulesets cannot be viewed or -modified from inside a jail. +is set to a value lower than 2. +Devfs rules and rulesets cannot be viewed or modified from inside a jail. .It Va children.max The number of child jails allowed to be created by this jail (or by other jails under this jail). @@ -415,8 +416,8 @@ This permission is effective only togeth .Va allow.mount and if .Va enforce_statfs -is set to a value lower than 2. Please consider restricting the devfs ruleset -with the +is set to a value lower than 2. +Please consider restricting the devfs ruleset with the .Va devfs_ruleset option. .It Va allow.mount.nullfs @@ -434,7 +435,8 @@ This permission is effective only togeth .Va allow.mount and if .Va enforce_statfs -is set to a value lower than 2. See +is set to a value lower than 2. +See .Xr zfs 8 for information on how to configure the ZFS filesystem to operate from within a jail. From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 11:06:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 827E01065673; Tue, 28 Feb 2012 11:06:52 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6BC818FC1B; Tue, 28 Feb 2012 11:06:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1SB6q80067937; Tue, 28 Feb 2012 11:06:52 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1SB6qR2067935; Tue, 28 Feb 2012 11:06:52 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201202281106.q1SB6qR2067935@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 28 Feb 2012 11:06: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: r232249 - 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, 28 Feb 2012 11:06:52 -0000 Author: pluknet Date: Tue Feb 28 11:06:52 2012 New Revision: 232249 URL: http://svn.freebsd.org/changeset/base/232249 Log: Add lib32 part after libarchive 3.0.3 update. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Feb 28 08:36:38 2012 (r232248) +++ head/ObsoleteFiles.inc Tue Feb 28 11:06:52 2012 (r232249) @@ -56,6 +56,9 @@ OLD_FILES+=man/man3/archive_read_data_in man/man3/archive_write_set_compression_none.3.gz \ man/man3/archive_write_set_compression_program.3.gz OLD_LIBS+=usr/lib/libarchive.so.5 +.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64" +OLD_LIBS+=usr/lib32/libarchive.so.5 +.endif # 20120113: removal of wtmpcvt(1) OLD_FILES+=usr/bin/wtmpcvt OLD_FILES+=usr/share/man/man1/wtmpcvt.1.gz From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 13:19:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1A2A106564A; Tue, 28 Feb 2012 13:19:34 +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 DE8558FC0A; Tue, 28 Feb 2012 13:19:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1SDJYLC072346; Tue, 28 Feb 2012 13:19:34 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1SDJYiH072336; Tue, 28 Feb 2012 13:19:34 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201202281319.q1SDJYiH072336@svn.freebsd.org> From: Gavin Atkinson Date: Tue, 28 Feb 2012 13:19: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: r232250 - in head: sbin/ifconfig sbin/ipfw share/man/man4 sys/conf sys/dev/ath sys/dev/siba sys/ia64/ia64 sys/mips/rt305x X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Feb 2012 13:19:35 -0000 Author: gavin Date: Tue Feb 28 13:19:34 2012 New Revision: 232250 URL: http://svn.freebsd.org/changeset/base/232250 Log: Correct capitalization of "Hz" in user-visible text (manpages, printf(), etc). MFC after: 3 days Modified: head/sbin/ifconfig/ifconfig.8 head/sbin/ipfw/ipfw.8 head/share/man/man4/ath.4 head/share/man/man4/net80211.4 head/sys/conf/NOTES head/sys/dev/ath/if_ath_sysctl.c head/sys/dev/siba/siba_core.c head/sys/ia64/ia64/machdep.c head/sys/mips/rt305x/rt305x_sysctl.c Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Tue Feb 28 11:06:52 2012 (r232249) +++ head/sbin/ifconfig/ifconfig.8 Tue Feb 28 13:19:34 2012 (r232250) @@ -1036,7 +1036,7 @@ Enable Dynamic Frequency Selection (DFS) DFS embodies several facilities including detection of overlapping radar signals, dynamic transmit power control, and channel selection according to a least-congested criteria. -DFS support is mandatory for some 5Ghz frequencies in certain +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 current country code, regdomain, @@ -1091,7 +1091,7 @@ By default DTIM is 1 (i.e., DTIM occurs .It Cm quiet Enable the use of quiet IE. Hostap will use this to silent other stations to reduce interference for radar detection when -operating on 5Ghz frequency and doth support is enabled. +operating on 5GHz frequency and doth support is enabled. Use .Fl quiet to disable this functionality. Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Tue Feb 28 11:06:52 2012 (r232249) +++ head/sbin/ipfw/ipfw.8 Tue Feb 28 13:19:34 2012 (r232250) @@ -2235,7 +2235,7 @@ specifies the scheduling algorithm to us is just a FIFO scheduler (which means that all packets are stored in the same queue as they arrive to the scheduler). FIFO has O(1) per-packet time complexity, with very low -constants (estimate 60-80ns on a 2Ghz desktop machine) +constants (estimate 60-80ns on a 2GHz desktop machine) but gives no service guarantees. .It Cm wf2qp implements the WF2Q+ algorithm, which is a Weighted Fair Queueing Modified: head/share/man/man4/ath.4 ============================================================================== --- head/share/man/man4/ath.4 Tue Feb 28 11:06:52 2012 (r232249) +++ head/share/man/man4/ath.4 Tue Feb 28 13:19:34 2012 (r232250) @@ -95,8 +95,8 @@ with transmit speeds appropriate to each AR5416-class devices are capable of 802.11n operation but are supported only in legacy modes (802.11a, 11b, 11g). Most chips also support an Atheros Turbo Mode (TM) that operates in -the 5Ghz frequency range with 2x the transmit speeds. -Some chips also support Turbo mode in the 2.4Ghz range with 802.11g +the 5GHz frequency range with 2x the transmit speeds. +Some chips also support Turbo mode in the 2.4GHz range with 802.11g though this support is not presently available due to regulatory requirements. (Note that Turbo modes are, however, only interoperable with other Atheros-based devices.) Modified: head/share/man/man4/net80211.4 ============================================================================== --- head/share/man/man4/net80211.4 Tue Feb 28 11:06:52 2012 (r232249) +++ head/share/man/man4/net80211.4 Tue Feb 28 13:19:34 2012 (r232250) @@ -280,7 +280,7 @@ Return whether or not Dynamic Frequency DFS embodies several facilities including detection of overlapping radar signals, dynamic transmit power control, and channel selection according to a least-congested criteria. -DFS support is mandatory for some 5Ghz frequencies in certain +DFS support is mandatory for some 5GHz frequencies in certain locales (e.g. ETSI). By default DFS is enabled according to the regulatory definitions and the current country code, regdomain, and channel. Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue Feb 28 11:06:52 2012 (r232249) +++ head/sys/conf/NOTES Tue Feb 28 13:19:34 2012 (r232250) @@ -2417,11 +2417,11 @@ device cmx # or # options BROOKTREE_SYSTEM_DEFAULT=BROOKTREE_NTSC # Specifies the default video capture mode. -# This is required for Dual Crystal (28&35Mhz) boards where PAL is used +# This is required for Dual Crystal (28&35MHz) boards where PAL is used # to prevent hangs during initialization, e.g. VideoLogic Captivator PCI. # # options BKTR_USE_PLL -# This is required for PAL or SECAM boards with a 28Mhz crystal and no 35Mhz +# This is required for PAL or SECAM boards with a 28MHz crystal and no 35MHz # crystal, e.g. some new Bt878 cards. # # options BKTR_GPIO_ACCESS Modified: head/sys/dev/ath/if_ath_sysctl.c ============================================================================== --- head/sys/dev/ath/if_ath_sysctl.c Tue Feb 28 11:06:52 2012 (r232249) +++ head/sys/dev/ath/if_ath_sysctl.c Tue Feb 28 13:19:34 2012 (r232250) @@ -912,7 +912,7 @@ ath_sysctl_hal_attach(struct ath_softc * sc->sc_ah->ah_config.ah_ar5416_biasadj = 0; SYSCTL_ADD_INT(ctx, child, OID_AUTO, "ar5416_biasadj", CTLFLAG_RW, &sc->sc_ah->ah_config.ah_ar5416_biasadj, 0, - "Enable 2ghz AR5416 direction sensitivity bias adjust"); + "Enable 2GHz AR5416 direction sensitivity bias adjust"); sc->sc_ah->ah_config.ah_dma_beacon_response_time = 2; SYSCTL_ADD_INT(ctx, child, OID_AUTO, "dma_brt", CTLFLAG_RW, Modified: head/sys/dev/siba/siba_core.c ============================================================================== --- head/sys/dev/siba/siba_core.c Tue Feb 28 11:06:52 2012 (r232249) +++ head/sys/dev/siba/siba_core.c Tue Feb 28 13:19:34 2012 (r232250) @@ -1207,7 +1207,7 @@ siba_cc_pmu0_pll0_init(struct siba_cc *s if (((pmu & SIBA_CC_PMUCTL_XF) >> 2) == e->xf) return; - DPRINTF(siba, SIBA_DEBUG_PLL, "change PLL value to %u.%03u mhz\n", + DPRINTF(siba, SIBA_DEBUG_PLL, "change PLL value to %u.%03u MHz\n", (xtalfreq / 1000), (xtalfreq % 1000)); KASSERT(siba->siba_chipid == 0x4328 || siba->siba_chipid == 0x5354, Modified: head/sys/ia64/ia64/machdep.c ============================================================================== --- head/sys/ia64/ia64/machdep.c Tue Feb 28 11:06:52 2012 (r232249) +++ head/sys/ia64/ia64/machdep.c Tue Feb 28 13:19:34 2012 (r232250) @@ -245,7 +245,7 @@ identifycpu(void) printf("CPU: %s (", model_name); if (cpu_freq) - printf("%u Mhz ", cpu_freq); + printf("%u MHz ", cpu_freq); printf("%s)\n", family_name); printf(" Origin = \"%s\" Revision = %d\n", vendor, revision); printf(" Features = 0x%b\n", (u_int32_t) features, Modified: head/sys/mips/rt305x/rt305x_sysctl.c ============================================================================== --- head/sys/mips/rt305x/rt305x_sysctl.c Tue Feb 28 11:06:52 2012 (r232249) +++ head/sys/mips/rt305x/rt305x_sysctl.c Tue Feb 28 13:19:34 2012 (r232250) @@ -84,7 +84,7 @@ rt305x_sysctl_dump_config(device_t dev) if ( val & SYSCTL_SYSCFG_BIG_ENDIAN) printf("\tBig Endian\n"); if ( val & SYSCTL_SYSCFG_CPU_CLK_SEL_384MHZ) - printf("\tClock is 384Mhz\n"); + printf("\tClock is 384MHz\n"); printf("\tBoot from %u\n", ((val & SYSCTL_SYSCFG_BOOT_FROM_MASK) >> SYSCTL_SYSCFG_BOOT_FROM_SHIFT)); @@ -109,7 +109,7 @@ rt305x_sysctl_dump_config(device_t dev) printf("\tI2S clock is enabled\n"); printf("\tI2S clock is %s\n", (val & SYSCTL_CLKCFG1_I2S_CLK_SEL_EXT)? - "external":"internal 15.625Mhz"); + "external":"internal 15.625MHz"); printf("\tI2S clock divider %u\n", ((val & SYSCTL_CLKCFG1_I2S_CLK_DIV_MASK) >> SYSCTL_CLKCFG1_I2S_CLK_DIV_SHIFT)); @@ -118,7 +118,7 @@ rt305x_sysctl_dump_config(device_t dev) printf("\tPCM clock is %s\n", (val & SYSCTL_CLKCFG1_PCM_CLK_SEL_EXT)? - "external":"internal 15.625Mhz"); + "external":"internal 15.625MHz"); printf("\tPCM clock divider %u\n", ((val & SYSCTL_CLKCFG1_PCM_CLK_DIV_MASK) >> SYSCTL_CLKCFG1_PCM_CLK_DIV_SHIFT)); From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 14:35:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 317621065670; Tue, 28 Feb 2012 14:35:37 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07A658FC13; Tue, 28 Feb 2012 14:35:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1SEZaXI074919; Tue, 28 Feb 2012 14:35:36 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1SEZaEI074917; Tue, 28 Feb 2012 14:35:36 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201202281435.q1SEZaEI074917@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 28 Feb 2012 14:35: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: r232253 - 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, 28 Feb 2012 14:35:37 -0000 Author: pluknet Date: Tue Feb 28 14:35:36 2012 New Revision: 232253 URL: http://svn.freebsd.org/changeset/base/232253 Log: Correct pathname for manpages after libarchive 3.0.3 update. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Feb 28 14:22:54 2012 (r232252) +++ head/ObsoleteFiles.inc Tue Feb 28 14:35:36 2012 (r232253) @@ -39,22 +39,22 @@ # done # 20120225: libarchive 3.0.3 -OLD_FILES+=man/man3/archive_read_data_into_buffer.3.gz \ - man/man3/archive_read_support_compression_all.3.gz \ - man/man3/archive_read_support_compression_bzip2.3.gz \ - man/man3/archive_read_support_compression_compress.3.gz \ - man/man3/archive_read_support_compression_gzip.3.gz \ - man/man3/archive_read_support_compression_lzma.3.gz \ - man/man3/archive_read_support_compression_none.3.gz \ - man/man3/archive_read_support_compression_program.3.gz \ - man/man3/archive_read_support_compression_program_signature.3.gz \ - man/man3/archive_read_support_compression_xz.3.gz \ - man/man3/archive_write_set_callbacks.3.gz \ - man/man3/archive_write_set_compression_bzip2.3.gz \ - man/man3/archive_write_set_compression_compress.3.gz \ - man/man3/archive_write_set_compression_gzip.3.gz \ - man/man3/archive_write_set_compression_none.3.gz \ - man/man3/archive_write_set_compression_program.3.gz +OLD_FILES+=usr/share/man/man3/archive_read_data_into_buffer.3.gz \ + usr/share/man/man3/archive_read_support_compression_all.3.gz \ + usr/share/man/man3/archive_read_support_compression_bzip2.3.gz \ + usr/share/man/man3/archive_read_support_compression_compress.3.gz \ + usr/share/man/man3/archive_read_support_compression_gzip.3.gz \ + usr/share/man/man3/archive_read_support_compression_lzma.3.gz \ + usr/share/man/man3/archive_read_support_compression_none.3.gz \ + usr/share/man/man3/archive_read_support_compression_program.3.gz \ + usr/share/man/man3/archive_read_support_compression_program_signature.3.gz \ + usr/share/man/man3/archive_read_support_compression_xz.3.gz \ + usr/share/man/man3/archive_write_set_callbacks.3.gz \ + usr/share/man/man3/archive_write_set_compression_bzip2.3.gz \ + usr/share/man/man3/archive_write_set_compression_compress.3.gz \ + usr/share/man/man3/archive_write_set_compression_gzip.3.gz \ + usr/share/man/man3/archive_write_set_compression_none.3.gz \ + usr/share/man/man3/archive_write_set_compression_program.3.gz OLD_LIBS+=usr/lib/libarchive.so.5 .if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64" OLD_LIBS+=usr/lib32/libarchive.so.5 From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 15:07:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D54A6106566B; Tue, 28 Feb 2012 15:07:05 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C42DB8FC0A; Tue, 28 Feb 2012 15:07:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1SF75vE075915; Tue, 28 Feb 2012 15:07:05 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1SF758I075911; Tue, 28 Feb 2012 15:07:05 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201202281507.q1SF758I075911@svn.freebsd.org> From: Kevin Lo Date: Tue, 28 Feb 2012 15:07: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: r232254 - in head: share/man/man5 share/man/man9 sys/netatalk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Feb 2012 15:07:05 -0000 Author: kevlo Date: Tue Feb 28 15:07:05 2012 New Revision: 232254 URL: http://svn.freebsd.org/changeset/base/232254 Log: Fix typos Modified: head/share/man/man5/passwd.5 head/share/man/man9/byteorder.9 head/sys/netatalk/aarp.c Modified: head/share/man/man5/passwd.5 ============================================================================== --- head/share/man/man5/passwd.5 Tue Feb 28 14:35:36 2012 (r232253) +++ head/share/man/man5/passwd.5 Tue Feb 28 15:07:05 2012 (r232254) @@ -232,7 +232,7 @@ user's home phone number .Pp The full .Ar name -may contain a ampersand +may contain an ampersand .Pq Ql & which will be replaced by the capitalized login Modified: head/share/man/man9/byteorder.9 ============================================================================== --- head/share/man/man9/byteorder.9 Tue Feb 28 14:35:36 2012 (r232253) +++ head/share/man/man9/byteorder.9 Tue Feb 28 15:07:05 2012 (r232254) @@ -123,7 +123,7 @@ The .Fn htobe32 , and .Fn htobe64 -functions return a integer in the system's native +functions return an integer in the system's native byte order converted to big endian byte order. The return value will be the same as the argument on big endian systems. .Pp Modified: head/sys/netatalk/aarp.c ============================================================================== --- head/sys/netatalk/aarp.c Tue Feb 28 14:35:36 2012 (r232253) +++ head/sys/netatalk/aarp.c Tue Feb 28 15:07:05 2012 (r232254) @@ -467,7 +467,7 @@ at_aarpinput(struct ifnet *ifp, struct m if (aat != NULL) { if (op == AARPOP_PROBE) { /* - * Someone's probing for spa, dealocate the one we've + * Someone's probing for spa, deallocate the one we've * got, so that if the prober keeps the address, * we'll be able to arp for him. */ From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 15:09:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA55E106567C; Tue, 28 Feb 2012 15:09:56 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA13E8FC08; Tue, 28 Feb 2012 15:09:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1SF9ujK076036; Tue, 28 Feb 2012 15:09:56 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1SF9ubH076034; Tue, 28 Feb 2012 15:09:56 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201202281509.q1SF9ubH076034@svn.freebsd.org> From: Kevin Lo Date: Tue, 28 Feb 2012 15:09: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: r232255 - head/sys/dev/amr X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Feb 2012 15:09:56 -0000 Author: kevlo Date: Tue Feb 28 15:09:56 2012 New Revision: 232255 URL: http://svn.freebsd.org/changeset/base/232255 Log: Fix checks for error return from amr_sglist_map() and amr_ccb_map() Modified: head/sys/dev/amr/amr_pci.c Modified: head/sys/dev/amr/amr_pci.c ============================================================================== --- head/sys/dev/amr/amr_pci.c Tue Feb 28 15:07:05 2012 (r232254) +++ head/sys/dev/amr/amr_pci.c Tue Feb 28 15:09:56 2012 (r232255) @@ -339,11 +339,11 @@ amr_pci_attach(device_t dev) /* * Build the scatter/gather buffers. */ - if (amr_sglist_map(sc)) + if ((error = amr_sglist_map(sc)) != 0) goto out; debug(2, "s/g list mapped"); - if (amr_ccb_map(sc)) + if ((error = amr_ccb_map(sc)) != 0) goto out; debug(2, "ccb mapped"); From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 15:12:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60C86106564A; Tue, 28 Feb 2012 15:12:26 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 505608FC0A; Tue, 28 Feb 2012 15:12:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1SFCQNS076160; Tue, 28 Feb 2012 15:12:26 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1SFCQGq076158; Tue, 28 Feb 2012 15:12:26 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201202281512.q1SFCQGq076158@svn.freebsd.org> From: Kevin Lo Date: Tue, 28 Feb 2012 15: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: r232256 - head/sys/dev/acpi_support X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2012 15:12:26 -0000 Author: kevlo Date: Tue Feb 28 15:12:26 2012 New Revision: 232256 URL: http://svn.freebsd.org/changeset/base/232256 Log: Add missing MODULE_DEPEND() so that acpi.ko and aibs.ko can be loaded dynamically. Modified: head/sys/dev/acpi_support/atk0110.c Modified: head/sys/dev/acpi_support/atk0110.c ============================================================================== --- head/sys/dev/acpi_support/atk0110.c Tue Feb 28 15:09:56 2012 (r232255) +++ head/sys/dev/acpi_support/atk0110.c Tue Feb 28 15:12:26 2012 (r232256) @@ -97,7 +97,7 @@ static driver_t aibs_driver = { static devclass_t aibs_devclass; DRIVER_MODULE(aibs, acpi, aibs_driver, aibs_devclass, NULL, NULL); - +MODULE_DEPEND(aibs, acpi, 1, 1, 1); static char* aibs_hids[] = { "ATK0110", From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 15:18:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13D0F1065674; Tue, 28 Feb 2012 15:18:27 +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 DC7498FC17; Tue, 28 Feb 2012 15:18:26 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 9304246B2D; Tue, 28 Feb 2012 10:18:26 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 8C407B967; Tue, 28 Feb 2012 10:18:25 -0500 (EST) From: John Baldwin To: Julian Elischer Date: Tue, 28 Feb 2012 08:41:53 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201202261425.q1QEPm9g069102@svn.freebsd.org> <20120227092951.GB55074@deviant.kiev.zoral.com.ua> <4F4C7571.7010407@freebsd.org> In-Reply-To: <4F4C7571.7010407@freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201202280841.53552.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 28 Feb 2012 10:18:25 -0500 (EST) Cc: src-committers@freebsd.org, Pawel Jakub Dawidek , svn-src-all@freebsd.org, Mikolaj Golub , svn-src-head@freebsd.org, Konstantin Belousov Subject: Re: svn commit: r232181 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2012 15:18:27 -0000 On Tuesday, February 28, 2012 1:34:25 am Julian Elischer wrote: > On 2/27/12 1:29 AM, Konstantin Belousov wrote: > > On Mon, Feb 27, 2012 at 10:49:59AM +0200, Mikolaj Golub wrote: > >> On Mon, 27 Feb 2012 09:28:11 +0100 Pawel Jakub Dawidek wrote: > >> > >> PJD> On Sun, Feb 26, 2012 at 02:25:48PM +0000, Mikolaj Golub wrote: > >> >> Author: trociny > >> >> Date: Sun Feb 26 14:25:48 2012 > >> >> New Revision: 232181 > >> >> URL: http://svn.freebsd.org/changeset/base/232181 > >> >> > >> >> Log: > >> >> Add sysctl to retrieve or set umask of another process. > >> > >> PJD> "set umask of another process"? This seems... weird. What's the purpose > >> PJD> of this change? > >> > >> When we were discussing this with Kostik and Robert, and I asked if it could > >> be useful to have the sysctl rw, Kostik described a real situation when he had > >> had to change umask of another process: umask had not been set properly on an > >> aplication start but it could not be restarted until the end of the day. > >> Kostik was able to fix it using gdb but having an easier way looked useful. > > kgdb, not gdb. > > > > It is indeed possible to write a ptrace-based utility that inject a code > > payload that would change umask. Since this is very risky but indeed possible, > > having the straighforward kernel facility is justified. > Why not have a sysctl to change a process' uid, cwd, memory limits, > etc. etc. uid and cwd would be rediculous to change. However, we recently added sysctls to allow a sysadmin to read and write the limits of other processes (and that is a very useful feature indeed since it is not unusual for a long-running process to require more resources than it was initially allocated, as is the ability to easily query the limits that a given process is subject to). > I don't think this belongs in the kernel by default. It's not exactl a > call for backout but It's teh next thing short of that. a call for "do > you REALLY think we need this particular specific case catered for?" That said, the umask bit does strike me as a bit more odd than the limits case. I would have more need of a tool to let me adjust the listen queue length of a socket than to adjust umask (I've had to do that multiple times via kgdb). -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 15:45:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94568106566C; Tue, 28 Feb 2012 15:45:42 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 831958FC0C; Tue, 28 Feb 2012 15:45:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1SFjg7Z077213; Tue, 28 Feb 2012 15:45:42 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1SFjgZm077208; Tue, 28 Feb 2012 15:45:42 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201202281545.q1SFjgZm077208@svn.freebsd.org> From: Kevin Lo Date: Tue, 28 Feb 2012 15:45: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: r232257 - in head: share/man/man4 sys/dev/usb sys/dev/usb/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2012 15:45:42 -0000 Author: kevlo Date: Tue Feb 28 15:45:42 2012 New Revision: 232257 URL: http://svn.freebsd.org/changeset/base/232257 Log: Add support for the MCS7832 Obtained from: OpenBSD Modified: head/share/man/man4/mos.4 head/sys/dev/usb/net/if_mos.c head/sys/dev/usb/net/if_mosreg.h head/sys/dev/usb/usbdevs Modified: head/share/man/man4/mos.4 ============================================================================== --- head/share/man/man4/mos.4 Tue Feb 28 15:12:26 2012 (r232256) +++ head/share/man/man4/mos.4 Tue Feb 28 15:45:42 2012 (r232257) @@ -20,7 +20,7 @@ .Os .Sh NAME .Nm mos -.Nd Moschip MCS7730/MCS7840 USB Ethernet driver +.Nd Moschip MCS7730/MCS7830/MCS7832 USB Ethernet driver .Sh SYNOPSIS To compile this driver into the kernel, place the following lines in your @@ -44,9 +44,9 @@ if_mos_load="YES" The .Nm driver provides support for USB Ethernet adapters based on the -Moschip MCS7730/MCS7830 chipset. +Moschip MCS7730/MCS7830/MCS7832 chipset. .Pp -The adapters that contain the Moschip MCS7730/MCS7830 chipset +The adapters that contain the Moschip MCS7730/MCS7830/MCS7832 chipset will operate at 100Base-TX and full-duplex. .Pp The Moschip contains a 10/100 Modified: head/sys/dev/usb/net/if_mos.c ============================================================================== --- head/sys/dev/usb/net/if_mos.c Tue Feb 28 15:12:26 2012 (r232256) +++ head/sys/dev/usb/net/if_mos.c Tue Feb 28 15:45:42 2012 (r232257) @@ -82,7 +82,7 @@ __FBSDID("$FreeBSD$"); /* - * Moschip MCS7730/MCS7830 USB to Ethernet controller + * Moschip MCS7730/MCS7830/MCS7832 USB to Ethernet controller * The datasheet is available at the following URL: * http://www.moschip.com/data/products/MCS7830/Data%20Sheet_7830.pdf */ @@ -149,6 +149,7 @@ SYSCTL_INT(_hw_usb_mos, OID_AUTO, debug, static const STRUCT_USB_HOST_ID mos_devs[] = { {USB_VPI(USB_VENDOR_MOSCHIP, USB_PRODUCT_MOSCHIP_MCS7730, MCS7730)}, {USB_VPI(USB_VENDOR_MOSCHIP, USB_PRODUCT_MOSCHIP_MCS7830, MCS7830)}, + {USB_VPI(USB_VENDOR_MOSCHIP, USB_PRODUCT_MOSCHIP_MCS7832, MCS7832)}, {USB_VPI(USB_VENDOR_SITECOMEU, USB_PRODUCT_SITECOMEU_LN030, MCS7830)}, }; @@ -715,6 +716,8 @@ mos_attach(device_t dev) MOS_DPRINTFN("model: MCS7730"); } else if (sc->mos_flags & MCS7830) { MOS_DPRINTFN("model: MCS7830"); + } else if (sc->mos_flags & MCS7832) { + MOS_DPRINTFN("model: MCS7832"); } error = uether_ifattach(ue); if (error) { Modified: head/sys/dev/usb/net/if_mosreg.h ============================================================================== --- head/sys/dev/usb/net/if_mosreg.h Tue Feb 28 15:12:26 2012 (r232256) +++ head/sys/dev/usb/net/if_mosreg.h Tue Feb 28 15:45:42 2012 (r232257) @@ -152,6 +152,7 @@ #define MCS7730 0x0001 #define MCS7830 0x0002 +#define MCS7832 0x0004 #define MOS_INC(x, y) (x) = (x + 1) % y Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue Feb 28 15:12:26 2012 (r232256) +++ head/sys/dev/usb/usbdevs Tue Feb 28 15:45:42 2012 (r232257) @@ -2306,6 +2306,7 @@ product MOSCHIP MCS7703 0x7703 MCS7703 product MOSCHIP MCS7730 0x7730 MCS7730 Ethernet product MOSCHIP MCS7820 0x7820 MCS7820 Serial Port Adapter product MOSCHIP MCS7830 0x7830 MCS7830 Ethernet +product MOSCHIP MCS7832 0x7832 MCS7832 Ethernet product MOSCHIP MCS7840 0x7840 MCS7840 Serial Port Adapter /* Motorola products */ From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 15:47:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6CFA1065673; Tue, 28 Feb 2012 15:47:39 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D35F8FC08; Tue, 28 Feb 2012 15:47:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1SFld9p077310; Tue, 28 Feb 2012 15:47:39 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1SFld3E077308; Tue, 28 Feb 2012 15:47:39 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201202281547.q1SFld3E077308@svn.freebsd.org> From: Kevin Lo Date: Tue, 28 Feb 2012 15:47: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: r232258 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2012 15:47:39 -0000 Author: kevlo Date: Tue Feb 28 15:47:39 2012 New Revision: 232258 URL: http://svn.freebsd.org/changeset/base/232258 Log: Mention mos(4) Modified: head/share/man/man4/usb.4 Modified: head/share/man/man4/usb.4 ============================================================================== --- head/share/man/man4/usb.4 Tue Feb 28 15:45:42 2012 (r232257) +++ head/share/man/man4/usb.4 Tue Feb 28 15:47:39 2012 (r232258) @@ -150,6 +150,7 @@ specifications can be found at: .Xr cue 4 , .Xr ehci 4 , .Xr kue 4 , +.Xr mos 4 , .Xr ohci 4 , .Xr pci 4 , .Xr rue 4 , From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 15:52:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 796BA106566B; Tue, 28 Feb 2012 15:52:02 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4DDC98FC13; Tue, 28 Feb 2012 15:52:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1SFq2ji077489; Tue, 28 Feb 2012 15:52:02 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1SFq2AI077486; Tue, 28 Feb 2012 15:52:02 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201202281552.q1SFq2AI077486@svn.freebsd.org> From: Rick Macklem Date: Tue, 28 Feb 2012 15:52:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232259 - in stable/9/sys: fs/nfsserver i386/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2012 15:52:02 -0000 Author: rmacklem Date: Tue Feb 28 15:52:01 2012 New Revision: 232259 URL: http://svn.freebsd.org/changeset/base/232259 Log: MFC: r232050 hrs@ reported a panic to freebsd-stable@ under the subject line "panic in 8.3-PRERELEASE" on Feb. 22, 2012. This panic was caused by use of a mix of tsleep() and msleep() calls on the same event in the new NFS server DRC code. It did "mtx_unlock(); tsleep();" in two places, which kib@ noted introduced a slight risk that the wakeup() would occur before the tsleep(), resulting in a 10sec delay before waking up. This patch fixes the problem by replacing "mtx_unlock(); tsleep();" with mtx_sleep(..PDROP..). It also changes a nfsmsleep() call to mtx_sleep() so that the code uses mtx_sleep() consistently within the file. Modified: stable/9/sys/fs/nfsserver/nfs_nfsdcache.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/i386/conf/XENHVM (props changed) Modified: stable/9/sys/fs/nfsserver/nfs_nfsdcache.c ============================================================================== --- stable/9/sys/fs/nfsserver/nfs_nfsdcache.c Tue Feb 28 15:47:39 2012 (r232258) +++ stable/9/sys/fs/nfsserver/nfs_nfsdcache.c Tue Feb 28 15:52:01 2012 (r232259) @@ -336,9 +336,8 @@ loop: nfsaddr_match(NETFAMILY(rp), &rp->rc_haddr, nd->nd_nam)) { if ((rp->rc_flag & RC_LOCKED) != 0) { rp->rc_flag |= RC_WANTED; - NFSUNLOCKCACHE(); - (void) tsleep((caddr_t)rp, PZERO - 1, - "nfsrc", 10 * hz); + (void)mtx_sleep(rp, NFSCACHEMUTEXPTR, + (PZERO - 1) | PDROP, "nfsrc", 10 * hz); goto loop; } if (rp->rc_flag == 0) @@ -622,8 +621,8 @@ tryagain: rp = hitrp; if ((rp->rc_flag & RC_LOCKED) != 0) { rp->rc_flag |= RC_WANTED; - NFSUNLOCKCACHE(); - (void) tsleep((caddr_t)rp, PZERO-1, "nfsrc", 10 * hz); + (void)mtx_sleep(rp, NFSCACHEMUTEXPTR, + (PZERO - 1) | PDROP, "nfsrc", 10 * hz); goto tryagain; } if (rp->rc_flag == 0) @@ -694,7 +693,7 @@ nfsrc_lock(struct nfsrvcache *rp) NFSCACHELOCKREQUIRED(); while ((rp->rc_flag & RC_LOCKED) != 0) { rp->rc_flag |= RC_WANTED; - (void) nfsmsleep((caddr_t)rp, NFSCACHEMUTEXPTR, PZERO - 1, + (void)mtx_sleep(rp, NFSCACHEMUTEXPTR, PZERO - 1, "nfsrc", 0); } rp->rc_flag |= RC_LOCKED; From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 17:29:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9343106566B; Tue, 28 Feb 2012 17:29:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B8CA68FC17; Tue, 28 Feb 2012 17:29:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1SHTVhi080514; Tue, 28 Feb 2012 17:29:31 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1SHTVsj080512; Tue, 28 Feb 2012 17:29:31 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201202281729.q1SHTVsj080512@svn.freebsd.org> From: Ed Maste Date: Tue, 28 Feb 2012 17:29: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: r232260 - head/sys/dev/aac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Feb 2012 17:29:31 -0000 Author: emaste Date: Tue Feb 28 17:29:31 2012 New Revision: 232260 URL: http://svn.freebsd.org/changeset/base/232260 Log: Avoid transfers crossing a 4GB boundary, which can lead to data corruption. Thanks to scottl@ for the suggestion. This change will likely be revised after consideration of a general method to address this type of issue for other drivers. Sponsored by: Sandvine Incorporated MFC after: 3 days Modified: head/sys/dev/aac/aac_pci.c Modified: head/sys/dev/aac/aac_pci.c ============================================================================== --- head/sys/dev/aac/aac_pci.c Tue Feb 28 15:52:01 2012 (r232259) +++ head/sys/dev/aac/aac_pci.c Tue Feb 28 17:29:31 2012 (r232260) @@ -403,7 +403,8 @@ aac_pci_attach(device_t dev) * Note that some of these controllers are 64-bit capable. */ if (bus_dma_tag_create(NULL, /* parent */ - PAGE_SIZE, 0, /* algnmnt, boundary */ + PAGE_SIZE, /* alignment */ + ((bus_size_t)((uint64_t)1 << 32)), /* boundary*/ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 18:15:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14FAD106564A; Tue, 28 Feb 2012 18:15:29 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE0958FC15; Tue, 28 Feb 2012 18:15:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1SIFSMP082035; Tue, 28 Feb 2012 18:15:28 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1SIFSbB082030; Tue, 28 Feb 2012 18:15:28 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201202281815.q1SIFSbB082030@svn.freebsd.org> From: Tijl Coosemans Date: Tue, 28 Feb 2012 18:15: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: r232261 - in head/sys: amd64/include i386/include pc98/include x86/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2012 18:15:29 -0000 Author: tijl Date: Tue Feb 28 18:15:28 2012 New Revision: 232261 URL: http://svn.freebsd.org/changeset/base/232261 Log: Copy amd64 _types.h to x86 and merge with i386 _types.h. Replace existing amd64/i386/pc98 _types.h with stubs. Added: head/sys/x86/include/_types.h - copied, changed from r232259, head/sys/amd64/include/_types.h Modified: head/sys/amd64/include/_types.h head/sys/i386/include/_types.h head/sys/pc98/include/_types.h Modified: head/sys/amd64/include/_types.h ============================================================================== --- head/sys/amd64/include/_types.h Tue Feb 28 17:29:31 2012 (r232260) +++ head/sys/amd64/include/_types.h Tue Feb 28 18:15:28 2012 (r232261) @@ -1,116 +1,6 @@ /*- - * Copyright (c) 2002 Mike Barcroft - * Copyright (c) 1990, 1993 - * The Regents of the University of California. 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * From: @(#)ansi.h 8.2 (Berkeley) 1/4/94 - * From: @(#)types.h 8.3 (Berkeley) 1/5/94 - * $FreeBSD$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE__TYPES_H_ -#define _MACHINE__TYPES_H_ - -#ifndef _SYS_CDEFS_H_ -#error this file needs sys/cdefs.h as a prerequisite -#endif - -#define __NO_STRICT_ALIGNMENT - -/* - * Basic types upon which most other types are built. - */ -typedef signed char __int8_t; -typedef unsigned char __uint8_t; -typedef short __int16_t; -typedef unsigned short __uint16_t; -typedef int __int32_t; -typedef unsigned int __uint32_t; -typedef long __int64_t; -typedef unsigned long __uint64_t; - -/* - * Standard type definitions. - */ -typedef __int32_t __clock_t; /* clock()... */ -typedef __int64_t __critical_t; -typedef double __double_t; -typedef float __float_t; -typedef __int64_t __intfptr_t; -typedef __int64_t __intmax_t; -typedef __int64_t __intptr_t; -typedef __int32_t __int_fast8_t; -typedef __int32_t __int_fast16_t; -typedef __int32_t __int_fast32_t; -typedef __int64_t __int_fast64_t; -typedef __int8_t __int_least8_t; -typedef __int16_t __int_least16_t; -typedef __int32_t __int_least32_t; -typedef __int64_t __int_least64_t; -typedef __int64_t __ptrdiff_t; /* ptr1 - ptr2 */ -typedef __int64_t __register_t; -typedef __int64_t __segsz_t; /* segment size (in pages) */ -typedef __uint64_t __size_t; /* sizeof() */ -typedef __int64_t __ssize_t; /* byte count or error */ -typedef __int64_t __time_t; /* time()... */ -typedef __uint64_t __uintfptr_t; -typedef __uint64_t __uintmax_t; -typedef __uint64_t __uintptr_t; -typedef __uint32_t __uint_fast8_t; -typedef __uint32_t __uint_fast16_t; -typedef __uint32_t __uint_fast32_t; -typedef __uint64_t __uint_fast64_t; -typedef __uint8_t __uint_least8_t; -typedef __uint16_t __uint_least16_t; -typedef __uint32_t __uint_least32_t; -typedef __uint64_t __uint_least64_t; -typedef __uint64_t __u_register_t; -typedef __uint64_t __vm_offset_t; -typedef __int64_t __vm_ooffset_t; -typedef __uint64_t __vm_paddr_t; -typedef __uint64_t __vm_pindex_t; -typedef __uint64_t __vm_size_t; - -/* - * Unusual type definitions. - */ -#ifdef __GNUCLIKE_BUILTIN_VARARGS -typedef __builtin_va_list __va_list; /* internally known to gcc */ -#elif defined(lint) -typedef char * __va_list; /* pretend */ -#endif -#if defined(__GNUC_VA_LIST_COMPATIBILITY) && !defined(__GNUC_VA_LIST) \ - && !defined(__NO_GNUC_VA_LIST) -#define __GNUC_VA_LIST -typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/ -#endif - -#endif /* !_MACHINE__TYPES_H_ */ +#include Modified: head/sys/i386/include/_types.h ============================================================================== --- head/sys/i386/include/_types.h Tue Feb 28 17:29:31 2012 (r232260) +++ head/sys/i386/include/_types.h Tue Feb 28 18:15:28 2012 (r232261) @@ -1,128 +1,6 @@ /*- - * Copyright (c) 2002 Mike Barcroft - * Copyright (c) 1990, 1993 - * The Regents of the University of California. 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * From: @(#)ansi.h 8.2 (Berkeley) 1/4/94 - * From: @(#)types.h 8.3 (Berkeley) 1/5/94 - * $FreeBSD$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE__TYPES_H_ -#define _MACHINE__TYPES_H_ - -#ifndef _SYS_CDEFS_H_ -#error this file needs sys/cdefs.h as a prerequisite -#endif - -#define __NO_STRICT_ALIGNMENT - -/* - * Basic types upon which most other types are built. - */ -typedef signed char __int8_t; -typedef unsigned char __uint8_t; -typedef short __int16_t; -typedef unsigned short __uint16_t; -typedef int __int32_t; -typedef unsigned int __uint32_t; -#ifndef lint -__extension__ -#endif -/* LONGLONG */ -typedef long long __int64_t; -#ifndef lint -__extension__ -#endif -/* LONGLONG */ -typedef unsigned long long __uint64_t; - -/* - * Standard type definitions. - */ -typedef unsigned long __clock_t; /* clock()... */ -typedef __int32_t __critical_t; -typedef long double __double_t; -typedef long double __float_t; -typedef __int32_t __intfptr_t; -typedef __int64_t __intmax_t; -typedef __int32_t __intptr_t; -typedef __int32_t __int_fast8_t; -typedef __int32_t __int_fast16_t; -typedef __int32_t __int_fast32_t; -typedef __int64_t __int_fast64_t; -typedef __int8_t __int_least8_t; -typedef __int16_t __int_least16_t; -typedef __int32_t __int_least32_t; -typedef __int64_t __int_least64_t; -typedef __int32_t __ptrdiff_t; /* ptr1 - ptr2 */ -typedef __int32_t __register_t; -typedef __int32_t __segsz_t; /* segment size (in pages) */ -typedef __uint32_t __size_t; /* sizeof() */ -typedef __int32_t __ssize_t; /* byte count or error */ -typedef __int32_t __time_t; /* time()... */ -typedef __uint32_t __uintfptr_t; -typedef __uint64_t __uintmax_t; -typedef __uint32_t __uintptr_t; -typedef __uint32_t __uint_fast8_t; -typedef __uint32_t __uint_fast16_t; -typedef __uint32_t __uint_fast32_t; -typedef __uint64_t __uint_fast64_t; -typedef __uint8_t __uint_least8_t; -typedef __uint16_t __uint_least16_t; -typedef __uint32_t __uint_least32_t; -typedef __uint64_t __uint_least64_t; -typedef __uint32_t __u_register_t; -typedef __uint32_t __vm_offset_t; -typedef __int64_t __vm_ooffset_t; -#ifdef PAE -typedef __uint64_t __vm_paddr_t; -#else -typedef __uint32_t __vm_paddr_t; -#endif -typedef __uint64_t __vm_pindex_t; -typedef __uint32_t __vm_size_t; - -/* - * Unusual type definitions. - */ -#ifdef __GNUCLIKE_BUILTIN_VARARGS -typedef __builtin_va_list __va_list; /* internally known to gcc */ -#else -typedef char * __va_list; -#endif /* __GNUCLIKE_BUILTIN_VARARGS */ -#if defined(__GNUC_VA_LIST_COMPATIBILITY) && !defined(__GNUC_VA_LIST) \ - && !defined(__NO_GNUC_VA_LIST) -#define __GNUC_VA_LIST -typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/ -#endif - -#endif /* !_MACHINE__TYPES_H_ */ +#include Modified: head/sys/pc98/include/_types.h ============================================================================== --- head/sys/pc98/include/_types.h Tue Feb 28 17:29:31 2012 (r232260) +++ head/sys/pc98/include/_types.h Tue Feb 28 18:15:28 2012 (r232261) @@ -3,4 +3,4 @@ */ /* $FreeBSD$ */ -#include +#include Copied and modified: head/sys/x86/include/_types.h (from r232259, head/sys/amd64/include/_types.h) ============================================================================== --- head/sys/amd64/include/_types.h Tue Feb 28 15:52:01 2012 (r232259, copy source) +++ head/sys/x86/include/_types.h Tue Feb 28 18:15:28 2012 (r232261) @@ -54,19 +54,41 @@ typedef short __int16_t; typedef unsigned short __uint16_t; typedef int __int32_t; typedef unsigned int __uint32_t; +#ifdef _LP64 typedef long __int64_t; typedef unsigned long __uint64_t; +#else +#ifndef lint +__extension__ +#endif +/* LONGLONG */ +typedef long long __int64_t; +#ifndef lint +__extension__ +#endif +/* LONGLONG */ +typedef unsigned long long __uint64_t; +#endif /* * Standard type definitions. */ +#ifdef _LP64 typedef __int32_t __clock_t; /* clock()... */ typedef __int64_t __critical_t; typedef double __double_t; typedef float __float_t; typedef __int64_t __intfptr_t; -typedef __int64_t __intmax_t; typedef __int64_t __intptr_t; +#else +typedef unsigned long __clock_t; +typedef __int32_t __critical_t; +typedef long double __double_t; +typedef long double __float_t; +typedef __int32_t __intfptr_t; +typedef __int32_t __intptr_t; +#endif +typedef __int64_t __intmax_t; typedef __int32_t __int_fast8_t; typedef __int32_t __int_fast16_t; typedef __int32_t __int_fast32_t; @@ -75,6 +97,7 @@ typedef __int8_t __int_least8_t; typedef __int16_t __int_least16_t; typedef __int32_t __int_least32_t; typedef __int64_t __int_least64_t; +#ifdef _LP64 typedef __int64_t __ptrdiff_t; /* ptr1 - ptr2 */ typedef __int64_t __register_t; typedef __int64_t __segsz_t; /* segment size (in pages) */ @@ -82,8 +105,18 @@ typedef __uint64_t __size_t; /* sizeof( typedef __int64_t __ssize_t; /* byte count or error */ typedef __int64_t __time_t; /* time()... */ typedef __uint64_t __uintfptr_t; -typedef __uint64_t __uintmax_t; typedef __uint64_t __uintptr_t; +#else +typedef __int32_t __ptrdiff_t; +typedef __int32_t __register_t; +typedef __int32_t __segsz_t; +typedef __uint32_t __size_t; +typedef __int32_t __ssize_t; +typedef __int32_t __time_t; +typedef __uint32_t __uintfptr_t; +typedef __uint32_t __uintptr_t; +#endif +typedef __uint64_t __uintmax_t; typedef __uint32_t __uint_fast8_t; typedef __uint32_t __uint_fast16_t; typedef __uint32_t __uint_fast32_t; @@ -92,12 +125,23 @@ typedef __uint8_t __uint_least8_t; typedef __uint16_t __uint_least16_t; typedef __uint32_t __uint_least32_t; typedef __uint64_t __uint_least64_t; +#ifdef _LP64 typedef __uint64_t __u_register_t; typedef __uint64_t __vm_offset_t; -typedef __int64_t __vm_ooffset_t; typedef __uint64_t __vm_paddr_t; -typedef __uint64_t __vm_pindex_t; typedef __uint64_t __vm_size_t; +#else +typedef __uint32_t __u_register_t; +typedef __uint32_t __vm_offset_t; +#ifdef PAE +typedef __uint64_t __vm_paddr_t; +#else +typedef __uint32_t __vm_paddr_t; +#endif +typedef __uint32_t __vm_size_t; +#endif +typedef __int64_t __vm_ooffset_t; +typedef __uint64_t __vm_pindex_t; /* * Unusual type definitions. From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 18:24:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F4081065672; Tue, 28 Feb 2012 18:24:29 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7CFC58FC19; Tue, 28 Feb 2012 18:24:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1SIOTfP082349; Tue, 28 Feb 2012 18:24:29 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1SIOTdp082344; Tue, 28 Feb 2012 18:24:29 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201202281824.q1SIOTdp082344@svn.freebsd.org> From: Tijl Coosemans Date: Tue, 28 Feb 2012 18:24: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: r232262 - in head/sys: amd64/include i386/include pc98/include x86/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2012 18:24:29 -0000 Author: tijl Date: Tue Feb 28 18:24:28 2012 New Revision: 232262 URL: http://svn.freebsd.org/changeset/base/232262 Log: Copy amd64 _limits.h to x86 and merge with i386 _limits.h. Replace amd64/i386/pc98 _limits.h with stubs. Added: head/sys/x86/include/_limits.h - copied, changed from r232259, head/sys/amd64/include/_limits.h Modified: head/sys/amd64/include/_limits.h head/sys/i386/include/_limits.h head/sys/pc98/include/_limits.h Modified: head/sys/amd64/include/_limits.h ============================================================================== --- head/sys/amd64/include/_limits.h Tue Feb 28 18:15:28 2012 (r232261) +++ head/sys/amd64/include/_limits.h Tue Feb 28 18:24:28 2012 (r232262) @@ -1,87 +1,6 @@ /*- - * Copyright (c) 1988, 1993 - * The Regents of the University of California. 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. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)limits.h 8.3 (Berkeley) 1/4/94 - * $FreeBSD$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE__LIMITS_H_ -#define _MACHINE__LIMITS_H_ - -/* - * According to ANSI (section 2.2.4.2), the values below must be usable by - * #if preprocessing directives. Additionally, the expression must have the - * same type as would an expression that is an object of the corresponding - * type converted according to the integral promotions. The subtraction for - * INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an - * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). - */ - -#define __CHAR_BIT 8 /* number of bits in a char */ - -#define __SCHAR_MAX 0x7f /* max value for a signed char */ -#define __SCHAR_MIN (-0x7f - 1) /* min value for a signed char */ - -#define __UCHAR_MAX 0xff /* max value for an unsigned char */ - -#define __USHRT_MAX 0xffff /* max value for an unsigned short */ -#define __SHRT_MAX 0x7fff /* max value for a short */ -#define __SHRT_MIN (-0x7fff - 1) /* min value for a short */ - -#define __UINT_MAX 0xffffffff /* max value for an unsigned int */ -#define __INT_MAX 0x7fffffff /* max value for an int */ -#define __INT_MIN (-0x7fffffff - 1) /* min value for an int */ - -#define __ULONG_MAX 0xffffffffffffffff /* max for an unsigned long */ -#define __LONG_MAX 0x7fffffffffffffff /* max for a long */ -#define __LONG_MIN (-0x7fffffffffffffff - 1) /* min for a long */ - - /* max value for an unsigned long long */ -#define __ULLONG_MAX 0xffffffffffffffffULL -#define __LLONG_MAX 0x7fffffffffffffffLL /* max value for a long long */ -#define __LLONG_MIN (-0x7fffffffffffffffLL - 1) /* min for a long long */ - -#define __SSIZE_MAX __LONG_MAX /* max value for a ssize_t */ - -#define __SIZE_T_MAX __ULONG_MAX /* max value for a size_t */ - -#define __OFF_MAX __LONG_MAX /* max value for an off_t */ -#define __OFF_MIN __LONG_MIN /* min value for an off_t */ - -/* Quads and longs are the same on the amd64. Ensure they stay in sync. */ -#define __UQUAD_MAX __ULONG_MAX /* max value for a uquad_t */ -#define __QUAD_MAX __LONG_MAX /* max value for a quad_t */ -#define __QUAD_MIN __LONG_MIN /* min value for a quad_t */ - -#define __LONG_BIT 64 -#define __WORD_BIT 32 - -/* Minimum signal stack size. */ -#define __MINSIGSTKSZ (512 * 4) - -#endif /* !_MACHINE__LIMITS_H_ */ +#include Modified: head/sys/i386/include/_limits.h ============================================================================== --- head/sys/i386/include/_limits.h Tue Feb 28 18:15:28 2012 (r232261) +++ head/sys/i386/include/_limits.h Tue Feb 28 18:24:28 2012 (r232262) @@ -1,87 +1,6 @@ /*- - * Copyright (c) 1988, 1993 - * The Regents of the University of California. 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. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)limits.h 8.3 (Berkeley) 1/4/94 - * $FreeBSD$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE__LIMITS_H_ -#define _MACHINE__LIMITS_H_ - -/* - * According to ANSI (section 2.2.4.2), the values below must be usable by - * #if preprocessing directives. Additionally, the expression must have the - * same type as would an expression that is an object of the corresponding - * type converted according to the integral promotions. The subtraction for - * INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an - * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2). - */ - -#define __CHAR_BIT 8 /* number of bits in a char */ - -#define __SCHAR_MAX 0x7f /* max value for a signed char */ -#define __SCHAR_MIN (-0x7f - 1) /* min value for a signed char */ - -#define __UCHAR_MAX 0xff /* max value for an unsigned char */ - -#define __USHRT_MAX 0xffff /* max value for an unsigned short */ -#define __SHRT_MAX 0x7fff /* max value for a short */ -#define __SHRT_MIN (-0x7fff - 1) /* min value for a short */ - -#define __UINT_MAX 0xffffffff /* max value for an unsigned int */ -#define __INT_MAX 0x7fffffff /* max value for an int */ -#define __INT_MIN (-0x7fffffff - 1) /* min value for an int */ - -#define __ULONG_MAX 0xffffffffUL /* max value for an unsigned long */ -#define __LONG_MAX 0x7fffffffL /* max value for a long */ -#define __LONG_MIN (-0x7fffffffL - 1) /* min value for a long */ - - /* max value for an unsigned long long */ -#define __ULLONG_MAX 0xffffffffffffffffULL -#define __LLONG_MAX 0x7fffffffffffffffLL /* max value for a long long */ -#define __LLONG_MIN (-0x7fffffffffffffffLL - 1) /* min for a long long */ - -#define __SSIZE_MAX __INT_MAX /* max value for a ssize_t */ - -#define __SIZE_T_MAX __UINT_MAX /* max value for a size_t */ - -#define __OFF_MAX __LLONG_MAX /* max value for an off_t */ -#define __OFF_MIN __LLONG_MIN /* min value for an off_t */ - -/* Quads and long longs are the same size. Ensure they stay in sync. */ -#define __UQUAD_MAX __ULLONG_MAX /* max value for a uquad_t */ -#define __QUAD_MAX __LLONG_MAX /* max value for a quad_t */ -#define __QUAD_MIN __LLONG_MIN /* min value for a quad_t */ - -#define __LONG_BIT 32 -#define __WORD_BIT 32 - -/* Minimum signal stack size. */ -#define __MINSIGSTKSZ (512 * 4) - -#endif /* !_MACHINE__LIMITS_H_ */ +#include Modified: head/sys/pc98/include/_limits.h ============================================================================== --- head/sys/pc98/include/_limits.h Tue Feb 28 18:15:28 2012 (r232261) +++ head/sys/pc98/include/_limits.h Tue Feb 28 18:24:28 2012 (r232262) @@ -3,4 +3,4 @@ */ /* $FreeBSD$ */ -#include +#include Copied and modified: head/sys/x86/include/_limits.h (from r232259, head/sys/amd64/include/_limits.h) ============================================================================== --- head/sys/amd64/include/_limits.h Tue Feb 28 15:52:01 2012 (r232259, copy source) +++ head/sys/x86/include/_limits.h Tue Feb 28 18:24:28 2012 (r232262) @@ -57,28 +57,42 @@ #define __INT_MAX 0x7fffffff /* max value for an int */ #define __INT_MIN (-0x7fffffff - 1) /* min value for an int */ +#ifdef _LP64 #define __ULONG_MAX 0xffffffffffffffff /* max for an unsigned long */ #define __LONG_MAX 0x7fffffffffffffff /* max for a long */ #define __LONG_MIN (-0x7fffffffffffffff - 1) /* min for a long */ +#else +#define __ULONG_MAX 0xffffffffUL +#define __LONG_MAX 0x7fffffffL +#define __LONG_MIN (-0x7fffffffL - 1) +#endif /* max value for an unsigned long long */ #define __ULLONG_MAX 0xffffffffffffffffULL #define __LLONG_MAX 0x7fffffffffffffffLL /* max value for a long long */ #define __LLONG_MIN (-0x7fffffffffffffffLL - 1) /* min for a long long */ +#ifdef _LP64 #define __SSIZE_MAX __LONG_MAX /* max value for a ssize_t */ - #define __SIZE_T_MAX __ULONG_MAX /* max value for a size_t */ - #define __OFF_MAX __LONG_MAX /* max value for an off_t */ #define __OFF_MIN __LONG_MIN /* min value for an off_t */ - /* Quads and longs are the same on the amd64. Ensure they stay in sync. */ #define __UQUAD_MAX __ULONG_MAX /* max value for a uquad_t */ #define __QUAD_MAX __LONG_MAX /* max value for a quad_t */ #define __QUAD_MIN __LONG_MIN /* min value for a quad_t */ - #define __LONG_BIT 64 +#else +#define __SSIZE_MAX __INT_MAX +#define __SIZE_T_MAX __UINT_MAX +#define __OFF_MAX __LLONG_MAX +#define __OFF_MIN __LLONG_MIN +#define __UQUAD_MAX __ULLONG_MAX +#define __QUAD_MAX __LLONG_MAX +#define __QUAD_MIN __LLONG_MIN +#define __LONG_BIT 32 +#endif + #define __WORD_BIT 32 /* Minimum signal stack size. */ From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 18:30:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E853106566B; Tue, 28 Feb 2012 18:30:19 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A4AD8FC19; Tue, 28 Feb 2012 18:30:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1SIUJNR082587; Tue, 28 Feb 2012 18:30:19 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1SIUIIM082560; Tue, 28 Feb 2012 18:30:18 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201202281830.q1SIUIIM082560@svn.freebsd.org> From: Dimitry Andric Date: Tue, 28 Feb 2012 18:30: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: r232263 - in head: lib/libsm lib/libthread_db lib/libz libexec/mail.local libexec/smrsh sbin/fsdb share/mk sys/boot/i386/boot0 sys/boot/i386/boot2 sys/boot/i386/btx/btx sys/boot/i386/bt... X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Feb 2012 18:30:19 -0000 Author: dim Date: Tue Feb 28 18:30:18 2012 New Revision: 232263 URL: http://svn.freebsd.org/changeset/base/232263 Log: Define several extra macros in bsd.sys.mk and sys/conf/kern.pre.mk, to get rid of testing explicitly for clang (using ${CC:T:Mclang}) in individual Makefiles. Instead, use the following extra macros, for use with clang: - NO_WERROR.clang (disables -Werror) - NO_WCAST_ALIGN.clang (disables -Wcast-align) - NO_WFORMAT.clang (disables -Wformat and friends) - CLANG_NO_IAS (disables integrated assembler) - CLANG_OPT_SMALL (adds flags for extra small size optimizations) As a side effect, this enables setting CC/CXX/CPP in src.conf instead of make.conf! For clang, use the following: CC=clang CXX=clang++ CPP=clang-cpp MFC after: 2 weeks Modified: head/lib/libsm/Makefile head/lib/libthread_db/Makefile head/lib/libz/Makefile head/libexec/mail.local/Makefile head/libexec/smrsh/Makefile head/sbin/fsdb/Makefile head/share/mk/bsd.sys.mk head/sys/boot/i386/boot0/Makefile head/sys/boot/i386/boot2/Makefile head/sys/boot/i386/btx/btx/Makefile head/sys/boot/i386/btx/btxldr/Makefile head/sys/boot/i386/gptboot/Makefile head/sys/boot/i386/gptzfsboot/Makefile head/sys/boot/i386/libi386/Makefile head/sys/boot/i386/pxeldr/Makefile head/sys/boot/i386/zfsboot/Makefile head/sys/boot/pc98/btx/btx/Makefile head/sys/boot/pc98/btx/btxldr/Makefile head/sys/conf/Makefile.amd64 head/sys/conf/Makefile.i386 head/sys/conf/kern.pre.mk head/sys/modules/bios/smapi/Makefile head/sys/modules/linux/Makefile head/usr.bin/netstat/Makefile head/usr.bin/vacation/Makefile head/usr.sbin/sendmail/Makefile Modified: head/lib/libsm/Makefile ============================================================================== --- head/lib/libsm/Makefile Tue Feb 28 18:24:28 2012 (r232262) +++ head/lib/libsm/Makefile Tue Feb 28 18:30:18 2012 (r232263) @@ -18,12 +18,10 @@ CFLAGS+=${SENDMAIL_CFLAGS} WARNS?= 2 -.if ${CC:T:Mclang} == "clang" # Unfortunately, clang gives warnings about sendmail code that cannot # be turned off yet. Since this is contrib code, and we don't really # care about the warnings, just make them non-fatal for now. -NO_WERROR= -.endif +NO_WERROR.clang= LIB= sm Modified: head/lib/libthread_db/Makefile ============================================================================== --- head/lib/libthread_db/Makefile Tue Feb 28 18:24:28 2012 (r232262) +++ head/lib/libthread_db/Makefile Tue Feb 28 18:30:18 2012 (r232263) @@ -16,10 +16,8 @@ SYM_MAPS+=${.CURDIR}/Symbol.map SYMBOL_MAPS=${SYM_MAPS} VERSION_DEF=${.CURDIR}/../libc/Versions.def -.if ${CC:T:Mclang} == "clang" # Unfortunately, clang gives an incorrect warning about alignment in # arch/i386/libpthread_md.c, so turn that off for now. -NO_WCAST_ALIGN= -.endif +NO_WCAST_ALIGN.clang= .include Modified: head/lib/libz/Makefile ============================================================================== --- head/lib/libz/Makefile Tue Feb 28 18:24:28 2012 (r232262) +++ head/lib/libz/Makefile Tue Feb 28 18:30:18 2012 (r232263) @@ -47,10 +47,6 @@ ACFLAGS+= -Wa,--noexecstack #SRCS+= gvmat64.S #CFLAGS+= -DASMV -DNO_UNDERLINE #ACFLAGS+= -Wa,--noexecstack -#.if ${CC:T:Mclang} == "clang" -## XXX: clang integrated-as doesn't grok .intel_syntax directives yet -#ACFLAGS+= ${.IMPSRC:T:Mgvmat64.S:C/^.+$/-no-integrated-as/} -#.endif #.endif VERSION_DEF= ${.CURDIR}/Versions.def @@ -71,3 +67,7 @@ test: example minigzip echo hello world | ./minigzip | ./minigzip -d ) .include + +## XXX: clang integrated-as doesn't grok .intel_syntax directives yet +#ACFLAGS.gvmat64.S= ${CLANG_NO_IAS} +#ACFLAGS+= ${ACFLAGS.${.IMPSRC:T}} Modified: head/libexec/mail.local/Makefile ============================================================================== --- head/libexec/mail.local/Makefile Tue Feb 28 18:24:28 2012 (r232262) +++ head/libexec/mail.local/Makefile Tue Feb 28 18:30:18 2012 (r232263) @@ -12,12 +12,10 @@ CFLAGS+=-I${SENDMAIL_DIR}/include -I. WARNS?= 2 WFORMAT=0 -.if ${CC:T:Mclang} == "clang" # Unfortunately, clang gives warnings about sendmail code that cannot # be turned off yet. Since this is contrib code, and we don't really # care about the warnings, just make them non-fatal for now. -NO_WERROR= -.endif +NO_WERROR.clang= LIBSMDIR= ${.OBJDIR}/../../lib/libsm LIBSM= ${LIBSMDIR}/libsm.a Modified: head/libexec/smrsh/Makefile ============================================================================== --- head/libexec/smrsh/Makefile Tue Feb 28 18:24:28 2012 (r232262) +++ head/libexec/smrsh/Makefile Tue Feb 28 18:30:18 2012 (r232263) @@ -17,12 +17,10 @@ LDADD= ${LIBSM} WARNS?= 2 -.if ${CC:T:Mclang} == "clang" # Unfortunately, clang gives warnings about sendmail code that cannot # be turned off yet. Since this is contrib code, and we don't really # care about the warnings, just make them non-fatal for now. -NO_WERROR= -.endif +NO_WERROR.clang= SRCS+= sm_os.h CLEANFILES+=sm_os.h Modified: head/sbin/fsdb/Makefile ============================================================================== --- head/sbin/fsdb/Makefile Tue Feb 28 18:24:28 2012 (r232262) +++ head/sbin/fsdb/Makefile Tue Feb 28 18:30:18 2012 (r232263) @@ -9,10 +9,8 @@ SRCS= fsdb.c fsdbutil.c \ pass5.c setup.c utilities.c ffs_subr.c ffs_tables.c CFLAGS+= -I${.CURDIR}/../fsck_ffs WARNS?= 2 -.if ${CC:T:Mclang} == "clang" # Work around a problem with format string warnings and ntohs macros. -NO_WFORMAT= -.endif +NO_WFORMAT.clang= LDADD= -ledit -ltermcap DPADD= ${LIBEDIT} ${LIBTERMCAP} .PATH: ${.CURDIR}/../fsck_ffs ${.CURDIR}/../../sys/ufs/ffs Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Tue Feb 28 18:24:28 2012 (r232262) +++ head/share/mk/bsd.sys.mk Tue Feb 28 18:30:18 2012 (r232263) @@ -28,7 +28,7 @@ CFLAGS += -std=${CSTD} . if defined(WARNS) . if ${WARNS} >= 1 CWARNFLAGS += -Wsystem-headers -. if !defined(NO_WERROR) +. if !defined(NO_WERROR) && (${CC:T:Mclang} != "clang" || !defined(NO_WERROR.clang)) CWARNFLAGS += -Werror . endif . endif @@ -42,7 +42,7 @@ CWARNFLAGS += -W -Wno-unused-parameter - . if ${WARNS} >= 4 CWARNFLAGS += -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch\ -Wshadow -Wunused-parameter -. if !defined(NO_WCAST_ALIGN) +. if !defined(NO_WCAST_ALIGN) && (${CC:T:Mclang} != "clang" || !defined(NO_WCAST_ALIGN.clang)) CWARNFLAGS += -Wcast-align . endif . endif @@ -84,12 +84,12 @@ WFORMAT = 1 . if ${WFORMAT} > 0 #CWARNFLAGS += -Wformat-nonliteral -Wformat-security -Wno-format-extra-args CWARNFLAGS += -Wformat=2 -Wno-format-extra-args -. if !defined(NO_WERROR) +. if !defined(NO_WERROR) && (${CC:T:Mclang} != "clang" || !defined(NO_WERROR.clang)) CWARNFLAGS += -Werror . endif . endif . endif -. if defined(NO_WFORMAT) +. if defined(NO_WFORMAT) || (${CC:T:Mclang} == "clang" && defined(NO_WFORMAT.clang)) CWARNFLAGS += -Wno-format . endif .endif @@ -98,6 +98,12 @@ CWARNFLAGS += -Wno-format CWARNFLAGS += -Wno-unknown-pragmas .endif +.if ${CC:T:Mclang} == "clang" +CLANG_NO_IAS = -no-integrated-as +CLANG_OPT_SMALL = -mllvm -stack-alignment=8 -mllvm -inline-threshold=3 \ + -mllvm -enable-load-pre=false +.endif + .if ${MK_SSP} != "no" && ${MACHINE_CPUARCH} != "ia64" && \ ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" # Don't use -Wstack-protector as it breaks world with -Werror. Modified: head/sys/boot/i386/boot0/Makefile ============================================================================== --- head/sys/boot/i386/boot0/Makefile Tue Feb 28 18:24:28 2012 (r232262) +++ head/sys/boot/i386/boot0/Makefile Tue Feb 28 18:30:18 2012 (r232263) @@ -19,12 +19,6 @@ SRCS= ${PROG}.S OPTS ?= -DVOLUME_SERIAL -DPXE CFLAGS += ${OPTS} -.if ${CC:T:Mclang} == "clang" -# XXX: clang integrated-as doesn't grok .codeNN directives yet -CFLAGS+= ${.IMPSRC:T:Mboot0.S:C/^.+$/-no-integrated-as/} -CFLAGS+= ${.IMPSRC:T:Mboot0ext.S:C/^.+$/-no-integrated-as/} -.endif - # Flags used in the boot0.S code: # 0x0f all valid partitions enabled. # 0x80 'packet', use BIOS EDD (LBA) extensions instead of CHS @@ -83,3 +77,8 @@ CFLAGS+=-DFLAGS=${BOOT_BOOT0_FLAGS} \ LDFLAGS=-e start -Ttext ${BOOT_BOOT0_ORG} -Wl,-N,-S,--oformat,binary .include + +# XXX: clang integrated-as doesn't grok .codeNN directives yet +CFLAGS.boot0.S= ${CLANG_NO_IAS} +CFLAGS.boot0ext.S= ${CLANG_NO_IAS} +CFLAGS+= ${CFLAGS.${.IMPSRC:T}} Modified: head/sys/boot/i386/boot2/Makefile ============================================================================== --- head/sys/boot/i386/boot2/Makefile Tue Feb 28 18:24:28 2012 (r232262) +++ head/sys/boot/i386/boot2/Makefile Tue Feb 28 18:30:18 2012 (r232263) @@ -40,14 +40,8 @@ CFLAGS= -Os \ -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ - -Winline --param max-inline-insns-single=100 - -.if ${CC:T:Mclang} == "clang" -CFLAGS+= -mllvm -stack-alignment=8 -mllvm -inline-threshold=3 \ - -mllvm -enable-load-pre=false -# XXX: clang integrated-as doesn't grok .codeNN directives yet -CFLAGS+= ${.IMPSRC:T:Mboot1.S:C/^.+$/-no-integrated-as/} -.endif + -Winline --param max-inline-insns-single=100 \ + ${CLANG_OPT_SMALL} LDFLAGS=-static -N --gc-sections @@ -89,9 +83,7 @@ boot2.out: ${BTXCRT} boot2.o sio.o ${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} boot2.o: boot2.s -.if ${CC:T:Mclang} == "clang" ${CC} ${ACFLAGS} -c boot2.s -.endif SRCS= boot2.c boot2.h @@ -115,3 +107,7 @@ machine: .endif .include + +# XXX: clang integrated-as doesn't grok .codeNN directives yet +CFLAGS.boot1.S= ${CLANG_NO_IAS} +CFLAGS+= ${CFLAGS.${.IMPSRC:T}} Modified: head/sys/boot/i386/btx/btx/Makefile ============================================================================== --- head/sys/boot/i386/btx/btx/Makefile Tue Feb 28 18:24:28 2012 (r232262) +++ head/sys/boot/i386/btx/btx/Makefile Tue Feb 28 18:30:18 2012 (r232263) @@ -13,11 +13,6 @@ BOOT_BTX_FLAGS=0x0 CFLAGS+=-DBTX_FLAGS=${BOOT_BTX_FLAGS} -.if ${CC:T:Mclang} == "clang" -# XXX: clang integrated-as doesn't grok .codeNN directives yet -CFLAGS+=${.IMPSRC:T:Mbtx.S:C/^.+$/-no-integrated-as/} -.endif - .if defined(BTX_SERIAL) BOOT_COMCONSOLE_PORT?= 0x3f8 BOOT_COMCONSOLE_SPEED?= 9600 @@ -32,3 +27,7 @@ ORG= 0x9000 LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary .include + +# XXX: clang integrated-as doesn't grok .codeNN directives yet +CFLAGS.btx.S= ${CLANG_NO_IAS} +CFLAGS+= ${CFLAGS.${.IMPSRC:T}} Modified: head/sys/boot/i386/btx/btxldr/Makefile ============================================================================== --- head/sys/boot/i386/btx/btxldr/Makefile Tue Feb 28 18:24:28 2012 (r232262) +++ head/sys/boot/i386/btx/btxldr/Makefile Tue Feb 28 18:30:18 2012 (r232263) @@ -11,11 +11,10 @@ CFLAGS+=-DLOADER_ADDRESS=${LOADER_ADDRES CFLAGS+=-DBTXLDR_VERBOSE .endif -.if ${CC:T:Mclang} == "clang" -# XXX: clang integrated-as doesn't grok .codeNN directives yet -CFLAGS+=${.IMPSRC:T:Mbtxldr.S:C/^.+$/-no-integrated-as/} -.endif - LDFLAGS=-e start -Ttext ${LOADER_ADDRESS} -Wl,-N,-S,--oformat,binary .include + +# XXX: clang integrated-as doesn't grok .codeNN directives yet +CFLAGS.btxldr.S= ${CLANG_NO_IAS} +CFLAGS+= ${CFLAGS.${.IMPSRC:T}} Modified: head/sys/boot/i386/gptboot/Makefile ============================================================================== --- head/sys/boot/i386/gptboot/Makefile Tue Feb 28 18:24:28 2012 (r232262) +++ head/sys/boot/i386/gptboot/Makefile Tue Feb 28 18:30:18 2012 (r232263) @@ -36,11 +36,6 @@ CFLAGS= -DBOOTPROG=\"gptboot\" \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ -Winline --param max-inline-insns-single=100 -.if ${CC:T:Mclang} == "clang" -# XXX: clang integrated-as doesn't grok .codeNN directives yet -CFLAGS+= ${.IMPSRC:T:Mgptldr.S:C/^.+$/-no-integrated-as/} -.endif - LDFLAGS=-static -N --gc-sections # Pick up ../Makefile.inc early. @@ -79,3 +74,7 @@ machine: .endif .include + +# XXX: clang integrated-as doesn't grok .codeNN directives yet +CFLAGS.gptldr.S= ${CLANG_NO_IAS} +CFLAGS+= ${CFLAGS.${.IMPSRC:T}} Modified: head/sys/boot/i386/gptzfsboot/Makefile ============================================================================== --- head/sys/boot/i386/gptzfsboot/Makefile Tue Feb 28 18:24:28 2012 (r232262) +++ head/sys/boot/i386/gptzfsboot/Makefile Tue Feb 28 18:30:18 2012 (r232263) @@ -34,11 +34,6 @@ CFLAGS= -DBOOTPROG=\"gptzfsboot\" \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ -Winline --param max-inline-insns-single=100 -.if ${CC:T:Mclang} == "clang" -# XXX: clang integrated-as doesn't grok .codeNN directives yet -CFLAGS+= ${.IMPSRC:T:Mgptldr.S:C/^.+$/-no-integrated-as/} -.endif - LDFLAGS=-static -N --gc-sections # Pick up ../Makefile.inc early. @@ -77,3 +72,7 @@ machine: .endif .include + +# XXX: clang integrated-as doesn't grok .codeNN directives yet +CFLAGS.gptldr.S= ${CLANG_NO_IAS} +CFLAGS+= ${CFLAGS.${.IMPSRC:T}} Modified: head/sys/boot/i386/libi386/Makefile ============================================================================== --- head/sys/boot/i386/libi386/Makefile Tue Feb 28 18:24:28 2012 (r232262) +++ head/sys/boot/i386/libi386/Makefile Tue Feb 28 18:30:18 2012 (r232263) @@ -54,11 +54,6 @@ CFLAGS+= -I${.CURDIR}/../../common -I${. # the location of libstand CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ -.if ${CC:T:Mclang} == "clang" -# XXX: clang integrated-as doesn't grok .codeNN directives yet -CFLAGS+= ${.IMPSRC:T:Mamd64_tramp.S:C/^.+$/-no-integrated-as/} -.endif - .if ${MACHINE_CPUARCH} == "amd64" CLEANFILES+= machine machine: @@ -67,6 +62,10 @@ machine: .include +# XXX: clang integrated-as doesn't grok .codeNN directives yet +CFLAGS.amd64_tramp.S= ${CLANG_NO_IAS} +CFLAGS+= ${CFLAGS.${.IMPSRC:T}} + .if ${MACHINE_CPUARCH} == "amd64" beforedepend ${OBJS}: machine .endif Modified: head/sys/boot/i386/pxeldr/Makefile ============================================================================== --- head/sys/boot/i386/pxeldr/Makefile Tue Feb 28 18:24:28 2012 (r232262) +++ head/sys/boot/i386/pxeldr/Makefile Tue Feb 28 18:30:18 2012 (r232263) @@ -23,11 +23,6 @@ CFLAGS+=-DPROBE_KEYBOARD CFLAGS+=-DALWAYS_SERIAL .endif -.if ${CC:T:Mclang} == "clang" -# XXX: clang integrated-as doesn't grok .codeNN directives yet -CFLAGS+=${.IMPSRC:T:Mpxeldr.S:C/^.+$/-no-integrated-as/} -.endif - LOADERBIN= ${.OBJDIR}/../loader/loader.bin CLEANFILES+= ${BOOT}.tmp @@ -46,3 +41,7 @@ ${LOADER}: ${LOADERBIN} ${BTXLDR} ${BTXK -b ${BTXKERN} ${LOADERBIN} .include + +# XXX: clang integrated-as doesn't grok .codeNN directives yet +CFLAGS.pxeldr.S= ${CLANG_NO_IAS} +CFLAGS+= ${CFLAGS.${.IMPSRC:T}} Modified: head/sys/boot/i386/zfsboot/Makefile ============================================================================== --- head/sys/boot/i386/zfsboot/Makefile Tue Feb 28 18:24:28 2012 (r232262) +++ head/sys/boot/i386/zfsboot/Makefile Tue Feb 28 18:30:18 2012 (r232263) @@ -31,11 +31,6 @@ CFLAGS= -DBOOTPROG=\"zfsboot\" \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ -Winline --param max-inline-insns-single=100 -.if ${CC:T:Mclang} == "clang" -# XXX: clang integrated-as doesn't grok .codeNN directives yet -CFLAGS+= ${.IMPSRC:T:Mzfsldr.S:C/^.+$/-no-integrated-as/} -.endif - LDFLAGS=-static -N --gc-sections # Pick up ../Makefile.inc early. @@ -90,3 +85,7 @@ machine: .endif .include + +# XXX: clang integrated-as doesn't grok .codeNN directives yet +CFLAGS.zfsldr.S= ${CLANG_NO_IAS} +CFLAGS+= ${CFLAGS.${.IMPSRC:T}} Modified: head/sys/boot/pc98/btx/btx/Makefile ============================================================================== --- head/sys/boot/pc98/btx/btx/Makefile Tue Feb 28 18:24:28 2012 (r232262) +++ head/sys/boot/pc98/btx/btx/Makefile Tue Feb 28 18:30:18 2012 (r232263) @@ -13,11 +13,6 @@ BOOT_BTX_FLAGS=0x0 CFLAGS+=-DBTX_FLAGS=${BOOT_BTX_FLAGS} -.if ${CC:T:Mclang} == "clang" -# XXX: clang integrated-as doesn't grok .codeNN directives yet -CFLAGS+=${.IMPSRC:T:Mbtx.S:C/^.+$/-no-integrated-as/} -.endif - .if defined(BTX_SERIAL) BOOT_COMCONSOLE_PORT?= 0x238 BOOT_COMCONSOLE_SPEED?= 9600 @@ -32,3 +27,7 @@ ORG= 0x9000 LDFLAGS=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary .include + +# XXX: clang integrated-as doesn't grok .codeNN directives yet +CFLAGS.btx.S= ${CLANG_NO_IAS} +CFLAGS+= ${CFLAGS.${.IMPSRC:T}} Modified: head/sys/boot/pc98/btx/btxldr/Makefile ============================================================================== --- head/sys/boot/pc98/btx/btxldr/Makefile Tue Feb 28 18:24:28 2012 (r232262) +++ head/sys/boot/pc98/btx/btxldr/Makefile Tue Feb 28 18:30:18 2012 (r232263) @@ -11,11 +11,10 @@ CFLAGS+=-DLOADER_ADDRESS=${LOADER_ADDRES CFLAGS+=-DBTXLDR_VERBOSE .endif -.if ${CC:T:Mclang} == "clang" -# XXX: clang integrated-as doesn't grok .codeNN directives yet -CFLAGS+=${.IMPSRC:T:Mbtxldr.S:C/^.+$/-no-integrated-as/} -.endif - LDFLAGS=-e start -Ttext ${LOADER_ADDRESS} -Wl,-N,-S,--oformat,binary .include + +# XXX: clang integrated-as doesn't grok .codeNN directives yet +CFLAGS.btxldr.S= ${CLANG_NO_IAS} +CFLAGS+= ${CFLAGS.${.IMPSRC:T}} Modified: head/sys/conf/Makefile.amd64 ============================================================================== --- head/sys/conf/Makefile.amd64 Tue Feb 28 18:24:28 2012 (r232262) +++ head/sys/conf/Makefile.amd64 Tue Feb 28 18:30:18 2012 (r232263) @@ -40,13 +40,12 @@ CFLAGS+= -fno-omit-frame-pointer MKMODULESENV+= MACHINE=amd64 -.if ${CC:T:Mclang} == "clang" # XXX: clang integrated-as doesn't grok .codeNN directives yet -ASM_CFLAGS+= ${.IMPSRC:T:Macpi_wakecode.S:C/^.+$/-no-integrated-as/} -ASM_CFLAGS+= ${.IMPSRC:T:Mia32_sigtramp.S:C/^.+$/-no-integrated-as/} -ASM_CFLAGS+= ${.IMPSRC:T:Mlinux32_locore.s:C/^.+$/-no-integrated-as/} -ASM_CFLAGS+= ${.IMPSRC:T:Mmpboot.S:C/^.+$/-no-integrated-as/} -.endif +ASM_CFLAGS.acpi_wakecode.S= ${CLANG_NO_IAS} +ASM_CFLAGS.ia32_sigtramp.S= ${CLANG_NO_IAS} +ASM_CFLAGS.linux32_locore.s= ${CLANG_NO_IAS} +ASM_CFLAGS.mpboot.S= ${CLANG_NO_IAS} +ASM_CFLAGS+= ${ASM_CFLAGS.${.IMPSRC:T}} %BEFORE_DEPEND Modified: head/sys/conf/Makefile.i386 ============================================================================== --- head/sys/conf/Makefile.i386 Tue Feb 28 18:24:28 2012 (r232262) +++ head/sys/conf/Makefile.i386 Tue Feb 28 18:30:18 2012 (r232263) @@ -34,11 +34,10 @@ MACHINE=i386 MKMODULESENV+= MACHINE=${MACHINE} -.if ${CC:T:Mclang} == "clang" # XXX: clang integrated-as doesn't grok .codeNN directives yet -ASM_CFLAGS+= ${.IMPSRC:T:Macpi_wakecode.S:C/^.+$/-no-integrated-as/} -ASM_CFLAGS+= ${.IMPSRC:T:Mmpboot.s:C/^.+$/-no-integrated-as/} -.endif +ASM_CFLAGS.acpi_wakecode.S= ${CLANG_NO_IAS} +ASM_CFLAGS.mpboot.s= ${CLANG_NO_IAS} +ASM_CFLAGS+= ${ASM_CFLAGS.${.IMPSRC:T}} %BEFORE_DEPEND Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Tue Feb 28 18:24:28 2012 (r232262) +++ head/sys/conf/kern.pre.mk Tue Feb 28 18:30:18 2012 (r232263) @@ -101,6 +101,10 @@ WERROR?= -Werror # XXX LOCORE means "don't declare C stuff" not "for locore.s". ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${CFLAGS} +.if ${CC:T:Mclang} == "clang" +CLANG_NO_IAS= -no-integrated-as +.endif + .if defined(PROFLEVEL) && ${PROFLEVEL} >= 1 CFLAGS+= -DGPROF -falign-functions=16 .if ${PROFLEVEL} >= 2 Modified: head/sys/modules/bios/smapi/Makefile ============================================================================== --- head/sys/modules/bios/smapi/Makefile Tue Feb 28 18:24:28 2012 (r232262) +++ head/sys/modules/bios/smapi/Makefile Tue Feb 28 18:30:18 2012 (r232263) @@ -7,9 +7,9 @@ KMOD= smapi SRCS= smapi.c smapi_bios.S \ bus_if.h device_if.h WERROR= -.if ${CC:T:Mclang} == "clang" -# XXX: clang integrated-as doesn't grok 16-bit assembly yet -CFLAGS+= ${.IMPSRC:T:Msmapi_bios.S:C/^.+$/-no-integrated-as/} -.endif .include + +# XXX: clang integrated-as doesn't grok 16-bit assembly yet +CFLAGS.smapi_bios.S= ${CLANG_NO_IAS} +CFLAGS+= ${CFLAGS.${.IMPSRC:T}} Modified: head/sys/modules/linux/Makefile ============================================================================== --- head/sys/modules/linux/Makefile Tue Feb 28 18:24:28 2012 (r232262) +++ head/sys/modules/linux/Makefile Tue Feb 28 18:30:18 2012 (r232263) @@ -5,11 +5,6 @@ SFX= 32 CFLAGS+=-DCOMPAT_FREEBSD32 -DCOMPAT_LINUX32 .endif -.if ${CC:T:Mclang} == "clang" -# XXX: clang integrated-as doesn't grok .codeNN directives yet -CFLAGS+= ${.IMPSRC:T:Mlinux32_locore.s:C/^.+$/-no-integrated-as/} -.endif - .PATH: ${.CURDIR}/../../compat/linux ${.CURDIR}/../../${MACHINE_CPUARCH}/linux${SFX} KMOD= linux @@ -69,3 +64,7 @@ CFLAGS+= -DKTR .endif .include + +# XXX: clang integrated-as doesn't grok .codeNN directives yet +CFLAGS.linux32_locore.s= ${CLANG_NO_IAS} +CFLAGS+= ${CFLAGS.${.IMPSRC:T}} Modified: head/usr.bin/netstat/Makefile ============================================================================== --- head/usr.bin/netstat/Makefile Tue Feb 28 18:24:28 2012 (r232262) +++ head/usr.bin/netstat/Makefile Tue Feb 28 18:30:18 2012 (r232263) @@ -8,11 +8,9 @@ SRCS= if.c inet.c main.c mbuf.c mroute.c unix.c atalk.c mroute6.c ipsec.c bpf.c pfkey.c sctp.c WARNS?= 3 -.if ${CC:T:Mclang} == "clang" # XXX: Work around a clang false positive with format string warnings # and ntohs macros (see LLVM PR 11313). -NO_WFORMAT= -.endif +NO_WFORMAT.clang= CFLAGS+=-fno-strict-aliasing CFLAGS+=-DIPSEC Modified: head/usr.bin/vacation/Makefile ============================================================================== --- head/usr.bin/vacation/Makefile Tue Feb 28 18:24:28 2012 (r232262) +++ head/usr.bin/vacation/Makefile Tue Feb 28 18:30:18 2012 (r232263) @@ -11,12 +11,10 @@ CFLAGS+=-D_FFR_LISTDB -D_FFR_DEBUG WARNS?= 2 -.if ${CC:T:Mclang} == "clang" # Unfortunately, clang gives warnings about sendmail code that cannot # be turned off yet. Since this is contrib code, and we don't really # care about the warnings, just make them non-fatal for now. -NO_WERROR= -.endif +NO_WERROR.clang= LIBSMDIR= ${.OBJDIR}/../../lib/libsm LIBSM= ${LIBSMDIR}/libsm.a Modified: head/usr.sbin/sendmail/Makefile ============================================================================== --- head/usr.sbin/sendmail/Makefile Tue Feb 28 18:24:28 2012 (r232262) +++ head/usr.sbin/sendmail/Makefile Tue Feb 28 18:30:18 2012 (r232263) @@ -45,12 +45,10 @@ CFLAGS+= -DNETINET6 WARNS?= 1 -.if ${CC:T:Mclang} == "clang" # Unfortunately, clang gives warnings about sendmail code that cannot # be turned off yet. Since this is contrib code, and we don't really # care about the warnings, just make them non-fatal for now. -NO_WERROR= -.endif +NO_WERROR.clang= DPADD= ${LIBUTIL} ${LIBWRAP} LDADD= -lutil -lwrap From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 18:38:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D8D41065670; Tue, 28 Feb 2012 18:38:34 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 47AD68FC0A; Tue, 28 Feb 2012 18:38:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1SIcYH1082933; Tue, 28 Feb 2012 18:38:34 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1SIcYhE082928; Tue, 28 Feb 2012 18:38:34 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201202281838.q1SIcYhE082928@svn.freebsd.org> From: Tijl Coosemans Date: Tue, 28 Feb 2012 18:38: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: r232264 - in head/sys: amd64/include i386/include pc98/include x86/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2012 18:38:34 -0000 Author: tijl Date: Tue Feb 28 18:38:33 2012 New Revision: 232264 URL: http://svn.freebsd.org/changeset/base/232264 Log: Copy amd64 _stdint.h to x86 and merge with i386 _stdint.h. Replace amd64/i386/pc98 _stdint.h with stubs. Added: head/sys/x86/include/_stdint.h - copied, changed from r232259, head/sys/amd64/include/_stdint.h Modified: head/sys/amd64/include/_stdint.h head/sys/i386/include/_stdint.h head/sys/pc98/include/_stdint.h Modified: head/sys/amd64/include/_stdint.h ============================================================================== --- head/sys/amd64/include/_stdint.h Tue Feb 28 18:30:18 2012 (r232263) +++ head/sys/amd64/include/_stdint.h Tue Feb 28 18:38:33 2012 (r232264) @@ -1,171 +1,6 @@ /*- - * Copyright (c) 2001, 2002 Mike Barcroft - * Copyright (c) 2001 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Klaus Klein. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE__STDINT_H_ -#define _MACHINE__STDINT_H_ - -#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) - -#define INT8_C(c) (c) -#define INT16_C(c) (c) -#define INT32_C(c) (c) -#define INT64_C(c) (c ## L) - -#define UINT8_C(c) (c) -#define UINT16_C(c) (c) -#define UINT32_C(c) (c ## U) -#define UINT64_C(c) (c ## UL) - -#define INTMAX_C(c) INT64_C(c) -#define UINTMAX_C(c) UINT64_C(c) - -#endif /* !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) */ - -#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) - -/* - * ISO/IEC 9899:1999 - * 7.18.2.1 Limits of exact-width integer types - */ -/* Minimum values of exact-width signed integer types. */ -#define INT8_MIN (-0x7f-1) -#define INT16_MIN (-0x7fff-1) -#define INT32_MIN (-0x7fffffff-1) -#define INT64_MIN (-0x7fffffffffffffffL-1) - -/* Maximum values of exact-width signed integer types. */ -#define INT8_MAX 0x7f -#define INT16_MAX 0x7fff -#define INT32_MAX 0x7fffffff -#define INT64_MAX 0x7fffffffffffffffL - -/* Maximum values of exact-width unsigned integer types. */ -#define UINT8_MAX 0xff -#define UINT16_MAX 0xffff -#define UINT32_MAX 0xffffffffU -#define UINT64_MAX 0xffffffffffffffffUL - -/* - * ISO/IEC 9899:1999 - * 7.18.2.2 Limits of minimum-width integer types - */ -/* Minimum values of minimum-width signed integer types. */ -#define INT_LEAST8_MIN INT8_MIN -#define INT_LEAST16_MIN INT16_MIN -#define INT_LEAST32_MIN INT32_MIN -#define INT_LEAST64_MIN INT64_MIN - -/* Maximum values of minimum-width signed integer types. */ -#define INT_LEAST8_MAX INT8_MAX -#define INT_LEAST16_MAX INT16_MAX -#define INT_LEAST32_MAX INT32_MAX -#define INT_LEAST64_MAX INT64_MAX - -/* Maximum values of minimum-width unsigned integer types. */ -#define UINT_LEAST8_MAX UINT8_MAX -#define UINT_LEAST16_MAX UINT16_MAX -#define UINT_LEAST32_MAX UINT32_MAX -#define UINT_LEAST64_MAX UINT64_MAX - -/* - * ISO/IEC 9899:1999 - * 7.18.2.3 Limits of fastest minimum-width integer types - */ -/* Minimum values of fastest minimum-width signed integer types. */ -#define INT_FAST8_MIN INT32_MIN -#define INT_FAST16_MIN INT32_MIN -#define INT_FAST32_MIN INT32_MIN -#define INT_FAST64_MIN INT64_MIN - -/* Maximum values of fastest minimum-width signed integer types. */ -#define INT_FAST8_MAX INT32_MAX -#define INT_FAST16_MAX INT32_MAX -#define INT_FAST32_MAX INT32_MAX -#define INT_FAST64_MAX INT64_MAX - -/* Maximum values of fastest minimum-width unsigned integer types. */ -#define UINT_FAST8_MAX UINT32_MAX -#define UINT_FAST16_MAX UINT32_MAX -#define UINT_FAST32_MAX UINT32_MAX -#define UINT_FAST64_MAX UINT64_MAX - -/* - * ISO/IEC 9899:1999 - * 7.18.2.4 Limits of integer types capable of holding object pointers - */ -#define INTPTR_MIN INT64_MIN -#define INTPTR_MAX INT64_MAX -#define UINTPTR_MAX UINT64_MAX - -/* - * ISO/IEC 9899:1999 - * 7.18.2.5 Limits of greatest-width integer types - */ -#define INTMAX_MIN INT64_MIN -#define INTMAX_MAX INT64_MAX -#define UINTMAX_MAX UINT64_MAX - -/* - * ISO/IEC 9899:1999 - * 7.18.3 Limits of other integer types - */ -/* Limits of ptrdiff_t. */ -#define PTRDIFF_MIN INT64_MIN -#define PTRDIFF_MAX INT64_MAX - -/* Limits of sig_atomic_t. */ -#define SIG_ATOMIC_MIN LONG_MIN -#define SIG_ATOMIC_MAX LONG_MAX - -/* Limit of size_t. */ -#define SIZE_MAX UINT64_MAX - -#ifndef WCHAR_MIN /* Also possibly defined in */ -/* Limits of wchar_t. */ -#define WCHAR_MIN INT32_MIN -#define WCHAR_MAX INT32_MAX -#endif - -/* Limits of wint_t. */ -#define WINT_MIN INT32_MIN -#define WINT_MAX INT32_MAX - -#endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */ - -#endif /* !_MACHINE__STDINT_H_ */ +#include Modified: head/sys/i386/include/_stdint.h ============================================================================== --- head/sys/i386/include/_stdint.h Tue Feb 28 18:30:18 2012 (r232263) +++ head/sys/i386/include/_stdint.h Tue Feb 28 18:38:33 2012 (r232264) @@ -1,171 +1,6 @@ /*- - * Copyright (c) 2001, 2002 Mike Barcroft - * Copyright (c) 2001 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by Klaus Klein. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE__STDINT_H_ -#define _MACHINE__STDINT_H_ - -#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) - -#define INT8_C(c) (c) -#define INT16_C(c) (c) -#define INT32_C(c) (c) -#define INT64_C(c) (c ## LL) - -#define UINT8_C(c) (c) -#define UINT16_C(c) (c) -#define UINT32_C(c) (c ## U) -#define UINT64_C(c) (c ## ULL) - -#define INTMAX_C(c) INT64_C(c) -#define UINTMAX_C(c) UINT64_C(c) - -#endif /* !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) */ - -#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) - -/* - * ISO/IEC 9899:1999 - * 7.18.2.1 Limits of exact-width integer types - */ -/* Minimum values of exact-width signed integer types. */ -#define INT8_MIN (-0x7f-1) -#define INT16_MIN (-0x7fff-1) -#define INT32_MIN (-0x7fffffff-1) -#define INT64_MIN (-0x7fffffffffffffffLL-1) - -/* Maximum values of exact-width signed integer types. */ -#define INT8_MAX 0x7f -#define INT16_MAX 0x7fff -#define INT32_MAX 0x7fffffff -#define INT64_MAX 0x7fffffffffffffffLL - -/* Maximum values of exact-width unsigned integer types. */ -#define UINT8_MAX 0xff -#define UINT16_MAX 0xffff -#define UINT32_MAX 0xffffffffU -#define UINT64_MAX 0xffffffffffffffffULL - -/* - * ISO/IEC 9899:1999 - * 7.18.2.2 Limits of minimum-width integer types - */ -/* Minimum values of minimum-width signed integer types. */ -#define INT_LEAST8_MIN INT8_MIN -#define INT_LEAST16_MIN INT16_MIN -#define INT_LEAST32_MIN INT32_MIN -#define INT_LEAST64_MIN INT64_MIN - -/* Maximum values of minimum-width signed integer types. */ -#define INT_LEAST8_MAX INT8_MAX -#define INT_LEAST16_MAX INT16_MAX -#define INT_LEAST32_MAX INT32_MAX -#define INT_LEAST64_MAX INT64_MAX - -/* Maximum values of minimum-width unsigned integer types. */ -#define UINT_LEAST8_MAX UINT8_MAX -#define UINT_LEAST16_MAX UINT16_MAX -#define UINT_LEAST32_MAX UINT32_MAX -#define UINT_LEAST64_MAX UINT64_MAX - -/* - * ISO/IEC 9899:1999 - * 7.18.2.3 Limits of fastest minimum-width integer types - */ -/* Minimum values of fastest minimum-width signed integer types. */ -#define INT_FAST8_MIN INT32_MIN -#define INT_FAST16_MIN INT32_MIN -#define INT_FAST32_MIN INT32_MIN -#define INT_FAST64_MIN INT64_MIN - -/* Maximum values of fastest minimum-width signed integer types. */ -#define INT_FAST8_MAX INT32_MAX -#define INT_FAST16_MAX INT32_MAX -#define INT_FAST32_MAX INT32_MAX -#define INT_FAST64_MAX INT64_MAX - -/* Maximum values of fastest minimum-width unsigned integer types. */ -#define UINT_FAST8_MAX UINT32_MAX -#define UINT_FAST16_MAX UINT32_MAX -#define UINT_FAST32_MAX UINT32_MAX -#define UINT_FAST64_MAX UINT64_MAX - -/* - * ISO/IEC 9899:1999 - * 7.18.2.4 Limits of integer types capable of holding object pointers - */ -#define INTPTR_MIN INT32_MIN -#define INTPTR_MAX INT32_MAX -#define UINTPTR_MAX UINT32_MAX - -/* - * ISO/IEC 9899:1999 - * 7.18.2.5 Limits of greatest-width integer types - */ -#define INTMAX_MIN INT64_MIN -#define INTMAX_MAX INT64_MAX -#define UINTMAX_MAX UINT64_MAX - -/* - * ISO/IEC 9899:1999 - * 7.18.3 Limits of other integer types - */ -/* Limits of ptrdiff_t. */ -#define PTRDIFF_MIN INT32_MIN -#define PTRDIFF_MAX INT32_MAX - -/* Limits of sig_atomic_t. */ -#define SIG_ATOMIC_MIN INT32_MIN -#define SIG_ATOMIC_MAX INT32_MAX - -/* Limit of size_t. */ -#define SIZE_MAX UINT32_MAX - -#ifndef WCHAR_MIN /* Also possibly defined in */ -/* Limits of wchar_t. */ -#define WCHAR_MIN INT32_MIN -#define WCHAR_MAX INT32_MAX -#endif - -/* Limits of wint_t. */ -#define WINT_MIN INT32_MIN -#define WINT_MAX INT32_MAX - -#endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */ - -#endif /* !_MACHINE__STDINT_H_ */ +#include Modified: head/sys/pc98/include/_stdint.h ============================================================================== --- head/sys/pc98/include/_stdint.h Tue Feb 28 18:30:18 2012 (r232263) +++ head/sys/pc98/include/_stdint.h Tue Feb 28 18:38:33 2012 (r232264) @@ -3,4 +3,4 @@ */ /* $FreeBSD$ */ -#include +#include Copied and modified: head/sys/x86/include/_stdint.h (from r232259, head/sys/amd64/include/_stdint.h) ============================================================================== --- head/sys/amd64/include/_stdint.h Tue Feb 28 15:52:01 2012 (r232259, copy source) +++ head/sys/x86/include/_stdint.h Tue Feb 28 18:38:33 2012 (r232264) @@ -45,12 +45,18 @@ #define INT8_C(c) (c) #define INT16_C(c) (c) #define INT32_C(c) (c) -#define INT64_C(c) (c ## L) #define UINT8_C(c) (c) #define UINT16_C(c) (c) #define UINT32_C(c) (c ## U) + +#ifdef _LP64 +#define INT64_C(c) (c ## L) #define UINT64_C(c) (c ## UL) +#else +#define INT64_C(c) (c ## LL) +#define UINT64_C(c) (c ## ULL) +#endif #define INTMAX_C(c) INT64_C(c) #define UINTMAX_C(c) UINT64_C(c) @@ -67,19 +73,19 @@ #define INT8_MIN (-0x7f-1) #define INT16_MIN (-0x7fff-1) #define INT32_MIN (-0x7fffffff-1) -#define INT64_MIN (-0x7fffffffffffffffL-1) +#define INT64_MIN (-INT64_C(0x7fffffffffffffff)-1) /* Maximum values of exact-width signed integer types. */ #define INT8_MAX 0x7f #define INT16_MAX 0x7fff #define INT32_MAX 0x7fffffff -#define INT64_MAX 0x7fffffffffffffffL +#define INT64_MAX INT64_C(0x7fffffffffffffff) /* Maximum values of exact-width unsigned integer types. */ #define UINT8_MAX 0xff #define UINT16_MAX 0xffff #define UINT32_MAX 0xffffffffU -#define UINT64_MAX 0xffffffffffffffffUL +#define UINT64_MAX UINT64_C(0xffffffffffffffff) /* * ISO/IEC 9899:1999 @@ -129,9 +135,15 @@ * ISO/IEC 9899:1999 * 7.18.2.4 Limits of integer types capable of holding object pointers */ +#ifdef _LP64 #define INTPTR_MIN INT64_MIN #define INTPTR_MAX INT64_MAX #define UINTPTR_MAX UINT64_MAX +#else +#define INTPTR_MIN INT32_MIN +#define INTPTR_MAX INT32_MAX +#define UINTPTR_MAX UINT32_MAX +#endif /* * ISO/IEC 9899:1999 @@ -145,6 +157,7 @@ * ISO/IEC 9899:1999 * 7.18.3 Limits of other integer types */ +#ifdef _LP64 /* Limits of ptrdiff_t. */ #define PTRDIFF_MIN INT64_MIN #define PTRDIFF_MAX INT64_MAX @@ -155,6 +168,13 @@ /* Limit of size_t. */ #define SIZE_MAX UINT64_MAX +#else +#define PTRDIFF_MIN INT32_MIN +#define PTRDIFF_MAX INT32_MAX +#define SIG_ATOMIC_MIN INT32_MIN +#define SIG_ATOMIC_MAX INT32_MAX +#define SIZE_MAX UINT32_MAX +#endif #ifndef WCHAR_MIN /* Also possibly defined in */ /* Limits of wchar_t. */ From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 19:16:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 130AB106567A; Tue, 28 Feb 2012 19:16:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D9E4E8FC12; Tue, 28 Feb 2012 19:16:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1SJG23x084109; Tue, 28 Feb 2012 19:16:02 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1SJG2JE084107; Tue, 28 Feb 2012 19:16:02 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202281916.q1SJG2JE084107@svn.freebsd.org> From: John Baldwin Date: Tue, 28 Feb 2012 19:16: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: r232265 - 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, 28 Feb 2012 19:16:03 -0000 Author: jhb Date: Tue Feb 28 19:16:02 2012 New Revision: 232265 URL: http://svn.freebsd.org/changeset/base/232265 Log: Properly clear a device's devclass if DEVICE_ATTACH() fails if the device does not have a fixed devclass. Reviewed by: imp MFC after: 2 weeks Modified: head/sys/kern/subr_bus.c Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Tue Feb 28 18:38:33 2012 (r232264) +++ head/sys/kern/subr_bus.c Tue Feb 28 19:16:02 2012 (r232265) @@ -2732,9 +2732,8 @@ device_attach(device_t dev) if ((error = DEVICE_ATTACH(dev)) != 0) { printf("device_attach: %s%d attach returned %d\n", dev->driver->name, dev->unit, error); - /* Unset the class; set in device_probe_child */ - if (dev->devclass == NULL) - (void)device_set_devclass(dev, NULL); + if (!(dev->flags & DF_FIXEDCLASS)) + devclass_delete_device(dev->devclass, dev); (void)device_set_driver(dev, NULL); device_sysctl_fini(dev); dev->state = DS_NOTPRESENT; From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 19:39:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D13F106564A; Tue, 28 Feb 2012 19:39:55 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 424298FC1D; Tue, 28 Feb 2012 19:39:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1SJdtJM084863; Tue, 28 Feb 2012 19:39:55 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1SJdtYr084858; Tue, 28 Feb 2012 19:39:55 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201202281939.q1SJdtYr084858@svn.freebsd.org> From: Tijl Coosemans Date: Tue, 28 Feb 2012 19:39: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: r232266 - in head/sys: amd64/include i386/include pc98/include x86/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2012 19:39:55 -0000 Author: tijl Date: Tue Feb 28 19:39:54 2012 New Revision: 232266 URL: http://svn.freebsd.org/changeset/base/232266 Log: Copy amd64 endian.h to x86 and merge with i386 endian.h. Replace amd64/i386/pc98 endian.h with stubs. In __bswap64_const(x) the conflict between 0xffUL and 0xffULL has been resolved by reimplementing the macro in terms of __bswap32(x). As a side effect __bswap64_var(x) is now implemented using two bswap instructions on i386 and should be much faster. __bswap32_const(x) has been reimplemented in terms of __bswap16(x) for consistency. Added: head/sys/x86/include/endian.h - copied, changed from r232259, head/sys/amd64/include/endian.h Modified: head/sys/amd64/include/endian.h head/sys/i386/include/endian.h head/sys/pc98/include/endian.h Modified: head/sys/amd64/include/endian.h ============================================================================== --- head/sys/amd64/include/endian.h Tue Feb 28 19:16:02 2012 (r232265) +++ head/sys/amd64/include/endian.h Tue Feb 28 19:39:54 2012 (r232266) @@ -1,145 +1,6 @@ /*- - * Copyright (c) 1987, 1991 Regents of the University of California. - * 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. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)endian.h 7.8 (Berkeley) 4/3/91 - * $FreeBSD$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE_ENDIAN_H_ -#define _MACHINE_ENDIAN_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Define the order of 32-bit words in 64-bit words. - */ -#define _QUAD_HIGHWORD 1 -#define _QUAD_LOWWORD 0 - -/* - * Definitions for byte order, according to byte significance from low - * address to high. - */ -#define _LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ -#define _BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */ -#define _PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */ - -#define _BYTE_ORDER _LITTLE_ENDIAN - -/* - * Deprecated variants that don't have enough underscores to be useful in more - * strict namespaces. - */ -#if __BSD_VISIBLE -#define LITTLE_ENDIAN _LITTLE_ENDIAN -#define BIG_ENDIAN _BIG_ENDIAN -#define PDP_ENDIAN _PDP_ENDIAN -#define BYTE_ORDER _BYTE_ORDER -#endif - -#if defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE_BUILTIN_CONSTANT_P) - -#define __bswap64_const(_x) \ - (((_x) >> 56) | \ - (((_x) >> 40) & (0xffUL << 8)) | \ - (((_x) >> 24) & (0xffUL << 16)) | \ - (((_x) >> 8) & (0xffUL << 24)) | \ - (((_x) << 8) & (0xffUL << 32)) | \ - (((_x) << 24) & (0xffUL << 40)) | \ - (((_x) << 40) & (0xffUL << 48)) | \ - ((_x) << 56)) - -#define __bswap32_const(_x) \ - (((_x) >> 24) | \ - (((_x) & (0xff << 16)) >> 8) | \ - (((_x) & (0xff << 8)) << 8) | \ - ((_x) << 24)) - -#define __bswap16_const(_x) (__uint16_t)((_x) << 8 | (_x) >> 8) - -static __inline __uint64_t -__bswap64_var(__uint64_t _x) -{ - - __asm ("bswap %0" : "+r" (_x)); - return (_x); -} - -static __inline __uint32_t -__bswap32_var(__uint32_t _x) -{ - - __asm ("bswap %0" : "+r" (_x)); - return (_x); -} - -static __inline __uint16_t -__bswap16_var(__uint16_t _x) -{ - - return (__bswap16_const(_x)); -} - -#define __bswap64(_x) \ - (__builtin_constant_p(_x) ? \ - __bswap64_const((__uint64_t)(_x)) : __bswap64_var(_x)) - -#define __bswap32(_x) \ - (__builtin_constant_p(_x) ? \ - __bswap32_const((__uint32_t)(_x)) : __bswap32_var(_x)) - -#define __bswap16(_x) \ - (__builtin_constant_p(_x) ? \ - __bswap16_const((__uint16_t)(_x)) : __bswap16_var(_x)) - -#define __htonl(x) __bswap32(x) -#define __htons(x) __bswap16(x) -#define __ntohl(x) __bswap32(x) -#define __ntohs(x) __bswap16(x) - -#else /* !(__GNUCLIKE_ASM && __GNUCLIKE_BUILTIN_CONSTANT_P) */ - -/* - * No optimizations are available for this compiler. Fall back to - * non-optimized functions by defining the constant usually used to prevent - * redefinition. - */ -#define _BYTEORDER_FUNC_DEFINED - -#endif /* __GNUCLIKE_ASM && __GNUCLIKE_BUILTIN_CONSTANT_P */ - -#ifdef __cplusplus -} -#endif - -#endif /* !_MACHINE_ENDIAN_H_ */ +#include Modified: head/sys/i386/include/endian.h ============================================================================== --- head/sys/i386/include/endian.h Tue Feb 28 19:16:02 2012 (r232265) +++ head/sys/i386/include/endian.h Tue Feb 28 19:39:54 2012 (r232266) @@ -1,145 +1,6 @@ /*- - * Copyright (c) 1987, 1991 Regents of the University of California. - * 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. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)endian.h 7.8 (Berkeley) 4/3/91 - * $FreeBSD$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE_ENDIAN_H_ -#define _MACHINE_ENDIAN_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Define the order of 32-bit words in 64-bit words. - */ -#define _QUAD_HIGHWORD 1 -#define _QUAD_LOWWORD 0 - -/* - * Definitions for byte order, according to byte significance from low - * address to high. - */ -#define _LITTLE_ENDIAN 1234 /* LSB first: i386, vax */ -#define _BIG_ENDIAN 4321 /* MSB first: 68000, ibm, net */ -#define _PDP_ENDIAN 3412 /* LSB first in word, MSW first in long */ - -#define _BYTE_ORDER _LITTLE_ENDIAN - -/* - * Deprecated variants that don't have enough underscores to be useful in more - * strict namespaces. - */ -#if __BSD_VISIBLE -#define LITTLE_ENDIAN _LITTLE_ENDIAN -#define BIG_ENDIAN _BIG_ENDIAN -#define PDP_ENDIAN _PDP_ENDIAN -#define BYTE_ORDER _BYTE_ORDER -#endif - -#if defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE_BUILTIN_CONSTANT_P) - -#define __bswap64_const(_x) \ - (((_x) >> 56) | \ - (((_x) >> 40) & (0xffULL << 8)) | \ - (((_x) >> 24) & (0xffULL << 16)) | \ - (((_x) >> 8) & (0xffULL << 24)) | \ - (((_x) << 8) & (0xffULL << 32)) | \ - (((_x) << 24) & (0xffULL << 40)) | \ - (((_x) << 40) & (0xffULL << 48)) | \ - ((_x) << 56)) - -#define __bswap32_const(_x) \ - (((_x) >> 24) | \ - (((_x) & (0xff << 16)) >> 8) | \ - (((_x) & (0xff << 8)) << 8) | \ - ((_x) << 24)) - -#define __bswap16_const(_x) (__uint16_t)((_x) << 8 | (_x) >> 8) - -static __inline __uint64_t -__bswap64_var(__uint64_t __x) -{ - - return __bswap64_const(__x); -} - - -static __inline __uint32_t -__bswap32_var(__uint32_t _x) -{ - - __asm ("bswap %0" : "+r" (_x)); - return (_x); -} - -static __inline __uint16_t -__bswap16_var(__uint16_t _x) -{ - - return (__bswap16_const(_x)); -} - -#define __bswap64(_x) \ - (__builtin_constant_p(_x) ? \ - __bswap64_const((__uint64_t)(_x)) : __bswap64_var(_x)) - -#define __bswap32(_x) \ - (__builtin_constant_p(_x) ? \ - __bswap32_const((__uint32_t)(_x)) : __bswap32_var(_x)) - -#define __bswap16(_x) \ - (__builtin_constant_p(_x) ? \ - __bswap16_const((__uint16_t)(_x)) : __bswap16_var(_x)) - -#define __htonl(x) __bswap32(x) -#define __htons(x) __bswap16(x) -#define __ntohl(x) __bswap32(x) -#define __ntohs(x) __bswap16(x) - -#else /* !(__GNUCLIKE_ASM && __GNUCLIKE_BUILTIN_CONSTANT_P) */ - -/* - * No optimizations are available for this compiler. Fall back to - * non-optimized functions by defining the constant usually used to prevent - * redefinition. - */ -#define _BYTEORDER_FUNC_DEFINED - -#endif /* __GNUCLIKE_ASM && __GNUCLIKE_BUILTIN_CONSTANT_P */ - -#ifdef __cplusplus -} -#endif - -#endif /* !_MACHINE_ENDIAN_H_ */ +#include Modified: head/sys/pc98/include/endian.h ============================================================================== --- head/sys/pc98/include/endian.h Tue Feb 28 19:16:02 2012 (r232265) +++ head/sys/pc98/include/endian.h Tue Feb 28 19:39:54 2012 (r232266) @@ -3,4 +3,4 @@ */ /* $FreeBSD$ */ -#include +#include Copied and modified: head/sys/x86/include/endian.h (from r232259, head/sys/amd64/include/endian.h) ============================================================================== --- head/sys/amd64/include/endian.h Tue Feb 28 15:52:01 2012 (r232259, copy source) +++ head/sys/x86/include/endian.h Tue Feb 28 19:39:54 2012 (r232266) @@ -69,30 +69,31 @@ extern "C" { #if defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE_BUILTIN_CONSTANT_P) -#define __bswap64_const(_x) \ - (((_x) >> 56) | \ - (((_x) >> 40) & (0xffUL << 8)) | \ - (((_x) >> 24) & (0xffUL << 16)) | \ - (((_x) >> 8) & (0xffUL << 24)) | \ - (((_x) << 8) & (0xffUL << 32)) | \ - (((_x) << 24) & (0xffUL << 40)) | \ - (((_x) << 40) & (0xffUL << 48)) | \ - ((_x) << 56)) - -#define __bswap32_const(_x) \ - (((_x) >> 24) | \ - (((_x) & (0xff << 16)) >> 8) | \ - (((_x) & (0xff << 8)) << 8) | \ - ((_x) << 24)) +#define __bswap16_const(_x) (__uint16_t)((_x) << 8 | (_x) >> 8) -#define __bswap16_const(_x) (__uint16_t)((_x) << 8 | (_x) >> 8) +#define __bswap16(_x) \ + (__builtin_constant_p(_x) ? \ + __bswap16_const((__uint16_t)(_x)) : __bswap16_var(_x)) -static __inline __uint64_t -__bswap64_var(__uint64_t _x) +#define __bswap32_const(_x) \ + (((__uint32_t)__bswap16(_x) << 16) | __bswap16((_x) >> 16)) + +#define __bswap32(_x) \ + (__builtin_constant_p(_x) ? \ + __bswap32_const((__uint32_t)(_x)) : __bswap32_var(_x)) + +#define __bswap64_const(_x) \ + (((__uint64_t)__bswap32(_x) << 32) | __bswap32((_x) >> 32)) + +#define __bswap64(_x) \ + (__builtin_constant_p(_x) ? \ + __bswap64_const((__uint64_t)(_x)) : __bswap64_var(_x)) + +static __inline __uint16_t +__bswap16_var(__uint16_t _x) { - __asm ("bswap %0" : "+r" (_x)); - return (_x); + return (__bswap16_const(_x)); } static __inline __uint32_t @@ -103,25 +104,17 @@ __bswap32_var(__uint32_t _x) return (_x); } -static __inline __uint16_t -__bswap16_var(__uint16_t _x) +static __inline __uint64_t +__bswap64_var(__uint64_t _x) { - - return (__bswap16_const(_x)); +#ifdef _LP64 + __asm ("bswap %0" : "+r" (_x)); + return (_x); +#else + return (__bswap64_const(_x)); +#endif } -#define __bswap64(_x) \ - (__builtin_constant_p(_x) ? \ - __bswap64_const((__uint64_t)(_x)) : __bswap64_var(_x)) - -#define __bswap32(_x) \ - (__builtin_constant_p(_x) ? \ - __bswap32_const((__uint32_t)(_x)) : __bswap32_var(_x)) - -#define __bswap16(_x) \ - (__builtin_constant_p(_x) ? \ - __bswap16_const((__uint16_t)(_x)) : __bswap16_var(_x)) - #define __htonl(x) __bswap32(x) #define __htons(x) __bswap16(x) #define __ntohl(x) __bswap32(x) From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 19:42:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D079106566C; Tue, 28 Feb 2012 19:42:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8CB698FC12; Tue, 28 Feb 2012 19:42:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1SJge2E084976; Tue, 28 Feb 2012 19:42:40 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1SJgeed084974; Tue, 28 Feb 2012 19:42:40 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201202281942.q1SJgeed084974@svn.freebsd.org> From: Ed Maste Date: Tue, 28 Feb 2012 19:42: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: r232267 - head/sys/x86/x86 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Feb 2012 19:42:40 -0000 Author: emaste Date: Tue Feb 28 19:42:40 2012 New Revision: 232267 URL: http://svn.freebsd.org/changeset/base/232267 Log: Workaround for PCIe 4GB boundary issue Enforce a boundary of no more than 4GB - transfers crossing a 4GB boundary can lead to data corruption due to PCIe limitations. This change is a less-intrusive workaround that can be quickly merged back to older branches; a cleaner implementation will arrive in HEAD later but may require KPI changes. This change is based on a suggestion by jhb@. Reviewed by: scottl, jhb Sponsored by: Sandvine Incorporated MFC after: 3 days Modified: head/sys/x86/x86/busdma_machdep.c Modified: head/sys/x86/x86/busdma_machdep.c ============================================================================== --- head/sys/x86/x86/busdma_machdep.c Tue Feb 28 19:39:54 2012 (r232266) +++ head/sys/x86/x86/busdma_machdep.c Tue Feb 28 19:42:40 2012 (r232267) @@ -227,6 +227,14 @@ bus_dma_tag_create(bus_dma_tag_t parent, bus_dma_tag_t newtag; int error = 0; + /* Always enforce at least a 4GB (2GB for PAE) boundary. */ +#if defined(__amd64__) + if (boundary == 0 || boundary > ((bus_addr_t)1 << 32)) + boundary = (bus_size_t)1 << 32; +#elif defined(PAE) + if (boundary == 0 || boundary > ((bus_addr_t)1 << 31)) + boundary = (bus_size_t)1 << 31; +#endif /* Basic sanity checking */ if (boundary != 0 && boundary < maxsegsz) maxsegsz = boundary; From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 19:45:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id AEAAC106566C; Tue, 28 Feb 2012 19:45:20 +0000 (UTC) Date: Tue, 28 Feb 2012 19:45:20 +0000 From: Alexander Best To: Jilles Tjoelker Message-ID: <20120228194520.GA56030@freebsd.org> References: <201202261514.q1QFET0v070810@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201202261514.q1QFET0v070810@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232183 - 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, 28 Feb 2012 19:45:20 -0000 On Sun Feb 26 12, Jilles Tjoelker wrote: > Author: jilles > Date: Sun Feb 26 15:14:29 2012 > New Revision: 232183 > URL: http://svn.freebsd.org/changeset/base/232183 > > Log: > Fix fchmod() and fchown() on fifos. > > The new fifo implementation in r232055 broke fchmod() and fchown() on fifos. > Postfix needs this. clang seems to have a problem with this commit: usr/subversion-src/sys/kern/sys_pipe.c:1556:10: error: promoted type 'int' of K&R function parameter is not compatible with the parameter type 'mode_t' (aka 'unsigned short') declared in a previous prototype [-Werror] mode_t mode; ^ /usr/subversion-src/sys/kern/sys_pipe.c:155:19: note: previous declaration is here static fo_chmod_t pipe_chmod; ^ 1 error generated. *** Error code 1 cheers. alex > > Submitted by: gianni > Reported by: dougb > > Modified: > head/sys/kern/sys_pipe.c > > Modified: head/sys/kern/sys_pipe.c > ============================================================================== > --- head/sys/kern/sys_pipe.c Sun Feb 26 14:27:34 2012 (r232182) > +++ head/sys/kern/sys_pipe.c Sun Feb 26 15:14:29 2012 (r232183) > @@ -152,6 +152,8 @@ static fo_poll_t pipe_poll; > static fo_kqfilter_t pipe_kqfilter; > static fo_stat_t pipe_stat; > static fo_close_t pipe_close; > +static fo_chmod_t pipe_chmod; > +static fo_chown_t pipe_chown; > > struct fileops pipeops = { > .fo_read = pipe_read, > @@ -162,8 +164,8 @@ struct fileops pipeops = { > .fo_kqfilter = pipe_kqfilter, > .fo_stat = pipe_stat, > .fo_close = pipe_close, > - .fo_chmod = invfo_chmod, > - .fo_chown = invfo_chown, > + .fo_chmod = pipe_chmod, > + .fo_chown = pipe_chown, > .fo_flags = DFLAG_PASSABLE > }; > > @@ -1548,6 +1550,43 @@ pipe_close(fp, td) > return (0); > } > > +static int > +pipe_chmod(fp, mode, active_cred, td) > + struct file *fp; > + mode_t mode; > + struct ucred *active_cred; > + struct thread *td; > +{ > + struct pipe *cpipe; > + int error; > + > + cpipe = fp->f_data; > + if (cpipe->pipe_state & PIPE_NAMED) > + error = vn_chmod(fp, mode, active_cred, td); > + else > + error = invfo_chmod(fp, mode, active_cred, td); > + return (error); > +} > + > +static int > +pipe_chown(fp, uid, gid, active_cred, td) > + struct file *fp; > + uid_t uid; > + gid_t gid; > + struct ucred *active_cred; > + struct thread *td; > +{ > + struct pipe *cpipe; > + int error; > + > + cpipe = fp->f_data; > + if (cpipe->pipe_state & PIPE_NAMED) > + error = vn_chown(fp, uid, gid, active_cred, td); > + else > + error = invfo_chown(fp, uid, gid, active_cred, td); > + return (error); > +} > + > static void > pipe_free_kmem(cpipe) > struct pipe *cpipe; From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 19:50:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CB90106564A; Tue, 28 Feb 2012 19:50:15 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C4D58FC0C; Tue, 28 Feb 2012 19:50:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1SJoFuR085291; Tue, 28 Feb 2012 19:50:15 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1SJoFur085289; Tue, 28 Feb 2012 19:50:15 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201202281950.q1SJoFur085289@svn.freebsd.org> From: Ed Maste Date: Tue, 28 Feb 2012 19:50: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: r232268 - head/sys/dev/aac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Feb 2012 19:50:15 -0000 Author: emaste Date: Tue Feb 28 19:50:14 2012 New Revision: 232268 URL: http://svn.freebsd.org/changeset/base/232268 Log: Revert r232260. The problem is now fixed by a general workaround in r232267. Modified: head/sys/dev/aac/aac_pci.c Modified: head/sys/dev/aac/aac_pci.c ============================================================================== --- head/sys/dev/aac/aac_pci.c Tue Feb 28 19:42:40 2012 (r232267) +++ head/sys/dev/aac/aac_pci.c Tue Feb 28 19:50:14 2012 (r232268) @@ -403,8 +403,7 @@ aac_pci_attach(device_t dev) * Note that some of these controllers are 64-bit capable. */ if (bus_dma_tag_create(NULL, /* parent */ - PAGE_SIZE, /* alignment */ - ((bus_size_t)((uint64_t)1 << 32)), /* boundary*/ + PAGE_SIZE, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 20:56:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2ADD7106564A; Tue, 28 Feb 2012 20:56:01 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id DE5CF8FC08; Tue, 28 Feb 2012 20:56:00 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:40c7:bfc6:1449:f9dd] (unknown [IPv6:2001:7b8:3a7:0:40c7:bfc6:1449:f9dd]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 875A05C37; Tue, 28 Feb 2012 21:55:58 +0100 (CET) Message-ID: <4F4D3F5D.70905@FreeBSD.org> Date: Tue, 28 Feb 2012 21:55:57 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120216 Thunderbird/11.0 MIME-Version: 1.0 To: Tijl Coosemans References: <201202281939.q1SJdtYr084858@svn.freebsd.org> In-Reply-To: <201202281939.q1SJdtYr084858@svn.freebsd.org> X-Enigmail-Version: 1.4a1pre 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: r232266 - in head/sys: amd64/include i386/include pc98/include x86/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2012 20:56:01 -0000 On 2012-02-28 20:39, Tijl Coosemans wrote: > Author: tijl > Date: Tue Feb 28 19:39:54 2012 > New Revision: 232266 > URL: http://svn.freebsd.org/changeset/base/232266 > > Log: > Copy amd64 endian.h to x86 and merge with i386 endian.h. Replace > amd64/i386/pc98 endian.h with stubs. > > In __bswap64_const(x) the conflict between 0xffUL and 0xffULL has been > resolved by reimplementing the macro in terms of __bswap32(x). As a side > effect __bswap64_var(x) is now implemented using two bswap instructions on > i386 and should be much faster. __bswap32_const(x) has been reimplemented > in terms of __bswap16(x) for consistency. ... > +#define __bswap32_const(_x) \ > + (((__uint32_t)__bswap16(_x) << 16) | __bswap16((_x) >> 16)) > + > +#define __bswap32(_x) \ > + (__builtin_constant_p(_x) ? \ > + __bswap32_const((__uint32_t)(_x)) : __bswap32_var(_x)) > + > +#define __bswap64_const(_x) \ > + (((__uint64_t)__bswap32(_x) << 32) | __bswap32((_x) >> 32)) Hmm, shouldn't __bswap32_const() be implemented in terms of __bswap16_const(), and similarly for __bswap64_const(), which should be implemented in terms of __bswap32_const()? The whole reason for the difficult dance with __builtin_constant_p is to allow for compile-time resolving of bswap'd constants. Invoking the regular __bswap() macros doesn't gain you anything here. From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 20:56:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11F751065673; Tue, 28 Feb 2012 20:56:20 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) by mx1.freebsd.org (Postfix) with ESMTP id B94A38FC17; Tue, 28 Feb 2012 20:56:19 +0000 (UTC) Received: from slw by zxy.spb.ru with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1S2Tlb-000ETm-V8; Wed, 29 Feb 2012 00:35:23 +0400 Date: Wed, 29 Feb 2012 00:35:23 +0400 From: Slawa Olhovchenkov To: Luigi Rizzo Message-ID: <20120228203523.GB97848@zxy.spb.ru> References: <201202271905.q1RJ52Se032771@svn.freebsd.org> <20120228073122.GC57270@onelab2.iet.unipi.it> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120228073122.GC57270@onelab2.iet.unipi.it> User-Agent: Mutt/1.5.21 (2010-09-15) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false Cc: svn-src-head@freebsd.org, Luigi Rizzo , src-committers@freebsd.org, svn-src-all@freebsd.org, Ben Kaduk Subject: Re: svn commit: r232238 - in head: share/man/man4 sys/dev/e1000 sys/dev/ixgbe sys/dev/netmap sys/dev/re sys/net tools/tools/netmap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2012 20:56:20 -0000 On Tue, Feb 28, 2012 at 08:31:22AM +0100, Luigi Rizzo wrote: > On Mon, Feb 27, 2012 at 07:05:45PM -0500, Ben Kaduk wrote: > ... > > > ?1. add support for devices with different number of rx and tx queues; > > > > > > ?2. add better support for zero-copy operation, adding an extra field > > > ? ? to the netmap ring to indicate how many buffers we have already processed > > > ? ? but not yet released (with help from Eddie Kohler); > > > > > > ?3. The two changes above unfortunately require an API change, so while > > > ? ? at it add a version field and some spares to the ioctl() argument > > > ? ? to help detect mismatches. > > > > Is it worth bumping __FreeBSD_version? > > I don't think it is necessary. > There is basically no code that uses the netmap API except for > the examples in tools/tools/netmap, and i now have a NETMAP_API macro no code in *FreeBSD base system*, yes? because I am write tools uses the netmap API now. > that defines the version without the need for using __FreeBSD_version From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 21:32:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 350E5106564A; Tue, 28 Feb 2012 21:32:36 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay012.isp.belgacom.be (mailrelay012.isp.belgacom.be [195.238.6.179]) by mx1.freebsd.org (Postfix) with ESMTP id 2559F8FC16; Tue, 28 Feb 2012 21:32:34 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av8EAOhETU9bsWst/2dsb2JhbABDhSeuLIEIgXcBAQUjMxYKAxALDgYEKgICOR4GiB8Hpm2SGI0TDQ8CAj4UBgMChQgKPweCOoEWBKgw Received: from 45.107-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.107.45]) by relay.skynet.be with ESMTP; 28 Feb 2012 22:22:29 +0100 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.5/8.14.5) with ESMTP id q1SLMS6M006493; Tue, 28 Feb 2012 22:22:28 +0100 (CET) (envelope-from tijl@freebsd.org) From: Tijl Coosemans To: Dimitry Andric Date: Tue, 28 Feb 2012 22:22:20 +0100 User-Agent: KMail/1.13.7 (FreeBSD/10.0-CURRENT; KDE/4.7.3; i386; ; ) References: <201202281939.q1SJdtYr084858@svn.freebsd.org> <4F4D3F5D.70905@FreeBSD.org> In-Reply-To: <4F4D3F5D.70905@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1486186.v0UtTdUSRE"; protocol="application/pgp-signature"; micalg=pgp-sha256 Content-Transfer-Encoding: 7bit Message-Id: <201202282222.26343.tijl@freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232266 - in head/sys: amd64/include i386/include pc98/include x86/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2012 21:32:36 -0000 --nextPart1486186.v0UtTdUSRE Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Tuesday 28 February 2012 21:55:57 Dimitry Andric wrote: > On 2012-02-28 20:39, Tijl Coosemans wrote: >> Author: tijl >> Date: Tue Feb 28 19:39:54 2012 >> New Revision: 232266 >> URL: http://svn.freebsd.org/changeset/base/232266 >>=20 >> Log: >> Copy amd64 endian.h to x86 and merge with i386 endian.h. Replace >> amd64/i386/pc98 endian.h with stubs. >> =20 >> In __bswap64_const(x) the conflict between 0xffUL and 0xffULL has been >> resolved by reimplementing the macro in terms of __bswap32(x). As a si= de >> effect __bswap64_var(x) is now implemented using two bswap instruction= s on >> i386 and should be much faster. __bswap32_const(x) has been reimplemen= ted >> in terms of __bswap16(x) for consistency. > ... >> +#define __bswap32_const(_x) \ >> + (((__uint32_t)__bswap16(_x) << 16) | __bswap16((_x) >> 16)) >> + >> +#define __bswap32(_x) \ >> + (__builtin_constant_p(_x) ? \ >> + __bswap32_const((__uint32_t)(_x)) : __bswap32_var(_x)) >> + >> +#define __bswap64_const(_x) \ >> + (((__uint64_t)__bswap32(_x) << 32) | __bswap32((_x) >> 32)) >=20 > Hmm, shouldn't __bswap32_const() be implemented in terms of > __bswap16_const(), and similarly for __bswap64_const(), which should be > implemented in terms of __bswap32_const()? >=20 > The whole reason for the difficult dance with __builtin_constant_p is to > allow for compile-time resolving of bswap'd constants. Invoking the > regular __bswap() macros doesn't gain you anything here. __bswap64_const is also used in __bswap64_var, so its argument isn't always a compile time constant and then __bswap32 becomes __bswap32_var. If it is a constant __bswap32 becomes __bswap32_const (even at -O0). --nextPart1486186.v0UtTdUSRE Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iF4EABEIAAYFAk9NRZIACgkQfoCS2CCgtitN6AD8DQEnzXs8/yF/R0V/q8r/QqKT 4LPpT2qnabaPO9u4XPkA/2THbeoN9I7c1DAty5t4EBlZw31uf8dThiNUkl1d5HIq =XmI7 -----END PGP SIGNATURE----- --nextPart1486186.v0UtTdUSRE-- From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 21:40:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9250D106566B; Tue, 28 Feb 2012 21:40:43 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 4B37E8FC14; Tue, 28 Feb 2012 21:40:42 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 298627300A; Tue, 28 Feb 2012 22:58:56 +0100 (CET) Date: Tue, 28 Feb 2012 22:58:56 +0100 From: Luigi Rizzo To: Slawa Olhovchenkov Message-ID: <20120228215856.GA99692@onelab2.iet.unipi.it> References: <201202271905.q1RJ52Se032771@svn.freebsd.org> <20120228073122.GC57270@onelab2.iet.unipi.it> <20120228203523.GB97848@zxy.spb.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120228203523.GB97848@zxy.spb.ru> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, Luigi Rizzo , src-committers@freebsd.org, svn-src-all@freebsd.org, Ben Kaduk Subject: Re: svn commit: r232238 - in head: share/man/man4 sys/dev/e1000 sys/dev/ixgbe sys/dev/netmap sys/dev/re sys/net tools/tools/netmap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2012 21:40:43 -0000 On Wed, Feb 29, 2012 at 12:35:23AM +0400, Slawa Olhovchenkov wrote: ... > > > > ?3. The two changes above unfortunately require an API change, so while > > > > ? ? at it add a version field and some spares to the ioctl() argument > > > > ? ? to help detect mismatches. > > > > > > Is it worth bumping __FreeBSD_version? > > > > I don't think it is necessary. > > There is basically no code that uses the netmap API except for > > the examples in tools/tools/netmap, and i now have a NETMAP_API macro > > no code in *FreeBSD base system*, yes? > because I am write tools uses the netmap API now. i am glad to hear that, and the NETMAP_API will serve you well because you can use the same also on the Linux version of netmap cheers luigi From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 21:41:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8CA45106566B; Tue, 28 Feb 2012 21:41:48 +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 7C36A8FC08; Tue, 28 Feb 2012 21:41:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1SLfmrg093468; Tue, 28 Feb 2012 21:41:48 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1SLfmRx093466; Tue, 28 Feb 2012 21:41:48 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201202282141.q1SLfmRx093466@svn.freebsd.org> From: Adrian Chadd Date: Tue, 28 Feb 2012 21:41:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232269 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2012 21:41:48 -0000 Author: adrian Date: Tue Feb 28 21:41:47 2012 New Revision: 232269 URL: http://svn.freebsd.org/changeset/base/232269 Log: Print out the bogus beacon interval. Modified: head/sys/net80211/ieee80211_input.c Modified: head/sys/net80211/ieee80211_input.c ============================================================================== --- head/sys/net80211/ieee80211_input.c Tue Feb 28 19:50:14 2012 (r232268) +++ head/sys/net80211/ieee80211_input.c Tue Feb 28 21:41:47 2012 (r232269) @@ -652,7 +652,8 @@ ieee80211_parse_beacon(struct ieee80211_ scan->bintval <= IEEE80211_BINTVAL_MAX)) { IEEE80211_DISCARD(vap, IEEE80211_MSG_ELEMID | IEEE80211_MSG_INPUT, - wh, NULL, "bogus beacon interval", scan->bintval); + wh, NULL, "bogus beacon interval (%d TU)", + (int) scan->bintval); vap->iv_stats.is_rx_badbintval++; scan->status |= IEEE80211_BPARSE_BINTVAL_INVALID; } From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 21:43:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D681D106567B; Tue, 28 Feb 2012 21:43:29 +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 C61BE8FC0A; Tue, 28 Feb 2012 21:43:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1SLhTe1093551; Tue, 28 Feb 2012 21:43:29 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1SLhTFg093549; Tue, 28 Feb 2012 21:43:29 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201202282143.q1SLhTFg093549@svn.freebsd.org> From: Adrian Chadd Date: Tue, 28 Feb 2012 21:43: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: r232270 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2012 21:43:29 -0000 Author: adrian Date: Tue Feb 28 21:43:29 2012 New Revision: 232270 URL: http://svn.freebsd.org/changeset/base/232270 Log: Only increment is_beacon_bad if we're not scanning. Otherwise things such as off-channel probe responses and beacons are also silently discarded and logged against this error counter. Modified: head/sys/net80211/ieee80211_sta.c Modified: head/sys/net80211/ieee80211_sta.c ============================================================================== --- head/sys/net80211/ieee80211_sta.c Tue Feb 28 21:41:47 2012 (r232269) +++ head/sys/net80211/ieee80211_sta.c Tue Feb 28 21:43:29 2012 (r232270) @@ -1306,7 +1306,8 @@ sta_recv_mgmt(struct ieee80211_node *ni, } /* XXX probe response in sta mode when !scanning? */ if (ieee80211_parse_beacon(ni, m0, &scan) != 0) { - vap->iv_stats.is_beacon_bad++; + if (! (ic->ic_flags & IEEE80211_F_SCAN)) + vap->iv_stats.is_beacon_bad++; return; } /* From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 21:45:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18DAD106566C; Tue, 28 Feb 2012 21:45:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 089E58FC13; Tue, 28 Feb 2012 21:45:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1SLjLMP093660; Tue, 28 Feb 2012 21:45:21 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1SLjLpO093657; Tue, 28 Feb 2012 21:45:21 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201202282145.q1SLjLpO093657@svn.freebsd.org> From: Dimitry Andric Date: Tue, 28 Feb 2012 21:45: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: r232271 - 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, 28 Feb 2012 21:45:22 -0000 Author: dim Date: Tue Feb 28 21:45:21 2012 New Revision: 232271 URL: http://svn.freebsd.org/changeset/base/232271 Log: Change definition of pipe_chmod() from K&R to C99, to avoid the following clang warning: sys/kern/sys_pipe.c:1556:10: error: promoted type 'int' of K&R function parameter is not compatible with the parameter type 'mode_t' (aka 'unsigned short') declared in a previous prototype [-Werror] mode_t mode; ^ sys/kern/sys_pipe.c:155:19: note: previous declaration is here static fo_chmod_t pipe_chmod; ^ Modified: head/sys/kern/sys_pipe.c Modified: head/sys/kern/sys_pipe.c ============================================================================== --- head/sys/kern/sys_pipe.c Tue Feb 28 21:43:29 2012 (r232270) +++ head/sys/kern/sys_pipe.c Tue Feb 28 21:45:21 2012 (r232271) @@ -1551,11 +1551,7 @@ pipe_close(fp, td) } static int -pipe_chmod(fp, mode, active_cred, td) - struct file *fp; - mode_t mode; - struct ucred *active_cred; - struct thread *td; +pipe_chmod(struct file *fp, mode_t mode, struct ucred *active_cred, struct thread *td) { struct pipe *cpipe; int error; From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 21:53:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1AB9D106566B; Tue, 28 Feb 2012 21:53:40 +0000 (UTC) (envelope-from oleg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F3AAA8FC0A; Tue, 28 Feb 2012 21:53:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1SLrdqI093938; Tue, 28 Feb 2012 21:53:39 GMT (envelope-from oleg@svn.freebsd.org) Received: (from oleg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1SLrdfQ093936; Tue, 28 Feb 2012 21:53:39 GMT (envelope-from oleg@svn.freebsd.org) Message-Id: <201202282153.q1SLrdfQ093936@svn.freebsd.org> From: Oleg Bulyzhin Date: Tue, 28 Feb 2012 21:53: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: r232272 - head/sys/netinet/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: Tue, 28 Feb 2012 21:53:40 -0000 Author: oleg Date: Tue Feb 28 21:53:39 2012 New Revision: 232272 URL: http://svn.freebsd.org/changeset/base/232272 Log: lookup_dyn_rule_locked(): style(9) cleanup MFC after: 1 month Modified: head/sys/netinet/ipfw/ip_fw_dynamic.c Modified: head/sys/netinet/ipfw/ip_fw_dynamic.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_dynamic.c Tue Feb 28 21:45:21 2012 (r232271) +++ head/sys/netinet/ipfw/ip_fw_dynamic.c Tue Feb 28 21:53:39 2012 (r232272) @@ -390,72 +390,68 @@ ipfw_remove_dyn_children(struct ip_fw *r IPFW_DYN_UNLOCK(); } -/** - * lookup a dynamic rule, locked version +/* + * Lookup a dynamic rule, locked version. */ static ipfw_dyn_rule * lookup_dyn_rule_locked(struct ipfw_flow_id *pkt, int *match_direction, struct tcphdr *tcp) { /* - * stateful ipfw extensions. - * Lookup into dynamic session queue + * Stateful ipfw extensions. + * Lookup into dynamic session queue. */ #define MATCH_REVERSE 0 #define MATCH_FORWARD 1 #define MATCH_NONE 2 #define MATCH_UNKNOWN 3 int i, dir = MATCH_NONE; - ipfw_dyn_rule *prev, *q=NULL; + ipfw_dyn_rule *prev, *q = NULL; IPFW_DYN_LOCK_ASSERT(); if (V_ipfw_dyn_v == NULL) - goto done; /* not found */ - i = hash_packet( pkt ); - for (prev=NULL, q = V_ipfw_dyn_v[i] ; q != NULL ; ) { + goto done; /* not found */ + i = hash_packet(pkt); + for (prev = NULL, q = V_ipfw_dyn_v[i]; q != NULL;) { if (q->dyn_type == O_LIMIT_PARENT && q->count) goto next; - if (TIME_LEQ( q->expire, time_uptime)) { /* expire entry */ + if (TIME_LEQ(q->expire, time_uptime)) { /* expire entry */ UNLINK_DYN_RULE(prev, V_ipfw_dyn_v[i], q); continue; } - if (pkt->proto == q->id.proto && - q->dyn_type != O_LIMIT_PARENT) { - if (IS_IP6_FLOW_ID(pkt)) { - if (IN6_ARE_ADDR_EQUAL(&(pkt->src_ip6), - &(q->id.src_ip6)) && - IN6_ARE_ADDR_EQUAL(&(pkt->dst_ip6), - &(q->id.dst_ip6)) && + if (pkt->proto != q->id.proto || q->dyn_type == O_LIMIT_PARENT) + goto next; + + if (IS_IP6_FLOW_ID(pkt)) { + if (IN6_ARE_ADDR_EQUAL(&pkt->src_ip6, &q->id.src_ip6) && + IN6_ARE_ADDR_EQUAL(&pkt->dst_ip6, &q->id.dst_ip6) && pkt->src_port == q->id.src_port && - pkt->dst_port == q->id.dst_port ) { + pkt->dst_port == q->id.dst_port) { dir = MATCH_FORWARD; break; - } - if (IN6_ARE_ADDR_EQUAL(&(pkt->src_ip6), - &(q->id.dst_ip6)) && - IN6_ARE_ADDR_EQUAL(&(pkt->dst_ip6), - &(q->id.src_ip6)) && - pkt->src_port == q->id.dst_port && - pkt->dst_port == q->id.src_port ) { - dir = MATCH_REVERSE; - break; - } - } else { - if (pkt->src_ip == q->id.src_ip && - pkt->dst_ip == q->id.dst_ip && - pkt->src_port == q->id.src_port && - pkt->dst_port == q->id.dst_port ) { - dir = MATCH_FORWARD; - break; - } - if (pkt->src_ip == q->id.dst_ip && - pkt->dst_ip == q->id.src_ip && - pkt->src_port == q->id.dst_port && - pkt->dst_port == q->id.src_port ) { - dir = MATCH_REVERSE; - break; - } + } + if (IN6_ARE_ADDR_EQUAL(&pkt->src_ip6, &q->id.dst_ip6) && + IN6_ARE_ADDR_EQUAL(&pkt->dst_ip6, &q->id.src_ip6) && + pkt->src_port == q->id.dst_port && + pkt->dst_port == q->id.src_port) { + dir = MATCH_REVERSE; + break; + } + } else { + if (pkt->src_ip == q->id.src_ip && + pkt->dst_ip == q->id.dst_ip && + pkt->src_port == q->id.src_port && + pkt->dst_port == q->id.dst_port) { + dir = MATCH_FORWARD; + break; + } + if (pkt->src_ip == q->id.dst_ip && + pkt->dst_ip == q->id.src_ip && + pkt->src_port == q->id.dst_port && + pkt->dst_port == q->id.src_port) { + dir = MATCH_REVERSE; + break; } } next: @@ -463,43 +459,45 @@ next: q = q->next; } if (q == NULL) - goto done; /* q = NULL, not found */ + goto done; /* q = NULL, not found */ - if ( prev != NULL) { /* found and not in front */ + if (prev != NULL) { /* found and not in front */ prev->next = q->next; q->next = V_ipfw_dyn_v[i]; V_ipfw_dyn_v[i] = q; } if (pkt->proto == IPPROTO_TCP) { /* update state according to flags */ - u_char flags = pkt->_flags & (TH_FIN|TH_SYN|TH_RST); + uint32_t ack; + u_char flags = pkt->_flags & (TH_FIN | TH_SYN | TH_RST); #define BOTH_SYN (TH_SYN | (TH_SYN << 8)) #define BOTH_FIN (TH_FIN | (TH_FIN << 8)) - q->state |= (dir == MATCH_FORWARD ) ? flags : (flags << 8); + q->state |= (dir == MATCH_FORWARD) ? flags : (flags << 8); switch (q->state) { - case TH_SYN: /* opening */ + case TH_SYN: /* opening */ q->expire = time_uptime + V_dyn_syn_lifetime; break; case BOTH_SYN: /* move to established */ - case BOTH_SYN | TH_FIN : /* one side tries to close */ - case BOTH_SYN | (TH_FIN << 8) : - if (tcp) { + case BOTH_SYN | TH_FIN: /* one side tries to close */ + case BOTH_SYN | (TH_FIN << 8): #define _SEQ_GE(a,b) ((int)(a) - (int)(b) >= 0) - u_int32_t ack = ntohl(tcp->th_ack); - if (dir == MATCH_FORWARD) { + if (tcp == NULL) { + q->expire = time_uptime + V_dyn_ack_lifetime; + break; + } + + ack = ntohl(tcp->th_ack); + if (dir == MATCH_FORWARD) { if (q->ack_fwd == 0 || _SEQ_GE(ack, q->ack_fwd)) - q->ack_fwd = ack; - else { /* ignore out-of-sequence */ - break; - } - } else { + q->ack_fwd = ack; + else /* ignore out-of-sequence */ + break; + } else { if (q->ack_rev == 0 || _SEQ_GE(ack, q->ack_rev)) - q->ack_rev = ack; - else { /* ignore out-of-sequence */ - break; - } - } + q->ack_rev = ack; + else /* ignore out-of-sequence */ + break; } q->expire = time_uptime + V_dyn_ack_lifetime; break; @@ -531,9 +529,9 @@ next: q->expire = time_uptime + V_dyn_short_lifetime; } done: - if (match_direction) + if (match_direction != NULL) *match_direction = dir; - return q; + return (q); } ipfw_dyn_rule * From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 22:00:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDDF2106564A; Tue, 28 Feb 2012 22:00:41 +0000 (UTC) (envelope-from oleg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D2DDF8FC13; Tue, 28 Feb 2012 22:00:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1SM0f25094205; Tue, 28 Feb 2012 22:00:41 GMT (envelope-from oleg@svn.freebsd.org) Received: (from oleg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1SM0f5R094203; Tue, 28 Feb 2012 22:00:41 GMT (envelope-from oleg@svn.freebsd.org) Message-Id: <201202282200.q1SM0f5R094203@svn.freebsd.org> From: Oleg Bulyzhin Date: Tue, 28 Feb 2012 22:00: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: r232273 - head/sys/netinet/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: Tue, 28 Feb 2012 22:00:42 -0000 Author: oleg Date: Tue Feb 28 22:00:41 2012 New Revision: 232273 URL: http://svn.freebsd.org/changeset/base/232273 Log: - Refresh dynamic tcp rule only if both sides answered keepalive packets. - Remove some useless assignments. MFC after: 1 month Modified: head/sys/netinet/ipfw/ip_fw_dynamic.c Modified: head/sys/netinet/ipfw/ip_fw_dynamic.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_dynamic.c Tue Feb 28 21:53:39 2012 (r232272) +++ head/sys/netinet/ipfw/ip_fw_dynamic.c Tue Feb 28 22:00:41 2012 (r232273) @@ -472,8 +472,12 @@ next: #define BOTH_SYN (TH_SYN | (TH_SYN << 8)) #define BOTH_FIN (TH_FIN | (TH_FIN << 8)) +#define TCP_FLAGS (TH_FLAGS | (TH_FLAGS << 8)) +#define ACK_FWD 0x10000 /* fwd ack seen */ +#define ACK_REV 0x20000 /* rev ack seen */ + q->state |= (dir == MATCH_FORWARD) ? flags : (flags << 8); - switch (q->state) { + switch (q->state & TCP_FLAGS) { case TH_SYN: /* opening */ q->expire = time_uptime + V_dyn_syn_lifetime; break; @@ -482,24 +486,28 @@ next: case BOTH_SYN | TH_FIN: /* one side tries to close */ case BOTH_SYN | (TH_FIN << 8): #define _SEQ_GE(a,b) ((int)(a) - (int)(b) >= 0) - if (tcp == NULL) { - q->expire = time_uptime + V_dyn_ack_lifetime; + if (tcp == NULL) break; - } ack = ntohl(tcp->th_ack); if (dir == MATCH_FORWARD) { - if (q->ack_fwd == 0 || _SEQ_GE(ack, q->ack_fwd)) + if (q->ack_fwd == 0 || + _SEQ_GE(ack, q->ack_fwd)) { q->ack_fwd = ack; - else /* ignore out-of-sequence */ - break; + q->state |= ACK_FWD; + } } else { - if (q->ack_rev == 0 || _SEQ_GE(ack, q->ack_rev)) + if (q->ack_rev == 0 || + _SEQ_GE(ack, q->ack_rev)) { q->ack_rev = ack; - else /* ignore out-of-sequence */ - break; + q->state |= ACK_REV; + } + } + if ((q->state & (ACK_FWD | ACK_REV)) == + (ACK_FWD | ACK_REV)) { + q->expire = time_uptime + V_dyn_ack_lifetime; + q->state &= ~(ACK_FWD | ACK_REV); } - q->expire = time_uptime + V_dyn_ack_lifetime; break; case BOTH_SYN | BOTH_FIN: /* both sides closed */ @@ -1074,10 +1082,12 @@ ipfw_tick(void * vnetx) if (TIME_LEQ(q->expire, time_uptime)) continue; /* too late, rule expired */ - m = ipfw_send_pkt(NULL, &(q->id), q->ack_rev - 1, - q->ack_fwd, TH_SYN); - mnext = ipfw_send_pkt(NULL, &(q->id), q->ack_fwd - 1, - q->ack_rev, 0); + m = (q->state & ACK_REV) ? NULL : + ipfw_send_pkt(NULL, &(q->id), q->ack_rev - 1, + q->ack_fwd, TH_SYN); + mnext = (q->state & ACK_FWD) ? NULL : + ipfw_send_pkt(NULL, &(q->id), q->ack_fwd - 1, + q->ack_rev, 0); switch (q->id.addr_type) { case 4: @@ -1103,18 +1113,16 @@ ipfw_tick(void * vnetx) break; #endif } - - m = mnext = NULL; } } IPFW_DYN_UNLOCK(); - for (m = mnext = m0; m != NULL; m = mnext) { + for (m = m0; m != NULL; m = mnext) { mnext = m->m_nextpkt; m->m_nextpkt = NULL; ip_output(m, NULL, NULL, 0, NULL, NULL); } #ifdef INET6 - for (m = mnext = m6; m != NULL; m = mnext) { + for (m = m6; m != NULL; m = mnext) { mnext = m->m_nextpkt; m->m_nextpkt = NULL; ip6_output(m, NULL, NULL, 0, NULL, NULL, NULL); From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 22:04:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04421106566B; Tue, 28 Feb 2012 22:04:40 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 5D70C8FC1D; Tue, 28 Feb 2012 22:04:39 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 758227300B; Tue, 28 Feb 2012 23:22:52 +0100 (CET) Date: Tue, 28 Feb 2012 23:22:52 +0100 From: Luigi Rizzo To: Oleg Bulyzhin Message-ID: <20120228222252.GA801@onelab2.iet.unipi.it> References: <201202282153.q1SLrdfQ093936@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201202282153.q1SLrdfQ093936@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232272 - head/sys/netinet/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: Tue, 28 Feb 2012 22:04:40 -0000 On Tue, Feb 28, 2012 at 09:53:39PM +0000, Oleg Bulyzhin wrote: > Author: oleg > Date: Tue Feb 28 21:53:39 2012 > New Revision: 232272 > URL: http://svn.freebsd.org/changeset/base/232272 > > Log: > lookup_dyn_rule_locked(): style(9) cleanup > > MFC after: 1 month is there a reason for delaying the MFC, such as this is preparatory work for further changes ? Otherwise i'd suggest that whitespace changes like this are quickly pushed to the stable branch so that the code versions do not diverge. cheers luigi > Modified: > head/sys/netinet/ipfw/ip_fw_dynamic.c > > Modified: head/sys/netinet/ipfw/ip_fw_dynamic.c > ============================================================================== > --- head/sys/netinet/ipfw/ip_fw_dynamic.c Tue Feb 28 21:45:21 2012 (r232271) > +++ head/sys/netinet/ipfw/ip_fw_dynamic.c Tue Feb 28 21:53:39 2012 (r232272) > @@ -390,72 +390,68 @@ ipfw_remove_dyn_children(struct ip_fw *r > IPFW_DYN_UNLOCK(); > } > > -/** > - * lookup a dynamic rule, locked version > +/* > + * Lookup a dynamic rule, locked version. > */ > static ipfw_dyn_rule * > lookup_dyn_rule_locked(struct ipfw_flow_id *pkt, int *match_direction, > struct tcphdr *tcp) > { > /* > - * stateful ipfw extensions. > - * Lookup into dynamic session queue > + * Stateful ipfw extensions. > + * Lookup into dynamic session queue. > */ > #define MATCH_REVERSE 0 > #define MATCH_FORWARD 1 > #define MATCH_NONE 2 > #define MATCH_UNKNOWN 3 > int i, dir = MATCH_NONE; > - ipfw_dyn_rule *prev, *q=NULL; > + ipfw_dyn_rule *prev, *q = NULL; > > IPFW_DYN_LOCK_ASSERT(); > > if (V_ipfw_dyn_v == NULL) > - goto done; /* not found */ > - i = hash_packet( pkt ); > - for (prev=NULL, q = V_ipfw_dyn_v[i] ; q != NULL ; ) { > + goto done; /* not found */ > + i = hash_packet(pkt); > + for (prev = NULL, q = V_ipfw_dyn_v[i]; q != NULL;) { > if (q->dyn_type == O_LIMIT_PARENT && q->count) > goto next; > - if (TIME_LEQ( q->expire, time_uptime)) { /* expire entry */ > + if (TIME_LEQ(q->expire, time_uptime)) { /* expire entry */ > UNLINK_DYN_RULE(prev, V_ipfw_dyn_v[i], q); > continue; > } > - if (pkt->proto == q->id.proto && > - q->dyn_type != O_LIMIT_PARENT) { > - if (IS_IP6_FLOW_ID(pkt)) { > - if (IN6_ARE_ADDR_EQUAL(&(pkt->src_ip6), > - &(q->id.src_ip6)) && > - IN6_ARE_ADDR_EQUAL(&(pkt->dst_ip6), > - &(q->id.dst_ip6)) && > + if (pkt->proto != q->id.proto || q->dyn_type == O_LIMIT_PARENT) > + goto next; > + > + if (IS_IP6_FLOW_ID(pkt)) { > + if (IN6_ARE_ADDR_EQUAL(&pkt->src_ip6, &q->id.src_ip6) && > + IN6_ARE_ADDR_EQUAL(&pkt->dst_ip6, &q->id.dst_ip6) && > pkt->src_port == q->id.src_port && > - pkt->dst_port == q->id.dst_port ) { > + pkt->dst_port == q->id.dst_port) { > dir = MATCH_FORWARD; > break; > - } > - if (IN6_ARE_ADDR_EQUAL(&(pkt->src_ip6), > - &(q->id.dst_ip6)) && > - IN6_ARE_ADDR_EQUAL(&(pkt->dst_ip6), > - &(q->id.src_ip6)) && > - pkt->src_port == q->id.dst_port && > - pkt->dst_port == q->id.src_port ) { > - dir = MATCH_REVERSE; > - break; > - } > - } else { > - if (pkt->src_ip == q->id.src_ip && > - pkt->dst_ip == q->id.dst_ip && > - pkt->src_port == q->id.src_port && > - pkt->dst_port == q->id.dst_port ) { > - dir = MATCH_FORWARD; > - break; > - } > - if (pkt->src_ip == q->id.dst_ip && > - pkt->dst_ip == q->id.src_ip && > - pkt->src_port == q->id.dst_port && > - pkt->dst_port == q->id.src_port ) { > - dir = MATCH_REVERSE; > - break; > - } > + } > + if (IN6_ARE_ADDR_EQUAL(&pkt->src_ip6, &q->id.dst_ip6) && > + IN6_ARE_ADDR_EQUAL(&pkt->dst_ip6, &q->id.src_ip6) && > + pkt->src_port == q->id.dst_port && > + pkt->dst_port == q->id.src_port) { > + dir = MATCH_REVERSE; > + break; > + } > + } else { > + if (pkt->src_ip == q->id.src_ip && > + pkt->dst_ip == q->id.dst_ip && > + pkt->src_port == q->id.src_port && > + pkt->dst_port == q->id.dst_port) { > + dir = MATCH_FORWARD; > + break; > + } > + if (pkt->src_ip == q->id.dst_ip && > + pkt->dst_ip == q->id.src_ip && > + pkt->src_port == q->id.dst_port && > + pkt->dst_port == q->id.src_port) { > + dir = MATCH_REVERSE; > + break; > } > } > next: > @@ -463,43 +459,45 @@ next: > q = q->next; > } > if (q == NULL) > - goto done; /* q = NULL, not found */ > + goto done; /* q = NULL, not found */ > > - if ( prev != NULL) { /* found and not in front */ > + if (prev != NULL) { /* found and not in front */ > prev->next = q->next; > q->next = V_ipfw_dyn_v[i]; > V_ipfw_dyn_v[i] = q; > } > if (pkt->proto == IPPROTO_TCP) { /* update state according to flags */ > - u_char flags = pkt->_flags & (TH_FIN|TH_SYN|TH_RST); > + uint32_t ack; > + u_char flags = pkt->_flags & (TH_FIN | TH_SYN | TH_RST); > > #define BOTH_SYN (TH_SYN | (TH_SYN << 8)) > #define BOTH_FIN (TH_FIN | (TH_FIN << 8)) > - q->state |= (dir == MATCH_FORWARD ) ? flags : (flags << 8); > + q->state |= (dir == MATCH_FORWARD) ? flags : (flags << 8); > switch (q->state) { > - case TH_SYN: /* opening */ > + case TH_SYN: /* opening */ > q->expire = time_uptime + V_dyn_syn_lifetime; > break; > > case BOTH_SYN: /* move to established */ > - case BOTH_SYN | TH_FIN : /* one side tries to close */ > - case BOTH_SYN | (TH_FIN << 8) : > - if (tcp) { > + case BOTH_SYN | TH_FIN: /* one side tries to close */ > + case BOTH_SYN | (TH_FIN << 8): > #define _SEQ_GE(a,b) ((int)(a) - (int)(b) >= 0) > - u_int32_t ack = ntohl(tcp->th_ack); > - if (dir == MATCH_FORWARD) { > + if (tcp == NULL) { > + q->expire = time_uptime + V_dyn_ack_lifetime; > + break; > + } > + > + ack = ntohl(tcp->th_ack); > + if (dir == MATCH_FORWARD) { > if (q->ack_fwd == 0 || _SEQ_GE(ack, q->ack_fwd)) > - q->ack_fwd = ack; > - else { /* ignore out-of-sequence */ > - break; > - } > - } else { > + q->ack_fwd = ack; > + else /* ignore out-of-sequence */ > + break; > + } else { > if (q->ack_rev == 0 || _SEQ_GE(ack, q->ack_rev)) > - q->ack_rev = ack; > - else { /* ignore out-of-sequence */ > - break; > - } > - } > + q->ack_rev = ack; > + else /* ignore out-of-sequence */ > + break; > } > q->expire = time_uptime + V_dyn_ack_lifetime; > break; > @@ -531,9 +529,9 @@ next: > q->expire = time_uptime + V_dyn_short_lifetime; > } > done: > - if (match_direction) > + if (match_direction != NULL) > *match_direction = dir; > - return q; > + return (q); > } > > ipfw_dyn_rule * From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 22:11:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 225B1106566B; Tue, 28 Feb 2012 22:11:13 +0000 (UTC) (envelope-from giovanni.trematerra@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 AFEF58FC14; Tue, 28 Feb 2012 22:11:12 +0000 (UTC) Received: by qcsg15 with SMTP id g15so1826933qcs.13 for ; Tue, 28 Feb 2012 14:11:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=wP/NNCAWuMjx9qhUmBvUXhBSZ+9hu9w6fVegR4W4K1k=; b=C5gEOVtUWQPUbg0TCzFrjxa6q6frfPOjqFq0BAroeeCXRgfOJrw5xXCA1ypAnNGKiM PkKO+yZBRw1G5+iPEVIIrt3KfBHiNUR+QKcLKqfTO9IAu/N6uP378aab6XF70otKjaQE mMQU1vL/tsUzb2G/xWy5EER9C3jJm1M3BgjEc= MIME-Version: 1.0 Received: by 10.229.102.101 with SMTP id f37mr6966639qco.37.1330467072127; Tue, 28 Feb 2012 14:11:12 -0800 (PST) Received: by 10.229.86.200 with HTTP; Tue, 28 Feb 2012 14:11:12 -0800 (PST) In-Reply-To: <201202282145.q1SLjLpO093657@svn.freebsd.org> References: <201202282145.q1SLjLpO093657@svn.freebsd.org> Date: Tue, 28 Feb 2012 23:11:12 +0100 Message-ID: From: Giovanni Trematerra To: Dimitry Andric Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r232271 - 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, 28 Feb 2012 22:11:13 -0000 On Tue, Feb 28, 2012 at 10:45 PM, Dimitry Andric wrote: > Author: dim > Date: Tue Feb 28 21:45:21 2012 > New Revision: 232271 > URL: http://svn.freebsd.org/changeset/base/232271 > > Log: > =A0Change definition of pipe_chmod() from K&R to C99, to avoid the > =A0following clang warning: > > =A0sys/kern/sys_pipe.c:1556:10: error: promoted type 'int' of K&R functio= n parameter is not compatible with the parameter type 'mode_t' > =A0 =A0 =A0 =A0(aka 'unsigned short') declared in a previous prototype [-= Werror] > =A0 =A0 =A0 =A0 =A0mode_t mode; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ^ > =A0sys/kern/sys_pipe.c:155:19: note: previous declaration is here > =A0static fo_chmod_t =A0 =A0 =A0 pipe_chmod; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0^ > > Modified: > =A0head/sys/kern/sys_pipe.c > > Modified: head/sys/kern/sys_pipe.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/kern/sys_pipe.c =A0 =A0Tue Feb 28 21:43:29 2012 =A0 =A0 =A0 = =A0(r232270) > +++ head/sys/kern/sys_pipe.c =A0 =A0Tue Feb 28 21:45:21 2012 =A0 =A0 =A0 = =A0(r232271) > @@ -1551,11 +1551,7 @@ pipe_close(fp, td) > =A0} > > =A0static int > -pipe_chmod(fp, mode, active_cred, td) > - =A0 =A0 =A0 struct file *fp; > - =A0 =A0 =A0 mode_t mode; > - =A0 =A0 =A0 struct ucred *active_cred; > - =A0 =A0 =A0 struct thread *td; > +pipe_chmod(struct file *fp, mode_t mode, struct ucred *active_cred, stru= ct thread *td) > =A0{ > =A0 =A0 =A0 =A0struct pipe *cpipe; > =A0 =A0 =A0 =A0int error; Thank you. It introduces a style(9) violation, though. I think it should be in this way pipe_chmod(struct file *fp, mode_t mode, struct ucred *active_cred, struct thread *td) Anyway that's not a problem I can take care of this and other style violati= ons during next weeks. -- Gianni From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 22:15:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47BAF106564A; Tue, 28 Feb 2012 22:15:47 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3714E8FC16; Tue, 28 Feb 2012 22:15:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1SMFlIA094682; Tue, 28 Feb 2012 22:15:47 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1SMFlDB094680; Tue, 28 Feb 2012 22:15:47 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201202282215.q1SMFlDB094680@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 28 Feb 2012 22:15:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232274 - head/usr.bin/fetch X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages 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, 28 Feb 2012 22:15:47 -0000 Author: obrien Date: Tue Feb 28 22:15:46 2012 New Revision: 232274 URL: http://svn.freebsd.org/changeset/base/232274 Log: Document the 'URL' argument. Modified: head/usr.bin/fetch/fetch.1 Modified: head/usr.bin/fetch/fetch.1 ============================================================================== --- head/usr.bin/fetch/fetch.1 Tue Feb 28 22:00:41 2012 (r232273) +++ head/usr.bin/fetch/fetch.1 Tue Feb 28 22:15:46 2012 (r232274) @@ -1,5 +1,5 @@ .\"- -.\" Copyright (c) 2000-2011 Dag-Erling Smørgrav +.\" Copyright (c) 2000-2012 Dag-Erling Smørgrav .\" All rights reserved. .\" Portions Copyright (c) 1999 Massachusetts Institute of Technology; used .\" by permission. @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 27, 2011 +.Dd February 28, 2012 .Dt FETCH 1 .Os .Sh NAME @@ -214,6 +214,11 @@ When the flag is specified, wait this many seconds between successive retries. .El .Pp +.Ar URL +.Bd -literal + :(//((:)?@)?(:)?)?/()? +.Ed +.Pp If .Nm receives a From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 22:17:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 815BE1065670; Tue, 28 Feb 2012 22:17:53 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6EEE28FC1C; Tue, 28 Feb 2012 22:17:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1SMHrwA094785; Tue, 28 Feb 2012 22:17:53 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1SMHrIk094780; Tue, 28 Feb 2012 22:17:53 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201202282217.q1SMHrIk094780@svn.freebsd.org> From: Tijl Coosemans Date: Tue, 28 Feb 2012 22:17: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: r232275 - in head/sys: amd64/include i386/include pc98/include x86/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2012 22:17:53 -0000 Author: tijl Date: Tue Feb 28 22:17:52 2012 New Revision: 232275 URL: http://svn.freebsd.org/changeset/base/232275 Log: Copy amd64 setjmp.h to x86 and replace amd64/i386/pc98 setjmp.h with stubs. Added: head/sys/x86/include/setjmp.h - copied unchanged from r232268, head/sys/amd64/include/setjmp.h Modified: head/sys/amd64/include/setjmp.h head/sys/i386/include/setjmp.h head/sys/pc98/include/setjmp.h Modified: head/sys/amd64/include/setjmp.h ============================================================================== --- head/sys/amd64/include/setjmp.h Tue Feb 28 22:15:46 2012 (r232274) +++ head/sys/amd64/include/setjmp.h Tue Feb 28 22:17:52 2012 (r232275) @@ -1,50 +1,6 @@ /*- - * Copyright (c) 1998 John Birrell . - * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE_SETJMP_H_ -#define _MACHINE_SETJMP_H_ - -#include - -#define _JBLEN 12 /* Size of the jmp_buf on AMD64. */ - -/* - * jmp_buf and sigjmp_buf are encapsulated in different structs to force - * compile-time diagnostics for mismatches. The structs are the same - * internally to avoid some run-time errors for mismatches. - */ -#if __BSD_VISIBLE || __POSIX_VISIBLE || __XSI_VISIBLE -typedef struct _sigjmp_buf { long _sjb[_JBLEN]; } sigjmp_buf[1]; -#endif - -typedef struct _jmp_buf { long _jb[_JBLEN]; } jmp_buf[1]; - -#endif /* !_MACHINE_SETJMP_H_ */ +#include Modified: head/sys/i386/include/setjmp.h ============================================================================== --- head/sys/i386/include/setjmp.h Tue Feb 28 22:15:46 2012 (r232274) +++ head/sys/i386/include/setjmp.h Tue Feb 28 22:17:52 2012 (r232275) @@ -1,50 +1,6 @@ /*- - * Copyright (c) 1998 John Birrell . - * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE_SETJMP_H_ -#define _MACHINE_SETJMP_H_ - -#include - -#define _JBLEN 11 /* Size of the jmp_buf on x86. */ - -/* - * jmp_buf and sigjmp_buf are encapsulated in different structs to force - * compile-time diagnostics for mismatches. The structs are the same - * internally to avoid some run-time errors for mismatches. - */ -#if __BSD_VISIBLE || __POSIX_VISIBLE || __XSI_VISIBLE -typedef struct _sigjmp_buf { int _sjb[_JBLEN + 1]; } sigjmp_buf[1]; -#endif - -typedef struct _jmp_buf { int _jb[_JBLEN + 1]; } jmp_buf[1]; - -#endif /* !_MACHINE_SETJMP_H_ */ +#include Modified: head/sys/pc98/include/setjmp.h ============================================================================== --- head/sys/pc98/include/setjmp.h Tue Feb 28 22:15:46 2012 (r232274) +++ head/sys/pc98/include/setjmp.h Tue Feb 28 22:17:52 2012 (r232275) @@ -3,4 +3,4 @@ */ /* $FreeBSD$ */ -#include +#include Copied: head/sys/x86/include/setjmp.h (from r232268, head/sys/amd64/include/setjmp.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/x86/include/setjmp.h Tue Feb 28 22:17:52 2012 (r232275, copy of r232268, head/sys/amd64/include/setjmp.h) @@ -0,0 +1,50 @@ +/*- + * Copyright (c) 1998 John Birrell . + * 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. + * 3. Neither the name of the author nor the names of any co-contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _MACHINE_SETJMP_H_ +#define _MACHINE_SETJMP_H_ + +#include + +#define _JBLEN 12 /* Size of the jmp_buf on AMD64. */ + +/* + * jmp_buf and sigjmp_buf are encapsulated in different structs to force + * compile-time diagnostics for mismatches. The structs are the same + * internally to avoid some run-time errors for mismatches. + */ +#if __BSD_VISIBLE || __POSIX_VISIBLE || __XSI_VISIBLE +typedef struct _sigjmp_buf { long _sjb[_JBLEN]; } sigjmp_buf[1]; +#endif + +typedef struct _jmp_buf { long _jb[_JBLEN]; } jmp_buf[1]; + +#endif /* !_MACHINE_SETJMP_H_ */ From owner-svn-src-all@FreeBSD.ORG Tue Feb 28 22:30:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4AA3F106564A; Tue, 28 Feb 2012 22:30:59 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37DB58FC13; Tue, 28 Feb 2012 22:30:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1SMUxpl095215; Tue, 28 Feb 2012 22:30:59 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1SMUwAb095210; Tue, 28 Feb 2012 22:30:58 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201202282230.q1SMUwAb095210@svn.freebsd.org> From: Tijl Coosemans Date: Tue, 28 Feb 2012 22:30: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: r232276 - in head/sys: amd64/include i386/include pc98/include x86/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Feb 2012 22:30:59 -0000 Author: tijl Date: Tue Feb 28 22:30:58 2012 New Revision: 232276 URL: http://svn.freebsd.org/changeset/base/232276 Log: Copy amd64 stdarg.h to x86 and replace amd64/i386/pc98 stdarg.h with stubs. Added: head/sys/x86/include/stdarg.h - copied unchanged from r232268, head/sys/amd64/include/stdarg.h Modified: head/sys/amd64/include/stdarg.h head/sys/i386/include/stdarg.h head/sys/pc98/include/stdarg.h Modified: head/sys/amd64/include/stdarg.h ============================================================================== --- head/sys/amd64/include/stdarg.h Tue Feb 28 22:17:52 2012 (r232275) +++ head/sys/amd64/include/stdarg.h Tue Feb 28 22:30:58 2012 (r232276) @@ -1,75 +1,6 @@ /*- - * Copyright (c) 2002 David E. O'Brien. 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. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE 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$ + * This file is in the public domain. */ +/* $FreeBSD$ */ -#ifndef _MACHINE_STDARG_H_ -#define _MACHINE_STDARG_H_ - -#include -#include - -#ifndef _VA_LIST_DECLARED -#define _VA_LIST_DECLARED -typedef __va_list va_list; -#endif - -#ifdef __GNUCLIKE_BUILTIN_STDARG - -#define va_start(ap, last) \ - __builtin_va_start((ap), (last)) - -#define va_arg(ap, type) \ - __builtin_va_arg((ap), type) - -#define __va_copy(dest, src) \ - __builtin_va_copy((dest), (src)) - -#if __ISO_C_VISIBLE >= 1999 -#define va_copy(dest, src) \ - __va_copy(dest, src) -#endif - -#define va_end(ap) \ - __builtin_va_end(ap) - -#elif defined(lint) -/* Provide a fake implementation for lint's benefit */ -#define __va_size(type) \ - (((sizeof(type) + sizeof(long) - 1) / sizeof(long)) * sizeof(long)) -#define va_start(ap, last) \ - ((ap) = (va_list)&(last) + __va_size(last)) -#define va_arg(ap, type) \ - (*(type *)((ap) += __va_size(type), (ap) - __va_size(type))) -#define va_end(ap) - -#else -#error this file needs to be ported to your compiler -#endif - -#endif /* !_MACHINE_STDARG_H_ */ +#include Modified: head/sys/i386/include/stdarg.h ============================================================================== --- head/sys/i386/include/stdarg.h Tue Feb 28 22:17:52 2012 (r232275) +++ head/sys/i386/include/stdarg.h Tue Feb 28 22:30:58 2012 (r232276) @@ -1,90 +1,6 @@ /*- - * Copyright (c) 2002 David E. O'Brien. All rights reserved. - * Copyright (c) 1991, 1993 - * The Regents of the University of California. 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. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endors